clk-exynos3250.c 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102
  1. /*
  2. * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * Common Clock Framework support for Exynos3250 SoC.
  9. */
  10. #include <linux/clk-provider.h>
  11. #include <linux/of.h>
  12. #include <linux/of_address.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/syscore_ops.h>
  15. #include <dt-bindings/clock/exynos3250.h>
  16. #include "clk.h"
  17. #include "clk-cpu.h"
  18. #include "clk-pll.h"
  19. #define SRC_LEFTBUS 0x4200
  20. #define DIV_LEFTBUS 0x4500
  21. #define GATE_IP_LEFTBUS 0x4800
  22. #define SRC_RIGHTBUS 0x8200
  23. #define DIV_RIGHTBUS 0x8500
  24. #define GATE_IP_RIGHTBUS 0x8800
  25. #define GATE_IP_PERIR 0x8960
  26. #define MPLL_LOCK 0xc010
  27. #define MPLL_CON0 0xc110
  28. #define VPLL_LOCK 0xc020
  29. #define VPLL_CON0 0xc120
  30. #define UPLL_LOCK 0xc030
  31. #define UPLL_CON0 0xc130
  32. #define SRC_TOP0 0xc210
  33. #define SRC_TOP1 0xc214
  34. #define SRC_CAM 0xc220
  35. #define SRC_MFC 0xc228
  36. #define SRC_G3D 0xc22c
  37. #define SRC_LCD 0xc234
  38. #define SRC_ISP 0xc238
  39. #define SRC_FSYS 0xc240
  40. #define SRC_PERIL0 0xc250
  41. #define SRC_PERIL1 0xc254
  42. #define SRC_MASK_TOP 0xc310
  43. #define SRC_MASK_CAM 0xc320
  44. #define SRC_MASK_LCD 0xc334
  45. #define SRC_MASK_ISP 0xc338
  46. #define SRC_MASK_FSYS 0xc340
  47. #define SRC_MASK_PERIL0 0xc350
  48. #define SRC_MASK_PERIL1 0xc354
  49. #define DIV_TOP 0xc510
  50. #define DIV_CAM 0xc520
  51. #define DIV_MFC 0xc528
  52. #define DIV_G3D 0xc52c
  53. #define DIV_LCD 0xc534
  54. #define DIV_ISP 0xc538
  55. #define DIV_FSYS0 0xc540
  56. #define DIV_FSYS1 0xc544
  57. #define DIV_FSYS2 0xc548
  58. #define DIV_PERIL0 0xc550
  59. #define DIV_PERIL1 0xc554
  60. #define DIV_PERIL3 0xc55c
  61. #define DIV_PERIL4 0xc560
  62. #define DIV_PERIL5 0xc564
  63. #define DIV_CAM1 0xc568
  64. #define CLKDIV2_RATIO 0xc580
  65. #define GATE_SCLK_CAM 0xc820
  66. #define GATE_SCLK_MFC 0xc828
  67. #define GATE_SCLK_G3D 0xc82c
  68. #define GATE_SCLK_LCD 0xc834
  69. #define GATE_SCLK_ISP_TOP 0xc838
  70. #define GATE_SCLK_FSYS 0xc840
  71. #define GATE_SCLK_PERIL 0xc850
  72. #define GATE_IP_CAM 0xc920
  73. #define GATE_IP_MFC 0xc928
  74. #define GATE_IP_G3D 0xc92c
  75. #define GATE_IP_LCD 0xc934
  76. #define GATE_IP_ISP 0xc938
  77. #define GATE_IP_FSYS 0xc940
  78. #define GATE_IP_PERIL 0xc950
  79. #define GATE_BLOCK 0xc970
  80. #define APLL_LOCK 0x14000
  81. #define APLL_CON0 0x14100
  82. #define SRC_CPU 0x14200
  83. #define DIV_CPU0 0x14500
  84. #define DIV_CPU1 0x14504
  85. #define PWR_CTRL1 0x15020
  86. #define PWR_CTRL2 0x15024
  87. /* Below definitions are used for PWR_CTRL settings */
  88. #define PWR_CTRL1_CORE2_DOWN_RATIO(x) (((x) & 0x7) << 28)
  89. #define PWR_CTRL1_CORE1_DOWN_RATIO(x) (((x) & 0x7) << 16)
  90. #define PWR_CTRL1_DIV2_DOWN_EN (1 << 9)
  91. #define PWR_CTRL1_DIV1_DOWN_EN (1 << 8)
  92. #define PWR_CTRL1_USE_CORE3_WFE (1 << 7)
  93. #define PWR_CTRL1_USE_CORE2_WFE (1 << 6)
  94. #define PWR_CTRL1_USE_CORE1_WFE (1 << 5)
  95. #define PWR_CTRL1_USE_CORE0_WFE (1 << 4)
  96. #define PWR_CTRL1_USE_CORE3_WFI (1 << 3)
  97. #define PWR_CTRL1_USE_CORE2_WFI (1 << 2)
  98. #define PWR_CTRL1_USE_CORE1_WFI (1 << 1)
  99. #define PWR_CTRL1_USE_CORE0_WFI (1 << 0)
  100. static const unsigned long exynos3250_cmu_clk_regs[] __initconst = {
  101. SRC_LEFTBUS,
  102. DIV_LEFTBUS,
  103. GATE_IP_LEFTBUS,
  104. SRC_RIGHTBUS,
  105. DIV_RIGHTBUS,
  106. GATE_IP_RIGHTBUS,
  107. GATE_IP_PERIR,
  108. MPLL_LOCK,
  109. MPLL_CON0,
  110. VPLL_LOCK,
  111. VPLL_CON0,
  112. UPLL_LOCK,
  113. UPLL_CON0,
  114. SRC_TOP0,
  115. SRC_TOP1,
  116. SRC_CAM,
  117. SRC_MFC,
  118. SRC_G3D,
  119. SRC_LCD,
  120. SRC_ISP,
  121. SRC_FSYS,
  122. SRC_PERIL0,
  123. SRC_PERIL1,
  124. SRC_MASK_TOP,
  125. SRC_MASK_CAM,
  126. SRC_MASK_LCD,
  127. SRC_MASK_ISP,
  128. SRC_MASK_FSYS,
  129. SRC_MASK_PERIL0,
  130. SRC_MASK_PERIL1,
  131. DIV_TOP,
  132. DIV_CAM,
  133. DIV_MFC,
  134. DIV_G3D,
  135. DIV_LCD,
  136. DIV_ISP,
  137. DIV_FSYS0,
  138. DIV_FSYS1,
  139. DIV_FSYS2,
  140. DIV_PERIL0,
  141. DIV_PERIL1,
  142. DIV_PERIL3,
  143. DIV_PERIL4,
  144. DIV_PERIL5,
  145. DIV_CAM1,
  146. CLKDIV2_RATIO,
  147. GATE_SCLK_CAM,
  148. GATE_SCLK_MFC,
  149. GATE_SCLK_G3D,
  150. GATE_SCLK_LCD,
  151. GATE_SCLK_ISP_TOP,
  152. GATE_SCLK_FSYS,
  153. GATE_SCLK_PERIL,
  154. GATE_IP_CAM,
  155. GATE_IP_MFC,
  156. GATE_IP_G3D,
  157. GATE_IP_LCD,
  158. GATE_IP_ISP,
  159. GATE_IP_FSYS,
  160. GATE_IP_PERIL,
  161. GATE_BLOCK,
  162. APLL_LOCK,
  163. SRC_CPU,
  164. DIV_CPU0,
  165. DIV_CPU1,
  166. PWR_CTRL1,
  167. PWR_CTRL2,
  168. };
  169. /* list of all parent clock list */
  170. PNAME(mout_vpllsrc_p) = { "fin_pll", };
  171. PNAME(mout_apll_p) = { "fin_pll", "fout_apll", };
  172. PNAME(mout_mpll_p) = { "fin_pll", "fout_mpll", };
  173. PNAME(mout_vpll_p) = { "fin_pll", "fout_vpll", };
  174. PNAME(mout_upll_p) = { "fin_pll", "fout_upll", };
  175. PNAME(mout_mpll_user_p) = { "fin_pll", "div_mpll_pre", };
  176. PNAME(mout_epll_user_p) = { "fin_pll", "mout_epll", };
  177. PNAME(mout_core_p) = { "mout_apll", "mout_mpll_user_c", };
  178. PNAME(mout_hpm_p) = { "mout_apll", "mout_mpll_user_c", };
  179. PNAME(mout_ebi_p) = { "div_aclk_200", "div_aclk_160", };
  180. PNAME(mout_ebi_1_p) = { "mout_ebi", "mout_vpll", };
  181. PNAME(mout_gdl_p) = { "mout_mpll_user_l", };
  182. PNAME(mout_gdr_p) = { "mout_mpll_user_r", };
  183. PNAME(mout_aclk_400_mcuisp_sub_p)
  184. = { "fin_pll", "div_aclk_400_mcuisp", };
  185. PNAME(mout_aclk_266_0_p) = { "div_mpll_pre", "mout_vpll", };
  186. PNAME(mout_aclk_266_1_p) = { "mout_epll_user", };
  187. PNAME(mout_aclk_266_p) = { "mout_aclk_266_0", "mout_aclk_266_1", };
  188. PNAME(mout_aclk_266_sub_p) = { "fin_pll", "div_aclk_266", };
  189. PNAME(group_div_mpll_pre_p) = { "div_mpll_pre", };
  190. PNAME(group_epll_vpll_p) = { "mout_epll_user", "mout_vpll" };
  191. PNAME(group_sclk_p) = { "xxti", "xusbxti",
  192. "none", "none",
  193. "none", "none", "div_mpll_pre",
  194. "mout_epll_user", "mout_vpll", };
  195. PNAME(group_sclk_audio_p) = { "audiocdclk", "none",
  196. "none", "none",
  197. "xxti", "xusbxti",
  198. "div_mpll_pre", "mout_epll_user",
  199. "mout_vpll", };
  200. PNAME(group_sclk_cam_blk_p) = { "xxti", "xusbxti",
  201. "none", "none", "none",
  202. "none", "div_mpll_pre",
  203. "mout_epll_user", "mout_vpll",
  204. "none", "none", "none",
  205. "div_cam_blk_320", };
  206. PNAME(group_sclk_fimd0_p) = { "xxti", "xusbxti",
  207. "m_bitclkhsdiv4_2l", "none",
  208. "none", "none", "div_mpll_pre",
  209. "mout_epll_user", "mout_vpll",
  210. "none", "none", "none",
  211. "div_lcd_blk_145", };
  212. PNAME(mout_mfc_p) = { "mout_mfc_0", "mout_mfc_1" };
  213. PNAME(mout_g3d_p) = { "mout_g3d_0", "mout_g3d_1" };
  214. static const struct samsung_fixed_factor_clock fixed_factor_clks[] __initconst = {
  215. FFACTOR(0, "sclk_mpll_1600", "mout_mpll", 1, 1, 0),
  216. FFACTOR(0, "sclk_mpll_mif", "mout_mpll", 1, 2, 0),
  217. FFACTOR(0, "sclk_bpll", "fout_bpll", 1, 2, 0),
  218. FFACTOR(0, "div_cam_blk_320", "sclk_mpll_1600", 1, 5, 0),
  219. FFACTOR(0, "div_lcd_blk_145", "sclk_mpll_1600", 1, 11, 0),
  220. /* HACK: fin_pll hardcoded to xusbxti until detection is implemented. */
  221. FFACTOR(CLK_FIN_PLL, "fin_pll", "xusbxti", 1, 1, 0),
  222. };
  223. static const struct samsung_mux_clock mux_clks[] __initconst = {
  224. /*
  225. * NOTE: Following table is sorted by register address in ascending
  226. * order and then bitfield shift in descending order, as it is done
  227. * in the User's Manual. When adding new entries, please make sure
  228. * that the order is preserved, to avoid merge conflicts and make
  229. * further work with defined data easier.
  230. */
  231. /* SRC_LEFTBUS */
  232. MUX(CLK_MOUT_MPLL_USER_L, "mout_mpll_user_l", mout_mpll_user_p,
  233. SRC_LEFTBUS, 4, 1),
  234. MUX(CLK_MOUT_GDL, "mout_gdl", mout_gdl_p, SRC_LEFTBUS, 0, 1),
  235. /* SRC_RIGHTBUS */
  236. MUX(CLK_MOUT_MPLL_USER_R, "mout_mpll_user_r", mout_mpll_user_p,
  237. SRC_RIGHTBUS, 4, 1),
  238. MUX(CLK_MOUT_GDR, "mout_gdr", mout_gdr_p, SRC_RIGHTBUS, 0, 1),
  239. /* SRC_TOP0 */
  240. MUX(CLK_MOUT_EBI, "mout_ebi", mout_ebi_p, SRC_TOP0, 28, 1),
  241. MUX(CLK_MOUT_ACLK_200, "mout_aclk_200", group_div_mpll_pre_p,SRC_TOP0, 24, 1),
  242. MUX(CLK_MOUT_ACLK_160, "mout_aclk_160", group_div_mpll_pre_p, SRC_TOP0, 20, 1),
  243. MUX(CLK_MOUT_ACLK_100, "mout_aclk_100", group_div_mpll_pre_p, SRC_TOP0, 16, 1),
  244. MUX(CLK_MOUT_ACLK_266_1, "mout_aclk_266_1", mout_aclk_266_1_p, SRC_TOP0, 14, 1),
  245. MUX(CLK_MOUT_ACLK_266_0, "mout_aclk_266_0", mout_aclk_266_0_p, SRC_TOP0, 13, 1),
  246. MUX(CLK_MOUT_ACLK_266, "mout_aclk_266", mout_aclk_266_p, SRC_TOP0, 12, 1),
  247. MUX(CLK_MOUT_VPLL, "mout_vpll", mout_vpll_p, SRC_TOP0, 8, 1),
  248. MUX(CLK_MOUT_EPLL_USER, "mout_epll_user", mout_epll_user_p, SRC_TOP0, 4, 1),
  249. MUX(CLK_MOUT_EBI_1, "mout_ebi_1", mout_ebi_1_p, SRC_TOP0, 0, 1),
  250. /* SRC_TOP1 */
  251. MUX(CLK_MOUT_UPLL, "mout_upll", mout_upll_p, SRC_TOP1, 28, 1),
  252. MUX(CLK_MOUT_ACLK_400_MCUISP_SUB, "mout_aclk_400_mcuisp_sub", mout_aclk_400_mcuisp_sub_p,
  253. SRC_TOP1, 24, 1),
  254. MUX(CLK_MOUT_ACLK_266_SUB, "mout_aclk_266_sub", mout_aclk_266_sub_p, SRC_TOP1, 20, 1),
  255. MUX(CLK_MOUT_MPLL, "mout_mpll", mout_mpll_p, SRC_TOP1, 12, 1),
  256. MUX(CLK_MOUT_ACLK_400_MCUISP, "mout_aclk_400_mcuisp", group_div_mpll_pre_p, SRC_TOP1, 8, 1),
  257. MUX(CLK_MOUT_VPLLSRC, "mout_vpllsrc", mout_vpllsrc_p, SRC_TOP1, 0, 1),
  258. /* SRC_CAM */
  259. MUX(CLK_MOUT_CAM1, "mout_cam1", group_sclk_p, SRC_CAM, 20, 4),
  260. MUX(CLK_MOUT_CAM_BLK, "mout_cam_blk", group_sclk_cam_blk_p, SRC_CAM, 0, 4),
  261. /* SRC_MFC */
  262. MUX(CLK_MOUT_MFC, "mout_mfc", mout_mfc_p, SRC_MFC, 8, 1),
  263. MUX(CLK_MOUT_MFC_1, "mout_mfc_1", group_epll_vpll_p, SRC_MFC, 4, 1),
  264. MUX(CLK_MOUT_MFC_0, "mout_mfc_0", group_div_mpll_pre_p, SRC_MFC, 0, 1),
  265. /* SRC_G3D */
  266. MUX(CLK_MOUT_G3D, "mout_g3d", mout_g3d_p, SRC_G3D, 8, 1),
  267. MUX(CLK_MOUT_G3D_1, "mout_g3d_1", group_epll_vpll_p, SRC_G3D, 4, 1),
  268. MUX(CLK_MOUT_G3D_0, "mout_g3d_0", group_div_mpll_pre_p, SRC_G3D, 0, 1),
  269. /* SRC_LCD */
  270. MUX(CLK_MOUT_MIPI0, "mout_mipi0", group_sclk_p, SRC_LCD, 12, 4),
  271. MUX(CLK_MOUT_FIMD0, "mout_fimd0", group_sclk_fimd0_p, SRC_LCD, 0, 4),
  272. /* SRC_ISP */
  273. MUX(CLK_MOUT_UART_ISP, "mout_uart_isp", group_sclk_p, SRC_ISP, 12, 4),
  274. MUX(CLK_MOUT_SPI1_ISP, "mout_spi1_isp", group_sclk_p, SRC_ISP, 8, 4),
  275. MUX(CLK_MOUT_SPI0_ISP, "mout_spi0_isp", group_sclk_p, SRC_ISP, 4, 4),
  276. /* SRC_FSYS */
  277. MUX(CLK_MOUT_TSADC, "mout_tsadc", group_sclk_p, SRC_FSYS, 28, 4),
  278. MUX(CLK_MOUT_MMC2, "mout_mmc2", group_sclk_p, SRC_FSYS, 8, 4),
  279. MUX(CLK_MOUT_MMC1, "mout_mmc1", group_sclk_p, SRC_FSYS, 4, 4),
  280. MUX(CLK_MOUT_MMC0, "mout_mmc0", group_sclk_p, SRC_FSYS, 0, 4),
  281. /* SRC_PERIL0 */
  282. MUX(CLK_MOUT_UART2, "mout_uart2", group_sclk_p, SRC_PERIL0, 8, 4),
  283. MUX(CLK_MOUT_UART1, "mout_uart1", group_sclk_p, SRC_PERIL0, 4, 4),
  284. MUX(CLK_MOUT_UART0, "mout_uart0", group_sclk_p, SRC_PERIL0, 0, 4),
  285. /* SRC_PERIL1 */
  286. MUX(CLK_MOUT_SPI1, "mout_spi1", group_sclk_p, SRC_PERIL1, 20, 4),
  287. MUX(CLK_MOUT_SPI0, "mout_spi0", group_sclk_p, SRC_PERIL1, 16, 4),
  288. MUX(CLK_MOUT_AUDIO, "mout_audio", group_sclk_audio_p, SRC_PERIL1, 4, 4),
  289. /* SRC_CPU */
  290. MUX(CLK_MOUT_MPLL_USER_C, "mout_mpll_user_c", mout_mpll_user_p,
  291. SRC_CPU, 24, 1),
  292. MUX(CLK_MOUT_HPM, "mout_hpm", mout_hpm_p, SRC_CPU, 20, 1),
  293. MUX_F(CLK_MOUT_CORE, "mout_core", mout_core_p, SRC_CPU, 16, 1,
  294. CLK_SET_RATE_PARENT, 0),
  295. MUX_F(CLK_MOUT_APLL, "mout_apll", mout_apll_p, SRC_CPU, 0, 1,
  296. CLK_SET_RATE_PARENT, 0),
  297. };
  298. static const struct samsung_div_clock div_clks[] __initconst = {
  299. /*
  300. * NOTE: Following table is sorted by register address in ascending
  301. * order and then bitfield shift in descending order, as it is done
  302. * in the User's Manual. When adding new entries, please make sure
  303. * that the order is preserved, to avoid merge conflicts and make
  304. * further work with defined data easier.
  305. */
  306. /* DIV_LEFTBUS */
  307. DIV(CLK_DIV_GPL, "div_gpl", "div_gdl", DIV_LEFTBUS, 4, 3),
  308. DIV(CLK_DIV_GDL, "div_gdl", "mout_gdl", DIV_LEFTBUS, 0, 4),
  309. /* DIV_RIGHTBUS */
  310. DIV(CLK_DIV_GPR, "div_gpr", "div_gdr", DIV_RIGHTBUS, 4, 3),
  311. DIV(CLK_DIV_GDR, "div_gdr", "mout_gdr", DIV_RIGHTBUS, 0, 4),
  312. /* DIV_TOP */
  313. DIV(CLK_DIV_MPLL_PRE, "div_mpll_pre", "sclk_mpll_mif", DIV_TOP, 28, 2),
  314. DIV(CLK_DIV_ACLK_400_MCUISP, "div_aclk_400_mcuisp",
  315. "mout_aclk_400_mcuisp", DIV_TOP, 24, 3),
  316. DIV(CLK_DIV_EBI, "div_ebi", "mout_ebi_1", DIV_TOP, 16, 3),
  317. DIV(CLK_DIV_ACLK_200, "div_aclk_200", "mout_aclk_200", DIV_TOP, 12, 3),
  318. DIV(CLK_DIV_ACLK_160, "div_aclk_160", "mout_aclk_160", DIV_TOP, 8, 3),
  319. DIV(CLK_DIV_ACLK_100, "div_aclk_100", "mout_aclk_100", DIV_TOP, 4, 4),
  320. DIV(CLK_DIV_ACLK_266, "div_aclk_266", "mout_aclk_266", DIV_TOP, 0, 3),
  321. /* DIV_CAM */
  322. DIV(CLK_DIV_CAM1, "div_cam1", "mout_cam1", DIV_CAM, 20, 4),
  323. DIV(CLK_DIV_CAM_BLK, "div_cam_blk", "mout_cam_blk", DIV_CAM, 0, 4),
  324. /* DIV_MFC */
  325. DIV(CLK_DIV_MFC, "div_mfc", "mout_mfc", DIV_MFC, 0, 4),
  326. /* DIV_G3D */
  327. DIV(CLK_DIV_G3D, "div_g3d", "mout_g3d", DIV_G3D, 0, 4),
  328. /* DIV_LCD */
  329. DIV_F(CLK_DIV_MIPI0_PRE, "div_mipi0_pre", "div_mipi0", DIV_LCD, 20, 4,
  330. CLK_SET_RATE_PARENT, 0),
  331. DIV(CLK_DIV_MIPI0, "div_mipi0", "mout_mipi0", DIV_LCD, 16, 4),
  332. DIV(CLK_DIV_FIMD0, "div_fimd0", "mout_fimd0", DIV_LCD, 0, 4),
  333. /* DIV_ISP */
  334. DIV(CLK_DIV_UART_ISP, "div_uart_isp", "mout_uart_isp", DIV_ISP, 28, 4),
  335. DIV_F(CLK_DIV_SPI1_ISP_PRE, "div_spi1_isp_pre", "div_spi1_isp",
  336. DIV_ISP, 20, 8, CLK_SET_RATE_PARENT, 0),
  337. DIV(CLK_DIV_SPI1_ISP, "div_spi1_isp", "mout_spi1_isp", DIV_ISP, 16, 4),
  338. DIV_F(CLK_DIV_SPI0_ISP_PRE, "div_spi0_isp_pre", "div_spi0_isp",
  339. DIV_ISP, 8, 8, CLK_SET_RATE_PARENT, 0),
  340. DIV(CLK_DIV_SPI0_ISP, "div_spi0_isp", "mout_spi0_isp", DIV_ISP, 4, 4),
  341. /* DIV_FSYS0 */
  342. DIV_F(CLK_DIV_TSADC_PRE, "div_tsadc_pre", "div_tsadc", DIV_FSYS0, 8, 8,
  343. CLK_SET_RATE_PARENT, 0),
  344. DIV(CLK_DIV_TSADC, "div_tsadc", "mout_tsadc", DIV_FSYS0, 0, 4),
  345. /* DIV_FSYS1 */
  346. DIV_F(CLK_DIV_MMC1_PRE, "div_mmc1_pre", "div_mmc1", DIV_FSYS1, 24, 8,
  347. CLK_SET_RATE_PARENT, 0),
  348. DIV(CLK_DIV_MMC1, "div_mmc1", "mout_mmc1", DIV_FSYS1, 16, 4),
  349. DIV_F(CLK_DIV_MMC0_PRE, "div_mmc0_pre", "div_mmc0", DIV_FSYS1, 8, 8,
  350. CLK_SET_RATE_PARENT, 0),
  351. DIV(CLK_DIV_MMC0, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
  352. /* DIV_FSYS2 */
  353. DIV_F(CLK_DIV_MMC2_PRE, "div_mmc2_pre", "div_mmc2", DIV_FSYS2, 8, 8,
  354. CLK_SET_RATE_PARENT, 0),
  355. DIV(CLK_DIV_MMC2, "div_mmc2", "mout_mmc2", DIV_FSYS2, 0, 4),
  356. /* DIV_PERIL0 */
  357. DIV(CLK_DIV_UART2, "div_uart2", "mout_uart2", DIV_PERIL0, 8, 4),
  358. DIV(CLK_DIV_UART1, "div_uart1", "mout_uart1", DIV_PERIL0, 4, 4),
  359. DIV(CLK_DIV_UART0, "div_uart0", "mout_uart0", DIV_PERIL0, 0, 4),
  360. /* DIV_PERIL1 */
  361. DIV_F(CLK_DIV_SPI1_PRE, "div_spi1_pre", "div_spi1", DIV_PERIL1, 24, 8,
  362. CLK_SET_RATE_PARENT, 0),
  363. DIV(CLK_DIV_SPI1, "div_spi1", "mout_spi1", DIV_PERIL1, 16, 4),
  364. DIV_F(CLK_DIV_SPI0_PRE, "div_spi0_pre", "div_spi0", DIV_PERIL1, 8, 8,
  365. CLK_SET_RATE_PARENT, 0),
  366. DIV(CLK_DIV_SPI0, "div_spi0", "mout_spi0", DIV_PERIL1, 0, 4),
  367. /* DIV_PERIL4 */
  368. DIV(CLK_DIV_PCM, "div_pcm", "div_audio", DIV_PERIL4, 20, 8),
  369. DIV(CLK_DIV_AUDIO, "div_audio", "mout_audio", DIV_PERIL4, 16, 4),
  370. /* DIV_PERIL5 */
  371. DIV(CLK_DIV_I2S, "div_i2s", "div_audio", DIV_PERIL5, 8, 6),
  372. /* DIV_CPU0 */
  373. DIV(CLK_DIV_CORE2, "div_core2", "div_core", DIV_CPU0, 28, 3),
  374. DIV(CLK_DIV_APLL, "div_apll", "mout_apll", DIV_CPU0, 24, 3),
  375. DIV(CLK_DIV_PCLK_DBG, "div_pclk_dbg", "div_core2", DIV_CPU0, 20, 3),
  376. DIV(CLK_DIV_ATB, "div_atb", "div_core2", DIV_CPU0, 16, 3),
  377. DIV(CLK_DIV_COREM, "div_corem", "div_core2", DIV_CPU0, 4, 3),
  378. DIV(CLK_DIV_CORE, "div_core", "mout_core", DIV_CPU0, 0, 3),
  379. /* DIV_CPU1 */
  380. DIV(CLK_DIV_HPM, "div_hpm", "div_copy", DIV_CPU1, 4, 3),
  381. DIV(CLK_DIV_COPY, "div_copy", "mout_hpm", DIV_CPU1, 0, 3),
  382. };
  383. static const struct samsung_gate_clock gate_clks[] __initconst = {
  384. /*
  385. * NOTE: Following table is sorted by register address in ascending
  386. * order and then bitfield shift in descending order, as it is done
  387. * in the User's Manual. When adding new entries, please make sure
  388. * that the order is preserved, to avoid merge conflicts and make
  389. * further work with defined data easier.
  390. */
  391. /* GATE_IP_LEFTBUS */
  392. GATE(CLK_ASYNC_G3D, "async_g3d", "div_aclk_100", GATE_IP_LEFTBUS, 6,
  393. CLK_IGNORE_UNUSED, 0),
  394. GATE(CLK_ASYNC_MFCL, "async_mfcl", "div_aclk_100", GATE_IP_LEFTBUS, 4,
  395. CLK_IGNORE_UNUSED, 0),
  396. GATE(CLK_PPMULEFT, "ppmuleft", "div_aclk_100", GATE_IP_LEFTBUS, 1,
  397. CLK_IGNORE_UNUSED, 0),
  398. GATE(CLK_GPIO_LEFT, "gpio_left", "div_aclk_100", GATE_IP_LEFTBUS, 0,
  399. CLK_IGNORE_UNUSED, 0),
  400. /* GATE_IP_RIGHTBUS */
  401. GATE(CLK_ASYNC_ISPMX, "async_ispmx", "div_aclk_100",
  402. GATE_IP_RIGHTBUS, 9, CLK_IGNORE_UNUSED, 0),
  403. GATE(CLK_ASYNC_FSYSD, "async_fsysd", "div_aclk_100",
  404. GATE_IP_RIGHTBUS, 5, CLK_IGNORE_UNUSED, 0),
  405. GATE(CLK_ASYNC_LCD0X, "async_lcd0x", "div_aclk_100",
  406. GATE_IP_RIGHTBUS, 3, CLK_IGNORE_UNUSED, 0),
  407. GATE(CLK_ASYNC_CAMX, "async_camx", "div_aclk_100", GATE_IP_RIGHTBUS, 2,
  408. CLK_IGNORE_UNUSED, 0),
  409. GATE(CLK_PPMURIGHT, "ppmuright", "div_aclk_100", GATE_IP_RIGHTBUS, 1,
  410. CLK_IGNORE_UNUSED, 0),
  411. GATE(CLK_GPIO_RIGHT, "gpio_right", "div_aclk_100", GATE_IP_RIGHTBUS, 0,
  412. CLK_IGNORE_UNUSED, 0),
  413. /* GATE_IP_PERIR */
  414. GATE(CLK_MONOCNT, "monocnt", "div_aclk_100", GATE_IP_PERIR, 22,
  415. CLK_IGNORE_UNUSED, 0),
  416. GATE(CLK_TZPC6, "tzpc6", "div_aclk_100", GATE_IP_PERIR, 21,
  417. CLK_IGNORE_UNUSED, 0),
  418. GATE(CLK_PROVISIONKEY1, "provisionkey1", "div_aclk_100",
  419. GATE_IP_PERIR, 20, CLK_IGNORE_UNUSED, 0),
  420. GATE(CLK_PROVISIONKEY0, "provisionkey0", "div_aclk_100",
  421. GATE_IP_PERIR, 19, CLK_IGNORE_UNUSED, 0),
  422. GATE(CLK_CMU_ISPPART, "cmu_isppart", "div_aclk_100", GATE_IP_PERIR, 18,
  423. CLK_IGNORE_UNUSED, 0),
  424. GATE(CLK_TMU_APBIF, "tmu_apbif", "div_aclk_100",
  425. GATE_IP_PERIR, 17, 0, 0),
  426. GATE(CLK_KEYIF, "keyif", "div_aclk_100", GATE_IP_PERIR, 16, 0, 0),
  427. GATE(CLK_RTC, "rtc", "div_aclk_100", GATE_IP_PERIR, 15, 0, 0),
  428. GATE(CLK_WDT, "wdt", "div_aclk_100", GATE_IP_PERIR, 14, 0, 0),
  429. GATE(CLK_MCT, "mct", "div_aclk_100", GATE_IP_PERIR, 13, 0, 0),
  430. GATE(CLK_SECKEY, "seckey", "div_aclk_100", GATE_IP_PERIR, 12,
  431. CLK_IGNORE_UNUSED, 0),
  432. GATE(CLK_TZPC5, "tzpc5", "div_aclk_100", GATE_IP_PERIR, 10,
  433. CLK_IGNORE_UNUSED, 0),
  434. GATE(CLK_TZPC4, "tzpc4", "div_aclk_100", GATE_IP_PERIR, 9,
  435. CLK_IGNORE_UNUSED, 0),
  436. GATE(CLK_TZPC3, "tzpc3", "div_aclk_100", GATE_IP_PERIR, 8,
  437. CLK_IGNORE_UNUSED, 0),
  438. GATE(CLK_TZPC2, "tzpc2", "div_aclk_100", GATE_IP_PERIR, 7,
  439. CLK_IGNORE_UNUSED, 0),
  440. GATE(CLK_TZPC1, "tzpc1", "div_aclk_100", GATE_IP_PERIR, 6,
  441. CLK_IGNORE_UNUSED, 0),
  442. GATE(CLK_TZPC0, "tzpc0", "div_aclk_100", GATE_IP_PERIR, 5,
  443. CLK_IGNORE_UNUSED, 0),
  444. GATE(CLK_CMU_COREPART, "cmu_corepart", "div_aclk_100", GATE_IP_PERIR, 4,
  445. CLK_IGNORE_UNUSED, 0),
  446. GATE(CLK_CMU_TOPPART, "cmu_toppart", "div_aclk_100", GATE_IP_PERIR, 3,
  447. CLK_IGNORE_UNUSED, 0),
  448. GATE(CLK_PMU_APBIF, "pmu_apbif", "div_aclk_100", GATE_IP_PERIR, 2,
  449. CLK_IGNORE_UNUSED, 0),
  450. GATE(CLK_SYSREG, "sysreg", "div_aclk_100", GATE_IP_PERIR, 1,
  451. CLK_IGNORE_UNUSED, 0),
  452. GATE(CLK_CHIP_ID, "chip_id", "div_aclk_100", GATE_IP_PERIR, 0,
  453. CLK_IGNORE_UNUSED, 0),
  454. /* GATE_SCLK_CAM */
  455. GATE(CLK_SCLK_JPEG, "sclk_jpeg", "div_cam_blk",
  456. GATE_SCLK_CAM, 8, CLK_SET_RATE_PARENT, 0),
  457. GATE(CLK_SCLK_M2MSCALER, "sclk_m2mscaler", "div_cam_blk",
  458. GATE_SCLK_CAM, 2, CLK_SET_RATE_PARENT, 0),
  459. GATE(CLK_SCLK_GSCALER1, "sclk_gscaler1", "div_cam_blk",
  460. GATE_SCLK_CAM, 1, CLK_SET_RATE_PARENT, 0),
  461. GATE(CLK_SCLK_GSCALER0, "sclk_gscaler0", "div_cam_blk",
  462. GATE_SCLK_CAM, 0, CLK_SET_RATE_PARENT, 0),
  463. /* GATE_SCLK_MFC */
  464. GATE(CLK_SCLK_MFC, "sclk_mfc", "div_mfc",
  465. GATE_SCLK_MFC, 0, CLK_SET_RATE_PARENT, 0),
  466. /* GATE_SCLK_G3D */
  467. GATE(CLK_SCLK_G3D, "sclk_g3d", "div_g3d",
  468. GATE_SCLK_G3D, 0, CLK_SET_RATE_PARENT, 0),
  469. /* GATE_SCLK_LCD */
  470. GATE(CLK_SCLK_MIPIDPHY2L, "sclk_mipidphy2l", "div_mipi0",
  471. GATE_SCLK_LCD, 4, CLK_SET_RATE_PARENT, 0),
  472. GATE(CLK_SCLK_MIPI0, "sclk_mipi0", "div_mipi0_pre",
  473. GATE_SCLK_LCD, 3, CLK_SET_RATE_PARENT, 0),
  474. GATE(CLK_SCLK_FIMD0, "sclk_fimd0", "div_fimd0",
  475. GATE_SCLK_LCD, 0, CLK_SET_RATE_PARENT, 0),
  476. /* GATE_SCLK_ISP_TOP */
  477. GATE(CLK_SCLK_CAM1, "sclk_cam1", "div_cam1",
  478. GATE_SCLK_ISP_TOP, 4, CLK_SET_RATE_PARENT, 0),
  479. GATE(CLK_SCLK_UART_ISP, "sclk_uart_isp", "div_uart_isp",
  480. GATE_SCLK_ISP_TOP, 3, CLK_SET_RATE_PARENT, 0),
  481. GATE(CLK_SCLK_SPI1_ISP, "sclk_spi1_isp", "div_spi1_isp",
  482. GATE_SCLK_ISP_TOP, 2, CLK_SET_RATE_PARENT, 0),
  483. GATE(CLK_SCLK_SPI0_ISP, "sclk_spi0_isp", "div_spi0_isp",
  484. GATE_SCLK_ISP_TOP, 1, CLK_SET_RATE_PARENT, 0),
  485. /* GATE_SCLK_FSYS */
  486. GATE(CLK_SCLK_UPLL, "sclk_upll", "mout_upll", GATE_SCLK_FSYS, 10, 0, 0),
  487. GATE(CLK_SCLK_TSADC, "sclk_tsadc", "div_tsadc_pre",
  488. GATE_SCLK_FSYS, 9, CLK_SET_RATE_PARENT, 0),
  489. GATE(CLK_SCLK_EBI, "sclk_ebi", "div_ebi",
  490. GATE_SCLK_FSYS, 6, CLK_SET_RATE_PARENT, 0),
  491. GATE(CLK_SCLK_MMC2, "sclk_mmc2", "div_mmc2_pre",
  492. GATE_SCLK_FSYS, 2, CLK_SET_RATE_PARENT, 0),
  493. GATE(CLK_SCLK_MMC1, "sclk_mmc1", "div_mmc1_pre",
  494. GATE_SCLK_FSYS, 1, CLK_SET_RATE_PARENT, 0),
  495. GATE(CLK_SCLK_MMC0, "sclk_mmc0", "div_mmc0_pre",
  496. GATE_SCLK_FSYS, 0, CLK_SET_RATE_PARENT, 0),
  497. /* GATE_SCLK_PERIL */
  498. GATE(CLK_SCLK_I2S, "sclk_i2s", "div_i2s",
  499. GATE_SCLK_PERIL, 18, CLK_SET_RATE_PARENT, 0),
  500. GATE(CLK_SCLK_PCM, "sclk_pcm", "div_pcm",
  501. GATE_SCLK_PERIL, 16, CLK_SET_RATE_PARENT, 0),
  502. GATE(CLK_SCLK_SPI1, "sclk_spi1", "div_spi1_pre",
  503. GATE_SCLK_PERIL, 7, CLK_SET_RATE_PARENT, 0),
  504. GATE(CLK_SCLK_SPI0, "sclk_spi0", "div_spi0_pre",
  505. GATE_SCLK_PERIL, 6, CLK_SET_RATE_PARENT, 0),
  506. GATE(CLK_SCLK_UART2, "sclk_uart2", "div_uart2",
  507. GATE_SCLK_PERIL, 2, CLK_SET_RATE_PARENT, 0),
  508. GATE(CLK_SCLK_UART1, "sclk_uart1", "div_uart1",
  509. GATE_SCLK_PERIL, 1, CLK_SET_RATE_PARENT, 0),
  510. GATE(CLK_SCLK_UART0, "sclk_uart0", "div_uart0",
  511. GATE_SCLK_PERIL, 0, CLK_SET_RATE_PARENT, 0),
  512. /* GATE_IP_CAM */
  513. GATE(CLK_QEJPEG, "qejpeg", "div_cam_blk_320", GATE_IP_CAM, 19,
  514. CLK_IGNORE_UNUSED, 0),
  515. GATE(CLK_PIXELASYNCM1, "pixelasyncm1", "div_cam_blk_320",
  516. GATE_IP_CAM, 18, CLK_IGNORE_UNUSED, 0),
  517. GATE(CLK_PIXELASYNCM0, "pixelasyncm0", "div_cam_blk_320",
  518. GATE_IP_CAM, 17, CLK_IGNORE_UNUSED, 0),
  519. GATE(CLK_PPMUCAMIF, "ppmucamif", "div_cam_blk_320",
  520. GATE_IP_CAM, 16, CLK_IGNORE_UNUSED, 0),
  521. GATE(CLK_QEM2MSCALER, "qem2mscaler", "div_cam_blk_320",
  522. GATE_IP_CAM, 14, CLK_IGNORE_UNUSED, 0),
  523. GATE(CLK_QEGSCALER1, "qegscaler1", "div_cam_blk_320",
  524. GATE_IP_CAM, 13, CLK_IGNORE_UNUSED, 0),
  525. GATE(CLK_QEGSCALER0, "qegscaler0", "div_cam_blk_320",
  526. GATE_IP_CAM, 12, CLK_IGNORE_UNUSED, 0),
  527. GATE(CLK_SMMUJPEG, "smmujpeg", "div_cam_blk_320",
  528. GATE_IP_CAM, 11, 0, 0),
  529. GATE(CLK_SMMUM2M2SCALER, "smmum2m2scaler", "div_cam_blk_320",
  530. GATE_IP_CAM, 9, 0, 0),
  531. GATE(CLK_SMMUGSCALER1, "smmugscaler1", "div_cam_blk_320",
  532. GATE_IP_CAM, 8, 0, 0),
  533. GATE(CLK_SMMUGSCALER0, "smmugscaler0", "div_cam_blk_320",
  534. GATE_IP_CAM, 7, 0, 0),
  535. GATE(CLK_JPEG, "jpeg", "div_cam_blk_320", GATE_IP_CAM, 6, 0, 0),
  536. GATE(CLK_M2MSCALER, "m2mscaler", "div_cam_blk_320",
  537. GATE_IP_CAM, 2, 0, 0),
  538. GATE(CLK_GSCALER1, "gscaler1", "div_cam_blk_320", GATE_IP_CAM, 1, 0, 0),
  539. GATE(CLK_GSCALER0, "gscaler0", "div_cam_blk_320", GATE_IP_CAM, 0, 0, 0),
  540. /* GATE_IP_MFC */
  541. GATE(CLK_QEMFC, "qemfc", "div_aclk_200", GATE_IP_MFC, 5,
  542. CLK_IGNORE_UNUSED, 0),
  543. GATE(CLK_PPMUMFC_L, "ppmumfc_l", "div_aclk_200", GATE_IP_MFC, 3,
  544. CLK_IGNORE_UNUSED, 0),
  545. GATE(CLK_SMMUMFC_L, "smmumfc_l", "div_aclk_200", GATE_IP_MFC, 1, 0, 0),
  546. GATE(CLK_MFC, "mfc", "div_aclk_200", GATE_IP_MFC, 0, 0, 0),
  547. /* GATE_IP_G3D */
  548. GATE(CLK_SMMUG3D, "smmug3d", "div_aclk_200", GATE_IP_G3D, 3, 0, 0),
  549. GATE(CLK_QEG3D, "qeg3d", "div_aclk_200", GATE_IP_G3D, 2,
  550. CLK_IGNORE_UNUSED, 0),
  551. GATE(CLK_PPMUG3D, "ppmug3d", "div_aclk_200", GATE_IP_G3D, 1,
  552. CLK_IGNORE_UNUSED, 0),
  553. GATE(CLK_G3D, "g3d", "div_aclk_200", GATE_IP_G3D, 0, 0, 0),
  554. /* GATE_IP_LCD */
  555. GATE(CLK_QE_CH1_LCD, "qe_ch1_lcd", "div_aclk_160", GATE_IP_LCD, 7,
  556. CLK_IGNORE_UNUSED, 0),
  557. GATE(CLK_QE_CH0_LCD, "qe_ch0_lcd", "div_aclk_160", GATE_IP_LCD, 6,
  558. CLK_IGNORE_UNUSED, 0),
  559. GATE(CLK_PPMULCD0, "ppmulcd0", "div_aclk_160", GATE_IP_LCD, 5,
  560. CLK_IGNORE_UNUSED, 0),
  561. GATE(CLK_SMMUFIMD0, "smmufimd0", "div_aclk_160", GATE_IP_LCD, 4, 0, 0),
  562. GATE(CLK_DSIM0, "dsim0", "div_aclk_160", GATE_IP_LCD, 3, 0, 0),
  563. GATE(CLK_SMIES, "smies", "div_aclk_160", GATE_IP_LCD, 2, 0, 0),
  564. GATE(CLK_FIMD0, "fimd0", "div_aclk_160", GATE_IP_LCD, 0, 0, 0),
  565. /* GATE_IP_ISP */
  566. GATE(CLK_CAM1, "cam1", "mout_aclk_266_sub", GATE_IP_ISP, 5, 0, 0),
  567. GATE(CLK_UART_ISP_TOP, "uart_isp_top", "mout_aclk_266_sub",
  568. GATE_IP_ISP, 3, 0, 0),
  569. GATE(CLK_SPI1_ISP_TOP, "spi1_isp_top", "mout_aclk_266_sub",
  570. GATE_IP_ISP, 2, 0, 0),
  571. GATE(CLK_SPI0_ISP_TOP, "spi0_isp_top", "mout_aclk_266_sub",
  572. GATE_IP_ISP, 1, 0, 0),
  573. /* GATE_IP_FSYS */
  574. GATE(CLK_TSADC, "tsadc", "div_aclk_200", GATE_IP_FSYS, 20, 0, 0),
  575. GATE(CLK_PPMUFILE, "ppmufile", "div_aclk_200", GATE_IP_FSYS, 17,
  576. CLK_IGNORE_UNUSED, 0),
  577. GATE(CLK_USBOTG, "usbotg", "div_aclk_200", GATE_IP_FSYS, 13, 0, 0),
  578. GATE(CLK_USBHOST, "usbhost", "div_aclk_200", GATE_IP_FSYS, 12, 0, 0),
  579. GATE(CLK_SROMC, "sromc", "div_aclk_200", GATE_IP_FSYS, 11, 0, 0),
  580. GATE(CLK_SDMMC2, "sdmmc2", "div_aclk_200", GATE_IP_FSYS, 7, 0, 0),
  581. GATE(CLK_SDMMC1, "sdmmc1", "div_aclk_200", GATE_IP_FSYS, 6, 0, 0),
  582. GATE(CLK_SDMMC0, "sdmmc0", "div_aclk_200", GATE_IP_FSYS, 5, 0, 0),
  583. GATE(CLK_PDMA1, "pdma1", "div_aclk_200", GATE_IP_FSYS, 1, 0, 0),
  584. GATE(CLK_PDMA0, "pdma0", "div_aclk_200", GATE_IP_FSYS, 0, 0, 0),
  585. /* GATE_IP_PERIL */
  586. GATE(CLK_PWM, "pwm", "div_aclk_100", GATE_IP_PERIL, 24, 0, 0),
  587. GATE(CLK_PCM, "pcm", "div_aclk_100", GATE_IP_PERIL, 23, 0, 0),
  588. GATE(CLK_I2S, "i2s", "div_aclk_100", GATE_IP_PERIL, 21, 0, 0),
  589. GATE(CLK_SPI1, "spi1", "div_aclk_100", GATE_IP_PERIL, 17, 0, 0),
  590. GATE(CLK_SPI0, "spi0", "div_aclk_100", GATE_IP_PERIL, 16, 0, 0),
  591. GATE(CLK_I2C7, "i2c7", "div_aclk_100", GATE_IP_PERIL, 13, 0, 0),
  592. GATE(CLK_I2C6, "i2c6", "div_aclk_100", GATE_IP_PERIL, 12, 0, 0),
  593. GATE(CLK_I2C5, "i2c5", "div_aclk_100", GATE_IP_PERIL, 11, 0, 0),
  594. GATE(CLK_I2C4, "i2c4", "div_aclk_100", GATE_IP_PERIL, 10, 0, 0),
  595. GATE(CLK_I2C3, "i2c3", "div_aclk_100", GATE_IP_PERIL, 9, 0, 0),
  596. GATE(CLK_I2C2, "i2c2", "div_aclk_100", GATE_IP_PERIL, 8, 0, 0),
  597. GATE(CLK_I2C1, "i2c1", "div_aclk_100", GATE_IP_PERIL, 7, 0, 0),
  598. GATE(CLK_I2C0, "i2c0", "div_aclk_100", GATE_IP_PERIL, 6, 0, 0),
  599. GATE(CLK_UART2, "uart2", "div_aclk_100", GATE_IP_PERIL, 2, 0, 0),
  600. GATE(CLK_UART1, "uart1", "div_aclk_100", GATE_IP_PERIL, 1, 0, 0),
  601. GATE(CLK_UART0, "uart0", "div_aclk_100", GATE_IP_PERIL, 0, 0, 0),
  602. };
  603. /* APLL & MPLL & BPLL & UPLL */
  604. static const struct samsung_pll_rate_table exynos3250_pll_rates[] __initconst = {
  605. PLL_35XX_RATE(1200000000, 400, 4, 1),
  606. PLL_35XX_RATE(1100000000, 275, 3, 1),
  607. PLL_35XX_RATE(1066000000, 533, 6, 1),
  608. PLL_35XX_RATE(1000000000, 250, 3, 1),
  609. PLL_35XX_RATE( 960000000, 320, 4, 1),
  610. PLL_35XX_RATE( 900000000, 300, 4, 1),
  611. PLL_35XX_RATE( 850000000, 425, 6, 1),
  612. PLL_35XX_RATE( 800000000, 200, 3, 1),
  613. PLL_35XX_RATE( 700000000, 175, 3, 1),
  614. PLL_35XX_RATE( 667000000, 667, 12, 1),
  615. PLL_35XX_RATE( 600000000, 400, 4, 2),
  616. PLL_35XX_RATE( 533000000, 533, 6, 2),
  617. PLL_35XX_RATE( 520000000, 260, 3, 2),
  618. PLL_35XX_RATE( 500000000, 250, 3, 2),
  619. PLL_35XX_RATE( 400000000, 200, 3, 2),
  620. PLL_35XX_RATE( 200000000, 200, 3, 3),
  621. PLL_35XX_RATE( 100000000, 200, 3, 4),
  622. { /* sentinel */ }
  623. };
  624. /* EPLL */
  625. static const struct samsung_pll_rate_table exynos3250_epll_rates[] __initconst = {
  626. PLL_36XX_RATE(800000000, 200, 3, 1, 0),
  627. PLL_36XX_RATE(288000000, 96, 2, 2, 0),
  628. PLL_36XX_RATE(192000000, 128, 2, 3, 0),
  629. PLL_36XX_RATE(144000000, 96, 2, 3, 0),
  630. PLL_36XX_RATE( 96000000, 128, 2, 4, 0),
  631. PLL_36XX_RATE( 84000000, 112, 2, 4, 0),
  632. PLL_36XX_RATE( 80000003, 106, 2, 4, 43691),
  633. PLL_36XX_RATE( 73728000, 98, 2, 4, 19923),
  634. PLL_36XX_RATE( 67737598, 270, 3, 5, 62285),
  635. PLL_36XX_RATE( 65535999, 174, 2, 5, 49982),
  636. PLL_36XX_RATE( 50000000, 200, 3, 5, 0),
  637. PLL_36XX_RATE( 49152002, 131, 2, 5, 4719),
  638. PLL_36XX_RATE( 48000000, 128, 2, 5, 0),
  639. PLL_36XX_RATE( 45158401, 180, 3, 5, 41524),
  640. { /* sentinel */ }
  641. };
  642. /* VPLL */
  643. static const struct samsung_pll_rate_table exynos3250_vpll_rates[] __initconst = {
  644. PLL_36XX_RATE(600000000, 100, 2, 1, 0),
  645. PLL_36XX_RATE(533000000, 266, 3, 2, 32768),
  646. PLL_36XX_RATE(519230987, 173, 2, 2, 5046),
  647. PLL_36XX_RATE(500000000, 250, 3, 2, 0),
  648. PLL_36XX_RATE(445500000, 148, 2, 2, 32768),
  649. PLL_36XX_RATE(445055007, 148, 2, 2, 23047),
  650. PLL_36XX_RATE(400000000, 200, 3, 2, 0),
  651. PLL_36XX_RATE(371250000, 123, 2, 2, 49152),
  652. PLL_36XX_RATE(370878997, 185, 3, 2, 28803),
  653. PLL_36XX_RATE(340000000, 170, 3, 2, 0),
  654. PLL_36XX_RATE(335000015, 111, 2, 2, 43691),
  655. PLL_36XX_RATE(333000000, 111, 2, 2, 0),
  656. PLL_36XX_RATE(330000000, 110, 2, 2, 0),
  657. PLL_36XX_RATE(320000015, 106, 2, 2, 43691),
  658. PLL_36XX_RATE(300000000, 100, 2, 2, 0),
  659. PLL_36XX_RATE(275000000, 275, 3, 3, 0),
  660. PLL_36XX_RATE(222750000, 148, 2, 3, 32768),
  661. PLL_36XX_RATE(222528007, 148, 2, 3, 23069),
  662. PLL_36XX_RATE(160000000, 160, 3, 3, 0),
  663. PLL_36XX_RATE(148500000, 99, 2, 3, 0),
  664. PLL_36XX_RATE(148352005, 98, 2, 3, 59070),
  665. PLL_36XX_RATE(108000000, 144, 2, 4, 0),
  666. PLL_36XX_RATE( 74250000, 99, 2, 4, 0),
  667. PLL_36XX_RATE( 74176002, 98, 2, 4, 59070),
  668. PLL_36XX_RATE( 54054000, 216, 3, 5, 14156),
  669. PLL_36XX_RATE( 54000000, 144, 2, 5, 0),
  670. { /* sentinel */ }
  671. };
  672. static const struct samsung_pll_clock exynos3250_plls[] __initconst = {
  673. PLL(pll_35xx, CLK_FOUT_APLL, "fout_apll", "fin_pll",
  674. APLL_LOCK, APLL_CON0, exynos3250_pll_rates),
  675. PLL(pll_35xx, CLK_FOUT_MPLL, "fout_mpll", "fin_pll",
  676. MPLL_LOCK, MPLL_CON0, exynos3250_pll_rates),
  677. PLL(pll_36xx, CLK_FOUT_VPLL, "fout_vpll", "fin_pll",
  678. VPLL_LOCK, VPLL_CON0, exynos3250_vpll_rates),
  679. PLL(pll_35xx, CLK_FOUT_UPLL, "fout_upll", "fin_pll",
  680. UPLL_LOCK, UPLL_CON0, exynos3250_pll_rates),
  681. };
  682. static void __init exynos3_core_down_clock(void __iomem *reg_base)
  683. {
  684. unsigned int tmp;
  685. /*
  686. * Enable arm clock down (in idle) and set arm divider
  687. * ratios in WFI/WFE state.
  688. */
  689. tmp = (PWR_CTRL1_CORE2_DOWN_RATIO(7) | PWR_CTRL1_CORE1_DOWN_RATIO(7) |
  690. PWR_CTRL1_DIV2_DOWN_EN | PWR_CTRL1_DIV1_DOWN_EN |
  691. PWR_CTRL1_USE_CORE1_WFE | PWR_CTRL1_USE_CORE0_WFE |
  692. PWR_CTRL1_USE_CORE1_WFI | PWR_CTRL1_USE_CORE0_WFI);
  693. __raw_writel(tmp, reg_base + PWR_CTRL1);
  694. /*
  695. * Disable the clock up feature on Exynos4x12, in case it was
  696. * enabled by bootloader.
  697. */
  698. __raw_writel(0x0, reg_base + PWR_CTRL2);
  699. }
  700. static const struct samsung_cmu_info cmu_info __initconst = {
  701. .pll_clks = exynos3250_plls,
  702. .nr_pll_clks = ARRAY_SIZE(exynos3250_plls),
  703. .mux_clks = mux_clks,
  704. .nr_mux_clks = ARRAY_SIZE(mux_clks),
  705. .div_clks = div_clks,
  706. .nr_div_clks = ARRAY_SIZE(div_clks),
  707. .gate_clks = gate_clks,
  708. .nr_gate_clks = ARRAY_SIZE(gate_clks),
  709. .fixed_factor_clks = fixed_factor_clks,
  710. .nr_fixed_factor_clks = ARRAY_SIZE(fixed_factor_clks),
  711. .nr_clk_ids = CLK_NR_CLKS,
  712. .clk_regs = exynos3250_cmu_clk_regs,
  713. .nr_clk_regs = ARRAY_SIZE(exynos3250_cmu_clk_regs),
  714. };
  715. #define E3250_CPU_DIV0(apll, pclk_dbg, atb, corem) \
  716. (((apll) << 24) | ((pclk_dbg) << 20) | ((atb) << 16) | \
  717. ((corem) << 4))
  718. #define E3250_CPU_DIV1(hpm, copy) \
  719. (((hpm) << 4) | ((copy) << 0))
  720. static const struct exynos_cpuclk_cfg_data e3250_armclk_d[] __initconst = {
  721. { 1000000, E3250_CPU_DIV0(1, 7, 4, 1), E3250_CPU_DIV1(7, 7), },
  722. { 900000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), },
  723. { 800000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), },
  724. { 700000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), },
  725. { 600000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), },
  726. { 500000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), },
  727. { 400000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), },
  728. { 300000, E3250_CPU_DIV0(1, 5, 3, 1), E3250_CPU_DIV1(7, 7), },
  729. { 200000, E3250_CPU_DIV0(1, 3, 3, 1), E3250_CPU_DIV1(7, 7), },
  730. { 100000, E3250_CPU_DIV0(1, 1, 1, 1), E3250_CPU_DIV1(7, 7), },
  731. { 0 },
  732. };
  733. static void __init exynos3250_cmu_init(struct device_node *np)
  734. {
  735. struct samsung_clk_provider *ctx;
  736. ctx = samsung_cmu_register_one(np, &cmu_info);
  737. if (!ctx)
  738. return;
  739. exynos_register_cpu_clock(ctx, CLK_ARM_CLK, "armclk",
  740. mout_core_p[0], mout_core_p[1], 0x14200,
  741. e3250_armclk_d, ARRAY_SIZE(e3250_armclk_d),
  742. CLK_CPU_HAS_DIV1);
  743. exynos3_core_down_clock(ctx->reg_base);
  744. }
  745. CLK_OF_DECLARE(exynos3250_cmu, "samsung,exynos3250-cmu", exynos3250_cmu_init);
  746. /*
  747. * CMU DMC
  748. */
  749. #define BPLL_LOCK 0x0118
  750. #define BPLL_CON0 0x0218
  751. #define BPLL_CON1 0x021c
  752. #define BPLL_CON2 0x0220
  753. #define SRC_DMC 0x0300
  754. #define DIV_DMC1 0x0504
  755. #define GATE_BUS_DMC0 0x0700
  756. #define GATE_BUS_DMC1 0x0704
  757. #define GATE_BUS_DMC2 0x0708
  758. #define GATE_BUS_DMC3 0x070c
  759. #define GATE_SCLK_DMC 0x0800
  760. #define GATE_IP_DMC0 0x0900
  761. #define GATE_IP_DMC1 0x0904
  762. #define EPLL_LOCK 0x1110
  763. #define EPLL_CON0 0x1114
  764. #define EPLL_CON1 0x1118
  765. #define EPLL_CON2 0x111c
  766. #define SRC_EPLL 0x1120
  767. static const unsigned long exynos3250_cmu_dmc_clk_regs[] __initconst = {
  768. BPLL_LOCK,
  769. BPLL_CON0,
  770. BPLL_CON1,
  771. BPLL_CON2,
  772. SRC_DMC,
  773. DIV_DMC1,
  774. GATE_BUS_DMC0,
  775. GATE_BUS_DMC1,
  776. GATE_BUS_DMC2,
  777. GATE_BUS_DMC3,
  778. GATE_SCLK_DMC,
  779. GATE_IP_DMC0,
  780. GATE_IP_DMC1,
  781. EPLL_LOCK,
  782. EPLL_CON0,
  783. EPLL_CON1,
  784. EPLL_CON2,
  785. SRC_EPLL,
  786. };
  787. PNAME(mout_epll_p) = { "fin_pll", "fout_epll", };
  788. PNAME(mout_bpll_p) = { "fin_pll", "fout_bpll", };
  789. PNAME(mout_mpll_mif_p) = { "fin_pll", "sclk_mpll_mif", };
  790. PNAME(mout_dphy_p) = { "mout_mpll_mif", "mout_bpll", };
  791. static const struct samsung_mux_clock dmc_mux_clks[] __initconst = {
  792. /*
  793. * NOTE: Following table is sorted by register address in ascending
  794. * order and then bitfield shift in descending order, as it is done
  795. * in the User's Manual. When adding new entries, please make sure
  796. * that the order is preserved, to avoid merge conflicts and make
  797. * further work with defined data easier.
  798. */
  799. /* SRC_DMC */
  800. MUX(CLK_MOUT_MPLL_MIF, "mout_mpll_mif", mout_mpll_mif_p, SRC_DMC, 12, 1),
  801. MUX(CLK_MOUT_BPLL, "mout_bpll", mout_bpll_p, SRC_DMC, 10, 1),
  802. MUX(CLK_MOUT_DPHY, "mout_dphy", mout_dphy_p, SRC_DMC, 8, 1),
  803. MUX(CLK_MOUT_DMC_BUS, "mout_dmc_bus", mout_dphy_p, SRC_DMC, 4, 1),
  804. /* SRC_EPLL */
  805. MUX(CLK_MOUT_EPLL, "mout_epll", mout_epll_p, SRC_EPLL, 4, 1),
  806. };
  807. static const struct samsung_div_clock dmc_div_clks[] __initconst = {
  808. /*
  809. * NOTE: Following table is sorted by register address in ascending
  810. * order and then bitfield shift in descending order, as it is done
  811. * in the User's Manual. When adding new entries, please make sure
  812. * that the order is preserved, to avoid merge conflicts and make
  813. * further work with defined data easier.
  814. */
  815. /* DIV_DMC1 */
  816. DIV(CLK_DIV_DMC, "div_dmc", "div_dmc_pre", DIV_DMC1, 27, 3),
  817. DIV(CLK_DIV_DPHY, "div_dphy", "mout_dphy", DIV_DMC1, 23, 3),
  818. DIV(CLK_DIV_DMC_PRE, "div_dmc_pre", "mout_dmc_bus", DIV_DMC1, 19, 2),
  819. DIV(CLK_DIV_DMCP, "div_dmcp", "div_dmcd", DIV_DMC1, 15, 3),
  820. DIV(CLK_DIV_DMCD, "div_dmcd", "div_dmc", DIV_DMC1, 11, 3),
  821. };
  822. static const struct samsung_pll_clock exynos3250_dmc_plls[] __initconst = {
  823. PLL(pll_35xx, CLK_FOUT_BPLL, "fout_bpll", "fin_pll",
  824. BPLL_LOCK, BPLL_CON0, exynos3250_pll_rates),
  825. PLL(pll_36xx, CLK_FOUT_EPLL, "fout_epll", "fin_pll",
  826. EPLL_LOCK, EPLL_CON0, exynos3250_epll_rates),
  827. };
  828. static const struct samsung_cmu_info dmc_cmu_info __initconst = {
  829. .pll_clks = exynos3250_dmc_plls,
  830. .nr_pll_clks = ARRAY_SIZE(exynos3250_dmc_plls),
  831. .mux_clks = dmc_mux_clks,
  832. .nr_mux_clks = ARRAY_SIZE(dmc_mux_clks),
  833. .div_clks = dmc_div_clks,
  834. .nr_div_clks = ARRAY_SIZE(dmc_div_clks),
  835. .nr_clk_ids = NR_CLKS_DMC,
  836. .clk_regs = exynos3250_cmu_dmc_clk_regs,
  837. .nr_clk_regs = ARRAY_SIZE(exynos3250_cmu_dmc_clk_regs),
  838. };
  839. static void __init exynos3250_cmu_dmc_init(struct device_node *np)
  840. {
  841. samsung_cmu_register_one(np, &dmc_cmu_info);
  842. }
  843. CLK_OF_DECLARE(exynos3250_cmu_dmc, "samsung,exynos3250-cmu-dmc",
  844. exynos3250_cmu_dmc_init);
  845. /*
  846. * CMU ISP
  847. */
  848. #define DIV_ISP0 0x300
  849. #define DIV_ISP1 0x304
  850. #define GATE_IP_ISP0 0x800
  851. #define GATE_IP_ISP1 0x804
  852. #define GATE_SCLK_ISP 0x900
  853. static const struct samsung_div_clock isp_div_clks[] __initconst = {
  854. /*
  855. * NOTE: Following table is sorted by register address in ascending
  856. * order and then bitfield shift in descending order, as it is done
  857. * in the User's Manual. When adding new entries, please make sure
  858. * that the order is preserved, to avoid merge conflicts and make
  859. * further work with defined data easier.
  860. */
  861. /* DIV_ISP0 */
  862. DIV(CLK_DIV_ISP1, "div_isp1", "mout_aclk_266_sub", DIV_ISP0, 4, 3),
  863. DIV(CLK_DIV_ISP0, "div_isp0", "mout_aclk_266_sub", DIV_ISP0, 0, 3),
  864. /* DIV_ISP1 */
  865. DIV(CLK_DIV_MCUISP1, "div_mcuisp1", "mout_aclk_400_mcuisp_sub",
  866. DIV_ISP1, 8, 3),
  867. DIV(CLK_DIV_MCUISP0, "div_mcuisp0", "mout_aclk_400_mcuisp_sub",
  868. DIV_ISP1, 4, 3),
  869. DIV(CLK_DIV_MPWM, "div_mpwm", "div_isp1", DIV_ISP1, 0, 3),
  870. };
  871. static const struct samsung_gate_clock isp_gate_clks[] __initconst = {
  872. /*
  873. * NOTE: Following table is sorted by register address in ascending
  874. * order and then bitfield shift in descending order, as it is done
  875. * in the User's Manual. When adding new entries, please make sure
  876. * that the order is preserved, to avoid merge conflicts and make
  877. * further work with defined data easier.
  878. */
  879. /* GATE_IP_ISP0 */
  880. GATE(CLK_UART_ISP, "uart_isp", "uart_isp_top",
  881. GATE_IP_ISP0, 31, CLK_IGNORE_UNUSED, 0),
  882. GATE(CLK_WDT_ISP, "wdt_isp", "mout_aclk_266_sub",
  883. GATE_IP_ISP0, 30, CLK_IGNORE_UNUSED, 0),
  884. GATE(CLK_PWM_ISP, "pwm_isp", "mout_aclk_266_sub",
  885. GATE_IP_ISP0, 28, CLK_IGNORE_UNUSED, 0),
  886. GATE(CLK_I2C1_ISP, "i2c1_isp", "mout_aclk_266_sub",
  887. GATE_IP_ISP0, 26, CLK_IGNORE_UNUSED, 0),
  888. GATE(CLK_I2C0_ISP, "i2c0_isp", "mout_aclk_266_sub",
  889. GATE_IP_ISP0, 25, CLK_IGNORE_UNUSED, 0),
  890. GATE(CLK_MPWM_ISP, "mpwm_isp", "mout_aclk_266_sub",
  891. GATE_IP_ISP0, 24, CLK_IGNORE_UNUSED, 0),
  892. GATE(CLK_MCUCTL_ISP, "mcuctl_isp", "mout_aclk_266_sub",
  893. GATE_IP_ISP0, 23, CLK_IGNORE_UNUSED, 0),
  894. GATE(CLK_PPMUISPX, "ppmuispx", "mout_aclk_266_sub",
  895. GATE_IP_ISP0, 21, CLK_IGNORE_UNUSED, 0),
  896. GATE(CLK_PPMUISPMX, "ppmuispmx", "mout_aclk_266_sub",
  897. GATE_IP_ISP0, 20, CLK_IGNORE_UNUSED, 0),
  898. GATE(CLK_QE_LITE1, "qe_lite1", "mout_aclk_266_sub",
  899. GATE_IP_ISP0, 18, CLK_IGNORE_UNUSED, 0),
  900. GATE(CLK_QE_LITE0, "qe_lite0", "mout_aclk_266_sub",
  901. GATE_IP_ISP0, 17, CLK_IGNORE_UNUSED, 0),
  902. GATE(CLK_QE_FD, "qe_fd", "mout_aclk_266_sub",
  903. GATE_IP_ISP0, 16, CLK_IGNORE_UNUSED, 0),
  904. GATE(CLK_QE_DRC, "qe_drc", "mout_aclk_266_sub",
  905. GATE_IP_ISP0, 15, CLK_IGNORE_UNUSED, 0),
  906. GATE(CLK_QE_ISP, "qe_isp", "mout_aclk_266_sub",
  907. GATE_IP_ISP0, 14, CLK_IGNORE_UNUSED, 0),
  908. GATE(CLK_CSIS1, "csis1", "mout_aclk_266_sub",
  909. GATE_IP_ISP0, 13, CLK_IGNORE_UNUSED, 0),
  910. GATE(CLK_SMMU_LITE1, "smmu_lite1", "mout_aclk_266_sub",
  911. GATE_IP_ISP0, 12, CLK_IGNORE_UNUSED, 0),
  912. GATE(CLK_SMMU_LITE0, "smmu_lite0", "mout_aclk_266_sub",
  913. GATE_IP_ISP0, 11, CLK_IGNORE_UNUSED, 0),
  914. GATE(CLK_SMMU_FD, "smmu_fd", "mout_aclk_266_sub",
  915. GATE_IP_ISP0, 10, CLK_IGNORE_UNUSED, 0),
  916. GATE(CLK_SMMU_DRC, "smmu_drc", "mout_aclk_266_sub",
  917. GATE_IP_ISP0, 9, CLK_IGNORE_UNUSED, 0),
  918. GATE(CLK_SMMU_ISP, "smmu_isp", "mout_aclk_266_sub",
  919. GATE_IP_ISP0, 8, CLK_IGNORE_UNUSED, 0),
  920. GATE(CLK_GICISP, "gicisp", "mout_aclk_266_sub",
  921. GATE_IP_ISP0, 7, CLK_IGNORE_UNUSED, 0),
  922. GATE(CLK_CSIS0, "csis0", "mout_aclk_266_sub",
  923. GATE_IP_ISP0, 6, CLK_IGNORE_UNUSED, 0),
  924. GATE(CLK_MCUISP, "mcuisp", "mout_aclk_266_sub",
  925. GATE_IP_ISP0, 5, CLK_IGNORE_UNUSED, 0),
  926. GATE(CLK_LITE1, "lite1", "mout_aclk_266_sub",
  927. GATE_IP_ISP0, 4, CLK_IGNORE_UNUSED, 0),
  928. GATE(CLK_LITE0, "lite0", "mout_aclk_266_sub",
  929. GATE_IP_ISP0, 3, CLK_IGNORE_UNUSED, 0),
  930. GATE(CLK_FD, "fd", "mout_aclk_266_sub",
  931. GATE_IP_ISP0, 2, CLK_IGNORE_UNUSED, 0),
  932. GATE(CLK_DRC, "drc", "mout_aclk_266_sub",
  933. GATE_IP_ISP0, 1, CLK_IGNORE_UNUSED, 0),
  934. GATE(CLK_ISP, "isp", "mout_aclk_266_sub",
  935. GATE_IP_ISP0, 0, CLK_IGNORE_UNUSED, 0),
  936. /* GATE_IP_ISP1 */
  937. GATE(CLK_QE_ISPCX, "qe_ispcx", "uart_isp_top",
  938. GATE_IP_ISP0, 21, CLK_IGNORE_UNUSED, 0),
  939. GATE(CLK_QE_SCALERP, "qe_scalerp", "uart_isp_top",
  940. GATE_IP_ISP0, 20, CLK_IGNORE_UNUSED, 0),
  941. GATE(CLK_QE_SCALERC, "qe_scalerc", "uart_isp_top",
  942. GATE_IP_ISP0, 19, CLK_IGNORE_UNUSED, 0),
  943. GATE(CLK_SMMU_SCALERP, "smmu_scalerp", "uart_isp_top",
  944. GATE_IP_ISP0, 18, CLK_IGNORE_UNUSED, 0),
  945. GATE(CLK_SMMU_SCALERC, "smmu_scalerc", "uart_isp_top",
  946. GATE_IP_ISP0, 17, CLK_IGNORE_UNUSED, 0),
  947. GATE(CLK_SCALERP, "scalerp", "uart_isp_top",
  948. GATE_IP_ISP0, 16, CLK_IGNORE_UNUSED, 0),
  949. GATE(CLK_SCALERC, "scalerc", "uart_isp_top",
  950. GATE_IP_ISP0, 15, CLK_IGNORE_UNUSED, 0),
  951. GATE(CLK_SPI1_ISP, "spi1_isp", "uart_isp_top",
  952. GATE_IP_ISP0, 13, CLK_IGNORE_UNUSED, 0),
  953. GATE(CLK_SPI0_ISP, "spi0_isp", "uart_isp_top",
  954. GATE_IP_ISP0, 12, CLK_IGNORE_UNUSED, 0),
  955. GATE(CLK_SMMU_ISPCX, "smmu_ispcx", "uart_isp_top",
  956. GATE_IP_ISP0, 4, CLK_IGNORE_UNUSED, 0),
  957. GATE(CLK_ASYNCAXIM, "asyncaxim", "uart_isp_top",
  958. GATE_IP_ISP0, 0, CLK_IGNORE_UNUSED, 0),
  959. /* GATE_SCLK_ISP */
  960. GATE(CLK_SCLK_MPWM_ISP, "sclk_mpwm_isp", "div_mpwm",
  961. GATE_SCLK_ISP, 0, CLK_IGNORE_UNUSED, 0),
  962. };
  963. static const struct samsung_cmu_info isp_cmu_info __initconst = {
  964. .div_clks = isp_div_clks,
  965. .nr_div_clks = ARRAY_SIZE(isp_div_clks),
  966. .gate_clks = isp_gate_clks,
  967. .nr_gate_clks = ARRAY_SIZE(isp_gate_clks),
  968. .nr_clk_ids = NR_CLKS_ISP,
  969. };
  970. static int __init exynos3250_cmu_isp_probe(struct platform_device *pdev)
  971. {
  972. struct device_node *np = pdev->dev.of_node;
  973. samsung_cmu_register_one(np, &isp_cmu_info);
  974. return 0;
  975. }
  976. static const struct of_device_id exynos3250_cmu_isp_of_match[] __initconst = {
  977. { .compatible = "samsung,exynos3250-cmu-isp", },
  978. { /* sentinel */ }
  979. };
  980. static struct platform_driver exynos3250_cmu_isp_driver __initdata = {
  981. .driver = {
  982. .name = "exynos3250-cmu-isp",
  983. .suppress_bind_attrs = true,
  984. .of_match_table = exynos3250_cmu_isp_of_match,
  985. },
  986. };
  987. static int __init exynos3250_cmu_platform_init(void)
  988. {
  989. return platform_driver_probe(&exynos3250_cmu_isp_driver,
  990. exynos3250_cmu_isp_probe);
  991. }
  992. subsys_initcall(exynos3250_cmu_platform_init);