xref: /linux/Documentation/devicetree/bindings/timer/renesas,rz-mtu3.yaml (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
10a9d6b54SBiju Das# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
20a9d6b54SBiju Das%YAML 1.2
30a9d6b54SBiju Das---
40a9d6b54SBiju Das$id: http://devicetree.org/schemas/timer/renesas,rz-mtu3.yaml#
50a9d6b54SBiju Das$schema: http://devicetree.org/meta-schemas/core.yaml#
60a9d6b54SBiju Das
70a9d6b54SBiju Dastitle: Renesas RZ/G2L Multi-Function Timer Pulse Unit 3 (MTU3a)
80a9d6b54SBiju Das
90a9d6b54SBiju Dasmaintainers:
100a9d6b54SBiju Das  - Biju Das <biju.das.jz@bp.renesas.com>
110a9d6b54SBiju Das
120a9d6b54SBiju Dasdescription: |
130a9d6b54SBiju Das  This hardware block consists of eight 16-bit timer channels and one
140a9d6b54SBiju Das  32-bit timer channel. It supports the following specifications:
15b121e788SBiju Das    - Pulse input/output: 28 lines max
160a9d6b54SBiju Das    - Pulse input 3 lines
170a9d6b54SBiju Das    - Count clock 11 clocks for each channel (14 clocks for MTU0, 12 clocks
180a9d6b54SBiju Das      for MTU2, and 10 clocks for MTU5, four clocks for MTU1-MTU2 combination
190a9d6b54SBiju Das      (when LWA = 1))
200a9d6b54SBiju Das    - Operating frequency Up to 100 MHz
210a9d6b54SBiju Das    - Available operations [MTU0 to MTU4, MTU6, MTU7, and MTU8]
220a9d6b54SBiju Das        - Waveform output on compare match
230a9d6b54SBiju Das        - Input capture function (noise filter setting available)
240a9d6b54SBiju Das        - Counter-clearing operation
250a9d6b54SBiju Das        - Simultaneous writing to multiple timer counters (TCNT)
26b121e788SBiju Das          (excluding MTU8)
270a9d6b54SBiju Das        - Simultaneous clearing on compare match or input capture
28b121e788SBiju Das          (excluding MTU8)
290a9d6b54SBiju Das        - Simultaneous input and output to registers in synchronization with
30b121e788SBiju Das          counter operations (excluding MTU8)
310a9d6b54SBiju Das        - Up to 12-phase PWM output in combination with synchronous operation
320a9d6b54SBiju Das          (excluding MTU8)
330a9d6b54SBiju Das    - [MTU0 MTU3, MTU4, MTU6, MTU7, and MTU8]
340a9d6b54SBiju Das        - Buffer operation specifiable
350a9d6b54SBiju Das    - [MTU1, MTU2]
360a9d6b54SBiju Das        - Phase counting mode can be specified independently
370a9d6b54SBiju Das        - 32-bit phase counting mode can be specified for interlocked operation
380a9d6b54SBiju Das          of MTU1 and MTU2 (when TMDR3.LWA = 1)
390a9d6b54SBiju Das        - Cascade connection operation available
400a9d6b54SBiju Das    - [MTU3, MTU4, MTU6, and MTU7]
410a9d6b54SBiju Das        - Through interlocked operation of MTU3/4 and MTU6/7, the positive and
420a9d6b54SBiju Das          negative signals in six phases (12 phases in total) can be output in
43b121e788SBiju Das          complementary PWM and reset-synchronized PWM operation
440a9d6b54SBiju Das        - In complementary PWM mode, values can be transferred from buffer
450a9d6b54SBiju Das          registers to temporary registers at crests and troughs of the timer-
460a9d6b54SBiju Das          counter values or when the buffer registers (TGRD registers in MTU4
47b121e788SBiju Das          and MTU7) are written to
48b121e788SBiju Das        - Double-buffering selectable in complementary PWM mode
490a9d6b54SBiju Das    - [MTU3 and MTU4]
500a9d6b54SBiju Das        - Through interlocking with MTU0, a mode for driving AC synchronous
510a9d6b54SBiju Das          motors (brushless DC motors) by using complementary PWM output and
520a9d6b54SBiju Das          reset-synchronized PWM output is settable and allows the selection
53b121e788SBiju Das          of two types of waveform output (chopping or level)
540a9d6b54SBiju Das    - [MTU5]
55b121e788SBiju Das        - Capable of operation as a dead-time compensation counter
560a9d6b54SBiju Das    - [MTU0/MTU5, MTU1, MTU2, and MTU8]
570a9d6b54SBiju Das        - 32-bit phase counting mode specifiable by combining MTU1 and MTU2 and
58b121e788SBiju Das          through interlocked operation with MTU0/MTU5 and MTU8
590a9d6b54SBiju Das    - Interrupt-skipping function
600a9d6b54SBiju Das        - In complementary PWM mode, interrupts on crests and troughs of counter
610a9d6b54SBiju Das          values and triggers to start conversion by the A/D converter can be
62b121e788SBiju Das          skipped
630a9d6b54SBiju Das    - Interrupt sources: 43 sources.
640a9d6b54SBiju Das    - Buffer operation:
650a9d6b54SBiju Das        - Automatic transfer of register data (transfer from the buffer
660a9d6b54SBiju Das          register to the timer register).
670a9d6b54SBiju Das    - Trigger generation
680a9d6b54SBiju Das        - A/D converter start triggers can be generated
690a9d6b54SBiju Das        - A/D converter start request delaying function enables A/D converter
700a9d6b54SBiju Das          to be started with any desired timing and to be synchronized with
71b121e788SBiju Das          PWM output
720a9d6b54SBiju Das    - Low power consumption function
73b121e788SBiju Das        - The MTU3a can be placed in the module-stop state
740a9d6b54SBiju Das
750a9d6b54SBiju Das    There are two phase counting modes. 16-bit phase counting mode in which
760a9d6b54SBiju Das    MTU1 and MTU2 operate independently, and cascade connection 32-bit phase
770a9d6b54SBiju Das    counting mode in which MTU1 and MTU2 are cascaded.
780a9d6b54SBiju Das
790a9d6b54SBiju Das    In phase counting mode, the phase difference between two external input
800a9d6b54SBiju Das    clocks is detected and the corresponding TCNT is incremented or
810a9d6b54SBiju Das    decremented.
820a9d6b54SBiju Das    The below counters are supported
830a9d6b54SBiju Das      count0 - MTU1 16-bit phase counting
840a9d6b54SBiju Das      count1 - MTU2 16-bit phase counting
850a9d6b54SBiju Das      count2 - MTU1+ MTU2 32-bit phase counting
860a9d6b54SBiju Das
870a9d6b54SBiju Das    The module supports PWM mode{1,2}, Reset-synchronized PWM mode and
880a9d6b54SBiju Das    complementary PWM mode{1,2,3}.
890a9d6b54SBiju Das
900a9d6b54SBiju Das    In complementary PWM mode, six positive-phase and six negative-phase PWM
910a9d6b54SBiju Das    waveforms (12 phases in total) with dead time can be output by
920a9d6b54SBiju Das    combining MTU{3,4} and MTU{6,7}.
930a9d6b54SBiju Das
940a9d6b54SBiju Das    The below pwm channels are supported in pwm mode 1.
950a9d6b54SBiju Das      pwm0  - MTU0.MTIOC0A PWM mode 1
960a9d6b54SBiju Das      pwm1  - MTU0.MTIOC0C PWM mode 1
970a9d6b54SBiju Das      pwm2  - MTU1.MTIOC1A PWM mode 1
980a9d6b54SBiju Das      pwm3  - MTU2.MTIOC2A PWM mode 1
990a9d6b54SBiju Das      pwm4  - MTU3.MTIOC3A PWM mode 1
1000a9d6b54SBiju Das      pwm5  - MTU3.MTIOC3C PWM mode 1
1010a9d6b54SBiju Das      pwm6  - MTU4.MTIOC4A PWM mode 1
1020a9d6b54SBiju Das      pwm7  - MTU4.MTIOC4C PWM mode 1
1030a9d6b54SBiju Das      pwm8  - MTU6.MTIOC6A PWM mode 1
1040a9d6b54SBiju Das      pwm9  - MTU6.MTIOC6C PWM mode 1
1050a9d6b54SBiju Das      pwm10 - MTU7.MTIOC7A PWM mode 1
1060a9d6b54SBiju Das      pwm11 - MTU7.MTIOC7C PWM mode 1
1070a9d6b54SBiju Das
1080a9d6b54SBiju Dasproperties:
1090a9d6b54SBiju Das  compatible:
1100a9d6b54SBiju Das    items:
1110a9d6b54SBiju Das      - enum:
112*078a5babSBiju Das          - renesas,r9a07g043-mtu3  # RZ/{G2UL,Five}
1130a9d6b54SBiju Das          - renesas,r9a07g044-mtu3  # RZ/G2{L,LC}
1140a9d6b54SBiju Das          - renesas,r9a07g054-mtu3  # RZ/V2L
1150a9d6b54SBiju Das      - const: renesas,rz-mtu3
1160a9d6b54SBiju Das
1170a9d6b54SBiju Das  reg:
1180a9d6b54SBiju Das    maxItems: 1
1190a9d6b54SBiju Das
1200a9d6b54SBiju Das  interrupts:
1210a9d6b54SBiju Das    items:
1220a9d6b54SBiju Das      - description: MTU0.TGRA input capture/compare match
1230a9d6b54SBiju Das      - description: MTU0.TGRB input capture/compare match
1240a9d6b54SBiju Das      - description: MTU0.TGRC input capture/compare match
1250a9d6b54SBiju Das      - description: MTU0.TGRD input capture/compare match
1260a9d6b54SBiju Das      - description: MTU0.TCNT overflow
1270a9d6b54SBiju Das      - description: MTU0.TGRE compare match
1280a9d6b54SBiju Das      - description: MTU0.TGRF compare match
1290a9d6b54SBiju Das      - description: MTU1.TGRA input capture/compare match
1300a9d6b54SBiju Das      - description: MTU1.TGRB input capture/compare match
1310a9d6b54SBiju Das      - description: MTU1.TCNT overflow
1320a9d6b54SBiju Das      - description: MTU1.TCNT underflow
1330a9d6b54SBiju Das      - description: MTU2.TGRA input capture/compare match
1340a9d6b54SBiju Das      - description: MTU2.TGRB input capture/compare match
1350a9d6b54SBiju Das      - description: MTU2.TCNT overflow
1360a9d6b54SBiju Das      - description: MTU2.TCNT underflow
1370a9d6b54SBiju Das      - description: MTU3.TGRA input capture/compare match
1380a9d6b54SBiju Das      - description: MTU3.TGRB input capture/compare match
1390a9d6b54SBiju Das      - description: MTU3.TGRC input capture/compare match
1400a9d6b54SBiju Das      - description: MTU3.TGRD input capture/compare match
1410a9d6b54SBiju Das      - description: MTU3.TCNT overflow
1420a9d6b54SBiju Das      - description: MTU4.TGRA input capture/compare match
1430a9d6b54SBiju Das      - description: MTU4.TGRB input capture/compare match
1440a9d6b54SBiju Das      - description: MTU4.TGRC input capture/compare match
1450a9d6b54SBiju Das      - description: MTU4.TGRD input capture/compare match
1460a9d6b54SBiju Das      - description: MTU4.TCNT overflow/underflow
1470a9d6b54SBiju Das      - description: MTU5.TGRU input capture/compare match
1480a9d6b54SBiju Das      - description: MTU5.TGRV input capture/compare match
1490a9d6b54SBiju Das      - description: MTU5.TGRW input capture/compare match
1500a9d6b54SBiju Das      - description: MTU6.TGRA input capture/compare match
1510a9d6b54SBiju Das      - description: MTU6.TGRB input capture/compare match
1520a9d6b54SBiju Das      - description: MTU6.TGRC input capture/compare match
1530a9d6b54SBiju Das      - description: MTU6.TGRD input capture/compare match
1540a9d6b54SBiju Das      - description: MTU6.TCNT overflow
1550a9d6b54SBiju Das      - description: MTU7.TGRA input capture/compare match
1560a9d6b54SBiju Das      - description: MTU7.TGRB input capture/compare match
1570a9d6b54SBiju Das      - description: MTU7.TGRC input capture/compare match
1580a9d6b54SBiju Das      - description: MTU7.TGRD input capture/compare match
1590a9d6b54SBiju Das      - description: MTU7.TCNT overflow/underflow
1600a9d6b54SBiju Das      - description: MTU8.TGRA input capture/compare match
1610a9d6b54SBiju Das      - description: MTU8.TGRB input capture/compare match
1620a9d6b54SBiju Das      - description: MTU8.TGRC input capture/compare match
1630a9d6b54SBiju Das      - description: MTU8.TGRD input capture/compare match
1640a9d6b54SBiju Das      - description: MTU8.TCNT overflow
1650a9d6b54SBiju Das      - description: MTU8.TCNT underflow
1660a9d6b54SBiju Das
1670a9d6b54SBiju Das  interrupt-names:
1680a9d6b54SBiju Das    items:
1690a9d6b54SBiju Das      - const: tgia0
1700a9d6b54SBiju Das      - const: tgib0
1710a9d6b54SBiju Das      - const: tgic0
1720a9d6b54SBiju Das      - const: tgid0
173b7a8f1f7SBiju Das      - const: tciv0
1740a9d6b54SBiju Das      - const: tgie0
1750a9d6b54SBiju Das      - const: tgif0
1760a9d6b54SBiju Das      - const: tgia1
1770a9d6b54SBiju Das      - const: tgib1
178b7a8f1f7SBiju Das      - const: tciv1
179b7a8f1f7SBiju Das      - const: tciu1
1800a9d6b54SBiju Das      - const: tgia2
1810a9d6b54SBiju Das      - const: tgib2
182b7a8f1f7SBiju Das      - const: tciv2
183b7a8f1f7SBiju Das      - const: tciu2
1840a9d6b54SBiju Das      - const: tgia3
1850a9d6b54SBiju Das      - const: tgib3
1860a9d6b54SBiju Das      - const: tgic3
1870a9d6b54SBiju Das      - const: tgid3
188b7a8f1f7SBiju Das      - const: tciv3
1890a9d6b54SBiju Das      - const: tgia4
1900a9d6b54SBiju Das      - const: tgib4
1910a9d6b54SBiju Das      - const: tgic4
1920a9d6b54SBiju Das      - const: tgid4
193b7a8f1f7SBiju Das      - const: tciv4
1940a9d6b54SBiju Das      - const: tgiu5
1950a9d6b54SBiju Das      - const: tgiv5
1960a9d6b54SBiju Das      - const: tgiw5
1970a9d6b54SBiju Das      - const: tgia6
1980a9d6b54SBiju Das      - const: tgib6
1990a9d6b54SBiju Das      - const: tgic6
2000a9d6b54SBiju Das      - const: tgid6
201b7a8f1f7SBiju Das      - const: tciv6
2020a9d6b54SBiju Das      - const: tgia7
2030a9d6b54SBiju Das      - const: tgib7
2040a9d6b54SBiju Das      - const: tgic7
2050a9d6b54SBiju Das      - const: tgid7
206b7a8f1f7SBiju Das      - const: tciv7
2070a9d6b54SBiju Das      - const: tgia8
2080a9d6b54SBiju Das      - const: tgib8
2090a9d6b54SBiju Das      - const: tgic8
2100a9d6b54SBiju Das      - const: tgid8
211b7a8f1f7SBiju Das      - const: tciv8
212b7a8f1f7SBiju Das      - const: tciu8
2130a9d6b54SBiju Das
2140a9d6b54SBiju Das  clocks:
2150a9d6b54SBiju Das    maxItems: 1
2160a9d6b54SBiju Das
2170a9d6b54SBiju Das  power-domains:
2180a9d6b54SBiju Das    maxItems: 1
2190a9d6b54SBiju Das
2200a9d6b54SBiju Das  resets:
2210a9d6b54SBiju Das    maxItems: 1
2220a9d6b54SBiju Das
2230a9d6b54SBiju Das  "#pwm-cells":
2240a9d6b54SBiju Das    const: 2
2250a9d6b54SBiju Das
2260a9d6b54SBiju Dasrequired:
2270a9d6b54SBiju Das  - compatible
2280a9d6b54SBiju Das  - reg
2290a9d6b54SBiju Das  - interrupts
2300a9d6b54SBiju Das  - interrupt-names
2310a9d6b54SBiju Das  - clocks
2320a9d6b54SBiju Das  - power-domains
2330a9d6b54SBiju Das  - resets
2340a9d6b54SBiju Das
2350a9d6b54SBiju DasadditionalProperties: false
2360a9d6b54SBiju Das
2370a9d6b54SBiju Dasexamples:
2380a9d6b54SBiju Das  - |
2390a9d6b54SBiju Das    #include <dt-bindings/clock/r9a07g044-cpg.h>
2400a9d6b54SBiju Das    #include <dt-bindings/interrupt-controller/arm-gic.h>
2410a9d6b54SBiju Das
2420a9d6b54SBiju Das    mtu3: timer@10001200 {
2430a9d6b54SBiju Das      compatible = "renesas,r9a07g044-mtu3", "renesas,rz-mtu3";
2440a9d6b54SBiju Das      reg = <0x10001200 0xb00>;
2450a9d6b54SBiju Das      interrupts = <GIC_SPI 170 IRQ_TYPE_EDGE_RISING>,
2460a9d6b54SBiju Das                   <GIC_SPI 171 IRQ_TYPE_EDGE_RISING>,
2470a9d6b54SBiju Das                   <GIC_SPI 172 IRQ_TYPE_EDGE_RISING>,
2480a9d6b54SBiju Das                   <GIC_SPI 173 IRQ_TYPE_EDGE_RISING>,
2490a9d6b54SBiju Das                   <GIC_SPI 174 IRQ_TYPE_EDGE_RISING>,
2500a9d6b54SBiju Das                   <GIC_SPI 175 IRQ_TYPE_EDGE_RISING>,
2510a9d6b54SBiju Das                   <GIC_SPI 176 IRQ_TYPE_EDGE_RISING>,
2520a9d6b54SBiju Das                   <GIC_SPI 177 IRQ_TYPE_EDGE_RISING>,
2530a9d6b54SBiju Das                   <GIC_SPI 178 IRQ_TYPE_EDGE_RISING>,
2540a9d6b54SBiju Das                   <GIC_SPI 179 IRQ_TYPE_EDGE_RISING>,
2550a9d6b54SBiju Das                   <GIC_SPI 180 IRQ_TYPE_EDGE_RISING>,
2560a9d6b54SBiju Das                   <GIC_SPI 181 IRQ_TYPE_EDGE_RISING>,
2570a9d6b54SBiju Das                   <GIC_SPI 182 IRQ_TYPE_EDGE_RISING>,
2580a9d6b54SBiju Das                   <GIC_SPI 183 IRQ_TYPE_EDGE_RISING>,
2590a9d6b54SBiju Das                   <GIC_SPI 184 IRQ_TYPE_EDGE_RISING>,
2600a9d6b54SBiju Das                   <GIC_SPI 185 IRQ_TYPE_EDGE_RISING>,
2610a9d6b54SBiju Das                   <GIC_SPI 186 IRQ_TYPE_EDGE_RISING>,
2620a9d6b54SBiju Das                   <GIC_SPI 187 IRQ_TYPE_EDGE_RISING>,
2630a9d6b54SBiju Das                   <GIC_SPI 188 IRQ_TYPE_EDGE_RISING>,
2640a9d6b54SBiju Das                   <GIC_SPI 189 IRQ_TYPE_EDGE_RISING>,
2650a9d6b54SBiju Das                   <GIC_SPI 190 IRQ_TYPE_EDGE_RISING>,
2660a9d6b54SBiju Das                   <GIC_SPI 191 IRQ_TYPE_EDGE_RISING>,
2670a9d6b54SBiju Das                   <GIC_SPI 192 IRQ_TYPE_EDGE_RISING>,
2680a9d6b54SBiju Das                   <GIC_SPI 193 IRQ_TYPE_EDGE_RISING>,
2690a9d6b54SBiju Das                   <GIC_SPI 194 IRQ_TYPE_EDGE_RISING>,
2700a9d6b54SBiju Das                   <GIC_SPI 195 IRQ_TYPE_EDGE_RISING>,
2710a9d6b54SBiju Das                   <GIC_SPI 196 IRQ_TYPE_EDGE_RISING>,
2720a9d6b54SBiju Das                   <GIC_SPI 197 IRQ_TYPE_EDGE_RISING>,
2730a9d6b54SBiju Das                   <GIC_SPI 198 IRQ_TYPE_EDGE_RISING>,
2740a9d6b54SBiju Das                   <GIC_SPI 199 IRQ_TYPE_EDGE_RISING>,
2750a9d6b54SBiju Das                   <GIC_SPI 200 IRQ_TYPE_EDGE_RISING>,
2760a9d6b54SBiju Das                   <GIC_SPI 201 IRQ_TYPE_EDGE_RISING>,
2770a9d6b54SBiju Das                   <GIC_SPI 202 IRQ_TYPE_EDGE_RISING>,
2780a9d6b54SBiju Das                   <GIC_SPI 203 IRQ_TYPE_EDGE_RISING>,
2790a9d6b54SBiju Das                   <GIC_SPI 204 IRQ_TYPE_EDGE_RISING>,
2800a9d6b54SBiju Das                   <GIC_SPI 205 IRQ_TYPE_EDGE_RISING>,
2810a9d6b54SBiju Das                   <GIC_SPI 206 IRQ_TYPE_EDGE_RISING>,
2820a9d6b54SBiju Das                   <GIC_SPI 207 IRQ_TYPE_EDGE_RISING>,
2830a9d6b54SBiju Das                   <GIC_SPI 208 IRQ_TYPE_EDGE_RISING>,
2840a9d6b54SBiju Das                   <GIC_SPI 209 IRQ_TYPE_EDGE_RISING>,
2850a9d6b54SBiju Das                   <GIC_SPI 210 IRQ_TYPE_EDGE_RISING>,
2860a9d6b54SBiju Das                   <GIC_SPI 211 IRQ_TYPE_EDGE_RISING>,
2870a9d6b54SBiju Das                   <GIC_SPI 212 IRQ_TYPE_EDGE_RISING>,
2880a9d6b54SBiju Das                   <GIC_SPI 213 IRQ_TYPE_EDGE_RISING>;
289b7a8f1f7SBiju Das      interrupt-names = "tgia0", "tgib0", "tgic0", "tgid0", "tciv0", "tgie0",
2900a9d6b54SBiju Das                        "tgif0",
291b7a8f1f7SBiju Das                        "tgia1", "tgib1", "tciv1", "tciu1",
292b7a8f1f7SBiju Das                        "tgia2", "tgib2", "tciv2", "tciu2",
293b7a8f1f7SBiju Das                        "tgia3", "tgib3", "tgic3", "tgid3", "tciv3",
294b7a8f1f7SBiju Das                        "tgia4", "tgib4", "tgic4", "tgid4", "tciv4",
2950a9d6b54SBiju Das                        "tgiu5", "tgiv5", "tgiw5",
296b7a8f1f7SBiju Das                        "tgia6", "tgib6", "tgic6", "tgid6", "tciv6",
297b7a8f1f7SBiju Das                        "tgia7", "tgib7", "tgic7", "tgid7", "tciv7",
298b7a8f1f7SBiju Das                        "tgia8", "tgib8", "tgic8", "tgid8", "tciv8", "tciu8";
2990a9d6b54SBiju Das      clocks = <&cpg CPG_MOD R9A07G044_MTU_X_MCK_MTU3>;
3000a9d6b54SBiju Das      power-domains = <&cpg>;
3010a9d6b54SBiju Das      resets = <&cpg R9A07G044_MTU_X_PRESET_MTU3>;
3020a9d6b54SBiju Das      #pwm-cells = <2>;
3030a9d6b54SBiju Das    };
304