From fb0df3552892ff150edaf7579989fd4750ee85ee Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Fri, 13 Mar 2026 11:42:27 +0100 Subject: [PATCH] spl: mmc: support squashfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit spl_mmc_do_fs_boot supports now loading an image from squashfs. Also, convert #if defined(CONFIG_SPL_xx) to if (CONFIG_IS_ENABLED(xx)) Signed-off-by: Richard Genoud Reviewed-by: Miquel Raynal Reviewed-by: João Marcos Costa --- common/spl/spl_mmc.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 47cfe4aef58..cc16709dc9b 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -226,6 +226,11 @@ static int __maybe_unused spl_mmc_fs_load(struct spl_image_info *spl_image, if (!err) return 0; } + if (CONFIG_IS_ENABLED(FS_SQUASHFS)) { + err = spl_load_image_sqfs(spl_image, bootdev, blk_dev, part, file); + if (!err) + return 0; + } return err; } @@ -284,13 +289,15 @@ static int spl_mmc_do_fs_boot(struct spl_image_info *spl_image, u32 __weak spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) { -#if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4) - return MMCSD_MODE_FS; -#elif defined(CONFIG_SUPPORT_EMMC_BOOT) - return MMCSD_MODE_EMMCBOOT; -#else + if (CONFIG_IS_ENABLED(FS_FAT) || + CONFIG_IS_ENABLED(FS_EXT4) || + CONFIG_IS_ENABLED(FS_SQUASHFS)) + return MMCSD_MODE_FS; + + if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT)) + return MMCSD_MODE_EMMCBOOT; + return MMCSD_MODE_RAW; -#endif } #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION