2009-12-02 14:32:54     plat_nand.c

Document created by Aaronwu Employee on Aug 19, 2013
Version 1Show Document
  • View in full screen mode

2009-12-02 14:32:54     plat_nand.c

Chris Brissette (UNITED STATES)

Message: 82982   

 

I have been seeing alot of problems with the generic platform driver with NAND on a custom 537 Stamp board. There has been alot of write & read problems. And alot of blocks being retired.

 

We have been using the only bfin_nand driver with yaffs and never had a problem.

 

Bonnie would fail everytime on the plat_nand.c while the bfin works fine. Same hardware.

 

kernel:    Linux release 2.6.28.10-ADI-2009R1.1-svn7900, build #270 Wed Dec 2 13:47:31 EST 2009

toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)

user-dist: release svn-9201, build #123 Wed Dec 2 13:46:32 EST 2009

 

Some of the errors look like this, there are many.

 

nand_erase: attempt to erase a bad block at page 0x00000040

[ 2150.196000] mtdblock: erase of region [0x20000, 0x20000] on "linux kernel(nand)" failed

[ 2150.200000] end_request: I/O error, dev mtdblock0, sector 512

 

Do I need to have GPIO enabled to use the generic driver?

 

Chris

QuoteReplyEditDelete

 

 

2009-12-02 14:53:12     Re: plat_nand.c

Mike Frysinger (UNITED STATES)

Message: 82984   

 

i dont know what you mean by "GPIO enabled".  the generic driver is largely hooks back into your own board file.

 

the bf537-stamp plat_nand example should be equivalent to the bfin_nand example:

https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:bfin_async_nand

QuoteReplyEditDelete

 

 

2009-12-02 15:06:58     Re: plat_nand.c

Chris Brissette (UNITED STATES)

Message: 82985   

 

I was using the stamp board file. I only changed the ready bit to

 

#define BFIN_NAND_PLAT_READY GPIO_PF4.

 

I wasn't sure if GPIOLIB needed to be enabled for the generic NAND driver.

 

But I compiled with it in and I get the same errors.

 

[17179688.604000] **>> Block 1106 needs retiring

[17179688.608000] **>> yaffs write required 2 attempts

[17179688.648000] **>> ] **>> Block 1116 needs retiring

[17179689.228000] **>> Block 1117 needs retiring

[17179689.232000] **>> Block 1117 retired

[17179689.240000] **>> yaffs write required 3 attempts

[17179689.248000] **>> Block 1118 needs retiring

[17179689.256000] **>> yaffs write required 2 attempts

[17179689.296000] **>> Block 1107 retired

 

It just seems to me like it's a floating bit almost the way that it gets itself to work. Just retires blocks like crazy.

 

root:/mnt/NAND> cat /proc/yaffs

YAFFS built:Dec  2 2009 14:46:02

$Id: yaffs_fs.c,v 1.71 2009/01/22 00:45:54 charles Exp $

$Id: yaffs_guts.c,v 1.74 2009/01/18 23:24:08 charles Exp $

 

Device 0 "file system(nand)"

startBlock......... 0

endBlock........... 4031

totalBytesPerChunk. 2048

nDataBytesPerChunk. 2048

chunkGroupBits..... 0

chunkGroupSize..... 1

nErasedBlocks...... 3787

nReservedBlocks.... 5

blocksInCheckpoint. 0

nTnodesCreated..... 7900

nFreeTnodes........ 1069

nObjectsCreated.... 8000

nFreeObjects....... 1075

nFreeChunks........ 245531

nPageWrites........ 0

nPageReads......... 0

nBlockErasures..... 6

nGCCopies.......... 641

garbageCollections. 102

passiveGCs......... 102

nRetriedWrites..... 110

nShortOpCaches..... 10

nRetireBlocks...... 87

eccFixed........... 0

eccUnfixed......... 0

tagsEccFixed....... 0

tagsEccUnfixed..... 0

cacheHits.......... 390

nDeletedFiles...... 0

nUnlinkedFiles..... 1015

nBackgroudDeletions 0

useNANDECC......... 1

isYaffs2........... 1

inbandTags......... 0

 

 

I tried it on the trunk too with the same problem.

 

Chris

QuoteReplyEditDelete

 

 

2009-12-02 15:19:48     Re: plat_nand.c

Mike Frysinger (UNITED STATES)

Message: 82986   

 

gpiolib is not necessary as long as your GPIOs are all on-chip

 

you might want to try defining your own read_buf and write_buf functions and copy & pasting the ones from the old bfin_nand driver (notice the SSYNC()s)

QuoteReplyEditDelete

Attachments

    Outcomes