aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx
diff options
context:
space:
mode:
authorRajeshwari Shinde <rajeshwari.s@samsung.com>2011-10-24 11:05:58 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-12-22 20:09:16 -0500
commita361d10a2b490812b051433b1aad5b4351372597 (patch)
tree7132392c01d78d275d12313056803e15e97c5f6b /arch/arm/mach-s3c64xx
parenta60879e7ca17ea41bacd57e3cb2b56e48135f7a3 (diff)
ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names
Add support for lookup of sdhci-s3c controller clocks using generic names for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's. Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> [kgene.kim@samsung.com: fixed trailing whitespace] Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c64xx')
-rw-r--r--arch/arm/mach-s3c64xx/clock.c126
1 files changed, 78 insertions, 48 deletions
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c
index 2addd988141c..415c5406b17c 100644
--- a/arch/arm/mach-s3c64xx/clock.c
+++ b/arch/arm/mach-s3c64xx/clock.c
@@ -243,24 +243,6 @@ static struct clk init_clocks[] = {
243 .enable = s3c64xx_hclk_ctrl, 243 .enable = s3c64xx_hclk_ctrl,
244 .ctrlbit = S3C_CLKCON_HCLK_UHOST, 244 .ctrlbit = S3C_CLKCON_HCLK_UHOST,
245 }, { 245 }, {
246 .name = "hsmmc",
247 .devname = "s3c-sdhci.0",
248 .parent = &clk_h,
249 .enable = s3c64xx_hclk_ctrl,
250 .ctrlbit = S3C_CLKCON_HCLK_HSMMC0,
251 }, {
252 .name = "hsmmc",
253 .devname = "s3c-sdhci.1",
254 .parent = &clk_h,
255 .enable = s3c64xx_hclk_ctrl,
256 .ctrlbit = S3C_CLKCON_HCLK_HSMMC1,
257 }, {
258 .name = "hsmmc",
259 .devname = "s3c-sdhci.2",
260 .parent = &clk_h,
261 .enable = s3c64xx_hclk_ctrl,
262 .ctrlbit = S3C_CLKCON_HCLK_HSMMC2,
263 }, {
264 .name = "otg", 246 .name = "otg",
265 .parent = &clk_h, 247 .parent = &clk_h,
266 .enable = s3c64xx_hclk_ctrl, 248 .enable = s3c64xx_hclk_ctrl,
@@ -310,6 +292,29 @@ static struct clk init_clocks[] = {
310 } 292 }
311}; 293};
312 294
295static struct clk clk_hsmmc0 = {
296 .name = "hsmmc",
297 .devname = "s3c-sdhci.0",
298 .parent = &clk_h,
299 .enable = s3c64xx_hclk_ctrl,
300 .ctrlbit = S3C_CLKCON_HCLK_HSMMC0,
301};
302
303static struct clk clk_hsmmc1 = {
304 .name = "hsmmc",
305 .devname = "s3c-sdhci.1",
306 .parent = &clk_h,
307 .enable = s3c64xx_hclk_ctrl,
308 .ctrlbit = S3C_CLKCON_HCLK_HSMMC1,
309};
310
311static struct clk clk_hsmmc2 = {
312 .name = "hsmmc",
313 .devname = "s3c-sdhci.2",
314 .parent = &clk_h,
315 .enable = s3c64xx_hclk_ctrl,
316 .ctrlbit = S3C_CLKCON_HCLK_HSMMC2,
317};
313 318
314static struct clk clk_fout_apll = { 319static struct clk clk_fout_apll = {
315 .name = "fout_apll", 320 .name = "fout_apll",
@@ -578,36 +583,6 @@ static struct clksrc_sources clkset_camif = {
578static struct clksrc_clk clksrcs[] = { 583static struct clksrc_clk clksrcs[] = {
579 { 584 {
580 .clk = { 585 .clk = {
581 .name = "mmc_bus",
582 .devname = "s3c-sdhci.0",
583 .ctrlbit = S3C_CLKCON_SCLK_MMC0,
584 .enable = s3c64xx_sclk_ctrl,
585 },
586 .reg_src = { .reg = S3C_CLK_SRC, .shift = 18, .size = 2 },
587 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 0, .size = 4 },
588 .sources = &clkset_spi_mmc,
589 }, {
590 .clk = {
591 .name = "mmc_bus",
592 .devname = "s3c-sdhci.1",
593 .ctrlbit = S3C_CLKCON_SCLK_MMC1,
594 .enable = s3c64xx_sclk_ctrl,
595 },
596 .reg_src = { .reg = S3C_CLK_SRC, .shift = 20, .size = 2 },
597 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 4, .size = 4 },
598 .sources = &clkset_spi_mmc,
599 }, {
600 .clk = {
601 .name = "mmc_bus",
602 .devname = "s3c-sdhci.2",
603 .ctrlbit = S3C_CLKCON_SCLK_MMC2,
604 .enable = s3c64xx_sclk_ctrl,
605 },
606 .reg_src = { .reg = S3C_CLK_SRC, .shift = 22, .size = 2 },
607 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 8, .size = 4 },
608 .sources = &clkset_spi_mmc,
609 }, {
610 .clk = {
611 .name = "usb-bus-host", 586 .name = "usb-bus-host",
612 .ctrlbit = S3C_CLKCON_SCLK_UHOST, 587 .ctrlbit = S3C_CLKCON_SCLK_UHOST,
613 .enable = s3c64xx_sclk_ctrl, 588 .enable = s3c64xx_sclk_ctrl,
@@ -697,6 +672,42 @@ static struct clksrc_clk clk_sclk_uclk = {
697 .sources = &clkset_uart, 672 .sources = &clkset_uart,
698}; 673};
699 674
675static struct clksrc_clk clk_sclk_mmc0 = {
676 .clk = {
677 .name = "mmc_bus",
678 .devname = "s3c-sdhci.0",
679 .ctrlbit = S3C_CLKCON_SCLK_MMC0,
680 .enable = s3c64xx_sclk_ctrl,
681 },
682 .reg_src = { .reg = S3C_CLK_SRC, .shift = 18, .size = 2 },
683 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 0, .size = 4 },
684 .sources = &clkset_spi_mmc,
685};
686
687static struct clksrc_clk clk_sclk_mmc1 = {
688 .clk = {
689 .name = "mmc_bus",
690 .devname = "s3c-sdhci.1",
691 .ctrlbit = S3C_CLKCON_SCLK_MMC1,
692 .enable = s3c64xx_sclk_ctrl,
693 },
694 .reg_src = { .reg = S3C_CLK_SRC, .shift = 20, .size = 2 },
695 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 4, .size = 4 },
696 .sources = &clkset_spi_mmc,
697};
698
699static struct clksrc_clk clk_sclk_mmc2 = {
700 .clk = {
701 .name = "mmc_bus",
702 .devname = "s3c-sdhci.2",
703 .ctrlbit = S3C_CLKCON_SCLK_MMC2,
704 .enable = s3c64xx_sclk_ctrl,
705 },
706 .reg_src = { .reg = S3C_CLK_SRC, .shift = 22, .size = 2 },
707 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 8, .size = 4 },
708 .sources = &clkset_spi_mmc,
709};
710
700/* Clock initialisation code */ 711/* Clock initialisation code */
701 712
702static struct clksrc_clk *init_parents[] = { 713static struct clksrc_clk *init_parents[] = {
@@ -707,11 +718,26 @@ static struct clksrc_clk *init_parents[] = {
707 718
708static struct clksrc_clk *clksrc_cdev[] = { 719static struct clksrc_clk *clksrc_cdev[] = {
709 &clk_sclk_uclk, 720 &clk_sclk_uclk,
721 &clk_sclk_mmc0,
722 &clk_sclk_mmc1,
723 &clk_sclk_mmc2,
724};
725
726static struct clk *clk_cdev[] = {
727 &clk_hsmmc0,
728 &clk_hsmmc1,
729 &clk_hsmmc2,
710}; 730};
711 731
712static struct clk_lookup s3c64xx_clk_lookup[] = { 732static struct clk_lookup s3c64xx_clk_lookup[] = {
713 CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), 733 CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p),
714 CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk), 734 CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk),
735 CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.0", &clk_hsmmc0),
736 CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &clk_hsmmc1),
737 CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.0", &clk_hsmmc2),
738 CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
739 CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
740 CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
715}; 741};
716 742
717#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) 743#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
@@ -834,6 +860,10 @@ void __init s3c64xx_register_clocks(unsigned long xtal,
834 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 860 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
835 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 861 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
836 862
863 s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev));
864 for (cnt = 0; cnt < ARRAY_SIZE(clk_cdev); cnt++)
865 s3c_disable_clocks(clk_cdev[cnt], 1);
866
837 s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1)); 867 s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1));
838 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 868 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
839 for (cnt = 0; cnt < ARRAY_SIZE(clksrc_cdev); cnt++) 869 for (cnt = 0; cnt < ARRAY_SIZE(clksrc_cdev); cnt++)