diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2008-05-14 12:03:06 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2008-05-14 12:03:06 +0000 |
commit | 68db3a2bdc335519003c7f18ead043d7507718aa (patch) | |
tree | 581d02c85a09d3370291069b9fb0f393fee1f0a3 /util/flashrom/spi.c | |
parent | b69e46bca3ee8e25ee45ba04ff812e507fccb0fc (diff) |
Check the JEDEC vendor ID for correct parity. Flash chips which can be
detected by JEDEC probe routines all have vendor IDs with correct
parity. Use a parity check as additional hint whether a vendor ID makes
sense.
Note: Device IDs have no parity requirements whatsoever.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3308 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/spi.c')
-rw-r--r-- | util/flashrom/spi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/util/flashrom/spi.c b/util/flashrom/spi.c index 5cfc052103..786d555ee9 100644 --- a/util/flashrom/spi.c +++ b/util/flashrom/spi.c @@ -71,8 +71,12 @@ int probe_spi(struct flashchip *flash) uint32_t manuf_id; uint32_t model_id; if (!spi_rdid(readarr)) { + if (!oddparity(readarr[0])) + printf_debug("RDID byte 0 parity violation.\n"); /* Check if this is a continuation vendor ID */ if (readarr[0] == 0x7f) { + if (!oddparity(readarr[1])) + printf_debug("RDID byte 1 parity violation.\n"); manuf_id = (readarr[0] << 8) | readarr[1]; model_id = readarr[2]; } else { |