[U-Boot] [PATCH] am33xx: Fix fetching of mmc1 bootmode from bootrom for AM33XX

Joel A Fernandes joelagnel at ti.com
Tue Sep 18 16:30:51 CEST 2012


U-boot should not ignore getting the bootmode passed on from the bootrom.
With this, U-boot SPL knows it was loaded from MMC1 and use this info to
read full U-boot from MMC1 as well.

Cc: pprakash at ti.com
Cc: trini at ti.com
Signed-off-by: Joel A Fernandes <joelagnel at ti.com>
---
 arch/arm/cpu/armv7/omap-common/lowlevel_init.S |    6 ++++--
 arch/arm/include/asm/omap_common.h             |    9 +++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
index 1ece073..665bab7 100644
--- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
@@ -26,7 +26,9 @@
  * MA 02111-1307 USA
  */
 
+#include <config.h>
 #include <asm/arch/omap.h>
+#include <asm/omap_common.h>
 #include <linux/linkage.h>
 
 ENTRY(save_boot_params)
@@ -59,9 +61,9 @@ ENTRY(save_boot_params)
 	strb	r2, [r3, #BOOT_DEVICE_OFFSET]	@ omap_boot_device <- r1
 
 	/* boot mode is passed only for devices that can raw/fat mode */
-	cmp	r2, #2
+	cmp	r2, #BOOT_DEVICE_XIP
 	blt	2f
-	cmp	r2, #7
+	cmp	r2, #BOOT_DEVICE_MMC2
 	bgt	2f
 	/* Store the boot mode (raw/FAT) in omap_boot_mode */
 	ldr	r2, [r0, #DEV_DESC_PTR_OFFSET]	@ get the device descriptor ptr
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 71ef9b0..557fb5c 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -34,8 +34,6 @@
 #define OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL	2
 #define OMAP_INIT_CONTEXT_UBOOT_AFTER_CH	3
 
-void preloader_console_init(void);
-
 /* Boot device */
 #ifdef CONFIG_OMAP54XX
 #define BOOT_DEVICE_NONE        0
@@ -65,6 +63,7 @@ void preloader_console_init(void);
 #define BOOT_DEVICE_XIPWAIT	7
 #define BOOT_DEVICE_MMC2_2      0xFF
 #elif defined(CONFIG_AM33XX)	/* AM33XX */
+#define BOOT_DEVICE_XIP       	2
 #define BOOT_DEVICE_NAND	5
 #define BOOT_DEVICE_MMC1	8
 #define BOOT_DEVICE_MMC2	9 /* eMMC or daughter card */
@@ -78,6 +77,8 @@ void preloader_console_init(void);
 #define MMCSD_MODE_FAT		2
 #define NAND_MODE_HW_ECC	3
 
+#ifndef __ASSEMBLY__
+
 struct spl_image_info {
 	const char *name;
 	u8 os;
@@ -137,4 +138,8 @@ static inline u32 omap_revision(void)
 #define OMAP5430_SILICON_ID_INVALID	0
 #define OMAP5430_ES1_0	0x54300100
 #define OMAP5432_ES1_0	0x54320100
+
+void preloader_console_init(void);
+
+#endif
 #endif /* _OMAP_COMMON_H_ */
-- 
1.7.9.5



More information about the U-Boot mailing list