From 01f77cf404b9260731626aff357b5728261cbe6e Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 17 Oct 2025 12:16:00 +0100 Subject: [PATCH 1/4] dts: arm: nordic: Add ranges and address/size cells to SRAM nodes Allows these nodes to be partitioned Signed-off-by: Jamie McCrae --- dts/arm/nordic/nrf51822.dtsi | 2 ++ dts/arm/nordic/nrf51822_qfaa.dtsi | 1 + dts/arm/nordic/nrf51822_qfab.dtsi | 1 + dts/arm/nordic/nrf51822_qfac.dtsi | 1 + dts/arm/nordic/nrf52805.dtsi | 2 ++ dts/arm/nordic/nrf52805_caaa.dtsi | 1 + dts/arm/nordic/nrf52810.dtsi | 2 ++ dts/arm/nordic/nrf52810_qfaa.dtsi | 1 + dts/arm/nordic/nrf52811.dtsi | 2 ++ dts/arm/nordic/nrf52811_qfaa.dtsi | 1 + dts/arm/nordic/nrf52820.dtsi | 2 ++ dts/arm/nordic/nrf52820_qdaa.dtsi | 1 + dts/arm/nordic/nrf52832.dtsi | 2 ++ dts/arm/nordic/nrf52832_ciaa.dtsi | 1 + dts/arm/nordic/nrf52832_qfaa.dtsi | 1 + dts/arm/nordic/nrf52832_qfab.dtsi | 1 + dts/arm/nordic/nrf52833.dtsi | 2 ++ dts/arm/nordic/nrf52833_qdaa.dtsi | 1 + dts/arm/nordic/nrf52833_qiaa.dtsi | 1 + dts/arm/nordic/nrf52840.dtsi | 2 ++ dts/arm/nordic/nrf52840_qfaa.dtsi | 1 + dts/arm/nordic/nrf52840_qiaa.dtsi | 1 + dts/arm/nordic/nrf5340_cpuapp.dtsi | 2 ++ dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi | 1 + dts/arm/nordic/nrf5340_cpuappns.dtsi | 2 ++ dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi | 1 + dts/arm/nordic/nrf5340_cpunet.dtsi | 4 ++++ dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi | 2 ++ dts/arm/nordic/nrf91.dtsi | 2 ++ dts/arm/nordic/nrf9131_laca.dtsi | 1 + dts/arm/nordic/nrf9131ns_laca.dtsi | 1 + dts/arm/nordic/nrf9151_laca.dtsi | 1 + dts/arm/nordic/nrf9151ns_laca.dtsi | 1 + dts/arm/nordic/nrf9160_sica.dtsi | 1 + dts/arm/nordic/nrf9160ns_sica.dtsi | 1 + dts/arm/nordic/nrf9161_laca.dtsi | 1 + dts/arm/nordic/nrf9161ns_laca.dtsi | 1 + dts/arm/nordic/nrf91ns.dtsi | 2 ++ 38 files changed, 54 insertions(+) diff --git a/dts/arm/nordic/nrf51822.dtsi b/dts/arm/nordic/nrf51822.dtsi index 8f262909d61fd..5644ea2787bf4 100644 --- a/dts/arm/nordic/nrf51822.dtsi +++ b/dts/arm/nordic/nrf51822.dtsi @@ -47,6 +47,8 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; power: power@40000000 { diff --git a/dts/arm/nordic/nrf51822_qfaa.dtsi b/dts/arm/nordic/nrf51822_qfaa.dtsi index 2aeec68fd8529..b2ce647684e99 100644 --- a/dts/arm/nordic/nrf51822_qfaa.dtsi +++ b/dts/arm/nordic/nrf51822_qfaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(16)>; + ranges = <0x0 0x20000000 DT_SIZE_K(16)>; }; / { diff --git a/dts/arm/nordic/nrf51822_qfab.dtsi b/dts/arm/nordic/nrf51822_qfab.dtsi index 6f6818ac46074..d4327bb2b7559 100644 --- a/dts/arm/nordic/nrf51822_qfab.dtsi +++ b/dts/arm/nordic/nrf51822_qfab.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(16)>; + ranges = <0x0 0x20000000 DT_SIZE_K(16)>; }; / { diff --git a/dts/arm/nordic/nrf51822_qfac.dtsi b/dts/arm/nordic/nrf51822_qfac.dtsi index eae879189c0c2..f41890945e47c 100644 --- a/dts/arm/nordic/nrf51822_qfac.dtsi +++ b/dts/arm/nordic/nrf51822_qfac.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(32)>; + ranges = <0x0 0x20000000 DT_SIZE_K(32)>; }; / { diff --git a/dts/arm/nordic/nrf52805.dtsi b/dts/arm/nordic/nrf52805.dtsi index e940c7a2cdf2c..667f69836d05d 100644 --- a/dts/arm/nordic/nrf52805.dtsi +++ b/dts/arm/nordic/nrf52805.dtsi @@ -52,6 +52,8 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; clock: clock@40000000 { diff --git a/dts/arm/nordic/nrf52805_caaa.dtsi b/dts/arm/nordic/nrf52805_caaa.dtsi index 285d21440599e..38daaff88d0eb 100644 --- a/dts/arm/nordic/nrf52805_caaa.dtsi +++ b/dts/arm/nordic/nrf52805_caaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(24)>; + ranges = <0x0 0x20000000 DT_SIZE_K(24)>; }; / { diff --git a/dts/arm/nordic/nrf52810.dtsi b/dts/arm/nordic/nrf52810.dtsi index c1e5f87631725..bdb592e3fe839 100644 --- a/dts/arm/nordic/nrf52810.dtsi +++ b/dts/arm/nordic/nrf52810.dtsi @@ -56,6 +56,8 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; clock: clock@40000000 { diff --git a/dts/arm/nordic/nrf52810_qfaa.dtsi b/dts/arm/nordic/nrf52810_qfaa.dtsi index bbc76ab759719..344eca772f37e 100644 --- a/dts/arm/nordic/nrf52810_qfaa.dtsi +++ b/dts/arm/nordic/nrf52810_qfaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(24)>; + ranges = <0x0 0x20000000 DT_SIZE_K(24)>; }; / { diff --git a/dts/arm/nordic/nrf52811.dtsi b/dts/arm/nordic/nrf52811.dtsi index 33f6ac38747a3..3a793554c86f3 100644 --- a/dts/arm/nordic/nrf52811.dtsi +++ b/dts/arm/nordic/nrf52811.dtsi @@ -60,6 +60,8 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; clock: clock@40000000 { diff --git a/dts/arm/nordic/nrf52811_qfaa.dtsi b/dts/arm/nordic/nrf52811_qfaa.dtsi index 17b387919dc87..18eacff062341 100644 --- a/dts/arm/nordic/nrf52811_qfaa.dtsi +++ b/dts/arm/nordic/nrf52811_qfaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(24)>; + ranges = <0x0 0x20000000 DT_SIZE_K(24)>; }; / { diff --git a/dts/arm/nordic/nrf52820.dtsi b/dts/arm/nordic/nrf52820.dtsi index 1073b973c22a7..88fc0c76dc5d6 100644 --- a/dts/arm/nordic/nrf52820.dtsi +++ b/dts/arm/nordic/nrf52820.dtsi @@ -59,6 +59,8 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; clock: clock@40000000 { diff --git a/dts/arm/nordic/nrf52820_qdaa.dtsi b/dts/arm/nordic/nrf52820_qdaa.dtsi index a683ddcd2e614..585926d1a1660 100644 --- a/dts/arm/nordic/nrf52820_qdaa.dtsi +++ b/dts/arm/nordic/nrf52820_qdaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(32)>; + ranges = <0x0 0x20000000 DT_SIZE_K(32)>; }; / { diff --git a/dts/arm/nordic/nrf52832.dtsi b/dts/arm/nordic/nrf52832.dtsi index 09a651762db65..39a2dd5b0d3ee 100644 --- a/dts/arm/nordic/nrf52832.dtsi +++ b/dts/arm/nordic/nrf52832.dtsi @@ -56,6 +56,8 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; clock: clock@40000000 { diff --git a/dts/arm/nordic/nrf52832_ciaa.dtsi b/dts/arm/nordic/nrf52832_ciaa.dtsi index 81bed18daf27a..28848a4d12131 100644 --- a/dts/arm/nordic/nrf52832_ciaa.dtsi +++ b/dts/arm/nordic/nrf52832_ciaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(64)>; + ranges = <0x0 0x20000000 DT_SIZE_K(64)>; }; / { diff --git a/dts/arm/nordic/nrf52832_qfaa.dtsi b/dts/arm/nordic/nrf52832_qfaa.dtsi index 81bed18daf27a..28848a4d12131 100644 --- a/dts/arm/nordic/nrf52832_qfaa.dtsi +++ b/dts/arm/nordic/nrf52832_qfaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(64)>; + ranges = <0x0 0x20000000 DT_SIZE_K(64)>; }; / { diff --git a/dts/arm/nordic/nrf52832_qfab.dtsi b/dts/arm/nordic/nrf52832_qfab.dtsi index faecc765efdf7..5c0d3dd8abdbe 100644 --- a/dts/arm/nordic/nrf52832_qfab.dtsi +++ b/dts/arm/nordic/nrf52832_qfab.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(32)>; + ranges = <0x0 0x20000000 DT_SIZE_K(32)>; }; / { diff --git a/dts/arm/nordic/nrf52833.dtsi b/dts/arm/nordic/nrf52833.dtsi index 87e6bccfb53d3..24addb6f3cf4e 100644 --- a/dts/arm/nordic/nrf52833.dtsi +++ b/dts/arm/nordic/nrf52833.dtsi @@ -60,6 +60,8 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; clock: clock@40000000 { diff --git a/dts/arm/nordic/nrf52833_qdaa.dtsi b/dts/arm/nordic/nrf52833_qdaa.dtsi index 64462d29269bb..2c4ebaa0014ab 100644 --- a/dts/arm/nordic/nrf52833_qdaa.dtsi +++ b/dts/arm/nordic/nrf52833_qdaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(128)>; + ranges = <0x0 0x20000000 DT_SIZE_K(128)>; }; / { diff --git a/dts/arm/nordic/nrf52833_qiaa.dtsi b/dts/arm/nordic/nrf52833_qiaa.dtsi index 6ab9a4f1e6eb7..2b15451b3306c 100644 --- a/dts/arm/nordic/nrf52833_qiaa.dtsi +++ b/dts/arm/nordic/nrf52833_qiaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(128)>; + ranges = <0x0 0x20000000 DT_SIZE_K(128)>; }; / { diff --git a/dts/arm/nordic/nrf52840.dtsi b/dts/arm/nordic/nrf52840.dtsi index c0a2545f01378..77e70fa85f114 100644 --- a/dts/arm/nordic/nrf52840.dtsi +++ b/dts/arm/nordic/nrf52840.dtsi @@ -56,6 +56,8 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; clock: clock@40000000 { diff --git a/dts/arm/nordic/nrf52840_qfaa.dtsi b/dts/arm/nordic/nrf52840_qfaa.dtsi index 6d549a45d1ddc..9c4b70a10d0b8 100644 --- a/dts/arm/nordic/nrf52840_qfaa.dtsi +++ b/dts/arm/nordic/nrf52840_qfaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; / { diff --git a/dts/arm/nordic/nrf52840_qiaa.dtsi b/dts/arm/nordic/nrf52840_qiaa.dtsi index 7986ab41fd6a3..3ad3537a05d7b 100644 --- a/dts/arm/nordic/nrf52840_qiaa.dtsi +++ b/dts/arm/nordic/nrf52840_qiaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; &power { diff --git a/dts/arm/nordic/nrf5340_cpuapp.dtsi b/dts/arm/nordic/nrf5340_cpuapp.dtsi index b9762248a5dfd..aaf7c5657019d 100644 --- a/dts/arm/nordic/nrf5340_cpuapp.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp.dtsi @@ -54,6 +54,8 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; peripheral@50000000 { diff --git a/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi index 76a2af386623b..cd9983d949ecd 100644 --- a/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpuapp_qkaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(512)>; + ranges = <0x0 0x20000000 DT_SIZE_K(512)>; }; / { diff --git a/dts/arm/nordic/nrf5340_cpuappns.dtsi b/dts/arm/nordic/nrf5340_cpuappns.dtsi index 763e9ca7839b7..8e4aa44aa2600 100644 --- a/dts/arm/nordic/nrf5340_cpuappns.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns.dtsi @@ -37,6 +37,8 @@ soc { sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; peripheral@40000000 { diff --git a/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi index 37d6a605556ef..6e18f646977d1 100644 --- a/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpuappns_qkaa.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(512)>; + ranges = <0x0 0x20000000 DT_SIZE_K(512)>; }; / { diff --git a/dts/arm/nordic/nrf5340_cpunet.dtsi b/dts/arm/nordic/nrf5340_cpunet.dtsi index 5010f801e0c01..94e93782fe317 100644 --- a/dts/arm/nordic/nrf5340_cpunet.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet.dtsi @@ -48,11 +48,15 @@ sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; sram1: memory@21000000 { compatible = "zephyr,memory-region", "mmio-sram"; zephyr,memory-region = "SRAM1"; + #address-cells = <1>; + #size-cells = <1>; }; clock: clock@41005000 { diff --git a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi index e9948125ba894..be16eedfc5296 100644 --- a/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi +++ b/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi @@ -13,10 +13,12 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(512)>; + ranges = <0x0 0x20000000 DT_SIZE_K(512)>; }; &sram1 { reg = <0x21000000 DT_SIZE_K(64)>; + ranges = <0x0 0x21000000 DT_SIZE_K(64)>; }; / { diff --git a/dts/arm/nordic/nrf91.dtsi b/dts/arm/nordic/nrf91.dtsi index 2ef4b9bbab20c..6d03f9d6d7529 100644 --- a/dts/arm/nordic/nrf91.dtsi +++ b/dts/arm/nordic/nrf91.dtsi @@ -34,6 +34,8 @@ soc { sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; peripheral@50000000 { diff --git a/dts/arm/nordic/nrf9131_laca.dtsi b/dts/arm/nordic/nrf9131_laca.dtsi index 77fe73c22af66..30c526af5d32e 100644 --- a/dts/arm/nordic/nrf9131_laca.dtsi +++ b/dts/arm/nordic/nrf9131_laca.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; / { diff --git a/dts/arm/nordic/nrf9131ns_laca.dtsi b/dts/arm/nordic/nrf9131ns_laca.dtsi index 6ab80a842a33c..8426efcde26a8 100644 --- a/dts/arm/nordic/nrf9131ns_laca.dtsi +++ b/dts/arm/nordic/nrf9131ns_laca.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; / { diff --git a/dts/arm/nordic/nrf9151_laca.dtsi b/dts/arm/nordic/nrf9151_laca.dtsi index 77fe73c22af66..30c526af5d32e 100644 --- a/dts/arm/nordic/nrf9151_laca.dtsi +++ b/dts/arm/nordic/nrf9151_laca.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; / { diff --git a/dts/arm/nordic/nrf9151ns_laca.dtsi b/dts/arm/nordic/nrf9151ns_laca.dtsi index 6ab80a842a33c..8426efcde26a8 100644 --- a/dts/arm/nordic/nrf9151ns_laca.dtsi +++ b/dts/arm/nordic/nrf9151ns_laca.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; / { diff --git a/dts/arm/nordic/nrf9160_sica.dtsi b/dts/arm/nordic/nrf9160_sica.dtsi index 6bbe048277c12..e00d03fb5afc0 100644 --- a/dts/arm/nordic/nrf9160_sica.dtsi +++ b/dts/arm/nordic/nrf9160_sica.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; / { diff --git a/dts/arm/nordic/nrf9160ns_sica.dtsi b/dts/arm/nordic/nrf9160ns_sica.dtsi index 12ec1fcbc8e07..a10a5df325c92 100644 --- a/dts/arm/nordic/nrf9160ns_sica.dtsi +++ b/dts/arm/nordic/nrf9160ns_sica.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; / { diff --git a/dts/arm/nordic/nrf9161_laca.dtsi b/dts/arm/nordic/nrf9161_laca.dtsi index 77fe73c22af66..30c526af5d32e 100644 --- a/dts/arm/nordic/nrf9161_laca.dtsi +++ b/dts/arm/nordic/nrf9161_laca.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; / { diff --git a/dts/arm/nordic/nrf9161ns_laca.dtsi b/dts/arm/nordic/nrf9161ns_laca.dtsi index 6ab80a842a33c..8426efcde26a8 100644 --- a/dts/arm/nordic/nrf9161ns_laca.dtsi +++ b/dts/arm/nordic/nrf9161ns_laca.dtsi @@ -13,6 +13,7 @@ &sram0 { reg = <0x20000000 DT_SIZE_K(256)>; + ranges = <0x0 0x20000000 DT_SIZE_K(256)>; }; / { diff --git a/dts/arm/nordic/nrf91ns.dtsi b/dts/arm/nordic/nrf91ns.dtsi index e44bbcde0a433..f4d88a6e635cd 100644 --- a/dts/arm/nordic/nrf91ns.dtsi +++ b/dts/arm/nordic/nrf91ns.dtsi @@ -35,6 +35,8 @@ soc { sram0: memory@20000000 { compatible = "mmio-sram"; + #address-cells = <1>; + #size-cells = <1>; }; peripheral@40000000 { From 71d6f8a58a5d70b063cc6444d983642c168a54db Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 17 Oct 2025 12:17:30 +0100 Subject: [PATCH 2/4] dts: vendor: nordic: nrf91: Fix SRAM partitioning Uses the correct way to partition memory as per the linux binding, also fixes names which were not compliant with the zephyr devicetree guidelines Signed-off-by: Jamie McCrae --- dts/vendor/nordic/nrf91xx_partition.dtsi | 31 +++++++++++------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/dts/vendor/nordic/nrf91xx_partition.dtsi b/dts/vendor/nordic/nrf91xx_partition.dtsi index dd98ce62f8e6f..89bc968a67d77 100644 --- a/dts/vendor/nordic/nrf91xx_partition.dtsi +++ b/dts/vendor/nordic/nrf91xx_partition.dtsi @@ -94,7 +94,7 @@ }; }; -/ { +&sram0 { /* * Default SRAM planning when building for nRF91xx with * ARM TrustZone-M support @@ -104,29 +104,26 @@ * - 40 kB SRAM reserved for and used by the modem library (sram0_ns_modem). * - 128 kB allocated to the application (sram0_ns_app). */ - reserved-memory { + sram0_s: sram@0 { + /* Secure image memory */ + reg = <0x0 DT_SIZE_K(88)>; + }; + + sram0_ns: sram@16000 { + /* Non-Secure image memory */ + reg = <0x16000 DT_SIZE_K(168)>; #address-cells = <1>; #size-cells = <1>; - ranges; - - sram0_s: image_s@20000000 { - /* Secure image memory */ - reg = <0x20000000 DT_SIZE_K(88)>; - }; - - sram0_ns: image_ns@20016000 { - /* Non-Secure image memory */ - reg = <0x20016000 DT_SIZE_K(168)>; - }; + ranges = <0x0 0x16000 DT_SIZE_K(168)>; - sram0_ns_modem: image_ns_modem@20016000 { + sram0_ns_modem: sram@0 { /* Modem (shared) memory */ - reg = <0x20016000 DT_SIZE_K(40)>; + reg = <0x0 DT_SIZE_K(40)>; }; - sram0_ns_app: image_ns_app@20020000 { + sram0_ns_app: sram@a000 { /* Non-Secure application memory */ - reg = <0x20020000 DT_SIZE_K(128)>; + reg = <0xa000 DT_SIZE_K(128)>; }; }; }; From d2eff13438988efd242932281da323939343ae7b Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 17 Oct 2025 12:21:00 +0100 Subject: [PATCH 3/4] dts: vendor: nordic: nrf5340: Fix SRAM partitioning Uses the correct way to partition memory as per the linux binding, also fixes names which were not compliant with the zephyr devicetree guidelines Signed-off-by: Jamie McCrae --- .../nordic/nrf5340_shared_sram_partition.dtsi | 14 +++---- dts/vendor/nordic/nrf5340_sram_partition.dtsi | 38 ++++++++----------- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/dts/vendor/nordic/nrf5340_shared_sram_partition.dtsi b/dts/vendor/nordic/nrf5340_shared_sram_partition.dtsi index a5dc3489e893e..980a6a0f3b7bf 100644 --- a/dts/vendor/nordic/nrf5340_shared_sram_partition.dtsi +++ b/dts/vendor/nordic/nrf5340_shared_sram_partition.dtsi @@ -21,15 +21,11 @@ chosen { zephyr,ipc_shm = &sram0_shared; }; +}; - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - sram0_shared: memory@20070000 { - /* Last 64 kB of sram0 */ - reg = <0x20070000 0x10000>; - }; +&sram0 { + sram0_shared: sram@70000 { + /* Last 64 kB of sram0 */ + reg = <0x70000 0x10000>; }; }; diff --git a/dts/vendor/nordic/nrf5340_sram_partition.dtsi b/dts/vendor/nordic/nrf5340_sram_partition.dtsi index db1d9dd4f1603..f844e07498c14 100644 --- a/dts/vendor/nordic/nrf5340_sram_partition.dtsi +++ b/dts/vendor/nordic/nrf5340_sram_partition.dtsi @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -/ { +&sram0 { /* Default SRAM planning when building for nRF5340 with ARM TF-M support * - Lowest 256 kB SRAM allocated to Secure image (sram0_s) * - Upper 256 kB allocated to Non-Secure image (sram0_ns) @@ -13,29 +13,23 @@ * - 64 kB allocated to shared memory (sram0_shared). * (See nrf5340_shared_sram_partition.dtsi) */ - reserved-memory { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - sram0_image: image@20000000 { - /* Zephyr image(s) memory */ - reg = <0x20000000 DT_SIZE_K(448)>; - }; + sram0_image: sram@0 { + /* Zephyr image(s) memory */ + reg = <0x20000000 DT_SIZE_K(448)>; + }; - sram0_s: image_s@20000000 { - /* Secure image memory */ - reg = <0x20000000 0x40000>; - }; + sram0_s: sram@20000000 { + /* Secure image memory */ + reg = <0x20000000 0x40000>; + }; - sram0_ns: image_ns@20040000 { - /* Non-Secure image memory */ - reg = <0x20040000 0x40000>; - }; + sram0_ns: sram@20040000 { + /* Non-Secure image memory */ + reg = <0x20040000 0x40000>; + }; - sram0_ns_app: image_ns_app@20040000 { - /* Non-Secure image memory */ - reg = <0x20040000 0x30000>; - }; + sram0_ns_app: sram@20040000 { + /* Non-Secure image memory */ + reg = <0x20040000 0x30000>; }; }; From 7657e676b6df08f81a5ffadd58356d5422915ae8 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 17 Oct 2025 14:13:45 +0100 Subject: [PATCH 4/4] boards: native: nrf_bsim: Fix for new memory layout Fixes this board so that it works with the now-needed sram0 node Signed-off-by: Alberto Escolar Piedras Signed-off-by: Jamie McCrae --- boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts | 8 +++++--- boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts index 98447e569938f..32ed9916a382d 100644 --- a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts +++ b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts @@ -16,7 +16,6 @@ /* We need to remove aliases to nodes we delete */ aliases { - /delete-property/ sram-0; /delete-property/ i2c-0; /delete-property/ spi-0; /delete-property/ i2c-1; @@ -48,8 +47,6 @@ }; soc { - /delete-node/ memory@20000000; - peripheral@50000000 { /delete-node/ dcnf@0; /delete-node/ oscillator@4000; @@ -110,6 +107,11 @@ }; }; +&sram0 { + reg = <0x20000000 DT_SIZE_K(512)>; + ranges = <0x0 0x20000000 DT_SIZE_K(512)>; +}; + &gpiote { status = "okay"; }; diff --git a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts index 317aff9cc00d1..567e87869d393 100644 --- a/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts +++ b/boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts @@ -16,7 +16,6 @@ /* We need to remove aliases to nodes we delete */ aliases { - /delete-property/ sram-0; /delete-property/ sram-1; /delete-property/ wdt-0; /delete-property/ i2c-0; @@ -33,7 +32,6 @@ }; soc { - /delete-node/ memory@20000000; /delete-node/ memory@21000000; /delete-node/ watchdog@4100b000; /delete-node/ i2c@41013000; @@ -70,6 +68,11 @@ }; }; +&sram0 { + reg = <0x20000000 DT_SIZE_K(512)>; + ranges = <0x0 0x20000000 DT_SIZE_K(512)>; +}; + &gpiote { status = "okay"; };