u-boot/drivers/watchdog
Rasmus Villemoes 492ee6b8d0 watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()
A board can have and make use of more than one watchdog device, say
one built into the SOC and an external gpio-petted one. Having
wdt-uclass only handle the first is both a little arbitrary and
unexpected.

So change initr_watchdog() so we visit (probe) all DM watchdog
devices, and call the init_watchdog_dev helper for each.

Similarly let watchdog_reset() loop over the whole uclass - each
having their own ratelimiting metadata, and a separate "is this device
running" flag.

This gets rid of the watchdog_dev member of struct global_data.  We
do, however, still need the GD_FLG_WDT_READY set in
initr_watchdog(). This is because watchdog_reset() can get called
before DM is ready, and I don't think we can call uclass_get() that
early.

The current code just returns 0 if "getting" the first device fails -
that can of course happen because there are no devices, but it could
also happen if its ->probe call failed. In keeping with that, continue
with the handling of the remaining devices even if one fails to
probe. This is also why we cannot use uclass_probe_all().

If desired, it's possible to later add a per-device "u-boot,autostart"
boolean property, so that one can do CONFIG_WATCHDOG_AUTOSTART
per-device.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2021-08-31 12:04:03 +02:00
..
armada-37xx-wdt.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
ast2600_wdt.c wdt: aspeed: Add AST2600 watchdog support 2021-01-18 15:23:05 -05:00
ast_wdt.c dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
at91sam9_wdt.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
bcm6345_wdt.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
booke_wdt.c watchdog: Add booke watchdog driver 2021-04-15 14:22:17 +05:30
cdns_wdt.c watchdog: cadence: Add expire_now method 2021-07-01 09:25:06 +02:00
cortina_wdt.c watchdog: cortina_wdt: add support for HW WDT on CAxxxx SoCs 2020-02-07 16:15:57 -05:00
designware_wdt.c driver: watchdog: reset watchdog in designware_wdt_stop() function 2021-07-16 10:28:35 +02:00
ftwdt010_wdt.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
imx_watchdog.c reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
Kconfig watchdog: Add booke watchdog driver 2021-04-15 14:22:17 +05:30
Makefile watchdog: Add booke watchdog driver 2021-04-15 14:22:17 +05:30
mpc8xx_wdt.c watchdog: mpc8xx_wdt: Allow selection of watchdog mode through environment 2020-04-24 10:09:59 -04:00
mt7620_wdt.c watchdog: add watchdog driver for MediaTek MT7620 SoC 2021-01-24 21:39:26 +01:00
mt7621_wdt.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mtk_wdt.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
octeontx_wdt.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
omap_wdt.c dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
orion_wdt.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
rti_wdt.c dm: Rename DM_FLAG_REMOVE_WITH_PD_ON 2021-02-03 03:38:41 -07:00
s5p_wdt.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sandbox_wdt.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sbsa_gwdt.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sp805_wdt.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
stm32mp_wdt.c watchdog: stm32mp: migrate trace to dev macro 2021-01-13 09:52:58 +01:00
tangier_wdt.c dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
ulp_wdog.c mx7ulp: wdog: Wait for WDOG unlock and reconfiguration to complete 2021-07-17 14:59:56 +02:00
wdt-uclass.c watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset() 2021-08-31 12:04:03 +02:00
xilinx_tb_wdt.c dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
xilinx_wwdt.c watchdog: versal: Include header file needed for dev_ functions 2021-08-26 08:08:11 +02:00