Merge tag 'kbuild-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-block.git] / Documentation / devicetree / bindings / clock / at91-clock.txt
1 Device Tree Clock bindings for arch-at91
2
3 This binding uses the common clock binding[1].
4
5 [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
6
7 Required properties:
8 - compatible : shall be one of the following:
9         "atmel,at91sam9x5-sckc" or
10         "atmel,sama5d4-sckc":
11                 at91 SCKC (Slow Clock Controller)
12                 This node contains the slow clock definitions.
13
14         "atmel,at91sam9x5-clk-slow-osc":
15                 at91 slow oscillator
16
17         "atmel,at91sam9x5-clk-slow-rc-osc":
18                 at91 internal slow RC oscillator
19
20         "atmel,at91rm9200-pmc" or
21         "atmel,at91sam9g45-pmc" or
22         "atmel,at91sam9n12-pmc" or
23         "atmel,at91sam9x5-pmc" or
24         "atmel,sama5d3-pmc":
25                 at91 PMC (Power Management Controller)
26                 All at91 specific clocks (clocks defined below) must be child
27                 node of the PMC node.
28
29         "atmel,at91sam9x5-clk-slow" (under sckc node)
30         or
31         "atmel,at91sam9260-clk-slow" (under pmc node):
32                 at91 slow clk
33
34         "atmel,at91rm9200-clk-main-osc"
35         "atmel,at91sam9x5-clk-main-rc-osc"
36                 at91 main clk sources
37
38         "atmel,at91sam9x5-clk-main"
39         "atmel,at91rm9200-clk-main":
40                 at91 main clock
41
42         "atmel,at91rm9200-clk-master" or
43         "atmel,at91sam9x5-clk-master":
44                 at91 master clock
45
46         "atmel,at91sam9x5-clk-peripheral" or
47         "atmel,at91rm9200-clk-peripheral":
48                 at91 peripheral clocks
49
50         "atmel,at91rm9200-clk-pll" or
51         "atmel,at91sam9g45-clk-pll" or
52         "atmel,at91sam9g20-clk-pllb" or
53         "atmel,sama5d3-clk-pll":
54                 at91 pll clocks
55
56         "atmel,at91sam9x5-clk-plldiv":
57                 at91 plla divisor
58
59         "atmel,at91rm9200-clk-programmable" or
60         "atmel,at91sam9g45-clk-programmable" or
61         "atmel,at91sam9x5-clk-programmable":
62                 at91 programmable clocks
63
64         "atmel,at91sam9x5-clk-smd":
65                 at91 SMD (Soft Modem) clock
66
67         "atmel,at91rm9200-clk-system":
68                 at91 system clocks
69
70         "atmel,at91rm9200-clk-usb" or
71         "atmel,at91sam9x5-clk-usb" or
72         "atmel,at91sam9n12-clk-usb":
73                 at91 usb clock
74
75         "atmel,at91sam9x5-clk-utmi":
76                 at91 utmi clock
77
78         "atmel,sama5d4-clk-h32mx":
79                 at91 h32mx clock
80
81         "atmel,sama5d2-clk-generated":
82                 at91 generated clock
83
84         "atmel,sama5d2-clk-audio-pll-frac":
85                 at91 audio fractional pll
86
87         "atmel,sama5d2-clk-audio-pll-pad":
88                 at91 audio pll CLK_AUDIO output pin
89
90         "atmel,sama5d2-clk-audio-pll-pmc"
91                 at91 audio pll output on AUDIOPLLCLK that feeds the PMC
92                 and can be used by peripheral clock or generic clock
93
94 Required properties for SCKC node:
95 - reg : defines the IO memory reserved for the SCKC.
96 - #size-cells : shall be 0 (reg is used to encode clk id).
97 - #address-cells : shall be 1 (reg is used to encode clk id).
98
99
100 For example:
101         sckc: sckc@fffffe50 {
102                 compatible = "atmel,sama5d3-pmc";
103                 reg = <0xfffffe50 0x4>
104                 #size-cells = <0>;
105                 #address-cells = <1>;
106
107                 /* put at91 slow clocks here */
108         };
109
110
111 Required properties for internal slow RC oscillator:
112 - #clock-cells : from common clock binding; shall be set to 0.
113 - clock-frequency : define the internal RC oscillator frequency.
114
115 Optional properties:
116 - clock-accuracy : define the internal RC oscillator accuracy.
117
118 For example:
119         slow_rc_osc: slow_rc_osc {
120                 compatible = "atmel,at91sam9x5-clk-slow-rc-osc";
121                 clock-frequency = <32768>;
122                 clock-accuracy = <50000000>;
123         };
124
125 Required properties for slow oscillator:
126 - #clock-cells : from common clock binding; shall be set to 0.
127 - clocks : shall encode the main osc source clk sources (see atmel datasheet).
128
129 Optional properties:
130 - atmel,osc-bypass : boolean property. Set this when a clock signal is directly
131   provided on XIN.
132
133 For example:
134         slow_osc: slow_osc {
135                 compatible = "atmel,at91rm9200-clk-slow-osc";
136                 #clock-cells = <0>;
137                 clocks = <&slow_xtal>;
138         };
139
140 Required properties for slow clock:
141 - #clock-cells : from common clock binding; shall be set to 0.
142 - clocks : shall encode the slow clk sources (see atmel datasheet).
143
144 For example:
145         clk32k: slck {
146                 compatible = "atmel,at91sam9x5-clk-slow";
147                 #clock-cells = <0>;
148                 clocks = <&slow_rc_osc &slow_osc>;
149         };
150
151 Required properties for PMC node:
152 - reg : defines the IO memory reserved for the PMC.
153 - #size-cells : shall be 0 (reg is used to encode clk id).
154 - #address-cells : shall be 1 (reg is used to encode clk id).
155 - interrupts : shall be set to PMC interrupt line.
156 - interrupt-controller : tell that the PMC is an interrupt controller.
157 - #interrupt-cells : must be set to 1. The first cell encodes the interrupt id,
158         and reflect the bit position in the PMC_ER/DR/SR registers.
159         You can use the dt macros defined in dt-bindings/clock/at91.h.
160         0 (AT91_PMC_MOSCS) -> main oscillator ready
161         1 (AT91_PMC_LOCKA) -> PLL A ready
162         2 (AT91_PMC_LOCKB) -> PLL B ready
163         3 (AT91_PMC_MCKRDY) -> master clock ready
164         6 (AT91_PMC_LOCKU) -> UTMI PLL clock ready
165         8 .. 15 (AT91_PMC_PCKRDY(id)) -> programmable clock ready
166         16 (AT91_PMC_MOSCSELS) -> main oscillator selected
167         17 (AT91_PMC_MOSCRCS) -> RC main oscillator stabilized
168         18 (AT91_PMC_CFDEV) -> clock failure detected
169
170 For example:
171         pmc: pmc@fffffc00 {
172                 compatible = "atmel,sama5d3-pmc";
173                 interrupts = <1 4 7>;
174                 interrupt-controller;
175                 #interrupt-cells = <2>;
176                 #size-cells = <0>;
177                 #address-cells = <1>;
178
179                 /* put at91 clocks here */
180         };
181
182 Required properties for main clock internal RC oscillator:
183 - interrupts : shall be set to "<0>".
184 - clock-frequency : define the internal RC oscillator frequency.
185
186 Optional properties:
187 - clock-accuracy : define the internal RC oscillator accuracy.
188
189 For example:
190         main_rc_osc: main_rc_osc {
191                 compatible = "atmel,at91sam9x5-clk-main-rc-osc";
192                 interrupt-parent = <&pmc>;
193                 interrupts = <0>;
194                 clock-frequency = <12000000>;
195                 clock-accuracy = <50000000>;
196         };
197
198 Required properties for main clock oscillator:
199 - interrupts : shall be set to "<0>".
200 - #clock-cells : from common clock binding; shall be set to 0.
201 - clocks : shall encode the main osc source clk sources (see atmel datasheet).
202
203 Optional properties:
204 - atmel,osc-bypass : boolean property. Specified if a clock signal is provided
205   on XIN.
206
207   clock signal is directly provided on XIN pin.
208
209 For example:
210         main_osc: main_osc {
211                 compatible = "atmel,at91rm9200-clk-main-osc";
212                 interrupt-parent = <&pmc>;
213                 interrupts = <0>;
214                 #clock-cells = <0>;
215                 clocks = <&main_xtal>;
216         };
217
218 Required properties for main clock:
219 - interrupts : shall be set to "<0>".
220 - #clock-cells : from common clock binding; shall be set to 0.
221 - clocks : shall encode the main clk sources (see atmel datasheet).
222
223 For example:
224         main: mainck {
225                 compatible = "atmel,at91sam9x5-clk-main";
226                 interrupt-parent = <&pmc>;
227                 interrupts = <0>;
228                 #clock-cells = <0>;
229                 clocks = <&main_rc_osc &main_osc>;
230         };
231
232 Required properties for master clock:
233 - interrupts : shall be set to "<3>".
234 - #clock-cells : from common clock binding; shall be set to 0.
235 - clocks : shall be the master clock sources (see atmel datasheet) phandles.
236         e.g. "<&ck32k>, <&main>, <&plla>, <&pllb>".
237 - atmel,clk-output-range : minimum and maximum clock frequency (two u32
238                            fields).
239            e.g. output = <0 133000000>; <=> 0 to 133MHz.
240 - atmel,clk-divisors : master clock divisors table (four u32 fields).
241                 0 <=> reserved value.
242                 e.g. divisors = <1 2 4 6>;
243 - atmel,master-clk-have-div3-pres : some SoC use the reserved value 7 in the
244                                     PRES field as CLOCK_DIV3 (e.g sam9x5).
245
246 For example:
247         mck: mck {
248                 compatible = "atmel,at91rm9200-clk-master";
249                 interrupt-parent = <&pmc>;
250                 interrupts = <3>;
251                 #clock-cells = <0>;
252                 atmel,clk-output-range = <0 133000000>;
253                 atmel,clk-divisors = <1 2 4 0>;
254         };
255
256 Required properties for peripheral clocks:
257 - #size-cells : shall be 0 (reg is used to encode clk id).
258 - #address-cells : shall be 1 (reg is used to encode clk id).
259 - clocks : shall be the master clock phandle.
260         e.g. clocks = <&mck>;
261 - name: device tree node describing a specific peripheral clock.
262         * #clock-cells : from common clock binding; shall be set to 0.
263         * reg: peripheral id. See Atmel's datasheets to get a full
264           list of peripheral ids.
265         * atmel,clk-output-range : minimum and maximum clock frequency
266           (two u32 fields). Only valid on at91sam9x5-clk-peripheral
267           compatible IPs.
268
269 For example:
270         periph: periphck {
271                 compatible = "atmel,at91sam9x5-clk-peripheral";
272                 #size-cells = <0>;
273                 #address-cells = <1>;
274                 clocks = <&mck>;
275
276                 ssc0_clk {
277                         #clock-cells = <0>;
278                         reg = <2>;
279                         atmel,clk-output-range = <0 133000000>;
280                 };
281
282                 usart0_clk {
283                         #clock-cells = <0>;
284                         reg = <3>;
285                         atmel,clk-output-range = <0 66000000>;
286                 };
287         };
288
289
290 Required properties for pll clocks:
291 - interrupts : shall be set to "<1>".
292 - #clock-cells : from common clock binding; shall be set to 0.
293 - clocks : shall be the main clock phandle.
294 - reg : pll id.
295         0 -> PLL A
296         1 -> PLL B
297 - atmel,clk-input-range : minimum and maximum source clock frequency (two u32
298                           fields).
299           e.g. input = <1 32000000>; <=> 1 to 32MHz.
300 - #atmel,pll-clk-output-range-cells : number of cells reserved for pll output
301                                       range description. Sould be set to 2, 3
302                                       or 4.
303         * 1st and 2nd cells represent the frequency range (min-max).
304         * 3rd cell is optional and represents the OUT field value for the given
305           range.
306         * 4th cell is optional and represents the ICPLL field (PLLICPR
307           register)
308 - atmel,pll-clk-output-ranges : pll output frequency ranges + optional parameter
309                                 depending on #atmel,pll-output-range-cells
310                                 property value.
311
312 For example:
313         plla: pllack {
314                 compatible = "atmel,at91sam9g45-clk-pll";
315                 interrupt-parent = <&pmc>;
316                 interrupts = <1>;
317                 #clock-cells = <0>;
318                 clocks = <&main>;
319                 reg = <0>;
320                 atmel,clk-input-range = <2000000 32000000>;
321                 #atmel,pll-clk-output-range-cells = <4>;
322                 atmel,pll-clk-output-ranges = <74500000 800000000 0 0
323                                                69500000 750000000 1 0
324                                                64500000 700000000 2 0
325                                                59500000 650000000 3 0
326                                                54500000 600000000 0 1
327                                                49500000 550000000 1 1
328                                                44500000 500000000 2 1
329                                                40000000 450000000 3 1>;
330         };
331
332 Required properties for plldiv clocks (plldiv = pll / 2):
333 - #clock-cells : from common clock binding; shall be set to 0.
334 - clocks : shall be the plla clock phandle.
335
336 The pll divisor is equal to 2 and cannot be changed.
337
338 For example:
339         plladiv: plladivck {
340                 compatible = "atmel,at91sam9x5-clk-plldiv";
341                 #clock-cells = <0>;
342                 clocks = <&plla>;
343         };
344
345 Required properties for programmable clocks:
346 - #size-cells : shall be 0 (reg is used to encode clk id).
347 - #address-cells : shall be 1 (reg is used to encode clk id).
348 - clocks : shall be the programmable clock source phandles.
349         e.g. clocks = <&clk32k>, <&main>, <&plla>, <&pllb>;
350 - name: device tree node describing a specific prog clock.
351         * #clock-cells : from common clock binding; shall be set to 0.
352         * reg : programmable clock id (register offset from  PCKx
353                          register).
354         * interrupts : shall be set to "<(8 + id)>".
355
356 For example:
357         prog: progck {
358                 compatible = "atmel,at91sam9g45-clk-programmable";
359                 #size-cells = <0>;
360                 #address-cells = <1>;
361                 interrupt-parent = <&pmc>;
362                 clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>;
363
364                 prog0 {
365                         #clock-cells = <0>;
366                         reg = <0>;
367                         interrupts = <8>;
368                 };
369
370                 prog1 {
371                         #clock-cells = <0>;
372                         reg = <1>;
373                         interrupts = <9>;
374                 };
375         };
376
377
378 Required properties for smd clock:
379 - #clock-cells : from common clock binding; shall be set to 0.
380 - clocks : shall be the smd clock source phandles.
381         e.g. clocks = <&plladiv>, <&utmi>;
382
383 For example:
384         smd: smdck {
385                 compatible = "atmel,at91sam9x5-clk-smd";
386                 #clock-cells = <0>;
387                 clocks = <&plladiv>, <&utmi>;
388         };
389
390 Required properties for system clocks:
391 - #size-cells : shall be 0 (reg is used to encode clk id).
392 - #address-cells : shall be 1 (reg is used to encode clk id).
393 - name: device tree node describing a specific system clock.
394         * #clock-cells : from common clock binding; shall be set to 0.
395         * reg: system clock id (bit position in SCER/SCDR/SCSR registers).
396               See Atmel's datasheet to get a full list of system clock ids.
397
398 For example:
399         system: systemck {
400                 compatible = "atmel,at91rm9200-clk-system";
401                 #address-cells = <1>;
402                 #size-cells = <0>;
403
404                 ddrck {
405                         #clock-cells = <0>;
406                         reg = <2>;
407                         clocks = <&mck>;
408                 };
409
410                 uhpck {
411                         #clock-cells = <0>;
412                         reg = <6>;
413                         clocks = <&usb>;
414                 };
415
416                 udpck {
417                         #clock-cells = <0>;
418                         reg = <7>;
419                         clocks = <&usb>;
420                 };
421         };
422
423
424 Required properties for usb clock:
425 - #clock-cells : from common clock binding; shall be set to 0.
426 - clocks : shall be the smd clock source phandles.
427         e.g. clocks = <&pllb>;
428 - atmel,clk-divisors (only available for "atmel,at91rm9200-clk-usb"):
429         usb clock divisor table.
430         e.g. divisors = <1 2 4 0>;
431
432 For example:
433         usb: usbck {
434                 compatible = "atmel,at91sam9x5-clk-usb";
435                 #clock-cells = <0>;
436                 clocks = <&plladiv>, <&utmi>;
437         };
438
439         usb: usbck {
440                 compatible = "atmel,at91rm9200-clk-usb";
441                 #clock-cells = <0>;
442                 clocks = <&pllb>;
443                 atmel,clk-divisors = <1 2 4 0>;
444         };
445
446
447 Required properties for utmi clock:
448 - interrupts : shall be set to "<AT91_PMC_LOCKU IRQ_TYPE_LEVEL_HIGH>".
449 - #clock-cells : from common clock binding; shall be set to 0.
450 - clocks : shall be the main clock source phandle.
451
452 For example:
453         utmi: utmick {
454                 compatible = "atmel,at91sam9x5-clk-utmi";
455                 interrupt-parent = <&pmc>;
456                 interrupts = <AT91_PMC_LOCKU IRQ_TYPE_LEVEL_HIGH>;
457                 #clock-cells = <0>;
458                 clocks = <&main>;
459         };
460
461 Required properties for 32 bits bus Matrix clock (h32mx clock):
462 - #clock-cells : from common clock binding; shall be set to 0.
463 - clocks : shall be the master clock source phandle.
464
465 For example:
466         h32ck: h32mxck {
467                 #clock-cells = <0>;
468                 compatible = "atmel,sama5d4-clk-h32mx";
469                 clocks = <&mck>;
470         };
471
472 Required properties for generated clocks:
473 - #size-cells : shall be 0 (reg is used to encode clk id).
474 - #address-cells : shall be 1 (reg is used to encode clk id).
475 - clocks : shall be the generated clock source phandles.
476         e.g. clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>, <&audio_pll_pmc>;
477 - name: device tree node describing a specific generated clock.
478         * #clock-cells : from common clock binding; shall be set to 0.
479         * reg: peripheral id. See Atmel's datasheets to get a full
480           list of peripheral ids.
481         * atmel,clk-output-range : minimum and maximum clock frequency
482           (two u32 fields).
483
484 For example:
485         gck {
486                 compatible = "atmel,sama5d2-clk-generated";
487                 #address-cells = <1>;
488                 #size-cells = <0>;
489                 clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>, <&audio_pll_pmc>;
490
491                 tcb0_gclk: tcb0_gclk {
492                         #clock-cells = <0>;
493                         reg = <35>;
494                         atmel,clk-output-range = <0 83000000>;
495                 };
496
497                 pwm_gclk: pwm_gclk {
498                         #clock-cells = <0>;
499                         reg = <38>;
500                         atmel,clk-output-range = <0 83000000>;
501                 };
502         };