aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock24xx.h
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2008-03-18 04:35:15 -0400
committerTony Lindgren <tony@atomide.com>2008-04-14 13:29:38 -0400
commit6b8858a972a0eff1dc1ab77b0fd9fc25387c217c (patch)
treea34e94f4d372670c5125e8f490c85e9364d222df /arch/arm/mach-omap2/clock24xx.h
parent543d93781a3c744017594d0721c4c1814a26bcce (diff)
ARM: OMAP2: Change 24xx to use shared clock code and new reg access
This patch changes 24xx to use shared clock code and new register access. Note that patch adds some temporary OLD_CK defines to keep patch more readable. These temporary defines will be removed in the next patch. Also not all clocks are changed in this patch to limit the size. Also, the patch fixes few incorrect clock defines in clock24xx.h. Signed-off-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/clock24xx.h')
-rw-r--r--arch/arm/mach-omap2/clock24xx.h320
1 files changed, 213 insertions, 107 deletions
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h
index 4f791866b910..9363c207f581 100644
--- a/arch/arm/mach-omap2/clock24xx.h
+++ b/arch/arm/mach-omap2/clock24xx.h
@@ -14,24 +14,29 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_H 17#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK24XX_H
18#define __ARCH_ARM_MACH_OMAP2_CLOCK_H 18#define __ARCH_ARM_MACH_OMAP2_CLOCK24XX_H
19 19
20static void omap2_sys_clk_recalc(struct clk * clk); 20#include "clock.h"
21static void omap2_clksel_recalc(struct clk * clk); 21
22static void omap2_followparent_recalc(struct clk * clk); 22#include "prm.h"
23static void omap2_propagate_rate(struct clk * clk); 23#include "cm.h"
24static void omap2_mpu_recalc(struct clk * clk); 24#include "prm-regbits-24xx.h"
25#include "cm-regbits-24xx.h"
26#include "sdrc.h"
27
28static void omap2_table_mpu_recalc(struct clk * clk);
25static int omap2_select_table_rate(struct clk * clk, unsigned long rate); 29static int omap2_select_table_rate(struct clk * clk, unsigned long rate);
26static long omap2_round_to_table_rate(struct clk * clk, unsigned long rate); 30static long omap2_round_to_table_rate(struct clk * clk, unsigned long rate);
27static void omap2_clk_disable(struct clk *clk);
28static void omap2_sys_clk_recalc(struct clk * clk); 31static void omap2_sys_clk_recalc(struct clk * clk);
29static u32 omap2_clksel_to_divisor(u32 div_sel, u32 field_val); 32static void omap2_osc_clk_recalc(struct clk * clk);
30static u32 omap2_clksel_get_divisor(struct clk *clk); 33static void omap2_sys_clk_recalc(struct clk * clk);
31 34static void omap2_dpll_recalc(struct clk * clk);
32 35static int omap2_clk_fixed_enable(struct clk * clk);
33#define RATE_IN_242X (1 << 0) 36static void omap2_clk_fixed_disable(struct clk * clk);
34#define RATE_IN_243X (1 << 1) 37static int omap2_enable_osc_ck(struct clk * clk);
38static void omap2_disable_osc_ck(struct clk * clk);
39static int omap2_reprogram_dpll(struct clk * clk, unsigned long rate);
35 40
36/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 41/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
37 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP 42 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP
@@ -52,16 +57,6 @@ struct prcm_config {
52 unsigned char flags; 57 unsigned char flags;
53}; 58};
54 59
55/* Mask for clksel which support parent settign in set_rate */
56#define SRC_SEL_MASK (CM_CORE_SEL1 | CM_CORE_SEL2 | CM_WKUP_SEL1 | \
57 CM_PLL_SEL1 | CM_PLL_SEL2 | CM_SYSCLKOUT_SEL1)
58
59/* Mask for clksel regs which support rate operations */
60#define SRC_RATE_SEL_MASK (CM_MPU_SEL1 | CM_DSP_SEL1 | CM_GFX_SEL1 | \
61 CM_MODEM_SEL1 | CM_CORE_SEL1 | CM_CORE_SEL2 | \
62 CM_WKUP_SEL1 | CM_PLL_SEL1 | CM_PLL_SEL2 | \
63 CM_SYSCLKOUT_SEL1)
64
65/* 60/*
66 * The OMAP2 processor can be run at several discrete 'PRCM configurations'. 61 * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
67 * These configurations are characterized by voltage and speed for clocks. 62 * These configurations are characterized by voltage and speed for clocks.
@@ -174,7 +169,7 @@ struct prcm_config {
174#define RII_CLKSEL_DSP (3 << 0) /* c5x - 200MHz */ 169#define RII_CLKSEL_DSP (3 << 0) /* c5x - 200MHz */
175#define RII_CLKSEL_DSP_IF (2 << 5) /* c5x - 100MHz */ 170#define RII_CLKSEL_DSP_IF (2 << 5) /* c5x - 100MHz */
176#define RII_SYNC_DSP (0 << 7) /* Bypass sync */ 171#define RII_SYNC_DSP (0 << 7) /* Bypass sync */
177#define RII_CLKSEL_IVA (6 << 8) /* iva1 - 200MHz */ 172#define RII_CLKSEL_IVA (3 << 8) /* iva1 - 200MHz */
178#define RII_SYNC_IVA (0 << 13) /* Bypass sync */ 173#define RII_SYNC_IVA (0 << 13) /* Bypass sync */
179#define RII_CM_CLKSEL_DSP_VAL RII_SYNC_IVA | RII_CLKSEL_IVA | \ 174#define RII_CM_CLKSEL_DSP_VAL RII_SYNC_IVA | RII_CLKSEL_IVA | \
180 RII_SYNC_DSP | RII_CLKSEL_DSP_IF | \ 175 RII_SYNC_DSP | RII_CLKSEL_DSP_IF | \
@@ -182,6 +177,27 @@ struct prcm_config {
182#define RII_CLKSEL_GFX (2 << 0) /* 50MHz */ 177#define RII_CLKSEL_GFX (2 << 0) /* 50MHz */
183#define RII_CM_CLKSEL_GFX_VAL RII_CLKSEL_GFX 178#define RII_CM_CLKSEL_GFX_VAL RII_CLKSEL_GFX
184 179
180/* 2420-PRCM I 660MHz core */
181#define RI_CLKSEL_L3 (4 << 0) /* 165MHz */
182#define RI_CLKSEL_L4 (2 << 5) /* 82.5MHz */
183#define RI_CLKSEL_USB (4 << 25) /* 41.25MHz */
184#define RI_CM_CLKSEL1_CORE_VAL RI_CLKSEL_USB | \
185 RXX_CLKSEL_SSI | RXX_CLKSEL_VLYNQ | \
186 RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
187 RI_CLKSEL_L4 | RI_CLKSEL_L3
188#define RI_CLKSEL_MPU (2 << 0) /* 330MHz */
189#define RI_CM_CLKSEL_MPU_VAL RI_CLKSEL_MPU
190#define RI_CLKSEL_DSP (3 << 0) /* c5x - 220MHz */
191#define RI_CLKSEL_DSP_IF (2 << 5) /* c5x - 110MHz */
192#define RI_SYNC_DSP (1 << 7) /* Activate sync */
193#define RI_CLKSEL_IVA (4 << 8) /* iva1 - 165MHz */
194#define RI_SYNC_IVA (0 << 13) /* Bypass sync */
195#define RI_CM_CLKSEL_DSP_VAL RI_SYNC_IVA | RI_CLKSEL_IVA | \
196 RI_SYNC_DSP | RI_CLKSEL_DSP_IF | \
197 RI_CLKSEL_DSP
198#define RI_CLKSEL_GFX (1 << 0) /* 165MHz */
199#define RI_CM_CLKSEL_GFX_VAL RI_CLKSEL_GFX
200
185/* 2420-PRCM VII (boot) */ 201/* 2420-PRCM VII (boot) */
186#define RVII_CLKSEL_L3 (1 << 0) 202#define RVII_CLKSEL_L3 (1 << 0)
187#define RVII_CLKSEL_L4 (1 << 5) 203#define RVII_CLKSEL_L4 (1 << 5)
@@ -224,7 +240,6 @@ struct prcm_config {
224 240
225/* 241/*
226 * 2430 - standalone, 2*ref*M/(n+1), M/N is for exactness not relock speed 242 * 2430 - standalone, 2*ref*M/(n+1), M/N is for exactness not relock speed
227 * #2 (ratio1) baseport-target
228 * #5a (ratio1) baseport-target, target DPLL = 266*2 = 532MHz 243 * #5a (ratio1) baseport-target, target DPLL = 266*2 = 532MHz
229 */ 244 */
230#define M5A_DPLL_MULT_12 (133 << 12) 245#define M5A_DPLL_MULT_12 (133 << 12)
@@ -232,13 +247,13 @@ struct prcm_config {
232#define M5A_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \ 247#define M5A_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
233 M5A_DPLL_DIV_12 | M5A_DPLL_MULT_12 | \ 248 M5A_DPLL_DIV_12 | M5A_DPLL_MULT_12 | \
234 MX_APLLS_CLIKIN_12 249 MX_APLLS_CLIKIN_12
235#define M5A_DPLL_MULT_13 (266 << 12) 250#define M5A_DPLL_MULT_13 (61 << 12)
236#define M5A_DPLL_DIV_13 (12 << 8) 251#define M5A_DPLL_DIV_13 (2 << 8)
237#define M5A_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \ 252#define M5A_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
238 M5A_DPLL_DIV_13 | M5A_DPLL_MULT_13 | \ 253 M5A_DPLL_DIV_13 | M5A_DPLL_MULT_13 | \
239 MX_APLLS_CLIKIN_13 254 MX_APLLS_CLIKIN_13
240#define M5A_DPLL_MULT_19 (180 << 12) 255#define M5A_DPLL_MULT_19 (55 << 12)
241#define M5A_DPLL_DIV_19 (12 << 8) 256#define M5A_DPLL_DIV_19 (3 << 8)
242#define M5A_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \ 257#define M5A_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
243 M5A_DPLL_DIV_19 | M5A_DPLL_MULT_19 | \ 258 M5A_DPLL_DIV_19 | M5A_DPLL_MULT_19 | \
244 MX_APLLS_CLIKIN_19_2 259 MX_APLLS_CLIKIN_19_2
@@ -260,7 +275,27 @@ struct prcm_config {
260 M5B_DPLL_DIV_19 | M5B_DPLL_MULT_19 | \ 275 M5B_DPLL_DIV_19 | M5B_DPLL_MULT_19 | \
261 MX_APLLS_CLIKIN_19_2 276 MX_APLLS_CLIKIN_19_2
262/* 277/*
263 * #4 (ratio2) 278 * #4 (ratio2), DPLL = 399*2 = 798MHz, L3=133MHz
279 */
280#define M4_DPLL_MULT_12 (133 << 12)
281#define M4_DPLL_DIV_12 (3 << 8)
282#define M4_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
283 M4_DPLL_DIV_12 | M4_DPLL_MULT_12 | \
284 MX_APLLS_CLIKIN_12
285
286#define M4_DPLL_MULT_13 (399 << 12)
287#define M4_DPLL_DIV_13 (12 << 8)
288#define M4_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
289 M4_DPLL_DIV_13 | M4_DPLL_MULT_13 | \
290 MX_APLLS_CLIKIN_13
291
292#define M4_DPLL_MULT_19 (145 << 12)
293#define M4_DPLL_DIV_19 (6 << 8)
294#define M4_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
295 M4_DPLL_DIV_19 | M4_DPLL_MULT_19 | \
296 MX_APLLS_CLIKIN_19_2
297
298/*
264 * #3 (ratio2) baseport-target, target DPLL = 330*2 = 660MHz 299 * #3 (ratio2) baseport-target, target DPLL = 330*2 = 660MHz
265 */ 300 */
266#define M3_DPLL_MULT_12 (55 << 12) 301#define M3_DPLL_MULT_12 (55 << 12)
@@ -268,16 +303,41 @@ struct prcm_config {
268#define M3_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \ 303#define M3_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
269 M3_DPLL_DIV_12 | M3_DPLL_MULT_12 | \ 304 M3_DPLL_DIV_12 | M3_DPLL_MULT_12 | \
270 MX_APLLS_CLIKIN_12 305 MX_APLLS_CLIKIN_12
271#define M3_DPLL_MULT_13 (330 << 12) 306#define M3_DPLL_MULT_13 (76 << 12)
272#define M3_DPLL_DIV_13 (12 << 8) 307#define M3_DPLL_DIV_13 (2 << 8)
273#define M3_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \ 308#define M3_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
274 M3_DPLL_DIV_13 | M3_DPLL_MULT_13 | \ 309 M3_DPLL_DIV_13 | M3_DPLL_MULT_13 | \
275 MX_APLLS_CLIKIN_13 310 MX_APLLS_CLIKIN_13
276#define M3_DPLL_MULT_19 (275 << 12) 311#define M3_DPLL_MULT_19 (17 << 12)
277#define M3_DPLL_DIV_19 (15 << 8) 312#define M3_DPLL_DIV_19 (0 << 8)
278#define M3_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \ 313#define M3_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
279 M3_DPLL_DIV_19 | M3_DPLL_MULT_19 | \ 314 M3_DPLL_DIV_19 | M3_DPLL_MULT_19 | \
280 MX_APLLS_CLIKIN_19_2 315 MX_APLLS_CLIKIN_19_2
316
317/*
318 * #2 (ratio1) DPLL = 330*2 = 660MHz, L3=165MHz
319 */
320#define M2_DPLL_MULT_12 (55 << 12)
321#define M2_DPLL_DIV_12 (1 << 8)
322#define M2_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
323 M2_DPLL_DIV_12 | M2_DPLL_MULT_12 | \
324 MX_APLLS_CLIKIN_12
325
326/* Speed changes - Used 658.7MHz instead of 660MHz for LP-Refresh M=76 N=2,
327 * relock time issue */
328/* Core frequency changed from 330/165 to 329/164 MHz*/
329#define M2_DPLL_MULT_13 (76 << 12)
330#define M2_DPLL_DIV_13 (2 << 8)
331#define M2_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
332 M2_DPLL_DIV_13 | M2_DPLL_MULT_13 | \
333 MX_APLLS_CLIKIN_13
334
335#define M2_DPLL_MULT_19 (17 << 12)
336#define M2_DPLL_DIV_19 (0 << 8)
337#define M2_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
338 M2_DPLL_DIV_19 | M2_DPLL_MULT_19 | \
339 MX_APLLS_CLIKIN_19_2
340
281/* boot (boot) */ 341/* boot (boot) */
282#define MB_DPLL_MULT (1 << 12) 342#define MB_DPLL_MULT (1 << 12)
283#define MB_DPLL_DIV (0 << 8) 343#define MB_DPLL_DIV (0 << 8)
@@ -300,6 +360,13 @@ struct prcm_config {
300 * boot (boot) 360 * boot (boot)
301 */ 361 */
302 362
363/* PRCM I target DPLL = 2*330MHz = 660MHz */
364#define MI_DPLL_MULT_12 (55 << 12)
365#define MI_DPLL_DIV_12 (1 << 8)
366#define MI_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
367 MI_DPLL_DIV_12 | MI_DPLL_MULT_12 | \
368 MX_APLLS_CLIKIN_12
369
303/* 370/*
304 * 2420 Equivalent - mode registers 371 * 2420 Equivalent - mode registers
305 * PRCM II , target DPLL = 2*300MHz = 600MHz 372 * PRCM II , target DPLL = 2*300MHz = 600MHz
@@ -335,28 +402,6 @@ struct prcm_config {
335#define MX_CLKSEL2_PLL_2x_VAL (2 << 0) 402#define MX_CLKSEL2_PLL_2x_VAL (2 << 0)
336#define MX_CLKSEL2_PLL_1x_VAL (1 << 0) 403#define MX_CLKSEL2_PLL_1x_VAL (1 << 0)
337 404
338/*
339 * These represent optimal values for common parts, it won't work for all.
340 * As long as you scale down, most parameters are still work, they just
341 * become sub-optimal. The RFR value goes in the opposite direction. If you
342 * don't adjust it down as your clock period increases the refresh interval
343 * will not be met. Setting all parameters for complete worst case may work,
344 * but may cut memory performance by 2x. Due to errata the DLLs need to be
345 * unlocked and their value needs run time calibration. A dynamic call is
346 * need for that as no single right value exists acorss production samples.
347 *
348 * Only the FULL speed values are given. Current code is such that rate
349 * changes must be made at DPLLoutx2. The actual value adjustment for low
350 * frequency operation will be handled by omap_set_performance()
351 *
352 * By having the boot loader boot up in the fastest L4 speed available likely
353 * will result in something which you can switch between.
354 */
355#define V24XX_SDRC_RFR_CTRL_133MHz (0x0003de00 | 1)
356#define V24XX_SDRC_RFR_CTRL_100MHz (0x0002da01 | 1)
357#define V24XX_SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */
358#define V24XX_SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */
359
360/* MPU speed defines */ 405/* MPU speed defines */
361#define S12M 12000000 406#define S12M 12000000
362#define S13M 13000000 407#define S13M 13000000
@@ -365,15 +410,21 @@ struct prcm_config {
365#define S100M 100000000 410#define S100M 100000000
366#define S133M 133000000 411#define S133M 133000000
367#define S150M 150000000 412#define S150M 150000000
413#define S164M 164000000
368#define S165M 165000000 414#define S165M 165000000
415#define S199M 199000000
369#define S200M 200000000 416#define S200M 200000000
370#define S266M 266000000 417#define S266M 266000000
371#define S300M 300000000 418#define S300M 300000000
419#define S329M 329000000
372#define S330M 330000000 420#define S330M 330000000
421#define S399M 399000000
373#define S400M 400000000 422#define S400M 400000000
374#define S532M 532000000 423#define S532M 532000000
375#define S600M 600000000 424#define S600M 600000000
425#define S658M 658000000
376#define S660M 660000000 426#define S660M 660000000
427#define S798M 798000000
377 428
378/*------------------------------------------------------------------------- 429/*-------------------------------------------------------------------------
379 * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 430 * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
@@ -394,78 +445,93 @@ struct prcm_config {
394 * Note: This table needs to be sorted, fastest to slowest. 445 * Note: This table needs to be sorted, fastest to slowest.
395 *-------------------------------------------------------------------------*/ 446 *-------------------------------------------------------------------------*/
396static struct prcm_config rate_table[] = { 447static struct prcm_config rate_table[] = {
448 /* PRCM I - FAST */
449 {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */
450 RI_CM_CLKSEL_DSP_VAL, RI_CM_CLKSEL_GFX_VAL,
451 RI_CM_CLKSEL1_CORE_VAL, MI_CM_CLKSEL1_PLL_12_VAL,
452 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_165MHz,
453 RATE_IN_242X},
454
397 /* PRCM II - FAST */ 455 /* PRCM II - FAST */
398 {S12M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */ 456 {S12M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */
399 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL, 457 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
400 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL, 458 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
401 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz, 459 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
402 RATE_IN_242X}, 460 RATE_IN_242X},
403 461
404 {S13M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */ 462 {S13M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */
405 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL, 463 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
406 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL, 464 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
407 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz, 465 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
408 RATE_IN_242X}, 466 RATE_IN_242X},
409 467
410 /* PRCM III - FAST */ 468 /* PRCM III - FAST */
411 {S12M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */ 469 {S12M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
412 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL, 470 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
413 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL, 471 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
414 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz, 472 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
415 RATE_IN_242X}, 473 RATE_IN_242X},
416 474
417 {S13M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */ 475 {S13M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
418 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL, 476 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
419 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL, 477 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
420 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz, 478 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
421 RATE_IN_242X}, 479 RATE_IN_242X},
422 480
423 /* PRCM II - SLOW */ 481 /* PRCM II - SLOW */
424 {S12M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */ 482 {S12M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */
425 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL, 483 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
426 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL, 484 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
427 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz, 485 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
428 RATE_IN_242X}, 486 RATE_IN_242X},
429 487
430 {S13M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */ 488 {S13M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */
431 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL, 489 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
432 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL, 490 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
433 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_100MHz, 491 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
434 RATE_IN_242X}, 492 RATE_IN_242X},
435 493
436 /* PRCM III - SLOW */ 494 /* PRCM III - SLOW */
437 {S12M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */ 495 {S12M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
438 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL, 496 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
439 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL, 497 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
440 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz, 498 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
441 RATE_IN_242X}, 499 RATE_IN_242X},
442 500
443 {S13M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */ 501 {S13M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
444 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL, 502 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
445 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL, 503 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
446 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_133MHz, 504 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
447 RATE_IN_242X}, 505 RATE_IN_242X},
448 506
449 /* PRCM-VII (boot-bypass) */ 507 /* PRCM-VII (boot-bypass) */
450 {S12M, S12M, S12M, RVII_CM_CLKSEL_MPU_VAL, /* 12MHz ARM*/ 508 {S12M, S12M, S12M, RVII_CM_CLKSEL_MPU_VAL, /* 12MHz ARM*/
451 RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL, 509 RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
452 RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_12_VAL, 510 RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_12_VAL,
453 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_BYPASS, 511 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
454 RATE_IN_242X}, 512 RATE_IN_242X},
455 513
456 /* PRCM-VII (boot-bypass) */ 514 /* PRCM-VII (boot-bypass) */
457 {S13M, S13M, S13M, RVII_CM_CLKSEL_MPU_VAL, /* 13MHz ARM */ 515 {S13M, S13M, S13M, RVII_CM_CLKSEL_MPU_VAL, /* 13MHz ARM */
458 RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL, 516 RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
459 RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_13_VAL, 517 RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_13_VAL,
460 MX_CLKSEL2_PLL_2x_VAL, 0, V24XX_SDRC_RFR_CTRL_BYPASS, 518 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
461 RATE_IN_242X}, 519 RATE_IN_242X},
462 520
463 /* PRCM #3 - ratio2 (ES2) - FAST */ 521 /* PRCM #4 - ratio2 (ES2.1) - FAST */
464 {S13M, S660M, S330M, R2_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */ 522 {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* 399MHz ARM */
465 R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL, 523 R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
466 R2_CM_CLKSEL1_CORE_VAL, M3_CM_CLKSEL1_PLL_13_VAL, 524 R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
467 MX_CLKSEL2_PLL_2x_VAL, R2_CM_CLKSEL_MDM_VAL, 525 MX_CLKSEL2_PLL_2x_VAL, R2_CM_CLKSEL_MDM_VAL,
468 V24XX_SDRC_RFR_CTRL_110MHz, 526 SDRC_RFR_CTRL_133MHz,
527 RATE_IN_243X},
528
529 /* PRCM #2 - ratio1 (ES2) - FAST */
530 {S13M, S658M, S329M, R1_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */
531 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
532 R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
533 MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
534 SDRC_RFR_CTRL_165MHz,
469 RATE_IN_243X}, 535 RATE_IN_243X},
470 536
471 /* PRCM #5a - ratio1 - FAST */ 537 /* PRCM #5a - ratio1 - FAST */
@@ -473,7 +539,7 @@ static struct prcm_config rate_table[] = {
473 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL, 539 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
474 R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL, 540 R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
475 MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL, 541 MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
476 V24XX_SDRC_RFR_CTRL_133MHz, 542 SDRC_RFR_CTRL_133MHz,
477 RATE_IN_243X}, 543 RATE_IN_243X},
478 544
479 /* PRCM #5b - ratio1 - FAST */ 545 /* PRCM #5b - ratio1 - FAST */
@@ -481,15 +547,23 @@ static struct prcm_config rate_table[] = {
481 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL, 547 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
482 R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL, 548 R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
483 MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL, 549 MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
484 V24XX_SDRC_RFR_CTRL_100MHz, 550 SDRC_RFR_CTRL_100MHz,
485 RATE_IN_243X}, 551 RATE_IN_243X},
486 552
487 /* PRCM #3 - ratio2 (ES2) - SLOW */ 553 /* PRCM #4 - ratio1 (ES2.1) - SLOW */
488 {S13M, S330M, S165M, R2_CM_CLKSEL_MPU_VAL, /* 165MHz ARM */ 554 {S13M, S399M, S199M, R2_CM_CLKSEL_MPU_VAL, /* 200MHz ARM */
489 R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL, 555 R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
490 R2_CM_CLKSEL1_CORE_VAL, M3_CM_CLKSEL1_PLL_13_VAL, 556 R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
491 MX_CLKSEL2_PLL_1x_VAL, R2_CM_CLKSEL_MDM_VAL, 557 MX_CLKSEL2_PLL_1x_VAL, R2_CM_CLKSEL_MDM_VAL,
492 V24XX_SDRC_RFR_CTRL_110MHz, 558 SDRC_RFR_CTRL_133MHz,
559 RATE_IN_243X},
560
561 /* PRCM #2 - ratio1 (ES2) - SLOW */
562 {S13M, S329M, S164M, R1_CM_CLKSEL_MPU_VAL, /* 165MHz ARM */
563 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
564 R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
565 MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
566 SDRC_RFR_CTRL_165MHz,
493 RATE_IN_243X}, 567 RATE_IN_243X},
494 568
495 /* PRCM #5a - ratio1 - SLOW */ 569 /* PRCM #5a - ratio1 - SLOW */
@@ -497,7 +571,7 @@ static struct prcm_config rate_table[] = {
497 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL, 571 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
498 R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL, 572 R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
499 MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL, 573 MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
500 V24XX_SDRC_RFR_CTRL_133MHz, 574 SDRC_RFR_CTRL_133MHz,
501 RATE_IN_243X}, 575 RATE_IN_243X},
502 576
503 /* PRCM #5b - ratio1 - SLOW*/ 577 /* PRCM #5b - ratio1 - SLOW*/
@@ -505,7 +579,7 @@ static struct prcm_config rate_table[] = {
505 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL, 579 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
506 R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL, 580 R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
507 MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL, 581 MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
508 V24XX_SDRC_RFR_CTRL_100MHz, 582 SDRC_RFR_CTRL_100MHz,
509 RATE_IN_243X}, 583 RATE_IN_243X},
510 584
511 /* PRCM-boot/bypass */ 585 /* PRCM-boot/bypass */
@@ -513,7 +587,7 @@ static struct prcm_config rate_table[] = {
513 RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL, 587 RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
514 RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL, 588 RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL,
515 MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL, 589 MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
516 V24XX_SDRC_RFR_CTRL_BYPASS, 590 SDRC_RFR_CTRL_BYPASS,
517 RATE_IN_243X}, 591 RATE_IN_243X},
518 592
519 /* PRCM-boot/bypass */ 593 /* PRCM-boot/bypass */
@@ -521,7 +595,7 @@ static struct prcm_config rate_table[] = {
521 RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL, 595 RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
522 RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL, 596 RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL,
523 MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL, 597 MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
524 V24XX_SDRC_RFR_CTRL_BYPASS, 598 SDRC_RFR_CTRL_BYPASS,
525 RATE_IN_243X}, 599 RATE_IN_243X},
526 600
527 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 601 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -547,6 +621,7 @@ static struct prcm_config rate_table[] = {
547 * clocks. 621 * clocks.
548 *-------------------------------------------------------------------------*/ 622 *-------------------------------------------------------------------------*/
549 623
624#ifdef OLD_CK
550/* Base external input clocks */ 625/* Base external input clocks */
551static struct clk func_32k_ck = { 626static struct clk func_32k_ck = {
552 .name = "func_32k_ck", 627 .name = "func_32k_ck",
@@ -554,7 +629,7 @@ static struct clk func_32k_ck = {
554 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 629 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
555 RATE_FIXED | ALWAYS_ENABLED, 630 RATE_FIXED | ALWAYS_ENABLED,
556}; 631};
557 632#endif /* OLD_CK */
558/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ 633/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
559static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */ 634static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
560 .name = "osc_ck", 635 .name = "osc_ck",
@@ -570,10 +645,9 @@ static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */
570 .rate = 13000000, 645 .rate = 13000000,
571 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 646 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
572 RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES, 647 RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
573 .rate_offset = 6, /* sysclkdiv 1 or 2, already handled or no boot */
574 .recalc = &omap2_sys_clk_recalc, 648 .recalc = &omap2_sys_clk_recalc,
575}; 649};
576 650#ifdef OLD_CK
577static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ 651static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
578 .name = "alt_ck", 652 .name = "alt_ck",
579 .rate = 54000000, 653 .rate = 54000000,
@@ -581,29 +655,43 @@ static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
581 RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES, 655 RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
582 .recalc = &omap2_propagate_rate, 656 .recalc = &omap2_propagate_rate,
583}; 657};
584 658#endif /* OLD_CK */
585/* 659/*
586 * Analog domain root source clocks 660 * Analog domain root source clocks
587 */ 661 */
588 662
589/* dpll_ck, is broken out in to special cases through clksel */ 663/* dpll_ck, is broken out in to special cases through clksel */
664/* REVISIT: Rate changes on dpll_ck trigger a full set change. ...
665 * deal with this
666 */
667
668static const struct dpll_data dpll_dd = {
669 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
670 .mult_mask = OMAP24XX_DPLL_MULT_MASK,
671 .div1_mask = OMAP24XX_DPLL_DIV_MASK,
672};
673
590static struct clk dpll_ck = { 674static struct clk dpll_ck = {
591 .name = "dpll_ck", 675 .name = "dpll_ck",
592 .parent = &sys_ck, /* Can be func_32k also */ 676 .parent = &sys_ck, /* Can be func_32k also */
677 .dpll_data = &dpll_dd,
593 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 678 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
594 RATE_PROPAGATES | RATE_CKCTL | CM_PLL_SEL1, 679 RATE_PROPAGATES | ALWAYS_ENABLED,
595 .recalc = &omap2_clksel_recalc, 680 .recalc = &omap2_dpll_recalc,
681 .set_rate = &omap2_reprogram_dpll,
596}; 682};
597 683
598static struct clk apll96_ck = { 684static struct clk apll96_ck = {
599 .name = "apll96_ck", 685 .name = "apll96_ck",
600 .parent = &sys_ck, 686 .parent = &sys_ck,
601 .rate = 96000000, 687 .rate = 96000000,
602 .flags = CLOCK_IN_OMAP242X |CLOCK_IN_OMAP243X | 688 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
603 RATE_FIXED | RATE_PROPAGATES, 689 RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
604 .enable_reg = (void __iomem *)&CM_CLKEN_PLL, 690 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
605 .enable_bit = 0x2, 691 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
606 .recalc = &omap2_propagate_rate, 692 .enable = &omap2_clk_fixed_enable,
693 .disable = &omap2_clk_fixed_disable,
694 .recalc = &propagate_rate,
607}; 695};
608 696
609static struct clk apll54_ck = { 697static struct clk apll54_ck = {
@@ -611,15 +699,18 @@ static struct clk apll54_ck = {
611 .parent = &sys_ck, 699 .parent = &sys_ck,
612 .rate = 54000000, 700 .rate = 54000000,
613 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 701 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
614 RATE_FIXED | RATE_PROPAGATES, 702 RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
615 .enable_reg = (void __iomem *)&CM_CLKEN_PLL, 703 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
616 .enable_bit = 0x6, 704 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
617 .recalc = &omap2_propagate_rate, 705 .enable = &omap2_clk_fixed_enable,
706 .disable = &omap2_clk_fixed_disable,
707 .recalc = &propagate_rate,
618}; 708};
619 709
620/* 710/*
621 * PRCM digital base sources 711 * PRCM digital base sources
622 */ 712 */
713#ifdef OLD_CK
623static struct clk func_54m_ck = { 714static struct clk func_54m_ck = {
624 .name = "func_54m_ck", 715 .name = "func_54m_ck",
625 .parent = &apll54_ck, /* can also be alt_clk */ 716 .parent = &apll54_ck, /* can also be alt_clk */
@@ -631,15 +722,15 @@ static struct clk func_54m_ck = {
631 .enable_bit = 0xff, 722 .enable_bit = 0xff,
632 .recalc = &omap2_propagate_rate, 723 .recalc = &omap2_propagate_rate,
633}; 724};
634 725#endif /* OLD_CK */
635static struct clk core_ck = { 726static struct clk core_ck = {
636 .name = "core_ck", 727 .name = "core_ck",
637 .parent = &dpll_ck, /* can also be 32k */ 728 .parent = &dpll_ck, /* can also be 32k */
638 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 729 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
639 ALWAYS_ENABLED | RATE_PROPAGATES, 730 ALWAYS_ENABLED | RATE_PROPAGATES,
640 .recalc = &omap2_propagate_rate, 731 .recalc = &followparent_recalc,
641}; 732};
642 733#ifdef OLD_CK
643static struct clk sleep_ck = { /* sys_clk or 32k */ 734static struct clk sleep_ck = { /* sys_clk or 32k */
644 .name = "sleep_ck", 735 .name = "sleep_ck",
645 .parent = &func_32k_ck, 736 .parent = &func_32k_ck,
@@ -726,7 +817,7 @@ static struct clk emul_ck = {
726 .recalc = &omap2_propagate_rate, 817 .recalc = &omap2_propagate_rate,
727 818
728}; 819};
729 820#endif /* OLD_CK */
730/* 821/*
731 * MPU clock domain 822 * MPU clock domain
732 * Clocks: 823 * Clocks:
@@ -740,13 +831,17 @@ static struct clk emul_ck = {
740static struct clk mpu_ck = { /* Control cpu */ 831static struct clk mpu_ck = { /* Control cpu */
741 .name = "mpu_ck", 832 .name = "mpu_ck",
742 .parent = &core_ck, 833 .parent = &core_ck,
743 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_CKCTL | 834 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
744 ALWAYS_ENABLED | CM_MPU_SEL1 | DELAYED_APP | 835 ALWAYS_ENABLED | DELAYED_APP |
745 CONFIG_PARTICIPANT | RATE_PROPAGATES, 836 CONFIG_PARTICIPANT | RATE_PROPAGATES,
746 .rate_offset = 0, /* bits 0-4 */ 837 .init = &omap2_init_clksel_parent,
838 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
839 .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK,
747 .recalc = &omap2_clksel_recalc, 840 .recalc = &omap2_clksel_recalc,
841 .round_rate = &omap2_clksel_round_rate,
842 .set_rate = &omap2_clksel_set_rate
748}; 843};
749 844#ifdef OLD_CK
750/* 845/*
751 * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain 846 * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain
752 * Clocks: 847 * Clocks:
@@ -1933,7 +2028,7 @@ static struct clk mmchsdb2_fck = {
1933 .enable_bit = 17, 2028 .enable_bit = 17,
1934 .recalc = &omap2_followparent_recalc, 2029 .recalc = &omap2_followparent_recalc,
1935}; 2030};
1936 2031#endif /* OLD_CK */
1937/* 2032/*
1938 * This clock is a composite clock which does entire set changes then 2033 * This clock is a composite clock which does entire set changes then
1939 * forces a rebalance. It keys on the MPU speed, but it really could 2034 * forces a rebalance. It keys on the MPU speed, but it really could
@@ -1953,11 +2048,10 @@ static struct clk virt_prcm_set = {
1953 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 2048 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1954 VIRTUAL_CLOCK | ALWAYS_ENABLED | DELAYED_APP, 2049 VIRTUAL_CLOCK | ALWAYS_ENABLED | DELAYED_APP,
1955 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */ 2050 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
1956 .recalc = &omap2_mpu_recalc, /* sets are keyed on mpu rate */
1957 .set_rate = &omap2_select_table_rate, 2051 .set_rate = &omap2_select_table_rate,
1958 .round_rate = &omap2_round_to_table_rate, 2052 .round_rate = &omap2_round_to_table_rate,
1959}; 2053};
1960 2054#ifdef OLD_CK
1961static struct clk *onchip_clks[] = { 2055static struct clk *onchip_clks[] = {
1962 /* external root sources */ 2056 /* external root sources */
1963 &func_32k_ck, 2057 &func_32k_ck,
@@ -2107,5 +2201,17 @@ static struct clk *onchip_clks[] = {
2107 &mmchsdb1_fck, 2201 &mmchsdb1_fck,
2108 &mmchsdb2_fck, 2202 &mmchsdb2_fck,
2109}; 2203};
2204#endif /* OLD_CK */
2205
2206static struct clk *onchip_24xx_clks[] __initdata = {
2207 /* external root sources */
2208 &osc_ck,
2209 &sys_ck,
2210 /* internal analog sources */
2211 &dpll_ck,
2212 &apll96_ck,
2213 &apll54_ck,
2214};
2110 2215
2111#endif 2216#endif
2217