[PATCH v2] configs: socfpga: soc64: agilex5: Enable NAND boot with UBI / UBIFS

Chee, Tien Fong tien.fong.chee at altera.com
Tue Jul 22 10:40:58 CEST 2025



> -----Original Message-----
> From: Maniyam, Dinesh <dinesh.maniyam at altera.com>
> Sent: Friday, July 4, 2025 2:10 PM
> To: u-boot at lists.denx.de
> Cc: Marek <marex at denx.de>; Simon <simon.k.r.goldschmidt at gmail.com>;
> Simon Glass <sjg at chromium.org>; Tom Rini <trini at konsulko.com>; Chee,
> Tien Fong <tien.fong.chee at altera.com>; Hea, Kok Kiang
> <kok.kiang.hea at altera.com>; Maniyam, Dinesh
> <dinesh.maniyam at altera.com>; Ng, Boon Khai <boon.khai.ng at altera.com>;
> Yuslaimi, Alif Zakuan <alif.zakuan.yuslaimi at altera.com>; Lim, Jit Loon
> <jit.loon.lim at altera.com>
> Subject: [PATCH v2] configs: socfpga: soc64: agilex5: Enable NAND boot with
> UBI / UBIFS
> 
> From: Dinesh Maniyam <dinesh.maniyam at altera.com>
> 
> Add the required configuration in the U-Boot env to enable Linux NAND boot
> with UBI / UBIFS.
> 
> Signed-off-by: Dinesh Maniyam <dinesh.maniyam at altera.com>
> 
> ---
> 
> v2->v1
> - remove additional space
> ---
>  include/configs/socfpga_soc64_common.h | 24
> +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/include/configs/socfpga_soc64_common.h
> b/include/configs/socfpga_soc64_common.h
> index 5ed17671f79..83b600c7fcc 100644
> --- a/include/configs/socfpga_soc64_common.h
> +++ b/include/configs/socfpga_soc64_common.h
> @@ -73,9 +73,31 @@
>  #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>
> 
> --
> 2.19.0

Reviewed-by: Tien Fong Chee <tien.fong.chee at altera.com>

Best regards,
Tien Fong


More information about the U-Boot mailing list