From 93087cb2d1f09ff3b0509f526bec0e140931f2aa Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 23:45:19 -0500 Subject: [PATCH 01/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. Signed-off-by: Samuel Holland --- arch/arm/Kconfig | 4 ++++ drivers/usb/host/Kconfig | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 710f171f87e..d3a1f03b369 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -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 diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 1aabe062fb3..a4d62bc9e8f 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -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. From 6322810dc7ce6d963fe1e3dc87ff1fc9bb02c85b Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 4 Aug 2022 23:22:05 -0500 Subject: [PATCH 02/22] sunxi: Remove unnecessary Kconfig selections Two 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 Signed-off-by: Samuel Holland --- arch/arm/Kconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index d3a1f03b369..939f76867e8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -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 From 3cce77c1b28f651607ec0fc108f605f4d1336b80 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 4 Aug 2022 23:29:13 -0500 Subject: [PATCH 03/22] sunxi: Add missing dependencies to Kconfig selections Some of the selected symbols have a user-visible dependency. Make the selections conditional on that dependency to avoid creating invalid configurations. Signed-off-by: Samuel Holland --- arch/arm/Kconfig | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 939f76867e8..4e5daa9e7f8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -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 From 00394be8316a5510f310d07531efbad36915de50 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 21:56:43 -0500 Subject: [PATCH 04/22] sunxi: Hide image type selection if SPL is disabled This choice is meaningless when SPL is disabled. Hide it to avoid any possible confusion. Signed-off-by: Samuel Holland --- board/sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 084a8b0c6ca..42f61df5c54 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -1,5 +1,6 @@ choice prompt "SPL Image Type" + depends on SPL default SPL_IMAGE_TYPE_SUNXI_EGON config SPL_IMAGE_TYPE_SUNXI_EGON From 1c30baf6d6f546d1626a940a39fd9885a756cb80 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 4 Aug 2022 21:30:57 -0500 Subject: [PATCH 05/22] sunxi: Share the board Kconfig across architectures 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 --- 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 e3a456a98d2..a77192096aa 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 4e5daa9e7f8..f2852783d40 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 dbe6005daab..a03e700a0b6 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 42f61df5c54..9010631b168 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 From c4a7f99fa2f2ca976265e839e129d5f5d7d533c7 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 4 Aug 2022 22:42:29 -0500 Subject: [PATCH 06/22] sunxi: Move most Kconfig selections to the board Kconfig To 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. Signed-off-by: Samuel Holland --- arch/arm/Kconfig | 46 --------------------------------------------- board/sunxi/Kconfig | 46 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index f2852783d40..2c32b419a86 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -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" diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 9010631b168..1d0700fe5f2 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -1,5 +1,51 @@ config BOARD_SUNXI bool + select BINMAN + select CLK + select CMD_GPIO if GPIO + select CMD_MMC if MMC + select CMD_USB if DISTRO_DEFAULTS && USB_HOST + 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 OF_BOARD_SETUP + select PINCTRL + select SPL_SEPARATE_BSS if SPL + select SUNXI_GPIO if GPIO + select SYS_NS16550 if SERIAL + select SYS_RELOC_GD_ENV_ADDR + select USB if DISTRO_DEFAULTS + select USB_KEYBOARD if DISTRO_DEFAULTS && USB_HOST + select USE_PREBOOT + 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 if BOARD_SUNXI From 9a3d746a74c6ee6d3b985210377af886122295e4 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 23:31:04 -0500 Subject: [PATCH 07/22] sunxi: Globally enable SUPPORT_SPL This was already supported by every machine type. It is unlikely that any new SoC support will be added without SPL support. Signed-off-by: Samuel Holland --- arch/arm/mach-sunxi/Kconfig | 14 -------------- board/sunxi/Kconfig | 2 ++ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index a03e700a0b6..73097e5a40a 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -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 diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 1d0700fe5f2..056ccb6f745 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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 From 7d38e1cf7c4af20bf6eb738a1b925c5c52b35006 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 6 Aug 2022 00:10:46 -0500 Subject: [PATCH 08/22] sunxi: Downgrade driver selections to implications While not especially likely, it is plausible that someone wants to build U-Boot without GPIO or UART support. Don't force building these drivers. Signed-off-by: Samuel Holland --- board/sunxi/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 056ccb6f745..b301ba998eb 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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 From cd193be996c0cc3532ac055988a096cf9e41df3c Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 6 Aug 2022 00:11:54 -0500 Subject: [PATCH 09/22] sunxi: Enable the I2C driver by default This is used by quite a large number of boards, for PMIC/regulator or LCD panel control. Signed-off-by: Samuel Holland --- board/sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index b301ba998eb..809cd17f54f 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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 From 8e5e0e91d5f34f9df153c0cb609417dbef7a9f23 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 23:10:11 -0500 Subject: [PATCH 10/22] sunxi: Move default values to the board Kconfig This 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. Signed-off-by: Samuel Holland --- arch/arm/mach-sunxi/Kconfig | 67 ------------------------------------ board/sunxi/Kconfig | 68 +++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 67 deletions(-) diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 73097e5a40a..24840f6d7e9 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -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 diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 809cd17f54f..105c902036f 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -52,6 +52,74 @@ config BOARD_SUNXI if BOARD_SUNXI +config IDENT_STRING + default " Allwinner Technology" + +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 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 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 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 boot mask ROM mapped just + below 4GB, with the first SRAM region located at address 0. + Newer SoCs map the boot ROM at address 0 instead and move the + SRAM to a different address. + +config SYS_BOARD + default "sunxi" + +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 1008000000 if MACH_SUN8I + default 1008000000 if MACH_SUN9I + default 816000000 if MACH_SUN50I || MACH_SUN50I_H5 + 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_SOC + default "sunxi" + menu "sunxi board options" choice From 665abb4e4a17d0df7a6f8b8fb74b3c1782543c14 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Mon, 31 Oct 2022 22:14:36 -0500 Subject: [PATCH 11/22] sunxi: Hide the SUNXI_MINIMUM_DRAM_MB symbol This option affects the ABI between SPL/U-Boot and U-Boot/scripts, so it should not normally be changed by the user. Signed-off-by: Samuel Holland --- board/sunxi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 105c902036f..d686d841707 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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 From b44e50d3f340db29226039093114ab0704c4c282 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 23:25:26 -0500 Subject: [PATCH 12/22] sunxi: Clean up the SPL_STACK_R_ADDR defaults Update 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. Signed-off-by: Samuel Holland --- board/sunxi/Kconfig | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index d686d841707..7d678108a08 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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 From a759def05cf3dbc4ce964a0b1de8b7d6ef3a2936 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 6 Aug 2022 00:45:10 -0500 Subject: [PATCH 13/22] sunxi: Move PRE_CON_BUF_ADDR to the board Kconfig This 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. Signed-off-by: Samuel Holland --- board/sunxi/Kconfig | 6 ++++++ common/Kconfig | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 7d678108a08..704535d467f 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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 diff --git a/common/Kconfig b/common/Kconfig index 21434c5cf16..bc2c078d4ac 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -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 From 4c0ec2d15602358753640768f20bc1523ac14074 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Mon, 31 Oct 2022 00:08:26 -0500 Subject: [PATCH 14/22] sunxi: Move SPL_BSS_START_ADDR to the board Kconfig This 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. Signed-off-by: Samuel Holland --- board/sunxi/Kconfig | 6 ++++++ common/spl/Kconfig | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 704535d467f..1abb3e18162 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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 diff --git a/common/spl/Kconfig b/common/spl/Kconfig index b738c749fff..b1e9926e68f 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -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 From 0110f352eb9aca553f5bc83db864fc3c0f41cc9e Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 6 Aug 2022 00:07:47 -0500 Subject: [PATCH 15/22] sunxi: Move SPL_TEXT_BASE to the board Kconfig It makes sense to put this near the definition of SUNXI_SRAM_ADDRESS. Signed-off-by: Samuel Holland --- board/sunxi/Kconfig | 5 +++++ common/spl/Kconfig | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 1abb3e18162..b561dd467f5 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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 diff --git a/common/spl/Kconfig b/common/spl/Kconfig index b1e9926e68f..930028b5af7 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -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 From 9c3f889d721afcbb84b654fb244aa9324b31dc1f Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 23:23:34 -0500 Subject: [PATCH 16/22] sunxi: Move SYS_LOAD_ADDR to the board Kconfig This 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. Signed-off-by: Samuel Holland --- Kconfig | 3 --- board/sunxi/Kconfig | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Kconfig b/Kconfig index ef94f88adc2..70e159221c9 100644 --- a/Kconfig +++ b/Kconfig @@ -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) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index b561dd467f5..d4634745355 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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" From ac7381da70be4ca73af655cb43e8cd59035559cb Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 21:48:53 -0500 Subject: [PATCH 17/22] sunxi: Move TEXT_BASE to the board Kconfig This is how the vast majority of platforms provided TEXT_BASE. sunxi was the exception here. Signed-off-by: Samuel Holland --- board/sunxi/Kconfig | 6 ++++++ boot/Kconfig | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index d4634745355..7ff0275ae44 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -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 diff --git a/boot/Kconfig b/boot/Kconfig index d5c582ebe8c..b650a0b052e 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -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. From 3196c0369883496cdba03065d1ed63d1533cd1e3 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 23:18:11 -0500 Subject: [PATCH 18/22] sunxi: Move most board options to the board Kconfig This excludes options that are inherently ARM-specific or are specific to legacy non-DM drivers. Some help text is cleaned up along the way. Signed-off-by: Samuel Holland --- arch/arm/mach-sunxi/Kconfig | 71 ------------------------------------ board/sunxi/Kconfig | 72 +++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 71 deletions(-) diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 24840f6d7e9..ff21d948422 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -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 diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 7ff0275ae44..f5e5c3770f5 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -171,6 +171,78 @@ config SPL_IMAGE_TYPE default "sunxi_egon" if SPL_IMAGE_TYPE_SUNXI_EGON default "sunxi_toc0" if SPL_IMAGE_TYPE_SUNXI_TOC0 +config MMC_SUNXI_SLOT_EXTRA + int "MMC extra slot number" + default -1 + help + sunxi builds always enable mmc0. Some boards also have a + second SD card slot or eMMC on mmc1 - mmc3. Setting this to 1, + 2 or 3 will enable support for this. + +config MMC1_PINS_PH + bool "MMC1 pins are on Port H" + depends on MACH_SUN4I || MACH_SUN7I || MACH_SUN8I_R40 + help + Select this option on boards where mmc1 uses the Port H pinmux. + +config UART0_PORT_F + bool "UART0 pins are on Port F (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 FEL mode. Only enable this if you really know + what you are doing. + +config AXP_DISABLE_BOOT_ON_POWERON + bool "Disable device boot on power plug-in" + depends on AXP209_POWER || AXP221_POWER || AXP809_POWER || AXP818_POWER + 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 the board + was powered on because of a plug-in event instead of a button + press event, it will shut back off. + +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 + +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. + endmenu endif From a34fd3ce31a74cc61edf6877a4d5fb2d9978facf Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 23:28:54 -0500 Subject: [PATCH 19/22] env: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI This ensures the same environment layout will be used across all sunxi boards, regardless of CPU architecture. Signed-off-by: Samuel Holland --- env/Kconfig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/env/Kconfig b/env/Kconfig index 24111dfaf47..ae28e4e3e6e 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -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. From dc98d5b6960869b93c0cfbdb7a8c975050cc2a4c Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Fri, 5 Aug 2022 23:53:23 -0500 Subject: [PATCH 20/22] drivers: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI This provides a unified configuration across all sunxi boards, regardless of CPU architecture. Signed-off-by: Samuel Holland --- 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(-) diff --git a/drivers/clk/sunxi/Kconfig b/drivers/clk/sunxi/Kconfig index bf11fad6eef..72310e231dc 100644 --- a/drivers/clk/sunxi/Kconfig +++ b/drivers/clk/sunxi/Kconfig @@ -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 diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index b97c67bf609..a55fdac3704 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -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 diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index ff87fbfb397..defdb913684 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -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. diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index 56f42820c74..6a7271de75f 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -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 diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index 52ce08b3b38..a68298fa08b 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -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. diff --git a/drivers/phy/allwinner/Kconfig b/drivers/phy/allwinner/Kconfig index f8f1e99c4f5..ab43681f0cf 100644 --- a/drivers/phy/allwinner/Kconfig +++ b/drivers/phy/allwinner/Kconfig @@ -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 diff --git a/drivers/pinctrl/sunxi/Kconfig b/drivers/pinctrl/sunxi/Kconfig index 77da90836b6..eb574236a37 100644 --- a/drivers/pinctrl/sunxi/Kconfig +++ b/drivers/pinctrl/sunxi/Kconfig @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -if ARCH_SUNXI +if BOARD_SUNXI config PINCTRL_SUNXI select PINCTRL_FULL diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index 4cb0ba08508..cb15372306c 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -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 diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 34b92ceaee0..20412e18873 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -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. diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 3afb45d5ccb..8c0d4da1933 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -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. diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index e8da73c7886..19071e003ee 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -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 diff --git a/drivers/usb/musb-new/Kconfig b/drivers/usb/musb-new/Kconfig index 51f876cd711..d2d86a5c0e6 100644 --- a/drivers/usb/musb-new/Kconfig +++ b/drivers/usb/musb-new/Kconfig @@ -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--- diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index c841b99bb30..4e9e179d12c 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -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 diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index f1b1cf63ca3..575dea5da54 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -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. From be670018a3ad4548a88a406e9c599adca2792c6a Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 6 Aug 2022 00:05:52 -0500 Subject: [PATCH 21/22] disk: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI This provides a unified configuration across all sunxi boards, regardless of CPU architecture. Signed-off-by: Samuel Holland --- disk/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/disk/Kconfig b/disk/Kconfig index c9b9dbaf1a6..b9d3625dc2d 100644 --- a/disk/Kconfig +++ b/disk/Kconfig @@ -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 From 305893084cfd0b9be587651c3f9b6d558c60aae9 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 6 Aug 2022 00:09:38 -0500 Subject: [PATCH 22/22] spl: sunxi: Replace ARCH_SUNXI with BOARD_SUNXI This provides a unified configuration across all sunxi boards, regardless of CPU architecture. Signed-off-by: Samuel Holland --- common/spl/Kconfig | 12 ++++++------ scripts/Makefile.spl | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 930028b5af7..5ff75aad9f1 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -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 diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 15ac87286d5..819050dd4d6 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -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