Commit Graph

4 Commits

Author SHA1 Message Date
Jason Zhu 22dccd1122 mtd: mtd_blk: parse the block part info to mtd part info
Change-Id: Ib4117bf22d1c91a5b2d69a45b6584e8d0cb47021
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-24 16:17:39 +08:00
Jason Zhu e6482de4e5 mtd: mtd_blk: get desc->product by mtd->name
Change-Id: I9c089032db87de20fa9a57a9637247df8fac2fbb
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-21 15:12:58 +08:00
Jason Zhu f1892190de mtd: add desc->lba to mtd block device
The desc->lba is based on mtd->size: desc->lba = mtd->size >> 9;

If the mtd storage is spi nand or nand flash, reserve 4 blocks
for BBT(Bad Block Table). Then desc->lba is
desc->lba = (mtd->size >> 9) - (mtd->erasesize >> 9) * 4;

Change-Id: I70702623895fe05cec614c4c3ca5f3f6c41d26ca
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-18 18:03:33 +08:00
Jason Zhu 054229abb7 mtd: support mtd block model
Attach the mtd driver to block device, then we can call common interface
(blk_dread & blk_dwrite) to operate storage in application layer.

Usage:
Open CONFIG_MTD_BLK & CONFIG_MTD.

Change-Id: I47a969322e2d20c12d46898bdc88f4104e1a15bf
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-05 14:47:56 +08:00