public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] common/board_f: Add back gd init
@ 2014-04-28 22:51 York Sun
  2014-04-28 22:51 ` [U-Boot] [PATCH 2/2] common/board_f: Fix size variable York Sun
  2014-04-30 17:33 ` [U-Boot] [PATCH 1/2] common/board_f: Add back gd init York Sun
  0 siblings, 2 replies; 8+ messages in thread
From: York Sun @ 2014-04-28 22:51 UTC (permalink / raw)
  To: u-boot

For powerpc SoCs, the initial gd is in INIT_RAM, in most cases, resideing
in locked D-cache. At the time the function baord_inti_f() runs, no other
RAM is available as a stack. This technique has been used in
arch/powerpc/lib/board.c and should be added to generic board for powerpc.

Signed-off-by: York Sun <yorksun@freescale.com>
---
 common/board_f.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index cbdf06f..3a00b92 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -970,7 +970,10 @@ static init_fnc_t init_sequence_f[] = {
 
 void board_init_f(ulong boot_flags)
 {
-#ifndef CONFIG_X86
+#ifdef CONFIG_PPC
+	gd = (gd_t *)(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
+	__asm__ __volatile__("" : : : "memory");
+#elif !defined(CONFIG_X86)
 	gd_t data;
 
 	gd = &data;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-04-30 20:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-28 22:51 [U-Boot] [PATCH 1/2] common/board_f: Add back gd init York Sun
2014-04-28 22:51 ` [U-Boot] [PATCH 2/2] common/board_f: Fix size variable York Sun
2014-04-30 17:33 ` [U-Boot] [PATCH 1/2] common/board_f: Add back gd init York Sun
2014-04-30 17:57   ` Scott Wood
2014-04-30 18:14     ` York Sun
2014-04-30 18:24       ` Scott Wood
2014-04-30 18:30         ` York Sun
2014-04-30 20:38         ` York Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox