Derek Huang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/77631?usp=email )
Change subject: vc/google/chromeos: Move clear_ec_ap_idle() to common code ......................................................................
vc/google/chromeos: Move clear_ec_ap_idle() to common code
TEST=emerge-brask coreboot Change-Id: I2dbe41b01e70f7259f75d967e6df694a3e0fac23 Signed-off-by: Derek Huang derekhuang@google.com --- M src/vendorcode/google/chromeos/Makefile.inc M src/vendorcode/google/chromeos/chromeos.h A src/vendorcode/google/chromeos/clear_ec_ap_idle.c M src/vendorcode/google/chromeos/cr50_enable_update.c 4 files changed, 21 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/77631/1
diff --git a/src/vendorcode/google/chromeos/Makefile.inc b/src/vendorcode/google/chromeos/Makefile.inc index fbfd7a4..dbe7545 100644 --- a/src/vendorcode/google/chromeos/Makefile.inc +++ b/src/vendorcode/google/chromeos/Makefile.inc @@ -13,6 +13,8 @@ romstage-$(CONFIG_CHROMEOS_CSE_BOARD_RESET_OVERRIDE) += cse_board_reset.c ramstage-$(CONFIG_CHROMEOS_CSE_BOARD_RESET_OVERRIDE) += cse_board_reset.c
+ramstage-$(CONFIG_CR50_RESET_CLEAR_EC_AP_IDLE_FLAG) += clear_ec_ap_idle.c + bootblock-y += watchdog.c verstage-y += watchdog.c romstage-y += watchdog.c diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index cab855d..30a9d91 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -32,6 +32,8 @@ */ void chromeos_acpi_gpio_generate(void);
+void clear_ec_ap_idle(void); + enum { CROS_GPIO_REC = 1, /* Recovery */ CROS_GPIO_DEPRECATED_DEV = 2, /* Developer; diff --git a/src/vendorcode/google/chromeos/clear_ec_ap_idle.c b/src/vendorcode/google/chromeos/clear_ec_ap_idle.c new file mode 100644 index 0000000..697ad23 --- /dev/null +++ b/src/vendorcode/google/chromeos/clear_ec_ap_idle.c @@ -0,0 +1,17 @@ +#include <console/console.h> +#include <ec/google/chromeec/ec.h> +#include "chromeos.h" + +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"); +} + diff --git a/src/vendorcode/google/chromeos/cr50_enable_update.c b/src/vendorcode/google/chromeos/cr50_enable_update.c index 19f2006..b6afdaa9 100644 --- a/src/vendorcode/google/chromeos/cr50_enable_update.c +++ b/src/vendorcode/google/chromeos/cr50_enable_update.c @@ -3,7 +3,6 @@ #include <bootstate.h> #include <commonlib/console/post_codes.h> #include <console/console.h> -#include <ec/google/chromeec/ec.h> #include <elog.h> #include <halt.h> #include <security/tpm/tss.h> @@ -68,19 +67,6 @@ 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;