Print at least the vendor for SPI flash chips if the exact chip ID is
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Fri, 4 Jan 2008 16:22:09 +0000 (16:22 +0000)
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Fri, 4 Jan 2008 16:22:09 +0000 (16:22 +0000)
unknown.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3032 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/flashrom/flash.h
util/flashrom/flashchips.c
util/flashrom/spi.c

index e1e5934692a12e1f0dd9a8d8d87b20e94151512c..4b571625ffdfeb51e1ba5112b14a56ffd18b24b8 100644 (file)
@@ -59,10 +59,13 @@ extern struct flashchip flashchips[];
  * entry of each section should be the manufacturer ID, followed by the
  * list of devices from that manufacturer (sorted by device IDs).
  *
- * All LPC/FWH parts (parallel flash) have 8-bit device IDs.
+ * All LPC/FWH parts (parallel flash) have 8-bit device IDs if there is no
+ * continuation code.
  * All SPI parts have 16-bit device IDs.
  */
 
+#define GENERIC_DEVICE_ID      0xffff  /* Only match the vendor ID */
+
 #define ALLIANCE_ID            0x52    /* Alliance Semiconductor */
 
 #define AMD_ID                 0x01    /* AMD */
index 53deb499f9dd2d2970532a68fd771767d3741ada..0430ca7da63fca796cb8c4e9d18d8add6a541c74 100644 (file)
@@ -185,5 +185,13 @@ struct flashchip flashchips[] = {
         probe_jedec,   erase_chip_jedec, write_49f002},
        {"S29C31004T",  SYNCMOS_ID,     S29C31004T,     512, 128,
         probe_jedec,   erase_chip_jedec, write_49f002},
+       {"EON unknown SPI chip", EON_ID_NOPREFIX, GENERIC_DEVICE_ID,    0, 0,
+        probe_spi,     NULL,   NULL},
+       {"MX unknown SPI chip", MX_ID,  GENERIC_DEVICE_ID,      0, 0,
+        probe_spi,     NULL,   NULL},
+       {"SST unknown SPI chip",        SST_ID, GENERIC_DEVICE_ID,      0, 0,
+        probe_spi,     NULL,   NULL},
+       {"ST unknown SPI chip", ST_ID,  GENERIC_DEVICE_ID,      0, 0,
+        probe_spi,     NULL,   NULL},
        {NULL,}
 };
index 5f9290a536b52e675abdefed710f531c7c943c3e..1040b01e0652968c9d45790be38e7fc083222235 100644 (file)
@@ -262,14 +262,19 @@ int probe_spi(struct flashchip *flash)
                manuf_id = readarr[0];
                model_id = (readarr[1] << 8) | readarr[2];
                printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, manuf_id, model_id);
-               if (manuf_id == flash->manufacture_id && model_id == flash->model_id) {
-                       /* Print the status register before erase to tell the
+               if (manuf_id == flash->manufacture_id &&
+                   model_id == flash->model_id) {
+                       /* Print the status register to tell the
                         * user about possible write protection.
                         */
                        generic_spi_prettyprint_status_register(flash);
 
                        return 1;
                }
+               /* Test if this is a pure vendor match. */
+               if (manuf_id == flash->manufacture_id &&
+                   GENERIC_DEVICE_ID == flash->model_id)
+                       return 1;
        }
 
        return 0;