summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-08-24 19:38:05 -0700
committerPatrick Georgi <pgeorgi@google.com>2016-09-20 21:50:39 +0200
commitb6bf1ddb91ccb6241827792afead6ac3fce79eb5 (patch)
tree85c060ce781a2146a5943d6ee3fe83b499923826 /src/mainboard/google
parentaa1d314ac2febafc5243266b420ff57b280621c5 (diff)
gru: Add watchdog reset support
This patch adds support to reboot the whole board after a hardware watchdog reset, to avoid the usual TPM issues. Work 100% equivalent to Veyron. From my tests it looks like both SRAM and PMUSRAM get preserved across warm reboots. I'm putting the WATCHDOG_TOMBSTONE into PMUSRAM since that makes it easier to deal with in coreboot (PMUSRAM is currently not mapped as cached, so we don't need to worry about flushing the results back before reboot). BRANCH=None BUG=chrome-os-partner:56600 TEST='stop daisydog; cat > /dev/watchdog', press CTRL+D, wait 30 seconds. Confirm that system reboots correctly without entering recovery and we get a HW watchdog event in the eventlog. Change-Id: I317266df40bbb221910017d1a6bdec6a1660a511 Signed-off-by: Martin Roth <martinroth@chromium.org> Original-Commit-Id: 3b8f3d064ad56d181191c1e1c98a73196cb8d098 Original-Change-Id: I17c5a801bef200d7592a315a955234bca11cf7a3 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/375562 Original-Commit-Queue: Douglas Anderson <dianders@chromium.org> Reviewed-on: https://review.coreboot.org/16578 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/gru/Makefile.inc1
-rw-r--r--src/mainboard/google/gru/bootblock.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/mainboard/google/gru/Makefile.inc b/src/mainboard/google/gru/Makefile.inc
index 9e07a6c13a..034edde8a7 100644
--- a/src/mainboard/google/gru/Makefile.inc
+++ b/src/mainboard/google/gru/Makefile.inc
@@ -20,6 +20,7 @@ bootblock-y += chromeos.c
bootblock-y += memlayout.ld
bootblock-y += pwm_regulator.c
bootblock-y += boardid.c
+bootblock-y += reset.c
verstage-y += chromeos.c
verstage-y += memlayout.ld
diff --git a/src/mainboard/google/gru/bootblock.c b/src/mainboard/google/gru/bootblock.c
index ff91e1a971..420fdf1e84 100644
--- a/src/mainboard/google/gru/bootblock.c
+++ b/src/mainboard/google/gru/bootblock.c
@@ -24,6 +24,7 @@
#include <soc/i2c.h>
#include <soc/pwm.h>
#include <soc/spi.h>
+#include <vendorcode/google/chromeos/chromeos.h>
#include "board.h"
#include "pwm_regulator.h"
@@ -75,6 +76,9 @@ void bootblock_mainboard_init(void)
{
speed_up_boot_cpu();
+ if (rkclk_was_watchdog_reset())
+ reboot_from_watchdog();
+
/* Set pinmux and configure spi flashrom. */
write32(&rk3399_pmugrf->spi1_rxd, IOMUX_SPI1_RX);
write32(&rk3399_pmugrf->spi1_csclktx, IOMUX_SPI1_CSCLKTX);