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>
This commit is contained in:
Rex-BC Chen 2022-03-15 10:30:06 +08:00 committed by Felix Held
parent bd529e2e20
commit 1e24b20475
1 changed files with 13 additions and 10 deletions

View File

@ -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: