clock2xxx.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. /*
  2. * linux/arch/arm/mach-omap2/clock.c
  3. *
  4. * Copyright (C) 2005-2008 Texas Instruments, Inc.
  5. * Copyright (C) 2004-2008 Nokia Corporation
  6. *
  7. * Contacts:
  8. * Richard Woodruff <r-woodruff2@ti.com>
  9. * Paul Walmsley
  10. *
  11. * Based on earlier work by Tuukka Tikkanen, Tony Lindgren,
  12. * Gordon McNutt and RidgeRun, Inc.
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License version 2 as
  16. * published by the Free Software Foundation.
  17. */
  18. #undef DEBUG
  19. #include <linux/module.h>
  20. #include <linux/kernel.h>
  21. #include <linux/device.h>
  22. #include <linux/list.h>
  23. #include <linux/errno.h>
  24. #include <linux/delay.h>
  25. #include <linux/clk.h>
  26. #include <linux/io.h>
  27. #include <linux/cpufreq.h>
  28. #include <linux/bitops.h>
  29. #include <plat/clock.h>
  30. #include <plat/sram.h>
  31. #include <plat/prcm.h>
  32. #include <plat/clkdev_omap.h>
  33. #include <asm/div64.h>
  34. #include <asm/clkdev.h>
  35. #include <plat/sdrc.h>
  36. #include "clock.h"
  37. #include "clock2xxx.h"
  38. #include "opp2xxx.h"
  39. #include "prm.h"
  40. #include "prm-regbits-24xx.h"
  41. #include "cm.h"
  42. #include "cm-regbits-24xx.h"
  43. /* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
  44. #define EN_APLL_STOPPED 0
  45. #define EN_APLL_LOCKED 3
  46. /* CM_CLKSEL1_PLL.APLLS_CLKIN options (24XX) */
  47. #define APLLS_CLKIN_19_2MHZ 0
  48. #define APLLS_CLKIN_13MHZ 2
  49. #define APLLS_CLKIN_12MHZ 3
  50. /* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */
  51. const struct prcm_config *curr_prcm_set;
  52. const struct prcm_config *rate_table;
  53. struct clk *vclk, *sclk, *dclk;
  54. void __iomem *prcm_clksrc_ctrl;
  55. /*-------------------------------------------------------------------------
  56. * Omap24xx specific clock functions
  57. *-------------------------------------------------------------------------*/
  58. /**
  59. * omap2430_clk_i2chs_find_idlest - return CM_IDLEST info for 2430 I2CHS
  60. * @clk: struct clk * being enabled
  61. * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into
  62. * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into
  63. *
  64. * OMAP2430 I2CHS CM_IDLEST bits are in CM_IDLEST1_CORE, but the
  65. * CM_*CLKEN bits are in CM_{I,F}CLKEN2_CORE. This custom function
  66. * passes back the correct CM_IDLEST register address for I2CHS
  67. * modules. No return value.
  68. */
  69. static void omap2430_clk_i2chs_find_idlest(struct clk *clk,
  70. void __iomem **idlest_reg,
  71. u8 *idlest_bit)
  72. {
  73. *idlest_reg = OMAP_CM_REGADDR(CORE_MOD, CM_IDLEST);
  74. *idlest_bit = clk->enable_bit;
  75. }
  76. /* 2430 I2CHS has non-standard IDLEST register */
  77. const struct clkops clkops_omap2430_i2chs_wait = {
  78. .enable = omap2_dflt_clk_enable,
  79. .disable = omap2_dflt_clk_disable,
  80. .find_idlest = omap2430_clk_i2chs_find_idlest,
  81. .find_companion = omap2_clk_dflt_find_companion,
  82. };
  83. /**
  84. * omap2xxx_clk_get_core_rate - return the CORE_CLK rate
  85. * @clk: pointer to the combined dpll_ck + core_ck (currently "dpll_ck")
  86. *
  87. * Returns the CORE_CLK rate. CORE_CLK can have one of three rate
  88. * sources on OMAP2xxx: the DPLL CLKOUT rate, DPLL CLKOUTX2, or 32KHz
  89. * (the latter is unusual). This currently should be called with
  90. * struct clk *dpll_ck, which is a composite clock of dpll_ck and
  91. * core_ck.
  92. */
  93. unsigned long omap2xxx_clk_get_core_rate(struct clk *clk)
  94. {
  95. long long core_clk;
  96. u32 v;
  97. core_clk = omap2_get_dpll_rate(clk);
  98. v = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
  99. v &= OMAP24XX_CORE_CLK_SRC_MASK;
  100. if (v == CORE_CLK_SRC_32K)
  101. core_clk = 32768;
  102. else
  103. core_clk *= v;
  104. return core_clk;
  105. }
  106. static int omap2_enable_osc_ck(struct clk *clk)
  107. {
  108. u32 pcc;
  109. pcc = __raw_readl(prcm_clksrc_ctrl);
  110. __raw_writel(pcc & ~OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl);
  111. return 0;
  112. }
  113. static void omap2_disable_osc_ck(struct clk *clk)
  114. {
  115. u32 pcc;
  116. pcc = __raw_readl(prcm_clksrc_ctrl);
  117. __raw_writel(pcc | OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl);
  118. }
  119. const struct clkops clkops_oscck = {
  120. .enable = omap2_enable_osc_ck,
  121. .disable = omap2_disable_osc_ck,
  122. };
  123. #ifdef OLD_CK
  124. /* Recalculate SYST_CLK */
  125. static void omap2_sys_clk_recalc(struct clk *clk)
  126. {
  127. u32 div = PRCM_CLKSRC_CTRL;
  128. div &= (1 << 7) | (1 << 6); /* Test if ext clk divided by 1 or 2 */
  129. div >>= clk->rate_offset;
  130. clk->rate = (clk->parent->rate / div);
  131. propagate_rate(clk);
  132. }
  133. #endif /* OLD_CK */
  134. /* Enable an APLL if off */
  135. static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask)
  136. {
  137. u32 cval, apll_mask;
  138. apll_mask = EN_APLL_LOCKED << clk->enable_bit;
  139. cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN);
  140. if ((cval & apll_mask) == apll_mask)
  141. return 0; /* apll already enabled */
  142. cval &= ~apll_mask;
  143. cval |= apll_mask;
  144. cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
  145. omap2_cm_wait_idlest(OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), status_mask,
  146. clk->name);
  147. /*
  148. * REVISIT: Should we return an error code if omap2_wait_clock_ready()
  149. * fails?
  150. */
  151. return 0;
  152. }
  153. static int omap2_clk_apll96_enable(struct clk *clk)
  154. {
  155. return omap2_clk_apll_enable(clk, OMAP24XX_ST_96M_APLL);
  156. }
  157. static int omap2_clk_apll54_enable(struct clk *clk)
  158. {
  159. return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL);
  160. }
  161. /* Stop APLL */
  162. static void omap2_clk_apll_disable(struct clk *clk)
  163. {
  164. u32 cval;
  165. cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN);
  166. cval &= ~(EN_APLL_LOCKED << clk->enable_bit);
  167. cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
  168. }
  169. const struct clkops clkops_apll96 = {
  170. .enable = omap2_clk_apll96_enable,
  171. .disable = omap2_clk_apll_disable,
  172. };
  173. const struct clkops clkops_apll54 = {
  174. .enable = omap2_clk_apll54_enable,
  175. .disable = omap2_clk_apll_disable,
  176. };
  177. /*
  178. * Uses the current prcm set to tell if a rate is valid.
  179. * You can go slower, but not faster within a given rate set.
  180. */
  181. long omap2_dpllcore_round_rate(unsigned long target_rate)
  182. {
  183. u32 high, low, core_clk_src;
  184. core_clk_src = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
  185. core_clk_src &= OMAP24XX_CORE_CLK_SRC_MASK;
  186. if (core_clk_src == CORE_CLK_SRC_DPLL) { /* DPLL clockout */
  187. high = curr_prcm_set->dpll_speed * 2;
  188. low = curr_prcm_set->dpll_speed;
  189. } else { /* DPLL clockout x 2 */
  190. high = curr_prcm_set->dpll_speed;
  191. low = curr_prcm_set->dpll_speed / 2;
  192. }
  193. #ifdef DOWN_VARIABLE_DPLL
  194. if (target_rate > high)
  195. return high;
  196. else
  197. return target_rate;
  198. #else
  199. if (target_rate > low)
  200. return high;
  201. else
  202. return low;
  203. #endif
  204. }
  205. unsigned long omap2_dpllcore_recalc(struct clk *clk)
  206. {
  207. return omap2xxx_clk_get_core_rate(clk);
  208. }
  209. int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
  210. {
  211. u32 cur_rate, low, mult, div, valid_rate, done_rate;
  212. u32 bypass = 0;
  213. struct prcm_config tmpset;
  214. const struct dpll_data *dd;
  215. cur_rate = omap2xxx_clk_get_core_rate(dclk);
  216. mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
  217. mult &= OMAP24XX_CORE_CLK_SRC_MASK;
  218. if ((rate == (cur_rate / 2)) && (mult == 2)) {
  219. omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1);
  220. } else if ((rate == (cur_rate * 2)) && (mult == 1)) {
  221. omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1);
  222. } else if (rate != cur_rate) {
  223. valid_rate = omap2_dpllcore_round_rate(rate);
  224. if (valid_rate != rate)
  225. return -EINVAL;
  226. if (mult == 1)
  227. low = curr_prcm_set->dpll_speed;
  228. else
  229. low = curr_prcm_set->dpll_speed / 2;
  230. dd = clk->dpll_data;
  231. if (!dd)
  232. return -EINVAL;
  233. tmpset.cm_clksel1_pll = __raw_readl(dd->mult_div1_reg);
  234. tmpset.cm_clksel1_pll &= ~(dd->mult_mask |
  235. dd->div1_mask);
  236. div = ((curr_prcm_set->xtal_speed / 1000000) - 1);
  237. tmpset.cm_clksel2_pll = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
  238. tmpset.cm_clksel2_pll &= ~OMAP24XX_CORE_CLK_SRC_MASK;
  239. if (rate > low) {
  240. tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL_X2;
  241. mult = ((rate / 2) / 1000000);
  242. done_rate = CORE_CLK_SRC_DPLL_X2;
  243. } else {
  244. tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL;
  245. mult = (rate / 1000000);
  246. done_rate = CORE_CLK_SRC_DPLL;
  247. }
  248. tmpset.cm_clksel1_pll |= (div << __ffs(dd->mult_mask));
  249. tmpset.cm_clksel1_pll |= (mult << __ffs(dd->div1_mask));
  250. /* Worst case */
  251. tmpset.base_sdrc_rfr = SDRC_RFR_CTRL_BYPASS;
  252. if (rate == curr_prcm_set->xtal_speed) /* If asking for 1-1 */
  253. bypass = 1;
  254. /* For omap2xxx_sdrc_init_params() */
  255. omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1);
  256. /* Force dll lock mode */
  257. omap2_set_prcm(tmpset.cm_clksel1_pll, tmpset.base_sdrc_rfr,
  258. bypass);
  259. /* Errata: ret dll entry state */
  260. omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked());
  261. omap2xxx_sdrc_reprogram(done_rate, 0);
  262. }
  263. return 0;
  264. }
  265. /**
  266. * omap2_table_mpu_recalc - just return the MPU speed
  267. * @clk: virt_prcm_set struct clk
  268. *
  269. * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set.
  270. */
  271. unsigned long omap2_table_mpu_recalc(struct clk *clk)
  272. {
  273. return curr_prcm_set->mpu_speed;
  274. }
  275. /*
  276. * Look for a rate equal or less than the target rate given a configuration set.
  277. *
  278. * What's not entirely clear is "which" field represents the key field.
  279. * Some might argue L3-DDR, others ARM, others IVA. This code is simple and
  280. * just uses the ARM rates.
  281. */
  282. long omap2_round_to_table_rate(struct clk *clk, unsigned long rate)
  283. {
  284. const struct prcm_config *ptr;
  285. long highest_rate;
  286. long sys_ck_rate;
  287. sys_ck_rate = clk_get_rate(sclk);
  288. highest_rate = -EINVAL;
  289. for (ptr = rate_table; ptr->mpu_speed; ptr++) {
  290. if (!(ptr->flags & cpu_mask))
  291. continue;
  292. if (ptr->xtal_speed != sys_ck_rate)
  293. continue;
  294. highest_rate = ptr->mpu_speed;
  295. /* Can check only after xtal frequency check */
  296. if (ptr->mpu_speed <= rate)
  297. break;
  298. }
  299. return highest_rate;
  300. }
  301. /* Sets basic clocks based on the specified rate */
  302. int omap2_select_table_rate(struct clk *clk, unsigned long rate)
  303. {
  304. u32 cur_rate, done_rate, bypass = 0, tmp;
  305. const struct prcm_config *prcm;
  306. unsigned long found_speed = 0;
  307. unsigned long flags;
  308. long sys_ck_rate;
  309. sys_ck_rate = clk_get_rate(sclk);
  310. for (prcm = rate_table; prcm->mpu_speed; prcm++) {
  311. if (!(prcm->flags & cpu_mask))
  312. continue;
  313. if (prcm->xtal_speed != sys_ck_rate)
  314. continue;
  315. if (prcm->mpu_speed <= rate) {
  316. found_speed = prcm->mpu_speed;
  317. break;
  318. }
  319. }
  320. if (!found_speed) {
  321. printk(KERN_INFO "Could not set MPU rate to %luMHz\n",
  322. rate / 1000000);
  323. return -EINVAL;
  324. }
  325. curr_prcm_set = prcm;
  326. cur_rate = omap2xxx_clk_get_core_rate(dclk);
  327. if (prcm->dpll_speed == cur_rate / 2) {
  328. omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1);
  329. } else if (prcm->dpll_speed == cur_rate * 2) {
  330. omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1);
  331. } else if (prcm->dpll_speed != cur_rate) {
  332. local_irq_save(flags);
  333. if (prcm->dpll_speed == prcm->xtal_speed)
  334. bypass = 1;
  335. if ((prcm->cm_clksel2_pll & OMAP24XX_CORE_CLK_SRC_MASK) ==
  336. CORE_CLK_SRC_DPLL_X2)
  337. done_rate = CORE_CLK_SRC_DPLL_X2;
  338. else
  339. done_rate = CORE_CLK_SRC_DPLL;
  340. /* MPU divider */
  341. cm_write_mod_reg(prcm->cm_clksel_mpu, MPU_MOD, CM_CLKSEL);
  342. /* dsp + iva1 div(2420), iva2.1(2430) */
  343. cm_write_mod_reg(prcm->cm_clksel_dsp,
  344. OMAP24XX_DSP_MOD, CM_CLKSEL);
  345. cm_write_mod_reg(prcm->cm_clksel_gfx, GFX_MOD, CM_CLKSEL);
  346. /* Major subsystem dividers */
  347. tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK;
  348. cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD,
  349. CM_CLKSEL1);
  350. if (cpu_is_omap2430())
  351. cm_write_mod_reg(prcm->cm_clksel_mdm,
  352. OMAP2430_MDM_MOD, CM_CLKSEL);
  353. /* x2 to enter omap2xxx_sdrc_init_params() */
  354. omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1);
  355. omap2_set_prcm(prcm->cm_clksel1_pll, prcm->base_sdrc_rfr,
  356. bypass);
  357. omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked());
  358. omap2xxx_sdrc_reprogram(done_rate, 0);
  359. local_irq_restore(flags);
  360. }
  361. return 0;
  362. }
  363. #ifdef CONFIG_CPU_FREQ
  364. /*
  365. * Walk PRCM rate table and fillout cpufreq freq_table
  366. * XXX This should be replaced by an OPP layer in the near future
  367. */
  368. static struct cpufreq_frequency_table *freq_table;
  369. void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
  370. {
  371. const struct prcm_config *prcm;
  372. long sys_ck_rate;
  373. int i = 0;
  374. int tbl_sz = 0;
  375. sys_ck_rate = clk_get_rate(sclk);
  376. for (prcm = rate_table; prcm->mpu_speed; prcm++) {
  377. if (!(prcm->flags & cpu_mask))
  378. continue;
  379. if (prcm->xtal_speed != sys_ck_rate)
  380. continue;
  381. /* don't put bypass rates in table */
  382. if (prcm->dpll_speed == prcm->xtal_speed)
  383. continue;
  384. tbl_sz++;
  385. }
  386. /*
  387. * XXX Ensure that we're doing what CPUFreq expects for this error
  388. * case and the following one
  389. */
  390. if (tbl_sz == 0) {
  391. pr_warning("%s: no matching entries in rate_table\n",
  392. __func__);
  393. return;
  394. }
  395. /* Include the CPUFREQ_TABLE_END terminator entry */
  396. tbl_sz++;
  397. freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) * tbl_sz,
  398. GFP_ATOMIC);
  399. if (!freq_table) {
  400. pr_err("%s: could not kzalloc frequency table\n", __func__);
  401. return;
  402. }
  403. for (prcm = rate_table; prcm->mpu_speed; prcm++) {
  404. if (!(prcm->flags & cpu_mask))
  405. continue;
  406. if (prcm->xtal_speed != sys_ck_rate)
  407. continue;
  408. /* don't put bypass rates in table */
  409. if (prcm->dpll_speed == prcm->xtal_speed)
  410. continue;
  411. freq_table[i].index = i;
  412. freq_table[i].frequency = prcm->mpu_speed / 1000;
  413. i++;
  414. }
  415. freq_table[i].index = i;
  416. freq_table[i].frequency = CPUFREQ_TABLE_END;
  417. *table = &freq_table[0];
  418. }
  419. void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
  420. {
  421. kfree(freq_table);
  422. }
  423. #endif
  424. struct clk_functions omap2_clk_functions = {
  425. .clk_enable = omap2_clk_enable,
  426. .clk_disable = omap2_clk_disable,
  427. .clk_round_rate = omap2_clk_round_rate,
  428. .clk_set_rate = omap2_clk_set_rate,
  429. .clk_set_parent = omap2_clk_set_parent,
  430. .clk_disable_unused = omap2_clk_disable_unused,
  431. #ifdef CONFIG_CPU_FREQ
  432. .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table,
  433. .clk_exit_cpufreq_table = omap2_clk_exit_cpufreq_table,
  434. #endif
  435. };
  436. static u32 omap2_get_apll_clkin(void)
  437. {
  438. u32 aplls, srate = 0;
  439. aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1);
  440. aplls &= OMAP24XX_APLLS_CLKIN_MASK;
  441. aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT;
  442. if (aplls == APLLS_CLKIN_19_2MHZ)
  443. srate = 19200000;
  444. else if (aplls == APLLS_CLKIN_13MHZ)
  445. srate = 13000000;
  446. else if (aplls == APLLS_CLKIN_12MHZ)
  447. srate = 12000000;
  448. return srate;
  449. }
  450. static u32 omap2_get_sysclkdiv(void)
  451. {
  452. u32 div;
  453. div = __raw_readl(prcm_clksrc_ctrl);
  454. div &= OMAP_SYSCLKDIV_MASK;
  455. div >>= OMAP_SYSCLKDIV_SHIFT;
  456. return div;
  457. }
  458. unsigned long omap2_osc_clk_recalc(struct clk *clk)
  459. {
  460. return omap2_get_apll_clkin() * omap2_get_sysclkdiv();
  461. }
  462. unsigned long omap2_sys_clk_recalc(struct clk *clk)
  463. {
  464. return clk->parent->rate / omap2_get_sysclkdiv();
  465. }
  466. /*
  467. * Set clocks for bypass mode for reboot to work.
  468. */
  469. void omap2_clk_prepare_for_reboot(void)
  470. {
  471. u32 rate;
  472. if (vclk == NULL || sclk == NULL)
  473. return;
  474. rate = clk_get_rate(sclk);
  475. clk_set_rate(vclk, rate);
  476. }
  477. /*
  478. * Switch the MPU rate if specified on cmdline.
  479. * We cannot do this early until cmdline is parsed.
  480. */
  481. static int __init omap2_clk_arch_init(void)
  482. {
  483. struct clk *virt_prcm_set, *sys_ck, *dpll_ck, *mpu_ck;
  484. unsigned long sys_ck_rate;
  485. if (!mpurate)
  486. return -EINVAL;
  487. virt_prcm_set = clk_get(NULL, "virt_prcm_set");
  488. sys_ck = clk_get(NULL, "sys_ck");
  489. dpll_ck = clk_get(NULL, "dpll_ck");
  490. mpu_ck = clk_get(NULL, "mpu_ck");
  491. if (clk_set_rate(virt_prcm_set, mpurate))
  492. printk(KERN_ERR "Could not find matching MPU rate\n");
  493. recalculate_root_clocks();
  494. sys_ck_rate = clk_get_rate(sys_ck);
  495. pr_info("Switched to new clocking rate (Crystal/DPLL/MPU): "
  496. "%ld.%01ld/%ld/%ld MHz\n",
  497. (sys_ck_rate / 1000000), (sys_ck_rate / 100000) % 10,
  498. (clk_get_rate(dpll_ck) / 1000000),
  499. (clk_get_rate(mpu_ck) / 1000000));
  500. return 0;
  501. }
  502. arch_initcall(omap2_clk_arch_init);