sunxi: Prepare platform Kconfig to support multiple architectures
Subsystems (17)
Samuel Holland
maintainercover sunxi: Prepare platform Kconfig to support multiple architectures
sunxi is getting a new RISC-V platform, D1. We want to share as much of the existing configuration as possible, to provide a familiar environment, DRAM layout, partition layout, etc.
Because U-Boot includes all architecture Kconfig files at once, we must use a symbol outside of both CONFIG_ARM and CONFIG_RISCV to contain shared Kconfig options. I chose BOARD_SUNXI, corresponding to the file location and somewhat following the BOARD_SPECIFIC_OPTIONS pattern.
I did a buildman run on this series. The only net option changes are the expected ones:
- Host-side USB gets enabled on several boards by the first patch (emlid_neutis_n5_devboard orangepi_zero2 pinephone pinetab tanix_tx6 x96_mate teres_i)
- CONFIG_BOARD_SUNXI gets added everywhere
- CONFIG_SYS_I2C_MVTWSI gets enabled by the corresponding patch
Andre, please feel free to take any subset of these; they don't all have to go in at once. And I'm open to suggestions about what instances of ARCH_SUNXI should (not) be converted. Some of them are open to opinion.
I left alone the options in arch/arm/mach-sunxi/Kconfig that are covered by other series (MMC CD/USB PHY/power pins, AXP GPIO).
After this series, the Kconfig changes needed for D1 support are quite small, something like this commit:
https://github.com/smaeul/u-boot/commit/c12cf6c5d72f5327eff793518229ddbd41dcf729.patch
Adding SUNXI_MINIMUM_DRAM_MB certainly made things nicer. There are a few options that probably still need some adjustment to respect it.
Samuel Holland (22):
sunxi: Fix default-enablement of USB host drivers
sunxi: Remove unnecessary Kconfig selections
sunxi: Add missing dependencies to Kconfig selections
sunxi: Hide image type selection if SPL is disabled
sunxi: Share the board Kconfig across architectures
sunxi: Move most Kconfig selections to the board Kconfig
sunxi: Globally enable SUPPORT_SPL
sunxi: Downgrade driver selections to implications
sunxi: Enable the I2C driver by default
sunxi: Move default values to the board Kconfig
sunxi: Hide the SUNXI_MINIMUM_DRAM_MB symbol
sunxi: Clean up the SPL_STACK_R_ADDR defaults
sunxi: Move PRE_CON_BUF_ADDR to the board Kconfig
sunxi: Move SPL_BSS_START_ADDR to the board Kconfig
sunxi: Move SPL_TEXT_BASE to the board Kconfig
sunxi: Move SYS_LOAD_ADDR to the board Kconfig
sunxi: Move TEXT_BASE to the board Kconfig
sunxi: Move most board options to the board Kconfig
env: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
drivers: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
disk: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
spl: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
Kconfig | 3 - arch/Kconfig | 1 + arch/arm/Kconfig | 48 +------- arch/arm/mach-sunxi/Kconfig | 154 ----------------------- board/sunxi/Kconfig | 224 ++++++++++++++++++++++++++++++++++ boot/Kconfig | 4 - common/Kconfig | 2 - common/spl/Kconfig | 18 +-- disk/Kconfig | 6 +- drivers/clk/sunxi/Kconfig | 2 +- drivers/fastboot/Kconfig | 13 +- drivers/gpio/Kconfig | 2 +- drivers/mmc/Kconfig | 2 +- drivers/net/phy/Kconfig | 4 +- drivers/phy/allwinner/Kconfig | 2 +- drivers/pinctrl/sunxi/Kconfig | 2 +- drivers/reset/Kconfig | 2 +- drivers/spi/Kconfig | 2 +- drivers/usb/Kconfig | 2 +- drivers/usb/gadget/Kconfig | 8 +- drivers/usb/host/Kconfig | 2 - drivers/usb/musb-new/Kconfig | 2 +- drivers/video/Kconfig | 2 +- drivers/watchdog/Kconfig | 4 +- env/Kconfig | 12 +- scripts/Makefile.spl | 2 +- 26 files changed, 267 insertions(+), 258 deletions(-)
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 1/22 sunxi: Fix default-enablement of USB host drivers
We tried to enable USB_EHCI_GENERIC and USB_OHCI_GENERIC by default. This did not work because those symbols depend on USB_EHCI_HCD and USB_OHCI_HCD, which were not enabled. Fix this by implying all four.
---
arch/arm/Kconfig | 4 ++++ drivers/usb/host/Kconfig | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/Kconfig +4 -0
@@ -1185,7 +1185,11 @@ config ARCH_SUNXI imply SYSRESET imply SYSRESET_WATCHDOG imply SYSRESET_WATCHDOG_AUTO + imply USB_EHCI_GENERIC + imply USB_EHCI_HCD imply USB_GADGET + imply USB_OHCI_GENERIC + imply USB_OHCI_HCD imply WDT config ARCH_U8500
drivers/usb/host/Kconfig +0 -2
@@ -280,7 +280,6 @@ config USB_EHCI_ZYNQ config USB_EHCI_GENERIC bool "Support for generic EHCI USB controller" depends on DM_USB - default ARCH_SUNXI ---help--- Enables support for generic EHCI controller.
@@ -342,7 +341,6 @@ config USB_OHCI_PCI config USB_OHCI_GENERIC bool "Support for generic OHCI USB controller" - default ARCH_SUNXI ---help--- Enables support for generic OHCI controller.
Signature · 1 line
2.37.3
Re: [PATCH 01/22] sunxi: Fix default-enablement of USB host drivers
On Tue, 1 Nov 2022 00:08:13 -0500
Samuel Holland <[email protected]> wrote:
Hi Samuel,
Quoted 1 line
We tried to enable
USB_EHCI_GENERICandUSB_OHCI_GENERICby default.
Well, I am not really sure that was the real intention, looking at commit 29d280c88a1ff3, and the fact that those symbols are still explicitly defined in many board config files.
My main concern is that this change enables USB on many boards which had it disabled - at least some of them probably on purpose. I believe for the Pinephone for instance it's off to decrease boot time.
Quoted 2 lines
This did not work because those symbols depend on
USB_EHCI_HCDandUSB_OHCI_HCD, which were not enabled. Fix this by implying all four.
The change itself looks correct, but as mentioned, 47 out of 161 boards now come with USB newly enabled. 25 of those don't have EHCI or OHCI nodes in their DT, so enabling USB doesn't make much sense there. For the others I don't know if USB was disabled on purpose, on some tablets for instance it seems that the only USB HCI port is connected to an on-board WiFi chip, which we don't support in U-Boot.
So in a first round I would like to skip this patch. If we want to have it (I am not against it, since the majority of boards have USB), this should be paired with:
# USB_EHCI_HCD is not set
# USB_OHCI_HCD is not set
in the defconfigs at least for those boards without HCI DT nodes (I have a list), to keep it disabled there.
If someone cares, and it has been disabled by mistake, they can fix that with an extra patch.
For the other boards we should remove the ?HCI symbols from their defconfigs, since they would be redundant then.
Cheers,
Andre
Quoted 43 lines
Signed-off-by Samuel Holland <[email protected]>---
arch/arm/Kconfig | 4 ++++ drivers/usb/host/Kconfig | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-)arch/arm/Kconfig +4
-0@@ -1185,7 +1185,11 @@ config ARCH_SUNXI imply SYSRESET imply SYSRESET_WATCHDOG imply SYSRESET_WATCHDOG_AUTO + imply USB_EHCI_GENERIC + imply USB_EHCI_HCD imply USB_GADGET + imply USB_OHCI_GENERIC + imply USB_OHCI_HCD imply WDT config ARCH_U8500drivers/usb/host/Kconfig +0
-2@@ -280,7 +280,6 @@ config USB_EHCI_ZYNQ config USB_EHCI_GENERIC bool "Support for generic EHCI USB controller" depends on DM_USB - default ARCH_SUNXI ---help--- Enables support for generic EHCI controller.@@ -342,7 +341,6 @@ config USB_OHCI_PCI config USB_OHCI_GENERIC bool "Support for generic OHCI USB controller" - default ARCH_SUNXI ---help--- Enables support for generic OHCI controller.
Samuel Holland
maintainerPATCH 2/22 sunxi: Remove unnecessary Kconfig selections
In reply to Samuel HollandTwo of these selections are redundant and have no effect:
- DM_KEYBOARD is selected by USB_KEYBOARD
- DM_MMC is selected by MMC
This selection has no effect by default and is unnecessarily strong:
- USB_STORAGE is implied by DISTRO_DEFAULTS
---
arch/arm/Kconfig | 3 --- 1 file changed, 3 deletions(-)
arch/arm/Kconfig +0 -3
@@ -1144,8 +1144,6 @@ config ARCH_SUNXI select DM_I2C if I2C select DM_SPI if SPI select DM_SPI_FLASH if SPI - select DM_KEYBOARD - select DM_MMC if MMC select DM_SCSI if SCSI select DM_SERIAL select GPIO_EXTRA_HEADER
@@ -1163,7 +1161,6 @@ config ARCH_SUNXI select SYS_THUMB_BUILD if !ARM64 select USB if DISTRO_DEFAULTS select USB_KEYBOARD if DISTRO_DEFAULTS && USB_HOST - select USB_STORAGE if DISTRO_DEFAULTS && USB_HOST select SPL_USE_TINY_PRINTF select USE_PREBOOT select SYS_RELOC_GD_ENV_ADDR
Signature · 1 line
2.37.3
Re: [PATCH 02/22] sunxi: Remove unnecessary Kconfig selections
Quoted 6 lines · On Tue, 1 Nov 2022 00:08:14 -0500 Samuel Holland <[email protected]> wrote:
Two of these selections are redundant and have no effect:
-DM_KEYBOARDis selected byUSB_KEYBOARD
-DM_MMCis selected by MMCThis selection has no effect by default and is unnecessarily strong:
-USB_STORAGEis implied byDISTRO_DEFAULTS
With patch 01/22 removed (for now), this disables DM_KEYBOARD on 15 boards, it looks like for those without USB. I wouldn't be aware of any other keyboard type supported on Allwinner boards, so the change is fine:
Quoted 1 line
Signed-off-by Samuel Holland <[email protected]>
Cheers,
Andre
Quoted 26 lines
---
arch/arm/Kconfig | 3 --- 1 file changed, 3 deletions(-)arch/arm/Kconfig +0
-3@@ -1144,8 +1144,6 @@ config ARCH_SUNXI select DM_I2C if I2C select DM_SPI if SPI select DM_SPI_FLASH if SPI - select DM_KEYBOARD - select DM_MMC if MMC select DM_SCSI if SCSI select DM_SERIAL select GPIO_EXTRA_HEADER@@ -1163,7 +1161,6 @@ config ARCH_SUNXI select SYS_THUMB_BUILD if !ARM64 select USB if DISTRO_DEFAULTS select USB_KEYBOARD if DISTRO_DEFAULTS && USB_HOST - select USB_STORAGE if DISTRO_DEFAULTS && USB_HOST select SPL_USE_TINY_PRINTF select USE_PREBOOT select SYS_RELOC_GD_ENV_ADDR
Samuel Holland
maintainerPATCH 3/22 sunxi: Add missing dependencies to Kconfig selections
In reply to Samuel HollandSome of the selected symbols have a user-visible dependency. Make the selections conditional on that dependency to avoid creating invalid configurations.
---
arch/arm/Kconfig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm/Kconfig +8 -8
@@ -1134,30 +1134,30 @@ config ARCH_SOCFPGA config ARCH_SUNXI bool "Support sunxi (Allwinner) SoCs" select BINMAN - select CMD_GPIO + select CMD_GPIO if GPIO select CMD_MMC if MMC select CMD_USB if DISTRO_DEFAULTS && USB_HOST select CLK select DM - select DM_ETH - select DM_GPIO + select DM_ETH if NET + select DM_GPIO if GPIO select DM_I2C if I2C + select DM_SCSI if BLK && SCSI + select DM_SERIAL if SERIAL select DM_SPI if SPI select DM_SPI_FLASH if SPI - select DM_SCSI if SCSI - select DM_SERIAL select GPIO_EXTRA_HEADER select OF_BOARD_SETUP select OF_CONTROL select OF_SEPARATE select PINCTRL - select SPECIFY_CONSOLE_INDEX + select SPECIFY_CONSOLE_INDEX if SERIAL select SPL_SEPARATE_BSS if SPL select SPL_STACK_R if SPL select SPL_SYS_MALLOC_SIMPLE if SPL select SPL_SYS_THUMB_BUILD if !ARM64 - select SUNXI_GPIO - select SYS_NS16550 + select SUNXI_GPIO if GPIO + select SYS_NS16550 if SERIAL select SYS_THUMB_BUILD if !ARM64 select USB if DISTRO_DEFAULTS select USB_KEYBOARD if DISTRO_DEFAULTS && USB_HOST
Signature · 1 line
2.37.3
Re: [PATCH 03/22] sunxi: Add missing dependencies to Kconfig selections
Quoted 3 lines · On Tue, 1 Nov 2022 00:08:15 -0500 Samuel Holland <[email protected]> wrote:
Some of the selected symbols have a user-visible dependency. Make the selections conditional on that dependency to avoid creating invalid configurations.
No change in any of the generated configs, so looks fine:
Quoted 1 line
Signed-off-by Samuel Holland <[email protected]>
Thanks,
Andre
Quoted 48 lines
---
arch/arm/Kconfig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)arch/arm/Kconfig +8
-8@@ -1134,30 +1134,30 @@ config ARCH_SOCFPGA config ARCH_SUNXI bool "Support sunxi (Allwinner) SoCs" select BINMAN - select CMD_GPIO + select CMD_GPIO if GPIO select CMD_MMC if MMC select CMD_USB if DISTRO_DEFAULTS && USB_HOST select CLK select DM - select DM_ETH - select DM_GPIO + select DM_ETH if NET + select DM_GPIO if GPIO select DM_I2C if I2C + select DM_SCSI if BLK && SCSI + select DM_SERIAL if SERIAL select DM_SPI if SPI select DM_SPI_FLASH if SPI - select DM_SCSI if SCSI - select DM_SERIAL select GPIO_EXTRA_HEADER select OF_BOARD_SETUP select OF_CONTROL select OF_SEPARATE select PINCTRL - select SPECIFY_CONSOLE_INDEX + select SPECIFY_CONSOLE_INDEX if SERIAL select SPL_SEPARATE_BSS if SPL select SPL_STACK_R if SPL select SPL_SYS_MALLOC_SIMPLE if SPL select SPL_SYS_THUMB_BUILD if !ARM64 - select SUNXI_GPIO - select SYS_NS16550 + select SUNXI_GPIO if GPIO + select SYS_NS16550 if SERIAL select SYS_THUMB_BUILD if !ARM64 select USB if DISTRO_DEFAULTS select USB_KEYBOARD if DISTRO_DEFAULTS && USB_HOST
Samuel Holland
maintainerPATCH 4/22 sunxi: Hide image type selection if SPL is disabled
In reply to Samuel HollandThis choice is meaningless when SPL is disabled. Hide it to avoid any possible confusion.
---
board/sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+)
board/sunxi/Kconfig +1 -0
@@ -1,5 +1,6 @@ choice prompt "SPL Image Type" + depends on SPL default SPL_IMAGE_TYPE_SUNXI_EGON config SPL_IMAGE_TYPE_SUNXI_EGON
Signature · 1 line
2.37.3
Re: [PATCH 04/22] sunxi: Hide image type selection if SPL is disabled
Quoted 4 lines · On Tue, 1 Nov 2022 00:08:16 -0500 Samuel Holland <[email protected]> wrote:
This choice is meaningless when SPL is disabled. Hide it to avoid any possible confusion.
Signed-off-by Samuel Holland <[email protected]>
Cheers,
Andre
Quoted 16 lines
---
board/sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+)board/sunxi/Kconfig +1
-0@@ -1,5 +1,6 @@ choice prompt "SPL Image Type" + depends on SPL default SPL_IMAGE_TYPE_SUNXI_EGON config SPL_IMAGE_TYPE_SUNXI_EGON
Samuel Holland
maintainerPATCH 5/22 sunxi: Share the board Kconfig across architectures
In reply to Samuel HollandWith 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.
---
arch/Kconfig | 1 + arch/arm/Kconfig | 1 + arch/arm/mach-sunxi/Kconfig | 2 -- board/sunxi/Kconfig | 11 +++++++++++ 4 files changed, 13 insertions(+), 2 deletions(-)
arch/Kconfig +1 -0
@@ -458,6 +458,7 @@ source "arch/Kconfig.nxp" endif source "board/keymile/Kconfig" +source "board/sunxi/Kconfig" if MIPS || MICROBLAZE
arch/arm/Kconfig +1 -0
@@ -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
arch/arm/mach-sunxi/Kconfig +0 -2
@@ -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
board/sunxi/Kconfig +11 -0
@@ -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
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 6/22 sunxi: Move most Kconfig selections to the board Kconfig
In reply to Samuel HollandTo maintain consistent behavior across architectures, most of the options selected by ARCH_SUNXI should be selected for the D1 SoC as well. To accomplish this, select them from BOARD_SUNXI instead.
No functional change here. Lines are only moved and alphabetized.
---
arch/arm/Kconfig | 46 --------------------------------------------- board/sunxi/Kconfig | 46 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-)
arch/arm/Kconfig +0 -46
@@ -1133,62 +1133,16 @@ 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 - select CLK - select DM - select DM_ETH if NET - select DM_GPIO if GPIO - select DM_I2C if I2C - select DM_SCSI if BLK && SCSI - select DM_SERIAL if SERIAL - select DM_SPI if SPI - select DM_SPI_FLASH if SPI select GPIO_EXTRA_HEADER - select OF_BOARD_SETUP select OF_CONTROL select OF_SEPARATE - select PINCTRL select SPECIFY_CONSOLE_INDEX if SERIAL - select SPL_SEPARATE_BSS if SPL select SPL_STACK_R if SPL select SPL_SYS_MALLOC_SIMPLE if SPL select SPL_SYS_THUMB_BUILD if !ARM64 - select SUNXI_GPIO if GPIO - select SYS_NS16550 if SERIAL select SYS_THUMB_BUILD if !ARM64 - select USB if DISTRO_DEFAULTS - select USB_KEYBOARD if DISTRO_DEFAULTS && USB_HOST select SPL_USE_TINY_PRINTF - select USE_PREBOOT - select SYS_RELOC_GD_ENV_ADDR - imply BOARD_LATE_INIT - imply CMD_DM - imply CMD_GPT - imply CMD_UBI if MTD_RAW_NAND - imply DISTRO_DEFAULTS - imply FAT_WRITE - imply FIT - imply OF_LIBFDT_OVERLAY - imply PRE_CONSOLE_BUFFER - imply SPL_GPIO - imply SPL_LIBCOMMON_SUPPORT - imply SPL_LIBGENERIC_SUPPORT - imply SPL_MMC if MMC - imply SPL_POWER - imply SPL_SERIAL - imply SYSRESET - imply SYSRESET_WATCHDOG - imply SYSRESET_WATCHDOG_AUTO - imply USB_EHCI_GENERIC - imply USB_EHCI_HCD - imply USB_GADGET - imply USB_OHCI_GENERIC - imply USB_OHCI_HCD - imply WDT config ARCH_U8500 bool "ST-Ericsson U8500 Series"
board/sunxi/Kconfig +46 -0
51 lines not on this page · raw message
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 7/22 sunxi: Globally enable SUPPORT_SPL
In reply to Samuel HollandThis was already supported by every machine type. It is unlikely that any new SoC support will be added without SPL support.
---
arch/arm/mach-sunxi/Kconfig | 14 -------------- board/sunxi/Kconfig | 2 ++ 2 files changed, 2 insertions(+), 14 deletions(-)
arch/arm/mach-sunxi/Kconfig +0 -14
@@ -133,7 +133,6 @@ config SUN50I_GEN_H6 select FIT select SPL_LOAD_FIT select MMC_SUNXI_HAS_NEW_MODE - select SUPPORT_SPL ---help--- Select this for sunxi SoCs which have H6 like peripherals, clocks and memory map.
@@ -167,7 +166,6 @@ config MACH_SUNXI_H3_H5 select SUNXI_DRAM_DW select SUNXI_DRAM_DW_32BIT select SUNXI_GEN_SUN6I - select SUPPORT_SPL # TODO: try out A80's 8GiB DRAM space config SUNXI_DRAM_MAX_SIZE
@@ -184,7 +182,6 @@ config MACH_SUNIV bool "suniv (Allwinner F1C100s/F1C200s/F1C600/R6)" select CPU_ARM926EJS select SUNXI_GEN_SUN6I - select SUPPORT_SPL select SKIP_LOWLEVEL_INIT_ONLY select SPL_SKIP_LOWLEVEL_INIT_ONLY
@@ -194,7 +191,6 @@ config MACH_SUN4I select PHY_SUN4I_USB select DRAM_SUN4I select SUNXI_GEN_SUN4I - select SUPPORT_SPL imply SPL_SYS_I2C_LEGACY imply SYS_I2C_LEGACY
@@ -204,7 +200,6 @@ config MACH_SUN5I select DRAM_SUN4I select PHY_SUN4I_USB select SUNXI_GEN_SUN4I - select SUPPORT_SPL imply SPL_SYS_I2C_LEGACY imply SYS_I2C_LEGACY
@@ -220,7 +215,6 @@ config MACH_SUN6I select SPL_I2C select SUN6I_PRCM select SUNXI_GEN_SUN6I - select SUPPORT_SPL select SYS_I2C_SUN6I_P2WI select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
@@ -234,7 +228,6 @@ config MACH_SUN7I select DRAM_SUN4I select PHY_SUN4I_USB select SUNXI_GEN_SUN4I - select SUPPORT_SPL select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT imply SPL_SYS_I2C_LEGACY imply SYS_I2C_LEGACY
@@ -249,7 +242,6 @@ config MACH_SUN8I_A23 select PHY_SUN4I_USB select SPL_I2C select SUNXI_GEN_SUN6I - select SUPPORT_SPL select SYS_I2C_SUN8I_RSB select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
@@ -263,7 +255,6 @@ config MACH_SUN8I_A33 select PHY_SUN4I_USB select SPL_I2C select SUNXI_GEN_SUN6I - select SUPPORT_SPL select SYS_I2C_SUN8I_RSB select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
@@ -276,7 +267,6 @@ config MACH_SUN8I_A83T select SUNXI_GEN_SUN6I select MMC_SUNXI_HAS_NEW_MODE select MMC_SUNXI_HAS_MODE_SWITCH - select SUPPORT_SPL select SYS_I2C_SUN8I_RSB config MACH_SUN8I_H3
@@ -296,7 +286,6 @@ config MACH_SUN8I_R40 select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN6I select MMC_SUNXI_HAS_NEW_MODE - select SUPPORT_SPL select SUNXI_DRAM_DW select SUNXI_DRAM_DW_32BIT select PHY_SUN4I_USB
@@ -311,7 +300,6 @@ config MACH_SUN8I_V3S select SUNXI_GEN_SUN6I select SUNXI_DRAM_DW select SUNXI_DRAM_DW_16BIT - select SUPPORT_SPL select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT config MACH_SUN9I
@@ -322,7 +310,6 @@ config MACH_SUN9I select SPL_I2C select SUN6I_PRCM select SUNXI_GEN_SUN6I - select SUPPORT_SPL config MACH_SUN50I bool "sun50i (Allwinner A64)"
@@ -332,7 +319,6 @@ config MACH_SUN50I select SUNXI_DE2 select SUNXI_GEN_SUN6I select MMC_SUNXI_HAS_NEW_MODE - select SUPPORT_SPL select SUNXI_DRAM_DW select SUNXI_DRAM_DW_32BIT select FIT
board/sunxi/Kconfig +2 -0
@@ -18,6 +18,7 @@ config BOARD_SUNXI select SPL_SEPARATE_BSS if SPL select SUNXI_GPIO if GPIO select SYS_NS16550 if SERIAL + select SUPPORT_SPL select SYS_RELOC_GD_ENV_ADDR select USB if DISTRO_DEFAULTS select USB_KEYBOARD if DISTRO_DEFAULTS && USB_HOST
@@ -31,6 +32,7 @@ config BOARD_SUNXI imply FIT imply OF_LIBFDT_OVERLAY imply PRE_CONSOLE_BUFFER + imply SPL imply SPL_GPIO imply SPL_LIBCOMMON_SUPPORT imply SPL_LIBGENERIC_SUPPORT
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 8/22 sunxi: Downgrade driver selections to implications
In reply to Samuel HollandWhile not especially likely, it is plausible that someone wants to build U-Boot without GPIO or UART support. Don't force building these drivers.
---
board/sunxi/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
board/sunxi/Kconfig +2 -2
@@ -16,8 +16,6 @@ config BOARD_SUNXI select OF_BOARD_SETUP select PINCTRL select SPL_SEPARATE_BSS if SPL - select SUNXI_GPIO if GPIO - select SYS_NS16550 if SERIAL select SUPPORT_SPL select SYS_RELOC_GD_ENV_ADDR select USB if DISTRO_DEFAULTS
@@ -39,6 +37,8 @@ config BOARD_SUNXI imply SPL_MMC if MMC imply SPL_POWER imply SPL_SERIAL + imply SUNXI_GPIO + imply SYS_NS16550 imply SYSRESET imply SYSRESET_WATCHDOG imply SYSRESET_WATCHDOG_AUTO
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 9/22 sunxi: Enable the I2C driver by default
In reply to Samuel HollandThis is used by quite a large number of boards, for PMIC/regulator or LCD panel control.
---
board/sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+)
board/sunxi/Kconfig +1 -0
@@ -38,6 +38,7 @@ config BOARD_SUNXI imply SPL_POWER imply SPL_SERIAL imply SUNXI_GPIO + imply SYS_I2C_MVTWSI imply SYS_NS16550 imply SYSRESET imply SYSRESET_WATCHDOG
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 10/22 sunxi: Move default values to the board Kconfig
In reply to Samuel HollandThis keeps all of the defaults for sunxi platforms in one place. Most of these only depend on architecture-independent features of the SoC (clock tree or SRAM layout) anyway.
No functional change; just some minor help text cleanup.
---
arch/arm/mach-sunxi/Kconfig | 67 ------------------------------------ board/sunxi/Kconfig | 68 +++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 67 deletions(-)
arch/arm/mach-sunxi/Kconfig +0 -67
@@ -1,8 +1,5 @@ if ARCH_SUNXI -config IDENT_STRING - default " Allwinner Technology" - config DRAM_SUN4I bool help
@@ -99,17 +96,6 @@ config AXP_PMIC_BUS Select this PMIC bus access helpers for Sunxi platform PRCM or other AXP family PMIC devices. -config SUNXI_SRAM_ADDRESS - hex - default 0x10000 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5 - default 0x20000 if SUN50I_GEN_H6 - default 0x0 - ---help--- - Older Allwinner SoCs have their mask boot ROM mapped just below 4GB, - with the first SRAM region being located at address 0. - Some newer SoCs map the boot ROM at address 0 instead and move the - SRAM to a different address. - config SUNXI_A64_TIMER_ERRATUM bool
@@ -573,48 +559,6 @@ config DRAM_ODT_CORRECTION then the correction is negative. Usually the value for this is 0. endif -config SYS_CLK_FREQ - default 408000000 if MACH_SUNIV - default 1008000000 if MACH_SUN4I - default 1008000000 if MACH_SUN5I - default 1008000000 if MACH_SUN6I - default 912000000 if MACH_SUN7I - default 816000000 if MACH_SUN50I || MACH_SUN50I_H5 - default 1008000000 if MACH_SUN8I - default 1008000000 if MACH_SUN9I - default 888000000 if MACH_SUN50I_H6 - default 1008000000 if MACH_SUN50I_H616 - -config SYS_CONFIG_NAME - default "suniv" if MACH_SUNIV - default "sun4i" if MACH_SUN4I - default "sun5i" if MACH_SUN5I - default "sun6i" if MACH_SUN6I - default "sun7i" if MACH_SUN7I - default "sun8i" if MACH_SUN8I - default "sun9i" if MACH_SUN9I - default "sun50i" if MACH_SUN50I - default "sun50i" if MACH_SUN50I_H6 - default "sun50i" if MACH_SUN50I_H616 - -config SYS_BOARD - default "sunxi" - -config SYS_SOC - default "sunxi" - -config SUNXI_MINIMUM_DRAM_MB - int "minimum DRAM size" - default 32 if MACH_SUNIV - default 64 if MACH_SUN8I_V3S - default 256 - ---help--- - Minimum DRAM size expected on the board. Traditionally we assumed - 256 MB, so that U-Boot would load at 160MB. With co-packaged DRAM - we have smaller sizes, though, so that U-Boot's own load address and - the default payload addresses must be shifted down. - This is expected to be fixed by the SoC selection. - config UART0_PORT_F bool "UART0 on MicroSD breakout board" ---help---
@@ -985,17 +929,6 @@ config GMAC_TX_DELAY ---help--- Set the GMAC Transmit Clock Delay Chain value. -config SPL_STACK_R_ADDR - default 0x81e00000 if MACH_SUNIV - default 0x4fe00000 if MACH_SUN4I - default 0x4fe00000 if MACH_SUN5I - default 0x4fe00000 if MACH_SUN6I - default 0x4fe00000 if MACH_SUN7I - default 0x4fe00000 if MACH_SUN8I - default 0x2fe00000 if MACH_SUN9I - default 0x4fe00000 if MACH_SUN50I - default 0x4fe00000 if SUN50I_GEN_H6 - config SPL_SPI_SUNXI bool "Support for SPI Flash on Allwinner SoCs in SPL" depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNXI_H3_H5 || MACH_SUN50I || MACH_SUN8I_R40 || SUN50I_GEN_H6 || MACH_SUNIV
board/sunxi/Kconfig +68 -0
74 lines not on this page · raw message
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 11/22 sunxi: Hide the SUNXI_MINIMUM_DRAM_MB symbol
In reply to Samuel HollandThis option affects the ABI between SPL/U-Boot and U-Boot/scripts, so it should not normally be changed by the user.
---
board/sunxi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/sunxi/Kconfig +1 -1
@@ -67,7 +67,7 @@ config SPL_STACK_R_ADDR default 0x4fe00000 if SUN50I_GEN_H6 config SUNXI_MINIMUM_DRAM_MB - int "minimum DRAM size" + int default 32 if MACH_SUNIV default 64 if MACH_SUN8I_V3S default 256
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 12/22 sunxi: Clean up the SPL_STACK_R_ADDR defaults
In reply to Samuel HollandUpdate this option to be based on SUNXI_MINIMUM_DRAM_MB. This corrects the value used on V3s, which previously was the MACH_SUN8I default, and so relied on addresses wrapping modulo the DRAM size.
---
board/sunxi/Kconfig | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
board/sunxi/Kconfig +2 -7
@@ -57,14 +57,9 @@ config IDENT_STRING config SPL_STACK_R_ADDR default 0x81e00000 if MACH_SUNIV - default 0x4fe00000 if MACH_SUN4I - default 0x4fe00000 if MACH_SUN5I - default 0x4fe00000 if MACH_SUN6I - default 0x4fe00000 if MACH_SUN7I - default 0x4fe00000 if MACH_SUN8I default 0x2fe00000 if MACH_SUN9I - default 0x4fe00000 if MACH_SUN50I - default 0x4fe00000 if SUN50I_GEN_H6 + default 0x4fe00000 if SUNXI_MINIMUM_DRAM_MB >= 256 + default 0x43e00000 if SUNXI_MINIMUM_DRAM_MB >= 64 config SUNXI_MINIMUM_DRAM_MB int
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 13/22 sunxi: Move PRE_CON_BUF_ADDR to the board Kconfig
In reply to Samuel HollandThis provides a default value for RISC-V when that is added, and it makes sense to put this option next to the other DRAM layout options.
While at it, provide sensible values for platforms with less DRAM.
---
board/sunxi/Kconfig | 6 ++++++ common/Kconfig | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-)
board/sunxi/Kconfig +6 -0
@@ -55,6 +55,12 @@ if BOARD_SUNXI config IDENT_STRING default " Allwinner Technology" +config PRE_CON_BUF_ADDR + default 0x81000000 if MACH_SUNIV + default 0x2f000000 if MACH_SUN9I + default 0x4f000000 if SUNXI_MINIMUM_DRAM_MB >= 256 + default 0x43000000 if SUNXI_MINIMUM_DRAM_MB >= 64 + config SPL_STACK_R_ADDR default 0x81e00000 if MACH_SUNIV default 0x2fe00000 if MACH_SUN9I
common/Kconfig +0 -2
@@ -195,8 +195,6 @@ config PRE_CON_BUF_SZ config PRE_CON_BUF_ADDR hex "Address of the pre-console buffer" depends on PRE_CONSOLE_BUFFER - default 0x2f000000 if ARCH_SUNXI && MACH_SUN9I - default 0x4f000000 if ARCH_SUNXI && !MACH_SUN9I default 0x0f000000 if ROCKCHIP_RK3288 default 0x0f200000 if ROCKCHIP_RK3399 help
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 14/22 sunxi: Move SPL_BSS_START_ADDR to the board Kconfig
In reply to Samuel HollandThis provides a default value for RISC-V when that is added, and it makes sense to put this option next to the other DRAM layout options.
While at it, provide sensible values for platforms with less DRAM.
---
board/sunxi/Kconfig | 6 ++++++ common/spl/Kconfig | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-)
board/sunxi/Kconfig +6 -0
@@ -61,6 +61,12 @@ config PRE_CON_BUF_ADDR default 0x4f000000 if SUNXI_MINIMUM_DRAM_MB >= 256 default 0x43000000 if SUNXI_MINIMUM_DRAM_MB >= 64 +config SPL_BSS_START_ADDR + default 0x81f80000 if MACH_SUNIV + default 0x2ff80000 if MACH_SUN9I + default 0x4ff80000 if SUNXI_MINIMUM_DRAM_MB >= 256 + default 0x43f80000 if SUNXI_MINIMUM_DRAM_MB >= 64 + config SPL_STACK_R_ADDR default 0x81e00000 if MACH_SUNIV default 0x2fe00000 if MACH_SUN9I
common/spl/Kconfig +0 -3
@@ -118,9 +118,6 @@ config SPL_BSS_START_ADDR default 0x88200000 if (ARCH_MX6 && (MX6SX || MX6SL || MX6UL || MX6ULL)) || ARCH_MX7 default 0x18200000 if ARCH_MX6 && !(MX6SX || MX6SL || MX6UL || MX6ULL) default 0x80a00000 if ARCH_OMAP2PLUS - default 0x81f80000 if ARCH_SUNXI && MACH_SUNIV - default 0x4ff80000 if ARCH_SUNXI && !(MACH_SUN9I || MACH_SUNIV) - default 0x2ff80000 if ARCH_SUNXI && MACH_SUN9I default 0x1000 if ARCH_ZYNQMP choice
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 15/22 sunxi: Move SPL_TEXT_BASE to the board Kconfig
In reply to Samuel HollandIt makes sense to put this near the definition of SUNXI_SRAM_ADDRESS.
---
board/sunxi/Kconfig | 5 +++++ common/spl/Kconfig | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-)
board/sunxi/Kconfig +5 -0
@@ -73,6 +73,11 @@ config SPL_STACK_R_ADDR default 0x4fe00000 if SUNXI_MINIMUM_DRAM_MB >= 256 default 0x43e00000 if SUNXI_MINIMUM_DRAM_MB >= 64 +config SPL_TEXT_BASE + default 0x10060 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5 + default 0x20060 if SUN50I_GEN_H6 + default 0x00060 + config SUNXI_MINIMUM_DRAM_MB int default 32 if MACH_SUNIV
common/spl/Kconfig +0 -3
@@ -260,9 +260,6 @@ config SPL_TEXT_BASE default 0x402F4000 if AM43XX default 0x402F0400 if AM33XX default 0x40301350 if OMAP54XX - default 0x10060 if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN9I - default 0x20060 if SUN50I_GEN_H6 - default 0x00060 if ARCH_SUNXI default 0xfffc0000 if ARCH_ZYNQMP default 0x0 help
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 16/22 sunxi: Move SYS_LOAD_ADDR to the board Kconfig
In reply to Samuel HollandThis will provide a default value for RISC-V when that is added, and it makes sense to put this option next to the other DRAM layout options.
---
Kconfig | 3 --- board/sunxi/Kconfig | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-)
Kconfig +0 -3
@@ -508,9 +508,6 @@ config SYS_LOAD_ADDR hex "Address in memory to use by default" default 0x01000000 if ARCH_SOCFPGA default 0x02000000 if PPC || X86 - default 0x81000000 if MACH_SUNIV - default 0x22000000 if MACH_SUN9I - default 0x42000000 if ARCH_SUNXI default 0x82000000 if ARCH_KEYSTONE || ARCH_OMAP2PLUS || ARCH_K3 default 0x82000000 if ARCH_MX6 && (MX6SL || MX6SLL || MX6SX || MX6UL || MX6ULL) default 0x12000000 if ARCH_MX6 && !(MX6SL || MX6SLL || MX6SX || MX6UL || MX6ULL)
board/sunxi/Kconfig +5 -0
@@ -129,6 +129,11 @@ config SYS_CONFIG_NAME default "sun50i" if MACH_SUN50I_H6 default "sun50i" if MACH_SUN50I_H616 +config SYS_LOAD_ADDR + default 0x81000000 if MACH_SUNIV + default 0x22000000 if MACH_SUN9I + default 0x42000000 + config SYS_SOC default "sunxi"
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 17/22 sunxi: Move TEXT_BASE to the board Kconfig
In reply to Samuel HollandThis is how the vast majority of platforms provided TEXT_BASE. sunxi was the exception here.
---
board/sunxi/Kconfig | 6 ++++++ boot/Kconfig | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-)
board/sunxi/Kconfig +6 -0
@@ -137,6 +137,12 @@ config SYS_LOAD_ADDR config SYS_SOC default "sunxi" +config TEXT_BASE + default 0x81700000 if MACH_SUNIV + default 0x2a000000 if MACH_SUN9I + default 0x4a000000 if SUNXI_MINIMUM_DRAM_MB >= 256 + default 0x42e00000 if SUNXI_MINIMUM_DRAM_MB >= 64 + menu "sunxi board options" choice
boot/Kconfig +0 -4
@@ -633,10 +633,6 @@ config TEXT_BASE depends on HAVE_TEXT_BASE default 0x0 if POSITION_INDEPENDENT default 0x80800000 if ARCH_OMAP2PLUS || ARCH_K3 - default 0x81700000 if MACH_SUNIV - default 0x2a000000 if MACH_SUN9I - default 0x4a000000 if SUNXI_MINIMUM_DRAM_MB >= 256 - default 0x42e00000 if SUNXI_MINIMUM_DRAM_MB >= 64 hex "Text Base" help The address in memory that U-Boot will be running from, initially.
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 18/22 sunxi: Move most board options to the board Kconfig
In reply to Samuel HollandThis excludes options that are inherently ARM-specific or are specific to legacy non-DM drivers.
Some help text is cleaned up along the way.
---
arch/arm/mach-sunxi/Kconfig | 71 ------------------------------------ board/sunxi/Kconfig | 72 +++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 71 deletions(-)
arch/arm/mach-sunxi/Kconfig +0 -71
@@ -559,16 +559,6 @@ config DRAM_ODT_CORRECTION then the correction is negative. Usually the value for this is 0. endif -config UART0_PORT_F - bool "UART0 on MicroSD breakout board" - ---help--- - Repurpose the SD card slot for getting access to the UART0 serial - console. Primarily useful only for low level u-boot debugging on - tablets, where normal UART0 is difficult to access and requires - device disassembly and/or soldering. As the SD card can't be used - at the same time, the system can be only booted in the FEL mode. - Only enable this if you really know what you are doing. - config OLD_SUNXI_KERNEL_COMPAT bool "Enable workarounds for booting old kernels" ---help---
@@ -609,20 +599,6 @@ config MMC3_CD_PIN ---help--- See MMC0_CD_PIN help text. -config MMC1_PINS_PH - bool "Pins for mmc1 are on Port H" - depends on MACH_SUN4I || MACH_SUN7I || MACH_SUN8I_R40 - ---help--- - Select this option for boards where mmc1 uses the Port H pinmux. - -config MMC_SUNXI_SLOT_EXTRA - int "mmc extra slot number" - default -1 - ---help--- - sunxi builds always enable mmc0, some boards also have a second sdcard - slot or emmc on mmc1 - mmc3. Setting this to 1, 2 or 3 will enable - support for this. - config USB0_VBUS_PIN string "Vbus enable pin for usb0 (otg)" default ""
@@ -699,16 +675,6 @@ config AXP_GPIO ---help--- Say Y here to enable support for the gpio pins of the axp PMIC ICs. -config AXP_DISABLE_BOOT_ON_POWERON - bool "Disable device boot on power plug-in" - depends on AXP209_POWER || AXP221_POWER || AXP809_POWER || AXP818_POWER - default n - ---help--- - Say Y here to prevent the device from booting up because of a plug-in - event. When set, the device will boot into the SPL briefly to - determine why it was powered on, and if it was determined because of - a plug-in event instead of a button press event it will shut back off. - config VIDEO_SUNXI bool "Enable graphical uboot console on HDMI, LCD or VGA" depends on !MACH_SUN8I_A83T
@@ -937,41 +903,4 @@ config SPL_SPI_SUNXI sunxi SPI Flash. It uses the same method as the boot ROM, so does not need any extra configuration. -config PINE64_DT_SELECTION - bool "Enable Pine64 device tree selection code" - depends on MACH_SUN50I - help - The original Pine A64 and Pine A64+ are similar but different - boards and can be differed by the DRAM size. Pine A64 has - 512MiB DRAM, and Pine A64+ has 1GiB or 2GiB. By selecting this - option, the device tree selection code specific to Pine64 which - utilizes the DRAM size will be enabled. - -config PINEPHONE_DT_SELECTION - bool "Enable PinePhone device tree selection code" - depends on MACH_SUN50I - help - Enable this option to automatically select the device tree for the - correct PinePhone hardware revision during boot. - -config BLUETOOTH_DT_DEVICE_FIXUP - string "Fixup the Bluetooth controller address" - default "" - help - This option specifies the DT compatible name of the Bluetooth - controller for which to set the "local-bd-address" property. - Set this option if your device ships with the Bluetooth controller - default address. - The used address is "bdaddr" if set, and "ethaddr" with the LSB - flipped elsewise. - endif - -config CHIP_DIP_SCAN - bool "Enable DIPs detection for CHIP board" - select SUPPORT_EXTENSION_SCAN - select W1 - select W1_GPIO - select W1_EEPROM - select W1_EEPROM_DS24XXX - select CMD_EXTENSION
board/sunxi/Kconfig +72 -0
78 lines not on this page · raw message
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 19/22 env: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
In reply to Samuel HollandThis ensures the same environment layout will be used across all sunxi boards, regardless of CPU architecture.
---
env/Kconfig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
env/Kconfig +6 -6
@@ -92,7 +92,7 @@ config ENV_IS_IN_FAT bool "Environment is in a FAT filesystem" depends on !CHAIN_OF_TRUST default y if ARCH_BCM283X - default y if ARCH_SUNXI && MMC + default y if BOARD_SUNXI && MMC default y if MMC_OMAP_HS && TI_COMMON_CMD_OPTIONS select FS_FAT select FAT_WRITE
@@ -338,7 +338,7 @@ config ENV_IS_IN_SPI_FLASH default y if NORTHBRIDGE_INTEL_IVYBRIDGE default y if INTEL_QUARK default y if INTEL_QUEENSBAY - default y if ARCH_SUNXI + default y if BOARD_SUNXI help Define this if you have a SPI Flash memory device which you want to use for the environment.
@@ -461,7 +461,7 @@ config ENV_FAT_DEVICE_AND_PART depends on ENV_IS_IN_FAT default "0:1" if TI_COMMON_CMD_OPTIONS default "0:auto" if ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL - default ":auto" if ARCH_SUNXI + default ":auto" if BOARD_SUNXI default "0" if ARCH_AT91 help Define this to a string to specify the partition of the device. It can
@@ -555,7 +555,7 @@ config ENV_OFFSET ENV_IS_IN_SPI_FLASH default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH - default 0xF0000 if ARCH_SUNXI + default 0xF0000 if BOARD_SUNXI default 0xE0000 if ARCH_ZYNQ default 0x1E00000 if ARCH_ZYNQMP default 0x7F40000 if ARCH_VERSAL || ARCH_VERSAL_NET
@@ -580,7 +580,7 @@ config ENV_SIZE hex "Environment Size" default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91 - default 0x10000 if ARCH_SUNXI + default 0x10000 if BOARD_SUNXI default 0x8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC default 0x2000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH default 0x8000 if ARCH_ZYNQMP || ARCH_VERSAL || ARCH_VERSAL_NET
@@ -596,7 +596,7 @@ config ENV_SECT_SIZE default 0x40000 if ARCH_ZYNQMP || ARCH_VERSAL || ARCH_VERSAL_NET default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91 default 0x20000 if MICROBLAZE && ENV_IS_IN_SPI_FLASH - default 0x10000 if ARCH_SUNXI && ENV_IS_IN_SPI_FLASH + default 0x10000 if BOARD_SUNXI && ENV_IS_IN_SPI_FLASH help Size of the sector containing the environment.
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 20/22 drivers: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
In reply to Samuel HollandThis provides a unified configuration across all sunxi boards, regardless of CPU architecture.
---
drivers/clk/sunxi/Kconfig | 2 +- drivers/fastboot/Kconfig | 13 ++++++------- drivers/gpio/Kconfig | 2 +- drivers/mmc/Kconfig | 2 +- drivers/net/phy/Kconfig | 4 ++-- drivers/phy/allwinner/Kconfig | 2 +- drivers/pinctrl/sunxi/Kconfig | 2 +- drivers/reset/Kconfig | 2 +- drivers/spi/Kconfig | 2 +- drivers/usb/Kconfig | 2 +- drivers/usb/gadget/Kconfig | 8 ++++---- drivers/usb/musb-new/Kconfig | 2 +- drivers/video/Kconfig | 2 +- drivers/watchdog/Kconfig | 4 ++-- 14 files changed, 24 insertions(+), 25 deletions(-)
drivers/clk/sunxi/Kconfig +1 -1
@@ -1,6 +1,6 @@ config CLK_SUNXI bool "Clock support for Allwinner SoCs" - depends on CLK && ARCH_SUNXI + depends on CLK && BOARD_SUNXI select DM_RESET select SPL_DM_RESET if SPL_CLK default y
drivers/fastboot/Kconfig +6 -7
@@ -8,7 +8,7 @@ config FASTBOOT config USB_FUNCTION_FASTBOOT bool "Enable USB fastboot gadget" depends on USB_GADGET - default y if ARCH_SUNXI && USB_MUSB_GADGET + default y if BOARD_SUNXI && USB_MUSB_GADGET select FASTBOOT select USB_GADGET_DOWNLOAD help
@@ -32,10 +32,9 @@ if FASTBOOT config FASTBOOT_BUF_ADDR hex "Define FASTBOOT buffer address" + default SYS_LOAD_ADDR if BOARD_SUNXI default 0x82000000 if MX6SX || MX6SL || MX6UL || MX6SLL default 0x81000000 if ARCH_OMAP2PLUS - default 0x42000000 if ARCH_SUNXI && !MACH_SUN9I - default 0x22000000 if ARCH_SUNXI && MACH_SUN9I default 0x60800800 if ROCKCHIP_RK3036 || ROCKCHIP_RK3188 || \ ROCKCHIP_RK322X default 0x800800 if ROCKCHIP_RK3288 || ROCKCHIP_RK3329 || \
@@ -52,7 +51,7 @@ config FASTBOOT_BUF_SIZE hex "Define FASTBOOT buffer size" default 0x8000000 if ARCH_ROCKCHIP default 0x6000000 if ARCH_ZYNQMP - default 0x2000000 if ARCH_SUNXI + default 0x2000000 if BOARD_SUNXI default 0x8192 if SANDBOX default 0x7000000 help
@@ -71,7 +70,7 @@ config FASTBOOT_USB_DEV config FASTBOOT_FLASH bool "Enable FASTBOOT FLASH command" - default y if ARCH_SUNXI || ARCH_ROCKCHIP + default y if BOARD_SUNXI || ARCH_ROCKCHIP depends on MMC || (MTD_RAW_NAND && CMD_MTDPARTS) select IMAGE_SPARSE help
@@ -105,8 +104,8 @@ config FASTBOOT_FLASH_MMC_DEV int "Define FASTBOOT MMC FLASH default device" depends on FASTBOOT_FLASH_MMC default 0 if ARCH_ROCKCHIP - default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1 - default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1 + default 0 if BOARD_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1 + default 1 if BOARD_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1 help The fastboot "flash" command requires additional information regarding the non-volatile storage device. Define this to
drivers/gpio/Kconfig +1 -1
@@ -363,7 +363,7 @@ config SANDBOX_GPIO_COUNT config SUNXI_GPIO bool "Allwinner GPIO driver" - depends on ARCH_SUNXI + depends on BOARD_SUNXI select SPL_STRTO if SPL help Support the GPIO device in Allwinner SoCs.
drivers/mmc/Kconfig +1 -1
@@ -749,7 +749,7 @@ config ZYNQ_HISPD_BROKEN config MMC_SUNXI bool "Allwinner sunxi SD/MMC Host Controller support" - depends on ARCH_SUNXI + depends on BOARD_SUNXI default y help This selects support for the SD/MMC Host Controller on
drivers/net/phy/Kconfig +2 -2
@@ -19,14 +19,14 @@ if PHYLIB config PHY_ADDR_ENABLE bool "Limit phy address" - default y if ARCH_SUNXI + default y if BOARD_SUNXI help Select this if you want to control which phy address is used if PHY_ADDR_ENABLE config PHY_ADDR int "PHY address" - default 1 if ARCH_SUNXI + default 1 if BOARD_SUNXI default 0 help The address of PHY on MII bus. Usually in range of 0 to 31.
drivers/phy/allwinner/Kconfig +1 -1
@@ -3,7 +3,7 @@ # config PHY_SUN4I_USB bool "Allwinner Sun4I USB PHY driver" - depends on ARCH_SUNXI + depends on BOARD_SUNXI select DM_REGULATOR select PHY help
drivers/pinctrl/sunxi/Kconfig +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -if ARCH_SUNXI +if BOARD_SUNXI config PINCTRL_SUNXI select PINCTRL_FULL
drivers/reset/Kconfig +1 -1
@@ -137,7 +137,7 @@ config RESET_MTMIPS config RESET_SUNXI bool "RESET support for Allwinner SoCs" - depends on DM_RESET && ARCH_SUNXI + depends on DM_RESET && BOARD_SUNXI default y help This enables support for common reset driver for
drivers/spi/Kconfig +1 -1
@@ -442,7 +442,7 @@ config SOFT_SPI config SPI_SUNXI bool "Allwinner SoC SPI controllers" - default ARCH_SUNXI + default BOARD_SUNXI help Enable the Allwinner SoC SPi controller driver.
drivers/usb/Kconfig +1 -1
@@ -116,7 +116,7 @@ config USB_KEYBOARD_FN_KEYS choice prompt "USB keyboard polling" - default SYS_USB_EVENT_POLL_VIA_INT_QUEUE if ARCH_SUNXI + default SYS_USB_EVENT_POLL_VIA_INT_QUEUE if BOARD_SUNXI default SYS_USB_EVENT_POLL ---help--- Enable a polling mechanism for USB keyboard.
drivers/usb/gadget/Kconfig +4 -4
@@ -40,7 +40,7 @@ if USB_GADGET config USB_GADGET_MANUFACTURER string "Vendor name of the USB device" - default "Allwinner Technology" if ARCH_SUNXI + default "Allwinner Technology" if BOARD_SUNXI default "Rockchip" if ARCH_ROCKCHIP default "U-Boot" help
@@ -49,7 +49,7 @@ config USB_GADGET_MANUFACTURER config USB_GADGET_VENDOR_NUM hex "Vendor ID of the USB device" - default 0x1f3a if ARCH_SUNXI + default 0x1f3a if BOARD_SUNXI default 0x2207 if ARCH_ROCKCHIP default 0x0 help
@@ -59,7 +59,7 @@ config USB_GADGET_VENDOR_NUM config USB_GADGET_PRODUCT_NUM hex "Product ID of the USB device" - default 0x1010 if ARCH_SUNXI + default 0x1010 if BOARD_SUNXI default 0x310a if ROCKCHIP_RK3036 default 0x300a if ROCKCHIP_RK3066 default 0x310c if ROCKCHIP_RK3128
@@ -202,7 +202,7 @@ endif # USB_GADGET_DOWNLOAD config USB_ETHER bool "USB Ethernet Gadget" depends on NET - default y if ARCH_SUNXI && USB_MUSB_GADGET + default y if BOARD_SUNXI && USB_MUSB_GADGET help Creates an Ethernet network device through a USB peripheral controller. This will create a network interface on both the device
drivers/usb/musb-new/Kconfig +1 -1
@@ -67,7 +67,7 @@ config USB_MUSB_PIC32 config USB_MUSB_SUNXI bool "Enable sunxi OTG / DRC USB controller" - depends on ARCH_SUNXI + depends on BOARD_SUNXI select USB_MUSB_PIO_ONLY default y ---help---
drivers/video/Kconfig +1 -1
@@ -183,7 +183,7 @@ config CONSOLE_TRUETYPE_MAX_METRICS config SYS_WHITE_ON_BLACK bool "Display console as white on a black background" - default y if ARCH_AT91 || ARCH_EXYNOS || ARCH_ROCKCHIP || ARCH_TEGRA || X86 || ARCH_SUNXI + default y if ARCH_AT91 || ARCH_EXYNOS || ARCH_ROCKCHIP || ARCH_TEGRA || X86 || BOARD_SUNXI help Normally the display is black on a white background, Enable this option to invert this, i.e. white on a black background. This can be
drivers/watchdog/Kconfig +2 -2
@@ -29,7 +29,7 @@ config WATCHDOG_TIMEOUT_MSECS default 128000 if ARCH_MX31 || ARCH_MX5 || ARCH_MX6 default 128000 if ARCH_MX7 || ARCH_VF610 default 30000 if ARCH_SOCFPGA - default 16000 if ARCH_SUNXI + default 16000 if BOARD_SUNXI default 60000 help Watchdog timeout in msec
@@ -321,7 +321,7 @@ config WDT_STM32MP config WDT_SUNXI bool "Allwinner sunxi watchdog timer support" - depends on WDT && ARCH_SUNXI + depends on WDT && BOARD_SUNXI default y help Enable support for the watchdog timer in Allwinner sunxi SoCs.
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 21/22 disk: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
In reply to Samuel HollandThis provides a unified configuration across all sunxi boards, regardless of CPU architecture.
---
disk/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
disk/Kconfig +3 -3
@@ -61,7 +61,7 @@ config SPL_DOS_PARTITION bool "Enable MS Dos partition table for SPL" depends on SPL default n if ARCH_MVEBU - default n if ARCH_SUNXI + default n if BOARD_SUNXI default y if DOS_PARTITION select SPL_PARTITIONS
@@ -104,7 +104,7 @@ config EFI_PARTITION config EFI_PARTITION_ENTRIES_NUMBERS int "Number of the EFI partition entries" depends on EFI_PARTITION - default 56 if ARCH_SUNXI + default 56 if BOARD_SUNXI default 128 help Specify the number of partition entries in the GPT. This is
@@ -132,7 +132,7 @@ config SPL_EFI_PARTITION bool "Enable EFI GPT partition table for SPL" depends on SPL default n if ARCH_MVEBU - default n if ARCH_SUNXI + default n if BOARD_SUNXI default y if EFI_PARTITION select SPL_PARTITIONS
Signature · 1 line
2.37.3
Samuel Holland
maintainerPATCH 22/22 spl: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI
In reply to Samuel HollandThis provides a unified configuration across all sunxi boards, regardless of CPU architecture.
---
common/spl/Kconfig | 12 ++++++------ scripts/Makefile.spl | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-)
common/spl/Kconfig +6 -6
@@ -110,7 +110,7 @@ config SPL_PAD_TO config SPL_HAS_BSS_LINKER_SECTION depends on SPL_FRAMEWORK bool "Use a specific address for the BSS via the linker script" - default y if ARCH_SUNXI || ARCH_MX6 || ARCH_OMAP2PLUS || MIPS || RISCV || ARCH_ZYNQMP + default y if ARCH_MX6 || ARCH_OMAP2PLUS || ARCH_ZYNQMP || BOARD_SUNXI || MIPS || RISCV config SPL_BSS_START_ADDR hex "Link address for the BSS within the SPL binary"
@@ -334,7 +334,7 @@ config SPL_SYS_MALLOC_SIMPLE config SPL_SHARES_INIT_SP_ADDR bool "SPL and U-Boot use the same initial stack pointer location" depends on (ARM || ARCH_JZ47XX || MICROBLAZE || RISCV) && SPL_FRAMEWORK - default n if ARCH_SUNXI || ARCH_MX6 || ARCH_MX7 + default n if BOARD_SUNXI || ARCH_MX6 || ARCH_MX7 default y help In many cases, we can use the same initial stack pointer address for
@@ -452,7 +452,7 @@ config SPL_DISPLAY_PRINT config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR bool "MMC raw mode: by sector" - default y if ARCH_SUNXI || ARCH_DAVINCI || ARCH_UNIPHIER || \ + default y if BOARD_SUNXI || ARCH_DAVINCI || ARCH_UNIPHIER || \ ARCH_MX6 || ARCH_MX7 || \ ARCH_ROCKCHIP || ARCH_MVEBU || ARCH_SOCFPGA || \ ARCH_AT91 || ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \
@@ -465,7 +465,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR hex "Address on the MMC to load U-Boot from" depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR - default 0x40 if ARCH_SUNXI + default 0x40 if BOARD_SUNXI default 0x75 if ARCH_DAVINCI default 0x8a if ARCH_MX6 || ARCH_MX7 default 0x100 if ARCH_UNIPHIER
@@ -482,7 +482,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR config SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET hex "U-Boot main hardware partition image offset" depends on SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR - default 0x10 if ARCH_SUNXI + default 0x10 if BOARD_SUNXI default 0x0 help On some platforms SPL location depends on hardware partition. The ROM
@@ -1308,7 +1308,7 @@ endif # SPL_SPI_FLASH_SUPPORT config SYS_SPI_U_BOOT_OFFS hex "address of u-boot payload in SPI flash" - default 0x8000 if ARCH_SUNXI + default 0x8000 if BOARD_SUNXI default 0x0 depends on SPL_SPI_LOAD || SPL_SPI_SUNXI help
scripts/Makefile.spl +1 -1
@@ -264,7 +264,7 @@ endif INPUTS-$(CONFIG_TARGET_SOCFPGA_SOC64) += $(obj)/u-boot-spl-dtb.hex -ifdef CONFIG_ARCH_SUNXI +ifdef CONFIG_BOARD_SUNXI INPUTS-y += $(obj)/sunxi-spl.bin ifdef CONFIG_NAND_SUNXI
Signature · 1 line
2.37.3
On Tue, 1 Nov 2022 00:08:12 -0500
Samuel Holland <[email protected]> wrote:
Hi Samuel,
Quoted 8 lines
sunxi is getting a new RISC-V platform, D1. We want to share as much of the existing configuration as possible, to provide a familiar environment, DRAM layout, partition layout, etc.
Because U-Boot includes all architecture
Kconfigfiles at once, we must use a symbol outside of bothCONFIG_ARMandCONFIG_RISCVto contain sharedKconfigoptions. I choseBOARD_SUNXI, corresponding to the file location and somewhat following theBOARD_SPECIFIC_OPTIONSpattern.
many thanks for sending this, indeed our Kconfig deserved some cleanups, plus we need to fix the woes with RISC-V.
I just skimmed over this for now, and it seems to look good.
I have some gripes with the name BOARD_SUNXI though. Bad enough we have board-agnostic generic code in board/sunxi, but maybe we shouldn't add to the confusion. Would PLAT_SUNXI be a better name? After all it's all about the Allwinner platform (and not even "architecture", for that matter).
Quoted 11 lines
I did a buildman run on this series. The only net option changes are the expected ones:
- Host-side USB gets enabled on several boards by the first patch (emlid_neutis_n5_devboardorangepi_zero2pinephone pinetabtanix_tx6x96_mateteres_i)
-CONFIG_BOARD_SUNXIgets added everywhere
-CONFIG_SYS_I2C_MVTWSIgets enabled by the corresponding patchAndre, please feel free to take any subset of these; they don't all have to go in at once. And I'm open to suggestions about what instances of
ARCH_SUNXIshould (not) be converted. Some of them are open to opinion.
Yeah, I will definitely cherry-pick some patches, especially the more innocent ones. I will run my before/after defconfig comparisons to test them.
Cheers,
Andre
Quoted 63 lines
I left alone the options in
arch/arm/mach-sunxi/Kconfigthat are covered by other series (MMC CD/USB PHY/power pins, AXP GPIO).After this series, the
Kconfigchanges needed for D1 support are quite small, something like this commit:
https://github.com/smaeul/u-boot/commit/c12cf6c5d72f5327eff793518229ddbd41dcf729.patchAdding
SUNXI_MINIMUM_DRAM_MBcertainly made things nicer. There are a few options that probably still need some adjustment to respect it.Samuel Holland (22):
sunxi: Fix default-enablement of USB host drivers
sunxi: Remove unnecessaryKconfigselections
sunxi: Add missing dependencies toKconfigselections
sunxi: Hide image type selection if SPL is disabled
sunxi: Share the boardKconfigacross architectures
sunxi: Move mostKconfigselections to the boardKconfig
sunxi: Globally enableSUPPORT_SPL
sunxi: Downgrade driver selections to implications
sunxi: Enable the I2C driver by default
sunxi: Move default values to the boardKconfig
sunxi: Hide theSUNXI_MINIMUM_DRAM_MBsymbol
sunxi: Clean up theSPL_STACK_R_ADDRdefaults
sunxi: MovePRE_CON_BUF_ADDRto the boardKconfig
sunxi: MoveSPL_BSS_START_ADDRto the boardKconfig
sunxi: MoveSPL_TEXT_BASEto the boardKconfig
sunxi: MoveSYS_LOAD_ADDRto the boardKconfig
sunxi: MoveTEXT_BASEto the boardKconfig
sunxi: Move most board options to the boardKconfig
env: sunxi: ReplaceARCH_SUNXIwithBOARD_SUNXI
drivers: sunxi: ReplaceARCH_SUNXIwithBOARD_SUNXI
disk: sunxi: ReplaceARCH_SUNXIwithBOARD_SUNXI
spl: sunxi: ReplaceARCH_SUNXIwithBOARD_SUNXIKconfig | 3 - arch/Kconfig | 1 + arch/arm/Kconfig | 48 +------- arch/arm/mach-sunxi/Kconfig | 154 ----------------------- board/sunxi/Kconfig | 224 ++++++++++++++++++++++++++++++++++ boot/Kconfig | 4 - common/Kconfig | 2 - common/spl/Kconfig | 18 +-- disk/Kconfig | 6 +- drivers/clk/sunxi/Kconfig | 2 +- drivers/fastboot/Kconfig | 13 +- drivers/gpio/Kconfig | 2 +- drivers/mmc/Kconfig | 2 +- drivers/net/phy/Kconfig | 4 +- drivers/phy/allwinner/Kconfig | 2 +- drivers/pinctrl/sunxi/Kconfig | 2 +- drivers/reset/Kconfig | 2 +- drivers/spi/Kconfig | 2 +- drivers/usb/Kconfig | 2 +- drivers/usb/gadget/Kconfig | 8 +- drivers/usb/host/Kconfig | 2 - drivers/usb/musb-new/Kconfig | 2 +- drivers/video/Kconfig | 2 +- drivers/watchdog/Kconfig | 4 +- env/Kconfig | 12 +- scripts/Makefile.spl | 2 +- 26 files changed, 267 insertions(+), 258 deletions(-)
Samuel Holland
maintainerQuoted 14 lines · Andre Przywara
On Tue, 1 Nov 2022 00:08:12 -0500
Samuel Holland <[email protected]> wrote:Hi Samuel,
Quoted 8 lines
sunxi is getting a new RISC-V platform, D1. We want to share as much of the existing configuration as possible, to provide a familiar environment, DRAM layout, partition layout, etc.
Because U-Boot includes all architecture
Kconfigfiles at once, we must use a symbol outside of bothCONFIG_ARMandCONFIG_RISCVto contain sharedKconfigoptions. I choseBOARD_SUNXI, corresponding to the file location and somewhat following theBOARD_SPECIFIC_OPTIONSpattern.
Quoted 8 lines
many thanks for sending this, indeed our
Kconfigdeserved some cleanups, plus we need to fix the woes with RISC-V.
I just skimmed over this for now, and it seems to look good.I have some gripes with the name
BOARD_SUNXIthough. Bad enough we have board-agnostic generic code in board/sunxi, but maybe we shouldn't add to the confusion. WouldPLAT_SUNXIbe a better name? After all it's all about the Allwinner platform (and not even "architecture", for that matter).
I am fine with either name. "board" is U-Boot's name for the level of abstraction we are working at. I don't know that it necessarily has to refer to code for a _single_ board, as opposed to code that glues things together at the "board level" outside the CPU/SoC. But I can see where the confusion comes from. Let me know what you want me to do, and I can adjust/resend the series.
Quoted 8 lines
Quoted 8 lines
I did a buildman run on this series. The only net option changes are the expected ones:
- Host-side USB gets enabled on several boards by the first patch (emlid_neutis_n5_devboardorangepi_zero2pinephone pinetabtanix_tx6x96_mateteres_i)
-CONFIG_BOARD_SUNXIgets added everywhere
-CONFIG_SYS_I2C_MVTWSIgets enabled by the corresponding patch
Quoted 7 lines
Quoted 3 lines
Andre, please feel free to take any subset of these; they don't all have to go in at once. And I'm open to suggestions about what instances of
ARCH_SUNXIshould (not) be converted. Some of them are open to opinion.Yeah, I will definitely cherry-pick some patches, especially the more innocent ones. I will run my before/after defconfig comparisons to test them.
I used buildman's -K option to get the list above; it outputs the list of individual boards with option changes per patch.
Regards,
Samuel