-
-
Notifications
You must be signed in to change notification settings - Fork 7
Description
At the moment, drv/block_device is the platform specific implementation of the disk I/O operations and sys/storage manages data and decides whether to write on shutdown.
We can re-balance this to give drv/block_device more control over the initial read and final write of the "ram disk", but keep the data logic in sys/storage. This has a few benefits:
- We can move the logic for
pbsys_storage_update_checksumto the platform specific driver, which is really a much better place. So this field would not be in the data map anymore:
#if PBSYS_CONFIG_STORAGE_OVERLAPS_BOOTLOADER_CHECKSUM
/**
* Checksum complement to satisfy bootloader requirements. This ensures
* that words in the scanned area still add up to precisely 0 after user
* data was written.
*/
volatile uint32_t checksum_complement;
#endif-
When the logic for handling the initial read resides in
drv, we can do it before theadcdriver is started, which is needed for EV3 in [EV3 - help wanted]: Implement SPI flash block device driver #2247. They can run sequentially, both asynchronously alongside the other drivers being initialized. We need theadcfor the intermediatepbiolayer, so we can't delay theadcuntil aftersyscompletes initializing. -
This has the added benefit of having storage ready before
pbioandsysbegins. This means that some of its modules like the UI don't need to await user settings to become ready. They'll just be available directly.