Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/72630 )
Change subject: jedec.c: Make programer_delay() usage symetrical ......................................................................
jedec.c: Make programer_delay() usage symetrical
Change-Id: Ia8c22914bc14d39716fb2f82f0b8394edc1cae7f Signed-off-by: Edward O'Callaghan quasisec@google.com --- M jedec.c 1 file changed, 20 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/30/72630/1
diff --git a/jedec.c b/jedec.c index b90454d..70acc65 100644 --- a/jedec.c +++ b/jedec.c @@ -293,17 +293,24 @@ const chipaddr bios = flash->virtual_memory; bool shifted = (flash->chip->feature_bits & FEATURE_ADDR_SHIFTED); const unsigned int mask = getaddrmask(flash->chip); - unsigned int delay_us = (flash->chip->probe_timing == TIMING_ZERO) ? 0 : 10; + unsigned int probe_timing_enter, probe_timing_exit; + + if (probe_timings(chip, &probe_timing_enter, &probe_timing_exit) < 0) + return;
if (!operand) operand = (shifted ? 0x2AAA : 0x5555) & mask;
chip_writeb(flash, 0xAA, bios + ((shifted ? 0x2AAA : 0x5555) & mask)); - programmer_delay(flash, delay_us); + if (probe_timing_enter) + programmer_delay(flash, 10); chip_writeb(flash, 0x55, bios + ((shifted ? 0x5555 : 0x2AAA) & mask)); programmer_delay(flash, delay_us); + if (probe_timing_enter) + programmer_delay(flash, 10); chip_writeb(flash, op, bios + operand); - programmer_delay(flash, delay_us); + if (probe_timing_enter) + programmer_delay(flash, probe_timing_enter); }
int erase_sector_jedec(struct flashctx *flash, unsigned int page, unsigned int size)