Edward O'Callaghan has uploaded this change for review.

View Change

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)

To view, visit change 72630. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia8c22914bc14d39716fb2f82f0b8394edc1cae7f
Gerrit-Change-Number: 72630
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange