summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJim Liu <jim.t90615@gmail.com>2023-10-18 10:09:00 +0800
committerStefan Roese <sr@denx.de>2023-10-19 07:51:12 +0200
commit127d03893bd51f855e1a277e31a8258105ace42a (patch)
tree513818a9c8de52c19d6fc0d4cdd9703ab8954827 /drivers
parentbc003cad7f1ee9eb6fd993e82e6f7e6795432ef5 (diff)
downloadu-boot-127d03893bd51f855e1a277e31a8258105ace42a.tar.gz
u-boot-127d03893bd51f855e1a277e31a8258105ace42a.tar.bz2
u-boot-127d03893bd51f855e1a277e31a8258105ace42a.zip
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 <JJLIU0@nuvoton.com> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/watchdog/npcm_wdt.c10
1 files changed, 8 insertions, 2 deletions
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)