From 99d1595329190de2a09785e8e2017ecfc397eb23 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Mon, 2 May 2016 16:54:24 +0200 Subject: cli_classic: Add option (-N, --noverify-all) This option specifies to verify included regions only after a write. It also reduces the data read before the write. v2: o Changed short option name to `-N`. o Added section in the manual page. Change-Id: I40b5983f56d62821d17b827b88b73d1d41a30bd7 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/17950 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- cli_classic.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'cli_classic.c') diff --git a/cli_classic.c b/cli_classic.c index 00baf490..391fc5a8 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -42,7 +42,7 @@ static void cli_classic_usage(const char *name) "-z|" #endif "-p [:] [-c ]\n" - "[-E|(-r|-w|-v) ] [-l [-i ]...] [-n] [-f]]\n" + "[-E|(-r|-w|-v) ] [-l [-i ]...] [-n] [-N] [-f]]\n" "[-V[V[V]]] [-o ]\n\n", name); printf(" -h | --help print this help text\n" @@ -55,6 +55,7 @@ static void cli_classic_usage(const char *name) " -c | --chip probe only for specified flash chip\n" " -f | --force force specific operations (see man page)\n" " -n | --noverify don't auto-verify\n" + " -N | --noverify-all verify included regions only (cf. -i)\n" " -l | --layout read ROM layout from \n" " -i | --image only flash image from flash layout\n" " -o | --output log output to \n" @@ -103,17 +104,18 @@ int main(int argc, char *argv[]) int list_supported_wiki = 0; #endif int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0; - int dont_verify_it = 0, list_supported = 0, operation_specified = 0; + int dont_verify_it = 0, dont_verify_all = 0, list_supported = 0, operation_specified = 0; enum programmer prog = PROGRAMMER_INVALID; int ret = 0; - static const char optstring[] = "r:Rw:v:nVEfc:l:i:p:Lzho:"; + static const char optstring[] = "r:Rw:v:nNVEfc:l:i:p:Lzho:"; static const struct option long_options[] = { {"read", 1, NULL, 'r'}, {"write", 1, NULL, 'w'}, {"erase", 0, NULL, 'E'}, {"verify", 1, NULL, 'v'}, {"noverify", 0, NULL, 'n'}, + {"noverify-all", 0, NULL, 'N'}, {"chip", 1, NULL, 'c'}, {"verbose", 0, NULL, 'V'}, {"force", 0, NULL, 'f'}, @@ -190,6 +192,9 @@ int main(int argc, char *argv[]) } dont_verify_it = 1; break; + case 'N': + dont_verify_all = 1; + break; case 'c': chip_to_probe = strdup(optarg); break; @@ -536,7 +541,7 @@ int main(int argc, char *argv[]) flashrom_flag_set(fill_flash, FLASHROM_FLAG_FORCE, !!force); flashrom_flag_set(fill_flash, FLASHROM_FLAG_FORCE_BOARDMISMATCH, !!force_boardmismatch); flashrom_flag_set(fill_flash, FLASHROM_FLAG_VERIFY_AFTER_WRITE, !dont_verify_it); - flashrom_flag_set(fill_flash, FLASHROM_FLAG_VERIFY_WHOLE_CHIP, true); + flashrom_flag_set(fill_flash, FLASHROM_FLAG_VERIFY_WHOLE_CHIP, !dont_verify_all); /* FIXME: We should issue an unconditional chip reset here. This can be * done once we have a .reset function in struct flashchip. -- cgit v1.2.3