diff --git a/src/soc/mediatek/common/include/soc/wdt_common.h b/src/soc/mediatek/common/include/soc/wdt_common.h index 5587d504e8..6d6d2ba758 100644 --- a/src/soc/mediatek/common/include/soc/wdt_common.h +++ b/src/soc/mediatek/common/include/soc/wdt_common.h @@ -32,6 +32,11 @@ enum { MTK_WDT_MODE_ENABLE = 1 << 0 }; +/* WDT_RESTART */ +enum { + MTK_WDT_RESTART_KEY = 0x1971 +}; + /* WDT_RESET */ enum { MTK_WDT_SWRST_KEY = 0x1209, diff --git a/src/soc/mediatek/common/wdt.c b/src/soc/mediatek/common/wdt.c index 7ae4661011..663fc2fd30 100644 --- a/src/soc/mediatek/common/wdt.c +++ b/src/soc/mediatek/common/wdt.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include +#include #include #include #include @@ -23,7 +24,9 @@ static inline void mtk_wdt_swreset(void) printk(BIOS_INFO, "%s() called!\n", __func__); dcache_clean_all(); + write32(&mtk_wdt->wdt_restart, MTK_WDT_RESTART_KEY); setbits32(&mtk_wdt->wdt_mode, MTK_WDT_MODE_EXTEN | MTK_WDT_MODE_KEY); + udelay(100); write32(&mtk_wdt->wdt_swrst, MTK_WDT_SWRST_KEY); halt();