diff --git a/firmware/lib/ec_sync_all.c b/firmware/lib/ec_sync_all.c index 7e6cbf34..f09b708f 100644 --- a/firmware/lib/ec_sync_all.c +++ b/firmware/lib/ec_sync_all.c @@ -78,14 +78,18 @@ VbError_t ec_sync_all(struct vb2_context *ctx) display_wait_screen(ctx, "AUX FW"); } - /* - * Do Aux FW software sync and protect devices tunneled through the EC. - * Aux FW update may request RO reboot to force EC cold reset so also - * disable display request if needed to prevent a second reboot. - */ - rv = ec_sync_update_aux_fw(ctx); - if (rv) - return rv; + if (fw_update > VB_AUX_FW_NO_UPDATE) { + /* Do Aux FW software sync */ + rv = ec_sync_update_aux_fw(ctx); + if (rv) + return 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. + */ + return VBERROR_EC_REBOOT_TO_RO_REQUIRED; + } /* Phase 3; Completes sync and handles battery cutoff */ rv = ec_sync_phase3(ctx); diff --git a/tests/ec_sync_tests.c b/tests/ec_sync_tests.c index 1698e032..44efb7de 100644 --- a/tests/ec_sync_tests.c +++ b/tests/ec_sync_tests.c @@ -469,12 +469,12 @@ static void VbSoftwareSyncTest(void) ResetMocks(); ec_aux_fw_mock_severity = VB_AUX_FW_FAST_UPDATE; - test_ssync(VBERROR_SUCCESS, 0, + test_ssync(VBERROR_EC_REBOOT_TO_RO_REQUIRED, 0, "Fast auxiliary FW update needed"); TEST_EQ(screens_count, 0, " wait screen skipped"); TEST_EQ(ec_aux_fw_update_req, 1, " aux fw update requested"); - TEST_EQ(ec_aux_fw_protected, 1, " aux fw protected"); + TEST_EQ(ec_aux_fw_protected, 0, " aux fw protected"); ResetMocks(); ec_aux_fw_mock_severity = VB_AUX_FW_SLOW_UPDATE; @@ -484,14 +484,15 @@ static void VbSoftwareSyncTest(void) ResetMocks(); ec_aux_fw_mock_severity = VB_AUX_FW_SLOW_UPDATE; - test_ssync(VBERROR_SUCCESS, 0, + test_ssync(VBERROR_EC_REBOOT_TO_RO_REQUIRED, 0, "Slow auxiliary FW update needed"); TEST_EQ(ec_aux_fw_update_req, 1, " aux fw update requested"); - TEST_EQ(ec_aux_fw_protected, 1, " aux fw protected"); + TEST_EQ(ec_aux_fw_protected, 0, " aux fw protected"); TEST_EQ(screens_displayed[0], VB_SCREEN_WAIT, " wait screen forced"); ResetMocks(); + ec_aux_fw_mock_severity = VB_AUX_FW_FAST_UPDATE; ec_aux_fw_retval = VBERROR_UNKNOWN; test_ssync(VBERROR_UNKNOWN, VB2_RECOVERY_AUX_FW_UPDATE, "Error updating AUX firmware");