writeprotect: Hook wp functions into the chip driver
Change-Id: I17a06210ec329aba337cf459d581463827182108
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72532
diff --git a/include/flash.h b/include/flash.h
index 561a597..340af59 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -323,6 +323,12 @@
struct reg_bit_info wps;
} reg_bits;
+ /* Write WP configuration to the chip */
+ enum flashprog_wp_result (*wp_write_cfg)(struct flashctx *, const struct flashprog_wp_cfg *);
+ /* Read WP configuration from the chip */
+ enum flashprog_wp_result (*wp_read_cfg)(struct flashprog_wp_cfg *, struct flashctx *);
+ /* Get a list of protection ranges supported by the chip */
+ enum flashprog_wp_result (*wp_get_ranges)(struct flashprog_wp_ranges **, struct flashctx *);
/* Function that takes a set of WP config bits (e.g. BP, SEC, TB, etc) */
/* and determines what protection range they select. */
void (*decode_range)(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len);