aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2015-02-02 09:24:04 -0500
committerSylwester Nawrocki <s.nawrocki@samsung.com>2015-02-04 12:58:13 -0500
commit5785d6e61f27f7af4d239c1647d5a22e0dbff19b (patch)
treeda9553916b683c6972978d809b100d5866562349
parent2e997c035945784fb8c564305c0f0ddacc374fe4 (diff)
clk: samsung: exynos5433: Add clocks for CMU_BUS{0|1|2} domains
This patch adds the mux/divider/gate clocks for CMU_BUS{0|1|2} domains which contain global data buses clocked at up the 400MHz. These blocks transfer data between DRAM and various sub-blocks. These clock domains also contain global peripheral buses clocked at 67/111/200/222/266/333/400 MHz and used for register accesses. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
-rw-r--r--drivers/clk/samsung/clk-exynos5433.c187
-rw-r--r--include/dt-bindings/clock/exynos5433.h27
2 files changed, 213 insertions, 1 deletions
diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c
index ad0105aa0de6..7c4e91a440e5 100644
--- a/drivers/clk/samsung/clk-exynos5433.c
+++ b/drivers/clk/samsung/clk-exynos5433.c
@@ -438,6 +438,14 @@ static struct samsung_div_clock top_div_clks[] __initdata = {
438 DIV(CLK_DIV_ACLK_PERIS_66_A, "div_aclk_peris_66_a", 438 DIV(CLK_DIV_ACLK_PERIS_66_A, "div_aclk_peris_66_a",
439 "mout_bus_pll_user", DIV_TOP3, 0, 3), 439 "mout_bus_pll_user", DIV_TOP3, 0, 3),
440 440
441 /* DIV_TOP4 */
442 DIV(CLK_DIV_ACLK_G3D_400, "div_aclk_g3d_400", "mout_bus_pll_user",
443 DIV_TOP4, 8, 3),
444 DIV(CLK_DIV_ACLK_BUS0_400, "div_aclk_bus0_400", "mout_aclk_bus0_400",
445 DIV_TOP4, 4, 3),
446 DIV(CLK_DIV_ACLK_BUS1_400, "div_aclk_bus1_400", "mout_bus_pll_user",
447 DIV_TOP4, 0, 3),
448
441 /* DIV_TOP_FSYS0 */ 449 /* DIV_TOP_FSYS0 */
442 DIV(CLK_DIV_SCLK_MMC1_B, "div_sclk_mmc1_b", "div_sclk_mmc1_a", 450 DIV(CLK_DIV_SCLK_MMC1_B, "div_sclk_mmc1_b", "div_sclk_mmc1_a",
443 DIV_TOP_FSYS0, 16, 8), 451 DIV_TOP_FSYS0, 16, 8),
@@ -501,6 +509,23 @@ static struct samsung_div_clock top_div_clks[] __initdata = {
501 509
502static struct samsung_gate_clock top_gate_clks[] __initdata = { 510static struct samsung_gate_clock top_gate_clks[] __initdata = {
503 /* ENABLE_ACLK_TOP */ 511 /* ENABLE_ACLK_TOP */
512 GATE(CLK_ACLK_G3D_400, "aclk_g3d_400", "div_aclk_g3d_400",
513 ENABLE_ACLK_TOP, 30, 0, 0),
514 GATE(CLK_ACLK_IMEM_SSX_266, "aclk_imem_ssx_266",
515 "div_aclk_imem_sssx_266", ENABLE_ACLK_TOP,
516 29, CLK_IGNORE_UNUSED, 0),
517 GATE(CLK_ACLK_BUS0_400, "aclk_bus0_400", "div_aclk_bus0_400",
518 ENABLE_ACLK_TOP, 26,
519 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
520 GATE(CLK_ACLK_BUS1_400, "aclk_bus1_400", "div_aclk_bus1_400",
521 ENABLE_ACLK_TOP, 25,
522 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
523 GATE(CLK_ACLK_IMEM_200, "aclk_imem_200", "div_aclk_imem_266",
524 ENABLE_ACLK_TOP, 24,
525 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
526 GATE(CLK_ACLK_IMEM_266, "aclk_imem_266", "div_aclk_imem_200",
527 ENABLE_ACLK_TOP, 23,
528 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
504 GATE(CLK_ACLK_PERIC_66, "aclk_peric_66", "div_aclk_peric_66_b", 529 GATE(CLK_ACLK_PERIC_66, "aclk_peric_66", "div_aclk_peric_66_b",
505 ENABLE_ACLK_TOP, 22, 530 ENABLE_ACLK_TOP, 22,
506 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0), 531 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
@@ -2631,3 +2656,165 @@ static void __init exynos5433_cmu_aud_init(struct device_node *np)
2631} 2656}
2632CLK_OF_DECLARE(exynos5433_cmu_aud, "samsung,exynos5433-cmu-aud", 2657CLK_OF_DECLARE(exynos5433_cmu_aud, "samsung,exynos5433-cmu-aud",
2633 exynos5433_cmu_aud_init); 2658 exynos5433_cmu_aud_init);
2659
2660
2661/*
2662 * Register offset definitions for CMU_BUS{0|1|2}
2663 */
2664#define DIV_BUS 0x0600
2665#define DIV_STAT_BUS 0x0700
2666#define ENABLE_ACLK_BUS 0x0800
2667#define ENABLE_PCLK_BUS 0x0900
2668#define ENABLE_IP_BUS0 0x0b00
2669#define ENABLE_IP_BUS1 0x0b04
2670
2671#define MUX_SEL_BUS2 0x0200 /* Only for CMU_BUS2 */
2672#define MUX_ENABLE_BUS2 0x0300 /* Only for CMU_BUS2 */
2673#define MUX_STAT_BUS2 0x0400 /* Only for CMU_BUS2 */
2674
2675/* list of all parent clock list */
2676PNAME(mout_aclk_bus2_400_p) = { "oscclk", "aclk_bus2_400", };
2677
2678#define CMU_BUS_COMMON_CLK_REGS \
2679 DIV_BUS, \
2680 DIV_STAT_BUS, \
2681 ENABLE_ACLK_BUS, \
2682 ENABLE_PCLK_BUS, \
2683 ENABLE_IP_BUS0, \
2684 ENABLE_IP_BUS1
2685
2686static unsigned long bus01_clk_regs[] __initdata = {
2687 CMU_BUS_COMMON_CLK_REGS,
2688};
2689
2690static unsigned long bus2_clk_regs[] __initdata = {
2691 MUX_SEL_BUS2,
2692 MUX_ENABLE_BUS2,
2693 MUX_STAT_BUS2,
2694 CMU_BUS_COMMON_CLK_REGS,
2695};
2696
2697static struct samsung_div_clock bus0_div_clks[] __initdata = {
2698 /* DIV_BUS0 */
2699 DIV(CLK_DIV_PCLK_BUS_133, "div_pclk_bus0_133", "aclk_bus0_400",
2700 DIV_BUS, 0, 3),
2701};
2702
2703/* CMU_BUS0 clocks */
2704static struct samsung_gate_clock bus0_gate_clks[] __initdata = {
2705 /* ENABLE_ACLK_BUS0 */
2706 GATE(CLK_ACLK_AHB2APB_BUSP, "aclk_ahb2apb_bus0p", "div_pclk_bus0_133",
2707 ENABLE_ACLK_BUS, 4, CLK_IGNORE_UNUSED, 0),
2708 GATE(CLK_ACLK_BUSNP_133, "aclk_bus0np_133", "div_pclk_bus0_133",
2709 ENABLE_ACLK_BUS, 2, CLK_IGNORE_UNUSED, 0),
2710 GATE(CLK_ACLK_BUSND_400, "aclk_bus0nd_400", "aclk_bus0_400",
2711 ENABLE_ACLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
2712
2713 /* ENABLE_PCLK_BUS0 */
2714 GATE(CLK_PCLK_BUSSRVND_133, "pclk_bus0srvnd_133", "div_pclk_bus0_133",
2715 ENABLE_PCLK_BUS, 2, 0, 0),
2716 GATE(CLK_PCLK_PMU_BUS, "pclk_pmu_bus0", "div_pclk_bus0_133",
2717 ENABLE_PCLK_BUS, 1, CLK_IGNORE_UNUSED, 0),
2718 GATE(CLK_PCLK_SYSREG_BUS, "pclk_sysreg_bus0", "div_pclk_bus0_133",
2719 ENABLE_PCLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
2720};
2721
2722/* CMU_BUS1 clocks */
2723static struct samsung_div_clock bus1_div_clks[] __initdata = {
2724 /* DIV_BUS1 */
2725 DIV(CLK_DIV_PCLK_BUS_133, "div_pclk_bus1_133", "aclk_bus1_400",
2726 DIV_BUS, 0, 3),
2727};
2728
2729static struct samsung_gate_clock bus1_gate_clks[] __initdata = {
2730 /* ENABLE_ACLK_BUS1 */
2731 GATE(CLK_ACLK_AHB2APB_BUSP, "aclk_ahb2apb_bus1p", "div_pclk_bus1_133",
2732 ENABLE_ACLK_BUS, 4, CLK_IGNORE_UNUSED, 0),
2733 GATE(CLK_ACLK_BUSNP_133, "aclk_bus1np_133", "div_pclk_bus1_133",
2734 ENABLE_ACLK_BUS, 2, CLK_IGNORE_UNUSED, 0),
2735 GATE(CLK_ACLK_BUSND_400, "aclk_bus1nd_400", "aclk_bus1_400",
2736 ENABLE_ACLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
2737
2738 /* ENABLE_PCLK_BUS1 */
2739 GATE(CLK_PCLK_BUSSRVND_133, "pclk_bus1srvnd_133", "div_pclk_bus1_133",
2740 ENABLE_PCLK_BUS, 2, 0, 0),
2741 GATE(CLK_PCLK_PMU_BUS, "pclk_pmu_bus1", "div_pclk_bus1_133",
2742 ENABLE_PCLK_BUS, 1, CLK_IGNORE_UNUSED, 0),
2743 GATE(CLK_PCLK_SYSREG_BUS, "pclk_sysreg_bus1", "div_pclk_bus1_133",
2744 ENABLE_PCLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
2745};
2746
2747/* CMU_BUS2 clocks */
2748static struct samsung_mux_clock bus2_mux_clks[] __initdata = {
2749 /* MUX_SEL_BUS2 */
2750 MUX(CLK_MOUT_ACLK_BUS2_400_USER, "mout_aclk_bus2_400_user",
2751 mout_aclk_bus2_400_p, MUX_SEL_BUS2, 0, 1),
2752};
2753
2754static struct samsung_div_clock bus2_div_clks[] __initdata = {
2755 /* DIV_BUS2 */
2756 DIV(CLK_DIV_PCLK_BUS_133, "div_pclk_bus2_133",
2757 "mout_aclk_bus2_400_user", DIV_BUS, 0, 3),
2758};
2759
2760static struct samsung_gate_clock bus2_gate_clks[] __initdata = {
2761 /* ENABLE_ACLK_BUS2 */
2762 GATE(CLK_ACLK_AHB2APB_BUSP, "aclk_ahb2apb_bus2p", "div_pclk_bus2_133",
2763 ENABLE_ACLK_BUS, 3, CLK_IGNORE_UNUSED, 0),
2764 GATE(CLK_ACLK_BUSNP_133, "aclk_bus2np_133", "div_pclk_bus2_133",
2765 ENABLE_ACLK_BUS, 2, CLK_IGNORE_UNUSED, 0),
2766 GATE(CLK_ACLK_BUS2BEND_400, "aclk_bus2bend_400",
2767 "mout_aclk_bus2_400_user", ENABLE_ACLK_BUS,
2768 1, CLK_IGNORE_UNUSED, 0),
2769 GATE(CLK_ACLK_BUS2RTND_400, "aclk_bus2rtnd_400",
2770 "mout_aclk_bus2_400_user", ENABLE_ACLK_BUS,
2771 0, CLK_IGNORE_UNUSED, 0),
2772
2773 /* ENABLE_PCLK_BUS2 */
2774 GATE(CLK_PCLK_BUSSRVND_133, "pclk_bus2srvnd_133", "div_pclk_bus2_133",
2775 ENABLE_PCLK_BUS, 2, 0, 0),
2776 GATE(CLK_PCLK_PMU_BUS, "pclk_pmu_bus2", "div_pclk_bus2_133",
2777 ENABLE_PCLK_BUS, 1, CLK_IGNORE_UNUSED, 0),
2778 GATE(CLK_PCLK_SYSREG_BUS, "pclk_sysreg_bus2", "div_pclk_bus2_133",
2779 ENABLE_PCLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
2780};
2781
2782#define CMU_BUS_INFO_CLKS(id) \
2783 .div_clks = bus##id##_div_clks, \
2784 .nr_div_clks = ARRAY_SIZE(bus##id##_div_clks), \
2785 .gate_clks = bus##id##_gate_clks, \
2786 .nr_gate_clks = ARRAY_SIZE(bus##id##_gate_clks), \
2787 .nr_clk_ids = BUSx_NR_CLK
2788
2789static struct samsung_cmu_info bus0_cmu_info __initdata = {
2790 CMU_BUS_INFO_CLKS(0),
2791 .clk_regs = bus01_clk_regs,
2792 .nr_clk_regs = ARRAY_SIZE(bus01_clk_regs),
2793};
2794
2795static struct samsung_cmu_info bus1_cmu_info __initdata = {
2796 CMU_BUS_INFO_CLKS(1),
2797 .clk_regs = bus01_clk_regs,
2798 .nr_clk_regs = ARRAY_SIZE(bus01_clk_regs),
2799};
2800
2801static struct samsung_cmu_info bus2_cmu_info __initdata = {
2802 CMU_BUS_INFO_CLKS(2),
2803 .mux_clks = bus2_mux_clks,
2804 .nr_mux_clks = ARRAY_SIZE(bus2_mux_clks),
2805 .clk_regs = bus2_clk_regs,
2806 .nr_clk_regs = ARRAY_SIZE(bus2_clk_regs),
2807};
2808
2809#define exynos5433_cmu_bus_init(id) \
2810static void __init exynos5433_cmu_bus##id##_init(struct device_node *np)\
2811{ \
2812 samsung_cmu_register_one(np, &bus##id##_cmu_info); \
2813} \
2814CLK_OF_DECLARE(exynos5433_cmu_bus##id, \
2815 "samsung,exynos5433-cmu-bus"#id, \
2816 exynos5433_cmu_bus##id##_init)
2817
2818exynos5433_cmu_bus_init(0);
2819exynos5433_cmu_bus_init(1);
2820exynos5433_cmu_bus_init(2);
diff --git a/include/dt-bindings/clock/exynos5433.h b/include/dt-bindings/clock/exynos5433.h
index 4d150e244057..8d388e700a80 100644
--- a/include/dt-bindings/clock/exynos5433.h
+++ b/include/dt-bindings/clock/exynos5433.h
@@ -107,6 +107,9 @@
107#define CLK_DIV_ACLK_MFC_400 134 107#define CLK_DIV_ACLK_MFC_400 134
108#define CLK_DIV_ACLK_G2D_266 135 108#define CLK_DIV_ACLK_G2D_266 135
109#define CLK_DIV_ACLK_G2D_400 136 109#define CLK_DIV_ACLK_G2D_400 136
110#define CLK_DIV_ACLK_G3D_400 137
111#define CLK_DIV_ACLK_BUS0_400 138
112#define CLK_DIV_ACLK_BUS1_400 139
110 113
111#define CLK_ACLK_PERIC_66 200 114#define CLK_ACLK_PERIC_66 200
112#define CLK_ACLK_PERIS_66 201 115#define CLK_ACLK_PERIS_66 201
@@ -130,8 +133,14 @@
130#define CLK_SCLK_AUDIO0 219 133#define CLK_SCLK_AUDIO0 219
131#define CLK_ACLK_G2D_266 220 134#define CLK_ACLK_G2D_266 220
132#define CLK_ACLK_G2D_400 221 135#define CLK_ACLK_G2D_400 221
136#define CLK_ACLK_G3D_400 222
137#define CLK_ACLK_IMEM_SSX_266 223
138#define CLK_ACLK_BUS0_400 224
139#define CLK_ACLK_BUS1_400 225
140#define CLK_ACLK_IMEM_200 226
141#define CLK_ACLK_IMEM_266 227
133 142
134#define TOP_NR_CLK 222 143#define TOP_NR_CLK 228
135 144
136/* CMU_CPIF */ 145/* CMU_CPIF */
137#define CLK_FOUT_MPHY_PLL 1 146#define CLK_FOUT_MPHY_PLL 1
@@ -679,4 +688,20 @@
679 688
680#define AUD_NR_CLK 48 689#define AUD_NR_CLK 48
681 690
691/* CMU_BUS{0|1|2} */
692#define CLK_DIV_PCLK_BUS_133 1
693
694#define CLK_ACLK_AHB2APB_BUSP 2
695#define CLK_ACLK_BUSNP_133 3
696#define CLK_ACLK_BUSND_400 4
697#define CLK_PCLK_BUSSRVND_133 5
698#define CLK_PCLK_PMU_BUS 6
699#define CLK_PCLK_SYSREG_BUS 7
700
701#define CLK_MOUT_ACLK_BUS2_400_USER 8 /* Only CMU_BUS2 */
702#define CLK_ACLK_BUS2BEND_400 9 /* Only CMU_BUS2 */
703#define CLK_ACLK_BUS2RTND_400 10 /* Only CMU_BUS2 */
704
705#define BUSx_NR_CLK 11
706
682#endif /* _DT_BINDINGS_CLOCK_EXYNOS5433_H */ 707#endif /* _DT_BINDINGS_CLOCK_EXYNOS5433_H */