Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/trusted-firmware-m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ set_property(TARGET zephyr_property_target
$<$<BOOL:${CONFIG_NRF_SECURE_APPROTECT_USER_HANDLING}>:-DCONFIG_NRF_SECURE_APPROTECT_USER_HANDLING=ON>
$<$<BOOL:${CONFIG_IDENTITY_KEY_TFM}>:-DCONFIG_IDENTITY_KEY_TFM=ON>
$<$<BOOL:${CONFIG_TFM_PS_SUPPORT_FORMAT_TRANSITION}>:-DPS_SUPPORT_FORMAT_TRANSITION=ON>
$<$<BOOL:${CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE}>:-DTFM_NRF_SYSTEM_OFF_SERVICE=ON>
)

if(CONFIG_TFM_PROFILE_TYPE_MINIMAL)
Expand Down
14 changes: 14 additions & 0 deletions modules/trusted-firmware-m/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -538,4 +538,18 @@ config TFM_PSA_FRAMEWORK_HAS_MM_IOVEC
Memory-mapped iovecs provide direct mapping of client input and output vectors into
the Secure Partition.

config TFM_NRF_SYSTEM_OFF_SERVICE
bool "TF-M NRF System Off Service [EXPERIMENTAL]"
depends on TFM_ISOLATION_LEVEL = 1
depends on TFM_SFN
depends on SOC_SERIES_NRF54LX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about nRF71?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not urgent. Post NCS 3.2, unless adding this doesn't delay the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot test it so I will not add it myself now. It can be added later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depends on !RETAINED_MEM_NRF_RAM_CTRL
select EXPERIMENTAL
help
Provide a system off service for the nRF54L series SoCs.
This service allows the non-secure application to request
the system to enter system off mode via a secure service call.
This service will disable RAM retention for all RAM blocks
before entering system off mode.

endif # BUILD_WITH_TFM
17 changes: 17 additions & 0 deletions modules/trusted-firmware-m/tfm_boards/src/tfm_platform_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#include <tfm_hal_isolation.h>

#include <hal/nrf_gpio.h>
#include <hal/nrf_regulators.h>
#include <helpers/nrfx_ram_ctrl.h>

#include "handle_attr.h"

#if NRF_ALLOW_NON_SECURE_FAULT_HANDLING
Expand All @@ -28,6 +31,20 @@ void tfm_platform_hal_system_reset(void)
NVIC_SystemReset();
}

#if TFM_NRF_SYSTEM_OFF_SERVICE
enum tfm_platform_err_t tfm_platform_hal_system_off(void)
{
__disable_irq();

nrfx_ram_ctrl_retention_enable_all_set(false);

nrf_regulators_system_off(NRF_REGULATORS);

/* This should be unreachable */
return TFM_PLATFORM_ERR_SYSTEM_ERROR;
}
#endif /* TFM_NRF_SYSTEM_OFF_SERVICE */

#if CONFIG_FW_INFO
static enum tfm_platform_err_t tfm_platform_hal_fw_info_service(psa_invec *in_vec,
psa_outvec *out_vec)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_TFM_SFN=y
CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_TFM_SFN=y
CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_TFM_SFN=y
CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_TFM_SFN=y
CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE=y
4 changes: 2 additions & 2 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: dc05376c170fc2739a4881629caf49c40d485a9e
revision: pull/3330/head
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down Expand Up @@ -147,7 +147,7 @@ manifest:
- name: trusted-firmware-m
repo-path: sdk-trusted-firmware-m
path: modules/tee/tf-m/trusted-firmware-m
revision: 565a30c7f4426cdf644bff03766a292dd509ee9c
revision: pull/212/head
- name: psa-arch-tests
repo-path: sdk-psa-arch-tests
path: modules/tee/tf-m/psa-arch-tests
Expand Down
Loading