From ad4ca1a49d2aa52b2653922ad6a82213a75fb5a0 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 21 Nov 2018 22:17:08 -0800 Subject: [PATCH] MLK-20442 imx8qm/qxp: Fix SPL crash when authentication is failed When booting SPL from SD/MMC, the codes load and parse container image first, if its authentication is failed, the flow continues to load and parse for FIT image and cause crash in SPL. The correct way should stop the booting if authentication is failed, avoid trying the FIT image since FIT does not support AHAB on 8QM/QXP. Signed-off-by: Ye Li Reviewed-by: Peng Fan (cherry picked from commit 7843ab1b619d53c24a11f7db10b277287dcd1b11) --- common/spl/spl_mmc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 785bbd5338..ec56f11fdb 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -185,7 +185,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image, err = part_get_info(mmc_get_blk_desc(mmc), type_part, &info); if (err) continue; - if (info.sys_ind == + if (info.sys_ind == CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE) { partition = type_part; break; @@ -400,12 +400,10 @@ int spl_mmc_load_image(struct spl_image_info *spl_image, #ifdef CONFIG_PARSE_CONTAINER err = mmc_load_image_parse_container(spl_image, mmc, spl_mmc_get_uboot_raw_sector(mmc)); - - if (!err) - return err; -#endif +#else err = mmc_load_image_raw_sector(spl_image, mmc, spl_mmc_get_uboot_raw_sector(mmc)); +#endif #endif if (!err) return err;