summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2007-11-13 14:56:54 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2007-11-13 14:56:54 +0000
commit6d6146c377caee1c0dd888b9b08faeb3c8a3c43f (patch)
tree09c591aa71e8ef0c9369b7bd0431eafaf1f692cb /util
parentd591baa22f52661de836bc4a04ea6c010b0d83de (diff)
downloadcoreboot-6d6146c377caee1c0dd888b9b08faeb3c8a3c43f.tar.xz
Fix ATMEL 29C020 detection with flashrom. The JEDEC probe routine had
a delay of 10 us after entering ID mode and this was insufficient for the 29C020. The data sheet claims we have to wait 10 ms, but tests have shown that 20 us suffice. Allow for variations in chip delays with a factor of 2 safety margin. 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@2962 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rw-r--r--util/flashrom/jedec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/util/flashrom/jedec.c b/util/flashrom/jedec.c
index 46153dd66c..30d0cdadd2 100644
--- a/util/flashrom/jedec.c
+++ b/util/flashrom/jedec.c
@@ -89,7 +89,11 @@ int probe_jedec(struct flashchip *flash)
*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
myusec_delay(10);
*(volatile uint8_t *)(bios + 0x5555) = 0x90;
- myusec_delay(10);
+ /* Older chips may need up to 100 us to respond. The ATMEL 29C020
+ * needs 10 ms according to the data sheet, but it has been tested
+ * to work reliably with 20 us. Allow a factor of 2 safety margin.
+ */
+ myusec_delay(40);
/* Read product ID */
id1 = *(volatile uint8_t *)bios;
@@ -101,7 +105,7 @@ int probe_jedec(struct flashchip *flash)
*(volatile uint8_t *)(bios + 0x2AAA) = 0x55;
myusec_delay(10);
*(volatile uint8_t *)(bios + 0x5555) = 0xF0;
- myusec_delay(10);
+ myusec_delay(40);
printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)