Skip to content

Commit e89c955

Browse files
committed
[nrf fromtree] boards: nordic: Add initial support for nRF54LM20A/ns
Add board files for nRF54LM20A/ns. Update existing nRF54LM20A board files to support this. Upstream PR #: 95743 Signed-off-by: Dag Erik Gjørvad <[email protected]>
1 parent bc77dfb commit e89c955

20 files changed

+401
-40
lines changed

boards/nordic/nrf54lm20dk/Kconfig

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

boards/nordic/nrf54lm20dk/Kconfig.defconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
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+
DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition
7+
48
if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP
59

610
config HW_STACK_PROTECTION
@@ -10,3 +14,25 @@ config ROM_START_OFFSET
1014
default 0x800 if BOOTLOADER_MCUBOOT
1115

1216
endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP
17+
18+
if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS
19+
20+
config FLASH_LOAD_OFFSET
21+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
22+
23+
config FLASH_LOAD_SIZE
24+
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
25+
26+
# By default, if we build for a Non-Secure version of the board,
27+
# enable building with TF-M as the Secure Execution Environment.
28+
config BUILD_WITH_TFM
29+
default y
30+
31+
# By default, if we build with TF-M, instruct build system to
32+
# flash the combined TF-M (Secure) & Zephyr (Non Secure) image
33+
config TFM_FLASH_MERGED_BINARY
34+
bool
35+
default y
36+
depends on BUILD_WITH_TFM
37+
38+
endif # BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS

boards/nordic/nrf54lm20dk/Kconfig.nrf54lm20dk

Lines changed: 2 additions & 2 deletions
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
6-
select SOC_NRF54LM20A_ENGA_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR
5+
select SOC_NRF54LM20A_ENGA_CPUAPP if BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP || BOARD_NRF54LM20DK_NRF54LM20A_CPUAPP_NS
6+
select SOC_NRF54LM20A_ENGA_CPUFLPR if BOARD_NRF54LM20DK_NRF54LM20A_CPUFLPR

boards/nordic/nrf54lm20dk/board.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,15 @@ 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+
18+
set(TFM_PLATFORM "nordic_nrf/nrf54lm20a_cpuapp")
19+
1020
include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake)
1121
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
@@ -53,43 +53,7 @@
5353
status = "okay";
5454
};
5555

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

9458
&uart20 {
9559
status = "okay";

boards/nordic/nrf54lm20dk/nrf54lm20dk_nrf54lm20a-common.dtsi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@
8585
sw3 = &button3;
8686
watchdog0 = &wdt31;
8787
};
88+
89+
nrf_mpc: memory@50041000 {
90+
compatible = "nordic,nrf-mpc";
91+
reg = <0x50041000 0x1000>;
92+
#address-cells = <1>;
93+
#size-cells = <1>;
94+
override-num = <5>;
95+
override-granularity = <4096>;
96+
};
8897
};
8998

9099
&uart20 {

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: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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 256 kB SRAM allocated to Secure image (sram0_s).
34+
* - Upper 256 kB SRAM allocated to Non-Secure image (sram0_ns).
35+
*
36+
* nRF54LM20A has 512 kB of volatile memory (SRAM).
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+
/* Get a node label for wi-fi spi to use in shield files */
67+
wifi_spi: &spi22 {};
68+
69+
&uart30 {
70+
/* Disable so that TF-M can use this UART */
71+
status = "disabled";
72+
};
73+
74+
/* Include default memory partition configuration file */
75+
#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: 256
9+
flash: 968
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

0 commit comments

Comments
 (0)