blob: a1b3de7e2bd769109af09a7f3ccfa8fd81679ca9 [file] [log] [blame]
Paul Walmsleyb045d082008-03-18 11:24:28 +02001/*
2 * OMAP3 clock framework
3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2008 Nokia Corporation
6 *
7 * Written by Paul Walmsley
Paul Walmsley542313c2008-07-03 12:24:45 +03008 * With many device clock fixes by Kevin Hilman and Jouni Högander
9 * DPLL bypass clock support added by Roman Tereshonkov
10 *
11 */
12
13/*
14 * Virtual clocks are introduced as convenient tools.
15 * They are sources for other clocks and not supposed
16 * to be requested from drivers directly.
Paul Walmsleyb045d082008-03-18 11:24:28 +020017 */
18
19#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
20#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
21
Tony Lindgrence491cf2009-10-20 09:40:47 -070022#include <plat/control.h>
Paul Walmsleyb045d082008-03-18 11:24:28 +020023
24#include "clock.h"
25#include "cm.h"
26#include "cm-regbits-34xx.h"
27#include "prm.h"
28#include "prm-regbits-34xx.h"
29
Tony Lindgrenef6685a2009-05-25 11:26:46 -070030#define OMAP_CM_REGADDR OMAP34XX_CM_REGADDR
31
Russell King8b9dbc12009-02-12 10:12:59 +000032static unsigned long omap3_dpll_recalc(struct clk *clk);
33static unsigned long omap3_clkoutx2_recalc(struct clk *clk);
Paul Walmsley542313c2008-07-03 12:24:45 +030034static void omap3_dpll_allow_idle(struct clk *clk);
35static void omap3_dpll_deny_idle(struct clk *clk);
36static u32 omap3_dpll_autoidle_read(struct clk *clk);
Paul Walmsley16c90f02009-01-27 19:12:47 -070037static int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate);
38static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate);
Paul Walmsley0eafd472009-01-28 12:27:42 -070039static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate);
Paul Walmsleyb045d082008-03-18 11:24:28 +020040
Paul Walmsley88b8ba92008-07-03 12:24:46 +030041/* Maximum DPLL multiplier, divider values for OMAP3 */
42#define OMAP3_MAX_DPLL_MULT 2048
43#define OMAP3_MAX_DPLL_DIV 128
44
Paul Walmsleyb045d082008-03-18 11:24:28 +020045/*
46 * DPLL1 supplies clock to the MPU.
47 * DPLL2 supplies clock to the IVA2.
48 * DPLL3 supplies CORE domain clocks.
49 * DPLL4 supplies peripheral clocks.
50 * DPLL5 supplies other peripheral clocks (USBHOST, USIM).
51 */
52
Russell Kingc0bf3132009-02-19 13:29:22 +000053/* Forward declarations for DPLL bypass clocks */
54static struct clk dpll1_fck;
55static struct clk dpll2_fck;
56
Paul Walmsley542313c2008-07-03 12:24:45 +030057/* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */
58#define DPLL_LOW_POWER_STOP 0x1
59#define DPLL_LOW_POWER_BYPASS 0x5
60#define DPLL_LOCKED 0x7
61
Paul Walmsleyb045d082008-03-18 11:24:28 +020062/* PRM CLOCKS */
63
64/* According to timer32k.c, this is a 32768Hz clock, not a 32000Hz clock. */
65static struct clk omap_32k_fck = {
66 .name = "omap_32k_fck",
Russell King897dcde2008-11-04 16:35:03 +000067 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +020068 .rate = 32768,
Russell King3f0a8202009-01-31 10:05:51 +000069 .flags = RATE_FIXED,
Paul Walmsleyb045d082008-03-18 11:24:28 +020070};
71
72static struct clk secure_32k_fck = {
73 .name = "secure_32k_fck",
Russell King897dcde2008-11-04 16:35:03 +000074 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +020075 .rate = 32768,
Russell King3f0a8202009-01-31 10:05:51 +000076 .flags = RATE_FIXED,
Paul Walmsleyb045d082008-03-18 11:24:28 +020077};
78
79/* Virtual source clocks for osc_sys_ck */
80static struct clk virt_12m_ck = {
81 .name = "virt_12m_ck",
Russell King897dcde2008-11-04 16:35:03 +000082 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +020083 .rate = 12000000,
Russell King3f0a8202009-01-31 10:05:51 +000084 .flags = RATE_FIXED,
Paul Walmsleyb045d082008-03-18 11:24:28 +020085};
86
87static struct clk virt_13m_ck = {
88 .name = "virt_13m_ck",
Russell King897dcde2008-11-04 16:35:03 +000089 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +020090 .rate = 13000000,
Russell King3f0a8202009-01-31 10:05:51 +000091 .flags = RATE_FIXED,
Paul Walmsleyb045d082008-03-18 11:24:28 +020092};
93
94static struct clk virt_16_8m_ck = {
95 .name = "virt_16_8m_ck",
Russell King897dcde2008-11-04 16:35:03 +000096 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +020097 .rate = 16800000,
Russell King3f0a8202009-01-31 10:05:51 +000098 .flags = RATE_FIXED,
Paul Walmsleyb045d082008-03-18 11:24:28 +020099};
100
101static struct clk virt_19_2m_ck = {
102 .name = "virt_19_2m_ck",
Russell King897dcde2008-11-04 16:35:03 +0000103 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200104 .rate = 19200000,
Russell King3f0a8202009-01-31 10:05:51 +0000105 .flags = RATE_FIXED,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200106};
107
108static struct clk virt_26m_ck = {
109 .name = "virt_26m_ck",
Russell King897dcde2008-11-04 16:35:03 +0000110 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200111 .rate = 26000000,
Russell King3f0a8202009-01-31 10:05:51 +0000112 .flags = RATE_FIXED,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200113};
114
115static struct clk virt_38_4m_ck = {
116 .name = "virt_38_4m_ck",
Russell King897dcde2008-11-04 16:35:03 +0000117 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200118 .rate = 38400000,
Russell King3f0a8202009-01-31 10:05:51 +0000119 .flags = RATE_FIXED,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200120};
121
122static const struct clksel_rate osc_sys_12m_rates[] = {
123 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
124 { .div = 0 }
125};
126
127static const struct clksel_rate osc_sys_13m_rates[] = {
128 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
129 { .div = 0 }
130};
131
132static const struct clksel_rate osc_sys_16_8m_rates[] = {
133 { .div = 1, .val = 5, .flags = RATE_IN_3430ES2 | DEFAULT_RATE },
134 { .div = 0 }
135};
136
137static const struct clksel_rate osc_sys_19_2m_rates[] = {
138 { .div = 1, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
139 { .div = 0 }
140};
141
142static const struct clksel_rate osc_sys_26m_rates[] = {
143 { .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
144 { .div = 0 }
145};
146
147static const struct clksel_rate osc_sys_38_4m_rates[] = {
148 { .div = 1, .val = 4, .flags = RATE_IN_343X | DEFAULT_RATE },
149 { .div = 0 }
150};
151
152static const struct clksel osc_sys_clksel[] = {
153 { .parent = &virt_12m_ck, .rates = osc_sys_12m_rates },
154 { .parent = &virt_13m_ck, .rates = osc_sys_13m_rates },
155 { .parent = &virt_16_8m_ck, .rates = osc_sys_16_8m_rates },
156 { .parent = &virt_19_2m_ck, .rates = osc_sys_19_2m_rates },
157 { .parent = &virt_26m_ck, .rates = osc_sys_26m_rates },
158 { .parent = &virt_38_4m_ck, .rates = osc_sys_38_4m_rates },
159 { .parent = NULL },
160};
161
162/* Oscillator clock */
163/* 12, 13, 16.8, 19.2, 26, or 38.4 MHz */
164static struct clk osc_sys_ck = {
165 .name = "osc_sys_ck",
Russell King897dcde2008-11-04 16:35:03 +0000166 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200167 .init = &omap2_init_clksel_parent,
168 .clksel_reg = OMAP3430_PRM_CLKSEL,
169 .clksel_mask = OMAP3430_SYS_CLKIN_SEL_MASK,
170 .clksel = osc_sys_clksel,
171 /* REVISIT: deal with autoextclkmode? */
Russell King3f0a8202009-01-31 10:05:51 +0000172 .flags = RATE_FIXED,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200173 .recalc = &omap2_clksel_recalc,
174};
175
176static const struct clksel_rate div2_rates[] = {
177 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
178 { .div = 2, .val = 2, .flags = RATE_IN_343X },
179 { .div = 0 }
180};
181
182static const struct clksel sys_clksel[] = {
183 { .parent = &osc_sys_ck, .rates = div2_rates },
184 { .parent = NULL }
185};
186
187/* Latency: this clock is only enabled after PRM_CLKSETUP.SETUP_TIME */
188/* Feeds DPLLs - divided first by PRM_CLKSRC_CTRL.SYSCLKDIV? */
189static struct clk sys_ck = {
190 .name = "sys_ck",
Russell King897dcde2008-11-04 16:35:03 +0000191 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200192 .parent = &osc_sys_ck,
193 .init = &omap2_init_clksel_parent,
194 .clksel_reg = OMAP3430_PRM_CLKSRC_CTRL,
195 .clksel_mask = OMAP_SYSCLKDIV_MASK,
196 .clksel = sys_clksel,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200197 .recalc = &omap2_clksel_recalc,
198};
199
200static struct clk sys_altclk = {
201 .name = "sys_altclk",
Russell King897dcde2008-11-04 16:35:03 +0000202 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200203};
204
205/* Optional external clock input for some McBSPs */
206static struct clk mcbsp_clks = {
207 .name = "mcbsp_clks",
Russell King897dcde2008-11-04 16:35:03 +0000208 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200209};
210
211/* PRM EXTERNAL CLOCK OUTPUT */
212
213static struct clk sys_clkout1 = {
214 .name = "sys_clkout1",
Russell Kingc1168dc2008-11-04 21:24:00 +0000215 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200216 .parent = &osc_sys_ck,
217 .enable_reg = OMAP3430_PRM_CLKOUT_CTRL,
218 .enable_bit = OMAP3430_CLKOUT_EN_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200219 .recalc = &followparent_recalc,
220};
221
222/* DPLLS */
223
224/* CM CLOCKS */
225
Paul Walmsleyb045d082008-03-18 11:24:28 +0200226static const struct clksel_rate div16_dpll_rates[] = {
227 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
228 { .div = 2, .val = 2, .flags = RATE_IN_343X },
229 { .div = 3, .val = 3, .flags = RATE_IN_343X },
230 { .div = 4, .val = 4, .flags = RATE_IN_343X },
231 { .div = 5, .val = 5, .flags = RATE_IN_343X },
232 { .div = 6, .val = 6, .flags = RATE_IN_343X },
233 { .div = 7, .val = 7, .flags = RATE_IN_343X },
234 { .div = 8, .val = 8, .flags = RATE_IN_343X },
235 { .div = 9, .val = 9, .flags = RATE_IN_343X },
236 { .div = 10, .val = 10, .flags = RATE_IN_343X },
237 { .div = 11, .val = 11, .flags = RATE_IN_343X },
238 { .div = 12, .val = 12, .flags = RATE_IN_343X },
239 { .div = 13, .val = 13, .flags = RATE_IN_343X },
240 { .div = 14, .val = 14, .flags = RATE_IN_343X },
241 { .div = 15, .val = 15, .flags = RATE_IN_343X },
242 { .div = 16, .val = 16, .flags = RATE_IN_343X },
243 { .div = 0 }
244};
245
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200246/* DPLL1 */
247/* MPU clock source */
248/* Type: DPLL */
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300249static struct dpll_data dpll1_dd = {
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200250 .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
251 .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK,
252 .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK,
Russell Kingc0bf3132009-02-19 13:29:22 +0000253 .clk_bypass = &dpll1_fck,
254 .clk_ref = &sys_ck,
Paul Walmsley16c90f02009-01-27 19:12:47 -0700255 .freqsel_mask = OMAP3430_MPU_DPLL_FREQSEL_MASK,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200256 .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
257 .enable_mask = OMAP3430_EN_MPU_DPLL_MASK,
Paul Walmsley542313c2008-07-03 12:24:45 +0300258 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200259 .auto_recal_bit = OMAP3430_EN_MPU_DPLL_DRIFTGUARD_SHIFT,
260 .recal_en_bit = OMAP3430_MPU_DPLL_RECAL_EN_SHIFT,
261 .recal_st_bit = OMAP3430_MPU_DPLL_ST_SHIFT,
Paul Walmsley542313c2008-07-03 12:24:45 +0300262 .autoidle_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL),
263 .autoidle_mask = OMAP3430_AUTO_MPU_DPLL_MASK,
264 .idlest_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
Paul Walmsleyc1bd7aa2009-01-28 12:08:17 -0700265 .idlest_mask = OMAP3430_ST_MPU_CLK_MASK,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300266 .max_multiplier = OMAP3_MAX_DPLL_MULT,
Paul Walmsley95f538a2009-01-28 12:08:44 -0700267 .min_divider = 1,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300268 .max_divider = OMAP3_MAX_DPLL_DIV,
269 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200270};
271
272static struct clk dpll1_ck = {
273 .name = "dpll1_ck",
Russell King897dcde2008-11-04 16:35:03 +0000274 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200275 .parent = &sys_ck,
276 .dpll_data = &dpll1_dd,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300277 .round_rate = &omap2_dpll_round_rate,
Paul Walmsley16c90f02009-01-27 19:12:47 -0700278 .set_rate = &omap3_noncore_dpll_set_rate,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700279 .clkdm_name = "dpll1_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200280 .recalc = &omap3_dpll_recalc,
281};
282
283/*
284 * This virtual clock provides the CLKOUTX2 output from the DPLL if the
285 * DPLL isn't bypassed.
286 */
287static struct clk dpll1_x2_ck = {
288 .name = "dpll1_x2_ck",
Russell King57137182008-11-04 16:48:35 +0000289 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200290 .parent = &dpll1_ck,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700291 .clkdm_name = "dpll1_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200292 .recalc = &omap3_clkoutx2_recalc,
293};
294
295/* On DPLL1, unlike other DPLLs, the divider is downstream from CLKOUTX2 */
296static const struct clksel div16_dpll1_x2m2_clksel[] = {
297 { .parent = &dpll1_x2_ck, .rates = div16_dpll_rates },
298 { .parent = NULL }
299};
300
301/*
302 * Does not exist in the TRM - needed to separate the M2 divider from
303 * bypass selection in mpu_ck
304 */
305static struct clk dpll1_x2m2_ck = {
306 .name = "dpll1_x2m2_ck",
Russell King57137182008-11-04 16:48:35 +0000307 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200308 .parent = &dpll1_x2_ck,
309 .init = &omap2_init_clksel_parent,
310 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL),
311 .clksel_mask = OMAP3430_MPU_DPLL_CLKOUT_DIV_MASK,
312 .clksel = div16_dpll1_x2m2_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700313 .clkdm_name = "dpll1_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200314 .recalc = &omap2_clksel_recalc,
315};
316
317/* DPLL2 */
318/* IVA2 clock source */
319/* Type: DPLL */
320
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300321static struct dpll_data dpll2_dd = {
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200322 .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
323 .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK,
324 .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK,
Russell Kingc0bf3132009-02-19 13:29:22 +0000325 .clk_bypass = &dpll2_fck,
326 .clk_ref = &sys_ck,
Paul Walmsley16c90f02009-01-27 19:12:47 -0700327 .freqsel_mask = OMAP3430_IVA2_DPLL_FREQSEL_MASK,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200328 .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
329 .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK,
Paul Walmsley542313c2008-07-03 12:24:45 +0300330 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
331 (1 << DPLL_LOW_POWER_BYPASS),
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200332 .auto_recal_bit = OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT,
333 .recal_en_bit = OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_SHIFT,
334 .recal_st_bit = OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_SHIFT,
Paul Walmsley542313c2008-07-03 12:24:45 +0300335 .autoidle_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL),
336 .autoidle_mask = OMAP3430_AUTO_IVA2_DPLL_MASK,
337 .idlest_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL),
Paul Walmsleyc1bd7aa2009-01-28 12:08:17 -0700338 .idlest_mask = OMAP3430_ST_IVA2_CLK_MASK,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300339 .max_multiplier = OMAP3_MAX_DPLL_MULT,
Paul Walmsley95f538a2009-01-28 12:08:44 -0700340 .min_divider = 1,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300341 .max_divider = OMAP3_MAX_DPLL_DIV,
342 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200343};
344
345static struct clk dpll2_ck = {
346 .name = "dpll2_ck",
Russell King548d8492008-11-04 14:02:46 +0000347 .ops = &clkops_noncore_dpll_ops,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200348 .parent = &sys_ck,
349 .dpll_data = &dpll2_dd,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300350 .round_rate = &omap2_dpll_round_rate,
Paul Walmsley16c90f02009-01-27 19:12:47 -0700351 .set_rate = &omap3_noncore_dpll_set_rate,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700352 .clkdm_name = "dpll2_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200353 .recalc = &omap3_dpll_recalc,
354};
355
356static const struct clksel div16_dpll2_m2x2_clksel[] = {
357 { .parent = &dpll2_ck, .rates = div16_dpll_rates },
358 { .parent = NULL }
359};
360
361/*
362 * The TRM is conflicted on whether IVA2 clock comes from DPLL2 CLKOUT
363 * or CLKOUTX2. CLKOUT seems most plausible.
364 */
365static struct clk dpll2_m2_ck = {
366 .name = "dpll2_m2_ck",
Russell King57137182008-11-04 16:48:35 +0000367 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200368 .parent = &dpll2_ck,
369 .init = &omap2_init_clksel_parent,
370 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD,
371 OMAP3430_CM_CLKSEL2_PLL),
372 .clksel_mask = OMAP3430_IVA2_DPLL_CLKOUT_DIV_MASK,
373 .clksel = div16_dpll2_m2x2_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700374 .clkdm_name = "dpll2_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200375 .recalc = &omap2_clksel_recalc,
376};
377
Paul Walmsley542313c2008-07-03 12:24:45 +0300378/*
379 * DPLL3
380 * Source clock for all interfaces and for some device fclks
381 * REVISIT: Also supports fast relock bypass - not included below
382 */
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300383static struct dpll_data dpll3_dd = {
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200384 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
385 .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK,
386 .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK,
Russell Kingc0bf3132009-02-19 13:29:22 +0000387 .clk_bypass = &sys_ck,
388 .clk_ref = &sys_ck,
Paul Walmsley16c90f02009-01-27 19:12:47 -0700389 .freqsel_mask = OMAP3430_CORE_DPLL_FREQSEL_MASK,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200390 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
391 .enable_mask = OMAP3430_EN_CORE_DPLL_MASK,
392 .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT,
393 .recal_en_bit = OMAP3430_CORE_DPLL_RECAL_EN_SHIFT,
394 .recal_st_bit = OMAP3430_CORE_DPLL_ST_SHIFT,
Paul Walmsley542313c2008-07-03 12:24:45 +0300395 .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
396 .autoidle_mask = OMAP3430_AUTO_CORE_DPLL_MASK,
Paul Walmsleyc1bd7aa2009-01-28 12:08:17 -0700397 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
398 .idlest_mask = OMAP3430_ST_CORE_CLK_MASK,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300399 .max_multiplier = OMAP3_MAX_DPLL_MULT,
Paul Walmsley95f538a2009-01-28 12:08:44 -0700400 .min_divider = 1,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300401 .max_divider = OMAP3_MAX_DPLL_DIV,
402 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200403};
404
405static struct clk dpll3_ck = {
406 .name = "dpll3_ck",
Russell King897dcde2008-11-04 16:35:03 +0000407 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200408 .parent = &sys_ck,
409 .dpll_data = &dpll3_dd,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300410 .round_rate = &omap2_dpll_round_rate,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700411 .clkdm_name = "dpll3_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200412 .recalc = &omap3_dpll_recalc,
413};
414
415/*
416 * This virtual clock provides the CLKOUTX2 output from the DPLL if the
417 * DPLL isn't bypassed
418 */
419static struct clk dpll3_x2_ck = {
420 .name = "dpll3_x2_ck",
Russell King57137182008-11-04 16:48:35 +0000421 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200422 .parent = &dpll3_ck,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700423 .clkdm_name = "dpll3_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200424 .recalc = &omap3_clkoutx2_recalc,
425};
426
Paul Walmsleyb045d082008-03-18 11:24:28 +0200427static const struct clksel_rate div31_dpll3_rates[] = {
428 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
429 { .div = 2, .val = 2, .flags = RATE_IN_343X },
430 { .div = 3, .val = 3, .flags = RATE_IN_3430ES2 },
431 { .div = 4, .val = 4, .flags = RATE_IN_3430ES2 },
432 { .div = 5, .val = 5, .flags = RATE_IN_3430ES2 },
433 { .div = 6, .val = 6, .flags = RATE_IN_3430ES2 },
434 { .div = 7, .val = 7, .flags = RATE_IN_3430ES2 },
435 { .div = 8, .val = 8, .flags = RATE_IN_3430ES2 },
436 { .div = 9, .val = 9, .flags = RATE_IN_3430ES2 },
437 { .div = 10, .val = 10, .flags = RATE_IN_3430ES2 },
438 { .div = 11, .val = 11, .flags = RATE_IN_3430ES2 },
439 { .div = 12, .val = 12, .flags = RATE_IN_3430ES2 },
440 { .div = 13, .val = 13, .flags = RATE_IN_3430ES2 },
441 { .div = 14, .val = 14, .flags = RATE_IN_3430ES2 },
442 { .div = 15, .val = 15, .flags = RATE_IN_3430ES2 },
443 { .div = 16, .val = 16, .flags = RATE_IN_3430ES2 },
444 { .div = 17, .val = 17, .flags = RATE_IN_3430ES2 },
445 { .div = 18, .val = 18, .flags = RATE_IN_3430ES2 },
446 { .div = 19, .val = 19, .flags = RATE_IN_3430ES2 },
447 { .div = 20, .val = 20, .flags = RATE_IN_3430ES2 },
448 { .div = 21, .val = 21, .flags = RATE_IN_3430ES2 },
449 { .div = 22, .val = 22, .flags = RATE_IN_3430ES2 },
450 { .div = 23, .val = 23, .flags = RATE_IN_3430ES2 },
451 { .div = 24, .val = 24, .flags = RATE_IN_3430ES2 },
452 { .div = 25, .val = 25, .flags = RATE_IN_3430ES2 },
453 { .div = 26, .val = 26, .flags = RATE_IN_3430ES2 },
454 { .div = 27, .val = 27, .flags = RATE_IN_3430ES2 },
455 { .div = 28, .val = 28, .flags = RATE_IN_3430ES2 },
456 { .div = 29, .val = 29, .flags = RATE_IN_3430ES2 },
457 { .div = 30, .val = 30, .flags = RATE_IN_3430ES2 },
458 { .div = 31, .val = 31, .flags = RATE_IN_3430ES2 },
459 { .div = 0 },
460};
461
462static const struct clksel div31_dpll3m2_clksel[] = {
463 { .parent = &dpll3_ck, .rates = div31_dpll3_rates },
464 { .parent = NULL }
465};
466
Paul Walmsley0eafd472009-01-28 12:27:42 -0700467/* DPLL3 output M2 - primary control point for CORE speed */
Paul Walmsleyb045d082008-03-18 11:24:28 +0200468static struct clk dpll3_m2_ck = {
469 .name = "dpll3_m2_ck",
Russell King57137182008-11-04 16:48:35 +0000470 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200471 .parent = &dpll3_ck,
472 .init = &omap2_init_clksel_parent,
473 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
474 .clksel_mask = OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK,
475 .clksel = div31_dpll3m2_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700476 .clkdm_name = "dpll3_clkdm",
Paul Walmsley0eafd472009-01-28 12:27:42 -0700477 .round_rate = &omap2_clksel_round_rate,
478 .set_rate = &omap3_core_dpll_m2_set_rate,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200479 .recalc = &omap2_clksel_recalc,
480};
481
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200482static struct clk core_ck = {
483 .name = "core_ck",
Russell King57137182008-11-04 16:48:35 +0000484 .ops = &clkops_null,
Russell Kingc0bf3132009-02-19 13:29:22 +0000485 .parent = &dpll3_m2_ck,
486 .recalc = &followparent_recalc,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200487};
488
489static struct clk dpll3_m2x2_ck = {
490 .name = "dpll3_m2x2_ck",
Russell King57137182008-11-04 16:48:35 +0000491 .ops = &clkops_null,
Russell Kingc0bf3132009-02-19 13:29:22 +0000492 .parent = &dpll3_x2_ck,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700493 .clkdm_name = "dpll3_clkdm",
Russell Kingc0bf3132009-02-19 13:29:22 +0000494 .recalc = &followparent_recalc,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200495};
496
497/* The PWRDN bit is apparently only available on 3430ES2 and above */
498static const struct clksel div16_dpll3_clksel[] = {
499 { .parent = &dpll3_ck, .rates = div16_dpll_rates },
500 { .parent = NULL }
501};
502
503/* This virtual clock is the source for dpll3_m3x2_ck */
504static struct clk dpll3_m3_ck = {
505 .name = "dpll3_m3_ck",
Russell King57137182008-11-04 16:48:35 +0000506 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200507 .parent = &dpll3_ck,
508 .init = &omap2_init_clksel_parent,
509 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
510 .clksel_mask = OMAP3430_DIV_DPLL3_MASK,
511 .clksel = div16_dpll3_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700512 .clkdm_name = "dpll3_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200513 .recalc = &omap2_clksel_recalc,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200514};
515
516/* The PWRDN bit is apparently only available on 3430ES2 and above */
517static struct clk dpll3_m3x2_ck = {
518 .name = "dpll3_m3x2_ck",
Russell Kingb36ee722008-11-04 17:59:52 +0000519 .ops = &clkops_omap2_dflt_wait,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200520 .parent = &dpll3_m3_ck,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200521 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
522 .enable_bit = OMAP3430_PWRDN_EMU_CORE_SHIFT,
Russell King3f0a8202009-01-31 10:05:51 +0000523 .flags = INVERT_ENABLE,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700524 .clkdm_name = "dpll3_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200525 .recalc = &omap3_clkoutx2_recalc,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200526};
527
Paul Walmsleyb045d082008-03-18 11:24:28 +0200528static struct clk emu_core_alwon_ck = {
529 .name = "emu_core_alwon_ck",
Russell King57137182008-11-04 16:48:35 +0000530 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200531 .parent = &dpll3_m3x2_ck,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700532 .clkdm_name = "dpll3_clkdm",
Russell Kingc0bf3132009-02-19 13:29:22 +0000533 .recalc = &followparent_recalc,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200534};
535
536/* DPLL4 */
537/* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */
538/* Type: DPLL */
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300539static struct dpll_data dpll4_dd = {
Paul Walmsleyb045d082008-03-18 11:24:28 +0200540 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
541 .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK,
542 .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK,
Russell Kingc0bf3132009-02-19 13:29:22 +0000543 .clk_bypass = &sys_ck,
544 .clk_ref = &sys_ck,
Paul Walmsley16c90f02009-01-27 19:12:47 -0700545 .freqsel_mask = OMAP3430_PERIPH_DPLL_FREQSEL_MASK,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200546 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
547 .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK,
Paul Walmsley542313c2008-07-03 12:24:45 +0300548 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
Paul Walmsleyb045d082008-03-18 11:24:28 +0200549 .auto_recal_bit = OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT,
550 .recal_en_bit = OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT,
551 .recal_st_bit = OMAP3430_PERIPH_DPLL_ST_SHIFT,
Paul Walmsley542313c2008-07-03 12:24:45 +0300552 .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
553 .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
554 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
Paul Walmsleyc1bd7aa2009-01-28 12:08:17 -0700555 .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300556 .max_multiplier = OMAP3_MAX_DPLL_MULT,
Paul Walmsley95f538a2009-01-28 12:08:44 -0700557 .min_divider = 1,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300558 .max_divider = OMAP3_MAX_DPLL_DIV,
559 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
Paul Walmsleyb045d082008-03-18 11:24:28 +0200560};
561
562static struct clk dpll4_ck = {
563 .name = "dpll4_ck",
Russell King548d8492008-11-04 14:02:46 +0000564 .ops = &clkops_noncore_dpll_ops,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200565 .parent = &sys_ck,
566 .dpll_data = &dpll4_dd,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300567 .round_rate = &omap2_dpll_round_rate,
Paul Walmsley16c90f02009-01-27 19:12:47 -0700568 .set_rate = &omap3_dpll4_set_rate,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700569 .clkdm_name = "dpll4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +0200570 .recalc = &omap3_dpll_recalc,
571};
572
573/*
574 * This virtual clock provides the CLKOUTX2 output from the DPLL if the
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200575 * DPLL isn't bypassed --
576 * XXX does this serve any downstream clocks?
Paul Walmsleyb045d082008-03-18 11:24:28 +0200577 */
578static struct clk dpll4_x2_ck = {
579 .name = "dpll4_x2_ck",
Russell King57137182008-11-04 16:48:35 +0000580 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200581 .parent = &dpll4_ck,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700582 .clkdm_name = "dpll4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +0200583 .recalc = &omap3_clkoutx2_recalc,
584};
585
586static const struct clksel div16_dpll4_clksel[] = {
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200587 { .parent = &dpll4_ck, .rates = div16_dpll_rates },
Paul Walmsleyb045d082008-03-18 11:24:28 +0200588 { .parent = NULL }
589};
590
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200591/* This virtual clock is the source for dpll4_m2x2_ck */
592static struct clk dpll4_m2_ck = {
593 .name = "dpll4_m2_ck",
Russell King57137182008-11-04 16:48:35 +0000594 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200595 .parent = &dpll4_ck,
596 .init = &omap2_init_clksel_parent,
597 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3),
598 .clksel_mask = OMAP3430_DIV_96M_MASK,
599 .clksel = div16_dpll4_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700600 .clkdm_name = "dpll4_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200601 .recalc = &omap2_clksel_recalc,
602};
603
Paul Walmsleyb045d082008-03-18 11:24:28 +0200604/* The PWRDN bit is apparently only available on 3430ES2 and above */
605static struct clk dpll4_m2x2_ck = {
606 .name = "dpll4_m2x2_ck",
Russell Kingb36ee722008-11-04 17:59:52 +0000607 .ops = &clkops_omap2_dflt_wait,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200608 .parent = &dpll4_m2_ck,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200609 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
610 .enable_bit = OMAP3430_PWRDN_96M_SHIFT,
Russell King3f0a8202009-01-31 10:05:51 +0000611 .flags = INVERT_ENABLE,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700612 .clkdm_name = "dpll4_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200613 .recalc = &omap3_clkoutx2_recalc,
614};
615
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700616/*
617 * DPLL4 generates DPLL4_M2X2_CLK which is then routed into the PRM as
618 * PRM_96M_ALWON_(F)CLK. Two clocks then emerge from the PRM:
619 * 96M_ALWON_FCLK (called "omap_96m_alwon_fck" below) and
620 * CM_96K_(F)CLK.
621 */
Paul Walmsleyb045d082008-03-18 11:24:28 +0200622static struct clk omap_96m_alwon_fck = {
623 .name = "omap_96m_alwon_fck",
Russell King57137182008-11-04 16:48:35 +0000624 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200625 .parent = &dpll4_m2x2_ck,
Russell Kingc0bf3132009-02-19 13:29:22 +0000626 .recalc = &followparent_recalc,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200627};
628
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700629static struct clk cm_96m_fck = {
630 .name = "cm_96m_fck",
Russell King57137182008-11-04 16:48:35 +0000631 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200632 .parent = &omap_96m_alwon_fck,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200633 .recalc = &followparent_recalc,
634};
635
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700636static const struct clksel_rate omap_96m_dpll_rates[] = {
637 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
638 { .div = 0 }
639};
640
641static const struct clksel_rate omap_96m_sys_rates[] = {
642 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
643 { .div = 0 }
644};
645
646static const struct clksel omap_96m_fck_clksel[] = {
647 { .parent = &cm_96m_fck, .rates = omap_96m_dpll_rates },
648 { .parent = &sys_ck, .rates = omap_96m_sys_rates },
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200649 { .parent = NULL }
650};
651
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700652static struct clk omap_96m_fck = {
653 .name = "omap_96m_fck",
Russell King57137182008-11-04 16:48:35 +0000654 .ops = &clkops_null,
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700655 .parent = &sys_ck,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200656 .init = &omap2_init_clksel_parent,
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700657 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
658 .clksel_mask = OMAP3430_SOURCE_96M_MASK,
659 .clksel = omap_96m_fck_clksel,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200660 .recalc = &omap2_clksel_recalc,
661};
662
663/* This virtual clock is the source for dpll4_m3x2_ck */
664static struct clk dpll4_m3_ck = {
665 .name = "dpll4_m3_ck",
Russell King57137182008-11-04 16:48:35 +0000666 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200667 .parent = &dpll4_ck,
668 .init = &omap2_init_clksel_parent,
669 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
670 .clksel_mask = OMAP3430_CLKSEL_TV_MASK,
671 .clksel = div16_dpll4_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700672 .clkdm_name = "dpll4_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200673 .recalc = &omap2_clksel_recalc,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200674};
675
676/* The PWRDN bit is apparently only available on 3430ES2 and above */
677static struct clk dpll4_m3x2_ck = {
678 .name = "dpll4_m3x2_ck",
Russell Kingb36ee722008-11-04 17:59:52 +0000679 .ops = &clkops_omap2_dflt_wait,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200680 .parent = &dpll4_m3_ck,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200681 .init = &omap2_init_clksel_parent,
682 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
683 .enable_bit = OMAP3430_PWRDN_TV_SHIFT,
Russell King3f0a8202009-01-31 10:05:51 +0000684 .flags = INVERT_ENABLE,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700685 .clkdm_name = "dpll4_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200686 .recalc = &omap3_clkoutx2_recalc,
687};
688
Paul Walmsleyb045d082008-03-18 11:24:28 +0200689static const struct clksel_rate omap_54m_d4m3x2_rates[] = {
690 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
691 { .div = 0 }
692};
693
694static const struct clksel_rate omap_54m_alt_rates[] = {
695 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
696 { .div = 0 }
697};
698
699static const struct clksel omap_54m_clksel[] = {
Russell Kingc0bf3132009-02-19 13:29:22 +0000700 { .parent = &dpll4_m3x2_ck, .rates = omap_54m_d4m3x2_rates },
Paul Walmsleyb045d082008-03-18 11:24:28 +0200701 { .parent = &sys_altclk, .rates = omap_54m_alt_rates },
702 { .parent = NULL }
703};
704
705static struct clk omap_54m_fck = {
706 .name = "omap_54m_fck",
Russell King57137182008-11-04 16:48:35 +0000707 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200708 .init = &omap2_init_clksel_parent,
709 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700710 .clksel_mask = OMAP3430_SOURCE_54M_MASK,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200711 .clksel = omap_54m_clksel,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200712 .recalc = &omap2_clksel_recalc,
713};
714
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700715static const struct clksel_rate omap_48m_cm96m_rates[] = {
Paul Walmsleyb045d082008-03-18 11:24:28 +0200716 { .div = 2, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
717 { .div = 0 }
718};
719
720static const struct clksel_rate omap_48m_alt_rates[] = {
721 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
722 { .div = 0 }
723};
724
725static const struct clksel omap_48m_clksel[] = {
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700726 { .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates },
Paul Walmsleyb045d082008-03-18 11:24:28 +0200727 { .parent = &sys_altclk, .rates = omap_48m_alt_rates },
728 { .parent = NULL }
729};
730
731static struct clk omap_48m_fck = {
732 .name = "omap_48m_fck",
Russell King57137182008-11-04 16:48:35 +0000733 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200734 .init = &omap2_init_clksel_parent,
735 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700736 .clksel_mask = OMAP3430_SOURCE_48M_MASK,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200737 .clksel = omap_48m_clksel,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200738 .recalc = &omap2_clksel_recalc,
739};
740
741static struct clk omap_12m_fck = {
742 .name = "omap_12m_fck",
Russell King57137182008-11-04 16:48:35 +0000743 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200744 .parent = &omap_48m_fck,
745 .fixed_div = 4,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200746 .recalc = &omap2_fixed_divisor_recalc,
747};
748
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200749/* This virstual clock is the source for dpll4_m4x2_ck */
750static struct clk dpll4_m4_ck = {
751 .name = "dpll4_m4_ck",
Russell King57137182008-11-04 16:48:35 +0000752 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200753 .parent = &dpll4_ck,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200754 .init = &omap2_init_clksel_parent,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200755 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
756 .clksel_mask = OMAP3430_CLKSEL_DSS1_MASK,
757 .clksel = div16_dpll4_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700758 .clkdm_name = "dpll4_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200759 .recalc = &omap2_clksel_recalc,
Paul Walmsleyae8578c2009-01-27 19:13:12 -0700760 .set_rate = &omap2_clksel_set_rate,
761 .round_rate = &omap2_clksel_round_rate,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200762};
763
764/* The PWRDN bit is apparently only available on 3430ES2 and above */
765static struct clk dpll4_m4x2_ck = {
766 .name = "dpll4_m4x2_ck",
Russell Kingb36ee722008-11-04 17:59:52 +0000767 .ops = &clkops_omap2_dflt_wait,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200768 .parent = &dpll4_m4_ck,
769 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
770 .enable_bit = OMAP3430_PWRDN_CAM_SHIFT,
Russell King3f0a8202009-01-31 10:05:51 +0000771 .flags = INVERT_ENABLE,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700772 .clkdm_name = "dpll4_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200773 .recalc = &omap3_clkoutx2_recalc,
774};
775
776/* This virtual clock is the source for dpll4_m5x2_ck */
777static struct clk dpll4_m5_ck = {
778 .name = "dpll4_m5_ck",
Russell King57137182008-11-04 16:48:35 +0000779 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200780 .parent = &dpll4_ck,
781 .init = &omap2_init_clksel_parent,
782 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL),
783 .clksel_mask = OMAP3430_CLKSEL_CAM_MASK,
784 .clksel = div16_dpll4_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700785 .clkdm_name = "dpll4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +0200786 .recalc = &omap2_clksel_recalc,
787};
788
789/* The PWRDN bit is apparently only available on 3430ES2 and above */
790static struct clk dpll4_m5x2_ck = {
791 .name = "dpll4_m5x2_ck",
Russell Kingb36ee722008-11-04 17:59:52 +0000792 .ops = &clkops_omap2_dflt_wait,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200793 .parent = &dpll4_m5_ck,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200794 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
795 .enable_bit = OMAP3430_PWRDN_CAM_SHIFT,
Russell King3f0a8202009-01-31 10:05:51 +0000796 .flags = INVERT_ENABLE,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700797 .clkdm_name = "dpll4_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200798 .recalc = &omap3_clkoutx2_recalc,
799};
800
801/* This virtual clock is the source for dpll4_m6x2_ck */
802static struct clk dpll4_m6_ck = {
803 .name = "dpll4_m6_ck",
Russell King57137182008-11-04 16:48:35 +0000804 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200805 .parent = &dpll4_ck,
806 .init = &omap2_init_clksel_parent,
807 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
808 .clksel_mask = OMAP3430_DIV_DPLL4_MASK,
809 .clksel = div16_dpll4_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700810 .clkdm_name = "dpll4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +0200811 .recalc = &omap2_clksel_recalc,
812};
813
814/* The PWRDN bit is apparently only available on 3430ES2 and above */
815static struct clk dpll4_m6x2_ck = {
816 .name = "dpll4_m6x2_ck",
Russell Kingb36ee722008-11-04 17:59:52 +0000817 .ops = &clkops_omap2_dflt_wait,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200818 .parent = &dpll4_m6_ck,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200819 .init = &omap2_init_clksel_parent,
820 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
821 .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
Russell King3f0a8202009-01-31 10:05:51 +0000822 .flags = INVERT_ENABLE,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700823 .clkdm_name = "dpll4_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200824 .recalc = &omap3_clkoutx2_recalc,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200825};
826
827static struct clk emu_per_alwon_ck = {
828 .name = "emu_per_alwon_ck",
Russell King57137182008-11-04 16:48:35 +0000829 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200830 .parent = &dpll4_m6x2_ck,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700831 .clkdm_name = "dpll4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +0200832 .recalc = &followparent_recalc,
833};
834
835/* DPLL5 */
836/* Supplies 120MHz clock, USIM source clock */
837/* Type: DPLL */
838/* 3430ES2 only */
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300839static struct dpll_data dpll5_dd = {
Paul Walmsleyb045d082008-03-18 11:24:28 +0200840 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4),
841 .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK,
842 .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK,
Russell Kingc0bf3132009-02-19 13:29:22 +0000843 .clk_bypass = &sys_ck,
844 .clk_ref = &sys_ck,
Paul Walmsley16c90f02009-01-27 19:12:47 -0700845 .freqsel_mask = OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200846 .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
847 .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
Paul Walmsley542313c2008-07-03 12:24:45 +0300848 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
Paul Walmsleyb045d082008-03-18 11:24:28 +0200849 .auto_recal_bit = OMAP3430ES2_EN_PERIPH2_DPLL_DRIFTGUARD_SHIFT,
850 .recal_en_bit = OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT,
851 .recal_st_bit = OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT,
Paul Walmsley542313c2008-07-03 12:24:45 +0300852 .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL),
853 .autoidle_mask = OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK,
854 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
Paul Walmsleyc1bd7aa2009-01-28 12:08:17 -0700855 .idlest_mask = OMAP3430ES2_ST_PERIPH2_CLK_MASK,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300856 .max_multiplier = OMAP3_MAX_DPLL_MULT,
Paul Walmsley95f538a2009-01-28 12:08:44 -0700857 .min_divider = 1,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300858 .max_divider = OMAP3_MAX_DPLL_DIV,
859 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
Paul Walmsleyb045d082008-03-18 11:24:28 +0200860};
861
862static struct clk dpll5_ck = {
863 .name = "dpll5_ck",
Russell King548d8492008-11-04 14:02:46 +0000864 .ops = &clkops_noncore_dpll_ops,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200865 .parent = &sys_ck,
866 .dpll_data = &dpll5_dd,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300867 .round_rate = &omap2_dpll_round_rate,
Paul Walmsley16c90f02009-01-27 19:12:47 -0700868 .set_rate = &omap3_noncore_dpll_set_rate,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700869 .clkdm_name = "dpll5_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +0200870 .recalc = &omap3_dpll_recalc,
871};
872
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200873static const struct clksel div16_dpll5_clksel[] = {
Paul Walmsleyb045d082008-03-18 11:24:28 +0200874 { .parent = &dpll5_ck, .rates = div16_dpll_rates },
875 { .parent = NULL }
876};
877
878static struct clk dpll5_m2_ck = {
879 .name = "dpll5_m2_ck",
Russell King57137182008-11-04 16:48:35 +0000880 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200881 .parent = &dpll5_ck,
882 .init = &omap2_init_clksel_parent,
883 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5),
884 .clksel_mask = OMAP3430ES2_DIV_120M_MASK,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200885 .clksel = div16_dpll5_clksel,
Paul Walmsley46e0ccf2009-01-27 19:44:18 -0700886 .clkdm_name = "dpll5_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +0200887 .recalc = &omap2_clksel_recalc,
888};
889
Paul Walmsleyb045d082008-03-18 11:24:28 +0200890/* CM EXTERNAL CLOCK OUTPUTS */
891
892static const struct clksel_rate clkout2_src_core_rates[] = {
893 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
894 { .div = 0 }
895};
896
897static const struct clksel_rate clkout2_src_sys_rates[] = {
898 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
899 { .div = 0 }
900};
901
902static const struct clksel_rate clkout2_src_96m_rates[] = {
903 { .div = 1, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
904 { .div = 0 }
905};
906
907static const struct clksel_rate clkout2_src_54m_rates[] = {
908 { .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
909 { .div = 0 }
910};
911
912static const struct clksel clkout2_src_clksel[] = {
Paul Walmsley9cfd9852009-01-27 19:13:02 -0700913 { .parent = &core_ck, .rates = clkout2_src_core_rates },
914 { .parent = &sys_ck, .rates = clkout2_src_sys_rates },
915 { .parent = &cm_96m_fck, .rates = clkout2_src_96m_rates },
916 { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates },
Paul Walmsleyb045d082008-03-18 11:24:28 +0200917 { .parent = NULL }
918};
919
920static struct clk clkout2_src_ck = {
921 .name = "clkout2_src_ck",
Russell Kingc1168dc2008-11-04 21:24:00 +0000922 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200923 .init = &omap2_init_clksel_parent,
924 .enable_reg = OMAP3430_CM_CLKOUT_CTRL,
925 .enable_bit = OMAP3430_CLKOUT2_EN_SHIFT,
926 .clksel_reg = OMAP3430_CM_CLKOUT_CTRL,
927 .clksel_mask = OMAP3430_CLKOUT2SOURCE_MASK,
928 .clksel = clkout2_src_clksel,
Paul Walmsley15b52bc2008-05-07 19:19:07 -0600929 .clkdm_name = "core_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +0200930 .recalc = &omap2_clksel_recalc,
931};
932
933static const struct clksel_rate sys_clkout2_rates[] = {
934 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
935 { .div = 2, .val = 1, .flags = RATE_IN_343X },
936 { .div = 4, .val = 2, .flags = RATE_IN_343X },
937 { .div = 8, .val = 3, .flags = RATE_IN_343X },
938 { .div = 16, .val = 4, .flags = RATE_IN_343X },
939 { .div = 0 },
940};
941
942static const struct clksel sys_clkout2_clksel[] = {
943 { .parent = &clkout2_src_ck, .rates = sys_clkout2_rates },
944 { .parent = NULL },
945};
946
947static struct clk sys_clkout2 = {
948 .name = "sys_clkout2",
Russell King57137182008-11-04 16:48:35 +0000949 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200950 .init = &omap2_init_clksel_parent,
951 .clksel_reg = OMAP3430_CM_CLKOUT_CTRL,
952 .clksel_mask = OMAP3430_CLKOUT2_DIV_MASK,
953 .clksel = sys_clkout2_clksel,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200954 .recalc = &omap2_clksel_recalc,
955};
956
957/* CM OUTPUT CLOCKS */
958
959static struct clk corex2_fck = {
960 .name = "corex2_fck",
Russell King57137182008-11-04 16:48:35 +0000961 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200962 .parent = &dpll3_m2x2_ck,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200963 .recalc = &followparent_recalc,
964};
965
966/* DPLL power domain clock controls */
967
Paul Walmsleyb8168d12009-01-28 12:08:14 -0700968static const struct clksel_rate div4_rates[] = {
969 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
970 { .div = 2, .val = 2, .flags = RATE_IN_343X },
971 { .div = 4, .val = 4, .flags = RATE_IN_343X },
972 { .div = 0 }
973};
974
975static const struct clksel div4_core_clksel[] = {
976 { .parent = &core_ck, .rates = div4_rates },
Paul Walmsleyb045d082008-03-18 11:24:28 +0200977 { .parent = NULL }
978};
979
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200980/*
981 * REVISIT: Are these in DPLL power domain or CM power domain? docs
982 * may be inconsistent here?
983 */
Paul Walmsleyb045d082008-03-18 11:24:28 +0200984static struct clk dpll1_fck = {
985 .name = "dpll1_fck",
Russell King57137182008-11-04 16:48:35 +0000986 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200987 .parent = &core_ck,
988 .init = &omap2_init_clksel_parent,
989 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
990 .clksel_mask = OMAP3430_MPU_CLK_SRC_MASK,
Paul Walmsleyb8168d12009-01-28 12:08:14 -0700991 .clksel = div4_core_clksel,
Paul Walmsleyb045d082008-03-18 11:24:28 +0200992 .recalc = &omap2_clksel_recalc,
993};
994
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200995static struct clk mpu_ck = {
996 .name = "mpu_ck",
Russell King57137182008-11-04 16:48:35 +0000997 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +0200998 .parent = &dpll1_x2m2_ck,
Paul Walmsley333943b2008-08-19 11:08:45 +0300999 .clkdm_name = "mpu_clkdm",
Russell Kingc0bf3132009-02-19 13:29:22 +00001000 .recalc = &followparent_recalc,
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001001};
1002
1003/* arm_fck is divided by two when DPLL1 locked; otherwise, passthrough mpu_ck */
1004static const struct clksel_rate arm_fck_rates[] = {
1005 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
1006 { .div = 2, .val = 1, .flags = RATE_IN_343X },
1007 { .div = 0 },
1008};
1009
1010static const struct clksel arm_fck_clksel[] = {
1011 { .parent = &mpu_ck, .rates = arm_fck_rates },
1012 { .parent = NULL }
1013};
1014
1015static struct clk arm_fck = {
1016 .name = "arm_fck",
Russell King57137182008-11-04 16:48:35 +00001017 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001018 .parent = &mpu_ck,
1019 .init = &omap2_init_clksel_parent,
1020 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
1021 .clksel_mask = OMAP3430_ST_MPU_CLK_MASK,
1022 .clksel = arm_fck_clksel,
Paul Walmsley19f4d3a2009-09-03 20:14:00 +03001023 .clkdm_name = "mpu_clkdm",
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001024 .recalc = &omap2_clksel_recalc,
1025};
1026
Paul Walmsley333943b2008-08-19 11:08:45 +03001027/* XXX What about neon_clkdm ? */
1028
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001029/*
1030 * REVISIT: This clock is never specifically defined in the 3430 TRM,
1031 * although it is referenced - so this is a guess
1032 */
1033static struct clk emu_mpu_alwon_ck = {
1034 .name = "emu_mpu_alwon_ck",
Russell King57137182008-11-04 16:48:35 +00001035 .ops = &clkops_null,
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001036 .parent = &mpu_ck,
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001037 .recalc = &followparent_recalc,
1038};
1039
Paul Walmsleyb045d082008-03-18 11:24:28 +02001040static struct clk dpll2_fck = {
1041 .name = "dpll2_fck",
Russell King57137182008-11-04 16:48:35 +00001042 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001043 .parent = &core_ck,
1044 .init = &omap2_init_clksel_parent,
1045 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
1046 .clksel_mask = OMAP3430_IVA2_CLK_SRC_MASK,
Paul Walmsleyb8168d12009-01-28 12:08:14 -07001047 .clksel = div4_core_clksel,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001048 .recalc = &omap2_clksel_recalc,
1049};
1050
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001051static struct clk iva2_ck = {
1052 .name = "iva2_ck",
Russell Kingb36ee722008-11-04 17:59:52 +00001053 .ops = &clkops_omap2_dflt_wait,
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001054 .parent = &dpll2_m2_ck,
1055 .init = &omap2_init_clksel_parent,
Hiroshi DOYU31c203d2008-04-01 10:11:22 +03001056 .enable_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN),
1057 .enable_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001058 .clkdm_name = "iva2_clkdm",
Russell Kingc0bf3132009-02-19 13:29:22 +00001059 .recalc = &followparent_recalc,
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001060};
1061
Paul Walmsleyb045d082008-03-18 11:24:28 +02001062/* Common interface clocks */
1063
Paul Walmsleyb8168d12009-01-28 12:08:14 -07001064static const struct clksel div2_core_clksel[] = {
1065 { .parent = &core_ck, .rates = div2_rates },
1066 { .parent = NULL }
1067};
1068
Paul Walmsleyb045d082008-03-18 11:24:28 +02001069static struct clk l3_ick = {
1070 .name = "l3_ick",
Russell King57137182008-11-04 16:48:35 +00001071 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001072 .parent = &core_ck,
1073 .init = &omap2_init_clksel_parent,
1074 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1075 .clksel_mask = OMAP3430_CLKSEL_L3_MASK,
1076 .clksel = div2_core_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03001077 .clkdm_name = "core_l3_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001078 .recalc = &omap2_clksel_recalc,
1079};
1080
1081static const struct clksel div2_l3_clksel[] = {
1082 { .parent = &l3_ick, .rates = div2_rates },
1083 { .parent = NULL }
1084};
1085
1086static struct clk l4_ick = {
1087 .name = "l4_ick",
Russell King57137182008-11-04 16:48:35 +00001088 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001089 .parent = &l3_ick,
1090 .init = &omap2_init_clksel_parent,
1091 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1092 .clksel_mask = OMAP3430_CLKSEL_L4_MASK,
1093 .clksel = div2_l3_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03001094 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001095 .recalc = &omap2_clksel_recalc,
1096
1097};
1098
1099static const struct clksel div2_l4_clksel[] = {
1100 { .parent = &l4_ick, .rates = div2_rates },
1101 { .parent = NULL }
1102};
1103
1104static struct clk rm_ick = {
1105 .name = "rm_ick",
Russell King57137182008-11-04 16:48:35 +00001106 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001107 .parent = &l4_ick,
1108 .init = &omap2_init_clksel_parent,
1109 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
1110 .clksel_mask = OMAP3430_CLKSEL_RM_MASK,
1111 .clksel = div2_l4_clksel,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001112 .recalc = &omap2_clksel_recalc,
1113};
1114
1115/* GFX power domain */
1116
Roman Tereshonkov3760d312008-03-13 21:35:09 +02001117/* GFX clocks are in 3430ES1 only. 3430ES2 and later uses the SGX instead */
Paul Walmsleyb045d082008-03-18 11:24:28 +02001118
1119static const struct clksel gfx_l3_clksel[] = {
1120 { .parent = &l3_ick, .rates = gfx_l3_rates },
1121 { .parent = NULL }
1122};
1123
Högander Jouni59559022008-08-19 11:08:45 +03001124/* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */
1125static struct clk gfx_l3_ck = {
1126 .name = "gfx_l3_ck",
Russell Kingb36ee722008-11-04 17:59:52 +00001127 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001128 .parent = &l3_ick,
1129 .init = &omap2_init_clksel_parent,
1130 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
1131 .enable_bit = OMAP_EN_GFX_SHIFT,
Högander Jouni59559022008-08-19 11:08:45 +03001132 .recalc = &followparent_recalc,
1133};
1134
1135static struct clk gfx_l3_fck = {
1136 .name = "gfx_l3_fck",
Russell King57137182008-11-04 16:48:35 +00001137 .ops = &clkops_null,
Högander Jouni59559022008-08-19 11:08:45 +03001138 .parent = &gfx_l3_ck,
1139 .init = &omap2_init_clksel_parent,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001140 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
1141 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
1142 .clksel = gfx_l3_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03001143 .clkdm_name = "gfx_3430es1_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001144 .recalc = &omap2_clksel_recalc,
1145};
1146
1147static struct clk gfx_l3_ick = {
1148 .name = "gfx_l3_ick",
Russell King57137182008-11-04 16:48:35 +00001149 .ops = &clkops_null,
Högander Jouni59559022008-08-19 11:08:45 +03001150 .parent = &gfx_l3_ck,
Paul Walmsley333943b2008-08-19 11:08:45 +03001151 .clkdm_name = "gfx_3430es1_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001152 .recalc = &followparent_recalc,
1153};
1154
1155static struct clk gfx_cg1_ck = {
1156 .name = "gfx_cg1_ck",
Russell Kingb36ee722008-11-04 17:59:52 +00001157 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001158 .parent = &gfx_l3_fck, /* REVISIT: correct? */
1159 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
1160 .enable_bit = OMAP3430ES1_EN_2D_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001161 .clkdm_name = "gfx_3430es1_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001162 .recalc = &followparent_recalc,
1163};
1164
1165static struct clk gfx_cg2_ck = {
1166 .name = "gfx_cg2_ck",
Russell Kingb36ee722008-11-04 17:59:52 +00001167 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001168 .parent = &gfx_l3_fck, /* REVISIT: correct? */
1169 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
1170 .enable_bit = OMAP3430ES1_EN_3D_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001171 .clkdm_name = "gfx_3430es1_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001172 .recalc = &followparent_recalc,
1173};
1174
1175/* SGX power domain - 3430ES2 only */
1176
1177static const struct clksel_rate sgx_core_rates[] = {
1178 { .div = 3, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
1179 { .div = 4, .val = 1, .flags = RATE_IN_343X },
1180 { .div = 6, .val = 2, .flags = RATE_IN_343X },
1181 { .div = 0 },
1182};
1183
1184static const struct clksel_rate sgx_96m_rates[] = {
1185 { .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
1186 { .div = 0 },
1187};
1188
1189static const struct clksel sgx_clksel[] = {
1190 { .parent = &core_ck, .rates = sgx_core_rates },
1191 { .parent = &cm_96m_fck, .rates = sgx_96m_rates },
1192 { .parent = NULL },
1193};
1194
1195static struct clk sgx_fck = {
1196 .name = "sgx_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001197 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001198 .init = &omap2_init_clksel_parent,
1199 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN),
Daniel Stone712d7c82009-01-27 19:13:05 -07001200 .enable_bit = OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001201 .clksel_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL),
1202 .clksel_mask = OMAP3430ES2_CLKSEL_SGX_MASK,
1203 .clksel = sgx_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03001204 .clkdm_name = "sgx_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001205 .recalc = &omap2_clksel_recalc,
1206};
1207
1208static struct clk sgx_ick = {
1209 .name = "sgx_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001210 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001211 .parent = &l3_ick,
1212 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_ICLKEN),
Daniel Stone712d7c82009-01-27 19:13:05 -07001213 .enable_bit = OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001214 .clkdm_name = "sgx_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001215 .recalc = &followparent_recalc,
1216};
1217
1218/* CORE power domain */
1219
1220static struct clk d2d_26m_fck = {
1221 .name = "d2d_26m_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001222 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001223 .parent = &sys_ck,
1224 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1225 .enable_bit = OMAP3430ES1_EN_D2D_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001226 .clkdm_name = "d2d_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001227 .recalc = &followparent_recalc,
1228};
1229
Kevin Hilman8111b222009-04-28 15:27:44 -07001230static struct clk modem_fck = {
1231 .name = "modem_fck",
1232 .ops = &clkops_omap2_dflt_wait,
1233 .parent = &sys_ck,
Kevin Hilman8111b222009-04-28 15:27:44 -07001234 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1235 .enable_bit = OMAP3430_EN_MODEM_SHIFT,
1236 .clkdm_name = "d2d_clkdm",
1237 .recalc = &followparent_recalc,
1238};
1239
1240static struct clk sad2d_ick = {
1241 .name = "sad2d_ick",
1242 .ops = &clkops_omap2_dflt_wait,
1243 .parent = &l3_ick,
1244 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1245 .enable_bit = OMAP3430_EN_SAD2D_SHIFT,
1246 .clkdm_name = "d2d_clkdm",
1247 .recalc = &followparent_recalc,
1248};
1249
1250static struct clk mad2d_ick = {
1251 .name = "mad2d_ick",
1252 .ops = &clkops_omap2_dflt_wait,
1253 .parent = &l3_ick,
1254 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1255 .enable_bit = OMAP3430_EN_MAD2D_SHIFT,
1256 .clkdm_name = "d2d_clkdm",
1257 .recalc = &followparent_recalc,
1258};
1259
Paul Walmsleyb045d082008-03-18 11:24:28 +02001260static const struct clksel omap343x_gpt_clksel[] = {
1261 { .parent = &omap_32k_fck, .rates = gpt_32k_rates },
1262 { .parent = &sys_ck, .rates = gpt_sys_rates },
1263 { .parent = NULL}
1264};
1265
1266static struct clk gpt10_fck = {
1267 .name = "gpt10_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001268 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001269 .parent = &sys_ck,
1270 .init = &omap2_init_clksel_parent,
1271 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1272 .enable_bit = OMAP3430_EN_GPT10_SHIFT,
1273 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1274 .clksel_mask = OMAP3430_CLKSEL_GPT10_MASK,
1275 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03001276 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001277 .recalc = &omap2_clksel_recalc,
1278};
1279
1280static struct clk gpt11_fck = {
1281 .name = "gpt11_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001282 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001283 .parent = &sys_ck,
1284 .init = &omap2_init_clksel_parent,
1285 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1286 .enable_bit = OMAP3430_EN_GPT11_SHIFT,
1287 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1288 .clksel_mask = OMAP3430_CLKSEL_GPT11_MASK,
1289 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03001290 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001291 .recalc = &omap2_clksel_recalc,
1292};
1293
1294static struct clk cpefuse_fck = {
1295 .name = "cpefuse_fck",
Russell Kingc1168dc2008-11-04 21:24:00 +00001296 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001297 .parent = &sys_ck,
1298 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
1299 .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001300 .recalc = &followparent_recalc,
1301};
1302
1303static struct clk ts_fck = {
1304 .name = "ts_fck",
Russell Kingc1168dc2008-11-04 21:24:00 +00001305 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001306 .parent = &omap_32k_fck,
1307 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
1308 .enable_bit = OMAP3430ES2_EN_TS_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001309 .recalc = &followparent_recalc,
1310};
1311
1312static struct clk usbtll_fck = {
1313 .name = "usbtll_fck",
Russell Kingc1168dc2008-11-04 21:24:00 +00001314 .ops = &clkops_omap2_dflt,
Russell Kingc0bf3132009-02-19 13:29:22 +00001315 .parent = &dpll5_m2_ck,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001316 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
1317 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001318 .recalc = &followparent_recalc,
1319};
1320
1321/* CORE 96M FCLK-derived clocks */
1322
1323static struct clk core_96m_fck = {
1324 .name = "core_96m_fck",
Russell King57137182008-11-04 16:48:35 +00001325 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001326 .parent = &omap_96m_fck,
Paul Walmsley333943b2008-08-19 11:08:45 +03001327 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001328 .recalc = &followparent_recalc,
1329};
1330
1331static struct clk mmchs3_fck = {
1332 .name = "mmchs_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001333 .ops = &clkops_omap2_dflt_wait,
Tony Lindgrend8874662008-12-10 17:37:16 -08001334 .id = 2,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001335 .parent = &core_96m_fck,
1336 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1337 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001338 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001339 .recalc = &followparent_recalc,
1340};
1341
1342static struct clk mmchs2_fck = {
1343 .name = "mmchs_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001344 .ops = &clkops_omap2_dflt_wait,
Tony Lindgrend8874662008-12-10 17:37:16 -08001345 .id = 1,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001346 .parent = &core_96m_fck,
1347 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1348 .enable_bit = OMAP3430_EN_MMC2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001349 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001350 .recalc = &followparent_recalc,
1351};
1352
1353static struct clk mspro_fck = {
1354 .name = "mspro_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001355 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001356 .parent = &core_96m_fck,
1357 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1358 .enable_bit = OMAP3430_EN_MSPRO_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001359 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001360 .recalc = &followparent_recalc,
1361};
1362
1363static struct clk mmchs1_fck = {
1364 .name = "mmchs_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001365 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001366 .parent = &core_96m_fck,
1367 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1368 .enable_bit = OMAP3430_EN_MMC1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001369 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001370 .recalc = &followparent_recalc,
1371};
1372
1373static struct clk i2c3_fck = {
1374 .name = "i2c_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001375 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001376 .id = 3,
1377 .parent = &core_96m_fck,
1378 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1379 .enable_bit = OMAP3430_EN_I2C3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001380 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001381 .recalc = &followparent_recalc,
1382};
1383
1384static struct clk i2c2_fck = {
1385 .name = "i2c_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001386 .ops = &clkops_omap2_dflt_wait,
Paul Walmsley333943b2008-08-19 11:08:45 +03001387 .id = 2,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001388 .parent = &core_96m_fck,
1389 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1390 .enable_bit = OMAP3430_EN_I2C2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001391 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001392 .recalc = &followparent_recalc,
1393};
1394
1395static struct clk i2c1_fck = {
1396 .name = "i2c_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001397 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001398 .id = 1,
1399 .parent = &core_96m_fck,
1400 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1401 .enable_bit = OMAP3430_EN_I2C1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001402 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001403 .recalc = &followparent_recalc,
1404};
1405
1406/*
1407 * MCBSP 1 & 5 get their 96MHz clock from core_96m_fck;
1408 * MCBSP 2, 3, 4 get their 96MHz clock from per_96m_fck.
1409 */
1410static const struct clksel_rate common_mcbsp_96m_rates[] = {
1411 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
1412 { .div = 0 }
1413};
1414
1415static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
1416 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
1417 { .div = 0 }
1418};
1419
1420static const struct clksel mcbsp_15_clksel[] = {
1421 { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
1422 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
1423 { .parent = NULL }
1424};
1425
1426static struct clk mcbsp5_fck = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03001427 .name = "mcbsp_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001428 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03001429 .id = 5,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001430 .init = &omap2_init_clksel_parent,
1431 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1432 .enable_bit = OMAP3430_EN_MCBSP5_SHIFT,
1433 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
1434 .clksel_mask = OMAP2_MCBSP5_CLKS_MASK,
1435 .clksel = mcbsp_15_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03001436 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001437 .recalc = &omap2_clksel_recalc,
1438};
1439
1440static struct clk mcbsp1_fck = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03001441 .name = "mcbsp_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001442 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03001443 .id = 1,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001444 .init = &omap2_init_clksel_parent,
1445 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1446 .enable_bit = OMAP3430_EN_MCBSP1_SHIFT,
1447 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1448 .clksel_mask = OMAP2_MCBSP1_CLKS_MASK,
1449 .clksel = mcbsp_15_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03001450 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001451 .recalc = &omap2_clksel_recalc,
1452};
1453
1454/* CORE_48M_FCK-derived clocks */
1455
1456static struct clk core_48m_fck = {
1457 .name = "core_48m_fck",
Russell King57137182008-11-04 16:48:35 +00001458 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001459 .parent = &omap_48m_fck,
Paul Walmsley333943b2008-08-19 11:08:45 +03001460 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001461 .recalc = &followparent_recalc,
1462};
1463
1464static struct clk mcspi4_fck = {
1465 .name = "mcspi_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001466 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001467 .id = 4,
1468 .parent = &core_48m_fck,
1469 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1470 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001471 .recalc = &followparent_recalc,
1472};
1473
1474static struct clk mcspi3_fck = {
1475 .name = "mcspi_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001476 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001477 .id = 3,
1478 .parent = &core_48m_fck,
1479 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1480 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001481 .recalc = &followparent_recalc,
1482};
1483
1484static struct clk mcspi2_fck = {
1485 .name = "mcspi_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001486 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001487 .id = 2,
1488 .parent = &core_48m_fck,
1489 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1490 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001491 .recalc = &followparent_recalc,
1492};
1493
1494static struct clk mcspi1_fck = {
1495 .name = "mcspi_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001496 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001497 .id = 1,
1498 .parent = &core_48m_fck,
1499 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1500 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001501 .recalc = &followparent_recalc,
1502};
1503
1504static struct clk uart2_fck = {
1505 .name = "uart2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001506 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001507 .parent = &core_48m_fck,
1508 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1509 .enable_bit = OMAP3430_EN_UART2_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001510 .recalc = &followparent_recalc,
1511};
1512
1513static struct clk uart1_fck = {
1514 .name = "uart1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001515 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001516 .parent = &core_48m_fck,
1517 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1518 .enable_bit = OMAP3430_EN_UART1_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001519 .recalc = &followparent_recalc,
1520};
1521
1522static struct clk fshostusb_fck = {
1523 .name = "fshostusb_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001524 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001525 .parent = &core_48m_fck,
1526 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1527 .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001528 .recalc = &followparent_recalc,
1529};
1530
1531/* CORE_12M_FCK based clocks */
1532
1533static struct clk core_12m_fck = {
1534 .name = "core_12m_fck",
Russell King57137182008-11-04 16:48:35 +00001535 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001536 .parent = &omap_12m_fck,
Paul Walmsley333943b2008-08-19 11:08:45 +03001537 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001538 .recalc = &followparent_recalc,
1539};
1540
1541static struct clk hdq_fck = {
1542 .name = "hdq_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001543 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001544 .parent = &core_12m_fck,
1545 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1546 .enable_bit = OMAP3430_EN_HDQ_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001547 .recalc = &followparent_recalc,
1548};
1549
1550/* DPLL3-derived clock */
1551
1552static const struct clksel_rate ssi_ssr_corex2_rates[] = {
1553 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
1554 { .div = 2, .val = 2, .flags = RATE_IN_343X },
1555 { .div = 3, .val = 3, .flags = RATE_IN_343X },
1556 { .div = 4, .val = 4, .flags = RATE_IN_343X },
1557 { .div = 6, .val = 6, .flags = RATE_IN_343X },
1558 { .div = 8, .val = 8, .flags = RATE_IN_343X },
1559 { .div = 0 }
1560};
1561
1562static const struct clksel ssi_ssr_clksel[] = {
1563 { .parent = &corex2_fck, .rates = ssi_ssr_corex2_rates },
1564 { .parent = NULL }
1565};
1566
Paul Walmsley3c82e222009-07-24 19:44:06 -06001567static struct clk ssi_ssr_fck_3430es1 = {
Paul Walmsleyb045d082008-03-18 11:24:28 +02001568 .name = "ssi_ssr_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00001569 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001570 .init = &omap2_init_clksel_parent,
1571 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1572 .enable_bit = OMAP3430_EN_SSI_SHIFT,
1573 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1574 .clksel_mask = OMAP3430_CLKSEL_SSI_MASK,
1575 .clksel = ssi_ssr_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03001576 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001577 .recalc = &omap2_clksel_recalc,
1578};
1579
Paul Walmsley3c82e222009-07-24 19:44:06 -06001580static struct clk ssi_ssr_fck_3430es2 = {
1581 .name = "ssi_ssr_fck",
1582 .ops = &clkops_omap3430es2_ssi_wait,
1583 .init = &omap2_init_clksel_parent,
1584 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1585 .enable_bit = OMAP3430_EN_SSI_SHIFT,
1586 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1587 .clksel_mask = OMAP3430_CLKSEL_SSI_MASK,
1588 .clksel = ssi_ssr_clksel,
1589 .clkdm_name = "core_l4_clkdm",
1590 .recalc = &omap2_clksel_recalc,
1591};
1592
1593static struct clk ssi_sst_fck_3430es1 = {
Paul Walmsleyb045d082008-03-18 11:24:28 +02001594 .name = "ssi_sst_fck",
Russell King57137182008-11-04 16:48:35 +00001595 .ops = &clkops_null,
Paul Walmsley3c82e222009-07-24 19:44:06 -06001596 .parent = &ssi_ssr_fck_3430es1,
1597 .fixed_div = 2,
1598 .recalc = &omap2_fixed_divisor_recalc,
1599};
1600
1601static struct clk ssi_sst_fck_3430es2 = {
1602 .name = "ssi_sst_fck",
1603 .ops = &clkops_null,
1604 .parent = &ssi_ssr_fck_3430es2,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001605 .fixed_div = 2,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001606 .recalc = &omap2_fixed_divisor_recalc,
1607};
1608
1609
1610
1611/* CORE_L3_ICK based clocks */
1612
Paul Walmsley333943b2008-08-19 11:08:45 +03001613/*
1614 * XXX must add clk_enable/clk_disable for these if standard code won't
1615 * handle it
1616 */
Paul Walmsleyb045d082008-03-18 11:24:28 +02001617static struct clk core_l3_ick = {
1618 .name = "core_l3_ick",
Russell King57137182008-11-04 16:48:35 +00001619 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001620 .parent = &l3_ick,
Paul Walmsley333943b2008-08-19 11:08:45 +03001621 .clkdm_name = "core_l3_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001622 .recalc = &followparent_recalc,
1623};
1624
Paul Walmsley3c82e222009-07-24 19:44:06 -06001625static struct clk hsotgusb_ick_3430es1 = {
Paul Walmsleyb045d082008-03-18 11:24:28 +02001626 .name = "hsotgusb_ick",
Paul Walmsley3c82e222009-07-24 19:44:06 -06001627 .ops = &clkops_omap2_dflt,
1628 .parent = &core_l3_ick,
1629 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1630 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
1631 .clkdm_name = "core_l3_clkdm",
1632 .recalc = &followparent_recalc,
1633};
1634
1635static struct clk hsotgusb_ick_3430es2 = {
1636 .name = "hsotgusb_ick",
1637 .ops = &clkops_omap3430es2_hsotgusb_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001638 .parent = &core_l3_ick,
1639 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1640 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001641 .clkdm_name = "core_l3_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001642 .recalc = &followparent_recalc,
1643};
1644
1645static struct clk sdrc_ick = {
1646 .name = "sdrc_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001647 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001648 .parent = &core_l3_ick,
1649 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1650 .enable_bit = OMAP3430_EN_SDRC_SHIFT,
Russell King44dc9d02009-01-19 15:51:11 +00001651 .flags = ENABLE_ON_INIT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001652 .clkdm_name = "core_l3_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001653 .recalc = &followparent_recalc,
1654};
1655
1656static struct clk gpmc_fck = {
1657 .name = "gpmc_fck",
Russell King57137182008-11-04 16:48:35 +00001658 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001659 .parent = &core_l3_ick,
Russell King44dc9d02009-01-19 15:51:11 +00001660 .flags = ENABLE_ON_INIT, /* huh? */
Paul Walmsley333943b2008-08-19 11:08:45 +03001661 .clkdm_name = "core_l3_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001662 .recalc = &followparent_recalc,
1663};
1664
1665/* SECURITY_L3_ICK based clocks */
1666
1667static struct clk security_l3_ick = {
1668 .name = "security_l3_ick",
Russell King57137182008-11-04 16:48:35 +00001669 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001670 .parent = &l3_ick,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001671 .recalc = &followparent_recalc,
1672};
1673
1674static struct clk pka_ick = {
1675 .name = "pka_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001676 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001677 .parent = &security_l3_ick,
1678 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1679 .enable_bit = OMAP3430_EN_PKA_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001680 .recalc = &followparent_recalc,
1681};
1682
1683/* CORE_L4_ICK based clocks */
1684
1685static struct clk core_l4_ick = {
1686 .name = "core_l4_ick",
Russell King57137182008-11-04 16:48:35 +00001687 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001688 .parent = &l4_ick,
Paul Walmsley333943b2008-08-19 11:08:45 +03001689 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001690 .recalc = &followparent_recalc,
1691};
1692
1693static struct clk usbtll_ick = {
1694 .name = "usbtll_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001695 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001696 .parent = &core_l4_ick,
1697 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1698 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001699 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001700 .recalc = &followparent_recalc,
1701};
1702
1703static struct clk mmchs3_ick = {
1704 .name = "mmchs_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001705 .ops = &clkops_omap2_dflt_wait,
Tony Lindgrend8874662008-12-10 17:37:16 -08001706 .id = 2,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001707 .parent = &core_l4_ick,
1708 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1709 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001710 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001711 .recalc = &followparent_recalc,
1712};
1713
1714/* Intersystem Communication Registers - chassis mode only */
1715static struct clk icr_ick = {
1716 .name = "icr_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001717 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001718 .parent = &core_l4_ick,
1719 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1720 .enable_bit = OMAP3430_EN_ICR_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001721 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001722 .recalc = &followparent_recalc,
1723};
1724
1725static struct clk aes2_ick = {
1726 .name = "aes2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001727 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001728 .parent = &core_l4_ick,
1729 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1730 .enable_bit = OMAP3430_EN_AES2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001731 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001732 .recalc = &followparent_recalc,
1733};
1734
1735static struct clk sha12_ick = {
1736 .name = "sha12_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001737 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001738 .parent = &core_l4_ick,
1739 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1740 .enable_bit = OMAP3430_EN_SHA12_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001741 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001742 .recalc = &followparent_recalc,
1743};
1744
1745static struct clk des2_ick = {
1746 .name = "des2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001747 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001748 .parent = &core_l4_ick,
1749 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1750 .enable_bit = OMAP3430_EN_DES2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001751 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001752 .recalc = &followparent_recalc,
1753};
1754
1755static struct clk mmchs2_ick = {
1756 .name = "mmchs_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001757 .ops = &clkops_omap2_dflt_wait,
Tony Lindgrend8874662008-12-10 17:37:16 -08001758 .id = 1,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001759 .parent = &core_l4_ick,
1760 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1761 .enable_bit = OMAP3430_EN_MMC2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001762 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001763 .recalc = &followparent_recalc,
1764};
1765
1766static struct clk mmchs1_ick = {
1767 .name = "mmchs_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001768 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001769 .parent = &core_l4_ick,
1770 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1771 .enable_bit = OMAP3430_EN_MMC1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001772 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001773 .recalc = &followparent_recalc,
1774};
1775
1776static struct clk mspro_ick = {
1777 .name = "mspro_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001778 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001779 .parent = &core_l4_ick,
1780 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1781 .enable_bit = OMAP3430_EN_MSPRO_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001782 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001783 .recalc = &followparent_recalc,
1784};
1785
1786static struct clk hdq_ick = {
1787 .name = "hdq_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001788 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001789 .parent = &core_l4_ick,
1790 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1791 .enable_bit = OMAP3430_EN_HDQ_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001792 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001793 .recalc = &followparent_recalc,
1794};
1795
1796static struct clk mcspi4_ick = {
1797 .name = "mcspi_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001798 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001799 .id = 4,
1800 .parent = &core_l4_ick,
1801 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1802 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001803 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001804 .recalc = &followparent_recalc,
1805};
1806
1807static struct clk mcspi3_ick = {
1808 .name = "mcspi_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001809 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001810 .id = 3,
1811 .parent = &core_l4_ick,
1812 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1813 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001814 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001815 .recalc = &followparent_recalc,
1816};
1817
1818static struct clk mcspi2_ick = {
1819 .name = "mcspi_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001820 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001821 .id = 2,
1822 .parent = &core_l4_ick,
1823 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1824 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001825 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001826 .recalc = &followparent_recalc,
1827};
1828
1829static struct clk mcspi1_ick = {
1830 .name = "mcspi_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001831 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001832 .id = 1,
1833 .parent = &core_l4_ick,
1834 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1835 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001836 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001837 .recalc = &followparent_recalc,
1838};
1839
1840static struct clk i2c3_ick = {
1841 .name = "i2c_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001842 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001843 .id = 3,
1844 .parent = &core_l4_ick,
1845 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1846 .enable_bit = OMAP3430_EN_I2C3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001847 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001848 .recalc = &followparent_recalc,
1849};
1850
1851static struct clk i2c2_ick = {
1852 .name = "i2c_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001853 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001854 .id = 2,
1855 .parent = &core_l4_ick,
1856 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1857 .enable_bit = OMAP3430_EN_I2C2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001858 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001859 .recalc = &followparent_recalc,
1860};
1861
1862static struct clk i2c1_ick = {
1863 .name = "i2c_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001864 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001865 .id = 1,
1866 .parent = &core_l4_ick,
1867 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1868 .enable_bit = OMAP3430_EN_I2C1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001869 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001870 .recalc = &followparent_recalc,
1871};
1872
1873static struct clk uart2_ick = {
1874 .name = "uart2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001875 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001876 .parent = &core_l4_ick,
1877 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1878 .enable_bit = OMAP3430_EN_UART2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001879 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001880 .recalc = &followparent_recalc,
1881};
1882
1883static struct clk uart1_ick = {
1884 .name = "uart1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001885 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001886 .parent = &core_l4_ick,
1887 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1888 .enable_bit = OMAP3430_EN_UART1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001889 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001890 .recalc = &followparent_recalc,
1891};
1892
1893static struct clk gpt11_ick = {
1894 .name = "gpt11_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001895 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001896 .parent = &core_l4_ick,
1897 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1898 .enable_bit = OMAP3430_EN_GPT11_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001899 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001900 .recalc = &followparent_recalc,
1901};
1902
1903static struct clk gpt10_ick = {
1904 .name = "gpt10_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001905 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001906 .parent = &core_l4_ick,
1907 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1908 .enable_bit = OMAP3430_EN_GPT10_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001909 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001910 .recalc = &followparent_recalc,
1911};
1912
1913static struct clk mcbsp5_ick = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03001914 .name = "mcbsp_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001915 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03001916 .id = 5,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001917 .parent = &core_l4_ick,
1918 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1919 .enable_bit = OMAP3430_EN_MCBSP5_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001920 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001921 .recalc = &followparent_recalc,
1922};
1923
1924static struct clk mcbsp1_ick = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03001925 .name = "mcbsp_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001926 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03001927 .id = 1,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001928 .parent = &core_l4_ick,
1929 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1930 .enable_bit = OMAP3430_EN_MCBSP1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001931 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001932 .recalc = &followparent_recalc,
1933};
1934
1935static struct clk fac_ick = {
1936 .name = "fac_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001937 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001938 .parent = &core_l4_ick,
1939 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1940 .enable_bit = OMAP3430ES1_EN_FAC_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001941 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001942 .recalc = &followparent_recalc,
1943};
1944
1945static struct clk mailboxes_ick = {
1946 .name = "mailboxes_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001947 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001948 .parent = &core_l4_ick,
1949 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1950 .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001951 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001952 .recalc = &followparent_recalc,
1953};
1954
1955static struct clk omapctrl_ick = {
1956 .name = "omapctrl_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001957 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001958 .parent = &core_l4_ick,
1959 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1960 .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT,
Russell King44dc9d02009-01-19 15:51:11 +00001961 .flags = ENABLE_ON_INIT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001962 .recalc = &followparent_recalc,
1963};
1964
1965/* SSI_L4_ICK based clocks */
1966
1967static struct clk ssi_l4_ick = {
1968 .name = "ssi_l4_ick",
Russell King57137182008-11-04 16:48:35 +00001969 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001970 .parent = &l4_ick,
Paul Walmsley333943b2008-08-19 11:08:45 +03001971 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001972 .recalc = &followparent_recalc,
1973};
1974
Paul Walmsley3c82e222009-07-24 19:44:06 -06001975static struct clk ssi_ick_3430es1 = {
Paul Walmsleyb045d082008-03-18 11:24:28 +02001976 .name = "ssi_ick",
Russell Kingbc51da42008-11-04 18:59:32 +00001977 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02001978 .parent = &ssi_l4_ick,
1979 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1980 .enable_bit = OMAP3430_EN_SSI_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03001981 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02001982 .recalc = &followparent_recalc,
1983};
1984
Paul Walmsley3c82e222009-07-24 19:44:06 -06001985static struct clk ssi_ick_3430es2 = {
1986 .name = "ssi_ick",
1987 .ops = &clkops_omap3430es2_ssi_wait,
1988 .parent = &ssi_l4_ick,
1989 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1990 .enable_bit = OMAP3430_EN_SSI_SHIFT,
1991 .clkdm_name = "core_l4_clkdm",
1992 .recalc = &followparent_recalc,
1993};
1994
Paul Walmsleyb045d082008-03-18 11:24:28 +02001995/* REVISIT: Technically the TRM claims that this is CORE_CLK based,
1996 * but l4_ick makes more sense to me */
1997
1998static const struct clksel usb_l4_clksel[] = {
1999 { .parent = &l4_ick, .rates = div2_rates },
2000 { .parent = NULL },
2001};
2002
2003static struct clk usb_l4_ick = {
2004 .name = "usb_l4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002005 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002006 .parent = &l4_ick,
2007 .init = &omap2_init_clksel_parent,
2008 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2009 .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
2010 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
2011 .clksel_mask = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK,
2012 .clksel = usb_l4_clksel,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002013 .recalc = &omap2_clksel_recalc,
2014};
2015
Paul Walmsleyb045d082008-03-18 11:24:28 +02002016/* SECURITY_L4_ICK2 based clocks */
2017
2018static struct clk security_l4_ick2 = {
2019 .name = "security_l4_ick2",
Russell King57137182008-11-04 16:48:35 +00002020 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002021 .parent = &l4_ick,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002022 .recalc = &followparent_recalc,
2023};
2024
2025static struct clk aes1_ick = {
2026 .name = "aes1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002027 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002028 .parent = &security_l4_ick2,
2029 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2030 .enable_bit = OMAP3430_EN_AES1_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002031 .recalc = &followparent_recalc,
2032};
2033
2034static struct clk rng_ick = {
2035 .name = "rng_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002036 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002037 .parent = &security_l4_ick2,
2038 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2039 .enable_bit = OMAP3430_EN_RNG_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002040 .recalc = &followparent_recalc,
2041};
2042
2043static struct clk sha11_ick = {
2044 .name = "sha11_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002045 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002046 .parent = &security_l4_ick2,
2047 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2048 .enable_bit = OMAP3430_EN_SHA11_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002049 .recalc = &followparent_recalc,
2050};
2051
2052static struct clk des1_ick = {
2053 .name = "des1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002054 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002055 .parent = &security_l4_ick2,
2056 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2057 .enable_bit = OMAP3430_EN_DES1_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002058 .recalc = &followparent_recalc,
2059};
2060
2061/* DSS */
Paul Walmsley3c82e222009-07-24 19:44:06 -06002062static struct clk dss1_alwon_fck_3430es1 = {
Paul Walmsleyb045d082008-03-18 11:24:28 +02002063 .name = "dss1_alwon_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00002064 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002065 .parent = &dpll4_m4x2_ck,
2066 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
2067 .enable_bit = OMAP3430_EN_DSS1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002068 .clkdm_name = "dss_clkdm",
Russell Kingc0bf3132009-02-19 13:29:22 +00002069 .recalc = &followparent_recalc,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002070};
2071
Paul Walmsley3c82e222009-07-24 19:44:06 -06002072static struct clk dss1_alwon_fck_3430es2 = {
2073 .name = "dss1_alwon_fck",
2074 .ops = &clkops_omap3430es2_dss_usbhost_wait,
2075 .parent = &dpll4_m4x2_ck,
2076 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
2077 .enable_bit = OMAP3430_EN_DSS1_SHIFT,
2078 .clkdm_name = "dss_clkdm",
2079 .recalc = &followparent_recalc,
2080};
2081
Paul Walmsleyb045d082008-03-18 11:24:28 +02002082static struct clk dss_tv_fck = {
2083 .name = "dss_tv_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00002084 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002085 .parent = &omap_54m_fck,
2086 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
2087 .enable_bit = OMAP3430_EN_TV_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002088 .clkdm_name = "dss_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002089 .recalc = &followparent_recalc,
2090};
2091
2092static struct clk dss_96m_fck = {
2093 .name = "dss_96m_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00002094 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002095 .parent = &omap_96m_fck,
2096 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
2097 .enable_bit = OMAP3430_EN_TV_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002098 .clkdm_name = "dss_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002099 .recalc = &followparent_recalc,
2100};
2101
2102static struct clk dss2_alwon_fck = {
2103 .name = "dss2_alwon_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00002104 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002105 .parent = &sys_ck,
2106 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
2107 .enable_bit = OMAP3430_EN_DSS2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002108 .clkdm_name = "dss_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002109 .recalc = &followparent_recalc,
2110};
2111
Paul Walmsley3c82e222009-07-24 19:44:06 -06002112static struct clk dss_ick_3430es1 = {
Paul Walmsleyb045d082008-03-18 11:24:28 +02002113 /* Handles both L3 and L4 clocks */
2114 .name = "dss_ick",
Russell Kingbc51da42008-11-04 18:59:32 +00002115 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002116 .parent = &l4_ick,
2117 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
2118 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002119 .clkdm_name = "dss_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002120 .recalc = &followparent_recalc,
2121};
2122
Paul Walmsley3c82e222009-07-24 19:44:06 -06002123static struct clk dss_ick_3430es2 = {
2124 /* Handles both L3 and L4 clocks */
2125 .name = "dss_ick",
2126 .ops = &clkops_omap3430es2_dss_usbhost_wait,
2127 .parent = &l4_ick,
Paul Walmsley3c82e222009-07-24 19:44:06 -06002128 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
2129 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
2130 .clkdm_name = "dss_clkdm",
2131 .recalc = &followparent_recalc,
2132};
2133
Paul Walmsleyb045d082008-03-18 11:24:28 +02002134/* CAM */
2135
2136static struct clk cam_mclk = {
2137 .name = "cam_mclk",
Sergio Aguirre9e53dd72009-04-23 21:11:07 -06002138 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002139 .parent = &dpll4_m5x2_ck,
2140 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
2141 .enable_bit = OMAP3430_EN_CAM_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002142 .clkdm_name = "cam_clkdm",
Russell Kingc0bf3132009-02-19 13:29:22 +00002143 .recalc = &followparent_recalc,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002144};
2145
Högander Jouni59559022008-08-19 11:08:45 +03002146static struct clk cam_ick = {
2147 /* Handles both L3 and L4 clocks */
2148 .name = "cam_ick",
Sergio Aguirre9e53dd72009-04-23 21:11:07 -06002149 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002150 .parent = &l4_ick,
2151 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
2152 .enable_bit = OMAP3430_EN_CAM_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002153 .clkdm_name = "cam_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002154 .recalc = &followparent_recalc,
2155};
2156
Sergio Aguirre6c8fe0b2009-01-27 19:13:09 -07002157static struct clk csi2_96m_fck = {
2158 .name = "csi2_96m_fck",
Sergio Aguirre9e53dd72009-04-23 21:11:07 -06002159 .ops = &clkops_omap2_dflt,
Sergio Aguirre6c8fe0b2009-01-27 19:13:09 -07002160 .parent = &core_96m_fck,
Sergio Aguirre6c8fe0b2009-01-27 19:13:09 -07002161 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
2162 .enable_bit = OMAP3430_EN_CSI2_SHIFT,
2163 .clkdm_name = "cam_clkdm",
2164 .recalc = &followparent_recalc,
2165};
2166
Paul Walmsleyb045d082008-03-18 11:24:28 +02002167/* USBHOST - 3430ES2 only */
2168
2169static struct clk usbhost_120m_fck = {
2170 .name = "usbhost_120m_fck",
Paul Walmsley3c82e222009-07-24 19:44:06 -06002171 .ops = &clkops_omap2_dflt,
Russell Kingc0bf3132009-02-19 13:29:22 +00002172 .parent = &dpll5_m2_ck,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002173 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
2174 .enable_bit = OMAP3430ES2_EN_USBHOST2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002175 .clkdm_name = "usbhost_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002176 .recalc = &followparent_recalc,
2177};
2178
2179static struct clk usbhost_48m_fck = {
2180 .name = "usbhost_48m_fck",
Paul Walmsley3c82e222009-07-24 19:44:06 -06002181 .ops = &clkops_omap3430es2_dss_usbhost_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002182 .parent = &omap_48m_fck,
2183 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
2184 .enable_bit = OMAP3430ES2_EN_USBHOST1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002185 .clkdm_name = "usbhost_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002186 .recalc = &followparent_recalc,
2187};
2188
Högander Jouni59559022008-08-19 11:08:45 +03002189static struct clk usbhost_ick = {
2190 /* Handles both L3 and L4 clocks */
2191 .name = "usbhost_ick",
Paul Walmsley3c82e222009-07-24 19:44:06 -06002192 .ops = &clkops_omap3430es2_dss_usbhost_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002193 .parent = &l4_ick,
2194 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
2195 .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002196 .clkdm_name = "usbhost_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002197 .recalc = &followparent_recalc,
2198};
2199
Paul Walmsleyb045d082008-03-18 11:24:28 +02002200/* WKUP */
2201
2202static const struct clksel_rate usim_96m_rates[] = {
2203 { .div = 2, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
2204 { .div = 4, .val = 4, .flags = RATE_IN_343X },
2205 { .div = 8, .val = 5, .flags = RATE_IN_343X },
2206 { .div = 10, .val = 6, .flags = RATE_IN_343X },
2207 { .div = 0 },
2208};
2209
2210static const struct clksel_rate usim_120m_rates[] = {
2211 { .div = 4, .val = 7, .flags = RATE_IN_343X | DEFAULT_RATE },
2212 { .div = 8, .val = 8, .flags = RATE_IN_343X },
2213 { .div = 16, .val = 9, .flags = RATE_IN_343X },
2214 { .div = 20, .val = 10, .flags = RATE_IN_343X },
2215 { .div = 0 },
2216};
2217
2218static const struct clksel usim_clksel[] = {
2219 { .parent = &omap_96m_fck, .rates = usim_96m_rates },
Russell Kingc0bf3132009-02-19 13:29:22 +00002220 { .parent = &dpll5_m2_ck, .rates = usim_120m_rates },
Paul Walmsleyb045d082008-03-18 11:24:28 +02002221 { .parent = &sys_ck, .rates = div2_rates },
2222 { .parent = NULL },
2223};
2224
2225/* 3430ES2 only */
2226static struct clk usim_fck = {
2227 .name = "usim_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002228 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002229 .init = &omap2_init_clksel_parent,
2230 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2231 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT,
2232 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
2233 .clksel_mask = OMAP3430ES2_CLKSEL_USIMOCP_MASK,
2234 .clksel = usim_clksel,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002235 .recalc = &omap2_clksel_recalc,
2236};
2237
Paul Walmsley333943b2008-08-19 11:08:45 +03002238/* XXX should gpt1's clksel have wkup_32k_fck as the 32k opt? */
Paul Walmsleyb045d082008-03-18 11:24:28 +02002239static struct clk gpt1_fck = {
2240 .name = "gpt1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002241 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002242 .init = &omap2_init_clksel_parent,
2243 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2244 .enable_bit = OMAP3430_EN_GPT1_SHIFT,
2245 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
2246 .clksel_mask = OMAP3430_CLKSEL_GPT1_MASK,
2247 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002248 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002249 .recalc = &omap2_clksel_recalc,
2250};
2251
2252static struct clk wkup_32k_fck = {
2253 .name = "wkup_32k_fck",
Russell King897dcde2008-11-04 16:35:03 +00002254 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002255 .parent = &omap_32k_fck,
Paul Walmsley333943b2008-08-19 11:08:45 +03002256 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002257 .recalc = &followparent_recalc,
2258};
2259
Jouni Hogander89db9482008-12-10 17:35:24 -08002260static struct clk gpio1_dbck = {
2261 .name = "gpio1_dbck",
Paul Walmsley6f733a32009-05-11 09:58:19 -07002262 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002263 .parent = &wkup_32k_fck,
2264 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2265 .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002266 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002267 .recalc = &followparent_recalc,
2268};
2269
2270static struct clk wdt2_fck = {
2271 .name = "wdt2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002272 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002273 .parent = &wkup_32k_fck,
2274 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2275 .enable_bit = OMAP3430_EN_WDT2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002276 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002277 .recalc = &followparent_recalc,
2278};
2279
2280static struct clk wkup_l4_ick = {
2281 .name = "wkup_l4_ick",
Russell King897dcde2008-11-04 16:35:03 +00002282 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002283 .parent = &sys_ck,
Paul Walmsley333943b2008-08-19 11:08:45 +03002284 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002285 .recalc = &followparent_recalc,
2286};
2287
2288/* 3430ES2 only */
2289/* Never specifically named in the TRM, so we have to infer a likely name */
2290static struct clk usim_ick = {
2291 .name = "usim_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002292 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002293 .parent = &wkup_l4_ick,
2294 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2295 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002296 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002297 .recalc = &followparent_recalc,
2298};
2299
2300static struct clk wdt2_ick = {
2301 .name = "wdt2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002302 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002303 .parent = &wkup_l4_ick,
2304 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2305 .enable_bit = OMAP3430_EN_WDT2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002306 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002307 .recalc = &followparent_recalc,
2308};
2309
2310static struct clk wdt1_ick = {
2311 .name = "wdt1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002312 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002313 .parent = &wkup_l4_ick,
2314 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2315 .enable_bit = OMAP3430_EN_WDT1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002316 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002317 .recalc = &followparent_recalc,
2318};
2319
2320static struct clk gpio1_ick = {
2321 .name = "gpio1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002322 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002323 .parent = &wkup_l4_ick,
2324 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2325 .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002326 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002327 .recalc = &followparent_recalc,
2328};
2329
2330static struct clk omap_32ksync_ick = {
2331 .name = "omap_32ksync_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002332 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002333 .parent = &wkup_l4_ick,
2334 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2335 .enable_bit = OMAP3430_EN_32KSYNC_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002336 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002337 .recalc = &followparent_recalc,
2338};
2339
Paul Walmsley333943b2008-08-19 11:08:45 +03002340/* XXX This clock no longer exists in 3430 TRM rev F */
Paul Walmsleyb045d082008-03-18 11:24:28 +02002341static struct clk gpt12_ick = {
2342 .name = "gpt12_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002343 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002344 .parent = &wkup_l4_ick,
2345 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2346 .enable_bit = OMAP3430_EN_GPT12_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002347 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002348 .recalc = &followparent_recalc,
2349};
2350
2351static struct clk gpt1_ick = {
2352 .name = "gpt1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002353 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002354 .parent = &wkup_l4_ick,
2355 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2356 .enable_bit = OMAP3430_EN_GPT1_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002357 .clkdm_name = "wkup_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002358 .recalc = &followparent_recalc,
2359};
2360
2361
2362
2363/* PER clock domain */
2364
2365static struct clk per_96m_fck = {
2366 .name = "per_96m_fck",
Russell King57137182008-11-04 16:48:35 +00002367 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002368 .parent = &omap_96m_alwon_fck,
Paul Walmsley333943b2008-08-19 11:08:45 +03002369 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002370 .recalc = &followparent_recalc,
2371};
2372
2373static struct clk per_48m_fck = {
2374 .name = "per_48m_fck",
Russell King57137182008-11-04 16:48:35 +00002375 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002376 .parent = &omap_48m_fck,
Paul Walmsley333943b2008-08-19 11:08:45 +03002377 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002378 .recalc = &followparent_recalc,
2379};
2380
2381static struct clk uart3_fck = {
2382 .name = "uart3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002383 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002384 .parent = &per_48m_fck,
2385 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2386 .enable_bit = OMAP3430_EN_UART3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002387 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002388 .recalc = &followparent_recalc,
2389};
2390
2391static struct clk gpt2_fck = {
2392 .name = "gpt2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002393 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002394 .init = &omap2_init_clksel_parent,
2395 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2396 .enable_bit = OMAP3430_EN_GPT2_SHIFT,
2397 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2398 .clksel_mask = OMAP3430_CLKSEL_GPT2_MASK,
2399 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002400 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002401 .recalc = &omap2_clksel_recalc,
2402};
2403
2404static struct clk gpt3_fck = {
2405 .name = "gpt3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002406 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002407 .init = &omap2_init_clksel_parent,
2408 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2409 .enable_bit = OMAP3430_EN_GPT3_SHIFT,
2410 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2411 .clksel_mask = OMAP3430_CLKSEL_GPT3_MASK,
2412 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002413 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002414 .recalc = &omap2_clksel_recalc,
2415};
2416
2417static struct clk gpt4_fck = {
2418 .name = "gpt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002419 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002420 .init = &omap2_init_clksel_parent,
2421 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2422 .enable_bit = OMAP3430_EN_GPT4_SHIFT,
2423 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2424 .clksel_mask = OMAP3430_CLKSEL_GPT4_MASK,
2425 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002426 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002427 .recalc = &omap2_clksel_recalc,
2428};
2429
2430static struct clk gpt5_fck = {
2431 .name = "gpt5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002432 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002433 .init = &omap2_init_clksel_parent,
2434 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2435 .enable_bit = OMAP3430_EN_GPT5_SHIFT,
2436 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2437 .clksel_mask = OMAP3430_CLKSEL_GPT5_MASK,
2438 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002439 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002440 .recalc = &omap2_clksel_recalc,
2441};
2442
2443static struct clk gpt6_fck = {
2444 .name = "gpt6_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002445 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002446 .init = &omap2_init_clksel_parent,
2447 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2448 .enable_bit = OMAP3430_EN_GPT6_SHIFT,
2449 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2450 .clksel_mask = OMAP3430_CLKSEL_GPT6_MASK,
2451 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002452 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002453 .recalc = &omap2_clksel_recalc,
2454};
2455
2456static struct clk gpt7_fck = {
2457 .name = "gpt7_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002458 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002459 .init = &omap2_init_clksel_parent,
2460 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2461 .enable_bit = OMAP3430_EN_GPT7_SHIFT,
2462 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2463 .clksel_mask = OMAP3430_CLKSEL_GPT7_MASK,
2464 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002465 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002466 .recalc = &omap2_clksel_recalc,
2467};
2468
2469static struct clk gpt8_fck = {
2470 .name = "gpt8_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002471 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002472 .init = &omap2_init_clksel_parent,
2473 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2474 .enable_bit = OMAP3430_EN_GPT8_SHIFT,
2475 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2476 .clksel_mask = OMAP3430_CLKSEL_GPT8_MASK,
2477 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002478 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002479 .recalc = &omap2_clksel_recalc,
2480};
2481
2482static struct clk gpt9_fck = {
2483 .name = "gpt9_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002484 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002485 .init = &omap2_init_clksel_parent,
2486 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2487 .enable_bit = OMAP3430_EN_GPT9_SHIFT,
2488 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2489 .clksel_mask = OMAP3430_CLKSEL_GPT9_MASK,
2490 .clksel = omap343x_gpt_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002491 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002492 .recalc = &omap2_clksel_recalc,
2493};
2494
2495static struct clk per_32k_alwon_fck = {
2496 .name = "per_32k_alwon_fck",
Russell King897dcde2008-11-04 16:35:03 +00002497 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002498 .parent = &omap_32k_fck,
Paul Walmsley333943b2008-08-19 11:08:45 +03002499 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002500 .recalc = &followparent_recalc,
2501};
2502
Jouni Hogander89db9482008-12-10 17:35:24 -08002503static struct clk gpio6_dbck = {
2504 .name = "gpio6_dbck",
Paul Walmsley6f733a32009-05-11 09:58:19 -07002505 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002506 .parent = &per_32k_alwon_fck,
2507 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
Jouni Höganderc3aa044a2008-03-28 14:57:50 +02002508 .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002509 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002510 .recalc = &followparent_recalc,
2511};
2512
Jouni Hogander89db9482008-12-10 17:35:24 -08002513static struct clk gpio5_dbck = {
2514 .name = "gpio5_dbck",
Paul Walmsley6f733a32009-05-11 09:58:19 -07002515 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002516 .parent = &per_32k_alwon_fck,
2517 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
Jouni Höganderc3aa044a2008-03-28 14:57:50 +02002518 .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002519 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002520 .recalc = &followparent_recalc,
2521};
2522
Jouni Hogander89db9482008-12-10 17:35:24 -08002523static struct clk gpio4_dbck = {
2524 .name = "gpio4_dbck",
Paul Walmsley6f733a32009-05-11 09:58:19 -07002525 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002526 .parent = &per_32k_alwon_fck,
2527 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
Jouni Höganderc3aa044a2008-03-28 14:57:50 +02002528 .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002529 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002530 .recalc = &followparent_recalc,
2531};
2532
Jouni Hogander89db9482008-12-10 17:35:24 -08002533static struct clk gpio3_dbck = {
2534 .name = "gpio3_dbck",
Paul Walmsley6f733a32009-05-11 09:58:19 -07002535 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002536 .parent = &per_32k_alwon_fck,
2537 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
Jouni Höganderc3aa044a2008-03-28 14:57:50 +02002538 .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002539 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002540 .recalc = &followparent_recalc,
2541};
2542
Jouni Hogander89db9482008-12-10 17:35:24 -08002543static struct clk gpio2_dbck = {
2544 .name = "gpio2_dbck",
Paul Walmsley6f733a32009-05-11 09:58:19 -07002545 .ops = &clkops_omap2_dflt,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002546 .parent = &per_32k_alwon_fck,
2547 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
Jouni Höganderc3aa044a2008-03-28 14:57:50 +02002548 .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002549 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002550 .recalc = &followparent_recalc,
2551};
2552
2553static struct clk wdt3_fck = {
2554 .name = "wdt3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002555 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002556 .parent = &per_32k_alwon_fck,
2557 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2558 .enable_bit = OMAP3430_EN_WDT3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002559 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002560 .recalc = &followparent_recalc,
2561};
2562
2563static struct clk per_l4_ick = {
2564 .name = "per_l4_ick",
Russell King57137182008-11-04 16:48:35 +00002565 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002566 .parent = &l4_ick,
Paul Walmsley333943b2008-08-19 11:08:45 +03002567 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002568 .recalc = &followparent_recalc,
2569};
2570
2571static struct clk gpio6_ick = {
2572 .name = "gpio6_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002573 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002574 .parent = &per_l4_ick,
2575 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2576 .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002577 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002578 .recalc = &followparent_recalc,
2579};
2580
2581static struct clk gpio5_ick = {
2582 .name = "gpio5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002583 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002584 .parent = &per_l4_ick,
2585 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2586 .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002587 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002588 .recalc = &followparent_recalc,
2589};
2590
2591static struct clk gpio4_ick = {
2592 .name = "gpio4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002593 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002594 .parent = &per_l4_ick,
2595 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2596 .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002597 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002598 .recalc = &followparent_recalc,
2599};
2600
2601static struct clk gpio3_ick = {
2602 .name = "gpio3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002603 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002604 .parent = &per_l4_ick,
2605 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2606 .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002607 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002608 .recalc = &followparent_recalc,
2609};
2610
2611static struct clk gpio2_ick = {
2612 .name = "gpio2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002613 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002614 .parent = &per_l4_ick,
2615 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2616 .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002617 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002618 .recalc = &followparent_recalc,
2619};
2620
2621static struct clk wdt3_ick = {
2622 .name = "wdt3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002623 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002624 .parent = &per_l4_ick,
2625 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2626 .enable_bit = OMAP3430_EN_WDT3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002627 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002628 .recalc = &followparent_recalc,
2629};
2630
2631static struct clk uart3_ick = {
2632 .name = "uart3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002633 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002634 .parent = &per_l4_ick,
2635 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2636 .enable_bit = OMAP3430_EN_UART3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002637 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002638 .recalc = &followparent_recalc,
2639};
2640
2641static struct clk gpt9_ick = {
2642 .name = "gpt9_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002643 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002644 .parent = &per_l4_ick,
2645 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2646 .enable_bit = OMAP3430_EN_GPT9_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002647 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002648 .recalc = &followparent_recalc,
2649};
2650
2651static struct clk gpt8_ick = {
2652 .name = "gpt8_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002653 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002654 .parent = &per_l4_ick,
2655 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2656 .enable_bit = OMAP3430_EN_GPT8_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002657 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002658 .recalc = &followparent_recalc,
2659};
2660
2661static struct clk gpt7_ick = {
2662 .name = "gpt7_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002663 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002664 .parent = &per_l4_ick,
2665 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2666 .enable_bit = OMAP3430_EN_GPT7_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002667 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002668 .recalc = &followparent_recalc,
2669};
2670
2671static struct clk gpt6_ick = {
2672 .name = "gpt6_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002673 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002674 .parent = &per_l4_ick,
2675 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2676 .enable_bit = OMAP3430_EN_GPT6_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002677 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002678 .recalc = &followparent_recalc,
2679};
2680
2681static struct clk gpt5_ick = {
2682 .name = "gpt5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002683 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002684 .parent = &per_l4_ick,
2685 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2686 .enable_bit = OMAP3430_EN_GPT5_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002687 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002688 .recalc = &followparent_recalc,
2689};
2690
2691static struct clk gpt4_ick = {
2692 .name = "gpt4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002693 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002694 .parent = &per_l4_ick,
2695 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2696 .enable_bit = OMAP3430_EN_GPT4_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002697 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002698 .recalc = &followparent_recalc,
2699};
2700
2701static struct clk gpt3_ick = {
2702 .name = "gpt3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002703 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002704 .parent = &per_l4_ick,
2705 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2706 .enable_bit = OMAP3430_EN_GPT3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002707 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002708 .recalc = &followparent_recalc,
2709};
2710
2711static struct clk gpt2_ick = {
2712 .name = "gpt2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002713 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002714 .parent = &per_l4_ick,
2715 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2716 .enable_bit = OMAP3430_EN_GPT2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002717 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002718 .recalc = &followparent_recalc,
2719};
2720
2721static struct clk mcbsp2_ick = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002722 .name = "mcbsp_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002723 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002724 .id = 2,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002725 .parent = &per_l4_ick,
2726 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2727 .enable_bit = OMAP3430_EN_MCBSP2_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002728 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002729 .recalc = &followparent_recalc,
2730};
2731
2732static struct clk mcbsp3_ick = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002733 .name = "mcbsp_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002734 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002735 .id = 3,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002736 .parent = &per_l4_ick,
2737 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2738 .enable_bit = OMAP3430_EN_MCBSP3_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002739 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002740 .recalc = &followparent_recalc,
2741};
2742
2743static struct clk mcbsp4_ick = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002744 .name = "mcbsp_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00002745 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002746 .id = 4,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002747 .parent = &per_l4_ick,
2748 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2749 .enable_bit = OMAP3430_EN_MCBSP4_SHIFT,
Paul Walmsley333943b2008-08-19 11:08:45 +03002750 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002751 .recalc = &followparent_recalc,
2752};
2753
2754static const struct clksel mcbsp_234_clksel[] = {
Paul Walmsley9cfd9852009-01-27 19:13:02 -07002755 { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
2756 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
Paul Walmsleyb045d082008-03-18 11:24:28 +02002757 { .parent = NULL }
2758};
2759
2760static struct clk mcbsp2_fck = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002761 .name = "mcbsp_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002762 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002763 .id = 2,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002764 .init = &omap2_init_clksel_parent,
2765 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2766 .enable_bit = OMAP3430_EN_MCBSP2_SHIFT,
2767 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
2768 .clksel_mask = OMAP2_MCBSP2_CLKS_MASK,
2769 .clksel = mcbsp_234_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002770 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002771 .recalc = &omap2_clksel_recalc,
2772};
2773
2774static struct clk mcbsp3_fck = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002775 .name = "mcbsp_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002776 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002777 .id = 3,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002778 .init = &omap2_init_clksel_parent,
2779 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2780 .enable_bit = OMAP3430_EN_MCBSP3_SHIFT,
2781 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
2782 .clksel_mask = OMAP2_MCBSP3_CLKS_MASK,
2783 .clksel = mcbsp_234_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002784 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002785 .recalc = &omap2_clksel_recalc,
2786};
2787
2788static struct clk mcbsp4_fck = {
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002789 .name = "mcbsp_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002790 .ops = &clkops_omap2_dflt_wait,
Eduardo Valentin78673bc2008-07-03 12:24:40 +03002791 .id = 4,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002792 .init = &omap2_init_clksel_parent,
2793 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2794 .enable_bit = OMAP3430_EN_MCBSP4_SHIFT,
2795 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
2796 .clksel_mask = OMAP2_MCBSP4_CLKS_MASK,
2797 .clksel = mcbsp_234_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002798 .clkdm_name = "per_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002799 .recalc = &omap2_clksel_recalc,
2800};
2801
2802/* EMU clocks */
2803
2804/* More information: ARM Cortex-A8 Technical Reference Manual, sect 10.1 */
2805
2806static const struct clksel_rate emu_src_sys_rates[] = {
2807 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
2808 { .div = 0 },
2809};
2810
2811static const struct clksel_rate emu_src_core_rates[] = {
2812 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
2813 { .div = 0 },
2814};
2815
2816static const struct clksel_rate emu_src_per_rates[] = {
2817 { .div = 1, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
2818 { .div = 0 },
2819};
2820
2821static const struct clksel_rate emu_src_mpu_rates[] = {
2822 { .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
2823 { .div = 0 },
2824};
2825
2826static const struct clksel emu_src_clksel[] = {
2827 { .parent = &sys_ck, .rates = emu_src_sys_rates },
2828 { .parent = &emu_core_alwon_ck, .rates = emu_src_core_rates },
2829 { .parent = &emu_per_alwon_ck, .rates = emu_src_per_rates },
2830 { .parent = &emu_mpu_alwon_ck, .rates = emu_src_mpu_rates },
2831 { .parent = NULL },
2832};
2833
2834/*
2835 * Like the clkout_src clocks, emu_src_clk is a virtual clock, existing only
2836 * to switch the source of some of the EMU clocks.
2837 * XXX Are there CLKEN bits for these EMU clks?
2838 */
2839static struct clk emu_src_ck = {
2840 .name = "emu_src_ck",
Russell King897dcde2008-11-04 16:35:03 +00002841 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002842 .init = &omap2_init_clksel_parent,
2843 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2844 .clksel_mask = OMAP3430_MUX_CTRL_MASK,
2845 .clksel = emu_src_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002846 .clkdm_name = "emu_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002847 .recalc = &omap2_clksel_recalc,
2848};
2849
2850static const struct clksel_rate pclk_emu_rates[] = {
2851 { .div = 2, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
2852 { .div = 3, .val = 3, .flags = RATE_IN_343X },
2853 { .div = 4, .val = 4, .flags = RATE_IN_343X },
2854 { .div = 6, .val = 6, .flags = RATE_IN_343X },
2855 { .div = 0 },
2856};
2857
2858static const struct clksel pclk_emu_clksel[] = {
2859 { .parent = &emu_src_ck, .rates = pclk_emu_rates },
2860 { .parent = NULL },
2861};
2862
2863static struct clk pclk_fck = {
2864 .name = "pclk_fck",
Russell King897dcde2008-11-04 16:35:03 +00002865 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002866 .init = &omap2_init_clksel_parent,
2867 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2868 .clksel_mask = OMAP3430_CLKSEL_PCLK_MASK,
2869 .clksel = pclk_emu_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002870 .clkdm_name = "emu_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002871 .recalc = &omap2_clksel_recalc,
2872};
2873
2874static const struct clksel_rate pclkx2_emu_rates[] = {
2875 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
2876 { .div = 2, .val = 2, .flags = RATE_IN_343X },
2877 { .div = 3, .val = 3, .flags = RATE_IN_343X },
2878 { .div = 0 },
2879};
2880
2881static const struct clksel pclkx2_emu_clksel[] = {
2882 { .parent = &emu_src_ck, .rates = pclkx2_emu_rates },
2883 { .parent = NULL },
2884};
2885
2886static struct clk pclkx2_fck = {
2887 .name = "pclkx2_fck",
Russell King897dcde2008-11-04 16:35:03 +00002888 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002889 .init = &omap2_init_clksel_parent,
2890 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2891 .clksel_mask = OMAP3430_CLKSEL_PCLKX2_MASK,
2892 .clksel = pclkx2_emu_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002893 .clkdm_name = "emu_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002894 .recalc = &omap2_clksel_recalc,
2895};
2896
2897static const struct clksel atclk_emu_clksel[] = {
2898 { .parent = &emu_src_ck, .rates = div2_rates },
2899 { .parent = NULL },
2900};
2901
2902static struct clk atclk_fck = {
2903 .name = "atclk_fck",
Russell King897dcde2008-11-04 16:35:03 +00002904 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002905 .init = &omap2_init_clksel_parent,
2906 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2907 .clksel_mask = OMAP3430_CLKSEL_ATCLK_MASK,
2908 .clksel = atclk_emu_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002909 .clkdm_name = "emu_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002910 .recalc = &omap2_clksel_recalc,
2911};
2912
2913static struct clk traceclk_src_fck = {
2914 .name = "traceclk_src_fck",
Russell King897dcde2008-11-04 16:35:03 +00002915 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002916 .init = &omap2_init_clksel_parent,
2917 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2918 .clksel_mask = OMAP3430_TRACE_MUX_CTRL_MASK,
2919 .clksel = emu_src_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002920 .clkdm_name = "emu_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002921 .recalc = &omap2_clksel_recalc,
2922};
2923
2924static const struct clksel_rate traceclk_rates[] = {
2925 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
2926 { .div = 2, .val = 2, .flags = RATE_IN_343X },
2927 { .div = 4, .val = 4, .flags = RATE_IN_343X },
2928 { .div = 0 },
2929};
2930
2931static const struct clksel traceclk_clksel[] = {
2932 { .parent = &traceclk_src_fck, .rates = traceclk_rates },
2933 { .parent = NULL },
2934};
2935
2936static struct clk traceclk_fck = {
2937 .name = "traceclk_fck",
Russell King897dcde2008-11-04 16:35:03 +00002938 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002939 .init = &omap2_init_clksel_parent,
2940 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2941 .clksel_mask = OMAP3430_CLKSEL_TRACECLK_MASK,
2942 .clksel = traceclk_clksel,
Paul Walmsley333943b2008-08-19 11:08:45 +03002943 .clkdm_name = "emu_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002944 .recalc = &omap2_clksel_recalc,
2945};
2946
2947/* SR clocks */
2948
2949/* SmartReflex fclk (VDD1) */
2950static struct clk sr1_fck = {
2951 .name = "sr1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002952 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002953 .parent = &sys_ck,
2954 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2955 .enable_bit = OMAP3430_EN_SR1_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002956 .recalc = &followparent_recalc,
2957};
2958
2959/* SmartReflex fclk (VDD2) */
2960static struct clk sr2_fck = {
2961 .name = "sr2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002962 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002963 .parent = &sys_ck,
2964 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2965 .enable_bit = OMAP3430_EN_SR2_SHIFT,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002966 .recalc = &followparent_recalc,
2967};
2968
2969static struct clk sr_l4_ick = {
2970 .name = "sr_l4_ick",
Russell King897dcde2008-11-04 16:35:03 +00002971 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleyb045d082008-03-18 11:24:28 +02002972 .parent = &l4_ick,
Paul Walmsley333943b2008-08-19 11:08:45 +03002973 .clkdm_name = "core_l4_clkdm",
Paul Walmsleyb045d082008-03-18 11:24:28 +02002974 .recalc = &followparent_recalc,
2975};
2976
2977/* SECURE_32K_FCK clocks */
2978
2979static struct clk gpt12_fck = {
2980 .name = "gpt12_fck",
Russell King897dcde2008-11-04 16:35:03 +00002981 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002982 .parent = &secure_32k_fck,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002983 .recalc = &followparent_recalc,
2984};
2985
2986static struct clk wdt1_fck = {
2987 .name = "wdt1_fck",
Russell King897dcde2008-11-04 16:35:03 +00002988 .ops = &clkops_null,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002989 .parent = &secure_32k_fck,
Paul Walmsleyb045d082008-03-18 11:24:28 +02002990 .recalc = &followparent_recalc,
2991};
2992
Paul Walmsleyb045d082008-03-18 11:24:28 +02002993#endif