summaryrefslogtreecommitdiff
path: root/chip/mt_scp/rv32i_common/watchdog.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/mt_scp/rv32i_common/watchdog.c')
-rw-r--r--chip/mt_scp/rv32i_common/watchdog.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/chip/mt_scp/rv32i_common/watchdog.c b/chip/mt_scp/rv32i_common/watchdog.c
deleted file mode 100644
index 72ca5edad8..0000000000
--- a/chip/mt_scp/rv32i_common/watchdog.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Watchdog driver */
-
-#include "common.h"
-#include "hooks.h"
-#include "registers.h"
-#include "watchdog.h"
-
-void watchdog_reload(void)
-{
- SCP_CORE0_WDT_KICK = BIT(0);
-}
-DECLARE_HOOK(HOOK_TICK, watchdog_reload, HOOK_PRIO_DEFAULT);
-
-int watchdog_init(void)
-{
- const uint32_t timeout = WDT_PERIOD(CONFIG_WATCHDOG_PERIOD_MS);
-
- /* disable watchdog */
- SCP_CORE0_WDT_CFG &= ~WDT_EN;
- /* clear watchdog irq */
- SCP_CORE0_WDT_IRQ |= BIT(0);
- /* enable watchdog */
- SCP_CORE0_WDT_CFG = WDT_EN | timeout;
- /* reload watchdog */
- watchdog_reload();
-
- return EC_SUCCESS;
-}