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 00:05:36 +0000
commit32658d5cccafc62e5638c208d5b49dcbaa474c20 (patch)
tree01b1d3f03acdf52b3e3bba01c0fc90043d598e83
parent38ecaa7dc54359f9bf4215c9adfb227bf7dece22 (diff)
downloadvboot-firmware-trogdor-13577.B.tar.gz
2lib/2auxfw_sync: Handle VB2_REQUEST* error codesfirmware-trogdor-13577.B
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/+/3347669 Reviewed-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org> Tested-by: Julius Werner <jwerner@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