diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2019-06-12 10:41:59 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-18 02:04:36 +0000 |
commit | a958f5390c29378dd7e6dfc600794ce390145b13 (patch) | |
tree | 2940fba958ea941697a6c63bc7d185d6f3ce91ae | |
parent | a0206634baea037a4958986d72e66231eef8769d (diff) | |
download | vboot-a958f5390c29378dd7e6dfc600794ce390145b13.tar.gz |
EC: Add VbExEcVbootDone
VbExEcVbootDone is called after software sync is done. It's supposed to
check whether Depthcharge should continue to boot or shut down.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b/128455667
BRANCH=strago
TEST=TBD
Change-Id: I325b14d240c17ce74686d86fcbe140fbcfef6b74
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1656775
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | firmware/lib/include/vboot_kernel.h | 13 | ||||
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/firmware/lib/include/vboot_kernel.h b/firmware/lib/include/vboot_kernel.h index 2f1be5be..88e3df7c 100644 --- a/firmware/lib/include/vboot_kernel.h +++ b/firmware/lib/include/vboot_kernel.h @@ -71,4 +71,17 @@ VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p); */ VbError_t VbEcSoftwareSync(int devidx, VbCommonParams *cparams); +/** + * Perform EC post-verification / updating / jumping actions. + * + * This routine is called to perform certain actions that must wait until + * after the EC resides in its `final` image (the image the EC will + * run for the duration of boot). These actions include verifying that + * enough power is available to continue with boot. + * + * @param in_recovery 1 if recovery mode is selected by the AP, 0 otherwise. + * @return VBERROR_... error, VBERROR_SUCCESS on success. + */ +VbError_t VbExEcVbootDone(void); + #endif /* VBOOT_REFERENCE_VBOOT_KERNEL_H_ */ diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 312014bd..8750f670 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -1031,6 +1031,13 @@ VbError_t VbSelectAndLoadKernel(VbCommonParams *cparams, } } + /* If not in recovery mode, check whether EC wants to boot or not */ + if (!shared->recovery_reason) { + retval = VbExEcVbootDone(); + if (retval) + goto VbSelectAndLoadKernel_exit; + } + /* Read kernel version from the TPM. Ignore errors in recovery mode. */ tpm_status = RollbackKernelRead(&shared->kernel_version_tpm); if (0 != tpm_status) { |