-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add Memory scrubbing for ECC #239
Conversation
*/ | ||
.global __metal_before_start | ||
.type __metal_before_start, @function | ||
__metal_before_start: |
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.
you'll need to save and restore 'ra' across this function.
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.
This get called using jal though. It is a single instruction to jump and save return address: jump and link (jal)
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.
Your general approach looks good; we'll want to make this optional as it will have a pretty significant impact on startup time.
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.
This looks fine to me.
As far as startup cost is concerned, maybe disabling this could be as simple as the linker script generator setting the start
and end
symbols equal to each other when it knows this isn't necessary?
Making the start = end would be a quick work-around. I did make the function a weak type, so user may include their empty function. But have not tested that yet |
If we can get to compiling freedom-metal for each project, instead of creating a library, then we can put conditional compilation based on project configuration which will make things like this really easy. |
Update to use metal-platform.h (bare header)
ea55db5
to
4c221ae
Compare
Scrub memory based of what available in the lds files, ie
And have scrub.S implement the __metal_before_start() which call metal_memory_scrub()
User/Customer have the option to override with their own if desire.
The intention is for metal_init() to enable the BEU and disable ECC suppression