Re: [U-Boot] [PATCH] powerpc/lib/board.c: Call run_post(POST_ROM) before relocating

2011-10-23 Thread Wolfgang Denk
Dear Bernhard Kaindl,

In message 1318759628-10668-1-git-send-email-bernhard.kai...@gmx.net you 
wrote:
 From: Bernhard Kaindl bernhard.kai...@thalesgroup.com
 
 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.kai...@thalesgroup.com
 Cc: Pieter Voorthuijsen pieter.voorthuij...@prodrive.nl
 ---
  arch/powerpc/lib/board.c |   14 +++---
  1 files changed, 7 insertions(+), 7 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Totally illogical, there was no chance.
-- Spock, The Galileo Seven, stardate 2822.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] powerpc/lib/board.c: Call run_post(POST_ROM) before relocating

2011-10-16 Thread Bernhard Kaindl
From: Bernhard Kaindl bernhard.kai...@thalesgroup.com

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.kai...@thalesgroup.com
Cc: Pieter Voorthuijsen pieter.voorthuij...@prodrive.nl
---
 arch/powerpc/lib/board.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 4fd0149..f9c9dea 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -397,6 +397,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.
@@ -604,13 +611,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));
-- 
1.7.3.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot