[PATCH] configs: socfpga_common: Add fatscript env for optional U-Boot script
dinesh.maniyam at altera.com
dinesh.maniyam at altera.com
Thu May 7 02:53:58 CEST 2026
From: Tien Fong Chee <tien.fong.chee at altera.com>
Add 'scriptfile' and 'fatscript' environment variables to the SoCFPGA
common config so that users can drop an optional U-Boot script
(u-boot.scr) on MMC partition 0:1 and execute it without modifying
the source code. This is useful for board-specific customisation such
as register tweaks at boot time. The script is optional and not
required for normal booting; users can invoke it manually with
"run fatscript" or include it in their bootcmd as desired.
Signed-off-by: Tien Fong Chee <tien.fong.chee at altera.com>
Signed-off-by: Dinesh Maniyam <dinesh.maniyam at altera.com>
---
include/configs/socfpga_common.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 36d6bfb3d03..ade020bd216 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -151,6 +151,9 @@
"kernel_addr_r="__stringify(CONFIG_SYS_LOAD_ADDR)"\0" \
"fdt_addr_r=0x02000000\0" \
"scriptaddr=0x02100000\0" \
+ "scriptfile=u-boot.scr\0" \
+ "fatscript=if fatload mmc 0:1 ${scriptaddr} ${scriptfile};" \
+ "then source ${scriptaddr}; fi\0" \
"pxefile_addr_r=0x02200000\0" \
"ramdisk_addr_r=0x02300000\0" \
"socfpga_legacy_reset_compat=1\0" \
--
2.43.7
More information about the U-Boot
mailing list