clock34xx.h 84.3 KB
Newer Older
P
Paul Walmsley 已提交
1 2 3 4 5 6 7
/*
 * OMAP3 clock framework
 *
 * Copyright (C) 2007-2008 Texas Instruments, Inc.
 * Copyright (C) 2007-2008 Nokia Corporation
 *
 * Written by Paul Walmsley
8 9 10 11 12 13 14 15 16
 * With many device clock fixes by Kevin Hilman and Jouni Högander
 * DPLL bypass clock support added by Roman Tereshonkov
 *
 */

/*
 * Virtual clocks are introduced as convenient tools.
 * They are sources for other clocks and not supposed
 * to be requested from drivers directly.
P
Paul Walmsley 已提交
17 18 19 20 21
 */

#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H

22
#include <plat/control.h>
P
Paul Walmsley 已提交
23 24 25 26 27 28 29

#include "clock.h"
#include "cm.h"
#include "cm-regbits-34xx.h"
#include "prm.h"
#include "prm-regbits-34xx.h"

30 31
#define OMAP_CM_REGADDR		OMAP34XX_CM_REGADDR

32 33
static unsigned long omap3_dpll_recalc(struct clk *clk);
static unsigned long omap3_clkoutx2_recalc(struct clk *clk);
34 35 36
static void omap3_dpll_allow_idle(struct clk *clk);
static void omap3_dpll_deny_idle(struct clk *clk);
static u32 omap3_dpll_autoidle_read(struct clk *clk);
37 38
static int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate);
static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate);
39
static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate);
P
Paul Walmsley 已提交
40

41 42 43 44
/* Maximum DPLL multiplier, divider values for OMAP3 */
#define OMAP3_MAX_DPLL_MULT		2048
#define OMAP3_MAX_DPLL_DIV		128

P
Paul Walmsley 已提交
45 46 47 48 49 50 51 52
/*
 * DPLL1 supplies clock to the MPU.
 * DPLL2 supplies clock to the IVA2.
 * DPLL3 supplies CORE domain clocks.
 * DPLL4 supplies peripheral clocks.
 * DPLL5 supplies other peripheral clocks (USBHOST, USIM).
 */

53 54 55 56
/* Forward declarations for DPLL bypass clocks */
static struct clk dpll1_fck;
static struct clk dpll2_fck;

57 58 59 60 61
/* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */
#define DPLL_LOW_POWER_STOP		0x1
#define DPLL_LOW_POWER_BYPASS		0x5
#define DPLL_LOCKED			0x7

P
Paul Walmsley 已提交
62 63 64 65 66
/* PRM CLOCKS */

/* According to timer32k.c, this is a 32768Hz clock, not a 32000Hz clock. */
static struct clk omap_32k_fck = {
	.name		= "omap_32k_fck",
67
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
68
	.rate		= 32768,
69
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
70 71 72 73
};

static struct clk secure_32k_fck = {
	.name		= "secure_32k_fck",
74
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
75
	.rate		= 32768,
76
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
77 78 79 80 81
};

/* Virtual source clocks for osc_sys_ck */
static struct clk virt_12m_ck = {
	.name		= "virt_12m_ck",
82
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
83
	.rate		= 12000000,
84
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
85 86 87 88
};

static struct clk virt_13m_ck = {
	.name		= "virt_13m_ck",
89
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
90
	.rate		= 13000000,
91
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
92 93 94 95
};

static struct clk virt_16_8m_ck = {
	.name		= "virt_16_8m_ck",
96
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
97
	.rate		= 16800000,
98
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
99 100 101 102
};

static struct clk virt_19_2m_ck = {
	.name		= "virt_19_2m_ck",
103
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
104
	.rate		= 19200000,
105
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
106 107 108 109
};

static struct clk virt_26m_ck = {
	.name		= "virt_26m_ck",
110
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
111
	.rate		= 26000000,
112
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
113 114 115 116
};

static struct clk virt_38_4m_ck = {
	.name		= "virt_38_4m_ck",
117
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
118
	.rate		= 38400000,
119
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
};

static const struct clksel_rate osc_sys_12m_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate osc_sys_13m_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate osc_sys_16_8m_rates[] = {
	{ .div = 1, .val = 5, .flags = RATE_IN_3430ES2 | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate osc_sys_19_2m_rates[] = {
	{ .div = 1, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate osc_sys_26m_rates[] = {
	{ .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate osc_sys_38_4m_rates[] = {
	{ .div = 1, .val = 4, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel osc_sys_clksel[] = {
	{ .parent = &virt_12m_ck,   .rates = osc_sys_12m_rates },
	{ .parent = &virt_13m_ck,   .rates = osc_sys_13m_rates },
	{ .parent = &virt_16_8m_ck, .rates = osc_sys_16_8m_rates },
	{ .parent = &virt_19_2m_ck, .rates = osc_sys_19_2m_rates },
	{ .parent = &virt_26m_ck,   .rates = osc_sys_26m_rates },
	{ .parent = &virt_38_4m_ck, .rates = osc_sys_38_4m_rates },
	{ .parent = NULL },
};

/* Oscillator clock */
/* 12, 13, 16.8, 19.2, 26, or 38.4 MHz */
static struct clk osc_sys_ck = {
	.name		= "osc_sys_ck",
166
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
167 168 169 170 171
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP3430_PRM_CLKSEL,
	.clksel_mask	= OMAP3430_SYS_CLKIN_SEL_MASK,
	.clksel		= osc_sys_clksel,
	/* REVISIT: deal with autoextclkmode? */
172
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel_rate div2_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_343X },
	{ .div = 0 }
};

static const struct clksel sys_clksel[] = {
	{ .parent = &osc_sys_ck, .rates = div2_rates },
	{ .parent = NULL }
};

/* Latency: this clock is only enabled after PRM_CLKSETUP.SETUP_TIME */
/* Feeds DPLLs - divided first by PRM_CLKSRC_CTRL.SYSCLKDIV? */
static struct clk sys_ck = {
	.name		= "sys_ck",
191
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
192 193 194 195 196 197 198 199 200 201
	.parent		= &osc_sys_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP3430_PRM_CLKSRC_CTRL,
	.clksel_mask	= OMAP_SYSCLKDIV_MASK,
	.clksel		= sys_clksel,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk sys_altclk = {
	.name		= "sys_altclk",
202
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
203 204 205 206 207
};

/* Optional external clock input for some McBSPs */
static struct clk mcbsp_clks = {
	.name		= "mcbsp_clks",
208
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
209 210 211 212 213 214
};

/* PRM EXTERNAL CLOCK OUTPUT */

static struct clk sys_clkout1 = {
	.name		= "sys_clkout1",
215
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
216 217 218 219 220 221 222 223 224 225
	.parent		= &osc_sys_ck,
	.enable_reg	= OMAP3430_PRM_CLKOUT_CTRL,
	.enable_bit	= OMAP3430_CLKOUT_EN_SHIFT,
	.recalc		= &followparent_recalc,
};

/* DPLLS */

/* CM CLOCKS */

226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
static const struct clksel_rate div16_dpll_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_343X },
	{ .div = 3, .val = 3, .flags = RATE_IN_343X },
	{ .div = 4, .val = 4, .flags = RATE_IN_343X },
	{ .div = 5, .val = 5, .flags = RATE_IN_343X },
	{ .div = 6, .val = 6, .flags = RATE_IN_343X },
	{ .div = 7, .val = 7, .flags = RATE_IN_343X },
	{ .div = 8, .val = 8, .flags = RATE_IN_343X },
	{ .div = 9, .val = 9, .flags = RATE_IN_343X },
	{ .div = 10, .val = 10, .flags = RATE_IN_343X },
	{ .div = 11, .val = 11, .flags = RATE_IN_343X },
	{ .div = 12, .val = 12, .flags = RATE_IN_343X },
	{ .div = 13, .val = 13, .flags = RATE_IN_343X },
	{ .div = 14, .val = 14, .flags = RATE_IN_343X },
	{ .div = 15, .val = 15, .flags = RATE_IN_343X },
	{ .div = 16, .val = 16, .flags = RATE_IN_343X },
	{ .div = 0 }
};

P
Paul Walmsley 已提交
246 247 248
/* DPLL1 */
/* MPU clock source */
/* Type: DPLL */
249
static struct dpll_data dpll1_dd = {
P
Paul Walmsley 已提交
250 251 252
	.mult_div1_reg	= OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
	.mult_mask	= OMAP3430_MPU_DPLL_MULT_MASK,
	.div1_mask	= OMAP3430_MPU_DPLL_DIV_MASK,
253 254
	.clk_bypass	= &dpll1_fck,
	.clk_ref	= &sys_ck,
255
	.freqsel_mask	= OMAP3430_MPU_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
256 257
	.control_reg	= OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
	.enable_mask	= OMAP3430_EN_MPU_DPLL_MASK,
258
	.modes		= (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
P
Paul Walmsley 已提交
259 260 261
	.auto_recal_bit	= OMAP3430_EN_MPU_DPLL_DRIFTGUARD_SHIFT,
	.recal_en_bit	= OMAP3430_MPU_DPLL_RECAL_EN_SHIFT,
	.recal_st_bit	= OMAP3430_MPU_DPLL_ST_SHIFT,
262 263 264
	.autoidle_reg	= OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL),
	.autoidle_mask	= OMAP3430_AUTO_MPU_DPLL_MASK,
	.idlest_reg	= OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
265
	.idlest_mask	= OMAP3430_ST_MPU_CLK_MASK,
266
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
267
	.min_divider	= 1,
268 269
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
270 271 272 273
};

static struct clk dpll1_ck = {
	.name		= "dpll1_ck",
274
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
275 276
	.parent		= &sys_ck,
	.dpll_data	= &dpll1_dd,
277
	.round_rate	= &omap2_dpll_round_rate,
278
	.set_rate	= &omap3_noncore_dpll_set_rate,
279
	.clkdm_name	= "dpll1_clkdm",
P
Paul Walmsley 已提交
280 281 282 283
	.recalc		= &omap3_dpll_recalc,
};

/*
284 285
 * This virtual clock provides the CLKOUTX2 output from the DPLL if the
 * DPLL isn't bypassed.
P
Paul Walmsley 已提交
286
 */
287 288
static struct clk dpll1_x2_ck = {
	.name		= "dpll1_x2_ck",
289
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
290
	.parent		= &dpll1_ck,
291
	.clkdm_name	= "dpll1_clkdm",
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
	.recalc		= &omap3_clkoutx2_recalc,
};

/* On DPLL1, unlike other DPLLs, the divider is downstream from CLKOUTX2 */
static const struct clksel div16_dpll1_x2m2_clksel[] = {
	{ .parent = &dpll1_x2_ck, .rates = div16_dpll_rates },
	{ .parent = NULL }
};

/*
 * Does not exist in the TRM - needed to separate the M2 divider from
 * bypass selection in mpu_ck
 */
static struct clk dpll1_x2m2_ck = {
	.name		= "dpll1_x2m2_ck",
307
	.ops		= &clkops_null,
308 309 310 311 312
	.parent		= &dpll1_x2_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL),
	.clksel_mask	= OMAP3430_MPU_DPLL_CLKOUT_DIV_MASK,
	.clksel		= div16_dpll1_x2m2_clksel,
313
	.clkdm_name	= "dpll1_clkdm",
314
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
315 316 317 318 319 320
};

/* DPLL2 */
/* IVA2 clock source */
/* Type: DPLL */

321
static struct dpll_data dpll2_dd = {
P
Paul Walmsley 已提交
322 323 324
	.mult_div1_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
	.mult_mask	= OMAP3430_IVA2_DPLL_MULT_MASK,
	.div1_mask	= OMAP3430_IVA2_DPLL_DIV_MASK,
325 326
	.clk_bypass	= &dpll2_fck,
	.clk_ref	= &sys_ck,
327
	.freqsel_mask	= OMAP3430_IVA2_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
328 329
	.control_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
	.enable_mask	= OMAP3430_EN_IVA2_DPLL_MASK,
330 331
	.modes		= (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
				(1 << DPLL_LOW_POWER_BYPASS),
P
Paul Walmsley 已提交
332 333 334
	.auto_recal_bit	= OMAP3430_EN_IVA2_DPLL_DRIFTGUARD_SHIFT,
	.recal_en_bit	= OMAP3430_PRM_IRQENABLE_MPU_IVA2_DPLL_RECAL_EN_SHIFT,
	.recal_st_bit	= OMAP3430_PRM_IRQSTATUS_MPU_IVA2_DPLL_ST_SHIFT,
335 336 337
	.autoidle_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL),
	.autoidle_mask	= OMAP3430_AUTO_IVA2_DPLL_MASK,
	.idlest_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL),
338
	.idlest_mask	= OMAP3430_ST_IVA2_CLK_MASK,
339
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
340
	.min_divider	= 1,
341 342
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
343 344 345 346
};

static struct clk dpll2_ck = {
	.name		= "dpll2_ck",
347
	.ops		= &clkops_noncore_dpll_ops,
P
Paul Walmsley 已提交
348 349
	.parent		= &sys_ck,
	.dpll_data	= &dpll2_dd,
350
	.round_rate	= &omap2_dpll_round_rate,
351
	.set_rate	= &omap3_noncore_dpll_set_rate,
352
	.clkdm_name	= "dpll2_clkdm",
P
Paul Walmsley 已提交
353 354 355
	.recalc		= &omap3_dpll_recalc,
};

356 357 358 359 360 361 362 363 364 365 366
static const struct clksel div16_dpll2_m2x2_clksel[] = {
	{ .parent = &dpll2_ck, .rates = div16_dpll_rates },
	{ .parent = NULL }
};

/*
 * The TRM is conflicted on whether IVA2 clock comes from DPLL2 CLKOUT
 * or CLKOUTX2. CLKOUT seems most plausible.
 */
static struct clk dpll2_m2_ck = {
	.name		= "dpll2_m2_ck",
367
	.ops		= &clkops_null,
368 369 370 371 372 373
	.parent		= &dpll2_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD,
					  OMAP3430_CM_CLKSEL2_PLL),
	.clksel_mask	= OMAP3430_IVA2_DPLL_CLKOUT_DIV_MASK,
	.clksel		= div16_dpll2_m2x2_clksel,
374
	.clkdm_name	= "dpll2_clkdm",
375 376 377
	.recalc		= &omap2_clksel_recalc,
};

378 379 380 381 382
/*
 * DPLL3
 * Source clock for all interfaces and for some device fclks
 * REVISIT: Also supports fast relock bypass - not included below
 */
383
static struct dpll_data dpll3_dd = {
P
Paul Walmsley 已提交
384 385 386
	.mult_div1_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.mult_mask	= OMAP3430_CORE_DPLL_MULT_MASK,
	.div1_mask	= OMAP3430_CORE_DPLL_DIV_MASK,
387 388
	.clk_bypass	= &sys_ck,
	.clk_ref	= &sys_ck,
389
	.freqsel_mask	= OMAP3430_CORE_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
390 391 392 393 394
	.control_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_mask	= OMAP3430_EN_CORE_DPLL_MASK,
	.auto_recal_bit	= OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT,
	.recal_en_bit	= OMAP3430_CORE_DPLL_RECAL_EN_SHIFT,
	.recal_st_bit	= OMAP3430_CORE_DPLL_ST_SHIFT,
395 396
	.autoidle_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
	.autoidle_mask	= OMAP3430_AUTO_CORE_DPLL_MASK,
397 398
	.idlest_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
	.idlest_mask	= OMAP3430_ST_CORE_CLK_MASK,
399
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
400
	.min_divider	= 1,
401 402
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
403 404 405 406
};

static struct clk dpll3_ck = {
	.name		= "dpll3_ck",
407
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
408 409
	.parent		= &sys_ck,
	.dpll_data	= &dpll3_dd,
410
	.round_rate	= &omap2_dpll_round_rate,
411
	.clkdm_name	= "dpll3_clkdm",
P
Paul Walmsley 已提交
412 413 414
	.recalc		= &omap3_dpll_recalc,
};

415 416 417 418 419 420
/*
 * This virtual clock provides the CLKOUTX2 output from the DPLL if the
 * DPLL isn't bypassed
 */
static struct clk dpll3_x2_ck = {
	.name		= "dpll3_x2_ck",
421
	.ops		= &clkops_null,
422
	.parent		= &dpll3_ck,
423
	.clkdm_name	= "dpll3_clkdm",
424
	.recalc		= &omap3_clkoutx2_recalc,
P
Paul Walmsley 已提交
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466
};

static const struct clksel_rate div31_dpll3_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_343X },
	{ .div = 3, .val = 3, .flags = RATE_IN_3430ES2 },
	{ .div = 4, .val = 4, .flags = RATE_IN_3430ES2 },
	{ .div = 5, .val = 5, .flags = RATE_IN_3430ES2 },
	{ .div = 6, .val = 6, .flags = RATE_IN_3430ES2 },
	{ .div = 7, .val = 7, .flags = RATE_IN_3430ES2 },
	{ .div = 8, .val = 8, .flags = RATE_IN_3430ES2 },
	{ .div = 9, .val = 9, .flags = RATE_IN_3430ES2 },
	{ .div = 10, .val = 10, .flags = RATE_IN_3430ES2 },
	{ .div = 11, .val = 11, .flags = RATE_IN_3430ES2 },
	{ .div = 12, .val = 12, .flags = RATE_IN_3430ES2 },
	{ .div = 13, .val = 13, .flags = RATE_IN_3430ES2 },
	{ .div = 14, .val = 14, .flags = RATE_IN_3430ES2 },
	{ .div = 15, .val = 15, .flags = RATE_IN_3430ES2 },
	{ .div = 16, .val = 16, .flags = RATE_IN_3430ES2 },
	{ .div = 17, .val = 17, .flags = RATE_IN_3430ES2 },
	{ .div = 18, .val = 18, .flags = RATE_IN_3430ES2 },
	{ .div = 19, .val = 19, .flags = RATE_IN_3430ES2 },
	{ .div = 20, .val = 20, .flags = RATE_IN_3430ES2 },
	{ .div = 21, .val = 21, .flags = RATE_IN_3430ES2 },
	{ .div = 22, .val = 22, .flags = RATE_IN_3430ES2 },
	{ .div = 23, .val = 23, .flags = RATE_IN_3430ES2 },
	{ .div = 24, .val = 24, .flags = RATE_IN_3430ES2 },
	{ .div = 25, .val = 25, .flags = RATE_IN_3430ES2 },
	{ .div = 26, .val = 26, .flags = RATE_IN_3430ES2 },
	{ .div = 27, .val = 27, .flags = RATE_IN_3430ES2 },
	{ .div = 28, .val = 28, .flags = RATE_IN_3430ES2 },
	{ .div = 29, .val = 29, .flags = RATE_IN_3430ES2 },
	{ .div = 30, .val = 30, .flags = RATE_IN_3430ES2 },
	{ .div = 31, .val = 31, .flags = RATE_IN_3430ES2 },
	{ .div = 0 },
};

static const struct clksel div31_dpll3m2_clksel[] = {
	{ .parent = &dpll3_ck, .rates = div31_dpll3_rates },
	{ .parent = NULL }
};

467
/* DPLL3 output M2 - primary control point for CORE speed */
P
Paul Walmsley 已提交
468 469
static struct clk dpll3_m2_ck = {
	.name		= "dpll3_m2_ck",
470
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
471 472 473 474 475
	.parent		= &dpll3_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK,
	.clksel		= div31_dpll3m2_clksel,
476
	.clkdm_name	= "dpll3_clkdm",
477 478
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap3_core_dpll_m2_set_rate,
P
Paul Walmsley 已提交
479 480 481 482 483
	.recalc		= &omap2_clksel_recalc,
};

static struct clk core_ck = {
	.name		= "core_ck",
484
	.ops		= &clkops_null,
485 486
	.parent		= &dpll3_m2_ck,
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
487 488 489 490
};

static struct clk dpll3_m2x2_ck = {
	.name		= "dpll3_m2x2_ck",
491
	.ops		= &clkops_null,
492
	.parent		= &dpll3_m2_ck,
493
	.clkdm_name	= "dpll3_clkdm",
494
	.recalc		= &omap3_clkoutx2_recalc,
495 496 497 498 499 500 501 502 503 504 505
};

/* The PWRDN bit is apparently only available on 3430ES2 and above */
static const struct clksel div16_dpll3_clksel[] = {
	{ .parent = &dpll3_ck, .rates = div16_dpll_rates },
	{ .parent = NULL }
};

/* This virtual clock is the source for dpll3_m3x2_ck */
static struct clk dpll3_m3_ck = {
	.name		= "dpll3_m3_ck",
506
	.ops		= &clkops_null,
507 508 509 510 511
	.parent		= &dpll3_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_DIV_DPLL3_MASK,
	.clksel		= div16_dpll3_clksel,
512
	.clkdm_name	= "dpll3_clkdm",
513
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
514 515 516 517 518
};

/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll3_m3x2_ck = {
	.name		= "dpll3_m3x2_ck",
519
	.ops		= &clkops_omap2_dflt_wait,
520
	.parent		= &dpll3_m3_ck,
P
Paul Walmsley 已提交
521 522
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_EMU_CORE_SHIFT,
523
	.flags		= INVERT_ENABLE,
524
	.clkdm_name	= "dpll3_clkdm",
525
	.recalc		= &omap3_clkoutx2_recalc,
P
Paul Walmsley 已提交
526 527 528 529
};

static struct clk emu_core_alwon_ck = {
	.name		= "emu_core_alwon_ck",
530
	.ops		= &clkops_null,
531
	.parent		= &dpll3_m3x2_ck,
532
	.clkdm_name	= "dpll3_clkdm",
533
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
534 535 536 537 538
};

/* DPLL4 */
/* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */
/* Type: DPLL */
539
static struct dpll_data dpll4_dd = {
P
Paul Walmsley 已提交
540 541 542
	.mult_div1_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
	.mult_mask	= OMAP3430_PERIPH_DPLL_MULT_MASK,
	.div1_mask	= OMAP3430_PERIPH_DPLL_DIV_MASK,
543 544
	.clk_bypass	= &sys_ck,
	.clk_ref	= &sys_ck,
545
	.freqsel_mask	= OMAP3430_PERIPH_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
546 547
	.control_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_mask	= OMAP3430_EN_PERIPH_DPLL_MASK,
548
	.modes		= (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
P
Paul Walmsley 已提交
549 550 551
	.auto_recal_bit	= OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT,
	.recal_en_bit	= OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT,
	.recal_st_bit	= OMAP3430_PERIPH_DPLL_ST_SHIFT,
552 553 554
	.autoidle_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
	.autoidle_mask	= OMAP3430_AUTO_PERIPH_DPLL_MASK,
	.idlest_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
555
	.idlest_mask	= OMAP3430_ST_PERIPH_CLK_MASK,
556
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
557
	.min_divider	= 1,
558 559
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
560 561 562 563
};

static struct clk dpll4_ck = {
	.name		= "dpll4_ck",
564
	.ops		= &clkops_noncore_dpll_ops,
P
Paul Walmsley 已提交
565 566
	.parent		= &sys_ck,
	.dpll_data	= &dpll4_dd,
567
	.round_rate	= &omap2_dpll_round_rate,
568
	.set_rate	= &omap3_dpll4_set_rate,
569
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
570 571 572 573 574
	.recalc		= &omap3_dpll_recalc,
};

/*
 * This virtual clock provides the CLKOUTX2 output from the DPLL if the
575 576
 * DPLL isn't bypassed --
 * XXX does this serve any downstream clocks?
P
Paul Walmsley 已提交
577 578 579
 */
static struct clk dpll4_x2_ck = {
	.name		= "dpll4_x2_ck",
580
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
581
	.parent		= &dpll4_ck,
582
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
583 584 585 586
	.recalc		= &omap3_clkoutx2_recalc,
};

static const struct clksel div16_dpll4_clksel[] = {
587
	{ .parent = &dpll4_ck, .rates = div16_dpll_rates },
P
Paul Walmsley 已提交
588 589 590
	{ .parent = NULL }
};

591 592 593
/* This virtual clock is the source for dpll4_m2x2_ck */
static struct clk dpll4_m2_ck = {
	.name		= "dpll4_m2_ck",
594
	.ops		= &clkops_null,
595 596 597 598 599
	.parent		= &dpll4_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3),
	.clksel_mask	= OMAP3430_DIV_96M_MASK,
	.clksel		= div16_dpll4_clksel,
600
	.clkdm_name	= "dpll4_clkdm",
601 602 603
	.recalc		= &omap2_clksel_recalc,
};

P
Paul Walmsley 已提交
604 605 606
/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll4_m2x2_ck = {
	.name		= "dpll4_m2x2_ck",
607
	.ops		= &clkops_omap2_dflt_wait,
608
	.parent		= &dpll4_m2_ck,
P
Paul Walmsley 已提交
609 610
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_96M_SHIFT,
611
	.flags		= INVERT_ENABLE,
612
	.clkdm_name	= "dpll4_clkdm",
613 614 615
	.recalc		= &omap3_clkoutx2_recalc,
};

616 617 618 619 620 621
/*
 * DPLL4 generates DPLL4_M2X2_CLK which is then routed into the PRM as
 * PRM_96M_ALWON_(F)CLK.  Two clocks then emerge from the PRM:
 * 96M_ALWON_FCLK (called "omap_96m_alwon_fck" below) and
 * CM_96K_(F)CLK.
 */
P
Paul Walmsley 已提交
622 623
static struct clk omap_96m_alwon_fck = {
	.name		= "omap_96m_alwon_fck",
624
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
625
	.parent		= &dpll4_m2x2_ck,
626
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
627 628
};

629 630
static struct clk cm_96m_fck = {
	.name		= "cm_96m_fck",
631
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
632 633 634 635
	.parent		= &omap_96m_alwon_fck,
	.recalc		= &followparent_recalc,
};

636 637 638 639 640 641 642 643 644 645 646 647 648
static const struct clksel_rate omap_96m_dpll_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate omap_96m_sys_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel omap_96m_fck_clksel[] = {
	{ .parent = &cm_96m_fck, .rates = omap_96m_dpll_rates },
	{ .parent = &sys_ck,	 .rates = omap_96m_sys_rates },
649 650 651
	{ .parent = NULL }
};

652 653
static struct clk omap_96m_fck = {
	.name		= "omap_96m_fck",
654
	.ops		= &clkops_null,
655
	.parent		= &sys_ck,
656
	.init		= &omap2_init_clksel_parent,
657 658 659
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_SOURCE_96M_MASK,
	.clksel		= omap_96m_fck_clksel,
660 661 662 663 664 665
	.recalc		= &omap2_clksel_recalc,
};

/* This virtual clock is the source for dpll4_m3x2_ck */
static struct clk dpll4_m3_ck = {
	.name		= "dpll4_m3_ck",
666
	.ops		= &clkops_null,
667 668 669 670 671
	.parent		= &dpll4_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_TV_MASK,
	.clksel		= div16_dpll4_clksel,
672
	.clkdm_name	= "dpll4_clkdm",
673
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
674 675 676 677 678
};

/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll4_m3x2_ck = {
	.name		= "dpll4_m3x2_ck",
679
	.ops		= &clkops_omap2_dflt_wait,
680
	.parent		= &dpll4_m3_ck,
P
Paul Walmsley 已提交
681 682 683
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_TV_SHIFT,
684
	.flags		= INVERT_ENABLE,
685
	.clkdm_name	= "dpll4_clkdm",
686 687 688
	.recalc		= &omap3_clkoutx2_recalc,
};

P
Paul Walmsley 已提交
689 690 691 692 693 694 695 696 697 698 699
static const struct clksel_rate omap_54m_d4m3x2_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate omap_54m_alt_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel omap_54m_clksel[] = {
700
	{ .parent = &dpll4_m3x2_ck, .rates = omap_54m_d4m3x2_rates },
P
Paul Walmsley 已提交
701 702 703 704 705 706
	{ .parent = &sys_altclk,    .rates = omap_54m_alt_rates },
	{ .parent = NULL }
};

static struct clk omap_54m_fck = {
	.name		= "omap_54m_fck",
707
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
708 709
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
710
	.clksel_mask	= OMAP3430_SOURCE_54M_MASK,
P
Paul Walmsley 已提交
711 712 713 714
	.clksel		= omap_54m_clksel,
	.recalc		= &omap2_clksel_recalc,
};

715
static const struct clksel_rate omap_48m_cm96m_rates[] = {
P
Paul Walmsley 已提交
716 717 718 719 720 721 722 723 724 725
	{ .div = 2, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate omap_48m_alt_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel omap_48m_clksel[] = {
726
	{ .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates },
P
Paul Walmsley 已提交
727 728 729 730 731 732
	{ .parent = &sys_altclk, .rates = omap_48m_alt_rates },
	{ .parent = NULL }
};

static struct clk omap_48m_fck = {
	.name		= "omap_48m_fck",
733
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
734 735
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
736
	.clksel_mask	= OMAP3430_SOURCE_48M_MASK,
P
Paul Walmsley 已提交
737 738 739 740 741 742
	.clksel		= omap_48m_clksel,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk omap_12m_fck = {
	.name		= "omap_12m_fck",
743
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
744 745 746 747 748
	.parent		= &omap_48m_fck,
	.fixed_div	= 4,
	.recalc		= &omap2_fixed_divisor_recalc,
};

749 750 751
/* This virstual clock is the source for dpll4_m4x2_ck */
static struct clk dpll4_m4_ck = {
	.name		= "dpll4_m4_ck",
752
	.ops		= &clkops_null,
753 754 755 756 757
	.parent		= &dpll4_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_DSS1_MASK,
	.clksel		= div16_dpll4_clksel,
758
	.clkdm_name	= "dpll4_clkdm",
759
	.recalc		= &omap2_clksel_recalc,
760 761
	.set_rate	= &omap2_clksel_set_rate,
	.round_rate	= &omap2_clksel_round_rate,
762 763
};

P
Paul Walmsley 已提交
764 765 766
/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll4_m4x2_ck = {
	.name		= "dpll4_m4x2_ck",
767
	.ops		= &clkops_omap2_dflt_wait,
768
	.parent		= &dpll4_m4_ck,
P
Paul Walmsley 已提交
769 770
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_CAM_SHIFT,
771
	.flags		= INVERT_ENABLE,
772
	.clkdm_name	= "dpll4_clkdm",
773 774 775 776 777 778
	.recalc		= &omap3_clkoutx2_recalc,
};

/* This virtual clock is the source for dpll4_m5x2_ck */
static struct clk dpll4_m5_ck = {
	.name		= "dpll4_m5_ck",
779
	.ops		= &clkops_null,
780 781 782 783 784
	.parent		= &dpll4_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_CAM_MASK,
	.clksel		= div16_dpll4_clksel,
785
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
786 787 788 789 790 791
	.recalc		= &omap2_clksel_recalc,
};

/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll4_m5x2_ck = {
	.name		= "dpll4_m5x2_ck",
792
	.ops		= &clkops_omap2_dflt_wait,
793
	.parent		= &dpll4_m5_ck,
P
Paul Walmsley 已提交
794 795
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_CAM_SHIFT,
796
	.flags		= INVERT_ENABLE,
797
	.clkdm_name	= "dpll4_clkdm",
798 799 800 801 802 803
	.recalc		= &omap3_clkoutx2_recalc,
};

/* This virtual clock is the source for dpll4_m6x2_ck */
static struct clk dpll4_m6_ck = {
	.name		= "dpll4_m6_ck",
804
	.ops		= &clkops_null,
805 806 807 808 809
	.parent		= &dpll4_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_DIV_DPLL4_MASK,
	.clksel		= div16_dpll4_clksel,
810
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
811 812 813 814 815 816
	.recalc		= &omap2_clksel_recalc,
};

/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll4_m6x2_ck = {
	.name		= "dpll4_m6x2_ck",
817
	.ops		= &clkops_omap2_dflt_wait,
818
	.parent		= &dpll4_m6_ck,
P
Paul Walmsley 已提交
819 820 821
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
822
	.flags		= INVERT_ENABLE,
823
	.clkdm_name	= "dpll4_clkdm",
824
	.recalc		= &omap3_clkoutx2_recalc,
P
Paul Walmsley 已提交
825 826 827 828
};

static struct clk emu_per_alwon_ck = {
	.name		= "emu_per_alwon_ck",
829
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
830
	.parent		= &dpll4_m6x2_ck,
831
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
832 833 834 835 836 837 838
	.recalc		= &followparent_recalc,
};

/* DPLL5 */
/* Supplies 120MHz clock, USIM source clock */
/* Type: DPLL */
/* 3430ES2 only */
839
static struct dpll_data dpll5_dd = {
P
Paul Walmsley 已提交
840 841 842
	.mult_div1_reg	= OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4),
	.mult_mask	= OMAP3430ES2_PERIPH2_DPLL_MULT_MASK,
	.div1_mask	= OMAP3430ES2_PERIPH2_DPLL_DIV_MASK,
843 844
	.clk_bypass	= &sys_ck,
	.clk_ref	= &sys_ck,
845
	.freqsel_mask	= OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
846 847
	.control_reg	= OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
	.enable_mask	= OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
848
	.modes		= (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
P
Paul Walmsley 已提交
849 850 851
	.auto_recal_bit	= OMAP3430ES2_EN_PERIPH2_DPLL_DRIFTGUARD_SHIFT,
	.recal_en_bit	= OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT,
	.recal_st_bit	= OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT,
852 853 854
	.autoidle_reg	= OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL),
	.autoidle_mask	= OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK,
	.idlest_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
855
	.idlest_mask	= OMAP3430ES2_ST_PERIPH2_CLK_MASK,
856
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
857
	.min_divider	= 1,
858 859
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
860 861 862 863
};

static struct clk dpll5_ck = {
	.name		= "dpll5_ck",
864
	.ops		= &clkops_noncore_dpll_ops,
P
Paul Walmsley 已提交
865 866
	.parent		= &sys_ck,
	.dpll_data	= &dpll5_dd,
867
	.round_rate	= &omap2_dpll_round_rate,
868
	.set_rate	= &omap3_noncore_dpll_set_rate,
869
	.clkdm_name	= "dpll5_clkdm",
P
Paul Walmsley 已提交
870 871 872
	.recalc		= &omap3_dpll_recalc,
};

873
static const struct clksel div16_dpll5_clksel[] = {
P
Paul Walmsley 已提交
874 875 876 877 878 879
	{ .parent = &dpll5_ck, .rates = div16_dpll_rates },
	{ .parent = NULL }
};

static struct clk dpll5_m2_ck = {
	.name		= "dpll5_m2_ck",
880
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
881 882 883 884
	.parent		= &dpll5_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5),
	.clksel_mask	= OMAP3430ES2_DIV_120M_MASK,
885
	.clksel		= div16_dpll5_clksel,
886
	.clkdm_name	= "dpll5_clkdm",
P
Paul Walmsley 已提交
887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912
	.recalc		= &omap2_clksel_recalc,
};

/* CM EXTERNAL CLOCK OUTPUTS */

static const struct clksel_rate clkout2_src_core_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate clkout2_src_sys_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate clkout2_src_96m_rates[] = {
	{ .div = 1, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate clkout2_src_54m_rates[] = {
	{ .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel clkout2_src_clksel[] = {
913 914 915 916
	{ .parent = &core_ck,		.rates = clkout2_src_core_rates },
	{ .parent = &sys_ck,		.rates = clkout2_src_sys_rates },
	{ .parent = &cm_96m_fck,	.rates = clkout2_src_96m_rates },
	{ .parent = &omap_54m_fck,	.rates = clkout2_src_54m_rates },
P
Paul Walmsley 已提交
917 918 919 920 921
	{ .parent = NULL }
};

static struct clk clkout2_src_ck = {
	.name		= "clkout2_src_ck",
922
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
923 924 925 926 927 928
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP3430_CM_CLKOUT_CTRL,
	.enable_bit	= OMAP3430_CLKOUT2_EN_SHIFT,
	.clksel_reg	= OMAP3430_CM_CLKOUT_CTRL,
	.clksel_mask	= OMAP3430_CLKOUT2SOURCE_MASK,
	.clksel		= clkout2_src_clksel,
929
	.clkdm_name	= "core_clkdm",
P
Paul Walmsley 已提交
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel_rate sys_clkout2_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 2, .val = 1, .flags = RATE_IN_343X },
	{ .div = 4, .val = 2, .flags = RATE_IN_343X },
	{ .div = 8, .val = 3, .flags = RATE_IN_343X },
	{ .div = 16, .val = 4, .flags = RATE_IN_343X },
	{ .div = 0 },
};

static const struct clksel sys_clkout2_clksel[] = {
	{ .parent = &clkout2_src_ck, .rates = sys_clkout2_rates },
	{ .parent = NULL },
};

static struct clk sys_clkout2 = {
	.name		= "sys_clkout2",
949
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
950 951 952 953 954 955 956 957 958 959 960
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP3430_CM_CLKOUT_CTRL,
	.clksel_mask	= OMAP3430_CLKOUT2_DIV_MASK,
	.clksel		= sys_clkout2_clksel,
	.recalc		= &omap2_clksel_recalc,
};

/* CM OUTPUT CLOCKS */

static struct clk corex2_fck = {
	.name		= "corex2_fck",
961
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
962 963 964 965 966 967
	.parent		= &dpll3_m2x2_ck,
	.recalc		= &followparent_recalc,
};

/* DPLL power domain clock controls */

968 969 970 971 972 973 974 975 976
static const struct clksel_rate div4_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_343X },
	{ .div = 4, .val = 4, .flags = RATE_IN_343X },
	{ .div = 0 }
};

static const struct clksel div4_core_clksel[] = {
	{ .parent = &core_ck, .rates = div4_rates },
P
Paul Walmsley 已提交
977 978 979
	{ .parent = NULL }
};

980 981 982 983
/*
 * REVISIT: Are these in DPLL power domain or CM power domain? docs
 * may be inconsistent here?
 */
P
Paul Walmsley 已提交
984 985
static struct clk dpll1_fck = {
	.name		= "dpll1_fck",
986
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
987 988 989 990
	.parent		= &core_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
	.clksel_mask	= OMAP3430_MPU_CLK_SRC_MASK,
991
	.clksel		= div4_core_clksel,
P
Paul Walmsley 已提交
992 993 994
	.recalc		= &omap2_clksel_recalc,
};

995 996
static struct clk mpu_ck = {
	.name		= "mpu_ck",
997
	.ops		= &clkops_null,
998
	.parent		= &dpll1_x2m2_ck,
999
	.clkdm_name	= "mpu_clkdm",
1000
	.recalc		= &followparent_recalc,
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
};

/* arm_fck is divided by two when DPLL1 locked; otherwise, passthrough mpu_ck */
static const struct clksel_rate arm_fck_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 2, .val = 1, .flags = RATE_IN_343X },
	{ .div = 0 },
};

static const struct clksel arm_fck_clksel[] = {
	{ .parent = &mpu_ck, .rates = arm_fck_rates },
	{ .parent = NULL }
};

static struct clk arm_fck = {
	.name		= "arm_fck",
1017
	.ops		= &clkops_null,
1018 1019 1020 1021 1022
	.parent		= &mpu_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
	.clksel_mask	= OMAP3430_ST_MPU_CLK_MASK,
	.clksel		= arm_fck_clksel,
1023
	.clkdm_name	= "mpu_clkdm",
1024 1025 1026
	.recalc		= &omap2_clksel_recalc,
};

1027 1028
/* XXX What about neon_clkdm ? */

1029 1030 1031 1032 1033 1034
/*
 * REVISIT: This clock is never specifically defined in the 3430 TRM,
 * although it is referenced - so this is a guess
 */
static struct clk emu_mpu_alwon_ck = {
	.name		= "emu_mpu_alwon_ck",
1035
	.ops		= &clkops_null,
1036 1037 1038 1039
	.parent		= &mpu_ck,
	.recalc		= &followparent_recalc,
};

P
Paul Walmsley 已提交
1040 1041
static struct clk dpll2_fck = {
	.name		= "dpll2_fck",
1042
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1043 1044 1045 1046
	.parent		= &core_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
	.clksel_mask	= OMAP3430_IVA2_CLK_SRC_MASK,
1047
	.clksel		= div4_core_clksel,
P
Paul Walmsley 已提交
1048 1049 1050
	.recalc		= &omap2_clksel_recalc,
};

1051 1052
static struct clk iva2_ck = {
	.name		= "iva2_ck",
1053
	.ops		= &clkops_omap2_dflt_wait,
1054 1055
	.parent		= &dpll2_m2_ck,
	.init		= &omap2_init_clksel_parent,
1056 1057
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT,
1058
	.clkdm_name	= "iva2_clkdm",
1059
	.recalc		= &followparent_recalc,
1060 1061
};

P
Paul Walmsley 已提交
1062 1063
/* Common interface clocks */

1064 1065 1066 1067 1068
static const struct clksel div2_core_clksel[] = {
	{ .parent = &core_ck, .rates = div2_rates },
	{ .parent = NULL }
};

P
Paul Walmsley 已提交
1069 1070
static struct clk l3_ick = {
	.name		= "l3_ick",
1071
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1072 1073 1074 1075 1076
	.parent		= &core_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_L3_MASK,
	.clksel		= div2_core_clksel,
1077
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1078 1079 1080 1081 1082 1083 1084 1085 1086 1087
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel div2_l3_clksel[] = {
	{ .parent = &l3_ick, .rates = div2_rates },
	{ .parent = NULL }
};

static struct clk l4_ick = {
	.name		= "l4_ick",
1088
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1089 1090 1091 1092 1093
	.parent		= &l3_ick,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_L4_MASK,
	.clksel		= div2_l3_clksel,
1094
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105
	.recalc		= &omap2_clksel_recalc,

};

static const struct clksel div2_l4_clksel[] = {
	{ .parent = &l4_ick, .rates = div2_rates },
	{ .parent = NULL }
};

static struct clk rm_ick = {
	.name		= "rm_ick",
1106
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116
	.parent		= &l4_ick,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_RM_MASK,
	.clksel		= div2_l4_clksel,
	.recalc		= &omap2_clksel_recalc,
};

/* GFX power domain */

1117
/* GFX clocks are in 3430ES1 only. 3430ES2 and later uses the SGX instead */
P
Paul Walmsley 已提交
1118 1119 1120 1121 1122 1123

static const struct clksel gfx_l3_clksel[] = {
	{ .parent = &l3_ick, .rates = gfx_l3_rates },
	{ .parent = NULL }
};

1124 1125 1126
/* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */
static struct clk gfx_l3_ck = {
	.name		= "gfx_l3_ck",
1127
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1128 1129 1130 1131
	.parent		= &l3_ick,
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
	.enable_bit	= OMAP_EN_GFX_SHIFT,
1132 1133 1134 1135 1136
	.recalc		= &followparent_recalc,
};

static struct clk gfx_l3_fck = {
	.name		= "gfx_l3_fck",
1137
	.ops		= &clkops_null,
1138 1139
	.parent		= &gfx_l3_ck,
	.init		= &omap2_init_clksel_parent,
P
Paul Walmsley 已提交
1140 1141 1142
	.clksel_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP_CLKSEL_GFX_MASK,
	.clksel		= gfx_l3_clksel,
1143
	.clkdm_name	= "gfx_3430es1_clkdm",
P
Paul Walmsley 已提交
1144 1145 1146 1147 1148
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gfx_l3_ick = {
	.name		= "gfx_l3_ick",
1149
	.ops		= &clkops_null,
1150
	.parent		= &gfx_l3_ck,
1151
	.clkdm_name	= "gfx_3430es1_clkdm",
P
Paul Walmsley 已提交
1152 1153 1154 1155 1156
	.recalc		= &followparent_recalc,
};

static struct clk gfx_cg1_ck = {
	.name		= "gfx_cg1_ck",
1157
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1158 1159 1160
	.parent		= &gfx_l3_fck, /* REVISIT: correct? */
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES1_EN_2D_SHIFT,
1161
	.clkdm_name	= "gfx_3430es1_clkdm",
P
Paul Walmsley 已提交
1162 1163 1164 1165 1166
	.recalc		= &followparent_recalc,
};

static struct clk gfx_cg2_ck = {
	.name		= "gfx_cg2_ck",
1167
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1168 1169 1170
	.parent		= &gfx_l3_fck, /* REVISIT: correct? */
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES1_EN_3D_SHIFT,
1171
	.clkdm_name	= "gfx_3430es1_clkdm",
P
Paul Walmsley 已提交
1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196
	.recalc		= &followparent_recalc,
};

/* SGX power domain - 3430ES2 only */

static const struct clksel_rate sgx_core_rates[] = {
	{ .div = 3, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 4, .val = 1, .flags = RATE_IN_343X },
	{ .div = 6, .val = 2, .flags = RATE_IN_343X },
	{ .div = 0 },
};

static const struct clksel_rate sgx_96m_rates[] = {
	{ .div = 1,  .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 },
};

static const struct clksel sgx_clksel[] = {
	{ .parent = &core_ck,	 .rates = sgx_core_rates },
	{ .parent = &cm_96m_fck, .rates = sgx_96m_rates },
	{ .parent = NULL },
};

static struct clk sgx_fck = {
	.name		= "sgx_fck",
1197
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1198 1199
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN),
1200
	.enable_bit	= OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT,
P
Paul Walmsley 已提交
1201 1202 1203
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430ES2_CLKSEL_SGX_MASK,
	.clksel		= sgx_clksel,
1204
	.clkdm_name	= "sgx_clkdm",
P
Paul Walmsley 已提交
1205 1206 1207 1208 1209
	.recalc		= &omap2_clksel_recalc,
};

static struct clk sgx_ick = {
	.name		= "sgx_ick",
1210
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1211 1212
	.parent		= &l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_ICLKEN),
1213
	.enable_bit	= OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT,
1214
	.clkdm_name	= "sgx_clkdm",
P
Paul Walmsley 已提交
1215 1216 1217 1218 1219 1220 1221
	.recalc		= &followparent_recalc,
};

/* CORE power domain */

static struct clk d2d_26m_fck = {
	.name		= "d2d_26m_fck",
1222
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1223 1224 1225
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430ES1_EN_D2D_SHIFT,
1226
	.clkdm_name	= "d2d_clkdm",
P
Paul Walmsley 已提交
1227 1228 1229
	.recalc		= &followparent_recalc,
};

1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259
static struct clk modem_fck = {
	.name		= "modem_fck",
	.ops		= &clkops_omap2_dflt_wait,
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MODEM_SHIFT,
	.clkdm_name	= "d2d_clkdm",
	.recalc		= &followparent_recalc,
};

static struct clk sad2d_ick = {
	.name		= "sad2d_ick",
	.ops		= &clkops_omap2_dflt_wait,
	.parent		= &l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SAD2D_SHIFT,
	.clkdm_name	= "d2d_clkdm",
	.recalc		= &followparent_recalc,
};

static struct clk mad2d_ick = {
	.name		= "mad2d_ick",
	.ops		= &clkops_omap2_dflt_wait,
	.parent		= &l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
	.enable_bit	= OMAP3430_EN_MAD2D_SHIFT,
	.clkdm_name	= "d2d_clkdm",
	.recalc		= &followparent_recalc,
};

P
Paul Walmsley 已提交
1260 1261 1262 1263 1264 1265 1266 1267
static const struct clksel omap343x_gpt_clksel[] = {
	{ .parent = &omap_32k_fck, .rates = gpt_32k_rates },
	{ .parent = &sys_ck,	   .rates = gpt_sys_rates },
	{ .parent = NULL}
};

static struct clk gpt10_fck = {
	.name		= "gpt10_fck",
1268
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1269 1270 1271 1272 1273 1274 1275
	.parent		= &sys_ck,
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_GPT10_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT10_MASK,
	.clksel		= omap343x_gpt_clksel,
1276
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1277 1278 1279 1280 1281
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt11_fck = {
	.name		= "gpt11_fck",
1282
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1283 1284 1285 1286 1287 1288 1289
	.parent		= &sys_ck,
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_GPT11_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT11_MASK,
	.clksel		= omap343x_gpt_clksel,
1290
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1291 1292 1293 1294 1295
	.recalc		= &omap2_clksel_recalc,
};

static struct clk cpefuse_fck = {
	.name		= "cpefuse_fck",
1296
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1297 1298 1299 1300 1301 1302 1303 1304
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
	.enable_bit	= OMAP3430ES2_EN_CPEFUSE_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk ts_fck = {
	.name		= "ts_fck",
1305
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1306 1307 1308 1309 1310 1311 1312 1313
	.parent		= &omap_32k_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
	.enable_bit	= OMAP3430ES2_EN_TS_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk usbtll_fck = {
	.name		= "usbtll_fck",
1314
	.ops		= &clkops_omap2_dflt,
1315
	.parent		= &dpll5_m2_ck,
P
Paul Walmsley 已提交
1316 1317 1318 1319 1320 1321 1322 1323 1324
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
	.enable_bit	= OMAP3430ES2_EN_USBTLL_SHIFT,
	.recalc		= &followparent_recalc,
};

/* CORE 96M FCLK-derived clocks */

static struct clk core_96m_fck = {
	.name		= "core_96m_fck",
1325
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1326
	.parent		= &omap_96m_fck,
1327
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1328 1329 1330 1331 1332
	.recalc		= &followparent_recalc,
};

static struct clk mmchs3_fck = {
	.name		= "mmchs_fck",
1333
	.ops		= &clkops_omap2_dflt_wait,
1334
	.id		= 2,
P
Paul Walmsley 已提交
1335 1336 1337
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430ES2_EN_MMC3_SHIFT,
1338
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1339 1340 1341 1342 1343
	.recalc		= &followparent_recalc,
};

static struct clk mmchs2_fck = {
	.name		= "mmchs_fck",
1344
	.ops		= &clkops_omap2_dflt_wait,
1345
	.id		= 1,
P
Paul Walmsley 已提交
1346 1347 1348
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MMC2_SHIFT,
1349
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1350 1351 1352 1353 1354
	.recalc		= &followparent_recalc,
};

static struct clk mspro_fck = {
	.name		= "mspro_fck",
1355
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1356 1357 1358
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MSPRO_SHIFT,
1359
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1360 1361 1362 1363 1364
	.recalc		= &followparent_recalc,
};

static struct clk mmchs1_fck = {
	.name		= "mmchs_fck",
1365
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1366 1367 1368
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MMC1_SHIFT,
1369
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1370 1371 1372 1373 1374
	.recalc		= &followparent_recalc,
};

static struct clk i2c3_fck = {
	.name		= "i2c_fck",
1375
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1376 1377 1378 1379
	.id		= 3,
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_I2C3_SHIFT,
1380
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1381 1382 1383 1384 1385
	.recalc		= &followparent_recalc,
};

static struct clk i2c2_fck = {
	.name		= "i2c_fck",
1386
	.ops		= &clkops_omap2_dflt_wait,
1387
	.id		= 2,
P
Paul Walmsley 已提交
1388 1389 1390
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_I2C2_SHIFT,
1391
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1392 1393 1394 1395 1396
	.recalc		= &followparent_recalc,
};

static struct clk i2c1_fck = {
	.name		= "i2c_fck",
1397
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1398 1399 1400 1401
	.id		= 1,
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_I2C1_SHIFT,
1402
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426
	.recalc		= &followparent_recalc,
};

/*
 * MCBSP 1 & 5 get their 96MHz clock from core_96m_fck;
 * MCBSP 2, 3, 4 get their 96MHz clock from per_96m_fck.
 */
static const struct clksel_rate common_mcbsp_96m_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel mcbsp_15_clksel[] = {
	{ .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
	{ .parent = &mcbsp_clks,   .rates = common_mcbsp_mcbsp_rates },
	{ .parent = NULL }
};

static struct clk mcbsp5_fck = {
1427
	.name		= "mcbsp_fck",
1428
	.ops		= &clkops_omap2_dflt_wait,
1429
	.id		= 5,
P
Paul Walmsley 已提交
1430 1431 1432 1433 1434 1435
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MCBSP5_SHIFT,
	.clksel_reg	= OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
	.clksel_mask	= OMAP2_MCBSP5_CLKS_MASK,
	.clksel		= mcbsp_15_clksel,
1436
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1437 1438 1439 1440
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mcbsp1_fck = {
1441
	.name		= "mcbsp_fck",
1442
	.ops		= &clkops_omap2_dflt_wait,
1443
	.id		= 1,
P
Paul Walmsley 已提交
1444 1445 1446 1447 1448 1449
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MCBSP1_SHIFT,
	.clksel_reg	= OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
	.clksel_mask	= OMAP2_MCBSP1_CLKS_MASK,
	.clksel		= mcbsp_15_clksel,
1450
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1451 1452 1453 1454 1455 1456 1457
	.recalc		= &omap2_clksel_recalc,
};

/* CORE_48M_FCK-derived clocks */

static struct clk core_48m_fck = {
	.name		= "core_48m_fck",
1458
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1459
	.parent		= &omap_48m_fck,
1460
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1461 1462 1463 1464 1465
	.recalc		= &followparent_recalc,
};

static struct clk mcspi4_fck = {
	.name		= "mcspi_fck",
1466
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1467 1468 1469 1470 1471 1472 1473 1474 1475
	.id		= 4,
	.parent		= &core_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI4_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk mcspi3_fck = {
	.name		= "mcspi_fck",
1476
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1477 1478 1479 1480 1481 1482 1483 1484 1485
	.id		= 3,
	.parent		= &core_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI3_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk mcspi2_fck = {
	.name		= "mcspi_fck",
1486
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1487 1488 1489 1490 1491 1492 1493 1494 1495
	.id		= 2,
	.parent		= &core_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI2_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk mcspi1_fck = {
	.name		= "mcspi_fck",
1496
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1497 1498 1499 1500 1501 1502 1503 1504 1505
	.id		= 1,
	.parent		= &core_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI1_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk uart2_fck = {
	.name		= "uart2_fck",
1506
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1507 1508 1509 1510 1511 1512 1513 1514
	.parent		= &core_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_UART2_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk uart1_fck = {
	.name		= "uart1_fck",
1515
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1516 1517 1518 1519 1520 1521 1522 1523
	.parent		= &core_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_UART1_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk fshostusb_fck = {
	.name		= "fshostusb_fck",
1524
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1525 1526 1527 1528 1529 1530 1531 1532 1533 1534
	.parent		= &core_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
	.recalc		= &followparent_recalc,
};

/* CORE_12M_FCK based clocks */

static struct clk core_12m_fck = {
	.name		= "core_12m_fck",
1535
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1536
	.parent		= &omap_12m_fck,
1537
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1538 1539 1540 1541 1542
	.recalc		= &followparent_recalc,
};

static struct clk hdq_fck = {
	.name		= "hdq_fck",
1543
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566
	.parent		= &core_12m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
};

/* DPLL3-derived clock */

static const struct clksel_rate ssi_ssr_corex2_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_343X },
	{ .div = 3, .val = 3, .flags = RATE_IN_343X },
	{ .div = 4, .val = 4, .flags = RATE_IN_343X },
	{ .div = 6, .val = 6, .flags = RATE_IN_343X },
	{ .div = 8, .val = 8, .flags = RATE_IN_343X },
	{ .div = 0 }
};

static const struct clksel ssi_ssr_clksel[] = {
	{ .parent = &corex2_fck, .rates = ssi_ssr_corex2_rates },
	{ .parent = NULL }
};

1567
static struct clk ssi_ssr_fck_3430es1 = {
P
Paul Walmsley 已提交
1568
	.name		= "ssi_ssr_fck",
1569
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1570 1571 1572 1573 1574 1575
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_SSI_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_SSI_MASK,
	.clksel		= ssi_ssr_clksel,
1576
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1577 1578 1579
	.recalc		= &omap2_clksel_recalc,
};

1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593
static struct clk ssi_ssr_fck_3430es2 = {
	.name		= "ssi_ssr_fck",
	.ops		= &clkops_omap3430es2_ssi_wait,
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_SSI_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_SSI_MASK,
	.clksel		= ssi_ssr_clksel,
	.clkdm_name	= "core_l4_clkdm",
	.recalc		= &omap2_clksel_recalc,
};

static struct clk ssi_sst_fck_3430es1 = {
P
Paul Walmsley 已提交
1594
	.name		= "ssi_sst_fck",
1595
	.ops		= &clkops_null,
1596 1597 1598 1599 1600 1601 1602 1603 1604
	.parent		= &ssi_ssr_fck_3430es1,
	.fixed_div	= 2,
	.recalc		= &omap2_fixed_divisor_recalc,
};

static struct clk ssi_sst_fck_3430es2 = {
	.name		= "ssi_sst_fck",
	.ops		= &clkops_null,
	.parent		= &ssi_ssr_fck_3430es2,
P
Paul Walmsley 已提交
1605 1606 1607 1608 1609 1610 1611 1612
	.fixed_div	= 2,
	.recalc		= &omap2_fixed_divisor_recalc,
};



/* CORE_L3_ICK based clocks */

1613 1614 1615 1616
/*
 * XXX must add clk_enable/clk_disable for these if standard code won't
 * handle it
 */
P
Paul Walmsley 已提交
1617 1618
static struct clk core_l3_ick = {
	.name		= "core_l3_ick",
1619
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1620
	.parent		= &l3_ick,
1621
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1622 1623 1624
	.recalc		= &followparent_recalc,
};

1625
static struct clk hsotgusb_ick_3430es1 = {
P
Paul Walmsley 已提交
1626
	.name		= "hsotgusb_ick",
1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637
	.ops		= &clkops_omap2_dflt,
	.parent		= &core_l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_HSOTGUSB_SHIFT,
	.clkdm_name	= "core_l3_clkdm",
	.recalc		= &followparent_recalc,
};

static struct clk hsotgusb_ick_3430es2 = {
	.name		= "hsotgusb_ick",
	.ops		= &clkops_omap3430es2_hsotgusb_wait,
P
Paul Walmsley 已提交
1638 1639 1640
	.parent		= &core_l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_HSOTGUSB_SHIFT,
1641
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1642 1643 1644 1645 1646
	.recalc		= &followparent_recalc,
};

static struct clk sdrc_ick = {
	.name		= "sdrc_ick",
1647
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1648 1649 1650
	.parent		= &core_l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SDRC_SHIFT,
1651
	.flags		= ENABLE_ON_INIT,
1652
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1653 1654 1655 1656 1657
	.recalc		= &followparent_recalc,
};

static struct clk gpmc_fck = {
	.name		= "gpmc_fck",
1658
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1659
	.parent		= &core_l3_ick,
1660
	.flags		= ENABLE_ON_INIT, /* huh? */
1661
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1662 1663 1664 1665 1666 1667 1668
	.recalc		= &followparent_recalc,
};

/* SECURITY_L3_ICK based clocks */

static struct clk security_l3_ick = {
	.name		= "security_l3_ick",
1669
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1670 1671 1672 1673 1674 1675
	.parent		= &l3_ick,
	.recalc		= &followparent_recalc,
};

static struct clk pka_ick = {
	.name		= "pka_ick",
1676
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1677 1678 1679 1680 1681 1682 1683 1684 1685 1686
	.parent		= &security_l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP3430_EN_PKA_SHIFT,
	.recalc		= &followparent_recalc,
};

/* CORE_L4_ICK based clocks */

static struct clk core_l4_ick = {
	.name		= "core_l4_ick",
1687
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1688
	.parent		= &l4_ick,
1689
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1690 1691 1692 1693 1694
	.recalc		= &followparent_recalc,
};

static struct clk usbtll_ick = {
	.name		= "usbtll_ick",
1695
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1696 1697 1698
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
	.enable_bit	= OMAP3430ES2_EN_USBTLL_SHIFT,
1699
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1700 1701 1702 1703 1704
	.recalc		= &followparent_recalc,
};

static struct clk mmchs3_ick = {
	.name		= "mmchs_ick",
1705
	.ops		= &clkops_omap2_dflt_wait,
1706
	.id		= 2,
P
Paul Walmsley 已提交
1707 1708 1709
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430ES2_EN_MMC3_SHIFT,
1710
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1711 1712 1713 1714 1715 1716
	.recalc		= &followparent_recalc,
};

/* Intersystem Communication Registers - chassis mode only */
static struct clk icr_ick = {
	.name		= "icr_ick",
1717
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1718 1719 1720
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_ICR_SHIFT,
1721
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1722 1723 1724 1725 1726
	.recalc		= &followparent_recalc,
};

static struct clk aes2_ick = {
	.name		= "aes2_ick",
1727
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1728 1729 1730
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_AES2_SHIFT,
1731
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1732 1733 1734 1735 1736
	.recalc		= &followparent_recalc,
};

static struct clk sha12_ick = {
	.name		= "sha12_ick",
1737
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1738 1739 1740
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SHA12_SHIFT,
1741
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1742 1743 1744 1745 1746
	.recalc		= &followparent_recalc,
};

static struct clk des2_ick = {
	.name		= "des2_ick",
1747
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1748 1749 1750
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_DES2_SHIFT,
1751
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1752 1753 1754 1755 1756
	.recalc		= &followparent_recalc,
};

static struct clk mmchs2_ick = {
	.name		= "mmchs_ick",
1757
	.ops		= &clkops_omap2_dflt_wait,
1758
	.id		= 1,
P
Paul Walmsley 已提交
1759 1760 1761
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MMC2_SHIFT,
1762
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1763 1764 1765 1766 1767
	.recalc		= &followparent_recalc,
};

static struct clk mmchs1_ick = {
	.name		= "mmchs_ick",
1768
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1769 1770 1771
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MMC1_SHIFT,
1772
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1773 1774 1775 1776 1777
	.recalc		= &followparent_recalc,
};

static struct clk mspro_ick = {
	.name		= "mspro_ick",
1778
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1779 1780 1781
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MSPRO_SHIFT,
1782
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1783 1784 1785 1786 1787
	.recalc		= &followparent_recalc,
};

static struct clk hdq_ick = {
	.name		= "hdq_ick",
1788
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1789 1790 1791
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_HDQ_SHIFT,
1792
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1793 1794 1795 1796 1797
	.recalc		= &followparent_recalc,
};

static struct clk mcspi4_ick = {
	.name		= "mcspi_ick",
1798
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1799 1800 1801 1802
	.id		= 4,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI4_SHIFT,
1803
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1804 1805 1806 1807 1808
	.recalc		= &followparent_recalc,
};

static struct clk mcspi3_ick = {
	.name		= "mcspi_ick",
1809
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1810 1811 1812 1813
	.id		= 3,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI3_SHIFT,
1814
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1815 1816 1817 1818 1819
	.recalc		= &followparent_recalc,
};

static struct clk mcspi2_ick = {
	.name		= "mcspi_ick",
1820
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1821 1822 1823 1824
	.id		= 2,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI2_SHIFT,
1825
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1826 1827 1828 1829 1830
	.recalc		= &followparent_recalc,
};

static struct clk mcspi1_ick = {
	.name		= "mcspi_ick",
1831
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1832 1833 1834 1835
	.id		= 1,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI1_SHIFT,
1836
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1837 1838 1839 1840 1841
	.recalc		= &followparent_recalc,
};

static struct clk i2c3_ick = {
	.name		= "i2c_ick",
1842
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1843 1844 1845 1846
	.id		= 3,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_I2C3_SHIFT,
1847
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1848 1849 1850 1851 1852
	.recalc		= &followparent_recalc,
};

static struct clk i2c2_ick = {
	.name		= "i2c_ick",
1853
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1854 1855 1856 1857
	.id		= 2,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_I2C2_SHIFT,
1858
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1859 1860 1861 1862 1863
	.recalc		= &followparent_recalc,
};

static struct clk i2c1_ick = {
	.name		= "i2c_ick",
1864
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1865 1866 1867 1868
	.id		= 1,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_I2C1_SHIFT,
1869
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1870 1871 1872 1873 1874
	.recalc		= &followparent_recalc,
};

static struct clk uart2_ick = {
	.name		= "uart2_ick",
1875
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1876 1877 1878
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_UART2_SHIFT,
1879
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1880 1881 1882 1883 1884
	.recalc		= &followparent_recalc,
};

static struct clk uart1_ick = {
	.name		= "uart1_ick",
1885
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1886 1887 1888
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_UART1_SHIFT,
1889
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1890 1891 1892 1893 1894
	.recalc		= &followparent_recalc,
};

static struct clk gpt11_ick = {
	.name		= "gpt11_ick",
1895
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1896 1897 1898
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_GPT11_SHIFT,
1899
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1900 1901 1902 1903 1904
	.recalc		= &followparent_recalc,
};

static struct clk gpt10_ick = {
	.name		= "gpt10_ick",
1905
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1906 1907 1908
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_GPT10_SHIFT,
1909
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1910 1911 1912 1913
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp5_ick = {
1914
	.name		= "mcbsp_ick",
1915
	.ops		= &clkops_omap2_dflt_wait,
1916
	.id		= 5,
P
Paul Walmsley 已提交
1917 1918 1919
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCBSP5_SHIFT,
1920
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1921 1922 1923 1924
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp1_ick = {
1925
	.name		= "mcbsp_ick",
1926
	.ops		= &clkops_omap2_dflt_wait,
1927
	.id		= 1,
P
Paul Walmsley 已提交
1928 1929 1930
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCBSP1_SHIFT,
1931
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1932 1933 1934 1935 1936
	.recalc		= &followparent_recalc,
};

static struct clk fac_ick = {
	.name		= "fac_ick",
1937
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1938 1939 1940
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430ES1_EN_FAC_SHIFT,
1941
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1942 1943 1944 1945 1946
	.recalc		= &followparent_recalc,
};

static struct clk mailboxes_ick = {
	.name		= "mailboxes_ick",
1947
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1948 1949 1950
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MAILBOXES_SHIFT,
1951
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1952 1953 1954 1955 1956
	.recalc		= &followparent_recalc,
};

static struct clk omapctrl_ick = {
	.name		= "omapctrl_ick",
1957
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1958 1959 1960
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_OMAPCTRL_SHIFT,
1961
	.flags		= ENABLE_ON_INIT,
P
Paul Walmsley 已提交
1962 1963 1964 1965 1966 1967 1968
	.recalc		= &followparent_recalc,
};

/* SSI_L4_ICK based clocks */

static struct clk ssi_l4_ick = {
	.name		= "ssi_l4_ick",
1969
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1970
	.parent		= &l4_ick,
1971
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1972 1973 1974
	.recalc		= &followparent_recalc,
};

1975
static struct clk ssi_ick_3430es1 = {
P
Paul Walmsley 已提交
1976
	.name		= "ssi_ick",
1977
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1978 1979 1980
	.parent		= &ssi_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SSI_SHIFT,
1981
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1982 1983 1984
	.recalc		= &followparent_recalc,
};

1985 1986 1987 1988 1989 1990 1991 1992 1993 1994
static struct clk ssi_ick_3430es2 = {
	.name		= "ssi_ick",
	.ops		= &clkops_omap3430es2_ssi_wait,
	.parent		= &ssi_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SSI_SHIFT,
	.clkdm_name	= "core_l4_clkdm",
	.recalc		= &followparent_recalc,
};

P
Paul Walmsley 已提交
1995 1996 1997 1998 1999 2000 2001 2002 2003 2004
/* REVISIT: Technically the TRM claims that this is CORE_CLK based,
 * but l4_ick makes more sense to me */

static const struct clksel usb_l4_clksel[] = {
	{ .parent = &l4_ick, .rates = div2_rates },
	{ .parent = NULL },
};

static struct clk usb_l4_ick = {
	.name		= "usb_l4_ick",
2005
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
	.parent		= &l4_ick,
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK,
	.clksel		= usb_l4_clksel,
	.recalc		= &omap2_clksel_recalc,
};

/* SECURITY_L4_ICK2 based clocks */

static struct clk security_l4_ick2 = {
	.name		= "security_l4_ick2",
2020
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2021 2022 2023 2024 2025 2026
	.parent		= &l4_ick,
	.recalc		= &followparent_recalc,
};

static struct clk aes1_ick = {
	.name		= "aes1_ick",
2027
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2028 2029 2030 2031 2032 2033 2034 2035
	.parent		= &security_l4_ick2,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP3430_EN_AES1_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk rng_ick = {
	.name		= "rng_ick",
2036
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2037 2038 2039 2040 2041 2042 2043 2044
	.parent		= &security_l4_ick2,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP3430_EN_RNG_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk sha11_ick = {
	.name		= "sha11_ick",
2045
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2046 2047 2048 2049 2050 2051 2052 2053
	.parent		= &security_l4_ick2,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP3430_EN_SHA11_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk des1_ick = {
	.name		= "des1_ick",
2054
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2055 2056 2057 2058 2059 2060 2061
	.parent		= &security_l4_ick2,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP3430_EN_DES1_SHIFT,
	.recalc		= &followparent_recalc,
};

/* DSS */
2062
static struct clk dss1_alwon_fck_3430es1 = {
P
Paul Walmsley 已提交
2063
	.name		= "dss1_alwon_fck",
2064
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2065 2066 2067
	.parent		= &dpll4_m4x2_ck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_DSS1_SHIFT,
2068
	.clkdm_name	= "dss_clkdm",
2069
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
2070 2071
};

2072 2073 2074 2075 2076 2077 2078 2079 2080 2081
static struct clk dss1_alwon_fck_3430es2 = {
	.name		= "dss1_alwon_fck",
	.ops		= &clkops_omap3430es2_dss_usbhost_wait,
	.parent		= &dpll4_m4x2_ck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_DSS1_SHIFT,
	.clkdm_name	= "dss_clkdm",
	.recalc		= &followparent_recalc,
};

P
Paul Walmsley 已提交
2082 2083
static struct clk dss_tv_fck = {
	.name		= "dss_tv_fck",
2084
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2085 2086 2087
	.parent		= &omap_54m_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_TV_SHIFT,
2088
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2089 2090 2091 2092 2093
	.recalc		= &followparent_recalc,
};

static struct clk dss_96m_fck = {
	.name		= "dss_96m_fck",
2094
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2095 2096 2097
	.parent		= &omap_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_TV_SHIFT,
2098
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2099 2100 2101 2102 2103
	.recalc		= &followparent_recalc,
};

static struct clk dss2_alwon_fck = {
	.name		= "dss2_alwon_fck",
2104
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2105 2106 2107
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_DSS2_SHIFT,
2108
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2109 2110 2111
	.recalc		= &followparent_recalc,
};

2112
static struct clk dss_ick_3430es1 = {
P
Paul Walmsley 已提交
2113 2114
	/* Handles both L3 and L4 clocks */
	.name		= "dss_ick",
2115
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2116 2117 2118
	.parent		= &l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
2119
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2120 2121 2122
	.recalc		= &followparent_recalc,
};

2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133
static struct clk dss_ick_3430es2 = {
	/* Handles both L3 and L4 clocks */
	.name		= "dss_ick",
	.ops		= &clkops_omap3430es2_dss_usbhost_wait,
	.parent		= &l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
	.clkdm_name	= "dss_clkdm",
	.recalc		= &followparent_recalc,
};

P
Paul Walmsley 已提交
2134 2135 2136 2137
/* CAM */

static struct clk cam_mclk = {
	.name		= "cam_mclk",
2138
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2139 2140 2141
	.parent		= &dpll4_m5x2_ck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_CAM_SHIFT,
2142
	.clkdm_name	= "cam_clkdm",
2143
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
2144 2145
};

2146 2147 2148
static struct clk cam_ick = {
	/* Handles both L3 and L4 clocks */
	.name		= "cam_ick",
2149
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2150 2151 2152
	.parent		= &l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_CAM_SHIFT,
2153
	.clkdm_name	= "cam_clkdm",
P
Paul Walmsley 已提交
2154 2155 2156
	.recalc		= &followparent_recalc,
};

2157 2158
static struct clk csi2_96m_fck = {
	.name		= "csi2_96m_fck",
2159
	.ops		= &clkops_omap2_dflt,
2160 2161 2162 2163 2164 2165 2166
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_CSI2_SHIFT,
	.clkdm_name	= "cam_clkdm",
	.recalc		= &followparent_recalc,
};

P
Paul Walmsley 已提交
2167 2168 2169 2170
/* USBHOST - 3430ES2 only */

static struct clk usbhost_120m_fck = {
	.name		= "usbhost_120m_fck",
2171
	.ops		= &clkops_omap2_dflt,
2172
	.parent		= &dpll5_m2_ck,
P
Paul Walmsley 已提交
2173 2174
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES2_EN_USBHOST2_SHIFT,
2175
	.clkdm_name	= "usbhost_clkdm",
P
Paul Walmsley 已提交
2176 2177 2178 2179 2180
	.recalc		= &followparent_recalc,
};

static struct clk usbhost_48m_fck = {
	.name		= "usbhost_48m_fck",
2181
	.ops		= &clkops_omap3430es2_dss_usbhost_wait,
P
Paul Walmsley 已提交
2182 2183 2184
	.parent		= &omap_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES2_EN_USBHOST1_SHIFT,
2185
	.clkdm_name	= "usbhost_clkdm",
P
Paul Walmsley 已提交
2186 2187 2188
	.recalc		= &followparent_recalc,
};

2189 2190 2191
static struct clk usbhost_ick = {
	/* Handles both L3 and L4 clocks */
	.name		= "usbhost_ick",
2192
	.ops		= &clkops_omap3430es2_dss_usbhost_wait,
P
Paul Walmsley 已提交
2193 2194 2195
	.parent		= &l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430ES2_EN_USBHOST_SHIFT,
2196
	.clkdm_name	= "usbhost_clkdm",
P
Paul Walmsley 已提交
2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219
	.recalc		= &followparent_recalc,
};

/* WKUP */

static const struct clksel_rate usim_96m_rates[] = {
	{ .div = 2,  .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 4,  .val = 4, .flags = RATE_IN_343X },
	{ .div = 8,  .val = 5, .flags = RATE_IN_343X },
	{ .div = 10, .val = 6, .flags = RATE_IN_343X },
	{ .div = 0 },
};

static const struct clksel_rate usim_120m_rates[] = {
	{ .div = 4,  .val = 7,	.flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 8,  .val = 8,	.flags = RATE_IN_343X },
	{ .div = 16, .val = 9,	.flags = RATE_IN_343X },
	{ .div = 20, .val = 10, .flags = RATE_IN_343X },
	{ .div = 0 },
};

static const struct clksel usim_clksel[] = {
	{ .parent = &omap_96m_fck,	.rates = usim_96m_rates },
2220
	{ .parent = &dpll5_m2_ck,	.rates = usim_120m_rates },
P
Paul Walmsley 已提交
2221 2222 2223 2224 2225 2226 2227
	{ .parent = &sys_ck,		.rates = div2_rates },
	{ .parent = NULL },
};

/* 3430ES2 only */
static struct clk usim_fck = {
	.name		= "usim_fck",
2228
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2229 2230 2231 2232 2233 2234 2235 2236 2237
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES2_EN_USIMOCP_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430ES2_CLKSEL_USIMOCP_MASK,
	.clksel		= usim_clksel,
	.recalc		= &omap2_clksel_recalc,
};

2238
/* XXX should gpt1's clksel have wkup_32k_fck as the 32k opt? */
P
Paul Walmsley 已提交
2239 2240
static struct clk gpt1_fck = {
	.name		= "gpt1_fck",
2241
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2242 2243 2244 2245 2246 2247
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPT1_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT1_MASK,
	.clksel		= omap343x_gpt_clksel,
2248
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2249 2250 2251 2252 2253
	.recalc		= &omap2_clksel_recalc,
};

static struct clk wkup_32k_fck = {
	.name		= "wkup_32k_fck",
2254
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2255
	.parent		= &omap_32k_fck,
2256
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2257 2258 2259
	.recalc		= &followparent_recalc,
};

2260 2261
static struct clk gpio1_dbck = {
	.name		= "gpio1_dbck",
2262
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2263 2264 2265
	.parent		= &wkup_32k_fck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPIO1_SHIFT,
2266
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2267 2268 2269 2270 2271
	.recalc		= &followparent_recalc,
};

static struct clk wdt2_fck = {
	.name		= "wdt2_fck",
2272
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2273 2274 2275
	.parent		= &wkup_32k_fck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_WDT2_SHIFT,
2276
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2277 2278 2279 2280 2281
	.recalc		= &followparent_recalc,
};

static struct clk wkup_l4_ick = {
	.name		= "wkup_l4_ick",
2282
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2283
	.parent		= &sys_ck,
2284
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2285 2286 2287 2288 2289 2290 2291
	.recalc		= &followparent_recalc,
};

/* 3430ES2 only */
/* Never specifically named in the TRM, so we have to infer a likely name */
static struct clk usim_ick = {
	.name		= "usim_ick",
2292
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2293 2294 2295
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430ES2_EN_USIMOCP_SHIFT,
2296
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2297 2298 2299 2300 2301
	.recalc		= &followparent_recalc,
};

static struct clk wdt2_ick = {
	.name		= "wdt2_ick",
2302
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2303 2304 2305
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_WDT2_SHIFT,
2306
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2307 2308 2309 2310 2311
	.recalc		= &followparent_recalc,
};

static struct clk wdt1_ick = {
	.name		= "wdt1_ick",
2312
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2313 2314 2315
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_WDT1_SHIFT,
2316
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2317 2318 2319 2320 2321
	.recalc		= &followparent_recalc,
};

static struct clk gpio1_ick = {
	.name		= "gpio1_ick",
2322
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2323 2324 2325
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO1_SHIFT,
2326
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2327 2328 2329 2330 2331
	.recalc		= &followparent_recalc,
};

static struct clk omap_32ksync_ick = {
	.name		= "omap_32ksync_ick",
2332
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2333 2334 2335
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_32KSYNC_SHIFT,
2336
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2337 2338 2339
	.recalc		= &followparent_recalc,
};

2340
/* XXX This clock no longer exists in 3430 TRM rev F */
P
Paul Walmsley 已提交
2341 2342
static struct clk gpt12_ick = {
	.name		= "gpt12_ick",
2343
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2344 2345 2346
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT12_SHIFT,
2347
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2348 2349 2350 2351 2352
	.recalc		= &followparent_recalc,
};

static struct clk gpt1_ick = {
	.name		= "gpt1_ick",
2353
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2354 2355 2356
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT1_SHIFT,
2357
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2358 2359 2360 2361 2362 2363 2364 2365 2366
	.recalc		= &followparent_recalc,
};



/* PER clock domain */

static struct clk per_96m_fck = {
	.name		= "per_96m_fck",
2367
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2368
	.parent		= &omap_96m_alwon_fck,
2369
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2370 2371 2372 2373 2374
	.recalc		= &followparent_recalc,
};

static struct clk per_48m_fck = {
	.name		= "per_48m_fck",
2375
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2376
	.parent		= &omap_48m_fck,
2377
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2378 2379 2380 2381 2382
	.recalc		= &followparent_recalc,
};

static struct clk uart3_fck = {
	.name		= "uart3_fck",
2383
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2384 2385 2386
	.parent		= &per_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_UART3_SHIFT,
2387
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2388 2389 2390 2391 2392
	.recalc		= &followparent_recalc,
};

static struct clk gpt2_fck = {
	.name		= "gpt2_fck",
2393
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2394 2395 2396 2397 2398 2399
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPT2_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT2_MASK,
	.clksel		= omap343x_gpt_clksel,
2400
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2401 2402 2403 2404 2405
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt3_fck = {
	.name		= "gpt3_fck",
2406
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2407 2408 2409 2410 2411 2412
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPT3_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT3_MASK,
	.clksel		= omap343x_gpt_clksel,
2413
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2414 2415 2416 2417 2418
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt4_fck = {
	.name		= "gpt4_fck",
2419
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2420 2421 2422 2423 2424 2425
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPT4_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT4_MASK,
	.clksel		= omap343x_gpt_clksel,
2426
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2427 2428 2429 2430 2431
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt5_fck = {
	.name		= "gpt5_fck",
2432
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2433 2434 2435 2436 2437 2438
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPT5_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT5_MASK,
	.clksel		= omap343x_gpt_clksel,
2439
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2440 2441 2442 2443 2444
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt6_fck = {
	.name		= "gpt6_fck",
2445
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2446 2447 2448 2449 2450 2451
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPT6_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT6_MASK,
	.clksel		= omap343x_gpt_clksel,
2452
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2453 2454 2455 2456 2457
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt7_fck = {
	.name		= "gpt7_fck",
2458
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2459 2460 2461 2462 2463 2464
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPT7_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT7_MASK,
	.clksel		= omap343x_gpt_clksel,
2465
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2466 2467 2468 2469 2470
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt8_fck = {
	.name		= "gpt8_fck",
2471
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2472 2473 2474 2475 2476 2477
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPT8_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT8_MASK,
	.clksel		= omap343x_gpt_clksel,
2478
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2479 2480 2481 2482 2483
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt9_fck = {
	.name		= "gpt9_fck",
2484
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2485 2486 2487 2488 2489 2490
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPT9_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430_CLKSEL_GPT9_MASK,
	.clksel		= omap343x_gpt_clksel,
2491
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2492 2493 2494 2495 2496
	.recalc		= &omap2_clksel_recalc,
};

static struct clk per_32k_alwon_fck = {
	.name		= "per_32k_alwon_fck",
2497
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2498
	.parent		= &omap_32k_fck,
2499
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2500 2501 2502
	.recalc		= &followparent_recalc,
};

2503 2504
static struct clk gpio6_dbck = {
	.name		= "gpio6_dbck",
2505
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2506 2507
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2508
	.enable_bit	= OMAP3430_EN_GPIO6_SHIFT,
2509
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2510 2511 2512
	.recalc		= &followparent_recalc,
};

2513 2514
static struct clk gpio5_dbck = {
	.name		= "gpio5_dbck",
2515
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2516 2517
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2518
	.enable_bit	= OMAP3430_EN_GPIO5_SHIFT,
2519
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2520 2521 2522
	.recalc		= &followparent_recalc,
};

2523 2524
static struct clk gpio4_dbck = {
	.name		= "gpio4_dbck",
2525
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2526 2527
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2528
	.enable_bit	= OMAP3430_EN_GPIO4_SHIFT,
2529
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2530 2531 2532
	.recalc		= &followparent_recalc,
};

2533 2534
static struct clk gpio3_dbck = {
	.name		= "gpio3_dbck",
2535
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2536 2537
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2538
	.enable_bit	= OMAP3430_EN_GPIO3_SHIFT,
2539
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2540 2541 2542
	.recalc		= &followparent_recalc,
};

2543 2544
static struct clk gpio2_dbck = {
	.name		= "gpio2_dbck",
2545
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2546 2547
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2548
	.enable_bit	= OMAP3430_EN_GPIO2_SHIFT,
2549
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2550 2551 2552 2553 2554
	.recalc		= &followparent_recalc,
};

static struct clk wdt3_fck = {
	.name		= "wdt3_fck",
2555
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2556 2557 2558
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_WDT3_SHIFT,
2559
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2560 2561 2562 2563 2564
	.recalc		= &followparent_recalc,
};

static struct clk per_l4_ick = {
	.name		= "per_l4_ick",
2565
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2566
	.parent		= &l4_ick,
2567
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2568 2569 2570 2571 2572
	.recalc		= &followparent_recalc,
};

static struct clk gpio6_ick = {
	.name		= "gpio6_ick",
2573
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2574 2575 2576
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO6_SHIFT,
2577
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2578 2579 2580 2581 2582
	.recalc		= &followparent_recalc,
};

static struct clk gpio5_ick = {
	.name		= "gpio5_ick",
2583
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2584 2585 2586
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO5_SHIFT,
2587
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2588 2589 2590 2591 2592
	.recalc		= &followparent_recalc,
};

static struct clk gpio4_ick = {
	.name		= "gpio4_ick",
2593
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2594 2595 2596
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO4_SHIFT,
2597
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2598 2599 2600 2601 2602
	.recalc		= &followparent_recalc,
};

static struct clk gpio3_ick = {
	.name		= "gpio3_ick",
2603
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2604 2605 2606
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO3_SHIFT,
2607
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2608 2609 2610 2611 2612
	.recalc		= &followparent_recalc,
};

static struct clk gpio2_ick = {
	.name		= "gpio2_ick",
2613
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2614 2615 2616
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO2_SHIFT,
2617
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2618 2619 2620 2621 2622
	.recalc		= &followparent_recalc,
};

static struct clk wdt3_ick = {
	.name		= "wdt3_ick",
2623
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2624 2625 2626
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_WDT3_SHIFT,
2627
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2628 2629 2630 2631 2632
	.recalc		= &followparent_recalc,
};

static struct clk uart3_ick = {
	.name		= "uart3_ick",
2633
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2634 2635 2636
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_UART3_SHIFT,
2637
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2638 2639 2640 2641 2642
	.recalc		= &followparent_recalc,
};

static struct clk gpt9_ick = {
	.name		= "gpt9_ick",
2643
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2644 2645 2646
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT9_SHIFT,
2647
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2648 2649 2650 2651 2652
	.recalc		= &followparent_recalc,
};

static struct clk gpt8_ick = {
	.name		= "gpt8_ick",
2653
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2654 2655 2656
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT8_SHIFT,
2657
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2658 2659 2660 2661 2662
	.recalc		= &followparent_recalc,
};

static struct clk gpt7_ick = {
	.name		= "gpt7_ick",
2663
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2664 2665 2666
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT7_SHIFT,
2667
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2668 2669 2670 2671 2672
	.recalc		= &followparent_recalc,
};

static struct clk gpt6_ick = {
	.name		= "gpt6_ick",
2673
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2674 2675 2676
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT6_SHIFT,
2677
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2678 2679 2680 2681 2682
	.recalc		= &followparent_recalc,
};

static struct clk gpt5_ick = {
	.name		= "gpt5_ick",
2683
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2684 2685 2686
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT5_SHIFT,
2687
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2688 2689 2690 2691 2692
	.recalc		= &followparent_recalc,
};

static struct clk gpt4_ick = {
	.name		= "gpt4_ick",
2693
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2694 2695 2696
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT4_SHIFT,
2697
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2698 2699 2700 2701 2702
	.recalc		= &followparent_recalc,
};

static struct clk gpt3_ick = {
	.name		= "gpt3_ick",
2703
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2704 2705 2706
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT3_SHIFT,
2707
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2708 2709 2710 2711 2712
	.recalc		= &followparent_recalc,
};

static struct clk gpt2_ick = {
	.name		= "gpt2_ick",
2713
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2714 2715 2716
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT2_SHIFT,
2717
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2718 2719 2720 2721
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp2_ick = {
2722
	.name		= "mcbsp_ick",
2723
	.ops		= &clkops_omap2_dflt_wait,
2724
	.id		= 2,
P
Paul Walmsley 已提交
2725 2726 2727
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP2_SHIFT,
2728
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2729 2730 2731 2732
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp3_ick = {
2733
	.name		= "mcbsp_ick",
2734
	.ops		= &clkops_omap2_dflt_wait,
2735
	.id		= 3,
P
Paul Walmsley 已提交
2736 2737 2738
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP3_SHIFT,
2739
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2740 2741 2742 2743
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp4_ick = {
2744
	.name		= "mcbsp_ick",
2745
	.ops		= &clkops_omap2_dflt_wait,
2746
	.id		= 4,
P
Paul Walmsley 已提交
2747 2748 2749
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP4_SHIFT,
2750
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2751 2752 2753 2754
	.recalc		= &followparent_recalc,
};

static const struct clksel mcbsp_234_clksel[] = {
2755 2756
	{ .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
	{ .parent = &mcbsp_clks,   .rates = common_mcbsp_mcbsp_rates },
P
Paul Walmsley 已提交
2757 2758 2759 2760
	{ .parent = NULL }
};

static struct clk mcbsp2_fck = {
2761
	.name		= "mcbsp_fck",
2762
	.ops		= &clkops_omap2_dflt_wait,
2763
	.id		= 2,
P
Paul Walmsley 已提交
2764 2765 2766 2767 2768 2769
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP2_SHIFT,
	.clksel_reg	= OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
	.clksel_mask	= OMAP2_MCBSP2_CLKS_MASK,
	.clksel		= mcbsp_234_clksel,
2770
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2771 2772 2773 2774
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mcbsp3_fck = {
2775
	.name		= "mcbsp_fck",
2776
	.ops		= &clkops_omap2_dflt_wait,
2777
	.id		= 3,
P
Paul Walmsley 已提交
2778 2779 2780 2781 2782 2783
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP3_SHIFT,
	.clksel_reg	= OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
	.clksel_mask	= OMAP2_MCBSP3_CLKS_MASK,
	.clksel		= mcbsp_234_clksel,
2784
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2785 2786 2787 2788
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mcbsp4_fck = {
2789
	.name		= "mcbsp_fck",
2790
	.ops		= &clkops_omap2_dflt_wait,
2791
	.id		= 4,
P
Paul Walmsley 已提交
2792 2793 2794 2795 2796 2797
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP4_SHIFT,
	.clksel_reg	= OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
	.clksel_mask	= OMAP2_MCBSP4_CLKS_MASK,
	.clksel		= mcbsp_234_clksel,
2798
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840
	.recalc		= &omap2_clksel_recalc,
};

/* EMU clocks */

/* More information: ARM Cortex-A8 Technical Reference Manual, sect 10.1 */

static const struct clksel_rate emu_src_sys_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 },
};

static const struct clksel_rate emu_src_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 },
};

static const struct clksel_rate emu_src_per_rates[] = {
	{ .div = 1, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 },
};

static const struct clksel_rate emu_src_mpu_rates[] = {
	{ .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 },
};

static const struct clksel emu_src_clksel[] = {
	{ .parent = &sys_ck,		.rates = emu_src_sys_rates },
	{ .parent = &emu_core_alwon_ck, .rates = emu_src_core_rates },
	{ .parent = &emu_per_alwon_ck,	.rates = emu_src_per_rates },
	{ .parent = &emu_mpu_alwon_ck,	.rates = emu_src_mpu_rates },
	{ .parent = NULL },
};

/*
 * Like the clkout_src clocks, emu_src_clk is a virtual clock, existing only
 * to switch the source of some of the EMU clocks.
 * XXX Are there CLKEN bits for these EMU clks?
 */
static struct clk emu_src_ck = {
	.name		= "emu_src_ck",
2841
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2842 2843 2844 2845
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_MUX_CTRL_MASK,
	.clksel		= emu_src_clksel,
2846
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel_rate pclk_emu_rates[] = {
	{ .div = 2, .val = 2, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 3, .val = 3, .flags = RATE_IN_343X },
	{ .div = 4, .val = 4, .flags = RATE_IN_343X },
	{ .div = 6, .val = 6, .flags = RATE_IN_343X },
	{ .div = 0 },
};

static const struct clksel pclk_emu_clksel[] = {
	{ .parent = &emu_src_ck, .rates = pclk_emu_rates },
	{ .parent = NULL },
};

static struct clk pclk_fck = {
	.name		= "pclk_fck",
2865
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2866 2867 2868 2869
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_CLKSEL_PCLK_MASK,
	.clksel		= pclk_emu_clksel,
2870
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel_rate pclkx2_emu_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_343X },
	{ .div = 3, .val = 3, .flags = RATE_IN_343X },
	{ .div = 0 },
};

static const struct clksel pclkx2_emu_clksel[] = {
	{ .parent = &emu_src_ck, .rates = pclkx2_emu_rates },
	{ .parent = NULL },
};

static struct clk pclkx2_fck = {
	.name		= "pclkx2_fck",
2888
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2889 2890 2891 2892
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_CLKSEL_PCLKX2_MASK,
	.clksel		= pclkx2_emu_clksel,
2893
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2894 2895 2896 2897 2898 2899 2900 2901 2902 2903
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel atclk_emu_clksel[] = {
	{ .parent = &emu_src_ck, .rates = div2_rates },
	{ .parent = NULL },
};

static struct clk atclk_fck = {
	.name		= "atclk_fck",
2904
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2905 2906 2907 2908
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_CLKSEL_ATCLK_MASK,
	.clksel		= atclk_emu_clksel,
2909
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2910 2911 2912 2913 2914
	.recalc		= &omap2_clksel_recalc,
};

static struct clk traceclk_src_fck = {
	.name		= "traceclk_src_fck",
2915
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2916 2917 2918 2919
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_TRACE_MUX_CTRL_MASK,
	.clksel		= emu_src_clksel,
2920
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel_rate traceclk_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_343X },
	{ .div = 4, .val = 4, .flags = RATE_IN_343X },
	{ .div = 0 },
};

static const struct clksel traceclk_clksel[] = {
	{ .parent = &traceclk_src_fck, .rates = traceclk_rates },
	{ .parent = NULL },
};

static struct clk traceclk_fck = {
	.name		= "traceclk_fck",
2938
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2939 2940 2941 2942
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_CLKSEL_TRACECLK_MASK,
	.clksel		= traceclk_clksel,
2943
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2944 2945 2946 2947 2948 2949 2950 2951
	.recalc		= &omap2_clksel_recalc,
};

/* SR clocks */

/* SmartReflex fclk (VDD1) */
static struct clk sr1_fck = {
	.name		= "sr1_fck",
2952
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2953 2954 2955 2956 2957 2958 2959 2960 2961
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_SR1_SHIFT,
	.recalc		= &followparent_recalc,
};

/* SmartReflex fclk (VDD2) */
static struct clk sr2_fck = {
	.name		= "sr2_fck",
2962
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2963 2964 2965 2966 2967 2968 2969 2970
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_SR2_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk sr_l4_ick = {
	.name		= "sr_l4_ick",
2971
	.ops		= &clkops_null, /* RMK: missing? */
P
Paul Walmsley 已提交
2972
	.parent		= &l4_ick,
2973
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
2974 2975 2976 2977 2978 2979 2980
	.recalc		= &followparent_recalc,
};

/* SECURE_32K_FCK clocks */

static struct clk gpt12_fck = {
	.name		= "gpt12_fck",
2981
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2982 2983 2984 2985 2986 2987
	.parent		= &secure_32k_fck,
	.recalc		= &followparent_recalc,
};

static struct clk wdt1_fck = {
	.name		= "wdt1_fck",
2988
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2989
	.parent		= &secure_32k_fck,
2990
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
2991 2992 2993
};

#endif