Skip to content

Commit 2ed1f3f

Browse files
SebastianBoeAnton-TF
authored andcommitted
platform: nordic_nrf: add support for more UARTs
Add support for more UARTs. Signed-off-by: Sebastian Bøe <[email protected]> Change-Id: Iffdce1df87fd603cf76f435028896c12f1d2c276
1 parent 01b48f2 commit 2ed1f3f

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#define ARM_USART_DRV_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2, 2)
3636

37-
#if RTE_USART0 || RTE_USART1 || RTE_USART2 || RTE_USART3
37+
#if RTE_USART0 || RTE_USART1 || RTE_USART2 || RTE_USART3 || RTE_USART20 || RTE_USART22
3838

3939
#define PSEL_DISCONNECTED 0xFFFFFFFFUL
4040

@@ -422,4 +422,13 @@ DRIVER_USART(2);
422422
DRIVER_USART(3);
423423
#endif
424424

425-
#endif /* RTE_USART0 || RTE_USART1 || RTE_USART2 || RTE_USART3 */
425+
// TODO: NCSDK-25009: Support choosing an instance for TF-M
426+
#if RTE_USART20
427+
DRIVER_USART(20);
428+
#endif
429+
430+
#if RTE_USART22
431+
DRIVER_USART(22);
432+
#endif
433+
434+
#endif /* RTE_USART0 || RTE_USART1 || etc. */

platform/ext/target/nordic_nrf/common/core/nrfx_config.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,20 @@
3535
#include <RTE_Device.h>
3636

3737
#if RTE_FLASH0
38+
39+
#include <nrf.h>
40+
41+
#if defined(NRF_NVMC_S)
3842
#define NRFX_NVMC_ENABLED 1
43+
#elif defined(NRF_RRAMC_S)
44+
#define NRFX_RRAMC_ENABLED 1
45+
#else
46+
#error "Unrecognized platform"
3947
#endif
4048

41-
#if RTE_USART0 || RTE_USART1 || RTE_USART2 || RTE_USART3
49+
#endif /* RTE_FLASH0 */
50+
51+
#if RTE_USART0 || RTE_USART1 || RTE_USART2 || RTE_USART3 || RTE_USART20 || RTE_USART22
4252
#define NRFX_UARTE_ENABLED 1
4353
#endif
4454
#if RTE_USART0
@@ -54,6 +64,14 @@
5464
#define NRFX_UARTE3_ENABLED 1
5565
#endif
5666

67+
// TODO: NCSDK-25009: Moonlight: Make it possible to use different UARTS with TF-M
68+
#if RTE_USART20
69+
#define NRFX_UARTE20_ENABLED 1
70+
#endif
71+
#if RTE_USART22
72+
#define NRFX_UARTE22_ENABLED 1
73+
#endif
74+
5775
/*
5876
* For chips with TrustZone support, MDK provides CMSIS-Core peripheral
5977
* accessing symbols in two flavors, with secure and non-secure base address
@@ -72,6 +90,8 @@
7290
#include <nrfx_config_nrf5340_application.h>
7391
#elif defined(NRF91_SERIES)
7492
#include <nrfx_config_nrf91.h>
93+
#elif defined(NRF54L15_ENGA_XXAA)
94+
#include <nrfx_config_nrf54l15_application.h>
7595
#else
7696
#error "Unknown device."
7797
#endif

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,21 @@
3535
#include "tfm_plat_defs.h"
3636
#include "region_defs.h"
3737

38+
// TODO: NCSDK-25009: Support configuring which UART is used by TF-M on nrf54L
39+
40+
#if NRF_SECURE_UART_INSTANCE == 0
41+
#define TFM_DRIVER_STDIO Driver_USART0
42+
#elif NRF_SECURE_UART_INSTANCE == 1
3843
#define TFM_DRIVER_STDIO Driver_USART1
44+
#elif NRF_SECURE_UART_INSTANCE == 22
45+
#define TFM_DRIVER_STDIO Driver_USART22
46+
#endif
47+
48+
#ifdef NRF54L15_ENGA_XXAA
49+
#define NS_DRIVER_STDIO Driver_USART20
50+
#else
3951
#define NS_DRIVER_STDIO Driver_USART0
52+
#endif
4053

4154
/**
4255
* \brief Store the addresses of memory regions
@@ -92,6 +105,13 @@ enum tfm_plat_err_t spu_periph_init_cfg(void);
92105
*/
93106
void spu_clear_irq(void);
94107

108+
/**
109+
* \brief Configures memory permissions via the MPC.
110+
*
111+
* \return Returns values as specified by the \ref tfm_plat_err_t
112+
*/
113+
enum tfm_plat_err_t nrf_mpc_init_cfg(void);
114+
95115
/**
96116
* \brief Configures SAU and IDAU.
97117
*/

0 commit comments

Comments
 (0)