diff options
author | Tom Rini <trini@konsulko.com> | 2023-10-19 09:39:00 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-10-19 09:39:00 -0400 |
commit | 48bc9de28228a0fdd30a10f59f23e6a24cb75636 (patch) | |
tree | 513818a9c8de52c19d6fc0d4cdd9703ab8954827 | |
parent | 9a0cf3993f71043ba08c315572c54622de42d447 (diff) | |
parent | 127d03893bd51f855e1a277e31a8258105ace42a (diff) | |
download | u-boot-48bc9de28228a0fdd30a10f59f23e6a24cb75636.zip u-boot-48bc9de28228a0fdd30a10f59f23e6a24cb75636.tar.gz u-boot-48bc9de28228a0fdd30a10f59f23e6a24cb75636.tar.bz2 |
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-watchdog
- sandbox: watchdog: Avoid an error on startup (Simon)
- nuvoton: Fix reset/expire function error (Jim)
-rw-r--r-- | arch/sandbox/dts/test.dts | 2 | ||||
-rw-r--r-- | drivers/watchdog/npcm_wdt.c | 10 | ||||
-rw-r--r-- | test/dm/wdt.c | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index e88c267..e430347 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -975,7 +975,7 @@ }; wdt-gpio-toggle { - gpios = <&gpio_a 7 0>; + gpios = <&gpio_a 8 0>; compatible = "linux,wdt-gpio"; hw_margin_ms = <100>; hw_algo = "toggle"; diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c index e56aa0e..57b6121 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) diff --git a/test/dm/wdt.c b/test/dm/wdt.c index 653d7b1..2bbebcd 100644 --- a/test/dm/wdt.c +++ b/test/dm/wdt.c @@ -54,7 +54,7 @@ static int dm_test_wdt_gpio_toggle(struct unit_test_state *uts) */ struct udevice *wdt, *gpio; const u64 timeout = 42; - const int offset = 7; + const int offset = 8; int val; ut_assertok(uclass_get_device_by_name(UCLASS_WDT, @@ -115,7 +115,7 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts) struct udevice *gpio_wdt, *sandbox_wdt; struct udevice *gpio; const u64 timeout = 42; - const int offset = 7; + const int offset = 8; uint reset_count; int val; |