mtd: Implement BIOC_PARTINFO for all drivers
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
5a1de89370
commit
71269811ca
@ -212,6 +212,21 @@ static int cxd56_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->density / PAGE_SIZE;
|
||||
info->sectorsize = PAGE_SIZE;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -349,6 +349,22 @@ static int lc823450_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
geo->erasesize, geo->neraseblocks);
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nblocks;
|
||||
info->sectorsize = priv->blocksize;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_XIPBASE:
|
||||
finfo("BIOC_XIPBASE\n");
|
||||
ppv = (FAR void**)arg;
|
||||
|
@ -887,6 +887,28 @@ static int lpc43_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_SPIFI_SECTOR512
|
||||
info->numsectors = priv->nblocks <<
|
||||
(SPIFI_BLKSHIFT - SPIFI_512SHIFT);
|
||||
info->sectorsize = 512;
|
||||
#else
|
||||
info->numsectors = priv->nblocks;
|
||||
info->sectorsize = SPIFI_BLKSIZE;
|
||||
#endif
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -244,6 +244,22 @@ static int ameba_flash_ioctl(FAR struct mtd_dev_s *dev,
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
AMEBA_SECTOR_SIZE / AMEBA_PAGE_SIZE;
|
||||
info->sectorsize = AMEBA_PAGE_SIZE;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
|
@ -394,6 +394,22 @@ static int tiva_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = TIVA_VIRTUAL_NPAGES;
|
||||
info->sectorsize = TIVA_FLASH_PAGESIZE;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_XIPBASE:
|
||||
{
|
||||
FAR void **ppv = (FAR void**)arg;
|
||||
|
@ -287,14 +287,13 @@ int bl602_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
FAR struct bl602_spiflash_s *priv = MTD2PRIV(dev);
|
||||
FAR struct mtd_geometry_s *geo;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case MTDIOC_GEOMETRY:
|
||||
{
|
||||
finfo("cmd(0x%x) MTDIOC_GEOMETRY.\n", cmd);
|
||||
geo = (FAR struct mtd_geometry_s *)arg;
|
||||
FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg;
|
||||
if (geo)
|
||||
{
|
||||
geo->blocksize = SPIFLASH_BLOCKSIZE;
|
||||
@ -308,6 +307,22 @@ int bl602_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->config->flash_size /
|
||||
SPIFLASH_BLOCKSIZE;
|
||||
info->sectorsize = SPIFLASH_BLOCKSIZE;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
finfo("cmd(0x%x) not support.\n", cmd);
|
||||
|
@ -853,7 +853,6 @@ static int esp32c3_ioctl(struct mtd_dev_s *dev, int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
int ret = OK;
|
||||
struct mtd_geometry_s *geo;
|
||||
|
||||
finfo("cmd: %d \n", cmd);
|
||||
|
||||
@ -861,7 +860,7 @@ static int esp32c3_ioctl(struct mtd_dev_s *dev, int cmd,
|
||||
{
|
||||
case MTDIOC_GEOMETRY:
|
||||
{
|
||||
geo = (struct mtd_geometry_s *)arg;
|
||||
struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
|
||||
if (geo)
|
||||
{
|
||||
geo->blocksize = SPI_FLASH_BLK_SIZE;
|
||||
@ -876,9 +875,23 @@ static int esp32c3_ioctl(struct mtd_dev_s *dev, int cmd,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
struct partition_info_s *info = (struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = SPI_FLASH_SIZE / SPI_FLASH_BLK_SIZE;
|
||||
info->sectorsize = SPI_FLASH_BLK_SIZE;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_ERASESTATE:
|
||||
{
|
||||
FAR uint8_t *result = (FAR uint8_t *)arg;
|
||||
uint8_t *result = (uint8_t *)arg;
|
||||
*result = SPI_FLASH_ERASED_STATE;
|
||||
|
||||
ret = OK;
|
||||
|
@ -1909,7 +1909,6 @@ static int esp32_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
FAR struct esp32_spiflash_s *priv = MTD2PRIV(dev);
|
||||
FAR struct mtd_geometry_s *geo;
|
||||
|
||||
finfo("cmd: %d \n", cmd);
|
||||
|
||||
@ -1917,7 +1916,7 @@ static int esp32_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
{
|
||||
case MTDIOC_GEOMETRY:
|
||||
{
|
||||
geo = (FAR struct mtd_geometry_s *)arg;
|
||||
FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)arg;
|
||||
if (geo)
|
||||
{
|
||||
geo->blocksize = MTD_BLKSIZE(priv);
|
||||
@ -1931,6 +1930,22 @@ static int esp32_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = MTD_SIZE(priv) / MTD_BLKSIZE(priv);
|
||||
info->sectorsize = MTD_BLKSIZE(priv);
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_ERASESTATE:
|
||||
{
|
||||
FAR uint8_t *result = (FAR uint8_t *)arg;
|
||||
|
@ -578,6 +578,22 @@ static int imxrt_flexspi_nor_ioctl(FAR struct mtd_dev_s *dev,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = 32768; /* 8MB only */
|
||||
info->sectorsize = NOR_PAGE_SIZE;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -632,6 +632,28 @@ static int at24c_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#if CONFIG_AT24XX_MTD_BLOCKSIZE > AT24XX_PAGESIZE
|
||||
info->numsectors = (CONFIG_AT24XX_SIZE * 1024 / 8) /
|
||||
CONFIG_AT24XX_MTD_BLOCKSIZE;
|
||||
info->sectorsize = CONFIG_AT24XX_MTD_BLOCKSIZE;
|
||||
#else
|
||||
info->numsectors = priv->npages;
|
||||
info->sectorsize = priv->pagesize;
|
||||
#endif
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
ret = at24c_eraseall(priv);
|
||||
break;
|
||||
|
@ -639,6 +639,23 @@ static int at25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
/* Ordering Code Detail:
|
||||
*
|
||||
* AT 45DB 16 1 D – SS U
|
||||
* AT 45DB 16 1 D SS U
|
||||
* | | | | | | `- Device grade
|
||||
* | | | | | `- Package Option
|
||||
* | | | | `- Device revision
|
||||
@ -805,6 +805,22 @@ static int at45db_ioctl(FAR struct mtd_dev_s *mtd,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->npages;
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Take the lock so that we have exclusive access to the bus, then
|
||||
|
@ -436,6 +436,23 @@ static int filemtd_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nblocks *
|
||||
priv->erasesize / priv->blocksize;
|
||||
info->sectorsize = priv->blocksize;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -945,6 +945,23 @@ static int gd25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
GD25_SECTOR_SIZE / GD25_PAGE_SIZE;
|
||||
info->sectorsize = GD25_PAGE_SIZE;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -781,6 +781,23 @@ static int gd5f_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -954,6 +954,23 @@ static int is25xp_ioctl(FAR struct mtd_dev_s *dev,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -1036,6 +1036,23 @@ static int m25p_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -787,7 +787,7 @@ static int nand_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
{
|
||||
case MTDIOC_GEOMETRY:
|
||||
{
|
||||
struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
|
||||
FAR struct mtd_geometry_s *geo = (struct mtd_geometry_s *)arg;
|
||||
if (geo)
|
||||
{
|
||||
/* Populate the geometry structure with information needed to
|
||||
@ -806,6 +806,24 @@ static int nand_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = nandmodel_getdevblocks(model) *
|
||||
nandmodel_getbyteblocksize(model) /
|
||||
model->pagesize;
|
||||
info->sectorsize = model->pagesize;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -326,6 +326,23 @@ static int progmem_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = up_progmem_neraseblocks() <<
|
||||
(priv->ersshift - priv->blkshift);
|
||||
info->sectorsize = 1 << priv->blkshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_XIPBASE:
|
||||
{
|
||||
FAR void **ppv = (FAR void**)arg;
|
||||
|
@ -296,6 +296,22 @@ static int mtd_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->rwb.nblocks;
|
||||
info->sectorsize = priv->rwb.blocksize;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -1083,6 +1083,29 @@ static int mx25l_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_MX25L_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - MX25L_SECTOR512_SHIFT);
|
||||
info->sectorsize = 1 << MX25L_SECTOR512_SHIFT;
|
||||
#else
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
#endif
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -753,6 +753,29 @@ int mx25rxx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_MX25RXX_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - MX25RXX_SECTOR512_SHIFT);
|
||||
info->sectorsize = 1 << MX25RXX_SECTOR512_SHIFT;
|
||||
#else
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
#endif
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -811,6 +811,23 @@ static int mx35_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -1401,6 +1401,29 @@ static int n25qxxx_ioctl(FAR struct mtd_dev_s *dev,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_N25QXXX_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - N25QXXX_SECTOR512_SHIFT);
|
||||
info->sectorsize = 1 << N25QXXX_SECTOR512_SHIFT;
|
||||
#else
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
#endif
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -399,6 +399,24 @@ static int ram_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nblocks *
|
||||
CONFIG_RAMMTD_ERASESIZE /
|
||||
CONFIG_RAMMTD_BLOCKSIZE;
|
||||
info->sectorsize = CONFIG_RAMMTD_BLOCKSIZE;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
size_t size = priv->nblocks * CONFIG_RAMMTD_ERASESIZE;
|
||||
|
@ -954,6 +954,23 @@ static int ramtron_ioctl(FAR struct mtd_dev_s *dev,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
finfo("BULDERASE: Makes no sense in ramtron.\n");
|
||||
finfo("BULDERASE: Let's confirm operation as OK\n");
|
||||
|
@ -1447,6 +1447,29 @@ static int s25fl1_ioctl(FAR struct mtd_dev_s *dev,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_S25FL1_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - S25FL1_SECTOR512_SHIFT);
|
||||
info->sectorsize = 1 << S25FL1_SECTOR512_SHIFT;
|
||||
#else
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
#endif
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -543,6 +543,22 @@ static int s512_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->neblocks * priv->stdperblock;
|
||||
info->sectorsize = SECTOR_512;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -259,6 +259,22 @@ static int skel_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = 8192;
|
||||
info->sectorsize = 512;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_XIPBASE:
|
||||
{
|
||||
FAR void **ppv = (FAR void**)arg;
|
||||
|
@ -1195,6 +1195,28 @@ static int sst25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_SST25_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - SST25_SECTOR_SHIFT);
|
||||
info->sectorsize = 1 << SST25_SECTOR_SHIFT;
|
||||
#else
|
||||
info->numsectors = priv->nsectors;
|
||||
info->sectorsize = 1 << priv->sectorshift;
|
||||
#endif
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -893,6 +893,23 @@ static int sst25xx_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -898,6 +898,23 @@ static int sst26_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -320,12 +320,12 @@ static void sst39vf_writeseq(FAR const struct sst39vf_wrinfo_s *wrinfo,
|
||||
*
|
||||
* "Toggle Bits (DQ6 and DQ2). During the internal Program or Erase
|
||||
* operation, any consecutive attempts to read DQ6 will produce
|
||||
* alternating “1”s and “0”s, i.e., toggling between 1 and 0. When
|
||||
* alternating 1s and 0s, i.e., toggling between 1 and 0. When
|
||||
* the internal Program or Erase operation is completed, the DQ6 bit
|
||||
* will stop toggling. The device is then ready for the next operation.
|
||||
* For Sector-, Block-, or Chip-Erase, the toggle bit (DQ6) is valid
|
||||
* after the rising edge of sixth WE# (or CE#) pulse. DQ6 will be set to
|
||||
* “1” if a Read operation is attempted on an Erase-Suspended
|
||||
* 1 if a Read operation is attempted on an Erase-Suspended
|
||||
* Sector/Block. If Program operation is initiated in a sector/block not
|
||||
* selected in Erase-Suspend mode, DQ6 will toggle.
|
||||
*
|
||||
@ -377,7 +377,7 @@ static int sst39vf_waittoggle(FAR const struct sst39vf_wrinfo_s *wrinfo,
|
||||
* Erase the entire chip
|
||||
*
|
||||
* "The SST39VF160x/320x provide a Chip-Erase operation, which allows the
|
||||
* user to erase the entire memory array to the “1” state. This is
|
||||
* user to erase the entire memory array to the 1 state. This is
|
||||
* useful when the entire device must be quickly erased. The Chip-Erase
|
||||
* operation is initiated by executing a six-byte command sequence with
|
||||
* Chip-Erase command (10H) at address 5555H in the last byte sequence.
|
||||
@ -534,7 +534,7 @@ static int sst39vf_sectorerase(FAR struct sst39vf_dev_s *priv,
|
||||
* CE# or WE#, whichever occurs first. The third step is the internal
|
||||
* Program operation which is initiated after the rising edge of the
|
||||
* fourth WE# or CE#, whichever occurs first. The Program operation, once
|
||||
* initiated, will be completed within 10 µs. .... During the Program
|
||||
* initiated, will be completed within 10s. .... During the Program
|
||||
* operation, the only valid reads are Data# Polling and Toggle Bit.
|
||||
* During the internal Program operation, the host is free to perform
|
||||
* additional tasks. Any commands issued during the internal Program
|
||||
@ -736,6 +736,22 @@ static int sst39vf_ioctl(FAR struct mtd_dev_s *dev,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->chip->nsectors;
|
||||
info->sectorsize = priv->chip->sectorsize;
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire chip */
|
||||
|
@ -1323,6 +1323,29 @@ static int w25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_W25_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(W25_SECTOR_SHIFT - W25_SECTOR512_SHIFT);
|
||||
info->sectorsize = 1 << W25_SECTOR512_SHIFT;
|
||||
#else
|
||||
info->numsectors = priv->nsectors *
|
||||
W25_SECTOR_SIZE / W25_PAGE_SIZE;
|
||||
info->sectorsize = W25_PAGE_SIZE;
|
||||
#endif
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
@ -1407,6 +1407,29 @@ static int w25qxxxjv_ioctl(FAR struct mtd_dev_s *dev,
|
||||
}
|
||||
break;
|
||||
|
||||
case BIOC_PARTINFO:
|
||||
{
|
||||
FAR struct partition_info_s *info =
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_W25QXXXJV_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - W25QXXXJV_SECTOR512_SHIFT);
|
||||
info->sectorsize = 1 << W25QXXXJV_SECTOR512_SHIFT;
|
||||
#else
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
#endif
|
||||
info->startsector = 0;
|
||||
info->parent[0] = '\0';
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MTDIOC_BULKERASE:
|
||||
{
|
||||
/* Erase the entire device */
|
||||
|
Loading…
Reference in New Issue
Block a user