diff mbox series

[4/4] arm: socfpga: soc64: Load and boot for NAND flash with UBI and UBIFS in enviroment

Message ID 20221211144047.8464-4-jit.loon.lim@intel.com
State Needs Review / ACK, archived
Delegated to: Marek Vasut
Headers show
Series [1/4] configs: defconfig: Enable UBI and UBIFS for Agilex and Stratix10 | expand

Commit Message

Jit Loon Lim Dec. 11, 2022, 2:40 p.m. UTC
From: Sin Hui Kho <sin.hui.kho@intel.com>

Load kernel and device tree from UBI volume. Set root file system type
for NAND boot as UBIFS located at UBI volume on MTD partition 1 or
namely "root".

Signed-off-by: Sin Hui Kho <sin.hui.kho@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
---
 include/configs/socfpga_soc64_common.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/configs/socfpga_soc64_common.h b/include/configs/socfpga_soc64_common.h
index 5939f13231..5b1d243153 100644
--- a/include/configs/socfpga_soc64_common.h
+++ b/include/configs/socfpga_soc64_common.h
@@ -92,10 +92,15 @@ 
 	"scriptfile=u-boot.scr\0" \
 	"fatscript=if fatload mmc 0:1 ${scriptaddr} ${scriptfile};" \
 		   "then source ${scriptaddr}:script; fi\0" \
+	"nandroot=ubi0:rootfs\0" \
+	"nandload=ubi part root; ubi readvol ${loadaddr} kernel; ubi readvol ${fdt_addr} dtb\0" \
+	"nandboot=setenv bootargs " CONFIG_BOOTARGS \
+			" root=${nandroot} rw rootwait rootfstype=ubifs ubi.mtd=1; " \
+			"booti ${loadaddr} - ${fdt_addr}\0" \
 	"nandfitboot=setenv bootargs " CONFIG_BOOTARGS \
-			" root=${nandroot} rw rootwait rootfstype=jffs2; " \
+			" root=${nandroot} rw rootwait rootfstype=ubifs ubi.mtd=1; " \
 			"bootm ${loadaddr}\0" \
-	"nandfitload=nand read ${loadaddr} kernel\0" \
+	"nandfitload=ubi part root; ubi readvol ${loadaddr} kernel\0" \
 	"socfpga_legacy_reset_compat=1\0" \
 	"rsu_status=rsu dtb; rsu display_dcmf_version; "\
 		"rsu display_dcmf_status; rsu display_max_retry\0" \