From 2dae1823abbc8b4e22db14908b602767e35f1a84 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Thu, 7 Apr 2022 10:48:25 +0200 Subject: [PATCH] hwinfo: Add dependency handling for HWINFO_NRF in nonsecure The limitation on HWINFO_NRF depending on not nonsecure was removed in 52be3030aac9ad6523baeb3d83a473ffe05d62a1. This caused problems when TF-M was not enabled. This happens on the thingy53_nrf5340_cpuapp_ns board since this board is not supported by TF-M. Introduce proper dependency handling for the soc secure functions to make HWINFO_NRF unavailable when no secure services exist in nonsecure. Signed-off-by: Joakim Andersson --- drivers/hwinfo/Kconfig | 1 + soc/arm/nordic_nrf/Kconfig | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/hwinfo/Kconfig b/drivers/hwinfo/Kconfig index 597636f0b8d..bc1d9f40d0f 100644 --- a/drivers/hwinfo/Kconfig +++ b/drivers/hwinfo/Kconfig @@ -32,6 +32,7 @@ config HWINFO_NRF bool "NRF device ID" default y depends on SOC_FAMILY_NRF + depends on NRF_SOC_SECURE_SUPPORTED help Enable Nordic NRF hwinfo driver. diff --git a/soc/arm/nordic_nrf/Kconfig b/soc/arm/nordic_nrf/Kconfig index 2030c98f12f..aefe8ea0061 100644 --- a/soc/arm/nordic_nrf/Kconfig +++ b/soc/arm/nordic_nrf/Kconfig @@ -16,6 +16,14 @@ config SOC_FAMILY source "soc/arm/nordic_nrf/Kconfig.peripherals" source "soc/arm/nordic_nrf/*/Kconfig.soc" +config NRF_SOC_SECURE_SUPPORTED + def_bool !TRUSTED_EXECUTION_NONSECURE || BUILD_WITH_TFM + help + Hidden function to indicate that that the soc_secure functions are + available. + The functions are always available when not in non-secure. + For non-secure the functions must redirect to secure services exposed + by the secure firmware. config NRF_MPU_FLASH_REGION_SIZE hex