writeprotect.c: refuse to work with chip if OTP WPS == 1
Perform the check right in read_wp_bits() as it's used by various WP
operations and also because its results won't make sense if WPS bit is
on and can't be changed.
Change-Id: I143186066a1d3af89809b7135886cb8b0d038085
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/66836
Original-Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Original-Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71005
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/libflashrom.h b/libflashrom.h
index 2570362..0c007e6 100644
--- a/libflashrom.h
+++ b/libflashrom.h
@@ -129,7 +129,8 @@
FLASHROM_WP_ERR_VERIFY_FAILED = 5,
FLASHROM_WP_ERR_RANGE_UNSUPPORTED = 6,
FLASHROM_WP_ERR_MODE_UNSUPPORTED = 7,
- FLASHROM_WP_ERR_RANGE_LIST_UNAVAILABLE = 8
+ FLASHROM_WP_ERR_RANGE_LIST_UNAVAILABLE = 8,
+ FLASHROM_WP_ERR_UNSUPPORTED_STATE = 9,
};
enum flashrom_wp_mode {