Skip to contentSkip to conversation

mpc5200: spl_boot.c: Change init oder to first enable printf

PATCH New Stefan Roese 2 participants 2 messages Dec 6, 2012 – Mar 9, 2013 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc5200: spl_boot.c: Change init oder to first enable printf

On MPC5200, the initial RAM (and gd) is located in the internal SRAM. So we can actually call the preloader console init code before calling initdram(). This makes serial output (printf) available very early, even before SDRAM init, which has been an U-Boot priciple from day 1.

---
 arch/powerpc/cpu/mpc5xxx/spl_boot.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
arch/powerpc/cpu/mpc5xxx/spl_boot.c +14 -6
index 9f14127..080bd58 100644
@@ -41,13 +41,12 @@ void board_init_f(ulong bootflag)
 	end_align = (u32)__spl_flash_end;
 
 	/*
-	 * First we need to initialize the SDRAM, so that the real
-	 * U-Boot or the OS (Linux) can be loaded
+	 * On MPC5200, the initial RAM (and gd) is located in the internal
+	 * SRAM. So we can actually call the preloader console init code
+	 * before calling initdram(). This makes serial output (printf)
+	 * available very early, even before SDRAM init, which has been
+	 * an U-Boot priciple from day 1.
 	 */
-	initdram(0);
-
-	/* Clear bss */
-	memset(__bss_start, '\0', __bss_end__ - __bss_start);
 
 	/*
 	 * Init global_data pointer. Has to be done before calling
@@ -71,6 +70,15 @@ void board_init_f(ulong bootflag)
 	preloader_console_init();
 
 	/*
+	 * First we need to initialize the SDRAM, so that the real
+	 * U-Boot or the OS (Linux) can be loaded
+	 */
+	initdram(0);
+
+	/* Clear bss */
+	memset(__bss_start, '\0', __bss_end__ - __bss_start);
+
+	/*
 	 * Call board_init_r() (SPL framework version) to load and boot
 	 * real U-Boot or OS
 	 */
Signature · 1 line
1.8.0.1
#1 lore raw

PATCH 1/1 mpc5200: spl_boot.c: Change init oder to first enable printf

Dear Stefan Roese,

Quoted 10 lines · In message <[email protected]> you wrote:

On MPC5200, the initial RAM (and gd) is located in the internal SRAM. So we can actually call the preloader console init code before calling initdram(). This makes serial output (printf) available very early, even before SDRAM init, which has been an U-Boot priciple from day 1.

---
 arch/powerpc/cpu/mpc5xxx/spl_boot.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

Applied to u-boot-mpc5xxx repo, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
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: wd at denx.de
"The best index to a person's character is a) how  he  treats  people
who can't do him any good and b) how he treats people who can't fight
back."                                            - Abigail Van Buren