Skip to content

Commit 08197d3

Browse files
committed
HSD #15018158429: configs: Support Agilex3 layout for QSPI
Agilex 3 platforms with reduced QSPI flash size require a different layout and boot script loading strategy. This commit enhances the QSPI bootcmd logic to support both primary and Agilex 3-specific MTD partition layouts. The boot sequence attempts to load the boot script for primary MTD layout and then if fails, retries using an alternate layout optimized for smaller flash devices. Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
1 parent 9c16c73 commit 08197d3

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

include/configs/socfpga_soc64_common.h

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,22 @@
9898
"bootcmd_qspi=ubi detach; sf probe && " \
9999
"setenv mtdids 'nor0=nor0,nand0=nand.0' && " \
100100
"setenv mtdparts 'mtdparts=nor0:66m(u-boot),190m(root);nand.0:2m(nand_uboot),500m(nand_root)' && " \
101-
"env select UBI; saveenv && " \
102-
"ubi part root && " \
103-
"if ubi part root && ubi readvol ${scriptaddr} script; " \
104-
"then echo QSPI: Running script from UBIFS; " \
105-
"elif sf read ${scriptaddr} ${qspiscriptaddr} ${scriptsize}; " \
106-
"then echo QSPI: Running script from JFFS2; fi; " \
101+
"env select UBI && " \
102+
"if ubi part root && ubi readvol ${scriptaddr} script; then " \
103+
"echo QSPI: Running script from UBIFS; " \
104+
"elif sf read ${scriptaddr} ${qspiscriptaddr} ${scriptsize}; then " \
105+
"echo QSPI: Running script from JFFS2; " \
106+
"source ${scriptaddr}; " \
107+
"echo QSPI: UBIFS/JFFS2 load failed, trying fallback layout...; " \
108+
"setenv mtdids 'nor0=nor0' && " \
109+
"setenv mtdparts 'mtdparts=nor0:6m(u-boot),58m(root)' && " \
110+
"env select UBI && " \
111+
"if ubi part root && ubi readvol ${scriptaddr} script; then " \
112+
"echo QSPI: Running script from UBIFS fallback; " \
113+
"elif sf read ${scriptaddr} ${qspiscriptaddr} ${scriptsize}; then " \
114+
"echo QSPI: Running script from JFFS2 fallback; " \
115+
"fi; " \
116+
"fi; " \
107117
"echo QSPI: Trying to boot script at ${scriptaddr} && " \
108118
"source ${scriptaddr}; " \
109119
"echo QSPI: SCRIPT FAILED: continuing...; ubi detach;\0"

0 commit comments

Comments
 (0)