* [U-Boot] Bug of NOR Flash CFI Driver
@ 2012-01-13 15:57 Robert Ding
2012-01-13 23:26 ` Wolfgang Denk
0 siblings, 1 reply; 2+ messages in thread
From: Robert Ding @ 2012-01-13 15:57 UTC (permalink / raw)
To: u-boot
Dear Wolfgang Denk:
I found a bug on NOR Flash CFI drivers during my development. In the file of cfi_flash.c, the function of flash_write_cfibuffer() maybe have a problem.
The process of NOR Flash write buffer program mode in u-boot code is:
flash_unlock_seq(info,0);
flash_write_cmd(info, sector, offset, AMD_CMD_WRITE_TO_BUFFER);
cnt = len >> shift;
flash_write_cmd(info, sector, offset, cnt - 1);
case FLASH_CFI_16BIT:
while (cnt-- > 0) {
flash_write16(flash_read16(src), dst);
src += 2, dst += 2;
}
break;
To which the address of src point is a RAM address, the code is OK. But if it points to a address of the same NOR Flash, the code will cause some problems, which
cannot read the correct data from the NOR Flash.
I check out the datasheet of some Manufacturer of NOR Flash, in which, it describes that if the users want to read the data from the NOR Flash in program process,
it must suspend the program, then read data, and resume to program.
So the function of flash_read16(src) need to be moved to the front of the function flash_unlock_seq(info,0) or add the operation of suspend program and resume program.
Linux CFI drivers use the first process.
I tested the u-boot cfi flash drivers on Manufacturer of Spansion and Numonyx(Micron) which both use the AMD command set. I cannot understand why the Spasion NOR Flash can work well, maybe its hardware is stronger, but the Numonyx(Micron) does have the problem.
I hope u-boot to fix this bug in the new version.
I am looking forward to your reply.
Best regards:
Robert Ding
^ permalink raw reply [flat|nested] 2+ messages in thread* [U-Boot] Bug of NOR Flash CFI Driver
2012-01-13 15:57 [U-Boot] Bug of NOR Flash CFI Driver Robert Ding
@ 2012-01-13 23:26 ` Wolfgang Denk
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2012-01-13 23:26 UTC (permalink / raw)
To: u-boot
Dear "Robert Ding",
In message <6FE7F5133E344F8BB49547A07A987714@DyingPC> you wrote:
>
> I found a bug on NOR Flash CFI drivers during my development. In the
This is not bug. It is a limitation, or you may call it a feature...
> To which the address of src point is a RAM address, the code is OK. But
> if it points to a address of the same NOR Flash, the code will cause
> some problems, which
> cannot read the correct data from the NOR Flash.
This is a known limitation. You are not supposed to copy data from one
part of a NOR device to another part.
> I hope u-boot to fix this bug in the new version.
Patches that improve U-Boot are always welcoem. Please see
http://www.denx.de/wiki/U-Boot/Patches for hints hot to submit
patches.
Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A verbal contract isn't worth the paper it's written on.
-- Samuel Goldwyn
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-13 23:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-13 15:57 [U-Boot] Bug of NOR Flash CFI Driver Robert Ding
2012-01-13 23:26 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox