aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/clock.c')
-rw-r--r--arch/arm/mach-omap2/clock.c76
1 files changed, 69 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 591581a66532..5a0cac93d9ec 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -47,6 +47,24 @@
47u16 cpu_mask; 47u16 cpu_mask;
48 48
49/* 49/*
50 * Clock features setup. Used instead of CPU type checks.
51 */
52struct ti_clk_features ti_clk_features;
53
54/* DPLL valid Fint frequency band limits - from 34xx TRM Section 4.7.6.2 */
55#define OMAP3430_DPLL_FINT_BAND1_MIN 750000
56#define OMAP3430_DPLL_FINT_BAND1_MAX 2100000
57#define OMAP3430_DPLL_FINT_BAND2_MIN 7500000
58#define OMAP3430_DPLL_FINT_BAND2_MAX 21000000
59
60/*
61 * DPLL valid Fint frequency range for OMAP36xx and OMAP4xxx.
62 * From device data manual section 4.3 "DPLL and DLL Specifications".
63 */
64#define OMAP3PLUS_DPLL_FINT_MIN 32000
65#define OMAP3PLUS_DPLL_FINT_MAX 52000000
66
67/*
50 * clkdm_control: if true, then when a clock is enabled in the 68 * clkdm_control: if true, then when a clock is enabled in the
51 * hardware, its clockdomain will first be enabled; and when a clock 69 * hardware, its clockdomain will first be enabled; and when a clock
52 * is disabled in the hardware, its clockdomain will be disabled 70 * is disabled in the hardware, its clockdomain will be disabled
@@ -287,13 +305,7 @@ void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,
287 * 34xx reverses this, just to keep us on our toes 305 * 34xx reverses this, just to keep us on our toes
288 * AM35xx uses both, depending on the module. 306 * AM35xx uses both, depending on the module.
289 */ 307 */
290 if (cpu_is_omap24xx()) 308 *idlest_val = ti_clk_features.cm_idlest_val;
291 *idlest_val = OMAP24XX_CM_IDLEST_VAL;
292 else if (cpu_is_omap34xx())
293 *idlest_val = OMAP34XX_CM_IDLEST_VAL;
294 else
295 BUG();
296
297} 309}
298 310
299/** 311/**
@@ -731,3 +743,53 @@ void __init omap2_clk_print_new_rates(const char *hfclkin_ck_name,
731 (clk_get_rate(core_ck) / 1000000), 743 (clk_get_rate(core_ck) / 1000000),
732 (clk_get_rate(mpu_ck) / 1000000)); 744 (clk_get_rate(mpu_ck) / 1000000));
733} 745}
746
747/**
748 * ti_clk_init_features - init clock features struct for the SoC
749 *
750 * Initializes the clock features struct based on the SoC type.
751 */
752void __init ti_clk_init_features(void)
753{
754 /* Fint setup for DPLLs */
755 if (cpu_is_omap3430()) {
756 ti_clk_features.fint_min = OMAP3430_DPLL_FINT_BAND1_MIN;
757 ti_clk_features.fint_max = OMAP3430_DPLL_FINT_BAND2_MAX;
758 ti_clk_features.fint_band1_max = OMAP3430_DPLL_FINT_BAND1_MAX;
759 ti_clk_features.fint_band2_min = OMAP3430_DPLL_FINT_BAND2_MIN;
760 } else {
761 ti_clk_features.fint_min = OMAP3PLUS_DPLL_FINT_MIN;
762 ti_clk_features.fint_max = OMAP3PLUS_DPLL_FINT_MAX;
763 }
764
765 /* Bypass value setup for DPLLs */
766 if (cpu_is_omap24xx()) {
767 ti_clk_features.dpll_bypass_vals |=
768 (1 << OMAP2XXX_EN_DPLL_LPBYPASS) |
769 (1 << OMAP2XXX_EN_DPLL_FRBYPASS);
770 } else if (cpu_is_omap34xx()) {
771 ti_clk_features.dpll_bypass_vals |=
772 (1 << OMAP3XXX_EN_DPLL_LPBYPASS) |
773 (1 << OMAP3XXX_EN_DPLL_FRBYPASS);
774 } else if (soc_is_am33xx() || cpu_is_omap44xx() || soc_is_am43xx() ||
775 soc_is_omap54xx() || soc_is_dra7xx()) {
776 ti_clk_features.dpll_bypass_vals |=
777 (1 << OMAP4XXX_EN_DPLL_LPBYPASS) |
778 (1 << OMAP4XXX_EN_DPLL_FRBYPASS) |
779 (1 << OMAP4XXX_EN_DPLL_MNBYPASS);
780 }
781
782 /* Jitter correction only available on OMAP343X */
783 if (cpu_is_omap343x())
784 ti_clk_features.flags |= TI_CLK_DPLL_HAS_FREQSEL;
785
786 /* Idlest value for interface clocks.
787 * 24xx uses 0 to indicate not ready, and 1 to indicate ready.
788 * 34xx reverses this, just to keep us on our toes
789 * AM35xx uses both, depending on the module.
790 */
791 if (cpu_is_omap24xx())
792 ti_clk_features.cm_idlest_val = OMAP24XX_CM_IDLEST_VAL;
793 else if (cpu_is_omap34xx())
794 ti_clk_features.cm_idlest_val = OMAP34XX_CM_IDLEST_VAL;
795}