Currently there is only one SRAM of type "mimo-sram" defined in each *.dts file of each board.
Is it possible to create multiple SRAM segments in SoC and then choose one of them or multiple at same time from *.dts file accordingly?
One of the application fields would be SRAM implementation in STM3H7 series with it's axi-sram, sram0, sram1, sram2... - each of them placed at own (not necessarily comsequtiv) memory address.
@galak what is your point view? How should we start adding new sram areas ?
There are my ideas listed below:
zephyr,sram in corresponding BSP *.dts file. This SRAM region is obligatory, since at least one SRAM region needed for functionality of Zephyr. The other regions could be defined as zephyr,sram1, zephyr,sram2 etc. in Zephyr device tree.sram0 or sramx as name by __attribute((section("sramx"))) for example.Thus each board can define it's memory as splitter pieces of SRAM's for Zephyr (as sram0) and additional special purposes. This is especially important for STM32H7, where multiple SRAM regions from different domains (D1, D2, D3) are presented and depending on usage can have impact on performance/implementation.
There are examples already like the nxp_lpc55S6x_common.dtsi in which we have multiple SRAM regions defined in the DTS. That is pretty straight forward to support. We can select which memory region to use via zephyr,sram & optionally (zephyr,code-partition).
the more complicated scenarios come into play if we want to utilize multiple regions and how that would work. Less from a DTS point of view, but more on how we interpret the data.
There are examples already like the nxp_lpc55S6x_common.dtsi in which we have multiple SRAM regions defined in the DTS. That is pretty straight forward to support. We can select which memory region to use via zephyr,sram & optionally (zephyr,code-partition).
the more complicated scenarios come into play if we want to utilize multiple regions and how that would work. Less from a DTS point of view, but more on how we interpret the data.
Does Zephyr already has documentation for zephyr,code-partition usage?
Does Zephyr already has documentation for
zephyr,code-partitionusage?
there's a little bit of docs at https://docs.zephyrproject.org/latest/reference/devicetree/index.html
@galak txs for feedback, I though this was blocked for some reason.
@galak What do you mean under data interpretation?
As a first step I would suggest just named sections in splitted SRAM regions for use as a named section in code.
Then they can be used as __attribute(section("sectionName")) in code.
@galak What do you mean under data interpretation?
As a first step I would suggest just named sections in splitted SRAM regions for use as a named section in code.
Then they can be used as__attribute(section("sectionName"))in code.
I just mean we already produce defines for the various memory regions.
If there are more than one SRAM region, how would you like to utilize them?
If there are more than one SRAM region, how would you like to utilize them?
Using scenario:
__attribute(section("my_sram_region_name_1")) for static variables.I just mean we already produce defines for the various memory regions.
Do I understand it right that my using scenario from above can be covered by produced defines?
@galak What are your ideas for more than one SRAM regions utilization?