summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ec/google/chromeec/ec.c10
-rw-r--r--src/ec/google/chromeec/ec.h5
-rw-r--r--src/security/tpm/tss/vendor/cr50/Kconfig3
-rw-r--r--src/vendorcode/google/chromeos/cr50_enable_update.c16
4 files changed, 19 insertions, 15 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index c950673c6538..9a1d08358e14 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 61b23cf3babd..f6a2e60ff440 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
diff --git a/src/security/tpm/tss/vendor/cr50/Kconfig b/src/security/tpm/tss/vendor/cr50/Kconfig
index 6aa1b10550b7..7e6d2204e414 100644
--- a/src/security/tpm/tss/vendor/cr50/Kconfig
+++ b/src/security/tpm/tss/vendor/cr50/Kconfig
@@ -41,7 +41,8 @@ config GOOGLE_TPM_IRQ_TIMEOUT_MS
750ms otherwise.
config CR50_RESET_CLEAR_EC_AP_IDLE_FLAG
- def_bool n
+ bool
+ default y if !SYSTEM_TYPE_LAPTOP
help
Select this if the variant is a Chromebox/base. This allows AP to direct EC
to clear AP_IDLE flag after AP shutdown before triggering CR50 reset and
diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c
index 9fd8d99c7c49..551c56a9154a 100644
--- a/src/vendorcode/google/chromeos/cr50_enable_update.c
+++ b/src/vendorcode/google/chromeos/cr50_enable_update.c
@@ -68,19 +68,6 @@ 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;
@@ -170,7 +157,8 @@ static void enable_update(void *unused)
}
if (CONFIG(POWER_OFF_ON_CR50_UPDATE)) {
- clear_ec_ap_idle();
+ if (CONFIG(CR50_RESET_CLEAR_EC_AP_IDLE_FLAG))
+ google_chromeec_clear_ec_ap_idle();
poweroff();
}
halt();