Skip to content

Commit f959557

Browse files
committed
modules: trusted-firmware-m: add MRAMC serivce
MRAM controller is a secure only peripherals, accessing MRAMC will need psa_call into secure environment. Access mramc and initialise mramc functions is added to configure write permission. Signed-off-by: Travis Lam <travis.lam@nordicsemi.no>
1 parent 5a9709c commit f959557

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ set_property(TARGET zephyr_property_target
107107
$<$<BOOL:${CONFIG_IDENTITY_KEY_TFM}>:-DCONFIG_IDENTITY_KEY_TFM=ON>
108108
$<$<BOOL:${CONFIG_TFM_PS_SUPPORT_FORMAT_TRANSITION}>:-DPS_SUPPORT_FORMAT_TRANSITION=ON>
109109
$<$<BOOL:${CONFIG_TFM_NRF_SYSTEM_OFF_SERVICE}>:-DTFM_NRF_SYSTEM_OFF_SERVICE=ON>
110+
$<$<BOOL:${CONFIG_TFM_NRF_MRAMC_SERVICE}>:-DTFM_NRF_MRAMC_SERVICE=ON>
110111
$<$<BOOL:${CONFIG_NRF91_ANOMALY_36_WORKAROUND}>:-DCONFIG_NRF91_ANOMALY_36_WORKAROUND=ON>
111112
-DTFM_MCUBOOT_OFFSET=${CONFIG_TFM_MCUBOOT_HEADER_SIZE}
112113
)

modules/trusted-firmware-m/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,4 +562,13 @@ config TFM_HAS_B0N
562562
bool "Network core bootloader present (informative only, do not change)"
563563
depends on SOC_SERIES_NRF53
564564

565+
config TFM_NRF_MRAMC_SERVICE
566+
bool "TF-M MRAMC service"
567+
default y if SOC_FLASH_NRF_MRAMC && BUILD_WITH_TFM
568+
depends on SOC_NRF7120
569+
help
570+
Provide a MRAMC service for the nRF7120 SoC.
571+
This service allows the non-secure application to request
572+
the system to configure MRAMC using a secure service call.
573+
565574
endif # BUILD_WITH_TFM

modules/trusted-firmware-m/tfm_boards/src/tfm_platform_system.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ enum tfm_platform_err_t tfm_platform_hal_ioctl(tfm_platform_ioctl_req_t request,
151151
case TFM_PLATFORM_IOCTL_GPIO_SERVICE:
152152
return tfm_platform_hal_gpio_service(in_vec, out_vec);
153153
#endif /* defined(GPIO_PIN_CNF_MCUSEL_Msk) */
154+
#if TFM_NRF_MRAMC_SERVICE
155+
case TFM_PLATFORM_IOCTL_MRAMC_INIT_SERVICE:
156+
return tfm_platform_hal_mramc_init_service();
157+
case TFM_PLATFORM_IOCTL_MRAMC_SET_WEN_SERVICE:
158+
return tfm_platform_hal_mramc_set_wen_service(in_vec);
159+
#endif
154160

155161
/* Board specific IOCTL services */
156162
#if CONFIG_FW_INFO

0 commit comments

Comments
 (0)