summaryrefslogtreecommitdiff
path: root/common/spl/spl_mmc.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2019-09-03 17:16:50 +0300
committerTom Rini <trini@konsulko.com>2019-10-11 22:33:27 +0300
commit17241ea0543a4c998f79bde27b8a6047c8d84d0a (patch)
tree047be85c185737b69f7d27655c1b3952f9697ca1 /common/spl/spl_mmc.c
parent9243990b17558c6498208061842b2ff4056acde0 (diff)
downloadu-boot-17241ea0543a4c998f79bde27b8a6047c8d84d0a.tar.xz
spl: mmc: Add option to set eMMC HW boot partition
This change allows setting pre-defined eMMC boot partition for SPL eMMC booting. It is necessary in the case when one wants to boot (through falcon boot) from eMMC after loading SPL from other memory (like SPI-NOR). Signed-off-by: Mans Rullgard <mans@mansr.com> [lukma: Edit the commit message] Signed-off-by: Lukasz Majewski <lukma@denx.de> Acked-by: Andreas Dannenberg <dannenberg@ti.com>
Diffstat (limited to 'common/spl/spl_mmc.c')
-rw-r--r--common/spl/spl_mmc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index fa19aa76b3..c5cae97099 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -355,6 +355,9 @@ int spl_mmc_load(struct spl_image_info *spl_image,
err = -EINVAL;
switch (boot_mode) {
case MMCSD_MODE_EMMCBOOT:
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
+ part = CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION;
+#else
/*
* We need to check what the partition is configured to.
* 1 and 2 match up to boot0 / boot1 and 7 is user data
@@ -364,6 +367,7 @@ int spl_mmc_load(struct spl_image_info *spl_image,
if (part == 7)
part = 0;
+#endif
if (CONFIG_IS_ENABLED(MMC_TINY))
err = mmc_switch_part(mmc, part);