From 1263d2af08990b7c372a744ab970a7f0e279885f Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 6 Feb 2008 22:07:58 +0000 Subject: Handle JEDEC JEP106W continuation codes in SPI RDID Some vendors like Programmable Micro Corp (PMC) 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. Add support for the PMC Pm25LV family of SPI flash chips. Corresponding to flashrom svn r191 and coreboot v2 svn r3091. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Chris Lingard --- spi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'spi.c') diff --git a/spi.c b/spi.c index 9313850..a322d31 100644 --- a/spi.c +++ b/spi.c @@ -278,11 +278,17 @@ void generic_spi_write_disable() int probe_spi(struct flashchip *flash) { unsigned char readarr[3]; - uint8_t manuf_id; - uint16_t model_id; + uint32_t manuf_id; + uint32_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) { -- cgit v1.1