1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +02:00

flashrom.c: Make 'chip_to_probe' a param to probe_flash()

Apart from the very bespoke case of 'probe_w29ee011()'
the override 'chip_to_probe' name is a nature parameter
to 'probe_flash()'. However we can deal with w29ee011
by providing a probe specific validation function to
check if the chip can indeed be overriden.

TEST=`./flashrom -p internal --flash-name`.

Change-Id: Ifcdace07ea2135d83dea92cfa5c6bec8d7ddf05d
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67091
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
This commit is contained in:
Edward O'Callaghan
2022-08-25 23:11:56 +10:00
committed by Anastasia Klimchuk
parent 39b1890773
commit af76e44752
6 changed files with 27 additions and 18 deletions

View File

@ -646,6 +646,7 @@ int main(int argc, char *argv[])
char *pparam = NULL;
struct layout_include_args *include_args = NULL;
char *wp_region = NULL;
const char *chip_to_probe = NULL;
/*
* Safety-guard against a user who has (mistakenly) closed
@ -977,7 +978,7 @@ int main(int argc, char *argv[])
for (j = 0; j < registered_master_count; j++) {
startchip = 0;
while (chipcount < (int)ARRAY_SIZE(flashes)) {
startchip = probe_flash(&registered_masters[j], startchip, &flashes[chipcount], 0);
startchip = probe_flash(&registered_masters[j], startchip, &flashes[chipcount], 0, chip_to_probe);
if (startchip == -1)
break;
chipcount++;
@ -1020,7 +1021,7 @@ int main(int argc, char *argv[])
"chip, using the first one.\n");
for (j = 0; j < registered_master_count; j++) {
mst = &registered_masters[j];
startchip = probe_flash(mst, 0, &flashes[0], 1);
startchip = probe_flash(mst, 0, &flashes[0], 1, chip_to_probe);
if (startchip != -1)
break;
}