-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Delay relocation of data/bss init after MEMC init is completed #68888
Conversation
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
I guess this would fix #43555 |
@talih0 Can you fix compliance issue reported by automated checks ? |
depends on ARCH_HAS_CODE_DATA_RELOCATION | ||
depends on CODE_DATA_RELOCATION |
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.
CODE_DATA_RELOCATION
already depends on ARCH_HAS_CODE_DATA_RELOCATION
, no need to add it again.
depends on ARCH_HAS_CODE_DATA_RELOCATION | |
depends on CODE_DATA_RELOCATION | |
depends on CODE_DATA_RELOCATION |
I wonder if we should have some form of The reason I ask is that if we simply blindly copy data into memory regions that may be set up by MEMC devices, we run the risk of crashing the chip. I have seen this with iMX.RT parts (which use external SDRAM setup by the bootloader). In this case, the chip will simply crash at initialization since the SRAM region is not accessible. I'm not sure how we would best handle this (perhaps simply triggering a fault). I just would like to avoid the case where an external memory device fails to initialize, and the application simply crashes rather than printing some form of error message |
Is cache handled at this point? I see most of cache enables are in the level of |
There is another issue I just thought about. Since stimer init call is in |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Currently, when relocating to external SRAM regions via MEMC drivers, the relocation/zero initialization is done before the MEMC drivers are initialized.
See issue #68884
This patch delays initialization after PRE_KERNEL_1 level.
The initialization is only delayed on devicetree memory regions with delay-relocation property set.
Note, MEMC drivers (i.e. Atmel SAM SMC) use POST_KERNEL level, so their initialization levels would have to be updated.