Skip to content

Commit 9f68dae

Browse files
Vge0rgerlubos
authored andcommitted
[nrf noup] platform: nordic_nrf: Fix SPU include for 54l
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 <[email protected]>
1 parent 2f02d2e commit 9f68dae

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

platform/ext/target/nordic_nrf/common/core/cmsis_drivers/Driver_USART.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
2929
#endif
3030

31-
#if !(DOMAIN_NS == 1U) && defined(CONFIG_TFM_LOG_SHARE_UART) && defined(NRF_SPU)
31+
#if !(DOMAIN_NS == 1U) && defined(CONFIG_TFM_LOG_SHARE_UART) && (defined(NRF_SPU) || defined(NRF_SPU00))
3232
#define SPU_CONFIGURE_UART
3333
#include <spu.h>
3434
#endif

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

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,9 @@ enum tfm_plat_err_t init_debug(void)
872872
return TFM_PLAT_ERR_SUCCESS;
873873
}
874874

875+
#define NRF_UARTE_INSTANCE(id) NRF_UARTE ## id
876+
#define NRF_UARTE_INSTANCE_GET(id) NRF_UARTE_INSTANCE(id)
877+
875878
/*----------------- NVIC interrupt target state to NS configuration ----------*/
876879
enum tfm_plat_err_t nvic_interrupt_target_state_cfg(void)
877880
{
@@ -893,26 +896,8 @@ enum tfm_plat_err_t nvic_interrupt_target_state_cfg(void)
893896
#endif
894897

895898
#ifdef SECURE_UART1
896-
#if NRF_SECURE_UART_INSTANCE == 0
897-
/* UARTE0 is a secure peripheral, so its IRQ has to target S state */
898-
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE0));
899-
#elif NRF_SECURE_UART_INSTANCE == 1
900-
/* UARTE1 is a secure peripheral, so its IRQ has to target S state */
901-
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE1));
902-
#elif NRF_SECURE_UART_INSTANCE == 30
903-
/* UARTE30 is a secure peripheral, so its IRQ has to target S state */
904-
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE30));
905-
#elif NRF_SECURE_UART_INSTANCE == 00
906-
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE00));
907-
#elif NRF_SECURE_UART_INSTANCE == 20
908-
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE20));
909-
#elif NRF_SECURE_UART_INSTANCE == 21
910-
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE21));
911-
#elif NRF_SECURE_UART_INSTANCE == 22
912-
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE22));
913-
#elif NRF_SECURE_UART_INSTANCE == 30
914-
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE30));
915-
#endif
899+
/* IRQ for the selected secure UART has to target S state */
900+
NVIC_ClearTargetState(NRFX_IRQ_NUMBER_GET(NRF_UARTE_INSTANCE_GET(NRF_SECURE_UART_INSTANCE)));
916901
#endif
917902

918903
return TFM_PLAT_ERR_SUCCESS;

0 commit comments

Comments
 (0)