summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@google.com>2021-12-15 22:40:40 -0700
committerCommit Bot <commit-bot@chromium.org>2021-12-21 08:02:06 +0000
commit3d647464a4e5fcd29779beb39b82251ee27dab08 (patch)
tree39b03f483d84e8f0eae6b9562b3618be7cf12a4d
parentd0bcac282af65c1e4f554c008d1c95bf76983599 (diff)
downloadvboot-3d647464a4e5fcd29779beb39b82251ee27dab08.tar.gz
2lib/2auxfw_sync: Handle VB2_REQUEST* error codes
NOTE: Asurada uses the ITE on-chip TCPC, where no update is needed, so this issue didn't have practical impact on Asurada devices. Still, it's better to cherry-pick the fix. In normal/secure mode, display is not always available. Hence aux firmware updates request reboot to initialize the display so that slow firmware update screen can be displayed. Since this error is not handled, the concerned firmware slot is marked as failed. This leads to devices in the field not picking FW updates and falling back to old FW slot. Handle VB2_REQUEST* error codes, so that the device reboots to initialize the display. BUG=b:210127173 BRANCH=dedede, volteer, zork, trogdor, keeby TEST=Build and boot to OS in Drawlat. Ensure that the AP + EC + ME + PD FW updates are applied and the system was able to boot to OS successfully - https://paste.googleplex.com/4966135716904960. Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Change-Id: I2b7bdd830a1141ee59e25204bf4f77adba58b679 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3351408 Tested-by: Yu-Ping Wu <yupingso@chromium.org> Auto-Submit: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org>
-rw-r--r--firmware/2lib/2auxfw_sync.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/firmware/2lib/2auxfw_sync.c b/firmware/2lib/2auxfw_sync.c
index da7bc979..eaea1d46 100644
--- a/firmware/2lib/2auxfw_sync.c
+++ b/firmware/2lib/2auxfw_sync.c
@@ -28,40 +28,6 @@ static int auxfw_sync_allowed(struct vb2_context *ctx)
}
/**
- * Update the specified auxfw and verify the update succeeded.
- *
- * @param ctx Vboot2 context
- * @return VB2_SUCCESS, or non-zero error code.
- */
-static vb2_error_t update_auxfw(struct vb2_context *ctx)
-{
- vb2_error_t rv;
-
- VB2_DEBUG("Updating auxfw\n");
-
- /*
- * The underlying platform is expected to know how and where to find the
- * firmware image for all auxfw devices.
- */
- rv = vb2ex_auxfw_update();
- if (rv != VB2_SUCCESS) {
- VB2_DEBUG("vb2ex_auxfw_update() returned %d\n", rv);
-
- /*
- * The device may need a reboot. It may need to unprotect the
- * region before updating, or may need to reboot after updating.
- * Either way, it's not an error requiring recovery mode.
- *
- * If we fail for any other reason, trigger recovery mode.
- */
- if (rv != VB2_REQUEST_REBOOT_EC_TO_RO)
- vb2api_fail(ctx, VB2_RECOVERY_AUXFW_UPDATE, rv);
- }
-
- return rv;
-}
-
-/**
* Decides if auxfw sync is allowed to be performed.
*
* If sync is allowed, invokes the external callback,
@@ -90,7 +56,8 @@ vb2_error_t vb2api_auxfw_sync(struct vb2_context *ctx)
VB2_TRY(auxfw_sync_check_update(ctx, &fw_update));
if (fw_update > VB2_AUXFW_NO_UPDATE) {
- VB2_TRY(update_auxfw(ctx));
+ VB2_DEBUG("Updating auxfw\n");
+ VB2_TRY(vb2ex_auxfw_update(), ctx, VB2_RECOVERY_AUXFW_UPDATE);
/*
* auxfw update is applied successfully. Request EC reboot to
* RO, so that the chips that had FW update get reset to a