blob: fea3d5c0252e2a7546a7f74e60e2b933f5b95d00 [file] [log] [blame]
Ben Dooksaf337f32010-04-28 18:03:57 +09001/* linux/arch/arm/plat-s3c24xx/s3c2443-clock.c
2 *
3 * Copyright (c) 2007, 2010 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2443 Clock control suport - common code
7 */
8
9#include <linux/init.h>
10#include <linux/clk.h>
11#include <linux/io.h>
12
13#include <mach/regs-s3c2443-clock.h>
14
15#include <plat/s3c2443.h>
16#include <plat/clock.h>
17#include <plat/clock-clksrc.h>
18#include <plat/cpu.h>
19
20#include <plat/cpu-freq.h>
21
22
23static int s3c2443_gate(void __iomem *reg, struct clk *clk, int enable)
24{
25 u32 ctrlbit = clk->ctrlbit;
26 u32 con = __raw_readl(reg);
27
28 if (enable)
29 con |= ctrlbit;
30 else
31 con &= ~ctrlbit;
32
33 __raw_writel(con, reg);
34 return 0;
35}
36
37int s3c2443_clkcon_enable_h(struct clk *clk, int enable)
38{
39 return s3c2443_gate(S3C2443_HCLKCON, clk, enable);
40}
41
42int s3c2443_clkcon_enable_p(struct clk *clk, int enable)
43{
44 return s3c2443_gate(S3C2443_PCLKCON, clk, enable);
45}
46
47int s3c2443_clkcon_enable_s(struct clk *clk, int enable)
48{
49 return s3c2443_gate(S3C2443_SCLKCON, clk, enable);
50}
51
52/* mpllref is a direct descendant of clk_xtal by default, but it is not
53 * elided as the EPLL can be either sourced by the XTAL or EXTCLK and as
54 * such directly equating the two source clocks is impossible.
55 */
56struct clk clk_mpllref = {
57 .name = "mpllref",
58 .parent = &clk_xtal,
Ben Dooksaf337f32010-04-28 18:03:57 +090059};
60
61static struct clk *clk_epllref_sources[] = {
62 [0] = &clk_mpllref,
63 [1] = &clk_mpllref,
64 [2] = &clk_xtal,
65 [3] = &clk_ext,
66};
67
68struct clksrc_clk clk_epllref = {
69 .clk = {
70 .name = "epllref",
Ben Dooksaf337f32010-04-28 18:03:57 +090071 },
72 .sources = &(struct clksrc_sources) {
73 .sources = clk_epllref_sources,
74 .nr_sources = ARRAY_SIZE(clk_epllref_sources),
75 },
76 .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 7 },
77};
78
79/* esysclk
80 *
81 * this is sourced from either the EPLL or the EPLLref clock
82*/
83
84static struct clk *clk_sysclk_sources[] = {
85 [0] = &clk_epllref.clk,
86 [1] = &clk_epll,
87};
88
89struct clksrc_clk clk_esysclk = {
90 .clk = {
91 .name = "esysclk",
92 .parent = &clk_epll,
Ben Dooksaf337f32010-04-28 18:03:57 +090093 },
94 .sources = &(struct clksrc_sources) {
95 .sources = clk_sysclk_sources,
96 .nr_sources = ARRAY_SIZE(clk_sysclk_sources),
97 },
98 .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 6 },
99};
100
101static unsigned long s3c2443_getrate_mdivclk(struct clk *clk)
102{
103 unsigned long parent_rate = clk_get_rate(clk->parent);
104 unsigned long div = __raw_readl(S3C2443_CLKDIV0);
105
106 div &= S3C2443_CLKDIV0_EXTDIV_MASK;
107 div >>= (S3C2443_CLKDIV0_EXTDIV_SHIFT-1); /* x2 */
108
109 return parent_rate / (div + 1);
110}
111
112static struct clk clk_mdivclk = {
113 .name = "mdivclk",
114 .parent = &clk_mpllref,
Ben Dooksaf337f32010-04-28 18:03:57 +0900115 .ops = &(struct clk_ops) {
116 .get_rate = s3c2443_getrate_mdivclk,
117 },
118};
119
120static struct clk *clk_msysclk_sources[] = {
121 [0] = &clk_mpllref,
122 [1] = &clk_mpll,
123 [2] = &clk_mdivclk,
124 [3] = &clk_mpllref,
125};
126
127struct clksrc_clk clk_msysclk = {
128 .clk = {
129 .name = "msysclk",
130 .parent = &clk_xtal,
Ben Dooksaf337f32010-04-28 18:03:57 +0900131 },
132 .sources = &(struct clksrc_sources) {
133 .sources = clk_msysclk_sources,
134 .nr_sources = ARRAY_SIZE(clk_msysclk_sources),
135 },
136 .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 3 },
137};
138
139/* prediv
140 *
141 * this divides the msysclk down to pass to h/p/etc.
142 */
143
144static unsigned long s3c2443_prediv_getrate(struct clk *clk)
145{
146 unsigned long rate = clk_get_rate(clk->parent);
147 unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0);
148
149 clkdiv0 &= S3C2443_CLKDIV0_PREDIV_MASK;
150 clkdiv0 >>= S3C2443_CLKDIV0_PREDIV_SHIFT;
151
152 return rate / (clkdiv0 + 1);
153}
154
155static struct clk clk_prediv = {
156 .name = "prediv",
Ben Dooksaf337f32010-04-28 18:03:57 +0900157 .parent = &clk_msysclk.clk,
158 .ops = &(struct clk_ops) {
159 .get_rate = s3c2443_prediv_getrate,
160 },
161};
162
Heiko St?bneraab08ee2011-10-14 15:08:56 +0900163/* armdiv
164 *
165 * this clock is sourced from msysclk and can have a number of
166 * divider values applied to it to then be fed into armclk.
167*/
168
Heiko Stuebnerd9a3bfb2011-10-14 15:08:56 +0900169static unsigned int *armdiv;
170static int nr_armdiv;
171static int armdivmask;
172
Heiko St?bneraab08ee2011-10-14 15:08:56 +0900173static unsigned long s3c2443_armclk_roundrate(struct clk *clk,
174 unsigned long rate)
175{
176 unsigned long parent = clk_get_rate(clk->parent);
177 unsigned long calc;
178 unsigned best = 256; /* bigger than any value */
179 unsigned div;
180 int ptr;
181
182 for (ptr = 0; ptr < nr_armdiv; ptr++) {
183 div = armdiv[ptr];
184 calc = parent / div;
185 if (calc <= rate && div < best)
186 best = div;
187 }
188
189 return parent / best;
190}
191
Heiko Stuebner5f33bd72011-10-14 15:08:56 +0900192static unsigned long s3c2443_armclk_getrate(struct clk *clk)
193{
194 unsigned long rate = clk_get_rate(clk->parent);
195 unsigned long clkcon0;
196 int val;
197
198 clkcon0 = __raw_readl(S3C2443_CLKDIV0);
199 clkcon0 &= armdivmask;
200 val = clkcon0 >> S3C2443_CLKDIV0_ARMDIV_SHIFT;
201
202 return rate / armdiv[val];
203}
204
Heiko St?bneraab08ee2011-10-14 15:08:56 +0900205static int s3c2443_armclk_setrate(struct clk *clk, unsigned long rate)
206{
207 unsigned long parent = clk_get_rate(clk->parent);
208 unsigned long calc;
209 unsigned div;
210 unsigned best = 256; /* bigger than any value */
211 int ptr;
212 int val = -1;
213
214 for (ptr = 0; ptr < nr_armdiv; ptr++) {
215 div = armdiv[ptr];
216 calc = parent / div;
217 if (calc <= rate && div < best) {
218 best = div;
219 val = ptr;
220 }
221 }
222
223 if (val >= 0) {
224 unsigned long clkcon0;
225
226 clkcon0 = __raw_readl(S3C2443_CLKDIV0);
227 clkcon0 &= ~armdivmask;
228 clkcon0 |= val << S3C2443_CLKDIV0_ARMDIV_SHIFT;
229 __raw_writel(clkcon0, S3C2443_CLKDIV0);
230 }
231
232 return (val == -1) ? -EINVAL : 0;
233}
234
235static struct clk clk_armdiv = {
236 .name = "armdiv",
237 .parent = &clk_msysclk.clk,
238 .ops = &(struct clk_ops) {
239 .round_rate = s3c2443_armclk_roundrate,
Heiko Stuebner5f33bd72011-10-14 15:08:56 +0900240 .get_rate = s3c2443_armclk_getrate,
Heiko St?bneraab08ee2011-10-14 15:08:56 +0900241 .set_rate = s3c2443_armclk_setrate,
242 },
243};
244
245/* armclk
246 *
247 * this is the clock fed into the ARM core itself, from armdiv or from hclk.
248 */
249
250static struct clk *clk_arm_sources[] = {
251 [0] = &clk_armdiv,
252 [1] = &clk_h,
253};
254
255static struct clksrc_clk clk_arm = {
256 .clk = {
257 .name = "armclk",
258 },
259 .sources = &(struct clksrc_sources) {
260 .sources = clk_arm_sources,
261 .nr_sources = ARRAY_SIZE(clk_arm_sources),
262 },
263 .reg_src = { .reg = S3C2443_CLKDIV0, .size = 1, .shift = 13 },
264};
265
Ben Dooksaf337f32010-04-28 18:03:57 +0900266/* usbhost
267 *
268 * usb host bus-clock, usually 48MHz to provide USB bus clock timing
269*/
270
271static struct clksrc_clk clk_usb_bus_host = {
272 .clk = {
273 .name = "usb-bus-host-parent",
Ben Dooksaf337f32010-04-28 18:03:57 +0900274 .parent = &clk_esysclk.clk,
275 .ctrlbit = S3C2443_SCLKCON_USBHOST,
276 .enable = s3c2443_clkcon_enable_s,
277 },
278 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 4 },
279};
280
281/* common clksrc clocks */
282
283static struct clksrc_clk clksrc_clks[] = {
284 {
285 /* ART baud-rate clock sourced from esysclk via a divisor */
286 .clk = {
287 .name = "uartclk",
Ben Dooksaf337f32010-04-28 18:03:57 +0900288 .parent = &clk_esysclk.clk,
289 },
290 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 },
291 }, {
292 /* camera interface bus-clock, divided down from esysclk */
293 .clk = {
294 .name = "camif-upll", /* same as 2440 name */
Ben Dooksaf337f32010-04-28 18:03:57 +0900295 .parent = &clk_esysclk.clk,
296 .ctrlbit = S3C2443_SCLKCON_CAMCLK,
297 .enable = s3c2443_clkcon_enable_s,
298 },
299 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 26 },
300 }, {
301 .clk = {
302 .name = "display-if",
Ben Dooksaf337f32010-04-28 18:03:57 +0900303 .parent = &clk_esysclk.clk,
304 .ctrlbit = S3C2443_SCLKCON_DISPCLK,
305 .enable = s3c2443_clkcon_enable_s,
306 },
307 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 8, .shift = 16 },
308 },
309};
310
Heiko Stuebnere3b454f2011-09-27 08:44:37 +0900311static struct clk clk_i2s_ext = {
312 .name = "i2s-ext",
313};
314
315/* i2s_eplldiv
316 *
317 * This clock is the output from the I2S divisor of ESYSCLK, and is separate
318 * from the mux that comes after it (cannot merge into one single clock)
319*/
320
321static struct clksrc_clk clk_i2s_eplldiv = {
322 .clk = {
323 .name = "i2s-eplldiv",
324 .parent = &clk_esysclk.clk,
325 },
326 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 12, },
327};
328
329/* i2s-ref
330 *
331 * i2s bus reference clock, selectable from external, esysclk or epllref
332 *
333 * Note, this used to be two clocks, but was compressed into one.
334*/
335
336static struct clk *clk_i2s_srclist[] = {
337 [0] = &clk_i2s_eplldiv.clk,
338 [1] = &clk_i2s_ext,
339 [2] = &clk_epllref.clk,
340 [3] = &clk_epllref.clk,
341};
342
343static struct clksrc_clk clk_i2s = {
344 .clk = {
345 .name = "i2s-if",
346 .ctrlbit = S3C2443_SCLKCON_I2SCLK,
347 .enable = s3c2443_clkcon_enable_s,
348
349 },
350 .sources = &(struct clksrc_sources) {
351 .sources = clk_i2s_srclist,
352 .nr_sources = ARRAY_SIZE(clk_i2s_srclist),
353 },
354 .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 14 },
355};
Ben Dooksaf337f32010-04-28 18:03:57 +0900356
357static struct clk init_clocks_off[] = {
358 {
Heiko Stuebnere3b454f2011-09-27 08:44:37 +0900359 .name = "iis",
360 .parent = &clk_p,
361 .enable = s3c2443_clkcon_enable_p,
362 .ctrlbit = S3C2443_PCLKCON_IIS,
363 }, {
Heiko Stuebner8b069b72011-09-27 08:45:23 +0900364 .name = "hsspi",
365 .parent = &clk_p,
366 .enable = s3c2443_clkcon_enable_p,
367 .ctrlbit = S3C2443_PCLKCON_HSSPI,
368 }, {
Ben Dooksaf337f32010-04-28 18:03:57 +0900369 .name = "adc",
Ben Dooksaf337f32010-04-28 18:03:57 +0900370 .parent = &clk_p,
371 .enable = s3c2443_clkcon_enable_p,
372 .ctrlbit = S3C2443_PCLKCON_ADC,
373 }, {
374 .name = "i2c",
Ben Dooksaf337f32010-04-28 18:03:57 +0900375 .parent = &clk_p,
376 .enable = s3c2443_clkcon_enable_p,
377 .ctrlbit = S3C2443_PCLKCON_IIC,
378 }
379};
380
381static struct clk init_clocks[] = {
382 {
383 .name = "dma",
Ben Dooksaf337f32010-04-28 18:03:57 +0900384 .parent = &clk_h,
385 .enable = s3c2443_clkcon_enable_h,
386 .ctrlbit = S3C2443_HCLKCON_DMA0,
387 }, {
388 .name = "dma",
Ben Dooksaf337f32010-04-28 18:03:57 +0900389 .parent = &clk_h,
390 .enable = s3c2443_clkcon_enable_h,
391 .ctrlbit = S3C2443_HCLKCON_DMA1,
392 }, {
393 .name = "dma",
Ben Dooksaf337f32010-04-28 18:03:57 +0900394 .parent = &clk_h,
395 .enable = s3c2443_clkcon_enable_h,
396 .ctrlbit = S3C2443_HCLKCON_DMA2,
397 }, {
398 .name = "dma",
Ben Dooksaf337f32010-04-28 18:03:57 +0900399 .parent = &clk_h,
400 .enable = s3c2443_clkcon_enable_h,
401 .ctrlbit = S3C2443_HCLKCON_DMA3,
402 }, {
403 .name = "dma",
Ben Dooksaf337f32010-04-28 18:03:57 +0900404 .parent = &clk_h,
405 .enable = s3c2443_clkcon_enable_h,
406 .ctrlbit = S3C2443_HCLKCON_DMA4,
407 }, {
408 .name = "dma",
Ben Dooksaf337f32010-04-28 18:03:57 +0900409 .parent = &clk_h,
410 .enable = s3c2443_clkcon_enable_h,
411 .ctrlbit = S3C2443_HCLKCON_DMA5,
412 }, {
413 .name = "hsmmc",
Ben Dooksaf337f32010-04-28 18:03:57 +0900414 .parent = &clk_h,
415 .enable = s3c2443_clkcon_enable_h,
416 .ctrlbit = S3C2443_HCLKCON_HSMMC,
417 }, {
418 .name = "gpio",
Ben Dooksaf337f32010-04-28 18:03:57 +0900419 .parent = &clk_p,
420 .enable = s3c2443_clkcon_enable_p,
421 .ctrlbit = S3C2443_PCLKCON_GPIO,
422 }, {
423 .name = "usb-host",
Ben Dooksaf337f32010-04-28 18:03:57 +0900424 .parent = &clk_h,
425 .enable = s3c2443_clkcon_enable_h,
426 .ctrlbit = S3C2443_HCLKCON_USBH,
427 }, {
428 .name = "usb-device",
Ben Dooksaf337f32010-04-28 18:03:57 +0900429 .parent = &clk_h,
430 .enable = s3c2443_clkcon_enable_h,
431 .ctrlbit = S3C2443_HCLKCON_USBD,
432 }, {
433 .name = "lcd",
Ben Dooksaf337f32010-04-28 18:03:57 +0900434 .parent = &clk_h,
435 .enable = s3c2443_clkcon_enable_h,
436 .ctrlbit = S3C2443_HCLKCON_LCDC,
437
438 }, {
439 .name = "timers",
Ben Dooksaf337f32010-04-28 18:03:57 +0900440 .parent = &clk_p,
441 .enable = s3c2443_clkcon_enable_p,
442 .ctrlbit = S3C2443_PCLKCON_PWMT,
443 }, {
444 .name = "cfc",
Ben Dooksaf337f32010-04-28 18:03:57 +0900445 .parent = &clk_h,
446 .enable = s3c2443_clkcon_enable_h,
447 .ctrlbit = S3C2443_HCLKCON_CFC,
448 }, {
449 .name = "ssmc",
Ben Dooksaf337f32010-04-28 18:03:57 +0900450 .parent = &clk_h,
451 .enable = s3c2443_clkcon_enable_h,
452 .ctrlbit = S3C2443_HCLKCON_SSMC,
453 }, {
454 .name = "uart",
Thomas Abrahame83626f2011-06-14 19:12:26 +0900455 .devname = "s3c2440-uart.0",
Ben Dooksaf337f32010-04-28 18:03:57 +0900456 .parent = &clk_p,
457 .enable = s3c2443_clkcon_enable_p,
458 .ctrlbit = S3C2443_PCLKCON_UART0,
459 }, {
460 .name = "uart",
Thomas Abrahame83626f2011-06-14 19:12:26 +0900461 .devname = "s3c2440-uart.1",
Ben Dooksaf337f32010-04-28 18:03:57 +0900462 .parent = &clk_p,
463 .enable = s3c2443_clkcon_enable_p,
464 .ctrlbit = S3C2443_PCLKCON_UART1,
465 }, {
466 .name = "uart",
Thomas Abrahame83626f2011-06-14 19:12:26 +0900467 .devname = "s3c2440-uart.2",
Ben Dooksaf337f32010-04-28 18:03:57 +0900468 .parent = &clk_p,
469 .enable = s3c2443_clkcon_enable_p,
470 .ctrlbit = S3C2443_PCLKCON_UART2,
471 }, {
472 .name = "uart",
Thomas Abrahame83626f2011-06-14 19:12:26 +0900473 .devname = "s3c2440-uart.3",
Ben Dooksaf337f32010-04-28 18:03:57 +0900474 .parent = &clk_p,
475 .enable = s3c2443_clkcon_enable_p,
476 .ctrlbit = S3C2443_PCLKCON_UART3,
477 }, {
478 .name = "rtc",
Ben Dooksaf337f32010-04-28 18:03:57 +0900479 .parent = &clk_p,
480 .enable = s3c2443_clkcon_enable_p,
481 .ctrlbit = S3C2443_PCLKCON_RTC,
482 }, {
483 .name = "watchdog",
Ben Dooksaf337f32010-04-28 18:03:57 +0900484 .parent = &clk_p,
485 .ctrlbit = S3C2443_PCLKCON_WDT,
486 }, {
487 .name = "ac97",
Ben Dooksaf337f32010-04-28 18:03:57 +0900488 .parent = &clk_p,
489 .ctrlbit = S3C2443_PCLKCON_AC97,
490 }, {
491 .name = "nand",
Ben Dooksaf337f32010-04-28 18:03:57 +0900492 .parent = &clk_h,
493 }, {
494 .name = "usb-bus-host",
Ben Dooksaf337f32010-04-28 18:03:57 +0900495 .parent = &clk_usb_bus_host.clk,
496 }
497};
498
499static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0)
500{
501 clkcon0 &= S3C2443_CLKDIV0_HCLKDIV_MASK;
502
503 return clkcon0 + 1;
504}
505
506/* EPLLCON compatible enough to get on/off information */
507
508void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll,
509 fdiv_fn get_fdiv)
510{
511 unsigned long epllcon = __raw_readl(S3C2443_EPLLCON);
512 unsigned long mpllcon = __raw_readl(S3C2443_MPLLCON);
513 unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0);
514 struct clk *xtal_clk;
515 unsigned long xtal;
516 unsigned long pll;
517 unsigned long fclk;
518 unsigned long hclk;
519 unsigned long pclk;
520 int ptr;
521
522 xtal_clk = clk_get(NULL, "xtal");
523 xtal = clk_get_rate(xtal_clk);
524 clk_put(xtal_clk);
525
526 pll = get_mpll(mpllcon, xtal);
527 clk_msysclk.clk.rate = pll;
528
529 fclk = pll / get_fdiv(clkdiv0);
530 hclk = s3c2443_prediv_getrate(&clk_prediv);
531 hclk /= s3c2443_get_hdiv(clkdiv0);
532 pclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_PCLK) ? 2 : 1);
533
534 s3c24xx_setup_clocks(fclk, hclk, pclk);
535
536 printk("CPU: MPLL %s %ld.%03ld MHz, cpu %ld.%03ld MHz, mem %ld.%03ld MHz, pclk %ld.%03ld MHz\n",
537 (mpllcon & S3C2443_PLLCON_OFF) ? "off":"on",
538 print_mhz(pll), print_mhz(fclk),
539 print_mhz(hclk), print_mhz(pclk));
540
541 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_clks); ptr++)
542 s3c_set_clksrc(&clksrc_clks[ptr], true);
543
544 /* ensure usb bus clock is within correct rate of 48MHz */
545
546 if (clk_get_rate(&clk_usb_bus_host.clk) != (48 * 1000 * 1000)) {
547 printk(KERN_INFO "Warning: USB host bus not at 48MHz\n");
548 clk_set_rate(&clk_usb_bus_host.clk, 48*1000*1000);
549 }
550
551 printk("CPU: EPLL %s %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n",
552 (epllcon & S3C2443_PLLCON_OFF) ? "off":"on",
553 print_mhz(clk_get_rate(&clk_epll)),
554 print_mhz(clk_get_rate(&clk_usb_bus)));
555}
556
557static struct clk *clks[] __initdata = {
558 &clk_prediv,
559 &clk_mpllref,
560 &clk_mdivclk,
561 &clk_ext,
562 &clk_epll,
563 &clk_usb_bus,
Heiko St?bneraab08ee2011-10-14 15:08:56 +0900564 &clk_armdiv,
Ben Dooksaf337f32010-04-28 18:03:57 +0900565};
566
567static struct clksrc_clk *clksrcs[] __initdata = {
Heiko Stuebnere3b454f2011-09-27 08:44:37 +0900568 &clk_i2s_eplldiv,
569 &clk_i2s,
Ben Dooksaf337f32010-04-28 18:03:57 +0900570 &clk_usb_bus_host,
571 &clk_epllref,
572 &clk_esysclk,
573 &clk_msysclk,
Heiko St?bneraab08ee2011-10-14 15:08:56 +0900574 &clk_arm,
Ben Dooksaf337f32010-04-28 18:03:57 +0900575};
576
577void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll,
Heiko Stuebnerd9a3bfb2011-10-14 15:08:56 +0900578 fdiv_fn get_fdiv,
579 unsigned int *divs, int nr_divs,
580 int divmask)
Ben Dooksaf337f32010-04-28 18:03:57 +0900581{
582 int ptr;
583
Heiko Stuebnerd9a3bfb2011-10-14 15:08:56 +0900584 armdiv = divs;
585 nr_armdiv = nr_divs;
586 armdivmask = divmask;
587
Ben Dooksaf337f32010-04-28 18:03:57 +0900588 /* s3c2443 parents h and p clocks from prediv */
589 clk_h.parent = &clk_prediv;
590 clk_p.parent = &clk_prediv;
591
592 clk_usb_bus.parent = &clk_usb_bus_host.clk;
593 clk_epll.parent = &clk_epllref.clk;
594
595 s3c24xx_register_baseclocks(xtal);
596 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
597
598 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
599 s3c_register_clksrc(clksrcs[ptr], 1);
600
601 s3c_register_clksrc(clksrc_clks, ARRAY_SIZE(clksrc_clks));
602 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
603
604 /* See s3c2443/etc notes on disabling clocks at init time */
605 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
606 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
607
608 s3c2443_common_setup_clocks(get_mpll, get_fdiv);
609}