Skip to content

Conversation

@ioannisg
Copy link
Member

@ioannisg ioannisg commented Apr 23, 2020

We would like to have sram0 DT node represent the available SRAM memory on nrf9160 and nRF5340 SoCs. As such, sram0 shall not be resized in Board DT configuration.

In DTS we define sram0 node as such, but in boards//nrf5340pdk_ and nrf9160dk_ we have been using sram0 to represent (also) the image RAM allocated to Zephyr builds. The consequence is that sram0 is resized to match the requirements of the specific build (security domain, inter-processor shared memory, etc.), so we do not have a DTS generated macro to represent the total SRAM.

In this PR we fix this problem by having sram0 always represent the physical SRAM.
For nRF5340 we introduce sram0_image, to represent the RAM available for Zephyr image(s), secure and non-secure.

This PR is also adding additional information regarding reserved memory areas in board DT, such as SRAM memory areas explicitly allocated to secure and non-secure Zephyr execution environment.

@ioannisg ioannisg requested a review from hakonfam April 23, 2020 12:45
@ioannisg ioannisg force-pushed the nrf5340_fix_sram0_node branch from d69c512 to 4422251 Compare April 23, 2020 15:30
@ioannisg ioannisg changed the title Nrf5340 fix sram0 node Allow sram0 to represent the physical RAM in nRF5340 and nRF9160 DKs Apr 23, 2020
@ioannisg ioannisg changed the title Allow sram0 to represent the physical RAM in nRF5340 and nRF9160 DKs Set sram0 to represent the physical RAM in nRF5340 and nRF9160 DKs Apr 23, 2020
@ioannisg ioannisg added the Enhancement Changes/Updates/Additions to existing features label Apr 23, 2020
Copy link
Member Author

@ioannisg ioannisg Apr 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the sentence is more "generic" (as long as we're using zephyr,sram for image ram, which we do in all ARM platforms AFAIK)

@ioannisg ioannisg added the platform: nRF Nordic nRFx label Apr 23, 2020
Copy link
Contributor

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ioannisg ioannisg force-pushed the nrf5340_fix_sram0_node branch from 4422251 to 3a73b45 Compare April 23, 2020 16:56
@zephyrbot
Copy link

zephyrbot commented Apr 23, 2020

All checks passed.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

@ioannisg ioannisg marked this pull request as ready for review April 23, 2020 17:01
Copy link
Contributor

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need the labels?

Copy link
Contributor

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, outside of the question if you need to label memory nodes (which I'd ask be removed, unless there's a really good reason for it).

@ioannisg ioannisg force-pushed the nrf5340_fix_sram0_node branch from 3a73b45 to 2a1979a Compare April 23, 2020 19:39
@ioannisg
Copy link
Member Author

Looks good, outside of the question if you need to label memory nodes (which I'd ask be removed, unless there's a really good reason for it).

No I did not need the labels, that's right. What I wanted is some inline descriptive comments.
fixed now.

@ioannisg ioannisg requested a review from galak April 23, 2020 19:40
Copy link
Contributor

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still a few labels in nrf9160dk_nrf9160_common.dts

@ioannisg ioannisg force-pushed the nrf5340_fix_sram0_node branch from 2a1979a to c629155 Compare April 24, 2020 07:15
@ioannisg ioannisg force-pushed the nrf5340_fix_sram0_node branch from c629155 to 626b4a5 Compare April 24, 2020 14:54
@ioannisg
Copy link
Member Author

ioannisg commented May 8, 2020

needs #25009

@pabigot pabigot self-requested a review May 9, 2020 00:13
ioannisg and others added 5 commits May 9, 2020 20:31
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]>
We do not want sram0_shared to represent physical ram;
this is just a portion of sram reserved for shared memory
between Application and Network MCU. Therfore, we remove
the 'mmio' compatible property and transform this node to
a reserved-memory node definition, inside which we define
the sram0_shared node along with its reg property.

In addition we correct the documentation about the shared
memory, stressing that it is placed after the image RAM of
nrf5340 Application MCU (not after the secure SRAM).

Signed-off-by: Ioannis Glaropoulos <[email protected]>
sram0 node is needed to hold the size of the
total, physical SRAM available on nRF9160 SoC.
We use sram0_s to represent the Secure image
SRAM for nRF9160_dk builds.

Signed-off-by: Håkon Øye Amundsen <[email protected]>
Signed-off-by: Ioannis Glaropoulos <[email protected]>
We do not want sram0_ns and sram0_bsd to represent physical
ram; these are just portions of sram reserved for the non-secure
image and the bsd library, respectively. Thus we can remove the
compatible property from these nodes. We also make use of
'reserved-memory' to represent the different memory partitions
to be used by the nrf9160 builds.

Signed-off-by: Ioannis Glaropoulos <[email protected]>
When we build Zephyr as Secure image on nRF340 Application
MCU and nRF9160 SoC we would like to pass the information
about the reserved memory area allocated to the Non-Secure
images. The information may be needed to apply proper
security configuration. We add a "chosen" node in board .dts
file for this purpose.

Signed-off-by: Ioannis Glaropoulos <[email protected]>
@ioannisg ioannisg force-pushed the nrf5340_fix_sram0_node branch from 8ff9d22 to 3ffec9a Compare May 9, 2020 18:31
@ioannisg ioannisg requested review from galak and removed request for galak May 9, 2020 19:26
Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be using the commonly agreed mechanism now.

@carlescufi carlescufi merged commit effac5b into zephyrproject-rtos:master May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Boards Enhancement Changes/Updates/Additions to existing features platform: nRF Nordic nRFx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants