xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/clock/qoriq-clock.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun* Clock Block on Freescale QorIQ Platforms
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunFreescale QorIQ chips take primary clocking input from the external
4*4882a593SmuzhiyunSYSCLK signal. The SYSCLK input (frequency) is multiplied using
5*4882a593Smuzhiyunmultiple phase locked loops (PLL) to create a variety of frequencies
6*4882a593Smuzhiyunwhich can then be passed to a variety of internal logic, including
7*4882a593Smuzhiyuncores and peripheral IP blocks.
8*4882a593SmuzhiyunPlease refer to the Reference Manual for details.
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunAll references to "1.0" and "2.0" refer to the QorIQ chassis version to
11*4882a593Smuzhiyunwhich the chip complies.
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunChassis Version		Example Chips
14*4882a593Smuzhiyun---------------		-------------
15*4882a593Smuzhiyun1.0			p4080, p5020, p5040
16*4882a593Smuzhiyun2.0			t4240, b4860
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun1. Clock Block Binding
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunRequired properties:
21*4882a593Smuzhiyun- compatible: Should contain a chip-specific clock block compatible
22*4882a593Smuzhiyun	string and (if applicable) may contain a chassis-version clock
23*4882a593Smuzhiyun	compatible string.
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun	Chip-specific strings are of the form "fsl,<chip>-clockgen", such as:
26*4882a593Smuzhiyun	* "fsl,p2041-clockgen"
27*4882a593Smuzhiyun	* "fsl,p3041-clockgen"
28*4882a593Smuzhiyun	* "fsl,p4080-clockgen"
29*4882a593Smuzhiyun	* "fsl,p5020-clockgen"
30*4882a593Smuzhiyun	* "fsl,p5040-clockgen"
31*4882a593Smuzhiyun	* "fsl,t1023-clockgen"
32*4882a593Smuzhiyun	* "fsl,t1024-clockgen"
33*4882a593Smuzhiyun	* "fsl,t1040-clockgen"
34*4882a593Smuzhiyun	* "fsl,t1042-clockgen"
35*4882a593Smuzhiyun	* "fsl,t2080-clockgen"
36*4882a593Smuzhiyun	* "fsl,t2081-clockgen"
37*4882a593Smuzhiyun	* "fsl,t4240-clockgen"
38*4882a593Smuzhiyun	* "fsl,b4420-clockgen"
39*4882a593Smuzhiyun	* "fsl,b4860-clockgen"
40*4882a593Smuzhiyun	* "fsl,ls1012a-clockgen"
41*4882a593Smuzhiyun	* "fsl,ls1021a-clockgen"
42*4882a593Smuzhiyun	* "fsl,ls1028a-clockgen"
43*4882a593Smuzhiyun	* "fsl,ls1043a-clockgen"
44*4882a593Smuzhiyun	* "fsl,ls1046a-clockgen"
45*4882a593Smuzhiyun	* "fsl,ls1088a-clockgen"
46*4882a593Smuzhiyun	* "fsl,ls2080a-clockgen"
47*4882a593Smuzhiyun	Chassis-version clock strings include:
48*4882a593Smuzhiyun	* "fsl,qoriq-clockgen-1.0": for chassis 1.0 clocks
49*4882a593Smuzhiyun	* "fsl,qoriq-clockgen-2.0": for chassis 2.0 clocks
50*4882a593Smuzhiyun- reg: Describes the address of the device's resources within the
51*4882a593Smuzhiyun	address space defined by its parent bus, and resource zero
52*4882a593Smuzhiyun	represents the clock register set
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunOptional properties:
55*4882a593Smuzhiyun- ranges: Allows valid translation between child's address space and
56*4882a593Smuzhiyun	parent's. Must be present if the device has sub-nodes.
57*4882a593Smuzhiyun- #address-cells: Specifies the number of cells used to represent
58*4882a593Smuzhiyun	physical base addresses.  Must be present if the device has
59*4882a593Smuzhiyun	sub-nodes and set to 1 if present
60*4882a593Smuzhiyun- #size-cells: Specifies the number of cells used to represent
61*4882a593Smuzhiyun	the size of an address. Must be present if the device has
62*4882a593Smuzhiyun	sub-nodes and set to 1 if present
63*4882a593Smuzhiyun- clock-frequency: Input system clock frequency (SYSCLK)
64*4882a593Smuzhiyun- clocks: If clock-frequency is not specified, sysclk may be provided
65*4882a593Smuzhiyun	as an input clock.  Either clock-frequency or clocks must be
66*4882a593Smuzhiyun	provided.
67*4882a593Smuzhiyun	A second input clock, called "coreclk", may be provided if
68*4882a593Smuzhiyun	core PLLs are based on a different input clock from the
69*4882a593Smuzhiyun	platform PLL.
70*4882a593Smuzhiyun- clock-names: Required if a coreclk is present.  Valid names are
71*4882a593Smuzhiyun	"sysclk" and "coreclk".
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun2. Clock Provider
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunThe clockgen node should act as a clock provider, though in older device
76*4882a593Smuzhiyuntrees the children of the clockgen node are the clock providers.
77*4882a593Smuzhiyun
78*4882a593SmuzhiyunWhen the clockgen node is a clock provider, #clock-cells = <2>.
79*4882a593SmuzhiyunThe first cell of the clock specifier is the clock type, and the
80*4882a593Smuzhiyunsecond cell is the clock index for the specified type.
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun	Type#	Name		Index Cell
83*4882a593Smuzhiyun	0	sysclk		must be 0
84*4882a593Smuzhiyun	1	cmux		index (n in CLKCnCSR)
85*4882a593Smuzhiyun	2	hwaccel		index (n in CLKCGnHWACSR)
86*4882a593Smuzhiyun	3	fman		0 for fm1, 1 for fm2
87*4882a593Smuzhiyun	4	platform pll	n=pll/(n+1). For example, when n=1,
88*4882a593Smuzhiyun				that means output_freq=PLL_freq/2.
89*4882a593Smuzhiyun	5	coreclk		must be 0
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun3. Example
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun	clockgen: global-utilities@e1000 {
94*4882a593Smuzhiyun		compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0";
95*4882a593Smuzhiyun		clock-frequency = <133333333>;
96*4882a593Smuzhiyun		reg = <0xe1000 0x1000>;
97*4882a593Smuzhiyun		#clock-cells = <2>;
98*4882a593Smuzhiyun	};
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun	fman@400000 {
101*4882a593Smuzhiyun		...
102*4882a593Smuzhiyun		clocks = <&clockgen 3 0>;
103*4882a593Smuzhiyun		...
104*4882a593Smuzhiyun	};
105*4882a593Smuzhiyun}
106*4882a593Smuzhiyun4. Legacy Child Nodes
107*4882a593Smuzhiyun
108*4882a593SmuzhiyunNOTE: These nodes are deprecated.  Kernels should continue to support
109*4882a593Smuzhiyundevice trees with these nodes, but new device trees should not use them.
110*4882a593Smuzhiyun
111*4882a593SmuzhiyunMost of the bindings are from the common clock binding[1].
112*4882a593Smuzhiyun [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
113*4882a593Smuzhiyun
114*4882a593SmuzhiyunRequired properties:
115*4882a593Smuzhiyun- compatible : Should include one of the following:
116*4882a593Smuzhiyun	* "fsl,qoriq-core-pll-1.0" for core PLL clocks (v1.0)
117*4882a593Smuzhiyun	* "fsl,qoriq-core-pll-2.0" for core PLL clocks (v2.0)
118*4882a593Smuzhiyun	* "fsl,qoriq-core-mux-1.0" for core mux clocks (v1.0)
119*4882a593Smuzhiyun	* "fsl,qoriq-core-mux-2.0" for core mux clocks (v2.0)
120*4882a593Smuzhiyun	* "fsl,qoriq-sysclk-1.0": for input system clock (v1.0).
121*4882a593Smuzhiyun		It takes parent's clock-frequency as its clock.
122*4882a593Smuzhiyun	* "fsl,qoriq-sysclk-2.0": for input system clock (v2.0).
123*4882a593Smuzhiyun		It takes parent's clock-frequency as its clock.
124*4882a593Smuzhiyun	* "fsl,qoriq-platform-pll-1.0" for the platform PLL clock (v1.0)
125*4882a593Smuzhiyun	* "fsl,qoriq-platform-pll-2.0" for the platform PLL clock (v2.0)
126*4882a593Smuzhiyun- #clock-cells: From common clock binding. The number of cells in a
127*4882a593Smuzhiyun	clock-specifier. Should be <0> for "fsl,qoriq-sysclk-[1,2].0"
128*4882a593Smuzhiyun	clocks, or <1> for "fsl,qoriq-core-pll-[1,2].0" clocks.
129*4882a593Smuzhiyun	For "fsl,qoriq-core-pll-[1,2].0" clocks, the single
130*4882a593Smuzhiyun	clock-specifier cell may take the following values:
131*4882a593Smuzhiyun	* 0 - equal to the PLL frequency
132*4882a593Smuzhiyun	* 1 - equal to the PLL frequency divided by 2
133*4882a593Smuzhiyun	* 2 - equal to the PLL frequency divided by 4
134*4882a593Smuzhiyun
135*4882a593SmuzhiyunRecommended properties:
136*4882a593Smuzhiyun- clocks: Should be the phandle of input parent clock
137*4882a593Smuzhiyun- clock-names: From common clock binding, indicates the clock name
138*4882a593Smuzhiyun- clock-output-names: From common clock binding, indicates the names of
139*4882a593Smuzhiyun	output clocks
140*4882a593Smuzhiyun- reg: Should be the offset and length of clock block base address.
141*4882a593Smuzhiyun	The length should be 4.
142*4882a593Smuzhiyun
143*4882a593SmuzhiyunLegacy Example:
144*4882a593Smuzhiyun/ {
145*4882a593Smuzhiyun	clockgen: global-utilities@e1000 {
146*4882a593Smuzhiyun		compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0";
147*4882a593Smuzhiyun		ranges = <0x0 0xe1000 0x1000>;
148*4882a593Smuzhiyun		clock-frequency = <133333333>;
149*4882a593Smuzhiyun		reg = <0xe1000 0x1000>;
150*4882a593Smuzhiyun		#address-cells = <1>;
151*4882a593Smuzhiyun		#size-cells = <1>;
152*4882a593Smuzhiyun
153*4882a593Smuzhiyun		sysclk: sysclk {
154*4882a593Smuzhiyun			#clock-cells = <0>;
155*4882a593Smuzhiyun			compatible = "fsl,qoriq-sysclk-1.0";
156*4882a593Smuzhiyun			clock-output-names = "sysclk";
157*4882a593Smuzhiyun		};
158*4882a593Smuzhiyun
159*4882a593Smuzhiyun		pll0: pll0@800 {
160*4882a593Smuzhiyun			#clock-cells = <1>;
161*4882a593Smuzhiyun			reg = <0x800 0x4>;
162*4882a593Smuzhiyun			compatible = "fsl,qoriq-core-pll-1.0";
163*4882a593Smuzhiyun			clocks = <&sysclk>;
164*4882a593Smuzhiyun			clock-output-names = "pll0", "pll0-div2";
165*4882a593Smuzhiyun		};
166*4882a593Smuzhiyun
167*4882a593Smuzhiyun		pll1: pll1@820 {
168*4882a593Smuzhiyun			#clock-cells = <1>;
169*4882a593Smuzhiyun			reg = <0x820 0x4>;
170*4882a593Smuzhiyun			compatible = "fsl,qoriq-core-pll-1.0";
171*4882a593Smuzhiyun			clocks = <&sysclk>;
172*4882a593Smuzhiyun			clock-output-names = "pll1", "pll1-div2";
173*4882a593Smuzhiyun		};
174*4882a593Smuzhiyun
175*4882a593Smuzhiyun		mux0: mux0@0 {
176*4882a593Smuzhiyun			#clock-cells = <0>;
177*4882a593Smuzhiyun			reg = <0x0 0x4>;
178*4882a593Smuzhiyun			compatible = "fsl,qoriq-core-mux-1.0";
179*4882a593Smuzhiyun			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
180*4882a593Smuzhiyun			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
181*4882a593Smuzhiyun			clock-output-names = "cmux0";
182*4882a593Smuzhiyun		};
183*4882a593Smuzhiyun
184*4882a593Smuzhiyun		mux1: mux1@20 {
185*4882a593Smuzhiyun			#clock-cells = <0>;
186*4882a593Smuzhiyun			reg = <0x20 0x4>;
187*4882a593Smuzhiyun			compatible = "fsl,qoriq-core-mux-1.0";
188*4882a593Smuzhiyun			clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
189*4882a593Smuzhiyun			clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
190*4882a593Smuzhiyun			clock-output-names = "cmux1";
191*4882a593Smuzhiyun		};
192*4882a593Smuzhiyun
193*4882a593Smuzhiyun		platform-pll: platform-pll@c00 {
194*4882a593Smuzhiyun			#clock-cells = <1>;
195*4882a593Smuzhiyun			reg = <0xc00 0x4>;
196*4882a593Smuzhiyun			compatible = "fsl,qoriq-platform-pll-1.0";
197*4882a593Smuzhiyun			clocks = <&sysclk>;
198*4882a593Smuzhiyun			clock-output-names = "platform-pll", "platform-pll-div2";
199*4882a593Smuzhiyun		};
200*4882a593Smuzhiyun	};
201*4882a593Smuzhiyun};
202*4882a593Smuzhiyun
203*4882a593SmuzhiyunExample for legacy clock consumer:
204*4882a593Smuzhiyun
205*4882a593Smuzhiyun/ {
206*4882a593Smuzhiyun	cpu0: PowerPC,e5500@0 {
207*4882a593Smuzhiyun		...
208*4882a593Smuzhiyun		clocks = <&mux0>;
209*4882a593Smuzhiyun		...
210*4882a593Smuzhiyun	};
211*4882a593Smuzhiyun};
212