Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/67720 )
(
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: writeprotect: Add some debug logging if wp_verify fails ......................................................................
writeprotect: Add some debug logging if wp_verify fails
Change-Id: I5fcaf767570418f90ae44826a1135d9b49653033 Signed-off-by: Evan Benn evanbenn@chromium.org Reviewed-on: https://review.coreboot.org/c/flashrom/+/67720 Reviewed-by: Nikolai Artemiev nartemiev@google.com Reviewed-by: Edward O'Callaghan quasisec@chromium.org Reviewed-by: Sergii Dmytruk sergii.dmytruk@3mdeb.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M writeprotect.c 1 file changed, 23 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Edward O'Callaghan: Looks good to me, approved Nikolai Artemiev: Looks good to me, but someone else must approve Sergii Dmytruk: Looks good to me, but someone else must approve
diff --git a/writeprotect.c b/writeprotect.c index dcffe03..f72c362 100644 --- a/writeprotect.c +++ b/writeprotect.c @@ -155,6 +155,7 @@ return FLASHROM_WP_ERR_WRITE_FAILED; }
+ enum flashrom_wp_result ret = FLASHROM_WP_OK; /* Verify each register */ for (enum flash_reg reg = STATUS1; reg < MAX_REGISTERS; reg++) { if (!write_masks[reg]) @@ -164,14 +165,18 @@ if (wp_read_register(flash, reg, &value)) return FLASHROM_WP_ERR_READ_FAILED;
+ msg_cdbg2("%s: wp_verify reg:%u value:0x%x\n", __func__, reg, value); uint8_t actual = value & write_masks[reg]; uint8_t expected = reg_values[reg] & write_masks[reg];
- if (actual != expected) - return FLASHROM_WP_ERR_VERIFY_FAILED; + if (actual != expected) { + msg_cdbg("%s: wp_verify failed: reg:%u actual:0x%x expected:0x%x\n", + __func__, reg, actual, expected); + ret = FLASHROM_WP_ERR_VERIFY_FAILED; + } }
- return FLASHROM_WP_OK; + return ret; }
static decode_range_func_t *lookup_decode_range_func_ptr(const struct flashchip *chip)