blob: b33118fb6a87fd69a6f4484f6f0f697d006a32ac [file] [log] [blame]
Tony Lindgren046d6b22005-11-10 14:26:52 +00001/*
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002 * linux/arch/arm/mach-omap2/clock2430_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
Paul Walmsley81b34fb2010-02-22 22:09:22 -070031#define OMAP_CM_REGADDR OMAP2430_CM_REGADDR
32
33/*
34 * 2430 clock tree.
Tony Lindgren046d6b22005-11-10 14:26:52 +000035 *
36 * NOTE:In many cases here we are assigning a 'default' parent. In many
37 * cases the parent is selectable. The get/set parent calls will also
38 * switch sources.
39 *
40 * Many some clocks say always_enabled, but they can be auto idled for
41 * power savings. They will always be available upon clock request.
42 *
43 * Several sources are given initial rates which may be wrong, this will
44 * be fixed up in the init func.
45 *
46 * Things are broadly separated below by clock domains. It is
47 * noteworthy that most periferals have dependencies on multiple clock
48 * domains. Many get their interface clocks from the L4 domain, but get
49 * functional clocks from fixed sources or other core domain derived
50 * clocks.
Paul Walmsley81b34fb2010-02-22 22:09:22 -070051 */
Tony Lindgren046d6b22005-11-10 14:26:52 +000052
53/* Base external input clocks */
54static struct clk func_32k_ck = {
55 .name = "func_32k_ck",
Russell King897dcde2008-11-04 16:35:03 +000056 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +000057 .rate = 32000,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030058 .clkdm_name = "wkup_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +000059};
Paul Walmsleye32744b2008-03-18 15:47:55 +020060
Paul Walmsleyf2480762009-04-23 21:11:10 -060061static struct clk secure_32k_ck = {
62 .name = "secure_32k_ck",
63 .ops = &clkops_null,
64 .rate = 32768,
Paul Walmsleyf2480762009-04-23 21:11:10 -060065 .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,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030089 .clkdm_name = "wkup_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +000090};
Paul Walmsleye32744b2008-03-18 15:47:55 +020091
Tony Lindgren046d6b22005-11-10 14:26:52 +000092/*
93 * Analog domain root source clocks
94 */
95
96/* dpll_ck, is broken out in to special cases through clksel */
Paul Walmsley6b8858a2008-03-18 10:35:15 +020097/* REVISIT: Rate changes on dpll_ck trigger a full set change. ...
98 * deal with this
99 */
100
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300101static struct dpll_data dpll_dd = {
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200102 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
103 .mult_mask = OMAP24XX_DPLL_MULT_MASK,
104 .div1_mask = OMAP24XX_DPLL_DIV_MASK,
Russell Kingc0bf3132009-02-19 13:29:22 +0000105 .clk_bypass = &sys_ck,
106 .clk_ref = &sys_ck,
107 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
108 .enable_mask = OMAP24XX_EN_DPLL_MASK,
Paul Walmsley93340a22010-02-22 22:09:12 -0700109 .max_multiplier = 1023,
Paul Walmsley95f538a2009-01-28 12:08:44 -0700110 .min_divider = 1,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300111 .max_divider = 16,
112 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200113};
114
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300115/*
116 * XXX Cannot add round_rate here yet, as this is still a composite clock,
117 * not just a DPLL
118 */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000119static struct clk dpll_ck = {
120 .name = "dpll_ck",
Russell King897dcde2008-11-04 16:35:03 +0000121 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000122 .parent = &sys_ck, /* Can be func_32k also */
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200123 .dpll_data = &dpll_dd,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300124 .clkdm_name = "wkup_clkdm",
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300125 .recalc = &omap2_dpllcore_recalc,
126 .set_rate = &omap2_reprogram_dpllcore,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000127};
128
129static struct clk apll96_ck = {
130 .name = "apll96_ck",
Paul Walmsley06b16932009-12-08 16:18:46 -0700131 .ops = &clkops_apll96,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000132 .parent = &sys_ck,
133 .rate = 96000000,
Paul Walmsley51c19542010-02-22 22:09:26 -0700134 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300135 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200136 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
137 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000138};
139
140static struct clk apll54_ck = {
141 .name = "apll54_ck",
Paul Walmsley06b16932009-12-08 16:18:46 -0700142 .ops = &clkops_apll54,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000143 .parent = &sys_ck,
144 .rate = 54000000,
Paul Walmsley51c19542010-02-22 22:09:26 -0700145 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300146 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200147 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
148 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000149};
150
151/*
152 * PRCM digital base sources
153 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200154
155/* func_54m_ck */
156
157static const struct clksel_rate func_54m_apll54_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600158 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200159 { .div = 0 },
160};
161
162static const struct clksel_rate func_54m_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600163 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200164 { .div = 0 },
165};
166
167static const struct clksel func_54m_clksel[] = {
168 { .parent = &apll54_ck, .rates = func_54m_apll54_rates, },
169 { .parent = &alt_ck, .rates = func_54m_alt_rates, },
170 { .parent = NULL },
171};
172
Tony Lindgren046d6b22005-11-10 14:26:52 +0000173static struct clk func_54m_ck = {
174 .name = "func_54m_ck",
Russell King57137182008-11-04 16:48:35 +0000175 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000176 .parent = &apll54_ck, /* can also be alt_clk */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300177 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200178 .init = &omap2_init_clksel_parent,
179 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsleyf38ca102010-05-20 12:31:04 -0600180 .clksel_mask = OMAP24XX_54M_SOURCE_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200181 .clksel = func_54m_clksel,
182 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000183};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200184
Tony Lindgren046d6b22005-11-10 14:26:52 +0000185static struct clk core_ck = {
186 .name = "core_ck",
Russell King897dcde2008-11-04 16:35:03 +0000187 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000188 .parent = &dpll_ck, /* can also be 32k */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300189 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200190 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000191};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200192
193/* func_96m_ck */
194static const struct clksel_rate func_96m_apll96_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600195 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200196 { .div = 0 },
Tony Lindgren046d6b22005-11-10 14:26:52 +0000197};
198
Paul Walmsleye32744b2008-03-18 15:47:55 +0200199static const struct clksel_rate func_96m_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600200 { .div = 1, .val = 1, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200201 { .div = 0 },
202};
203
204static const struct clksel func_96m_clksel[] = {
205 { .parent = &apll96_ck, .rates = func_96m_apll96_rates },
206 { .parent = &alt_ck, .rates = func_96m_alt_rates },
207 { .parent = NULL }
208};
209
Tony Lindgren046d6b22005-11-10 14:26:52 +0000210static struct clk func_96m_ck = {
211 .name = "func_96m_ck",
Russell King57137182008-11-04 16:48:35 +0000212 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000213 .parent = &apll96_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300214 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200215 .init = &omap2_init_clksel_parent,
216 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsleyf38ca102010-05-20 12:31:04 -0600217 .clksel_mask = OMAP2430_96M_SOURCE_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200218 .clksel = func_96m_clksel,
219 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200220};
221
222/* func_48m_ck */
223
224static const struct clksel_rate func_48m_apll96_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600225 { .div = 2, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200226 { .div = 0 },
227};
228
229static const struct clksel_rate func_48m_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600230 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200231 { .div = 0 },
232};
233
234static const struct clksel func_48m_clksel[] = {
235 { .parent = &apll96_ck, .rates = func_48m_apll96_rates },
236 { .parent = &alt_ck, .rates = func_48m_alt_rates },
237 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000238};
239
240static struct clk func_48m_ck = {
241 .name = "func_48m_ck",
Russell King57137182008-11-04 16:48:35 +0000242 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000243 .parent = &apll96_ck, /* 96M or Alt */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300244 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200245 .init = &omap2_init_clksel_parent,
246 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsleyf38ca102010-05-20 12:31:04 -0600247 .clksel_mask = OMAP24XX_48M_SOURCE_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200248 .clksel = func_48m_clksel,
249 .recalc = &omap2_clksel_recalc,
250 .round_rate = &omap2_clksel_round_rate,
251 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000252};
253
254static struct clk func_12m_ck = {
255 .name = "func_12m_ck",
Russell King57137182008-11-04 16:48:35 +0000256 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000257 .parent = &func_48m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200258 .fixed_div = 4,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300259 .clkdm_name = "wkup_clkdm",
Paul Walmsleye9b98f62010-01-26 20:12:57 -0700260 .recalc = &omap_fixed_divisor_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000261};
262
263/* Secure timer, only available in secure mode */
264static struct clk wdt1_osc_ck = {
265 .name = "ck_wdt1_osc",
Russell King897dcde2008-11-04 16:35:03 +0000266 .ops = &clkops_null, /* RMK: missing? */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000267 .parent = &osc_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200268 .recalc = &followparent_recalc,
269};
270
271/*
272 * The common_clkout* clksel_rate structs are common to
273 * sys_clkout, sys_clkout_src, sys_clkout2, and sys_clkout2_src.
274 * sys_clkout2_* are 2420-only, so the
275 * clksel_rate flags fields are inaccurate for those clocks. This is
276 * harmless since access to those clocks are gated by the struct clk
277 * flags fields, which mark them as 2420-only.
278 */
279static const struct clksel_rate common_clkout_src_core_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600280 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200281 { .div = 0 }
282};
283
284static const struct clksel_rate common_clkout_src_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600285 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200286 { .div = 0 }
287};
288
289static const struct clksel_rate common_clkout_src_96m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600290 { .div = 1, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200291 { .div = 0 }
292};
293
294static const struct clksel_rate common_clkout_src_54m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600295 { .div = 1, .val = 3, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200296 { .div = 0 }
297};
298
299static const struct clksel common_clkout_src_clksel[] = {
300 { .parent = &core_ck, .rates = common_clkout_src_core_rates },
301 { .parent = &sys_ck, .rates = common_clkout_src_sys_rates },
302 { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates },
303 { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates },
304 { .parent = NULL }
305};
306
307static struct clk sys_clkout_src = {
308 .name = "sys_clkout_src",
Russell Kingc1168dc2008-11-04 21:24:00 +0000309 .ops = &clkops_omap2_dflt,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200310 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300311 .clkdm_name = "wkup_clkdm",
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700312 .enable_reg = OMAP2430_PRCM_CLKOUT_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200313 .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT,
314 .init = &omap2_init_clksel_parent,
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700315 .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200316 .clksel_mask = OMAP24XX_CLKOUT_SOURCE_MASK,
317 .clksel = common_clkout_src_clksel,
318 .recalc = &omap2_clksel_recalc,
319 .round_rate = &omap2_clksel_round_rate,
320 .set_rate = &omap2_clksel_set_rate
321};
322
323static const struct clksel_rate common_clkout_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600324 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200325 { .div = 2, .val = 1, .flags = RATE_IN_24XX },
326 { .div = 4, .val = 2, .flags = RATE_IN_24XX },
327 { .div = 8, .val = 3, .flags = RATE_IN_24XX },
328 { .div = 16, .val = 4, .flags = RATE_IN_24XX },
329 { .div = 0 },
330};
331
332static const struct clksel sys_clkout_clksel[] = {
333 { .parent = &sys_clkout_src, .rates = common_clkout_rates },
334 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000335};
336
337static struct clk sys_clkout = {
338 .name = "sys_clkout",
Russell King57137182008-11-04 16:48:35 +0000339 .ops = &clkops_null,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200340 .parent = &sys_clkout_src,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300341 .clkdm_name = "wkup_clkdm",
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700342 .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200343 .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK,
344 .clksel = sys_clkout_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000345 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200346 .round_rate = &omap2_clksel_round_rate,
347 .set_rate = &omap2_clksel_set_rate
348};
349
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100350static struct clk emul_ck = {
351 .name = "emul_ck",
Russell Kingc1168dc2008-11-04 21:24:00 +0000352 .ops = &clkops_omap2_dflt,
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100353 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300354 .clkdm_name = "wkup_clkdm",
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700355 .enable_reg = OMAP2430_PRCM_CLKEMUL_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200356 .enable_bit = OMAP24XX_EMULATION_EN_SHIFT,
357 .recalc = &followparent_recalc,
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100358
359};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200360
Tony Lindgren046d6b22005-11-10 14:26:52 +0000361/*
362 * MPU clock domain
363 * Clocks:
364 * MPU_FCLK, MPU_ICLK
365 * INT_M_FCLK, INT_M_I_CLK
366 *
367 * - Individual clocks are hardware managed.
368 * - Base divider comes from: CM_CLKSEL_MPU
369 *
370 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200371static const struct clksel_rate mpu_core_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600372 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200373 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200374 { .div = 0 },
375};
376
377static const struct clksel mpu_clksel[] = {
378 { .parent = &core_ck, .rates = mpu_core_rates },
379 { .parent = NULL }
380};
381
Tony Lindgren046d6b22005-11-10 14:26:52 +0000382static struct clk mpu_ck = { /* Control cpu */
383 .name = "mpu_ck",
Russell King897dcde2008-11-04 16:35:03 +0000384 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000385 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300386 .clkdm_name = "mpu_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200387 .init = &omap2_init_clksel_parent,
388 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
389 .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200390 .clksel = mpu_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000391 .recalc = &omap2_clksel_recalc,
392};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200393
Tony Lindgren046d6b22005-11-10 14:26:52 +0000394/*
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700395 * DSP (2430-IVA2.1) clock domain
Tony Lindgren046d6b22005-11-10 14:26:52 +0000396 * Clocks:
Paul Walmsleye32744b2008-03-18 15:47:55 +0200397 * 2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
Paul Walmsleye32744b2008-03-18 15:47:55 +0200398 *
Tony Lindgren046d6b22005-11-10 14:26:52 +0000399 * Won't be too specific here. The core clock comes into this block
400 * it is divided then tee'ed. One branch goes directly to xyz enable
401 * controls. The other branch gets further divided by 2 then possibly
402 * routed into a synchronizer and out of clocks abc.
403 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200404static const struct clksel_rate dsp_fck_core_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600405 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200406 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
407 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
408 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200409 { .div = 0 },
410};
411
412static const struct clksel dsp_fck_clksel[] = {
413 { .parent = &core_ck, .rates = dsp_fck_core_rates },
414 { .parent = NULL }
415};
416
Tony Lindgren046d6b22005-11-10 14:26:52 +0000417static struct clk dsp_fck = {
418 .name = "dsp_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000419 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000420 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300421 .clkdm_name = "dsp_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200422 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
423 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
424 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
425 .clksel_mask = OMAP24XX_CLKSEL_DSP_MASK,
426 .clksel = dsp_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000427 .recalc = &omap2_clksel_recalc,
428};
429
Paul Walmsleye32744b2008-03-18 15:47:55 +0200430/* DSP interface clock */
431static const struct clksel_rate dsp_irate_ick_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600432 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200433 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
434 { .div = 3, .val = 3, .flags = RATE_IN_243X },
435 { .div = 0 },
436};
437
438static const struct clksel dsp_irate_ick_clksel[] = {
439 { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
440 { .parent = NULL }
441};
442
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300443/* This clock does not exist as such in the TRM. */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200444static struct clk dsp_irate_ick = {
445 .name = "dsp_irate_ick",
Russell King57137182008-11-04 16:48:35 +0000446 .ops = &clkops_null,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200447 .parent = &dsp_fck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200448 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
449 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
450 .clksel = dsp_irate_ick_clksel,
451 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200452};
453
Paul Walmsleye32744b2008-03-18 15:47:55 +0200454/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
455static struct clk iva2_1_ick = {
456 .name = "iva2_1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000457 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200458 .parent = &dsp_irate_ick,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200459 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
460 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000461};
462
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300463/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000464 * L3 clock domain
465 * L3 clocks are used for both interface and functional clocks to
466 * multiple entities. Some of these clocks are completely managed
467 * by hardware, and some others allow software control. Hardware
468 * managed ones general are based on directly CLK_REQ signals and
469 * various auto idle settings. The functional spec sets many of these
470 * as 'tie-high' for their enables.
471 *
472 * I-CLOCKS:
473 * L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
474 * CAM, HS-USB.
475 * F-CLOCK
476 * SSI.
477 *
478 * GPMC memories and SDRC have timing and clock sensitive registers which
479 * may very well need notification when the clock changes. Currently for low
480 * operating points, these are taken care of in sleep.S.
481 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200482static const struct clksel_rate core_l3_core_rates[] = {
483 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600484 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200485 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200486 { .div = 0 }
487};
488
489static const struct clksel core_l3_clksel[] = {
490 { .parent = &core_ck, .rates = core_l3_core_rates },
491 { .parent = NULL }
492};
493
Tony Lindgren046d6b22005-11-10 14:26:52 +0000494static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */
495 .name = "core_l3_ck",
Russell King897dcde2008-11-04 16:35:03 +0000496 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000497 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300498 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200499 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
500 .clksel_mask = OMAP24XX_CLKSEL_L3_MASK,
501 .clksel = core_l3_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000502 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200503};
504
505/* usb_l4_ick */
506static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
507 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600508 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200509 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
510 { .div = 0 }
511};
512
513static const struct clksel usb_l4_ick_clksel[] = {
514 { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates },
515 { .parent = NULL },
Tony Lindgren046d6b22005-11-10 14:26:52 +0000516};
517
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300518/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000519static struct clk usb_l4_ick = { /* FS-USB interface clock */
520 .name = "usb_l4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000521 .ops = &clkops_omap2_dflt_wait,
Tony Lindgrenfde0fd42006-01-17 15:31:18 -0800522 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300523 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200524 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
525 .enable_bit = OMAP24XX_EN_USB_SHIFT,
526 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
527 .clksel_mask = OMAP24XX_CLKSEL_USB_MASK,
528 .clksel = usb_l4_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000529 .recalc = &omap2_clksel_recalc,
530};
531
532/*
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300533 * L4 clock management domain
534 *
535 * This domain contains lots of interface clocks from the L4 interface, some
536 * functional clocks. Fixed APLL functional source clocks are managed in
537 * this domain.
538 */
539static const struct clksel_rate l4_core_l3_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600540 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300541 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
542 { .div = 0 }
543};
544
545static const struct clksel l4_clksel[] = {
546 { .parent = &core_l3_ck, .rates = l4_core_l3_rates },
547 { .parent = NULL }
548};
549
550static struct clk l4_ck = { /* used both as an ick and fck */
551 .name = "l4_ck",
Russell King897dcde2008-11-04 16:35:03 +0000552 .ops = &clkops_null,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300553 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300554 .clkdm_name = "core_l4_clkdm",
555 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
556 .clksel_mask = OMAP24XX_CLKSEL_L4_MASK,
557 .clksel = l4_clksel,
558 .recalc = &omap2_clksel_recalc,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300559};
560
561/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000562 * SSI is in L3 management domain, its direct parent is core not l3,
563 * many core power domain entities are grouped into the L3 clock
564 * domain.
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300565 * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK
Tony Lindgren046d6b22005-11-10 14:26:52 +0000566 *
567 * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
568 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200569static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
570 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600571 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200572 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
573 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
574 { .div = 5, .val = 5, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200575 { .div = 0 }
576};
577
578static const struct clksel ssi_ssr_sst_fck_clksel[] = {
579 { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates },
580 { .parent = NULL }
581};
582
Tony Lindgren046d6b22005-11-10 14:26:52 +0000583static struct clk ssi_ssr_sst_fck = {
584 .name = "ssi_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000585 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000586 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300587 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200588 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
589 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
590 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
591 .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK,
592 .clksel = ssi_ssr_sst_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000593 .recalc = &omap2_clksel_recalc,
594};
595
Paul Walmsley9299fd82009-01-27 19:12:54 -0700596/*
597 * Presumably this is the same as SSI_ICLK.
598 * TRM contradicts itself on what clockdomain SSI_ICLK is in
599 */
600static struct clk ssi_l4_ick = {
601 .name = "ssi_l4_ick",
602 .ops = &clkops_omap2_dflt_wait,
603 .parent = &l4_ck,
604 .clkdm_name = "core_l4_clkdm",
605 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
606 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
607 .recalc = &followparent_recalc,
608};
609
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300610
Tony Lindgren046d6b22005-11-10 14:26:52 +0000611/*
612 * GFX clock domain
613 * Clocks:
614 * GFX_FCLK, GFX_ICLK
615 * GFX_CG1(2d), GFX_CG2(3d)
616 *
617 * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
618 * The 2d and 3d clocks run at a hardware determined
619 * divided value of fclk.
620 *
621 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200622
623/* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */
624static const struct clksel gfx_fck_clksel[] = {
625 { .parent = &core_l3_ck, .rates = gfx_l3_rates },
626 { .parent = NULL },
627};
628
Tony Lindgren046d6b22005-11-10 14:26:52 +0000629static struct clk gfx_3d_fck = {
630 .name = "gfx_3d_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000631 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000632 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300633 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200634 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
635 .enable_bit = OMAP24XX_EN_3D_SHIFT,
636 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
637 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
638 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000639 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200640 .round_rate = &omap2_clksel_round_rate,
641 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000642};
643
644static struct clk gfx_2d_fck = {
645 .name = "gfx_2d_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000646 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000647 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300648 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200649 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
650 .enable_bit = OMAP24XX_EN_2D_SHIFT,
651 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
652 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
653 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000654 .recalc = &omap2_clksel_recalc,
655};
656
657static struct clk gfx_ick = {
658 .name = "gfx_ick", /* From l3 */
Russell Kingb36ee722008-11-04 17:59:52 +0000659 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000660 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300661 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200662 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
663 .enable_bit = OMAP_EN_GFX_SHIFT,
664 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000665};
666
667/*
668 * Modem clock domain (2430)
669 * CLOCKS:
670 * MDM_OSC_CLK
671 * MDM_ICLK
Paul Walmsleye32744b2008-03-18 15:47:55 +0200672 * These clocks are usable in chassis mode only.
Tony Lindgren046d6b22005-11-10 14:26:52 +0000673 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200674static const struct clksel_rate mdm_ick_core_rates[] = {
675 { .div = 1, .val = 1, .flags = RATE_IN_243X },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600676 { .div = 4, .val = 4, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200677 { .div = 6, .val = 6, .flags = RATE_IN_243X },
678 { .div = 9, .val = 9, .flags = RATE_IN_243X },
679 { .div = 0 }
680};
681
682static const struct clksel mdm_ick_clksel[] = {
683 { .parent = &core_ck, .rates = mdm_ick_core_rates },
684 { .parent = NULL }
685};
686
Tony Lindgren046d6b22005-11-10 14:26:52 +0000687static struct clk mdm_ick = { /* used both as a ick and fck */
688 .name = "mdm_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000689 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000690 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300691 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200692 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
693 .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
694 .clksel_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
695 .clksel_mask = OMAP2430_CLKSEL_MDM_MASK,
696 .clksel = mdm_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000697 .recalc = &omap2_clksel_recalc,
698};
699
700static struct clk mdm_osc_ck = {
701 .name = "mdm_osc_ck",
Russell Kingb36ee722008-11-04 17:59:52 +0000702 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000703 .parent = &osc_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300704 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200705 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
706 .enable_bit = OMAP2430_EN_OSC_SHIFT,
707 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000708};
709
710/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000711 * DSS clock domain
712 * CLOCKs:
713 * DSS_L4_ICLK, DSS_L3_ICLK,
714 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
715 *
716 * DSS is both initiator and target.
717 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200718/* XXX Add RATE_NOT_VALIDATED */
719
720static const struct clksel_rate dss1_fck_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600721 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200722 { .div = 0 }
723};
724
725static const struct clksel_rate dss1_fck_core_rates[] = {
726 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
727 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
728 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
729 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
730 { .div = 5, .val = 5, .flags = RATE_IN_24XX },
731 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
732 { .div = 8, .val = 8, .flags = RATE_IN_24XX },
733 { .div = 9, .val = 9, .flags = RATE_IN_24XX },
734 { .div = 12, .val = 12, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600735 { .div = 16, .val = 16, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200736 { .div = 0 }
737};
738
739static const struct clksel dss1_fck_clksel[] = {
740 { .parent = &sys_ck, .rates = dss1_fck_sys_rates },
741 { .parent = &core_ck, .rates = dss1_fck_core_rates },
742 { .parent = NULL },
743};
744
Tony Lindgren046d6b22005-11-10 14:26:52 +0000745static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
746 .name = "dss_ick",
Russell Kingbc51da42008-11-04 18:59:32 +0000747 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000748 .parent = &l4_ck, /* really both l3 and l4 */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300749 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200750 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
751 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
752 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000753};
754
755static struct clk dss1_fck = {
756 .name = "dss1_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000757 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000758 .parent = &core_ck, /* Core or sys */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300759 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200760 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
761 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
762 .init = &omap2_init_clksel_parent,
763 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
764 .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK,
765 .clksel = dss1_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000766 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200767};
768
769static const struct clksel_rate dss2_fck_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600770 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200771 { .div = 0 }
772};
773
774static const struct clksel_rate dss2_fck_48m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600775 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200776 { .div = 0 }
777};
778
779static const struct clksel dss2_fck_clksel[] = {
780 { .parent = &sys_ck, .rates = dss2_fck_sys_rates },
781 { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
782 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000783};
784
785static struct clk dss2_fck = { /* Alt clk used in power management */
786 .name = "dss2_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000787 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000788 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300789 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200790 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
791 .enable_bit = OMAP24XX_EN_DSS2_SHIFT,
792 .init = &omap2_init_clksel_parent,
793 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
794 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
795 .clksel = dss2_fck_clksel,
796 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000797};
798
799static struct clk dss_54m_fck = { /* Alt clk used in power management */
800 .name = "dss_54m_fck", /* 54m tv clk */
Russell Kingb36ee722008-11-04 17:59:52 +0000801 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000802 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300803 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200804 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
805 .enable_bit = OMAP24XX_EN_TV_SHIFT,
806 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000807};
808
809/*
810 * CORE power domain ICLK & FCLK defines.
811 * Many of the these can have more than one possible parent. Entries
812 * here will likely have an L4 interface parent, and may have multiple
813 * functional clock parents.
814 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200815static const struct clksel_rate gpt_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600816 { .div = 1, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200817 { .div = 0 }
818};
819
820static const struct clksel omap24xx_gpt_clksel[] = {
821 { .parent = &func_32k_ck, .rates = gpt_32k_rates },
822 { .parent = &sys_ck, .rates = gpt_sys_rates },
823 { .parent = &alt_ck, .rates = gpt_alt_rates },
824 { .parent = NULL },
825};
826
Tony Lindgren046d6b22005-11-10 14:26:52 +0000827static struct clk gpt1_ick = {
828 .name = "gpt1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000829 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000830 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300831 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200832 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
833 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
834 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000835};
836
837static struct clk gpt1_fck = {
838 .name = "gpt1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000839 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000840 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300841 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200842 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
843 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
844 .init = &omap2_init_clksel_parent,
845 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
846 .clksel_mask = OMAP24XX_CLKSEL_GPT1_MASK,
847 .clksel = omap24xx_gpt_clksel,
848 .recalc = &omap2_clksel_recalc,
849 .round_rate = &omap2_clksel_round_rate,
850 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000851};
852
853static struct clk gpt2_ick = {
854 .name = "gpt2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000855 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000856 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300857 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200858 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
859 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
860 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000861};
862
863static struct clk gpt2_fck = {
864 .name = "gpt2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000865 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000866 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300867 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200868 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
869 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
870 .init = &omap2_init_clksel_parent,
871 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
872 .clksel_mask = OMAP24XX_CLKSEL_GPT2_MASK,
873 .clksel = omap24xx_gpt_clksel,
874 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000875};
876
877static struct clk gpt3_ick = {
878 .name = "gpt3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000879 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000880 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300881 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200882 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
883 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
884 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000885};
886
887static struct clk gpt3_fck = {
888 .name = "gpt3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000889 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000890 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300891 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200892 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
893 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
894 .init = &omap2_init_clksel_parent,
895 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
896 .clksel_mask = OMAP24XX_CLKSEL_GPT3_MASK,
897 .clksel = omap24xx_gpt_clksel,
898 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000899};
900
901static struct clk gpt4_ick = {
902 .name = "gpt4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000903 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000904 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300905 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200906 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
907 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
908 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000909};
910
911static struct clk gpt4_fck = {
912 .name = "gpt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000913 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000914 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300915 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200916 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
917 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
918 .init = &omap2_init_clksel_parent,
919 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
920 .clksel_mask = OMAP24XX_CLKSEL_GPT4_MASK,
921 .clksel = omap24xx_gpt_clksel,
922 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000923};
924
925static struct clk gpt5_ick = {
926 .name = "gpt5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000927 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000928 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300929 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200930 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
931 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
932 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000933};
934
935static struct clk gpt5_fck = {
936 .name = "gpt5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000937 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000938 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300939 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200940 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
941 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
942 .init = &omap2_init_clksel_parent,
943 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
944 .clksel_mask = OMAP24XX_CLKSEL_GPT5_MASK,
945 .clksel = omap24xx_gpt_clksel,
946 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000947};
948
949static struct clk gpt6_ick = {
950 .name = "gpt6_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000951 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000952 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300953 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200954 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
955 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
956 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000957};
958
959static struct clk gpt6_fck = {
960 .name = "gpt6_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000961 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000962 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300963 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200964 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
965 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
966 .init = &omap2_init_clksel_parent,
967 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
968 .clksel_mask = OMAP24XX_CLKSEL_GPT6_MASK,
969 .clksel = omap24xx_gpt_clksel,
970 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000971};
972
973static struct clk gpt7_ick = {
974 .name = "gpt7_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000975 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000976 .parent = &l4_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200977 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
978 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
979 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000980};
981
982static struct clk gpt7_fck = {
983 .name = "gpt7_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000984 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000985 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300986 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200987 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
988 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
989 .init = &omap2_init_clksel_parent,
990 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
991 .clksel_mask = OMAP24XX_CLKSEL_GPT7_MASK,
992 .clksel = omap24xx_gpt_clksel,
993 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000994};
995
996static struct clk gpt8_ick = {
997 .name = "gpt8_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000998 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000999 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001000 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001001 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1002 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1003 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001004};
1005
1006static struct clk gpt8_fck = {
1007 .name = "gpt8_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001008 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001009 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001010 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001011 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1012 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1013 .init = &omap2_init_clksel_parent,
1014 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1015 .clksel_mask = OMAP24XX_CLKSEL_GPT8_MASK,
1016 .clksel = omap24xx_gpt_clksel,
1017 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001018};
1019
1020static struct clk gpt9_ick = {
1021 .name = "gpt9_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001022 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001023 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001024 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001025 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1026 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1027 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001028};
1029
1030static struct clk gpt9_fck = {
1031 .name = "gpt9_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001032 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001033 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001034 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001035 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1036 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1037 .init = &omap2_init_clksel_parent,
1038 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1039 .clksel_mask = OMAP24XX_CLKSEL_GPT9_MASK,
1040 .clksel = omap24xx_gpt_clksel,
1041 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001042};
1043
1044static struct clk gpt10_ick = {
1045 .name = "gpt10_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001046 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001047 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001048 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001049 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1050 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1051 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001052};
1053
1054static struct clk gpt10_fck = {
1055 .name = "gpt10_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001056 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001057 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001058 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001059 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1060 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1061 .init = &omap2_init_clksel_parent,
1062 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1063 .clksel_mask = OMAP24XX_CLKSEL_GPT10_MASK,
1064 .clksel = omap24xx_gpt_clksel,
1065 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001066};
1067
1068static struct clk gpt11_ick = {
1069 .name = "gpt11_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001070 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001071 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001072 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001073 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1074 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1075 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001076};
1077
1078static struct clk gpt11_fck = {
1079 .name = "gpt11_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001080 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001081 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001082 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001083 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1084 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1085 .init = &omap2_init_clksel_parent,
1086 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1087 .clksel_mask = OMAP24XX_CLKSEL_GPT11_MASK,
1088 .clksel = omap24xx_gpt_clksel,
1089 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001090};
1091
1092static struct clk gpt12_ick = {
1093 .name = "gpt12_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001094 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001095 .parent = &l4_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_ICLKEN1),
1098 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1099 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001100};
1101
1102static struct clk gpt12_fck = {
1103 .name = "gpt12_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001104 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyf2480762009-04-23 21:11:10 -06001105 .parent = &secure_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001106 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001107 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1108 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1109 .init = &omap2_init_clksel_parent,
1110 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1111 .clksel_mask = OMAP24XX_CLKSEL_GPT12_MASK,
1112 .clksel = omap24xx_gpt_clksel,
1113 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001114};
1115
1116static struct clk mcbsp1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001117 .name = "mcbsp1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001118 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001119 .parent = &l4_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_ICLKEN1),
1122 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1123 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001124};
1125
1126static struct clk mcbsp1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001127 .name = "mcbsp1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001128 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001129 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001130 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001131 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1132 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1133 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001134};
1135
1136static struct clk mcbsp2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001137 .name = "mcbsp2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001138 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001139 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001140 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001141 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1142 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1143 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001144};
1145
1146static struct clk mcbsp2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001147 .name = "mcbsp2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001148 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001149 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001150 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001151 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1152 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1153 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001154};
1155
1156static struct clk mcbsp3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001157 .name = "mcbsp3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001158 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001159 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001160 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001161 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1162 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
1163 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001164};
1165
1166static struct clk mcbsp3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001167 .name = "mcbsp3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001168 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001169 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001170 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001171 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1172 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
1173 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001174};
1175
1176static struct clk mcbsp4_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001177 .name = "mcbsp4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001178 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001179 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001180 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001181 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1182 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1183 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001184};
1185
1186static struct clk mcbsp4_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001187 .name = "mcbsp4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001188 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001189 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001190 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001191 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1192 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1193 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001194};
1195
1196static struct clk mcbsp5_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001197 .name = "mcbsp5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001198 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001199 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001200 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001201 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1202 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1203 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001204};
1205
1206static struct clk mcbsp5_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001207 .name = "mcbsp5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001208 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001209 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001210 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001211 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1212 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1213 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001214};
1215
1216static struct clk mcspi1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001217 .name = "mcspi1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001218 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001219 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001220 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001221 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1222 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1223 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001224};
1225
1226static struct clk mcspi1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001227 .name = "mcspi1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001228 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001229 .parent = &func_48m_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_FCLKEN1),
1232 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1233 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001234};
1235
1236static struct clk mcspi2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001237 .name = "mcspi2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001238 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001239 .parent = &l4_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_ICLKEN1),
1242 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1243 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001244};
1245
1246static struct clk mcspi2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001247 .name = "mcspi2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001248 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001249 .parent = &func_48m_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_FCLKEN1),
1252 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1253 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001254};
1255
1256static struct clk mcspi3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001257 .name = "mcspi3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001258 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001259 .parent = &l4_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_ICLKEN2),
1262 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1263 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001264};
1265
1266static struct clk mcspi3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001267 .name = "mcspi3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001268 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001269 .parent = &func_48m_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, OMAP24XX_CM_FCLKEN2),
1272 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1273 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001274};
1275
1276static struct clk uart1_ick = {
1277 .name = "uart1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001278 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001279 .parent = &l4_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, CM_ICLKEN1),
1282 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1283 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001284};
1285
1286static struct clk uart1_fck = {
1287 .name = "uart1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001288 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001289 .parent = &func_48m_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_FCLKEN1),
1292 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1293 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001294};
1295
1296static struct clk uart2_ick = {
1297 .name = "uart2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001298 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001299 .parent = &l4_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, CM_ICLKEN1),
1302 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1303 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001304};
1305
1306static struct clk uart2_fck = {
1307 .name = "uart2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001308 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001309 .parent = &func_48m_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_FCLKEN1),
1312 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1313 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001314};
1315
1316static struct clk uart3_ick = {
1317 .name = "uart3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001318 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001319 .parent = &l4_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, CM_ICLKEN2),
1322 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1323 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001324};
1325
1326static struct clk uart3_fck = {
1327 .name = "uart3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001328 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001329 .parent = &func_48m_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, OMAP24XX_CM_FCLKEN2),
1332 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1333 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001334};
1335
1336static struct clk gpios_ick = {
1337 .name = "gpios_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001338 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001339 .parent = &l4_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(WKUP_MOD, CM_ICLKEN),
1342 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1343 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001344};
1345
1346static struct clk gpios_fck = {
1347 .name = "gpios_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001348 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001349 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001350 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001351 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1352 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1353 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001354};
1355
1356static struct clk mpu_wdt_ick = {
1357 .name = "mpu_wdt_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001358 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001359 .parent = &l4_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(WKUP_MOD, CM_ICLKEN),
1362 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1363 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001364};
1365
1366static struct clk mpu_wdt_fck = {
1367 .name = "mpu_wdt_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001368 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001369 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001370 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001371 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1372 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1373 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001374};
1375
1376static struct clk sync_32k_ick = {
1377 .name = "sync_32k_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001378 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001379 .parent = &l4_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001380 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001381 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001382 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1383 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
1384 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001385};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001386
Tony Lindgren046d6b22005-11-10 14:26:52 +00001387static struct clk wdt1_ick = {
1388 .name = "wdt1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001389 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001390 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001391 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001392 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1393 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
1394 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001395};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001396
Tony Lindgren046d6b22005-11-10 14:26:52 +00001397static struct clk omapctrl_ick = {
1398 .name = "omapctrl_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001399 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001400 .parent = &l4_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001401 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001402 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001403 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1404 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
1405 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001406};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001407
Tony Lindgren046d6b22005-11-10 14:26:52 +00001408static struct clk icr_ick = {
1409 .name = "icr_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001410 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001411 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001412 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001413 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1414 .enable_bit = OMAP2430_EN_ICR_SHIFT,
1415 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001416};
1417
1418static struct clk cam_ick = {
1419 .name = "cam_ick",
Russell Kingbc51da42008-11-04 18:59:32 +00001420 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001421 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001422 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001423 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1424 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1425 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001426};
1427
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001428/*
1429 * cam_fck controls both CAM_MCLK and CAM_FCLK. It should probably be
1430 * split into two separate clocks, since the parent clocks are different
1431 * and the clockdomains are also different.
1432 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001433static struct clk cam_fck = {
1434 .name = "cam_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00001435 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001436 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001437 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001438 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1439 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1440 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001441};
1442
1443static struct clk mailboxes_ick = {
1444 .name = "mailboxes_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001445 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001446 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001447 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001448 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1449 .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
1450 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001451};
1452
1453static struct clk wdt4_ick = {
1454 .name = "wdt4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001455 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001456 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001457 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001458 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1459 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1460 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001461};
1462
1463static struct clk wdt4_fck = {
1464 .name = "wdt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001465 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001466 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001467 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001468 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1469 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1470 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001471};
1472
Tony Lindgren046d6b22005-11-10 14:26:52 +00001473static struct clk mspro_ick = {
1474 .name = "mspro_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001475 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001476 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001477 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001478 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1479 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1480 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001481};
1482
1483static struct clk mspro_fck = {
1484 .name = "mspro_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001485 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001486 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001487 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001488 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1489 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1490 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001491};
1492
Tony Lindgren046d6b22005-11-10 14:26:52 +00001493static struct clk fac_ick = {
1494 .name = "fac_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001495 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001496 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001497 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001498 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1499 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1500 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001501};
1502
1503static struct clk fac_fck = {
1504 .name = "fac_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001505 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001506 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001507 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001508 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1509 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1510 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001511};
1512
Tony Lindgren046d6b22005-11-10 14:26:52 +00001513static struct clk hdq_ick = {
1514 .name = "hdq_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001515 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001516 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001517 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001518 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1519 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1520 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001521};
1522
1523static struct clk hdq_fck = {
1524 .name = "hdq_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001525 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001526 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001527 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001528 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1529 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1530 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001531};
1532
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001533/*
1534 * XXX This is marked as a 2420-only define, but it claims to be present
1535 * on 2430 also. Double-check.
1536 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001537static struct clk i2c2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001538 .name = "i2c2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001539 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001540 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001541 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001542 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1543 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
1544 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001545};
1546
Tony Lindgren046d6b22005-11-10 14:26:52 +00001547static struct clk i2chs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001548 .name = "i2chs2_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001549 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001550 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001551 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001552 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1553 .enable_bit = OMAP2430_EN_I2CHS2_SHIFT,
1554 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001555};
1556
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001557/*
1558 * XXX This is marked as a 2420-only define, but it claims to be present
1559 * on 2430 also. Double-check.
1560 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001561static struct clk i2c1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001562 .name = "i2c1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001563 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001564 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001565 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001566 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1567 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
1568 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001569};
1570
Tony Lindgren046d6b22005-11-10 14:26:52 +00001571static struct clk i2chs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001572 .name = "i2chs1_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001573 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001574 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001575 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001576 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1577 .enable_bit = OMAP2430_EN_I2CHS1_SHIFT,
1578 .recalc = &followparent_recalc,
1579};
1580
1581static struct clk gpmc_fck = {
1582 .name = "gpmc_fck",
Russell King897dcde2008-11-04 16:35:03 +00001583 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001584 .parent = &core_l3_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001585 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001586 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001587 .recalc = &followparent_recalc,
1588};
1589
1590static struct clk sdma_fck = {
1591 .name = "sdma_fck",
Russell King897dcde2008-11-04 16:35:03 +00001592 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001593 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001594 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001595 .recalc = &followparent_recalc,
1596};
1597
1598static struct clk sdma_ick = {
1599 .name = "sdma_ick",
Russell King897dcde2008-11-04 16:35:03 +00001600 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001601 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001602 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001603 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001604};
1605
Tony Lindgren046d6b22005-11-10 14:26:52 +00001606static struct clk sdrc_ick = {
1607 .name = "sdrc_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001608 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001609 .parent = &l4_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001610 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001611 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001612 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1613 .enable_bit = OMAP2430_EN_SDRC_SHIFT,
1614 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001615};
1616
1617static struct clk des_ick = {
1618 .name = "des_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001619 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001620 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001621 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001622 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1623 .enable_bit = OMAP24XX_EN_DES_SHIFT,
1624 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001625};
1626
1627static struct clk sha_ick = {
1628 .name = "sha_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001629 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001630 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001631 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001632 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1633 .enable_bit = OMAP24XX_EN_SHA_SHIFT,
1634 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001635};
1636
1637static struct clk rng_ick = {
1638 .name = "rng_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001639 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001640 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001641 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001642 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1643 .enable_bit = OMAP24XX_EN_RNG_SHIFT,
1644 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001645};
1646
1647static struct clk aes_ick = {
1648 .name = "aes_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001649 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001650 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001651 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001652 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1653 .enable_bit = OMAP24XX_EN_AES_SHIFT,
1654 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001655};
1656
1657static struct clk pka_ick = {
1658 .name = "pka_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001659 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001660 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001661 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001662 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1663 .enable_bit = OMAP24XX_EN_PKA_SHIFT,
1664 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001665};
1666
1667static struct clk usb_fck = {
1668 .name = "usb_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001669 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001670 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001671 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001672 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1673 .enable_bit = OMAP24XX_EN_USB_SHIFT,
1674 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001675};
1676
1677static struct clk usbhs_ick = {
1678 .name = "usbhs_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001679 .ops = &clkops_omap2_dflt_wait,
Tony Lindgrenfde0fd42006-01-17 15:31:18 -08001680 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001681 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001682 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1683 .enable_bit = OMAP2430_EN_USBHS_SHIFT,
1684 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001685};
1686
1687static struct clk mmchs1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001688 .name = "mmchs1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001689 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001690 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001691 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001692 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1693 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1694 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001695};
1696
1697static struct clk mmchs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001698 .name = "mmchs1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001699 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001700 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001701 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001702 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1703 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1704 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001705};
1706
1707static struct clk mmchs2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001708 .name = "mmchs2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001709 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001710 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001711 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001712 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1713 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1714 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001715};
1716
1717static struct clk mmchs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001718 .name = "mmchs2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001719 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001720 .parent = &func_96m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001721 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1722 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1723 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001724};
1725
1726static struct clk gpio5_ick = {
1727 .name = "gpio5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001728 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001729 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001730 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001731 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1732 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1733 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001734};
1735
1736static struct clk gpio5_fck = {
1737 .name = "gpio5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001738 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001739 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001740 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001741 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1742 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1743 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001744};
1745
1746static struct clk mdm_intc_ick = {
1747 .name = "mdm_intc_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001748 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001749 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001750 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001751 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1752 .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT,
1753 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001754};
1755
1756static struct clk mmchsdb1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001757 .name = "mmchsdb1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001758 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001759 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001760 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001761 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1762 .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT,
1763 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001764};
1765
1766static struct clk mmchsdb2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001767 .name = "mmchsdb2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001768 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001769 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001770 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001771 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1772 .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT,
1773 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001774};
Paul Walmsleye32744b2008-03-18 15:47:55 +02001775
Tony Lindgren046d6b22005-11-10 14:26:52 +00001776/*
1777 * This clock is a composite clock which does entire set changes then
1778 * forces a rebalance. It keys on the MPU speed, but it really could
1779 * be any key speed part of a set in the rate table.
1780 *
1781 * to really change a set, you need memory table sets which get changed
1782 * in sram, pre-notifiers & post notifiers, changing the top set, without
1783 * having low level display recalc's won't work... this is why dpm notifiers
1784 * work, isr's off, walk a list of clocks already _off_ and not messing with
1785 * the bus.
1786 *
1787 * This clock should have no parent. It embodies the entire upper level
1788 * active set. A parent will mess up some of the init also.
1789 */
1790static struct clk virt_prcm_set = {
1791 .name = "virt_prcm_set",
Russell King897dcde2008-11-04 16:35:03 +00001792 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001793 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001794 .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001795 .set_rate = &omap2_select_table_rate,
1796 .round_rate = &omap2_round_to_table_rate,
1797};
Paul Walmsleye32744b2008-03-18 15:47:55 +02001798
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001799
1800/*
1801 * clkdev integration
1802 */
1803
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001804static struct omap_clk omap2430_clks[] = {
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001805 /* external root sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001806 CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X),
1807 CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X),
1808 CLK(NULL, "osc_ck", &osc_ck, CK_243X),
1809 CLK(NULL, "sys_ck", &sys_ck, CK_243X),
1810 CLK(NULL, "alt_ck", &alt_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001811 /* internal analog sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001812 CLK(NULL, "dpll_ck", &dpll_ck, CK_243X),
1813 CLK(NULL, "apll96_ck", &apll96_ck, CK_243X),
1814 CLK(NULL, "apll54_ck", &apll54_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001815 /* internal prcm root sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001816 CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X),
1817 CLK(NULL, "core_ck", &core_ck, CK_243X),
1818 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X),
1819 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X),
1820 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X),
1821 CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X),
1822 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X),
1823 CLK(NULL, "sys_clkout", &sys_clkout, CK_243X),
1824 CLK(NULL, "emul_ck", &emul_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001825 /* mpu domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001826 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001827 /* dsp domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001828 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X),
1829 CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001830 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001831 /* GFX domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001832 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X),
1833 CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X),
1834 CLK(NULL, "gfx_ick", &gfx_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001835 /* Modem domain clocks */
1836 CLK(NULL, "mdm_ick", &mdm_ick, CK_243X),
1837 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
1838 /* DSS domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001839 CLK("omapdss", "ick", &dss_ick, CK_243X),
1840 CLK("omapdss", "dss1_fck", &dss1_fck, CK_243X),
1841 CLK("omapdss", "dss2_fck", &dss2_fck, CK_243X),
1842 CLK("omapdss", "tv_fck", &dss_54m_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001843 /* L3 domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001844 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X),
1845 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X),
1846 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001847 /* L4 domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001848 CLK(NULL, "l4_ck", &l4_ck, CK_243X),
1849 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001850 /* virtual meta-group clock */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001851 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001852 /* general l4 interface ck, multi-parent functional clk */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001853 CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X),
1854 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X),
1855 CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X),
1856 CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X),
1857 CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X),
1858 CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X),
1859 CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X),
1860 CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X),
1861 CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X),
1862 CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X),
1863 CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X),
1864 CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X),
1865 CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X),
1866 CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X),
1867 CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X),
1868 CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X),
1869 CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X),
1870 CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X),
1871 CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X),
1872 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X),
1873 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X),
1874 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X),
1875 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X),
1876 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X),
1877 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X),
1878 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X),
1879 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X),
1880 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001881 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
1882 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X),
1883 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
1884 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X),
1885 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
1886 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001887 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X),
1888 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X),
1889 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X),
1890 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001891 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
1892 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001893 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X),
1894 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X),
1895 CLK(NULL, "uart2_ick", &uart2_ick, CK_243X),
1896 CLK(NULL, "uart2_fck", &uart2_fck, CK_243X),
1897 CLK(NULL, "uart3_ick", &uart3_ick, CK_243X),
1898 CLK(NULL, "uart3_fck", &uart3_fck, CK_243X),
1899 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X),
1900 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X),
1901 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X),
1902 CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X),
1903 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X),
1904 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X),
1905 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001906 CLK(NULL, "icr_ick", &icr_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001907 CLK("omap24xxcam", "fck", &cam_fck, CK_243X),
1908 CLK("omap24xxcam", "ick", &cam_ick, CK_243X),
1909 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X),
1910 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X),
1911 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X),
1912 CLK(NULL, "mspro_ick", &mspro_ick, CK_243X),
1913 CLK(NULL, "mspro_fck", &mspro_fck, CK_243X),
1914 CLK(NULL, "fac_ick", &fac_ick, CK_243X),
1915 CLK(NULL, "fac_fck", &fac_fck, CK_243X),
1916 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X),
1917 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X),
1918 CLK("i2c_omap.1", "ick", &i2c1_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001919 CLK("i2c_omap.1", "fck", &i2chs1_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001920 CLK("i2c_omap.2", "ick", &i2c2_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001921 CLK("i2c_omap.2", "fck", &i2chs2_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001922 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X),
1923 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X),
1924 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001925 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001926 CLK(NULL, "des_ick", &des_ick, CK_243X),
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +08001927 CLK("omap-sham", "ick", &sha_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001928 CLK("omap_rng", "ick", &rng_ick, CK_243X),
1929 CLK(NULL, "aes_ick", &aes_ick, CK_243X),
1930 CLK(NULL, "pka_ick", &pka_ick, CK_243X),
1931 CLK(NULL, "usb_fck", &usb_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001932 CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X),
1933 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X),
1934 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X),
1935 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X),
1936 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X),
1937 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
1938 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
1939 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
1940 CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
1941 CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
1942};
1943
1944/*
1945 * init code
1946 */
1947
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001948int __init omap2430_clk_init(void)
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001949{
1950 const struct prcm_config *prcm;
1951 struct omap_clk *c;
1952 u32 clkrate;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001953
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001954 prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
1955 cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST);
1956 cpu_mask = RATE_IN_243X;
1957 rate_table = omap2430_rate_table;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001958
1959 clk_init(&omap2_clk_functions);
1960
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001961 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
1962 c++)
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001963 clk_preinit(c->lk.clk);
1964
1965 osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
1966 propagate_rate(&osc_ck);
Paul Walmsley44da0a52010-01-26 20:13:08 -07001967 sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck);
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001968 propagate_rate(&sys_ck);
1969
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001970 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
1971 c++) {
1972 clkdev_add(&c->lk);
1973 clk_register(c->lk.clk);
1974 omap2_init_clk_clkdm(c->lk.clk);
1975 }
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001976
1977 /* Check the MPU rate set by bootloader */
1978 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
1979 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
1980 if (!(prcm->flags & cpu_mask))
1981 continue;
1982 if (prcm->xtal_speed != sys_ck.rate)
1983 continue;
1984 if (prcm->dpll_speed <= clkrate)
1985 break;
1986 }
1987 curr_prcm_set = prcm;
1988
1989 recalculate_root_clocks();
1990
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001991 pr_info("Clocking rate (Crystal/DPLL/MPU): %ld.%01ld/%ld/%ld MHz\n",
1992 (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
1993 (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001994
1995 /*
1996 * Only enable those clocks we will need, let the drivers
1997 * enable other clocks as necessary
1998 */
1999 clk_enable_init_clocks();
2000
2001 /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
2002 vclk = clk_get(NULL, "virt_prcm_set");
2003 sclk = clk_get(NULL, "sys_ck");
2004 dclk = clk_get(NULL, "dpll_ck");
2005
2006 return 0;
2007}
Paul Walmsley6b8858a2008-03-18 10:35:15 +02002008