blob: 3378dbf8bace48a6c48f4279714366bb159db06b [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 Walmsleya1d55622011-02-25 15:39:30 -07005 * Copyright (C) 2004-2011 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 Walmsley59fb6592010-12-21 15:30:55 -070025#include "cm2xxx_3xxx.h"
26#include "prm2xxx_3xxx.h"
Paul Walmsley6b8858a2008-03-18 10:35:15 +020027#include "prm-regbits-24xx.h"
28#include "cm-regbits-24xx.h"
29#include "sdrc.h"
Paul Walmsley4814ced2010-10-08 11:40:20 -060030#include "control.h"
Paul Walmsley6b8858a2008-03-18 10:35:15 +020031
Paul Walmsley81b34fb2010-02-22 22:09:22 -070032#define OMAP_CM_REGADDR OMAP2430_CM_REGADDR
33
34/*
35 * 2430 clock tree.
Tony Lindgren046d6b22005-11-10 14:26:52 +000036 *
37 * NOTE:In many cases here we are assigning a 'default' parent. In many
38 * cases the parent is selectable. The get/set parent calls will also
39 * switch sources.
40 *
41 * Many some clocks say always_enabled, but they can be auto idled for
42 * power savings. They will always be available upon clock request.
43 *
44 * Several sources are given initial rates which may be wrong, this will
45 * be fixed up in the init func.
46 *
47 * Things are broadly separated below by clock domains. It is
48 * noteworthy that most periferals have dependencies on multiple clock
49 * domains. Many get their interface clocks from the L4 domain, but get
50 * functional clocks from fixed sources or other core domain derived
51 * clocks.
Paul Walmsley81b34fb2010-02-22 22:09:22 -070052 */
Tony Lindgren046d6b22005-11-10 14:26:52 +000053
54/* Base external input clocks */
55static struct clk func_32k_ck = {
56 .name = "func_32k_ck",
Russell King897dcde2008-11-04 16:35:03 +000057 .ops = &clkops_null,
Paul Walmsley3f9cfd32011-02-16 15:38:38 -070058 .rate = 32768,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030059 .clkdm_name = "wkup_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +000060};
Paul Walmsleye32744b2008-03-18 15:47:55 +020061
Paul Walmsleyf2480762009-04-23 21:11:10 -060062static struct clk secure_32k_ck = {
63 .name = "secure_32k_ck",
64 .ops = &clkops_null,
65 .rate = 32768,
Paul Walmsleyf2480762009-04-23 21:11:10 -060066 .clkdm_name = "wkup_clkdm",
67};
68
Tony Lindgren046d6b22005-11-10 14:26:52 +000069/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
70static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
71 .name = "osc_ck",
Russell King548d8492008-11-04 14:02:46 +000072 .ops = &clkops_oscck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030073 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +020074 .recalc = &omap2_osc_clk_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +000075};
76
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030077/* Without modem likely 12MHz, with modem likely 13MHz */
Tony Lindgren046d6b22005-11-10 14:26:52 +000078static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */
79 .name = "sys_ck", /* ~ ref_clk also */
Russell King897dcde2008-11-04 16:35:03 +000080 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +000081 .parent = &osc_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030082 .clkdm_name = "wkup_clkdm",
Paul Walmsley44da0a52010-01-26 20:13:08 -070083 .recalc = &omap2xxx_sys_clk_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +000084};
Paul Walmsleye32744b2008-03-18 15:47:55 +020085
Tony Lindgren046d6b22005-11-10 14:26:52 +000086static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
87 .name = "alt_ck",
Russell King897dcde2008-11-04 16:35:03 +000088 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +000089 .rate = 54000000,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030090 .clkdm_name = "wkup_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +000091};
Paul Walmsleye32744b2008-03-18 15:47:55 +020092
Paul Walmsleyb115b742010-10-08 11:40:18 -060093/* Optional external clock input for McBSP CLKS */
94static struct clk mcbsp_clks = {
95 .name = "mcbsp_clks",
96 .ops = &clkops_null,
97};
98
Tony Lindgren046d6b22005-11-10 14:26:52 +000099/*
100 * Analog domain root source clocks
101 */
102
103/* dpll_ck, is broken out in to special cases through clksel */
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200104/* REVISIT: Rate changes on dpll_ck trigger a full set change. ...
105 * deal with this
106 */
107
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300108static struct dpll_data dpll_dd = {
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200109 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
110 .mult_mask = OMAP24XX_DPLL_MULT_MASK,
111 .div1_mask = OMAP24XX_DPLL_DIV_MASK,
Russell Kingc0bf3132009-02-19 13:29:22 +0000112 .clk_bypass = &sys_ck,
113 .clk_ref = &sys_ck,
114 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
115 .enable_mask = OMAP24XX_EN_DPLL_MASK,
Paul Walmsley93340a22010-02-22 22:09:12 -0700116 .max_multiplier = 1023,
Paul Walmsley95f538a2009-01-28 12:08:44 -0700117 .min_divider = 1,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300118 .max_divider = 16,
119 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200120};
121
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300122/*
123 * XXX Cannot add round_rate here yet, as this is still a composite clock,
124 * not just a DPLL
125 */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000126static struct clk dpll_ck = {
127 .name = "dpll_ck",
Paul Walmsley0fd0c212011-02-25 15:49:53 -0700128 .ops = &clkops_omap2xxx_dpll_ops,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000129 .parent = &sys_ck, /* Can be func_32k also */
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200130 .dpll_data = &dpll_dd,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300131 .clkdm_name = "wkup_clkdm",
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300132 .recalc = &omap2_dpllcore_recalc,
133 .set_rate = &omap2_reprogram_dpllcore,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000134};
135
136static struct clk apll96_ck = {
137 .name = "apll96_ck",
Paul Walmsley06b16932009-12-08 16:18:46 -0700138 .ops = &clkops_apll96,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000139 .parent = &sys_ck,
140 .rate = 96000000,
Paul Walmsley51c19542010-02-22 22:09:26 -0700141 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300142 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200143 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
144 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000145};
146
147static struct clk apll54_ck = {
148 .name = "apll54_ck",
Paul Walmsley06b16932009-12-08 16:18:46 -0700149 .ops = &clkops_apll54,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000150 .parent = &sys_ck,
151 .rate = 54000000,
Paul Walmsley51c19542010-02-22 22:09:26 -0700152 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300153 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200154 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
155 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000156};
157
158/*
159 * PRCM digital base sources
160 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200161
162/* func_54m_ck */
163
164static const struct clksel_rate func_54m_apll54_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600165 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200166 { .div = 0 },
167};
168
169static const struct clksel_rate func_54m_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600170 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200171 { .div = 0 },
172};
173
174static const struct clksel func_54m_clksel[] = {
175 { .parent = &apll54_ck, .rates = func_54m_apll54_rates, },
176 { .parent = &alt_ck, .rates = func_54m_alt_rates, },
177 { .parent = NULL },
178};
179
Tony Lindgren046d6b22005-11-10 14:26:52 +0000180static struct clk func_54m_ck = {
181 .name = "func_54m_ck",
Russell King57137182008-11-04 16:48:35 +0000182 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000183 .parent = &apll54_ck, /* can also be alt_clk */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300184 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200185 .init = &omap2_init_clksel_parent,
186 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsleyf38ca102010-05-20 12:31:04 -0600187 .clksel_mask = OMAP24XX_54M_SOURCE_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200188 .clksel = func_54m_clksel,
189 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000190};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200191
Tony Lindgren046d6b22005-11-10 14:26:52 +0000192static struct clk core_ck = {
193 .name = "core_ck",
Russell King897dcde2008-11-04 16:35:03 +0000194 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000195 .parent = &dpll_ck, /* can also be 32k */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300196 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200197 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000198};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200199
200/* func_96m_ck */
201static const struct clksel_rate func_96m_apll96_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600202 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200203 { .div = 0 },
Tony Lindgren046d6b22005-11-10 14:26:52 +0000204};
205
Paul Walmsleye32744b2008-03-18 15:47:55 +0200206static const struct clksel_rate func_96m_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600207 { .div = 1, .val = 1, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200208 { .div = 0 },
209};
210
211static const struct clksel func_96m_clksel[] = {
212 { .parent = &apll96_ck, .rates = func_96m_apll96_rates },
213 { .parent = &alt_ck, .rates = func_96m_alt_rates },
214 { .parent = NULL }
215};
216
Tony Lindgren046d6b22005-11-10 14:26:52 +0000217static struct clk func_96m_ck = {
218 .name = "func_96m_ck",
Russell King57137182008-11-04 16:48:35 +0000219 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000220 .parent = &apll96_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300221 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200222 .init = &omap2_init_clksel_parent,
223 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsleyf38ca102010-05-20 12:31:04 -0600224 .clksel_mask = OMAP2430_96M_SOURCE_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200225 .clksel = func_96m_clksel,
226 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200227};
228
229/* func_48m_ck */
230
231static const struct clksel_rate func_48m_apll96_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600232 { .div = 2, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200233 { .div = 0 },
234};
235
236static const struct clksel_rate func_48m_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600237 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200238 { .div = 0 },
239};
240
241static const struct clksel func_48m_clksel[] = {
242 { .parent = &apll96_ck, .rates = func_48m_apll96_rates },
243 { .parent = &alt_ck, .rates = func_48m_alt_rates },
244 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000245};
246
247static struct clk func_48m_ck = {
248 .name = "func_48m_ck",
Russell King57137182008-11-04 16:48:35 +0000249 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000250 .parent = &apll96_ck, /* 96M or Alt */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300251 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200252 .init = &omap2_init_clksel_parent,
253 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsleyf38ca102010-05-20 12:31:04 -0600254 .clksel_mask = OMAP24XX_48M_SOURCE_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200255 .clksel = func_48m_clksel,
256 .recalc = &omap2_clksel_recalc,
257 .round_rate = &omap2_clksel_round_rate,
258 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000259};
260
261static struct clk func_12m_ck = {
262 .name = "func_12m_ck",
Russell King57137182008-11-04 16:48:35 +0000263 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000264 .parent = &func_48m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200265 .fixed_div = 4,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300266 .clkdm_name = "wkup_clkdm",
Paul Walmsleye9b98f62010-01-26 20:12:57 -0700267 .recalc = &omap_fixed_divisor_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000268};
269
270/* Secure timer, only available in secure mode */
271static struct clk wdt1_osc_ck = {
272 .name = "ck_wdt1_osc",
Russell King897dcde2008-11-04 16:35:03 +0000273 .ops = &clkops_null, /* RMK: missing? */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000274 .parent = &osc_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200275 .recalc = &followparent_recalc,
276};
277
278/*
279 * The common_clkout* clksel_rate structs are common to
280 * sys_clkout, sys_clkout_src, sys_clkout2, and sys_clkout2_src.
281 * sys_clkout2_* are 2420-only, so the
282 * clksel_rate flags fields are inaccurate for those clocks. This is
283 * harmless since access to those clocks are gated by the struct clk
284 * flags fields, which mark them as 2420-only.
285 */
286static const struct clksel_rate common_clkout_src_core_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600287 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200288 { .div = 0 }
289};
290
291static const struct clksel_rate common_clkout_src_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600292 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200293 { .div = 0 }
294};
295
296static const struct clksel_rate common_clkout_src_96m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600297 { .div = 1, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200298 { .div = 0 }
299};
300
301static const struct clksel_rate common_clkout_src_54m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600302 { .div = 1, .val = 3, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200303 { .div = 0 }
304};
305
306static const struct clksel common_clkout_src_clksel[] = {
307 { .parent = &core_ck, .rates = common_clkout_src_core_rates },
308 { .parent = &sys_ck, .rates = common_clkout_src_sys_rates },
309 { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates },
310 { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates },
311 { .parent = NULL }
312};
313
314static struct clk sys_clkout_src = {
315 .name = "sys_clkout_src",
Russell Kingc1168dc2008-11-04 21:24:00 +0000316 .ops = &clkops_omap2_dflt,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200317 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300318 .clkdm_name = "wkup_clkdm",
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700319 .enable_reg = OMAP2430_PRCM_CLKOUT_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200320 .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT,
321 .init = &omap2_init_clksel_parent,
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700322 .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200323 .clksel_mask = OMAP24XX_CLKOUT_SOURCE_MASK,
324 .clksel = common_clkout_src_clksel,
325 .recalc = &omap2_clksel_recalc,
326 .round_rate = &omap2_clksel_round_rate,
327 .set_rate = &omap2_clksel_set_rate
328};
329
330static const struct clksel_rate common_clkout_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600331 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200332 { .div = 2, .val = 1, .flags = RATE_IN_24XX },
333 { .div = 4, .val = 2, .flags = RATE_IN_24XX },
334 { .div = 8, .val = 3, .flags = RATE_IN_24XX },
335 { .div = 16, .val = 4, .flags = RATE_IN_24XX },
336 { .div = 0 },
337};
338
339static const struct clksel sys_clkout_clksel[] = {
340 { .parent = &sys_clkout_src, .rates = common_clkout_rates },
341 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000342};
343
344static struct clk sys_clkout = {
345 .name = "sys_clkout",
Russell King57137182008-11-04 16:48:35 +0000346 .ops = &clkops_null,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200347 .parent = &sys_clkout_src,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300348 .clkdm_name = "wkup_clkdm",
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700349 .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200350 .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK,
351 .clksel = sys_clkout_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000352 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200353 .round_rate = &omap2_clksel_round_rate,
354 .set_rate = &omap2_clksel_set_rate
355};
356
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100357static struct clk emul_ck = {
358 .name = "emul_ck",
Russell Kingc1168dc2008-11-04 21:24:00 +0000359 .ops = &clkops_omap2_dflt,
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100360 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300361 .clkdm_name = "wkup_clkdm",
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700362 .enable_reg = OMAP2430_PRCM_CLKEMUL_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200363 .enable_bit = OMAP24XX_EMULATION_EN_SHIFT,
364 .recalc = &followparent_recalc,
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100365
366};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200367
Tony Lindgren046d6b22005-11-10 14:26:52 +0000368/*
369 * MPU clock domain
370 * Clocks:
371 * MPU_FCLK, MPU_ICLK
372 * INT_M_FCLK, INT_M_I_CLK
373 *
374 * - Individual clocks are hardware managed.
375 * - Base divider comes from: CM_CLKSEL_MPU
376 *
377 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200378static const struct clksel_rate mpu_core_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600379 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200380 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200381 { .div = 0 },
382};
383
384static const struct clksel mpu_clksel[] = {
385 { .parent = &core_ck, .rates = mpu_core_rates },
386 { .parent = NULL }
387};
388
Tony Lindgren046d6b22005-11-10 14:26:52 +0000389static struct clk mpu_ck = { /* Control cpu */
390 .name = "mpu_ck",
Russell King897dcde2008-11-04 16:35:03 +0000391 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000392 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300393 .clkdm_name = "mpu_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200394 .init = &omap2_init_clksel_parent,
395 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
396 .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200397 .clksel = mpu_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000398 .recalc = &omap2_clksel_recalc,
399};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200400
Tony Lindgren046d6b22005-11-10 14:26:52 +0000401/*
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700402 * DSP (2430-IVA2.1) clock domain
Tony Lindgren046d6b22005-11-10 14:26:52 +0000403 * Clocks:
Paul Walmsleye32744b2008-03-18 15:47:55 +0200404 * 2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
Paul Walmsleye32744b2008-03-18 15:47:55 +0200405 *
Tony Lindgren046d6b22005-11-10 14:26:52 +0000406 * Won't be too specific here. The core clock comes into this block
407 * it is divided then tee'ed. One branch goes directly to xyz enable
408 * controls. The other branch gets further divided by 2 then possibly
409 * routed into a synchronizer and out of clocks abc.
410 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200411static const struct clksel_rate dsp_fck_core_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600412 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200413 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
414 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
415 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200416 { .div = 0 },
417};
418
419static const struct clksel dsp_fck_clksel[] = {
420 { .parent = &core_ck, .rates = dsp_fck_core_rates },
421 { .parent = NULL }
422};
423
Tony Lindgren046d6b22005-11-10 14:26:52 +0000424static struct clk dsp_fck = {
425 .name = "dsp_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000426 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000427 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300428 .clkdm_name = "dsp_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200429 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
430 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
431 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
432 .clksel_mask = OMAP24XX_CLKSEL_DSP_MASK,
433 .clksel = dsp_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000434 .recalc = &omap2_clksel_recalc,
435};
436
Paul Walmsleye32744b2008-03-18 15:47:55 +0200437/* DSP interface clock */
438static const struct clksel_rate dsp_irate_ick_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600439 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200440 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
441 { .div = 3, .val = 3, .flags = RATE_IN_243X },
442 { .div = 0 },
443};
444
445static const struct clksel dsp_irate_ick_clksel[] = {
446 { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
447 { .parent = NULL }
448};
449
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300450/* This clock does not exist as such in the TRM. */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200451static struct clk dsp_irate_ick = {
452 .name = "dsp_irate_ick",
Russell King57137182008-11-04 16:48:35 +0000453 .ops = &clkops_null,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200454 .parent = &dsp_fck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200455 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
456 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
457 .clksel = dsp_irate_ick_clksel,
458 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200459};
460
Paul Walmsleye32744b2008-03-18 15:47:55 +0200461/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
462static struct clk iva2_1_ick = {
463 .name = "iva2_1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000464 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200465 .parent = &dsp_irate_ick,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200466 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
467 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000468};
469
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300470/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000471 * L3 clock domain
472 * L3 clocks are used for both interface and functional clocks to
473 * multiple entities. Some of these clocks are completely managed
474 * by hardware, and some others allow software control. Hardware
475 * managed ones general are based on directly CLK_REQ signals and
476 * various auto idle settings. The functional spec sets many of these
477 * as 'tie-high' for their enables.
478 *
479 * I-CLOCKS:
480 * L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
481 * CAM, HS-USB.
482 * F-CLOCK
483 * SSI.
484 *
485 * GPMC memories and SDRC have timing and clock sensitive registers which
486 * may very well need notification when the clock changes. Currently for low
487 * operating points, these are taken care of in sleep.S.
488 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200489static const struct clksel_rate core_l3_core_rates[] = {
490 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600491 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200492 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200493 { .div = 0 }
494};
495
496static const struct clksel core_l3_clksel[] = {
497 { .parent = &core_ck, .rates = core_l3_core_rates },
498 { .parent = NULL }
499};
500
Tony Lindgren046d6b22005-11-10 14:26:52 +0000501static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */
502 .name = "core_l3_ck",
Russell King897dcde2008-11-04 16:35:03 +0000503 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000504 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300505 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200506 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
507 .clksel_mask = OMAP24XX_CLKSEL_L3_MASK,
508 .clksel = core_l3_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000509 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200510};
511
512/* usb_l4_ick */
513static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
514 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600515 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200516 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
517 { .div = 0 }
518};
519
520static const struct clksel usb_l4_ick_clksel[] = {
521 { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates },
522 { .parent = NULL },
Tony Lindgren046d6b22005-11-10 14:26:52 +0000523};
524
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300525/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000526static struct clk usb_l4_ick = { /* FS-USB interface clock */
527 .name = "usb_l4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700528 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgrenfde0fd42006-01-17 15:31:18 -0800529 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300530 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200531 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
532 .enable_bit = OMAP24XX_EN_USB_SHIFT,
533 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
534 .clksel_mask = OMAP24XX_CLKSEL_USB_MASK,
535 .clksel = usb_l4_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000536 .recalc = &omap2_clksel_recalc,
537};
538
539/*
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300540 * L4 clock management domain
541 *
542 * This domain contains lots of interface clocks from the L4 interface, some
543 * functional clocks. Fixed APLL functional source clocks are managed in
544 * this domain.
545 */
546static const struct clksel_rate l4_core_l3_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600547 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300548 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
549 { .div = 0 }
550};
551
552static const struct clksel l4_clksel[] = {
553 { .parent = &core_l3_ck, .rates = l4_core_l3_rates },
554 { .parent = NULL }
555};
556
557static struct clk l4_ck = { /* used both as an ick and fck */
558 .name = "l4_ck",
Russell King897dcde2008-11-04 16:35:03 +0000559 .ops = &clkops_null,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300560 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300561 .clkdm_name = "core_l4_clkdm",
562 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
563 .clksel_mask = OMAP24XX_CLKSEL_L4_MASK,
564 .clksel = l4_clksel,
565 .recalc = &omap2_clksel_recalc,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300566};
567
568/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000569 * SSI is in L3 management domain, its direct parent is core not l3,
570 * many core power domain entities are grouped into the L3 clock
571 * domain.
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300572 * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK
Tony Lindgren046d6b22005-11-10 14:26:52 +0000573 *
574 * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
575 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200576static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
577 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600578 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200579 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
580 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
581 { .div = 5, .val = 5, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200582 { .div = 0 }
583};
584
585static const struct clksel ssi_ssr_sst_fck_clksel[] = {
586 { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates },
587 { .parent = NULL }
588};
589
Tony Lindgren046d6b22005-11-10 14:26:52 +0000590static struct clk ssi_ssr_sst_fck = {
591 .name = "ssi_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000592 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000593 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300594 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200595 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
596 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
597 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
598 .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK,
599 .clksel = ssi_ssr_sst_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000600 .recalc = &omap2_clksel_recalc,
601};
602
Paul Walmsley9299fd82009-01-27 19:12:54 -0700603/*
604 * Presumably this is the same as SSI_ICLK.
605 * TRM contradicts itself on what clockdomain SSI_ICLK is in
606 */
607static struct clk ssi_l4_ick = {
608 .name = "ssi_l4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700609 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley9299fd82009-01-27 19:12:54 -0700610 .parent = &l4_ck,
611 .clkdm_name = "core_l4_clkdm",
612 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
613 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
614 .recalc = &followparent_recalc,
615};
616
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300617
Tony Lindgren046d6b22005-11-10 14:26:52 +0000618/*
619 * GFX clock domain
620 * Clocks:
621 * GFX_FCLK, GFX_ICLK
622 * GFX_CG1(2d), GFX_CG2(3d)
623 *
624 * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
625 * The 2d and 3d clocks run at a hardware determined
626 * divided value of fclk.
627 *
628 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200629
630/* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */
631static const struct clksel gfx_fck_clksel[] = {
632 { .parent = &core_l3_ck, .rates = gfx_l3_rates },
633 { .parent = NULL },
634};
635
Tony Lindgren046d6b22005-11-10 14:26:52 +0000636static struct clk gfx_3d_fck = {
637 .name = "gfx_3d_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000638 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000639 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300640 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200641 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
642 .enable_bit = OMAP24XX_EN_3D_SHIFT,
643 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
644 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
645 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000646 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200647 .round_rate = &omap2_clksel_round_rate,
648 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000649};
650
651static struct clk gfx_2d_fck = {
652 .name = "gfx_2d_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000653 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000654 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300655 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200656 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
657 .enable_bit = OMAP24XX_EN_2D_SHIFT,
658 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
659 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
660 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000661 .recalc = &omap2_clksel_recalc,
662};
663
Paul Walmsleya1d55622011-02-25 15:39:30 -0700664/* This interface clock does not have a CM_AUTOIDLE bit */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000665static struct clk gfx_ick = {
666 .name = "gfx_ick", /* From l3 */
Russell Kingb36ee722008-11-04 17:59:52 +0000667 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000668 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300669 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200670 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
671 .enable_bit = OMAP_EN_GFX_SHIFT,
672 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000673};
674
675/*
676 * Modem clock domain (2430)
677 * CLOCKS:
678 * MDM_OSC_CLK
679 * MDM_ICLK
Paul Walmsleye32744b2008-03-18 15:47:55 +0200680 * These clocks are usable in chassis mode only.
Tony Lindgren046d6b22005-11-10 14:26:52 +0000681 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200682static const struct clksel_rate mdm_ick_core_rates[] = {
683 { .div = 1, .val = 1, .flags = RATE_IN_243X },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600684 { .div = 4, .val = 4, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200685 { .div = 6, .val = 6, .flags = RATE_IN_243X },
686 { .div = 9, .val = 9, .flags = RATE_IN_243X },
687 { .div = 0 }
688};
689
690static const struct clksel mdm_ick_clksel[] = {
691 { .parent = &core_ck, .rates = mdm_ick_core_rates },
692 { .parent = NULL }
693};
694
Tony Lindgren046d6b22005-11-10 14:26:52 +0000695static struct clk mdm_ick = { /* used both as a ick and fck */
696 .name = "mdm_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700697 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000698 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300699 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200700 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
701 .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
702 .clksel_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
703 .clksel_mask = OMAP2430_CLKSEL_MDM_MASK,
704 .clksel = mdm_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000705 .recalc = &omap2_clksel_recalc,
706};
707
708static struct clk mdm_osc_ck = {
709 .name = "mdm_osc_ck",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700710 .ops = &clkops_omap2_mdmclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000711 .parent = &osc_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300712 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200713 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
714 .enable_bit = OMAP2430_EN_OSC_SHIFT,
715 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000716};
717
718/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000719 * DSS clock domain
720 * CLOCKs:
721 * DSS_L4_ICLK, DSS_L3_ICLK,
722 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
723 *
724 * DSS is both initiator and target.
725 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200726/* XXX Add RATE_NOT_VALIDATED */
727
728static const struct clksel_rate dss1_fck_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600729 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200730 { .div = 0 }
731};
732
733static const struct clksel_rate dss1_fck_core_rates[] = {
734 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
735 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
736 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
737 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
738 { .div = 5, .val = 5, .flags = RATE_IN_24XX },
739 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
740 { .div = 8, .val = 8, .flags = RATE_IN_24XX },
741 { .div = 9, .val = 9, .flags = RATE_IN_24XX },
742 { .div = 12, .val = 12, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600743 { .div = 16, .val = 16, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200744 { .div = 0 }
745};
746
747static const struct clksel dss1_fck_clksel[] = {
748 { .parent = &sys_ck, .rates = dss1_fck_sys_rates },
749 { .parent = &core_ck, .rates = dss1_fck_core_rates },
750 { .parent = NULL },
751};
752
Tony Lindgren046d6b22005-11-10 14:26:52 +0000753static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
754 .name = "dss_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700755 .ops = &clkops_omap2_iclk_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000756 .parent = &l4_ck, /* really both l3 and l4 */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300757 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200758 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
759 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
760 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000761};
762
763static struct clk dss1_fck = {
764 .name = "dss1_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000765 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000766 .parent = &core_ck, /* Core or sys */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300767 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200768 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
769 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
770 .init = &omap2_init_clksel_parent,
771 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
772 .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK,
773 .clksel = dss1_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000774 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200775};
776
777static const struct clksel_rate dss2_fck_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600778 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200779 { .div = 0 }
780};
781
782static const struct clksel_rate dss2_fck_48m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600783 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200784 { .div = 0 }
785};
786
787static const struct clksel dss2_fck_clksel[] = {
788 { .parent = &sys_ck, .rates = dss2_fck_sys_rates },
789 { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
790 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000791};
792
793static struct clk dss2_fck = { /* Alt clk used in power management */
794 .name = "dss2_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000795 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000796 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300797 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200798 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
799 .enable_bit = OMAP24XX_EN_DSS2_SHIFT,
800 .init = &omap2_init_clksel_parent,
801 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
802 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
803 .clksel = dss2_fck_clksel,
Paul Walmsleyd4521f62010-12-21 21:08:14 -0700804 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000805};
806
807static struct clk dss_54m_fck = { /* Alt clk used in power management */
808 .name = "dss_54m_fck", /* 54m tv clk */
Russell Kingb36ee722008-11-04 17:59:52 +0000809 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000810 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300811 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200812 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
813 .enable_bit = OMAP24XX_EN_TV_SHIFT,
814 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000815};
816
Paul Walmsley19c1c0c2011-02-16 15:38:38 -0700817static struct clk wu_l4_ick = {
818 .name = "wu_l4_ick",
819 .ops = &clkops_null,
820 .parent = &sys_ck,
821 .clkdm_name = "wkup_clkdm",
822 .recalc = &followparent_recalc,
823};
824
Tony Lindgren046d6b22005-11-10 14:26:52 +0000825/*
826 * CORE power domain ICLK & FCLK defines.
827 * Many of the these can have more than one possible parent. Entries
828 * here will likely have an L4 interface parent, and may have multiple
829 * functional clock parents.
830 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200831static const struct clksel_rate gpt_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600832 { .div = 1, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200833 { .div = 0 }
834};
835
836static const struct clksel omap24xx_gpt_clksel[] = {
837 { .parent = &func_32k_ck, .rates = gpt_32k_rates },
838 { .parent = &sys_ck, .rates = gpt_sys_rates },
839 { .parent = &alt_ck, .rates = gpt_alt_rates },
840 { .parent = NULL },
841};
842
Tony Lindgren046d6b22005-11-10 14:26:52 +0000843static struct clk gpt1_ick = {
844 .name = "gpt1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700845 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -0700846 .parent = &wu_l4_ick,
847 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200848 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
849 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
850 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000851};
852
853static struct clk gpt1_fck = {
854 .name = "gpt1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000855 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000856 .parent = &func_32k_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(WKUP_MOD, CM_FCLKEN),
859 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
860 .init = &omap2_init_clksel_parent,
861 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
862 .clksel_mask = OMAP24XX_CLKSEL_GPT1_MASK,
863 .clksel = omap24xx_gpt_clksel,
864 .recalc = &omap2_clksel_recalc,
865 .round_rate = &omap2_clksel_round_rate,
866 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000867};
868
869static struct clk gpt2_ick = {
870 .name = "gpt2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700871 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000872 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300873 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200874 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
875 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
876 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000877};
878
879static struct clk gpt2_fck = {
880 .name = "gpt2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000881 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000882 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300883 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200884 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
885 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
886 .init = &omap2_init_clksel_parent,
887 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
888 .clksel_mask = OMAP24XX_CLKSEL_GPT2_MASK,
889 .clksel = omap24xx_gpt_clksel,
890 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000891};
892
893static struct clk gpt3_ick = {
894 .name = "gpt3_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700895 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000896 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300897 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200898 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
899 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
900 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000901};
902
903static struct clk gpt3_fck = {
904 .name = "gpt3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000905 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000906 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300907 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200908 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
909 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
910 .init = &omap2_init_clksel_parent,
911 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
912 .clksel_mask = OMAP24XX_CLKSEL_GPT3_MASK,
913 .clksel = omap24xx_gpt_clksel,
914 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000915};
916
917static struct clk gpt4_ick = {
918 .name = "gpt4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700919 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000920 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300921 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200922 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
923 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
924 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000925};
926
927static struct clk gpt4_fck = {
928 .name = "gpt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000929 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000930 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300931 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200932 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
933 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
934 .init = &omap2_init_clksel_parent,
935 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
936 .clksel_mask = OMAP24XX_CLKSEL_GPT4_MASK,
937 .clksel = omap24xx_gpt_clksel,
938 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000939};
940
941static struct clk gpt5_ick = {
942 .name = "gpt5_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700943 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000944 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300945 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200946 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
947 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
948 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000949};
950
951static struct clk gpt5_fck = {
952 .name = "gpt5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000953 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000954 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300955 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200956 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
957 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
958 .init = &omap2_init_clksel_parent,
959 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
960 .clksel_mask = OMAP24XX_CLKSEL_GPT5_MASK,
961 .clksel = omap24xx_gpt_clksel,
962 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000963};
964
965static struct clk gpt6_ick = {
966 .name = "gpt6_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700967 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000968 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300969 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200970 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
971 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
972 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000973};
974
975static struct clk gpt6_fck = {
976 .name = "gpt6_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000977 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000978 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300979 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200980 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
981 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
982 .init = &omap2_init_clksel_parent,
983 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
984 .clksel_mask = OMAP24XX_CLKSEL_GPT6_MASK,
985 .clksel = omap24xx_gpt_clksel,
986 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000987};
988
989static struct clk gpt7_ick = {
990 .name = "gpt7_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700991 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000992 .parent = &l4_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200993 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
994 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
995 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000996};
997
998static struct clk gpt7_fck = {
999 .name = "gpt7_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001000 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001001 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001002 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001003 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1004 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
1005 .init = &omap2_init_clksel_parent,
1006 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1007 .clksel_mask = OMAP24XX_CLKSEL_GPT7_MASK,
1008 .clksel = omap24xx_gpt_clksel,
1009 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001010};
1011
1012static struct clk gpt8_ick = {
1013 .name = "gpt8_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001014 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001015 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001016 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001017 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1018 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1019 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001020};
1021
1022static struct clk gpt8_fck = {
1023 .name = "gpt8_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001024 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001025 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001026 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001027 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1028 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1029 .init = &omap2_init_clksel_parent,
1030 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1031 .clksel_mask = OMAP24XX_CLKSEL_GPT8_MASK,
1032 .clksel = omap24xx_gpt_clksel,
1033 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001034};
1035
1036static struct clk gpt9_ick = {
1037 .name = "gpt9_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001038 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001039 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001040 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001041 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1042 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1043 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001044};
1045
1046static struct clk gpt9_fck = {
1047 .name = "gpt9_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001048 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001049 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001050 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001051 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1052 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1053 .init = &omap2_init_clksel_parent,
1054 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1055 .clksel_mask = OMAP24XX_CLKSEL_GPT9_MASK,
1056 .clksel = omap24xx_gpt_clksel,
1057 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001058};
1059
1060static struct clk gpt10_ick = {
1061 .name = "gpt10_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001062 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001063 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001064 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001065 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1066 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1067 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001068};
1069
1070static struct clk gpt10_fck = {
1071 .name = "gpt10_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001072 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001073 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001074 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001075 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1076 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1077 .init = &omap2_init_clksel_parent,
1078 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1079 .clksel_mask = OMAP24XX_CLKSEL_GPT10_MASK,
1080 .clksel = omap24xx_gpt_clksel,
1081 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001082};
1083
1084static struct clk gpt11_ick = {
1085 .name = "gpt11_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001086 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001087 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001088 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001089 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1090 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1091 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001092};
1093
1094static struct clk gpt11_fck = {
1095 .name = "gpt11_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001096 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001097 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001098 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001099 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1100 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1101 .init = &omap2_init_clksel_parent,
1102 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1103 .clksel_mask = OMAP24XX_CLKSEL_GPT11_MASK,
1104 .clksel = omap24xx_gpt_clksel,
1105 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001106};
1107
1108static struct clk gpt12_ick = {
1109 .name = "gpt12_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001110 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001111 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001112 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001113 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1114 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1115 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001116};
1117
1118static struct clk gpt12_fck = {
1119 .name = "gpt12_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001120 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyf2480762009-04-23 21:11:10 -06001121 .parent = &secure_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001122 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001123 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1124 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1125 .init = &omap2_init_clksel_parent,
1126 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1127 .clksel_mask = OMAP24XX_CLKSEL_GPT12_MASK,
1128 .clksel = omap24xx_gpt_clksel,
1129 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001130};
1131
1132static struct clk mcbsp1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001133 .name = "mcbsp1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001134 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001135 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001136 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001137 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1138 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1139 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001140};
1141
Paul Walmsleyb115b742010-10-08 11:40:18 -06001142static const struct clksel_rate common_mcbsp_96m_rates[] = {
1143 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
1144 { .div = 0 }
1145};
1146
1147static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
1148 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
1149 { .div = 0 }
1150};
1151
1152static const struct clksel mcbsp_fck_clksel[] = {
1153 { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates },
1154 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
1155 { .parent = NULL }
1156};
1157
Tony Lindgren046d6b22005-11-10 14:26:52 +00001158static struct clk mcbsp1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001159 .name = "mcbsp1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001160 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001161 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001162 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001163 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001164 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1165 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001166 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1167 .clksel_mask = OMAP2_MCBSP1_CLKS_MASK,
1168 .clksel = mcbsp_fck_clksel,
1169 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001170};
1171
1172static struct clk mcbsp2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001173 .name = "mcbsp2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001174 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001175 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001176 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001177 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1178 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1179 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001180};
1181
1182static struct clk mcbsp2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001183 .name = "mcbsp2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001184 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001185 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001186 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001187 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001188 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1189 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001190 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1191 .clksel_mask = OMAP2_MCBSP2_CLKS_MASK,
1192 .clksel = mcbsp_fck_clksel,
1193 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001194};
1195
1196static struct clk mcbsp3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001197 .name = "mcbsp3_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001198 .ops = &clkops_omap2_iclk_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_MCBSP3_SHIFT,
1203 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001204};
1205
1206static struct clk mcbsp3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001207 .name = "mcbsp3_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 Walmsleyb115b742010-10-08 11:40:18 -06001210 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001211 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001212 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1213 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001214 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1215 .clksel_mask = OMAP2_MCBSP3_CLKS_MASK,
1216 .clksel = mcbsp_fck_clksel,
1217 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001218};
1219
1220static struct clk mcbsp4_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001221 .name = "mcbsp4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001222 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001223 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001224 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001225 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1226 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1227 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001228};
1229
1230static struct clk mcbsp4_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001231 .name = "mcbsp4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001232 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001233 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001234 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001235 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001236 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1237 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001238 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1239 .clksel_mask = OMAP2_MCBSP4_CLKS_MASK,
1240 .clksel = mcbsp_fck_clksel,
1241 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001242};
1243
1244static struct clk mcbsp5_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001245 .name = "mcbsp5_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001246 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001247 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001248 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001249 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1250 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1251 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001252};
1253
1254static struct clk mcbsp5_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001255 .name = "mcbsp5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001256 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001257 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001258 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001259 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001260 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1261 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001262 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1263 .clksel_mask = OMAP2_MCBSP5_CLKS_MASK,
1264 .clksel = mcbsp_fck_clksel,
1265 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001266};
1267
1268static struct clk mcspi1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001269 .name = "mcspi1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001270 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001271 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001272 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001273 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1274 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1275 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001276};
1277
1278static struct clk mcspi1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001279 .name = "mcspi1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001280 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001281 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001282 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001283 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1284 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1285 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001286};
1287
1288static struct clk mcspi2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001289 .name = "mcspi2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001290 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001291 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001292 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001293 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1294 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1295 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001296};
1297
1298static struct clk mcspi2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001299 .name = "mcspi2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001300 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001301 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001302 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001303 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1304 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1305 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001306};
1307
1308static struct clk mcspi3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001309 .name = "mcspi3_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001310 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001311 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001312 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001313 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1314 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1315 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001316};
1317
1318static struct clk mcspi3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001319 .name = "mcspi3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001320 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001321 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001322 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001323 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1324 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1325 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001326};
1327
1328static struct clk uart1_ick = {
1329 .name = "uart1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001330 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001331 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001332 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001333 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1334 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1335 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001336};
1337
1338static struct clk uart1_fck = {
1339 .name = "uart1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001340 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001341 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001342 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001343 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1344 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1345 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001346};
1347
1348static struct clk uart2_ick = {
1349 .name = "uart2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001350 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001351 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001352 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001353 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1354 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1355 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001356};
1357
1358static struct clk uart2_fck = {
1359 .name = "uart2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001360 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001361 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001362 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001363 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1364 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1365 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001366};
1367
1368static struct clk uart3_ick = {
1369 .name = "uart3_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001370 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001371 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001372 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001373 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1374 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1375 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001376};
1377
1378static struct clk uart3_fck = {
1379 .name = "uart3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001380 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001381 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001382 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001383 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1384 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1385 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001386};
1387
1388static struct clk gpios_ick = {
1389 .name = "gpios_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001390 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001391 .parent = &wu_l4_ick,
1392 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001393 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1394 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1395 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001396};
1397
1398static struct clk gpios_fck = {
1399 .name = "gpios_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001400 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001401 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001402 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001403 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1404 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1405 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001406};
1407
1408static struct clk mpu_wdt_ick = {
1409 .name = "mpu_wdt_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001410 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001411 .parent = &wu_l4_ick,
1412 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001413 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1414 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1415 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001416};
1417
1418static struct clk mpu_wdt_fck = {
1419 .name = "mpu_wdt_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001420 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001421 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001422 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001423 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1424 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1425 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001426};
1427
1428static struct clk sync_32k_ick = {
1429 .name = "sync_32k_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001430 .ops = &clkops_omap2_iclk_dflt_wait,
Russell King8ad8ff62009-01-19 15:27:29 +00001431 .flags = ENABLE_ON_INIT,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001432 .parent = &wu_l4_ick,
1433 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001434 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1435 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
1436 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001437};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001438
Tony Lindgren046d6b22005-11-10 14:26:52 +00001439static struct clk wdt1_ick = {
1440 .name = "wdt1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001441 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001442 .parent = &wu_l4_ick,
1443 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001444 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1445 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
1446 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001447};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001448
Tony Lindgren046d6b22005-11-10 14:26:52 +00001449static struct clk omapctrl_ick = {
1450 .name = "omapctrl_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001451 .ops = &clkops_omap2_iclk_dflt_wait,
Russell King8ad8ff62009-01-19 15:27:29 +00001452 .flags = ENABLE_ON_INIT,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001453 .parent = &wu_l4_ick,
1454 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001455 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1456 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
1457 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001458};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001459
Tony Lindgren046d6b22005-11-10 14:26:52 +00001460static struct clk icr_ick = {
1461 .name = "icr_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001462 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001463 .parent = &wu_l4_ick,
1464 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001465 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1466 .enable_bit = OMAP2430_EN_ICR_SHIFT,
1467 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001468};
1469
1470static struct clk cam_ick = {
1471 .name = "cam_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001472 .ops = &clkops_omap2_iclk_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001473 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001474 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001475 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1476 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1477 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001478};
1479
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001480/*
1481 * cam_fck controls both CAM_MCLK and CAM_FCLK. It should probably be
1482 * split into two separate clocks, since the parent clocks are different
1483 * and the clockdomains are also different.
1484 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001485static struct clk cam_fck = {
1486 .name = "cam_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00001487 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001488 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001489 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001490 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1491 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1492 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001493};
1494
1495static struct clk mailboxes_ick = {
1496 .name = "mailboxes_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001497 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001498 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001499 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001500 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1501 .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
1502 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001503};
1504
1505static struct clk wdt4_ick = {
1506 .name = "wdt4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001507 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001508 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001509 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001510 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1511 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1512 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001513};
1514
1515static struct clk wdt4_fck = {
1516 .name = "wdt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001517 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001518 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001519 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001520 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1521 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1522 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001523};
1524
Tony Lindgren046d6b22005-11-10 14:26:52 +00001525static struct clk mspro_ick = {
1526 .name = "mspro_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001527 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001528 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001529 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001530 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1531 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1532 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001533};
1534
1535static struct clk mspro_fck = {
1536 .name = "mspro_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001537 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001538 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001539 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001540 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1541 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1542 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001543};
1544
Tony Lindgren046d6b22005-11-10 14:26:52 +00001545static struct clk fac_ick = {
1546 .name = "fac_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001547 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001548 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001549 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001550 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1551 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1552 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001553};
1554
1555static struct clk fac_fck = {
1556 .name = "fac_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001557 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001558 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001559 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001560 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1561 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1562 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001563};
1564
Tony Lindgren046d6b22005-11-10 14:26:52 +00001565static struct clk hdq_ick = {
1566 .name = "hdq_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001567 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001568 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001569 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001570 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1571 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1572 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001573};
1574
1575static struct clk hdq_fck = {
1576 .name = "hdq_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001577 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001578 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001579 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001580 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1581 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1582 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001583};
1584
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001585/*
1586 * XXX This is marked as a 2420-only define, but it claims to be present
1587 * on 2430 also. Double-check.
1588 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001589static struct clk i2c2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001590 .name = "i2c2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001591 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001592 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001593 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001594 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1595 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
1596 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001597};
1598
Tony Lindgren046d6b22005-11-10 14:26:52 +00001599static struct clk i2chs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001600 .name = "i2chs2_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001601 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001602 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001603 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001604 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1605 .enable_bit = OMAP2430_EN_I2CHS2_SHIFT,
1606 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001607};
1608
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001609/*
1610 * XXX This is marked as a 2420-only define, but it claims to be present
1611 * on 2430 also. Double-check.
1612 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001613static struct clk i2c1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001614 .name = "i2c1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001615 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001616 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001617 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001618 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1619 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
1620 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001621};
1622
Tony Lindgren046d6b22005-11-10 14:26:52 +00001623static struct clk i2chs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001624 .name = "i2chs1_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001625 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001626 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001627 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001628 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1629 .enable_bit = OMAP2430_EN_I2CHS1_SHIFT,
1630 .recalc = &followparent_recalc,
1631};
1632
Paul Walmsleya1d55622011-02-25 15:39:30 -07001633/*
1634 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1635 * accesses derived from this data.
1636 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001637static struct clk gpmc_fck = {
1638 .name = "gpmc_fck",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001639 .ops = &clkops_omap2_iclk_idle_only,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001640 .parent = &core_l3_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001641 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001642 .clkdm_name = "core_l3_clkdm",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001643 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1644 .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001645 .recalc = &followparent_recalc,
1646};
1647
1648static struct clk sdma_fck = {
1649 .name = "sdma_fck",
Russell King897dcde2008-11-04 16:35:03 +00001650 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001651 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001652 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001653 .recalc = &followparent_recalc,
1654};
1655
Paul Walmsleya1d55622011-02-25 15:39:30 -07001656/*
1657 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1658 * accesses derived from this data.
1659 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001660static struct clk sdma_ick = {
1661 .name = "sdma_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001662 .ops = &clkops_omap2_iclk_idle_only,
Paul Walmsleya1fed572011-02-25 15:51:02 -07001663 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001664 .clkdm_name = "core_l3_clkdm",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001665 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1666 .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001667 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001668};
1669
Tony Lindgren046d6b22005-11-10 14:26:52 +00001670static struct clk sdrc_ick = {
1671 .name = "sdrc_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001672 .ops = &clkops_omap2_iclk_idle_only,
Paul Walmsleya1fed572011-02-25 15:51:02 -07001673 .parent = &core_l3_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001674 .flags = ENABLE_ON_INIT,
Paul Walmsleya1fed572011-02-25 15:51:02 -07001675 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001676 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1677 .enable_bit = OMAP2430_EN_SDRC_SHIFT,
1678 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001679};
1680
1681static struct clk des_ick = {
1682 .name = "des_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001683 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001684 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001685 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001686 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1687 .enable_bit = OMAP24XX_EN_DES_SHIFT,
1688 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001689};
1690
1691static struct clk sha_ick = {
1692 .name = "sha_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001693 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001694 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001695 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001696 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1697 .enable_bit = OMAP24XX_EN_SHA_SHIFT,
1698 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001699};
1700
1701static struct clk rng_ick = {
1702 .name = "rng_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001703 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001704 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001705 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001706 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1707 .enable_bit = OMAP24XX_EN_RNG_SHIFT,
1708 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001709};
1710
1711static struct clk aes_ick = {
1712 .name = "aes_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001713 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001714 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001715 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001716 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1717 .enable_bit = OMAP24XX_EN_AES_SHIFT,
1718 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001719};
1720
1721static struct clk pka_ick = {
1722 .name = "pka_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001723 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001724 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001725 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001726 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1727 .enable_bit = OMAP24XX_EN_PKA_SHIFT,
1728 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001729};
1730
1731static struct clk usb_fck = {
1732 .name = "usb_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001733 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001734 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001735 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001736 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1737 .enable_bit = OMAP24XX_EN_USB_SHIFT,
1738 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001739};
1740
1741static struct clk usbhs_ick = {
1742 .name = "usbhs_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001743 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgrenfde0fd42006-01-17 15:31:18 -08001744 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001745 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001746 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1747 .enable_bit = OMAP2430_EN_USBHS_SHIFT,
1748 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001749};
1750
1751static struct clk mmchs1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001752 .name = "mmchs1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001753 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001754 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001755 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001756 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1757 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1758 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001759};
1760
1761static struct clk mmchs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001762 .name = "mmchs1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001763 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001764 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001765 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001766 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1767 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1768 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001769};
1770
1771static struct clk mmchs2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001772 .name = "mmchs2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001773 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001774 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001775 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001776 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1777 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1778 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001779};
1780
1781static struct clk mmchs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001782 .name = "mmchs2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001783 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001784 .parent = &func_96m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001785 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1786 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1787 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001788};
1789
1790static struct clk gpio5_ick = {
1791 .name = "gpio5_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001792 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001793 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001794 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001795 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1796 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1797 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001798};
1799
1800static struct clk gpio5_fck = {
1801 .name = "gpio5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001802 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001803 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001804 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001805 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1806 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1807 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001808};
1809
1810static struct clk mdm_intc_ick = {
1811 .name = "mdm_intc_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001812 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001813 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001814 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001815 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1816 .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT,
1817 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001818};
1819
1820static struct clk mmchsdb1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001821 .name = "mmchsdb1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001822 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001823 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001824 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001825 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1826 .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT,
1827 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001828};
1829
1830static struct clk mmchsdb2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001831 .name = "mmchsdb2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001832 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001833 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001834 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001835 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1836 .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT,
1837 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001838};
Paul Walmsleye32744b2008-03-18 15:47:55 +02001839
Tony Lindgren046d6b22005-11-10 14:26:52 +00001840/*
1841 * This clock is a composite clock which does entire set changes then
1842 * forces a rebalance. It keys on the MPU speed, but it really could
1843 * be any key speed part of a set in the rate table.
1844 *
1845 * to really change a set, you need memory table sets which get changed
1846 * in sram, pre-notifiers & post notifiers, changing the top set, without
1847 * having low level display recalc's won't work... this is why dpm notifiers
1848 * work, isr's off, walk a list of clocks already _off_ and not messing with
1849 * the bus.
1850 *
1851 * This clock should have no parent. It embodies the entire upper level
1852 * active set. A parent will mess up some of the init also.
1853 */
1854static struct clk virt_prcm_set = {
1855 .name = "virt_prcm_set",
Russell King897dcde2008-11-04 16:35:03 +00001856 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001857 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001858 .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001859 .set_rate = &omap2_select_table_rate,
1860 .round_rate = &omap2_round_to_table_rate,
1861};
Paul Walmsleye32744b2008-03-18 15:47:55 +02001862
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001863
1864/*
1865 * clkdev integration
1866 */
1867
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001868static struct omap_clk omap2430_clks[] = {
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001869 /* external root sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001870 CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X),
1871 CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X),
1872 CLK(NULL, "osc_ck", &osc_ck, CK_243X),
1873 CLK(NULL, "sys_ck", &sys_ck, CK_243X),
1874 CLK(NULL, "alt_ck", &alt_ck, CK_243X),
Paul Walmsleyb115b742010-10-08 11:40:18 -06001875 CLK("omap-mcbsp.1", "pad_fck", &mcbsp_clks, CK_243X),
1876 CLK("omap-mcbsp.2", "pad_fck", &mcbsp_clks, CK_243X),
1877 CLK("omap-mcbsp.3", "pad_fck", &mcbsp_clks, CK_243X),
1878 CLK("omap-mcbsp.4", "pad_fck", &mcbsp_clks, CK_243X),
1879 CLK("omap-mcbsp.5", "pad_fck", &mcbsp_clks, CK_243X),
1880 CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001881 /* internal analog sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001882 CLK(NULL, "dpll_ck", &dpll_ck, CK_243X),
1883 CLK(NULL, "apll96_ck", &apll96_ck, CK_243X),
1884 CLK(NULL, "apll54_ck", &apll54_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001885 /* internal prcm root sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001886 CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X),
1887 CLK(NULL, "core_ck", &core_ck, CK_243X),
Paul Walmsleyb115b742010-10-08 11:40:18 -06001888 CLK("omap-mcbsp.1", "prcm_fck", &func_96m_ck, CK_243X),
1889 CLK("omap-mcbsp.2", "prcm_fck", &func_96m_ck, CK_243X),
1890 CLK("omap-mcbsp.3", "prcm_fck", &func_96m_ck, CK_243X),
1891 CLK("omap-mcbsp.4", "prcm_fck", &func_96m_ck, CK_243X),
1892 CLK("omap-mcbsp.5", "prcm_fck", &func_96m_ck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001893 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X),
1894 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X),
1895 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X),
1896 CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X),
1897 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X),
1898 CLK(NULL, "sys_clkout", &sys_clkout, CK_243X),
1899 CLK(NULL, "emul_ck", &emul_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001900 /* mpu domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001901 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001902 /* dsp domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001903 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X),
1904 CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001905 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001906 /* GFX domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001907 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X),
1908 CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X),
1909 CLK(NULL, "gfx_ick", &gfx_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001910 /* Modem domain clocks */
1911 CLK(NULL, "mdm_ick", &mdm_ick, CK_243X),
1912 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
1913 /* DSS domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001914 CLK("omapdss", "ick", &dss_ick, CK_243X),
1915 CLK("omapdss", "dss1_fck", &dss1_fck, CK_243X),
1916 CLK("omapdss", "dss2_fck", &dss2_fck, CK_243X),
1917 CLK("omapdss", "tv_fck", &dss_54m_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001918 /* L3 domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001919 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X),
1920 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X),
1921 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001922 /* L4 domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001923 CLK(NULL, "l4_ck", &l4_ck, CK_243X),
1924 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X),
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001925 CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001926 /* virtual meta-group clock */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001927 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001928 /* general l4 interface ck, multi-parent functional clk */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001929 CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X),
1930 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X),
1931 CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X),
1932 CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X),
1933 CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X),
1934 CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X),
1935 CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X),
1936 CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X),
1937 CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X),
1938 CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X),
1939 CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X),
1940 CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X),
1941 CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X),
1942 CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X),
1943 CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X),
1944 CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X),
1945 CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X),
1946 CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X),
1947 CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X),
1948 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X),
1949 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X),
1950 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X),
1951 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X),
1952 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X),
1953 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X),
1954 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X),
1955 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X),
1956 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001957 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
1958 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X),
1959 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
1960 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X),
1961 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
1962 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001963 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X),
1964 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X),
1965 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X),
1966 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001967 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
1968 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001969 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X),
1970 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X),
1971 CLK(NULL, "uart2_ick", &uart2_ick, CK_243X),
1972 CLK(NULL, "uart2_fck", &uart2_fck, CK_243X),
1973 CLK(NULL, "uart3_ick", &uart3_ick, CK_243X),
1974 CLK(NULL, "uart3_fck", &uart3_fck, CK_243X),
1975 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X),
1976 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X),
1977 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X),
1978 CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X),
1979 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X),
1980 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X),
1981 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001982 CLK(NULL, "icr_ick", &icr_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001983 CLK("omap24xxcam", "fck", &cam_fck, CK_243X),
1984 CLK("omap24xxcam", "ick", &cam_ick, CK_243X),
1985 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X),
1986 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X),
1987 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X),
1988 CLK(NULL, "mspro_ick", &mspro_ick, CK_243X),
1989 CLK(NULL, "mspro_fck", &mspro_fck, CK_243X),
1990 CLK(NULL, "fac_ick", &fac_ick, CK_243X),
1991 CLK(NULL, "fac_fck", &fac_fck, CK_243X),
1992 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X),
1993 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X),
Benoit Coussonf7bb0d92010-12-09 14:24:16 +00001994 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X),
1995 CLK("omap_i2c.1", "fck", &i2chs1_fck, CK_243X),
1996 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X),
1997 CLK("omap_i2c.2", "fck", &i2chs2_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001998 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X),
1999 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X),
2000 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002001 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002002 CLK(NULL, "des_ick", &des_ick, CK_243X),
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +08002003 CLK("omap-sham", "ick", &sha_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002004 CLK("omap_rng", "ick", &rng_ick, CK_243X),
Dmitry Kasatkin82a0c142010-08-20 13:44:46 +00002005 CLK("omap-aes", "ick", &aes_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002006 CLK(NULL, "pka_ick", &pka_ick, CK_243X),
2007 CLK(NULL, "usb_fck", &usb_fck, CK_243X),
Felipe Balbi03491762010-12-02 09:57:08 +02002008 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002009 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X),
2010 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X),
2011 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X),
2012 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X),
2013 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
2014 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
2015 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
2016 CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
2017 CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
2018};
2019
2020/*
2021 * init code
2022 */
2023
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002024int __init omap2430_clk_init(void)
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002025{
2026 const struct prcm_config *prcm;
2027 struct omap_clk *c;
2028 u32 clkrate;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002029
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002030 prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
2031 cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST);
2032 cpu_mask = RATE_IN_243X;
2033 rate_table = omap2430_rate_table;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002034
2035 clk_init(&omap2_clk_functions);
2036
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002037 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
2038 c++)
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002039 clk_preinit(c->lk.clk);
2040
2041 osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
2042 propagate_rate(&osc_ck);
Paul Walmsley44da0a52010-01-26 20:13:08 -07002043 sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck);
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002044 propagate_rate(&sys_ck);
2045
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002046 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
2047 c++) {
2048 clkdev_add(&c->lk);
2049 clk_register(c->lk.clk);
2050 omap2_init_clk_clkdm(c->lk.clk);
2051 }
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002052
Paul Walmsleyc6461f52011-02-25 15:49:53 -07002053 /* Disable autoidle on all clocks; let the PM code enable it later */
2054 omap_clk_disable_autoidle_all();
2055
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002056 /* Check the MPU rate set by bootloader */
2057 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
2058 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
2059 if (!(prcm->flags & cpu_mask))
2060 continue;
2061 if (prcm->xtal_speed != sys_ck.rate)
2062 continue;
2063 if (prcm->dpll_speed <= clkrate)
2064 break;
2065 }
2066 curr_prcm_set = prcm;
2067
2068 recalculate_root_clocks();
2069
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002070 pr_info("Clocking rate (Crystal/DPLL/MPU): %ld.%01ld/%ld/%ld MHz\n",
2071 (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
2072 (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002073
2074 /*
2075 * Only enable those clocks we will need, let the drivers
2076 * enable other clocks as necessary
2077 */
2078 clk_enable_init_clocks();
2079
2080 /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
2081 vclk = clk_get(NULL, "virt_prcm_set");
2082 sclk = clk_get(NULL, "sys_ck");
2083 dclk = clk_get(NULL, "dpll_ck");
2084
2085 return 0;
2086}
Paul Walmsley6b8858a2008-03-18 10:35:15 +02002087