Skip to content

Commit c5839f8

Browse files
ulfalizergalak
authored andcommitted
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 <[email protected]>
1 parent b81eec9 commit c5839f8

File tree

309 files changed

+106
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+106
-250
lines changed

arch/Kconfig

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,62 @@
1111
# Note: $ARCH might be a glob pattern
1212
source "$(ARCH_DIR)/$(ARCH)/Kconfig"
1313

14-
choice ARCH_CHOICE
15-
prompt "Architecture"
16-
default X86
14+
# Architecture symbols
15+
#
16+
# Should be 'select'ed by low-level symbols like SOC_SERIES_* or, lacking that,
17+
# by SOC_*.
1718

1819
config ARC
19-
bool "ARC architecture"
20+
bool
2021
select HAS_DTS
22+
help
23+
ARC architecture
2124

2225
config ARM
23-
bool "ARM architecture"
26+
bool
2427
select HAS_DTS
28+
help
29+
ARM architecture
2530

2631
config X86
27-
bool "x86 architecture"
32+
bool
2833
select ATOMIC_OPERATIONS_BUILTIN
2934
select HAS_DTS
35+
help
36+
x86 architecture
3037

3138
config NIOS2
32-
bool "Nios II Gen 2 architecture"
39+
bool
3340
select ATOMIC_OPERATIONS_C
3441
select HAS_DTS
42+
help
43+
Nios II Gen 2 architecture
3544

3645
config RISCV
37-
bool "RISCV architecture"
46+
bool
3847
select HAS_DTS
48+
help
49+
RISCV architecture
3950

4051
config XTENSA
41-
bool "Xtensa architecture"
52+
bool
4253
select HAS_DTS
4354
select USE_SWITCH
4455
select USE_SWITCH_SUPPORTED
4556
select XTENSA_HAL if "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "xcc"
57+
help
58+
Xtensa architecture
4659

4760
config ARCH_POSIX
48-
bool "POSIX (native) architecture"
61+
bool
4962
select ATOMIC_OPERATIONS_BUILTIN
5063
select ARCH_HAS_CUSTOM_SWAP_TO_MAIN
5164
select ARCH_HAS_CUSTOM_BUSY_WAIT
5265
select ARCH_HAS_THREAD_ABORT
5366
select NATIVE_APPLICATION
5467
select HAS_COVERAGE_SUPPORT
55-
56-
endchoice
57-
68+
help
69+
POSIX (native) architecture
5870

5971
menu "General Architecture Options"
6072

boards/arc/em_starterkit/em_starterkit_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
CONFIG_ARC=y
43
CONFIG_CPU_ARCEM=y
54
CONFIG_SOC_EMSK=y
65
CONFIG_SOC_EMSK_EM9D=y

boards/arc/em_starterkit/em_starterkit_em11d_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
CONFIG_ARC=y
43
CONFIG_CPU_ARCEM=y
54
CONFIG_SOC_EMSK=y
65
CONFIG_SOC_EMSK_EM11D=y

boards/arc/em_starterkit/em_starterkit_em7d_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
CONFIG_ARC=y
43
CONFIG_CPU_ARCEM=y
54
CONFIG_SOC_EMSK=y
65
CONFIG_SOC_EMSK_EM7D=y

boards/arc/em_starterkit/em_starterkit_em7d_normal_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CONFIG_ARC=y
21
CONFIG_SOC_EMSK=y
32
CONFIG_SOC_EMSK_EM7D=y
43
CONFIG_BOARD_EM_STARTERKIT=y

boards/arc/em_starterkit/em_starterkit_em7d_v22_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
CONFIG_ARC=y
43
CONFIG_CPU_ARCEM=y
54
CONFIG_SOC_EMSK=y
65
CONFIG_SOC_EMSK_EM7D=y

boards/arc/emsdp/emsdp_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
CONFIG_ARC=y
43
CONFIG_CPU_ARCEM=y
54
CONFIG_SOC_ARC_EMSDP=y
65
CONFIG_SOC_EMSDP_EM11D=y

boards/arc/emsdp/emsdp_em4_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
CONFIG_ARC=y
43
CONFIG_CPU_ARCEM=y
54
CONFIG_SOC_ARC_EMSDP=y
65
CONFIG_SOC_EMSDP_EM4=y

boards/arc/emsdp/emsdp_em5d_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
CONFIG_ARC=y
43
CONFIG_CPU_ARCEM=y
54
CONFIG_SOC_ARC_EMSDP=y
65
CONFIG_SOC_EMSDP_EM5D=y

boards/arc/emsdp/emsdp_em6_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
CONFIG_ARC=y
43
CONFIG_CPU_ARCEM=y
54
CONFIG_SOC_ARC_EMSDP=y
65
CONFIG_SOC_EMSDP_EM6=y

0 commit comments

Comments
 (0)