Rex-BC Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/62797 )
Change subject: soc/mediatek/common: Trigger wdt SW reset when wdt status is not equal to 0 ......................................................................
soc/mediatek/common: 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 we need to trigger sw reset with exteranl signal again if the wdt status is not euqal to 0.
BUG=none TEST=build pass
Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Change-Id: Ic6128df7eadaebcf7ff8d4c5492e3e0cfbab6e36 --- M src/soc/mediatek/common/wdt.c 1 file changed, 13 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/97/62797/1
diff --git a/src/soc/mediatek/common/wdt.c b/src/soc/mediatek/common/wdt.c index 108648f..d58ac32 100644 --- a/src/soc/mediatek/common/wdt.c +++ b/src/soc/mediatek/common/wdt.c @@ -40,18 +40,21 @@ 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: