-
Notifications
You must be signed in to change notification settings - Fork 8.3k
STM32H745 SRAM Sections Definition #30302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32H745 SRAM Sections Definition #30302
Conversation
69f3100 to
7eceaf3
Compare
gmarull
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes do not follow Linux Kernel docs. In their model, SRAM entries are children with relative addresses, I can't see this structure here neither updated bindings. A use case should also be provided.
154990d to
771d41e
Compare
|
@gmarull Thank you for your review. I've prepared changes. Please take a look.
Fixed. Please see
You cane take a look at But generally following use case are possible now:
Other use cases are similar to 1 and 2. Both were tested with my nucleo_h745zi_q board and civetweb/websocket_server sample and working fine for me. |
771d41e to
2cad62a
Compare
ABOSTM
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
For now i'd suggest carving out the sram region for ethernet and putting a phandle property in the ethernet node that references that sram region. As far as the other regions go, are you trying to treat them as on large system memory pool? If so, for now we have to fake that out in DTS. |
2cad62a to
49faa34
Compare
|
@galak Thak you for your review
I would prefer to wait with merge instead, untill we're done wit MPU SRAM #30403 configuration for ethernet. I will be able update this PR continuously.
Yes, the purpose of this PR to give access to all SRAM regions of the Zephyr application, if it needs it. Do you have an example, how to fake it out in DT? |
a48eda8 to
40b4246
Compare
80b7d41 to
42c832f
Compare
42c832f to
6468968
Compare
6468968 to
614ca39
Compare
|
@erwango Can you confirm this memory model works on your board (for example with hello_world and/or civetweb webscoket server)? |
|
@gmarull Please review |
f9904b8 to
c95aebe
Compare
dts/arm/st/h7/stm32h745.dtsi
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmio-sram compatible does not specify ranges as a property nor child bindings (here we have a parent and a child with the same compatible). I think this needs more discussion as well as proper support in Zephyr, not just definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmio-sramcompatible does not specifyrangesas a property nor child bindings (here we have a parent and a child with the same compatible). I think this needs more discussion as well as proper support in Zephyr, not just definitions.
Where can it be better discussed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nukersson #dev-review meeting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need to have these as one node v separate nodes for each SRAM ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need to have these as one node v separate nodes for each SRAM ?
With this approach I am able to use all SRAM sections of H7 together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My initial feeling is that I'd suggest that be done as a board specific setting of CONFIG_SRAM_SIZE/CONFIG_SRAM_BASE_ADDRESS. I'm concerned about the precedence set of describing multiple SRAM regions this way and what assumptions one can really make.
What are you pointing zephyr,sram at in the case you are using all the SRAM sections together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My initial feeling is that I'd suggest that be done as a board specific setting of CONFIG_SRAM_SIZE/CONFIG_SRAM_BASE_ADDRESS. I'm concerned about the precedence set of describing multiple SRAM regions this way and what assumptions one can really make.
What are you pointing
zephyr,sramat in the case you are using all the SRAM sections together?
Compiling samples/hello_world with zephyr,sram = &axi_sram; gives:
[129/136] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region Used Size Region Size %age Used
FLASH: 16580 B 1 MB 1.58%
DTCM: 0 GB 128 KB 0.00%
SRAM: 4512 B 512 KB 0.86%
IDT_LIST: 120 B 2 KB 5.86%
[136/136] Linking C executable zephyr/zephyr.elf
and with zephyr,sram = &sram0; gives:
[129/136] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region Used Size Region Size %age Used
FLASH: 16580 B 1 MB 1.58%
DTCM: 0 GB 128 KB 0.00%
SRAM: 4512 B 864 KB 0.51%
IDT_LIST: 120 B 2 KB 5.86%
[136/136] Linking C executable zephyr/zephyr.elf
Especially see difference in Region Size of SRAM section.
Thus my approach still allows using of each separate SRAM section within the whole SRAM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
I still see this as an application specific need and not a generic solution. It just happens that all the SRAM regions are contiguous so things work out that way.
In addition, the way you are using ranges + reg is technically in violation of DTS. If you have a range the node that has that shouldn't have a reg that overlaps that range region. Since you are effectively claiming 2 different device nodes for the same reg region than.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I see your point. Thank you very much. But how would you put different memory banks of some SoC with non-consequtive memory addresses together? Would you use device-tree or linker skript?
The application would be best utilization of all memory banks of some SoC like stm32h743/5
c0d323a to
ca8e05f
Compare
galak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current solution is not generic enough. Makes assumptions about SRAM regions being contiguous which may not be valid on all platforms with multiple SRAM regions.
Would rather see something on the linker side that tries to take all the 'mmio-sram' regions from DTS and coalesce them. Or support multiple different memory regions in the core of Zephyr.
define only single sram0 define sram sections within sram0 Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
change choosen sram name Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
change choosen sram name to axi_sram Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
change choosen sram name Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
change choosen sram name to axi_sram Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
ca8e05f to
933a882
Compare
|
Closed since not generic |
Define multiple SRAM sections within
sram0. With this PR each stm32h745 based board can use either wholesram0(choose zephyr,sram = &sram0;) or only parts of it (choose zephyr,sram = &ahb_sram1; for example).This step is necessary toward whole SRAM utilization for projects.
Same behavior for SRAM realized in linux kernel.