summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2008-01-04 16:22:09 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2008-01-04 16:22:09 +0000
commite973b05710de68556dd5b7f336816b03d2b0e691 (patch)
tree0bd46b9d23079b543465fa2249887f6b6dc86590
parent2736e328320cbf524b3e5e93847cb4167062de7c (diff)
downloadast2050-flashrom-e973b05710de68556dd5b7f336816b03d2b0e691.zip
ast2050-flashrom-e973b05710de68556dd5b7f336816b03d2b0e691.tar.gz
Print at least the vendor for SPI flash chips if the exact chip ID is unknown
Corresponding to flashrom svn r173 and coreboot v2 svn r3032. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
-rw-r--r--flash.h5
-rw-r--r--flashchips.c8
-rw-r--r--spi.c9
3 files changed, 19 insertions, 3 deletions
diff --git a/flash.h b/flash.h
index e1e5934..4b57162 100644
--- a/flash.h
+++ b/flash.h
@@ -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 */
diff --git a/flashchips.c b/flashchips.c
index 53deb49..0430ca7 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -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,}
};
diff --git a/spi.c b/spi.c
index 5f9290a..1040b01 100644
--- a/spi.c
+++ b/spi.c
@@ -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;
OpenPOWER on IntegriCloud