diff options
author | Edward O'Callaghan <quasisec@google.com> | 2022-08-25 23:11:56 +1000 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-11-06 23:30:33 +0000 |
commit | af76e447527da609965dff5726696b59d6873d6e (patch) | |
tree | a6153ef63056d4501cec684410a28314a4aea7e5 /cli_classic.c | |
parent | 39b189077379a6cdd99e5ae20452fa685b94500e (diff) | |
download | flashrom-af76e447527da609965dff5726696b59d6873d6e.tar.gz flashrom-af76e447527da609965dff5726696b59d6873d6e.tar.bz2 flashrom-af76e447527da609965dff5726696b59d6873d6e.zip |
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>
Diffstat (limited to 'cli_classic.c')
-rw-r--r-- | cli_classic.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli_classic.c b/cli_classic.c index b66094ccd..574afff1f 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -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(®istered_masters[j], startchip, &flashes[chipcount], 0); + startchip = probe_flash(®istered_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 = ®istered_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; } |