-
Notifications
You must be signed in to change notification settings - Fork 972
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 XIP cache maintenance API (fixes #2005) #2013
Conversation
Also add a cache clean to hardware_flash implementations, to avoid losing pending writes on the subsequent invalidate.
pls add new library to |
…f XIP_CACHE assertions on FLASH
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 RP2350 - I've tested all the functions and they work as expected with PSRAM and Flash
@kilograham @Wren6991 If I try building the
If I replace the Let me know if this was the right fix, and I'll submit a PR (or of course you can fix it directly yourself if that's easier). EDIT: Ahh, and according to https://github.com/raspberrypi/pico-sdk/actions/runs/11936570350 this is failing the CI builds for GCC 6.2.1, GCC 6.3.1 and GCC 7.2.1 |
correct; we have |
Also add a cache clean to all
hardware_flash
implementations which flush the cache, to avoid losing cached PSRAM writes.This adds five new functions:
xip_cache_invalidate_all()
xip_cache_invalidate_range()
xip_cache_clean_all()
(no-op on RP2040)xip_cache_clean_range()
(no-op on RP2040)xip_cache_pin_range()
(unavailable on RP2040)It uses offsets (
- XIP_BASE
) instead of addresses, to be consistent with thehardware_flash
APIs. If anyone strongly disagrees then we should change it now before we're stuck with it.The library is unfortunately dependent on
hardware_sync
, just to get the barrier macros.