2009-01-20 11:49:16     nand : need your help to configure

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

2009-01-20 11:49:16     nand : need your help to configure

Stephane DEBUSNE (FRANCE)

Message: 68157   

 

Hi all,

 

i really need your help to setup nand flash on my board : I've got a custom board based on a bf527. This board boots on a serial (SPI) flash. Uboot is in the serial flash, uClinux and root filesystem also. On this board, i may have a nand flash connected to the port H of the bf527. I want to use a micron MT29F2G08AACWP nand flash.

 

First of all I tried to add nand flash support to the kernel by adding in mtd support section : nand flash support -> Blackfin on chip nand flash controller driver.

 

I've also checked BF5xx nand hardware ECC, Verify nand page writes and nand ecc smart media byte order.

 

In the board.c file, i just kept the default nand flash description of the ezkit for the moment.

 

When i try to boot on this generated kernel... it crashs. see attached file for dumping.

 

Note that for the moment there is no NAND flash on the board. Is this the reason of the crash ?

 

Could you please help me to solve this ? Tomorrow morning i'll try the same thing with a nand flash chip soldered (and the description in board.c adapted) to see if something is changing...

 

best regards

 

Stephane

 

capture.txt

QuoteReplyEditDelete

 

 

2009-01-20 12:00:16     Re: nand : need your help to configure

Mike Frysinger (UNITED STATES)

Message: 68158   

 

if you boot the kernel w/the nand driver disabled and things dont crarsh, then that is probably why

QuoteReplyEditDelete

 

 

2009-01-20 12:05:25     Re: nand : need your help to configure

Stephane DEBUSNE (FRANCE)

Message: 68159   

 

yes, without the nand flash settings, the kernel boots weel.

 

In the case where nand flash support is added, i feel strange that it crashs if no nand flash is detected, so i thought i was missing something in the configuration...

 

anyway, i'll try with a nand flash chip.

QuoteReplyEditDelete

 

 

2009-01-20 16:09:47     Re: nand : need your help to configure

Mike Frysinger (UNITED STATES)

Message: 68163   

 

maybe the nand error path is incorrect ... we dont have any bf52x boards to test with though

QuoteReplyEditDelete

 

 

2009-01-21 05:13:05     Re: nand : need your help to configure

Stephane DEBUSNE (FRANCE)

Message: 68187   

 

So, when the nand flash device is plugged on the board, the kernel boots well.

 

=> BF5xx on-chip NAND FLash Controller Driver, Version 1.2 (c) 2007 Analog Devices,Inc.

bf5xx-nand bf5xx-nand.0: page_size=256, data_width=8, wr_dly=3, rd_dly=3

NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)

Creating 1 MTD partitions on "NAND 256MiB 3,3V 8-bit":

0x00000000-0x10000000 : "Nand File System"

 

So it seems that the driver crashs the kernel when the nand is not detected. (Note that i'm using the uClinux-dist-2008R1.5-RC3 and note the cvs trunk. maybe there has been some changes ?).

 

 

 

two more questions :

 

* the flash is for the moment the mtdblock0 partition. My spi flash partitions are now Mtdblock1 and 2. Is there a mean to put the spi flash first ? i tried to change the order in the board.c file but it seems not to work as i expected.

 

* i tried to mount the nand flash with jffs2 => it "hangs" the system. no answer from mount command and Ctrl+C does not quit... but eraseall command seems to do something :

 

root:/> eraseall /dev/mtd0

Erasing 128 Kibyte @ 520000 --  2 % complete.nand_erase: attempt to erase a bad

block at page 0x00001480

Erasing 128 Kibyte @ a40000 --  4 % complete.

eraseall: /dev/mtd0: MTD Erase failure: Input/output error

Erasing 128 Kibyte @ 25a0000 -- 14 % complete.nd_erase: attempt to erase a bad b

lock at page 0x000051c0

Erasing 128 Kibyte @ 28e0000 -- 15 % complete.

eraseall: /dev/mtd0: MTD Erase failure: Input/output error

Erasing 128 Kibyte @ 4ee0000 -- 14 % complete.and_erase: attempt to erase a bad

block at page 0x0000a500

Erasing 128 Kibyte @ 5280000 --  0 % complete.

eraseall: /dev/mtd0: MTD Erase failure: Input/output error

Erasing 128 Kibyte @ e9a0000 -- 11 % complete.nd_erase: attempt to erase a bad b

lock at page 0x0001da80

Erasing 128 Kibyte @ ed40000 -- 12 % complete.

eraseall: /dev/mtd0: MTD Erase failure: Input/output error

Erased 262144 Kibyte @ 0 -- 100% complete.

 

root:/> mount -t jffs2 /dev/mtdblock0 /mnt

 

What should be done in order to mount to work ? do i need to use yaafs ?

 

thanks for any answer

 

 

 

regards

 

 

 

Stephane

QuoteReplyEditDelete

 

 

2009-01-21 05:20:27     Re: nand : need your help to configure

Mike Frysinger (UNITED STATES)

Message: 68189   

 

yaffs is better for NAND flashes

 

mtd order matches probe order, so if NAND is probed before SPI, then that's the order they'll be declared.  you can try re-ordering your platform_devices that are passed to platform_add_devices() ...

 

otherwise, try reviewing the documentation:

http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:mtd

QuoteReplyEditDelete

 

 

2009-01-21 05:32:29     Re: nand : need your help to configure

Stephane DEBUSNE (FRANCE)

Message: 68190   

 

ok, i'll try yaffs so.

 

for the mtd order, i tought i did that. i'll check again.

 

I'll also try to investigate why the kernel crash without the nand flash device (i've got a second board without the chip)

 

thanks for your replies, i'll keep you informed

QuoteReplyEditDelete

 

 

2009-01-21 09:44:35     Re: nand : need your help to configure

Stephane DEBUSNE (FRANCE)

Message: 68196   

 

so... still a t the same point :

 

whith yaffs2, the mount is ok but any other action failed : create a directory, a file, umount... the console stalls.

 

Moreover, fot the probe order : if i change the add_platform_device array, it does not change the probe order. The nand is always probed before the spi flash... i'll create a new thread for this and keep this one for the nand problem

 

 

 

So it seems that i have the same problem than Samuel (see https://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&_forum_action=ForumMessageBrowse&thread_id=32082 )

 

 

 

Any idea ?

 

 

 

regards

QuoteReplyEditDelete

 

 

2009-01-26 16:54:33     Re: nand : need your help to configure

Robin Getz (UNITED STATES)

Message: 68360   

 

Stephane:

 

Are you using trunk or the 2008R1.5 release? If the "console stalls" - does watchdog kick in? Is ethernet alive?

 

-Robin

QuoteReplyEditDelete

 

 

2009-01-29 05:20:41     Re: nand : need your help to configure

Stephane DEBUSNE (FRANCE)

Message: 68508   

 

Hi Robin,

 

 

 

the console stalls, but if i do something like : touch dummyfile &, the board is not hanged. I mean, only the touch function is stalled. So the watchdog does not reset the board since the board is still running... only the touch / cp, etc function are blocked

QuoteReplyEditDelete

 

 

2009-01-29 05:22:55     Re: nand : need your help to configure

Stephane DEBUSNE (FRANCE)

Message: 68509   

 

i forgot : i'm not using the trunk. i'm using uClinux-dist-2008R1.5-RC3.

 

But Yi Li saw the same problem with the trunk and he has opened a bug tracker.

 

 

 

regards

 

 

 

Stephane

QuoteReplyEditDelete

 

 

2009-01-29 13:05:27     Re: nand : need your help to configure

Robin Getz (UNITED STATES)

Message: 68523   

 

Stephane:

 

So once Yi gets back - we will look into it.

 

Thanks.

QuoteReplyEditDelete

 

 

2009-02-04 06:24:29     Re: nand : need your help to configure

Michael Hennerich (GERMANY)

Message: 68849   

 

Can you try again? - The Nand Flash DMA issues on BF52x is fixed on the 2008R1branch

 

-Michael

QuoteReplyEditDelete

 

 

2009-02-06 11:07:12     Re: nand : need your help to configure

Stephane DEBUSNE (FRANCE)

Message: 68995   

 

Sorry for the late answer, i'm out of the office. I'll have a try on monday and give you some feedback.

 

Thanks for the support

 

 

 

regards

 

 

 

Stephane

QuoteReplyEditDelete

 

 

2009-02-11 10:54:35     Re: nand : need your help to configure

Stephane DEBUSNE (FRANCE)

Message: 69269   

 

Hi,

 

 

 

i just made a test. i took the corrected driver in the trunk and test with and withou nand flash chip soldered.

 

It works great ! No more crash when no nand, and when the nand is here, i can mount and read/write it.

 

You made a great job guy, congratulations

 

best regards

 

Stephane

Attachments

Outcomes