diff mbox

[U-Boot,RFC,02/10] ARM: omap3/board: add spl specific board_init_f

Message ID 1401568344-4441-3-git-send-email-jeroen@myspectrum.nl
State RFC
Delegated to: Tom Rini
Headers show

Commit Message

Jeroen Hofstee May 31, 2014, 8:32 p.m. UTC
gd is already setup when calling board_init_f and
preloader_console_init depends on it. Therefore move
the SPL specific part to its own board_init_f as it
prevents the need for a temporarily gd.
---
 arch/arm/cpu/armv7/omap3/board.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 9bb1a1c..2e2ec14 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -239,17 +239,22 @@  void s_init(void)
 	ehci_clocks_enable();
 #endif
 
+	if (!in_sdram)
+		mem_init();
+}
+
 #ifdef CONFIG_SPL_BUILD
-	gd = &gdata;
+void board_init_f(ulong dummy)
+{
+	/* Clear the BSS. */
+	memset(__bss_start, 0, __bss_end - __bss_start);
 
 	preloader_console_init();
-
 	timer_init();
-#endif
 
-	if (!in_sdram)
-		mem_init();
+        board_init_r(NULL, 0);
 }
+#endif
 
 /*
  * Routine: misc_init_r