summaryrefslogtreecommitdiff
path: root/include/nvmem.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/nvmem.h')
-rw-r--r--include/nvmem.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/nvmem.h b/include/nvmem.h
index 781ea219f0..354e763c8d 100644
--- a/include/nvmem.h
+++ b/include/nvmem.h
@@ -51,9 +51,10 @@
* CONFIG_FLASH_NVMEM_BASE_(A|B) -> address of start of each partition
*
* The board.h file must define a macro or enum named NVMEM_NUM_USERS.
- * The board.c file must include 1 function and an array of user buffer lengths
+ * The board.c file must implement:
* nvmem_user_sizes[] -> array of user buffer lengths
* nvmem_compute_sha() -> function used to compute 4 byte sha (or equivalent)
+ * nvmem_wipe() -> function to erase and reformat the users' storage
*
* Note that total length of user buffers must satisfy the following:
* sum(user sizes) <= (NVMEM_PARTITION_SIZE) - sizeof(struct nvmem_tag)
@@ -176,4 +177,11 @@ int nvmem_setup(uint8_t version);
void nvmem_compute_sha(uint8_t *p_buf, int num_bytes, uint8_t *p_sha,
int sha_len);
+/*
+ * Erase and reformat the entire nvmem storage space. This returns only if it
+ * was successful. If it fails, we can't be certain of the state of the system,
+ * so it should do a hard reboot to be safe.
+ */
+void nvmem_wipe_or_reboot(void);
+
#endif /* __CROS_EC_NVMEM_UTILS_H */