summaryrefslogtreecommitdiffstats
path: root/jedec.c
diff options
context:
space:
mode:
authorSean Nelson <audiohacked@gmail.com>2010-10-20 21:13:19 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-10-20 21:13:19 +0000
commitf59e2637d184eef8e3ef8914ac500161804fc526 (patch)
treeff26f6f3a14b86338723f9c9a37bb67e0ec99e34 /jedec.c
parent42d38a9dd1ef58870635c0e003b1a37e89a51ba7 (diff)
downloadast2050-flashrom-f59e2637d184eef8e3ef8914ac500161804fc526.zip
ast2050-flashrom-f59e2637d184eef8e3ef8914ac500161804fc526.tar.gz
Add a reset to probe_jedec before we read the chip's IDs
Previous probes might have had too short delays for entering ID mode, so the chip may still be in the process of entering the ID mode. Due to that, an additional delay before the reset makes sense. Add FEATURE_RESET_MASK to deal cleanly with those feature bits. Maciej Pijanka tested the patch and it fixes probing for him with some old Atmel chips. Corresponding to flashrom svn r1216. Signed-off-by: Sean Nelson <audiohacked@gmail.com> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Anders Juel Jensen <andersjjensen@gmail.com> Tested-by: Maciej Pijanka <maciej.pijanka@gmail.com> Acked-by: Sean Nelson <audiohacked@gmail.com>
Diffstat (limited to 'jedec.c')
-rw-r--r--jedec.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/jedec.c b/jedec.c
index 4f042f2..199c64d 100644
--- a/jedec.c
+++ b/jedec.c
@@ -142,6 +142,26 @@ static int probe_jedec_common(struct flashchip *flash, unsigned int mask)
return 0;
}
+ /* Earlier probes might have been too fast for the chip to enter ID
+ * mode completely. Allow the chip to finish this before seeing a
+ * reset command.
+ */
+ if (probe_timing_enter)
+ programmer_delay(probe_timing_enter);
+ /* Reset chip to a clean slate */
+ if ((flash->feature_bits & FEATURE_RESET_MASK) == FEATURE_LONG_RESET)
+ {
+ chip_writeb(0xAA, bios + (0x5555 & mask));
+ if (probe_timing_exit)
+ programmer_delay(10);
+ chip_writeb(0x55, bios + (0x2AAA & mask));
+ if (probe_timing_exit)
+ programmer_delay(10);
+ }
+ chip_writeb(0xF0, bios + (0x5555 & mask));
+ if (probe_timing_exit)
+ programmer_delay(probe_timing_exit);
+
/* Issue JEDEC Product ID Entry command */
chip_writeb(0xAA, bios + (0x5555 & mask));
if (probe_timing_enter)
@@ -172,7 +192,7 @@ static int probe_jedec_common(struct flashchip *flash, unsigned int mask)
}
/* Issue JEDEC Product ID Exit command */
- if ((flash->feature_bits & FEATURE_SHORT_RESET) == FEATURE_LONG_RESET)
+ if ((flash->feature_bits & FEATURE_RESET_MASK) == FEATURE_LONG_RESET)
{
chip_writeb(0xAA, bios + (0x5555 & mask));
if (probe_timing_exit)
OpenPOWER on IntegriCloud