diff options
author | Edward O'Callaghan <quasisec@google.com> | 2023-01-25 14:15:33 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2023-02-01 02:50:51 +0000 |
commit | 0a6fa239241a951e524e74254b9a3bc4a323b2c7 (patch) | |
tree | 56c4784f95f0536aacdfd3867a2f6d239cf055de /flashrom.c | |
parent | 31c5caa6149e63181ae67d12dc22345c3617c2f2 (diff) | |
download | flashrom-0a6fa239241a951e524e74254b9a3bc4a323b2c7.tar.gz flashrom-0a6fa239241a951e524e74254b9a3bc4a323b2c7.tar.bz2 flashrom-0a6fa239241a951e524e74254b9a3bc4a323b2c7.zip |
programmers: Allow opaque programmers to specify custom delay
The dummyprogrammer in the opaque case can have a NOP delay
to avoid wasting CPU time and energy.
BUG=b:266014935
TEST=builds
Change-Id: Ia86ad21f011214abc2aa0891a43559f91e2a9591
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/72424
Reviewed-by: Sam McNally <sammc@google.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'flashrom.c')
-rw-r--r-- | flashrom.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/flashrom.c b/flashrom.c index 3e214163e..f26bb4774 100644 --- a/flashrom.c +++ b/flashrom.c @@ -277,6 +277,9 @@ void programmer_delay(const struct flashctx *flash, unsigned int usecs) } else if (flash->mst->buses_supported & BUS_PARALLEL) { if (flash->mst->par.delay) return flash->mst->par.delay(flash, usecs); + } else if (flash->mst->buses_supported & BUS_PROG) { + if (flash->mst->opaque.delay) + return flash->mst->opaque.delay(flash, usecs); } return default_delay(usecs); |