summaryrefslogtreecommitdiff
path: root/src/soc/qualcomm/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/qualcomm/common')
-rw-r--r--src/soc/qualcomm/common/include/soc/watchdog.h8
-rw-r--r--src/soc/qualcomm/common/watchdog.c16
2 files changed, 24 insertions, 0 deletions
diff --git a/src/soc/qualcomm/common/include/soc/watchdog.h b/src/soc/qualcomm/common/include/soc/watchdog.h
new file mode 100644
index 0000000000..1995e62742
--- /dev/null
+++ b/src/soc/qualcomm/common/include/soc/watchdog.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _SOC_QUALCOMM_WDOG_COMMON_H__
+#define _SOC_QUALCOMM_WDOG_COMMON_H__
+
+void check_wdog(void);
+
+#endif /* _SOC_QUALCOMM_WDOG_COMMON_H__ */
diff --git a/src/soc/qualcomm/common/watchdog.c b/src/soc/qualcomm/common/watchdog.c
new file mode 100644
index 0000000000..680d70b2d3
--- /dev/null
+++ b/src/soc/qualcomm/common/watchdog.c
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <soc/clock.h>
+#include <soc/watchdog.h>
+#include <device/mmio.h>
+#include <vendorcode/google/chromeos/chromeos.h>
+
+#define WDOG_RESET_BIT_MASK 1
+
+void check_wdog(void)
+{
+ uint32_t wdog_sta = read32(&aoss->aoss_cc_reset_status);
+
+ if (wdog_sta & WDOG_RESET_BIT_MASK)
+ mark_watchdog_tombstone();
+}