M29W640DB bad address for writing (0x554)

Ronny L Nilsson rln-mtd at arbetsmyra.dyndns.org
Wed Oct 18 11:20:41 EDT 2006


Hi
I've been bitten by the same bug as Philippe discovered in march:
http://lists.infradead.org/pipermail/linux-mtd/2006-March/014934.html


Using a 16-bit NOR flash in 8-bit mode doesn't work. (At least with 
chips from STMicroelectronics and kernel 2.6.18 and kernel 2.6.16). The 
function
	include/linux/mtd/cfi.h:cfi_build_cmd_addr()
makes a faulty address calculation so the chip doesn't receive commands 
properly. What cfi_build_cmd_addr() is doing is calculating: 
	0x2aa * 2 = 0x554
This is however a bad value! It should be 0x555 or the chip will simply 
ignore the command.



I can see no obvious clean method for fixing this issue. A Philippe 
mentions though, one can insert an ugly conditional statement and it'll 
work.

return ((cmd_ofs * type * interleave == 0x554u) ? 0x555u :
	cmd_ofs * type * interleave);



BR
/Ronny Nilsson






More information about the linux-mtd mailing list