For some years, we have been shipping an open-source ARM9 based hardware product that uses kernel 2.4.21 and yaffs on NAND Flash (SAMSUNG 32MB, 512+16). Never had a single problem with it. - Works great.
I am now trying to update the product to Linux 2.6.17.14 (As supplied by Cirrus Logic) and it is giving me fits.
The product is a little unconventional because the flash chip is not on the data bus but on a GPIO port. It was a simple matter to change the driver to accommodate that. Something like:
#undef readb
#define readb(x) SMread(x)
And then write a FUNCTION SMread() to read the GPIO port as required. - Same for write.
In the old product, I can mtd_debug write a large file to the device and then read it back successfully.
With the upgraded kernel I can do the same thing. It seems to work fine.
~ # mtd_debug write /dev/mtdblock7 0 150000 foxes
Copied 150000 bytes from foxes to address 0x00000000 in flash
~ # mtd_debug read /dev/mtdblock7 0 150000 foxes.out
Copied 150000 bytes from address 0x00000000 in flash to foxes.out
~ # md5sum f*
ab2672a5b7fd37e0b1c655252d918fe3 foxes
ab2672a5b7fd37e0b1c655252d918fe3 foxes.out
If I use my low-level utility that talks directly to the chip and erase it and blank check it, it says it erases and then finds 23 - 512 byte pages that did not erase properly.
When I start the kernel, it scans the chip, finds it and reports 1024 bad blocks. Yaffs mounts fine and I can read and write files.
DF shows only 51% available
Everything now works fine for a while, but if I check back with the idle system in a couple of hours, dmesg reports all kinds of bad blocks and retirement messages and DF shows 0 available space.
I’m sure I must have the configuration wrong somewhere.
I would really appreciate some advice on the way I have the system set.
Thanks in advance,
Steve
cat /proc/yaffs
YAFFS built:Jul 25 2007 10:21:58
$Id: yaffs_fs.c,v 1.61 2007/07/18 19:40:38 charles Exp $
$Id: yaffs_guts.c,v 1.51 2007/07/23 05:14:08 charles Exp $
Device 0 "RT2 Reports"
startBlock......... 0
endBlock........... 2047
nDataBytesPerChunk. 512
chunkGroupBits..... 0
chunkGroupSize..... 1
nErasedBlocks...... 985
nReservedBlocks.... 5
nCheckptResBlocks.. 0
blocksInCheckpoint. 0
nTnodesCreated..... 5400
nFreeTnodes........ 63
nObjectsCreated.... 400
nFreeObjects....... 42
nFreeChunks........ 31934
nPageWrites........ 1173
nPageReads......... 1197
nBlockErasures..... 34
nGCCopies.......... 460
garbageCollections. 33
passiveGCs......... 33
nRetriedWrites..... 0
nShortOpCaches..... 10
nRetireBlocks...... 0
eccFixed........... 0
eccUnfixed......... 0
tagsEccFixed....... 0
tagsEccUnfixed..... 640
cacheHits.......... 0
nDeletedFiles...... 102
nUnlinkedFiles..... 126
nBackgroudDeletions 0
useNANDECC......... 1
isYaffs2........... 0
~ #
CONFIG_YAFFS_FS=y
CONFIG_YAFFS_YAFFS1=y
CONFIG_YAFFS_9BYTE_TAGS=y
CONFIG_YAFFS_YAFFS2=y
# CONFIG_YAFFS_AUTO_YAFFS2 is not set
# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_CONCAT is not set
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_REDBOOT_PARTS=y
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
# CONFIG_MTD_AFS_PARTS is not set
#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_NOSWAP=y
# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
# CONFIG_MTD_CFI_GEOMETRY is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_OTP is not set
CONFIG_MTD_CFI_INTELEXT=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_STAA=y
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
CONFIG_MTD_ROM=y
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_OBSOLETE_CHIPS is not set
#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=0x0
CONFIG_MTD_PHYSMAP_LEN=0x0
CONFIG_MTD_PHYSMAP_BANKWIDTH=1
# CONFIG_MTD_ARM_INTEGRATOR is not set
# CONFIG_MTD_EDB93XX is not set
# CONFIG_MTD_PLATRAM is not set
#
# Self-contained MTD device drivers
#
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set
#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
#
# NAND Flash Device Drivers
#
CONFIG_MTD_NAND=y
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
CONFIG_MTD_NAND_EDB93xx=y
CONFIG_MTD_NAND_IDS=y
# CONFIG_MTD_NAND_NANDSIM is not set
#
# OneNAND Flash Device Drivers
#
# CONFIG_MTD_ONENAND is not set