diff options
author | Paul Walmsley <paul@pwsan.com> | 2009-01-27 21:13:02 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-02-08 12:50:26 -0500 |
commit | 9cfd985e27bfdf1e120aecaf595db265f4b5eb27 (patch) | |
tree | 2c59a330bd0b5ca871744fb2f73932c691feb6d0 /arch/arm | |
parent | 207233533dd197457634810c6dc1b5d65ab6b8c7 (diff) |
[ARM] OMAP3 clock: fix 96MHz clocks
Fix some bugs in the OMAP3 clock tree pertaining to the 96MHz clocks.
The 96MHz portion of the clock tree should now have reasonable
fidelity to the 34xx TRM Rev I.
One remaining question mark: it's not clear exactly which 96MHz source
clock the USIM uses. This patch sticks with the previous setting, which
seems reasonable.
linux-omap source commit is 15c706e8179ce238c3ba70a25846a36b73bd2359.
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')
-rw-r--r-- | arch/arm/mach-omap2/clock34xx.h | 58 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cm-regbits-34xx.h | 8 |
2 files changed, 43 insertions, 23 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h index a2dcf574d98a..2c84717f9528 100644 --- a/arch/arm/mach-omap2/clock34xx.h +++ b/arch/arm/mach-omap2/clock34xx.h | |||
@@ -640,6 +640,12 @@ static const struct clksel omap_96m_alwon_fck_clksel[] = { | |||
640 | { .parent = NULL } | 640 | { .parent = NULL } |
641 | }; | 641 | }; |
642 | 642 | ||
643 | /* | ||
644 | * DPLL4 generates DPLL4_M2X2_CLK which is then routed into the PRM as | ||
645 | * PRM_96M_ALWON_(F)CLK. Two clocks then emerge from the PRM: | ||
646 | * 96M_ALWON_FCLK (called "omap_96m_alwon_fck" below) and | ||
647 | * CM_96K_(F)CLK. | ||
648 | */ | ||
643 | static struct clk omap_96m_alwon_fck = { | 649 | static struct clk omap_96m_alwon_fck = { |
644 | .name = "omap_96m_alwon_fck", | 650 | .name = "omap_96m_alwon_fck", |
645 | .ops = &clkops_null, | 651 | .ops = &clkops_null, |
@@ -652,28 +658,38 @@ static struct clk omap_96m_alwon_fck = { | |||
652 | .recalc = &omap2_clksel_recalc, | 658 | .recalc = &omap2_clksel_recalc, |
653 | }; | 659 | }; |
654 | 660 | ||
655 | static struct clk omap_96m_fck = { | 661 | static struct clk cm_96m_fck = { |
656 | .name = "omap_96m_fck", | 662 | .name = "cm_96m_fck", |
657 | .ops = &clkops_null, | 663 | .ops = &clkops_null, |
658 | .parent = &omap_96m_alwon_fck, | 664 | .parent = &omap_96m_alwon_fck, |
659 | .flags = RATE_PROPAGATES, | 665 | .flags = RATE_PROPAGATES, |
660 | .recalc = &followparent_recalc, | 666 | .recalc = &followparent_recalc, |
661 | }; | 667 | }; |
662 | 668 | ||
663 | static const struct clksel cm_96m_fck_clksel[] = { | 669 | static const struct clksel_rate omap_96m_dpll_rates[] = { |
664 | { .parent = &sys_ck, .rates = dpll_bypass_rates }, | 670 | { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, |
665 | { .parent = &dpll4_m2x2_ck, .rates = dpll_locked_rates }, | 671 | { .div = 0 } |
672 | }; | ||
673 | |||
674 | static const struct clksel_rate omap_96m_sys_rates[] = { | ||
675 | { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE }, | ||
676 | { .div = 0 } | ||
677 | }; | ||
678 | |||
679 | static const struct clksel omap_96m_fck_clksel[] = { | ||
680 | { .parent = &cm_96m_fck, .rates = omap_96m_dpll_rates }, | ||
681 | { .parent = &sys_ck, .rates = omap_96m_sys_rates }, | ||
666 | { .parent = NULL } | 682 | { .parent = NULL } |
667 | }; | 683 | }; |
668 | 684 | ||
669 | static struct clk cm_96m_fck = { | 685 | static struct clk omap_96m_fck = { |
670 | .name = "cm_96m_fck", | 686 | .name = "omap_96m_fck", |
671 | .ops = &clkops_null, | 687 | .ops = &clkops_null, |
672 | .parent = &dpll4_m2x2_ck, | 688 | .parent = &sys_ck, |
673 | .init = &omap2_init_clksel_parent, | 689 | .init = &omap2_init_clksel_parent, |
674 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | 690 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
675 | .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK, | 691 | .clksel_mask = OMAP3430_SOURCE_96M_MASK, |
676 | .clksel = cm_96m_fck_clksel, | 692 | .clksel = omap_96m_fck_clksel, |
677 | .flags = RATE_PROPAGATES, | 693 | .flags = RATE_PROPAGATES, |
678 | .recalc = &omap2_clksel_recalc, | 694 | .recalc = &omap2_clksel_recalc, |
679 | }; | 695 | }; |
@@ -742,13 +758,13 @@ static struct clk omap_54m_fck = { | |||
742 | .ops = &clkops_null, | 758 | .ops = &clkops_null, |
743 | .init = &omap2_init_clksel_parent, | 759 | .init = &omap2_init_clksel_parent, |
744 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 760 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
745 | .clksel_mask = OMAP3430_SOURCE_54M, | 761 | .clksel_mask = OMAP3430_SOURCE_54M_MASK, |
746 | .clksel = omap_54m_clksel, | 762 | .clksel = omap_54m_clksel, |
747 | .flags = RATE_PROPAGATES, | 763 | .flags = RATE_PROPAGATES, |
748 | .recalc = &omap2_clksel_recalc, | 764 | .recalc = &omap2_clksel_recalc, |
749 | }; | 765 | }; |
750 | 766 | ||
751 | static const struct clksel_rate omap_48m_96md2_rates[] = { | 767 | static const struct clksel_rate omap_48m_cm96m_rates[] = { |
752 | { .div = 2, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, | 768 | { .div = 2, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, |
753 | { .div = 0 } | 769 | { .div = 0 } |
754 | }; | 770 | }; |
@@ -759,7 +775,7 @@ static const struct clksel_rate omap_48m_alt_rates[] = { | |||
759 | }; | 775 | }; |
760 | 776 | ||
761 | static const struct clksel omap_48m_clksel[] = { | 777 | static const struct clksel omap_48m_clksel[] = { |
762 | { .parent = &cm_96m_fck, .rates = omap_48m_96md2_rates }, | 778 | { .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates }, |
763 | { .parent = &sys_altclk, .rates = omap_48m_alt_rates }, | 779 | { .parent = &sys_altclk, .rates = omap_48m_alt_rates }, |
764 | { .parent = NULL } | 780 | { .parent = NULL } |
765 | }; | 781 | }; |
@@ -769,7 +785,7 @@ static struct clk omap_48m_fck = { | |||
769 | .ops = &clkops_null, | 785 | .ops = &clkops_null, |
770 | .init = &omap2_init_clksel_parent, | 786 | .init = &omap2_init_clksel_parent, |
771 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | 787 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), |
772 | .clksel_mask = OMAP3430_SOURCE_48M, | 788 | .clksel_mask = OMAP3430_SOURCE_48M_MASK, |
773 | .clksel = omap_48m_clksel, | 789 | .clksel = omap_48m_clksel, |
774 | .flags = RATE_PROPAGATES, | 790 | .flags = RATE_PROPAGATES, |
775 | .recalc = &omap2_clksel_recalc, | 791 | .recalc = &omap2_clksel_recalc, |
@@ -958,10 +974,10 @@ static const struct clksel_rate clkout2_src_54m_rates[] = { | |||
958 | }; | 974 | }; |
959 | 975 | ||
960 | static const struct clksel clkout2_src_clksel[] = { | 976 | static const struct clksel clkout2_src_clksel[] = { |
961 | { .parent = &core_ck, .rates = clkout2_src_core_rates }, | 977 | { .parent = &core_ck, .rates = clkout2_src_core_rates }, |
962 | { .parent = &sys_ck, .rates = clkout2_src_sys_rates }, | 978 | { .parent = &sys_ck, .rates = clkout2_src_sys_rates }, |
963 | { .parent = &omap_96m_alwon_fck, .rates = clkout2_src_96m_rates }, | 979 | { .parent = &cm_96m_fck, .rates = clkout2_src_96m_rates }, |
964 | { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates }, | 980 | { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates }, |
965 | { .parent = NULL } | 981 | { .parent = NULL } |
966 | }; | 982 | }; |
967 | 983 | ||
@@ -2782,8 +2798,8 @@ static struct clk mcbsp4_ick = { | |||
2782 | }; | 2798 | }; |
2783 | 2799 | ||
2784 | static const struct clksel mcbsp_234_clksel[] = { | 2800 | static const struct clksel mcbsp_234_clksel[] = { |
2785 | { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates }, | 2801 | { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates }, |
2786 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, | 2802 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, |
2787 | { .parent = NULL } | 2803 | { .parent = NULL } |
2788 | }; | 2804 | }; |
2789 | 2805 | ||
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h index 219f5c8d9659..a46f93c399da 100644 --- a/arch/arm/mach-omap2/cm-regbits-34xx.h +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h | |||
@@ -449,8 +449,12 @@ | |||
449 | #define OMAP3430_CORE_DPLL_MULT_MASK (0x7ff << 16) | 449 | #define OMAP3430_CORE_DPLL_MULT_MASK (0x7ff << 16) |
450 | #define OMAP3430_CORE_DPLL_DIV_SHIFT 8 | 450 | #define OMAP3430_CORE_DPLL_DIV_SHIFT 8 |
451 | #define OMAP3430_CORE_DPLL_DIV_MASK (0x7f << 8) | 451 | #define OMAP3430_CORE_DPLL_DIV_MASK (0x7f << 8) |
452 | #define OMAP3430_SOURCE_54M (1 << 5) | 452 | #define OMAP3430_SOURCE_96M_SHIFT 6 |
453 | #define OMAP3430_SOURCE_48M (1 << 3) | 453 | #define OMAP3430_SOURCE_96M_MASK (1 << 6) |
454 | #define OMAP3430_SOURCE_54M_SHIFT 5 | ||
455 | #define OMAP3430_SOURCE_54M_MASK (1 << 5) | ||
456 | #define OMAP3430_SOURCE_48M_SHIFT 3 | ||
457 | #define OMAP3430_SOURCE_48M_MASK (1 << 3) | ||
454 | 458 | ||
455 | /* CM_CLKSEL2_PLL */ | 459 | /* CM_CLKSEL2_PLL */ |
456 | #define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8 | 460 | #define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8 |