xref: /openbmc/linux/Documentation/devicetree/bindings/timer/ingenic,tcu.yaml (revision c900529f3d9161bfde5cca0754f83b4d3c3e0220)
149ac0c7cSPaul Cercueil# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
249ac0c7cSPaul Cercueil%YAML 1.2
349ac0c7cSPaul Cercueil---
449ac0c7cSPaul Cercueil$id: http://devicetree.org/schemas/timer/ingenic,tcu.yaml#
549ac0c7cSPaul Cercueil$schema: http://devicetree.org/meta-schemas/core.yaml#
649ac0c7cSPaul Cercueil
7a612130cSKrzysztof Kozlowskititle: Ingenic SoCs Timer/Counter Unit (TCU)
849ac0c7cSPaul Cercueil
949ac0c7cSPaul Cercueildescription: |
1049ac0c7cSPaul Cercueil  For a description of the TCU hardware and drivers, have a look at
11*ec62a746SCosta Shulyupin  Documentation/arch/mips/ingenic-tcu.rst.
1249ac0c7cSPaul Cercueil
1349ac0c7cSPaul Cercueilmaintainers:
1449ac0c7cSPaul Cercueil  - Paul Cercueil <paul@crapouillou.net>
1549ac0c7cSPaul Cercueil
1649ac0c7cSPaul Cercueilselect:
1749ac0c7cSPaul Cercueil  properties:
1849ac0c7cSPaul Cercueil    compatible:
1949ac0c7cSPaul Cercueil      contains:
2049ac0c7cSPaul Cercueil        enum:
2149ac0c7cSPaul Cercueil          - ingenic,jz4740-tcu
2249ac0c7cSPaul Cercueil          - ingenic,jz4725b-tcu
23507d8c5aSPaul Cercueil          - ingenic,jz4760-tcu
24507d8c5aSPaul Cercueil          - ingenic,jz4760b-tcu
2549ac0c7cSPaul Cercueil          - ingenic,jz4770-tcu
2649ac0c7cSPaul Cercueil          - ingenic,jz4780-tcu
2749ac0c7cSPaul Cercueil          - ingenic,x1000-tcu
2849ac0c7cSPaul Cercueil  required:
2949ac0c7cSPaul Cercueil    - compatible
3049ac0c7cSPaul Cercueil
3149ac0c7cSPaul Cercueilproperties:
3249ac0c7cSPaul Cercueil  $nodename:
3349ac0c7cSPaul Cercueil    pattern: "^timer@[0-9a-f]+$"
3449ac0c7cSPaul Cercueil
3549ac0c7cSPaul Cercueil  "#address-cells":
3649ac0c7cSPaul Cercueil    const: 1
3749ac0c7cSPaul Cercueil
3849ac0c7cSPaul Cercueil  "#size-cells":
3949ac0c7cSPaul Cercueil    const: 1
4049ac0c7cSPaul Cercueil
4149ac0c7cSPaul Cercueil  "#clock-cells":
4249ac0c7cSPaul Cercueil    const: 1
4349ac0c7cSPaul Cercueil
4449ac0c7cSPaul Cercueil  "#interrupt-cells":
4549ac0c7cSPaul Cercueil    const: 1
4649ac0c7cSPaul Cercueil
4749ac0c7cSPaul Cercueil  interrupt-controller: true
4849ac0c7cSPaul Cercueil
4949ac0c7cSPaul Cercueil  ranges: true
5049ac0c7cSPaul Cercueil
5149ac0c7cSPaul Cercueil  compatible:
5249ac0c7cSPaul Cercueil    oneOf:
5349ac0c7cSPaul Cercueil      - items:
5449ac0c7cSPaul Cercueil          - enum:
5549ac0c7cSPaul Cercueil              - ingenic,jz4740-tcu
5649ac0c7cSPaul Cercueil              - ingenic,jz4725b-tcu
57507d8c5aSPaul Cercueil              - ingenic,jz4760-tcu
5849ac0c7cSPaul Cercueil              - ingenic,x1000-tcu
5949ac0c7cSPaul Cercueil          - const: simple-mfd
6049ac0c7cSPaul Cercueil      - items:
61507d8c5aSPaul Cercueil          - enum:
62507d8c5aSPaul Cercueil              - ingenic,jz4780-tcu
63507d8c5aSPaul Cercueil              - ingenic,jz4770-tcu
64507d8c5aSPaul Cercueil              - ingenic,jz4760b-tcu
65507d8c5aSPaul Cercueil          - const: ingenic,jz4760-tcu
6649ac0c7cSPaul Cercueil          - const: simple-mfd
6749ac0c7cSPaul Cercueil
6849ac0c7cSPaul Cercueil  reg:
6949ac0c7cSPaul Cercueil    maxItems: 1
7049ac0c7cSPaul Cercueil
7149ac0c7cSPaul Cercueil  clocks:
7249ac0c7cSPaul Cercueil    items:
7349ac0c7cSPaul Cercueil      - description: RTC clock
7449ac0c7cSPaul Cercueil      - description: EXT clock
7549ac0c7cSPaul Cercueil      - description: PCLK clock
7649ac0c7cSPaul Cercueil      - description: TCU clock
7749ac0c7cSPaul Cercueil    minItems: 3
7849ac0c7cSPaul Cercueil
7949ac0c7cSPaul Cercueil  clock-names:
8049ac0c7cSPaul Cercueil    items:
8149ac0c7cSPaul Cercueil      - const: rtc
8249ac0c7cSPaul Cercueil      - const: ext
8349ac0c7cSPaul Cercueil      - const: pclk
8449ac0c7cSPaul Cercueil      - const: tcu
8549ac0c7cSPaul Cercueil    minItems: 3
8649ac0c7cSPaul Cercueil
8749ac0c7cSPaul Cercueil  interrupts:
8849ac0c7cSPaul Cercueil    items:
8949ac0c7cSPaul Cercueil      - description: TCU0 interrupt
9049ac0c7cSPaul Cercueil      - description: TCU1 interrupt
9149ac0c7cSPaul Cercueil      - description: TCU2 interrupt
9249ac0c7cSPaul Cercueil    minItems: 1
9349ac0c7cSPaul Cercueil
9449ac0c7cSPaul Cercueil  assigned-clocks:
9549ac0c7cSPaul Cercueil    minItems: 1
9649ac0c7cSPaul Cercueil    maxItems: 8
9749ac0c7cSPaul Cercueil
9849ac0c7cSPaul Cercueil  assigned-clock-parents:
9949ac0c7cSPaul Cercueil    minItems: 1
10049ac0c7cSPaul Cercueil    maxItems: 8
10149ac0c7cSPaul Cercueil
10249ac0c7cSPaul Cercueil  assigned-clock-rates:
10349ac0c7cSPaul Cercueil    minItems: 1
10449ac0c7cSPaul Cercueil    maxItems: 8
10549ac0c7cSPaul Cercueil
10649ac0c7cSPaul Cercueil  ingenic,pwm-channels-mask:
10749ac0c7cSPaul Cercueil    description: Bitmask of TCU channels reserved for PWM use.
1083d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
1093d21a460SRob Herring    minimum: 0x00
1103d21a460SRob Herring    maximum: 0xff
1113d21a460SRob Herring    default: 0xfc
11249ac0c7cSPaul Cercueil
11349ac0c7cSPaul CercueilpatternProperties:
11449ac0c7cSPaul Cercueil  "^watchdog@[a-f0-9]+$":
11549ac0c7cSPaul Cercueil    type: object
116561a0846SKrzysztof Kozlowski    $ref: /schemas/watchdog/watchdog.yaml#
117d2153e4cSRob Herring    unevaluatedProperties: false
118d2153e4cSRob Herring
11949ac0c7cSPaul Cercueil    properties:
12049ac0c7cSPaul Cercueil      compatible:
12149ac0c7cSPaul Cercueil        oneOf:
12249ac0c7cSPaul Cercueil          - enum:
12349ac0c7cSPaul Cercueil              - ingenic,jz4740-watchdog
12449ac0c7cSPaul Cercueil              - ingenic,jz4780-watchdog
12549ac0c7cSPaul Cercueil          - items:
12692404db7SPaul Cercueil              - enum:
12792404db7SPaul Cercueil                  - ingenic,jz4770-watchdog
128507d8c5aSPaul Cercueil                  - ingenic,jz4760b-watchdog
129507d8c5aSPaul Cercueil                  - ingenic,jz4760-watchdog
13092404db7SPaul Cercueil                  - ingenic,jz4725b-watchdog
13149ac0c7cSPaul Cercueil              - const: ingenic,jz4740-watchdog
13249ac0c7cSPaul Cercueil
13349ac0c7cSPaul Cercueil      reg:
13449ac0c7cSPaul Cercueil        maxItems: 1
13549ac0c7cSPaul Cercueil
13649ac0c7cSPaul Cercueil      clocks:
13749ac0c7cSPaul Cercueil        maxItems: 1
13849ac0c7cSPaul Cercueil
13949ac0c7cSPaul Cercueil      clock-names:
14049ac0c7cSPaul Cercueil        const: wdt
14149ac0c7cSPaul Cercueil
14249ac0c7cSPaul Cercueil    required:
14349ac0c7cSPaul Cercueil      - compatible
14449ac0c7cSPaul Cercueil      - reg
14549ac0c7cSPaul Cercueil      - clocks
14649ac0c7cSPaul Cercueil      - clock-names
14749ac0c7cSPaul Cercueil
14849ac0c7cSPaul Cercueil  "^pwm@[a-f0-9]+$":
14949ac0c7cSPaul Cercueil    type: object
150561a0846SKrzysztof Kozlowski    $ref: /schemas/pwm/pwm.yaml#
151d2153e4cSRob Herring    unevaluatedProperties: false
152d2153e4cSRob Herring
15349ac0c7cSPaul Cercueil    properties:
15449ac0c7cSPaul Cercueil      compatible:
15549ac0c7cSPaul Cercueil        oneOf:
15649ac0c7cSPaul Cercueil          - enum:
15749ac0c7cSPaul Cercueil              - ingenic,jz4740-pwm
15892404db7SPaul Cercueil              - ingenic,jz4725b-pwm
1594f34ebbeSAidan MacDonald              - ingenic,x1000-pwm
16049ac0c7cSPaul Cercueil          - items:
16149ac0c7cSPaul Cercueil              - enum:
162507d8c5aSPaul Cercueil                  - ingenic,jz4760-pwm
163507d8c5aSPaul Cercueil                  - ingenic,jz4760b-pwm
16449ac0c7cSPaul Cercueil                  - ingenic,jz4770-pwm
16549ac0c7cSPaul Cercueil                  - ingenic,jz4780-pwm
16649ac0c7cSPaul Cercueil              - const: ingenic,jz4740-pwm
16749ac0c7cSPaul Cercueil
16849ac0c7cSPaul Cercueil      reg:
16949ac0c7cSPaul Cercueil        maxItems: 1
17049ac0c7cSPaul Cercueil
17149ac0c7cSPaul Cercueil      clocks:
17249ac0c7cSPaul Cercueil        minItems: 6
17349ac0c7cSPaul Cercueil        maxItems: 8
17449ac0c7cSPaul Cercueil
17549ac0c7cSPaul Cercueil      clock-names:
17649ac0c7cSPaul Cercueil        items:
17749ac0c7cSPaul Cercueil          - const: timer0
17849ac0c7cSPaul Cercueil          - const: timer1
17949ac0c7cSPaul Cercueil          - const: timer2
18049ac0c7cSPaul Cercueil          - const: timer3
18149ac0c7cSPaul Cercueil          - const: timer4
18249ac0c7cSPaul Cercueil          - const: timer5
18349ac0c7cSPaul Cercueil          - const: timer6
18449ac0c7cSPaul Cercueil          - const: timer7
18549ac0c7cSPaul Cercueil        minItems: 6
18649ac0c7cSPaul Cercueil
18749ac0c7cSPaul Cercueil    required:
18849ac0c7cSPaul Cercueil      - compatible
18949ac0c7cSPaul Cercueil      - reg
19049ac0c7cSPaul Cercueil      - clocks
19149ac0c7cSPaul Cercueil      - clock-names
19249ac0c7cSPaul Cercueil
19349ac0c7cSPaul Cercueil  "^timer@[a-f0-9]+$":
19449ac0c7cSPaul Cercueil    type: object
19549ac0c7cSPaul Cercueil    properties:
19649ac0c7cSPaul Cercueil      compatible:
19749ac0c7cSPaul Cercueil        oneOf:
19849ac0c7cSPaul Cercueil          - enum:
19949ac0c7cSPaul Cercueil              - ingenic,jz4725b-ost
200507d8c5aSPaul Cercueil              - ingenic,jz4760b-ost
20149ac0c7cSPaul Cercueil          - items:
202507d8c5aSPaul Cercueil              - const: ingenic,jz4760-ost
203507d8c5aSPaul Cercueil              - const: ingenic,jz4725b-ost
204507d8c5aSPaul Cercueil          - items:
205507d8c5aSPaul Cercueil              - enum:
206507d8c5aSPaul Cercueil                  - ingenic,jz4780-ost
207507d8c5aSPaul Cercueil                  - ingenic,jz4770-ost
208507d8c5aSPaul Cercueil              - const: ingenic,jz4760b-ost
20949ac0c7cSPaul Cercueil
21049ac0c7cSPaul Cercueil      reg:
21149ac0c7cSPaul Cercueil        maxItems: 1
21249ac0c7cSPaul Cercueil
21349ac0c7cSPaul Cercueil      clocks:
21449ac0c7cSPaul Cercueil        maxItems: 1
21549ac0c7cSPaul Cercueil
21649ac0c7cSPaul Cercueil      clock-names:
21749ac0c7cSPaul Cercueil        const: ost
21849ac0c7cSPaul Cercueil
21949ac0c7cSPaul Cercueil      interrupts:
22049ac0c7cSPaul Cercueil        maxItems: 1
22149ac0c7cSPaul Cercueil
22249ac0c7cSPaul Cercueil    required:
22349ac0c7cSPaul Cercueil      - compatible
22449ac0c7cSPaul Cercueil      - reg
22549ac0c7cSPaul Cercueil      - clocks
22649ac0c7cSPaul Cercueil      - clock-names
22749ac0c7cSPaul Cercueil      - interrupts
22849ac0c7cSPaul Cercueil
22949ac0c7cSPaul Cercueil    additionalProperties: false
23049ac0c7cSPaul Cercueil
23149ac0c7cSPaul Cercueilrequired:
23249ac0c7cSPaul Cercueil  - "#clock-cells"
23349ac0c7cSPaul Cercueil  - "#interrupt-cells"
23449ac0c7cSPaul Cercueil  - interrupt-controller
23549ac0c7cSPaul Cercueil  - compatible
23649ac0c7cSPaul Cercueil  - reg
23749ac0c7cSPaul Cercueil  - clocks
23849ac0c7cSPaul Cercueil  - clock-names
23949ac0c7cSPaul Cercueil  - interrupts
24049ac0c7cSPaul Cercueil
24149ac0c7cSPaul CercueiladditionalProperties: false
24249ac0c7cSPaul Cercueil
24349ac0c7cSPaul Cercueilexamples:
24449ac0c7cSPaul Cercueil  - |
245c4a11bf4SPaul Cercueil    #include <dt-bindings/clock/ingenic,jz4770-cgu.h>
24649ac0c7cSPaul Cercueil    #include <dt-bindings/clock/ingenic,tcu.h>
24749ac0c7cSPaul Cercueil    tcu: timer@10002000 {
248507d8c5aSPaul Cercueil      compatible = "ingenic,jz4770-tcu", "ingenic,jz4760-tcu", "simple-mfd";
24949ac0c7cSPaul Cercueil      reg = <0x10002000 0x1000>;
25049ac0c7cSPaul Cercueil      #address-cells = <1>;
25149ac0c7cSPaul Cercueil      #size-cells = <1>;
25249ac0c7cSPaul Cercueil      ranges = <0x0 0x10002000 0x1000>;
25349ac0c7cSPaul Cercueil
25449ac0c7cSPaul Cercueil      #clock-cells = <1>;
25549ac0c7cSPaul Cercueil
25649ac0c7cSPaul Cercueil      clocks = <&cgu JZ4770_CLK_RTC>,
25749ac0c7cSPaul Cercueil               <&cgu JZ4770_CLK_EXT>,
25849ac0c7cSPaul Cercueil               <&cgu JZ4770_CLK_PCLK>;
25949ac0c7cSPaul Cercueil      clock-names = "rtc", "ext", "pclk";
26049ac0c7cSPaul Cercueil
26149ac0c7cSPaul Cercueil      interrupt-controller;
26249ac0c7cSPaul Cercueil      #interrupt-cells = <1>;
26349ac0c7cSPaul Cercueil
26449ac0c7cSPaul Cercueil      interrupt-parent = <&intc>;
26549ac0c7cSPaul Cercueil      interrupts = <27 26 25>;
26649ac0c7cSPaul Cercueil
26749ac0c7cSPaul Cercueil      watchdog: watchdog@0 {
26849ac0c7cSPaul Cercueil        compatible = "ingenic,jz4770-watchdog", "ingenic,jz4740-watchdog";
26949ac0c7cSPaul Cercueil        reg = <0x0 0xc>;
27049ac0c7cSPaul Cercueil
27149ac0c7cSPaul Cercueil        clocks = <&tcu TCU_CLK_WDT>;
27249ac0c7cSPaul Cercueil        clock-names = "wdt";
27349ac0c7cSPaul Cercueil      };
27449ac0c7cSPaul Cercueil
27549ac0c7cSPaul Cercueil      pwm: pwm@40 {
27649ac0c7cSPaul Cercueil        compatible = "ingenic,jz4770-pwm", "ingenic,jz4740-pwm";
27749ac0c7cSPaul Cercueil        reg = <0x40 0x80>;
27849ac0c7cSPaul Cercueil
27949ac0c7cSPaul Cercueil        #pwm-cells = <3>;
28049ac0c7cSPaul Cercueil
28149ac0c7cSPaul Cercueil        clocks = <&tcu TCU_CLK_TIMER0>,
28249ac0c7cSPaul Cercueil                 <&tcu TCU_CLK_TIMER1>,
28349ac0c7cSPaul Cercueil                 <&tcu TCU_CLK_TIMER2>,
28449ac0c7cSPaul Cercueil                 <&tcu TCU_CLK_TIMER3>,
28549ac0c7cSPaul Cercueil                 <&tcu TCU_CLK_TIMER4>,
28649ac0c7cSPaul Cercueil                 <&tcu TCU_CLK_TIMER5>,
28749ac0c7cSPaul Cercueil                 <&tcu TCU_CLK_TIMER6>,
28849ac0c7cSPaul Cercueil                 <&tcu TCU_CLK_TIMER7>;
28949ac0c7cSPaul Cercueil        clock-names = "timer0", "timer1", "timer2", "timer3",
29049ac0c7cSPaul Cercueil                "timer4", "timer5", "timer6", "timer7";
29149ac0c7cSPaul Cercueil      };
29249ac0c7cSPaul Cercueil
29349ac0c7cSPaul Cercueil      ost: timer@e0 {
294507d8c5aSPaul Cercueil        compatible = "ingenic,jz4770-ost", "ingenic,jz4760b-ost";
29549ac0c7cSPaul Cercueil        reg = <0xe0 0x20>;
29649ac0c7cSPaul Cercueil
29749ac0c7cSPaul Cercueil        clocks = <&tcu TCU_CLK_OST>;
29849ac0c7cSPaul Cercueil        clock-names = "ost";
29949ac0c7cSPaul Cercueil
30049ac0c7cSPaul Cercueil        interrupts = <15>;
30149ac0c7cSPaul Cercueil      };
30249ac0c7cSPaul Cercueil    };
303