From 7be01fd4519b4a0a764052832e8831d8ed406e43 Mon Sep 17 00:00:00 2001 From: Nikolai Artemiev Date: Wed, 2 Nov 2022 12:11:02 +1100 Subject: tests: ensure chip erase operation is executed The `full_chip_erase_with_wp_dummyflasher_test_success` test case checks that erasing a write-protected region of a dummyflasher chip fails. However erase optimization may cause the erase operation to be skipped if the flash contents are already erased, so the erase operation appears to succeed and the test case fails. Writing a non-erased value to the chip ensures that an erase operation will be executed and write protection will be properly tested. BUG=b:237620197 BRANCH=none TEST=ninja test Change-Id: Ia00444dcd2ad96c64832a13201efbd064cd7302d Signed-off-by: Nikolai Artemiev Reviewed-on: https://review.coreboot.org/c/flashrom/+/69130 Tested-by: build bot (Jenkins) Reviewed-by: Anastasia Klimchuk Reviewed-by: Edward O'Callaghan Reviewed-by: Angel Pons --- include/flash.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/flash.h') diff --git a/include/flash.h b/include/flash.h index 238d0101..ea8e25b8 100644 --- a/include/flash.h +++ b/include/flash.h @@ -156,6 +156,7 @@ enum write_granularity { #define FEATURE_WRSR3 (1 << 23) #define ERASED_VALUE(flash) (((flash)->chip->feature_bits & FEATURE_ERASED_ZERO) ? 0x00 : 0xff) +#define UNERASED_VALUE(flash) (((flash)->chip->feature_bits & FEATURE_ERASED_ZERO) ? 0xff : 0x00) enum test_state { OK = 0, -- cgit v1.2.3