From eea73e13bd7733df83c199125d3f718a4ed26106 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Wed, 3 Oct 2018 15:51:11 +0200 Subject: [PATCH] soc: Kconfig: Add options for compatible NRF SOCs Simulated NRF boards based on the POSIX ARCH cannot directly use the current SOC_*NRF options as these pull options from the ARM CPU and other peripherals. This commit adds a new set of hidden SOC_COMPATIBLE_* options to be selected both by the real SOCs and the simulated ones. In this manner we can have the common code depend on the SOC_COMPATIBLE* options instead of the current ones where neccessary. Signed-off-by: Alberto Escolar Piedras (f) arm kconfig --- soc/Kconfig | 13 +++++++++++++ soc/arm/nordic_nrf/Kconfig | 1 + soc/arm/nordic_nrf/nrf52/Kconfig.series | 1 + soc/arm/nordic_nrf/nrf52/Kconfig.soc | 1 + 4 files changed, 16 insertions(+) diff --git a/soc/Kconfig b/soc/Kconfig index ab0c3810f74..69fc7cb3ff8 100644 --- a/soc/Kconfig +++ b/soc/Kconfig @@ -16,3 +16,16 @@ module-str = SOC source "subsys/logging/Kconfig.template.log_config" endmenu + +# The helper symbols below are put here due to an unusual setup: The simulated +# nrf52_bsim board uses the POSIX arch, but is compatible with Nordic ARM +# boards + +config SOC_COMPATIBLE_NRF + bool + +config SOC_COMPATIBLE_NRF52X + bool + +config SOC_COMPATIBLE_NRF52832 + bool diff --git a/soc/arm/nordic_nrf/Kconfig b/soc/arm/nordic_nrf/Kconfig index 34c535eafbe..eff6bc8ab1c 100644 --- a/soc/arm/nordic_nrf/Kconfig +++ b/soc/arm/nordic_nrf/Kconfig @@ -6,6 +6,7 @@ # config SOC_FAMILY_NRF + select SOC_COMPATIBLE_NRF bool # omit prompt to signify a "hidden" option diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.series b/soc/arm/nordic_nrf/nrf52/Kconfig.series index 5c8ad8415d9..ad95fc72bba 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.series +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.series @@ -7,6 +7,7 @@ config SOC_SERIES_NRF52X bool "Nordic Semiconductor nRF52 series MCU" + select SOC_COMPATIBLE_NRF52X select CPU_CORTEX_M4 select CPU_HAS_ARM_MPU select SOC_FAMILY_NRF diff --git a/soc/arm/nordic_nrf/nrf52/Kconfig.soc b/soc/arm/nordic_nrf/nrf52/Kconfig.soc index 2723fc0333b..b8aabd705eb 100644 --- a/soc/arm/nordic_nrf/nrf52/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf52/Kconfig.soc @@ -45,6 +45,7 @@ config SOC_NRF52810 config SOC_NRF52832 depends on SOC_SERIES_NRF52X bool + select SOC_COMPATIBLE_NRF52832 select CPU_HAS_FPU select HAS_HW_NRF_CCM select HAS_HW_NRF_CLOCK