Skip to content
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

Switch RP2040 flash settings to nvm.toml #4446

Merged
merged 6 commits into from
Mar 23, 2021
Merged

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Mar 19, 2021

It generates a best case stage2 for all the possible flashes and will work with others of the same capability as well. Flash size is dynamically configured based on the flash.

This also moves TCM designated code and data into RAM so that it's space is freed in the XIP cache.

tannewt added 2 commits March 18, 2021 16:55
This switches stage2 to C and uses Jinja to change the C code based
on flash settings from https://github.com/adafruit/nvm.toml. It
produces the fastest settings for the given set of external flashes.
Flash size is no longer hard coded so switching flashes with similar
capabilities but different sizes should *just work*.

This PR also places "ITCM" code in RAM to save the XIP cache for
code execution. Further optimization is possible. A blink code.py
still requires a number of flash fetches every blink.

Fixes micropython#4041
@tannewt tannewt added enhancement rp2040 Raspberry Pi RP2040 labels Mar 19, 2021
@tannewt tannewt requested review from jepler and dhalbert March 19, 2021 22:27
@ladyada
Copy link
Member

ladyada commented Mar 19, 2021

want me to test feather rp2040 artifact? i could verify it uses QSPI?

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

A minor cleanup .. no testing performed.

ports/raspberrypi/Makefile Show resolved Hide resolved
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

I don't know some of technical details, but you are testing!

ports/raspberrypi/gen_stage2.py Outdated Show resolved Hide resolved
ports/raspberrypi/stage2.c.jinja Show resolved Hide resolved
ports/raspberrypi/supervisor/internal_flash.c Outdated Show resolved Hide resolved
ports/raspberrypi/supervisor/port.c Outdated Show resolved Hide resolved
@tannewt tannewt requested review from jepler and dhalbert March 22, 2021 22:31
@tannewt
Copy link
Member Author

tannewt commented Mar 23, 2021

Ok, @jepler and @dhalbert, this is passing. Please take another look.

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

Thanks for resolving the issue I raised.

Copy link
Collaborator

@dhalbert dhalbert 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! This is a really good step for flash management.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement rp2040 Raspberry Pi RP2040
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants