Skip to content

Commit 6b48f84

Browse files
tomi-fontnordicjm
authored andcommitted
[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]> (cherry picked from commit 6b4c840)
1 parent 270c1e9 commit 6b48f84

File tree

8 files changed

+181
-1
lines changed

8 files changed

+181
-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
@@ -13,3 +13,21 @@ config ROM_START_OFFSET
1313

1414
endif # BOARD_NRF54L15DK_NRF54L05_CPUAPP || BOARD_NRF54L15DK_NRF54L10_CPUAPP || \
1515
# BOARD_NRF54L15DK_NRF54L15_CPUAPP
16+
17+
if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
18+
19+
config BT_CTLR
20+
default BT
21+
22+
# By default, if we build for a Non-Secure version of the board,
23+
# enable building with TF-M as the Secure Execution Environment.
24+
config BUILD_WITH_TFM
25+
default y if BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
26+
27+
# By default, if we build with TF-M, instruct build system to
28+
# flash the combined TF-M (Secure) & Zephyr (Non Secure) image
29+
config TFM_FLASH_MERGED_BINARY
30+
default y
31+
depends on BUILD_WITH_TFM
32+
33+
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
@@ -4,6 +4,6 @@
44
config BOARD_NRF54L15DK
55
select SOC_NRF54L05_CPUAPP if BOARD_NRF54L15DK_NRF54L05_CPUAPP
66
select SOC_NRF54L10_CPUAPP if BOARD_NRF54L15DK_NRF54L10_CPUAPP
7-
select SOC_NRF54L15_CPUAPP if BOARD_NRF54L15DK_NRF54L15_CPUAPP
7+
select SOC_NRF54L15_CPUAPP if BOARD_NRF54L15DK_NRF54L15_CPUAPP || BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS
88
select SOC_NRF54L15_CPUFLPR if BOARD_NRF54L15DK_NRF54L15_CPUFLPR || \
99
BOARD_NRF54L15DK_NRF54L15_CPUFLPR_XIP

boards/nordic/nrf54l15dk/board.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@ elseif(CONFIG_SOC_NRF54L05_CPUFLPR OR CONFIG_SOC_NRF54L10_CPUFLPR OR
99
board_runner_args(jlink "--speed=4000")
1010
endif()
1111

12+
if(BOARD_NRF54L15DK_NRF54L15_CPUAPP_NS)
13+
set(TFM_PUBLIC_KEY_FORMAT "full")
14+
endif()
15+
16+
if(CONFIG_TFM_FLASH_MERGED_BINARY)
17+
set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex)
18+
endif()
19+
1220
include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake)
1321
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
@@ -9,3 +9,5 @@ board:
99
variants:
1010
- name: xip
1111
cpucluster: cpuflpr
12+
- name: ns
13+
cpucluster: cpuapp
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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 <nordic/nrf54l15_cpuapp.dtsi>
12+
#include "nrf54l_05_10_15_cpuapp_common.dtsi"
13+
14+
/ {
15+
compatible = "nordic,nrf54l15dk_nrf54l15-cpuapp";
16+
model = "Nordic nRF54L15 DK nRF54L15 Application MCU";
17+
18+
chosen {
19+
zephyr,code-partition = &slot0_partition;
20+
zephyr,sram = &cpuapp_sram;
21+
};
22+
};
23+
24+
&cpuapp_rram {
25+
partitions {
26+
compatible = "fixed-partitions";
27+
#address-cells = <1>;
28+
#size-cells = <1>;
29+
boot_partition: partition@0 {
30+
label = "mcuboot";
31+
reg = <0x0 DT_SIZE_K(64)>;
32+
};
33+
slot0_partition: partition@10000 {
34+
label = "image-0";
35+
reg = <0x10000 DT_SIZE_K(324)>;
36+
};
37+
slot0_ns_partition: partition@61000 {
38+
label = "image-0-nonsecure";
39+
reg = <0x61000 DT_SIZE_K(324)>;
40+
};
41+
slot1_partition: partition@b2000 {
42+
label = "image-1";
43+
reg = <0xb2000 DT_SIZE_K(324)>;
44+
};
45+
slot1_ns_partition: partition@103000 {
46+
label = "image-1-nonsecure";
47+
reg = <0x103000 DT_SIZE_K(324)>;
48+
};
49+
/* 32k from 0x154000 to 0x15bfff reserved for TF-M partitions */
50+
storage_partition: partition@15c000 {
51+
label = "storage";
52+
reg = <0x15c000 DT_SIZE_K(36)>;
53+
};
54+
};
55+
};
56+
57+
&uart30 {
58+
/* Disable so that TF-M can use this UART */
59+
status = "disabled";
60+
61+
current-speed = <115200>;
62+
pinctrl-0 = <&uart30_default>;
63+
pinctrl-1 = <&uart30_sleep>;
64+
pinctrl-names = "default", "sleep";
65+
};
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)