summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common/wdt.c
diff options
context:
space:
mode:
authorRex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>2021-09-27 13:06:53 +0800
committerFelix Held <felix-coreboot@felixheld.de>2021-11-03 18:51:24 +0000
commita23d76a8bcaff5fedc370a9850d953005f261202 (patch)
treea1152ffdad79f94ef14cddcf84d7f12f501ccddb /src/soc/mediatek/common/wdt.c
parent9559c68b3cf24780d351875a007fb5c57303c3a6 (diff)
soc/mediatek: Add an overridable function for WDT clear status
mtk_wdt_clr_status is different for MT8186 and MT8195, so we move this function to soc folder. TEST=build pass BUG=b:202871018 Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> Change-Id: Ia8697ffdca1e2d1443f2259713c4ab6fdf1b1a9e Reviewed-on: https://review.coreboot.org/c/coreboot/+/58834 Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/common/wdt.c')
-rw-r--r--src/soc/mediatek/common/wdt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/soc/mediatek/common/wdt.c b/src/soc/mediatek/common/wdt.c
index 05bd27d277..b228e56a05 100644
--- a/src/soc/mediatek/common/wdt.c
+++ b/src/soc/mediatek/common/wdt.c
@@ -5,6 +5,8 @@
#include <soc/wdt.h>
#include <vendorcode/google/chromeos/chromeos.h>
+__weak void mtk_wdt_clr_status(uint32_t wdt_sta) { /* do nothing */ }
+
int mtk_wdt_init(void)
{
uint32_t wdt_sta;
@@ -12,8 +14,7 @@ int mtk_wdt_init(void)
/* Writing mode register will clear status register */
wdt_sta = read32(&mtk_wdt->wdt_status);
- if (CONFIG(CLEAR_WDT_MODE_REG))
- write32(&mtk_wdt->wdt_mode, MTK_WDT_CLR_STATUS);
+ mtk_wdt_clr_status(wdt_sta);
printk(BIOS_INFO, "WDT: Last reset was ");
if (wdt_sta & MTK_WDT_STA_HW_RST) {