xref: /linux/Documentation/devicetree/bindings/clock/ti-clkctrl.txt (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
135395a9cSTony LindgrenTexas Instruments clkctrl clock binding
235395a9cSTony Lindgren
335395a9cSTony LindgrenTexas Instruments SoCs can have a clkctrl clock controller for each
435395a9cSTony Lindgreninterconnect target module. The clkctrl clock controller manages functional
535395a9cSTony Lindgrenand interface clocks for each module. Each clkctrl controller can also
635395a9cSTony Lindgrengate one or more optional functional clocks for a module, and can have one
735395a9cSTony Lindgrenor more clock muxes. There is a clkctrl clock controller typically for each
835395a9cSTony Lindgreninterconnect target module on omap4 and later variants.
935395a9cSTony Lindgren
1035395a9cSTony LindgrenThe clock consumers can specify the index of the clkctrl clock using
1135395a9cSTony Lindgrenthe hardware offset from the clkctrl instance register space. The optional
1235395a9cSTony Lindgrenclocks can be specified by clkctrl hardware offset and the index of the
1335395a9cSTony Lindgrenoptional clock.
1435395a9cSTony Lindgren
1535395a9cSTony LindgrenFor more information, please see the Linux clock framework binding at
1635395a9cSTony LindgrenDocumentation/devicetree/bindings/clock/clock-bindings.txt.
1735395a9cSTony Lindgren
1835395a9cSTony LindgrenRequired properties :
196c309052STony Lindgren- compatible : shall be "ti,clkctrl" or a clock domain specific name:
206c309052STony Lindgren	       "ti,clkctrl-l4-cfg"
216c309052STony Lindgren	       "ti,clkctrl-l4-per"
226c309052STony Lindgren	       "ti,clkctrl-l4-secure"
236c309052STony Lindgren	       "ti,clkctrl-l4-wkup"
24*8ab42308STony Lindgren- clock-output-names : from common clock binding
2535395a9cSTony Lindgren- #clock-cells : shall contain 2 with the first entry being the instance
2635395a9cSTony Lindgren		 offset from the clock domain base and the second being the
2735395a9cSTony Lindgren		 clock index
286c309052STony Lindgren- reg : clock registers
2935395a9cSTony Lindgren
3035395a9cSTony LindgrenExample: Clock controller node on omap 4430:
3135395a9cSTony Lindgren
3235395a9cSTony Lindgren&cm2 {
3335395a9cSTony Lindgren	l4per: cm@1400 {
3435395a9cSTony Lindgren		cm_l4per@0 {
356c309052STony Lindgren			cm_l4per_clkctrl: clock@20 {
36*8ab42308STony Lindgren				compatible = "ti,clkctrl";
37*8ab42308STony Lindgren				clock-output-names = "l4_per";
3835395a9cSTony Lindgren				reg = <0x20 0x1b0>;
3935395a9cSTony Lindgren				#clock-cells = <2>;
4035395a9cSTony Lindgren			};
4135395a9cSTony Lindgren		};
4235395a9cSTony Lindgren	};
4335395a9cSTony Lindgren};
4435395a9cSTony Lindgren
4535395a9cSTony LindgrenExample: Preprocessor helper macros in dt-bindings/clock/ti-clkctrl.h
4635395a9cSTony Lindgren
4735395a9cSTony Lindgren#define OMAP4_CLKCTRL_OFFSET		0x20
4835395a9cSTony Lindgren#define OMAP4_CLKCTRL_INDEX(offset)	((offset) - OMAP4_CLKCTRL_OFFSET)
4935395a9cSTony Lindgren#define MODULEMODE_HWCTRL		1
5035395a9cSTony Lindgren#define MODULEMODE_SWCTRL		2
5135395a9cSTony Lindgren
5235395a9cSTony Lindgren#define OMAP4_GPTIMER10_CLKTRL		OMAP4_CLKCTRL_INDEX(0x28)
5335395a9cSTony Lindgren#define OMAP4_GPTIMER11_CLKTRL		OMAP4_CLKCTRL_INDEX(0x30)
5435395a9cSTony Lindgren#define OMAP4_GPTIMER2_CLKTRL		OMAP4_CLKCTRL_INDEX(0x38)
5535395a9cSTony Lindgren...
5635395a9cSTony Lindgren#define OMAP4_GPIO2_CLKCTRL		OMAP_CLKCTRL_INDEX(0x60)
5735395a9cSTony Lindgren
5835395a9cSTony LindgrenExample: Clock consumer node for GPIO2:
5935395a9cSTony Lindgren
6035395a9cSTony Lindgren&gpio2 {
6135395a9cSTony Lindgren       clocks = <&cm_l4per_clkctrl OMAP4_GPIO2_CLKCTRL 0
6235395a9cSTony Lindgren		 &cm_l4per_clkctrl OMAP4_GPIO2_CLKCTRL 8>;
6335395a9cSTony Lindgren};
64