xref: /freebsd/sys/contrib/device-tree/Bindings/timer/renesas,cmt.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
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/renesas,cmt.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: Renesas Compare Match Timer (CMT)
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Geert Uytterhoeven <geert+renesas@glider.be>
11c66ec88fSEmmanuel Vadot  - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription:
14c66ec88fSEmmanuel Vadot  The CMT is a multi-channel 16/32/48-bit timer/counter with configurable clock
15c66ec88fSEmmanuel Vadot  inputs and programmable compare match.
16c66ec88fSEmmanuel Vadot
17c66ec88fSEmmanuel Vadot  Channels share hardware resources but their counter and compare match values
18c66ec88fSEmmanuel Vadot  are independent. A particular CMT instance can implement only a subset of the
19c66ec88fSEmmanuel Vadot  channels supported by the CMT model. Channel indices represent the hardware
20c66ec88fSEmmanuel Vadot  position of the channel in the CMT and don't match the channel numbers in the
21c66ec88fSEmmanuel Vadot  datasheets.
22c66ec88fSEmmanuel Vadot
23c66ec88fSEmmanuel Vadotproperties:
24c66ec88fSEmmanuel Vadot  compatible:
25c66ec88fSEmmanuel Vadot    oneOf:
26c66ec88fSEmmanuel Vadot      - items:
27c66ec88fSEmmanuel Vadot          - enum:
28c66ec88fSEmmanuel Vadot              - renesas,r8a7740-cmt0      # 32-bit CMT0 on R-Mobile A1
29c66ec88fSEmmanuel Vadot              - renesas,r8a7740-cmt1      # 48-bit CMT1 on R-Mobile A1
30c66ec88fSEmmanuel Vadot              - renesas,r8a7740-cmt2      # 32-bit CMT2 on R-Mobile A1
31c66ec88fSEmmanuel Vadot              - renesas,r8a7740-cmt3      # 32-bit CMT3 on R-Mobile A1
32c66ec88fSEmmanuel Vadot              - renesas,r8a7740-cmt4      # 32-bit CMT4 on R-Mobile A1
33c66ec88fSEmmanuel Vadot              - renesas,sh73a0-cmt0       # 32-bit CMT0 on SH-Mobile AG5
34c66ec88fSEmmanuel Vadot              - renesas,sh73a0-cmt1       # 48-bit CMT1 on SH-Mobile AG5
35c66ec88fSEmmanuel Vadot              - renesas,sh73a0-cmt2       # 32-bit CMT2 on SH-Mobile AG5
36c66ec88fSEmmanuel Vadot              - renesas,sh73a0-cmt3       # 32-bit CMT3 on SH-Mobile AG5
37c66ec88fSEmmanuel Vadot              - renesas,sh73a0-cmt4       # 32-bit CMT4 on SH-Mobile AG5
38c66ec88fSEmmanuel Vadot
39c66ec88fSEmmanuel Vadot      - items:
40c66ec88fSEmmanuel Vadot          - enum:
41c66ec88fSEmmanuel Vadot              - renesas,r8a73a4-cmt0      # 32-bit CMT0 on R-Mobile APE6
426be33864SEmmanuel Vadot              - renesas,r8a7742-cmt0      # 32-bit CMT0 on RZ/G1H
43c66ec88fSEmmanuel Vadot              - renesas,r8a7743-cmt0      # 32-bit CMT0 on RZ/G1M
44c66ec88fSEmmanuel Vadot              - renesas,r8a7744-cmt0      # 32-bit CMT0 on RZ/G1N
45c66ec88fSEmmanuel Vadot              - renesas,r8a7745-cmt0      # 32-bit CMT0 on RZ/G1E
46c66ec88fSEmmanuel Vadot              - renesas,r8a77470-cmt0     # 32-bit CMT0 on RZ/G1C
47c66ec88fSEmmanuel Vadot              - renesas,r8a7790-cmt0      # 32-bit CMT0 on R-Car H2
48c66ec88fSEmmanuel Vadot              - renesas,r8a7791-cmt0      # 32-bit CMT0 on R-Car M2-W
49c66ec88fSEmmanuel Vadot              - renesas,r8a7792-cmt0      # 32-bit CMT0 on R-Car V2H
50c66ec88fSEmmanuel Vadot              - renesas,r8a7793-cmt0      # 32-bit CMT0 on R-Car M2-N
51c66ec88fSEmmanuel Vadot              - renesas,r8a7794-cmt0      # 32-bit CMT0 on R-Car E2
52c66ec88fSEmmanuel Vadot          - const: renesas,rcar-gen2-cmt0 # 32-bit CMT0 on R-Mobile APE6, R-Car Gen2 and RZ/G1
53c66ec88fSEmmanuel Vadot
54c66ec88fSEmmanuel Vadot      - items:
55c66ec88fSEmmanuel Vadot          - enum:
56c66ec88fSEmmanuel Vadot              - renesas,r8a73a4-cmt1      # 48-bit CMT1 on R-Mobile APE6
576be33864SEmmanuel Vadot              - renesas,r8a7742-cmt1      # 48-bit CMT1 on RZ/G1H
58c66ec88fSEmmanuel Vadot              - renesas,r8a7743-cmt1      # 48-bit CMT1 on RZ/G1M
59c66ec88fSEmmanuel Vadot              - renesas,r8a7744-cmt1      # 48-bit CMT1 on RZ/G1N
60c66ec88fSEmmanuel Vadot              - renesas,r8a7745-cmt1      # 48-bit CMT1 on RZ/G1E
61c66ec88fSEmmanuel Vadot              - renesas,r8a77470-cmt1     # 48-bit CMT1 on RZ/G1C
62c66ec88fSEmmanuel Vadot              - renesas,r8a7790-cmt1      # 48-bit CMT1 on R-Car H2
63c66ec88fSEmmanuel Vadot              - renesas,r8a7791-cmt1      # 48-bit CMT1 on R-Car M2-W
64c66ec88fSEmmanuel Vadot              - renesas,r8a7792-cmt1      # 48-bit CMT1 on R-Car V2H
65c66ec88fSEmmanuel Vadot              - renesas,r8a7793-cmt1      # 48-bit CMT1 on R-Car M2-N
66c66ec88fSEmmanuel Vadot              - renesas,r8a7794-cmt1      # 48-bit CMT1 on R-Car E2
67c66ec88fSEmmanuel Vadot          - const: renesas,rcar-gen2-cmt1 # 48-bit CMT1 on R-Mobile APE6, R-Car Gen2 and RZ/G1
68c66ec88fSEmmanuel Vadot
69c66ec88fSEmmanuel Vadot      - items:
70c66ec88fSEmmanuel Vadot          - enum:
71c66ec88fSEmmanuel Vadot              - renesas,r8a774a1-cmt0     # 32-bit CMT0 on RZ/G2M
72c66ec88fSEmmanuel Vadot              - renesas,r8a774b1-cmt0     # 32-bit CMT0 on RZ/G2N
73c66ec88fSEmmanuel Vadot              - renesas,r8a774c0-cmt0     # 32-bit CMT0 on RZ/G2E
746be33864SEmmanuel Vadot              - renesas,r8a774e1-cmt0     # 32-bit CMT0 on RZ/G2H
75c66ec88fSEmmanuel Vadot              - renesas,r8a7795-cmt0      # 32-bit CMT0 on R-Car H3
76c66ec88fSEmmanuel Vadot              - renesas,r8a7796-cmt0      # 32-bit CMT0 on R-Car M3-W
772eb4d8dcSEmmanuel Vadot              - renesas,r8a77961-cmt0     # 32-bit CMT0 on R-Car M3-W+
78c66ec88fSEmmanuel Vadot              - renesas,r8a77965-cmt0     # 32-bit CMT0 on R-Car M3-N
79c66ec88fSEmmanuel Vadot              - renesas,r8a77970-cmt0     # 32-bit CMT0 on R-Car V3M
80c66ec88fSEmmanuel Vadot              - renesas,r8a77980-cmt0     # 32-bit CMT0 on R-Car V3H
81c66ec88fSEmmanuel Vadot              - renesas,r8a77990-cmt0     # 32-bit CMT0 on R-Car E3
82c66ec88fSEmmanuel Vadot              - renesas,r8a77995-cmt0     # 32-bit CMT0 on R-Car D3
83c66ec88fSEmmanuel Vadot          - const: renesas,rcar-gen3-cmt0 # 32-bit CMT0 on R-Car Gen3 and RZ/G2
84c66ec88fSEmmanuel Vadot
85c66ec88fSEmmanuel Vadot      - items:
86c66ec88fSEmmanuel Vadot          - enum:
87c66ec88fSEmmanuel Vadot              - renesas,r8a774a1-cmt1     # 48-bit CMT on RZ/G2M
88c66ec88fSEmmanuel Vadot              - renesas,r8a774b1-cmt1     # 48-bit CMT on RZ/G2N
89c66ec88fSEmmanuel Vadot              - renesas,r8a774c0-cmt1     # 48-bit CMT on RZ/G2E
906be33864SEmmanuel Vadot              - renesas,r8a774e1-cmt1     # 48-bit CMT on RZ/G2H
91c66ec88fSEmmanuel Vadot              - renesas,r8a7795-cmt1      # 48-bit CMT on R-Car H3
92c66ec88fSEmmanuel Vadot              - renesas,r8a7796-cmt1      # 48-bit CMT on R-Car M3-W
932eb4d8dcSEmmanuel Vadot              - renesas,r8a77961-cmt1     # 48-bit CMT on R-Car M3-W+
94c66ec88fSEmmanuel Vadot              - renesas,r8a77965-cmt1     # 48-bit CMT on R-Car M3-N
95c66ec88fSEmmanuel Vadot              - renesas,r8a77970-cmt1     # 48-bit CMT on R-Car V3M
96c66ec88fSEmmanuel Vadot              - renesas,r8a77980-cmt1     # 48-bit CMT on R-Car V3H
97c66ec88fSEmmanuel Vadot              - renesas,r8a77990-cmt1     # 48-bit CMT on R-Car E3
98c66ec88fSEmmanuel Vadot              - renesas,r8a77995-cmt1     # 48-bit CMT on R-Car D3
99c66ec88fSEmmanuel Vadot          - const: renesas,rcar-gen3-cmt1 # 48-bit CMT on R-Car Gen3 and RZ/G2
100c66ec88fSEmmanuel Vadot
101b97ee269SEmmanuel Vadot      - items:
102b97ee269SEmmanuel Vadot          - enum:
103b97ee269SEmmanuel Vadot              - renesas,r8a779a0-cmt0     # 32-bit CMT0 on R-Car V3U
104b97ee269SEmmanuel Vadot              - renesas,r8a779f0-cmt0     # 32-bit CMT0 on R-Car S4-8
105*8bab661aSEmmanuel Vadot              - renesas,r8a779g0-cmt0     # 32-bit CMT0 on R-Car V4H
106b97ee269SEmmanuel Vadot          - const: renesas,rcar-gen4-cmt0 # 32-bit CMT0 on R-Car Gen4
107b97ee269SEmmanuel Vadot
108b97ee269SEmmanuel Vadot      - items:
109b97ee269SEmmanuel Vadot          - enum:
110b97ee269SEmmanuel Vadot              - renesas,r8a779a0-cmt1     # 48-bit CMT on R-Car V3U
111b97ee269SEmmanuel Vadot              - renesas,r8a779f0-cmt1     # 48-bit CMT on R-Car S4-8
112*8bab661aSEmmanuel Vadot              - renesas,r8a779g0-cmt1     # 48-bit CMT on R-Car V4H
113b97ee269SEmmanuel Vadot          - const: renesas,rcar-gen4-cmt1 # 48-bit CMT on R-Car Gen4
114b97ee269SEmmanuel Vadot
115c66ec88fSEmmanuel Vadot  reg:
116c66ec88fSEmmanuel Vadot    maxItems: 1
117c66ec88fSEmmanuel Vadot
118c66ec88fSEmmanuel Vadot  interrupts:
119c66ec88fSEmmanuel Vadot    minItems: 1
120c66ec88fSEmmanuel Vadot    maxItems: 8
121c66ec88fSEmmanuel Vadot
122c66ec88fSEmmanuel Vadot  clocks:
123c66ec88fSEmmanuel Vadot    maxItems: 1
124c66ec88fSEmmanuel Vadot
125c66ec88fSEmmanuel Vadot  clock-names:
126c66ec88fSEmmanuel Vadot    const: fck
127c66ec88fSEmmanuel Vadot
128c66ec88fSEmmanuel Vadot  power-domains:
129c66ec88fSEmmanuel Vadot    maxItems: 1
130c66ec88fSEmmanuel Vadot
131c66ec88fSEmmanuel Vadot  resets:
132c66ec88fSEmmanuel Vadot    maxItems: 1
133c66ec88fSEmmanuel Vadot
134c66ec88fSEmmanuel Vadotrequired:
135c66ec88fSEmmanuel Vadot  - compatible
136c66ec88fSEmmanuel Vadot  - reg
137c66ec88fSEmmanuel Vadot  - interrupts
138c66ec88fSEmmanuel Vadot  - clocks
139c66ec88fSEmmanuel Vadot  - clock-names
140c66ec88fSEmmanuel Vadot  - power-domains
141c66ec88fSEmmanuel Vadot
142c66ec88fSEmmanuel VadotallOf:
143c66ec88fSEmmanuel Vadot  - if:
144c66ec88fSEmmanuel Vadot      properties:
145c66ec88fSEmmanuel Vadot        compatible:
146c66ec88fSEmmanuel Vadot          contains:
147c66ec88fSEmmanuel Vadot            enum:
148c66ec88fSEmmanuel Vadot              - renesas,rcar-gen2-cmt0
149c66ec88fSEmmanuel Vadot              - renesas,rcar-gen3-cmt0
150b97ee269SEmmanuel Vadot              - renesas,rcar-gen4-cmt0
151c66ec88fSEmmanuel Vadot    then:
152c66ec88fSEmmanuel Vadot      properties:
153c66ec88fSEmmanuel Vadot        interrupts:
154c66ec88fSEmmanuel Vadot          minItems: 2
155c66ec88fSEmmanuel Vadot          maxItems: 2
156c66ec88fSEmmanuel Vadot
157c66ec88fSEmmanuel Vadot  - if:
158c66ec88fSEmmanuel Vadot      properties:
159c66ec88fSEmmanuel Vadot        compatible:
160c66ec88fSEmmanuel Vadot          contains:
161c66ec88fSEmmanuel Vadot            enum:
162c66ec88fSEmmanuel Vadot              - renesas,rcar-gen2-cmt1
163c66ec88fSEmmanuel Vadot              - renesas,rcar-gen3-cmt1
164b97ee269SEmmanuel Vadot              - renesas,rcar-gen4-cmt1
165c66ec88fSEmmanuel Vadot    then:
166c66ec88fSEmmanuel Vadot      properties:
167c66ec88fSEmmanuel Vadot        interrupts:
168c66ec88fSEmmanuel Vadot          minItems: 8
169c66ec88fSEmmanuel Vadot          maxItems: 8
170c66ec88fSEmmanuel Vadot
171c66ec88fSEmmanuel VadotadditionalProperties: false
172c66ec88fSEmmanuel Vadot
173c66ec88fSEmmanuel Vadotexamples:
174c66ec88fSEmmanuel Vadot  - |
175c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/r8a7790-cpg-mssr.h>
176c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
177c66ec88fSEmmanuel Vadot    #include <dt-bindings/power/r8a7790-sysc.h>
178c66ec88fSEmmanuel Vadot    cmt0: timer@ffca0000 {
179c66ec88fSEmmanuel Vadot            compatible = "renesas,r8a7790-cmt0", "renesas,rcar-gen2-cmt0";
180c66ec88fSEmmanuel Vadot            reg = <0xffca0000 0x1004>;
181c66ec88fSEmmanuel Vadot            interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
182c66ec88fSEmmanuel Vadot                         <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
183c66ec88fSEmmanuel Vadot            clocks = <&cpg CPG_MOD 124>;
184c66ec88fSEmmanuel Vadot            clock-names = "fck";
185c66ec88fSEmmanuel Vadot            power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
186c66ec88fSEmmanuel Vadot            resets = <&cpg 124>;
187c66ec88fSEmmanuel Vadot    };
188c66ec88fSEmmanuel Vadot
189c66ec88fSEmmanuel Vadot    cmt1: timer@e6130000 {
190c66ec88fSEmmanuel Vadot            compatible = "renesas,r8a7790-cmt1", "renesas,rcar-gen2-cmt1";
191c66ec88fSEmmanuel Vadot            reg = <0xe6130000 0x1004>;
192c66ec88fSEmmanuel Vadot            interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
193c66ec88fSEmmanuel Vadot                         <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
194c66ec88fSEmmanuel Vadot                         <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
195c66ec88fSEmmanuel Vadot                         <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
196c66ec88fSEmmanuel Vadot                         <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
197c66ec88fSEmmanuel Vadot                         <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
198c66ec88fSEmmanuel Vadot                         <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
199c66ec88fSEmmanuel Vadot                         <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
200c66ec88fSEmmanuel Vadot            clocks = <&cpg CPG_MOD 329>;
201c66ec88fSEmmanuel Vadot            clock-names = "fck";
202c66ec88fSEmmanuel Vadot            power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
203c66ec88fSEmmanuel Vadot            resets = <&cpg 329>;
204c66ec88fSEmmanuel Vadot    };
205