Skip to content

Commit 471f3b5

Browse files
committed
[nrf noup]platform: nordic_nrf: Add support for TFM_SHARED_INSTANCE
nrf-squash! [nrf noup] secure_fw: Add option to log output on a shared UART instance. UART instances would be locked permanently even when TFM_SHARED_INSTANCE was set. Update to allow shared instance for UART on 54L and 71 series devices. TFM_SHARED_INSTANCE is a NCS config which is why this is a noup. Signed-off-by: Dag Erik Gjørvad <dag.erik.gjorvad@nordicsemi.no>
1 parent 6aafa7b commit 471f3b5

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

platform/ext/target/nordic_nrf/common/core/native_drivers/spu.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ void spu_peripheral_config_secure(const uint32_t periph_base_address, bool perip
351351

352352
nrf_spu_periph_perm_secattr_set(nrf_spu, index, true /* Secure */);
353353
nrf_spu_periph_perm_dmasec_set(nrf_spu, index, true /* Secure */);
354-
nrf_spu_periph_perm_lock_enable(nrf_spu, index);
354+
if (periph_lock) {
355+
nrf_spu_periph_perm_lock_enable(nrf_spu, index);
356+
}
355357
#endif
356358
}
357359

@@ -379,6 +381,8 @@ void spu_peripheral_config_non_secure(const uint32_t periph_base_address, bool p
379381

380382
nrf_spu_periph_perm_secattr_set(nrf_spu, index, false /* Non-Secure */);
381383
nrf_spu_periph_perm_dmasec_set(nrf_spu, index, false /* Non-Secure */);
382-
nrf_spu_periph_perm_lock_enable(nrf_spu, index);
384+
if (periph_lock) {
385+
nrf_spu_periph_perm_lock_enable(nrf_spu, index);
386+
}
383387
#endif
384388
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,12 @@ void peripheral_configuration(void)
302302
#else
303303
#error "Unsupported NRF_SECURE_UART_INSTANCE for nrf54l series. Supported instances: 00, 20, 21, 22, 30"
304304
#endif
305+
306+
#if defined(CONFIG_TFM_LOG_SHARE_UART)
307+
spu_peripheral_config_secure(uart_periph_start, SPU_LOCK_CONF_UNLOCKED);
308+
#else
305309
spu_peripheral_config_secure(uart_periph_start, SPU_LOCK_CONF_LOCKED);
310+
#endif
306311
#endif /* SECURE_UART1 */
307312

308313
/* Configure the CTRL-AP mailbox interface to be secure as it is used by the secure ADAC

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,12 @@ void peripheral_configuration(void)
314314
#else
315315
#error "Unsupported NRF_SECURE_UART_INSTANCE for nrf71 series. Supported instances: 00, 20, 21, 22, 30"
316316
#endif
317+
318+
#if defined(CONFIG_TFM_LOG_SHARE_UART)
319+
spu_peripheral_config_secure(uart_periph_start, SPU_LOCK_CONF_UNLOCKED);
320+
#else
317321
spu_peripheral_config_secure(uart_periph_start, SPU_LOCK_CONF_LOCKED);
322+
#endif
318323
#endif /* SECURE_UART1 */
319324

320325
/* Configure the CTRL-AP mailbox interface to be secure as it is used by the secure ADAC

0 commit comments

Comments
 (0)