From a29511eeca5f00e31653af28b9f758cf39e001fc Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 8 Apr 2020 10:51:36 +0200 Subject: xilinx: Move initrd_high setup to common location Moving to common location initrd_high is also setup for Zynq which hasn't done in run time code. Signed-off-by: Michal Simek --- board/xilinx/common/board.c | 7 +++++++ board/xilinx/versal/board.c | 6 ------ board/xilinx/zynqmp/zynqmp.c | 6 ------ 3 files changed, 7 insertions(+), 12 deletions(-) (limited to 'board/xilinx') diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 7c191e53fb7..294a59df77d 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "board.h" int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) @@ -75,7 +76,13 @@ void *board_fdt_blob_setup(void) int board_late_init_xilinx(void) { + ulong initrd_hi; + env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); + initrd_hi = gd->start_addr_sp - CONFIG_STACK_SIZE; + initrd_hi = round_down(initrd_hi, SZ_16M); + env_set_addr("initrd_high", (void *)initrd_hi); + return 0; } diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 908ea87163f..2900dfb44e9 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -16,7 +16,6 @@ #include #include #include -#include #include "../common/board.h" DECLARE_GLOBAL_DATA_PTR; @@ -94,7 +93,6 @@ int board_late_init(void) const char *mode; char *new_targets; char *env_targets; - ulong initrd_hi; if (!(gd->flags & GD_FLG_ENV_DEFAULT)) { debug("Saved variables - Skipping\n"); @@ -201,10 +199,6 @@ int board_late_init(void) env_set("boot_targets", new_targets); - initrd_hi = gd->start_addr_sp - CONFIG_STACK_SIZE; - initrd_hi = round_down(initrd_hi, SZ_16M); - env_set_addr("initrd_high", (void *)initrd_hi); - return board_late_init_xilinx(); } diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index b2172356ad0..66a43974e68 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "../common/board.h" #include "pm_cfg_obj.h" @@ -565,7 +564,6 @@ int board_late_init(void) char *new_targets; char *env_targets; int ret; - ulong initrd_hi; #if defined(CONFIG_USB_ETHER) && !defined(CONFIG_USB_GADGET_DOWNLOAD) usb_ether_init(); @@ -692,10 +690,6 @@ int board_late_init(void) env_set("boot_targets", new_targets); - initrd_hi = gd->start_addr_sp - CONFIG_STACK_SIZE; - initrd_hi = round_down(initrd_hi, SZ_16M); - env_set_addr("initrd_high", (void *)initrd_hi); - reset_reason(); return board_late_init_xilinx(); -- cgit v1.2.3