diff options
-rw-r--r-- | Documentation/devicetree/bindings/clock/exynos7-clock.txt | 5 | ||||
-rw-r--r-- | drivers/clk/samsung/clk-exynos7.c | 54 | ||||
-rw-r--r-- | include/dt-bindings/clock/exynos7-clk.h | 7 |
3 files changed, 65 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/clock/exynos7-clock.txt b/Documentation/devicetree/bindings/clock/exynos7-clock.txt index b29cb50048c6..6d3d5f80c1c3 100644 --- a/Documentation/devicetree/bindings/clock/exynos7-clock.txt +++ b/Documentation/devicetree/bindings/clock/exynos7-clock.txt | |||
@@ -28,6 +28,7 @@ Required Properties for Clock Controller: | |||
28 | - "samsung,exynos7-clock-topc" | 28 | - "samsung,exynos7-clock-topc" |
29 | - "samsung,exynos7-clock-top0" | 29 | - "samsung,exynos7-clock-top0" |
30 | - "samsung,exynos7-clock-top1" | 30 | - "samsung,exynos7-clock-top1" |
31 | - "samsung,exynos7-clock-ccore" | ||
31 | - "samsung,exynos7-clock-peric0" | 32 | - "samsung,exynos7-clock-peric0" |
32 | - "samsung,exynos7-clock-peric1" | 33 | - "samsung,exynos7-clock-peric1" |
33 | - "samsung,exynos7-clock-peris" | 34 | - "samsung,exynos7-clock-peris" |
@@ -60,6 +61,10 @@ Input clocks for top1 clock controller: | |||
60 | - dout_sclk_cc_pll | 61 | - dout_sclk_cc_pll |
61 | - dout_sclk_mfc_pll | 62 | - dout_sclk_mfc_pll |
62 | 63 | ||
64 | Input clocks for ccore clock controller: | ||
65 | - fin_pll | ||
66 | - dout_aclk_ccore_133 | ||
67 | |||
63 | Input clocks for peric0 clock controller: | 68 | Input clocks for peric0 clock controller: |
64 | - fin_pll | 69 | - fin_pll |
65 | - dout_aclk_peric0_66 | 70 | - dout_aclk_peric0_66 |
diff --git a/drivers/clk/samsung/clk-exynos7.c b/drivers/clk/samsung/clk-exynos7.c index f5e43fab1951..3a30f43fa925 100644 --- a/drivers/clk/samsung/clk-exynos7.c +++ b/drivers/clk/samsung/clk-exynos7.c | |||
@@ -29,7 +29,9 @@ | |||
29 | #define AUD_PLL_CON0 0x0140 | 29 | #define AUD_PLL_CON0 0x0140 |
30 | #define MUX_SEL_TOPC0 0x0200 | 30 | #define MUX_SEL_TOPC0 0x0200 |
31 | #define MUX_SEL_TOPC1 0x0204 | 31 | #define MUX_SEL_TOPC1 0x0204 |
32 | #define MUX_SEL_TOPC2 0x0208 | ||
32 | #define MUX_SEL_TOPC3 0x020C | 33 | #define MUX_SEL_TOPC3 0x020C |
34 | #define DIV_TOPC0 0x0600 | ||
33 | #define DIV_TOPC1 0x0604 | 35 | #define DIV_TOPC1 0x0604 |
34 | #define DIV_TOPC3 0x060C | 36 | #define DIV_TOPC3 0x060C |
35 | 37 | ||
@@ -78,7 +80,9 @@ static unsigned long topc_clk_regs[] __initdata = { | |||
78 | AUD_PLL_CON0, | 80 | AUD_PLL_CON0, |
79 | MUX_SEL_TOPC0, | 81 | MUX_SEL_TOPC0, |
80 | MUX_SEL_TOPC1, | 82 | MUX_SEL_TOPC1, |
83 | MUX_SEL_TOPC2, | ||
81 | MUX_SEL_TOPC3, | 84 | MUX_SEL_TOPC3, |
85 | DIV_TOPC0, | ||
82 | DIV_TOPC1, | 86 | DIV_TOPC1, |
83 | DIV_TOPC3, | 87 | DIV_TOPC3, |
84 | }; | 88 | }; |
@@ -101,10 +105,15 @@ static struct samsung_mux_clock topc_mux_clks[] __initdata = { | |||
101 | MUX(0, "mout_sclk_bus0_pll_out", mout_sclk_bus0_pll_out_p, | 105 | MUX(0, "mout_sclk_bus0_pll_out", mout_sclk_bus0_pll_out_p, |
102 | MUX_SEL_TOPC1, 16, 1), | 106 | MUX_SEL_TOPC1, 16, 1), |
103 | 107 | ||
108 | MUX(0, "mout_aclk_ccore_133", mout_topc_group2, MUX_SEL_TOPC2, 4, 2), | ||
109 | |||
104 | MUX(0, "mout_aclk_peris_66", mout_topc_group2, MUX_SEL_TOPC3, 24, 2), | 110 | MUX(0, "mout_aclk_peris_66", mout_topc_group2, MUX_SEL_TOPC3, 24, 2), |
105 | }; | 111 | }; |
106 | 112 | ||
107 | static struct samsung_div_clock topc_div_clks[] __initdata = { | 113 | static struct samsung_div_clock topc_div_clks[] __initdata = { |
114 | DIV(DOUT_ACLK_CCORE_133, "dout_aclk_ccore_133", "mout_aclk_ccore_133", | ||
115 | DIV_TOPC0, 4, 4), | ||
116 | |||
108 | DIV(DOUT_ACLK_PERIS, "dout_aclk_peris_66", "mout_aclk_peris_66", | 117 | DIV(DOUT_ACLK_PERIS, "dout_aclk_peris_66", "mout_aclk_peris_66", |
109 | DIV_TOPC1, 24, 4), | 118 | DIV_TOPC1, 24, 4), |
110 | 119 | ||
@@ -393,6 +402,51 @@ static void __init exynos7_clk_top1_init(struct device_node *np) | |||
393 | CLK_OF_DECLARE(exynos7_clk_top1, "samsung,exynos7-clock-top1", | 402 | CLK_OF_DECLARE(exynos7_clk_top1, "samsung,exynos7-clock-top1", |
394 | exynos7_clk_top1_init); | 403 | exynos7_clk_top1_init); |
395 | 404 | ||
405 | /* Register Offset definitions for CMU_CCORE (0x105B0000) */ | ||
406 | #define MUX_SEL_CCORE 0x0200 | ||
407 | #define DIV_CCORE 0x0600 | ||
408 | #define ENABLE_ACLK_CCORE0 0x0800 | ||
409 | #define ENABLE_ACLK_CCORE1 0x0804 | ||
410 | #define ENABLE_PCLK_CCORE 0x0900 | ||
411 | |||
412 | /* | ||
413 | * List of parent clocks for Muxes in CMU_CCORE | ||
414 | */ | ||
415 | PNAME(mout_aclk_ccore_133_p) = { "fin_pll", "dout_aclk_ccore_133" }; | ||
416 | |||
417 | static unsigned long ccore_clk_regs[] __initdata = { | ||
418 | MUX_SEL_CCORE, | ||
419 | ENABLE_PCLK_CCORE, | ||
420 | }; | ||
421 | |||
422 | static struct samsung_mux_clock ccore_mux_clks[] __initdata = { | ||
423 | MUX(0, "mout_aclk_ccore_133_user", mout_aclk_ccore_133_p, | ||
424 | MUX_SEL_CCORE, 1, 1), | ||
425 | }; | ||
426 | |||
427 | static struct samsung_gate_clock ccore_gate_clks[] __initdata = { | ||
428 | GATE(PCLK_RTC, "pclk_rtc", "mout_aclk_ccore_133_user", | ||
429 | ENABLE_PCLK_CCORE, 8, 0, 0), | ||
430 | }; | ||
431 | |||
432 | static struct samsung_cmu_info ccore_cmu_info __initdata = { | ||
433 | .mux_clks = ccore_mux_clks, | ||
434 | .nr_mux_clks = ARRAY_SIZE(ccore_mux_clks), | ||
435 | .gate_clks = ccore_gate_clks, | ||
436 | .nr_gate_clks = ARRAY_SIZE(ccore_gate_clks), | ||
437 | .nr_clk_ids = CCORE_NR_CLK, | ||
438 | .clk_regs = ccore_clk_regs, | ||
439 | .nr_clk_regs = ARRAY_SIZE(ccore_clk_regs), | ||
440 | }; | ||
441 | |||
442 | static void __init exynos7_clk_ccore_init(struct device_node *np) | ||
443 | { | ||
444 | samsung_cmu_register_one(np, &ccore_cmu_info); | ||
445 | } | ||
446 | |||
447 | CLK_OF_DECLARE(exynos7_clk_ccore, "samsung,exynos7-clock-ccore", | ||
448 | exynos7_clk_ccore_init); | ||
449 | |||
396 | /* Register Offset definitions for CMU_PERIC0 (0x13610000) */ | 450 | /* Register Offset definitions for CMU_PERIC0 (0x13610000) */ |
397 | #define MUX_SEL_PERIC0 0x0200 | 451 | #define MUX_SEL_PERIC0 0x0200 |
398 | #define ENABLE_PCLK_PERIC0 0x0900 | 452 | #define ENABLE_PCLK_PERIC0 0x0900 |
diff --git a/include/dt-bindings/clock/exynos7-clk.h b/include/dt-bindings/clock/exynos7-clk.h index ff63c4e15cc5..dd89aa0f84e1 100644 --- a/include/dt-bindings/clock/exynos7-clk.h +++ b/include/dt-bindings/clock/exynos7-clk.h | |||
@@ -16,7 +16,8 @@ | |||
16 | #define DOUT_SCLK_BUS1_PLL 3 | 16 | #define DOUT_SCLK_BUS1_PLL 3 |
17 | #define DOUT_SCLK_CC_PLL 4 | 17 | #define DOUT_SCLK_CC_PLL 4 |
18 | #define DOUT_SCLK_MFC_PLL 5 | 18 | #define DOUT_SCLK_MFC_PLL 5 |
19 | #define TOPC_NR_CLK 6 | 19 | #define DOUT_ACLK_CCORE_133 6 |
20 | #define TOPC_NR_CLK 7 | ||
20 | 21 | ||
21 | /* TOP0 */ | 22 | /* TOP0 */ |
22 | #define DOUT_ACLK_PERIC1 1 | 23 | #define DOUT_ACLK_PERIC1 1 |
@@ -38,6 +39,10 @@ | |||
38 | #define CLK_SCLK_MMC0 8 | 39 | #define CLK_SCLK_MMC0 8 |
39 | #define TOP1_NR_CLK 9 | 40 | #define TOP1_NR_CLK 9 |
40 | 41 | ||
42 | /* CCORE */ | ||
43 | #define PCLK_RTC 1 | ||
44 | #define CCORE_NR_CLK 2 | ||
45 | |||
41 | /* PERIC0 */ | 46 | /* PERIC0 */ |
42 | #define PCLK_UART0 1 | 47 | #define PCLK_UART0 1 |
43 | #define SCLK_UART0 2 | 48 | #define SCLK_UART0 2 |