-
Notifications
You must be signed in to change notification settings - Fork 1.4k
drivers/mtd: introduce nvblk #16789
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
drivers/mtd: introduce nvblk #16789
Conversation
|
@acassis @xiaoxiang781216 I am having some problems in creating a |
the script in Makefile looks good to me:(. |
|
@xiaoxiang781216 first I would like to thank you for reviewing this PR so fast. Regarding the mtd_proxy approach I still have my doubts: when a flash wear levelling library like dhara or nvblk is inserted the direct link between the mtd and block device is broken. And I don't think it is possible to use direct mtd writing/reading and block writing/reading at the same time. Suppose you would like to I think the same problem might exist for nand flashes (but I haven't checked the ftl thoroughly). I remember that you made a remark that |
Yes, the direct mode isn't suitable for the advanced wear leveling algo like dhara/nvblk since both save the meta data into flash. The direct mode will destroy this critical information.
But since ftl doesn't save any meta data into flash, so the direct mode(skip buffer and erase) works well with it in some special user case.
That's because fs layer will add FTL wrapper on mtd device automatically when the user open /dev/mtdblockx, which equal to you call ftl_initialize in board file manually. |
After going through the |
you need remove all files under drivers/mtd/nvblk/ which isn't added to git when user issue |
@xiaoxiang781216 thanks for the reply. I am unsure if I understand you correct. Do you mean that it is required that |
|
yes, the file download/unzip and not add to git. |
|
@xiaoxiang781216 I think I have found the problem in the |
NVBLK provides a block device that operates on top of a non volatile
memory (as a mtd device) that enables wear levelling for non volatile
memory. It's operation is similar to the dhara wear levelling library,
but nvblk is meant to be used on smaller (nor, mram, rram) memory.
I am also the author and maintainer of the nvblk library.
A block device can be created during startup by using:
```
nvblk_initialize(0, mtd, CONFIG_MTD_NVBLK_DEFAULT_LBS,
CONFIG_MTD_NVBLK_DEFAULT_IOBS,
CONFIG_MTD_NVBLK_DEFAULT_SPEB);
```
and a fat filesystem on top of this as:
```
nsh> mkfatfs /dev/mtdblock0
nsh> mount -t vfat /dev/mtdblock0 /mnt
```
this fat filesystem can then be used:
```
nsh> echo "test" > /mnt/test.txt
nsh> cat test.txt
test
nsh>
```
Signed-off-by: Laczen JMS <laczenjms@gmail.com>
Add: - GD55 QSPI NOR Flash apache#15523 - nvblk apache#16789 - virtual NAND Flash device simulator apache#11806 Signed-off-by: simbit18 <simbit18@gmail.com>
Add: - GD55 QSPI NOR Flash apache#15523 - nvblk apache#16789 - virtual NAND Flash device simulator apache#11806 Signed-off-by: simbit18 <simbit18@gmail.com>
Summary
NVBLK provides a block device that operates on top of a non volatile memory (as a mtd device) that enables wear levelling for non volatile memory. It's operation is similar to the dhara wear levelling library, but nvblk is meant to be used on smaller (nor, mram, rram) memory.
I am also the author and maintainer of the nvblk library.
A block device can be created during startup by using:
and a fat filesystem on top of this as:
this fat filesystem can then be used:
Impact
Impact on users: none, new type of block device is provided for future use
Impact on build proces: none, new type of block device is provided for future use
Impact on hardware: none,
Impact on documentation:
none (a sample config will be added)sample defconfig added,Impact on security: none,
Impact on compatibility: none
Testing
The correct operation of this block device was verified on esp32-devkitc.
The block device was tested using NuttX vfat library and littlefs library.