u8540_clk.c 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. /*
  2. * Clock definitions for u8540 platform.
  3. *
  4. * Copyright (C) 2012 ST-Ericsson SA
  5. * Author: Ulf Hansson <ulf.hansson@linaro.org>
  6. *
  7. * License terms: GNU General Public License (GPL) version 2
  8. */
  9. #include <linux/of.h>
  10. #include <linux/of_address.h>
  11. #include <linux/clkdev.h>
  12. #include <linux/clk-provider.h>
  13. #include <linux/mfd/dbx500-prcmu.h>
  14. #include <linux/platform_data/clk-ux500.h>
  15. #include "clk.h"
  16. static const struct of_device_id u8540_clk_of_match[] = {
  17. { .compatible = "stericsson,u8540-clks", },
  18. { }
  19. };
  20. /* CLKRST4 is missing making it hard to index things */
  21. enum clkrst_index {
  22. CLKRST1_INDEX = 0,
  23. CLKRST2_INDEX,
  24. CLKRST3_INDEX,
  25. CLKRST5_INDEX,
  26. CLKRST6_INDEX,
  27. CLKRST_MAX,
  28. };
  29. void u8540_clk_init(void)
  30. {
  31. struct clk *clk;
  32. struct device_node *np = NULL;
  33. u32 bases[CLKRST_MAX];
  34. int i;
  35. if (of_have_populated_dt())
  36. np = of_find_matching_node(NULL, u8540_clk_of_match);
  37. if (!np) {
  38. pr_err("Either DT or U8540 Clock node not found\n");
  39. return;
  40. }
  41. for (i = 0; i < ARRAY_SIZE(bases); i++) {
  42. struct resource r;
  43. if (of_address_to_resource(np, i, &r))
  44. /* Not much choice but to continue */
  45. pr_err("failed to get CLKRST %d base address\n",
  46. i + 1);
  47. bases[i] = r.start;
  48. }
  49. /* Clock sources. */
  50. /* Fixed ClockGen */
  51. clk = clk_reg_prcmu_gate("soc0_pll", NULL, PRCMU_PLLSOC0,
  52. CLK_IS_ROOT|CLK_IGNORE_UNUSED);
  53. clk_register_clkdev(clk, "soc0_pll", NULL);
  54. clk = clk_reg_prcmu_gate("soc1_pll", NULL, PRCMU_PLLSOC1,
  55. CLK_IS_ROOT|CLK_IGNORE_UNUSED);
  56. clk_register_clkdev(clk, "soc1_pll", NULL);
  57. clk = clk_reg_prcmu_gate("ddr_pll", NULL, PRCMU_PLLDDR,
  58. CLK_IS_ROOT|CLK_IGNORE_UNUSED);
  59. clk_register_clkdev(clk, "ddr_pll", NULL);
  60. clk = clk_register_fixed_rate(NULL, "rtc32k", NULL,
  61. CLK_IS_ROOT|CLK_IGNORE_UNUSED,
  62. 32768);
  63. clk_register_clkdev(clk, "clk32k", NULL);
  64. clk_register_clkdev(clk, "apb_pclk", "rtc-pl031");
  65. clk = clk_register_fixed_rate(NULL, "ulp38m4", NULL,
  66. CLK_IS_ROOT|CLK_IGNORE_UNUSED,
  67. 38400000);
  68. clk = clk_reg_prcmu_gate("uartclk", NULL, PRCMU_UARTCLK, CLK_IS_ROOT);
  69. clk_register_clkdev(clk, NULL, "UART");
  70. /* msp02clk needs a abx500 clk as parent. Handle by abx500 clk driver */
  71. clk = clk_reg_prcmu_gate("msp02clk", "ab9540_sysclk12_b1",
  72. PRCMU_MSP02CLK, 0);
  73. clk_register_clkdev(clk, NULL, "MSP02");
  74. clk = clk_reg_prcmu_gate("msp1clk", NULL, PRCMU_MSP1CLK, CLK_IS_ROOT);
  75. clk_register_clkdev(clk, NULL, "MSP1");
  76. clk = clk_reg_prcmu_gate("i2cclk", NULL, PRCMU_I2CCLK, CLK_IS_ROOT);
  77. clk_register_clkdev(clk, NULL, "I2C");
  78. clk = clk_reg_prcmu_gate("slimclk", NULL, PRCMU_SLIMCLK, CLK_IS_ROOT);
  79. clk_register_clkdev(clk, NULL, "slim");
  80. clk = clk_reg_prcmu_gate("per1clk", NULL, PRCMU_PER1CLK, CLK_IS_ROOT);
  81. clk_register_clkdev(clk, NULL, "PERIPH1");
  82. clk = clk_reg_prcmu_gate("per2clk", NULL, PRCMU_PER2CLK, CLK_IS_ROOT);
  83. clk_register_clkdev(clk, NULL, "PERIPH2");
  84. clk = clk_reg_prcmu_gate("per3clk", NULL, PRCMU_PER3CLK, CLK_IS_ROOT);
  85. clk_register_clkdev(clk, NULL, "PERIPH3");
  86. clk = clk_reg_prcmu_gate("per5clk", NULL, PRCMU_PER5CLK, CLK_IS_ROOT);
  87. clk_register_clkdev(clk, NULL, "PERIPH5");
  88. clk = clk_reg_prcmu_gate("per6clk", NULL, PRCMU_PER6CLK, CLK_IS_ROOT);
  89. clk_register_clkdev(clk, NULL, "PERIPH6");
  90. clk = clk_reg_prcmu_gate("per7clk", NULL, PRCMU_PER7CLK, CLK_IS_ROOT);
  91. clk_register_clkdev(clk, NULL, "PERIPH7");
  92. clk = clk_reg_prcmu_scalable("lcdclk", NULL, PRCMU_LCDCLK, 0,
  93. CLK_IS_ROOT|CLK_SET_RATE_GATE);
  94. clk_register_clkdev(clk, NULL, "lcd");
  95. clk_register_clkdev(clk, "lcd", "mcde");
  96. clk = clk_reg_prcmu_opp_gate("bmlclk", NULL, PRCMU_BMLCLK,
  97. CLK_IS_ROOT);
  98. clk_register_clkdev(clk, NULL, "bml");
  99. clk = clk_reg_prcmu_scalable("hsitxclk", NULL, PRCMU_HSITXCLK, 0,
  100. CLK_IS_ROOT|CLK_SET_RATE_GATE);
  101. clk = clk_reg_prcmu_scalable("hsirxclk", NULL, PRCMU_HSIRXCLK, 0,
  102. CLK_IS_ROOT|CLK_SET_RATE_GATE);
  103. clk = clk_reg_prcmu_scalable("hdmiclk", NULL, PRCMU_HDMICLK, 0,
  104. CLK_IS_ROOT|CLK_SET_RATE_GATE);
  105. clk_register_clkdev(clk, NULL, "hdmi");
  106. clk_register_clkdev(clk, "hdmi", "mcde");
  107. clk = clk_reg_prcmu_gate("apeatclk", NULL, PRCMU_APEATCLK, CLK_IS_ROOT);
  108. clk_register_clkdev(clk, NULL, "apeat");
  109. clk = clk_reg_prcmu_gate("apetraceclk", NULL, PRCMU_APETRACECLK,
  110. CLK_IS_ROOT);
  111. clk_register_clkdev(clk, NULL, "apetrace");
  112. clk = clk_reg_prcmu_gate("mcdeclk", NULL, PRCMU_MCDECLK, CLK_IS_ROOT);
  113. clk_register_clkdev(clk, NULL, "mcde");
  114. clk_register_clkdev(clk, "mcde", "mcde");
  115. clk_register_clkdev(clk, NULL, "dsilink.0");
  116. clk_register_clkdev(clk, NULL, "dsilink.1");
  117. clk_register_clkdev(clk, NULL, "dsilink.2");
  118. clk = clk_reg_prcmu_opp_gate("ipi2cclk", NULL, PRCMU_IPI2CCLK,
  119. CLK_IS_ROOT);
  120. clk_register_clkdev(clk, NULL, "ipi2");
  121. clk = clk_reg_prcmu_gate("dsialtclk", NULL, PRCMU_DSIALTCLK,
  122. CLK_IS_ROOT);
  123. clk_register_clkdev(clk, NULL, "dsialt");
  124. clk = clk_reg_prcmu_gate("dmaclk", NULL, PRCMU_DMACLK, CLK_IS_ROOT);
  125. clk_register_clkdev(clk, NULL, "dma40.0");
  126. clk = clk_reg_prcmu_gate("b2r2clk", NULL, PRCMU_B2R2CLK, CLK_IS_ROOT);
  127. clk_register_clkdev(clk, NULL, "b2r2");
  128. clk_register_clkdev(clk, NULL, "b2r2_core");
  129. clk_register_clkdev(clk, NULL, "U8500-B2R2.0");
  130. clk_register_clkdev(clk, NULL, "b2r2_1_core");
  131. clk = clk_reg_prcmu_scalable("tvclk", NULL, PRCMU_TVCLK, 0,
  132. CLK_IS_ROOT|CLK_SET_RATE_GATE);
  133. clk_register_clkdev(clk, NULL, "tv");
  134. clk_register_clkdev(clk, "tv", "mcde");
  135. clk = clk_reg_prcmu_gate("sspclk", NULL, PRCMU_SSPCLK, CLK_IS_ROOT);
  136. clk_register_clkdev(clk, NULL, "SSP");
  137. clk = clk_reg_prcmu_gate("rngclk", NULL, PRCMU_RNGCLK, CLK_IS_ROOT);
  138. clk_register_clkdev(clk, NULL, "rngclk");
  139. clk = clk_reg_prcmu_gate("uiccclk", NULL, PRCMU_UICCCLK, CLK_IS_ROOT);
  140. clk_register_clkdev(clk, NULL, "uicc");
  141. clk = clk_reg_prcmu_gate("timclk", NULL, PRCMU_TIMCLK, CLK_IS_ROOT);
  142. clk_register_clkdev(clk, NULL, "mtu0");
  143. clk_register_clkdev(clk, NULL, "mtu1");
  144. clk = clk_reg_prcmu_opp_volt_scalable("sdmmcclk", NULL,
  145. PRCMU_SDMMCCLK, 100000000,
  146. CLK_IS_ROOT|CLK_SET_RATE_GATE);
  147. clk_register_clkdev(clk, NULL, "sdmmc");
  148. clk = clk_reg_prcmu_opp_volt_scalable("sdmmchclk", NULL,
  149. PRCMU_SDMMCHCLK, 400000000,
  150. CLK_IS_ROOT|CLK_SET_RATE_GATE);
  151. clk_register_clkdev(clk, NULL, "sdmmchclk");
  152. clk = clk_reg_prcmu_gate("hvaclk", NULL, PRCMU_HVACLK, CLK_IS_ROOT);
  153. clk_register_clkdev(clk, NULL, "hva");
  154. clk = clk_reg_prcmu_gate("g1clk", NULL, PRCMU_G1CLK, CLK_IS_ROOT);
  155. clk_register_clkdev(clk, NULL, "g1");
  156. clk = clk_reg_prcmu_scalable("spare1clk", NULL, PRCMU_SPARE1CLK, 0,
  157. CLK_IS_ROOT|CLK_SET_RATE_GATE);
  158. clk_register_clkdev(clk, "dsilcd", "mcde");
  159. clk = clk_reg_prcmu_scalable("dsi_pll", "hdmiclk",
  160. PRCMU_PLLDSI, 0, CLK_SET_RATE_GATE);
  161. clk_register_clkdev(clk, "dsihs2", "mcde");
  162. clk_register_clkdev(clk, "hs_clk", "dsilink.2");
  163. clk = clk_reg_prcmu_scalable("dsilcd_pll", "spare1clk",
  164. PRCMU_PLLDSI_LCD, 0, CLK_SET_RATE_GATE);
  165. clk_register_clkdev(clk, "dsilcd_pll", "mcde");
  166. clk = clk_reg_prcmu_scalable("dsi0clk", "dsi_pll",
  167. PRCMU_DSI0CLK, 0, CLK_SET_RATE_GATE);
  168. clk_register_clkdev(clk, "dsihs0", "mcde");
  169. clk = clk_reg_prcmu_scalable("dsi0lcdclk", "dsilcd_pll",
  170. PRCMU_DSI0CLK_LCD, 0, CLK_SET_RATE_GATE);
  171. clk_register_clkdev(clk, "dsihs0", "mcde");
  172. clk_register_clkdev(clk, "hs_clk", "dsilink.0");
  173. clk = clk_reg_prcmu_scalable("dsi1clk", "dsi_pll",
  174. PRCMU_DSI1CLK, 0, CLK_SET_RATE_GATE);
  175. clk_register_clkdev(clk, "dsihs1", "mcde");
  176. clk = clk_reg_prcmu_scalable("dsi1lcdclk", "dsilcd_pll",
  177. PRCMU_DSI1CLK_LCD, 0, CLK_SET_RATE_GATE);
  178. clk_register_clkdev(clk, "dsihs1", "mcde");
  179. clk_register_clkdev(clk, "hs_clk", "dsilink.1");
  180. clk = clk_reg_prcmu_scalable("dsi0escclk", "tvclk",
  181. PRCMU_DSI0ESCCLK, 0, CLK_SET_RATE_GATE);
  182. clk_register_clkdev(clk, "lp_clk", "dsilink.0");
  183. clk_register_clkdev(clk, "dsilp0", "mcde");
  184. clk = clk_reg_prcmu_scalable("dsi1escclk", "tvclk",
  185. PRCMU_DSI1ESCCLK, 0, CLK_SET_RATE_GATE);
  186. clk_register_clkdev(clk, "lp_clk", "dsilink.1");
  187. clk_register_clkdev(clk, "dsilp1", "mcde");
  188. clk = clk_reg_prcmu_scalable("dsi2escclk", "tvclk",
  189. PRCMU_DSI2ESCCLK, 0, CLK_SET_RATE_GATE);
  190. clk_register_clkdev(clk, "lp_clk", "dsilink.2");
  191. clk_register_clkdev(clk, "dsilp2", "mcde");
  192. clk = clk_reg_prcmu_scalable_rate("armss", NULL,
  193. PRCMU_ARMSS, 0, CLK_IS_ROOT|CLK_IGNORE_UNUSED);
  194. clk_register_clkdev(clk, "armss", NULL);
  195. clk = clk_register_fixed_factor(NULL, "smp_twd", "armss",
  196. CLK_IGNORE_UNUSED, 1, 2);
  197. clk_register_clkdev(clk, NULL, "smp_twd");
  198. /* PRCC P-clocks */
  199. /* Peripheral 1 : PRCC P-clocks */
  200. clk = clk_reg_prcc_pclk("p1_pclk0", "per1clk", bases[CLKRST1_INDEX],
  201. BIT(0), 0);
  202. clk_register_clkdev(clk, "apb_pclk", "uart0");
  203. clk = clk_reg_prcc_pclk("p1_pclk1", "per1clk", bases[CLKRST1_INDEX],
  204. BIT(1), 0);
  205. clk_register_clkdev(clk, "apb_pclk", "uart1");
  206. clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", bases[CLKRST1_INDEX],
  207. BIT(2), 0);
  208. clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.1");
  209. clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", bases[CLKRST1_INDEX],
  210. BIT(3), 0);
  211. clk_register_clkdev(clk, "apb_pclk", "msp0");
  212. clk_register_clkdev(clk, "apb_pclk", "dbx5x0-msp-i2s.0");
  213. clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", bases[CLKRST1_INDEX],
  214. BIT(4), 0);
  215. clk_register_clkdev(clk, "apb_pclk", "msp1");
  216. clk_register_clkdev(clk, "apb_pclk", "dbx5x0-msp-i2s.1");
  217. clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", bases[CLKRST1_INDEX],
  218. BIT(5), 0);
  219. clk_register_clkdev(clk, "apb_pclk", "sdi0");
  220. clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", bases[CLKRST1_INDEX],
  221. BIT(6), 0);
  222. clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.2");
  223. clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", bases[CLKRST1_INDEX],
  224. BIT(7), 0);
  225. clk_register_clkdev(clk, NULL, "spi3");
  226. clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", bases[CLKRST1_INDEX],
  227. BIT(8), 0);
  228. clk_register_clkdev(clk, "apb_pclk", "slimbus0");
  229. clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", bases[CLKRST1_INDEX],
  230. BIT(9), 0);
  231. clk_register_clkdev(clk, NULL, "gpio.0");
  232. clk_register_clkdev(clk, NULL, "gpio.1");
  233. clk_register_clkdev(clk, NULL, "gpioblock0");
  234. clk_register_clkdev(clk, "apb_pclk", "ab85xx-codec.0");
  235. clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", bases[CLKRST1_INDEX],
  236. BIT(10), 0);
  237. clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.4");
  238. clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", bases[CLKRST1_INDEX],
  239. BIT(11), 0);
  240. clk_register_clkdev(clk, "apb_pclk", "msp3");
  241. clk_register_clkdev(clk, "apb_pclk", "dbx5x0-msp-i2s.3");
  242. /* Peripheral 2 : PRCC P-clocks */
  243. clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", bases[CLKRST2_INDEX],
  244. BIT(0), 0);
  245. clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.3");
  246. clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", bases[CLKRST2_INDEX],
  247. BIT(1), 0);
  248. clk_register_clkdev(clk, NULL, "spi2");
  249. clk = clk_reg_prcc_pclk("p2_pclk2", "per2clk", bases[CLKRST2_INDEX],
  250. BIT(2), 0);
  251. clk_register_clkdev(clk, NULL, "spi1");
  252. clk = clk_reg_prcc_pclk("p2_pclk3", "per2clk", bases[CLKRST2_INDEX],
  253. BIT(3), 0);
  254. clk_register_clkdev(clk, NULL, "pwl");
  255. clk = clk_reg_prcc_pclk("p2_pclk4", "per2clk", bases[CLKRST2_INDEX],
  256. BIT(4), 0);
  257. clk_register_clkdev(clk, "apb_pclk", "sdi4");
  258. clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", bases[CLKRST2_INDEX],
  259. BIT(5), 0);
  260. clk_register_clkdev(clk, "apb_pclk", "msp2");
  261. clk_register_clkdev(clk, "apb_pclk", "dbx5x0-msp-i2s.2");
  262. clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", bases[CLKRST2_INDEX],
  263. BIT(6), 0);
  264. clk_register_clkdev(clk, "apb_pclk", "sdi1");
  265. clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", bases[CLKRST2_INDEX],
  266. BIT(7), 0);
  267. clk_register_clkdev(clk, "apb_pclk", "sdi3");
  268. clk = clk_reg_prcc_pclk("p2_pclk8", "per2clk", bases[CLKRST2_INDEX],
  269. BIT(8), 0);
  270. clk_register_clkdev(clk, NULL, "spi0");
  271. clk = clk_reg_prcc_pclk("p2_pclk9", "per2clk", bases[CLKRST2_INDEX],
  272. BIT(9), 0);
  273. clk_register_clkdev(clk, "hsir_hclk", "ste_hsi.0");
  274. clk = clk_reg_prcc_pclk("p2_pclk10", "per2clk", bases[CLKRST2_INDEX],
  275. BIT(10), 0);
  276. clk_register_clkdev(clk, "hsit_hclk", "ste_hsi.0");
  277. clk = clk_reg_prcc_pclk("p2_pclk11", "per2clk", bases[CLKRST2_INDEX],
  278. BIT(11), 0);
  279. clk_register_clkdev(clk, NULL, "gpio.6");
  280. clk_register_clkdev(clk, NULL, "gpio.7");
  281. clk_register_clkdev(clk, NULL, "gpioblock1");
  282. clk = clk_reg_prcc_pclk("p2_pclk12", "per2clk", bases[CLKRST2_INDEX],
  283. BIT(12), 0);
  284. clk_register_clkdev(clk, "msp4-pclk", "ab85xx-codec.0");
  285. /* Peripheral 3 : PRCC P-clocks */
  286. clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", bases[CLKRST3_INDEX],
  287. BIT(0), 0);
  288. clk_register_clkdev(clk, NULL, "fsmc");
  289. clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", bases[CLKRST3_INDEX],
  290. BIT(1), 0);
  291. clk_register_clkdev(clk, "apb_pclk", "ssp0");
  292. clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", bases[CLKRST3_INDEX],
  293. BIT(2), 0);
  294. clk_register_clkdev(clk, "apb_pclk", "ssp1");
  295. clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", bases[CLKRST3_INDEX],
  296. BIT(3), 0);
  297. clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.0");
  298. clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", bases[CLKRST3_INDEX],
  299. BIT(4), 0);
  300. clk_register_clkdev(clk, "apb_pclk", "sdi2");
  301. clk = clk_reg_prcc_pclk("p3_pclk5", "per3clk", bases[CLKRST3_INDEX],
  302. BIT(5), 0);
  303. clk_register_clkdev(clk, "apb_pclk", "ske");
  304. clk_register_clkdev(clk, "apb_pclk", "nmk-ske-keypad");
  305. clk = clk_reg_prcc_pclk("p3_pclk6", "per3clk", bases[CLKRST3_INDEX],
  306. BIT(6), 0);
  307. clk_register_clkdev(clk, "apb_pclk", "uart2");
  308. clk = clk_reg_prcc_pclk("p3_pclk7", "per3clk", bases[CLKRST3_INDEX],
  309. BIT(7), 0);
  310. clk_register_clkdev(clk, "apb_pclk", "sdi5");
  311. clk = clk_reg_prcc_pclk("p3_pclk8", "per3clk", bases[CLKRST3_INDEX],
  312. BIT(8), 0);
  313. clk_register_clkdev(clk, NULL, "gpio.2");
  314. clk_register_clkdev(clk, NULL, "gpio.3");
  315. clk_register_clkdev(clk, NULL, "gpio.4");
  316. clk_register_clkdev(clk, NULL, "gpio.5");
  317. clk_register_clkdev(clk, NULL, "gpioblock2");
  318. clk = clk_reg_prcc_pclk("p3_pclk9", "per3clk", bases[CLKRST3_INDEX],
  319. BIT(9), 0);
  320. clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.5");
  321. clk = clk_reg_prcc_pclk("p3_pclk10", "per3clk", bases[CLKRST3_INDEX],
  322. BIT(10), 0);
  323. clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.6");
  324. clk = clk_reg_prcc_pclk("p3_pclk11", "per3clk", bases[CLKRST3_INDEX],
  325. BIT(11), 0);
  326. clk_register_clkdev(clk, "apb_pclk", "uart3");
  327. clk = clk_reg_prcc_pclk("p3_pclk12", "per3clk", bases[CLKRST3_INDEX],
  328. BIT(12), 0);
  329. clk_register_clkdev(clk, "apb_pclk", "uart4");
  330. /* Peripheral 5 : PRCC P-clocks */
  331. clk = clk_reg_prcc_pclk("p5_pclk0", "per5clk", bases[CLKRST5_INDEX],
  332. BIT(0), 0);
  333. clk_register_clkdev(clk, "usb", "musb-ux500.0");
  334. clk_register_clkdev(clk, "usbclk", "ab-iddet.0");
  335. clk = clk_reg_prcc_pclk("p5_pclk1", "per5clk", bases[CLKRST5_INDEX],
  336. BIT(1), 0);
  337. clk_register_clkdev(clk, NULL, "gpio.8");
  338. clk_register_clkdev(clk, NULL, "gpioblock3");
  339. /* Peripheral 6 : PRCC P-clocks */
  340. clk = clk_reg_prcc_pclk("p6_pclk0", "per6clk", bases[CLKRST6_INDEX],
  341. BIT(0), 0);
  342. clk_register_clkdev(clk, "apb_pclk", "rng");
  343. clk = clk_reg_prcc_pclk("p6_pclk1", "per6clk", bases[CLKRST6_INDEX],
  344. BIT(1), 0);
  345. clk_register_clkdev(clk, NULL, "cryp0");
  346. clk_register_clkdev(clk, NULL, "cryp1");
  347. clk = clk_reg_prcc_pclk("p6_pclk2", "per6clk", bases[CLKRST6_INDEX],
  348. BIT(2), 0);
  349. clk_register_clkdev(clk, NULL, "hash0");
  350. clk = clk_reg_prcc_pclk("p6_pclk3", "per6clk", bases[CLKRST6_INDEX],
  351. BIT(3), 0);
  352. clk_register_clkdev(clk, NULL, "pka");
  353. clk = clk_reg_prcc_pclk("p6_pclk4", "per6clk", bases[CLKRST6_INDEX],
  354. BIT(4), 0);
  355. clk_register_clkdev(clk, NULL, "db8540-hash1");
  356. clk = clk_reg_prcc_pclk("p6_pclk5", "per6clk", bases[CLKRST6_INDEX],
  357. BIT(5), 0);
  358. clk_register_clkdev(clk, NULL, "cfgreg");
  359. clk = clk_reg_prcc_pclk("p6_pclk6", "per6clk", bases[CLKRST6_INDEX],
  360. BIT(6), 0);
  361. clk_register_clkdev(clk, "apb_pclk", "mtu0");
  362. clk = clk_reg_prcc_pclk("p6_pclk7", "per6clk", bases[CLKRST6_INDEX],
  363. BIT(7), 0);
  364. clk_register_clkdev(clk, "apb_pclk", "mtu1");
  365. /*
  366. * PRCC K-clocks ==> see table PRCC_PCKEN/PRCC_KCKEN
  367. * This differs from the internal implementation:
  368. * We don't use the PERPIH[n| clock as parent, since those _should_
  369. * only be used as parents for the P-clocks.
  370. * TODO: "parentjoin" with corresponding P-clocks for all K-clocks.
  371. */
  372. /* Peripheral 1 : PRCC K-clocks */
  373. clk = clk_reg_prcc_kclk("p1_uart0_kclk", "uartclk",
  374. bases[CLKRST1_INDEX], BIT(0), CLK_SET_RATE_GATE);
  375. clk_register_clkdev(clk, NULL, "uart0");
  376. clk = clk_reg_prcc_kclk("p1_uart1_kclk", "uartclk",
  377. bases[CLKRST1_INDEX], BIT(1), CLK_SET_RATE_GATE);
  378. clk_register_clkdev(clk, NULL, "uart1");
  379. clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk",
  380. bases[CLKRST1_INDEX], BIT(2), CLK_SET_RATE_GATE);
  381. clk_register_clkdev(clk, NULL, "nmk-i2c.1");
  382. clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk",
  383. bases[CLKRST1_INDEX], BIT(3), CLK_SET_RATE_GATE);
  384. clk_register_clkdev(clk, NULL, "msp0");
  385. clk_register_clkdev(clk, NULL, "dbx5x0-msp-i2s.0");
  386. clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk",
  387. bases[CLKRST1_INDEX], BIT(4), CLK_SET_RATE_GATE);
  388. clk_register_clkdev(clk, NULL, "msp1");
  389. clk_register_clkdev(clk, NULL, "dbx5x0-msp-i2s.1");
  390. clk = clk_reg_prcc_kclk("p1_sdi0_kclk", "sdmmchclk",
  391. bases[CLKRST1_INDEX], BIT(5), CLK_SET_RATE_GATE);
  392. clk_register_clkdev(clk, NULL, "sdi0");
  393. clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk",
  394. bases[CLKRST1_INDEX], BIT(6), CLK_SET_RATE_GATE);
  395. clk_register_clkdev(clk, NULL, "nmk-i2c.2");
  396. clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk",
  397. bases[CLKRST1_INDEX], BIT(8), CLK_SET_RATE_GATE);
  398. clk_register_clkdev(clk, NULL, "slimbus0");
  399. clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk",
  400. bases[CLKRST1_INDEX], BIT(9), CLK_SET_RATE_GATE);
  401. clk_register_clkdev(clk, NULL, "nmk-i2c.4");
  402. clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk",
  403. bases[CLKRST1_INDEX], BIT(10), CLK_SET_RATE_GATE);
  404. clk_register_clkdev(clk, NULL, "msp3");
  405. clk_register_clkdev(clk, NULL, "dbx5x0-msp-i2s.3");
  406. /* Peripheral 2 : PRCC K-clocks */
  407. clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk",
  408. bases[CLKRST2_INDEX], BIT(0), CLK_SET_RATE_GATE);
  409. clk_register_clkdev(clk, NULL, "nmk-i2c.3");
  410. clk = clk_reg_prcc_kclk("p2_pwl_kclk", "rtc32k",
  411. bases[CLKRST2_INDEX], BIT(1), CLK_SET_RATE_GATE);
  412. clk_register_clkdev(clk, NULL, "pwl");
  413. clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmchclk",
  414. bases[CLKRST2_INDEX], BIT(2), CLK_SET_RATE_GATE);
  415. clk_register_clkdev(clk, NULL, "sdi4");
  416. clk = clk_reg_prcc_kclk("p2_msp2_kclk", "msp02clk",
  417. bases[CLKRST2_INDEX], BIT(3), CLK_SET_RATE_GATE);
  418. clk_register_clkdev(clk, NULL, "msp2");
  419. clk_register_clkdev(clk, NULL, "dbx5x0-msp-i2s.2");
  420. clk = clk_reg_prcc_kclk("p2_sdi1_kclk", "sdmmchclk",
  421. bases[CLKRST2_INDEX], BIT(4), CLK_SET_RATE_GATE);
  422. clk_register_clkdev(clk, NULL, "sdi1");
  423. clk = clk_reg_prcc_kclk("p2_sdi3_kclk", "sdmmcclk",
  424. bases[CLKRST2_INDEX], BIT(5), CLK_SET_RATE_GATE);
  425. clk_register_clkdev(clk, NULL, "sdi3");
  426. clk = clk_reg_prcc_kclk("p2_ssirx_kclk", "hsirxclk",
  427. bases[CLKRST2_INDEX], BIT(6),
  428. CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT);
  429. clk_register_clkdev(clk, "hsir_hsirxclk", "ste_hsi.0");
  430. clk = clk_reg_prcc_kclk("p2_ssitx_kclk", "hsitxclk",
  431. bases[CLKRST2_INDEX], BIT(7),
  432. CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT);
  433. clk_register_clkdev(clk, "hsit_hsitxclk", "ste_hsi.0");
  434. /* Should only be 9540, but might be added for 85xx as well */
  435. clk = clk_reg_prcc_kclk("p2_msp4_kclk", "msp02clk",
  436. bases[CLKRST2_INDEX], BIT(9), CLK_SET_RATE_GATE);
  437. clk_register_clkdev(clk, NULL, "msp4");
  438. clk_register_clkdev(clk, "msp4", "ab85xx-codec.0");
  439. /* Peripheral 3 : PRCC K-clocks */
  440. clk = clk_reg_prcc_kclk("p3_ssp0_kclk", "sspclk",
  441. bases[CLKRST3_INDEX], BIT(1), CLK_SET_RATE_GATE);
  442. clk_register_clkdev(clk, NULL, "ssp0");
  443. clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk",
  444. bases[CLKRST3_INDEX], BIT(2), CLK_SET_RATE_GATE);
  445. clk_register_clkdev(clk, NULL, "ssp1");
  446. clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk",
  447. bases[CLKRST3_INDEX], BIT(3), CLK_SET_RATE_GATE);
  448. clk_register_clkdev(clk, NULL, "nmk-i2c.0");
  449. clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmchclk",
  450. bases[CLKRST3_INDEX], BIT(4), CLK_SET_RATE_GATE);
  451. clk_register_clkdev(clk, NULL, "sdi2");
  452. clk = clk_reg_prcc_kclk("p3_ske_kclk", "rtc32k",
  453. bases[CLKRST3_INDEX], BIT(5), CLK_SET_RATE_GATE);
  454. clk_register_clkdev(clk, NULL, "ske");
  455. clk_register_clkdev(clk, NULL, "nmk-ske-keypad");
  456. clk = clk_reg_prcc_kclk("p3_uart2_kclk", "uartclk",
  457. bases[CLKRST3_INDEX], BIT(6), CLK_SET_RATE_GATE);
  458. clk_register_clkdev(clk, NULL, "uart2");
  459. clk = clk_reg_prcc_kclk("p3_sdi5_kclk", "sdmmcclk",
  460. bases[CLKRST3_INDEX], BIT(7), CLK_SET_RATE_GATE);
  461. clk_register_clkdev(clk, NULL, "sdi5");
  462. clk = clk_reg_prcc_kclk("p3_i2c5_kclk", "i2cclk",
  463. bases[CLKRST3_INDEX], BIT(8), CLK_SET_RATE_GATE);
  464. clk_register_clkdev(clk, NULL, "nmk-i2c.5");
  465. clk = clk_reg_prcc_kclk("p3_i2c6_kclk", "i2cclk",
  466. bases[CLKRST3_INDEX], BIT(9), CLK_SET_RATE_GATE);
  467. clk_register_clkdev(clk, NULL, "nmk-i2c.6");
  468. clk = clk_reg_prcc_kclk("p3_uart3_kclk", "uartclk",
  469. bases[CLKRST3_INDEX], BIT(10), CLK_SET_RATE_GATE);
  470. clk_register_clkdev(clk, NULL, "uart3");
  471. clk = clk_reg_prcc_kclk("p3_uart4_kclk", "uartclk",
  472. bases[CLKRST3_INDEX], BIT(11), CLK_SET_RATE_GATE);
  473. clk_register_clkdev(clk, NULL, "uart4");
  474. /* Peripheral 6 : PRCC K-clocks */
  475. clk = clk_reg_prcc_kclk("p6_rng_kclk", "rngclk",
  476. bases[CLKRST6_INDEX], BIT(0), CLK_SET_RATE_GATE);
  477. clk_register_clkdev(clk, NULL, "rng");
  478. }