at91-clock.txt 14 KB

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