summaryrefslogtreecommitdiff
path: root/src/ec
diff options
context:
space:
mode:
authorDerek Huang <derekhuang@google.com>2023-09-01 04:17:11 +0000
committerEric Lai <eric_lai@quanta.corp-partner.google.com>2023-09-14 01:53:22 +0000
commitc6f4738f9883750213e54e34fdcc3ece2bd59c7f (patch)
tree983111674e02a37a67d518a86489a9cf9b716127 /src/ec
parent5ccc5271acf6a282fea5e2ee1e6f3013e38bd387 (diff)
vc/google/chromeos: Move clear_ec_ap_idle() to common code
Previously the clear_ec_ap_idle() is implemented in cr50_enable_update.c and be called in the file. Move it to common code so that it can be called in cse_board_reset.c TEST=emerge-brask coreboot Change-Id: I2dbe41b01e70f7259f75d967e6df694a3e0fac23 Signed-off-by: Derek Huang <derekhuang@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77631 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Reka Norman <rekanorman@chromium.org>
Diffstat (limited to 'src/ec')
-rw-r--r--src/ec/google/chromeec/ec.c10
-rw-r--r--src/ec/google/chromeec/ec.h5
2 files changed, 15 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index c950673c65..9a1d08358e 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -1522,3 +1522,13 @@ int google_chromeec_regulator_get_voltage(uint32_t index, uint32_t *voltage_mv)
*voltage_mv = resp.voltage_mv;
return 0;
}
+
+void google_chromeec_clear_ec_ap_idle(void)
+{
+ /* 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\n");
+ else
+ printk(BIOS_ERR, "Failed to clear EC AP_IDLE flag\n");
+}
diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h
index 61b23cf3ba..f6a2e60ff4 100644
--- a/src/ec/google/chromeec/ec.h
+++ b/src/ec/google/chromeec/ec.h
@@ -411,6 +411,11 @@ int google_chromeec_regulator_set_voltage(uint32_t index, uint32_t min_mv,
*/
int google_chromeec_regulator_get_voltage(uint32_t index, uint32_t *voltage_mv);
+/**
+ * Clear EC AP_IDLE flag
+ */
+void google_chromeec_clear_ec_ap_idle(void);
+
#if CONFIG(HAVE_ACPI_TABLES)
/**
* Writes USB Type-C PD related information to the SSDT