summaryrefslogtreecommitdiff
path: root/host/lib/include/flashrom.h
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/include/flashrom.h')
-rw-r--r--host/lib/include/flashrom.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/host/lib/include/flashrom.h b/host/lib/include/flashrom.h
index 0c1b3716..5fb7a03c 100644
--- a/host/lib/include/flashrom.h
+++ b/host/lib/include/flashrom.h
@@ -71,18 +71,20 @@ int flashrom_write_image(const struct firmware_image *image,
const struct firmware_image *diff_image,
int do_verify, int verbosity);
-enum wp_state {
- WP_ERROR = -1,
- WP_DISABLED = 0,
- WP_ENABLED,
-};
-
/**
* Get wp state using flashrom.
*
* @param programmer The name of the programmer to use for reading the
* writeprotect state.
+ * @param wp_mode Pointer to a bool to store the WP mode. Will be set to
+ * false if WP is disabled, true if WP is enabled.
+ * NULL can be passed if not needed.
+ * @param wp_start Pointer to a uint32_t to store the WP start addr.
+ * NULL can be passed if not needed.
+ * @param wp_len Pointer to a uint32_t to store the WP region length.
+ * NULL can be passed if not needed.
*
- * @return WP_DISABLED, WP_ENABLED, ot a relevant error.
+ * @return 0 on success, or a relevant error.
*/
-enum wp_state flashrom_get_wp(const char *programmer, int verbosity);
+int flashrom_get_wp(const char *programmer, bool *wp_mode,
+ uint32_t *wp_start, uint32_t *wp_len, int verbosity);