Skip to content

Commit fd5200f

Browse files
committed
[nrf noup] boards: Add non-secure target for nrf54L15dk
This adds the nrf54l15dk/nrf54l15/cpuapp/ns board variant to sdk-zephyr. It allows to build nRF54l15dk with TF-M in nRF Connect SDK. This is done as a noup as the out-of-tree board extension feature is not available. When zephyrproject-rtos/zephyr#69548 is completed this commit can be reverted and the variant be placed in sdk-nrf. Signed-off-by: Tomi Fontanilles <[email protected]>
1 parent 6f6b0e4 commit fd5200f

File tree

8 files changed

+147
-1
lines changed

8 files changed

+147
-1
lines changed

boards/nordic/nrf54l15dk/Kconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# nRF54L15 DK board configuration
2+
3+
# Copyright (c) 2024 Nordic Semiconductor ASA
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
7+
8+
config NRF_MPC_REGION_SIZE
9+
hex
10+
default 0x1000
11+
help
12+
Region size for the Memory Protection Controller (MPC) in bytes.
13+
14+
config NRF_TRUSTZONE_FLASH_REGION_SIZE
15+
hex
16+
default NRF_MPC_REGION_SIZE
17+
help
18+
This defines the flash region size from the TRUSTZONE perspective.
19+
It is used when configuring the TRUSTZONE and when setting alignments
20+
requirements for the partitions.
21+
This abstraction allows us to configure TRUSTZONE without depending
22+
on peripheral specific symbols.
23+
24+
config NRF_TRUSTZONE_RAM_REGION_SIZE
25+
hex
26+
default NRF_MPC_REGION_SIZE
27+
help
28+
This defines the RAM region size from the TRUSTZONE perspective.
29+
It is used when configuring the TRUSTZONE and when setting alignments
30+
requirements for the partitions.
31+
This abstraction allows us to configure TRUSTZONE without depending
32+
on peripheral specific symbols.
33+
34+
endif #BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS

boards/nordic/nrf54l15dk/Kconfig.defconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,21 @@ config ROM_START_OFFSET
1111
default 0x800 if BOOTLOADER_MCUBOOT
1212

1313
endif # BOARD_NRF54L15DK_NRF54L15_CPUAPP
14+
15+
if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
16+
17+
config BT_CTLR
18+
default BT
19+
20+
# By default, if we build for a Non-Secure version of the board,
21+
# enable building with TF-M as the Secure Execution Environment.
22+
config BUILD_WITH_TFM
23+
default y if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
24+
25+
# By default, if we build with TF-M, instruct build system to
26+
# flash the combined TF-M (Secure) & Zephyr (Non Secure) image
27+
config TFM_FLASH_MERGED_BINARY
28+
default y
29+
depends on BUILD_WITH_TFM
30+
31+
endif #BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS

boards/nordic/nrf54l15dk/Kconfig.nrf54l15dk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
config BOARD_NRF54L15DK
5-
select SOC_NRF54L15_CPUAPP if BOARD_NRF54L15DK_NRF54L15_CPUAPP
5+
select SOC_NRF54L15_CPUAPP if BOARD_NRF54L15DK_NRF54L15_CPUAPP || BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
66
select SOC_NRF54L15_CPUFLPR if BOARD_NRF54L15DK_NRF54L15_CPUFLPR || \
77
BOARD_NRF54L15DK_NRF54L15_CPUFLPR_XIP

boards/nordic/nrf54l15dk/board.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,13 @@ elseif(CONFIG_SOC_NRF54L15_CPUFLPR)
77
board_runner_args(jlink "--speed=4000")
88
endif()
99

10+
if(BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS)
11+
set(TFM_PUBLIC_KEY_FORMAT "full")
12+
endif()
13+
14+
if(CONFIG_TFM_FLASH_MERGED_BINARY)
15+
set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex)
16+
endif()
17+
1018
include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake)
1119
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/nordic/nrf54l15dk/board.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ board:
66
variants:
77
- name: xip
88
cpucluster: cpuflpr
9+
- name: ns
10+
cpucluster: cpuapp
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#define USE_NON_SECURE_ADDRESS_MAP 1
10+
11+
#include "nrf54l15_cpuapp_common.dtsi"
12+
13+
/ {
14+
compatible = "nordic,nrf54l15dk_nrf54l15-cpuapp";
15+
model = "Nordic nRF54L15 DK nRF54L15 Application MCU";
16+
17+
chosen {
18+
zephyr,code-partition = &slot0_partition;
19+
zephyr,sram = &cpuapp_sram;
20+
};
21+
};
22+
23+
&uart30 {
24+
/* Disable so that TF-M can use this UART */
25+
status = "disabled";
26+
27+
current-speed = <115200>;
28+
pinctrl-0 = <&uart30_default>;
29+
pinctrl-1 = <&uart30_sleep>;
30+
pinctrl-names = "default", "sleep";
31+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
3+
4+
identifier: nrf54l15dk/nrf54l15/cpuapp/ns
5+
name: nRF54l15-DK-nRF54l15-Application-Non-Secure
6+
type: mcu
7+
arch: arm
8+
toolchain:
9+
- gnuarmemb
10+
- xtools
11+
- zephyr
12+
ram: 256
13+
flash: 1524
14+
supported:
15+
- adc
16+
- gpio
17+
- i2c
18+
- spi
19+
- counter
20+
- watchdog
21+
- adc
22+
- i2s
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
3+
4+
# Enable MPU
5+
CONFIG_ARM_MPU=y
6+
7+
# Enable hardware stack protection
8+
CONFIG_HW_STACK_PROTECTION=y
9+
10+
CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y
11+
12+
# Enable TrustZone-M
13+
CONFIG_ARM_TRUSTZONE_M=y
14+
15+
# This Board implies building Non-Secure firmware
16+
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
17+
18+
# Don't enable the cache in the non-secure image as it is a
19+
# secure-only peripheral on 54l
20+
CONFIG_CACHE_MANAGEMENT=n
21+
CONFIG_EXTERNAL_CACHE=n
22+
23+
CONFIG_UART_CONSOLE=y
24+
CONFIG_CONSOLE=y
25+
CONFIG_SERIAL=y
26+
27+
# Enable GPIO
28+
CONFIG_GPIO=y
29+
30+
# Start SYSCOUNTER on driver init
31+
CONFIG_NRF_GRTC_START_SYSCOUNTER=y

0 commit comments

Comments
 (0)