[PATCH 5/7] ARM: qemu: move board code to central location

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Nov 25 08:10:40 PST 2021


The state/environment overlay applied on top of QEMU is applicable to
other virt platforms as well, like RISC-V. In preparation for sharing
code across architectures, add a new common/boards and move the board
code there.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/Kconfig                                           | 1 +
 arch/arm/boards/Makefile                                   | 1 -
 arch/arm/boards/qemu-virt/Makefile                         | 1 -
 common/Kconfig                                             | 2 ++
 common/Makefile                                            | 1 +
 common/boards/Kconfig                                      | 4 ++++
 common/boards/Makefile                                     | 3 +++
 common/boards/qemu-virt/Makefile                           | 4 ++++
 {arch/arm => common}/boards/qemu-virt/board.c              | 0
 {arch/arm => common}/boards/qemu-virt/overlay-of-flash.dts | 0
 10 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 common/boards/Kconfig
 create mode 100644 common/boards/Makefile
 create mode 100644 common/boards/qemu-virt/Makefile
 rename {arch/arm => common}/boards/qemu-virt/board.c (100%)
 rename {arch/arm => common}/boards/qemu-virt/overlay-of-flash.dts (100%)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 14aa7e26af29..b532d3fe2fc2 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -308,6 +308,7 @@ source "arch/arm/mach-zynqmp/Kconfig"
 config BOARD_ARM_VIRT
 	bool
 	select BOARD_ARM_GENERIC_DT
+	select BOARD_QEMU_VIRT
 	select OF_OVERLAY
 
 config BOARD_ARM_GENERIC_DT
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 08815d79ec43..50b07462bb78 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -167,7 +167,6 @@ obj-$(CONFIG_MACH_ZEDBOARD)			+= avnet-zedboard/
 obj-$(CONFIG_MACH_ZYLONITE)			+= zylonite/
 obj-$(CONFIG_MACH_VARISCITE_MX6)		+= variscite-mx6/
 obj-$(CONFIG_MACH_VSCOM_BALTOS)			+= vscom-baltos/
-obj-$(CONFIG_BOARD_ARM_VIRT)			+= qemu-virt/
 obj-$(CONFIG_MACH_WARP7)			+= element14-warp7/
 obj-$(CONFIG_MACH_WEBASTO_CCBV2)		+= webasto-ccbv2/
 obj-$(CONFIG_MACH_VF610_TWR)			+= freescale-vf610-twr/
diff --git a/arch/arm/boards/qemu-virt/Makefile b/arch/arm/boards/qemu-virt/Makefile
index 8451c7832d03..dcfc2937d325 100644
--- a/arch/arm/boards/qemu-virt/Makefile
+++ b/arch/arm/boards/qemu-virt/Makefile
@@ -1,2 +1 @@
 obj-y += board.o
-obj-y += overlay-of-flash.dtb.o
diff --git a/common/Kconfig b/common/Kconfig
index ab6258d90f40..9ddccc85ba26 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1,3 +1,5 @@
+source "common/boards/Kconfig"
+
 config GREGORIAN_CALENDER
 	bool
 
diff --git a/common/Makefile b/common/Makefile
index 4b45f678c7de..96808ecd35e5 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -1,3 +1,4 @@
+obj-y				+= boards/
 obj-y				+= memory.o
 obj-y				+= memory_display.o
 pbl-$(CONFIG_PBL_CONSOLE)	+= memory_display.o
diff --git a/common/boards/Kconfig b/common/boards/Kconfig
new file mode 100644
index 000000000000..e27273b7671d
--- /dev/null
+++ b/common/boards/Kconfig
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config BOARD_QEMU_VIRT
+	bool
diff --git a/common/boards/Makefile b/common/boards/Makefile
new file mode 100644
index 000000000000..5b4e429c13e9
--- /dev/null
+++ b/common/boards/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-$(CONFIG_BOARD_QEMU_VIRT)	+= qemu-virt/
diff --git a/common/boards/qemu-virt/Makefile b/common/boards/qemu-virt/Makefile
new file mode 100644
index 000000000000..f10d39138578
--- /dev/null
+++ b/common/boards/qemu-virt/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-y += board.o
+obj-y += overlay-of-flash.dtb.o
diff --git a/arch/arm/boards/qemu-virt/board.c b/common/boards/qemu-virt/board.c
similarity index 100%
rename from arch/arm/boards/qemu-virt/board.c
rename to common/boards/qemu-virt/board.c
diff --git a/arch/arm/boards/qemu-virt/overlay-of-flash.dts b/common/boards/qemu-virt/overlay-of-flash.dts
similarity index 100%
rename from arch/arm/boards/qemu-virt/overlay-of-flash.dts
rename to common/boards/qemu-virt/overlay-of-flash.dts
-- 
2.30.2




More information about the barebox mailing list