]> git.sur5r.net Git - u-boot/blobdiff - arch/powerpc/lib/board.c
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
[u-boot] / arch / powerpc / lib / board.c
index 7daffcec3afc7c0a90a8fae10a92bdfd3b08ec87..07feaf55fc2290f56fa628e48a6a791eed22894f 100644 (file)
@@ -345,6 +345,13 @@ ulong get_effective_memsize(void)
 #endif
 }
 
+int __fixup_cpu(void)
+{
+       return 0;
+}
+
+int fixup_cpu(void) __attribute__((weak, alias("__fixup_cpu")));
+
 /*
  * This is the first part of the initialization sequence that is
  * implemented in C, but still running from ROM.
@@ -521,9 +528,8 @@ void board_init_f(ulong bootflag)
        addr_sp -= 16;
        addr_sp &= ~0xF;
        s = (ulong *) addr_sp;
-       *s-- = 0;
-       *s-- = 0;
-       addr_sp = (ulong) s;
+       *s = 0; /* Terminate back chain */
+       *++s = 0; /* NULL return address */
        debug("Stack Pointer at: %08lx\n", addr_sp);
 
        /*
@@ -647,6 +653,12 @@ void board_init_r(gd_t *id, ulong dest_addr)
         * We need to update it to point to the same CPU entry in RAM.
         */
        gd->cpu += dest_addr - CONFIG_SYS_MONITOR_BASE;
+
+       /*
+        * If we didn't know the cpu mask & # cores, we can save them of
+        * now rather than 'computing' them constantly
+        */
+       fixup_cpu();
 #endif
 
 #ifdef CONFIG_SYS_EXTRA_ENV_RELOC
@@ -932,14 +944,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
        /* Initialize from environment */
        load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-       {
-               char *s = getenv("bootfile");
-
-               if (s != NULL)
-                       copy_filename(BootFile, s, sizeof(BootFile));
-       }
-#endif
 
        WATCHDOG_RESET();