diff options
author | Tom Rini <trini@konsulko.com> | 2023-08-10 11:40:09 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-10 11:40:09 -0400 |
commit | a5899cc69a99379f01e8e2f9f98e0e09b24f1656 (patch) | |
tree | a7ec9a60b612bfbebceb74940219a4ad315a608d | |
parent | 824f1044227d5e971d5541d8f334bc2dfa22b99f (diff) | |
parent | 160984ed3a91a4225b27ffe8bfc3b1b4dc08a4ea (diff) | |
download | u-boot-a5899cc69a99379f01e8e2f9f98e0e09b24f1656.zip u-boot-a5899cc69a99379f01e8e2f9f98e0e09b24f1656.tar.gz u-boot-a5899cc69a99379f01e8e2f9f98e0e09b24f1656.tar.bz2 |
Merge https://source.denx.de/u-boot/custodians/u-boot-watchdog
- cmd: cyclic: Remove duplicate command name in help text (Alexander)
- ftwdt010: need to reset watchdog in ftwdt010_wdt_start() (Sergei)
-rw-r--r-- | cmd/cyclic.c | 2 | ||||
-rw-r--r-- | drivers/watchdog/ftwdt010_wdt.c | 40 |
2 files changed, 22 insertions, 20 deletions
diff --git a/cmd/cyclic.c b/cmd/cyclic.c index 97324d8..946f1d7 100644 --- a/cmd/cyclic.c +++ b/cmd/cyclic.c @@ -77,7 +77,7 @@ static int do_cyclic_list(struct cmd_tbl *cmdtp, int flag, int argc, } static char cyclic_help_text[] = - "cyclic demo <cycletime_ms> <delay_us> - register cyclic demo function\n" + "demo <cycletime_ms> <delay_us> - register cyclic demo function\n" "cyclic list - list cyclic functions\n"; U_BOOT_CMD_WITH_SUBCMDS(cyclic, "Cyclic", cyclic_help_text, diff --git a/drivers/watchdog/ftwdt010_wdt.c b/drivers/watchdog/ftwdt010_wdt.c index a6b33b1..1f5f301 100644 --- a/drivers/watchdog/ftwdt010_wdt.c +++ b/drivers/watchdog/ftwdt010_wdt.c @@ -25,8 +25,27 @@ struct ftwdt010_wdt_priv { struct ftwdt010_wdt __iomem *regs; }; +static int ftwdt010_wdt_reset(struct udevice *dev) +{ + struct ftwdt010_wdt_priv *priv = dev_get_priv(dev); + struct ftwdt010_wdt *wd = priv->regs; + + debug("Reset WDT..\n"); + + /* clear control register */ + writel(0, &wd->wdcr); + + /* Write Magic number */ + writel(FTWDT010_WDRESTART_MAGIC, &wd->wdrestart); + + /* Enable WDT */ + writel(FTWDT010_WDCR_RST | FTWDT010_WDCR_ENABLE, &wd->wdcr); + + return 0; +} + /* - * Set the watchdog time interval. + * Set the watchdog time interval and start the timer. * Counter is 32 bit. */ static int ftwdt010_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags) @@ -52,24 +71,7 @@ static int ftwdt010_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags) writel(reg, &wd->wdload); - return 0; -} - -static int ftwdt010_wdt_reset(struct udevice *dev) -{ - struct ftwdt010_wdt_priv *priv = dev_get_priv(dev); - struct ftwdt010_wdt *wd = priv->regs; - - /* clear control register */ - writel(0, &wd->wdcr); - - /* Write Magic number */ - writel(FTWDT010_WDRESTART_MAGIC, &wd->wdrestart); - - /* Enable WDT */ - writel((FTWDT010_WDCR_RST | FTWDT010_WDCR_ENABLE), &wd->wdcr); - - return 0; + return ftwdt010_wdt_reset(dev); } static int ftwdt010_wdt_stop(struct udevice *dev) |