xref: /freebsd/sys/contrib/device-tree/Bindings/timer/ingenic,tcu.yaml (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/timer/ingenic,tcu.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: Ingenic SoCs Timer/Counter Unit (TCU)
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotdescription: |
10c66ec88fSEmmanuel Vadot  For a description of the TCU hardware and drivers, have a look at
11*aa1a8ff2SEmmanuel Vadot  Documentation/arch/mips/ingenic-tcu.rst.
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotmaintainers:
14c66ec88fSEmmanuel Vadot  - Paul Cercueil <paul@crapouillou.net>
15c66ec88fSEmmanuel Vadot
16c66ec88fSEmmanuel Vadotselect:
17c66ec88fSEmmanuel Vadot  properties:
18c66ec88fSEmmanuel Vadot    compatible:
19c66ec88fSEmmanuel Vadot      contains:
20c66ec88fSEmmanuel Vadot        enum:
21c66ec88fSEmmanuel Vadot          - ingenic,jz4740-tcu
22c66ec88fSEmmanuel Vadot          - ingenic,jz4725b-tcu
232eb4d8dcSEmmanuel Vadot          - ingenic,jz4760-tcu
242eb4d8dcSEmmanuel Vadot          - ingenic,jz4760b-tcu
25c66ec88fSEmmanuel Vadot          - ingenic,jz4770-tcu
26c66ec88fSEmmanuel Vadot          - ingenic,jz4780-tcu
27c66ec88fSEmmanuel Vadot          - ingenic,x1000-tcu
28c66ec88fSEmmanuel Vadot  required:
29c66ec88fSEmmanuel Vadot    - compatible
30c66ec88fSEmmanuel Vadot
31c66ec88fSEmmanuel Vadotproperties:
32c66ec88fSEmmanuel Vadot  $nodename:
33c66ec88fSEmmanuel Vadot    pattern: "^timer@[0-9a-f]+$"
34c66ec88fSEmmanuel Vadot
35c66ec88fSEmmanuel Vadot  "#address-cells":
36c66ec88fSEmmanuel Vadot    const: 1
37c66ec88fSEmmanuel Vadot
38c66ec88fSEmmanuel Vadot  "#size-cells":
39c66ec88fSEmmanuel Vadot    const: 1
40c66ec88fSEmmanuel Vadot
41c66ec88fSEmmanuel Vadot  "#clock-cells":
42c66ec88fSEmmanuel Vadot    const: 1
43c66ec88fSEmmanuel Vadot
44c66ec88fSEmmanuel Vadot  "#interrupt-cells":
45c66ec88fSEmmanuel Vadot    const: 1
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  interrupt-controller: true
48c66ec88fSEmmanuel Vadot
49c66ec88fSEmmanuel Vadot  ranges: true
50c66ec88fSEmmanuel Vadot
51c66ec88fSEmmanuel Vadot  compatible:
52c66ec88fSEmmanuel Vadot    oneOf:
53c66ec88fSEmmanuel Vadot      - items:
54c66ec88fSEmmanuel Vadot          - enum:
55c66ec88fSEmmanuel Vadot              - ingenic,jz4740-tcu
56c66ec88fSEmmanuel Vadot              - ingenic,jz4725b-tcu
572eb4d8dcSEmmanuel Vadot              - ingenic,jz4760-tcu
58c66ec88fSEmmanuel Vadot              - ingenic,x1000-tcu
59c66ec88fSEmmanuel Vadot          - const: simple-mfd
60c66ec88fSEmmanuel Vadot      - items:
612eb4d8dcSEmmanuel Vadot          - enum:
622eb4d8dcSEmmanuel Vadot              - ingenic,jz4780-tcu
632eb4d8dcSEmmanuel Vadot              - ingenic,jz4770-tcu
642eb4d8dcSEmmanuel Vadot              - ingenic,jz4760b-tcu
652eb4d8dcSEmmanuel Vadot          - const: ingenic,jz4760-tcu
66c66ec88fSEmmanuel Vadot          - const: simple-mfd
67c66ec88fSEmmanuel Vadot
68c66ec88fSEmmanuel Vadot  reg:
69c66ec88fSEmmanuel Vadot    maxItems: 1
70c66ec88fSEmmanuel Vadot
71c66ec88fSEmmanuel Vadot  clocks:
72c66ec88fSEmmanuel Vadot    items:
73c66ec88fSEmmanuel Vadot      - description: RTC clock
74c66ec88fSEmmanuel Vadot      - description: EXT clock
75c66ec88fSEmmanuel Vadot      - description: PCLK clock
76c66ec88fSEmmanuel Vadot      - description: TCU clock
77c66ec88fSEmmanuel Vadot    minItems: 3
78c66ec88fSEmmanuel Vadot
79c66ec88fSEmmanuel Vadot  clock-names:
80c66ec88fSEmmanuel Vadot    items:
81c66ec88fSEmmanuel Vadot      - const: rtc
82c66ec88fSEmmanuel Vadot      - const: ext
83c66ec88fSEmmanuel Vadot      - const: pclk
84c66ec88fSEmmanuel Vadot      - const: tcu
85c66ec88fSEmmanuel Vadot    minItems: 3
86c66ec88fSEmmanuel Vadot
87c66ec88fSEmmanuel Vadot  interrupts:
88c66ec88fSEmmanuel Vadot    items:
89c66ec88fSEmmanuel Vadot      - description: TCU0 interrupt
90c66ec88fSEmmanuel Vadot      - description: TCU1 interrupt
91c66ec88fSEmmanuel Vadot      - description: TCU2 interrupt
92c66ec88fSEmmanuel Vadot    minItems: 1
93c66ec88fSEmmanuel Vadot
94c66ec88fSEmmanuel Vadot  assigned-clocks:
95c66ec88fSEmmanuel Vadot    minItems: 1
96c66ec88fSEmmanuel Vadot    maxItems: 8
97c66ec88fSEmmanuel Vadot
98c66ec88fSEmmanuel Vadot  assigned-clock-parents:
99c66ec88fSEmmanuel Vadot    minItems: 1
100c66ec88fSEmmanuel Vadot    maxItems: 8
101c66ec88fSEmmanuel Vadot
102c66ec88fSEmmanuel Vadot  assigned-clock-rates:
103c66ec88fSEmmanuel Vadot    minItems: 1
104c66ec88fSEmmanuel Vadot    maxItems: 8
105c66ec88fSEmmanuel Vadot
106c66ec88fSEmmanuel Vadot  ingenic,pwm-channels-mask:
107c66ec88fSEmmanuel Vadot    description: Bitmask of TCU channels reserved for PWM use.
108c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
109c66ec88fSEmmanuel Vadot    minimum: 0x00
110c66ec88fSEmmanuel Vadot    maximum: 0xff
111c66ec88fSEmmanuel Vadot    default: 0xfc
112c66ec88fSEmmanuel Vadot
113c66ec88fSEmmanuel VadotpatternProperties:
114c66ec88fSEmmanuel Vadot  "^watchdog@[a-f0-9]+$":
115c66ec88fSEmmanuel Vadot    type: object
116b97ee269SEmmanuel Vadot    $ref: /schemas/watchdog/watchdog.yaml#
1177ef62cebSEmmanuel Vadot    unevaluatedProperties: false
1187ef62cebSEmmanuel Vadot
119c66ec88fSEmmanuel Vadot    properties:
120c66ec88fSEmmanuel Vadot      compatible:
121c66ec88fSEmmanuel Vadot        oneOf:
122c66ec88fSEmmanuel Vadot          - enum:
123c66ec88fSEmmanuel Vadot              - ingenic,jz4740-watchdog
124c66ec88fSEmmanuel Vadot              - ingenic,jz4780-watchdog
125c66ec88fSEmmanuel Vadot          - items:
126c66ec88fSEmmanuel Vadot              - enum:
127c66ec88fSEmmanuel Vadot                  - ingenic,jz4770-watchdog
1282eb4d8dcSEmmanuel Vadot                  - ingenic,jz4760b-watchdog
1292eb4d8dcSEmmanuel Vadot                  - ingenic,jz4760-watchdog
130c66ec88fSEmmanuel Vadot                  - ingenic,jz4725b-watchdog
131c66ec88fSEmmanuel Vadot              - const: ingenic,jz4740-watchdog
132c66ec88fSEmmanuel Vadot
133c66ec88fSEmmanuel Vadot      reg:
134c66ec88fSEmmanuel Vadot        maxItems: 1
135c66ec88fSEmmanuel Vadot
136c66ec88fSEmmanuel Vadot      clocks:
137c66ec88fSEmmanuel Vadot        maxItems: 1
138c66ec88fSEmmanuel Vadot
139c66ec88fSEmmanuel Vadot      clock-names:
140c66ec88fSEmmanuel Vadot        const: wdt
141c66ec88fSEmmanuel Vadot
142c66ec88fSEmmanuel Vadot    required:
143c66ec88fSEmmanuel Vadot      - compatible
144c66ec88fSEmmanuel Vadot      - reg
145c66ec88fSEmmanuel Vadot      - clocks
146c66ec88fSEmmanuel Vadot      - clock-names
147c66ec88fSEmmanuel Vadot
148c66ec88fSEmmanuel Vadot  "^pwm@[a-f0-9]+$":
149c66ec88fSEmmanuel Vadot    type: object
150b97ee269SEmmanuel Vadot    $ref: /schemas/pwm/pwm.yaml#
1517ef62cebSEmmanuel Vadot    unevaluatedProperties: false
1527ef62cebSEmmanuel Vadot
153c66ec88fSEmmanuel Vadot    properties:
154c66ec88fSEmmanuel Vadot      compatible:
155c66ec88fSEmmanuel Vadot        oneOf:
156c66ec88fSEmmanuel Vadot          - enum:
157c66ec88fSEmmanuel Vadot              - ingenic,jz4740-pwm
158c66ec88fSEmmanuel Vadot              - ingenic,jz4725b-pwm
159c9ccf3a3SEmmanuel Vadot              - ingenic,x1000-pwm
160c66ec88fSEmmanuel Vadot          - items:
161c66ec88fSEmmanuel Vadot              - enum:
1622eb4d8dcSEmmanuel Vadot                  - ingenic,jz4760-pwm
1632eb4d8dcSEmmanuel Vadot                  - ingenic,jz4760b-pwm
164c66ec88fSEmmanuel Vadot                  - ingenic,jz4770-pwm
165c66ec88fSEmmanuel Vadot                  - ingenic,jz4780-pwm
166c66ec88fSEmmanuel Vadot              - const: ingenic,jz4740-pwm
167c66ec88fSEmmanuel Vadot
168c66ec88fSEmmanuel Vadot      reg:
169c66ec88fSEmmanuel Vadot        maxItems: 1
170c66ec88fSEmmanuel Vadot
171c66ec88fSEmmanuel Vadot      clocks:
172c66ec88fSEmmanuel Vadot        minItems: 6
173c66ec88fSEmmanuel Vadot        maxItems: 8
174c66ec88fSEmmanuel Vadot
175c66ec88fSEmmanuel Vadot      clock-names:
176c66ec88fSEmmanuel Vadot        items:
177c66ec88fSEmmanuel Vadot          - const: timer0
178c66ec88fSEmmanuel Vadot          - const: timer1
179c66ec88fSEmmanuel Vadot          - const: timer2
180c66ec88fSEmmanuel Vadot          - const: timer3
181c66ec88fSEmmanuel Vadot          - const: timer4
182c66ec88fSEmmanuel Vadot          - const: timer5
183c66ec88fSEmmanuel Vadot          - const: timer6
184c66ec88fSEmmanuel Vadot          - const: timer7
185c66ec88fSEmmanuel Vadot        minItems: 6
186c66ec88fSEmmanuel Vadot
187c66ec88fSEmmanuel Vadot    required:
188c66ec88fSEmmanuel Vadot      - compatible
189c66ec88fSEmmanuel Vadot      - reg
190c66ec88fSEmmanuel Vadot      - clocks
191c66ec88fSEmmanuel Vadot      - clock-names
192c66ec88fSEmmanuel Vadot
193c66ec88fSEmmanuel Vadot  "^timer@[a-f0-9]+$":
194c66ec88fSEmmanuel Vadot    type: object
195c66ec88fSEmmanuel Vadot    properties:
196c66ec88fSEmmanuel Vadot      compatible:
197c66ec88fSEmmanuel Vadot        oneOf:
198c66ec88fSEmmanuel Vadot          - enum:
199c66ec88fSEmmanuel Vadot              - ingenic,jz4725b-ost
2002eb4d8dcSEmmanuel Vadot              - ingenic,jz4760b-ost
201c66ec88fSEmmanuel Vadot          - items:
2022eb4d8dcSEmmanuel Vadot              - const: ingenic,jz4760-ost
2032eb4d8dcSEmmanuel Vadot              - const: ingenic,jz4725b-ost
2042eb4d8dcSEmmanuel Vadot          - items:
2052eb4d8dcSEmmanuel Vadot              - enum:
2062eb4d8dcSEmmanuel Vadot                  - ingenic,jz4780-ost
2072eb4d8dcSEmmanuel Vadot                  - ingenic,jz4770-ost
2082eb4d8dcSEmmanuel Vadot              - const: ingenic,jz4760b-ost
209c66ec88fSEmmanuel Vadot
210c66ec88fSEmmanuel Vadot      reg:
211c66ec88fSEmmanuel Vadot        maxItems: 1
212c66ec88fSEmmanuel Vadot
213c66ec88fSEmmanuel Vadot      clocks:
214c66ec88fSEmmanuel Vadot        maxItems: 1
215c66ec88fSEmmanuel Vadot
216c66ec88fSEmmanuel Vadot      clock-names:
217c66ec88fSEmmanuel Vadot        const: ost
218c66ec88fSEmmanuel Vadot
219c66ec88fSEmmanuel Vadot      interrupts:
220c66ec88fSEmmanuel Vadot        maxItems: 1
221c66ec88fSEmmanuel Vadot
222c66ec88fSEmmanuel Vadot    required:
223c66ec88fSEmmanuel Vadot      - compatible
224c66ec88fSEmmanuel Vadot      - reg
225c66ec88fSEmmanuel Vadot      - clocks
226c66ec88fSEmmanuel Vadot      - clock-names
227c66ec88fSEmmanuel Vadot      - interrupts
228c66ec88fSEmmanuel Vadot
229c66ec88fSEmmanuel Vadot    additionalProperties: false
230c66ec88fSEmmanuel Vadot
231c66ec88fSEmmanuel Vadotrequired:
232c66ec88fSEmmanuel Vadot  - "#clock-cells"
233c66ec88fSEmmanuel Vadot  - "#interrupt-cells"
234c66ec88fSEmmanuel Vadot  - interrupt-controller
235c66ec88fSEmmanuel Vadot  - compatible
236c66ec88fSEmmanuel Vadot  - reg
237c66ec88fSEmmanuel Vadot  - clocks
238c66ec88fSEmmanuel Vadot  - clock-names
239c66ec88fSEmmanuel Vadot  - interrupts
240c66ec88fSEmmanuel Vadot
241c66ec88fSEmmanuel VadotadditionalProperties: false
242c66ec88fSEmmanuel Vadot
243c66ec88fSEmmanuel Vadotexamples:
244c66ec88fSEmmanuel Vadot  - |
2458cc087a1SEmmanuel Vadot    #include <dt-bindings/clock/ingenic,jz4770-cgu.h>
246c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/ingenic,tcu.h>
247c66ec88fSEmmanuel Vadot    tcu: timer@10002000 {
2482eb4d8dcSEmmanuel Vadot      compatible = "ingenic,jz4770-tcu", "ingenic,jz4760-tcu", "simple-mfd";
249c66ec88fSEmmanuel Vadot      reg = <0x10002000 0x1000>;
250c66ec88fSEmmanuel Vadot      #address-cells = <1>;
251c66ec88fSEmmanuel Vadot      #size-cells = <1>;
252c66ec88fSEmmanuel Vadot      ranges = <0x0 0x10002000 0x1000>;
253c66ec88fSEmmanuel Vadot
254c66ec88fSEmmanuel Vadot      #clock-cells = <1>;
255c66ec88fSEmmanuel Vadot
256c66ec88fSEmmanuel Vadot      clocks = <&cgu JZ4770_CLK_RTC>,
257c66ec88fSEmmanuel Vadot               <&cgu JZ4770_CLK_EXT>,
258c66ec88fSEmmanuel Vadot               <&cgu JZ4770_CLK_PCLK>;
259c66ec88fSEmmanuel Vadot      clock-names = "rtc", "ext", "pclk";
260c66ec88fSEmmanuel Vadot
261c66ec88fSEmmanuel Vadot      interrupt-controller;
262c66ec88fSEmmanuel Vadot      #interrupt-cells = <1>;
263c66ec88fSEmmanuel Vadot
264c66ec88fSEmmanuel Vadot      interrupt-parent = <&intc>;
265c66ec88fSEmmanuel Vadot      interrupts = <27 26 25>;
266c66ec88fSEmmanuel Vadot
267c66ec88fSEmmanuel Vadot      watchdog: watchdog@0 {
268c66ec88fSEmmanuel Vadot        compatible = "ingenic,jz4770-watchdog", "ingenic,jz4740-watchdog";
269c66ec88fSEmmanuel Vadot        reg = <0x0 0xc>;
270c66ec88fSEmmanuel Vadot
271c66ec88fSEmmanuel Vadot        clocks = <&tcu TCU_CLK_WDT>;
272c66ec88fSEmmanuel Vadot        clock-names = "wdt";
273c66ec88fSEmmanuel Vadot      };
274c66ec88fSEmmanuel Vadot
275c66ec88fSEmmanuel Vadot      pwm: pwm@40 {
276c66ec88fSEmmanuel Vadot        compatible = "ingenic,jz4770-pwm", "ingenic,jz4740-pwm";
277c66ec88fSEmmanuel Vadot        reg = <0x40 0x80>;
278c66ec88fSEmmanuel Vadot
279c66ec88fSEmmanuel Vadot        #pwm-cells = <3>;
280c66ec88fSEmmanuel Vadot
281c66ec88fSEmmanuel Vadot        clocks = <&tcu TCU_CLK_TIMER0>,
282c66ec88fSEmmanuel Vadot                 <&tcu TCU_CLK_TIMER1>,
283c66ec88fSEmmanuel Vadot                 <&tcu TCU_CLK_TIMER2>,
284c66ec88fSEmmanuel Vadot                 <&tcu TCU_CLK_TIMER3>,
285c66ec88fSEmmanuel Vadot                 <&tcu TCU_CLK_TIMER4>,
286c66ec88fSEmmanuel Vadot                 <&tcu TCU_CLK_TIMER5>,
287c66ec88fSEmmanuel Vadot                 <&tcu TCU_CLK_TIMER6>,
288c66ec88fSEmmanuel Vadot                 <&tcu TCU_CLK_TIMER7>;
289c66ec88fSEmmanuel Vadot        clock-names = "timer0", "timer1", "timer2", "timer3",
290c66ec88fSEmmanuel Vadot                "timer4", "timer5", "timer6", "timer7";
291c66ec88fSEmmanuel Vadot      };
292c66ec88fSEmmanuel Vadot
293c66ec88fSEmmanuel Vadot      ost: timer@e0 {
2942eb4d8dcSEmmanuel Vadot        compatible = "ingenic,jz4770-ost", "ingenic,jz4760b-ost";
295c66ec88fSEmmanuel Vadot        reg = <0xe0 0x20>;
296c66ec88fSEmmanuel Vadot
297c66ec88fSEmmanuel Vadot        clocks = <&tcu TCU_CLK_OST>;
298c66ec88fSEmmanuel Vadot        clock-names = "ost";
299c66ec88fSEmmanuel Vadot
300c66ec88fSEmmanuel Vadot        interrupts = <15>;
301c66ec88fSEmmanuel Vadot      };
302c66ec88fSEmmanuel Vadot    };
303