diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index ba1530c878dba..0ac042c5fb8c4 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -69,7 +69,7 @@ jobs: # debug ls -la git log --pretty=oneline | head -n 10 - ./scripts/ci/check_compliance.py -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m Kconfig -c origin/${BASE_REF}.. + ./scripts/ci/check_compliance.py -m Devicetree -m Gitlint -m Identity -m Nits -m pylint -m checkpatch -m Kconfig -m KconfigBoardV2 -c origin/${BASE_REF}.. - name: upload-results uses: actions/upload-artifact@v3 diff --git a/arch/Kconfig b/arch/Kconfig index a6079eb90eef1..77bfaf8e58d24 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -904,27 +904,6 @@ config ARCH help System architecture string. -config SOC - string - help - SoC name which can be found under soc//. - This option holds the directory name used by the build system to locate - the correct linker and header files for the SoC. - -config SOC_SERIES - string - help - SoC series name which can be found under soc///. - This option holds the directory name used by the build system to locate - the correct linker and header files. - -config SOC_FAMILY - string - help - SoC family name which can be found under soc//. - This option holds the directory name used by the build system to locate - the correct linker and header files. - config TOOLCHAIN_HAS_BUILTIN_FFS bool default y if !(64BIT && RISCV) diff --git a/boards/Kconfig b/boards/Kconfig index 5a0adb67ea59d..d7404bcefa8d3 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -2,6 +2,8 @@ config BOARD string + # When using Board scheme v2, then the board is inherited from CMake. + default "$(BOARD)" if "$(BOARD_SCHEME)" = "v2" help This option holds the name of the board and is used to locate the files related to the board in the source tree (under boards/). @@ -38,14 +40,7 @@ config NET_DRIVERS When building for a qemu target then NET_DRIVERS will be default enabled to allow for easy use of SLIP or PPP -# Note: $BOARD_DIR might be a glob pattern - -choice - prompt "Board Selection" - -source "$(BOARD_DIR)/Kconfig.board" - -endchoice +rsource "Kconfig.$(BOARD_SCHEME)" # Parse shields references # Don't do it as a menuconfig, as shield selection is a CMake feature. diff --git a/boards/Kconfig.v1 b/boards/Kconfig.v1 new file mode 100644 index 0000000000000..670e2f2376eb8 --- /dev/null +++ b/boards/Kconfig.v1 @@ -0,0 +1,10 @@ +# Copyright (c) 2022 Nordic Semiconductor ASA + +# SPDX-License-Identifier: Apache-2.0 + +choice + prompt "Board Selection" + +source "$(BOARD_DIR)/Kconfig.board" + +endchoice diff --git a/boards/Kconfig.v2 b/boards/Kconfig.v2 new file mode 100644 index 0000000000000..3742440878691 --- /dev/null +++ b/boards/Kconfig.v2 @@ -0,0 +1,5 @@ +# Copyright (c) 2022 Nordic Semiconductor ASA + +# SPDX-License-Identifier: Apache-2.0 + +osource "$(BOARD_DIR)/Kconfig.v2.$(BOARD)" diff --git a/boards/arm/nrf52840dk_nrf52811/Kconfig.board b/boards/arm/nrf52840dk_nrf52811/Kconfig.v2.nrf52840dk_nrf52811 similarity index 70% rename from boards/arm/nrf52840dk_nrf52811/Kconfig.board rename to boards/arm/nrf52840dk_nrf52811/Kconfig.v2.nrf52840dk_nrf52811 index 5eefb967cd7a3..d8f38a9138cb0 100644 --- a/boards/arm/nrf52840dk_nrf52811/Kconfig.board +++ b/boards/arm/nrf52840dk_nrf52811/Kconfig.v2.nrf52840dk_nrf52811 @@ -4,5 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 config BOARD_NRF52840DK_NRF52811 - bool "nRF52840 DK NRF52811" - depends on SOC_NRF52811_QFAA + bool + default y + select SOC_NRF52811_QFAA + select SOC_SERIES_NRF52X diff --git a/boards/arm/nrf52840dk_nrf52811/nrf52840dk_nrf52811_defconfig b/boards/arm/nrf52840dk_nrf52811/nrf52840dk_nrf52811_defconfig index 36553a757eb68..c3af0cbf96877 100644 --- a/boards/arm/nrf52840dk_nrf52811/nrf52840dk_nrf52811_defconfig +++ b/boards/arm/nrf52840dk_nrf52811/nrf52840dk_nrf52811_defconfig @@ -2,10 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52811_QFAA=y -CONFIG_BOARD_NRF52840DK_NRF52811=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/boards/arm/nrf52840dk_nrf52840/Kconfig.board b/boards/arm/nrf52840dk_nrf52840/Kconfig.board deleted file mode 100644 index dcfdb550a4361..0000000000000 --- a/boards/arm/nrf52840dk_nrf52840/Kconfig.board +++ /dev/null @@ -1,8 +0,0 @@ -# nRF52840 DK NRF52840 board configuration - -# Copyright (c) 2016 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config BOARD_NRF52840DK_NRF52840 - bool "nRF52840 DK NRF52840" - depends on SOC_NRF52840_QIAA diff --git a/boards/arm/nrf52840dk_nrf52840/Kconfig.v2.nrf52840dk_nrf52840 b/boards/arm/nrf52840dk_nrf52840/Kconfig.v2.nrf52840dk_nrf52840 new file mode 100644 index 0000000000000..e3eab293f0412 --- /dev/null +++ b/boards/arm/nrf52840dk_nrf52840/Kconfig.v2.nrf52840dk_nrf52840 @@ -0,0 +1,9 @@ +# Copyright (c) 2022 Zephyr Project members and individual contributors +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_NRF52840DK_NRF52840 + bool + default y + select SOC_SERIES_NRF52X + select SOC_NRF52840_QIAA + select NATIVE_APPLICATION diff --git a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig index 100d91ed3203b..f4129c730a9d8 100644 --- a/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig +++ b/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig @@ -1,9 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52840_QIAA=y -CONFIG_BOARD_NRF52840DK_NRF52840=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/cmake/modules/kconfig.cmake b/cmake/modules/kconfig.cmake index 4316f2e42d285..afceb98f40556 100644 --- a/cmake/modules/kconfig.cmake +++ b/cmake/modules/kconfig.cmake @@ -111,6 +111,17 @@ string(REPLACE ";" "\\\;" SHIELD_AS_LIST_ESCAPED "${SHIELD_AS_LIST}") # cmake commands are escaped differently string(REPLACE ";" "\\;" SHIELD_AS_LIST_ESCAPED_COMMAND "${SHIELD_AS_LIST}") +# A Kconfig.board indicates legacy style board definition, whereas +# Kconfig.${BOARD} indicates new and improved style. +if(EXISTS ${BOARD_DIR}/Kconfig.board AND NOT EXISTS ${BOARD_DIR}/Kconfig.${BOARD}) + set(BOARD_SCHEME v1) +elseif(NOT EXISTS ${BOARD_DIR}/Kconfig.board AND EXISTS ${BOARD_DIR}/Kconfig.${BOARD}) + set(BOARD_SCHEME v2) +elseif(EXISTS ${BOARD_DIR}/Kconfig.board AND EXISTS ${BOARD_DIR}/Kconfig.${BOARD}) + message(WARNING "Mixed board scheme (v1 + v2) not allowed, using board scheme v2.") + set(BOARD_SCHEME v2) +endif() + set(COMMON_KCONFIG_ENV_SETTINGS PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} srctree=${ZEPHYR_BASE} @@ -122,7 +133,9 @@ set(COMMON_KCONFIG_ENV_SETTINGS ARCH=${ARCH} ARCH_DIR=${ARCH_DIR} BOARD_DIR=${BOARD_DIR} + BOARD=${BOARD} BOARD_REVISION=${BOARD_REVISION} + BOARD_SCHEME=${BOARD_SCHEME} KCONFIG_BINARY_DIR=${KCONFIG_BINARY_DIR} ZEPHYR_TOOLCHAIN_VARIANT=${ZEPHYR_TOOLCHAIN_VARIANT} TOOLCHAIN_KCONFIG_DIR=${TOOLCHAIN_KCONFIG_DIR} diff --git a/doc/_extensions/zephyr/kconfig/__init__.py b/doc/_extensions/zephyr/kconfig/__init__.py index 1e7f4097f4cb2..3645d39b99cbb 100644 --- a/doc/_extensions/zephyr/kconfig/__init__.py +++ b/doc/_extensions/zephyr/kconfig/__init__.py @@ -97,6 +97,7 @@ def kconfig_load(app: Sphinx) -> Tuple[kconfiglib.Kconfig, Dict[str, str]]: os.environ["ARCH_DIR"] = "arch" os.environ["ARCH"] = "*" os.environ["BOARD_DIR"] = "boards/*/*" + os.environ["BOARD_SCHEME"] = "v*" # insert external Kconfigs to the environment module_paths = dict() diff --git a/scripts/ci/Kconfig.board.v2 b/scripts/ci/Kconfig.board.v2 new file mode 100644 index 0000000000000..48e239d1bae94 --- /dev/null +++ b/scripts/ci/Kconfig.board.v2 @@ -0,0 +1,11 @@ +# Kconfig top-level ci for compliance testing Kconfig tree for boards / SoC v2 scheme. +# +# Copyright (c) 2022 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 + +mainmenu "Zephyr board / SoC v2 Configuration" + +SOC_SCHEME = $(BOARD_SCHEME) +source "boards/Kconfig.$(BOARD_SCHEME)" +source "soc/Kconfig.$(SOC_SCHEME)" diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 088e331dade3d..9341384773f9f 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -229,8 +229,8 @@ class KconfigCheck(ComplianceTest): doc = "See https://docs.zephyrproject.org/latest/guides/kconfig/index.html for more details." path_hint = ZEPHYR_BASE - def run(self, full=True): - kconf = self.parse_kconfig() + def run(self, full=True, board_scheme="v*", filename="Kconfig"): + kconf = self.parse_kconfig(board_scheme=board_scheme, filename=filename) self.check_top_menu_not_too_long(kconf) self.check_no_pointless_menuconfigs(kconf) @@ -294,7 +294,7 @@ def get_kconfig_dts(self, kconfig_dts_file): self.error(ex.output) - def parse_kconfig(self): + def parse_kconfig(self, board_scheme="v*", filename="Kconfig"): """ Returns a kconfiglib.Kconfig object for the Kconfig files. We reuse this object for all tests to avoid having to reparse for each test. @@ -321,6 +321,8 @@ def parse_kconfig(self): os.environ["SOC_DIR"] = "soc/" os.environ["ARCH_DIR"] = "arch/" os.environ["BOARD_DIR"] = "boards/*/*" + os.environ["BOARD_SCHEME"] = board_scheme + os.environ["BOARD"] = "*" os.environ["ARCH"] = "*" os.environ["KCONFIG_BINARY_DIR"] = tempfile.gettempdir() os.environ['DEVICETREE_CONF'] = "dummy" @@ -345,7 +347,7 @@ def parse_kconfig(self): # them: so some warnings might get printed # twice. "warn_to_stderr=False" could unfortunately cause # some (other) warnings to never be printed. - return kconfiglib.Kconfig() + return kconfiglib.Kconfig(filename=filename) except kconfiglib.KconfigError as e: self.add_failure(str(e)) raise EndTest @@ -632,6 +634,24 @@ def run(self): super().run(full=False) +class KconfigBoardV2Check(KconfigCheck, ComplianceTest): + """ + This runs the Kconfig test for board and SoC v2 scheme. + This check ensures that all symbols inside the v2 scheme is also defined + within the same tree. + This ensures the board and SoC trees are fully self-contained and reusable. + """ + name = "KconfigBoardV2" + doc = "See https://docs.zephyrproject.org/latest/guides/kconfig/index.html for more details." + path_hint = ZEPHYR_BASE + + def run(self): + # Use dedicated Kconfig board / soc v2 scheme file. + # This file sources only v2 scheme tree. + kconfig_file = os.path.join(os.path.dirname(__file__), "Kconfig.board.v2") + super().run(full=False, board_scheme="v2", filename=kconfig_file) + + class Codeowners(ComplianceTest): """ Check if added files have an owner. diff --git a/soc/Kconfig b/soc/Kconfig index da9febef2ce7c..525fff1412ecc 100644 --- a/soc/Kconfig +++ b/soc/Kconfig @@ -1,14 +1,10 @@ # SPDX-License-Identifier: Apache-2.0 -choice - prompt "SoC/CPU/Configuration Selection" +# SoC scheme follows the board scheme versioning. +SOC_SCHEME = $(BOARD_SCHEME) -# This loads custom SoC root Kconfig (only available if custom SoC root are defined) -osource "$(KCONFIG_BINARY_DIR)/Kconfig.soc" -# This loads Zephyr base SoC root Kconfig -osource "soc/$(ARCH)/*/Kconfig.soc" - -endchoice +# This loads any SoC scheme specific content. +rsource "Kconfig.$(SOC_SCHEME)" menu "Hardware Configuration" # This loads custom SoC root Kconfig (only available if custom SoC root are defined) diff --git a/soc/Kconfig.v1 b/soc/Kconfig.v1 new file mode 100644 index 0000000000000..e6d90ca96e67c --- /dev/null +++ b/soc/Kconfig.v1 @@ -0,0 +1,34 @@ +# Copyright (c) 2022 Nordic Semiconductor ASA + +# SPDX-License-Identifier: Apache-2.0 + +config SOC + string + help + SoC name which can be found under soc//. + This option holds the directory name used by the build system to locate + the correct linker and header files for the SoC. + +config SOC_SERIES + string + help + SoC series name which can be found under soc///. + This option holds the directory name used by the build system to locate + the correct linker and header files. + +config SOC_FAMILY + string + help + SoC family name which can be found under soc//. + This option holds the directory name used by the build system to locate + the correct linker and header files. + +choice + prompt "SoC/CPU/Configuration Selection" + +# This loads custom SoC root Kconfig (only available if custom SoC root are defined) +osource "$(KCONFIG_BINARY_DIR)/Kconfig.soc" +# This loads Zephyr base SoC scheme v1 root Kconfig +osource "soc/$(ARCH)/*/Kconfig.soc" + +endchoice diff --git a/soc/Kconfig.v2 b/soc/Kconfig.v2 new file mode 100644 index 0000000000000..02cf1ed643658 --- /dev/null +++ b/soc/Kconfig.v2 @@ -0,0 +1,37 @@ +# Copyright (c) 2022 Nordic Semiconductor ASA + +# SPDX-License-Identifier: Apache-2.0 + +# Load all SoCs. +# SoCs that has transistioned to SoC scheme v2 are promptless, and thus +# unselectable by the user or thorugh configuration files. +# +# SoC that are still using scheme v1 are still having a prompt but is loaded as +# they offer board maintainers the possibility to use board scheme v2. + +config SOC + string + help + SoC name which can be found under soc//. + This option holds the directory name used by the build system to locate + the correct linker and header files for the SoC. + +config SOC_SERIES + string + help + SoC series name which can be found under soc///. + This option holds the directory name used by the build system to locate + the correct linker and header files. + +config SOC_FAMILY + string + help + SoC family name which can be found under soc//. + This option holds the directory name used by the build system to locate + the correct linker and header files. + +osource "$(KCONFIG_BINARY_DIR)/Kconfig.soc.v2" +# This loads Zephyr base SoC root Kconfig +osource "soc/$(ARCH)/*/Kconfig.soc.v2" + +#endif diff --git a/soc/arm/nordic_nrf/Kconfig b/soc/arm/nordic_nrf/Kconfig index aefe8ea0061b7..adcb56fa8d507 100644 --- a/soc/arm/nordic_nrf/Kconfig +++ b/soc/arm/nordic_nrf/Kconfig @@ -8,12 +8,28 @@ config SOC_FAMILY_NRF select PLATFORM_SPECIFIC_INIT bool +config SOC_SERIES_NRF52X + bool + select ARM + select SOC_COMPATIBLE_NRF52X + select CPU_CORTEX_M4 + select CPU_HAS_ARM_MPU + select SOC_FAMILY_NRF + select XIP + select HAS_NRFX + select HAS_NORDIC_DRIVERS + select HAS_SEGGER_RTT + select HAS_SWO + help + Enable support for NRF52 MCU series + if SOC_FAMILY_NRF config SOC_FAMILY string default "nordic_nrf" source "soc/arm/nordic_nrf/Kconfig.peripherals" +source "soc/arm/nordic_nrf/*/Kconfig.soc.$(SOC_SCHEME)" source "soc/arm/nordic_nrf/*/Kconfig.soc" config NRF_SOC_SECURE_SUPPORTED diff --git a/soc/arm/nordic_nrf/Kconfig.soc b/soc/arm/nordic_nrf/Kconfig.soc deleted file mode 100644 index 1eda7294674df..0000000000000 --- a/soc/arm/nordic_nrf/Kconfig.soc +++ /dev/null @@ -1,6 +0,0 @@ -# Nordic Semiconductor nRFx MCU line - -# Copyright (c) 2016-2018 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -source "soc/arm/nordic_nrf/*/Kconfig.series" diff --git a/soc/arm/nordic_nrf/Kconfig.soc.v2 b/soc/arm/nordic_nrf/Kconfig.soc.v2 new file mode 100644 index 0000000000000..78996cb987bdb --- /dev/null +++ b/soc/arm/nordic_nrf/Kconfig.soc.v2 @@ -0,0 +1,38 @@ +# Copyright (c) 2022 Nordic Semiconductor ASA + +# SPDX-License-Identifier: Apache-2.0 + +config SOC_SERIES + default "nrf52" + depends on SOC_SERIES_NRF52X + +config SOC_FAMILY_NRF + bool + +config SOC_FAMILY + string + default "nordic_nrf" + depends on SOC_FAMILY_NRF + +config SOC_SERIES_NRF51X + bool + help + Enable support for NRF51 MCU series + +config SOC_SERIES_NRF52X + bool + select SOC_FAMILY_NRF + help + Enable support for NRF52 MCU series + +config SOC_SERIES_NRF53X + bool + help + Enable support for NRF53 MCU series + +config SOC_SERIES_NRF91X + bool + help + Enable support for NRF91 MCU series + +rsource "*/Kconfig.soc.v2" diff --git a/soc/arm/nordic_nrf/nrf51/Kconfig.series b/soc/arm/nordic_nrf/nrf51/Kconfig.series index a09a8210fe134..800abbce3b370 100644 --- a/soc/arm/nordic_nrf/nrf51/Kconfig.series +++ b/soc/arm/nordic_nrf/nrf51/Kconfig.series @@ -5,7 +5,7 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF51X - bool "Nordic Semiconductor nRF51 series MCU" + bool "Nordic Semiconductor nRF51 series MCU" if "$(SOC_SCHEME)" = "v1" select ARM select CPU_CORTEX_M0 select SOC_FAMILY_NRF diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52810_QFAA b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52810_QFAA index 1b5a7b5c31407..7f87637b92f92 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52810_QFAA +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52810_QFAA @@ -5,9 +5,6 @@ if SOC_NRF52810_QFAA -config SOC - default "nRF52810_QFAA" - config NUM_IRQS default 30 diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52811_QFAA b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52811_QFAA index 7b291305208db..bc4c757e6f859 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52811_QFAA +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52811_QFAA @@ -5,9 +5,6 @@ if SOC_NRF52811_QFAA -config SOC - default "nRF52811_QFAA" - config NUM_IRQS default 30 diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52820_QDAA b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52820_QDAA index 4aa761b93be8c..2db0291afad8d 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52820_QDAA +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52820_QDAA @@ -5,10 +5,6 @@ if SOC_NRF52820_QDAA -config SOC - string - default "nRF52820_QDAA" - config NUM_IRQS int default 40 diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_CIAA b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_CIAA index 4060453badcf4..4f9101f4c6143 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_CIAA +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_CIAA @@ -5,9 +5,6 @@ if SOC_NRF52832_CIAA -config SOC - default "nRF52832_CIAA" - config NUM_IRQS default 39 diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_QFAA b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_QFAA index cc48aaeaccbfa..b579b1e3ed080 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_QFAA +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_QFAA @@ -5,9 +5,6 @@ if SOC_NRF52832_QFAA -config SOC - default "nRF52832_QFAA" - config NUM_IRQS default 39 diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_QFAB b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_QFAB index 2b9491cae3bab..1c494d222c96c 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_QFAB +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52832_QFAB @@ -5,9 +5,6 @@ if SOC_NRF52832_QFAB -config SOC - default "nRF52832_QFAB" - config NUM_IRQS default 39 diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52833_QIAA b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52833_QIAA index 6256b30e741de..add0c89503b4f 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52833_QIAA +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52833_QIAA @@ -5,10 +5,6 @@ if SOC_NRF52833_QIAA -config SOC - string - default "nRF52833_QIAA" - config NUM_IRQS int default 48 diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52840_QIAA b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52840_QIAA index 62ca5e76cbd66..a2ac50ca5dd6e 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52840_QIAA +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52840_QIAA @@ -5,9 +5,6 @@ if SOC_NRF52840_QIAA -config SOC - default "nRF52840_QIAA" - config NUM_IRQS default 48 diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.series b/soc/arm/nordic_nrf/nrf52/Kconfig.series deleted file mode 100644 index f4d3a6f407a86..0000000000000 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.series +++ /dev/null @@ -1,19 +0,0 @@ -# Nordic Semiconductor nRF52 MCU line - -# Copyright (c) 2016-2018 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -config SOC_SERIES_NRF52X - bool "Nordic Semiconductor nRF52 series MCU" - select ARM - select SOC_COMPATIBLE_NRF52X - select CPU_CORTEX_M4 - select CPU_HAS_ARM_MPU - select SOC_FAMILY_NRF - select XIP - select HAS_NRFX - select HAS_NORDIC_DRIVERS - select HAS_SEGGER_RTT - select HAS_SWO - help - Enable support for NRF52 MCU series diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.soc b/soc/arm/nordic_nrf/nrf52/Kconfig.soc index cc0d2d8119708..2f9bf10c6a491 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.soc @@ -3,83 +3,22 @@ # Copyright (c) 2016-2019 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config SOC_NRF52805 - depends on SOC_SERIES_NRF52X - bool - -config SOC_NRF52810 - depends on SOC_SERIES_NRF52X - bool - -config SOC_NRF52811 - depends on SOC_SERIES_NRF52X - bool - -config SOC_NRF52820 - depends on SOC_SERIES_NRF52X - bool - config SOC_NRF52832 depends on SOC_SERIES_NRF52X - bool select SOC_COMPATIBLE_NRF52832 select CPU_CORTEX_M_HAS_DWT select CPU_HAS_FPU config SOC_NRF52833 depends on SOC_SERIES_NRF52X - bool select CPU_CORTEX_M_HAS_DWT select CPU_HAS_FPU config SOC_NRF52840 depends on SOC_SERIES_NRF52X - bool select CPU_CORTEX_M_HAS_DWT select CPU_HAS_FPU -choice - prompt "nRF52x MCU Selection" - depends on SOC_SERIES_NRF52X - -config SOC_NRF52805_CAAA - bool "NRF52805_CAAA" - select SOC_NRF52805 - -config SOC_NRF52810_QFAA - bool "NRF52810_QFAA" - select SOC_NRF52810 - -config SOC_NRF52811_QFAA - bool "NRF52811_QFAA" - select SOC_NRF52811 - -config SOC_NRF52820_QDAA - bool "NRF52820_QDAA" - select SOC_NRF52820 - -config SOC_NRF52832_CIAA - bool "NRF52832_CIAA" - select SOC_NRF52832 - -config SOC_NRF52832_QFAA - bool "NRF52832_QFAA" - select SOC_NRF52832 - -config SOC_NRF52832_QFAB - bool "NRF52832_QFAB" - select SOC_NRF52832 - -config SOC_NRF52833_QIAA - bool "NRF52833_QIAA" - select SOC_NRF52833 - -config SOC_NRF52840_QIAA - bool "NRF52840_QIAA" - select SOC_NRF52840 - -endchoice - config SOC_DCDC_NRF52X bool help diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.soc.names b/soc/arm/nordic_nrf/nrf52/Kconfig.soc.names new file mode 100644 index 0000000000000..f67c491447042 --- /dev/null +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.soc.names @@ -0,0 +1,43 @@ +# Nordic Semiconductor nRF52 MCU line SoC names. + +# Copyright (c) 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# This file contains SoC names and is shared between SoC scheme v1 and v2. + +config SOC + default "nRF52805_CAAA" + depends on SOC_NRF52805_CAAA + +config SOC + default "nRF52840_QIAA" + depends on SOC_NRF52840_QIAA + +config SOC + default "nRF52810_QFAA" + depends on SOC_NRF52810_QFAA + +config SOC + default "nRF52811_QFAA" + depends on SOC_NRF52811_QFAA + +config SOC + string + default "nRF52820_QDAA" + depends on SOC_NRF52820_QDAA + +config SOC + default "nRF52832_CIAA" + depends on SOC_NRF52832_CIAA + +config SOC + default "nRF52832_QFAA" + depends on SOC_NRF52832_QFAA + +config SOC + default "nRF52832_QFAB" + depends on SOC_NRF52832_QFAB + +config SOC + default "nRF52833_QIAA" + depends on SOC_NRF52833_QIAA diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.soc.v2 b/soc/arm/nordic_nrf/nrf52/Kconfig.soc.v2 new file mode 100644 index 0000000000000..9c4629f98f123 --- /dev/null +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.soc.v2 @@ -0,0 +1,71 @@ +# Nordic Semiconductor nRF52 MCU line + +# Copyright (c) 2022 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + + +config SOC_NRF52805 + depends on SOC_SERIES_NRF52X + bool + +config SOC_NRF52810 + depends on SOC_SERIES_NRF52X + bool + +config SOC_NRF52811 + depends on SOC_SERIES_NRF52X + bool + +config SOC_NRF52820 + depends on SOC_SERIES_NRF52X + bool + +config SOC_NRF52832 + depends on SOC_SERIES_NRF52X + bool + +config SOC_NRF52833 + depends on SOC_SERIES_NRF52X + bool + +config SOC_NRF52840 + depends on SOC_SERIES_NRF52X + bool + +config SOC_NRF52805_CAAA + bool "NRF52805_CAAA" + select SOC_NRF52805 + +config SOC_NRF52810_QFAA + bool "NRF52810_QFAA" + select SOC_NRF52810 + +config SOC_NRF52811_QFAA + bool "NRF52811_QFAA" + select SOC_NRF52811 + +config SOC_NRF52820_QDAA + bool "NRF52820_QDAA" + select SOC_NRF52820 + +config SOC_NRF52832_CIAA + bool "NRF52832_CIAA" + select SOC_NRF52832 + +config SOC_NRF52832_QFAA + bool "NRF52832_QFAA" + select SOC_NRF52832 + +config SOC_NRF52832_QFAB + bool "NRF52832_QFAB" + select SOC_NRF52832 + +config SOC_NRF52833_QIAA + bool "NRF52833_QIAA" + select SOC_NRF52833 + +config SOC_NRF52840_QIAA + bool "NRF52840_QIAA" + select SOC_NRF52840 + +rsource "Kconfig.soc.names" diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.series b/soc/arm/nordic_nrf/nrf53/Kconfig.series index da82e8d68aaa3..b827ffd925286 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.series +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.series @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF53X - bool "Nordic Semiconductor nRF53 series MCU" + bool "Nordic Semiconductor nRF53 series MCU" if "$(SOC_SCHEME)" = "v1" select ARM select CPU_CORTEX_M33 select CPU_CORTEX_M_HAS_DWT diff --git a/soc/arm/nordic_nrf/nrf91/Kconfig.series b/soc/arm/nordic_nrf/nrf91/Kconfig.series index c68c080a16379..dd3275372ed4a 100644 --- a/soc/arm/nordic_nrf/nrf91/Kconfig.series +++ b/soc/arm/nordic_nrf/nrf91/Kconfig.series @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 config SOC_SERIES_NRF91X - bool "Nordic Semiconductor nRF91 series MCU" + bool "Nordic Semiconductor nRF91 series MCU" if "$(SOC_SCHEME)" = "v1" select ARM select CPU_CORTEX_M33 select CPU_CORTEX_M_HAS_DWT