Edward O'Callaghan submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, but someone else must approve Angel Pons: Looks good to me, but someone else must approve Anastasia Klimchuk: Looks good to me, approved
cli_classic: Use flashrom_init() from API

flashrom_init() already does delay calibration and self-checking
via the canonical libflashrom API. Port the cli implementation
to go via the libflashrom API entry-point natively.

BUG=b:208132085
TEST=```sudo ./flashrom -p internal --flash-size
<snip>
Found Programmer flash chip "Opaque flash chip" (16384 kB, Programmer-specific) mapped at physical address 0x0000000000000000.
16777216
```

Change-Id: I07faeed876f678c35355621a080c7852eed16824
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/61582
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
---
M cli_classic.c
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/cli_classic.c b/cli_classic.c
index 4a5f298..317172c 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -350,7 +350,8 @@
print_version();
print_banner();

- if (selfcheck())
+ /* FIXME: Delay calibration should happen in programmer code. */
+ if (flashrom_init(1))
exit(1);

setbuf(stdout, NULL);
@@ -661,9 +662,6 @@
}
}

- /* FIXME: Delay calibration should happen in programmer code. */
- myusec_calibrate_delay();
-
if (programmer_init(prog, pparam)) {
msg_perr("Error: Programmer initialization failed.\n");
ret = 1;

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

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I07faeed876f678c35355621a080c7852eed16824
Gerrit-Change-Number: 61582
Gerrit-PatchSet: 5
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged