aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips
diff options
context:
space:
mode:
authorTrent Piepho <tpiepho@freescale.com>2008-03-31 00:19:29 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2008-04-22 16:16:09 -0400
commitfecb8865def541ff38f59ef3caf0cbd09f4fc9fd (patch)
tree0e407d1f17584399b158e2ef4028c9321960726d /drivers/mtd/chips
parent0ff6631be150702ed4c92b46b77941affee866ba (diff)
[MTD] [NOR] Read extended device ID from AMD/Spansion CFI flash chips
AMD/Spansion use a device id of 0x7e to indicate an extended device is present at offset 0xe and 0xf in the query data. I've verified with Spansion that all their chips (mfr == 0x01) with an id of 0x7e use it to indicate an extended id is present. What's more, there are no chips with a NON-extended id that is the same as a different chip's extended id. In other words, when the extended ID is present, one can replace the normal id with the extended id without losing any information. Which is what I've done. Signed-off-by: Trent Piepho <tpiepho@freescale.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r--drivers/mtd/chips/cfi_probe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
index b03d43ef9108..a4463a91ce31 100644
--- a/drivers/mtd/chips/cfi_probe.c
+++ b/drivers/mtd/chips/cfi_probe.c
@@ -232,6 +232,11 @@ static int __xipram cfi_chip_setup(struct map_info *map,
232 cfi->mfr = cfi_read_query16(map, base); 232 cfi->mfr = cfi_read_query16(map, base);
233 cfi->id = cfi_read_query16(map, base + ofs_factor); 233 cfi->id = cfi_read_query16(map, base + ofs_factor);
234 234
235 /* Get AMD/Spansion extended JEDEC ID */
236 if (cfi->mfr == CFI_MFR_AMD && (cfi->id & 0xff) == 0x7e)
237 cfi->id = cfi_read_query(map, base + 0xe * ofs_factor) << 8 |
238 cfi_read_query(map, base + 0xf * ofs_factor);
239
235 /* Put it back into Read Mode */ 240 /* Put it back into Read Mode */
236 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); 241 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
237 /* ... even if it's an Intel chip */ 242 /* ... even if it's an Intel chip */