clock.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. /*
  2. * linux/arch/arm/mach-omap1/clock.h
  3. *
  4. * Copyright (C) 2004 - 2005 Nokia corporation
  5. * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
  6. * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H
  13. #define __ARCH_ARM_MACH_OMAP1_CLOCK_H
  14. static void omap1_ckctl_recalc(struct clk * clk);
  15. static void omap1_watchdog_recalc(struct clk * clk);
  16. static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate);
  17. static void omap1_sossi_recalc(struct clk *clk);
  18. static void omap1_ckctl_recalc_dsp_domain(struct clk * clk);
  19. static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate);
  20. static int omap1_set_uart_rate(struct clk * clk, unsigned long rate);
  21. static void omap1_uart_recalc(struct clk * clk);
  22. static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate);
  23. static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate);
  24. static void omap1_init_ext_clk(struct clk * clk);
  25. static int omap1_select_table_rate(struct clk * clk, unsigned long rate);
  26. static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate);
  27. static int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate);
  28. static long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate);
  29. struct mpu_rate {
  30. unsigned long rate;
  31. unsigned long xtal;
  32. unsigned long pll_rate;
  33. __u16 ckctl_val;
  34. __u16 dpllctl_val;
  35. };
  36. struct uart_clk {
  37. struct clk clk;
  38. unsigned long sysc_addr;
  39. };
  40. /* Provide a method for preventing idling some ARM IDLECT clocks */
  41. struct arm_idlect1_clk {
  42. struct clk clk;
  43. unsigned long no_idle_count;
  44. __u8 idlect_shift;
  45. };
  46. /* ARM_CKCTL bit shifts */
  47. #define CKCTL_PERDIV_OFFSET 0
  48. #define CKCTL_LCDDIV_OFFSET 2
  49. #define CKCTL_ARMDIV_OFFSET 4
  50. #define CKCTL_DSPDIV_OFFSET 6
  51. #define CKCTL_TCDIV_OFFSET 8
  52. #define CKCTL_DSPMMUDIV_OFFSET 10
  53. /*#define ARM_TIMXO 12*/
  54. #define EN_DSPCK 13
  55. /*#define ARM_INTHCK_SEL 14*/ /* Divide-by-2 for mpu inth_ck */
  56. /* DSP_CKCTL bit shifts */
  57. #define CKCTL_DSPPERDIV_OFFSET 0
  58. /* ARM_IDLECT2 bit shifts */
  59. #define EN_WDTCK 0
  60. #define EN_XORPCK 1
  61. #define EN_PERCK 2
  62. #define EN_LCDCK 3
  63. #define EN_LBCK 4 /* Not on 1610/1710 */
  64. /*#define EN_HSABCK 5*/
  65. #define EN_APICK 6
  66. #define EN_TIMCK 7
  67. #define DMACK_REQ 8
  68. #define EN_GPIOCK 9 /* Not on 1610/1710 */
  69. /*#define EN_LBFREECK 10*/
  70. #define EN_CKOUT_ARM 11
  71. /* ARM_IDLECT3 bit shifts */
  72. #define EN_OCPI_CK 0
  73. #define EN_TC1_CK 2
  74. #define EN_TC2_CK 4
  75. /* DSP_IDLECT2 bit shifts (0,1,2 are same as for ARM_IDLECT2) */
  76. #define EN_DSPTIMCK 5
  77. /* Various register defines for clock controls scattered around OMAP chip */
  78. #define SDW_MCLK_INV_BIT 2 /* In ULPD_CLKC_CTRL */
  79. #define USB_MCLK_EN_BIT 4 /* In ULPD_CLKC_CTRL */
  80. #define USB_HOST_HHC_UHOST_EN 9 /* In MOD_CONF_CTRL_0 */
  81. #define SWD_ULPD_PLL_CLK_REQ 1 /* In SWD_CLK_DIV_CTRL_SEL */
  82. #define COM_ULPD_PLL_CLK_REQ 1 /* In COM_CLK_DIV_CTRL_SEL */
  83. #define SWD_CLK_DIV_CTRL_SEL 0xfffe0874
  84. #define COM_CLK_DIV_CTRL_SEL 0xfffe0878
  85. #define SOFT_REQ_REG 0xfffe0834
  86. #define SOFT_REQ_REG2 0xfffe0880
  87. /*-------------------------------------------------------------------------
  88. * Omap1 MPU rate table
  89. *-------------------------------------------------------------------------*/
  90. static struct mpu_rate rate_table[] = {
  91. /* MPU MHz, xtal MHz, dpll1 MHz, CKCTL, DPLL_CTL
  92. * NOTE: Comment order here is different from bits in CKCTL value:
  93. * armdiv, dspdiv, dspmmu, tcdiv, perdiv, lcddiv
  94. */
  95. #if defined(CONFIG_OMAP_ARM_216MHZ)
  96. { 216000000, 12000000, 216000000, 0x050d, 0x2910 }, /* 1/1/2/2/2/8 */
  97. #endif
  98. #if defined(CONFIG_OMAP_ARM_195MHZ)
  99. { 195000000, 13000000, 195000000, 0x050e, 0x2790 }, /* 1/1/2/2/4/8 */
  100. #endif
  101. #if defined(CONFIG_OMAP_ARM_192MHZ)
  102. { 192000000, 19200000, 192000000, 0x050f, 0x2510 }, /* 1/1/2/2/8/8 */
  103. { 192000000, 12000000, 192000000, 0x050f, 0x2810 }, /* 1/1/2/2/8/8 */
  104. { 96000000, 12000000, 192000000, 0x055f, 0x2810 }, /* 2/2/2/2/8/8 */
  105. { 48000000, 12000000, 192000000, 0x0baf, 0x2810 }, /* 4/4/4/8/8/8 */
  106. { 24000000, 12000000, 192000000, 0x0fff, 0x2810 }, /* 8/8/8/8/8/8 */
  107. #endif
  108. #if defined(CONFIG_OMAP_ARM_182MHZ)
  109. { 182000000, 13000000, 182000000, 0x050e, 0x2710 }, /* 1/1/2/2/4/8 */
  110. #endif
  111. #if defined(CONFIG_OMAP_ARM_168MHZ)
  112. { 168000000, 12000000, 168000000, 0x010f, 0x2710 }, /* 1/1/1/2/8/8 */
  113. #endif
  114. #if defined(CONFIG_OMAP_ARM_150MHZ)
  115. { 150000000, 12000000, 150000000, 0x010a, 0x2cb0 }, /* 1/1/1/2/4/4 */
  116. #endif
  117. #if defined(CONFIG_OMAP_ARM_120MHZ)
  118. { 120000000, 12000000, 120000000, 0x010a, 0x2510 }, /* 1/1/1/2/4/4 */
  119. #endif
  120. #if defined(CONFIG_OMAP_ARM_96MHZ)
  121. { 96000000, 12000000, 96000000, 0x0005, 0x2410 }, /* 1/1/1/1/2/2 */
  122. #endif
  123. #if defined(CONFIG_OMAP_ARM_60MHZ)
  124. { 60000000, 12000000, 60000000, 0x0005, 0x2290 }, /* 1/1/1/1/2/2 */
  125. #endif
  126. #if defined(CONFIG_OMAP_ARM_30MHZ)
  127. { 30000000, 12000000, 60000000, 0x0555, 0x2290 }, /* 2/2/2/2/2/2 */
  128. #endif
  129. { 0, 0, 0, 0, 0 },
  130. };
  131. /*-------------------------------------------------------------------------
  132. * Omap1 clocks
  133. *-------------------------------------------------------------------------*/
  134. static struct clk ck_ref = {
  135. .name = "ck_ref",
  136. .ops = &clkops_null,
  137. .rate = 12000000,
  138. };
  139. static struct clk ck_dpll1 = {
  140. .name = "ck_dpll1",
  141. .ops = &clkops_null,
  142. .parent = &ck_ref,
  143. .flags = RATE_PROPAGATES,
  144. };
  145. static struct arm_idlect1_clk ck_dpll1out = {
  146. .clk = {
  147. .name = "ck_dpll1out",
  148. .ops = &clkops_generic,
  149. .parent = &ck_dpll1,
  150. .flags = CLOCK_IDLE_CONTROL |
  151. ENABLE_REG_32BIT | RATE_PROPAGATES,
  152. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  153. .enable_bit = EN_CKOUT_ARM,
  154. .recalc = &followparent_recalc,
  155. },
  156. .idlect_shift = 12,
  157. };
  158. static struct clk sossi_ck = {
  159. .name = "ck_sossi",
  160. .ops = &clkops_generic,
  161. .parent = &ck_dpll1out.clk,
  162. .flags = CLOCK_NO_IDLE_PARENT | ENABLE_REG_32BIT,
  163. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_1),
  164. .enable_bit = 16,
  165. .recalc = &omap1_sossi_recalc,
  166. .set_rate = &omap1_set_sossi_rate,
  167. };
  168. static struct clk arm_ck = {
  169. .name = "arm_ck",
  170. .ops = &clkops_null,
  171. .parent = &ck_dpll1,
  172. .flags = RATE_PROPAGATES,
  173. .rate_offset = CKCTL_ARMDIV_OFFSET,
  174. .recalc = &omap1_ckctl_recalc,
  175. .round_rate = omap1_clk_round_rate_ckctl_arm,
  176. .set_rate = omap1_clk_set_rate_ckctl_arm,
  177. };
  178. static struct arm_idlect1_clk armper_ck = {
  179. .clk = {
  180. .name = "armper_ck",
  181. .ops = &clkops_generic,
  182. .parent = &ck_dpll1,
  183. .flags = CLOCK_IDLE_CONTROL,
  184. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  185. .enable_bit = EN_PERCK,
  186. .rate_offset = CKCTL_PERDIV_OFFSET,
  187. .recalc = &omap1_ckctl_recalc,
  188. .round_rate = omap1_clk_round_rate_ckctl_arm,
  189. .set_rate = omap1_clk_set_rate_ckctl_arm,
  190. },
  191. .idlect_shift = 2,
  192. };
  193. static struct clk arm_gpio_ck = {
  194. .name = "arm_gpio_ck",
  195. .ops = &clkops_generic,
  196. .parent = &ck_dpll1,
  197. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  198. .enable_bit = EN_GPIOCK,
  199. .recalc = &followparent_recalc,
  200. };
  201. static struct arm_idlect1_clk armxor_ck = {
  202. .clk = {
  203. .name = "armxor_ck",
  204. .ops = &clkops_generic,
  205. .parent = &ck_ref,
  206. .flags = CLOCK_IDLE_CONTROL,
  207. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  208. .enable_bit = EN_XORPCK,
  209. .recalc = &followparent_recalc,
  210. },
  211. .idlect_shift = 1,
  212. };
  213. static struct arm_idlect1_clk armtim_ck = {
  214. .clk = {
  215. .name = "armtim_ck",
  216. .ops = &clkops_generic,
  217. .parent = &ck_ref,
  218. .flags = CLOCK_IDLE_CONTROL,
  219. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  220. .enable_bit = EN_TIMCK,
  221. .recalc = &followparent_recalc,
  222. },
  223. .idlect_shift = 9,
  224. };
  225. static struct arm_idlect1_clk armwdt_ck = {
  226. .clk = {
  227. .name = "armwdt_ck",
  228. .ops = &clkops_generic,
  229. .parent = &ck_ref,
  230. .flags = CLOCK_IDLE_CONTROL,
  231. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  232. .enable_bit = EN_WDTCK,
  233. .recalc = &omap1_watchdog_recalc,
  234. },
  235. .idlect_shift = 0,
  236. };
  237. static struct clk arminth_ck16xx = {
  238. .name = "arminth_ck",
  239. .ops = &clkops_null,
  240. .parent = &arm_ck,
  241. .recalc = &followparent_recalc,
  242. /* Note: On 16xx the frequency can be divided by 2 by programming
  243. * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1
  244. *
  245. * 1510 version is in TC clocks.
  246. */
  247. };
  248. static struct clk dsp_ck = {
  249. .name = "dsp_ck",
  250. .ops = &clkops_generic,
  251. .parent = &ck_dpll1,
  252. .enable_reg = OMAP1_IO_ADDRESS(ARM_CKCTL),
  253. .enable_bit = EN_DSPCK,
  254. .rate_offset = CKCTL_DSPDIV_OFFSET,
  255. .recalc = &omap1_ckctl_recalc,
  256. .round_rate = omap1_clk_round_rate_ckctl_arm,
  257. .set_rate = omap1_clk_set_rate_ckctl_arm,
  258. };
  259. static struct clk dspmmu_ck = {
  260. .name = "dspmmu_ck",
  261. .ops = &clkops_null,
  262. .parent = &ck_dpll1,
  263. .rate_offset = CKCTL_DSPMMUDIV_OFFSET,
  264. .recalc = &omap1_ckctl_recalc,
  265. .round_rate = omap1_clk_round_rate_ckctl_arm,
  266. .set_rate = omap1_clk_set_rate_ckctl_arm,
  267. };
  268. static struct clk dspper_ck = {
  269. .name = "dspper_ck",
  270. .ops = &clkops_dspck,
  271. .parent = &ck_dpll1,
  272. .enable_reg = DSP_IDLECT2,
  273. .enable_bit = EN_PERCK,
  274. .rate_offset = CKCTL_PERDIV_OFFSET,
  275. .recalc = &omap1_ckctl_recalc_dsp_domain,
  276. .round_rate = omap1_clk_round_rate_ckctl_arm,
  277. .set_rate = &omap1_clk_set_rate_dsp_domain,
  278. };
  279. static struct clk dspxor_ck = {
  280. .name = "dspxor_ck",
  281. .ops = &clkops_dspck,
  282. .parent = &ck_ref,
  283. .enable_reg = DSP_IDLECT2,
  284. .enable_bit = EN_XORPCK,
  285. .recalc = &followparent_recalc,
  286. };
  287. static struct clk dsptim_ck = {
  288. .name = "dsptim_ck",
  289. .ops = &clkops_dspck,
  290. .parent = &ck_ref,
  291. .enable_reg = DSP_IDLECT2,
  292. .enable_bit = EN_DSPTIMCK,
  293. .recalc = &followparent_recalc,
  294. };
  295. /* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */
  296. static struct arm_idlect1_clk tc_ck = {
  297. .clk = {
  298. .name = "tc_ck",
  299. .ops = &clkops_null,
  300. .parent = &ck_dpll1,
  301. .flags = RATE_PROPAGATES | CLOCK_IDLE_CONTROL,
  302. .rate_offset = CKCTL_TCDIV_OFFSET,
  303. .recalc = &omap1_ckctl_recalc,
  304. .round_rate = omap1_clk_round_rate_ckctl_arm,
  305. .set_rate = omap1_clk_set_rate_ckctl_arm,
  306. },
  307. .idlect_shift = 6,
  308. };
  309. static struct clk arminth_ck1510 = {
  310. .name = "arminth_ck",
  311. .ops = &clkops_null,
  312. .parent = &tc_ck.clk,
  313. .recalc = &followparent_recalc,
  314. /* Note: On 1510 the frequency follows TC_CK
  315. *
  316. * 16xx version is in MPU clocks.
  317. */
  318. };
  319. static struct clk tipb_ck = {
  320. /* No-idle controlled by "tc_ck" */
  321. .name = "tipb_ck",
  322. .ops = &clkops_null,
  323. .parent = &tc_ck.clk,
  324. .recalc = &followparent_recalc,
  325. };
  326. static struct clk l3_ocpi_ck = {
  327. /* No-idle controlled by "tc_ck" */
  328. .name = "l3_ocpi_ck",
  329. .ops = &clkops_generic,
  330. .parent = &tc_ck.clk,
  331. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
  332. .enable_bit = EN_OCPI_CK,
  333. .recalc = &followparent_recalc,
  334. };
  335. static struct clk tc1_ck = {
  336. .name = "tc1_ck",
  337. .ops = &clkops_generic,
  338. .parent = &tc_ck.clk,
  339. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
  340. .enable_bit = EN_TC1_CK,
  341. .recalc = &followparent_recalc,
  342. };
  343. static struct clk tc2_ck = {
  344. .name = "tc2_ck",
  345. .ops = &clkops_generic,
  346. .parent = &tc_ck.clk,
  347. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
  348. .enable_bit = EN_TC2_CK,
  349. .recalc = &followparent_recalc,
  350. };
  351. static struct clk dma_ck = {
  352. /* No-idle controlled by "tc_ck" */
  353. .name = "dma_ck",
  354. .ops = &clkops_null,
  355. .parent = &tc_ck.clk,
  356. .recalc = &followparent_recalc,
  357. };
  358. static struct clk dma_lcdfree_ck = {
  359. .name = "dma_lcdfree_ck",
  360. .ops = &clkops_null,
  361. .parent = &tc_ck.clk,
  362. .recalc = &followparent_recalc,
  363. };
  364. static struct arm_idlect1_clk api_ck = {
  365. .clk = {
  366. .name = "api_ck",
  367. .ops = &clkops_generic,
  368. .parent = &tc_ck.clk,
  369. .flags = CLOCK_IDLE_CONTROL,
  370. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  371. .enable_bit = EN_APICK,
  372. .recalc = &followparent_recalc,
  373. },
  374. .idlect_shift = 8,
  375. };
  376. static struct arm_idlect1_clk lb_ck = {
  377. .clk = {
  378. .name = "lb_ck",
  379. .ops = &clkops_generic,
  380. .parent = &tc_ck.clk,
  381. .flags = CLOCK_IDLE_CONTROL,
  382. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  383. .enable_bit = EN_LBCK,
  384. .recalc = &followparent_recalc,
  385. },
  386. .idlect_shift = 4,
  387. };
  388. static struct clk rhea1_ck = {
  389. .name = "rhea1_ck",
  390. .ops = &clkops_null,
  391. .parent = &tc_ck.clk,
  392. .recalc = &followparent_recalc,
  393. };
  394. static struct clk rhea2_ck = {
  395. .name = "rhea2_ck",
  396. .ops = &clkops_null,
  397. .parent = &tc_ck.clk,
  398. .recalc = &followparent_recalc,
  399. };
  400. static struct clk lcd_ck_16xx = {
  401. .name = "lcd_ck",
  402. .ops = &clkops_generic,
  403. .parent = &ck_dpll1,
  404. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  405. .enable_bit = EN_LCDCK,
  406. .rate_offset = CKCTL_LCDDIV_OFFSET,
  407. .recalc = &omap1_ckctl_recalc,
  408. .round_rate = omap1_clk_round_rate_ckctl_arm,
  409. .set_rate = omap1_clk_set_rate_ckctl_arm,
  410. };
  411. static struct arm_idlect1_clk lcd_ck_1510 = {
  412. .clk = {
  413. .name = "lcd_ck",
  414. .ops = &clkops_generic,
  415. .parent = &ck_dpll1,
  416. .flags = CLOCK_IDLE_CONTROL,
  417. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  418. .enable_bit = EN_LCDCK,
  419. .rate_offset = CKCTL_LCDDIV_OFFSET,
  420. .recalc = &omap1_ckctl_recalc,
  421. .round_rate = omap1_clk_round_rate_ckctl_arm,
  422. .set_rate = omap1_clk_set_rate_ckctl_arm,
  423. },
  424. .idlect_shift = 3,
  425. };
  426. static struct clk uart1_1510 = {
  427. .name = "uart1_ck",
  428. .ops = &clkops_null,
  429. /* Direct from ULPD, no real parent */
  430. .parent = &armper_ck.clk,
  431. .rate = 12000000,
  432. .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  433. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  434. .enable_bit = 29, /* Chooses between 12MHz and 48MHz */
  435. .set_rate = &omap1_set_uart_rate,
  436. .recalc = &omap1_uart_recalc,
  437. };
  438. static struct uart_clk uart1_16xx = {
  439. .clk = {
  440. .name = "uart1_ck",
  441. .ops = &clkops_uart,
  442. /* Direct from ULPD, no real parent */
  443. .parent = &armper_ck.clk,
  444. .rate = 48000000,
  445. .flags = RATE_FIXED | ENABLE_REG_32BIT |
  446. CLOCK_NO_IDLE_PARENT,
  447. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  448. .enable_bit = 29,
  449. },
  450. .sysc_addr = 0xfffb0054,
  451. };
  452. static struct clk uart2_ck = {
  453. .name = "uart2_ck",
  454. .ops = &clkops_null,
  455. /* Direct from ULPD, no real parent */
  456. .parent = &armper_ck.clk,
  457. .rate = 12000000,
  458. .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  459. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  460. .enable_bit = 30, /* Chooses between 12MHz and 48MHz */
  461. .set_rate = &omap1_set_uart_rate,
  462. .recalc = &omap1_uart_recalc,
  463. };
  464. static struct clk uart3_1510 = {
  465. .name = "uart3_ck",
  466. .ops = &clkops_null,
  467. /* Direct from ULPD, no real parent */
  468. .parent = &armper_ck.clk,
  469. .rate = 12000000,
  470. .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  471. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  472. .enable_bit = 31, /* Chooses between 12MHz and 48MHz */
  473. .set_rate = &omap1_set_uart_rate,
  474. .recalc = &omap1_uart_recalc,
  475. };
  476. static struct uart_clk uart3_16xx = {
  477. .clk = {
  478. .name = "uart3_ck",
  479. .ops = &clkops_uart,
  480. /* Direct from ULPD, no real parent */
  481. .parent = &armper_ck.clk,
  482. .rate = 48000000,
  483. .flags = RATE_FIXED | ENABLE_REG_32BIT |
  484. CLOCK_NO_IDLE_PARENT,
  485. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  486. .enable_bit = 31,
  487. },
  488. .sysc_addr = 0xfffb9854,
  489. };
  490. static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */
  491. .name = "usb_clko",
  492. .ops = &clkops_generic,
  493. /* Direct from ULPD, no parent */
  494. .rate = 6000000,
  495. .flags = RATE_FIXED | ENABLE_REG_32BIT,
  496. .enable_reg = OMAP1_IO_ADDRESS(ULPD_CLOCK_CTRL),
  497. .enable_bit = USB_MCLK_EN_BIT,
  498. };
  499. static struct clk usb_hhc_ck1510 = {
  500. .name = "usb_hhc_ck",
  501. .ops = &clkops_generic,
  502. /* Direct from ULPD, no parent */
  503. .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */
  504. .flags = RATE_FIXED | ENABLE_REG_32BIT,
  505. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  506. .enable_bit = USB_HOST_HHC_UHOST_EN,
  507. };
  508. static struct clk usb_hhc_ck16xx = {
  509. .name = "usb_hhc_ck",
  510. .ops = &clkops_generic,
  511. /* Direct from ULPD, no parent */
  512. .rate = 48000000,
  513. /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */
  514. .flags = RATE_FIXED | ENABLE_REG_32BIT,
  515. .enable_reg = OMAP1_IO_ADDRESS(OTG_BASE + 0x08), /* OTG_SYSCON_2 */
  516. .enable_bit = 8 /* UHOST_EN */,
  517. };
  518. static struct clk usb_dc_ck = {
  519. .name = "usb_dc_ck",
  520. .ops = &clkops_generic,
  521. /* Direct from ULPD, no parent */
  522. .rate = 48000000,
  523. .flags = RATE_FIXED,
  524. .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
  525. .enable_bit = 4,
  526. };
  527. static struct clk mclk_1510 = {
  528. .name = "mclk",
  529. .ops = &clkops_generic,
  530. /* Direct from ULPD, no parent. May be enabled by ext hardware. */
  531. .rate = 12000000,
  532. .flags = RATE_FIXED,
  533. .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
  534. .enable_bit = 6,
  535. };
  536. static struct clk mclk_16xx = {
  537. .name = "mclk",
  538. .ops = &clkops_generic,
  539. /* Direct from ULPD, no parent. May be enabled by ext hardware. */
  540. .enable_reg = OMAP1_IO_ADDRESS(COM_CLK_DIV_CTRL_SEL),
  541. .enable_bit = COM_ULPD_PLL_CLK_REQ,
  542. .set_rate = &omap1_set_ext_clk_rate,
  543. .round_rate = &omap1_round_ext_clk_rate,
  544. .init = &omap1_init_ext_clk,
  545. };
  546. static struct clk bclk_1510 = {
  547. .name = "bclk",
  548. .ops = &clkops_generic,
  549. /* Direct from ULPD, no parent. May be enabled by ext hardware. */
  550. .rate = 12000000,
  551. .flags = RATE_FIXED,
  552. };
  553. static struct clk bclk_16xx = {
  554. .name = "bclk",
  555. .ops = &clkops_generic,
  556. /* Direct from ULPD, no parent. May be enabled by ext hardware. */
  557. .enable_reg = OMAP1_IO_ADDRESS(SWD_CLK_DIV_CTRL_SEL),
  558. .enable_bit = SWD_ULPD_PLL_CLK_REQ,
  559. .set_rate = &omap1_set_ext_clk_rate,
  560. .round_rate = &omap1_round_ext_clk_rate,
  561. .init = &omap1_init_ext_clk,
  562. };
  563. static struct clk mmc1_ck = {
  564. .name = "mmc_ck",
  565. .ops = &clkops_generic,
  566. /* Functional clock is direct from ULPD, interface clock is ARMPER */
  567. .parent = &armper_ck.clk,
  568. .rate = 48000000,
  569. .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  570. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  571. .enable_bit = 23,
  572. };
  573. static struct clk mmc2_ck = {
  574. .name = "mmc_ck",
  575. .id = 1,
  576. .ops = &clkops_generic,
  577. /* Functional clock is direct from ULPD, interface clock is ARMPER */
  578. .parent = &armper_ck.clk,
  579. .rate = 48000000,
  580. .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  581. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  582. .enable_bit = 20,
  583. };
  584. static struct clk virtual_ck_mpu = {
  585. .name = "mpu",
  586. .ops = &clkops_null,
  587. .parent = &arm_ck, /* Is smarter alias for */
  588. .recalc = &followparent_recalc,
  589. .set_rate = &omap1_select_table_rate,
  590. .round_rate = &omap1_round_to_table_rate,
  591. };
  592. /* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK
  593. remains active during MPU idle whenever this is enabled */
  594. static struct clk i2c_fck = {
  595. .name = "i2c_fck",
  596. .id = 1,
  597. .ops = &clkops_null,
  598. .flags = CLOCK_NO_IDLE_PARENT,
  599. .parent = &armxor_ck.clk,
  600. .recalc = &followparent_recalc,
  601. };
  602. static struct clk i2c_ick = {
  603. .name = "i2c_ick",
  604. .id = 1,
  605. .ops = &clkops_null,
  606. .flags = CLOCK_NO_IDLE_PARENT,
  607. .parent = &armper_ck.clk,
  608. .recalc = &followparent_recalc,
  609. };
  610. #endif