NAND JFFS2 bad block usage
Rick Bronson
rick at efn.org
Tue Nov 18 17:54:06 EST 2003
Hi,
I'm trying to understand NAND bad block usage under JFFS2. I'm
using the 11/16/03 cvs version of mtd on an ARM. I have a partition
(mtd0) on my 32 Mbyte NAND (Toshiba TC58256FT/DC) that has no bad
blocks and I can erase/copy and cmp the file on NAND with the original
and it all works.
I also have a partition (mtd1) with one bad block as reported by u-boot:
Uboot> nand bad
Device 0 bad blocks:
0x00dec000
and sure enough, when I do:
./eraseall --jffs2 /dev/mtd1
I get:
Erasing 16 Kibyte @ e8000 -- 8 % complete. Cleanmarker written at e8000.
Erasing 16 Kibyte @ ec000 -- 8 % complete.
./eraseall: /dev/mtd1: MTD Erase failure: Input/output error
Erasing 16 Kibyte @ f0000 -- 8 % complete. Cleanmarker written at f0000.
Erasing 16 Kibyte @ f4000 -- 8 % complete. Cleanmarker written at f4000.
mtd1 starts at 0x00d00000 so the offset of ec000 this makes sense
with what u-boot reported above.
When I copy a file to mtd1, it doesn't report any errors but it
doesn't compare (using cmp) with the original file. Looking in
nand.c, it doesn't look like there is any check for bad blocks in the
write routine. I must be missing something?
I'm using linux-2.4.19, and here's my config:
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_NAND=y
Here's my hardware specific NAND stuff:
my_nand->eccmode = NAND_ECC_SOFT; /* enable ECC */
my_nand->chip_delay = 20;
Any help greatly appreciated.
Rick Bronson
More information about the linux-mtd
mailing list