Skip to content

Commit

Permalink
[nrf noup] platform: ext: nordic_nrf: Fix UART configuration for nRF54l
Browse files Browse the repository at this point in the history
fixup! [nrf noup] platform: nordic_nrf: Add support for 54l

1) Don't configure UART when no secure UART is enabled
2) Configure the UART peripheral interrupt based on the
   selected port

Signed-off-by: Georgios Vasilakis <[email protected]>
  • Loading branch information
Vge0rge authored and rlubos committed Sep 3, 2024
1 parent dc309f6 commit 2f02d2e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions platform/ext/target/nordic_nrf/common/core/target_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,16 @@ enum tfm_plat_err_t nvic_interrupt_target_state_cfg(void)
#elif NRF_SECURE_UART_INSTANCE == 30
/* UARTE30 is a secure peripheral, so its IRQ has to target S state */
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE30));
#elif NRF_SECURE_UART_INSTANCE == 00
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE00));
#elif NRF_SECURE_UART_INSTANCE == 20
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE20));
#elif NRF_SECURE_UART_INSTANCE == 21
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE21));
#elif NRF_SECURE_UART_INSTANCE == 22
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE22));
#elif NRF_SECURE_UART_INSTANCE == 30
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE30));
#endif
#endif

Expand Down Expand Up @@ -1260,6 +1270,7 @@ enum tfm_plat_err_t spu_periph_init_cfg(void)
memset(NRF_SPU20, 0, sizeof(NRF_SPU_Type));
memset(NRF_SPU30, 0, sizeof(NRF_SPU_Type));

#if SECURE_UART1
/* Configure TF-M's UART peripheral to be secure */
#if NRF_SECURE_UART_INSTANCE == 00
uint32_t uart_periph_start = tfm_peripheral_uarte00.periph_start;
Expand All @@ -1277,6 +1288,7 @@ enum tfm_plat_err_t spu_periph_init_cfg(void)
uint32_t uart_periph_start = tfm_peripheral_uarte30.periph_start;
#endif
spu_peripheral_config_secure(uart_periph_start, SPU_LOCK_CONF_LOCKED);
#endif

/* Configure the CTRL-AP mailbox interface to be secure as it is used by the secure ADAC service */
spu_peripheral_config_secure(NRF_CTRLAP_S_BASE, SPU_LOCK_CONF_LOCKED);
Expand Down

0 comments on commit 2f02d2e

Please sign in to comment.