bad eraseblock in nandflash when booting linux-2.6.12
Hi!
I am running 2.6.12 on EDB9312 platform, using Samsung nand flash K9F1208UOM. and the GPIO pins connect to nand
flash's ALE,CLE,NCE,but the BUSY pin is float.so i declared" this->dev_ready = NULL;" in function"int __init ep9312_init (void)".
Now,it boot with NFS,the kernel can detect the nand flash,but it report there are many "Bad eraseblock",The
following is part of my booting info:
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Bad eraseblock 6 at 0x00018000
Bad eraseblock 43 at 0x000ac000
Bad eraseblock 68 at 0x00110000
Bad eraseblock 101 at 0x00194000
Bad eraseblock 159 at 0x0027c000
Bad eraseblock 171 at 0x002ac000
...
(maybe the total"bad block" is 160)
Bad eraseblock 3951 at 0x03dbc000
Bad eraseblock 4011 at 0x03eac000
Bad eraseblock 4021 at 0x03ed4000
Bad eraseblock 4048 at 0x03f40000
Bad eraseblock 4074 at 0x03fa8000
cmdlinepart partition parsing not available
sing static partition definition
reating 1 MTD partitions on "edb9312-nand":
0x00000000-0x04000000 : "EP9312 Nand Flash"
...
/******************************/
But when i reboot system it report:
/******************************/
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Bad eraseblock 1 at 0x00004000
Bad eraseblock 12 at 0x00030000
Bad eraseblock 48 at 0x000c0000
Bad eraseblock 83 at 0x0014c000
Bad erasblock 89 at 0x00164000
Bad eraseblock 110 at 0x001b8000
...
Bad eraseblock 4046 at 0x03f38000
Bad eraseblock 4051 at 0x03f4c000
Bad eraseblock 4079 at 0x03fbc000
Bad eraseblock 4090 at 0x03fe8000
/******************************/
It seem that the location of bad eraseblocks is random in every booting time.
I want to use flash_eraseall to erase all block,but it skiped the bad block.so i hacked ../util/flash_eraseall.c
by comment out the bbttest:
../util/flash_eraseall.c
main()
{
...
/***comment out not to check bbt**/
/*
if (bbtest) {
...
}
*/
if (!quiet) {
...
}
compile it and make out flash_eraseall_hack
/***************************************/
~#flash_eraseall_hack -j /dev/mtd5
MTD_open
MTD_ioctl
MTD_ioctl
rasing 16 KibyMTD_ioctl
e @ 0 -- 0 % complete.MTD_ioctl leanmarker wriMTD_ioctl
ten at 0. ... Erasing 16 MTD_ioctl ibyte @ 80000 -nand_erase: Failed erase, page 0x00000680 0 % complete. Cleanmarker wriMTD_ioctl ten at 80000. .... /************************************/ there is a little "Failed erase" in this operation. but also it is random in every time i do flash_eraseall_hack. Now i don't know the problem is caused by my nand flash device driver or MTD driver.can anybody help me! Thanks advanced! Best Regards,
JianZhang
[email protected]
2005-07-29
Please fix your mail client and wrap lines at 76.
Also we really don't need all the empty lines between the information you want to send us. Reduce the information to the necessary amount to describe your problem and do not flood us with redundant crap.
Quoted 2 lines · JianZhang
NAND device: Manufacturer ID:
0xec, Chip ID:0x76(Samsung NAND 64MiB 3,3V 8-bit)NAND_ECC_NONEselected by board driver. This is not recommended !!
Use software ECC !
Quoted 2 lines
Scanning device for bad blocks
Bad eraseblock 6 at0x00018000
<SNIP>
Quoted 5 lines
Scanning device for bad blocks
Bad eraseblock 1 at0x00004000It seem that the location of bad eraseblocks is random in every booting time.
Yes, it's probably related to timing. Did you set this->chip_delay correct ? Is the timing of your CPU setup to match the NAND timing specs ?
Quoted 2 lines
I want to use
flash_eraseallto erase all block,but it skiped the bad block.so i hacked ....
What are you trying to solve ? Erase random bad blocks ? Fix the random read problem first before messing with your FLASH chip.
I really start to question the quality of engineering schools. Did nobody ever tell you to solve basic problems first instead of trying to work around them without even having a clue whats going on ?
Quoted 2 lines
there is a little "Failed erase" in this operation. but also it is random in every time i do
flash_eraseall_hack.
The kernel refuses to erase bad blocks, even if you remove the check in flash_erase_all. And I recommend you not to touch that check in the kernel, unless you exactly know what you are doing.
tglx