at91-clock.txt 14 KB

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