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