Skip to content

Commit

Permalink
ARM: use "depends on" for SoC configs instead of "if" after prompt
Browse files Browse the repository at this point in the history
Many ARM sub-architectures use prompts followed by "if" conditional,
but it is wrong.

Please notice the difference between

    config ARCH_FOO
            bool "Foo SoCs" if ARCH_MULTI_V7

and

    config ARCH_FOO
            bool "Foo SoCs"
            depends on ARCH_MULTI_V7

These two are *not* equivalent!

In the former statement, it is not ARCH_FOO, but its prompt that
depends on ARCH_MULTI_V7.  So, it is completely valid that ARCH_FOO
is selected by another, but ARCH_MULTI_V7 is still disabled. As it is
not unmet dependency, Kconfig never warns.  This is probably not what
you want.

The former should be used only when you need to do so, and you really
understand what you are doing.  (In most cases, it should be wrong!)

For enabling/disabling sub-architectures, the latter is always correct.

As a good side effect, this commit fixes some entries over 80 columns
(mach-imx, mach-integrator, mach-mbevu).

[Arnd: I note that there is not really a bug here, according to
 the discussion that followed, but I can see value in being consistent
 and in making the lines shorter]

Signed-off-by: Masahiro Yamada <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Acked-by: Heiko Stuebner <[email protected]>
Acked-by: Patrice Chotard <[email protected]>
Acked-by: Liviu Dudau <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Jun Nie <[email protected]>
Acked-by: Matthias Brugger <[email protected]>
Acked-by: Simon Horman <[email protected]>
Acked-by: Gregory CLEMENT <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Acked-by: Sebastian Hesselbarth <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Acked-by: Krzysztof Halasa <[email protected]>
Acked-by: Maxime Coquelin <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
  • Loading branch information
masahir0y authored and arndb committed Dec 1, 2015
1 parent 9d2aa8c commit e324654
Show file tree
Hide file tree
Showing 32 changed files with 110 additions and 58 deletions.
3 changes: 2 additions & 1 deletion arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,8 @@ config ARCH_MULTI_CPU_AUTO
endmenu

config ARCH_VIRT
bool "Dummy Virtual Machine" if ARCH_MULTI_V7
bool "Dummy Virtual Machine"
depends on ARCH_MULTI_V7
select ARM_AMBA
select ARM_GIC
select ARM_GIC_V3
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-alpine/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config ARCH_ALPINE
bool "Annapurna Labs Alpine platform" if ARCH_MULTI_V7
bool "Annapurna Labs Alpine platform"
depends on ARCH_MULTI_V7
select ARM_AMBA
select ARM_GIC
select GENERIC_IRQ_CHIP
Expand Down
15 changes: 10 additions & 5 deletions arch/arm/mach-at91/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ menuconfig ARCH_AT91

if ARCH_AT91
config SOC_SAMA5D2
bool "SAMA5D2 family" if ARCH_MULTI_V7
bool "SAMA5D2 family"
depends on ARCH_MULTI_V7
select SOC_SAMA5
select CACHE_L2X0
select HAVE_FB_ATMEL
Expand All @@ -21,7 +22,8 @@ config SOC_SAMA5D2
Select this if ou are using one of Atmel's SAMA5D2 family SoC.

config SOC_SAMA5D3
bool "SAMA5D3 family" if ARCH_MULTI_V7
bool "SAMA5D3 family"
depends on ARCH_MULTI_V7
select SOC_SAMA5
select HAVE_FB_ATMEL
select HAVE_AT91_UTMI
Expand All @@ -32,7 +34,8 @@ config SOC_SAMA5D3
This support covers SAMA5D31, SAMA5D33, SAMA5D34, SAMA5D35, SAMA5D36.

config SOC_SAMA5D4
bool "SAMA5D4 family" if ARCH_MULTI_V7
bool "SAMA5D4 family"
depends on ARCH_MULTI_V7
select SOC_SAMA5
select CACHE_L2X0
select HAVE_FB_ATMEL
Expand All @@ -44,7 +47,8 @@ config SOC_SAMA5D4
Select this if you are using one of Atmel's SAMA5D4 family SoC.

config SOC_AT91RM9200
bool "AT91RM9200" if ARCH_MULTI_V4T
bool "AT91RM9200"
depends on ARCH_MULTI_V4T
select ATMEL_AIC_IRQ
select ATMEL_ST
select CPU_ARM920T
Expand All @@ -56,7 +60,8 @@ config SOC_AT91RM9200
Select this if you are using Atmel's AT91RM9200 SoC.

config SOC_AT91SAM9
bool "AT91SAM9" if ARCH_MULTI_V5
bool "AT91SAM9"
depends on ARCH_MULTI_V5
select ATMEL_AIC_IRQ
select ATMEL_SDRAMC
select CPU_ARM926T
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-axxia/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config ARCH_AXXIA
bool "LSI Axxia platforms" if (ARCH_MULTI_V7 && ARM_LPAE)
bool "LSI Axxia platforms"
depends on ARCH_MULTI_V7 && ARM_LPAE
select ARCH_DMA_ADDR_T_64BIT
select ARM_AMBA
select ARM_GIC
Expand Down
27 changes: 18 additions & 9 deletions arch/arm/mach-bcm/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_BCM
bool "Broadcom SoC Support" if ARCH_MULTI_V6_V7
bool "Broadcom SoC Support"
depends on ARCH_MULTI_V6_V7
help
This enables support for Broadcom ARM based SoC chips

Expand Down Expand Up @@ -27,7 +28,8 @@ config ARCH_BCM_IPROC
Currently supported SoCs are Cygnus.

config ARCH_BCM_CYGNUS
bool "Broadcom Cygnus Support" if ARCH_MULTI_V7
bool "Broadcom Cygnus Support"
depends on ARCH_MULTI_V7
select ARCH_BCM_IPROC
help
Enable support for the Cygnus family,
Expand All @@ -36,7 +38,8 @@ config ARCH_BCM_CYGNUS
BCM58300, BCM58302, BCM58303, BCM58305.

config ARCH_BCM_NSP
bool "Broadcom Northstar Plus SoC Support" if ARCH_MULTI_V7
bool "Broadcom Northstar Plus SoC Support"
depends on ARCH_MULTI_V7
select ARCH_BCM_IPROC
select ARM_ERRATA_754322
select ARM_ERRATA_775420
Expand All @@ -50,7 +53,8 @@ config ARCH_BCM_NSP
NAND flash, SATA and several other IO controllers.

config ARCH_BCM_5301X
bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
bool "Broadcom BCM470X / BCM5301X ARM SoC"
depends on ARCH_MULTI_V7
select ARCH_BCM_IPROC
help
Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores.
Expand Down Expand Up @@ -82,7 +86,8 @@ config ARCH_BCM_MOBILE
This enables support for systems based on Broadcom mobile SoCs.

config ARCH_BCM_281XX
bool "Broadcom BCM281XX SoC family" if ARCH_MULTI_V7
bool "Broadcom BCM281XX SoC family"
depends on ARCH_MULTI_V7
select ARCH_BCM_MOBILE
select HAVE_SMP
help
Expand All @@ -91,7 +96,8 @@ config ARCH_BCM_281XX
variants.

config ARCH_BCM_21664
bool "Broadcom BCM21664 SoC family" if ARCH_MULTI_V7
bool "Broadcom BCM21664 SoC family"
depends on ARCH_MULTI_V7
select ARCH_BCM_MOBILE
select HAVE_SMP
help
Expand Down Expand Up @@ -122,7 +128,8 @@ config ARCH_BCM_MOBILE_SMP
comment "Other Architectures"

config ARCH_BCM2835
bool "Broadcom BCM2835 family" if ARCH_MULTI_V6
bool "Broadcom BCM2835 family"
depends on ARCH_MULTI_V6
select ARCH_REQUIRE_GPIOLIB
select ARM_AMBA
select ARM_ERRATA_411920
Expand All @@ -135,7 +142,8 @@ config ARCH_BCM2835
used in the Raspberry Pi and Roku 2 devices.

config ARCH_BCM_63XX
bool "Broadcom BCM63xx DSL SoC" if ARCH_MULTI_V7
bool "Broadcom BCM63xx DSL SoC"
depends on ARCH_MULTI_V7
depends on MMU
select ARM_ERRATA_754322
select ARM_ERRATA_764369 if SMP
Expand All @@ -152,7 +160,8 @@ config ARCH_BCM_63XX
the BCM63138 variant.

config ARCH_BRCMSTB
bool "Broadcom BCM7XXX based boards" if ARCH_MULTI_V7
bool "Broadcom BCM7XXX based boards"
depends on ARCH_MULTI_V7
select ARM_GIC
select ARM_ERRATA_798181 if SMP
select HAVE_ARM_ARCH_TIMER
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-berlin/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_BERLIN
bool "Marvell Berlin SoCs" if ARCH_MULTI_V7
bool "Marvell Berlin SoCs"
depends on ARCH_MULTI_V7
select ARCH_HAS_RESET_CONTROLLER
select ARCH_REQUIRE_GPIOLIB
select ARM_GIC
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-cns3xxx/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_CNS3XXX
bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6
bool "Cavium Networks CNS3XXX family"
depends on ARCH_MULTI_V6
select ARM_GIC
select PCI_DOMAINS if PCI
help
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-exynos/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
# Configuration options for the EXYNOS4

menuconfig ARCH_EXYNOS
bool "Samsung EXYNOS" if ARCH_MULTI_V7
bool "Samsung EXYNOS"
depends on ARCH_MULTI_V7
select ARCH_HAS_BANDGAP
select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_REQUIRE_GPIOLIB
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-highbank/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config ARCH_HIGHBANK
bool "Calxeda ECX-1000/2000 (Highbank/Midway)" if ARCH_MULTI_V7
bool "Calxeda ECX-1000/2000 (Highbank/Midway)"
depends on ARCH_MULTI_V7
select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
select ARCH_HAS_HOLES_MEMORYMODEL
select ARCH_SUPPORTS_BIG_ENDIAN
Expand Down
12 changes: 8 additions & 4 deletions arch/arm/mach-hisi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ if ARCH_HISI
menu "Hisilicon platform type"

config ARCH_HI3xxx
bool "Hisilicon Hi36xx family" if ARCH_MULTI_V7
bool "Hisilicon Hi36xx family"
depends on ARCH_MULTI_V7
select CACHE_L2X0
select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP
Expand All @@ -23,15 +24,17 @@ config ARCH_HI3xxx
Support for Hisilicon Hi36xx SoC family

config ARCH_HIP01
bool "Hisilicon HIP01 family" if ARCH_MULTI_V7
bool "Hisilicon HIP01 family"
depends on ARCH_MULTI_V7
select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP
select ARM_GLOBAL_TIMER
help
Support for Hisilicon HIP01 SoC family

config ARCH_HIP04
bool "Hisilicon HiP04 Cortex A15 family" if ARCH_MULTI_V7
bool "Hisilicon HiP04 Cortex A15 family"
depends on ARCH_MULTI_V7
select ARM_ERRATA_798181 if SMP
select HAVE_ARM_ARCH_TIMER
select MCPM if SMP
Expand All @@ -40,7 +43,8 @@ config ARCH_HIP04
Support for Hisilicon HiP04 SoC family

config ARCH_HIX5HD2
bool "Hisilicon X5HD2 family" if ARCH_MULTI_V7
bool "Hisilicon X5HD2 family"
depends on ARCH_MULTI_V7
select CACHE_L2X0
select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/mach-imx/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_MXC
bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M
bool "Freescale i.MX family"
depends on ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M
select ARCH_REQUIRE_GPIOLIB
select ARM_CPU_SUSPEND if PM
select CLKSRC_IMX_GPT
Expand Down Expand Up @@ -596,7 +597,8 @@ choice
default VF_USE_ARM_GLOBAL_TIMER

config VF_USE_ARM_GLOBAL_TIMER
bool "Use ARM Global Timer" if ARCH_MULTI_V7
bool "Use ARM Global Timer"
depends on ARCH_MULTI_V7
select ARM_GLOBAL_TIMER
select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
help
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-integrator/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config ARCH_INTEGRATOR
bool "ARM Ltd. Integrator family" if (ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V6)
bool "ARM Ltd. Integrator family"
depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V6
select ARM_AMBA
select ARM_PATCH_PHYS_VIRT if MMU
select AUTO_ZRELADDR
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-mediatek/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_MEDIATEK
bool "Mediatek MT65xx & MT81xx SoC" if ARCH_MULTI_V7
bool "Mediatek MT65xx & MT81xx SoC"
depends on ARCH_MULTI_V7
select ARM_GIC
select PINCTRL
select MTK_TIMER
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-meson/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_MESON
bool "Amlogic Meson SoCs" if ARCH_MULTI_V7
bool "Amlogic Meson SoCs"
depends on ARCH_MULTI_V7
select ARCH_REQUIRE_GPIOLIB
select GENERIC_IRQ_CHIP
select ARM_GIC
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-moxart/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_MOXART
bool "MOXA ART SoC" if ARCH_MULTI_V4
bool "MOXA ART SoC"
depends on ARCH_MULTI_V4
select CPU_FA526
select ARM_DMA_MEM_BUFFERABLE
select CLKSRC_MMIO
Expand Down
24 changes: 16 additions & 8 deletions arch/arm/mach-mvebu/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_MVEBU
bool "Marvell Engineering Business Unit (MVEBU) SoCs" if (ARCH_MULTI_V7 || ARCH_MULTI_V5)
bool "Marvell Engineering Business Unit (MVEBU) SoCs"
depends on ARCH_MULTI_V7 || ARCH_MULTI_V5
select ARCH_SUPPORTS_BIG_ENDIAN
select CLKSRC_MMIO
select GENERIC_IRQ_CHIP
Expand All @@ -25,7 +26,8 @@ config MACH_MVEBU_V7
select MACH_MVEBU_ANY

config MACH_ARMADA_370
bool "Marvell Armada 370 boards" if ARCH_MULTI_V7
bool "Marvell Armada 370 boards"
depends on ARCH_MULTI_V7
select ARMADA_370_CLK
select CPU_PJ4B
select MACH_MVEBU_V7
Expand All @@ -35,7 +37,8 @@ config MACH_ARMADA_370
on the Marvell Armada 370 SoC with device tree.

config MACH_ARMADA_375
bool "Marvell Armada 375 boards" if ARCH_MULTI_V7
bool "Marvell Armada 375 boards"
depends on ARCH_MULTI_V7
select ARM_ERRATA_720789
select ARM_ERRATA_753970
select ARM_GIC
Expand All @@ -50,7 +53,8 @@ config MACH_ARMADA_375
on the Marvell Armada 375 SoC with device tree.

config MACH_ARMADA_38X
bool "Marvell Armada 380/385 boards" if ARCH_MULTI_V7
bool "Marvell Armada 380/385 boards"
depends on ARCH_MULTI_V7
select ARM_ERRATA_720789
select ARM_ERRATA_753970
select ARM_GIC
Expand All @@ -65,7 +69,8 @@ config MACH_ARMADA_38X
on the Marvell Armada 380/385 SoC with device tree.

config MACH_ARMADA_39X
bool "Marvell Armada 39x boards" if ARCH_MULTI_V7
bool "Marvell Armada 39x boards"
depends on ARCH_MULTI_V7
select ARM_GIC
select ARMADA_39X_CLK
select CACHE_L2X0
Expand All @@ -79,7 +84,8 @@ config MACH_ARMADA_39X
on the Marvell Armada 39x SoC with device tree.

config MACH_ARMADA_XP
bool "Marvell Armada XP boards" if ARCH_MULTI_V7
bool "Marvell Armada XP boards"
depends on ARCH_MULTI_V7
select ARMADA_XP_CLK
select CPU_PJ4B
select MACH_MVEBU_V7
Expand All @@ -89,7 +95,8 @@ config MACH_ARMADA_XP
on the Marvell Armada XP SoC with device tree.

config MACH_DOVE
bool "Marvell Dove boards" if ARCH_MULTI_V7
bool "Marvell Dove boards"
depends on ARCH_MULTI_V7
select CACHE_L2X0
select CPU_PJ4
select DOVE_CLK
Expand All @@ -103,7 +110,8 @@ config MACH_DOVE
Marvell Dove using flattened device tree.

config MACH_KIRKWOOD
bool "Marvell Kirkwood boards" if ARCH_MULTI_V5
bool "Marvell Kirkwood boards"
depends on ARCH_MULTI_V5
select ARCH_REQUIRE_GPIOLIB
select CPU_FEROCEON
select KIRKWOOD_CLK
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-picoxcell/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config ARCH_PICOXCELL
bool "Picochip PicoXcell" if ARCH_MULTI_V6
bool "Picochip PicoXcell"
depends on ARCH_MULTI_V6
select ARCH_REQUIRE_GPIOLIB
select ARM_VIC
select DW_APB_TIMER_OF
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-prima2/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_SIRF
bool "CSR SiRF" if ARCH_MULTI_V7
bool "CSR SiRF"
depends on ARCH_MULTI_V7
select ARCH_HAS_RESET_CONTROLLER
select ARCH_REQUIRE_GPIOLIB
select GENERIC_IRQ_CHIP
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-qcom/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
menuconfig ARCH_QCOM
bool "Qualcomm Support" if ARCH_MULTI_V7
bool "Qualcomm Support"
depends on ARCH_MULTI_V7
select ARCH_SUPPORTS_BIG_ENDIAN
select ARM_GIC
select ARM_AMBA
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-rockchip/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config ARCH_ROCKCHIP
bool "Rockchip RK2928 and RK3xxx SOCs" if ARCH_MULTI_V7
bool "Rockchip RK2928 and RK3xxx SOCs"
depends on ARCH_MULTI_V7
select PINCTRL
select PINCTRL_ROCKCHIP
select ARCH_HAS_RESET_CONTROLLER
Expand Down
Loading

0 comments on commit e324654

Please sign in to comment.