blob: 259280ad605964ed6abdc33f8a434effef3a772a [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.
19 */
20
21#include <linux/kernel.h>
22#include <linux/list.h>
23#include <linux/clk-private.h>
24#include <linux/clkdev.h>
25#include <linux/io.h>
26
27#include "soc.h"
28#include "iomap.h"
29#include "clock.h"
30#include "clock44xx.h"
31#include "cm1_44xx.h"
32#include "cm2_44xx.h"
33#include "cm-regbits-44xx.h"
34#include "prm44xx.h"
35#include "prm-regbits-44xx.h"
36#include "control.h"
37#include "scrm44xx.h"
38
39/* OMAP4 modulemode control */
40#define OMAP4430_MODULEMODE_HWCTRL_SHIFT 0
41#define OMAP4430_MODULEMODE_SWCTRL_SHIFT 1
42
Jon Hunter8c197cc2012-12-15 01:35:50 -070043/*
44 * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section
45 * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK
46 * must be set to 196.608 MHz" and hence, the DPLL locked frequency is
47 * half of this value.
48 */
49#define OMAP4_DPLL_ABE_DEFFREQ 98304000
50
Rajendra Nayakcb268672012-11-06 15:41:08 -070051/* Root clocks */
52
53DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);
54
55DEFINE_CLK_FIXED_RATE(pad_clks_src_ck, CLK_IS_ROOT, 12000000, 0x0);
56
57DEFINE_CLK_GATE(pad_clks_ck, "pad_clks_src_ck", &pad_clks_src_ck, 0x0,
58 OMAP4430_CM_CLKSEL_ABE, OMAP4430_PAD_CLKS_GATE_SHIFT,
59 0x0, NULL);
60
61DEFINE_CLK_FIXED_RATE(pad_slimbus_core_clks_ck, CLK_IS_ROOT, 12000000, 0x0);
62
63DEFINE_CLK_FIXED_RATE(secure_32k_clk_src_ck, CLK_IS_ROOT, 32768, 0x0);
64
65DEFINE_CLK_FIXED_RATE(slimbus_src_clk, CLK_IS_ROOT, 12000000, 0x0);
66
67DEFINE_CLK_GATE(slimbus_clk, "slimbus_src_clk", &slimbus_src_clk, 0x0,
68 OMAP4430_CM_CLKSEL_ABE, OMAP4430_SLIMBUS_CLK_GATE_SHIFT,
69 0x0, NULL);
70
71DEFINE_CLK_FIXED_RATE(sys_32k_ck, CLK_IS_ROOT, 32768, 0x0);
72
73DEFINE_CLK_FIXED_RATE(virt_12000000_ck, CLK_IS_ROOT, 12000000, 0x0);
74
75DEFINE_CLK_FIXED_RATE(virt_13000000_ck, CLK_IS_ROOT, 13000000, 0x0);
76
77DEFINE_CLK_FIXED_RATE(virt_16800000_ck, CLK_IS_ROOT, 16800000, 0x0);
78
79DEFINE_CLK_FIXED_RATE(virt_19200000_ck, CLK_IS_ROOT, 19200000, 0x0);
80
81DEFINE_CLK_FIXED_RATE(virt_26000000_ck, CLK_IS_ROOT, 26000000, 0x0);
82
83DEFINE_CLK_FIXED_RATE(virt_27000000_ck, CLK_IS_ROOT, 27000000, 0x0);
84
85DEFINE_CLK_FIXED_RATE(virt_38400000_ck, CLK_IS_ROOT, 38400000, 0x0);
86
87static const char *sys_clkin_ck_parents[] = {
88 "virt_12000000_ck", "virt_13000000_ck", "virt_16800000_ck",
89 "virt_19200000_ck", "virt_26000000_ck", "virt_27000000_ck",
90 "virt_38400000_ck",
91};
92
93DEFINE_CLK_MUX(sys_clkin_ck, sys_clkin_ck_parents, NULL, 0x0,
94 OMAP4430_CM_SYS_CLKSEL, OMAP4430_SYS_CLKSEL_SHIFT,
95 OMAP4430_SYS_CLKSEL_WIDTH, CLK_MUX_INDEX_ONE, NULL);
96
97DEFINE_CLK_FIXED_RATE(tie_low_clock_ck, CLK_IS_ROOT, 0, 0x0);
98
99DEFINE_CLK_FIXED_RATE(utmi_phy_clkout_ck, CLK_IS_ROOT, 60000000, 0x0);
100
101DEFINE_CLK_FIXED_RATE(xclk60mhsp1_ck, CLK_IS_ROOT, 60000000, 0x0);
102
103DEFINE_CLK_FIXED_RATE(xclk60mhsp2_ck, CLK_IS_ROOT, 60000000, 0x0);
104
105DEFINE_CLK_FIXED_RATE(xclk60motg_ck, CLK_IS_ROOT, 60000000, 0x0);
106
107/* Module clocks and DPLL outputs */
108
109static const char *abe_dpll_bypass_clk_mux_ck_parents[] = {
110 "sys_clkin_ck", "sys_32k_ck",
111};
112
113DEFINE_CLK_MUX(abe_dpll_bypass_clk_mux_ck, abe_dpll_bypass_clk_mux_ck_parents,
114 NULL, 0x0, OMAP4430_CM_L4_WKUP_CLKSEL, OMAP4430_CLKSEL_SHIFT,
115 OMAP4430_CLKSEL_WIDTH, 0x0, NULL);
116
117DEFINE_CLK_MUX(abe_dpll_refclk_mux_ck, abe_dpll_bypass_clk_mux_ck_parents, NULL,
118 0x0, OMAP4430_CM_ABE_PLL_REF_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
119 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
120
121/* DPLL_ABE */
122static struct dpll_data dpll_abe_dd = {
123 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_ABE,
124 .clk_bypass = &abe_dpll_bypass_clk_mux_ck,
125 .clk_ref = &abe_dpll_refclk_mux_ck,
126 .control_reg = OMAP4430_CM_CLKMODE_DPLL_ABE,
127 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
128 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_ABE,
129 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_ABE,
130 .mult_mask = OMAP4430_DPLL_MULT_MASK,
131 .div1_mask = OMAP4430_DPLL_DIV_MASK,
132 .enable_mask = OMAP4430_DPLL_EN_MASK,
133 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
134 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
Jon Hunter3ff51ed2012-12-15 01:35:46 -0700135 .m4xen_mask = OMAP4430_DPLL_REGM4XEN_MASK,
136 .lpmode_mask = OMAP4430_DPLL_LPMODE_EN_MASK,
Rajendra Nayakcb268672012-11-06 15:41:08 -0700137 .max_multiplier = 2047,
138 .max_divider = 128,
139 .min_divider = 1,
140};
141
142
143static const char *dpll_abe_ck_parents[] = {
144 "abe_dpll_refclk_mux_ck",
145};
146
147static struct clk dpll_abe_ck;
148
149static const struct clk_ops dpll_abe_ck_ops = {
150 .enable = &omap3_noncore_dpll_enable,
151 .disable = &omap3_noncore_dpll_disable,
152 .recalc_rate = &omap4_dpll_regm4xen_recalc,
153 .round_rate = &omap4_dpll_regm4xen_round_rate,
154 .set_rate = &omap3_noncore_dpll_set_rate,
155 .get_parent = &omap2_init_dpll_parent,
156};
157
158static struct clk_hw_omap dpll_abe_ck_hw = {
159 .hw = {
160 .clk = &dpll_abe_ck,
161 },
162 .dpll_data = &dpll_abe_dd,
163 .ops = &clkhwops_omap3_dpll,
164};
165
166DEFINE_STRUCT_CLK(dpll_abe_ck, dpll_abe_ck_parents, dpll_abe_ck_ops);
167
168static const char *dpll_abe_x2_ck_parents[] = {
169 "dpll_abe_ck",
170};
171
172static struct clk dpll_abe_x2_ck;
173
174static const struct clk_ops dpll_abe_x2_ck_ops = {
175 .recalc_rate = &omap3_clkoutx2_recalc,
176};
177
178static struct clk_hw_omap dpll_abe_x2_ck_hw = {
179 .hw = {
180 .clk = &dpll_abe_x2_ck,
181 },
182 .flags = CLOCK_CLKOUTX2,
183 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
184 .ops = &clkhwops_omap4_dpllmx,
185};
186
187DEFINE_STRUCT_CLK(dpll_abe_x2_ck, dpll_abe_x2_ck_parents, dpll_abe_x2_ck_ops);
188
189static const struct clk_ops omap_hsdivider_ops = {
190 .set_rate = &omap2_clksel_set_rate,
191 .recalc_rate = &omap2_clksel_recalc,
192 .round_rate = &omap2_clksel_round_rate,
193};
194
195DEFINE_CLK_OMAP_HSDIVIDER(dpll_abe_m2x2_ck, "dpll_abe_x2_ck", &dpll_abe_x2_ck,
196 0x0, OMAP4430_CM_DIV_M2_DPLL_ABE,
197 OMAP4430_DPLL_CLKOUT_DIV_MASK);
198
199DEFINE_CLK_FIXED_FACTOR(abe_24m_fclk, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck,
200 0x0, 1, 8);
201
202DEFINE_CLK_DIVIDER(abe_clk, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck, 0x0,
203 OMAP4430_CM_CLKSEL_ABE, OMAP4430_CLKSEL_OPP_SHIFT,
204 OMAP4430_CLKSEL_OPP_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
205
206DEFINE_CLK_DIVIDER(aess_fclk, "abe_clk", &abe_clk, 0x0,
207 OMAP4430_CM1_ABE_AESS_CLKCTRL,
208 OMAP4430_CLKSEL_AESS_FCLK_SHIFT,
209 OMAP4430_CLKSEL_AESS_FCLK_WIDTH,
210 0x0, NULL);
211
212DEFINE_CLK_OMAP_HSDIVIDER(dpll_abe_m3x2_ck, "dpll_abe_x2_ck", &dpll_abe_x2_ck,
213 0x0, OMAP4430_CM_DIV_M3_DPLL_ABE,
214 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK);
215
216static const char *core_hsd_byp_clk_mux_ck_parents[] = {
217 "sys_clkin_ck", "dpll_abe_m3x2_ck",
218};
219
220DEFINE_CLK_MUX(core_hsd_byp_clk_mux_ck, core_hsd_byp_clk_mux_ck_parents, NULL,
221 0x0, OMAP4430_CM_CLKSEL_DPLL_CORE,
222 OMAP4430_DPLL_BYP_CLKSEL_SHIFT, OMAP4430_DPLL_BYP_CLKSEL_WIDTH,
223 0x0, NULL);
224
225/* DPLL_CORE */
226static struct dpll_data dpll_core_dd = {
227 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_CORE,
228 .clk_bypass = &core_hsd_byp_clk_mux_ck,
229 .clk_ref = &sys_clkin_ck,
230 .control_reg = OMAP4430_CM_CLKMODE_DPLL_CORE,
231 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
232 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_CORE,
233 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_CORE,
234 .mult_mask = OMAP4430_DPLL_MULT_MASK,
235 .div1_mask = OMAP4430_DPLL_DIV_MASK,
236 .enable_mask = OMAP4430_DPLL_EN_MASK,
237 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
238 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
239 .max_multiplier = 2047,
240 .max_divider = 128,
241 .min_divider = 1,
242};
243
244
245static const char *dpll_core_ck_parents[] = {
246 "sys_clkin_ck",
247};
248
249static struct clk dpll_core_ck;
250
251static const struct clk_ops dpll_core_ck_ops = {
252 .recalc_rate = &omap3_dpll_recalc,
253 .get_parent = &omap2_init_dpll_parent,
254};
255
256static struct clk_hw_omap dpll_core_ck_hw = {
257 .hw = {
258 .clk = &dpll_core_ck,
259 },
260 .dpll_data = &dpll_core_dd,
261 .ops = &clkhwops_omap3_dpll,
262};
263
264DEFINE_STRUCT_CLK(dpll_core_ck, dpll_core_ck_parents, dpll_core_ck_ops);
265
266static const char *dpll_core_x2_ck_parents[] = {
267 "dpll_core_ck",
268};
269
270static struct clk dpll_core_x2_ck;
271
272static struct clk_hw_omap dpll_core_x2_ck_hw = {
273 .hw = {
274 .clk = &dpll_core_x2_ck,
275 },
276};
277
278DEFINE_STRUCT_CLK(dpll_core_x2_ck, dpll_core_x2_ck_parents, dpll_abe_x2_ck_ops);
279
280DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m6x2_ck, "dpll_core_x2_ck",
281 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M6_DPLL_CORE,
282 OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK);
283
284DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m2_ck, "dpll_core_ck", &dpll_core_ck, 0x0,
285 OMAP4430_CM_DIV_M2_DPLL_CORE,
286 OMAP4430_DPLL_CLKOUT_DIV_MASK);
287
288DEFINE_CLK_FIXED_FACTOR(ddrphy_ck, "dpll_core_m2_ck", &dpll_core_m2_ck, 0x0, 1,
289 2);
290
291DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m5x2_ck, "dpll_core_x2_ck",
292 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M5_DPLL_CORE,
293 OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK);
294
295DEFINE_CLK_DIVIDER(div_core_ck, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, 0x0,
296 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_CORE_SHIFT,
297 OMAP4430_CLKSEL_CORE_WIDTH, 0x0, NULL);
298
Paul Walmsley628a37d2012-12-15 01:35:58 -0700299DEFINE_CLK_DIVIDER(div_iva_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
300 0x0, OMAP4430_CM_BYPCLK_DPLL_IVA, OMAP4430_CLKSEL_0_1_SHIFT,
301 OMAP4430_CLKSEL_0_1_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700302
303DEFINE_CLK_DIVIDER(div_mpu_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
304 0x0, OMAP4430_CM_BYPCLK_DPLL_MPU, OMAP4430_CLKSEL_0_1_SHIFT,
305 OMAP4430_CLKSEL_0_1_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
306
307DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m4x2_ck, "dpll_core_x2_ck",
308 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M4_DPLL_CORE,
309 OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK);
310
311DEFINE_CLK_FIXED_FACTOR(dll_clk_div_ck, "dpll_core_m4x2_ck", &dpll_core_m4x2_ck,
312 0x0, 1, 2);
313
314DEFINE_CLK_DIVIDER(dpll_abe_m2_ck, "dpll_abe_ck", &dpll_abe_ck, 0x0,
315 OMAP4430_CM_DIV_M2_DPLL_ABE, OMAP4430_DPLL_CLKOUT_DIV_SHIFT,
316 OMAP4430_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
317
318static const struct clk_ops dmic_fck_ops = {
319 .enable = &omap2_dflt_clk_enable,
320 .disable = &omap2_dflt_clk_disable,
321 .is_enabled = &omap2_dflt_clk_is_enabled,
322 .recalc_rate = &omap2_clksel_recalc,
323 .get_parent = &omap2_clksel_find_parent_index,
324 .set_parent = &omap2_clksel_set_parent,
325 .init = &omap2_init_clk_clkdm,
326};
327
328static const char *dpll_core_m3x2_ck_parents[] = {
329 "dpll_core_x2_ck",
330};
331
332static const struct clksel dpll_core_m3x2_div[] = {
333 { .parent = &dpll_core_x2_ck, .rates = div31_1to31_rates },
334 { .parent = NULL },
335};
336
337/* XXX Missing round_rate, set_rate in ops */
338DEFINE_CLK_OMAP_MUX_GATE(dpll_core_m3x2_ck, NULL, dpll_core_m3x2_div,
339 OMAP4430_CM_DIV_M3_DPLL_CORE,
340 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
341 OMAP4430_CM_DIV_M3_DPLL_CORE,
342 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL,
343 dpll_core_m3x2_ck_parents, dmic_fck_ops);
344
345DEFINE_CLK_OMAP_HSDIVIDER(dpll_core_m7x2_ck, "dpll_core_x2_ck",
346 &dpll_core_x2_ck, 0x0, OMAP4430_CM_DIV_M7_DPLL_CORE,
347 OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK);
348
349static const char *iva_hsd_byp_clk_mux_ck_parents[] = {
350 "sys_clkin_ck", "div_iva_hs_clk",
351};
352
353DEFINE_CLK_MUX(iva_hsd_byp_clk_mux_ck, iva_hsd_byp_clk_mux_ck_parents, NULL,
354 0x0, OMAP4430_CM_CLKSEL_DPLL_IVA, OMAP4430_DPLL_BYP_CLKSEL_SHIFT,
355 OMAP4430_DPLL_BYP_CLKSEL_WIDTH, 0x0, NULL);
356
357/* DPLL_IVA */
358static struct dpll_data dpll_iva_dd = {
359 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_IVA,
360 .clk_bypass = &iva_hsd_byp_clk_mux_ck,
361 .clk_ref = &sys_clkin_ck,
362 .control_reg = OMAP4430_CM_CLKMODE_DPLL_IVA,
363 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
364 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_IVA,
365 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_IVA,
366 .mult_mask = OMAP4430_DPLL_MULT_MASK,
367 .div1_mask = OMAP4430_DPLL_DIV_MASK,
368 .enable_mask = OMAP4430_DPLL_EN_MASK,
369 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
370 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
371 .max_multiplier = 2047,
372 .max_divider = 128,
373 .min_divider = 1,
374};
375
376static struct clk dpll_iva_ck;
377
Jon Hunter9b4fcc82012-12-15 01:35:43 -0700378static const struct clk_ops dpll_ck_ops = {
379 .enable = &omap3_noncore_dpll_enable,
380 .disable = &omap3_noncore_dpll_disable,
381 .recalc_rate = &omap3_dpll_recalc,
382 .round_rate = &omap2_dpll_round_rate,
383 .set_rate = &omap3_noncore_dpll_set_rate,
384 .get_parent = &omap2_init_dpll_parent,
385};
386
Rajendra Nayakcb268672012-11-06 15:41:08 -0700387static struct clk_hw_omap dpll_iva_ck_hw = {
388 .hw = {
389 .clk = &dpll_iva_ck,
390 },
391 .dpll_data = &dpll_iva_dd,
392 .ops = &clkhwops_omap3_dpll,
393};
394
Jon Hunter9b4fcc82012-12-15 01:35:43 -0700395DEFINE_STRUCT_CLK(dpll_iva_ck, dpll_core_ck_parents, dpll_ck_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700396
397static const char *dpll_iva_x2_ck_parents[] = {
398 "dpll_iva_ck",
399};
400
401static struct clk dpll_iva_x2_ck;
402
403static struct clk_hw_omap dpll_iva_x2_ck_hw = {
404 .hw = {
405 .clk = &dpll_iva_x2_ck,
406 },
407};
408
409DEFINE_STRUCT_CLK(dpll_iva_x2_ck, dpll_iva_x2_ck_parents, dpll_abe_x2_ck_ops);
410
411DEFINE_CLK_OMAP_HSDIVIDER(dpll_iva_m4x2_ck, "dpll_iva_x2_ck", &dpll_iva_x2_ck,
412 0x0, OMAP4430_CM_DIV_M4_DPLL_IVA,
413 OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK);
414
415DEFINE_CLK_OMAP_HSDIVIDER(dpll_iva_m5x2_ck, "dpll_iva_x2_ck", &dpll_iva_x2_ck,
416 0x0, OMAP4430_CM_DIV_M5_DPLL_IVA,
417 OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK);
418
419/* DPLL_MPU */
420static struct dpll_data dpll_mpu_dd = {
421 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_MPU,
422 .clk_bypass = &div_mpu_hs_clk,
423 .clk_ref = &sys_clkin_ck,
424 .control_reg = OMAP4430_CM_CLKMODE_DPLL_MPU,
425 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
426 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_MPU,
427 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_MPU,
428 .mult_mask = OMAP4430_DPLL_MULT_MASK,
429 .div1_mask = OMAP4430_DPLL_DIV_MASK,
430 .enable_mask = OMAP4430_DPLL_EN_MASK,
431 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
432 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
433 .max_multiplier = 2047,
434 .max_divider = 128,
435 .min_divider = 1,
436};
437
438static struct clk dpll_mpu_ck;
439
440static struct clk_hw_omap dpll_mpu_ck_hw = {
441 .hw = {
442 .clk = &dpll_mpu_ck,
443 },
444 .dpll_data = &dpll_mpu_dd,
445 .ops = &clkhwops_omap3_dpll,
446};
447
Jon Hunter9b4fcc82012-12-15 01:35:43 -0700448DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_core_ck_parents, dpll_ck_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700449
450DEFINE_CLK_FIXED_FACTOR(mpu_periphclk, "dpll_mpu_ck", &dpll_mpu_ck, 0x0, 1, 2);
451
452DEFINE_CLK_OMAP_HSDIVIDER(dpll_mpu_m2_ck, "dpll_mpu_ck", &dpll_mpu_ck, 0x0,
453 OMAP4430_CM_DIV_M2_DPLL_MPU,
454 OMAP4430_DPLL_CLKOUT_DIV_MASK);
455
456DEFINE_CLK_FIXED_FACTOR(per_hs_clk_div_ck, "dpll_abe_m3x2_ck",
457 &dpll_abe_m3x2_ck, 0x0, 1, 2);
458
459static const char *per_hsd_byp_clk_mux_ck_parents[] = {
460 "sys_clkin_ck", "per_hs_clk_div_ck",
461};
462
463DEFINE_CLK_MUX(per_hsd_byp_clk_mux_ck, per_hsd_byp_clk_mux_ck_parents, NULL,
464 0x0, OMAP4430_CM_CLKSEL_DPLL_PER, OMAP4430_DPLL_BYP_CLKSEL_SHIFT,
465 OMAP4430_DPLL_BYP_CLKSEL_WIDTH, 0x0, NULL);
466
467/* DPLL_PER */
468static struct dpll_data dpll_per_dd = {
469 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_PER,
470 .clk_bypass = &per_hsd_byp_clk_mux_ck,
471 .clk_ref = &sys_clkin_ck,
472 .control_reg = OMAP4430_CM_CLKMODE_DPLL_PER,
473 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
474 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_PER,
475 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_PER,
476 .mult_mask = OMAP4430_DPLL_MULT_MASK,
477 .div1_mask = OMAP4430_DPLL_DIV_MASK,
478 .enable_mask = OMAP4430_DPLL_EN_MASK,
479 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
480 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
481 .max_multiplier = 2047,
482 .max_divider = 128,
483 .min_divider = 1,
484};
485
486
487static struct clk dpll_per_ck;
488
489static struct clk_hw_omap dpll_per_ck_hw = {
490 .hw = {
491 .clk = &dpll_per_ck,
492 },
493 .dpll_data = &dpll_per_dd,
494 .ops = &clkhwops_omap3_dpll,
495};
496
Jon Hunter9b4fcc82012-12-15 01:35:43 -0700497DEFINE_STRUCT_CLK(dpll_per_ck, dpll_core_ck_parents, dpll_ck_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700498
499DEFINE_CLK_DIVIDER(dpll_per_m2_ck, "dpll_per_ck", &dpll_per_ck, 0x0,
500 OMAP4430_CM_DIV_M2_DPLL_PER, OMAP4430_DPLL_CLKOUT_DIV_SHIFT,
501 OMAP4430_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
502
503static const char *dpll_per_x2_ck_parents[] = {
504 "dpll_per_ck",
505};
506
507static struct clk dpll_per_x2_ck;
508
509static struct clk_hw_omap dpll_per_x2_ck_hw = {
510 .hw = {
511 .clk = &dpll_per_x2_ck,
512 },
513 .flags = CLOCK_CLKOUTX2,
514 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
515 .ops = &clkhwops_omap4_dpllmx,
516};
517
518DEFINE_STRUCT_CLK(dpll_per_x2_ck, dpll_per_x2_ck_parents, dpll_abe_x2_ck_ops);
519
520DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m2x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
521 0x0, OMAP4430_CM_DIV_M2_DPLL_PER,
522 OMAP4430_DPLL_CLKOUT_DIV_MASK);
523
524static const char *dpll_per_m3x2_ck_parents[] = {
525 "dpll_per_x2_ck",
526};
527
528static const struct clksel dpll_per_m3x2_div[] = {
529 { .parent = &dpll_per_x2_ck, .rates = div31_1to31_rates },
530 { .parent = NULL },
531};
532
533/* XXX Missing round_rate, set_rate in ops */
534DEFINE_CLK_OMAP_MUX_GATE(dpll_per_m3x2_ck, NULL, dpll_per_m3x2_div,
535 OMAP4430_CM_DIV_M3_DPLL_PER,
536 OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
537 OMAP4430_CM_DIV_M3_DPLL_PER,
538 OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT, NULL,
539 dpll_per_m3x2_ck_parents, dmic_fck_ops);
540
541DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m4x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
542 0x0, OMAP4430_CM_DIV_M4_DPLL_PER,
543 OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK);
544
545DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m5x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
546 0x0, OMAP4430_CM_DIV_M5_DPLL_PER,
547 OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK);
548
549DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m6x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
550 0x0, OMAP4430_CM_DIV_M6_DPLL_PER,
551 OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK);
552
553DEFINE_CLK_OMAP_HSDIVIDER(dpll_per_m7x2_ck, "dpll_per_x2_ck", &dpll_per_x2_ck,
554 0x0, OMAP4430_CM_DIV_M7_DPLL_PER,
555 OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK);
556
557DEFINE_CLK_FIXED_FACTOR(usb_hs_clk_div_ck, "dpll_abe_m3x2_ck",
558 &dpll_abe_m3x2_ck, 0x0, 1, 3);
559
560/* DPLL_USB */
561static struct dpll_data dpll_usb_dd = {
562 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_USB,
563 .clk_bypass = &usb_hs_clk_div_ck,
564 .flags = DPLL_J_TYPE,
565 .clk_ref = &sys_clkin_ck,
566 .control_reg = OMAP4430_CM_CLKMODE_DPLL_USB,
567 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
568 .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_USB,
569 .idlest_reg = OMAP4430_CM_IDLEST_DPLL_USB,
570 .mult_mask = OMAP4430_DPLL_MULT_USB_MASK,
571 .div1_mask = OMAP4430_DPLL_DIV_0_7_MASK,
572 .enable_mask = OMAP4430_DPLL_EN_MASK,
573 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
574 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
575 .sddiv_mask = OMAP4430_DPLL_SD_DIV_MASK,
576 .max_multiplier = 4095,
577 .max_divider = 256,
578 .min_divider = 1,
579};
580
581static struct clk dpll_usb_ck;
582
583static struct clk_hw_omap dpll_usb_ck_hw = {
584 .hw = {
585 .clk = &dpll_usb_ck,
586 },
587 .dpll_data = &dpll_usb_dd,
588 .ops = &clkhwops_omap3_dpll,
589};
590
Jon Hunter9b4fcc82012-12-15 01:35:43 -0700591DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_core_ck_parents, dpll_ck_ops);
Rajendra Nayakcb268672012-11-06 15:41:08 -0700592
593static const char *dpll_usb_clkdcoldo_ck_parents[] = {
594 "dpll_usb_ck",
595};
596
597static struct clk dpll_usb_clkdcoldo_ck;
598
599static const struct clk_ops dpll_usb_clkdcoldo_ck_ops = {
600};
601
602static struct clk_hw_omap dpll_usb_clkdcoldo_ck_hw = {
603 .hw = {
604 .clk = &dpll_usb_clkdcoldo_ck,
605 },
606 .clksel_reg = OMAP4430_CM_CLKDCOLDO_DPLL_USB,
607 .ops = &clkhwops_omap4_dpllmx,
608};
609
610DEFINE_STRUCT_CLK(dpll_usb_clkdcoldo_ck, dpll_usb_clkdcoldo_ck_parents,
611 dpll_usb_clkdcoldo_ck_ops);
612
613DEFINE_CLK_OMAP_HSDIVIDER(dpll_usb_m2_ck, "dpll_usb_ck", &dpll_usb_ck, 0x0,
614 OMAP4430_CM_DIV_M2_DPLL_USB,
615 OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK);
616
617static const char *ducati_clk_mux_ck_parents[] = {
618 "div_core_ck", "dpll_per_m6x2_ck",
619};
620
621DEFINE_CLK_MUX(ducati_clk_mux_ck, ducati_clk_mux_ck_parents, NULL, 0x0,
622 OMAP4430_CM_CLKSEL_DUCATI_ISS_ROOT, OMAP4430_CLKSEL_0_0_SHIFT,
623 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
624
625DEFINE_CLK_FIXED_FACTOR(func_12m_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
626 0x0, 1, 16);
627
628DEFINE_CLK_FIXED_FACTOR(func_24m_clk, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0,
629 1, 4);
630
631DEFINE_CLK_FIXED_FACTOR(func_24mc_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
632 0x0, 1, 8);
633
634static const struct clk_div_table func_48m_fclk_rates[] = {
635 { .div = 4, .val = 0 },
636 { .div = 8, .val = 1 },
637 { .div = 0 },
638};
639DEFINE_CLK_DIVIDER_TABLE(func_48m_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
640 0x0, OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
641 OMAP4430_SCALE_FCLK_WIDTH, 0x0, func_48m_fclk_rates,
642 NULL);
643
644DEFINE_CLK_FIXED_FACTOR(func_48mc_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
645 0x0, 1, 4);
646
647static const struct clk_div_table func_64m_fclk_rates[] = {
648 { .div = 2, .val = 0 },
649 { .div = 4, .val = 1 },
650 { .div = 0 },
651};
652DEFINE_CLK_DIVIDER_TABLE(func_64m_fclk, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck,
653 0x0, OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
654 OMAP4430_SCALE_FCLK_WIDTH, 0x0, func_64m_fclk_rates,
655 NULL);
656
657static const struct clk_div_table func_96m_fclk_rates[] = {
658 { .div = 2, .val = 0 },
659 { .div = 4, .val = 1 },
660 { .div = 0 },
661};
662DEFINE_CLK_DIVIDER_TABLE(func_96m_fclk, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck,
663 0x0, OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
664 OMAP4430_SCALE_FCLK_WIDTH, 0x0, func_96m_fclk_rates,
665 NULL);
666
667static const struct clk_div_table init_60m_fclk_rates[] = {
668 { .div = 1, .val = 0 },
669 { .div = 8, .val = 1 },
670 { .div = 0 },
671};
672DEFINE_CLK_DIVIDER_TABLE(init_60m_fclk, "dpll_usb_m2_ck", &dpll_usb_m2_ck,
673 0x0, OMAP4430_CM_CLKSEL_USB_60MHZ,
674 OMAP4430_CLKSEL_0_0_SHIFT, OMAP4430_CLKSEL_0_0_WIDTH,
675 0x0, init_60m_fclk_rates, NULL);
676
677DEFINE_CLK_DIVIDER(l3_div_ck, "div_core_ck", &div_core_ck, 0x0,
678 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_L3_SHIFT,
679 OMAP4430_CLKSEL_L3_WIDTH, 0x0, NULL);
680
681DEFINE_CLK_DIVIDER(l4_div_ck, "l3_div_ck", &l3_div_ck, 0x0,
682 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_L4_SHIFT,
683 OMAP4430_CLKSEL_L4_WIDTH, 0x0, NULL);
684
685DEFINE_CLK_FIXED_FACTOR(lp_clk_div_ck, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck,
686 0x0, 1, 16);
687
688static const char *l4_wkup_clk_mux_ck_parents[] = {
689 "sys_clkin_ck", "lp_clk_div_ck",
690};
691
692DEFINE_CLK_MUX(l4_wkup_clk_mux_ck, l4_wkup_clk_mux_ck_parents, NULL, 0x0,
693 OMAP4430_CM_L4_WKUP_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
694 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
695
696static const struct clk_div_table ocp_abe_iclk_rates[] = {
697 { .div = 2, .val = 0 },
698 { .div = 1, .val = 1 },
699 { .div = 0 },
700};
701DEFINE_CLK_DIVIDER_TABLE(ocp_abe_iclk, "aess_fclk", &aess_fclk, 0x0,
702 OMAP4430_CM1_ABE_AESS_CLKCTRL,
703 OMAP4430_CLKSEL_AESS_FCLK_SHIFT,
704 OMAP4430_CLKSEL_AESS_FCLK_WIDTH,
705 0x0, ocp_abe_iclk_rates, NULL);
706
707DEFINE_CLK_FIXED_FACTOR(per_abe_24m_fclk, "dpll_abe_m2_ck", &dpll_abe_m2_ck,
708 0x0, 1, 4);
709
710DEFINE_CLK_DIVIDER(per_abe_nc_fclk, "dpll_abe_m2_ck", &dpll_abe_m2_ck, 0x0,
711 OMAP4430_CM_SCALE_FCLK, OMAP4430_SCALE_FCLK_SHIFT,
712 OMAP4430_SCALE_FCLK_WIDTH, 0x0, NULL);
713
714DEFINE_CLK_DIVIDER(syc_clk_div_ck, "sys_clkin_ck", &sys_clkin_ck, 0x0,
715 OMAP4430_CM_ABE_DSS_SYS_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
716 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
717
718static struct clk dbgclk_mux_ck;
719DEFINE_STRUCT_CLK_HW_OMAP(dbgclk_mux_ck, NULL);
720DEFINE_STRUCT_CLK(dbgclk_mux_ck, dpll_core_ck_parents,
721 dpll_usb_clkdcoldo_ck_ops);
722
723/* Leaf clocks controlled by modules */
724
725DEFINE_CLK_GATE(aes1_fck, "l3_div_ck", &l3_div_ck, 0x0,
726 OMAP4430_CM_L4SEC_AES1_CLKCTRL,
727 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
728
729DEFINE_CLK_GATE(aes2_fck, "l3_div_ck", &l3_div_ck, 0x0,
730 OMAP4430_CM_L4SEC_AES2_CLKCTRL,
731 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
732
733DEFINE_CLK_GATE(aess_fck, "aess_fclk", &aess_fclk, 0x0,
734 OMAP4430_CM1_ABE_AESS_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
735 0x0, NULL);
736
737DEFINE_CLK_GATE(bandgap_fclk, "sys_32k_ck", &sys_32k_ck, 0x0,
738 OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
739 OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT, 0x0, NULL);
740
741static const struct clk_div_table div_ts_ck_rates[] = {
742 { .div = 8, .val = 0 },
743 { .div = 16, .val = 1 },
744 { .div = 32, .val = 2 },
745 { .div = 0 },
746};
747DEFINE_CLK_DIVIDER_TABLE(div_ts_ck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
748 0x0, OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
749 OMAP4430_CLKSEL_24_25_SHIFT,
750 OMAP4430_CLKSEL_24_25_WIDTH, 0x0, div_ts_ck_rates,
751 NULL);
752
753DEFINE_CLK_GATE(bandgap_ts_fclk, "div_ts_ck", &div_ts_ck, 0x0,
754 OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
755 OMAP4460_OPTFCLKEN_TS_FCLK_SHIFT,
756 0x0, NULL);
757
758DEFINE_CLK_GATE(des3des_fck, "l4_div_ck", &l4_div_ck, 0x0,
759 OMAP4430_CM_L4SEC_DES3DES_CLKCTRL,
760 OMAP4430_MODULEMODE_SWCTRL_SHIFT,
761 0x0, NULL);
762
763static const char *dmic_sync_mux_ck_parents[] = {
764 "abe_24m_fclk", "syc_clk_div_ck", "func_24m_clk",
765};
766
767DEFINE_CLK_MUX(dmic_sync_mux_ck, dmic_sync_mux_ck_parents, NULL,
768 0x0, OMAP4430_CM1_ABE_DMIC_CLKCTRL,
769 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
770 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
771
772static const struct clksel func_dmic_abe_gfclk_sel[] = {
773 { .parent = &dmic_sync_mux_ck, .rates = div_1_0_rates },
774 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
775 { .parent = &slimbus_clk, .rates = div_1_2_rates },
776 { .parent = NULL },
777};
778
779static const char *dmic_fck_parents[] = {
780 "dmic_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
781};
782
783/* Merged func_dmic_abe_gfclk into dmic */
784static struct clk dmic_fck;
785
786DEFINE_CLK_OMAP_MUX_GATE(dmic_fck, "abe_clkdm", func_dmic_abe_gfclk_sel,
787 OMAP4430_CM1_ABE_DMIC_CLKCTRL,
788 OMAP4430_CLKSEL_SOURCE_MASK,
789 OMAP4430_CM1_ABE_DMIC_CLKCTRL,
790 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
791 dmic_fck_parents, dmic_fck_ops);
792
793DEFINE_CLK_GATE(dsp_fck, "dpll_iva_m4x2_ck", &dpll_iva_m4x2_ck, 0x0,
794 OMAP4430_CM_TESLA_TESLA_CLKCTRL,
795 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
796
797DEFINE_CLK_GATE(dss_sys_clk, "syc_clk_div_ck", &syc_clk_div_ck, 0x0,
798 OMAP4430_CM_DSS_DSS_CLKCTRL,
799 OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT, 0x0, NULL);
800
801DEFINE_CLK_GATE(dss_tv_clk, "extalt_clkin_ck", &extalt_clkin_ck, 0x0,
802 OMAP4430_CM_DSS_DSS_CLKCTRL,
803 OMAP4430_OPTFCLKEN_TV_CLK_SHIFT, 0x0, NULL);
804
805DEFINE_CLK_GATE(dss_dss_clk, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck, 0x0,
806 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_DSSCLK_SHIFT,
807 0x0, NULL);
808
809DEFINE_CLK_GATE(dss_48mhz_clk, "func_48mc_fclk", &func_48mc_fclk, 0x0,
810 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT,
811 0x0, NULL);
812
813DEFINE_CLK_GATE(dss_fck, "l3_div_ck", &l3_div_ck, 0x0,
814 OMAP4430_CM_DSS_DSS_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
815 0x0, NULL);
816
817DEFINE_CLK_GATE(efuse_ctrl_cust_fck, "sys_clkin_ck", &sys_clkin_ck, 0x0,
818 OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL,
819 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
820
821DEFINE_CLK_GATE(emif1_fck, "ddrphy_ck", &ddrphy_ck, 0x0,
822 OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL,
823 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
824
825DEFINE_CLK_GATE(emif2_fck, "ddrphy_ck", &ddrphy_ck, 0x0,
826 OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL,
827 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
828
829DEFINE_CLK_DIVIDER(fdif_fck, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, 0x0,
830 OMAP4430_CM_CAM_FDIF_CLKCTRL, OMAP4430_CLKSEL_FCLK_SHIFT,
831 OMAP4430_CLKSEL_FCLK_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
832
833DEFINE_CLK_GATE(fpka_fck, "l4_div_ck", &l4_div_ck, 0x0,
834 OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL,
835 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
836
837DEFINE_CLK_GATE(gpio1_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
838 OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
839 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL);
840
841DEFINE_CLK_GATE(gpio1_ick, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck, 0x0,
842 OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
843 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
844
845DEFINE_CLK_GATE(gpio2_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
846 OMAP4430_CM_L4PER_GPIO2_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
847 0x0, NULL);
848
849DEFINE_CLK_GATE(gpio2_ick, "l4_div_ck", &l4_div_ck, 0x0,
850 OMAP4430_CM_L4PER_GPIO2_CLKCTRL,
851 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
852
853DEFINE_CLK_GATE(gpio3_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
854 OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
855 OMAP4430_OPTFCLKEN_DBCLK_SHIFT, 0x0, NULL);
856
857DEFINE_CLK_GATE(gpio3_ick, "l4_div_ck", &l4_div_ck, 0x0,
858 OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
859 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
860
861DEFINE_CLK_GATE(gpio4_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
862 OMAP4430_CM_L4PER_GPIO4_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
863 0x0, NULL);
864
865DEFINE_CLK_GATE(gpio4_ick, "l4_div_ck", &l4_div_ck, 0x0,
866 OMAP4430_CM_L4PER_GPIO4_CLKCTRL,
867 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
868
869DEFINE_CLK_GATE(gpio5_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
870 OMAP4430_CM_L4PER_GPIO5_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
871 0x0, NULL);
872
873DEFINE_CLK_GATE(gpio5_ick, "l4_div_ck", &l4_div_ck, 0x0,
874 OMAP4430_CM_L4PER_GPIO5_CLKCTRL,
875 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
876
877DEFINE_CLK_GATE(gpio6_dbclk, "sys_32k_ck", &sys_32k_ck, 0x0,
878 OMAP4430_CM_L4PER_GPIO6_CLKCTRL, OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
879 0x0, NULL);
880
881DEFINE_CLK_GATE(gpio6_ick, "l4_div_ck", &l4_div_ck, 0x0,
882 OMAP4430_CM_L4PER_GPIO6_CLKCTRL,
883 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
884
885DEFINE_CLK_GATE(gpmc_ick, "l3_div_ck", &l3_div_ck, 0x0,
886 OMAP4430_CM_L3_2_GPMC_CLKCTRL, OMAP4430_MODULEMODE_HWCTRL_SHIFT,
887 0x0, NULL);
888
889static const struct clksel sgx_clk_mux_sel[] = {
890 { .parent = &dpll_core_m7x2_ck, .rates = div_1_0_rates },
891 { .parent = &dpll_per_m7x2_ck, .rates = div_1_1_rates },
892 { .parent = NULL },
893};
894
895static const char *gpu_fck_parents[] = {
896 "dpll_core_m7x2_ck", "dpll_per_m7x2_ck",
897};
898
899/* Merged sgx_clk_mux into gpu */
900DEFINE_CLK_OMAP_MUX_GATE(gpu_fck, "l3_gfx_clkdm", sgx_clk_mux_sel,
901 OMAP4430_CM_GFX_GFX_CLKCTRL,
902 OMAP4430_CLKSEL_SGX_FCLK_MASK,
903 OMAP4430_CM_GFX_GFX_CLKCTRL,
904 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
905 gpu_fck_parents, dmic_fck_ops);
906
907DEFINE_CLK_GATE(hdq1w_fck, "func_12m_fclk", &func_12m_fclk, 0x0,
908 OMAP4430_CM_L4PER_HDQ1W_CLKCTRL,
909 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
910
911DEFINE_CLK_DIVIDER(hsi_fck, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, 0x0,
912 OMAP4430_CM_L3INIT_HSI_CLKCTRL, OMAP4430_CLKSEL_24_25_SHIFT,
913 OMAP4430_CLKSEL_24_25_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
914 NULL);
915
916DEFINE_CLK_GATE(i2c1_fck, "func_96m_fclk", &func_96m_fclk, 0x0,
917 OMAP4430_CM_L4PER_I2C1_CLKCTRL,
918 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
919
920DEFINE_CLK_GATE(i2c2_fck, "func_96m_fclk", &func_96m_fclk, 0x0,
921 OMAP4430_CM_L4PER_I2C2_CLKCTRL,
922 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
923
924DEFINE_CLK_GATE(i2c3_fck, "func_96m_fclk", &func_96m_fclk, 0x0,
925 OMAP4430_CM_L4PER_I2C3_CLKCTRL,
926 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
927
928DEFINE_CLK_GATE(i2c4_fck, "func_96m_fclk", &func_96m_fclk, 0x0,
929 OMAP4430_CM_L4PER_I2C4_CLKCTRL,
930 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
931
932DEFINE_CLK_GATE(ipu_fck, "ducati_clk_mux_ck", &ducati_clk_mux_ck, 0x0,
933 OMAP4430_CM_DUCATI_DUCATI_CLKCTRL,
934 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
935
936DEFINE_CLK_GATE(iss_ctrlclk, "func_96m_fclk", &func_96m_fclk, 0x0,
937 OMAP4430_CM_CAM_ISS_CLKCTRL, OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT,
938 0x0, NULL);
939
940DEFINE_CLK_GATE(iss_fck, "ducati_clk_mux_ck", &ducati_clk_mux_ck, 0x0,
941 OMAP4430_CM_CAM_ISS_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
942 0x0, NULL);
943
944DEFINE_CLK_GATE(iva_fck, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck, 0x0,
945 OMAP4430_CM_IVAHD_IVAHD_CLKCTRL,
946 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
947
948DEFINE_CLK_GATE(kbd_fck, "sys_32k_ck", &sys_32k_ck, 0x0,
949 OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL,
950 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
951
952static struct clk l3_instr_ick;
953
954static const char *l3_instr_ick_parent_names[] = {
955 "l3_div_ck",
956};
957
958static const struct clk_ops l3_instr_ick_ops = {
959 .enable = &omap2_dflt_clk_enable,
960 .disable = &omap2_dflt_clk_disable,
961 .is_enabled = &omap2_dflt_clk_is_enabled,
962 .init = &omap2_init_clk_clkdm,
963};
964
965static struct clk_hw_omap l3_instr_ick_hw = {
966 .hw = {
967 .clk = &l3_instr_ick,
968 },
969 .enable_reg = OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL,
970 .enable_bit = OMAP4430_MODULEMODE_HWCTRL_SHIFT,
971 .clkdm_name = "l3_instr_clkdm",
972};
973
974DEFINE_STRUCT_CLK(l3_instr_ick, l3_instr_ick_parent_names, l3_instr_ick_ops);
975
976static struct clk l3_main_3_ick;
977static struct clk_hw_omap l3_main_3_ick_hw = {
978 .hw = {
979 .clk = &l3_main_3_ick,
980 },
981 .enable_reg = OMAP4430_CM_L3INSTR_L3_3_CLKCTRL,
982 .enable_bit = OMAP4430_MODULEMODE_HWCTRL_SHIFT,
983 .clkdm_name = "l3_instr_clkdm",
984};
985
986DEFINE_STRUCT_CLK(l3_main_3_ick, l3_instr_ick_parent_names, l3_instr_ick_ops);
987
988DEFINE_CLK_MUX(mcasp_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
989 OMAP4430_CM1_ABE_MCASP_CLKCTRL,
990 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
991 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
992
993static const struct clksel func_mcasp_abe_gfclk_sel[] = {
994 { .parent = &mcasp_sync_mux_ck, .rates = div_1_0_rates },
995 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
996 { .parent = &slimbus_clk, .rates = div_1_2_rates },
997 { .parent = NULL },
998};
999
1000static const char *mcasp_fck_parents[] = {
1001 "mcasp_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
1002};
1003
1004/* Merged func_mcasp_abe_gfclk into mcasp */
1005DEFINE_CLK_OMAP_MUX_GATE(mcasp_fck, "abe_clkdm", func_mcasp_abe_gfclk_sel,
1006 OMAP4430_CM1_ABE_MCASP_CLKCTRL,
1007 OMAP4430_CLKSEL_SOURCE_MASK,
1008 OMAP4430_CM1_ABE_MCASP_CLKCTRL,
1009 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1010 mcasp_fck_parents, dmic_fck_ops);
1011
1012DEFINE_CLK_MUX(mcbsp1_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
1013 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
1014 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
1015 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
1016
1017static const struct clksel func_mcbsp1_gfclk_sel[] = {
1018 { .parent = &mcbsp1_sync_mux_ck, .rates = div_1_0_rates },
1019 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
1020 { .parent = &slimbus_clk, .rates = div_1_2_rates },
1021 { .parent = NULL },
1022};
1023
1024static const char *mcbsp1_fck_parents[] = {
1025 "mcbsp1_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
1026};
1027
1028/* Merged func_mcbsp1_gfclk into mcbsp1 */
1029DEFINE_CLK_OMAP_MUX_GATE(mcbsp1_fck, "abe_clkdm", func_mcbsp1_gfclk_sel,
1030 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
1031 OMAP4430_CLKSEL_SOURCE_MASK,
1032 OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
1033 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1034 mcbsp1_fck_parents, dmic_fck_ops);
1035
1036DEFINE_CLK_MUX(mcbsp2_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
1037 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
1038 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
1039 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
1040
1041static const struct clksel func_mcbsp2_gfclk_sel[] = {
1042 { .parent = &mcbsp2_sync_mux_ck, .rates = div_1_0_rates },
1043 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
1044 { .parent = &slimbus_clk, .rates = div_1_2_rates },
1045 { .parent = NULL },
1046};
1047
1048static const char *mcbsp2_fck_parents[] = {
1049 "mcbsp2_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
1050};
1051
1052/* Merged func_mcbsp2_gfclk into mcbsp2 */
1053DEFINE_CLK_OMAP_MUX_GATE(mcbsp2_fck, "abe_clkdm", func_mcbsp2_gfclk_sel,
1054 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
1055 OMAP4430_CLKSEL_SOURCE_MASK,
1056 OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
1057 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1058 mcbsp2_fck_parents, dmic_fck_ops);
1059
1060DEFINE_CLK_MUX(mcbsp3_sync_mux_ck, dmic_sync_mux_ck_parents, NULL, 0x0,
1061 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
1062 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
1063 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
1064
1065static const struct clksel func_mcbsp3_gfclk_sel[] = {
1066 { .parent = &mcbsp3_sync_mux_ck, .rates = div_1_0_rates },
1067 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
1068 { .parent = &slimbus_clk, .rates = div_1_2_rates },
1069 { .parent = NULL },
1070};
1071
1072static const char *mcbsp3_fck_parents[] = {
1073 "mcbsp3_sync_mux_ck", "pad_clks_ck", "slimbus_clk",
1074};
1075
1076/* Merged func_mcbsp3_gfclk into mcbsp3 */
1077DEFINE_CLK_OMAP_MUX_GATE(mcbsp3_fck, "abe_clkdm", func_mcbsp3_gfclk_sel,
1078 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
1079 OMAP4430_CLKSEL_SOURCE_MASK,
1080 OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
1081 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1082 mcbsp3_fck_parents, dmic_fck_ops);
1083
1084static const char *mcbsp4_sync_mux_ck_parents[] = {
1085 "func_96m_fclk", "per_abe_nc_fclk",
1086};
1087
1088DEFINE_CLK_MUX(mcbsp4_sync_mux_ck, mcbsp4_sync_mux_ck_parents, NULL, 0x0,
1089 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
1090 OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT,
1091 OMAP4430_CLKSEL_INTERNAL_SOURCE_WIDTH, 0x0, NULL);
1092
1093static const struct clksel per_mcbsp4_gfclk_sel[] = {
1094 { .parent = &mcbsp4_sync_mux_ck, .rates = div_1_0_rates },
1095 { .parent = &pad_clks_ck, .rates = div_1_1_rates },
1096 { .parent = NULL },
1097};
1098
1099static const char *mcbsp4_fck_parents[] = {
1100 "mcbsp4_sync_mux_ck", "pad_clks_ck",
1101};
1102
1103/* Merged per_mcbsp4_gfclk into mcbsp4 */
1104DEFINE_CLK_OMAP_MUX_GATE(mcbsp4_fck, "l4_per_clkdm", per_mcbsp4_gfclk_sel,
1105 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
1106 OMAP4430_CLKSEL_SOURCE_24_24_MASK,
1107 OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
1108 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1109 mcbsp4_fck_parents, dmic_fck_ops);
1110
1111DEFINE_CLK_GATE(mcpdm_fck, "pad_clks_ck", &pad_clks_ck, 0x0,
1112 OMAP4430_CM1_ABE_PDM_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
1113 0x0, NULL);
1114
1115DEFINE_CLK_GATE(mcspi1_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1116 OMAP4430_CM_L4PER_MCSPI1_CLKCTRL,
1117 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1118
1119DEFINE_CLK_GATE(mcspi2_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1120 OMAP4430_CM_L4PER_MCSPI2_CLKCTRL,
1121 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1122
1123DEFINE_CLK_GATE(mcspi3_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1124 OMAP4430_CM_L4PER_MCSPI3_CLKCTRL,
1125 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1126
1127DEFINE_CLK_GATE(mcspi4_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1128 OMAP4430_CM_L4PER_MCSPI4_CLKCTRL,
1129 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1130
1131static const struct clksel hsmmc1_fclk_sel[] = {
1132 { .parent = &func_64m_fclk, .rates = div_1_0_rates },
1133 { .parent = &func_96m_fclk, .rates = div_1_1_rates },
1134 { .parent = NULL },
1135};
1136
1137static const char *mmc1_fck_parents[] = {
1138 "func_64m_fclk", "func_96m_fclk",
1139};
1140
1141/* Merged hsmmc1_fclk into mmc1 */
1142DEFINE_CLK_OMAP_MUX_GATE(mmc1_fck, "l3_init_clkdm", hsmmc1_fclk_sel,
1143 OMAP4430_CM_L3INIT_MMC1_CLKCTRL, OMAP4430_CLKSEL_MASK,
1144 OMAP4430_CM_L3INIT_MMC1_CLKCTRL,
1145 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1146 mmc1_fck_parents, dmic_fck_ops);
1147
1148/* Merged hsmmc2_fclk into mmc2 */
1149DEFINE_CLK_OMAP_MUX_GATE(mmc2_fck, "l3_init_clkdm", hsmmc1_fclk_sel,
1150 OMAP4430_CM_L3INIT_MMC2_CLKCTRL, OMAP4430_CLKSEL_MASK,
1151 OMAP4430_CM_L3INIT_MMC2_CLKCTRL,
1152 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1153 mmc1_fck_parents, dmic_fck_ops);
1154
1155DEFINE_CLK_GATE(mmc3_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1156 OMAP4430_CM_L4PER_MMCSD3_CLKCTRL,
1157 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1158
1159DEFINE_CLK_GATE(mmc4_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1160 OMAP4430_CM_L4PER_MMCSD4_CLKCTRL,
1161 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1162
1163DEFINE_CLK_GATE(mmc5_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1164 OMAP4430_CM_L4PER_MMCSD5_CLKCTRL,
1165 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1166
1167DEFINE_CLK_GATE(ocp2scp_usb_phy_phy_48m, "func_48m_fclk", &func_48m_fclk, 0x0,
1168 OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
1169 OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, 0x0, NULL);
1170
1171DEFINE_CLK_GATE(ocp2scp_usb_phy_ick, "l4_div_ck", &l4_div_ck, 0x0,
1172 OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
1173 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
1174
1175static struct clk ocp_wp_noc_ick;
1176
1177static struct clk_hw_omap ocp_wp_noc_ick_hw = {
1178 .hw = {
1179 .clk = &ocp_wp_noc_ick,
1180 },
1181 .enable_reg = OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL,
1182 .enable_bit = OMAP4430_MODULEMODE_HWCTRL_SHIFT,
1183 .clkdm_name = "l3_instr_clkdm",
1184};
1185
1186DEFINE_STRUCT_CLK(ocp_wp_noc_ick, l3_instr_ick_parent_names, l3_instr_ick_ops);
1187
1188DEFINE_CLK_GATE(rng_ick, "l4_div_ck", &l4_div_ck, 0x0,
1189 OMAP4430_CM_L4SEC_RNG_CLKCTRL, OMAP4430_MODULEMODE_HWCTRL_SHIFT,
1190 0x0, NULL);
1191
1192DEFINE_CLK_GATE(sha2md5_fck, "l3_div_ck", &l3_div_ck, 0x0,
1193 OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL,
1194 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1195
1196DEFINE_CLK_GATE(sl2if_ick, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck, 0x0,
1197 OMAP4430_CM_IVAHD_SL2_CLKCTRL, OMAP4430_MODULEMODE_HWCTRL_SHIFT,
1198 0x0, NULL);
1199
1200DEFINE_CLK_GATE(slimbus1_fclk_1, "func_24m_clk", &func_24m_clk, 0x0,
1201 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1202 OMAP4430_OPTFCLKEN_FCLK1_SHIFT, 0x0, NULL);
1203
1204DEFINE_CLK_GATE(slimbus1_fclk_0, "abe_24m_fclk", &abe_24m_fclk, 0x0,
1205 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1206 OMAP4430_OPTFCLKEN_FCLK0_SHIFT, 0x0, NULL);
1207
1208DEFINE_CLK_GATE(slimbus1_fclk_2, "pad_clks_ck", &pad_clks_ck, 0x0,
1209 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1210 OMAP4430_OPTFCLKEN_FCLK2_SHIFT, 0x0, NULL);
1211
1212DEFINE_CLK_GATE(slimbus1_slimbus_clk, "slimbus_clk", &slimbus_clk, 0x0,
1213 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1214 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT, 0x0, NULL);
1215
1216DEFINE_CLK_GATE(slimbus1_fck, "ocp_abe_iclk", &ocp_abe_iclk, 0x0,
1217 OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
1218 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1219
1220DEFINE_CLK_GATE(slimbus2_fclk_1, "per_abe_24m_fclk", &per_abe_24m_fclk, 0x0,
1221 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1222 OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT, 0x0, NULL);
1223
1224DEFINE_CLK_GATE(slimbus2_fclk_0, "func_24mc_fclk", &func_24mc_fclk, 0x0,
1225 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1226 OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT, 0x0, NULL);
1227
1228DEFINE_CLK_GATE(slimbus2_slimbus_clk, "pad_slimbus_core_clks_ck",
1229 &pad_slimbus_core_clks_ck, 0x0,
1230 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1231 OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT, 0x0, NULL);
1232
1233DEFINE_CLK_GATE(slimbus2_fck, "l4_div_ck", &l4_div_ck, 0x0,
1234 OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
1235 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1236
1237DEFINE_CLK_GATE(smartreflex_core_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1238 0x0, OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,
1239 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1240
1241DEFINE_CLK_GATE(smartreflex_iva_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1242 0x0, OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,
1243 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1244
1245DEFINE_CLK_GATE(smartreflex_mpu_fck, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck,
1246 0x0, OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,
1247 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1248
1249static const struct clksel dmt1_clk_mux_sel[] = {
1250 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
1251 { .parent = &sys_32k_ck, .rates = div_1_1_rates },
1252 { .parent = NULL },
1253};
1254
1255/* Merged dmt1_clk_mux into timer1 */
1256DEFINE_CLK_OMAP_MUX_GATE(timer1_fck, "l4_wkup_clkdm", dmt1_clk_mux_sel,
1257 OMAP4430_CM_WKUP_TIMER1_CLKCTRL, OMAP4430_CLKSEL_MASK,
1258 OMAP4430_CM_WKUP_TIMER1_CLKCTRL,
1259 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1260 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1261
1262/* Merged cm2_dm10_mux into timer10 */
1263DEFINE_CLK_OMAP_MUX_GATE(timer10_fck, "l4_per_clkdm", dmt1_clk_mux_sel,
1264 OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL,
1265 OMAP4430_CLKSEL_MASK,
1266 OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL,
1267 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1268 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1269
1270/* Merged cm2_dm11_mux into timer11 */
1271DEFINE_CLK_OMAP_MUX_GATE(timer11_fck, "l4_per_clkdm", dmt1_clk_mux_sel,
1272 OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL,
1273 OMAP4430_CLKSEL_MASK,
1274 OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL,
1275 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1276 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1277
1278/* Merged cm2_dm2_mux into timer2 */
1279DEFINE_CLK_OMAP_MUX_GATE(timer2_fck, "l4_per_clkdm", dmt1_clk_mux_sel,
1280 OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL,
1281 OMAP4430_CLKSEL_MASK,
1282 OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL,
1283 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1284 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1285
1286/* Merged cm2_dm3_mux into timer3 */
1287DEFINE_CLK_OMAP_MUX_GATE(timer3_fck, "l4_per_clkdm", dmt1_clk_mux_sel,
1288 OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL,
1289 OMAP4430_CLKSEL_MASK,
1290 OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL,
1291 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1292 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1293
1294/* Merged cm2_dm4_mux into timer4 */
1295DEFINE_CLK_OMAP_MUX_GATE(timer4_fck, "l4_per_clkdm", dmt1_clk_mux_sel,
1296 OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL,
1297 OMAP4430_CLKSEL_MASK,
1298 OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL,
1299 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1300 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1301
1302static const struct clksel timer5_sync_mux_sel[] = {
1303 { .parent = &syc_clk_div_ck, .rates = div_1_0_rates },
1304 { .parent = &sys_32k_ck, .rates = div_1_1_rates },
1305 { .parent = NULL },
1306};
1307
1308static const char *timer5_fck_parents[] = {
1309 "syc_clk_div_ck", "sys_32k_ck",
1310};
1311
1312/* Merged timer5_sync_mux into timer5 */
1313DEFINE_CLK_OMAP_MUX_GATE(timer5_fck, "abe_clkdm", timer5_sync_mux_sel,
1314 OMAP4430_CM1_ABE_TIMER5_CLKCTRL, OMAP4430_CLKSEL_MASK,
1315 OMAP4430_CM1_ABE_TIMER5_CLKCTRL,
1316 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1317 timer5_fck_parents, dmic_fck_ops);
1318
1319/* Merged timer6_sync_mux into timer6 */
1320DEFINE_CLK_OMAP_MUX_GATE(timer6_fck, "abe_clkdm", timer5_sync_mux_sel,
1321 OMAP4430_CM1_ABE_TIMER6_CLKCTRL, OMAP4430_CLKSEL_MASK,
1322 OMAP4430_CM1_ABE_TIMER6_CLKCTRL,
1323 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1324 timer5_fck_parents, dmic_fck_ops);
1325
1326/* Merged timer7_sync_mux into timer7 */
1327DEFINE_CLK_OMAP_MUX_GATE(timer7_fck, "abe_clkdm", timer5_sync_mux_sel,
1328 OMAP4430_CM1_ABE_TIMER7_CLKCTRL, OMAP4430_CLKSEL_MASK,
1329 OMAP4430_CM1_ABE_TIMER7_CLKCTRL,
1330 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1331 timer5_fck_parents, dmic_fck_ops);
1332
1333/* Merged timer8_sync_mux into timer8 */
1334DEFINE_CLK_OMAP_MUX_GATE(timer8_fck, "abe_clkdm", timer5_sync_mux_sel,
1335 OMAP4430_CM1_ABE_TIMER8_CLKCTRL, OMAP4430_CLKSEL_MASK,
1336 OMAP4430_CM1_ABE_TIMER8_CLKCTRL,
1337 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1338 timer5_fck_parents, dmic_fck_ops);
1339
1340/* Merged cm2_dm9_mux into timer9 */
1341DEFINE_CLK_OMAP_MUX_GATE(timer9_fck, "l4_per_clkdm", dmt1_clk_mux_sel,
1342 OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL,
1343 OMAP4430_CLKSEL_MASK,
1344 OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL,
1345 OMAP4430_MODULEMODE_SWCTRL_SHIFT, NULL,
1346 abe_dpll_bypass_clk_mux_ck_parents, dmic_fck_ops);
1347
1348DEFINE_CLK_GATE(uart1_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1349 OMAP4430_CM_L4PER_UART1_CLKCTRL,
1350 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1351
1352DEFINE_CLK_GATE(uart2_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1353 OMAP4430_CM_L4PER_UART2_CLKCTRL,
1354 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1355
1356DEFINE_CLK_GATE(uart3_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1357 OMAP4430_CM_L4PER_UART3_CLKCTRL,
1358 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1359
1360DEFINE_CLK_GATE(uart4_fck, "func_48m_fclk", &func_48m_fclk, 0x0,
1361 OMAP4430_CM_L4PER_UART4_CLKCTRL,
1362 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1363
1364static struct clk usb_host_fs_fck;
1365
1366static const char *usb_host_fs_fck_parent_names[] = {
1367 "func_48mc_fclk",
1368};
1369
1370static const struct clk_ops usb_host_fs_fck_ops = {
1371 .enable = &omap2_dflt_clk_enable,
1372 .disable = &omap2_dflt_clk_disable,
1373 .is_enabled = &omap2_dflt_clk_is_enabled,
1374};
1375
1376static struct clk_hw_omap usb_host_fs_fck_hw = {
1377 .hw = {
1378 .clk = &usb_host_fs_fck,
1379 },
1380 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL,
1381 .enable_bit = OMAP4430_MODULEMODE_SWCTRL_SHIFT,
1382 .clkdm_name = "l3_init_clkdm",
1383};
1384
1385DEFINE_STRUCT_CLK(usb_host_fs_fck, usb_host_fs_fck_parent_names,
1386 usb_host_fs_fck_ops);
1387
1388static const char *utmi_p1_gfclk_parents[] = {
1389 "init_60m_fclk", "xclk60mhsp1_ck",
1390};
1391
1392DEFINE_CLK_MUX(utmi_p1_gfclk, utmi_p1_gfclk_parents, NULL, 0x0,
1393 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1394 OMAP4430_CLKSEL_UTMI_P1_SHIFT, OMAP4430_CLKSEL_UTMI_P1_WIDTH,
1395 0x0, NULL);
1396
1397DEFINE_CLK_GATE(usb_host_hs_utmi_p1_clk, "utmi_p1_gfclk", &utmi_p1_gfclk, 0x0,
1398 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1399 OMAP4430_OPTFCLKEN_UTMI_P1_CLK_SHIFT, 0x0, NULL);
1400
1401static const char *utmi_p2_gfclk_parents[] = {
1402 "init_60m_fclk", "xclk60mhsp2_ck",
1403};
1404
1405DEFINE_CLK_MUX(utmi_p2_gfclk, utmi_p2_gfclk_parents, NULL, 0x0,
1406 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1407 OMAP4430_CLKSEL_UTMI_P2_SHIFT, OMAP4430_CLKSEL_UTMI_P2_WIDTH,
1408 0x0, NULL);
1409
1410DEFINE_CLK_GATE(usb_host_hs_utmi_p2_clk, "utmi_p2_gfclk", &utmi_p2_gfclk, 0x0,
1411 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1412 OMAP4430_OPTFCLKEN_UTMI_P2_CLK_SHIFT, 0x0, NULL);
1413
1414DEFINE_CLK_GATE(usb_host_hs_utmi_p3_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1415 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1416 OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT, 0x0, NULL);
1417
1418DEFINE_CLK_GATE(usb_host_hs_hsic480m_p1_clk, "dpll_usb_m2_ck",
1419 &dpll_usb_m2_ck, 0x0,
1420 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1421 OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT, 0x0, NULL);
1422
1423DEFINE_CLK_GATE(usb_host_hs_hsic60m_p1_clk, "init_60m_fclk",
1424 &init_60m_fclk, 0x0,
1425 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1426 OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT, 0x0, NULL);
1427
1428DEFINE_CLK_GATE(usb_host_hs_hsic60m_p2_clk, "init_60m_fclk",
1429 &init_60m_fclk, 0x0,
1430 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1431 OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT, 0x0, NULL);
1432
1433DEFINE_CLK_GATE(usb_host_hs_hsic480m_p2_clk, "dpll_usb_m2_ck",
1434 &dpll_usb_m2_ck, 0x0,
1435 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1436 OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT, 0x0, NULL);
1437
1438DEFINE_CLK_GATE(usb_host_hs_func48mclk, "func_48mc_fclk", &func_48mc_fclk, 0x0,
1439 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1440 OMAP4430_OPTFCLKEN_FUNC48MCLK_SHIFT, 0x0, NULL);
1441
1442DEFINE_CLK_GATE(usb_host_hs_fck, "init_60m_fclk", &init_60m_fclk, 0x0,
1443 OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
1444 OMAP4430_MODULEMODE_SWCTRL_SHIFT, 0x0, NULL);
1445
1446static const char *otg_60m_gfclk_parents[] = {
1447 "utmi_phy_clkout_ck", "xclk60motg_ck",
1448};
1449
1450DEFINE_CLK_MUX(otg_60m_gfclk, otg_60m_gfclk_parents, NULL, 0x0,
1451 OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL, OMAP4430_CLKSEL_60M_SHIFT,
1452 OMAP4430_CLKSEL_60M_WIDTH, 0x0, NULL);
1453
1454DEFINE_CLK_GATE(usb_otg_hs_xclk, "otg_60m_gfclk", &otg_60m_gfclk, 0x0,
1455 OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
1456 OMAP4430_OPTFCLKEN_XCLK_SHIFT, 0x0, NULL);
1457
1458DEFINE_CLK_GATE(usb_otg_hs_ick, "l3_div_ck", &l3_div_ck, 0x0,
1459 OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
1460 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
1461
1462DEFINE_CLK_GATE(usb_phy_cm_clk32k, "sys_32k_ck", &sys_32k_ck, 0x0,
1463 OMAP4430_CM_ALWON_USBPHY_CLKCTRL,
1464 OMAP4430_OPTFCLKEN_CLK32K_SHIFT, 0x0, NULL);
1465
1466DEFINE_CLK_GATE(usb_tll_hs_usb_ch2_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1467 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1468 OMAP4430_OPTFCLKEN_USB_CH2_CLK_SHIFT, 0x0, NULL);
1469
1470DEFINE_CLK_GATE(usb_tll_hs_usb_ch0_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1471 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1472 OMAP4430_OPTFCLKEN_USB_CH0_CLK_SHIFT, 0x0, NULL);
1473
1474DEFINE_CLK_GATE(usb_tll_hs_usb_ch1_clk, "init_60m_fclk", &init_60m_fclk, 0x0,
1475 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1476 OMAP4430_OPTFCLKEN_USB_CH1_CLK_SHIFT, 0x0, NULL);
1477
1478DEFINE_CLK_GATE(usb_tll_hs_ick, "l4_div_ck", &l4_div_ck, 0x0,
1479 OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
1480 OMAP4430_MODULEMODE_HWCTRL_SHIFT, 0x0, NULL);
1481
1482static const struct clk_div_table usim_ck_rates[] = {
1483 { .div = 14, .val = 0 },
1484 { .div = 18, .val = 1 },
1485 { .div = 0 },
1486};
1487DEFINE_CLK_DIVIDER_TABLE(usim_ck, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, 0x0,
1488 OMAP4430_CM_WKUP_USIM_CLKCTRL,
1489 OMAP4430_CLKSEL_DIV_SHIFT, OMAP4430_CLKSEL_DIV_WIDTH,
1490 0x0, usim_ck_rates, NULL);
1491
1492DEFINE_CLK_GATE(usim_fclk, "usim_ck", &usim_ck, 0x0,
1493 OMAP4430_CM_WKUP_USIM_CLKCTRL, OMAP4430_OPTFCLKEN_FCLK_SHIFT,
1494 0x0, NULL);
1495
1496DEFINE_CLK_GATE(usim_fck, "sys_32k_ck", &sys_32k_ck, 0x0,
1497 OMAP4430_CM_WKUP_USIM_CLKCTRL, OMAP4430_MODULEMODE_HWCTRL_SHIFT,
1498 0x0, NULL);
1499
1500DEFINE_CLK_GATE(wd_timer2_fck, "sys_32k_ck", &sys_32k_ck, 0x0,
1501 OMAP4430_CM_WKUP_WDT2_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
1502 0x0, NULL);
1503
1504DEFINE_CLK_GATE(wd_timer3_fck, "sys_32k_ck", &sys_32k_ck, 0x0,
1505 OMAP4430_CM1_ABE_WDT3_CLKCTRL, OMAP4430_MODULEMODE_SWCTRL_SHIFT,
1506 0x0, NULL);
1507
1508/* Remaining optional clocks */
1509static const char *pmd_stm_clock_mux_ck_parents[] = {
1510 "sys_clkin_ck", "dpll_core_m6x2_ck", "tie_low_clock_ck",
1511};
1512
1513DEFINE_CLK_MUX(pmd_stm_clock_mux_ck, pmd_stm_clock_mux_ck_parents, NULL, 0x0,
1514 OMAP4430_CM_EMU_DEBUGSS_CLKCTRL, OMAP4430_PMD_STM_MUX_CTRL_SHIFT,
1515 OMAP4430_PMD_STM_MUX_CTRL_WIDTH, 0x0, NULL);
1516
1517DEFINE_CLK_MUX(pmd_trace_clk_mux_ck, pmd_stm_clock_mux_ck_parents, NULL, 0x0,
1518 OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
1519 OMAP4430_PMD_TRACE_MUX_CTRL_SHIFT,
1520 OMAP4430_PMD_TRACE_MUX_CTRL_WIDTH, 0x0, NULL);
1521
1522DEFINE_CLK_DIVIDER(stm_clk_div_ck, "pmd_stm_clock_mux_ck",
1523 &pmd_stm_clock_mux_ck, 0x0, OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
1524 OMAP4430_CLKSEL_PMD_STM_CLK_SHIFT,
1525 OMAP4430_CLKSEL_PMD_STM_CLK_WIDTH, CLK_DIVIDER_POWER_OF_TWO,
1526 NULL);
1527
1528static const char *trace_clk_div_ck_parents[] = {
1529 "pmd_trace_clk_mux_ck",
1530};
1531
1532static const struct clksel trace_clk_div_div[] = {
1533 { .parent = &pmd_trace_clk_mux_ck, .rates = div3_1to4_rates },
1534 { .parent = NULL },
1535};
1536
1537static struct clk trace_clk_div_ck;
1538
1539static const struct clk_ops trace_clk_div_ck_ops = {
1540 .recalc_rate = &omap2_clksel_recalc,
1541 .set_rate = &omap2_clksel_set_rate,
1542 .round_rate = &omap2_clksel_round_rate,
1543 .init = &omap2_init_clk_clkdm,
1544 .enable = &omap2_clkops_enable_clkdm,
1545 .disable = &omap2_clkops_disable_clkdm,
1546};
1547
1548static struct clk_hw_omap trace_clk_div_ck_hw = {
1549 .hw = {
1550 .clk = &trace_clk_div_ck,
1551 },
1552 .clkdm_name = "emu_sys_clkdm",
1553 .clksel = trace_clk_div_div,
1554 .clksel_reg = OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
1555 .clksel_mask = OMAP4430_CLKSEL_PMD_TRACE_CLK_MASK,
1556};
1557
1558DEFINE_STRUCT_CLK(trace_clk_div_ck, trace_clk_div_ck_parents,
1559 trace_clk_div_ck_ops);
1560
1561/* SCRM aux clk nodes */
1562
1563static const struct clksel auxclk_src_sel[] = {
1564 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
1565 { .parent = &dpll_core_m3x2_ck, .rates = div_1_1_rates },
1566 { .parent = &dpll_per_m3x2_ck, .rates = div_1_2_rates },
1567 { .parent = NULL },
1568};
1569
1570static const char *auxclk_src_ck_parents[] = {
1571 "sys_clkin_ck", "dpll_core_m3x2_ck", "dpll_per_m3x2_ck",
1572};
1573
1574static const struct clk_ops auxclk_src_ck_ops = {
1575 .enable = &omap2_dflt_clk_enable,
1576 .disable = &omap2_dflt_clk_disable,
1577 .is_enabled = &omap2_dflt_clk_is_enabled,
1578 .recalc_rate = &omap2_clksel_recalc,
1579 .get_parent = &omap2_clksel_find_parent_index,
1580};
1581
1582DEFINE_CLK_OMAP_MUX_GATE(auxclk0_src_ck, NULL, auxclk_src_sel,
1583 OMAP4_SCRM_AUXCLK0, OMAP4_SRCSELECT_MASK,
1584 OMAP4_SCRM_AUXCLK0, OMAP4_ENABLE_SHIFT, NULL,
1585 auxclk_src_ck_parents, auxclk_src_ck_ops);
1586
1587DEFINE_CLK_DIVIDER(auxclk0_ck, "auxclk0_src_ck", &auxclk0_src_ck, 0x0,
1588 OMAP4_SCRM_AUXCLK0, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1589 0x0, NULL);
1590
1591DEFINE_CLK_OMAP_MUX_GATE(auxclk1_src_ck, NULL, auxclk_src_sel,
1592 OMAP4_SCRM_AUXCLK1, OMAP4_SRCSELECT_MASK,
1593 OMAP4_SCRM_AUXCLK1, OMAP4_ENABLE_SHIFT, NULL,
1594 auxclk_src_ck_parents, auxclk_src_ck_ops);
1595
1596DEFINE_CLK_DIVIDER(auxclk1_ck, "auxclk1_src_ck", &auxclk1_src_ck, 0x0,
1597 OMAP4_SCRM_AUXCLK1, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1598 0x0, NULL);
1599
1600DEFINE_CLK_OMAP_MUX_GATE(auxclk2_src_ck, NULL, auxclk_src_sel,
1601 OMAP4_SCRM_AUXCLK2, OMAP4_SRCSELECT_MASK,
1602 OMAP4_SCRM_AUXCLK2, OMAP4_ENABLE_SHIFT, NULL,
1603 auxclk_src_ck_parents, auxclk_src_ck_ops);
1604
1605DEFINE_CLK_DIVIDER(auxclk2_ck, "auxclk2_src_ck", &auxclk2_src_ck, 0x0,
1606 OMAP4_SCRM_AUXCLK2, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1607 0x0, NULL);
1608
1609DEFINE_CLK_OMAP_MUX_GATE(auxclk3_src_ck, NULL, auxclk_src_sel,
1610 OMAP4_SCRM_AUXCLK3, OMAP4_SRCSELECT_MASK,
1611 OMAP4_SCRM_AUXCLK3, OMAP4_ENABLE_SHIFT, NULL,
1612 auxclk_src_ck_parents, auxclk_src_ck_ops);
1613
1614DEFINE_CLK_DIVIDER(auxclk3_ck, "auxclk3_src_ck", &auxclk3_src_ck, 0x0,
1615 OMAP4_SCRM_AUXCLK3, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1616 0x0, NULL);
1617
1618DEFINE_CLK_OMAP_MUX_GATE(auxclk4_src_ck, NULL, auxclk_src_sel,
1619 OMAP4_SCRM_AUXCLK4, OMAP4_SRCSELECT_MASK,
1620 OMAP4_SCRM_AUXCLK4, OMAP4_ENABLE_SHIFT, NULL,
1621 auxclk_src_ck_parents, auxclk_src_ck_ops);
1622
1623DEFINE_CLK_DIVIDER(auxclk4_ck, "auxclk4_src_ck", &auxclk4_src_ck, 0x0,
1624 OMAP4_SCRM_AUXCLK4, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1625 0x0, NULL);
1626
1627DEFINE_CLK_OMAP_MUX_GATE(auxclk5_src_ck, NULL, auxclk_src_sel,
1628 OMAP4_SCRM_AUXCLK5, OMAP4_SRCSELECT_MASK,
1629 OMAP4_SCRM_AUXCLK5, OMAP4_ENABLE_SHIFT, NULL,
1630 auxclk_src_ck_parents, auxclk_src_ck_ops);
1631
1632DEFINE_CLK_DIVIDER(auxclk5_ck, "auxclk5_src_ck", &auxclk5_src_ck, 0x0,
1633 OMAP4_SCRM_AUXCLK5, OMAP4_CLKDIV_SHIFT, OMAP4_CLKDIV_WIDTH,
1634 0x0, NULL);
1635
1636static const char *auxclkreq_ck_parents[] = {
1637 "auxclk0_ck", "auxclk1_ck", "auxclk2_ck", "auxclk3_ck", "auxclk4_ck",
1638 "auxclk5_ck",
1639};
1640
1641DEFINE_CLK_MUX(auxclkreq0_ck, auxclkreq_ck_parents, NULL, 0x0,
1642 OMAP4_SCRM_AUXCLKREQ0, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1643 0x0, NULL);
1644
1645DEFINE_CLK_MUX(auxclkreq1_ck, auxclkreq_ck_parents, NULL, 0x0,
1646 OMAP4_SCRM_AUXCLKREQ1, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1647 0x0, NULL);
1648
1649DEFINE_CLK_MUX(auxclkreq2_ck, auxclkreq_ck_parents, NULL, 0x0,
1650 OMAP4_SCRM_AUXCLKREQ2, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1651 0x0, NULL);
1652
1653DEFINE_CLK_MUX(auxclkreq3_ck, auxclkreq_ck_parents, NULL, 0x0,
1654 OMAP4_SCRM_AUXCLKREQ3, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1655 0x0, NULL);
1656
1657DEFINE_CLK_MUX(auxclkreq4_ck, auxclkreq_ck_parents, NULL, 0x0,
1658 OMAP4_SCRM_AUXCLKREQ4, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1659 0x0, NULL);
1660
1661DEFINE_CLK_MUX(auxclkreq5_ck, auxclkreq_ck_parents, NULL, 0x0,
1662 OMAP4_SCRM_AUXCLKREQ5, OMAP4_MAPPING_SHIFT, OMAP4_MAPPING_WIDTH,
1663 0x0, NULL);
1664
1665/*
1666 * clkdev
1667 */
1668
1669static struct omap_clk omap44xx_clks[] = {
1670 CLK(NULL, "extalt_clkin_ck", &extalt_clkin_ck, CK_443X),
1671 CLK(NULL, "pad_clks_src_ck", &pad_clks_src_ck, CK_443X),
1672 CLK(NULL, "pad_clks_ck", &pad_clks_ck, CK_443X),
1673 CLK(NULL, "pad_slimbus_core_clks_ck", &pad_slimbus_core_clks_ck, CK_443X),
1674 CLK(NULL, "secure_32k_clk_src_ck", &secure_32k_clk_src_ck, CK_443X),
1675 CLK(NULL, "slimbus_src_clk", &slimbus_src_clk, CK_443X),
1676 CLK(NULL, "slimbus_clk", &slimbus_clk, CK_443X),
1677 CLK(NULL, "sys_32k_ck", &sys_32k_ck, CK_443X),
1678 CLK(NULL, "virt_12000000_ck", &virt_12000000_ck, CK_443X),
1679 CLK(NULL, "virt_13000000_ck", &virt_13000000_ck, CK_443X),
1680 CLK(NULL, "virt_16800000_ck", &virt_16800000_ck, CK_443X),
1681 CLK(NULL, "virt_19200000_ck", &virt_19200000_ck, CK_443X),
1682 CLK(NULL, "virt_26000000_ck", &virt_26000000_ck, CK_443X),
1683 CLK(NULL, "virt_27000000_ck", &virt_27000000_ck, CK_443X),
1684 CLK(NULL, "virt_38400000_ck", &virt_38400000_ck, CK_443X),
1685 CLK(NULL, "sys_clkin_ck", &sys_clkin_ck, CK_443X),
1686 CLK(NULL, "tie_low_clock_ck", &tie_low_clock_ck, CK_443X),
1687 CLK(NULL, "utmi_phy_clkout_ck", &utmi_phy_clkout_ck, CK_443X),
1688 CLK(NULL, "xclk60mhsp1_ck", &xclk60mhsp1_ck, CK_443X),
1689 CLK(NULL, "xclk60mhsp2_ck", &xclk60mhsp2_ck, CK_443X),
1690 CLK(NULL, "xclk60motg_ck", &xclk60motg_ck, CK_443X),
1691 CLK(NULL, "abe_dpll_bypass_clk_mux_ck", &abe_dpll_bypass_clk_mux_ck, CK_443X),
1692 CLK(NULL, "abe_dpll_refclk_mux_ck", &abe_dpll_refclk_mux_ck, CK_443X),
1693 CLK(NULL, "dpll_abe_ck", &dpll_abe_ck, CK_443X),
1694 CLK(NULL, "dpll_abe_x2_ck", &dpll_abe_x2_ck, CK_443X),
1695 CLK(NULL, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck, CK_443X),
1696 CLK(NULL, "abe_24m_fclk", &abe_24m_fclk, CK_443X),
1697 CLK(NULL, "abe_clk", &abe_clk, CK_443X),
1698 CLK(NULL, "aess_fclk", &aess_fclk, CK_443X),
1699 CLK(NULL, "dpll_abe_m3x2_ck", &dpll_abe_m3x2_ck, CK_443X),
1700 CLK(NULL, "core_hsd_byp_clk_mux_ck", &core_hsd_byp_clk_mux_ck, CK_443X),
1701 CLK(NULL, "dpll_core_ck", &dpll_core_ck, CK_443X),
1702 CLK(NULL, "dpll_core_x2_ck", &dpll_core_x2_ck, CK_443X),
1703 CLK(NULL, "dpll_core_m6x2_ck", &dpll_core_m6x2_ck, CK_443X),
1704 CLK(NULL, "dbgclk_mux_ck", &dbgclk_mux_ck, CK_443X),
1705 CLK(NULL, "dpll_core_m2_ck", &dpll_core_m2_ck, CK_443X),
1706 CLK(NULL, "ddrphy_ck", &ddrphy_ck, CK_443X),
1707 CLK(NULL, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, CK_443X),
1708 CLK(NULL, "div_core_ck", &div_core_ck, CK_443X),
1709 CLK(NULL, "div_iva_hs_clk", &div_iva_hs_clk, CK_443X),
1710 CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk, CK_443X),
1711 CLK(NULL, "dpll_core_m4x2_ck", &dpll_core_m4x2_ck, CK_443X),
1712 CLK(NULL, "dll_clk_div_ck", &dll_clk_div_ck, CK_443X),
1713 CLK(NULL, "dpll_abe_m2_ck", &dpll_abe_m2_ck, CK_443X),
1714 CLK(NULL, "dpll_core_m3x2_ck", &dpll_core_m3x2_ck, CK_443X),
1715 CLK(NULL, "dpll_core_m7x2_ck", &dpll_core_m7x2_ck, CK_443X),
1716 CLK(NULL, "iva_hsd_byp_clk_mux_ck", &iva_hsd_byp_clk_mux_ck, CK_443X),
1717 CLK(NULL, "dpll_iva_ck", &dpll_iva_ck, CK_443X),
1718 CLK(NULL, "dpll_iva_x2_ck", &dpll_iva_x2_ck, CK_443X),
1719 CLK(NULL, "dpll_iva_m4x2_ck", &dpll_iva_m4x2_ck, CK_443X),
1720 CLK(NULL, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck, CK_443X),
1721 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_443X),
1722 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_443X),
1723 CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck, CK_443X),
1724 CLK(NULL, "per_hsd_byp_clk_mux_ck", &per_hsd_byp_clk_mux_ck, CK_443X),
1725 CLK(NULL, "dpll_per_ck", &dpll_per_ck, CK_443X),
1726 CLK(NULL, "dpll_per_m2_ck", &dpll_per_m2_ck, CK_443X),
1727 CLK(NULL, "dpll_per_x2_ck", &dpll_per_x2_ck, CK_443X),
1728 CLK(NULL, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, CK_443X),
1729 CLK(NULL, "dpll_per_m3x2_ck", &dpll_per_m3x2_ck, CK_443X),
1730 CLK(NULL, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, CK_443X),
1731 CLK(NULL, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck, CK_443X),
1732 CLK(NULL, "dpll_per_m6x2_ck", &dpll_per_m6x2_ck, CK_443X),
1733 CLK(NULL, "dpll_per_m7x2_ck", &dpll_per_m7x2_ck, CK_443X),
1734 CLK(NULL, "usb_hs_clk_div_ck", &usb_hs_clk_div_ck, CK_443X),
1735 CLK(NULL, "dpll_usb_ck", &dpll_usb_ck, CK_443X),
1736 CLK(NULL, "dpll_usb_clkdcoldo_ck", &dpll_usb_clkdcoldo_ck, CK_443X),
1737 CLK(NULL, "dpll_usb_m2_ck", &dpll_usb_m2_ck, CK_443X),
1738 CLK(NULL, "ducati_clk_mux_ck", &ducati_clk_mux_ck, CK_443X),
1739 CLK(NULL, "func_12m_fclk", &func_12m_fclk, CK_443X),
1740 CLK(NULL, "func_24m_clk", &func_24m_clk, CK_443X),
1741 CLK(NULL, "func_24mc_fclk", &func_24mc_fclk, CK_443X),
1742 CLK(NULL, "func_48m_fclk", &func_48m_fclk, CK_443X),
1743 CLK(NULL, "func_48mc_fclk", &func_48mc_fclk, CK_443X),
1744 CLK(NULL, "func_64m_fclk", &func_64m_fclk, CK_443X),
1745 CLK(NULL, "func_96m_fclk", &func_96m_fclk, CK_443X),
1746 CLK(NULL, "init_60m_fclk", &init_60m_fclk, CK_443X),
1747 CLK(NULL, "l3_div_ck", &l3_div_ck, CK_443X),
1748 CLK(NULL, "l4_div_ck", &l4_div_ck, CK_443X),
1749 CLK(NULL, "lp_clk_div_ck", &lp_clk_div_ck, CK_443X),
1750 CLK(NULL, "l4_wkup_clk_mux_ck", &l4_wkup_clk_mux_ck, CK_443X),
1751 CLK("smp_twd", NULL, &mpu_periphclk, CK_443X),
1752 CLK(NULL, "ocp_abe_iclk", &ocp_abe_iclk, CK_443X),
1753 CLK(NULL, "per_abe_24m_fclk", &per_abe_24m_fclk, CK_443X),
1754 CLK(NULL, "per_abe_nc_fclk", &per_abe_nc_fclk, CK_443X),
1755 CLK(NULL, "syc_clk_div_ck", &syc_clk_div_ck, CK_443X),
1756 CLK(NULL, "aes1_fck", &aes1_fck, CK_443X),
1757 CLK(NULL, "aes2_fck", &aes2_fck, CK_443X),
1758 CLK(NULL, "aess_fck", &aess_fck, CK_443X),
1759 CLK(NULL, "bandgap_fclk", &bandgap_fclk, CK_443X),
1760 CLK(NULL, "div_ts_ck", &div_ts_ck, CK_446X),
1761 CLK(NULL, "bandgap_ts_fclk", &bandgap_ts_fclk, CK_446X),
1762 CLK(NULL, "des3des_fck", &des3des_fck, CK_443X),
1763 CLK(NULL, "dmic_sync_mux_ck", &dmic_sync_mux_ck, CK_443X),
1764 CLK(NULL, "dmic_fck", &dmic_fck, CK_443X),
1765 CLK(NULL, "dsp_fck", &dsp_fck, CK_443X),
1766 CLK(NULL, "dss_sys_clk", &dss_sys_clk, CK_443X),
1767 CLK(NULL, "dss_tv_clk", &dss_tv_clk, CK_443X),
1768 CLK(NULL, "dss_dss_clk", &dss_dss_clk, CK_443X),
1769 CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk, CK_443X),
1770 CLK(NULL, "dss_fck", &dss_fck, CK_443X),
1771 CLK("omapdss_dss", "ick", &dss_fck, CK_443X),
1772 CLK(NULL, "efuse_ctrl_cust_fck", &efuse_ctrl_cust_fck, CK_443X),
1773 CLK(NULL, "emif1_fck", &emif1_fck, CK_443X),
1774 CLK(NULL, "emif2_fck", &emif2_fck, CK_443X),
1775 CLK(NULL, "fdif_fck", &fdif_fck, CK_443X),
1776 CLK(NULL, "fpka_fck", &fpka_fck, CK_443X),
1777 CLK(NULL, "gpio1_dbclk", &gpio1_dbclk, CK_443X),
1778 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_443X),
1779 CLK(NULL, "gpio2_dbclk", &gpio2_dbclk, CK_443X),
1780 CLK(NULL, "gpio2_ick", &gpio2_ick, CK_443X),
1781 CLK(NULL, "gpio3_dbclk", &gpio3_dbclk, CK_443X),
1782 CLK(NULL, "gpio3_ick", &gpio3_ick, CK_443X),
1783 CLK(NULL, "gpio4_dbclk", &gpio4_dbclk, CK_443X),
1784 CLK(NULL, "gpio4_ick", &gpio4_ick, CK_443X),
1785 CLK(NULL, "gpio5_dbclk", &gpio5_dbclk, CK_443X),
1786 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_443X),
1787 CLK(NULL, "gpio6_dbclk", &gpio6_dbclk, CK_443X),
1788 CLK(NULL, "gpio6_ick", &gpio6_ick, CK_443X),
1789 CLK(NULL, "gpmc_ick", &gpmc_ick, CK_443X),
1790 CLK(NULL, "gpu_fck", &gpu_fck, CK_443X),
1791 CLK(NULL, "hdq1w_fck", &hdq1w_fck, CK_443X),
1792 CLK(NULL, "hsi_fck", &hsi_fck, CK_443X),
1793 CLK(NULL, "i2c1_fck", &i2c1_fck, CK_443X),
1794 CLK(NULL, "i2c2_fck", &i2c2_fck, CK_443X),
1795 CLK(NULL, "i2c3_fck", &i2c3_fck, CK_443X),
1796 CLK(NULL, "i2c4_fck", &i2c4_fck, CK_443X),
1797 CLK(NULL, "ipu_fck", &ipu_fck, CK_443X),
1798 CLK(NULL, "iss_ctrlclk", &iss_ctrlclk, CK_443X),
1799 CLK(NULL, "iss_fck", &iss_fck, CK_443X),
1800 CLK(NULL, "iva_fck", &iva_fck, CK_443X),
1801 CLK(NULL, "kbd_fck", &kbd_fck, CK_443X),
1802 CLK(NULL, "l3_instr_ick", &l3_instr_ick, CK_443X),
1803 CLK(NULL, "l3_main_3_ick", &l3_main_3_ick, CK_443X),
1804 CLK(NULL, "mcasp_sync_mux_ck", &mcasp_sync_mux_ck, CK_443X),
1805 CLK(NULL, "mcasp_fck", &mcasp_fck, CK_443X),
1806 CLK(NULL, "mcbsp1_sync_mux_ck", &mcbsp1_sync_mux_ck, CK_443X),
1807 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_443X),
1808 CLK(NULL, "mcbsp2_sync_mux_ck", &mcbsp2_sync_mux_ck, CK_443X),
1809 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_443X),
1810 CLK(NULL, "mcbsp3_sync_mux_ck", &mcbsp3_sync_mux_ck, CK_443X),
1811 CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_443X),
1812 CLK(NULL, "mcbsp4_sync_mux_ck", &mcbsp4_sync_mux_ck, CK_443X),
1813 CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_443X),
1814 CLK(NULL, "mcpdm_fck", &mcpdm_fck, CK_443X),
1815 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_443X),
1816 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_443X),
1817 CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_443X),
1818 CLK(NULL, "mcspi4_fck", &mcspi4_fck, CK_443X),
1819 CLK(NULL, "mmc1_fck", &mmc1_fck, CK_443X),
1820 CLK(NULL, "mmc2_fck", &mmc2_fck, CK_443X),
1821 CLK(NULL, "mmc3_fck", &mmc3_fck, CK_443X),
1822 CLK(NULL, "mmc4_fck", &mmc4_fck, CK_443X),
1823 CLK(NULL, "mmc5_fck", &mmc5_fck, CK_443X),
1824 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X),
1825 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X),
1826 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X),
1827 CLK(NULL, "rng_ick", &rng_ick, CK_443X),
1828 CLK("omap_rng", "ick", &rng_ick, CK_443X),
1829 CLK(NULL, "sha2md5_fck", &sha2md5_fck, CK_443X),
1830 CLK(NULL, "sl2if_ick", &sl2if_ick, CK_443X),
1831 CLK(NULL, "slimbus1_fclk_1", &slimbus1_fclk_1, CK_443X),
1832 CLK(NULL, "slimbus1_fclk_0", &slimbus1_fclk_0, CK_443X),
1833 CLK(NULL, "slimbus1_fclk_2", &slimbus1_fclk_2, CK_443X),
1834 CLK(NULL, "slimbus1_slimbus_clk", &slimbus1_slimbus_clk, CK_443X),
1835 CLK(NULL, "slimbus1_fck", &slimbus1_fck, CK_443X),
1836 CLK(NULL, "slimbus2_fclk_1", &slimbus2_fclk_1, CK_443X),
1837 CLK(NULL, "slimbus2_fclk_0", &slimbus2_fclk_0, CK_443X),
1838 CLK(NULL, "slimbus2_slimbus_clk", &slimbus2_slimbus_clk, CK_443X),
1839 CLK(NULL, "slimbus2_fck", &slimbus2_fck, CK_443X),
1840 CLK(NULL, "smartreflex_core_fck", &smartreflex_core_fck, CK_443X),
1841 CLK(NULL, "smartreflex_iva_fck", &smartreflex_iva_fck, CK_443X),
1842 CLK(NULL, "smartreflex_mpu_fck", &smartreflex_mpu_fck, CK_443X),
1843 CLK(NULL, "timer1_fck", &timer1_fck, CK_443X),
1844 CLK(NULL, "timer10_fck", &timer10_fck, CK_443X),
1845 CLK(NULL, "timer11_fck", &timer11_fck, CK_443X),
1846 CLK(NULL, "timer2_fck", &timer2_fck, CK_443X),
1847 CLK(NULL, "timer3_fck", &timer3_fck, CK_443X),
1848 CLK(NULL, "timer4_fck", &timer4_fck, CK_443X),
1849 CLK(NULL, "timer5_fck", &timer5_fck, CK_443X),
1850 CLK(NULL, "timer6_fck", &timer6_fck, CK_443X),
1851 CLK(NULL, "timer7_fck", &timer7_fck, CK_443X),
1852 CLK(NULL, "timer8_fck", &timer8_fck, CK_443X),
1853 CLK(NULL, "timer9_fck", &timer9_fck, CK_443X),
1854 CLK(NULL, "uart1_fck", &uart1_fck, CK_443X),
1855 CLK(NULL, "uart2_fck", &uart2_fck, CK_443X),
1856 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
1857 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
1858 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
1859 CLK("usbhs_omap", "fs_fck", &usb_host_fs_fck, CK_443X),
1860 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
1861 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
1862 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
1863 CLK(NULL, "usb_host_hs_utmi_p2_clk", &usb_host_hs_utmi_p2_clk, CK_443X),
1864 CLK(NULL, "usb_host_hs_utmi_p3_clk", &usb_host_hs_utmi_p3_clk, CK_443X),
1865 CLK(NULL, "usb_host_hs_hsic480m_p1_clk", &usb_host_hs_hsic480m_p1_clk, CK_443X),
1866 CLK(NULL, "usb_host_hs_hsic60m_p1_clk", &usb_host_hs_hsic60m_p1_clk, CK_443X),
1867 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
1868 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
1869 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
1870 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X),
1871 CLK("usbhs_omap", "hs_fck", &usb_host_hs_fck, CK_443X),
1872 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X),
1873 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X),
1874 CLK(NULL, "usb_otg_hs_ick", &usb_otg_hs_ick, CK_443X),
1875 CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X),
1876 CLK(NULL, "usb_phy_cm_clk32k", &usb_phy_cm_clk32k, CK_443X),
1877 CLK(NULL, "usb_tll_hs_usb_ch2_clk", &usb_tll_hs_usb_ch2_clk, CK_443X),
1878 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X),
1879 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X),
1880 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X),
1881 CLK("usbhs_omap", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
1882 CLK("usbhs_tll", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
1883 CLK(NULL, "usim_ck", &usim_ck, CK_443X),
1884 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
1885 CLK(NULL, "usim_fck", &usim_fck, CK_443X),
1886 CLK(NULL, "wd_timer2_fck", &wd_timer2_fck, CK_443X),
1887 CLK(NULL, "wd_timer3_fck", &wd_timer3_fck, CK_443X),
1888 CLK(NULL, "pmd_stm_clock_mux_ck", &pmd_stm_clock_mux_ck, CK_443X),
1889 CLK(NULL, "pmd_trace_clk_mux_ck", &pmd_trace_clk_mux_ck, CK_443X),
1890 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X),
1891 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X),
1892 CLK(NULL, "auxclk0_src_ck", &auxclk0_src_ck, CK_443X),
1893 CLK(NULL, "auxclk0_ck", &auxclk0_ck, CK_443X),
1894 CLK(NULL, "auxclkreq0_ck", &auxclkreq0_ck, CK_443X),
1895 CLK(NULL, "auxclk1_src_ck", &auxclk1_src_ck, CK_443X),
1896 CLK(NULL, "auxclk1_ck", &auxclk1_ck, CK_443X),
1897 CLK(NULL, "auxclkreq1_ck", &auxclkreq1_ck, CK_443X),
1898 CLK(NULL, "auxclk2_src_ck", &auxclk2_src_ck, CK_443X),
1899 CLK(NULL, "auxclk2_ck", &auxclk2_ck, CK_443X),
1900 CLK(NULL, "auxclkreq2_ck", &auxclkreq2_ck, CK_443X),
1901 CLK(NULL, "auxclk3_src_ck", &auxclk3_src_ck, CK_443X),
1902 CLK(NULL, "auxclk3_ck", &auxclk3_ck, CK_443X),
1903 CLK(NULL, "auxclkreq3_ck", &auxclkreq3_ck, CK_443X),
1904 CLK(NULL, "auxclk4_src_ck", &auxclk4_src_ck, CK_443X),
1905 CLK(NULL, "auxclk4_ck", &auxclk4_ck, CK_443X),
1906 CLK(NULL, "auxclkreq4_ck", &auxclkreq4_ck, CK_443X),
1907 CLK(NULL, "auxclk5_src_ck", &auxclk5_src_ck, CK_443X),
1908 CLK(NULL, "auxclk5_ck", &auxclk5_ck, CK_443X),
1909 CLK(NULL, "auxclkreq5_ck", &auxclkreq5_ck, CK_443X),
1910 CLK("omap-gpmc", "fck", &dummy_ck, CK_443X),
1911 CLK("omap_i2c.1", "ick", &dummy_ck, CK_443X),
1912 CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X),
1913 CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X),
1914 CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X),
1915 CLK(NULL, "mailboxes_ick", &dummy_ck, CK_443X),
1916 CLK("omap_hsmmc.0", "ick", &dummy_ck, CK_443X),
1917 CLK("omap_hsmmc.1", "ick", &dummy_ck, CK_443X),
1918 CLK("omap_hsmmc.2", "ick", &dummy_ck, CK_443X),
1919 CLK("omap_hsmmc.3", "ick", &dummy_ck, CK_443X),
1920 CLK("omap_hsmmc.4", "ick", &dummy_ck, CK_443X),
1921 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X),
1922 CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X),
1923 CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X),
1924 CLK("omap-mcbsp.4", "ick", &dummy_ck, CK_443X),
1925 CLK("omap2_mcspi.1", "ick", &dummy_ck, CK_443X),
1926 CLK("omap2_mcspi.2", "ick", &dummy_ck, CK_443X),
1927 CLK("omap2_mcspi.3", "ick", &dummy_ck, CK_443X),
1928 CLK("omap2_mcspi.4", "ick", &dummy_ck, CK_443X),
1929 CLK(NULL, "uart1_ick", &dummy_ck, CK_443X),
1930 CLK(NULL, "uart2_ick", &dummy_ck, CK_443X),
1931 CLK(NULL, "uart3_ick", &dummy_ck, CK_443X),
1932 CLK(NULL, "uart4_ick", &dummy_ck, CK_443X),
1933 CLK("usbhs_omap", "usbhost_ick", &dummy_ck, CK_443X),
1934 CLK("usbhs_omap", "usbtll_fck", &dummy_ck, CK_443X),
1935 CLK("usbhs_tll", "usbtll_fck", &dummy_ck, CK_443X),
1936 CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
1937 CLK(NULL, "timer_32k_ck", &sys_32k_ck, CK_443X),
1938 /* TODO: Remove "omap_timer.X" aliases once DT migration is complete */
1939 CLK("omap_timer.1", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1940 CLK("omap_timer.2", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1941 CLK("omap_timer.3", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1942 CLK("omap_timer.4", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1943 CLK("omap_timer.9", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1944 CLK("omap_timer.10", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1945 CLK("omap_timer.11", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1946 CLK("omap_timer.5", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1947 CLK("omap_timer.6", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1948 CLK("omap_timer.7", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1949 CLK("omap_timer.8", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1950 CLK("4a318000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1951 CLK("48032000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1952 CLK("48034000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1953 CLK("48036000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1954 CLK("4803e000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1955 CLK("48086000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1956 CLK("48088000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
Jon Hunterba68c7e2012-12-15 01:35:39 -07001957 CLK("40138000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1958 CLK("4013a000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1959 CLK("4013c000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1960 CLK("4013e000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
Rajendra Nayakcb268672012-11-06 15:41:08 -07001961 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X),
1962};
1963
1964static const char *enable_init_clks[] = {
1965 "emif1_fck",
1966 "emif2_fck",
1967 "gpmc_ick",
1968 "l3_instr_ick",
1969 "l3_main_3_ick",
1970 "ocp_wp_noc_ick",
1971};
1972
1973int __init omap4xxx_clk_init(void)
1974{
1975 u32 cpu_clkflg;
1976 struct omap_clk *c;
Jon Hunter8c197cc2012-12-15 01:35:50 -07001977 int rc;
Rajendra Nayakcb268672012-11-06 15:41:08 -07001978
1979 if (cpu_is_omap443x()) {
1980 cpu_mask = RATE_IN_4430;
1981 cpu_clkflg = CK_443X;
1982 } else if (cpu_is_omap446x() || cpu_is_omap447x()) {
1983 cpu_mask = RATE_IN_4460 | RATE_IN_4430;
1984 cpu_clkflg = CK_446X | CK_443X;
1985
1986 if (cpu_is_omap447x())
1987 pr_warn("WARNING: OMAP4470 clock data incomplete!\n");
1988 } else {
1989 return 0;
1990 }
1991
1992 for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks);
1993 c++) {
1994 if (c->cpu & cpu_clkflg) {
1995 clkdev_add(&c->lk);
1996 if (!__clk_init(NULL, c->lk.clk))
1997 omap2_init_clk_hw_omap_clocks(c->lk.clk);
1998 }
1999 }
2000
2001 omap2_clk_disable_autoidle_all();
2002
2003 omap2_clk_enable_init_clocks(enable_init_clks,
2004 ARRAY_SIZE(enable_init_clks));
2005
Jon Hunter8c197cc2012-12-15 01:35:50 -07002006 /*
2007 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
2008 * state when turning the ABE clock domain. Workaround this by
2009 * locking the ABE DPLL on boot.
2010 */
2011 if (cpu_is_omap446x()) {
2012 rc = clk_set_parent(&abe_dpll_refclk_mux_ck, &sys_32k_ck);
2013 if (!rc)
2014 rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ);
2015 if (rc)
2016 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
2017 }
2018
Rajendra Nayakcb268672012-11-06 15:41:08 -07002019 return 0;
2020}