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 02:21:02 +0000
commitf26315889290c1161617520032a3af04cc377223 (patch)
treefca5744ba6e5e96e88d2b402590568c564f56f8c
parent033513a93a95192c5b28d517dc0898db4a7d0bcb (diff)
downloadvboot-firmware-dedede-13606.516.B.tar.gz
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/+/3350763 Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Auto-Submit: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Henry Sun <henrysun@google.com> Commit-Queue: Henry Sun <henrysun@google.com>
-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