Edward O'Callaghan has uploaded this change for review.

View Change

cli_classic.c: Allow ctrl of behaviour with WO and RO regions

TODO: update man page.

Change-Id: Iff753b748765410ea38b845613c361db7ad16a61
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M cli_classic.c
1 file changed, 27 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/95/70895/1
diff --git a/cli_classic.c b/cli_classic.c
index c72836f..305106f 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -57,6 +57,8 @@
" -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"
+ " --noread-writeonly skip reading write-only regions without failure\n"
+ " --nowrite-readonly skip writing read-only regions without failure\n"
" -x | --extract extract regions to files\n"
" -l | --layout <layoutfile> read ROM layout from <layoutfile>\n"
" --wp-disable disable write protection\n"
@@ -585,6 +587,7 @@
bool set_wp_range = false, set_wp_region = false, print_wp_ranges = false;
bool read_it = false, extract_it = false, write_it = false, erase_it = false, verify_it = false;
bool dont_verify_it = false, dont_verify_all = false;
+ bool dont_read_wo = false, dont_write_ro = false;
bool list_supported = false;
bool show_progress = false;
struct flashrom_layout *layout = NULL;
@@ -603,6 +606,8 @@
OPTION_WP_DISABLE,
OPTION_WP_LIST,
OPTION_PROGRESS,
+ OPTION_NOREAD_WRITEONLY,
+ OPTION_NOWRITE_READONLY,
};
int ret = 0;

@@ -614,6 +619,8 @@
{"verify", 1, NULL, 'v'},
{"noverify", 0, NULL, 'n'},
{"noverify-all", 0, NULL, 'N'},
+ {"noread-writeonly", 0, NULL, OPTION_NOREAD_WRITEONLY},
+ {"nowrite-readonly", 0, NULL, OPTION_NOWRITE_READONLY},
{"extract", 0, NULL, 'x'},
{"chip", 1, NULL, 'c'},
{"verbose", 0, NULL, 'V'},
@@ -885,6 +892,12 @@
case OPTION_PROGRESS:
show_progress = true;
break;
+ case OPTION_NOREAD_WRITEONLY:
+ dont_read_wo = true;
+ break;
+ case OPTION_NOWRITE_READONLY:
+ dont_write_ro = true;
+ break;
default:
cli_classic_abort_usage(NULL);
break;
@@ -1194,6 +1207,8 @@
#endif
flashrom_flag_set(fill_flash, FLASHROM_FLAG_VERIFY_AFTER_WRITE, !dont_verify_it);
flashrom_flag_set(fill_flash, FLASHROM_FLAG_VERIFY_WHOLE_CHIP, !dont_verify_all);
+ flashrom_flag_set(fill_flash, FLASHROM_FLAG_SKIP_UNREADABLE_REGIONS, dont_read_wo);
+ flashrom_flag_set(fill_flash, FLASHROM_FLAG_SKIP_UNWRITABLE_REGIONS, dont_write_ro);

/* FIXME: We should issue an unconditional chip reset here. This can be
* done once we have a .reset function in struct flashchip.

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Iff753b748765410ea38b845613c361db7ad16a61
Gerrit-Change-Number: 70895
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange