diff options
Diffstat (limited to 'common/spl/spl_mmc.c')
-rw-r--r-- | common/spl/spl_mmc.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index ea07687fd8d..34e1e73d80d 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -349,28 +349,32 @@ int spl_mmc_load(struct spl_image_info *spl_image, err = -EINVAL; switch (boot_mode) { case 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). - */ - part = (mmc->part_config >> 3) & PART_ACCESS_MASK; - - if (part == 7) - part = 0; - - if (CONFIG_IS_ENABLED(MMC_TINY)) - err = mmc_switch_part(mmc, part); - else - err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part); - - if (err) { +#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 + * which is the first physical partition (0). + */ + part = (mmc->part_config >> 3) & PART_ACCESS_MASK; + + if (part == 7) + part = 0; +#endif + + if (CONFIG_IS_ENABLED(MMC_TINY)) + err = mmc_switch_part(mmc, part); + else + err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part); + + if (err) { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT - puts("spl: mmc partition switch failed\n"); + puts("spl: mmc partition switch failed\n"); #endif - return err; - } - /* Fall through */ + return err; + } + /* Fall through */ case MMCSD_MODE_RAW: debug("spl: mmc boot mode: raw\n"); |