2009-01-27 12:56:37     U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem

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

2009-01-27 12:56:37     U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem

der knut (GERMANY)

Message: 68421   

 

Hello,

 

we like to use U-Boot to boot linux from  SD-Card (MMC/SPI) and USB memory stick, this works fine for us with 2009.01 (Just to explain why I try the 2009.01-svn1623 not the 1.1.6 u-boot version)

 

On our BF526 Rev 0.0 custom board NAND-Flash works fine  with u-boot 1.1.6, but if I use 2009.01 all blocks are reported as "bad".

 

U-Boot output with "MTD_DEBUG", try reading U-Boot enviroment from NAND:

 

U-Boot 2009.01-svn1623 (ADI-2009R1-pre) (Jan 27 2009 - 17:51:04)

 

CPU:   ADSP bf526-0.0 (Detected Rev: 0.0) (spi flash boot)

Board: TEST A/I/V

       Support: www.xxx.org

Clock: VCO: 299.260 MHz, Core: 299.260 MHz, System: 74.815 MHz

RAM:   32 MB

NAND:  NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB 3,3V 8-bit)

64 MiB

Scanning device for bad blocks

nand_read_oob: from = 0x00000000, len = 0

Bad eraseblock 0 at 0x00000000

nand_read_oob: from = 0x00004000, len = 0

Bad eraseblock 1 at 0x00004000

nand_read_oob: from = 0x00008000, len = 0

Bad eraseblock 2 at 0x00008000

nand_read_oob: from = 0x0000c000, len = 0

Bad eraseblock 3 at 0x0000c000

nand_read_oob: from = 0x00010000, len = 0

Bad eraseblock 4 at 0x00010000

nand_read_oob: from = 0x00014000, len = 0

Bad eraseblock 5 at 0x00014000

 

 

 

 

 

.....

 

(until end of NAND)

 

----------------------------------------------------------------------------------------------------

 

U-Boot 1.1.6 output with "MTD_DEBUG". no problem reading enviroment or writing NAND:

 

 

U-Boot 1.1.6-svn (ADI-2009R1-pre) (Jan 27 2009 - 17:58:47)

 

CPU:   ADSP bf526-0.0 (Detected Rev: 0.0)

Board: TEST A/I/V

       Support: www.xxx.org

Clock: VCO: 299 MHz, Core: 299 MHz, System: 74 MHz

RAM:   32 MB

NAND:  64 MiB

nand_read_ecc: from = 0x0003c000, len = 16384

In:    serial

Out:   serial

Err:   serial

 

 

 

What I am doing wrong? Is NAND broken in this new version?

 

I plan to try 2009.01on our BF527-ezkit, but without ethernet (when NAND is useable) and without JTAG/ICEbear it is quit difficult.

 

Thank you and best regards

 

Knut

 

TranslateQuoteReplyEditDelete

 

 

2009-01-27 13:13:29     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem

Mike Frysinger (UNITED STATES)

Message: 68423   

 

verify nand dump reports the same data in both versions.  then make sure you're using the same ecc layout in both versions.

QuoteReplyEditDelete

 

 

2009-01-29 10:22:56     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem (Solved?)

der knut (GERMANY)

Message: 68517   

 

Hello,

 

learned lots about OOB and EEC but this was not the problem. I found some problems at NAND time out and ticks/ms handling.

 

The fix is attached, but I am not sure this was the right solution. This was my first closer look to NAND flashes, but It works for me.

 

With CONFIG_BFIN_NFC_BOOTROM_ECC the driver do not compile, but we can write our BF527 Rev 0.2 boot code with U-Boot 1.1.6 to NAND.

 

The patch also include a little fix for SPI FLASH, so we can write our BF526 Rev 0.0 boot code to SPI FLASH.

 

hth

 

Knut

 

 

 

u-boot-2009.01-svn1628-nand-spi.diff.gz

TranslateQuoteReplyEditDelete

 

 

2009-01-29 13:10:44     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem (Solved?)

Mike Frysinger (UNITED STATES)

Message: 68524   

 

that change to cmd_eeprom.c is incorrect.  you probably didnt define CONFIG_SYS_I2C_FRAM in your board config.

 

the portmuxing thing looks correct, so i'll get that in.

 

ive fixed the build error ... was missed in the forward port from u-boot-1.1.6.

 

i'll have to poke around to find out why things are timing out.

QuoteReplyEditDelete

 

 

2009-02-05 10:11:47     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem (Solved?)

der knut (GERMANY)

Message: 68904   

 

Hello,

 

thanks for information, SPI/Flash write is ok with CONFIG_SYS_I2C_FRAM, I revert my changes.

 

U-Boot 2009.01 build now with BOOTROM_ECC but is not working. On the first operation on NAND (read U-Boot enviroment from NAND here) the driver create the bad block table (bbt) and mark all blocks as bad. Then no further NAND operation is possible. Without BOOTROM_ECC it works.

 

Not a real problem to me, just as information. For production and BF527 we plan to use a U-Boot 1.1.6 for writing with BOOTROM_ECC to NAND, so BF527 can boot. The written U-Boot is 2009.01 without BOOTROM_ECC.

 

Thanks a lot

 

Knut

 

 

 

 

TranslateQuoteReplyEditDelete

 

 

2009-03-02 08:42:03     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem (Solved?)

yacobi chen (CHINA)

Message: 70217   

 

I meet the same bad blocks and Timeout problems with knut.

 

does anybody fix it?

QuoteReplyEditDelete

 

 

2009-03-03 06:08:37     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem (Solved?)

der knut (GERMANY)

Message: 70277   

 

Hello,

 

in the thread is a little patch which correct the wait period.  I am quit sure this is not the right way, but it works for me.

 

I attach it, cleaned of the wrong SPI/EEPROM patch.

 

Be sure you configure the right port for parallel use of NAND and RMII.

 

hth

 

Knut

 

 

 

u-boot-2009.01-svn1628-nand.diff.gz

TranslateQuoteReplyEditDelete

 

 

2009-03-03 08:14:10     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem (Solved?)

yacobi chen (CHINA)

Message: 70283   

 

Thank you Knut.

 

With your attchment I can operate the NAND FLASH now.

But there is still another problem. I can not boot linux from my NAND FLASH.

I define CONFIG_BFIN_NFC_BOOTROM_ECC and don't define CONFIG_BFIN_NFC_NO_HW_ECC.

And I config linux kernel like this:

<*> Blackfin on-chip NAND Flash Controller driver

[*] BF5XX NAND Hardware ECC

[  ] use Blackfin BootROM ECC Layout

 

Is there something wrong with my configuration in both uboot and linux kernel?

 

 

 

yacobi

QuoteReplyEditDelete

 

 

2009-03-03 08:43:26     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem (Solved?)

der knut (GERMANY)

Message: 70285   

 

What means "can not boot linux from my NAND FLASH"?

TranslateQuoteReplyEditDelete

 

 

2009-03-03 08:59:27     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem (Solved?)

yacobi chen (CHINA)

Message: 70286   

 

Within uboot, I copy rootfs.jffs2 into block1 and copy vmImage into block0 of nand flash.

 

Then I run "nboot 0x01000000 0x0" to boot the board.

 

The system will stop booting when it start to mount rootfs.

 

did you try this before?

QuoteReplyEditDelete

 

 

2009-03-03 09:11:37     Re: U-Boot 2009.01-svn1623 / BF526 / NAND Flash problem (Solved?)

der knut (GERMANY)

Message: 70287   

 

As I explain earlier in this thread we use BOOTROM_ECC with a u-boot 1.1.6 image in production just to write another u-boot 2009.01 _without_ BOOTROM_ECC image to nand for nand startup of our BF526 Rev 0.1 and BF527 Rev 0.2 board.

 

The starting u-boot is _without_ BOOTROM_ECC also the linux kernel nand driver.

 

Why the linux kernel is not mounting your jffs2 rootfs is outside the scope of this forum, I think. Have a look to wiki and uclinux forum.

Outcomes