]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
xilinx: Introduce board_late_init_xilinx()
authorMichal Simek <michal.simek@xilinx.com>
Tue, 31 Mar 2020 10:39:37 +0000 (12:39 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 27 Apr 2020 11:57:17 +0000 (13:57 +0200)
This function should keep common shared late configurations for Xilinx
SoCs.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/bitmain/antminer_s9/Makefile
board/topic/zynq/Makefile
board/xilinx/common/board.c
board/xilinx/common/board.h [new file with mode: 0644]
board/xilinx/versal/board.c
board/xilinx/zynq/board.c
board/xilinx/zynqmp/zynqmp.c

index 93a1e77f72bc4dd2e4f67fdd994e3595bed16219..1af01d6d8082a205fa293b77eaa76e8130025edd 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-y  := board.o
+obj-y  += ../../xilinx/common/board.o
 
 # Remove quotes
 hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE))
index becadd2ca743618c98f1356563995e75732afd23..cc100b0f42246ac7844386f9bc63bc41d8d819d2 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
 obj-y  := board.o
+obj-y  += ../../xilinx/common/board.o
 
 # Remove quotes
 hw-platform-y :=$(shell echo $(CONFIG_DEFAULT_DEVICE_TREE))
index e83c692f2174101e634b29364b679730d067ddb7..7c191e53fb71f402eeb9a3e5c1ac90f5ca5a4204 100644 (file)
@@ -8,6 +8,7 @@
 #include <asm/sections.h>
 #include <dm/uclass.h>
 #include <i2c.h>
+#include "board.h"
 
 int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
 {
@@ -71,3 +72,10 @@ void *board_fdt_blob_setup(void)
        return NULL;
 }
 #endif
+
+int board_late_init_xilinx(void)
+{
+       env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
+
+       return 0;
+}
diff --git a/board/xilinx/common/board.h b/board/xilinx/common/board.h
new file mode 100644 (file)
index 0000000..180dfbc
--- /dev/null
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * (C) Copyright 2020 Xilinx, Inc.
+ * Michal Simek <michal.simek@xilinx.com>
+ */
+
+#ifndef _BOARD_XILINX_COMMON_BOARD_H
+#define _BOARD_XILINX_COMMON_BOARD_H
+
+int board_late_init_xilinx(void);
+
+#endif /* BOARD_XILINX_COMMON_BOARD_H */
index 75aedb092922752f1cbe0ae7af94bcac55233f52..908ea87163f894ed4d126d976b1184965c28f8f9 100644 (file)
@@ -17,6 +17,7 @@
 #include <dm/uclass.h>
 #include <versalpl.h>
 #include <linux/sizes.h>
+#include "../common/board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -204,9 +205,7 @@ 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;
+       return board_late_init_xilinx();
 }
 
 int dram_init_banksize(void)
index 420a5ca663111a04099e093e8483e3f93417e9da..2164eac8d51885b4086254e4e3da28f403b15f1e 100644 (file)
@@ -17,6 +17,7 @@
 #include <zynqpl.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
+#include "../common/board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -76,9 +77,7 @@ int board_late_init(void)
 
        env_set("boot_targets", new_targets);
 
-       env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
-
-       return 0;
+       return board_late_init_xilinx();
 }
 
 #if !defined(CONFIG_SYS_SDRAM_BASE) && !defined(CONFIG_SYS_SDRAM_SIZE)
index 3c92b1a5825f5a422770f60b617dd56683928997..b2172356ad0ae5fe79593f5d91ed1f3389578ea1 100644 (file)
@@ -27,6 +27,7 @@
 #include <zynqmp_firmware.h>
 #include <g_dnl.h>
 #include <linux/sizes.h>
+#include "../common/board.h"
 
 #include "pm_cfg_obj.h"
 
@@ -695,11 +696,9 @@ 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;
+       return board_late_init_xilinx();
 }
 #endif