From: Tien Fong Chee <[email protected]> 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 <[email protected]> Signed-off-by: Dinesh Maniyam <[email protected]> --- 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

