Skip to content

Commit 2c9f9c6

Browse files
committed
[nrf fromtree] platform: nordic_nrf: Check if rpmsg_nrf53 is in non secure ram
Check if the rpmsg_nrf53 region is placed inside the NS_DATA region already. Partition places it there by default. If it is there already it is already configured as secure and thus we shouldn't (and can't) configure it again. Signed-off-by: Georgios Vasilakis <[email protected]> Change-Id: I5a139641abb511cf6659b78fca41815115646bbb (cherry picked from commit c4317f2679f5d2ba016629285464aa363eee9133)
1 parent c158179 commit 2c9f9c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

platform/ext/target/nordic_nrf/common/core/target_cfg_53_91.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ enum tfm_plat_err_t spu_init_cfg(void)
229229
#endif /* REGION_PCD_SRAM_ADDRESS */
230230

231231
#ifdef REGION_RPMSG_NRF53_SRAM_ADDRESS
232+
/* Partition manager by default places the rpmsg nrf53 partition in the non-secure region
233+
* so skip the configuration in this case.
234+
*/
235+
#if REGION_RPMSG_NRF53_SRAM_ADDRESS > NS_DATA_LIMIT || REGION_RPMSG_NRF53_SRAM_LIMIT < NS_DATA_START
232236
/* Configures rpmsg nrf53 partition to be non-secure */
233237
perm = 0;
234238
perm |= NRF_SPU_MEM_PERM_READ;
@@ -237,6 +241,7 @@ enum tfm_plat_err_t spu_init_cfg(void)
237241
spu_regions_sram_config(REGION_RPMSG_NRF53_SRAM_ADDRESS,
238242
REGION_RPMSG_NRF53_SRAM_LIMIT,
239243
SPU_SECURE_ATTR_NONSECURE, perm, SPU_LOCK_CONF_LOCKED);
244+
#endif /* REGION_RPMSG_NRF53_SRAM_ADDRESS > NS_DATA_START || REGION_RPMSG_NRF53_SRAM_LIMIT < NS_DATA_LIMIT */
240245
#endif /* REGION_RPMSG_NRF53_SRAM_ADDRESS */
241246

242247
return TFM_PLAT_ERR_SUCCESS;

0 commit comments

Comments
 (0)