clk-mmp2.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. /*
  2. * mmp2 clock framework source file
  3. *
  4. * Copyright (C) 2012 Marvell
  5. * Chao Xie <xiechao.mail@gmail.com>
  6. *
  7. * This file is licensed under the terms of the GNU General Public
  8. * License version 2. This program is licensed "as is" without any
  9. * warranty of any kind, whether express or implied.
  10. */
  11. #include <linux/clk.h>
  12. #include <linux/module.h>
  13. #include <linux/kernel.h>
  14. #include <linux/spinlock.h>
  15. #include <linux/io.h>
  16. #include <linux/delay.h>
  17. #include <linux/err.h>
  18. #include <mach/addr-map.h>
  19. #include "clk.h"
  20. #define APBC_RTC 0x0
  21. #define APBC_TWSI0 0x4
  22. #define APBC_TWSI1 0x8
  23. #define APBC_TWSI2 0xc
  24. #define APBC_TWSI3 0x10
  25. #define APBC_TWSI4 0x7c
  26. #define APBC_TWSI5 0x80
  27. #define APBC_KPC 0x18
  28. #define APBC_UART0 0x2c
  29. #define APBC_UART1 0x30
  30. #define APBC_UART2 0x34
  31. #define APBC_UART3 0x88
  32. #define APBC_GPIO 0x38
  33. #define APBC_PWM0 0x3c
  34. #define APBC_PWM1 0x40
  35. #define APBC_PWM2 0x44
  36. #define APBC_PWM3 0x48
  37. #define APBC_SSP0 0x50
  38. #define APBC_SSP1 0x54
  39. #define APBC_SSP2 0x58
  40. #define APBC_SSP3 0x5c
  41. #define APMU_SDH0 0x54
  42. #define APMU_SDH1 0x58
  43. #define APMU_SDH2 0xe8
  44. #define APMU_SDH3 0xec
  45. #define APMU_USB 0x5c
  46. #define APMU_DISP0 0x4c
  47. #define APMU_DISP1 0x110
  48. #define APMU_CCIC0 0x50
  49. #define APMU_CCIC1 0xf4
  50. #define MPMU_UART_PLL 0x14
  51. static DEFINE_SPINLOCK(clk_lock);
  52. static struct mmp_clk_factor_masks uart_factor_masks = {
  53. .factor = 2,
  54. .num_mask = 0x1fff,
  55. .den_mask = 0x1fff,
  56. .num_shift = 16,
  57. .den_shift = 0,
  58. };
  59. static struct mmp_clk_factor_tbl uart_factor_tbl[] = {
  60. {.num = 8125, .den = 1536}, /*14.745MHZ */
  61. {.num = 3521, .den = 689}, /*19.23MHZ */
  62. };
  63. static const char *uart_parent[] = {"uart_pll", "vctcxo"};
  64. static const char *ssp_parent[] = {"vctcxo_4", "vctcxo_2", "vctcxo", "pll1_16"};
  65. static const char *sdh_parent[] = {"pll1_4", "pll2", "usb_pll", "pll1"};
  66. static const char *disp_parent[] = {"pll1", "pll1_16", "pll2", "vctcxo"};
  67. static const char *ccic_parent[] = {"pll1_2", "pll1_16", "vctcxo"};
  68. void __init mmp2_clk_init(void)
  69. {
  70. struct clk *clk;
  71. struct clk *vctcxo;
  72. void __iomem *mpmu_base;
  73. void __iomem *apmu_base;
  74. void __iomem *apbc_base;
  75. mpmu_base = ioremap(APB_PHYS_BASE + 0x50000, SZ_4K);
  76. if (mpmu_base == NULL) {
  77. pr_err("error to ioremap MPMU base\n");
  78. return;
  79. }
  80. apmu_base = ioremap(AXI_PHYS_BASE + 0x82800, SZ_4K);
  81. if (apmu_base == NULL) {
  82. pr_err("error to ioremap APMU base\n");
  83. return;
  84. }
  85. apbc_base = ioremap(APB_PHYS_BASE + 0x15000, SZ_4K);
  86. if (apbc_base == NULL) {
  87. pr_err("error to ioremap APBC base\n");
  88. return;
  89. }
  90. clk = clk_register_fixed_rate(NULL, "clk32", NULL, CLK_IS_ROOT, 3200);
  91. clk_register_clkdev(clk, "clk32", NULL);
  92. vctcxo = clk_register_fixed_rate(NULL, "vctcxo", NULL, CLK_IS_ROOT,
  93. 26000000);
  94. clk_register_clkdev(vctcxo, "vctcxo", NULL);
  95. clk = clk_register_fixed_rate(NULL, "pll1", NULL, CLK_IS_ROOT,
  96. 800000000);
  97. clk_register_clkdev(clk, "pll1", NULL);
  98. clk = clk_register_fixed_rate(NULL, "usb_pll", NULL, CLK_IS_ROOT,
  99. 480000000);
  100. clk_register_clkdev(clk, "usb_pll", NULL);
  101. clk = clk_register_fixed_rate(NULL, "pll2", NULL, CLK_IS_ROOT,
  102. 960000000);
  103. clk_register_clkdev(clk, "pll2", NULL);
  104. clk = clk_register_fixed_factor(NULL, "pll1_2", "pll1",
  105. CLK_SET_RATE_PARENT, 1, 2);
  106. clk_register_clkdev(clk, "pll1_2", NULL);
  107. clk = clk_register_fixed_factor(NULL, "pll1_4", "pll1_2",
  108. CLK_SET_RATE_PARENT, 1, 2);
  109. clk_register_clkdev(clk, "pll1_4", NULL);
  110. clk = clk_register_fixed_factor(NULL, "pll1_8", "pll1_4",
  111. CLK_SET_RATE_PARENT, 1, 2);
  112. clk_register_clkdev(clk, "pll1_8", NULL);
  113. clk = clk_register_fixed_factor(NULL, "pll1_16", "pll1_8",
  114. CLK_SET_RATE_PARENT, 1, 2);
  115. clk_register_clkdev(clk, "pll1_16", NULL);
  116. clk = clk_register_fixed_factor(NULL, "pll1_20", "pll1_4",
  117. CLK_SET_RATE_PARENT, 1, 5);
  118. clk_register_clkdev(clk, "pll1_20", NULL);
  119. clk = clk_register_fixed_factor(NULL, "pll1_3", "pll1",
  120. CLK_SET_RATE_PARENT, 1, 3);
  121. clk_register_clkdev(clk, "pll1_3", NULL);
  122. clk = clk_register_fixed_factor(NULL, "pll1_6", "pll1_3",
  123. CLK_SET_RATE_PARENT, 1, 2);
  124. clk_register_clkdev(clk, "pll1_6", NULL);
  125. clk = clk_register_fixed_factor(NULL, "pll1_12", "pll1_6",
  126. CLK_SET_RATE_PARENT, 1, 2);
  127. clk_register_clkdev(clk, "pll1_12", NULL);
  128. clk = clk_register_fixed_factor(NULL, "pll2_2", "pll2",
  129. CLK_SET_RATE_PARENT, 1, 2);
  130. clk_register_clkdev(clk, "pll2_2", NULL);
  131. clk = clk_register_fixed_factor(NULL, "pll2_4", "pll2_2",
  132. CLK_SET_RATE_PARENT, 1, 2);
  133. clk_register_clkdev(clk, "pll2_4", NULL);
  134. clk = clk_register_fixed_factor(NULL, "pll2_8", "pll2_4",
  135. CLK_SET_RATE_PARENT, 1, 2);
  136. clk_register_clkdev(clk, "pll2_8", NULL);
  137. clk = clk_register_fixed_factor(NULL, "pll2_16", "pll2_8",
  138. CLK_SET_RATE_PARENT, 1, 2);
  139. clk_register_clkdev(clk, "pll2_16", NULL);
  140. clk = clk_register_fixed_factor(NULL, "pll2_3", "pll2",
  141. CLK_SET_RATE_PARENT, 1, 3);
  142. clk_register_clkdev(clk, "pll2_3", NULL);
  143. clk = clk_register_fixed_factor(NULL, "pll2_6", "pll2_3",
  144. CLK_SET_RATE_PARENT, 1, 2);
  145. clk_register_clkdev(clk, "pll2_6", NULL);
  146. clk = clk_register_fixed_factor(NULL, "pll2_12", "pll2_6",
  147. CLK_SET_RATE_PARENT, 1, 2);
  148. clk_register_clkdev(clk, "pll2_12", NULL);
  149. clk = clk_register_fixed_factor(NULL, "vctcxo_2", "vctcxo",
  150. CLK_SET_RATE_PARENT, 1, 2);
  151. clk_register_clkdev(clk, "vctcxo_2", NULL);
  152. clk = clk_register_fixed_factor(NULL, "vctcxo_4", "vctcxo_2",
  153. CLK_SET_RATE_PARENT, 1, 2);
  154. clk_register_clkdev(clk, "vctcxo_4", NULL);
  155. clk = mmp_clk_register_factor("uart_pll", "pll1_4", 0,
  156. mpmu_base + MPMU_UART_PLL,
  157. &uart_factor_masks, uart_factor_tbl,
  158. ARRAY_SIZE(uart_factor_tbl), &clk_lock);
  159. clk_set_rate(clk, 14745600);
  160. clk_register_clkdev(clk, "uart_pll", NULL);
  161. clk = mmp_clk_register_apbc("twsi0", "vctcxo",
  162. apbc_base + APBC_TWSI0, 10, 0, &clk_lock);
  163. clk_register_clkdev(clk, NULL, "pxa2xx-i2c.0");
  164. clk = mmp_clk_register_apbc("twsi1", "vctcxo",
  165. apbc_base + APBC_TWSI1, 10, 0, &clk_lock);
  166. clk_register_clkdev(clk, NULL, "pxa2xx-i2c.1");
  167. clk = mmp_clk_register_apbc("twsi2", "vctcxo",
  168. apbc_base + APBC_TWSI2, 10, 0, &clk_lock);
  169. clk_register_clkdev(clk, NULL, "pxa2xx-i2c.2");
  170. clk = mmp_clk_register_apbc("twsi3", "vctcxo",
  171. apbc_base + APBC_TWSI3, 10, 0, &clk_lock);
  172. clk_register_clkdev(clk, NULL, "pxa2xx-i2c.3");
  173. clk = mmp_clk_register_apbc("twsi4", "vctcxo",
  174. apbc_base + APBC_TWSI4, 10, 0, &clk_lock);
  175. clk_register_clkdev(clk, NULL, "pxa2xx-i2c.4");
  176. clk = mmp_clk_register_apbc("twsi5", "vctcxo",
  177. apbc_base + APBC_TWSI5, 10, 0, &clk_lock);
  178. clk_register_clkdev(clk, NULL, "pxa2xx-i2c.5");
  179. clk = mmp_clk_register_apbc("gpio", "vctcxo",
  180. apbc_base + APBC_GPIO, 10, 0, &clk_lock);
  181. clk_register_clkdev(clk, NULL, "mmp2-gpio");
  182. clk = mmp_clk_register_apbc("kpc", "clk32",
  183. apbc_base + APBC_KPC, 10, 0, &clk_lock);
  184. clk_register_clkdev(clk, NULL, "pxa27x-keypad");
  185. clk = mmp_clk_register_apbc("rtc", "clk32",
  186. apbc_base + APBC_RTC, 10, 0, &clk_lock);
  187. clk_register_clkdev(clk, NULL, "mmp-rtc");
  188. clk = mmp_clk_register_apbc("pwm0", "vctcxo",
  189. apbc_base + APBC_PWM0, 10, 0, &clk_lock);
  190. clk_register_clkdev(clk, NULL, "mmp2-pwm.0");
  191. clk = mmp_clk_register_apbc("pwm1", "vctcxo",
  192. apbc_base + APBC_PWM1, 10, 0, &clk_lock);
  193. clk_register_clkdev(clk, NULL, "mmp2-pwm.1");
  194. clk = mmp_clk_register_apbc("pwm2", "vctcxo",
  195. apbc_base + APBC_PWM2, 10, 0, &clk_lock);
  196. clk_register_clkdev(clk, NULL, "mmp2-pwm.2");
  197. clk = mmp_clk_register_apbc("pwm3", "vctcxo",
  198. apbc_base + APBC_PWM3, 10, 0, &clk_lock);
  199. clk_register_clkdev(clk, NULL, "mmp2-pwm.3");
  200. clk = clk_register_mux(NULL, "uart0_mux", uart_parent,
  201. ARRAY_SIZE(uart_parent),
  202. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  203. apbc_base + APBC_UART0, 4, 3, 0, &clk_lock);
  204. clk_set_parent(clk, vctcxo);
  205. clk_register_clkdev(clk, "uart_mux.0", NULL);
  206. clk = mmp_clk_register_apbc("uart0", "uart0_mux",
  207. apbc_base + APBC_UART0, 10, 0, &clk_lock);
  208. clk_register_clkdev(clk, NULL, "pxa2xx-uart.0");
  209. clk = clk_register_mux(NULL, "uart1_mux", uart_parent,
  210. ARRAY_SIZE(uart_parent),
  211. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  212. apbc_base + APBC_UART1, 4, 3, 0, &clk_lock);
  213. clk_set_parent(clk, vctcxo);
  214. clk_register_clkdev(clk, "uart_mux.1", NULL);
  215. clk = mmp_clk_register_apbc("uart1", "uart1_mux",
  216. apbc_base + APBC_UART1, 10, 0, &clk_lock);
  217. clk_register_clkdev(clk, NULL, "pxa2xx-uart.1");
  218. clk = clk_register_mux(NULL, "uart2_mux", uart_parent,
  219. ARRAY_SIZE(uart_parent),
  220. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  221. apbc_base + APBC_UART2, 4, 3, 0, &clk_lock);
  222. clk_set_parent(clk, vctcxo);
  223. clk_register_clkdev(clk, "uart_mux.2", NULL);
  224. clk = mmp_clk_register_apbc("uart2", "uart2_mux",
  225. apbc_base + APBC_UART2, 10, 0, &clk_lock);
  226. clk_register_clkdev(clk, NULL, "pxa2xx-uart.2");
  227. clk = clk_register_mux(NULL, "uart3_mux", uart_parent,
  228. ARRAY_SIZE(uart_parent),
  229. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  230. apbc_base + APBC_UART3, 4, 3, 0, &clk_lock);
  231. clk_set_parent(clk, vctcxo);
  232. clk_register_clkdev(clk, "uart_mux.3", NULL);
  233. clk = mmp_clk_register_apbc("uart3", "uart3_mux",
  234. apbc_base + APBC_UART3, 10, 0, &clk_lock);
  235. clk_register_clkdev(clk, NULL, "pxa2xx-uart.3");
  236. clk = clk_register_mux(NULL, "ssp0_mux", ssp_parent,
  237. ARRAY_SIZE(ssp_parent),
  238. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  239. apbc_base + APBC_SSP0, 4, 3, 0, &clk_lock);
  240. clk_register_clkdev(clk, "uart_mux.0", NULL);
  241. clk = mmp_clk_register_apbc("ssp0", "ssp0_mux",
  242. apbc_base + APBC_SSP0, 10, 0, &clk_lock);
  243. clk_register_clkdev(clk, NULL, "mmp-ssp.0");
  244. clk = clk_register_mux(NULL, "ssp1_mux", ssp_parent,
  245. ARRAY_SIZE(ssp_parent),
  246. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  247. apbc_base + APBC_SSP1, 4, 3, 0, &clk_lock);
  248. clk_register_clkdev(clk, "ssp_mux.1", NULL);
  249. clk = mmp_clk_register_apbc("ssp1", "ssp1_mux",
  250. apbc_base + APBC_SSP1, 10, 0, &clk_lock);
  251. clk_register_clkdev(clk, NULL, "mmp-ssp.1");
  252. clk = clk_register_mux(NULL, "ssp2_mux", ssp_parent,
  253. ARRAY_SIZE(ssp_parent),
  254. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  255. apbc_base + APBC_SSP2, 4, 3, 0, &clk_lock);
  256. clk_register_clkdev(clk, "ssp_mux.2", NULL);
  257. clk = mmp_clk_register_apbc("ssp2", "ssp2_mux",
  258. apbc_base + APBC_SSP2, 10, 0, &clk_lock);
  259. clk_register_clkdev(clk, NULL, "mmp-ssp.2");
  260. clk = clk_register_mux(NULL, "ssp3_mux", ssp_parent,
  261. ARRAY_SIZE(ssp_parent),
  262. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  263. apbc_base + APBC_SSP3, 4, 3, 0, &clk_lock);
  264. clk_register_clkdev(clk, "ssp_mux.3", NULL);
  265. clk = mmp_clk_register_apbc("ssp3", "ssp3_mux",
  266. apbc_base + APBC_SSP3, 10, 0, &clk_lock);
  267. clk_register_clkdev(clk, NULL, "mmp-ssp.3");
  268. clk = clk_register_mux(NULL, "sdh_mux", sdh_parent,
  269. ARRAY_SIZE(sdh_parent),
  270. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  271. apmu_base + APMU_SDH0, 8, 2, 0, &clk_lock);
  272. clk_register_clkdev(clk, "sdh_mux", NULL);
  273. clk = clk_register_divider(NULL, "sdh_div", "sdh_mux",
  274. CLK_SET_RATE_PARENT, apmu_base + APMU_SDH0,
  275. 10, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
  276. clk_register_clkdev(clk, "sdh_div", NULL);
  277. clk = mmp_clk_register_apmu("sdh0", "sdh_div", apmu_base + APMU_SDH0,
  278. 0x1b, &clk_lock);
  279. clk_register_clkdev(clk, NULL, "sdhci-pxav3.0");
  280. clk = mmp_clk_register_apmu("sdh1", "sdh_div", apmu_base + APMU_SDH1,
  281. 0x1b, &clk_lock);
  282. clk_register_clkdev(clk, NULL, "sdhci-pxav3.1");
  283. clk = mmp_clk_register_apmu("sdh2", "sdh_div", apmu_base + APMU_SDH2,
  284. 0x1b, &clk_lock);
  285. clk_register_clkdev(clk, NULL, "sdhci-pxav3.2");
  286. clk = mmp_clk_register_apmu("sdh3", "sdh_div", apmu_base + APMU_SDH3,
  287. 0x1b, &clk_lock);
  288. clk_register_clkdev(clk, NULL, "sdhci-pxav3.3");
  289. clk = mmp_clk_register_apmu("usb", "usb_pll", apmu_base + APMU_USB,
  290. 0x9, &clk_lock);
  291. clk_register_clkdev(clk, "usb_clk", NULL);
  292. clk = clk_register_mux(NULL, "disp0_mux", disp_parent,
  293. ARRAY_SIZE(disp_parent),
  294. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  295. apmu_base + APMU_DISP0, 6, 2, 0, &clk_lock);
  296. clk_register_clkdev(clk, "disp_mux.0", NULL);
  297. clk = clk_register_divider(NULL, "disp0_div", "disp0_mux",
  298. CLK_SET_RATE_PARENT, apmu_base + APMU_DISP0,
  299. 8, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
  300. clk_register_clkdev(clk, "disp_div.0", NULL);
  301. clk = mmp_clk_register_apmu("disp0", "disp0_div",
  302. apmu_base + APMU_DISP0, 0x1b, &clk_lock);
  303. clk_register_clkdev(clk, NULL, "mmp-disp.0");
  304. clk = clk_register_divider(NULL, "disp0_sphy_div", "disp0_mux", 0,
  305. apmu_base + APMU_DISP0, 15, 5, 0, &clk_lock);
  306. clk_register_clkdev(clk, "disp_sphy_div.0", NULL);
  307. clk = mmp_clk_register_apmu("disp0_sphy", "disp0_sphy_div",
  308. apmu_base + APMU_DISP0, 0x1024, &clk_lock);
  309. clk_register_clkdev(clk, "disp_sphy.0", NULL);
  310. clk = clk_register_mux(NULL, "disp1_mux", disp_parent,
  311. ARRAY_SIZE(disp_parent),
  312. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  313. apmu_base + APMU_DISP1, 6, 2, 0, &clk_lock);
  314. clk_register_clkdev(clk, "disp_mux.1", NULL);
  315. clk = clk_register_divider(NULL, "disp1_div", "disp1_mux",
  316. CLK_SET_RATE_PARENT, apmu_base + APMU_DISP1,
  317. 8, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
  318. clk_register_clkdev(clk, "disp_div.1", NULL);
  319. clk = mmp_clk_register_apmu("disp1", "disp1_div",
  320. apmu_base + APMU_DISP1, 0x1b, &clk_lock);
  321. clk_register_clkdev(clk, NULL, "mmp-disp.1");
  322. clk = mmp_clk_register_apmu("ccic_arbiter", "vctcxo",
  323. apmu_base + APMU_CCIC0, 0x1800, &clk_lock);
  324. clk_register_clkdev(clk, "ccic_arbiter", NULL);
  325. clk = clk_register_mux(NULL, "ccic0_mux", ccic_parent,
  326. ARRAY_SIZE(ccic_parent),
  327. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  328. apmu_base + APMU_CCIC0, 6, 2, 0, &clk_lock);
  329. clk_register_clkdev(clk, "ccic_mux.0", NULL);
  330. clk = clk_register_divider(NULL, "ccic0_div", "ccic0_mux",
  331. CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC0,
  332. 17, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
  333. clk_register_clkdev(clk, "ccic_div.0", NULL);
  334. clk = mmp_clk_register_apmu("ccic0", "ccic0_div",
  335. apmu_base + APMU_CCIC0, 0x1b, &clk_lock);
  336. clk_register_clkdev(clk, "fnclk", "mmp-ccic.0");
  337. clk = mmp_clk_register_apmu("ccic0_phy", "ccic0_div",
  338. apmu_base + APMU_CCIC0, 0x24, &clk_lock);
  339. clk_register_clkdev(clk, "phyclk", "mmp-ccic.0");
  340. clk = clk_register_divider(NULL, "ccic0_sphy_div", "ccic0_div",
  341. CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC0,
  342. 10, 5, 0, &clk_lock);
  343. clk_register_clkdev(clk, "sphyclk_div", "mmp-ccic.0");
  344. clk = mmp_clk_register_apmu("ccic0_sphy", "ccic0_sphy_div",
  345. apmu_base + APMU_CCIC0, 0x300, &clk_lock);
  346. clk_register_clkdev(clk, "sphyclk", "mmp-ccic.0");
  347. clk = clk_register_mux(NULL, "ccic1_mux", ccic_parent,
  348. ARRAY_SIZE(ccic_parent),
  349. CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
  350. apmu_base + APMU_CCIC1, 6, 2, 0, &clk_lock);
  351. clk_register_clkdev(clk, "ccic_mux.1", NULL);
  352. clk = clk_register_divider(NULL, "ccic1_div", "ccic1_mux",
  353. CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC1,
  354. 16, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
  355. clk_register_clkdev(clk, "ccic_div.1", NULL);
  356. clk = mmp_clk_register_apmu("ccic1", "ccic1_div",
  357. apmu_base + APMU_CCIC1, 0x1b, &clk_lock);
  358. clk_register_clkdev(clk, "fnclk", "mmp-ccic.1");
  359. clk = mmp_clk_register_apmu("ccic1_phy", "ccic1_div",
  360. apmu_base + APMU_CCIC1, 0x24, &clk_lock);
  361. clk_register_clkdev(clk, "phyclk", "mmp-ccic.1");
  362. clk = clk_register_divider(NULL, "ccic1_sphy_div", "ccic1_div",
  363. CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC1,
  364. 10, 5, 0, &clk_lock);
  365. clk_register_clkdev(clk, "sphyclk_div", "mmp-ccic.1");
  366. clk = mmp_clk_register_apmu("ccic1_sphy", "ccic1_sphy_div",
  367. apmu_base + APMU_CCIC1, 0x300, &clk_lock);
  368. clk_register_clkdev(clk, "sphyclk", "mmp-ccic.1");
  369. }