Skip to content

Commit

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

Include the SPU header for the NRF54L which it does not
have the define NRF_SPU.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
  • Loading branch information
Vge0rge authored and rlubos committed Sep 3, 2024
1 parent 2f02d2e commit 9f68dae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
#endif

#if !(DOMAIN_NS == 1U) && defined(CONFIG_TFM_LOG_SHARE_UART) && defined(NRF_SPU)
#if !(DOMAIN_NS == 1U) && defined(CONFIG_TFM_LOG_SHARE_UART) && (defined(NRF_SPU) || defined(NRF_SPU00))
#define SPU_CONFIGURE_UART
#include <spu.h>
#endif
Expand Down
25 changes: 5 additions & 20 deletions platform/ext/target/nordic_nrf/common/core/target_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,9 @@ enum tfm_plat_err_t init_debug(void)
return TFM_PLAT_ERR_SUCCESS;
}

#define NRF_UARTE_INSTANCE(id) NRF_UARTE ## id
#define NRF_UARTE_INSTANCE_GET(id) NRF_UARTE_INSTANCE(id)

/*----------------- NVIC interrupt target state to NS configuration ----------*/
enum tfm_plat_err_t nvic_interrupt_target_state_cfg(void)
{
Expand All @@ -893,26 +896,8 @@ enum tfm_plat_err_t nvic_interrupt_target_state_cfg(void)
#endif

#ifdef SECURE_UART1
#if NRF_SECURE_UART_INSTANCE == 0
/* UARTE0 is a secure peripheral, so its IRQ has to target S state */
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE0));
#elif NRF_SECURE_UART_INSTANCE == 1
/* UARTE1 is a secure peripheral, so its IRQ has to target S state */
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE1));
#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
/* IRQ for the selected secure UART has to target S state */
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INSTANCE_GET(NRF_SECURE_UART_INSTANCE)));
#endif

return TFM_PLAT_ERR_SUCCESS;
Expand Down

0 comments on commit 9f68dae

Please sign in to comment.