Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/47066 )
Change subject: cli_classic.c: Attempt to hook up fmap cros feature ......................................................................
cli_classic.c: Attempt to hook up fmap cros feature
Change-Id: Ieb8e96821832ed8a4ab6f1525a2b263925c76968 Signed-off-by: Edward O'Callaghan quasisec@google.com --- M cli_classic.c 1 file changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/66/47066/1
diff --git a/cli_classic.c b/cli_classic.c index ae7f6ef..beb578c 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -154,11 +154,13 @@ int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0; int dont_verify_it = 0, dont_verify_all = 0, list_supported = 0, operation_specified = 0; struct flashrom_layout *layout = NULL; + int set_ignore_fmap = 0; enum programmer prog = PROGRAMMER_INVALID; enum { OPTION_IFD = 0x0100, OPTION_FMAP, OPTION_FMAP_FILE, + OPTION_IGNORE_FMAP, OPTION_FLASH_CONTENTS, OPTION_FLASH_NAME, OPTION_FLASH_SIZE, @@ -187,6 +189,7 @@ {"ifd", 0, NULL, OPTION_IFD}, {"fmap", 0, NULL, OPTION_FMAP}, {"fmap-file", 1, NULL, OPTION_FMAP_FILE}, + {"ignore-fmap", 0, NULL, OPTION_IGNORE_FMAP}, {"image", 1, NULL, 'i'}, {"flash-contents", 1, NULL, OPTION_FLASH_CONTENTS}, {"flash-name", 0, NULL, OPTION_FLASH_NAME}, @@ -314,6 +317,9 @@ cli_classic_abort_usage("Error: --layout and --fmap both specified. Aborting.\n"); fmap = 1; break; + case OPTION_IGNORE_FMAP: + set_ignore_fmap = 1; + break; case 'i': tempstr = strdup(optarg); if (register_include_arg(&include_args, tempstr)) { @@ -641,6 +647,26 @@ goto out_shutdown; }
+#if 0 + /* If the user doesn't specify any -i argument, then we can skip the + * fmap parsing to speed up. */ + if (get_num_include_args() == 0 && !extract_it) { + msg_gdbg("No -i argument is specified, set ignore_fmap.\n"); + set_ignore_fmap = 1; + } +#endif + + /* + * Add entries for regions specified in flashmap, unless the user + * explicitly requested not to look for fmap, or provided a layout + * file. + */ + if (!set_ignore_fmap && !layoutfile && + get_fmap_entries(filename, fill_flash) < 0) { + ret = 1; + goto out_shutdown; + } + if (set_wp_enable && set_wp_disable) { msg_ginfo("Error: --wp-enable and --wp-disable are mutually exclusive\n"); ret = 1;