]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
powerpc/lib/board.c: Call run_post(POST_ROM) before relocating
authorBernhard Kaindl <bernhard.kaindl@thalesgroup.com>
Sun, 16 Oct 2011 00:07:08 +0000 (00:07 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 23 Oct 2011 21:34:19 +0000 (23:34 +0200)
The call to run_post(POST_ROM) which can run the POST memory test
is currently called too late when gd has already been copied to DRAM.

This results in failure to boot Linux after a POST_ROM memory test
tested all RAM while gd was already relocated to DRAM due to gd being
overwritten by the POST_ROM memory test.

Support this by moving the call to run_post(POST_ROM) to run earlier,
before U-Boot has started to move data to DRAM (from late board_init_f
to early board_init_f) where DRAM is initialized, but not used yet.

This allows that an POST memory test can test the whole DRAM,
including the area where the board info struct is located.

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@thalesgroup.com>
Cc: Pieter Voorthuijsen <pieter.voorthuijsen@prodrive.nl>
arch/powerpc/lib/board.c

index f7325c8bfd069efc8b0db8ed1efffd2ea67be4ae..6cb0ed63444e55a8c131f2a92b9c3b718f183cb8 100644 (file)
@@ -390,6 +390,13 @@ void board_init_f (ulong bootflag)
                }
        }
 
+#ifdef CONFIG_POST
+       post_bootmode_init();
+       post_run(NULL, POST_ROM | post_bootmode_get(0));
+#endif
+
+       WATCHDOG_RESET();
+
        /*
         * Now that we have DRAM mapped and working, we can
         * relocate the code and continue running from DRAM.
@@ -596,13 +603,6 @@ void board_init_f (ulong bootflag)
 
        WATCHDOG_RESET ();
 
-#ifdef CONFIG_POST
-       post_bootmode_init();
-       post_run (NULL, POST_ROM | post_bootmode_get(0));
-#endif
-
-       WATCHDOG_RESET();
-
        gd->relocaddr = addr; /* Record relocation address, useful for debug */
 
        memcpy (id, (void *)gd, sizeof (gd_t));