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
Index: util/flashrom/jedec.c =================================================================== --- util/flashrom/jedec.c (Revision 2955) +++ util/flashrom/jedec.c (Arbeitskopie) @@ -89,7 +89,11 @@ *(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 @@ *(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)
On Tue, Nov 13, 2007 at 03:08:45PM +0100, Carl-Daniel Hailfinger wrote:
Fix ATMEL 29C020 detection with flashrom.
Acked-by: Peter Stuge peter@stuge.se
On 13.11.2007 15:32, Peter Stuge wrote:
On Tue, Nov 13, 2007 at 03:08:45PM +0100, Carl-Daniel Hailfinger wrote:
Fix ATMEL 29C020 detection with flashrom.
Acked-by: Peter Stuge peter@stuge.se
Thanks, r2962.
Carl-Daniel