aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/clk/samsung/clk-exynos4.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c
index cee297daec4b..9de7a39b1adf 100644
--- a/drivers/clk/samsung/clk-exynos4.c
+++ b/drivers/clk/samsung/clk-exynos4.c
@@ -17,7 +17,6 @@
17#include <linux/of_address.h> 17#include <linux/of_address.h>
18 18
19#include "clk.h" 19#include "clk.h"
20#include "clk-pll.h"
21 20
22/* Exynos4 clock controller register offsets */ 21/* Exynos4 clock controller register offsets */
23#define SRC_LEFTBUS 0x4200 22#define SRC_LEFTBUS 0x4200
@@ -97,12 +96,14 @@
97#define GATE_IP_PERIL 0xc950 96#define GATE_IP_PERIL 0xc950
98#define E4210_GATE_IP_PERIR 0xc960 97#define E4210_GATE_IP_PERIR 0xc960
99#define GATE_BLOCK 0xc970 98#define GATE_BLOCK 0xc970
99#define E4X12_MPLL_LOCK 0x10008
100#define E4X12_MPLL_CON0 0x10108 100#define E4X12_MPLL_CON0 0x10108
101#define SRC_DMC 0x10200 101#define SRC_DMC 0x10200
102#define SRC_MASK_DMC 0x10300 102#define SRC_MASK_DMC 0x10300
103#define DIV_DMC0 0x10500 103#define DIV_DMC0 0x10500
104#define DIV_DMC1 0x10504 104#define DIV_DMC1 0x10504
105#define GATE_IP_DMC 0x10900 105#define GATE_IP_DMC 0x10900
106#define APLL_LOCK 0x14000
106#define APLL_CON0 0x14100 107#define APLL_CON0 0x14100
107#define E4210_MPLL_CON0 0x14108 108#define E4210_MPLL_CON0 0x14108
108#define SRC_CPU 0x14200 109#define SRC_CPU 0x14200
@@ -121,6 +122,12 @@ enum exynos4_soc {
121 EXYNOS4X12, 122 EXYNOS4X12,
122}; 123};
123 124
125/* list of PLLs to be registered */
126enum exynos4_plls {
127 apll, mpll, epll, vpll,
128 nr_plls /* number of PLLs */
129};
130
124/* 131/*
125 * Let each supported clock get a unique id. This id is used to lookup the clock 132 * Let each supported clock get a unique id. This id is used to lookup the clock
126 * for device tree based platforms. The clocks are categorized into three 133 * for device tree based platforms. The clocks are categorized into three
@@ -977,6 +984,17 @@ static __initdata struct of_device_id ext_clk_match[] = {
977 {}, 984 {},
978}; 985};
979 986
987struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = {
988 [apll] = PLL_A(pll_35xx, fout_apll, "fout_apll", "fin_pll", APLL_LOCK,
989 APLL_CON0, "fout_apll"),
990 [mpll] = PLL_A(pll_35xx, fout_mpll, "fout_mpll", "fin_pll",
991 E4X12_MPLL_LOCK, E4X12_MPLL_CON0, "fout_mpll"),
992 [epll] = PLL_A(pll_36xx, fout_epll, "fout_epll", "fin_pll", EPLL_LOCK,
993 EPLL_CON0, "fout_epll"),
994 [vpll] = PLL_A(pll_36xx, fout_vpll, "fout_vpll", "fin_pll", VPLL_LOCK,
995 VPLL_CON0, "fout_vpll"),
996};
997
980/* register exynos4 clocks */ 998/* register exynos4 clocks */
981static void __init exynos4_clk_init(struct device_node *np, 999static void __init exynos4_clk_init(struct device_node *np,
982 enum exynos4_soc exynos4_soc, 1000 enum exynos4_soc exynos4_soc,
@@ -1015,22 +1033,16 @@ static void __init exynos4_clk_init(struct device_node *np,
1015 reg_base + EPLL_CON0, pll_4600); 1033 reg_base + EPLL_CON0, pll_4600);
1016 vpll = samsung_clk_register_pll46xx("fout_vpll", "mout_vpllsrc", 1034 vpll = samsung_clk_register_pll46xx("fout_vpll", "mout_vpllsrc",
1017 reg_base + VPLL_CON0, pll_4650c); 1035 reg_base + VPLL_CON0, pll_4650c);
1036
1037 samsung_clk_add_lookup(apll, fout_apll);
1038 samsung_clk_add_lookup(mpll, fout_mpll);
1039 samsung_clk_add_lookup(epll, fout_epll);
1040 samsung_clk_add_lookup(vpll, fout_vpll);
1018 } else { 1041 } else {
1019 apll = samsung_clk_register_pll35xx("fout_apll", "fin_pll", 1042 samsung_clk_register_pll(exynos4_plls,
1020 reg_base + APLL_CON0); 1043 ARRAY_SIZE(exynos4_plls), reg_base);
1021 mpll = samsung_clk_register_pll35xx("fout_mpll", "fin_pll",
1022 reg_base + E4X12_MPLL_CON0);
1023 epll = samsung_clk_register_pll36xx("fout_epll", "fin_pll",
1024 reg_base + EPLL_CON0);
1025 vpll = samsung_clk_register_pll36xx("fout_vpll", "fin_pll",
1026 reg_base + VPLL_CON0);
1027 } 1044 }
1028 1045
1029 samsung_clk_add_lookup(apll, fout_apll);
1030 samsung_clk_add_lookup(mpll, fout_mpll);
1031 samsung_clk_add_lookup(epll, fout_epll);
1032 samsung_clk_add_lookup(vpll, fout_vpll);
1033
1034 samsung_clk_register_fixed_rate(exynos4_fixed_rate_clks, 1046 samsung_clk_register_fixed_rate(exynos4_fixed_rate_clks,
1035 ARRAY_SIZE(exynos4_fixed_rate_clks)); 1047 ARRAY_SIZE(exynos4_fixed_rate_clks));
1036 samsung_clk_register_mux(exynos4_mux_clks, 1048 samsung_clk_register_mux(exynos4_mux_clks,