summaryrefslogtreecommitdiff
path: root/src/vendorcode
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-03-23 16:08:11 -0700
committerPatrick Georgi <pgeorgi@google.com>2016-04-05 13:35:09 +0200
commitc71359413dfbf7940603f23f1f52a790d50e75dc (patch)
tree873dba6fdb0f793579f77d30c6950c3b167caaf5 /src/vendorcode
parent7b9bca0b2b1830262daffd16f285e868d241391b (diff)
downloadcoreboot-c71359413dfbf7940603f23f1f52a790d50e75dc.tar.xz
google/oak: Log hardware watchdog in eventlog
The MT8173 hardware watchdog can assert an external signal which we use to reset the TPM on Oak. Therefore we do not need to do the same double-reset dance as on other Chromebooks to ensure that we reset in a correct state. Still, we have a situation where we need to reconfigure the watchdog early in the bootblock in a way that will clear information about the previous reboot from the status register, and we need that information later in ramstage to log the right event. Let's reuse the same watchdog tombstone mechanism from other boards, except that we don't perform a second reset and the tombstone is simply used to communicate between bootblock and ramstage within the same boot. BRANCH=None BUG=None TEST=Run 'mem w 0x10007004 0x8' on Oak, observe how it reboots and how 'mosys eventlog list' shows a hardware watchdog reboot event afterwards. Change-Id: I1ade018eba652af91814fdaec233b9920f2df01f Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 07af37e11499e86e730f7581862e8f0d67a04218 Original-Change-Id: I0b9c6b83b20d6e1362d650ac2ee49fff45b29767 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/334449 Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://review.coreboot.org/14234 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/vendorcode')
-rw-r--r--src/vendorcode/google/chromeos/chromeos.h2
-rw-r--r--src/vendorcode/google/chromeos/watchdog.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h
index 03f1516ee0..57a2f71b29 100644
--- a/src/vendorcode/google/chromeos/chromeos.h
+++ b/src/vendorcode/google/chromeos/chromeos.h
@@ -34,10 +34,12 @@ void elog_add_boot_reason(void);
/* functions implemented in watchdog.c */
void elog_add_watchdog_reset(void);
+void mark_watchdog_tombstone(void);
void reboot_from_watchdog(void);
#else
static inline void elog_add_boot_reason(void) { return; }
static inline void elog_add_watchdog_reset(void) { return; }
+static inline void mark_watchdog_tombstone(void) { return; }
static inline void reboot_from_watchdog(void) { return; }
#endif /* CONFIG_CHROMEOS */
diff --git a/src/vendorcode/google/chromeos/watchdog.c b/src/vendorcode/google/chromeos/watchdog.c
index 79f7dde711..a2b18b75e5 100644
--- a/src/vendorcode/google/chromeos/watchdog.c
+++ b/src/vendorcode/google/chromeos/watchdog.c
@@ -30,9 +30,14 @@ void elog_add_watchdog_reset(void)
write32(_watchdog_tombstone, 0);
}
+void mark_watchdog_tombstone(void)
+{
+ write32(_watchdog_tombstone, WATCHDOG_TOMBSTONE_MAGIC);
+}
+
void reboot_from_watchdog(void)
{
printk(BIOS_INFO, "Last reset was watchdog, reboot again to reset TPM!\n");
- write32(_watchdog_tombstone, WATCHDOG_TOMBSTONE_MAGIC);
+ mark_watchdog_tombstone();
hard_reset();
}