]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
configs: socfpga: soc64: agilex5: Enable NAND boot with UBI / UBIFS
authorDinesh Maniyam <dinesh.maniyam@altera.com>
Fri, 4 Jul 2025 06:09:56 +0000 (14:09 +0800)
committerTien Fong Chee <tien.fong.chee@intel.com>
Wed, 30 Jul 2025 09:45:31 +0000 (17:45 +0800)
Add the required configuration in the U-Boot env to enable Linux NAND
boot with UBI / UBIFS.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
include/configs/socfpga_soc64_common.h

index 5ed17671f79dde5a294c1884310d69464c3be9b8..83b600c7fcc5ef037b66c354055da07a4fe32996 100644 (file)
 #define BOOTENV_DEV_NAME_QSPI(devtypeu, devtypel, instance) \
        "qspi "
 
+#if IS_ENABLED(CONFIG_CMD_NAND)
+#define BOOT_TARGET_DEVICES_NAND(func) func(NAND, nand, na)
+#else
+#define BOOT_TARGET_DEVICES_NAND(func)
+#endif
+
+#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
+       "bootcmd_nand=ubi detach && " \
+       "setenv mtdids 'nor0=nor0,nand0=nand.0' && " \
+       "setenv mtdparts 'mtdparts=nor0:66m(qspi_uboot),190m(qspi_root);" \
+       "nand.0:2m(u-boot),500m(root)' && " \
+       "env select UBI; saveenv && " \
+       "ubi part root && " \
+       "ubi readvol ${scriptaddr} script && " \
+       "echo NAND: Trying to boot script at ${scriptaddr} && " \
+       "source ${scriptaddr}; " \
+       "echo NAND: SCRIPT FAILED: continuing...; ubi detach;\0"
+
+#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
+       "nand "
+
 #define BOOT_TARGET_DEVICES(func) \
        BOOT_TARGET_DEVICES_MMC(func) \
-       BOOT_TARGET_DEVICES_QSPI(func)
+       BOOT_TARGET_DEVICES_QSPI(func) \
+       BOOT_TARGET_DEVICES_NAND(func)
 
 #include <config_distro_bootcmd.h>