Edward O'Callaghan has uploaded this change for review.

View Change

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>
---
M flashrom.c
M include/programmer.h
2 files changed, 20 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/24/72424/1
diff --git a/flashrom.c b/flashrom.c
index 67b71f0..09172f6 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -277,6 +277,9 @@
} 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);
diff --git a/include/programmer.h b/include/programmer.h
index 9e706d5..db32b2c 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -418,6 +418,7 @@
enum flashrom_wp_result (*wp_get_ranges)(struct flashrom_wp_ranges **, struct flashctx *);
void (*get_region)(const struct flashctx *flash, unsigned int addr, struct flash_region *region);
int (*shutdown)(void *data);
+ void (*delay) (const struct flashctx *flash, unsigned int usecs);
void *data;
};
int register_opaque_master(const struct opaque_master *mst, void *data);

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

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