NFTL Disk Driver#100858
Conversation
|
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 added project Note: This message is automatically posted and updated by the Manifest GitHub Action. |
5459c50 to
246fb9d
Compare
Add extended operations to the flash API to support marking blocks as bad and checking if a block is bad. This is necessary for NAND flash devices, which can have bad blocks that need to be managed. Signed-off-by: Pascal Linder <pascal.linder@zuehlke.com> Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
NAND flash translation layers require the flash extended operations API for bad block management. Add it here without implementation to test an FTL on the flash simulator. Signed-off-by: Pascal Linder <pascal.linder@zuehlke.com>
|
@de-nordic can the |
| #define FF_VOLUME_STRS \ | ||
| DT_FOREACH_STATUS_OKAY(zephyr_flash_disk, _FF_DISK_NAME) \ | ||
| DT_FOREACH_STATUS_OKAY(zephyr_ram_disk, _FF_DISK_NAME) \ | ||
| DT_FOREACH_STATUS_OKAY(zephyr_sdmmc_disk, _FF_DISK_NAME) \ | ||
| DT_FOREACH_STATUS_OKAY(zephyr_mmc_disk, _FF_DISK_NAME) \ | ||
| DT_FOREACH_STATUS_OKAY(st_stm32_sdmmc, _FF_DISK_NAME) | ||
| #define FF_VOLUME_STRS \ | ||
| DT_FOREACH_STATUS_OKAY(zephyr_flash_disk, _FF_DISK_NAME) \ | ||
| DT_FOREACH_STATUS_OKAY(zephyr_ram_disk, _FF_DISK_NAME) \ | ||
| DT_FOREACH_STATUS_OKAY(zephyr_sdmmc_disk, _FF_DISK_NAME) \ | ||
| DT_FOREACH_STATUS_OKAY(zephyr_mmc_disk, _FF_DISK_NAME) \ | ||
| DT_FOREACH_STATUS_OKAY(st_stm32_sdmmc, _FF_DISK_NAME) \ | ||
| DT_FOREACH_STATUS_OKAY(zephyr_ftl_dhara, _FF_DISK_NAME) |
There was a problem hiding this comment.
stray changes, have nothing to do with "modules: dhara: Implement Dhara disk driver as Zephyr module"
There was a problem hiding this comment.
I have split them off into separate commit.
| buffer-size: | ||
| type: int | ||
| required: true | ||
| description: | | ||
| Buffer size in bytes for the FTL driver. Must be equal or greater than the page size of the | ||
| backing flash. | ||
|
|
||
| gc-ratio: | ||
| type: int | ||
| default: 15 | ||
| description: | | ||
| Garbage collection ratio for the FTL driver. This is the ratio of garbage collection | ||
| operations to real writes when automatic collection is active. Smaller values lead to faster | ||
| and more predictable input/output at the expense of capacity. |
There was a problem hiding this comment.
Both properties sound like they are software configurations. Do they need to be configurable per instance, or can they be Kconfig options?
There was a problem hiding this comment.
buffer-size is somewhat hardware related as it has to be at least the size of a page of the flash. So, if one has multiple flashes with different page sizes and this is a KConfig one has to set it to the largest and would ovetallocate for the smaller flash. This was the motivation to have it in DT. zephyr,flash-disk has similar properties with cache-size and sector-size. I have no strong opinion here, if a KConfig is preferable, I can change it.
There was a problem hiding this comment.
What about gc-ratio does it make sense to be configurable per driver instance?
There was a problem hiding this comment.
I have switched gc-ratio to a KConfig. The GC ratio trades off write amplification for available capacity. The capacity for rewritable blocks is the number of pages times 1/(ratio+1), and the write amplification factor is (ratio+1). I don't think this needs to be configured per instance.
Zephyr has currently no flash translation layer implemented. This commit adds the basic possibility to use Dhara as FTL in Zephyr. It is implemented as disk driver that can be placed between a filesystem and a flash driver. Signed-off-by: Pascal Linder <pascal.linder@zuehlke.com> Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Add disk names for zephyr,ftl-dhara disks to FF_VOLUME_STRS, so that they are available for mounting. Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Add testcase and corresponding overlay for native_sim to test the FTL (Flash Translation Layer) disk driver. Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
|
|
@jfischer-no Please take another look, all comments have been addressed |
|
@tpambor I now added the "Override required" label since this must be merged with override due to a new module being added. |



Zephyr has currently no flash translation layer implemented. This pull request adds the basic possibility to use Dhara as FTL in Zephyr. It is implemented as disk driver that can be placed between a filesystem and a flash driver. The FTL uses API extensions for bad block management, which are also faked on the flash simulator to facilitate tests.
The Dhara repository shall be moved to the Zephyr organisation as soon as the module is ready for that (#99908, #100834).