aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBen Dooks <ben@simtec.co.uk>2005-02-14 16:27:38 +0000
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 12:33:26 +0200
commit011b2a36278cca110c70506ad85b042c2faabac2 (patch)
treefb24caf90e98001e71b210a83f4fe464a8d4eabb /drivers/mtd
parenteeada24da8bd23fcf6acd2729be054ea99b301bb (diff)
[MTD] Fixup probing logic for single 16bit devices
The change to the generic probe to look for the smallest width of chip first is causing some problems on boards with a single 16bit device. The problem seems to be the jedec_match() is truncating the device-id read from the table to match against the one read from the hardware, causing a match against the partial id of some chips with 16bit IDs (such as the SST39LF160) This fixes things for my own board, but something may need to be done if the same problem is exhibited for chips with an 8bit ID Signed-off-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/chips/jedec_probe.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index 30325a25ab9..c2ef821b7af 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -1,7 +1,7 @@
/*
Common Flash Interface probe code.
(C) 2000 Red Hat. GPL'd.
- $Id: jedec_probe.c,v 1.61 2004/11/19 20:52:16 thayne Exp $
+ $Id: jedec_probe.c,v 1.62 2005/02/14 16:27:34 bjd Exp $
See JEDEC (http://www.jedec.org/) standard JESD21C (section 3.5)
for the standard this probe goes back to.
@@ -1856,6 +1856,16 @@ static inline int jedec_match( __u32 base,
case CFI_DEVICETYPE_X8:
mfr = (__u8)finfo->mfr_id;
id = (__u8)finfo->dev_id;
+
+ /* bjd: it seems that if we do this, we can end up
+ * detecting 16bit flashes as an 8bit device, even though
+ * there aren't.
+ */
+ if (finfo->dev_id > 0xff) {
+ DEBUG( MTD_DEBUG_LEVEL3, "%s(): ID is not 8bit\n",
+ __func__);
+ goto match_done;
+ }
break;
case CFI_DEVICETYPE_X16:
mfr = (__u16)finfo->mfr_id;