aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/samsung/clk-exynos5420.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-04 14:44:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-04 14:44:20 -0400
commite4ca4308c055c7bfb82f6756297346760d697953 (patch)
tree886a5a0ab7184e799fdabdf91609bc25a2c12731 /drivers/clk/samsung/clk-exynos5420.c
parente17acfdc83b877794c119fac4627e80510ea3c09 (diff)
parentb11a6face1b6d5518319f797a74e22bb4309daa9 (diff)
Merge tag 'clk-for-linus-3.17' of git://git.linaro.org/people/mike.turquette/linux
Pull clock framework updates from Mike Turquette: "The clock framework changes for 3.17 are mostly additions of new clock drivers and fixes/enhancements to existing clock drivers. There are also some non-critical fixes and improvements to the framework core. Changes to the clock framework core include: - improvements to printks on errors - flattening the previously hierarchal structure of per-clock entries in debugfs - allow per-clock debugfs entries that are specific to a particular clock driver - configure initial clock parent and/or initial clock rate from Device Tree - several feature enhancements to the composite clock type - misc fixes New clock drivers added include: - TI Palmas PMIC - Allwinner A23 SoC - Qualcomm APQ8084 and IPQ8064 SoCs - Rockchip rk3188, rk3066 and rk3288 SoCs - STMicroelectronics STiH407 SoC - Cirrus Logic CLPS711X SoC Many fixes, feature enhancements and further clock tree support for existing clock drivers also were merged, such as Samsung's "ARMCLK down" power saving feature for their Exynos4 & Exynos5 SoCs" * tag 'clk-for-linus-3.17' of git://git.linaro.org/people/mike.turquette/linux: (86 commits) clk: Add missing of_clk_set_defaults export clk: checking wrong variable in __set_clk_parents() clk: Propagate any error return from debug_init() clk: clps711x: Add DT bindings documentation clk: Add CLPS711X clk driver clk: st: Use round to closest divider flag clk: st: Update frequency tables for fs660c32 and fs432c65 clk: st: STiH407: Support for clockgenA9 clk: st: STiH407: Support for clockgenD0/D2/D3 clk: st: STiH407: Support for clockgenC0 clk: st: Add quadfs reset handling clk: st: Add polarity bit indication clk: st: STiH407: Support for clockgenA0 clk: st: STiH407: Support for A9 MUX Clocks clk: st: STiH407: Support for Flexgen Clocks clk: st: Adds Flexgen clock binding clk: st: Remove uncessary (void *) cast clk: st: use static const for clkgen_pll_data tables clk: st: use static const for stm_fs tables clk: st: Update ST clock binding documentation ...
Diffstat (limited to 'drivers/clk/samsung/clk-exynos5420.c')
-rw-r--r--drivers/clk/samsung/clk-exynos5420.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
index a4e6cc782e5c..848d602efc06 100644
--- a/drivers/clk/samsung/clk-exynos5420.c
+++ b/drivers/clk/samsung/clk-exynos5420.c
@@ -28,6 +28,7 @@
28#define GATE_BUS_CPU 0x700 28#define GATE_BUS_CPU 0x700
29#define GATE_SCLK_CPU 0x800 29#define GATE_SCLK_CPU 0x800
30#define CLKOUT_CMU_CPU 0xa00 30#define CLKOUT_CMU_CPU 0xa00
31#define SRC_MASK_CPERI 0x4300
31#define GATE_IP_G2D 0x8800 32#define GATE_IP_G2D 0x8800
32#define CPLL_LOCK 0x10020 33#define CPLL_LOCK 0x10020
33#define DPLL_LOCK 0x10030 34#define DPLL_LOCK 0x10030
@@ -70,6 +71,8 @@
70#define SRC_TOP11 0x10284 71#define SRC_TOP11 0x10284
71#define SRC_TOP12 0x10288 72#define SRC_TOP12 0x10288
72#define SRC_TOP13 0x1028c /* 5800 specific */ 73#define SRC_TOP13 0x1028c /* 5800 specific */
74#define SRC_MASK_TOP0 0x10300
75#define SRC_MASK_TOP1 0x10304
73#define SRC_MASK_TOP2 0x10308 76#define SRC_MASK_TOP2 0x10308
74#define SRC_MASK_TOP7 0x1031c 77#define SRC_MASK_TOP7 0x1031c
75#define SRC_MASK_DISP10 0x1032c 78#define SRC_MASK_DISP10 0x1032c
@@ -77,6 +80,7 @@
77#define SRC_MASK_FSYS 0x10340 80#define SRC_MASK_FSYS 0x10340
78#define SRC_MASK_PERIC0 0x10350 81#define SRC_MASK_PERIC0 0x10350
79#define SRC_MASK_PERIC1 0x10354 82#define SRC_MASK_PERIC1 0x10354
83#define SRC_MASK_ISP 0x10370
80#define DIV_TOP0 0x10500 84#define DIV_TOP0 0x10500
81#define DIV_TOP1 0x10504 85#define DIV_TOP1 0x10504
82#define DIV_TOP2 0x10508 86#define DIV_TOP2 0x10508
@@ -98,6 +102,7 @@
98#define DIV2_RATIO0 0x10590 102#define DIV2_RATIO0 0x10590
99#define DIV4_RATIO 0x105a0 103#define DIV4_RATIO 0x105a0
100#define GATE_BUS_TOP 0x10700 104#define GATE_BUS_TOP 0x10700
105#define GATE_BUS_DISP1 0x10728
101#define GATE_BUS_GEN 0x1073c 106#define GATE_BUS_GEN 0x1073c
102#define GATE_BUS_FSYS0 0x10740 107#define GATE_BUS_FSYS0 0x10740
103#define GATE_BUS_FSYS2 0x10748 108#define GATE_BUS_FSYS2 0x10748
@@ -190,6 +195,10 @@ static unsigned long exynos5x_clk_regs[] __initdata = {
190 SRC_MASK_FSYS, 195 SRC_MASK_FSYS,
191 SRC_MASK_PERIC0, 196 SRC_MASK_PERIC0,
192 SRC_MASK_PERIC1, 197 SRC_MASK_PERIC1,
198 SRC_MASK_TOP0,
199 SRC_MASK_TOP1,
200 SRC_MASK_MAU,
201 SRC_MASK_ISP,
193 SRC_ISP, 202 SRC_ISP,
194 DIV_TOP0, 203 DIV_TOP0,
195 DIV_TOP1, 204 DIV_TOP1,
@@ -208,6 +217,7 @@ static unsigned long exynos5x_clk_regs[] __initdata = {
208 SCLK_DIV_ISP1, 217 SCLK_DIV_ISP1,
209 DIV2_RATIO0, 218 DIV2_RATIO0,
210 DIV4_RATIO, 219 DIV4_RATIO,
220 GATE_BUS_DISP1,
211 GATE_BUS_TOP, 221 GATE_BUS_TOP,
212 GATE_BUS_GEN, 222 GATE_BUS_GEN,
213 GATE_BUS_FSYS0, 223 GATE_BUS_FSYS0,
@@ -249,6 +259,22 @@ static unsigned long exynos5800_clk_regs[] __initdata = {
249 GATE_IP_CAM, 259 GATE_IP_CAM,
250}; 260};
251 261
262static const struct samsung_clk_reg_dump exynos5420_set_clksrc[] = {
263 { .offset = SRC_MASK_CPERI, .value = 0xffffffff, },
264 { .offset = SRC_MASK_TOP0, .value = 0x11111111, },
265 { .offset = SRC_MASK_TOP1, .value = 0x11101111, },
266 { .offset = SRC_MASK_TOP2, .value = 0x11111110, },
267 { .offset = SRC_MASK_TOP7, .value = 0x00111100, },
268 { .offset = SRC_MASK_DISP10, .value = 0x11111110, },
269 { .offset = SRC_MASK_MAU, .value = 0x10000000, },
270 { .offset = SRC_MASK_FSYS, .value = 0x11111110, },
271 { .offset = SRC_MASK_PERIC0, .value = 0x11111110, },
272 { .offset = SRC_MASK_PERIC1, .value = 0x11111100, },
273 { .offset = SRC_MASK_ISP, .value = 0x11111000, },
274 { .offset = GATE_BUS_DISP1, .value = 0xffffffff, },
275 { .offset = GATE_IP_PERIC, .value = 0xffffffff, },
276};
277
252static int exynos5420_clk_suspend(void) 278static int exynos5420_clk_suspend(void)
253{ 279{
254 samsung_clk_save(reg_base, exynos5x_save, 280 samsung_clk_save(reg_base, exynos5x_save,
@@ -258,6 +284,9 @@ static int exynos5420_clk_suspend(void)
258 samsung_clk_save(reg_base, exynos5800_save, 284 samsung_clk_save(reg_base, exynos5800_save,
259 ARRAY_SIZE(exynos5800_clk_regs)); 285 ARRAY_SIZE(exynos5800_clk_regs));
260 286
287 samsung_clk_restore(reg_base, exynos5420_set_clksrc,
288 ARRAY_SIZE(exynos5420_set_clksrc));
289
261 return 0; 290 return 0;
262} 291}
263 292
@@ -1169,6 +1198,28 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = {
1169 GATE(CLK_G3D, "g3d", "mout_user_aclk_g3d", GATE_IP_G3D, 9, 0, 0), 1198 GATE(CLK_G3D, "g3d", "mout_user_aclk_g3d", GATE_IP_G3D, 9, 0, 0),
1170}; 1199};
1171 1200
1201static const struct samsung_pll_rate_table exynos5420_pll2550x_24mhz_tbl[] = {
1202 PLL_35XX_RATE(2000000000, 250, 3, 0),
1203 PLL_35XX_RATE(1900000000, 475, 6, 0),
1204 PLL_35XX_RATE(1800000000, 225, 3, 0),
1205 PLL_35XX_RATE(1700000000, 425, 6, 0),
1206 PLL_35XX_RATE(1600000000, 200, 3, 0),
1207 PLL_35XX_RATE(1500000000, 250, 4, 0),
1208 PLL_35XX_RATE(1400000000, 175, 3, 0),
1209 PLL_35XX_RATE(1300000000, 325, 6, 0),
1210 PLL_35XX_RATE(1200000000, 200, 2, 1),
1211 PLL_35XX_RATE(1100000000, 275, 3, 1),
1212 PLL_35XX_RATE(1000000000, 250, 3, 1),
1213 PLL_35XX_RATE(900000000, 150, 2, 1),
1214 PLL_35XX_RATE(800000000, 200, 3, 1),
1215 PLL_35XX_RATE(700000000, 175, 3, 1),
1216 PLL_35XX_RATE(600000000, 200, 2, 2),
1217 PLL_35XX_RATE(500000000, 250, 3, 2),
1218 PLL_35XX_RATE(400000000, 200, 3, 2),
1219 PLL_35XX_RATE(300000000, 200, 2, 3),
1220 PLL_35XX_RATE(200000000, 200, 3, 3),
1221};
1222
1172static struct samsung_pll_clock exynos5x_plls[nr_plls] __initdata = { 1223static struct samsung_pll_clock exynos5x_plls[nr_plls] __initdata = {
1173 [apll] = PLL(pll_2550, CLK_FOUT_APLL, "fout_apll", "fin_pll", APLL_LOCK, 1224 [apll] = PLL(pll_2550, CLK_FOUT_APLL, "fout_apll", "fin_pll", APLL_LOCK,
1174 APLL_CON0, NULL), 1225 APLL_CON0, NULL),
@@ -1194,7 +1245,7 @@ static struct samsung_pll_clock exynos5x_plls[nr_plls] __initdata = {
1194 KPLL_CON0, NULL), 1245 KPLL_CON0, NULL),
1195}; 1246};
1196 1247
1197static struct of_device_id ext_clk_match[] __initdata = { 1248static const struct of_device_id ext_clk_match[] __initconst = {
1198 { .compatible = "samsung,exynos5420-oscclk", .data = (void *)0, }, 1249 { .compatible = "samsung,exynos5420-oscclk", .data = (void *)0, },
1199 { }, 1250 { },
1200}; 1251};
@@ -1222,6 +1273,12 @@ static void __init exynos5x_clk_init(struct device_node *np,
1222 samsung_clk_of_register_fixed_ext(ctx, exynos5x_fixed_rate_ext_clks, 1273 samsung_clk_of_register_fixed_ext(ctx, exynos5x_fixed_rate_ext_clks,
1223 ARRAY_SIZE(exynos5x_fixed_rate_ext_clks), 1274 ARRAY_SIZE(exynos5x_fixed_rate_ext_clks),
1224 ext_clk_match); 1275 ext_clk_match);
1276
1277 if (_get_rate("fin_pll") == 24 * MHZ) {
1278 exynos5x_plls[apll].rate_table = exynos5420_pll2550x_24mhz_tbl;
1279 exynos5x_plls[kpll].rate_table = exynos5420_pll2550x_24mhz_tbl;
1280 }
1281
1225 samsung_clk_register_pll(ctx, exynos5x_plls, ARRAY_SIZE(exynos5x_plls), 1282 samsung_clk_register_pll(ctx, exynos5x_plls, ARRAY_SIZE(exynos5x_plls),
1226 reg_base); 1283 reg_base);
1227 samsung_clk_register_fixed_rate(ctx, exynos5x_fixed_rate_clks, 1284 samsung_clk_register_fixed_rate(ctx, exynos5x_fixed_rate_clks,
@@ -1253,6 +1310,8 @@ static void __init exynos5x_clk_init(struct device_node *np,
1253 } 1310 }
1254 1311
1255 exynos5420_clk_sleep_init(); 1312 exynos5420_clk_sleep_init();
1313
1314 samsung_clk_of_add_provider(np, ctx);
1256} 1315}
1257 1316
1258static void __init exynos5420_clk_init(struct device_node *np) 1317static void __init exynos5420_clk_init(struct device_node *np)