aboutsummaryrefslogtreecommitdiff
path: root/src/soc/qualcomm/sc7180/watchdog.c
diff options
context:
space:
mode:
authorRavi Kumar Bokka <rbokka@codeaurora.org>2020-08-25 15:47:59 +0530
committerJulius Werner <jwerner@chromium.org>2020-09-16 00:44:09 +0000
commit6fde4c56b08250590c392ecbad0b6e067633d5c4 (patch)
treec52e9b0f70a3b5ff85595a1639f233facd4e1895 /src/soc/qualcomm/sc7180/watchdog.c
parent336ed66e35a00280cc0d65fedae02e639c9e6e6b (diff)
sc7180: report hardware watchdog reset after reboot
add WATCHDOG_TOMBSTONE in memlayout.ld Change-Id: I57ece39ff3d49f2bab259cbd92ab039a49323119 Signed-off-by: Ravi Kumar Bokka <rbokka@codeaurora.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/44868 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/soc/qualcomm/sc7180/watchdog.c')
-rw-r--r--src/soc/qualcomm/sc7180/watchdog.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/soc/qualcomm/sc7180/watchdog.c b/src/soc/qualcomm/sc7180/watchdog.c
new file mode 100644
index 0000000000..954f68aa3d
--- /dev/null
+++ b/src/soc/qualcomm/sc7180/watchdog.c
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <soc/watchdog.h>
+#include <soc/clock.h>
+#include <console/console.h>
+#include <device/mmio.h>
+#include <vendorcode/google/chromeos/chromeos.h>
+
+void check_wdog(void)
+{
+ uint32_t wdog_sta = read32(&aoss->aoss_cc_reset_status);
+
+ if (wdog_sta & WDOG_RESET_BIT_MASK)
+ mark_watchdog_tombstone();
+}