blob: df4ad8a510504c5dc146254ef74696b055301205 [file] [log] [blame]
Thomas Abraham1c4c5fe2013-03-09 17:02:48 +09001/*
2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 * Copyright (c) 2013 Linaro Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Common Clock Framework support for all PLL's in Samsung platforms
10*/
11
12#ifndef __SAMSUNG_CLK_PLL_H
13#define __SAMSUNG_CLK_PLL_H
14
Yadwinder Singh Brar07dc76f2013-06-11 15:01:07 +053015enum samsung_pll_type {
Heiko Stuebnera951b1d2014-02-19 09:25:41 +090016 pll_2126,
17 pll_3000,
Yadwinder Singh Brar07dc76f2013-06-11 15:01:07 +053018 pll_35xx,
19 pll_36xx,
20 pll_2550,
21 pll_2650,
Tomasz Figa52b06012013-08-26 19:09:04 +020022 pll_4500,
23 pll_4502,
24 pll_4508,
Tomasz Figac50d11f2013-08-26 19:09:06 +020025 pll_4600,
26 pll_4650,
27 pll_4650c,
Tomasz Figa40ef7232013-08-21 02:33:21 +020028 pll_6552,
Heiko Stuebner06654ac2014-02-19 09:25:36 +090029 pll_6552_s3c2416,
Tomasz Figa40ef7232013-08-21 02:33:21 +020030 pll_6553,
Heiko Stuebnerea5d6a82014-02-25 09:50:43 +090031 pll_s3c2410_mpll,
32 pll_s3c2410_upll,
33 pll_s3c2440_mpll,
Sylwester Nawrocki1d9aa642016-08-18 17:01:20 +020034 pll_2550x,
Pankaj Dubey84329842014-03-12 20:26:45 +053035 pll_2550xx,
Rahul Sharmaeefe1192014-03-12 20:26:46 +053036 pll_2650xx,
Naveen Krishna Ch0c23e2a2014-09-22 10:17:01 +053037 pll_1450x,
38 pll_1451x,
39 pll_1452x,
40 pll_1460x,
Yadwinder Singh Brar07dc76f2013-06-11 15:01:07 +053041};
42
Yadwinder Singh Brar3ff6e0d2013-06-11 15:01:12 +053043#define PLL_35XX_RATE(_rate, _m, _p, _s) \
44 { \
45 .rate = (_rate), \
46 .mdiv = (_m), \
47 .pdiv = (_p), \
48 .sdiv = (_s), \
49 }
50
51#define PLL_36XX_RATE(_rate, _m, _p, _s, _k) \
52 { \
53 .rate = (_rate), \
54 .mdiv = (_m), \
55 .pdiv = (_p), \
56 .sdiv = (_s), \
57 .kdiv = (_k), \
58 }
59
Tomasz Figab4054ac2013-08-26 19:09:05 +020060#define PLL_45XX_RATE(_rate, _m, _p, _s, _afc) \
61 { \
62 .rate = (_rate), \
63 .mdiv = (_m), \
64 .pdiv = (_p), \
65 .sdiv = (_s), \
66 .afc = (_afc), \
67 }
68
Tomasz Figa5c896582013-08-26 19:09:07 +020069#define PLL_4600_RATE(_rate, _m, _p, _s, _k, _vsel) \
70 { \
71 .rate = (_rate), \
72 .mdiv = (_m), \
73 .pdiv = (_p), \
74 .sdiv = (_s), \
75 .kdiv = (_k), \
76 .vsel = (_vsel), \
77 }
78
79#define PLL_4650_RATE(_rate, _m, _p, _s, _k, _mfr, _mrr, _vsel) \
80 { \
81 .rate = (_rate), \
82 .mdiv = (_m), \
83 .pdiv = (_p), \
84 .sdiv = (_s), \
85 .kdiv = (_k), \
86 .mfr = (_mfr), \
87 .mrr = (_mrr), \
88 .vsel = (_vsel), \
89 }
90
Yadwinder Singh Brar3ff6e0d2013-06-11 15:01:12 +053091/* NOTE: Rate table should be kept sorted in descending order. */
92
93struct samsung_pll_rate_table {
94 unsigned int rate;
95 unsigned int pdiv;
96 unsigned int mdiv;
97 unsigned int sdiv;
98 unsigned int kdiv;
Tomasz Figab4054ac2013-08-26 19:09:05 +020099 unsigned int afc;
Tomasz Figa5c896582013-08-26 19:09:07 +0200100 unsigned int mfr;
101 unsigned int mrr;
102 unsigned int vsel;
Yadwinder Singh Brar3ff6e0d2013-06-11 15:01:12 +0530103};
104
Thomas Abraham1c4c5fe2013-03-09 17:02:48 +0900105extern struct clk * __init samsung_clk_register_pll2550x(const char *name,
106 const char *pname, const void __iomem *reg_base,
107 const unsigned long offset);
108
109#endif /* __SAMSUNG_CLK_PLL_H */