clock2xxx_data.c 69.2 KB
Newer Older
1
/*
2
 *  linux/arch/arm/mach-omap2/clock2xxx_data.c
3
 *
4 5
 *  Copyright (C) 2005-2009 Texas Instruments, Inc.
 *  Copyright (C) 2004-2009 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 18
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/clk.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		= 1024,
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 | CONFIG_PARTICIPANT,
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
	.recalc		= &omap2_clksel_recalc,
436
	.round_rate	= &omap2_clksel_round_rate,
437
	.set_rate	= &omap2_clksel_set_rate
438
};
439

440 441 442
/*
 * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain
 * Clocks:
443
 *	2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
444
 *	2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP
445 446 447 448 449
 *
 * 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.
450
 */
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468
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",
469
	.ops		= &clkops_omap2_dflt_wait,
470
	.parent		= &core_ck,
471
	.flags		= DELAYED_APP | CONFIG_PARTICIPANT,
472
	.clkdm_name	= "dsp_clkdm",
473 474 475 476 477
	.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,
478
	.recalc		= &omap2_clksel_recalc,
479 480
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
481 482
};

483 484 485 486 487 488 489 490 491 492 493
/* 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 }
494 495
};

496
/* This clock does not exist as such in the TRM. */
497 498
static struct clk dsp_irate_ick = {
	.name		= "dsp_irate_ick",
499
	.ops		= &clkops_null,
500
	.parent		= &dsp_fck,
501
	.flags		= DELAYED_APP | CONFIG_PARTICIPANT,
502 503 504
	.clksel_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP24XX_CLKSEL_DSP_IF_MASK,
	.clksel		= dsp_irate_ick_clksel,
505
	.recalc		= &omap2_clksel_recalc,
506 507
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	      = &omap2_clksel_set_rate
508 509
};

510
/* 2420 only */
511 512
static struct clk dsp_ick = {
	.name		= "dsp_ick",	 /* apparently ipi and isp */
513
	.ops		= &clkops_omap2_dflt_wait,
514
	.parent		= &dsp_irate_ick,
515
	.flags		= DELAYED_APP | CONFIG_PARTICIPANT,
516 517 518 519 520 521 522
	.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",
523
	.ops		= &clkops_omap2_dflt_wait,
524
	.parent		= &dsp_irate_ick,
525
	.flags		= DELAYED_APP | CONFIG_PARTICIPANT,
526 527
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
528 529
};

530 531 532 533 534
/*
 * 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.
 */
535 536
static struct clk iva1_ifck = {
	.name		= "iva1_ifck",
537
	.ops		= &clkops_omap2_dflt_wait,
538
	.parent		= &core_ck,
539
	.flags		= CONFIG_PARTICIPANT | DELAYED_APP,
540
	.clkdm_name	= "iva1_clkdm",
541 542 543 544 545
	.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,
546
	.recalc		= &omap2_clksel_recalc,
547 548
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
549 550 551 552 553
};

/* IVA1 mpu/int/i/f clocks are /2 of parent */
static struct clk iva1_mpu_int_ifck = {
	.name		= "iva1_mpu_int_ifck",
554
	.ops		= &clkops_omap2_dflt_wait,
555
	.parent		= &iva1_ifck,
556
	.clkdm_name	= "iva1_clkdm",
557 558 559
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2420_EN_IVA_MPU_SHIFT,
	.fixed_div	= 2,
560
	.recalc		= &omap_fixed_divisor_recalc,
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581
};

/*
 * 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.
 */
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597
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 }
};

598 599
static struct clk core_l3_ck = {	/* Used for ick and fck, interconnect */
	.name		= "core_l3_ck",
600
	.ops		= &clkops_null,
601
	.parent		= &core_ck,
602
	.flags		= DELAYED_APP | CONFIG_PARTICIPANT,
603
	.clkdm_name	= "core_l3_clkdm",
604 605 606
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_L3_MASK,
	.clksel		= core_l3_clksel,
607
	.recalc		= &omap2_clksel_recalc,
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

/* 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 },
623 624
};

625
/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
626 627
static struct clk usb_l4_ick = {	/* FS-USB interface clock */
	.name		= "usb_l4_ick",
628
	.ops		= &clkops_omap2_dflt_wait,
629
	.parent		= &core_l3_ck,
630
	.flags		= DELAYED_APP | CONFIG_PARTICIPANT,
631
	.clkdm_name	= "core_l4_clkdm",
632 633 634 635 636
	.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,
637
	.recalc		= &omap2_clksel_recalc,
638 639
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
640 641
};

642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661
/*
 * 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",
662
	.ops		= &clkops_null,
663
	.parent		= &core_l3_ck,
664
	.flags		= DELAYED_APP,
665 666 667 668 669 670 671 672 673
	.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
};

674 675 676 677
/*
 * 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.
678
 * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK
679 680 681
 *
 * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
 */
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697
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 }
};

698 699
static struct clk ssi_ssr_sst_fck = {
	.name		= "ssi_fck",
700
	.ops		= &clkops_omap2_dflt_wait,
701
	.parent		= &core_ck,
702
	.flags		= DELAYED_APP,
703
	.clkdm_name	= "core_l3_clkdm",
704 705 706 707 708
	.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,
709
	.recalc		= &omap2_clksel_recalc,
710 711
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
712 713
};

714 715 716 717 718 719 720 721 722 723 724 725 726 727
/*
 * 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,
};

728

729 730 731 732 733 734 735 736 737 738 739
/*
 * 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.
 *
 */
740 741 742 743 744 745 746 747
/* XXX REVISIT: GFX clock is part of CONFIG_PARTICIPANT, no? doublecheck. */

/* 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 },
};

748 749
static struct clk gfx_3d_fck = {
	.name		= "gfx_3d_fck",
750
	.ops		= &clkops_omap2_dflt_wait,
751
	.parent		= &core_l3_ck,
752
	.clkdm_name	= "gfx_clkdm",
753 754 755 756 757
	.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,
758
	.recalc		= &omap2_clksel_recalc,
759 760
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
761 762 763 764
};

static struct clk gfx_2d_fck = {
	.name		= "gfx_2d_fck",
765
	.ops		= &clkops_omap2_dflt_wait,
766
	.parent		= &core_l3_ck,
767
	.clkdm_name	= "gfx_clkdm",
768 769 770 771 772
	.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,
773
	.recalc		= &omap2_clksel_recalc,
774 775
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
776 777 778 779
};

static struct clk gfx_ick = {
	.name		= "gfx_ick",		/* From l3 */
780
	.ops		= &clkops_omap2_dflt_wait,
781
	.parent		= &core_l3_ck,
782
	.clkdm_name	= "gfx_clkdm",
783 784 785
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
	.enable_bit	= OMAP_EN_GFX_SHIFT,
	.recalc		= &followparent_recalc,
786 787 788 789 790 791 792
};

/*
 * Modem clock domain (2430)
 *	CLOCKS:
 *		MDM_OSC_CLK
 *		MDM_ICLK
793
 * These clocks are usable in chassis mode only.
794
 */
795 796 797 798 799 800 801 802 803 804 805 806 807
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 }
};

808 809
static struct clk mdm_ick = {		/* used both as a ick and fck */
	.name		= "mdm_ick",
810
	.ops		= &clkops_omap2_dflt_wait,
811
	.parent		= &core_ck,
812
	.flags		= DELAYED_APP | CONFIG_PARTICIPANT,
813
	.clkdm_name	= "mdm_clkdm",
814 815 816 817 818
	.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,
819
	.recalc		= &omap2_clksel_recalc,
820 821
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
822 823 824 825
};

static struct clk mdm_osc_ck = {
	.name		= "mdm_osc_ck",
826
	.ops		= &clkops_omap2_dflt_wait,
827
	.parent		= &osc_ck,
828
	.clkdm_name	= "mdm_clkdm",
829 830 831
	.enable_reg	= OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2430_EN_OSC_SHIFT,
	.recalc		= &followparent_recalc,
832 833 834 835 836 837 838 839 840 841
};

/*
 * DSS clock domain
 * CLOCKs:
 * DSS_L4_ICLK, DSS_L3_ICLK,
 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
 *
 * DSS is both initiator and target.
 */
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868
/* 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 },
};

869 870
static struct clk dss_ick = {		/* Enables both L3,L4 ICLK's */
	.name		= "dss_ick",
871
	.ops		= &clkops_omap2_dflt,
872
	.parent		= &l4_ck,	/* really both l3 and l4 */
873
	.clkdm_name	= "dss_clkdm",
874 875 876
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_DSS1_SHIFT,
	.recalc		= &followparent_recalc,
877 878 879 880
};

static struct clk dss1_fck = {
	.name		= "dss1_fck",
881
	.ops		= &clkops_omap2_dflt,
882
	.parent		= &core_ck,		/* Core or sys */
883
	.flags		= DELAYED_APP,
884
	.clkdm_name	= "dss_clkdm",
885 886 887 888 889 890
	.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,
891
	.recalc		= &omap2_clksel_recalc,
892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909
	.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 }
910 911 912 913
};

static struct clk dss2_fck = {		/* Alt clk used in power management */
	.name		= "dss2_fck",
914
	.ops		= &clkops_omap2_dflt,
915
	.parent		= &sys_ck,		/* fixed at sys_ck or 48MHz */
916
	.flags		= DELAYED_APP,
917
	.clkdm_name	= "dss_clkdm",
918 919 920 921 922 923 924
	.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,
925 926 927 928
};

static struct clk dss_54m_fck = {	/* Alt clk used in power management */
	.name		= "dss_54m_fck",	/* 54m tv clk */
929
	.ops		= &clkops_omap2_dflt_wait,
930
	.parent		= &func_54m_ck,
931
	.clkdm_name	= "dss_clkdm",
932 933 934
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_TV_SHIFT,
	.recalc		= &followparent_recalc,
935 936 937 938 939 940 941 942
};

/*
 * 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.
 */
943 944 945 946 947 948 949 950 951 952 953 954
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 },
};

955 956
static struct clk gpt1_ick = {
	.name		= "gpt1_ick",
957
	.ops		= &clkops_omap2_dflt_wait,
958
	.parent		= &l4_ck,
959
	.clkdm_name	= "core_l4_clkdm",
960 961 962
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_GPT1_SHIFT,
	.recalc		= &followparent_recalc,
963 964 965 966
};

static struct clk gpt1_fck = {
	.name		= "gpt1_fck",
967
	.ops		= &clkops_omap2_dflt_wait,
968
	.parent		= &func_32k_ck,
969
	.clkdm_name	= "core_l4_clkdm",
970 971 972 973 974 975 976 977 978
	.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
979 980 981 982
};

static struct clk gpt2_ick = {
	.name		= "gpt2_ick",
983
	.ops		= &clkops_omap2_dflt_wait,
984
	.parent		= &l4_ck,
985
	.clkdm_name	= "core_l4_clkdm",
986 987 988
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT2_SHIFT,
	.recalc		= &followparent_recalc,
989 990 991 992
};

static struct clk gpt2_fck = {
	.name		= "gpt2_fck",
993
	.ops		= &clkops_omap2_dflt_wait,
994
	.parent		= &func_32k_ck,
995
	.clkdm_name	= "core_l4_clkdm",
996 997 998 999 1000 1001 1002
	.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,
1003 1004 1005 1006
};

static struct clk gpt3_ick = {
	.name		= "gpt3_ick",
1007
	.ops		= &clkops_omap2_dflt_wait,
1008
	.parent		= &l4_ck,
1009
	.clkdm_name	= "core_l4_clkdm",
1010 1011 1012
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT3_SHIFT,
	.recalc		= &followparent_recalc,
1013 1014 1015 1016
};

static struct clk gpt3_fck = {
	.name		= "gpt3_fck",
1017
	.ops		= &clkops_omap2_dflt_wait,
1018
	.parent		= &func_32k_ck,
1019
	.clkdm_name	= "core_l4_clkdm",
1020 1021 1022 1023 1024 1025 1026
	.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,
1027 1028 1029 1030
};

static struct clk gpt4_ick = {
	.name		= "gpt4_ick",
1031
	.ops		= &clkops_omap2_dflt_wait,
1032
	.parent		= &l4_ck,
1033
	.clkdm_name	= "core_l4_clkdm",
1034 1035 1036
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT4_SHIFT,
	.recalc		= &followparent_recalc,
1037 1038 1039 1040
};

static struct clk gpt4_fck = {
	.name		= "gpt4_fck",
1041
	.ops		= &clkops_omap2_dflt_wait,
1042
	.parent		= &func_32k_ck,
1043
	.clkdm_name	= "core_l4_clkdm",
1044 1045 1046 1047 1048 1049 1050
	.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,
1051 1052 1053 1054
};

static struct clk gpt5_ick = {
	.name		= "gpt5_ick",
1055
	.ops		= &clkops_omap2_dflt_wait,
1056
	.parent		= &l4_ck,
1057
	.clkdm_name	= "core_l4_clkdm",
1058 1059 1060
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT5_SHIFT,
	.recalc		= &followparent_recalc,
1061 1062 1063 1064
};

static struct clk gpt5_fck = {
	.name		= "gpt5_fck",
1065
	.ops		= &clkops_omap2_dflt_wait,
1066
	.parent		= &func_32k_ck,
1067
	.clkdm_name	= "core_l4_clkdm",
1068 1069 1070 1071 1072 1073 1074
	.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,
1075 1076 1077 1078
};

static struct clk gpt6_ick = {
	.name		= "gpt6_ick",
1079
	.ops		= &clkops_omap2_dflt_wait,
1080
	.parent		= &l4_ck,
1081
	.clkdm_name	= "core_l4_clkdm",
1082 1083 1084
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT6_SHIFT,
	.recalc		= &followparent_recalc,
1085 1086 1087 1088
};

static struct clk gpt6_fck = {
	.name		= "gpt6_fck",
1089
	.ops		= &clkops_omap2_dflt_wait,
1090
	.parent		= &func_32k_ck,
1091
	.clkdm_name	= "core_l4_clkdm",
1092 1093 1094 1095 1096 1097 1098
	.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,
1099 1100 1101 1102
};

static struct clk gpt7_ick = {
	.name		= "gpt7_ick",
1103
	.ops		= &clkops_omap2_dflt_wait,
1104
	.parent		= &l4_ck,
1105 1106 1107
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT7_SHIFT,
	.recalc		= &followparent_recalc,
1108 1109 1110 1111
};

static struct clk gpt7_fck = {
	.name		= "gpt7_fck",
1112
	.ops		= &clkops_omap2_dflt_wait,
1113
	.parent		= &func_32k_ck,
1114
	.clkdm_name	= "core_l4_clkdm",
1115 1116 1117 1118 1119 1120 1121
	.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,
1122 1123 1124 1125
};

static struct clk gpt8_ick = {
	.name		= "gpt8_ick",
1126
	.ops		= &clkops_omap2_dflt_wait,
1127
	.parent		= &l4_ck,
1128
	.clkdm_name	= "core_l4_clkdm",
1129 1130 1131
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT8_SHIFT,
	.recalc		= &followparent_recalc,
1132 1133 1134 1135
};

static struct clk gpt8_fck = {
	.name		= "gpt8_fck",
1136
	.ops		= &clkops_omap2_dflt_wait,
1137
	.parent		= &func_32k_ck,
1138
	.clkdm_name	= "core_l4_clkdm",
1139 1140 1141 1142 1143 1144 1145
	.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,
1146 1147 1148 1149
};

static struct clk gpt9_ick = {
	.name		= "gpt9_ick",
1150
	.ops		= &clkops_omap2_dflt_wait,
1151
	.parent		= &l4_ck,
1152
	.clkdm_name	= "core_l4_clkdm",
1153 1154 1155
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT9_SHIFT,
	.recalc		= &followparent_recalc,
1156 1157 1158 1159
};

static struct clk gpt9_fck = {
	.name		= "gpt9_fck",
1160
	.ops		= &clkops_omap2_dflt_wait,
1161
	.parent		= &func_32k_ck,
1162
	.clkdm_name	= "core_l4_clkdm",
1163 1164 1165 1166 1167 1168 1169
	.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,
1170 1171 1172 1173
};

static struct clk gpt10_ick = {
	.name		= "gpt10_ick",
1174
	.ops		= &clkops_omap2_dflt_wait,
1175
	.parent		= &l4_ck,
1176
	.clkdm_name	= "core_l4_clkdm",
1177 1178 1179
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT10_SHIFT,
	.recalc		= &followparent_recalc,
1180 1181 1182 1183
};

static struct clk gpt10_fck = {
	.name		= "gpt10_fck",
1184
	.ops		= &clkops_omap2_dflt_wait,
1185
	.parent		= &func_32k_ck,
1186
	.clkdm_name	= "core_l4_clkdm",
1187 1188 1189 1190 1191 1192 1193
	.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,
1194 1195 1196 1197
};

static struct clk gpt11_ick = {
	.name		= "gpt11_ick",
1198
	.ops		= &clkops_omap2_dflt_wait,
1199
	.parent		= &l4_ck,
1200
	.clkdm_name	= "core_l4_clkdm",
1201 1202 1203
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT11_SHIFT,
	.recalc		= &followparent_recalc,
1204 1205 1206 1207
};

static struct clk gpt11_fck = {
	.name		= "gpt11_fck",
1208
	.ops		= &clkops_omap2_dflt_wait,
1209
	.parent		= &func_32k_ck,
1210
	.clkdm_name	= "core_l4_clkdm",
1211 1212 1213 1214 1215 1216 1217
	.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,
1218 1219 1220 1221
};

static struct clk gpt12_ick = {
	.name		= "gpt12_ick",
1222
	.ops		= &clkops_omap2_dflt_wait,
1223
	.parent		= &l4_ck,
1224
	.clkdm_name	= "core_l4_clkdm",
1225 1226 1227
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT12_SHIFT,
	.recalc		= &followparent_recalc,
1228 1229 1230 1231
};

static struct clk gpt12_fck = {
	.name		= "gpt12_fck",
1232
	.ops		= &clkops_omap2_dflt_wait,
1233
	.parent		= &secure_32k_ck,
1234
	.clkdm_name	= "core_l4_clkdm",
1235 1236 1237 1238 1239 1240 1241
	.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,
1242 1243 1244
};

static struct clk mcbsp1_ick = {
1245
	.name		= "mcbsp_ick",
1246
	.ops		= &clkops_omap2_dflt_wait,
1247
	.id		= 1,
1248
	.parent		= &l4_ck,
1249
	.clkdm_name	= "core_l4_clkdm",
1250 1251 1252
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP1_SHIFT,
	.recalc		= &followparent_recalc,
1253 1254 1255
};

static struct clk mcbsp1_fck = {
1256
	.name		= "mcbsp_fck",
1257
	.ops		= &clkops_omap2_dflt_wait,
1258
	.id		= 1,
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_MCBSP1_SHIFT,
	.recalc		= &followparent_recalc,
1264 1265 1266
};

static struct clk mcbsp2_ick = {
1267
	.name		= "mcbsp_ick",
1268
	.ops		= &clkops_omap2_dflt_wait,
1269
	.id		= 2,
1270
	.parent		= &l4_ck,
1271
	.clkdm_name	= "core_l4_clkdm",
1272 1273 1274
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
	.recalc		= &followparent_recalc,
1275 1276 1277
};

static struct clk mcbsp2_fck = {
1278
	.name		= "mcbsp_fck",
1279
	.ops		= &clkops_omap2_dflt_wait,
1280
	.id		= 2,
1281
	.parent		= &func_96m_ck,
1282
	.clkdm_name	= "core_l4_clkdm",
1283 1284 1285
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
	.recalc		= &followparent_recalc,
1286 1287 1288
};

static struct clk mcbsp3_ick = {
1289
	.name		= "mcbsp_ick",
1290
	.ops		= &clkops_omap2_dflt_wait,
1291
	.id		= 3,
1292
	.parent		= &l4_ck,
1293
	.clkdm_name	= "core_l4_clkdm",
1294 1295 1296
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP3_SHIFT,
	.recalc		= &followparent_recalc,
1297 1298 1299
};

static struct clk mcbsp3_fck = {
1300
	.name		= "mcbsp_fck",
1301
	.ops		= &clkops_omap2_dflt_wait,
1302
	.id		= 3,
1303
	.parent		= &func_96m_ck,
1304
	.clkdm_name	= "core_l4_clkdm",
1305 1306 1307
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP3_SHIFT,
	.recalc		= &followparent_recalc,
1308 1309 1310
};

static struct clk mcbsp4_ick = {
1311
	.name		= "mcbsp_ick",
1312
	.ops		= &clkops_omap2_dflt_wait,
1313
	.id		= 4,
1314
	.parent		= &l4_ck,
1315
	.clkdm_name	= "core_l4_clkdm",
1316 1317 1318
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP4_SHIFT,
	.recalc		= &followparent_recalc,
1319 1320 1321
};

static struct clk mcbsp4_fck = {
1322
	.name		= "mcbsp_fck",
1323
	.ops		= &clkops_omap2_dflt_wait,
1324
	.id		= 4,
1325
	.parent		= &func_96m_ck,
1326
	.clkdm_name	= "core_l4_clkdm",
1327 1328 1329
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP4_SHIFT,
	.recalc		= &followparent_recalc,
1330 1331 1332
};

static struct clk mcbsp5_ick = {
1333
	.name		= "mcbsp_ick",
1334
	.ops		= &clkops_omap2_dflt_wait,
1335
	.id		= 5,
1336
	.parent		= &l4_ck,
1337
	.clkdm_name	= "core_l4_clkdm",
1338 1339 1340
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP5_SHIFT,
	.recalc		= &followparent_recalc,
1341 1342 1343
};

static struct clk mcbsp5_fck = {
1344
	.name		= "mcbsp_fck",
1345
	.ops		= &clkops_omap2_dflt_wait,
1346
	.id		= 5,
1347
	.parent		= &func_96m_ck,
1348
	.clkdm_name	= "core_l4_clkdm",
1349 1350 1351
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP5_SHIFT,
	.recalc		= &followparent_recalc,
1352 1353 1354
};

static struct clk mcspi1_ick = {
1355
	.name		= "mcspi_ick",
1356
	.ops		= &clkops_omap2_dflt_wait,
1357
	.id		= 1,
1358
	.parent		= &l4_ck,
1359
	.clkdm_name	= "core_l4_clkdm",
1360 1361 1362
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI1_SHIFT,
	.recalc		= &followparent_recalc,
1363 1364 1365
};

static struct clk mcspi1_fck = {
1366
	.name		= "mcspi_fck",
1367
	.ops		= &clkops_omap2_dflt_wait,
1368
	.id		= 1,
1369
	.parent		= &func_48m_ck,
1370
	.clkdm_name	= "core_l4_clkdm",
1371 1372 1373
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI1_SHIFT,
	.recalc		= &followparent_recalc,
1374 1375 1376
};

static struct clk mcspi2_ick = {
1377
	.name		= "mcspi_ick",
1378
	.ops		= &clkops_omap2_dflt_wait,
1379
	.id		= 2,
1380
	.parent		= &l4_ck,
1381
	.clkdm_name	= "core_l4_clkdm",
1382 1383 1384
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI2_SHIFT,
	.recalc		= &followparent_recalc,
1385 1386 1387
};

static struct clk mcspi2_fck = {
1388
	.name		= "mcspi_fck",
1389
	.ops		= &clkops_omap2_dflt_wait,
1390
	.id		= 2,
1391
	.parent		= &func_48m_ck,
1392
	.clkdm_name	= "core_l4_clkdm",
1393 1394 1395
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI2_SHIFT,
	.recalc		= &followparent_recalc,
1396 1397 1398
};

static struct clk mcspi3_ick = {
1399
	.name		= "mcspi_ick",
1400
	.ops		= &clkops_omap2_dflt_wait,
1401
	.id		= 3,
1402
	.parent		= &l4_ck,
1403
	.clkdm_name	= "core_l4_clkdm",
1404 1405 1406
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCSPI3_SHIFT,
	.recalc		= &followparent_recalc,
1407 1408 1409
};

static struct clk mcspi3_fck = {
1410
	.name		= "mcspi_fck",
1411
	.ops		= &clkops_omap2_dflt_wait,
1412
	.id		= 3,
1413
	.parent		= &func_48m_ck,
1414
	.clkdm_name	= "core_l4_clkdm",
1415 1416 1417
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCSPI3_SHIFT,
	.recalc		= &followparent_recalc,
1418 1419 1420 1421
};

static struct clk uart1_ick = {
	.name		= "uart1_ick",
1422
	.ops		= &clkops_omap2_dflt_wait,
1423
	.parent		= &l4_ck,
1424
	.clkdm_name	= "core_l4_clkdm",
1425 1426 1427
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_UART1_SHIFT,
	.recalc		= &followparent_recalc,
1428 1429 1430 1431
};

static struct clk uart1_fck = {
	.name		= "uart1_fck",
1432
	.ops		= &clkops_omap2_dflt_wait,
1433
	.parent		= &func_48m_ck,
1434
	.clkdm_name	= "core_l4_clkdm",
1435 1436 1437
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_UART1_SHIFT,
	.recalc		= &followparent_recalc,
1438 1439 1440 1441
};

static struct clk uart2_ick = {
	.name		= "uart2_ick",
1442
	.ops		= &clkops_omap2_dflt_wait,
1443
	.parent		= &l4_ck,
1444
	.clkdm_name	= "core_l4_clkdm",
1445 1446 1447
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_UART2_SHIFT,
	.recalc		= &followparent_recalc,
1448 1449 1450 1451
};

static struct clk uart2_fck = {
	.name		= "uart2_fck",
1452
	.ops		= &clkops_omap2_dflt_wait,
1453
	.parent		= &func_48m_ck,
1454
	.clkdm_name	= "core_l4_clkdm",
1455 1456 1457
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_UART2_SHIFT,
	.recalc		= &followparent_recalc,
1458 1459 1460 1461
};

static struct clk uart3_ick = {
	.name		= "uart3_ick",
1462
	.ops		= &clkops_omap2_dflt_wait,
1463
	.parent		= &l4_ck,
1464
	.clkdm_name	= "core_l4_clkdm",
1465 1466 1467
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP24XX_EN_UART3_SHIFT,
	.recalc		= &followparent_recalc,
1468 1469 1470 1471
};

static struct clk uart3_fck = {
	.name		= "uart3_fck",
1472
	.ops		= &clkops_omap2_dflt_wait,
1473
	.parent		= &func_48m_ck,
1474
	.clkdm_name	= "core_l4_clkdm",
1475 1476 1477
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_UART3_SHIFT,
	.recalc		= &followparent_recalc,
1478 1479 1480 1481
};

static struct clk gpios_ick = {
	.name		= "gpios_ick",
1482
	.ops		= &clkops_omap2_dflt_wait,
1483
	.parent		= &l4_ck,
1484
	.clkdm_name	= "core_l4_clkdm",
1485 1486 1487
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_GPIOS_SHIFT,
	.recalc		= &followparent_recalc,
1488 1489 1490 1491
};

static struct clk gpios_fck = {
	.name		= "gpios_fck",
1492
	.ops		= &clkops_omap2_dflt_wait,
1493
	.parent		= &func_32k_ck,
1494
	.clkdm_name	= "wkup_clkdm",
1495 1496 1497
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_GPIOS_SHIFT,
	.recalc		= &followparent_recalc,
1498 1499 1500 1501
};

static struct clk mpu_wdt_ick = {
	.name		= "mpu_wdt_ick",
1502
	.ops		= &clkops_omap2_dflt_wait,
1503
	.parent		= &l4_ck,
1504
	.clkdm_name	= "core_l4_clkdm",
1505 1506 1507
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_MPU_WDT_SHIFT,
	.recalc		= &followparent_recalc,
1508 1509 1510 1511
};

static struct clk mpu_wdt_fck = {
	.name		= "mpu_wdt_fck",
1512
	.ops		= &clkops_omap2_dflt_wait,
1513
	.parent		= &func_32k_ck,
1514
	.clkdm_name	= "wkup_clkdm",
1515 1516 1517
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_MPU_WDT_SHIFT,
	.recalc		= &followparent_recalc,
1518 1519 1520 1521
};

static struct clk sync_32k_ick = {
	.name		= "sync_32k_ick",
1522
	.ops		= &clkops_omap2_dflt_wait,
1523
	.parent		= &l4_ck,
1524
	.flags		= ENABLE_ON_INIT,
1525
	.clkdm_name	= "core_l4_clkdm",
1526 1527 1528
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_32KSYNC_SHIFT,
	.recalc		= &followparent_recalc,
1529
};
1530

1531 1532
static struct clk wdt1_ick = {
	.name		= "wdt1_ick",
1533
	.ops		= &clkops_omap2_dflt_wait,
1534
	.parent		= &l4_ck,
1535
	.clkdm_name	= "core_l4_clkdm",
1536 1537 1538
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_WDT1_SHIFT,
	.recalc		= &followparent_recalc,
1539
};
1540

1541 1542
static struct clk omapctrl_ick = {
	.name		= "omapctrl_ick",
1543
	.ops		= &clkops_omap2_dflt_wait,
1544
	.parent		= &l4_ck,
1545
	.flags		= ENABLE_ON_INIT,
1546
	.clkdm_name	= "core_l4_clkdm",
1547 1548 1549
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_OMAPCTRL_SHIFT,
	.recalc		= &followparent_recalc,
1550
};
1551

1552 1553
static struct clk icr_ick = {
	.name		= "icr_ick",
1554
	.ops		= &clkops_omap2_dflt_wait,
1555
	.parent		= &l4_ck,
1556
	.clkdm_name	= "core_l4_clkdm",
1557 1558 1559
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP2430_EN_ICR_SHIFT,
	.recalc		= &followparent_recalc,
1560 1561 1562 1563
};

static struct clk cam_ick = {
	.name		= "cam_ick",
1564
	.ops		= &clkops_omap2_dflt,
1565
	.parent		= &l4_ck,
1566
	.clkdm_name	= "core_l4_clkdm",
1567 1568 1569
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_CAM_SHIFT,
	.recalc		= &followparent_recalc,
1570 1571
};

1572 1573 1574 1575 1576
/*
 * 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.
 */
1577 1578
static struct clk cam_fck = {
	.name		= "cam_fck",
1579
	.ops		= &clkops_omap2_dflt,
1580
	.parent		= &func_96m_ck,
1581
	.clkdm_name	= "core_l3_clkdm",
1582 1583 1584
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_CAM_SHIFT,
	.recalc		= &followparent_recalc,
1585 1586 1587 1588
};

static struct clk mailboxes_ick = {
	.name		= "mailboxes_ick",
1589
	.ops		= &clkops_omap2_dflt_wait,
1590
	.parent		= &l4_ck,
1591
	.clkdm_name	= "core_l4_clkdm",
1592 1593 1594
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MAILBOXES_SHIFT,
	.recalc		= &followparent_recalc,
1595 1596 1597 1598
};

static struct clk wdt4_ick = {
	.name		= "wdt4_ick",
1599
	.ops		= &clkops_omap2_dflt_wait,
1600
	.parent		= &l4_ck,
1601
	.clkdm_name	= "core_l4_clkdm",
1602 1603 1604
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_WDT4_SHIFT,
	.recalc		= &followparent_recalc,
1605 1606 1607 1608
};

static struct clk wdt4_fck = {
	.name		= "wdt4_fck",
1609
	.ops		= &clkops_omap2_dflt_wait,
1610
	.parent		= &func_32k_ck,
1611
	.clkdm_name	= "core_l4_clkdm",
1612 1613 1614
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_WDT4_SHIFT,
	.recalc		= &followparent_recalc,
1615 1616 1617 1618
};

static struct clk wdt3_ick = {
	.name		= "wdt3_ick",
1619
	.ops		= &clkops_omap2_dflt_wait,
1620
	.parent		= &l4_ck,
1621
	.clkdm_name	= "core_l4_clkdm",
1622 1623 1624
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_WDT3_SHIFT,
	.recalc		= &followparent_recalc,
1625 1626 1627 1628
};

static struct clk wdt3_fck = {
	.name		= "wdt3_fck",
1629
	.ops		= &clkops_omap2_dflt_wait,
1630
	.parent		= &func_32k_ck,
1631
	.clkdm_name	= "core_l4_clkdm",
1632 1633 1634
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_WDT3_SHIFT,
	.recalc		= &followparent_recalc,
1635 1636 1637 1638
};

static struct clk mspro_ick = {
	.name		= "mspro_ick",
1639
	.ops		= &clkops_omap2_dflt_wait,
1640
	.parent		= &l4_ck,
1641
	.clkdm_name	= "core_l4_clkdm",
1642 1643 1644
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MSPRO_SHIFT,
	.recalc		= &followparent_recalc,
1645 1646 1647 1648
};

static struct clk mspro_fck = {
	.name		= "mspro_fck",
1649
	.ops		= &clkops_omap2_dflt_wait,
1650
	.parent		= &func_96m_ck,
1651
	.clkdm_name	= "core_l4_clkdm",
1652 1653 1654
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MSPRO_SHIFT,
	.recalc		= &followparent_recalc,
1655 1656 1657 1658
};

static struct clk mmc_ick = {
	.name		= "mmc_ick",
1659
	.ops		= &clkops_omap2_dflt_wait,
1660
	.parent		= &l4_ck,
1661
	.clkdm_name	= "core_l4_clkdm",
1662 1663 1664
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_MMC_SHIFT,
	.recalc		= &followparent_recalc,
1665 1666 1667 1668
};

static struct clk mmc_fck = {
	.name		= "mmc_fck",
1669
	.ops		= &clkops_omap2_dflt_wait,
1670
	.parent		= &func_96m_ck,
1671
	.clkdm_name	= "core_l4_clkdm",
1672 1673 1674
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_MMC_SHIFT,
	.recalc		= &followparent_recalc,
1675 1676 1677 1678
};

static struct clk fac_ick = {
	.name		= "fac_ick",
1679
	.ops		= &clkops_omap2_dflt_wait,
1680
	.parent		= &l4_ck,
1681
	.clkdm_name	= "core_l4_clkdm",
1682 1683 1684
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_FAC_SHIFT,
	.recalc		= &followparent_recalc,
1685 1686 1687 1688
};

static struct clk fac_fck = {
	.name		= "fac_fck",
1689
	.ops		= &clkops_omap2_dflt_wait,
1690
	.parent		= &func_12m_ck,
1691
	.clkdm_name	= "core_l4_clkdm",
1692 1693 1694
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_FAC_SHIFT,
	.recalc		= &followparent_recalc,
1695 1696 1697 1698
};

static struct clk eac_ick = {
	.name		= "eac_ick",
1699
	.ops		= &clkops_omap2_dflt_wait,
1700
	.parent		= &l4_ck,
1701
	.clkdm_name	= "core_l4_clkdm",
1702 1703 1704
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_EAC_SHIFT,
	.recalc		= &followparent_recalc,
1705 1706 1707 1708
};

static struct clk eac_fck = {
	.name		= "eac_fck",
1709
	.ops		= &clkops_omap2_dflt_wait,
1710
	.parent		= &func_96m_ck,
1711
	.clkdm_name	= "core_l4_clkdm",
1712 1713 1714
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_EAC_SHIFT,
	.recalc		= &followparent_recalc,
1715 1716 1717 1718
};

static struct clk hdq_ick = {
	.name		= "hdq_ick",
1719
	.ops		= &clkops_omap2_dflt_wait,
1720
	.parent		= &l4_ck,
1721
	.clkdm_name	= "core_l4_clkdm",
1722 1723 1724
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
1725 1726 1727 1728
};

static struct clk hdq_fck = {
	.name		= "hdq_fck",
1729
	.ops		= &clkops_omap2_dflt_wait,
1730
	.parent		= &func_12m_ck,
1731
	.clkdm_name	= "core_l4_clkdm",
1732 1733 1734
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
1735 1736 1737
};

static struct clk i2c2_ick = {
1738
	.name		= "i2c_ick",
1739
	.ops		= &clkops_omap2_dflt_wait,
1740
	.id		= 2,
1741
	.parent		= &l4_ck,
1742
	.clkdm_name	= "core_l4_clkdm",
1743 1744 1745
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_I2C2_SHIFT,
	.recalc		= &followparent_recalc,
1746 1747 1748
};

static struct clk i2c2_fck = {
1749
	.name		= "i2c_fck",
1750
	.ops		= &clkops_omap2_dflt_wait,
1751
	.id		= 2,
1752
	.parent		= &func_12m_ck,
1753
	.clkdm_name	= "core_l4_clkdm",
1754 1755 1756
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_I2C2_SHIFT,
	.recalc		= &followparent_recalc,
1757 1758 1759
};

static struct clk i2chs2_fck = {
1760
	.name		= "i2c_fck",
1761
	.ops		= &clkops_omap2430_i2chs_wait,
1762
	.id		= 2,
1763
	.parent		= &func_96m_ck,
1764
	.clkdm_name	= "core_l4_clkdm",
1765 1766 1767
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_I2CHS2_SHIFT,
	.recalc		= &followparent_recalc,
1768 1769 1770
};

static struct clk i2c1_ick = {
1771
	.name		= "i2c_ick",
1772
	.ops		= &clkops_omap2_dflt_wait,
1773
	.id		= 1,
1774
	.parent		= &l4_ck,
1775
	.clkdm_name	= "core_l4_clkdm",
1776 1777 1778
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_I2C1_SHIFT,
	.recalc		= &followparent_recalc,
1779 1780 1781
};

static struct clk i2c1_fck = {
1782
	.name		= "i2c_fck",
1783
	.ops		= &clkops_omap2_dflt_wait,
1784
	.id		= 1,
1785
	.parent		= &func_12m_ck,
1786
	.clkdm_name	= "core_l4_clkdm",
1787 1788 1789
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_I2C1_SHIFT,
	.recalc		= &followparent_recalc,
1790 1791 1792
};

static struct clk i2chs1_fck = {
1793
	.name		= "i2c_fck",
1794
	.ops		= &clkops_omap2430_i2chs_wait,
1795
	.id		= 1,
1796
	.parent		= &func_96m_ck,
1797
	.clkdm_name	= "core_l4_clkdm",
1798 1799 1800 1801 1802 1803 1804
	.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",
1805
	.ops		= &clkops_null, /* RMK: missing? */
1806
	.parent		= &core_l3_ck,
1807
	.flags		= ENABLE_ON_INIT,
1808
	.clkdm_name	= "core_l3_clkdm",
1809 1810 1811 1812 1813
	.recalc		= &followparent_recalc,
};

static struct clk sdma_fck = {
	.name		= "sdma_fck",
1814
	.ops		= &clkops_null, /* RMK: missing? */
1815
	.parent		= &core_l3_ck,
1816
	.clkdm_name	= "core_l3_clkdm",
1817 1818 1819 1820 1821
	.recalc		= &followparent_recalc,
};

static struct clk sdma_ick = {
	.name		= "sdma_ick",
1822
	.ops		= &clkops_null, /* RMK: missing? */
1823
	.parent		= &l4_ck,
1824
	.clkdm_name	= "core_l3_clkdm",
1825
	.recalc		= &followparent_recalc,
1826 1827 1828 1829
};

static struct clk vlynq_ick = {
	.name		= "vlynq_ick",
1830
	.ops		= &clkops_omap2_dflt_wait,
1831
	.parent		= &core_l3_ck,
1832
	.clkdm_name	= "core_l3_clkdm",
1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860
	.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 }
1861 1862 1863 1864
};

static struct clk vlynq_fck = {
	.name		= "vlynq_fck",
1865
	.ops		= &clkops_omap2_dflt_wait,
1866
	.parent		= &func_96m_ck,
1867
	.flags		= DELAYED_APP,
1868
	.clkdm_name	= "core_l3_clkdm",
1869 1870 1871 1872 1873 1874 1875 1876 1877
	.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
1878 1879 1880 1881
};

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

static struct clk des_ick = {
	.name		= "des_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_DES_SHIFT,
	.recalc		= &followparent_recalc,
1899 1900 1901 1902
};

static struct clk sha_ick = {
	.name		= "sha_ick",
1903
	.ops		= &clkops_omap2_dflt_wait,
1904
	.parent		= &l4_ck,
1905
	.clkdm_name	= "core_l4_clkdm",
1906 1907 1908
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_SHA_SHIFT,
	.recalc		= &followparent_recalc,
1909 1910 1911 1912
};

static struct clk rng_ick = {
	.name		= "rng_ick",
1913
	.ops		= &clkops_omap2_dflt_wait,
1914
	.parent		= &l4_ck,
1915
	.clkdm_name	= "core_l4_clkdm",
1916 1917 1918
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_RNG_SHIFT,
	.recalc		= &followparent_recalc,
1919 1920 1921 1922
};

static struct clk aes_ick = {
	.name		= "aes_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, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_AES_SHIFT,
	.recalc		= &followparent_recalc,
1929 1930 1931 1932
};

static struct clk pka_ick = {
	.name		= "pka_ick",
1933
	.ops		= &clkops_omap2_dflt_wait,
1934
	.parent		= &l4_ck,
1935
	.clkdm_name	= "core_l4_clkdm",
1936 1937 1938
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_PKA_SHIFT,
	.recalc		= &followparent_recalc,
1939 1940 1941 1942
};

static struct clk usb_fck = {
	.name		= "usb_fck",
1943
	.ops		= &clkops_omap2_dflt_wait,
1944
	.parent		= &func_48m_ck,
1945
	.clkdm_name	= "core_l3_clkdm",
1946 1947 1948
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_USB_SHIFT,
	.recalc		= &followparent_recalc,
1949 1950 1951 1952
};

static struct clk usbhs_ick = {
	.name		= "usbhs_ick",
1953
	.ops		= &clkops_omap2_dflt_wait,
1954
	.parent		= &core_l3_ck,
1955
	.clkdm_name	= "core_l3_clkdm",
1956 1957 1958
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_USBHS_SHIFT,
	.recalc		= &followparent_recalc,
1959 1960 1961
};

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

static struct clk mmchs1_fck = {
1972
	.name		= "mmchs_fck",
1973
	.ops		= &clkops_omap2_dflt_wait,
1974
	.parent		= &func_96m_ck,
1975
	.clkdm_name	= "core_l3_clkdm",
1976 1977 1978
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS1_SHIFT,
	.recalc		= &followparent_recalc,
1979 1980 1981
};

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

static struct clk mmchs2_fck = {
1993
	.name		= "mmchs_fck",
1994
	.ops		= &clkops_omap2_dflt_wait,
1995
	.id		= 1,
1996
	.parent		= &func_96m_ck,
1997 1998 1999
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS2_SHIFT,
	.recalc		= &followparent_recalc,
2000 2001 2002 2003
};

static struct clk gpio5_ick = {
	.name		= "gpio5_ick",
2004
	.ops		= &clkops_omap2_dflt_wait,
2005
	.parent		= &l4_ck,
2006
	.clkdm_name	= "core_l4_clkdm",
2007 2008 2009
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_GPIO5_SHIFT,
	.recalc		= &followparent_recalc,
2010 2011 2012 2013
};

static struct clk gpio5_fck = {
	.name		= "gpio5_fck",
2014
	.ops		= &clkops_omap2_dflt_wait,
2015
	.parent		= &func_32k_ck,
2016
	.clkdm_name	= "core_l4_clkdm",
2017 2018 2019
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_GPIO5_SHIFT,
	.recalc		= &followparent_recalc,
2020 2021 2022 2023
};

static struct clk mdm_intc_ick = {
	.name		= "mdm_intc_ick",
2024
	.ops		= &clkops_omap2_dflt_wait,
2025
	.parent		= &l4_ck,
2026
	.clkdm_name	= "core_l4_clkdm",
2027 2028 2029
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MDM_INTC_SHIFT,
	.recalc		= &followparent_recalc,
2030 2031 2032
};

static struct clk mmchsdb1_fck = {
2033
	.name		= "mmchsdb_fck",
2034
	.ops		= &clkops_omap2_dflt_wait,
2035
	.parent		= &func_32k_ck,
2036
	.clkdm_name	= "core_l4_clkdm",
2037 2038 2039
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHSDB1_SHIFT,
	.recalc		= &followparent_recalc,
2040 2041 2042
};

static struct clk mmchsdb2_fck = {
2043
	.name		= "mmchsdb_fck",
2044
	.ops		= &clkops_omap2_dflt_wait,
2045
	.id		= 1,
2046
	.parent		= &func_32k_ck,
2047
	.clkdm_name	= "core_l4_clkdm",
2048 2049 2050
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHSDB2_SHIFT,
	.recalc		= &followparent_recalc,
2051
};
2052

2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068
/*
 * 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",
2069
	.ops		= &clkops_null,
2070
	.flags		= DELAYED_APP,
2071
	.parent		= &mpu_ck,	/* Indexed by mpu speed, no parent */
2072
	.recalc		= &omap2_table_mpu_recalc,	/* sets are keyed on mpu rate */
2073 2074 2075
	.set_rate	= &omap2_select_table_rate,
	.round_rate	= &omap2_round_to_table_rate,
};
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 2197 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 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240

/*
 * 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
 */

2241
int __init omap2xxx_clk_init(void)
2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266
{
	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);
2267
	sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck);
2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308
	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;
}
2309