watchdog: add pulse support to gpio watchdog driver

A common external watchdog circuit is kept alive by triggering a short
pulse on the reset pin. This patch adds support for this use case, while
making the algorithm configurable in the devicetree.

The "linux,wdt-gpio" driver being modified is based off the equivalent
driver in the Linux kernel, which provides support for this algorithm.
This patch brings parity to this driver, and is kept aligned with
the functionality and devicetree configuration in the kernel.

It should be noted that this adds a required property named 'hw_algo'
to the devicetree binding, following suit with the kernel. I'm happy to
make this backward-compatible if preferred.

Signed-off-by: Paul Doelle <paaull.git@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Paul Doelle
2022-07-04 09:00:25 +00:00
committed by Stefan Roese
parent 818055fd4e
commit 1fc45d6483
4 changed files with 90 additions and 15 deletions

View File

@@ -850,10 +850,19 @@
};
};
gpio-wdt {
wdt-gpio-toggle {
gpios = <&gpio_a 7 0>;
compatible = "linux,wdt-gpio";
hw_margin_ms = <100>;
hw_algo = "toggle";
always-running;
};
wdt-gpio-level {
gpios = <&gpio_a 7 0>;
compatible = "linux,wdt-gpio";
hw_margin_ms = <100>;
hw_algo = "level";
always-running;
};