clock34xx.h 82.2 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

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

30 31
static unsigned long omap3_dpll_recalc(struct clk *clk);
static unsigned long 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);
37
static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate);
P
Paul Walmsley 已提交
38

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

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

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

55 56 57 58 59
/* 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 已提交
60 61 62 63 64
/* 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",
65
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
66
	.rate		= 32768,
67
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
68 69 70 71
};

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

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

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

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

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

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

static struct clk virt_38_4m_ck = {
	.name		= "virt_38_4m_ck",
115
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
116
	.rate		= 38400000,
117
	.flags		= RATE_FIXED,
P
Paul Walmsley 已提交
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 159 160 161 162 163
};

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

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

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

/* PRM EXTERNAL CLOCK OUTPUT */

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

/* DPLLS */

/* CM CLOCKS */

224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
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 已提交
244 245 246
/* DPLL1 */
/* MPU clock source */
/* Type: DPLL */
247
static struct dpll_data dpll1_dd = {
P
Paul Walmsley 已提交
248 249 250
	.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,
251 252
	.clk_bypass	= &dpll1_fck,
	.clk_ref	= &sys_ck,
253
	.freqsel_mask	= OMAP3430_MPU_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
254 255
	.control_reg	= OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
	.enable_mask	= OMAP3430_EN_MPU_DPLL_MASK,
256
	.modes		= (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
P
Paul Walmsley 已提交
257 258 259
	.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,
260 261 262
	.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),
263
	.idlest_mask	= OMAP3430_ST_MPU_CLK_MASK,
264
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
265
	.min_divider	= 1,
266 267
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
268 269 270 271
};

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

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

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

319
static struct dpll_data dpll2_dd = {
P
Paul Walmsley 已提交
320 321 322
	.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,
323 324
	.clk_bypass	= &dpll2_fck,
	.clk_ref	= &sys_ck,
325
	.freqsel_mask	= OMAP3430_IVA2_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
326 327
	.control_reg	= OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
	.enable_mask	= OMAP3430_EN_IVA2_DPLL_MASK,
328 329
	.modes		= (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
				(1 << DPLL_LOW_POWER_BYPASS),
P
Paul Walmsley 已提交
330 331 332
	.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,
333 334 335
	.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),
336
	.idlest_mask	= OMAP3430_ST_IVA2_CLK_MASK,
337
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
338
	.min_divider	= 1,
339 340
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
341 342 343 344
};

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

354 355 356 357 358 359 360 361 362 363 364
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",
365
	.ops		= &clkops_null,
366 367 368 369 370 371
	.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,
372
	.clkdm_name	= "dpll2_clkdm",
373 374 375
	.recalc		= &omap2_clksel_recalc,
};

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

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

413 414 415 416 417 418
/*
 * 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",
419
	.ops		= &clkops_null,
420
	.parent		= &dpll3_ck,
421
	.clkdm_name	= "dpll3_clkdm",
422
	.recalc		= &omap3_clkoutx2_recalc,
P
Paul Walmsley 已提交
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464
};

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

465
/* DPLL3 output M2 - primary control point for CORE speed */
P
Paul Walmsley 已提交
466 467
static struct clk dpll3_m2_ck = {
	.name		= "dpll3_m2_ck",
468
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
469 470 471 472 473
	.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,
474
	.clkdm_name	= "dpll3_clkdm",
475 476
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap3_core_dpll_m2_set_rate,
P
Paul Walmsley 已提交
477 478 479 480 481
	.recalc		= &omap2_clksel_recalc,
};

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

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

/* 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",
504
	.ops		= &clkops_null,
505 506 507 508 509
	.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,
510
	.clkdm_name	= "dpll3_clkdm",
511
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
512 513 514 515 516
};

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

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

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

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

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

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

589 590 591
/* This virtual clock is the source for dpll4_m2x2_ck */
static struct clk dpll4_m2_ck = {
	.name		= "dpll4_m2_ck",
592
	.ops		= &clkops_null,
593 594 595 596 597
	.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,
598
	.clkdm_name	= "dpll4_clkdm",
599 600 601
	.recalc		= &omap2_clksel_recalc,
};

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

614 615 616 617 618 619
/*
 * 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 已提交
620 621
static struct clk omap_96m_alwon_fck = {
	.name		= "omap_96m_alwon_fck",
622
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
623
	.parent		= &dpll4_m2x2_ck,
624
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
625 626
};

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

634 635 636 637 638 639 640 641 642 643 644 645 646
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 },
647 648 649
	{ .parent = NULL }
};

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

/* This virtual clock is the source for dpll4_m3x2_ck */
static struct clk dpll4_m3_ck = {
	.name		= "dpll4_m3_ck",
664
	.ops		= &clkops_null,
665 666 667 668 669
	.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,
670
	.clkdm_name	= "dpll4_clkdm",
671
	.recalc		= &omap2_clksel_recalc,
P
Paul Walmsley 已提交
672 673 674 675 676
};

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

P
Paul Walmsley 已提交
687 688 689 690 691 692 693 694 695 696 697
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[] = {
698
	{ .parent = &dpll4_m3x2_ck, .rates = omap_54m_d4m3x2_rates },
P
Paul Walmsley 已提交
699 700 701 702 703 704
	{ .parent = &sys_altclk,    .rates = omap_54m_alt_rates },
	{ .parent = NULL }
};

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

713
static const struct clksel_rate omap_48m_cm96m_rates[] = {
P
Paul Walmsley 已提交
714 715 716 717 718 719 720 721 722 723
	{ .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[] = {
724
	{ .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates },
P
Paul Walmsley 已提交
725 726 727 728 729 730
	{ .parent = &sys_altclk, .rates = omap_48m_alt_rates },
	{ .parent = NULL }
};

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

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

747 748 749
/* This virstual clock is the source for dpll4_m4x2_ck */
static struct clk dpll4_m4_ck = {
	.name		= "dpll4_m4_ck",
750
	.ops		= &clkops_null,
751 752 753 754 755
	.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,
756
	.clkdm_name	= "dpll4_clkdm",
757
	.recalc		= &omap2_clksel_recalc,
758 759
	.set_rate	= &omap2_clksel_set_rate,
	.round_rate	= &omap2_clksel_round_rate,
760 761
};

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

/* This virtual clock is the source for dpll4_m5x2_ck */
static struct clk dpll4_m5_ck = {
	.name		= "dpll4_m5_ck",
777
	.ops		= &clkops_null,
778 779 780 781 782
	.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,
783
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
784 785 786 787 788 789
	.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",
790
	.ops		= &clkops_omap2_dflt_wait,
791
	.parent		= &dpll4_m5_ck,
P
Paul Walmsley 已提交
792 793
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_CAM_SHIFT,
794
	.flags		= INVERT_ENABLE,
795
	.clkdm_name	= "dpll4_clkdm",
796 797 798 799 800 801
	.recalc		= &omap3_clkoutx2_recalc,
};

/* This virtual clock is the source for dpll4_m6x2_ck */
static struct clk dpll4_m6_ck = {
	.name		= "dpll4_m6_ck",
802
	.ops		= &clkops_null,
803 804 805 806 807
	.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,
808
	.clkdm_name	= "dpll4_clkdm",
P
Paul Walmsley 已提交
809 810 811 812 813 814
	.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",
815
	.ops		= &clkops_omap2_dflt_wait,
816
	.parent		= &dpll4_m6_ck,
P
Paul Walmsley 已提交
817 818 819
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
820
	.flags		= INVERT_ENABLE,
821
	.clkdm_name	= "dpll4_clkdm",
822
	.recalc		= &omap3_clkoutx2_recalc,
P
Paul Walmsley 已提交
823 824 825 826
};

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

/* DPLL5 */
/* Supplies 120MHz clock, USIM source clock */
/* Type: DPLL */
/* 3430ES2 only */
837
static struct dpll_data dpll5_dd = {
P
Paul Walmsley 已提交
838 839 840
	.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,
841 842
	.clk_bypass	= &sys_ck,
	.clk_ref	= &sys_ck,
843
	.freqsel_mask	= OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
P
Paul Walmsley 已提交
844 845
	.control_reg	= OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
	.enable_mask	= OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
846
	.modes		= (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
P
Paul Walmsley 已提交
847 848 849
	.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,
850 851 852
	.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),
853
	.idlest_mask	= OMAP3430ES2_ST_PERIPH2_CLK_MASK,
854
	.max_multiplier = OMAP3_MAX_DPLL_MULT,
855
	.min_divider	= 1,
856 857
	.max_divider	= OMAP3_MAX_DPLL_DIV,
	.rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
P
Paul Walmsley 已提交
858 859 860 861
};

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

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

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

/* CM EXTERNAL CLOCK OUTPUTS */

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

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

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

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

static const struct clksel clkout2_src_clksel[] = {
911 912 913 914
	{ .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 已提交
915 916 917 918 919
	{ .parent = NULL }
};

static struct clk clkout2_src_ck = {
	.name		= "clkout2_src_ck",
920
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
921 922 923 924 925 926
	.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,
927
	.clkdm_name	= "core_clkdm",
P
Paul Walmsley 已提交
928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946
	.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",
947
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
948 949 950 951 952 953 954 955 956 957 958
	.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",
959
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
960 961 962 963 964 965
	.parent		= &dpll3_m2x2_ck,
	.recalc		= &followparent_recalc,
};

/* DPLL power domain clock controls */

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

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

978 979 980 981
/*
 * REVISIT: Are these in DPLL power domain or CM power domain? docs
 * may be inconsistent here?
 */
P
Paul Walmsley 已提交
982 983
static struct clk dpll1_fck = {
	.name		= "dpll1_fck",
984
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
985 986 987 988
	.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,
989
	.clksel		= div4_core_clksel,
P
Paul Walmsley 已提交
990 991 992
	.recalc		= &omap2_clksel_recalc,
};

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

/* 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",
1015
	.ops		= &clkops_null,
1016 1017 1018 1019 1020 1021 1022 1023
	.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,
	.recalc		= &omap2_clksel_recalc,
};

1024 1025
/* XXX What about neon_clkdm ? */

1026 1027 1028 1029 1030 1031
/*
 * 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",
1032
	.ops		= &clkops_null,
1033 1034 1035 1036
	.parent		= &mpu_ck,
	.recalc		= &followparent_recalc,
};

P
Paul Walmsley 已提交
1037 1038
static struct clk dpll2_fck = {
	.name		= "dpll2_fck",
1039
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1040 1041 1042 1043
	.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,
1044
	.clksel		= div4_core_clksel,
P
Paul Walmsley 已提交
1045 1046 1047
	.recalc		= &omap2_clksel_recalc,
};

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

P
Paul Walmsley 已提交
1059 1060
/* Common interface clocks */

1061 1062 1063 1064 1065
static const struct clksel div2_core_clksel[] = {
	{ .parent = &core_ck, .rates = div2_rates },
	{ .parent = NULL }
};

P
Paul Walmsley 已提交
1066 1067
static struct clk l3_ick = {
	.name		= "l3_ick",
1068
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1069 1070 1071 1072 1073
	.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,
1074
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1075 1076 1077 1078 1079 1080 1081 1082 1083 1084
	.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",
1085
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1086 1087 1088 1089 1090
	.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,
1091
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102
	.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",
1103
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113
	.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 */

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

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

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

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

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

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

static struct clk gfx_cg2_ck = {
	.name		= "gfx_cg2_ck",
1165
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1166
	.parent		= &gfx_l3_fck, /* REVISIT: correct? */
1167
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
1168 1169
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES1_EN_3D_SHIFT,
1170
	.clkdm_name	= "gfx_3430es1_clkdm",
P
Paul Walmsley 已提交
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
	.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",
1196
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1197 1198
	.init		= &omap2_init_clksel_parent,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN),
1199
	.enable_bit	= OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT,
P
Paul Walmsley 已提交
1200 1201 1202
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP3430ES2_CLKSEL_SGX_MASK,
	.clksel		= sgx_clksel,
1203
	.clkdm_name	= "sgx_clkdm",
P
Paul Walmsley 已提交
1204 1205 1206 1207 1208
	.recalc		= &omap2_clksel_recalc,
};

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

/* CORE power domain */

static struct clk d2d_26m_fck = {
	.name		= "d2d_26m_fck",
1222
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1223
	.parent		= &sys_ck,
1224
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
1225 1226
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430ES1_EN_D2D_SHIFT,
1227
	.clkdm_name	= "d2d_clkdm",
P
Paul Walmsley 已提交
1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238
	.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",
1239
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1240 1241 1242 1243 1244 1245 1246
	.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,
1247
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1248 1249 1250 1251 1252
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt11_fck = {
	.name		= "gpt11_fck",
1253
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1254 1255 1256 1257 1258 1259 1260
	.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,
1261
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1262 1263 1264 1265 1266
	.recalc		= &omap2_clksel_recalc,
};

static struct clk cpefuse_fck = {
	.name		= "cpefuse_fck",
1267
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1268 1269 1270 1271 1272 1273 1274 1275
	.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",
1276
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1277 1278 1279 1280 1281 1282 1283 1284
	.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",
1285
	.ops		= &clkops_omap2_dflt,
1286
	.parent		= &dpll5_m2_ck,
P
Paul Walmsley 已提交
1287 1288 1289 1290 1291 1292 1293 1294 1295
	.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",
1296
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1297
	.parent		= &omap_96m_fck,
1298
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1299 1300 1301 1302 1303
	.recalc		= &followparent_recalc,
};

static struct clk mmchs3_fck = {
	.name		= "mmchs_fck",
1304
	.ops		= &clkops_omap2_dflt_wait,
1305
	.id		= 2,
P
Paul Walmsley 已提交
1306 1307 1308
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430ES2_EN_MMC3_SHIFT,
1309
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1310 1311 1312 1313 1314
	.recalc		= &followparent_recalc,
};

static struct clk mmchs2_fck = {
	.name		= "mmchs_fck",
1315
	.ops		= &clkops_omap2_dflt_wait,
1316
	.id		= 1,
P
Paul Walmsley 已提交
1317 1318 1319
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MMC2_SHIFT,
1320
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1321 1322 1323 1324 1325
	.recalc		= &followparent_recalc,
};

static struct clk mspro_fck = {
	.name		= "mspro_fck",
1326
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1327 1328 1329
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MSPRO_SHIFT,
1330
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1331 1332 1333 1334 1335
	.recalc		= &followparent_recalc,
};

static struct clk mmchs1_fck = {
	.name		= "mmchs_fck",
1336
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1337 1338 1339
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_MMC1_SHIFT,
1340
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1341 1342 1343 1344 1345
	.recalc		= &followparent_recalc,
};

static struct clk i2c3_fck = {
	.name		= "i2c_fck",
1346
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1347 1348 1349 1350
	.id		= 3,
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_I2C3_SHIFT,
1351
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1352 1353 1354 1355 1356
	.recalc		= &followparent_recalc,
};

static struct clk i2c2_fck = {
	.name		= "i2c_fck",
1357
	.ops		= &clkops_omap2_dflt_wait,
1358
	.id		= 2,
P
Paul Walmsley 已提交
1359 1360 1361
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_I2C2_SHIFT,
1362
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1363 1364 1365 1366 1367
	.recalc		= &followparent_recalc,
};

static struct clk i2c1_fck = {
	.name		= "i2c_fck",
1368
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1369 1370 1371 1372
	.id		= 1,
	.parent		= &core_96m_fck,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP3430_EN_I2C1_SHIFT,
1373
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397
	.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 = {
1398
	.name		= "mcbsp_fck",
1399
	.ops		= &clkops_omap2_dflt_wait,
1400
	.id		= 5,
P
Paul Walmsley 已提交
1401 1402 1403 1404 1405 1406
	.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,
1407
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1408 1409 1410 1411
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mcbsp1_fck = {
1412
	.name		= "mcbsp_fck",
1413
	.ops		= &clkops_omap2_dflt_wait,
1414
	.id		= 1,
P
Paul Walmsley 已提交
1415 1416 1417 1418 1419 1420
	.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,
1421
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1422 1423 1424 1425 1426 1427 1428
	.recalc		= &omap2_clksel_recalc,
};

/* CORE_48M_FCK-derived clocks */

static struct clk core_48m_fck = {
	.name		= "core_48m_fck",
1429
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1430
	.parent		= &omap_48m_fck,
1431
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1432 1433 1434 1435 1436
	.recalc		= &followparent_recalc,
};

static struct clk mcspi4_fck = {
	.name		= "mcspi_fck",
1437
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1438 1439 1440 1441 1442 1443 1444 1445 1446
	.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",
1447
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1448 1449 1450 1451 1452 1453 1454 1455 1456
	.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",
1457
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1458 1459 1460 1461 1462 1463 1464 1465 1466
	.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",
1467
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1468 1469 1470 1471 1472 1473 1474 1475 1476
	.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",
1477
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1478 1479 1480 1481 1482 1483 1484 1485
	.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",
1486
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1487 1488 1489 1490 1491 1492 1493 1494
	.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",
1495
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1496 1497 1498 1499 1500 1501 1502 1503 1504 1505
	.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",
1506
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1507
	.parent		= &omap_12m_fck,
1508
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1509 1510 1511 1512 1513
	.recalc		= &followparent_recalc,
};

static struct clk hdq_fck = {
	.name		= "hdq_fck",
1514
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539
	.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",
1540
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1541 1542 1543 1544 1545 1546
	.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,
1547
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1548 1549 1550 1551 1552
	.recalc		= &omap2_clksel_recalc,
};

static struct clk ssi_sst_fck = {
	.name		= "ssi_sst_fck",
1553
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1554 1555 1556 1557 1558 1559 1560 1561 1562
	.parent		= &ssi_ssr_fck,
	.fixed_div	= 2,
	.recalc		= &omap2_fixed_divisor_recalc,
};



/* CORE_L3_ICK based clocks */

1563 1564 1565 1566
/*
 * XXX must add clk_enable/clk_disable for these if standard code won't
 * handle it
 */
P
Paul Walmsley 已提交
1567 1568
static struct clk core_l3_ick = {
	.name		= "core_l3_ick",
1569
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1570
	.parent		= &l3_ick,
1571 1572
	.init		= &omap2_init_clk_clkdm,
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1573 1574 1575 1576 1577
	.recalc		= &followparent_recalc,
};

static struct clk hsotgusb_ick = {
	.name		= "hsotgusb_ick",
1578
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1579 1580 1581
	.parent		= &core_l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_HSOTGUSB_SHIFT,
1582
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1583 1584 1585 1586 1587
	.recalc		= &followparent_recalc,
};

static struct clk sdrc_ick = {
	.name		= "sdrc_ick",
1588
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1589 1590 1591
	.parent		= &core_l3_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SDRC_SHIFT,
1592
	.flags		= ENABLE_ON_INIT,
1593
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1594 1595 1596 1597 1598
	.recalc		= &followparent_recalc,
};

static struct clk gpmc_fck = {
	.name		= "gpmc_fck",
1599
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1600
	.parent		= &core_l3_ick,
1601
	.flags		= ENABLE_ON_INIT, /* huh? */
1602
	.clkdm_name	= "core_l3_clkdm",
P
Paul Walmsley 已提交
1603 1604 1605 1606 1607 1608 1609
	.recalc		= &followparent_recalc,
};

/* SECURITY_L3_ICK based clocks */

static struct clk security_l3_ick = {
	.name		= "security_l3_ick",
1610
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1611 1612 1613 1614 1615 1616
	.parent		= &l3_ick,
	.recalc		= &followparent_recalc,
};

static struct clk pka_ick = {
	.name		= "pka_ick",
1617
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1618 1619 1620 1621 1622 1623 1624 1625 1626 1627
	.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",
1628
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1629
	.parent		= &l4_ick,
1630 1631
	.init		= &omap2_init_clk_clkdm,
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1632 1633 1634 1635 1636
	.recalc		= &followparent_recalc,
};

static struct clk usbtll_ick = {
	.name		= "usbtll_ick",
1637
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1638 1639 1640
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
	.enable_bit	= OMAP3430ES2_EN_USBTLL_SHIFT,
1641
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1642 1643 1644 1645 1646
	.recalc		= &followparent_recalc,
};

static struct clk mmchs3_ick = {
	.name		= "mmchs_ick",
1647
	.ops		= &clkops_omap2_dflt_wait,
1648
	.id		= 2,
P
Paul Walmsley 已提交
1649 1650 1651
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430ES2_EN_MMC3_SHIFT,
1652
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1653 1654 1655 1656 1657 1658
	.recalc		= &followparent_recalc,
};

/* Intersystem Communication Registers - chassis mode only */
static struct clk icr_ick = {
	.name		= "icr_ick",
1659
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1660 1661 1662
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_ICR_SHIFT,
1663
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1664 1665 1666 1667 1668
	.recalc		= &followparent_recalc,
};

static struct clk aes2_ick = {
	.name		= "aes2_ick",
1669
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1670 1671 1672
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_AES2_SHIFT,
1673
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1674 1675 1676 1677 1678
	.recalc		= &followparent_recalc,
};

static struct clk sha12_ick = {
	.name		= "sha12_ick",
1679
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1680 1681 1682
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SHA12_SHIFT,
1683
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1684 1685 1686 1687 1688
	.recalc		= &followparent_recalc,
};

static struct clk des2_ick = {
	.name		= "des2_ick",
1689
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1690 1691 1692
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_DES2_SHIFT,
1693
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1694 1695 1696 1697 1698
	.recalc		= &followparent_recalc,
};

static struct clk mmchs2_ick = {
	.name		= "mmchs_ick",
1699
	.ops		= &clkops_omap2_dflt_wait,
1700
	.id		= 1,
P
Paul Walmsley 已提交
1701 1702 1703
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MMC2_SHIFT,
1704
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1705 1706 1707 1708 1709
	.recalc		= &followparent_recalc,
};

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

static struct clk mspro_ick = {
	.name		= "mspro_ick",
1720
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1721 1722 1723
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MSPRO_SHIFT,
1724
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1725 1726 1727 1728 1729
	.recalc		= &followparent_recalc,
};

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

static struct clk mcspi4_ick = {
	.name		= "mcspi_ick",
1740
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1741 1742 1743 1744
	.id		= 4,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI4_SHIFT,
1745
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1746 1747 1748 1749 1750
	.recalc		= &followparent_recalc,
};

static struct clk mcspi3_ick = {
	.name		= "mcspi_ick",
1751
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1752 1753 1754 1755
	.id		= 3,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI3_SHIFT,
1756
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1757 1758 1759 1760 1761
	.recalc		= &followparent_recalc,
};

static struct clk mcspi2_ick = {
	.name		= "mcspi_ick",
1762
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1763 1764 1765 1766
	.id		= 2,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI2_SHIFT,
1767
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1768 1769 1770 1771 1772
	.recalc		= &followparent_recalc,
};

static struct clk mcspi1_ick = {
	.name		= "mcspi_ick",
1773
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1774 1775 1776 1777
	.id		= 1,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCSPI1_SHIFT,
1778
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1779 1780 1781 1782 1783
	.recalc		= &followparent_recalc,
};

static struct clk i2c3_ick = {
	.name		= "i2c_ick",
1784
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1785 1786 1787 1788
	.id		= 3,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_I2C3_SHIFT,
1789
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1790 1791 1792 1793 1794
	.recalc		= &followparent_recalc,
};

static struct clk i2c2_ick = {
	.name		= "i2c_ick",
1795
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1796 1797 1798 1799
	.id		= 2,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_I2C2_SHIFT,
1800
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1801 1802 1803 1804 1805
	.recalc		= &followparent_recalc,
};

static struct clk i2c1_ick = {
	.name		= "i2c_ick",
1806
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1807 1808 1809 1810
	.id		= 1,
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_I2C1_SHIFT,
1811
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1812 1813 1814 1815 1816
	.recalc		= &followparent_recalc,
};

static struct clk uart2_ick = {
	.name		= "uart2_ick",
1817
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1818 1819 1820
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_UART2_SHIFT,
1821
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1822 1823 1824 1825 1826
	.recalc		= &followparent_recalc,
};

static struct clk uart1_ick = {
	.name		= "uart1_ick",
1827
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1828 1829 1830
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_UART1_SHIFT,
1831
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1832 1833 1834 1835 1836
	.recalc		= &followparent_recalc,
};

static struct clk gpt11_ick = {
	.name		= "gpt11_ick",
1837
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1838 1839 1840
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_GPT11_SHIFT,
1841
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1842 1843 1844 1845 1846
	.recalc		= &followparent_recalc,
};

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

static struct clk mcbsp5_ick = {
1856
	.name		= "mcbsp_ick",
1857
	.ops		= &clkops_omap2_dflt_wait,
1858
	.id		= 5,
P
Paul Walmsley 已提交
1859 1860 1861
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCBSP5_SHIFT,
1862
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1863 1864 1865 1866
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp1_ick = {
1867
	.name		= "mcbsp_ick",
1868
	.ops		= &clkops_omap2_dflt_wait,
1869
	.id		= 1,
P
Paul Walmsley 已提交
1870 1871 1872
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MCBSP1_SHIFT,
1873
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1874 1875 1876 1877 1878
	.recalc		= &followparent_recalc,
};

static struct clk fac_ick = {
	.name		= "fac_ick",
1879
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1880 1881 1882
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430ES1_EN_FAC_SHIFT,
1883
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1884 1885 1886 1887 1888
	.recalc		= &followparent_recalc,
};

static struct clk mailboxes_ick = {
	.name		= "mailboxes_ick",
1889
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1890 1891 1892
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_MAILBOXES_SHIFT,
1893
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1894 1895 1896 1897 1898
	.recalc		= &followparent_recalc,
};

static struct clk omapctrl_ick = {
	.name		= "omapctrl_ick",
1899
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1900 1901 1902
	.parent		= &core_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_OMAPCTRL_SHIFT,
1903
	.flags		= ENABLE_ON_INIT,
P
Paul Walmsley 已提交
1904 1905 1906 1907 1908 1909 1910
	.recalc		= &followparent_recalc,
};

/* SSI_L4_ICK based clocks */

static struct clk ssi_l4_ick = {
	.name		= "ssi_l4_ick",
1911
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1912
	.parent		= &l4_ick,
1913
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1914 1915 1916 1917 1918
	.recalc		= &followparent_recalc,
};

static struct clk ssi_ick = {
	.name		= "ssi_ick",
1919
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1920 1921 1922
	.parent		= &ssi_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP3430_EN_SSI_SHIFT,
1923
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936
	.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",
1937
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953
	.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",
1954
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
1955 1956 1957 1958 1959 1960
	.parent		= &l4_ick,
	.recalc		= &followparent_recalc,
};

static struct clk aes1_ick = {
	.name		= "aes1_ick",
1961
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1962 1963 1964 1965 1966 1967 1968 1969
	.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",
1970
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1971 1972 1973 1974 1975 1976 1977 1978
	.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",
1979
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1980 1981 1982 1983 1984 1985 1986 1987
	.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",
1988
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
1989 1990 1991 1992 1993 1994 1995 1996 1997
	.parent		= &security_l4_ick2,
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP3430_EN_DES1_SHIFT,
	.recalc		= &followparent_recalc,
};

/* DSS */
static struct clk dss1_alwon_fck = {
	.name		= "dss1_alwon_fck",
1998
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
1999 2000 2001
	.parent		= &dpll4_m4x2_ck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_DSS1_SHIFT,
2002
	.clkdm_name	= "dss_clkdm",
2003
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
2004 2005 2006 2007
};

static struct clk dss_tv_fck = {
	.name		= "dss_tv_fck",
2008
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2009
	.parent		= &omap_54m_fck,
2010
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2011 2012
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_TV_SHIFT,
2013
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2014 2015 2016 2017 2018
	.recalc		= &followparent_recalc,
};

static struct clk dss_96m_fck = {
	.name		= "dss_96m_fck",
2019
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2020
	.parent		= &omap_96m_fck,
2021
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2022 2023
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_TV_SHIFT,
2024
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2025 2026 2027 2028 2029
	.recalc		= &followparent_recalc,
};

static struct clk dss2_alwon_fck = {
	.name		= "dss2_alwon_fck",
2030
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2031
	.parent		= &sys_ck,
2032
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2033 2034
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_DSS2_SHIFT,
2035
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2036 2037 2038 2039 2040 2041
	.recalc		= &followparent_recalc,
};

static struct clk dss_ick = {
	/* Handles both L3 and L4 clocks */
	.name		= "dss_ick",
2042
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2043
	.parent		= &l4_ick,
2044
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2045 2046
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
2047
	.clkdm_name	= "dss_clkdm",
P
Paul Walmsley 已提交
2048 2049 2050 2051 2052 2053 2054
	.recalc		= &followparent_recalc,
};

/* CAM */

static struct clk cam_mclk = {
	.name		= "cam_mclk",
2055
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2056 2057 2058
	.parent		= &dpll4_m5x2_ck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_CAM_SHIFT,
2059
	.clkdm_name	= "cam_clkdm",
2060
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
2061 2062
};

2063 2064 2065
static struct clk cam_ick = {
	/* Handles both L3 and L4 clocks */
	.name		= "cam_ick",
2066
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2067
	.parent		= &l4_ick,
2068
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2069 2070
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_CAM_SHIFT,
2071
	.clkdm_name	= "cam_clkdm",
P
Paul Walmsley 已提交
2072 2073 2074
	.recalc		= &followparent_recalc,
};

2075 2076
static struct clk csi2_96m_fck = {
	.name		= "csi2_96m_fck",
2077
	.ops		= &clkops_omap2_dflt,
2078 2079 2080 2081 2082 2083 2084 2085
	.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 已提交
2086 2087 2088 2089
/* USBHOST - 3430ES2 only */

static struct clk usbhost_120m_fck = {
	.name		= "usbhost_120m_fck",
2090
	.ops		= &clkops_omap2_dflt_wait,
2091
	.parent		= &dpll5_m2_ck,
2092
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2093 2094
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES2_EN_USBHOST2_SHIFT,
2095
	.clkdm_name	= "usbhost_clkdm",
P
Paul Walmsley 已提交
2096 2097 2098 2099 2100
	.recalc		= &followparent_recalc,
};

static struct clk usbhost_48m_fck = {
	.name		= "usbhost_48m_fck",
2101
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2102
	.parent		= &omap_48m_fck,
2103
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2104 2105
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430ES2_EN_USBHOST1_SHIFT,
2106
	.clkdm_name	= "usbhost_clkdm",
P
Paul Walmsley 已提交
2107 2108 2109
	.recalc		= &followparent_recalc,
};

2110 2111 2112
static struct clk usbhost_ick = {
	/* Handles both L3 and L4 clocks */
	.name		= "usbhost_ick",
2113
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2114
	.parent		= &l4_ick,
2115
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2116 2117
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430ES2_EN_USBHOST_SHIFT,
2118
	.clkdm_name	= "usbhost_clkdm",
P
Paul Walmsley 已提交
2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141
	.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 },
2142
	{ .parent = &dpll5_m2_ck,	.rates = usim_120m_rates },
P
Paul Walmsley 已提交
2143 2144 2145 2146 2147 2148 2149
	{ .parent = &sys_ck,		.rates = div2_rates },
	{ .parent = NULL },
};

/* 3430ES2 only */
static struct clk usim_fck = {
	.name		= "usim_fck",
2150
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2151 2152 2153 2154 2155 2156 2157 2158 2159
	.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,
};

2160
/* XXX should gpt1's clksel have wkup_32k_fck as the 32k opt? */
P
Paul Walmsley 已提交
2161 2162
static struct clk gpt1_fck = {
	.name		= "gpt1_fck",
2163
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2164 2165 2166 2167 2168 2169
	.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,
2170
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2171 2172 2173 2174 2175
	.recalc		= &omap2_clksel_recalc,
};

static struct clk wkup_32k_fck = {
	.name		= "wkup_32k_fck",
2176
	.ops		= &clkops_null,
2177
	.init		= &omap2_init_clk_clkdm,
P
Paul Walmsley 已提交
2178
	.parent		= &omap_32k_fck,
2179
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2180 2181 2182
	.recalc		= &followparent_recalc,
};

2183 2184
static struct clk gpio1_dbck = {
	.name		= "gpio1_dbck",
2185
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2186 2187 2188
	.parent		= &wkup_32k_fck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_GPIO1_SHIFT,
2189
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2190 2191 2192 2193 2194
	.recalc		= &followparent_recalc,
};

static struct clk wdt2_fck = {
	.name		= "wdt2_fck",
2195
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2196 2197 2198
	.parent		= &wkup_32k_fck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_WDT2_SHIFT,
2199
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2200 2201 2202 2203 2204
	.recalc		= &followparent_recalc,
};

static struct clk wkup_l4_ick = {
	.name		= "wkup_l4_ick",
2205
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2206
	.parent		= &sys_ck,
2207
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2208 2209 2210 2211 2212 2213 2214
	.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",
2215
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2216 2217 2218
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430ES2_EN_USIMOCP_SHIFT,
2219
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2220 2221 2222 2223 2224
	.recalc		= &followparent_recalc,
};

static struct clk wdt2_ick = {
	.name		= "wdt2_ick",
2225
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2226 2227 2228
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_WDT2_SHIFT,
2229
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2230 2231 2232 2233 2234
	.recalc		= &followparent_recalc,
};

static struct clk wdt1_ick = {
	.name		= "wdt1_ick",
2235
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2236 2237 2238
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_WDT1_SHIFT,
2239
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2240 2241 2242 2243 2244
	.recalc		= &followparent_recalc,
};

static struct clk gpio1_ick = {
	.name		= "gpio1_ick",
2245
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2246 2247 2248
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO1_SHIFT,
2249
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2250 2251 2252 2253 2254
	.recalc		= &followparent_recalc,
};

static struct clk omap_32ksync_ick = {
	.name		= "omap_32ksync_ick",
2255
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2256 2257 2258
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_32KSYNC_SHIFT,
2259
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2260 2261 2262
	.recalc		= &followparent_recalc,
};

2263
/* XXX This clock no longer exists in 3430 TRM rev F */
P
Paul Walmsley 已提交
2264 2265
static struct clk gpt12_ick = {
	.name		= "gpt12_ick",
2266
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2267 2268 2269
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT12_SHIFT,
2270
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2271 2272 2273 2274 2275
	.recalc		= &followparent_recalc,
};

static struct clk gpt1_ick = {
	.name		= "gpt1_ick",
2276
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2277 2278 2279
	.parent		= &wkup_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT1_SHIFT,
2280
	.clkdm_name	= "wkup_clkdm",
P
Paul Walmsley 已提交
2281 2282 2283 2284 2285 2286 2287 2288 2289
	.recalc		= &followparent_recalc,
};



/* PER clock domain */

static struct clk per_96m_fck = {
	.name		= "per_96m_fck",
2290
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2291
	.parent		= &omap_96m_alwon_fck,
2292 2293
	.init		= &omap2_init_clk_clkdm,
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2294 2295 2296 2297 2298
	.recalc		= &followparent_recalc,
};

static struct clk per_48m_fck = {
	.name		= "per_48m_fck",
2299
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2300
	.parent		= &omap_48m_fck,
2301 2302
	.init		= &omap2_init_clk_clkdm,
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2303 2304 2305 2306 2307
	.recalc		= &followparent_recalc,
};

static struct clk uart3_fck = {
	.name		= "uart3_fck",
2308
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2309 2310 2311
	.parent		= &per_48m_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_UART3_SHIFT,
2312
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2313 2314 2315 2316 2317
	.recalc		= &followparent_recalc,
};

static struct clk gpt2_fck = {
	.name		= "gpt2_fck",
2318
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2319 2320 2321 2322 2323 2324
	.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,
2325
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2326 2327 2328 2329 2330
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt3_fck = {
	.name		= "gpt3_fck",
2331
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2332 2333 2334 2335 2336 2337
	.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,
2338
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2339 2340 2341 2342 2343
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt4_fck = {
	.name		= "gpt4_fck",
2344
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2345 2346 2347 2348 2349 2350
	.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,
2351
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2352 2353 2354 2355 2356
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt5_fck = {
	.name		= "gpt5_fck",
2357
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2358 2359 2360 2361 2362 2363
	.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,
2364
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2365 2366 2367 2368 2369
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt6_fck = {
	.name		= "gpt6_fck",
2370
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2371 2372 2373 2374 2375 2376
	.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,
2377
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2378 2379 2380 2381 2382
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt7_fck = {
	.name		= "gpt7_fck",
2383
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2384 2385 2386 2387 2388 2389
	.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,
2390
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2391 2392 2393 2394 2395
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt8_fck = {
	.name		= "gpt8_fck",
2396
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2397 2398 2399 2400 2401 2402
	.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,
2403
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2404 2405 2406 2407 2408
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gpt9_fck = {
	.name		= "gpt9_fck",
2409
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2410 2411 2412 2413 2414 2415
	.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,
2416
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2417 2418 2419 2420 2421
	.recalc		= &omap2_clksel_recalc,
};

static struct clk per_32k_alwon_fck = {
	.name		= "per_32k_alwon_fck",
2422
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2423
	.parent		= &omap_32k_fck,
2424
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2425 2426 2427
	.recalc		= &followparent_recalc,
};

2428 2429
static struct clk gpio6_dbck = {
	.name		= "gpio6_dbck",
2430
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2431 2432
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2433
	.enable_bit	= OMAP3430_EN_GPIO6_SHIFT,
2434
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2435 2436 2437
	.recalc		= &followparent_recalc,
};

2438 2439
static struct clk gpio5_dbck = {
	.name		= "gpio5_dbck",
2440
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2441 2442
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2443
	.enable_bit	= OMAP3430_EN_GPIO5_SHIFT,
2444
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2445 2446 2447
	.recalc		= &followparent_recalc,
};

2448 2449
static struct clk gpio4_dbck = {
	.name		= "gpio4_dbck",
2450
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2451 2452
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2453
	.enable_bit	= OMAP3430_EN_GPIO4_SHIFT,
2454
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2455 2456 2457
	.recalc		= &followparent_recalc,
};

2458 2459
static struct clk gpio3_dbck = {
	.name		= "gpio3_dbck",
2460
	.ops		= &clkops_omap2_dflt,
P
Paul Walmsley 已提交
2461 2462
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2463
	.enable_bit	= OMAP3430_EN_GPIO3_SHIFT,
2464
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2465 2466 2467
	.recalc		= &followparent_recalc,
};

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

static struct clk wdt3_fck = {
	.name		= "wdt3_fck",
2480
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2481 2482 2483
	.parent		= &per_32k_alwon_fck,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_WDT3_SHIFT,
2484
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2485 2486 2487 2488 2489
	.recalc		= &followparent_recalc,
};

static struct clk per_l4_ick = {
	.name		= "per_l4_ick",
2490
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2491
	.parent		= &l4_ick,
2492
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2493 2494 2495 2496 2497
	.recalc		= &followparent_recalc,
};

static struct clk gpio6_ick = {
	.name		= "gpio6_ick",
2498
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2499 2500 2501
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO6_SHIFT,
2502
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2503 2504 2505 2506 2507
	.recalc		= &followparent_recalc,
};

static struct clk gpio5_ick = {
	.name		= "gpio5_ick",
2508
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2509 2510 2511
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO5_SHIFT,
2512
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2513 2514 2515 2516 2517
	.recalc		= &followparent_recalc,
};

static struct clk gpio4_ick = {
	.name		= "gpio4_ick",
2518
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2519 2520 2521
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO4_SHIFT,
2522
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2523 2524 2525 2526 2527
	.recalc		= &followparent_recalc,
};

static struct clk gpio3_ick = {
	.name		= "gpio3_ick",
2528
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2529 2530 2531
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO3_SHIFT,
2532
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2533 2534 2535 2536 2537
	.recalc		= &followparent_recalc,
};

static struct clk gpio2_ick = {
	.name		= "gpio2_ick",
2538
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2539 2540 2541
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPIO2_SHIFT,
2542
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2543 2544 2545 2546 2547
	.recalc		= &followparent_recalc,
};

static struct clk wdt3_ick = {
	.name		= "wdt3_ick",
2548
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2549 2550 2551
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_WDT3_SHIFT,
2552
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2553 2554 2555 2556 2557
	.recalc		= &followparent_recalc,
};

static struct clk uart3_ick = {
	.name		= "uart3_ick",
2558
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2559 2560 2561
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_UART3_SHIFT,
2562
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2563 2564 2565 2566 2567
	.recalc		= &followparent_recalc,
};

static struct clk gpt9_ick = {
	.name		= "gpt9_ick",
2568
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2569 2570 2571
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT9_SHIFT,
2572
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2573 2574 2575 2576 2577
	.recalc		= &followparent_recalc,
};

static struct clk gpt8_ick = {
	.name		= "gpt8_ick",
2578
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2579 2580 2581
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT8_SHIFT,
2582
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2583 2584 2585 2586 2587
	.recalc		= &followparent_recalc,
};

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

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

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

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

static struct clk gpt3_ick = {
	.name		= "gpt3_ick",
2628
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2629 2630 2631
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT3_SHIFT,
2632
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2633 2634 2635 2636 2637
	.recalc		= &followparent_recalc,
};

static struct clk gpt2_ick = {
	.name		= "gpt2_ick",
2638
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2639 2640 2641
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_GPT2_SHIFT,
2642
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2643 2644 2645 2646
	.recalc		= &followparent_recalc,
};

static struct clk mcbsp2_ick = {
2647
	.name		= "mcbsp_ick",
2648
	.ops		= &clkops_omap2_dflt_wait,
2649
	.id		= 2,
P
Paul Walmsley 已提交
2650 2651 2652
	.parent		= &per_l4_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
	.enable_bit	= OMAP3430_EN_MCBSP2_SHIFT,
2653
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2654 2655 2656 2657
	.recalc		= &followparent_recalc,
};

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

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

static const struct clksel mcbsp_234_clksel[] = {
2680 2681
	{ .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
	{ .parent = &mcbsp_clks,   .rates = common_mcbsp_mcbsp_rates },
P
Paul Walmsley 已提交
2682 2683 2684 2685
	{ .parent = NULL }
};

static struct clk mcbsp2_fck = {
2686
	.name		= "mcbsp_fck",
2687
	.ops		= &clkops_omap2_dflt_wait,
2688
	.id		= 2,
P
Paul Walmsley 已提交
2689 2690 2691 2692 2693 2694
	.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,
2695
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2696 2697 2698 2699
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mcbsp3_fck = {
2700
	.name		= "mcbsp_fck",
2701
	.ops		= &clkops_omap2_dflt_wait,
2702
	.id		= 3,
P
Paul Walmsley 已提交
2703 2704 2705 2706 2707 2708
	.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,
2709
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2710 2711 2712 2713
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mcbsp4_fck = {
2714
	.name		= "mcbsp_fck",
2715
	.ops		= &clkops_omap2_dflt_wait,
2716
	.id		= 4,
P
Paul Walmsley 已提交
2717 2718 2719 2720 2721 2722
	.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,
2723
	.clkdm_name	= "per_clkdm",
P
Paul Walmsley 已提交
2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765
	.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",
2766
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2767 2768 2769 2770
	.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,
2771
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789
	.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",
2790
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2791 2792 2793 2794
	.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,
2795
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812
	.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",
2813
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2814 2815 2816 2817
	.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,
2818
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2819 2820 2821 2822 2823 2824 2825 2826 2827 2828
	.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",
2829
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2830 2831 2832 2833
	.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,
2834
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2835 2836 2837 2838 2839
	.recalc		= &omap2_clksel_recalc,
};

static struct clk traceclk_src_fck = {
	.name		= "traceclk_src_fck",
2840
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2841 2842 2843 2844
	.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,
2845
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862
	.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",
2863
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2864 2865 2866 2867
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP3430_CLKSEL_TRACECLK_MASK,
	.clksel		= traceclk_clksel,
2868
	.clkdm_name	= "emu_clkdm",
P
Paul Walmsley 已提交
2869 2870 2871 2872 2873 2874 2875 2876
	.recalc		= &omap2_clksel_recalc,
};

/* SR clocks */

/* SmartReflex fclk (VDD1) */
static struct clk sr1_fck = {
	.name		= "sr1_fck",
2877
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2878 2879 2880 2881 2882 2883 2884 2885 2886
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_SR1_SHIFT,
	.recalc		= &followparent_recalc,
};

/* SmartReflex fclk (VDD2) */
static struct clk sr2_fck = {
	.name		= "sr2_fck",
2887
	.ops		= &clkops_omap2_dflt_wait,
P
Paul Walmsley 已提交
2888 2889 2890 2891 2892 2893 2894 2895
	.parent		= &sys_ck,
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP3430_EN_SR2_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk sr_l4_ick = {
	.name		= "sr_l4_ick",
2896
	.ops		= &clkops_null, /* RMK: missing? */
P
Paul Walmsley 已提交
2897
	.parent		= &l4_ick,
2898
	.clkdm_name	= "core_l4_clkdm",
P
Paul Walmsley 已提交
2899 2900 2901 2902 2903 2904 2905
	.recalc		= &followparent_recalc,
};

/* SECURE_32K_FCK clocks */

static struct clk gpt12_fck = {
	.name		= "gpt12_fck",
2906
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2907 2908 2909 2910 2911 2912
	.parent		= &secure_32k_fck,
	.recalc		= &followparent_recalc,
};

static struct clk wdt1_fck = {
	.name		= "wdt1_fck",
2913
	.ops		= &clkops_null,
P
Paul Walmsley 已提交
2914
	.parent		= &secure_32k_fck,
2915
	.recalc		= &followparent_recalc,
P
Paul Walmsley 已提交
2916 2917 2918
};

#endif