watchdog: Add the Watchdog Timer for the NXP S32 platform
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 10 Apr 2025 08:26:14 +0000 (10:26 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sat, 24 May 2025 14:57:54 +0000 (16:57 +0200)
commitbd3f54ec559b554671e5a683e05794abe3a609df
treea332287001d792bf7d3c6bc332cab06ae2945a4d
parent45421ffbb4af3d29110c8c2ec92e06f3fec5096f
watchdog: Add the Watchdog Timer for the NXP S32 platform

The S32 platform has several Watchdog Timer available and tied with a
CPU. The SWT0 is the only one which directly asserts the reset line,
other SWT require an external setup to configure the reset behavior
which is not part of this change.

As a side note, in the NXP documentation, the s32g2 and s32g3
reference manuals refer the watchdog as the 'Software Timer Watchdog'
where the name can be misleading as it is actually a hardware
watchdog.

The maximum watchdog timeout value depends on the clock feeding the
SWT counter which is 32bits wide. On the s32g274-rb2, the clock has a
rate of 51MHz which result on 83 seconds maximum timeout.

The timeout can be specified via the device tree with the usual
existing bindings 'timeout-sec' or via the module param timeout.

The watchdog can be loaded with the 'nowayout' option, preventing the
watchdog to be stopped.

The watchdog can be started at boot time with the 'early-enable'
option, thus letting the watchdog framework to service the watchdog
counter.

The watchdog support the magic character to stop when the userspace
releases the device.

Cc: Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
Cc: Thomas Fossati <thomas.fossati@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Alexandru-Catalin Ionita <alexandru-catalin.ionita@nxp.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250410082616.1855860-3-daniel.lezcano@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/Kconfig
drivers/watchdog/Makefile
drivers/watchdog/s32g_wdt.c [new file with mode: 0644]