clock2430_data.c 58.5 KB
Newer Older
1
/*
2
 *  linux/arch/arm/mach-omap2/clock2430_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
#define OMAP_CM_REGADDR			OMAP2430_CM_REGADDR

/*
 * 2430 clock tree.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
 *
 * 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.
51
 */
52 53 54 55

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

61 62 63 64 65 66 67
static struct clk secure_32k_ck = {
	.name		= "secure_32k_ck",
	.ops		= &clkops_null,
	.rate		= 32768,
	.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
	.clkdm_name	= "wkup_clkdm",
90
};
91

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

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

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

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

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

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

/*
 * PRCM digital base sources
 */
154 155 156 157

/* func_54m_ck */

static const struct clksel_rate func_54m_apll54_rates[] = {
158
	{ .div = 1, .val = 0, .flags = RATE_IN_24XX },
159 160 161 162
	{ .div = 0 },
};

static const struct clksel_rate func_54m_alt_rates[] = {
163
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
164 165 166 167 168 169 170 171 172
	{ .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 },
};

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

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

/* func_96m_ck */
static const struct clksel_rate func_96m_apll96_rates[] = {
195
	{ .div = 1, .val = 0, .flags = RATE_IN_24XX },
196
	{ .div = 0 },
197 198
};

199
static const struct clksel_rate func_96m_alt_rates[] = {
200
	{ .div = 1, .val = 1, .flags = RATE_IN_243X },
201 202 203 204 205 206 207 208 209
	{ .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 }
};

210 211
static struct clk func_96m_ck = {
	.name		= "func_96m_ck",
212
	.ops		= &clkops_null,
213
	.parent		= &apll96_ck,
214
	.clkdm_name	= "wkup_clkdm",
215 216
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
217
	.clksel_mask	= OMAP2430_96M_SOURCE_MASK,
218 219 220 221 222 223 224
	.clksel		= func_96m_clksel,
	.recalc		= &omap2_clksel_recalc,
};

/* func_48m_ck */

static const struct clksel_rate func_48m_apll96_rates[] = {
225
	{ .div = 2, .val = 0, .flags = RATE_IN_24XX },
226 227 228 229
	{ .div = 0 },
};

static const struct clksel_rate func_48m_alt_rates[] = {
230
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
231 232 233 234 235 236 237
	{ .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 }
238 239 240 241
};

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

static struct clk func_12m_ck = {
	.name		= "func_12m_ck",
256
	.ops		= &clkops_null,
257
	.parent		= &func_48m_ck,
258
	.fixed_div	= 4,
259
	.clkdm_name	= "wkup_clkdm",
260
	.recalc		= &omap_fixed_divisor_recalc,
261 262 263 264 265
};

/* Secure timer, only available in secure mode */
static struct clk wdt1_osc_ck = {
	.name		= "ck_wdt1_osc",
266
	.ops		= &clkops_null, /* RMK: missing? */
267
	.parent		= &osc_ck,
268 269 270 271 272 273 274 275 276 277 278 279
	.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[] = {
280
	{ .div = 1, .val = 0, .flags = RATE_IN_24XX },
281 282 283 284
	{ .div = 0 }
};

static const struct clksel_rate common_clkout_src_sys_rates[] = {
285
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
286 287 288 289
	{ .div = 0 }
};

static const struct clksel_rate common_clkout_src_96m_rates[] = {
290
	{ .div = 1, .val = 2, .flags = RATE_IN_24XX },
291 292 293 294
	{ .div = 0 }
};

static const struct clksel_rate common_clkout_src_54m_rates[] = {
295
	{ .div = 1, .val = 3, .flags = RATE_IN_24XX },
296 297 298 299 300 301 302 303 304 305 306 307 308
	{ .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",
309
	.ops		= &clkops_omap2_dflt,
310
	.parent		= &func_54m_ck,
311
	.clkdm_name	= "wkup_clkdm",
312
	.enable_reg	= OMAP2430_PRCM_CLKOUT_CTRL,
313 314
	.enable_bit	= OMAP24XX_CLKOUT_EN_SHIFT,
	.init		= &omap2_init_clksel_parent,
315
	.clksel_reg	= OMAP2430_PRCM_CLKOUT_CTRL,
316 317 318 319 320 321 322 323
	.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[] = {
324
	{ .div = 1, .val = 0, .flags = RATE_IN_24XX },
325 326 327 328 329 330 331 332 333 334
	{ .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 }
335 336 337 338
};

static struct clk sys_clkout = {
	.name		= "sys_clkout",
339
	.ops		= &clkops_null,
340
	.parent		= &sys_clkout_src,
341
	.clkdm_name	= "wkup_clkdm",
342
	.clksel_reg	= OMAP2430_PRCM_CLKOUT_CTRL,
343 344 345 346 347 348 349
	.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
};

350 351
static struct clk emul_ck = {
	.name		= "emul_ck",
352
	.ops		= &clkops_omap2_dflt,
353
	.parent		= &func_54m_ck,
354
	.clkdm_name	= "wkup_clkdm",
355
	.enable_reg	= OMAP2430_PRCM_CLKEMUL_CTRL,
356 357
	.enable_bit	= OMAP24XX_EMULATION_EN_SHIFT,
	.recalc		= &followparent_recalc,
358 359

};
360

361 362 363 364 365 366 367 368 369 370
/*
 * 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
 *
 */
371
static const struct clksel_rate mpu_core_rates[] = {
372
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
373 374 375 376 377 378 379 380 381
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 0 },
};

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

382 383
static struct clk mpu_ck = {	/* Control cpu */
	.name		= "mpu_ck",
384
	.ops		= &clkops_null,
385
	.parent		= &core_ck,
386
	.clkdm_name	= "mpu_clkdm",
387 388 389
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP24XX_CLKSEL_MPU_MASK,
390
	.clksel		= mpu_clksel,
391 392
	.recalc		= &omap2_clksel_recalc,
};
393

394
/*
395
 * DSP (2430-IVA2.1) clock domain
396
 * Clocks:
397 398 399 400 401 402
 *	2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
 *
 * 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.
403
 */
404
static const struct clksel_rate dsp_fck_core_rates[] = {
405
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
406 407 408 409 410 411 412 413 414 415 416 417 418
	{ .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 = 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",
419
	.ops		= &clkops_omap2_dflt_wait,
420
	.parent		= &core_ck,
421
	.clkdm_name	= "dsp_clkdm",
422 423 424 425 426
	.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,
427 428 429
	.recalc		= &omap2_clksel_recalc,
};

430 431
/* DSP interface clock */
static const struct clksel_rate dsp_irate_ick_rates[] = {
432
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
433 434 435 436 437 438 439 440
	{ .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 }
441 442
};

443
/* This clock does not exist as such in the TRM. */
444 445
static struct clk dsp_irate_ick = {
	.name		= "dsp_irate_ick",
446
	.ops		= &clkops_null,
447 448 449 450
	.parent		= &dsp_fck,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP24XX_CLKSEL_DSP_IF_MASK,
	.clksel		= dsp_irate_ick_clksel,
451 452 453
	.recalc		= &omap2_clksel_recalc,
};

454 455 456
/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
static struct clk iva2_1_ick = {
	.name		= "iva2_1_ick",
457
	.ops		= &clkops_omap2_dflt_wait,
458 459 460
	.parent		= &dsp_irate_ick,
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
};

/*
 * 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.
 */
482 483
static const struct clksel_rate core_l3_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
484
	{ .div = 4, .val = 4, .flags = RATE_IN_24XX },
485 486 487 488 489 490 491 492 493
	{ .div = 6, .val = 6, .flags = RATE_IN_24XX },
	{ .div = 0 }
};

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

494 495
static struct clk core_l3_ck = {	/* Used for ick and fck, interconnect */
	.name		= "core_l3_ck",
496
	.ops		= &clkops_null,
497
	.parent		= &core_ck,
498
	.clkdm_name	= "core_l3_clkdm",
499 500 501
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_L3_MASK,
	.clksel		= core_l3_clksel,
502
	.recalc		= &omap2_clksel_recalc,
503 504 505 506 507
};

/* usb_l4_ick */
static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
508
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
509 510 511 512 513 514 515
	{ .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 },
516 517
};

518
/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
519 520
static struct clk usb_l4_ick = {	/* FS-USB interface clock */
	.name		= "usb_l4_ick",
521
	.ops		= &clkops_omap2_dflt_wait,
522
	.parent		= &core_l3_ck,
523
	.clkdm_name	= "core_l4_clkdm",
524 525 526 527 528
	.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,
529 530 531
	.recalc		= &omap2_clksel_recalc,
};

532 533 534 535 536 537 538 539
/*
 * 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[] = {
540
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
541 542 543 544 545 546 547 548 549 550 551
	{ .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",
552
	.ops		= &clkops_null,
553 554 555 556 557 558 559 560
	.parent		= &core_l3_ck,
	.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,
};

561 562 563 564
/*
 * 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.
565
 * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK
566 567 568
 *
 * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
 */
569 570
static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
571
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
572 573 574 575 576 577 578 579 580 581 582
	{ .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 = 0 }
};

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

583 584
static struct clk ssi_ssr_sst_fck = {
	.name		= "ssi_fck",
585
	.ops		= &clkops_omap2_dflt_wait,
586
	.parent		= &core_ck,
587
	.clkdm_name	= "core_l3_clkdm",
588 589 590 591 592
	.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,
593 594 595
	.recalc		= &omap2_clksel_recalc,
};

596 597 598 599 600 601 602 603 604 605 606 607 608 609
/*
 * 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,
};

610

611 612 613 614 615 616 617 618 619 620 621
/*
 * 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.
 *
 */
622 623 624 625 626 627 628

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

629 630
static struct clk gfx_3d_fck = {
	.name		= "gfx_3d_fck",
631
	.ops		= &clkops_omap2_dflt_wait,
632
	.parent		= &core_l3_ck,
633
	.clkdm_name	= "gfx_clkdm",
634 635 636 637 638
	.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,
639
	.recalc		= &omap2_clksel_recalc,
640 641
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
642 643 644 645
};

static struct clk gfx_2d_fck = {
	.name		= "gfx_2d_fck",
646
	.ops		= &clkops_omap2_dflt_wait,
647
	.parent		= &core_l3_ck,
648
	.clkdm_name	= "gfx_clkdm",
649 650 651 652 653
	.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,
654 655 656 657 658
	.recalc		= &omap2_clksel_recalc,
};

static struct clk gfx_ick = {
	.name		= "gfx_ick",		/* From l3 */
659
	.ops		= &clkops_omap2_dflt_wait,
660
	.parent		= &core_l3_ck,
661
	.clkdm_name	= "gfx_clkdm",
662 663 664
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
	.enable_bit	= OMAP_EN_GFX_SHIFT,
	.recalc		= &followparent_recalc,
665 666 667 668 669 670 671
};

/*
 * Modem clock domain (2430)
 *	CLOCKS:
 *		MDM_OSC_CLK
 *		MDM_ICLK
672
 * These clocks are usable in chassis mode only.
673
 */
674 675
static const struct clksel_rate mdm_ick_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_243X },
676
	{ .div = 4, .val = 4, .flags = RATE_IN_243X },
677 678 679 680 681 682 683 684 685 686
	{ .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 }
};

687 688
static struct clk mdm_ick = {		/* used both as a ick and fck */
	.name		= "mdm_ick",
689
	.ops		= &clkops_omap2_dflt_wait,
690
	.parent		= &core_ck,
691
	.clkdm_name	= "mdm_clkdm",
692 693 694 695 696
	.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,
697 698 699 700 701
	.recalc		= &omap2_clksel_recalc,
};

static struct clk mdm_osc_ck = {
	.name		= "mdm_osc_ck",
702
	.ops		= &clkops_omap2_dflt_wait,
703
	.parent		= &osc_ck,
704
	.clkdm_name	= "mdm_clkdm",
705 706 707
	.enable_reg	= OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2430_EN_OSC_SHIFT,
	.recalc		= &followparent_recalc,
708 709 710 711 712 713 714 715 716 717
};

/*
 * DSS clock domain
 * CLOCKs:
 * DSS_L4_ICLK, DSS_L3_ICLK,
 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
 *
 * DSS is both initiator and target.
 */
718 719 720
/* XXX Add RATE_NOT_VALIDATED */

static const struct clksel_rate dss1_fck_sys_rates[] = {
721
	{ .div = 1, .val = 0, .flags = RATE_IN_24XX },
722 723 724 725 726 727 728 729 730 731 732 733 734
	{ .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 },
735
	{ .div = 16, .val = 16, .flags = RATE_IN_24XX },
736 737 738 739 740 741 742 743 744
	{ .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 },
};

745 746
static struct clk dss_ick = {		/* Enables both L3,L4 ICLK's */
	.name		= "dss_ick",
747
	.ops		= &clkops_omap2_dflt,
748
	.parent		= &l4_ck,	/* really both l3 and l4 */
749
	.clkdm_name	= "dss_clkdm",
750 751 752
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_DSS1_SHIFT,
	.recalc		= &followparent_recalc,
753 754 755 756
};

static struct clk dss1_fck = {
	.name		= "dss1_fck",
757
	.ops		= &clkops_omap2_dflt,
758
	.parent		= &core_ck,		/* Core or sys */
759
	.clkdm_name	= "dss_clkdm",
760 761 762 763 764 765
	.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,
766
	.recalc		= &omap2_clksel_recalc,
767 768 769
};

static const struct clksel_rate dss2_fck_sys_rates[] = {
770
	{ .div = 1, .val = 0, .flags = RATE_IN_24XX },
771 772 773 774
	{ .div = 0 }
};

static const struct clksel_rate dss2_fck_48m_rates[] = {
775
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
776 777 778 779 780 781 782
	{ .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 }
783 784 785 786
};

static struct clk dss2_fck = {		/* Alt clk used in power management */
	.name		= "dss2_fck",
787
	.ops		= &clkops_omap2_dflt,
788
	.parent		= &sys_ck,		/* fixed at sys_ck or 48MHz */
789
	.clkdm_name	= "dss_clkdm",
790 791 792 793 794 795 796
	.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,
797 798 799 800
};

static struct clk dss_54m_fck = {	/* Alt clk used in power management */
	.name		= "dss_54m_fck",	/* 54m tv clk */
801
	.ops		= &clkops_omap2_dflt_wait,
802
	.parent		= &func_54m_ck,
803
	.clkdm_name	= "dss_clkdm",
804 805 806
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_TV_SHIFT,
	.recalc		= &followparent_recalc,
807 808 809 810 811 812 813 814
};

/*
 * 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.
 */
815
static const struct clksel_rate gpt_alt_rates[] = {
816
	{ .div = 1, .val = 2, .flags = RATE_IN_24XX },
817 818 819 820 821 822 823 824 825 826
	{ .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 },
};

827 828
static struct clk gpt1_ick = {
	.name		= "gpt1_ick",
829
	.ops		= &clkops_omap2_dflt_wait,
830
	.parent		= &l4_ck,
831
	.clkdm_name	= "core_l4_clkdm",
832 833 834
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_GPT1_SHIFT,
	.recalc		= &followparent_recalc,
835 836 837 838
};

static struct clk gpt1_fck = {
	.name		= "gpt1_fck",
839
	.ops		= &clkops_omap2_dflt_wait,
840
	.parent		= &func_32k_ck,
841
	.clkdm_name	= "core_l4_clkdm",
842 843 844 845 846 847 848 849 850
	.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
851 852 853 854
};

static struct clk gpt2_ick = {
	.name		= "gpt2_ick",
855
	.ops		= &clkops_omap2_dflt_wait,
856
	.parent		= &l4_ck,
857
	.clkdm_name	= "core_l4_clkdm",
858 859 860
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT2_SHIFT,
	.recalc		= &followparent_recalc,
861 862 863 864
};

static struct clk gpt2_fck = {
	.name		= "gpt2_fck",
865
	.ops		= &clkops_omap2_dflt_wait,
866
	.parent		= &func_32k_ck,
867
	.clkdm_name	= "core_l4_clkdm",
868 869 870 871 872 873 874
	.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,
875 876 877 878
};

static struct clk gpt3_ick = {
	.name		= "gpt3_ick",
879
	.ops		= &clkops_omap2_dflt_wait,
880
	.parent		= &l4_ck,
881
	.clkdm_name	= "core_l4_clkdm",
882 883 884
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT3_SHIFT,
	.recalc		= &followparent_recalc,
885 886 887 888
};

static struct clk gpt3_fck = {
	.name		= "gpt3_fck",
889
	.ops		= &clkops_omap2_dflt_wait,
890
	.parent		= &func_32k_ck,
891
	.clkdm_name	= "core_l4_clkdm",
892 893 894 895 896 897 898
	.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,
899 900 901 902
};

static struct clk gpt4_ick = {
	.name		= "gpt4_ick",
903
	.ops		= &clkops_omap2_dflt_wait,
904
	.parent		= &l4_ck,
905
	.clkdm_name	= "core_l4_clkdm",
906 907 908
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT4_SHIFT,
	.recalc		= &followparent_recalc,
909 910 911 912
};

static struct clk gpt4_fck = {
	.name		= "gpt4_fck",
913
	.ops		= &clkops_omap2_dflt_wait,
914
	.parent		= &func_32k_ck,
915
	.clkdm_name	= "core_l4_clkdm",
916 917 918 919 920 921 922
	.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,
923 924 925 926
};

static struct clk gpt5_ick = {
	.name		= "gpt5_ick",
927
	.ops		= &clkops_omap2_dflt_wait,
928
	.parent		= &l4_ck,
929
	.clkdm_name	= "core_l4_clkdm",
930 931 932
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT5_SHIFT,
	.recalc		= &followparent_recalc,
933 934 935 936
};

static struct clk gpt5_fck = {
	.name		= "gpt5_fck",
937
	.ops		= &clkops_omap2_dflt_wait,
938
	.parent		= &func_32k_ck,
939
	.clkdm_name	= "core_l4_clkdm",
940 941 942 943 944 945 946
	.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,
947 948 949 950
};

static struct clk gpt6_ick = {
	.name		= "gpt6_ick",
951
	.ops		= &clkops_omap2_dflt_wait,
952
	.parent		= &l4_ck,
953
	.clkdm_name	= "core_l4_clkdm",
954 955 956
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT6_SHIFT,
	.recalc		= &followparent_recalc,
957 958 959 960
};

static struct clk gpt6_fck = {
	.name		= "gpt6_fck",
961
	.ops		= &clkops_omap2_dflt_wait,
962
	.parent		= &func_32k_ck,
963
	.clkdm_name	= "core_l4_clkdm",
964 965 966 967 968 969 970
	.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,
971 972 973 974
};

static struct clk gpt7_ick = {
	.name		= "gpt7_ick",
975
	.ops		= &clkops_omap2_dflt_wait,
976
	.parent		= &l4_ck,
977 978 979
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT7_SHIFT,
	.recalc		= &followparent_recalc,
980 981 982 983
};

static struct clk gpt7_fck = {
	.name		= "gpt7_fck",
984
	.ops		= &clkops_omap2_dflt_wait,
985
	.parent		= &func_32k_ck,
986
	.clkdm_name	= "core_l4_clkdm",
987 988 989 990 991 992 993
	.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,
994 995 996 997
};

static struct clk gpt8_ick = {
	.name		= "gpt8_ick",
998
	.ops		= &clkops_omap2_dflt_wait,
999
	.parent		= &l4_ck,
1000
	.clkdm_name	= "core_l4_clkdm",
1001 1002 1003
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT8_SHIFT,
	.recalc		= &followparent_recalc,
1004 1005 1006 1007
};

static struct clk gpt8_fck = {
	.name		= "gpt8_fck",
1008
	.ops		= &clkops_omap2_dflt_wait,
1009
	.parent		= &func_32k_ck,
1010
	.clkdm_name	= "core_l4_clkdm",
1011 1012 1013 1014 1015 1016 1017
	.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,
1018 1019 1020 1021
};

static struct clk gpt9_ick = {
	.name		= "gpt9_ick",
1022
	.ops		= &clkops_omap2_dflt_wait,
1023
	.parent		= &l4_ck,
1024
	.clkdm_name	= "core_l4_clkdm",
1025 1026 1027
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT9_SHIFT,
	.recalc		= &followparent_recalc,
1028 1029 1030 1031
};

static struct clk gpt9_fck = {
	.name		= "gpt9_fck",
1032
	.ops		= &clkops_omap2_dflt_wait,
1033
	.parent		= &func_32k_ck,
1034
	.clkdm_name	= "core_l4_clkdm",
1035 1036 1037 1038 1039 1040 1041
	.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,
1042 1043 1044 1045
};

static struct clk gpt10_ick = {
	.name		= "gpt10_ick",
1046
	.ops		= &clkops_omap2_dflt_wait,
1047
	.parent		= &l4_ck,
1048
	.clkdm_name	= "core_l4_clkdm",
1049 1050 1051
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT10_SHIFT,
	.recalc		= &followparent_recalc,
1052 1053 1054 1055
};

static struct clk gpt10_fck = {
	.name		= "gpt10_fck",
1056
	.ops		= &clkops_omap2_dflt_wait,
1057
	.parent		= &func_32k_ck,
1058
	.clkdm_name	= "core_l4_clkdm",
1059 1060 1061 1062 1063 1064 1065
	.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,
1066 1067 1068 1069
};

static struct clk gpt11_ick = {
	.name		= "gpt11_ick",
1070
	.ops		= &clkops_omap2_dflt_wait,
1071
	.parent		= &l4_ck,
1072
	.clkdm_name	= "core_l4_clkdm",
1073 1074 1075
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT11_SHIFT,
	.recalc		= &followparent_recalc,
1076 1077 1078 1079
};

static struct clk gpt11_fck = {
	.name		= "gpt11_fck",
1080
	.ops		= &clkops_omap2_dflt_wait,
1081
	.parent		= &func_32k_ck,
1082
	.clkdm_name	= "core_l4_clkdm",
1083 1084 1085 1086 1087 1088 1089
	.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,
1090 1091 1092 1093
};

static struct clk gpt12_ick = {
	.name		= "gpt12_ick",
1094
	.ops		= &clkops_omap2_dflt_wait,
1095
	.parent		= &l4_ck,
1096
	.clkdm_name	= "core_l4_clkdm",
1097 1098 1099
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT12_SHIFT,
	.recalc		= &followparent_recalc,
1100 1101 1102 1103
};

static struct clk gpt12_fck = {
	.name		= "gpt12_fck",
1104
	.ops		= &clkops_omap2_dflt_wait,
1105
	.parent		= &secure_32k_ck,
1106
	.clkdm_name	= "core_l4_clkdm",
1107 1108 1109 1110 1111 1112 1113
	.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,
1114 1115 1116
};

static struct clk mcbsp1_ick = {
1117
	.name		= "mcbsp1_ick",
1118
	.ops		= &clkops_omap2_dflt_wait,
1119
	.parent		= &l4_ck,
1120
	.clkdm_name	= "core_l4_clkdm",
1121 1122 1123
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP1_SHIFT,
	.recalc		= &followparent_recalc,
1124 1125 1126
};

static struct clk mcbsp1_fck = {
1127
	.name		= "mcbsp1_fck",
1128
	.ops		= &clkops_omap2_dflt_wait,
1129
	.parent		= &func_96m_ck,
1130
	.clkdm_name	= "core_l4_clkdm",
1131 1132 1133
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP1_SHIFT,
	.recalc		= &followparent_recalc,
1134 1135 1136
};

static struct clk mcbsp2_ick = {
1137
	.name		= "mcbsp2_ick",
1138
	.ops		= &clkops_omap2_dflt_wait,
1139
	.parent		= &l4_ck,
1140
	.clkdm_name	= "core_l4_clkdm",
1141 1142 1143
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
	.recalc		= &followparent_recalc,
1144 1145 1146
};

static struct clk mcbsp2_fck = {
1147
	.name		= "mcbsp2_fck",
1148
	.ops		= &clkops_omap2_dflt_wait,
1149
	.parent		= &func_96m_ck,
1150
	.clkdm_name	= "core_l4_clkdm",
1151 1152 1153
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
	.recalc		= &followparent_recalc,
1154 1155 1156
};

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

static struct clk mcbsp3_fck = {
1167
	.name		= "mcbsp3_fck",
1168
	.ops		= &clkops_omap2_dflt_wait,
1169
	.parent		= &func_96m_ck,
1170
	.clkdm_name	= "core_l4_clkdm",
1171 1172 1173
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP3_SHIFT,
	.recalc		= &followparent_recalc,
1174 1175 1176
};

static struct clk mcbsp4_ick = {
1177
	.name		= "mcbsp4_ick",
1178
	.ops		= &clkops_omap2_dflt_wait,
1179
	.parent		= &l4_ck,
1180
	.clkdm_name	= "core_l4_clkdm",
1181 1182 1183
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP4_SHIFT,
	.recalc		= &followparent_recalc,
1184 1185 1186
};

static struct clk mcbsp4_fck = {
1187
	.name		= "mcbsp4_fck",
1188
	.ops		= &clkops_omap2_dflt_wait,
1189
	.parent		= &func_96m_ck,
1190
	.clkdm_name	= "core_l4_clkdm",
1191 1192 1193
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP4_SHIFT,
	.recalc		= &followparent_recalc,
1194 1195 1196
};

static struct clk mcbsp5_ick = {
1197
	.name		= "mcbsp5_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_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP5_SHIFT,
	.recalc		= &followparent_recalc,
1204 1205 1206
};

static struct clk mcbsp5_fck = {
1207
	.name		= "mcbsp5_fck",
1208
	.ops		= &clkops_omap2_dflt_wait,
1209
	.parent		= &func_96m_ck,
1210
	.clkdm_name	= "core_l4_clkdm",
1211 1212 1213
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP5_SHIFT,
	.recalc		= &followparent_recalc,
1214 1215 1216
};

static struct clk mcspi1_ick = {
1217
	.name		= "mcspi1_ick",
1218
	.ops		= &clkops_omap2_dflt_wait,
1219
	.parent		= &l4_ck,
1220
	.clkdm_name	= "core_l4_clkdm",
1221 1222 1223
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI1_SHIFT,
	.recalc		= &followparent_recalc,
1224 1225 1226
};

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

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

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

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

static struct clk mcspi3_fck = {
1267
	.name		= "mcspi3_fck",
1268
	.ops		= &clkops_omap2_dflt_wait,
1269
	.parent		= &func_48m_ck,
1270
	.clkdm_name	= "core_l4_clkdm",
1271 1272 1273
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCSPI3_SHIFT,
	.recalc		= &followparent_recalc,
1274 1275 1276 1277
};

static struct clk uart1_ick = {
	.name		= "uart1_ick",
1278
	.ops		= &clkops_omap2_dflt_wait,
1279
	.parent		= &l4_ck,
1280
	.clkdm_name	= "core_l4_clkdm",
1281 1282 1283
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_UART1_SHIFT,
	.recalc		= &followparent_recalc,
1284 1285 1286 1287
};

static struct clk uart1_fck = {
	.name		= "uart1_fck",
1288
	.ops		= &clkops_omap2_dflt_wait,
1289
	.parent		= &func_48m_ck,
1290
	.clkdm_name	= "core_l4_clkdm",
1291 1292 1293
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_UART1_SHIFT,
	.recalc		= &followparent_recalc,
1294 1295 1296 1297
};

static struct clk uart2_ick = {
	.name		= "uart2_ick",
1298
	.ops		= &clkops_omap2_dflt_wait,
1299
	.parent		= &l4_ck,
1300
	.clkdm_name	= "core_l4_clkdm",
1301 1302 1303
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_UART2_SHIFT,
	.recalc		= &followparent_recalc,
1304 1305 1306 1307
};

static struct clk uart2_fck = {
	.name		= "uart2_fck",
1308
	.ops		= &clkops_omap2_dflt_wait,
1309
	.parent		= &func_48m_ck,
1310
	.clkdm_name	= "core_l4_clkdm",
1311 1312 1313
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_UART2_SHIFT,
	.recalc		= &followparent_recalc,
1314 1315 1316 1317
};

static struct clk uart3_ick = {
	.name		= "uart3_ick",
1318
	.ops		= &clkops_omap2_dflt_wait,
1319
	.parent		= &l4_ck,
1320
	.clkdm_name	= "core_l4_clkdm",
1321 1322 1323
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP24XX_EN_UART3_SHIFT,
	.recalc		= &followparent_recalc,
1324 1325 1326 1327
};

static struct clk uart3_fck = {
	.name		= "uart3_fck",
1328
	.ops		= &clkops_omap2_dflt_wait,
1329
	.parent		= &func_48m_ck,
1330
	.clkdm_name	= "core_l4_clkdm",
1331 1332 1333
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_UART3_SHIFT,
	.recalc		= &followparent_recalc,
1334 1335 1336 1337
};

static struct clk gpios_ick = {
	.name		= "gpios_ick",
1338
	.ops		= &clkops_omap2_dflt_wait,
1339
	.parent		= &l4_ck,
1340
	.clkdm_name	= "core_l4_clkdm",
1341 1342 1343
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_GPIOS_SHIFT,
	.recalc		= &followparent_recalc,
1344 1345 1346 1347
};

static struct clk gpios_fck = {
	.name		= "gpios_fck",
1348
	.ops		= &clkops_omap2_dflt_wait,
1349
	.parent		= &func_32k_ck,
1350
	.clkdm_name	= "wkup_clkdm",
1351 1352 1353
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_GPIOS_SHIFT,
	.recalc		= &followparent_recalc,
1354 1355 1356 1357
};

static struct clk mpu_wdt_ick = {
	.name		= "mpu_wdt_ick",
1358
	.ops		= &clkops_omap2_dflt_wait,
1359
	.parent		= &l4_ck,
1360
	.clkdm_name	= "core_l4_clkdm",
1361 1362 1363
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_MPU_WDT_SHIFT,
	.recalc		= &followparent_recalc,
1364 1365 1366 1367
};

static struct clk mpu_wdt_fck = {
	.name		= "mpu_wdt_fck",
1368
	.ops		= &clkops_omap2_dflt_wait,
1369
	.parent		= &func_32k_ck,
1370
	.clkdm_name	= "wkup_clkdm",
1371 1372 1373
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_MPU_WDT_SHIFT,
	.recalc		= &followparent_recalc,
1374 1375 1376 1377
};

static struct clk sync_32k_ick = {
	.name		= "sync_32k_ick",
1378
	.ops		= &clkops_omap2_dflt_wait,
1379
	.parent		= &l4_ck,
1380
	.flags		= ENABLE_ON_INIT,
1381
	.clkdm_name	= "core_l4_clkdm",
1382 1383 1384
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_32KSYNC_SHIFT,
	.recalc		= &followparent_recalc,
1385
};
1386

1387 1388
static struct clk wdt1_ick = {
	.name		= "wdt1_ick",
1389
	.ops		= &clkops_omap2_dflt_wait,
1390
	.parent		= &l4_ck,
1391
	.clkdm_name	= "core_l4_clkdm",
1392 1393 1394
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_WDT1_SHIFT,
	.recalc		= &followparent_recalc,
1395
};
1396

1397 1398
static struct clk omapctrl_ick = {
	.name		= "omapctrl_ick",
1399
	.ops		= &clkops_omap2_dflt_wait,
1400
	.parent		= &l4_ck,
1401
	.flags		= ENABLE_ON_INIT,
1402
	.clkdm_name	= "core_l4_clkdm",
1403 1404 1405
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_OMAPCTRL_SHIFT,
	.recalc		= &followparent_recalc,
1406
};
1407

1408 1409
static struct clk icr_ick = {
	.name		= "icr_ick",
1410
	.ops		= &clkops_omap2_dflt_wait,
1411
	.parent		= &l4_ck,
1412
	.clkdm_name	= "core_l4_clkdm",
1413 1414 1415
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP2430_EN_ICR_SHIFT,
	.recalc		= &followparent_recalc,
1416 1417 1418 1419
};

static struct clk cam_ick = {
	.name		= "cam_ick",
1420
	.ops		= &clkops_omap2_dflt,
1421
	.parent		= &l4_ck,
1422
	.clkdm_name	= "core_l4_clkdm",
1423 1424 1425
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_CAM_SHIFT,
	.recalc		= &followparent_recalc,
1426 1427
};

1428 1429 1430 1431 1432
/*
 * 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.
 */
1433 1434
static struct clk cam_fck = {
	.name		= "cam_fck",
1435
	.ops		= &clkops_omap2_dflt,
1436
	.parent		= &func_96m_ck,
1437
	.clkdm_name	= "core_l3_clkdm",
1438 1439 1440
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_CAM_SHIFT,
	.recalc		= &followparent_recalc,
1441 1442 1443 1444
};

static struct clk mailboxes_ick = {
	.name		= "mailboxes_ick",
1445
	.ops		= &clkops_omap2_dflt_wait,
1446
	.parent		= &l4_ck,
1447
	.clkdm_name	= "core_l4_clkdm",
1448 1449 1450
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MAILBOXES_SHIFT,
	.recalc		= &followparent_recalc,
1451 1452 1453 1454
};

static struct clk wdt4_ick = {
	.name		= "wdt4_ick",
1455
	.ops		= &clkops_omap2_dflt_wait,
1456
	.parent		= &l4_ck,
1457
	.clkdm_name	= "core_l4_clkdm",
1458 1459 1460
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_WDT4_SHIFT,
	.recalc		= &followparent_recalc,
1461 1462 1463 1464
};

static struct clk wdt4_fck = {
	.name		= "wdt4_fck",
1465
	.ops		= &clkops_omap2_dflt_wait,
1466
	.parent		= &func_32k_ck,
1467
	.clkdm_name	= "core_l4_clkdm",
1468 1469 1470
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_WDT4_SHIFT,
	.recalc		= &followparent_recalc,
1471 1472 1473 1474
};

static struct clk mspro_ick = {
	.name		= "mspro_ick",
1475
	.ops		= &clkops_omap2_dflt_wait,
1476
	.parent		= &l4_ck,
1477
	.clkdm_name	= "core_l4_clkdm",
1478 1479 1480
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MSPRO_SHIFT,
	.recalc		= &followparent_recalc,
1481 1482 1483 1484
};

static struct clk mspro_fck = {
	.name		= "mspro_fck",
1485
	.ops		= &clkops_omap2_dflt_wait,
1486
	.parent		= &func_96m_ck,
1487
	.clkdm_name	= "core_l4_clkdm",
1488 1489 1490
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MSPRO_SHIFT,
	.recalc		= &followparent_recalc,
1491 1492 1493 1494
};

static struct clk fac_ick = {
	.name		= "fac_ick",
1495
	.ops		= &clkops_omap2_dflt_wait,
1496
	.parent		= &l4_ck,
1497
	.clkdm_name	= "core_l4_clkdm",
1498 1499 1500
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_FAC_SHIFT,
	.recalc		= &followparent_recalc,
1501 1502 1503 1504
};

static struct clk fac_fck = {
	.name		= "fac_fck",
1505
	.ops		= &clkops_omap2_dflt_wait,
1506
	.parent		= &func_12m_ck,
1507
	.clkdm_name	= "core_l4_clkdm",
1508 1509 1510
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_FAC_SHIFT,
	.recalc		= &followparent_recalc,
1511 1512 1513 1514
};

static struct clk hdq_ick = {
	.name		= "hdq_ick",
1515
	.ops		= &clkops_omap2_dflt_wait,
1516
	.parent		= &l4_ck,
1517
	.clkdm_name	= "core_l4_clkdm",
1518 1519 1520
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
1521 1522 1523 1524
};

static struct clk hdq_fck = {
	.name		= "hdq_fck",
1525
	.ops		= &clkops_omap2_dflt_wait,
1526
	.parent		= &func_12m_ck,
1527
	.clkdm_name	= "core_l4_clkdm",
1528 1529 1530
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
1531 1532
};

1533 1534 1535 1536
/*
 * XXX This is marked as a 2420-only define, but it claims to be present
 * on 2430 also.  Double-check.
 */
1537
static struct clk i2c2_ick = {
1538
	.name		= "i2c2_ick",
1539
	.ops		= &clkops_omap2_dflt_wait,
1540
	.parent		= &l4_ck,
1541
	.clkdm_name	= "core_l4_clkdm",
1542 1543 1544
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_I2C2_SHIFT,
	.recalc		= &followparent_recalc,
1545 1546 1547
};

static struct clk i2chs2_fck = {
1548
	.name		= "i2chs2_fck",
1549
	.ops		= &clkops_omap2430_i2chs_wait,
1550
	.parent		= &func_96m_ck,
1551
	.clkdm_name	= "core_l4_clkdm",
1552 1553 1554
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_I2CHS2_SHIFT,
	.recalc		= &followparent_recalc,
1555 1556
};

1557 1558 1559 1560
/*
 * XXX This is marked as a 2420-only define, but it claims to be present
 * on 2430 also.  Double-check.
 */
1561
static struct clk i2c1_ick = {
1562
	.name		= "i2c1_ick",
1563
	.ops		= &clkops_omap2_dflt_wait,
1564
	.parent		= &l4_ck,
1565
	.clkdm_name	= "core_l4_clkdm",
1566 1567 1568
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_I2C1_SHIFT,
	.recalc		= &followparent_recalc,
1569 1570 1571
};

static struct clk i2chs1_fck = {
1572
	.name		= "i2chs1_fck",
1573
	.ops		= &clkops_omap2430_i2chs_wait,
1574
	.parent		= &func_96m_ck,
1575
	.clkdm_name	= "core_l4_clkdm",
1576 1577 1578 1579 1580 1581 1582
	.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",
1583
	.ops		= &clkops_null, /* RMK: missing? */
1584
	.parent		= &core_l3_ck,
1585
	.flags		= ENABLE_ON_INIT,
1586
	.clkdm_name	= "core_l3_clkdm",
1587 1588 1589 1590 1591
	.recalc		= &followparent_recalc,
};

static struct clk sdma_fck = {
	.name		= "sdma_fck",
1592
	.ops		= &clkops_null, /* RMK: missing? */
1593
	.parent		= &core_l3_ck,
1594
	.clkdm_name	= "core_l3_clkdm",
1595 1596 1597 1598 1599
	.recalc		= &followparent_recalc,
};

static struct clk sdma_ick = {
	.name		= "sdma_ick",
1600
	.ops		= &clkops_null, /* RMK: missing? */
1601
	.parent		= &l4_ck,
1602
	.clkdm_name	= "core_l3_clkdm",
1603
	.recalc		= &followparent_recalc,
1604 1605 1606 1607
};

static struct clk sdrc_ick = {
	.name		= "sdrc_ick",
1608
	.ops		= &clkops_omap2_dflt_wait,
1609
	.parent		= &l4_ck,
1610
	.flags		= ENABLE_ON_INIT,
1611
	.clkdm_name	= "core_l4_clkdm",
1612 1613 1614
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
	.enable_bit	= OMAP2430_EN_SDRC_SHIFT,
	.recalc		= &followparent_recalc,
1615 1616 1617 1618
};

static struct clk des_ick = {
	.name		= "des_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, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_DES_SHIFT,
	.recalc		= &followparent_recalc,
1625 1626 1627 1628
};

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

static struct clk rng_ick = {
	.name		= "rng_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, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_RNG_SHIFT,
	.recalc		= &followparent_recalc,
1645 1646 1647 1648
};

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

static struct clk pka_ick = {
	.name		= "pka_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, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_PKA_SHIFT,
	.recalc		= &followparent_recalc,
1665 1666 1667 1668
};

static struct clk usb_fck = {
	.name		= "usb_fck",
1669
	.ops		= &clkops_omap2_dflt_wait,
1670
	.parent		= &func_48m_ck,
1671
	.clkdm_name	= "core_l3_clkdm",
1672 1673 1674
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_USB_SHIFT,
	.recalc		= &followparent_recalc,
1675 1676 1677 1678
};

static struct clk usbhs_ick = {
	.name		= "usbhs_ick",
1679
	.ops		= &clkops_omap2_dflt_wait,
1680
	.parent		= &core_l3_ck,
1681
	.clkdm_name	= "core_l3_clkdm",
1682 1683 1684
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_USBHS_SHIFT,
	.recalc		= &followparent_recalc,
1685 1686 1687
};

static struct clk mmchs1_ick = {
1688
	.name		= "mmchs1_ick",
1689
	.ops		= &clkops_omap2_dflt_wait,
1690
	.parent		= &l4_ck,
1691
	.clkdm_name	= "core_l4_clkdm",
1692 1693 1694
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS1_SHIFT,
	.recalc		= &followparent_recalc,
1695 1696 1697
};

static struct clk mmchs1_fck = {
1698
	.name		= "mmchs1_fck",
1699
	.ops		= &clkops_omap2_dflt_wait,
1700
	.parent		= &func_96m_ck,
1701
	.clkdm_name	= "core_l3_clkdm",
1702 1703 1704
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS1_SHIFT,
	.recalc		= &followparent_recalc,
1705 1706 1707
};

static struct clk mmchs2_ick = {
1708
	.name		= "mmchs2_ick",
1709
	.ops		= &clkops_omap2_dflt_wait,
1710
	.parent		= &l4_ck,
1711
	.clkdm_name	= "core_l4_clkdm",
1712 1713 1714
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS2_SHIFT,
	.recalc		= &followparent_recalc,
1715 1716 1717
};

static struct clk mmchs2_fck = {
1718
	.name		= "mmchs2_fck",
1719
	.ops		= &clkops_omap2_dflt_wait,
1720
	.parent		= &func_96m_ck,
1721 1722 1723
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS2_SHIFT,
	.recalc		= &followparent_recalc,
1724 1725 1726 1727
};

static struct clk gpio5_ick = {
	.name		= "gpio5_ick",
1728
	.ops		= &clkops_omap2_dflt_wait,
1729
	.parent		= &l4_ck,
1730
	.clkdm_name	= "core_l4_clkdm",
1731 1732 1733
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_GPIO5_SHIFT,
	.recalc		= &followparent_recalc,
1734 1735 1736 1737
};

static struct clk gpio5_fck = {
	.name		= "gpio5_fck",
1738
	.ops		= &clkops_omap2_dflt_wait,
1739
	.parent		= &func_32k_ck,
1740
	.clkdm_name	= "core_l4_clkdm",
1741 1742 1743
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_GPIO5_SHIFT,
	.recalc		= &followparent_recalc,
1744 1745 1746 1747
};

static struct clk mdm_intc_ick = {
	.name		= "mdm_intc_ick",
1748
	.ops		= &clkops_omap2_dflt_wait,
1749
	.parent		= &l4_ck,
1750
	.clkdm_name	= "core_l4_clkdm",
1751 1752 1753
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MDM_INTC_SHIFT,
	.recalc		= &followparent_recalc,
1754 1755 1756
};

static struct clk mmchsdb1_fck = {
1757
	.name		= "mmchsdb1_fck",
1758
	.ops		= &clkops_omap2_dflt_wait,
1759
	.parent		= &func_32k_ck,
1760
	.clkdm_name	= "core_l4_clkdm",
1761 1762 1763
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHSDB1_SHIFT,
	.recalc		= &followparent_recalc,
1764 1765 1766
};

static struct clk mmchsdb2_fck = {
1767
	.name		= "mmchsdb2_fck",
1768
	.ops		= &clkops_omap2_dflt_wait,
1769
	.parent		= &func_32k_ck,
1770
	.clkdm_name	= "core_l4_clkdm",
1771 1772 1773
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHSDB2_SHIFT,
	.recalc		= &followparent_recalc,
1774
};
1775

1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791
/*
 * 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",
1792
	.ops		= &clkops_null,
1793
	.parent		= &mpu_ck,	/* Indexed by mpu speed, no parent */
1794
	.recalc		= &omap2_table_mpu_recalc,	/* sets are keyed on mpu rate */
1795 1796 1797
	.set_rate	= &omap2_select_table_rate,
	.round_rate	= &omap2_round_to_table_rate,
};
1798

1799 1800 1801 1802 1803

/*
 * clkdev integration
 */

1804
static struct omap_clk omap2430_clks[] = {
1805
	/* external root sources */
1806 1807 1808 1809 1810
	CLK(NULL,	"func_32k_ck",	&func_32k_ck,	CK_243X),
	CLK(NULL,	"secure_32k_ck", &secure_32k_ck, CK_243X),
	CLK(NULL,	"osc_ck",	&osc_ck,	CK_243X),
	CLK(NULL,	"sys_ck",	&sys_ck,	CK_243X),
	CLK(NULL,	"alt_ck",	&alt_ck,	CK_243X),
1811
	/* internal analog sources */
1812 1813 1814
	CLK(NULL,	"dpll_ck",	&dpll_ck,	CK_243X),
	CLK(NULL,	"apll96_ck",	&apll96_ck,	CK_243X),
	CLK(NULL,	"apll54_ck",	&apll54_ck,	CK_243X),
1815
	/* internal prcm root sources */
1816 1817 1818 1819 1820 1821 1822 1823 1824
	CLK(NULL,	"func_54m_ck",	&func_54m_ck,	CK_243X),
	CLK(NULL,	"core_ck",	&core_ck,	CK_243X),
	CLK(NULL,	"func_96m_ck",	&func_96m_ck,	CK_243X),
	CLK(NULL,	"func_48m_ck",	&func_48m_ck,	CK_243X),
	CLK(NULL,	"func_12m_ck",	&func_12m_ck,	CK_243X),
	CLK(NULL,	"ck_wdt1_osc",	&wdt1_osc_ck,	CK_243X),
	CLK(NULL,	"sys_clkout_src", &sys_clkout_src, CK_243X),
	CLK(NULL,	"sys_clkout",	&sys_clkout,	CK_243X),
	CLK(NULL,	"emul_ck",	&emul_ck,	CK_243X),
1825
	/* mpu domain clocks */
1826
	CLK(NULL,	"mpu_ck",	&mpu_ck,	CK_243X),
1827
	/* dsp domain clocks */
1828 1829
	CLK(NULL,	"dsp_fck",	&dsp_fck,	CK_243X),
	CLK(NULL,	"dsp_irate_ick", &dsp_irate_ick, CK_243X),
1830 1831
	CLK(NULL,	"iva2_1_ick",	&iva2_1_ick,	CK_243X),
	/* GFX domain clocks */
1832 1833 1834
	CLK(NULL,	"gfx_3d_fck",	&gfx_3d_fck,	CK_243X),
	CLK(NULL,	"gfx_2d_fck",	&gfx_2d_fck,	CK_243X),
	CLK(NULL,	"gfx_ick",	&gfx_ick,	CK_243X),
1835 1836 1837 1838
	/* Modem domain clocks */
	CLK(NULL,	"mdm_ick",	&mdm_ick,	CK_243X),
	CLK(NULL,	"mdm_osc_ck",	&mdm_osc_ck,	CK_243X),
	/* DSS domain clocks */
1839 1840 1841 1842
	CLK("omapdss",	"ick",		&dss_ick,	CK_243X),
	CLK("omapdss",	"dss1_fck",	&dss1_fck,	CK_243X),
	CLK("omapdss",	"dss2_fck",	&dss2_fck,	CK_243X),
	CLK("omapdss",	"tv_fck",	&dss_54m_fck,	CK_243X),
1843
	/* L3 domain clocks */
1844 1845 1846
	CLK(NULL,	"core_l3_ck",	&core_l3_ck,	CK_243X),
	CLK(NULL,	"ssi_fck",	&ssi_ssr_sst_fck, CK_243X),
	CLK(NULL,	"usb_l4_ick",	&usb_l4_ick,	CK_243X),
1847
	/* L4 domain clocks */
1848 1849
	CLK(NULL,	"l4_ck",	&l4_ck,		CK_243X),
	CLK(NULL,	"ssi_l4_ick",	&ssi_l4_ick,	CK_243X),
1850
	/* virtual meta-group clock */
1851
	CLK(NULL,	"virt_prcm_set", &virt_prcm_set, CK_243X),
1852
	/* general l4 interface ck, multi-parent functional clk */
1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880
	CLK(NULL,	"gpt1_ick",	&gpt1_ick,	CK_243X),
	CLK(NULL,	"gpt1_fck",	&gpt1_fck,	CK_243X),
	CLK(NULL,	"gpt2_ick",	&gpt2_ick,	CK_243X),
	CLK(NULL,	"gpt2_fck",	&gpt2_fck,	CK_243X),
	CLK(NULL,	"gpt3_ick",	&gpt3_ick,	CK_243X),
	CLK(NULL,	"gpt3_fck",	&gpt3_fck,	CK_243X),
	CLK(NULL,	"gpt4_ick",	&gpt4_ick,	CK_243X),
	CLK(NULL,	"gpt4_fck",	&gpt4_fck,	CK_243X),
	CLK(NULL,	"gpt5_ick",	&gpt5_ick,	CK_243X),
	CLK(NULL,	"gpt5_fck",	&gpt5_fck,	CK_243X),
	CLK(NULL,	"gpt6_ick",	&gpt6_ick,	CK_243X),
	CLK(NULL,	"gpt6_fck",	&gpt6_fck,	CK_243X),
	CLK(NULL,	"gpt7_ick",	&gpt7_ick,	CK_243X),
	CLK(NULL,	"gpt7_fck",	&gpt7_fck,	CK_243X),
	CLK(NULL,	"gpt8_ick",	&gpt8_ick,	CK_243X),
	CLK(NULL,	"gpt8_fck",	&gpt8_fck,	CK_243X),
	CLK(NULL,	"gpt9_ick",	&gpt9_ick,	CK_243X),
	CLK(NULL,	"gpt9_fck",	&gpt9_fck,	CK_243X),
	CLK(NULL,	"gpt10_ick",	&gpt10_ick,	CK_243X),
	CLK(NULL,	"gpt10_fck",	&gpt10_fck,	CK_243X),
	CLK(NULL,	"gpt11_ick",	&gpt11_ick,	CK_243X),
	CLK(NULL,	"gpt11_fck",	&gpt11_fck,	CK_243X),
	CLK(NULL,	"gpt12_ick",	&gpt12_ick,	CK_243X),
	CLK(NULL,	"gpt12_fck",	&gpt12_fck,	CK_243X),
	CLK("omap-mcbsp.1", "ick",	&mcbsp1_ick,	CK_243X),
	CLK("omap-mcbsp.1", "fck",	&mcbsp1_fck,	CK_243X),
	CLK("omap-mcbsp.2", "ick",	&mcbsp2_ick,	CK_243X),
	CLK("omap-mcbsp.2", "fck",	&mcbsp2_fck,	CK_243X),
1881 1882 1883 1884 1885 1886
	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),
1887 1888 1889 1890
	CLK("omap2_mcspi.1", "ick",	&mcspi1_ick,	CK_243X),
	CLK("omap2_mcspi.1", "fck",	&mcspi1_fck,	CK_243X),
	CLK("omap2_mcspi.2", "ick",	&mcspi2_ick,	CK_243X),
	CLK("omap2_mcspi.2", "fck",	&mcspi2_fck,	CK_243X),
1891 1892
	CLK("omap2_mcspi.3", "ick",	&mcspi3_ick,	CK_243X),
	CLK("omap2_mcspi.3", "fck",	&mcspi3_fck,	CK_243X),
1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905
	CLK(NULL,	"uart1_ick",	&uart1_ick,	CK_243X),
	CLK(NULL,	"uart1_fck",	&uart1_fck,	CK_243X),
	CLK(NULL,	"uart2_ick",	&uart2_ick,	CK_243X),
	CLK(NULL,	"uart2_fck",	&uart2_fck,	CK_243X),
	CLK(NULL,	"uart3_ick",	&uart3_ick,	CK_243X),
	CLK(NULL,	"uart3_fck",	&uart3_fck,	CK_243X),
	CLK(NULL,	"gpios_ick",	&gpios_ick,	CK_243X),
	CLK(NULL,	"gpios_fck",	&gpios_fck,	CK_243X),
	CLK("omap_wdt",	"ick",		&mpu_wdt_ick,	CK_243X),
	CLK("omap_wdt",	"fck",		&mpu_wdt_fck,	CK_243X),
	CLK(NULL,	"sync_32k_ick",	&sync_32k_ick,	CK_243X),
	CLK(NULL,	"wdt1_ick",	&wdt1_ick,	CK_243X),
	CLK(NULL,	"omapctrl_ick",	&omapctrl_ick,	CK_243X),
1906
	CLK(NULL,	"icr_ick",	&icr_ick,	CK_243X),
1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918
	CLK("omap24xxcam", "fck",	&cam_fck,	CK_243X),
	CLK("omap24xxcam", "ick",	&cam_ick,	CK_243X),
	CLK(NULL,	"mailboxes_ick", &mailboxes_ick,	CK_243X),
	CLK(NULL,	"wdt4_ick",	&wdt4_ick,	CK_243X),
	CLK(NULL,	"wdt4_fck",	&wdt4_fck,	CK_243X),
	CLK(NULL,	"mspro_ick",	&mspro_ick,	CK_243X),
	CLK(NULL,	"mspro_fck",	&mspro_fck,	CK_243X),
	CLK(NULL,	"fac_ick",	&fac_ick,	CK_243X),
	CLK(NULL,	"fac_fck",	&fac_fck,	CK_243X),
	CLK("omap_hdq.0", "ick",	&hdq_ick,	CK_243X),
	CLK("omap_hdq.1", "fck",	&hdq_fck,	CK_243X),
	CLK("i2c_omap.1", "ick",	&i2c1_ick,	CK_243X),
1919
	CLK("i2c_omap.1", "fck",	&i2chs1_fck,	CK_243X),
1920
	CLK("i2c_omap.2", "ick",	&i2c2_ick,	CK_243X),
1921
	CLK("i2c_omap.2", "fck",	&i2chs2_fck,	CK_243X),
1922 1923 1924
	CLK(NULL,	"gpmc_fck",	&gpmc_fck,	CK_243X),
	CLK(NULL,	"sdma_fck",	&sdma_fck,	CK_243X),
	CLK(NULL,	"sdma_ick",	&sdma_ick,	CK_243X),
1925
	CLK(NULL,	"sdrc_ick",	&sdrc_ick,	CK_243X),
1926
	CLK(NULL,	"des_ick",	&des_ick,	CK_243X),
1927
	CLK("omap-sham",	"ick",	&sha_ick,	CK_243X),
1928
	CLK("omap_rng",	"ick",		&rng_ick,	CK_243X),
1929
	CLK("omap-aes",	"ick",	&aes_ick,	CK_243X),
1930 1931
	CLK(NULL,	"pka_ick",	&pka_ick,	CK_243X),
	CLK(NULL,	"usb_fck",	&usb_fck,	CK_243X),
1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947
	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
 */

1948
int __init omap2430_clk_init(void)
1949 1950 1951 1952
{
	const struct prcm_config *prcm;
	struct omap_clk *c;
	u32 clkrate;
1953 1954 1955 1956 1957

	prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
	cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST);
	cpu_mask = RATE_IN_243X;
	rate_table = omap2430_rate_table;
1958 1959 1960

	clk_init(&omap2_clk_functions);

1961 1962
	for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
	     c++)
1963 1964 1965 1966
		clk_preinit(c->lk.clk);

	osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
	propagate_rate(&osc_ck);
1967
	sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck);
1968 1969
	propagate_rate(&sys_ck);

1970 1971 1972 1973 1974 1975
	for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
	     c++) {
		clkdev_add(&c->lk);
		clk_register(c->lk.clk);
		omap2_init_clk_clkdm(c->lk.clk);
	}
1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990

	/* 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();

1991 1992 1993
	pr_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)) ;
1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007

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