14b88c673SAlexandre Belloni# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
24b88c673SAlexandre Belloni%YAML 1.2
34b88c673SAlexandre Belloni---
44b88c673SAlexandre Belloni$id: "http://devicetree.org/schemas/soc/microchip/atmel,at91rm9200-tcb.yaml#"
54b88c673SAlexandre Belloni$schema: "http://devicetree.org/meta-schemas/core.yaml#"
64b88c673SAlexandre Belloni
74b88c673SAlexandre Bellonititle: Atmel Timer Counter Block
84b88c673SAlexandre Belloni
94b88c673SAlexandre Bellonimaintainers:
104b88c673SAlexandre Belloni  - Alexandre Belloni <alexandre.belloni@bootlin.com>
114b88c673SAlexandre Belloni
124b88c673SAlexandre Bellonidescription: |
134b88c673SAlexandre Belloni  The Atmel (now Microchip) SoCs have timers named Timer Counter Block. Each
144b88c673SAlexandre Belloni  timer has three channels with two counters each.
154b88c673SAlexandre Belloni
164b88c673SAlexandre Belloniproperties:
174b88c673SAlexandre Belloni  compatible:
184b88c673SAlexandre Belloni    items:
194b88c673SAlexandre Belloni      - enum:
204b88c673SAlexandre Belloni          - atmel,at91rm9200-tcb
214b88c673SAlexandre Belloni          - atmel,at91sam9x5-tcb
223f07899fSAlexandre Belloni          - atmel,sama5d2-tcb
234b88c673SAlexandre Belloni      - const: simple-mfd
244b88c673SAlexandre Belloni      - const: syscon
254b88c673SAlexandre Belloni
264b88c673SAlexandre Belloni  reg:
274b88c673SAlexandre Belloni    maxItems: 1
284b88c673SAlexandre Belloni
294b88c673SAlexandre Belloni  interrupts:
304b88c673SAlexandre Belloni    description:
314b88c673SAlexandre Belloni      List of interrupts. One interrupt per TCB channel if available or one
324b88c673SAlexandre Belloni      interrupt for the TC block
334b88c673SAlexandre Belloni    minItems: 1
344b88c673SAlexandre Belloni    maxItems: 3
354b88c673SAlexandre Belloni
364b88c673SAlexandre Belloni  clock-names:
374b88c673SAlexandre Belloni    description:
384b88c673SAlexandre Belloni      List of clock names. Always includes t0_clk and slow clk. Also includes
394b88c673SAlexandre Belloni      t1_clk and t2_clk if a clock per channel is available.
404b88c673SAlexandre Belloni    minItems: 2
414b88c673SAlexandre Belloni    maxItems: 4
424b88c673SAlexandre Belloni
434b88c673SAlexandre Belloni  clocks:
444b88c673SAlexandre Belloni    minItems: 2
454b88c673SAlexandre Belloni    maxItems: 4
464b88c673SAlexandre Belloni
474b88c673SAlexandre Belloni  '#address-cells':
484b88c673SAlexandre Belloni    const: 1
494b88c673SAlexandre Belloni
504b88c673SAlexandre Belloni  '#size-cells':
514b88c673SAlexandre Belloni    const: 0
524b88c673SAlexandre Belloni
534b88c673SAlexandre BellonipatternProperties:
544b88c673SAlexandre Belloni  "^timer@[0-2]$":
557eb181cfSKamel Bouhara    description: The timer block channels that are used as timers or counters.
564b88c673SAlexandre Belloni    type: object
574b88c673SAlexandre Belloni    properties:
584b88c673SAlexandre Belloni      compatible:
597eb181cfSKamel Bouhara        items:
607eb181cfSKamel Bouhara          - enum:
617eb181cfSKamel Bouhara              - atmel,tcb-timer
627eb181cfSKamel Bouhara              - microchip,tcb-capture
634b88c673SAlexandre Belloni      reg:
644b88c673SAlexandre Belloni        description:
657eb181cfSKamel Bouhara          List of channels to use for this particular timer. In Microchip TCB capture
667eb181cfSKamel Bouhara          mode channels are registered as a counter devices, for the qdec mode TCB0's
677eb181cfSKamel Bouhara          channel <0> and <1> are required.
687eb181cfSKamel Bouhara
694b88c673SAlexandre Belloni        minItems: 1
704b88c673SAlexandre Belloni        maxItems: 3
714b88c673SAlexandre Belloni
724b88c673SAlexandre Belloni    required:
734b88c673SAlexandre Belloni      - compatible
744b88c673SAlexandre Belloni      - reg
754b88c673SAlexandre Belloni
763f07899fSAlexandre BelloniallOf:
773f07899fSAlexandre Belloni  - if:
783f07899fSAlexandre Belloni      properties:
793f07899fSAlexandre Belloni        compatible:
803f07899fSAlexandre Belloni          contains:
813f07899fSAlexandre Belloni            const: atmel,sama5d2-tcb
823f07899fSAlexandre Belloni    then:
833f07899fSAlexandre Belloni      properties:
843f07899fSAlexandre Belloni        clocks:
853f07899fSAlexandre Belloni          minItems: 3
863f07899fSAlexandre Belloni          maxItems: 3
873f07899fSAlexandre Belloni        clock-names:
883f07899fSAlexandre Belloni          items:
893f07899fSAlexandre Belloni            - const: t0_clk
903f07899fSAlexandre Belloni            - const: gclk
913f07899fSAlexandre Belloni            - const: slow_clk
923f07899fSAlexandre Belloni    else:
933f07899fSAlexandre Belloni      properties:
943f07899fSAlexandre Belloni        clocks:
953f07899fSAlexandre Belloni          minItems: 2
963f07899fSAlexandre Belloni          maxItems: 4
973f07899fSAlexandre Belloni        clock-names:
983f07899fSAlexandre Belloni          oneOf:
993f07899fSAlexandre Belloni            - items:
1003f07899fSAlexandre Belloni              - const: t0_clk
1013f07899fSAlexandre Belloni              - const: slow_clk
1023f07899fSAlexandre Belloni            - items:
1033f07899fSAlexandre Belloni              - const: t0_clk
1043f07899fSAlexandre Belloni              - const: t1_clk
1053f07899fSAlexandre Belloni              - const: t2_clk
1063f07899fSAlexandre Belloni              - const: slow_clk
1073f07899fSAlexandre Belloni
1084b88c673SAlexandre Bellonirequired:
1094b88c673SAlexandre Belloni  - compatible
1104b88c673SAlexandre Belloni  - reg
1114b88c673SAlexandre Belloni  - interrupts
1124b88c673SAlexandre Belloni  - clocks
1134b88c673SAlexandre Belloni  - clock-names
1144b88c673SAlexandre Belloni  - '#address-cells'
1154b88c673SAlexandre Belloni  - '#size-cells'
1164b88c673SAlexandre Belloni
1174b88c673SAlexandre BelloniadditionalProperties: false
1184b88c673SAlexandre Belloni
1194b88c673SAlexandre Belloniexamples:
1204b88c673SAlexandre Belloni  - |
1214b88c673SAlexandre Belloni    /* One interrupt per TC block: */
1224b88c673SAlexandre Belloni        tcb0: timer@fff7c000 {
1234b88c673SAlexandre Belloni                compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
1244b88c673SAlexandre Belloni                #address-cells = <1>;
1254b88c673SAlexandre Belloni                #size-cells = <0>;
1264b88c673SAlexandre Belloni                reg = <0xfff7c000 0x100>;
1274b88c673SAlexandre Belloni                interrupts = <18 4>;
1284b88c673SAlexandre Belloni                clocks = <&tcb0_clk>, <&clk32k>;
1294b88c673SAlexandre Belloni                clock-names = "t0_clk", "slow_clk";
1304b88c673SAlexandre Belloni
1314b88c673SAlexandre Belloni                timer@0 {
1324b88c673SAlexandre Belloni                        compatible = "atmel,tcb-timer";
1334b88c673SAlexandre Belloni                        reg = <0>, <1>;
1344b88c673SAlexandre Belloni                };
1354b88c673SAlexandre Belloni
1364b88c673SAlexandre Belloni                timer@2 {
1374b88c673SAlexandre Belloni                        compatible = "atmel,tcb-timer";
1384b88c673SAlexandre Belloni                        reg = <2>;
1394b88c673SAlexandre Belloni                };
1404b88c673SAlexandre Belloni        };
1414b88c673SAlexandre Belloni
1424b88c673SAlexandre Belloni    /* One interrupt per TC channel in a TC block: */
1434b88c673SAlexandre Belloni        tcb1: timer@fffdc000 {
1444b88c673SAlexandre Belloni                compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
1454b88c673SAlexandre Belloni                #address-cells = <1>;
1464b88c673SAlexandre Belloni                #size-cells = <0>;
1474b88c673SAlexandre Belloni                reg = <0xfffdc000 0x100>;
1484b88c673SAlexandre Belloni                interrupts = <26 4>, <27 4>, <28 4>;
1494b88c673SAlexandre Belloni                clocks = <&tcb1_clk>, <&clk32k>;
1504b88c673SAlexandre Belloni                clock-names = "t0_clk", "slow_clk";
1514b88c673SAlexandre Belloni
1524b88c673SAlexandre Belloni                timer@0 {
1534b88c673SAlexandre Belloni                        compatible = "atmel,tcb-timer";
1544b88c673SAlexandre Belloni                        reg = <0>;
1554b88c673SAlexandre Belloni                };
1564b88c673SAlexandre Belloni
1574b88c673SAlexandre Belloni                timer@1 {
1584b88c673SAlexandre Belloni                        compatible = "atmel,tcb-timer";
1594b88c673SAlexandre Belloni                        reg = <1>;
1604b88c673SAlexandre Belloni                };
1614b88c673SAlexandre Belloni        };
1627eb181cfSKamel Bouhara    /* TCB0 Capture with QDEC: */
1637eb181cfSKamel Bouhara        timer@f800c000 {
1647eb181cfSKamel Bouhara                compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
1657eb181cfSKamel Bouhara                #address-cells = <1>;
1667eb181cfSKamel Bouhara                #size-cells = <0>;
1677eb181cfSKamel Bouhara                reg = <0xfff7c000 0x100>;
1687eb181cfSKamel Bouhara                interrupts = <18 4>;
1697eb181cfSKamel Bouhara                clocks = <&tcb0_clk>, <&clk32k>;
1707eb181cfSKamel Bouhara                clock-names = "t0_clk", "slow_clk";
1717eb181cfSKamel Bouhara
1727eb181cfSKamel Bouhara                timer@0 {
1737eb181cfSKamel Bouhara                        compatible = "microchip,tcb-capture";
1747eb181cfSKamel Bouhara                        reg = <0>, <1>;
1757eb181cfSKamel Bouhara                };
1767eb181cfSKamel Bouhara
1777eb181cfSKamel Bouhara                timer@2 {
1787eb181cfSKamel Bouhara                        compatible = "atmel,tcb-timer";
1797eb181cfSKamel Bouhara                        reg = <2>;
1807eb181cfSKamel Bouhara                };
1817eb181cfSKamel Bouhara        };
182