diff options
Diffstat (limited to 'arch/arm/mach-s5p64x0/clock-s5p6440.c')
-rw-r--r-- | arch/arm/mach-s5p64x0/clock-s5p6440.c | 96 |
1 files changed, 54 insertions, 42 deletions
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c index c54c65d511f..58811ba89ee 100644 --- a/arch/arm/mach-s5p64x0/clock-s5p6440.c +++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c | |||
@@ -31,7 +31,8 @@ | |||
31 | #include <plat/pll.h> | 31 | #include <plat/pll.h> |
32 | #include <plat/s5p-clock.h> | 32 | #include <plat/s5p-clock.h> |
33 | #include <plat/clock-clksrc.h> | 33 | #include <plat/clock-clksrc.h> |
34 | #include <plat/s5p6440.h> | 34 | |
35 | #include "common.h" | ||
35 | 36 | ||
36 | static u32 epll_div[][5] = { | 37 | static u32 epll_div[][5] = { |
37 | { 36000000, 0, 48, 1, 4 }, | 38 | { 36000000, 0, 48, 1, 4 }, |
@@ -268,18 +269,6 @@ static struct clk init_clocks_off[] = { | |||
268 | .enable = s5p64x0_pclk_ctrl, | 269 | .enable = s5p64x0_pclk_ctrl, |
269 | .ctrlbit = (1 << 31), | 270 | .ctrlbit = (1 << 31), |
270 | }, { | 271 | }, { |
271 | .name = "sclk_spi_48", | ||
272 | .devname = "s3c64xx-spi.0", | ||
273 | .parent = &clk_48m, | ||
274 | .enable = s5p64x0_sclk_ctrl, | ||
275 | .ctrlbit = (1 << 22), | ||
276 | }, { | ||
277 | .name = "sclk_spi_48", | ||
278 | .devname = "s3c64xx-spi.1", | ||
279 | .parent = &clk_48m, | ||
280 | .enable = s5p64x0_sclk_ctrl, | ||
281 | .ctrlbit = (1 << 23), | ||
282 | }, { | ||
283 | .name = "mmc_48m", | 272 | .name = "mmc_48m", |
284 | .devname = "s3c-sdhci.0", | 273 | .devname = "s3c-sdhci.0", |
285 | .parent = &clk_48m, | 274 | .parent = &clk_48m, |
@@ -421,35 +410,6 @@ static struct clksrc_clk clksrcs[] = { | |||
421 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, | 410 | .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, |
422 | }, { | 411 | }, { |
423 | .clk = { | 412 | .clk = { |
424 | .name = "uclk1", | ||
425 | .ctrlbit = (1 << 5), | ||
426 | .enable = s5p64x0_sclk_ctrl, | ||
427 | }, | ||
428 | .sources = &clkset_uart, | ||
429 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, | ||
430 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, | ||
431 | }, { | ||
432 | .clk = { | ||
433 | .name = "sclk_spi", | ||
434 | .devname = "s3c64xx-spi.0", | ||
435 | .ctrlbit = (1 << 20), | ||
436 | .enable = s5p64x0_sclk_ctrl, | ||
437 | }, | ||
438 | .sources = &clkset_group1, | ||
439 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 14, .size = 2 }, | ||
440 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 0, .size = 4 }, | ||
441 | }, { | ||
442 | .clk = { | ||
443 | .name = "sclk_spi", | ||
444 | .devname = "s3c64xx-spi.1", | ||
445 | .ctrlbit = (1 << 21), | ||
446 | .enable = s5p64x0_sclk_ctrl, | ||
447 | }, | ||
448 | .sources = &clkset_group1, | ||
449 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 16, .size = 2 }, | ||
450 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 }, | ||
451 | }, { | ||
452 | .clk = { | ||
453 | .name = "sclk_post", | 413 | .name = "sclk_post", |
454 | .ctrlbit = (1 << 10), | 414 | .ctrlbit = (1 << 10), |
455 | .enable = s5p64x0_sclk_ctrl, | 415 | .enable = s5p64x0_sclk_ctrl, |
@@ -487,6 +447,41 @@ static struct clksrc_clk clksrcs[] = { | |||
487 | }, | 447 | }, |
488 | }; | 448 | }; |
489 | 449 | ||
450 | static struct clksrc_clk clk_sclk_uclk = { | ||
451 | .clk = { | ||
452 | .name = "uclk1", | ||
453 | .ctrlbit = (1 << 5), | ||
454 | .enable = s5p64x0_sclk_ctrl, | ||
455 | }, | ||
456 | .sources = &clkset_uart, | ||
457 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, | ||
458 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, | ||
459 | }; | ||
460 | |||
461 | static struct clksrc_clk clk_sclk_spi0 = { | ||
462 | .clk = { | ||
463 | .name = "sclk_spi", | ||
464 | .devname = "s3c64xx-spi.0", | ||
465 | .ctrlbit = (1 << 20), | ||
466 | .enable = s5p64x0_sclk_ctrl, | ||
467 | }, | ||
468 | .sources = &clkset_group1, | ||
469 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 14, .size = 2 }, | ||
470 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 0, .size = 4 }, | ||
471 | }; | ||
472 | |||
473 | static struct clksrc_clk clk_sclk_spi1 = { | ||
474 | .clk = { | ||
475 | .name = "sclk_spi", | ||
476 | .devname = "s3c64xx-spi.1", | ||
477 | .ctrlbit = (1 << 21), | ||
478 | .enable = s5p64x0_sclk_ctrl, | ||
479 | }, | ||
480 | .sources = &clkset_group1, | ||
481 | .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 16, .size = 2 }, | ||
482 | .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 4, .size = 4 }, | ||
483 | }; | ||
484 | |||
490 | /* Clock initialization code */ | 485 | /* Clock initialization code */ |
491 | static struct clksrc_clk *sysclks[] = { | 486 | static struct clksrc_clk *sysclks[] = { |
492 | &clk_mout_apll, | 487 | &clk_mout_apll, |
@@ -505,6 +500,20 @@ static struct clk dummy_apb_pclk = { | |||
505 | .id = -1, | 500 | .id = -1, |
506 | }; | 501 | }; |
507 | 502 | ||
503 | static struct clksrc_clk *clksrc_cdev[] = { | ||
504 | &clk_sclk_uclk, | ||
505 | &clk_sclk_spi0, | ||
506 | &clk_sclk_spi1, | ||
507 | }; | ||
508 | |||
509 | static struct clk_lookup s5p6440_clk_lookup[] = { | ||
510 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_pclk_low.clk), | ||
511 | CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk), | ||
512 | CLKDEV_INIT(NULL, "spi_busclk0", &clk_p), | ||
513 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk), | ||
514 | CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.clk), | ||
515 | }; | ||
516 | |||
508 | void __init_or_cpufreq s5p6440_setup_clocks(void) | 517 | void __init_or_cpufreq s5p6440_setup_clocks(void) |
509 | { | 518 | { |
510 | struct clk *xtal_clk; | 519 | struct clk *xtal_clk; |
@@ -583,9 +592,12 @@ void __init s5p6440_register_clocks(void) | |||
583 | 592 | ||
584 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); | 593 | s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); |
585 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); | 594 | s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); |
595 | for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) | ||
596 | s3c_register_clksrc(clksrc_cdev[ptr], 1); | ||
586 | 597 | ||
587 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 598 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
588 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 599 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
600 | clkdev_add_table(s5p6440_clk_lookup, ARRAY_SIZE(s5p6440_clk_lookup)); | ||
589 | 601 | ||
590 | s3c24xx_register_clock(&dummy_apb_pclk); | 602 | s3c24xx_register_clock(&dummy_apb_pclk); |
591 | 603 | ||