[U-Boot] [PATCH 1/5] arm64: versal: Move common board dtb search

Michal Simek michal.simek at xilinx.com
Thu Oct 3 10:33:33 UTC 2019


From: Ibai Erkiaga <ibai.erkiaga-elorza at xilinx.com>

Move the exisiting function of getting board dtb from versal to a common
Xilinx folder.

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza at xilinx.com>
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 arch/arm/mach-versal/Kconfig |  5 -----
 arch/arm/mach-versal/cpu.c   | 21 ---------------------
 board/xilinx/Kconfig         |  7 +++++++
 board/xilinx/common/board.c  | 14 ++++++++++++++
 4 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-versal/Kconfig b/arch/arm/mach-versal/Kconfig
index 06a035292464..a08e5ae41490 100644
--- a/arch/arm/mach-versal/Kconfig
+++ b/arch/arm/mach-versal/Kconfig
@@ -36,11 +36,6 @@ config COUNTER_FREQUENCY
 config ZYNQ_SDHCI_MAX_FREQ
 	default 200000000
 
-config VERSAL_OF_BOARD_DTB_ADDR
-	hex
-	default 0x1000
-	depends on OF_BOARD
-
 config IOU_SWITCH_DIVISOR0
 	hex "IOU switch divisor0"
 	default 0x20
diff --git a/arch/arm/mach-versal/cpu.c b/arch/arm/mach-versal/cpu.c
index 121f5d8f16a4..909949a76ab8 100644
--- a/arch/arm/mach-versal/cpu.c
+++ b/arch/arm/mach-versal/cpu.c
@@ -109,27 +109,6 @@ int reserve_mmu(void)
 }
 #endif
 
-#if defined(CONFIG_OF_BOARD)
-void *board_fdt_blob_setup(void)
-{
-	static void *fw_dtb = (void *)CONFIG_VERSAL_OF_BOARD_DTB_ADDR;
-
-	if (fdt_magic(fw_dtb) == FDT_MAGIC)
-		return fw_dtb;
-
-	printf("DTB is not passed via 0x%llx\n", (u64)fw_dtb);
-
-	/* Try to look at FDT is at end of image */
-	fw_dtb = (ulong *)&_end;
-
-	if (fdt_magic(fw_dtb) == FDT_MAGIC)
-		return fw_dtb;
-
-	printf("DTB is also not passed via 0x%llx\n", (u64)fw_dtb);
-	return NULL;
-}
-#endif
-
 int versal_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
 		      u32 arg3, u32 *ret_payload)
 {
diff --git a/board/xilinx/Kconfig b/board/xilinx/Kconfig
index 37bec5fae29d..4f290339a094 100644
--- a/board/xilinx/Kconfig
+++ b/board/xilinx/Kconfig
@@ -39,3 +39,10 @@ config XILINX_PS_INIT_FILE
 	     before the build.
 
 endif
+
+config VERSAL_OF_BOARD_DTB_ADDR
+	hex
+	default 0x1000
+	depends on OF_BOARD
+	help
+	  Offset in the memory where the board configuration DTB is placed.
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 7e6340bad6d4..3d95609ba757 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -36,3 +36,17 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
 
 	return ret;
 }
+
+#if defined(CONFIG_OF_BOARD)
+void *board_fdt_blob_setup(void)
+{
+	static void *fw_dtb = (void *)CONFIG_VERSAL_OF_BOARD_DTB_ADDR;
+
+	if (fdt_magic(fw_dtb) != FDT_MAGIC) {
+		printf("DTB is not passed via %llx\n", (u64)fw_dtb);
+		return NULL;
+	}
+
+	return fw_dtb;
+}
+#endif
-- 
2.17.1



More information about the U-Boot mailing list