diff options
author | Tony Lindgren <tony@atomide.com> | 2014-07-21 03:35:38 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2014-07-21 03:35:38 -0400 |
commit | 3db53918e306d3960bf9e12eea8b2fd3f7d0fd62 (patch) | |
tree | d56a3628dd3f87b243bdf27267091508bcaf0db5 | |
parent | 81c6d80661e07d1ecd6c6ac6b7136edac5209bab (diff) | |
parent | acd052bb8119dd9117e0af48ff0ac6e56e61b6b4 (diff) |
Merge tag 'for-v3.17/omap-clock-a' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into omap-for-v3.17/soc
An OMAP clock cleanup series for 3.17 from Tero Kristo.
This is in preparation for moving this code into drivers/clk/ti.
Basic build, boot, and PM test logs are here:
http://www.pwsan.com/omap/testlogs/clock-a-v3.17/20140717034329/
-rw-r--r-- | arch/arm/mach-omap2/clkt_dpll.c | 98 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clkt_iclk.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 76 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.h | 44 | ||||
-rw-r--r-- | arch/arm/mach-omap2/dpll3xxx.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-omap2/dpll44xx.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-omap2/io.c | 2 |
7 files changed, 154 insertions, 100 deletions
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index 332af927f4d3..3c34df0f1531 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c | |||
@@ -21,10 +21,7 @@ | |||
21 | 21 | ||
22 | #include <asm/div64.h> | 22 | #include <asm/div64.h> |
23 | 23 | ||
24 | #include "soc.h" | ||
25 | #include "clock.h" | 24 | #include "clock.h" |
26 | #include "cm-regbits-24xx.h" | ||
27 | #include "cm-regbits-34xx.h" | ||
28 | 25 | ||
29 | /* DPLL rate rounding: minimum DPLL multiplier, divider values */ | 26 | /* DPLL rate rounding: minimum DPLL multiplier, divider values */ |
30 | #define DPLL_MIN_MULTIPLIER 2 | 27 | #define DPLL_MIN_MULTIPLIER 2 |
@@ -44,20 +41,12 @@ | |||
44 | #define DPLL_ROUNDING_VAL ((DPLL_SCALE_BASE / 2) * \ | 41 | #define DPLL_ROUNDING_VAL ((DPLL_SCALE_BASE / 2) * \ |
45 | (DPLL_SCALE_FACTOR / DPLL_SCALE_BASE)) | 42 | (DPLL_SCALE_FACTOR / DPLL_SCALE_BASE)) |
46 | 43 | ||
47 | /* DPLL valid Fint frequency band limits - from 34xx TRM Section 4.7.6.2 */ | ||
48 | #define OMAP3430_DPLL_FINT_BAND1_MIN 750000 | ||
49 | #define OMAP3430_DPLL_FINT_BAND1_MAX 2100000 | ||
50 | #define OMAP3430_DPLL_FINT_BAND2_MIN 7500000 | ||
51 | #define OMAP3430_DPLL_FINT_BAND2_MAX 21000000 | ||
52 | |||
53 | /* | 44 | /* |
54 | * DPLL valid Fint frequency range for OMAP36xx and OMAP4xxx. | 45 | * DPLL valid Fint frequency range for OMAP36xx and OMAP4xxx. |
55 | * From device data manual section 4.3 "DPLL and DLL Specifications". | 46 | * From device data manual section 4.3 "DPLL and DLL Specifications". |
56 | */ | 47 | */ |
57 | #define OMAP3PLUS_DPLL_FINT_JTYPE_MIN 500000 | 48 | #define OMAP3PLUS_DPLL_FINT_JTYPE_MIN 500000 |
58 | #define OMAP3PLUS_DPLL_FINT_JTYPE_MAX 2500000 | 49 | #define OMAP3PLUS_DPLL_FINT_JTYPE_MAX 2500000 |
59 | #define OMAP3PLUS_DPLL_FINT_MIN 32000 | ||
60 | #define OMAP3PLUS_DPLL_FINT_MAX 52000000 | ||
61 | 50 | ||
62 | /* _dpll_test_fint() return codes */ | 51 | /* _dpll_test_fint() return codes */ |
63 | #define DPLL_FINT_UNDERFLOW -1 | 52 | #define DPLL_FINT_UNDERFLOW -1 |
@@ -87,33 +76,31 @@ static int _dpll_test_fint(struct clk_hw_omap *clk, u8 n) | |||
87 | /* DPLL divider must result in a valid jitter correction val */ | 76 | /* DPLL divider must result in a valid jitter correction val */ |
88 | fint = __clk_get_rate(__clk_get_parent(clk->hw.clk)) / n; | 77 | fint = __clk_get_rate(__clk_get_parent(clk->hw.clk)) / n; |
89 | 78 | ||
90 | if (cpu_is_omap24xx()) { | 79 | if (dd->flags & DPLL_J_TYPE) { |
91 | /* Should not be called for OMAP2, so warn if it is called */ | ||
92 | WARN(1, "No fint limits available for OMAP2!\n"); | ||
93 | return DPLL_FINT_INVALID; | ||
94 | } else if (cpu_is_omap3430()) { | ||
95 | fint_min = OMAP3430_DPLL_FINT_BAND1_MIN; | ||
96 | fint_max = OMAP3430_DPLL_FINT_BAND2_MAX; | ||
97 | } else if (dd->flags & DPLL_J_TYPE) { | ||
98 | fint_min = OMAP3PLUS_DPLL_FINT_JTYPE_MIN; | 80 | fint_min = OMAP3PLUS_DPLL_FINT_JTYPE_MIN; |
99 | fint_max = OMAP3PLUS_DPLL_FINT_JTYPE_MAX; | 81 | fint_max = OMAP3PLUS_DPLL_FINT_JTYPE_MAX; |
100 | } else { | 82 | } else { |
101 | fint_min = OMAP3PLUS_DPLL_FINT_MIN; | 83 | fint_min = ti_clk_features.fint_min; |
102 | fint_max = OMAP3PLUS_DPLL_FINT_MAX; | 84 | fint_max = ti_clk_features.fint_max; |
103 | } | 85 | } |
104 | 86 | ||
105 | if (fint < fint_min) { | 87 | if (!fint_min || !fint_max) { |
88 | WARN(1, "No fint limits available!\n"); | ||
89 | return DPLL_FINT_INVALID; | ||
90 | } | ||
91 | |||
92 | if (fint < ti_clk_features.fint_min) { | ||
106 | pr_debug("rejecting n=%d due to Fint failure, lowering max_divider\n", | 93 | pr_debug("rejecting n=%d due to Fint failure, lowering max_divider\n", |
107 | n); | 94 | n); |
108 | dd->max_divider = n; | 95 | dd->max_divider = n; |
109 | ret = DPLL_FINT_UNDERFLOW; | 96 | ret = DPLL_FINT_UNDERFLOW; |
110 | } else if (fint > fint_max) { | 97 | } else if (fint > ti_clk_features.fint_max) { |
111 | pr_debug("rejecting n=%d due to Fint failure, boosting min_divider\n", | 98 | pr_debug("rejecting n=%d due to Fint failure, boosting min_divider\n", |
112 | n); | 99 | n); |
113 | dd->min_divider = n; | 100 | dd->min_divider = n; |
114 | ret = DPLL_FINT_INVALID; | 101 | ret = DPLL_FINT_INVALID; |
115 | } else if (cpu_is_omap3430() && fint > OMAP3430_DPLL_FINT_BAND1_MAX && | 102 | } else if (fint > ti_clk_features.fint_band1_max && |
116 | fint < OMAP3430_DPLL_FINT_BAND2_MIN) { | 103 | fint < ti_clk_features.fint_band2_min) { |
117 | pr_debug("rejecting n=%d due to Fint failure\n", n); | 104 | pr_debug("rejecting n=%d due to Fint failure\n", n); |
118 | ret = DPLL_FINT_INVALID; | 105 | ret = DPLL_FINT_INVALID; |
119 | } | 106 | } |
@@ -185,6 +172,34 @@ static int _dpll_test_mult(int *m, int n, unsigned long *new_rate, | |||
185 | return r; | 172 | return r; |
186 | } | 173 | } |
187 | 174 | ||
175 | /** | ||
176 | * _omap2_dpll_is_in_bypass - check if DPLL is in bypass mode or not | ||
177 | * @v: bitfield value of the DPLL enable | ||
178 | * | ||
179 | * Checks given DPLL enable bitfield to see whether the DPLL is in bypass | ||
180 | * mode or not. Returns 1 if the DPLL is in bypass, 0 otherwise. | ||
181 | */ | ||
182 | static int _omap2_dpll_is_in_bypass(u32 v) | ||
183 | { | ||
184 | u8 mask, val; | ||
185 | |||
186 | mask = ti_clk_features.dpll_bypass_vals; | ||
187 | |||
188 | /* | ||
189 | * Each set bit in the mask corresponds to a bypass value equal | ||
190 | * to the bitshift. Go through each set-bit in the mask and | ||
191 | * compare against the given register value. | ||
192 | */ | ||
193 | while (mask) { | ||
194 | val = __ffs(mask); | ||
195 | mask ^= (1 << val); | ||
196 | if (v == val) | ||
197 | return 1; | ||
198 | } | ||
199 | |||
200 | return 0; | ||
201 | } | ||
202 | |||
188 | /* Public functions */ | 203 | /* Public functions */ |
189 | u8 omap2_init_dpll_parent(struct clk_hw *hw) | 204 | u8 omap2_init_dpll_parent(struct clk_hw *hw) |
190 | { | 205 | { |
@@ -201,20 +216,9 @@ u8 omap2_init_dpll_parent(struct clk_hw *hw) | |||
201 | v >>= __ffs(dd->enable_mask); | 216 | v >>= __ffs(dd->enable_mask); |
202 | 217 | ||
203 | /* Reparent the struct clk in case the dpll is in bypass */ | 218 | /* Reparent the struct clk in case the dpll is in bypass */ |
204 | if (cpu_is_omap24xx()) { | 219 | if (_omap2_dpll_is_in_bypass(v)) |
205 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | 220 | return 1; |
206 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | 221 | |
207 | return 1; | ||
208 | } else if (cpu_is_omap34xx()) { | ||
209 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | ||
210 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | ||
211 | return 1; | ||
212 | } else if (soc_is_am33xx() || cpu_is_omap44xx() || soc_is_am43xx()) { | ||
213 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | ||
214 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | ||
215 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | ||
216 | return 1; | ||
217 | } | ||
218 | return 0; | 222 | return 0; |
219 | } | 223 | } |
220 | 224 | ||
@@ -247,20 +251,8 @@ unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk) | |||
247 | v &= dd->enable_mask; | 251 | v &= dd->enable_mask; |
248 | v >>= __ffs(dd->enable_mask); | 252 | v >>= __ffs(dd->enable_mask); |
249 | 253 | ||
250 | if (cpu_is_omap24xx()) { | 254 | if (_omap2_dpll_is_in_bypass(v)) |
251 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | 255 | return __clk_get_rate(dd->clk_bypass); |
252 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | ||
253 | return __clk_get_rate(dd->clk_bypass); | ||
254 | } else if (cpu_is_omap34xx()) { | ||
255 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | ||
256 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | ||
257 | return __clk_get_rate(dd->clk_bypass); | ||
258 | } else if (soc_is_am33xx() || cpu_is_omap44xx() || soc_is_am43xx()) { | ||
259 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | ||
260 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | ||
261 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | ||
262 | return __clk_get_rate(dd->clk_bypass); | ||
263 | } | ||
264 | 256 | ||
265 | v = omap2_clk_readl(clk, dd->mult_div1_reg); | 257 | v = omap2_clk_readl(clk, dd->mult_div1_reg); |
266 | dpll_mult = v & dd->mult_mask; | 258 | dpll_mult = v & dd->mult_mask; |
diff --git a/arch/arm/mach-omap2/clkt_iclk.c b/arch/arm/mach-omap2/clkt_iclk.c index 333f0a666171..55eb579aeae1 100644 --- a/arch/arm/mach-omap2/clkt_iclk.c +++ b/arch/arm/mach-omap2/clkt_iclk.c | |||
@@ -14,11 +14,11 @@ | |||
14 | #include <linux/clk-provider.h> | 14 | #include <linux/clk-provider.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | 16 | ||
17 | |||
18 | #include "clock.h" | 17 | #include "clock.h" |
19 | #include "clock2xxx.h" | 18 | |
20 | #include "cm2xxx_3xxx.h" | 19 | /* Register offsets */ |
21 | #include "cm-regbits-24xx.h" | 20 | #define CM_AUTOIDLE 0x30 |
21 | #define CM_ICLKEN 0x10 | ||
22 | 22 | ||
23 | /* Private functions */ | 23 | /* Private functions */ |
24 | 24 | ||
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 @@ | |||
47 | u16 cpu_mask; | 47 | u16 cpu_mask; |
48 | 48 | ||
49 | /* | 49 | /* |
50 | * Clock features setup. Used instead of CPU type checks. | ||
51 | */ | ||
52 | struct 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 | */ | ||
752 | void __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 | } | ||
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 12f54d428d7c..0f100dc4e97f 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -101,31 +101,6 @@ struct clockdomain; | |||
101 | }; \ | 101 | }; \ |
102 | DEFINE_STRUCT_CLK(_name, _parent_names, _ops); | 102 | DEFINE_STRUCT_CLK(_name, _parent_names, _ops); |
103 | 103 | ||
104 | #define DEFINE_CLK_OMAP_HSDIVIDER(_name, _parent_name, \ | ||
105 | _parent_ptr, _flags, \ | ||
106 | _clksel_reg, _clksel_mask) \ | ||
107 | static const struct clksel _name##_div[] = { \ | ||
108 | { \ | ||
109 | .parent = _parent_ptr, \ | ||
110 | .rates = div31_1to31_rates \ | ||
111 | }, \ | ||
112 | { .parent = NULL }, \ | ||
113 | }; \ | ||
114 | static struct clk _name; \ | ||
115 | static const char *_name##_parent_names[] = { \ | ||
116 | _parent_name, \ | ||
117 | }; \ | ||
118 | static struct clk_hw_omap _name##_hw = { \ | ||
119 | .hw = { \ | ||
120 | .clk = &_name, \ | ||
121 | }, \ | ||
122 | .clksel = _name##_div, \ | ||
123 | .clksel_reg = _clksel_reg, \ | ||
124 | .clksel_mask = _clksel_mask, \ | ||
125 | .ops = &clkhwops_omap4_dpllmx, \ | ||
126 | }; \ | ||
127 | DEFINE_STRUCT_CLK(_name, _name##_parent_names, omap_hsdivider_ops); | ||
128 | |||
129 | /* struct clksel_rate.flags possibilities */ | 104 | /* struct clksel_rate.flags possibilities */ |
130 | #define RATE_IN_242X (1 << 0) | 105 | #define RATE_IN_242X (1 << 0) |
131 | #define RATE_IN_243X (1 << 1) | 106 | #define RATE_IN_243X (1 << 1) |
@@ -248,6 +223,23 @@ void omap2_clk_writel(u32 val, struct clk_hw_omap *clk, void __iomem *reg); | |||
248 | 223 | ||
249 | extern u16 cpu_mask; | 224 | extern u16 cpu_mask; |
250 | 225 | ||
226 | /* | ||
227 | * Clock features setup. Used instead of CPU type checks. | ||
228 | */ | ||
229 | struct ti_clk_features { | ||
230 | u32 flags; | ||
231 | long fint_min; | ||
232 | long fint_max; | ||
233 | long fint_band1_max; | ||
234 | long fint_band2_min; | ||
235 | u8 dpll_bypass_vals; | ||
236 | u8 cm_idlest_val; | ||
237 | }; | ||
238 | |||
239 | #define TI_CLK_DPLL_HAS_FREQSEL (1 << 0) | ||
240 | |||
241 | extern struct ti_clk_features ti_clk_features; | ||
242 | |||
251 | extern const struct clkops clkops_omap2_dflt_wait; | 243 | extern const struct clkops clkops_omap2_dflt_wait; |
252 | extern const struct clkops clkops_dummy; | 244 | extern const struct clkops clkops_dummy; |
253 | extern const struct clkops clkops_omap2_dflt; | 245 | extern const struct clkops clkops_omap2_dflt; |
@@ -286,4 +278,6 @@ extern int omap2_clkops_enable_clkdm(struct clk_hw *hw); | |||
286 | extern void omap2_clkops_disable_clkdm(struct clk_hw *hw); | 278 | extern void omap2_clkops_disable_clkdm(struct clk_hw *hw); |
287 | 279 | ||
288 | extern void omap_clocks_register(struct omap_clk *oclks, int cnt); | 280 | extern void omap_clocks_register(struct omap_clk *oclks, int cnt); |
281 | |||
282 | void __init ti_clk_init_features(void); | ||
289 | #endif | 283 | #endif |
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index 6d7ba37e2257..cd5f3a0b97bd 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -28,11 +28,8 @@ | |||
28 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
29 | #include <linux/clkdev.h> | 29 | #include <linux/clkdev.h> |
30 | 30 | ||
31 | #include "soc.h" | ||
32 | #include "clockdomain.h" | 31 | #include "clockdomain.h" |
33 | #include "clock.h" | 32 | #include "clock.h" |
34 | #include "cm2xxx_3xxx.h" | ||
35 | #include "cm-regbits-34xx.h" | ||
36 | 33 | ||
37 | /* CM_AUTOIDLE_PLL*.AUTO_* bit values */ | 34 | /* CM_AUTOIDLE_PLL*.AUTO_* bit values */ |
38 | #define DPLL_AUTOIDLE_DISABLE 0x0 | 35 | #define DPLL_AUTOIDLE_DISABLE 0x0 |
@@ -310,7 +307,7 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel) | |||
310 | * Set jitter correction. Jitter correction applicable for OMAP343X | 307 | * Set jitter correction. Jitter correction applicable for OMAP343X |
311 | * only since freqsel field is no longer present on other devices. | 308 | * only since freqsel field is no longer present on other devices. |
312 | */ | 309 | */ |
313 | if (cpu_is_omap343x()) { | 310 | if (ti_clk_features.flags & TI_CLK_DPLL_HAS_FREQSEL) { |
314 | v = omap2_clk_readl(clk, dd->control_reg); | 311 | v = omap2_clk_readl(clk, dd->control_reg); |
315 | v &= ~dd->freqsel_mask; | 312 | v &= ~dd->freqsel_mask; |
316 | v |= freqsel << __ffs(dd->freqsel_mask); | 313 | v |= freqsel << __ffs(dd->freqsel_mask); |
@@ -512,7 +509,7 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate, | |||
512 | return -EINVAL; | 509 | return -EINVAL; |
513 | 510 | ||
514 | /* Freqsel is available only on OMAP343X devices */ | 511 | /* Freqsel is available only on OMAP343X devices */ |
515 | if (cpu_is_omap343x()) { | 512 | if (ti_clk_features.flags & TI_CLK_DPLL_HAS_FREQSEL) { |
516 | freqsel = _omap3_dpll_compute_freqsel(clk, | 513 | freqsel = _omap3_dpll_compute_freqsel(clk, |
517 | dd->last_rounded_n); | 514 | dd->last_rounded_n); |
518 | WARN_ON(!freqsel); | 515 | WARN_ON(!freqsel); |
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c index 52f9438b92f2..4613f1e86988 100644 --- a/arch/arm/mach-omap2/dpll44xx.c +++ b/arch/arm/mach-omap2/dpll44xx.c | |||
@@ -15,10 +15,7 @@ | |||
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/bitops.h> | 16 | #include <linux/bitops.h> |
17 | 17 | ||
18 | #include "soc.h" | ||
19 | #include "clock.h" | 18 | #include "clock.h" |
20 | #include "clock44xx.h" | ||
21 | #include "cm-regbits-44xx.h" | ||
22 | 19 | ||
23 | /* | 20 | /* |
24 | * Maximum DPLL input frequency (FINT) and output frequency (FOUT) that | 21 | * Maximum DPLL input frequency (FINT) and output frequency (FOUT) that |
@@ -29,13 +26,23 @@ | |||
29 | #define OMAP4_DPLL_LP_FINT_MAX 1000000 | 26 | #define OMAP4_DPLL_LP_FINT_MAX 1000000 |
30 | #define OMAP4_DPLL_LP_FOUT_MAX 100000000 | 27 | #define OMAP4_DPLL_LP_FOUT_MAX 100000000 |
31 | 28 | ||
29 | /* | ||
30 | * Bitfield declarations | ||
31 | */ | ||
32 | #define OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK (1 << 8) | ||
33 | #define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK (1 << 10) | ||
34 | #define OMAP4430_DPLL_REGM4XEN_MASK (1 << 11) | ||
35 | |||
36 | /* Static rate multiplier for OMAP4 REGM4XEN clocks */ | ||
37 | #define OMAP4430_REGM4XEN_MULT 4 | ||
38 | |||
32 | /* Supported only on OMAP4 */ | 39 | /* Supported only on OMAP4 */ |
33 | int omap4_dpllmx_gatectrl_read(struct clk_hw_omap *clk) | 40 | int omap4_dpllmx_gatectrl_read(struct clk_hw_omap *clk) |
34 | { | 41 | { |
35 | u32 v; | 42 | u32 v; |
36 | u32 mask; | 43 | u32 mask; |
37 | 44 | ||
38 | if (!clk || !clk->clksel_reg || !cpu_is_omap44xx()) | 45 | if (!clk || !clk->clksel_reg) |
39 | return -EINVAL; | 46 | return -EINVAL; |
40 | 47 | ||
41 | mask = clk->flags & CLOCK_CLKOUTX2 ? | 48 | mask = clk->flags & CLOCK_CLKOUTX2 ? |
@@ -54,7 +61,7 @@ void omap4_dpllmx_allow_gatectrl(struct clk_hw_omap *clk) | |||
54 | u32 v; | 61 | u32 v; |
55 | u32 mask; | 62 | u32 mask; |
56 | 63 | ||
57 | if (!clk || !clk->clksel_reg || !cpu_is_omap44xx()) | 64 | if (!clk || !clk->clksel_reg) |
58 | return; | 65 | return; |
59 | 66 | ||
60 | mask = clk->flags & CLOCK_CLKOUTX2 ? | 67 | mask = clk->flags & CLOCK_CLKOUTX2 ? |
@@ -72,7 +79,7 @@ void omap4_dpllmx_deny_gatectrl(struct clk_hw_omap *clk) | |||
72 | u32 v; | 79 | u32 v; |
73 | u32 mask; | 80 | u32 mask; |
74 | 81 | ||
75 | if (!clk || !clk->clksel_reg || !cpu_is_omap44xx()) | 82 | if (!clk || !clk->clksel_reg) |
76 | return; | 83 | return; |
77 | 84 | ||
78 | mask = clk->flags & CLOCK_CLKOUTX2 ? | 85 | mask = clk->flags & CLOCK_CLKOUTX2 ? |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 8f559450c876..1fae5c123f79 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -728,6 +728,8 @@ int __init omap_clk_init(void) | |||
728 | if (!omap_clk_soc_init) | 728 | if (!omap_clk_soc_init) |
729 | return 0; | 729 | return 0; |
730 | 730 | ||
731 | ti_clk_init_features(); | ||
732 | |||
731 | ret = of_prcm_init(); | 733 | ret = of_prcm_init(); |
732 | if (!ret) | 734 | if (!ret) |
733 | ret = omap_clk_soc_init(); | 735 | ret = omap_clk_soc_init(); |