devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] watchdog: add Renesas Window Watchdog support
@ 2025-10-14 11:29 Wolfram Sang
  2025-10-14 11:29 ` [PATCH v2 1/2] dt-bindings: watchdog: Add Renesas WWDT Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2025-10-14 11:29 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Conor Dooley, devicetree, Geert Uytterhoeven,
	Guenter Roeck, Krzysztof Kozlowski, linux-watchdog, Magnus Damm,
	Rob Herring, Wim Van Sebroeck

This Window Watchdog is a little peculiar because it can only be setup
once but we cannot find out if this write already happened. So,
configuration is delegated to the firmware/bootloader and the driver
will adapt to whatever is configured. The driver handles all bits
described in the datasheets. This is really all there is.

Tested on a SparrowHawk board (Renesas R-Car V4H). Based on v6.18-rc1
and build bot is already happy. Passes also binding checks and dtb
checks here.

Big picture change since v1 (details mentioned per patch):

* support not only V4H but all Gen3/4 SoCs having this WWDT

Looking forward to comments!


Wolfram Sang (2):
  dt-bindings: watchdog: Add Renesas WWDT
  watchdog: renesas_wwdt: add driver

 .../watchdog/renesas,rcar-gen3-wwdt.yaml      | 114 ++++++++++++
 drivers/watchdog/Kconfig                      |   8 +
 drivers/watchdog/Makefile                     |   1 +
 drivers/watchdog/renesas_wwdt.c               | 163 ++++++++++++++++++
 4 files changed, 286 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,rcar-gen3-wwdt.yaml
 create mode 100644 drivers/watchdog/renesas_wwdt.c

-- 
2.47.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 1/2] dt-bindings: watchdog: Add Renesas WWDT
  2025-10-14 11:29 [PATCH v2 0/2] watchdog: add Renesas Window Watchdog support Wolfram Sang
@ 2025-10-14 11:29 ` Wolfram Sang
  2025-10-17 20:34   ` Rob Herring (Arm)
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2025-10-14 11:29 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Wim Van Sebroeck, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm, linux-watchdog, devicetree

Describe the Window Watchdog Timer found on Renesas R-Car SoCs from late
Gen3 onwards.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Note: Despite the name, V3U is considered to be a Gen4 SoC.

Changes since v1:

* support not only V4H but all Gen3/4 SoCs having this WWDT
* handle the two-resets exception for V3U and S4
* switch order of clocks, so it is the same as for the resets
  (for resets, "cnt" is always present and "bus" is optional)
* rename the file to match the base compatible
* require interrupts and resets
* drop unneeded label from the example

 .../watchdog/renesas,rcar-gen3-wwdt.yaml      | 114 ++++++++++++++++++
 1 file changed, 114 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,rcar-gen3-wwdt.yaml

diff --git a/Documentation/devicetree/bindings/watchdog/renesas,rcar-gen3-wwdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,rcar-gen3-wwdt.yaml
new file mode 100644
index 000000000000..ffafe9a6d3f5
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/renesas,rcar-gen3-wwdt.yaml
@@ -0,0 +1,114 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/renesas,rcar-gen3-wwdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Window Watchdog Timer (WWDT) Controller
+
+maintainers:
+  - Wolfram Sang <wsa+renesas@sang-engineering.com>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - renesas,r8a77970-wwdt  # R-Car V3M
+              - renesas,r8a77980-wwdt  # R-Car V3H
+          - const: renesas,rcar-gen3-wwdt
+
+      - items:
+          - enum:
+              - renesas,r8a779a0-wwdt  # R-Car V3U
+              - renesas,r8a779f0-wwdt  # R-Car S4
+              - renesas,r8a779g0-wwdt  # R-Car V4H
+              - renesas,r8a779h0-wwdt  # R-Car V4M
+          - const: renesas,rcar-gen4-wwdt
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    items:
+      - description: Pretimeout, 75% of overflow reached
+      - description: Error occurred
+
+  interrupt-names:
+    items:
+      - const: pretimeout
+      - const: error
+
+  clocks:
+    items:
+      - description: Counting clock
+      - description: Bus clock
+
+  clock-names:
+    items:
+      - const: cnt
+      - const: bus
+
+  resets:
+    minItems: 1
+    maxItems: 2
+
+  reset-names:
+    minItems: 1
+    items:
+      - const: cnt
+      - const: bus
+
+  power-domains:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+  - power-domains
+
+allOf:
+  - $ref: watchdog.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - renesas,r8a779a0-wwdt
+              - renesas,r8a779f0-wwdt
+    then:
+      properties:
+        resets:
+          minItems: 2
+        reset-names:
+          minItems: 2
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a779g0-cpg-mssr.h>
+    #include <dt-bindings/power/r8a779g0-sysc.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    watchdog@ffc90000 {
+            compatible = "renesas,r8a779g0-wwdt",
+                         "renesas,rcar-gen4-wwdt";
+            reg = <0xffc90000 0x10>;
+            interrupts = <GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH>;
+            interrupt-names = "pretimeout", "error";
+            clocks = <&cpg CPG_CORE R8A779G0_CLK_R>,
+                     <&cpg CPG_CORE R8A779G0_CLK_SASYNCRT>;
+            clock-names = "cnt", "bus";
+            power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+            resets = <&cpg 1200>;
+            reset-names = "cnt";
+    };
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: watchdog: Add Renesas WWDT
  2025-10-14 11:29 ` [PATCH v2 1/2] dt-bindings: watchdog: Add Renesas WWDT Wolfram Sang
@ 2025-10-17 20:34   ` Rob Herring (Arm)
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring (Arm) @ 2025-10-17 20:34 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Guenter Roeck, Wim Van Sebroeck, linux-watchdog,
	Krzysztof Kozlowski, Conor Dooley, devicetree, Geert Uytterhoeven,
	Magnus Damm, linux-renesas-soc


On Tue, 14 Oct 2025 13:29:53 +0200, Wolfram Sang wrote:
> Describe the Window Watchdog Timer found on Renesas R-Car SoCs from late
> Gen3 onwards.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> Note: Despite the name, V3U is considered to be a Gen4 SoC.
> 
> Changes since v1:
> 
> * support not only V4H but all Gen3/4 SoCs having this WWDT
> * handle the two-resets exception for V3U and S4
> * switch order of clocks, so it is the same as for the resets
>   (for resets, "cnt" is always present and "bus" is optional)
> * rename the file to match the base compatible
> * require interrupts and resets
> * drop unneeded label from the example
> 
>  .../watchdog/renesas,rcar-gen3-wwdt.yaml      | 114 ++++++++++++++++++
>  1 file changed, 114 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,rcar-gen3-wwdt.yaml
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-17 20:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14 11:29 [PATCH v2 0/2] watchdog: add Renesas Window Watchdog support Wolfram Sang
2025-10-14 11:29 ` [PATCH v2 1/2] dt-bindings: watchdog: Add Renesas WWDT Wolfram Sang
2025-10-17 20:34   ` Rob Herring (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).