From f630a1623f84b452873e3fc69d608925d90fd85b Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Mon, 16 May 2022 15:38:18 +1000 Subject: writeprotect.c: Allow opaque masters to hook {read,write}_register() Allow specialisation in opaque masters, such as ichspi hwseq, to write to status registers. Also update the dispatch logic in libflashrom to call wp code when status register access functions are provided by an opaque master. BUG=none BRANCH=none TEST=flashrom --wp-status on AMD and Intel DUTs Change-Id: I3ab0d7f5f48338c8ecb118a69651c203fbc516ac Signed-off-by: Edward O'Callaghan Signed-off-by: Nikolai Artemiev Co-Authored-by: Nikolai Artemiev Reviewed-on: https://review.coreboot.org/c/flashrom/+/64375 Reviewed-by: Anastasia Klimchuk Tested-by: build bot (Jenkins) --- include/writeprotect.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/writeprotect.h') diff --git a/include/writeprotect.h b/include/writeprotect.h index e27403dc..12926c4d 100644 --- a/include/writeprotect.h +++ b/include/writeprotect.h @@ -86,4 +86,7 @@ enum flashrom_wp_result wp_read_cfg(struct flashrom_wp_cfg *, struct flashrom_fl /* Get a list of protection ranges supported by the chip */ enum flashrom_wp_result wp_get_available_ranges(struct flashrom_wp_ranges **, struct flashrom_flashctx *); +/* Checks if writeprotect functions can be used with the current flash/programmer */ +bool wp_operations_available(struct flashrom_flashctx *); + #endif /* !__WRITEPROTECT_H__ */ -- cgit v1.2.3