diff options
author | Tom Rini <trini@konsulko.com> | 2021-07-16 09:15:21 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-07-16 09:15:21 -0400 |
commit | d0dab9336db08bf562dd7ded4a417efd8570cee7 (patch) | |
tree | c6a807580522598c637ea49bc2fa724dbb0a4534 | |
parent | 7533f80bec2e76f98df32e031ba5fe37927cd89f (diff) | |
parent | 5fc094351381c4254098a25404d8712324b6918e (diff) | |
download | u-boot-WIP/16Jul2021.zip u-boot-WIP/16Jul2021.tar.gz u-boot-WIP/16Jul2021.tar.bz2 |
Merge https://source.denx.de/u-boot/custodians/u-boot-marvellWIP/16Jul2021
- designware_wdt: reset watchdog in designware_wdt_stop() function
(Meng)
- socfpga_stratix10: enable wdt command (Meng)
- wdt-uclass: Use IS_ENABLED for WATCHDOG_AUTOSTART (Teresa)
-rw-r--r-- | configs/socfpga_stratix10_defconfig | 1 | ||||
-rw-r--r-- | drivers/watchdog/designware_wdt.c | 19 | ||||
-rw-r--r-- | drivers/watchdog/wdt-uclass.c | 2 |
3 files changed, 17 insertions, 5 deletions
diff --git a/configs/socfpga_stratix10_defconfig b/configs/socfpga_stratix10_defconfig index bbbae14..f83a90c 100644 --- a/configs/socfpga_stratix10_defconfig +++ b/configs/socfpga_stratix10_defconfig @@ -39,6 +39,7 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_WDT=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_NET_RANDOM_ETHADDR=y diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index 9e54871..afed81e 100644 --- a/drivers/watchdog/designware_wdt.c +++ b/drivers/watchdog/designware_wdt.c @@ -22,6 +22,7 @@ struct designware_wdt_priv { void __iomem *base; unsigned int clk_khz; + struct reset_ctl_bulk *resets; }; /* @@ -95,6 +96,18 @@ static int designware_wdt_stop(struct udevice *dev) designware_wdt_reset(dev); writel(0, priv->base + DW_WDT_CR); + if (CONFIG_IS_ENABLED(DM_RESET)) { + int ret; + + ret = reset_assert_bulk(priv->resets); + if (ret) + return ret; + + ret = reset_deassert_bulk(priv->resets); + if (ret) + return ret; + } + return 0; } @@ -143,13 +156,11 @@ static int designware_wdt_probe(struct udevice *dev) #endif if (CONFIG_IS_ENABLED(DM_RESET)) { - struct reset_ctl_bulk resets; - - ret = reset_get_bulk(dev, &resets); + ret = reset_get_bulk(dev, priv->resets); if (ret) goto err; - ret = reset_deassert_bulk(&resets); + ret = reset_deassert_bulk(priv->resets); if (ret) goto err; } diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index a0c2429..17334db 100644 --- a/drivers/watchdog/wdt-uclass.c +++ b/drivers/watchdog/wdt-uclass.c @@ -53,7 +53,7 @@ int initr_watchdog(void) 4 * reset_period) / 4; } - if (!CONFIG_IS_ENABLED(WATCHDOG_AUTOSTART)) { + if (!IS_ENABLED(CONFIG_WATCHDOG_AUTOSTART)) { printf("WDT: Not starting\n"); return 0; } |