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