]> git.sur5r.net Git - u-boot/blobdiff - cpu/ppc4xx/cpu.c
Merge branch 'asm-generic' of git://git.denx.de/u-boot-microblaze
[u-boot] / cpu / ppc4xx / cpu.c
index bc9335a05ea71a617c4bce2b6d163b4a79416625..fb3837c3df7befa480a7fc2ad30b180e41c49019 100644 (file)
 #include <command.h>
 #include <asm/cache.h>
 #include <ppc4xx.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 void board_reset(void);
 
+/*
+ * To provide an interface to detect CPU number for boards that support
+ * more then one CPU, we implement the "weak" default functions here.
+ *
+ * Returns CPU number
+ */
+int __get_cpu_num(void)
+{
+       return NA_OR_UNKNOWN_CPU;
+}
+int get_cpu_num(void) __attribute__((weak, alias("__get_cpu_num")));
+
+#if defined(CONFIG_PCI)
 #if defined(CONFIG_405GP) || \
     defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
     defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
@@ -63,6 +77,7 @@ static int pci_async_enabled(void)
 #endif
 }
 #endif
+#endif /* CONFIG_PCI */
 
 #if defined(CONFIG_PCI) && !defined(CONFIG_IOP480) && \
     !defined(CONFIG_405) && !defined(CONFIG_405EX)
@@ -274,8 +289,13 @@ int checkcpu (void)
 #if !defined(CONFIG_IOP480)
        char addstr[64] = "";
        sys_info_t sys_info;
+       int cpu_num;
 
-       puts ("CPU:   ");
+       cpu_num = get_cpu_num();
+       if (cpu_num >= 0)
+               printf("CPU%d:  ", cpu_num);
+       else
+               puts("CPU:   ");
 
        get_sys_info(&sys_info);
 
@@ -568,14 +588,18 @@ int checkcpu (void)
 #endif /* I2C_BOOTROM */
 #if defined(SDR0_PINSTP_SHIFT)
        printf ("       Bootstrap Option %c - ", bootstrap_char[bootstrap_option()]);
-       printf ("Boot ROM Location %s\n", bootstrap_str[bootstrap_option()]);
+       printf ("Boot ROM Location %s", bootstrap_str[bootstrap_option()]);
+#ifdef CONFIG_NAND_U_BOOT
+       puts(", booting from NAND");
+#endif /* CONFIG_NAND_U_BOOT */
+       putc('\n');
 #endif /* SDR0_PINSTP_SHIFT */
 
 #if defined(CONFIG_PCI) && !defined(CONFIG_405EX)
        printf ("       Internal PCI arbiter %sabled", pci_arbiter_enabled() ? "en" : "dis");
 #endif
 
-#if defined(PCI_ASYNC)
+#if defined(CONFIG_PCI) && defined(PCI_ASYNC)
        if (pci_async_enabled()) {
                printf (", PCI async ext clock used");
        } else {
@@ -629,14 +653,14 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 #if defined(CONFIG_BOARD_RESET)
        board_reset();
 #else
-#if defined(CFG_4xx_RESET_TYPE)
-       mtspr(dbcr0, CFG_4xx_RESET_TYPE << 28);
+#if defined(CONFIG_SYS_4xx_RESET_TYPE)
+       mtspr(dbcr0, CONFIG_SYS_4xx_RESET_TYPE << 28);
 #else
        /*
         * Initiate system reset in debug control register DBCR
         */
        mtspr(dbcr0, 0x30000000);
-#endif /* defined(CFG_4xx_RESET_TYPE) */
+#endif /* defined(CONFIG_SYS_4xx_RESET_TYPE) */
 #endif /* defined(CONFIG_BOARD_RESET) */
 
        return 1;
@@ -676,3 +700,15 @@ void reset_4xx_watchdog(void)
        mtspr(tsr, 0x40000000);
 }
 #endif /* CONFIG_WATCHDOG */
+
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
+ */
+int cpu_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_PPC4xx_EMAC)
+       ppc_4xx_eth_initialize(bis);
+#endif
+       return 0;
+}