[coreboot] [PATCH] flashrom: Handle JEDEC continuation codes in SPI ID

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Wed Feb 6 02:35:17 CET 2008


Chris: Try this patch against latest flashrom, please. It will not
detect your chip, but id1/id2 output should change. I need full output
from flashrom -V with that patch to proceed further.

Handle JEDEC JEP106W continuation codes in SPI RDID. Some vendors like
Programmable Micro Corp need this.
Both the serial and parallel flash JEDEC detection routines would
benefit from a parity/sanity check of the vendor ID. Will do this later.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

http://www.hailfinger.org/

Index: flashrom-spisecondjedecpage/spi.c
===================================================================
--- flashrom-spisecondjedecpage/spi.c	(Revision 3086)
+++ flashrom-spisecondjedecpage/spi.c	(Arbeitskopie)
@@ -281,8 +281,14 @@
 	uint8_t manuf_id;
 	uint16_t model_id;
 	if (!generic_spi_rdid(readarr)) {
-		manuf_id = readarr[0];
-		model_id = (readarr[1] << 8) | readarr[2];
+		/* Check if this is a continuation vendor ID */
+		if (readarr[0] == 0x7f) {
+			manuf_id = (readarr[0] << 8) | readarr[1];
+			model_id = readarr[2];
+		} else {
+			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) {






More information about the coreboot mailing list