summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2api.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/2lib/include/2api.h')
-rw-r--r--firmware/2lib/include/2api.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 643bc986..dd8af7b3 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -404,6 +404,26 @@ vb2_error_t vb2api_secdata_fwmp_check(struct vb2_context *ctx, uint8_t *size);
void vb2api_fail(struct vb2_context *ctx, uint8_t reason, uint8_t subcode);
/**
+ * Report firmware failure from previous boot to vboot.
+ *
+ * This function can only be called before vb2api_fw_phase1 (nvdata is
+ * initialized). Otherwise an assert is raised. This function is required to be
+ * called in the following environment:
+ * - Context has to be initialized using vb2api_init
+ * - NV data has to be read into context
+ * - Secdata may or may not have been read
+ * - vb2api_fw_phase1 must not have been called.
+ *
+ * If the other slot is not known bad then try the other firmware slot.
+ * If both the slots are known bad, then request recovery.
+ *
+ * @param reason Recovery reason
+ * @param subcode Recovery subcode
+ */
+void vb2api_previous_boot_fail(struct vb2_context *ctx,
+ uint8_t reason, uint8_t subcode);
+
+/**
* Entry point for setting up a context that can only load and verify a kernel.
*
* The only allowed usage is to call vb2api_init, then this entry point,