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

Merge branch 'v4.3-topic/clk-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into clk-next

authored by

Michael Turquette and committed by
Stephen Boyd
1db92e54 afe76c8f

+63 -2
+30 -2
drivers/clk/samsung/clk-exynos3250.c
··· 17 17 #include <dt-bindings/clock/exynos3250.h> 18 18 19 19 #include "clk.h" 20 + #include "clk-cpu.h" 20 21 #include "clk-pll.h" 21 22 22 23 #define SRC_LEFTBUS 0x4200 ··· 318 317 MUX(CLK_MOUT_MPLL_USER_C, "mout_mpll_user_c", mout_mpll_user_p, 319 318 SRC_CPU, 24, 1), 320 319 MUX(CLK_MOUT_HPM, "mout_hpm", mout_hpm_p, SRC_CPU, 20, 1), 321 - MUX(CLK_MOUT_CORE, "mout_core", mout_core_p, SRC_CPU, 16, 1), 322 - MUX(CLK_MOUT_APLL, "mout_apll", mout_apll_p, SRC_CPU, 0, 1), 320 + MUX_F(CLK_MOUT_CORE, "mout_core", mout_core_p, SRC_CPU, 16, 1, 321 + CLK_SET_RATE_PARENT, 0), 322 + MUX_F(CLK_MOUT_APLL, "mout_apll", mout_apll_p, SRC_CPU, 0, 1, 323 + CLK_SET_RATE_PARENT, 0), 323 324 }; 324 325 325 326 static struct samsung_div_clock div_clks[] __initdata = { ··· 773 770 .nr_clk_regs = ARRAY_SIZE(exynos3250_cmu_clk_regs), 774 771 }; 775 772 773 + #define E3250_CPU_DIV0(apll, pclk_dbg, atb, corem) \ 774 + (((apll) << 24) | ((pclk_dbg) << 20) | ((atb) << 16) | \ 775 + ((corem) << 4)) 776 + #define E3250_CPU_DIV1(hpm, copy) \ 777 + (((hpm) << 4) | ((copy) << 0)) 778 + 779 + static const struct exynos_cpuclk_cfg_data e3250_armclk_d[] __initconst = { 780 + { 1000000, E3250_CPU_DIV0(1, 7, 4, 1), E3250_CPU_DIV1(7, 7), }, 781 + { 900000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), }, 782 + { 800000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), }, 783 + { 700000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), }, 784 + { 600000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), }, 785 + { 500000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), }, 786 + { 400000, E3250_CPU_DIV0(1, 7, 3, 1), E3250_CPU_DIV1(7, 7), }, 787 + { 300000, E3250_CPU_DIV0(1, 5, 3, 1), E3250_CPU_DIV1(7, 7), }, 788 + { 200000, E3250_CPU_DIV0(1, 3, 3, 1), E3250_CPU_DIV1(7, 7), }, 789 + { 100000, E3250_CPU_DIV0(1, 1, 1, 1), E3250_CPU_DIV1(7, 7), }, 790 + { 0 }, 791 + }; 792 + 776 793 static void __init exynos3250_cmu_init(struct device_node *np) 777 794 { 778 795 struct samsung_clk_provider *ctx; ··· 800 777 ctx = samsung_cmu_register_one(np, &cmu_info); 801 778 if (!ctx) 802 779 return; 780 + 781 + exynos_register_cpu_clock(ctx, CLK_ARM_CLK, "armclk", 782 + mout_core_p[0], mout_core_p[1], 0x14200, 783 + e3250_armclk_d, ARRAY_SIZE(e3250_armclk_d), 784 + CLK_CPU_HAS_DIV1); 803 785 804 786 exynos3_core_down_clock(ctx->reg_base); 805 787 }
+31
drivers/clk/samsung/clk-exynos5250.c
··· 17 17 #include <linux/syscore_ops.h> 18 18 19 19 #include "clk.h" 20 + #include "clk-cpu.h" 20 21 21 22 #define APLL_LOCK 0x0 22 23 #define APLL_CON0 0x100 ··· 747 746 VPLL_LOCK, VPLL_CON0, NULL), 748 747 }; 749 748 749 + #define E5250_CPU_DIV0(apll, pclk_dbg, atb, periph, acp, cpud) \ 750 + ((((apll) << 24) | ((pclk_dbg) << 20) | ((atb) << 16) | \ 751 + ((periph) << 12) | ((acp) << 8) | ((cpud) << 4))) 752 + #define E5250_CPU_DIV1(hpm, copy) \ 753 + (((hpm) << 4) | (copy)) 754 + 755 + static const struct exynos_cpuclk_cfg_data exynos5250_armclk_d[] __initconst = { 756 + { 1700000, E5250_CPU_DIV0(5, 3, 7, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 757 + { 1600000, E5250_CPU_DIV0(4, 1, 7, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 758 + { 1500000, E5250_CPU_DIV0(4, 1, 7, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 759 + { 1400000, E5250_CPU_DIV0(4, 1, 6, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 760 + { 1300000, E5250_CPU_DIV0(3, 1, 6, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 761 + { 1200000, E5250_CPU_DIV0(3, 1, 5, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 762 + { 1100000, E5250_CPU_DIV0(3, 1, 5, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 763 + { 1000000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 764 + { 900000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 765 + { 800000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 766 + { 700000, E5250_CPU_DIV0(1, 1, 3, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 767 + { 600000, E5250_CPU_DIV0(1, 1, 3, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 768 + { 500000, E5250_CPU_DIV0(1, 1, 2, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 769 + { 400000, E5250_CPU_DIV0(1, 1, 2, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 770 + { 300000, E5250_CPU_DIV0(1, 1, 1, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 771 + { 200000, E5250_CPU_DIV0(1, 1, 1, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 772 + { 0 }, 773 + }; 774 + 750 775 static const struct of_device_id ext_clk_match[] __initconst = { 751 776 { .compatible = "samsung,clock-xxti", .data = (void *)0, }, 752 777 { }, ··· 822 795 ARRAY_SIZE(exynos5250_div_clks)); 823 796 samsung_clk_register_gate(ctx, exynos5250_gate_clks, 824 797 ARRAY_SIZE(exynos5250_gate_clks)); 798 + exynos_register_cpu_clock(ctx, CLK_ARM_CLK, "armclk", 799 + mout_cpu_p[0], mout_cpu_p[1], 0x200, 800 + exynos5250_armclk_d, ARRAY_SIZE(exynos5250_armclk_d), 801 + CLK_CPU_HAS_DIV1); 825 802 826 803 /* 827 804 * Enable arm clock down (in idle) and set arm divider
+1
include/dt-bindings/clock/exynos3250.h
··· 31 31 #define CLK_FOUT_VPLL 4 32 32 #define CLK_FOUT_UPLL 5 33 33 #define CLK_FOUT_MPLL 6 34 + #define CLK_ARM_CLK 7 34 35 35 36 /* Muxes */ 36 37 #define CLK_MOUT_MPLL_USER_L 16
+1
include/dt-bindings/clock/exynos5250.h
··· 21 21 #define CLK_FOUT_CPLL 6 22 22 #define CLK_FOUT_EPLL 7 23 23 #define CLK_FOUT_VPLL 8 24 + #define CLK_ARM_CLK 9 24 25 25 26 /* gate for special clocks (sclk) */ 26 27 #define CLK_SCLK_CAM_BAYER 128