]> git.sur5r.net Git - u-boot/blobdiff - arch/powerpc/lib/board.c
net: drop !NET_MULTI code
[u-boot] / arch / powerpc / lib / board.c
index b21c1d6ff0bbb98498ccf8c3f5924a03edaf6a18..4fd01498052331b41d4e73a991d1cd43782f7dc4 100644 (file)
@@ -123,7 +123,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #endif
 
 extern ulong __init_end;
-extern ulong _end;
+extern ulong __bss_end__;
 ulong monitor_flash_len;
 
 #if defined(CONFIG_CMD_BEDBUG)
@@ -186,6 +186,12 @@ int __board_flash_wp_on(void)
 }
 int board_flash_wp_on(void) __attribute__((weak, alias("__board_flash_wp_on")));
 
+void __cpu_secondary_init_r(void)
+{
+}
+void cpu_secondary_init_r(void)
+__attribute__((weak, alias("__cpu_secondary_init_r")));
+
 static int init_func_ram (void)
 {
 #ifdef CONFIG_BOARD_TYPES
@@ -403,7 +409,7 @@ void board_init_f (ulong bootflag)
         *  - monitor code
         *  - board info struct
         */
-       len = (ulong)&_end - CONFIG_SYS_MONITOR_BASE;
+       len = (ulong)&__bss_end__ - CONFIG_SYS_MONITOR_BASE;
 
        /*
         * Subtract specified amount of memory to hide so that it won't
@@ -453,9 +459,13 @@ void board_init_f (ulong bootflag)
        debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
 
 #ifdef CONFIG_LCD
+#ifdef CONFIG_FB_ADDR
+       gd->fb_base = CONFIG_FB_ADDR;
+#else
        /* reserve memory for LCD display (always full pages) */
        addr = lcd_setmem (addr);
        gd->fb_base = addr;
+#endif /* CONFIG_FB_ADDR */
 #endif /* CONFIG_LCD */
 
 #if defined(CONFIG_VIDEO) && defined(CONFIG_8xx)
@@ -645,6 +655,17 @@ void board_init_r (gd_t *id, ulong dest_addr)
        gd->cpu += dest_addr - CONFIG_SYS_MONITOR_BASE;
 #endif
 
+#ifdef CONFIG_SYS_EXTRA_ENV_RELOC
+       /*
+        * Some systems need to relocate the env_addr pointer early because the
+        * location it points to will get invalidated before env_relocate is
+        * called.  One example is on systems that might use a L2 or L3 cache
+        * in SRAM mode and initialize that cache from SRAM mode back to being
+        * a cache in cpu_init_r.
+        */
+       gd->env_addr += dest_addr - CONFIG_SYS_MONITOR_BASE;
+#endif
+
 #ifdef CONFIG_SERIAL_MULTI
        serial_initialize();
 #endif
@@ -706,7 +727,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN);
 
 #if !defined(CONFIG_SYS_NO_FLASH)
-       puts ("FLASH: ");
+       puts ("Flash: ");
 
        if (board_flash_wp_on()) {
                printf("Uninitialized - Write Protect On\n");
@@ -786,6 +807,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
        /* relocate environment function pointers etc. */
        env_relocate ();
 
+       /*
+        * after non-volatile devices & environment is setup and cpu code have
+        * another round to deal with any initialization that might require
+        * full access to the environment or loading of some image (firmware)
+        * from a non-volatile device
+        */
+       cpu_secondary_init_r();
+
        /*
         * Fill in missing fields of bd_info.
         * We do this here, where we have "normal" access to the
@@ -903,8 +932,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        udelay (20);
 
-       set_timer (0);
-
        /* Initialize from environment */
        if ((s = getenv ("loadaddr")) != NULL) {
                load_addr = simple_strtoul (s, NULL, 16);
@@ -917,9 +944,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        WATCHDOG_RESET ();
 
-#if defined(CONFIG_DTT)                /* Digital Thermometers and Thermostats */
-       dtt_init ();
-#endif
 #if defined(CONFIG_CMD_SCSI)
        WATCHDOG_RESET ();
        puts ("SCSI:  ");
@@ -936,10 +960,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
        bb_miiphy_init();
 #endif
 #if defined(CONFIG_CMD_NET)
-#if defined(CONFIG_NET_MULTI)
        WATCHDOG_RESET ();
        puts ("Net:   ");
-#endif
        eth_initialize (bd);
 #endif