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]$":
554b88c673SAlexandre Belloni    description: The timer block channels that are used as timers.
564b88c673SAlexandre Belloni    type: object
574b88c673SAlexandre Belloni    properties:
584b88c673SAlexandre Belloni      compatible:
594b88c673SAlexandre Belloni        const: atmel,tcb-timer
604b88c673SAlexandre Belloni      reg:
614b88c673SAlexandre Belloni        description:
624b88c673SAlexandre Belloni          List of channels to use for this particular timer.
634b88c673SAlexandre Belloni        minItems: 1
644b88c673SAlexandre Belloni        maxItems: 3
654b88c673SAlexandre Belloni
664b88c673SAlexandre Belloni    required:
674b88c673SAlexandre Belloni      - compatible
684b88c673SAlexandre Belloni      - reg
694b88c673SAlexandre Belloni
703f07899fSAlexandre BelloniallOf:
713f07899fSAlexandre Belloni  - if:
723f07899fSAlexandre Belloni      properties:
733f07899fSAlexandre Belloni        compatible:
743f07899fSAlexandre Belloni          contains:
753f07899fSAlexandre Belloni            const: atmel,sama5d2-tcb
763f07899fSAlexandre Belloni    then:
773f07899fSAlexandre Belloni      properties:
783f07899fSAlexandre Belloni        clocks:
793f07899fSAlexandre Belloni          minItems: 3
803f07899fSAlexandre Belloni          maxItems: 3
813f07899fSAlexandre Belloni        clock-names:
823f07899fSAlexandre Belloni          items:
833f07899fSAlexandre Belloni            - const: t0_clk
843f07899fSAlexandre Belloni            - const: gclk
853f07899fSAlexandre Belloni            - const: slow_clk
863f07899fSAlexandre Belloni    else:
873f07899fSAlexandre Belloni      properties:
883f07899fSAlexandre Belloni        clocks:
893f07899fSAlexandre Belloni          minItems: 2
903f07899fSAlexandre Belloni          maxItems: 4
913f07899fSAlexandre Belloni        clock-names:
923f07899fSAlexandre Belloni          oneOf:
933f07899fSAlexandre Belloni            - items:
943f07899fSAlexandre Belloni              - const: t0_clk
953f07899fSAlexandre Belloni              - const: slow_clk
963f07899fSAlexandre Belloni            - items:
973f07899fSAlexandre Belloni              - const: t0_clk
983f07899fSAlexandre Belloni              - const: t1_clk
993f07899fSAlexandre Belloni              - const: t2_clk
1003f07899fSAlexandre Belloni              - const: slow_clk
1013f07899fSAlexandre Belloni
1024b88c673SAlexandre Bellonirequired:
1034b88c673SAlexandre Belloni  - compatible
1044b88c673SAlexandre Belloni  - reg
1054b88c673SAlexandre Belloni  - interrupts
1064b88c673SAlexandre Belloni  - clocks
1074b88c673SAlexandre Belloni  - clock-names
1084b88c673SAlexandre Belloni  - '#address-cells'
1094b88c673SAlexandre Belloni  - '#size-cells'
1104b88c673SAlexandre Belloni
1114b88c673SAlexandre BelloniadditionalProperties: false
1124b88c673SAlexandre Belloni
1134b88c673SAlexandre Belloniexamples:
1144b88c673SAlexandre Belloni  - |
1154b88c673SAlexandre Belloni    /* One interrupt per TC block: */
1164b88c673SAlexandre Belloni        tcb0: timer@fff7c000 {
1174b88c673SAlexandre Belloni                compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
1184b88c673SAlexandre Belloni                #address-cells = <1>;
1194b88c673SAlexandre Belloni                #size-cells = <0>;
1204b88c673SAlexandre Belloni                reg = <0xfff7c000 0x100>;
1214b88c673SAlexandre Belloni                interrupts = <18 4>;
1224b88c673SAlexandre Belloni                clocks = <&tcb0_clk>, <&clk32k>;
1234b88c673SAlexandre Belloni                clock-names = "t0_clk", "slow_clk";
1244b88c673SAlexandre Belloni
1254b88c673SAlexandre Belloni                timer@0 {
1264b88c673SAlexandre Belloni                        compatible = "atmel,tcb-timer";
1274b88c673SAlexandre Belloni                        reg = <0>, <1>;
1284b88c673SAlexandre Belloni                };
1294b88c673SAlexandre Belloni
1304b88c673SAlexandre Belloni                timer@2 {
1314b88c673SAlexandre Belloni                        compatible = "atmel,tcb-timer";
1324b88c673SAlexandre Belloni                        reg = <2>;
1334b88c673SAlexandre Belloni                };
1344b88c673SAlexandre Belloni        };
1354b88c673SAlexandre Belloni
1364b88c673SAlexandre Belloni    /* One interrupt per TC channel in a TC block: */
1374b88c673SAlexandre Belloni        tcb1: timer@fffdc000 {
1384b88c673SAlexandre Belloni                compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
1394b88c673SAlexandre Belloni                #address-cells = <1>;
1404b88c673SAlexandre Belloni                #size-cells = <0>;
1414b88c673SAlexandre Belloni                reg = <0xfffdc000 0x100>;
1424b88c673SAlexandre Belloni                interrupts = <26 4>, <27 4>, <28 4>;
1434b88c673SAlexandre Belloni                clocks = <&tcb1_clk>, <&clk32k>;
1444b88c673SAlexandre Belloni                clock-names = "t0_clk", "slow_clk";
1454b88c673SAlexandre Belloni
1464b88c673SAlexandre Belloni                timer@0 {
1474b88c673SAlexandre Belloni                        compatible = "atmel,tcb-timer";
1484b88c673SAlexandre Belloni                        reg = <0>;
1494b88c673SAlexandre Belloni                };
1504b88c673SAlexandre Belloni
1514b88c673SAlexandre Belloni                timer@1 {
1524b88c673SAlexandre Belloni                        compatible = "atmel,tcb-timer";
1534b88c673SAlexandre Belloni                        reg = <1>;
1544b88c673SAlexandre Belloni                };
1554b88c673SAlexandre Belloni        };
156