From: Jim Liu Date: Wed, 18 Oct 2023 02:09:00 +0000 (+0800) Subject: wdt: nuvoton: Fix reset/expire function error X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=127d03893bd51f855e1a277e31a8258105ace42a;p=u-boot.git wdt: nuvoton: Fix reset/expire function error Fix npcm845 watchdog halt for reset function and expire function. Reset function is restart wdt. Signed-off-by: Jim Liu Reviewed-by: Stefan Roese --- diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c index e56aa0ebe1..57b61215a2 100644 --- a/drivers/watchdog/npcm_wdt.c +++ b/drivers/watchdog/npcm_wdt.c @@ -69,15 +69,21 @@ static int npcm_wdt_stop(struct udevice *dev) static int npcm_wdt_reset(struct udevice *dev) { struct npcm_wdt_priv *priv = dev_get_priv(dev); + u32 val; - writel(NPCM_WTR | NPCM_WTRE | NPCM_WTE, priv->regs); + val = readl(priv->regs); + writel(val | NPCM_WTR, priv->regs); return 0; } static int npcm_wdt_expire_now(struct udevice *dev, ulong flags) { - return npcm_wdt_reset(dev); + struct npcm_wdt_priv *priv = dev_get_priv(dev); + + writel(NPCM_WTR | NPCM_WTRE | NPCM_WTE, priv->regs); + + return 0; } static int npcm_wdt_of_to_plat(struct udevice *dev)