aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c64xx/clock.c')
-rw-r--r--arch/arm/mach-s3c64xx/clock.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c
index 39c238d7a3dc..2addd988141c 100644
--- a/arch/arm/mach-s3c64xx/clock.c
+++ b/arch/arm/mach-s3c64xx/clock.c
@@ -617,16 +617,6 @@ static struct clksrc_clk clksrcs[] = {
617 .sources = &clkset_uhost, 617 .sources = &clkset_uhost,
618 }, { 618 }, {
619 .clk = { 619 .clk = {
620 .name = "uclk1",
621 .ctrlbit = S3C_CLKCON_SCLK_UART,
622 .enable = s3c64xx_sclk_ctrl,
623 },
624 .reg_src = { .reg = S3C_CLK_SRC, .shift = 13, .size = 1 },
625 .reg_div = { .reg = S3C_CLK_DIV2, .shift = 16, .size = 4 },
626 .sources = &clkset_uart,
627 }, {
628/* Where does UCLK0 come from? */
629 .clk = {
630 .name = "spi-bus", 620 .name = "spi-bus",
631 .devname = "s3c64xx-spi.0", 621 .devname = "s3c64xx-spi.0",
632 .ctrlbit = S3C_CLKCON_SCLK_SPI0, 622 .ctrlbit = S3C_CLKCON_SCLK_SPI0,
@@ -695,6 +685,18 @@ static struct clksrc_clk clksrcs[] = {
695 }, 685 },
696}; 686};
697 687
688/* Where does UCLK0 come from? */
689static struct clksrc_clk clk_sclk_uclk = {
690 .clk = {
691 .name = "uclk1",
692 .ctrlbit = S3C_CLKCON_SCLK_UART,
693 .enable = s3c64xx_sclk_ctrl,
694 },
695 .reg_src = { .reg = S3C_CLK_SRC, .shift = 13, .size = 1 },
696 .reg_div = { .reg = S3C_CLK_DIV2, .shift = 16, .size = 4 },
697 .sources = &clkset_uart,
698};
699
698/* Clock initialisation code */ 700/* Clock initialisation code */
699 701
700static struct clksrc_clk *init_parents[] = { 702static struct clksrc_clk *init_parents[] = {
@@ -703,6 +705,15 @@ static struct clksrc_clk *init_parents[] = {
703 &clk_mout_mpll, 705 &clk_mout_mpll,
704}; 706};
705 707
708static struct clksrc_clk *clksrc_cdev[] = {
709 &clk_sclk_uclk,
710};
711
712static struct clk_lookup s3c64xx_clk_lookup[] = {
713 CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p),
714 CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk),
715};
716
706#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) 717#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
707 718
708void __init_or_cpufreq s3c6400_setup_clocks(void) 719void __init_or_cpufreq s3c6400_setup_clocks(void)
@@ -811,6 +822,8 @@ static struct clk *clks[] __initdata = {
811void __init s3c64xx_register_clocks(unsigned long xtal, 822void __init s3c64xx_register_clocks(unsigned long xtal,
812 unsigned armclk_divlimit) 823 unsigned armclk_divlimit)
813{ 824{
825 unsigned int cnt;
826
814 armclk_mask = armclk_divlimit; 827 armclk_mask = armclk_divlimit;
815 828
816 s3c24xx_register_baseclocks(xtal); 829 s3c24xx_register_baseclocks(xtal);
@@ -823,5 +836,9 @@ void __init s3c64xx_register_clocks(unsigned long xtal,
823 836
824 s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1)); 837 s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1));
825 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 838 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
839 for (cnt = 0; cnt < ARRAY_SIZE(clksrc_cdev); cnt++)
840 s3c_register_clksrc(clksrc_cdev[cnt], 1);
841 clkdev_add_table(s3c64xx_clk_lookup, ARRAY_SIZE(s3c64xx_clk_lookup));
842
826 s3c_pwmclk_init(); 843 s3c_pwmclk_init();
827} 844}