summaryrefslogtreecommitdiff
path: root/util/flashrom/spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2008-02-06 22:07:58 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2008-02-06 22:07:58 +0000
commitc23b3a57321dfa1b3341608074facde81aa2a8de (patch)
treee8da9f687847d1bb27596af75d69b225106e658b /util/flashrom/spi.c
parenta7c92a6dc4e72ad5d7dba1b23d7a8d7e914cf1e9 (diff)
downloadcoreboot-c23b3a57321dfa1b3341608074facde81aa2a8de.tar.xz
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. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Chris Lingard <chris@stockwith.co.uk> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3091 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/spi.c')
-rw-r--r--util/flashrom/spi.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/util/flashrom/spi.c b/util/flashrom/spi.c
index 9313850521..a322d31ae0 100644
--- a/util/flashrom/spi.c
+++ b/util/flashrom/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) {