Patchwork [U-Boot,v10,8/9] omap3: implement boot parameter saving

login
register
mail settings
Submitter Tom Rini
Date Sept. 13, 2011, 9:27 p.m.
Message ID <1315949258-12064-9-git-send-email-trini@ti.com>
Download mbox | patch
Permalink /patch/114560/
State Accepted
Headers show

Comments

Tom Rini - Sept. 13, 2011, 9:27 p.m.
From: Simon Schwarz <simonschwarzcor@googlemail.com>

Implements the saving of boot params passed by OMAP3 ROM code.

Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
---
 arch/arm/cpu/armv7/omap-common/spl.c     |    6 +++++-
 arch/arm/cpu/armv7/omap3/lowlevel_init.S |    9 +++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

Patch

diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
index 53d10bf..3dd8e0d 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -194,8 +194,12 @@  static void mmc_load_image(void)
 		printf("spl: mmc init failed: err - %d\n", err);
 		hang();
 	}
-
+/* For OMAP3 there is no automatic boot mode detection */
+#ifdef CONFIG_OMAP34XX
+	boot_mode = CONFIG_SYS_MMC_SD_BOOTMODE;
+#else
 	boot_mode = omap_boot_mode();
+#endif
 	if (boot_mode == MMCSD_MODE_RAW) {
 		debug("boot mode - RAW\n");
 		mmc_load_image_raw(mmc);
diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
index 48a7ec6..a308ebd 100644
--- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
@@ -37,8 +37,13 @@  _TEXT_BASE:
 
 .global save_boot_params
 save_boot_params:
-	#warning "Please implement save_boot_params for OMAP3"
-	bx lr
+#ifdef CONFIG_SPL_BUILD
+	ldr	r4, =omap3_boot_device
+	ldr	r5, [r0, #0x4]
+	and	r5, r5, #0xff
+	str	r5, [r4]
+#endif
+	bx	lr
 
 .global omap3_gp_romcode_call
 omap3_gp_romcode_call: