cfi_probe chip scanning

Simon Munton Simon.Munton at m4data.co.uk
Fri Jul 21 05:36:47 EDT 2000


After cfi_cfi_probe() has found the first set of chips, and starts looking
to see what else is there, the first address checked is set to the size of
the first chip detected. It doesn't take account of any interleaving of
chips.
So I get the following:

	physmap flash device: 800000 at 3800000
	Physically mapped flash: Found a coupled pair of CFI devices at 0 in
8 bit mode
		........
	Physically mapped flash: Found a coupled pair of CFI devices at
200000 in 8 bit mode
	T'was an alias for the chip at 0x0
	Physically mapped flash: Found a coupled pair of CFI devices at
400000 in 8 bit mode
	Not an alias. Adding
	Physically mapped flash: Found a coupled pair of CFI devices at
600000 in 8 bit mode
	T'was an alias for the chip at 0x400000
	 Amd/Fujitsu Extended Query Table at 0x0040
	number of CFI chips: 2

OK, so this isn't really a problem, as they are detected as aliases, but it
is redundant, and can be fixed by changing the for loop to:

        for (base = (1<<cfi.chipshift) * cfi.interleave; base < map->size;
base += (1<<cfi.chipshift) * cfi.interleave)
		cfi_probe_new_chip(map, base, &chip[0], &cfi);

I've added alias detection for 'coupled pair in 8bit mode', basically the
same as '1 device in 16bit mode', but with reads/writes changed for the
different sizes - see patch.

One other observation: as I read the CFI spec, and vendor datasheets, it
would imply that a single device in 16 bit mode would require a CFI query
command of 0x0098, and not 0x9898 as is used. Can anyone confirm that a 16
bit device responds correctly when given the 0x9898 command?
(Of course two interleaved 8 bit devices do require 0x9898 as the command)
(Also 32bit devices seem to want 0x00000098).

 <<cfi_probe.diff.gz>> 

========================================================
Simon Munton	simonm at m4data.co.uk
M4 Data Ltd	Tel: 44-1749-683800
Mendip Court, Bath Rd, Wells	Fax: 44-1749-673928
Somerset, BA5 3DG, England


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cfi_probe.diff.gz
Type: application/octet-stream
Size: 1216 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-mtd/attachments/20000721/ab959669/attachment.obj 


More information about the linux-mtd mailing list