From c6f4738f9883750213e54e34fdcc3ece2bd59c7f Mon Sep 17 00:00:00 2001 From: Derek Huang Date: Fri, 1 Sep 2023 04:17:11 +0000 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77631 Reviewed-by: Eric Lai Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Reka Norman --- src/vendorcode/google/chromeos/cr50_enable_update.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/vendorcode/google') diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c index 9fd8d99c7c..551c56a915 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(); -- cgit v1.2.3