summaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-02-05 10:24:18 -0500
committerPantelis Antoniou <panto@antoniou-consulting.com>2014-02-07 18:17:48 +0200
commit7dbe63bc950bbd12d021f72bf04104688cd324a9 (patch)
tree1a9b50f923e0d29c652748de49b6b06b5e697775 /common/spl
parentf9ec45d1d9d83db9a6539f78d51ff257373f3c4f (diff)
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 on TI OMAP/related. Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/spl_mmc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 13fbff082cf..fa6f891bc80 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -111,6 +111,30 @@ 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) {
+ /*
+ * We need to check what the partition is configured to.
+ * 1 and 2 match up to boot0 / boot1 and 7 is user data
+ * which is the first physical partition (0).
+ */
+ int part = (mmc->part_config >> 3) & PART_ACCESS_MASK;
+
+ if (part == 7)
+ part = 0;
+
+ if (mmc_switch_part(0, part)) {
+#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");