diff options
author | Karthikeyan Ramasubramanian <kramasub@google.com> | 2021-12-15 22:40:40 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-12-23 09:22:13 +0000 |
commit | 92b3d13933cd3e06f6802e94345ed1bef9e55b8c (patch) | |
tree | e913d831b40e8f1abf7e4df8ba12c80eeb422870 | |
parent | b83cf2cd34ee3430fa9b5cebc111c43fca811cc1 (diff) | |
download | vboot-92b3d13933cd3e06f6802e94345ed1bef9e55b8c.tar.gz |
2lib/2auxfw_sync: Handle VB2_REQUEST* error codes
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/+/3344277
Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Commit-Queue: Bob Moragues <moragues@chromium.org>
-rw-r--r-- | firmware/2lib/2auxfw_sync.c | 37 |
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 |