blob: 0c79d39e3021f02f59f54ab9aedfd9e10942e44e [file] [log] [blame]
Tony Lindgren046d6b22005-11-10 14:26:52 +00001/*
Paul Walmsley8c810e72011-02-25 13:56:40 -07002 * OMAP2430 clock data
Tony Lindgren046d6b22005-11-10 14:26:52 +00003 *
Paul Walmsley8c810e72011-02-25 13:56:40 -07004 * Copyright (C) 2005-2009 Texas Instruments, Inc.
5 * Copyright (C) 2004-2011 Nokia Corporation
Tony Lindgrena16e9702008-03-18 11:56:39 +02006 *
Paul Walmsley8c810e72011-02-25 13:56:40 -07007 * Contacts:
8 * Richard Woodruff <r-woodruff2@ti.com>
9 * Paul Walmsley
Tony Lindgren046d6b22005-11-10 14:26:52 +000010 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
Paul Walmsleyd8a94452009-12-08 16:21:29 -070016#include <linux/kernel.h>
17#include <linux/clk.h>
Paul Walmsley93340a22010-02-22 22:09:12 -070018#include <linux/list.h>
Paul Walmsleyd8a94452009-12-08 16:21:29 -070019
20#include <plat/clkdev_omap.h>
Tony Lindgren046d6b22005-11-10 14:26:52 +000021
Paul Walmsley6b8858a2008-03-18 10:35:15 +020022#include "clock.h"
Paul Walmsleyd8a94452009-12-08 16:21:29 -070023#include "clock2xxx.h"
24#include "opp2xxx.h"
Paul Walmsley59fb6592010-12-21 15:30:55 -070025#include "cm2xxx_3xxx.h"
26#include "prm2xxx_3xxx.h"
Paul Walmsley6b8858a2008-03-18 10:35:15 +020027#include "prm-regbits-24xx.h"
28#include "cm-regbits-24xx.h"
29#include "sdrc.h"
Paul Walmsley4814ced2010-10-08 11:40:20 -060030#include "control.h"
Paul Walmsley6b8858a2008-03-18 10:35:15 +020031
Paul Walmsley81b34fb2010-02-22 22:09:22 -070032#define OMAP_CM_REGADDR OMAP2430_CM_REGADDR
33
34/*
35 * 2430 clock tree.
Tony Lindgren046d6b22005-11-10 14:26:52 +000036 *
Paul Walmsley8c810e72011-02-25 13:56:40 -070037 * NOTE:In many cases here we are assigning a 'default' parent. In
38 * many cases the parent is selectable. The set parent calls will
39 * also switch sources.
Tony Lindgren046d6b22005-11-10 14:26:52 +000040 *
41 * Several sources are given initial rates which may be wrong, this will
42 * be fixed up in the init func.
43 *
44 * Things are broadly separated below by clock domains. It is
Paul Walmsley8c810e72011-02-25 13:56:40 -070045 * noteworthy that most peripherals have dependencies on multiple clock
Tony Lindgren046d6b22005-11-10 14:26:52 +000046 * domains. Many get their interface clocks from the L4 domain, but get
47 * functional clocks from fixed sources or other core domain derived
48 * clocks.
Paul Walmsley81b34fb2010-02-22 22:09:22 -070049 */
Tony Lindgren046d6b22005-11-10 14:26:52 +000050
51/* Base external input clocks */
52static struct clk func_32k_ck = {
53 .name = "func_32k_ck",
Russell King897dcde2008-11-04 16:35:03 +000054 .ops = &clkops_null,
Paul Walmsley3f9cfd32011-02-16 15:38:38 -070055 .rate = 32768,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030056 .clkdm_name = "wkup_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +000057};
Paul Walmsleye32744b2008-03-18 15:47:55 +020058
Paul Walmsleyf2480762009-04-23 21:11:10 -060059static struct clk secure_32k_ck = {
60 .name = "secure_32k_ck",
61 .ops = &clkops_null,
62 .rate = 32768,
Paul Walmsleyf2480762009-04-23 21:11:10 -060063 .clkdm_name = "wkup_clkdm",
64};
65
Tony Lindgren046d6b22005-11-10 14:26:52 +000066/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
67static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
68 .name = "osc_ck",
Russell King548d8492008-11-04 14:02:46 +000069 .ops = &clkops_oscck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030070 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +020071 .recalc = &omap2_osc_clk_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +000072};
73
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030074/* Without modem likely 12MHz, with modem likely 13MHz */
Tony Lindgren046d6b22005-11-10 14:26:52 +000075static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */
76 .name = "sys_ck", /* ~ ref_clk also */
Russell King897dcde2008-11-04 16:35:03 +000077 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +000078 .parent = &osc_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030079 .clkdm_name = "wkup_clkdm",
Paul Walmsley44da0a52010-01-26 20:13:08 -070080 .recalc = &omap2xxx_sys_clk_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +000081};
Paul Walmsleye32744b2008-03-18 15:47:55 +020082
Tony Lindgren046d6b22005-11-10 14:26:52 +000083static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
84 .name = "alt_ck",
Russell King897dcde2008-11-04 16:35:03 +000085 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +000086 .rate = 54000000,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +030087 .clkdm_name = "wkup_clkdm",
Tony Lindgren046d6b22005-11-10 14:26:52 +000088};
Paul Walmsleye32744b2008-03-18 15:47:55 +020089
Paul Walmsleyb115b742010-10-08 11:40:18 -060090/* Optional external clock input for McBSP CLKS */
91static struct clk mcbsp_clks = {
92 .name = "mcbsp_clks",
93 .ops = &clkops_null,
94};
95
Tony Lindgren046d6b22005-11-10 14:26:52 +000096/*
97 * Analog domain root source clocks
98 */
99
100/* dpll_ck, is broken out in to special cases through clksel */
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200101/* REVISIT: Rate changes on dpll_ck trigger a full set change. ...
102 * deal with this
103 */
104
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300105static struct dpll_data dpll_dd = {
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200106 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
107 .mult_mask = OMAP24XX_DPLL_MULT_MASK,
108 .div1_mask = OMAP24XX_DPLL_DIV_MASK,
Russell Kingc0bf3132009-02-19 13:29:22 +0000109 .clk_bypass = &sys_ck,
110 .clk_ref = &sys_ck,
111 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
112 .enable_mask = OMAP24XX_EN_DPLL_MASK,
Paul Walmsley93340a22010-02-22 22:09:12 -0700113 .max_multiplier = 1023,
Paul Walmsley95f538a2009-01-28 12:08:44 -0700114 .min_divider = 1,
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300115 .max_divider = 16,
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200116};
117
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300118/*
119 * XXX Cannot add round_rate here yet, as this is still a composite clock,
120 * not just a DPLL
121 */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000122static struct clk dpll_ck = {
123 .name = "dpll_ck",
Paul Walmsley0fd0c212011-02-25 15:49:53 -0700124 .ops = &clkops_omap2xxx_dpll_ops,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000125 .parent = &sys_ck, /* Can be func_32k also */
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200126 .dpll_data = &dpll_dd,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300127 .clkdm_name = "wkup_clkdm",
Paul Walmsley88b8ba92008-07-03 12:24:46 +0300128 .recalc = &omap2_dpllcore_recalc,
129 .set_rate = &omap2_reprogram_dpllcore,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000130};
131
132static struct clk apll96_ck = {
133 .name = "apll96_ck",
Paul Walmsley06b16932009-12-08 16:18:46 -0700134 .ops = &clkops_apll96,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000135 .parent = &sys_ck,
136 .rate = 96000000,
Paul Walmsley51c19542010-02-22 22:09:26 -0700137 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300138 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200139 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
140 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000141};
142
143static struct clk apll54_ck = {
144 .name = "apll54_ck",
Paul Walmsley06b16932009-12-08 16:18:46 -0700145 .ops = &clkops_apll54,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000146 .parent = &sys_ck,
147 .rate = 54000000,
Paul Walmsley51c19542010-02-22 22:09:26 -0700148 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300149 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200150 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
151 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000152};
153
154/*
155 * PRCM digital base sources
156 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200157
158/* func_54m_ck */
159
160static const struct clksel_rate func_54m_apll54_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600161 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200162 { .div = 0 },
163};
164
165static const struct clksel_rate func_54m_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600166 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200167 { .div = 0 },
168};
169
170static const struct clksel func_54m_clksel[] = {
171 { .parent = &apll54_ck, .rates = func_54m_apll54_rates, },
172 { .parent = &alt_ck, .rates = func_54m_alt_rates, },
173 { .parent = NULL },
174};
175
Tony Lindgren046d6b22005-11-10 14:26:52 +0000176static struct clk func_54m_ck = {
177 .name = "func_54m_ck",
Russell King57137182008-11-04 16:48:35 +0000178 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000179 .parent = &apll54_ck, /* can also be alt_clk */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300180 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200181 .init = &omap2_init_clksel_parent,
182 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsleyf38ca102010-05-20 12:31:04 -0600183 .clksel_mask = OMAP24XX_54M_SOURCE_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200184 .clksel = func_54m_clksel,
185 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000186};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200187
Tony Lindgren046d6b22005-11-10 14:26:52 +0000188static struct clk core_ck = {
189 .name = "core_ck",
Russell King897dcde2008-11-04 16:35:03 +0000190 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000191 .parent = &dpll_ck, /* can also be 32k */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300192 .clkdm_name = "wkup_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200193 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000194};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200195
196/* func_96m_ck */
197static const struct clksel_rate func_96m_apll96_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600198 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200199 { .div = 0 },
Tony Lindgren046d6b22005-11-10 14:26:52 +0000200};
201
Paul Walmsleye32744b2008-03-18 15:47:55 +0200202static const struct clksel_rate func_96m_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600203 { .div = 1, .val = 1, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200204 { .div = 0 },
205};
206
207static const struct clksel func_96m_clksel[] = {
208 { .parent = &apll96_ck, .rates = func_96m_apll96_rates },
209 { .parent = &alt_ck, .rates = func_96m_alt_rates },
210 { .parent = NULL }
211};
212
Tony Lindgren046d6b22005-11-10 14:26:52 +0000213static struct clk func_96m_ck = {
214 .name = "func_96m_ck",
Russell King57137182008-11-04 16:48:35 +0000215 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000216 .parent = &apll96_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300217 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200218 .init = &omap2_init_clksel_parent,
219 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsleyf38ca102010-05-20 12:31:04 -0600220 .clksel_mask = OMAP2430_96M_SOURCE_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200221 .clksel = func_96m_clksel,
222 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200223};
224
225/* func_48m_ck */
226
227static const struct clksel_rate func_48m_apll96_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600228 { .div = 2, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200229 { .div = 0 },
230};
231
232static const struct clksel_rate func_48m_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600233 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200234 { .div = 0 },
235};
236
237static const struct clksel func_48m_clksel[] = {
238 { .parent = &apll96_ck, .rates = func_48m_apll96_rates },
239 { .parent = &alt_ck, .rates = func_48m_alt_rates },
240 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000241};
242
243static struct clk func_48m_ck = {
244 .name = "func_48m_ck",
Russell King57137182008-11-04 16:48:35 +0000245 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000246 .parent = &apll96_ck, /* 96M or Alt */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300247 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200248 .init = &omap2_init_clksel_parent,
249 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
Paul Walmsleyf38ca102010-05-20 12:31:04 -0600250 .clksel_mask = OMAP24XX_48M_SOURCE_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200251 .clksel = func_48m_clksel,
252 .recalc = &omap2_clksel_recalc,
253 .round_rate = &omap2_clksel_round_rate,
254 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000255};
256
257static struct clk func_12m_ck = {
258 .name = "func_12m_ck",
Russell King57137182008-11-04 16:48:35 +0000259 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000260 .parent = &func_48m_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200261 .fixed_div = 4,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300262 .clkdm_name = "wkup_clkdm",
Paul Walmsleye9b98f62010-01-26 20:12:57 -0700263 .recalc = &omap_fixed_divisor_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000264};
265
266/* Secure timer, only available in secure mode */
267static struct clk wdt1_osc_ck = {
268 .name = "ck_wdt1_osc",
Russell King897dcde2008-11-04 16:35:03 +0000269 .ops = &clkops_null, /* RMK: missing? */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000270 .parent = &osc_ck,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200271 .recalc = &followparent_recalc,
272};
273
274/*
275 * The common_clkout* clksel_rate structs are common to
276 * sys_clkout, sys_clkout_src, sys_clkout2, and sys_clkout2_src.
277 * sys_clkout2_* are 2420-only, so the
278 * clksel_rate flags fields are inaccurate for those clocks. This is
279 * harmless since access to those clocks are gated by the struct clk
280 * flags fields, which mark them as 2420-only.
281 */
282static const struct clksel_rate common_clkout_src_core_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600283 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200284 { .div = 0 }
285};
286
287static const struct clksel_rate common_clkout_src_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600288 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200289 { .div = 0 }
290};
291
292static const struct clksel_rate common_clkout_src_96m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600293 { .div = 1, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200294 { .div = 0 }
295};
296
297static const struct clksel_rate common_clkout_src_54m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600298 { .div = 1, .val = 3, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200299 { .div = 0 }
300};
301
302static const struct clksel common_clkout_src_clksel[] = {
303 { .parent = &core_ck, .rates = common_clkout_src_core_rates },
304 { .parent = &sys_ck, .rates = common_clkout_src_sys_rates },
305 { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates },
306 { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates },
307 { .parent = NULL }
308};
309
310static struct clk sys_clkout_src = {
311 .name = "sys_clkout_src",
Russell Kingc1168dc2008-11-04 21:24:00 +0000312 .ops = &clkops_omap2_dflt,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200313 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300314 .clkdm_name = "wkup_clkdm",
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700315 .enable_reg = OMAP2430_PRCM_CLKOUT_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200316 .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT,
317 .init = &omap2_init_clksel_parent,
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700318 .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200319 .clksel_mask = OMAP24XX_CLKOUT_SOURCE_MASK,
320 .clksel = common_clkout_src_clksel,
321 .recalc = &omap2_clksel_recalc,
322 .round_rate = &omap2_clksel_round_rate,
323 .set_rate = &omap2_clksel_set_rate
324};
325
326static const struct clksel_rate common_clkout_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600327 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200328 { .div = 2, .val = 1, .flags = RATE_IN_24XX },
329 { .div = 4, .val = 2, .flags = RATE_IN_24XX },
330 { .div = 8, .val = 3, .flags = RATE_IN_24XX },
331 { .div = 16, .val = 4, .flags = RATE_IN_24XX },
332 { .div = 0 },
333};
334
335static const struct clksel sys_clkout_clksel[] = {
336 { .parent = &sys_clkout_src, .rates = common_clkout_rates },
337 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000338};
339
340static struct clk sys_clkout = {
341 .name = "sys_clkout",
Russell King57137182008-11-04 16:48:35 +0000342 .ops = &clkops_null,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200343 .parent = &sys_clkout_src,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300344 .clkdm_name = "wkup_clkdm",
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700345 .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200346 .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK,
347 .clksel = sys_clkout_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000348 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200349 .round_rate = &omap2_clksel_round_rate,
350 .set_rate = &omap2_clksel_set_rate
351};
352
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100353static struct clk emul_ck = {
354 .name = "emul_ck",
Russell Kingc1168dc2008-11-04 21:24:00 +0000355 .ops = &clkops_omap2_dflt,
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100356 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300357 .clkdm_name = "wkup_clkdm",
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700358 .enable_reg = OMAP2430_PRCM_CLKEMUL_CTRL,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200359 .enable_bit = OMAP24XX_EMULATION_EN_SHIFT,
360 .recalc = &followparent_recalc,
Tony Lindgrenb824efa2006-04-02 17:46:20 +0100361
362};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200363
Tony Lindgren046d6b22005-11-10 14:26:52 +0000364/*
365 * MPU clock domain
366 * Clocks:
367 * MPU_FCLK, MPU_ICLK
368 * INT_M_FCLK, INT_M_I_CLK
369 *
370 * - Individual clocks are hardware managed.
371 * - Base divider comes from: CM_CLKSEL_MPU
372 *
373 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200374static const struct clksel_rate mpu_core_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600375 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200376 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200377 { .div = 0 },
378};
379
380static const struct clksel mpu_clksel[] = {
381 { .parent = &core_ck, .rates = mpu_core_rates },
382 { .parent = NULL }
383};
384
Tony Lindgren046d6b22005-11-10 14:26:52 +0000385static struct clk mpu_ck = { /* Control cpu */
386 .name = "mpu_ck",
Russell King897dcde2008-11-04 16:35:03 +0000387 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000388 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300389 .clkdm_name = "mpu_clkdm",
Paul Walmsley6b8858a2008-03-18 10:35:15 +0200390 .init = &omap2_init_clksel_parent,
391 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
392 .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200393 .clksel = mpu_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000394 .recalc = &omap2_clksel_recalc,
395};
Paul Walmsleye32744b2008-03-18 15:47:55 +0200396
Tony Lindgren046d6b22005-11-10 14:26:52 +0000397/*
Paul Walmsley81b34fb2010-02-22 22:09:22 -0700398 * DSP (2430-IVA2.1) clock domain
Tony Lindgren046d6b22005-11-10 14:26:52 +0000399 * Clocks:
Paul Walmsleye32744b2008-03-18 15:47:55 +0200400 * 2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK
Paul Walmsleye32744b2008-03-18 15:47:55 +0200401 *
Tony Lindgren046d6b22005-11-10 14:26:52 +0000402 * Won't be too specific here. The core clock comes into this block
403 * it is divided then tee'ed. One branch goes directly to xyz enable
404 * controls. The other branch gets further divided by 2 then possibly
405 * routed into a synchronizer and out of clocks abc.
406 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200407static const struct clksel_rate dsp_fck_core_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600408 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200409 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
410 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
411 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200412 { .div = 0 },
413};
414
415static const struct clksel dsp_fck_clksel[] = {
416 { .parent = &core_ck, .rates = dsp_fck_core_rates },
417 { .parent = NULL }
418};
419
Tony Lindgren046d6b22005-11-10 14:26:52 +0000420static struct clk dsp_fck = {
421 .name = "dsp_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000422 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000423 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300424 .clkdm_name = "dsp_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200425 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
426 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
427 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
428 .clksel_mask = OMAP24XX_CLKSEL_DSP_MASK,
429 .clksel = dsp_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000430 .recalc = &omap2_clksel_recalc,
431};
432
Paul Walmsley22411392011-02-25 15:52:04 -0700433static const struct clksel dsp_ick_clksel[] = {
434 { .parent = &dsp_fck, .rates = dsp_ick_rates },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200435 { .parent = NULL }
436};
437
Paul Walmsleye32744b2008-03-18 15:47:55 +0200438/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
439static struct clk iva2_1_ick = {
440 .name = "iva2_1_ick",
Russell Kingb36ee722008-11-04 17:59:52 +0000441 .ops = &clkops_omap2_dflt_wait,
Paul Walmsley22411392011-02-25 15:52:04 -0700442 .parent = &dsp_fck,
443 .clkdm_name = "dsp_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200444 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
445 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
Paul Walmsley22411392011-02-25 15:52:04 -0700446 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
447 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
448 .clksel = dsp_ick_clksel,
449 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000450};
451
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300452/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000453 * L3 clock domain
454 * L3 clocks are used for both interface and functional clocks to
455 * multiple entities. Some of these clocks are completely managed
456 * by hardware, and some others allow software control. Hardware
457 * managed ones general are based on directly CLK_REQ signals and
458 * various auto idle settings. The functional spec sets many of these
459 * as 'tie-high' for their enables.
460 *
461 * I-CLOCKS:
462 * L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA
463 * CAM, HS-USB.
464 * F-CLOCK
465 * SSI.
466 *
467 * GPMC memories and SDRC have timing and clock sensitive registers which
468 * may very well need notification when the clock changes. Currently for low
469 * operating points, these are taken care of in sleep.S.
470 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200471static const struct clksel_rate core_l3_core_rates[] = {
472 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600473 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200474 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200475 { .div = 0 }
476};
477
478static const struct clksel core_l3_clksel[] = {
479 { .parent = &core_ck, .rates = core_l3_core_rates },
480 { .parent = NULL }
481};
482
Tony Lindgren046d6b22005-11-10 14:26:52 +0000483static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */
484 .name = "core_l3_ck",
Russell King897dcde2008-11-04 16:35:03 +0000485 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000486 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300487 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200488 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
489 .clksel_mask = OMAP24XX_CLKSEL_L3_MASK,
490 .clksel = core_l3_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000491 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200492};
493
494/* usb_l4_ick */
495static const struct clksel_rate usb_l4_ick_core_l3_rates[] = {
496 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600497 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200498 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
499 { .div = 0 }
500};
501
502static const struct clksel usb_l4_ick_clksel[] = {
503 { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates },
504 { .parent = NULL },
Tony Lindgren046d6b22005-11-10 14:26:52 +0000505};
506
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300507/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000508static struct clk usb_l4_ick = { /* FS-USB interface clock */
509 .name = "usb_l4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700510 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgrenfde0fd42006-01-17 15:31:18 -0800511 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300512 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200513 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
514 .enable_bit = OMAP24XX_EN_USB_SHIFT,
515 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
516 .clksel_mask = OMAP24XX_CLKSEL_USB_MASK,
517 .clksel = usb_l4_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000518 .recalc = &omap2_clksel_recalc,
519};
520
521/*
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300522 * L4 clock management domain
523 *
524 * This domain contains lots of interface clocks from the L4 interface, some
525 * functional clocks. Fixed APLL functional source clocks are managed in
526 * this domain.
527 */
528static const struct clksel_rate l4_core_l3_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600529 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300530 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
531 { .div = 0 }
532};
533
534static const struct clksel l4_clksel[] = {
535 { .parent = &core_l3_ck, .rates = l4_core_l3_rates },
536 { .parent = NULL }
537};
538
539static struct clk l4_ck = { /* used both as an ick and fck */
540 .name = "l4_ck",
Russell King897dcde2008-11-04 16:35:03 +0000541 .ops = &clkops_null,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300542 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300543 .clkdm_name = "core_l4_clkdm",
544 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
545 .clksel_mask = OMAP24XX_CLKSEL_L4_MASK,
546 .clksel = l4_clksel,
547 .recalc = &omap2_clksel_recalc,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300548};
549
550/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000551 * SSI is in L3 management domain, its direct parent is core not l3,
552 * many core power domain entities are grouped into the L3 clock
553 * domain.
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300554 * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK
Tony Lindgren046d6b22005-11-10 14:26:52 +0000555 *
556 * ssr = core/1/2/3/4/5, sst = 1/2 ssr.
557 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200558static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = {
559 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600560 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200561 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
562 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
563 { .div = 5, .val = 5, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200564 { .div = 0 }
565};
566
567static const struct clksel ssi_ssr_sst_fck_clksel[] = {
568 { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates },
569 { .parent = NULL }
570};
571
Tony Lindgren046d6b22005-11-10 14:26:52 +0000572static struct clk ssi_ssr_sst_fck = {
573 .name = "ssi_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000574 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000575 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300576 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200577 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
578 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
579 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
580 .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK,
581 .clksel = ssi_ssr_sst_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000582 .recalc = &omap2_clksel_recalc,
583};
584
Paul Walmsley9299fd82009-01-27 19:12:54 -0700585/*
586 * Presumably this is the same as SSI_ICLK.
587 * TRM contradicts itself on what clockdomain SSI_ICLK is in
588 */
589static struct clk ssi_l4_ick = {
590 .name = "ssi_l4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700591 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley9299fd82009-01-27 19:12:54 -0700592 .parent = &l4_ck,
593 .clkdm_name = "core_l4_clkdm",
594 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
595 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
596 .recalc = &followparent_recalc,
597};
598
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300599
Tony Lindgren046d6b22005-11-10 14:26:52 +0000600/*
601 * GFX clock domain
602 * Clocks:
603 * GFX_FCLK, GFX_ICLK
604 * GFX_CG1(2d), GFX_CG2(3d)
605 *
606 * GFX_FCLK runs from L3, and is divided by (1,2,3,4)
607 * The 2d and 3d clocks run at a hardware determined
608 * divided value of fclk.
609 *
610 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200611
612/* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */
613static const struct clksel gfx_fck_clksel[] = {
614 { .parent = &core_l3_ck, .rates = gfx_l3_rates },
615 { .parent = NULL },
616};
617
Tony Lindgren046d6b22005-11-10 14:26:52 +0000618static struct clk gfx_3d_fck = {
619 .name = "gfx_3d_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000620 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000621 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300622 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200623 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
624 .enable_bit = OMAP24XX_EN_3D_SHIFT,
625 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
626 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
627 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000628 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200629 .round_rate = &omap2_clksel_round_rate,
630 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000631};
632
633static struct clk gfx_2d_fck = {
634 .name = "gfx_2d_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000635 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000636 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300637 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200638 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
639 .enable_bit = OMAP24XX_EN_2D_SHIFT,
640 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
641 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
642 .clksel = gfx_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000643 .recalc = &omap2_clksel_recalc,
644};
645
Paul Walmsleya1d55622011-02-25 15:39:30 -0700646/* This interface clock does not have a CM_AUTOIDLE bit */
Tony Lindgren046d6b22005-11-10 14:26:52 +0000647static struct clk gfx_ick = {
648 .name = "gfx_ick", /* From l3 */
Russell Kingb36ee722008-11-04 17:59:52 +0000649 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000650 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300651 .clkdm_name = "gfx_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200652 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
653 .enable_bit = OMAP_EN_GFX_SHIFT,
654 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000655};
656
657/*
658 * Modem clock domain (2430)
659 * CLOCKS:
660 * MDM_OSC_CLK
661 * MDM_ICLK
Paul Walmsleye32744b2008-03-18 15:47:55 +0200662 * These clocks are usable in chassis mode only.
Tony Lindgren046d6b22005-11-10 14:26:52 +0000663 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200664static const struct clksel_rate mdm_ick_core_rates[] = {
665 { .div = 1, .val = 1, .flags = RATE_IN_243X },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600666 { .div = 4, .val = 4, .flags = RATE_IN_243X },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200667 { .div = 6, .val = 6, .flags = RATE_IN_243X },
668 { .div = 9, .val = 9, .flags = RATE_IN_243X },
669 { .div = 0 }
670};
671
672static const struct clksel mdm_ick_clksel[] = {
673 { .parent = &core_ck, .rates = mdm_ick_core_rates },
674 { .parent = NULL }
675};
676
Tony Lindgren046d6b22005-11-10 14:26:52 +0000677static struct clk mdm_ick = { /* used both as a ick and fck */
678 .name = "mdm_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700679 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000680 .parent = &core_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300681 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200682 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
683 .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
684 .clksel_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_CLKSEL),
685 .clksel_mask = OMAP2430_CLKSEL_MDM_MASK,
686 .clksel = mdm_ick_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000687 .recalc = &omap2_clksel_recalc,
688};
689
690static struct clk mdm_osc_ck = {
691 .name = "mdm_osc_ck",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700692 .ops = &clkops_omap2_mdmclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000693 .parent = &osc_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300694 .clkdm_name = "mdm_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200695 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
696 .enable_bit = OMAP2430_EN_OSC_SHIFT,
697 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000698};
699
700/*
Tony Lindgren046d6b22005-11-10 14:26:52 +0000701 * DSS clock domain
702 * CLOCKs:
703 * DSS_L4_ICLK, DSS_L3_ICLK,
704 * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK
705 *
706 * DSS is both initiator and target.
707 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200708/* XXX Add RATE_NOT_VALIDATED */
709
710static const struct clksel_rate dss1_fck_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600711 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200712 { .div = 0 }
713};
714
715static const struct clksel_rate dss1_fck_core_rates[] = {
716 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
717 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
718 { .div = 3, .val = 3, .flags = RATE_IN_24XX },
719 { .div = 4, .val = 4, .flags = RATE_IN_24XX },
720 { .div = 5, .val = 5, .flags = RATE_IN_24XX },
721 { .div = 6, .val = 6, .flags = RATE_IN_24XX },
722 { .div = 8, .val = 8, .flags = RATE_IN_24XX },
723 { .div = 9, .val = 9, .flags = RATE_IN_24XX },
724 { .div = 12, .val = 12, .flags = RATE_IN_24XX },
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600725 { .div = 16, .val = 16, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200726 { .div = 0 }
727};
728
729static const struct clksel dss1_fck_clksel[] = {
730 { .parent = &sys_ck, .rates = dss1_fck_sys_rates },
731 { .parent = &core_ck, .rates = dss1_fck_core_rates },
732 { .parent = NULL },
733};
734
Tony Lindgren046d6b22005-11-10 14:26:52 +0000735static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
736 .name = "dss_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700737 .ops = &clkops_omap2_iclk_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000738 .parent = &l4_ck, /* really both l3 and l4 */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300739 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200740 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
741 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
742 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000743};
744
745static struct clk dss1_fck = {
746 .name = "dss1_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000747 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000748 .parent = &core_ck, /* Core or sys */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300749 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200750 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
751 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
752 .init = &omap2_init_clksel_parent,
753 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
754 .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK,
755 .clksel = dss1_fck_clksel,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000756 .recalc = &omap2_clksel_recalc,
Paul Walmsleye32744b2008-03-18 15:47:55 +0200757};
758
759static const struct clksel_rate dss2_fck_sys_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600760 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200761 { .div = 0 }
762};
763
764static const struct clksel_rate dss2_fck_48m_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600765 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200766 { .div = 0 }
767};
768
769static const struct clksel dss2_fck_clksel[] = {
770 { .parent = &sys_ck, .rates = dss2_fck_sys_rates },
771 { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates },
772 { .parent = NULL }
Tony Lindgren046d6b22005-11-10 14:26:52 +0000773};
774
775static struct clk dss2_fck = { /* Alt clk used in power management */
776 .name = "dss2_fck",
Russell Kingbc51da42008-11-04 18:59:32 +0000777 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000778 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300779 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200780 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
781 .enable_bit = OMAP24XX_EN_DSS2_SHIFT,
782 .init = &omap2_init_clksel_parent,
783 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
784 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
785 .clksel = dss2_fck_clksel,
Paul Walmsleyd4521f62010-12-21 21:08:14 -0700786 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000787};
788
789static struct clk dss_54m_fck = { /* Alt clk used in power management */
790 .name = "dss_54m_fck", /* 54m tv clk */
Russell Kingb36ee722008-11-04 17:59:52 +0000791 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000792 .parent = &func_54m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300793 .clkdm_name = "dss_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200794 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
795 .enable_bit = OMAP24XX_EN_TV_SHIFT,
796 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000797};
798
Paul Walmsley19c1c0c2011-02-16 15:38:38 -0700799static struct clk wu_l4_ick = {
800 .name = "wu_l4_ick",
801 .ops = &clkops_null,
802 .parent = &sys_ck,
803 .clkdm_name = "wkup_clkdm",
804 .recalc = &followparent_recalc,
805};
806
Tony Lindgren046d6b22005-11-10 14:26:52 +0000807/*
808 * CORE power domain ICLK & FCLK defines.
809 * Many of the these can have more than one possible parent. Entries
810 * here will likely have an L4 interface parent, and may have multiple
811 * functional clock parents.
812 */
Paul Walmsleye32744b2008-03-18 15:47:55 +0200813static const struct clksel_rate gpt_alt_rates[] = {
Paul Walmsleyd74b4942010-05-18 18:40:24 -0600814 { .div = 1, .val = 2, .flags = RATE_IN_24XX },
Paul Walmsleye32744b2008-03-18 15:47:55 +0200815 { .div = 0 }
816};
817
818static const struct clksel omap24xx_gpt_clksel[] = {
819 { .parent = &func_32k_ck, .rates = gpt_32k_rates },
820 { .parent = &sys_ck, .rates = gpt_sys_rates },
821 { .parent = &alt_ck, .rates = gpt_alt_rates },
822 { .parent = NULL },
823};
824
Tony Lindgren046d6b22005-11-10 14:26:52 +0000825static struct clk gpt1_ick = {
826 .name = "gpt1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700827 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -0700828 .parent = &wu_l4_ick,
829 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200830 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
831 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
832 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000833};
834
835static struct clk gpt1_fck = {
836 .name = "gpt1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000837 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000838 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300839 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200840 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
841 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
842 .init = &omap2_init_clksel_parent,
843 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1),
844 .clksel_mask = OMAP24XX_CLKSEL_GPT1_MASK,
845 .clksel = omap24xx_gpt_clksel,
846 .recalc = &omap2_clksel_recalc,
847 .round_rate = &omap2_clksel_round_rate,
848 .set_rate = &omap2_clksel_set_rate
Tony Lindgren046d6b22005-11-10 14:26:52 +0000849};
850
851static struct clk gpt2_ick = {
852 .name = "gpt2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700853 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000854 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300855 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200856 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
857 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
858 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000859};
860
861static struct clk gpt2_fck = {
862 .name = "gpt2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000863 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000864 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300865 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200866 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
867 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
868 .init = &omap2_init_clksel_parent,
869 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
870 .clksel_mask = OMAP24XX_CLKSEL_GPT2_MASK,
871 .clksel = omap24xx_gpt_clksel,
872 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000873};
874
875static struct clk gpt3_ick = {
876 .name = "gpt3_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700877 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000878 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300879 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200880 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
881 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
882 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000883};
884
885static struct clk gpt3_fck = {
886 .name = "gpt3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000887 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000888 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300889 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200890 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
891 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
892 .init = &omap2_init_clksel_parent,
893 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
894 .clksel_mask = OMAP24XX_CLKSEL_GPT3_MASK,
895 .clksel = omap24xx_gpt_clksel,
896 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000897};
898
899static struct clk gpt4_ick = {
900 .name = "gpt4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700901 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000902 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300903 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200904 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
905 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
906 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000907};
908
909static struct clk gpt4_fck = {
910 .name = "gpt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000911 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000912 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300913 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200914 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
915 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
916 .init = &omap2_init_clksel_parent,
917 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
918 .clksel_mask = OMAP24XX_CLKSEL_GPT4_MASK,
919 .clksel = omap24xx_gpt_clksel,
920 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000921};
922
923static struct clk gpt5_ick = {
924 .name = "gpt5_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700925 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000926 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300927 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200928 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
929 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
930 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000931};
932
933static struct clk gpt5_fck = {
934 .name = "gpt5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000935 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000936 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300937 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200938 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
939 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
940 .init = &omap2_init_clksel_parent,
941 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
942 .clksel_mask = OMAP24XX_CLKSEL_GPT5_MASK,
943 .clksel = omap24xx_gpt_clksel,
944 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000945};
946
947static struct clk gpt6_ick = {
948 .name = "gpt6_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700949 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000950 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300951 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200952 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
953 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
954 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000955};
956
957static struct clk gpt6_fck = {
958 .name = "gpt6_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000959 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000960 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300961 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200962 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
963 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
964 .init = &omap2_init_clksel_parent,
965 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
966 .clksel_mask = OMAP24XX_CLKSEL_GPT6_MASK,
967 .clksel = omap24xx_gpt_clksel,
968 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000969};
970
971static struct clk gpt7_ick = {
972 .name = "gpt7_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700973 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000974 .parent = &l4_ck,
Paul Walmsleya4fc9272011-02-25 14:53:40 -0700975 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200976 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
977 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
978 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000979};
980
981static struct clk gpt7_fck = {
982 .name = "gpt7_fck",
Russell Kingb36ee722008-11-04 17:59:52 +0000983 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000984 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300985 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +0200986 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
987 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
988 .init = &omap2_init_clksel_parent,
989 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
990 .clksel_mask = OMAP24XX_CLKSEL_GPT7_MASK,
991 .clksel = omap24xx_gpt_clksel,
992 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000993};
994
995static struct clk gpt8_ick = {
996 .name = "gpt8_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -0700997 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +0000998 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +0300999 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001000 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1001 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1002 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001003};
1004
1005static struct clk gpt8_fck = {
1006 .name = "gpt8_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001007 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001008 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001009 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001010 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1011 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
1012 .init = &omap2_init_clksel_parent,
1013 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1014 .clksel_mask = OMAP24XX_CLKSEL_GPT8_MASK,
1015 .clksel = omap24xx_gpt_clksel,
1016 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001017};
1018
1019static struct clk gpt9_ick = {
1020 .name = "gpt9_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001021 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001022 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001023 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001024 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1025 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1026 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001027};
1028
1029static struct clk gpt9_fck = {
1030 .name = "gpt9_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001031 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001032 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001033 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001034 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1035 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
1036 .init = &omap2_init_clksel_parent,
1037 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1038 .clksel_mask = OMAP24XX_CLKSEL_GPT9_MASK,
1039 .clksel = omap24xx_gpt_clksel,
1040 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001041};
1042
1043static struct clk gpt10_ick = {
1044 .name = "gpt10_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001045 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001046 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001047 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001048 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1049 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1050 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001051};
1052
1053static struct clk gpt10_fck = {
1054 .name = "gpt10_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001055 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001056 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001057 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001058 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1059 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
1060 .init = &omap2_init_clksel_parent,
1061 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1062 .clksel_mask = OMAP24XX_CLKSEL_GPT10_MASK,
1063 .clksel = omap24xx_gpt_clksel,
1064 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001065};
1066
1067static struct clk gpt11_ick = {
1068 .name = "gpt11_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001069 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001070 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001071 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001072 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1073 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1074 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001075};
1076
1077static struct clk gpt11_fck = {
1078 .name = "gpt11_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001079 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001080 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001081 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001082 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1083 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
1084 .init = &omap2_init_clksel_parent,
1085 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1086 .clksel_mask = OMAP24XX_CLKSEL_GPT11_MASK,
1087 .clksel = omap24xx_gpt_clksel,
1088 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001089};
1090
1091static struct clk gpt12_ick = {
1092 .name = "gpt12_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001093 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001094 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001095 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001096 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1097 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1098 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001099};
1100
1101static struct clk gpt12_fck = {
1102 .name = "gpt12_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001103 .ops = &clkops_omap2_dflt_wait,
Paul Walmsleyf2480762009-04-23 21:11:10 -06001104 .parent = &secure_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001105 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001106 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1107 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
1108 .init = &omap2_init_clksel_parent,
1109 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2),
1110 .clksel_mask = OMAP24XX_CLKSEL_GPT12_MASK,
1111 .clksel = omap24xx_gpt_clksel,
1112 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001113};
1114
1115static struct clk mcbsp1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001116 .name = "mcbsp1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001117 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001118 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001119 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001120 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1121 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
1122 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001123};
1124
Paul Walmsleyb115b742010-10-08 11:40:18 -06001125static const struct clksel_rate common_mcbsp_96m_rates[] = {
1126 { .div = 1, .val = 0, .flags = RATE_IN_24XX },
1127 { .div = 0 }
1128};
1129
1130static const struct clksel_rate common_mcbsp_mcbsp_rates[] = {
1131 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
1132 { .div = 0 }
1133};
1134
1135static const struct clksel mcbsp_fck_clksel[] = {
1136 { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates },
1137 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
1138 { .parent = NULL }
1139};
1140
Tony Lindgren046d6b22005-11-10 14:26:52 +00001141static struct clk mcbsp1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001142 .name = "mcbsp1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001143 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001144 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001145 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001146 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001147 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1148 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001149 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1150 .clksel_mask = OMAP2_MCBSP1_CLKS_MASK,
1151 .clksel = mcbsp_fck_clksel,
1152 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001153};
1154
1155static struct clk mcbsp2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001156 .name = "mcbsp2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001157 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001158 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001159 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001160 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1161 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
1162 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001163};
1164
1165static struct clk mcbsp2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001166 .name = "mcbsp2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001167 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001168 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001169 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001170 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001171 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1172 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001173 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1174 .clksel_mask = OMAP2_MCBSP2_CLKS_MASK,
1175 .clksel = mcbsp_fck_clksel,
1176 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001177};
1178
1179static struct clk mcbsp3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001180 .name = "mcbsp3_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001181 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001182 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001183 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001184 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1185 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
1186 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001187};
1188
1189static struct clk mcbsp3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001190 .name = "mcbsp3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001191 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001192 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001193 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001194 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001195 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1196 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001197 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1198 .clksel_mask = OMAP2_MCBSP3_CLKS_MASK,
1199 .clksel = mcbsp_fck_clksel,
1200 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001201};
1202
1203static struct clk mcbsp4_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001204 .name = "mcbsp4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001205 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001206 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001207 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001208 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1209 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
1210 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001211};
1212
1213static struct clk mcbsp4_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001214 .name = "mcbsp4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001215 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001216 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001217 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001218 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001219 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1220 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001221 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1222 .clksel_mask = OMAP2_MCBSP4_CLKS_MASK,
1223 .clksel = mcbsp_fck_clksel,
1224 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001225};
1226
1227static struct clk mcbsp5_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001228 .name = "mcbsp5_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001229 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001230 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001231 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001232 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1233 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
1234 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001235};
1236
1237static struct clk mcbsp5_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001238 .name = "mcbsp5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001239 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001240 .parent = &func_96m_ck,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001241 .init = &omap2_init_clksel_parent,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001242 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001243 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1244 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
Paul Walmsleyb115b742010-10-08 11:40:18 -06001245 .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1),
1246 .clksel_mask = OMAP2_MCBSP5_CLKS_MASK,
1247 .clksel = mcbsp_fck_clksel,
1248 .recalc = &omap2_clksel_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001249};
1250
1251static struct clk mcspi1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001252 .name = "mcspi1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001253 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001254 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001255 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001256 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1257 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1258 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001259};
1260
1261static struct clk mcspi1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001262 .name = "mcspi1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001263 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001264 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001265 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001266 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1267 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1268 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001269};
1270
1271static struct clk mcspi2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001272 .name = "mcspi2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001273 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001274 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001275 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001276 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1277 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1278 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001279};
1280
1281static struct clk mcspi2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001282 .name = "mcspi2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001283 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001284 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001285 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001286 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1287 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
1288 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001289};
1290
1291static struct clk mcspi3_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001292 .name = "mcspi3_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001293 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001294 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001295 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001296 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1297 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1298 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001299};
1300
1301static struct clk mcspi3_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001302 .name = "mcspi3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001303 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001304 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001305 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001306 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1307 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
1308 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001309};
1310
1311static struct clk uart1_ick = {
1312 .name = "uart1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001313 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001314 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001315 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001316 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1317 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1318 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001319};
1320
1321static struct clk uart1_fck = {
1322 .name = "uart1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001323 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001324 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001325 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001326 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1327 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
1328 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001329};
1330
1331static struct clk uart2_ick = {
1332 .name = "uart2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001333 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001334 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001335 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001336 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1337 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1338 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001339};
1340
1341static struct clk uart2_fck = {
1342 .name = "uart2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001343 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001344 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001345 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001346 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1347 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
1348 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001349};
1350
1351static struct clk uart3_ick = {
1352 .name = "uart3_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001353 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001354 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001355 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001356 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1357 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1358 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001359};
1360
1361static struct clk uart3_fck = {
1362 .name = "uart3_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001363 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001364 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001365 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001366 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1367 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
1368 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001369};
1370
1371static struct clk gpios_ick = {
1372 .name = "gpios_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001373 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001374 .parent = &wu_l4_ick,
1375 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001376 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1377 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1378 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001379};
1380
1381static struct clk gpios_fck = {
1382 .name = "gpios_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001383 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001384 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001385 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001386 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1387 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1388 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001389};
1390
1391static struct clk mpu_wdt_ick = {
1392 .name = "mpu_wdt_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001393 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001394 .parent = &wu_l4_ick,
1395 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001396 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1397 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1398 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001399};
1400
1401static struct clk mpu_wdt_fck = {
1402 .name = "mpu_wdt_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001403 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001404 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001405 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001406 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1407 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1408 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001409};
1410
1411static struct clk sync_32k_ick = {
1412 .name = "sync_32k_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001413 .ops = &clkops_omap2_iclk_dflt_wait,
Russell King8ad8ff62009-01-19 15:27:29 +00001414 .flags = ENABLE_ON_INIT,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001415 .parent = &wu_l4_ick,
1416 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001417 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1418 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
1419 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001420};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001421
Tony Lindgren046d6b22005-11-10 14:26:52 +00001422static struct clk wdt1_ick = {
1423 .name = "wdt1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001424 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001425 .parent = &wu_l4_ick,
1426 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001427 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1428 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
1429 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001430};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001431
Tony Lindgren046d6b22005-11-10 14:26:52 +00001432static struct clk omapctrl_ick = {
1433 .name = "omapctrl_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001434 .ops = &clkops_omap2_iclk_dflt_wait,
Russell King8ad8ff62009-01-19 15:27:29 +00001435 .flags = ENABLE_ON_INIT,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001436 .parent = &wu_l4_ick,
1437 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001438 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1439 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
1440 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001441};
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001442
Tony Lindgren046d6b22005-11-10 14:26:52 +00001443static struct clk icr_ick = {
1444 .name = "icr_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001445 .ops = &clkops_omap2_iclk_dflt_wait,
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001446 .parent = &wu_l4_ick,
1447 .clkdm_name = "wkup_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001448 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1449 .enable_bit = OMAP2430_EN_ICR_SHIFT,
1450 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001451};
1452
1453static struct clk cam_ick = {
1454 .name = "cam_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001455 .ops = &clkops_omap2_iclk_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001456 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001457 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001458 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1459 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1460 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001461};
1462
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001463/*
1464 * cam_fck controls both CAM_MCLK and CAM_FCLK. It should probably be
1465 * split into two separate clocks, since the parent clocks are different
1466 * and the clockdomains are also different.
1467 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001468static struct clk cam_fck = {
1469 .name = "cam_fck",
Russell Kingbc51da42008-11-04 18:59:32 +00001470 .ops = &clkops_omap2_dflt,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001471 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001472 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001473 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1474 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
1475 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001476};
1477
1478static struct clk mailboxes_ick = {
1479 .name = "mailboxes_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001480 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001481 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001482 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001483 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1484 .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
1485 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001486};
1487
1488static struct clk wdt4_ick = {
1489 .name = "wdt4_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001490 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001491 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001492 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001493 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1494 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1495 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001496};
1497
1498static struct clk wdt4_fck = {
1499 .name = "wdt4_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001500 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001501 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001502 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001503 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1504 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
1505 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001506};
1507
Tony Lindgren046d6b22005-11-10 14:26:52 +00001508static struct clk mspro_ick = {
1509 .name = "mspro_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001510 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001511 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001512 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001513 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1514 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1515 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001516};
1517
1518static struct clk mspro_fck = {
1519 .name = "mspro_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001520 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001521 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001522 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001523 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1524 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
1525 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001526};
1527
Tony Lindgren046d6b22005-11-10 14:26:52 +00001528static struct clk fac_ick = {
1529 .name = "fac_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001530 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001531 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001532 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001533 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1534 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1535 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001536};
1537
1538static struct clk fac_fck = {
1539 .name = "fac_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001540 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001541 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001542 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001543 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1544 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
1545 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001546};
1547
Tony Lindgren046d6b22005-11-10 14:26:52 +00001548static struct clk hdq_ick = {
1549 .name = "hdq_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001550 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001551 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001552 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001553 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1554 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1555 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001556};
1557
1558static struct clk hdq_fck = {
1559 .name = "hdq_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001560 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001561 .parent = &func_12m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001562 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001563 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1564 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
1565 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001566};
1567
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001568/*
1569 * XXX This is marked as a 2420-only define, but it claims to be present
1570 * on 2430 also. Double-check.
1571 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001572static struct clk i2c2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001573 .name = "i2c2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001574 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001575 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001576 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001577 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1578 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
1579 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001580};
1581
Tony Lindgren046d6b22005-11-10 14:26:52 +00001582static struct clk i2chs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001583 .name = "i2chs2_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001584 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001585 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001586 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001587 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1588 .enable_bit = OMAP2430_EN_I2CHS2_SHIFT,
1589 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001590};
1591
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001592/*
1593 * XXX This is marked as a 2420-only define, but it claims to be present
1594 * on 2430 also. Double-check.
1595 */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001596static struct clk i2c1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001597 .name = "i2c1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001598 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001599 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001600 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001601 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1602 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
1603 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001604};
1605
Tony Lindgren046d6b22005-11-10 14:26:52 +00001606static struct clk i2chs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001607 .name = "i2chs1_fck",
Paul Walmsley3dc21972009-07-24 19:44:04 -06001608 .ops = &clkops_omap2430_i2chs_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001609 .parent = &func_96m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001610 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001611 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1612 .enable_bit = OMAP2430_EN_I2CHS1_SHIFT,
1613 .recalc = &followparent_recalc,
1614};
1615
Paul Walmsleya1d55622011-02-25 15:39:30 -07001616/*
1617 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1618 * accesses derived from this data.
1619 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001620static struct clk gpmc_fck = {
1621 .name = "gpmc_fck",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001622 .ops = &clkops_omap2_iclk_idle_only,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001623 .parent = &core_l3_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001624 .flags = ENABLE_ON_INIT,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001625 .clkdm_name = "core_l3_clkdm",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001626 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1627 .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001628 .recalc = &followparent_recalc,
1629};
1630
1631static struct clk sdma_fck = {
1632 .name = "sdma_fck",
Russell King897dcde2008-11-04 16:35:03 +00001633 .ops = &clkops_null, /* RMK: missing? */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001634 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001635 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001636 .recalc = &followparent_recalc,
1637};
1638
Paul Walmsleya1d55622011-02-25 15:39:30 -07001639/*
1640 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1641 * accesses derived from this data.
1642 */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001643static struct clk sdma_ick = {
1644 .name = "sdma_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001645 .ops = &clkops_omap2_iclk_idle_only,
Paul Walmsleya1fed572011-02-25 15:51:02 -07001646 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001647 .clkdm_name = "core_l3_clkdm",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001648 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1649 .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT,
Paul Walmsleye32744b2008-03-18 15:47:55 +02001650 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001651};
1652
Tony Lindgren046d6b22005-11-10 14:26:52 +00001653static struct clk sdrc_ick = {
1654 .name = "sdrc_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001655 .ops = &clkops_omap2_iclk_idle_only,
Paul Walmsleya1fed572011-02-25 15:51:02 -07001656 .parent = &core_l3_ck,
Russell King8ad8ff62009-01-19 15:27:29 +00001657 .flags = ENABLE_ON_INIT,
Paul Walmsleya1fed572011-02-25 15:51:02 -07001658 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001659 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1660 .enable_bit = OMAP2430_EN_SDRC_SHIFT,
1661 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001662};
1663
1664static struct clk des_ick = {
1665 .name = "des_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001666 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001667 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001668 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001669 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1670 .enable_bit = OMAP24XX_EN_DES_SHIFT,
1671 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001672};
1673
1674static struct clk sha_ick = {
1675 .name = "sha_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001676 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001677 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001678 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001679 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1680 .enable_bit = OMAP24XX_EN_SHA_SHIFT,
1681 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001682};
1683
1684static struct clk rng_ick = {
1685 .name = "rng_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001686 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001687 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001688 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001689 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1690 .enable_bit = OMAP24XX_EN_RNG_SHIFT,
1691 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001692};
1693
1694static struct clk aes_ick = {
1695 .name = "aes_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001696 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001697 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001698 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001699 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1700 .enable_bit = OMAP24XX_EN_AES_SHIFT,
1701 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001702};
1703
1704static struct clk pka_ick = {
1705 .name = "pka_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001706 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001707 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001708 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001709 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
1710 .enable_bit = OMAP24XX_EN_PKA_SHIFT,
1711 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001712};
1713
1714static struct clk usb_fck = {
1715 .name = "usb_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001716 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001717 .parent = &func_48m_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001718 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001719 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1720 .enable_bit = OMAP24XX_EN_USB_SHIFT,
1721 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001722};
1723
1724static struct clk usbhs_ick = {
1725 .name = "usbhs_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001726 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgrenfde0fd42006-01-17 15:31:18 -08001727 .parent = &core_l3_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001728 .clkdm_name = "core_l3_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001729 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1730 .enable_bit = OMAP2430_EN_USBHS_SHIFT,
1731 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001732};
1733
1734static struct clk mmchs1_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001735 .name = "mmchs1_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001736 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001737 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001738 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001739 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1740 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1741 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001742};
1743
1744static struct clk mmchs1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001745 .name = "mmchs1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001746 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001747 .parent = &func_96m_ck,
Paul Walmsleya4fc9272011-02-25 14:53:40 -07001748 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001749 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1750 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1751 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001752};
1753
1754static struct clk mmchs2_ick = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001755 .name = "mmchs2_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001756 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001757 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001758 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001759 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1760 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1761 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001762};
1763
1764static struct clk mmchs2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001765 .name = "mmchs2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001766 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001767 .parent = &func_96m_ck,
Paul Walmsleya4fc9272011-02-25 14:53:40 -07001768 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001769 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1770 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1771 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001772};
1773
1774static struct clk gpio5_ick = {
1775 .name = "gpio5_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001776 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001777 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001778 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001779 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1780 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1781 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001782};
1783
1784static struct clk gpio5_fck = {
1785 .name = "gpio5_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001786 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001787 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001788 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001789 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1790 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
1791 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001792};
1793
1794static struct clk mdm_intc_ick = {
1795 .name = "mdm_intc_ick",
Paul Walmsleya1d55622011-02-25 15:39:30 -07001796 .ops = &clkops_omap2_iclk_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001797 .parent = &l4_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001798 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001799 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1800 .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT,
1801 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001802};
1803
1804static struct clk mmchsdb1_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001805 .name = "mmchsdb1_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001806 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001807 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001808 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001809 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1810 .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT,
1811 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001812};
1813
1814static struct clk mmchsdb2_fck = {
Paul Walmsleyb92c1702010-02-22 22:09:19 -07001815 .name = "mmchsdb2_fck",
Russell Kingb36ee722008-11-04 17:59:52 +00001816 .ops = &clkops_omap2_dflt_wait,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001817 .parent = &func_32k_ck,
Paul Walmsleyd1b03f62008-08-19 11:08:44 +03001818 .clkdm_name = "core_l4_clkdm",
Paul Walmsleye32744b2008-03-18 15:47:55 +02001819 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1820 .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT,
1821 .recalc = &followparent_recalc,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001822};
Paul Walmsleye32744b2008-03-18 15:47:55 +02001823
Tony Lindgren046d6b22005-11-10 14:26:52 +00001824/*
1825 * This clock is a composite clock which does entire set changes then
1826 * forces a rebalance. It keys on the MPU speed, but it really could
1827 * be any key speed part of a set in the rate table.
1828 *
1829 * to really change a set, you need memory table sets which get changed
1830 * in sram, pre-notifiers & post notifiers, changing the top set, without
1831 * having low level display recalc's won't work... this is why dpm notifiers
1832 * work, isr's off, walk a list of clocks already _off_ and not messing with
1833 * the bus.
1834 *
1835 * This clock should have no parent. It embodies the entire upper level
1836 * active set. A parent will mess up some of the init also.
1837 */
1838static struct clk virt_prcm_set = {
1839 .name = "virt_prcm_set",
Russell King897dcde2008-11-04 16:35:03 +00001840 .ops = &clkops_null,
Tony Lindgren046d6b22005-11-10 14:26:52 +00001841 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
Paul Walmsleye32744b2008-03-18 15:47:55 +02001842 .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */
Tony Lindgren046d6b22005-11-10 14:26:52 +00001843 .set_rate = &omap2_select_table_rate,
1844 .round_rate = &omap2_round_to_table_rate,
1845};
Paul Walmsleye32744b2008-03-18 15:47:55 +02001846
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001847
1848/*
1849 * clkdev integration
1850 */
1851
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001852static struct omap_clk omap2430_clks[] = {
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001853 /* external root sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001854 CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X),
1855 CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X),
1856 CLK(NULL, "osc_ck", &osc_ck, CK_243X),
1857 CLK(NULL, "sys_ck", &sys_ck, CK_243X),
1858 CLK(NULL, "alt_ck", &alt_ck, CK_243X),
Paul Walmsleyb115b742010-10-08 11:40:18 -06001859 CLK("omap-mcbsp.1", "pad_fck", &mcbsp_clks, CK_243X),
1860 CLK("omap-mcbsp.2", "pad_fck", &mcbsp_clks, CK_243X),
1861 CLK("omap-mcbsp.3", "pad_fck", &mcbsp_clks, CK_243X),
1862 CLK("omap-mcbsp.4", "pad_fck", &mcbsp_clks, CK_243X),
1863 CLK("omap-mcbsp.5", "pad_fck", &mcbsp_clks, CK_243X),
1864 CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001865 /* internal analog sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001866 CLK(NULL, "dpll_ck", &dpll_ck, CK_243X),
1867 CLK(NULL, "apll96_ck", &apll96_ck, CK_243X),
1868 CLK(NULL, "apll54_ck", &apll54_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001869 /* internal prcm root sources */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001870 CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X),
1871 CLK(NULL, "core_ck", &core_ck, CK_243X),
Paul Walmsleyb115b742010-10-08 11:40:18 -06001872 CLK("omap-mcbsp.1", "prcm_fck", &func_96m_ck, CK_243X),
1873 CLK("omap-mcbsp.2", "prcm_fck", &func_96m_ck, CK_243X),
1874 CLK("omap-mcbsp.3", "prcm_fck", &func_96m_ck, CK_243X),
1875 CLK("omap-mcbsp.4", "prcm_fck", &func_96m_ck, CK_243X),
1876 CLK("omap-mcbsp.5", "prcm_fck", &func_96m_ck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001877 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X),
1878 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X),
1879 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X),
1880 CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X),
1881 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X),
1882 CLK(NULL, "sys_clkout", &sys_clkout, CK_243X),
1883 CLK(NULL, "emul_ck", &emul_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001884 /* mpu domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001885 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001886 /* dsp domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001887 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001888 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001889 /* GFX domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001890 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X),
1891 CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X),
1892 CLK(NULL, "gfx_ick", &gfx_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001893 /* Modem domain clocks */
1894 CLK(NULL, "mdm_ick", &mdm_ick, CK_243X),
1895 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
1896 /* DSS domain clocks */
Senthilvadivu Guruswamy8b9cb3a2011-01-24 06:21:58 +00001897 CLK("omapdss_dss", "ick", &dss_ick, CK_243X),
Sumit Semwal872462c2011-01-31 16:27:43 +00001898 CLK("omapdss_dss", "fck", &dss1_fck, CK_243X),
1899 CLK("omapdss_dss", "sys_clk", &dss2_fck, CK_243X),
1900 CLK("omapdss_dss", "tv_clk", &dss_54m_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001901 /* L3 domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001902 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X),
1903 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X),
1904 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001905 /* L4 domain clocks */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001906 CLK(NULL, "l4_ck", &l4_ck, CK_243X),
1907 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X),
Paul Walmsley19c1c0c2011-02-16 15:38:38 -07001908 CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001909 /* virtual meta-group clock */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001910 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001911 /* general l4 interface ck, multi-parent functional clk */
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001912 CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X),
1913 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X),
1914 CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X),
1915 CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X),
1916 CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X),
1917 CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X),
1918 CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X),
1919 CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X),
1920 CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X),
1921 CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X),
1922 CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X),
1923 CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X),
1924 CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X),
1925 CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X),
1926 CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X),
1927 CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X),
1928 CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X),
1929 CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X),
1930 CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X),
1931 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X),
1932 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X),
1933 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X),
1934 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X),
1935 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X),
1936 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X),
1937 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X),
1938 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X),
1939 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001940 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
1941 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X),
1942 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
1943 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X),
1944 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
1945 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001946 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X),
1947 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X),
1948 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X),
1949 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001950 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
1951 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001952 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X),
1953 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X),
1954 CLK(NULL, "uart2_ick", &uart2_ick, CK_243X),
1955 CLK(NULL, "uart2_fck", &uart2_fck, CK_243X),
1956 CLK(NULL, "uart3_ick", &uart3_ick, CK_243X),
1957 CLK(NULL, "uart3_fck", &uart3_fck, CK_243X),
1958 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X),
1959 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X),
1960 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X),
1961 CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X),
1962 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X),
1963 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X),
1964 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001965 CLK(NULL, "icr_ick", &icr_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001966 CLK("omap24xxcam", "fck", &cam_fck, CK_243X),
1967 CLK("omap24xxcam", "ick", &cam_ick, CK_243X),
1968 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X),
1969 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X),
1970 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X),
1971 CLK(NULL, "mspro_ick", &mspro_ick, CK_243X),
1972 CLK(NULL, "mspro_fck", &mspro_fck, CK_243X),
1973 CLK(NULL, "fac_ick", &fac_ick, CK_243X),
1974 CLK(NULL, "fac_fck", &fac_fck, CK_243X),
1975 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X),
1976 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X),
Benoit Coussonf7bb0d92010-12-09 14:24:16 +00001977 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X),
1978 CLK("omap_i2c.1", "fck", &i2chs1_fck, CK_243X),
1979 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X),
1980 CLK("omap_i2c.2", "fck", &i2chs2_fck, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001981 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X),
1982 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X),
1983 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001984 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001985 CLK(NULL, "des_ick", &des_ick, CK_243X),
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +08001986 CLK("omap-sham", "ick", &sha_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001987 CLK("omap_rng", "ick", &rng_ick, CK_243X),
Dmitry Kasatkin82a0c142010-08-20 13:44:46 +00001988 CLK("omap-aes", "ick", &aes_ick, CK_243X),
Paul Walmsley81b34fb2010-02-22 22:09:22 -07001989 CLK(NULL, "pka_ick", &pka_ick, CK_243X),
1990 CLK(NULL, "usb_fck", &usb_fck, CK_243X),
Felipe Balbi03491762010-12-02 09:57:08 +02001991 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X),
Kishore Kadiyala0005ae72011-02-28 20:48:05 +05301992 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X),
1993 CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_243X),
1994 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X),
1995 CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07001996 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
1997 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
1998 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
Kishore Kadiyala0005ae72011-02-28 20:48:05 +05301999 CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
2000 CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002001};
2002
2003/*
2004 * init code
2005 */
2006
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002007int __init omap2430_clk_init(void)
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002008{
2009 const struct prcm_config *prcm;
2010 struct omap_clk *c;
2011 u32 clkrate;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002012
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002013 prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
2014 cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST);
2015 cpu_mask = RATE_IN_243X;
2016 rate_table = omap2430_rate_table;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002017
2018 clk_init(&omap2_clk_functions);
2019
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002020 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
2021 c++)
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002022 clk_preinit(c->lk.clk);
2023
2024 osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
2025 propagate_rate(&osc_ck);
Paul Walmsley44da0a52010-01-26 20:13:08 -07002026 sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck);
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002027 propagate_rate(&sys_ck);
2028
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002029 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
2030 c++) {
2031 clkdev_add(&c->lk);
2032 clk_register(c->lk.clk);
2033 omap2_init_clk_clkdm(c->lk.clk);
2034 }
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002035
Paul Walmsleyc6461f52011-02-25 15:49:53 -07002036 /* Disable autoidle on all clocks; let the PM code enable it later */
2037 omap_clk_disable_autoidle_all();
2038
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002039 /* Check the MPU rate set by bootloader */
2040 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
2041 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
2042 if (!(prcm->flags & cpu_mask))
2043 continue;
2044 if (prcm->xtal_speed != sys_ck.rate)
2045 continue;
2046 if (prcm->dpll_speed <= clkrate)
2047 break;
2048 }
2049 curr_prcm_set = prcm;
2050
2051 recalculate_root_clocks();
2052
Paul Walmsley81b34fb2010-02-22 22:09:22 -07002053 pr_info("Clocking rate (Crystal/DPLL/MPU): %ld.%01ld/%ld/%ld MHz\n",
2054 (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10,
2055 (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ;
Paul Walmsleyd8a94452009-12-08 16:21:29 -07002056
2057 /*
2058 * Only enable those clocks we will need, let the drivers
2059 * enable other clocks as necessary
2060 */
2061 clk_enable_init_clocks();
2062
2063 /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
2064 vclk = clk_get(NULL, "virt_prcm_set");
2065 sclk = clk_get(NULL, "sys_ck");
2066 dclk = clk_get(NULL, "dpll_ck");
2067
2068 return 0;
2069}
Paul Walmsley6b8858a2008-03-18 10:35:15 +02002070