clock.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  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 unsigned long omap1_ckctl_recalc(struct clk *clk);
  15. static unsigned long omap1_watchdog_recalc(struct clk *clk);
  16. static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate);
  17. static unsigned long omap1_sossi_recalc(struct clk *clk);
  18. static unsigned long 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 unsigned long 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. };
  144. static struct arm_idlect1_clk ck_dpll1out = {
  145. .clk = {
  146. .name = "ck_dpll1out",
  147. .ops = &clkops_generic,
  148. .parent = &ck_dpll1,
  149. .flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT,
  150. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  151. .enable_bit = EN_CKOUT_ARM,
  152. .recalc = &followparent_recalc,
  153. },
  154. .idlect_shift = 12,
  155. };
  156. static struct clk sossi_ck = {
  157. .name = "ck_sossi",
  158. .ops = &clkops_generic,
  159. .parent = &ck_dpll1out.clk,
  160. .flags = CLOCK_NO_IDLE_PARENT | ENABLE_REG_32BIT,
  161. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_1),
  162. .enable_bit = 16,
  163. .recalc = &omap1_sossi_recalc,
  164. .set_rate = &omap1_set_sossi_rate,
  165. };
  166. static struct clk arm_ck = {
  167. .name = "arm_ck",
  168. .ops = &clkops_null,
  169. .parent = &ck_dpll1,
  170. .rate_offset = CKCTL_ARMDIV_OFFSET,
  171. .recalc = &omap1_ckctl_recalc,
  172. .round_rate = omap1_clk_round_rate_ckctl_arm,
  173. .set_rate = omap1_clk_set_rate_ckctl_arm,
  174. };
  175. static struct arm_idlect1_clk armper_ck = {
  176. .clk = {
  177. .name = "armper_ck",
  178. .ops = &clkops_generic,
  179. .parent = &ck_dpll1,
  180. .flags = CLOCK_IDLE_CONTROL,
  181. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  182. .enable_bit = EN_PERCK,
  183. .rate_offset = CKCTL_PERDIV_OFFSET,
  184. .recalc = &omap1_ckctl_recalc,
  185. .round_rate = omap1_clk_round_rate_ckctl_arm,
  186. .set_rate = omap1_clk_set_rate_ckctl_arm,
  187. },
  188. .idlect_shift = 2,
  189. };
  190. static struct clk arm_gpio_ck = {
  191. .name = "arm_gpio_ck",
  192. .ops = &clkops_generic,
  193. .parent = &ck_dpll1,
  194. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  195. .enable_bit = EN_GPIOCK,
  196. .recalc = &followparent_recalc,
  197. };
  198. static struct arm_idlect1_clk armxor_ck = {
  199. .clk = {
  200. .name = "armxor_ck",
  201. .ops = &clkops_generic,
  202. .parent = &ck_ref,
  203. .flags = CLOCK_IDLE_CONTROL,
  204. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  205. .enable_bit = EN_XORPCK,
  206. .recalc = &followparent_recalc,
  207. },
  208. .idlect_shift = 1,
  209. };
  210. static struct arm_idlect1_clk armtim_ck = {
  211. .clk = {
  212. .name = "armtim_ck",
  213. .ops = &clkops_generic,
  214. .parent = &ck_ref,
  215. .flags = CLOCK_IDLE_CONTROL,
  216. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  217. .enable_bit = EN_TIMCK,
  218. .recalc = &followparent_recalc,
  219. },
  220. .idlect_shift = 9,
  221. };
  222. static struct arm_idlect1_clk armwdt_ck = {
  223. .clk = {
  224. .name = "armwdt_ck",
  225. .ops = &clkops_generic,
  226. .parent = &ck_ref,
  227. .flags = CLOCK_IDLE_CONTROL,
  228. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  229. .enable_bit = EN_WDTCK,
  230. .recalc = &omap1_watchdog_recalc,
  231. },
  232. .idlect_shift = 0,
  233. };
  234. static struct clk arminth_ck16xx = {
  235. .name = "arminth_ck",
  236. .ops = &clkops_null,
  237. .parent = &arm_ck,
  238. .recalc = &followparent_recalc,
  239. /* Note: On 16xx the frequency can be divided by 2 by programming
  240. * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1
  241. *
  242. * 1510 version is in TC clocks.
  243. */
  244. };
  245. static struct clk dsp_ck = {
  246. .name = "dsp_ck",
  247. .ops = &clkops_generic,
  248. .parent = &ck_dpll1,
  249. .enable_reg = OMAP1_IO_ADDRESS(ARM_CKCTL),
  250. .enable_bit = EN_DSPCK,
  251. .rate_offset = CKCTL_DSPDIV_OFFSET,
  252. .recalc = &omap1_ckctl_recalc,
  253. .round_rate = omap1_clk_round_rate_ckctl_arm,
  254. .set_rate = omap1_clk_set_rate_ckctl_arm,
  255. };
  256. static struct clk dspmmu_ck = {
  257. .name = "dspmmu_ck",
  258. .ops = &clkops_null,
  259. .parent = &ck_dpll1,
  260. .rate_offset = CKCTL_DSPMMUDIV_OFFSET,
  261. .recalc = &omap1_ckctl_recalc,
  262. .round_rate = omap1_clk_round_rate_ckctl_arm,
  263. .set_rate = omap1_clk_set_rate_ckctl_arm,
  264. };
  265. static struct clk dspper_ck = {
  266. .name = "dspper_ck",
  267. .ops = &clkops_dspck,
  268. .parent = &ck_dpll1,
  269. .enable_reg = DSP_IDLECT2,
  270. .enable_bit = EN_PERCK,
  271. .rate_offset = CKCTL_PERDIV_OFFSET,
  272. .recalc = &omap1_ckctl_recalc_dsp_domain,
  273. .round_rate = omap1_clk_round_rate_ckctl_arm,
  274. .set_rate = &omap1_clk_set_rate_dsp_domain,
  275. };
  276. static struct clk dspxor_ck = {
  277. .name = "dspxor_ck",
  278. .ops = &clkops_dspck,
  279. .parent = &ck_ref,
  280. .enable_reg = DSP_IDLECT2,
  281. .enable_bit = EN_XORPCK,
  282. .recalc = &followparent_recalc,
  283. };
  284. static struct clk dsptim_ck = {
  285. .name = "dsptim_ck",
  286. .ops = &clkops_dspck,
  287. .parent = &ck_ref,
  288. .enable_reg = DSP_IDLECT2,
  289. .enable_bit = EN_DSPTIMCK,
  290. .recalc = &followparent_recalc,
  291. };
  292. /* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */
  293. static struct arm_idlect1_clk tc_ck = {
  294. .clk = {
  295. .name = "tc_ck",
  296. .ops = &clkops_null,
  297. .parent = &ck_dpll1,
  298. .flags = CLOCK_IDLE_CONTROL,
  299. .rate_offset = CKCTL_TCDIV_OFFSET,
  300. .recalc = &omap1_ckctl_recalc,
  301. .round_rate = omap1_clk_round_rate_ckctl_arm,
  302. .set_rate = omap1_clk_set_rate_ckctl_arm,
  303. },
  304. .idlect_shift = 6,
  305. };
  306. static struct clk arminth_ck1510 = {
  307. .name = "arminth_ck",
  308. .ops = &clkops_null,
  309. .parent = &tc_ck.clk,
  310. .recalc = &followparent_recalc,
  311. /* Note: On 1510 the frequency follows TC_CK
  312. *
  313. * 16xx version is in MPU clocks.
  314. */
  315. };
  316. static struct clk tipb_ck = {
  317. /* No-idle controlled by "tc_ck" */
  318. .name = "tipb_ck",
  319. .ops = &clkops_null,
  320. .parent = &tc_ck.clk,
  321. .recalc = &followparent_recalc,
  322. };
  323. static struct clk l3_ocpi_ck = {
  324. /* No-idle controlled by "tc_ck" */
  325. .name = "l3_ocpi_ck",
  326. .ops = &clkops_generic,
  327. .parent = &tc_ck.clk,
  328. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
  329. .enable_bit = EN_OCPI_CK,
  330. .recalc = &followparent_recalc,
  331. };
  332. static struct clk tc1_ck = {
  333. .name = "tc1_ck",
  334. .ops = &clkops_generic,
  335. .parent = &tc_ck.clk,
  336. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
  337. .enable_bit = EN_TC1_CK,
  338. .recalc = &followparent_recalc,
  339. };
  340. static struct clk tc2_ck = {
  341. .name = "tc2_ck",
  342. .ops = &clkops_generic,
  343. .parent = &tc_ck.clk,
  344. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
  345. .enable_bit = EN_TC2_CK,
  346. .recalc = &followparent_recalc,
  347. };
  348. static struct clk dma_ck = {
  349. /* No-idle controlled by "tc_ck" */
  350. .name = "dma_ck",
  351. .ops = &clkops_null,
  352. .parent = &tc_ck.clk,
  353. .recalc = &followparent_recalc,
  354. };
  355. static struct clk dma_lcdfree_ck = {
  356. .name = "dma_lcdfree_ck",
  357. .ops = &clkops_null,
  358. .parent = &tc_ck.clk,
  359. .recalc = &followparent_recalc,
  360. };
  361. static struct arm_idlect1_clk api_ck = {
  362. .clk = {
  363. .name = "api_ck",
  364. .ops = &clkops_generic,
  365. .parent = &tc_ck.clk,
  366. .flags = CLOCK_IDLE_CONTROL,
  367. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  368. .enable_bit = EN_APICK,
  369. .recalc = &followparent_recalc,
  370. },
  371. .idlect_shift = 8,
  372. };
  373. static struct arm_idlect1_clk lb_ck = {
  374. .clk = {
  375. .name = "lb_ck",
  376. .ops = &clkops_generic,
  377. .parent = &tc_ck.clk,
  378. .flags = CLOCK_IDLE_CONTROL,
  379. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  380. .enable_bit = EN_LBCK,
  381. .recalc = &followparent_recalc,
  382. },
  383. .idlect_shift = 4,
  384. };
  385. static struct clk rhea1_ck = {
  386. .name = "rhea1_ck",
  387. .ops = &clkops_null,
  388. .parent = &tc_ck.clk,
  389. .recalc = &followparent_recalc,
  390. };
  391. static struct clk rhea2_ck = {
  392. .name = "rhea2_ck",
  393. .ops = &clkops_null,
  394. .parent = &tc_ck.clk,
  395. .recalc = &followparent_recalc,
  396. };
  397. static struct clk lcd_ck_16xx = {
  398. .name = "lcd_ck",
  399. .ops = &clkops_generic,
  400. .parent = &ck_dpll1,
  401. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  402. .enable_bit = EN_LCDCK,
  403. .rate_offset = CKCTL_LCDDIV_OFFSET,
  404. .recalc = &omap1_ckctl_recalc,
  405. .round_rate = omap1_clk_round_rate_ckctl_arm,
  406. .set_rate = omap1_clk_set_rate_ckctl_arm,
  407. };
  408. static struct arm_idlect1_clk lcd_ck_1510 = {
  409. .clk = {
  410. .name = "lcd_ck",
  411. .ops = &clkops_generic,
  412. .parent = &ck_dpll1,
  413. .flags = CLOCK_IDLE_CONTROL,
  414. .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
  415. .enable_bit = EN_LCDCK,
  416. .rate_offset = CKCTL_LCDDIV_OFFSET,
  417. .recalc = &omap1_ckctl_recalc,
  418. .round_rate = omap1_clk_round_rate_ckctl_arm,
  419. .set_rate = omap1_clk_set_rate_ckctl_arm,
  420. },
  421. .idlect_shift = 3,
  422. };
  423. static struct clk uart1_1510 = {
  424. .name = "uart1_ck",
  425. .ops = &clkops_null,
  426. /* Direct from ULPD, no real parent */
  427. .parent = &armper_ck.clk,
  428. .rate = 12000000,
  429. .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  430. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  431. .enable_bit = 29, /* Chooses between 12MHz and 48MHz */
  432. .set_rate = &omap1_set_uart_rate,
  433. .recalc = &omap1_uart_recalc,
  434. };
  435. static struct uart_clk uart1_16xx = {
  436. .clk = {
  437. .name = "uart1_ck",
  438. .ops = &clkops_uart,
  439. /* Direct from ULPD, no real parent */
  440. .parent = &armper_ck.clk,
  441. .rate = 48000000,
  442. .flags = RATE_FIXED | ENABLE_REG_32BIT |
  443. CLOCK_NO_IDLE_PARENT,
  444. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  445. .enable_bit = 29,
  446. },
  447. .sysc_addr = 0xfffb0054,
  448. };
  449. static struct clk uart2_ck = {
  450. .name = "uart2_ck",
  451. .ops = &clkops_null,
  452. /* Direct from ULPD, no real parent */
  453. .parent = &armper_ck.clk,
  454. .rate = 12000000,
  455. .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  456. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  457. .enable_bit = 30, /* Chooses between 12MHz and 48MHz */
  458. .set_rate = &omap1_set_uart_rate,
  459. .recalc = &omap1_uart_recalc,
  460. };
  461. static struct clk uart3_1510 = {
  462. .name = "uart3_ck",
  463. .ops = &clkops_null,
  464. /* Direct from ULPD, no real parent */
  465. .parent = &armper_ck.clk,
  466. .rate = 12000000,
  467. .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  468. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  469. .enable_bit = 31, /* Chooses between 12MHz and 48MHz */
  470. .set_rate = &omap1_set_uart_rate,
  471. .recalc = &omap1_uart_recalc,
  472. };
  473. static struct uart_clk uart3_16xx = {
  474. .clk = {
  475. .name = "uart3_ck",
  476. .ops = &clkops_uart,
  477. /* Direct from ULPD, no real parent */
  478. .parent = &armper_ck.clk,
  479. .rate = 48000000,
  480. .flags = RATE_FIXED | ENABLE_REG_32BIT |
  481. CLOCK_NO_IDLE_PARENT,
  482. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  483. .enable_bit = 31,
  484. },
  485. .sysc_addr = 0xfffb9854,
  486. };
  487. static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */
  488. .name = "usb_clko",
  489. .ops = &clkops_generic,
  490. /* Direct from ULPD, no parent */
  491. .rate = 6000000,
  492. .flags = RATE_FIXED | ENABLE_REG_32BIT,
  493. .enable_reg = OMAP1_IO_ADDRESS(ULPD_CLOCK_CTRL),
  494. .enable_bit = USB_MCLK_EN_BIT,
  495. };
  496. static struct clk usb_hhc_ck1510 = {
  497. .name = "usb_hhc_ck",
  498. .ops = &clkops_generic,
  499. /* Direct from ULPD, no parent */
  500. .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */
  501. .flags = RATE_FIXED | ENABLE_REG_32BIT,
  502. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  503. .enable_bit = USB_HOST_HHC_UHOST_EN,
  504. };
  505. static struct clk usb_hhc_ck16xx = {
  506. .name = "usb_hhc_ck",
  507. .ops = &clkops_generic,
  508. /* Direct from ULPD, no parent */
  509. .rate = 48000000,
  510. /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */
  511. .flags = RATE_FIXED | ENABLE_REG_32BIT,
  512. .enable_reg = OMAP1_IO_ADDRESS(OTG_BASE + 0x08), /* OTG_SYSCON_2 */
  513. .enable_bit = 8 /* UHOST_EN */,
  514. };
  515. static struct clk usb_dc_ck = {
  516. .name = "usb_dc_ck",
  517. .ops = &clkops_generic,
  518. /* Direct from ULPD, no parent */
  519. .rate = 48000000,
  520. .flags = RATE_FIXED,
  521. .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
  522. .enable_bit = 4,
  523. };
  524. static struct clk mclk_1510 = {
  525. .name = "mclk",
  526. .ops = &clkops_generic,
  527. /* Direct from ULPD, no parent. May be enabled by ext hardware. */
  528. .rate = 12000000,
  529. .flags = RATE_FIXED,
  530. .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
  531. .enable_bit = 6,
  532. };
  533. static struct clk mclk_16xx = {
  534. .name = "mclk",
  535. .ops = &clkops_generic,
  536. /* Direct from ULPD, no parent. May be enabled by ext hardware. */
  537. .enable_reg = OMAP1_IO_ADDRESS(COM_CLK_DIV_CTRL_SEL),
  538. .enable_bit = COM_ULPD_PLL_CLK_REQ,
  539. .set_rate = &omap1_set_ext_clk_rate,
  540. .round_rate = &omap1_round_ext_clk_rate,
  541. .init = &omap1_init_ext_clk,
  542. };
  543. static struct clk bclk_1510 = {
  544. .name = "bclk",
  545. .ops = &clkops_generic,
  546. /* Direct from ULPD, no parent. May be enabled by ext hardware. */
  547. .rate = 12000000,
  548. .flags = RATE_FIXED,
  549. };
  550. static struct clk bclk_16xx = {
  551. .name = "bclk",
  552. .ops = &clkops_generic,
  553. /* Direct from ULPD, no parent. May be enabled by ext hardware. */
  554. .enable_reg = OMAP1_IO_ADDRESS(SWD_CLK_DIV_CTRL_SEL),
  555. .enable_bit = SWD_ULPD_PLL_CLK_REQ,
  556. .set_rate = &omap1_set_ext_clk_rate,
  557. .round_rate = &omap1_round_ext_clk_rate,
  558. .init = &omap1_init_ext_clk,
  559. };
  560. static struct clk mmc1_ck = {
  561. .name = "mmc_ck",
  562. .ops = &clkops_generic,
  563. /* Functional clock is direct from ULPD, interface clock is ARMPER */
  564. .parent = &armper_ck.clk,
  565. .rate = 48000000,
  566. .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  567. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  568. .enable_bit = 23,
  569. };
  570. static struct clk mmc2_ck = {
  571. .name = "mmc_ck",
  572. .id = 1,
  573. .ops = &clkops_generic,
  574. /* Functional clock is direct from ULPD, interface clock is ARMPER */
  575. .parent = &armper_ck.clk,
  576. .rate = 48000000,
  577. .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
  578. .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
  579. .enable_bit = 20,
  580. };
  581. static struct clk virtual_ck_mpu = {
  582. .name = "mpu",
  583. .ops = &clkops_null,
  584. .parent = &arm_ck, /* Is smarter alias for */
  585. .recalc = &followparent_recalc,
  586. .set_rate = &omap1_select_table_rate,
  587. .round_rate = &omap1_round_to_table_rate,
  588. };
  589. /* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK
  590. remains active during MPU idle whenever this is enabled */
  591. static struct clk i2c_fck = {
  592. .name = "i2c_fck",
  593. .id = 1,
  594. .ops = &clkops_null,
  595. .flags = CLOCK_NO_IDLE_PARENT,
  596. .parent = &armxor_ck.clk,
  597. .recalc = &followparent_recalc,
  598. };
  599. static struct clk i2c_ick = {
  600. .name = "i2c_ick",
  601. .id = 1,
  602. .ops = &clkops_null,
  603. .flags = CLOCK_NO_IDLE_PARENT,
  604. .parent = &armper_ck.clk,
  605. .recalc = &followparent_recalc,
  606. };
  607. #endif