[PATCH 05/22] sunxi: Share the board Kconfig across architectures

Samuel Holland samuel at sholland.org
Tue Nov 1 06:08:17 CET 2022


With the introduction of the Allwinner D1, the sunxi board family now
spans multiple architectures (ARM and RISC-V). Since ARCH_SUNXI depends
on ARM, it cannot be used to gate architecture-independent options.
Specifically, this means the board Kconfig file cannot be sourced from
inside the "if ARCH_SUNXI" block.

Introduce a new BOARD_SUNXI symbol that can be selected by both
ARCH_SUNXI now and the new RISC-V SoC symbols when they are added, and
use it to gate the architecture-independent board options.

Signed-off-by: Samuel Holland <samuel at sholland.org>
---

 arch/Kconfig                |  1 +
 arch/arm/Kconfig            |  1 +
 arch/arm/mach-sunxi/Kconfig |  2 --
 board/sunxi/Kconfig         | 11 +++++++++++
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index e3a456a98d..a77192096a 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -458,6 +458,7 @@ source "arch/Kconfig.nxp"
 endif
 
 source "board/keymile/Kconfig"
+source "board/sunxi/Kconfig"
 
 if MIPS || MICROBLAZE
 
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4e5daa9e7f..f2852783d4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1134,6 +1134,7 @@ config ARCH_SOCFPGA
 config ARCH_SUNXI
 	bool "Support sunxi (Allwinner) SoCs"
 	select BINMAN
+	select BOARD_SUNXI
 	select CMD_GPIO if GPIO
 	select CMD_MMC if MMC
 	select CMD_USB if DISTRO_DEFAULTS && USB_HOST
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index dbe6005daa..a03e700a0b 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -1046,8 +1046,6 @@ config BLUETOOTH_DT_DEVICE_FIXUP
 	  The used address is "bdaddr" if set, and "ethaddr" with the LSB
 	  flipped elsewise.
 
-source "board/sunxi/Kconfig"
-
 endif
 
 config CHIP_DIP_SCAN
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 42f61df5c5..9010631b16 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -1,3 +1,10 @@
+config BOARD_SUNXI
+	bool
+
+if BOARD_SUNXI
+
+menu "sunxi board options"
+
 choice
 	prompt "SPL Image Type"
 	depends on SPL
@@ -23,3 +30,7 @@ config SPL_IMAGE_TYPE
 	string
 	default "sunxi_egon" if SPL_IMAGE_TYPE_SUNXI_EGON
 	default "sunxi_toc0" if SPL_IMAGE_TYPE_SUNXI_TOC0
+
+endmenu
+
+endif
-- 
2.37.3



More information about the U-Boot mailing list