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

16 17
#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK24XX_H
#define __ARCH_ARM_MACH_OMAP2_CLOCK24XX_H
18

19 20 21 22 23 24 25 26
#include "clock.h"

#include "prm.h"
#include "cm.h"
#include "prm-regbits-24xx.h"
#include "cm-regbits-24xx.h"
#include "sdrc.h"

27 28 29 30 31 32
static void omap2_table_mpu_recalc(struct clk *clk);
static int omap2_select_table_rate(struct clk *clk, unsigned long rate);
static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate);
static void omap2_sys_clk_recalc(struct clk *clk);
static void omap2_osc_clk_recalc(struct clk *clk);
static void omap2_sys_clk_recalc(struct clk *clk);
33 34
static void omap2_dpllcore_recalc(struct clk *clk);
static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate);
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 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

/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP
 * CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL CM_CLKSEL2_PLL, CM_CLKSEL_MDM
 */
struct prcm_config {
	unsigned long xtal_speed;	/* crystal rate */
	unsigned long dpll_speed;	/* dpll: out*xtal*M/(N-1)table_recalc */
	unsigned long mpu_speed;	/* speed of MPU */
	unsigned long cm_clksel_mpu;	/* mpu divider */
	unsigned long cm_clksel_dsp;	/* dsp+iva1 div(2420), iva2.1(2430) */
	unsigned long cm_clksel_gfx;	/* gfx dividers */
	unsigned long cm_clksel1_core;	/* major subsystem dividers */
	unsigned long cm_clksel1_pll;	/* m,n */
	unsigned long cm_clksel2_pll;	/* dpllx1 or x2 out */
	unsigned long cm_clksel_mdm;	/* modem dividers 2430 only */
	unsigned long base_sdrc_rfr;	/* base refresh timing for a set */
	unsigned char flags;
};

/*
 * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
 * These configurations are characterized by voltage and speed for clocks.
 * The device is only validated for certain combinations. One way to express
 * these combinations is via the 'ratio's' which the clocks operate with
 * respect to each other. These ratio sets are for a given voltage/DPLL
 * setting. All configurations can be described by a DPLL setting and a ratio
 * There are 3 ratio sets for the 2430 and X ratio sets for 2420.
 *
 * 2430 differs from 2420 in that there are no more phase synchronizers used.
 * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
 * 2430 (iva2.1, NOdsp, mdm)
 */

/* Core fields for cm_clksel, not ratio governed */
#define RX_CLKSEL_DSS1			(0x10 << 8)
#define RX_CLKSEL_DSS2			(0x0 << 13)
#define RX_CLKSEL_SSI			(0x5 << 20)

/*-------------------------------------------------------------------------
 * Voltage/DPLL ratios
 *-------------------------------------------------------------------------*/

/* 2430 Ratio's, 2430-Ratio Config 1 */
#define R1_CLKSEL_L3			(4 << 0)
#define R1_CLKSEL_L4			(2 << 5)
#define R1_CLKSEL_USB			(4 << 25)
#define R1_CM_CLKSEL1_CORE_VAL		R1_CLKSEL_USB | RX_CLKSEL_SSI | \
					RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
					R1_CLKSEL_L4 | R1_CLKSEL_L3
#define R1_CLKSEL_MPU			(2 << 0)
#define R1_CM_CLKSEL_MPU_VAL		R1_CLKSEL_MPU
#define R1_CLKSEL_DSP			(2 << 0)
#define R1_CLKSEL_DSP_IF		(2 << 5)
#define R1_CM_CLKSEL_DSP_VAL		R1_CLKSEL_DSP | R1_CLKSEL_DSP_IF
#define R1_CLKSEL_GFX			(2 << 0)
#define R1_CM_CLKSEL_GFX_VAL		R1_CLKSEL_GFX
#define R1_CLKSEL_MDM			(4 << 0)
#define R1_CM_CLKSEL_MDM_VAL		R1_CLKSEL_MDM

/* 2430-Ratio Config 2 */
#define R2_CLKSEL_L3			(6 << 0)
#define R2_CLKSEL_L4			(2 << 5)
#define R2_CLKSEL_USB			(2 << 25)
#define R2_CM_CLKSEL1_CORE_VAL		R2_CLKSEL_USB | RX_CLKSEL_SSI | \
					RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
					R2_CLKSEL_L4 | R2_CLKSEL_L3
#define R2_CLKSEL_MPU			(2 << 0)
#define R2_CM_CLKSEL_MPU_VAL		R2_CLKSEL_MPU
#define R2_CLKSEL_DSP			(2 << 0)
#define R2_CLKSEL_DSP_IF		(3 << 5)
#define R2_CM_CLKSEL_DSP_VAL		R2_CLKSEL_DSP | R2_CLKSEL_DSP_IF
#define R2_CLKSEL_GFX			(2 << 0)
#define R2_CM_CLKSEL_GFX_VAL		R2_CLKSEL_GFX
#define R2_CLKSEL_MDM			(6 << 0)
#define R2_CM_CLKSEL_MDM_VAL		R2_CLKSEL_MDM

/* 2430-Ratio Bootm (BYPASS) */
#define RB_CLKSEL_L3			(1 << 0)
#define RB_CLKSEL_L4			(1 << 5)
#define RB_CLKSEL_USB			(1 << 25)
#define RB_CM_CLKSEL1_CORE_VAL		RB_CLKSEL_USB | RX_CLKSEL_SSI | \
					RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
					RB_CLKSEL_L4 | RB_CLKSEL_L3
#define RB_CLKSEL_MPU			(1 << 0)
#define RB_CM_CLKSEL_MPU_VAL		RB_CLKSEL_MPU
#define RB_CLKSEL_DSP			(1 << 0)
#define RB_CLKSEL_DSP_IF		(1 << 5)
#define RB_CM_CLKSEL_DSP_VAL		RB_CLKSEL_DSP | RB_CLKSEL_DSP_IF
#define RB_CLKSEL_GFX			(1 << 0)
#define RB_CM_CLKSEL_GFX_VAL		RB_CLKSEL_GFX
#define RB_CLKSEL_MDM			(1 << 0)
#define RB_CM_CLKSEL_MDM_VAL		RB_CLKSEL_MDM

/* 2420 Ratio Equivalents */
#define RXX_CLKSEL_VLYNQ		(0x12 << 15)
#define RXX_CLKSEL_SSI			(0x8 << 20)

/* 2420-PRCM III 532MHz core */
#define RIII_CLKSEL_L3			(4 << 0)	/* 133MHz */
#define RIII_CLKSEL_L4			(2 << 5)	/* 66.5MHz */
#define RIII_CLKSEL_USB			(4 << 25)	/* 33.25MHz */
#define RIII_CM_CLKSEL1_CORE_VAL	RIII_CLKSEL_USB | RXX_CLKSEL_SSI | \
					RXX_CLKSEL_VLYNQ | RX_CLKSEL_DSS2 | \
					RX_CLKSEL_DSS1 | RIII_CLKSEL_L4 | \
					RIII_CLKSEL_L3
#define RIII_CLKSEL_MPU			(2 << 0)	/* 266MHz */
#define RIII_CM_CLKSEL_MPU_VAL		RIII_CLKSEL_MPU
#define RIII_CLKSEL_DSP			(3 << 0)	/* c5x - 177.3MHz */
#define RIII_CLKSEL_DSP_IF		(2 << 5)	/* c5x - 88.67MHz */
#define RIII_SYNC_DSP			(1 << 7)	/* Enable sync */
#define RIII_CLKSEL_IVA			(6 << 8)	/* iva1 - 88.67MHz */
#define RIII_SYNC_IVA			(1 << 13)	/* Enable sync */
#define RIII_CM_CLKSEL_DSP_VAL		RIII_SYNC_IVA | RIII_CLKSEL_IVA | \
					RIII_SYNC_DSP | RIII_CLKSEL_DSP_IF | \
					RIII_CLKSEL_DSP
#define RIII_CLKSEL_GFX			(2 << 0)	/* 66.5MHz */
#define RIII_CM_CLKSEL_GFX_VAL		RIII_CLKSEL_GFX

/* 2420-PRCM II 600MHz core */
#define RII_CLKSEL_L3			(6 << 0)	/* 100MHz */
#define RII_CLKSEL_L4			(2 << 5)	/* 50MHz */
#define RII_CLKSEL_USB			(2 << 25)	/* 50MHz */
#define RII_CM_CLKSEL1_CORE_VAL		RII_CLKSEL_USB | \
					RXX_CLKSEL_SSI | RXX_CLKSEL_VLYNQ | \
					RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
					RII_CLKSEL_L4 | RII_CLKSEL_L3
#define RII_CLKSEL_MPU			(2 << 0)	/* 300MHz */
#define RII_CM_CLKSEL_MPU_VAL		RII_CLKSEL_MPU
#define RII_CLKSEL_DSP			(3 << 0)	/* c5x - 200MHz */
#define RII_CLKSEL_DSP_IF		(2 << 5)	/* c5x - 100MHz */
#define RII_SYNC_DSP			(0 << 7)	/* Bypass sync */
167
#define RII_CLKSEL_IVA			(3 << 8)	/* iva1 - 200MHz */
168 169 170 171 172 173 174
#define RII_SYNC_IVA			(0 << 13)	/* Bypass sync */
#define RII_CM_CLKSEL_DSP_VAL		RII_SYNC_IVA | RII_CLKSEL_IVA | \
					RII_SYNC_DSP | RII_CLKSEL_DSP_IF | \
					RII_CLKSEL_DSP
#define RII_CLKSEL_GFX			(2 << 0)	/* 50MHz */
#define RII_CM_CLKSEL_GFX_VAL		RII_CLKSEL_GFX

175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
/* 2420-PRCM I 660MHz core */
#define RI_CLKSEL_L3			(4 << 0)	/* 165MHz */
#define RI_CLKSEL_L4			(2 << 5)	/* 82.5MHz */
#define RI_CLKSEL_USB			(4 << 25)	/* 41.25MHz */
#define RI_CM_CLKSEL1_CORE_VAL		RI_CLKSEL_USB | \
					RXX_CLKSEL_SSI | RXX_CLKSEL_VLYNQ | \
					RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
					RI_CLKSEL_L4 | RI_CLKSEL_L3
#define RI_CLKSEL_MPU			(2 << 0)	/* 330MHz */
#define RI_CM_CLKSEL_MPU_VAL		RI_CLKSEL_MPU
#define RI_CLKSEL_DSP			(3 << 0)	/* c5x - 220MHz */
#define RI_CLKSEL_DSP_IF		(2 << 5)	/* c5x - 110MHz */
#define RI_SYNC_DSP			(1 << 7)	/* Activate sync */
#define RI_CLKSEL_IVA			(4 << 8)	/* iva1 - 165MHz */
#define RI_SYNC_IVA			(0 << 13)	/* Bypass sync */
#define RI_CM_CLKSEL_DSP_VAL		RI_SYNC_IVA | RI_CLKSEL_IVA | \
					RI_SYNC_DSP | RI_CLKSEL_DSP_IF | \
					RI_CLKSEL_DSP
#define RI_CLKSEL_GFX			(1 << 0)	/* 165MHz */
#define RI_CM_CLKSEL_GFX_VAL		RI_CLKSEL_GFX

196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
/* 2420-PRCM VII (boot) */
#define RVII_CLKSEL_L3			(1 << 0)
#define RVII_CLKSEL_L4			(1 << 5)
#define RVII_CLKSEL_DSS1		(1 << 8)
#define RVII_CLKSEL_DSS2		(0 << 13)
#define RVII_CLKSEL_VLYNQ		(1 << 15)
#define RVII_CLKSEL_SSI			(1 << 20)
#define RVII_CLKSEL_USB			(1 << 25)

#define RVII_CM_CLKSEL1_CORE_VAL	RVII_CLKSEL_USB | RVII_CLKSEL_SSI | \
					RVII_CLKSEL_VLYNQ | RVII_CLKSEL_DSS2 | \
					RVII_CLKSEL_DSS1 | RVII_CLKSEL_L4 | RVII_CLKSEL_L3

#define RVII_CLKSEL_MPU			(1 << 0) /* all divide by 1 */
#define RVII_CM_CLKSEL_MPU_VAL		RVII_CLKSEL_MPU

#define RVII_CLKSEL_DSP			(1 << 0)
#define RVII_CLKSEL_DSP_IF		(1 << 5)
#define RVII_SYNC_DSP			(0 << 7)
#define RVII_CLKSEL_IVA			(1 << 8)
#define RVII_SYNC_IVA			(0 << 13)
#define RVII_CM_CLKSEL_DSP_VAL		RVII_SYNC_IVA | RVII_CLKSEL_IVA | RVII_SYNC_DSP | \
					RVII_CLKSEL_DSP_IF | RVII_CLKSEL_DSP

#define RVII_CLKSEL_GFX			(1 << 0)
#define RVII_CM_CLKSEL_GFX_VAL		RVII_CLKSEL_GFX

/*-------------------------------------------------------------------------
 * 2430 Target modes: Along with each configuration the CPU has several
 * modes which goes along with them. Modes mainly are the addition of
 * describe DPLL combinations to go along with a ratio.
 *-------------------------------------------------------------------------*/

/* Hardware governed */
#define MX_48M_SRC			(0 << 3)
#define MX_54M_SRC			(0 << 5)
#define MX_APLLS_CLIKIN_12		(3 << 23)
#define MX_APLLS_CLIKIN_13		(2 << 23)
#define MX_APLLS_CLIKIN_19_2		(0 << 23)

/*
 * 2430 - standalone, 2*ref*M/(n+1), M/N is for exactness not relock speed
 * #5a	(ratio1) baseport-target, target DPLL = 266*2 = 532MHz
 */
#define M5A_DPLL_MULT_12		(133 << 12)
#define M5A_DPLL_DIV_12			(5 << 8)
#define M5A_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | \
					M5A_DPLL_DIV_12 | M5A_DPLL_MULT_12 | \
					MX_APLLS_CLIKIN_12
245 246
#define M5A_DPLL_MULT_13		(61 << 12)
#define M5A_DPLL_DIV_13			(2 << 8)
247 248 249
#define M5A_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | \
					M5A_DPLL_DIV_13 | M5A_DPLL_MULT_13 | \
					MX_APLLS_CLIKIN_13
250 251
#define M5A_DPLL_MULT_19		(55 << 12)
#define M5A_DPLL_DIV_19			(3 << 8)
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
#define M5A_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | \
					M5A_DPLL_DIV_19 | M5A_DPLL_MULT_19 | \
					MX_APLLS_CLIKIN_19_2
/* #5b	(ratio1) target DPLL = 200*2 = 400MHz */
#define M5B_DPLL_MULT_12		(50 << 12)
#define M5B_DPLL_DIV_12			(2 << 8)
#define M5B_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | \
					M5B_DPLL_DIV_12 | M5B_DPLL_MULT_12 | \
					MX_APLLS_CLIKIN_12
#define M5B_DPLL_MULT_13		(200 << 12)
#define M5B_DPLL_DIV_13			(12 << 8)

#define M5B_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | \
					M5B_DPLL_DIV_13 | M5B_DPLL_MULT_13 | \
					MX_APLLS_CLIKIN_13
#define M5B_DPLL_MULT_19		(125 << 12)
#define M5B_DPLL_DIV_19			(31 << 8)
#define M5B_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | \
					M5B_DPLL_DIV_19 | M5B_DPLL_MULT_19 | \
					MX_APLLS_CLIKIN_19_2
/*
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
 * #4	(ratio2), DPLL = 399*2 = 798MHz, L3=133MHz
 */
#define M4_DPLL_MULT_12			(133 << 12)
#define M4_DPLL_DIV_12			(3 << 8)
#define M4_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | \
					M4_DPLL_DIV_12 | M4_DPLL_MULT_12 | \
					MX_APLLS_CLIKIN_12

#define M4_DPLL_MULT_13			(399 << 12)
#define M4_DPLL_DIV_13			(12 << 8)
#define M4_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | \
					M4_DPLL_DIV_13 | M4_DPLL_MULT_13 | \
					MX_APLLS_CLIKIN_13

#define M4_DPLL_MULT_19			(145 << 12)
#define M4_DPLL_DIV_19			(6 << 8)
#define M4_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | \
					M4_DPLL_DIV_19 | M4_DPLL_MULT_19 | \
					MX_APLLS_CLIKIN_19_2

/*
294 295 296 297 298 299 300
 * #3	(ratio2) baseport-target, target DPLL = 330*2 = 660MHz
 */
#define M3_DPLL_MULT_12			(55 << 12)
#define M3_DPLL_DIV_12			(1 << 8)
#define M3_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | \
					M3_DPLL_DIV_12 | M3_DPLL_MULT_12 | \
					MX_APLLS_CLIKIN_12
301 302
#define M3_DPLL_MULT_13			(76 << 12)
#define M3_DPLL_DIV_13			(2 << 8)
303 304 305
#define M3_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | \
					M3_DPLL_DIV_13 | M3_DPLL_MULT_13 | \
					MX_APLLS_CLIKIN_13
306 307
#define M3_DPLL_MULT_19			(17 << 12)
#define M3_DPLL_DIV_19			(0 << 8)
308 309 310
#define M3_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | \
					M3_DPLL_DIV_19 | M3_DPLL_MULT_19 | \
					MX_APLLS_CLIKIN_19_2
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335

/*
 * #2   (ratio1) DPLL = 330*2 = 660MHz, L3=165MHz
 */
#define M2_DPLL_MULT_12		        (55 << 12)
#define M2_DPLL_DIV_12		        (1 << 8)
#define M2_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | \
					M2_DPLL_DIV_12 | M2_DPLL_MULT_12 | \
					MX_APLLS_CLIKIN_12

/* Speed changes - Used 658.7MHz instead of 660MHz for LP-Refresh M=76 N=2,
 * relock time issue */
/* Core frequency changed from 330/165 to 329/164 MHz*/
#define M2_DPLL_MULT_13		        (76 << 12)
#define M2_DPLL_DIV_13		        (2 << 8)
#define M2_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | \
					M2_DPLL_DIV_13 | M2_DPLL_MULT_13 | \
					MX_APLLS_CLIKIN_13

#define M2_DPLL_MULT_19		        (17 << 12)
#define M2_DPLL_DIV_19		        (0 << 8)
#define M2_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | \
					M2_DPLL_DIV_19 | M2_DPLL_MULT_19 | \
					MX_APLLS_CLIKIN_19_2

336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
/* boot (boot) */
#define MB_DPLL_MULT			(1 << 12)
#define MB_DPLL_DIV			(0 << 8)
#define MB_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
					MB_DPLL_MULT | MX_APLLS_CLIKIN_12

#define MB_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
					MB_DPLL_MULT | MX_APLLS_CLIKIN_13

#define MB_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
					MB_DPLL_MULT | MX_APLLS_CLIKIN_19

/*
 * 2430 - chassis (sedna)
 * 165 (ratio1) same as above #2
 * 150 (ratio1)
 * 133 (ratio2) same as above #4
 * 110 (ratio2) same as above #3
 * 104 (ratio2)
 * boot (boot)
 */

358 359 360 361 362 363 364
/* PRCM I target DPLL = 2*330MHz = 660MHz */
#define MI_DPLL_MULT_12			(55 << 12)
#define MI_DPLL_DIV_12			(1 << 8)
#define MI_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | \
					MI_DPLL_DIV_12 | MI_DPLL_MULT_12 | \
					MX_APLLS_CLIKIN_12

365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
/*
 * 2420 Equivalent - mode registers
 * PRCM II , target DPLL = 2*300MHz = 600MHz
 */
#define MII_DPLL_MULT_12		(50 << 12)
#define MII_DPLL_DIV_12			(1 << 8)
#define MII_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | \
					MII_DPLL_DIV_12 | MII_DPLL_MULT_12 | \
					MX_APLLS_CLIKIN_12
#define MII_DPLL_MULT_13		(300 << 12)
#define MII_DPLL_DIV_13			(12 << 8)
#define MII_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | \
					MII_DPLL_DIV_13 | MII_DPLL_MULT_13 | \
					MX_APLLS_CLIKIN_13

/* PRCM III target DPLL = 2*266 = 532MHz*/
#define MIII_DPLL_MULT_12		(133 << 12)
#define MIII_DPLL_DIV_12		(5 << 8)
#define MIII_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | \
					MIII_DPLL_DIV_12 | MIII_DPLL_MULT_12 | \
					MX_APLLS_CLIKIN_12
#define MIII_DPLL_MULT_13		(266 << 12)
#define MIII_DPLL_DIV_13		(12 << 8)
#define MIII_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | \
					MIII_DPLL_DIV_13 | MIII_DPLL_MULT_13 | \
					MX_APLLS_CLIKIN_13

/* PRCM VII (boot bypass) */
#define MVII_CM_CLKSEL1_PLL_12_VAL	MB_CM_CLKSEL1_PLL_12_VAL
#define MVII_CM_CLKSEL1_PLL_13_VAL	MB_CM_CLKSEL1_PLL_13_VAL

/* High and low operation value */
#define MX_CLKSEL2_PLL_2x_VAL		(2 << 0)
#define MX_CLKSEL2_PLL_1x_VAL		(1 << 0)

/* MPU speed defines */
#define S12M	12000000
#define S13M	13000000
#define S19M	19200000
#define S26M	26000000
#define S100M	100000000
#define S133M	133000000
#define S150M	150000000
408
#define S164M	164000000
409
#define S165M	165000000
410
#define S199M	199000000
411 412 413
#define S200M	200000000
#define S266M	266000000
#define S300M	300000000
414
#define S329M	329000000
415
#define S330M	330000000
416
#define S399M	399000000
417 418 419
#define S400M	400000000
#define S532M	532000000
#define S600M	600000000
420
#define S658M	658000000
421
#define S660M	660000000
422
#define S798M	798000000
423 424 425 426 427 428 429 430 431 432

/*-------------------------------------------------------------------------
 * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
 * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
 * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
 *
 * Filling in table based on H4 boards and 2430-SDPs variants available.
 * There are quite a few more rates combinations which could be defined.
 *
S
Simon Arlott 已提交
433
 * When multiple values are defined the start up will try and choose the
434 435 436 437 438 439 440 441 442
 * fastest one. If a 'fast' value is defined, then automatically, the /2
 * one should be included as it can be used.	Generally having more that
 * one fast set does not make sense, as static timings need to be changed
 * to change the set.	 The exception is the bypass setting which is
 * availble for low power bypass.
 *
 * Note: This table needs to be sorted, fastest to slowest.
 *-------------------------------------------------------------------------*/
static struct prcm_config rate_table[] = {
443 444 445 446 447 448 449
	/* PRCM I - FAST */
	{S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL,		/* 330MHz ARM */
		RI_CM_CLKSEL_DSP_VAL, RI_CM_CLKSEL_GFX_VAL,
		RI_CM_CLKSEL1_CORE_VAL, MI_CM_CLKSEL1_PLL_12_VAL,
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_165MHz,
		RATE_IN_242X},

450 451 452 453
	/* PRCM II - FAST */
	{S12M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL,		/* 300MHz ARM */
		RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
		RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
454
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
455 456 457 458 459
		RATE_IN_242X},

	{S13M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL,		/* 300MHz ARM */
		RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
		RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
460
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
461 462 463 464 465 466
		RATE_IN_242X},

	/* PRCM III - FAST */
	{S12M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL,		/* 266MHz ARM */
		RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
		RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
467
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
468 469 470 471 472
		RATE_IN_242X},

	{S13M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL,		/* 266MHz ARM */
		RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
		RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
473
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
474 475 476 477 478 479
		RATE_IN_242X},

	/* PRCM II - SLOW */
	{S12M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL,		/* 150MHz ARM */
		RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
		RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
480
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
481 482 483 484 485
		RATE_IN_242X},

	{S13M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL,		/* 150MHz ARM */
		RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
		RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
486
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
487 488 489 490 491 492
		RATE_IN_242X},

	/* PRCM III - SLOW */
	{S12M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL,		/* 133MHz ARM */
		RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
		RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
493
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
494 495 496 497 498
		RATE_IN_242X},

	{S13M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL,		/* 133MHz ARM */
		RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
		RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
499
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
500 501 502 503 504 505
		RATE_IN_242X},

	/* PRCM-VII (boot-bypass) */
	{S12M, S12M, S12M, RVII_CM_CLKSEL_MPU_VAL,		/* 12MHz ARM*/
		RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
		RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_12_VAL,
506
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
507 508 509 510 511 512
		RATE_IN_242X},

	/* PRCM-VII (boot-bypass) */
	{S13M, S13M, S13M, RVII_CM_CLKSEL_MPU_VAL,		/* 13MHz ARM */
		RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
		RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_13_VAL,
513
		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
514 515
		RATE_IN_242X},

516 517
	/* PRCM #4 - ratio2 (ES2.1) - FAST */
	{S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL,		/* 399MHz ARM */
518
		R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
519
		R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
520
		MX_CLKSEL2_PLL_2x_VAL, R2_CM_CLKSEL_MDM_VAL,
521 522 523 524 525 526 527 528 529
		SDRC_RFR_CTRL_133MHz,
		RATE_IN_243X},

	/* PRCM #2 - ratio1 (ES2) - FAST */
	{S13M, S658M, S329M, R1_CM_CLKSEL_MPU_VAL,		/* 330MHz ARM */
		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
		R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
		MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
		SDRC_RFR_CTRL_165MHz,
530 531 532 533 534 535 536
		RATE_IN_243X},

	/* PRCM #5a - ratio1 - FAST */
	{S13M, S532M, S266M, R1_CM_CLKSEL_MPU_VAL,		/* 266MHz ARM */
		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
		R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
		MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
537
		SDRC_RFR_CTRL_133MHz,
538 539 540 541 542 543 544
		RATE_IN_243X},

	/* PRCM #5b - ratio1 - FAST */
	{S13M, S400M, S200M, R1_CM_CLKSEL_MPU_VAL,		/* 200MHz ARM */
		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
		R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
		MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
545
		SDRC_RFR_CTRL_100MHz,
546 547
		RATE_IN_243X},

548 549
	/* PRCM #4 - ratio1 (ES2.1) - SLOW */
	{S13M, S399M, S199M, R2_CM_CLKSEL_MPU_VAL,		/* 200MHz ARM */
550
		R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
551
		R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
552
		MX_CLKSEL2_PLL_1x_VAL, R2_CM_CLKSEL_MDM_VAL,
553 554 555 556 557 558 559 560 561
		SDRC_RFR_CTRL_133MHz,
		RATE_IN_243X},

	/* PRCM #2 - ratio1 (ES2) - SLOW */
	{S13M, S329M, S164M, R1_CM_CLKSEL_MPU_VAL,		/* 165MHz ARM */
		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
		R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
		MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
		SDRC_RFR_CTRL_165MHz,
562 563 564 565 566 567 568
		RATE_IN_243X},

	/* PRCM #5a - ratio1 - SLOW */
	{S13M, S266M, S133M, R1_CM_CLKSEL_MPU_VAL,		/* 133MHz ARM */
		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
		R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
		MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
569
		SDRC_RFR_CTRL_133MHz,
570 571 572 573 574 575 576
		RATE_IN_243X},

	/* PRCM #5b - ratio1 - SLOW*/
	{S13M, S200M, S100M, R1_CM_CLKSEL_MPU_VAL,		/* 100MHz ARM */
		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
		R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
		MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
577
		SDRC_RFR_CTRL_100MHz,
578 579 580 581 582 583 584
		RATE_IN_243X},

	/* PRCM-boot/bypass */
	{S13M, S13M, S13M, RB_CM_CLKSEL_MPU_VAL,		/* 13Mhz */
		RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
		RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL,
		MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
585
		SDRC_RFR_CTRL_BYPASS,
586 587 588 589 590 591 592
		RATE_IN_243X},

	/* PRCM-boot/bypass */
	{S12M, S12M, S12M, RB_CM_CLKSEL_MPU_VAL,		/* 12Mhz */
		RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
		RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL,
		MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
593
		SDRC_RFR_CTRL_BYPASS,
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621
		RATE_IN_243X},

	{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
};

/*-------------------------------------------------------------------------
 * 24xx clock tree.
 *
 * NOTE:In many cases here we are assigning a 'default' parent.	In many
 *	cases the parent is selectable.	The get/set parent calls will also
 *	switch sources.
 *
 *	Many some clocks say always_enabled, but they can be auto idled for
 *	power savings. They will always be available upon clock request.
 *
 *	Several sources are given initial rates which may be wrong, this will
 *	be fixed up in the init func.
 *
 *	Things are broadly separated below by clock domains. It is
 *	noteworthy that most periferals have dependencies on multiple clock
 *	domains. Many get their interface clocks from the L4 domain, but get
 *	functional clocks from fixed sources or other core domain derived
 *	clocks.
 *-------------------------------------------------------------------------*/

/* Base external input clocks */
static struct clk func_32k_ck = {
	.name		= "func_32k_ck",
622
	.ops		= &clkops_null,
623 624
	.rate		= 32000,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
625
				RATE_FIXED | RATE_PROPAGATES,
626
	.clkdm_name	= "wkup_clkdm",
627
	.recalc		= &propagate_rate,
628
};
629

630 631 632
/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
static struct clk osc_ck = {		/* (*12, *13, 19.2, *26, 38.4)MHz */
	.name		= "osc_ck",
633
	.ops		= &clkops_oscck,
634
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
635
				RATE_PROPAGATES,
636
	.clkdm_name	= "wkup_clkdm",
637
	.recalc		= &omap2_osc_clk_recalc,
638 639
};

640
/* Without modem likely 12MHz, with modem likely 13MHz */
641 642
static struct clk sys_ck = {		/* (*12, *13, 19.2, 26, 38.4)MHz */
	.name		= "sys_ck",		/* ~ ref_clk also */
643
	.ops		= &clkops_null,
644 645
	.parent		= &osc_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
646
				RATE_PROPAGATES,
647
	.clkdm_name	= "wkup_clkdm",
648 649
	.recalc		= &omap2_sys_clk_recalc,
};
650

651 652
static struct clk alt_ck = {		/* Typical 54M or 48M, may not exist */
	.name		= "alt_ck",
653
	.ops		= &clkops_null,
654 655
	.rate		= 54000000,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
656
				RATE_FIXED | RATE_PROPAGATES,
657
	.clkdm_name	= "wkup_clkdm",
658
	.recalc		= &propagate_rate,
659
};
660

661 662 663 664 665
/*
 * Analog domain root source clocks
 */

/* dpll_ck, is broken out in to special cases through clksel */
666 667 668 669
/* REVISIT: Rate changes on dpll_ck trigger a full set change.	...
 * deal with this
 */

670
static struct dpll_data dpll_dd = {
671 672 673
	.mult_div1_reg		= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.mult_mask		= OMAP24XX_DPLL_MULT_MASK,
	.div1_mask		= OMAP24XX_DPLL_DIV_MASK,
674 675 676
	.max_multiplier		= 1024,
	.max_divider		= 16,
	.rate_tolerance		= DEFAULT_DPLL_RATE_TOLERANCE
677 678
};

679 680 681 682
/*
 * XXX Cannot add round_rate here yet, as this is still a composite clock,
 * not just a DPLL
 */
683 684
static struct clk dpll_ck = {
	.name		= "dpll_ck",
685
	.ops		= &clkops_null,
686
	.parent		= &sys_ck,		/* Can be func_32k also */
687
	.dpll_data	= &dpll_dd,
688
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
689
				RATE_PROPAGATES,
690
	.clkdm_name	= "wkup_clkdm",
691 692
	.recalc		= &omap2_dpllcore_recalc,
	.set_rate	= &omap2_reprogram_dpllcore,
693 694 695 696
};

static struct clk apll96_ck = {
	.name		= "apll96_ck",
697
	.ops		= &clkops_fixed,
698 699
	.parent		= &sys_ck,
	.rate		= 96000000,
700 701
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
				RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
702
	.clkdm_name	= "wkup_clkdm",
703 704 705
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP24XX_EN_96M_PLL_SHIFT,
	.recalc		= &propagate_rate,
706 707 708 709
};

static struct clk apll54_ck = {
	.name		= "apll54_ck",
710
	.ops		= &clkops_fixed,
711 712 713
	.parent		= &sys_ck,
	.rate		= 54000000,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
714
				RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
715
	.clkdm_name	= "wkup_clkdm",
716 717 718
	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
	.enable_bit	= OMAP24XX_EN_54M_PLL_SHIFT,
	.recalc		= &propagate_rate,
719 720 721 722 723
};

/*
 * PRCM digital base sources
 */
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742

/* func_54m_ck */

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

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

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

743 744
static struct clk func_54m_ck = {
	.name		= "func_54m_ck",
745
	.ops		= &clkops_null,
746 747
	.parent		= &apll54_ck,	/* can also be alt_clk */
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
748
				RATE_PROPAGATES,
749
	.clkdm_name	= "wkup_clkdm",
750 751 752 753 754
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_54M_SOURCE,
	.clksel		= func_54m_clksel,
	.recalc		= &omap2_clksel_recalc,
755
};
756

757 758
static struct clk core_ck = {
	.name		= "core_ck",
759
	.ops		= &clkops_null,
760 761
	.parent		= &dpll_ck,		/* can also be 32k */
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
762
				RATE_PROPAGATES,
763
	.clkdm_name	= "wkup_clkdm",
764
	.recalc		= &followparent_recalc,
765
};
766 767 768 769 770

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

773 774 775 776 777 778 779 780 781 782 783 784
static const struct clksel_rate func_96m_alt_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_243X | DEFAULT_RATE },
	{ .div = 0 },
};

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

/* The parent of this clock is not selectable on 2420. */
785 786
static struct clk func_96m_ck = {
	.name		= "func_96m_ck",
787
	.ops		= &clkops_null,
788 789
	.parent		= &apll96_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
790
				RATE_PROPAGATES,
791
	.clkdm_name	= "wkup_clkdm",
792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP2430_96M_SOURCE,
	.clksel		= func_96m_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

/* func_48m_ck */

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

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

static const struct clksel func_48m_clksel[] = {
	{ .parent = &apll96_ck,	.rates = func_48m_apll96_rates },
	{ .parent = &alt_ck, .rates = func_48m_alt_rates },
	{ .parent = NULL }
817 818 819 820
};

static struct clk func_48m_ck = {
	.name		= "func_48m_ck",
821
	.ops		= &clkops_null,
822 823
	.parent		= &apll96_ck,	 /* 96M or Alt */
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
824
				RATE_PROPAGATES,
825
	.clkdm_name	= "wkup_clkdm",
826 827 828 829 830 831 832
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_48M_SOURCE,
	.clksel		= func_48m_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
833 834 835 836
};

static struct clk func_12m_ck = {
	.name		= "func_12m_ck",
837
	.ops		= &clkops_null,
838
	.parent		= &func_48m_ck,
839
	.fixed_div	= 4,
840
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
841
				RATE_PROPAGATES,
842
	.clkdm_name	= "wkup_clkdm",
843
	.recalc		= &omap2_fixed_divisor_recalc,
844 845 846 847 848
};

/* Secure timer, only available in secure mode */
static struct clk wdt1_osc_ck = {
	.name		= "ck_wdt1_osc",
849
	.ops		= &clkops_null, /* RMK: missing? */
850 851
	.parent		= &osc_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892
	.recalc		= &followparent_recalc,
};

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

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

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

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

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

static struct clk sys_clkout_src = {
	.name		= "sys_clkout_src",
893
	.ops		= &clkops_omap2_dflt_wait,
894 895 896
	.parent		= &func_54m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
				RATE_PROPAGATES,
897
	.clkdm_name	= "wkup_clkdm",
898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920
	.enable_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.enable_bit	= OMAP24XX_CLKOUT_EN_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.clksel_mask	= OMAP24XX_CLKOUT_SOURCE_MASK,
	.clksel		= common_clkout_src_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

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

static const struct clksel sys_clkout_clksel[] = {
	{ .parent = &sys_clkout_src, .rates = common_clkout_rates },
	{ .parent = NULL }
921 922 923 924
};

static struct clk sys_clkout = {
	.name		= "sys_clkout",
925
	.ops		= &clkops_null,
926
	.parent		= &sys_clkout_src,
927
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
928
	.clkdm_name	= "wkup_clkdm",
929 930 931 932 933 934 935 936 937 938 939
	.clksel_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.clksel_mask	= OMAP24XX_CLKOUT_DIV_MASK,
	.clksel		= sys_clkout_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

/* In 2430, new in 2420 ES2 */
static struct clk sys_clkout2_src = {
	.name		= "sys_clkout2_src",
940
	.ops		= &clkops_omap2_dflt_wait,
941 942
	.parent		= &func_54m_ck,
	.flags		= CLOCK_IN_OMAP242X | RATE_PROPAGATES,
943
	.clkdm_name	= "wkup_clkdm",
944 945 946 947 948 949
	.enable_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.enable_bit	= OMAP2420_CLKOUT2_EN_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.clksel_mask	= OMAP2420_CLKOUT2_SOURCE_MASK,
	.clksel		= common_clkout_src_clksel,
950
	.recalc		= &omap2_clksel_recalc,
951 952 953 954 955 956 957
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

static const struct clksel sys_clkout2_clksel[] = {
	{ .parent = &sys_clkout2_src, .rates = common_clkout_rates },
	{ .parent = NULL }
958 959 960 961 962
};

/* In 2430, new in 2420 ES2 */
static struct clk sys_clkout2 = {
	.name		= "sys_clkout2",
963
	.ops		= &clkops_null,
964
	.parent		= &sys_clkout2_src,
965
	.flags		= CLOCK_IN_OMAP242X,
966
	.clkdm_name	= "wkup_clkdm",
967 968 969
	.clksel_reg	= OMAP24XX_PRCM_CLKOUT_CTRL,
	.clksel_mask	= OMAP2420_CLKOUT2_DIV_MASK,
	.clksel		= sys_clkout2_clksel,
970
	.recalc		= &omap2_clksel_recalc,
971 972
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
973 974
};

975 976
static struct clk emul_ck = {
	.name		= "emul_ck",
977
	.ops		= &clkops_omap2_dflt_wait,
978 979
	.parent		= &func_54m_ck,
	.flags		= CLOCK_IN_OMAP242X,
980
	.clkdm_name	= "wkup_clkdm",
981 982 983
	.enable_reg	= OMAP24XX_PRCM_CLKEMUL_CTRL,
	.enable_bit	= OMAP24XX_EMULATION_EN_SHIFT,
	.recalc		= &followparent_recalc,
984 985

};
986

987 988 989 990 991 992 993 994 995 996
/*
 * MPU clock domain
 *	Clocks:
 *		MPU_FCLK, MPU_ICLK
 *		INT_M_FCLK, INT_M_I_CLK
 *
 * - Individual clocks are hardware managed.
 * - Base divider comes from: CM_CLKSEL_MPU
 *
 */
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
static const struct clksel_rate mpu_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 4, .val = 4, .flags = RATE_IN_242X },
	{ .div = 6, .val = 6, .flags = RATE_IN_242X },
	{ .div = 8, .val = 8, .flags = RATE_IN_242X },
	{ .div = 0 },
};

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

1011 1012
static struct clk mpu_ck = {	/* Control cpu */
	.name		= "mpu_ck",
1013
	.ops		= &clkops_null,
1014
	.parent		= &core_ck,
1015
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1016
				DELAYED_APP |
1017
				CONFIG_PARTICIPANT | RATE_PROPAGATES,
1018
	.clkdm_name	= "mpu_clkdm",
1019 1020 1021
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP24XX_CLKSEL_MPU_MASK,
1022
	.clksel		= mpu_clksel,
1023
	.recalc		= &omap2_clksel_recalc,
1024
	.round_rate	= &omap2_clksel_round_rate,
1025
	.set_rate	= &omap2_clksel_set_rate
1026
};
1027

1028 1029 1030
/*
 * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain
 * Clocks:
1031
 *	2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
1032
 *	2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP
1033 1034 1035 1036 1037
 *
 * Won't be too specific here. The core clock comes into this block
 * it is divided then tee'ed. One branch goes directly to xyz enable
 * controls. The other branch gets further divided by 2 then possibly
 * routed into a synchronizer and out of clocks abc.
1038
 */
1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056
static const struct clksel_rate dsp_fck_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 3, .val = 3, .flags = RATE_IN_24XX },
	{ .div = 4, .val = 4, .flags = RATE_IN_24XX },
	{ .div = 6, .val = 6, .flags = RATE_IN_242X },
	{ .div = 8, .val = 8, .flags = RATE_IN_242X },
	{ .div = 12, .val = 12, .flags = RATE_IN_242X },
	{ .div = 0 },
};

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

static struct clk dsp_fck = {
	.name		= "dsp_fck",
1057
	.ops		= &clkops_omap2_dflt_wait,
1058
	.parent		= &core_ck,
1059 1060
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP |
				CONFIG_PARTICIPANT | RATE_PROPAGATES,
1061
	.clkdm_name	= "dsp_clkdm",
1062 1063 1064 1065 1066
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP24XX_CLKSEL_DSP_MASK,
	.clksel		= dsp_fck_clksel,
1067
	.recalc		= &omap2_clksel_recalc,
1068 1069
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
1070 1071
};

1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082
/* DSP interface clock */
static const struct clksel_rate dsp_irate_ick_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 3, .val = 3, .flags = RATE_IN_243X },
	{ .div = 0 },
};

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

1085
/* This clock does not exist as such in the TRM. */
1086 1087
static struct clk dsp_irate_ick = {
	.name		= "dsp_irate_ick",
1088
	.ops		= &clkops_null,
1089 1090
	.parent		= &dsp_fck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP |
1091
				CONFIG_PARTICIPANT,
1092 1093 1094
	.clksel_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP24XX_CLKSEL_DSP_IF_MASK,
	.clksel		= dsp_irate_ick_clksel,
1095
	.recalc		= &omap2_clksel_recalc,
1096 1097
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	      = &omap2_clksel_set_rate
1098 1099
};

1100
/* 2420 only */
1101 1102
static struct clk dsp_ick = {
	.name		= "dsp_ick",	 /* apparently ipi and isp */
1103
	.ops		= &clkops_omap2_dflt_wait,
1104 1105 1106 1107 1108 1109 1110 1111 1112
	.parent		= &dsp_irate_ick,
	.flags		= CLOCK_IN_OMAP242X | DELAYED_APP | CONFIG_PARTICIPANT,
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP2420_EN_DSP_IPI_SHIFT,	      /* for ipi */
};

/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
static struct clk iva2_1_ick = {
	.name		= "iva2_1_ick",
1113
	.ops		= &clkops_omap2_dflt_wait,
1114 1115 1116 1117
	.parent		= &dsp_irate_ick,
	.flags		= CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT,
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
1118 1119
};

1120 1121 1122 1123 1124
/*
 * The IVA1 is an ARM7 core on the 2420 that has nothing to do with
 * the C54x, but which is contained in the DSP powerdomain.  Does not
 * exist on later OMAPs.
 */
1125 1126
static struct clk iva1_ifck = {
	.name		= "iva1_ifck",
1127
	.ops		= &clkops_omap2_dflt_wait,
1128
	.parent		= &core_ck,
1129 1130
	.flags		= CLOCK_IN_OMAP242X | CONFIG_PARTICIPANT |
				RATE_PROPAGATES | DELAYED_APP,
1131
	.clkdm_name	= "iva1_clkdm",
1132 1133 1134 1135 1136
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2420_EN_IVA_COP_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP2420_CLKSEL_IVA_MASK,
	.clksel		= dsp_fck_clksel,
1137
	.recalc		= &omap2_clksel_recalc,
1138 1139
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
1140 1141 1142 1143 1144
};

/* IVA1 mpu/int/i/f clocks are /2 of parent */
static struct clk iva1_mpu_int_ifck = {
	.name		= "iva1_mpu_int_ifck",
1145
	.ops		= &clkops_omap2_dflt_wait,
1146
	.parent		= &iva1_ifck,
1147
	.flags		= CLOCK_IN_OMAP242X,
1148
	.clkdm_name	= "iva1_clkdm",
1149 1150 1151 1152
	.enable_reg	= OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2420_EN_IVA_MPU_SHIFT,
	.fixed_div	= 2,
	.recalc		= &omap2_fixed_divisor_recalc,
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
};

/*
 * L3 clock domain
 * L3 clocks are used for both interface and functional clocks to
 * multiple entities. Some of these clocks are completely managed
 * by hardware, and some others allow software control. Hardware
 * managed ones general are based on directly CLK_REQ signals and
 * various auto idle settings. The functional spec sets many of these
 * as 'tie-high' for their enables.
 *
 * I-CLOCKS:
 *	L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
 *	CAM, HS-USB.
 * F-CLOCK
 *	SSI.
 *
 * GPMC memories and SDRC have timing and clock sensitive registers which
 * may very well need notification when the clock changes. Currently for low
 * operating points, these are taken care of in sleep.S.
 */
1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189
static const struct clksel_rate core_l3_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
	{ .div = 2, .val = 2, .flags = RATE_IN_242X },
	{ .div = 4, .val = 4, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 6, .val = 6, .flags = RATE_IN_24XX },
	{ .div = 8, .val = 8, .flags = RATE_IN_242X },
	{ .div = 12, .val = 12, .flags = RATE_IN_242X },
	{ .div = 16, .val = 16, .flags = RATE_IN_242X },
	{ .div = 0 }
};

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

1190 1191
static struct clk core_l3_ck = {	/* Used for ick and fck, interconnect */
	.name		= "core_l3_ck",
1192
	.ops		= &clkops_null,
1193 1194
	.parent		= &core_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1195
				DELAYED_APP |
1196
				CONFIG_PARTICIPANT | RATE_PROPAGATES,
1197
	.clkdm_name	= "core_l3_clkdm",
1198 1199 1200
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_L3_MASK,
	.clksel		= core_l3_clksel,
1201
	.recalc		= &omap2_clksel_recalc,
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

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

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

1219
/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
1220 1221
static struct clk usb_l4_ick = {	/* FS-USB interface clock */
	.name		= "usb_l4_ick",
1222
	.ops		= &clkops_omap2_dflt_wait,
1223
	.parent		= &core_l3_ck,
1224
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1225
				DELAYED_APP | CONFIG_PARTICIPANT,
1226
	.clkdm_name	= "core_l4_clkdm",
1227 1228 1229 1230 1231
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP24XX_EN_USB_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_USB_MASK,
	.clksel		= usb_l4_ick_clksel,
1232
	.recalc		= &omap2_clksel_recalc,
1233 1234
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
1235 1236
};

1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256
/*
 * L4 clock management domain
 *
 * This domain contains lots of interface clocks from the L4 interface, some
 * functional clocks.	Fixed APLL functional source clocks are managed in
 * this domain.
 */
static const struct clksel_rate l4_core_l3_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX },
	{ .div = 0 }
};

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

static struct clk l4_ck = {		/* used both as an ick and fck */
	.name		= "l4_ck",
1257
	.ops		= &clkops_null,
1258 1259
	.parent		= &core_l3_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1260
				DELAYED_APP | RATE_PROPAGATES,
1261 1262 1263 1264 1265 1266 1267 1268 1269
	.clkdm_name	= "core_l4_clkdm",
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_L4_MASK,
	.clksel		= l4_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

1270 1271 1272 1273
/*
 * SSI is in L3 management domain, its direct parent is core not l3,
 * many core power domain entities are grouped into the L3 clock
 * domain.
1274
 * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK
1275 1276 1277
 *
 * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
 */
1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293
static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_24XX },
	{ .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 3, .val = 3, .flags = RATE_IN_24XX },
	{ .div = 4, .val = 4, .flags = RATE_IN_24XX },
	{ .div = 5, .val = 5, .flags = RATE_IN_243X },
	{ .div = 6, .val = 6, .flags = RATE_IN_242X },
	{ .div = 8, .val = 8, .flags = RATE_IN_242X },
	{ .div = 0 }
};

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

1294 1295
static struct clk ssi_ssr_sst_fck = {
	.name		= "ssi_fck",
1296
	.ops		= &clkops_omap2_dflt_wait,
1297 1298
	.parent		= &core_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1299
				DELAYED_APP,
1300
	.clkdm_name	= "core_l3_clkdm",
1301 1302 1303 1304 1305
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_SSI_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_SSI_MASK,
	.clksel		= ssi_ssr_sst_fck_clksel,
1306
	.recalc		= &omap2_clksel_recalc,
1307 1308
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
1309 1310
};

1311

1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322
/*
 * GFX clock domain
 *	Clocks:
 * GFX_FCLK, GFX_ICLK
 * GFX_CG1(2d), GFX_CG2(3d)
 *
 * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
 * The 2d and 3d clocks run at a hardware determined
 * divided value of fclk.
 *
 */
1323 1324 1325 1326 1327 1328 1329 1330
/* XXX REVISIT: GFX clock is part of CONFIG_PARTICIPANT, no? doublecheck. */

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

1331 1332
static struct clk gfx_3d_fck = {
	.name		= "gfx_3d_fck",
1333
	.ops		= &clkops_omap2_dflt_wait,
1334
	.parent		= &core_l3_ck,
1335
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1336
	.clkdm_name	= "gfx_clkdm",
1337 1338 1339 1340 1341
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_3D_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP_CLKSEL_GFX_MASK,
	.clksel		= gfx_fck_clksel,
1342
	.recalc		= &omap2_clksel_recalc,
1343 1344
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
1345 1346 1347 1348
};

static struct clk gfx_2d_fck = {
	.name		= "gfx_2d_fck",
1349
	.ops		= &clkops_omap2_dflt_wait,
1350
	.parent		= &core_l3_ck,
1351
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1352
	.clkdm_name	= "gfx_clkdm",
1353 1354 1355 1356 1357
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_2D_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP_CLKSEL_GFX_MASK,
	.clksel		= gfx_fck_clksel,
1358
	.recalc		= &omap2_clksel_recalc,
1359 1360
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
1361 1362 1363 1364
};

static struct clk gfx_ick = {
	.name		= "gfx_ick",		/* From l3 */
1365
	.ops		= &clkops_omap2_dflt_wait,
1366
	.parent		= &core_l3_ck,
1367
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1368
	.clkdm_name	= "gfx_clkdm",
1369 1370 1371
	.enable_reg	= OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
	.enable_bit	= OMAP_EN_GFX_SHIFT,
	.recalc		= &followparent_recalc,
1372 1373 1374 1375 1376 1377 1378
};

/*
 * Modem clock domain (2430)
 *	CLOCKS:
 *		MDM_OSC_CLK
 *		MDM_ICLK
1379
 * These clocks are usable in chassis mode only.
1380
 */
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393
static const struct clksel_rate mdm_ick_core_rates[] = {
	{ .div = 1, .val = 1, .flags = RATE_IN_243X },
	{ .div = 4, .val = 4, .flags = RATE_IN_243X | DEFAULT_RATE },
	{ .div = 6, .val = 6, .flags = RATE_IN_243X },
	{ .div = 9, .val = 9, .flags = RATE_IN_243X },
	{ .div = 0 }
};

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

1394 1395
static struct clk mdm_ick = {		/* used both as a ick and fck */
	.name		= "mdm_ick",
1396
	.ops		= &clkops_omap2_dflt_wait,
1397
	.parent		= &core_ck,
1398
	.flags		= CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT,
1399
	.clkdm_name	= "mdm_clkdm",
1400 1401 1402 1403 1404
	.enable_reg	= OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
	.enable_bit	= OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
	.clksel_reg	= OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
	.clksel_mask	= OMAP2430_CLKSEL_MDM_MASK,
	.clksel		= mdm_ick_clksel,
1405
	.recalc		= &omap2_clksel_recalc,
1406 1407
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
1408 1409 1410 1411
};

static struct clk mdm_osc_ck = {
	.name		= "mdm_osc_ck",
1412
	.ops		= &clkops_omap2_dflt_wait,
1413
	.parent		= &osc_ck,
1414
	.flags		= CLOCK_IN_OMAP243X,
1415
	.clkdm_name	= "mdm_clkdm",
1416 1417 1418
	.enable_reg	= OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
	.enable_bit	= OMAP2430_EN_OSC_SHIFT,
	.recalc		= &followparent_recalc,
1419 1420 1421 1422 1423 1424 1425 1426 1427 1428
};

/*
 * DSS clock domain
 * CLOCKs:
 * DSS_L4_ICLK, DSS_L3_ICLK,
 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
 *
 * DSS is both initiator and target.
 */
1429 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
/* XXX Add RATE_NOT_VALIDATED */

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

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

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

1456 1457
static struct clk dss_ick = {		/* Enables both L3,L4 ICLK's */
	.name		= "dss_ick",
1458
	.ops		= &clkops_omap2_dflt_wait,
1459
	.parent		= &l4_ck,	/* really both l3 and l4 */
1460
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1461
	.clkdm_name	= "dss_clkdm",
1462 1463 1464
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_DSS1_SHIFT,
	.recalc		= &followparent_recalc,
1465 1466 1467 1468
};

static struct clk dss1_fck = {
	.name		= "dss1_fck",
1469
	.ops		= &clkops_omap2_dflt_wait,
1470 1471
	.parent		= &core_ck,		/* Core or sys */
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1472
				DELAYED_APP,
1473
	.clkdm_name	= "dss_clkdm",
1474 1475 1476 1477 1478 1479
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_DSS1_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_DSS1_MASK,
	.clksel		= dss1_fck_clksel,
1480
	.recalc		= &omap2_clksel_recalc,
1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
};

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

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

static const struct clksel dss2_fck_clksel[] = {
	{ .parent = &sys_ck,	  .rates = dss2_fck_sys_rates },
	{ .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
	{ .parent = NULL }
1499 1500 1501 1502
};

static struct clk dss2_fck = {		/* Alt clk used in power management */
	.name		= "dss2_fck",
1503
	.ops		= &clkops_omap2_dflt_wait,
1504 1505
	.parent		= &sys_ck,		/* fixed at sys_ck or 48MHz */
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1506
				DELAYED_APP,
1507
	.clkdm_name	= "dss_clkdm",
1508 1509 1510 1511 1512 1513 1514
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_DSS2_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_DSS2_MASK,
	.clksel		= dss2_fck_clksel,
	.recalc		= &followparent_recalc,
1515 1516 1517 1518
};

static struct clk dss_54m_fck = {	/* Alt clk used in power management */
	.name		= "dss_54m_fck",	/* 54m tv clk */
1519
	.ops		= &clkops_omap2_dflt_wait,
1520
	.parent		= &func_54m_ck,
1521
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1522
	.clkdm_name	= "dss_clkdm",
1523 1524 1525
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_TV_SHIFT,
	.recalc		= &followparent_recalc,
1526 1527 1528 1529 1530 1531 1532 1533
};

/*
 * CORE power domain ICLK & FCLK defines.
 * Many of the these can have more than one possible parent. Entries
 * here will likely have an L4 interface parent, and may have multiple
 * functional clock parents.
 */
1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545
static const struct clksel_rate gpt_alt_rates[] = {
	{ .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
	{ .div = 0 }
};

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

1546 1547
static struct clk gpt1_ick = {
	.name		= "gpt1_ick",
1548
	.ops		= &clkops_omap2_dflt_wait,
1549 1550
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1551
	.clkdm_name	= "core_l4_clkdm",
1552 1553 1554
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_GPT1_SHIFT,
	.recalc		= &followparent_recalc,
1555 1556 1557 1558
};

static struct clk gpt1_fck = {
	.name		= "gpt1_fck",
1559
	.ops		= &clkops_omap2_dflt_wait,
1560
	.parent		= &func_32k_ck,
1561
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1562
	.clkdm_name	= "core_l4_clkdm",
1563 1564 1565 1566 1567 1568 1569 1570 1571
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_GPT1_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT1_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
1572 1573 1574 1575
};

static struct clk gpt2_ick = {
	.name		= "gpt2_ick",
1576
	.ops		= &clkops_omap2_dflt_wait,
1577 1578
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1579
	.clkdm_name	= "core_l4_clkdm",
1580 1581 1582
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT2_SHIFT,
	.recalc		= &followparent_recalc,
1583 1584 1585 1586
};

static struct clk gpt2_fck = {
	.name		= "gpt2_fck",
1587
	.ops		= &clkops_omap2_dflt_wait,
1588
	.parent		= &func_32k_ck,
1589
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1590
	.clkdm_name	= "core_l4_clkdm",
1591 1592 1593 1594 1595 1596 1597
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT2_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT2_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1598 1599 1600 1601
};

static struct clk gpt3_ick = {
	.name		= "gpt3_ick",
1602
	.ops		= &clkops_omap2_dflt_wait,
1603 1604
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1605
	.clkdm_name	= "core_l4_clkdm",
1606 1607 1608
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT3_SHIFT,
	.recalc		= &followparent_recalc,
1609 1610 1611 1612
};

static struct clk gpt3_fck = {
	.name		= "gpt3_fck",
1613
	.ops		= &clkops_omap2_dflt_wait,
1614
	.parent		= &func_32k_ck,
1615
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1616
	.clkdm_name	= "core_l4_clkdm",
1617 1618 1619 1620 1621 1622 1623
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT3_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT3_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1624 1625 1626 1627
};

static struct clk gpt4_ick = {
	.name		= "gpt4_ick",
1628
	.ops		= &clkops_omap2_dflt_wait,
1629 1630
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1631
	.clkdm_name	= "core_l4_clkdm",
1632 1633 1634
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT4_SHIFT,
	.recalc		= &followparent_recalc,
1635 1636 1637 1638
};

static struct clk gpt4_fck = {
	.name		= "gpt4_fck",
1639
	.ops		= &clkops_omap2_dflt_wait,
1640
	.parent		= &func_32k_ck,
1641
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1642
	.clkdm_name	= "core_l4_clkdm",
1643 1644 1645 1646 1647 1648 1649
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT4_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT4_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1650 1651 1652 1653
};

static struct clk gpt5_ick = {
	.name		= "gpt5_ick",
1654
	.ops		= &clkops_omap2_dflt_wait,
1655 1656
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1657
	.clkdm_name	= "core_l4_clkdm",
1658 1659 1660
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT5_SHIFT,
	.recalc		= &followparent_recalc,
1661 1662 1663 1664
};

static struct clk gpt5_fck = {
	.name		= "gpt5_fck",
1665
	.ops		= &clkops_omap2_dflt_wait,
1666
	.parent		= &func_32k_ck,
1667
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1668
	.clkdm_name	= "core_l4_clkdm",
1669 1670 1671 1672 1673 1674 1675
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT5_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT5_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1676 1677 1678 1679
};

static struct clk gpt6_ick = {
	.name		= "gpt6_ick",
1680
	.ops		= &clkops_omap2_dflt_wait,
1681 1682
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1683
	.clkdm_name	= "core_l4_clkdm",
1684 1685 1686
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT6_SHIFT,
	.recalc		= &followparent_recalc,
1687 1688 1689 1690
};

static struct clk gpt6_fck = {
	.name		= "gpt6_fck",
1691
	.ops		= &clkops_omap2_dflt_wait,
1692
	.parent		= &func_32k_ck,
1693
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1694
	.clkdm_name	= "core_l4_clkdm",
1695 1696 1697 1698 1699 1700 1701
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT6_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT6_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1702 1703 1704 1705
};

static struct clk gpt7_ick = {
	.name		= "gpt7_ick",
1706
	.ops		= &clkops_omap2_dflt_wait,
1707 1708
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1709 1710 1711
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT7_SHIFT,
	.recalc		= &followparent_recalc,
1712 1713 1714 1715
};

static struct clk gpt7_fck = {
	.name		= "gpt7_fck",
1716
	.ops		= &clkops_omap2_dflt_wait,
1717
	.parent		= &func_32k_ck,
1718
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1719
	.clkdm_name	= "core_l4_clkdm",
1720 1721 1722 1723 1724 1725 1726
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT7_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT7_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1727 1728 1729 1730
};

static struct clk gpt8_ick = {
	.name		= "gpt8_ick",
1731
	.ops		= &clkops_omap2_dflt_wait,
1732 1733
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1734
	.clkdm_name	= "core_l4_clkdm",
1735 1736 1737
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT8_SHIFT,
	.recalc		= &followparent_recalc,
1738 1739 1740 1741
};

static struct clk gpt8_fck = {
	.name		= "gpt8_fck",
1742
	.ops		= &clkops_omap2_dflt_wait,
1743
	.parent		= &func_32k_ck,
1744
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1745
	.clkdm_name	= "core_l4_clkdm",
1746 1747 1748 1749 1750 1751 1752
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT8_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT8_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1753 1754 1755 1756
};

static struct clk gpt9_ick = {
	.name		= "gpt9_ick",
1757
	.ops		= &clkops_omap2_dflt_wait,
1758 1759
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1760
	.clkdm_name	= "core_l4_clkdm",
1761 1762 1763
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT9_SHIFT,
	.recalc		= &followparent_recalc,
1764 1765 1766 1767
};

static struct clk gpt9_fck = {
	.name		= "gpt9_fck",
1768
	.ops		= &clkops_omap2_dflt_wait,
1769
	.parent		= &func_32k_ck,
1770
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1771
	.clkdm_name	= "core_l4_clkdm",
1772 1773 1774 1775 1776 1777 1778
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT9_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT9_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1779 1780 1781 1782
};

static struct clk gpt10_ick = {
	.name		= "gpt10_ick",
1783
	.ops		= &clkops_omap2_dflt_wait,
1784 1785
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1786
	.clkdm_name	= "core_l4_clkdm",
1787 1788 1789
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT10_SHIFT,
	.recalc		= &followparent_recalc,
1790 1791 1792 1793
};

static struct clk gpt10_fck = {
	.name		= "gpt10_fck",
1794
	.ops		= &clkops_omap2_dflt_wait,
1795
	.parent		= &func_32k_ck,
1796
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1797
	.clkdm_name	= "core_l4_clkdm",
1798 1799 1800 1801 1802 1803 1804
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT10_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT10_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1805 1806 1807 1808
};

static struct clk gpt11_ick = {
	.name		= "gpt11_ick",
1809
	.ops		= &clkops_omap2_dflt_wait,
1810 1811
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1812
	.clkdm_name	= "core_l4_clkdm",
1813 1814 1815
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT11_SHIFT,
	.recalc		= &followparent_recalc,
1816 1817 1818 1819
};

static struct clk gpt11_fck = {
	.name		= "gpt11_fck",
1820
	.ops		= &clkops_omap2_dflt_wait,
1821
	.parent		= &func_32k_ck,
1822
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1823
	.clkdm_name	= "core_l4_clkdm",
1824 1825 1826 1827 1828 1829 1830
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT11_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT11_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1831 1832 1833 1834
};

static struct clk gpt12_ick = {
	.name		= "gpt12_ick",
1835
	.ops		= &clkops_omap2_dflt_wait,
1836 1837
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1838
	.clkdm_name	= "core_l4_clkdm",
1839 1840 1841
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT12_SHIFT,
	.recalc		= &followparent_recalc,
1842 1843 1844 1845
};

static struct clk gpt12_fck = {
	.name		= "gpt12_fck",
1846
	.ops		= &clkops_omap2_dflt_wait,
1847
	.parent		= &func_32k_ck,
1848
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1849
	.clkdm_name	= "core_l4_clkdm",
1850 1851 1852 1853 1854 1855 1856
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_GPT12_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
	.clksel_mask	= OMAP24XX_CLKSEL_GPT12_MASK,
	.clksel		= omap24xx_gpt_clksel,
	.recalc		= &omap2_clksel_recalc,
1857 1858 1859
};

static struct clk mcbsp1_ick = {
1860
	.name		= "mcbsp_ick",
1861
	.ops		= &clkops_omap2_dflt_wait,
1862
	.id		= 1,
1863 1864
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1865
	.clkdm_name	= "core_l4_clkdm",
1866 1867 1868
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP1_SHIFT,
	.recalc		= &followparent_recalc,
1869 1870 1871
};

static struct clk mcbsp1_fck = {
1872
	.name		= "mcbsp_fck",
1873
	.ops		= &clkops_omap2_dflt_wait,
1874
	.id		= 1,
1875 1876
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1877
	.clkdm_name	= "core_l4_clkdm",
1878 1879 1880
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP1_SHIFT,
	.recalc		= &followparent_recalc,
1881 1882 1883
};

static struct clk mcbsp2_ick = {
1884
	.name		= "mcbsp_ick",
1885
	.ops		= &clkops_omap2_dflt_wait,
1886
	.id		= 2,
1887 1888
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1889
	.clkdm_name	= "core_l4_clkdm",
1890 1891 1892
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
	.recalc		= &followparent_recalc,
1893 1894 1895
};

static struct clk mcbsp2_fck = {
1896
	.name		= "mcbsp_fck",
1897
	.ops		= &clkops_omap2_dflt_wait,
1898
	.id		= 2,
1899 1900
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1901
	.clkdm_name	= "core_l4_clkdm",
1902 1903 1904
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCBSP2_SHIFT,
	.recalc		= &followparent_recalc,
1905 1906 1907
};

static struct clk mcbsp3_ick = {
1908
	.name		= "mcbsp_ick",
1909
	.ops		= &clkops_omap2_dflt_wait,
1910
	.id		= 3,
1911 1912
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X,
1913
	.clkdm_name	= "core_l4_clkdm",
1914 1915 1916
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP3_SHIFT,
	.recalc		= &followparent_recalc,
1917 1918 1919
};

static struct clk mcbsp3_fck = {
1920
	.name		= "mcbsp_fck",
1921
	.ops		= &clkops_omap2_dflt_wait,
1922
	.id		= 3,
1923 1924
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP243X,
1925
	.clkdm_name	= "core_l4_clkdm",
1926 1927 1928
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP3_SHIFT,
	.recalc		= &followparent_recalc,
1929 1930 1931
};

static struct clk mcbsp4_ick = {
1932
	.name		= "mcbsp_ick",
1933
	.ops		= &clkops_omap2_dflt_wait,
1934
	.id		= 4,
1935 1936
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X,
1937
	.clkdm_name	= "core_l4_clkdm",
1938 1939 1940
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP4_SHIFT,
	.recalc		= &followparent_recalc,
1941 1942 1943
};

static struct clk mcbsp4_fck = {
1944
	.name		= "mcbsp_fck",
1945
	.ops		= &clkops_omap2_dflt_wait,
1946
	.id		= 4,
1947 1948
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP243X,
1949
	.clkdm_name	= "core_l4_clkdm",
1950 1951 1952
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP4_SHIFT,
	.recalc		= &followparent_recalc,
1953 1954 1955
};

static struct clk mcbsp5_ick = {
1956
	.name		= "mcbsp_ick",
1957
	.ops		= &clkops_omap2_dflt_wait,
1958
	.id		= 5,
1959 1960
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X,
1961
	.clkdm_name	= "core_l4_clkdm",
1962 1963 1964
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP5_SHIFT,
	.recalc		= &followparent_recalc,
1965 1966 1967
};

static struct clk mcbsp5_fck = {
1968
	.name		= "mcbsp_fck",
1969
	.ops		= &clkops_omap2_dflt_wait,
1970
	.id		= 5,
1971 1972
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP243X,
1973
	.clkdm_name	= "core_l4_clkdm",
1974 1975 1976
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCBSP5_SHIFT,
	.recalc		= &followparent_recalc,
1977 1978 1979
};

static struct clk mcspi1_ick = {
1980
	.name		= "mcspi_ick",
1981
	.ops		= &clkops_omap2_dflt_wait,
1982
	.id		= 1,
1983
	.parent		= &l4_ck,
1984
	.clkdm_name	= "core_l4_clkdm",
1985
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1986 1987 1988
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI1_SHIFT,
	.recalc		= &followparent_recalc,
1989 1990 1991
};

static struct clk mcspi1_fck = {
1992
	.name		= "mcspi_fck",
1993
	.ops		= &clkops_omap2_dflt_wait,
1994
	.id		= 1,
1995 1996
	.parent		= &func_48m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1997
	.clkdm_name	= "core_l4_clkdm",
1998 1999 2000
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI1_SHIFT,
	.recalc		= &followparent_recalc,
2001 2002 2003
};

static struct clk mcspi2_ick = {
2004
	.name		= "mcspi_ick",
2005
	.ops		= &clkops_omap2_dflt_wait,
2006
	.id		= 2,
2007 2008
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2009
	.clkdm_name	= "core_l4_clkdm",
2010 2011 2012
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI2_SHIFT,
	.recalc		= &followparent_recalc,
2013 2014 2015
};

static struct clk mcspi2_fck = {
2016
	.name		= "mcspi_fck",
2017
	.ops		= &clkops_omap2_dflt_wait,
2018
	.id		= 2,
2019 2020
	.parent		= &func_48m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2021
	.clkdm_name	= "core_l4_clkdm",
2022 2023 2024
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MCSPI2_SHIFT,
	.recalc		= &followparent_recalc,
2025 2026 2027
};

static struct clk mcspi3_ick = {
2028
	.name		= "mcspi_ick",
2029
	.ops		= &clkops_omap2_dflt_wait,
2030
	.id		= 3,
2031 2032
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X,
2033
	.clkdm_name	= "core_l4_clkdm",
2034 2035 2036
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MCSPI3_SHIFT,
	.recalc		= &followparent_recalc,
2037 2038 2039
};

static struct clk mcspi3_fck = {
2040
	.name		= "mcspi_fck",
2041
	.ops		= &clkops_omap2_dflt_wait,
2042
	.id		= 3,
2043 2044
	.parent		= &func_48m_ck,
	.flags		= CLOCK_IN_OMAP243X,
2045
	.clkdm_name	= "core_l4_clkdm",
2046 2047 2048
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MCSPI3_SHIFT,
	.recalc		= &followparent_recalc,
2049 2050 2051 2052
};

static struct clk uart1_ick = {
	.name		= "uart1_ick",
2053
	.ops		= &clkops_omap2_dflt_wait,
2054 2055
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2056
	.clkdm_name	= "core_l4_clkdm",
2057 2058 2059
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_UART1_SHIFT,
	.recalc		= &followparent_recalc,
2060 2061 2062 2063
};

static struct clk uart1_fck = {
	.name		= "uart1_fck",
2064
	.ops		= &clkops_omap2_dflt_wait,
2065 2066
	.parent		= &func_48m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2067
	.clkdm_name	= "core_l4_clkdm",
2068 2069 2070
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_UART1_SHIFT,
	.recalc		= &followparent_recalc,
2071 2072 2073 2074
};

static struct clk uart2_ick = {
	.name		= "uart2_ick",
2075
	.ops		= &clkops_omap2_dflt_wait,
2076 2077
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2078
	.clkdm_name	= "core_l4_clkdm",
2079 2080 2081
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_UART2_SHIFT,
	.recalc		= &followparent_recalc,
2082 2083 2084 2085
};

static struct clk uart2_fck = {
	.name		= "uart2_fck",
2086
	.ops		= &clkops_omap2_dflt_wait,
2087 2088
	.parent		= &func_48m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2089
	.clkdm_name	= "core_l4_clkdm",
2090 2091 2092
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_UART2_SHIFT,
	.recalc		= &followparent_recalc,
2093 2094 2095 2096
};

static struct clk uart3_ick = {
	.name		= "uart3_ick",
2097
	.ops		= &clkops_omap2_dflt_wait,
2098 2099
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2100
	.clkdm_name	= "core_l4_clkdm",
2101 2102 2103
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP24XX_EN_UART3_SHIFT,
	.recalc		= &followparent_recalc,
2104 2105 2106 2107
};

static struct clk uart3_fck = {
	.name		= "uart3_fck",
2108
	.ops		= &clkops_omap2_dflt_wait,
2109 2110
	.parent		= &func_48m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2111
	.clkdm_name	= "core_l4_clkdm",
2112 2113 2114
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_UART3_SHIFT,
	.recalc		= &followparent_recalc,
2115 2116 2117 2118
};

static struct clk gpios_ick = {
	.name		= "gpios_ick",
2119
	.ops		= &clkops_omap2_dflt_wait,
2120 2121
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2122
	.clkdm_name	= "core_l4_clkdm",
2123 2124 2125
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_GPIOS_SHIFT,
	.recalc		= &followparent_recalc,
2126 2127 2128 2129
};

static struct clk gpios_fck = {
	.name		= "gpios_fck",
2130
	.ops		= &clkops_omap2_dflt_wait,
2131 2132
	.parent		= &func_32k_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2133
	.clkdm_name	= "wkup_clkdm",
2134 2135 2136
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_GPIOS_SHIFT,
	.recalc		= &followparent_recalc,
2137 2138 2139 2140
};

static struct clk mpu_wdt_ick = {
	.name		= "mpu_wdt_ick",
2141
	.ops		= &clkops_omap2_dflt_wait,
2142 2143
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2144
	.clkdm_name	= "core_l4_clkdm",
2145 2146 2147
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_MPU_WDT_SHIFT,
	.recalc		= &followparent_recalc,
2148 2149 2150 2151
};

static struct clk mpu_wdt_fck = {
	.name		= "mpu_wdt_fck",
2152
	.ops		= &clkops_omap2_dflt_wait,
2153 2154
	.parent		= &func_32k_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2155
	.clkdm_name	= "wkup_clkdm",
2156 2157 2158
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
	.enable_bit	= OMAP24XX_EN_MPU_WDT_SHIFT,
	.recalc		= &followparent_recalc,
2159 2160 2161 2162
};

static struct clk sync_32k_ick = {
	.name		= "sync_32k_ick",
2163
	.ops		= &clkops_omap2_dflt_wait,
2164
	.parent		= &l4_ck,
2165 2166 2167
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
				ENABLE_ON_INIT,
	.clkdm_name	= "core_l4_clkdm",
2168 2169 2170
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_32KSYNC_SHIFT,
	.recalc		= &followparent_recalc,
2171
};
2172

2173 2174
static struct clk wdt1_ick = {
	.name		= "wdt1_ick",
2175
	.ops		= &clkops_omap2_dflt_wait,
2176 2177
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2178
	.clkdm_name	= "core_l4_clkdm",
2179 2180 2181
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_WDT1_SHIFT,
	.recalc		= &followparent_recalc,
2182
};
2183

2184 2185
static struct clk omapctrl_ick = {
	.name		= "omapctrl_ick",
2186
	.ops		= &clkops_omap2_dflt_wait,
2187
	.parent		= &l4_ck,
2188 2189 2190
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
				ENABLE_ON_INIT,
	.clkdm_name	= "core_l4_clkdm",
2191 2192 2193
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP24XX_EN_OMAPCTRL_SHIFT,
	.recalc		= &followparent_recalc,
2194
};
2195

2196 2197
static struct clk icr_ick = {
	.name		= "icr_ick",
2198
	.ops		= &clkops_omap2_dflt_wait,
2199 2200
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X,
2201
	.clkdm_name	= "core_l4_clkdm",
2202 2203 2204
	.enable_reg	= OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
	.enable_bit	= OMAP2430_EN_ICR_SHIFT,
	.recalc		= &followparent_recalc,
2205 2206 2207 2208
};

static struct clk cam_ick = {
	.name		= "cam_ick",
2209
	.ops		= &clkops_omap2_dflt_wait,
2210 2211
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2212
	.clkdm_name	= "core_l4_clkdm",
2213 2214 2215
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_CAM_SHIFT,
	.recalc		= &followparent_recalc,
2216 2217
};

2218 2219 2220 2221 2222
/*
 * cam_fck controls both CAM_MCLK and CAM_FCLK.  It should probably be
 * split into two separate clocks, since the parent clocks are different
 * and the clockdomains are also different.
 */
2223 2224
static struct clk cam_fck = {
	.name		= "cam_fck",
2225
	.ops		= &clkops_omap2_dflt_wait,
2226 2227
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2228
	.clkdm_name	= "core_l3_clkdm",
2229 2230 2231
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_CAM_SHIFT,
	.recalc		= &followparent_recalc,
2232 2233 2234 2235
};

static struct clk mailboxes_ick = {
	.name		= "mailboxes_ick",
2236
	.ops		= &clkops_omap2_dflt_wait,
2237 2238
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2239
	.clkdm_name	= "core_l4_clkdm",
2240 2241 2242
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MAILBOXES_SHIFT,
	.recalc		= &followparent_recalc,
2243 2244 2245 2246
};

static struct clk wdt4_ick = {
	.name		= "wdt4_ick",
2247
	.ops		= &clkops_omap2_dflt_wait,
2248 2249
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2250
	.clkdm_name	= "core_l4_clkdm",
2251 2252 2253
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_WDT4_SHIFT,
	.recalc		= &followparent_recalc,
2254 2255 2256 2257
};

static struct clk wdt4_fck = {
	.name		= "wdt4_fck",
2258
	.ops		= &clkops_omap2_dflt_wait,
2259 2260
	.parent		= &func_32k_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2261
	.clkdm_name	= "core_l4_clkdm",
2262 2263 2264
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_WDT4_SHIFT,
	.recalc		= &followparent_recalc,
2265 2266 2267 2268
};

static struct clk wdt3_ick = {
	.name		= "wdt3_ick",
2269
	.ops		= &clkops_omap2_dflt_wait,
2270 2271
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X,
2272
	.clkdm_name	= "core_l4_clkdm",
2273 2274 2275
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_WDT3_SHIFT,
	.recalc		= &followparent_recalc,
2276 2277 2278 2279
};

static struct clk wdt3_fck = {
	.name		= "wdt3_fck",
2280
	.ops		= &clkops_omap2_dflt_wait,
2281 2282
	.parent		= &func_32k_ck,
	.flags		= CLOCK_IN_OMAP242X,
2283
	.clkdm_name	= "core_l4_clkdm",
2284 2285 2286
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_WDT3_SHIFT,
	.recalc		= &followparent_recalc,
2287 2288 2289 2290
};

static struct clk mspro_ick = {
	.name		= "mspro_ick",
2291
	.ops		= &clkops_omap2_dflt_wait,
2292 2293
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2294
	.clkdm_name	= "core_l4_clkdm",
2295 2296 2297
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_MSPRO_SHIFT,
	.recalc		= &followparent_recalc,
2298 2299 2300 2301
};

static struct clk mspro_fck = {
	.name		= "mspro_fck",
2302
	.ops		= &clkops_omap2_dflt_wait,
2303 2304
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2305
	.clkdm_name	= "core_l4_clkdm",
2306 2307 2308
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_MSPRO_SHIFT,
	.recalc		= &followparent_recalc,
2309 2310 2311 2312
};

static struct clk mmc_ick = {
	.name		= "mmc_ick",
2313
	.ops		= &clkops_omap2_dflt_wait,
2314 2315
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X,
2316
	.clkdm_name	= "core_l4_clkdm",
2317 2318 2319
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_MMC_SHIFT,
	.recalc		= &followparent_recalc,
2320 2321 2322 2323
};

static struct clk mmc_fck = {
	.name		= "mmc_fck",
2324
	.ops		= &clkops_omap2_dflt_wait,
2325 2326
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP242X,
2327
	.clkdm_name	= "core_l4_clkdm",
2328 2329 2330
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_MMC_SHIFT,
	.recalc		= &followparent_recalc,
2331 2332 2333 2334
};

static struct clk fac_ick = {
	.name		= "fac_ick",
2335
	.ops		= &clkops_omap2_dflt_wait,
2336 2337
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2338
	.clkdm_name	= "core_l4_clkdm",
2339 2340 2341
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_FAC_SHIFT,
	.recalc		= &followparent_recalc,
2342 2343 2344 2345
};

static struct clk fac_fck = {
	.name		= "fac_fck",
2346
	.ops		= &clkops_omap2_dflt_wait,
2347 2348
	.parent		= &func_12m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2349
	.clkdm_name	= "core_l4_clkdm",
2350 2351 2352
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_FAC_SHIFT,
	.recalc		= &followparent_recalc,
2353 2354 2355 2356
};

static struct clk eac_ick = {
	.name		= "eac_ick",
2357
	.ops		= &clkops_omap2_dflt_wait,
2358 2359
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X,
2360
	.clkdm_name	= "core_l4_clkdm",
2361 2362 2363
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_EAC_SHIFT,
	.recalc		= &followparent_recalc,
2364 2365 2366 2367
};

static struct clk eac_fck = {
	.name		= "eac_fck",
2368
	.ops		= &clkops_omap2_dflt_wait,
2369 2370
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP242X,
2371
	.clkdm_name	= "core_l4_clkdm",
2372 2373 2374
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_EAC_SHIFT,
	.recalc		= &followparent_recalc,
2375 2376 2377 2378
};

static struct clk hdq_ick = {
	.name		= "hdq_ick",
2379
	.ops		= &clkops_omap2_dflt_wait,
2380 2381
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2382
	.clkdm_name	= "core_l4_clkdm",
2383 2384 2385
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP24XX_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
2386 2387 2388 2389
};

static struct clk hdq_fck = {
	.name		= "hdq_fck",
2390
	.ops		= &clkops_omap2_dflt_wait,
2391 2392
	.parent		= &func_12m_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2393
	.clkdm_name	= "core_l4_clkdm",
2394 2395 2396
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP24XX_EN_HDQ_SHIFT,
	.recalc		= &followparent_recalc,
2397 2398 2399
};

static struct clk i2c2_ick = {
2400
	.name		= "i2c_ick",
2401
	.ops		= &clkops_omap2_dflt_wait,
2402
	.id		= 2,
2403 2404
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2405
	.clkdm_name	= "core_l4_clkdm",
2406 2407 2408
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_I2C2_SHIFT,
	.recalc		= &followparent_recalc,
2409 2410 2411
};

static struct clk i2c2_fck = {
2412
	.name		= "i2c_fck",
2413
	.ops		= &clkops_omap2_dflt_wait,
2414
	.id		= 2,
2415
	.parent		= &func_12m_ck,
2416
	.flags		= CLOCK_IN_OMAP242X,
2417
	.clkdm_name	= "core_l4_clkdm",
2418 2419 2420
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_I2C2_SHIFT,
	.recalc		= &followparent_recalc,
2421 2422 2423
};

static struct clk i2chs2_fck = {
2424
	.name		= "i2c_fck",
2425
	.ops		= &clkops_omap2_dflt_wait,
2426
	.id		= 2,
2427 2428
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP243X,
2429
	.clkdm_name	= "core_l4_clkdm",
2430 2431 2432
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_I2CHS2_SHIFT,
	.recalc		= &followparent_recalc,
2433 2434 2435
};

static struct clk i2c1_ick = {
2436
	.name		= "i2c_ick",
2437
	.ops		= &clkops_omap2_dflt_wait,
2438
	.id		= 1,
2439 2440
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2441
	.clkdm_name	= "core_l4_clkdm",
2442 2443 2444
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_I2C1_SHIFT,
	.recalc		= &followparent_recalc,
2445 2446 2447
};

static struct clk i2c1_fck = {
2448
	.name		= "i2c_fck",
2449
	.ops		= &clkops_omap2_dflt_wait,
2450
	.id		= 1,
2451
	.parent		= &func_12m_ck,
2452
	.flags		= CLOCK_IN_OMAP242X,
2453
	.clkdm_name	= "core_l4_clkdm",
2454 2455 2456
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_I2C1_SHIFT,
	.recalc		= &followparent_recalc,
2457 2458 2459
};

static struct clk i2chs1_fck = {
2460
	.name		= "i2c_fck",
2461
	.ops		= &clkops_omap2_dflt_wait,
2462
	.id		= 1,
2463 2464
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP243X,
2465
	.clkdm_name	= "core_l4_clkdm",
2466 2467 2468 2469 2470 2471 2472
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_I2CHS1_SHIFT,
	.recalc		= &followparent_recalc,
};

static struct clk gpmc_fck = {
	.name		= "gpmc_fck",
2473
	.ops		= &clkops_null, /* RMK: missing? */
2474
	.parent		= &core_l3_ck,
2475 2476 2477
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
				ENABLE_ON_INIT,
	.clkdm_name	= "core_l3_clkdm",
2478 2479 2480 2481 2482
	.recalc		= &followparent_recalc,
};

static struct clk sdma_fck = {
	.name		= "sdma_fck",
2483
	.ops		= &clkops_null, /* RMK: missing? */
2484 2485
	.parent		= &core_l3_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2486
	.clkdm_name	= "core_l3_clkdm",
2487 2488 2489 2490 2491
	.recalc		= &followparent_recalc,
};

static struct clk sdma_ick = {
	.name		= "sdma_ick",
2492
	.ops		= &clkops_null, /* RMK: missing? */
2493 2494
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2495
	.clkdm_name	= "core_l3_clkdm",
2496
	.recalc		= &followparent_recalc,
2497 2498 2499 2500
};

static struct clk vlynq_ick = {
	.name		= "vlynq_ick",
2501
	.ops		= &clkops_omap2_dflt_wait,
2502 2503
	.parent		= &core_l3_ck,
	.flags		= CLOCK_IN_OMAP242X,
2504
	.clkdm_name	= "core_l3_clkdm",
2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
	.enable_bit	= OMAP2420_EN_VLYNQ_SHIFT,
	.recalc		= &followparent_recalc,
};

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

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

static const struct clksel vlynq_fck_clksel[] = {
	{ .parent = &func_96m_ck, .rates = vlynq_fck_96m_rates },
	{ .parent = &core_ck,	  .rates = vlynq_fck_core_rates },
	{ .parent = NULL }
2533 2534 2535 2536
};

static struct clk vlynq_fck = {
	.name		= "vlynq_fck",
2537
	.ops		= &clkops_omap2_dflt_wait,
2538
	.parent		= &func_96m_ck,
2539
	.flags		= CLOCK_IN_OMAP242X | DELAYED_APP,
2540
	.clkdm_name	= "core_l3_clkdm",
2541 2542 2543 2544 2545 2546 2547 2548 2549
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
	.enable_bit	= OMAP2420_EN_VLYNQ_SHIFT,
	.init		= &omap2_init_clksel_parent,
	.clksel_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
	.clksel_mask	= OMAP2420_CLKSEL_VLYNQ_MASK,
	.clksel		= vlynq_fck_clksel,
	.recalc		= &omap2_clksel_recalc,
	.round_rate	= &omap2_clksel_round_rate,
	.set_rate	= &omap2_clksel_set_rate
2550 2551 2552 2553
};

static struct clk sdrc_ick = {
	.name		= "sdrc_ick",
2554
	.ops		= &clkops_omap2_dflt_wait,
2555
	.parent		= &l4_ck,
2556
	.flags		= CLOCK_IN_OMAP243X | ENABLE_ON_INIT,
2557
	.clkdm_name	= "core_l4_clkdm",
2558 2559 2560
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
	.enable_bit	= OMAP2430_EN_SDRC_SHIFT,
	.recalc		= &followparent_recalc,
2561 2562 2563 2564
};

static struct clk des_ick = {
	.name		= "des_ick",
2565
	.ops		= &clkops_omap2_dflt_wait,
2566 2567
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2568
	.clkdm_name	= "core_l4_clkdm",
2569 2570 2571
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_DES_SHIFT,
	.recalc		= &followparent_recalc,
2572 2573 2574 2575
};

static struct clk sha_ick = {
	.name		= "sha_ick",
2576
	.ops		= &clkops_omap2_dflt_wait,
2577 2578
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2579
	.clkdm_name	= "core_l4_clkdm",
2580 2581 2582
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_SHA_SHIFT,
	.recalc		= &followparent_recalc,
2583 2584 2585 2586
};

static struct clk rng_ick = {
	.name		= "rng_ick",
2587
	.ops		= &clkops_omap2_dflt_wait,
2588 2589
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2590
	.clkdm_name	= "core_l4_clkdm",
2591 2592 2593
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_RNG_SHIFT,
	.recalc		= &followparent_recalc,
2594 2595 2596 2597
};

static struct clk aes_ick = {
	.name		= "aes_ick",
2598
	.ops		= &clkops_omap2_dflt_wait,
2599 2600
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2601
	.clkdm_name	= "core_l4_clkdm",
2602 2603 2604
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_AES_SHIFT,
	.recalc		= &followparent_recalc,
2605 2606 2607 2608
};

static struct clk pka_ick = {
	.name		= "pka_ick",
2609
	.ops		= &clkops_omap2_dflt_wait,
2610 2611
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2612
	.clkdm_name	= "core_l4_clkdm",
2613 2614 2615
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
	.enable_bit	= OMAP24XX_EN_PKA_SHIFT,
	.recalc		= &followparent_recalc,
2616 2617 2618 2619
};

static struct clk usb_fck = {
	.name		= "usb_fck",
2620
	.ops		= &clkops_omap2_dflt_wait,
2621 2622
	.parent		= &func_48m_ck,
	.flags		= CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2623
	.clkdm_name	= "core_l3_clkdm",
2624 2625 2626
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP24XX_EN_USB_SHIFT,
	.recalc		= &followparent_recalc,
2627 2628 2629 2630
};

static struct clk usbhs_ick = {
	.name		= "usbhs_ick",
2631
	.ops		= &clkops_omap2_dflt_wait,
2632
	.parent		= &core_l3_ck,
2633
	.flags		= CLOCK_IN_OMAP243X,
2634
	.clkdm_name	= "core_l3_clkdm",
2635 2636 2637
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_USBHS_SHIFT,
	.recalc		= &followparent_recalc,
2638 2639 2640
};

static struct clk mmchs1_ick = {
2641
	.name		= "mmchs_ick",
2642
	.ops		= &clkops_omap2_dflt_wait,
2643 2644
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X,
2645
	.clkdm_name	= "core_l4_clkdm",
2646 2647 2648
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS1_SHIFT,
	.recalc		= &followparent_recalc,
2649 2650 2651
};

static struct clk mmchs1_fck = {
2652
	.name		= "mmchs_fck",
2653
	.ops		= &clkops_omap2_dflt_wait,
2654 2655
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP243X,
2656
	.clkdm_name	= "core_l3_clkdm",
2657 2658 2659
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS1_SHIFT,
	.recalc		= &followparent_recalc,
2660 2661 2662
};

static struct clk mmchs2_ick = {
2663
	.name		= "mmchs_ick",
2664
	.ops		= &clkops_omap2_dflt_wait,
2665
	.id		= 1,
2666 2667
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X,
2668
	.clkdm_name	= "core_l4_clkdm",
2669 2670 2671
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS2_SHIFT,
	.recalc		= &followparent_recalc,
2672 2673 2674
};

static struct clk mmchs2_fck = {
2675
	.name		= "mmchs_fck",
2676
	.ops		= &clkops_omap2_dflt_wait,
2677
	.id		= 1,
2678 2679
	.parent		= &func_96m_ck,
	.flags		= CLOCK_IN_OMAP243X,
2680 2681 2682
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHS2_SHIFT,
	.recalc		= &followparent_recalc,
2683 2684 2685 2686
};

static struct clk gpio5_ick = {
	.name		= "gpio5_ick",
2687
	.ops		= &clkops_omap2_dflt_wait,
2688 2689
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X,
2690
	.clkdm_name	= "core_l4_clkdm",
2691 2692 2693
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_GPIO5_SHIFT,
	.recalc		= &followparent_recalc,
2694 2695 2696 2697
};

static struct clk gpio5_fck = {
	.name		= "gpio5_fck",
2698
	.ops		= &clkops_omap2_dflt_wait,
2699 2700
	.parent		= &func_32k_ck,
	.flags		= CLOCK_IN_OMAP243X,
2701
	.clkdm_name	= "core_l4_clkdm",
2702 2703 2704
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_GPIO5_SHIFT,
	.recalc		= &followparent_recalc,
2705 2706 2707 2708
};

static struct clk mdm_intc_ick = {
	.name		= "mdm_intc_ick",
2709
	.ops		= &clkops_omap2_dflt_wait,
2710 2711
	.parent		= &l4_ck,
	.flags		= CLOCK_IN_OMAP243X,
2712
	.clkdm_name	= "core_l4_clkdm",
2713 2714 2715
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
	.enable_bit	= OMAP2430_EN_MDM_INTC_SHIFT,
	.recalc		= &followparent_recalc,
2716 2717 2718
};

static struct clk mmchsdb1_fck = {
2719
	.name		= "mmchsdb_fck",
2720
	.ops		= &clkops_omap2_dflt_wait,
2721 2722
	.parent		= &func_32k_ck,
	.flags		= CLOCK_IN_OMAP243X,
2723
	.clkdm_name	= "core_l4_clkdm",
2724 2725 2726
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHSDB1_SHIFT,
	.recalc		= &followparent_recalc,
2727 2728 2729
};

static struct clk mmchsdb2_fck = {
2730
	.name		= "mmchsdb_fck",
2731
	.ops		= &clkops_omap2_dflt_wait,
2732
	.id		= 1,
2733 2734
	.parent		= &func_32k_ck,
	.flags		= CLOCK_IN_OMAP243X,
2735
	.clkdm_name	= "core_l4_clkdm",
2736 2737 2738
	.enable_reg	= OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
	.enable_bit	= OMAP2430_EN_MMCHSDB2_SHIFT,
	.recalc		= &followparent_recalc,
2739
};
2740

2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756
/*
 * This clock is a composite clock which does entire set changes then
 * forces a rebalance. It keys on the MPU speed, but it really could
 * be any key speed part of a set in the rate table.
 *
 * to really change a set, you need memory table sets which get changed
 * in sram, pre-notifiers & post notifiers, changing the top set, without
 * having low level display recalc's won't work... this is why dpm notifiers
 * work, isr's off, walk a list of clocks already _off_ and not messing with
 * the bus.
 *
 * This clock should have no parent. It embodies the entire upper level
 * active set. A parent will mess up some of the init also.
 */
static struct clk virt_prcm_set = {
	.name		= "virt_prcm_set",
2757
	.ops		= &clkops_null,
2758
	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
2759
				DELAYED_APP,
2760
	.parent		= &mpu_ck,	/* Indexed by mpu speed, no parent */
2761
	.recalc		= &omap2_table_mpu_recalc,	/* sets are keyed on mpu rate */
2762 2763 2764
	.set_rate	= &omap2_select_table_rate,
	.round_rate	= &omap2_round_to_table_rate,
};
2765 2766

static struct clk *onchip_24xx_clks[] __initdata = {
2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782
	/* external root sources */
	&func_32k_ck,
	&osc_ck,
	&sys_ck,
	&alt_ck,
	/* internal analog sources */
	&dpll_ck,
	&apll96_ck,
	&apll54_ck,
	/* internal prcm root sources */
	&func_54m_ck,
	&core_ck,
	&func_96m_ck,
	&func_48m_ck,
	&func_12m_ck,
	&wdt1_osc_ck,
2783
	&sys_clkout_src,
2784
	&sys_clkout,
2785
	&sys_clkout2_src,
2786
	&sys_clkout2,
2787
	&emul_ck,
2788 2789 2790 2791
	/* mpu domain clocks */
	&mpu_ck,
	/* dsp domain clocks */
	&dsp_fck,
2792 2793 2794 2795 2796
	&dsp_irate_ick,
	&dsp_ick,		/* 242x */
	&iva2_1_ick,		/* 243x */
	&iva1_ifck,		/* 242x */
	&iva1_mpu_int_ifck,	/* 242x */
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 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894
	/* GFX domain clocks */
	&gfx_3d_fck,
	&gfx_2d_fck,
	&gfx_ick,
	/* Modem domain clocks */
	&mdm_ick,
	&mdm_osc_ck,
	/* DSS domain clocks */
	&dss_ick,
	&dss1_fck,
	&dss2_fck,
	&dss_54m_fck,
	/* L3 domain clocks */
	&core_l3_ck,
	&ssi_ssr_sst_fck,
	&usb_l4_ick,
	/* L4 domain clocks */
	&l4_ck,			/* used as both core_l4 and wu_l4 */
	/* virtual meta-group clock */
	&virt_prcm_set,
	/* general l4 interface ck, multi-parent functional clk */
	&gpt1_ick,
	&gpt1_fck,
	&gpt2_ick,
	&gpt2_fck,
	&gpt3_ick,
	&gpt3_fck,
	&gpt4_ick,
	&gpt4_fck,
	&gpt5_ick,
	&gpt5_fck,
	&gpt6_ick,
	&gpt6_fck,
	&gpt7_ick,
	&gpt7_fck,
	&gpt8_ick,
	&gpt8_fck,
	&gpt9_ick,
	&gpt9_fck,
	&gpt10_ick,
	&gpt10_fck,
	&gpt11_ick,
	&gpt11_fck,
	&gpt12_ick,
	&gpt12_fck,
	&mcbsp1_ick,
	&mcbsp1_fck,
	&mcbsp2_ick,
	&mcbsp2_fck,
	&mcbsp3_ick,
	&mcbsp3_fck,
	&mcbsp4_ick,
	&mcbsp4_fck,
	&mcbsp5_ick,
	&mcbsp5_fck,
	&mcspi1_ick,
	&mcspi1_fck,
	&mcspi2_ick,
	&mcspi2_fck,
	&mcspi3_ick,
	&mcspi3_fck,
	&uart1_ick,
	&uart1_fck,
	&uart2_ick,
	&uart2_fck,
	&uart3_ick,
	&uart3_fck,
	&gpios_ick,
	&gpios_fck,
	&mpu_wdt_ick,
	&mpu_wdt_fck,
	&sync_32k_ick,
	&wdt1_ick,
	&omapctrl_ick,
	&icr_ick,
	&cam_fck,
	&cam_ick,
	&mailboxes_ick,
	&wdt4_ick,
	&wdt4_fck,
	&wdt3_ick,
	&wdt3_fck,
	&mspro_ick,
	&mspro_fck,
	&mmc_ick,
	&mmc_fck,
	&fac_ick,
	&fac_fck,
	&eac_ick,
	&eac_fck,
	&hdq_ick,
	&hdq_fck,
	&i2c1_ick,
	&i2c1_fck,
	&i2chs1_fck,
	&i2c2_ick,
	&i2c2_fck,
	&i2chs2_fck,
2895 2896 2897
	&gpmc_fck,
	&sdma_fck,
	&sdma_ick,
2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919
	&vlynq_ick,
	&vlynq_fck,
	&sdrc_ick,
	&des_ick,
	&sha_ick,
	&rng_ick,
	&aes_ick,
	&pka_ick,
	&usb_fck,
	&usbhs_ick,
	&mmchs1_ick,
	&mmchs1_fck,
	&mmchs2_ick,
	&mmchs2_fck,
	&gpio5_ick,
	&gpio5_fck,
	&mdm_intc_ick,
	&mmchsdb1_fck,
	&mmchsdb2_fck,
};

#endif
2920