aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/google
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendorcode/google')
-rw-r--r--src/vendorcode/google/chromeos/Kconfig6
-rw-r--r--src/vendorcode/google/chromeos/watchdog.c17
2 files changed, 18 insertions, 5 deletions
diff --git a/src/vendorcode/google/chromeos/Kconfig b/src/vendorcode/google/chromeos/Kconfig
index 26ee31edc7..2ff7ec70b8 100644
--- a/src/vendorcode/google/chromeos/Kconfig
+++ b/src/vendorcode/google/chromeos/Kconfig
@@ -89,5 +89,11 @@ config CHROMEOS_DISABLE_PLATFORM_HIERARCHY_ON_RESUME
on normal boot as well as resume and coreboot is only involved
in the resume piece w.r.t. the platform hierarchy.
+config CHROMEOS_USE_EC_WATCHDOG_FLAG
+ bool
+ default n
+ help
+ Use the AP watchdog flag stored in EC.
+
endif # CHROMEOS
endmenu
diff --git a/src/vendorcode/google/chromeos/watchdog.c b/src/vendorcode/google/chromeos/watchdog.c
index 4557251ef6..2b2959f016 100644
--- a/src/vendorcode/google/chromeos/watchdog.c
+++ b/src/vendorcode/google/chromeos/watchdog.c
@@ -17,6 +17,7 @@
#include <assert.h>
#include <bootstate.h>
#include <console/console.h>
+#include <ec/google/chromeec/ec.h>
#include <elog.h>
#include <reset.h>
#include <symbols.h>
@@ -30,13 +31,19 @@ DECLARE_OPTIONAL_REGION(watchdog_tombstone);
static void elog_handle_watchdog_tombstone(void *unused)
{
- if (!REGION_SIZE(watchdog_tombstone))
- return;
+ bool flag = false;
- if (read32(_watchdog_tombstone) == WATCHDOG_TOMBSTONE_MAGIC)
- elog_add_event(ELOG_TYPE_ASYNC_HW_TIMER_EXPIRED);
+ if (CONFIG(CHROMEOS_USE_EC_WATCHDOG_FLAG))
+ flag |= google_chromeec_get_ap_watchdog_flag();
+
+ if (REGION_SIZE(watchdog_tombstone)) {
+ flag |= (read32(_watchdog_tombstone) ==
+ WATCHDOG_TOMBSTONE_MAGIC);
+ write32(_watchdog_tombstone, 0);
+ }
- write32(_watchdog_tombstone, 0);
+ if (flag)
+ elog_add_event(ELOG_TYPE_ASYNC_HW_TIMER_EXPIRED);
}
BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY,