Skip to contentSkip to conversation

SPL: Add CONFIG_SUPPORT_EMMC_BOOT support to CONFIG_SPL_FRAMEWORK

PATCH Superseded Tom Rini 1 participant 1 message Jan 27, 2014 Arm (32-bit)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 SPL: Add CONFIG_SUPPORT_EMMC_BOOT support to CONFIG_SPL_FRAMEWORK

We use the switch CONFIG_SUPPORT_EMMC_BOOT today to enable some additional features of the eMMC boot partitions. Add support for being told that we have booted from one of these partitions to the spl framework and implement this for the dra7xx_evm board.

Cc Pantelis Antoniou <[email protected]>
Cc Lokesh Vutla <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/boot-common.c |    8 +++++++-
 boards.cfg                                   |    1 +
 common/spl/spl_mmc.c                         |   16 ++++++++++++++++
 include/spl.h                                |    1 +
 4 files changed, 25 insertions(+), 1 deletion(-)
arch/arm/cpu/armv7/omap-common/boot-common.c +7 -1
index 69fff32..ec0f936 100644
@@ -66,7 +66,13 @@ u32 spl_boot_device(void)
 
 u32 spl_boot_mode(void)
 {
-	return gd->arch.omap_boot_params.omap_bootmode;
+	u32 val = gd->arch.omap_boot_params.omap_bootmode;
+
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+	if (val == 0)
+		val = MMCSD_MODE_EMMCBOOT;
+#endif
+	return val;
 }
 
 void spl_board_init(void)
boards.cfg +1 -0
index 2dfd2b4..96fc2bf 100644
@@ -343,6 +343,7 @@ Active  arm         armv7          omap3       timll           devkit8000
 Active  arm         armv7          omap4       ti              panda               omap4_panda                          -                                                                                                                                 Sricharan R <[email protected]>
 Active  arm         armv7          omap4       ti              sdp4430             omap4_sdp4430                        -                                                                                                                                 Sricharan R <[email protected]>
 Active  arm         armv7          omap5       ti              dra7xx              dra7xx_evm                           dra7xx_evm:CONS_INDEX=1                                                                                                           Lokesh Vutla <[email protected]>
+Active  arm         armv7          omap5       ti              dra7xx              dra7xx_evm_emmcboot                  dra7xx_evm:CONS_INDEX=1,SUPPORT_EMMC_BOOT                                                                                         Lokesh Vutla <[email protected]>
 Active  arm         armv7          omap5       ti              dra7xx              dra7xx_evm_uart3                     dra7xx_evm:CONS_INDEX=3,SPL_YMODEM_SUPPORT                                                                                        Lokesh Vutla <[email protected]>
 Active  arm         armv7          omap5       ti              omap5_uevm          omap5_uevm                           -                                                                                                                                 -
 Active  arm         armv7          rmobile     atmark-techno   armadillo-800eva    armadillo-800eva                     -                                                                                                                                 Nobuhiro Iwamatsu <[email protected]>
common/spl/spl_mmc.c +16 -0
index 13fbff0..be68b27 100644
@@ -111,6 +111,22 @@ void spl_mmc_load_image(void)
 					CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION,
 					CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
 #endif
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+	} else if (boot_mode == MMCSD_MODE_EMMCBOOT) {
+		/* Switch to the currently configured boot partition. */
+		if (mmc_switch_part(0, (mmc->part_config >> 3) &
+				    PART_ACCESS_MASK)) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+			puts("MMC partition switch failed\n");
+#endif
+			hang();
+		}
+#ifdef CONFIG_SPL_OS_BOOT
+		if (spl_start_uboot() || mmc_load_image_raw_os(mmc))
+#endif
+		err = mmc_load_image_raw(mmc,
+			CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
+#endif
 	} else {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		puts("spl: wrong MMC boot mode\n");
include/spl.h +1 -0
index 5e24856..dad00c0 100644
@@ -16,6 +16,7 @@
 #define MMCSD_MODE_UNDEFINED	0
 #define MMCSD_MODE_RAW		1
 #define MMCSD_MODE_FAT		2
+#define MMCSD_MODE_EMMCBOOT	3
 
 struct spl_image_info {
 	const char *name;
Signature · 1 line
1.7.9.5