Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: samsung: exynos7: add clocks for RTC block

Add clock support for the RTC block in Exynos7.

Signed-off-by: Naveen Krishna Ch <naveenkrishna.ch@gmail.com>
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

authored by

Naveen Krishna Ch and committed by
Sylwester Nawrocki
f5e127cd 6d0c8c72

+65 -1
+5
Documentation/devicetree/bindings/clock/exynos7-clock.txt
··· 28 28 - "samsung,exynos7-clock-topc" 29 29 - "samsung,exynos7-clock-top0" 30 30 - "samsung,exynos7-clock-top1" 31 + - "samsung,exynos7-clock-ccore" 31 32 - "samsung,exynos7-clock-peric0" 32 33 - "samsung,exynos7-clock-peric1" 33 34 - "samsung,exynos7-clock-peris" ··· 60 59 - dout_sclk_bus1_pll 61 60 - dout_sclk_cc_pll 62 61 - dout_sclk_mfc_pll 62 + 63 + Input clocks for ccore clock controller: 64 + - fin_pll 65 + - dout_aclk_ccore_133 63 66 64 67 Input clocks for peric0 clock controller: 65 68 - fin_pll
+54
drivers/clk/samsung/clk-exynos7.c
··· 29 29 #define AUD_PLL_CON0 0x0140 30 30 #define MUX_SEL_TOPC0 0x0200 31 31 #define MUX_SEL_TOPC1 0x0204 32 + #define MUX_SEL_TOPC2 0x0208 32 33 #define MUX_SEL_TOPC3 0x020C 34 + #define DIV_TOPC0 0x0600 33 35 #define DIV_TOPC1 0x0604 34 36 #define DIV_TOPC3 0x060C 35 37 ··· 80 78 AUD_PLL_CON0, 81 79 MUX_SEL_TOPC0, 82 80 MUX_SEL_TOPC1, 81 + MUX_SEL_TOPC2, 83 82 MUX_SEL_TOPC3, 83 + DIV_TOPC0, 84 84 DIV_TOPC1, 85 85 DIV_TOPC3, 86 86 }; ··· 105 101 MUX(0, "mout_sclk_bus0_pll_out", mout_sclk_bus0_pll_out_p, 106 102 MUX_SEL_TOPC1, 16, 1), 107 103 104 + MUX(0, "mout_aclk_ccore_133", mout_topc_group2, MUX_SEL_TOPC2, 4, 2), 105 + 108 106 MUX(0, "mout_aclk_peris_66", mout_topc_group2, MUX_SEL_TOPC3, 24, 2), 109 107 }; 110 108 111 109 static struct samsung_div_clock topc_div_clks[] __initdata = { 110 + DIV(DOUT_ACLK_CCORE_133, "dout_aclk_ccore_133", "mout_aclk_ccore_133", 111 + DIV_TOPC0, 4, 4), 112 + 112 113 DIV(DOUT_ACLK_PERIS, "dout_aclk_peris_66", "mout_aclk_peris_66", 113 114 DIV_TOPC1, 24, 4), 114 115 ··· 401 392 402 393 CLK_OF_DECLARE(exynos7_clk_top1, "samsung,exynos7-clock-top1", 403 394 exynos7_clk_top1_init); 395 + 396 + /* Register Offset definitions for CMU_CCORE (0x105B0000) */ 397 + #define MUX_SEL_CCORE 0x0200 398 + #define DIV_CCORE 0x0600 399 + #define ENABLE_ACLK_CCORE0 0x0800 400 + #define ENABLE_ACLK_CCORE1 0x0804 401 + #define ENABLE_PCLK_CCORE 0x0900 402 + 403 + /* 404 + * List of parent clocks for Muxes in CMU_CCORE 405 + */ 406 + PNAME(mout_aclk_ccore_133_p) = { "fin_pll", "dout_aclk_ccore_133" }; 407 + 408 + static unsigned long ccore_clk_regs[] __initdata = { 409 + MUX_SEL_CCORE, 410 + ENABLE_PCLK_CCORE, 411 + }; 412 + 413 + static struct samsung_mux_clock ccore_mux_clks[] __initdata = { 414 + MUX(0, "mout_aclk_ccore_133_user", mout_aclk_ccore_133_p, 415 + MUX_SEL_CCORE, 1, 1), 416 + }; 417 + 418 + static struct samsung_gate_clock ccore_gate_clks[] __initdata = { 419 + GATE(PCLK_RTC, "pclk_rtc", "mout_aclk_ccore_133_user", 420 + ENABLE_PCLK_CCORE, 8, 0, 0), 421 + }; 422 + 423 + static struct samsung_cmu_info ccore_cmu_info __initdata = { 424 + .mux_clks = ccore_mux_clks, 425 + .nr_mux_clks = ARRAY_SIZE(ccore_mux_clks), 426 + .gate_clks = ccore_gate_clks, 427 + .nr_gate_clks = ARRAY_SIZE(ccore_gate_clks), 428 + .nr_clk_ids = CCORE_NR_CLK, 429 + .clk_regs = ccore_clk_regs, 430 + .nr_clk_regs = ARRAY_SIZE(ccore_clk_regs), 431 + }; 432 + 433 + static void __init exynos7_clk_ccore_init(struct device_node *np) 434 + { 435 + samsung_cmu_register_one(np, &ccore_cmu_info); 436 + } 437 + 438 + CLK_OF_DECLARE(exynos7_clk_ccore, "samsung,exynos7-clock-ccore", 439 + exynos7_clk_ccore_init); 404 440 405 441 /* Register Offset definitions for CMU_PERIC0 (0x13610000) */ 406 442 #define MUX_SEL_PERIC0 0x0200
+6 -1
include/dt-bindings/clock/exynos7-clk.h
··· 16 16 #define DOUT_SCLK_BUS1_PLL 3 17 17 #define DOUT_SCLK_CC_PLL 4 18 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 22 /* TOP0 */ 22 23 #define DOUT_ACLK_PERIC1 1 ··· 38 37 #define CLK_SCLK_MMC1 7 39 38 #define CLK_SCLK_MMC0 8 40 39 #define TOP1_NR_CLK 9 40 + 41 + /* CCORE */ 42 + #define PCLK_RTC 1 43 + #define CCORE_NR_CLK 2 41 44 42 45 /* PERIC0 */ 43 46 #define PCLK_UART0 1