Skip to content

Commit 28310ea

Browse files
ioannisgcarlescufi
authored andcommitted
boards: arm: nrf5340pdk: define sram0_image for image(s) RAM
We should not be using sram0 for image SRAM in nrf5340pdk. sram0 represents the physical SRAM and that one includes the shared memory between the two M33 CPUs on the SoC. We should not be re-sizing sram0 to account for the shared RAM; instead we would like to have sram0 representing the whole available SRAM. For that, we define a new memory node, sram0_image to represent the 'image' SRAM that is available for Zephyr on the board. sram0_image is the chosen image SRAM for default builds, i.e. when TrustZone is ignored (TRUSTED_EXECUTION_SECURE is not defined). Signed-off-by: Ioannis Glaropoulos <[email protected]>
1 parent bf98113 commit 28310ea

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

boards/arm/nrf5340pdk_nrf5340/Kconfig.defconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ config BOARD
2626
# If the secure firmware is to be combined with a non-secure image
2727
# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always
2828
# be restricted to the secure image SRAM partition (sram-secure-partition).
29-
# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole sram0 may be
30-
# used by the image.
29+
# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram
30+
# may be used by the image.
3131
#
3232
# For the non-secure version of the board, the firmware image SRAM is
3333
# always restricted to the allocated non-secure SRAM partition.

boards/arm/nrf5340pdk_nrf5340/nrf5340pdk_nrf5340_cpuapp.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/ {
1212
chosen {
13-
zephyr,sram = &sram0;
13+
zephyr,sram = &sram0_image;
1414
zephyr,flash = &flash0;
1515
zephyr,code-partition = &slot0_partition;
1616
zephyr,sram-secure-partition = &sram0_s;

boards/arm/nrf5340pdk_nrf5340/nrf5340pdk_nrf5340_cpuapp_common.dts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,23 @@
164164
};
165165
};
166166

167-
&sram0 {
167+
/ {
168168

169-
partitions {
170-
compatible = "fixed-partitions";
169+
reserved-memory {
171170
#address-cells = <1>;
172171
#size-cells = <1>;
172+
ranges;
173+
174+
sram0_image: image@20000000 {
175+
/* Zephyr image(s) memory */
176+
};
173177

174-
/* SRAM allocated to the Secure image */
175-
sram0_s: memory@20000000 {
176-
label = "secure_sram_partition";
178+
sram0_s: image_s@20000000 {
179+
/* Secure image memory */
177180
};
178181

179-
/* SRAM allocated to the Non-Secure image */
180-
sram0_ns: memory@20010000 {
181-
label = "non_secure_sram_partition";
182+
sram0_ns: image_ns@20010000 {
183+
/* Non-Secure image memory */
182184
};
183185
};
184186
};

boards/arm/nrf5340pdk_nrf5340/nrf5340pdk_nrf5340_cpuapp_partition_conf.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* - Upper 64 kB SRAM allocated as Shared memory (sram0_shared)
4545
* (see nrf5340pdk_nrf5340_shared_sram_planning_conf.dts)
4646
*/
47-
&sram0 {
47+
&sram0_image {
4848
reg = <0x20000000 DT_SIZE_K(448)>;
4949
};
5050

0 commit comments

Comments
 (0)