clock44xx_data.c 104.9 KB
Newer Older
1 2 3
/*
 * OMAP4 Clock data
 *
4 5
 * Copyright (C) 2009-2010 Texas Instruments, Inc.
 * Copyright (C) 2009-2010 Nokia Corporation
6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * Paul Walmsley (paul@pwsan.com)
 * Rajendra Nayak (rnayak@ti.com)
 * Benoit Cousson (b-cousson@ti.com)
 *
 * This file is automatically generated from the OMAP hardware databases.
 * We respectfully ask that any modifications to this file be coordinated
 * with the public linux-omap@vger.kernel.org mailing list and the
 * authors above to ensure that the autogeneration scripts are kept
 * up-to-date with the file contents.
 *
 * 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.
20 21 22 23
 *
 * XXX Some of the ES1 clocks have been removed/changed; once support
 * is added for discriminating clocks by ES level, these should be added back
 * in.
24 25 26
 */

#include <linux/kernel.h>
27
#include <linux/list.h>
28
#include <linux/clk.h>
29
#include <linux/io.h>
30 31

#include <plat/hardware.h>
32 33
#include <plat/clkdev_omap.h>

34
#include "iomap.h"
35 36
#include "clock.h"
#include "clock44xx.h"
37 38
#include "cm1_44xx.h"
#include "cm2_44xx.h"
39
#include "cm-regbits-44xx.h"
40
#include "prm44xx.h"
41
#include "prm-regbits-44xx.h"
42
#include "control.h"
43
#include "scrm44xx.h"
44

45 46 47 48
/* OMAP4 modulemode control */
#define OMAP4430_MODULEMODE_HWCTRL			0
#define OMAP4430_MODULEMODE_SWCTRL			1

49 50 51 52 53 54 55 56 57 58 59
/* Root clocks */

static struct clk extalt_clkin_ck = {
	.name		= "extalt_clkin_ck",
	.rate		= 59000000,
	.ops		= &clkops_null,
};

static struct clk pad_clks_ck = {
	.name		= "pad_clks_ck",
	.rate		= 12000000,
60 61 62
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_CLKSEL_ABE,
	.enable_bit	= OMAP4430_PAD_CLKS_GATE_SHIFT,
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
};

static struct clk pad_slimbus_core_clks_ck = {
	.name		= "pad_slimbus_core_clks_ck",
	.rate		= 12000000,
	.ops		= &clkops_null,
};

static struct clk secure_32k_clk_src_ck = {
	.name		= "secure_32k_clk_src_ck",
	.rate		= 32768,
	.ops		= &clkops_null,
};

static struct clk slimbus_clk = {
	.name		= "slimbus_clk",
	.rate		= 12000000,
80 81 82
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_CLKSEL_ABE,
	.enable_bit	= OMAP4430_SLIMBUS_CLK_GATE_SHIFT,
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
};

static struct clk sys_32k_ck = {
	.name		= "sys_32k_ck",
	.rate		= 32768,
	.ops		= &clkops_null,
};

static struct clk virt_12000000_ck = {
	.name		= "virt_12000000_ck",
	.ops		= &clkops_null,
	.rate		= 12000000,
};

static struct clk virt_13000000_ck = {
	.name		= "virt_13000000_ck",
	.ops		= &clkops_null,
	.rate		= 13000000,
};

static struct clk virt_16800000_ck = {
	.name		= "virt_16800000_ck",
	.ops		= &clkops_null,
	.rate		= 16800000,
};

static struct clk virt_19200000_ck = {
	.name		= "virt_19200000_ck",
	.ops		= &clkops_null,
	.rate		= 19200000,
};

static struct clk virt_26000000_ck = {
	.name		= "virt_26000000_ck",
	.ops		= &clkops_null,
	.rate		= 26000000,
};

static struct clk virt_27000000_ck = {
	.name		= "virt_27000000_ck",
	.ops		= &clkops_null,
	.rate		= 27000000,
};

static struct clk virt_38400000_ck = {
	.name		= "virt_38400000_ck",
	.ops		= &clkops_null,
	.rate		= 38400000,
};

static const struct clksel_rate div_1_0_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel_rate div_1_1_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel_rate div_1_2_rates[] = {
	{ .div = 1, .val = 2, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel_rate div_1_3_rates[] = {
	{ .div = 1, .val = 3, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel_rate div_1_4_rates[] = {
	{ .div = 1, .val = 4, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel_rate div_1_5_rates[] = {
	{ .div = 1, .val = 5, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel_rate div_1_6_rates[] = {
	{ .div = 1, .val = 6, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel_rate div_1_7_rates[] = {
	{ .div = 1, .val = 7, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel sys_clkin_sel[] = {
	{ .parent = &virt_12000000_ck, .rates = div_1_1_rates },
	{ .parent = &virt_13000000_ck, .rates = div_1_2_rates },
	{ .parent = &virt_16800000_ck, .rates = div_1_3_rates },
	{ .parent = &virt_19200000_ck, .rates = div_1_4_rates },
	{ .parent = &virt_26000000_ck, .rates = div_1_5_rates },
	{ .parent = &virt_27000000_ck, .rates = div_1_6_rates },
	{ .parent = &virt_38400000_ck, .rates = div_1_7_rates },
	{ .parent = NULL },
};

static struct clk sys_clkin_ck = {
	.name		= "sys_clkin_ck",
	.rate		= 38400000,
	.clksel		= sys_clkin_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_SYS_CLKSEL,
	.clksel_mask	= OMAP4430_SYS_CLKSEL_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

195 196 197 198 199 200
static struct clk tie_low_clock_ck = {
	.name		= "tie_low_clock_ck",
	.rate		= 0,
	.ops		= &clkops_null,
};

201 202
static struct clk utmi_phy_clkout_ck = {
	.name		= "utmi_phy_clkout_ck",
203
	.rate		= 60000000,
204 205 206 207 208
	.ops		= &clkops_null,
};

static struct clk xclk60mhsp1_ck = {
	.name		= "xclk60mhsp1_ck",
209
	.rate		= 60000000,
210 211 212 213 214
	.ops		= &clkops_null,
};

static struct clk xclk60mhsp2_ck = {
	.name		= "xclk60mhsp2_ck",
215
	.rate		= 60000000,
216 217 218 219 220 221 222 223 224 225 226
	.ops		= &clkops_null,
};

static struct clk xclk60motg_ck = {
	.name		= "xclk60motg_ck",
	.rate		= 60000000,
	.ops		= &clkops_null,
};

/* Module clocks and DPLL outputs */

227 228 229
static const struct clksel abe_dpll_bypass_clk_mux_sel[] = {
	{ .parent = &sys_clkin_ck, .rates = div_1_0_rates },
	{ .parent = &sys_32k_ck, .rates = div_1_1_rates },
230 231 232
	{ .parent = NULL },
};

233 234
static struct clk abe_dpll_bypass_clk_mux_ck = {
	.name		= "abe_dpll_bypass_clk_mux_ck",
235 236
	.parent		= &sys_clkin_ck,
	.ops		= &clkops_null,
237
	.recalc		= &followparent_recalc,
238 239 240 241
};

static struct clk abe_dpll_refclk_mux_ck = {
	.name		= "abe_dpll_refclk_mux_ck",
242 243
	.parent		= &sys_clkin_ck,
	.clksel		= abe_dpll_bypass_clk_mux_sel,
244 245 246 247 248 249 250 251 252 253
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_ABE_PLL_REF_CLKSEL,
	.clksel_mask	= OMAP4430_CLKSEL_0_0_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

/* DPLL_ABE */
static struct dpll_data dpll_abe_dd = {
	.mult_div1_reg	= OMAP4430_CM_CLKSEL_DPLL_ABE,
254
	.clk_bypass	= &abe_dpll_bypass_clk_mux_ck,
255 256 257 258 259 260 261 262 263 264
	.clk_ref	= &abe_dpll_refclk_mux_ck,
	.control_reg	= OMAP4430_CM_CLKMODE_DPLL_ABE,
	.modes		= (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
	.autoidle_reg	= OMAP4430_CM_AUTOIDLE_DPLL_ABE,
	.idlest_reg	= OMAP4430_CM_IDLEST_DPLL_ABE,
	.mult_mask	= OMAP4430_DPLL_MULT_MASK,
	.div1_mask	= OMAP4430_DPLL_DIV_MASK,
	.enable_mask	= OMAP4430_DPLL_EN_MASK,
	.autoidle_mask	= OMAP4430_AUTO_DPLL_MODE_MASK,
	.idlest_mask	= OMAP4430_ST_DPLL_CLK_MASK,
265 266
	.max_multiplier	= 2047,
	.max_divider	= 128,
267 268 269 270 271 272 273 274
	.min_divider	= 1,
};


static struct clk dpll_abe_ck = {
	.name		= "dpll_abe_ck",
	.parent		= &abe_dpll_refclk_mux_ck,
	.dpll_data	= &dpll_abe_dd,
275
	.init		= &omap2_init_dpll_parent,
276
	.ops		= &clkops_omap3_noncore_dpll_ops,
277 278
	.recalc		= &omap4_dpll_regm4xen_recalc,
	.round_rate	= &omap4_dpll_regm4xen_round_rate,
279 280 281
	.set_rate	= &omap3_noncore_dpll_set_rate,
};

282 283 284
static struct clk dpll_abe_x2_ck = {
	.name		= "dpll_abe_x2_ck",
	.parent		= &dpll_abe_ck,
285
	.clksel_reg	= OMAP4430_CM_DIV_M2_DPLL_ABE,
286 287
	.flags		= CLOCK_CLKOUTX2,
	.ops		= &clkops_omap4_dpllmx_ops,
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 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
	.recalc		= &omap3_clkoutx2_recalc,
};

static const struct clksel_rate div31_1to31_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 2, .val = 2, .flags = RATE_IN_4430 },
	{ .div = 3, .val = 3, .flags = RATE_IN_4430 },
	{ .div = 4, .val = 4, .flags = RATE_IN_4430 },
	{ .div = 5, .val = 5, .flags = RATE_IN_4430 },
	{ .div = 6, .val = 6, .flags = RATE_IN_4430 },
	{ .div = 7, .val = 7, .flags = RATE_IN_4430 },
	{ .div = 8, .val = 8, .flags = RATE_IN_4430 },
	{ .div = 9, .val = 9, .flags = RATE_IN_4430 },
	{ .div = 10, .val = 10, .flags = RATE_IN_4430 },
	{ .div = 11, .val = 11, .flags = RATE_IN_4430 },
	{ .div = 12, .val = 12, .flags = RATE_IN_4430 },
	{ .div = 13, .val = 13, .flags = RATE_IN_4430 },
	{ .div = 14, .val = 14, .flags = RATE_IN_4430 },
	{ .div = 15, .val = 15, .flags = RATE_IN_4430 },
	{ .div = 16, .val = 16, .flags = RATE_IN_4430 },
	{ .div = 17, .val = 17, .flags = RATE_IN_4430 },
	{ .div = 18, .val = 18, .flags = RATE_IN_4430 },
	{ .div = 19, .val = 19, .flags = RATE_IN_4430 },
	{ .div = 20, .val = 20, .flags = RATE_IN_4430 },
	{ .div = 21, .val = 21, .flags = RATE_IN_4430 },
	{ .div = 22, .val = 22, .flags = RATE_IN_4430 },
	{ .div = 23, .val = 23, .flags = RATE_IN_4430 },
	{ .div = 24, .val = 24, .flags = RATE_IN_4430 },
	{ .div = 25, .val = 25, .flags = RATE_IN_4430 },
	{ .div = 26, .val = 26, .flags = RATE_IN_4430 },
	{ .div = 27, .val = 27, .flags = RATE_IN_4430 },
	{ .div = 28, .val = 28, .flags = RATE_IN_4430 },
	{ .div = 29, .val = 29, .flags = RATE_IN_4430 },
	{ .div = 30, .val = 30, .flags = RATE_IN_4430 },
	{ .div = 31, .val = 31, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel dpll_abe_m2x2_div[] = {
	{ .parent = &dpll_abe_x2_ck, .rates = div31_1to31_rates },
	{ .parent = NULL },
};

331 332
static struct clk dpll_abe_m2x2_ck = {
	.name		= "dpll_abe_m2x2_ck",
333 334 335 336
	.parent		= &dpll_abe_x2_ck,
	.clksel		= dpll_abe_m2x2_div,
	.clksel_reg	= OMAP4430_CM_DIV_M2_DPLL_ABE,
	.clksel_mask	= OMAP4430_DPLL_CLKOUT_DIV_MASK,
337
	.ops		= &clkops_omap4_dpllmx_ops,
338 339 340
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
341 342 343 344 345 346
};

static struct clk abe_24m_fclk = {
	.name		= "abe_24m_fclk",
	.parent		= &dpll_abe_m2x2_ck,
	.ops		= &clkops_null,
347 348
	.fixed_div	= 8,
	.recalc		= &omap_fixed_divisor_recalc,
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
};

static const struct clksel_rate div3_1to4_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 2, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 4, .val = 2, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel abe_clk_div[] = {
	{ .parent = &dpll_abe_m2x2_ck, .rates = div3_1to4_rates },
	{ .parent = NULL },
};

static struct clk abe_clk = {
	.name		= "abe_clk",
	.parent		= &dpll_abe_m2x2_ck,
	.clksel		= abe_clk_div,
	.clksel_reg	= OMAP4430_CM_CLKSEL_ABE,
	.clksel_mask	= OMAP4430_CLKSEL_OPP_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

375 376 377 378 379 380
static const struct clksel_rate div2_1to2_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 2, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397
static const struct clksel aess_fclk_div[] = {
	{ .parent = &abe_clk, .rates = div2_1to2_rates },
	{ .parent = NULL },
};

static struct clk aess_fclk = {
	.name		= "aess_fclk",
	.parent		= &abe_clk,
	.clksel		= aess_fclk_div,
	.clksel_reg	= OMAP4430_CM1_ABE_AESS_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_AESS_FCLK_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

398 399 400 401
static struct clk dpll_abe_m3x2_ck = {
	.name		= "dpll_abe_m3x2_ck",
	.parent		= &dpll_abe_x2_ck,
	.clksel		= dpll_abe_m2x2_div,
402 403
	.clksel_reg	= OMAP4430_CM_DIV_M3_DPLL_ABE,
	.clksel_mask	= OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
404
	.ops		= &clkops_omap4_dpllmx_ops,
405 406 407 408 409 410
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel core_hsd_byp_clk_mux_sel[] = {
411
	{ .parent = &sys_clkin_ck, .rates = div_1_0_rates },
412
	{ .parent = &dpll_abe_m3x2_ck, .rates = div_1_1_rates },
413 414 415 416 417
	{ .parent = NULL },
};

static struct clk core_hsd_byp_clk_mux_ck = {
	.name		= "core_hsd_byp_clk_mux_ck",
418
	.parent		= &sys_clkin_ck,
419 420 421 422 423 424 425 426 427 428 429 430
	.clksel		= core_hsd_byp_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_CLKSEL_DPLL_CORE,
	.clksel_mask	= OMAP4430_DPLL_BYP_CLKSEL_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

/* DPLL_CORE */
static struct dpll_data dpll_core_dd = {
	.mult_div1_reg	= OMAP4430_CM_CLKSEL_DPLL_CORE,
	.clk_bypass	= &core_hsd_byp_clk_mux_ck,
431
	.clk_ref	= &sys_clkin_ck,
432 433 434 435 436 437 438 439 440
	.control_reg	= OMAP4430_CM_CLKMODE_DPLL_CORE,
	.modes		= (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
	.autoidle_reg	= OMAP4430_CM_AUTOIDLE_DPLL_CORE,
	.idlest_reg	= OMAP4430_CM_IDLEST_DPLL_CORE,
	.mult_mask	= OMAP4430_DPLL_MULT_MASK,
	.div1_mask	= OMAP4430_DPLL_DIV_MASK,
	.enable_mask	= OMAP4430_DPLL_EN_MASK,
	.autoidle_mask	= OMAP4430_AUTO_DPLL_MODE_MASK,
	.idlest_mask	= OMAP4430_ST_DPLL_CLK_MASK,
441 442
	.max_multiplier	= 2047,
	.max_divider	= 128,
443 444 445 446 447 448
	.min_divider	= 1,
};


static struct clk dpll_core_ck = {
	.name		= "dpll_core_ck",
449
	.parent		= &sys_clkin_ck,
450
	.dpll_data	= &dpll_core_dd,
451
	.init		= &omap2_init_dpll_parent,
452
	.ops		= &clkops_omap3_core_dpll_ops,
453 454 455
	.recalc		= &omap3_dpll_recalc,
};

456 457 458
static struct clk dpll_core_x2_ck = {
	.name		= "dpll_core_x2_ck",
	.parent		= &dpll_core_ck,
459
	.flags		= CLOCK_CLKOUTX2,
460 461 462 463 464 465
	.ops		= &clkops_null,
	.recalc		= &omap3_clkoutx2_recalc,
};

static const struct clksel dpll_core_m6x2_div[] = {
	{ .parent = &dpll_core_x2_ck, .rates = div31_1to31_rates },
466 467 468
	{ .parent = NULL },
};

469 470 471 472
static struct clk dpll_core_m6x2_ck = {
	.name		= "dpll_core_m6x2_ck",
	.parent		= &dpll_core_x2_ck,
	.clksel		= dpll_core_m6x2_div,
473 474
	.clksel_reg	= OMAP4430_CM_DIV_M6_DPLL_CORE,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
475
	.ops		= &clkops_omap4_dpllmx_ops,
476 477 478 479 480 481 482
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel dbgclk_mux_sel[] = {
	{ .parent = &sys_clkin_ck, .rates = div_1_0_rates },
483
	{ .parent = &dpll_core_m6x2_ck, .rates = div_1_1_rates },
484 485 486 487 488 489 490 491 492 493
	{ .parent = NULL },
};

static struct clk dbgclk_mux_ck = {
	.name		= "dbgclk_mux_ck",
	.parent		= &sys_clkin_ck,
	.ops		= &clkops_null,
	.recalc		= &followparent_recalc,
};

494 495 496 497 498
static const struct clksel dpll_core_m2_div[] = {
	{ .parent = &dpll_core_ck, .rates = div31_1to31_rates },
	{ .parent = NULL },
};

499 500 501
static struct clk dpll_core_m2_ck = {
	.name		= "dpll_core_m2_ck",
	.parent		= &dpll_core_ck,
502
	.clksel		= dpll_core_m2_div,
503 504
	.clksel_reg	= OMAP4430_CM_DIV_M2_DPLL_CORE,
	.clksel_mask	= OMAP4430_DPLL_CLKOUT_DIV_MASK,
505
	.ops		= &clkops_omap4_dpllmx_ops,
506 507 508 509 510 511 512 513 514
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk ddrphy_ck = {
	.name		= "ddrphy_ck",
	.parent		= &dpll_core_m2_ck,
	.ops		= &clkops_null,
515 516
	.fixed_div	= 2,
	.recalc		= &omap_fixed_divisor_recalc,
517 518
};

519 520 521 522
static struct clk dpll_core_m5x2_ck = {
	.name		= "dpll_core_m5x2_ck",
	.parent		= &dpll_core_x2_ck,
	.clksel		= dpll_core_m6x2_div,
523 524
	.clksel_reg	= OMAP4430_CM_DIV_M5_DPLL_CORE,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
525
	.ops		= &clkops_omap4_dpllmx_ops,
526 527 528 529 530 531
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel div_core_div[] = {
532
	{ .parent = &dpll_core_m5x2_ck, .rates = div2_1to2_rates },
533 534 535 536 537
	{ .parent = NULL },
};

static struct clk div_core_ck = {
	.name		= "div_core_ck",
538
	.parent		= &dpll_core_m5x2_ck,
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556
	.clksel		= div_core_div,
	.clksel_reg	= OMAP4430_CM_CLKSEL_CORE,
	.clksel_mask	= OMAP4430_CLKSEL_CORE_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel_rate div4_1to8_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 2, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 4, .val = 2, .flags = RATE_IN_4430 },
	{ .div = 8, .val = 3, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel div_iva_hs_clk_div[] = {
557
	{ .parent = &dpll_core_m5x2_ck, .rates = div4_1to8_rates },
558 559 560 561 562
	{ .parent = NULL },
};

static struct clk div_iva_hs_clk = {
	.name		= "div_iva_hs_clk",
563
	.parent		= &dpll_core_m5x2_ck,
564 565 566 567 568 569 570 571 572 573 574
	.clksel		= div_iva_hs_clk_div,
	.clksel_reg	= OMAP4430_CM_BYPCLK_DPLL_IVA,
	.clksel_mask	= OMAP4430_CLKSEL_0_1_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk div_mpu_hs_clk = {
	.name		= "div_mpu_hs_clk",
575
	.parent		= &dpll_core_m5x2_ck,
576 577 578 579 580 581 582 583 584
	.clksel		= div_iva_hs_clk_div,
	.clksel_reg	= OMAP4430_CM_BYPCLK_DPLL_MPU,
	.clksel_mask	= OMAP4430_CLKSEL_0_1_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

585 586 587 588
static struct clk dpll_core_m4x2_ck = {
	.name		= "dpll_core_m4x2_ck",
	.parent		= &dpll_core_x2_ck,
	.clksel		= dpll_core_m6x2_div,
589 590
	.clksel_reg	= OMAP4430_CM_DIV_M4_DPLL_CORE,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
591
	.ops		= &clkops_omap4_dpllmx_ops,
592 593 594 595 596 597 598
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk dll_clk_div_ck = {
	.name		= "dll_clk_div_ck",
599
	.parent		= &dpll_core_m4x2_ck,
600
	.ops		= &clkops_null,
601 602
	.fixed_div	= 2,
	.recalc		= &omap_fixed_divisor_recalc,
603 604
};

605 606 607 608 609
static const struct clksel dpll_abe_m2_div[] = {
	{ .parent = &dpll_abe_ck, .rates = div31_1to31_rates },
	{ .parent = NULL },
};

610 611 612
static struct clk dpll_abe_m2_ck = {
	.name		= "dpll_abe_m2_ck",
	.parent		= &dpll_abe_ck,
613
	.clksel		= dpll_abe_m2_div,
614 615
	.clksel_reg	= OMAP4430_CM_DIV_M2_DPLL_ABE,
	.clksel_mask	= OMAP4430_DPLL_CLKOUT_DIV_MASK,
616
	.ops		= &clkops_omap4_dpllmx_ops,
617 618 619 620 621
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

622 623 624 625
static struct clk dpll_core_m3x2_ck = {
	.name		= "dpll_core_m3x2_ck",
	.parent		= &dpll_core_x2_ck,
	.clksel		= dpll_core_m6x2_div,
626 627
	.clksel_reg	= OMAP4430_CM_DIV_M3_DPLL_CORE,
	.clksel_mask	= OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
628
	.ops		= &clkops_omap2_dflt,
629 630 631
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
632 633
	.enable_reg	= OMAP4430_CM_DIV_M3_DPLL_CORE,
	.enable_bit	= OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT,
634 635
};

636 637 638 639
static struct clk dpll_core_m7x2_ck = {
	.name		= "dpll_core_m7x2_ck",
	.parent		= &dpll_core_x2_ck,
	.clksel		= dpll_core_m6x2_div,
640 641
	.clksel_reg	= OMAP4430_CM_DIV_M7_DPLL_CORE,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
642
	.ops		= &clkops_omap4_dpllmx_ops,
643 644 645 646 647 648
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel iva_hsd_byp_clk_mux_sel[] = {
649
	{ .parent = &sys_clkin_ck, .rates = div_1_0_rates },
650 651 652 653 654 655
	{ .parent = &div_iva_hs_clk, .rates = div_1_1_rates },
	{ .parent = NULL },
};

static struct clk iva_hsd_byp_clk_mux_ck = {
	.name		= "iva_hsd_byp_clk_mux_ck",
656
	.parent		= &sys_clkin_ck,
657 658 659 660
	.clksel		= iva_hsd_byp_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_CLKSEL_DPLL_IVA,
	.clksel_mask	= OMAP4430_DPLL_BYP_CLKSEL_MASK,
661
	.ops		= &clkops_null,
662
	.recalc		= &omap2_clksel_recalc,
663 664 665 666 667 668
};

/* DPLL_IVA */
static struct dpll_data dpll_iva_dd = {
	.mult_div1_reg	= OMAP4430_CM_CLKSEL_DPLL_IVA,
	.clk_bypass	= &iva_hsd_byp_clk_mux_ck,
669
	.clk_ref	= &sys_clkin_ck,
670 671 672 673 674 675 676 677 678
	.control_reg	= OMAP4430_CM_CLKMODE_DPLL_IVA,
	.modes		= (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
	.autoidle_reg	= OMAP4430_CM_AUTOIDLE_DPLL_IVA,
	.idlest_reg	= OMAP4430_CM_IDLEST_DPLL_IVA,
	.mult_mask	= OMAP4430_DPLL_MULT_MASK,
	.div1_mask	= OMAP4430_DPLL_DIV_MASK,
	.enable_mask	= OMAP4430_DPLL_EN_MASK,
	.autoidle_mask	= OMAP4430_AUTO_DPLL_MODE_MASK,
	.idlest_mask	= OMAP4430_ST_DPLL_CLK_MASK,
679 680
	.max_multiplier	= 2047,
	.max_divider	= 128,
681 682 683 684 685 686
	.min_divider	= 1,
};


static struct clk dpll_iva_ck = {
	.name		= "dpll_iva_ck",
687
	.parent		= &sys_clkin_ck,
688
	.dpll_data	= &dpll_iva_dd,
689
	.init		= &omap2_init_dpll_parent,
690
	.ops		= &clkops_omap3_noncore_dpll_ops,
691 692 693 694 695
	.recalc		= &omap3_dpll_recalc,
	.round_rate	= &omap2_dpll_round_rate,
	.set_rate	= &omap3_noncore_dpll_set_rate,
};

696 697 698
static struct clk dpll_iva_x2_ck = {
	.name		= "dpll_iva_x2_ck",
	.parent		= &dpll_iva_ck,
699
	.flags		= CLOCK_CLKOUTX2,
700 701 702 703 704 705
	.ops		= &clkops_null,
	.recalc		= &omap3_clkoutx2_recalc,
};

static const struct clksel dpll_iva_m4x2_div[] = {
	{ .parent = &dpll_iva_x2_ck, .rates = div31_1to31_rates },
706 707 708
	{ .parent = NULL },
};

709 710 711 712
static struct clk dpll_iva_m4x2_ck = {
	.name		= "dpll_iva_m4x2_ck",
	.parent		= &dpll_iva_x2_ck,
	.clksel		= dpll_iva_m4x2_div,
713 714
	.clksel_reg	= OMAP4430_CM_DIV_M4_DPLL_IVA,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
715
	.ops		= &clkops_omap4_dpllmx_ops,
716 717 718 719 720
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

721 722 723 724
static struct clk dpll_iva_m5x2_ck = {
	.name		= "dpll_iva_m5x2_ck",
	.parent		= &dpll_iva_x2_ck,
	.clksel		= dpll_iva_m4x2_div,
725 726
	.clksel_reg	= OMAP4430_CM_DIV_M5_DPLL_IVA,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
727
	.ops		= &clkops_omap4_dpllmx_ops,
728 729 730 731 732 733 734 735 736
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

/* DPLL_MPU */
static struct dpll_data dpll_mpu_dd = {
	.mult_div1_reg	= OMAP4430_CM_CLKSEL_DPLL_MPU,
	.clk_bypass	= &div_mpu_hs_clk,
737
	.clk_ref	= &sys_clkin_ck,
738 739 740 741 742 743 744 745 746
	.control_reg	= OMAP4430_CM_CLKMODE_DPLL_MPU,
	.modes		= (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
	.autoidle_reg	= OMAP4430_CM_AUTOIDLE_DPLL_MPU,
	.idlest_reg	= OMAP4430_CM_IDLEST_DPLL_MPU,
	.mult_mask	= OMAP4430_DPLL_MULT_MASK,
	.div1_mask	= OMAP4430_DPLL_DIV_MASK,
	.enable_mask	= OMAP4430_DPLL_EN_MASK,
	.autoidle_mask	= OMAP4430_AUTO_DPLL_MODE_MASK,
	.idlest_mask	= OMAP4430_ST_DPLL_CLK_MASK,
747 748
	.max_multiplier	= 2047,
	.max_divider	= 128,
749 750 751 752 753 754
	.min_divider	= 1,
};


static struct clk dpll_mpu_ck = {
	.name		= "dpll_mpu_ck",
755
	.parent		= &sys_clkin_ck,
756
	.dpll_data	= &dpll_mpu_dd,
757
	.init		= &omap2_init_dpll_parent,
758
	.ops		= &clkops_omap3_noncore_dpll_ops,
759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774
	.recalc		= &omap3_dpll_recalc,
	.round_rate	= &omap2_dpll_round_rate,
	.set_rate	= &omap3_noncore_dpll_set_rate,
};

static const struct clksel dpll_mpu_m2_div[] = {
	{ .parent = &dpll_mpu_ck, .rates = div31_1to31_rates },
	{ .parent = NULL },
};

static struct clk dpll_mpu_m2_ck = {
	.name		= "dpll_mpu_m2_ck",
	.parent		= &dpll_mpu_ck,
	.clksel		= dpll_mpu_m2_div,
	.clksel_reg	= OMAP4430_CM_DIV_M2_DPLL_MPU,
	.clksel_mask	= OMAP4430_DPLL_CLKOUT_DIV_MASK,
775
	.ops		= &clkops_omap4_dpllmx_ops,
776 777 778 779 780 781 782
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk per_hs_clk_div_ck = {
	.name		= "per_hs_clk_div_ck",
783
	.parent		= &dpll_abe_m3x2_ck,
784
	.ops		= &clkops_null,
785 786
	.fixed_div	= 2,
	.recalc		= &omap_fixed_divisor_recalc,
787 788 789
};

static const struct clksel per_hsd_byp_clk_mux_sel[] = {
790
	{ .parent = &sys_clkin_ck, .rates = div_1_0_rates },
791 792 793 794 795 796
	{ .parent = &per_hs_clk_div_ck, .rates = div_1_1_rates },
	{ .parent = NULL },
};

static struct clk per_hsd_byp_clk_mux_ck = {
	.name		= "per_hsd_byp_clk_mux_ck",
797
	.parent		= &sys_clkin_ck,
798 799 800 801 802 803 804 805 806 807 808 809
	.clksel		= per_hsd_byp_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_CLKSEL_DPLL_PER,
	.clksel_mask	= OMAP4430_DPLL_BYP_CLKSEL_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

/* DPLL_PER */
static struct dpll_data dpll_per_dd = {
	.mult_div1_reg	= OMAP4430_CM_CLKSEL_DPLL_PER,
	.clk_bypass	= &per_hsd_byp_clk_mux_ck,
810
	.clk_ref	= &sys_clkin_ck,
811 812 813 814 815 816 817 818 819
	.control_reg	= OMAP4430_CM_CLKMODE_DPLL_PER,
	.modes		= (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
	.autoidle_reg	= OMAP4430_CM_AUTOIDLE_DPLL_PER,
	.idlest_reg	= OMAP4430_CM_IDLEST_DPLL_PER,
	.mult_mask	= OMAP4430_DPLL_MULT_MASK,
	.div1_mask	= OMAP4430_DPLL_DIV_MASK,
	.enable_mask	= OMAP4430_DPLL_EN_MASK,
	.autoidle_mask	= OMAP4430_AUTO_DPLL_MODE_MASK,
	.idlest_mask	= OMAP4430_ST_DPLL_CLK_MASK,
820 821
	.max_multiplier	= 2047,
	.max_divider	= 128,
822 823 824 825 826 827
	.min_divider	= 1,
};


static struct clk dpll_per_ck = {
	.name		= "dpll_per_ck",
828
	.parent		= &sys_clkin_ck,
829
	.dpll_data	= &dpll_per_dd,
830
	.init		= &omap2_init_dpll_parent,
831
	.ops		= &clkops_omap3_noncore_dpll_ops,
832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847
	.recalc		= &omap3_dpll_recalc,
	.round_rate	= &omap2_dpll_round_rate,
	.set_rate	= &omap3_noncore_dpll_set_rate,
};

static const struct clksel dpll_per_m2_div[] = {
	{ .parent = &dpll_per_ck, .rates = div31_1to31_rates },
	{ .parent = NULL },
};

static struct clk dpll_per_m2_ck = {
	.name		= "dpll_per_m2_ck",
	.parent		= &dpll_per_ck,
	.clksel		= dpll_per_m2_div,
	.clksel_reg	= OMAP4430_CM_DIV_M2_DPLL_PER,
	.clksel_mask	= OMAP4430_DPLL_CLKOUT_DIV_MASK,
848
	.ops		= &clkops_omap4_dpllmx_ops,
849 850 851 852 853
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

854 855 856
static struct clk dpll_per_x2_ck = {
	.name		= "dpll_per_x2_ck",
	.parent		= &dpll_per_ck,
857
	.clksel_reg	= OMAP4430_CM_DIV_M2_DPLL_PER,
858 859
	.flags		= CLOCK_CLKOUTX2,
	.ops		= &clkops_omap4_dpllmx_ops,
860 861 862 863 864 865 866 867
	.recalc		= &omap3_clkoutx2_recalc,
};

static const struct clksel dpll_per_m2x2_div[] = {
	{ .parent = &dpll_per_x2_ck, .rates = div31_1to31_rates },
	{ .parent = NULL },
};

868 869
static struct clk dpll_per_m2x2_ck = {
	.name		= "dpll_per_m2x2_ck",
870 871 872 873
	.parent		= &dpll_per_x2_ck,
	.clksel		= dpll_per_m2x2_div,
	.clksel_reg	= OMAP4430_CM_DIV_M2_DPLL_PER,
	.clksel_mask	= OMAP4430_DPLL_CLKOUT_DIV_MASK,
874
	.ops		= &clkops_omap4_dpllmx_ops,
875 876 877
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
878 879
};

880 881 882 883
static struct clk dpll_per_m3x2_ck = {
	.name		= "dpll_per_m3x2_ck",
	.parent		= &dpll_per_x2_ck,
	.clksel		= dpll_per_m2x2_div,
884 885
	.clksel_reg	= OMAP4430_CM_DIV_M3_DPLL_PER,
	.clksel_mask	= OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
886
	.ops		= &clkops_omap2_dflt,
887 888 889
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
890 891
	.enable_reg	= OMAP4430_CM_DIV_M3_DPLL_PER,
	.enable_bit	= OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT,
892 893
};

894 895 896 897
static struct clk dpll_per_m4x2_ck = {
	.name		= "dpll_per_m4x2_ck",
	.parent		= &dpll_per_x2_ck,
	.clksel		= dpll_per_m2x2_div,
898 899
	.clksel_reg	= OMAP4430_CM_DIV_M4_DPLL_PER,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
900
	.ops		= &clkops_omap4_dpllmx_ops,
901 902 903 904 905
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

906 907 908 909
static struct clk dpll_per_m5x2_ck = {
	.name		= "dpll_per_m5x2_ck",
	.parent		= &dpll_per_x2_ck,
	.clksel		= dpll_per_m2x2_div,
910 911
	.clksel_reg	= OMAP4430_CM_DIV_M5_DPLL_PER,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
912
	.ops		= &clkops_omap4_dpllmx_ops,
913 914 915 916 917
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

918 919 920 921
static struct clk dpll_per_m6x2_ck = {
	.name		= "dpll_per_m6x2_ck",
	.parent		= &dpll_per_x2_ck,
	.clksel		= dpll_per_m2x2_div,
922 923
	.clksel_reg	= OMAP4430_CM_DIV_M6_DPLL_PER,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
924
	.ops		= &clkops_omap4_dpllmx_ops,
925 926 927 928 929
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

930 931 932 933
static struct clk dpll_per_m7x2_ck = {
	.name		= "dpll_per_m7x2_ck",
	.parent		= &dpll_per_x2_ck,
	.clksel		= dpll_per_m2x2_div,
934 935
	.clksel_reg	= OMAP4430_CM_DIV_M7_DPLL_PER,
	.clksel_mask	= OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
936
	.ops		= &clkops_omap4_dpllmx_ops,
937 938 939 940 941 942 943
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk usb_hs_clk_div_ck = {
	.name		= "usb_hs_clk_div_ck",
944
	.parent		= &dpll_abe_m3x2_ck,
945
	.ops		= &clkops_null,
946 947
	.fixed_div	= 3,
	.recalc		= &omap_fixed_divisor_recalc,
948 949 950 951 952 953
};

/* DPLL_USB */
static struct dpll_data dpll_usb_dd = {
	.mult_div1_reg	= OMAP4430_CM_CLKSEL_DPLL_USB,
	.clk_bypass	= &usb_hs_clk_div_ck,
954
	.flags		= DPLL_J_TYPE,
955
	.clk_ref	= &sys_clkin_ck,
956 957 958 959 960 961 962 963 964
	.control_reg	= OMAP4430_CM_CLKMODE_DPLL_USB,
	.modes		= (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
	.autoidle_reg	= OMAP4430_CM_AUTOIDLE_DPLL_USB,
	.idlest_reg	= OMAP4430_CM_IDLEST_DPLL_USB,
	.mult_mask	= OMAP4430_DPLL_MULT_MASK,
	.div1_mask	= OMAP4430_DPLL_DIV_MASK,
	.enable_mask	= OMAP4430_DPLL_EN_MASK,
	.autoidle_mask	= OMAP4430_AUTO_DPLL_MODE_MASK,
	.idlest_mask	= OMAP4430_ST_DPLL_CLK_MASK,
965
	.sddiv_mask	= OMAP4430_DPLL_SD_DIV_MASK,
966 967
	.max_multiplier	= 4095,
	.max_divider	= 256,
968 969 970 971 972 973
	.min_divider	= 1,
};


static struct clk dpll_usb_ck = {
	.name		= "dpll_usb_ck",
974
	.parent		= &sys_clkin_ck,
975
	.dpll_data	= &dpll_usb_dd,
976
	.init		= &omap2_init_dpll_parent,
977
	.ops		= &clkops_omap3_noncore_dpll_ops,
978 979 980 981 982 983 984 985
	.recalc		= &omap3_dpll_recalc,
	.round_rate	= &omap2_dpll_round_rate,
	.set_rate	= &omap3_noncore_dpll_set_rate,
};

static struct clk dpll_usb_clkdcoldo_ck = {
	.name		= "dpll_usb_clkdcoldo_ck",
	.parent		= &dpll_usb_ck,
986
	.clksel_reg	= OMAP4430_CM_CLKDCOLDO_DPLL_USB,
987
	.ops		= &clkops_omap4_dpllmx_ops,
988 989 990 991 992 993 994 995 996 997 998 999 1000 1001
	.recalc		= &followparent_recalc,
};

static const struct clksel dpll_usb_m2_div[] = {
	{ .parent = &dpll_usb_ck, .rates = div31_1to31_rates },
	{ .parent = NULL },
};

static struct clk dpll_usb_m2_ck = {
	.name		= "dpll_usb_m2_ck",
	.parent		= &dpll_usb_ck,
	.clksel		= dpll_usb_m2_div,
	.clksel_reg	= OMAP4430_CM_DIV_M2_DPLL_USB,
	.clksel_mask	= OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK,
1002
	.ops		= &clkops_omap4_dpllmx_ops,
1003 1004 1005 1006 1007 1008 1009
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel ducati_clk_mux_sel[] = {
	{ .parent = &div_core_ck, .rates = div_1_0_rates },
1010
	{ .parent = &dpll_per_m6x2_ck, .rates = div_1_1_rates },
1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028
	{ .parent = NULL },
};

static struct clk ducati_clk_mux_ck = {
	.name		= "ducati_clk_mux_ck",
	.parent		= &div_core_ck,
	.clksel		= ducati_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_CLKSEL_DUCATI_ISS_ROOT,
	.clksel_mask	= OMAP4430_CLKSEL_0_0_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk func_12m_fclk = {
	.name		= "func_12m_fclk",
	.parent		= &dpll_per_m2x2_ck,
	.ops		= &clkops_null,
1029 1030
	.fixed_div	= 16,
	.recalc		= &omap_fixed_divisor_recalc,
1031 1032 1033 1034 1035 1036
};

static struct clk func_24m_clk = {
	.name		= "func_24m_clk",
	.parent		= &dpll_per_m2_ck,
	.ops		= &clkops_null,
1037 1038
	.fixed_div	= 4,
	.recalc		= &omap_fixed_divisor_recalc,
1039 1040 1041 1042 1043 1044
};

static struct clk func_24mc_fclk = {
	.name		= "func_24mc_fclk",
	.parent		= &dpll_per_m2x2_ck,
	.ops		= &clkops_null,
1045 1046
	.fixed_div	= 8,
	.recalc		= &omap_fixed_divisor_recalc,
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075
};

static const struct clksel_rate div2_4to8_rates[] = {
	{ .div = 4, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 8, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel func_48m_fclk_div[] = {
	{ .parent = &dpll_per_m2x2_ck, .rates = div2_4to8_rates },
	{ .parent = NULL },
};

static struct clk func_48m_fclk = {
	.name		= "func_48m_fclk",
	.parent		= &dpll_per_m2x2_ck,
	.clksel		= func_48m_fclk_div,
	.clksel_reg	= OMAP4430_CM_SCALE_FCLK,
	.clksel_mask	= OMAP4430_SCALE_FCLK_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk func_48mc_fclk = {
	.name		= "func_48mc_fclk",
	.parent		= &dpll_per_m2x2_ck,
	.ops		= &clkops_null,
1076 1077
	.fixed_div	= 4,
	.recalc		= &omap_fixed_divisor_recalc,
1078 1079 1080 1081 1082 1083 1084 1085 1086
};

static const struct clksel_rate div2_2to4_rates[] = {
	{ .div = 2, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 4, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel func_64m_fclk_div[] = {
1087
	{ .parent = &dpll_per_m4x2_ck, .rates = div2_2to4_rates },
1088 1089 1090 1091 1092
	{ .parent = NULL },
};

static struct clk func_64m_fclk = {
	.name		= "func_64m_fclk",
1093
	.parent		= &dpll_per_m4x2_ck,
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180
	.clksel		= func_64m_fclk_div,
	.clksel_reg	= OMAP4430_CM_SCALE_FCLK,
	.clksel_mask	= OMAP4430_SCALE_FCLK_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel func_96m_fclk_div[] = {
	{ .parent = &dpll_per_m2x2_ck, .rates = div2_2to4_rates },
	{ .parent = NULL },
};

static struct clk func_96m_fclk = {
	.name		= "func_96m_fclk",
	.parent		= &dpll_per_m2x2_ck,
	.clksel		= func_96m_fclk_div,
	.clksel_reg	= OMAP4430_CM_SCALE_FCLK,
	.clksel_mask	= OMAP4430_SCALE_FCLK_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel_rate div2_1to8_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 8, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel init_60m_fclk_div[] = {
	{ .parent = &dpll_usb_m2_ck, .rates = div2_1to8_rates },
	{ .parent = NULL },
};

static struct clk init_60m_fclk = {
	.name		= "init_60m_fclk",
	.parent		= &dpll_usb_m2_ck,
	.clksel		= init_60m_fclk_div,
	.clksel_reg	= OMAP4430_CM_CLKSEL_USB_60MHZ,
	.clksel_mask	= OMAP4430_CLKSEL_0_0_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel l3_div_div[] = {
	{ .parent = &div_core_ck, .rates = div2_1to2_rates },
	{ .parent = NULL },
};

static struct clk l3_div_ck = {
	.name		= "l3_div_ck",
	.parent		= &div_core_ck,
	.clksel		= l3_div_div,
	.clksel_reg	= OMAP4430_CM_CLKSEL_CORE,
	.clksel_mask	= OMAP4430_CLKSEL_L3_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel l4_div_div[] = {
	{ .parent = &l3_div_ck, .rates = div2_1to2_rates },
	{ .parent = NULL },
};

static struct clk l4_div_ck = {
	.name		= "l4_div_ck",
	.parent		= &l3_div_ck,
	.clksel		= l4_div_div,
	.clksel_reg	= OMAP4430_CM_CLKSEL_CORE,
	.clksel_mask	= OMAP4430_CLKSEL_L4_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk lp_clk_div_ck = {
	.name		= "lp_clk_div_ck",
	.parent		= &dpll_abe_m2x2_ck,
	.ops		= &clkops_null,
1181 1182
	.fixed_div	= 16,
	.recalc		= &omap_fixed_divisor_recalc,
1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201
};

static const struct clksel l4_wkup_clk_mux_sel[] = {
	{ .parent = &sys_clkin_ck, .rates = div_1_0_rates },
	{ .parent = &lp_clk_div_ck, .rates = div_1_1_rates },
	{ .parent = NULL },
};

static struct clk l4_wkup_clk_mux_ck = {
	.name		= "l4_wkup_clk_mux_ck",
	.parent		= &sys_clkin_ck,
	.clksel		= l4_wkup_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L4_WKUP_CLKSEL,
	.clksel_mask	= OMAP4430_CLKSEL_0_0_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212
static const struct clksel_rate div2_2to1_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 2, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel ocp_abe_iclk_div[] = {
	{ .parent = &aess_fclk, .rates = div2_2to1_rates },
	{ .parent = NULL },
};

1213 1214 1215 1216 1217 1218 1219 1220
static struct clk mpu_periphclk = {
	.name		= "mpu_periphclk",
	.parent		= &dpll_mpu_ck,
	.ops		= &clkops_null,
	.fixed_div	= 2,
	.recalc		= &omap_fixed_divisor_recalc,
};

1221 1222 1223
static struct clk ocp_abe_iclk = {
	.name		= "ocp_abe_iclk",
	.parent		= &aess_fclk,
1224 1225 1226
	.clksel		= ocp_abe_iclk_div,
	.clksel_reg	= OMAP4430_CM1_ABE_AESS_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_AESS_FCLK_MASK,
1227
	.ops		= &clkops_null,
1228
	.recalc		= &omap2_clksel_recalc,
1229 1230 1231 1232 1233 1234 1235 1236 1237 1238
};

static struct clk per_abe_24m_fclk = {
	.name		= "per_abe_24m_fclk",
	.parent		= &dpll_abe_m2_ck,
	.ops		= &clkops_null,
	.fixed_div	= 4,
	.recalc		= &omap_fixed_divisor_recalc,
};

1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257
static const struct clksel per_abe_nc_fclk_div[] = {
	{ .parent = &dpll_abe_m2_ck, .rates = div2_1to2_rates },
	{ .parent = NULL },
};

static struct clk per_abe_nc_fclk = {
	.name		= "per_abe_nc_fclk",
	.parent		= &dpll_abe_m2_ck,
	.clksel		= per_abe_nc_fclk_div,
	.clksel_reg	= OMAP4430_CM_SCALE_FCLK,
	.clksel_mask	= OMAP4430_SCALE_FCLK_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel pmd_stm_clock_mux_sel[] = {
	{ .parent = &sys_clkin_ck, .rates = div_1_0_rates },
1258
	{ .parent = &dpll_core_m6x2_ck, .rates = div_1_1_rates },
1259
	{ .parent = &tie_low_clock_ck, .rates = div_1_2_rates },
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276
	{ .parent = NULL },
};

static struct clk pmd_stm_clock_mux_ck = {
	.name		= "pmd_stm_clock_mux_ck",
	.parent		= &sys_clkin_ck,
	.ops		= &clkops_null,
	.recalc		= &followparent_recalc,
};

static struct clk pmd_trace_clk_mux_ck = {
	.name		= "pmd_trace_clk_mux_ck",
	.parent		= &sys_clkin_ck,
	.ops		= &clkops_null,
	.recalc		= &followparent_recalc,
};

1277 1278 1279 1280 1281
static const struct clksel syc_clk_div_div[] = {
	{ .parent = &sys_clkin_ck, .rates = div2_1to2_rates },
	{ .parent = NULL },
};

1282 1283 1284
static struct clk syc_clk_div_ck = {
	.name		= "syc_clk_div_ck",
	.parent		= &sys_clkin_ck,
1285
	.clksel		= syc_clk_div_div,
1286 1287 1288 1289 1290 1291 1292 1293 1294 1295
	.clksel_reg	= OMAP4430_CM_ABE_DSS_SYS_CLKSEL,
	.clksel_mask	= OMAP4430_CLKSEL_0_0_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

/* Leaf clocks controlled by modules */

1296 1297
static struct clk aes1_fck = {
	.name		= "aes1_fck",
1298 1299 1300 1301 1302 1303 1304 1305
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4SEC_AES1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_secure_clkdm",
	.parent		= &l3_div_ck,
	.recalc		= &followparent_recalc,
};

1306 1307
static struct clk aes2_fck = {
	.name		= "aes2_fck",
1308 1309 1310 1311 1312 1313 1314 1315
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4SEC_AES2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_secure_clkdm",
	.parent		= &l3_div_ck,
	.recalc		= &followparent_recalc,
};

1316 1317
static struct clk aess_fck = {
	.name		= "aess_fck",
1318 1319 1320 1321 1322 1323 1324 1325
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM1_ABE_AESS_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
	.parent		= &aess_fclk,
	.recalc		= &followparent_recalc,
};

1326 1327 1328 1329 1330 1331 1332 1333 1334 1335
static struct clk bandgap_fclk = {
	.name		= "bandgap_fclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT,
	.clkdm_name	= "l4_wkup_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

1336 1337
static struct clk des3des_fck = {
	.name		= "des3des_fck",
1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4SEC_DES3DES_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_secure_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
};

static const struct clksel dmic_sync_mux_sel[] = {
	{ .parent = &abe_24m_fclk, .rates = div_1_0_rates },
	{ .parent = &syc_clk_div_ck, .rates = div_1_1_rates },
	{ .parent = &func_24m_clk, .rates = div_1_2_rates },
	{ .parent = NULL },
};

static struct clk dmic_sync_mux_ck = {
	.name		= "dmic_sync_mux_ck",
	.parent		= &abe_24m_fclk,
	.clksel		= dmic_sync_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_DMIC_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel func_dmic_abe_gfclk_sel[] = {
	{ .parent = &dmic_sync_mux_ck, .rates = div_1_0_rates },
	{ .parent = &pad_clks_ck, .rates = div_1_1_rates },
	{ .parent = &slimbus_clk, .rates = div_1_2_rates },
	{ .parent = NULL },
};

1371 1372 1373
/* Merged func_dmic_abe_gfclk into dmic */
static struct clk dmic_fck = {
	.name		= "dmic_fck",
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385
	.parent		= &dmic_sync_mux_ck,
	.clksel		= func_dmic_abe_gfclk_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_DMIC_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_SOURCE_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM1_ABE_DMIC_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
};

1386 1387 1388 1389 1390 1391
static struct clk dsp_fck = {
	.name		= "dsp_fck",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_TESLA_TESLA_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "tesla_clkdm",
1392
	.parent		= &dpll_iva_m4x2_ck,
1393 1394 1395
	.recalc		= &followparent_recalc,
};

1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421
static struct clk dss_sys_clk = {
	.name		= "dss_sys_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_DSS_DSS_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT,
	.clkdm_name	= "l3_dss_clkdm",
	.parent		= &syc_clk_div_ck,
	.recalc		= &followparent_recalc,
};

static struct clk dss_tv_clk = {
	.name		= "dss_tv_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_DSS_DSS_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_TV_CLK_SHIFT,
	.clkdm_name	= "l3_dss_clkdm",
	.parent		= &extalt_clkin_ck,
	.recalc		= &followparent_recalc,
};

static struct clk dss_dss_clk = {
	.name		= "dss_dss_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_DSS_DSS_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_DSSCLK_SHIFT,
	.clkdm_name	= "l3_dss_clkdm",
1422
	.parent		= &dpll_per_m5x2_ck,
1423 1424 1425
	.recalc		= &followparent_recalc,
};

1426
static const struct clksel_rate div3_8to32_rates[] = {
1427 1428 1429
	{ .div = 8, .val = 0, .flags = RATE_IN_4460 },
	{ .div = 16, .val = 1, .flags = RATE_IN_4460 },
	{ .div = 32, .val = 2, .flags = RATE_IN_4460 },
1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459
	{ .div = 0 },
};

static const struct clksel div_ts_div[] = {
	{ .parent = &l4_wkup_clk_mux_ck, .rates = div3_8to32_rates },
	{ .parent = NULL },
};

static struct clk div_ts_ck = {
	.name		= "div_ts_ck",
	.parent		= &l4_wkup_clk_mux_ck,
	.clksel		= div_ts_div,
	.clksel_reg	= OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_24_25_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk bandgap_ts_fclk = {
	.name		= "bandgap_ts_fclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
	.enable_bit	= OMAP4460_OPTFCLKEN_TS_FCLK_SHIFT,
	.clkdm_name	= "l4_wkup_clkdm",
	.parent		= &div_ts_ck,
	.recalc		= &followparent_recalc,
};

1460 1461 1462 1463 1464 1465 1466 1467 1468 1469
static struct clk dss_48mhz_clk = {
	.name		= "dss_48mhz_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_DSS_DSS_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT,
	.clkdm_name	= "l3_dss_clkdm",
	.parent		= &func_48mc_fclk,
	.recalc		= &followparent_recalc,
};

1470 1471
static struct clk dss_fck = {
	.name		= "dss_fck",
1472 1473 1474 1475 1476 1477 1478 1479
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_DSS_DSS_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l3_dss_clkdm",
	.parent		= &l3_div_ck,
	.recalc		= &followparent_recalc,
};

1480 1481
static struct clk efuse_ctrl_cust_fck = {
	.name		= "efuse_ctrl_cust_fck",
1482
	.ops		= &clkops_omap2_dflt,
1483 1484 1485 1486
	.enable_reg	= OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_cefuse_clkdm",
	.parent		= &sys_clkin_ck,
1487 1488 1489
	.recalc		= &followparent_recalc,
};

1490 1491
static struct clk emif1_fck = {
	.name		= "emif1_fck",
1492 1493 1494
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
1495
	.flags		= ENABLE_ON_INIT,
1496 1497 1498 1499 1500
	.clkdm_name	= "l3_emif_clkdm",
	.parent		= &ddrphy_ck,
	.recalc		= &followparent_recalc,
};

1501 1502
static struct clk emif2_fck = {
	.name		= "emif2_fck",
1503 1504 1505
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
1506
	.flags		= ENABLE_ON_INIT,
1507 1508 1509 1510 1511 1512
	.clkdm_name	= "l3_emif_clkdm",
	.parent		= &ddrphy_ck,
	.recalc		= &followparent_recalc,
};

static const struct clksel fdif_fclk_div[] = {
1513
	{ .parent = &dpll_per_m4x2_ck, .rates = div3_1to4_rates },
1514 1515 1516
	{ .parent = NULL },
};

1517 1518 1519
/* Merged fdif_fclk into fdif */
static struct clk fdif_fck = {
	.name		= "fdif_fck",
1520
	.parent		= &dpll_per_m4x2_ck,
1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532
	.clksel		= fdif_fclk_div,
	.clksel_reg	= OMAP4430_CM_CAM_FDIF_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_FCLK_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
	.enable_reg	= OMAP4430_CM_CAM_FDIF_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "iss_clkdm",
};

1533 1534
static struct clk fpka_fck = {
	.name		= "fpka_fck",
1535
	.ops		= &clkops_omap2_dflt,
1536
	.enable_reg	= OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL,
1537
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
1538 1539 1540
	.clkdm_name	= "l4_secure_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
1541 1542
};

1543 1544 1545 1546 1547 1548 1549 1550 1551 1552
static struct clk gpio1_dbclk = {
	.name		= "gpio1_dbclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
	.clkdm_name	= "l4_wkup_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

1553 1554
static struct clk gpio1_ick = {
	.name		= "gpio1_ick",
1555 1556 1557 1558 1559 1560 1561 1562
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l4_wkup_clkdm",
	.parent		= &l4_wkup_clk_mux_ck,
	.recalc		= &followparent_recalc,
};

1563 1564 1565 1566 1567 1568 1569 1570 1571 1572
static struct clk gpio2_dbclk = {
	.name		= "gpio2_dbclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO2_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

1573 1574
static struct clk gpio2_ick = {
	.name		= "gpio2_ick",
1575 1576 1577 1578 1579 1580 1581 1582
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
};

1583 1584 1585 1586 1587 1588 1589 1590 1591 1592
static struct clk gpio3_dbclk = {
	.name		= "gpio3_dbclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

1593 1594
static struct clk gpio3_ick = {
	.name		= "gpio3_ick",
1595 1596 1597 1598 1599 1600 1601 1602
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
};

1603 1604 1605 1606 1607 1608 1609 1610 1611 1612
static struct clk gpio4_dbclk = {
	.name		= "gpio4_dbclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO4_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

1613 1614
static struct clk gpio4_ick = {
	.name		= "gpio4_ick",
1615 1616 1617 1618 1619 1620 1621 1622
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO4_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
};

1623 1624 1625 1626 1627 1628 1629 1630 1631 1632
static struct clk gpio5_dbclk = {
	.name		= "gpio5_dbclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO5_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

1633 1634
static struct clk gpio5_ick = {
	.name		= "gpio5_ick",
1635 1636 1637 1638 1639 1640 1641 1642
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO5_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
};

1643 1644 1645 1646 1647 1648 1649 1650 1651 1652
static struct clk gpio6_dbclk = {
	.name		= "gpio6_dbclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO6_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_DBCLK_SHIFT,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

1653 1654
static struct clk gpio6_ick = {
	.name		= "gpio6_ick",
1655 1656 1657 1658 1659 1660 1661 1662
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_GPIO6_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
};

1663 1664
static struct clk gpmc_ick = {
	.name		= "gpmc_ick",
1665 1666 1667
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3_2_GPMC_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
1668
	.flags		= ENABLE_ON_INIT,
1669 1670 1671 1672 1673
	.clkdm_name	= "l3_2_clkdm",
	.parent		= &l3_div_ck,
	.recalc		= &followparent_recalc,
};

1674
static const struct clksel sgx_clk_mux_sel[] = {
1675 1676
	{ .parent = &dpll_core_m7x2_ck, .rates = div_1_0_rates },
	{ .parent = &dpll_per_m7x2_ck, .rates = div_1_1_rates },
1677 1678 1679
	{ .parent = NULL },
};

1680 1681 1682
/* Merged sgx_clk_mux into gpu */
static struct clk gpu_fck = {
	.name		= "gpu_fck",
1683
	.parent		= &dpll_core_m7x2_ck,
1684
	.clksel		= sgx_clk_mux_sel,
1685
	.init		= &omap2_init_clksel_parent,
1686 1687
	.clksel_reg	= OMAP4430_CM_GFX_GFX_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_SGX_FCLK_MASK,
1688 1689
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
1690
	.enable_reg	= OMAP4430_CM_GFX_GFX_CLKCTRL,
1691
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
1692
	.clkdm_name	= "l3_gfx_clkdm",
1693 1694
};

1695 1696
static struct clk hdq1w_fck = {
	.name		= "hdq1w_fck",
1697 1698 1699 1700 1701 1702 1703 1704
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_HDQ1W_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_12m_fclk,
	.recalc		= &followparent_recalc,
};

1705 1706 1707 1708 1709
static const struct clksel hsi_fclk_div[] = {
	{ .parent = &dpll_per_m2x2_ck, .rates = div3_1to4_rates },
	{ .parent = NULL },
};

1710
/* Merged hsi_fclk into hsi */
1711 1712
static struct clk hsi_fck = {
	.name		= "hsi_fck",
1713
	.parent		= &dpll_per_m2x2_ck,
1714
	.clksel		= hsi_fclk_div,
1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725
	.clksel_reg	= OMAP4430_CM_L3INIT_HSI_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_24_25_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
	.enable_reg	= OMAP4430_CM_L3INIT_HSI_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l3_init_clkdm",
};

1726 1727
static struct clk i2c1_fck = {
	.name		= "i2c1_fck",
1728 1729 1730 1731 1732 1733 1734 1735
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_I2C1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_96m_fclk,
	.recalc		= &followparent_recalc,
};

1736 1737
static struct clk i2c2_fck = {
	.name		= "i2c2_fck",
1738 1739 1740 1741 1742 1743 1744 1745
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_I2C2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_96m_fclk,
	.recalc		= &followparent_recalc,
};

1746 1747
static struct clk i2c3_fck = {
	.name		= "i2c3_fck",
1748 1749 1750 1751 1752 1753 1754 1755
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_I2C3_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_96m_fclk,
	.recalc		= &followparent_recalc,
};

1756 1757
static struct clk i2c4_fck = {
	.name		= "i2c4_fck",
1758 1759 1760 1761 1762 1763 1764 1765
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_I2C4_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_96m_fclk,
	.recalc		= &followparent_recalc,
};

1766 1767 1768 1769 1770 1771 1772 1773 1774 1775
static struct clk ipu_fck = {
	.name		= "ipu_fck",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_DUCATI_DUCATI_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "ducati_clkdm",
	.parent		= &ducati_clk_mux_ck,
	.recalc		= &followparent_recalc,
};

1776 1777 1778 1779 1780 1781 1782 1783 1784 1785
static struct clk iss_ctrlclk = {
	.name		= "iss_ctrlclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_CAM_ISS_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT,
	.clkdm_name	= "iss_clkdm",
	.parent		= &func_96m_fclk,
	.recalc		= &followparent_recalc,
};

1786 1787
static struct clk iss_fck = {
	.name		= "iss_fck",
1788 1789 1790 1791 1792 1793 1794 1795
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_CAM_ISS_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "iss_clkdm",
	.parent		= &ducati_clk_mux_ck,
	.recalc		= &followparent_recalc,
};

1796 1797
static struct clk iva_fck = {
	.name		= "iva_fck",
1798 1799 1800 1801
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_IVAHD_IVAHD_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "ivahd_clkdm",
1802
	.parent		= &dpll_iva_m5x2_ck,
1803 1804 1805
	.recalc		= &followparent_recalc,
};

1806 1807
static struct clk kbd_fck = {
	.name		= "kbd_fck",
1808 1809 1810 1811 1812 1813 1814 1815
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_wkup_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

1816 1817
static struct clk l3_instr_ick = {
	.name		= "l3_instr_ick",
1818 1819 1820
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
1821
	.flags		= ENABLE_ON_INIT,
1822
	.clkdm_name	= "l3_instr_clkdm",
1823 1824 1825 1826
	.parent		= &l3_div_ck,
	.recalc		= &followparent_recalc,
};

1827 1828
static struct clk l3_main_3_ick = {
	.name		= "l3_main_3_ick",
1829 1830 1831
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INSTR_L3_3_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
1832
	.flags		= ENABLE_ON_INIT,
1833
	.clkdm_name	= "l3_instr_clkdm",
1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855
	.parent		= &l3_div_ck,
	.recalc		= &followparent_recalc,
};

static struct clk mcasp_sync_mux_ck = {
	.name		= "mcasp_sync_mux_ck",
	.parent		= &abe_24m_fclk,
	.clksel		= dmic_sync_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_MCASP_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel func_mcasp_abe_gfclk_sel[] = {
	{ .parent = &mcasp_sync_mux_ck, .rates = div_1_0_rates },
	{ .parent = &pad_clks_ck, .rates = div_1_1_rates },
	{ .parent = &slimbus_clk, .rates = div_1_2_rates },
	{ .parent = NULL },
};

1856 1857 1858
/* Merged func_mcasp_abe_gfclk into mcasp */
static struct clk mcasp_fck = {
	.name		= "mcasp_fck",
1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888
	.parent		= &mcasp_sync_mux_ck,
	.clksel		= func_mcasp_abe_gfclk_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_MCASP_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_SOURCE_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM1_ABE_MCASP_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
};

static struct clk mcbsp1_sync_mux_ck = {
	.name		= "mcbsp1_sync_mux_ck",
	.parent		= &abe_24m_fclk,
	.clksel		= dmic_sync_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel func_mcbsp1_gfclk_sel[] = {
	{ .parent = &mcbsp1_sync_mux_ck, .rates = div_1_0_rates },
	{ .parent = &pad_clks_ck, .rates = div_1_1_rates },
	{ .parent = &slimbus_clk, .rates = div_1_2_rates },
	{ .parent = NULL },
};

1889 1890 1891
/* Merged func_mcbsp1_gfclk into mcbsp1 */
static struct clk mcbsp1_fck = {
	.name		= "mcbsp1_fck",
1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921
	.parent		= &mcbsp1_sync_mux_ck,
	.clksel		= func_mcbsp1_gfclk_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_SOURCE_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
};

static struct clk mcbsp2_sync_mux_ck = {
	.name		= "mcbsp2_sync_mux_ck",
	.parent		= &abe_24m_fclk,
	.clksel		= dmic_sync_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel func_mcbsp2_gfclk_sel[] = {
	{ .parent = &mcbsp2_sync_mux_ck, .rates = div_1_0_rates },
	{ .parent = &pad_clks_ck, .rates = div_1_1_rates },
	{ .parent = &slimbus_clk, .rates = div_1_2_rates },
	{ .parent = NULL },
};

1922 1923 1924
/* Merged func_mcbsp2_gfclk into mcbsp2 */
static struct clk mcbsp2_fck = {
	.name		= "mcbsp2_fck",
1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954
	.parent		= &mcbsp2_sync_mux_ck,
	.clksel		= func_mcbsp2_gfclk_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_SOURCE_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
};

static struct clk mcbsp3_sync_mux_ck = {
	.name		= "mcbsp3_sync_mux_ck",
	.parent		= &abe_24m_fclk,
	.clksel		= dmic_sync_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel func_mcbsp3_gfclk_sel[] = {
	{ .parent = &mcbsp3_sync_mux_ck, .rates = div_1_0_rates },
	{ .parent = &pad_clks_ck, .rates = div_1_1_rates },
	{ .parent = &slimbus_clk, .rates = div_1_2_rates },
	{ .parent = NULL },
};

1955 1956 1957
/* Merged func_mcbsp3_gfclk into mcbsp3 */
static struct clk mcbsp3_fck = {
	.name		= "mcbsp3_fck",
1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969
	.parent		= &mcbsp3_sync_mux_ck,
	.clksel		= func_mcbsp3_gfclk_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_SOURCE_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
};

1970 1971 1972 1973 1974 1975
static const struct clksel mcbsp4_sync_mux_sel[] = {
	{ .parent = &func_96m_fclk, .rates = div_1_0_rates },
	{ .parent = &per_abe_nc_fclk, .rates = div_1_1_rates },
	{ .parent = NULL },
};

1976 1977 1978
static struct clk mcbsp4_sync_mux_ck = {
	.name		= "mcbsp4_sync_mux_ck",
	.parent		= &func_96m_fclk,
1979
	.clksel		= mcbsp4_sync_mux_sel,
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static const struct clksel per_mcbsp4_gfclk_sel[] = {
	{ .parent = &mcbsp4_sync_mux_ck, .rates = div_1_0_rates },
	{ .parent = &pad_clks_ck, .rates = div_1_1_rates },
	{ .parent = NULL },
};

1993 1994 1995
/* Merged per_mcbsp4_gfclk into mcbsp4 */
static struct clk mcbsp4_fck = {
	.name		= "mcbsp4_fck",
1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007
	.parent		= &mcbsp4_sync_mux_ck,
	.clksel		= per_mcbsp4_gfclk_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_SOURCE_24_24_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
};

2008 2009 2010 2011 2012 2013 2014 2015 2016 2017
static struct clk mcpdm_fck = {
	.name		= "mcpdm_fck",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM1_ABE_PDM_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
	.parent		= &pad_clks_ck,
	.recalc		= &followparent_recalc,
};

2018 2019
static struct clk mcspi1_fck = {
	.name		= "mcspi1_fck",
2020 2021 2022 2023 2024 2025 2026 2027
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_MCSPI1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2028 2029
static struct clk mcspi2_fck = {
	.name		= "mcspi2_fck",
2030 2031 2032 2033 2034 2035 2036 2037
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_MCSPI2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2038 2039
static struct clk mcspi3_fck = {
	.name		= "mcspi3_fck",
2040 2041 2042 2043 2044 2045 2046 2047
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_MCSPI3_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2048 2049
static struct clk mcspi4_fck = {
	.name		= "mcspi4_fck",
2050 2051 2052 2053 2054 2055 2056 2057
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_MCSPI4_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2058 2059 2060 2061 2062 2063
static const struct clksel hsmmc1_fclk_sel[] = {
	{ .parent = &func_64m_fclk, .rates = div_1_0_rates },
	{ .parent = &func_96m_fclk, .rates = div_1_1_rates },
	{ .parent = NULL },
};

2064 2065 2066
/* Merged hsmmc1_fclk into mmc1 */
static struct clk mmc1_fck = {
	.name		= "mmc1_fck",
2067
	.parent		= &func_64m_fclk,
2068
	.clksel		= hsmmc1_fclk_sel,
2069 2070 2071 2072 2073 2074 2075 2076 2077 2078
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L3INIT_MMC1_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_L3INIT_MMC1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l3_init_clkdm",
};

2079 2080 2081
/* Merged hsmmc2_fclk into mmc2 */
static struct clk mmc2_fck = {
	.name		= "mmc2_fck",
2082
	.parent		= &func_64m_fclk,
2083
	.clksel		= hsmmc1_fclk_sel,
2084 2085 2086 2087 2088 2089 2090 2091 2092 2093
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L3INIT_MMC2_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_L3INIT_MMC2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l3_init_clkdm",
};

2094 2095
static struct clk mmc3_fck = {
	.name		= "mmc3_fck",
2096 2097 2098 2099 2100 2101 2102 2103
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_MMCSD3_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2104 2105
static struct clk mmc4_fck = {
	.name		= "mmc4_fck",
2106 2107 2108 2109 2110 2111 2112 2113
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_MMCSD4_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2114 2115
static struct clk mmc5_fck = {
	.name		= "mmc5_fck",
2116 2117 2118 2119 2120 2121 2122 2123
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_MMCSD5_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2124 2125
static struct clk ocp2scp_usb_phy_phy_48m = {
	.name		= "ocp2scp_usb_phy_phy_48m",
2126 2127
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
2128
	.enable_bit	= OMAP4430_OPTFCLKEN_PHY_48M_SHIFT,
2129
	.clkdm_name	= "l3_init_clkdm",
2130
	.parent		= &func_48m_fclk,
2131 2132 2133
	.recalc		= &followparent_recalc,
};

2134 2135
static struct clk ocp2scp_usb_phy_ick = {
	.name		= "ocp2scp_usb_phy_ick",
2136 2137
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL,
2138
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
2139
	.clkdm_name	= "l3_init_clkdm",
2140
	.parent		= &l4_div_ck,
2141 2142 2143
	.recalc		= &followparent_recalc,
};

2144 2145
static struct clk ocp_wp_noc_ick = {
	.name		= "ocp_wp_noc_ick",
2146 2147 2148
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
2149
	.flags		= ENABLE_ON_INIT,
2150
	.clkdm_name	= "l3_instr_clkdm",
2151 2152 2153 2154
	.parent		= &l3_div_ck,
	.recalc		= &followparent_recalc,
};

2155 2156
static struct clk rng_ick = {
	.name		= "rng_ick",
2157 2158 2159 2160 2161 2162 2163 2164
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4SEC_RNG_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l4_secure_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
};

2165 2166
static struct clk sha2md5_fck = {
	.name		= "sha2md5_fck",
2167 2168 2169 2170 2171 2172 2173 2174
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_secure_clkdm",
	.parent		= &l3_div_ck,
	.recalc		= &followparent_recalc,
};

2175 2176
static struct clk sl2if_ick = {
	.name		= "sl2if_ick",
2177 2178 2179 2180
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_IVAHD_SL2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "ivahd_clkdm",
2181
	.parent		= &dpll_iva_m5x2_ck,
2182 2183 2184
	.recalc		= &followparent_recalc,
};

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
static struct clk slimbus1_fclk_1 = {
	.name		= "slimbus1_fclk_1",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_FCLK1_SHIFT,
	.clkdm_name	= "abe_clkdm",
	.parent		= &func_24m_clk,
	.recalc		= &followparent_recalc,
};

static struct clk slimbus1_fclk_0 = {
	.name		= "slimbus1_fclk_0",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_FCLK0_SHIFT,
	.clkdm_name	= "abe_clkdm",
	.parent		= &abe_24m_fclk,
	.recalc		= &followparent_recalc,
};

static struct clk slimbus1_fclk_2 = {
	.name		= "slimbus1_fclk_2",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_FCLK2_SHIFT,
	.clkdm_name	= "abe_clkdm",
	.parent		= &pad_clks_ck,
	.recalc		= &followparent_recalc,
};

static struct clk slimbus1_slimbus_clk = {
	.name		= "slimbus1_slimbus_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT,
	.clkdm_name	= "abe_clkdm",
	.parent		= &slimbus_clk,
	.recalc		= &followparent_recalc,
};

2225 2226
static struct clk slimbus1_fck = {
	.name		= "slimbus1_fck",
2227 2228 2229 2230 2231 2232 2233 2234
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
	.parent		= &ocp_abe_iclk,
	.recalc		= &followparent_recalc,
};

2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264
static struct clk slimbus2_fclk_1 = {
	.name		= "slimbus2_fclk_1",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &per_abe_24m_fclk,
	.recalc		= &followparent_recalc,
};

static struct clk slimbus2_fclk_0 = {
	.name		= "slimbus2_fclk_0",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_24mc_fclk,
	.recalc		= &followparent_recalc,
};

static struct clk slimbus2_slimbus_clk = {
	.name		= "slimbus2_slimbus_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &pad_slimbus_core_clks_ck,
	.recalc		= &followparent_recalc,
};

2265 2266
static struct clk slimbus2_fck = {
	.name		= "slimbus2_fck",
2267 2268 2269 2270 2271 2272 2273 2274
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
};

2275 2276
static struct clk smartreflex_core_fck = {
	.name		= "smartreflex_core_fck",
2277 2278 2279 2280 2281 2282 2283 2284
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_ALWON_SR_CORE_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_ao_clkdm",
	.parent		= &l4_wkup_clk_mux_ck,
	.recalc		= &followparent_recalc,
};

2285 2286
static struct clk smartreflex_iva_fck = {
	.name		= "smartreflex_iva_fck",
2287 2288 2289 2290 2291 2292 2293 2294
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_ALWON_SR_IVA_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_ao_clkdm",
	.parent		= &l4_wkup_clk_mux_ck,
	.recalc		= &followparent_recalc,
};

2295 2296
static struct clk smartreflex_mpu_fck = {
	.name		= "smartreflex_mpu_fck",
2297 2298 2299 2300 2301 2302 2303 2304
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_ALWON_SR_MPU_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_ao_clkdm",
	.parent		= &l4_wkup_clk_mux_ck,
	.recalc		= &followparent_recalc,
};

2305 2306 2307 2308 2309 2310 2311 2312
/* Merged dmt1_clk_mux into timer1 */
static struct clk timer1_fck = {
	.name		= "timer1_fck",
	.parent		= &sys_clkin_ck,
	.clksel		= abe_dpll_bypass_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_WKUP_TIMER1_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
2313
	.ops		= &clkops_omap2_dflt,
2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_WKUP_TIMER1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_wkup_clkdm",
};

/* Merged cm2_dm10_mux into timer10 */
static struct clk timer10_fck = {
	.name		= "timer10_fck",
	.parent		= &sys_clkin_ck,
	.clksel		= abe_dpll_bypass_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
};

/* Merged cm2_dm11_mux into timer11 */
static struct clk timer11_fck = {
	.name		= "timer11_fck",
	.parent		= &sys_clkin_ck,
	.clksel		= abe_dpll_bypass_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
};

/* Merged cm2_dm2_mux into timer2 */
static struct clk timer2_fck = {
	.name		= "timer2_fck",
	.parent		= &sys_clkin_ck,
	.clksel		= abe_dpll_bypass_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
};

/* Merged cm2_dm3_mux into timer3 */
static struct clk timer3_fck = {
	.name		= "timer3_fck",
	.parent		= &sys_clkin_ck,
	.clksel		= abe_dpll_bypass_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
};

/* Merged cm2_dm4_mux into timer4 */
static struct clk timer4_fck = {
	.name		= "timer4_fck",
	.parent		= &sys_clkin_ck,
	.clksel		= abe_dpll_bypass_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
};

static const struct clksel timer5_sync_mux_sel[] = {
	{ .parent = &syc_clk_div_ck, .rates = div_1_0_rates },
	{ .parent = &sys_32k_ck, .rates = div_1_1_rates },
	{ .parent = NULL },
};

/* Merged timer5_sync_mux into timer5 */
static struct clk timer5_fck = {
	.name		= "timer5_fck",
	.parent		= &syc_clk_div_ck,
	.clksel		= timer5_sync_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_TIMER5_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM1_ABE_TIMER5_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
};

/* Merged timer6_sync_mux into timer6 */
static struct clk timer6_fck = {
	.name		= "timer6_fck",
	.parent		= &syc_clk_div_ck,
	.clksel		= timer5_sync_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_TIMER6_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM1_ABE_TIMER6_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
};

/* Merged timer7_sync_mux into timer7 */
static struct clk timer7_fck = {
	.name		= "timer7_fck",
	.parent		= &syc_clk_div_ck,
	.clksel		= timer5_sync_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_TIMER7_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM1_ABE_TIMER7_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
};

/* Merged timer8_sync_mux into timer8 */
static struct clk timer8_fck = {
	.name		= "timer8_fck",
	.parent		= &syc_clk_div_ck,
	.clksel		= timer5_sync_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM1_ABE_TIMER8_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM1_ABE_TIMER8_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
};

/* Merged cm2_dm9_mux into timer9 */
static struct clk timer9_fck = {
	.name		= "timer9_fck",
	.parent		= &sys_clkin_ck,
	.clksel		= abe_dpll_bypass_clk_mux_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_MASK,
	.ops		= &clkops_omap2_dflt,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
2474 2475
};

2476 2477
static struct clk uart1_fck = {
	.name		= "uart1_fck",
2478 2479 2480 2481 2482 2483 2484 2485
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_UART1_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2486 2487
static struct clk uart2_fck = {
	.name		= "uart2_fck",
2488 2489 2490 2491 2492 2493 2494 2495
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_UART2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2496 2497
static struct clk uart3_fck = {
	.name		= "uart3_fck",
2498 2499 2500 2501 2502 2503 2504 2505
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_UART3_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2506 2507
static struct clk uart4_fck = {
	.name		= "uart4_fck",
2508 2509 2510 2511 2512 2513 2514 2515
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L4PER_UART4_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_per_clkdm",
	.parent		= &func_48m_fclk,
	.recalc		= &followparent_recalc,
};

2516 2517
static struct clk usb_host_fs_fck = {
	.name		= "usb_host_fs_fck",
2518
	.ops		= &clkops_omap2_dflt,
2519
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL,
2520 2521
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l3_init_clkdm",
2522
	.parent		= &func_48mc_fclk,
2523 2524 2525
	.recalc		= &followparent_recalc,
};

2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579
static const struct clksel utmi_p1_gfclk_sel[] = {
	{ .parent = &init_60m_fclk, .rates = div_1_0_rates },
	{ .parent = &xclk60mhsp1_ck, .rates = div_1_1_rates },
	{ .parent = NULL },
};

static struct clk utmi_p1_gfclk = {
	.name		= "utmi_p1_gfclk",
	.parent		= &init_60m_fclk,
	.clksel		= utmi_p1_gfclk_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_UTMI_P1_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk usb_host_hs_utmi_p1_clk = {
	.name		= "usb_host_hs_utmi_p1_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_UTMI_P1_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &utmi_p1_gfclk,
	.recalc		= &followparent_recalc,
};

static const struct clksel utmi_p2_gfclk_sel[] = {
	{ .parent = &init_60m_fclk, .rates = div_1_0_rates },
	{ .parent = &xclk60mhsp2_ck, .rates = div_1_1_rates },
	{ .parent = NULL },
};

static struct clk utmi_p2_gfclk = {
	.name		= "utmi_p2_gfclk",
	.parent		= &init_60m_fclk,
	.clksel		= utmi_p2_gfclk_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_UTMI_P2_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk usb_host_hs_utmi_p2_clk = {
	.name		= "usb_host_hs_utmi_p2_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_UTMI_P2_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &utmi_p2_gfclk,
	.recalc		= &followparent_recalc,
};

2580 2581 2582 2583 2584 2585 2586 2587 2588 2589
static struct clk usb_host_hs_utmi_p3_clk = {
	.name		= "usb_host_hs_utmi_p3_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &init_60m_fclk,
	.recalc		= &followparent_recalc,
};

2590 2591 2592 2593 2594 2595 2596 2597 2598 2599
static struct clk usb_host_hs_hsic480m_p1_clk = {
	.name		= "usb_host_hs_hsic480m_p1_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &dpll_usb_m2_ck,
	.recalc		= &followparent_recalc,
};

2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619
static struct clk usb_host_hs_hsic60m_p1_clk = {
	.name		= "usb_host_hs_hsic60m_p1_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &init_60m_fclk,
	.recalc		= &followparent_recalc,
};

static struct clk usb_host_hs_hsic60m_p2_clk = {
	.name		= "usb_host_hs_hsic60m_p2_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &init_60m_fclk,
	.recalc		= &followparent_recalc,
};

2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639
static struct clk usb_host_hs_hsic480m_p2_clk = {
	.name		= "usb_host_hs_hsic480m_p2_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &dpll_usb_m2_ck,
	.recalc		= &followparent_recalc,
};

static struct clk usb_host_hs_func48mclk = {
	.name		= "usb_host_hs_func48mclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_FUNC48MCLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &func_48mc_fclk,
	.recalc		= &followparent_recalc,
};

2640 2641
static struct clk usb_host_hs_fck = {
	.name		= "usb_host_hs_fck",
2642 2643 2644 2645 2646 2647 2648 2649
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &init_60m_fclk,
	.recalc		= &followparent_recalc,
};

2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676
static const struct clksel otg_60m_gfclk_sel[] = {
	{ .parent = &utmi_phy_clkout_ck, .rates = div_1_0_rates },
	{ .parent = &xclk60motg_ck, .rates = div_1_1_rates },
	{ .parent = NULL },
};

static struct clk otg_60m_gfclk = {
	.name		= "otg_60m_gfclk",
	.parent		= &utmi_phy_clkout_ck,
	.clksel		= otg_60m_gfclk_sel,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_60M_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk usb_otg_hs_xclk = {
	.name		= "usb_otg_hs_xclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_XCLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &otg_60m_gfclk,
	.recalc		= &followparent_recalc,
};

2677 2678
static struct clk usb_otg_hs_ick = {
	.name		= "usb_otg_hs_ick",
2679 2680 2681 2682 2683 2684 2685 2686
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &l3_div_ck,
	.recalc		= &followparent_recalc,
};

2687 2688 2689 2690 2691 2692 2693 2694 2695 2696
static struct clk usb_phy_cm_clk32k = {
	.name		= "usb_phy_cm_clk32k",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_ALWON_USBPHY_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_CLK32K_SHIFT,
	.clkdm_name	= "l4_ao_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726
static struct clk usb_tll_hs_usb_ch2_clk = {
	.name		= "usb_tll_hs_usb_ch2_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_USB_CH2_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &init_60m_fclk,
	.recalc		= &followparent_recalc,
};

static struct clk usb_tll_hs_usb_ch0_clk = {
	.name		= "usb_tll_hs_usb_ch0_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_USB_CH0_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &init_60m_fclk,
	.recalc		= &followparent_recalc,
};

static struct clk usb_tll_hs_usb_ch1_clk = {
	.name		= "usb_tll_hs_usb_ch1_clk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_USB_CH1_CLK_SHIFT,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &init_60m_fclk,
	.recalc		= &followparent_recalc,
};

2727 2728
static struct clk usb_tll_hs_ick = {
	.name		= "usb_tll_hs_ick",
2729 2730 2731 2732 2733 2734 2735 2736
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
	.clkdm_name	= "l3_init_clkdm",
	.parent		= &l4_div_ck,
	.recalc		= &followparent_recalc,
};

2737 2738 2739 2740 2741 2742 2743
static const struct clksel_rate div2_14to18_rates[] = {
	{ .div = 14, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 18, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static const struct clksel usim_fclk_div[] = {
2744
	{ .parent = &dpll_per_m4x2_ck, .rates = div2_14to18_rates },
2745 2746 2747 2748 2749
	{ .parent = NULL },
};

static struct clk usim_ck = {
	.name		= "usim_ck",
2750
	.parent		= &dpll_per_m4x2_ck,
2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769
	.clksel		= usim_fclk_div,
	.clksel_reg	= OMAP4430_CM_WKUP_USIM_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_DIV_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk usim_fclk = {
	.name		= "usim_fclk",
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_WKUP_USIM_CLKCTRL,
	.enable_bit	= OMAP4430_OPTFCLKEN_FCLK_SHIFT,
	.clkdm_name	= "l4_wkup_clkdm",
	.parent		= &usim_ck,
	.recalc		= &followparent_recalc,
};

2770 2771
static struct clk usim_fck = {
	.name		= "usim_fck",
2772 2773
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_WKUP_USIM_CLKCTRL,
2774
	.enable_bit	= OMAP4430_MODULEMODE_HWCTRL,
2775 2776 2777 2778 2779
	.clkdm_name	= "l4_wkup_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

2780 2781
static struct clk wd_timer2_fck = {
	.name		= "wd_timer2_fck",
2782 2783 2784 2785 2786 2787 2788 2789
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM_WKUP_WDT2_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "l4_wkup_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

2790 2791
static struct clk wd_timer3_fck = {
	.name		= "wd_timer3_fck",
2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834
	.ops		= &clkops_omap2_dflt,
	.enable_reg	= OMAP4430_CM1_ABE_WDT3_CLKCTRL,
	.enable_bit	= OMAP4430_MODULEMODE_SWCTRL,
	.clkdm_name	= "abe_clkdm",
	.parent		= &sys_32k_ck,
	.recalc		= &followparent_recalc,
};

/* Remaining optional clocks */
static const struct clksel stm_clk_div_div[] = {
	{ .parent = &pmd_stm_clock_mux_ck, .rates = div3_1to4_rates },
	{ .parent = NULL },
};

static struct clk stm_clk_div_ck = {
	.name		= "stm_clk_div_ck",
	.parent		= &pmd_stm_clock_mux_ck,
	.clksel		= stm_clk_div_div,
	.clksel_reg	= OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_PMD_STM_CLK_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static const struct clksel trace_clk_div_div[] = {
	{ .parent = &pmd_trace_clk_mux_ck, .rates = div3_1to4_rates },
	{ .parent = NULL },
};

static struct clk trace_clk_div_ck = {
	.name		= "trace_clk_div_ck",
	.parent		= &pmd_trace_clk_mux_ck,
	.clksel		= trace_clk_div_div,
	.clksel_reg	= OMAP4430_CM_EMU_DEBUGSS_CLKCTRL,
	.clksel_mask	= OMAP4430_CLKSEL_PMD_TRACE_CLK_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

2835 2836
/* SCRM aux clk nodes */

2837
static const struct clksel auxclk_src_sel[] = {
2838 2839 2840 2841 2842 2843
	{ .parent = &sys_clkin_ck, .rates = div_1_0_rates },
	{ .parent = &dpll_core_m3x2_ck, .rates = div_1_1_rates },
	{ .parent = &dpll_per_m3x2_ck, .rates = div_1_2_rates },
	{ .parent = NULL },
};

2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865
static const struct clksel_rate div16_1to16_rates[] = {
	{ .div = 1, .val = 0, .flags = RATE_IN_4430 },
	{ .div = 2, .val = 1, .flags = RATE_IN_4430 },
	{ .div = 3, .val = 2, .flags = RATE_IN_4430 },
	{ .div = 4, .val = 3, .flags = RATE_IN_4430 },
	{ .div = 5, .val = 4, .flags = RATE_IN_4430 },
	{ .div = 6, .val = 5, .flags = RATE_IN_4430 },
	{ .div = 7, .val = 6, .flags = RATE_IN_4430 },
	{ .div = 8, .val = 7, .flags = RATE_IN_4430 },
	{ .div = 9, .val = 8, .flags = RATE_IN_4430 },
	{ .div = 10, .val = 9, .flags = RATE_IN_4430 },
	{ .div = 11, .val = 10, .flags = RATE_IN_4430 },
	{ .div = 12, .val = 11, .flags = RATE_IN_4430 },
	{ .div = 13, .val = 12, .flags = RATE_IN_4430 },
	{ .div = 14, .val = 13, .flags = RATE_IN_4430 },
	{ .div = 15, .val = 14, .flags = RATE_IN_4430 },
	{ .div = 16, .val = 15, .flags = RATE_IN_4430 },
	{ .div = 0 },
};

static struct clk auxclk0_src_ck = {
	.name		= "auxclk0_src_ck",
2866 2867 2868
	.parent		= &sys_clkin_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_omap2_dflt,
2869
	.clksel		= auxclk_src_sel,
2870 2871 2872 2873 2874 2875 2876
	.clksel_reg	= OMAP4_SCRM_AUXCLK0,
	.clksel_mask	= OMAP4_SRCSELECT_MASK,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4_SCRM_AUXCLK0,
	.enable_bit	= OMAP4_ENABLE_SHIFT,
};

2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895
static const struct clksel auxclk0_sel[] = {
	{ .parent = &auxclk0_src_ck, .rates = div16_1to16_rates },
	{ .parent = NULL },
};

static struct clk auxclk0_ck = {
	.name		= "auxclk0_ck",
	.parent		= &auxclk0_src_ck,
	.clksel		= auxclk0_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLK0,
	.clksel_mask	= OMAP4_CLKDIV_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk auxclk1_src_ck = {
	.name		= "auxclk1_src_ck",
2896 2897 2898
	.parent		= &sys_clkin_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_omap2_dflt,
2899
	.clksel		= auxclk_src_sel,
2900 2901 2902 2903 2904 2905 2906
	.clksel_reg	= OMAP4_SCRM_AUXCLK1,
	.clksel_mask	= OMAP4_SRCSELECT_MASK,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4_SCRM_AUXCLK1,
	.enable_bit	= OMAP4_ENABLE_SHIFT,
};

2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925
static const struct clksel auxclk1_sel[] = {
	{ .parent = &auxclk1_src_ck, .rates = div16_1to16_rates },
	{ .parent = NULL },
};

static struct clk auxclk1_ck = {
	.name		= "auxclk1_ck",
	.parent		= &auxclk1_src_ck,
	.clksel		= auxclk1_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLK1,
	.clksel_mask	= OMAP4_CLKDIV_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk auxclk2_src_ck = {
	.name		= "auxclk2_src_ck",
2926 2927 2928
	.parent		= &sys_clkin_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_omap2_dflt,
2929
	.clksel		= auxclk_src_sel,
2930 2931 2932 2933 2934 2935
	.clksel_reg	= OMAP4_SCRM_AUXCLK2,
	.clksel_mask	= OMAP4_SRCSELECT_MASK,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4_SCRM_AUXCLK2,
	.enable_bit	= OMAP4_ENABLE_SHIFT,
};
2936

2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955
static const struct clksel auxclk2_sel[] = {
	{ .parent = &auxclk2_src_ck, .rates = div16_1to16_rates },
	{ .parent = NULL },
};

static struct clk auxclk2_ck = {
	.name		= "auxclk2_ck",
	.parent		= &auxclk2_src_ck,
	.clksel		= auxclk2_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLK2,
	.clksel_mask	= OMAP4_CLKDIV_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk auxclk3_src_ck = {
	.name		= "auxclk3_src_ck",
2956 2957 2958
	.parent		= &sys_clkin_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_omap2_dflt,
2959
	.clksel		= auxclk_src_sel,
2960 2961 2962 2963 2964 2965 2966
	.clksel_reg	= OMAP4_SCRM_AUXCLK3,
	.clksel_mask	= OMAP4_SRCSELECT_MASK,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4_SCRM_AUXCLK3,
	.enable_bit	= OMAP4_ENABLE_SHIFT,
};

2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985
static const struct clksel auxclk3_sel[] = {
	{ .parent = &auxclk3_src_ck, .rates = div16_1to16_rates },
	{ .parent = NULL },
};

static struct clk auxclk3_ck = {
	.name		= "auxclk3_ck",
	.parent		= &auxclk3_src_ck,
	.clksel		= auxclk3_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLK3,
	.clksel_mask	= OMAP4_CLKDIV_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk auxclk4_src_ck = {
	.name		= "auxclk4_src_ck",
2986 2987 2988
	.parent		= &sys_clkin_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_omap2_dflt,
2989
	.clksel		= auxclk_src_sel,
2990 2991 2992 2993 2994 2995 2996
	.clksel_reg	= OMAP4_SCRM_AUXCLK4,
	.clksel_mask	= OMAP4_SRCSELECT_MASK,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4_SCRM_AUXCLK4,
	.enable_bit	= OMAP4_ENABLE_SHIFT,
};

2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015
static const struct clksel auxclk4_sel[] = {
	{ .parent = &auxclk4_src_ck, .rates = div16_1to16_rates },
	{ .parent = NULL },
};

static struct clk auxclk4_ck = {
	.name		= "auxclk4_ck",
	.parent		= &auxclk4_src_ck,
	.clksel		= auxclk4_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLK4,
	.clksel_mask	= OMAP4_CLKDIV_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

static struct clk auxclk5_src_ck = {
	.name		= "auxclk5_src_ck",
3016 3017 3018
	.parent		= &sys_clkin_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_omap2_dflt,
3019
	.clksel		= auxclk_src_sel,
3020 3021 3022 3023 3024 3025 3026
	.clksel_reg	= OMAP4_SCRM_AUXCLK5,
	.clksel_mask	= OMAP4_SRCSELECT_MASK,
	.recalc		= &omap2_clksel_recalc,
	.enable_reg	= OMAP4_SCRM_AUXCLK5,
	.enable_bit	= OMAP4_ENABLE_SHIFT,
};

3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043
static const struct clksel auxclk5_sel[] = {
	{ .parent = &auxclk5_src_ck, .rates = div16_1to16_rates },
	{ .parent = NULL },
};

static struct clk auxclk5_ck = {
	.name		= "auxclk5_ck",
	.parent		= &auxclk5_src_ck,
	.clksel		= auxclk5_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLK5,
	.clksel_mask	= OMAP4_CLKDIV_MASK,
	.ops		= &clkops_null,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate,
};

3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119
static const struct clksel auxclkreq_sel[] = {
	{ .parent = &auxclk0_ck, .rates = div_1_0_rates },
	{ .parent = &auxclk1_ck, .rates = div_1_1_rates },
	{ .parent = &auxclk2_ck, .rates = div_1_2_rates },
	{ .parent = &auxclk3_ck, .rates = div_1_3_rates },
	{ .parent = &auxclk4_ck, .rates = div_1_4_rates },
	{ .parent = &auxclk5_ck, .rates = div_1_5_rates },
	{ .parent = NULL },
};

static struct clk auxclkreq0_ck = {
	.name		= "auxclkreq0_ck",
	.parent		= &auxclk0_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_null,
	.clksel         = auxclkreq_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLKREQ0,
	.clksel_mask	= OMAP4_MAPPING_MASK,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk auxclkreq1_ck = {
	.name		= "auxclkreq1_ck",
	.parent		= &auxclk1_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_null,
	.clksel         = auxclkreq_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLKREQ1,
	.clksel_mask	= OMAP4_MAPPING_MASK,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk auxclkreq2_ck = {
	.name		= "auxclkreq2_ck",
	.parent		= &auxclk2_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_null,
	.clksel         = auxclkreq_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLKREQ2,
	.clksel_mask	= OMAP4_MAPPING_MASK,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk auxclkreq3_ck = {
	.name		= "auxclkreq3_ck",
	.parent		= &auxclk3_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_null,
	.clksel         = auxclkreq_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLKREQ3,
	.clksel_mask	= OMAP4_MAPPING_MASK,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk auxclkreq4_ck = {
	.name		= "auxclkreq4_ck",
	.parent		= &auxclk4_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_null,
	.clksel         = auxclkreq_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLKREQ4,
	.clksel_mask	= OMAP4_MAPPING_MASK,
	.recalc		= &omap2_clksel_recalc,
};

static struct clk auxclkreq5_ck = {
	.name		= "auxclkreq5_ck",
	.parent		= &auxclk5_ck,
	.init		= &omap2_init_clksel_parent,
	.ops		= &clkops_null,
	.clksel         = auxclkreq_sel,
	.clksel_reg	= OMAP4_SCRM_AUXCLKREQ5,
	.clksel_mask	= OMAP4_MAPPING_MASK,
	.recalc		= &omap2_clksel_recalc,
};

3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138
/*
 * clkdev
 */

static struct omap_clk omap44xx_clks[] = {
	CLK(NULL,	"extalt_clkin_ck",		&extalt_clkin_ck,	CK_443X),
	CLK(NULL,	"pad_clks_ck",			&pad_clks_ck,	CK_443X),
	CLK(NULL,	"pad_slimbus_core_clks_ck",	&pad_slimbus_core_clks_ck,	CK_443X),
	CLK(NULL,	"secure_32k_clk_src_ck",	&secure_32k_clk_src_ck,	CK_443X),
	CLK(NULL,	"slimbus_clk",			&slimbus_clk,	CK_443X),
	CLK(NULL,	"sys_32k_ck",			&sys_32k_ck,	CK_443X),
	CLK(NULL,	"virt_12000000_ck",		&virt_12000000_ck,	CK_443X),
	CLK(NULL,	"virt_13000000_ck",		&virt_13000000_ck,	CK_443X),
	CLK(NULL,	"virt_16800000_ck",		&virt_16800000_ck,	CK_443X),
	CLK(NULL,	"virt_19200000_ck",		&virt_19200000_ck,	CK_443X),
	CLK(NULL,	"virt_26000000_ck",		&virt_26000000_ck,	CK_443X),
	CLK(NULL,	"virt_27000000_ck",		&virt_27000000_ck,	CK_443X),
	CLK(NULL,	"virt_38400000_ck",		&virt_38400000_ck,	CK_443X),
	CLK(NULL,	"sys_clkin_ck",			&sys_clkin_ck,	CK_443X),
3139
	CLK(NULL,	"tie_low_clock_ck",		&tie_low_clock_ck,	CK_443X),
3140 3141 3142 3143
	CLK(NULL,	"utmi_phy_clkout_ck",		&utmi_phy_clkout_ck,	CK_443X),
	CLK(NULL,	"xclk60mhsp1_ck",		&xclk60mhsp1_ck,	CK_443X),
	CLK(NULL,	"xclk60mhsp2_ck",		&xclk60mhsp2_ck,	CK_443X),
	CLK(NULL,	"xclk60motg_ck",		&xclk60motg_ck,	CK_443X),
3144
	CLK(NULL,	"abe_dpll_bypass_clk_mux_ck",	&abe_dpll_bypass_clk_mux_ck,	CK_443X),
3145 3146
	CLK(NULL,	"abe_dpll_refclk_mux_ck",	&abe_dpll_refclk_mux_ck,	CK_443X),
	CLK(NULL,	"dpll_abe_ck",			&dpll_abe_ck,	CK_443X),
3147
	CLK(NULL,	"dpll_abe_x2_ck",		&dpll_abe_x2_ck,	CK_443X),
3148 3149 3150 3151
	CLK(NULL,	"dpll_abe_m2x2_ck",		&dpll_abe_m2x2_ck,	CK_443X),
	CLK(NULL,	"abe_24m_fclk",			&abe_24m_fclk,	CK_443X),
	CLK(NULL,	"abe_clk",			&abe_clk,	CK_443X),
	CLK(NULL,	"aess_fclk",			&aess_fclk,	CK_443X),
3152
	CLK(NULL,	"dpll_abe_m3x2_ck",		&dpll_abe_m3x2_ck,	CK_443X),
3153 3154
	CLK(NULL,	"core_hsd_byp_clk_mux_ck",	&core_hsd_byp_clk_mux_ck,	CK_443X),
	CLK(NULL,	"dpll_core_ck",			&dpll_core_ck,	CK_443X),
3155 3156
	CLK(NULL,	"dpll_core_x2_ck",		&dpll_core_x2_ck,	CK_443X),
	CLK(NULL,	"dpll_core_m6x2_ck",		&dpll_core_m6x2_ck,	CK_443X),
3157 3158 3159
	CLK(NULL,	"dbgclk_mux_ck",		&dbgclk_mux_ck,	CK_443X),
	CLK(NULL,	"dpll_core_m2_ck",		&dpll_core_m2_ck,	CK_443X),
	CLK(NULL,	"ddrphy_ck",			&ddrphy_ck,	CK_443X),
3160
	CLK(NULL,	"dpll_core_m5x2_ck",		&dpll_core_m5x2_ck,	CK_443X),
3161 3162 3163
	CLK(NULL,	"div_core_ck",			&div_core_ck,	CK_443X),
	CLK(NULL,	"div_iva_hs_clk",		&div_iva_hs_clk,	CK_443X),
	CLK(NULL,	"div_mpu_hs_clk",		&div_mpu_hs_clk,	CK_443X),
3164
	CLK(NULL,	"dpll_core_m4x2_ck",		&dpll_core_m4x2_ck,	CK_443X),
3165 3166
	CLK(NULL,	"dll_clk_div_ck",		&dll_clk_div_ck,	CK_443X),
	CLK(NULL,	"dpll_abe_m2_ck",		&dpll_abe_m2_ck,	CK_443X),
3167 3168
	CLK(NULL,	"dpll_core_m3x2_ck",		&dpll_core_m3x2_ck,	CK_443X),
	CLK(NULL,	"dpll_core_m7x2_ck",		&dpll_core_m7x2_ck,	CK_443X),
3169 3170
	CLK(NULL,	"iva_hsd_byp_clk_mux_ck",	&iva_hsd_byp_clk_mux_ck,	CK_443X),
	CLK(NULL,	"dpll_iva_ck",			&dpll_iva_ck,	CK_443X),
3171 3172 3173
	CLK(NULL,	"dpll_iva_x2_ck",		&dpll_iva_x2_ck,	CK_443X),
	CLK(NULL,	"dpll_iva_m4x2_ck",		&dpll_iva_m4x2_ck,	CK_443X),
	CLK(NULL,	"dpll_iva_m5x2_ck",		&dpll_iva_m5x2_ck,	CK_443X),
3174 3175 3176 3177 3178 3179
	CLK(NULL,	"dpll_mpu_ck",			&dpll_mpu_ck,	CK_443X),
	CLK(NULL,	"dpll_mpu_m2_ck",		&dpll_mpu_m2_ck,	CK_443X),
	CLK(NULL,	"per_hs_clk_div_ck",		&per_hs_clk_div_ck,	CK_443X),
	CLK(NULL,	"per_hsd_byp_clk_mux_ck",	&per_hsd_byp_clk_mux_ck,	CK_443X),
	CLK(NULL,	"dpll_per_ck",			&dpll_per_ck,	CK_443X),
	CLK(NULL,	"dpll_per_m2_ck",		&dpll_per_m2_ck,	CK_443X),
3180
	CLK(NULL,	"dpll_per_x2_ck",		&dpll_per_x2_ck,	CK_443X),
3181
	CLK(NULL,	"dpll_per_m2x2_ck",		&dpll_per_m2x2_ck,	CK_443X),
3182 3183 3184 3185 3186
	CLK(NULL,	"dpll_per_m3x2_ck",		&dpll_per_m3x2_ck,	CK_443X),
	CLK(NULL,	"dpll_per_m4x2_ck",		&dpll_per_m4x2_ck,	CK_443X),
	CLK(NULL,	"dpll_per_m5x2_ck",		&dpll_per_m5x2_ck,	CK_443X),
	CLK(NULL,	"dpll_per_m6x2_ck",		&dpll_per_m6x2_ck,	CK_443X),
	CLK(NULL,	"dpll_per_m7x2_ck",		&dpll_per_m7x2_ck,	CK_443X),
3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203
	CLK(NULL,	"usb_hs_clk_div_ck",		&usb_hs_clk_div_ck,	CK_443X),
	CLK(NULL,	"dpll_usb_ck",			&dpll_usb_ck,	CK_443X),
	CLK(NULL,	"dpll_usb_clkdcoldo_ck",	&dpll_usb_clkdcoldo_ck,	CK_443X),
	CLK(NULL,	"dpll_usb_m2_ck",		&dpll_usb_m2_ck,	CK_443X),
	CLK(NULL,	"ducati_clk_mux_ck",		&ducati_clk_mux_ck,	CK_443X),
	CLK(NULL,	"func_12m_fclk",		&func_12m_fclk,	CK_443X),
	CLK(NULL,	"func_24m_clk",			&func_24m_clk,	CK_443X),
	CLK(NULL,	"func_24mc_fclk",		&func_24mc_fclk,	CK_443X),
	CLK(NULL,	"func_48m_fclk",		&func_48m_fclk,	CK_443X),
	CLK(NULL,	"func_48mc_fclk",		&func_48mc_fclk,	CK_443X),
	CLK(NULL,	"func_64m_fclk",		&func_64m_fclk,	CK_443X),
	CLK(NULL,	"func_96m_fclk",		&func_96m_fclk,	CK_443X),
	CLK(NULL,	"init_60m_fclk",		&init_60m_fclk,	CK_443X),
	CLK(NULL,	"l3_div_ck",			&l3_div_ck,	CK_443X),
	CLK(NULL,	"l4_div_ck",			&l4_div_ck,	CK_443X),
	CLK(NULL,	"lp_clk_div_ck",		&lp_clk_div_ck,	CK_443X),
	CLK(NULL,	"l4_wkup_clk_mux_ck",		&l4_wkup_clk_mux_ck,	CK_443X),
3204
	CLK("smp_twd",	NULL,				&mpu_periphclk,	CK_443X),
3205 3206
	CLK(NULL,	"ocp_abe_iclk",			&ocp_abe_iclk,	CK_443X),
	CLK(NULL,	"per_abe_24m_fclk",		&per_abe_24m_fclk,	CK_443X),
3207
	CLK(NULL,	"per_abe_nc_fclk",		&per_abe_nc_fclk,	CK_443X),
3208 3209 3210
	CLK(NULL,	"pmd_stm_clock_mux_ck",		&pmd_stm_clock_mux_ck,	CK_443X),
	CLK(NULL,	"pmd_trace_clk_mux_ck",		&pmd_trace_clk_mux_ck,	CK_443X),
	CLK(NULL,	"syc_clk_div_ck",		&syc_clk_div_ck,	CK_443X),
3211 3212 3213
	CLK(NULL,	"aes1_fck",			&aes1_fck,	CK_443X),
	CLK(NULL,	"aes2_fck",			&aes2_fck,	CK_443X),
	CLK(NULL,	"aess_fck",			&aess_fck,	CK_443X),
3214
	CLK(NULL,	"bandgap_fclk",			&bandgap_fclk,	CK_443X),
3215
	CLK(NULL,	"bandgap_ts_fclk",		&bandgap_ts_fclk,	CK_446X),
3216
	CLK(NULL,	"des3des_fck",			&des3des_fck,	CK_443X),
3217
	CLK(NULL,	"div_ts_ck",			&div_ts_ck,	CK_446X),
3218
	CLK(NULL,	"dmic_sync_mux_ck",		&dmic_sync_mux_ck,	CK_443X),
3219
	CLK(NULL,	"dmic_fck",			&dmic_fck,	CK_443X),
3220
	CLK(NULL,	"dsp_fck",			&dsp_fck,	CK_443X),
3221 3222 3223 3224
	CLK(NULL,	"dss_sys_clk",			&dss_sys_clk,	CK_443X),
	CLK(NULL,	"dss_tv_clk",			&dss_tv_clk,	CK_443X),
	CLK(NULL,	"dss_48mhz_clk",		&dss_48mhz_clk,	CK_443X),
	CLK(NULL,	"dss_dss_clk",			&dss_dss_clk,	CK_443X),
3225
	CLK("omapdss_dss",	"ick",				&dss_fck,	CK_443X),
3226 3227 3228
	CLK(NULL,	"efuse_ctrl_cust_fck",		&efuse_ctrl_cust_fck,	CK_443X),
	CLK(NULL,	"emif1_fck",			&emif1_fck,	CK_443X),
	CLK(NULL,	"emif2_fck",			&emif2_fck,	CK_443X),
3229
	CLK(NULL,	"fdif_fck",			&fdif_fck,	CK_443X),
3230
	CLK(NULL,	"fpka_fck",			&fpka_fck,	CK_443X),
3231
	CLK(NULL,	"gpio1_dbclk",			&gpio1_dbclk,	CK_443X),
3232
	CLK(NULL,	"gpio1_ick",			&gpio1_ick,	CK_443X),
3233
	CLK(NULL,	"gpio2_dbclk",			&gpio2_dbclk,	CK_443X),
3234
	CLK(NULL,	"gpio2_ick",			&gpio2_ick,	CK_443X),
3235
	CLK(NULL,	"gpio3_dbclk",			&gpio3_dbclk,	CK_443X),
3236
	CLK(NULL,	"gpio3_ick",			&gpio3_ick,	CK_443X),
3237
	CLK(NULL,	"gpio4_dbclk",			&gpio4_dbclk,	CK_443X),
3238
	CLK(NULL,	"gpio4_ick",			&gpio4_ick,	CK_443X),
3239
	CLK(NULL,	"gpio5_dbclk",			&gpio5_dbclk,	CK_443X),
3240
	CLK(NULL,	"gpio5_ick",			&gpio5_ick,	CK_443X),
3241
	CLK(NULL,	"gpio6_dbclk",			&gpio6_dbclk,	CK_443X),
3242 3243
	CLK(NULL,	"gpio6_ick",			&gpio6_ick,	CK_443X),
	CLK(NULL,	"gpmc_ick",			&gpmc_ick,	CK_443X),
3244
	CLK(NULL,	"gpu_fck",			&gpu_fck,	CK_443X),
3245
	CLK(NULL,	"hdq1w_fck",			&hdq1w_fck,	CK_443X),
3246
	CLK(NULL,	"hsi_fck",			&hsi_fck,	CK_443X),
3247 3248 3249 3250
	CLK(NULL,	"i2c1_fck",			&i2c1_fck,	CK_443X),
	CLK(NULL,	"i2c2_fck",			&i2c2_fck,	CK_443X),
	CLK(NULL,	"i2c3_fck",			&i2c3_fck,	CK_443X),
	CLK(NULL,	"i2c4_fck",			&i2c4_fck,	CK_443X),
3251
	CLK(NULL,	"ipu_fck",			&ipu_fck,	CK_443X),
3252
	CLK(NULL,	"iss_ctrlclk",			&iss_ctrlclk,	CK_443X),
3253
	CLK(NULL,	"iss_fck",			&iss_fck,	CK_443X),
3254 3255 3256 3257
	CLK(NULL,	"iva_fck",			&iva_fck,	CK_443X),
	CLK(NULL,	"kbd_fck",			&kbd_fck,	CK_443X),
	CLK(NULL,	"l3_instr_ick",			&l3_instr_ick,	CK_443X),
	CLK(NULL,	"l3_main_3_ick",		&l3_main_3_ick,	CK_443X),
3258
	CLK(NULL,	"mcasp_sync_mux_ck",		&mcasp_sync_mux_ck,	CK_443X),
3259
	CLK(NULL,	"mcasp_fck",			&mcasp_fck,	CK_443X),
3260
	CLK(NULL,	"mcbsp1_sync_mux_ck",		&mcbsp1_sync_mux_ck,	CK_443X),
3261
	CLK(NULL,	"mcbsp1_fck",			&mcbsp1_fck,	CK_443X),
3262
	CLK(NULL,	"mcbsp2_sync_mux_ck",		&mcbsp2_sync_mux_ck,	CK_443X),
3263
	CLK(NULL,	"mcbsp2_fck",			&mcbsp2_fck,	CK_443X),
3264
	CLK(NULL,	"mcbsp3_sync_mux_ck",		&mcbsp3_sync_mux_ck,	CK_443X),
3265
	CLK(NULL,	"mcbsp3_fck",			&mcbsp3_fck,	CK_443X),
3266
	CLK(NULL,	"mcbsp4_sync_mux_ck",		&mcbsp4_sync_mux_ck,	CK_443X),
3267
	CLK(NULL,	"mcbsp4_fck",			&mcbsp4_fck,	CK_443X),
3268
	CLK(NULL,	"mcpdm_fck",			&mcpdm_fck,	CK_443X),
3269 3270 3271 3272 3273 3274 3275 3276 3277
	CLK(NULL,	"mcspi1_fck",			&mcspi1_fck,	CK_443X),
	CLK(NULL,	"mcspi2_fck",			&mcspi2_fck,	CK_443X),
	CLK(NULL,	"mcspi3_fck",			&mcspi3_fck,	CK_443X),
	CLK(NULL,	"mcspi4_fck",			&mcspi4_fck,	CK_443X),
	CLK(NULL,	"mmc1_fck",			&mmc1_fck,	CK_443X),
	CLK(NULL,	"mmc2_fck",			&mmc2_fck,	CK_443X),
	CLK(NULL,	"mmc3_fck",			&mmc3_fck,	CK_443X),
	CLK(NULL,	"mmc4_fck",			&mmc4_fck,	CK_443X),
	CLK(NULL,	"mmc5_fck",			&mmc5_fck,	CK_443X),
3278
	CLK(NULL,	"ocp2scp_usb_phy_phy_48m",	&ocp2scp_usb_phy_phy_48m,	CK_443X),
3279
	CLK(NULL,	"ocp2scp_usb_phy_ick",		&ocp2scp_usb_phy_ick,	CK_443X),
3280
	CLK(NULL,	"ocp_wp_noc_ick",		&ocp_wp_noc_ick,	CK_443X),
3281
	CLK("omap_rng",	"ick",				&rng_ick,	CK_443X),
3282 3283
	CLK(NULL,	"sha2md5_fck",			&sha2md5_fck,	CK_443X),
	CLK(NULL,	"sl2if_ick",			&sl2if_ick,	CK_443X),
3284 3285 3286 3287
	CLK(NULL,	"slimbus1_fclk_1",		&slimbus1_fclk_1,	CK_443X),
	CLK(NULL,	"slimbus1_fclk_0",		&slimbus1_fclk_0,	CK_443X),
	CLK(NULL,	"slimbus1_fclk_2",		&slimbus1_fclk_2,	CK_443X),
	CLK(NULL,	"slimbus1_slimbus_clk",		&slimbus1_slimbus_clk,	CK_443X),
3288
	CLK(NULL,	"slimbus1_fck",			&slimbus1_fck,	CK_443X),
3289 3290 3291
	CLK(NULL,	"slimbus2_fclk_1",		&slimbus2_fclk_1,	CK_443X),
	CLK(NULL,	"slimbus2_fclk_0",		&slimbus2_fclk_0,	CK_443X),
	CLK(NULL,	"slimbus2_slimbus_clk",		&slimbus2_slimbus_clk,	CK_443X),
3292
	CLK(NULL,	"slimbus2_fck",			&slimbus2_fck,	CK_443X),
3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306
	CLK(NULL,	"smartreflex_core_fck",		&smartreflex_core_fck,	CK_443X),
	CLK(NULL,	"smartreflex_iva_fck",		&smartreflex_iva_fck,	CK_443X),
	CLK(NULL,	"smartreflex_mpu_fck",		&smartreflex_mpu_fck,	CK_443X),
	CLK(NULL,	"gpt1_fck",			&timer1_fck,	CK_443X),
	CLK(NULL,	"gpt10_fck",			&timer10_fck,	CK_443X),
	CLK(NULL,	"gpt11_fck",			&timer11_fck,	CK_443X),
	CLK(NULL,	"gpt2_fck",			&timer2_fck,	CK_443X),
	CLK(NULL,	"gpt3_fck",			&timer3_fck,	CK_443X),
	CLK(NULL,	"gpt4_fck",			&timer4_fck,	CK_443X),
	CLK(NULL,	"gpt5_fck",			&timer5_fck,	CK_443X),
	CLK(NULL,	"gpt6_fck",			&timer6_fck,	CK_443X),
	CLK(NULL,	"gpt7_fck",			&timer7_fck,	CK_443X),
	CLK(NULL,	"gpt8_fck",			&timer8_fck,	CK_443X),
	CLK(NULL,	"gpt9_fck",			&timer9_fck,	CK_443X),
3307 3308 3309 3310
	CLK(NULL,	"uart1_fck",			&uart1_fck,	CK_443X),
	CLK(NULL,	"uart2_fck",			&uart2_fck,	CK_443X),
	CLK(NULL,	"uart3_fck",			&uart3_fck,	CK_443X),
	CLK(NULL,	"uart4_fck",			&uart4_fck,	CK_443X),
3311
	CLK("usbhs_omap",	"fs_fck",		&usb_host_fs_fck,	CK_443X),
3312 3313 3314 3315
	CLK(NULL,	"utmi_p1_gfclk",		&utmi_p1_gfclk,	CK_443X),
	CLK(NULL,	"usb_host_hs_utmi_p1_clk",	&usb_host_hs_utmi_p1_clk,	CK_443X),
	CLK(NULL,	"utmi_p2_gfclk",		&utmi_p2_gfclk,	CK_443X),
	CLK(NULL,	"usb_host_hs_utmi_p2_clk",	&usb_host_hs_utmi_p2_clk,	CK_443X),
3316
	CLK(NULL,	"usb_host_hs_utmi_p3_clk",	&usb_host_hs_utmi_p3_clk,	CK_443X),
3317
	CLK(NULL,	"usb_host_hs_hsic480m_p1_clk",	&usb_host_hs_hsic480m_p1_clk,	CK_443X),
3318 3319
	CLK(NULL,	"usb_host_hs_hsic60m_p1_clk",	&usb_host_hs_hsic60m_p1_clk,	CK_443X),
	CLK(NULL,	"usb_host_hs_hsic60m_p2_clk",	&usb_host_hs_hsic60m_p2_clk,	CK_443X),
3320 3321
	CLK(NULL,	"usb_host_hs_hsic480m_p2_clk",	&usb_host_hs_hsic480m_p2_clk,	CK_443X),
	CLK(NULL,	"usb_host_hs_func48mclk",	&usb_host_hs_func48mclk,	CK_443X),
3322
	CLK("usbhs_omap",	"hs_fck",		&usb_host_hs_fck,	CK_443X),
3323 3324
	CLK(NULL,	"otg_60m_gfclk",		&otg_60m_gfclk,	CK_443X),
	CLK(NULL,	"usb_otg_hs_xclk",		&usb_otg_hs_xclk,	CK_443X),
3325
	CLK("musb-omap2430",	"ick",				&usb_otg_hs_ick,	CK_443X),
3326
	CLK(NULL,	"usb_phy_cm_clk32k",		&usb_phy_cm_clk32k,	CK_443X),
3327 3328 3329
	CLK(NULL,	"usb_tll_hs_usb_ch2_clk",	&usb_tll_hs_usb_ch2_clk,	CK_443X),
	CLK(NULL,	"usb_tll_hs_usb_ch0_clk",	&usb_tll_hs_usb_ch0_clk,	CK_443X),
	CLK(NULL,	"usb_tll_hs_usb_ch1_clk",	&usb_tll_hs_usb_ch1_clk,	CK_443X),
3330
	CLK("usbhs_omap",	"usbtll_ick",		&usb_tll_hs_ick,	CK_443X),
3331 3332
	CLK(NULL,	"usim_ck",			&usim_ck,	CK_443X),
	CLK(NULL,	"usim_fclk",			&usim_fclk,	CK_443X),
3333
	CLK(NULL,	"usim_fck",			&usim_fck,	CK_443X),
3334
	CLK(NULL,	"wd_timer2_fck",		&wd_timer2_fck,	CK_443X),
3335
	CLK(NULL,	"wd_timer3_fck",		&wd_timer3_fck,	CK_443X),
3336 3337
	CLK(NULL,	"stm_clk_div_ck",		&stm_clk_div_ck,	CK_443X),
	CLK(NULL,	"trace_clk_div_ck",		&trace_clk_div_ck,	CK_443X),
3338
	CLK(NULL,	"auxclk0_src_ck",		&auxclk0_src_ck,	CK_443X),
3339 3340
	CLK(NULL,	"auxclk0_ck",			&auxclk0_ck,	CK_443X),
	CLK(NULL,	"auxclkreq0_ck",		&auxclkreq0_ck,	CK_443X),
3341 3342
	CLK(NULL,	"auxclk1_src_ck",		&auxclk1_src_ck,	CK_443X),
	CLK(NULL,	"auxclk1_ck",			&auxclk1_ck,	CK_443X),
3343
	CLK(NULL,	"auxclkreq1_ck",		&auxclkreq1_ck,	CK_443X),
3344 3345
	CLK(NULL,	"auxclk2_src_ck",		&auxclk2_src_ck,	CK_443X),
	CLK(NULL,	"auxclk2_ck",			&auxclk2_ck,	CK_443X),
3346
	CLK(NULL,	"auxclkreq2_ck",		&auxclkreq2_ck,	CK_443X),
3347 3348
	CLK(NULL,	"auxclk3_src_ck",		&auxclk3_src_ck,	CK_443X),
	CLK(NULL,	"auxclk3_ck",			&auxclk3_ck,	CK_443X),
3349
	CLK(NULL,	"auxclkreq3_ck",		&auxclkreq3_ck,	CK_443X),
3350 3351
	CLK(NULL,	"auxclk4_src_ck",		&auxclk4_src_ck,	CK_443X),
	CLK(NULL,	"auxclk4_ck",			&auxclk4_ck,	CK_443X),
3352
	CLK(NULL,	"auxclkreq4_ck",		&auxclkreq4_ck,	CK_443X),
3353 3354
	CLK(NULL,	"auxclk5_src_ck",		&auxclk5_src_ck,	CK_443X),
	CLK(NULL,	"auxclk5_ck",			&auxclk5_ck,	CK_443X),
3355
	CLK(NULL,	"auxclkreq5_ck",		&auxclkreq5_ck,	CK_443X),
3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367
	CLK(NULL,	"gpmc_ck",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt1_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt2_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt3_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt4_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt5_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt6_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt7_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt8_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt9_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt10_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"gpt11_ick",			&dummy_ck,	CK_443X),
3368 3369 3370 3371
	CLK("omap_i2c.1",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap_i2c.2",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap_i2c.3",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap_i2c.4",	"ick",				&dummy_ck,	CK_443X),
3372
	CLK(NULL,	"mailboxes_ick",		&dummy_ck,	CK_443X),
3373 3374 3375 3376 3377
	CLK("omap_hsmmc.0",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap_hsmmc.1",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap_hsmmc.2",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap_hsmmc.3",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap_hsmmc.4",	"ick",				&dummy_ck,	CK_443X),
3378 3379 3380 3381
	CLK("omap-mcbsp.1",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap-mcbsp.2",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap-mcbsp.3",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap-mcbsp.4",	"ick",				&dummy_ck,	CK_443X),
3382 3383 3384 3385
	CLK("omap2_mcspi.1",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap2_mcspi.2",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap2_mcspi.3",	"ick",				&dummy_ck,	CK_443X),
	CLK("omap2_mcspi.4",	"ick",				&dummy_ck,	CK_443X),
3386 3387 3388 3389
	CLK(NULL,	"uart1_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"uart2_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"uart3_ick",			&dummy_ck,	CK_443X),
	CLK(NULL,	"uart4_ick",			&dummy_ck,	CK_443X),
3390 3391
	CLK("usbhs_omap",	"usbhost_ick",		&dummy_ck,		CK_443X),
	CLK("usbhs_omap",	"usbtll_fck",		&dummy_ck,	CK_443X),
3392
	CLK("omap_wdt",	"ick",				&dummy_ck,	CK_443X),
3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414
	CLK("omap_timer.1",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.2",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.3",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.4",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.5",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.6",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.7",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.8",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.9",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.10",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.11",	"32k_ck",	&sys_32k_ck,	CK_443X),
	CLK("omap_timer.1",	"sys_ck",	&sys_clkin_ck,	CK_443X),
	CLK("omap_timer.2",	"sys_ck",	&sys_clkin_ck,	CK_443X),
	CLK("omap_timer.3",	"sys_ck",	&sys_clkin_ck,	CK_443X),
	CLK("omap_timer.4",	"sys_ck",	&sys_clkin_ck,	CK_443X),
	CLK("omap_timer.9",	"sys_ck",	&sys_clkin_ck,	CK_443X),
	CLK("omap_timer.10",	"sys_ck",	&sys_clkin_ck,	CK_443X),
	CLK("omap_timer.11",	"sys_ck",	&sys_clkin_ck,	CK_443X),
	CLK("omap_timer.5",	"sys_ck",	&syc_clk_div_ck,	CK_443X),
	CLK("omap_timer.6",	"sys_ck",	&syc_clk_div_ck,	CK_443X),
	CLK("omap_timer.7",	"sys_ck",	&syc_clk_div_ck,	CK_443X),
	CLK("omap_timer.8",	"sys_ck",	&syc_clk_div_ck,	CK_443X),
3415 3416
};

3417
int __init omap4xxx_clk_init(void)
3418 3419 3420 3421
{
	struct omap_clk *c;
	u32 cpu_clkflg;

3422
	if (cpu_is_omap443x()) {
3423 3424
		cpu_mask = RATE_IN_4430;
		cpu_clkflg = CK_443X;
3425
	} else if (cpu_is_omap446x()) {
3426 3427
		cpu_mask = RATE_IN_4460 | RATE_IN_4430;
		cpu_clkflg = CK_446X | CK_443X;
3428 3429
	} else {
		return 0;
3430 3431 3432
	}

	clk_init(&omap2_clk_functions);
3433 3434 3435 3436 3437 3438 3439

	/*
	 * Must stay commented until all OMAP SoC drivers are
	 * converted to runtime PM, or drivers may start crashing
	 *
	 * omap2_clk_disable_clkdm_control();
	 */
3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452

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

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

3453 3454 3455
	/* Disable autoidle on all clocks; let the PM code enable it later */
	omap_clk_disable_autoidle_all();

3456 3457 3458 3459 3460 3461 3462 3463 3464 3465
	recalculate_root_clocks();

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

	return 0;
}