summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vendorcode/google/chromeos/vboot_context.h1
-rw-r--r--src/vendorcode/google/chromeos/vboot_loader.c6
-rw-r--r--src/vendorcode/google/chromeos/vboot_wrapper.c7
3 files changed, 13 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/vboot_context.h b/src/vendorcode/google/chromeos/vboot_context.h
index 822fed4d2e..cd82aacf0a 100644
--- a/src/vendorcode/google/chromeos/vboot_context.h
+++ b/src/vendorcode/google/chromeos/vboot_context.h
@@ -57,6 +57,7 @@ struct vboot_context {
void (*log_msg)(const char *fmt, va_list args);
void (*fatal_error)(void);
void *(*get_region)(uintptr_t offset_addr, size_t size, void *dest);
+ void (*reset)(void);
};
#endif /* VBOOT_CONTEXT_H */
diff --git a/src/vendorcode/google/chromeos/vboot_loader.c b/src/vendorcode/google/chromeos/vboot_loader.c
index 80e2aea1bb..daf5260d44 100644
--- a/src/vendorcode/google/chromeos/vboot_loader.c
+++ b/src/vendorcode/google/chromeos/vboot_loader.c
@@ -229,6 +229,11 @@ static void vboot_clean_up(struct vboot_context *context)
cbmem_entry_remove(context->vblocks);
}
+static void reset(void)
+{
+ hard_reset();
+}
+
static void vboot_invoke_wrapper(struct vboot_handoff *vboot_handoff)
{
VbCommonParams cparams;
@@ -298,6 +303,7 @@ static void vboot_invoke_wrapper(struct vboot_handoff *vboot_handoff)
context.log_msg = &log_msg;
context.fatal_error = &fatal_error;
context.get_region = &vboot_get_region;
+ context.reset = &reset;
vboot_run_stub(&context);
diff --git a/src/vendorcode/google/chromeos/vboot_wrapper.c b/src/vendorcode/google/chromeos/vboot_wrapper.c
index 5aa0066944..dd6065cb81 100644
--- a/src/vendorcode/google/chromeos/vboot_wrapper.c
+++ b/src/vendorcode/google/chromeos/vboot_wrapper.c
@@ -43,8 +43,13 @@ static void vboot_wrapper(void *arg)
res = VbInit(context->cparams, &context->handoff->init_params);
VbExDebug("VbInit() returned 0x%08x\n", res);
- if (res != VBERROR_SUCCESS)
+ if (res != VBERROR_SUCCESS) {
+ if(res == VBERROR_TPM_REBOOT_REQUIRED) {
+ VbExDebug("TPM Reboot Required. Proceeding reboot.\n");
+ gcontext->reset();
+ }
return;
+ }
VbExDebug("Calling VbSelectFirmware()\n");
res = VbSelectFirmware(context->cparams, context->fparams);