-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
Feature: mass erase target API #1619
Feature: mass erase target API #1619
Conversation
d0595a9
to
49b8138
Compare
49b8138
to
a403c4b
Compare
Apologies this PR got a bit forgotten about.. If you could please rebase it on |
235fc7e
to
971b340
Compare
@dragonmux Managed to rebase this, sorry for the MIA... There have been quite a lot of changes since this was first submitted, and though I got things to build and it appears most changes should not affect it I could not meaningfully test things, so here be dragons. |
target_flash_mass_erase abstracts the implementation details of the target mass erase
Move the scope of the print progress timeout creation to the common target API
target_enter_flash_mode_stub is a No-op stub for use in the target->enter_flash_mode API where the default behaviour of resetting the target is undesirable
…outine is available Targets that don't provide a dedicated mass erase routine will have it's flash erased block by block when the user requests a mass erase
Mass erase now by default manually erases target flash block by block when no specialized routine is available, the removed mass erase routine duplicates said functionality
Mass erase now by default manually erases target flash block by block when no specialized routine is available, this mass erase routine duplicates said functionality
Mass erase now by default manually erases target flash block by block when no specialized routine is available, this mass erase routine duplicates said functionality
This routine, like the other flash routines is called in between a flash prepare and flash done, with the FLASH_OPERATION_MASS_ERASE. It is meant to be used where the flash controller implements functionality to totally erase the relevant flash, and nothing else, mainly targeted at targets with multiple flash banks and funcionality to erase the banks wholly, individually
All targets that add a spi flash will have mass erase routines by default without te need to explicitly provide them, this also is more correct for scope and fixes the assumption that the first target flash registred is a spi flash
Using the buffer allocation state as a means to determine the flash operation is undefined and not guaranteed to work in the future, use proper API
When an erase is requested that would result in a complete erase of a flash and the mass erase routine is provided, use it as a speed optimization
This is a very important restriction to ensure the method is safe to use during normal load operations
9afb1f9
to
5627de9
Compare
7d1aadc
to
3576cdf
Compare
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.
All LGTM, merging. Thank you for the contribution and this huge clean-up!
Detailed description
This PR is a refactor of the target mass erase API, it can be summed up in:
Target is placed in "flash mode" (enter/exit flash mode routine) before a mass erase, the flash API is used when a dedicated mass erase routine is not provided
when a specialized mass erase routine is not provided the mass erase consists of erasing all the target flash' block by block via the target flash API
This is not yet thoroughly tested, and due to the lack of targets at my disposal, it likely won't be adequately tested by just me.
Your checklist for this pull request
make PROBE_HOST=native
)make PROBE_HOST=hosted
)Closing issues