[flashrom] [commit] r767 - trunk

svn at flashrom.org svn at flashrom.org
Fri Nov 20 02:12:45 CET 2009


Author: hailfinger
Date: 2009-11-20 02:12:45 +0100 (Fri, 20 Nov 2009)
New Revision: 767

Modified:
   trunk/flashchips.c
   trunk/flashchips.h
   trunk/spi.c
Log:
If a chip is not on the RDID generic vendor list nor on the REMS
specific ID list, flashrom will claim that no chip is there. Handle
these cases gracefully. flashrom will ignore generic matches if a
specific chip was found, so this will have no impact on supported chips,
but help a lot for a first quick analysis by the user or developer. The
only drawback is that unknown chips may be recognized multiple times
until they are added to flashchips.[ch].

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Marc Jones <marcj303 at gmail.com>


Modified: trunk/flashchips.c
===================================================================
--- trunk/flashchips.c	2009-11-17 09:57:34 UTC (rev 766)
+++ trunk/flashchips.c	2009-11-20 01:12:45 UTC (rev 767)
@@ -3340,5 +3340,32 @@
 		.read		= NULL,
 	},
 
+	{
+		.vendor		= "Generic",
+		.name		= "unknown SPI chip (RDID)",
+		.bustype	= CHIP_BUSTYPE_SPI,
+		.manufacture_id	= GENERIC_MANUF_ID,
+		.model_id	= GENERIC_DEVICE_ID,
+		.total_size	= 0,
+		.page_size	= 256,
+		.tested		= TEST_BAD_PREW,
+		.probe		= probe_spi_rdid,
+		.erase		= NULL,
+		.write		= NULL,
+	},
+	{
+		.vendor		= "Generic",
+		.name		= "unknown SPI chip (REMS)",
+		.bustype	= CHIP_BUSTYPE_SPI,
+		.manufacture_id	= GENERIC_MANUF_ID,
+		.model_id	= GENERIC_DEVICE_ID,
+		.total_size	= 0,
+		.page_size	= 256,
+		.tested		= TEST_BAD_PREW,
+		.probe		= probe_spi_rems,
+		.erase		= NULL,
+		.write		= NULL,
+	},
+
 	{ NULL 	}
 };

Modified: trunk/flashchips.h
===================================================================
--- trunk/flashchips.h	2009-11-17 09:57:34 UTC (rev 766)
+++ trunk/flashchips.h	2009-11-20 01:12:45 UTC (rev 767)
@@ -34,6 +34,7 @@
  * SPI parts have 16-bit device IDs if they support RDID.
  */
 
+#define GENERIC_MANUF_ID	0xffff	/* Check if there is a vendor ID */
 #define GENERIC_DEVICE_ID	0xffff	/* Only match the vendor ID */
 
 #define ALLIANCE_ID		0x52	/* Alliance Semiconductor */

Modified: trunk/spi.c
===================================================================
--- trunk/spi.c	2009-11-17 09:57:34 UTC (rev 766)
+++ trunk/spi.c	2009-11-20 01:12:45 UTC (rev 767)
@@ -281,6 +281,11 @@
 	    GENERIC_DEVICE_ID == flash->model_id)
 		return 1;
 
+	/* Test if there is any vendor ID. */
+	if (GENERIC_MANUF_ID == flash->manufacture_id &&
+	    id1 != 0xff)
+		return 1;
+
 	return 0;
 }
 
@@ -340,6 +345,11 @@
 	    GENERIC_DEVICE_ID == flash->model_id)
 		return 1;
 
+	/* Test if there is any vendor ID. */
+	if (GENERIC_MANUF_ID == flash->manufacture_id &&
+	    id1 != 0xff)
+		return 1;
+
 	return 0;
 }
 





More information about the flashrom mailing list