blob: 82ad8b439eb9c568f5b3e3040ab78a9631fcdb05 [file] [log] [blame]
Tony Lindgren046d6b22005-11-10 14:26:52 +00001/*
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002 * linux/arch/arm/mach-omap2/clock2xxx_data.c
Tony Lindgren046d6b22005-11-10 14:26:52 +00003 *
Paul Walmsleyd8a94452009-12-08 16:21:29 -07004 * Copyright (C) 2005-2009 Texas Instruments, Inc.
Paul Walmsley93340a22010-02-22 22:09:12 -07005 * Copyright (C) 2004-2010 Nokia Corporation
Tony Lindgrena16e9702008-03-18 11:56:39 +02006 *
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 Walmsleyd8a94452009-12-08 16:21:29 -070016#include <linux/kernel.h>
17#include <linux/clk.h>
Paul Walmsley93340a22010-02-22 22:09:12 -070018#include <linux/list.h>
Paul Walmsleyd8a94452009-12-08 16:21:29 -070019
20#include <plat/clkdev_omap.h>
Tony Lindgren046d6b22005-11-10 14:26:52 +000021
Paul Walmsley6b8858a2008-03-18 10:35:15 +020022#include "clock.h"
Paul Walmsleyd8a94452009-12-08 16:21:29 -070023#include "clock2xxx.h"
24#include "opp2xxx.h"
Paul Walmsley6b8858a2008-03-18 10:35:15 +020025#include "prm.h"
26#include "cm.h"
27#include "prm-regbits-24xx.h"
28#include "cm-regbits-24xx.h"
29#include "sdrc.h"
30
Tony Lindgren046d6b22005-11-10 14:26:52 +000031/*-------------------------------------------------------------------------
32 * 24xx clock tree.
33 *
34 * NOTE:In many cases here we are assigning a 'default' parent. In many
35 * cases the parent is selectable. The get/set parent calls will also
36 * switch sources.
37 *
38 * Many some clocks say always_enabled, but they can be auto idled for
39 * power savings. They will always be available upon clock request.
40 *
41 * Several sources are given initial rates which may be wrong, this will
42 * be fixed up in the init func.
43 *
44 * Things are broadly separated below by clock domains. It is
45 * noteworthy that most periferals have dependencies on multiple clock
46 * domains. Many get their interface clocks from the L4 domain, but get
47 * functional clocks from fixed sources or other core domain derived
48 * clocks.
49 *-------------------------------------------------------------------------*/
50
51/* Base external input clocks */
52static struct clk func_32k_ck = {
53 .name = "func_32k_ck",
Russell King897dcde2008-11-04 16:35:03 +000054 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +000055 .rate = 32000,
Russell King3f0a8202009-01-31 10:05:51 +000056 .flags = RATE_FIXED,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030057 .clkdm_name = "wkup_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +000058};
Paul Walmsleye32744b2008-03-18 15:47:55 +020059
Paul Walmsleyf2480762009-04-23 21:11:10 -060060static struct clk secure_32k_ck = {
61 .name = "secure_32k_ck",
62 .ops = &clkops_null,
63 .rate = 32768,
64 .flags = RATE_FIXED,
65 .clkdm_name = "wkup_clkdm",
66};
67
Tony Lindgren046d6b22005-11-10 14:26:52 +000068/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
69static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
70 .name = "osc_ck",
Russell King548d8492008-11-04 14:02:46 +000071 .ops = &clkops_oscck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030072 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +020073 .recalc = &omap2_osc_clk_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +000074};
75
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030076/* Without modem likely 12MHz, with modem likely 13MHz */
Tony Lindgren046d6b22005-11-10 14:26:52 +000077static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */
78 .name = "sys_ck", /* ~ ref_clk also */
Russell King897dcde2008-11-04 16:35:03 +000079 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +000080 .parent = &osc_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030081 .clkdm_name = "wkup_clkdm",
Paul Walmsley44da0a52010-01-26 20:13:08 -070082 .recalc = &omap2xxx_sys_clk_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +000083};
Paul Walmsleye32744b2008-03-18 15:47:55 +020084
Tony Lindgren046d6b22005-11-10 14:26:52 +000085static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
86 .name = "alt_ck",
Russell King897dcde2008-11-04 16:35:03 +000087 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +000088 .rate = 54000000,
Russell King3f0a8202009-01-31 10:05:51 +000089 .flags = RATE_FIXED,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030090 .clkdm_name = "wkup_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +000091};
Paul Walmsleye32744b2008-03-18 15:47:55 +020092
Tony Lindgren046d6b22005-11-10 14:26:52 +000093/*
94 * Analog domain root source clocks
95 */
96
97/* dpll_ck, is broken out in to special cases through clksel */
Paul Walmsley6b8858a2008-03-18 10:35:15 +020098/* REVISIT: Rate changes on dpll_ck trigger a full set change. ...
99 * deal with this
100 */
101
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300102static struct dpll_data dpll_dd = {
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200103 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
104 .mult_mask = OMAP24XX_DPLL_MULT_MASK,
105 .div1_mask = OMAP24XX_DPLL_DIV_MASK,
Russell Kingc0bf3132009-02-19 13:29:22 +0000106 .clk_bypass = &sys_ck,
107 .clk_ref = &sys_ck,
108 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
109 .enable_mask = OMAP24XX_EN_DPLL_MASK,
Paul Walmsley93340a22010-02-22 22:09:12 -0700110 .max_multiplier = 1023,
Paul Walmsley95f538a2009-01-28 12:08:44 -0700111 .min_divider = 1,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300112 .max_divider = 16,
113 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200114};
115
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300116/*
117 * XXX Cannot add round_rate here yet, as this is still a composite clock,
118 * not just a DPLL
119 */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000120static struct clk dpll_ck = {
121 .name = "dpll_ck",
Russell King897dcde2008-11-04 16:35:03 +0000122 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000123 .parent = &sys_ck, /* Can be func_32k also */
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200124 .dpll_data = &dpll_dd,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300125 .clkdm_name = "wkup_clkdm",
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300126 .recalc = &omap2_dpllcore_recalc,
127 .set_rate = &omap2_reprogram_dpllcore,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000128};
129
130static struct clk apll96_ck = {
131 .name = "apll96_ck",
Paul Walmsley06b16932009-12-08 16:18:46 -0700132 .ops = &clkops_apll96,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000133 .parent = &sys_ck,
134 .rate = 96000000,
Russell King3f0a8202009-01-31 10:05:51 +0000135 .flags = RATE_FIXED | ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300136 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200137 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
138 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000139};
140
141static struct clk apll54_ck = {
142 .name = "apll54_ck",
Paul Walmsley06b16932009-12-08 16:18:46 -0700143 .ops = &clkops_apll54,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000144 .parent = &sys_ck,
145 .rate = 54000000,
Russell King3f0a8202009-01-31 10:05:51 +0000146 .flags = RATE_FIXED | ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300147 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200148 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
149 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000150};
151
152/*
153 * PRCM digital base sources
154 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200155
156/* func_54m_ck */
157
158static const struct clksel_rate func_54m_apll54_rates[] = {
159 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
160 { .div = 0 },
161};
162
163static const struct clksel_rate func_54m_alt_rates[] = {
164 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
165 { .div = 0 },
166};
167
168static const struct clksel func_54m_clksel[] = {
169 { .parent = &apll54_ck, .rates = func_54m_apll54_rates, },
170 { .parent = &alt_ck, .rates = func_54m_alt_rates, },
171 { .parent = NULL },
172};
173
Tony Lindgren046d6b22005-11-10 14:26:52 +0000174static struct clk func_54m_ck = {
175 .name = "func_54m_ck",
Russell King57137182008-11-04 16:48:35 +0000176 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000177 .parent = &apll54_ck, /* can also be alt_clk */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300178 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200179 .init = &omap2_init_clksel_parent,
180 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
181 .clksel_mask = OMAP24XX_54M_SOURCE,
182 .clksel = func_54m_clksel,
183 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000184};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200185
Tony Lindgren046d6b22005-11-10 14:26:52 +0000186static struct clk core_ck = {
187 .name = "core_ck",
Russell King897dcde2008-11-04 16:35:03 +0000188 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000189 .parent = &dpll_ck, /* can also be 32k */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300190 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200191 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000192};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200193
194/* func_96m_ck */
195static const struct clksel_rate func_96m_apll96_rates[] = {
196 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
197 { .div = 0 },
Tony Lindgren046d6b22005-11-10 14:26:52 +0000198};
199
Paul Walmsleye32744b2008-03-18 15:47:55 +0200200static const struct clksel_rate func_96m_alt_rates[] = {
201 { .div = 1, .val = 1, .flags = RATE_IN_243X | DEFAULT_RATE },
202 { .div = 0 },
203};
204
205static const struct clksel func_96m_clksel[] = {
206 { .parent = &apll96_ck, .rates = func_96m_apll96_rates },
207 { .parent = &alt_ck, .rates = func_96m_alt_rates },
208 { .parent = NULL }
209};
210
211/* The parent of this clock is not selectable on 2420. */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000212static struct clk func_96m_ck = {
213 .name = "func_96m_ck",
Russell King57137182008-11-04 16:48:35 +0000214 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000215 .parent = &apll96_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300216 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200217 .init = &omap2_init_clksel_parent,
218 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
219 .clksel_mask = OMAP2430_96M_SOURCE,
220 .clksel = func_96m_clksel,
221 .recalc = &omap2_clksel_recalc,
222 .round_rate = &omap2_clksel_round_rate,
223 .set_rate = &omap2_clksel_set_rate
224};
225
226/* func_48m_ck */
227
228static const struct clksel_rate func_48m_apll96_rates[] = {
229 { .div = 2, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
230 { .div = 0 },
231};
232
233static const struct clksel_rate func_48m_alt_rates[] = {
234 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
235 { .div = 0 },
236};
237
238static const struct clksel func_48m_clksel[] = {
239 { .parent = &apll96_ck, .rates = func_48m_apll96_rates },
240 { .parent = &alt_ck, .rates = func_48m_alt_rates },
241 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000242};
243
244static struct clk func_48m_ck = {
245 .name = "func_48m_ck",
Russell King57137182008-11-04 16:48:35 +0000246 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000247 .parent = &apll96_ck, /* 96M or Alt */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300248 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200249 .init = &omap2_init_clksel_parent,
250 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
251 .clksel_mask = OMAP24XX_48M_SOURCE,
252 .clksel = func_48m_clksel,
253 .recalc = &omap2_clksel_recalc,
254 .round_rate = &omap2_clksel_round_rate,
255 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000256};
257
258static struct clk func_12m_ck = {
259 .name = "func_12m_ck",
Russell King57137182008-11-04 16:48:35 +0000260 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000261 .parent = &func_48m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200262 .fixed_div = 4,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300263 .clkdm_name = "wkup_clkdm",
Paul Walmsleye9b98f62010-01-26 20:12:57 -0700264 .recalc = &omap_fixed_divisor_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000265};
266
267/* Secure timer, only available in secure mode */
268static struct clk wdt1_osc_ck = {
269 .name = "ck_wdt1_osc",
Russell King897dcde2008-11-04 16:35:03 +0000270 .ops = &clkops_null, /* RMK: missing? */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000271 .parent = &osc_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200272 .recalc = &followparent_recalc,
273};
274
275/*
276 * The common_clkout* clksel_rate structs are common to
277 * sys_clkout, sys_clkout_src, sys_clkout2, and sys_clkout2_src.
278 * sys_clkout2_* are 2420-only, so the
279 * clksel_rate flags fields are inaccurate for those clocks. This is
280 * harmless since access to those clocks are gated by the struct clk
281 * flags fields, which mark them as 2420-only.
282 */
283static const struct clksel_rate common_clkout_src_core_rates[] = {
284 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
285 { .div = 0 }
286};
287
288static const struct clksel_rate common_clkout_src_sys_rates[] = {
289 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
290 { .div = 0 }
291};
292
293static const struct clksel_rate common_clkout_src_96m_rates[] = {
294 { .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
295 { .div = 0 }
296};
297
298static const struct clksel_rate common_clkout_src_54m_rates[] = {
299 { .div = 1, .val = 3, .flags = RATE_IN_24XX | DEFAULT_RATE },
300 { .div = 0 }
301};
302
303static const struct clksel common_clkout_src_clksel[] = {
304 { .parent = &core_ck, .rates = common_clkout_src_core_rates },
305 { .parent = &sys_ck, .rates = common_clkout_src_sys_rates },
306 { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates },
307 { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates },
308 { .parent = NULL }
309};
310
311static struct clk sys_clkout_src = {
312 .name = "sys_clkout_src",
Russell Kingc1168dc2008-11-04 21:24:00 +0000313 .ops = &clkops_omap2_dflt,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200314 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300315 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200316 .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
317 .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT,
318 .init = &omap2_init_clksel_parent,
319 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
320 .clksel_mask = OMAP24XX_CLKOUT_SOURCE_MASK,
321 .clksel = common_clkout_src_clksel,
322 .recalc = &omap2_clksel_recalc,
323 .round_rate = &omap2_clksel_round_rate,
324 .set_rate = &omap2_clksel_set_rate
325};
326
327static const struct clksel_rate common_clkout_rates[] = {
328 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
329 { .div = 2, .val = 1, .flags = RATE_IN_24XX },
330 { .div = 4, .val = 2, .flags = RATE_IN_24XX },
331 { .div = 8, .val = 3, .flags = RATE_IN_24XX },
332 { .div = 16, .val = 4, .flags = RATE_IN_24XX },
333 { .div = 0 },
334};
335
336static const struct clksel sys_clkout_clksel[] = {
337 { .parent = &sys_clkout_src, .rates = common_clkout_rates },
338 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000339};
340
341static struct clk sys_clkout = {
342 .name = "sys_clkout",
Russell King57137182008-11-04 16:48:35 +0000343 .ops = &clkops_null,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200344 .parent = &sys_clkout_src,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300345 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200346 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
347 .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK,
348 .clksel = sys_clkout_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000349 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200350 .round_rate = &omap2_clksel_round_rate,
351 .set_rate = &omap2_clksel_set_rate
352};
353
354/* In 2430, new in 2420 ES2 */
355static struct clk sys_clkout2_src = {
356 .name = "sys_clkout2_src",
Russell Kingc1168dc2008-11-04 21:24:00 +0000357 .ops = &clkops_omap2_dflt,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200358 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300359 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200360 .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
361 .enable_bit = OMAP2420_CLKOUT2_EN_SHIFT,
362 .init = &omap2_init_clksel_parent,
363 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
364 .clksel_mask = OMAP2420_CLKOUT2_SOURCE_MASK,
365 .clksel = common_clkout_src_clksel,
366 .recalc = &omap2_clksel_recalc,
367 .round_rate = &omap2_clksel_round_rate,
368 .set_rate = &omap2_clksel_set_rate
369};
370
371static const struct clksel sys_clkout2_clksel[] = {
372 { .parent = &sys_clkout2_src, .rates = common_clkout_rates },
373 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000374};
375
376/* In 2430, new in 2420 ES2 */
377static struct clk sys_clkout2 = {
378 .name = "sys_clkout2",
Russell King57137182008-11-04 16:48:35 +0000379 .ops = &clkops_null,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200380 .parent = &sys_clkout2_src,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300381 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200382 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
383 .clksel_mask = OMAP2420_CLKOUT2_DIV_MASK,
384 .clksel = sys_clkout2_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000385 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200386 .round_rate = &omap2_clksel_round_rate,
387 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000388};
389
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100390static struct clk emul_ck = {
391 .name = "emul_ck",
Russell Kingc1168dc2008-11-04 21:24:00 +0000392 .ops = &clkops_omap2_dflt,
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100393 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300394 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200395 .enable_reg = OMAP24XX_PRCM_CLKEMUL_CTRL,
396 .enable_bit = OMAP24XX_EMULATION_EN_SHIFT,
397 .recalc = &followparent_recalc,
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100398
399};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200400
Tony Lindgren046d6b22005-11-10 14:26:52 +0000401/*
402 * MPU clock domain
403 * Clocks:
404 * MPU_FCLK, MPU_ICLK
405 * INT_M_FCLK, INT_M_I_CLK
406 *
407 * - Individual clocks are hardware managed.
408 * - Base divider comes from: CM_CLKSEL_MPU
409 *
410 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200411static const struct clksel_rate mpu_core_rates[] = {
412 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
413 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
414 { .div = 4, .val = 4, .flags = RATE_IN_242X },
415 { .div = 6, .val = 6, .flags = RATE_IN_242X },
416 { .div = 8, .val = 8, .flags = RATE_IN_242X },
417 { .div = 0 },
418};
419
420static const struct clksel mpu_clksel[] = {
421 { .parent = &core_ck, .rates = mpu_core_rates },
422 { .parent = NULL }
423};
424
Tony Lindgren046d6b22005-11-10 14:26:52 +0000425static struct clk mpu_ck = { /* Control cpu */
426 .name = "mpu_ck",
Russell King897dcde2008-11-04 16:35:03 +0000427 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000428 .parent = &core_ck,
Paul Walmsley1a337712010-02-22 22:09:16 -0700429 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300430 .clkdm_name = "mpu_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200431 .init = &omap2_init_clksel_parent,
432 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
433 .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200434 .clksel = mpu_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000435 .recalc = &omap2_clksel_recalc,
436};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200437
Tony Lindgren046d6b22005-11-10 14:26:52 +0000438/*
439 * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain
440 * Clocks:
Paul Walmsleye32744b2008-03-18 15:47:55 +0200441 * 2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
Tony Lindgren046d6b22005-11-10 14:26:52 +0000442 * 2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP
Paul Walmsleye32744b2008-03-18 15:47:55 +0200443 *
Tony Lindgren046d6b22005-11-10 14:26:52 +0000444 * Won't be too specific here. The core clock comes into this block
445 * it is divided then tee'ed. One branch goes directly to xyz enable
446 * controls. The other branch gets further divided by 2 then possibly
447 * routed into a synchronizer and out of clocks abc.
448 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200449static const struct clksel_rate dsp_fck_core_rates[] = {
450 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
451 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
452 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
453 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
454 { .div = 6, .val = 6, .flags = RATE_IN_242X },
455 { .div = 8, .val = 8, .flags = RATE_IN_242X },
456 { .div = 12, .val = 12, .flags = RATE_IN_242X },
457 { .div = 0 },
458};
459
460static const struct clksel dsp_fck_clksel[] = {
461 { .parent = &core_ck, .rates = dsp_fck_core_rates },
462 { .parent = NULL }
463};
464
Tony Lindgren046d6b22005-11-10 14:26:52 +0000465static struct clk dsp_fck = {
466 .name = "dsp_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000467 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000468 .parent = &core_ck,
Paul Walmsley1a337712010-02-22 22:09:16 -0700469 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300470 .clkdm_name = "dsp_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200471 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
472 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
473 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
474 .clksel_mask = OMAP24XX_CLKSEL_DSP_MASK,
475 .clksel = dsp_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000476 .recalc = &omap2_clksel_recalc,
477};
478
Paul Walmsleye32744b2008-03-18 15:47:55 +0200479/* DSP interface clock */
480static const struct clksel_rate dsp_irate_ick_rates[] = {
481 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
482 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
483 { .div = 3, .val = 3, .flags = RATE_IN_243X },
484 { .div = 0 },
485};
486
487static const struct clksel dsp_irate_ick_clksel[] = {
488 { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
489 { .parent = NULL }
490};
491
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300492/* This clock does not exist as such in the TRM. */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200493static struct clk dsp_irate_ick = {
494 .name = "dsp_irate_ick",
Russell King57137182008-11-04 16:48:35 +0000495 .ops = &clkops_null,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200496 .parent = &dsp_fck,
Paul Walmsley1a337712010-02-22 22:09:16 -0700497 .flags = DELAYED_APP,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200498 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
499 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
500 .clksel = dsp_irate_ick_clksel,
501 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200502};
503
504/* 2420 only */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000505static struct clk dsp_ick = {
506 .name = "dsp_ick", /* apparently ipi and isp */
Russell Kingb36ee722008-11-04 17:59:52 +0000507 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200508 .parent = &dsp_irate_ick,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200509 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
510 .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */
511};
512
513/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
514static struct clk iva2_1_ick = {
515 .name = "iva2_1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000516 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200517 .parent = &dsp_irate_ick,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200518 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
519 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000520};
521
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300522/*
523 * The IVA1 is an ARM7 core on the 2420 that has nothing to do with
524 * the C54x, but which is contained in the DSP powerdomain. Does not
525 * exist on later OMAPs.
526 */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000527static struct clk iva1_ifck = {
528 .name = "iva1_ifck",
Russell Kingb36ee722008-11-04 17:59:52 +0000529 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000530 .parent = &core_ck,
Paul Walmsley1a337712010-02-22 22:09:16 -0700531 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300532 .clkdm_name = "iva1_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200533 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
534 .enable_bit = OMAP2420_EN_IVA_COP_SHIFT,
535 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
536 .clksel_mask = OMAP2420_CLKSEL_IVA_MASK,
537 .clksel = dsp_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000538 .recalc = &omap2_clksel_recalc,
539};
540
541/* IVA1 mpu/int/i/f clocks are /2 of parent */
542static struct clk iva1_mpu_int_ifck = {
543 .name = "iva1_mpu_int_ifck",
Russell Kingb36ee722008-11-04 17:59:52 +0000544 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000545 .parent = &iva1_ifck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300546 .clkdm_name = "iva1_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200547 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
548 .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT,
549 .fixed_div = 2,
Paul Walmsleye9b98f62010-01-26 20:12:57 -0700550 .recalc = &omap_fixed_divisor_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000551};
552
553/*
554 * L3 clock domain
555 * L3 clocks are used for both interface and functional clocks to
556 * multiple entities. Some of these clocks are completely managed
557 * by hardware, and some others allow software control. Hardware
558 * managed ones general are based on directly CLK_REQ signals and
559 * various auto idle settings. The functional spec sets many of these
560 * as 'tie-high' for their enables.
561 *
562 * I-CLOCKS:
563 * L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
564 * CAM, HS-USB.
565 * F-CLOCK
566 * SSI.
567 *
568 * GPMC memories and SDRC have timing and clock sensitive registers which
569 * may very well need notification when the clock changes. Currently for low
570 * operating points, these are taken care of in sleep.S.
571 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200572static const struct clksel_rate core_l3_core_rates[] = {
573 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
574 { .div = 2, .val = 2, .flags = RATE_IN_242X },
575 { .div = 4, .val = 4, .flags = RATE_IN_24XX | DEFAULT_RATE },
576 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
577 { .div = 8, .val = 8, .flags = RATE_IN_242X },
578 { .div = 12, .val = 12, .flags = RATE_IN_242X },
579 { .div = 16, .val = 16, .flags = RATE_IN_242X },
580 { .div = 0 }
581};
582
583static const struct clksel core_l3_clksel[] = {
584 { .parent = &core_ck, .rates = core_l3_core_rates },
585 { .parent = NULL }
586};
587
Tony Lindgren046d6b22005-11-10 14:26:52 +0000588static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */
589 .name = "core_l3_ck",
Russell King897dcde2008-11-04 16:35:03 +0000590 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000591 .parent = &core_ck,
Paul Walmsley1a337712010-02-22 22:09:16 -0700592 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300593 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200594 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
595 .clksel_mask = OMAP24XX_CLKSEL_L3_MASK,
596 .clksel = core_l3_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000597 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200598};
599
600/* usb_l4_ick */
601static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
602 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
603 { .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
604 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
605 { .div = 0 }
606};
607
608static const struct clksel usb_l4_ick_clksel[] = {
609 { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates },
610 { .parent = NULL },
Tony Lindgren046d6b22005-11-10 14:26:52 +0000611};
612
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300613/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000614static struct clk usb_l4_ick = { /* FS-USB interface clock */
615 .name = "usb_l4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000616 .ops = &clkops_omap2_dflt_wait,
Tony Lindgrenfde0fd42006-01-17 15:31:18 -0800617 .parent = &core_l3_ck,
Paul Walmsley1a337712010-02-22 22:09:16 -0700618 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300619 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200620 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
621 .enable_bit = OMAP24XX_EN_USB_SHIFT,
622 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
623 .clksel_mask = OMAP24XX_CLKSEL_USB_MASK,
624 .clksel = usb_l4_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000625 .recalc = &omap2_clksel_recalc,
626};
627
628/*
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300629 * L4 clock management domain
630 *
631 * This domain contains lots of interface clocks from the L4 interface, some
632 * functional clocks. Fixed APLL functional source clocks are managed in
633 * this domain.
634 */
635static const struct clksel_rate l4_core_l3_rates[] = {
636 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
637 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
638 { .div = 0 }
639};
640
641static const struct clksel l4_clksel[] = {
642 { .parent = &core_l3_ck, .rates = l4_core_l3_rates },
643 { .parent = NULL }
644};
645
646static struct clk l4_ck = { /* used both as an ick and fck */
647 .name = "l4_ck",
Russell King897dcde2008-11-04 16:35:03 +0000648 .ops = &clkops_null,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300649 .parent = &core_l3_ck,
Russell King3f0a8202009-01-31 10:05:51 +0000650 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300651 .clkdm_name = "core_l4_clkdm",
652 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
653 .clksel_mask = OMAP24XX_CLKSEL_L4_MASK,
654 .clksel = l4_clksel,
655 .recalc = &omap2_clksel_recalc,
656 .round_rate = &omap2_clksel_round_rate,
657 .set_rate = &omap2_clksel_set_rate
658};
659
660/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000661 * SSI is in L3 management domain, its direct parent is core not l3,
662 * many core power domain entities are grouped into the L3 clock
663 * domain.
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300664 * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK
Tony Lindgren046d6b22005-11-10 14:26:52 +0000665 *
666 * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
667 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200668static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
669 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
670 { .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
671 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
672 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
673 { .div = 5, .val = 5, .flags = RATE_IN_243X },
674 { .div = 6, .val = 6, .flags = RATE_IN_242X },
675 { .div = 8, .val = 8, .flags = RATE_IN_242X },
676 { .div = 0 }
677};
678
679static const struct clksel ssi_ssr_sst_fck_clksel[] = {
680 { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates },
681 { .parent = NULL }
682};
683
Tony Lindgren046d6b22005-11-10 14:26:52 +0000684static struct clk ssi_ssr_sst_fck = {
685 .name = "ssi_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000686 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000687 .parent = &core_ck,
Russell King8ad8ff62009-01-19 15:27:29 +0000688 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300689 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200690 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
691 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
692 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
693 .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK,
694 .clksel = ssi_ssr_sst_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000695 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200696 .round_rate = &omap2_clksel_round_rate,
697 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000698};
699
Paul Walmsley9299fd82009-01-27 19:12:54 -0700700/*
701 * Presumably this is the same as SSI_ICLK.
702 * TRM contradicts itself on what clockdomain SSI_ICLK is in
703 */
704static struct clk ssi_l4_ick = {
705 .name = "ssi_l4_ick",
706 .ops = &clkops_omap2_dflt_wait,
707 .parent = &l4_ck,
708 .clkdm_name = "core_l4_clkdm",
709 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
710 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
711 .recalc = &followparent_recalc,
712};
713
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300714
Tony Lindgren046d6b22005-11-10 14:26:52 +0000715/*
716 * GFX clock domain
717 * Clocks:
718 * GFX_FCLK, GFX_ICLK
719 * GFX_CG1(2d), GFX_CG2(3d)
720 *
721 * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
722 * The 2d and 3d clocks run at a hardware determined
723 * divided value of fclk.
724 *
725 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200726
727/* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */
728static const struct clksel gfx_fck_clksel[] = {
729 { .parent = &core_l3_ck, .rates = gfx_l3_rates },
730 { .parent = NULL },
731};
732
Tony Lindgren046d6b22005-11-10 14:26:52 +0000733static struct clk gfx_3d_fck = {
734 .name = "gfx_3d_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000735 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000736 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300737 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200738 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
739 .enable_bit = OMAP24XX_EN_3D_SHIFT,
740 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
741 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
742 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000743 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200744 .round_rate = &omap2_clksel_round_rate,
745 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000746};
747
748static struct clk gfx_2d_fck = {
749 .name = "gfx_2d_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000750 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000751 .parent = &core_l3_ck,
Paul Walmsley1a337712010-02-22 22:09:16 -0700752 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300753 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200754 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
755 .enable_bit = OMAP24XX_EN_2D_SHIFT,
756 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
757 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
758 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000759 .recalc = &omap2_clksel_recalc,
760};
761
762static struct clk gfx_ick = {
763 .name = "gfx_ick", /* From l3 */
Russell Kingb36ee722008-11-04 17:59:52 +0000764 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000765 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300766 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200767 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
768 .enable_bit = OMAP_EN_GFX_SHIFT,
769 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000770};
771
772/*
773 * Modem clock domain (2430)
774 * CLOCKS:
775 * MDM_OSC_CLK
776 * MDM_ICLK
Paul Walmsleye32744b2008-03-18 15:47:55 +0200777 * These clocks are usable in chassis mode only.
Tony Lindgren046d6b22005-11-10 14:26:52 +0000778 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200779static const struct clksel_rate mdm_ick_core_rates[] = {
780 { .div = 1, .val = 1, .flags = RATE_IN_243X },
781 { .div = 4, .val = 4, .flags = RATE_IN_243X | DEFAULT_RATE },
782 { .div = 6, .val = 6, .flags = RATE_IN_243X },
783 { .div = 9, .val = 9, .flags = RATE_IN_243X },
784 { .div = 0 }
785};
786
787static const struct clksel mdm_ick_clksel[] = {
788 { .parent = &core_ck, .rates = mdm_ick_core_rates },
789 { .parent = NULL }
790};
791
Tony Lindgren046d6b22005-11-10 14:26:52 +0000792static struct clk mdm_ick = { /* used both as a ick and fck */
793 .name = "mdm_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000794 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000795 .parent = &core_ck,
Paul Walmsley1a337712010-02-22 22:09:16 -0700796 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300797 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200798 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
799 .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
800 .clksel_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
801 .clksel_mask = OMAP2430_CLKSEL_MDM_MASK,
802 .clksel = mdm_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000803 .recalc = &omap2_clksel_recalc,
804};
805
806static struct clk mdm_osc_ck = {
807 .name = "mdm_osc_ck",
Russell Kingb36ee722008-11-04 17:59:52 +0000808 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000809 .parent = &osc_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300810 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200811 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
812 .enable_bit = OMAP2430_EN_OSC_SHIFT,
813 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000814};
815
816/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000817 * DSS clock domain
818 * CLOCKs:
819 * DSS_L4_ICLK, DSS_L3_ICLK,
820 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
821 *
822 * DSS is both initiator and target.
823 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200824/* XXX Add RATE_NOT_VALIDATED */
825
826static const struct clksel_rate dss1_fck_sys_rates[] = {
827 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
828 { .div = 0 }
829};
830
831static const struct clksel_rate dss1_fck_core_rates[] = {
832 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
833 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
834 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
835 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
836 { .div = 5, .val = 5, .flags = RATE_IN_24XX },
837 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
838 { .div = 8, .val = 8, .flags = RATE_IN_24XX },
839 { .div = 9, .val = 9, .flags = RATE_IN_24XX },
840 { .div = 12, .val = 12, .flags = RATE_IN_24XX },
841 { .div = 16, .val = 16, .flags = RATE_IN_24XX | DEFAULT_RATE },
842 { .div = 0 }
843};
844
845static const struct clksel dss1_fck_clksel[] = {
846 { .parent = &sys_ck, .rates = dss1_fck_sys_rates },
847 { .parent = &core_ck, .rates = dss1_fck_core_rates },
848 { .parent = NULL },
849};
850
Tony Lindgren046d6b22005-11-10 14:26:52 +0000851static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
852 .name = "dss_ick",
Russell Kingbc51da42008-11-04 18:59:32 +0000853 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000854 .parent = &l4_ck, /* really both l3 and l4 */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300855 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200856 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
857 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
858 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000859};
860
861static struct clk dss1_fck = {
862 .name = "dss1_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000863 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000864 .parent = &core_ck, /* Core or sys */
Russell King8ad8ff62009-01-19 15:27:29 +0000865 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300866 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200867 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
868 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
869 .init = &omap2_init_clksel_parent,
870 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
871 .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK,
872 .clksel = dss1_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000873 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200874 .round_rate = &omap2_clksel_round_rate,
875 .set_rate = &omap2_clksel_set_rate
876};
877
878static const struct clksel_rate dss2_fck_sys_rates[] = {
879 { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE },
880 { .div = 0 }
881};
882
883static const struct clksel_rate dss2_fck_48m_rates[] = {
884 { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE },
885 { .div = 0 }
886};
887
888static const struct clksel dss2_fck_clksel[] = {
889 { .parent = &sys_ck, .rates = dss2_fck_sys_rates },
890 { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
891 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000892};
893
894static struct clk dss2_fck = { /* Alt clk used in power management */
895 .name = "dss2_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000896 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000897 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */
Russell King8ad8ff62009-01-19 15:27:29 +0000898 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300899 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200900 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
901 .enable_bit = OMAP24XX_EN_DSS2_SHIFT,
902 .init = &omap2_init_clksel_parent,
903 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
904 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
905 .clksel = dss2_fck_clksel,
906 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000907};
908
909static struct clk dss_54m_fck = { /* Alt clk used in power management */
910 .name = "dss_54m_fck", /* 54m tv clk */
Russell Kingb36ee722008-11-04 17:59:52 +0000911 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000912 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300913 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200914 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
915 .enable_bit = OMAP24XX_EN_TV_SHIFT,
916 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000917};
918
919/*
920 * CORE power domain ICLK & FCLK defines.
921 * Many of the these can have more than one possible parent. Entries
922 * here will likely have an L4 interface parent, and may have multiple
923 * functional clock parents.
924 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200925static const struct clksel_rate gpt_alt_rates[] = {
926 { .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE },
927 { .div = 0 }
928};
929
930static const struct clksel omap24xx_gpt_clksel[] = {
931 { .parent = &func_32k_ck, .rates = gpt_32k_rates },
932 { .parent = &sys_ck, .rates = gpt_sys_rates },
933 { .parent = &alt_ck, .rates = gpt_alt_rates },
934 { .parent = NULL },
935};
936
Tony Lindgren046d6b22005-11-10 14:26:52 +0000937static struct clk gpt1_ick = {
938 .name = "gpt1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000939 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000940 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300941 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200942 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
943 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
944 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000945};
946
947static struct clk gpt1_fck = {
948 .name = "gpt1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000949 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000950 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300951 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200952 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
953 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
954 .init = &omap2_init_clksel_parent,
955 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
956 .clksel_mask = OMAP24XX_CLKSEL_GPT1_MASK,
957 .clksel = omap24xx_gpt_clksel,
958 .recalc = &omap2_clksel_recalc,
959 .round_rate = &omap2_clksel_round_rate,
960 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000961};
962
963static struct clk gpt2_ick = {
964 .name = "gpt2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000965 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000966 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300967 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200968 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
969 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
970 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000971};
972
973static struct clk gpt2_fck = {
974 .name = "gpt2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000975 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000976 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300977 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200978 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
979 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
980 .init = &omap2_init_clksel_parent,
981 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
982 .clksel_mask = OMAP24XX_CLKSEL_GPT2_MASK,
983 .clksel = omap24xx_gpt_clksel,
984 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000985};
986
987static struct clk gpt3_ick = {
988 .name = "gpt3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000989 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000990 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300991 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200992 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
993 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
994 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000995};
996
997static struct clk gpt3_fck = {
998 .name = "gpt3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000999 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001000 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001001 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001002 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1003 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
1004 .init = &omap2_init_clksel_parent,
1005 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1006 .clksel_mask = OMAP24XX_CLKSEL_GPT3_MASK,
1007 .clksel = omap24xx_gpt_clksel,
1008 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001009};
1010
1011static struct clk gpt4_ick = {
1012 .name = "gpt4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001013 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001014 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001015 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001016 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1017 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
1018 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001019};
1020
1021static struct clk gpt4_fck = {
1022 .name = "gpt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001023 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001024 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001025 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001026 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1027 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
1028 .init = &omap2_init_clksel_parent,
1029 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1030 .clksel_mask = OMAP24XX_CLKSEL_GPT4_MASK,
1031 .clksel = omap24xx_gpt_clksel,
1032 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001033};
1034
1035static struct clk gpt5_ick = {
1036 .name = "gpt5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001037 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001038 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001039 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001040 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1041 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
1042 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001043};
1044
1045static struct clk gpt5_fck = {
1046 .name = "gpt5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001047 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001048 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001049 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001050 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1051 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
1052 .init = &omap2_init_clksel_parent,
1053 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1054 .clksel_mask = OMAP24XX_CLKSEL_GPT5_MASK,
1055 .clksel = omap24xx_gpt_clksel,
1056 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001057};
1058
1059static struct clk gpt6_ick = {
1060 .name = "gpt6_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001061 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001062 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001063 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001064 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1065 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
1066 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001067};
1068
1069static struct clk gpt6_fck = {
1070 .name = "gpt6_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001071 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001072 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001073 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001074 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1075 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
1076 .init = &omap2_init_clksel_parent,
1077 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1078 .clksel_mask = OMAP24XX_CLKSEL_GPT6_MASK,
1079 .clksel = omap24xx_gpt_clksel,
1080 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001081};
1082
1083static struct clk gpt7_ick = {
1084 .name = "gpt7_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001085 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001086 .parent = &l4_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001087 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1088 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
1089 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001090};
1091
1092static struct clk gpt7_fck = {
1093 .name = "gpt7_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001094 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001095 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001096 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001097 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1098 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
1099 .init = &omap2_init_clksel_parent,
1100 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1101 .clksel_mask = OMAP24XX_CLKSEL_GPT7_MASK,
1102 .clksel = omap24xx_gpt_clksel,
1103 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001104};
1105
1106static struct clk gpt8_ick = {
1107 .name = "gpt8_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001108 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001109 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001110 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001111 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1112 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1113 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001114};
1115
1116static struct clk gpt8_fck = {
1117 .name = "gpt8_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001118 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001119 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001120 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001121 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1122 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1123 .init = &omap2_init_clksel_parent,
1124 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1125 .clksel_mask = OMAP24XX_CLKSEL_GPT8_MASK,
1126 .clksel = omap24xx_gpt_clksel,
1127 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001128};
1129
1130static struct clk gpt9_ick = {
1131 .name = "gpt9_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001132 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001133 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001134 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001135 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1136 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1137 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001138};
1139
1140static struct clk gpt9_fck = {
1141 .name = "gpt9_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001142 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001143 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001144 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001145 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1146 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1147 .init = &omap2_init_clksel_parent,
1148 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1149 .clksel_mask = OMAP24XX_CLKSEL_GPT9_MASK,
1150 .clksel = omap24xx_gpt_clksel,
1151 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001152};
1153
1154static struct clk gpt10_ick = {
1155 .name = "gpt10_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001156 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001157 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001158 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001159 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1160 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1161 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001162};
1163
1164static struct clk gpt10_fck = {
1165 .name = "gpt10_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001166 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001167 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001168 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001169 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1170 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1171 .init = &omap2_init_clksel_parent,
1172 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1173 .clksel_mask = OMAP24XX_CLKSEL_GPT10_MASK,
1174 .clksel = omap24xx_gpt_clksel,
1175 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001176};
1177
1178static struct clk gpt11_ick = {
1179 .name = "gpt11_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001180 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001181 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001182 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001183 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1184 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1185 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001186};
1187
1188static struct clk gpt11_fck = {
1189 .name = "gpt11_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001190 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001191 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001192 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001193 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1194 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1195 .init = &omap2_init_clksel_parent,
1196 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1197 .clksel_mask = OMAP24XX_CLKSEL_GPT11_MASK,
1198 .clksel = omap24xx_gpt_clksel,
1199 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001200};
1201
1202static struct clk gpt12_ick = {
1203 .name = "gpt12_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001204 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001205 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001206 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001207 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1208 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1209 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001210};
1211
1212static struct clk gpt12_fck = {
1213 .name = "gpt12_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001214 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyf2480762009-04-23 21:11:10 -06001215 .parent = &secure_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001216 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001217 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1218 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1219 .init = &omap2_init_clksel_parent,
1220 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1221 .clksel_mask = OMAP24XX_CLKSEL_GPT12_MASK,
1222 .clksel = omap24xx_gpt_clksel,
1223 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001224};
1225
1226static struct clk mcbsp1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001227 .name = "mcbsp1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001228 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001229 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001230 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001231 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1232 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1233 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001234};
1235
1236static struct clk mcbsp1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001237 .name = "mcbsp1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001238 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001239 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001240 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001241 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1242 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1243 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001244};
1245
1246static struct clk mcbsp2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001247 .name = "mcbsp2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001248 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001249 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001250 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001251 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1252 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1253 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001254};
1255
1256static struct clk mcbsp2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001257 .name = "mcbsp2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001258 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001259 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001260 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001261 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1262 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1263 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001264};
1265
1266static struct clk mcbsp3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001267 .name = "mcbsp3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001268 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001269 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001270 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001271 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1272 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
1273 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001274};
1275
1276static struct clk mcbsp3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001277 .name = "mcbsp3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001278 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001279 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001280 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001281 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1282 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
1283 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001284};
1285
1286static struct clk mcbsp4_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001287 .name = "mcbsp4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001288 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001289 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001290 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001291 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1292 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1293 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001294};
1295
1296static struct clk mcbsp4_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001297 .name = "mcbsp4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001298 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001299 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001300 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001301 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1302 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1303 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001304};
1305
1306static struct clk mcbsp5_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001307 .name = "mcbsp5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001308 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001309 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001310 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001311 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1312 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1313 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001314};
1315
1316static struct clk mcbsp5_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001317 .name = "mcbsp5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001318 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001319 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001320 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001321 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1322 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1323 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001324};
1325
1326static struct clk mcspi1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001327 .name = "mcspi1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001328 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001329 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001330 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001331 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1332 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1333 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001334};
1335
1336static struct clk mcspi1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001337 .name = "mcspi1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001338 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001339 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001340 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001341 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1342 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1343 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001344};
1345
1346static struct clk mcspi2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001347 .name = "mcspi2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001348 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001349 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001350 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001351 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1352 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1353 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001354};
1355
1356static struct clk mcspi2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001357 .name = "mcspi2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001358 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001359 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001360 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001361 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1362 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1363 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001364};
1365
1366static struct clk mcspi3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001367 .name = "mcspi3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001368 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001369 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001370 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001371 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1372 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1373 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001374};
1375
1376static struct clk mcspi3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001377 .name = "mcspi3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001378 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001379 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001380 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001381 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1382 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1383 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001384};
1385
1386static struct clk uart1_ick = {
1387 .name = "uart1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001388 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001389 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001390 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001391 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1392 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1393 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001394};
1395
1396static struct clk uart1_fck = {
1397 .name = "uart1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001398 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001399 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001400 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001401 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1402 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1403 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001404};
1405
1406static struct clk uart2_ick = {
1407 .name = "uart2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001408 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001409 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001410 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001411 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1412 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1413 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001414};
1415
1416static struct clk uart2_fck = {
1417 .name = "uart2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001418 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001419 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001420 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001421 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1422 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1423 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001424};
1425
1426static struct clk uart3_ick = {
1427 .name = "uart3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001428 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001429 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001430 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001431 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1432 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1433 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001434};
1435
1436static struct clk uart3_fck = {
1437 .name = "uart3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001438 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001439 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001440 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001441 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1442 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1443 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001444};
1445
1446static struct clk gpios_ick = {
1447 .name = "gpios_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001448 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001449 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001450 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001451 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1452 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1453 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001454};
1455
1456static struct clk gpios_fck = {
1457 .name = "gpios_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001458 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001459 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001460 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001461 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1462 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1463 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001464};
1465
1466static struct clk mpu_wdt_ick = {
1467 .name = "mpu_wdt_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001468 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001469 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001470 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001471 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1472 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1473 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001474};
1475
1476static struct clk mpu_wdt_fck = {
1477 .name = "mpu_wdt_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001478 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001479 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001480 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001481 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1482 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1483 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001484};
1485
1486static struct clk sync_32k_ick = {
1487 .name = "sync_32k_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001488 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001489 .parent = &l4_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001490 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001491 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001492 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1493 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
1494 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001495};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001496
Tony Lindgren046d6b22005-11-10 14:26:52 +00001497static struct clk wdt1_ick = {
1498 .name = "wdt1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001499 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001500 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001501 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001502 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1503 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
1504 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001505};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001506
Tony Lindgren046d6b22005-11-10 14:26:52 +00001507static struct clk omapctrl_ick = {
1508 .name = "omapctrl_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001509 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001510 .parent = &l4_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001511 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001512 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001513 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1514 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
1515 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001516};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001517
Tony Lindgren046d6b22005-11-10 14:26:52 +00001518static struct clk icr_ick = {
1519 .name = "icr_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001520 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001521 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001522 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001523 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1524 .enable_bit = OMAP2430_EN_ICR_SHIFT,
1525 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001526};
1527
1528static struct clk cam_ick = {
1529 .name = "cam_ick",
Russell Kingbc51da42008-11-04 18:59:32 +00001530 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001531 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001532 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001533 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1534 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1535 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001536};
1537
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001538/*
1539 * cam_fck controls both CAM_MCLK and CAM_FCLK. It should probably be
1540 * split into two separate clocks, since the parent clocks are different
1541 * and the clockdomains are also different.
1542 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001543static struct clk cam_fck = {
1544 .name = "cam_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00001545 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001546 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001547 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001548 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1549 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1550 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001551};
1552
1553static struct clk mailboxes_ick = {
1554 .name = "mailboxes_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001555 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001556 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001557 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001558 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1559 .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
1560 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001561};
1562
1563static struct clk wdt4_ick = {
1564 .name = "wdt4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001565 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001566 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001567 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001568 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1569 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1570 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001571};
1572
1573static struct clk wdt4_fck = {
1574 .name = "wdt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001575 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001576 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001577 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001578 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1579 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1580 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001581};
1582
1583static struct clk wdt3_ick = {
1584 .name = "wdt3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001585 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001586 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001587 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001588 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1589 .enable_bit = OMAP2420_EN_WDT3_SHIFT,
1590 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001591};
1592
1593static struct clk wdt3_fck = {
1594 .name = "wdt3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001595 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001596 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001597 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001598 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1599 .enable_bit = OMAP2420_EN_WDT3_SHIFT,
1600 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001601};
1602
1603static struct clk mspro_ick = {
1604 .name = "mspro_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001605 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001606 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001607 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001608 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1609 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1610 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001611};
1612
1613static struct clk mspro_fck = {
1614 .name = "mspro_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001615 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001616 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001617 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001618 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1619 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1620 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001621};
1622
1623static struct clk mmc_ick = {
1624 .name = "mmc_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001625 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001626 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001627 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001628 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1629 .enable_bit = OMAP2420_EN_MMC_SHIFT,
1630 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001631};
1632
1633static struct clk mmc_fck = {
1634 .name = "mmc_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001635 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001636 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001637 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001638 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1639 .enable_bit = OMAP2420_EN_MMC_SHIFT,
1640 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001641};
1642
1643static struct clk fac_ick = {
1644 .name = "fac_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001645 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001646 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001647 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001648 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1649 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1650 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001651};
1652
1653static struct clk fac_fck = {
1654 .name = "fac_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001655 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001656 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001657 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001658 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1659 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1660 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001661};
1662
1663static struct clk eac_ick = {
1664 .name = "eac_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001665 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001666 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001667 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001668 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1669 .enable_bit = OMAP2420_EN_EAC_SHIFT,
1670 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001671};
1672
1673static struct clk eac_fck = {
1674 .name = "eac_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001675 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001676 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001677 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001678 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1679 .enable_bit = OMAP2420_EN_EAC_SHIFT,
1680 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001681};
1682
1683static struct clk hdq_ick = {
1684 .name = "hdq_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001685 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001686 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001687 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001688 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1689 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1690 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001691};
1692
1693static struct clk hdq_fck = {
1694 .name = "hdq_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001695 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001696 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001697 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001698 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1699 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1700 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001701};
1702
1703static struct clk i2c2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001704 .name = "i2c2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001705 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001706 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001707 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001708 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1709 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
1710 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001711};
1712
1713static struct clk i2c2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001714 .name = "i2c2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001715 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001716 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001717 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001718 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1719 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
1720 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001721};
1722
1723static struct clk i2chs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001724 .name = "i2chs2_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001725 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001726 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001727 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001728 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1729 .enable_bit = OMAP2430_EN_I2CHS2_SHIFT,
1730 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001731};
1732
1733static struct clk i2c1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001734 .name = "i2c1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001735 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001736 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001737 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001738 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1739 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
1740 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001741};
1742
1743static struct clk i2c1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001744 .name = "i2c1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001745 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001746 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001747 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001748 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1749 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
1750 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001751};
1752
1753static struct clk i2chs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001754 .name = "i2chs1_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001755 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001756 .parent = &func_96m_ck,
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, OMAP24XX_CM_FCLKEN2),
1759 .enable_bit = OMAP2430_EN_I2CHS1_SHIFT,
1760 .recalc = &followparent_recalc,
1761};
1762
1763static struct clk gpmc_fck = {
1764 .name = "gpmc_fck",
Russell King897dcde2008-11-04 16:35:03 +00001765 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001766 .parent = &core_l3_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001767 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001768 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001769 .recalc = &followparent_recalc,
1770};
1771
1772static struct clk sdma_fck = {
1773 .name = "sdma_fck",
Russell King897dcde2008-11-04 16:35:03 +00001774 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001775 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001776 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001777 .recalc = &followparent_recalc,
1778};
1779
1780static struct clk sdma_ick = {
1781 .name = "sdma_ick",
Russell King897dcde2008-11-04 16:35:03 +00001782 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001783 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001784 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001785 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001786};
1787
1788static struct clk vlynq_ick = {
1789 .name = "vlynq_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001790 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001791 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001792 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001793 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1794 .enable_bit = OMAP2420_EN_VLYNQ_SHIFT,
1795 .recalc = &followparent_recalc,
1796};
1797
1798static const struct clksel_rate vlynq_fck_96m_rates[] = {
1799 { .div = 1, .val = 0, .flags = RATE_IN_242X | DEFAULT_RATE },
1800 { .div = 0 }
1801};
1802
1803static const struct clksel_rate vlynq_fck_core_rates[] = {
1804 { .div = 1, .val = 1, .flags = RATE_IN_242X },
1805 { .div = 2, .val = 2, .flags = RATE_IN_242X },
1806 { .div = 3, .val = 3, .flags = RATE_IN_242X },
1807 { .div = 4, .val = 4, .flags = RATE_IN_242X },
1808 { .div = 6, .val = 6, .flags = RATE_IN_242X },
1809 { .div = 8, .val = 8, .flags = RATE_IN_242X },
1810 { .div = 9, .val = 9, .flags = RATE_IN_242X },
1811 { .div = 12, .val = 12, .flags = RATE_IN_242X },
1812 { .div = 16, .val = 16, .flags = RATE_IN_242X | DEFAULT_RATE },
1813 { .div = 18, .val = 18, .flags = RATE_IN_242X },
1814 { .div = 0 }
1815};
1816
1817static const struct clksel vlynq_fck_clksel[] = {
1818 { .parent = &func_96m_ck, .rates = vlynq_fck_96m_rates },
1819 { .parent = &core_ck, .rates = vlynq_fck_core_rates },
1820 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +00001821};
1822
1823static struct clk vlynq_fck = {
1824 .name = "vlynq_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001825 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001826 .parent = &func_96m_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001827 .flags = DELAYED_APP,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001828 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001829 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1830 .enable_bit = OMAP2420_EN_VLYNQ_SHIFT,
1831 .init = &omap2_init_clksel_parent,
1832 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
1833 .clksel_mask = OMAP2420_CLKSEL_VLYNQ_MASK,
1834 .clksel = vlynq_fck_clksel,
1835 .recalc = &omap2_clksel_recalc,
1836 .round_rate = &omap2_clksel_round_rate,
1837 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +00001838};
1839
1840static struct clk sdrc_ick = {
1841 .name = "sdrc_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001842 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001843 .parent = &l4_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001844 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001845 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001846 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1847 .enable_bit = OMAP2430_EN_SDRC_SHIFT,
1848 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001849};
1850
1851static struct clk des_ick = {
1852 .name = "des_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001853 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001854 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001855 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001856 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1857 .enable_bit = OMAP24XX_EN_DES_SHIFT,
1858 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001859};
1860
1861static struct clk sha_ick = {
1862 .name = "sha_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001863 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001864 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001865 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001866 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1867 .enable_bit = OMAP24XX_EN_SHA_SHIFT,
1868 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001869};
1870
1871static struct clk rng_ick = {
1872 .name = "rng_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001873 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001874 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001875 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001876 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1877 .enable_bit = OMAP24XX_EN_RNG_SHIFT,
1878 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001879};
1880
1881static struct clk aes_ick = {
1882 .name = "aes_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001883 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001884 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001885 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001886 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1887 .enable_bit = OMAP24XX_EN_AES_SHIFT,
1888 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001889};
1890
1891static struct clk pka_ick = {
1892 .name = "pka_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001893 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001894 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001895 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001896 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1897 .enable_bit = OMAP24XX_EN_PKA_SHIFT,
1898 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001899};
1900
1901static struct clk usb_fck = {
1902 .name = "usb_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001903 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001904 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001905 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001906 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1907 .enable_bit = OMAP24XX_EN_USB_SHIFT,
1908 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001909};
1910
1911static struct clk usbhs_ick = {
1912 .name = "usbhs_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001913 .ops = &clkops_omap2_dflt_wait,
Tony Lindgrenfde0fd42006-01-17 15:31:18 -08001914 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001915 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001916 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1917 .enable_bit = OMAP2430_EN_USBHS_SHIFT,
1918 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001919};
1920
1921static struct clk mmchs1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001922 .name = "mmchs1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001923 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001924 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001925 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001926 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1927 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1928 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001929};
1930
1931static struct clk mmchs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001932 .name = "mmchs1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001933 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001934 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001935 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001936 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1937 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1938 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001939};
1940
1941static struct clk mmchs2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001942 .name = "mmchs2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001943 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001944 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001945 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001946 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1947 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1948 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001949};
1950
1951static struct clk mmchs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001952 .name = "mmchs2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001953 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001954 .parent = &func_96m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001955 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1956 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1957 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001958};
1959
1960static struct clk gpio5_ick = {
1961 .name = "gpio5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001962 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001963 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001964 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001965 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1966 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1967 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001968};
1969
1970static struct clk gpio5_fck = {
1971 .name = "gpio5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001972 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001973 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001974 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001975 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1976 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1977 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001978};
1979
1980static struct clk mdm_intc_ick = {
1981 .name = "mdm_intc_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001982 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001983 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001984 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001985 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1986 .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT,
1987 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001988};
1989
1990static struct clk mmchsdb1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001991 .name = "mmchsdb1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001992 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001993 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001994 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001995 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1996 .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT,
1997 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001998};
1999
2000static struct clk mmchsdb2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07002001 .name = "mmchsdb2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00002002 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002003 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03002004 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02002005 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2006 .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT,
2007 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002008};
Paul Walmsleye32744b2008-03-18 15:47:55 +02002009
Tony Lindgren046d6b22005-11-10 14:26:52 +00002010/*
2011 * This clock is a composite clock which does entire set changes then
2012 * forces a rebalance. It keys on the MPU speed, but it really could
2013 * be any key speed part of a set in the rate table.
2014 *
2015 * to really change a set, you need memory table sets which get changed
2016 * in sram, pre-notifiers & post notifiers, changing the top set, without
2017 * having low level display recalc's won't work... this is why dpm notifiers
2018 * work, isr's off, walk a list of clocks already _off_ and not messing with
2019 * the bus.
2020 *
2021 * This clock should have no parent. It embodies the entire upper level
2022 * active set. A parent will mess up some of the init also.
2023 */
2024static struct clk virt_prcm_set = {
2025 .name = "virt_prcm_set",
Russell King897dcde2008-11-04 16:35:03 +00002026 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +00002027 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
Paul Walmsleye32744b2008-03-18 15:47:55 +02002028 .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */
Tony Lindgren046d6b22005-11-10 14:26:52 +00002029 .set_rate = &omap2_select_table_rate,
2030 .round_rate = &omap2_round_to_table_rate,
2031};
Paul Walmsleye32744b2008-03-18 15:47:55 +02002032
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002033
2034/*
2035 * clkdev integration
2036 */
2037
2038static struct omap_clk omap24xx_clks[] = {
2039 /* external root sources */
2040 CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X | CK_242X),
2041 CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X | CK_242X),
2042 CLK(NULL, "osc_ck", &osc_ck, CK_243X | CK_242X),
2043 CLK(NULL, "sys_ck", &sys_ck, CK_243X | CK_242X),
2044 CLK(NULL, "alt_ck", &alt_ck, CK_243X | CK_242X),
2045 /* internal analog sources */
2046 CLK(NULL, "dpll_ck", &dpll_ck, CK_243X | CK_242X),
2047 CLK(NULL, "apll96_ck", &apll96_ck, CK_243X | CK_242X),
2048 CLK(NULL, "apll54_ck", &apll54_ck, CK_243X | CK_242X),
2049 /* internal prcm root sources */
2050 CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X | CK_242X),
2051 CLK(NULL, "core_ck", &core_ck, CK_243X | CK_242X),
2052 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X | CK_242X),
2053 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X | CK_242X),
2054 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X | CK_242X),
2055 CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X | CK_242X),
2056 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X | CK_242X),
2057 CLK(NULL, "sys_clkout", &sys_clkout, CK_243X | CK_242X),
2058 CLK(NULL, "sys_clkout2_src", &sys_clkout2_src, CK_242X),
2059 CLK(NULL, "sys_clkout2", &sys_clkout2, CK_242X),
2060 CLK(NULL, "emul_ck", &emul_ck, CK_242X),
2061 /* mpu domain clocks */
2062 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X | CK_242X),
2063 /* dsp domain clocks */
2064 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X | CK_242X),
2065 CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X | CK_242X),
2066 CLK(NULL, "dsp_ick", &dsp_ick, CK_242X),
2067 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X),
2068 CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X),
2069 CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X),
2070 /* GFX domain clocks */
2071 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X | CK_242X),
2072 CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X | CK_242X),
2073 CLK(NULL, "gfx_ick", &gfx_ick, CK_243X | CK_242X),
2074 /* Modem domain clocks */
2075 CLK(NULL, "mdm_ick", &mdm_ick, CK_243X),
2076 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
2077 /* DSS domain clocks */
2078 CLK("omapdss", "ick", &dss_ick, CK_243X | CK_242X),
2079 CLK("omapdss", "dss1_fck", &dss1_fck, CK_243X | CK_242X),
2080 CLK("omapdss", "dss2_fck", &dss2_fck, CK_243X | CK_242X),
2081 CLK("omapdss", "tv_fck", &dss_54m_fck, CK_243X | CK_242X),
2082 /* L3 domain clocks */
2083 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X | CK_242X),
2084 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X | CK_242X),
2085 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X | CK_242X),
2086 /* L4 domain clocks */
2087 CLK(NULL, "l4_ck", &l4_ck, CK_243X | CK_242X),
2088 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X | CK_242X),
2089 /* virtual meta-group clock */
2090 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X | CK_242X),
2091 /* general l4 interface ck, multi-parent functional clk */
2092 CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X | CK_242X),
2093 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X | CK_242X),
2094 CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X | CK_242X),
2095 CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X | CK_242X),
2096 CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X | CK_242X),
2097 CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X | CK_242X),
2098 CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X | CK_242X),
2099 CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X | CK_242X),
2100 CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X | CK_242X),
2101 CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X | CK_242X),
2102 CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X | CK_242X),
2103 CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X | CK_242X),
2104 CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X | CK_242X),
2105 CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X | CK_242X),
2106 CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X | CK_242X),
2107 CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X | CK_242X),
2108 CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X | CK_242X),
2109 CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X | CK_242X),
2110 CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X | CK_242X),
2111 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X | CK_242X),
2112 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X | CK_242X),
2113 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X | CK_242X),
2114 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X | CK_242X),
2115 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X | CK_242X),
2116 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X | CK_242X),
2117 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X | CK_242X),
2118 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X | CK_242X),
2119 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X | CK_242X),
2120 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
2121 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X),
2122 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
2123 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X),
2124 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
2125 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X),
2126 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X | CK_242X),
2127 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X | CK_242X),
2128 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X | CK_242X),
2129 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X | CK_242X),
2130 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
2131 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X),
2132 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X | CK_242X),
2133 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X | CK_242X),
2134 CLK(NULL, "uart2_ick", &uart2_ick, CK_243X | CK_242X),
2135 CLK(NULL, "uart2_fck", &uart2_fck, CK_243X | CK_242X),
2136 CLK(NULL, "uart3_ick", &uart3_ick, CK_243X | CK_242X),
2137 CLK(NULL, "uart3_fck", &uart3_fck, CK_243X | CK_242X),
2138 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X | CK_242X),
2139 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X | CK_242X),
2140 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X | CK_242X),
2141 CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X | CK_242X),
2142 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X | CK_242X),
2143 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X | CK_242X),
2144 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X | CK_242X),
2145 CLK(NULL, "icr_ick", &icr_ick, CK_243X),
2146 CLK("omap24xxcam", "fck", &cam_fck, CK_243X | CK_242X),
2147 CLK("omap24xxcam", "ick", &cam_ick, CK_243X | CK_242X),
2148 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X | CK_242X),
2149 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X | CK_242X),
2150 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X | CK_242X),
2151 CLK(NULL, "wdt3_ick", &wdt3_ick, CK_242X),
2152 CLK(NULL, "wdt3_fck", &wdt3_fck, CK_242X),
2153 CLK(NULL, "mspro_ick", &mspro_ick, CK_243X | CK_242X),
2154 CLK(NULL, "mspro_fck", &mspro_fck, CK_243X | CK_242X),
2155 CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X),
2156 CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X),
2157 CLK(NULL, "fac_ick", &fac_ick, CK_243X | CK_242X),
2158 CLK(NULL, "fac_fck", &fac_fck, CK_243X | CK_242X),
2159 CLK(NULL, "eac_ick", &eac_ick, CK_242X),
2160 CLK(NULL, "eac_fck", &eac_fck, CK_242X),
2161 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X | CK_242X),
2162 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X | CK_242X),
2163 CLK("i2c_omap.1", "ick", &i2c1_ick, CK_243X | CK_242X),
2164 CLK("i2c_omap.1", "fck", &i2c1_fck, CK_242X),
2165 CLK("i2c_omap.1", "fck", &i2chs1_fck, CK_243X),
2166 CLK("i2c_omap.2", "ick", &i2c2_ick, CK_243X | CK_242X),
2167 CLK("i2c_omap.2", "fck", &i2c2_fck, CK_242X),
2168 CLK("i2c_omap.2", "fck", &i2chs2_fck, CK_243X),
2169 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X | CK_242X),
2170 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X | CK_242X),
2171 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X | CK_242X),
2172 CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X),
2173 CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X),
2174 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X),
2175 CLK(NULL, "des_ick", &des_ick, CK_243X | CK_242X),
2176 CLK(NULL, "sha_ick", &sha_ick, CK_243X | CK_242X),
2177 CLK("omap_rng", "ick", &rng_ick, CK_243X | CK_242X),
2178 CLK(NULL, "aes_ick", &aes_ick, CK_243X | CK_242X),
2179 CLK(NULL, "pka_ick", &pka_ick, CK_243X | CK_242X),
2180 CLK(NULL, "usb_fck", &usb_fck, CK_243X | CK_242X),
2181 CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X),
2182 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X),
2183 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X),
2184 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X),
2185 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X),
2186 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
2187 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
2188 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
2189 CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
2190 CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
2191};
2192
2193/*
2194 * init code
2195 */
2196
Paul Walmsleye80a9722010-01-26 20:13:12 -07002197int __init omap2xxx_clk_init(void)
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002198{
2199 const struct prcm_config *prcm;
2200 struct omap_clk *c;
2201 u32 clkrate;
2202 u16 cpu_clkflg;
2203
2204 if (cpu_is_omap242x()) {
2205 prcm_clksrc_ctrl = OMAP2420_PRCM_CLKSRC_CTRL;
2206 cpu_mask = RATE_IN_242X;
2207 cpu_clkflg = CK_242X;
2208 rate_table = omap2420_rate_table;
2209 } else if (cpu_is_omap2430()) {
2210 prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
2211 cpu_mask = RATE_IN_243X;
2212 cpu_clkflg = CK_243X;
2213 rate_table = omap2430_rate_table;
2214 }
2215
2216 clk_init(&omap2_clk_functions);
2217
2218 for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
2219 clk_preinit(c->lk.clk);
2220
2221 osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
2222 propagate_rate(&osc_ck);
Paul Walmsley44da0a52010-01-26 20:13:08 -07002223 sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck);
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002224 propagate_rate(&sys_ck);
2225
2226 for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
2227 if (c->cpu & cpu_clkflg) {
2228 clkdev_add(&c->lk);
2229 clk_register(c->lk.clk);
2230 omap2_init_clk_clkdm(c->lk.clk);
2231 }
2232
2233 /* Check the MPU rate set by bootloader */
2234 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
2235 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
2236 if (!(prcm->flags & cpu_mask))
2237 continue;
2238 if (prcm->xtal_speed != sys_ck.rate)
2239 continue;
2240 if (prcm->dpll_speed <= clkrate)
2241 break;
2242 }
2243 curr_prcm_set = prcm;
2244
2245 recalculate_root_clocks();
2246
2247 printk(KERN_INFO "Clocking rate (Crystal/DPLL/MPU): "
2248 "%ld.%01ld/%ld/%ld MHz\n",
2249 (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
2250 (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;
2251
2252 /*
2253 * Only enable those clocks we will need, let the drivers
2254 * enable other clocks as necessary
2255 */
2256 clk_enable_init_clocks();
2257
2258 /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
2259 vclk = clk_get(NULL, "virt_prcm_set");
2260 sclk = clk_get(NULL, "sys_ck");
2261 dclk = clk_get(NULL, "dpll_ck");
2262
2263 return 0;
2264}
Paul Walmsley6b8858a2008-03-18 10:35:15 +02002265