drivrs/mtd/filemtd.c: add block device MTD interface. Block MTD interface allows using block device directly as MTD instead of having to use file-system in between. NOTE that this provides the opposite capability of FTL which will let you use an MTD interface directly as a block device.

This commit is contained in:
Jussi Kivilinna
2017-10-19 09:53:41 -06:00
committed by Gregory Nutt
parent 0ef127e273
commit 5ef548677a
2 changed files with 108 additions and 43 deletions
+23 -1
View File
@@ -560,6 +560,28 @@ FAR struct mtd_dev_s *mx25rxx_initialize(FAR struct qspi_dev_s *qspi,
FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi,
bool unprotect);
/****************************************************************************
* Name: blockmtd_initialize
*
* Description:
* Create a block device backed a MTD device.
*
****************************************************************************/
FAR struct mtd_dev_s *blockmtd_initialize(FAR const char *path, size_t offset,
size_t mtdlen, int16_t sectsize,
int32_t erasesize);
/****************************************************************************
* Name: blockmtd_teardown
*
* Description:
* Tear down a blockmtd device.
*
****************************************************************************/
void blockmtd_teardown(FAR struct mtd_dev_s *dev);
/****************************************************************************
* Name: filemtd_initialize
*
@@ -569,7 +591,7 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi,
****************************************************************************/
FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset,
int16_t sectsize, int32_t erasesize);
int16_t sectsize, int32_t erasesize);
/****************************************************************************
* Name: filemtd_teardown