summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/2lib/include/2misc.h')
-rw-r--r--firmware/2lib/include/2misc.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/firmware/2lib/include/2misc.h b/firmware/2lib/include/2misc.h
index 6a61f9e5..b80f6906 100644
--- a/firmware/2lib/include/2misc.h
+++ b/firmware/2lib/include/2misc.h
@@ -188,4 +188,26 @@ vb2_error_t vb2_enable_developer_mode(struct vb2_context *ctx);
*/
int vb2_allow_recovery(struct vb2_context *ctx);
+/**
+ * Clear recovery request appropriately.
+ *
+ * To avoid the recovery request "sticking" and the user being in a permanent
+ * recovery loop, the recovery request must be cleared and committed to nvdata.
+ * Note that this should be done at some point after we are certain the system
+ * does not require any reboots for non-vboot-related reasons (e.g. FSP
+ * initialization), and before triggering a reboot to exit a transient recovery
+ * mode (e.g. memory retraining request).
+ *
+ * In BROKEN cases, the recovery reason will be stowed away as subcode, to be
+ * retrieved after the user reboots in manual recovery. In manual recovery,
+ * subcode will be left alone to keep available for subsequent manual recovery
+ * requests, or for accessing from userspace on the next boot.
+ *
+ * This function modifies nvdata in vb2_context, but the caller is still
+ * expected to call vb2_commit_data.
+ *
+ * @param ctx Vboot context
+ */
+void vb2_clear_recovery(struct vb2_context *ctx);
+
#endif /* VBOOT_REFERENCE_2MISC_H_ */