2010-08-24 21:45:56     Mtd erase(write) error in kernel and u-boot?

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

2010-08-24 21:45:56     Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92740   

 

hi,

 

My chips is bf531, the version of my trunk is the 2009R1.4, and my the version of my uboot is 2008R1-RC5,

 

The type of my flash is AM29LV160,

 

When using uboot erase the flash, which hint successful,

 

theni using the command > cp.b 0x1000000 0x20040000 $(filesize)

 

which hinting the addr 0x20100400 haven't been erased. and can't be writed.

 

so does the kernel flash driver(MTD).

 

 

 

But when i connect my jtag IGLOO to my board,

 

the addr of 0x20100400 erase (read, write ) ok!

 

it is very strange, my network card is DM9000X using the asyn addr 0x20300300. A2 to the DM9000AEP.

 

can you give me any suggestion?

 

regards!

QuoteReplyEditDelete

 

 

2010-08-24 22:49:44     Re: Mtd erase(write) error in kernel and u-boot?

Aaron Wu (CHINA)

Message: 92741   

 

How did you assign your memory and flash chip to the blackfin external memory bank in your board, or is it a reference board from ADI? and what's the value for "filesize" in your test?

QuoteReplyEditDelete

 

 

2010-08-24 23:54:21     Re: Mtd erase(write) error in kernel and u-boot?

Mike Frysinger (UNITED STATES)

Message: 92742   

 

there is no "2009R1.4" release, and you shouldnt be mixing versions of software.  they should all be from the same release as the FAQ states.

 

post the actual boot up from your board, as well as the output of 'flinfo'.

QuoteReplyEditDelete

 

 

2010-08-25 00:17:37     Re: Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92743   

 

I am sorry the 2009R1.1-RC4 was abbreviated by me.

 

the filesize is about 0xf0000 bytes.

 

My board is reference to the third part in china called HH tech.

 

my momory is 32M bytes

 

nor flash is 2M Bytes taking  up address of 0x20000000 0x20100000 (AMS0-AMS1)

 

DM9000 take up 0x20300000 (AMS3)

QuoteReplyEditDelete

 

 

2010-08-25 00:20:34     Re: Mtd erase(write) error in kernel and u-boot?

Sonic Zhang (CHINA)

Message: 92744   

 

Please update your uboot to 2009R1 to match your linux release version.

 

Then, post your boot up log here.

QuoteReplyEditDelete

 

 

2010-08-25 00:53:51     Re: Mtd erase(write) error in kernel and u-boot?

Mike Frysinger (UNITED STATES)

Message: 92745   

 

i think the addresses you quoted are off.  ams0 covers 0x20000000 - 0x200fffff while ams1 covers 0x20100000 - 0x201fffff.

QuoteReplyEditDelete

 

 

2010-08-25 01:18:02     Re: Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92746   

 

I think the hardware is ok because The jtag tool can manipulate it.

 

and my flash address is 0x20000000 to 0x201fffff.

 

The addr of 0x20110000 to 0x201fffff worked Ok. only 0x20100000 to 2010ffff is brocken.

 

 

 

Because my u-boot was cutted to 63KB, which only support some usual command.

 

I think the log is useless.

 

My mtd driver in kernel has the problem also.

 

regards.

QuoteReplyEditDelete

 

 

2010-08-25 21:44:19     Re: Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92767   

 

Hi,

 

I found out that the reason of addr 0x20104000 can't writed successfully is the address of 0x20104000 erased failed.

 

But when Using Jtag command

 

>eraseflash 0x20100000 1

 

and in the uboot command bfin> md 0x20100000, I can get the data from 0x20100000 to 0x2010ffff  all is 0xffffffff. imply the operation of erase successful.

 

 

 

But in uboot, Using erase 0x20100000 0x2010ffff

 

and then md the flash 0x20100000, I Can see from 0x201000000 0x20103fff is 0xffffffff(successed)

 

But form address 0x20104000 to 0x2010ffff is 0x00000000, Which imply the space was erased failed.

 

 

 

My command is the stand CFI flash, is the same as the JTAG.

 

why failed???

 

thanks!

QuoteReplyEditDelete

 

 

2010-08-25 21:52:31     Re: Mtd erase(write) error in kernel and u-boot?

Mike Frysinger (UNITED STATES)

Message: 92768   

 

you're using an old version of u-boot.  as Sonic said, try upgrading first.

 

QuoteReplyEditDelete

 

 

2010-08-25 22:14:55     Re: Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92769   

 

but my kernel version is  2009R1.1-RC4,

 

when i use the the mtd dirver at this version, which erased failed also.

 

Does cfi interface not support the type of AMD serial flash?

QuoteReplyEditDelete

 

 

2010-08-25 22:33:01     Re: Mtd erase(write) error in kernel and u-boot?

Mike Frysinger (UNITED STATES)

Message: 92770   

 

you can try our suggestions or debug it on your own

QuoteReplyEditDelete

 

 

2010-08-25 22:46:56     Re: Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92774   

 

Thanks, Mike, I will try it, reference to the JTAG source code, and update my uboot to the latest version.

QuoteReplyEditDelete

 

 

2010-08-26 23:24:35     Re: Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92822   

 

I have update my u-boot version to u-boot-2008.10-2009R1.1-rc1, but the addr of 0x20100000 to 0x2010ffff can't be erased

 

all the same.

 

Does this type of AMD serial flash  support CFI not very well?

 

The strange things to me is JTAG tool can erase this area successful

QuoteReplyEditDelete

 

 

2010-08-27 12:55:46     Re: Mtd erase(write) error in kernel and u-boot?

Mike Frysinger (UNITED STATES)

Message: 92874   

 

we dont keep track of flashes and their cfi-compatibility.  ADI doesnt make flashes, so it doesnt make sense for us to do so.  this is the job for the board designer to research software compatibility while doing part selection.

 

if you do 'protect on all' and then 'flinfo', does it show all sectors marked with RO ?  what about then doing 'protect off all' and then 'flinfo' ?

 

post the output of 'flinfo' and the flash settings you're using in your board config header.

QuoteReplyEditDelete

 

 

2010-08-29 23:50:45     Re: Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92916   

 

Mike, 问题解决了,热泪盈款,呵呵

 

I have solve this problem,

 

the method is :

 

generally, when we want to erase the sector of 0x20100000, the step of erase flash according to the datasheet of AMD is

 

wrrite 0xaaa 0x... to the address 0x20100000

 

          0x555  0x... to the address 0x20100000

 

          ...

 

          0x30 0x20100000

 

but this operation can only erase the address from 0x20100000 0x20103fff

 

After this I add the following cmd:

 

wrrite 0xaaa 0x... to the address 0x20104000

 

          0x555  0x... to the address 0x20104000

 

          ...

 

          0x30 0x20104000

 

After this .

 

the address form 0x20100000 to 2010ffff erased successfully.

 

thanks!!!

QuoteReplyEditDelete

 

 

2010-08-30 00:27:16     Re: Mtd erase(write) error in kernel and u-boot?

Mike Frysinger (UNITED STATES)

Message: 92918   

 

did you modify u-boot ?  could you post the patch ?

QuoteReplyEditDelete

 

 

2010-08-30 02:19:31     Re: Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92920   

 

I modified the  uboot and the kernel mtd driver.

 

I will post my code later!

QuoteReplyEditDelete

 

 

2010-08-30 21:31:48     Re: Mtd erase(write) error in kernel and u-boot?

macgrady tracy (CHINA)

Message: 92945   

 

int the kernel (drivers/mtd/chips/cfi_cmdset_0002.c)

 

int the function of follows:

 

static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)

 

{

 

.....

 

if ( 0x10000 == chip->start)

 

{

 

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x10, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);

 

 

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start+0x4000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start+0x4000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start+0x4000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start+0x4000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start+0x4000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x10, cfi->addr_unlock1, chip->start+0x4000, map, cfi, cfi->device_type, NULL);

 

 

 

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start+0x6000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start+0x6000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start+0x6000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start+0x6000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start+0x6000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x10, cfi->addr_unlock1, chip->start+0x6000, map, cfi, cfi->device_type, NULL);

 

 

 

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start+0x8000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start+0x8000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start+0x8000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start+0x8000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start+0x8000, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x10, cfi->addr_unlock1, chip->start+0x8000, map, cfi, cfi->device_type, NULL);

 

}

 

else

 

{

 

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL);

cfi_send_gen_cmd(0x10, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);

}

 

}

 

so does the uboot.

 

may be there is something bugs in ours board.

Attachments

    Outcomes