summaryrefslogtreecommitdiff
path: root/src/soc/mediatek
diff options
context:
space:
mode:
authorRex-BC Chen <rex-bc.chen@mediatek.com>2022-03-15 10:30:06 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-03-18 15:42:40 +0000
commit1e24b2047565e1ab01facb8185c06292550b3050 (patch)
tree9b3eb17adbae6b4021779916a0dc0156ebfbae39 /src/soc/mediatek
parentbd529e2e200a8fbfd455dd62be0494a2b727b9a5 (diff)
soc/mediatek: Trigger wdt SW reset when wdt status is not equal to 0
Because we close external signal in kernel driver since MT8195, it's more reasonable to trigger sw reset with exteranl signal again whenever the wdt status is not equal to 0. BUG=none TEST=build pass Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> Change-Id: Ic6128df7eadaebcf7ff8d4c5492e3e0cfbab6e36 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62797 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek')
-rw-r--r--src/soc/mediatek/common/wdt.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/soc/mediatek/common/wdt.c b/src/soc/mediatek/common/wdt.c
index 108648f80f..d58ac32b33 100644
--- a/src/soc/mediatek/common/wdt.c
+++ b/src/soc/mediatek/common/wdt.c
@@ -40,18 +40,21 @@ int mtk_wdt_init(void)
printk(BIOS_INFO, "WDT: Status = %#x\n", wdt_sta);
printk(BIOS_INFO, "WDT: Last reset was ");
- if (wdt_sta & MTK_WDT_STA_HW_RST) {
- printk(BIOS_INFO, "hardware watchdog\n");
+ if (!wdt_sta) {
+ printk(BIOS_INFO, "cold boot\n");
+ } else {
+ if (wdt_sta & MTK_WDT_STA_HW_RST)
+ printk(BIOS_INFO, "hardware watchdog\n");
+ else if (wdt_sta & MTK_WDT_STA_SW_RST)
+ printk(BIOS_INFO, "normal software reboot\n");
+ else if (wdt_sta & MTK_WDT_STA_SPM_RST)
+ printk(BIOS_INFO, "SPM reboot\n");
+ else
+ printk(BIOS_INFO, "other reset type: %#.8x\n", wdt_sta);
+
mark_watchdog_tombstone();
mtk_wdt_swreset();
- } else if (wdt_sta & MTK_WDT_STA_SW_RST)
- printk(BIOS_INFO, "normal software reboot\n");
- else if (wdt_sta & MTK_WDT_STA_SPM_RST)
- printk(BIOS_INFO, "SPM reboot\n");
- else if (!wdt_sta)
- printk(BIOS_INFO, "cold boot\n");
- else
- printk(BIOS_INFO, "unexpected reset type: %#.8x\n", wdt_sta);
+ }
/* Config watchdog reboot mode:
* Clearing bits: