diff options
author | Tom Rini <trini@konsulko.com> | 2021-07-17 10:52:21 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-07-17 10:52:21 -0400 |
commit | d5dbc661c3041e910e161a95fca9e615d85730ac (patch) | |
tree | aff587483c785b8384de496d6670e9824eb3e703 /common | |
parent | c39946a2e2d062025c9fc8b34587dfdd45fd8703 (diff) | |
parent | edf95bdeddeab8f0fd7b88d4865fbc6e99071c73 (diff) | |
download | u-boot-d5dbc661c3041e910e161a95fca9e615d85730ac.zip u-boot-d5dbc661c3041e910e161a95fca9e615d85730ac.tar.gz u-boot-d5dbc661c3041e910e161a95fca9e615d85730ac.tar.bz2 |
Merge tag 'u-boot-imx-20210717' of https://gitlab.denx.de/u-boot/custodians/u-boot-imxWIP/17Jul2021
i.MX
----
- mx7ulp : fix WDOG
- imx8 : Phytec
- USB3 support for i.MX8
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/8277
Diffstat (limited to 'common')
-rw-r--r-- | common/spl/spl_mmc.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index add2785..2377d09 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -324,6 +324,29 @@ unsigned long __weak spl_mmc_get_uboot_raw_sector(struct mmc *mmc, return raw_sect; } +int default_spl_mmc_emmc_boot_partition(struct mmc *mmc) +{ + int part; +#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 + return part; +} + +int __weak spl_mmc_emmc_boot_partition(struct mmc *mmc) +{ + return default_spl_mmc_emmc_boot_partition(mmc); +} + int spl_mmc_load(struct spl_image_info *spl_image, struct spl_boot_device *bootdev, const char *filename, @@ -355,19 +378,7 @@ 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 - * which is the first physical partition (0). - */ - part = (mmc->part_config >> 3) & PART_ACCESS_MASK; - - if (part == 7) - part = 0; -#endif + part = spl_mmc_emmc_boot_partition(mmc); if (CONFIG_IS_ENABLED(MMC_TINY)) err = mmc_switch_part(mmc, part); |