SAMA5 NAND: Still debugging

This commit is contained in:
Gregory Nutt
2013-11-28 12:21:33 -06:00
parent f171394ba9
commit 1ea447867a
10 changed files with 66 additions and 37 deletions
+2 -1
View File
@@ -311,7 +311,8 @@ struct nxffs_blkstats_s
off_t ngood; /* Number of good FLASH blocks found */
off_t nbad; /* Number of well-formatted FLASH blocks marked as bad */
off_t nunformat; /* Number of unformatted FLASH blocks */
off_t ncorrupt; /* Number of blocks with correupted format info */
off_t ncorrupt; /* Number of blocks with corrupted format info */
off_t nbadread; /* Number of blocks that could not be read */
};
/****************************************************************************
+14 -4
View File
@@ -107,8 +107,19 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume,
ret = MTD_BREAD(volume->mtd, ioblock, volume->blkper, volume->pack);
if (ret < volume->blkper)
{
fdbg("Failed to read erase block %d: %d\n", ioblock / volume->blkper, -ret);
return ret;
/* This should not happen at all on most FLASH. A bad read will
* happen normally with a NAND device that has uncorrectable blocks.
* So, just for NAND, we keep the count of unreadable blocks.
*/
fdbg("Failed to read erase block %d: %d\n",
ioblock / volume->blkper, ret);
/* Declare all blocks in the eraseblock as bad */
stats->nblocks += volume->blkper;
stats->nbadread += volume->blkper;
continue;
}
/* Process each logical block */
@@ -146,7 +157,6 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume,
fdbg(" Bad blocks: %d\n", stats->nbad);
fdbg(" Unformatted blocks: %d\n", stats->nunformat);
fdbg(" Corrupt blocks: %d\n", stats->ncorrupt);
fdbg(" Undreadable blocks: %d\n", stats->nbadread);
return OK;
}