[LinuxBIOS] r3032 - trunk/util/flashrom

svn at openbios.org svn at openbios.org
Fri Jan 4 17:22:09 CET 2008


Author: hailfinger
Date: 2008-01-04 17:22:09 +0100 (Fri, 04 Jan 2008)
New Revision: 3032

Modified:
   trunk/util/flashrom/flash.h
   trunk/util/flashrom/flashchips.c
   trunk/util/flashrom/spi.c
Log:
Print at least the vendor for SPI flash chips if the exact chip ID is
unknown.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Ronald G. Minnich <rminnich at gmail.com>


Modified: trunk/util/flashrom/flash.h
===================================================================
--- trunk/util/flashrom/flash.h	2007-12-31 14:05:08 UTC (rev 3031)
+++ trunk/util/flashrom/flash.h	2008-01-04 16:22:09 UTC (rev 3032)
@@ -59,10 +59,13 @@
  * 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 */

Modified: trunk/util/flashrom/flashchips.c
===================================================================
--- trunk/util/flashrom/flashchips.c	2007-12-31 14:05:08 UTC (rev 3031)
+++ trunk/util/flashrom/flashchips.c	2008-01-04 16:22:09 UTC (rev 3032)
@@ -185,5 +185,13 @@
 	 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,}
 };

Modified: trunk/util/flashrom/spi.c
===================================================================
--- trunk/util/flashrom/spi.c	2007-12-31 14:05:08 UTC (rev 3031)
+++ trunk/util/flashrom/spi.c	2008-01-04 16:22:09 UTC (rev 3032)
@@ -262,14 +262,19 @@
 		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;





More information about the coreboot mailing list