blob: 454831966d338bc3d64f1e8ede2c8e25ad7e84c4 [file] [log] [blame]
Tony Lindgren046d6b22005-11-10 14:26:52 +00001/*
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002 * linux/arch/arm/mach-omap2/clock2430_data.c
Tony Lindgren046d6b22005-11-10 14:26:52 +00003 *
Paul Walmsleyd8a94452009-12-08 16:21:29 -07004 * Copyright (C) 2005-2009 Texas Instruments, Inc.
Paul Walmsley93340a22010-02-22 22:09:12 -07005 * Copyright (C) 2004-2010 Nokia Corporation
Tony Lindgrena16e9702008-03-18 11:56:39 +02006 *
7 * Contacts:
Tony Lindgren046d6b22005-11-10 14:26:52 +00008 * Richard Woodruff <r-woodruff2@ti.com>
Tony Lindgrena16e9702008-03-18 11:56:39 +02009 * Paul Walmsley
Tony Lindgren046d6b22005-11-10 14:26:52 +000010 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
Paul Walmsleyd8a94452009-12-08 16:21:29 -070016#include <linux/kernel.h>
17#include <linux/clk.h>
Paul Walmsley93340a22010-02-22 22:09:12 -070018#include <linux/list.h>
Paul Walmsleyd8a94452009-12-08 16:21:29 -070019
20#include <plat/clkdev_omap.h>
Paul Walmsleyb115b742010-10-08 11:40:18 -060021#include <plat/control.h>
Tony Lindgren046d6b22005-11-10 14:26:52 +000022
Paul Walmsley6b8858a2008-03-18 10:35:15 +020023#include "clock.h"
Paul Walmsleyd8a94452009-12-08 16:21:29 -070024#include "clock2xxx.h"
25#include "opp2xxx.h"
Paul Walmsley6b8858a2008-03-18 10:35:15 +020026#include "prm.h"
27#include "cm.h"
28#include "prm-regbits-24xx.h"
29#include "cm-regbits-24xx.h"
30#include "sdrc.h"
31
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,
Tony Lindgren046d6b22005-11-10 14:26:52 +000058 .rate = 32000,
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",
Russell King897dcde2008-11-04 16:35:03 +0000128 .ops = &clkops_null,
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",
Russell Kingb36ee722008-11-04 17:59:52 +0000528 .ops = &clkops_omap2_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",
609 .ops = &clkops_omap2_dflt_wait,
610 .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
664static struct clk gfx_ick = {
665 .name = "gfx_ick", /* From l3 */
Russell Kingb36ee722008-11-04 17:59:52 +0000666 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000667 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300668 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200669 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
670 .enable_bit = OMAP_EN_GFX_SHIFT,
671 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000672};
673
674/*
675 * Modem clock domain (2430)
676 * CLOCKS:
677 * MDM_OSC_CLK
678 * MDM_ICLK
Paul Walmsleye32744b2008-03-18 15:47:55 +0200679 * These clocks are usable in chassis mode only.
Tony Lindgren046d6b22005-11-10 14:26:52 +0000680 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200681static const struct clksel_rate mdm_ick_core_rates[] = {
682 { .div = 1, .val = 1, .flags = RATE_IN_243X },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600683 { .div = 4, .val = 4, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200684 { .div = 6, .val = 6, .flags = RATE_IN_243X },
685 { .div = 9, .val = 9, .flags = RATE_IN_243X },
686 { .div = 0 }
687};
688
689static const struct clksel mdm_ick_clksel[] = {
690 { .parent = &core_ck, .rates = mdm_ick_core_rates },
691 { .parent = NULL }
692};
693
Tony Lindgren046d6b22005-11-10 14:26:52 +0000694static struct clk mdm_ick = { /* used both as a ick and fck */
695 .name = "mdm_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000696 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000697 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300698 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200699 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
700 .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
701 .clksel_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
702 .clksel_mask = OMAP2430_CLKSEL_MDM_MASK,
703 .clksel = mdm_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000704 .recalc = &omap2_clksel_recalc,
705};
706
707static struct clk mdm_osc_ck = {
708 .name = "mdm_osc_ck",
Russell Kingb36ee722008-11-04 17:59:52 +0000709 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000710 .parent = &osc_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300711 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200712 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
713 .enable_bit = OMAP2430_EN_OSC_SHIFT,
714 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000715};
716
717/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000718 * DSS clock domain
719 * CLOCKs:
720 * DSS_L4_ICLK, DSS_L3_ICLK,
721 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
722 *
723 * DSS is both initiator and target.
724 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200725/* XXX Add RATE_NOT_VALIDATED */
726
727static const struct clksel_rate dss1_fck_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600728 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200729 { .div = 0 }
730};
731
732static const struct clksel_rate dss1_fck_core_rates[] = {
733 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
734 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
735 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
736 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
737 { .div = 5, .val = 5, .flags = RATE_IN_24XX },
738 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
739 { .div = 8, .val = 8, .flags = RATE_IN_24XX },
740 { .div = 9, .val = 9, .flags = RATE_IN_24XX },
741 { .div = 12, .val = 12, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600742 { .div = 16, .val = 16, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200743 { .div = 0 }
744};
745
746static const struct clksel dss1_fck_clksel[] = {
747 { .parent = &sys_ck, .rates = dss1_fck_sys_rates },
748 { .parent = &core_ck, .rates = dss1_fck_core_rates },
749 { .parent = NULL },
750};
751
Tony Lindgren046d6b22005-11-10 14:26:52 +0000752static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
753 .name = "dss_ick",
Russell Kingbc51da42008-11-04 18:59:32 +0000754 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000755 .parent = &l4_ck, /* really both l3 and l4 */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300756 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200757 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
758 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
759 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000760};
761
762static struct clk dss1_fck = {
763 .name = "dss1_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000764 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000765 .parent = &core_ck, /* Core or sys */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300766 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200767 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
768 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
769 .init = &omap2_init_clksel_parent,
770 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
771 .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK,
772 .clksel = dss1_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000773 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200774};
775
776static const struct clksel_rate dss2_fck_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600777 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200778 { .div = 0 }
779};
780
781static const struct clksel_rate dss2_fck_48m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600782 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200783 { .div = 0 }
784};
785
786static const struct clksel dss2_fck_clksel[] = {
787 { .parent = &sys_ck, .rates = dss2_fck_sys_rates },
788 { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
789 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000790};
791
792static struct clk dss2_fck = { /* Alt clk used in power management */
793 .name = "dss2_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000794 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000795 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300796 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200797 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
798 .enable_bit = OMAP24XX_EN_DSS2_SHIFT,
799 .init = &omap2_init_clksel_parent,
800 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
801 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
802 .clksel = dss2_fck_clksel,
803 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000804};
805
806static struct clk dss_54m_fck = { /* Alt clk used in power management */
807 .name = "dss_54m_fck", /* 54m tv clk */
Russell Kingb36ee722008-11-04 17:59:52 +0000808 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000809 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300810 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200811 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
812 .enable_bit = OMAP24XX_EN_TV_SHIFT,
813 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000814};
815
816/*
817 * CORE power domain ICLK & FCLK defines.
818 * Many of the these can have more than one possible parent. Entries
819 * here will likely have an L4 interface parent, and may have multiple
820 * functional clock parents.
821 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200822static const struct clksel_rate gpt_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600823 { .div = 1, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200824 { .div = 0 }
825};
826
827static const struct clksel omap24xx_gpt_clksel[] = {
828 { .parent = &func_32k_ck, .rates = gpt_32k_rates },
829 { .parent = &sys_ck, .rates = gpt_sys_rates },
830 { .parent = &alt_ck, .rates = gpt_alt_rates },
831 { .parent = NULL },
832};
833
Tony Lindgren046d6b22005-11-10 14:26:52 +0000834static struct clk gpt1_ick = {
835 .name = "gpt1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000836 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000837 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300838 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200839 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
840 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
841 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000842};
843
844static struct clk gpt1_fck = {
845 .name = "gpt1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000846 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000847 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300848 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200849 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
850 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
851 .init = &omap2_init_clksel_parent,
852 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
853 .clksel_mask = OMAP24XX_CLKSEL_GPT1_MASK,
854 .clksel = omap24xx_gpt_clksel,
855 .recalc = &omap2_clksel_recalc,
856 .round_rate = &omap2_clksel_round_rate,
857 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000858};
859
860static struct clk gpt2_ick = {
861 .name = "gpt2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000862 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000863 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300864 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200865 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
866 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
867 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000868};
869
870static struct clk gpt2_fck = {
871 .name = "gpt2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000872 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000873 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300874 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200875 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
876 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
877 .init = &omap2_init_clksel_parent,
878 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
879 .clksel_mask = OMAP24XX_CLKSEL_GPT2_MASK,
880 .clksel = omap24xx_gpt_clksel,
881 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000882};
883
884static struct clk gpt3_ick = {
885 .name = "gpt3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000886 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000887 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300888 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200889 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
890 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
891 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000892};
893
894static struct clk gpt3_fck = {
895 .name = "gpt3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000896 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000897 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300898 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200899 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
900 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
901 .init = &omap2_init_clksel_parent,
902 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
903 .clksel_mask = OMAP24XX_CLKSEL_GPT3_MASK,
904 .clksel = omap24xx_gpt_clksel,
905 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000906};
907
908static struct clk gpt4_ick = {
909 .name = "gpt4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000910 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000911 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300912 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200913 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
914 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
915 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000916};
917
918static struct clk gpt4_fck = {
919 .name = "gpt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000920 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000921 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300922 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200923 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
924 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
925 .init = &omap2_init_clksel_parent,
926 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
927 .clksel_mask = OMAP24XX_CLKSEL_GPT4_MASK,
928 .clksel = omap24xx_gpt_clksel,
929 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000930};
931
932static struct clk gpt5_ick = {
933 .name = "gpt5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000934 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000935 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300936 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200937 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
938 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
939 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000940};
941
942static struct clk gpt5_fck = {
943 .name = "gpt5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000944 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000945 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300946 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200947 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
948 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
949 .init = &omap2_init_clksel_parent,
950 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
951 .clksel_mask = OMAP24XX_CLKSEL_GPT5_MASK,
952 .clksel = omap24xx_gpt_clksel,
953 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000954};
955
956static struct clk gpt6_ick = {
957 .name = "gpt6_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000958 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000959 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300960 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200961 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
962 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
963 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000964};
965
966static struct clk gpt6_fck = {
967 .name = "gpt6_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000968 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000969 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300970 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200971 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
972 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
973 .init = &omap2_init_clksel_parent,
974 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
975 .clksel_mask = OMAP24XX_CLKSEL_GPT6_MASK,
976 .clksel = omap24xx_gpt_clksel,
977 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000978};
979
980static struct clk gpt7_ick = {
981 .name = "gpt7_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000982 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000983 .parent = &l4_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200984 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
985 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
986 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000987};
988
989static struct clk gpt7_fck = {
990 .name = "gpt7_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000991 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000992 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300993 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200994 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
995 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
996 .init = &omap2_init_clksel_parent,
997 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
998 .clksel_mask = OMAP24XX_CLKSEL_GPT7_MASK,
999 .clksel = omap24xx_gpt_clksel,
1000 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001001};
1002
1003static struct clk gpt8_ick = {
1004 .name = "gpt8_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001005 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001006 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001007 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001008 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1009 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1010 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001011};
1012
1013static struct clk gpt8_fck = {
1014 .name = "gpt8_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001015 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001016 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001017 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001018 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1019 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1020 .init = &omap2_init_clksel_parent,
1021 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1022 .clksel_mask = OMAP24XX_CLKSEL_GPT8_MASK,
1023 .clksel = omap24xx_gpt_clksel,
1024 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001025};
1026
1027static struct clk gpt9_ick = {
1028 .name = "gpt9_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001029 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001030 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001031 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001032 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1033 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1034 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001035};
1036
1037static struct clk gpt9_fck = {
1038 .name = "gpt9_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001039 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001040 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001041 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001042 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1043 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1044 .init = &omap2_init_clksel_parent,
1045 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1046 .clksel_mask = OMAP24XX_CLKSEL_GPT9_MASK,
1047 .clksel = omap24xx_gpt_clksel,
1048 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001049};
1050
1051static struct clk gpt10_ick = {
1052 .name = "gpt10_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001053 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001054 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001055 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001056 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1057 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1058 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001059};
1060
1061static struct clk gpt10_fck = {
1062 .name = "gpt10_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001063 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001064 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001065 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001066 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1067 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1068 .init = &omap2_init_clksel_parent,
1069 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1070 .clksel_mask = OMAP24XX_CLKSEL_GPT10_MASK,
1071 .clksel = omap24xx_gpt_clksel,
1072 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001073};
1074
1075static struct clk gpt11_ick = {
1076 .name = "gpt11_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001077 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001078 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001079 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001080 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1081 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1082 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001083};
1084
1085static struct clk gpt11_fck = {
1086 .name = "gpt11_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001087 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001088 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001089 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001090 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1091 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1092 .init = &omap2_init_clksel_parent,
1093 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1094 .clksel_mask = OMAP24XX_CLKSEL_GPT11_MASK,
1095 .clksel = omap24xx_gpt_clksel,
1096 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001097};
1098
1099static struct clk gpt12_ick = {
1100 .name = "gpt12_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001101 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001102 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001103 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001104 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1105 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1106 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001107};
1108
1109static struct clk gpt12_fck = {
1110 .name = "gpt12_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001111 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyf2480762009-04-23 21:11:10 -06001112 .parent = &secure_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001113 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001114 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1115 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1116 .init = &omap2_init_clksel_parent,
1117 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1118 .clksel_mask = OMAP24XX_CLKSEL_GPT12_MASK,
1119 .clksel = omap24xx_gpt_clksel,
1120 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001121};
1122
1123static struct clk mcbsp1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001124 .name = "mcbsp1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001125 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001126 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001127 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001128 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1129 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1130 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001131};
1132
Paul Walmsleyb115b742010-10-08 11:40:18 -06001133static const struct clksel_rate common_mcbsp_96m_rates[] = {
1134 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
1135 { .div = 0 }
1136};
1137
1138static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
1139 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
1140 { .div = 0 }
1141};
1142
1143static const struct clksel mcbsp_fck_clksel[] = {
1144 { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates },
1145 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
1146 { .parent = NULL }
1147};
1148
Tony Lindgren046d6b22005-11-10 14:26:52 +00001149static struct clk mcbsp1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001150 .name = "mcbsp1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001151 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001152 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001153 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001154 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001155 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1156 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001157 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1158 .clksel_mask = OMAP2_MCBSP1_CLKS_MASK,
1159 .clksel = mcbsp_fck_clksel,
1160 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001161};
1162
1163static struct clk mcbsp2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001164 .name = "mcbsp2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001165 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001166 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001167 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001168 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1169 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1170 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001171};
1172
1173static struct clk mcbsp2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001174 .name = "mcbsp2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001175 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001176 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001177 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001178 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001179 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1180 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001181 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1182 .clksel_mask = OMAP2_MCBSP2_CLKS_MASK,
1183 .clksel = mcbsp_fck_clksel,
1184 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001185};
1186
1187static struct clk mcbsp3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001188 .name = "mcbsp3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001189 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001190 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001191 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001192 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1193 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
1194 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001195};
1196
1197static struct clk mcbsp3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001198 .name = "mcbsp3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001199 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001200 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001201 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001202 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001203 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1204 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001205 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1206 .clksel_mask = OMAP2_MCBSP3_CLKS_MASK,
1207 .clksel = mcbsp_fck_clksel,
1208 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001209};
1210
1211static struct clk mcbsp4_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001212 .name = "mcbsp4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001213 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001214 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001215 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001216 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1217 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1218 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001219};
1220
1221static struct clk mcbsp4_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001222 .name = "mcbsp4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001223 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001224 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001225 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001226 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001227 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1228 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001229 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1230 .clksel_mask = OMAP2_MCBSP4_CLKS_MASK,
1231 .clksel = mcbsp_fck_clksel,
1232 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001233};
1234
1235static struct clk mcbsp5_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001236 .name = "mcbsp5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001237 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001238 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001239 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001240 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1241 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1242 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001243};
1244
1245static struct clk mcbsp5_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001246 .name = "mcbsp5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001247 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001248 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001249 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001250 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001251 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1252 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001253 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1254 .clksel_mask = OMAP2_MCBSP5_CLKS_MASK,
1255 .clksel = mcbsp_fck_clksel,
1256 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001257};
1258
1259static struct clk mcspi1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001260 .name = "mcspi1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001261 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001262 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001263 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001264 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1265 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1266 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001267};
1268
1269static struct clk mcspi1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001270 .name = "mcspi1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001271 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001272 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001273 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001274 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1275 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1276 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001277};
1278
1279static struct clk mcspi2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001280 .name = "mcspi2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001281 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001282 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001283 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001284 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1285 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1286 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001287};
1288
1289static struct clk mcspi2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001290 .name = "mcspi2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001291 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001292 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001293 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001294 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1295 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1296 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001297};
1298
1299static struct clk mcspi3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001300 .name = "mcspi3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001301 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001302 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001303 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001304 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1305 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1306 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001307};
1308
1309static struct clk mcspi3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001310 .name = "mcspi3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001311 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001312 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001313 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001314 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1315 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1316 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001317};
1318
1319static struct clk uart1_ick = {
1320 .name = "uart1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001321 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001322 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001323 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001324 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1325 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1326 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001327};
1328
1329static struct clk uart1_fck = {
1330 .name = "uart1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001331 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001332 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001333 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001334 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1335 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1336 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001337};
1338
1339static struct clk uart2_ick = {
1340 .name = "uart2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001341 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001342 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001343 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001344 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1345 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1346 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001347};
1348
1349static struct clk uart2_fck = {
1350 .name = "uart2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001351 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001352 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001353 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001354 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1355 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1356 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001357};
1358
1359static struct clk uart3_ick = {
1360 .name = "uart3_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001361 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001362 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001363 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001364 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1365 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1366 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001367};
1368
1369static struct clk uart3_fck = {
1370 .name = "uart3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001371 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001372 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001373 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001374 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1375 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1376 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001377};
1378
1379static struct clk gpios_ick = {
1380 .name = "gpios_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001381 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001382 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001383 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001384 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1385 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1386 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001387};
1388
1389static struct clk gpios_fck = {
1390 .name = "gpios_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001391 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001392 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001393 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001394 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1395 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1396 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001397};
1398
1399static struct clk mpu_wdt_ick = {
1400 .name = "mpu_wdt_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001401 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001402 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001403 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001404 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1405 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1406 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001407};
1408
1409static struct clk mpu_wdt_fck = {
1410 .name = "mpu_wdt_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001411 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001412 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001413 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001414 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1415 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1416 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001417};
1418
1419static struct clk sync_32k_ick = {
1420 .name = "sync_32k_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001421 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001422 .parent = &l4_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001423 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001424 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001425 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1426 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
1427 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001428};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001429
Tony Lindgren046d6b22005-11-10 14:26:52 +00001430static struct clk wdt1_ick = {
1431 .name = "wdt1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001432 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001433 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001434 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001435 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1436 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
1437 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001438};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001439
Tony Lindgren046d6b22005-11-10 14:26:52 +00001440static struct clk omapctrl_ick = {
1441 .name = "omapctrl_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001442 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001443 .parent = &l4_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001444 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001445 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001446 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1447 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
1448 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001449};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001450
Tony Lindgren046d6b22005-11-10 14:26:52 +00001451static struct clk icr_ick = {
1452 .name = "icr_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001453 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001454 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001455 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001456 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1457 .enable_bit = OMAP2430_EN_ICR_SHIFT,
1458 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001459};
1460
1461static struct clk cam_ick = {
1462 .name = "cam_ick",
Russell Kingbc51da42008-11-04 18:59:32 +00001463 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001464 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001465 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001466 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1467 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1468 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001469};
1470
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001471/*
1472 * cam_fck controls both CAM_MCLK and CAM_FCLK. It should probably be
1473 * split into two separate clocks, since the parent clocks are different
1474 * and the clockdomains are also different.
1475 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001476static struct clk cam_fck = {
1477 .name = "cam_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00001478 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001479 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001480 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001481 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1482 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1483 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001484};
1485
1486static struct clk mailboxes_ick = {
1487 .name = "mailboxes_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001488 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001489 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001490 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001491 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1492 .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
1493 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001494};
1495
1496static struct clk wdt4_ick = {
1497 .name = "wdt4_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001498 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001499 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001500 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001501 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1502 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1503 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001504};
1505
1506static struct clk wdt4_fck = {
1507 .name = "wdt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001508 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001509 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001510 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001511 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1512 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1513 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001514};
1515
Tony Lindgren046d6b22005-11-10 14:26:52 +00001516static struct clk mspro_ick = {
1517 .name = "mspro_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001518 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001519 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001520 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001521 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1522 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1523 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001524};
1525
1526static struct clk mspro_fck = {
1527 .name = "mspro_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001528 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001529 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001530 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001531 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1532 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1533 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001534};
1535
Tony Lindgren046d6b22005-11-10 14:26:52 +00001536static struct clk fac_ick = {
1537 .name = "fac_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001538 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001539 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001540 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001541 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1542 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1543 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001544};
1545
1546static struct clk fac_fck = {
1547 .name = "fac_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001548 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001549 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001550 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001551 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1552 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1553 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001554};
1555
Tony Lindgren046d6b22005-11-10 14:26:52 +00001556static struct clk hdq_ick = {
1557 .name = "hdq_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001558 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001559 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001560 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001561 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1562 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1563 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001564};
1565
1566static struct clk hdq_fck = {
1567 .name = "hdq_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001568 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001569 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001570 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001571 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1572 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1573 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001574};
1575
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001576/*
1577 * XXX This is marked as a 2420-only define, but it claims to be present
1578 * on 2430 also. Double-check.
1579 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001580static struct clk i2c2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001581 .name = "i2c2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001582 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001583 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001584 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001585 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1586 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
1587 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001588};
1589
Tony Lindgren046d6b22005-11-10 14:26:52 +00001590static struct clk i2chs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001591 .name = "i2chs2_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001592 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001593 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001594 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001595 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1596 .enable_bit = OMAP2430_EN_I2CHS2_SHIFT,
1597 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001598};
1599
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001600/*
1601 * XXX This is marked as a 2420-only define, but it claims to be present
1602 * on 2430 also. Double-check.
1603 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001604static struct clk i2c1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001605 .name = "i2c1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001606 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001607 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001608 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001609 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1610 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
1611 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001612};
1613
Tony Lindgren046d6b22005-11-10 14:26:52 +00001614static struct clk i2chs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001615 .name = "i2chs1_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001616 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001617 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001618 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001619 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1620 .enable_bit = OMAP2430_EN_I2CHS1_SHIFT,
1621 .recalc = &followparent_recalc,
1622};
1623
1624static struct clk gpmc_fck = {
1625 .name = "gpmc_fck",
Russell King897dcde2008-11-04 16:35:03 +00001626 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001627 .parent = &core_l3_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001628 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001629 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001630 .recalc = &followparent_recalc,
1631};
1632
1633static struct clk sdma_fck = {
1634 .name = "sdma_fck",
Russell King897dcde2008-11-04 16:35:03 +00001635 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001636 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001637 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001638 .recalc = &followparent_recalc,
1639};
1640
1641static struct clk sdma_ick = {
1642 .name = "sdma_ick",
Russell King897dcde2008-11-04 16:35:03 +00001643 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001644 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001645 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001646 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001647};
1648
Tony Lindgren046d6b22005-11-10 14:26:52 +00001649static struct clk sdrc_ick = {
1650 .name = "sdrc_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001651 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001652 .parent = &l4_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001653 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001654 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001655 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1656 .enable_bit = OMAP2430_EN_SDRC_SHIFT,
1657 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001658};
1659
1660static struct clk des_ick = {
1661 .name = "des_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001662 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001663 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001664 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001665 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1666 .enable_bit = OMAP24XX_EN_DES_SHIFT,
1667 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001668};
1669
1670static struct clk sha_ick = {
1671 .name = "sha_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001672 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001673 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001674 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001675 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1676 .enable_bit = OMAP24XX_EN_SHA_SHIFT,
1677 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001678};
1679
1680static struct clk rng_ick = {
1681 .name = "rng_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001682 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001683 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001684 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001685 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1686 .enable_bit = OMAP24XX_EN_RNG_SHIFT,
1687 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001688};
1689
1690static struct clk aes_ick = {
1691 .name = "aes_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001692 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001693 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001694 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001695 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1696 .enable_bit = OMAP24XX_EN_AES_SHIFT,
1697 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001698};
1699
1700static struct clk pka_ick = {
1701 .name = "pka_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001702 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001703 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001704 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001705 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1706 .enable_bit = OMAP24XX_EN_PKA_SHIFT,
1707 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001708};
1709
1710static struct clk usb_fck = {
1711 .name = "usb_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001712 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001713 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001714 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001715 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1716 .enable_bit = OMAP24XX_EN_USB_SHIFT,
1717 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001718};
1719
1720static struct clk usbhs_ick = {
1721 .name = "usbhs_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001722 .ops = &clkops_omap2_dflt_wait,
Tony Lindgrenfde0fd42006-01-17 15:31:18 -08001723 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001724 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001725 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1726 .enable_bit = OMAP2430_EN_USBHS_SHIFT,
1727 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001728};
1729
1730static struct clk mmchs1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001731 .name = "mmchs1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001732 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001733 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001734 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001735 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1736 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1737 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001738};
1739
1740static struct clk mmchs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001741 .name = "mmchs1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001742 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001743 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001744 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001745 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1746 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1747 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001748};
1749
1750static struct clk mmchs2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001751 .name = "mmchs2_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001752 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001753 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001754 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001755 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1756 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1757 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001758};
1759
1760static struct clk mmchs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001761 .name = "mmchs2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001762 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001763 .parent = &func_96m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001764 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1765 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1766 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001767};
1768
1769static struct clk gpio5_ick = {
1770 .name = "gpio5_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001771 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001772 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001773 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001774 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1775 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1776 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001777};
1778
1779static struct clk gpio5_fck = {
1780 .name = "gpio5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001781 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001782 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001783 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001784 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1785 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1786 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001787};
1788
1789static struct clk mdm_intc_ick = {
1790 .name = "mdm_intc_ick",
Russell Kingb36ee722008-11-04 17:59:52 +00001791 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001792 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001793 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001794 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1795 .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT,
1796 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001797};
1798
1799static struct clk mmchsdb1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001800 .name = "mmchsdb1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001801 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001802 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001803 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001804 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1805 .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT,
1806 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001807};
1808
1809static struct clk mmchsdb2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001810 .name = "mmchsdb2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001811 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001812 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001813 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001814 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1815 .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT,
1816 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001817};
Paul Walmsleye32744b2008-03-18 15:47:55 +02001818
Tony Lindgren046d6b22005-11-10 14:26:52 +00001819/*
1820 * This clock is a composite clock which does entire set changes then
1821 * forces a rebalance. It keys on the MPU speed, but it really could
1822 * be any key speed part of a set in the rate table.
1823 *
1824 * to really change a set, you need memory table sets which get changed
1825 * in sram, pre-notifiers & post notifiers, changing the top set, without
1826 * having low level display recalc's won't work... this is why dpm notifiers
1827 * work, isr's off, walk a list of clocks already _off_ and not messing with
1828 * the bus.
1829 *
1830 * This clock should have no parent. It embodies the entire upper level
1831 * active set. A parent will mess up some of the init also.
1832 */
1833static struct clk virt_prcm_set = {
1834 .name = "virt_prcm_set",
Russell King897dcde2008-11-04 16:35:03 +00001835 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001836 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001837 .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001838 .set_rate = &omap2_select_table_rate,
1839 .round_rate = &omap2_round_to_table_rate,
1840};
Paul Walmsleye32744b2008-03-18 15:47:55 +02001841
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001842
1843/*
1844 * clkdev integration
1845 */
1846
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001847static struct omap_clk omap2430_clks[] = {
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001848 /* external root sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001849 CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X),
1850 CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X),
1851 CLK(NULL, "osc_ck", &osc_ck, CK_243X),
1852 CLK(NULL, "sys_ck", &sys_ck, CK_243X),
1853 CLK(NULL, "alt_ck", &alt_ck, CK_243X),
Paul Walmsleyb115b742010-10-08 11:40:18 -06001854 CLK("omap-mcbsp.1", "pad_fck", &mcbsp_clks, CK_243X),
1855 CLK("omap-mcbsp.2", "pad_fck", &mcbsp_clks, CK_243X),
1856 CLK("omap-mcbsp.3", "pad_fck", &mcbsp_clks, CK_243X),
1857 CLK("omap-mcbsp.4", "pad_fck", &mcbsp_clks, CK_243X),
1858 CLK("omap-mcbsp.5", "pad_fck", &mcbsp_clks, CK_243X),
1859 CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001860 /* internal analog sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001861 CLK(NULL, "dpll_ck", &dpll_ck, CK_243X),
1862 CLK(NULL, "apll96_ck", &apll96_ck, CK_243X),
1863 CLK(NULL, "apll54_ck", &apll54_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001864 /* internal prcm root sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001865 CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X),
1866 CLK(NULL, "core_ck", &core_ck, CK_243X),
Paul Walmsleyb115b742010-10-08 11:40:18 -06001867 CLK("omap-mcbsp.1", "prcm_fck", &func_96m_ck, CK_243X),
1868 CLK("omap-mcbsp.2", "prcm_fck", &func_96m_ck, CK_243X),
1869 CLK("omap-mcbsp.3", "prcm_fck", &func_96m_ck, CK_243X),
1870 CLK("omap-mcbsp.4", "prcm_fck", &func_96m_ck, CK_243X),
1871 CLK("omap-mcbsp.5", "prcm_fck", &func_96m_ck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001872 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X),
1873 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X),
1874 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X),
1875 CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X),
1876 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X),
1877 CLK(NULL, "sys_clkout", &sys_clkout, CK_243X),
1878 CLK(NULL, "emul_ck", &emul_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001879 /* mpu domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001880 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001881 /* dsp domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001882 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X),
1883 CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001884 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001885 /* GFX domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001886 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X),
1887 CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X),
1888 CLK(NULL, "gfx_ick", &gfx_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001889 /* Modem domain clocks */
1890 CLK(NULL, "mdm_ick", &mdm_ick, CK_243X),
1891 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
1892 /* DSS domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001893 CLK("omapdss", "ick", &dss_ick, CK_243X),
1894 CLK("omapdss", "dss1_fck", &dss1_fck, CK_243X),
1895 CLK("omapdss", "dss2_fck", &dss2_fck, CK_243X),
1896 CLK("omapdss", "tv_fck", &dss_54m_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001897 /* L3 domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001898 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X),
1899 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X),
1900 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001901 /* L4 domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001902 CLK(NULL, "l4_ck", &l4_ck, CK_243X),
1903 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001904 /* virtual meta-group clock */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001905 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001906 /* general l4 interface ck, multi-parent functional clk */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001907 CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X),
1908 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X),
1909 CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X),
1910 CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X),
1911 CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X),
1912 CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X),
1913 CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X),
1914 CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X),
1915 CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X),
1916 CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X),
1917 CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X),
1918 CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X),
1919 CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X),
1920 CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X),
1921 CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X),
1922 CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X),
1923 CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X),
1924 CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X),
1925 CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X),
1926 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X),
1927 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X),
1928 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X),
1929 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X),
1930 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X),
1931 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X),
1932 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X),
1933 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X),
1934 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001935 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
1936 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X),
1937 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
1938 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X),
1939 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
1940 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001941 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X),
1942 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X),
1943 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X),
1944 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001945 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
1946 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001947 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X),
1948 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X),
1949 CLK(NULL, "uart2_ick", &uart2_ick, CK_243X),
1950 CLK(NULL, "uart2_fck", &uart2_fck, CK_243X),
1951 CLK(NULL, "uart3_ick", &uart3_ick, CK_243X),
1952 CLK(NULL, "uart3_fck", &uart3_fck, CK_243X),
1953 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X),
1954 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X),
1955 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X),
1956 CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X),
1957 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X),
1958 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X),
1959 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001960 CLK(NULL, "icr_ick", &icr_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001961 CLK("omap24xxcam", "fck", &cam_fck, CK_243X),
1962 CLK("omap24xxcam", "ick", &cam_ick, CK_243X),
1963 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X),
1964 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X),
1965 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X),
1966 CLK(NULL, "mspro_ick", &mspro_ick, CK_243X),
1967 CLK(NULL, "mspro_fck", &mspro_fck, CK_243X),
1968 CLK(NULL, "fac_ick", &fac_ick, CK_243X),
1969 CLK(NULL, "fac_fck", &fac_fck, CK_243X),
1970 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X),
1971 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X),
1972 CLK("i2c_omap.1", "ick", &i2c1_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001973 CLK("i2c_omap.1", "fck", &i2chs1_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001974 CLK("i2c_omap.2", "ick", &i2c2_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001975 CLK("i2c_omap.2", "fck", &i2chs2_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001976 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X),
1977 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X),
1978 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001979 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001980 CLK(NULL, "des_ick", &des_ick, CK_243X),
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +08001981 CLK("omap-sham", "ick", &sha_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001982 CLK("omap_rng", "ick", &rng_ick, CK_243X),
Dmitry Kasatkin82a0c142010-08-20 13:44:46 +00001983 CLK("omap-aes", "ick", &aes_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001984 CLK(NULL, "pka_ick", &pka_ick, CK_243X),
1985 CLK(NULL, "usb_fck", &usb_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001986 CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X),
1987 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X),
1988 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X),
1989 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X),
1990 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X),
1991 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
1992 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
1993 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
1994 CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
1995 CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
1996};
1997
1998/*
1999 * init code
2000 */
2001
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002002int __init omap2430_clk_init(void)
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002003{
2004 const struct prcm_config *prcm;
2005 struct omap_clk *c;
2006 u32 clkrate;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002007
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002008 prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
2009 cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST);
2010 cpu_mask = RATE_IN_243X;
2011 rate_table = omap2430_rate_table;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002012
2013 clk_init(&omap2_clk_functions);
2014
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002015 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
2016 c++)
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002017 clk_preinit(c->lk.clk);
2018
2019 osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
2020 propagate_rate(&osc_ck);
Paul Walmsley44da0a52010-01-26 20:13:08 -07002021 sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck);
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002022 propagate_rate(&sys_ck);
2023
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002024 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
2025 c++) {
2026 clkdev_add(&c->lk);
2027 clk_register(c->lk.clk);
2028 omap2_init_clk_clkdm(c->lk.clk);
2029 }
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002030
2031 /* Check the MPU rate set by bootloader */
2032 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
2033 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
2034 if (!(prcm->flags & cpu_mask))
2035 continue;
2036 if (prcm->xtal_speed != sys_ck.rate)
2037 continue;
2038 if (prcm->dpll_speed <= clkrate)
2039 break;
2040 }
2041 curr_prcm_set = prcm;
2042
2043 recalculate_root_clocks();
2044
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002045 pr_info("Clocking rate (Crystal/DPLL/MPU): %ld.%01ld/%ld/%ld MHz\n",
2046 (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
2047 (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002048
2049 /*
2050 * Only enable those clocks we will need, let the drivers
2051 * enable other clocks as necessary
2052 */
2053 clk_enable_init_clocks();
2054
2055 /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
2056 vclk = clk_get(NULL, "virt_prcm_set");
2057 sclk = clk_get(NULL, "sys_ck");
2058 dclk = clk_get(NULL, "dpll_ck");
2059
2060 return 0;
2061}
Paul Walmsley6b8858a2008-03-18 10:35:15 +02002062