[Yaffs] cvs YAFFS + MTD cvs + 2.4.27-vrs1 problems

Aras Vaichas arasv@magellan-technology.com
Mon, 06 Dec 2004 12:25:57 +1100


This is a multi-part message in MIME format.
--------------020601090004020608000204
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Thomas Gleixner wrote:
> Hmm, can you verify that the chip is erased correctly, when you do an
> flash_eraseall ? Dump it and check for nonzero pages. 

I used:
# flash_eraseall /dev/mtd/4
# nanddump /dev/mtd/4 dump.out

No, not all spages are erased after doing a flash_eraseall. i.e. they were not 
all 0xff.

The very first 8MB Flash partition that I started using for development is 
missing about 60% of its space due to "bad eraseblocks". The second 8MB Flash 
partition is missing only 1%. Luckily I make my own Smartmedia cards, so I can 
simply solder in a new Flash chip for further development. From now on I think 
I will make my partitions much smaller so I don't "lose" as many. ;)

y2 # df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/root            102901816  77308708  20365960  79% /
tmpfs                    15428       152     15276   1% /var
/dev/mtdblock/4          16368      9904      6464  61% /mnt/y1
/dev/mtdblock/5          16368       176     16192   1% /mnt/y2
y2 # ll /mnt/y1
yaffs_readdir: starting at 0
yaffs_readdir: starting at 3
drw-rw-rw-    1 root     root          512 Dec  6 11:12 ./
drwxrwxr-x    9 root     100          4096 Nov 11 10:17 ../
drw-rw-rw-    1 root     root          512 Dec  6 11:12 lost+found/
y2 # ll /mnt/y2
yaffs_readdir: starting at 0
yaffs_readdir: starting at 3
drw-rw-rw-    1 root     root          512 Dec  6 11:12 ./
drwxrwxr-x    9 root     100          4096 Nov 11 10:17 ../
drw-rw-rw-    1 root     root          512 Dec  6 11:12 lost+found/


 >>Surely it's not the easy to "break" a NAND chip? Can my original NAND be 
recovered?
 >>
 > It's quite easy, if the timing is wrong or if the rdy/busy check is not
 > reliable.

Is there a utility that writes to every single page, reads back the data and 
then marks the pages correctly? Or are those "bad eraseblocks" permanently lost?


 > Can I have a look at your board driver ?

Sure, see attached.

I simply modified the existing at91_nand.c file to compile with the latest MTD 
drivers. see 
http://lists.infradead.org/pipermail/linux-mtd/2004-December/011039.html for 
details on the changes I made to at91_nand.c


regards,


Aras Vaichas

--------------020601090004020608000204
Content-Type: text/plain;
 name="at91_nand.c"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="at91_nand.c"

LyoKICogZHJpdmVycy9hdDkxL210ZC9hdDkxX25hbmQuYwogKgogKiAgQ29weXJpZ2h0IChj
KSAyMDAzIFJpY2sgQnJvbnNvbgogKgogKiAgRGVyaXZlZCBmcm9tIGRyaXZlcnMvbXRkL25h
bmQvYXV0Y3B1MTIuYwogKgkgQ29weXJpZ2h0IChjKSAyMDAxIFRob21hcyBHbGVpeG5lciAo
Z2xlaXhuZXJAYXV0cm9uaXguZGUpCiAqCiAqICBEZXJpdmVkIGZyb20gZHJpdmVycy9tdGQv
c3BpYS5jCiAqCSBDb3B5cmlnaHQgKEMpIDIwMDAgU3RldmVuIEouIEhpbGwgKHNqaGlsbEBj
b3R3LmNvbSkKICoKICogVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4g
cmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkKICogaXQgdW5kZXIgdGhlIHRlcm1zIG9m
IHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIgYXMKICogcHVibGlz
aGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24uCiAqCiAqLwoKI2luY2x1ZGUg
PGxpbnV4L3NsYWIuaD4KI2luY2x1ZGUgPGxpbnV4L21vZHVsZS5oPgojaW5jbHVkZSA8bGlu
dXgvbXRkL210ZC5oPgojaW5jbHVkZSA8bGludXgvbXRkL25hbmQuaD4KI2luY2x1ZGUgPGxp
bnV4L210ZC9wYXJ0aXRpb25zLmg+CiNpbmNsdWRlIDxhc20vaW8uaD4KI2luY2x1ZGUgPGFz
bS9hcmNoL2hhcmR3YXJlLmg+CiNpb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