clock2xxx_data.c 68.0 KB
Newer Older
1
/*
2
 *  linux/arch/arm/mach-omap2/clock2xxx_data.c
3
 *
4
 *  Copyright (C) 2005-2009 Texas Instruments, Inc.
5
 *  Copyright (C) 2004-2010 Nokia Corporation
6
 *
7 8 9
 *  Contacts:
 *  Richard Woodruff <r-woodruff2@ti.com>
 *  Paul Walmsley
10 11 12 13 14 15
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

16 17
#include <linux/kernel.h>
#include <linux/clk.h>
18
#include <linux/list.h>
19

20
#include <plat/clkdev_omap.h>
21

22 23 24
#include "clock.h"
#include "clock2xxx.h"
#include "opp2xxx.h"
25 26 27 28 29 30
#include "prm.h"
#include "cm.h"
#include "prm-regbits-24xx.h"
#include "cm-regbits-24xx.h"
#include "sdrc.h"

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
/*-------------------------------------------------------------------------
 * 24xx clock tree.
 *
 * NOTE:In many cases here we are assigning a 'default' parent.	In many
 *	cases the parent is selectable.	The get/set parent calls will also
 *	switch sources.
 *
 *	Many some clocks say always_enabled, but they can be auto idled for
 *	power savings. They will always be available upon clock request.
 *
 *	Several sources are given initial rates which may be wrong, this will
 *	be fixed up in the init func.
 *
 *	Things are broadly separated below by clock domains. It is
 *	noteworthy that most periferals have dependencies on multiple clock
 *	domains. Many get their interface clocks from the L4 domain, but get
 *	functional clocks from fixed sources or other core domain derived
 *	clocks.
 *-------------------------------------------------------------------------*/

/* Base external input clocks */
static struct clk func_32k_ck = {
	.name		= "func_32k_ck",
54
	.ops		= &clkops_null,
55
	.rate		= 32000,
56
	.flags		= RATE_FIXED,
57
	.clkdm_name	= "wkup_clkdm",
58
};
59

60 61 62 63 64 65 66 67
static struct clk secure_32k_ck = {
	.name		= "secure_32k_ck",
	.ops		= &clkops_null,
	.rate		= 32768,
	.flags		= RATE_FIXED,
	.clkdm_name	= "wkup_clkdm",
};

68 69 70
/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
static struct clk osc_ck = {		/* (*12, *13, 19.2, *26, 38.4)MHz */
	.name		= "osc_ck",
71
	.ops		= &clkops_oscck,
72
	.clkdm_name	= "wkup_clkdm",
73
	.recalc		= &omap2_osc_clk_recalc,
74 75
};

76
/* Without modem likely 12MHz, with modem likely 13MHz */
77 78
static struct clk sys_ck = {		/* (*12, *13, 19.2, 26, 38.4)MHz */
	.name		= "sys_ck",		/* ~ ref_clk also */
79
	.ops		= &clkops_null,
80
	.parent		= &osc_ck,
81
	.clkdm_name	= "wkup_clkdm",
82
	.recalc		= &omap2xxx_sys_clk_recalc,
83
};
84

85 86
static struct clk alt_ck = {		/* Typical 54M or 48M, may not exist */
	.name		= "alt_ck",
87
	.ops		= &clkops_null,
88
	.rate		= 54000000,
89
	.flags		= RATE_FIXED,
90
	.clkdm_name	= "wkup_clkdm",
91
};
92

93 94 95 96 97
/*
 * Analog domain root source clocks
 */

/* dpll_ck, is broken out in to special cases through clksel */
98 99 100 101
/* REVISIT: Rate changes on dpll_ck trigger a full set change.	...
 * deal with this
 */

102
static struct dpll_data dpll_dd = {
103 104 105
	.mult_div1_reg		= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.mult_mask		= OMAP24XX_DPLL_MULT_MASK,
	.div1_mask		= OMAP24XX_DPLL_DIV_MASK,
106 107 108 109
	.clk_bypass		= &sys_ck,
	.clk_ref		= &sys_ck,
	.control_reg		= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_mask		= OMAP24XX_EN_DPLL_MASK,
110
	.max_multiplier		= 1023,
111
	.min_divider		= 1,
112 113
	.max_divider		= 16,
	.rate_tolerance		= DEFAULT_DPLL_RATE_TOLERANCE
114 115
};

116 117 118 119
/*
 * XXX Cannot add round_rate here yet, as this is still a composite clock,
 * not just a DPLL
 */
120 121
static struct clk dpll_ck = {
	.name		= "dpll_ck",
122
	.ops		= &clkops_null,
123
	.parent		= &sys_ck,		/* Can be func_32k also */
124
	.dpll_data	= &dpll_dd,
125
	.clkdm_name	= "wkup_clkdm",
126 127
	.recalc		= &omap2_dpllcore_recalc,
	.set_rate	= &omap2_reprogram_dpllcore,
128 129 130 131
};

static struct clk apll96_ck = {
	.name		= "apll96_ck",
132
	.ops		= &clkops_apll96,
133 134
	.parent		= &sys_ck,
	.rate		= 96000000,
135
	.flags		= RATE_FIXED | ENABLE_ON_INIT,
136
	.clkdm_name	= "wkup_clkdm",
137 138
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP24XX_EN_96M_PLL_SHIFT,
139 140 141 142
};

static struct clk apll54_ck = {
	.name		= "apll54_ck",
143
	.ops		= &clkops_apll54,
144 145
	.parent		= &sys_ck,
	.rate		= 54000000,
146
	.flags		= RATE_FIXED | ENABLE_ON_INIT,
147
	.clkdm_name	= "wkup_clkdm",
148 149
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP24XX_EN_54M_PLL_SHIFT,
150 151 152 153 154
};

/*
 * PRCM digital base sources
 */
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173

/* func_54m_ck */

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

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

static const struct clksel func_54m_clksel[] = {
	{ .parent = &apll54_ck, .rates = func_54m_apll54_rates, },
	{ .parent = &alt_ck,	.rates = func_54m_alt_rates, },
	{ .parent = NULL },
};

174 175
static struct clk func_54m_ck = {
	.name		= "func_54m_ck",
176
	.ops		= &clkops_null,
177
	.parent		= &apll54_ck,	/* can also be alt_clk */
178
	.clkdm_name	= "wkup_clkdm",
179 180 181 182 183
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_54M_SOURCE,
	.clksel		= func_54m_clksel,
	.recalc		= &omap2_clksel_recalc,
184
};
185

186 187
static struct clk core_ck = {
	.name		= "core_ck",
188
	.ops		= &clkops_null,
189
	.parent		= &dpll_ck,		/* can also be 32k */
190
	.clkdm_name	= "wkup_clkdm",
191
	.recalc		= &followparent_recalc,
192
};
193 194 195 196 197

/* func_96m_ck */
static const struct clksel_rate func_96m_apll96_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 0 },
198 199
};

200 201 202 203 204 205 206 207 208 209 210 211
static const struct clksel_rate func_96m_alt_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_243X | DEFAULT_RATE },
	{ .div = 0 },
};

static const struct clksel func_96m_clksel[] = {
	{ .parent = &apll96_ck,	.rates = func_96m_apll96_rates },
	{ .parent = &alt_ck,	.rates = func_96m_alt_rates },
	{ .parent = NULL }
};

/* The parent of this clock is not selectable on 2420. */
212 213
static struct clk func_96m_ck = {
	.name		= "func_96m_ck",
214
	.ops		= &clkops_null,
215
	.parent		= &apll96_ck,
216
	.clkdm_name	= "wkup_clkdm",
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP2430_96M_SOURCE,
	.clksel		= func_96m_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

/* func_48m_ck */

static const struct clksel_rate func_48m_apll96_rates[] = {
	{ .div = 2, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 0 },
};

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

static const struct clksel func_48m_clksel[] = {
	{ .parent = &apll96_ck,	.rates = func_48m_apll96_rates },
	{ .parent = &alt_ck, .rates = func_48m_alt_rates },
	{ .parent = NULL }
242 243 244 245
};

static struct clk func_48m_ck = {
	.name		= "func_48m_ck",
246
	.ops		= &clkops_null,
247
	.parent		= &apll96_ck,	 /* 96M or Alt */
248
	.clkdm_name	= "wkup_clkdm",
249 250 251 252 253 254 255
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_48M_SOURCE,
	.clksel		= func_48m_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
256 257 258 259
};

static struct clk func_12m_ck = {
	.name		= "func_12m_ck",
260
	.ops		= &clkops_null,
261
	.parent		= &func_48m_ck,
262
	.fixed_div	= 4,
263
	.clkdm_name	= "wkup_clkdm",
264
	.recalc		= &omap_fixed_divisor_recalc,
265 266 267 268 269
};

/* Secure timer, only available in secure mode */
static struct clk wdt1_osc_ck = {
	.name		= "ck_wdt1_osc",
270
	.ops		= &clkops_null, /* RMK: missing? */
271
	.parent		= &osc_ck,
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
	.recalc		= &followparent_recalc,
};

/*
 * The common_clkout* clksel_rate structs are common to
 * sys_clkout, sys_clkout_src, sys_clkout2, and sys_clkout2_src.
 * sys_clkout2_* are 2420-only, so the
 * clksel_rate flags fields are inaccurate for those clocks. This is
 * harmless since access to those clocks are gated by the struct clk
 * flags fields, which mark them as 2420-only.
 */
static const struct clksel_rate common_clkout_src_core_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 0 }
};

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

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

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

static const struct clksel common_clkout_src_clksel[] = {
	{ .parent = &core_ck,	  .rates = common_clkout_src_core_rates },
	{ .parent = &sys_ck,	  .rates = common_clkout_src_sys_rates },
	{ .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates },
	{ .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates },
	{ .parent = NULL }
};

static struct clk sys_clkout_src = {
	.name		= "sys_clkout_src",
313
	.ops		= &clkops_omap2_dflt,
314
	.parent		= &func_54m_ck,
315
	.clkdm_name	= "wkup_clkdm",
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
	.enable_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.enable_bit	= OMAP24XX_CLKOUT_EN_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.clksel_mask	= OMAP24XX_CLKOUT_SOURCE_MASK,
	.clksel		= common_clkout_src_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

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

static const struct clksel sys_clkout_clksel[] = {
	{ .parent = &sys_clkout_src, .rates = common_clkout_rates },
	{ .parent = NULL }
339 340 341 342
};

static struct clk sys_clkout = {
	.name		= "sys_clkout",
343
	.ops		= &clkops_null,
344
	.parent		= &sys_clkout_src,
345
	.clkdm_name	= "wkup_clkdm",
346 347 348 349 350 351 352 353 354 355 356
	.clksel_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.clksel_mask	= OMAP24XX_CLKOUT_DIV_MASK,
	.clksel		= sys_clkout_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

/* In 2430, new in 2420 ES2 */
static struct clk sys_clkout2_src = {
	.name		= "sys_clkout2_src",
357
	.ops		= &clkops_omap2_dflt,
358
	.parent		= &func_54m_ck,
359
	.clkdm_name	= "wkup_clkdm",
360 361 362 363 364 365
	.enable_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.enable_bit	= OMAP2420_CLKOUT2_EN_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.clksel_mask	= OMAP2420_CLKOUT2_SOURCE_MASK,
	.clksel		= common_clkout_src_clksel,
366
	.recalc		= &omap2_clksel_recalc,
367 368 369 370 371 372 373
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

static const struct clksel sys_clkout2_clksel[] = {
	{ .parent = &sys_clkout2_src, .rates = common_clkout_rates },
	{ .parent = NULL }
374 375 376 377 378
};

/* In 2430, new in 2420 ES2 */
static struct clk sys_clkout2 = {
	.name		= "sys_clkout2",
379
	.ops		= &clkops_null,
380
	.parent		= &sys_clkout2_src,
381
	.clkdm_name	= "wkup_clkdm",
382 383 384
	.clksel_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.clksel_mask	= OMAP2420_CLKOUT2_DIV_MASK,
	.clksel		= sys_clkout2_clksel,
385
	.recalc		= &omap2_clksel_recalc,
386 387
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
388 389
};

390 391
static struct clk emul_ck = {
	.name		= "emul_ck",
392
	.ops		= &clkops_omap2_dflt,
393
	.parent		= &func_54m_ck,
394
	.clkdm_name	= "wkup_clkdm",
395 396 397
	.enable_reg	= OMAP24XX_PRCM_CLKEMUL_CTRL,
	.enable_bit	= OMAP24XX_EMULATION_EN_SHIFT,
	.recalc		= &followparent_recalc,
398 399

};
400

401 402 403 404 405 406 407 408 409 410
/*
 * MPU clock domain
 *	Clocks:
 *		MPU_FCLK, MPU_ICLK
 *		INT_M_FCLK, INT_M_I_CLK
 *
 * - Individual clocks are hardware managed.
 * - Base divider comes from: CM_CLKSEL_MPU
 *
 */
411 412 413 414 415 416 417 418 419 420 421 422 423 424
static const struct clksel_rate mpu_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 4, .val = 4, .flags = RATE_IN_242X },
	{ .div = 6, .val = 6, .flags = RATE_IN_242X },
	{ .div = 8, .val = 8, .flags = RATE_IN_242X },
	{ .div = 0 },
};

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

425 426
static struct clk mpu_ck = {	/* Control cpu */
	.name		= "mpu_ck",
427
	.ops		= &clkops_null,
428
	.parent		= &core_ck,
429
	.flags		= DELAYED_APP,
430
	.clkdm_name	= "mpu_clkdm",
431 432 433
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP24XX_CLKSEL_MPU_MASK,
434
	.clksel		= mpu_clksel,
435 436
	.recalc		= &omap2_clksel_recalc,
};
437

438 439 440
/*
 * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain
 * Clocks:
441
 *	2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
442
 *	2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP
443 444 445 446 447
 *
 * Won't be too specific here. The core clock comes into this block
 * it is divided then tee'ed. One branch goes directly to xyz enable
 * controls. The other branch gets further divided by 2 then possibly
 * routed into a synchronizer and out of clocks abc.
448
 */
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466
static const struct clksel_rate dsp_fck_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 3, .val = 3, .flags = RATE_IN_24XX },
	{ .div = 4, .val = 4, .flags = RATE_IN_24XX },
	{ .div = 6, .val = 6, .flags = RATE_IN_242X },
	{ .div = 8, .val = 8, .flags = RATE_IN_242X },
	{ .div = 12, .val = 12, .flags = RATE_IN_242X },
	{ .div = 0 },
};

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

static struct clk dsp_fck = {
	.name		= "dsp_fck",
467
	.ops		= &clkops_omap2_dflt_wait,
468
	.parent		= &core_ck,
469
	.flags		= DELAYED_APP,
470
	.clkdm_name	= "dsp_clkdm",
471 472 473 474 475
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP24XX_CLKSEL_DSP_MASK,
	.clksel		= dsp_fck_clksel,
476 477 478
	.recalc		= &omap2_clksel_recalc,
};

479 480 481 482 483 484 485 486 487 488 489
/* DSP interface clock */
static const struct clksel_rate dsp_irate_ick_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 3, .val = 3, .flags = RATE_IN_243X },
	{ .div = 0 },
};

static const struct clksel dsp_irate_ick_clksel[] = {
	{ .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
	{ .parent = NULL }
490 491
};

492
/* This clock does not exist as such in the TRM. */
493 494
static struct clk dsp_irate_ick = {
	.name		= "dsp_irate_ick",
495
	.ops		= &clkops_null,
496
	.parent		= &dsp_fck,
497
	.flags		= DELAYED_APP,
498 499 500
	.clksel_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP24XX_CLKSEL_DSP_IF_MASK,
	.clksel		= dsp_irate_ick_clksel,
501 502 503
	.recalc		= &omap2_clksel_recalc,
};

504
/* 2420 only */
505 506
static struct clk dsp_ick = {
	.name		= "dsp_ick",	 /* apparently ipi and isp */
507
	.ops		= &clkops_omap2_dflt_wait,
508 509 510 511 512 513 514 515
	.parent		= &dsp_irate_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP2420_EN_DSP_IPI_SHIFT,	      /* for ipi */
};

/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
static struct clk iva2_1_ick = {
	.name		= "iva2_1_ick",
516
	.ops		= &clkops_omap2_dflt_wait,
517 518 519
	.parent		= &dsp_irate_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
520 521
};

522 523 524 525 526
/*
 * The IVA1 is an ARM7 core on the 2420 that has nothing to do with
 * the C54x, but which is contained in the DSP powerdomain.  Does not
 * exist on later OMAPs.
 */
527 528
static struct clk iva1_ifck = {
	.name		= "iva1_ifck",
529
	.ops		= &clkops_omap2_dflt_wait,
530
	.parent		= &core_ck,
531
	.flags		= DELAYED_APP,
532
	.clkdm_name	= "iva1_clkdm",
533 534 535 536 537
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2420_EN_IVA_COP_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP2420_CLKSEL_IVA_MASK,
	.clksel		= dsp_fck_clksel,
538 539 540 541 542 543
	.recalc		= &omap2_clksel_recalc,
};

/* IVA1 mpu/int/i/f clocks are /2 of parent */
static struct clk iva1_mpu_int_ifck = {
	.name		= "iva1_mpu_int_ifck",
544
	.ops		= &clkops_omap2_dflt_wait,
545
	.parent		= &iva1_ifck,
546
	.clkdm_name	= "iva1_clkdm",
547 548 549
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2420_EN_IVA_MPU_SHIFT,
	.fixed_div	= 2,
550
	.recalc		= &omap_fixed_divisor_recalc,
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571
};

/*
 * L3 clock domain
 * L3 clocks are used for both interface and functional clocks to
 * multiple entities. Some of these clocks are completely managed
 * by hardware, and some others allow software control. Hardware
 * managed ones general are based on directly CLK_REQ signals and
 * various auto idle settings. The functional spec sets many of these
 * as 'tie-high' for their enables.
 *
 * I-CLOCKS:
 *	L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
 *	CAM, HS-USB.
 * F-CLOCK
 *	SSI.
 *
 * GPMC memories and SDRC have timing and clock sensitive registers which
 * may very well need notification when the clock changes. Currently for low
 * operating points, these are taken care of in sleep.S.
 */
572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
static const struct clksel_rate core_l3_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
	{ .div = 2, .val = 2, .flags = RATE_IN_242X },
	{ .div = 4, .val = 4, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 6, .val = 6, .flags = RATE_IN_24XX },
	{ .div = 8, .val = 8, .flags = RATE_IN_242X },
	{ .div = 12, .val = 12, .flags = RATE_IN_242X },
	{ .div = 16, .val = 16, .flags = RATE_IN_242X },
	{ .div = 0 }
};

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

588 589
static struct clk core_l3_ck = {	/* Used for ick and fck, interconnect */
	.name		= "core_l3_ck",
590
	.ops		= &clkops_null,
591
	.parent		= &core_ck,
592
	.flags		= DELAYED_APP,
593
	.clkdm_name	= "core_l3_clkdm",
594 595 596
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_L3_MASK,
	.clksel		= core_l3_clksel,
597
	.recalc		= &omap2_clksel_recalc,
598 599 600 601 602 603 604 605 606 607 608 609 610
};

/* usb_l4_ick */
static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 4, .val = 4, .flags = RATE_IN_24XX },
	{ .div = 0 }
};

static const struct clksel usb_l4_ick_clksel[] = {
	{ .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates },
	{ .parent = NULL },
611 612
};

613
/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
614 615
static struct clk usb_l4_ick = {	/* FS-USB interface clock */
	.name		= "usb_l4_ick",
616
	.ops		= &clkops_omap2_dflt_wait,
617
	.parent		= &core_l3_ck,
618
	.flags		= DELAYED_APP,
619
	.clkdm_name	= "core_l4_clkdm",
620 621 622 623 624
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP24XX_EN_USB_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_USB_MASK,
	.clksel		= usb_l4_ick_clksel,
625 626 627
	.recalc		= &omap2_clksel_recalc,
};

628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647
/*
 * L4 clock management domain
 *
 * This domain contains lots of interface clocks from the L4 interface, some
 * functional clocks.	Fixed APLL functional source clocks are managed in
 * this domain.
 */
static const struct clksel_rate l4_core_l3_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 0 }
};

static const struct clksel l4_clksel[] = {
	{ .parent = &core_l3_ck, .rates = l4_core_l3_rates },
	{ .parent = NULL }
};

static struct clk l4_ck = {		/* used both as an ick and fck */
	.name		= "l4_ck",
648
	.ops		= &clkops_null,
649
	.parent		= &core_l3_ck,
650
	.flags		= DELAYED_APP,
651 652 653 654 655 656 657 658 659
	.clkdm_name	= "core_l4_clkdm",
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_L4_MASK,
	.clksel		= l4_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

660 661 662 663
/*
 * SSI is in L3 management domain, its direct parent is core not l3,
 * many core power domain entities are grouped into the L3 clock
 * domain.
664
 * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK
665 666 667
 *
 * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
 */
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 3, .val = 3, .flags = RATE_IN_24XX },
	{ .div = 4, .val = 4, .flags = RATE_IN_24XX },
	{ .div = 5, .val = 5, .flags = RATE_IN_243X },
	{ .div = 6, .val = 6, .flags = RATE_IN_242X },
	{ .div = 8, .val = 8, .flags = RATE_IN_242X },
	{ .div = 0 }
};

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

684 685
static struct clk ssi_ssr_sst_fck = {
	.name		= "ssi_fck",
686
	.ops		= &clkops_omap2_dflt_wait,
687
	.parent		= &core_ck,
688
	.flags		= DELAYED_APP,
689
	.clkdm_name	= "core_l3_clkdm",
690 691 692 693 694
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_SSI_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_SSI_MASK,
	.clksel		= ssi_ssr_sst_fck_clksel,
695
	.recalc		= &omap2_clksel_recalc,
696 697
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
698 699
};

700 701 702 703 704 705 706 707 708 709 710 711 712 713
/*
 * Presumably this is the same as SSI_ICLK.
 * TRM contradicts itself on what clockdomain SSI_ICLK is in
 */
static struct clk ssi_l4_ick = {
	.name		= "ssi_l4_ick",
	.ops		= &clkops_omap2_dflt_wait,
	.parent		= &l4_ck,
	.clkdm_name	= "core_l4_clkdm",
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP24XX_EN_SSI_SHIFT,
	.recalc		= &followparent_recalc,
};

714

715 716 717 718 719 720 721 722 723 724 725
/*
 * GFX clock domain
 *	Clocks:
 * GFX_FCLK, GFX_ICLK
 * GFX_CG1(2d), GFX_CG2(3d)
 *
 * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
 * The 2d and 3d clocks run at a hardware determined
 * divided value of fclk.
 *
 */
726 727 728 729 730 731 732

/* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */
static const struct clksel gfx_fck_clksel[] = {
	{ .parent = &core_l3_ck, .rates = gfx_l3_rates },
	{ .parent = NULL },
};

733 734
static struct clk gfx_3d_fck = {
	.name		= "gfx_3d_fck",
735
	.ops		= &clkops_omap2_dflt_wait,
736
	.parent		= &core_l3_ck,
737
	.clkdm_name	= "gfx_clkdm",
738 739 740 741 742
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_3D_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP_CLKSEL_GFX_MASK,
	.clksel		= gfx_fck_clksel,
743
	.recalc		= &omap2_clksel_recalc,
744 745
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
746 747 748 749
};

static struct clk gfx_2d_fck = {
	.name		= "gfx_2d_fck",
750
	.ops		= &clkops_omap2_dflt_wait,
751
	.parent		= &core_l3_ck,
752
	.flags		= DELAYED_APP,
753
	.clkdm_name	= "gfx_clkdm",
754 755 756 757 758
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_2D_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP_CLKSEL_GFX_MASK,
	.clksel		= gfx_fck_clksel,
759 760 761 762 763
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gfx_ick = {
	.name		= "gfx_ick",		/* From l3 */
764
	.ops		= &clkops_omap2_dflt_wait,
765
	.parent		= &core_l3_ck,
766
	.clkdm_name	= "gfx_clkdm",
767 768 769
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
	.enable_bit	= OMAP_EN_GFX_SHIFT,
	.recalc		= &followparent_recalc,
770 771 772 773 774 775 776
};

/*
 * Modem clock domain (2430)
 *	CLOCKS:
 *		MDM_OSC_CLK
 *		MDM_ICLK
777
 * These clocks are usable in chassis mode only.
778
 */
779 780 781 782 783 784 785 786 787 788 789 790 791
static const struct clksel_rate mdm_ick_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_243X },
	{ .div = 4, .val = 4, .flags = RATE_IN_243X | DEFAULT_RATE },
	{ .div = 6, .val = 6, .flags = RATE_IN_243X },
	{ .div = 9, .val = 9, .flags = RATE_IN_243X },
	{ .div = 0 }
};

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

792 793
static struct clk mdm_ick = {		/* used both as a ick and fck */
	.name		= "mdm_ick",
794
	.ops		= &clkops_omap2_dflt_wait,
795
	.parent		= &core_ck,
796
	.flags		= DELAYED_APP,
797
	.clkdm_name	= "mdm_clkdm",
798 799 800 801 802
	.enable_reg	= OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
	.enable_bit	= OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP2430_CLKSEL_MDM_MASK,
	.clksel		= mdm_ick_clksel,
803 804 805 806 807
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mdm_osc_ck = {
	.name		= "mdm_osc_ck",
808
	.ops		= &clkops_omap2_dflt_wait,
809
	.parent		= &osc_ck,
810
	.clkdm_name	= "mdm_clkdm",
811 812 813
	.enable_reg	= OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2430_EN_OSC_SHIFT,
	.recalc		= &followparent_recalc,
814 815 816 817 818 819 820 821 822 823
};

/*
 * DSS clock domain
 * CLOCKs:
 * DSS_L4_ICLK, DSS_L3_ICLK,
 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
 *
 * DSS is both initiator and target.
 */
824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850
/* XXX Add RATE_NOT_VALIDATED */

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

static const struct clksel_rate dss1_fck_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 3, .val = 3, .flags = RATE_IN_24XX },
	{ .div = 4, .val = 4, .flags = RATE_IN_24XX },
	{ .div = 5, .val = 5, .flags = RATE_IN_24XX },
	{ .div = 6, .val = 6, .flags = RATE_IN_24XX },
	{ .div = 8, .val = 8, .flags = RATE_IN_24XX },
	{ .div = 9, .val = 9, .flags = RATE_IN_24XX },
	{ .div = 12, .val = 12, .flags = RATE_IN_24XX },
	{ .div = 16, .val = 16, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel dss1_fck_clksel[] = {
	{ .parent = &sys_ck,  .rates = dss1_fck_sys_rates },
	{ .parent = &core_ck, .rates = dss1_fck_core_rates },
	{ .parent = NULL },
};

851 852
static struct clk dss_ick = {		/* Enables both L3,L4 ICLK's */
	.name		= "dss_ick",
853
	.ops		= &clkops_omap2_dflt,
854
	.parent		= &l4_ck,	/* really both l3 and l4 */
855
	.clkdm_name	= "dss_clkdm",
856 857 858
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_DSS1_SHIFT,
	.recalc		= &followparent_recalc,
859 860 861 862
};

static struct clk dss1_fck = {
	.name		= "dss1_fck",
863
	.ops		= &clkops_omap2_dflt,
864
	.parent		= &core_ck,		/* Core or sys */
865
	.flags		= DELAYED_APP,
866
	.clkdm_name	= "dss_clkdm",
867 868 869 870 871 872
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_DSS1_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_DSS1_MASK,
	.clksel		= dss1_fck_clksel,
873
	.recalc		= &omap2_clksel_recalc,
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

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

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

static const struct clksel dss2_fck_clksel[] = {
	{ .parent = &sys_ck,	  .rates = dss2_fck_sys_rates },
	{ .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
	{ .parent = NULL }
892 893 894 895
};

static struct clk dss2_fck = {		/* Alt clk used in power management */
	.name		= "dss2_fck",
896
	.ops		= &clkops_omap2_dflt,
897
	.parent		= &sys_ck,		/* fixed at sys_ck or 48MHz */
898
	.flags		= DELAYED_APP,
899
	.clkdm_name	= "dss_clkdm",
900 901 902 903 904 905 906
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_DSS2_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_DSS2_MASK,
	.clksel		= dss2_fck_clksel,
	.recalc		= &followparent_recalc,
907 908 909 910
};

static struct clk dss_54m_fck = {	/* Alt clk used in power management */
	.name		= "dss_54m_fck",	/* 54m tv clk */
911
	.ops		= &clkops_omap2_dflt_wait,
912
	.parent		= &func_54m_ck,
913
	.clkdm_name	= "dss_clkdm",
914 915 916
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_TV_SHIFT,
	.recalc		= &followparent_recalc,
917 918 919 920 921 922 923 924
};

/*
 * CORE power domain ICLK & FCLK defines.
 * Many of the these can have more than one possible parent. Entries
 * here will likely have an L4 interface parent, and may have multiple
 * functional clock parents.
 */
925 926 927 928 929 930 931 932 933 934 935 936
static const struct clksel_rate gpt_alt_rates[] = {
	{ .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 0 }
};

static const struct clksel omap24xx_gpt_clksel[] = {
	{ .parent = &func_32k_ck, .rates = gpt_32k_rates },
	{ .parent = &sys_ck,	  .rates = gpt_sys_rates },
	{ .parent = &alt_ck,	  .rates = gpt_alt_rates },
	{ .parent = NULL },
};

937 938
static struct clk gpt1_ick = {
	.name		= "gpt1_ick",
939
	.ops		= &clkops_omap2_dflt_wait,
940
	.parent		= &l4_ck,
941
	.clkdm_name	= "core_l4_clkdm",
942 943 944
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_GPT1_SHIFT,
	.recalc		= &followparent_recalc,
945 946 947 948
};

static struct clk gpt1_fck = {
	.name		= "gpt1_fck",
949
	.ops		= &clkops_omap2_dflt_wait,
950
	.parent		= &func_32k_ck,
951
	.clkdm_name	= "core_l4_clkdm",
952 953 954 955 956 957 958 959 960
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_GPT1_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT1_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
961 962 963 964
};

static struct clk gpt2_ick = {
	.name		= "gpt2_ick",
965
	.ops		= &clkops_omap2_dflt_wait,
966
	.parent		= &l4_ck,
967
	.clkdm_name	= "core_l4_clkdm",
968 969 970
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT2_SHIFT,
	.recalc		= &followparent_recalc,
971 972 973 974
};

static struct clk gpt2_fck = {
	.name		= "gpt2_fck",
975
	.ops		= &clkops_omap2_dflt_wait,
976
	.parent		= &func_32k_ck,
977
	.clkdm_name	= "core_l4_clkdm",
978 979 980 981 982 983 984
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT2_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT2_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
985 986 987 988
};

static struct clk gpt3_ick = {
	.name		= "gpt3_ick",
989
	.ops		= &clkops_omap2_dflt_wait,
990
	.parent		= &l4_ck,
991
	.clkdm_name	= "core_l4_clkdm",
992 993 994
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT3_SHIFT,
	.recalc		= &followparent_recalc,
995 996 997 998
};

static struct clk gpt3_fck = {
	.name		= "gpt3_fck",
999
	.ops		= &clkops_omap2_dflt_wait,
1000
	.parent		= &func_32k_ck,
1001
	.clkdm_name	= "core_l4_clkdm",
1002 1003 1004 1005 1006 1007 1008
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT3_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT3_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1009 1010 1011 1012
};

static struct clk gpt4_ick = {
	.name		= "gpt4_ick",
1013
	.ops		= &clkops_omap2_dflt_wait,
1014
	.parent		= &l4_ck,
1015
	.clkdm_name	= "core_l4_clkdm",
1016 1017 1018
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT4_SHIFT,
	.recalc		= &followparent_recalc,
1019 1020 1021 1022
};

static struct clk gpt4_fck = {
	.name		= "gpt4_fck",
1023
	.ops		= &clkops_omap2_dflt_wait,
1024
	.parent		= &func_32k_ck,
1025
	.clkdm_name	= "core_l4_clkdm",
1026 1027 1028 1029 1030 1031 1032
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT4_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT4_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1033 1034 1035 1036
};

static struct clk gpt5_ick = {
	.name		= "gpt5_ick",
1037
	.ops		= &clkops_omap2_dflt_wait,
1038
	.parent		= &l4_ck,
1039
	.clkdm_name	= "core_l4_clkdm",
1040 1041 1042
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT5_SHIFT,
	.recalc		= &followparent_recalc,
1043 1044 1045 1046
};

static struct clk gpt5_fck = {
	.name		= "gpt5_fck",
1047
	.ops		= &clkops_omap2_dflt_wait,
1048
	.parent		= &func_32k_ck,
1049
	.clkdm_name	= "core_l4_clkdm",
1050 1051 1052 1053 1054 1055 1056
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT5_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT5_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1057 1058 1059 1060
};

static struct clk gpt6_ick = {
	.name		= "gpt6_ick",
1061
	.ops		= &clkops_omap2_dflt_wait,
1062
	.parent		= &l4_ck,
1063
	.clkdm_name	= "core_l4_clkdm",
1064 1065 1066
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT6_SHIFT,
	.recalc		= &followparent_recalc,
1067 1068 1069 1070
};

static struct clk gpt6_fck = {
	.name		= "gpt6_fck",
1071
	.ops		= &clkops_omap2_dflt_wait,
1072
	.parent		= &func_32k_ck,
1073
	.clkdm_name	= "core_l4_clkdm",
1074 1075 1076 1077 1078 1079 1080
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT6_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT6_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1081 1082 1083 1084
};

static struct clk gpt7_ick = {
	.name		= "gpt7_ick",
1085
	.ops		= &clkops_omap2_dflt_wait,
1086
	.parent		= &l4_ck,
1087 1088 1089
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT7_SHIFT,
	.recalc		= &followparent_recalc,
1090 1091 1092 1093
};

static struct clk gpt7_fck = {
	.name		= "gpt7_fck",
1094
	.ops		= &clkops_omap2_dflt_wait,
1095
	.parent		= &func_32k_ck,
1096
	.clkdm_name	= "core_l4_clkdm",
1097 1098 1099 1100 1101 1102 1103
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT7_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT7_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1104 1105 1106 1107
};

static struct clk gpt8_ick = {
	.name		= "gpt8_ick",
1108
	.ops		= &clkops_omap2_dflt_wait,
1109
	.parent		= &l4_ck,
1110
	.clkdm_name	= "core_l4_clkdm",
1111 1112 1113
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT8_SHIFT,
	.recalc		= &followparent_recalc,
1114 1115 1116 1117
};

static struct clk gpt8_fck = {
	.name		= "gpt8_fck",
1118
	.ops		= &clkops_omap2_dflt_wait,
1119
	.parent		= &func_32k_ck,
1120
	.clkdm_name	= "core_l4_clkdm",
1121 1122 1123 1124 1125 1126 1127
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT8_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT8_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1128 1129 1130 1131
};

static struct clk gpt9_ick = {
	.name		= "gpt9_ick",
1132
	.ops		= &clkops_omap2_dflt_wait,
1133
	.parent		= &l4_ck,
1134
	.clkdm_name	= "core_l4_clkdm",
1135 1136 1137
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT9_SHIFT,
	.recalc		= &followparent_recalc,
1138 1139 1140 1141
};

static struct clk gpt9_fck = {
	.name		= "gpt9_fck",
1142
	.ops		= &clkops_omap2_dflt_wait,
1143
	.parent		= &func_32k_ck,
1144
	.clkdm_name	= "core_l4_clkdm",
1145 1146 1147 1148 1149 1150 1151
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT9_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT9_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1152 1153 1154 1155
};

static struct clk gpt10_ick = {
	.name		= "gpt10_ick",
1156
	.ops		= &clkops_omap2_dflt_wait,
1157
	.parent		= &l4_ck,
1158
	.clkdm_name	= "core_l4_clkdm",
1159 1160 1161
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT10_SHIFT,
	.recalc		= &followparent_recalc,
1162 1163 1164 1165
};

static struct clk gpt10_fck = {
	.name		= "gpt10_fck",
1166
	.ops		= &clkops_omap2_dflt_wait,
1167
	.parent		= &func_32k_ck,
1168
	.clkdm_name	= "core_l4_clkdm",
1169 1170 1171 1172 1173 1174 1175
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT10_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT10_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1176 1177 1178 1179
};

static struct clk gpt11_ick = {
	.name		= "gpt11_ick",
1180
	.ops		= &clkops_omap2_dflt_wait,
1181
	.parent		= &l4_ck,
1182
	.clkdm_name	= "core_l4_clkdm",
1183 1184 1185
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT11_SHIFT,
	.recalc		= &followparent_recalc,
1186 1187 1188 1189
};

static struct clk gpt11_fck = {
	.name		= "gpt11_fck",
1190
	.ops		= &clkops_omap2_dflt_wait,
1191
	.parent		= &func_32k_ck,
1192
	.clkdm_name	= "core_l4_clkdm",
1193 1194 1195 1196 1197 1198 1199
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT11_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT11_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1200 1201 1202 1203
};

static struct clk gpt12_ick = {
	.name		= "gpt12_ick",
1204
	.ops		= &clkops_omap2_dflt_wait,
1205
	.parent		= &l4_ck,
1206
	.clkdm_name	= "core_l4_clkdm",
1207 1208 1209
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT12_SHIFT,
	.recalc		= &followparent_recalc,
1210 1211 1212 1213
};

static struct clk gpt12_fck = {
	.name		= "gpt12_fck",
1214
	.ops		= &clkops_omap2_dflt_wait,
1215
	.parent		= &secure_32k_ck,
1216
	.clkdm_name	= "core_l4_clkdm",
1217 1218 1219 1220 1221 1222 1223
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT12_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT12_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1224 1225 1226
};

static struct clk mcbsp1_ick = {
1227
	.name		= "mcbsp1_ick",
1228
	.ops		= &clkops_omap2_dflt_wait,
1229
	.parent		= &l4_ck,
1230
	.clkdm_name	= "core_l4_clkdm",
1231 1232 1233
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP1_SHIFT,
	.recalc		= &followparent_recalc,
1234 1235 1236
};

static struct clk mcbsp1_fck = {
1237
	.name		= "mcbsp1_fck",
1238
	.ops		= &clkops_omap2_dflt_wait,
1239
	.parent		= &func_96m_ck,
1240
	.clkdm_name	= "core_l4_clkdm",
1241 1242 1243
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP1_SHIFT,
	.recalc		= &followparent_recalc,
1244 1245 1246
};

static struct clk mcbsp2_ick = {
1247
	.name		= "mcbsp2_ick",
1248
	.ops		= &clkops_omap2_dflt_wait,
1249
	.parent		= &l4_ck,
1250
	.clkdm_name	= "core_l4_clkdm",
1251 1252 1253
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
	.recalc		= &followparent_recalc,
1254 1255 1256
};

static struct clk mcbsp2_fck = {
1257
	.name		= "mcbsp2_fck",
1258
	.ops		= &clkops_omap2_dflt_wait,
1259
	.parent		= &func_96m_ck,
1260
	.clkdm_name	= "core_l4_clkdm",
1261 1262 1263
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
	.recalc		= &followparent_recalc,
1264 1265 1266
};

static struct clk mcbsp3_ick = {
1267
	.name		= "mcbsp3_ick",
1268
	.ops		= &clkops_omap2_dflt_wait,
1269
	.parent		= &l4_ck,
1270
	.clkdm_name	= "core_l4_clkdm",
1271 1272 1273
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP3_SHIFT,
	.recalc		= &followparent_recalc,
1274 1275 1276
};

static struct clk mcbsp3_fck = {
1277
	.name		= "mcbsp3_fck",
1278
	.ops		= &clkops_omap2_dflt_wait,
1279
	.parent		= &func_96m_ck,
1280
	.clkdm_name	= "core_l4_clkdm",
1281 1282 1283
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP3_SHIFT,
	.recalc		= &followparent_recalc,
1284 1285 1286
};

static struct clk mcbsp4_ick = {
1287
	.name		= "mcbsp4_ick",
1288
	.ops		= &clkops_omap2_dflt_wait,
1289
	.parent		= &l4_ck,
1290
	.clkdm_name	= "core_l4_clkdm",
1291 1292 1293
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP4_SHIFT,
	.recalc		= &followparent_recalc,
1294 1295 1296
};

static struct clk mcbsp4_fck = {
1297
	.name		= "mcbsp4_fck",
1298
	.ops		= &clkops_omap2_dflt_wait,
1299
	.parent		= &func_96m_ck,
1300
	.clkdm_name	= "core_l4_clkdm",
1301 1302 1303
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP4_SHIFT,
	.recalc		= &followparent_recalc,
1304 1305 1306
};

static struct clk mcbsp5_ick = {
1307
	.name		= "mcbsp5_ick",
1308
	.ops		= &clkops_omap2_dflt_wait,
1309
	.parent		= &l4_ck,
1310
	.clkdm_name	= "core_l4_clkdm",
1311 1312 1313
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP5_SHIFT,
	.recalc		= &followparent_recalc,
1314 1315 1316
};

static struct clk mcbsp5_fck = {
1317
	.name		= "mcbsp5_fck",
1318
	.ops		= &clkops_omap2_dflt_wait,
1319
	.parent		= &func_96m_ck,
1320
	.clkdm_name	= "core_l4_clkdm",
1321 1322 1323
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP5_SHIFT,
	.recalc		= &followparent_recalc,
1324 1325 1326
};

static struct clk mcspi1_ick = {
1327
	.name		= "mcspi1_ick",
1328
	.ops		= &clkops_omap2_dflt_wait,
1329
	.parent		= &l4_ck,
1330
	.clkdm_name	= "core_l4_clkdm",
1331 1332 1333
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI1_SHIFT,
	.recalc		= &followparent_recalc,
1334 1335 1336
};

static struct clk mcspi1_fck = {
1337
	.name		= "mcspi1_fck",
1338
	.ops		= &clkops_omap2_dflt_wait,
1339
	.parent		= &func_48m_ck,
1340
	.clkdm_name	= "core_l4_clkdm",
1341 1342 1343
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI1_SHIFT,
	.recalc		= &followparent_recalc,
1344 1345 1346
};

static struct clk mcspi2_ick = {
1347
	.name		= "mcspi2_ick",
1348
	.ops		= &clkops_omap2_dflt_wait,
1349
	.parent		= &l4_ck,
1350
	.clkdm_name	= "core_l4_clkdm",
1351 1352 1353
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI2_SHIFT,
	.recalc		= &followparent_recalc,
1354 1355 1356
};

static struct clk mcspi2_fck = {
1357
	.name		= "mcspi2_fck",
1358
	.ops		= &clkops_omap2_dflt_wait,
1359
	.parent		= &func_48m_ck,
1360
	.clkdm_name	= "core_l4_clkdm",
1361 1362 1363
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI2_SHIFT,
	.recalc		= &followparent_recalc,
1364 1365 1366
};

static struct clk mcspi3_ick = {
1367
	.name		= "mcspi3_ick",
1368
	.ops		= &clkops_omap2_dflt_wait,
1369
	.parent		= &l4_ck,
1370
	.clkdm_name	= "core_l4_clkdm",
1371 1372 1373
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCSPI3_SHIFT,
	.recalc		= &followparent_recalc,
1374 1375 1376
};

static struct clk mcspi3_fck = {
1377
	.name		= "mcspi3_fck",
1378
	.ops		= &clkops_omap2_dflt_wait,
1379
	.parent		= &func_48m_ck,
1380
	.clkdm_name	= "core_l4_clkdm",
1381 1382 1383
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCSPI3_SHIFT,
	.recalc		= &followparent_recalc,
1384 1385 1386 1387
};

static struct clk uart1_ick = {
	.name		= "uart1_ick",
1388
	.ops		= &clkops_omap2_dflt_wait,
1389
	.parent		= &l4_ck,
1390
	.clkdm_name	= "core_l4_clkdm",
1391 1392 1393
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_UART1_SHIFT,
	.recalc		= &followparent_recalc,
1394 1395 1396 1397
};

static struct clk uart1_fck = {
	.name		= "uart1_fck",
1398
	.ops		= &clkops_omap2_dflt_wait,
1399
	.parent		= &func_48m_ck,
1400
	.clkdm_name	= "core_l4_clkdm",
1401 1402 1403
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_UART1_SHIFT,
	.recalc		= &followparent_recalc,
1404 1405 1406 1407
};

static struct clk uart2_ick = {
	.name		= "uart2_ick",
1408
	.ops		= &clkops_omap2_dflt_wait,
1409
	.parent		= &l4_ck,
1410
	.clkdm_name	= "core_l4_clkdm",
1411 1412 1413
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_UART2_SHIFT,
	.recalc		= &followparent_recalc,
1414 1415 1416 1417
};

static struct clk uart2_fck = {
	.name		= "uart2_fck",
1418
	.ops		= &clkops_omap2_dflt_wait,
1419
	.parent		= &func_48m_ck,
1420
	.clkdm_name	= "core_l4_clkdm",
1421 1422 1423
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_UART2_SHIFT,
	.recalc		= &followparent_recalc,
1424 1425 1426 1427
};

static struct clk uart3_ick = {
	.name		= "uart3_ick",
1428
	.ops		= &clkops_omap2_dflt_wait,
1429
	.parent		= &l4_ck,
1430
	.clkdm_name	= "core_l4_clkdm",
1431 1432 1433
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP24XX_EN_UART3_SHIFT,
	.recalc		= &followparent_recalc,
1434 1435 1436 1437
};

static struct clk uart3_fck = {
	.name		= "uart3_fck",
1438
	.ops		= &clkops_omap2_dflt_wait,
1439
	.parent		= &func_48m_ck,
1440
	.clkdm_name	= "core_l4_clkdm",
1441 1442 1443
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_UART3_SHIFT,
	.recalc		= &followparent_recalc,
1444 1445 1446 1447
};

static struct clk gpios_ick = {
	.name		= "gpios_ick",
1448
	.ops		= &clkops_omap2_dflt_wait,
1449
	.parent		= &l4_ck,
1450
	.clkdm_name	= "core_l4_clkdm",
1451 1452 1453
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_GPIOS_SHIFT,
	.recalc		= &followparent_recalc,
1454 1455 1456 1457
};

static struct clk gpios_fck = {
	.name		= "gpios_fck",
1458
	.ops		= &clkops_omap2_dflt_wait,
1459
	.parent		= &func_32k_ck,
1460
	.clkdm_name	= "wkup_clkdm",
1461 1462 1463
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_GPIOS_SHIFT,
	.recalc		= &followparent_recalc,
1464 1465 1466 1467
};

static struct clk mpu_wdt_ick = {
	.name		= "mpu_wdt_ick",
1468
	.ops		= &clkops_omap2_dflt_wait,
1469
	.parent		= &l4_ck,
1470
	.clkdm_name	= "core_l4_clkdm",
1471 1472 1473
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_MPU_WDT_SHIFT,
	.recalc		= &followparent_recalc,
1474 1475 1476 1477
};

static struct clk mpu_wdt_fck = {
	.name		= "mpu_wdt_fck",
1478
	.ops		= &clkops_omap2_dflt_wait,
1479
	.parent		= &func_32k_ck,
1480
	.clkdm_name	= "wkup_clkdm",
1481 1482 1483
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_MPU_WDT_SHIFT,
	.recalc		= &followparent_recalc,
1484 1485 1486 1487
};

static struct clk sync_32k_ick = {
	.name		= "sync_32k_ick",
1488
	.ops		= &clkops_omap2_dflt_wait,
1489
	.parent		= &l4_ck,
1490
	.flags		= ENABLE_ON_INIT,
1491
	.clkdm_name	= "core_l4_clkdm",
1492 1493 1494
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_32KSYNC_SHIFT,
	.recalc		= &followparent_recalc,
1495
};
1496

1497 1498
static struct clk wdt1_ick = {
	.name		= "wdt1_ick",
1499
	.ops		= &clkops_omap2_dflt_wait,
1500
	.parent		= &l4_ck,
1501
	.clkdm_name	= "core_l4_clkdm",
1502 1503 1504
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_WDT1_SHIFT,
	.recalc		= &followparent_recalc,
1505
};
1506

1507 1508
static struct clk omapctrl_ick = {
	.name		= "omapctrl_ick",
1509
	.ops		= &clkops_omap2_dflt_wait,
1510
	.parent		= &l4_ck,
1511
	.flags		= ENABLE_ON_INIT,
1512
	.clkdm_name	= "core_l4_clkdm",
1513 1514 1515
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_OMAPCTRL_SHIFT,
	.recalc		= &followparent_recalc,
1516
};
1517

1518 1519
static struct clk icr_ick = {
	.name		= "icr_ick",
1520
	.ops		= &clkops_omap2_dflt_wait,
1521
	.parent		= &l4_ck,
1522
	.clkdm_name	= "core_l4_clkdm",
1523 1524 1525
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP2430_EN_ICR_SHIFT,
	.recalc		= &followparent_recalc,
1526 1527 1528 1529
};

static struct clk cam_ick = {
	.name		= "cam_ick",
1530
	.ops		= &clkops_omap2_dflt,
1531
	.parent		= &l4_ck,
1532
	.clkdm_name	= "core_l4_clkdm",
1533 1534 1535
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_CAM_SHIFT,
	.recalc		= &followparent_recalc,
1536 1537
};

1538 1539 1540 1541 1542
/*
 * cam_fck controls both CAM_MCLK and CAM_FCLK.  It should probably be
 * split into two separate clocks, since the parent clocks are different
 * and the clockdomains are also different.
 */
1543 1544
static struct clk cam_fck = {
	.name		= "cam_fck",
1545
	.ops		= &clkops_omap2_dflt,
1546
	.parent		= &func_96m_ck,
1547
	.clkdm_name	= "core_l3_clkdm",
1548 1549 1550
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_CAM_SHIFT,
	.recalc		= &followparent_recalc,
1551 1552 1553 1554
};

static struct clk mailboxes_ick = {
	.name		= "mailboxes_ick",
1555
	.ops		= &clkops_omap2_dflt_wait,
1556
	.parent		= &l4_ck,
1557
	.clkdm_name	= "core_l4_clkdm",
1558 1559 1560
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MAILBOXES_SHIFT,
	.recalc		= &followparent_recalc,
1561 1562 1563 1564
};

static struct clk wdt4_ick = {
	.name		= "wdt4_ick",
1565
	.ops		= &clkops_omap2_dflt_wait,
1566
	.parent		= &l4_ck,
1567
	.clkdm_name	= "core_l4_clkdm",
1568 1569 1570
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_WDT4_SHIFT,
	.recalc		= &followparent_recalc,
1571 1572 1573 1574
};

static struct clk wdt4_fck = {
	.name		= "wdt4_fck",
1575
	.ops		= &clkops_omap2_dflt_wait,
1576
	.parent		= &func_32k_ck,
1577
	.clkdm_name	= "core_l4_clkdm",
1578 1579 1580
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_WDT4_SHIFT,
	.recalc		= &followparent_recalc,
1581 1582 1583 1584
};

static struct clk wdt3_ick = {
	.name		= "wdt3_ick",
1585
	.ops		= &clkops_omap2_dflt_wait,
1586
	.parent		= &l4_ck,
1587
	.clkdm_name	= "core_l4_clkdm",
1588 1589 1590
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_WDT3_SHIFT,
	.recalc		= &followparent_recalc,
1591 1592 1593 1594
};

static struct clk wdt3_fck = {
	.name		= "wdt3_fck",
1595
	.ops		= &clkops_omap2_dflt_wait,
1596
	.parent		= &func_32k_ck,
1597
	.clkdm_name	= "core_l4_clkdm",
1598 1599 1600
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_WDT3_SHIFT,
	.recalc		= &followparent_recalc,
1601 1602 1603 1604
};

static struct clk mspro_ick = {
	.name		= "mspro_ick",
1605
	.ops		= &clkops_omap2_dflt_wait,
1606
	.parent		= &l4_ck,
1607
	.clkdm_name	= "core_l4_clkdm",
1608 1609 1610
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MSPRO_SHIFT,
	.recalc		= &followparent_recalc,
1611 1612 1613 1614
};

static struct clk mspro_fck = {
	.name		= "mspro_fck",
1615
	.ops		= &clkops_omap2_dflt_wait,
1616
	.parent		= &func_96m_ck,
1617
	.clkdm_name	= "core_l4_clkdm",
1618 1619 1620
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MSPRO_SHIFT,
	.recalc		= &followparent_recalc,
1621 1622 1623 1624
};

static struct clk mmc_ick = {
	.name		= "mmc_ick",
1625
	.ops		= &clkops_omap2_dflt_wait,
1626
	.parent		= &l4_ck,
1627
	.clkdm_name	= "core_l4_clkdm",
1628 1629 1630
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_MMC_SHIFT,
	.recalc		= &followparent_recalc,
1631 1632 1633 1634
};

static struct clk mmc_fck = {
	.name		= "mmc_fck",
1635
	.ops		= &clkops_omap2_dflt_wait,
1636
	.parent		= &func_96m_ck,
1637
	.clkdm_name	= "core_l4_clkdm",
1638 1639 1640
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_MMC_SHIFT,
	.recalc		= &followparent_recalc,
1641 1642 1643 1644
};

static struct clk fac_ick = {
	.name		= "fac_ick",
1645
	.ops		= &clkops_omap2_dflt_wait,
1646
	.parent		= &l4_ck,
1647
	.clkdm_name	= "core_l4_clkdm",
1648 1649 1650
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_FAC_SHIFT,
	.recalc		= &followparent_recalc,
1651 1652 1653 1654
};

static struct clk fac_fck = {
	.name		= "fac_fck",
1655
	.ops		= &clkops_omap2_dflt_wait,
1656
	.parent		= &func_12m_ck,
1657
	.clkdm_name	= "core_l4_clkdm",
1658 1659 1660
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_FAC_SHIFT,
	.recalc		= &followparent_recalc,
1661 1662 1663 1664
};

static struct clk eac_ick = {
	.name		= "eac_ick",
1665
	.ops		= &clkops_omap2_dflt_wait,
1666
	.parent		= &l4_ck,
1667
	.clkdm_name	= "core_l4_clkdm",
1668 1669 1670
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_EAC_SHIFT,
	.recalc		= &followparent_recalc,
1671 1672 1673 1674
};

static struct clk eac_fck = {
	.name		= "eac_fck",
1675
	.ops		= &clkops_omap2_dflt_wait,
1676
	.parent		= &func_96m_ck,
1677
	.clkdm_name	= "core_l4_clkdm",
1678 1679 1680
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_EAC_SHIFT,
	.recalc		= &followparent_recalc,
1681 1682 1683 1684
};

static struct clk hdq_ick = {
	.name		= "hdq_ick",
1685
	.ops		= &clkops_omap2_dflt_wait,
1686
	.parent		= &l4_ck,
1687
	.clkdm_name	= "core_l4_clkdm",
1688 1689 1690
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
1691 1692 1693 1694
};

static struct clk hdq_fck = {
	.name		= "hdq_fck",
1695
	.ops		= &clkops_omap2_dflt_wait,
1696
	.parent		= &func_12m_ck,
1697
	.clkdm_name	= "core_l4_clkdm",
1698 1699 1700
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
1701 1702 1703
};

static struct clk i2c2_ick = {
1704
	.name		= "i2c2_ick",
1705
	.ops		= &clkops_omap2_dflt_wait,
1706
	.parent		= &l4_ck,
1707
	.clkdm_name	= "core_l4_clkdm",
1708 1709 1710
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_I2C2_SHIFT,
	.recalc		= &followparent_recalc,
1711 1712 1713
};

static struct clk i2c2_fck = {
1714
	.name		= "i2c2_fck",
1715
	.ops		= &clkops_omap2_dflt_wait,
1716
	.parent		= &func_12m_ck,
1717
	.clkdm_name	= "core_l4_clkdm",
1718 1719 1720
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_I2C2_SHIFT,
	.recalc		= &followparent_recalc,
1721 1722 1723
};

static struct clk i2chs2_fck = {
1724
	.name		= "i2chs2_fck",
1725
	.ops		= &clkops_omap2430_i2chs_wait,
1726
	.parent		= &func_96m_ck,
1727
	.clkdm_name	= "core_l4_clkdm",
1728 1729 1730
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_I2CHS2_SHIFT,
	.recalc		= &followparent_recalc,
1731 1732 1733
};

static struct clk i2c1_ick = {
1734
	.name		= "i2c1_ick",
1735
	.ops		= &clkops_omap2_dflt_wait,
1736
	.parent		= &l4_ck,
1737
	.clkdm_name	= "core_l4_clkdm",
1738 1739 1740
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_I2C1_SHIFT,
	.recalc		= &followparent_recalc,
1741 1742 1743
};

static struct clk i2c1_fck = {
1744
	.name		= "i2c1_fck",
1745
	.ops		= &clkops_omap2_dflt_wait,
1746
	.parent		= &func_12m_ck,
1747
	.clkdm_name	= "core_l4_clkdm",
1748 1749 1750
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_I2C1_SHIFT,
	.recalc		= &followparent_recalc,
1751 1752 1753
};

static struct clk i2chs1_fck = {
1754
	.name		= "i2chs1_fck",
1755
	.ops		= &clkops_omap2430_i2chs_wait,
1756
	.parent		= &func_96m_ck,
1757
	.clkdm_name	= "core_l4_clkdm",
1758 1759 1760 1761 1762 1763 1764
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_I2CHS1_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk gpmc_fck = {
	.name		= "gpmc_fck",
1765
	.ops		= &clkops_null, /* RMK: missing? */
1766
	.parent		= &core_l3_ck,
1767
	.flags		= ENABLE_ON_INIT,
1768
	.clkdm_name	= "core_l3_clkdm",
1769 1770 1771 1772 1773
	.recalc		= &followparent_recalc,
};

static struct clk sdma_fck = {
	.name		= "sdma_fck",
1774
	.ops		= &clkops_null, /* RMK: missing? */
1775
	.parent		= &core_l3_ck,
1776
	.clkdm_name	= "core_l3_clkdm",
1777 1778 1779 1780 1781
	.recalc		= &followparent_recalc,
};

static struct clk sdma_ick = {
	.name		= "sdma_ick",
1782
	.ops		= &clkops_null, /* RMK: missing? */
1783
	.parent		= &l4_ck,
1784
	.clkdm_name	= "core_l3_clkdm",
1785
	.recalc		= &followparent_recalc,
1786 1787 1788 1789
};

static struct clk vlynq_ick = {
	.name		= "vlynq_ick",
1790
	.ops		= &clkops_omap2_dflt_wait,
1791
	.parent		= &core_l3_ck,
1792
	.clkdm_name	= "core_l3_clkdm",
1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_VLYNQ_SHIFT,
	.recalc		= &followparent_recalc,
};

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

static const struct clksel_rate vlynq_fck_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_242X },
	{ .div = 2, .val = 2, .flags = RATE_IN_242X },
	{ .div = 3, .val = 3, .flags = RATE_IN_242X },
	{ .div = 4, .val = 4, .flags = RATE_IN_242X },
	{ .div = 6, .val = 6, .flags = RATE_IN_242X },
	{ .div = 8, .val = 8, .flags = RATE_IN_242X },
	{ .div = 9, .val = 9, .flags = RATE_IN_242X },
	{ .div = 12, .val = 12, .flags = RATE_IN_242X },
	{ .div = 16, .val = 16, .flags = RATE_IN_242X | DEFAULT_RATE },
	{ .div = 18, .val = 18, .flags = RATE_IN_242X },
	{ .div = 0 }
};

static const struct clksel vlynq_fck_clksel[] = {
	{ .parent = &func_96m_ck, .rates = vlynq_fck_96m_rates },
	{ .parent = &core_ck,	  .rates = vlynq_fck_core_rates },
	{ .parent = NULL }
1821 1822 1823 1824
};

static struct clk vlynq_fck = {
	.name		= "vlynq_fck",
1825
	.ops		= &clkops_omap2_dflt_wait,
1826
	.parent		= &func_96m_ck,
1827
	.flags		= DELAYED_APP,
1828
	.clkdm_name	= "core_l3_clkdm",
1829 1830 1831 1832 1833 1834 1835 1836 1837
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_VLYNQ_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP2420_CLKSEL_VLYNQ_MASK,
	.clksel		= vlynq_fck_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
1838 1839 1840 1841
};

static struct clk sdrc_ick = {
	.name		= "sdrc_ick",
1842
	.ops		= &clkops_omap2_dflt_wait,
1843
	.parent		= &l4_ck,
1844
	.flags		= ENABLE_ON_INIT,
1845
	.clkdm_name	= "core_l4_clkdm",
1846 1847 1848
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
	.enable_bit	= OMAP2430_EN_SDRC_SHIFT,
	.recalc		= &followparent_recalc,
1849 1850 1851 1852
};

static struct clk des_ick = {
	.name		= "des_ick",
1853
	.ops		= &clkops_omap2_dflt_wait,
1854
	.parent		= &l4_ck,
1855
	.clkdm_name	= "core_l4_clkdm",
1856 1857 1858
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_DES_SHIFT,
	.recalc		= &followparent_recalc,
1859 1860 1861 1862
};

static struct clk sha_ick = {
	.name		= "sha_ick",
1863
	.ops		= &clkops_omap2_dflt_wait,
1864
	.parent		= &l4_ck,
1865
	.clkdm_name	= "core_l4_clkdm",
1866 1867 1868
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_SHA_SHIFT,
	.recalc		= &followparent_recalc,
1869 1870 1871 1872
};

static struct clk rng_ick = {
	.name		= "rng_ick",
1873
	.ops		= &clkops_omap2_dflt_wait,
1874
	.parent		= &l4_ck,
1875
	.clkdm_name	= "core_l4_clkdm",
1876 1877 1878
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_RNG_SHIFT,
	.recalc		= &followparent_recalc,
1879 1880 1881 1882
};

static struct clk aes_ick = {
	.name		= "aes_ick",
1883
	.ops		= &clkops_omap2_dflt_wait,
1884
	.parent		= &l4_ck,
1885
	.clkdm_name	= "core_l4_clkdm",
1886 1887 1888
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_AES_SHIFT,
	.recalc		= &followparent_recalc,
1889 1890 1891 1892
};

static struct clk pka_ick = {
	.name		= "pka_ick",
1893
	.ops		= &clkops_omap2_dflt_wait,
1894
	.parent		= &l4_ck,
1895
	.clkdm_name	= "core_l4_clkdm",
1896 1897 1898
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_PKA_SHIFT,
	.recalc		= &followparent_recalc,
1899 1900 1901 1902
};

static struct clk usb_fck = {
	.name		= "usb_fck",
1903
	.ops		= &clkops_omap2_dflt_wait,
1904
	.parent		= &func_48m_ck,
1905
	.clkdm_name	= "core_l3_clkdm",
1906 1907 1908
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_USB_SHIFT,
	.recalc		= &followparent_recalc,
1909 1910 1911 1912
};

static struct clk usbhs_ick = {
	.name		= "usbhs_ick",
1913
	.ops		= &clkops_omap2_dflt_wait,
1914
	.parent		= &core_l3_ck,
1915
	.clkdm_name	= "core_l3_clkdm",
1916 1917 1918
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_USBHS_SHIFT,
	.recalc		= &followparent_recalc,
1919 1920 1921
};

static struct clk mmchs1_ick = {
1922
	.name		= "mmchs1_ick",
1923
	.ops		= &clkops_omap2_dflt_wait,
1924
	.parent		= &l4_ck,
1925
	.clkdm_name	= "core_l4_clkdm",
1926 1927 1928
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS1_SHIFT,
	.recalc		= &followparent_recalc,
1929 1930 1931
};

static struct clk mmchs1_fck = {
1932
	.name		= "mmchs1_fck",
1933
	.ops		= &clkops_omap2_dflt_wait,
1934
	.parent		= &func_96m_ck,
1935
	.clkdm_name	= "core_l3_clkdm",
1936 1937 1938
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS1_SHIFT,
	.recalc		= &followparent_recalc,
1939 1940 1941
};

static struct clk mmchs2_ick = {
1942
	.name		= "mmchs2_ick",
1943
	.ops		= &clkops_omap2_dflt_wait,
1944
	.parent		= &l4_ck,
1945
	.clkdm_name	= "core_l4_clkdm",
1946 1947 1948
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS2_SHIFT,
	.recalc		= &followparent_recalc,
1949 1950 1951
};

static struct clk mmchs2_fck = {
1952
	.name		= "mmchs2_fck",
1953
	.ops		= &clkops_omap2_dflt_wait,
1954
	.parent		= &func_96m_ck,
1955 1956 1957
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS2_SHIFT,
	.recalc		= &followparent_recalc,
1958 1959 1960 1961
};

static struct clk gpio5_ick = {
	.name		= "gpio5_ick",
1962
	.ops		= &clkops_omap2_dflt_wait,
1963
	.parent		= &l4_ck,
1964
	.clkdm_name	= "core_l4_clkdm",
1965 1966 1967
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_GPIO5_SHIFT,
	.recalc		= &followparent_recalc,
1968 1969 1970 1971
};

static struct clk gpio5_fck = {
	.name		= "gpio5_fck",
1972
	.ops		= &clkops_omap2_dflt_wait,
1973
	.parent		= &func_32k_ck,
1974
	.clkdm_name	= "core_l4_clkdm",
1975 1976 1977
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_GPIO5_SHIFT,
	.recalc		= &followparent_recalc,
1978 1979 1980 1981
};

static struct clk mdm_intc_ick = {
	.name		= "mdm_intc_ick",
1982
	.ops		= &clkops_omap2_dflt_wait,
1983
	.parent		= &l4_ck,
1984
	.clkdm_name	= "core_l4_clkdm",
1985 1986 1987
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MDM_INTC_SHIFT,
	.recalc		= &followparent_recalc,
1988 1989 1990
};

static struct clk mmchsdb1_fck = {
1991
	.name		= "mmchsdb1_fck",
1992
	.ops		= &clkops_omap2_dflt_wait,
1993
	.parent		= &func_32k_ck,
1994
	.clkdm_name	= "core_l4_clkdm",
1995 1996 1997
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHSDB1_SHIFT,
	.recalc		= &followparent_recalc,
1998 1999 2000
};

static struct clk mmchsdb2_fck = {
2001
	.name		= "mmchsdb2_fck",
2002
	.ops		= &clkops_omap2_dflt_wait,
2003
	.parent		= &func_32k_ck,
2004
	.clkdm_name	= "core_l4_clkdm",
2005 2006 2007
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHSDB2_SHIFT,
	.recalc		= &followparent_recalc,
2008
};
2009

2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025
/*
 * This clock is a composite clock which does entire set changes then
 * forces a rebalance. It keys on the MPU speed, but it really could
 * be any key speed part of a set in the rate table.
 *
 * to really change a set, you need memory table sets which get changed
 * in sram, pre-notifiers & post notifiers, changing the top set, without
 * having low level display recalc's won't work... this is why dpm notifiers
 * work, isr's off, walk a list of clocks already _off_ and not messing with
 * the bus.
 *
 * This clock should have no parent. It embodies the entire upper level
 * active set. A parent will mess up some of the init also.
 */
static struct clk virt_prcm_set = {
	.name		= "virt_prcm_set",
2026
	.ops		= &clkops_null,
2027
	.parent		= &mpu_ck,	/* Indexed by mpu speed, no parent */
2028
	.recalc		= &omap2_table_mpu_recalc,	/* sets are keyed on mpu rate */
2029 2030 2031
	.set_rate	= &omap2_select_table_rate,
	.round_rate	= &omap2_round_to_table_rate,
};
2032

2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196

/*
 * clkdev integration
 */

static struct omap_clk omap24xx_clks[] = {
	/* external root sources */
	CLK(NULL,	"func_32k_ck",	&func_32k_ck,	CK_243X | CK_242X),
	CLK(NULL,	"secure_32k_ck", &secure_32k_ck, CK_243X | CK_242X),
	CLK(NULL,	"osc_ck",	&osc_ck,	CK_243X | CK_242X),
	CLK(NULL,	"sys_ck",	&sys_ck,	CK_243X | CK_242X),
	CLK(NULL,	"alt_ck",	&alt_ck,	CK_243X | CK_242X),
	/* internal analog sources */
	CLK(NULL,	"dpll_ck",	&dpll_ck,	CK_243X | CK_242X),
	CLK(NULL,	"apll96_ck",	&apll96_ck,	CK_243X | CK_242X),
	CLK(NULL,	"apll54_ck",	&apll54_ck,	CK_243X | CK_242X),
	/* internal prcm root sources */
	CLK(NULL,	"func_54m_ck",	&func_54m_ck,	CK_243X | CK_242X),
	CLK(NULL,	"core_ck",	&core_ck,	CK_243X | CK_242X),
	CLK(NULL,	"func_96m_ck",	&func_96m_ck,	CK_243X | CK_242X),
	CLK(NULL,	"func_48m_ck",	&func_48m_ck,	CK_243X | CK_242X),
	CLK(NULL,	"func_12m_ck",	&func_12m_ck,	CK_243X | CK_242X),
	CLK(NULL,	"ck_wdt1_osc",	&wdt1_osc_ck,	CK_243X | CK_242X),
	CLK(NULL,	"sys_clkout_src", &sys_clkout_src, CK_243X | CK_242X),
	CLK(NULL,	"sys_clkout",	&sys_clkout,	CK_243X | CK_242X),
	CLK(NULL,	"sys_clkout2_src", &sys_clkout2_src, CK_242X),
	CLK(NULL,	"sys_clkout2",	&sys_clkout2,	CK_242X),
	CLK(NULL,	"emul_ck",	&emul_ck,	CK_242X),
	/* mpu domain clocks */
	CLK(NULL,	"mpu_ck",	&mpu_ck,	CK_243X | CK_242X),
	/* dsp domain clocks */
	CLK(NULL,	"dsp_fck",	&dsp_fck,	CK_243X | CK_242X),
	CLK(NULL,	"dsp_irate_ick", &dsp_irate_ick, CK_243X | CK_242X),
	CLK(NULL,	"dsp_ick",	&dsp_ick,	CK_242X),
	CLK(NULL,	"iva2_1_ick",	&iva2_1_ick,	CK_243X),
	CLK(NULL,	"iva1_ifck",	&iva1_ifck,	CK_242X),
	CLK(NULL,	"iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X),
	/* GFX domain clocks */
	CLK(NULL,	"gfx_3d_fck",	&gfx_3d_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gfx_2d_fck",	&gfx_2d_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gfx_ick",	&gfx_ick,	CK_243X | CK_242X),
	/* Modem domain clocks */
	CLK(NULL,	"mdm_ick",	&mdm_ick,	CK_243X),
	CLK(NULL,	"mdm_osc_ck",	&mdm_osc_ck,	CK_243X),
	/* DSS domain clocks */
	CLK("omapdss",	"ick",		&dss_ick,	CK_243X | CK_242X),
	CLK("omapdss",	"dss1_fck",	&dss1_fck,	CK_243X | CK_242X),
	CLK("omapdss",	"dss2_fck",	&dss2_fck,	CK_243X | CK_242X),
	CLK("omapdss",	"tv_fck",	&dss_54m_fck,	CK_243X | CK_242X),
	/* L3 domain clocks */
	CLK(NULL,	"core_l3_ck",	&core_l3_ck,	CK_243X | CK_242X),
	CLK(NULL,	"ssi_fck",	&ssi_ssr_sst_fck, CK_243X | CK_242X),
	CLK(NULL,	"usb_l4_ick",	&usb_l4_ick,	CK_243X | CK_242X),
	/* L4 domain clocks */
	CLK(NULL,	"l4_ck",	&l4_ck,		CK_243X | CK_242X),
	CLK(NULL,	"ssi_l4_ick",	&ssi_l4_ick,	CK_243X | CK_242X),
	/* virtual meta-group clock */
	CLK(NULL,	"virt_prcm_set", &virt_prcm_set, CK_243X | CK_242X),
	/* general l4 interface ck, multi-parent functional clk */
	CLK(NULL,	"gpt1_ick",	&gpt1_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt1_fck",	&gpt1_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt2_ick",	&gpt2_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt2_fck",	&gpt2_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt3_ick",	&gpt3_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt3_fck",	&gpt3_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt4_ick",	&gpt4_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt4_fck",	&gpt4_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt5_ick",	&gpt5_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt5_fck",	&gpt5_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt6_ick",	&gpt6_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt6_fck",	&gpt6_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt7_ick",	&gpt7_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt7_fck",	&gpt7_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt8_ick",	&gpt8_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt8_fck",	&gpt8_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt9_ick",	&gpt9_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt9_fck",	&gpt9_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt10_ick",	&gpt10_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt10_fck",	&gpt10_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt11_ick",	&gpt11_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt11_fck",	&gpt11_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpt12_ick",	&gpt12_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpt12_fck",	&gpt12_fck,	CK_243X | CK_242X),
	CLK("omap-mcbsp.1", "ick",	&mcbsp1_ick,	CK_243X | CK_242X),
	CLK("omap-mcbsp.1", "fck",	&mcbsp1_fck,	CK_243X | CK_242X),
	CLK("omap-mcbsp.2", "ick",	&mcbsp2_ick,	CK_243X | CK_242X),
	CLK("omap-mcbsp.2", "fck",	&mcbsp2_fck,	CK_243X | CK_242X),
	CLK("omap-mcbsp.3", "ick",	&mcbsp3_ick,	CK_243X),
	CLK("omap-mcbsp.3", "fck",	&mcbsp3_fck,	CK_243X),
	CLK("omap-mcbsp.4", "ick",	&mcbsp4_ick,	CK_243X),
	CLK("omap-mcbsp.4", "fck",	&mcbsp4_fck,	CK_243X),
	CLK("omap-mcbsp.5", "ick",	&mcbsp5_ick,	CK_243X),
	CLK("omap-mcbsp.5", "fck",	&mcbsp5_fck,	CK_243X),
	CLK("omap2_mcspi.1", "ick",	&mcspi1_ick,	CK_243X | CK_242X),
	CLK("omap2_mcspi.1", "fck",	&mcspi1_fck,	CK_243X | CK_242X),
	CLK("omap2_mcspi.2", "ick",	&mcspi2_ick,	CK_243X | CK_242X),
	CLK("omap2_mcspi.2", "fck",	&mcspi2_fck,	CK_243X | CK_242X),
	CLK("omap2_mcspi.3", "ick",	&mcspi3_ick,	CK_243X),
	CLK("omap2_mcspi.3", "fck",	&mcspi3_fck,	CK_243X),
	CLK(NULL,	"uart1_ick",	&uart1_ick,	CK_243X | CK_242X),
	CLK(NULL,	"uart1_fck",	&uart1_fck,	CK_243X | CK_242X),
	CLK(NULL,	"uart2_ick",	&uart2_ick,	CK_243X | CK_242X),
	CLK(NULL,	"uart2_fck",	&uart2_fck,	CK_243X | CK_242X),
	CLK(NULL,	"uart3_ick",	&uart3_ick,	CK_243X | CK_242X),
	CLK(NULL,	"uart3_fck",	&uart3_fck,	CK_243X | CK_242X),
	CLK(NULL,	"gpios_ick",	&gpios_ick,	CK_243X | CK_242X),
	CLK(NULL,	"gpios_fck",	&gpios_fck,	CK_243X | CK_242X),
	CLK("omap_wdt",	"ick",		&mpu_wdt_ick,	CK_243X | CK_242X),
	CLK("omap_wdt",	"fck",		&mpu_wdt_fck,	CK_243X | CK_242X),
	CLK(NULL,	"sync_32k_ick",	&sync_32k_ick,	CK_243X | CK_242X),
	CLK(NULL,	"wdt1_ick",	&wdt1_ick,	CK_243X | CK_242X),
	CLK(NULL,	"omapctrl_ick",	&omapctrl_ick,	CK_243X | CK_242X),
	CLK(NULL,	"icr_ick",	&icr_ick,	CK_243X),
	CLK("omap24xxcam", "fck",	&cam_fck,	CK_243X | CK_242X),
	CLK("omap24xxcam", "ick",	&cam_ick,	CK_243X | CK_242X),
	CLK(NULL,	"mailboxes_ick", &mailboxes_ick,	CK_243X | CK_242X),
	CLK(NULL,	"wdt4_ick",	&wdt4_ick,	CK_243X | CK_242X),
	CLK(NULL,	"wdt4_fck",	&wdt4_fck,	CK_243X | CK_242X),
	CLK(NULL,	"wdt3_ick",	&wdt3_ick,	CK_242X),
	CLK(NULL,	"wdt3_fck",	&wdt3_fck,	CK_242X),
	CLK(NULL,	"mspro_ick",	&mspro_ick,	CK_243X | CK_242X),
	CLK(NULL,	"mspro_fck",	&mspro_fck,	CK_243X | CK_242X),
	CLK("mmci-omap.0", "ick",	&mmc_ick,	CK_242X),
	CLK("mmci-omap.0", "fck",	&mmc_fck,	CK_242X),
	CLK(NULL,	"fac_ick",	&fac_ick,	CK_243X | CK_242X),
	CLK(NULL,	"fac_fck",	&fac_fck,	CK_243X | CK_242X),
	CLK(NULL,	"eac_ick",	&eac_ick,	CK_242X),
	CLK(NULL,	"eac_fck",	&eac_fck,	CK_242X),
	CLK("omap_hdq.0", "ick",	&hdq_ick,	CK_243X | CK_242X),
	CLK("omap_hdq.1", "fck",	&hdq_fck,	CK_243X | CK_242X),
	CLK("i2c_omap.1", "ick",	&i2c1_ick,	CK_243X | CK_242X),
	CLK("i2c_omap.1", "fck",	&i2c1_fck,	CK_242X),
	CLK("i2c_omap.1", "fck",	&i2chs1_fck,	CK_243X),
	CLK("i2c_omap.2", "ick",	&i2c2_ick,	CK_243X | CK_242X),
	CLK("i2c_omap.2", "fck",	&i2c2_fck,	CK_242X),
	CLK("i2c_omap.2", "fck",	&i2chs2_fck,	CK_243X),
	CLK(NULL,	"gpmc_fck",	&gpmc_fck,	CK_243X | CK_242X),
	CLK(NULL,	"sdma_fck",	&sdma_fck,	CK_243X | CK_242X),
	CLK(NULL,	"sdma_ick",	&sdma_ick,	CK_243X | CK_242X),
	CLK(NULL,	"vlynq_ick",	&vlynq_ick,	CK_242X),
	CLK(NULL,	"vlynq_fck",	&vlynq_fck,	CK_242X),
	CLK(NULL,	"sdrc_ick",	&sdrc_ick,	CK_243X),
	CLK(NULL,	"des_ick",	&des_ick,	CK_243X | CK_242X),
	CLK(NULL,	"sha_ick",	&sha_ick,	CK_243X | CK_242X),
	CLK("omap_rng",	"ick",		&rng_ick,	CK_243X | CK_242X),
	CLK(NULL,	"aes_ick",	&aes_ick,	CK_243X | CK_242X),
	CLK(NULL,	"pka_ick",	&pka_ick,	CK_243X | CK_242X),
	CLK(NULL,	"usb_fck",	&usb_fck,	CK_243X | CK_242X),
	CLK("musb_hdrc",	"ick",	&usbhs_ick,	CK_243X),
	CLK("mmci-omap-hs.0", "ick",	&mmchs1_ick,	CK_243X),
	CLK("mmci-omap-hs.0", "fck",	&mmchs1_fck,	CK_243X),
	CLK("mmci-omap-hs.1", "ick",	&mmchs2_ick,	CK_243X),
	CLK("mmci-omap-hs.1", "fck",	&mmchs2_fck,	CK_243X),
	CLK(NULL,	"gpio5_ick",	&gpio5_ick,	CK_243X),
	CLK(NULL,	"gpio5_fck",	&gpio5_fck,	CK_243X),
	CLK(NULL,	"mdm_intc_ick",	&mdm_intc_ick,	CK_243X),
	CLK("mmci-omap-hs.0", "mmchsdb_fck",	&mmchsdb1_fck,	CK_243X),
	CLK("mmci-omap-hs.1", "mmchsdb_fck", 	&mmchsdb2_fck,	CK_243X),
};

/*
 * init code
 */

2197
int __init omap2xxx_clk_init(void)
2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222
{
	const struct prcm_config *prcm;
	struct omap_clk *c;
	u32 clkrate;
	u16 cpu_clkflg;

	if (cpu_is_omap242x()) {
		prcm_clksrc_ctrl = OMAP2420_PRCM_CLKSRC_CTRL;
		cpu_mask = RATE_IN_242X;
		cpu_clkflg = CK_242X;
		rate_table = omap2420_rate_table;
	} else if (cpu_is_omap2430()) {
		prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
		cpu_mask = RATE_IN_243X;
		cpu_clkflg = CK_243X;
		rate_table = omap2430_rate_table;
	}

	clk_init(&omap2_clk_functions);

	for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
		clk_preinit(c->lk.clk);

	osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
	propagate_rate(&osc_ck);
2223
	sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck);
2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264
	propagate_rate(&sys_ck);

	for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
		if (c->cpu & cpu_clkflg) {
			clkdev_add(&c->lk);
			clk_register(c->lk.clk);
			omap2_init_clk_clkdm(c->lk.clk);
		}

	/* Check the MPU rate set by bootloader */
	clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
	for (prcm = rate_table; prcm->mpu_speed; prcm++) {
		if (!(prcm->flags & cpu_mask))
			continue;
		if (prcm->xtal_speed != sys_ck.rate)
			continue;
		if (prcm->dpll_speed <= clkrate)
			break;
	}
	curr_prcm_set = prcm;

	recalculate_root_clocks();

	printk(KERN_INFO "Clocking rate (Crystal/DPLL/MPU): "
	       "%ld.%01ld/%ld/%ld MHz\n",
	       (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
	       (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;

	/*
	 * Only enable those clocks we will need, let the drivers
	 * enable other clocks as necessary
	 */
	clk_enable_init_clocks();

	/* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
	vclk = clk_get(NULL, "virt_prcm_set");
	sclk = clk_get(NULL, "sys_ck");
	dclk = clk_get(NULL, "dpll_ck");

	return 0;
}
2265