1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-09-13 16:51:58 +02:00

Erase should respect --noverify option

This commit adds check for the flag `verify_after_write` after
erase operation and does not perfom verification if the flag
disabled.
From command line, this is set by --noverify option.
libflashrom flag is FLASHROM_FLAG_VERIFY_AFTER_WRITE

Default stays the same, by default verification is performed.

This commit also adds test for the scenario.

Previously, erase operation ignored --noverify option and always
performed verification.

For more details, see
Ticket: https://ticket.coreboot.org/issues/520

Change-Id: I9f6cb7210f4dcdc32870f9096657a08b12e77c7f
Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/88734
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Carly Zlabek <carlyzlabek@gmail.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Vincent Fazio <vfazio@gmail.com>
This commit is contained in:
Anastasia Klimchuk
2025-08-09 19:52:41 +10:00
parent fa2d2ccb94
commit 008919aa69
3 changed files with 86 additions and 4 deletions

View File

@@ -301,7 +301,8 @@ static int erase_write_helper(struct flashctx *const flashctx, chipoff_t region_
if (erasefn(flashctx, start_addr, block_len)) {
return -1;
}
if (check_erased_range(flashctx, start_addr, block_len)) {
if (flashctx->flags.verify_after_write
&& check_erased_range(flashctx, start_addr, block_len)) {
msg_cerr("ERASE FAILED!\n");
return -1;
}