* [PATCH v2 1/4] dt-bindings: watchdog: factor out RZ/A watchdog
2025-10-05 14:44 [PATCH v2 0/4] dt-bindings: watchdog: factor out RZ watchdogs Wolfram Sang
@ 2025-10-05 14:44 ` Wolfram Sang
2025-10-05 14:44 ` [PATCH v2 2/4] dt-bindings: watchdog: factor out RZ/N1 watchdog Wolfram Sang
` (2 subsequent siblings)
3 siblings, 0 replies; 16+ messages in thread
From: Wolfram Sang @ 2025-10-05 14:44 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Guenter Roeck, Lad Prabhakar, Wim Van Sebroeck,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, linux-watchdog, devicetree
Renesas created different watchdog IPs but they are all handled in the
same binding documentation. This leads to a lot of conditional handling
which makes it unnecessarily hard to add new items. Factor out the RZ/A
watchdog to make handling easier.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Changes since v1:
* removed unneeded label from example (Thanks, Prabhakar)
* added tags from Guenter and Prabhakar (Thanks!)
.../bindings/watchdog/renesas,rza-wdt.yaml | 51 +++++++++++++++++++
.../bindings/watchdog/renesas,wdt.yaml | 7 ---
2 files changed, 51 insertions(+), 7 deletions(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,rza-wdt.yaml
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,rza-wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,rza-wdt.yaml
new file mode 100644
index 000000000000..ba922c3f7b10
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/renesas,rza-wdt.yaml
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/renesas,rza-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/A Watchdog Timer (WDT) Controller
+
+maintainers:
+ - Wolfram Sang <wsa+renesas@sang-engineering.com>
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - renesas,r7s72100-wdt # RZ/A1
+ - renesas,r7s9210-wdt # RZ/A2
+ - const: renesas,rza-wdt # RZ/A
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ timeout-sec: true
+
+required:
+ - compatible
+ - reg
+ - clocks
+
+allOf:
+ - $ref: watchdog.yaml#
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/r7s72100-clock.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ watchdog@fcfe0000 {
+ compatible = "renesas,r7s72100-wdt", "renesas,rza-wdt";
+ reg = <0xfcfe0000 0x6>;
+ interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&p0_clk>;
+ };
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
index b6e60162c263..8a25e0c6271f 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
@@ -13,12 +13,6 @@ maintainers:
properties:
compatible:
oneOf:
- - items:
- - enum:
- - renesas,r7s72100-wdt # RZ/A1
- - renesas,r7s9210-wdt # RZ/A2
- - const: renesas,rza-wdt # RZ/A
-
- items:
- enum:
- renesas,r9a06g032-wdt # RZ/N1D
@@ -140,7 +134,6 @@ allOf:
contains:
enum:
- renesas,r9a09g077-wdt
- - renesas,rza-wdt
- renesas,rzn1-wdt
then:
required:
--
2.47.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v2 2/4] dt-bindings: watchdog: factor out RZ/N1 watchdog
2025-10-05 14:44 [PATCH v2 0/4] dt-bindings: watchdog: factor out RZ watchdogs Wolfram Sang
2025-10-05 14:44 ` [PATCH v2 1/4] dt-bindings: watchdog: factor out RZ/A watchdog Wolfram Sang
@ 2025-10-05 14:44 ` Wolfram Sang
2025-10-05 14:44 ` [PATCH v2 3/4] dt-bindings: watchdog: factor out RZ/G2L watchdog Wolfram Sang
2025-10-05 14:44 ` [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog Wolfram Sang
3 siblings, 0 replies; 16+ messages in thread
From: Wolfram Sang @ 2025-10-05 14:44 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Guenter Roeck, Lad Prabhakar, Wim Van Sebroeck,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, linux-watchdog, devicetree
Renesas created different watchdog IPs but they are all handled in the
same binding documentation. This leads to a lot of conditional handling
which makes it unnecessarily hard to add new items. Factor out the RZ/N1
watchdog to make handling easier.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Changes since v1:
* turned N1D compatible into a const (Thanks, Prabhakar)
* removed unneeded label from example (Thanks, Prabhakar)
* added tags from Guenter and Prabhakar (Thanks!)
.../bindings/watchdog/renesas,rzn1-wdt.yaml | 48 +++++++++++++++++++
.../bindings/watchdog/renesas,wdt.yaml | 6 ---
2 files changed, 48 insertions(+), 6 deletions(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
new file mode 100644
index 000000000000..0efc9a92fa51
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/renesas,rzn1-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/N1 Watchdog Timer (WDT) Controller
+
+maintainers:
+ - Wolfram Sang <wsa+renesas@sang-engineering.com>
+
+properties:
+ compatible:
+ items:
+ - const: renesas,r9a06g032-wdt # RZ/N1D
+ - const: renesas,rzn1-wdt # RZ/N1
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+
+allOf:
+ - $ref: watchdog.yaml#
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/r9a06g032-sysctrl.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ watchdog@40008000 {
+ compatible = "renesas,r9a06g032-wdt", "renesas,rzn1-wdt";
+ reg = <0x40008000 0x1000>;
+ interrupts = <GIC_SPI 73 IRQ_TYPE_EDGE_RISING>;
+ clocks = <&sysctrl R9A06G032_CLK_WATCHDOG>;
+ };
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
index 8a25e0c6271f..12ba07781763 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
@@ -13,11 +13,6 @@ maintainers:
properties:
compatible:
oneOf:
- - items:
- - enum:
- - renesas,r9a06g032-wdt # RZ/N1D
- - const: renesas,rzn1-wdt # RZ/N1
-
- items:
- enum:
- renesas,r9a07g043-wdt # RZ/G2UL and RZ/Five
@@ -134,7 +129,6 @@ allOf:
contains:
enum:
- renesas,r9a09g077-wdt
- - renesas,rzn1-wdt
then:
required:
- power-domains
--
2.47.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH v2 3/4] dt-bindings: watchdog: factor out RZ/G2L watchdog
2025-10-05 14:44 [PATCH v2 0/4] dt-bindings: watchdog: factor out RZ watchdogs Wolfram Sang
2025-10-05 14:44 ` [PATCH v2 1/4] dt-bindings: watchdog: factor out RZ/A watchdog Wolfram Sang
2025-10-05 14:44 ` [PATCH v2 2/4] dt-bindings: watchdog: factor out RZ/N1 watchdog Wolfram Sang
@ 2025-10-05 14:44 ` Wolfram Sang
2025-10-05 16:04 ` Biju Das
2025-10-05 14:44 ` [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog Wolfram Sang
3 siblings, 1 reply; 16+ messages in thread
From: Wolfram Sang @ 2025-10-05 14:44 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Guenter Roeck, Lad Prabhakar, Wim Van Sebroeck,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Biju Das, linux-watchdog,
devicetree
Renesas created different watchdog IPs but they are all handled in the
same binding documentation. This leads to a lot of conditional handling
which makes it unnecessarily hard to add new items. Factor out the
RZ/G2L watchdog to make handling easier.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Changes since v1:
* dropped 'interrupt-names' for RZ/V2M (Thanks, Prabhakar)
* removed unneeded label from example (Thanks, Prabhakar)
* added tags from Guenter and Prabhakar (Thanks!)
.../bindings/watchdog/renesas,rzg2l-wdt.yaml | 112 ++++++++++++++++++
.../bindings/watchdog/renesas,wdt.yaml | 45 +------
2 files changed, 113 insertions(+), 44 deletions(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,rzg2l-wdt.yaml
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,rzg2l-wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,rzg2l-wdt.yaml
new file mode 100644
index 000000000000..7543e6528f48
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/renesas,rzg2l-wdt.yaml
@@ -0,0 +1,112 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/renesas,rzg2l-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/G2L Watchdog Timer (WDT) Controller
+
+maintainers:
+ - Biju Das <biju.das.jz@bp.renesas.com>
+
+properties:
+ compatible:
+ oneOf:
+ - items:
+ - enum:
+ - renesas,r9a07g043-wdt # RZ/G2UL and RZ/Five
+ - renesas,r9a07g044-wdt # RZ/G2{L,LC}
+ - renesas,r9a07g054-wdt # RZ/V2L
+ - renesas,r9a08g045-wdt # RZ/G3S
+ - const: renesas,rzg2l-wdt
+
+ - items:
+ - enum:
+ - renesas,r9a09g011-wdt # RZ/V2M
+ - const: renesas,rzv2m-wdt # RZ/V2M
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ minItems: 1
+ items:
+ - description: Timeout
+ - description: Parity error
+
+ interrupt-names:
+ minItems: 1
+ items:
+ - const: wdt
+ - const: perrout
+
+ clocks:
+ items:
+ - description: Register access clock
+ - description: Main clock
+
+ clock-names:
+ items:
+ - const: pclk
+ - const: oscclk
+
+ power-domains:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ timeout-sec: true
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - clock-names
+ - power-domains
+ - resets
+
+allOf:
+ - $ref: watchdog.yaml#
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - renesas,rzg2l-wdt
+ then:
+ properties:
+ interrupts:
+ minItems: 2
+ interrupt-names:
+ minItems: 2
+ required:
+ - interrupt-names
+ else:
+ properties:
+ interrupts:
+ maxItems: 1
+ interrupt-names: false
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/r9a07g044-cpg.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ watchdog@12800800 {
+ compatible = "renesas,r9a07g044-wdt",
+ "renesas,rzg2l-wdt";
+ reg = <0x12800800 0x400>;
+ clocks = <&cpg CPG_MOD R9A07G044_WDT0_PCLK>,
+ <&cpg CPG_MOD R9A07G044_WDT0_CLK>;
+ clock-names = "pclk", "oscclk";
+ interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "wdt", "perrout";
+ resets = <&cpg R9A07G044_WDT0_PRESETN>;
+ power-domains = <&cpg>;
+ };
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
index 12ba07781763..2a15c012fd67 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
@@ -13,19 +13,6 @@ maintainers:
properties:
compatible:
oneOf:
- - items:
- - enum:
- - renesas,r9a07g043-wdt # RZ/G2UL and RZ/Five
- - renesas,r9a07g044-wdt # RZ/G2{L,LC}
- - renesas,r9a07g054-wdt # RZ/V2L
- - renesas,r9a08g045-wdt # RZ/G3S
- - const: renesas,rzg2l-wdt
-
- - items:
- - enum:
- - renesas,r9a09g011-wdt # RZ/V2M
- - const: renesas,rzv2m-wdt # RZ/V2M
-
- items:
- enum:
- renesas,r8a7742-wdt # RZ/G1H
@@ -83,16 +70,7 @@ properties:
maxItems: 2
interrupts:
- minItems: 1
- items:
- - description: Timeout
- - description: Parity error
-
- interrupt-names:
- minItems: 1
- items:
- - const: wdt
- - const: perrout
+ maxItems: 1
clocks:
minItems: 1
@@ -140,8 +118,6 @@ allOf:
contains:
enum:
- renesas,r9a09g057-wdt
- - renesas,rzg2l-wdt
- - renesas,rzv2m-wdt
then:
properties:
clocks:
@@ -155,25 +131,6 @@ allOf:
clocks:
maxItems: 1
- - if:
- properties:
- compatible:
- contains:
- enum:
- - renesas,rzg2l-wdt
- then:
- properties:
- interrupts:
- minItems: 2
- interrupt-names:
- minItems: 2
- required:
- - interrupt-names
- else:
- properties:
- interrupts:
- maxItems: 1
-
- if:
properties:
compatible:
--
2.47.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* RE: [PATCH v2 3/4] dt-bindings: watchdog: factor out RZ/G2L watchdog
2025-10-05 14:44 ` [PATCH v2 3/4] dt-bindings: watchdog: factor out RZ/G2L watchdog Wolfram Sang
@ 2025-10-05 16:04 ` Biju Das
0 siblings, 0 replies; 16+ messages in thread
From: Biju Das @ 2025-10-05 16:04 UTC (permalink / raw)
To: wsa+renesas, linux-renesas-soc@vger.kernel.org
Cc: wsa+renesas, Guenter Roeck, Prabhakar Mahadev Lad,
Wim Van Sebroeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
Hi Wolfram,
> -----Original Message-----
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Sent: 05 October 2025 15:44
> Subject: [PATCH v2 3/4] dt-bindings: watchdog: factor out RZ/G2L watchdog
>
> Renesas created different watchdog IPs but they are all handled in the same binding documentation. This
> leads to a lot of conditional handling which makes it unnecessarily hard to add new items. Factor out
> the RZ/G2L watchdog to make handling easier.
>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
>
> Changes since v1:
> * dropped 'interrupt-names' for RZ/V2M (Thanks, Prabhakar)
> * removed unneeded label from example (Thanks, Prabhakar)
> * added tags from Guenter and Prabhakar (Thanks!)
>
> .../bindings/watchdog/renesas,rzg2l-wdt.yaml | 112 ++++++++++++++++++
> .../bindings/watchdog/renesas,wdt.yaml | 45 +------
> 2 files changed, 113 insertions(+), 44 deletions(-) create mode 100644
> Documentation/devicetree/bindings/watchdog/renesas,rzg2l-wdt.yaml
>
> diff --git a/Documentation/devicetree/bindings/watchdog/renesas,rzg2l-wdt.yaml
> b/Documentation/devicetree/bindings/watchdog/renesas,rzg2l-wdt.yaml
> new file mode 100644
> index 000000000000..7543e6528f48
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/watchdog/renesas,rzg2l-wdt.yaml
> @@ -0,0 +1,112 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/watchdog/renesas,rzg2l-wdt.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas RZ/G2L Watchdog Timer (WDT) Controller
> +
> +maintainers:
> + - Biju Das <biju.das.jz@bp.renesas.com>
> +
> +properties:
> + compatible:
> + oneOf:
> + - items:
> + - enum:
> + - renesas,r9a07g043-wdt # RZ/G2UL and RZ/Five
> + - renesas,r9a07g044-wdt # RZ/G2{L,LC}
> + - renesas,r9a07g054-wdt # RZ/V2L
> + - renesas,r9a08g045-wdt # RZ/G3S
> + - const: renesas,rzg2l-wdt
> +
> + - items:
> + - enum:
> + - renesas,r9a09g011-wdt # RZ/V2M
> + - const: renesas,rzv2m-wdt # RZ/V2M
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + minItems: 1
> + items:
> + - description: Timeout
> + - description: Parity error
> +
> + interrupt-names:
> + minItems: 1
> + items:
> + - const: wdt
> + - const: perrout
> +
> + clocks:
> + items:
> + - description: Register access clock
> + - description: Main clock
> +
> + clock-names:
> + items:
> + - const: pclk
> + - const: oscclk
> +
> + power-domains:
> + maxItems: 1
> +
> + resets:
> + maxItems: 1
> +
> + timeout-sec: true
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> + - clock-names
> + - power-domains
> + - resets
> +
> +allOf:
> + - $ref: watchdog.yaml#
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - renesas,rzg2l-wdt
> + then:
> + properties:
> + interrupts:
> + minItems: 2
> + interrupt-names:
> + minItems: 2
> + required:
> + - interrupt-names
> + else:
> + properties:
> + interrupts:
> + maxItems: 1
> + interrupt-names: false
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/r9a07g044-cpg.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> + watchdog@12800800 {
> + compatible = "renesas,r9a07g044-wdt",
> + "renesas,rzg2l-wdt";
> + reg = <0x12800800 0x400>;
> + clocks = <&cpg CPG_MOD R9A07G044_WDT0_PCLK>,
> + <&cpg CPG_MOD R9A07G044_WDT0_CLK>;
> + clock-names = "pclk", "oscclk";
> + interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "wdt", "perrout";
> + resets = <&cpg R9A07G044_WDT0_PRESETN>;
> + power-domains = <&cpg>;
> + };
> diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> index 12ba07781763..2a15c012fd67 100644
> --- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> @@ -13,19 +13,6 @@ maintainers:
> properties:
> compatible:
> oneOf:
> - - items:
> - - enum:
> - - renesas,r9a07g043-wdt # RZ/G2UL and RZ/Five
> - - renesas,r9a07g044-wdt # RZ/G2{L,LC}
> - - renesas,r9a07g054-wdt # RZ/V2L
> - - renesas,r9a08g045-wdt # RZ/G3S
> - - const: renesas,rzg2l-wdt
> -
> - - items:
> - - enum:
> - - renesas,r9a09g011-wdt # RZ/V2M
> - - const: renesas,rzv2m-wdt # RZ/V2M
> -
> - items:
> - enum:
> - renesas,r8a7742-wdt # RZ/G1H
> @@ -83,16 +70,7 @@ properties:
> maxItems: 2
>
> interrupts:
> - minItems: 1
> - items:
> - - description: Timeout
> - - description: Parity error
> -
> - interrupt-names:
> - minItems: 1
> - items:
> - - const: wdt
> - - const: perrout
> + maxItems: 1
>
> clocks:
> minItems: 1
> @@ -140,8 +118,6 @@ allOf:
> contains:
> enum:
> - renesas,r9a09g057-wdt
> - - renesas,rzg2l-wdt
> - - renesas,rzv2m-wdt
> then:
> properties:
> clocks:
> @@ -155,25 +131,6 @@ allOf:
> clocks:
> maxItems: 1
>
> - - if:
> - properties:
> - compatible:
> - contains:
> - enum:
> - - renesas,rzg2l-wdt
> - then:
> - properties:
> - interrupts:
> - minItems: 2
> - interrupt-names:
> - minItems: 2
> - required:
> - - interrupt-names
> - else:
> - properties:
> - interrupts:
> - maxItems: 1
> -
> - if:
> properties:
> compatible:
> --
> 2.47.2
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-05 14:44 [PATCH v2 0/4] dt-bindings: watchdog: factor out RZ watchdogs Wolfram Sang
` (2 preceding siblings ...)
2025-10-05 14:44 ` [PATCH v2 3/4] dt-bindings: watchdog: factor out RZ/G2L watchdog Wolfram Sang
@ 2025-10-05 14:44 ` Wolfram Sang
2025-10-05 16:07 ` Biju Das
2025-10-06 8:39 ` Wolfram Sang
3 siblings, 2 replies; 16+ messages in thread
From: Wolfram Sang @ 2025-10-05 14:44 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Guenter Roeck, Lad Prabhakar, Wim Van Sebroeck,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, linux-watchdog, devicetree
Renesas created different watchdog IPs but they are all handled in the
same binding documentation. This leads to a lot of conditional handling
which makes it unnecessarily hard to add new items. Factor out the
RZ/V2H(P) watchdog to make handling easier.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Changes since v1:
* moved 'clock-names' and 'power-domains' to top-level 'required:'
(Thanks, Prabhakar)
* removed unneeded label from example (Thanks, Prabhakar)
* added tags from Guenter and Prabhakar (Thanks!)
.../watchdog/renesas,r9a09g057-wdt.yaml | 110 ++++++++++++++++++
.../bindings/watchdog/renesas,wdt.yaml | 97 +--------------
2 files changed, 115 insertions(+), 92 deletions(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
new file mode 100644
index 000000000000..1c1c464b95e6
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
@@ -0,0 +1,110 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/renesas,r9a09g057-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/V2H(P) Watchdog Timer (WDT) Controller
+
+maintainers:
+ - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
+
+properties:
+ compatible:
+ oneOf:
+ - items:
+ - enum:
+ - renesas,r9a09g047-wdt # RZ/G3E
+ - renesas,r9a09g056-wdt # RZ/V2N
+ - const: renesas,r9a09g057-wdt # RZ/V2H(P)
+
+ - enum:
+ - renesas,r9a09g057-wdt # RZ/V2H(P)
+ - renesas,r9a09g077-wdt # RZ/T2H
+
+ - items:
+ - const: renesas,r9a09g087-wdt # RZ/N2H
+ - const: renesas,r9a09g077-wdt # RZ/T2H
+
+ reg:
+ minItems: 1
+ maxItems: 2
+
+ clocks:
+ minItems: 1
+ items:
+ - description: Register access clock
+ - description: Main clock
+
+ clock-names:
+ minItems: 1
+ items:
+ - const: pclk
+ - const: oscclk
+
+ power-domains:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ timeout-sec: true
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - power-domains
+
+allOf:
+ - $ref: watchdog.yaml#
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - renesas,r9a09g057-wdt
+ then:
+ properties:
+ clocks:
+ minItems: 2
+ clock-names:
+ minItems: 2
+ else:
+ properties:
+ clocks:
+ maxItems: 1
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a09g077-wdt
+ then:
+ properties:
+ resets: false
+ clock-names:
+ maxItems: 1
+ reg:
+ minItems: 2
+ else:
+ properties:
+ reg:
+ maxItems: 1
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/renesas,r9a09g057-cpg.h>
+
+ watchdog@11c00400 {
+ compatible = "renesas,r9a09g057-wdt";
+ reg = <0x11c00400 0x400>;
+ clocks = <&cpg CPG_MOD 0x4b>, <&cpg CPG_MOD 0x4c>;
+ clock-names = "pclk", "oscclk";
+ resets = <&cpg 0x75>;
+ power-domains = <&cpg>;
+ };
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
index 2a15c012fd67..08ba128bf442 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
@@ -51,38 +51,14 @@ properties:
- renesas,r8a779h0-wdt # R-Car V4M
- const: renesas,rcar-gen4-wdt # R-Car Gen4
- - items:
- - enum:
- - renesas,r9a09g047-wdt # RZ/G3E
- - renesas,r9a09g056-wdt # RZ/V2N
- - const: renesas,r9a09g057-wdt # RZ/V2H(P)
-
- - enum:
- - renesas,r9a09g057-wdt # RZ/V2H(P)
- - renesas,r9a09g077-wdt # RZ/T2H
-
- - items:
- - const: renesas,r9a09g087-wdt # RZ/N2H
- - const: renesas,r9a09g077-wdt # RZ/T2H
-
reg:
- minItems: 1
- maxItems: 2
+ maxItems: 1
interrupts:
maxItems: 1
clocks:
- minItems: 1
- items:
- - description: Register access clock
- - description: Main clock
-
- clock-names:
- minItems: 1
- items:
- - const: pclk
- - const: oscclk
+ maxItems: 1
power-domains:
maxItems: 1
@@ -96,76 +72,13 @@ required:
- compatible
- reg
- clocks
+ - interrupts
+ - power-domains
+ - resets
allOf:
- $ref: watchdog.yaml#
- - if:
- not:
- properties:
- compatible:
- contains:
- enum:
- - renesas,r9a09g077-wdt
- then:
- required:
- - power-domains
- - resets
-
- - if:
- properties:
- compatible:
- contains:
- enum:
- - renesas,r9a09g057-wdt
- then:
- properties:
- clocks:
- minItems: 2
- clock-names:
- minItems: 2
- required:
- - clock-names
- else:
- properties:
- clocks:
- maxItems: 1
-
- - if:
- properties:
- compatible:
- contains:
- enum:
- - renesas,r9a09g057-wdt
- - renesas,r9a09g077-wdt
- then:
- properties:
- interrupts: false
- interrupt-names: false
- else:
- required:
- - interrupts
-
- - if:
- properties:
- compatible:
- contains:
- const: renesas,r9a09g077-wdt
- then:
- properties:
- resets: false
- clock-names:
- maxItems: 1
- reg:
- minItems: 2
- required:
- - clock-names
- - power-domains
- else:
- properties:
- reg:
- maxItems: 1
-
additionalProperties: false
examples:
--
2.47.2
^ permalink raw reply related [flat|nested] 16+ messages in thread* RE: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-05 14:44 ` [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog Wolfram Sang
@ 2025-10-05 16:07 ` Biju Das
2025-10-05 16:11 ` Biju Das
2025-10-05 16:19 ` wsa+renesas
2025-10-06 8:39 ` Wolfram Sang
1 sibling, 2 replies; 16+ messages in thread
From: Biju Das @ 2025-10-05 16:07 UTC (permalink / raw)
To: wsa+renesas, linux-renesas-soc@vger.kernel.org
Cc: wsa+renesas, Guenter Roeck, Prabhakar Mahadev Lad,
Wim Van Sebroeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
Hi Wolfram,
> -----Original Message-----
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Sent: 05 October 2025 15:44
> Subject: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
>
> Renesas created different watchdog IPs but they are all handled in the same binding documentation. This
> leads to a lot of conditional handling which makes it unnecessarily hard to add new items. Factor out the
> RZ/V2H(P) watchdog to make handling easier.
>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Changes since v1:
> * moved 'clock-names' and 'power-domains' to top-level 'required:'
> (Thanks, Prabhakar)
> * removed unneeded label from example (Thanks, Prabhakar)
> * added tags from Guenter and Prabhakar (Thanks!)
>
> .../watchdog/renesas,r9a09g057-wdt.yaml | 110 ++++++++++++++++++
> .../bindings/watchdog/renesas,wdt.yaml | 97 +--------------
> 2 files changed, 115 insertions(+), 92 deletions(-) create mode 100644
> Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
>
> diff --git a/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
> b/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
> new file mode 100644
> index 000000000000..1c1c464b95e6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.y
> +++ aml
> @@ -0,0 +1,110 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/watchdog/renesas,r9a09g057-wdt.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas RZ/V2H(P) Watchdog Timer (WDT) Controller
> +
> +maintainers:
> + - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> +
> +properties:
> + compatible:
> + oneOf:
> + - items:
> + - enum:
> + - renesas,r9a09g047-wdt # RZ/G3E
> + - renesas,r9a09g056-wdt # RZ/V2N
> + - const: renesas,r9a09g057-wdt # RZ/V2H(P)
> +
> + - enum:
> + - renesas,r9a09g057-wdt # RZ/V2H(P)
> + - renesas,r9a09g077-wdt # RZ/T2H
> +
> + - items:
> + - const: renesas,r9a09g087-wdt # RZ/N2H
> + - const: renesas,r9a09g077-wdt # RZ/T2H
Looks there is duplication of entries for RZ/T2H?
Cheers,
Biju
> +
> + reg:
> + minItems: 1
> + maxItems: 2
> +
> + clocks:
> + minItems: 1
> + items:
> + - description: Register access clock
> + - description: Main clock
> +
> + clock-names:
> + minItems: 1
> + items:
> + - const: pclk
> + - const: oscclk
> +
> + power-domains:
> + maxItems: 1
> +
> + resets:
> + maxItems: 1
> +
> + timeout-sec: true
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> + - clock-names
> + - power-domains
> +
> +allOf:
> + - $ref: watchdog.yaml#
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - renesas,r9a09g057-wdt
> + then:
> + properties:
> + clocks:
> + minItems: 2
> + clock-names:
> + minItems: 2
> + else:
> + properties:
> + clocks:
> + maxItems: 1
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: renesas,r9a09g077-wdt
> + then:
> + properties:
> + resets: false
> + clock-names:
> + maxItems: 1
> + reg:
> + minItems: 2
> + else:
> + properties:
> + reg:
> + maxItems: 1
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/renesas,r9a09g057-cpg.h>
> +
> + watchdog@11c00400 {
> + compatible = "renesas,r9a09g057-wdt";
> + reg = <0x11c00400 0x400>;
> + clocks = <&cpg CPG_MOD 0x4b>, <&cpg CPG_MOD 0x4c>;
> + clock-names = "pclk", "oscclk";
> + resets = <&cpg 0x75>;
> + power-domains = <&cpg>;
> + };
> diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> index 2a15c012fd67..08ba128bf442 100644
> --- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> @@ -51,38 +51,14 @@ properties:
> - renesas,r8a779h0-wdt # R-Car V4M
> - const: renesas,rcar-gen4-wdt # R-Car Gen4
>
> - - items:
> - - enum:
> - - renesas,r9a09g047-wdt # RZ/G3E
> - - renesas,r9a09g056-wdt # RZ/V2N
> - - const: renesas,r9a09g057-wdt # RZ/V2H(P)
> -
> - - enum:
> - - renesas,r9a09g057-wdt # RZ/V2H(P)
> - - renesas,r9a09g077-wdt # RZ/T2H
> -
> - - items:
> - - const: renesas,r9a09g087-wdt # RZ/N2H
> - - const: renesas,r9a09g077-wdt # RZ/T2H
> -
> reg:
> - minItems: 1
> - maxItems: 2
> + maxItems: 1
>
> interrupts:
> maxItems: 1
>
> clocks:
> - minItems: 1
> - items:
> - - description: Register access clock
> - - description: Main clock
> -
> - clock-names:
> - minItems: 1
> - items:
> - - const: pclk
> - - const: oscclk
> + maxItems: 1
>
> power-domains:
> maxItems: 1
> @@ -96,76 +72,13 @@ required:
> - compatible
> - reg
> - clocks
> + - interrupts
> + - power-domains
> + - resets
>
> allOf:
> - $ref: watchdog.yaml#
>
> - - if:
> - not:
> - properties:
> - compatible:
> - contains:
> - enum:
> - - renesas,r9a09g077-wdt
> - then:
> - required:
> - - power-domains
> - - resets
> -
> - - if:
> - properties:
> - compatible:
> - contains:
> - enum:
> - - renesas,r9a09g057-wdt
> - then:
> - properties:
> - clocks:
> - minItems: 2
> - clock-names:
> - minItems: 2
> - required:
> - - clock-names
> - else:
> - properties:
> - clocks:
> - maxItems: 1
> -
> - - if:
> - properties:
> - compatible:
> - contains:
> - enum:
> - - renesas,r9a09g057-wdt
> - - renesas,r9a09g077-wdt
> - then:
> - properties:
> - interrupts: false
> - interrupt-names: false
> - else:
> - required:
> - - interrupts
> -
> - - if:
> - properties:
> - compatible:
> - contains:
> - const: renesas,r9a09g077-wdt
> - then:
> - properties:
> - resets: false
> - clock-names:
> - maxItems: 1
> - reg:
> - minItems: 2
> - required:
> - - clock-names
> - - power-domains
> - else:
> - properties:
> - reg:
> - maxItems: 1
> -
> additionalProperties: false
>
> examples:
> --
> 2.47.2
>
^ permalink raw reply [flat|nested] 16+ messages in thread* RE: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-05 16:07 ` Biju Das
@ 2025-10-05 16:11 ` Biju Das
2025-10-05 16:19 ` wsa+renesas
1 sibling, 0 replies; 16+ messages in thread
From: Biju Das @ 2025-10-05 16:11 UTC (permalink / raw)
To: Biju Das, wsa+renesas, linux-renesas-soc@vger.kernel.org
Cc: wsa+renesas, Guenter Roeck, Prabhakar Mahadev Lad,
Wim Van Sebroeck, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
Hi Wolfram,
> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: 05 October 2025 17:08
> Subject: RE: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
>
> Hi Wolfram,
>
> > -----Original Message-----
> > From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > Sent: 05 October 2025 15:44
> > Subject: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P)
> > watchdog
> >
> > Renesas created different watchdog IPs but they are all handled in the
> > same binding documentation. This leads to a lot of conditional
> > handling which makes it unnecessarily hard to add new items. Factor
> > out the
> > RZ/V2H(P) watchdog to make handling easier.
> >
> > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > ---
> >
> > Changes since v1:
> > * moved 'clock-names' and 'power-domains' to top-level 'required:'
> > (Thanks, Prabhakar)
> > * removed unneeded label from example (Thanks, Prabhakar)
> > * added tags from Guenter and Prabhakar (Thanks!)
> >
> > .../watchdog/renesas,r9a09g057-wdt.yaml | 110 ++++++++++++++++++
> > .../bindings/watchdog/renesas,wdt.yaml | 97 +--------------
> > 2 files changed, 115 insertions(+), 92 deletions(-) create mode
> > 100644
> > Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
> >
> > diff --git
> > a/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yam
> > l
> > b/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yam
> > l
> > new file mode 100644
> > index 000000000000..1c1c464b95e6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt
> > +++ .y
> > +++ aml
> > @@ -0,0 +1,110 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> > +---
> > +$id:
> > +http://devicetree.org/schemas/watchdog/renesas,r9a09g057-wdt.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Renesas RZ/V2H(P) Watchdog Timer (WDT) Controller
> > +
> > +maintainers:
> > + - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > +
> > +properties:
> > + compatible:
> > + oneOf:
> > + - items:
> > + - enum:
> > + - renesas,r9a09g047-wdt # RZ/G3E
> > + - renesas,r9a09g056-wdt # RZ/V2N
> > + - const: renesas,r9a09g057-wdt # RZ/V2H(P)
> > +
> > + - enum:
> > + - renesas,r9a09g057-wdt # RZ/V2H(P)
> > + - renesas,r9a09g077-wdt # RZ/T2H
> > +
> > + - items:
> > + - const: renesas,r9a09g087-wdt # RZ/N2H
> > + - const: renesas,r9a09g077-wdt # RZ/T2H
>
> Looks there is duplication of entries for RZ/T2H?
>
Sorry for the noise. It is fallback for N2H. Please ignore me.
Cheers,
Biju
>
> > +
> > + reg:
> > + minItems: 1
> > + maxItems: 2
> > +
> > + clocks:
> > + minItems: 1
> > + items:
> > + - description: Register access clock
> > + - description: Main clock
> > +
> > + clock-names:
> > + minItems: 1
> > + items:
> > + - const: pclk
> > + - const: oscclk
> > +
> > + power-domains:
> > + maxItems: 1
> > +
> > + resets:
> > + maxItems: 1
> > +
> > + timeout-sec: true
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - clocks
> > + - clock-names
> > + - power-domains
> > +
> > +allOf:
> > + - $ref: watchdog.yaml#
> > +
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + enum:
> > + - renesas,r9a09g057-wdt
> > + then:
> > + properties:
> > + clocks:
> > + minItems: 2
> > + clock-names:
> > + minItems: 2
> > + else:
> > + properties:
> > + clocks:
> > + maxItems: 1
> > +
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + const: renesas,r9a09g077-wdt
> > + then:
> > + properties:
> > + resets: false
> > + clock-names:
> > + maxItems: 1
> > + reg:
> > + minItems: 2
> > + else:
> > + properties:
> > + reg:
> > + maxItems: 1
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/clock/renesas,r9a09g057-cpg.h>
> > +
> > + watchdog@11c00400 {
> > + compatible = "renesas,r9a09g057-wdt";
> > + reg = <0x11c00400 0x400>;
> > + clocks = <&cpg CPG_MOD 0x4b>, <&cpg CPG_MOD 0x4c>;
> > + clock-names = "pclk", "oscclk";
> > + resets = <&cpg 0x75>;
> > + power-domains = <&cpg>;
> > + };
> > diff --git
> > a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> > b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> > index 2a15c012fd67..08ba128bf442 100644
> > --- a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> > +++ b/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
> > @@ -51,38 +51,14 @@ properties:
> > - renesas,r8a779h0-wdt # R-Car V4M
> > - const: renesas,rcar-gen4-wdt # R-Car Gen4
> >
> > - - items:
> > - - enum:
> > - - renesas,r9a09g047-wdt # RZ/G3E
> > - - renesas,r9a09g056-wdt # RZ/V2N
> > - - const: renesas,r9a09g057-wdt # RZ/V2H(P)
> > -
> > - - enum:
> > - - renesas,r9a09g057-wdt # RZ/V2H(P)
> > - - renesas,r9a09g077-wdt # RZ/T2H
> > -
> > - - items:
> > - - const: renesas,r9a09g087-wdt # RZ/N2H
> > - - const: renesas,r9a09g077-wdt # RZ/T2H
> > -
> > reg:
> > - minItems: 1
> > - maxItems: 2
> > + maxItems: 1
> >
> > interrupts:
> > maxItems: 1
> >
> > clocks:
> > - minItems: 1
> > - items:
> > - - description: Register access clock
> > - - description: Main clock
> > -
> > - clock-names:
> > - minItems: 1
> > - items:
> > - - const: pclk
> > - - const: oscclk
> > + maxItems: 1
> >
> > power-domains:
> > maxItems: 1
> > @@ -96,76 +72,13 @@ required:
> > - compatible
> > - reg
> > - clocks
> > + - interrupts
> > + - power-domains
> > + - resets
> >
> > allOf:
> > - $ref: watchdog.yaml#
> >
> > - - if:
> > - not:
> > - properties:
> > - compatible:
> > - contains:
> > - enum:
> > - - renesas,r9a09g077-wdt
> > - then:
> > - required:
> > - - power-domains
> > - - resets
> > -
> > - - if:
> > - properties:
> > - compatible:
> > - contains:
> > - enum:
> > - - renesas,r9a09g057-wdt
> > - then:
> > - properties:
> > - clocks:
> > - minItems: 2
> > - clock-names:
> > - minItems: 2
> > - required:
> > - - clock-names
> > - else:
> > - properties:
> > - clocks:
> > - maxItems: 1
> > -
> > - - if:
> > - properties:
> > - compatible:
> > - contains:
> > - enum:
> > - - renesas,r9a09g057-wdt
> > - - renesas,r9a09g077-wdt
> > - then:
> > - properties:
> > - interrupts: false
> > - interrupt-names: false
> > - else:
> > - required:
> > - - interrupts
> > -
> > - - if:
> > - properties:
> > - compatible:
> > - contains:
> > - const: renesas,r9a09g077-wdt
> > - then:
> > - properties:
> > - resets: false
> > - clock-names:
> > - maxItems: 1
> > - reg:
> > - minItems: 2
> > - required:
> > - - clock-names
> > - - power-domains
> > - else:
> > - properties:
> > - reg:
> > - maxItems: 1
> > -
> > additionalProperties: false
> >
> > examples:
> > --
> > 2.47.2
> >
>
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-05 16:07 ` Biju Das
2025-10-05 16:11 ` Biju Das
@ 2025-10-05 16:19 ` wsa+renesas
2025-10-06 3:17 ` Biju Das
1 sibling, 1 reply; 16+ messages in thread
From: wsa+renesas @ 2025-10-05 16:19 UTC (permalink / raw)
To: Biju Das
Cc: linux-renesas-soc@vger.kernel.org, Guenter Roeck,
Prabhakar Mahadev Lad, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
Hi Biju,
> > + - enum:
> > + - renesas,r9a09g057-wdt # RZ/V2H(P)
> > + - renesas,r9a09g077-wdt # RZ/T2H
> > +
> > + - items:
> > + - const: renesas,r9a09g087-wdt # RZ/N2H
> > + - const: renesas,r9a09g077-wdt # RZ/T2H
>
> Looks there is duplication of entries for RZ/T2H?
The first one is plain T2H, the second one N2H with a fallback to T2H.
This is how I read it, at least, and how it already was in the original
binding description.
Thanks for the review,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-05 16:19 ` wsa+renesas
@ 2025-10-06 3:17 ` Biju Das
2025-10-06 6:30 ` wsa+renesas
0 siblings, 1 reply; 16+ messages in thread
From: Biju Das @ 2025-10-06 3:17 UTC (permalink / raw)
To: wsa+renesas
Cc: linux-renesas-soc@vger.kernel.org, Guenter Roeck,
Prabhakar Mahadev Lad, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
Hi Wolfram,
Thanks for feedback.
> -----Original Message-----
> From: wsa+renesas <wsa+renesas@sang-engineering.com>
> Sent: 05 October 2025 17:19
> Subject: Re: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
>
> Hi Biju,
>
> > > + - enum:
> > > + - renesas,r9a09g057-wdt # RZ/V2H(P)
> > > + - renesas,r9a09g077-wdt # RZ/T2H
> > > +
> > > + - items:
> > > + - const: renesas,r9a09g087-wdt # RZ/N2H
> > > + - const: renesas,r9a09g077-wdt # RZ/T2H
I guess a comment like # fallback RZ/T2H here will avoid confusion.
> >
> > Looks there is duplication of entries for RZ/T2H?
>
> The first one is plain T2H, the second one N2H with a fallback to T2H.
> This is how I read it, at least, and how it already was in the original binding description.
I agree.
Cheers,
Biju
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-06 3:17 ` Biju Das
@ 2025-10-06 6:30 ` wsa+renesas
2025-10-06 9:25 ` Geert Uytterhoeven
0 siblings, 1 reply; 16+ messages in thread
From: wsa+renesas @ 2025-10-06 6:30 UTC (permalink / raw)
To: Biju Das
Cc: linux-renesas-soc@vger.kernel.org, Guenter Roeck,
Prabhakar Mahadev Lad, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
Hi Biju,
> > > > + - enum:
> > > > + - renesas,r9a09g057-wdt # RZ/V2H(P)
> > > > + - renesas,r9a09g077-wdt # RZ/T2H
> > > > +
> > > > + - items:
> > > > + - const: renesas,r9a09g087-wdt # RZ/N2H
> > > > + - const: renesas,r9a09g077-wdt # RZ/T2H
>
> I guess a comment like # fallback RZ/T2H here will avoid confusion.
Hmmm, if we add such a comment for every fallback, this will be quite
some churn, I would think. My favourite solution would be to swap the
'items' entry with the 'enum'. So, everything with a fallback comes
first, and the 'plain' entries last. But what do others think?
Happy hacking,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-06 6:30 ` wsa+renesas
@ 2025-10-06 9:25 ` Geert Uytterhoeven
2025-10-06 9:43 ` wsa+renesas
2025-10-09 20:00 ` Rob Herring
0 siblings, 2 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2025-10-06 9:25 UTC (permalink / raw)
To: wsa+renesas
Cc: Biju Das, linux-renesas-soc@vger.kernel.org, Guenter Roeck,
Prabhakar Mahadev Lad, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
Hi Wolfram,
On Mon, 6 Oct 2025 at 08:30, wsa+renesas
<wsa+renesas@sang-engineering.com> wrote:
> > > > > + - enum:
> > > > > + - renesas,r9a09g057-wdt # RZ/V2H(P)
> > > > > + - renesas,r9a09g077-wdt # RZ/T2H
> > > > > +
> > > > > + - items:
> > > > > + - const: renesas,r9a09g087-wdt # RZ/N2H
> > > > > + - const: renesas,r9a09g077-wdt # RZ/T2H
> >
> > I guess a comment like # fallback RZ/T2H here will avoid confusion.
>
> Hmmm, if we add such a comment for every fallback, this will be quite
> some churn, I would think. My favourite solution would be to swap the
> 'items' entry with the 'enum'. So, everything with a fallback comes
> first, and the 'plain' entries last. But what do others think?
We do have "fallback" comments in other places, and I think they do
help in understanding compatible naming schemes.
Would it be possible to handle this in dt-schema?
Currently we have to write:
- const: vendor,soc1-ip
- items:
- enum:
- vendor,soc2-ip
- vendor,soc3-ip
- const: vendor,soc1-ip # fallback
If dt-schema would automatically drop duplicates of the fallback,
we could just write:
- items:
- enum:
- vendor,soc1-ip
- vendor,soc2-ip
- vendor,soc3-ip
- const: vendor,soc1-ip # fallback
What do you think?
Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-06 9:25 ` Geert Uytterhoeven
@ 2025-10-06 9:43 ` wsa+renesas
2025-10-06 9:54 ` Geert Uytterhoeven
2025-10-09 20:00 ` Rob Herring
1 sibling, 1 reply; 16+ messages in thread
From: wsa+renesas @ 2025-10-06 9:43 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Biju Das, linux-renesas-soc@vger.kernel.org, Guenter Roeck,
Prabhakar Mahadev Lad, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]
Hi Geert,
> We do have "fallback" comments in other places, and I think they do
> help in understanding compatible naming schemes.
Still, dunno...
> Would it be possible to handle this in dt-schema?
> Currently we have to write:
>
> - const: vendor,soc1-ip
>
> - items:
> - enum:
> - vendor,soc2-ip
> - vendor,soc3-ip
> - const: vendor,soc1-ip # fallback
... I think '- items' makes it clear that later entries are fallback
entries. I am by no means a YAML master but this knowledge should/could
be expected? If peolpe don't know that...
What really is confusing, I'd say, is a mixture of entries with
fallbacks and without. One can overlook this easily. So, they should be
grouped IMHO. That's my previous suggestion.
> If dt-schema would automatically drop duplicates of the fallback,
> we could just write:
>
> - items:
> - enum:
> - vendor,soc1-ip
> - vendor,soc2-ip
> - vendor,soc3-ip
> - const: vendor,soc1-ip # fallback
>
> What do you think?
(soc1 should be omitted from the enum)
Do you mean "# fallback" indicates that the fallback entry should be
created? Or just the const item?
Well, this is ultimately DT maintainers call, but my gut feeling says it
is better to be explicit than implicit. I do understand that the more
compact binding documentation would be a gain, though.
All the best,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-06 9:43 ` wsa+renesas
@ 2025-10-06 9:54 ` Geert Uytterhoeven
0 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2025-10-06 9:54 UTC (permalink / raw)
To: wsa+renesas
Cc: Biju Das, linux-renesas-soc@vger.kernel.org, Guenter Roeck,
Prabhakar Mahadev Lad, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
Hi Wolfram,
On Mon, 6 Oct 2025 at 11:43, wsa+renesas
<wsa+renesas@sang-engineering.com> wrote:
> > We do have "fallback" comments in other places, and I think they do
> > help in understanding compatible naming schemes.
>
> Still, dunno...
>
> > Would it be possible to handle this in dt-schema?
> > Currently we have to write:
> >
> > - const: vendor,soc1-ip
> >
> > - items:
> > - enum:
> > - vendor,soc2-ip
> > - vendor,soc3-ip
> > - const: vendor,soc1-ip # fallback
>
> ... I think '- items' makes it clear that later entries are fallback
> entries. I am by no means a YAML master but this knowledge should/could
> be expected? If peolpe don't know that...
>
> What really is confusing, I'd say, is a mixture of entries with
> fallbacks and without. One can overlook this easily. So, they should be
> grouped IMHO. That's my previous suggestion.
>
> > If dt-schema would automatically drop duplicates of the fallback,
> > we could just write:
> >
> > - items:
> > - enum:
> > - vendor,soc1-ip
> > - vendor,soc2-ip
> > - vendor,soc3-ip
> > - const: vendor,soc1-ip # fallback
> >
> > What do you think?
>
> (soc1 should be omitted from the enum)
If you omit it, how do you know it is valid to only specify the
fallback compatible value in DTS? We do have (non-SoC, but family or
(ugh) generic) fallbacks that must not be used on their own.
> Do you mean "# fallback" indicates that the fallback entry should be
> created? Or just the const item?
The "# fallback" is just a comment.
The new dt-schema magic would be ignoring the first enum, because it
is identical to the fallback after that.
> Well, this is ultimately DT maintainers call, but my gut feeling says it
> is better to be explicit than implicit. I do understand that the more
> compact binding documentation would be a gain, though.
OK.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-06 9:25 ` Geert Uytterhoeven
2025-10-06 9:43 ` wsa+renesas
@ 2025-10-09 20:00 ` Rob Herring
1 sibling, 0 replies; 16+ messages in thread
From: Rob Herring @ 2025-10-09 20:00 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: wsa+renesas, Biju Das, linux-renesas-soc@vger.kernel.org,
Guenter Roeck, Prabhakar Mahadev Lad, Wim Van Sebroeck,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
magnus.damm, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org
On Mon, Oct 06, 2025 at 11:25:11AM +0200, Geert Uytterhoeven wrote:
> Hi Wolfram,
>
> On Mon, 6 Oct 2025 at 08:30, wsa+renesas
> <wsa+renesas@sang-engineering.com> wrote:
> > > > > > + - enum:
> > > > > > + - renesas,r9a09g057-wdt # RZ/V2H(P)
> > > > > > + - renesas,r9a09g077-wdt # RZ/T2H
> > > > > > +
> > > > > > + - items:
> > > > > > + - const: renesas,r9a09g087-wdt # RZ/N2H
> > > > > > + - const: renesas,r9a09g077-wdt # RZ/T2H
> > >
> > > I guess a comment like # fallback RZ/T2H here will avoid confusion.
> >
> > Hmmm, if we add such a comment for every fallback, this will be quite
> > some churn, I would think. My favourite solution would be to swap the
> > 'items' entry with the 'enum'. So, everything with a fallback comes
> > first, and the 'plain' entries last. But what do others think?
That's probably what I'd pick, but I try not to define rules we can't
check with tools. Otherwise, I get tired of having to review that rule.
And adding a rule to tools has the cost of fixing the existing cases
everywhere.
> We do have "fallback" comments in other places, and I think they do
> help in understanding compatible naming schemes.
>
> Would it be possible to handle this in dt-schema?
> Currently we have to write:
>
> - const: vendor,soc1-ip
>
> - items:
> - enum:
> - vendor,soc2-ip
> - vendor,soc3-ip
> - const: vendor,soc1-ip # fallback
>
> If dt-schema would automatically drop duplicates of the fallback,
> we could just write:
>
> - items:
> - enum:
> - vendor,soc1-ip
> - vendor,soc2-ip
> - vendor,soc3-ip
> - const: vendor,soc1-ip # fallback
>
> What do you think?
It would almost work with just 'minItems: 1' added. That's because we
require strings to be unique entries, so soc1 twice will be rejected.
But then that allows for no fallback with soc2 and soc3.
So I don't see a way to do this other than transforming the above back
into what we have today under a oneOf. That's a bit more deviation from
json-schema than I'm comfortable with. Mostly the tools just add
properties (like 'additionalItems: false' here) where the default is not
what we want.
Rob
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
2025-10-05 14:44 ` [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog Wolfram Sang
2025-10-05 16:07 ` Biju Das
@ 2025-10-06 8:39 ` Wolfram Sang
1 sibling, 0 replies; 16+ messages in thread
From: Wolfram Sang @ 2025-10-06 8:39 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Guenter Roeck, Lad Prabhakar, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Magnus Damm, linux-watchdog, devicetree
[-- Attachment #1: Type: text/plain, Size: 342 bytes --]
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - renesas,r9a09g057-wdt
I think this should be 'const' for now...
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: renesas,r9a09g077-wdt
...like here.
Same for patch 3.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread