blob: cebe2b31943ec98e5f4a86521659898058dc1745 [file] [log] [blame]
Rajendra Nayakcb268672012-11-06 15:41:08 -07001/*
2 * OMAP4 Clock data
3 *
4 * Copyright (C) 2009-2012 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation
6 *
7 * Paul Walmsley (paul@pwsan.com)
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 * Mike Turquette (mturquette@ti.com)
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 * XXX Some of the ES1 clocks have been removed/changed; once support
17 * is added for discriminating clocks by ES level, these should be added back
18 * in.
Paul Walmsley17b7e7d2013-01-26 00:48:54 -070019 *
Paul Walmsleyee877ac2013-01-26 00:48:55 -070020 * XXX All of the remaining MODULEMODE clock nodes should be removed
21 * once the drivers are updated to use pm_runtime or to use the appropriate
22 * upstream clock node for rate/parent selection.
Rajendra Nayakcb268672012-11-06 15:41:08 -070023 */
24
25#include <linux/kernel.h>
26#include <linux/list.h>
27#include <linux/clk-private.h>
28#include <linux/clkdev.h>
29#include <linux/io.h>
30
31#include "soc.h"
32#include "iomap.h"
33#include "clock.h"
34#include "clock44xx.h"
35#include "cm1_44xx.h"
36#include "cm2_44xx.h"
37#include "cm-regbits-44xx.h"
38#include "prm44xx.h"
39#include "prm-regbits-44xx.h"
40#include "control.h"
41#include "scrm44xx.h"
42
43/* OMAP4 modulemode control */
44#define OMAP4430_MODULEMODE_HWCTRL_SHIFT 0
45#define OMAP4430_MODULEMODE_SWCTRL_SHIFT 1
46
Jon Hunter8c197cc2012-12-15 01:35:50 -070047/*
48 * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section
49 * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK
50 * must be set to 196.608 MHz" and hence, the DPLL locked frequency is
51 * half of this value.
52 */
53#define OMAP4_DPLL_ABE_DEFFREQ 98304000
54
Rajendra Nayakcb268672012-11-06 15:41:08 -070055/* Root clocks */
56
57DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);
58
59DEFINE_CLK_FIXED_RATE(pad_clks_src_ck, CLK_IS_ROOT, 12000000, 0x0);
60
61DEFINE_CLK_GATE(pad_clks_ck, "pad_clks_src_ck", &pad_clks_src_ck, 0x0,
62 OMAP4430_CM_CLKSEL_ABE, OMAP4430_PAD_CLKS_GATE_SHIFT,
63 0x0, NULL);
64
65DEFINE_CLK_FIXED_RATE(pad_slimbus_core_clks_ck, CLK_IS_ROOT, 12000000, 0x0);
66
67DEFINE_CLK_FIXED_RATE(secure_32k_clk_src_ck, CLK_IS_ROOT, 32768, 0x0);
68
69DEFINE_CLK_FIXED_RATE(slimbus_src_clk, CLK_IS_ROOT, 12000000, 0x0);
70
71DEFINE_CLK_GATE(slimbus_clk, "slimbus_src_clk", &slimbus_src_clk, 0x0,
72 OMAP4430_CM_CLKSEL_ABE, OMAP4430_SLIMBUS_CLK_GATE_SHIFT,
73 0x0, NULL);
74
75DEFINE_CLK_FIXED_RATE(sys_32k_ck, CLK_IS_ROOT, 32768, 0x0);
76
77DEFINE_CLK_FIXED_RATE(virt_12000000_ck, CLK_IS_ROOT, 12000000, 0x0);
78
79DEFINE_CLK_FIXED_RATE(virt_13000000_ck, CLK_IS_ROOT, 13000000, 0x0);
80
81DEFINE_CLK_FIXED_RATE(virt_16800000_ck, CLK_IS_ROOT, 16800000, 0x0);
82
83DEFINE_CLK_FIXED_RATE(virt_19200000_ck, CLK_IS_ROOT, 19200000, 0x0);
84
85DEFINE_CLK_FIXED_RATE(virt_26000000_ck, CLK_IS_ROOT, 26000000, 0x0);
86
87DEFINE_CLK_FIXED_RATE(virt_27000000_ck, CLK_IS_ROOT, 27000000, 0x0);
88
89DEFINE_CLK_FIXED_RATE(virt_38400000_ck, CLK_IS_ROOT, 38400000, 0x0);
90
91static const char *sys_clkin_ck_parents[] = {
92 "virt_12000000_ck", "virt_13000000_ck", "virt_16800000_ck",
93 "virt_19200000_ck", "virt_26000000_ck", "virt_27000000_ck",
94 "virt_38400000_ck",
95};
96
97DEFINE_CLK_MUX(sys_clkin_ck, sys_clkin_ck_parents, NULL, 0x0,
98 OMAP4430_CM_SYS_CLKSEL, OMAP4430_SYS_CLKSEL_SHIFT,
99 OMAP4430_SYS_CLKSEL_WIDTH, CLK_MUX_INDEX_ONE, NULL);
100
101DEFINE_CLK_FIXED_RATE(tie_low_clock_ck, CLK_IS_ROOT, 0, 0x0);
102
103DEFINE_CLK_FIXED_RATE(utmi_phy_clkout_ck, CLK_IS_ROOT, 60000000, 0x0);
104
105DEFINE_CLK_FIXED_RATE(xclk60mhsp1_ck, CLK_IS_ROOT, 60000000, 0x0);
106
107DEFINE_CLK_FIXED_RATE(xclk60mhsp2_ck, CLK_IS_ROOT, 60000000, 0x0);
108
109DEFINE_CLK_FIXED_RATE(xclk60motg_ck, CLK_IS_ROOT, 60000000, 0x0);
110
111/* Module clocks and DPLL outputs */
112
113static const char *abe_dpll_bypass_clk_mux_ck_parents[] = {
114 "sys_clkin_ck", "sys_32k_ck",
115};
116
117DEFINE_CLK_MUX(abe_dpll_bypass_clk_mux_ck, abe_dpll_bypass_clk_mux_ck_parents,
118 NULL, 0x0, OMAP4430_CM_L4_WKUP_CLKSEL, OMAP4430_CLKSEL_SHIFT,
119 OMAP4430_CLKSEL_WIDTH, 0x0, NULL);
120
121DEFINE_CLK_MUX(abe_dpll_refclk_mux_ck, abe_dpll_bypass_clk_mux_ck_parents, NULL,
122 0x0, OMAP4430_CM_ABE_PLL_REF_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
123 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
124
125/* DPLL_ABE */
126static struct dpll_data dpll_abe_dd = {
127 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_ABE,
128 .clk_bypass = &abe_dpll_bypass_clk_mux_ck,
129 .clk_ref = &abe_dpll_refclk_mux_ck,
130 .control_reg = OMAP4430_CM_CLKMODE_DPLL_ABE,
131 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
132 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_ABE,
133 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_ABE,
134 .mult_mask = OMAP4430_DPLL_MULT_MASK,
135 .div1_mask = OMAP4430_DPLL_DIV_MASK,
136 .enable_mask = OMAP4430_DPLL_EN_MASK,
137 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
138 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
Jon Hunter3ff51ed2012-12-15 01:35:46 -0700139 .m4xen_mask = OMAP4430_DPLL_REGM4XEN_MASK,
140 .lpmode_mask = OMAP4430_DPLL_LPMODE_EN_MASK,
Rajendra Nayakcb268672012-11-06 15:41:08 -0700141 .max_multiplier = 2047,
142 .max_divider = 128,
143 .min_divider = 1,
144};
145
146
147static const char *dpll_abe_ck_parents[] = {
148 "abe_dpll_refclk_mux_ck",
149};
150
151static struct clk dpll_abe_ck;
152
153static const struct clk_ops dpll_abe_ck_ops = {
154 .enable = &omap3_noncore_dpll_enable,
155 .disable = &omap3_noncore_dpll_disable,
156 .recalc_rate = &omap4_dpll_regm4xen_recalc,
157 .round_rate = &omap4_dpll_regm4xen_round_rate,
158 .set_rate = &omap3_noncore_dpll_set_rate,
159 .get_parent = &omap2_init_dpll_parent,
160};
161
162static struct clk_hw_omap dpll_abe_ck_hw = {
163 .hw = {
164 .clk = &dpll_abe_ck,
165 },
166 .dpll_data = &dpll_abe_dd,
167 .ops = &clkhwops_omap3_dpll,
168};
169
170DEFINE_STRUCT_CLK(dpll_abe_ck, dpll_abe_ck_parents, dpll_abe_ck_ops);
171
172static const char *dpll_abe_x2_ck_parents[] = {
173 "dpll_abe_ck",
174};
175
176static struct clk dpll_abe_x2_ck;
177
178static const struct clk_ops dpll_abe_x2_ck_ops = {
179 .recalc_rate = &omap3_clkoutx2_recalc,
180};
181
182static struct clk_hw_omap dpll_abe_x2_ck_hw = {
183 .hw = {
184 .clk = &dpll_abe_x2_ck,
185 },
186 .flags = CLOCK_CLKOUTX2,
187 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
188 .ops = &clkhwops_omap4_dpllmx,
189};
190
191DEFINE_STRUCT_CLK(dpll_abe_x2_ck, dpll_abe_x2_ck_parents, dpll_abe_x2_ck_ops);
192
193static const struct clk_ops omap_hsdivider_ops = {
194 .set_rate = &omap2_clksel_set_rate,
195 .recalc_rate = &omap2_clksel_recalc,
196 .round_rate = &omap2_clksel_round_rate,
197};
198
199DEFINE_CLK_OMAP_HSDIVIDER(dpll_abe_m2x2_ck, "dpll_abe_x2_ck", &dpll_abe_x2_ck,
200 0x0, OMAP4430_CM_DIV_M2_DPLL_ABE,
201 OMAP4430_DPLL_CLKOUT_DIV_MASK);
202
203DEFINE_CLK_FIXED_FACTOR(abe_24m_fclk, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck,
204 0x0, 1, 8);
205
206DEFINE_CLK_DIVIDER(abe_clk, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck, 0x0,
207 OMAP4430_CM_CLKSEL_ABE, OMAP4430_CLKSEL_OPP_SHIFT,
208 OMAP4430_CLKSEL_OPP_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
209
210DEFINE_CLK_DIVIDER(aess_fclk, "abe_clk", &abe_clk, 0x0,
211 OMAP4430_CM1_ABE_AESS_CLKCTRL,
212 OMAP4430_CLKSEL_AESS_FCLK_SHIFT,
213 OMAP4430_CLKSEL_AESS_FCLK_WIDTH,
214 0x0, NULL);
215
216DEFINE_CLK_OMAP_HSDIVIDER(dpll_abe_m3x2_ck, "dpll_abe_x2_ck", &dpll_abe_x2_ck,
217 0x0, OMAP4430_CM_DIV_M3_DPLL_ABE,
218 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK);
219
220static const char *core_hsd_byp_clk_mux_ck_parents[] = {
221 "sys_clkin_ck", "dpll_abe_m3x2_ck",
222};
223
224DEFINE_CLK_MUX(core_hsd_byp_clk_mux_ck, core_hsd_byp_clk_mux_ck_parents, NULL,
225 0x0, OMAP4430_CM_CLKSEL_DPLL_CORE,
226 OMAP4430_DPLL_BYP_CLKSEL_SHIFT, OMAP4430_DPLL_BYP_CLKSEL_WIDTH,
227 0x0, NULL);
228
229/* DPLL_CORE */
230static struct dpll_data dpll_core_dd = {
231 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_CORE,
232 .clk_bypass = &core_hsd_byp_clk_mux_ck,
233 .clk_ref = &sys_clkin_ck,
234 .control_reg = OMAP4430_CM_CLKMODE_DPLL_CORE,
235 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
236 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_CORE,
237 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_CORE,
238 .mult_mask = OMAP4430_DPLL_MULT_MASK,
239 .div1_mask = OMAP4430_DPLL_DIV_MASK,
240 .enable_mask = OMAP4430_DPLL_EN_MASK,
241 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
242 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
243 .max_multiplier = 2047,
244 .max_divider = 128,
245 .min_divider = 1,
246};
247
248
249static const char *dpll_core_ck_parents[] = {
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700250 "sys_clkin_ck", "core_hsd_byp_clk_mux_ck"
Rajendra Nayakcb268672012-11-06 15:41:08 -0700251};
252
253static struct clk dpll_core_ck;
254
255static const struct clk_ops dpll_core_ck_ops = {
256 .recalc_rate = &omap3_dpll_recalc,
257 .get_parent = &omap2_init_dpll_parent,
258};
259
260static struct clk_hw_omap dpll_core_ck_hw = {
261 .hw = {
262 .clk = &dpll_core_ck,
263 },
264 .dpll_data = &dpll_core_dd,
265 .ops = &clkhwops_omap3_dpll,
266};
267
268DEFINE_STRUCT_CLK(dpll_core_ck, dpll_core_ck_parents, dpll_core_ck_ops);
269
270static const char *dpll_core_x2_ck_parents[] = {
271 "dpll_core_ck",
272};
273
274static struct clk dpll_core_x2_ck;
275
276static struct clk_hw_omap dpll_core_x2_ck_hw = {
277 .hw = {
278 .clk = &dpll_core_x2_ck,
279 },
280};
281
282DEFINE_STRUCT_CLK(dpll_core_x2_ck, dpll_core_x2_ck_parents, dpll_abe_x2_ck_ops);
283
284DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m6x2_ck, "dpll_core_x2_ck",
285 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M6_DPLL_CORE,
286 OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK);
287
288DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m2_ck, "dpll_core_ck", &dpll_core_ck, 0x0,
289 OMAP4430_CM_DIV_M2_DPLL_CORE,
290 OMAP4430_DPLL_CLKOUT_DIV_MASK);
291
292DEFINE_CLK_FIXED_FACTOR(ddrphy_ck, "dpll_core_m2_ck", &dpll_core_m2_ck, 0x0, 1,
293 2);
294
295DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m5x2_ck, "dpll_core_x2_ck",
296 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M5_DPLL_CORE,
297 OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK);
298
299DEFINE_CLK_DIVIDER(div_core_ck, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, 0x0,
300 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_CORE_SHIFT,
301 OMAP4430_CLKSEL_CORE_WIDTH, 0x0, NULL);
302
Paul Walmsley628a37d2012-12-15 01:35:58 -0700303DEFINE_CLK_DIVIDER(div_iva_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
304 0x0, OMAP4430_CM_BYPCLK_DPLL_IVA, OMAP4430_CLKSEL_0_1_SHIFT,
305 OMAP4430_CLKSEL_0_1_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700306
307DEFINE_CLK_DIVIDER(div_mpu_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
308 0x0, OMAP4430_CM_BYPCLK_DPLL_MPU, OMAP4430_CLKSEL_0_1_SHIFT,
309 OMAP4430_CLKSEL_0_1_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
310
311DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m4x2_ck, "dpll_core_x2_ck",
312 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M4_DPLL_CORE,
313 OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK);
314
315DEFINE_CLK_FIXED_FACTOR(dll_clk_div_ck, "dpll_core_m4x2_ck", &dpll_core_m4x2_ck,
316 0x0, 1, 2);
317
318DEFINE_CLK_DIVIDER(dpll_abe_m2_ck, "dpll_abe_ck", &dpll_abe_ck, 0x0,
319 OMAP4430_CM_DIV_M2_DPLL_ABE, OMAP4430_DPLL_CLKOUT_DIV_SHIFT,
320 OMAP4430_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
321
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700322static const struct clk_ops dpll_hsd_ops = {
Rajendra Nayakcb268672012-11-06 15:41:08 -0700323 .enable = &omap2_dflt_clk_enable,
324 .disable = &omap2_dflt_clk_disable,
325 .is_enabled = &omap2_dflt_clk_is_enabled,
326 .recalc_rate = &omap2_clksel_recalc,
327 .get_parent = &omap2_clksel_find_parent_index,
328 .set_parent = &omap2_clksel_set_parent,
329 .init = &omap2_init_clk_clkdm,
330};
331
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700332static const struct clk_ops func_dmic_abe_gfclk_ops = {
333 .recalc_rate = &omap2_clksel_recalc,
334 .get_parent = &omap2_clksel_find_parent_index,
335 .set_parent = &omap2_clksel_set_parent,
336};
337
Rajendra Nayakcb268672012-11-06 15:41:08 -0700338static const char *dpll_core_m3x2_ck_parents[] = {
339 "dpll_core_x2_ck",
340};
341
342static const struct clksel dpll_core_m3x2_div[] = {
343 { .parent = &dpll_core_x2_ck, .rates = div31_1to31_rates },
344 { .parent = NULL },
345};
346
347/* XXX Missing round_rate, set_rate in ops */
348DEFINE_CLK_OMAP_MUX_GATE(dpll_core_m3x2_ck, NULL, dpll_core_m3x2_div,
349 OMAP4430_CM_DIV_M3_DPLL_CORE,
350 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
351 OMAP4430_CM_DIV_M3_DPLL_CORE,
352 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL,
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700353 dpll_core_m3x2_ck_parents, dpll_hsd_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700354
355DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m7x2_ck, "dpll_core_x2_ck",
356 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M7_DPLL_CORE,
357 OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK);
358
359static const char *iva_hsd_byp_clk_mux_ck_parents[] = {
360 "sys_clkin_ck", "div_iva_hs_clk",
361};
362
363DEFINE_CLK_MUX(iva_hsd_byp_clk_mux_ck, iva_hsd_byp_clk_mux_ck_parents, NULL,
364 0x0, OMAP4430_CM_CLKSEL_DPLL_IVA, OMAP4430_DPLL_BYP_CLKSEL_SHIFT,
365 OMAP4430_DPLL_BYP_CLKSEL_WIDTH, 0x0, NULL);
366
367/* DPLL_IVA */
368static struct dpll_data dpll_iva_dd = {
369 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_IVA,
370 .clk_bypass = &iva_hsd_byp_clk_mux_ck,
371 .clk_ref = &sys_clkin_ck,
372 .control_reg = OMAP4430_CM_CLKMODE_DPLL_IVA,
373 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
374 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_IVA,
375 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_IVA,
376 .mult_mask = OMAP4430_DPLL_MULT_MASK,
377 .div1_mask = OMAP4430_DPLL_DIV_MASK,
378 .enable_mask = OMAP4430_DPLL_EN_MASK,
379 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
380 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
381 .max_multiplier = 2047,
382 .max_divider = 128,
383 .min_divider = 1,
384};
385
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700386static const char *dpll_iva_ck_parents[] = {
387 "sys_clkin_ck", "iva_hsd_byp_clk_mux_ck"
388};
389
Rajendra Nayakcb268672012-11-06 15:41:08 -0700390static struct clk dpll_iva_ck;
391
Jon Hunter9b4fcc82012-12-15 01:35:43 -0700392static const struct clk_ops dpll_ck_ops = {
393 .enable = &omap3_noncore_dpll_enable,
394 .disable = &omap3_noncore_dpll_disable,
395 .recalc_rate = &omap3_dpll_recalc,
396 .round_rate = &omap2_dpll_round_rate,
397 .set_rate = &omap3_noncore_dpll_set_rate,
398 .get_parent = &omap2_init_dpll_parent,
399};
400
Rajendra Nayakcb268672012-11-06 15:41:08 -0700401static struct clk_hw_omap dpll_iva_ck_hw = {
402 .hw = {
403 .clk = &dpll_iva_ck,
404 },
405 .dpll_data = &dpll_iva_dd,
406 .ops = &clkhwops_omap3_dpll,
407};
408
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700409DEFINE_STRUCT_CLK(dpll_iva_ck, dpll_iva_ck_parents, dpll_ck_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700410
411static const char *dpll_iva_x2_ck_parents[] = {
412 "dpll_iva_ck",
413};
414
415static struct clk dpll_iva_x2_ck;
416
417static struct clk_hw_omap dpll_iva_x2_ck_hw = {
418 .hw = {
419 .clk = &dpll_iva_x2_ck,
420 },
421};
422
423DEFINE_STRUCT_CLK(dpll_iva_x2_ck, dpll_iva_x2_ck_parents, dpll_abe_x2_ck_ops);
424
425DEFINE_CLK_OMAP_HSDIVIDER(dpll_iva_m4x2_ck, "dpll_iva_x2_ck", &dpll_iva_x2_ck,
426 0x0, OMAP4430_CM_DIV_M4_DPLL_IVA,
427 OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK);
428
429DEFINE_CLK_OMAP_HSDIVIDER(dpll_iva_m5x2_ck, "dpll_iva_x2_ck", &dpll_iva_x2_ck,
430 0x0, OMAP4430_CM_DIV_M5_DPLL_IVA,
431 OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK);
432
433/* DPLL_MPU */
434static struct dpll_data dpll_mpu_dd = {
435 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_MPU,
436 .clk_bypass = &div_mpu_hs_clk,
437 .clk_ref = &sys_clkin_ck,
438 .control_reg = OMAP4430_CM_CLKMODE_DPLL_MPU,
439 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
440 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_MPU,
441 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_MPU,
442 .mult_mask = OMAP4430_DPLL_MULT_MASK,
443 .div1_mask = OMAP4430_DPLL_DIV_MASK,
444 .enable_mask = OMAP4430_DPLL_EN_MASK,
445 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
446 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
447 .max_multiplier = 2047,
448 .max_divider = 128,
449 .min_divider = 1,
450};
451
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700452static const char *dpll_mpu_ck_parents[] = {
453 "sys_clkin_ck", "div_mpu_hs_clk"
454};
455
Rajendra Nayakcb268672012-11-06 15:41:08 -0700456static struct clk dpll_mpu_ck;
457
458static struct clk_hw_omap dpll_mpu_ck_hw = {
459 .hw = {
460 .clk = &dpll_mpu_ck,
461 },
462 .dpll_data = &dpll_mpu_dd,
463 .ops = &clkhwops_omap3_dpll,
464};
465
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700466DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_mpu_ck_parents, dpll_ck_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700467
468DEFINE_CLK_FIXED_FACTOR(mpu_periphclk, "dpll_mpu_ck", &dpll_mpu_ck, 0x0, 1, 2);
469
470DEFINE_CLK_OMAP_HSDIVIDER(dpll_mpu_m2_ck, "dpll_mpu_ck", &dpll_mpu_ck, 0x0,
471 OMAP4430_CM_DIV_M2_DPLL_MPU,
472 OMAP4430_DPLL_CLKOUT_DIV_MASK);
473
474DEFINE_CLK_FIXED_FACTOR(per_hs_clk_div_ck, "dpll_abe_m3x2_ck",
475 &dpll_abe_m3x2_ck, 0x0, 1, 2);
476
477static const char *per_hsd_byp_clk_mux_ck_parents[] = {
478 "sys_clkin_ck", "per_hs_clk_div_ck",
479};
480
481DEFINE_CLK_MUX(per_hsd_byp_clk_mux_ck, per_hsd_byp_clk_mux_ck_parents, NULL,
482 0x0, OMAP4430_CM_CLKSEL_DPLL_PER, OMAP4430_DPLL_BYP_CLKSEL_SHIFT,
483 OMAP4430_DPLL_BYP_CLKSEL_WIDTH, 0x0, NULL);
484
485/* DPLL_PER */
486static struct dpll_data dpll_per_dd = {
487 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_PER,
488 .clk_bypass = &per_hsd_byp_clk_mux_ck,
489 .clk_ref = &sys_clkin_ck,
490 .control_reg = OMAP4430_CM_CLKMODE_DPLL_PER,
491 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
492 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_PER,
493 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_PER,
494 .mult_mask = OMAP4430_DPLL_MULT_MASK,
495 .div1_mask = OMAP4430_DPLL_DIV_MASK,
496 .enable_mask = OMAP4430_DPLL_EN_MASK,
497 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
498 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
499 .max_multiplier = 2047,
500 .max_divider = 128,
501 .min_divider = 1,
502};
503
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700504static const char *dpll_per_ck_parents[] = {
505 "sys_clkin_ck", "per_hsd_byp_clk_mux_ck"
506};
Rajendra Nayakcb268672012-11-06 15:41:08 -0700507
508static struct clk dpll_per_ck;
509
510static struct clk_hw_omap dpll_per_ck_hw = {
511 .hw = {
512 .clk = &dpll_per_ck,
513 },
514 .dpll_data = &dpll_per_dd,
515 .ops = &clkhwops_omap3_dpll,
516};
517
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700518DEFINE_STRUCT_CLK(dpll_per_ck, dpll_per_ck_parents, dpll_ck_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700519
520DEFINE_CLK_DIVIDER(dpll_per_m2_ck, "dpll_per_ck", &dpll_per_ck, 0x0,
521 OMAP4430_CM_DIV_M2_DPLL_PER, OMAP4430_DPLL_CLKOUT_DIV_SHIFT,
522 OMAP4430_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
523
524static const char *dpll_per_x2_ck_parents[] = {
525 "dpll_per_ck",
526};
527
528static struct clk dpll_per_x2_ck;
529
530static struct clk_hw_omap dpll_per_x2_ck_hw = {
531 .hw = {
532 .clk = &dpll_per_x2_ck,
533 },
534 .flags = CLOCK_CLKOUTX2,
535 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
536 .ops = &clkhwops_omap4_dpllmx,
537};
538
539DEFINE_STRUCT_CLK(dpll_per_x2_ck, dpll_per_x2_ck_parents, dpll_abe_x2_ck_ops);
540
541DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m2x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
542 0x0, OMAP4430_CM_DIV_M2_DPLL_PER,
543 OMAP4430_DPLL_CLKOUT_DIV_MASK);
544
545static const char *dpll_per_m3x2_ck_parents[] = {
546 "dpll_per_x2_ck",
547};
548
549static const struct clksel dpll_per_m3x2_div[] = {
550 { .parent = &dpll_per_x2_ck, .rates = div31_1to31_rates },
551 { .parent = NULL },
552};
553
554/* XXX Missing round_rate, set_rate in ops */
555DEFINE_CLK_OMAP_MUX_GATE(dpll_per_m3x2_ck, NULL, dpll_per_m3x2_div,
556 OMAP4430_CM_DIV_M3_DPLL_PER,
557 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
558 OMAP4430_CM_DIV_M3_DPLL_PER,
559 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL,
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700560 dpll_per_m3x2_ck_parents, dpll_hsd_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700561
562DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m4x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
563 0x0, OMAP4430_CM_DIV_M4_DPLL_PER,
564 OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK);
565
566DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m5x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
567 0x0, OMAP4430_CM_DIV_M5_DPLL_PER,
568 OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK);
569
570DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m6x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
571 0x0, OMAP4430_CM_DIV_M6_DPLL_PER,
572 OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK);
573
574DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m7x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
575 0x0, OMAP4430_CM_DIV_M7_DPLL_PER,
576 OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK);
577
578DEFINE_CLK_FIXED_FACTOR(usb_hs_clk_div_ck, "dpll_abe_m3x2_ck",
579 &dpll_abe_m3x2_ck, 0x0, 1, 3);
580
581/* DPLL_USB */
582static struct dpll_data dpll_usb_dd = {
583 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_USB,
584 .clk_bypass = &usb_hs_clk_div_ck,
585 .flags = DPLL_J_TYPE,
586 .clk_ref = &sys_clkin_ck,
587 .control_reg = OMAP4430_CM_CLKMODE_DPLL_USB,
588 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
589 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_USB,
590 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_USB,
591 .mult_mask = OMAP4430_DPLL_MULT_USB_MASK,
592 .div1_mask = OMAP4430_DPLL_DIV_0_7_MASK,
593 .enable_mask = OMAP4430_DPLL_EN_MASK,
594 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
595 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
596 .sddiv_mask = OMAP4430_DPLL_SD_DIV_MASK,
597 .max_multiplier = 4095,
598 .max_divider = 256,
599 .min_divider = 1,
600};
601
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700602static const char *dpll_usb_ck_parents[] = {
603 "sys_clkin_ck", "usb_hs_clk_div_ck"
604};
605
Rajendra Nayakcb268672012-11-06 15:41:08 -0700606static struct clk dpll_usb_ck;
607
608static struct clk_hw_omap dpll_usb_ck_hw = {
609 .hw = {
610 .clk = &dpll_usb_ck,
611 },
612 .dpll_data = &dpll_usb_dd,
613 .ops = &clkhwops_omap3_dpll,
614};
615
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700616DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_ck_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700617
618static const char *dpll_usb_clkdcoldo_ck_parents[] = {
619 "dpll_usb_ck",
620};
621
622static struct clk dpll_usb_clkdcoldo_ck;
623
624static const struct clk_ops dpll_usb_clkdcoldo_ck_ops = {
625};
626
627static struct clk_hw_omap dpll_usb_clkdcoldo_ck_hw = {
628 .hw = {
629 .clk = &dpll_usb_clkdcoldo_ck,
630 },
631 .clksel_reg = OMAP4430_CM_CLKDCOLDO_DPLL_USB,
632 .ops = &clkhwops_omap4_dpllmx,
633};
634
635DEFINE_STRUCT_CLK(dpll_usb_clkdcoldo_ck, dpll_usb_clkdcoldo_ck_parents,
636 dpll_usb_clkdcoldo_ck_ops);
637
638DEFINE_CLK_OMAP_HSDIVIDER(dpll_usb_m2_ck, "dpll_usb_ck", &dpll_usb_ck, 0x0,
639 OMAP4430_CM_DIV_M2_DPLL_USB,
640 OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK);
641
642static const char *ducati_clk_mux_ck_parents[] = {
643 "div_core_ck", "dpll_per_m6x2_ck",
644};
645
646DEFINE_CLK_MUX(ducati_clk_mux_ck, ducati_clk_mux_ck_parents, NULL, 0x0,
647 OMAP4430_CM_CLKSEL_DUCATI_ISS_ROOT, OMAP4430_CLKSEL_0_0_SHIFT,
648 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
649
650DEFINE_CLK_FIXED_FACTOR(func_12m_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
651 0x0, 1, 16);
652
653DEFINE_CLK_FIXED_FACTOR(func_24m_clk, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0,
654 1, 4);
655
656DEFINE_CLK_FIXED_FACTOR(func_24mc_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
657 0x0, 1, 8);
658
659static const struct clk_div_table func_48m_fclk_rates[] = {
660 { .div = 4, .val = 0 },
661 { .div = 8, .val = 1 },
662 { .div = 0 },
663};
664DEFINE_CLK_DIVIDER_TABLE(func_48m_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
665 0x0, OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
666 OMAP4430_SCALE_FCLK_WIDTH, 0x0, func_48m_fclk_rates,
667 NULL);
668
669DEFINE_CLK_FIXED_FACTOR(func_48mc_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
670 0x0, 1, 4);
671
672static const struct clk_div_table func_64m_fclk_rates[] = {
673 { .div = 2, .val = 0 },
674 { .div = 4, .val = 1 },
675 { .div = 0 },
676};
677DEFINE_CLK_DIVIDER_TABLE(func_64m_fclk, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck,
678 0x0, OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
679 OMAP4430_SCALE_FCLK_WIDTH, 0x0, func_64m_fclk_rates,
680 NULL);
681
682static const struct clk_div_table func_96m_fclk_rates[] = {
683 { .div = 2, .val = 0 },
684 { .div = 4, .val = 1 },
685 { .div = 0 },
686};
687DEFINE_CLK_DIVIDER_TABLE(func_96m_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
688 0x0, OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
689 OMAP4430_SCALE_FCLK_WIDTH, 0x0, func_96m_fclk_rates,
690 NULL);
691
692static const struct clk_div_table init_60m_fclk_rates[] = {
693 { .div = 1, .val = 0 },
694 { .div = 8, .val = 1 },
695 { .div = 0 },
696};
697DEFINE_CLK_DIVIDER_TABLE(init_60m_fclk, "dpll_usb_m2_ck", &dpll_usb_m2_ck,
698 0x0, OMAP4430_CM_CLKSEL_USB_60MHZ,
699 OMAP4430_CLKSEL_0_0_SHIFT, OMAP4430_CLKSEL_0_0_WIDTH,
700 0x0, init_60m_fclk_rates, NULL);
701
702DEFINE_CLK_DIVIDER(l3_div_ck, "div_core_ck", &div_core_ck, 0x0,
703 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_L3_SHIFT,
704 OMAP4430_CLKSEL_L3_WIDTH, 0x0, NULL);
705
706DEFINE_CLK_DIVIDER(l4_div_ck, "l3_div_ck", &l3_div_ck, 0x0,
707 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_L4_SHIFT,
708 OMAP4430_CLKSEL_L4_WIDTH, 0x0, NULL);
709
710DEFINE_CLK_FIXED_FACTOR(lp_clk_div_ck, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck,
711 0x0, 1, 16);
712
713static const char *l4_wkup_clk_mux_ck_parents[] = {
714 "sys_clkin_ck", "lp_clk_div_ck",
715};
716
717DEFINE_CLK_MUX(l4_wkup_clk_mux_ck, l4_wkup_clk_mux_ck_parents, NULL, 0x0,
718 OMAP4430_CM_L4_WKUP_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
719 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
720
721static const struct clk_div_table ocp_abe_iclk_rates[] = {
722 { .div = 2, .val = 0 },
723 { .div = 1, .val = 1 },
724 { .div = 0 },
725};
726DEFINE_CLK_DIVIDER_TABLE(ocp_abe_iclk, "aess_fclk", &aess_fclk, 0x0,
727 OMAP4430_CM1_ABE_AESS_CLKCTRL,
728 OMAP4430_CLKSEL_AESS_FCLK_SHIFT,
729 OMAP4430_CLKSEL_AESS_FCLK_WIDTH,
730 0x0, ocp_abe_iclk_rates, NULL);
731
732DEFINE_CLK_FIXED_FACTOR(per_abe_24m_fclk, "dpll_abe_m2_ck", &dpll_abe_m2_ck,
733 0x0, 1, 4);
734
735DEFINE_CLK_DIVIDER(per_abe_nc_fclk, "dpll_abe_m2_ck", &dpll_abe_m2_ck, 0x0,
736 OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
737 OMAP4430_SCALE_FCLK_WIDTH, 0x0, NULL);
738
739DEFINE_CLK_DIVIDER(syc_clk_div_ck, "sys_clkin_ck", &sys_clkin_ck, 0x0,
740 OMAP4430_CM_ABE_DSS_SYS_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
741 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
742
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700743static const char *dbgclk_mux_ck_parents[] = {
744 "sys_clkin_ck"
745};
746
Rajendra Nayakcb268672012-11-06 15:41:08 -0700747static struct clk dbgclk_mux_ck;
748DEFINE_STRUCT_CLK_HW_OMAP(dbgclk_mux_ck, NULL);
Paul Walmsleyb8675e22012-12-15 01:36:04 -0700749DEFINE_STRUCT_CLK(dbgclk_mux_ck, dbgclk_mux_ck_parents,
Rajendra Nayakcb268672012-11-06 15:41:08 -0700750 dpll_usb_clkdcoldo_ck_ops);
751
752/* Leaf clocks controlled by modules */
753
754DEFINE_CLK_GATE(aes1_fck, "l3_div_ck", &l3_div_ck, 0x0,
755 OMAP4430_CM_L4SEC_AES1_CLKCTRL,
756 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
757
758DEFINE_CLK_GATE(aes2_fck, "l3_div_ck", &l3_div_ck, 0x0,
759 OMAP4430_CM_L4SEC_AES2_CLKCTRL,
760 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
761
Rajendra Nayakcb268672012-11-06 15:41:08 -0700762DEFINE_CLK_GATE(bandgap_fclk, "sys_32k_ck", &sys_32k_ck, 0x0,
763 OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
764 OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT, 0x0, NULL);
765
766static const struct clk_div_table div_ts_ck_rates[] = {
767 { .div = 8, .val = 0 },
768 { .div = 16, .val = 1 },
769 { .div = 32, .val = 2 },
770 { .div = 0 },
771};
772DEFINE_CLK_DIVIDER_TABLE(div_ts_ck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
773 0x0, OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
774 OMAP4430_CLKSEL_24_25_SHIFT,
775 OMAP4430_CLKSEL_24_25_WIDTH, 0x0, div_ts_ck_rates,
776 NULL);
777
778DEFINE_CLK_GATE(bandgap_ts_fclk, "div_ts_ck", &div_ts_ck, 0x0,
779 OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
780 OMAP4460_OPTFCLKEN_TS_FCLK_SHIFT,
781 0x0, NULL);
782
Rajendra Nayakcb268672012-11-06 15:41:08 -0700783static const char *dmic_sync_mux_ck_parents[] = {
784 "abe_24m_fclk", "syc_clk_div_ck", "func_24m_clk",
785};
786
787DEFINE_CLK_MUX(dmic_sync_mux_ck, dmic_sync_mux_ck_parents, NULL,
788 0x0, OMAP4430_CM1_ABE_DMIC_CLKCTRL,
789 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
790 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
791
792static const struct clksel func_dmic_abe_gfclk_sel[] = {
793 { .parent = &dmic_sync_mux_ck, .rates = div_1_0_rates },
794 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
795 { .parent = &slimbus_clk, .rates = div_1_2_rates },
796 { .parent = NULL },
797};
798
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700799static const char *func_dmic_abe_gfclk_parents[] = {
Rajendra Nayakcb268672012-11-06 15:41:08 -0700800 "dmic_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
801};
802
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700803DEFINE_CLK_OMAP_MUX(func_dmic_abe_gfclk, "abe_clkdm", func_dmic_abe_gfclk_sel,
804 OMAP4430_CM1_ABE_DMIC_CLKCTRL, OMAP4430_CLKSEL_SOURCE_MASK,
805 func_dmic_abe_gfclk_parents, func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700806
Rajendra Nayakcb268672012-11-06 15:41:08 -0700807DEFINE_CLK_GATE(dss_sys_clk, "syc_clk_div_ck", &syc_clk_div_ck, 0x0,
808 OMAP4430_CM_DSS_DSS_CLKCTRL,
809 OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT, 0x0, NULL);
810
811DEFINE_CLK_GATE(dss_tv_clk, "extalt_clkin_ck", &extalt_clkin_ck, 0x0,
812 OMAP4430_CM_DSS_DSS_CLKCTRL,
813 OMAP4430_OPTFCLKEN_TV_CLK_SHIFT, 0x0, NULL);
814
815DEFINE_CLK_GATE(dss_dss_clk, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck, 0x0,
816 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_DSSCLK_SHIFT,
817 0x0, NULL);
818
819DEFINE_CLK_GATE(dss_48mhz_clk, "func_48mc_fclk", &func_48mc_fclk, 0x0,
820 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT,
821 0x0, NULL);
822
823DEFINE_CLK_GATE(dss_fck, "l3_div_ck", &l3_div_ck, 0x0,
824 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
825 0x0, NULL);
826
Rajendra Nayakcb268672012-11-06 15:41:08 -0700827DEFINE_CLK_DIVIDER(fdif_fck, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, 0x0,
828 OMAP4430_CM_CAM_FDIF_CLKCTRL, OMAP4430_CLKSEL_FCLK_SHIFT,
829 OMAP4430_CLKSEL_FCLK_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
830
Rajendra Nayakcb268672012-11-06 15:41:08 -0700831DEFINE_CLK_GATE(gpio1_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
832 OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
833 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL);
834
Rajendra Nayakcb268672012-11-06 15:41:08 -0700835DEFINE_CLK_GATE(gpio2_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
836 OMAP4430_CM_L4PER_GPIO2_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
837 0x0, NULL);
838
Rajendra Nayakcb268672012-11-06 15:41:08 -0700839DEFINE_CLK_GATE(gpio3_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
840 OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
841 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL);
842
Rajendra Nayakcb268672012-11-06 15:41:08 -0700843DEFINE_CLK_GATE(gpio4_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
844 OMAP4430_CM_L4PER_GPIO4_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
845 0x0, NULL);
846
Rajendra Nayakcb268672012-11-06 15:41:08 -0700847DEFINE_CLK_GATE(gpio5_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
848 OMAP4430_CM_L4PER_GPIO5_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
849 0x0, NULL);
850
Rajendra Nayakcb268672012-11-06 15:41:08 -0700851DEFINE_CLK_GATE(gpio6_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
852 OMAP4430_CM_L4PER_GPIO6_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
853 0x0, NULL);
854
Rajendra Nayakcb268672012-11-06 15:41:08 -0700855static const struct clksel sgx_clk_mux_sel[] = {
856 { .parent = &dpll_core_m7x2_ck, .rates = div_1_0_rates },
857 { .parent = &dpll_per_m7x2_ck, .rates = div_1_1_rates },
858 { .parent = NULL },
859};
860
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700861static const char *sgx_clk_mux_parents[] = {
Rajendra Nayakcb268672012-11-06 15:41:08 -0700862 "dpll_core_m7x2_ck", "dpll_per_m7x2_ck",
863};
864
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700865DEFINE_CLK_OMAP_MUX(sgx_clk_mux, "l3_gfx_clkdm", sgx_clk_mux_sel,
866 OMAP4430_CM_GFX_GFX_CLKCTRL, OMAP4430_CLKSEL_SGX_FCLK_MASK,
867 sgx_clk_mux_parents, func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700868
Rajendra Nayakcb268672012-11-06 15:41:08 -0700869DEFINE_CLK_DIVIDER(hsi_fck, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, 0x0,
870 OMAP4430_CM_L3INIT_HSI_CLKCTRL, OMAP4430_CLKSEL_24_25_SHIFT,
871 OMAP4430_CLKSEL_24_25_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
872 NULL);
873
Rajendra Nayakcb268672012-11-06 15:41:08 -0700874DEFINE_CLK_GATE(iss_ctrlclk, "func_96m_fclk", &func_96m_fclk, 0x0,
875 OMAP4430_CM_CAM_ISS_CLKCTRL, OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT,
876 0x0, NULL);
877
Rajendra Nayakcb268672012-11-06 15:41:08 -0700878DEFINE_CLK_MUX(mcasp_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
879 OMAP4430_CM1_ABE_MCASP_CLKCTRL,
880 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
881 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
882
883static const struct clksel func_mcasp_abe_gfclk_sel[] = {
884 { .parent = &mcasp_sync_mux_ck, .rates = div_1_0_rates },
885 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
886 { .parent = &slimbus_clk, .rates = div_1_2_rates },
887 { .parent = NULL },
888};
889
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700890static const char *func_mcasp_abe_gfclk_parents[] = {
Rajendra Nayakcb268672012-11-06 15:41:08 -0700891 "mcasp_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
892};
893
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700894DEFINE_CLK_OMAP_MUX(func_mcasp_abe_gfclk, "abe_clkdm", func_mcasp_abe_gfclk_sel,
895 OMAP4430_CM1_ABE_MCASP_CLKCTRL, OMAP4430_CLKSEL_SOURCE_MASK,
896 func_mcasp_abe_gfclk_parents, func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700897
898DEFINE_CLK_MUX(mcbsp1_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
899 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
900 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
901 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
902
903static const struct clksel func_mcbsp1_gfclk_sel[] = {
904 { .parent = &mcbsp1_sync_mux_ck, .rates = div_1_0_rates },
905 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
906 { .parent = &slimbus_clk, .rates = div_1_2_rates },
907 { .parent = NULL },
908};
909
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700910static const char *func_mcbsp1_gfclk_parents[] = {
Rajendra Nayakcb268672012-11-06 15:41:08 -0700911 "mcbsp1_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
912};
913
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700914DEFINE_CLK_OMAP_MUX(func_mcbsp1_gfclk, "abe_clkdm", func_mcbsp1_gfclk_sel,
915 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
916 OMAP4430_CLKSEL_SOURCE_MASK, func_mcbsp1_gfclk_parents,
917 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700918
919DEFINE_CLK_MUX(mcbsp2_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
920 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
921 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
922 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
923
924static const struct clksel func_mcbsp2_gfclk_sel[] = {
925 { .parent = &mcbsp2_sync_mux_ck, .rates = div_1_0_rates },
926 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
927 { .parent = &slimbus_clk, .rates = div_1_2_rates },
928 { .parent = NULL },
929};
930
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700931static const char *func_mcbsp2_gfclk_parents[] = {
Rajendra Nayakcb268672012-11-06 15:41:08 -0700932 "mcbsp2_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
933};
934
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700935DEFINE_CLK_OMAP_MUX(func_mcbsp2_gfclk, "abe_clkdm", func_mcbsp2_gfclk_sel,
936 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
937 OMAP4430_CLKSEL_SOURCE_MASK, func_mcbsp2_gfclk_parents,
938 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700939
940DEFINE_CLK_MUX(mcbsp3_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
941 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
942 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
943 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
944
945static const struct clksel func_mcbsp3_gfclk_sel[] = {
946 { .parent = &mcbsp3_sync_mux_ck, .rates = div_1_0_rates },
947 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
948 { .parent = &slimbus_clk, .rates = div_1_2_rates },
949 { .parent = NULL },
950};
951
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700952static const char *func_mcbsp3_gfclk_parents[] = {
Rajendra Nayakcb268672012-11-06 15:41:08 -0700953 "mcbsp3_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
954};
955
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700956DEFINE_CLK_OMAP_MUX(func_mcbsp3_gfclk, "abe_clkdm", func_mcbsp3_gfclk_sel,
957 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
958 OMAP4430_CLKSEL_SOURCE_MASK, func_mcbsp3_gfclk_parents,
959 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700960
961static const char *mcbsp4_sync_mux_ck_parents[] = {
962 "func_96m_fclk", "per_abe_nc_fclk",
963};
964
965DEFINE_CLK_MUX(mcbsp4_sync_mux_ck, mcbsp4_sync_mux_ck_parents, NULL, 0x0,
966 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
967 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
968 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
969
970static const struct clksel per_mcbsp4_gfclk_sel[] = {
971 { .parent = &mcbsp4_sync_mux_ck, .rates = div_1_0_rates },
972 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
973 { .parent = NULL },
974};
975
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700976static const char *per_mcbsp4_gfclk_parents[] = {
Rajendra Nayakcb268672012-11-06 15:41:08 -0700977 "mcbsp4_sync_mux_ck", "pad_clks_ck",
978};
979
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700980DEFINE_CLK_OMAP_MUX(per_mcbsp4_gfclk, "l4_per_clkdm", per_mcbsp4_gfclk_sel,
981 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
982 OMAP4430_CLKSEL_SOURCE_24_24_MASK, per_mcbsp4_gfclk_parents,
983 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700984
Rajendra Nayakcb268672012-11-06 15:41:08 -0700985static const struct clksel hsmmc1_fclk_sel[] = {
986 { .parent = &func_64m_fclk, .rates = div_1_0_rates },
987 { .parent = &func_96m_fclk, .rates = div_1_1_rates },
988 { .parent = NULL },
989};
990
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700991static const char *hsmmc1_fclk_parents[] = {
Rajendra Nayakcb268672012-11-06 15:41:08 -0700992 "func_64m_fclk", "func_96m_fclk",
993};
994
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700995DEFINE_CLK_OMAP_MUX(hsmmc1_fclk, "l3_init_clkdm", hsmmc1_fclk_sel,
996 OMAP4430_CM_L3INIT_MMC1_CLKCTRL, OMAP4430_CLKSEL_MASK,
997 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700998
Paul Walmsleyee877ac2013-01-26 00:48:55 -0700999DEFINE_CLK_OMAP_MUX(hsmmc2_fclk, "l3_init_clkdm", hsmmc1_fclk_sel,
1000 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK,
1001 hsmmc1_fclk_parents, func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001002
Rajendra Nayakcb268672012-11-06 15:41:08 -07001003DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0,
1004 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL,
1005 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1006
Rajendra Nayakcb268672012-11-06 15:41:08 -07001007DEFINE_CLK_GATE(slimbus1_fclk_1, "func_24m_clk", &func_24m_clk, 0x0,
1008 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1009 OMAP4430_OPTFCLKEN_FCLK1_SHIFT, 0x0, NULL);
1010
1011DEFINE_CLK_GATE(slimbus1_fclk_0, "abe_24m_fclk", &abe_24m_fclk, 0x0,
1012 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1013 OMAP4430_OPTFCLKEN_FCLK0_SHIFT, 0x0, NULL);
1014
1015DEFINE_CLK_GATE(slimbus1_fclk_2, "pad_clks_ck", &pad_clks_ck, 0x0,
1016 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1017 OMAP4430_OPTFCLKEN_FCLK2_SHIFT, 0x0, NULL);
1018
1019DEFINE_CLK_GATE(slimbus1_slimbus_clk, "slimbus_clk", &slimbus_clk, 0x0,
1020 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1021 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT, 0x0, NULL);
1022
Rajendra Nayakcb268672012-11-06 15:41:08 -07001023DEFINE_CLK_GATE(slimbus2_fclk_1, "per_abe_24m_fclk", &per_abe_24m_fclk, 0x0,
1024 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1025 OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT, 0x0, NULL);
1026
1027DEFINE_CLK_GATE(slimbus2_fclk_0, "func_24mc_fclk", &func_24mc_fclk, 0x0,
1028 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1029 OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT, 0x0, NULL);
1030
1031DEFINE_CLK_GATE(slimbus2_slimbus_clk, "pad_slimbus_core_clks_ck",
1032 &pad_slimbus_core_clks_ck, 0x0,
1033 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1034 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT, 0x0, NULL);
1035
Rajendra Nayakcb268672012-11-06 15:41:08 -07001036DEFINE_CLK_GATE(smartreflex_core_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1037 0x0, OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,
1038 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1039
1040DEFINE_CLK_GATE(smartreflex_iva_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1041 0x0, OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,
1042 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1043
1044DEFINE_CLK_GATE(smartreflex_mpu_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1045 0x0, OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,
1046 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1047
1048static const struct clksel dmt1_clk_mux_sel[] = {
1049 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
1050 { .parent = &sys_32k_ck, .rates = div_1_1_rates },
1051 { .parent = NULL },
1052};
1053
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001054DEFINE_CLK_OMAP_MUX(dmt1_clk_mux, "l4_wkup_clkdm", dmt1_clk_mux_sel,
1055 OMAP4430_CM_WKUP_TIMER1_CLKCTRL, OMAP4430_CLKSEL_MASK,
1056 abe_dpll_bypass_clk_mux_ck_parents,
1057 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001058
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001059DEFINE_CLK_OMAP_MUX(cm2_dm10_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1060 OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL, OMAP4430_CLKSEL_MASK,
1061 abe_dpll_bypass_clk_mux_ck_parents,
1062 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001063
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001064DEFINE_CLK_OMAP_MUX(cm2_dm11_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1065 OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL, OMAP4430_CLKSEL_MASK,
1066 abe_dpll_bypass_clk_mux_ck_parents,
1067 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001068
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001069DEFINE_CLK_OMAP_MUX(cm2_dm2_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1070 OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL, OMAP4430_CLKSEL_MASK,
1071 abe_dpll_bypass_clk_mux_ck_parents,
1072 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001073
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001074DEFINE_CLK_OMAP_MUX(cm2_dm3_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1075 OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL, OMAP4430_CLKSEL_MASK,
1076 abe_dpll_bypass_clk_mux_ck_parents,
1077 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001078
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001079DEFINE_CLK_OMAP_MUX(cm2_dm4_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1080 OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL, OMAP4430_CLKSEL_MASK,
1081 abe_dpll_bypass_clk_mux_ck_parents,
1082 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001083
1084static const struct clksel timer5_sync_mux_sel[] = {
1085 { .parent = &syc_clk_div_ck, .rates = div_1_0_rates },
1086 { .parent = &sys_32k_ck, .rates = div_1_1_rates },
1087 { .parent = NULL },
1088};
1089
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001090static const char *timer5_sync_mux_parents[] = {
Rajendra Nayakcb268672012-11-06 15:41:08 -07001091 "syc_clk_div_ck", "sys_32k_ck",
1092};
1093
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001094DEFINE_CLK_OMAP_MUX(timer5_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1095 OMAP4430_CM1_ABE_TIMER5_CLKCTRL, OMAP4430_CLKSEL_MASK,
1096 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001097
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001098DEFINE_CLK_OMAP_MUX(timer6_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1099 OMAP4430_CM1_ABE_TIMER6_CLKCTRL, OMAP4430_CLKSEL_MASK,
1100 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001101
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001102DEFINE_CLK_OMAP_MUX(timer7_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1103 OMAP4430_CM1_ABE_TIMER7_CLKCTRL, OMAP4430_CLKSEL_MASK,
1104 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001105
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001106DEFINE_CLK_OMAP_MUX(timer8_sync_mux, "abe_clkdm", timer5_sync_mux_sel,
1107 OMAP4430_CM1_ABE_TIMER8_CLKCTRL, OMAP4430_CLKSEL_MASK,
1108 timer5_sync_mux_parents, func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001109
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001110DEFINE_CLK_OMAP_MUX(cm2_dm9_mux, "l4_per_clkdm", dmt1_clk_mux_sel,
1111 OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL, OMAP4430_CLKSEL_MASK,
1112 abe_dpll_bypass_clk_mux_ck_parents,
1113 func_dmic_abe_gfclk_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -07001114
Rajendra Nayakcb268672012-11-06 15:41:08 -07001115static struct clk usb_host_fs_fck;
1116
1117static const char *usb_host_fs_fck_parent_names[] = {
1118 "func_48mc_fclk",
1119};
1120
1121static const struct clk_ops usb_host_fs_fck_ops = {
1122 .enable = &omap2_dflt_clk_enable,
1123 .disable = &omap2_dflt_clk_disable,
1124 .is_enabled = &omap2_dflt_clk_is_enabled,
1125};
1126
1127static struct clk_hw_omap usb_host_fs_fck_hw = {
1128 .hw = {
1129 .clk = &usb_host_fs_fck,
1130 },
1131 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL,
1132 .enable_bit = OMAP4430_MODULEMODE_SWCTRL_SHIFT,
1133 .clkdm_name = "l3_init_clkdm",
1134};
1135
1136DEFINE_STRUCT_CLK(usb_host_fs_fck, usb_host_fs_fck_parent_names,
1137 usb_host_fs_fck_ops);
1138
1139static const char *utmi_p1_gfclk_parents[] = {
1140 "init_60m_fclk", "xclk60mhsp1_ck",
1141};
1142
1143DEFINE_CLK_MUX(utmi_p1_gfclk, utmi_p1_gfclk_parents, NULL, 0x0,
1144 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1145 OMAP4430_CLKSEL_UTMI_P1_SHIFT, OMAP4430_CLKSEL_UTMI_P1_WIDTH,
1146 0x0, NULL);
1147
1148DEFINE_CLK_GATE(usb_host_hs_utmi_p1_clk, "utmi_p1_gfclk", &utmi_p1_gfclk, 0x0,
1149 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1150 OMAP4430_OPTFCLKEN_UTMI_P1_CLK_SHIFT, 0x0, NULL);
1151
1152static const char *utmi_p2_gfclk_parents[] = {
1153 "init_60m_fclk", "xclk60mhsp2_ck",
1154};
1155
1156DEFINE_CLK_MUX(utmi_p2_gfclk, utmi_p2_gfclk_parents, NULL, 0x0,
1157 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1158 OMAP4430_CLKSEL_UTMI_P2_SHIFT, OMAP4430_CLKSEL_UTMI_P2_WIDTH,
1159 0x0, NULL);
1160
1161DEFINE_CLK_GATE(usb_host_hs_utmi_p2_clk, "utmi_p2_gfclk", &utmi_p2_gfclk, 0x0,
1162 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1163 OMAP4430_OPTFCLKEN_UTMI_P2_CLK_SHIFT, 0x0, NULL);
1164
1165DEFINE_CLK_GATE(usb_host_hs_utmi_p3_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1166 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1167 OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT, 0x0, NULL);
1168
1169DEFINE_CLK_GATE(usb_host_hs_hsic480m_p1_clk, "dpll_usb_m2_ck",
1170 &dpll_usb_m2_ck, 0x0,
1171 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1172 OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT, 0x0, NULL);
1173
1174DEFINE_CLK_GATE(usb_host_hs_hsic60m_p1_clk, "init_60m_fclk",
1175 &init_60m_fclk, 0x0,
1176 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1177 OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT, 0x0, NULL);
1178
1179DEFINE_CLK_GATE(usb_host_hs_hsic60m_p2_clk, "init_60m_fclk",
1180 &init_60m_fclk, 0x0,
1181 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1182 OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT, 0x0, NULL);
1183
1184DEFINE_CLK_GATE(usb_host_hs_hsic480m_p2_clk, "dpll_usb_m2_ck",
1185 &dpll_usb_m2_ck, 0x0,
1186 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1187 OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT, 0x0, NULL);
1188
1189DEFINE_CLK_GATE(usb_host_hs_func48mclk, "func_48mc_fclk", &func_48mc_fclk, 0x0,
1190 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1191 OMAP4430_OPTFCLKEN_FUNC48MCLK_SHIFT, 0x0, NULL);
1192
1193DEFINE_CLK_GATE(usb_host_hs_fck, "init_60m_fclk", &init_60m_fclk, 0x0,
1194 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1195 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1196
1197static const char *otg_60m_gfclk_parents[] = {
1198 "utmi_phy_clkout_ck", "xclk60motg_ck",
1199};
1200
1201DEFINE_CLK_MUX(otg_60m_gfclk, otg_60m_gfclk_parents, NULL, 0x0,
1202 OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL, OMAP4430_CLKSEL_60M_SHIFT,
1203 OMAP4430_CLKSEL_60M_WIDTH, 0x0, NULL);
1204
1205DEFINE_CLK_GATE(usb_otg_hs_xclk, "otg_60m_gfclk", &otg_60m_gfclk, 0x0,
1206 OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
1207 OMAP4430_OPTFCLKEN_XCLK_SHIFT, 0x0, NULL);
1208
1209DEFINE_CLK_GATE(usb_otg_hs_ick, "l3_div_ck", &l3_div_ck, 0x0,
1210 OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
1211 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
1212
1213DEFINE_CLK_GATE(usb_phy_cm_clk32k, "sys_32k_ck", &sys_32k_ck, 0x0,
1214 OMAP4430_CM_ALWON_USBPHY_CLKCTRL,
1215 OMAP4430_OPTFCLKEN_CLK32K_SHIFT, 0x0, NULL);
1216
1217DEFINE_CLK_GATE(usb_tll_hs_usb_ch2_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1218 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1219 OMAP4430_OPTFCLKEN_USB_CH2_CLK_SHIFT, 0x0, NULL);
1220
1221DEFINE_CLK_GATE(usb_tll_hs_usb_ch0_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1222 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1223 OMAP4430_OPTFCLKEN_USB_CH0_CLK_SHIFT, 0x0, NULL);
1224
1225DEFINE_CLK_GATE(usb_tll_hs_usb_ch1_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1226 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1227 OMAP4430_OPTFCLKEN_USB_CH1_CLK_SHIFT, 0x0, NULL);
1228
1229DEFINE_CLK_GATE(usb_tll_hs_ick, "l4_div_ck", &l4_div_ck, 0x0,
1230 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1231 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
1232
1233static const struct clk_div_table usim_ck_rates[] = {
1234 { .div = 14, .val = 0 },
1235 { .div = 18, .val = 1 },
1236 { .div = 0 },
1237};
1238DEFINE_CLK_DIVIDER_TABLE(usim_ck, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, 0x0,
1239 OMAP4430_CM_WKUP_USIM_CLKCTRL,
1240 OMAP4430_CLKSEL_DIV_SHIFT, OMAP4430_CLKSEL_DIV_WIDTH,
1241 0x0, usim_ck_rates, NULL);
1242
1243DEFINE_CLK_GATE(usim_fclk, "usim_ck", &usim_ck, 0x0,
1244 OMAP4430_CM_WKUP_USIM_CLKCTRL, OMAP4430_OPTFCLKEN_FCLK_SHIFT,
1245 0x0, NULL);
1246
Rajendra Nayakcb268672012-11-06 15:41:08 -07001247/* Remaining optional clocks */
1248static const char *pmd_stm_clock_mux_ck_parents[] = {
1249 "sys_clkin_ck", "dpll_core_m6x2_ck", "tie_low_clock_ck",
1250};
1251
1252DEFINE_CLK_MUX(pmd_stm_clock_mux_ck, pmd_stm_clock_mux_ck_parents, NULL, 0x0,
1253 OMAP4430_CM_EMU_DEBUGSS_CLKCTRL, OMAP4430_PMD_STM_MUX_CTRL_SHIFT,
1254 OMAP4430_PMD_STM_MUX_CTRL_WIDTH, 0x0, NULL);
1255
1256DEFINE_CLK_MUX(pmd_trace_clk_mux_ck, pmd_stm_clock_mux_ck_parents, NULL, 0x0,
1257 OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
1258 OMAP4430_PMD_TRACE_MUX_CTRL_SHIFT,
1259 OMAP4430_PMD_TRACE_MUX_CTRL_WIDTH, 0x0, NULL);
1260
1261DEFINE_CLK_DIVIDER(stm_clk_div_ck, "pmd_stm_clock_mux_ck",
1262 &pmd_stm_clock_mux_ck, 0x0, OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
1263 OMAP4430_CLKSEL_PMD_STM_CLK_SHIFT,
1264 OMAP4430_CLKSEL_PMD_STM_CLK_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
1265 NULL);
1266
1267static const char *trace_clk_div_ck_parents[] = {
1268 "pmd_trace_clk_mux_ck",
1269};
1270
1271static const struct clksel trace_clk_div_div[] = {
1272 { .parent = &pmd_trace_clk_mux_ck, .rates = div3_1to4_rates },
1273 { .parent = NULL },
1274};
1275
1276static struct clk trace_clk_div_ck;
1277
1278static const struct clk_ops trace_clk_div_ck_ops = {
1279 .recalc_rate = &omap2_clksel_recalc,
1280 .set_rate = &omap2_clksel_set_rate,
1281 .round_rate = &omap2_clksel_round_rate,
1282 .init = &omap2_init_clk_clkdm,
1283 .enable = &omap2_clkops_enable_clkdm,
1284 .disable = &omap2_clkops_disable_clkdm,
1285};
1286
1287static struct clk_hw_omap trace_clk_div_ck_hw = {
1288 .hw = {
1289 .clk = &trace_clk_div_ck,
1290 },
1291 .clkdm_name = "emu_sys_clkdm",
1292 .clksel = trace_clk_div_div,
1293 .clksel_reg = OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
1294 .clksel_mask = OMAP4430_CLKSEL_PMD_TRACE_CLK_MASK,
1295};
1296
1297DEFINE_STRUCT_CLK(trace_clk_div_ck, trace_clk_div_ck_parents,
1298 trace_clk_div_ck_ops);
1299
1300/* SCRM aux clk nodes */
1301
1302static const struct clksel auxclk_src_sel[] = {
1303 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
1304 { .parent = &dpll_core_m3x2_ck, .rates = div_1_1_rates },
1305 { .parent = &dpll_per_m3x2_ck, .rates = div_1_2_rates },
1306 { .parent = NULL },
1307};
1308
1309static const char *auxclk_src_ck_parents[] = {
1310 "sys_clkin_ck", "dpll_core_m3x2_ck", "dpll_per_m3x2_ck",
1311};
1312
1313static const struct clk_ops auxclk_src_ck_ops = {
1314 .enable = &omap2_dflt_clk_enable,
1315 .disable = &omap2_dflt_clk_disable,
1316 .is_enabled = &omap2_dflt_clk_is_enabled,
1317 .recalc_rate = &omap2_clksel_recalc,
1318 .get_parent = &omap2_clksel_find_parent_index,
1319};
1320
1321DEFINE_CLK_OMAP_MUX_GATE(auxclk0_src_ck, NULL, auxclk_src_sel,
1322 OMAP4_SCRM_AUXCLK0, OMAP4_SRCSELECT_MASK,
1323 OMAP4_SCRM_AUXCLK0, OMAP4_ENABLE_SHIFT, NULL,
1324 auxclk_src_ck_parents, auxclk_src_ck_ops);
1325
1326DEFINE_CLK_DIVIDER(auxclk0_ck, "auxclk0_src_ck", &auxclk0_src_ck, 0x0,
1327 OMAP4_SCRM_AUXCLK0, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1328 0x0, NULL);
1329
1330DEFINE_CLK_OMAP_MUX_GATE(auxclk1_src_ck, NULL, auxclk_src_sel,
1331 OMAP4_SCRM_AUXCLK1, OMAP4_SRCSELECT_MASK,
1332 OMAP4_SCRM_AUXCLK1, OMAP4_ENABLE_SHIFT, NULL,
1333 auxclk_src_ck_parents, auxclk_src_ck_ops);
1334
1335DEFINE_CLK_DIVIDER(auxclk1_ck, "auxclk1_src_ck", &auxclk1_src_ck, 0x0,
1336 OMAP4_SCRM_AUXCLK1, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1337 0x0, NULL);
1338
1339DEFINE_CLK_OMAP_MUX_GATE(auxclk2_src_ck, NULL, auxclk_src_sel,
1340 OMAP4_SCRM_AUXCLK2, OMAP4_SRCSELECT_MASK,
1341 OMAP4_SCRM_AUXCLK2, OMAP4_ENABLE_SHIFT, NULL,
1342 auxclk_src_ck_parents, auxclk_src_ck_ops);
1343
1344DEFINE_CLK_DIVIDER(auxclk2_ck, "auxclk2_src_ck", &auxclk2_src_ck, 0x0,
1345 OMAP4_SCRM_AUXCLK2, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1346 0x0, NULL);
1347
1348DEFINE_CLK_OMAP_MUX_GATE(auxclk3_src_ck, NULL, auxclk_src_sel,
1349 OMAP4_SCRM_AUXCLK3, OMAP4_SRCSELECT_MASK,
1350 OMAP4_SCRM_AUXCLK3, OMAP4_ENABLE_SHIFT, NULL,
1351 auxclk_src_ck_parents, auxclk_src_ck_ops);
1352
1353DEFINE_CLK_DIVIDER(auxclk3_ck, "auxclk3_src_ck", &auxclk3_src_ck, 0x0,
1354 OMAP4_SCRM_AUXCLK3, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1355 0x0, NULL);
1356
1357DEFINE_CLK_OMAP_MUX_GATE(auxclk4_src_ck, NULL, auxclk_src_sel,
1358 OMAP4_SCRM_AUXCLK4, OMAP4_SRCSELECT_MASK,
1359 OMAP4_SCRM_AUXCLK4, OMAP4_ENABLE_SHIFT, NULL,
1360 auxclk_src_ck_parents, auxclk_src_ck_ops);
1361
1362DEFINE_CLK_DIVIDER(auxclk4_ck, "auxclk4_src_ck", &auxclk4_src_ck, 0x0,
1363 OMAP4_SCRM_AUXCLK4, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1364 0x0, NULL);
1365
1366DEFINE_CLK_OMAP_MUX_GATE(auxclk5_src_ck, NULL, auxclk_src_sel,
1367 OMAP4_SCRM_AUXCLK5, OMAP4_SRCSELECT_MASK,
1368 OMAP4_SCRM_AUXCLK5, OMAP4_ENABLE_SHIFT, NULL,
1369 auxclk_src_ck_parents, auxclk_src_ck_ops);
1370
1371DEFINE_CLK_DIVIDER(auxclk5_ck, "auxclk5_src_ck", &auxclk5_src_ck, 0x0,
1372 OMAP4_SCRM_AUXCLK5, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1373 0x0, NULL);
1374
1375static const char *auxclkreq_ck_parents[] = {
1376 "auxclk0_ck", "auxclk1_ck", "auxclk2_ck", "auxclk3_ck", "auxclk4_ck",
1377 "auxclk5_ck",
1378};
1379
1380DEFINE_CLK_MUX(auxclkreq0_ck, auxclkreq_ck_parents, NULL, 0x0,
1381 OMAP4_SCRM_AUXCLKREQ0, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1382 0x0, NULL);
1383
1384DEFINE_CLK_MUX(auxclkreq1_ck, auxclkreq_ck_parents, NULL, 0x0,
1385 OMAP4_SCRM_AUXCLKREQ1, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1386 0x0, NULL);
1387
1388DEFINE_CLK_MUX(auxclkreq2_ck, auxclkreq_ck_parents, NULL, 0x0,
1389 OMAP4_SCRM_AUXCLKREQ2, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1390 0x0, NULL);
1391
1392DEFINE_CLK_MUX(auxclkreq3_ck, auxclkreq_ck_parents, NULL, 0x0,
1393 OMAP4_SCRM_AUXCLKREQ3, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1394 0x0, NULL);
1395
1396DEFINE_CLK_MUX(auxclkreq4_ck, auxclkreq_ck_parents, NULL, 0x0,
1397 OMAP4_SCRM_AUXCLKREQ4, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1398 0x0, NULL);
1399
1400DEFINE_CLK_MUX(auxclkreq5_ck, auxclkreq_ck_parents, NULL, 0x0,
1401 OMAP4_SCRM_AUXCLKREQ5, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1402 0x0, NULL);
1403
1404/*
1405 * clkdev
1406 */
1407
1408static struct omap_clk omap44xx_clks[] = {
1409 CLK(NULL, "extalt_clkin_ck", &extalt_clkin_ck, CK_443X),
1410 CLK(NULL, "pad_clks_src_ck", &pad_clks_src_ck, CK_443X),
1411 CLK(NULL, "pad_clks_ck", &pad_clks_ck, CK_443X),
1412 CLK(NULL, "pad_slimbus_core_clks_ck", &pad_slimbus_core_clks_ck, CK_443X),
1413 CLK(NULL, "secure_32k_clk_src_ck", &secure_32k_clk_src_ck, CK_443X),
1414 CLK(NULL, "slimbus_src_clk", &slimbus_src_clk, CK_443X),
1415 CLK(NULL, "slimbus_clk", &slimbus_clk, CK_443X),
1416 CLK(NULL, "sys_32k_ck", &sys_32k_ck, CK_443X),
1417 CLK(NULL, "virt_12000000_ck", &virt_12000000_ck, CK_443X),
1418 CLK(NULL, "virt_13000000_ck", &virt_13000000_ck, CK_443X),
1419 CLK(NULL, "virt_16800000_ck", &virt_16800000_ck, CK_443X),
1420 CLK(NULL, "virt_19200000_ck", &virt_19200000_ck, CK_443X),
1421 CLK(NULL, "virt_26000000_ck", &virt_26000000_ck, CK_443X),
1422 CLK(NULL, "virt_27000000_ck", &virt_27000000_ck, CK_443X),
1423 CLK(NULL, "virt_38400000_ck", &virt_38400000_ck, CK_443X),
1424 CLK(NULL, "sys_clkin_ck", &sys_clkin_ck, CK_443X),
1425 CLK(NULL, "tie_low_clock_ck", &tie_low_clock_ck, CK_443X),
1426 CLK(NULL, "utmi_phy_clkout_ck", &utmi_phy_clkout_ck, CK_443X),
1427 CLK(NULL, "xclk60mhsp1_ck", &xclk60mhsp1_ck, CK_443X),
1428 CLK(NULL, "xclk60mhsp2_ck", &xclk60mhsp2_ck, CK_443X),
1429 CLK(NULL, "xclk60motg_ck", &xclk60motg_ck, CK_443X),
1430 CLK(NULL, "abe_dpll_bypass_clk_mux_ck", &abe_dpll_bypass_clk_mux_ck, CK_443X),
1431 CLK(NULL, "abe_dpll_refclk_mux_ck", &abe_dpll_refclk_mux_ck, CK_443X),
1432 CLK(NULL, "dpll_abe_ck", &dpll_abe_ck, CK_443X),
1433 CLK(NULL, "dpll_abe_x2_ck", &dpll_abe_x2_ck, CK_443X),
1434 CLK(NULL, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck, CK_443X),
1435 CLK(NULL, "abe_24m_fclk", &abe_24m_fclk, CK_443X),
1436 CLK(NULL, "abe_clk", &abe_clk, CK_443X),
1437 CLK(NULL, "aess_fclk", &aess_fclk, CK_443X),
1438 CLK(NULL, "dpll_abe_m3x2_ck", &dpll_abe_m3x2_ck, CK_443X),
1439 CLK(NULL, "core_hsd_byp_clk_mux_ck", &core_hsd_byp_clk_mux_ck, CK_443X),
1440 CLK(NULL, "dpll_core_ck", &dpll_core_ck, CK_443X),
1441 CLK(NULL, "dpll_core_x2_ck", &dpll_core_x2_ck, CK_443X),
1442 CLK(NULL, "dpll_core_m6x2_ck", &dpll_core_m6x2_ck, CK_443X),
1443 CLK(NULL, "dbgclk_mux_ck", &dbgclk_mux_ck, CK_443X),
1444 CLK(NULL, "dpll_core_m2_ck", &dpll_core_m2_ck, CK_443X),
1445 CLK(NULL, "ddrphy_ck", &ddrphy_ck, CK_443X),
1446 CLK(NULL, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, CK_443X),
1447 CLK(NULL, "div_core_ck", &div_core_ck, CK_443X),
1448 CLK(NULL, "div_iva_hs_clk", &div_iva_hs_clk, CK_443X),
1449 CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk, CK_443X),
1450 CLK(NULL, "dpll_core_m4x2_ck", &dpll_core_m4x2_ck, CK_443X),
1451 CLK(NULL, "dll_clk_div_ck", &dll_clk_div_ck, CK_443X),
1452 CLK(NULL, "dpll_abe_m2_ck", &dpll_abe_m2_ck, CK_443X),
1453 CLK(NULL, "dpll_core_m3x2_ck", &dpll_core_m3x2_ck, CK_443X),
1454 CLK(NULL, "dpll_core_m7x2_ck", &dpll_core_m7x2_ck, CK_443X),
1455 CLK(NULL, "iva_hsd_byp_clk_mux_ck", &iva_hsd_byp_clk_mux_ck, CK_443X),
1456 CLK(NULL, "dpll_iva_ck", &dpll_iva_ck, CK_443X),
1457 CLK(NULL, "dpll_iva_x2_ck", &dpll_iva_x2_ck, CK_443X),
1458 CLK(NULL, "dpll_iva_m4x2_ck", &dpll_iva_m4x2_ck, CK_443X),
1459 CLK(NULL, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck, CK_443X),
1460 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_443X),
1461 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_443X),
1462 CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck, CK_443X),
1463 CLK(NULL, "per_hsd_byp_clk_mux_ck", &per_hsd_byp_clk_mux_ck, CK_443X),
1464 CLK(NULL, "dpll_per_ck", &dpll_per_ck, CK_443X),
1465 CLK(NULL, "dpll_per_m2_ck", &dpll_per_m2_ck, CK_443X),
1466 CLK(NULL, "dpll_per_x2_ck", &dpll_per_x2_ck, CK_443X),
1467 CLK(NULL, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, CK_443X),
1468 CLK(NULL, "dpll_per_m3x2_ck", &dpll_per_m3x2_ck, CK_443X),
1469 CLK(NULL, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, CK_443X),
1470 CLK(NULL, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck, CK_443X),
1471 CLK(NULL, "dpll_per_m6x2_ck", &dpll_per_m6x2_ck, CK_443X),
1472 CLK(NULL, "dpll_per_m7x2_ck", &dpll_per_m7x2_ck, CK_443X),
1473 CLK(NULL, "usb_hs_clk_div_ck", &usb_hs_clk_div_ck, CK_443X),
1474 CLK(NULL, "dpll_usb_ck", &dpll_usb_ck, CK_443X),
1475 CLK(NULL, "dpll_usb_clkdcoldo_ck", &dpll_usb_clkdcoldo_ck, CK_443X),
1476 CLK(NULL, "dpll_usb_m2_ck", &dpll_usb_m2_ck, CK_443X),
1477 CLK(NULL, "ducati_clk_mux_ck", &ducati_clk_mux_ck, CK_443X),
1478 CLK(NULL, "func_12m_fclk", &func_12m_fclk, CK_443X),
1479 CLK(NULL, "func_24m_clk", &func_24m_clk, CK_443X),
1480 CLK(NULL, "func_24mc_fclk", &func_24mc_fclk, CK_443X),
1481 CLK(NULL, "func_48m_fclk", &func_48m_fclk, CK_443X),
1482 CLK(NULL, "func_48mc_fclk", &func_48mc_fclk, CK_443X),
1483 CLK(NULL, "func_64m_fclk", &func_64m_fclk, CK_443X),
1484 CLK(NULL, "func_96m_fclk", &func_96m_fclk, CK_443X),
1485 CLK(NULL, "init_60m_fclk", &init_60m_fclk, CK_443X),
1486 CLK(NULL, "l3_div_ck", &l3_div_ck, CK_443X),
1487 CLK(NULL, "l4_div_ck", &l4_div_ck, CK_443X),
1488 CLK(NULL, "lp_clk_div_ck", &lp_clk_div_ck, CK_443X),
1489 CLK(NULL, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck, CK_443X),
1490 CLK("smp_twd", NULL, &mpu_periphclk, CK_443X),
1491 CLK(NULL, "ocp_abe_iclk", &ocp_abe_iclk, CK_443X),
1492 CLK(NULL, "per_abe_24m_fclk", &per_abe_24m_fclk, CK_443X),
1493 CLK(NULL, "per_abe_nc_fclk", &per_abe_nc_fclk, CK_443X),
1494 CLK(NULL, "syc_clk_div_ck", &syc_clk_div_ck, CK_443X),
1495 CLK(NULL, "aes1_fck", &aes1_fck, CK_443X),
1496 CLK(NULL, "aes2_fck", &aes2_fck, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001497 CLK(NULL, "bandgap_fclk", &bandgap_fclk, CK_443X),
1498 CLK(NULL, "div_ts_ck", &div_ts_ck, CK_446X),
1499 CLK(NULL, "bandgap_ts_fclk", &bandgap_ts_fclk, CK_446X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001500 CLK(NULL, "dmic_sync_mux_ck", &dmic_sync_mux_ck, CK_443X),
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001501 CLK(NULL, "func_dmic_abe_gfclk", &func_dmic_abe_gfclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001502 CLK(NULL, "dss_sys_clk", &dss_sys_clk, CK_443X),
1503 CLK(NULL, "dss_tv_clk", &dss_tv_clk, CK_443X),
1504 CLK(NULL, "dss_dss_clk", &dss_dss_clk, CK_443X),
1505 CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk, CK_443X),
1506 CLK(NULL, "dss_fck", &dss_fck, CK_443X),
1507 CLK("omapdss_dss", "ick", &dss_fck, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001508 CLK(NULL, "fdif_fck", &fdif_fck, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001509 CLK(NULL, "gpio1_dbclk", &gpio1_dbclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001510 CLK(NULL, "gpio2_dbclk", &gpio2_dbclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001511 CLK(NULL, "gpio3_dbclk", &gpio3_dbclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001512 CLK(NULL, "gpio4_dbclk", &gpio4_dbclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001513 CLK(NULL, "gpio5_dbclk", &gpio5_dbclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001514 CLK(NULL, "gpio6_dbclk", &gpio6_dbclk, CK_443X),
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001515 CLK(NULL, "sgx_clk_mux", &sgx_clk_mux, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001516 CLK(NULL, "hsi_fck", &hsi_fck, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001517 CLK(NULL, "iss_ctrlclk", &iss_ctrlclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001518 CLK(NULL, "mcasp_sync_mux_ck", &mcasp_sync_mux_ck, CK_443X),
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001519 CLK(NULL, "func_mcasp_abe_gfclk", &func_mcasp_abe_gfclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001520 CLK(NULL, "mcbsp1_sync_mux_ck", &mcbsp1_sync_mux_ck, CK_443X),
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001521 CLK(NULL, "func_mcbsp1_gfclk", &func_mcbsp1_gfclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001522 CLK(NULL, "mcbsp2_sync_mux_ck", &mcbsp2_sync_mux_ck, CK_443X),
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001523 CLK(NULL, "func_mcbsp2_gfclk", &func_mcbsp2_gfclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001524 CLK(NULL, "mcbsp3_sync_mux_ck", &mcbsp3_sync_mux_ck, CK_443X),
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001525 CLK(NULL, "func_mcbsp3_gfclk", &func_mcbsp3_gfclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001526 CLK(NULL, "mcbsp4_sync_mux_ck", &mcbsp4_sync_mux_ck, CK_443X),
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001527 CLK(NULL, "per_mcbsp4_gfclk", &per_mcbsp4_gfclk, CK_443X),
1528 CLK(NULL, "hsmmc1_fclk", &hsmmc1_fclk, CK_443X),
1529 CLK(NULL, "hsmmc2_fclk", &hsmmc2_fclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001530 CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001531 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1, CK_443X),
1532 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0, CK_443X),
1533 CLK(NULL, "slimbus1_fclk_2", &slimbus1_fclk_2, CK_443X),
1534 CLK(NULL, "slimbus1_slimbus_clk", &slimbus1_slimbus_clk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001535 CLK(NULL, "slimbus2_fclk_1", &slimbus2_fclk_1, CK_443X),
1536 CLK(NULL, "slimbus2_fclk_0", &slimbus2_fclk_0, CK_443X),
1537 CLK(NULL, "slimbus2_slimbus_clk", &slimbus2_slimbus_clk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001538 CLK(NULL, "smartreflex_core_fck", &smartreflex_core_fck, CK_443X),
1539 CLK(NULL, "smartreflex_iva_fck", &smartreflex_iva_fck, CK_443X),
1540 CLK(NULL, "smartreflex_mpu_fck", &smartreflex_mpu_fck, CK_443X),
Paul Walmsleyee877ac2013-01-26 00:48:55 -07001541 CLK(NULL, "dmt1_clk_mux", &dmt1_clk_mux, CK_443X),
1542 CLK(NULL, "cm2_dm10_mux", &cm2_dm10_mux, CK_443X),
1543 CLK(NULL, "cm2_dm11_mux", &cm2_dm11_mux, CK_443X),
1544 CLK(NULL, "cm2_dm2_mux", &cm2_dm2_mux, CK_443X),
1545 CLK(NULL, "cm2_dm3_mux", &cm2_dm3_mux, CK_443X),
1546 CLK(NULL, "cm2_dm4_mux", &cm2_dm4_mux, CK_443X),
1547 CLK(NULL, "timer5_sync_mux", &timer5_sync_mux, CK_443X),
1548 CLK(NULL, "timer6_sync_mux", &timer6_sync_mux, CK_443X),
1549 CLK(NULL, "timer7_sync_mux", &timer7_sync_mux, CK_443X),
1550 CLK(NULL, "timer8_sync_mux", &timer8_sync_mux, CK_443X),
1551 CLK(NULL, "cm2_dm9_mux", &cm2_dm9_mux, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001552 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
1553 CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X),
1554 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
1555 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
1556 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
1557 CLK(NULL, "usb_host_hs_utmi_p2_clk", &usb_host_hs_utmi_p2_clk, CK_443X),
1558 CLK(NULL, "usb_host_hs_utmi_p3_clk", &usb_host_hs_utmi_p3_clk, CK_443X),
1559 CLK(NULL, "usb_host_hs_hsic480m_p1_clk", &usb_host_hs_hsic480m_p1_clk, CK_443X),
1560 CLK(NULL, "usb_host_hs_hsic60m_p1_clk", &usb_host_hs_hsic60m_p1_clk, CK_443X),
1561 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
1562 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
1563 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
1564 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X),
1565 CLK("usbhs_omap", "hs_fck", &usb_host_hs_fck, CK_443X),
1566 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X),
1567 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X),
1568 CLK(NULL, "usb_otg_hs_ick", &usb_otg_hs_ick, CK_443X),
1569 CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X),
1570 CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X),
1571 CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X),
1572 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X),
1573 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X),
1574 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X),
1575 CLK("usbhs_omap", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
1576 CLK("usbhs_tll", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
1577 CLK(NULL, "usim_ck", &usim_ck, CK_443X),
1578 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001579 CLK(NULL, "pmd_stm_clock_mux_ck", &pmd_stm_clock_mux_ck, CK_443X),
1580 CLK(NULL, "pmd_trace_clk_mux_ck", &pmd_trace_clk_mux_ck, CK_443X),
1581 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X),
1582 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X),
1583 CLK(NULL, "auxclk0_src_ck", &auxclk0_src_ck, CK_443X),
1584 CLK(NULL, "auxclk0_ck", &auxclk0_ck, CK_443X),
1585 CLK(NULL, "auxclkreq0_ck", &auxclkreq0_ck, CK_443X),
1586 CLK(NULL, "auxclk1_src_ck", &auxclk1_src_ck, CK_443X),
1587 CLK(NULL, "auxclk1_ck", &auxclk1_ck, CK_443X),
1588 CLK(NULL, "auxclkreq1_ck", &auxclkreq1_ck, CK_443X),
1589 CLK(NULL, "auxclk2_src_ck", &auxclk2_src_ck, CK_443X),
1590 CLK(NULL, "auxclk2_ck", &auxclk2_ck, CK_443X),
1591 CLK(NULL, "auxclkreq2_ck", &auxclkreq2_ck, CK_443X),
1592 CLK(NULL, "auxclk3_src_ck", &auxclk3_src_ck, CK_443X),
1593 CLK(NULL, "auxclk3_ck", &auxclk3_ck, CK_443X),
1594 CLK(NULL, "auxclkreq3_ck", &auxclkreq3_ck, CK_443X),
1595 CLK(NULL, "auxclk4_src_ck", &auxclk4_src_ck, CK_443X),
1596 CLK(NULL, "auxclk4_ck", &auxclk4_ck, CK_443X),
1597 CLK(NULL, "auxclkreq4_ck", &auxclkreq4_ck, CK_443X),
1598 CLK(NULL, "auxclk5_src_ck", &auxclk5_src_ck, CK_443X),
1599 CLK(NULL, "auxclk5_ck", &auxclk5_ck, CK_443X),
1600 CLK(NULL, "auxclkreq5_ck", &auxclkreq5_ck, CK_443X),
1601 CLK("omap-gpmc", "fck", &dummy_ck, CK_443X),
1602 CLK("omap_i2c.1", "ick", &dummy_ck, CK_443X),
1603 CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X),
1604 CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X),
1605 CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X),
1606 CLK(NULL, "mailboxes_ick", &dummy_ck, CK_443X),
1607 CLK("omap_hsmmc.0", "ick", &dummy_ck, CK_443X),
1608 CLK("omap_hsmmc.1", "ick", &dummy_ck, CK_443X),
1609 CLK("omap_hsmmc.2", "ick", &dummy_ck, CK_443X),
1610 CLK("omap_hsmmc.3", "ick", &dummy_ck, CK_443X),
1611 CLK("omap_hsmmc.4", "ick", &dummy_ck, CK_443X),
1612 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X),
1613 CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X),
1614 CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X),
1615 CLK("omap-mcbsp.4", "ick", &dummy_ck, CK_443X),
1616 CLK("omap2_mcspi.1", "ick", &dummy_ck, CK_443X),
1617 CLK("omap2_mcspi.2", "ick", &dummy_ck, CK_443X),
1618 CLK("omap2_mcspi.3", "ick", &dummy_ck, CK_443X),
1619 CLK("omap2_mcspi.4", "ick", &dummy_ck, CK_443X),
1620 CLK(NULL, "uart1_ick", &dummy_ck, CK_443X),
1621 CLK(NULL, "uart2_ick", &dummy_ck, CK_443X),
1622 CLK(NULL, "uart3_ick", &dummy_ck, CK_443X),
1623 CLK(NULL, "uart4_ick", &dummy_ck, CK_443X),
1624 CLK("usbhs_omap", "usbhost_ick", &dummy_ck, CK_443X),
1625 CLK("usbhs_omap", "usbtll_fck", &dummy_ck, CK_443X),
1626 CLK("usbhs_tll", "usbtll_fck", &dummy_ck, CK_443X),
1627 CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
1628 CLK(NULL, "timer_32k_ck", &sys_32k_ck, CK_443X),
1629 /* TODO: Remove "omap_timer.X" aliases once DT migration is complete */
1630 CLK("omap_timer.1", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1631 CLK("omap_timer.2", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1632 CLK("omap_timer.3", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1633 CLK("omap_timer.4", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1634 CLK("omap_timer.9", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1635 CLK("omap_timer.10", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1636 CLK("omap_timer.11", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1637 CLK("omap_timer.5", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1638 CLK("omap_timer.6", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1639 CLK("omap_timer.7", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1640 CLK("omap_timer.8", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1641 CLK("4a318000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1642 CLK("48032000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1643 CLK("48034000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1644 CLK("48036000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1645 CLK("4803e000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1646 CLK("48086000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1647 CLK("48088000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
Jon Hunterba68c7e2012-12-15 01:35:39 -07001648 CLK("40138000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1649 CLK("4013a000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1650 CLK("4013c000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1651 CLK("4013e000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001652 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X),
1653};
1654
Rajendra Nayakcb268672012-11-06 15:41:08 -07001655int __init omap4xxx_clk_init(void)
1656{
1657 u32 cpu_clkflg;
1658 struct omap_clk *c;
Jon Hunter8c197cc2012-12-15 01:35:50 -07001659 int rc;
Rajendra Nayakcb268672012-11-06 15:41:08 -07001660
1661 if (cpu_is_omap443x()) {
1662 cpu_mask = RATE_IN_4430;
1663 cpu_clkflg = CK_443X;
1664 } else if (cpu_is_omap446x() || cpu_is_omap447x()) {
1665 cpu_mask = RATE_IN_4460 | RATE_IN_4430;
1666 cpu_clkflg = CK_446X | CK_443X;
1667
1668 if (cpu_is_omap447x())
1669 pr_warn("WARNING: OMAP4470 clock data incomplete!\n");
1670 } else {
1671 return 0;
1672 }
1673
1674 for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks);
1675 c++) {
1676 if (c->cpu & cpu_clkflg) {
1677 clkdev_add(&c->lk);
1678 if (!__clk_init(NULL, c->lk.clk))
1679 omap2_init_clk_hw_omap_clocks(c->lk.clk);
1680 }
1681 }
1682
1683 omap2_clk_disable_autoidle_all();
1684
Jon Hunter8c197cc2012-12-15 01:35:50 -07001685 /*
1686 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
1687 * state when turning the ABE clock domain. Workaround this by
1688 * locking the ABE DPLL on boot.
Peter Ujfalusi981827a2013-01-18 16:48:15 -07001689 * Lock the ABE DPLL in any case to avoid issues with audio.
Jon Hunter8c197cc2012-12-15 01:35:50 -07001690 */
Peter Ujfalusi981827a2013-01-18 16:48:15 -07001691 rc = clk_set_parent(&abe_dpll_refclk_mux_ck, &sys_32k_ck);
1692 if (!rc)
1693 rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ);
1694 if (rc)
1695 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
Jon Hunter8c197cc2012-12-15 01:35:50 -07001696
Rajendra Nayakcb268672012-11-06 15:41:08 -07001697 return 0;
1698}