Skip to content

Commit f7de485

Browse files
committed
[nrf noup] soc: nordic: Support TF-M for poweroff
Enable going to system off when the TF-M API is available. This calls the relevant TF-M platform API to enter system off mode using TF-M. This is a noup because the TF-M service for system off is currently located in sdk-nrf only. This is meant to be a short lived commit, work is already ongoing to upstream an official TF-M system off solution that can be be added to upstream Zephyr. Signed-off-by: Georgios Vasilakis <[email protected]>
1 parent ca9ae7f commit f7de485

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

soc/nordic/common/poweroff.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#include <zephyr/toolchain.h>
88
#include <zephyr/drivers/retained_mem/nrf_retained_mem.h>
99

10-
#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X)
10+
#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE)
11+
#include "tfm_platform_api.h"
12+
#elif defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X)
1113
#include <hal/nrf_power.h>
1214
#elif defined(CONFIG_SOC_SERIES_NRF54HX)
1315
#include <power.h>
@@ -30,6 +32,10 @@
3032

3133
void z_sys_poweroff(void)
3234
{
35+
#if defined(CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE)
36+
tfm_platform_system_off();
37+
#else
38+
3339
#if defined(CONFIG_HAS_NORDIC_RAM_CTRL)
3440
uint8_t *ram_start;
3541
size_t ram_size;
@@ -78,5 +84,7 @@ void z_sys_poweroff(void)
7884
nrf_regulators_system_off(NRF_REGULATORS);
7985
#endif
8086

87+
#endif /* CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE */
88+
8189
CODE_UNREACHABLE;
8290
}

0 commit comments

Comments
 (0)