Edward O'Callaghan submitted this change.

View Change



2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: build bot (Jenkins): Verified Sam McNally: Looks good to me, approved Anastasia Klimchuk: Looks good to me, approved
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>
---
M flashrom.c
M include/programmer.h
2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/flashrom.c b/flashrom.c
index 3e21416..f26bb47 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: 4
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Sam McNally <sammc@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged