summaryrefslogtreecommitdiff
path: root/firmware/lib/ec_sync_all.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/lib/ec_sync_all.c')
-rw-r--r--firmware/lib/ec_sync_all.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/firmware/lib/ec_sync_all.c b/firmware/lib/ec_sync_all.c
index 6c3fe74f..f981a52d 100644
--- a/firmware/lib/ec_sync_all.c
+++ b/firmware/lib/ec_sync_all.c
@@ -44,7 +44,7 @@ VbError_t ec_sync_all(struct vb2_context *ctx)
struct vb2_shared_data *sd = vb2_get_sd(ctx);
VbSharedDataHeader *shared = sd->vbsd;
VbAuxFwUpdateSeverity_t fw_update;
- VbError_t rv;
+ VbError_t rv, update_aux_fw_rv;
rv = ec_sync_check_aux_fw(ctx, &fw_update);
if (rv)
@@ -92,14 +92,19 @@ VbError_t ec_sync_all(struct vb2_context *ctx)
* Aux FW update may request RO reboot to force EC cold reset so also
* unload the option ROM if needed to prevent a second reboot.
*/
- rv = ec_sync_update_aux_fw(ctx);
- if (rv) {
- ec_sync_unload_oprom(ctx, shared, need_wait_screen);
- return rv;
- }
+ update_aux_fw_rv = ec_sync_update_aux_fw(ctx);
- /* Reboot to unload VGA Option ROM if needed */
+ /* Reboot to unload VGA Option ROM for both slow EC & AUX FW updates */
rv = ec_sync_unload_oprom(ctx, shared, need_wait_screen);
+ /* Something went wrong during AUX FW update */
+ if (update_aux_fw_rv)
+ return update_aux_fw_rv;
+ /*
+ * AUX FW Update is applied successfully. Request EC reboot to RO,
+ * so that the chips that had FW update gets reset to a clean state.
+ */
+ if (fw_update > VB_AUX_FW_NO_UPDATE)
+ return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
if (rv)
return rv;