root / hw / omap_clk.c @ 21eea4b3
History | View | Annotate | Download (30.1 kB)
1 | c3d2689d | balrog | /*
|
---|---|---|---|
2 | c3d2689d | balrog | * OMAP clocks.
|
3 | c3d2689d | balrog | *
|
4 | 827df9f3 | balrog | * Copyright (C) 2006-2008 Andrzej Zaborowski <balrog@zabor.org>
|
5 | c3d2689d | balrog | *
|
6 | c3d2689d | balrog | * Clocks data comes in part from arch/arm/mach-omap1/clock.h in Linux.
|
7 | c3d2689d | balrog | *
|
8 | c3d2689d | balrog | * This program is free software; you can redistribute it and/or
|
9 | c3d2689d | balrog | * modify it under the terms of the GNU General Public License as
|
10 | c3d2689d | balrog | * published by the Free Software Foundation; either version 2 of
|
11 | c3d2689d | balrog | * the License, or (at your option) any later version.
|
12 | c3d2689d | balrog | *
|
13 | c3d2689d | balrog | * This program is distributed in the hope that it will be useful,
|
14 | c3d2689d | balrog | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 | c3d2689d | balrog | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 | c3d2689d | balrog | * GNU General Public License for more details.
|
17 | c3d2689d | balrog | *
|
18 | fad6cb1a | aurel32 | * You should have received a copy of the GNU General Public License along
|
19 | 8167ee88 | Blue Swirl | * with this program; if not, see <http://www.gnu.org/licenses/>.
|
20 | c3d2689d | balrog | */
|
21 | 87ecb68b | pbrook | #include "hw.h" |
22 | 87ecb68b | pbrook | #include "omap.h" |
23 | c3d2689d | balrog | |
24 | c3d2689d | balrog | struct clk {
|
25 | c3d2689d | balrog | const char *name; |
26 | c3d2689d | balrog | const char *alias; |
27 | c3d2689d | balrog | struct clk *parent;
|
28 | c3d2689d | balrog | struct clk *child1;
|
29 | c3d2689d | balrog | struct clk *sibling;
|
30 | c3d2689d | balrog | #define ALWAYS_ENABLED (1 << 0) |
31 | c3d2689d | balrog | #define CLOCK_IN_OMAP310 (1 << 10) |
32 | c3d2689d | balrog | #define CLOCK_IN_OMAP730 (1 << 11) |
33 | c3d2689d | balrog | #define CLOCK_IN_OMAP1510 (1 << 12) |
34 | c3d2689d | balrog | #define CLOCK_IN_OMAP16XX (1 << 13) |
35 | 827df9f3 | balrog | #define CLOCK_IN_OMAP242X (1 << 14) |
36 | 827df9f3 | balrog | #define CLOCK_IN_OMAP243X (1 << 15) |
37 | 827df9f3 | balrog | #define CLOCK_IN_OMAP343X (1 << 16) |
38 | c3d2689d | balrog | uint32_t flags; |
39 | c3d2689d | balrog | int id;
|
40 | c3d2689d | balrog | |
41 | c3d2689d | balrog | int running; /* Is currently ticking */ |
42 | c3d2689d | balrog | int enabled; /* Is enabled, regardless of its input clk */ |
43 | c3d2689d | balrog | unsigned long rate; /* Current rate (if .running) */ |
44 | c3d2689d | balrog | unsigned int divisor; /* Rate relative to input (if .enabled) */ |
45 | c3d2689d | balrog | unsigned int multiplier; /* Rate relative to input (if .enabled) */ |
46 | c3d2689d | balrog | qemu_irq users[16]; /* Who to notify on change */ |
47 | c3d2689d | balrog | int usecount; /* Automatically idle when unused */ |
48 | c3d2689d | balrog | }; |
49 | c3d2689d | balrog | |
50 | c3d2689d | balrog | static struct clk xtal_osc12m = { |
51 | c3d2689d | balrog | .name = "xtal_osc_12m",
|
52 | c3d2689d | balrog | .rate = 12000000,
|
53 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
54 | c3d2689d | balrog | }; |
55 | c3d2689d | balrog | |
56 | c3d2689d | balrog | static struct clk xtal_osc32k = { |
57 | c3d2689d | balrog | .name = "xtal_osc_32k",
|
58 | c3d2689d | balrog | .rate = 32768,
|
59 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
60 | 827df9f3 | balrog | CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
61 | c3d2689d | balrog | }; |
62 | c3d2689d | balrog | |
63 | c3d2689d | balrog | static struct clk ck_ref = { |
64 | c3d2689d | balrog | .name = "ck_ref",
|
65 | c3d2689d | balrog | .alias = "clkin",
|
66 | c3d2689d | balrog | .parent = &xtal_osc12m, |
67 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
68 | c3d2689d | balrog | ALWAYS_ENABLED, |
69 | c3d2689d | balrog | }; |
70 | c3d2689d | balrog | |
71 | c3d2689d | balrog | /* If a dpll is disabled it becomes a bypass, child clocks don't stop */
|
72 | c3d2689d | balrog | static struct clk dpll1 = { |
73 | c3d2689d | balrog | .name = "dpll1",
|
74 | c3d2689d | balrog | .parent = &ck_ref, |
75 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
76 | c3d2689d | balrog | ALWAYS_ENABLED, |
77 | c3d2689d | balrog | }; |
78 | c3d2689d | balrog | |
79 | c3d2689d | balrog | static struct clk dpll2 = { |
80 | c3d2689d | balrog | .name = "dpll2",
|
81 | c3d2689d | balrog | .parent = &ck_ref, |
82 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | ALWAYS_ENABLED, |
83 | c3d2689d | balrog | }; |
84 | c3d2689d | balrog | |
85 | c3d2689d | balrog | static struct clk dpll3 = { |
86 | c3d2689d | balrog | .name = "dpll3",
|
87 | c3d2689d | balrog | .parent = &ck_ref, |
88 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | ALWAYS_ENABLED, |
89 | c3d2689d | balrog | }; |
90 | c3d2689d | balrog | |
91 | c3d2689d | balrog | static struct clk dpll4 = { |
92 | c3d2689d | balrog | .name = "dpll4",
|
93 | c3d2689d | balrog | .parent = &ck_ref, |
94 | c3d2689d | balrog | .multiplier = 4,
|
95 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
96 | c3d2689d | balrog | }; |
97 | c3d2689d | balrog | |
98 | c3d2689d | balrog | static struct clk apll = { |
99 | c3d2689d | balrog | .name = "apll",
|
100 | c3d2689d | balrog | .parent = &ck_ref, |
101 | c3d2689d | balrog | .multiplier = 48,
|
102 | c3d2689d | balrog | .divisor = 12,
|
103 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
104 | c3d2689d | balrog | }; |
105 | c3d2689d | balrog | |
106 | c3d2689d | balrog | static struct clk ck_48m = { |
107 | c3d2689d | balrog | .name = "ck_48m",
|
108 | c3d2689d | balrog | .parent = &dpll4, /* either dpll4 or apll */
|
109 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
110 | c3d2689d | balrog | }; |
111 | c3d2689d | balrog | |
112 | c3d2689d | balrog | static struct clk ck_dpll1out = { |
113 | c3d2689d | balrog | .name = "ck_dpll1out",
|
114 | c3d2689d | balrog | .parent = &dpll1, |
115 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
116 | c3d2689d | balrog | }; |
117 | c3d2689d | balrog | |
118 | c3d2689d | balrog | static struct clk sossi_ck = { |
119 | c3d2689d | balrog | .name = "ck_sossi",
|
120 | c3d2689d | balrog | .parent = &ck_dpll1out, |
121 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
122 | c3d2689d | balrog | }; |
123 | c3d2689d | balrog | |
124 | c3d2689d | balrog | static struct clk clkm1 = { |
125 | c3d2689d | balrog | .name = "clkm1",
|
126 | c3d2689d | balrog | .alias = "ck_gen1",
|
127 | c3d2689d | balrog | .parent = &dpll1, |
128 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
129 | c3d2689d | balrog | ALWAYS_ENABLED, |
130 | c3d2689d | balrog | }; |
131 | c3d2689d | balrog | |
132 | c3d2689d | balrog | static struct clk clkm2 = { |
133 | c3d2689d | balrog | .name = "clkm2",
|
134 | c3d2689d | balrog | .alias = "ck_gen2",
|
135 | c3d2689d | balrog | .parent = &dpll1, |
136 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
137 | c3d2689d | balrog | ALWAYS_ENABLED, |
138 | c3d2689d | balrog | }; |
139 | c3d2689d | balrog | |
140 | c3d2689d | balrog | static struct clk clkm3 = { |
141 | c3d2689d | balrog | .name = "clkm3",
|
142 | c3d2689d | balrog | .alias = "ck_gen3",
|
143 | c3d2689d | balrog | .parent = &dpll1, /* either dpll1 or ck_ref */
|
144 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
145 | c3d2689d | balrog | ALWAYS_ENABLED, |
146 | c3d2689d | balrog | }; |
147 | c3d2689d | balrog | |
148 | c3d2689d | balrog | static struct clk arm_ck = { |
149 | c3d2689d | balrog | .name = "arm_ck",
|
150 | c3d2689d | balrog | .alias = "mpu_ck",
|
151 | c3d2689d | balrog | .parent = &clkm1, |
152 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
153 | c3d2689d | balrog | ALWAYS_ENABLED, |
154 | c3d2689d | balrog | }; |
155 | c3d2689d | balrog | |
156 | c3d2689d | balrog | static struct clk armper_ck = { |
157 | c3d2689d | balrog | .name = "armper_ck",
|
158 | c3d2689d | balrog | .alias = "mpuper_ck",
|
159 | c3d2689d | balrog | .parent = &clkm1, |
160 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
161 | c3d2689d | balrog | }; |
162 | c3d2689d | balrog | |
163 | c3d2689d | balrog | static struct clk arm_gpio_ck = { |
164 | c3d2689d | balrog | .name = "arm_gpio_ck",
|
165 | c3d2689d | balrog | .alias = "mpu_gpio_ck",
|
166 | c3d2689d | balrog | .parent = &clkm1, |
167 | c3d2689d | balrog | .divisor = 1,
|
168 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, |
169 | c3d2689d | balrog | }; |
170 | c3d2689d | balrog | |
171 | c3d2689d | balrog | static struct clk armxor_ck = { |
172 | c3d2689d | balrog | .name = "armxor_ck",
|
173 | c3d2689d | balrog | .alias = "mpuxor_ck",
|
174 | c3d2689d | balrog | .parent = &ck_ref, |
175 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
176 | c3d2689d | balrog | }; |
177 | c3d2689d | balrog | |
178 | c3d2689d | balrog | static struct clk armtim_ck = { |
179 | c3d2689d | balrog | .name = "armtim_ck",
|
180 | c3d2689d | balrog | .alias = "mputim_ck",
|
181 | c3d2689d | balrog | .parent = &ck_ref, /* either CLKIN or DPLL1 */
|
182 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
183 | c3d2689d | balrog | }; |
184 | c3d2689d | balrog | |
185 | c3d2689d | balrog | static struct clk armwdt_ck = { |
186 | c3d2689d | balrog | .name = "armwdt_ck",
|
187 | c3d2689d | balrog | .alias = "mpuwd_ck",
|
188 | c3d2689d | balrog | .parent = &clkm1, |
189 | c3d2689d | balrog | .divisor = 14,
|
190 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
191 | c3d2689d | balrog | ALWAYS_ENABLED, |
192 | c3d2689d | balrog | }; |
193 | c3d2689d | balrog | |
194 | c3d2689d | balrog | static struct clk arminth_ck16xx = { |
195 | c3d2689d | balrog | .name = "arminth_ck",
|
196 | c3d2689d | balrog | .parent = &arm_ck, |
197 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, |
198 | c3d2689d | balrog | /* Note: On 16xx the frequency can be divided by 2 by programming
|
199 | c3d2689d | balrog | * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1
|
200 | c3d2689d | balrog | *
|
201 | c3d2689d | balrog | * 1510 version is in TC clocks.
|
202 | c3d2689d | balrog | */
|
203 | c3d2689d | balrog | }; |
204 | c3d2689d | balrog | |
205 | c3d2689d | balrog | static struct clk dsp_ck = { |
206 | c3d2689d | balrog | .name = "dsp_ck",
|
207 | c3d2689d | balrog | .parent = &clkm2, |
208 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX, |
209 | c3d2689d | balrog | }; |
210 | c3d2689d | balrog | |
211 | c3d2689d | balrog | static struct clk dspmmu_ck = { |
212 | c3d2689d | balrog | .name = "dspmmu_ck",
|
213 | c3d2689d | balrog | .parent = &clkm2, |
214 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | |
215 | c3d2689d | balrog | ALWAYS_ENABLED, |
216 | c3d2689d | balrog | }; |
217 | c3d2689d | balrog | |
218 | c3d2689d | balrog | static struct clk dspper_ck = { |
219 | c3d2689d | balrog | .name = "dspper_ck",
|
220 | c3d2689d | balrog | .parent = &clkm2, |
221 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX, |
222 | c3d2689d | balrog | }; |
223 | c3d2689d | balrog | |
224 | c3d2689d | balrog | static struct clk dspxor_ck = { |
225 | c3d2689d | balrog | .name = "dspxor_ck",
|
226 | c3d2689d | balrog | .parent = &ck_ref, |
227 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX, |
228 | c3d2689d | balrog | }; |
229 | c3d2689d | balrog | |
230 | c3d2689d | balrog | static struct clk dsptim_ck = { |
231 | c3d2689d | balrog | .name = "dsptim_ck",
|
232 | c3d2689d | balrog | .parent = &ck_ref, |
233 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX, |
234 | c3d2689d | balrog | }; |
235 | c3d2689d | balrog | |
236 | c3d2689d | balrog | static struct clk tc_ck = { |
237 | c3d2689d | balrog | .name = "tc_ck",
|
238 | c3d2689d | balrog | .parent = &clkm3, |
239 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | |
240 | c3d2689d | balrog | CLOCK_IN_OMAP730 | CLOCK_IN_OMAP310 | |
241 | c3d2689d | balrog | ALWAYS_ENABLED, |
242 | c3d2689d | balrog | }; |
243 | c3d2689d | balrog | |
244 | c3d2689d | balrog | static struct clk arminth_ck15xx = { |
245 | c3d2689d | balrog | .name = "arminth_ck",
|
246 | c3d2689d | balrog | .parent = &tc_ck, |
247 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED, |
248 | c3d2689d | balrog | /* Note: On 1510 the frequency follows TC_CK
|
249 | c3d2689d | balrog | *
|
250 | c3d2689d | balrog | * 16xx version is in MPU clocks.
|
251 | c3d2689d | balrog | */
|
252 | c3d2689d | balrog | }; |
253 | c3d2689d | balrog | |
254 | c3d2689d | balrog | static struct clk tipb_ck = { |
255 | c3d2689d | balrog | /* No-idle controlled by "tc_ck" */
|
256 | c3d2689d | balrog | .name = "tipb_ck",
|
257 | c3d2689d | balrog | .parent = &tc_ck, |
258 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED, |
259 | c3d2689d | balrog | }; |
260 | c3d2689d | balrog | |
261 | c3d2689d | balrog | static struct clk l3_ocpi_ck = { |
262 | c3d2689d | balrog | /* No-idle controlled by "tc_ck" */
|
263 | c3d2689d | balrog | .name = "l3_ocpi_ck",
|
264 | c3d2689d | balrog | .parent = &tc_ck, |
265 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
266 | c3d2689d | balrog | }; |
267 | c3d2689d | balrog | |
268 | c3d2689d | balrog | static struct clk tc1_ck = { |
269 | c3d2689d | balrog | .name = "tc1_ck",
|
270 | c3d2689d | balrog | .parent = &tc_ck, |
271 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
272 | c3d2689d | balrog | }; |
273 | c3d2689d | balrog | |
274 | c3d2689d | balrog | static struct clk tc2_ck = { |
275 | c3d2689d | balrog | .name = "tc2_ck",
|
276 | c3d2689d | balrog | .parent = &tc_ck, |
277 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
278 | c3d2689d | balrog | }; |
279 | c3d2689d | balrog | |
280 | c3d2689d | balrog | static struct clk dma_ck = { |
281 | c3d2689d | balrog | /* No-idle controlled by "tc_ck" */
|
282 | c3d2689d | balrog | .name = "dma_ck",
|
283 | c3d2689d | balrog | .parent = &tc_ck, |
284 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
285 | c3d2689d | balrog | ALWAYS_ENABLED, |
286 | c3d2689d | balrog | }; |
287 | c3d2689d | balrog | |
288 | c3d2689d | balrog | static struct clk dma_lcdfree_ck = { |
289 | c3d2689d | balrog | .name = "dma_lcdfree_ck",
|
290 | c3d2689d | balrog | .parent = &tc_ck, |
291 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, |
292 | c3d2689d | balrog | }; |
293 | c3d2689d | balrog | |
294 | c3d2689d | balrog | static struct clk api_ck = { |
295 | c3d2689d | balrog | .name = "api_ck",
|
296 | c3d2689d | balrog | .alias = "mpui_ck",
|
297 | c3d2689d | balrog | .parent = &tc_ck, |
298 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
299 | c3d2689d | balrog | }; |
300 | c3d2689d | balrog | |
301 | c3d2689d | balrog | static struct clk lb_ck = { |
302 | c3d2689d | balrog | .name = "lb_ck",
|
303 | c3d2689d | balrog | .parent = &tc_ck, |
304 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, |
305 | c3d2689d | balrog | }; |
306 | c3d2689d | balrog | |
307 | c3d2689d | balrog | static struct clk lbfree_ck = { |
308 | c3d2689d | balrog | .name = "lbfree_ck",
|
309 | c3d2689d | balrog | .parent = &tc_ck, |
310 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, |
311 | c3d2689d | balrog | }; |
312 | c3d2689d | balrog | |
313 | d8f699cb | balrog | static struct clk hsab_ck = { |
314 | d8f699cb | balrog | .name = "hsab_ck",
|
315 | d8f699cb | balrog | .parent = &tc_ck, |
316 | d8f699cb | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, |
317 | d8f699cb | balrog | }; |
318 | d8f699cb | balrog | |
319 | c3d2689d | balrog | static struct clk rhea1_ck = { |
320 | c3d2689d | balrog | .name = "rhea1_ck",
|
321 | c3d2689d | balrog | .parent = &tc_ck, |
322 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, |
323 | c3d2689d | balrog | }; |
324 | c3d2689d | balrog | |
325 | c3d2689d | balrog | static struct clk rhea2_ck = { |
326 | c3d2689d | balrog | .name = "rhea2_ck",
|
327 | c3d2689d | balrog | .parent = &tc_ck, |
328 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, |
329 | c3d2689d | balrog | }; |
330 | c3d2689d | balrog | |
331 | c3d2689d | balrog | static struct clk lcd_ck_16xx = { |
332 | c3d2689d | balrog | .name = "lcd_ck",
|
333 | c3d2689d | balrog | .parent = &clkm3, |
334 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP730, |
335 | c3d2689d | balrog | }; |
336 | c3d2689d | balrog | |
337 | c3d2689d | balrog | static struct clk lcd_ck_1510 = { |
338 | c3d2689d | balrog | .name = "lcd_ck",
|
339 | c3d2689d | balrog | .parent = &clkm3, |
340 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, |
341 | c3d2689d | balrog | }; |
342 | c3d2689d | balrog | |
343 | c3d2689d | balrog | static struct clk uart1_1510 = { |
344 | c3d2689d | balrog | .name = "uart1_ck",
|
345 | c3d2689d | balrog | /* Direct from ULPD, no real parent */
|
346 | c3d2689d | balrog | .parent = &armper_ck, /* either armper_ck or dpll4 */
|
347 | c3d2689d | balrog | .rate = 12000000,
|
348 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED, |
349 | c3d2689d | balrog | }; |
350 | c3d2689d | balrog | |
351 | c3d2689d | balrog | static struct clk uart1_16xx = { |
352 | c3d2689d | balrog | .name = "uart1_ck",
|
353 | c3d2689d | balrog | /* Direct from ULPD, no real parent */
|
354 | c3d2689d | balrog | .parent = &armper_ck, |
355 | c3d2689d | balrog | .rate = 48000000,
|
356 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
357 | c3d2689d | balrog | }; |
358 | c3d2689d | balrog | |
359 | c3d2689d | balrog | static struct clk uart2_ck = { |
360 | c3d2689d | balrog | .name = "uart2_ck",
|
361 | c3d2689d | balrog | /* Direct from ULPD, no real parent */
|
362 | c3d2689d | balrog | .parent = &armper_ck, /* either armper_ck or dpll4 */
|
363 | c3d2689d | balrog | .rate = 12000000,
|
364 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310 | |
365 | c3d2689d | balrog | ALWAYS_ENABLED, |
366 | c3d2689d | balrog | }; |
367 | c3d2689d | balrog | |
368 | c3d2689d | balrog | static struct clk uart3_1510 = { |
369 | c3d2689d | balrog | .name = "uart3_ck",
|
370 | c3d2689d | balrog | /* Direct from ULPD, no real parent */
|
371 | d8f699cb | balrog | .parent = &armper_ck, /* either armper_ck or dpll4 */
|
372 | c3d2689d | balrog | .rate = 12000000,
|
373 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | ALWAYS_ENABLED, |
374 | c3d2689d | balrog | }; |
375 | c3d2689d | balrog | |
376 | c3d2689d | balrog | static struct clk uart3_16xx = { |
377 | c3d2689d | balrog | .name = "uart3_ck",
|
378 | c3d2689d | balrog | /* Direct from ULPD, no real parent */
|
379 | c3d2689d | balrog | .parent = &armper_ck, |
380 | c3d2689d | balrog | .rate = 48000000,
|
381 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
382 | c3d2689d | balrog | }; |
383 | c3d2689d | balrog | |
384 | c3d2689d | balrog | static struct clk usb_clk0 = { /* 6 MHz output on W4_USB_CLK0 */ |
385 | c3d2689d | balrog | .name = "usb_clk0",
|
386 | c3d2689d | balrog | .alias = "usb.clko",
|
387 | c3d2689d | balrog | /* Direct from ULPD, no parent */
|
388 | c3d2689d | balrog | .rate = 6000000,
|
389 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
390 | c3d2689d | balrog | }; |
391 | c3d2689d | balrog | |
392 | c3d2689d | balrog | static struct clk usb_hhc_ck1510 = { |
393 | c3d2689d | balrog | .name = "usb_hhc_ck",
|
394 | c3d2689d | balrog | /* Direct from ULPD, no parent */
|
395 | c3d2689d | balrog | .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */ |
396 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, |
397 | c3d2689d | balrog | }; |
398 | c3d2689d | balrog | |
399 | c3d2689d | balrog | static struct clk usb_hhc_ck16xx = { |
400 | c3d2689d | balrog | .name = "usb_hhc_ck",
|
401 | c3d2689d | balrog | /* Direct from ULPD, no parent */
|
402 | c3d2689d | balrog | .rate = 48000000,
|
403 | c3d2689d | balrog | /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */
|
404 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
405 | c3d2689d | balrog | }; |
406 | c3d2689d | balrog | |
407 | d8f699cb | balrog | static struct clk usb_w2fc_mclk = { |
408 | d8f699cb | balrog | .name = "usb_w2fc_mclk",
|
409 | d8f699cb | balrog | .alias = "usb_w2fc_ck",
|
410 | d8f699cb | balrog | .parent = &ck_48m, |
411 | c3d2689d | balrog | .rate = 48000000,
|
412 | d8f699cb | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX, |
413 | c3d2689d | balrog | }; |
414 | c3d2689d | balrog | |
415 | c3d2689d | balrog | static struct clk mclk_1510 = { |
416 | c3d2689d | balrog | .name = "mclk",
|
417 | c3d2689d | balrog | /* Direct from ULPD, no parent. May be enabled by ext hardware. */
|
418 | c3d2689d | balrog | .rate = 12000000,
|
419 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510, |
420 | c3d2689d | balrog | }; |
421 | c3d2689d | balrog | |
422 | c3d2689d | balrog | static struct clk bclk_310 = { |
423 | c3d2689d | balrog | .name = "bt_mclk_out", /* Alias midi_mclk_out? */ |
424 | c3d2689d | balrog | .parent = &armper_ck, |
425 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310, |
426 | c3d2689d | balrog | }; |
427 | c3d2689d | balrog | |
428 | c3d2689d | balrog | static struct clk mclk_310 = { |
429 | c3d2689d | balrog | .name = "com_mclk_out",
|
430 | c3d2689d | balrog | .parent = &armper_ck, |
431 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310, |
432 | c3d2689d | balrog | }; |
433 | c3d2689d | balrog | |
434 | c3d2689d | balrog | static struct clk mclk_16xx = { |
435 | c3d2689d | balrog | .name = "mclk",
|
436 | c3d2689d | balrog | /* Direct from ULPD, no parent. May be enabled by ext hardware. */
|
437 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
438 | c3d2689d | balrog | }; |
439 | c3d2689d | balrog | |
440 | c3d2689d | balrog | static struct clk bclk_1510 = { |
441 | c3d2689d | balrog | .name = "bclk",
|
442 | c3d2689d | balrog | /* Direct from ULPD, no parent. May be enabled by ext hardware. */
|
443 | c3d2689d | balrog | .rate = 12000000,
|
444 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510, |
445 | c3d2689d | balrog | }; |
446 | c3d2689d | balrog | |
447 | c3d2689d | balrog | static struct clk bclk_16xx = { |
448 | c3d2689d | balrog | .name = "bclk",
|
449 | c3d2689d | balrog | /* Direct from ULPD, no parent. May be enabled by ext hardware. */
|
450 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
451 | c3d2689d | balrog | }; |
452 | c3d2689d | balrog | |
453 | c3d2689d | balrog | static struct clk mmc1_ck = { |
454 | c3d2689d | balrog | .name = "mmc_ck",
|
455 | c3d2689d | balrog | .id = 1,
|
456 | c3d2689d | balrog | /* Functional clock is direct from ULPD, interface clock is ARMPER */
|
457 | c3d2689d | balrog | .parent = &armper_ck, /* either armper_ck or dpll4 */
|
458 | c3d2689d | balrog | .rate = 48000000,
|
459 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP310, |
460 | c3d2689d | balrog | }; |
461 | c3d2689d | balrog | |
462 | c3d2689d | balrog | static struct clk mmc2_ck = { |
463 | c3d2689d | balrog | .name = "mmc_ck",
|
464 | c3d2689d | balrog | .id = 2,
|
465 | c3d2689d | balrog | /* Functional clock is direct from ULPD, interface clock is ARMPER */
|
466 | c3d2689d | balrog | .parent = &armper_ck, |
467 | c3d2689d | balrog | .rate = 48000000,
|
468 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX, |
469 | c3d2689d | balrog | }; |
470 | c3d2689d | balrog | |
471 | c3d2689d | balrog | static struct clk cam_mclk = { |
472 | c3d2689d | balrog | .name = "cam.mclk",
|
473 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX, |
474 | c3d2689d | balrog | .rate = 12000000,
|
475 | c3d2689d | balrog | }; |
476 | c3d2689d | balrog | |
477 | c3d2689d | balrog | static struct clk cam_exclk = { |
478 | c3d2689d | balrog | .name = "cam.exclk",
|
479 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX, |
480 | c3d2689d | balrog | /* Either 12M from cam.mclk or 48M from dpll4 */
|
481 | c3d2689d | balrog | .parent = &cam_mclk, |
482 | c3d2689d | balrog | }; |
483 | c3d2689d | balrog | |
484 | c3d2689d | balrog | static struct clk cam_lclk = { |
485 | c3d2689d | balrog | .name = "cam.lclk",
|
486 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX, |
487 | c3d2689d | balrog | }; |
488 | c3d2689d | balrog | |
489 | c3d2689d | balrog | static struct clk i2c_fck = { |
490 | c3d2689d | balrog | .name = "i2c_fck",
|
491 | c3d2689d | balrog | .id = 1,
|
492 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | |
493 | c3d2689d | balrog | ALWAYS_ENABLED, |
494 | c3d2689d | balrog | .parent = &armxor_ck, |
495 | c3d2689d | balrog | }; |
496 | c3d2689d | balrog | |
497 | c3d2689d | balrog | static struct clk i2c_ick = { |
498 | c3d2689d | balrog | .name = "i2c_ick",
|
499 | c3d2689d | balrog | .id = 1,
|
500 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED, |
501 | c3d2689d | balrog | .parent = &armper_ck, |
502 | c3d2689d | balrog | }; |
503 | c3d2689d | balrog | |
504 | c3d2689d | balrog | static struct clk clk32k = { |
505 | c3d2689d | balrog | .name = "clk32-kHz",
|
506 | c3d2689d | balrog | .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | |
507 | 827df9f3 | balrog | CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED, |
508 | 827df9f3 | balrog | .parent = &xtal_osc32k, |
509 | 827df9f3 | balrog | }; |
510 | 827df9f3 | balrog | |
511 | 51fec3cc | balrog | static struct clk ref_clk = { |
512 | 51fec3cc | balrog | .name = "ref_clk",
|
513 | 51fec3cc | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED, |
514 | 51fec3cc | balrog | .rate = 12000000, /* 12 MHz or 13 MHz or 19.2 MHz */ |
515 | 51fec3cc | balrog | /*.parent = sys.xtalin */
|
516 | 51fec3cc | balrog | }; |
517 | 51fec3cc | balrog | |
518 | 827df9f3 | balrog | static struct clk apll_96m = { |
519 | 827df9f3 | balrog | .name = "apll_96m",
|
520 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED, |
521 | 827df9f3 | balrog | .rate = 96000000,
|
522 | 51fec3cc | balrog | /*.parent = ref_clk */
|
523 | 827df9f3 | balrog | }; |
524 | 827df9f3 | balrog | |
525 | 827df9f3 | balrog | static struct clk apll_54m = { |
526 | 827df9f3 | balrog | .name = "apll_54m",
|
527 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED, |
528 | 827df9f3 | balrog | .rate = 54000000,
|
529 | 51fec3cc | balrog | /*.parent = ref_clk */
|
530 | 827df9f3 | balrog | }; |
531 | 827df9f3 | balrog | |
532 | 827df9f3 | balrog | static struct clk sys_clk = { |
533 | 827df9f3 | balrog | .name = "sys_clk",
|
534 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED, |
535 | 827df9f3 | balrog | .rate = 32768,
|
536 | 827df9f3 | balrog | /*.parent = sys.xtalin */
|
537 | 827df9f3 | balrog | }; |
538 | 827df9f3 | balrog | |
539 | 827df9f3 | balrog | static struct clk sleep_clk = { |
540 | 827df9f3 | balrog | .name = "sleep_clk",
|
541 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED, |
542 | 827df9f3 | balrog | .rate = 32768,
|
543 | 827df9f3 | balrog | /*.parent = sys.xtalin */
|
544 | 827df9f3 | balrog | }; |
545 | 827df9f3 | balrog | |
546 | 827df9f3 | balrog | static struct clk dpll_ck = { |
547 | 827df9f3 | balrog | .name = "dpll",
|
548 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED, |
549 | 51fec3cc | balrog | .parent = &ref_clk, |
550 | 827df9f3 | balrog | }; |
551 | 827df9f3 | balrog | |
552 | 827df9f3 | balrog | static struct clk dpll_x2_ck = { |
553 | 827df9f3 | balrog | .name = "dpll_x2",
|
554 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED, |
555 | 51fec3cc | balrog | .parent = &ref_clk, |
556 | 827df9f3 | balrog | }; |
557 | 827df9f3 | balrog | |
558 | 827df9f3 | balrog | static struct clk wdt1_sys_clk = { |
559 | 827df9f3 | balrog | .name = "wdt1_sys_clk",
|
560 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED, |
561 | 827df9f3 | balrog | .rate = 32768,
|
562 | 827df9f3 | balrog | /*.parent = sys.xtalin */
|
563 | 827df9f3 | balrog | }; |
564 | 827df9f3 | balrog | |
565 | 827df9f3 | balrog | static struct clk func_96m_clk = { |
566 | 827df9f3 | balrog | .name = "func_96m_clk",
|
567 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
568 | 827df9f3 | balrog | .divisor = 1,
|
569 | 827df9f3 | balrog | .parent = &apll_96m, |
570 | 827df9f3 | balrog | }; |
571 | 827df9f3 | balrog | |
572 | 827df9f3 | balrog | static struct clk func_48m_clk = { |
573 | 827df9f3 | balrog | .name = "func_48m_clk",
|
574 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
575 | 827df9f3 | balrog | .divisor = 2,
|
576 | 827df9f3 | balrog | .parent = &apll_96m, |
577 | 827df9f3 | balrog | }; |
578 | 827df9f3 | balrog | |
579 | 827df9f3 | balrog | static struct clk func_12m_clk = { |
580 | 827df9f3 | balrog | .name = "func_12m_clk",
|
581 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
582 | 827df9f3 | balrog | .divisor = 8,
|
583 | 827df9f3 | balrog | .parent = &apll_96m, |
584 | 827df9f3 | balrog | }; |
585 | 827df9f3 | balrog | |
586 | 827df9f3 | balrog | static struct clk func_54m_clk = { |
587 | 827df9f3 | balrog | .name = "func_54m_clk",
|
588 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X, |
589 | 827df9f3 | balrog | .divisor = 1,
|
590 | 827df9f3 | balrog | .parent = &apll_54m, |
591 | 827df9f3 | balrog | }; |
592 | 827df9f3 | balrog | |
593 | 827df9f3 | balrog | static struct clk sys_clkout = { |
594 | 827df9f3 | balrog | .name = "clkout",
|
595 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
596 | 827df9f3 | balrog | .parent = &sys_clk, |
597 | 827df9f3 | balrog | }; |
598 | 827df9f3 | balrog | |
599 | 827df9f3 | balrog | static struct clk sys_clkout2 = { |
600 | 827df9f3 | balrog | .name = "clkout2",
|
601 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
602 | 827df9f3 | balrog | .parent = &sys_clk, |
603 | 827df9f3 | balrog | }; |
604 | 827df9f3 | balrog | |
605 | 827df9f3 | balrog | static struct clk core_clk = { |
606 | 827df9f3 | balrog | .name = "core_clk",
|
607 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
608 | 51fec3cc | balrog | .parent = &dpll_x2_ck, /* Switchable between dpll_ck and clk32k */
|
609 | 827df9f3 | balrog | }; |
610 | 827df9f3 | balrog | |
611 | 827df9f3 | balrog | static struct clk l3_clk = { |
612 | 827df9f3 | balrog | .name = "l3_clk",
|
613 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
614 | 827df9f3 | balrog | .parent = &core_clk, |
615 | 827df9f3 | balrog | }; |
616 | 827df9f3 | balrog | |
617 | 827df9f3 | balrog | static struct clk core_l4_iclk = { |
618 | 827df9f3 | balrog | .name = "core_l4_iclk",
|
619 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
620 | 827df9f3 | balrog | .parent = &l3_clk, |
621 | 827df9f3 | balrog | }; |
622 | 827df9f3 | balrog | |
623 | 827df9f3 | balrog | static struct clk wu_l4_iclk = { |
624 | 827df9f3 | balrog | .name = "wu_l4_iclk",
|
625 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
626 | 827df9f3 | balrog | .parent = &l3_clk, |
627 | 827df9f3 | balrog | }; |
628 | 827df9f3 | balrog | |
629 | 827df9f3 | balrog | static struct clk core_l3_iclk = { |
630 | 827df9f3 | balrog | .name = "core_l3_iclk",
|
631 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
632 | 827df9f3 | balrog | .parent = &core_clk, |
633 | 827df9f3 | balrog | }; |
634 | 827df9f3 | balrog | |
635 | 827df9f3 | balrog | static struct clk core_l4_usb_clk = { |
636 | 827df9f3 | balrog | .name = "core_l4_usb_clk",
|
637 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
638 | 827df9f3 | balrog | .parent = &l3_clk, |
639 | 827df9f3 | balrog | }; |
640 | 827df9f3 | balrog | |
641 | 827df9f3 | balrog | static struct clk wu_gpt1_clk = { |
642 | 827df9f3 | balrog | .name = "wu_gpt1_clk",
|
643 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
644 | 827df9f3 | balrog | .parent = &sys_clk, |
645 | 827df9f3 | balrog | }; |
646 | 827df9f3 | balrog | |
647 | 827df9f3 | balrog | static struct clk wu_32k_clk = { |
648 | 827df9f3 | balrog | .name = "wu_32k_clk",
|
649 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
650 | 827df9f3 | balrog | .parent = &sys_clk, |
651 | 827df9f3 | balrog | }; |
652 | 827df9f3 | balrog | |
653 | 827df9f3 | balrog | static struct clk uart1_fclk = { |
654 | 827df9f3 | balrog | .name = "uart1_fclk",
|
655 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
656 | 827df9f3 | balrog | .parent = &func_48m_clk, |
657 | 827df9f3 | balrog | }; |
658 | 827df9f3 | balrog | |
659 | 827df9f3 | balrog | static struct clk uart1_iclk = { |
660 | 827df9f3 | balrog | .name = "uart1_iclk",
|
661 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
662 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
663 | 827df9f3 | balrog | }; |
664 | 827df9f3 | balrog | |
665 | 827df9f3 | balrog | static struct clk uart2_fclk = { |
666 | 827df9f3 | balrog | .name = "uart2_fclk",
|
667 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
668 | 827df9f3 | balrog | .parent = &func_48m_clk, |
669 | 827df9f3 | balrog | }; |
670 | 827df9f3 | balrog | |
671 | 827df9f3 | balrog | static struct clk uart2_iclk = { |
672 | 827df9f3 | balrog | .name = "uart2_iclk",
|
673 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
674 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
675 | 827df9f3 | balrog | }; |
676 | 827df9f3 | balrog | |
677 | 827df9f3 | balrog | static struct clk uart3_fclk = { |
678 | 827df9f3 | balrog | .name = "uart3_fclk",
|
679 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
680 | 827df9f3 | balrog | .parent = &func_48m_clk, |
681 | 827df9f3 | balrog | }; |
682 | 827df9f3 | balrog | |
683 | 827df9f3 | balrog | static struct clk uart3_iclk = { |
684 | 827df9f3 | balrog | .name = "uart3_iclk",
|
685 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
686 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
687 | 827df9f3 | balrog | }; |
688 | 827df9f3 | balrog | |
689 | 827df9f3 | balrog | static struct clk mpu_fclk = { |
690 | 827df9f3 | balrog | .name = "mpu_fclk",
|
691 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
692 | 827df9f3 | balrog | .parent = &core_clk, |
693 | 827df9f3 | balrog | }; |
694 | 827df9f3 | balrog | |
695 | 827df9f3 | balrog | static struct clk mpu_iclk = { |
696 | 827df9f3 | balrog | .name = "mpu_iclk",
|
697 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
698 | 827df9f3 | balrog | .parent = &core_clk, |
699 | 827df9f3 | balrog | }; |
700 | 827df9f3 | balrog | |
701 | 827df9f3 | balrog | static struct clk int_m_fclk = { |
702 | 827df9f3 | balrog | .name = "int_m_fclk",
|
703 | 827df9f3 | balrog | .alias = "mpu_intc_fclk",
|
704 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
705 | 827df9f3 | balrog | .parent = &core_clk, |
706 | 827df9f3 | balrog | }; |
707 | 827df9f3 | balrog | |
708 | 827df9f3 | balrog | static struct clk int_m_iclk = { |
709 | 827df9f3 | balrog | .name = "int_m_iclk",
|
710 | 827df9f3 | balrog | .alias = "mpu_intc_iclk",
|
711 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
712 | 827df9f3 | balrog | .parent = &core_clk, |
713 | 827df9f3 | balrog | }; |
714 | 827df9f3 | balrog | |
715 | 827df9f3 | balrog | static struct clk core_gpt2_clk = { |
716 | 827df9f3 | balrog | .name = "core_gpt2_clk",
|
717 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
718 | 827df9f3 | balrog | .parent = &sys_clk, |
719 | 827df9f3 | balrog | }; |
720 | 827df9f3 | balrog | |
721 | 827df9f3 | balrog | static struct clk core_gpt3_clk = { |
722 | 827df9f3 | balrog | .name = "core_gpt3_clk",
|
723 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
724 | 827df9f3 | balrog | .parent = &sys_clk, |
725 | 827df9f3 | balrog | }; |
726 | 827df9f3 | balrog | |
727 | 827df9f3 | balrog | static struct clk core_gpt4_clk = { |
728 | 827df9f3 | balrog | .name = "core_gpt4_clk",
|
729 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
730 | 827df9f3 | balrog | .parent = &sys_clk, |
731 | 827df9f3 | balrog | }; |
732 | 827df9f3 | balrog | |
733 | 827df9f3 | balrog | static struct clk core_gpt5_clk = { |
734 | 827df9f3 | balrog | .name = "core_gpt5_clk",
|
735 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
736 | 827df9f3 | balrog | .parent = &sys_clk, |
737 | 827df9f3 | balrog | }; |
738 | 827df9f3 | balrog | |
739 | 827df9f3 | balrog | static struct clk core_gpt6_clk = { |
740 | 827df9f3 | balrog | .name = "core_gpt6_clk",
|
741 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
742 | 827df9f3 | balrog | .parent = &sys_clk, |
743 | 827df9f3 | balrog | }; |
744 | 827df9f3 | balrog | |
745 | 827df9f3 | balrog | static struct clk core_gpt7_clk = { |
746 | 827df9f3 | balrog | .name = "core_gpt7_clk",
|
747 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
748 | 827df9f3 | balrog | .parent = &sys_clk, |
749 | 827df9f3 | balrog | }; |
750 | 827df9f3 | balrog | |
751 | 827df9f3 | balrog | static struct clk core_gpt8_clk = { |
752 | 827df9f3 | balrog | .name = "core_gpt8_clk",
|
753 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
754 | 827df9f3 | balrog | .parent = &sys_clk, |
755 | 827df9f3 | balrog | }; |
756 | 827df9f3 | balrog | |
757 | 827df9f3 | balrog | static struct clk core_gpt9_clk = { |
758 | 827df9f3 | balrog | .name = "core_gpt9_clk",
|
759 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
760 | 827df9f3 | balrog | .parent = &sys_clk, |
761 | 827df9f3 | balrog | }; |
762 | 827df9f3 | balrog | |
763 | 827df9f3 | balrog | static struct clk core_gpt10_clk = { |
764 | 827df9f3 | balrog | .name = "core_gpt10_clk",
|
765 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
766 | 827df9f3 | balrog | .parent = &sys_clk, |
767 | 827df9f3 | balrog | }; |
768 | 827df9f3 | balrog | |
769 | 827df9f3 | balrog | static struct clk core_gpt11_clk = { |
770 | 827df9f3 | balrog | .name = "core_gpt11_clk",
|
771 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
772 | 827df9f3 | balrog | .parent = &sys_clk, |
773 | 827df9f3 | balrog | }; |
774 | 827df9f3 | balrog | |
775 | 827df9f3 | balrog | static struct clk core_gpt12_clk = { |
776 | 827df9f3 | balrog | .name = "core_gpt12_clk",
|
777 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
778 | 827df9f3 | balrog | .parent = &sys_clk, |
779 | 827df9f3 | balrog | }; |
780 | 827df9f3 | balrog | |
781 | 827df9f3 | balrog | static struct clk mcbsp1_clk = { |
782 | 827df9f3 | balrog | .name = "mcbsp1_cg",
|
783 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
784 | 827df9f3 | balrog | .divisor = 2,
|
785 | 827df9f3 | balrog | .parent = &func_96m_clk, |
786 | 827df9f3 | balrog | }; |
787 | 827df9f3 | balrog | |
788 | 827df9f3 | balrog | static struct clk mcbsp2_clk = { |
789 | 827df9f3 | balrog | .name = "mcbsp2_cg",
|
790 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
791 | 827df9f3 | balrog | .divisor = 2,
|
792 | 827df9f3 | balrog | .parent = &func_96m_clk, |
793 | 827df9f3 | balrog | }; |
794 | 827df9f3 | balrog | |
795 | 827df9f3 | balrog | static struct clk emul_clk = { |
796 | 827df9f3 | balrog | .name = "emul_ck",
|
797 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
798 | 827df9f3 | balrog | .parent = &func_54m_clk, |
799 | 827df9f3 | balrog | }; |
800 | 827df9f3 | balrog | |
801 | 827df9f3 | balrog | static struct clk sdma_fclk = { |
802 | 827df9f3 | balrog | .name = "sdma_fclk",
|
803 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
804 | 827df9f3 | balrog | .parent = &l3_clk, |
805 | 827df9f3 | balrog | }; |
806 | 827df9f3 | balrog | |
807 | 827df9f3 | balrog | static struct clk sdma_iclk = { |
808 | 827df9f3 | balrog | .name = "sdma_iclk",
|
809 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
810 | 827df9f3 | balrog | .parent = &core_l3_iclk, /* core_l4_iclk for the configuration port */
|
811 | 827df9f3 | balrog | }; |
812 | 827df9f3 | balrog | |
813 | 827df9f3 | balrog | static struct clk i2c1_fclk = { |
814 | 827df9f3 | balrog | .name = "i2c1.fclk",
|
815 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
816 | 827df9f3 | balrog | .parent = &func_12m_clk, |
817 | 827df9f3 | balrog | .divisor = 1,
|
818 | 827df9f3 | balrog | }; |
819 | 827df9f3 | balrog | |
820 | 827df9f3 | balrog | static struct clk i2c1_iclk = { |
821 | 827df9f3 | balrog | .name = "i2c1.iclk",
|
822 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
823 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
824 | 827df9f3 | balrog | }; |
825 | 827df9f3 | balrog | |
826 | 827df9f3 | balrog | static struct clk i2c2_fclk = { |
827 | 827df9f3 | balrog | .name = "i2c2.fclk",
|
828 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
829 | 827df9f3 | balrog | .parent = &func_12m_clk, |
830 | 827df9f3 | balrog | .divisor = 1,
|
831 | 827df9f3 | balrog | }; |
832 | 827df9f3 | balrog | |
833 | 827df9f3 | balrog | static struct clk i2c2_iclk = { |
834 | 827df9f3 | balrog | .name = "i2c2.iclk",
|
835 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
836 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
837 | 827df9f3 | balrog | }; |
838 | 827df9f3 | balrog | |
839 | 827df9f3 | balrog | static struct clk gpio_dbclk[4] = { |
840 | 827df9f3 | balrog | { |
841 | 827df9f3 | balrog | .name = "gpio1_dbclk",
|
842 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
843 | 827df9f3 | balrog | .parent = &wu_32k_clk, |
844 | 827df9f3 | balrog | }, { |
845 | 827df9f3 | balrog | .name = "gpio2_dbclk",
|
846 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
847 | 827df9f3 | balrog | .parent = &wu_32k_clk, |
848 | 827df9f3 | balrog | }, { |
849 | 827df9f3 | balrog | .name = "gpio3_dbclk",
|
850 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
851 | 827df9f3 | balrog | .parent = &wu_32k_clk, |
852 | 827df9f3 | balrog | }, { |
853 | 827df9f3 | balrog | .name = "gpio4_dbclk",
|
854 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
855 | 827df9f3 | balrog | .parent = &wu_32k_clk, |
856 | 827df9f3 | balrog | }, |
857 | 827df9f3 | balrog | }; |
858 | 827df9f3 | balrog | |
859 | 827df9f3 | balrog | static struct clk gpio_iclk = { |
860 | 827df9f3 | balrog | .name = "gpio_iclk",
|
861 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
862 | 827df9f3 | balrog | .parent = &wu_l4_iclk, |
863 | 827df9f3 | balrog | }; |
864 | 827df9f3 | balrog | |
865 | 827df9f3 | balrog | static struct clk mmc_fck = { |
866 | 827df9f3 | balrog | .name = "mmc_fclk",
|
867 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X, |
868 | 827df9f3 | balrog | .parent = &func_96m_clk, |
869 | 827df9f3 | balrog | }; |
870 | 827df9f3 | balrog | |
871 | 827df9f3 | balrog | static struct clk mmc_ick = { |
872 | 827df9f3 | balrog | .name = "mmc_iclk",
|
873 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X, |
874 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
875 | 827df9f3 | balrog | }; |
876 | 827df9f3 | balrog | |
877 | 827df9f3 | balrog | static struct clk spi_fclk[3] = { |
878 | 827df9f3 | balrog | { |
879 | 827df9f3 | balrog | .name = "spi1_fclk",
|
880 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
881 | 827df9f3 | balrog | .parent = &func_48m_clk, |
882 | 827df9f3 | balrog | }, { |
883 | 827df9f3 | balrog | .name = "spi2_fclk",
|
884 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
885 | 827df9f3 | balrog | .parent = &func_48m_clk, |
886 | 827df9f3 | balrog | }, { |
887 | 827df9f3 | balrog | .name = "spi3_fclk",
|
888 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP243X, |
889 | 827df9f3 | balrog | .parent = &func_48m_clk, |
890 | 827df9f3 | balrog | }, |
891 | 827df9f3 | balrog | }; |
892 | 827df9f3 | balrog | |
893 | 827df9f3 | balrog | static struct clk dss_clk[2] = { |
894 | 827df9f3 | balrog | { |
895 | 827df9f3 | balrog | .name = "dss_clk1",
|
896 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
897 | 827df9f3 | balrog | .parent = &core_clk, |
898 | 827df9f3 | balrog | }, { |
899 | 827df9f3 | balrog | .name = "dss_clk2",
|
900 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
901 | 827df9f3 | balrog | .parent = &sys_clk, |
902 | 827df9f3 | balrog | }, |
903 | 827df9f3 | balrog | }; |
904 | 827df9f3 | balrog | |
905 | 827df9f3 | balrog | static struct clk dss_54m_clk = { |
906 | 827df9f3 | balrog | .name = "dss_54m_clk",
|
907 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
908 | 827df9f3 | balrog | .parent = &func_54m_clk, |
909 | 827df9f3 | balrog | }; |
910 | 827df9f3 | balrog | |
911 | 827df9f3 | balrog | static struct clk dss_l3_iclk = { |
912 | 827df9f3 | balrog | .name = "dss_l3_iclk",
|
913 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
914 | 827df9f3 | balrog | .parent = &core_l3_iclk, |
915 | 827df9f3 | balrog | }; |
916 | 827df9f3 | balrog | |
917 | 827df9f3 | balrog | static struct clk dss_l4_iclk = { |
918 | 827df9f3 | balrog | .name = "dss_l4_iclk",
|
919 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
920 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
921 | 827df9f3 | balrog | }; |
922 | 827df9f3 | balrog | |
923 | 827df9f3 | balrog | static struct clk spi_iclk[3] = { |
924 | 827df9f3 | balrog | { |
925 | 827df9f3 | balrog | .name = "spi1_iclk",
|
926 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
927 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
928 | 827df9f3 | balrog | }, { |
929 | 827df9f3 | balrog | .name = "spi2_iclk",
|
930 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
931 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
932 | 827df9f3 | balrog | }, { |
933 | 827df9f3 | balrog | .name = "spi3_iclk",
|
934 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP243X, |
935 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
936 | 827df9f3 | balrog | }, |
937 | 827df9f3 | balrog | }; |
938 | 827df9f3 | balrog | |
939 | 827df9f3 | balrog | static struct clk omapctrl_clk = { |
940 | 827df9f3 | balrog | .name = "omapctrl_iclk",
|
941 | 827df9f3 | balrog | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X, |
942 | 827df9f3 | balrog | /* XXX Should be in WKUP domain */
|
943 | 827df9f3 | balrog | .parent = &core_l4_iclk, |
944 | c3d2689d | balrog | }; |
945 | c3d2689d | balrog | |
946 | c3d2689d | balrog | static struct clk *onchip_clks[] = { |
947 | 827df9f3 | balrog | /* OMAP 1 */
|
948 | 827df9f3 | balrog | |
949 | c3d2689d | balrog | /* non-ULPD clocks */
|
950 | c3d2689d | balrog | &xtal_osc12m, |
951 | c3d2689d | balrog | &xtal_osc32k, |
952 | c3d2689d | balrog | &ck_ref, |
953 | c3d2689d | balrog | &dpll1, |
954 | c3d2689d | balrog | &dpll2, |
955 | c3d2689d | balrog | &dpll3, |
956 | c3d2689d | balrog | &dpll4, |
957 | c3d2689d | balrog | &apll, |
958 | c3d2689d | balrog | &ck_48m, |
959 | c3d2689d | balrog | /* CK_GEN1 clocks */
|
960 | c3d2689d | balrog | &clkm1, |
961 | c3d2689d | balrog | &ck_dpll1out, |
962 | c3d2689d | balrog | &sossi_ck, |
963 | c3d2689d | balrog | &arm_ck, |
964 | c3d2689d | balrog | &armper_ck, |
965 | c3d2689d | balrog | &arm_gpio_ck, |
966 | c3d2689d | balrog | &armxor_ck, |
967 | c3d2689d | balrog | &armtim_ck, |
968 | c3d2689d | balrog | &armwdt_ck, |
969 | c3d2689d | balrog | &arminth_ck15xx, &arminth_ck16xx, |
970 | c3d2689d | balrog | /* CK_GEN2 clocks */
|
971 | c3d2689d | balrog | &clkm2, |
972 | c3d2689d | balrog | &dsp_ck, |
973 | c3d2689d | balrog | &dspmmu_ck, |
974 | c3d2689d | balrog | &dspper_ck, |
975 | c3d2689d | balrog | &dspxor_ck, |
976 | c3d2689d | balrog | &dsptim_ck, |
977 | c3d2689d | balrog | /* CK_GEN3 clocks */
|
978 | c3d2689d | balrog | &clkm3, |
979 | c3d2689d | balrog | &tc_ck, |
980 | c3d2689d | balrog | &tipb_ck, |
981 | c3d2689d | balrog | &l3_ocpi_ck, |
982 | c3d2689d | balrog | &tc1_ck, |
983 | c3d2689d | balrog | &tc2_ck, |
984 | c3d2689d | balrog | &dma_ck, |
985 | c3d2689d | balrog | &dma_lcdfree_ck, |
986 | c3d2689d | balrog | &api_ck, |
987 | c3d2689d | balrog | &lb_ck, |
988 | c3d2689d | balrog | &lbfree_ck, |
989 | d8f699cb | balrog | &hsab_ck, |
990 | c3d2689d | balrog | &rhea1_ck, |
991 | c3d2689d | balrog | &rhea2_ck, |
992 | c3d2689d | balrog | &lcd_ck_16xx, |
993 | c3d2689d | balrog | &lcd_ck_1510, |
994 | c3d2689d | balrog | /* ULPD clocks */
|
995 | c3d2689d | balrog | &uart1_1510, |
996 | c3d2689d | balrog | &uart1_16xx, |
997 | c3d2689d | balrog | &uart2_ck, |
998 | c3d2689d | balrog | &uart3_1510, |
999 | c3d2689d | balrog | &uart3_16xx, |
1000 | c3d2689d | balrog | &usb_clk0, |
1001 | c3d2689d | balrog | &usb_hhc_ck1510, &usb_hhc_ck16xx, |
1002 | c3d2689d | balrog | &mclk_1510, &mclk_16xx, &mclk_310, |
1003 | c3d2689d | balrog | &bclk_1510, &bclk_16xx, &bclk_310, |
1004 | c3d2689d | balrog | &mmc1_ck, |
1005 | c3d2689d | balrog | &mmc2_ck, |
1006 | c3d2689d | balrog | &cam_mclk, |
1007 | c3d2689d | balrog | &cam_exclk, |
1008 | c3d2689d | balrog | &cam_lclk, |
1009 | c3d2689d | balrog | &clk32k, |
1010 | d8f699cb | balrog | &usb_w2fc_mclk, |
1011 | c3d2689d | balrog | /* Virtual clocks */
|
1012 | c3d2689d | balrog | &i2c_fck, |
1013 | c3d2689d | balrog | &i2c_ick, |
1014 | 827df9f3 | balrog | |
1015 | 827df9f3 | balrog | /* OMAP 2 */
|
1016 | 827df9f3 | balrog | |
1017 | 51fec3cc | balrog | &ref_clk, |
1018 | 827df9f3 | balrog | &apll_96m, |
1019 | 827df9f3 | balrog | &apll_54m, |
1020 | 827df9f3 | balrog | &sys_clk, |
1021 | 827df9f3 | balrog | &sleep_clk, |
1022 | 827df9f3 | balrog | &dpll_ck, |
1023 | 827df9f3 | balrog | &dpll_x2_ck, |
1024 | 827df9f3 | balrog | &wdt1_sys_clk, |
1025 | 827df9f3 | balrog | &func_96m_clk, |
1026 | 827df9f3 | balrog | &func_48m_clk, |
1027 | 827df9f3 | balrog | &func_12m_clk, |
1028 | 827df9f3 | balrog | &func_54m_clk, |
1029 | 827df9f3 | balrog | &sys_clkout, |
1030 | 827df9f3 | balrog | &sys_clkout2, |
1031 | 827df9f3 | balrog | &core_clk, |
1032 | 827df9f3 | balrog | &l3_clk, |
1033 | 827df9f3 | balrog | &core_l4_iclk, |
1034 | 827df9f3 | balrog | &wu_l4_iclk, |
1035 | 827df9f3 | balrog | &core_l3_iclk, |
1036 | 827df9f3 | balrog | &core_l4_usb_clk, |
1037 | 827df9f3 | balrog | &wu_gpt1_clk, |
1038 | 827df9f3 | balrog | &wu_32k_clk, |
1039 | 827df9f3 | balrog | &uart1_fclk, |
1040 | 827df9f3 | balrog | &uart1_iclk, |
1041 | 827df9f3 | balrog | &uart2_fclk, |
1042 | 827df9f3 | balrog | &uart2_iclk, |
1043 | 827df9f3 | balrog | &uart3_fclk, |
1044 | 827df9f3 | balrog | &uart3_iclk, |
1045 | 827df9f3 | balrog | &mpu_fclk, |
1046 | 827df9f3 | balrog | &mpu_iclk, |
1047 | 827df9f3 | balrog | &int_m_fclk, |
1048 | 827df9f3 | balrog | &int_m_iclk, |
1049 | 827df9f3 | balrog | &core_gpt2_clk, |
1050 | 827df9f3 | balrog | &core_gpt3_clk, |
1051 | 827df9f3 | balrog | &core_gpt4_clk, |
1052 | 827df9f3 | balrog | &core_gpt5_clk, |
1053 | 827df9f3 | balrog | &core_gpt6_clk, |
1054 | 827df9f3 | balrog | &core_gpt7_clk, |
1055 | 827df9f3 | balrog | &core_gpt8_clk, |
1056 | 827df9f3 | balrog | &core_gpt9_clk, |
1057 | 827df9f3 | balrog | &core_gpt10_clk, |
1058 | 827df9f3 | balrog | &core_gpt11_clk, |
1059 | 827df9f3 | balrog | &core_gpt12_clk, |
1060 | 827df9f3 | balrog | &mcbsp1_clk, |
1061 | 827df9f3 | balrog | &mcbsp2_clk, |
1062 | 827df9f3 | balrog | &emul_clk, |
1063 | 827df9f3 | balrog | &sdma_fclk, |
1064 | 827df9f3 | balrog | &sdma_iclk, |
1065 | 827df9f3 | balrog | &i2c1_fclk, |
1066 | 827df9f3 | balrog | &i2c1_iclk, |
1067 | 827df9f3 | balrog | &i2c2_fclk, |
1068 | 827df9f3 | balrog | &i2c2_iclk, |
1069 | 827df9f3 | balrog | &gpio_dbclk[0],
|
1070 | 827df9f3 | balrog | &gpio_dbclk[1],
|
1071 | 827df9f3 | balrog | &gpio_dbclk[2],
|
1072 | 827df9f3 | balrog | &gpio_dbclk[3],
|
1073 | 827df9f3 | balrog | &gpio_iclk, |
1074 | 827df9f3 | balrog | &mmc_fck, |
1075 | 827df9f3 | balrog | &mmc_ick, |
1076 | 827df9f3 | balrog | &spi_fclk[0],
|
1077 | 827df9f3 | balrog | &spi_iclk[0],
|
1078 | 827df9f3 | balrog | &spi_fclk[1],
|
1079 | 827df9f3 | balrog | &spi_iclk[1],
|
1080 | 827df9f3 | balrog | &spi_fclk[2],
|
1081 | 827df9f3 | balrog | &spi_iclk[2],
|
1082 | 827df9f3 | balrog | &dss_clk[0],
|
1083 | 827df9f3 | balrog | &dss_clk[1],
|
1084 | 827df9f3 | balrog | &dss_54m_clk, |
1085 | 827df9f3 | balrog | &dss_l3_iclk, |
1086 | 827df9f3 | balrog | &dss_l4_iclk, |
1087 | 827df9f3 | balrog | &omapctrl_clk, |
1088 | 827df9f3 | balrog | |
1089 | b9d38e95 | Blue Swirl | NULL
|
1090 | c3d2689d | balrog | }; |
1091 | c3d2689d | balrog | |
1092 | c3d2689d | balrog | void omap_clk_adduser(struct clk *clk, qemu_irq user) |
1093 | c3d2689d | balrog | { |
1094 | c3d2689d | balrog | qemu_irq *i; |
1095 | c3d2689d | balrog | |
1096 | c3d2689d | balrog | for (i = clk->users; *i; i ++);
|
1097 | c3d2689d | balrog | *i = user; |
1098 | c3d2689d | balrog | } |
1099 | c3d2689d | balrog | |
1100 | c3d2689d | balrog | struct clk *omap_findclk(struct omap_mpu_state_s *mpu, const char *name) |
1101 | c3d2689d | balrog | { |
1102 | c3d2689d | balrog | struct clk *i;
|
1103 | c3d2689d | balrog | |
1104 | c3d2689d | balrog | for (i = mpu->clks; i->name; i ++)
|
1105 | c3d2689d | balrog | if (!strcmp(i->name, name) || (i->alias && !strcmp(i->alias, name)))
|
1106 | c3d2689d | balrog | return i;
|
1107 | 2ac71179 | Paul Brook | hw_error("%s: %s not found\n", __FUNCTION__, name);
|
1108 | c3d2689d | balrog | } |
1109 | c3d2689d | balrog | |
1110 | c3d2689d | balrog | void omap_clk_get(struct clk *clk) |
1111 | c3d2689d | balrog | { |
1112 | c3d2689d | balrog | clk->usecount ++; |
1113 | c3d2689d | balrog | } |
1114 | c3d2689d | balrog | |
1115 | c3d2689d | balrog | void omap_clk_put(struct clk *clk) |
1116 | c3d2689d | balrog | { |
1117 | c3d2689d | balrog | if (!(clk->usecount --))
|
1118 | 2ac71179 | Paul Brook | hw_error("%s: %s is not in use\n", __FUNCTION__, clk->name);
|
1119 | c3d2689d | balrog | } |
1120 | c3d2689d | balrog | |
1121 | c3d2689d | balrog | static void omap_clk_update(struct clk *clk) |
1122 | c3d2689d | balrog | { |
1123 | c3d2689d | balrog | int parent, running;
|
1124 | c3d2689d | balrog | qemu_irq *user; |
1125 | c3d2689d | balrog | struct clk *i;
|
1126 | c3d2689d | balrog | |
1127 | c3d2689d | balrog | if (clk->parent)
|
1128 | c3d2689d | balrog | parent = clk->parent->running; |
1129 | c3d2689d | balrog | else
|
1130 | c3d2689d | balrog | parent = 1;
|
1131 | c3d2689d | balrog | |
1132 | c3d2689d | balrog | running = parent && (clk->enabled || |
1133 | c3d2689d | balrog | ((clk->flags & ALWAYS_ENABLED) && clk->usecount)); |
1134 | c3d2689d | balrog | if (clk->running != running) {
|
1135 | c3d2689d | balrog | clk->running = running; |
1136 | c3d2689d | balrog | for (user = clk->users; *user; user ++)
|
1137 | c3d2689d | balrog | qemu_set_irq(*user, running); |
1138 | c3d2689d | balrog | for (i = clk->child1; i; i = i->sibling)
|
1139 | c3d2689d | balrog | omap_clk_update(i); |
1140 | c3d2689d | balrog | } |
1141 | c3d2689d | balrog | } |
1142 | c3d2689d | balrog | |
1143 | c3d2689d | balrog | static void omap_clk_rate_update_full(struct clk *clk, unsigned long int rate, |
1144 | c3d2689d | balrog | unsigned long int div, unsigned long int mult) |
1145 | c3d2689d | balrog | { |
1146 | c3d2689d | balrog | struct clk *i;
|
1147 | c3d2689d | balrog | qemu_irq *user; |
1148 | c3d2689d | balrog | |
1149 | c3d2689d | balrog | clk->rate = muldiv64(rate, mult, div); |
1150 | c3d2689d | balrog | if (clk->running)
|
1151 | c3d2689d | balrog | for (user = clk->users; *user; user ++)
|
1152 | c3d2689d | balrog | qemu_irq_raise(*user); |
1153 | c3d2689d | balrog | for (i = clk->child1; i; i = i->sibling)
|
1154 | c3d2689d | balrog | omap_clk_rate_update_full(i, rate, |
1155 | c3d2689d | balrog | div * i->divisor, mult * i->multiplier); |
1156 | c3d2689d | balrog | } |
1157 | c3d2689d | balrog | |
1158 | c3d2689d | balrog | static void omap_clk_rate_update(struct clk *clk) |
1159 | c3d2689d | balrog | { |
1160 | c3d2689d | balrog | struct clk *i;
|
1161 | c3d2689d | balrog | unsigned long int div, mult = div = 1; |
1162 | c3d2689d | balrog | |
1163 | c3d2689d | balrog | for (i = clk; i->parent; i = i->parent) {
|
1164 | c3d2689d | balrog | div *= i->divisor; |
1165 | c3d2689d | balrog | mult *= i->multiplier; |
1166 | c3d2689d | balrog | } |
1167 | c3d2689d | balrog | |
1168 | c3d2689d | balrog | omap_clk_rate_update_full(clk, i->rate, div, mult); |
1169 | c3d2689d | balrog | } |
1170 | c3d2689d | balrog | |
1171 | c3d2689d | balrog | void omap_clk_reparent(struct clk *clk, struct clk *parent) |
1172 | c3d2689d | balrog | { |
1173 | c3d2689d | balrog | struct clk **p;
|
1174 | c3d2689d | balrog | |
1175 | c3d2689d | balrog | if (clk->parent) {
|
1176 | c3d2689d | balrog | for (p = &clk->parent->child1; *p != clk; p = &(*p)->sibling);
|
1177 | c3d2689d | balrog | *p = clk->sibling; |
1178 | c3d2689d | balrog | } |
1179 | c3d2689d | balrog | |
1180 | c3d2689d | balrog | clk->parent = parent; |
1181 | c3d2689d | balrog | if (parent) {
|
1182 | c3d2689d | balrog | clk->sibling = parent->child1; |
1183 | c3d2689d | balrog | parent->child1 = clk; |
1184 | c3d2689d | balrog | omap_clk_update(clk); |
1185 | c3d2689d | balrog | omap_clk_rate_update(clk); |
1186 | c3d2689d | balrog | } else
|
1187 | b9d38e95 | Blue Swirl | clk->sibling = NULL;
|
1188 | c3d2689d | balrog | } |
1189 | c3d2689d | balrog | |
1190 | c3d2689d | balrog | void omap_clk_onoff(struct clk *clk, int on) |
1191 | c3d2689d | balrog | { |
1192 | c3d2689d | balrog | clk->enabled = on; |
1193 | c3d2689d | balrog | omap_clk_update(clk); |
1194 | c3d2689d | balrog | } |
1195 | c3d2689d | balrog | |
1196 | c3d2689d | balrog | void omap_clk_canidle(struct clk *clk, int can) |
1197 | c3d2689d | balrog | { |
1198 | c3d2689d | balrog | if (can)
|
1199 | c3d2689d | balrog | omap_clk_put(clk); |
1200 | c3d2689d | balrog | else
|
1201 | c3d2689d | balrog | omap_clk_get(clk); |
1202 | c3d2689d | balrog | } |
1203 | c3d2689d | balrog | |
1204 | c3d2689d | balrog | void omap_clk_setrate(struct clk *clk, int divide, int multiply) |
1205 | c3d2689d | balrog | { |
1206 | c3d2689d | balrog | clk->divisor = divide; |
1207 | c3d2689d | balrog | clk->multiplier = multiply; |
1208 | c3d2689d | balrog | omap_clk_rate_update(clk); |
1209 | c3d2689d | balrog | } |
1210 | c3d2689d | balrog | |
1211 | c3d2689d | balrog | int64_t omap_clk_getrate(omap_clk clk) |
1212 | c3d2689d | balrog | { |
1213 | c3d2689d | balrog | return clk->rate;
|
1214 | c3d2689d | balrog | } |
1215 | c3d2689d | balrog | |
1216 | c3d2689d | balrog | void omap_clk_init(struct omap_mpu_state_s *mpu) |
1217 | c3d2689d | balrog | { |
1218 | c3d2689d | balrog | struct clk **i, *j, *k;
|
1219 | c3d2689d | balrog | int count;
|
1220 | c3d2689d | balrog | int flag;
|
1221 | c3d2689d | balrog | |
1222 | c3d2689d | balrog | if (cpu_is_omap310(mpu))
|
1223 | c3d2689d | balrog | flag = CLOCK_IN_OMAP310; |
1224 | c3d2689d | balrog | else if (cpu_is_omap1510(mpu)) |
1225 | c3d2689d | balrog | flag = CLOCK_IN_OMAP1510; |
1226 | 827df9f3 | balrog | else if (cpu_is_omap2410(mpu) || cpu_is_omap2420(mpu)) |
1227 | 827df9f3 | balrog | flag = CLOCK_IN_OMAP242X; |
1228 | 827df9f3 | balrog | else if (cpu_is_omap2430(mpu)) |
1229 | 827df9f3 | balrog | flag = CLOCK_IN_OMAP243X; |
1230 | 827df9f3 | balrog | else if (cpu_is_omap3430(mpu)) |
1231 | 827df9f3 | balrog | flag = CLOCK_IN_OMAP243X; |
1232 | c3d2689d | balrog | else
|
1233 | c3d2689d | balrog | return;
|
1234 | c3d2689d | balrog | |
1235 | c3d2689d | balrog | for (i = onchip_clks, count = 0; *i; i ++) |
1236 | c3d2689d | balrog | if ((*i)->flags & flag)
|
1237 | c3d2689d | balrog | count ++; |
1238 | c3d2689d | balrog | mpu->clks = (struct clk *) qemu_mallocz(sizeof(struct clk) * (count + 1)); |
1239 | c3d2689d | balrog | for (i = onchip_clks, j = mpu->clks; *i; i ++)
|
1240 | c3d2689d | balrog | if ((*i)->flags & flag) {
|
1241 | c3d2689d | balrog | memcpy(j, *i, sizeof(struct clk)); |
1242 | c3d2689d | balrog | for (k = mpu->clks; k < j; k ++)
|
1243 | c3d2689d | balrog | if (j->parent && !strcmp(j->parent->name, k->name)) {
|
1244 | c3d2689d | balrog | j->parent = k; |
1245 | c3d2689d | balrog | j->sibling = k->child1; |
1246 | c3d2689d | balrog | k->child1 = j; |
1247 | c3d2689d | balrog | } else if (k->parent && !strcmp(k->parent->name, j->name)) { |
1248 | c3d2689d | balrog | k->parent = j; |
1249 | c3d2689d | balrog | k->sibling = j->child1; |
1250 | c3d2689d | balrog | j->child1 = k; |
1251 | c3d2689d | balrog | } |
1252 | c3d2689d | balrog | j->divisor = j->divisor ?: 1;
|
1253 | c3d2689d | balrog | j->multiplier = j->multiplier ?: 1;
|
1254 | c3d2689d | balrog | j ++; |
1255 | c3d2689d | balrog | } |
1256 | b854bc19 | balrog | for (j = mpu->clks; count --; j ++) {
|
1257 | b854bc19 | balrog | omap_clk_update(j); |
1258 | b854bc19 | balrog | omap_clk_rate_update(j); |
1259 | b854bc19 | balrog | } |
1260 | c3d2689d | balrog | } |