From fcaa60a99fa9d5256078ed28557856ec3709cfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Thu, 23 Feb 2023 12:09:09 +0100 Subject: [PATCH] [nrf fromtree] soc: nrf53: Warn if workaround for anomaly 160 cannot be applied MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up to commit fe3b97a87f480eb473cd58cc1990a5845c2ca9c6. Add a cmake warning issued when the workaround for the nRF5340 anomaly 160 cannot be applied because the application is configured with no system clock. Signed-off-by: Andrzej Głąbek (cherry picked from commit 4e197b7c5e6ac5235ca58267ebcd2e18235c949f) --- soc/arm/nordic_nrf/nrf53/CMakeLists.txt | 12 ++++++++++++ soc/arm/nordic_nrf/nrf53/Kconfig.soc | 19 ++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/soc/arm/nordic_nrf/nrf53/CMakeLists.txt b/soc/arm/nordic_nrf/nrf53/CMakeLists.txt index 3276bd427cc..bb398c987a9 100644 --- a/soc/arm/nordic_nrf/nrf53/CMakeLists.txt +++ b/soc/arm/nordic_nrf/nrf53/CMakeLists.txt @@ -11,3 +11,15 @@ zephyr_library_sources_ifdef(CONFIG_PM zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC sync_rtc.c ) + +if (CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED AND + NOT CONFIG_SYS_CLOCK_EXISTS) + message(WARNING " + Your application may be affected by the anomaly 160 that concerns the + nRF5340 SoC. The related workaround cannot be applied, because your + application has the system clock disabled (CONFIG_SYS_CLOCK_EXISTS=n). + Consider enabling the system clock to apply the workaround. + " " + At your own risk, you can suppress this warning by setting + CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED=n.") +endif() diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index 5ad8e3791b9..96737608800 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -13,7 +13,7 @@ config SOC_NRF5340_CPUAPP config SOC_NRF5340_CPUNET bool select HAS_NO_PM - imply SOC_NRF53_ANOMALY_160_WORKAROUND + imply SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED choice prompt "nRF53x MCU Selection" @@ -28,6 +28,19 @@ config SOC_NRF5340_CPUNET_QKAA endchoice +config SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED + bool "Workaround for nRF5340 anomaly 160" + imply SOC_NRF53_ANOMALY_160_WORKAROUND + help + Indicates that the workaround for the anomaly 160 that affects + the nRF5340 SoC should be applied. + This option is enabled by default for the Application MCU when + DC/DC mode is enabled for the VREGMAIN or VREGRADIO regulator + and always for the Network MCU. + If this option is enabled, but the workaround cannot be applied, + because the system clock is disabled, a related cmake warning is + issued. + config SOC_NRF53_ANOMALY_160_WORKAROUND bool depends on SYS_CLOCK_EXISTS @@ -37,13 +50,13 @@ if SOC_NRF5340_CPUAPP config SOC_DCDC_NRF53X_APP bool - imply SOC_NRF53_ANOMALY_160_WORKAROUND + imply SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED help Enable nRF53 series System on Chip Application MCU DC/DC converter. config SOC_DCDC_NRF53X_NET bool - imply SOC_NRF53_ANOMALY_160_WORKAROUND + imply SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED help Enable nRF53 series System on Chip Network MCU DC/DC converter.