kconfig: Remove assignments to CONFIG_<arch> syms and hide them

All board defconfig files currently set the architecture in addition to
the board and the SoC, by setting e.g. CONFIG_ARM=y. This spams up
defconfig files.

CONFIG_<arch> symbols currently being set in configuration files also
means that they are configurable (can be changed in menuconfig and in
configuration files), even though changing the architecture won't work,
since other things get set from -DBOARD=<board>. Many boards also allow
changing the architecture symbols independently from the SoC symbols,
which doesn't make sense.

Get rid of all assignments to CONFIG_<arch> symbols and clean up the
relationships between symbols and the configuration interface, like
this:

1. Remove the choice with the CONFIG_<arch> symbols in arch/Kconfig and
   turn the CONFIG_<arch> symbols into invisible
   (promptless/nonconfigurable) symbols instead.

   Getting rid of the choice allows the symbols to be 'select'ed (choice
   symbols don't support 'select').

2. Select the right CONFIG_<arch> symbol from the SOC_SERIES_* symbols.
   This makes sense since you know the architecture if you know the SoC.

   Put the select on the SOC_* symbol instead for boards that don't have
   a SOC_SERIES_*.

3. Remove all assignments to CONFIG_<arch> symbols. The assignments
   would generate errors now, since the symbols are promptless.

The change was done by grepping for assignments to CONFIG_<arch>
symbols, finding the SOC_SERIES_* (or SOC_*) symbol being set in the
same defconfig file, and putting a 'select' on it instead.

See
https://github.com/ulfalizer/zephyr/commits/hide-arch-syms-unsquashed
for a split-up version of this commit, which will make it easier to see
how stuff was done. This needs to go in as one commit though.

This change is safer than it might seem re. outstanding PRs, because any
assignment to CONFIG_<arch> symbols generates an error now, making
outdated stuff easy to catch.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2020-02-06 18:26:14 +01:00 committed by Kumar Gala
commit c5839f834b
309 changed files with 106 additions and 250 deletions

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32F0X
bool "STM32F0x Series MCU"
select ARM
select CPU_CORTEX_M0
select CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP
select SOC_FAMILY_STM32

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32F1X
bool "STM32F1x Series MCU"
select ARM
select CPU_CORTEX_M3
select CPU_CORTEX_M_HAS_DWT
select SOC_FAMILY_STM32

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32F2X
bool "stm32f2x Series MCU"
select ARM
select CPU_CORTEX_M3
select CPU_CORTEX_M_HAS_DWT
select SOC_FAMILY_STM32

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32F3X
bool "STM32F3x Series MCU"
select ARM
select CPU_CORTEX_M4
select CPU_CORTEX_M_HAS_DWT
select SOC_FAMILY_STM32

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32F4X
bool "STM32F4x Series MCU"
select ARM
select CPU_CORTEX_M4
select CPU_CORTEX_M_HAS_DWT
select CPU_HAS_FPU

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32F7X
bool "STM32F7x Series MCU"
select ARM
select CPU_CORTEX_M7
select CPU_CORTEX_M_HAS_DWT
select CPU_HAS_FPU

View file

@ -6,6 +6,7 @@
config SOC_SERIES_STM32G0X
bool "STM32G0x Series MCU"
select ARM
select CPU_CORTEX_M0PLUS
select CPU_CORTEX_M_HAS_VTOR
select CPU_HAS_ARM_MPU

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32G4X
bool "STM32G4x Series MCU"
select ARM
select CPU_CORTEX_M4
select CPU_CORTEX_M_HAS_DWT
select CPU_HAS_FPU

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32H7X
bool "STM32H7x Series MCU"
select ARM
select CPU_CORTEX_M_HAS_DWT
select CPU_HAS_FPU
select SOC_FAMILY_STM32

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32L0X
bool "STM32L0x Series MCU"
select ARM
select CPU_CORTEX_M0PLUS
select CPU_CORTEX_M_HAS_VTOR
select SOC_FAMILY_STM32

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32L1X
bool "STM32L1x Series MCU"
select ARM
select CPU_CORTEX_M3
select CPU_CORTEX_M_HAS_DWT
select SOC_FAMILY_STM32

View file

@ -6,6 +6,7 @@
config SOC_SERIES_STM32L4X
bool "STM32L4x Series MCU"
select ARM
select CPU_CORTEX_M4
select CPU_CORTEX_M_HAS_DWT
select CPU_HAS_FPU

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32MP1X
bool "STM32MP15 Series MPU"
select ARM
select CPU_CORTEX_M4
select CPU_CORTEX_M_HAS_DWT
select SOC_FAMILY_STM32

View file

@ -5,6 +5,7 @@
config SOC_SERIES_STM32WBX
bool "STM32WBx Series MCU"
select ARM
select CPU_CORTEX_M4
select CPU_CORTEX_M_HAS_DWT
select CPU_HAS_FPU