Commit 9d256b67 authored by Bernhard Kaindl's avatar Bernhard Kaindl Committed by Wolfgang Denk
Browse files

powerpc/lib/board.c: Call run_post(POST_ROM) before relocating

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: default avatarBernhard Kaindl <>
Cc: Pieter Voorthuijsen <>
parent 6dc809f4
......@@ -390,6 +390,13 @@ void board_init_f (ulong bootflag)
post_run(NULL, POST_ROM | post_bootmode_get(0));
* 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)
post_run (NULL, POST_ROM | post_bootmode_get(0));
gd->relocaddr = addr; /* Record relocation address, useful for debug */
memcpy (id, (void *)gd, sizeof (gd_t));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment