]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/chips/cfi_probe.c
Merge branch 'master' of git://eden-feed.erg.abdn.ac.uk/net-2.6
[linux-2.6-omap-h63xx.git] / drivers / mtd / chips / cfi_probe.c
index f651b6ef1c5d6c44805b066fab343eb965f952d0..c418e92e1d92b79286f46a173bd1f93ff3591939 100644 (file)
@@ -1,7 +1,6 @@
 /*
    Common Flash Interface probe code.
    (C) 2000 Red Hat. GPL'd.
-   $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $
 */
 
 #include <linux/module.h>
@@ -39,7 +38,7 @@ struct mtd_info *cfi_probe(struct map_info *map);
 #define xip_allowed(base, map) \
 do { \
        (void) map_read(map, base); \
-       asm volatile (".rep 8; nop; .endr"); \
+       xip_iprefetch(); \
        local_irq_enable(); \
 } while (0)
 
@@ -232,6 +231,11 @@ static int __xipram cfi_chip_setup(struct map_info *map,
        cfi->mfr = cfi_read_query16(map, base);
        cfi->id = cfi_read_query16(map, base + ofs_factor);
 
+       /* Get AMD/Spansion extended JEDEC ID */
+       if (cfi->mfr == CFI_MFR_AMD && (cfi->id & 0xff) == 0x7e)
+               cfi->id = cfi_read_query(map, base + 0xe * ofs_factor) << 8 |
+                         cfi_read_query(map, base + 0xf * ofs_factor);
+
        /* Put it back into Read Mode */
        cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
        /* ... even if it's an Intel chip */