summaryrefslogtreecommitdiff
path: root/src/vendorcode
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendorcode')
-rw-r--r--src/vendorcode/google/chromeos/cr50_enable_update.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c
index 6beea913ca..19f200605e 100644
--- a/src/vendorcode/google/chromeos/cr50_enable_update.c
+++ b/src/vendorcode/google/chromeos/cr50_enable_update.c
@@ -68,6 +68,19 @@ static int cr50_is_reset_needed(void)
return 0;
}
+static void clear_ec_ap_idle(void)
+{
+ if (!CONFIG(CR50_RESET_CLEAR_EC_AP_IDLE_FLAG))
+ return;
+
+ /* Send EC command to clear AP_IDLE flag */
+ if (!google_chromeec_reboot(EC_REBOOT_NO_OP, EC_REBOOT_FLAG_CLEAR_AP_IDLE |
+ EC_REBOOT_FLAG_ON_AP_SHUTDOWN))
+ printk(BIOS_INFO, "Successfully clear AP_IDLE flag");
+ else
+ printk(BIOS_ERR, "Failed to clear EC AP_IDLE flag");
+}
+
static void enable_update(void *unused)
{
int ret;
@@ -156,8 +169,10 @@ static void enable_update(void *unused)
}
}
- if (CONFIG(POWER_OFF_ON_CR50_UPDATE))
+ if (CONFIG(POWER_OFF_ON_CR50_UPDATE)) {
+ clear_ec_ap_idle();
poweroff();
+ }
halt();
}
BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_ENTRY, enable_update, NULL);