492ee6b8d0
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> |
||
---|---|---|
.. | ||
armada-37xx-wdt.c | ||
ast2600_wdt.c | ||
ast_wdt.c | ||
at91sam9_wdt.c | ||
bcm6345_wdt.c | ||
booke_wdt.c | ||
cdns_wdt.c | ||
cortina_wdt.c | ||
designware_wdt.c | ||
ftwdt010_wdt.c | ||
imx_watchdog.c | ||
Kconfig | ||
Makefile | ||
mpc8xx_wdt.c | ||
mt7620_wdt.c | ||
mt7621_wdt.c | ||
mtk_wdt.c | ||
octeontx_wdt.c | ||
omap_wdt.c | ||
orion_wdt.c | ||
rti_wdt.c | ||
s5p_wdt.c | ||
sandbox_wdt.c | ||
sbsa_gwdt.c | ||
sp805_wdt.c | ||
stm32mp_wdt.c | ||
tangier_wdt.c | ||
ulp_wdog.c | ||
wdt-uclass.c | ||
xilinx_tb_wdt.c | ||
xilinx_wwdt.c |