2011-03-31 14:38:48     Issues of NAND in U-boot

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

2011-03-31 14:38:48     Issues of NAND in U-boot

Usama Shakeel (PAKISTAN)

Message: 99480   

 

Hello,

 

I am facing few issues in NAND. I downloaded U-Boot from SVN trunk. The U-Boot is detecting the NAND flash but not erasing and Reading from it.

 

// NAND INFO SAYS

 

bfin> nand info

Device 0: NAND 256MiB 3,3V 8-bit, sector size 128 KiB

 

// NAND READ

 

bfin> nand read 0x2000000 0x0 0x4590d0

NAND read: device 0 offset 0x0, size 0x4590d0

NAND read from offset 0 failed -74

0 bytes read: ERROR

 

//NAND ERASE

 

bfin> nand erase clean

 

it does not detect the command

 

Kindly help what can be the reason behind this behaviour.

 

Regards

 

Usama Bin Shakeel

QuoteReplyEditDelete

 

 

2011-03-31 14:59:37     Re: Issues of NAND in U-boot

Mike Frysinger (UNITED STATES)

Message: 99481   

 

what processor are you using ?  how exactly is the NAND connected ?

 

if you're using the async bank, what driver are you using exactly ?  what are your async memory timings ?

QuoteReplyEditDelete

 

 

2011-03-31 15:22:17     Re: Issues of NAND in U-boot

Usama Shakeel (PAKISTAN)

Message: 99483   

 

Hi Mike.

 

 

 

I am using the BF532 and SAMSUNG K9F2G08U0A. NAND is connected similar to the connection in IP04 board. (i.e. PF10 is connected to BUSY pin, ALE and CLE are connected to pin 1 and 2) with nand base 0x20000000

 

 

 

Loking forward for your response.

QuoteReplyEditDelete

 

 

2011-03-31 15:24:04     Re: Issues of NAND in U-boot

Usama Shakeel (PAKISTAN)

Message: 99484   

 

P.S. Although the nand write command do work

QuoteReplyEditDelete

 

 

2011-03-31 15:27:33     Re: Issues of NAND in U-boot

Mike Frysinger (UNITED STATES)

Message: 99485   

 

you didnt say how you configured things in software.  you could always try slowing down the async timings.

QuoteReplyEditDelete

 

 

2011-03-31 15:30:14     Re: Issues of NAND in U-boot

Usama Shakeel (PAKISTAN)

Message: 99486   

 

Thanx Mike for your reply again.

 

I used these settings as of IP04 board. Where should I alter things to slow it down? in NAND PLAT Driver?

 

#define CONFIG_NAND_PLAT

 

#define CONFIG_SYS_NAND_BASE 0x20000000

 

#define CONFIG_SYS_MAX_NAND_DEVICE 1

 

 

 

#define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))

 

#define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))

 

#define BFIN_NAND_WRITE(addr, cmd) \

 

do { \

 

bfin_write8(addr, cmd); \

 

SSYNC(); \

 

} while (0)

 

 

 

#define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)

 

#define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)

 

#define NAND_PLAT_GPIO_DEV_READY       GPIO_PF10

 

QuoteReplyEditDelete

 

 

2011-03-31 15:44:46     Re: Issues of NAND in U-boot

Mike Frysinger (UNITED STATES)

Message: 99487   

 

use the CONFIG_EBIU_AMBCTL related defines in your board config header

QuoteReplyEditDelete

 

 

2011-03-31 15:49:06     Re: Issues of NAND in U-boot

Usama Shakeel (PAKISTAN)

Message: 99488   

 

Mike I have used these

 

 

 

#define CONFIG_EBIU_AMGCTL_VAL 0xFF

 

#define CONFIG_EBIU_AMBCTL0_VAL 0xffc2ffc2

 

#define CONFIG_EBIU_AMBCTL1_VAL 0xffc2ffc2

 

In your opinion is it timing issue if NAND is being detected and Writting but not being read or Erased?

 

 

QuoteReplyEditDelete

 

 

2011-03-31 17:53:05     Re: Issues of NAND in U-boot

Mike Frysinger (UNITED STATES)

Message: 99489   

 

i dont think you really know if the write is working.  how can you if you cant read back out the results ?

QuoteReplyEditDelete

 

 

2011-04-01 02:26:05     Re: Issues of NAND in U-boot

Usama Shakeel (PAKISTAN)

Message: 99490   

 

Yes right Mike, I am not sure that it is being able to write or not but what I can see is that it is showing nand in nand info and the nand write commands does not end with an error as read or erase do. Kindly tell whether the register settings are appropriate and what should be the steps to get to the solution.

 

 

 

I really appreciate the help you have been providing..

 

 

 

Regards

 

Usama Bin Shakeel

QuoteReplyEditDelete

 

 

2011-04-08 00:46:43     Re: Issues of NAND in U-boot

Mike Frysinger (UNITED STATES)

Message: 99675   

 

at this point, you'll probably have to enable debug options in the mtd code, and put a bus analyzer on the nand pins.  then you can verify the simple commands you're doing (like reading/writing) are going out to the flash correctly.

Attachments

    Outcomes