Watchdog

This chapter provides an overview of the K3 RTI-Windowed Watchdog Timer (WWDT) driver, designed to support the watchdog functionality found in TI’s AM62x SoCs. The WWDT offers a digital windowed watchdog mechanism, where a specific time window is defined for servicing the watchdog. If the watchdog is serviced outside this configurable window or fails to be serviced within it, the system responds by generating an interrupt to the MCU Error Signaling Module (ESM). The ESM then processes these interrupts and, if necessary, triggers the reset logic to ensure the device is reset, maintaining system reliability.

Note

Per default we configure our BSPs to let the ESM module reset the devices. This is enabled by the u-boot bootloader through the CONFIG_ESM_K3 R5 config in combination with the esm-pins properties from the device tree.

Timeout configuration

Default user space program handling the keepalive signal in our BSP is systemd. The default timeout is set to 60 seconds, and systemd will pet the watchdog at intervals of timeout/2. Configuration for systemd can be found in /usr/lib/systemd/system.conf.d/10-watchdog.conf.

/usr/lib/systemd/system.conf.d/10-watchdog.conf
[Manager]
RuntimeWatchdogSec=60
RebootWatchdogSec=120

For more details please refer to systemd’s documentation: https://www.freedesktop.org/software/systemd/man/latest/systemd-system.conf.html

You can check what process is handling your watchdog device by simply checking what process holds the device handle.

journalctl
phyboard-lyra-am62xx-3:~# fuser /dev/watchdog0
1 # 1 is the process id of systemd

The timeout parameter for the watchdog module can be configured by specifying it through the kernel command line. For example by passing it by the bootloader (rti_wdt.heartbeat=10).

Set timeout
uboot:~# setenv mmcargs "setenv bootargs console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=/dev/mmcblk1p2 rootwait rw rti_wdt.heartbeat=10"
uboot:~# saveenv
uboot:~# boot

See your output to verify the modyfied timeout.

journalctl
phyboard-lyra-am62xx-3:~# journalctl | grep -i watchdog
phyboard-lyra-am62xx-3 systemd[1]: Using hardware watchdog 'K3 RTI Watchdog', version 0, device /dev/watchdog0
phyboard-lyra-am62xx-3 systemd[1]: Modifying watchdog timeout is not supported, reusing the programmed timeout.
phyboard-lyra-am62xx-3 systemd[1]: Watchdog running with a timeout of 10s.

Test system resets

Trigger a Kernel failure and see if your device is resetting:

Trigger Kernel panic
echo c > /proc/sysrq-trigger

Disable reset

The simplest way to prevent the reset is by disabling the CONFIG_ESM_K3 driver in U-Boot or modifying the ESM routing using the esm-pins configuration.