Merge tag 'for-linus-5.7-1' of git://github.com/cminyard/linux-ipmi
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / timer / ingenic,tcu.txt
1 Ingenic JZ47xx SoCs Timer/Counter Unit devicetree bindings
2 ==========================================================
3
4 For a description of the TCU hardware and drivers, have a look at
5 Documentation/mips/ingenic-tcu.rst.
6
7 Required properties:
8
9 - compatible: Must be one of:
10   * ingenic,jz4740-tcu
11   * ingenic,jz4725b-tcu
12   * ingenic,jz4770-tcu
13   * ingenic,x1000-tcu
14   followed by "simple-mfd".
15 - reg: Should be the offset/length value corresponding to the TCU registers
16 - clocks: List of phandle & clock specifiers for clocks external to the TCU.
17   The "pclk", "rtc" and "ext" clocks should be provided. The "tcu" clock
18   should be provided if the SoC has it.
19 - clock-names: List of name strings for the external clocks.
20 - #clock-cells: Should be <1>;
21   Clock consumers specify this argument to identify a clock. The valid values
22   may be found in <dt-bindings/clock/ingenic,tcu.h>.
23 - interrupt-controller : Identifies the node as an interrupt controller
24 - #interrupt-cells : Specifies the number of cells needed to encode an
25   interrupt source. The value should be 1.
26 - interrupts : Specifies the interrupt the controller is connected to.
27
28 Optional properties:
29
30 - ingenic,pwm-channels-mask: Bitmask of TCU channels reserved for PWM use.
31   Default value is 0xfc.
32
33
34 Children nodes
35 ==========================================================
36
37
38 PWM node:
39 ---------
40
41 Required properties:
42
43 - compatible: Must be one of:
44   * ingenic,jz4740-pwm
45   * ingenic,jz4725b-pwm
46 - #pwm-cells: Should be 3. See ../pwm/pwm.yaml for a description of the cell
47   format.
48 - clocks: List of phandle & clock specifiers for the TCU clocks.
49 - clock-names: List of name strings for the TCU clocks.
50
51
52 Watchdog node:
53 --------------
54
55 Required properties:
56
57 - compatible: Must be "ingenic,jz4740-watchdog"
58 - clocks: phandle to the WDT clock
59 - clock-names: should be "wdt"
60
61
62 OS Timer node:
63 ---------
64
65 Required properties:
66
67 - compatible: Must be one of:
68   * ingenic,jz4725b-ost
69   * ingenic,jz4770-ost
70 - clocks: phandle to the OST clock
71 - clock-names: should be "ost"
72 - interrupts : Specifies the interrupt the OST is connected to.
73
74
75 Example
76 ==========================================================
77
78 #include <dt-bindings/clock/jz4770-cgu.h>
79 #include <dt-bindings/clock/ingenic,tcu.h>
80
81 / {
82         tcu: timer@10002000 {
83                 compatible = "ingenic,jz4770-tcu", "simple-mfd";
84                 reg = <0x10002000 0x1000>;
85                 #address-cells = <1>;
86                 #size-cells = <1>;
87                 ranges = <0x0 0x10002000 0x1000>;
88
89                 #clock-cells = <1>;
90
91                 clocks = <&cgu JZ4770_CLK_RTC
92                           &cgu JZ4770_CLK_EXT
93                           &cgu JZ4770_CLK_PCLK>;
94                 clock-names = "rtc", "ext", "pclk";
95
96                 interrupt-controller;
97                 #interrupt-cells = <1>;
98
99                 interrupt-parent = <&intc>;
100                 interrupts = <27 26 25>;
101
102                 watchdog: watchdog@0 {
103                         compatible = "ingenic,jz4740-watchdog";
104                         reg = <0x0 0xc>;
105
106                         clocks = <&tcu TCU_CLK_WDT>;
107                         clock-names = "wdt";
108                 };
109
110                 pwm: pwm@40 {
111                         compatible = "ingenic,jz4740-pwm";
112                         reg = <0x40 0x80>;
113
114                         #pwm-cells = <3>;
115
116                         clocks = <&tcu TCU_CLK_TIMER0
117                                   &tcu TCU_CLK_TIMER1
118                                   &tcu TCU_CLK_TIMER2
119                                   &tcu TCU_CLK_TIMER3
120                                   &tcu TCU_CLK_TIMER4
121                                   &tcu TCU_CLK_TIMER5
122                                   &tcu TCU_CLK_TIMER6
123                                   &tcu TCU_CLK_TIMER7>;
124                         clock-names = "timer0", "timer1", "timer2", "timer3",
125                                       "timer4", "timer5", "timer6", "timer7";
126                 };
127
128                 ost: timer@e0 {
129                         compatible = "ingenic,jz4770-ost";
130                         reg = <0xe0 0x20>;
131
132                         clocks = <&tcu TCU_CLK_OST>;
133                         clock-names = "ost";
134
135                         interrupts = <15>;
136                 };
137         };
138 };