From 091303c788c2360d6ec0bf1b315d160b3b556a07 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Fri, 23 May 2025 11:46:55 +0200 Subject: watchdog: wdt-uclass.c: add wdt_set_force_autostart() helper The watchdog could have been already started by a previous boot stage (e.g. bootrom or secure OS). U-Boot has to start and kick the watchdog even when CONFIG_WATCHDOG_AUTOSTART is not enabled or when the DT property u-boot,noautostart is present. Add the helper wdt_set_force_autostart() that can be called by the driver's probe() when it detects that the watchdog has already been started and is running. Co-developed-by: Patrice Chotard Signed-off-by: Patrice Chotard Signed-off-by: Antonio Borneo Reviewed-by: Patrice Chotard --- include/wdt.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/wdt.h b/include/wdt.h index 5026f5a6db4..1ef656585c4 100644 --- a/include/wdt.h +++ b/include/wdt.h @@ -18,6 +18,15 @@ struct udevice; * which typically include placing the system in a safe, known state. */ +/* + * Force watchdog start during init. Called by driver's probe when the watchdog + * is detected as already started. + * + * @dev: WDT Device + * @return: 0 if OK, -ve on error + */ +int wdt_set_force_autostart(struct udevice *dev); + /* * Start the timer * -- cgit v1.3.1