Skip to content

Commit 06d8aab

Browse files
boards: mps2_an521: clean up memory map
Fix comments in board DTS files referring to AN521 tables defining memory areas, and choose node label names that more accurately reflect the entries of interest in those tables. Adjust the one in-tree user of the affected node labels. Signed-off-by: Martí Bolívar <[email protected]>
1 parent 842a6ba commit 06d8aab

File tree

4 files changed

+57
-24
lines changed

4 files changed

+57
-24
lines changed

boards/arm/mps2_an521/mps2_an521.dts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,15 @@
2727
chosen {
2828
zephyr,console = &uart0;
2929
zephyr,shell-uart = &uart0;
30-
zephyr,sram = &sram2_3;
31-
zephyr,flash = &sram1;
30+
31+
/*
32+
* These SRAM and flash settings give the entire available
33+
* code and data memories to this secure firmware image.
34+
* This may conflict with mps2_an521_remote firmware. Use
35+
* caution when using both targets simultaneously.
36+
*/
37+
zephyr,sram = &ssram2_3;
38+
zephyr,flash = &ssram1;
3239
};
3340

3441
leds {
@@ -77,22 +84,26 @@
7784
/*
7885
* The memory regions defined below are according to AN521:
7986
* https://documentation-service.arm.com/static/5fa12fe9b1a7c5445f29017f
80-
* Please see tables from 3-1 to 3-4.
87+
*
88+
* Please see tables mentioned in individual comments below for details.
8189
*/
8290

83-
sram1: memory@10000000 {
91+
ssram1: memory@10000000 {
92+
/* Table 3-2, row 6. */
8493
compatible = "zephyr,memory-region", "mmio-sram";
8594
reg = <0x10000000 DT_SIZE_M(4)>;
86-
zephyr,memory-region = "SRAM1";
95+
zephyr,memory-region = "SSRAM1";
8796
};
8897

89-
sram2_3: memory@38000000 {
98+
ssram2_3: memory@38000000 {
99+
/* Table 3-4, rows 16 and 17. */
90100
compatible = "zephyr,memory-region", "mmio-sram";
91101
reg = <0x38000000 DT_SIZE_M(4)>;
92-
zephyr,memory-region = "SRAM2_3";
102+
zephyr,memory-region = "SSRAM2_3";
93103
};
94104

95105
psram: memory@80000000 {
106+
/* Table 3-6, row 1. */
96107
device_type = "memory";
97108
reg = <0x80000000 DT_SIZE_M(16)>;
98109
};

boards/arm/mps2_an521/mps2_an521_ns.dts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,26 @@
7676
/*
7777
* The memory regions defined below are according to AN521:
7878
* https://documentation-service.arm.com/static/5fa12fe9b1a7c5445f29017f
79-
* Please see tables from 3-1 to 3-4.
79+
*
80+
* Please see tables mentioned in individual comments below for details.
8081
*/
8182

82-
sram1: memory@0 {
83+
ssram1: memory@0 {
84+
/* Table 3-2, row 1. */
8385
compatible = "zephyr,memory-region", "mmio-sram";
8486
reg = <0x0 DT_SIZE_M(4)>;
85-
zephyr,memory-region = "SRAM1";
87+
zephyr,memory-region = "SSRAM1";
8688
};
8789

88-
sram2_3: memory@28000000 {
90+
ssram2_3: memory@28000000 {
91+
/* Table 3-4, rows 8 and 9. */
8992
compatible = "zephyr,memory-region", "mmio-sram";
9093
reg = <0x28000000 DT_SIZE_M(4)>;
91-
zephyr,memory-region = "SRAM2_3";
94+
zephyr,memory-region = "SSRAM2_3";
9295
};
9396

9497
psram: memory@80000000 {
98+
/* Table 3-6, row 1. */
9599
device_type = "memory";
96100
reg = <0x80000000 DT_SIZE_M(16)>;
97101
};
@@ -101,16 +105,22 @@
101105
#size-cells = <1>;
102106
ranges;
103107

104-
/* The memory regions defined below must match what the TF-M
108+
/* This code memory region must match what the TF-M
105109
* project has defined for that board - a single image boot is
106110
* assumed. Please see the memory layout in:
107-
* https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/platform/ext/target/mps2/an521/partition/flash_layout.h
111+
*
112+
* https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/master/platform/ext/target/arm/mps2/an521/partition/flash_layout.h
108113
*/
109-
110114
code: memory@100000 {
111115
reg = <0x00100000 DT_SIZE_K(512)>;
112116
};
113117

118+
/* This ram memory region's size is chosen to avoid conflict
119+
* with the mps2_an521_remote board's RAM region.
120+
*
121+
* Its available address space must be compatible with what
122+
* TF-M assigns to NS firmware.
123+
*/
114124
ram: memory@28100000 {
115125
reg = <0x28100000 DT_SIZE_K(512)>;
116126
};

boards/arm/mps2_an521/mps2_an521_remote.dts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,26 @@
7676
/*
7777
* The memory regions defined below are according to AN521:
7878
* https://documentation-service.arm.com/static/5fa12fe9b1a7c5445f29017f
79-
* Please see tables from 3-1 to 3-4.
79+
*
80+
* Please see tables mentioned in individual comments below for details.
8081
*/
8182

82-
sram1: memory@0 {
83+
ssram1: memory@0 {
84+
/* Table 3-2, row 1. */
8385
compatible = "zephyr,memory-region", "mmio-sram";
8486
reg = <0x0 DT_SIZE_M(4)>;
85-
zephyr,memory-region = "SRAM1";
87+
zephyr,memory-region = "SSRAM1";
8688
};
8789

88-
sram2_3: memory@28000000 {
90+
ssram2_3: memory@28000000 {
91+
/* Table 3-4, rows 8 and 9. */
8992
compatible = "zephyr,memory-region", "mmio-sram";
9093
reg = <0x28000000 DT_SIZE_M(4)>;
91-
zephyr,memory-region = "SRAM2_3";
94+
zephyr,memory-region = "SSRAM2_3";
9295
};
9396

9497
psram: memory@80000000 {
98+
/* Table 3-6, row 1. */
9599
device_type = "memory";
96100
reg = <0x80000000 DT_SIZE_M(16)>;
97101
};
@@ -101,16 +105,24 @@
101105
#size-cells = <1>;
102106
ranges;
103107

104-
/* The memory regions defined below are selected to remain
108+
/* The code memory region defined below is selected to remain
105109
* compatible with what TF-M has defined for a single boot image,
106110
* where 468 KB memory at the bottom of the 4 MB code region is
107-
* marked as 'Unused'.
111+
* marked as 'Unused'. Please see the memory layout in:
112+
*
113+
* https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/master/platform/ext/target/arm/mps2/an521/partition/flash_layout.h
108114
*/
109115

110116
code: memory@38B000 {
111117
reg = <0x0038B000 DT_SIZE_K(468)>;
112118
};
113119

120+
/* This ram memory region's base address is chosen to avoid
121+
* conflict with the mps2_an521_ns board's RAM region.
122+
*
123+
* Its available address space must be compatible with what
124+
* TF-M assigns to NS firmware.
125+
*/
114126
ram: memory@28180000 {
115127
reg = <0x28180000 DT_SIZE_K(512)>;
116128
};

tests/kernel/mem_heap/shared_multi_heap/boards/mps2_an521.overlay

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
/ {
88
/delete-node/ memory@38000000;
99

10-
sram2_3: memory@38000000 {
10+
ssram2_3: memory@38000000 {
1111
compatible = "zephyr,memory-region", "mmio-sram";
1212
reg = <0x38000000 0x100000>;
13-
zephyr,memory-region = "SRAM2_3";
13+
zephyr,memory-region = "SSRAM2_3";
1414
};
1515

1616
res0: memory@38100000 {

0 commit comments

Comments
 (0)