aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock34xx.h
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2009-01-27 21:12:47 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-08 12:50:24 -0500
commit16c90f020034d3cd38b3dab280001e728e6b19e5 (patch)
tree71b142bdf83578688b4844b0b65414f2b3d6c3df /arch/arm/mach-omap2/clock34xx.h
parent6f7607ccd175518a3ee7dccc1620f3a086689668 (diff)
[ARM] OMAP2/3: Add non-CORE DPLL rate set code and M, N programming
Add non-CORE DPLL rate set code and M,N programming for OMAP3. Connect it to OMAP34xx DPLLs 1, 2, 4, 5 via the clock framework. You may see some warnings on rate sets from the freqsel code. The table that TI presented in the 3430 TRM Rev F does not cover Fint < 750000, which definitely occurs in practice. However, the lack of this freqsel case does not appear to impair the DPLL rate change. linux-omap source commit is 689fe67c6d1ad8f52f7f7b139a3274b79bf3e784. Signed-off-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap2/clock34xx.h')
-rw-r--r--arch/arm/mach-omap2/clock34xx.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index 6bd8c6d5a4e7..f811a0978512 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -32,6 +32,8 @@ static void omap3_clkoutx2_recalc(struct clk *clk);
32static void omap3_dpll_allow_idle(struct clk *clk); 32static void omap3_dpll_allow_idle(struct clk *clk);
33static void omap3_dpll_deny_idle(struct clk *clk); 33static void omap3_dpll_deny_idle(struct clk *clk);
34static u32 omap3_dpll_autoidle_read(struct clk *clk); 34static u32 omap3_dpll_autoidle_read(struct clk *clk);
35static int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate);
36static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate);
35 37
36/* Maximum DPLL multiplier, divider values for OMAP3 */ 38/* Maximum DPLL multiplier, divider values for OMAP3 */
37#define OMAP3_MAX_DPLL_MULT 2048 39#define OMAP3_MAX_DPLL_MULT 2048
@@ -254,6 +256,7 @@ static struct dpll_data dpll1_dd = {
254 .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL), 256 .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
255 .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK, 257 .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK,
256 .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK, 258 .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK,
259 .freqsel_mask = OMAP3430_MPU_DPLL_FREQSEL_MASK,
257 .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL), 260 .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
258 .enable_mask = OMAP3430_EN_MPU_DPLL_MASK, 261 .enable_mask = OMAP3430_EN_MPU_DPLL_MASK,
259 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), 262 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
@@ -276,6 +279,7 @@ static struct clk dpll1_ck = {
276 .dpll_data = &dpll1_dd, 279 .dpll_data = &dpll1_dd,
277 .flags = RATE_PROPAGATES, 280 .flags = RATE_PROPAGATES,
278 .round_rate = &omap2_dpll_round_rate, 281 .round_rate = &omap2_dpll_round_rate,
282 .set_rate = &omap3_noncore_dpll_set_rate,
279 .recalc = &omap3_dpll_recalc, 283 .recalc = &omap3_dpll_recalc,
280}; 284};
281 285
@@ -321,6 +325,7 @@ static struct dpll_data dpll2_dd = {
321 .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL), 325 .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
322 .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK, 326 .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK,
323 .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK, 327 .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK,
328 .freqsel_mask = OMAP3430_IVA2_DPLL_FREQSEL_MASK,
324 .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL), 329 .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
325 .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK, 330 .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK,
326 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) | 331 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
@@ -344,6 +349,7 @@ static struct clk dpll2_ck = {
344 .dpll_data = &dpll2_dd, 349 .dpll_data = &dpll2_dd,
345 .flags = RATE_PROPAGATES, 350 .flags = RATE_PROPAGATES,
346 .round_rate = &omap2_dpll_round_rate, 351 .round_rate = &omap2_dpll_round_rate,
352 .set_rate = &omap3_noncore_dpll_set_rate,
347 .recalc = &omap3_dpll_recalc, 353 .recalc = &omap3_dpll_recalc,
348}; 354};
349 355
@@ -378,6 +384,7 @@ static struct dpll_data dpll3_dd = {
378 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), 384 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
379 .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK, 385 .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK,
380 .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK, 386 .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK,
387 .freqsel_mask = OMAP3430_CORE_DPLL_FREQSEL_MASK,
381 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 388 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
382 .enable_mask = OMAP3430_EN_CORE_DPLL_MASK, 389 .enable_mask = OMAP3430_EN_CORE_DPLL_MASK,
383 .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT, 390 .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT,
@@ -558,6 +565,7 @@ static struct dpll_data dpll4_dd = {
558 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2), 565 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
559 .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK, 566 .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK,
560 .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK, 567 .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK,
568 .freqsel_mask = OMAP3430_PERIPH_DPLL_FREQSEL_MASK,
561 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 569 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
562 .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK, 570 .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK,
563 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED), 571 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
@@ -580,6 +588,7 @@ static struct clk dpll4_ck = {
580 .dpll_data = &dpll4_dd, 588 .dpll_data = &dpll4_dd,
581 .flags = RATE_PROPAGATES, 589 .flags = RATE_PROPAGATES,
582 .round_rate = &omap2_dpll_round_rate, 590 .round_rate = &omap2_dpll_round_rate,
591 .set_rate = &omap3_dpll4_set_rate,
583 .recalc = &omap3_dpll_recalc, 592 .recalc = &omap3_dpll_recalc,
584}; 593};
585 594
@@ -864,6 +873,7 @@ static struct dpll_data dpll5_dd = {
864 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4), 873 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4),
865 .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK, 874 .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK,
866 .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK, 875 .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK,
876 .freqsel_mask = OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
867 .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2), 877 .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
868 .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK, 878 .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
869 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED), 879 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
@@ -886,6 +896,7 @@ static struct clk dpll5_ck = {
886 .dpll_data = &dpll5_dd, 896 .dpll_data = &dpll5_dd,
887 .flags = RATE_PROPAGATES, 897 .flags = RATE_PROPAGATES,
888 .round_rate = &omap2_dpll_round_rate, 898 .round_rate = &omap2_dpll_round_rate,
899 .set_rate = &omap3_noncore_dpll_set_rate,
889 .recalc = &omap3_dpll_recalc, 900 .recalc = &omap3_dpll_recalc,
890}; 901};
891 902