The FCB has been strongly tied to 0xff erased flash devices and this
commit adds support for other erase values.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Previously flash_area structure was the parameter for the callback
function for transferring sector location info.
Now flash_sector is used so relevant flash_area is missing for
the callback.
This patch introduces structure fcb_entry_ctx which incorporates
entries' location and relevant flash area. It is used to pass complete
information to the callback. Additional pointer to the flash_area fcb
speeds up operations.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Prior to this commit: `struct fcb` contained a pointer to an array of
`struct flash_area`. Each entry in the array represented a flash sector
that the fcb comprised.
After commit: `struct fcb` contains a pointer to an array of `struct
flash_sector`, not `struct flash_area`.
Rationale: The FCB needs to know which sectors it occupies for its
rotate operation. However, the `flash_area` type is meant to represent
a collection of sectors, not a single sector. `struct flash_area`
contains information that the fcb does not need (e.g., area ID and
device ID). Furthermore, the flash_map API provides a means of
converting a flash area ID to an array of sectors
(`flash_area_get_sectors()`), but no way to convert to an array of
areas.
Signed-off-by: Christopher Collins <ccollins@apache.org>
Zephyr already supports NFFS as a storage layer, but it might
be a little bit too heavyweight for certain applications in
memory-restricted ICs.
This module is response for need of Lightweight flash storage
capability. FCB is ported form MyNewt as native zephyr module.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>