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

clk: exynos5250: add cpu clock configuration data and instantiate cpu clock

With the addition of the new Samsung specific cpu-clock type, the
arm clock can be represented as a cpu-clock type. Add the CPU clock
configuration data and instantiate the CPU clock type for Exynos5250.

Cc: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
[b.zolnierkie: split exynos5250 support from the original patch]
[b.zolnierkie: moved E5250_CPU_DIV[0,1] macros to clk-exynos5250.c]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org>
Tested-by: Javier Martinez Canillas <javier@dowhile0.org>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>

authored by

Thomas Abraham and committed by
Kukjin Kim
d7cc4c81 d770e558

+32
+31
drivers/clk/samsung/clk-exynos5250.c
··· 19 19 #include <linux/syscore_ops.h> 20 20 21 21 #include "clk.h" 22 + #include "clk-cpu.h" 22 23 23 24 #define APLL_LOCK 0x0 24 25 #define APLL_CON0 0x100 ··· 749 748 VPLL_LOCK, VPLL_CON0, NULL), 750 749 }; 751 750 751 + #define E5250_CPU_DIV0(apll, pclk_dbg, atb, periph, acp, cpud) \ 752 + ((((apll) << 24) | ((pclk_dbg) << 20) | ((atb) << 16) | \ 753 + ((periph) << 12) | ((acp) << 8) | ((cpud) << 4))) 754 + #define E5250_CPU_DIV1(hpm, copy) \ 755 + (((hpm) << 4) | (copy)) 756 + 757 + static const struct exynos_cpuclk_cfg_data exynos5250_armclk_d[] __initconst = { 758 + { 1700000, E5250_CPU_DIV0(5, 3, 7, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 759 + { 1600000, E5250_CPU_DIV0(4, 1, 7, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 760 + { 1500000, E5250_CPU_DIV0(4, 1, 7, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 761 + { 1400000, E5250_CPU_DIV0(4, 1, 6, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 762 + { 1300000, E5250_CPU_DIV0(3, 1, 6, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 763 + { 1200000, E5250_CPU_DIV0(3, 1, 5, 7, 7, 2), E5250_CPU_DIV1(2, 0), }, 764 + { 1100000, E5250_CPU_DIV0(3, 1, 5, 7, 7, 3), E5250_CPU_DIV1(2, 0), }, 765 + { 1000000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 766 + { 900000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 767 + { 800000, E5250_CPU_DIV0(2, 1, 4, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 768 + { 700000, E5250_CPU_DIV0(1, 1, 3, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 769 + { 600000, E5250_CPU_DIV0(1, 1, 3, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 770 + { 500000, E5250_CPU_DIV0(1, 1, 2, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 771 + { 400000, E5250_CPU_DIV0(1, 1, 2, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 772 + { 300000, E5250_CPU_DIV0(1, 1, 1, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 773 + { 200000, E5250_CPU_DIV0(1, 1, 1, 7, 7, 1), E5250_CPU_DIV1(2, 0), }, 774 + { 0 }, 775 + }; 776 + 752 777 static const struct of_device_id ext_clk_match[] __initconst = { 753 778 { .compatible = "samsung,clock-xxti", .data = (void *)0, }, 754 779 { }, ··· 824 797 ARRAY_SIZE(exynos5250_div_clks)); 825 798 samsung_clk_register_gate(ctx, exynos5250_gate_clks, 826 799 ARRAY_SIZE(exynos5250_gate_clks)); 800 + exynos_register_cpu_clock(ctx, CLK_ARM_CLK, "armclk", 801 + mout_cpu_p[0], mout_cpu_p[1], 0x200, 802 + exynos5250_armclk_d, ARRAY_SIZE(exynos5250_armclk_d), 803 + CLK_CPU_HAS_DIV1); 827 804 828 805 /* 829 806 * Enable arm clock down (in idle) and set arm divider
+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