blob: 2aa0b5e656083e57fca6bc8cb908a77b436ad5a8 [file] [log] [blame]
Tony Lindgren046d6b22005-11-10 14:26:52 +00001/*
Tony Lindgrena16e9702008-03-18 11:56:39 +02002 * linux/arch/arm/mach-omap2/clock24xx.h
Tony Lindgren046d6b22005-11-10 14:26:52 +00003 *
Tony Lindgrena16e9702008-03-18 11:56:39 +02004 * Copyright (C) 2005-2008 Texas Instruments, Inc.
5 * Copyright (C) 2004-2008 Nokia Corporation
6 *
7 * Contacts:
Tony Lindgren046d6b22005-11-10 14:26:52 +00008 * Richard Woodruff <r-woodruff2@ti.com>
Tony Lindgrena16e9702008-03-18 11:56:39 +02009 * Paul Walmsley
Tony Lindgren046d6b22005-11-10 14:26:52 +000010 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
Paul Walmsley6b8858a2008-03-18 10:35:15 +020016#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK24XX_H
17#define __ARCH_ARM_MACH_OMAP2_CLOCK24XX_H
Tony Lindgren046d6b22005-11-10 14:26:52 +000018
Paul Walmsley6b8858a2008-03-18 10:35:15 +020019#include "clock.h"
20
21#include "prm.h"
22#include "cm.h"
23#include "prm-regbits-24xx.h"
24#include "cm-regbits-24xx.h"
25#include "sdrc.h"
26
Tony Lindgrena16e9702008-03-18 11:56:39 +020027static void omap2_table_mpu_recalc(struct clk *clk);
28static int omap2_select_table_rate(struct clk *clk, unsigned long rate);
29static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate);
30static void omap2_sys_clk_recalc(struct clk *clk);
31static void omap2_osc_clk_recalc(struct clk *clk);
32static void omap2_sys_clk_recalc(struct clk *clk);
Paul Walmsley88b8ba92008-07-03 12:24:46 +030033static void omap2_dpllcore_recalc(struct clk *clk);
Paul Walmsley88b8ba92008-07-03 12:24:46 +030034static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate);
Tony Lindgren046d6b22005-11-10 14:26:52 +000035
Tony Lindgren046d6b22005-11-10 14:26:52 +000036/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
37 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP
38 * CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL CM_CLKSEL2_PLL, CM_CLKSEL_MDM
39 */
40struct prcm_config {
41 unsigned long xtal_speed; /* crystal rate */
42 unsigned long dpll_speed; /* dpll: out*xtal*M/(N-1)table_recalc */
43 unsigned long mpu_speed; /* speed of MPU */
44 unsigned long cm_clksel_mpu; /* mpu divider */
45 unsigned long cm_clksel_dsp; /* dsp+iva1 div(2420), iva2.1(2430) */
46 unsigned long cm_clksel_gfx; /* gfx dividers */
47 unsigned long cm_clksel1_core; /* major subsystem dividers */
48 unsigned long cm_clksel1_pll; /* m,n */
49 unsigned long cm_clksel2_pll; /* dpllx1 or x2 out */
50 unsigned long cm_clksel_mdm; /* modem dividers 2430 only */
51 unsigned long base_sdrc_rfr; /* base refresh timing for a set */
52 unsigned char flags;
53};
54
Tony Lindgren046d6b22005-11-10 14:26:52 +000055/*
56 * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
57 * These configurations are characterized by voltage and speed for clocks.
58 * The device is only validated for certain combinations. One way to express
59 * these combinations is via the 'ratio's' which the clocks operate with
60 * respect to each other. These ratio sets are for a given voltage/DPLL
61 * setting. All configurations can be described by a DPLL setting and a ratio
62 * There are 3 ratio sets for the 2430 and X ratio sets for 2420.
63 *
64 * 2430 differs from 2420 in that there are no more phase synchronizers used.
65 * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
66 * 2430 (iva2.1, NOdsp, mdm)
67 */
68
69/* Core fields for cm_clksel, not ratio governed */
70#define RX_CLKSEL_DSS1 (0x10 << 8)
71#define RX_CLKSEL_DSS2 (0x0 << 13)
72#define RX_CLKSEL_SSI (0x5 << 20)
73
74/*-------------------------------------------------------------------------
75 * Voltage/DPLL ratios
76 *-------------------------------------------------------------------------*/
77
78/* 2430 Ratio's, 2430-Ratio Config 1 */
79#define R1_CLKSEL_L3 (4 << 0)
80#define R1_CLKSEL_L4 (2 << 5)
81#define R1_CLKSEL_USB (4 << 25)
82#define R1_CM_CLKSEL1_CORE_VAL R1_CLKSEL_USB | RX_CLKSEL_SSI | \
83 RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
84 R1_CLKSEL_L4 | R1_CLKSEL_L3
85#define R1_CLKSEL_MPU (2 << 0)
86#define R1_CM_CLKSEL_MPU_VAL R1_CLKSEL_MPU
87#define R1_CLKSEL_DSP (2 << 0)
88#define R1_CLKSEL_DSP_IF (2 << 5)
89#define R1_CM_CLKSEL_DSP_VAL R1_CLKSEL_DSP | R1_CLKSEL_DSP_IF
90#define R1_CLKSEL_GFX (2 << 0)
91#define R1_CM_CLKSEL_GFX_VAL R1_CLKSEL_GFX
92#define R1_CLKSEL_MDM (4 << 0)
93#define R1_CM_CLKSEL_MDM_VAL R1_CLKSEL_MDM
94
95/* 2430-Ratio Config 2 */
96#define R2_CLKSEL_L3 (6 << 0)
97#define R2_CLKSEL_L4 (2 << 5)
98#define R2_CLKSEL_USB (2 << 25)
99#define R2_CM_CLKSEL1_CORE_VAL R2_CLKSEL_USB | RX_CLKSEL_SSI | \
100 RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
101 R2_CLKSEL_L4 | R2_CLKSEL_L3
102#define R2_CLKSEL_MPU (2 << 0)
103#define R2_CM_CLKSEL_MPU_VAL R2_CLKSEL_MPU
104#define R2_CLKSEL_DSP (2 << 0)
105#define R2_CLKSEL_DSP_IF (3 << 5)
106#define R2_CM_CLKSEL_DSP_VAL R2_CLKSEL_DSP | R2_CLKSEL_DSP_IF
107#define R2_CLKSEL_GFX (2 << 0)
108#define R2_CM_CLKSEL_GFX_VAL R2_CLKSEL_GFX
109#define R2_CLKSEL_MDM (6 << 0)
110#define R2_CM_CLKSEL_MDM_VAL R2_CLKSEL_MDM
111
112/* 2430-Ratio Bootm (BYPASS) */
113#define RB_CLKSEL_L3 (1 << 0)
114#define RB_CLKSEL_L4 (1 << 5)
115#define RB_CLKSEL_USB (1 << 25)
116#define RB_CM_CLKSEL1_CORE_VAL RB_CLKSEL_USB | RX_CLKSEL_SSI | \
117 RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
118 RB_CLKSEL_L4 | RB_CLKSEL_L3
119#define RB_CLKSEL_MPU (1 << 0)
120#define RB_CM_CLKSEL_MPU_VAL RB_CLKSEL_MPU
121#define RB_CLKSEL_DSP (1 << 0)
122#define RB_CLKSEL_DSP_IF (1 << 5)
123#define RB_CM_CLKSEL_DSP_VAL RB_CLKSEL_DSP | RB_CLKSEL_DSP_IF
124#define RB_CLKSEL_GFX (1 << 0)
125#define RB_CM_CLKSEL_GFX_VAL RB_CLKSEL_GFX
126#define RB_CLKSEL_MDM (1 << 0)
127#define RB_CM_CLKSEL_MDM_VAL RB_CLKSEL_MDM
128
129/* 2420 Ratio Equivalents */
130#define RXX_CLKSEL_VLYNQ (0x12 << 15)
131#define RXX_CLKSEL_SSI (0x8 << 20)
132
133/* 2420-PRCM III 532MHz core */
134#define RIII_CLKSEL_L3 (4 << 0) /* 133MHz */
135#define RIII_CLKSEL_L4 (2 << 5) /* 66.5MHz */
136#define RIII_CLKSEL_USB (4 << 25) /* 33.25MHz */
137#define RIII_CM_CLKSEL1_CORE_VAL RIII_CLKSEL_USB | RXX_CLKSEL_SSI | \
138 RXX_CLKSEL_VLYNQ | RX_CLKSEL_DSS2 | \
139 RX_CLKSEL_DSS1 | RIII_CLKSEL_L4 | \
140 RIII_CLKSEL_L3
141#define RIII_CLKSEL_MPU (2 << 0) /* 266MHz */
142#define RIII_CM_CLKSEL_MPU_VAL RIII_CLKSEL_MPU
143#define RIII_CLKSEL_DSP (3 << 0) /* c5x - 177.3MHz */
144#define RIII_CLKSEL_DSP_IF (2 << 5) /* c5x - 88.67MHz */
145#define RIII_SYNC_DSP (1 << 7) /* Enable sync */
146#define RIII_CLKSEL_IVA (6 << 8) /* iva1 - 88.67MHz */
147#define RIII_SYNC_IVA (1 << 13) /* Enable sync */
148#define RIII_CM_CLKSEL_DSP_VAL RIII_SYNC_IVA | RIII_CLKSEL_IVA | \
149 RIII_SYNC_DSP | RIII_CLKSEL_DSP_IF | \
150 RIII_CLKSEL_DSP
151#define RIII_CLKSEL_GFX (2 << 0) /* 66.5MHz */
152#define RIII_CM_CLKSEL_GFX_VAL RIII_CLKSEL_GFX
153
154/* 2420-PRCM II 600MHz core */
155#define RII_CLKSEL_L3 (6 << 0) /* 100MHz */
156#define RII_CLKSEL_L4 (2 << 5) /* 50MHz */
157#define RII_CLKSEL_USB (2 << 25) /* 50MHz */
158#define RII_CM_CLKSEL1_CORE_VAL RII_CLKSEL_USB | \
159 RXX_CLKSEL_SSI | RXX_CLKSEL_VLYNQ | \
160 RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
161 RII_CLKSEL_L4 | RII_CLKSEL_L3
162#define RII_CLKSEL_MPU (2 << 0) /* 300MHz */
163#define RII_CM_CLKSEL_MPU_VAL RII_CLKSEL_MPU
164#define RII_CLKSEL_DSP (3 << 0) /* c5x - 200MHz */
165#define RII_CLKSEL_DSP_IF (2 << 5) /* c5x - 100MHz */
166#define RII_SYNC_DSP (0 << 7) /* Bypass sync */
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200167#define RII_CLKSEL_IVA (3 << 8) /* iva1 - 200MHz */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000168#define RII_SYNC_IVA (0 << 13) /* Bypass sync */
169#define RII_CM_CLKSEL_DSP_VAL RII_SYNC_IVA | RII_CLKSEL_IVA | \
170 RII_SYNC_DSP | RII_CLKSEL_DSP_IF | \
171 RII_CLKSEL_DSP
172#define RII_CLKSEL_GFX (2 << 0) /* 50MHz */
173#define RII_CM_CLKSEL_GFX_VAL RII_CLKSEL_GFX
174
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200175/* 2420-PRCM I 660MHz core */
176#define RI_CLKSEL_L3 (4 << 0) /* 165MHz */
177#define RI_CLKSEL_L4 (2 << 5) /* 82.5MHz */
178#define RI_CLKSEL_USB (4 << 25) /* 41.25MHz */
179#define RI_CM_CLKSEL1_CORE_VAL RI_CLKSEL_USB | \
180 RXX_CLKSEL_SSI | RXX_CLKSEL_VLYNQ | \
181 RX_CLKSEL_DSS2 | RX_CLKSEL_DSS1 | \
182 RI_CLKSEL_L4 | RI_CLKSEL_L3
183#define RI_CLKSEL_MPU (2 << 0) /* 330MHz */
184#define RI_CM_CLKSEL_MPU_VAL RI_CLKSEL_MPU
185#define RI_CLKSEL_DSP (3 << 0) /* c5x - 220MHz */
186#define RI_CLKSEL_DSP_IF (2 << 5) /* c5x - 110MHz */
187#define RI_SYNC_DSP (1 << 7) /* Activate sync */
188#define RI_CLKSEL_IVA (4 << 8) /* iva1 - 165MHz */
189#define RI_SYNC_IVA (0 << 13) /* Bypass sync */
190#define RI_CM_CLKSEL_DSP_VAL RI_SYNC_IVA | RI_CLKSEL_IVA | \
191 RI_SYNC_DSP | RI_CLKSEL_DSP_IF | \
192 RI_CLKSEL_DSP
193#define RI_CLKSEL_GFX (1 << 0) /* 165MHz */
194#define RI_CM_CLKSEL_GFX_VAL RI_CLKSEL_GFX
195
Tony Lindgren046d6b22005-11-10 14:26:52 +0000196/* 2420-PRCM VII (boot) */
197#define RVII_CLKSEL_L3 (1 << 0)
198#define RVII_CLKSEL_L4 (1 << 5)
199#define RVII_CLKSEL_DSS1 (1 << 8)
200#define RVII_CLKSEL_DSS2 (0 << 13)
201#define RVII_CLKSEL_VLYNQ (1 << 15)
202#define RVII_CLKSEL_SSI (1 << 20)
203#define RVII_CLKSEL_USB (1 << 25)
204
205#define RVII_CM_CLKSEL1_CORE_VAL RVII_CLKSEL_USB | RVII_CLKSEL_SSI | \
206 RVII_CLKSEL_VLYNQ | RVII_CLKSEL_DSS2 | \
207 RVII_CLKSEL_DSS1 | RVII_CLKSEL_L4 | RVII_CLKSEL_L3
208
209#define RVII_CLKSEL_MPU (1 << 0) /* all divide by 1 */
210#define RVII_CM_CLKSEL_MPU_VAL RVII_CLKSEL_MPU
211
212#define RVII_CLKSEL_DSP (1 << 0)
213#define RVII_CLKSEL_DSP_IF (1 << 5)
214#define RVII_SYNC_DSP (0 << 7)
215#define RVII_CLKSEL_IVA (1 << 8)
216#define RVII_SYNC_IVA (0 << 13)
217#define RVII_CM_CLKSEL_DSP_VAL RVII_SYNC_IVA | RVII_CLKSEL_IVA | RVII_SYNC_DSP | \
218 RVII_CLKSEL_DSP_IF | RVII_CLKSEL_DSP
219
220#define RVII_CLKSEL_GFX (1 << 0)
221#define RVII_CM_CLKSEL_GFX_VAL RVII_CLKSEL_GFX
222
223/*-------------------------------------------------------------------------
224 * 2430 Target modes: Along with each configuration the CPU has several
225 * modes which goes along with them. Modes mainly are the addition of
226 * describe DPLL combinations to go along with a ratio.
227 *-------------------------------------------------------------------------*/
228
229/* Hardware governed */
230#define MX_48M_SRC (0 << 3)
231#define MX_54M_SRC (0 << 5)
232#define MX_APLLS_CLIKIN_12 (3 << 23)
233#define MX_APLLS_CLIKIN_13 (2 << 23)
234#define MX_APLLS_CLIKIN_19_2 (0 << 23)
235
236/*
237 * 2430 - standalone, 2*ref*M/(n+1), M/N is for exactness not relock speed
Tony Lindgren046d6b22005-11-10 14:26:52 +0000238 * #5a (ratio1) baseport-target, target DPLL = 266*2 = 532MHz
239 */
240#define M5A_DPLL_MULT_12 (133 << 12)
241#define M5A_DPLL_DIV_12 (5 << 8)
242#define M5A_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
243 M5A_DPLL_DIV_12 | M5A_DPLL_MULT_12 | \
244 MX_APLLS_CLIKIN_12
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200245#define M5A_DPLL_MULT_13 (61 << 12)
246#define M5A_DPLL_DIV_13 (2 << 8)
Tony Lindgren046d6b22005-11-10 14:26:52 +0000247#define M5A_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
248 M5A_DPLL_DIV_13 | M5A_DPLL_MULT_13 | \
249 MX_APLLS_CLIKIN_13
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200250#define M5A_DPLL_MULT_19 (55 << 12)
251#define M5A_DPLL_DIV_19 (3 << 8)
Tony Lindgren046d6b22005-11-10 14:26:52 +0000252#define M5A_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
253 M5A_DPLL_DIV_19 | M5A_DPLL_MULT_19 | \
254 MX_APLLS_CLIKIN_19_2
255/* #5b (ratio1) target DPLL = 200*2 = 400MHz */
256#define M5B_DPLL_MULT_12 (50 << 12)
257#define M5B_DPLL_DIV_12 (2 << 8)
258#define M5B_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
259 M5B_DPLL_DIV_12 | M5B_DPLL_MULT_12 | \
260 MX_APLLS_CLIKIN_12
261#define M5B_DPLL_MULT_13 (200 << 12)
262#define M5B_DPLL_DIV_13 (12 << 8)
263
264#define M5B_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
265 M5B_DPLL_DIV_13 | M5B_DPLL_MULT_13 | \
266 MX_APLLS_CLIKIN_13
267#define M5B_DPLL_MULT_19 (125 << 12)
268#define M5B_DPLL_DIV_19 (31 << 8)
269#define M5B_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
270 M5B_DPLL_DIV_19 | M5B_DPLL_MULT_19 | \
271 MX_APLLS_CLIKIN_19_2
272/*
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200273 * #4 (ratio2), DPLL = 399*2 = 798MHz, L3=133MHz
274 */
275#define M4_DPLL_MULT_12 (133 << 12)
276#define M4_DPLL_DIV_12 (3 << 8)
277#define M4_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
278 M4_DPLL_DIV_12 | M4_DPLL_MULT_12 | \
279 MX_APLLS_CLIKIN_12
280
281#define M4_DPLL_MULT_13 (399 << 12)
282#define M4_DPLL_DIV_13 (12 << 8)
283#define M4_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
284 M4_DPLL_DIV_13 | M4_DPLL_MULT_13 | \
285 MX_APLLS_CLIKIN_13
286
287#define M4_DPLL_MULT_19 (145 << 12)
288#define M4_DPLL_DIV_19 (6 << 8)
289#define M4_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
290 M4_DPLL_DIV_19 | M4_DPLL_MULT_19 | \
291 MX_APLLS_CLIKIN_19_2
292
293/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000294 * #3 (ratio2) baseport-target, target DPLL = 330*2 = 660MHz
295 */
296#define M3_DPLL_MULT_12 (55 << 12)
297#define M3_DPLL_DIV_12 (1 << 8)
298#define M3_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
299 M3_DPLL_DIV_12 | M3_DPLL_MULT_12 | \
300 MX_APLLS_CLIKIN_12
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200301#define M3_DPLL_MULT_13 (76 << 12)
302#define M3_DPLL_DIV_13 (2 << 8)
Tony Lindgren046d6b22005-11-10 14:26:52 +0000303#define M3_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
304 M3_DPLL_DIV_13 | M3_DPLL_MULT_13 | \
305 MX_APLLS_CLIKIN_13
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200306#define M3_DPLL_MULT_19 (17 << 12)
307#define M3_DPLL_DIV_19 (0 << 8)
Tony Lindgren046d6b22005-11-10 14:26:52 +0000308#define M3_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
309 M3_DPLL_DIV_19 | M3_DPLL_MULT_19 | \
310 MX_APLLS_CLIKIN_19_2
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200311
312/*
313 * #2 (ratio1) DPLL = 330*2 = 660MHz, L3=165MHz
314 */
315#define M2_DPLL_MULT_12 (55 << 12)
316#define M2_DPLL_DIV_12 (1 << 8)
317#define M2_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
318 M2_DPLL_DIV_12 | M2_DPLL_MULT_12 | \
319 MX_APLLS_CLIKIN_12
320
321/* Speed changes - Used 658.7MHz instead of 660MHz for LP-Refresh M=76 N=2,
322 * relock time issue */
323/* Core frequency changed from 330/165 to 329/164 MHz*/
324#define M2_DPLL_MULT_13 (76 << 12)
325#define M2_DPLL_DIV_13 (2 << 8)
326#define M2_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
327 M2_DPLL_DIV_13 | M2_DPLL_MULT_13 | \
328 MX_APLLS_CLIKIN_13
329
330#define M2_DPLL_MULT_19 (17 << 12)
331#define M2_DPLL_DIV_19 (0 << 8)
332#define M2_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | \
333 M2_DPLL_DIV_19 | M2_DPLL_MULT_19 | \
334 MX_APLLS_CLIKIN_19_2
335
Tony Lindgren046d6b22005-11-10 14:26:52 +0000336/* boot (boot) */
337#define MB_DPLL_MULT (1 << 12)
338#define MB_DPLL_DIV (0 << 8)
339#define MB_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
340 MB_DPLL_MULT | MX_APLLS_CLIKIN_12
341
342#define MB_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
343 MB_DPLL_MULT | MX_APLLS_CLIKIN_13
344
345#define MB_CM_CLKSEL1_PLL_19_VAL MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV |\
346 MB_DPLL_MULT | MX_APLLS_CLIKIN_19
347
348/*
349 * 2430 - chassis (sedna)
350 * 165 (ratio1) same as above #2
351 * 150 (ratio1)
352 * 133 (ratio2) same as above #4
353 * 110 (ratio2) same as above #3
354 * 104 (ratio2)
355 * boot (boot)
356 */
357
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200358/* PRCM I target DPLL = 2*330MHz = 660MHz */
359#define MI_DPLL_MULT_12 (55 << 12)
360#define MI_DPLL_DIV_12 (1 << 8)
361#define MI_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
362 MI_DPLL_DIV_12 | MI_DPLL_MULT_12 | \
363 MX_APLLS_CLIKIN_12
364
Tony Lindgren046d6b22005-11-10 14:26:52 +0000365/*
366 * 2420 Equivalent - mode registers
367 * PRCM II , target DPLL = 2*300MHz = 600MHz
368 */
369#define MII_DPLL_MULT_12 (50 << 12)
370#define MII_DPLL_DIV_12 (1 << 8)
371#define MII_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
372 MII_DPLL_DIV_12 | MII_DPLL_MULT_12 | \
373 MX_APLLS_CLIKIN_12
374#define MII_DPLL_MULT_13 (300 << 12)
375#define MII_DPLL_DIV_13 (12 << 8)
376#define MII_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
377 MII_DPLL_DIV_13 | MII_DPLL_MULT_13 | \
378 MX_APLLS_CLIKIN_13
379
380/* PRCM III target DPLL = 2*266 = 532MHz*/
381#define MIII_DPLL_MULT_12 (133 << 12)
382#define MIII_DPLL_DIV_12 (5 << 8)
383#define MIII_CM_CLKSEL1_PLL_12_VAL MX_48M_SRC | MX_54M_SRC | \
384 MIII_DPLL_DIV_12 | MIII_DPLL_MULT_12 | \
385 MX_APLLS_CLIKIN_12
386#define MIII_DPLL_MULT_13 (266 << 12)
387#define MIII_DPLL_DIV_13 (12 << 8)
388#define MIII_CM_CLKSEL1_PLL_13_VAL MX_48M_SRC | MX_54M_SRC | \
389 MIII_DPLL_DIV_13 | MIII_DPLL_MULT_13 | \
390 MX_APLLS_CLIKIN_13
391
392/* PRCM VII (boot bypass) */
393#define MVII_CM_CLKSEL1_PLL_12_VAL MB_CM_CLKSEL1_PLL_12_VAL
394#define MVII_CM_CLKSEL1_PLL_13_VAL MB_CM_CLKSEL1_PLL_13_VAL
395
396/* High and low operation value */
397#define MX_CLKSEL2_PLL_2x_VAL (2 << 0)
398#define MX_CLKSEL2_PLL_1x_VAL (1 << 0)
399
Tony Lindgren046d6b22005-11-10 14:26:52 +0000400/* MPU speed defines */
401#define S12M 12000000
402#define S13M 13000000
403#define S19M 19200000
404#define S26M 26000000
405#define S100M 100000000
406#define S133M 133000000
407#define S150M 150000000
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200408#define S164M 164000000
Tony Lindgren046d6b22005-11-10 14:26:52 +0000409#define S165M 165000000
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200410#define S199M 199000000
Tony Lindgren046d6b22005-11-10 14:26:52 +0000411#define S200M 200000000
412#define S266M 266000000
413#define S300M 300000000
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200414#define S329M 329000000
Tony Lindgren046d6b22005-11-10 14:26:52 +0000415#define S330M 330000000
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200416#define S399M 399000000
Tony Lindgren046d6b22005-11-10 14:26:52 +0000417#define S400M 400000000
418#define S532M 532000000
419#define S600M 600000000
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200420#define S658M 658000000
Tony Lindgren046d6b22005-11-10 14:26:52 +0000421#define S660M 660000000
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200422#define S798M 798000000
Tony Lindgren046d6b22005-11-10 14:26:52 +0000423
424/*-------------------------------------------------------------------------
425 * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
426 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
427 * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
428 * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
429 *
430 * Filling in table based on H4 boards and 2430-SDPs variants available.
431 * There are quite a few more rates combinations which could be defined.
432 *
Simon Arlott6cbdc8c2007-05-11 20:40:30 +0100433 * When multiple values are defined the start up will try and choose the
Tony Lindgren046d6b22005-11-10 14:26:52 +0000434 * fastest one. If a 'fast' value is defined, then automatically, the /2
435 * one should be included as it can be used. Generally having more that
436 * one fast set does not make sense, as static timings need to be changed
437 * to change the set. The exception is the bypass setting which is
438 * availble for low power bypass.
439 *
440 * Note: This table needs to be sorted, fastest to slowest.
441 *-------------------------------------------------------------------------*/
442static struct prcm_config rate_table[] = {
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200443 /* PRCM I - FAST */
444 {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */
445 RI_CM_CLKSEL_DSP_VAL, RI_CM_CLKSEL_GFX_VAL,
446 RI_CM_CLKSEL1_CORE_VAL, MI_CM_CLKSEL1_PLL_12_VAL,
447 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_165MHz,
448 RATE_IN_242X},
449
Tony Lindgren046d6b22005-11-10 14:26:52 +0000450 /* PRCM II - FAST */
451 {S12M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */
452 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
453 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200454 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000455 RATE_IN_242X},
456
457 {S13M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL, /* 300MHz ARM */
458 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
459 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200460 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000461 RATE_IN_242X},
462
463 /* PRCM III - FAST */
464 {S12M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
465 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
466 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200467 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000468 RATE_IN_242X},
469
470 {S13M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
471 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
472 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200473 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000474 RATE_IN_242X},
475
476 /* PRCM II - SLOW */
477 {S12M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */
478 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
479 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200480 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000481 RATE_IN_242X},
482
483 {S13M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL, /* 150MHz ARM */
484 RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
485 RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200486 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000487 RATE_IN_242X},
488
489 /* PRCM III - SLOW */
490 {S12M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
491 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
492 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200493 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000494 RATE_IN_242X},
495
496 {S13M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
497 RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
498 RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200499 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000500 RATE_IN_242X},
501
502 /* PRCM-VII (boot-bypass) */
503 {S12M, S12M, S12M, RVII_CM_CLKSEL_MPU_VAL, /* 12MHz ARM*/
504 RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
505 RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_12_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200506 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000507 RATE_IN_242X},
508
509 /* PRCM-VII (boot-bypass) */
510 {S13M, S13M, S13M, RVII_CM_CLKSEL_MPU_VAL, /* 13MHz ARM */
511 RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
512 RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_13_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200513 MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000514 RATE_IN_242X},
515
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200516 /* PRCM #4 - ratio2 (ES2.1) - FAST */
517 {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* 399MHz ARM */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000518 R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200519 R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000520 MX_CLKSEL2_PLL_2x_VAL, R2_CM_CLKSEL_MDM_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200521 SDRC_RFR_CTRL_133MHz,
522 RATE_IN_243X},
523
524 /* PRCM #2 - ratio1 (ES2) - FAST */
525 {S13M, S658M, S329M, R1_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */
526 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
527 R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
528 MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
529 SDRC_RFR_CTRL_165MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000530 RATE_IN_243X},
531
532 /* PRCM #5a - ratio1 - FAST */
533 {S13M, S532M, S266M, R1_CM_CLKSEL_MPU_VAL, /* 266MHz ARM */
534 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
535 R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
536 MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200537 SDRC_RFR_CTRL_133MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000538 RATE_IN_243X},
539
540 /* PRCM #5b - ratio1 - FAST */
541 {S13M, S400M, S200M, R1_CM_CLKSEL_MPU_VAL, /* 200MHz ARM */
542 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
543 R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
544 MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200545 SDRC_RFR_CTRL_100MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000546 RATE_IN_243X},
547
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200548 /* PRCM #4 - ratio1 (ES2.1) - SLOW */
549 {S13M, S399M, S199M, R2_CM_CLKSEL_MPU_VAL, /* 200MHz ARM */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000550 R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200551 R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000552 MX_CLKSEL2_PLL_1x_VAL, R2_CM_CLKSEL_MDM_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200553 SDRC_RFR_CTRL_133MHz,
554 RATE_IN_243X},
555
556 /* PRCM #2 - ratio1 (ES2) - SLOW */
557 {S13M, S329M, S164M, R1_CM_CLKSEL_MPU_VAL, /* 165MHz ARM */
558 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
559 R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
560 MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
561 SDRC_RFR_CTRL_165MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000562 RATE_IN_243X},
563
564 /* PRCM #5a - ratio1 - SLOW */
565 {S13M, S266M, S133M, R1_CM_CLKSEL_MPU_VAL, /* 133MHz ARM */
566 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
567 R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
568 MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200569 SDRC_RFR_CTRL_133MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000570 RATE_IN_243X},
571
572 /* PRCM #5b - ratio1 - SLOW*/
573 {S13M, S200M, S100M, R1_CM_CLKSEL_MPU_VAL, /* 100MHz ARM */
574 R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
575 R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
576 MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200577 SDRC_RFR_CTRL_100MHz,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000578 RATE_IN_243X},
579
580 /* PRCM-boot/bypass */
581 {S13M, S13M, S13M, RB_CM_CLKSEL_MPU_VAL, /* 13Mhz */
582 RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
583 RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL,
584 MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200585 SDRC_RFR_CTRL_BYPASS,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000586 RATE_IN_243X},
587
588 /* PRCM-boot/bypass */
589 {S12M, S12M, S12M, RB_CM_CLKSEL_MPU_VAL, /* 12Mhz */
590 RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
591 RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL,
592 MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200593 SDRC_RFR_CTRL_BYPASS,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000594 RATE_IN_243X},
595
596 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
597};
598
599/*-------------------------------------------------------------------------
600 * 24xx clock tree.
601 *
602 * NOTE:In many cases here we are assigning a 'default' parent. In many
603 * cases the parent is selectable. The get/set parent calls will also
604 * switch sources.
605 *
606 * Many some clocks say always_enabled, but they can be auto idled for
607 * power savings. They will always be available upon clock request.
608 *
609 * Several sources are given initial rates which may be wrong, this will
610 * be fixed up in the init func.
611 *
612 * Things are broadly separated below by clock domains. It is
613 * noteworthy that most periferals have dependencies on multiple clock
614 * domains. Many get their interface clocks from the L4 domain, but get
615 * functional clocks from fixed sources or other core domain derived
616 * clocks.
617 *-------------------------------------------------------------------------*/
618
619/* Base external input clocks */
620static struct clk func_32k_ck = {
621 .name = "func_32k_ck",
622 .rate = 32000,
623 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +0200624 RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300625 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200626 .recalc = &propagate_rate,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000627};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200628
Tony Lindgren046d6b22005-11-10 14:26:52 +0000629/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
630static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
631 .name = "osc_ck",
Russell King548d8492008-11-04 14:02:46 +0000632 .ops = &clkops_oscck,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000633 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +0200634 RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300635 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200636 .recalc = &omap2_osc_clk_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000637};
638
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300639/* Without modem likely 12MHz, with modem likely 13MHz */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000640static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */
641 .name = "sys_ck", /* ~ ref_clk also */
642 .parent = &osc_ck,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000643 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +0200644 ALWAYS_ENABLED | RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300645 .clkdm_name = "wkup_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +0000646 .recalc = &omap2_sys_clk_recalc,
647};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200648
Tony Lindgren046d6b22005-11-10 14:26:52 +0000649static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
650 .name = "alt_ck",
651 .rate = 54000000,
652 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
653 RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300654 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200655 .recalc = &propagate_rate,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000656};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200657
Tony Lindgren046d6b22005-11-10 14:26:52 +0000658/*
659 * Analog domain root source clocks
660 */
661
662/* dpll_ck, is broken out in to special cases through clksel */
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200663/* REVISIT: Rate changes on dpll_ck trigger a full set change. ...
664 * deal with this
665 */
666
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300667static struct dpll_data dpll_dd = {
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200668 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
669 .mult_mask = OMAP24XX_DPLL_MULT_MASK,
670 .div1_mask = OMAP24XX_DPLL_DIV_MASK,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300671 .max_multiplier = 1024,
672 .max_divider = 16,
673 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200674};
675
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300676/*
677 * XXX Cannot add round_rate here yet, as this is still a composite clock,
678 * not just a DPLL
679 */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000680static struct clk dpll_ck = {
681 .name = "dpll_ck",
682 .parent = &sys_ck, /* Can be func_32k also */
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200683 .dpll_data = &dpll_dd,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000684 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200685 RATE_PROPAGATES | ALWAYS_ENABLED,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300686 .clkdm_name = "wkup_clkdm",
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300687 .recalc = &omap2_dpllcore_recalc,
688 .set_rate = &omap2_reprogram_dpllcore,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000689};
690
691static struct clk apll96_ck = {
692 .name = "apll96_ck",
Russell King548d8492008-11-04 14:02:46 +0000693 .ops = &clkops_fixed,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000694 .parent = &sys_ck,
695 .rate = 96000000,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200696 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
697 RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300698 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200699 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
700 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200701 .recalc = &propagate_rate,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000702};
703
704static struct clk apll54_ck = {
705 .name = "apll54_ck",
Russell King548d8492008-11-04 14:02:46 +0000706 .ops = &clkops_fixed,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000707 .parent = &sys_ck,
708 .rate = 54000000,
709 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200710 RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300711 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200712 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
713 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200714 .recalc = &propagate_rate,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000715};
716
717/*
718 * PRCM digital base sources
719 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200720
721/* func_54m_ck */
722
723static const struct clksel_rate func_54m_apll54_rates[] = {
724 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
725 { .div = 0 },
726};
727
728static const struct clksel_rate func_54m_alt_rates[] = {
729 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
730 { .div = 0 },
731};
732
733static const struct clksel func_54m_clksel[] = {
734 { .parent = &apll54_ck, .rates = func_54m_apll54_rates, },
735 { .parent = &alt_ck, .rates = func_54m_alt_rates, },
736 { .parent = NULL },
737};
738
Tony Lindgren046d6b22005-11-10 14:26:52 +0000739static struct clk func_54m_ck = {
740 .name = "func_54m_ck",
741 .parent = &apll54_ck, /* can also be alt_clk */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000742 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +0200743 RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300744 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200745 .init = &omap2_init_clksel_parent,
746 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
747 .clksel_mask = OMAP24XX_54M_SOURCE,
748 .clksel = func_54m_clksel,
749 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000750};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200751
Tony Lindgren046d6b22005-11-10 14:26:52 +0000752static struct clk core_ck = {
753 .name = "core_ck",
754 .parent = &dpll_ck, /* can also be 32k */
755 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
756 ALWAYS_ENABLED | RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300757 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200758 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000759};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200760
761/* func_96m_ck */
762static const struct clksel_rate func_96m_apll96_rates[] = {
763 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
764 { .div = 0 },
Tony Lindgren046d6b22005-11-10 14:26:52 +0000765};
766
Paul Walmsleye32744b2008-03-18 15:47:55 +0200767static const struct clksel_rate func_96m_alt_rates[] = {
768 { .div = 1, .val = 1, .flags = RATE_IN_243X | DEFAULT_RATE },
769 { .div = 0 },
770};
771
772static const struct clksel func_96m_clksel[] = {
773 { .parent = &apll96_ck, .rates = func_96m_apll96_rates },
774 { .parent = &alt_ck, .rates = func_96m_alt_rates },
775 { .parent = NULL }
776};
777
778/* The parent of this clock is not selectable on 2420. */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000779static struct clk func_96m_ck = {
780 .name = "func_96m_ck",
781 .parent = &apll96_ck,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000782 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +0200783 RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300784 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200785 .init = &omap2_init_clksel_parent,
786 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
787 .clksel_mask = OMAP2430_96M_SOURCE,
788 .clksel = func_96m_clksel,
789 .recalc = &omap2_clksel_recalc,
790 .round_rate = &omap2_clksel_round_rate,
791 .set_rate = &omap2_clksel_set_rate
792};
793
794/* func_48m_ck */
795
796static const struct clksel_rate func_48m_apll96_rates[] = {
797 { .div = 2, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
798 { .div = 0 },
799};
800
801static const struct clksel_rate func_48m_alt_rates[] = {
802 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
803 { .div = 0 },
804};
805
806static const struct clksel func_48m_clksel[] = {
807 { .parent = &apll96_ck, .rates = func_48m_apll96_rates },
808 { .parent = &alt_ck, .rates = func_48m_alt_rates },
809 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000810};
811
812static struct clk func_48m_ck = {
813 .name = "func_48m_ck",
814 .parent = &apll96_ck, /* 96M or Alt */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000815 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +0200816 RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300817 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200818 .init = &omap2_init_clksel_parent,
819 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
820 .clksel_mask = OMAP24XX_48M_SOURCE,
821 .clksel = func_48m_clksel,
822 .recalc = &omap2_clksel_recalc,
823 .round_rate = &omap2_clksel_round_rate,
824 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000825};
826
827static struct clk func_12m_ck = {
828 .name = "func_12m_ck",
829 .parent = &func_48m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200830 .fixed_div = 4,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000831 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +0200832 RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300833 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200834 .recalc = &omap2_fixed_divisor_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000835};
836
837/* Secure timer, only available in secure mode */
838static struct clk wdt1_osc_ck = {
839 .name = "ck_wdt1_osc",
840 .parent = &osc_ck,
841 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200842 .recalc = &followparent_recalc,
843};
844
845/*
846 * The common_clkout* clksel_rate structs are common to
847 * sys_clkout, sys_clkout_src, sys_clkout2, and sys_clkout2_src.
848 * sys_clkout2_* are 2420-only, so the
849 * clksel_rate flags fields are inaccurate for those clocks. This is
850 * harmless since access to those clocks are gated by the struct clk
851 * flags fields, which mark them as 2420-only.
852 */
853static const struct clksel_rate common_clkout_src_core_rates[] = {
854 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
855 { .div = 0 }
856};
857
858static const struct clksel_rate common_clkout_src_sys_rates[] = {
859 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
860 { .div = 0 }
861};
862
863static const struct clksel_rate common_clkout_src_96m_rates[] = {
864 { .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
865 { .div = 0 }
866};
867
868static const struct clksel_rate common_clkout_src_54m_rates[] = {
869 { .div = 1, .val = 3, .flags = RATE_IN_24XX | DEFAULT_RATE },
870 { .div = 0 }
871};
872
873static const struct clksel common_clkout_src_clksel[] = {
874 { .parent = &core_ck, .rates = common_clkout_src_core_rates },
875 { .parent = &sys_ck, .rates = common_clkout_src_sys_rates },
876 { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates },
877 { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates },
878 { .parent = NULL }
879};
880
881static struct clk sys_clkout_src = {
882 .name = "sys_clkout_src",
883 .parent = &func_54m_ck,
884 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
885 RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300886 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200887 .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
888 .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT,
889 .init = &omap2_init_clksel_parent,
890 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
891 .clksel_mask = OMAP24XX_CLKOUT_SOURCE_MASK,
892 .clksel = common_clkout_src_clksel,
893 .recalc = &omap2_clksel_recalc,
894 .round_rate = &omap2_clksel_round_rate,
895 .set_rate = &omap2_clksel_set_rate
896};
897
898static const struct clksel_rate common_clkout_rates[] = {
899 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
900 { .div = 2, .val = 1, .flags = RATE_IN_24XX },
901 { .div = 4, .val = 2, .flags = RATE_IN_24XX },
902 { .div = 8, .val = 3, .flags = RATE_IN_24XX },
903 { .div = 16, .val = 4, .flags = RATE_IN_24XX },
904 { .div = 0 },
905};
906
907static const struct clksel sys_clkout_clksel[] = {
908 { .parent = &sys_clkout_src, .rates = common_clkout_rates },
909 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000910};
911
912static struct clk sys_clkout = {
913 .name = "sys_clkout",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200914 .parent = &sys_clkout_src,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000915 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +0200916 PARENT_CONTROLS_CLOCK,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300917 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200918 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
919 .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK,
920 .clksel = sys_clkout_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000921 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200922 .round_rate = &omap2_clksel_round_rate,
923 .set_rate = &omap2_clksel_set_rate
924};
925
926/* In 2430, new in 2420 ES2 */
927static struct clk sys_clkout2_src = {
928 .name = "sys_clkout2_src",
929 .parent = &func_54m_ck,
930 .flags = CLOCK_IN_OMAP242X | RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300931 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200932 .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
933 .enable_bit = OMAP2420_CLKOUT2_EN_SHIFT,
934 .init = &omap2_init_clksel_parent,
935 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
936 .clksel_mask = OMAP2420_CLKOUT2_SOURCE_MASK,
937 .clksel = common_clkout_src_clksel,
938 .recalc = &omap2_clksel_recalc,
939 .round_rate = &omap2_clksel_round_rate,
940 .set_rate = &omap2_clksel_set_rate
941};
942
943static const struct clksel sys_clkout2_clksel[] = {
944 { .parent = &sys_clkout2_src, .rates = common_clkout_rates },
945 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000946};
947
948/* In 2430, new in 2420 ES2 */
949static struct clk sys_clkout2 = {
950 .name = "sys_clkout2",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200951 .parent = &sys_clkout2_src,
952 .flags = CLOCK_IN_OMAP242X | PARENT_CONTROLS_CLOCK,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300953 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200954 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
955 .clksel_mask = OMAP2420_CLKOUT2_DIV_MASK,
956 .clksel = sys_clkout2_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000957 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200958 .round_rate = &omap2_clksel_round_rate,
959 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000960};
961
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100962static struct clk emul_ck = {
963 .name = "emul_ck",
964 .parent = &func_54m_ck,
965 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300966 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200967 .enable_reg = OMAP24XX_PRCM_CLKEMUL_CTRL,
968 .enable_bit = OMAP24XX_EMULATION_EN_SHIFT,
969 .recalc = &followparent_recalc,
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100970
971};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200972
Tony Lindgren046d6b22005-11-10 14:26:52 +0000973/*
974 * MPU clock domain
975 * Clocks:
976 * MPU_FCLK, MPU_ICLK
977 * INT_M_FCLK, INT_M_I_CLK
978 *
979 * - Individual clocks are hardware managed.
980 * - Base divider comes from: CM_CLKSEL_MPU
981 *
982 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200983static const struct clksel_rate mpu_core_rates[] = {
984 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
985 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
986 { .div = 4, .val = 4, .flags = RATE_IN_242X },
987 { .div = 6, .val = 6, .flags = RATE_IN_242X },
988 { .div = 8, .val = 8, .flags = RATE_IN_242X },
989 { .div = 0 },
990};
991
992static const struct clksel mpu_clksel[] = {
993 { .parent = &core_ck, .rates = mpu_core_rates },
994 { .parent = NULL }
995};
996
Tony Lindgren046d6b22005-11-10 14:26:52 +0000997static struct clk mpu_ck = { /* Control cpu */
998 .name = "mpu_ck",
999 .parent = &core_ck,
Paul Walmsley6b8858a2008-03-18 10:35:15 +02001000 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1001 ALWAYS_ENABLED | DELAYED_APP |
Tony Lindgren046d6b22005-11-10 14:26:52 +00001002 CONFIG_PARTICIPANT | RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001003 .clkdm_name = "mpu_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +02001004 .init = &omap2_init_clksel_parent,
1005 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
1006 .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001007 .clksel = mpu_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001008 .recalc = &omap2_clksel_recalc,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001009 .round_rate = &omap2_clksel_round_rate,
Paul Walmsley6b8858a2008-03-18 10:35:15 +02001010 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001011};
Paul Walmsleye32744b2008-03-18 15:47:55 +02001012
Tony Lindgren046d6b22005-11-10 14:26:52 +00001013/*
1014 * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain
1015 * Clocks:
Paul Walmsleye32744b2008-03-18 15:47:55 +02001016 * 2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
Tony Lindgren046d6b22005-11-10 14:26:52 +00001017 * 2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP
Paul Walmsleye32744b2008-03-18 15:47:55 +02001018 *
Tony Lindgren046d6b22005-11-10 14:26:52 +00001019 * Won't be too specific here. The core clock comes into this block
1020 * it is divided then tee'ed. One branch goes directly to xyz enable
1021 * controls. The other branch gets further divided by 2 then possibly
1022 * routed into a synchronizer and out of clocks abc.
1023 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001024static const struct clksel_rate dsp_fck_core_rates[] = {
1025 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
1026 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
1027 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
1028 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
1029 { .div = 6, .val = 6, .flags = RATE_IN_242X },
1030 { .div = 8, .val = 8, .flags = RATE_IN_242X },
1031 { .div = 12, .val = 12, .flags = RATE_IN_242X },
1032 { .div = 0 },
1033};
1034
1035static const struct clksel dsp_fck_clksel[] = {
1036 { .parent = &core_ck, .rates = dsp_fck_core_rates },
1037 { .parent = NULL }
1038};
1039
Tony Lindgren046d6b22005-11-10 14:26:52 +00001040static struct clk dsp_fck = {
1041 .name = "dsp_fck",
1042 .parent = &core_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001043 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP |
1044 CONFIG_PARTICIPANT | RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001045 .clkdm_name = "dsp_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001046 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
1047 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
1048 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
1049 .clksel_mask = OMAP24XX_CLKSEL_DSP_MASK,
1050 .clksel = dsp_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001051 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001052 .round_rate = &omap2_clksel_round_rate,
1053 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001054};
1055
Paul Walmsleye32744b2008-03-18 15:47:55 +02001056/* DSP interface clock */
1057static const struct clksel_rate dsp_irate_ick_rates[] = {
1058 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
1059 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
1060 { .div = 3, .val = 3, .flags = RATE_IN_243X },
1061 { .div = 0 },
1062};
1063
1064static const struct clksel dsp_irate_ick_clksel[] = {
1065 { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
1066 { .parent = NULL }
1067};
1068
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001069/* This clock does not exist as such in the TRM. */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001070static struct clk dsp_irate_ick = {
1071 .name = "dsp_irate_ick",
1072 .parent = &dsp_fck,
1073 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP |
1074 CONFIG_PARTICIPANT | PARENT_CONTROLS_CLOCK,
1075 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
1076 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
1077 .clksel = dsp_irate_ick_clksel,
1078 .recalc = &omap2_clksel_recalc,
1079 .round_rate = &omap2_clksel_round_rate,
1080 .set_rate = &omap2_clksel_set_rate
1081};
1082
1083/* 2420 only */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001084static struct clk dsp_ick = {
1085 .name = "dsp_ick", /* apparently ipi and isp */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001086 .parent = &dsp_irate_ick,
1087 .flags = CLOCK_IN_OMAP242X | DELAYED_APP | CONFIG_PARTICIPANT,
1088 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
1089 .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */
1090};
1091
1092/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
1093static struct clk iva2_1_ick = {
1094 .name = "iva2_1_ick",
1095 .parent = &dsp_irate_ick,
1096 .flags = CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT,
1097 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
1098 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001099};
1100
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001101/*
1102 * The IVA1 is an ARM7 core on the 2420 that has nothing to do with
1103 * the C54x, but which is contained in the DSP powerdomain. Does not
1104 * exist on later OMAPs.
1105 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001106static struct clk iva1_ifck = {
1107 .name = "iva1_ifck",
1108 .parent = &core_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001109 .flags = CLOCK_IN_OMAP242X | CONFIG_PARTICIPANT |
1110 RATE_PROPAGATES | DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001111 .clkdm_name = "iva1_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001112 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
1113 .enable_bit = OMAP2420_EN_IVA_COP_SHIFT,
1114 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
1115 .clksel_mask = OMAP2420_CLKSEL_IVA_MASK,
1116 .clksel = dsp_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001117 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001118 .round_rate = &omap2_clksel_round_rate,
1119 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001120};
1121
1122/* IVA1 mpu/int/i/f clocks are /2 of parent */
1123static struct clk iva1_mpu_int_ifck = {
1124 .name = "iva1_mpu_int_ifck",
1125 .parent = &iva1_ifck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001126 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001127 .clkdm_name = "iva1_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001128 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
1129 .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT,
1130 .fixed_div = 2,
1131 .recalc = &omap2_fixed_divisor_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001132};
1133
1134/*
1135 * L3 clock domain
1136 * L3 clocks are used for both interface and functional clocks to
1137 * multiple entities. Some of these clocks are completely managed
1138 * by hardware, and some others allow software control. Hardware
1139 * managed ones general are based on directly CLK_REQ signals and
1140 * various auto idle settings. The functional spec sets many of these
1141 * as 'tie-high' for their enables.
1142 *
1143 * I-CLOCKS:
1144 * L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
1145 * CAM, HS-USB.
1146 * F-CLOCK
1147 * SSI.
1148 *
1149 * GPMC memories and SDRC have timing and clock sensitive registers which
1150 * may very well need notification when the clock changes. Currently for low
1151 * operating points, these are taken care of in sleep.S.
1152 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001153static const struct clksel_rate core_l3_core_rates[] = {
1154 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
1155 { .div = 2, .val = 2, .flags = RATE_IN_242X },
1156 { .div = 4, .val = 4, .flags = RATE_IN_24XX | DEFAULT_RATE },
1157 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
1158 { .div = 8, .val = 8, .flags = RATE_IN_242X },
1159 { .div = 12, .val = 12, .flags = RATE_IN_242X },
1160 { .div = 16, .val = 16, .flags = RATE_IN_242X },
1161 { .div = 0 }
1162};
1163
1164static const struct clksel core_l3_clksel[] = {
1165 { .parent = &core_ck, .rates = core_l3_core_rates },
1166 { .parent = NULL }
1167};
1168
Tony Lindgren046d6b22005-11-10 14:26:52 +00001169static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */
1170 .name = "core_l3_ck",
1171 .parent = &core_ck,
1172 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +02001173 ALWAYS_ENABLED | DELAYED_APP |
1174 CONFIG_PARTICIPANT | RATE_PROPAGATES,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001175 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001176 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
1177 .clksel_mask = OMAP24XX_CLKSEL_L3_MASK,
1178 .clksel = core_l3_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001179 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001180 .round_rate = &omap2_clksel_round_rate,
1181 .set_rate = &omap2_clksel_set_rate
1182};
1183
1184/* usb_l4_ick */
1185static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
1186 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
1187 { .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
1188 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
1189 { .div = 0 }
1190};
1191
1192static const struct clksel usb_l4_ick_clksel[] = {
1193 { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates },
1194 { .parent = NULL },
Tony Lindgren046d6b22005-11-10 14:26:52 +00001195};
1196
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001197/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001198static struct clk usb_l4_ick = { /* FS-USB interface clock */
1199 .name = "usb_l4_ick",
Tony Lindgrenfde0fd42006-01-17 15:31:18 -08001200 .parent = &core_l3_ck,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001201 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +02001202 DELAYED_APP | CONFIG_PARTICIPANT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001203 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001204 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1205 .enable_bit = OMAP24XX_EN_USB_SHIFT,
1206 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
1207 .clksel_mask = OMAP24XX_CLKSEL_USB_MASK,
1208 .clksel = usb_l4_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001209 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001210 .round_rate = &omap2_clksel_round_rate,
1211 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001212};
1213
1214/*
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001215 * L4 clock management domain
1216 *
1217 * This domain contains lots of interface clocks from the L4 interface, some
1218 * functional clocks. Fixed APLL functional source clocks are managed in
1219 * this domain.
1220 */
1221static const struct clksel_rate l4_core_l3_rates[] = {
1222 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
1223 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
1224 { .div = 0 }
1225};
1226
1227static const struct clksel l4_clksel[] = {
1228 { .parent = &core_l3_ck, .rates = l4_core_l3_rates },
1229 { .parent = NULL }
1230};
1231
1232static struct clk l4_ck = { /* used both as an ick and fck */
1233 .name = "l4_ck",
1234 .parent = &core_l3_ck,
1235 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
1236 ALWAYS_ENABLED | DELAYED_APP | RATE_PROPAGATES,
1237 .clkdm_name = "core_l4_clkdm",
1238 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
1239 .clksel_mask = OMAP24XX_CLKSEL_L4_MASK,
1240 .clksel = l4_clksel,
1241 .recalc = &omap2_clksel_recalc,
1242 .round_rate = &omap2_clksel_round_rate,
1243 .set_rate = &omap2_clksel_set_rate
1244};
1245
1246/*
Tony Lindgren046d6b22005-11-10 14:26:52 +00001247 * SSI is in L3 management domain, its direct parent is core not l3,
1248 * many core power domain entities are grouped into the L3 clock
1249 * domain.
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001250 * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK
Tony Lindgren046d6b22005-11-10 14:26:52 +00001251 *
1252 * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
1253 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001254static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
1255 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
1256 { .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
1257 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
1258 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
1259 { .div = 5, .val = 5, .flags = RATE_IN_243X },
1260 { .div = 6, .val = 6, .flags = RATE_IN_242X },
1261 { .div = 8, .val = 8, .flags = RATE_IN_242X },
1262 { .div = 0 }
1263};
1264
1265static const struct clksel ssi_ssr_sst_fck_clksel[] = {
1266 { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates },
1267 { .parent = NULL }
1268};
1269
Tony Lindgren046d6b22005-11-10 14:26:52 +00001270static struct clk ssi_ssr_sst_fck = {
1271 .name = "ssi_fck",
1272 .parent = &core_ck,
1273 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +02001274 DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001275 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001276 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1277 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
1278 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
1279 .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK,
1280 .clksel = ssi_ssr_sst_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001281 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001282 .round_rate = &omap2_clksel_round_rate,
1283 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001284};
1285
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001286
Tony Lindgren046d6b22005-11-10 14:26:52 +00001287/*
1288 * GFX clock domain
1289 * Clocks:
1290 * GFX_FCLK, GFX_ICLK
1291 * GFX_CG1(2d), GFX_CG2(3d)
1292 *
1293 * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
1294 * The 2d and 3d clocks run at a hardware determined
1295 * divided value of fclk.
1296 *
1297 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001298/* XXX REVISIT: GFX clock is part of CONFIG_PARTICIPANT, no? doublecheck. */
1299
1300/* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */
1301static const struct clksel gfx_fck_clksel[] = {
1302 { .parent = &core_l3_ck, .rates = gfx_l3_rates },
1303 { .parent = NULL },
1304};
1305
Tony Lindgren046d6b22005-11-10 14:26:52 +00001306static struct clk gfx_3d_fck = {
1307 .name = "gfx_3d_fck",
1308 .parent = &core_l3_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001309 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001310 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001311 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
1312 .enable_bit = OMAP24XX_EN_3D_SHIFT,
1313 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
1314 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
1315 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001316 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001317 .round_rate = &omap2_clksel_round_rate,
1318 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001319};
1320
1321static struct clk gfx_2d_fck = {
1322 .name = "gfx_2d_fck",
1323 .parent = &core_l3_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001324 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001325 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001326 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
1327 .enable_bit = OMAP24XX_EN_2D_SHIFT,
1328 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
1329 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
1330 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001331 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001332 .round_rate = &omap2_clksel_round_rate,
1333 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001334};
1335
1336static struct clk gfx_ick = {
1337 .name = "gfx_ick", /* From l3 */
1338 .parent = &core_l3_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001339 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001340 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001341 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
1342 .enable_bit = OMAP_EN_GFX_SHIFT,
1343 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001344};
1345
1346/*
1347 * Modem clock domain (2430)
1348 * CLOCKS:
1349 * MDM_OSC_CLK
1350 * MDM_ICLK
Paul Walmsleye32744b2008-03-18 15:47:55 +02001351 * These clocks are usable in chassis mode only.
Tony Lindgren046d6b22005-11-10 14:26:52 +00001352 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001353static const struct clksel_rate mdm_ick_core_rates[] = {
1354 { .div = 1, .val = 1, .flags = RATE_IN_243X },
1355 { .div = 4, .val = 4, .flags = RATE_IN_243X | DEFAULT_RATE },
1356 { .div = 6, .val = 6, .flags = RATE_IN_243X },
1357 { .div = 9, .val = 9, .flags = RATE_IN_243X },
1358 { .div = 0 }
1359};
1360
1361static const struct clksel mdm_ick_clksel[] = {
1362 { .parent = &core_ck, .rates = mdm_ick_core_rates },
1363 { .parent = NULL }
1364};
1365
Tony Lindgren046d6b22005-11-10 14:26:52 +00001366static struct clk mdm_ick = { /* used both as a ick and fck */
1367 .name = "mdm_ick",
1368 .parent = &core_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001369 .flags = CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001370 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001371 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
1372 .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
1373 .clksel_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
1374 .clksel_mask = OMAP2430_CLKSEL_MDM_MASK,
1375 .clksel = mdm_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001376 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001377 .round_rate = &omap2_clksel_round_rate,
1378 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001379};
1380
1381static struct clk mdm_osc_ck = {
1382 .name = "mdm_osc_ck",
Tony Lindgren046d6b22005-11-10 14:26:52 +00001383 .parent = &osc_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001384 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001385 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001386 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
1387 .enable_bit = OMAP2430_EN_OSC_SHIFT,
1388 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001389};
1390
1391/*
Tony Lindgren046d6b22005-11-10 14:26:52 +00001392 * DSS clock domain
1393 * CLOCKs:
1394 * DSS_L4_ICLK, DSS_L3_ICLK,
1395 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
1396 *
1397 * DSS is both initiator and target.
1398 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001399/* XXX Add RATE_NOT_VALIDATED */
1400
1401static const struct clksel_rate dss1_fck_sys_rates[] = {
1402 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
1403 { .div = 0 }
1404};
1405
1406static const struct clksel_rate dss1_fck_core_rates[] = {
1407 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
1408 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
1409 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
1410 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
1411 { .div = 5, .val = 5, .flags = RATE_IN_24XX },
1412 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
1413 { .div = 8, .val = 8, .flags = RATE_IN_24XX },
1414 { .div = 9, .val = 9, .flags = RATE_IN_24XX },
1415 { .div = 12, .val = 12, .flags = RATE_IN_24XX },
1416 { .div = 16, .val = 16, .flags = RATE_IN_24XX | DEFAULT_RATE },
1417 { .div = 0 }
1418};
1419
1420static const struct clksel dss1_fck_clksel[] = {
1421 { .parent = &sys_ck, .rates = dss1_fck_sys_rates },
1422 { .parent = &core_ck, .rates = dss1_fck_core_rates },
1423 { .parent = NULL },
1424};
1425
Tony Lindgren046d6b22005-11-10 14:26:52 +00001426static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
1427 .name = "dss_ick",
1428 .parent = &l4_ck, /* really both l3 and l4 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001429 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001430 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001431 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1432 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
1433 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001434};
1435
1436static struct clk dss1_fck = {
1437 .name = "dss1_fck",
1438 .parent = &core_ck, /* Core or sys */
1439 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Paul Walmsleye32744b2008-03-18 15:47:55 +02001440 DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001441 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001442 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1443 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
1444 .init = &omap2_init_clksel_parent,
1445 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
1446 .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK,
1447 .clksel = dss1_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001448 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001449 .round_rate = &omap2_clksel_round_rate,
1450 .set_rate = &omap2_clksel_set_rate
1451};
1452
1453static const struct clksel_rate dss2_fck_sys_rates[] = {
1454 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
1455 { .div = 0 }
1456};
1457
1458static const struct clksel_rate dss2_fck_48m_rates[] = {
1459 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
1460 { .div = 0 }
1461};
1462
1463static const struct clksel dss2_fck_clksel[] = {
1464 { .parent = &sys_ck, .rates = dss2_fck_sys_rates },
1465 { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
1466 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +00001467};
1468
1469static struct clk dss2_fck = { /* Alt clk used in power management */
1470 .name = "dss2_fck",
1471 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */
1472 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Richard Woodruff474844f2007-01-26 12:08:51 -08001473 DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001474 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001475 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1476 .enable_bit = OMAP24XX_EN_DSS2_SHIFT,
1477 .init = &omap2_init_clksel_parent,
1478 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
1479 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
1480 .clksel = dss2_fck_clksel,
1481 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001482};
1483
1484static struct clk dss_54m_fck = { /* Alt clk used in power management */
1485 .name = "dss_54m_fck", /* 54m tv clk */
1486 .parent = &func_54m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001487 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001488 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001489 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1490 .enable_bit = OMAP24XX_EN_TV_SHIFT,
1491 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001492};
1493
1494/*
1495 * CORE power domain ICLK & FCLK defines.
1496 * Many of the these can have more than one possible parent. Entries
1497 * here will likely have an L4 interface parent, and may have multiple
1498 * functional clock parents.
1499 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001500static const struct clksel_rate gpt_alt_rates[] = {
1501 { .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
1502 { .div = 0 }
1503};
1504
1505static const struct clksel omap24xx_gpt_clksel[] = {
1506 { .parent = &func_32k_ck, .rates = gpt_32k_rates },
1507 { .parent = &sys_ck, .rates = gpt_sys_rates },
1508 { .parent = &alt_ck, .rates = gpt_alt_rates },
1509 { .parent = NULL },
1510};
1511
Tony Lindgren046d6b22005-11-10 14:26:52 +00001512static struct clk gpt1_ick = {
1513 .name = "gpt1_ick",
1514 .parent = &l4_ck,
1515 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001516 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001517 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1518 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
1519 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001520};
1521
1522static struct clk gpt1_fck = {
1523 .name = "gpt1_fck",
1524 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001525 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001526 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001527 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1528 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
1529 .init = &omap2_init_clksel_parent,
1530 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
1531 .clksel_mask = OMAP24XX_CLKSEL_GPT1_MASK,
1532 .clksel = omap24xx_gpt_clksel,
1533 .recalc = &omap2_clksel_recalc,
1534 .round_rate = &omap2_clksel_round_rate,
1535 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001536};
1537
1538static struct clk gpt2_ick = {
1539 .name = "gpt2_ick",
1540 .parent = &l4_ck,
1541 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001542 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001543 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1544 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
1545 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001546};
1547
1548static struct clk gpt2_fck = {
1549 .name = "gpt2_fck",
1550 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001551 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001552 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001553 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1554 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
1555 .init = &omap2_init_clksel_parent,
1556 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1557 .clksel_mask = OMAP24XX_CLKSEL_GPT2_MASK,
1558 .clksel = omap24xx_gpt_clksel,
1559 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001560};
1561
1562static struct clk gpt3_ick = {
1563 .name = "gpt3_ick",
1564 .parent = &l4_ck,
1565 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001566 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001567 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1568 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
1569 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001570};
1571
1572static struct clk gpt3_fck = {
1573 .name = "gpt3_fck",
1574 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001575 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001576 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001577 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1578 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
1579 .init = &omap2_init_clksel_parent,
1580 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1581 .clksel_mask = OMAP24XX_CLKSEL_GPT3_MASK,
1582 .clksel = omap24xx_gpt_clksel,
1583 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001584};
1585
1586static struct clk gpt4_ick = {
1587 .name = "gpt4_ick",
1588 .parent = &l4_ck,
1589 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001590 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001591 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1592 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
1593 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001594};
1595
1596static struct clk gpt4_fck = {
1597 .name = "gpt4_fck",
1598 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001599 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001600 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001601 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1602 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
1603 .init = &omap2_init_clksel_parent,
1604 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1605 .clksel_mask = OMAP24XX_CLKSEL_GPT4_MASK,
1606 .clksel = omap24xx_gpt_clksel,
1607 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001608};
1609
1610static struct clk gpt5_ick = {
1611 .name = "gpt5_ick",
1612 .parent = &l4_ck,
1613 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001614 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001615 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1616 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
1617 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001618};
1619
1620static struct clk gpt5_fck = {
1621 .name = "gpt5_fck",
1622 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001623 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001624 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001625 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1626 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
1627 .init = &omap2_init_clksel_parent,
1628 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1629 .clksel_mask = OMAP24XX_CLKSEL_GPT5_MASK,
1630 .clksel = omap24xx_gpt_clksel,
1631 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001632};
1633
1634static struct clk gpt6_ick = {
1635 .name = "gpt6_ick",
1636 .parent = &l4_ck,
1637 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001638 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001639 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1640 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
1641 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001642};
1643
1644static struct clk gpt6_fck = {
1645 .name = "gpt6_fck",
1646 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001647 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001648 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001649 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1650 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
1651 .init = &omap2_init_clksel_parent,
1652 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1653 .clksel_mask = OMAP24XX_CLKSEL_GPT6_MASK,
1654 .clksel = omap24xx_gpt_clksel,
1655 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001656};
1657
1658static struct clk gpt7_ick = {
1659 .name = "gpt7_ick",
1660 .parent = &l4_ck,
1661 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001662 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1663 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
1664 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001665};
1666
1667static struct clk gpt7_fck = {
1668 .name = "gpt7_fck",
1669 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001670 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001671 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001672 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1673 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
1674 .init = &omap2_init_clksel_parent,
1675 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1676 .clksel_mask = OMAP24XX_CLKSEL_GPT7_MASK,
1677 .clksel = omap24xx_gpt_clksel,
1678 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001679};
1680
1681static struct clk gpt8_ick = {
1682 .name = "gpt8_ick",
1683 .parent = &l4_ck,
1684 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001685 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001686 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1687 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1688 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001689};
1690
1691static struct clk gpt8_fck = {
1692 .name = "gpt8_fck",
1693 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001694 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001695 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001696 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1697 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1698 .init = &omap2_init_clksel_parent,
1699 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1700 .clksel_mask = OMAP24XX_CLKSEL_GPT8_MASK,
1701 .clksel = omap24xx_gpt_clksel,
1702 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001703};
1704
1705static struct clk gpt9_ick = {
1706 .name = "gpt9_ick",
1707 .parent = &l4_ck,
1708 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001709 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001710 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1711 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1712 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001713};
1714
1715static struct clk gpt9_fck = {
1716 .name = "gpt9_fck",
1717 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001718 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001719 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001720 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1721 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1722 .init = &omap2_init_clksel_parent,
1723 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1724 .clksel_mask = OMAP24XX_CLKSEL_GPT9_MASK,
1725 .clksel = omap24xx_gpt_clksel,
1726 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001727};
1728
1729static struct clk gpt10_ick = {
1730 .name = "gpt10_ick",
1731 .parent = &l4_ck,
1732 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001733 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001734 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1735 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1736 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001737};
1738
1739static struct clk gpt10_fck = {
1740 .name = "gpt10_fck",
1741 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001742 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001743 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001744 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1745 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1746 .init = &omap2_init_clksel_parent,
1747 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1748 .clksel_mask = OMAP24XX_CLKSEL_GPT10_MASK,
1749 .clksel = omap24xx_gpt_clksel,
1750 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001751};
1752
1753static struct clk gpt11_ick = {
1754 .name = "gpt11_ick",
1755 .parent = &l4_ck,
1756 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001757 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001758 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1759 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1760 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001761};
1762
1763static struct clk gpt11_fck = {
1764 .name = "gpt11_fck",
1765 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001766 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001767 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001768 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1769 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1770 .init = &omap2_init_clksel_parent,
1771 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1772 .clksel_mask = OMAP24XX_CLKSEL_GPT11_MASK,
1773 .clksel = omap24xx_gpt_clksel,
1774 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001775};
1776
1777static struct clk gpt12_ick = {
1778 .name = "gpt12_ick",
1779 .parent = &l4_ck,
1780 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001781 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001782 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1783 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1784 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001785};
1786
1787static struct clk gpt12_fck = {
1788 .name = "gpt12_fck",
1789 .parent = &func_32k_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001790 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001791 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001792 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1793 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1794 .init = &omap2_init_clksel_parent,
1795 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1796 .clksel_mask = OMAP24XX_CLKSEL_GPT12_MASK,
1797 .clksel = omap24xx_gpt_clksel,
1798 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001799};
1800
1801static struct clk mcbsp1_ick = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001802 .name = "mcbsp_ick",
1803 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001804 .parent = &l4_ck,
1805 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001806 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001807 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1808 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1809 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001810};
1811
1812static struct clk mcbsp1_fck = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001813 .name = "mcbsp_fck",
1814 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001815 .parent = &func_96m_ck,
1816 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001817 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001818 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1819 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1820 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001821};
1822
1823static struct clk mcbsp2_ick = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001824 .name = "mcbsp_ick",
1825 .id = 2,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001826 .parent = &l4_ck,
1827 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001828 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001829 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1830 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1831 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001832};
1833
1834static struct clk mcbsp2_fck = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001835 .name = "mcbsp_fck",
1836 .id = 2,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001837 .parent = &func_96m_ck,
1838 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001839 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001840 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1841 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1842 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001843};
1844
1845static struct clk mcbsp3_ick = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001846 .name = "mcbsp_ick",
1847 .id = 3,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001848 .parent = &l4_ck,
1849 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001850 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001851 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1852 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
1853 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001854};
1855
1856static struct clk mcbsp3_fck = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001857 .name = "mcbsp_fck",
1858 .id = 3,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001859 .parent = &func_96m_ck,
1860 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001861 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001862 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1863 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
1864 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001865};
1866
1867static struct clk mcbsp4_ick = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001868 .name = "mcbsp_ick",
1869 .id = 4,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001870 .parent = &l4_ck,
1871 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001872 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001873 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1874 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1875 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001876};
1877
1878static struct clk mcbsp4_fck = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001879 .name = "mcbsp_fck",
1880 .id = 4,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001881 .parent = &func_96m_ck,
1882 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001883 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001884 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1885 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1886 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001887};
1888
1889static struct clk mcbsp5_ick = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001890 .name = "mcbsp_ick",
1891 .id = 5,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001892 .parent = &l4_ck,
1893 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001894 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001895 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1896 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1897 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001898};
1899
1900static struct clk mcbsp5_fck = {
Eduardo Valentin44ec9a32008-07-03 12:24:40 +03001901 .name = "mcbsp_fck",
1902 .id = 5,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001903 .parent = &func_96m_ck,
1904 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001905 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001906 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1907 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1908 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001909};
1910
1911static struct clk mcspi1_ick = {
Tony Lindgren90afd5c2006-09-25 13:27:20 +03001912 .name = "mcspi_ick",
1913 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001914 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001915 .clkdm_name = "core_l4_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +00001916 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001917 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1918 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1919 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001920};
1921
1922static struct clk mcspi1_fck = {
Tony Lindgren90afd5c2006-09-25 13:27:20 +03001923 .name = "mcspi_fck",
1924 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001925 .parent = &func_48m_ck,
1926 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001927 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001928 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1929 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1930 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001931};
1932
1933static struct clk mcspi2_ick = {
Tony Lindgren90afd5c2006-09-25 13:27:20 +03001934 .name = "mcspi_ick",
1935 .id = 2,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001936 .parent = &l4_ck,
1937 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001938 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001939 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1940 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1941 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001942};
1943
1944static struct clk mcspi2_fck = {
Tony Lindgren90afd5c2006-09-25 13:27:20 +03001945 .name = "mcspi_fck",
1946 .id = 2,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001947 .parent = &func_48m_ck,
1948 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001949 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001950 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1951 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1952 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001953};
1954
1955static struct clk mcspi3_ick = {
Tony Lindgren90afd5c2006-09-25 13:27:20 +03001956 .name = "mcspi_ick",
1957 .id = 3,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001958 .parent = &l4_ck,
1959 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001960 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001961 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1962 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1963 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001964};
1965
1966static struct clk mcspi3_fck = {
Tony Lindgren90afd5c2006-09-25 13:27:20 +03001967 .name = "mcspi_fck",
1968 .id = 3,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001969 .parent = &func_48m_ck,
1970 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001971 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001972 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1973 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1974 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001975};
1976
1977static struct clk uart1_ick = {
1978 .name = "uart1_ick",
1979 .parent = &l4_ck,
1980 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001981 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001982 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1983 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1984 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001985};
1986
1987static struct clk uart1_fck = {
1988 .name = "uart1_fck",
1989 .parent = &func_48m_ck,
1990 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001991 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001992 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1993 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1994 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001995};
1996
1997static struct clk uart2_ick = {
1998 .name = "uart2_ick",
1999 .parent = &l4_ck,
2000 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002001 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002002 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2003 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
2004 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002005};
2006
2007static struct clk uart2_fck = {
2008 .name = "uart2_fck",
2009 .parent = &func_48m_ck,
2010 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002011 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002012 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2013 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
2014 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002015};
2016
2017static struct clk uart3_ick = {
2018 .name = "uart3_ick",
2019 .parent = &l4_ck,
2020 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002021 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002022 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2023 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
2024 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002025};
2026
2027static struct clk uart3_fck = {
2028 .name = "uart3_fck",
2029 .parent = &func_48m_ck,
2030 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002031 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002032 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2033 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
2034 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002035};
2036
2037static struct clk gpios_ick = {
2038 .name = "gpios_ick",
2039 .parent = &l4_ck,
2040 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002041 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002042 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2043 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
2044 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002045};
2046
2047static struct clk gpios_fck = {
2048 .name = "gpios_fck",
2049 .parent = &func_32k_ck,
2050 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002051 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002052 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2053 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
2054 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002055};
2056
2057static struct clk mpu_wdt_ick = {
2058 .name = "mpu_wdt_ick",
2059 .parent = &l4_ck,
2060 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002061 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002062 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2063 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
2064 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002065};
2066
2067static struct clk mpu_wdt_fck = {
2068 .name = "mpu_wdt_fck",
2069 .parent = &func_32k_ck,
2070 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002071 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002072 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2073 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
2074 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002075};
2076
2077static struct clk sync_32k_ick = {
2078 .name = "sync_32k_ick",
2079 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002080 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
2081 ENABLE_ON_INIT,
2082 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002083 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2084 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
2085 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002086};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002087
Tony Lindgren046d6b22005-11-10 14:26:52 +00002088static struct clk wdt1_ick = {
2089 .name = "wdt1_ick",
2090 .parent = &l4_ck,
2091 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002092 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002093 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2094 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
2095 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002096};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002097
Tony Lindgren046d6b22005-11-10 14:26:52 +00002098static struct clk omapctrl_ick = {
2099 .name = "omapctrl_ick",
2100 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002101 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
2102 ENABLE_ON_INIT,
2103 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002104 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2105 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
2106 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002107};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002108
Tony Lindgren046d6b22005-11-10 14:26:52 +00002109static struct clk icr_ick = {
2110 .name = "icr_ick",
2111 .parent = &l4_ck,
2112 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002113 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002114 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2115 .enable_bit = OMAP2430_EN_ICR_SHIFT,
2116 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002117};
2118
2119static struct clk cam_ick = {
2120 .name = "cam_ick",
2121 .parent = &l4_ck,
2122 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002123 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002124 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2125 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
2126 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002127};
2128
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002129/*
2130 * cam_fck controls both CAM_MCLK and CAM_FCLK. It should probably be
2131 * split into two separate clocks, since the parent clocks are different
2132 * and the clockdomains are also different.
2133 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00002134static struct clk cam_fck = {
2135 .name = "cam_fck",
2136 .parent = &func_96m_ck,
2137 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002138 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002139 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2140 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
2141 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002142};
2143
2144static struct clk mailboxes_ick = {
2145 .name = "mailboxes_ick",
2146 .parent = &l4_ck,
2147 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002148 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002149 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2150 .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
2151 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002152};
2153
2154static struct clk wdt4_ick = {
2155 .name = "wdt4_ick",
2156 .parent = &l4_ck,
2157 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002158 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002159 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2160 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
2161 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002162};
2163
2164static struct clk wdt4_fck = {
2165 .name = "wdt4_fck",
2166 .parent = &func_32k_ck,
2167 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002168 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002169 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2170 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
2171 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002172};
2173
2174static struct clk wdt3_ick = {
2175 .name = "wdt3_ick",
2176 .parent = &l4_ck,
2177 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002178 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002179 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2180 .enable_bit = OMAP2420_EN_WDT3_SHIFT,
2181 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002182};
2183
2184static struct clk wdt3_fck = {
2185 .name = "wdt3_fck",
2186 .parent = &func_32k_ck,
2187 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002188 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002189 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2190 .enable_bit = OMAP2420_EN_WDT3_SHIFT,
2191 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002192};
2193
2194static struct clk mspro_ick = {
2195 .name = "mspro_ick",
2196 .parent = &l4_ck,
2197 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002198 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002199 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2200 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
2201 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002202};
2203
2204static struct clk mspro_fck = {
2205 .name = "mspro_fck",
2206 .parent = &func_96m_ck,
2207 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002208 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002209 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2210 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
2211 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002212};
2213
2214static struct clk mmc_ick = {
2215 .name = "mmc_ick",
2216 .parent = &l4_ck,
2217 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002218 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002219 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2220 .enable_bit = OMAP2420_EN_MMC_SHIFT,
2221 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002222};
2223
2224static struct clk mmc_fck = {
2225 .name = "mmc_fck",
2226 .parent = &func_96m_ck,
2227 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002228 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002229 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2230 .enable_bit = OMAP2420_EN_MMC_SHIFT,
2231 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002232};
2233
2234static struct clk fac_ick = {
2235 .name = "fac_ick",
2236 .parent = &l4_ck,
2237 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002238 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002239 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2240 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
2241 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002242};
2243
2244static struct clk fac_fck = {
2245 .name = "fac_fck",
2246 .parent = &func_12m_ck,
2247 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002248 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002249 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2250 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
2251 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002252};
2253
2254static struct clk eac_ick = {
2255 .name = "eac_ick",
2256 .parent = &l4_ck,
2257 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002258 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002259 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2260 .enable_bit = OMAP2420_EN_EAC_SHIFT,
2261 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002262};
2263
2264static struct clk eac_fck = {
2265 .name = "eac_fck",
2266 .parent = &func_96m_ck,
2267 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002268 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002269 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2270 .enable_bit = OMAP2420_EN_EAC_SHIFT,
2271 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002272};
2273
2274static struct clk hdq_ick = {
2275 .name = "hdq_ick",
2276 .parent = &l4_ck,
2277 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002278 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002279 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2280 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
2281 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002282};
2283
2284static struct clk hdq_fck = {
2285 .name = "hdq_fck",
2286 .parent = &func_12m_ck,
2287 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002288 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002289 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2290 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
2291 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002292};
2293
2294static struct clk i2c2_ick = {
Tony Lindgrenb824efa2006-04-02 17:46:20 +01002295 .name = "i2c_ick",
2296 .id = 2,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002297 .parent = &l4_ck,
2298 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002299 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002300 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2301 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
2302 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002303};
2304
2305static struct clk i2c2_fck = {
Tony Lindgrenb824efa2006-04-02 17:46:20 +01002306 .name = "i2c_fck",
2307 .id = 2,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002308 .parent = &func_12m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02002309 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002310 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002311 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2312 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
2313 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002314};
2315
2316static struct clk i2chs2_fck = {
Syed Mohammed Khasim4574eb62008-11-21 13:39:45 -08002317 .name = "i2c_fck",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002318 .id = 2,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002319 .parent = &func_96m_ck,
2320 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002321 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002322 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2323 .enable_bit = OMAP2430_EN_I2CHS2_SHIFT,
2324 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002325};
2326
2327static struct clk i2c1_ick = {
Tony Lindgrenb824efa2006-04-02 17:46:20 +01002328 .name = "i2c_ick",
2329 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002330 .parent = &l4_ck,
2331 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002332 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002333 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2334 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
2335 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002336};
2337
2338static struct clk i2c1_fck = {
Tony Lindgrenb824efa2006-04-02 17:46:20 +01002339 .name = "i2c_fck",
2340 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002341 .parent = &func_12m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02002342 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002343 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002344 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2345 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
2346 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002347};
2348
2349static struct clk i2chs1_fck = {
Syed Mohammed Khasim4574eb62008-11-21 13:39:45 -08002350 .name = "i2c_fck",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002351 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002352 .parent = &func_96m_ck,
2353 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002354 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002355 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2356 .enable_bit = OMAP2430_EN_I2CHS1_SHIFT,
2357 .recalc = &followparent_recalc,
2358};
2359
2360static struct clk gpmc_fck = {
2361 .name = "gpmc_fck",
2362 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002363 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
2364 ENABLE_ON_INIT,
2365 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002366 .recalc = &followparent_recalc,
2367};
2368
2369static struct clk sdma_fck = {
2370 .name = "sdma_fck",
2371 .parent = &core_l3_ck,
2372 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002373 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002374 .recalc = &followparent_recalc,
2375};
2376
2377static struct clk sdma_ick = {
2378 .name = "sdma_ick",
2379 .parent = &l4_ck,
2380 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002381 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002382 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002383};
2384
2385static struct clk vlynq_ick = {
2386 .name = "vlynq_ick",
2387 .parent = &core_l3_ck,
2388 .flags = CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002389 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002390 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2391 .enable_bit = OMAP2420_EN_VLYNQ_SHIFT,
2392 .recalc = &followparent_recalc,
2393};
2394
2395static const struct clksel_rate vlynq_fck_96m_rates[] = {
2396 { .div = 1, .val = 0, .flags = RATE_IN_242X | DEFAULT_RATE },
2397 { .div = 0 }
2398};
2399
2400static const struct clksel_rate vlynq_fck_core_rates[] = {
2401 { .div = 1, .val = 1, .flags = RATE_IN_242X },
2402 { .div = 2, .val = 2, .flags = RATE_IN_242X },
2403 { .div = 3, .val = 3, .flags = RATE_IN_242X },
2404 { .div = 4, .val = 4, .flags = RATE_IN_242X },
2405 { .div = 6, .val = 6, .flags = RATE_IN_242X },
2406 { .div = 8, .val = 8, .flags = RATE_IN_242X },
2407 { .div = 9, .val = 9, .flags = RATE_IN_242X },
2408 { .div = 12, .val = 12, .flags = RATE_IN_242X },
2409 { .div = 16, .val = 16, .flags = RATE_IN_242X | DEFAULT_RATE },
2410 { .div = 18, .val = 18, .flags = RATE_IN_242X },
2411 { .div = 0 }
2412};
2413
2414static const struct clksel vlynq_fck_clksel[] = {
2415 { .parent = &func_96m_ck, .rates = vlynq_fck_96m_rates },
2416 { .parent = &core_ck, .rates = vlynq_fck_core_rates },
2417 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +00002418};
2419
2420static struct clk vlynq_fck = {
2421 .name = "vlynq_fck",
2422 .parent = &func_96m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02002423 .flags = CLOCK_IN_OMAP242X | DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002424 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002425 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2426 .enable_bit = OMAP2420_EN_VLYNQ_SHIFT,
2427 .init = &omap2_init_clksel_parent,
2428 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
2429 .clksel_mask = OMAP2420_CLKSEL_VLYNQ_MASK,
2430 .clksel = vlynq_fck_clksel,
2431 .recalc = &omap2_clksel_recalc,
2432 .round_rate = &omap2_clksel_round_rate,
2433 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00002434};
2435
2436static struct clk sdrc_ick = {
2437 .name = "sdrc_ick",
2438 .parent = &l4_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02002439 .flags = CLOCK_IN_OMAP243X | ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002440 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002441 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
2442 .enable_bit = OMAP2430_EN_SDRC_SHIFT,
2443 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002444};
2445
2446static struct clk des_ick = {
2447 .name = "des_ick",
2448 .parent = &l4_ck,
2449 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002450 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002451 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2452 .enable_bit = OMAP24XX_EN_DES_SHIFT,
2453 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002454};
2455
2456static struct clk sha_ick = {
2457 .name = "sha_ick",
2458 .parent = &l4_ck,
2459 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002460 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002461 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2462 .enable_bit = OMAP24XX_EN_SHA_SHIFT,
2463 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002464};
2465
2466static struct clk rng_ick = {
2467 .name = "rng_ick",
2468 .parent = &l4_ck,
2469 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002470 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002471 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2472 .enable_bit = OMAP24XX_EN_RNG_SHIFT,
2473 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002474};
2475
2476static struct clk aes_ick = {
2477 .name = "aes_ick",
2478 .parent = &l4_ck,
2479 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002480 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002481 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2482 .enable_bit = OMAP24XX_EN_AES_SHIFT,
2483 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002484};
2485
2486static struct clk pka_ick = {
2487 .name = "pka_ick",
2488 .parent = &l4_ck,
2489 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002490 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002491 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2492 .enable_bit = OMAP24XX_EN_PKA_SHIFT,
2493 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002494};
2495
2496static struct clk usb_fck = {
2497 .name = "usb_fck",
2498 .parent = &func_48m_ck,
2499 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002500 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002501 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2502 .enable_bit = OMAP24XX_EN_USB_SHIFT,
2503 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002504};
2505
2506static struct clk usbhs_ick = {
2507 .name = "usbhs_ick",
Tony Lindgrenfde0fd42006-01-17 15:31:18 -08002508 .parent = &core_l3_ck,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002509 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002510 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002511 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2512 .enable_bit = OMAP2430_EN_USBHS_SHIFT,
2513 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002514};
2515
2516static struct clk mmchs1_ick = {
Paul Walmsleye32744b2008-03-18 15:47:55 +02002517 .name = "mmchs_ick",
Tony Lindgren046d6b22005-11-10 14:26:52 +00002518 .parent = &l4_ck,
2519 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002520 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002521 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2522 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
2523 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002524};
2525
2526static struct clk mmchs1_fck = {
Paul Walmsleye32744b2008-03-18 15:47:55 +02002527 .name = "mmchs_fck",
Tony Lindgren046d6b22005-11-10 14:26:52 +00002528 .parent = &func_96m_ck,
2529 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002530 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002531 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2532 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
2533 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002534};
2535
2536static struct clk mmchs2_ick = {
Paul Walmsleye32744b2008-03-18 15:47:55 +02002537 .name = "mmchs_ick",
Tony Lindgrend8874662008-12-10 17:37:16 -08002538 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002539 .parent = &l4_ck,
2540 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002541 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002542 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2543 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
2544 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002545};
2546
2547static struct clk mmchs2_fck = {
Paul Walmsleye32744b2008-03-18 15:47:55 +02002548 .name = "mmchs_fck",
Tony Lindgrend8874662008-12-10 17:37:16 -08002549 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002550 .parent = &func_96m_ck,
2551 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleye32744b2008-03-18 15:47:55 +02002552 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2553 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
2554 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002555};
2556
2557static struct clk gpio5_ick = {
2558 .name = "gpio5_ick",
2559 .parent = &l4_ck,
2560 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002561 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002562 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2563 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
2564 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002565};
2566
2567static struct clk gpio5_fck = {
2568 .name = "gpio5_fck",
2569 .parent = &func_32k_ck,
2570 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002571 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002572 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2573 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
2574 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002575};
2576
2577static struct clk mdm_intc_ick = {
2578 .name = "mdm_intc_ick",
2579 .parent = &l4_ck,
2580 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002581 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002582 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2583 .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT,
2584 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002585};
2586
2587static struct clk mmchsdb1_fck = {
Paul Walmsleye32744b2008-03-18 15:47:55 +02002588 .name = "mmchsdb_fck",
Tony Lindgren046d6b22005-11-10 14:26:52 +00002589 .parent = &func_32k_ck,
2590 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002591 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002592 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2593 .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT,
2594 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002595};
2596
2597static struct clk mmchsdb2_fck = {
Paul Walmsleye32744b2008-03-18 15:47:55 +02002598 .name = "mmchsdb_fck",
Tony Lindgrend8874662008-12-10 17:37:16 -08002599 .id = 1,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002600 .parent = &func_32k_ck,
2601 .flags = CLOCK_IN_OMAP243X,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002602 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002603 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2604 .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT,
2605 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002606};
Paul Walmsleye32744b2008-03-18 15:47:55 +02002607
Tony Lindgren046d6b22005-11-10 14:26:52 +00002608/*
2609 * This clock is a composite clock which does entire set changes then
2610 * forces a rebalance. It keys on the MPU speed, but it really could
2611 * be any key speed part of a set in the rate table.
2612 *
2613 * to really change a set, you need memory table sets which get changed
2614 * in sram, pre-notifiers & post notifiers, changing the top set, without
2615 * having low level display recalc's won't work... this is why dpm notifiers
2616 * work, isr's off, walk a list of clocks already _off_ and not messing with
2617 * the bus.
2618 *
2619 * This clock should have no parent. It embodies the entire upper level
2620 * active set. A parent will mess up some of the init also.
2621 */
2622static struct clk virt_prcm_set = {
2623 .name = "virt_prcm_set",
2624 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
Russell Kingdb8ac472008-11-04 15:10:54 +00002625 ALWAYS_ENABLED | DELAYED_APP,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002626 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
Paul Walmsleye32744b2008-03-18 15:47:55 +02002627 .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */
Tony Lindgren046d6b22005-11-10 14:26:52 +00002628 .set_rate = &omap2_select_table_rate,
2629 .round_rate = &omap2_round_to_table_rate,
2630};
Paul Walmsleye32744b2008-03-18 15:47:55 +02002631
2632static struct clk *onchip_24xx_clks[] __initdata = {
Tony Lindgren046d6b22005-11-10 14:26:52 +00002633 /* external root sources */
2634 &func_32k_ck,
2635 &osc_ck,
2636 &sys_ck,
2637 &alt_ck,
2638 /* internal analog sources */
2639 &dpll_ck,
2640 &apll96_ck,
2641 &apll54_ck,
2642 /* internal prcm root sources */
2643 &func_54m_ck,
2644 &core_ck,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002645 &func_96m_ck,
2646 &func_48m_ck,
2647 &func_12m_ck,
2648 &wdt1_osc_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02002649 &sys_clkout_src,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002650 &sys_clkout,
Paul Walmsleye32744b2008-03-18 15:47:55 +02002651 &sys_clkout2_src,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002652 &sys_clkout2,
Tony Lindgrenb824efa2006-04-02 17:46:20 +01002653 &emul_ck,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002654 /* mpu domain clocks */
2655 &mpu_ck,
2656 /* dsp domain clocks */
Tony Lindgren046d6b22005-11-10 14:26:52 +00002657 &dsp_fck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02002658 &dsp_irate_ick,
2659 &dsp_ick, /* 242x */
2660 &iva2_1_ick, /* 243x */
2661 &iva1_ifck, /* 242x */
2662 &iva1_mpu_int_ifck, /* 242x */
Tony Lindgren046d6b22005-11-10 14:26:52 +00002663 /* GFX domain clocks */
2664 &gfx_3d_fck,
2665 &gfx_2d_fck,
2666 &gfx_ick,
2667 /* Modem domain clocks */
2668 &mdm_ick,
2669 &mdm_osc_ck,
2670 /* DSS domain clocks */
2671 &dss_ick,
2672 &dss1_fck,
2673 &dss2_fck,
2674 &dss_54m_fck,
2675 /* L3 domain clocks */
2676 &core_l3_ck,
2677 &ssi_ssr_sst_fck,
2678 &usb_l4_ick,
2679 /* L4 domain clocks */
2680 &l4_ck, /* used as both core_l4 and wu_l4 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00002681 /* virtual meta-group clock */
2682 &virt_prcm_set,
2683 /* general l4 interface ck, multi-parent functional clk */
2684 &gpt1_ick,
2685 &gpt1_fck,
2686 &gpt2_ick,
2687 &gpt2_fck,
2688 &gpt3_ick,
2689 &gpt3_fck,
2690 &gpt4_ick,
2691 &gpt4_fck,
2692 &gpt5_ick,
2693 &gpt5_fck,
2694 &gpt6_ick,
2695 &gpt6_fck,
2696 &gpt7_ick,
2697 &gpt7_fck,
2698 &gpt8_ick,
2699 &gpt8_fck,
2700 &gpt9_ick,
2701 &gpt9_fck,
2702 &gpt10_ick,
2703 &gpt10_fck,
2704 &gpt11_ick,
2705 &gpt11_fck,
2706 &gpt12_ick,
2707 &gpt12_fck,
2708 &mcbsp1_ick,
2709 &mcbsp1_fck,
2710 &mcbsp2_ick,
2711 &mcbsp2_fck,
2712 &mcbsp3_ick,
2713 &mcbsp3_fck,
2714 &mcbsp4_ick,
2715 &mcbsp4_fck,
2716 &mcbsp5_ick,
2717 &mcbsp5_fck,
2718 &mcspi1_ick,
2719 &mcspi1_fck,
2720 &mcspi2_ick,
2721 &mcspi2_fck,
2722 &mcspi3_ick,
2723 &mcspi3_fck,
2724 &uart1_ick,
2725 &uart1_fck,
2726 &uart2_ick,
2727 &uart2_fck,
2728 &uart3_ick,
2729 &uart3_fck,
2730 &gpios_ick,
2731 &gpios_fck,
2732 &mpu_wdt_ick,
2733 &mpu_wdt_fck,
2734 &sync_32k_ick,
2735 &wdt1_ick,
2736 &omapctrl_ick,
2737 &icr_ick,
2738 &cam_fck,
2739 &cam_ick,
2740 &mailboxes_ick,
2741 &wdt4_ick,
2742 &wdt4_fck,
2743 &wdt3_ick,
2744 &wdt3_fck,
2745 &mspro_ick,
2746 &mspro_fck,
2747 &mmc_ick,
2748 &mmc_fck,
2749 &fac_ick,
2750 &fac_fck,
2751 &eac_ick,
2752 &eac_fck,
2753 &hdq_ick,
2754 &hdq_fck,
2755 &i2c1_ick,
2756 &i2c1_fck,
2757 &i2chs1_fck,
2758 &i2c2_ick,
2759 &i2c2_fck,
2760 &i2chs2_fck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02002761 &gpmc_fck,
2762 &sdma_fck,
2763 &sdma_ick,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002764 &vlynq_ick,
2765 &vlynq_fck,
2766 &sdrc_ick,
2767 &des_ick,
2768 &sha_ick,
2769 &rng_ick,
2770 &aes_ick,
2771 &pka_ick,
2772 &usb_fck,
2773 &usbhs_ick,
2774 &mmchs1_ick,
2775 &mmchs1_fck,
2776 &mmchs2_ick,
2777 &mmchs2_fck,
2778 &gpio5_ick,
2779 &gpio5_fck,
2780 &mdm_intc_ick,
2781 &mmchsdb1_fck,
2782 &mmchsdb2_fck,
2783};
2784
2785#endif
Paul Walmsley6b8858a2008-03-18 10:35:15 +02002786