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