diff options
author | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2009-09-05 01:16:30 +0000 |
---|---|---|
committer | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2009-09-05 01:16:30 +0000 |
commit | bbdb455db32cbe91586f0f27834720153c77ef43 (patch) | |
tree | 2d17169c2f7f720fc40ac6184b15d46572d3086f /82802ab.c | |
parent | 2271d1f31021fd4b958f4ded30433af30fbba369 (diff) | |
download | flashrom-bbdb455db32cbe91586f0f27834720153c77ef43.tar.gz |
Quite a few probe functions in flashrom are copies of probe_jedec with
additional lock bit printing or other glue. Make them call probe_jedec
instead.
Use the correct reset sequence for 82802AB. Detailed explanation:
The reset sequence before ID reading was correct, so ID always
worked. But the reset sequence after ID reading was a copy-paste
leftover from probe_jedec and didn't have any effect. I dug up
flash_and_burn from the freebios-v1 tree and found out that 82802ab.c
was indeed a copy of jedec.c with lots of experimental unannotated #if 0
and #if 1.
About the wait_82802ab change:
Before the patch, wait_82802ab entered read status mode, switched to ID
mode, then tried an incorrect and unsupported JEDEC command to exit ID
mode. Nobody ever saw that this failed because all subsequent function
calls had the correct reset sequence at the beginning.
With the patch, wait_82802ab enters read status mode, then switches back
to read mode with the official reset command.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@717 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to '82802ab.c')
-rw-r--r-- | 82802ab.c | 30 |
1 files changed, 7 insertions, 23 deletions
@@ -47,14 +47,11 @@ int probe_82802ab(struct flashchip *flash) chipaddr bios = flash->virtual_memory; uint8_t id1, id2; -#if 0 - chip_writeb(0xAA, bios + 0x5555); - chip_writeb(0x55, bios + 0x2AAA); - chip_writeb(0x90, bios + 0x5555); -#endif - - chip_writeb(0xff, bios); + /* Reset to get a clean state */ + chip_writeb(0xFF, bios); programmer_delay(10); + + /* Enter ID mode */ chip_writeb(0x90, bios); programmer_delay(10); @@ -62,9 +59,7 @@ int probe_82802ab(struct flashchip *flash) id2 = chip_readb(bios + 0x01); /* Leave ID mode */ - chip_writeb(0xAA, bios + 0x5555); - chip_writeb(0x55, bios + 0x2AAA); - chip_writeb(0xF0, bios + 0x5555); + chip_writeb(0xFF, bios); programmer_delay(10); @@ -81,7 +76,6 @@ int probe_82802ab(struct flashchip *flash) uint8_t wait_82802ab(chipaddr bios) { uint8_t status; - uint8_t id1, id2; chip_writeb(0x70, bios); if ((chip_readb(bios) & 0x80) == 0) { // it's busy @@ -90,18 +84,8 @@ uint8_t wait_82802ab(chipaddr bios) status = chip_readb(bios); - // put another command to get out of status register mode - - chip_writeb(0x90, bios); - programmer_delay(10); - - id1 = chip_readb(bios); - id2 = chip_readb(bios + 0x01); - - // this is needed to jam it out of "read id" mode - chip_writeb(0xAA, bios + 0x5555); - chip_writeb(0x55, bios + 0x2AAA); - chip_writeb(0xF0, bios + 0x5555); + /* Reset to get a clean state */ + chip_writeb(0xFF, bios); return status; } |