[PATCH v1] wdt: nuvoton: add expire function for generic reset

Add expire_now function for generic sysreset request
Signed-off-by: Jim Liu JJLIU0@nuvoton.com --- drivers/watchdog/npcm_wdt.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c index 256020f5d3..e56aa0ebe1 100644 --- a/drivers/watchdog/npcm_wdt.c +++ b/drivers/watchdog/npcm_wdt.c @@ -75,6 +75,11 @@ static int npcm_wdt_reset(struct udevice *dev) return 0; }
+static int npcm_wdt_expire_now(struct udevice *dev, ulong flags) +{ + return npcm_wdt_reset(dev); +} + static int npcm_wdt_of_to_plat(struct udevice *dev) { struct npcm_wdt_priv *priv = dev_get_priv(dev); @@ -87,6 +92,7 @@ static int npcm_wdt_of_to_plat(struct udevice *dev) }
static const struct wdt_ops npcm_wdt_ops = { + .expire_now = npcm_wdt_expire_now, .start = npcm_wdt_start, .reset = npcm_wdt_reset, .stop = npcm_wdt_stop,

On 13.09.22 08:19, Jim Liu wrote:
Add expire_now function for generic sysreset request
Signed-off-by: Jim Liu JJLIU0@nuvoton.com
drivers/watchdog/npcm_wdt.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c index 256020f5d3..e56aa0ebe1 100644 --- a/drivers/watchdog/npcm_wdt.c +++ b/drivers/watchdog/npcm_wdt.c @@ -75,6 +75,11 @@ static int npcm_wdt_reset(struct udevice *dev) return 0; }
+static int npcm_wdt_expire_now(struct udevice *dev, ulong flags) +{
- return npcm_wdt_reset(dev);
+}
Does this really work? You are calling the watchdog reset function here in the expire function, which will just reset / trigger the WDT. I would not expect that this will expire the WDT and result in a CPU / SoC reset.
Thanks, Stefan
static int npcm_wdt_of_to_plat(struct udevice *dev) { struct npcm_wdt_priv *priv = dev_get_priv(dev); @@ -87,6 +92,7 @@ static int npcm_wdt_of_to_plat(struct udevice *dev) }
static const struct wdt_ops npcm_wdt_ops = {
- .expire_now = npcm_wdt_expire_now, .start = npcm_wdt_start, .reset = npcm_wdt_reset, .stop = npcm_wdt_stop,
Viele Grüße, Stefan Roese

On 13.09.22 08:19, Jim Liu wrote:
Add expire_now function for generic sysreset request
Signed-off-by: Jim Liu JJLIU0@nuvoton.com
Applied to u-boot-watchdog/master
Thanks, Stefan
drivers/watchdog/npcm_wdt.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c index 256020f5d3..e56aa0ebe1 100644 --- a/drivers/watchdog/npcm_wdt.c +++ b/drivers/watchdog/npcm_wdt.c @@ -75,6 +75,11 @@ static int npcm_wdt_reset(struct udevice *dev) return 0; }
+static int npcm_wdt_expire_now(struct udevice *dev, ulong flags) +{
- return npcm_wdt_reset(dev);
+}
- static int npcm_wdt_of_to_plat(struct udevice *dev) { struct npcm_wdt_priv *priv = dev_get_priv(dev);
@@ -87,6 +92,7 @@ static int npcm_wdt_of_to_plat(struct udevice *dev) }
static const struct wdt_ops npcm_wdt_ops = {
- .expire_now = npcm_wdt_expire_now, .start = npcm_wdt_start, .reset = npcm_wdt_reset, .stop = npcm_wdt_stop,
Viele Grüße, Stefan Roese
participants (2)
-
Jim Liu
-
Stefan Roese