summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsuan Ting Chen <roccochen@chromium.org>2021-11-11 08:06:47 +0000
committerCommit Bot <commit-bot@chromium.org>2021-12-10 07:59:50 +0000
commit2b3c2a958476d59ae547924238bba0190adf9d0b (patch)
treea4899bea4cc3b72a6de209bd241cfeb4d1a50865
parentca64d646cedcdf664015e070e3a2f0c475f449c3 (diff)
downloadvboot-2b3c2a958476d59ae547924238bba0190adf9d0b.tar.gz
Reland "2lib: Use ctx flag VB2_CONTEXT_EC_TRUSTED instead of vb2ex_ec_trusted"
This reverts commit 1269365169791c65a6bf6f364583209195874138. Reason for revert: We can try another reland after the coreboot CL https://review.coreboot.org/c/coreboot/+/58253 is downstreamed and the guybrush psp_verstage.bin is signed again. Original change's description: > Revert "2lib: Use ctx flag VB2_CONTEXT_EC_TRUSTED instead of vb2ex_ec_trusted" > > This reverts commit 8aded7005e2830f54cf53b329946cbb1f11548f2. > > Reason for revert: b:202258389 > > Original change's description: > > 2lib: Use ctx flag VB2_CONTEXT_EC_TRUSTED instead of vb2ex_ec_trusted > > > > In vb2api_allow_recovery(), we need to check if EC is trusted for > > booting into manual recovery mode. This was implemented by a function > > vb2ex_ec_trusted() which defined in vboot_reference and implemented in > > depthcharge by reading the corresponding EC_IN_RW GPIO flags. > > > > By introducing new boot mode architecture, coreboot will now calling > > these functions to determine the current boot mode and support the > > similar functionalities about checking if EC is trusted (i.e. EC is not > > in RW). > > > > We leverages the existing ctx flag VB2_CONTEXT_EC_TRUSTED for fulfilling > > this. This flag will be set at coreboot vboot_logic.c:verstage_main() > > and can be used deciding the boot mode in vboot_reference: > > vb2api_fw_phase1() and is cleared while EC jumps to RW (i.e. > > 2ec_sync.c:sync_ec()). > > > > BRANCH=none > > BUG=b:181931817 > > TEST=emerge-trogdor coreboot vboot_reference depthcharge > > > > Cq-Depend: chromium:3088889 > > Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> > > Change-Id: I50f35f48ce75e421094ea21e45c24b82e6e55a6c > > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3106329 > > Reviewed-by: Julius Werner <jwerner@chromium.org> > > Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> > > Bug: b:181931817 > Change-Id: I11ae3b2d71c040dfe45b34f74974845dafa92b42 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3211007 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Bhanu Prakash Maiya <bhanumaiya@google.com> Bug: b:181931817 Cq-Depend: chromium:3284392 Change-Id: Ie7d87b6608631b03f31651eacf9b40f8f891da1a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3274604 Tested-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Hsuan Ting Chen <roccochen@chromium.org>
-rw-r--r--firmware/2lib/2misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/2lib/2misc.c b/firmware/2lib/2misc.c
index 4896694b..b1696365 100644
--- a/firmware/2lib/2misc.c
+++ b/firmware/2lib/2misc.c
@@ -432,7 +432,7 @@ int vb2api_allow_recovery(struct vb2_context *ctx)
* return false (=RW). That's ok because if recovery is manual, we will
* get the right signal and that's the case we care about.
*/
- if (!(ctx->flags & VB2_CONTEXT_EC_TRUSTED) && !vb2ex_ec_trusted())
+ if (!(ctx->flags & VB2_CONTEXT_EC_TRUSTED))
return 0;
/* Now we confidently check the recovery switch state at boot */