@@ -283,10 +283,13 @@ uint32_t spu_regions_sram_get_region_size(void) {
283
283
return SRAM_SECURE_ATTRIBUTION_REGION_SIZE ;
284
284
}
285
285
286
+ #endif /* NRF_SPU_HAS_MEMORY */
287
+
286
288
void spu_peripheral_config_secure (const uint32_t periph_base_address , bool periph_lock )
287
289
{
288
290
uint8_t periph_id = NRFX_PERIPHERAL_ID_GET (periph_base_address );
289
291
292
+ #if NRF_SPU_HAS_MEMORY
290
293
/* ASSERT checking that this is not an explicit Non-Secure peripheral */
291
294
NRFX_ASSERT ((NRF_SPU -> PERIPHID [periph_id ].PERM &
292
295
SPU_PERIPHID_PERM_SECUREMAPPING_Msk ) !=
@@ -297,12 +300,26 @@ void spu_peripheral_config_secure(const uint32_t periph_base_address, bool perip
297
300
1 /* Secure */ ,
298
301
1 /* Secure DMA */ ,
299
302
periph_lock );
303
+
304
+ #else
305
+
306
+ NRF_SPU_Type * nrf_spu = spu_instance_from_peripheral_addr (periph_base_address );
307
+
308
+ uint8_t spu_id = NRFX_PERIPHERAL_ID_GET (nrf_spu );
309
+
310
+ uint8_t index = periph_id - spu_id ;
311
+
312
+ nrf_spu_periph_perm_secattr_set (nrf_spu , index , true /* Secure */ );
313
+ nrf_spu_periph_perm_dmasec_set (nrf_spu , index , true /* Secure */ );
314
+ nrf_spu_periph_perm_lock_enable (nrf_spu , index );
315
+ #endif
300
316
}
301
317
302
318
void spu_peripheral_config_non_secure (const uint32_t periph_base_address , bool periph_lock )
303
319
{
304
320
uint8_t periph_id = NRFX_PERIPHERAL_ID_GET (periph_base_address );
305
321
322
+ #if NRF_SPU_HAS_MEMORY
306
323
/* ASSERT checking that this is not an explicit Secure peripheral */
307
324
NRFX_ASSERT ((NRF_SPU -> PERIPHID [periph_id ].PERM &
308
325
SPU_PERIPHID_PERM_SECUREMAPPING_Msk ) !=
@@ -313,4 +330,15 @@ void spu_peripheral_config_non_secure(const uint32_t periph_base_address, bool p
313
330
0 /* Non-Secure */ ,
314
331
0 /* Non-Secure DMA */ ,
315
332
periph_lock );
333
+ #else
334
+ NRF_SPU_Type * nrf_spu = spu_instance_from_peripheral_addr (periph_base_address );
335
+
336
+ uint8_t spu_id = NRFX_PERIPHERAL_ID_GET (nrf_spu );
337
+
338
+ uint8_t index = periph_id - spu_id ;
339
+
340
+ nrf_spu_periph_perm_secattr_set (nrf_spu , index , false /* Non-Secure */ );
341
+ nrf_spu_periph_perm_dmasec_set (nrf_spu , index , false /* Non-Secure */ );
342
+ nrf_spu_periph_perm_lock_enable (nrf_spu , index );
343
+ #endif
316
344
}
0 commit comments