summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8192/wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/mediatek/mt8192/wdt.c')
-rw-r--r--src/soc/mediatek/mt8192/wdt.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8192/wdt.c b/src/soc/mediatek/mt8192/wdt.c
new file mode 100644
index 0000000000..8c8959a420
--- /dev/null
+++ b/src/soc/mediatek/mt8192/wdt.c
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <device/mmio.h>
+#include <soc/addressmap.h>
+#include <soc/wdt.h>
+
+#define MTK_WDT_REQ_MOD_KEY_VAL 0x33
+#define MTK_WDT_REQ_IRQ_KEY_VAL 0x44
+
+DEFINE_BITFIELD(MTK_WDT_REQ_MOD_KEY, 31, 24)
+DEFINE_BITFIELD(MTK_WDT_REQ_IRQ_KEY, 31, 24)
+DEFINE_BIT(MTK_WDT_THERMAL_EN, 18)
+DEFINE_BIT(MTK_WDT_THERMAL_IRQ, 18)
+
+void mtk_wdt_preinit(void)
+{
+ SET32_BITFIELDS(&mtk_wdt->wdt_req_mode,
+ MTK_WDT_THERMAL_EN, 1,
+ MTK_WDT_REQ_MOD_KEY, MTK_WDT_REQ_MOD_KEY_VAL);
+ SET32_BITFIELDS(&mtk_wdt->wdt_req_irq_en,
+ MTK_WDT_THERMAL_IRQ, 0,
+ MTK_WDT_REQ_IRQ_KEY, MTK_WDT_REQ_IRQ_KEY_VAL);
+}