1Texas Instruments clkctrl clock binding
2
3Texas Instruments SoCs can have a clkctrl clock controller for each
4interconnect target module. The clkctrl clock controller manages functional
5and interface clocks for each module. Each clkctrl controller can also
6gate one or more optional functional clocks for a module, and can have one
7or more clock muxes. There is a clkctrl clock controller typically for each
8interconnect target module on omap4 and later variants.
9
10The clock consumers can specify the index of the clkctrl clock using
11the hardware offset from the clkctrl instance register space. The optional
12clocks can be specified by clkctrl hardware offset and the index of the
13optional clock.
14
15For more information, please see the Linux clock framework binding at
16Documentation/devicetree/bindings/clock/clock-bindings.txt.
17
18Required properties :
19- compatible : shall be "ti,clkctrl" or a clock domain specific name:
20	       "ti,clkctrl-l4-cfg"
21	       "ti,clkctrl-l4-per"
22	       "ti,clkctrl-l4-secure"
23	       "ti,clkctrl-l4-wkup"
24- #clock-cells : shall contain 2 with the first entry being the instance
25		 offset from the clock domain base and the second being the
26		 clock index
27- reg : clock registers
28
29Example: Clock controller node on omap 4430:
30
31&cm2 {
32	l4per: cm@1400 {
33		cm_l4per@0 {
34			cm_l4per_clkctrl: clock@20 {
35				compatible = "ti,clkctrl-l4-per", "ti,clkctrl";
36				reg = <0x20 0x1b0>;
37				#clock-cells = <2>;
38			};
39		};
40	};
41};
42
43Example: Preprocessor helper macros in dt-bindings/clock/ti-clkctrl.h
44
45#define OMAP4_CLKCTRL_OFFSET		0x20
46#define OMAP4_CLKCTRL_INDEX(offset)	((offset) - OMAP4_CLKCTRL_OFFSET)
47#define MODULEMODE_HWCTRL		1
48#define MODULEMODE_SWCTRL		2
49
50#define OMAP4_GPTIMER10_CLKTRL		OMAP4_CLKCTRL_INDEX(0x28)
51#define OMAP4_GPTIMER11_CLKTRL		OMAP4_CLKCTRL_INDEX(0x30)
52#define OMAP4_GPTIMER2_CLKTRL		OMAP4_CLKCTRL_INDEX(0x38)
53...
54#define OMAP4_GPIO2_CLKCTRL		OMAP_CLKCTRL_INDEX(0x60)
55
56Example: Clock consumer node for GPIO2:
57
58&gpio2 {
59       clocks = <&cm_l4per_clkctrl OMAP4_GPIO2_CLKCTRL 0
60		 &cm_l4per_clkctrl OMAP4_GPIO2_CLKCTRL 8>;
61};
62