Marc Jones (marc.jones@se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8163
-gerrit
commit 1a7c27d7048d6fc0941a8df228e1c38d6debbe3a Author: Kevin Cheng kevin.cheng@intel.com Date: Mon Jun 30 17:51:48 2014 -0700
vboot_wrapper: handling VBERROR_TPM_REBOOT_REQUIRED from VbInit().
Doing reset while VBERROR_TPM_REBOOT_REQUIRED occured.
BUG=chromium:389568 TEST=Manual force VBERROR_TPM_REBOOT_REQUIRED returned from VbInit() and system will reboot.
Original-Change-Id: I9d7c4b3a380a931a728f792b4013b3b9bf65dfae Original-Signed-off-by: Kevin Cheng kevin.cheng@intel.com Original-Reviewed-on: https://chromium-review.googlesource.com/206337 Original-Reviewed-by: Randall Spangler rspangler@chromium.org (cherry picked from commit 32728dd9fc43a95d6f763a85f9cc7a660a66b175) Original-Reviewed-on: https://chromium-review.googlesource.com/206948 Original-Reviewed-by: Shawn Nematbakhsh shawnn@chromium.org (cherry picked from commit 1ea5e233386d236ce20f3d1695fac3a1bc49d4bd) Signed-off-by: Marc Jones marc.jones@se-eng.com
Change-Id: Ib93fdf7b22918f563d3e29207a75fc831bee186a --- src/vendorcode/google/chromeos/vboot_context.h | 1 + src/vendorcode/google/chromeos/vboot_loader.c | 6 ++++++ src/vendorcode/google/chromeos/vboot_wrapper.c | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/vendorcode/google/chromeos/vboot_context.h b/src/vendorcode/google/chromeos/vboot_context.h index 822fed4..cd82aac 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 80e2aea..daf5260 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 5aa0066..dd6065c 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);