at91-clock.txt 15 KB

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