]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spl: mmc: support squashfs
authorRichard Genoud <richard.genoud@bootlin.com>
Fri, 13 Mar 2026 10:42:27 +0000 (11:42 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 26 Mar 2026 17:04:28 +0000 (11:04 -0600)
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@bootlin.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
common/spl/spl_mmc.c

index 47cfe4aef58fda117dac3262db1b183871ddee20..cc16709dc9b1bc29e1de78cde7ff6af12780d914 100644 (file)
@@ -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