clock34xx.h 87.8 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 <mach/control.h>
P
Paul Walmsley 已提交
23 24 25 26 27 28 29 30 31

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

static void omap3_dpll_recalc(struct clk *clk);
static void omap3_clkoutx2_recalc(struct clk *clk);
32 33 34
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);
35 36
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);
P
Paul Walmsley 已提交
37

38 39 40 41
/* Maximum DPLL multiplier, divider values for OMAP3 */
#define OMAP3_MAX_DPLL_MULT		2048
#define OMAP3_MAX_DPLL_DIV		128

P
Paul Walmsley 已提交
42 43 44 45 46 47 48 49
/*
 * 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).
 */

50 51 52 53 54
/* 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 已提交
55 56 57 58 59
/* 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",
60
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
61
	.rate		= 32768,
62
	.flags		= RATE_FIXED | RATE_PROPAGATES,
P
Paul Walmsley 已提交
63 64 65 66
};

static struct clk secure_32k_fck = {
	.name		= "secure_32k_fck",
67
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
68
	.rate		= 32768,
69
	.flags		= RATE_FIXED | RATE_PROPAGATES,
P
Paul Walmsley 已提交
70 71 72 73 74
};

/* Virtual source clocks for osc_sys_ck */
static struct clk virt_12m_ck = {
	.name		= "virt_12m_ck",
75
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
76
	.rate		= 12000000,
77
	.flags		= RATE_FIXED | RATE_PROPAGATES,
P
Paul Walmsley 已提交
78 79 80 81
};

static struct clk virt_13m_ck = {
	.name		= "virt_13m_ck",
82
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
83
	.rate		= 13000000,
84
	.flags		= RATE_FIXED | RATE_PROPAGATES,
P
Paul Walmsley 已提交
85 86 87 88
};

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

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

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

static struct clk virt_38_4m_ck = {
	.name		= "virt_38_4m_ck",
110
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
111
	.rate		= 38400000,
112
	.flags		= RATE_FIXED | RATE_PROPAGATES,
P
Paul Walmsley 已提交
113 114 115 116 117 118 119 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
};

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",
159
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
160 161 162 163 164
	.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? */
165
	.flags		= RATE_FIXED | RATE_PROPAGATES,
P
Paul Walmsley 已提交
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
	.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",
184
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
185 186 187 188 189
	.parent		= &osc_sys_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP3430_PRM_CLKSRC_CTRL,
	.clksel_mask	= OMAP_SYSCLKDIV_MASK,
	.clksel		= sys_clksel,
190
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
191 192 193 194 195
	.recalc		= &omap2_clksel_recalc,
};

static struct clk sys_altclk = {
	.name		= "sys_altclk",
196
	.ops		= &clkops_null,
197
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
198 199 200 201 202
};

/* Optional external clock input for some McBSPs */
static struct clk mcbsp_clks = {
	.name		= "mcbsp_clks",
203
	.ops		= &clkops_null,
204
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
205 206 207 208 209 210
};

/* PRM EXTERNAL CLOCK OUTPUT */

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

/* DPLLS */

/* CM CLOCKS */

222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
static const struct clksel_rate dpll_bypass_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
	{ .div = 0 }
};

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

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 已提交
252 253 254
/* DPLL1 */
/* MPU clock source */
/* Type: DPLL */
255
static struct dpll_data dpll1_dd = {
P
Paul Walmsley 已提交
256 257 258
	.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,
259
	.freqsel_mask	= OMAP3430_MPU_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
260 261
	.control_reg	= OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
	.enable_mask	= OMAP3430_EN_MPU_DPLL_MASK,
262
	.modes		= (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
P
Paul Walmsley 已提交
263 264 265
	.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,
266 267 268 269
	.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),
	.idlest_bit	= OMAP3430_ST_MPU_CLK_SHIFT,
270 271 272
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
273 274 275 276
};

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

/*
288 289
 * This virtual clock provides the CLKOUTX2 output from the DPLL if the
 * DPLL isn't bypassed.
P
Paul Walmsley 已提交
290
 */
291 292
static struct clk dpll1_x2_ck = {
	.name		= "dpll1_x2_ck",
293
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
294
	.parent		= &dpll1_ck,
295
	.flags		= RATE_PROPAGATES,
296
	.clkdm_name	= "dpll1_clkdm",
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
	.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",
312
	.ops		= &clkops_null,
313 314 315 316 317
	.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,
318
	.flags		= RATE_PROPAGATES,
319
	.clkdm_name	= "dpll1_clkdm",
320
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
321 322 323 324 325 326
};

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

327
static struct dpll_data dpll2_dd = {
P
Paul Walmsley 已提交
328 329 330
	.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,
331
	.freqsel_mask	= OMAP3430_IVA2_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
332 333
	.control_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
	.enable_mask	= OMAP3430_EN_IVA2_DPLL_MASK,
334 335
	.modes		= (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
				(1 << DPLL_LOW_POWER_BYPASS),
P
Paul Walmsley 已提交
336 337 338
	.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,
339 340 341
	.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),
342 343 344 345
	.idlest_bit	= OMAP3430_ST_IVA2_CLK_SHIFT,
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
346 347 348 349
};

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

360 361 362 363 364 365 366 367 368 369 370
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",
371
	.ops		= &clkops_null,
372 373 374 375 376 377
	.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,
378
	.flags		= RATE_PROPAGATES,
379
	.clkdm_name	= "dpll2_clkdm",
380 381 382
	.recalc		= &omap2_clksel_recalc,
};

383 384 385 386 387
/*
 * DPLL3
 * Source clock for all interfaces and for some device fclks
 * REVISIT: Also supports fast relock bypass - not included below
 */
388
static struct dpll_data dpll3_dd = {
P
Paul Walmsley 已提交
389 390 391
	.mult_div1_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.mult_mask	= OMAP3430_CORE_DPLL_MULT_MASK,
	.div1_mask	= OMAP3430_CORE_DPLL_DIV_MASK,
392
	.freqsel_mask	= OMAP3430_CORE_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
393 394 395 396 397
	.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,
398 399
	.autoidle_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
	.autoidle_mask	= OMAP3430_AUTO_CORE_DPLL_MASK,
400 401 402
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
	.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
	.flags		= RATE_PROPAGATES,
411
	.round_rate	= &omap2_dpll_round_rate,
412
	.clkdm_name	= "dpll3_clkdm",
P
Paul Walmsley 已提交
413 414 415
	.recalc		= &omap3_dpll_recalc,
};

416 417 418 419 420 421
/*
 * 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",
422
	.ops		= &clkops_null,
423
	.parent		= &dpll3_ck,
424
	.flags		= RATE_PROPAGATES,
425
	.clkdm_name	= "dpll3_clkdm",
426
	.recalc		= &omap3_clkoutx2_recalc,
P
Paul Walmsley 已提交
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 467 468 469
};

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 }
};

/*
470 471 472
 * DPLL3 output M2
 * REVISIT: This DPLL output divider must be changed in SRAM, so until
 * that code is ready, this should remain a 'read-only' clksel clock.
P
Paul Walmsley 已提交
473 474 475
 */
static struct clk dpll3_m2_ck = {
	.name		= "dpll3_m2_ck",
476
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
477 478 479 480 481
	.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,
482
	.flags		= RATE_PROPAGATES,
483
	.clkdm_name	= "dpll3_clkdm",
P
Paul Walmsley 已提交
484 485 486
	.recalc		= &omap2_clksel_recalc,
};

487
static const struct clksel core_ck_clksel[] = {
488
	{ .parent = &sys_ck,	  .rates = dpll_bypass_rates },
489 490 491 492
	{ .parent = &dpll3_m2_ck, .rates = dpll_locked_rates },
	{ .parent = NULL }
};

P
Paul Walmsley 已提交
493 494
static struct clk core_ck = {
	.name		= "core_ck",
495
	.ops		= &clkops_null,
496 497
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
498
	.clksel_mask	= OMAP3430_ST_CORE_CLK_MASK,
499
	.clksel		= core_ck_clksel,
500
	.flags		= RATE_PROPAGATES,
501
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
502 503
};

504
static const struct clksel dpll3_m2x2_ck_clksel[] = {
505
	{ .parent = &sys_ck,	  .rates = dpll_bypass_rates },
506 507
	{ .parent = &dpll3_x2_ck, .rates = dpll_locked_rates },
	{ .parent = NULL }
P
Paul Walmsley 已提交
508 509 510 511
};

static struct clk dpll3_m2x2_ck = {
	.name		= "dpll3_m2x2_ck",
512
	.ops		= &clkops_null,
513 514
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
515
	.clksel_mask	= OMAP3430_ST_CORE_CLK_MASK,
516
	.clksel		= dpll3_m2x2_ck_clksel,
517
	.flags		= RATE_PROPAGATES,
518
	.clkdm_name	= "dpll3_clkdm",
519 520 521 522 523 524 525 526 527 528 529 530
	.recalc		= &omap2_clksel_recalc,
};

/* 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",
531
	.ops		= &clkops_null,
532 533 534 535 536
	.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,
537
	.flags		= RATE_PROPAGATES,
538
	.clkdm_name	= "dpll3_clkdm",
539
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
540 541 542 543 544
};

/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll3_m3x2_ck = {
	.name		= "dpll3_m3x2_ck",
545
	.ops		= &clkops_omap2_dflt_wait,
546
	.parent		= &dpll3_m3_ck,
P
Paul Walmsley 已提交
547 548
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_EMU_CORE_SHIFT,
549
	.flags		= RATE_PROPAGATES | INVERT_ENABLE,
550
	.clkdm_name	= "dpll3_clkdm",
551
	.recalc		= &omap3_clkoutx2_recalc,
P
Paul Walmsley 已提交
552 553
};

554
static const struct clksel emu_core_alwon_ck_clksel[] = {
555
	{ .parent = &sys_ck,	    .rates = dpll_bypass_rates },
556
	{ .parent = &dpll3_m3x2_ck, .rates = dpll_locked_rates },
P
Paul Walmsley 已提交
557 558 559 560 561
	{ .parent = NULL }
};

static struct clk emu_core_alwon_ck = {
	.name		= "emu_core_alwon_ck",
562
	.ops		= &clkops_null,
563
	.parent		= &dpll3_m3x2_ck,
P
Paul Walmsley 已提交
564
	.init		= &omap2_init_clksel_parent,
565
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
566
	.clksel_mask	= OMAP3430_ST_CORE_CLK_MASK,
567
	.clksel		= emu_core_alwon_ck_clksel,
568
	.flags		= RATE_PROPAGATES,
569
	.clkdm_name	= "dpll3_clkdm",
570
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
571 572 573 574 575
};

/* DPLL4 */
/* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */
/* Type: DPLL */
576
static struct dpll_data dpll4_dd = {
P
Paul Walmsley 已提交
577 578 579
	.mult_div1_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
	.mult_mask	= OMAP3430_PERIPH_DPLL_MULT_MASK,
	.div1_mask	= OMAP3430_PERIPH_DPLL_DIV_MASK,
580
	.freqsel_mask	= OMAP3430_PERIPH_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
581 582
	.control_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_mask	= OMAP3430_EN_PERIPH_DPLL_MASK,
583
	.modes		= (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
P
Paul Walmsley 已提交
584 585 586
	.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,
587 588 589 590
	.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),
	.idlest_bit	= OMAP3430_ST_PERIPH_CLK_SHIFT,
591 592 593
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
594 595 596 597
};

static struct clk dpll4_ck = {
	.name		= "dpll4_ck",
598
	.ops		= &clkops_noncore_dpll_ops,
P
Paul Walmsley 已提交
599 600
	.parent		= &sys_ck,
	.dpll_data	= &dpll4_dd,
601
	.flags		= RATE_PROPAGATES,
602
	.round_rate	= &omap2_dpll_round_rate,
603
	.set_rate	= &omap3_dpll4_set_rate,
604
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
605 606 607 608 609
	.recalc		= &omap3_dpll_recalc,
};

/*
 * This virtual clock provides the CLKOUTX2 output from the DPLL if the
610 611
 * DPLL isn't bypassed --
 * XXX does this serve any downstream clocks?
P
Paul Walmsley 已提交
612 613 614
 */
static struct clk dpll4_x2_ck = {
	.name		= "dpll4_x2_ck",
615
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
616
	.parent		= &dpll4_ck,
617
	.flags		= RATE_PROPAGATES,
618
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
619 620 621 622
	.recalc		= &omap3_clkoutx2_recalc,
};

static const struct clksel div16_dpll4_clksel[] = {
623
	{ .parent = &dpll4_ck, .rates = div16_dpll_rates },
P
Paul Walmsley 已提交
624 625 626
	{ .parent = NULL }
};

627 628 629
/* This virtual clock is the source for dpll4_m2x2_ck */
static struct clk dpll4_m2_ck = {
	.name		= "dpll4_m2_ck",
630
	.ops		= &clkops_null,
631 632 633 634 635
	.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,
636
	.flags		= RATE_PROPAGATES,
637
	.clkdm_name	= "dpll4_clkdm",
638 639 640
	.recalc		= &omap2_clksel_recalc,
};

P
Paul Walmsley 已提交
641 642 643
/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll4_m2x2_ck = {
	.name		= "dpll4_m2x2_ck",
644
	.ops		= &clkops_omap2_dflt_wait,
645
	.parent		= &dpll4_m2_ck,
P
Paul Walmsley 已提交
646 647
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_96M_SHIFT,
648
	.flags		= RATE_PROPAGATES | INVERT_ENABLE,
649
	.clkdm_name	= "dpll4_clkdm",
650 651 652 653
	.recalc		= &omap3_clkoutx2_recalc,
};

static const struct clksel omap_96m_alwon_fck_clksel[] = {
654
	{ .parent = &sys_ck,	    .rates = dpll_bypass_rates },
655 656
	{ .parent = &dpll4_m2x2_ck, .rates = dpll_locked_rates },
	{ .parent = NULL }
P
Paul Walmsley 已提交
657 658
};

659 660 661 662 663 664
/*
 * 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 已提交
665 666
static struct clk omap_96m_alwon_fck = {
	.name		= "omap_96m_alwon_fck",
667
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
668
	.parent		= &dpll4_m2x2_ck,
669 670
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
671
	.clksel_mask	= OMAP3430_ST_PERIPH_CLK_MASK,
672
	.clksel		= omap_96m_alwon_fck_clksel,
673
	.flags		= RATE_PROPAGATES,
674
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
675 676
};

677 678
static struct clk cm_96m_fck = {
	.name		= "cm_96m_fck",
679
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
680
	.parent		= &omap_96m_alwon_fck,
681
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
682 683 684
	.recalc		= &followparent_recalc,
};

685 686 687 688 689 690 691 692 693 694 695 696 697
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 },
698 699 700
	{ .parent = NULL }
};

701 702
static struct clk omap_96m_fck = {
	.name		= "omap_96m_fck",
703
	.ops		= &clkops_null,
704
	.parent		= &sys_ck,
705
	.init		= &omap2_init_clksel_parent,
706 707 708
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_SOURCE_96M_MASK,
	.clksel		= omap_96m_fck_clksel,
709
	.flags		= RATE_PROPAGATES,
710 711 712 713 714 715
	.recalc		= &omap2_clksel_recalc,
};

/* This virtual clock is the source for dpll4_m3x2_ck */
static struct clk dpll4_m3_ck = {
	.name		= "dpll4_m3_ck",
716
	.ops		= &clkops_null,
717 718 719 720 721
	.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,
722
	.flags		= RATE_PROPAGATES,
723
	.clkdm_name	= "dpll4_clkdm",
724
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
725 726 727 728 729
};

/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll4_m3x2_ck = {
	.name		= "dpll4_m3x2_ck",
730
	.ops		= &clkops_omap2_dflt_wait,
731
	.parent		= &dpll4_m3_ck,
P
Paul Walmsley 已提交
732 733 734
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_TV_SHIFT,
735
	.flags		= RATE_PROPAGATES | INVERT_ENABLE,
736
	.clkdm_name	= "dpll4_clkdm",
737 738 739 740
	.recalc		= &omap3_clkoutx2_recalc,
};

static const struct clksel virt_omap_54m_fck_clksel[] = {
741
	{ .parent = &sys_ck,	    .rates = dpll_bypass_rates },
742 743 744 745 746 747
	{ .parent = &dpll4_m3x2_ck, .rates = dpll_locked_rates },
	{ .parent = NULL }
};

static struct clk virt_omap_54m_fck = {
	.name		= "virt_omap_54m_fck",
748
	.ops		= &clkops_null,
749 750 751
	.parent		= &dpll4_m3x2_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
752
	.clksel_mask	= OMAP3430_ST_PERIPH_CLK_MASK,
753
	.clksel		= virt_omap_54m_fck_clksel,
754
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
755 756 757 758 759 760 761 762 763 764 765 766 767 768
	.recalc		= &omap2_clksel_recalc,
};

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[] = {
769
	{ .parent = &virt_omap_54m_fck, .rates = omap_54m_d4m3x2_rates },
P
Paul Walmsley 已提交
770 771 772 773 774 775
	{ .parent = &sys_altclk,    .rates = omap_54m_alt_rates },
	{ .parent = NULL }
};

static struct clk omap_54m_fck = {
	.name		= "omap_54m_fck",
776
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
777 778
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
779
	.clksel_mask	= OMAP3430_SOURCE_54M_MASK,
P
Paul Walmsley 已提交
780
	.clksel		= omap_54m_clksel,
781
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
782 783 784
	.recalc		= &omap2_clksel_recalc,
};

785
static const struct clksel_rate omap_48m_cm96m_rates[] = {
P
Paul Walmsley 已提交
786 787 788 789 790 791 792 793 794 795
	{ .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[] = {
796
	{ .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates },
P
Paul Walmsley 已提交
797 798 799 800 801 802
	{ .parent = &sys_altclk, .rates = omap_48m_alt_rates },
	{ .parent = NULL }
};

static struct clk omap_48m_fck = {
	.name		= "omap_48m_fck",
803
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
804 805
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
806
	.clksel_mask	= OMAP3430_SOURCE_48M_MASK,
P
Paul Walmsley 已提交
807
	.clksel		= omap_48m_clksel,
808
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
809 810 811 812 813
	.recalc		= &omap2_clksel_recalc,
};

static struct clk omap_12m_fck = {
	.name		= "omap_12m_fck",
814
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
815 816
	.parent		= &omap_48m_fck,
	.fixed_div	= 4,
817
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
818 819 820
	.recalc		= &omap2_fixed_divisor_recalc,
};

821 822 823
/* This virstual clock is the source for dpll4_m4x2_ck */
static struct clk dpll4_m4_ck = {
	.name		= "dpll4_m4_ck",
824
	.ops		= &clkops_null,
825 826 827 828 829
	.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,
830
	.flags		= RATE_PROPAGATES,
831
	.clkdm_name	= "dpll4_clkdm",
832
	.recalc		= &omap2_clksel_recalc,
833 834
	.set_rate	= &omap2_clksel_set_rate,
	.round_rate	= &omap2_clksel_round_rate,
835 836
};

P
Paul Walmsley 已提交
837 838 839
/* The PWRDN bit is apparently only available on 3430ES2 and above */
static struct clk dpll4_m4x2_ck = {
	.name		= "dpll4_m4x2_ck",
840
	.ops		= &clkops_omap2_dflt_wait,
841
	.parent		= &dpll4_m4_ck,
P
Paul Walmsley 已提交
842 843
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_CAM_SHIFT,
844
	.flags		= RATE_PROPAGATES | INVERT_ENABLE,
845
	.clkdm_name	= "dpll4_clkdm",
846 847 848 849 850 851
	.recalc		= &omap3_clkoutx2_recalc,
};

/* This virtual clock is the source for dpll4_m5x2_ck */
static struct clk dpll4_m5_ck = {
	.name		= "dpll4_m5_ck",
852
	.ops		= &clkops_null,
853 854 855 856 857
	.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,
858
	.flags		= RATE_PROPAGATES,
859
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
860 861 862 863 864 865
	.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",
866
	.ops		= &clkops_omap2_dflt_wait,
867
	.parent		= &dpll4_m5_ck,
P
Paul Walmsley 已提交
868 869
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_CAM_SHIFT,
870
	.flags		= RATE_PROPAGATES | INVERT_ENABLE,
871
	.clkdm_name	= "dpll4_clkdm",
872 873 874 875 876 877
	.recalc		= &omap3_clkoutx2_recalc,
};

/* This virtual clock is the source for dpll4_m6x2_ck */
static struct clk dpll4_m6_ck = {
	.name		= "dpll4_m6_ck",
878
	.ops		= &clkops_null,
879 880 881 882 883
	.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,
884
	.flags		= RATE_PROPAGATES,
885
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
886 887 888 889 890 891
	.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",
892
	.ops		= &clkops_omap2_dflt_wait,
893
	.parent		= &dpll4_m6_ck,
P
Paul Walmsley 已提交
894 895 896
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
897
	.flags		= RATE_PROPAGATES | INVERT_ENABLE,
898
	.clkdm_name	= "dpll4_clkdm",
899
	.recalc		= &omap3_clkoutx2_recalc,
P
Paul Walmsley 已提交
900 901 902 903
};

static struct clk emu_per_alwon_ck = {
	.name		= "emu_per_alwon_ck",
904
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
905
	.parent		= &dpll4_m6x2_ck,
906
	.flags		= RATE_PROPAGATES,
907
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
908 909 910 911 912 913 914
	.recalc		= &followparent_recalc,
};

/* DPLL5 */
/* Supplies 120MHz clock, USIM source clock */
/* Type: DPLL */
/* 3430ES2 only */
915
static struct dpll_data dpll5_dd = {
P
Paul Walmsley 已提交
916 917 918
	.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,
919
	.freqsel_mask	= OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
920 921
	.control_reg	= OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
	.enable_mask	= OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
922
	.modes		= (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
P
Paul Walmsley 已提交
923 924 925
	.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,
926 927 928 929
	.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),
	.idlest_bit	= OMAP3430ES2_ST_PERIPH2_CLK_SHIFT,
930 931 932
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
933 934 935 936
};

static struct clk dpll5_ck = {
	.name		= "dpll5_ck",
937
	.ops		= &clkops_noncore_dpll_ops,
P
Paul Walmsley 已提交
938 939
	.parent		= &sys_ck,
	.dpll_data	= &dpll5_dd,
940
	.flags		= RATE_PROPAGATES,
941
	.round_rate	= &omap2_dpll_round_rate,
942
	.set_rate	= &omap3_noncore_dpll_set_rate,
943
	.clkdm_name	= "dpll5_clkdm",
P
Paul Walmsley 已提交
944 945 946
	.recalc		= &omap3_dpll_recalc,
};

947
static const struct clksel div16_dpll5_clksel[] = {
P
Paul Walmsley 已提交
948 949 950 951 952 953
	{ .parent = &dpll5_ck, .rates = div16_dpll_rates },
	{ .parent = NULL }
};

static struct clk dpll5_m2_ck = {
	.name		= "dpll5_m2_ck",
954
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
955 956 957 958
	.parent		= &dpll5_ck,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5),
	.clksel_mask	= OMAP3430ES2_DIV_120M_MASK,
959
	.clksel		= div16_dpll5_clksel,
960
	.flags		= RATE_PROPAGATES,
961
	.clkdm_name	= "dpll5_clkdm",
P
Paul Walmsley 已提交
962 963 964
	.recalc		= &omap2_clksel_recalc,
};

965
static const struct clksel omap_120m_fck_clksel[] = {
966
	{ .parent = &sys_ck,	  .rates = dpll_bypass_rates },
967 968 969 970
	{ .parent = &dpll5_m2_ck, .rates = dpll_locked_rates },
	{ .parent = NULL }
};

P
Paul Walmsley 已提交
971 972
static struct clk omap_120m_fck = {
	.name		= "omap_120m_fck",
973
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
974
	.parent		= &dpll5_m2_ck,
975 976 977 978
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
	.clksel_mask	= OMAP3430ES2_ST_PERIPH2_CLK_MASK,
	.clksel		= omap_120m_fck_clksel,
979
	.flags		= RATE_PROPAGATES,
980
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005
};

/* 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[] = {
1006 1007 1008 1009
	{ .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 已提交
1010 1011 1012 1013 1014
	{ .parent = NULL }
};

static struct clk clkout2_src_ck = {
	.name		= "clkout2_src_ck",
1015
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1016 1017 1018 1019 1020 1021
	.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,
1022
	.flags		= RATE_PROPAGATES,
1023
	.clkdm_name	= "core_clkdm",
P
Paul Walmsley 已提交
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042
	.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",
1043
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054
	.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",
1055
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1056
	.parent		= &dpll3_m2x2_ck,
1057
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067
	.recalc		= &followparent_recalc,
};

/* DPLL power domain clock controls */

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

1068 1069 1070 1071
/*
 * REVISIT: Are these in DPLL power domain or CM power domain? docs
 * may be inconsistent here?
 */
P
Paul Walmsley 已提交
1072 1073
static struct clk dpll1_fck = {
	.name		= "dpll1_fck",
1074
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1075 1076 1077 1078 1079
	.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,
	.clksel		= div2_core_clksel,
1080
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
1081 1082 1083
	.recalc		= &omap2_clksel_recalc,
};

1084 1085 1086 1087 1088 1089 1090
/*
 * MPU clksel:
 * If DPLL1 is locked, mpu_ck derives from DPLL1; otherwise, mpu_ck
 * derives from the high-frequency bypass clock originating from DPLL3,
 * called 'dpll1_fck'
 */
static const struct clksel mpu_clksel[] = {
1091
	{ .parent = &dpll1_fck,	    .rates = dpll_bypass_rates },
1092 1093 1094 1095 1096 1097
	{ .parent = &dpll1_x2m2_ck, .rates = dpll_locked_rates },
	{ .parent = NULL }
};

static struct clk mpu_ck = {
	.name		= "mpu_ck",
1098
	.ops		= &clkops_null,
1099 1100 1101 1102 1103
	.parent		= &dpll1_x2m2_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		= mpu_clksel,
1104
	.flags		= RATE_PROPAGATES,
1105
	.clkdm_name	= "mpu_clkdm",
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122
	.recalc		= &omap2_clksel_recalc,
};

/* 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",
1123
	.ops		= &clkops_null,
1124 1125 1126 1127 1128
	.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,
1129
	.flags		= RATE_PROPAGATES,
1130 1131 1132
	.recalc		= &omap2_clksel_recalc,
};

1133 1134
/* XXX What about neon_clkdm ? */

1135 1136 1137 1138 1139 1140
/*
 * 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",
1141
	.ops		= &clkops_null,
1142
	.parent		= &mpu_ck,
1143
	.flags		= RATE_PROPAGATES,
1144 1145 1146
	.recalc		= &followparent_recalc,
};

P
Paul Walmsley 已提交
1147 1148
static struct clk dpll2_fck = {
	.name		= "dpll2_fck",
1149
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1150 1151 1152 1153 1154
	.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,
	.clksel		= div2_core_clksel,
1155
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
1156 1157 1158
	.recalc		= &omap2_clksel_recalc,
};

1159 1160 1161 1162 1163 1164 1165 1166
/*
 * IVA2 clksel:
 * If DPLL2 is locked, iva2_ck derives from DPLL2; otherwise, iva2_ck
 * derives from the high-frequency bypass clock originating from DPLL3,
 * called 'dpll2_fck'
 */

static const struct clksel iva2_clksel[] = {
1167
	{ .parent = &dpll2_fck,	  .rates = dpll_bypass_rates },
1168 1169 1170 1171 1172 1173
	{ .parent = &dpll2_m2_ck, .rates = dpll_locked_rates },
	{ .parent = NULL }
};

static struct clk iva2_ck = {
	.name		= "iva2_ck",
1174
	.ops		= &clkops_omap2_dflt_wait,
1175 1176
	.parent		= &dpll2_m2_ck,
	.init		= &omap2_init_clksel_parent,
1177 1178
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT,
1179 1180 1181 1182
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD,
					  OMAP3430_CM_IDLEST_PLL),
	.clksel_mask	= OMAP3430_ST_IVA2_CLK_MASK,
	.clksel		= iva2_clksel,
1183
	.flags		= RATE_PROPAGATES,
1184
	.clkdm_name	= "iva2_clkdm",
1185 1186 1187
	.recalc		= &omap2_clksel_recalc,
};

P
Paul Walmsley 已提交
1188 1189 1190 1191
/* Common interface clocks */

static struct clk l3_ick = {
	.name		= "l3_ick",
1192
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1193 1194 1195 1196 1197
	.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,
1198
	.flags		= RATE_PROPAGATES,
1199
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1200 1201 1202 1203 1204 1205 1206 1207 1208 1209
	.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",
1210
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1211 1212 1213 1214 1215
	.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,
1216
	.flags		= RATE_PROPAGATES,
1217
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228
	.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",
1229
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1230 1231 1232 1233 1234 1235 1236 1237 1238 1239
	.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 */

1240
/* GFX clocks are in 3430ES1 only. 3430ES2 and later uses the SGX instead */
P
Paul Walmsley 已提交
1241 1242 1243 1244 1245 1246

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

1247 1248 1249
/* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */
static struct clk gfx_l3_ck = {
	.name		= "gfx_l3_ck",
1250
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1251 1252 1253 1254
	.parent		= &l3_ick,
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
	.enable_bit	= OMAP_EN_GFX_SHIFT,
1255 1256 1257 1258 1259
	.recalc		= &followparent_recalc,
};

static struct clk gfx_l3_fck = {
	.name		= "gfx_l3_fck",
1260
	.ops		= &clkops_null,
1261 1262
	.parent		= &gfx_l3_ck,
	.init		= &omap2_init_clksel_parent,
P
Paul Walmsley 已提交
1263 1264 1265
	.clksel_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP_CLKSEL_GFX_MASK,
	.clksel		= gfx_l3_clksel,
1266
	.flags		= RATE_PROPAGATES,
1267
	.clkdm_name	= "gfx_3430es1_clkdm",
P
Paul Walmsley 已提交
1268 1269 1270 1271 1272
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gfx_l3_ick = {
	.name		= "gfx_l3_ick",
1273
	.ops		= &clkops_null,
1274
	.parent		= &gfx_l3_ck,
1275
	.clkdm_name	= "gfx_3430es1_clkdm",
P
Paul Walmsley 已提交
1276 1277 1278 1279 1280
	.recalc		= &followparent_recalc,
};

static struct clk gfx_cg1_ck = {
	.name		= "gfx_cg1_ck",
1281
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1282
	.parent		= &gfx_l3_fck, /* REVISIT: correct? */
1283
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
1284 1285
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES1_EN_2D_SHIFT,
1286
	.clkdm_name	= "gfx_3430es1_clkdm",
P
Paul Walmsley 已提交
1287 1288 1289 1290 1291
	.recalc		= &followparent_recalc,
};

static struct clk gfx_cg2_ck = {
	.name		= "gfx_cg2_ck",
1292
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1293
	.parent		= &gfx_l3_fck, /* REVISIT: correct? */
1294
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
1295 1296
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES1_EN_3D_SHIFT,
1297
	.clkdm_name	= "gfx_3430es1_clkdm",
P
Paul Walmsley 已提交
1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322
	.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",
1323
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1324 1325
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN),
1326
	.enable_bit	= OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT,
P
Paul Walmsley 已提交
1327 1328 1329
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430ES2_CLKSEL_SGX_MASK,
	.clksel		= sgx_clksel,
1330
	.clkdm_name	= "sgx_clkdm",
P
Paul Walmsley 已提交
1331 1332 1333 1334 1335
	.recalc		= &omap2_clksel_recalc,
};

static struct clk sgx_ick = {
	.name		= "sgx_ick",
1336
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1337
	.parent		= &l3_ick,
1338
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
1339
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_ICLKEN),
1340
	.enable_bit	= OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT,
1341
	.clkdm_name	= "sgx_clkdm",
P
Paul Walmsley 已提交
1342 1343 1344 1345 1346 1347 1348
	.recalc		= &followparent_recalc,
};

/* CORE power domain */

static struct clk d2d_26m_fck = {
	.name		= "d2d_26m_fck",
1349
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1350
	.parent		= &sys_ck,
1351
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
1352 1353
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430ES1_EN_D2D_SHIFT,
1354
	.clkdm_name	= "d2d_clkdm",
P
Paul Walmsley 已提交
1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365
	.recalc		= &followparent_recalc,
};

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",
1366
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1367 1368 1369 1370 1371 1372 1373
	.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,
1374
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1375 1376 1377 1378 1379
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt11_fck = {
	.name		= "gpt11_fck",
1380
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1381 1382 1383 1384 1385 1386 1387
	.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,
1388
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1389 1390 1391 1392 1393
	.recalc		= &omap2_clksel_recalc,
};

static struct clk cpefuse_fck = {
	.name		= "cpefuse_fck",
1394
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1395 1396 1397 1398 1399 1400 1401 1402
	.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",
1403
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1404 1405 1406 1407 1408 1409 1410 1411
	.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",
1412
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1413 1414 1415 1416 1417 1418 1419 1420 1421 1422
	.parent		= &omap_120m_fck,
	.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",
1423
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1424
	.parent		= &omap_96m_fck,
1425
	.flags		= RATE_PROPAGATES,
1426
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1427 1428 1429 1430 1431
	.recalc		= &followparent_recalc,
};

static struct clk mmchs3_fck = {
	.name		= "mmchs_fck",
1432
	.ops		= &clkops_omap2_dflt_wait,
1433
	.id		= 2,
P
Paul Walmsley 已提交
1434 1435 1436
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430ES2_EN_MMC3_SHIFT,
1437
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1438 1439 1440 1441 1442
	.recalc		= &followparent_recalc,
};

static struct clk mmchs2_fck = {
	.name		= "mmchs_fck",
1443
	.ops		= &clkops_omap2_dflt_wait,
1444
	.id		= 1,
P
Paul Walmsley 已提交
1445 1446 1447
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MMC2_SHIFT,
1448
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1449 1450 1451 1452 1453
	.recalc		= &followparent_recalc,
};

static struct clk mspro_fck = {
	.name		= "mspro_fck",
1454
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1455 1456 1457
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MSPRO_SHIFT,
1458
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1459 1460 1461 1462 1463
	.recalc		= &followparent_recalc,
};

static struct clk mmchs1_fck = {
	.name		= "mmchs_fck",
1464
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1465 1466 1467
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MMC1_SHIFT,
1468
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1469 1470 1471 1472 1473
	.recalc		= &followparent_recalc,
};

static struct clk i2c3_fck = {
	.name		= "i2c_fck",
1474
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1475 1476 1477 1478
	.id		= 3,
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_I2C3_SHIFT,
1479
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1480 1481 1482 1483 1484
	.recalc		= &followparent_recalc,
};

static struct clk i2c2_fck = {
	.name		= "i2c_fck",
1485
	.ops		= &clkops_omap2_dflt_wait,
1486
	.id		= 2,
P
Paul Walmsley 已提交
1487 1488 1489
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_I2C2_SHIFT,
1490
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1491 1492 1493 1494 1495
	.recalc		= &followparent_recalc,
};

static struct clk i2c1_fck = {
	.name		= "i2c_fck",
1496
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1497 1498 1499 1500
	.id		= 1,
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_I2C1_SHIFT,
1501
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525
	.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 = {
1526
	.name		= "mcbsp_fck",
1527
	.ops		= &clkops_omap2_dflt_wait,
1528
	.id		= 5,
P
Paul Walmsley 已提交
1529 1530 1531 1532 1533 1534
	.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,
1535
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1536 1537 1538 1539
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mcbsp1_fck = {
1540
	.name		= "mcbsp_fck",
1541
	.ops		= &clkops_omap2_dflt_wait,
1542
	.id		= 1,
P
Paul Walmsley 已提交
1543 1544 1545 1546 1547 1548
	.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,
1549
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1550 1551 1552 1553 1554 1555 1556
	.recalc		= &omap2_clksel_recalc,
};

/* CORE_48M_FCK-derived clocks */

static struct clk core_48m_fck = {
	.name		= "core_48m_fck",
1557
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1558
	.parent		= &omap_48m_fck,
1559
	.flags		= RATE_PROPAGATES,
1560
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1561 1562 1563 1564 1565
	.recalc		= &followparent_recalc,
};

static struct clk mcspi4_fck = {
	.name		= "mcspi_fck",
1566
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1567 1568 1569 1570 1571 1572 1573 1574 1575
	.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",
1576
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1577 1578 1579 1580 1581 1582 1583 1584 1585
	.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",
1586
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1587 1588 1589 1590 1591 1592 1593 1594 1595
	.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",
1596
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1597 1598 1599 1600 1601 1602 1603 1604 1605
	.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",
1606
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1607 1608 1609 1610 1611 1612 1613 1614
	.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",
1615
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1616 1617 1618 1619 1620 1621 1622 1623
	.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",
1624
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1625 1626 1627 1628 1629 1630 1631 1632 1633 1634
	.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",
1635
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1636
	.parent		= &omap_12m_fck,
1637
	.flags		= RATE_PROPAGATES,
1638
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1639 1640 1641 1642 1643
	.recalc		= &followparent_recalc,
};

static struct clk hdq_fck = {
	.name		= "hdq_fck",
1644
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669
	.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 }
};

static struct clk ssi_ssr_fck = {
	.name		= "ssi_ssr_fck",
1670
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1671 1672 1673 1674 1675 1676
	.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,
1677
	.flags		= RATE_PROPAGATES,
1678
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1679 1680 1681 1682 1683
	.recalc		= &omap2_clksel_recalc,
};

static struct clk ssi_sst_fck = {
	.name		= "ssi_sst_fck",
1684
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1685 1686 1687 1688 1689 1690 1691 1692 1693
	.parent		= &ssi_ssr_fck,
	.fixed_div	= 2,
	.recalc		= &omap2_fixed_divisor_recalc,
};



/* CORE_L3_ICK based clocks */

1694 1695 1696 1697
/*
 * XXX must add clk_enable/clk_disable for these if standard code won't
 * handle it
 */
P
Paul Walmsley 已提交
1698 1699
static struct clk core_l3_ick = {
	.name		= "core_l3_ick",
1700
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1701
	.parent		= &l3_ick,
1702
	.init		= &omap2_init_clk_clkdm,
1703
	.flags		= RATE_PROPAGATES,
1704
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1705 1706 1707 1708 1709
	.recalc		= &followparent_recalc,
};

static struct clk hsotgusb_ick = {
	.name		= "hsotgusb_ick",
1710
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1711 1712 1713
	.parent		= &core_l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_HSOTGUSB_SHIFT,
1714
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1715 1716 1717 1718 1719
	.recalc		= &followparent_recalc,
};

static struct clk sdrc_ick = {
	.name		= "sdrc_ick",
1720
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1721 1722 1723
	.parent		= &core_l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SDRC_SHIFT,
1724
	.flags		= ENABLE_ON_INIT,
1725
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1726 1727 1728 1729 1730
	.recalc		= &followparent_recalc,
};

static struct clk gpmc_fck = {
	.name		= "gpmc_fck",
1731
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1732
	.parent		= &core_l3_ick,
1733
	.flags		= ENABLE_ON_INIT, /* huh? */
1734
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1735 1736 1737 1738 1739 1740 1741
	.recalc		= &followparent_recalc,
};

/* SECURITY_L3_ICK based clocks */

static struct clk security_l3_ick = {
	.name		= "security_l3_ick",
1742
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1743
	.parent		= &l3_ick,
1744
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
1745 1746 1747 1748 1749
	.recalc		= &followparent_recalc,
};

static struct clk pka_ick = {
	.name		= "pka_ick",
1750
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1751 1752 1753 1754 1755 1756 1757 1758 1759 1760
	.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",
1761
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1762
	.parent		= &l4_ick,
1763
	.init		= &omap2_init_clk_clkdm,
1764
	.flags		= RATE_PROPAGATES,
1765
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1766 1767 1768 1769 1770
	.recalc		= &followparent_recalc,
};

static struct clk usbtll_ick = {
	.name		= "usbtll_ick",
1771
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1772 1773 1774
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
	.enable_bit	= OMAP3430ES2_EN_USBTLL_SHIFT,
1775
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1776 1777 1778 1779 1780
	.recalc		= &followparent_recalc,
};

static struct clk mmchs3_ick = {
	.name		= "mmchs_ick",
1781
	.ops		= &clkops_omap2_dflt_wait,
1782
	.id		= 2,
P
Paul Walmsley 已提交
1783 1784 1785
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430ES2_EN_MMC3_SHIFT,
1786
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1787 1788 1789 1790 1791 1792
	.recalc		= &followparent_recalc,
};

/* Intersystem Communication Registers - chassis mode only */
static struct clk icr_ick = {
	.name		= "icr_ick",
1793
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1794 1795 1796
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_ICR_SHIFT,
1797
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1798 1799 1800 1801 1802
	.recalc		= &followparent_recalc,
};

static struct clk aes2_ick = {
	.name		= "aes2_ick",
1803
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1804 1805 1806
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_AES2_SHIFT,
1807
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1808 1809 1810 1811 1812
	.recalc		= &followparent_recalc,
};

static struct clk sha12_ick = {
	.name		= "sha12_ick",
1813
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1814 1815 1816
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SHA12_SHIFT,
1817
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1818 1819 1820 1821 1822
	.recalc		= &followparent_recalc,
};

static struct clk des2_ick = {
	.name		= "des2_ick",
1823
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1824 1825 1826
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_DES2_SHIFT,
1827
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1828 1829 1830 1831 1832
	.recalc		= &followparent_recalc,
};

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

static struct clk mmchs1_ick = {
	.name		= "mmchs_ick",
1844
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1845 1846 1847
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MMC1_SHIFT,
1848
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1849 1850 1851 1852 1853
	.recalc		= &followparent_recalc,
};

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

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

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

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

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

static struct clk mcspi1_ick = {
	.name		= "mcspi_ick",
1907
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1908 1909 1910 1911
	.id		= 1,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI1_SHIFT,
1912
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1913 1914 1915 1916 1917
	.recalc		= &followparent_recalc,
};

static struct clk i2c3_ick = {
	.name		= "i2c_ick",
1918
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1919 1920 1921 1922
	.id		= 3,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_I2C3_SHIFT,
1923
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1924 1925 1926 1927 1928
	.recalc		= &followparent_recalc,
};

static struct clk i2c2_ick = {
	.name		= "i2c_ick",
1929
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1930 1931 1932 1933
	.id		= 2,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_I2C2_SHIFT,
1934
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1935 1936 1937 1938 1939
	.recalc		= &followparent_recalc,
};

static struct clk i2c1_ick = {
	.name		= "i2c_ick",
1940
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1941 1942 1943 1944
	.id		= 1,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_I2C1_SHIFT,
1945
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1946 1947 1948 1949 1950
	.recalc		= &followparent_recalc,
};

static struct clk uart2_ick = {
	.name		= "uart2_ick",
1951
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1952 1953 1954
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_UART2_SHIFT,
1955
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1956 1957 1958 1959 1960
	.recalc		= &followparent_recalc,
};

static struct clk uart1_ick = {
	.name		= "uart1_ick",
1961
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1962 1963 1964
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_UART1_SHIFT,
1965
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1966 1967 1968 1969 1970
	.recalc		= &followparent_recalc,
};

static struct clk gpt11_ick = {
	.name		= "gpt11_ick",
1971
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1972 1973 1974
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_GPT11_SHIFT,
1975
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1976 1977 1978 1979 1980
	.recalc		= &followparent_recalc,
};

static struct clk gpt10_ick = {
	.name		= "gpt10_ick",
1981
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1982 1983 1984
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_GPT10_SHIFT,
1985
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1986 1987 1988 1989
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp5_ick = {
1990
	.name		= "mcbsp_ick",
1991
	.ops		= &clkops_omap2_dflt_wait,
1992
	.id		= 5,
P
Paul Walmsley 已提交
1993 1994 1995
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCBSP5_SHIFT,
1996
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1997 1998 1999 2000
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp1_ick = {
2001
	.name		= "mcbsp_ick",
2002
	.ops		= &clkops_omap2_dflt_wait,
2003
	.id		= 1,
P
Paul Walmsley 已提交
2004 2005 2006
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCBSP1_SHIFT,
2007
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
2008 2009 2010 2011 2012
	.recalc		= &followparent_recalc,
};

static struct clk fac_ick = {
	.name		= "fac_ick",
2013
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2014 2015 2016
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430ES1_EN_FAC_SHIFT,
2017
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
2018 2019 2020 2021 2022
	.recalc		= &followparent_recalc,
};

static struct clk mailboxes_ick = {
	.name		= "mailboxes_ick",
2023
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2024 2025 2026
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MAILBOXES_SHIFT,
2027
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
2028 2029 2030 2031 2032
	.recalc		= &followparent_recalc,
};

static struct clk omapctrl_ick = {
	.name		= "omapctrl_ick",
2033
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2034 2035 2036
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_OMAPCTRL_SHIFT,
2037
	.flags		= ENABLE_ON_INIT,
P
Paul Walmsley 已提交
2038 2039 2040 2041 2042 2043 2044
	.recalc		= &followparent_recalc,
};

/* SSI_L4_ICK based clocks */

static struct clk ssi_l4_ick = {
	.name		= "ssi_l4_ick",
2045
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2046
	.parent		= &l4_ick,
2047
	.flags		= RATE_PROPAGATES,
2048
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
2049 2050 2051 2052 2053
	.recalc		= &followparent_recalc,
};

static struct clk ssi_ick = {
	.name		= "ssi_ick",
2054
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2055 2056 2057
	.parent		= &ssi_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SSI_SHIFT,
2058
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071
	.recalc		= &followparent_recalc,
};

/* 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",
2072
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088
	.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,
};

/* XXX MDM_INTC_ICK, SAD2D_ICK ?? */

/* SECURITY_L4_ICK2 based clocks */

static struct clk security_l4_ick2 = {
	.name		= "security_l4_ick2",
2089
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2090
	.parent		= &l4_ick,
2091
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
2092 2093 2094 2095 2096
	.recalc		= &followparent_recalc,
};

static struct clk aes1_ick = {
	.name		= "aes1_ick",
2097
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2098 2099 2100 2101 2102 2103 2104 2105
	.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",
2106
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2107 2108 2109 2110 2111 2112 2113 2114
	.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",
2115
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2116 2117 2118 2119 2120 2121 2122 2123
	.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",
2124
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2125 2126 2127 2128 2129 2130 2131
	.parent		= &security_l4_ick2,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP3430_EN_DES1_SHIFT,
	.recalc		= &followparent_recalc,
};

/* DSS */
2132
static const struct clksel dss1_alwon_fck_clksel[] = {
2133
	{ .parent = &sys_ck,	    .rates = dpll_bypass_rates },
2134 2135 2136
	{ .parent = &dpll4_m4x2_ck, .rates = dpll_locked_rates },
	{ .parent = NULL }
};
P
Paul Walmsley 已提交
2137 2138 2139

static struct clk dss1_alwon_fck = {
	.name		= "dss1_alwon_fck",
2140
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2141
	.parent		= &dpll4_m4x2_ck,
2142
	.init		= &omap2_init_clksel_parent,
P
Paul Walmsley 已提交
2143 2144
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_DSS1_SHIFT,
2145
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
2146
	.clksel_mask	= OMAP3430_ST_PERIPH_CLK_MASK,
2147
	.clksel		= dss1_alwon_fck_clksel,
2148
	.clkdm_name	= "dss_clkdm",
2149
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
2150 2151 2152 2153
};

static struct clk dss_tv_fck = {
	.name		= "dss_tv_fck",
2154
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2155
	.parent		= &omap_54m_fck,
2156
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2157 2158
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_TV_SHIFT,
2159
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2160 2161 2162 2163 2164
	.recalc		= &followparent_recalc,
};

static struct clk dss_96m_fck = {
	.name		= "dss_96m_fck",
2165
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2166
	.parent		= &omap_96m_fck,
2167
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2168 2169
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_TV_SHIFT,
2170
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2171 2172 2173 2174 2175
	.recalc		= &followparent_recalc,
};

static struct clk dss2_alwon_fck = {
	.name		= "dss2_alwon_fck",
2176
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2177
	.parent		= &sys_ck,
2178
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2179 2180
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_DSS2_SHIFT,
2181
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2182 2183 2184 2185 2186 2187
	.recalc		= &followparent_recalc,
};

static struct clk dss_ick = {
	/* Handles both L3 and L4 clocks */
	.name		= "dss_ick",
2188
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2189
	.parent		= &l4_ick,
2190
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2191 2192
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
2193
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2194 2195 2196 2197 2198
	.recalc		= &followparent_recalc,
};

/* CAM */

2199
static const struct clksel cam_mclk_clksel[] = {
2200
	{ .parent = &sys_ck,	    .rates = dpll_bypass_rates },
2201 2202 2203 2204
	{ .parent = &dpll4_m5x2_ck, .rates = dpll_locked_rates },
	{ .parent = NULL }
};

P
Paul Walmsley 已提交
2205 2206
static struct clk cam_mclk = {
	.name		= "cam_mclk",
2207
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2208
	.parent		= &dpll4_m5x2_ck,
2209 2210
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
2211
	.clksel_mask	= OMAP3430_ST_PERIPH_CLK_MASK,
2212
	.clksel		= cam_mclk_clksel,
P
Paul Walmsley 已提交
2213 2214
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_CAM_SHIFT,
2215
	.clkdm_name	= "cam_clkdm",
2216
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
2217 2218
};

2219 2220 2221
static struct clk cam_ick = {
	/* Handles both L3 and L4 clocks */
	.name		= "cam_ick",
2222
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2223
	.parent		= &l4_ick,
2224
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2225 2226
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_CAM_SHIFT,
2227
	.clkdm_name	= "cam_clkdm",
P
Paul Walmsley 已提交
2228 2229 2230
	.recalc		= &followparent_recalc,
};

2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241
static struct clk csi2_96m_fck = {
	.name		= "csi2_96m_fck",
	.ops		= &clkops_omap2_dflt_wait,
	.parent		= &core_96m_fck,
	.init		= &omap2_init_clk_clkdm,
	.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 已提交
2242 2243 2244 2245
/* USBHOST - 3430ES2 only */

static struct clk usbhost_120m_fck = {
	.name		= "usbhost_120m_fck",
2246
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2247
	.parent		= &omap_120m_fck,
2248
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2249 2250
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES2_EN_USBHOST2_SHIFT,
2251
	.clkdm_name	= "usbhost_clkdm",
P
Paul Walmsley 已提交
2252 2253 2254 2255 2256
	.recalc		= &followparent_recalc,
};

static struct clk usbhost_48m_fck = {
	.name		= "usbhost_48m_fck",
2257
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2258
	.parent		= &omap_48m_fck,
2259
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2260 2261
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES2_EN_USBHOST1_SHIFT,
2262
	.clkdm_name	= "usbhost_clkdm",
P
Paul Walmsley 已提交
2263 2264 2265
	.recalc		= &followparent_recalc,
};

2266 2267 2268
static struct clk usbhost_ick = {
	/* Handles both L3 and L4 clocks */
	.name		= "usbhost_ick",
2269
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2270
	.parent		= &l4_ick,
2271
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2272 2273
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430ES2_EN_USBHOST_SHIFT,
2274
	.clkdm_name	= "usbhost_clkdm",
P
Paul Walmsley 已提交
2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305
	.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 },
	{ .parent = &omap_120m_fck,	.rates = usim_120m_rates },
	{ .parent = &sys_ck,		.rates = div2_rates },
	{ .parent = NULL },
};

/* 3430ES2 only */
static struct clk usim_fck = {
	.name		= "usim_fck",
2306
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2307 2308 2309 2310 2311 2312 2313 2314 2315
	.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,
};

2316
/* XXX should gpt1's clksel have wkup_32k_fck as the 32k opt? */
P
Paul Walmsley 已提交
2317 2318
static struct clk gpt1_fck = {
	.name		= "gpt1_fck",
2319
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2320 2321 2322 2323 2324 2325
	.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,
2326
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2327 2328 2329 2330 2331
	.recalc		= &omap2_clksel_recalc,
};

static struct clk wkup_32k_fck = {
	.name		= "wkup_32k_fck",
2332
	.ops		= &clkops_null,
2333
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2334
	.parent		= &omap_32k_fck,
2335
	.flags		= RATE_PROPAGATES,
2336
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2337 2338 2339
	.recalc		= &followparent_recalc,
};

2340 2341
static struct clk gpio1_dbck = {
	.name		= "gpio1_dbck",
2342
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2343 2344 2345
	.parent		= &wkup_32k_fck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPIO1_SHIFT,
2346
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2347 2348 2349 2350 2351
	.recalc		= &followparent_recalc,
};

static struct clk wdt2_fck = {
	.name		= "wdt2_fck",
2352
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2353 2354 2355
	.parent		= &wkup_32k_fck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_WDT2_SHIFT,
2356
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2357 2358 2359 2360 2361
	.recalc		= &followparent_recalc,
};

static struct clk wkup_l4_ick = {
	.name		= "wkup_l4_ick",
2362
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2363
	.parent		= &sys_ck,
2364
	.flags		= RATE_PROPAGATES,
2365
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2366 2367 2368 2369 2370 2371 2372
	.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",
2373
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2374 2375 2376
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430ES2_EN_USIMOCP_SHIFT,
2377
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2378 2379 2380 2381 2382
	.recalc		= &followparent_recalc,
};

static struct clk wdt2_ick = {
	.name		= "wdt2_ick",
2383
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2384 2385 2386
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_WDT2_SHIFT,
2387
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2388 2389 2390 2391 2392
	.recalc		= &followparent_recalc,
};

static struct clk wdt1_ick = {
	.name		= "wdt1_ick",
2393
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2394 2395 2396
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_WDT1_SHIFT,
2397
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2398 2399 2400 2401 2402
	.recalc		= &followparent_recalc,
};

static struct clk gpio1_ick = {
	.name		= "gpio1_ick",
2403
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2404 2405 2406
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO1_SHIFT,
2407
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2408 2409 2410 2411 2412
	.recalc		= &followparent_recalc,
};

static struct clk omap_32ksync_ick = {
	.name		= "omap_32ksync_ick",
2413
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2414 2415 2416
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_32KSYNC_SHIFT,
2417
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2418 2419 2420
	.recalc		= &followparent_recalc,
};

2421
/* XXX This clock no longer exists in 3430 TRM rev F */
P
Paul Walmsley 已提交
2422 2423
static struct clk gpt12_ick = {
	.name		= "gpt12_ick",
2424
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2425 2426 2427
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT12_SHIFT,
2428
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2429 2430 2431 2432 2433
	.recalc		= &followparent_recalc,
};

static struct clk gpt1_ick = {
	.name		= "gpt1_ick",
2434
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2435 2436 2437
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT1_SHIFT,
2438
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2439 2440 2441 2442 2443 2444 2445 2446 2447
	.recalc		= &followparent_recalc,
};



/* PER clock domain */

static struct clk per_96m_fck = {
	.name		= "per_96m_fck",
2448
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2449
	.parent		= &omap_96m_alwon_fck,
2450
	.init		= &omap2_init_clk_clkdm,
2451
	.flags		= RATE_PROPAGATES,
2452
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2453 2454 2455 2456 2457
	.recalc		= &followparent_recalc,
};

static struct clk per_48m_fck = {
	.name		= "per_48m_fck",
2458
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2459
	.parent		= &omap_48m_fck,
2460
	.init		= &omap2_init_clk_clkdm,
2461
	.flags		= RATE_PROPAGATES,
2462
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2463 2464 2465 2466 2467
	.recalc		= &followparent_recalc,
};

static struct clk uart3_fck = {
	.name		= "uart3_fck",
2468
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2469 2470 2471
	.parent		= &per_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_UART3_SHIFT,
2472
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2473 2474 2475 2476 2477
	.recalc		= &followparent_recalc,
};

static struct clk gpt2_fck = {
	.name		= "gpt2_fck",
2478
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2479 2480 2481 2482 2483 2484
	.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,
2485
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2486 2487 2488 2489 2490
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt3_fck = {
	.name		= "gpt3_fck",
2491
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2492 2493 2494 2495 2496 2497
	.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,
2498
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2499 2500 2501 2502 2503
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt4_fck = {
	.name		= "gpt4_fck",
2504
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2505 2506 2507 2508 2509 2510
	.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,
2511
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2512 2513 2514 2515 2516
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt5_fck = {
	.name		= "gpt5_fck",
2517
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2518 2519 2520 2521 2522 2523
	.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,
2524
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2525 2526 2527 2528 2529
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt6_fck = {
	.name		= "gpt6_fck",
2530
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2531 2532 2533 2534 2535 2536
	.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,
2537
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2538 2539 2540 2541 2542
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt7_fck = {
	.name		= "gpt7_fck",
2543
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2544 2545 2546 2547 2548 2549
	.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,
2550
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2551 2552 2553 2554 2555
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt8_fck = {
	.name		= "gpt8_fck",
2556
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2557 2558 2559 2560 2561 2562
	.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,
2563
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2564 2565 2566 2567 2568
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt9_fck = {
	.name		= "gpt9_fck",
2569
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2570 2571 2572 2573 2574 2575
	.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,
2576
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2577 2578 2579 2580 2581
	.recalc		= &omap2_clksel_recalc,
};

static struct clk per_32k_alwon_fck = {
	.name		= "per_32k_alwon_fck",
2582
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2583
	.parent		= &omap_32k_fck,
2584
	.clkdm_name	= "per_clkdm",
2585
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
2586 2587 2588
	.recalc		= &followparent_recalc,
};

2589 2590
static struct clk gpio6_dbck = {
	.name		= "gpio6_dbck",
2591
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2592 2593
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2594
	.enable_bit	= OMAP3430_EN_GPIO6_SHIFT,
2595
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2596 2597 2598
	.recalc		= &followparent_recalc,
};

2599 2600
static struct clk gpio5_dbck = {
	.name		= "gpio5_dbck",
2601
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2602 2603
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2604
	.enable_bit	= OMAP3430_EN_GPIO5_SHIFT,
2605
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2606 2607 2608
	.recalc		= &followparent_recalc,
};

2609 2610
static struct clk gpio4_dbck = {
	.name		= "gpio4_dbck",
2611
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2612 2613
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2614
	.enable_bit	= OMAP3430_EN_GPIO4_SHIFT,
2615
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2616 2617 2618
	.recalc		= &followparent_recalc,
};

2619 2620
static struct clk gpio3_dbck = {
	.name		= "gpio3_dbck",
2621
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2622 2623
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2624
	.enable_bit	= OMAP3430_EN_GPIO3_SHIFT,
2625
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2626 2627 2628
	.recalc		= &followparent_recalc,
};

2629 2630
static struct clk gpio2_dbck = {
	.name		= "gpio2_dbck",
2631
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2632 2633
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2634
	.enable_bit	= OMAP3430_EN_GPIO2_SHIFT,
2635
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2636 2637 2638 2639 2640
	.recalc		= &followparent_recalc,
};

static struct clk wdt3_fck = {
	.name		= "wdt3_fck",
2641
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2642 2643 2644
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_WDT3_SHIFT,
2645
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2646 2647 2648 2649 2650
	.recalc		= &followparent_recalc,
};

static struct clk per_l4_ick = {
	.name		= "per_l4_ick",
2651
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2652
	.parent		= &l4_ick,
2653
	.flags		= RATE_PROPAGATES,
2654
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2655 2656 2657 2658 2659
	.recalc		= &followparent_recalc,
};

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

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

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

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

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

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

static struct clk uart3_ick = {
	.name		= "uart3_ick",
2720
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2721 2722 2723
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_UART3_SHIFT,
2724
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2725 2726 2727 2728 2729
	.recalc		= &followparent_recalc,
};

static struct clk gpt9_ick = {
	.name		= "gpt9_ick",
2730
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2731 2732 2733
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT9_SHIFT,
2734
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2735 2736 2737 2738 2739
	.recalc		= &followparent_recalc,
};

static struct clk gpt8_ick = {
	.name		= "gpt8_ick",
2740
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2741 2742 2743
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT8_SHIFT,
2744
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2745 2746 2747 2748 2749
	.recalc		= &followparent_recalc,
};

static struct clk gpt7_ick = {
	.name		= "gpt7_ick",
2750
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2751 2752 2753
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT7_SHIFT,
2754
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2755 2756 2757 2758 2759
	.recalc		= &followparent_recalc,
};

static struct clk gpt6_ick = {
	.name		= "gpt6_ick",
2760
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2761 2762 2763
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT6_SHIFT,
2764
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2765 2766 2767 2768 2769
	.recalc		= &followparent_recalc,
};

static struct clk gpt5_ick = {
	.name		= "gpt5_ick",
2770
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2771 2772 2773
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT5_SHIFT,
2774
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2775 2776 2777 2778 2779
	.recalc		= &followparent_recalc,
};

static struct clk gpt4_ick = {
	.name		= "gpt4_ick",
2780
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2781 2782 2783
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT4_SHIFT,
2784
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2785 2786 2787 2788 2789
	.recalc		= &followparent_recalc,
};

static struct clk gpt3_ick = {
	.name		= "gpt3_ick",
2790
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2791 2792 2793
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT3_SHIFT,
2794
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2795 2796 2797 2798 2799
	.recalc		= &followparent_recalc,
};

static struct clk gpt2_ick = {
	.name		= "gpt2_ick",
2800
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2801 2802 2803
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT2_SHIFT,
2804
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2805 2806 2807 2808
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp2_ick = {
2809
	.name		= "mcbsp_ick",
2810
	.ops		= &clkops_omap2_dflt_wait,
2811
	.id		= 2,
P
Paul Walmsley 已提交
2812 2813 2814
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP2_SHIFT,
2815
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2816 2817 2818 2819
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp3_ick = {
2820
	.name		= "mcbsp_ick",
2821
	.ops		= &clkops_omap2_dflt_wait,
2822
	.id		= 3,
P
Paul Walmsley 已提交
2823 2824 2825
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP3_SHIFT,
2826
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2827 2828 2829 2830
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp4_ick = {
2831
	.name		= "mcbsp_ick",
2832
	.ops		= &clkops_omap2_dflt_wait,
2833
	.id		= 4,
P
Paul Walmsley 已提交
2834 2835 2836
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP4_SHIFT,
2837
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2838 2839 2840 2841
	.recalc		= &followparent_recalc,
};

static const struct clksel mcbsp_234_clksel[] = {
2842 2843
	{ .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
	{ .parent = &mcbsp_clks,   .rates = common_mcbsp_mcbsp_rates },
P
Paul Walmsley 已提交
2844 2845 2846 2847
	{ .parent = NULL }
};

static struct clk mcbsp2_fck = {
2848
	.name		= "mcbsp_fck",
2849
	.ops		= &clkops_omap2_dflt_wait,
2850
	.id		= 2,
P
Paul Walmsley 已提交
2851 2852 2853 2854 2855 2856
	.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,
2857
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2858 2859 2860 2861
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mcbsp3_fck = {
2862
	.name		= "mcbsp_fck",
2863
	.ops		= &clkops_omap2_dflt_wait,
2864
	.id		= 3,
P
Paul Walmsley 已提交
2865 2866 2867 2868 2869 2870
	.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,
2871
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2872 2873 2874 2875
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mcbsp4_fck = {
2876
	.name		= "mcbsp_fck",
2877
	.ops		= &clkops_omap2_dflt_wait,
2878
	.id		= 4,
P
Paul Walmsley 已提交
2879 2880 2881 2882 2883 2884
	.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,
2885
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927
	.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",
2928
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2929 2930 2931 2932
	.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,
2933
	.flags		= RATE_PROPAGATES,
2934
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952
	.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",
2953
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2954 2955 2956 2957
	.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,
2958
	.flags		= RATE_PROPAGATES,
2959
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976
	.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",
2977
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2978 2979 2980 2981
	.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,
2982
	.flags		= RATE_PROPAGATES,
2983
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2984 2985 2986 2987 2988 2989 2990 2991 2992 2993
	.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",
2994
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2995 2996 2997 2998
	.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,
2999
	.flags		= RATE_PROPAGATES,
3000
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
3001 3002 3003 3004 3005
	.recalc		= &omap2_clksel_recalc,
};

static struct clk traceclk_src_fck = {
	.name		= "traceclk_src_fck",
3006
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
3007 3008 3009 3010
	.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,
3011
	.flags		= RATE_PROPAGATES,
3012
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029
	.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",
3030
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
3031 3032 3033 3034
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_CLKSEL_TRACECLK_MASK,
	.clksel		= traceclk_clksel,
3035
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
3036 3037 3038 3039 3040 3041 3042 3043
	.recalc		= &omap2_clksel_recalc,
};

/* SR clocks */

/* SmartReflex fclk (VDD1) */
static struct clk sr1_fck = {
	.name		= "sr1_fck",
3044
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
3045 3046 3047
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_SR1_SHIFT,
3048
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
3049 3050 3051 3052 3053 3054
	.recalc		= &followparent_recalc,
};

/* SmartReflex fclk (VDD2) */
static struct clk sr2_fck = {
	.name		= "sr2_fck",
3055
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
3056 3057 3058
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_SR2_SHIFT,
3059
	.flags		= RATE_PROPAGATES,
P
Paul Walmsley 已提交
3060 3061 3062 3063 3064
	.recalc		= &followparent_recalc,
};

static struct clk sr_l4_ick = {
	.name		= "sr_l4_ick",
3065
	.ops		= &clkops_null, /* RMK: missing? */
P
Paul Walmsley 已提交
3066
	.parent		= &l4_ick,
3067
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
3068 3069 3070 3071 3072
	.recalc		= &followparent_recalc,
};

/* SECURE_32K_FCK clocks */

3073
/* XXX This clock no longer exists in 3430 TRM rev F */
P
Paul Walmsley 已提交
3074 3075
static struct clk gpt12_fck = {
	.name		= "gpt12_fck",
3076
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
3077 3078 3079 3080 3081 3082
	.parent		= &secure_32k_fck,
	.recalc		= &followparent_recalc,
};

static struct clk wdt1_fck = {
	.name		= "wdt1_fck",
3083
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
3084
	.parent		= &secure_32k_fck,
3085
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
3086 3087 3088
};

#endif