diff options
author | T Karthik Reddy <t.karthik.reddy@xilinx.com> | 2019-12-18 13:34:41 +0300 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2020-01-14 11:05:52 +0300 |
commit | 53c69dec331ce8a6d0c57f0daed55d82f76d4fe6 (patch) | |
tree | ba6e8a2597fd75d8e7f13db6d82910f777574de0 /board/xilinx | |
parent | 18be60b8bce2ce4ab38da6f1be9aa8f22557129e (diff) | |
download | u-boot-53c69dec331ce8a6d0c57f0daed55d82f76d4fe6.tar.xz |
board: xilinx: Add support for user configurable boot script offset
Currently "script_offset_f" env variable is hardcoded, this variable
specifies from which offset of the flash boot.scr should be read/write.
As flashes are of different sizes having a fixed offset makes it
difficult to load other images into the flash which may overwrite the
boot script or cannot utilize the full memory. This current fix
creates a new config "CONFIG_BOOT_SCRIPT_OFFSET" which holds the
offset address, overwrites the "script_offset_f" variable.
Also removed existing variable with default values, as the default
values are held by CONFIG_BOOT_SCRIPT_OFFSET
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'board/xilinx')
-rw-r--r-- | board/xilinx/Kconfig | 9 | ||||
-rw-r--r-- | board/xilinx/versal/board.c | 2 | ||||
-rw-r--r-- | board/xilinx/zynq/board.c | 2 | ||||
-rw-r--r-- | board/xilinx/zynqmp/zynqmp.c | 2 |
4 files changed, 15 insertions, 0 deletions
diff --git a/board/xilinx/Kconfig b/board/xilinx/Kconfig index cb272eafda..7833b11767 100644 --- a/board/xilinx/Kconfig +++ b/board/xilinx/Kconfig @@ -47,3 +47,12 @@ config XILINX_OF_BOARD_DTB_ADDR depends on OF_BOARD help Offset in the memory where the board configuration DTB is placed. + +config BOOT_SCRIPT_OFFSET + hex "Boot script offset" + depends on ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL + default 0xFC0000 if ARCH_ZYNQ + default 0x3E80000 if ARCH_ZYNQMP + default 0x7F80000 if ARCH_VERSAL + help + Specifies distro boot script offset in NAND/NOR flash. diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 45724478a2..9fa9e76e66 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -203,6 +203,8 @@ int board_late_init(void) initrd_hi = round_down(initrd_hi, SZ_16M); env_set_addr("initrd_high", (void *)initrd_hi); + env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); + return 0; } diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index cffabe825a..390d9482a7 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -76,6 +76,8 @@ int board_late_init(void) env_set("boot_targets", new_targets); + env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); + return 0; } diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index b72eade43e..8bdc67748e 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -667,6 +667,8 @@ int board_late_init(void) initrd_hi = round_down(initrd_hi, SZ_16M); env_set_addr("initrd_high", (void *)initrd_hi); + env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); + reset_reason(); return 0; |