reset: Remove ARCH_HAS_RESET_CONTROLLER Kconfig symbol
Subsystems (21)
PATCH 1/1 reset: Remove ARCH_HAS_RESET_CONTROLLER Kconfig symbol
Many ARCH_HAS_* symbols change some behavior based on what an ARCH supports, but ARCH_HAS_RESET_CONTROLLER is used only to set a default for RESET_CONTROLLER. Those ARCH symbols that select this can skip the middleman and directly select RESET_CONTROLLER, and many already do.
Replace all selection of this symbol with a direct selection of RESET_CONTROLLER when it is not already in the selection list. In the latter case when RESET_CONTROLLER is also already selected we can simply remove the ARCH_HAS_RESET_CONTROLLER without changing existing behavior.
Some ARCHs "select" this symbol when they actually "depend on" the RESET_CONTROLLER framework to build, in those cases the indirect select could lead to broken randconfig builds. In cases when it is not needed for building the ARCH code, these selections can be switched to the weaker "imply" to allow it deselected for minimal builds without reset support. Additional checking will be needed to find such cases.
--- arch/arm/Kconfig | 2 +- arch/arm/Kconfig.platforms | 1 - arch/arm/mach-bcm/Kconfig | 4 ++-- arch/arm/mach-berlin/Kconfig | 2 +- arch/arm/mach-ep93xx/Kconfig | 2 +- arch/arm/mach-gemini/Kconfig | 2 +- arch/arm/mach-imx/Kconfig | 2 +- arch/arm/mach-keystone/Kconfig | 2 +- arch/arm/mach-mmp/Kconfig | 6 +++--- arch/arm/mach-omap2/Kconfig | 1 - arch/arm/mach-rockchip/Kconfig | 2 +- arch/arm/mach-socfpga/Kconfig | 1 - arch/arm/mach-sti/Kconfig | 1 - arch/arm/mach-stm32/Kconfig | 1 - arch/arm/mach-sunxi/Kconfig | 1 - arch/arm/mach-tegra/Kconfig | 1 - arch/arm/mach-zynq/Kconfig | 2 +- arch/arm64/Kconfig.platforms | 9 +++------ arch/mips/Kconfig | 6 ++---- arch/riscv/Kconfig.socs | 2 +- drivers/reset/Kconfig | 4 ---- 21 files changed, 19 insertions(+), 35 deletions(-)
arch/arm/Kconfig +1 -1
@@ -473,7 +473,7 @@ source "arch/arm/mach-zynq/Kconfig" config ARCH_LPC18XX bool "NXP LPC18xx/LPC43xx (DEPRECATED)" depends on ARM_SINGLE_ARMV7M - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARM_AMBA select CLKSRC_LPC32XX select PINCTRL
arch/arm/Kconfig.platforms +0 -1
@@ -191,7 +191,6 @@ endif config ARCH_UNIPHIER bool "Socionext UniPhier SoCs" depends on ARCH_MULTI_V7 - select ARCH_HAS_RESET_CONTROLLER select ARM_AMBA select ARM_GLOBAL_TIMER select ARM_GIC
arch/arm/mach-bcm/Kconfig +2 -2
@@ -182,7 +182,7 @@ config ARCH_BCM_53573 config ARCH_BRCMSTB bool "Broadcom BCM7XXX based boards" depends on ARCH_MULTI_V7 - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARM_AMBA select ARM_GIC select ARM_GIC_V3
@@ -229,7 +229,7 @@ config ARCH_BCMBCA_CORTEXA9 bool "Cortex-A9 SoCS" select ARM_ERRATA_754322 select ARM_ERRATA_764369 if SMP - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARM_GLOBAL_TIMER select CACHE_L2X0 select HAVE_ARM_TWD if SMP
arch/arm/mach-berlin/Kconfig +1 -1
@@ -2,7 +2,7 @@ menuconfig ARCH_BERLIN bool "Marvell Berlin SoCs" depends on ARCH_MULTI_V7 - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARM_GIC select DW_APB_ICTL select DW_APB_TIMER_OF
arch/arm/mach-ep93xx/Kconfig +1 -1
@@ -5,7 +5,7 @@ menuconfig ARCH_EP93XX depends on ARCH_MULTI_V4T # CONFIG_ARCH_MULTI_V7 is not set depends on CPU_LITTLE_ENDIAN - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARCH_SPARSEMEM_ENABLE select ARM_AMBA select ARM_VIC
arch/arm/mach-gemini/Kconfig +1 -1
@@ -3,7 +3,7 @@ menuconfig ARCH_GEMINI bool "Cortina Systems Gemini" depends on ARCH_MULTI_V4 depends on CPU_LITTLE_ENDIAN - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARM_AMBA select ARM_APPENDED_DTB # Old Redboot bootloaders deployed select COMMON_CLK_GEMINI
arch/arm/mach-imx/Kconfig +1 -1
@@ -33,7 +33,7 @@ config HAVE_IMX_MMDC config HAVE_IMX_SRC def_bool y if SMP - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER if ARCH_MULTI_V6
arch/arm/mach-keystone/Kconfig +1 -1
@@ -5,7 +5,7 @@ config ARCH_KEYSTONE select ARM_GIC select HAVE_ARM_ARCH_TIMER select KEYSTONE_TIMER - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARM_ERRATA_798181 if SMP select COMMON_CLK_KEYSTONE select ZONE_DMA if ARM_LPAE
arch/arm/mach-mmp/Kconfig +3 -3
@@ -18,7 +18,7 @@ config MACH_MMP_DT depends on ARCH_MULTI_V5 select PINCTRL select PINCTRL_SINGLE - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select CPU_MOHAWK help Include support for Marvell MMP2 based platforms using
@@ -30,7 +30,7 @@ config MACH_MMP2_DT depends on ARCH_MULTI_V7 select PINCTRL select PINCTRL_SINGLE - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select CPU_PJ4 select PM_GENERIC_DOMAINS if PM select PM_GENERIC_DOMAINS_OF if PM && OF
@@ -47,7 +47,7 @@ config MACH_MMP3_DT select CACHE_L2X0 select PINCTRL select PINCTRL_SINGLE - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select CPU_PJ4B select PM_GENERIC_DOMAINS if PM select PM_GENERIC_DOMAINS_OF if PM && OF
arch/arm/mach-omap2/Kconfig +0 -1
@@ -97,7 +97,6 @@ config SOC_DRA7XX config ARCH_OMAP2PLUS bool select ARCH_HAS_BANDGAP - select ARCH_HAS_RESET_CONTROLLER select ARCH_OMAP select CLKSRC_MMIO select GENERIC_IRQ_CHIP
arch/arm/mach-rockchip/Kconfig +1 -1
@@ -4,7 +4,7 @@ config ARCH_ROCKCHIP depends on ARCH_MULTI_V7 select PINCTRL select PINCTRL_ROCKCHIP - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARM_AMBA select ARM_GIC select CACHE_L2X0
arch/arm/mach-socfpga/Kconfig +0 -1
@@ -2,7 +2,6 @@ menuconfig ARCH_INTEL_SOCFPGA bool "Altera SOCFPGA family" depends on ARCH_MULTI_V7 - select ARCH_HAS_RESET_CONTROLLER select ARM_AMBA select ARM_GIC select CACHE_L2X0
arch/arm/mach-sti/Kconfig +0 -1
@@ -9,7 +9,6 @@ menuconfig ARCH_STI select PINCTRL select PINCTRL_ST select MFD_SYSCON - select ARCH_HAS_RESET_CONTROLLER select HAVE_ARM_SCU if SMP select GPIOLIB select ARM_ERRATA_754322
arch/arm/mach-stm32/Kconfig +0 -1
@@ -7,7 +7,6 @@ menuconfig ARCH_STM32 select ARM_GIC if ARCH_MULTI_V7 select ARM_PSCI if ARCH_MULTI_V7 select ARM_AMBA - select ARCH_HAS_RESET_CONTROLLER select CLKSRC_STM32 select PINCTRL select RESET_CONTROLLER
arch/arm/mach-sunxi/Kconfig +0 -1
@@ -2,7 +2,6 @@ menuconfig ARCH_SUNXI bool "Allwinner SoCs" depends on (CPU_LITTLE_ENDIAN && ARCH_MULTI_V5) || ARCH_MULTI_V7 - select ARCH_HAS_RESET_CONTROLLER select CLKSRC_MMIO select GPIOLIB select PINCTRL
arch/arm/mach-tegra/Kconfig +0 -1
@@ -2,7 +2,6 @@ menuconfig ARCH_TEGRA bool "NVIDIA Tegra" depends on ARCH_MULTI_V7 - select ARCH_HAS_RESET_CONTROLLER select ARM_AMBA select ARM_GIC select CLKSRC_MMIO
arch/arm/mach-zynq/Kconfig +1 -1
@@ -2,7 +2,7 @@ config ARCH_ZYNQ bool "Xilinx Zynq ARM Cortex A9 Platform" depends on ARCH_MULTI_V7 - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARM_AMBA select ARM_GIC select ARM_GLOBAL_TIMER
arch/arm64/Kconfig.platforms +3 -6
@@ -17,7 +17,6 @@ config ARCH_AIROHA config ARCH_SUNXI bool "Allwinner sunxi 64-bit SoC Family" - select ARCH_HAS_RESET_CONTROLLER select PINCTRL select RESET_CONTROLLER select SUN4I_TIMER
@@ -99,7 +98,7 @@ config ARCH_BCMBCA config ARCH_BRCMSTB bool "Broadcom Set-Top-Box SoCs" - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select GENERIC_IRQ_CHIP select PINCTRL help
@@ -353,7 +352,7 @@ config ARCH_RENESAS config ARCH_ROCKCHIP bool "Rockchip Platforms" - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select PINCTRL select PM select ROCKCHIP_TIMER
@@ -376,7 +375,7 @@ config ARCH_INTEL_SOCFPGA config ARCH_SOPHGO bool "Sophgo SoCs" - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER help This enables support for Sophgo SoC platform hardware.
@@ -405,7 +404,6 @@ config ARCH_SYNQUACER config ARCH_TEGRA bool "NVIDIA Tegra SoC Family" - select ARCH_HAS_RESET_CONTROLLER select ARM_GIC_PM select CLKSRC_MMIO select TIMER_OF
@@ -442,7 +440,6 @@ config ARCH_THUNDER2 config ARCH_UNIPHIER bool "Socionext UniPhier SoC Family" - select ARCH_HAS_RESET_CONTROLLER select PINCTRL select RESET_CONTROLLER help
arch/mips/Kconfig +2 -4
@@ -228,7 +228,7 @@ config ATH25 config ATH79 bool "Atheros AR71XX/AR724X/AR913X based boards" - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select BOOT_RAW select CEVT_R4K select CSRC_R4K
@@ -250,7 +250,7 @@ config ATH79 config BMIPS_GENERIC bool "Broadcom Generic BMIPS kernel" - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL select BOOT_RAW select NO_EXCEPT_FILL
@@ -472,7 +472,6 @@ config LANTIQ select USE_OF select PINCTRL select PINCTRL_LANTIQ - select ARCH_HAS_RESET_CONTROLLER select RESET_CONTROLLER config MACH_LOONGSON32
@@ -690,7 +689,6 @@ config RALINK select SYS_SUPPORTS_MIPS16 select SYS_SUPPORTS_ZBOOT select SYS_HAS_EARLY_PRINTK - select ARCH_HAS_RESET_CONTROLLER select RESET_CONTROLLER config MACH_REALTEK_RTL
arch/riscv/Kconfig.socs +1 -1
@@ -112,7 +112,7 @@ config ARCH_CANAAN config SOC_CANAAN_K210 bool "Canaan Kendryte K210 SoC" depends on !MMU && ARCH_CANAAN - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER select PINCTRL select COMMON_CLK help
drivers/reset/Kconfig +0 -4
@@ -1,10 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only -config ARCH_HAS_RESET_CONTROLLER - bool - menuconfig RESET_CONTROLLER bool "Reset Controller Support" - default y if ARCH_HAS_RESET_CONTROLLER help Generic Reset Controller support.
Signature · 1 line
2.43.0
Quoted 9 lines · Andrew Davis
Many ARCH_HAS_* symbols change some behavior based on what an ARCH supports, but
ARCH_HAS_RESET_CONTROLLERis used only to set a default forRESET_CONTROLLER. Those ARCH symbols that select this can skip the middleman and directly selectRESET_CONTROLLER, and many already do.Replace all selection of this symbol with a direct selection of
RESET_CONTROLLERwhen it is not already in the selection list. In the latter case whenRESET_CONTROLLERis also already selected we can simply remove theARCH_HAS_RESET_CONTROLLERwithout changing existing behavior.
This is fine
Quoted 6 lines
Some ARCHs "select" this symbol when they actually "depend on" the
RESET_CONTROLLERframework to build, in those cases the indirect select could lead to broken randconfig builds. In cases when it is not needed for building the ARCH code, these selections can be switched to the weaker "imply" to allow it deselected for minimal builds without reset support. Additional checking will be needed to find such cases.
Please don't recommend the use of 'imply', this is rarely what you want and everyone misunderstands what it does.
If you want to have a default, please add another symbol and use that as the default value, such as
config ARCH_WANT_RESET_CONTROLLER
bool
Arnd
Quoted 20 lines · Arnd Bergmann
Quoted 9 lines · Andrew Davis
Many ARCH_HAS_* symbols change some behavior based on what an ARCH supports, but
ARCH_HAS_RESET_CONTROLLERis used only to set a default forRESET_CONTROLLER. Those ARCH symbols that select this can skip the middleman and directly selectRESET_CONTROLLER, and many already do.Replace all selection of this symbol with a direct selection of
RESET_CONTROLLERwhen it is not already in the selection list. In the latter case whenRESET_CONTROLLERis also already selected we can simply remove theARCH_HAS_RESET_CONTROLLERwithout changing existing behavior.This is fine
Quoted 6 lines
Some ARCHs "select" this symbol when they actually "depend on" the
RESET_CONTROLLERframework to build, in those cases the indirect select could lead to broken randconfig builds. In cases when it is not needed for building the ARCH code, these selections can be switched to the weaker "imply" to allow it deselected for minimal builds without reset support. Additional checking will be needed to find such cases.
Quoted 3 lines
Please don't recommend the use of 'imply', this is rarely what you want and everyone misunderstands what it does.
Fair enough, I'll drop this suggestion for v2.
Quoted 6 lines
If you want to have a default, please add another symbol and use that as the default value, such as
config
ARCH_WANT_RESET_CONTROLLER
bool
Could work, but in this case most of these ARCH don't actually "want" the reset controller, at least not more than they want any other random subsystem for which they have drivers like GPIO, NET, etc..
In a few cases there is an actual hard dependency as some ARCH code calls into the reset controller framework, and in those cases directly selecting RESET_CONTROLLER seems more correct than going through some a "ARCH_WANT" symbol.
Andrew
Quoted 3 lines
Arnd
Philipp Zabel
maintainerQuoted 8 lines · Andrew Davis
Many ARCH_HAS_* symbols change some behavior based on what an ARCH supports, but
ARCH_HAS_RESET_CONTROLLERis used only to set a default forRESET_CONTROLLER. Those ARCH symbols that select this can skip the middleman and directly selectRESET_CONTROLLER, and many already do.Replace all selection of this symbol with a direct selection of
RESET_CONTROLLERwhen it is not already in the selection list. In the latter case whenRESET_CONTROLLERis also already selected we can simply
"In the latter case" and "when RESET_CONTROLLER is also already selected" are saying the same thing. I'd choose one and drop the other.
Quoted 7 lines
remove the
ARCH_HAS_RESET_CONTROLLERwithout changing existing behavior.Some ARCHs "select" this symbol when they actually "depend on" the
RESET_CONTROLLERframework to build, in those cases the indirect select could lead to broken randconfig builds. In cases when it is not needed for building the ARCH code, these selections can be switched to the weaker "imply" to allow it deselected for minimal builds without reset support.
Can't it just be dropped completely for those? See for example mach- gemini below.
Quoted 27 lines
Additional checking will be needed to find such cases.
Signed-off-by Andrew Davis <[email protected]>--- arch/arm/Kconfig | 2 +- arch/arm/Kconfig.platforms | 1 - arch/arm/mach-bcm/Kconfig | 4 ++-- arch/arm/mach-berlin/Kconfig | 2 +- arch/arm/mach-ep93xx/Kconfig | 2 +- arch/arm/mach-gemini/Kconfig | 2 +- arch/arm/mach-imx/Kconfig | 2 +- arch/arm/mach-keystone/Kconfig | 2 +- arch/arm/mach-mmp/Kconfig | 6 +++--- arch/arm/mach-omap2/Kconfig | 1 - arch/arm/mach-rockchip/Kconfig | 2 +- arch/arm/mach-socfpga/Kconfig | 1 - arch/arm/mach-sti/Kconfig | 1 - arch/arm/mach-stm32/Kconfig | 1 - arch/arm/mach-sunxi/Kconfig | 1 - arch/arm/mach-tegra/Kconfig | 1 - arch/arm/mach-zynq/Kconfig | 2 +- arch/arm64/Kconfig.platforms | 9 +++------ arch/mips/Kconfig | 6 ++---- arch/riscv/Kconfig.socs | 2 +- drivers/reset/Kconfig | 4 ---- 21 files changed, 19 insertions(+), 35 deletions(-)
[...]
arch/arm/mach-gemini/Kconfig menuconfig ARCH_GEMINI · line 6
Quoted 10 lines
arch/arm/mach-gemini/Kconfig +1
-1@@ -3,7 +3,7 @@ menuconfig ARCH_GEMINI bool "Cortina Systems Gemini" depends on ARCH_MULTI_V4 depends on CPU_LITTLE_ENDIAN - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLER
I don't think this is required. There is no reset controller implementation in arch/arm/mach-gemini ...
arch/arm/mach-gemini/Kconfig menuconfig ARCH_GEMINI · line 9
Quoted 3 lines
arch/arm/mach-gemini/Kconfig +0
-0select ARM_AMBA select ARM_APPENDED_DTB # Old Redboot bootloaders deployed select COMMON_CLK_GEMINI
... and COMMON_CLK_GEMINI already selects RESET_CONTROLLER in drivers/clk/Kconfig.
regards
Philipp
Quoted 6 lines · Philipp Zabel
Quoted 5 lines · Andrew Davis
Many ARCH_HAS_* symbols change some behavior based on what an ARCH supports, but
ARCH_HAS_RESET_CONTROLLERis used only to set a default forRESET_CONTROLLER. Those ARCH symbols that select this can skip the middleman and directly selectRESET_CONTROLLER, and many already do.
Quoted 7 lines
Quoted 3 lines
Replace all selection of this symbol with a direct selection of
RESET_CONTROLLERwhen it is not already in the selection list. In the latter case whenRESET_CONTROLLERis also already selected we can simply"In the latter case" and "when
RESET_CONTROLLERis also already selected" are saying the same thing. I'd choose one and drop the other.
Sure, it is a little long winded, will clean that up.
Quoted 11 lines
Quoted 7 lines
remove the
ARCH_HAS_RESET_CONTROLLERwithout changing existing behavior.Some ARCHs "select" this symbol when they actually "depend on" the
RESET_CONTROLLERframework to build, in those cases the indirect select could lead to broken randconfig builds. In cases when it is not needed for building the ARCH code, these selections can be switched to the weaker "imply" to allow it deselected for minimal builds without reset support.Can't it just be dropped completely for those? See for example mach- gemini below.
Yes, in some of these cases it wasn't needed and can be dropped such as the mach-gemini case you point out. But my intention here was to mechanical and not make any functional changes, going back and cleaning up cases when it wasn't needed in the first place would come next.
Take the ARCH_BRCMSTB case, nothing in its arch code needs RESET_CONTROLLER but if we remove that select, then nothing else selects RESET_CONTROLLER and RESET_BRCMSTB is no longer enabled, when before it would have been enabled by simply selecting ARCH_BRCMSTB.
Not saying that was correct behavior before either, but at least this patch doesn't change any current default behavior and allows us to start to clean some more odd cases.
Andrew
Quoted 52 lines
Quoted 27 lines
Additional checking will be needed to find such cases.
Signed-off-by Andrew Davis <[email protected]>--- arch/arm/Kconfig | 2 +- arch/arm/Kconfig.platforms | 1 - arch/arm/mach-bcm/Kconfig | 4 ++-- arch/arm/mach-berlin/Kconfig | 2 +- arch/arm/mach-ep93xx/Kconfig | 2 +- arch/arm/mach-gemini/Kconfig | 2 +- arch/arm/mach-imx/Kconfig | 2 +- arch/arm/mach-keystone/Kconfig | 2 +- arch/arm/mach-mmp/Kconfig | 6 +++--- arch/arm/mach-omap2/Kconfig | 1 - arch/arm/mach-rockchip/Kconfig | 2 +- arch/arm/mach-socfpga/Kconfig | 1 - arch/arm/mach-sti/Kconfig | 1 - arch/arm/mach-stm32/Kconfig | 1 - arch/arm/mach-sunxi/Kconfig | 1 - arch/arm/mach-tegra/Kconfig | 1 - arch/arm/mach-zynq/Kconfig | 2 +- arch/arm64/Kconfig.platforms | 9 +++------ arch/mips/Kconfig | 6 ++---- arch/riscv/Kconfig.socs | 2 +- drivers/reset/Kconfig | 4 ---- 21 files changed, 19 insertions(+), 35 deletions(-)[...]
arch/arm/mach-gemini/Kconfig menuconfig ARCH_GEMINI · line 6
Quoted 10 lines
arch/arm/mach-gemini/Kconfig +1
-1@@ -3,7 +3,7 @@ menuconfig ARCH_GEMINI bool "Cortina Systems Gemini" depends on ARCH_MULTI_V4 depends on CPU_LITTLE_ENDIAN - select ARCH_HAS_RESET_CONTROLLER + select RESET_CONTROLLERI don't think this is required. There is no reset controller implementation in
arch/arm/mach-gemini...arch/arm/mach-gemini/Kconfig menuconfig ARCH_GEMINI · line 9
Quoted 3 lines
arch/arm/mach-gemini/Kconfig +0
-0select ARM_AMBA select ARM_APPENDED_DTB # Old Redboot bootloaders deployed select COMMON_CLK_GEMINI... and
COMMON_CLK_GEMINIalready selectsRESET_CONTROLLERindrivers/clk/Kconfig.regards
Philipp