clk-exynos7.c 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. /*
  2. * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  3. * Author: Naveen Krishna Ch <naveenkrishna.ch@gmail.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. */
  10. #include <linux/clk.h>
  11. #include <linux/clkdev.h>
  12. #include <linux/clk-provider.h>
  13. #include <linux/of.h>
  14. #include "clk.h"
  15. #include <dt-bindings/clock/exynos7-clk.h>
  16. /* Register Offset definitions for CMU_TOPC (0x10570000) */
  17. #define CC_PLL_LOCK 0x0000
  18. #define BUS0_PLL_LOCK 0x0004
  19. #define BUS1_DPLL_LOCK 0x0008
  20. #define MFC_PLL_LOCK 0x000C
  21. #define AUD_PLL_LOCK 0x0010
  22. #define CC_PLL_CON0 0x0100
  23. #define BUS0_PLL_CON0 0x0110
  24. #define BUS1_DPLL_CON0 0x0120
  25. #define MFC_PLL_CON0 0x0130
  26. #define AUD_PLL_CON0 0x0140
  27. #define MUX_SEL_TOPC0 0x0200
  28. #define MUX_SEL_TOPC1 0x0204
  29. #define MUX_SEL_TOPC2 0x0208
  30. #define MUX_SEL_TOPC3 0x020C
  31. #define DIV_TOPC0 0x0600
  32. #define DIV_TOPC1 0x0604
  33. #define DIV_TOPC3 0x060C
  34. #define ENABLE_ACLK_TOPC1 0x0804
  35. static struct samsung_fixed_factor_clock topc_fixed_factor_clks[] __initdata = {
  36. FFACTOR(0, "ffac_topc_bus0_pll_div2", "mout_bus0_pll_ctrl", 1, 2, 0),
  37. FFACTOR(0, "ffac_topc_bus0_pll_div4",
  38. "ffac_topc_bus0_pll_div2", 1, 2, 0),
  39. FFACTOR(0, "ffac_topc_bus1_pll_div2", "mout_bus1_pll_ctrl", 1, 2, 0),
  40. FFACTOR(0, "ffac_topc_cc_pll_div2", "mout_cc_pll_ctrl", 1, 2, 0),
  41. FFACTOR(0, "ffac_topc_mfc_pll_div2", "mout_mfc_pll_ctrl", 1, 2, 0),
  42. };
  43. /* List of parent clocks for Muxes in CMU_TOPC */
  44. PNAME(mout_aud_pll_ctrl_p) = { "fin_pll", "fout_aud_pll" };
  45. PNAME(mout_bus0_pll_ctrl_p) = { "fin_pll", "fout_bus0_pll" };
  46. PNAME(mout_bus1_pll_ctrl_p) = { "fin_pll", "fout_bus1_pll" };
  47. PNAME(mout_cc_pll_ctrl_p) = { "fin_pll", "fout_cc_pll" };
  48. PNAME(mout_mfc_pll_ctrl_p) = { "fin_pll", "fout_mfc_pll" };
  49. PNAME(mout_topc_group2) = { "mout_sclk_bus0_pll_cmuc",
  50. "mout_sclk_bus1_pll_cmuc", "mout_sclk_cc_pll_cmuc",
  51. "mout_sclk_mfc_pll_cmuc" };
  52. PNAME(mout_sclk_bus0_pll_cmuc_p) = { "mout_bus0_pll_ctrl",
  53. "ffac_topc_bus0_pll_div2", "ffac_topc_bus0_pll_div4"};
  54. PNAME(mout_sclk_bus1_pll_cmuc_p) = { "mout_bus1_pll_ctrl",
  55. "ffac_topc_bus1_pll_div2"};
  56. PNAME(mout_sclk_cc_pll_cmuc_p) = { "mout_cc_pll_ctrl",
  57. "ffac_topc_cc_pll_div2"};
  58. PNAME(mout_sclk_mfc_pll_cmuc_p) = { "mout_mfc_pll_ctrl",
  59. "ffac_topc_mfc_pll_div2"};
  60. PNAME(mout_sclk_bus0_pll_out_p) = {"mout_bus0_pll_ctrl",
  61. "ffac_topc_bus0_pll_div2"};
  62. static unsigned long topc_clk_regs[] __initdata = {
  63. CC_PLL_LOCK,
  64. BUS0_PLL_LOCK,
  65. BUS1_DPLL_LOCK,
  66. MFC_PLL_LOCK,
  67. AUD_PLL_LOCK,
  68. CC_PLL_CON0,
  69. BUS0_PLL_CON0,
  70. BUS1_DPLL_CON0,
  71. MFC_PLL_CON0,
  72. AUD_PLL_CON0,
  73. MUX_SEL_TOPC0,
  74. MUX_SEL_TOPC1,
  75. MUX_SEL_TOPC2,
  76. MUX_SEL_TOPC3,
  77. DIV_TOPC0,
  78. DIV_TOPC1,
  79. DIV_TOPC3,
  80. };
  81. static struct samsung_mux_clock topc_mux_clks[] __initdata = {
  82. MUX(0, "mout_bus0_pll_ctrl", mout_bus0_pll_ctrl_p, MUX_SEL_TOPC0, 0, 1),
  83. MUX(0, "mout_bus1_pll_ctrl", mout_bus1_pll_ctrl_p, MUX_SEL_TOPC0, 4, 1),
  84. MUX(0, "mout_cc_pll_ctrl", mout_cc_pll_ctrl_p, MUX_SEL_TOPC0, 8, 1),
  85. MUX(0, "mout_mfc_pll_ctrl", mout_mfc_pll_ctrl_p, MUX_SEL_TOPC0, 12, 1),
  86. MUX(0, "mout_sclk_bus0_pll_cmuc", mout_sclk_bus0_pll_cmuc_p,
  87. MUX_SEL_TOPC0, 16, 2),
  88. MUX(0, "mout_sclk_bus1_pll_cmuc", mout_sclk_bus1_pll_cmuc_p,
  89. MUX_SEL_TOPC0, 20, 1),
  90. MUX(0, "mout_sclk_cc_pll_cmuc", mout_sclk_cc_pll_cmuc_p,
  91. MUX_SEL_TOPC0, 24, 1),
  92. MUX(0, "mout_sclk_mfc_pll_cmuc", mout_sclk_mfc_pll_cmuc_p,
  93. MUX_SEL_TOPC0, 28, 1),
  94. MUX(0, "mout_sclk_bus0_pll_out", mout_sclk_bus0_pll_out_p,
  95. MUX_SEL_TOPC1, 16, 1),
  96. MUX(0, "mout_aud_pll_ctrl", mout_aud_pll_ctrl_p, MUX_SEL_TOPC1, 0, 1),
  97. MUX(0, "mout_aclk_ccore_133", mout_topc_group2, MUX_SEL_TOPC2, 4, 2),
  98. MUX(0, "mout_aclk_mscl_532", mout_topc_group2, MUX_SEL_TOPC3, 20, 2),
  99. MUX(0, "mout_aclk_peris_66", mout_topc_group2, MUX_SEL_TOPC3, 24, 2),
  100. };
  101. static struct samsung_div_clock topc_div_clks[] __initdata = {
  102. DIV(DOUT_ACLK_CCORE_133, "dout_aclk_ccore_133", "mout_aclk_ccore_133",
  103. DIV_TOPC0, 4, 4),
  104. DIV(DOUT_ACLK_MSCL_532, "dout_aclk_mscl_532", "mout_aclk_mscl_532",
  105. DIV_TOPC1, 20, 4),
  106. DIV(DOUT_ACLK_PERIS, "dout_aclk_peris_66", "mout_aclk_peris_66",
  107. DIV_TOPC1, 24, 4),
  108. DIV(DOUT_SCLK_BUS0_PLL, "dout_sclk_bus0_pll", "mout_sclk_bus0_pll_out",
  109. DIV_TOPC3, 0, 3),
  110. DIV(DOUT_SCLK_BUS1_PLL, "dout_sclk_bus1_pll", "mout_bus1_pll_ctrl",
  111. DIV_TOPC3, 8, 3),
  112. DIV(DOUT_SCLK_CC_PLL, "dout_sclk_cc_pll", "mout_cc_pll_ctrl",
  113. DIV_TOPC3, 12, 3),
  114. DIV(DOUT_SCLK_MFC_PLL, "dout_sclk_mfc_pll", "mout_mfc_pll_ctrl",
  115. DIV_TOPC3, 16, 3),
  116. DIV(DOUT_SCLK_AUD_PLL, "dout_sclk_aud_pll", "mout_aud_pll_ctrl",
  117. DIV_TOPC3, 28, 3),
  118. };
  119. static struct samsung_pll_rate_table pll1460x_24mhz_tbl[] __initdata = {
  120. PLL_36XX_RATE(491520000, 20, 1, 0, 31457),
  121. {},
  122. };
  123. static struct samsung_gate_clock topc_gate_clks[] __initdata = {
  124. GATE(ACLK_MSCL_532, "aclk_mscl_532", "dout_aclk_mscl_532",
  125. ENABLE_ACLK_TOPC1, 20, 0, 0),
  126. };
  127. static struct samsung_pll_clock topc_pll_clks[] __initdata = {
  128. PLL(pll_1451x, 0, "fout_bus0_pll", "fin_pll", BUS0_PLL_LOCK,
  129. BUS0_PLL_CON0, NULL),
  130. PLL(pll_1452x, 0, "fout_cc_pll", "fin_pll", CC_PLL_LOCK,
  131. CC_PLL_CON0, NULL),
  132. PLL(pll_1452x, 0, "fout_bus1_pll", "fin_pll", BUS1_DPLL_LOCK,
  133. BUS1_DPLL_CON0, NULL),
  134. PLL(pll_1452x, 0, "fout_mfc_pll", "fin_pll", MFC_PLL_LOCK,
  135. MFC_PLL_CON0, NULL),
  136. PLL(pll_1460x, FOUT_AUD_PLL, "fout_aud_pll", "fin_pll", AUD_PLL_LOCK,
  137. AUD_PLL_CON0, pll1460x_24mhz_tbl),
  138. };
  139. static struct samsung_cmu_info topc_cmu_info __initdata = {
  140. .pll_clks = topc_pll_clks,
  141. .nr_pll_clks = ARRAY_SIZE(topc_pll_clks),
  142. .mux_clks = topc_mux_clks,
  143. .nr_mux_clks = ARRAY_SIZE(topc_mux_clks),
  144. .div_clks = topc_div_clks,
  145. .nr_div_clks = ARRAY_SIZE(topc_div_clks),
  146. .gate_clks = topc_gate_clks,
  147. .nr_gate_clks = ARRAY_SIZE(topc_gate_clks),
  148. .fixed_factor_clks = topc_fixed_factor_clks,
  149. .nr_fixed_factor_clks = ARRAY_SIZE(topc_fixed_factor_clks),
  150. .nr_clk_ids = TOPC_NR_CLK,
  151. .clk_regs = topc_clk_regs,
  152. .nr_clk_regs = ARRAY_SIZE(topc_clk_regs),
  153. };
  154. static void __init exynos7_clk_topc_init(struct device_node *np)
  155. {
  156. samsung_cmu_register_one(np, &topc_cmu_info);
  157. }
  158. CLK_OF_DECLARE(exynos7_clk_topc, "samsung,exynos7-clock-topc",
  159. exynos7_clk_topc_init);
  160. /* Register Offset definitions for CMU_TOP0 (0x105D0000) */
  161. #define MUX_SEL_TOP00 0x0200
  162. #define MUX_SEL_TOP01 0x0204
  163. #define MUX_SEL_TOP03 0x020C
  164. #define MUX_SEL_TOP0_PERIC0 0x0230
  165. #define MUX_SEL_TOP0_PERIC1 0x0234
  166. #define MUX_SEL_TOP0_PERIC2 0x0238
  167. #define MUX_SEL_TOP0_PERIC3 0x023C
  168. #define DIV_TOP03 0x060C
  169. #define DIV_TOP0_PERIC0 0x0630
  170. #define DIV_TOP0_PERIC1 0x0634
  171. #define DIV_TOP0_PERIC2 0x0638
  172. #define DIV_TOP0_PERIC3 0x063C
  173. #define ENABLE_SCLK_TOP0_PERIC0 0x0A30
  174. #define ENABLE_SCLK_TOP0_PERIC1 0x0A34
  175. #define ENABLE_SCLK_TOP0_PERIC2 0x0A38
  176. #define ENABLE_SCLK_TOP0_PERIC3 0x0A3C
  177. /* List of parent clocks for Muxes in CMU_TOP0 */
  178. PNAME(mout_bus0_pll_p) = { "fin_pll", "dout_sclk_bus0_pll" };
  179. PNAME(mout_bus1_pll_p) = { "fin_pll", "dout_sclk_bus1_pll" };
  180. PNAME(mout_cc_pll_p) = { "fin_pll", "dout_sclk_cc_pll" };
  181. PNAME(mout_mfc_pll_p) = { "fin_pll", "dout_sclk_mfc_pll" };
  182. PNAME(mout_aud_pll_p) = { "fin_pll", "dout_sclk_aud_pll" };
  183. PNAME(mout_top0_half_bus0_pll_p) = {"mout_top0_bus0_pll",
  184. "ffac_top0_bus0_pll_div2"};
  185. PNAME(mout_top0_half_bus1_pll_p) = {"mout_top0_bus1_pll",
  186. "ffac_top0_bus1_pll_div2"};
  187. PNAME(mout_top0_half_cc_pll_p) = {"mout_top0_cc_pll",
  188. "ffac_top0_cc_pll_div2"};
  189. PNAME(mout_top0_half_mfc_pll_p) = {"mout_top0_mfc_pll",
  190. "ffac_top0_mfc_pll_div2"};
  191. PNAME(mout_top0_group1) = {"mout_top0_half_bus0_pll",
  192. "mout_top0_half_bus1_pll", "mout_top0_half_cc_pll",
  193. "mout_top0_half_mfc_pll"};
  194. PNAME(mout_top0_group3) = {"ioclk_audiocdclk0",
  195. "ioclk_audiocdclk1", "ioclk_spdif_extclk",
  196. "mout_top0_aud_pll", "mout_top0_half_bus0_pll",
  197. "mout_top0_half_bus1_pll"};
  198. PNAME(mout_top0_group4) = {"ioclk_audiocdclk1", "mout_top0_aud_pll",
  199. "mout_top0_half_bus0_pll", "mout_top0_half_bus1_pll"};
  200. static unsigned long top0_clk_regs[] __initdata = {
  201. MUX_SEL_TOP00,
  202. MUX_SEL_TOP01,
  203. MUX_SEL_TOP03,
  204. MUX_SEL_TOP0_PERIC0,
  205. MUX_SEL_TOP0_PERIC1,
  206. MUX_SEL_TOP0_PERIC2,
  207. MUX_SEL_TOP0_PERIC3,
  208. DIV_TOP03,
  209. DIV_TOP0_PERIC0,
  210. DIV_TOP0_PERIC1,
  211. DIV_TOP0_PERIC2,
  212. DIV_TOP0_PERIC3,
  213. ENABLE_SCLK_TOP0_PERIC0,
  214. ENABLE_SCLK_TOP0_PERIC1,
  215. ENABLE_SCLK_TOP0_PERIC2,
  216. ENABLE_SCLK_TOP0_PERIC3,
  217. };
  218. static struct samsung_mux_clock top0_mux_clks[] __initdata = {
  219. MUX(0, "mout_top0_aud_pll", mout_aud_pll_p, MUX_SEL_TOP00, 0, 1),
  220. MUX(0, "mout_top0_mfc_pll", mout_mfc_pll_p, MUX_SEL_TOP00, 4, 1),
  221. MUX(0, "mout_top0_cc_pll", mout_cc_pll_p, MUX_SEL_TOP00, 8, 1),
  222. MUX(0, "mout_top0_bus1_pll", mout_bus1_pll_p, MUX_SEL_TOP00, 12, 1),
  223. MUX(0, "mout_top0_bus0_pll", mout_bus0_pll_p, MUX_SEL_TOP00, 16, 1),
  224. MUX(0, "mout_top0_half_mfc_pll", mout_top0_half_mfc_pll_p,
  225. MUX_SEL_TOP01, 4, 1),
  226. MUX(0, "mout_top0_half_cc_pll", mout_top0_half_cc_pll_p,
  227. MUX_SEL_TOP01, 8, 1),
  228. MUX(0, "mout_top0_half_bus1_pll", mout_top0_half_bus1_pll_p,
  229. MUX_SEL_TOP01, 12, 1),
  230. MUX(0, "mout_top0_half_bus0_pll", mout_top0_half_bus0_pll_p,
  231. MUX_SEL_TOP01, 16, 1),
  232. MUX(0, "mout_aclk_peric1_66", mout_top0_group1, MUX_SEL_TOP03, 12, 2),
  233. MUX(0, "mout_aclk_peric0_66", mout_top0_group1, MUX_SEL_TOP03, 20, 2),
  234. MUX(0, "mout_sclk_spdif", mout_top0_group3, MUX_SEL_TOP0_PERIC0, 4, 3),
  235. MUX(0, "mout_sclk_pcm1", mout_top0_group4, MUX_SEL_TOP0_PERIC0, 8, 2),
  236. MUX(0, "mout_sclk_i2s1", mout_top0_group4, MUX_SEL_TOP0_PERIC0, 20, 2),
  237. MUX(0, "mout_sclk_spi1", mout_top0_group1, MUX_SEL_TOP0_PERIC1, 8, 2),
  238. MUX(0, "mout_sclk_spi0", mout_top0_group1, MUX_SEL_TOP0_PERIC1, 20, 2),
  239. MUX(0, "mout_sclk_spi3", mout_top0_group1, MUX_SEL_TOP0_PERIC2, 8, 2),
  240. MUX(0, "mout_sclk_spi2", mout_top0_group1, MUX_SEL_TOP0_PERIC2, 20, 2),
  241. MUX(0, "mout_sclk_uart3", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 4, 2),
  242. MUX(0, "mout_sclk_uart2", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 8, 2),
  243. MUX(0, "mout_sclk_uart1", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 12, 2),
  244. MUX(0, "mout_sclk_uart0", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 16, 2),
  245. MUX(0, "mout_sclk_spi4", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 20, 2),
  246. };
  247. static struct samsung_div_clock top0_div_clks[] __initdata = {
  248. DIV(DOUT_ACLK_PERIC1, "dout_aclk_peric1_66", "mout_aclk_peric1_66",
  249. DIV_TOP03, 12, 6),
  250. DIV(DOUT_ACLK_PERIC0, "dout_aclk_peric0_66", "mout_aclk_peric0_66",
  251. DIV_TOP03, 20, 6),
  252. DIV(0, "dout_sclk_spdif", "mout_sclk_spdif", DIV_TOP0_PERIC0, 4, 4),
  253. DIV(0, "dout_sclk_pcm1", "mout_sclk_pcm1", DIV_TOP0_PERIC0, 8, 12),
  254. DIV(0, "dout_sclk_i2s1", "mout_sclk_i2s1", DIV_TOP0_PERIC0, 20, 10),
  255. DIV(0, "dout_sclk_spi1", "mout_sclk_spi1", DIV_TOP0_PERIC1, 8, 12),
  256. DIV(0, "dout_sclk_spi0", "mout_sclk_spi0", DIV_TOP0_PERIC1, 20, 12),
  257. DIV(0, "dout_sclk_spi3", "mout_sclk_spi3", DIV_TOP0_PERIC2, 8, 12),
  258. DIV(0, "dout_sclk_spi2", "mout_sclk_spi2", DIV_TOP0_PERIC2, 20, 12),
  259. DIV(0, "dout_sclk_uart3", "mout_sclk_uart3", DIV_TOP0_PERIC3, 4, 4),
  260. DIV(0, "dout_sclk_uart2", "mout_sclk_uart2", DIV_TOP0_PERIC3, 8, 4),
  261. DIV(0, "dout_sclk_uart1", "mout_sclk_uart1", DIV_TOP0_PERIC3, 12, 4),
  262. DIV(0, "dout_sclk_uart0", "mout_sclk_uart0", DIV_TOP0_PERIC3, 16, 4),
  263. DIV(0, "dout_sclk_spi4", "mout_sclk_spi4", DIV_TOP0_PERIC3, 20, 12),
  264. };
  265. static struct samsung_gate_clock top0_gate_clks[] __initdata = {
  266. GATE(CLK_SCLK_SPDIF, "sclk_spdif", "dout_sclk_spdif",
  267. ENABLE_SCLK_TOP0_PERIC0, 4, CLK_SET_RATE_PARENT, 0),
  268. GATE(CLK_SCLK_PCM1, "sclk_pcm1", "dout_sclk_pcm1",
  269. ENABLE_SCLK_TOP0_PERIC0, 8, CLK_SET_RATE_PARENT, 0),
  270. GATE(CLK_SCLK_I2S1, "sclk_i2s1", "dout_sclk_i2s1",
  271. ENABLE_SCLK_TOP0_PERIC0, 20, CLK_SET_RATE_PARENT, 0),
  272. GATE(CLK_SCLK_SPI1, "sclk_spi1", "dout_sclk_spi1",
  273. ENABLE_SCLK_TOP0_PERIC1, 8, CLK_SET_RATE_PARENT, 0),
  274. GATE(CLK_SCLK_SPI0, "sclk_spi0", "dout_sclk_spi0",
  275. ENABLE_SCLK_TOP0_PERIC1, 20, CLK_SET_RATE_PARENT, 0),
  276. GATE(CLK_SCLK_SPI3, "sclk_spi3", "dout_sclk_spi3",
  277. ENABLE_SCLK_TOP0_PERIC2, 8, CLK_SET_RATE_PARENT, 0),
  278. GATE(CLK_SCLK_SPI2, "sclk_spi2", "dout_sclk_spi2",
  279. ENABLE_SCLK_TOP0_PERIC2, 20, CLK_SET_RATE_PARENT, 0),
  280. GATE(CLK_SCLK_UART3, "sclk_uart3", "dout_sclk_uart3",
  281. ENABLE_SCLK_TOP0_PERIC3, 4, 0, 0),
  282. GATE(CLK_SCLK_UART2, "sclk_uart2", "dout_sclk_uart2",
  283. ENABLE_SCLK_TOP0_PERIC3, 8, 0, 0),
  284. GATE(CLK_SCLK_UART1, "sclk_uart1", "dout_sclk_uart1",
  285. ENABLE_SCLK_TOP0_PERIC3, 12, 0, 0),
  286. GATE(CLK_SCLK_UART0, "sclk_uart0", "dout_sclk_uart0",
  287. ENABLE_SCLK_TOP0_PERIC3, 16, 0, 0),
  288. GATE(CLK_SCLK_SPI4, "sclk_spi4", "dout_sclk_spi4",
  289. ENABLE_SCLK_TOP0_PERIC3, 20, CLK_SET_RATE_PARENT, 0),
  290. };
  291. static struct samsung_fixed_factor_clock top0_fixed_factor_clks[] __initdata = {
  292. FFACTOR(0, "ffac_top0_bus0_pll_div2", "mout_top0_bus0_pll", 1, 2, 0),
  293. FFACTOR(0, "ffac_top0_bus1_pll_div2", "mout_top0_bus1_pll", 1, 2, 0),
  294. FFACTOR(0, "ffac_top0_cc_pll_div2", "mout_top0_cc_pll", 1, 2, 0),
  295. FFACTOR(0, "ffac_top0_mfc_pll_div2", "mout_top0_mfc_pll", 1, 2, 0),
  296. };
  297. static struct samsung_cmu_info top0_cmu_info __initdata = {
  298. .mux_clks = top0_mux_clks,
  299. .nr_mux_clks = ARRAY_SIZE(top0_mux_clks),
  300. .div_clks = top0_div_clks,
  301. .nr_div_clks = ARRAY_SIZE(top0_div_clks),
  302. .gate_clks = top0_gate_clks,
  303. .nr_gate_clks = ARRAY_SIZE(top0_gate_clks),
  304. .fixed_factor_clks = top0_fixed_factor_clks,
  305. .nr_fixed_factor_clks = ARRAY_SIZE(top0_fixed_factor_clks),
  306. .nr_clk_ids = TOP0_NR_CLK,
  307. .clk_regs = top0_clk_regs,
  308. .nr_clk_regs = ARRAY_SIZE(top0_clk_regs),
  309. };
  310. static void __init exynos7_clk_top0_init(struct device_node *np)
  311. {
  312. samsung_cmu_register_one(np, &top0_cmu_info);
  313. }
  314. CLK_OF_DECLARE(exynos7_clk_top0, "samsung,exynos7-clock-top0",
  315. exynos7_clk_top0_init);
  316. /* Register Offset definitions for CMU_TOP1 (0x105E0000) */
  317. #define MUX_SEL_TOP10 0x0200
  318. #define MUX_SEL_TOP11 0x0204
  319. #define MUX_SEL_TOP13 0x020C
  320. #define MUX_SEL_TOP1_FSYS0 0x0224
  321. #define MUX_SEL_TOP1_FSYS1 0x0228
  322. #define DIV_TOP13 0x060C
  323. #define DIV_TOP1_FSYS0 0x0624
  324. #define DIV_TOP1_FSYS1 0x0628
  325. #define ENABLE_ACLK_TOP13 0x080C
  326. #define ENABLE_SCLK_TOP1_FSYS0 0x0A24
  327. #define ENABLE_SCLK_TOP1_FSYS1 0x0A28
  328. /* List of parent clocks for Muxes in CMU_TOP1 */
  329. PNAME(mout_top1_bus0_pll_p) = { "fin_pll", "dout_sclk_bus0_pll" };
  330. PNAME(mout_top1_bus1_pll_p) = { "fin_pll", "dout_sclk_bus1_pll_b" };
  331. PNAME(mout_top1_cc_pll_p) = { "fin_pll", "dout_sclk_cc_pll_b" };
  332. PNAME(mout_top1_mfc_pll_p) = { "fin_pll", "dout_sclk_mfc_pll_b" };
  333. PNAME(mout_top1_half_bus0_pll_p) = {"mout_top1_bus0_pll",
  334. "ffac_top1_bus0_pll_div2"};
  335. PNAME(mout_top1_half_bus1_pll_p) = {"mout_top1_bus1_pll",
  336. "ffac_top1_bus1_pll_div2"};
  337. PNAME(mout_top1_half_cc_pll_p) = {"mout_top1_cc_pll",
  338. "ffac_top1_cc_pll_div2"};
  339. PNAME(mout_top1_half_mfc_pll_p) = {"mout_top1_mfc_pll",
  340. "ffac_top1_mfc_pll_div2"};
  341. PNAME(mout_top1_group1) = {"mout_top1_half_bus0_pll",
  342. "mout_top1_half_bus1_pll", "mout_top1_half_cc_pll",
  343. "mout_top1_half_mfc_pll"};
  344. static unsigned long top1_clk_regs[] __initdata = {
  345. MUX_SEL_TOP10,
  346. MUX_SEL_TOP11,
  347. MUX_SEL_TOP13,
  348. MUX_SEL_TOP1_FSYS0,
  349. MUX_SEL_TOP1_FSYS1,
  350. DIV_TOP13,
  351. DIV_TOP1_FSYS0,
  352. DIV_TOP1_FSYS1,
  353. ENABLE_ACLK_TOP13,
  354. ENABLE_SCLK_TOP1_FSYS0,
  355. ENABLE_SCLK_TOP1_FSYS1,
  356. };
  357. static struct samsung_mux_clock top1_mux_clks[] __initdata = {
  358. MUX(0, "mout_top1_mfc_pll", mout_top1_mfc_pll_p, MUX_SEL_TOP10, 4, 1),
  359. MUX(0, "mout_top1_cc_pll", mout_top1_cc_pll_p, MUX_SEL_TOP10, 8, 1),
  360. MUX(0, "mout_top1_bus1_pll", mout_top1_bus1_pll_p,
  361. MUX_SEL_TOP10, 12, 1),
  362. MUX(0, "mout_top1_bus0_pll", mout_top1_bus0_pll_p,
  363. MUX_SEL_TOP10, 16, 1),
  364. MUX(0, "mout_top1_half_mfc_pll", mout_top1_half_mfc_pll_p,
  365. MUX_SEL_TOP11, 4, 1),
  366. MUX(0, "mout_top1_half_cc_pll", mout_top1_half_cc_pll_p,
  367. MUX_SEL_TOP11, 8, 1),
  368. MUX(0, "mout_top1_half_bus1_pll", mout_top1_half_bus1_pll_p,
  369. MUX_SEL_TOP11, 12, 1),
  370. MUX(0, "mout_top1_half_bus0_pll", mout_top1_half_bus0_pll_p,
  371. MUX_SEL_TOP11, 16, 1),
  372. MUX(0, "mout_aclk_fsys1_200", mout_top1_group1, MUX_SEL_TOP13, 24, 2),
  373. MUX(0, "mout_aclk_fsys0_200", mout_top1_group1, MUX_SEL_TOP13, 28, 2),
  374. MUX(0, "mout_sclk_mmc2", mout_top1_group1, MUX_SEL_TOP1_FSYS0, 24, 2),
  375. MUX(0, "mout_sclk_usbdrd300", mout_top1_group1,
  376. MUX_SEL_TOP1_FSYS0, 28, 2),
  377. MUX(0, "mout_sclk_mmc1", mout_top1_group1, MUX_SEL_TOP1_FSYS1, 24, 2),
  378. MUX(0, "mout_sclk_mmc0", mout_top1_group1, MUX_SEL_TOP1_FSYS1, 28, 2),
  379. };
  380. static struct samsung_div_clock top1_div_clks[] __initdata = {
  381. DIV(DOUT_ACLK_FSYS1_200, "dout_aclk_fsys1_200", "mout_aclk_fsys1_200",
  382. DIV_TOP13, 24, 4),
  383. DIV(DOUT_ACLK_FSYS0_200, "dout_aclk_fsys0_200", "mout_aclk_fsys0_200",
  384. DIV_TOP13, 28, 4),
  385. DIV(DOUT_SCLK_MMC2, "dout_sclk_mmc2", "mout_sclk_mmc2",
  386. DIV_TOP1_FSYS0, 24, 4),
  387. DIV(0, "dout_sclk_usbdrd300", "mout_sclk_usbdrd300",
  388. DIV_TOP1_FSYS0, 28, 4),
  389. DIV(DOUT_SCLK_MMC1, "dout_sclk_mmc1", "mout_sclk_mmc1",
  390. DIV_TOP1_FSYS1, 24, 4),
  391. DIV(DOUT_SCLK_MMC0, "dout_sclk_mmc0", "mout_sclk_mmc0",
  392. DIV_TOP1_FSYS1, 28, 4),
  393. };
  394. static struct samsung_gate_clock top1_gate_clks[] __initdata = {
  395. GATE(CLK_SCLK_MMC2, "sclk_mmc2", "dout_sclk_mmc2",
  396. ENABLE_SCLK_TOP1_FSYS0, 24, CLK_SET_RATE_PARENT, 0),
  397. GATE(0, "sclk_usbdrd300", "dout_sclk_usbdrd300",
  398. ENABLE_SCLK_TOP1_FSYS0, 28, 0, 0),
  399. GATE(CLK_SCLK_MMC1, "sclk_mmc1", "dout_sclk_mmc1",
  400. ENABLE_SCLK_TOP1_FSYS1, 24, CLK_SET_RATE_PARENT, 0),
  401. GATE(CLK_SCLK_MMC0, "sclk_mmc0", "dout_sclk_mmc0",
  402. ENABLE_SCLK_TOP1_FSYS1, 28, CLK_SET_RATE_PARENT, 0),
  403. };
  404. static struct samsung_fixed_factor_clock top1_fixed_factor_clks[] __initdata = {
  405. FFACTOR(0, "ffac_top1_bus0_pll_div2", "mout_top1_bus0_pll", 1, 2, 0),
  406. FFACTOR(0, "ffac_top1_bus1_pll_div2", "mout_top1_bus1_pll", 1, 2, 0),
  407. FFACTOR(0, "ffac_top1_cc_pll_div2", "mout_top1_cc_pll", 1, 2, 0),
  408. FFACTOR(0, "ffac_top1_mfc_pll_div2", "mout_top1_mfc_pll", 1, 2, 0),
  409. };
  410. static struct samsung_cmu_info top1_cmu_info __initdata = {
  411. .mux_clks = top1_mux_clks,
  412. .nr_mux_clks = ARRAY_SIZE(top1_mux_clks),
  413. .div_clks = top1_div_clks,
  414. .nr_div_clks = ARRAY_SIZE(top1_div_clks),
  415. .gate_clks = top1_gate_clks,
  416. .nr_gate_clks = ARRAY_SIZE(top1_gate_clks),
  417. .fixed_factor_clks = top1_fixed_factor_clks,
  418. .nr_fixed_factor_clks = ARRAY_SIZE(top1_fixed_factor_clks),
  419. .nr_clk_ids = TOP1_NR_CLK,
  420. .clk_regs = top1_clk_regs,
  421. .nr_clk_regs = ARRAY_SIZE(top1_clk_regs),
  422. };
  423. static void __init exynos7_clk_top1_init(struct device_node *np)
  424. {
  425. samsung_cmu_register_one(np, &top1_cmu_info);
  426. }
  427. CLK_OF_DECLARE(exynos7_clk_top1, "samsung,exynos7-clock-top1",
  428. exynos7_clk_top1_init);
  429. /* Register Offset definitions for CMU_CCORE (0x105B0000) */
  430. #define MUX_SEL_CCORE 0x0200
  431. #define DIV_CCORE 0x0600
  432. #define ENABLE_ACLK_CCORE0 0x0800
  433. #define ENABLE_ACLK_CCORE1 0x0804
  434. #define ENABLE_PCLK_CCORE 0x0900
  435. /*
  436. * List of parent clocks for Muxes in CMU_CCORE
  437. */
  438. PNAME(mout_aclk_ccore_133_p) = { "fin_pll", "dout_aclk_ccore_133" };
  439. static unsigned long ccore_clk_regs[] __initdata = {
  440. MUX_SEL_CCORE,
  441. ENABLE_PCLK_CCORE,
  442. };
  443. static struct samsung_mux_clock ccore_mux_clks[] __initdata = {
  444. MUX(0, "mout_aclk_ccore_133_user", mout_aclk_ccore_133_p,
  445. MUX_SEL_CCORE, 1, 1),
  446. };
  447. static struct samsung_gate_clock ccore_gate_clks[] __initdata = {
  448. GATE(PCLK_RTC, "pclk_rtc", "mout_aclk_ccore_133_user",
  449. ENABLE_PCLK_CCORE, 8, 0, 0),
  450. };
  451. static struct samsung_cmu_info ccore_cmu_info __initdata = {
  452. .mux_clks = ccore_mux_clks,
  453. .nr_mux_clks = ARRAY_SIZE(ccore_mux_clks),
  454. .gate_clks = ccore_gate_clks,
  455. .nr_gate_clks = ARRAY_SIZE(ccore_gate_clks),
  456. .nr_clk_ids = CCORE_NR_CLK,
  457. .clk_regs = ccore_clk_regs,
  458. .nr_clk_regs = ARRAY_SIZE(ccore_clk_regs),
  459. };
  460. static void __init exynos7_clk_ccore_init(struct device_node *np)
  461. {
  462. samsung_cmu_register_one(np, &ccore_cmu_info);
  463. }
  464. CLK_OF_DECLARE(exynos7_clk_ccore, "samsung,exynos7-clock-ccore",
  465. exynos7_clk_ccore_init);
  466. /* Register Offset definitions for CMU_PERIC0 (0x13610000) */
  467. #define MUX_SEL_PERIC0 0x0200
  468. #define ENABLE_PCLK_PERIC0 0x0900
  469. #define ENABLE_SCLK_PERIC0 0x0A00
  470. /* List of parent clocks for Muxes in CMU_PERIC0 */
  471. PNAME(mout_aclk_peric0_66_p) = { "fin_pll", "dout_aclk_peric0_66" };
  472. PNAME(mout_sclk_uart0_p) = { "fin_pll", "sclk_uart0" };
  473. static unsigned long peric0_clk_regs[] __initdata = {
  474. MUX_SEL_PERIC0,
  475. ENABLE_PCLK_PERIC0,
  476. ENABLE_SCLK_PERIC0,
  477. };
  478. static struct samsung_mux_clock peric0_mux_clks[] __initdata = {
  479. MUX(0, "mout_aclk_peric0_66_user", mout_aclk_peric0_66_p,
  480. MUX_SEL_PERIC0, 0, 1),
  481. MUX(0, "mout_sclk_uart0_user", mout_sclk_uart0_p,
  482. MUX_SEL_PERIC0, 16, 1),
  483. };
  484. static struct samsung_gate_clock peric0_gate_clks[] __initdata = {
  485. GATE(PCLK_HSI2C0, "pclk_hsi2c0", "mout_aclk_peric0_66_user",
  486. ENABLE_PCLK_PERIC0, 8, 0, 0),
  487. GATE(PCLK_HSI2C1, "pclk_hsi2c1", "mout_aclk_peric0_66_user",
  488. ENABLE_PCLK_PERIC0, 9, 0, 0),
  489. GATE(PCLK_HSI2C4, "pclk_hsi2c4", "mout_aclk_peric0_66_user",
  490. ENABLE_PCLK_PERIC0, 10, 0, 0),
  491. GATE(PCLK_HSI2C5, "pclk_hsi2c5", "mout_aclk_peric0_66_user",
  492. ENABLE_PCLK_PERIC0, 11, 0, 0),
  493. GATE(PCLK_HSI2C9, "pclk_hsi2c9", "mout_aclk_peric0_66_user",
  494. ENABLE_PCLK_PERIC0, 12, 0, 0),
  495. GATE(PCLK_HSI2C10, "pclk_hsi2c10", "mout_aclk_peric0_66_user",
  496. ENABLE_PCLK_PERIC0, 13, 0, 0),
  497. GATE(PCLK_HSI2C11, "pclk_hsi2c11", "mout_aclk_peric0_66_user",
  498. ENABLE_PCLK_PERIC0, 14, 0, 0),
  499. GATE(PCLK_UART0, "pclk_uart0", "mout_aclk_peric0_66_user",
  500. ENABLE_PCLK_PERIC0, 16, 0, 0),
  501. GATE(PCLK_ADCIF, "pclk_adcif", "mout_aclk_peric0_66_user",
  502. ENABLE_PCLK_PERIC0, 20, 0, 0),
  503. GATE(PCLK_PWM, "pclk_pwm", "mout_aclk_peric0_66_user",
  504. ENABLE_PCLK_PERIC0, 21, 0, 0),
  505. GATE(SCLK_UART0, "sclk_uart0_user", "mout_sclk_uart0_user",
  506. ENABLE_SCLK_PERIC0, 16, 0, 0),
  507. GATE(SCLK_PWM, "sclk_pwm", "fin_pll", ENABLE_SCLK_PERIC0, 21, 0, 0),
  508. };
  509. static struct samsung_cmu_info peric0_cmu_info __initdata = {
  510. .mux_clks = peric0_mux_clks,
  511. .nr_mux_clks = ARRAY_SIZE(peric0_mux_clks),
  512. .gate_clks = peric0_gate_clks,
  513. .nr_gate_clks = ARRAY_SIZE(peric0_gate_clks),
  514. .nr_clk_ids = PERIC0_NR_CLK,
  515. .clk_regs = peric0_clk_regs,
  516. .nr_clk_regs = ARRAY_SIZE(peric0_clk_regs),
  517. };
  518. static void __init exynos7_clk_peric0_init(struct device_node *np)
  519. {
  520. samsung_cmu_register_one(np, &peric0_cmu_info);
  521. }
  522. /* Register Offset definitions for CMU_PERIC1 (0x14C80000) */
  523. #define MUX_SEL_PERIC10 0x0200
  524. #define MUX_SEL_PERIC11 0x0204
  525. #define MUX_SEL_PERIC12 0x0208
  526. #define ENABLE_PCLK_PERIC1 0x0900
  527. #define ENABLE_SCLK_PERIC10 0x0A00
  528. CLK_OF_DECLARE(exynos7_clk_peric0, "samsung,exynos7-clock-peric0",
  529. exynos7_clk_peric0_init);
  530. /* List of parent clocks for Muxes in CMU_PERIC1 */
  531. PNAME(mout_aclk_peric1_66_p) = { "fin_pll", "dout_aclk_peric1_66" };
  532. PNAME(mout_sclk_uart1_p) = { "fin_pll", "sclk_uart1" };
  533. PNAME(mout_sclk_uart2_p) = { "fin_pll", "sclk_uart2" };
  534. PNAME(mout_sclk_uart3_p) = { "fin_pll", "sclk_uart3" };
  535. PNAME(mout_sclk_spi0_p) = { "fin_pll", "sclk_spi0" };
  536. PNAME(mout_sclk_spi1_p) = { "fin_pll", "sclk_spi1" };
  537. PNAME(mout_sclk_spi2_p) = { "fin_pll", "sclk_spi2" };
  538. PNAME(mout_sclk_spi3_p) = { "fin_pll", "sclk_spi3" };
  539. PNAME(mout_sclk_spi4_p) = { "fin_pll", "sclk_spi4" };
  540. static unsigned long peric1_clk_regs[] __initdata = {
  541. MUX_SEL_PERIC10,
  542. MUX_SEL_PERIC11,
  543. MUX_SEL_PERIC12,
  544. ENABLE_PCLK_PERIC1,
  545. ENABLE_SCLK_PERIC10,
  546. };
  547. static struct samsung_mux_clock peric1_mux_clks[] __initdata = {
  548. MUX(0, "mout_aclk_peric1_66_user", mout_aclk_peric1_66_p,
  549. MUX_SEL_PERIC10, 0, 1),
  550. MUX_F(0, "mout_sclk_spi0_user", mout_sclk_spi0_p,
  551. MUX_SEL_PERIC11, 0, 1, CLK_SET_RATE_PARENT, 0),
  552. MUX_F(0, "mout_sclk_spi1_user", mout_sclk_spi1_p,
  553. MUX_SEL_PERIC11, 4, 1, CLK_SET_RATE_PARENT, 0),
  554. MUX_F(0, "mout_sclk_spi2_user", mout_sclk_spi2_p,
  555. MUX_SEL_PERIC11, 8, 1, CLK_SET_RATE_PARENT, 0),
  556. MUX_F(0, "mout_sclk_spi3_user", mout_sclk_spi3_p,
  557. MUX_SEL_PERIC11, 12, 1, CLK_SET_RATE_PARENT, 0),
  558. MUX_F(0, "mout_sclk_spi4_user", mout_sclk_spi4_p,
  559. MUX_SEL_PERIC11, 16, 1, CLK_SET_RATE_PARENT, 0),
  560. MUX(0, "mout_sclk_uart1_user", mout_sclk_uart1_p,
  561. MUX_SEL_PERIC11, 20, 1),
  562. MUX(0, "mout_sclk_uart2_user", mout_sclk_uart2_p,
  563. MUX_SEL_PERIC11, 24, 1),
  564. MUX(0, "mout_sclk_uart3_user", mout_sclk_uart3_p,
  565. MUX_SEL_PERIC11, 28, 1),
  566. };
  567. static struct samsung_gate_clock peric1_gate_clks[] __initdata = {
  568. GATE(PCLK_HSI2C2, "pclk_hsi2c2", "mout_aclk_peric1_66_user",
  569. ENABLE_PCLK_PERIC1, 4, 0, 0),
  570. GATE(PCLK_HSI2C3, "pclk_hsi2c3", "mout_aclk_peric1_66_user",
  571. ENABLE_PCLK_PERIC1, 5, 0, 0),
  572. GATE(PCLK_HSI2C6, "pclk_hsi2c6", "mout_aclk_peric1_66_user",
  573. ENABLE_PCLK_PERIC1, 6, 0, 0),
  574. GATE(PCLK_HSI2C7, "pclk_hsi2c7", "mout_aclk_peric1_66_user",
  575. ENABLE_PCLK_PERIC1, 7, 0, 0),
  576. GATE(PCLK_HSI2C8, "pclk_hsi2c8", "mout_aclk_peric1_66_user",
  577. ENABLE_PCLK_PERIC1, 8, 0, 0),
  578. GATE(PCLK_UART1, "pclk_uart1", "mout_aclk_peric1_66_user",
  579. ENABLE_PCLK_PERIC1, 9, 0, 0),
  580. GATE(PCLK_UART2, "pclk_uart2", "mout_aclk_peric1_66_user",
  581. ENABLE_PCLK_PERIC1, 10, 0, 0),
  582. GATE(PCLK_UART3, "pclk_uart3", "mout_aclk_peric1_66_user",
  583. ENABLE_PCLK_PERIC1, 11, 0, 0),
  584. GATE(PCLK_SPI0, "pclk_spi0", "mout_aclk_peric1_66_user",
  585. ENABLE_PCLK_PERIC1, 12, 0, 0),
  586. GATE(PCLK_SPI1, "pclk_spi1", "mout_aclk_peric1_66_user",
  587. ENABLE_PCLK_PERIC1, 13, 0, 0),
  588. GATE(PCLK_SPI2, "pclk_spi2", "mout_aclk_peric1_66_user",
  589. ENABLE_PCLK_PERIC1, 14, 0, 0),
  590. GATE(PCLK_SPI3, "pclk_spi3", "mout_aclk_peric1_66_user",
  591. ENABLE_PCLK_PERIC1, 15, 0, 0),
  592. GATE(PCLK_SPI4, "pclk_spi4", "mout_aclk_peric1_66_user",
  593. ENABLE_PCLK_PERIC1, 16, 0, 0),
  594. GATE(PCLK_I2S1, "pclk_i2s1", "mout_aclk_peric1_66_user",
  595. ENABLE_PCLK_PERIC1, 17, CLK_SET_RATE_PARENT, 0),
  596. GATE(PCLK_PCM1, "pclk_pcm1", "mout_aclk_peric1_66_user",
  597. ENABLE_PCLK_PERIC1, 18, 0, 0),
  598. GATE(PCLK_SPDIF, "pclk_spdif", "mout_aclk_peric1_66_user",
  599. ENABLE_PCLK_PERIC1, 19, 0, 0),
  600. GATE(SCLK_UART1, "sclk_uart1_user", "mout_sclk_uart1_user",
  601. ENABLE_SCLK_PERIC10, 9, 0, 0),
  602. GATE(SCLK_UART2, "sclk_uart2_user", "mout_sclk_uart2_user",
  603. ENABLE_SCLK_PERIC10, 10, 0, 0),
  604. GATE(SCLK_UART3, "sclk_uart3_user", "mout_sclk_uart3_user",
  605. ENABLE_SCLK_PERIC10, 11, 0, 0),
  606. GATE(SCLK_SPI0, "sclk_spi0_user", "mout_sclk_spi0_user",
  607. ENABLE_SCLK_PERIC10, 12, CLK_SET_RATE_PARENT, 0),
  608. GATE(SCLK_SPI1, "sclk_spi1_user", "mout_sclk_spi1_user",
  609. ENABLE_SCLK_PERIC10, 13, CLK_SET_RATE_PARENT, 0),
  610. GATE(SCLK_SPI2, "sclk_spi2_user", "mout_sclk_spi2_user",
  611. ENABLE_SCLK_PERIC10, 14, CLK_SET_RATE_PARENT, 0),
  612. GATE(SCLK_SPI3, "sclk_spi3_user", "mout_sclk_spi3_user",
  613. ENABLE_SCLK_PERIC10, 15, CLK_SET_RATE_PARENT, 0),
  614. GATE(SCLK_SPI4, "sclk_spi4_user", "mout_sclk_spi4_user",
  615. ENABLE_SCLK_PERIC10, 16, CLK_SET_RATE_PARENT, 0),
  616. GATE(SCLK_I2S1, "sclk_i2s1_user", "sclk_i2s1",
  617. ENABLE_SCLK_PERIC10, 17, CLK_SET_RATE_PARENT, 0),
  618. GATE(SCLK_PCM1, "sclk_pcm1_user", "sclk_pcm1",
  619. ENABLE_SCLK_PERIC10, 18, CLK_SET_RATE_PARENT, 0),
  620. GATE(SCLK_SPDIF, "sclk_spdif_user", "sclk_spdif",
  621. ENABLE_SCLK_PERIC10, 19, CLK_SET_RATE_PARENT, 0),
  622. };
  623. static struct samsung_cmu_info peric1_cmu_info __initdata = {
  624. .mux_clks = peric1_mux_clks,
  625. .nr_mux_clks = ARRAY_SIZE(peric1_mux_clks),
  626. .gate_clks = peric1_gate_clks,
  627. .nr_gate_clks = ARRAY_SIZE(peric1_gate_clks),
  628. .nr_clk_ids = PERIC1_NR_CLK,
  629. .clk_regs = peric1_clk_regs,
  630. .nr_clk_regs = ARRAY_SIZE(peric1_clk_regs),
  631. };
  632. static void __init exynos7_clk_peric1_init(struct device_node *np)
  633. {
  634. samsung_cmu_register_one(np, &peric1_cmu_info);
  635. }
  636. CLK_OF_DECLARE(exynos7_clk_peric1, "samsung,exynos7-clock-peric1",
  637. exynos7_clk_peric1_init);
  638. /* Register Offset definitions for CMU_PERIS (0x10040000) */
  639. #define MUX_SEL_PERIS 0x0200
  640. #define ENABLE_PCLK_PERIS 0x0900
  641. #define ENABLE_PCLK_PERIS_SECURE_CHIPID 0x0910
  642. #define ENABLE_SCLK_PERIS 0x0A00
  643. #define ENABLE_SCLK_PERIS_SECURE_CHIPID 0x0A10
  644. /* List of parent clocks for Muxes in CMU_PERIS */
  645. PNAME(mout_aclk_peris_66_p) = { "fin_pll", "dout_aclk_peris_66" };
  646. static unsigned long peris_clk_regs[] __initdata = {
  647. MUX_SEL_PERIS,
  648. ENABLE_PCLK_PERIS,
  649. ENABLE_PCLK_PERIS_SECURE_CHIPID,
  650. ENABLE_SCLK_PERIS,
  651. ENABLE_SCLK_PERIS_SECURE_CHIPID,
  652. };
  653. static struct samsung_mux_clock peris_mux_clks[] __initdata = {
  654. MUX(0, "mout_aclk_peris_66_user",
  655. mout_aclk_peris_66_p, MUX_SEL_PERIS, 0, 1),
  656. };
  657. static struct samsung_gate_clock peris_gate_clks[] __initdata = {
  658. GATE(PCLK_WDT, "pclk_wdt", "mout_aclk_peris_66_user",
  659. ENABLE_PCLK_PERIS, 6, 0, 0),
  660. GATE(PCLK_TMU, "pclk_tmu_apbif", "mout_aclk_peris_66_user",
  661. ENABLE_PCLK_PERIS, 10, 0, 0),
  662. GATE(PCLK_CHIPID, "pclk_chipid", "mout_aclk_peris_66_user",
  663. ENABLE_PCLK_PERIS_SECURE_CHIPID, 0, 0, 0),
  664. GATE(SCLK_CHIPID, "sclk_chipid", "fin_pll",
  665. ENABLE_SCLK_PERIS_SECURE_CHIPID, 0, 0, 0),
  666. GATE(SCLK_TMU, "sclk_tmu", "fin_pll", ENABLE_SCLK_PERIS, 10, 0, 0),
  667. };
  668. static struct samsung_cmu_info peris_cmu_info __initdata = {
  669. .mux_clks = peris_mux_clks,
  670. .nr_mux_clks = ARRAY_SIZE(peris_mux_clks),
  671. .gate_clks = peris_gate_clks,
  672. .nr_gate_clks = ARRAY_SIZE(peris_gate_clks),
  673. .nr_clk_ids = PERIS_NR_CLK,
  674. .clk_regs = peris_clk_regs,
  675. .nr_clk_regs = ARRAY_SIZE(peris_clk_regs),
  676. };
  677. static void __init exynos7_clk_peris_init(struct device_node *np)
  678. {
  679. samsung_cmu_register_one(np, &peris_cmu_info);
  680. }
  681. CLK_OF_DECLARE(exynos7_clk_peris, "samsung,exynos7-clock-peris",
  682. exynos7_clk_peris_init);
  683. /* Register Offset definitions for CMU_FSYS0 (0x10E90000) */
  684. #define MUX_SEL_FSYS00 0x0200
  685. #define MUX_SEL_FSYS01 0x0204
  686. #define MUX_SEL_FSYS02 0x0208
  687. #define ENABLE_ACLK_FSYS00 0x0800
  688. #define ENABLE_ACLK_FSYS01 0x0804
  689. #define ENABLE_SCLK_FSYS01 0x0A04
  690. #define ENABLE_SCLK_FSYS02 0x0A08
  691. #define ENABLE_SCLK_FSYS04 0x0A10
  692. /*
  693. * List of parent clocks for Muxes in CMU_FSYS0
  694. */
  695. PNAME(mout_aclk_fsys0_200_p) = { "fin_pll", "dout_aclk_fsys0_200" };
  696. PNAME(mout_sclk_mmc2_p) = { "fin_pll", "sclk_mmc2" };
  697. PNAME(mout_sclk_usbdrd300_p) = { "fin_pll", "sclk_usbdrd300" };
  698. PNAME(mout_phyclk_usbdrd300_udrd30_phyclk_p) = { "fin_pll",
  699. "phyclk_usbdrd300_udrd30_phyclock" };
  700. PNAME(mout_phyclk_usbdrd300_udrd30_pipe_pclk_p) = { "fin_pll",
  701. "phyclk_usbdrd300_udrd30_pipe_pclk" };
  702. /* fixed rate clocks used in the FSYS0 block */
  703. struct samsung_fixed_rate_clock fixed_rate_clks_fsys0[] __initdata = {
  704. FRATE(0, "phyclk_usbdrd300_udrd30_phyclock", NULL,
  705. CLK_IS_ROOT, 60000000),
  706. FRATE(0, "phyclk_usbdrd300_udrd30_pipe_pclk", NULL,
  707. CLK_IS_ROOT, 125000000),
  708. };
  709. static unsigned long fsys0_clk_regs[] __initdata = {
  710. MUX_SEL_FSYS00,
  711. MUX_SEL_FSYS01,
  712. MUX_SEL_FSYS02,
  713. ENABLE_ACLK_FSYS00,
  714. ENABLE_ACLK_FSYS01,
  715. ENABLE_SCLK_FSYS01,
  716. ENABLE_SCLK_FSYS02,
  717. ENABLE_SCLK_FSYS04,
  718. };
  719. static struct samsung_mux_clock fsys0_mux_clks[] __initdata = {
  720. MUX(0, "mout_aclk_fsys0_200_user", mout_aclk_fsys0_200_p,
  721. MUX_SEL_FSYS00, 24, 1),
  722. MUX(0, "mout_sclk_mmc2_user", mout_sclk_mmc2_p, MUX_SEL_FSYS01, 24, 1),
  723. MUX(0, "mout_sclk_usbdrd300_user", mout_sclk_usbdrd300_p,
  724. MUX_SEL_FSYS01, 28, 1),
  725. MUX(0, "mout_phyclk_usbdrd300_udrd30_pipe_pclk_user",
  726. mout_phyclk_usbdrd300_udrd30_pipe_pclk_p,
  727. MUX_SEL_FSYS02, 24, 1),
  728. MUX(0, "mout_phyclk_usbdrd300_udrd30_phyclk_user",
  729. mout_phyclk_usbdrd300_udrd30_phyclk_p,
  730. MUX_SEL_FSYS02, 28, 1),
  731. };
  732. static struct samsung_gate_clock fsys0_gate_clks[] __initdata = {
  733. GATE(ACLK_AXIUS_USBDRD30X_FSYS0X, "aclk_axius_usbdrd30x_fsys0x",
  734. "mout_aclk_fsys0_200_user",
  735. ENABLE_ACLK_FSYS00, 19, 0, 0),
  736. GATE(ACLK_PDMA1, "aclk_pdma1", "mout_aclk_fsys0_200_user",
  737. ENABLE_ACLK_FSYS00, 3, 0, 0),
  738. GATE(ACLK_PDMA0, "aclk_pdma0", "mout_aclk_fsys0_200_user",
  739. ENABLE_ACLK_FSYS00, 4, 0, 0),
  740. GATE(ACLK_USBDRD300, "aclk_usbdrd300", "mout_aclk_fsys0_200_user",
  741. ENABLE_ACLK_FSYS01, 29, 0, 0),
  742. GATE(ACLK_MMC2, "aclk_mmc2", "mout_aclk_fsys0_200_user",
  743. ENABLE_ACLK_FSYS01, 31, 0, 0),
  744. GATE(SCLK_USBDRD300_SUSPENDCLK, "sclk_usbdrd300_suspendclk",
  745. "mout_sclk_usbdrd300_user",
  746. ENABLE_SCLK_FSYS01, 4, 0, 0),
  747. GATE(SCLK_USBDRD300_REFCLK, "sclk_usbdrd300_refclk", "fin_pll",
  748. ENABLE_SCLK_FSYS01, 8, 0, 0),
  749. GATE(PHYCLK_USBDRD300_UDRD30_PIPE_PCLK_USER,
  750. "phyclk_usbdrd300_udrd30_pipe_pclk_user",
  751. "mout_phyclk_usbdrd300_udrd30_pipe_pclk_user",
  752. ENABLE_SCLK_FSYS02, 24, 0, 0),
  753. GATE(PHYCLK_USBDRD300_UDRD30_PHYCLK_USER,
  754. "phyclk_usbdrd300_udrd30_phyclk_user",
  755. "mout_phyclk_usbdrd300_udrd30_phyclk_user",
  756. ENABLE_SCLK_FSYS02, 28, 0, 0),
  757. GATE(OSCCLK_PHY_CLKOUT_USB30_PHY, "oscclk_phy_clkout_usb30_phy",
  758. "fin_pll",
  759. ENABLE_SCLK_FSYS04, 28, 0, 0),
  760. };
  761. static struct samsung_cmu_info fsys0_cmu_info __initdata = {
  762. .mux_clks = fsys0_mux_clks,
  763. .nr_mux_clks = ARRAY_SIZE(fsys0_mux_clks),
  764. .gate_clks = fsys0_gate_clks,
  765. .nr_gate_clks = ARRAY_SIZE(fsys0_gate_clks),
  766. .nr_clk_ids = TOP1_NR_CLK,
  767. .clk_regs = fsys0_clk_regs,
  768. .nr_clk_regs = ARRAY_SIZE(fsys0_clk_regs),
  769. };
  770. static void __init exynos7_clk_fsys0_init(struct device_node *np)
  771. {
  772. samsung_cmu_register_one(np, &fsys0_cmu_info);
  773. }
  774. CLK_OF_DECLARE(exynos7_clk_fsys0, "samsung,exynos7-clock-fsys0",
  775. exynos7_clk_fsys0_init);
  776. /* Register Offset definitions for CMU_FSYS1 (0x156E0000) */
  777. #define MUX_SEL_FSYS10 0x0200
  778. #define MUX_SEL_FSYS11 0x0204
  779. #define ENABLE_ACLK_FSYS1 0x0800
  780. /*
  781. * List of parent clocks for Muxes in CMU_FSYS1
  782. */
  783. PNAME(mout_aclk_fsys1_200_p) = { "fin_pll", "dout_aclk_fsys1_200" };
  784. PNAME(mout_sclk_mmc0_p) = { "fin_pll", "sclk_mmc0" };
  785. PNAME(mout_sclk_mmc1_p) = { "fin_pll", "sclk_mmc1" };
  786. static unsigned long fsys1_clk_regs[] __initdata = {
  787. MUX_SEL_FSYS10,
  788. MUX_SEL_FSYS11,
  789. ENABLE_ACLK_FSYS1,
  790. };
  791. static struct samsung_mux_clock fsys1_mux_clks[] __initdata = {
  792. MUX(0, "mout_aclk_fsys1_200_user", mout_aclk_fsys1_200_p,
  793. MUX_SEL_FSYS10, 28, 1),
  794. MUX(0, "mout_sclk_mmc1_user", mout_sclk_mmc1_p, MUX_SEL_FSYS11, 24, 1),
  795. MUX(0, "mout_sclk_mmc0_user", mout_sclk_mmc0_p, MUX_SEL_FSYS11, 28, 1),
  796. };
  797. static struct samsung_gate_clock fsys1_gate_clks[] __initdata = {
  798. GATE(ACLK_MMC1, "aclk_mmc1", "mout_aclk_fsys1_200_user",
  799. ENABLE_ACLK_FSYS1, 29, 0, 0),
  800. GATE(ACLK_MMC0, "aclk_mmc0", "mout_aclk_fsys1_200_user",
  801. ENABLE_ACLK_FSYS1, 30, 0, 0),
  802. };
  803. static struct samsung_cmu_info fsys1_cmu_info __initdata = {
  804. .mux_clks = fsys1_mux_clks,
  805. .nr_mux_clks = ARRAY_SIZE(fsys1_mux_clks),
  806. .gate_clks = fsys1_gate_clks,
  807. .nr_gate_clks = ARRAY_SIZE(fsys1_gate_clks),
  808. .nr_clk_ids = TOP1_NR_CLK,
  809. .clk_regs = fsys1_clk_regs,
  810. .nr_clk_regs = ARRAY_SIZE(fsys1_clk_regs),
  811. };
  812. static void __init exynos7_clk_fsys1_init(struct device_node *np)
  813. {
  814. samsung_cmu_register_one(np, &fsys1_cmu_info);
  815. }
  816. CLK_OF_DECLARE(exynos7_clk_fsys1, "samsung,exynos7-clock-fsys1",
  817. exynos7_clk_fsys1_init);
  818. #define MUX_SEL_MSCL 0x0200
  819. #define DIV_MSCL 0x0600
  820. #define ENABLE_ACLK_MSCL 0x0800
  821. #define ENABLE_PCLK_MSCL 0x0900
  822. /* List of parent clocks for Muxes in CMU_MSCL */
  823. PNAME(mout_aclk_mscl_532_user_p) = { "fin_pll", "aclk_mscl_532" };
  824. static unsigned long mscl_clk_regs[] __initdata = {
  825. MUX_SEL_MSCL,
  826. DIV_MSCL,
  827. ENABLE_ACLK_MSCL,
  828. ENABLE_PCLK_MSCL,
  829. };
  830. static struct samsung_mux_clock mscl_mux_clks[] __initdata = {
  831. MUX(USERMUX_ACLK_MSCL_532, "usermux_aclk_mscl_532",
  832. mout_aclk_mscl_532_user_p, MUX_SEL_MSCL, 0, 1),
  833. };
  834. static struct samsung_div_clock mscl_div_clks[] __initdata = {
  835. DIV(DOUT_PCLK_MSCL, "dout_pclk_mscl", "usermux_aclk_mscl_532",
  836. DIV_MSCL, 0, 3),
  837. };
  838. static struct samsung_gate_clock mscl_gate_clks[] __initdata = {
  839. GATE(ACLK_MSCL_0, "aclk_mscl_0", "usermux_aclk_mscl_532",
  840. ENABLE_ACLK_MSCL, 31, 0, 0),
  841. GATE(ACLK_MSCL_1, "aclk_mscl_1", "usermux_aclk_mscl_532",
  842. ENABLE_ACLK_MSCL, 30, 0, 0),
  843. GATE(ACLK_JPEG, "aclk_jpeg", "usermux_aclk_mscl_532",
  844. ENABLE_ACLK_MSCL, 29, 0, 0),
  845. GATE(ACLK_G2D, "aclk_g2d", "usermux_aclk_mscl_532",
  846. ENABLE_ACLK_MSCL, 28, 0, 0),
  847. GATE(ACLK_LH_ASYNC_SI_MSCL_0, "aclk_lh_async_si_mscl_0",
  848. "usermux_aclk_mscl_532",
  849. ENABLE_ACLK_MSCL, 27, 0, 0),
  850. GATE(ACLK_LH_ASYNC_SI_MSCL_1, "aclk_lh_async_si_mscl_1",
  851. "usermux_aclk_mscl_532",
  852. ENABLE_ACLK_MSCL, 26, 0, 0),
  853. GATE(ACLK_XIU_MSCLX_0, "aclk_xiu_msclx_0", "usermux_aclk_mscl_532",
  854. ENABLE_ACLK_MSCL, 25, 0, 0),
  855. GATE(ACLK_XIU_MSCLX_1, "aclk_xiu_msclx_1", "usermux_aclk_mscl_532",
  856. ENABLE_ACLK_MSCL, 24, 0, 0),
  857. GATE(ACLK_AXI2ACEL_BRIDGE, "aclk_axi2acel_bridge",
  858. "usermux_aclk_mscl_532",
  859. ENABLE_ACLK_MSCL, 23, 0, 0),
  860. GATE(ACLK_QE_MSCL_0, "aclk_qe_mscl_0", "usermux_aclk_mscl_532",
  861. ENABLE_ACLK_MSCL, 22, 0, 0),
  862. GATE(ACLK_QE_MSCL_1, "aclk_qe_mscl_1", "usermux_aclk_mscl_532",
  863. ENABLE_ACLK_MSCL, 21, 0, 0),
  864. GATE(ACLK_QE_JPEG, "aclk_qe_jpeg", "usermux_aclk_mscl_532",
  865. ENABLE_ACLK_MSCL, 20, 0, 0),
  866. GATE(ACLK_QE_G2D, "aclk_qe_g2d", "usermux_aclk_mscl_532",
  867. ENABLE_ACLK_MSCL, 19, 0, 0),
  868. GATE(ACLK_PPMU_MSCL_0, "aclk_ppmu_mscl_0", "usermux_aclk_mscl_532",
  869. ENABLE_ACLK_MSCL, 18, 0, 0),
  870. GATE(ACLK_PPMU_MSCL_1, "aclk_ppmu_mscl_1", "usermux_aclk_mscl_532",
  871. ENABLE_ACLK_MSCL, 17, 0, 0),
  872. GATE(ACLK_MSCLNP_133, "aclk_msclnp_133", "usermux_aclk_mscl_532",
  873. ENABLE_ACLK_MSCL, 16, 0, 0),
  874. GATE(ACLK_AHB2APB_MSCL0P, "aclk_ahb2apb_mscl0p",
  875. "usermux_aclk_mscl_532",
  876. ENABLE_ACLK_MSCL, 15, 0, 0),
  877. GATE(ACLK_AHB2APB_MSCL1P, "aclk_ahb2apb_mscl1p",
  878. "usermux_aclk_mscl_532",
  879. ENABLE_ACLK_MSCL, 14, 0, 0),
  880. GATE(PCLK_MSCL_0, "pclk_mscl_0", "dout_pclk_mscl",
  881. ENABLE_PCLK_MSCL, 31, 0, 0),
  882. GATE(PCLK_MSCL_1, "pclk_mscl_1", "dout_pclk_mscl",
  883. ENABLE_PCLK_MSCL, 30, 0, 0),
  884. GATE(PCLK_JPEG, "pclk_jpeg", "dout_pclk_mscl",
  885. ENABLE_PCLK_MSCL, 29, 0, 0),
  886. GATE(PCLK_G2D, "pclk_g2d", "dout_pclk_mscl",
  887. ENABLE_PCLK_MSCL, 28, 0, 0),
  888. GATE(PCLK_QE_MSCL_0, "pclk_qe_mscl_0", "dout_pclk_mscl",
  889. ENABLE_PCLK_MSCL, 27, 0, 0),
  890. GATE(PCLK_QE_MSCL_1, "pclk_qe_mscl_1", "dout_pclk_mscl",
  891. ENABLE_PCLK_MSCL, 26, 0, 0),
  892. GATE(PCLK_QE_JPEG, "pclk_qe_jpeg", "dout_pclk_mscl",
  893. ENABLE_PCLK_MSCL, 25, 0, 0),
  894. GATE(PCLK_QE_G2D, "pclk_qe_g2d", "dout_pclk_mscl",
  895. ENABLE_PCLK_MSCL, 24, 0, 0),
  896. GATE(PCLK_PPMU_MSCL_0, "pclk_ppmu_mscl_0", "dout_pclk_mscl",
  897. ENABLE_PCLK_MSCL, 23, 0, 0),
  898. GATE(PCLK_PPMU_MSCL_1, "pclk_ppmu_mscl_1", "dout_pclk_mscl",
  899. ENABLE_PCLK_MSCL, 22, 0, 0),
  900. GATE(PCLK_AXI2ACEL_BRIDGE, "pclk_axi2acel_bridge", "dout_pclk_mscl",
  901. ENABLE_PCLK_MSCL, 21, 0, 0),
  902. GATE(PCLK_PMU_MSCL, "pclk_pmu_mscl", "dout_pclk_mscl",
  903. ENABLE_PCLK_MSCL, 20, 0, 0),
  904. };
  905. static struct samsung_cmu_info mscl_cmu_info __initdata = {
  906. .mux_clks = mscl_mux_clks,
  907. .nr_mux_clks = ARRAY_SIZE(mscl_mux_clks),
  908. .div_clks = mscl_div_clks,
  909. .nr_div_clks = ARRAY_SIZE(mscl_div_clks),
  910. .gate_clks = mscl_gate_clks,
  911. .nr_gate_clks = ARRAY_SIZE(mscl_gate_clks),
  912. .nr_clk_ids = MSCL_NR_CLK,
  913. .clk_regs = mscl_clk_regs,
  914. .nr_clk_regs = ARRAY_SIZE(mscl_clk_regs),
  915. };
  916. static void __init exynos7_clk_mscl_init(struct device_node *np)
  917. {
  918. samsung_cmu_register_one(np, &mscl_cmu_info);
  919. }
  920. CLK_OF_DECLARE(exynos7_clk_mscl, "samsung,exynos7-clock-mscl",
  921. exynos7_clk_mscl_init);
  922. /* Register Offset definitions for CMU_AUD (0x114C0000) */
  923. #define MUX_SEL_AUD 0x0200
  924. #define DIV_AUD0 0x0600
  925. #define DIV_AUD1 0x0604
  926. #define ENABLE_ACLK_AUD 0x0800
  927. #define ENABLE_PCLK_AUD 0x0900
  928. #define ENABLE_SCLK_AUD 0x0A00
  929. /*
  930. * List of parent clocks for Muxes in CMU_AUD
  931. */
  932. PNAME(mout_aud_pll_user_p) = { "fin_pll", "fout_aud_pll" };
  933. PNAME(mout_aud_group_p) = { "dout_aud_cdclk", "ioclk_audiocdclk0" };
  934. static unsigned long aud_clk_regs[] __initdata = {
  935. MUX_SEL_AUD,
  936. DIV_AUD0,
  937. DIV_AUD1,
  938. ENABLE_ACLK_AUD,
  939. ENABLE_PCLK_AUD,
  940. ENABLE_SCLK_AUD,
  941. };
  942. static struct samsung_mux_clock aud_mux_clks[] __initdata = {
  943. MUX(0, "mout_sclk_i2s", mout_aud_group_p, MUX_SEL_AUD, 12, 1),
  944. MUX(0, "mout_sclk_pcm", mout_aud_group_p, MUX_SEL_AUD, 16, 1),
  945. MUX(0, "mout_aud_pll_user", mout_aud_pll_user_p, MUX_SEL_AUD, 20, 1),
  946. };
  947. static struct samsung_div_clock aud_div_clks[] __initdata = {
  948. DIV(0, "dout_aud_ca5", "mout_aud_pll_user", DIV_AUD0, 0, 4),
  949. DIV(0, "dout_aclk_aud", "dout_aud_ca5", DIV_AUD0, 4, 4),
  950. DIV(0, "dout_aud_pclk_dbg", "dout_aud_ca5", DIV_AUD0, 8, 4),
  951. DIV(0, "dout_sclk_i2s", "mout_sclk_i2s", DIV_AUD1, 0, 4),
  952. DIV(0, "dout_sclk_pcm", "mout_sclk_pcm", DIV_AUD1, 4, 8),
  953. DIV(0, "dout_sclk_uart", "dout_aud_cdclk", DIV_AUD1, 12, 4),
  954. DIV(0, "dout_sclk_slimbus", "dout_aud_cdclk", DIV_AUD1, 16, 5),
  955. DIV(0, "dout_aud_cdclk", "mout_aud_pll_user", DIV_AUD1, 24, 4),
  956. };
  957. static struct samsung_gate_clock aud_gate_clks[] __initdata = {
  958. GATE(SCLK_PCM, "sclk_pcm", "dout_sclk_pcm",
  959. ENABLE_SCLK_AUD, 27, CLK_SET_RATE_PARENT, 0),
  960. GATE(SCLK_I2S, "sclk_i2s", "dout_sclk_i2s",
  961. ENABLE_SCLK_AUD, 28, CLK_SET_RATE_PARENT, 0),
  962. GATE(0, "sclk_uart", "dout_sclk_uart", ENABLE_SCLK_AUD, 29, 0, 0),
  963. GATE(0, "sclk_slimbus", "dout_sclk_slimbus",
  964. ENABLE_SCLK_AUD, 30, 0, 0),
  965. GATE(0, "pclk_dbg_aud", "dout_aud_pclk_dbg", ENABLE_PCLK_AUD, 19, 0, 0),
  966. GATE(0, "pclk_gpio_aud", "dout_aclk_aud", ENABLE_PCLK_AUD, 20, 0, 0),
  967. GATE(0, "pclk_wdt1", "dout_aclk_aud", ENABLE_PCLK_AUD, 22, 0, 0),
  968. GATE(0, "pclk_wdt0", "dout_aclk_aud", ENABLE_PCLK_AUD, 23, 0, 0),
  969. GATE(0, "pclk_slimbus", "dout_aclk_aud", ENABLE_PCLK_AUD, 24, 0, 0),
  970. GATE(0, "pclk_uart", "dout_aclk_aud", ENABLE_PCLK_AUD, 25, 0, 0),
  971. GATE(PCLK_PCM, "pclk_pcm", "dout_aclk_aud",
  972. ENABLE_PCLK_AUD, 26, CLK_SET_RATE_PARENT, 0),
  973. GATE(PCLK_I2S, "pclk_i2s", "dout_aclk_aud",
  974. ENABLE_PCLK_AUD, 27, CLK_SET_RATE_PARENT, 0),
  975. GATE(0, "pclk_timer", "dout_aclk_aud", ENABLE_PCLK_AUD, 28, 0, 0),
  976. GATE(0, "pclk_smmu_aud", "dout_aclk_aud", ENABLE_PCLK_AUD, 31, 0, 0),
  977. GATE(0, "aclk_smmu_aud", "dout_aclk_aud", ENABLE_ACLK_AUD, 27, 0, 0),
  978. GATE(0, "aclk_acel_lh_async_si_top", "dout_aclk_aud",
  979. ENABLE_ACLK_AUD, 28, 0, 0),
  980. GATE(ACLK_ADMA, "aclk_dmac", "dout_aclk_aud", ENABLE_ACLK_AUD, 31, 0, 0),
  981. };
  982. static struct samsung_cmu_info aud_cmu_info __initdata = {
  983. .mux_clks = aud_mux_clks,
  984. .nr_mux_clks = ARRAY_SIZE(aud_mux_clks),
  985. .div_clks = aud_div_clks,
  986. .nr_div_clks = ARRAY_SIZE(aud_div_clks),
  987. .gate_clks = aud_gate_clks,
  988. .nr_gate_clks = ARRAY_SIZE(aud_gate_clks),
  989. .nr_clk_ids = AUD_NR_CLK,
  990. .clk_regs = aud_clk_regs,
  991. .nr_clk_regs = ARRAY_SIZE(aud_clk_regs),
  992. };
  993. static void __init exynos7_clk_aud_init(struct device_node *np)
  994. {
  995. samsung_cmu_register_one(np, &aud_cmu_info);
  996. }
  997. CLK_OF_DECLARE(exynos7_clk_aud, "samsung,exynos7-clock-aud",
  998. exynos7_clk_aud_init);