aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/clock-exynos5.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos/clock-exynos5.c')
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c163
1 files changed, 124 insertions, 39 deletions
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index 3b00e299b624..c44ca1ee1b8d 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -547,6 +547,68 @@ static struct clksrc_clk exynos5_clk_aclk_66 = {
547 .reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 0, .size = 3 }, 547 .reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 0, .size = 3 },
548}; 548};
549 549
550static struct clksrc_clk exynos5_clk_mout_aclk_300_gscl_mid = {
551 .clk = {
552 .name = "mout_aclk_300_gscl_mid",
553 },
554 .sources = &exynos5_clkset_aclk,
555 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP0, .shift = 24, .size = 1 },
556};
557
558static struct clk *exynos5_clkset_aclk_300_mid1_list[] = {
559 [0] = &exynos5_clk_sclk_vpll.clk,
560 [1] = &exynos5_clk_mout_cpll.clk,
561};
562
563static struct clksrc_sources exynos5_clkset_aclk_300_gscl_mid1 = {
564 .sources = exynos5_clkset_aclk_300_mid1_list,
565 .nr_sources = ARRAY_SIZE(exynos5_clkset_aclk_300_mid1_list),
566};
567
568static struct clksrc_clk exynos5_clk_mout_aclk_300_gscl_mid1 = {
569 .clk = {
570 .name = "mout_aclk_300_gscl_mid1",
571 },
572 .sources = &exynos5_clkset_aclk_300_gscl_mid1,
573 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP1, .shift = 12, .size = 1 },
574};
575
576static struct clk *exynos5_clkset_aclk_300_gscl_list[] = {
577 [0] = &exynos5_clk_mout_aclk_300_gscl_mid.clk,
578 [1] = &exynos5_clk_mout_aclk_300_gscl_mid1.clk,
579};
580
581static struct clksrc_sources exynos5_clkset_aclk_300_gscl = {
582 .sources = exynos5_clkset_aclk_300_gscl_list,
583 .nr_sources = ARRAY_SIZE(exynos5_clkset_aclk_300_gscl_list),
584};
585
586static struct clksrc_clk exynos5_clk_mout_aclk_300_gscl = {
587 .clk = {
588 .name = "mout_aclk_300_gscl",
589 },
590 .sources = &exynos5_clkset_aclk_300_gscl,
591 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP0, .shift = 25, .size = 1 },
592};
593
594static struct clk *exynos5_clk_src_gscl_300_list[] = {
595 [0] = &clk_ext_xtal_mux,
596 [1] = &exynos5_clk_mout_aclk_300_gscl.clk,
597};
598
599static struct clksrc_sources exynos5_clk_src_gscl_300 = {
600 .sources = exynos5_clk_src_gscl_300_list,
601 .nr_sources = ARRAY_SIZE(exynos5_clk_src_gscl_300_list),
602};
603
604static struct clksrc_clk exynos5_clk_aclk_300_gscl = {
605 .clk = {
606 .name = "aclk_300_gscl",
607 },
608 .sources = &exynos5_clk_src_gscl_300,
609 .reg_src = { .reg = EXYNOS5_CLKSRC_TOP3, .shift = 10, .size = 1 },
610};
611
550static struct clk exynos5_init_clocks_off[] = { 612static struct clk exynos5_init_clocks_off[] = {
551 { 613 {
552 .name = "timers", 614 .name = "timers",
@@ -564,35 +626,30 @@ static struct clk exynos5_init_clocks_off[] = {
564 .enable = exynos5_clk_ip_peris_ctrl, 626 .enable = exynos5_clk_ip_peris_ctrl,
565 .ctrlbit = (1 << 19), 627 .ctrlbit = (1 << 19),
566 }, { 628 }, {
567 .name = "hsmmc", 629 .name = "biu", /* bus interface unit clock */
568 .devname = "exynos4-sdhci.0", 630 .devname = "dw_mmc.0",
569 .parent = &exynos5_clk_aclk_200.clk, 631 .parent = &exynos5_clk_aclk_200.clk,
570 .enable = exynos5_clk_ip_fsys_ctrl, 632 .enable = exynos5_clk_ip_fsys_ctrl,
571 .ctrlbit = (1 << 12), 633 .ctrlbit = (1 << 12),
572 }, { 634 }, {
573 .name = "hsmmc", 635 .name = "biu",
574 .devname = "exynos4-sdhci.1", 636 .devname = "dw_mmc.1",
575 .parent = &exynos5_clk_aclk_200.clk, 637 .parent = &exynos5_clk_aclk_200.clk,
576 .enable = exynos5_clk_ip_fsys_ctrl, 638 .enable = exynos5_clk_ip_fsys_ctrl,
577 .ctrlbit = (1 << 13), 639 .ctrlbit = (1 << 13),
578 }, { 640 }, {
579 .name = "hsmmc", 641 .name = "biu",
580 .devname = "exynos4-sdhci.2", 642 .devname = "dw_mmc.2",
581 .parent = &exynos5_clk_aclk_200.clk, 643 .parent = &exynos5_clk_aclk_200.clk,
582 .enable = exynos5_clk_ip_fsys_ctrl, 644 .enable = exynos5_clk_ip_fsys_ctrl,
583 .ctrlbit = (1 << 14), 645 .ctrlbit = (1 << 14),
584 }, { 646 }, {
585 .name = "hsmmc", 647 .name = "biu",
586 .devname = "exynos4-sdhci.3", 648 .devname = "dw_mmc.3",
587 .parent = &exynos5_clk_aclk_200.clk, 649 .parent = &exynos5_clk_aclk_200.clk,
588 .enable = exynos5_clk_ip_fsys_ctrl, 650 .enable = exynos5_clk_ip_fsys_ctrl,
589 .ctrlbit = (1 << 15), 651 .ctrlbit = (1 << 15),
590 }, { 652 }, {
591 .name = "dwmci",
592 .parent = &exynos5_clk_aclk_200.clk,
593 .enable = exynos5_clk_ip_fsys_ctrl,
594 .ctrlbit = (1 << 16),
595 }, {
596 .name = "sata", 653 .name = "sata",
597 .devname = "ahci", 654 .devname = "ahci",
598 .enable = exynos5_clk_ip_fsys_ctrl, 655 .enable = exynos5_clk_ip_fsys_ctrl,
@@ -755,6 +812,26 @@ static struct clk exynos5_init_clocks_off[] = {
755 .enable = exynos5_clk_ip_peric_ctrl, 812 .enable = exynos5_clk_ip_peric_ctrl,
756 .ctrlbit = (1 << 18), 813 .ctrlbit = (1 << 18),
757 }, { 814 }, {
815 .name = "gscl",
816 .devname = "exynos-gsc.0",
817 .enable = exynos5_clk_ip_gscl_ctrl,
818 .ctrlbit = (1 << 0),
819 }, {
820 .name = "gscl",
821 .devname = "exynos-gsc.1",
822 .enable = exynos5_clk_ip_gscl_ctrl,
823 .ctrlbit = (1 << 1),
824 }, {
825 .name = "gscl",
826 .devname = "exynos-gsc.2",
827 .enable = exynos5_clk_ip_gscl_ctrl,
828 .ctrlbit = (1 << 2),
829 }, {
830 .name = "gscl",
831 .devname = "exynos-gsc.3",
832 .enable = exynos5_clk_ip_gscl_ctrl,
833 .ctrlbit = (1 << 3),
834 }, {
758 .name = SYSMMU_CLOCK_NAME, 835 .name = SYSMMU_CLOCK_NAME,
759 .devname = SYSMMU_CLOCK_DEVNAME(mfc_l, 0), 836 .devname = SYSMMU_CLOCK_DEVNAME(mfc_l, 0),
760 .enable = &exynos5_clk_ip_mfc_ctrl, 837 .enable = &exynos5_clk_ip_mfc_ctrl,
@@ -882,6 +959,13 @@ static struct clk exynos5_clk_mdma1 = {
882 .ctrlbit = (1 << 4), 959 .ctrlbit = (1 << 4),
883}; 960};
884 961
962static struct clk exynos5_clk_fimd1 = {
963 .name = "fimd",
964 .devname = "exynos5-fb.1",
965 .enable = exynos5_clk_ip_disp1_ctrl,
966 .ctrlbit = (1 << 0),
967};
968
885struct clk *exynos5_clkset_group_list[] = { 969struct clk *exynos5_clkset_group_list[] = {
886 [0] = &clk_ext_xtal_mux, 970 [0] = &clk_ext_xtal_mux,
887 [1] = NULL, 971 [1] = NULL,
@@ -1006,8 +1090,8 @@ static struct clksrc_clk exynos5_clk_sclk_uart3 = {
1006 1090
1007static struct clksrc_clk exynos5_clk_sclk_mmc0 = { 1091static struct clksrc_clk exynos5_clk_sclk_mmc0 = {
1008 .clk = { 1092 .clk = {
1009 .name = "sclk_mmc", 1093 .name = "ciu", /* card interface unit clock */
1010 .devname = "exynos4-sdhci.0", 1094 .devname = "dw_mmc.0",
1011 .parent = &exynos5_clk_dout_mmc0.clk, 1095 .parent = &exynos5_clk_dout_mmc0.clk,
1012 .enable = exynos5_clksrc_mask_fsys_ctrl, 1096 .enable = exynos5_clksrc_mask_fsys_ctrl,
1013 .ctrlbit = (1 << 0), 1097 .ctrlbit = (1 << 0),
@@ -1017,8 +1101,8 @@ static struct clksrc_clk exynos5_clk_sclk_mmc0 = {
1017 1101
1018static struct clksrc_clk exynos5_clk_sclk_mmc1 = { 1102static struct clksrc_clk exynos5_clk_sclk_mmc1 = {
1019 .clk = { 1103 .clk = {
1020 .name = "sclk_mmc", 1104 .name = "ciu",
1021 .devname = "exynos4-sdhci.1", 1105 .devname = "dw_mmc.1",
1022 .parent = &exynos5_clk_dout_mmc1.clk, 1106 .parent = &exynos5_clk_dout_mmc1.clk,
1023 .enable = exynos5_clksrc_mask_fsys_ctrl, 1107 .enable = exynos5_clksrc_mask_fsys_ctrl,
1024 .ctrlbit = (1 << 4), 1108 .ctrlbit = (1 << 4),
@@ -1028,8 +1112,8 @@ static struct clksrc_clk exynos5_clk_sclk_mmc1 = {
1028 1112
1029static struct clksrc_clk exynos5_clk_sclk_mmc2 = { 1113static struct clksrc_clk exynos5_clk_sclk_mmc2 = {
1030 .clk = { 1114 .clk = {
1031 .name = "sclk_mmc", 1115 .name = "ciu",
1032 .devname = "exynos4-sdhci.2", 1116 .devname = "dw_mmc.2",
1033 .parent = &exynos5_clk_dout_mmc2.clk, 1117 .parent = &exynos5_clk_dout_mmc2.clk,
1034 .enable = exynos5_clksrc_mask_fsys_ctrl, 1118 .enable = exynos5_clksrc_mask_fsys_ctrl,
1035 .ctrlbit = (1 << 8), 1119 .ctrlbit = (1 << 8),
@@ -1039,8 +1123,8 @@ static struct clksrc_clk exynos5_clk_sclk_mmc2 = {
1039 1123
1040static struct clksrc_clk exynos5_clk_sclk_mmc3 = { 1124static struct clksrc_clk exynos5_clk_sclk_mmc3 = {
1041 .clk = { 1125 .clk = {
1042 .name = "sclk_mmc", 1126 .name = "ciu",
1043 .devname = "exynos4-sdhci.3", 1127 .devname = "dw_mmc.3",
1044 .parent = &exynos5_clk_dout_mmc3.clk, 1128 .parent = &exynos5_clk_dout_mmc3.clk,
1045 .enable = exynos5_clksrc_mask_fsys_ctrl, 1129 .enable = exynos5_clksrc_mask_fsys_ctrl,
1046 .ctrlbit = (1 << 12), 1130 .ctrlbit = (1 << 12),
@@ -1111,27 +1195,21 @@ static struct clksrc_clk exynos5_clk_sclk_spi2 = {
1111 .reg_div = { .reg = EXYNOS5_CLKDIV_PERIC2, .shift = 8, .size = 8 }, 1195 .reg_div = { .reg = EXYNOS5_CLKDIV_PERIC2, .shift = 8, .size = 8 },
1112}; 1196};
1113 1197
1198struct clksrc_clk exynos5_clk_sclk_fimd1 = {
1199 .clk = {
1200 .name = "sclk_fimd",
1201 .devname = "exynos5-fb.1",
1202 .enable = exynos5_clksrc_mask_disp1_0_ctrl,
1203 .ctrlbit = (1 << 0),
1204 },
1205 .sources = &exynos5_clkset_group,
1206 .reg_src = { .reg = EXYNOS5_CLKSRC_DISP1_0, .shift = 0, .size = 4 },
1207 .reg_div = { .reg = EXYNOS5_CLKDIV_DISP1_0, .shift = 0, .size = 4 },
1208};
1209
1114static struct clksrc_clk exynos5_clksrcs[] = { 1210static struct clksrc_clk exynos5_clksrcs[] = {
1115 { 1211 {
1116 .clk = { 1212 .clk = {
1117 .name = "sclk_dwmci",
1118 .parent = &exynos5_clk_dout_mmc4.clk,
1119 .enable = exynos5_clksrc_mask_fsys_ctrl,
1120 .ctrlbit = (1 << 16),
1121 },
1122 .reg_div = { .reg = EXYNOS5_CLKDIV_FSYS3, .shift = 8, .size = 8 },
1123 }, {
1124 .clk = {
1125 .name = "sclk_fimd",
1126 .devname = "s3cfb.1",
1127 .enable = exynos5_clksrc_mask_disp1_0_ctrl,
1128 .ctrlbit = (1 << 0),
1129 },
1130 .sources = &exynos5_clkset_group,
1131 .reg_src = { .reg = EXYNOS5_CLKSRC_DISP1_0, .shift = 0, .size = 4 },
1132 .reg_div = { .reg = EXYNOS5_CLKDIV_DISP1_0, .shift = 0, .size = 4 },
1133 }, {
1134 .clk = {
1135 .name = "aclk_266_gscl", 1213 .name = "aclk_266_gscl",
1136 }, 1214 },
1137 .sources = &clk_src_gscl_266, 1215 .sources = &clk_src_gscl_266,
@@ -1216,6 +1294,10 @@ static struct clksrc_clk *exynos5_sysclks[] = {
1216 &exynos5_clk_aclk_266, 1294 &exynos5_clk_aclk_266,
1217 &exynos5_clk_aclk_200, 1295 &exynos5_clk_aclk_200,
1218 &exynos5_clk_aclk_166, 1296 &exynos5_clk_aclk_166,
1297 &exynos5_clk_aclk_300_gscl,
1298 &exynos5_clk_mout_aclk_300_gscl,
1299 &exynos5_clk_mout_aclk_300_gscl_mid,
1300 &exynos5_clk_mout_aclk_300_gscl_mid1,
1219 &exynos5_clk_aclk_66_pre, 1301 &exynos5_clk_aclk_66_pre,
1220 &exynos5_clk_aclk_66, 1302 &exynos5_clk_aclk_66,
1221 &exynos5_clk_dout_mmc0, 1303 &exynos5_clk_dout_mmc0,
@@ -1231,12 +1313,14 @@ static struct clksrc_clk *exynos5_sysclks[] = {
1231 &exynos5_clk_mdout_spi0, 1313 &exynos5_clk_mdout_spi0,
1232 &exynos5_clk_mdout_spi1, 1314 &exynos5_clk_mdout_spi1,
1233 &exynos5_clk_mdout_spi2, 1315 &exynos5_clk_mdout_spi2,
1316 &exynos5_clk_sclk_fimd1,
1234}; 1317};
1235 1318
1236static struct clk *exynos5_clk_cdev[] = { 1319static struct clk *exynos5_clk_cdev[] = {
1237 &exynos5_clk_pdma0, 1320 &exynos5_clk_pdma0,
1238 &exynos5_clk_pdma1, 1321 &exynos5_clk_pdma1,
1239 &exynos5_clk_mdma1, 1322 &exynos5_clk_mdma1,
1323 &exynos5_clk_fimd1,
1240}; 1324};
1241 1325
1242static struct clksrc_clk *exynos5_clksrc_cdev[] = { 1326static struct clksrc_clk *exynos5_clksrc_cdev[] = {
@@ -1265,6 +1349,7 @@ static struct clk_lookup exynos5_clk_lookup[] = {
1265 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos5_clk_pdma0), 1349 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos5_clk_pdma0),
1266 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos5_clk_pdma1), 1350 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos5_clk_pdma1),
1267 CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos5_clk_mdma1), 1351 CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos5_clk_mdma1),
1352 CLKDEV_INIT("exynos5-fb.1", "lcd", &exynos5_clk_fimd1),
1268}; 1353};
1269 1354
1270static unsigned long exynos5_epll_get_rate(struct clk *clk) 1355static unsigned long exynos5_epll_get_rate(struct clk *clk)