blob: b9cd130596c21bd7a51a54b914e03c3b030ed8d3 [file] [log] [blame]
Kukjin Kim3109e552010-09-01 15:35:30 +09001/* linux/arch/arm/mach-s5p64x0/clock-s5p6450.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P6450 - Clock support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/clk.h>
20#include <linux/sysdev.h>
21#include <linux/io.h>
22
23#include <mach/hardware.h>
24#include <mach/map.h>
25#include <mach/regs-clock.h>
26#include <mach/s5p64x0-clock.h>
27
28#include <plat/cpu-freq.h>
29#include <plat/clock.h>
30#include <plat/cpu.h>
31#include <plat/pll.h>
32#include <plat/s5p-clock.h>
33#include <plat/clock-clksrc.h>
34#include <plat/s5p6450.h>
35
36static struct clksrc_clk clk_mout_dpll = {
37 .clk = {
38 .name = "mout_dpll",
39 .id = -1,
40 },
41 .sources = &clk_src_dpll,
42 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 5, .size = 1 },
43};
44
45static u32 epll_div[][5] = {
46 { 133000000, 27307, 55, 2, 2 },
47 { 100000000, 43691, 41, 2, 2 },
48 { 480000000, 0, 80, 2, 0 },
49};
50
51static int s5p6450_epll_set_rate(struct clk *clk, unsigned long rate)
52{
53 unsigned int epll_con, epll_con_k;
54 unsigned int i;
55
56 if (clk->rate == rate) /* Return if nothing changed */
57 return 0;
58
59 epll_con = __raw_readl(S5P64X0_EPLL_CON);
60 epll_con_k = __raw_readl(S5P64X0_EPLL_CON_K);
61
62 epll_con_k &= ~(PLL90XX_KDIV_MASK);
63 epll_con &= ~(PLL90XX_MDIV_MASK | PLL90XX_PDIV_MASK | PLL90XX_SDIV_MASK);
64
65 for (i = 0; i < ARRAY_SIZE(epll_div); i++) {
66 if (epll_div[i][0] == rate) {
67 epll_con_k |= (epll_div[i][1] << PLL90XX_KDIV_SHIFT);
68 epll_con |= (epll_div[i][2] << PLL90XX_MDIV_SHIFT) |
69 (epll_div[i][3] << PLL90XX_PDIV_SHIFT) |
70 (epll_div[i][4] << PLL90XX_SDIV_SHIFT);
71 break;
72 }
73 }
74
75 if (i == ARRAY_SIZE(epll_div)) {
76 printk(KERN_ERR "%s: Invalid Clock EPLL Frequency\n", __func__);
77 return -EINVAL;
78 }
79
80 __raw_writel(epll_con, S5P64X0_EPLL_CON);
81 __raw_writel(epll_con_k, S5P64X0_EPLL_CON_K);
82
Seungwhan Youn96166742010-10-14 10:39:33 +090083 printk(KERN_WARNING "EPLL Rate changes from %lu to %lu\n",
84 clk->rate, rate);
85
Kukjin Kim3109e552010-09-01 15:35:30 +090086 clk->rate = rate;
87
88 return 0;
89}
90
91static struct clk_ops s5p6450_epll_ops = {
Seungwhan Yound4b34c62010-10-14 10:39:08 +090092 .get_rate = s5p_epll_get_rate,
Kukjin Kim3109e552010-09-01 15:35:30 +090093 .set_rate = s5p6450_epll_set_rate,
94};
95
96static struct clksrc_clk clk_dout_epll = {
97 .clk = {
98 .name = "dout_epll",
99 .id = -1,
100 .parent = &clk_mout_epll.clk,
101 },
102 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 24, .size = 4 },
103};
104
105static struct clksrc_clk clk_mout_hclk_sel = {
106 .clk = {
107 .name = "mout_hclk_sel",
108 .id = -1,
109 },
110 .sources = &clkset_hclk_low,
111 .reg_src = { .reg = S5P64X0_OTHERS, .shift = 15, .size = 1 },
112};
113
114static struct clk *clkset_hclk_list[] = {
115 &clk_mout_hclk_sel.clk,
116 &clk_armclk.clk,
117};
118
119static struct clksrc_sources clkset_hclk = {
120 .sources = clkset_hclk_list,
121 .nr_sources = ARRAY_SIZE(clkset_hclk_list),
122};
123
124static struct clksrc_clk clk_hclk = {
125 .clk = {
126 .name = "clk_hclk",
127 .id = -1,
128 },
129 .sources = &clkset_hclk,
130 .reg_src = { .reg = S5P64X0_OTHERS, .shift = 14, .size = 1 },
131 .reg_div = { .reg = S5P64X0_CLK_DIV0, .shift = 8, .size = 4 },
132};
133
134static struct clksrc_clk clk_pclk = {
135 .clk = {
136 .name = "clk_pclk",
137 .id = -1,
138 .parent = &clk_hclk.clk,
139 },
140 .reg_div = { .reg = S5P64X0_CLK_DIV0, .shift = 12, .size = 4 },
141};
142static struct clksrc_clk clk_dout_pwm_ratio0 = {
143 .clk = {
144 .name = "clk_dout_pwm_ratio0",
145 .id = -1,
146 .parent = &clk_mout_hclk_sel.clk,
147 },
148 .reg_div = { .reg = S5P64X0_CLK_DIV3, .shift = 16, .size = 4 },
149};
150
151static struct clksrc_clk clk_pclk_to_wdt_pwm = {
152 .clk = {
153 .name = "clk_pclk_to_wdt_pwm",
154 .id = -1,
155 .parent = &clk_dout_pwm_ratio0.clk,
156 },
157 .reg_div = { .reg = S5P64X0_CLK_DIV3, .shift = 20, .size = 4 },
158};
159
160static struct clksrc_clk clk_hclk_low = {
161 .clk = {
162 .name = "clk_hclk_low",
163 .id = -1,
164 },
165 .sources = &clkset_hclk_low,
166 .reg_src = { .reg = S5P64X0_OTHERS, .shift = 6, .size = 1 },
167 .reg_div = { .reg = S5P64X0_CLK_DIV3, .shift = 8, .size = 4 },
168};
169
170static struct clksrc_clk clk_pclk_low = {
171 .clk = {
172 .name = "clk_pclk_low",
173 .id = -1,
174 .parent = &clk_hclk_low.clk,
175 },
176 .reg_div = { .reg = S5P64X0_CLK_DIV3, .shift = 12, .size = 4 },
177};
178
179/*
180 * The following clocks will be disabled during clock initialization. It is
181 * recommended to keep the following clocks disabled until the driver requests
182 * for enabling the clock.
183 */
184static struct clk init_clocks_disable[] = {
185 {
186 .name = "usbhost",
187 .id = -1,
188 .parent = &clk_hclk_low.clk,
189 .enable = s5p64x0_hclk0_ctrl,
190 .ctrlbit = (1 << 3),
191 }, {
Seungwhan Younb05d8532010-10-19 18:13:11 +0900192 .name = "pdma",
193 .id = -1,
194 .parent = &clk_hclk_low.clk,
195 .enable = s5p64x0_hclk0_ctrl,
196 .ctrlbit = (1 << 12),
197 }, {
Kukjin Kim3109e552010-09-01 15:35:30 +0900198 .name = "hsmmc",
199 .id = 0,
200 .parent = &clk_hclk_low.clk,
201 .enable = s5p64x0_hclk0_ctrl,
202 .ctrlbit = (1 << 17),
203 }, {
204 .name = "hsmmc",
205 .id = 1,
206 .parent = &clk_hclk_low.clk,
207 .enable = s5p64x0_hclk0_ctrl,
208 .ctrlbit = (1 << 18),
209 }, {
210 .name = "hsmmc",
211 .id = 2,
212 .parent = &clk_hclk_low.clk,
213 .enable = s5p64x0_hclk0_ctrl,
214 .ctrlbit = (1 << 19),
215 }, {
216 .name = "usbotg",
217 .id = -1,
218 .parent = &clk_hclk_low.clk,
219 .enable = s5p64x0_hclk0_ctrl,
220 .ctrlbit = (1 << 20),
221 }, {
222 .name = "lcd",
223 .id = -1,
224 .parent = &clk_h,
225 .enable = s5p64x0_hclk1_ctrl,
226 .ctrlbit = (1 << 1),
227 }, {
228 .name = "watchdog",
229 .id = -1,
230 .parent = &clk_pclk_low.clk,
231 .enable = s5p64x0_pclk_ctrl,
232 .ctrlbit = (1 << 5),
233 }, {
Atul Dahiya232d1002010-12-02 13:36:12 +0900234 .name = "rtc",
235 .id = -1,
236 .parent = &clk_pclk_low.clk,
237 .enable = s5p64x0_pclk_ctrl,
238 .ctrlbit = (1 << 6),
239 }, {
Kukjin Kim3109e552010-09-01 15:35:30 +0900240 .name = "adc",
241 .id = -1,
242 .parent = &clk_pclk_low.clk,
243 .enable = s5p64x0_pclk_ctrl,
244 .ctrlbit = (1 << 12),
245 }, {
246 .name = "i2c",
247 .id = 0,
248 .parent = &clk_pclk_low.clk,
249 .enable = s5p64x0_pclk_ctrl,
250 .ctrlbit = (1 << 17),
251 }, {
252 .name = "spi",
253 .id = 0,
254 .parent = &clk_pclk_low.clk,
255 .enable = s5p64x0_pclk_ctrl,
256 .ctrlbit = (1 << 21),
257 }, {
258 .name = "spi",
259 .id = 1,
260 .parent = &clk_pclk_low.clk,
261 .enable = s5p64x0_pclk_ctrl,
262 .ctrlbit = (1 << 22),
263 }, {
264 .name = "iis",
265 .id = -1,
266 .parent = &clk_pclk_low.clk,
267 .enable = s5p64x0_pclk_ctrl,
268 .ctrlbit = (1 << 26),
269 }, {
270 .name = "i2c",
271 .id = 1,
272 .parent = &clk_pclk_low.clk,
273 .enable = s5p64x0_pclk_ctrl,
274 .ctrlbit = (1 << 27),
275 }, {
276 .name = "dmc0",
277 .id = -1,
278 .parent = &clk_pclk.clk,
279 .enable = s5p64x0_pclk_ctrl,
280 .ctrlbit = (1 << 30),
281 }
282};
283
284/*
285 * The following clocks will be enabled during clock initialization.
286 */
287static struct clk init_clocks[] = {
288 {
289 .name = "intc",
290 .id = -1,
291 .parent = &clk_hclk.clk,
292 .enable = s5p64x0_hclk0_ctrl,
293 .ctrlbit = (1 << 1),
294 }, {
295 .name = "mem",
296 .id = -1,
297 .parent = &clk_hclk.clk,
298 .enable = s5p64x0_hclk0_ctrl,
299 .ctrlbit = (1 << 21),
300 }, {
Kukjin Kim3109e552010-09-01 15:35:30 +0900301 .name = "uart",
302 .id = 0,
303 .parent = &clk_pclk_low.clk,
304 .enable = s5p64x0_pclk_ctrl,
305 .ctrlbit = (1 << 1),
306 }, {
307 .name = "uart",
308 .id = 1,
309 .parent = &clk_pclk_low.clk,
310 .enable = s5p64x0_pclk_ctrl,
311 .ctrlbit = (1 << 2),
312 }, {
313 .name = "uart",
314 .id = 2,
315 .parent = &clk_pclk_low.clk,
316 .enable = s5p64x0_pclk_ctrl,
317 .ctrlbit = (1 << 3),
318 }, {
319 .name = "uart",
320 .id = 3,
321 .parent = &clk_pclk_low.clk,
322 .enable = s5p64x0_pclk_ctrl,
323 .ctrlbit = (1 << 4),
324 }, {
325 .name = "timers",
326 .id = -1,
327 .parent = &clk_pclk_to_wdt_pwm.clk,
328 .enable = s5p64x0_pclk_ctrl,
329 .ctrlbit = (1 << 7),
330 }, {
331 .name = "gpio",
332 .id = -1,
333 .parent = &clk_pclk_low.clk,
334 .enable = s5p64x0_pclk_ctrl,
335 .ctrlbit = (1 << 18),
336 },
337};
338
339static struct clk *clkset_uart_list[] = {
340 &clk_dout_epll.clk,
341 &clk_dout_mpll.clk,
342};
343
344static struct clksrc_sources clkset_uart = {
345 .sources = clkset_uart_list,
346 .nr_sources = ARRAY_SIZE(clkset_uart_list),
347};
348
349static struct clk *clkset_mali_list[] = {
350 &clk_mout_epll.clk,
351 &clk_mout_apll.clk,
352 &clk_mout_mpll.clk,
353};
354
355static struct clksrc_sources clkset_mali = {
356 .sources = clkset_mali_list,
357 .nr_sources = ARRAY_SIZE(clkset_mali_list),
358};
359
360static struct clk *clkset_group2_list[] = {
361 &clk_dout_epll.clk,
362 &clk_dout_mpll.clk,
363 &clk_ext_xtal_mux,
364};
365
366static struct clksrc_sources clkset_group2 = {
367 .sources = clkset_group2_list,
368 .nr_sources = ARRAY_SIZE(clkset_group2_list),
369};
370
371static struct clk *clkset_dispcon_list[] = {
372 &clk_dout_epll.clk,
373 &clk_dout_mpll.clk,
374 &clk_ext_xtal_mux,
375 &clk_mout_dpll.clk,
376};
377
378static struct clksrc_sources clkset_dispcon = {
379 .sources = clkset_dispcon_list,
380 .nr_sources = ARRAY_SIZE(clkset_dispcon_list),
381};
382
383static struct clk *clkset_hsmmc44_list[] = {
384 &clk_dout_epll.clk,
385 &clk_dout_mpll.clk,
386 &clk_ext_xtal_mux,
387 &s5p_clk_27m,
388 &clk_48m,
389};
390
391static struct clksrc_sources clkset_hsmmc44 = {
392 .sources = clkset_hsmmc44_list,
393 .nr_sources = ARRAY_SIZE(clkset_hsmmc44_list),
394};
395
396static struct clk *clkset_sclk_audio0_list[] = {
397 [0] = &clk_dout_epll.clk,
398 [1] = &clk_dout_mpll.clk,
399 [2] = &clk_ext_xtal_mux,
400 [3] = NULL,
401 [4] = NULL,
402};
403
404static struct clksrc_sources clkset_sclk_audio0 = {
405 .sources = clkset_sclk_audio0_list,
406 .nr_sources = ARRAY_SIZE(clkset_sclk_audio0_list),
407};
408
409static struct clksrc_clk clk_sclk_audio0 = {
410 .clk = {
411 .name = "audio-bus",
412 .id = -1,
413 .enable = s5p64x0_sclk_ctrl,
414 .ctrlbit = (1 << 8),
415 .parent = &clk_dout_epll.clk,
416 },
417 .sources = &clkset_sclk_audio0,
418 .reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 10, .size = 3 },
419 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 8, .size = 4 },
420};
421
422static struct clksrc_clk clksrcs[] = {
423 {
424 .clk = {
425 .name = "sclk_mmc",
426 .id = 0,
427 .ctrlbit = (1 << 24),
428 .enable = s5p64x0_sclk_ctrl,
429 },
430 .sources = &clkset_group2,
431 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 18, .size = 2 },
432 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 0, .size = 4 },
433 }, {
434 .clk = {
435 .name = "sclk_mmc",
436 .id = 1,
437 .ctrlbit = (1 << 25),
438 .enable = s5p64x0_sclk_ctrl,
439 },
440 .sources = &clkset_group2,
441 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 20, .size = 2 },
442 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 4, .size = 4 },
443 }, {
444 .clk = {
445 .name = "sclk_mmc",
446 .id = 2,
447 .ctrlbit = (1 << 26),
448 .enable = s5p64x0_sclk_ctrl,
449 },
450 .sources = &clkset_group2,
451 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 22, .size = 2 },
452 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 },
453 }, {
454 .clk = {
455 .name = "uclk1",
456 .id = -1,
457 .ctrlbit = (1 << 5),
458 .enable = s5p64x0_sclk_ctrl,
459 },
460 .sources = &clkset_uart,
461 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 },
462 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 },
463 }, {
464 .clk = {
465 .name = "sclk_spi",
466 .id = 0,
467 .ctrlbit = (1 << 20),
468 .enable = s5p64x0_sclk_ctrl,
469 },
470 .sources = &clkset_group2,
471 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 14, .size = 2 },
472 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 0, .size = 4 },
473 }, {
474 .clk = {
475 .name = "sclk_spi",
476 .id = 1,
477 .ctrlbit = (1 << 21),
478 .enable = s5p64x0_sclk_ctrl,
479 },
480 .sources = &clkset_group2,
481 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 16, .size = 2 },
482 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 },
483 }, {
484 .clk = {
485 .name = "sclk_fimc",
486 .id = -1,
487 .ctrlbit = (1 << 10),
488 .enable = s5p64x0_sclk_ctrl,
489 },
490 .sources = &clkset_group2,
491 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 26, .size = 2 },
492 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 12, .size = 4 },
493 }, {
494 .clk = {
495 .name = "aclk_mali",
496 .id = -1,
497 .ctrlbit = (1 << 2),
498 .enable = s5p64x0_sclk1_ctrl,
499 },
500 .sources = &clkset_mali,
501 .reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 8, .size = 2 },
502 .reg_div = { .reg = S5P64X0_CLK_DIV3, .shift = 4, .size = 4 },
503 }, {
504 .clk = {
505 .name = "sclk_2d",
506 .id = -1,
507 .ctrlbit = (1 << 12),
508 .enable = s5p64x0_sclk_ctrl,
509 },
510 .sources = &clkset_mali,
511 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 30, .size = 2 },
512 .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 20, .size = 4 },
513 }, {
514 .clk = {
515 .name = "sclk_usi",
516 .id = -1,
517 .ctrlbit = (1 << 7),
518 .enable = s5p64x0_sclk_ctrl,
519 },
520 .sources = &clkset_group2,
521 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 10, .size = 2 },
522 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 16, .size = 4 },
523 }, {
524 .clk = {
525 .name = "sclk_camif",
526 .id = -1,
527 .ctrlbit = (1 << 6),
528 .enable = s5p64x0_sclk_ctrl,
529 },
530 .sources = &clkset_group2,
531 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 28, .size = 2 },
532 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 20, .size = 4 },
533 }, {
534 .clk = {
535 .name = "sclk_dispcon",
536 .id = -1,
537 .ctrlbit = (1 << 1),
538 .enable = s5p64x0_sclk1_ctrl,
539 },
540 .sources = &clkset_dispcon,
541 .reg_src = { .reg = S5P64X0_CLK_SRC1, .shift = 4, .size = 2 },
542 .reg_div = { .reg = S5P64X0_CLK_DIV3, .shift = 0, .size = 4 },
543 }, {
544 .clk = {
545 .name = "sclk_hsmmc44",
546 .id = -1,
547 .ctrlbit = (1 << 30),
548 .enable = s5p64x0_sclk_ctrl,
549 },
550 .sources = &clkset_hsmmc44,
551 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 6, .size = 3 },
552 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 28, .size = 4 },
553 },
554};
555
556/* Clock initialization code */
557static struct clksrc_clk *sysclks[] = {
558 &clk_mout_apll,
559 &clk_mout_epll,
560 &clk_dout_epll,
561 &clk_mout_mpll,
562 &clk_dout_mpll,
563 &clk_armclk,
564 &clk_mout_hclk_sel,
565 &clk_dout_pwm_ratio0,
566 &clk_pclk_to_wdt_pwm,
567 &clk_hclk,
568 &clk_pclk,
569 &clk_hclk_low,
570 &clk_pclk_low,
571 &clk_sclk_audio0,
572};
573
574void __init_or_cpufreq s5p6450_setup_clocks(void)
575{
576 struct clk *xtal_clk;
577
578 unsigned long xtal;
579 unsigned long fclk;
580 unsigned long hclk;
581 unsigned long hclk_low;
582 unsigned long pclk;
583 unsigned long pclk_low;
584
585 unsigned long apll;
586 unsigned long mpll;
587 unsigned long epll;
588 unsigned long dpll;
589 unsigned int ptr;
590
591 /* Set S5P6450 functions for clk_fout_epll */
592
Seungwhan Yound4b34c62010-10-14 10:39:08 +0900593 clk_fout_epll.enable = s5p_epll_enable;
Kukjin Kim3109e552010-09-01 15:35:30 +0900594 clk_fout_epll.ops = &s5p6450_epll_ops;
595
596 clk_48m.enable = s5p64x0_clk48m_ctrl;
597
598 xtal_clk = clk_get(NULL, "ext_xtal");
599 BUG_ON(IS_ERR(xtal_clk));
600
601 xtal = clk_get_rate(xtal_clk);
602 clk_put(xtal_clk);
603
604 apll = s5p_get_pll45xx(xtal, __raw_readl(S5P64X0_APLL_CON), pll_4502);
605 mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P64X0_MPLL_CON), pll_4502);
606 epll = s5p_get_pll90xx(xtal, __raw_readl(S5P64X0_EPLL_CON),
607 __raw_readl(S5P64X0_EPLL_CON_K));
608 dpll = s5p_get_pll46xx(xtal, __raw_readl(S5P6450_DPLL_CON),
609 __raw_readl(S5P6450_DPLL_CON_K), pll_4650c);
610
611 clk_fout_apll.rate = apll;
612 clk_fout_mpll.rate = mpll;
613 clk_fout_epll.rate = epll;
614 clk_fout_dpll.rate = dpll;
615
616 printk(KERN_INFO "S5P6450: PLL settings, A=%ld.%ldMHz, M=%ld.%ldMHz," \
617 " E=%ld.%ldMHz, D=%ld.%ldMHz\n",
618 print_mhz(apll), print_mhz(mpll), print_mhz(epll),
619 print_mhz(dpll));
620
621 fclk = clk_get_rate(&clk_armclk.clk);
622 hclk = clk_get_rate(&clk_hclk.clk);
623 pclk = clk_get_rate(&clk_pclk.clk);
624 hclk_low = clk_get_rate(&clk_hclk_low.clk);
625 pclk_low = clk_get_rate(&clk_pclk_low.clk);
626
627 printk(KERN_INFO "S5P6450: HCLK=%ld.%ldMHz, HCLK_LOW=%ld.%ldMHz," \
628 " PCLK=%ld.%ldMHz, PCLK_LOW=%ld.%ldMHz\n",
629 print_mhz(hclk), print_mhz(hclk_low),
630 print_mhz(pclk), print_mhz(pclk_low));
631
632 clk_f.rate = fclk;
633 clk_h.rate = hclk;
634 clk_p.rate = pclk;
635
636 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
637 s3c_set_clksrc(&clksrcs[ptr], true);
638}
639
640void __init s5p6450_register_clocks(void)
641{
642 struct clk *clkp;
643 int ret;
644 int ptr;
645
646 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++)
647 s3c_register_clksrc(sysclks[ptr], 1);
648
649 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
650 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
651
652 clkp = init_clocks_disable;
653 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
654
655 ret = s3c24xx_register_clock(clkp);
656 if (ret < 0) {
657 printk(KERN_ERR "Failed to register clock %s (%d)\n",
658 clkp->name, ret);
659 }
660 (clkp->enable)(clkp, 0);
661 }
662
663 s3c_pwmclk_init();
664}