Skip to content

Commit dd5a3f1

Browse files
nordicjmcfriedt
authored andcommitted
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 <[email protected]>
1 parent f1e18c5 commit dd5a3f1

File tree

16 files changed

+78
-46
lines changed

16 files changed

+78
-46
lines changed

boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
/* We need to remove aliases to nodes we delete */
1818
aliases {
19-
/delete-property/ sram-0;
2019
/delete-property/ i2c-0;
2120
/delete-property/ spi-0;
2221
/delete-property/ i2c-1;
@@ -48,8 +47,6 @@
4847
};
4948

5049
soc {
51-
/delete-node/ memory@20000000;
52-
5350
peripheral@50000000 {
5451
/delete-node/ dcnf@0;
5552
/delete-node/ oscillator@4000;
@@ -110,6 +107,11 @@
110107
};
111108
};
112109

110+
&sram0 {
111+
reg = <0x20000000 DT_SIZE_K(512)>;
112+
ranges = <0x0 0x20000000 DT_SIZE_K(512)>;
113+
};
114+
113115
&gpiote {
114116
status = "okay";
115117
};

boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
/* We need to remove aliases to nodes we delete */
1818
aliases {
19-
/delete-property/ sram-0;
2019
/delete-property/ sram-1;
2120
/delete-property/ wdt-0;
2221
/delete-property/ i2c-0;
@@ -33,7 +32,6 @@
3332
};
3433

3534
soc {
36-
/delete-node/ memory@20000000;
3735
/delete-node/ memory@21000000;
3836
/delete-node/ watchdog@4100b000;
3937
/delete-node/ i2c@41013000;
@@ -70,6 +68,11 @@
7068
};
7169
};
7270

71+
&sram0 {
72+
reg = <0x20000000 DT_SIZE_K(512)>;
73+
ranges = <0x0 0x20000000 DT_SIZE_K(512)>;
74+
};
75+
7376
&gpiote {
7477
status = "okay";
7578
};

dts/vendor/nordic/nrf5340_shared_sram_partition.dtsi

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@
2121
chosen {
2222
zephyr,ipc_shm = &sram0_shared;
2323
};
24+
};
2425

25-
reserved-memory {
26-
#address-cells = <1>;
27-
#size-cells = <1>;
28-
ranges;
29-
30-
sram0_shared: memory@20070000 {
31-
/* Last 64 kB of sram0 */
32-
reg = <0x20070000 0x10000>;
33-
};
26+
&sram0 {
27+
sram0_shared: sram@70000 {
28+
/* Last 64 kB of sram0 */
29+
reg = <0x70000 0x10000>;
3430
};
3531
};

dts/vendor/nordic/nrf5340_sram_partition.dtsi

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
/ {
7+
&sram0 {
88
/* Default SRAM planning when building for nRF5340 with ARM TF-M support
99
* - Lowest 256 kB SRAM allocated to Secure image (sram0_s)
1010
* - Upper 256 kB allocated to Non-Secure image (sram0_ns)
@@ -13,29 +13,26 @@
1313
* - 64 kB allocated to shared memory (sram0_shared).
1414
* (See nrf5340_shared_sram_partition.dtsi)
1515
*/
16-
reserved-memory {
17-
#address-cells = <1>;
18-
#size-cells = <1>;
19-
ranges;
20-
21-
sram0_image: image@20000000 {
22-
/* Zephyr image(s) memory */
23-
reg = <0x20000000 DT_SIZE_K(448)>;
24-
};
16+
sram0_image: sram@0 {
17+
/* Zephyr image(s) memory */
18+
reg = <0x20000000 DT_SIZE_K(448)>;
19+
};
2520

26-
sram0_s: image_s@20000000 {
27-
/* Secure image memory */
28-
reg = <0x20000000 0x40000>;
29-
};
21+
sram0_s: sram@20000000 {
22+
/* Secure image memory */
23+
reg = <0x20000000 0x40000>;
24+
};
3025

31-
sram0_ns: image_ns@20040000 {
32-
/* Non-Secure image memory */
33-
reg = <0x20040000 0x40000>;
34-
};
26+
sram0_ns: sram@20040000 {
27+
/* Non-Secure image memory */
28+
reg = <0x20040000 0x40000>;
29+
ranges = <0x0 0x20040000 0x40000>;
30+
#address-cells = <1>;
31+
#size-cells = <1>;
3532

36-
sram0_ns_app: image_ns_app@20040000 {
33+
sram0_ns_app: sram@0 {
3734
/* Non-Secure image memory */
38-
reg = <0x20040000 0x30000>;
35+
reg = <0x0 0x30000>;
3936
};
4037
};
4138
};

samples/subsys/ipc/ipc_service/icmsg/boards/nrf5340dk_nrf5340_cpuapp.overlay

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
/delete-node/ &sram0_shared;
8+
79
/ {
810
chosen {
911
/delete-property/ zephyr,ipc_shm;
1012
};
1113

1214
reserved-memory {
13-
/delete-node/ memory@20070000;
15+
#address-cells = <1>;
16+
#size-cells = <1>;
1417

1518
sram_tx: memory@20070000 {
1619
reg = <0x20070000 0x0800>;

samples/subsys/ipc/ipc_service/icmsg/remote/boards/nrf5340dk_nrf5340_cpunet.overlay

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
/delete-node/ &sram0_shared;
8+
79
/ {
810
chosen {
911
/delete-property/ zephyr,ipc_shm;
1012
};
1113

1214
reserved-memory {
13-
/delete-node/ memory@20070000;
15+
#address-cells = <1>;
16+
#size-cells = <1>;
1417

1518
sram_rx: memory@20070000 {
1619
reg = <0x20070000 0x0800>;

samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp.overlay

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
/delete-node/ &sram0_shared;
8+
79
/ {
810
chosen {
911
/delete-property/ zephyr,ipc_shm;
1012
};
1113

1214
reserved-memory {
13-
/delete-node/ memory@20070000;
15+
#address-cells = <1>;
16+
#size-cells = <1>;
1417

1518
sram_ipc0_tx: memory@20070000 {
1619
reg = <0x20070000 0x4000>;

samples/subsys/ipc/ipc_service/multi_endpoint/boards/nrf5340dk_nrf5340_cpuapp_icbmsg.overlay

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
/delete-node/ &sram0_shared;
8+
79
/ {
810
chosen {
911
/delete-property/ zephyr,ipc_shm;
1012
};
1113

1214
reserved-memory {
13-
/delete-node/ memory@20070000;
15+
#address-cells = <1>;
16+
#size-cells = <1>;
1417

1518
sram_ipc0_tx: memory@20070000 {
1619
reg = <0x20070000 0x4000>;

samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet.overlay

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
/delete-node/ &sram0_shared;
8+
79
/ {
810
chosen {
911
/delete-property/ zephyr,ipc_shm;
1012
};
1113

1214
reserved-memory {
13-
/delete-node/ memory@20070000;
15+
#address-cells = <1>;
16+
#size-cells = <1>;
1417

1518
sram_ipc0_rx: memory@20070000 {
1619
reg = <0x20070000 0x4000>;

samples/subsys/ipc/ipc_service/multi_endpoint/remote/boards/nrf5340dk_nrf5340_cpunet_icbmsg.overlay

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
/delete-node/ &sram0_shared;
8+
79
/ {
810
chosen {
911
/delete-property/ zephyr,ipc_shm;
1012
};
1113

1214
reserved-memory {
13-
/delete-node/ memory@20070000;
15+
#address-cells = <1>;
16+
#size-cells = <1>;
1417

1518
sram_ipc0_rx: memory@20070000 {
1619
reg = <0x20070000 0x4000>;

0 commit comments

Comments
 (0)