* [PATCH v4 1/3] dt-bindings: watchdog: maxim,max63xx: Add wdi-gpios
2026-11-24 5:01 [PATCH v4 0/3] watchdog: max63xx_wdt: Support a WDI pin connected to a GPIO Josef Schlehofer
@ 2026-11-24 5:01 ` Josef Schlehofer
2026-11-24 5:01 ` [PATCH v4 2/3] watchdog: max63xx_wdt: Add support for specifying WDI logic via GPIO Josef Schlehofer
2026-11-24 5:01 ` [PATCH v4 3/3] powerpc: dts: turris1x.dts: Use wdi-gpios for the watchdog Josef Schlehofer
2 siblings, 0 replies; 6+ messages in thread
From: Josef Schlehofer @ 2026-11-24 5:01 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Pali Rohár, Marek Behún, Tzung-Bi Shih, Marc Zyngier,
Linus Walleij, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy (CS GROUP),
Ritesh Harjani (IBM),
Shrikanth Hegde, linux-watchdog, devicetree, linuxppc-dev,
linux-kernel
From: Pali Rohár <pali@kernel.org>
On some boards only the SET pins of the watchdog are mapped to the
register, and its WDI (watchdog input) pin is connected to a GPIO. The
CZ.NIC Turris 1.x routers are wired this way.
Add an optional wdi-gpios property for that GPIO.
Signed-off-by: Pali Rohár <pali@kernel.org>
[pepe.schlehofer@gmail.com: rename gpios to wdi-gpios, reword the description]
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
Notes:
Changes in v4:
- rename the property to wdi-gpios (Rob)
- wrap the description at 80 columns (Rob)
Changes in v3:
* Extend description
.../devicetree/bindings/watchdog/maxim,max63xx.yaml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/watchdog/maxim,max63xx.yaml b/Documentation/devicetree/bindings/watchdog/maxim,max63xx.yaml
index defe0401ded0..72f16d9f4596 100644
--- a/Documentation/devicetree/bindings/watchdog/maxim,max63xx.yaml
+++ b/Documentation/devicetree/bindings/watchdog/maxim,max63xx.yaml
@@ -28,6 +28,12 @@ properties:
description: This is a 1-byte memory-mapped address
maxItems: 1
+ wdi-gpios:
+ description:
+ GPIO connected to the WDI (watchdog input) pin, on boards where WDI is
+ not driven through the memory-mapped register.
+ maxItems: 1
+
required:
- compatible
- reg
--
2.54.0 (Apple Git-157)
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v4 2/3] watchdog: max63xx_wdt: Add support for specifying WDI logic via GPIO
2026-11-24 5:01 [PATCH v4 0/3] watchdog: max63xx_wdt: Support a WDI pin connected to a GPIO Josef Schlehofer
2026-11-24 5:01 ` [PATCH v4 1/3] dt-bindings: watchdog: maxim,max63xx: Add wdi-gpios Josef Schlehofer
@ 2026-11-24 5:01 ` Josef Schlehofer
2026-11-25 5:46 ` Tzung-Bi Shih
2026-11-24 5:01 ` [PATCH v4 3/3] powerpc: dts: turris1x.dts: Use wdi-gpios for the watchdog Josef Schlehofer
2 siblings, 1 reply; 6+ messages in thread
From: Josef Schlehofer @ 2026-11-24 5:01 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Pali Rohár, Marek Behún, Tzung-Bi Shih, Marc Zyngier,
Linus Walleij, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy (CS GROUP),
Ritesh Harjani (IBM),
Shrikanth Hegde, linux-watchdog, devicetree, linuxppc-dev,
linux-kernel
From: Pali Rohár <pali@kernel.org>
On some boards the WDI (watchdog input) pin of the chip is connected to
a GPIO, and only the SET pins are mapped to the register.
Take the GPIO from the optional wdi-gpios property. When it is present,
ping the watchdog through it instead of the register.
Signed-off-by: Pali Rohár <pali@kernel.org>
[pepe.schlehofer@gmail.com: use wdi-gpios, request the GPIO as an output
with devm_gpiod_get_optional(), ping without the lock, include
linux/delay.h, update the header comment]
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
Notes:
Changes in v4:
- take the GPIO from wdi-gpios
- request it with devm_gpiod_get_optional() (Tzung-Bi) and
GPIOD_OUT_LOW. v3 passed GPIOD_FLAGS_BIT_DIR_OUT alone, which sets
no direction
- ping without the lock, with gpiod_set_value_cansleep() (Tzung-Bi,
Guenter)
- include linux/delay.h (Tzung-Bi)
- print the error once (Tzung-Bi)
- say in the commit message that the GPIO replaces the register for
the ping (Tzung-Bi)
- update the comment at the top of the file
Changes in v3:
* Use gpiod_set_value()
Changes in v2:
* Usage of dev_err_probe()
* Fixing assignment of wdt->ping
* Remove clearing of wdt->gpio_wdi
* Move YAML change to separate patch
drivers/watchdog/max63xx_wdt.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/max63xx_wdt.c b/drivers/watchdog/max63xx_wdt.c
index 9e46b86b9b20..482cf9f6bd6e 100644
--- a/drivers/watchdog/max63xx_wdt.c
+++ b/drivers/watchdog/max63xx_wdt.c
@@ -7,8 +7,9 @@
* Copyright (C) 2009 Marc Zyngier <maz@misterjones.org>
*
* This driver assumes the watchdog pins are memory mapped (as it is
- * the case for the Arcom Zeus). Should it be connected over GPIOs or
- * another interface, some abstraction will have to be introduced.
+ * the case for the Arcom Zeus). The WDI pin can be connected to a GPIO
+ * instead. Should the other pins be connected over GPIOs or another
+ * interface, some abstraction will have to be introduced.
*/
#include <linux/err.h>
@@ -18,6 +19,8 @@
#include <linux/kernel.h>
#include <linux/watchdog.h>
#include <linux/bitops.h>
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <linux/io.h>
@@ -50,6 +53,9 @@ struct max63xx_wdt {
void __iomem *base;
spinlock_t lock;
+ /* optional GPIO connected to the WDI pin */
+ struct gpio_desc *gpio_wdi;
+
/* WDI and WSET bits write access routines */
void (*ping)(struct max63xx_wdt *wdt);
void (*set)(struct max63xx_wdt *wdt, u8 set);
@@ -155,6 +161,13 @@ static const struct watchdog_info max63xx_wdt_info = {
.identity = "max63xx Watchdog",
};
+static void max63xx_gpio_ping(struct max63xx_wdt *wdt)
+{
+ gpiod_set_value_cansleep(wdt->gpio_wdi, 1);
+ udelay(1);
+ gpiod_set_value_cansleep(wdt->gpio_wdi, 0);
+}
+
static void max63xx_mmap_ping(struct max63xx_wdt *wdt)
{
u8 val;
@@ -226,6 +239,13 @@ static int max63xx_wdt_probe(struct platform_device *pdev)
if (err)
return err;
+ wdt->gpio_wdi = devm_gpiod_get_optional(dev, "wdi", GPIOD_OUT_LOW);
+ if (IS_ERR(wdt->gpio_wdi))
+ return dev_err_probe(dev, PTR_ERR(wdt->gpio_wdi),
+ "failed to get the WDI GPIO\n");
+ if (wdt->gpio_wdi)
+ wdt->ping = max63xx_gpio_ping;
+
platform_set_drvdata(pdev, &wdt->wdd);
watchdog_set_drvdata(&wdt->wdd, wdt);
--
2.54.0 (Apple Git-157)
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v4 2/3] watchdog: max63xx_wdt: Add support for specifying WDI logic via GPIO
2026-11-24 5:01 ` [PATCH v4 2/3] watchdog: max63xx_wdt: Add support for specifying WDI logic via GPIO Josef Schlehofer
@ 2026-11-25 5:46 ` Tzung-Bi Shih
0 siblings, 0 replies; 6+ messages in thread
From: Tzung-Bi Shih @ 2026-11-25 5:46 UTC (permalink / raw)
To: Josef Schlehofer
Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Pali Rohár,
Marek Behún, Marc Zyngier, Linus Walleij,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Ritesh Harjani (IBM),
Shrikanth Hegde, linux-watchdog, devicetree, linuxppc-dev,
linux-kernel
On Tue, Nov 24, 2026 at 06:01:17AM +0100, Josef Schlehofer wrote:
> From: Pali Rohár <pali@kernel.org>
>
> On some boards the WDI (watchdog input) pin of the chip is connected to
> a GPIO, and only the SET pins are mapped to the register.
>
> Take the GPIO from the optional wdi-gpios property. When it is present,
> ping the watchdog through it instead of the register.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>
> [pepe.schlehofer@gmail.com: use wdi-gpios, request the GPIO as an output
> with devm_gpiod_get_optional(), ping without the lock, include
> linux/delay.h, update the header comment]
> Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
The patch looks good to me,
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4 3/3] powerpc: dts: turris1x.dts: Use wdi-gpios for the watchdog
2026-11-24 5:01 [PATCH v4 0/3] watchdog: max63xx_wdt: Support a WDI pin connected to a GPIO Josef Schlehofer
2026-11-24 5:01 ` [PATCH v4 1/3] dt-bindings: watchdog: maxim,max63xx: Add wdi-gpios Josef Schlehofer
2026-11-24 5:01 ` [PATCH v4 2/3] watchdog: max63xx_wdt: Add support for specifying WDI logic via GPIO Josef Schlehofer
@ 2026-11-24 5:01 ` Josef Schlehofer
2026-11-24 9:12 ` Madhavan Srinivasan
2 siblings, 1 reply; 6+ messages in thread
From: Josef Schlehofer @ 2026-11-24 5:01 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Pali Rohár, Marek Behún, Tzung-Bi Shih, Marc Zyngier,
Linus Walleij, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy (CS GROUP),
Ritesh Harjani (IBM),
Shrikanth Hegde, linux-watchdog, devicetree, linuxppc-dev,
linux-kernel
The watchdog node passes its WDI GPIO in a gpios property, which the
maxim,max63xx binding does not define and the max63xx_wdt driver does
not read. dtbs_check reports it for watchdog@2:
Unevaluated properties are not allowed ('gpios' was unexpected)
Rename it to wdi-gpios, which the binding defines and the driver reads.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
Notes:
Changes in v4:
- new patch
arch/powerpc/boot/dts/turris1x.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/boot/dts/turris1x.dts b/arch/powerpc/boot/dts/turris1x.dts
index dff1ea074d9d..494a96a1f78c 100644
--- a/arch/powerpc/boot/dts/turris1x.dts
+++ b/arch/powerpc/boot/dts/turris1x.dts
@@ -363,7 +363,7 @@
*/
compatible = "maxim,max6370";
reg = <0x02 0x01>;
- gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+ wdi-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
reboot@d {
--
2.54.0 (Apple Git-157)
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v4 3/3] powerpc: dts: turris1x.dts: Use wdi-gpios for the watchdog
2026-11-24 5:01 ` [PATCH v4 3/3] powerpc: dts: turris1x.dts: Use wdi-gpios for the watchdog Josef Schlehofer
@ 2026-11-24 9:12 ` Madhavan Srinivasan
0 siblings, 0 replies; 6+ messages in thread
From: Madhavan Srinivasan @ 2026-11-24 9:12 UTC (permalink / raw)
To: Josef Schlehofer, Wim Van Sebroeck, Guenter Roeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Pali Rohár, Marek Behún, Tzung-Bi Shih, Marc Zyngier,
Linus Walleij, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Ritesh Harjani (IBM),
Shrikanth Hegde, linux-watchdog, devicetree, linuxppc-dev,
linux-kernel
On 11/24/26 10:31 AM, Josef Schlehofer wrote:
> The watchdog node passes its WDI GPIO in a gpios property, which the
> maxim,max63xx binding does not define and the max63xx_wdt driver does
> not read. dtbs_check reports it for watchdog@2:
>
> Unevaluated properties are not allowed ('gpios' was unexpected)
>
> Rename it to wdi-gpios, which the binding defines and the driver reads.
Acked-by: Madhavan Srinivasan <maddy@linux.ibm.com>
> Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
> ---
>
> Notes:
> Changes in v4:
> - new patch
>
> arch/powerpc/boot/dts/turris1x.dts | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/boot/dts/turris1x.dts b/arch/powerpc/boot/dts/turris1x.dts
> index dff1ea074d9d..494a96a1f78c 100644
> --- a/arch/powerpc/boot/dts/turris1x.dts
> +++ b/arch/powerpc/boot/dts/turris1x.dts
> @@ -363,7 +363,7 @@
> */
> compatible = "maxim,max6370";
> reg = <0x02 0x01>;
> - gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
> + wdi-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
> };
>
> reboot@d {
^ permalink raw reply [flat|nested] 6+ messages in thread