[PATCH v3] wdt: nuvoton: Fix reset/expire function error
Stefan Roese
sr at denx.de
Thu Oct 19 07:53:44 CEST 2023
On 10/18/23 04:09, Jim Liu wrote:
> Fix npcm845 watchdog halt for reset function and expire function.
> Reset function is restart wdt.
>
> Signed-off-by: Jim Liu <JJLIU0 at nuvoton.com>
>
> Changes for v3:
> - Modify start sentences
> - Remove empty line
> Changes for v2:
> - Add commit message
> - Fix no empty line problem
> - Remove dts
> ---
The revision history should be placed below the "---" line. This way
it will not be included in the commit text when committing. No need to
change this though, I'll fix it up.
Reviewed-by: Stefan Roese <sr at denx.de>
Thanks,
Stefan
> drivers/watchdog/npcm_wdt.c | 10 ++++++++--
> 1 file 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)
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
More information about the U-Boot
mailing list