From 3c00c7ec6b1a26699f7aab39c6cb702aa16a3d42 Mon Sep 17 00:00:00 2001 From: Rex-BC Chen Date: Tue, 8 Feb 2022 18:56:15 +0800 Subject: [PATCH] soc/mediatek: Only update required bits when triggering WDT reset To prevent to modify original value of wdt_mode, we use setbits32 to update required bits. BUG=b:218420108 TEST=build pass Signed-off-by: Rex-BC Chen Change-Id: I743c1af3583c18ec8500fc1eb89f31cdbce5317c Reviewed-on: https://review.coreboot.org/c/coreboot/+/61729 Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/soc/mediatek/common/wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/soc/mediatek/common/wdt.c b/src/soc/mediatek/common/wdt.c index 587e50f04c..4f8eff282e 100644 --- a/src/soc/mediatek/common/wdt.c +++ b/src/soc/mediatek/common/wdt.c @@ -32,7 +32,7 @@ int mtk_wdt_init(void) * console (either in SRAM or DRAM) can be flushed. */ dcache_clean_all(); - write32(&mtk_wdt->wdt_mode, MTK_WDT_MODE_EXTEN | MTK_WDT_MODE_KEY); + setbits32(&mtk_wdt->wdt_mode, MTK_WDT_MODE_EXTEN | MTK_WDT_MODE_KEY); write32(&mtk_wdt->wdt_swrst, MTK_WDT_SWRST_KEY); } else if (wdt_sta & MTK_WDT_STA_SW_RST) printk(BIOS_INFO, "normal software reboot\n");