File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
modules/trusted-firmware-m Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ set_property(TARGET zephyr_property_target
103103 $<$<BOOL :${CONFIG_NRF_SECURE_APPROTECT_USER_HANDLING} >:-DCONFIG_NRF_SECURE_APPROTECT_USER_HANDLING=ON >
104104 $<$<BOOL :${CONFIG_IDENTITY_KEY_TFM} >:-DCONFIG_IDENTITY_KEY_TFM=ON >
105105 $<$<BOOL :${CONFIG_TFM_PS_SUPPORT_FORMAT_TRANSITION} >:-DPS_SUPPORT_FORMAT_TRANSITION=ON >
106+ $<$<BOOL :${CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE} >:-DTFM_NRF_SYSTEM_OFF_SERVICE=ON >
106107)
107108
108109if (CONFIG_TFM_PROFILE_TYPE_MINIMAL)
Original file line number Diff line number Diff line change @@ -538,4 +538,18 @@ config TFM_PSA_FRAMEWORK_HAS_MM_IOVEC
538538 Memory-mapped iovecs provide direct mapping of client input and output vectors into
539539 the Secure Partition.
540540
541+ config TFM_NRF_SYSTEM_OFF_SERVICE
542+ bool "TF-M NRF System Off Service [EXPERIMENTAL]"
543+ depends on TFM_ISOLATION_LEVEL = 1
544+ depends on TFM_SFN
545+ depends on SOC_SERIES_NRF54LX
546+ depends on !RETAINED_MEM_NRF_RAM_CTRL
547+ select EXPERIMENTAL
548+ help
549+ Provide a system off service for the nRF54L series SoCs.
550+ This service allows the non-secure application to request
551+ the system to enter system off mode via a secure service call.
552+ This service will disable RAM retention for all RAM blocks
553+ before entering system off mode.
554+
541555endif # BUILD_WITH_TFM
Original file line number Diff line number Diff line change 1616#include <tfm_hal_isolation.h>
1717
1818#include <hal/nrf_gpio.h>
19+ #include <hal/nrf_regulators.h>
20+ #include <helpers/nrfx_ram_ctrl.h>
21+
1922#include "handle_attr.h"
2023
2124#if NRF_ALLOW_NON_SECURE_FAULT_HANDLING
@@ -28,6 +31,20 @@ void tfm_platform_hal_system_reset(void)
2831 NVIC_SystemReset ();
2932}
3033
34+ #if TFM_NRF_SYSTEM_OFF_SERVICE
35+ enum tfm_platform_err_t tfm_platform_hal_system_off (void )
36+ {
37+ __disable_irq ();
38+
39+ nrfx_ram_ctrl_retention_enable_all_set (false);
40+
41+ nrf_regulators_system_off (NRF_REGULATORS );
42+
43+ /* This should be unreachable */
44+ return TFM_PLATFORM_ERR_SYSTEM_ERROR ;
45+ }
46+ #endif /* TFM_NRF_SYSTEM_OFF_SERVICE */
47+
3148#if CONFIG_FW_INFO
3249static enum tfm_platform_err_t tfm_platform_hal_fw_info_service (psa_invec * in_vec ,
3350 psa_outvec * out_vec )
You can’t perform that action at this time.
0 commit comments