Replace all occurrences of vdbg with vinfo

This commit is contained in:
Gregory Nutt
2016-06-11 11:59:51 -06:00
parent 3a74a438d9
commit fc3540cffe
845 changed files with 5817 additions and 5817 deletions
+11 -11
View File
@@ -302,7 +302,7 @@ static ssize_t at24c_read_internal(FAR struct at24c_dev_s *priv, off_t offset,
uint8_t buf[AT24XX_ADDRSIZE];
uint16_t at24addr;
fvdbg("offset: %lu nbytes: %lu address: %02x\n",
finfo("offset: %lu nbytes: %lu address: %02x\n",
(unsigned long)offset, (unsigned long)nbytes, address);
/* "Random Read: A Random Read requires a dummy byte write sequence to load in the
@@ -329,7 +329,7 @@ static ssize_t at24c_read_internal(FAR struct at24c_dev_s *priv, off_t offset,
while (at24c_i2c_write(priv, at24addr, buf, AT24XX_ADDRSIZE) < 0)
{
fvdbg("wait\n");
finfo("wait\n");
usleep(1000);
}
@@ -356,7 +356,7 @@ static ssize_t at24c_bread(FAR struct mtd_dev_s *dev, off_t startblock,
nblocks *= (CONFIG_AT24XX_MTD_BLOCKSIZE / AT24XX_PAGESIZE);
#endif
fvdbg("startblock: %08lx nblocks: %lu\n",
finfo("startblock: %08lx nblocks: %lu\n",
(unsigned long)startblock, (unsigned long)nblocks);
if (startblock >= priv->npages)
@@ -427,7 +427,7 @@ static ssize_t at24c_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t
nblocks = priv->npages - startblock;
}
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
while (blocksleft-- > 0)
{
@@ -445,7 +445,7 @@ static ssize_t at24c_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t
while (at24c_i2c_write(priv, at24addr, buf, AT24XX_ADDRSIZE) < 0)
{
fvdbg("wait\n");
finfo("wait\n");
usleep(1000);
}
@@ -474,7 +474,7 @@ static ssize_t at24c_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes
size_t memsize;
uint8_t addr;
fvdbg("offset: %lu nbytes: %lu\n", (unsigned long)offset, (unsigned long)nbytes);
finfo("offset: %lu nbytes: %lu\n", (unsigned long)offset, (unsigned long)nbytes);
/* Don't permit reads beyond the end of the memory region */
@@ -520,7 +520,7 @@ static int at24c_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct at24c_dev_s *priv = (FAR struct at24c_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -561,7 +561,7 @@ static int at24c_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
#endif
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -610,7 +610,7 @@ FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev)
FAR struct at24c_dev_s *priv;
#ifdef CONFIG_AT24XX_MULTI
fvdbg("dev: %p address: %02x\n", dev, address);
finfo("dev: %p address: %02x\n", dev, address);
/* Allocate a state structure (we allocate the structure instead of using
* a fixed, static allocation so that we can handle multiple FLASH devices.
@@ -627,7 +627,7 @@ FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev)
}
#else
fvdbg("dev: %p\n", dev);
finfo("dev: %p\n", dev);
/* If only a signal AT24 part is supported then a statically allocated state
* structure is used.
@@ -669,7 +669,7 @@ FAR struct mtd_dev_s *at24c_initialize(FAR struct i2c_master_s *dev)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
}
+20 -20
View File
@@ -213,7 +213,7 @@ static inline int at25_readid(struct at25_dev_s *priv)
uint16_t manufacturer;
uint16_t memory;
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Lock the SPI bus, configure the bus, and select this FLASH part. */
@@ -231,7 +231,7 @@ static inline int at25_readid(struct at25_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
at25_unlock(priv->dev);
fvdbg("manufacturer: %02x memory: %02x\n",
finfo("manufacturer: %02x memory: %02x\n",
manufacturer, memory);
/* Check for a valid manufacturer and memory type */
@@ -295,7 +295,7 @@ static void at25_waitwritecomplete(struct at25_dev_s *priv)
fdbg("ERROR: Write error, status: 0x%02x\n", status);
}
fvdbg("Complete, status: 0x%02x\n", status);
finfo("Complete, status: 0x%02x\n", status);
}
/************************************************************************************
@@ -307,7 +307,7 @@ static void at25_writeenable(struct at25_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, true);
(void)SPI_SEND(priv->dev, AT25_WREN);
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Enabled\n");
finfo("Enabled\n");
}
/************************************************************************************
@@ -318,7 +318,7 @@ static inline void at25_sectorerase(struct at25_dev_s *priv, off_t sector)
{
off_t offset = sector << priv->sectorshift;
fvdbg("sector: %08lx\n", (long)sector);
finfo("sector: %08lx\n", (long)sector);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -352,7 +352,7 @@ static inline void at25_sectorerase(struct at25_dev_s *priv, off_t sector)
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Erased\n");
finfo("Erased\n");
}
/************************************************************************************
@@ -361,7 +361,7 @@ static inline void at25_sectorerase(struct at25_dev_s *priv, off_t sector)
static inline int at25_bulkerase(struct at25_dev_s *priv)
{
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -386,7 +386,7 @@ static inline int at25_bulkerase(struct at25_dev_s *priv)
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Return: OK\n");
finfo("Return: OK\n");
return OK;
}
@@ -399,7 +399,7 @@ static inline void at25_pagewrite(struct at25_dev_s *priv, FAR const uint8_t *bu
{
off_t offset = page << 8;
fvdbg("page: %08lx offset: %08lx\n", (long)page, (long)offset);
finfo("page: %08lx offset: %08lx\n", (long)page, (long)offset);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -434,7 +434,7 @@ static inline void at25_pagewrite(struct at25_dev_s *priv, FAR const uint8_t *bu
/* Deselect the FLASH: Chip Select high */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Written\n");
finfo("Written\n");
}
/************************************************************************************
@@ -446,7 +446,7 @@ static int at25_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblock
FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev;
size_t blocksleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the SPI bus until we complete the erase */
@@ -473,7 +473,7 @@ static ssize_t at25_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nb
FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev;
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -496,7 +496,7 @@ static ssize_t at25_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t n
FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev;
size_t blocksleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the SPI bus and write each page to FLASH */
@@ -522,7 +522,7 @@ static ssize_t at25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
{
FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -556,7 +556,7 @@ static ssize_t at25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
at25_unlock(priv->dev);
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -569,7 +569,7 @@ static int at25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct at25_dev_s *priv = (FAR struct at25_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -592,7 +592,7 @@ static int at25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
geo->neraseblocks = priv->nsectors;
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -614,7 +614,7 @@ static int at25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -637,7 +637,7 @@ FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev)
FAR struct at25_dev_s *priv;
int ret;
fvdbg("dev: %p\n", dev);
finfo("dev: %p\n", dev);
/* Allocate a state structure (we allocate the structure instead of using
* a fixed, static allocation so that we can handle multiple FLASH devices.
@@ -695,6 +695,6 @@ FAR struct mtd_dev_s *at25_initialize(FAR struct spi_dev_s *dev)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
}
+16 -16
View File
@@ -341,7 +341,7 @@ static inline int at45db_rdid(FAR struct at45db_dev_s *priv)
uint8_t capacity;
uint8_t devid[3];
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Configure the bus, and select this FLASH part. (The caller should already have
* locked the bus for exclusive access)
@@ -360,7 +360,7 @@ static inline int at45db_rdid(FAR struct at45db_dev_s *priv)
SPI_SELECT(priv->spi, SPIDEV_FLASH, false);
fvdbg("manufacturer: %02x devid1: %02x devid2: %02x\n",
finfo("manufacturer: %02x devid1: %02x devid2: %02x\n",
devid[0], devid[1], devid[2]);
/* Check for a valid manufacturer and memory family */
@@ -474,7 +474,7 @@ static inline void at45db_pgerase(FAR struct at45db_dev_s *priv, off_t sector)
uint8_t erasecmd[4];
off_t offset = sector << priv->pageshift;
fvdbg("sector: %08lx\n", (long)sector);
finfo("sector: %08lx\n", (long)sector);
/* Higher performance write logic: We leave the chip busy after write and erase
* operations. This improves write and erase performance because we do not have
@@ -514,7 +514,7 @@ static inline void at45db_pgerase(FAR struct at45db_dev_s *priv, off_t sector)
#ifndef CONFIG_AT45DB_PREWAIT
at45db_waitbusy(priv);
#endif
fvdbg("Erased\n");
finfo("Erased\n");
}
/************************************************************************************
@@ -523,7 +523,7 @@ static inline void at45db_pgerase(FAR struct at45db_dev_s *priv, off_t sector)
static inline int at32db_chiperase(FAR struct at45db_dev_s *priv)
{
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Higher performance write logic: We leave the chip busy after write and erase
* operations. This improves write and erase performance because we do not have
@@ -569,7 +569,7 @@ static inline void at45db_pgwrite(FAR struct at45db_dev_s *priv,
uint8_t wrcmd [4];
off_t offset = page << priv->pageshift;
fvdbg("page: %08lx offset: %08lx\n", (long)page, (long)offset);
finfo("page: %08lx offset: %08lx\n", (long)page, (long)offset);
/* We assume that sectors are not write protected */
@@ -601,7 +601,7 @@ static inline void at45db_pgwrite(FAR struct at45db_dev_s *priv,
#ifndef CONFIG_AT45DB_PREWAIT
at45db_waitbusy(priv);
#endif
fvdbg("Written\n");
finfo("Written\n");
}
/************************************************************************************
@@ -613,7 +613,7 @@ static int at45db_erase(FAR struct mtd_dev_s *mtd, off_t startblock, size_t nblo
FAR struct at45db_dev_s *priv = (FAR struct at45db_dev_s *)mtd;
size_t pgsleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Take the lock so that we have exclusive access to the bus, then power up the
* FLASH device.
@@ -669,7 +669,7 @@ static ssize_t at45db_bwrite(FAR struct mtd_dev_s *mtd, off_t startblock,
FAR struct at45db_dev_s *priv = (FAR struct at45db_dev_s *)mtd;
size_t pgsleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Take the lock so that we have exclusive access to the bus, then power up the
* FLASH device.
@@ -703,7 +703,7 @@ static ssize_t at45db_read(FAR struct mtd_dev_s *mtd, off_t offset, size_t nbyte
FAR struct at45db_dev_s *priv = (FAR struct at45db_dev_s *)mtd;
uint8_t rdcmd [5];
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Set up for the read */
@@ -741,7 +741,7 @@ static ssize_t at45db_read(FAR struct mtd_dev_s *mtd, off_t offset, size_t nbyte
at45db_pwrdown(priv);
at45db_unlock(priv);
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -754,7 +754,7 @@ static int at45db_ioctl(FAR struct mtd_dev_s *mtd, int cmd, unsigned long arg)
FAR struct at45db_dev_s *priv = (FAR struct at45db_dev_s *)mtd;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -777,7 +777,7 @@ static int at45db_ioctl(FAR struct mtd_dev_s *mtd, int cmd, unsigned long arg)
geo->neraseblocks = priv->npages;
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -806,7 +806,7 @@ static int at45db_ioctl(FAR struct mtd_dev_s *mtd, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -830,7 +830,7 @@ FAR struct mtd_dev_s *at45db_initialize(FAR struct spi_dev_s *spi)
uint8_t sr;
int ret;
fvdbg("spi: %p\n", spi);
finfo("spi: %p\n", spi);
/* Allocate a state structure (we allocate the structure instead of using a fixed,
* static allocation so that we can handle multiple FLASH devices. The current
@@ -906,7 +906,7 @@ FAR struct mtd_dev_s *at45db_initialize(FAR struct spi_dev_s *spi)
mtd_register(&priv->mtd, "at45db");
#endif
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
/* On any failure, we need free memory allocations and release the lock that
+11 -11
View File
@@ -133,7 +133,7 @@ static const struct block_operations g_bops =
static int ftl_open(FAR struct inode *inode)
{
fvdbg("Entry\n");
finfo("Entry\n");
return OK;
}
@@ -146,7 +146,7 @@ static int ftl_open(FAR struct inode *inode)
static int ftl_close(FAR struct inode *inode)
{
fvdbg("Entry\n");
finfo("Entry\n");
return OK;
}
@@ -187,7 +187,7 @@ static ssize_t ftl_read(FAR struct inode *inode, unsigned char *buffer,
{
FAR struct ftl_struct_s *dev;
fvdbg("sector: %d nsectors: %d\n", start_sector, nsectors);
finfo("sector: %d nsectors: %d\n", start_sector, nsectors);
DEBUGASSERT(inode && inode->i_private);
@@ -271,7 +271,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
nbytes = dev->geo.erasesize - offset;
}
fvdbg("Copy %d bytes into erase block=%d at offset=%d\n",
finfo("Copy %d bytes into erase block=%d at offset=%d\n",
nbytes, eraseblock, offset);
memcpy(dev->eblock + offset, buffer, nbytes);
@@ -315,7 +315,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
/* Write a full erase back to flash */
fvdbg("Write %d bytes into erase block=%d at offset=0\n",
finfo("Write %d bytes into erase block=%d at offset=0\n",
dev->geo.erasesize, alignedblock);
nxfrd = MTD_BWRITE(dev->mtd, alignedblock, dev->blkper, buffer);
@@ -358,7 +358,7 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
/* Copy the user data at the beginning the buffered erase block */
nbytes = remaining * dev->geo.blocksize;
fvdbg("Copy %d bytes into erase block=%d at offset=0\n",
finfo("Copy %d bytes into erase block=%d at offset=0\n",
nbytes, alignedblock);
memcpy(dev->eblock, buffer, nbytes);
@@ -389,7 +389,7 @@ static ssize_t ftl_write(FAR struct inode *inode, const unsigned char *buffer,
{
struct ftl_struct_s *dev;
fvdbg("sector: %d nsectors: %d\n", start_sector, nsectors);
finfo("sector: %d nsectors: %d\n", start_sector, nsectors);
DEBUGASSERT(inode && inode->i_private);
dev = (struct ftl_struct_s *)inode->i_private;
@@ -412,7 +412,7 @@ static int ftl_geometry(FAR struct inode *inode, struct geometry *geometry)
{
struct ftl_struct_s *dev;
fvdbg("Entry\n");
finfo("Entry\n");
DEBUGASSERT(inode);
if (geometry)
@@ -428,9 +428,9 @@ static int ftl_geometry(FAR struct inode *inode, struct geometry *geometry)
geometry->geo_nsectors = dev->geo.neraseblocks * dev->blkper;
geometry->geo_sectorsize = dev->geo.blocksize;
fvdbg("available: true mediachanged: false writeenabled: %s\n",
finfo("available: true mediachanged: false writeenabled: %s\n",
geometry->geo_writeenabled ? "true" : "false");
fvdbg("nsectors: %d sectorsize: %d\n",
finfo("nsectors: %d sectorsize: %d\n",
geometry->geo_nsectors, geometry->geo_sectorsize);
return OK;
@@ -451,7 +451,7 @@ static int ftl_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
struct ftl_struct_s *dev ;
int ret;
fvdbg("Entry\n");
finfo("Entry\n");
DEBUGASSERT(inode && inode->i_private);
/* Only one block driver ioctl command is supported by this driver (and
+3 -3
View File
@@ -301,11 +301,11 @@ static int hamming_verify256(FAR uint8_t *data, FAR const uint8_t *original)
/* There are bit errors */
fvdbg("Read: %02x %02x %02x\n",
finfo("Read: %02x %02x %02x\n",
original[0], original[1], original[2]);
fvdbg("Computed: %02x %02x %02x\n",
finfo("Computed: %02x %02x %02x\n",
computed[0], computed[1], computed[2]);
fvdbg("Correction: %02x %02x %02x\n",
finfo("Correction: %02x %02x %02x\n",
correction[0], correction[1], correction[2]);
/* If there is a single bit error, there are 11 bits set to 1 */
+23 -23
View File
@@ -248,7 +248,7 @@ static inline int is25xp_readid(struct is25xp_dev_s *priv)
uint16_t memory;
uint16_t capacity;
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Lock the SPI bus, configure the bus, and select this FLASH part. */
@@ -267,7 +267,7 @@ static inline int is25xp_readid(struct is25xp_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
is25xp_unlock(priv->dev);
fvdbg("manufacturer: %02x memory: %02x capacity: %02x\n",
finfo("manufacturer: %02x memory: %02x capacity: %02x\n",
manufacturer, memory, capacity);
/* Check for a valid manufacturer and memory type */
@@ -383,7 +383,7 @@ static void is25xp_waitwritecomplete(struct is25xp_dev_s *priv)
priv->lastwaswrite = false;
fvdbg("Complete\n");
finfo("Complete\n");
}
/************************************************************************************
@@ -403,7 +403,7 @@ static void is25xp_writeenable(struct is25xp_dev_s *priv)
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Enabled\n");
finfo("Enabled\n");
}
/************************************************************************************
@@ -438,7 +438,7 @@ static void is25xp_sectorerase(struct is25xp_dev_s *priv, off_t sector, uint8_t
offset = sector << priv->sectorshift;
fvdbg("sector: %08lx\n", (long)sector);
finfo("sector: %08lx\n", (long)sector);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -475,7 +475,7 @@ static void is25xp_sectorerase(struct is25xp_dev_s *priv, off_t sector, uint8_t
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Erased\n");
finfo("Erased\n");
}
/************************************************************************************
@@ -484,7 +484,7 @@ static void is25xp_sectorerase(struct is25xp_dev_s *priv, off_t sector, uint8_t
static inline int is25xp_bulkerase(struct is25xp_dev_s *priv)
{
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -511,7 +511,7 @@ static inline int is25xp_bulkerase(struct is25xp_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
is25xp_waitwritecomplete(priv);
fvdbg("Return: OK\n");
finfo("Return: OK\n");
return OK;
}
@@ -524,7 +524,7 @@ static inline void is25xp_pagewrite(struct is25xp_dev_s *priv, FAR const uint8_t
{
off_t offset = page << priv->pageshift;
fvdbg("page: %08lx offset: %08lx\n", (long)page, (long)offset);
finfo("page: %08lx offset: %08lx\n", (long)page, (long)offset);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -560,7 +560,7 @@ static inline void is25xp_pagewrite(struct is25xp_dev_s *priv, FAR const uint8_t
/* Deselect the FLASH: Chip Select high */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Written\n");
finfo("Written\n");
}
/************************************************************************************
@@ -571,7 +571,7 @@ static inline void is25xp_pagewrite(struct is25xp_dev_s *priv, FAR const uint8_t
static inline void is25xp_bytewrite(struct is25xp_dev_s *priv, FAR const uint8_t *buffer,
off_t offset, uint16_t count)
{
fvdbg("offset: %08lx count:%d\n", (long)offset, count);
finfo("offset: %08lx count:%d\n", (long)offset, count);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -607,7 +607,7 @@ static inline void is25xp_bytewrite(struct is25xp_dev_s *priv, FAR const uint8_t
/* Deselect the FLASH: Chip Select high */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Written\n");
finfo("Written\n");
}
#endif
@@ -620,7 +620,7 @@ static int is25xp_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblo
FAR struct is25xp_dev_s *priv = (FAR struct is25xp_dev_s *)dev;
size_t blocksleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the SPI bus until we complete the erase */
@@ -697,7 +697,7 @@ static ssize_t is25xp_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t
FAR struct is25xp_dev_s *priv = (FAR struct is25xp_dev_s *)dev;
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -721,7 +721,7 @@ static ssize_t is25xp_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t
size_t blocksleft = nblocks;
size_t pagesize = 1 << priv->pageshift;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the SPI bus and write each page to FLASH */
@@ -746,7 +746,7 @@ static ssize_t is25xp_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte
{
FAR struct is25xp_dev_s *priv = (FAR struct is25xp_dev_s *)dev;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -782,7 +782,7 @@ static ssize_t is25xp_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
is25xp_unlock(priv->dev);
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -802,7 +802,7 @@ static ssize_t is25xp_write(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt
int pagesize;
int bytestowrite;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* We must test if the offset + count crosses one or more pages
* and perform individual writes. The devices can only write in
@@ -869,7 +869,7 @@ static int is25xp_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct is25xp_dev_s *priv = (FAR struct is25xp_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -893,7 +893,7 @@ static int is25xp_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -915,7 +915,7 @@ static int is25xp_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -938,7 +938,7 @@ FAR struct mtd_dev_s *is25xp_initialize(FAR struct spi_dev_s *dev)
FAR struct is25xp_dev_s *priv;
int ret;
fvdbg("dev: %p\n", dev);
finfo("dev: %p\n", dev);
/* Allocate a state structure (we allocate the structure instead of using
* a fixed, static allocation so that we can handle multiple FLASH devices.
@@ -996,7 +996,7 @@ FAR struct mtd_dev_s *is25xp_initialize(FAR struct spi_dev_s *dev)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
}
+23 -23
View File
@@ -312,7 +312,7 @@ static inline int m25p_readid(struct m25p_dev_s *priv)
uint16_t memory;
uint16_t capacity;
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Lock the SPI bus, configure the bus, and select this FLASH part. */
@@ -331,7 +331,7 @@ static inline int m25p_readid(struct m25p_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
m25p_unlock(priv->dev);
fvdbg("manufacturer: %02x memory: %02x capacity: %02x\n",
finfo("manufacturer: %02x memory: %02x capacity: %02x\n",
manufacturer, memory, capacity);
/* Check for a valid manufacturer and memory type */
@@ -460,7 +460,7 @@ static void m25p_waitwritecomplete(struct m25p_dev_s *priv)
}
while ((status & M25P_SR_WIP) != 0);
fvdbg("Complete\n");
finfo("Complete\n");
}
/************************************************************************************
@@ -480,7 +480,7 @@ static void m25p_writeenable(struct m25p_dev_s *priv)
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Enabled\n");
finfo("Enabled\n");
}
/************************************************************************************
@@ -502,7 +502,7 @@ static void m25p_sectorerase(struct m25p_dev_s *priv, off_t sector, uint8_t type
offset = sector << priv->sectorshift;
}
fvdbg("sector: %08lx\n", (long)sector);
finfo("sector: %08lx\n", (long)sector);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -538,7 +538,7 @@ static void m25p_sectorerase(struct m25p_dev_s *priv, off_t sector, uint8_t type
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Erased\n");
finfo("Erased\n");
}
/************************************************************************************
@@ -547,7 +547,7 @@ static void m25p_sectorerase(struct m25p_dev_s *priv, off_t sector, uint8_t type
static inline int m25p_bulkerase(struct m25p_dev_s *priv)
{
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -572,7 +572,7 @@ static inline int m25p_bulkerase(struct m25p_dev_s *priv)
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Return: OK\n");
finfo("Return: OK\n");
return OK;
}
@@ -585,7 +585,7 @@ static inline void m25p_pagewrite(struct m25p_dev_s *priv, FAR const uint8_t *bu
{
off_t offset = page << priv->pageshift;
fvdbg("page: %08lx offset: %08lx\n", (long)page, (long)offset);
finfo("page: %08lx offset: %08lx\n", (long)page, (long)offset);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -620,7 +620,7 @@ static inline void m25p_pagewrite(struct m25p_dev_s *priv, FAR const uint8_t *bu
/* Deselect the FLASH: Chip Select high */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Written\n");
finfo("Written\n");
}
/************************************************************************************
@@ -631,7 +631,7 @@ static inline void m25p_pagewrite(struct m25p_dev_s *priv, FAR const uint8_t *bu
static inline void m25p_bytewrite(struct m25p_dev_s *priv, FAR const uint8_t *buffer,
off_t offset, uint16_t count)
{
fvdbg("offset: %08lx count:%d\n", (long)offset, count);
finfo("offset: %08lx count:%d\n", (long)offset, count);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -666,7 +666,7 @@ static inline void m25p_bytewrite(struct m25p_dev_s *priv, FAR const uint8_t *bu
/* Deselect the FLASH: Chip Select high */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Written\n");
finfo("Written\n");
}
#endif
@@ -679,7 +679,7 @@ static int m25p_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblock
FAR struct m25p_dev_s *priv = (FAR struct m25p_dev_s *)dev;
size_t blocksleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the SPI bus until we complete the erase */
@@ -747,7 +747,7 @@ static ssize_t m25p_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nb
FAR struct m25p_dev_s *priv = (FAR struct m25p_dev_s *)dev;
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -771,7 +771,7 @@ static ssize_t m25p_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t n
size_t blocksleft = nblocks;
size_t pagesize = 1 << priv->pageshift;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the SPI bus and write each page to FLASH */
@@ -796,7 +796,7 @@ static ssize_t m25p_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
{
FAR struct m25p_dev_s *priv = (FAR struct m25p_dev_s *)dev;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -829,7 +829,7 @@ static ssize_t m25p_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
m25p_unlock(priv->dev);
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -849,7 +849,7 @@ static ssize_t m25p_write(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes
int pagesize;
int bytestowrite;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* We must test if the offset + count crosses one or more pages
* and perform individual writes. The devices can only write in
@@ -914,7 +914,7 @@ static int m25p_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct m25p_dev_s *priv = (FAR struct m25p_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -949,7 +949,7 @@ static int m25p_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -971,7 +971,7 @@ static int m25p_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -994,7 +994,7 @@ FAR struct mtd_dev_s *m25p_initialize(FAR struct spi_dev_s *dev)
FAR struct m25p_dev_s *priv;
int ret;
fvdbg("dev: %p\n", dev);
finfo("dev: %p\n", dev);
/* Allocate a state structure (we allocate the structure instead of using
* a fixed, static allocation so that we can handle multiple FLASH devices.
@@ -1045,6 +1045,6 @@ FAR struct mtd_dev_s *m25p_initialize(FAR struct spi_dev_s *dev)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
}
+16 -16
View File
@@ -207,7 +207,7 @@ static int nand_checkblock(FAR struct nand_dev_s *nand, off_t block)
nandscheme_readbadblockmarker(scheme, spare, &marker);
if (marker != 0xff)
{
fvdbg("Page 0 block %d marker=%02x\n", block, marker);
finfo("Page 0 block %d marker=%02x\n", block, marker);
return BADBLOCK;
}
@@ -223,7 +223,7 @@ static int nand_checkblock(FAR struct nand_dev_s *nand, off_t block)
nandscheme_readbadblockmarker(scheme, spare, &marker);
if (marker != 0xff)
{
fvdbg("Page 1 block %d marker=%02x\n", block, marker);
finfo("Page 1 block %d marker=%02x\n", block, marker);
return BADBLOCK;
}
@@ -275,7 +275,7 @@ static int nand_devscan(FAR struct nand_dev_s *nand)
/* Initialize block statuses */
fvdbg("Retrieving bad block information. nblocks=%d\n", nblocks);
finfo("Retrieving bad block information. nblocks=%d\n", nblocks);
/* Retrieve block status from their first page spare area */
@@ -293,13 +293,13 @@ static int nand_devscan(FAR struct nand_dev_s *nand)
#if defined(CONFIG_DEBUG_INFO) && defined(CONFIG_DEBUG_FS)
if (ngood > 0)
{
fvdbg("Good blocks: %u - %u\n", good, good + ngood);
finfo("Good blocks: %u - %u\n", good, good + ngood);
ngood = 0;
}
#endif
if (ret == BADBLOCK)
{
fvdbg("Block %u is bad\n", (unsigned int)block);
finfo("Block %u is bad\n", (unsigned int)block);
}
else
{
@@ -323,7 +323,7 @@ static int nand_devscan(FAR struct nand_dev_s *nand)
#if defined(CONFIG_DEBUG_INFO) && defined(CONFIG_DEBUG_FS)
if (ngood > 0)
{
fvdbg("Good blocks: %u - %u\n", good, good + ngood);
finfo("Good blocks: %u - %u\n", good, good + ngood);
}
#endif
@@ -360,7 +360,7 @@ static uint32_t nand_chipid(struct nand_raw_s *raw)
id[3] = READ_DATA8(raw);
id[4] = READ_DATA8(raw);
fvdbg("Chip ID: %02x %02x %02x %02x %02x\n",
finfo("Chip ID: %02x %02x %02x %02x %02x\n",
id[0], id[1], id[2], id[3], id[4]);
return (uint32_t)id[0] |
@@ -394,7 +394,7 @@ static int nand_eraseblock(FAR struct nand_dev_s *nand, off_t block,
FAR struct nand_raw_s *raw;
int ret;
/* fvdbg("Block %d\n", block); */
/* finfo("Block %d\n", block); */
DEBUGASSERT(nand && nand->raw);
#ifdef CONFIG_MTD_NAND_BLOCKCHECK
@@ -404,7 +404,7 @@ static int nand_eraseblock(FAR struct nand_dev_s *nand, off_t block,
if (nand_checkblock(nand, block) != GOODBLOCK)
{
fvdbg("Block is BAD\n");
finfo("Block is BAD\n");
return -EAGAIN;
}
}
@@ -460,7 +460,7 @@ static int nand_eraseblock(FAR struct nand_dev_s *nand, off_t block,
static int nand_readpage(FAR struct nand_dev_s *nand, off_t block,
unsigned int page, FAR uint8_t *data)
{
fvdbg("block=%d page=%d data=%p\n", (int)block, page, data);
finfo("block=%d page=%d data=%p\n", (int)block, page, data);
#ifdef CONFIG_MTD_NAND_BLOCKCHECK
/* Check that the block is not BAD if data is requested */
@@ -562,7 +562,7 @@ static int nand_erase(struct mtd_dev_s *dev, off_t startblock,
size_t blocksleft = nblocks;
int ret;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the NAND until we complete the erase */
@@ -609,7 +609,7 @@ static ssize_t nand_bread(struct mtd_dev_s *dev, off_t startpage,
off_t block;
int ret;
fvdbg("startpage: %ld npages: %d\n", (long)startpage, (int)npages);
finfo("startpage: %ld npages: %d\n", (long)startpage, (int)npages);
DEBUGASSERT(nand && nand->raw);
/* Retrieve the model */
@@ -705,7 +705,7 @@ static ssize_t nand_bwrite(struct mtd_dev_s *dev, off_t startpage,
off_t block;
int ret;
fvdbg("startpage: %08lx npages: %d\n", (long)startpage, (int)npages);
finfo("startpage: %08lx npages: %d\n", (long)startpage, (int)npages);
DEBUGASSERT(nand && nand->raw);
/* Retrieve the model */
@@ -864,7 +864,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw)
struct onfi_pgparam_s onfi;
int ret;
fvdbg("cmdaddr=%p addraddr=%p dataaddr=%p\n",
finfo("cmdaddr=%p addraddr=%p dataaddr=%p\n",
(FAR void *)raw->cmdaddr, (FAR void *)raw->addraddr,
(FAR void *)raw->dataaddr);
@@ -885,7 +885,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw)
{
uint32_t chipid;
fvdbg("Failed to get ONFI page parameters: %d\n", ret);
finfo("Failed to get ONFI page parameters: %d\n", ret);
/* If the ONFI model is not supported, determine the NAND
* model from a lookup of known FLASH parts.
@@ -904,7 +904,7 @@ FAR struct mtd_dev_s *nand_initialize(FAR struct nand_raw_s *raw)
FAR struct nand_model_s *model = &raw->model;
uint64_t size;
fvdbg("Found ONFI compliant NAND FLASH\n");
finfo("Found ONFI compliant NAND FLASH\n");
/* Construct the NAND model structure */
+2 -2
View File
@@ -97,7 +97,7 @@ int nandecc_readpage(FAR struct nand_dev_s *nand, off_t block,
unsigned int sparesize;
int ret;
fvdbg("block=%d page=%d data=%p spare=%d\n", (int)block, page, data, spare);
finfo("block=%d page=%d data=%p spare=%d\n", (int)block, page, data, spare);
/* Get convenience pointers */
@@ -189,7 +189,7 @@ int nandecc_writepage(FAR struct nand_dev_s *nand, off_t block,
unsigned int sparesize;
int ret;
fvdbg("block=%d page=%d data=%p spare=%d\n", (int)block, page, data, spare);
finfo("block=%d page=%d data=%p spare=%d\n", (int)block, page, data, spare);
/* Get convenience pointers */
+8 -8
View File
@@ -92,13 +92,13 @@ int nandmodel_find(FAR const struct nand_model_s *modeltab, size_t size,
id2 = (uint8_t)(chipid >> 8);
id4 = (uint8_t)(chipid >> 24);
fvdbg("NAND ID is 0x%08x\n", (int)chipid);
finfo("NAND ID is 0x%08x\n", (int)chipid);
for (i = 0; i < size; i++)
{
if (modeltab[i].devid == id2)
{
fvdbg("NAND Model found: ID2=0x%02x ID4=0x%02x\n", id2, id4);
finfo("NAND Model found: ID2=0x%02x ID4=0x%02x\n", id2, id4);
found = true;
if (model)
@@ -155,11 +155,11 @@ int nandmodel_find(FAR const struct nand_model_s *modeltab, size_t size,
}
}
fvdbg(" devid: 0x%02x\n", model->devid);
fvdbg(" devsize: %d (MB)\n", model->devsize);
fvdbg(" blocksize: %d (KB)\n", model->blocksize);
fvdbg(" pagesize: %d (B)\n", model->pagesize);
fvdbg(" options: 0x%02x\n", model->options);
finfo(" devid: 0x%02x\n", model->devid);
finfo(" devsize: %d (MB)\n", model->devsize);
finfo(" blocksize: %d (KB)\n", model->blocksize);
finfo(" pagesize: %d (B)\n", model->pagesize);
finfo(" options: 0x%02x\n", model->options);
}
break;
}
@@ -205,7 +205,7 @@ int nandmodel_translate(FAR const struct nand_model_s *model, off_t address,
if ((address + size) > nandmodel_getdevbytesize(model))
{
fvdbg("nandmodel_translate: out-of-bounds access.\n");
finfo("nandmodel_translate: out-of-bounds access.\n");
return -ESPIPE;
}
+12 -12
View File
@@ -273,7 +273,7 @@ int onfi_read(uintptr_t cmdaddr, uintptr_t addraddr, uintptr_t dataaddr,
uint8_t parmtab[ONFI_PARAM_TABLE_SIZE];
int i;
fvdbg("cmdaddr=%08x addraddr=%08x dataaddr=%08x\n",
finfo("cmdaddr=%08x addraddr=%08x dataaddr=%08x\n",
(int)cmdaddr, (int)addraddr, (int)dataaddr);
if (!onfi_compatible(cmdaddr, addraddr, dataaddr))
@@ -356,16 +356,16 @@ int onfi_read(uintptr_t cmdaddr, uintptr_t addraddr, uintptr_t dataaddr,
onfi->model = *(FAR uint8_t *)(parmtab + 49);
fvdbg("Returning:\n");
fvdbg(" manufacturer: 0x%02x\n", onfi->manufacturer);
fvdbg(" buswidth: %d\n", onfi->buswidth);
fvdbg(" luns: %d\n", onfi->luns);
fvdbg(" eccsize: %d\n", onfi->eccsize);
fvdbg(" model: 0x%02s\n", onfi->model);
fvdbg(" sparesize: %d\n", onfi->sparesize);
fvdbg(" pagesperblock: %d\n", onfi->pagesperblock);
fvdbg(" blocksperlun: %d\n", onfi->blocksperlun);
fvdbg(" pagesize: %d\n", onfi->pagesize);
finfo("Returning:\n");
finfo(" manufacturer: 0x%02x\n", onfi->manufacturer);
finfo(" buswidth: %d\n", onfi->buswidth);
finfo(" luns: %d\n", onfi->luns);
finfo(" eccsize: %d\n", onfi->eccsize);
finfo(" model: 0x%02s\n", onfi->model);
finfo(" sparesize: %d\n", onfi->sparesize);
finfo(" pagesperblock: %d\n", onfi->pagesperblock);
finfo(" blocksperlun: %d\n", onfi->blocksperlun);
finfo(" pagesize: %d\n", onfi->pagesize);
return OK;
}
@@ -455,7 +455,7 @@ bool onfi_ebidetect(uintptr_t cmdaddr, uintptr_t addraddr,
uint8_t ids[4];
uint8_t i;
fvdbg("cmdaddr=%08x addraddr=%08x dataaddr=%08x\n",
finfo("cmdaddr=%08x addraddr=%08x dataaddr=%08x\n",
(int)cmdaddr, (int)addraddr, (int)dataaddr);
/* Send Reset command */
+3 -3
View File
@@ -479,7 +479,7 @@ static int part_procfs_open(FAR struct file *filep, FAR const char *relpath,
{
FAR struct part_procfs_file_s *attr;
fvdbg("Open '%s'\n", relpath);
finfo("Open '%s'\n", relpath);
/* PROCFS is read-only. Any attempt to open with any kind of write
* access is not permitted.
@@ -550,7 +550,7 @@ static ssize_t part_procfs_read(FAR struct file *filep, FAR char *buffer,
uint8_t x;
#endif
fvdbg("buffer=%p buflen=%d\n", buffer, (int)buflen);
finfo("buffer=%p buflen=%d\n", buffer, (int)buflen);
/* Recover our private data from the struct file instance */
@@ -702,7 +702,7 @@ static int part_procfs_dup(FAR const struct file *oldp, FAR struct file *newp)
FAR struct part_procfs_file_s *oldattr;
FAR struct part_procfs_file_s *newattr;
fvdbg("Dup %p->%p\n", oldp, newp);
finfo("Dup %p->%p\n", oldp, newp);
/* Recover our private data from the old struct file instance */
+3 -3
View File
@@ -139,7 +139,7 @@ static int mtd_open(FAR struct file *filep, FAR const char *relpath,
{
FAR struct mtd_file_s *attr;
fvdbg("Open '%s'\n", relpath);
finfo("Open '%s'\n", relpath);
/* PROCFS is read-only. Any attempt to open with any kind of write
* access is not permitted.
@@ -201,7 +201,7 @@ static ssize_t mtd_read(FAR struct file *filep, FAR char *buffer,
ssize_t total = 0;
ssize_t ret;
fvdbg("buffer=%p buflen=%d\n", buffer, (int)buflen);
finfo("buffer=%p buflen=%d\n", buffer, (int)buflen);
/* Recover our private data from the struct file instance */
@@ -266,7 +266,7 @@ static int mtd_dup(FAR const struct file *oldp, FAR struct file *newp)
FAR struct mtd_file_s *oldattr;
FAR struct mtd_file_s *newattr;
fvdbg("Dup %p->%p\n", oldp, newp);
finfo("Dup %p->%p\n", oldp, newp);
/* Recover our private data from the old struct file instance */
+6 -6
View File
@@ -174,7 +174,7 @@ static int mtd_erase(FAR struct mtd_dev_s *dev, off_t block, size_t nblocks)
size_t nsectors;
int ret;
fvdbg("block: %08lx nsectors: %lu\n",
finfo("block: %08lx nsectors: %lu\n",
(unsigned long)block, (unsigned int)nsectors);
/* Convert to logical sectors and sector numbers */
@@ -253,7 +253,7 @@ static int mtd_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct mtd_rwbuffer_s *priv = (FAR struct mtd_rwbuffer_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -276,7 +276,7 @@ static int mtd_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
geo->neraseblocks = priv->rwb.nblocks / priv->spb;
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -309,7 +309,7 @@ static int mtd_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -337,7 +337,7 @@ FAR struct mtd_dev_s *mtd_rwb_initialize(FAR struct mtd_dev_s *mtd)
struct mtd_geometry_s geo;
int ret;
fvdbg("mtd: %p\n", mtd);
finfo("mtd: %p\n", mtd);
DEBUGASSERT(mtd && mtd->ioctl);
/* Get the device geometry */
@@ -418,7 +418,7 @@ FAR struct mtd_dev_s *mtd_rwb_initialize(FAR struct mtd_dev_s *mtd)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return &priv->mtd;
}
+21 -21
View File
@@ -391,7 +391,7 @@ static int n25qxxx_command(FAR struct qspi_dev_s *qspi, uint8_t cmd)
{
struct qspi_cmdinfo_s cmdinfo;
fvdbg("CMD: %02x\n", cmd);
finfo("CMD: %02x\n", cmd);
cmdinfo.flags = 0;
cmdinfo.addrlen = 0;
@@ -412,7 +412,7 @@ static int n25qxxx_command_address(FAR struct qspi_dev_s *qspi, uint8_t cmd,
{
struct qspi_cmdinfo_s cmdinfo;
fvdbg("CMD: %02x Address: %04lx addrlen=%d\n", cmd, (unsigned long)addr, addrlen);
finfo("CMD: %02x Address: %04lx addrlen=%d\n", cmd, (unsigned long)addr, addrlen);
cmdinfo.flags = QSPICMD_ADDRESS;
cmdinfo.addrlen = addrlen;
@@ -433,7 +433,7 @@ static int n25qxxx_command_read(FAR struct qspi_dev_s *qspi, uint8_t cmd,
{
struct qspi_cmdinfo_s cmdinfo;
fvdbg("CMD: %02x buflen: %lu\n", cmd, (unsigned long)buflen);
finfo("CMD: %02x buflen: %lu\n", cmd, (unsigned long)buflen);
cmdinfo.flags = QSPICMD_READDATA;
cmdinfo.addrlen = 0;
@@ -454,7 +454,7 @@ static int n25qxxx_command_write(FAR struct qspi_dev_s *qspi, uint8_t cmd,
{
struct qspi_cmdinfo_s cmdinfo;
fvdbg("CMD: %02x buflen: %lu\n", cmd, (unsigned long)buflen);
finfo("CMD: %02x buflen: %lu\n", cmd, (unsigned long)buflen);
cmdinfo.flags = QSPICMD_WRITEDATA;
cmdinfo.addrlen = 0;
@@ -567,7 +567,7 @@ static inline int n25qxxx_readid(struct n25qxxx_dev_s *priv)
n25qxxx_unlock(priv->qspi);
fvdbg("Manufacturer: %02x Device Type %02x, Capacity: %02x\n",
finfo("Manufacturer: %02x Device Type %02x, Capacity: %02x\n",
priv->cmdbuf[0], priv->cmdbuf[1], priv->cmdbuf[2]);
/* Check for a recognized memory device type */
@@ -795,7 +795,7 @@ static int n25qxxx_erase_sector(struct n25qxxx_dev_s *priv, off_t sector)
off_t address;
uint8_t status;
fvdbg("sector: %08lx\n", (unsigned long)sector);
finfo("sector: %08lx\n", (unsigned long)sector);
/* Check that the flash is ready and unprotected */
@@ -872,7 +872,7 @@ static int n25qxxx_read_byte(FAR struct n25qxxx_dev_s *priv, FAR uint8_t *buffer
{
struct qspi_meminfo_s meminfo;
fvdbg("address: %08lx nbytes: %d\n", (long)address, (int)buflen);
finfo("address: %08lx nbytes: %d\n", (long)address, (int)buflen);
meminfo.flags = QSPIMEM_READ | QSPIMEM_QUADIO;
meminfo.addrlen = 3;
@@ -898,7 +898,7 @@ static int n25qxxx_write_page(struct n25qxxx_dev_s *priv, FAR const uint8_t *buf
int ret;
int i;
fvdbg("address: %08lx buflen: %u\n", (unsigned long)address, (unsigned)buflen);
finfo("address: %08lx buflen: %u\n", (unsigned long)address, (unsigned)buflen);
npages = (buflen >> priv->pageshift);
pagesize = (1 << priv->pageshift);
@@ -1008,7 +1008,7 @@ static FAR uint8_t *n25qxxx_read_cache(struct n25qxxx_dev_s *priv, off_t sector)
shift = priv->sectorshift - N25QXXX_SECTOR512_SHIFT;
esectno = sector >> shift;
fvdbg("sector: %ld esectno: %d shift=%d\n", sector, esectno, shift);
finfo("sector: %ld esectno: %d shift=%d\n", sector, esectno, shift);
/* Check if the requested erase block is already in the cache */
@@ -1076,7 +1076,7 @@ static void n25qxxx_erase_cache(struct n25qxxx_dev_s *priv, off_t sector)
if (!IS_ERASED(priv))
{
off_t esectno = sector >> (priv->sectorshift - N25QXXX_SECTOR512_SHIFT);
fvdbg("sector: %ld esectno: %d\n", sector, esectno);
finfo("sector: %ld esectno: %d\n", sector, esectno);
DEBUGVERIFY(n25qxxx_erase_sector(priv, esectno));
SET_ERASED(priv);
@@ -1120,7 +1120,7 @@ static int n25qxxx_write_cache(FAR struct n25qxxx_dev_s *priv,
if (!IS_ERASED(priv))
{
off_t esectno = sector >> (priv->sectorshift - N25QXXX_SECTOR512_SHIFT);
fvdbg("sector: %ld esectno: %d\n", sector, esectno);
finfo("sector: %ld esectno: %d\n", sector, esectno);
ret = n25qxxx_erase_sector(priv, esectno);
if (ret < 0)
@@ -1161,7 +1161,7 @@ static int n25qxxx_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nbl
int ret;
#endif
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the SPI bus until we complete the erase */
@@ -1206,7 +1206,7 @@ static ssize_t n25qxxx_bread(FAR struct mtd_dev_s *dev, off_t startblock,
#endif
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -1239,7 +1239,7 @@ static ssize_t n25qxxx_bwrite(FAR struct mtd_dev_s *dev, off_t startblock,
FAR struct n25qxxx_dev_s *priv = (FAR struct n25qxxx_dev_s *)dev;
int ret = (int)nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the QuadSPI bus and write all of the pages to FLASH */
@@ -1276,7 +1276,7 @@ static ssize_t n25qxxx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt
FAR struct n25qxxx_dev_s *priv = (FAR struct n25qxxx_dev_s *)dev;
int ret;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Lock the QuadSPI bus and select this FLASH part */
@@ -1290,7 +1290,7 @@ static ssize_t n25qxxx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt
return (ssize_t)ret;
}
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return (ssize_t)nbytes;
}
@@ -1303,7 +1303,7 @@ static int n25qxxx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct n25qxxx_dev_s *priv = (FAR struct n25qxxx_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -1334,7 +1334,7 @@ static int n25qxxx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
#endif
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -1375,7 +1375,7 @@ static int n25qxxx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -1401,7 +1401,7 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi, bool unpro
FAR struct n25qxxx_dev_s *priv;
int ret;
fvdbg("qspi: %p\n", qspi);
finfo("qspi: %p\n", qspi);
DEBUGASSERT(qspi != NULL);
/* Allocate a state structure (we allocate the structure instead of using
@@ -1496,7 +1496,7 @@ FAR struct mtd_dev_s *n25qxxx_initialize(FAR struct qspi_dev_s *qspi, bool unpro
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
errout_with_readbuf:
+20 -20
View File
@@ -368,7 +368,7 @@ static inline int ramtron_readid(struct ramtron_dev_s *priv)
uint16_t part;
int i;
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Lock the SPI bus, configure the bus, and select this FLASH part. */
@@ -418,7 +418,7 @@ static inline int ramtron_readid(struct ramtron_dev_s *priv)
UNUSED(manufacturer); /* Eliminate warnings when debug is off */
UNUSED(memory); /* Eliminate warnings when debug is off */
fvdbg("RAMTRON %s of size %d bytes (mf:%02x mem:%02x cap:%02x part:%02x)\n",
finfo("RAMTRON %s of size %d bytes (mf:%02x mem:%02x cap:%02x part:%02x)\n",
priv->part->name, priv->part->size, manufacturer, memory, capacity, part);
priv->sectorshift = RAMTRON_EMULATE_SECTOR_SHIFT;
@@ -429,7 +429,7 @@ static inline int ramtron_readid(struct ramtron_dev_s *priv)
return OK;
}
fvdbg("RAMTRON device not found\n");
finfo("RAMTRON device not found\n");
return -ENODEV;
}
@@ -471,7 +471,7 @@ static int ramtron_waitwritecomplete(struct ramtron_dev_s *priv)
if (retries > 0)
{
fvdbg("Complete\n");
finfo("Complete\n");
retries = OK;
}
else
@@ -500,7 +500,7 @@ static void ramtron_writeenable(struct ramtron_dev_s *priv)
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Enabled\n");
finfo("Enabled\n");
}
/************************************************************************************
@@ -529,7 +529,7 @@ static inline int ramtron_pagewrite(struct ramtron_dev_s *priv, FAR const uint8_
{
off_t offset = page << priv->pageshift;
fvdbg("page: %08lx offset: %08lx\n", (long)page, (long)offset);
finfo("page: %08lx offset: %08lx\n", (long)page, (long)offset);
#ifndef RAMTRON_WRITEWAIT
/* Wait for any preceding write to complete. We could simplify things by
@@ -564,7 +564,7 @@ static inline int ramtron_pagewrite(struct ramtron_dev_s *priv, FAR const uint8_
/* Deselect the FLASH: Chip Select high */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Written\n");
finfo("Written\n");
#ifdef RAMTRON_WRITEWAIT
/* Wait for write completion now so we can report any errors to the caller. Thus
@@ -583,8 +583,8 @@ static inline int ramtron_pagewrite(struct ramtron_dev_s *priv, FAR const uint8_
static int ramtron_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks)
{
fvdbg("startblock: %08lx nblocks: %d\n", (unsigned long)startblock, (int)nblocks);
fvdbg("On RAMTRON devices erasing makes no sense, returning as OK\n");
finfo("startblock: %08lx nblocks: %d\n", (unsigned long)startblock, (int)nblocks);
finfo("On RAMTRON devices erasing makes no sense, returning as OK\n");
return (int)nblocks;
}
@@ -598,7 +598,7 @@ static ssize_t ramtron_bread(FAR struct mtd_dev_s *dev, off_t startblock,
FAR struct ramtron_dev_s *priv = (FAR struct ramtron_dev_s *)dev;
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -622,7 +622,7 @@ static ssize_t ramtron_bwrite(FAR struct mtd_dev_s *dev, off_t startblock,
FAR struct ramtron_dev_s *priv = (FAR struct ramtron_dev_s *)dev;
size_t blocksleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the SPI bus and write each page to FLASH */
@@ -653,7 +653,7 @@ static ssize_t ramtron_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt
uint8_t status;
#endif
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
#ifndef RAMTRON_WRITEWAIT
/* Wait for any preceding write to complete. We could simplify things by
@@ -704,7 +704,7 @@ static ssize_t ramtron_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
ramtron_unlock(priv->dev);
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -717,7 +717,7 @@ static int ramtron_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct ramtron_dev_s *priv = (FAR struct ramtron_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -740,14 +740,14 @@ static int ramtron_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
geo->neraseblocks = priv->nsectors;
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
break;
case MTDIOC_BULKERASE:
fvdbg("BULDERASE: Makes no sense in ramtron. Let's confirm operation as OK\n");
finfo("BULDERASE: Makes no sense in ramtron. Let's confirm operation as OK\n");
ret = OK;
break;
@@ -757,7 +757,7 @@ static int ramtron_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
if (arg > 0 && arg <= RAMTRON_INIT_CLK_MAX)
{
priv->speed = arg;
fvdbg("set bus speed to %lu\n", priv->speed);
finfo("set bus speed to %lu\n", priv->speed);
ret = OK;
}
}
@@ -770,7 +770,7 @@ static int ramtron_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -792,7 +792,7 @@ FAR struct mtd_dev_s *ramtron_initialize(FAR struct spi_dev_s *dev)
{
FAR struct ramtron_dev_s *priv;
fvdbg("dev: %p\n", dev);
finfo("dev: %p\n", dev);
/* Allocate a state structure (we allocate the structure instead of using
* a fixed, static allocation so that we can handle multiple FLASH devices.
@@ -838,6 +838,6 @@ FAR struct mtd_dev_s *ramtron_initialize(FAR struct spi_dev_s *dev)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
}
+21 -21
View File
@@ -443,7 +443,7 @@ static int s25fl1_command(FAR struct qspi_dev_s *qspi, uint8_t cmd)
{
struct qspi_cmdinfo_s cmdinfo;
fvdbg("CMD: %02x\n", cmd);
finfo("CMD: %02x\n", cmd);
cmdinfo.flags = 0;
cmdinfo.addrlen = 0;
@@ -464,7 +464,7 @@ static int s25fl1_command_address(FAR struct qspi_dev_s *qspi, uint8_t cmd,
{
struct qspi_cmdinfo_s cmdinfo;
fvdbg("CMD: %02x Address: %04lx addrlen=%d\n", cmd, (unsigned long)addr, addrlen);
finfo("CMD: %02x Address: %04lx addrlen=%d\n", cmd, (unsigned long)addr, addrlen);
cmdinfo.flags = QSPICMD_ADDRESS;
cmdinfo.addrlen = addrlen;
@@ -485,7 +485,7 @@ static int s25fl1_command_read(FAR struct qspi_dev_s *qspi, uint8_t cmd,
{
struct qspi_cmdinfo_s cmdinfo;
fvdbg("CMD: %02x buflen: %lu\n", cmd, (unsigned long)buflen);
finfo("CMD: %02x buflen: %lu\n", cmd, (unsigned long)buflen);
cmdinfo.flags = QSPICMD_READDATA;
cmdinfo.addrlen = 0;
@@ -506,7 +506,7 @@ static int s25fl1_command_write(FAR struct qspi_dev_s *qspi, uint8_t cmd,
{
struct qspi_cmdinfo_s cmdinfo;
fvdbg("CMD: %02x buflen: %lu\n", cmd, (unsigned long)buflen);
finfo("CMD: %02x buflen: %lu\n", cmd, (unsigned long)buflen);
cmdinfo.flags = QSPICMD_WRITEDATA;
cmdinfo.addrlen = 0;
@@ -613,7 +613,7 @@ static inline int s25fl1_readid(struct s25fl1_dev_s *priv)
s25fl1_unlock(priv->qspi);
fvdbg("Manufacturer: %02x Device Type %02x, Capacity: %02x",
finfo("Manufacturer: %02x Device Type %02x, Capacity: %02x",
priv->cmdbuf[0], priv->cmdbuf[1], priv->cmdbuf[2]);
/* Check for a recognized memory device type */
@@ -830,7 +830,7 @@ static int s25fl1_erase_sector(struct s25fl1_dev_s *priv, off_t sector)
off_t address;
uint8_t status;
fvdbg("sector: %08lx\n", (unsigned long)sector);
finfo("sector: %08lx\n", (unsigned long)sector);
/* Check that the flash is ready and unprotected */
@@ -906,7 +906,7 @@ static int s25fl1_read_byte(FAR struct s25fl1_dev_s *priv, FAR uint8_t *buffer,
{
struct qspi_meminfo_s meminfo;
fvdbg("address: %08lx nbytes: %d\n", (long)address, (int)buflen);
finfo("address: %08lx nbytes: %d\n", (long)address, (int)buflen);
#ifdef CONFIG_S25FL1_SCRAMBLE
meminfo.flags = QSPIMEM_READ | QSPIMEM_QUADIO | QSPIMEM_SCRAMBLE;
@@ -939,7 +939,7 @@ static int s25fl1_write_page(struct s25fl1_dev_s *priv, FAR const uint8_t *buffe
int ret;
int i;
fvdbg("address: %08lx buflen: %u\n", (unsigned long)address, (unsigned)buflen);
finfo("address: %08lx buflen: %u\n", (unsigned long)address, (unsigned)buflen);
npages = (buflen >> priv->pageshift);
pagesize = (1 << priv->pageshift);
@@ -1055,7 +1055,7 @@ static FAR uint8_t *s25fl1_read_cache(struct s25fl1_dev_s *priv, off_t sector)
shift = priv->sectorshift - S25FL1_SECTOR512_SHIFT;
esectno = sector >> shift;
fvdbg("sector: %ld esectno: %d shift=%d\n", sector, esectno, shift);
finfo("sector: %ld esectno: %d shift=%d\n", sector, esectno, shift);
/* Check if the requested erase block is already in the cache */
@@ -1123,7 +1123,7 @@ static void s25fl1_erase_cache(struct s25fl1_dev_s *priv, off_t sector)
if (!IS_ERASED(priv))
{
off_t esectno = sector >> (priv->sectorshift - S25FL1_SECTOR512_SHIFT);
fvdbg("sector: %ld esectno: %d\n", sector, esectno);
finfo("sector: %ld esectno: %d\n", sector, esectno);
DEBUGVERIFY(s25fl1_erase_sector(priv, esectno));
SET_ERASED(priv);
@@ -1167,7 +1167,7 @@ static int s25fl1_write_cache(FAR struct s25fl1_dev_s *priv,
if (!IS_ERASED(priv))
{
off_t esectno = sector >> (priv->sectorshift - S25FL1_SECTOR512_SHIFT);
fvdbg("sector: %ld esectno: %d\n", sector, esectno);
finfo("sector: %ld esectno: %d\n", sector, esectno);
ret = s25fl1_erase_sector(priv, esectno);
if (ret < 0)
@@ -1208,7 +1208,7 @@ static int s25fl1_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblo
int ret;
#endif
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the SPI bus until we complete the erase */
@@ -1252,7 +1252,7 @@ static ssize_t s25fl1_bread(FAR struct mtd_dev_s *dev, off_t startblock,
#endif
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -1285,7 +1285,7 @@ static ssize_t s25fl1_bwrite(FAR struct mtd_dev_s *dev, off_t startblock,
FAR struct s25fl1_dev_s *priv = (FAR struct s25fl1_dev_s *)dev;
int ret = (int)nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the QuadSPI bus and write all of the pages to FLASH */
@@ -1322,7 +1322,7 @@ static ssize_t s25fl1_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte
FAR struct s25fl1_dev_s *priv = (FAR struct s25fl1_dev_s *)dev;
int ret;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Lock the QuadSPI bus and select this FLASH part */
@@ -1336,7 +1336,7 @@ static ssize_t s25fl1_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte
return (ssize_t)ret;
}
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return (ssize_t)nbytes;
}
@@ -1349,7 +1349,7 @@ static int s25fl1_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct s25fl1_dev_s *priv = (FAR struct s25fl1_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -1380,7 +1380,7 @@ static int s25fl1_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
#endif
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -1421,7 +1421,7 @@ static int s25fl1_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -1447,7 +1447,7 @@ FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi, bool unprot
FAR struct s25fl1_dev_s *priv;
int ret;
fvdbg("qspi: %p\n", qspi);
finfo("qspi: %p\n", qspi);
DEBUGASSERT(qspi != NULL);
/* Allocate a state structure (we allocate the structure instead of using
@@ -1547,7 +1547,7 @@ FAR struct mtd_dev_s *s25fl1_initialize(FAR struct qspi_dev_s *qspi, bool unprot
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
errout_with_readbuf:
+13 -13
View File
@@ -155,7 +155,7 @@ static FAR uint8_t *s512_cacheread(struct s512_dev_s *priv, off_t sector512)
/* Get the erase block containing this sector */
eblockno = sector512 / priv->stdperblock;
fvdbg("sector512: %lu eblockno: %lu\n",
finfo("sector512: %lu eblockno: %lu\n",
(unsigned long)sector512, (unsigned long)eblockno);
/* Check if the requested erase block is already in the cache */
@@ -251,7 +251,7 @@ static int s512_erase(FAR struct mtd_dev_s *dev, off_t sector512, size_t nsector
size_t eblockno;
int ret;
fvdbg("sector512: %08lx nsectors: %lu\n",
finfo("sector512: %08lx nsectors: %lu\n",
(unsigned long)sector512, (unsigned int)nsectors);
while (sectorsleft-- > 0)
@@ -276,7 +276,7 @@ static int s512_erase(FAR struct mtd_dev_s *dev, off_t sector512, size_t nsector
if (!IS_ERASED(priv))
{
eblockno = sector512 / priv->stdperblock;
fvdbg("sector512: %lu eblockno: %lu\n",
finfo("sector512: %lu eblockno: %lu\n",
(unsigned long)sector512, (unsigned long)eblockno);
ret = priv->dev->erase(priv->dev, eblockno, 1);
@@ -320,7 +320,7 @@ static ssize_t s512_bread(FAR struct mtd_dev_s *dev, off_t sector512,
ssize_t remaining;
ssize_t result = nsectors;
fvdbg("sector512: %08lx nsectors: %d\n", (long)sector512, (int)nsectors);
finfo("sector512: %08lx nsectors: %d\n", (long)sector512, (int)nsectors);
/* Read each 512 byte sector from the block via the erase block cache */
@@ -369,7 +369,7 @@ static ssize_t s512_bwrite(FAR struct mtd_dev_s *dev, off_t sector512, size_t ns
ssize_t result;
off_t eblockno;
fvdbg("sector512: %08lx nsectors: %d\n", (long)sector512, (int)nsectors);
finfo("sector512: %08lx nsectors: %d\n", (long)sector512, (int)nsectors);
FAR uint8_t *dest;
@@ -399,7 +399,7 @@ static ssize_t s512_bwrite(FAR struct mtd_dev_s *dev, off_t sector512, size_t ns
if (!IS_ERASED(priv))
{
eblockno = sector512 / priv->stdperblock;
fvdbg("sector512: %lu eblockno: %lu\n",
finfo("sector512: %lu eblockno: %lu\n",
(unsigned long)sector512, (unsigned long)eblockno);
result = priv->dev->erase(priv->dev, eblockno, 1);
@@ -445,7 +445,7 @@ static ssize_t s512_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
off_t sectoffset;
off_t sector;
fvdbg("offset: %08lx nbytes: %lu\n",
finfo("offset: %08lx nbytes: %lu\n",
(unsigned long)offset, (unsigned long)nbytes);
/* Convert the offset into 512 byte sector address and a byte offset */
@@ -488,7 +488,7 @@ static ssize_t s512_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
buffer += xfrsize;
}
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -501,7 +501,7 @@ static int s512_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct s512_dev_s *priv = (FAR struct s512_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -524,7 +524,7 @@ static int s512_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
geo->neraseblocks = priv->neblocks * priv->stdperblock;
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -550,7 +550,7 @@ static int s512_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -578,7 +578,7 @@ FAR struct mtd_dev_s *s512_initialize(FAR struct mtd_dev_s *mtd)
FAR struct mtd_geometry_s geo;
int ret;
fvdbg("mtd: %p\n", mtd);
finfo("mtd: %p\n", mtd);
/* Get the device geometry */
@@ -643,6 +643,6 @@ FAR struct mtd_dev_s *s512_initialize(FAR struct mtd_dev_s *mtd)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return &priv->mtd;
}
+25 -25
View File
@@ -441,7 +441,7 @@ static const struct file_operations g_fops =
static int smart_open(FAR struct inode *inode)
{
fvdbg("Entry\n");
finfo("Entry\n");
return OK;
}
@@ -454,7 +454,7 @@ static int smart_open(FAR struct inode *inode)
static int smart_close(FAR struct inode *inode)
{
fvdbg("Entry\n");
finfo("Entry\n");
return OK;
}
@@ -767,7 +767,7 @@ static ssize_t smart_reload(struct smart_struct_s *dev, FAR uint8_t *buffer,
/* Read the full erase block into the buffer */
fvdbg("Read %d blocks starting at block %d\n", mtdBlocks, mtdStartBlock);
finfo("Read %d blocks starting at block %d\n", mtdBlocks, mtdStartBlock);
nread = MTD_BREAD(dev->mtd, mtdStartBlock, mtdBlocks, buffer);
if (nread != mtdBlocks)
{
@@ -790,7 +790,7 @@ static ssize_t smart_read(FAR struct inode *inode, unsigned char *buffer,
{
FAR struct smart_struct_s *dev;
fvdbg("SMART: sector: %d nsectors: %d\n", start_sector, nsectors);
finfo("SMART: sector: %d nsectors: %d\n", start_sector, nsectors);
DEBUGASSERT(inode && inode->i_private);
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
@@ -826,7 +826,7 @@ static ssize_t smart_write(FAR struct inode *inode,
int ret;
off_t mtdstartblock, mtdblockcount;
fvdbg("sector: %d nsectors: %d\n", start_sector, nsectors);
finfo("sector: %d nsectors: %d\n", start_sector, nsectors);
DEBUGASSERT(inode && inode->i_private);
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
@@ -851,7 +851,7 @@ static ssize_t smart_write(FAR struct inode *inode,
mtdblockcount = nsectors * dev->mtdBlksPerSector;
mtdBlksPerErase = dev->mtdBlksPerSector * dev->sectorsPerBlk;
fvdbg("mtdsector: %d mtdnsectors: %d\n", mtdstartblock, mtdblockcount);
finfo("mtdsector: %d mtdnsectors: %d\n", mtdstartblock, mtdblockcount);
/* Start at first block to be written */
@@ -933,7 +933,7 @@ static int smart_geometry(FAR struct inode *inode, struct geometry *geometry)
FAR struct smart_struct_s *dev;
uint32_t erasesize;
fvdbg("Entry\n");
finfo("Entry\n");
DEBUGASSERT(inode);
if (geometry)
@@ -956,9 +956,9 @@ static int smart_geometry(FAR struct inode *inode, struct geometry *geometry)
dev->sectorsize;
geometry->geo_sectorsize = dev->sectorsize;
fvdbg("available: true mediachanged: false writeenabled: %s\n",
finfo("available: true mediachanged: false writeenabled: %s\n",
geometry->geo_writeenabled ? "true" : "false");
fvdbg("nsectors: %d sectorsize: %d\n",
finfo("nsectors: %d sectorsize: %d\n",
geometry->geo_nsectors, geometry->geo_sectorsize);
return OK;
@@ -1767,7 +1767,7 @@ static int smart_set_wear_level(FAR struct smart_struct_s *dev, uint16_t block,
smart_find_wear_minmax(dev);
if (oldlevel != dev->minwearlevel)
fvdbg("##### New min wear level = %d\n", dev->minwearlevel);
finfo("##### New min wear level = %d\n", dev->minwearlevel);
}
}
@@ -1807,7 +1807,7 @@ static int smart_scan(FAR struct smart_struct_s *dev)
FAR struct smart_multiroot_device_s *rootdirdev;
#endif
fvdbg("Entry\n");
finfo("Entry\n");
/* Find the sector size on the volume by reading headers from
* sectors of decreasing size. On a formatted volume, the sector
@@ -1909,7 +1909,7 @@ static int smart_scan(FAR struct smart_struct_s *dev)
for (sector = 0; sector < totalsectors; sector++)
{
fvdbg("Scan sector %d\n", sector);
finfo("Scan sector %d\n", sector);
/* Calculate the read address for this sector */
@@ -2373,7 +2373,7 @@ static inline int smart_getformat(FAR struct smart_struct_s *dev,
{
int ret;
fvdbg("Entry\n");
finfo("Entry\n");
DEBUGASSERT(fmt);
/* Test if we know the format status or not. If we don't know the
@@ -2630,7 +2630,7 @@ static int smart_relocate_static_data(FAR struct smart_struct_s *dev, uint16_t b
nextsector = dev->freecount[x];
newsector = dev->releasecount[x];
#endif
fvdbg("Moving block %d, wear %d, free %d, released %d to block %d, wear %d\n",
finfo("Moving block %d, wear %d, free %d, released %d to block %d, wear %d\n",
x, smart_get_wear_level(dev, x),
nextsector, newsector,
block, smart_get_wear_level(dev, block));
@@ -2842,7 +2842,7 @@ static inline int smart_llformat(FAR struct smart_struct_s *dev, unsigned long a
uint8_t sectsize, prerelease;
uint16_t sectorsize;
fvdbg("Entry\n");
finfo("Entry\n");
/* Get the sector size from the provided arg */
@@ -3747,11 +3747,11 @@ static int smart_garbagecollect(FAR struct smart_struct_s *dev)
#endif
#ifdef CONFIG_MTD_SMART_PACK_COUNTS
fvdbg("Collecting block %d, free=%d released=%d, totalfree=%d, totalrelease=%d\n",
finfo("Collecting block %d, free=%d released=%d, totalfree=%d, totalrelease=%d\n",
collectblock, smart_get_count(dev, dev->freecount, collectblock),
smart_get_count(dev, dev->releasecount, collectblock), dev->freesectors, dev->releasesectors);
#else
fvdbg("Collecting block %d, free=%d released=%d\n",
finfo("Collecting block %d, free=%d released=%d\n",
collectblock, dev->freecount[collectblock],
dev->releasecount[collectblock]);
#endif
@@ -4088,7 +4088,7 @@ static int smart_write_alloc_sector(FAR struct smart_struct_s *dev,
/* Write the header to the physical sector location */
#ifndef CONFIG_MTD_SMART_ENABLE_CRC
fvdbg("Write MTD block %d\n", physical * dev->mtdBlksPerSector);
finfo("Write MTD block %d\n", physical * dev->mtdBlksPerSector);
ret = MTD_BWRITE(dev->mtd, physical * dev->mtdBlksPerSector, 1,
(FAR uint8_t *) dev->rwbuffer);
if (ret != 1)
@@ -4191,7 +4191,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev,
FAR struct smart_allocsector_s *allocsector;
#endif
fvdbg("Entry\n");
finfo("Entry\n");
req = (FAR struct smart_read_write_s *) arg;
DEBUGASSERT(req->offset <= dev->sectorsize);
DEBUGASSERT(req->offset+req->count <= dev->sectorsize);
@@ -4216,7 +4216,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev,
/* Subtract dev->minwearlevel from all wear levels */
offset = dev->minwearlevel;
fvdbg("Reducing wear level bits by %d\n", offset);
finfo("Reducing wear level bits by %d\n", offset);
for (x = 0; x < dev->geo.neraseblocks; x++)
{
smart_set_wear_level(dev, x, smart_get_wear_level(dev, x) - offset);
@@ -4462,7 +4462,7 @@ static int smart_writesector(FAR struct smart_struct_s *dev,
ret = smart_bytewrite(dev, offset, 1, &byte);
if (ret != 1)
{
fvdbg("Error committing physical sector %d\n", physsector);
finfo("Error committing physical sector %d\n", physsector);
ret = -EIO;
goto errout;
}
@@ -4592,7 +4592,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev,
struct smart_sect_header_s header;
#endif
fvdbg("Entry\n");
finfo("Entry\n");
req = (FAR struct smart_read_write_s *) arg;
DEBUGASSERT(req->offset < dev->sectorsize);
DEBUGASSERT(req->offset+req->count+ sizeof(struct smart_sect_header_s) <=
@@ -4677,7 +4677,7 @@ static int smart_readsector(FAR struct smart_struct_s *dev,
sizeof(struct smart_sect_header_s), (FAR uint8_t *) &header);
if (ret != sizeof(struct smart_sect_header_s))
{
fvdbg("Error reading sector %d header\n", physsector);
finfo("Error reading sector %d header\n", physsector);
ret = -EIO;
goto errout;
}
@@ -4891,7 +4891,7 @@ static inline int smart_allocsector(FAR struct smart_struct_s *dev,
/* Find a free physical sector */
physicalsector = smart_findfreephyssector(dev, FALSE);
fvdbg("Alloc: log=%d, phys=%d, erase block=%d, free=%d, released=%d\n",
finfo("Alloc: log=%d, phys=%d, erase block=%d, free=%d, released=%d\n",
logsector, physicalsector, physicalsector /
dev->sectorsPerBlk, dev->freesectors, dev->releasecount);
@@ -5083,7 +5083,7 @@ static int smart_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
FAR struct mtd_smart_debug_data_s *debug_data;
#endif
fvdbg("Entry\n");
finfo("Entry\n");
DEBUGASSERT(inode && inode->i_private);
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
+22 -22
View File
@@ -309,7 +309,7 @@ static inline int sst25_readid(struct sst25_dev_s *priv)
uint16_t memory;
uint16_t capacity;
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Lock the SPI bus, configure the bus, and select this FLASH part. */
@@ -328,7 +328,7 @@ static inline int sst25_readid(struct sst25_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
sst25_unlock(priv->dev);
fvdbg("manufacturer: %02x memory: %02x capacity: %02x\n",
finfo("manufacturer: %02x memory: %02x capacity: %02x\n",
manufacturer, memory, capacity);
/* Check for a valid manufacturer and memory type */
@@ -486,7 +486,7 @@ static void sst25_sectorerase(struct sst25_dev_s *priv, off_t sector)
{
off_t address = sector << priv->sectorshift;
fvdbg("sector: %08lx\n", (long)sector);
finfo("sector: %08lx\n", (long)sector);
/* Wait for any preceding write or erase operation to complete. */
@@ -523,7 +523,7 @@ static void sst25_sectorerase(struct sst25_dev_s *priv, off_t sector)
static inline int sst25_chiperase(struct sst25_dev_s *priv)
{
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Wait for any preceding write or erase operation to complete. */
@@ -537,7 +537,7 @@ static inline int sst25_chiperase(struct sst25_dev_s *priv)
sst25_cmd(priv, SST25_CE);
fvdbg("Return: OK\n");
finfo("Return: OK\n");
return OK;
}
@@ -550,7 +550,7 @@ static void sst25_byteread(FAR struct sst25_dev_s *priv, FAR uint8_t *buffer,
{
uint8_t status;
fvdbg("address: %08lx nbytes: %d\n", (long)address, (int)nbytes);
finfo("address: %08lx nbytes: %d\n", (long)address, (int)nbytes);
/* Wait for any preceding write or erase operation to complete. */
@@ -601,7 +601,7 @@ static void sst25_bytewrite(struct sst25_dev_s *priv, FAR const uint8_t *buffer,
{
uint8_t status;
fvdbg("address: %08lx nwords: %d\n", (long)address, (int)nbytes);
finfo("address: %08lx nwords: %d\n", (long)address, (int)nbytes);
DEBUGASSERT(priv && buffer);
/* Write each byte individually */
@@ -663,7 +663,7 @@ static void sst25_wordwrite(struct sst25_dev_s *priv, FAR const uint8_t *buffer,
size_t nwords = (nbytes + 1) >> 1;
uint8_t status;
fvdbg("address: %08lx nwords: %d\n", (long)address, (int)nwords);
finfo("address: %08lx nwords: %d\n", (long)address, (int)nwords);
DEBUGASSERT(priv && buffer);
/* Loop until all of the bytes have been written */
@@ -834,7 +834,7 @@ static FAR uint8_t *sst25_cacheread(struct sst25_dev_s *priv, off_t sector)
shift = priv->sectorshift - SST25_SECTOR_SHIFT;
esectno = sector >> shift;
fvdbg("sector: %ld esectno: %d shift=%d\n", sector, esectno, shift);
finfo("sector: %ld esectno: %d shift=%d\n", sector, esectno, shift);
/* Check if the requested erase block is already in the cache */
@@ -890,7 +890,7 @@ static void sst25_cacheerase(struct sst25_dev_s *priv, off_t sector)
if (!IS_ERASED(priv))
{
off_t esectno = sector >> (priv->sectorshift - SST25_SECTOR_SHIFT);
fvdbg("sector: %ld esectno: %d\n", sector, esectno);
finfo("sector: %ld esectno: %d\n", sector, esectno);
sst25_sectorerase(priv, esectno);
SET_ERASED(priv);
@@ -932,7 +932,7 @@ static void sst25_cachewrite(FAR struct sst25_dev_s *priv, FAR const uint8_t *bu
if (!IS_ERASED(priv))
{
off_t esectno = sector >> (priv->sectorshift - SST25_SECTOR_SHIFT);
fvdbg("sector: %ld esectno: %d\n", sector, esectno);
finfo("sector: %ld esectno: %d\n", sector, esectno);
sst25_sectorerase(priv, esectno);
SET_ERASED(priv);
@@ -967,7 +967,7 @@ static int sst25_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nbloc
FAR struct sst25_dev_s *priv = (FAR struct sst25_dev_s *)dev;
size_t blocksleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the SPI bus until we complete the erase */
@@ -1006,7 +1006,7 @@ static ssize_t sst25_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t n
#ifdef CONFIG_SST25_SECTOR512
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -1021,7 +1021,7 @@ static ssize_t sst25_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t n
FAR struct sst25_dev_s *priv = (FAR struct sst25_dev_s *)dev;
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -1047,7 +1047,7 @@ static ssize_t sst25_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t
#else
FAR struct sst25_dev_s *priv = (FAR struct sst25_dev_s *)dev;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the SPI bus and write all of the pages to FLASH */
@@ -1077,7 +1077,7 @@ static ssize_t sst25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes
{
FAR struct sst25_dev_s *priv = (FAR struct sst25_dev_s *)dev;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Lock the SPI bus and select this FLASH part */
@@ -1085,7 +1085,7 @@ static ssize_t sst25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes
sst25_byteread(priv, buffer, offset, nbytes);
sst25_unlock(priv->dev);
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -1098,7 +1098,7 @@ static int sst25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct sst25_dev_s *priv = (FAR struct sst25_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -1127,7 +1127,7 @@ static int sst25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
#endif
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -1149,7 +1149,7 @@ static int sst25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -1172,7 +1172,7 @@ FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev)
FAR struct sst25_dev_s *priv;
int ret;
fvdbg("dev: %p\n", dev);
finfo("dev: %p\n", dev);
/* Allocate a state structure (we allocate the structure instead of using
* a fixed, static allocation so that we can handle multiple FLASH devices.
@@ -1242,6 +1242,6 @@ FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
}
+23 -23
View File
@@ -259,7 +259,7 @@ static inline int sst25xx_readid(struct sst25xx_dev_s *priv)
uint16_t memory;
uint16_t capacity;
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Lock the SPI bus, configure the bus, and select this FLASH part. */
@@ -279,7 +279,7 @@ static inline int sst25xx_readid(struct sst25xx_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
sst25xx_unlock(priv->dev);
fvdbg("manufacturer: %02x memory: %02x capacity: %02x\n",
finfo("manufacturer: %02x memory: %02x capacity: %02x\n",
manufacturer, memory, capacity);
/* Check for a valid manufacturer and memory type */
@@ -356,7 +356,7 @@ static void sst25xx_waitwritecomplete(struct sst25xx_dev_s *priv)
priv->lastwaswrite = false;
fvdbg("Complete\n");
finfo("Complete\n");
}
/************************************************************************************
@@ -376,7 +376,7 @@ static void sst25xx_writeenable(struct sst25xx_dev_s *priv)
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Enabled\n");
finfo("Enabled\n");
}
/************************************************************************************
@@ -416,7 +416,7 @@ static void sst25xx_sectorerase(struct sst25xx_dev_s *priv, off_t sector, uint8_
offset = sector << priv->sectorshift;
fvdbg("sector: %08lx\n", (long)sector);
finfo("sector: %08lx\n", (long)sector);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -453,7 +453,7 @@ static void sst25xx_sectorerase(struct sst25xx_dev_s *priv, off_t sector, uint8_
/* Deselect the FLASH */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Erased\n");
finfo("Erased\n");
}
/************************************************************************************
@@ -462,7 +462,7 @@ static void sst25xx_sectorerase(struct sst25xx_dev_s *priv, off_t sector, uint8_
static inline int sst25xx_bulkerase(struct sst25xx_dev_s *priv)
{
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -489,7 +489,7 @@ static inline int sst25xx_bulkerase(struct sst25xx_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
sst25xx_waitwritecomplete(priv);
fvdbg("Return: OK\n");
finfo("Return: OK\n");
return OK;
}
@@ -502,7 +502,7 @@ static inline void sst25xx_pagewrite(struct sst25xx_dev_s *priv, FAR const uint8
{
off_t offset = page << priv->pageshift;
fvdbg("page: %08lx offset: %08lx\n", (long)page, (long)offset);
finfo("page: %08lx offset: %08lx\n", (long)page, (long)offset);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -538,7 +538,7 @@ static inline void sst25xx_pagewrite(struct sst25xx_dev_s *priv, FAR const uint8
/* Deselect the FLASH: Chip Select high */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Written\n");
finfo("Written\n");
}
/************************************************************************************
@@ -549,7 +549,7 @@ static inline void sst25xx_pagewrite(struct sst25xx_dev_s *priv, FAR const uint8
static inline void sst25xx_bytewrite(struct sst25xx_dev_s *priv, FAR const uint8_t *buffer,
off_t offset, uint16_t count)
{
fvdbg("offset: %08lx count:%d\n", (long)offset, count);
finfo("offset: %08lx count:%d\n", (long)offset, count);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -585,7 +585,7 @@ static inline void sst25xx_bytewrite(struct sst25xx_dev_s *priv, FAR const uint8
/* Deselect the FLASH: Chip Select high */
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
fvdbg("Written\n");
finfo("Written\n");
}
#endif
@@ -598,7 +598,7 @@ static int sst25xx_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nbl
FAR struct sst25xx_dev_s *priv = (FAR struct sst25xx_dev_s *)dev;
size_t blocksleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the SPI bus until we complete the erase */
@@ -675,7 +675,7 @@ static ssize_t sst25xx_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t
FAR struct sst25xx_dev_s *priv = (FAR struct sst25xx_dev_s *)dev;
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -699,7 +699,7 @@ static ssize_t sst25xx_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_
size_t blocksleft = nblocks;
size_t pagesize = 1 << priv->pageshift;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the SPI bus and write each page to FLASH */
@@ -724,7 +724,7 @@ static ssize_t sst25xx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt
{
FAR struct sst25xx_dev_s *priv = (FAR struct sst25xx_dev_s *)dev;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -760,7 +760,7 @@ static ssize_t sst25xx_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyt
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
sst25xx_unlock(priv->dev);
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -780,7 +780,7 @@ static ssize_t sst25xx_write(FAR struct mtd_dev_s *dev, off_t offset, size_t nby
int pagesize;
int bytestowrite;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* We must test if the offset + count crosses one or more pages
* and perform individual writes. The devices can only write in
@@ -847,7 +847,7 @@ static int sst25xx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct sst25xx_dev_s *priv = (FAR struct sst25xx_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -871,7 +871,7 @@ static int sst25xx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -893,7 +893,7 @@ static int sst25xx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -916,7 +916,7 @@ FAR struct mtd_dev_s *sst25xx_initialize(FAR struct spi_dev_s *dev)
FAR struct sst25xx_dev_s *priv;
int ret;
fvdbg("dev: %p\n", dev);
finfo("dev: %p\n", dev);
/* Allocate a state structure (we allocate the structure instead of using
* a fixed, static allocation so that we can handle multiple FLASH devices.
@@ -974,6 +974,6 @@ FAR struct mtd_dev_s *sst25xx_initialize(FAR struct spi_dev_s *dev)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
}
+27 -27
View File
@@ -210,13 +210,13 @@
#ifdef CONFIG_SST26_DEBUG
# define sstdbg(format, ...) dbg(format, ##__VA_ARGS__)
# define sstlldbg(format, ...) lldbg(format, ##__VA_ARGS__)
# define sstvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
# define sstllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
# define sstinfo(format, ...) info(format, ##__VA_ARGS__)
# define sstllinfo(format, ...) llinfo(format, ##__VA_ARGS__)
#else
# define sstdbg(x...)
# define sstlldbg(x...)
# define sstvdbg(x...)
# define sstllvdbg(x...)
# define sstinfo(x...)
# define sstllinfo(x...)
#endif
/************************************************************************************
@@ -321,7 +321,7 @@ static inline int sst26_readid(struct sst26_dev_s *priv)
uint16_t memory;
uint16_t capacity;
sstvdbg("priv: %p\n", priv);
sstinfo("priv: %p\n", priv);
/* Lock the SPI bus, configure the bus, and select this FLASH part. */
@@ -416,7 +416,7 @@ static void sst26_waitwritecomplete(struct sst26_dev_s *priv)
}
while ((status & SST26_SR_WIP) != 0);
sstvdbg("Complete\n");
sstinfo("Complete\n");
}
/************************************************************************************
@@ -439,7 +439,7 @@ static void sst26_globalunlock(struct sst26_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
sstvdbg("Device unlocked.\n");
sstinfo("Device unlocked.\n");
}
/************************************************************************************
@@ -460,7 +460,7 @@ static void sst26_writeenable(struct sst26_dev_s *priv)
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
sstvdbg("Enabled\n");
sstinfo("Enabled\n");
}
/************************************************************************************
@@ -473,7 +473,7 @@ static void sst26_sectorerase(struct sst26_dev_s *priv, off_t sector, uint8_t ty
offset = sector << priv->sectorshift;
sstvdbg("sector: %08lx\n", (long)sector);
sstinfo("sector: %08lx\n", (long)sector);
/* Send write enable instruction */
@@ -504,7 +504,7 @@ static void sst26_sectorerase(struct sst26_dev_s *priv, off_t sector, uint8_t ty
sst26_waitwritecomplete(priv);
sstvdbg("Erased\n");
sstinfo("Erased\n");
}
/************************************************************************************
@@ -513,7 +513,7 @@ static void sst26_sectorerase(struct sst26_dev_s *priv, off_t sector, uint8_t ty
static inline int sst26_chiperase(struct sst26_dev_s *priv)
{
sstvdbg("priv: %p\n", priv);
sstinfo("priv: %p\n", priv);
/* Send write enable instruction */
@@ -533,7 +533,7 @@ static inline int sst26_chiperase(struct sst26_dev_s *priv)
sst26_waitwritecomplete(priv);
sstvdbg("Return: OK\n");
sstinfo("Return: OK\n");
return OK;
}
@@ -546,7 +546,7 @@ static inline void sst26_pagewrite(struct sst26_dev_s *priv,
{
off_t offset = page << priv->pageshift;
sstvdbg("page: %08lx offset: %08lx\n", (long)page, (long)offset);
sstinfo("page: %08lx offset: %08lx\n", (long)page, (long)offset);
/* Enable the write access to the FLASH */
@@ -576,7 +576,7 @@ static inline void sst26_pagewrite(struct sst26_dev_s *priv,
sst26_waitwritecomplete(priv);
sstvdbg("Written\n");
sstinfo("Written\n");
}
/************************************************************************************
@@ -588,7 +588,7 @@ static inline void sst26_bytewrite(struct sst26_dev_s *priv,
FAR const uint8_t *buffer, off_t offset,
uint16_t count)
{
sstvdbg("offset: %08lx count:%d\n", (long)offset, count);
sstinfo("offset: %08lx count:%d\n", (long)offset, count);
/* Enable the write access to the FLASH */
@@ -619,7 +619,7 @@ static inline void sst26_bytewrite(struct sst26_dev_s *priv,
sst26_waitwritecomplete(priv);
sstvdbg("Written\n");
sstinfo("Written\n");
}
#endif
@@ -634,7 +634,7 @@ static int sst26_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nbloc
FAR struct sst26_dev_s *priv = (FAR struct sst26_dev_s *)dev;
size_t blocksleft = nblocks;
sstvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
sstinfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the SPI bus until we complete the erase */
@@ -664,7 +664,7 @@ static ssize_t sst26_bread(FAR struct mtd_dev_s *dev, off_t startblock,
FAR struct sst26_dev_s *priv = (FAR struct sst26_dev_s *)dev;
ssize_t nbytes;
sstvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
sstinfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -689,7 +689,7 @@ static ssize_t sst26_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t
size_t blocksleft = nblocks;
size_t pagesize = 1 << priv->pageshift;
sstvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
sstinfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the SPI bus and write each page to FLASH */
@@ -714,7 +714,7 @@ static ssize_t sst26_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes
{
FAR struct sst26_dev_s *priv = (FAR struct sst26_dev_s *)dev;
sstvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
sstinfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Lock the SPI bus and select this FLASH part */
@@ -743,7 +743,7 @@ static ssize_t sst26_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes
SPI_SELECT(priv->dev, SPIDEV_FLASH, false);
sst26_unlock(priv->dev);
sstvdbg("return nbytes: %d\n", (int)nbytes);
sstinfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -763,7 +763,7 @@ static ssize_t sst26_write(FAR struct mtd_dev_s *dev, off_t offset, size_t nbyte
int pagesize;
int bytestowrite;
sstvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
sstinfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* We must test if the offset + count crosses one or more pages
* and perform individual writes. The devices can only write in
@@ -830,7 +830,7 @@ static int sst26_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct sst26_dev_s *priv = (FAR struct sst26_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
sstvdbg("cmd: %d \n", cmd);
sstinfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -854,7 +854,7 @@ static int sst26_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
ret = OK;
sstvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
sstinfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -876,7 +876,7 @@ static int sst26_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
sstvdbg("return %d\n", ret);
sstinfo("return %d\n", ret);
return ret;
}
@@ -899,7 +899,7 @@ FAR struct mtd_dev_s *sst26_initialize_spi(FAR struct spi_dev_s *dev)
FAR struct sst26_dev_s *priv;
int ret;
sstvdbg("dev: %p\n", dev);
sstinfo("dev: %p\n", dev);
/* Allocate a state structure (we allocate the structure instead of using
* a fixed, static allocation so that we can handle multiple FLASH devices.
@@ -956,6 +956,6 @@ FAR struct mtd_dev_s *sst26_initialize_spi(FAR struct spi_dev_s *dev)
/* Return the implementation-specific state structure as the MTD device */
sstvdbg("Return %p\n", priv);
sstinfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
}
+2 -2
View File
@@ -814,8 +814,8 @@ FAR struct mtd_dev_s *sst39vf_initialize(void)
/* Now see if we can suport the part */
fvdbg("Manufacturer: %02x\n", manufacturer);
fvdbg("Chip ID: %04x\n", chipid);
finfo("Manufacturer: %02x\n", manufacturer);
finfo("Chip ID: %04x\n", chipid);
if (manufacturer != SST_MANUFACTURER_ID)
{
+23 -23
View File
@@ -333,7 +333,7 @@ static inline int w25_readid(struct w25_dev_s *priv)
uint16_t memory;
uint16_t capacity;
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Lock the SPI bus, configure the bus, and select this FLASH part. */
@@ -352,7 +352,7 @@ static inline int w25_readid(struct w25_dev_s *priv)
SPI_SELECT(priv->spi, SPIDEV_FLASH, false);
w25_unlock(priv->spi);
fvdbg("manufacturer: %02x memory: %02x capacity: %02x\n",
finfo("manufacturer: %02x memory: %02x capacity: %02x\n",
manufacturer, memory, capacity);
/* Check for a valid manufacturer and memory type */
@@ -557,7 +557,7 @@ static void w25_sectorerase(struct w25_dev_s *priv, off_t sector)
{
off_t address = sector << W25_SECTOR_SHIFT;
fvdbg("sector: %08lx\n", (long)sector);
finfo("sector: %08lx\n", (long)sector);
/* Wait for any preceding write or erase operation to complete. */
@@ -594,7 +594,7 @@ static void w25_sectorerase(struct w25_dev_s *priv, off_t sector)
static inline int w25_chiperase(struct w25_dev_s *priv)
{
fvdbg("priv: %p\n", priv);
finfo("priv: %p\n", priv);
/* Wait for any preceding write or erase operation to complete. */
@@ -615,7 +615,7 @@ static inline int w25_chiperase(struct w25_dev_s *priv)
/* Deselect the FLASH */
SPI_SELECT(priv->spi, SPIDEV_FLASH, false);
fvdbg("Return: OK\n");
finfo("Return: OK\n");
return OK;
}
@@ -628,7 +628,7 @@ static void w25_byteread(FAR struct w25_dev_s *priv, FAR uint8_t *buffer,
{
uint8_t status;
fvdbg("address: %08lx nbytes: %d\n", (long)address, (int)nbytes);
finfo("address: %08lx nbytes: %d\n", (long)address, (int)nbytes);
/* Wait for any preceding write or erase operation to complete. */
@@ -682,7 +682,7 @@ static void w25_pagewrite(struct w25_dev_s *priv, FAR const uint8_t *buffer,
{
uint8_t status;
fvdbg("address: %08lx nwords: %d\n", (long)address, (int)nbytes);
finfo("address: %08lx nwords: %d\n", (long)address, (int)nbytes);
DEBUGASSERT(priv && buffer && (address & 0xff) == 0 &&
(nbytes & 0xff) == 0);
@@ -739,7 +739,7 @@ static void w25_pagewrite(struct w25_dev_s *priv, FAR const uint8_t *buffer,
static inline void w25_bytewrite(struct w25_dev_s *priv, FAR const uint8_t *buffer,
off_t offset, uint16_t count)
{
fvdbg("offset: %08lx count:%d\n", (long)offset, count);
finfo("offset: %08lx count:%d\n", (long)offset, count);
/* Wait for any preceding write to complete. We could simplify things by
* perform this wait at the end of each write operation (rather than at
@@ -774,7 +774,7 @@ static inline void w25_bytewrite(struct w25_dev_s *priv, FAR const uint8_t *buff
/* Deselect the FLASH: Chip Select high */
SPI_SELECT(priv->spi, SPIDEV_FLASH, false);
fvdbg("Written\n");
finfo("Written\n");
}
#endif /* defined(CONFIG_MTD_BYTE_WRITE) && !defined(CONFIG_W25_READONLY) */
@@ -823,7 +823,7 @@ static FAR uint8_t *w25_cacheread(struct w25_dev_s *priv, off_t sector)
shift = W25_SECTOR_SHIFT - W25_SECTOR512_SHIFT;
esectno = sector >> shift;
fvdbg("sector: %ld esectno: %d shift=%d\n", sector, esectno, shift);
finfo("sector: %ld esectno: %d shift=%d\n", sector, esectno, shift);
/* Check if the requested erase block is already in the cache */
@@ -879,7 +879,7 @@ static void w25_cacheerase(struct w25_dev_s *priv, off_t sector)
if (!IS_ERASED(priv))
{
off_t esectno = sector >> (W25_SECTOR_SHIFT - W25_SECTOR512_SHIFT);
fvdbg("sector: %ld esectno: %d\n", sector, esectno);
finfo("sector: %ld esectno: %d\n", sector, esectno);
w25_sectorerase(priv, esectno);
SET_ERASED(priv);
@@ -921,7 +921,7 @@ static void w25_cachewrite(FAR struct w25_dev_s *priv, FAR const uint8_t *buffer
if (!IS_ERASED(priv))
{
off_t esectno = sector >> (W25_SECTOR_SHIFT - W25_SECTOR512_SHIFT);
fvdbg("sector: %ld esectno: %d\n", sector, esectno);
finfo("sector: %ld esectno: %d\n", sector, esectno);
w25_sectorerase(priv, esectno);
SET_ERASED(priv);
@@ -956,7 +956,7 @@ static int w25_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks
FAR struct w25_dev_s *priv = (FAR struct w25_dev_s *)dev;
size_t blocksleft = nblocks;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock access to the SPI bus until we complete the erase */
@@ -994,7 +994,7 @@ static ssize_t w25_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nbl
{
ssize_t nbytes;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* On this device, we can handle the block read just like the byte-oriented read */
@@ -1027,7 +1027,7 @@ static ssize_t w25_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t nb
#else
FAR struct w25_dev_s *priv = (FAR struct w25_dev_s *)dev;
fvdbg("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
finfo("startblock: %08lx nblocks: %d\n", (long)startblock, (int)nblocks);
/* Lock the SPI bus and write all of the pages to FLASH */
@@ -1054,7 +1054,7 @@ static ssize_t w25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
{
FAR struct w25_dev_s *priv = (FAR struct w25_dev_s *)dev;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* Lock the SPI bus and select this FLASH part */
@@ -1062,7 +1062,7 @@ static ssize_t w25_read(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
w25_byteread(priv, buffer, offset, nbytes);
w25_unlock(priv->spi);
fvdbg("return nbytes: %d\n", (int)nbytes);
finfo("return nbytes: %d\n", (int)nbytes);
return nbytes;
}
@@ -1081,7 +1081,7 @@ static ssize_t w25_write(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
int index;
int bytestowrite;
fvdbg("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
finfo("offset: %08lx nbytes: %d\n", (long)offset, (int)nbytes);
/* We must test if the offset + count crosses one or more pages
* and perform individual writes. The devices can only write in
@@ -1145,7 +1145,7 @@ static int w25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
FAR struct w25_dev_s *priv = (FAR struct w25_dev_s *)dev;
int ret = -EINVAL; /* Assume good command with bad parameters */
fvdbg("cmd: %d \n", cmd);
finfo("cmd: %d \n", cmd);
switch (cmd)
{
@@ -1174,7 +1174,7 @@ static int w25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
#endif
ret = OK;
fvdbg("blocksize: %d erasesize: %d neraseblocks: %d\n",
finfo("blocksize: %d erasesize: %d neraseblocks: %d\n",
geo->blocksize, geo->erasesize, geo->neraseblocks);
}
}
@@ -1196,7 +1196,7 @@ static int w25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
break;
}
fvdbg("return %d\n", ret);
finfo("return %d\n", ret);
return ret;
}
@@ -1219,7 +1219,7 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *spi)
FAR struct w25_dev_s *priv;
int ret;
fvdbg("spi: %p\n", spi);
finfo("spi: %p\n", spi);
/* Allocate a state structure (we allocate the structure instead of using
* a fixed, static allocation so that we can handle multiple FLASH devices.
@@ -1292,6 +1292,6 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *spi)
/* Return the implementation-specific state structure as the MTD device */
fvdbg("Return %p\n", priv);
finfo("Return %p\n", priv);
return (FAR struct mtd_dev_s *)priv;
}