uboot-d1: add bootloader for upcoming d1 target
[openwrt/staging/mans0n.git] / package / boot / uboot-d1 / patches / 0058-sunxi-Share-the-board-Kconfig-across-architectures.patch
1 From 5d197433cd54085306e369ac260e09fe6077bfbb Mon Sep 17 00:00:00 2001
2 From: Samuel Holland <samuel@sholland.org>
3 Date: Thu, 4 Aug 2022 21:30:57 -0500
4 Subject: [PATCH 58/90] sunxi: Share the board Kconfig across architectures
5
6 With the introduction of the Allwinner D1, the sunxi board family now
7 spans multiple architectures (ARM and RISC-V). Since ARCH_SUNXI depends
8 on ARM, it cannot be used to gate architecture-independent options.
9 Specifically, this means the board Kconfig file cannot be sourced from
10 inside the "if ARCH_SUNXI" block.
11
12 Introduce a new BOARD_SUNXI symbol that can be selected by both
13 ARCH_SUNXI now and the new RISC-V SoC symbols when they are added, and
14 use it to gate the architecture-independent board options.
15
16 Signed-off-by: Samuel Holland <samuel@sholland.org>
17 ---
18 arch/Kconfig | 1 +
19 arch/arm/Kconfig | 1 +
20 arch/arm/mach-sunxi/Kconfig | 2 --
21 board/sunxi/Kconfig | 11 +++++++++++
22 4 files changed, 13 insertions(+), 2 deletions(-)
23
24 --- a/arch/Kconfig
25 +++ b/arch/Kconfig
26 @@ -482,6 +482,7 @@ source "arch/Kconfig.nxp"
27 endif
28
29 source "board/keymile/Kconfig"
30 +source "board/sunxi/Kconfig"
31
32 if MIPS || MICROBLAZE
33
34 --- a/arch/arm/Kconfig
35 +++ b/arch/arm/Kconfig
36 @@ -1090,6 +1090,7 @@ config ARCH_SOCFPGA
37 config ARCH_SUNXI
38 bool "Support sunxi (Allwinner) SoCs"
39 select BINMAN
40 + select BOARD_SUNXI
41 select CMD_GPIO if GPIO
42 select CMD_MMC if MMC
43 select CMD_USB if DISTRO_DEFAULTS && USB_HOST
44 --- a/arch/arm/mach-sunxi/Kconfig
45 +++ b/arch/arm/mach-sunxi/Kconfig
46 @@ -959,8 +959,6 @@ config BLUETOOTH_DT_DEVICE_FIXUP
47 The used address is "bdaddr" if set, and "ethaddr" with the LSB
48 flipped elsewise.
49
50 -source "board/sunxi/Kconfig"
51 -
52 endif
53
54 config CHIP_DIP_SCAN
55 --- a/board/sunxi/Kconfig
56 +++ b/board/sunxi/Kconfig
57 @@ -1,3 +1,10 @@
58 +config BOARD_SUNXI
59 + bool
60 +
61 +if BOARD_SUNXI
62 +
63 +menu "sunxi board options"
64 +
65 choice
66 prompt "SPL Image Type"
67 depends on SPL
68 @@ -23,3 +30,7 @@ config SPL_IMAGE_TYPE
69 string
70 default "sunxi_egon" if SPL_IMAGE_TYPE_SUNXI_EGON
71 default "sunxi_toc0" if SPL_IMAGE_TYPE_SUNXI_TOC0
72 +
73 +endmenu
74 +
75 +endif