]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/gdsys/intip/intip.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / board / gdsys / intip / intip.c
index 2cd2e6d4503741504cf19ddee6db8715acd72194..ee6f9e06c354d526534fd542e287a2e281b376cc 100644 (file)
@@ -6,24 +6,11 @@
  * (C) Copyright 2008
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
-#include <ppc440.h>
+#include <asm/ppc440.h>
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <i2c.h>
@@ -31,7 +18,7 @@
 #include <asm/io.h>
 #include <asm/mmu.h>
 #include <asm/4xx_pcie.h>
-#include <asm/gpio.h>
+#include <asm/ppc4xx-gpio.h>
 
 extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];
 
@@ -124,7 +111,8 @@ int get_cpu_num(void)
 
 int checkboard(void)
 {
-       char *s = getenv("serial#");
+       char buf[64];
+       int i = getenv_f("serial#", buf, sizeof(buf));
 
 #ifdef CONFIG_DEVCONCENTER
        printf("Board: DevCon-Center");
@@ -132,73 +120,15 @@ int checkboard(void)
        printf("Board: Intip");
 #endif
 
-       if (s != NULL) {
+       if (i > 0) {
                puts(", serial# ");
-               puts(s);
+               puts(buf);
        }
        putc('\n');
 
        return 0;
 }
 
-/*
- *  pci_target_init
- *
- *     The bootstrap configuration provides default settings for the pci
- *     inbound map (PIM). But the bootstrap config choices are limited and
- *     may not be sufficient for a given board.
- */
-#if defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT)
-void pci_target_init(struct pci_controller *hose)
-{
-       /*
-        * Disable everything
-        */
-       out_le32((void *)PCIX0_PIM0SA, 0); /* disable */
-       out_le32((void *)PCIX0_PIM1SA, 0); /* disable */
-       out_le32((void *)PCIX0_PIM2SA, 0); /* disable */
-       out_le32((void *)PCIX0_EROMBA, 0); /* disable expansion rom */
-
-       /*
-        * Map all of SDRAM to PCI address 0x0000_0000. Note that the 440
-        * strapping options to not support sizes such as 128/256 MB.
-        */
-       out_le32((void *)PCIX0_PIM0LAL, CONFIG_SYS_SDRAM_BASE);
-       out_le32((void *)PCIX0_PIM0LAH, 0);
-       out_le32((void *)PCIX0_PIM0SA, ~(gd->ram_size - 1) | 1);
-       out_le32((void *)PCIX0_BAR0, 0);
-
-       /*
-        * Program the board's subsystem id/vendor id
-        */
-       out_le16((void *)PCIX0_SBSYSVID, CONFIG_SYS_PCI_SUBSYS_VENDORID);
-       out_le16((void *)PCIX0_SBSYSID, CONFIG_SYS_PCI_SUBSYS_DEVICEID);
-
-       out_le16((void *)PCIX0_CMD, in16r(PCIX0_CMD) | PCI_COMMAND_MEMORY);
-}
-#endif /* defined(CONFIG_PCI) && defined(CONFIG_SYS_PCI_TARGET_INIT) */
-
-#if defined(CONFIG_PCI)
-/*
- * is_pci_host
- *
- * This routine is called to determine if a pci scan should be
- * performed. With various hardware environments (especially cPCI and
- * PPMC) it's insufficient to depend on the state of the arbiter enable
- * bit in the strap register, or generic host/adapter assumptions.
- *
- * Rather than hard-code a bad assumption in the general 440 code, the
- * 440 pci code requires the board to decide at runtime.
- *
- * Return 0 for adapter mode, non-zero for host (monarch) mode.
- */
-int is_pci_host(struct pci_controller *hose)
-{
-       /* Board is always configured as host. */
-       return 1;
-}
-#endif /* CONFIG_PCI */
-
 int board_early_init_r(void)
 {
        /*