mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 13:56:20 +00:00
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>
This commit is contained in:
parent
bc003cad7f
commit
127d03893b
1 changed files with 8 additions and 2 deletions
|
@ -69,15 +69,21 @@ static int npcm_wdt_stop(struct udevice *dev)
|
||||||
static int npcm_wdt_reset(struct udevice *dev)
|
static int npcm_wdt_reset(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct npcm_wdt_priv *priv = dev_get_priv(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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int npcm_wdt_expire_now(struct udevice *dev, ulong flags)
|
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)
|
static int npcm_wdt_of_to_plat(struct udevice *dev)
|
||||||
|
|
Loading…
Add table
Reference in a new issue