[PATCH 5/7] spl: mmc: support squashfs

Richard Genoud richard.genoud at bootlin.com
Fri Mar 13 11:42:27 CET 2026


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 <richard.genoud at bootlin.com>
---
 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 47cfe4aef58f..cc16709dc9b1 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


More information about the U-Boot mailing list