Skip to content

Commit 7211cba

Browse files
committed
boards: nordic: Add initial support for nRF54LM20A/ns
Add board files for nRF54LM20A/ns. Update existing nRF54LM20A board files to support this. Signed-off-by: Dag Erik Gjørvad <[email protected]>
1 parent 376ca57 commit 7211cba

19 files changed

+371
-38
lines changed

boards/nordic/nrf54lm20dk/Kconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
DT_NRF_MPC := $(dt_nodelabel_path,nrf_mpc)
5+
6+
if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS
7+
8+
config NRF_TRUSTZONE_FLASH_REGION_SIZE
9+
hex
10+
default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity)
11+
help
12+
This defines the flash region size from the TrustZone perspective.
13+
It is used when configuring the TrustZone and when setting alignments
14+
requirements for the partitions.
15+
This abstraction allows us to configure TrustZone without depending
16+
on peripheral-specific symbols.
17+
18+
config NRF_TRUSTZONE_RAM_REGION_SIZE
19+
hex
20+
default $(dt_node_int_prop_hex,$(DT_NRF_MPC),override-granularity)
21+
help
22+
This defines the RAM region size from the TrustZone perspective.
23+
It is used when configuring the TrustZone and when setting alignments
24+
requirements for the partitions.
25+
This abstraction allows us to configure TrustZone without depending
26+
on peripheral specific symbols.
27+
28+
endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
# Copyright (c) 2025 Nordic Semiconductor ASA
22
# SPDX-License-Identifier: Apache-2.0
33

4+
# Workaround for not being able to have commas in macro arguments
5+
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
6+
47
if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP
58

69
config HW_STACK_PROTECTION
710
default ARCH_HAS_STACK_PROTECTION
811

912
endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP
13+
14+
if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS
15+
16+
# By default, if we build for a Non-Secure version of the board,
17+
# enable building with TF-M as the Secure Execution Environment.
18+
config BUILD_WITH_TFM
19+
default y
20+
21+
endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS

boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk

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

44
config BOARD_NRF54LM20DK
5-
select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP
5+
select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS
66
select SOC_NRF54LM20A_ENGA_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR

boards/nordic/nrf54lm20dk/board.cmake

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

10+
if(CONFIG_BOARD_NRF54LM20DK_NRF54LM20A_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/nrf54lm20dk/board.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ board:
55
socs:
66
- name: nrf54lm20a
77
variants:
8+
- name: ns
9+
cpucluster: cpuapp
810
- name: xip
911
cpucluster: cpuflpr
1012
runners:
@@ -17,6 +19,7 @@ runners:
1719
groups:
1820
- boards:
1921
- nrf54lm20dk/nrf54lm20a/cpuapp
22+
- nrf54lm20dk/nrf54lm20a/cpuapp/ns
2023
- nrf54lm20dk/nrf54lm20a/cpuflpr
2124
- nrf54lm20dk/nrf54lm20a/cpuflpr/xip
2225
'--erase':
@@ -28,6 +31,7 @@ runners:
2831
groups:
2932
- boards:
3033
- nrf54lm20dk/nrf54lm20a/cpuapp
34+
- nrf54lm20dk/nrf54lm20a/cpuapp/ns
3135
- nrf54lm20dk/nrf54lm20a/cpuflpr
3236
- nrf54lm20dk/nrf54lm20a/cpuflpr/xip
3337
'--reset':
@@ -39,5 +43,6 @@ runners:
3943
groups:
4044
- boards:
4145
- nrf54lm20dk/nrf54lm20a/cpuapp
46+
- nrf54lm20dk/nrf54lm20a/cpuapp/ns
4247
- nrf54lm20dk/nrf54lm20a/cpuflpr
4348
- nrf54lm20dk/nrf54lm20a/cpuflpr/xip

boards/nordic/nrf54lm20dk/nrf54lm20a_cpuapp_common.dtsi

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -58,43 +58,7 @@
5858
status = "okay";
5959
};
6060

61-
&cpuapp_rram {
62-
partitions {
63-
compatible = "fixed-partitions";
64-
#address-cells = <1>;
65-
#size-cells = <1>;
66-
67-
boot_partition: partition@0 {
68-
label = "mcuboot";
69-
reg = <0x0 DT_SIZE_K(64)>;
70-
};
71-
72-
slot0_partition: partition@10000 {
73-
label = "image-0";
74-
reg = <0x10000 DT_SIZE_K(449)>;
75-
};
76-
77-
slot0_ns_partition: partition@80400 {
78-
label = "image-0-nonsecure";
79-
reg = <0x80400 DT_SIZE_K(449)>;
80-
};
81-
82-
slot1_partition: partition@f0800 {
83-
label = "image-1";
84-
reg = <0xf0800 DT_SIZE_K(449)>;
85-
};
86-
87-
slot1_ns_partition: partition@160c00 {
88-
label = "image-1-nonsecure";
89-
reg = <0x160c00 DT_SIZE_K(449)>;
90-
};
91-
92-
storage_partition: partition@1d1000 {
93-
label = "storage";
94-
reg = <0x1d1000 DT_SIZE_K(36)>;
95-
};
96-
};
97-
};
61+
/* TF-M partitions are defined in the NS board DTS file */
9862

9963
&uart20 {
10064
status = "okay";

boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a_cpuapp.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/dts-v1/;
88

99
#include "nrf54lm20a_cpuapp_common.dtsi"
10+
#include <nordic/nrf54lm20a_partition.dtsi>
1011

1112
/ {
1213
compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuapp";
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright (c) 2025 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 "nrf54lm20a_cpuapp_common.dtsi"
12+
13+
/ {
14+
compatible = "nordic,nrf54lm20dk_nrf54lm20a-cpuapp-ns";
15+
model = "Nordic nRF54LM20 DK nRF54LM20A Application MCU Non-Secure";
16+
17+
chosen {
18+
zephyr,code-partition = &slot0_ns_partition;
19+
zephyr,sram = &sram0_ns;
20+
zephyr,entropy = &psa_rng;
21+
};
22+
23+
/delete-node/ rng;
24+
25+
psa_rng: psa-rng {
26+
status = "okay";
27+
};
28+
};
29+
30+
/ {
31+
/*
32+
* Default SRAM planning when building for nRF54LM20A with ARM TrustZone-M support
33+
* - Lowest 208 kB SRAM allocated to Secure image (sram0_s).
34+
* - Upper 208 kB SRAM allocated to Non-Secure image (sram0_ns).
35+
*
36+
* nRF54LM20A has 512 kB of volatile memory (SRAM), but 96kB is allocated for the FLPR MCU.
37+
* This static layout needs to be the same with the upstream TF-M layout in the
38+
* header flash_layout.h of the relevant platform. Any updates in the layout
39+
* needs to happen both in the flash_layout.h and in this file at the same time.
40+
*/
41+
reserved-memory {
42+
#address-cells = <1>;
43+
#size-cells = <1>;
44+
ranges;
45+
46+
sram0_s: image_s@20000000 {
47+
/* Secure image memory */
48+
reg = <0x20000000 DT_SIZE_K(256)>;
49+
};
50+
51+
sram0_ns: image_ns@20040000 {
52+
/* Non-Secure image memory */
53+
reg = <0x20040000 DT_SIZE_K(256)>;
54+
};
55+
};
56+
};
57+
58+
&bt_hci_sdc {
59+
status = "okay";
60+
};
61+
62+
&bt_hci_controller {
63+
status = "disabled";
64+
};
65+
66+
&uart30 {
67+
/* Disable so that TF-M can use this UART */
68+
status = "disabled";
69+
};
70+
71+
/* Include default memory partition configuration file */
72+
#include <nordic/nrf54lm20a_ns_partition.dtsi>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
identifier: nrf54lm20dk/nrf54lm20a/cpuapp/ns
2+
name: nRF54lm20-DK-nRF54lm20a-Application-Non-Secure
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- gnuarmemb
7+
- zephyr
8+
ram: 208
9+
flash: 1356
10+
supported:
11+
- adc
12+
- counter
13+
- dmic
14+
- gpio
15+
- i2c
16+
- i2s
17+
- pwm
18+
- spi
19+
- usbd
20+
- watchdog
21+
vendor: nordic
22+
sysbuild: true
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Enable MPU
5+
CONFIG_ARM_MPU=y
6+
CONFIG_NULL_POINTER_EXCEPTION_DETECTION_NONE=y
7+
8+
# Enable TrustZone-M
9+
CONFIG_ARM_TRUSTZONE_M=y
10+
11+
# This Board implies building Non-Secure firmware
12+
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
13+
14+
# Enable UART driver
15+
CONFIG_SERIAL=y
16+
17+
# Enable console
18+
CONFIG_CONSOLE=y
19+
CONFIG_UART_CONSOLE=y
20+
21+
# Enable GPIO
22+
CONFIG_GPIO=y
23+
24+
# Don't enable the cache in the non-secure image as it is a
25+
# secure-only peripheral on 54l
26+
CONFIG_CACHE_MANAGEMENT=n
27+
CONFIG_EXTERNAL_CACHE=n
28+
29+
# Start SYSCOUNTER on driver init
30+
CONFIG_NRF_GRTC_START_SYSCOUNTER=y
31+
32+
# Disable TFM BL2 since it is not supported
33+
CONFIG_TFM_BL2=n
34+
# Support for silence logging is not supported at the moment
35+
# Tracked by: NCSDK-31930
36+
CONFIG_TFM_LOG_LEVEL_SILENCE=n
37+
38+
# The oscillators are configured as secure and cannot be configured
39+
# from the non secure application directly. This needs to be set
40+
# otherwise nrfx will try to configure them, resulting in a bus
41+
# fault.
42+
CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG=y

0 commit comments

Comments
 (0)