You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bluetooth: Mesh: decouple blob_io_flash from internal flash
This fully decouples blob_io_flash from specific flash device details,
by not reading the write block size from a hard-coded device tree node,
instead pulling this from the actual flash device used.
The block write routine has been updated to be more generic and fix a
few bugs:
* The write buffer is now sized based on a KConfig option instead of
basing it off the device tree - this makes the module usable with
any flash device, not just the internal memory. The configured value
is checked during initialization, to ensure that the configured size
will fit the write block size required by the device passed to the
init function.
* The erase value used to fill the buffer when using a device with
explicit erase is now pulled from the flash parameters instead of
being hard-coded to `0xff`.
* An additional write block sized piece of buffer is allocated - the
previous buffer sizing with rounding up only worked if
`BLOB_RX_CHUNK_SIZE % WRITE_BLOCK_SIZE` was 0 or 1 (which
coincidentally worked in all testing because the chunk size defaults
to 161, and for internal flash w/write block size of 4,
`161 % 4 == 1`).
* The choice of whether to just write the chunk as-is or to
write-block align it is now based on the erase cap pulled from the
flash parameters, instead of checking the type of memory in the SOC.
This means the module dos _not_ currently support the case where
memory has to be written write-block aligned, but the memory does
_not_ use explicit erase. It uses a trick of filling the write
buffer with the erase value to avoid overwriting existing chunks,
which will not work in this case. This trick is required to support
random ordered chunks while still writing write-block aligned.
* The code has been cleaned up a bit in general.
Signed-off-by: Ludvig Jordet <[email protected]>
0 commit comments