summaryrefslogtreecommitdiff
path: root/82802ab.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-03-22 23:47:38 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-03-22 23:47:38 +0000
commit2750ad6258089047af337c57faca271c455e40cf (patch)
treeb34d080e817b9a94809b24734a0bf64ed9c5605c /82802ab.c
parentf44c517ce4992887caa5517e6ddab4fb10dc1023 (diff)
downloadflashrom-2750ad6258089047af337c57faca271c455e40cf.tar.gz
JEDEC ID probing checks the parity of the vendor ID and verifies that
the ID differs from the flash chip contents. Add the same feature to 82802AB ID probing. This should reduce the number of lines we have to look at to determine if we're missing a chip definition or if we need a board enable. Just use grep on the log: grep -v "parity violation" To narrow it down further, try: grep -v "id1 is normal flash content, id2 is normal flash content" And of course you want to ignore the skipped probes: grep -v "skipped" The remaining lines are worth examining, and if those look bogus as well, you can bet that we just need a board enable. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@971 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to '82802ab.c')
-rw-r--r--82802ab.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/82802ab.c b/82802ab.c
index 191114b..b6bd689 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -47,6 +47,7 @@ int probe_82802ab(struct flashchip *flash)
{
chipaddr bios = flash->virtual_memory;
uint8_t id1, id2;
+ uint8_t flashcontent1, flashcontent2;
/* Reset to get a clean state */
chip_writeb(0xFF, bios);
@@ -64,8 +65,21 @@ int probe_82802ab(struct flashchip *flash)
programmer_delay(10);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
+ printf_debug("%s: id1 0x%02x, id2 0x%02x", __func__, id1, id2);
+ if (!oddparity(id1))
+ printf_debug(", id1 parity violation");
+
+ /* Read the product ID location again. We should now see normal flash contents. */
+ flashcontent1 = chip_readb(bios);
+ flashcontent2 = chip_readb(bios + 0x01);
+
+ if (id1 == flashcontent1)
+ printf_debug(", id1 is normal flash content");
+ if (id2 == flashcontent2)
+ printf_debug(", id2 is normal flash content");
+
+ printf_debug("\n");
if (id1 != flash->manufacture_id || id2 != flash->model_id)
return 0;