Fix MTD device probing... (really)

Guillaume LECERF foxcore at gmail.com
Wed Aug 26 06:25:23 EDT 2009


Hi all,

I'm experiencing a problem with a 16bit SST 39VF3201 flash chip (id
0x235b) that is misdetected as a 8bit SST 49LF080A (id 0x005b).
I found that this commit is the source of my problem :

On Mon Jan 24 18:39:41 EST 2005, Russell King wrote :
>Fix MTD device probing, trying larger numbers of chips before smaller
>numbers of chips across the bus width.
>
>This means we'll avoid misdetecting a 2 x16 array as 1 x32 if the
>high 16-bits happen to read as zeros in the QRY area.
>
>--- orig/drivers/mtd/chips/gen_probe.c	Sat Oct 23 11:38:17 2004
>+++ linux/drivers/mtd/chips/gen_probe.c	Mon Jan 24 22:54:38 2005
>@@ -162,7 +162,7 @@ static int genprobe_new_chip(struct map_
> 	int max_chips = map_bankwidth(map); /* And minimum 1 */
> 	int nr_chips, type;
>
>-	for (nr_chips = min_chips; nr_chips <= max_chips; nr_chips <<= 1) {
>+	for (nr_chips = max_chips; nr_chips >= min_chips; nr_chips >>= 1) {
>
> 		if (!cfi_interleave_supported(nr_chips))
> 		    continue;


Before this commit, genprobe_new_chip() started the detection on
CFI_DEVICETYPE_X32, then CFI_DEVICETYPE_X16, and CFI_DEVICETYPE_X8.
I understand why this commit is useful, but can't find a way (apart
from reverting this change locally) to handle both cases.

Could you help me with this ?

Thanks in advance.

-- 
Guillaume LECERF
GeeXboX developer - www.geexbox.org



More information about the linux-mtd mailing list