[RE: CFI Devices in x8 mode ]
Eric
ebrower at usa.net
Mon Mar 26 14:01:57 EST 2001
"Alex Lennon" <ajlennon at arcom.co.uk> wrote:
>> The 8-bit buswidth probe doesn't attempt to probe for a
>> device type X16 any more. It should. Someone gave me a
>> patch for that a few days ago, I think - but I can't find
>> it. I've just committed what I think is the correct fix to
>> CVS.
You may be referring to my proposed patch:
--- cfi_probe.c.orig Wed Mar 21 15:59:05 2001
+++ cfi_probe.c Thu Mar 22 13:12:43 2001
@@ -235,6 +235,11 @@
cfi->device_type = CFI_DEVICETYPE_X8;
index = cfi_probe_chip(map,base,chips,cfi);
if (index>=0) return index;
+
+ /* if this did not work, attempt again in x16 mode */
+ cfi->device_type = CFI_DEVICETYPE_X16;
+ index = cfi_probe_chip(map,base,chips,cfi);
+ if (index>=0) return index;
break;
#endif
> Sorry - I think I'm misunderstanding - I've got an eight bit
> device here but the code looks as though its accessing it as
> a 16-bit device from what I can see in the spec.
[ ... ]
> If I'm reading this stuff right then the cfi_cfi_probe()
> code doesn't seems to be taking the base offset into account ?
No, I believe it attempts to calculate the offset properly in
cfi_probe.c cfi_check_qry_or_id():
int osf = cfi->interleave * cfi->device_type; // scale factor
[ ... ]
cfi_read(map,base+osf*0x10)==cfi_build_cmd('Q',map,cfi->interleave)
So it appears the calculation is done properly. What is NOT done
properly as of the last cfi_probe.c revision is that cfi->device_type
is unconditionally set to DEVICETYPE_X16 for all 8-bit-wide busses in
cfi_probe_new_chip(). The above patch simply falls-back to probing
in DEVICETYPE_X8 mode if the X16 fails. I have not seen David's
patch in CVS as of yet, but if it does the same it should be fine--
I cannot speak to whether or not this is the appropriate solution, but
it does work in my case (8-bit bus with 16-bit chip in X8 mode).
E
____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org
More information about the linux-mtd
mailing list