1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/watchdog/renesas,wdt.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Renesas Watchdog Timer (WDT) Controller
8
9maintainers:
10  - Wolfram Sang <wsa+renesas@sang-engineering.com>
11  - Geert Uytterhoeven <geert+renesas@glider.be>
12
13properties:
14  compatible:
15    oneOf:
16      - items:
17          - enum:
18              - renesas,r7s72100-wdt     # RZ/A1
19              - renesas,r7s9210-wdt      # RZ/A2
20          - const: renesas,rza-wdt       # RZ/A
21
22      - items:
23          - enum:
24              - renesas,r9a06g032-wdt    # RZ/N1D
25          - const: renesas,rzn1-wdt      # RZ/N1
26
27      - items:
28          - enum:
29              - renesas,r9a07g043-wdt    # RZ/G2UL and RZ/Five
30              - renesas,r9a07g044-wdt    # RZ/G2{L,LC}
31              - renesas,r9a07g054-wdt    # RZ/V2L
32          - const: renesas,rzg2l-wdt
33
34      - items:
35          - enum:
36              - renesas,r9a09g011-wdt    # RZ/V2M
37          - const: renesas,rzv2m-wdt     # RZ/V2M
38
39      - items:
40          - enum:
41              - renesas,r8a7742-wdt      # RZ/G1H
42              - renesas,r8a7743-wdt      # RZ/G1M
43              - renesas,r8a7744-wdt      # RZ/G1N
44              - renesas,r8a7745-wdt      # RZ/G1E
45              - renesas,r8a77470-wdt     # RZ/G1C
46              - renesas,r8a7790-wdt      # R-Car H2
47              - renesas,r8a7791-wdt      # R-Car M2-W
48              - renesas,r8a7792-wdt      # R-Car V2H
49              - renesas,r8a7793-wdt      # R-Car M2-N
50              - renesas,r8a7794-wdt      # R-Car E2
51          - const: renesas,rcar-gen2-wdt # R-Car Gen2 and RZ/G1
52
53      - items:
54          - enum:
55              - renesas,r8a774a1-wdt     # RZ/G2M
56              - renesas,r8a774b1-wdt     # RZ/G2N
57              - renesas,r8a774c0-wdt     # RZ/G2E
58              - renesas,r8a774e1-wdt     # RZ/G2H
59              - renesas,r8a7795-wdt      # R-Car H3
60              - renesas,r8a7796-wdt      # R-Car M3-W
61              - renesas,r8a77961-wdt     # R-Car M3-W+
62              - renesas,r8a77965-wdt     # R-Car M3-N
63              - renesas,r8a77970-wdt     # R-Car V3M
64              - renesas,r8a77980-wdt     # R-Car V3H
65              - renesas,r8a77990-wdt     # R-Car E3
66              - renesas,r8a77995-wdt     # R-Car D3
67          - const: renesas,rcar-gen3-wdt # R-Car Gen3 and RZ/G2
68
69      - items:
70          - enum:
71              - renesas,r8a779a0-wdt     # R-Car V3U
72              - renesas,r8a779f0-wdt     # R-Car S4-8
73              - renesas,r8a779g0-wdt     # R-Car V4H
74          - const: renesas,rcar-gen4-wdt # R-Car Gen4
75
76  reg:
77    maxItems: 1
78
79  interrupts:
80    minItems: 1
81    items:
82      - description: Timeout
83      - description: Parity error
84
85  interrupt-names:
86    minItems: 1
87    items:
88      - const: wdt
89      - const: perrout
90
91  clocks:
92    minItems: 1
93    items:
94      - description: Register access clock
95      - description: Main clock
96
97  clock-names:
98    minItems: 1
99    items:
100      - const: pclk
101      - const: oscclk
102
103  power-domains:
104    maxItems: 1
105
106  resets:
107    maxItems: 1
108
109  timeout-sec: true
110
111required:
112  - compatible
113  - reg
114  - interrupts
115  - clocks
116
117allOf:
118  - $ref: watchdog.yaml#
119
120  - if:
121      not:
122        properties:
123          compatible:
124            contains:
125              enum:
126                - renesas,rza-wdt
127                - renesas,rzn1-wdt
128    then:
129      required:
130        - power-domains
131        - resets
132
133  - if:
134      properties:
135        compatible:
136          contains:
137            enum:
138              - renesas,rzg2l-wdt
139              - renesas,rzv2m-wdt
140    then:
141      properties:
142        clocks:
143          minItems: 2
144        clock-names:
145          minItems: 2
146      required:
147        - clock-names
148    else:
149      properties:
150        clocks:
151          maxItems: 1
152
153  - if:
154      properties:
155        compatible:
156          contains:
157            enum:
158              - renesas,rzg2l-wdt
159    then:
160      properties:
161        interrupts:
162          minItems: 2
163        interrupt-names:
164          minItems: 2
165      required:
166        - interrupt-names
167    else:
168      properties:
169        interrupts:
170          maxItems: 1
171
172additionalProperties: false
173
174examples:
175  - |
176    #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
177    #include <dt-bindings/power/r8a7795-sysc.h>
178    #include <dt-bindings/interrupt-controller/arm-gic.h>
179    wdt0: watchdog@e6020000 {
180        compatible = "renesas,r8a7795-wdt", "renesas,rcar-gen3-wdt";
181        reg = <0xe6020000 0x0c>;
182        interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
183        clocks = <&cpg CPG_MOD 402>;
184        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
185        resets = <&cpg 402>;
186        timeout-sec = <60>;
187    };
188