watchdog: Automatically register device with sysreset

Add an option to automatically register watchdog devices with the
wdt_reboot driver for use with sysreset. This allows sysreset to be a
drop-in replacement for platform-specific watchdog reset code, without
needing any device tree changes.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Samuel Holland
2021-11-03 22:55:14 -05:00
committed by Stefan Roese
parent 5544a01142
commit a8f63d18bb
4 changed files with 49 additions and 0 deletions

View File

@@ -133,4 +133,14 @@ void sysreset_walk_halt(enum sysreset_t type);
*/
void reset_cpu(void);
/**
* sysreset_register_wdt() - register a watchdog for use with sysreset
*
* This registers the given watchdog timer to be used to reset the system.
*
* @dev: WDT device
* @return: 0 if OK, -errno if error
*/
int sysreset_register_wdt(struct udevice *dev);
#endif