blob: 945f41ce95724f148b00e5bc9e3d300d4803e8b1 [file] [log] [blame]
Naveen Krishna Ch532abc32014-09-22 10:17:04 +05301/*
2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 * Author: Naveen Krishna Ch <naveenkrishna.ch@gmail.com>
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*/
10
11#include <linux/clk.h>
12#include <linux/clkdev.h>
13#include <linux/clk-provider.h>
14#include <linux/of.h>
15
16#include "clk.h"
17#include <dt-bindings/clock/exynos7-clk.h>
18
19/* Register Offset definitions for CMU_TOPC (0x10570000) */
20#define CC_PLL_LOCK 0x0000
21#define BUS0_PLL_LOCK 0x0004
22#define BUS1_DPLL_LOCK 0x0008
23#define MFC_PLL_LOCK 0x000C
24#define AUD_PLL_LOCK 0x0010
25#define CC_PLL_CON0 0x0100
26#define BUS0_PLL_CON0 0x0110
27#define BUS1_DPLL_CON0 0x0120
28#define MFC_PLL_CON0 0x0130
29#define AUD_PLL_CON0 0x0140
30#define MUX_SEL_TOPC0 0x0200
31#define MUX_SEL_TOPC1 0x0204
Naveen Krishna Chf5e127c2014-10-28 16:48:53 +053032#define MUX_SEL_TOPC2 0x0208
Naveen Krishna Ch532abc32014-09-22 10:17:04 +053033#define MUX_SEL_TOPC3 0x020C
Naveen Krishna Chf5e127c2014-10-28 16:48:53 +053034#define DIV_TOPC0 0x0600
Naveen Krishna Ch532abc32014-09-22 10:17:04 +053035#define DIV_TOPC1 0x0604
36#define DIV_TOPC3 0x060C
Tony K Nadackal49cab822014-12-17 13:03:37 +053037#define ENABLE_ACLK_TOPC1 0x0804
Naveen Krishna Ch532abc32014-09-22 10:17:04 +053038
39static struct samsung_fixed_factor_clock topc_fixed_factor_clks[] __initdata = {
40 FFACTOR(0, "ffac_topc_bus0_pll_div2", "mout_bus0_pll_ctrl", 1, 2, 0),
41 FFACTOR(0, "ffac_topc_bus0_pll_div4",
42 "ffac_topc_bus0_pll_div2", 1, 2, 0),
43 FFACTOR(0, "ffac_topc_bus1_pll_div2", "mout_bus1_pll_ctrl", 1, 2, 0),
44 FFACTOR(0, "ffac_topc_cc_pll_div2", "mout_cc_pll_ctrl", 1, 2, 0),
45 FFACTOR(0, "ffac_topc_mfc_pll_div2", "mout_mfc_pll_ctrl", 1, 2, 0),
46};
47
48/* List of parent clocks for Muxes in CMU_TOPC */
49PNAME(mout_bus0_pll_ctrl_p) = { "fin_pll", "fout_bus0_pll" };
50PNAME(mout_bus1_pll_ctrl_p) = { "fin_pll", "fout_bus1_pll" };
51PNAME(mout_cc_pll_ctrl_p) = { "fin_pll", "fout_cc_pll" };
52PNAME(mout_mfc_pll_ctrl_p) = { "fin_pll", "fout_mfc_pll" };
53
54PNAME(mout_topc_group2) = { "mout_sclk_bus0_pll_cmuc",
55 "mout_sclk_bus1_pll_cmuc", "mout_sclk_cc_pll_cmuc",
56 "mout_sclk_mfc_pll_cmuc" };
57
58PNAME(mout_sclk_bus0_pll_cmuc_p) = { "mout_bus0_pll_ctrl",
59 "ffac_topc_bus0_pll_div2", "ffac_topc_bus0_pll_div4"};
60PNAME(mout_sclk_bus1_pll_cmuc_p) = { "mout_bus1_pll_ctrl",
61 "ffac_topc_bus1_pll_div2"};
62PNAME(mout_sclk_cc_pll_cmuc_p) = { "mout_cc_pll_ctrl",
63 "ffac_topc_cc_pll_div2"};
64PNAME(mout_sclk_mfc_pll_cmuc_p) = { "mout_mfc_pll_ctrl",
65 "ffac_topc_mfc_pll_div2"};
66
67
68PNAME(mout_sclk_bus0_pll_out_p) = {"mout_bus0_pll_ctrl",
69 "ffac_topc_bus0_pll_div2"};
70
71static unsigned long topc_clk_regs[] __initdata = {
72 CC_PLL_LOCK,
73 BUS0_PLL_LOCK,
74 BUS1_DPLL_LOCK,
75 MFC_PLL_LOCK,
76 AUD_PLL_LOCK,
77 CC_PLL_CON0,
78 BUS0_PLL_CON0,
79 BUS1_DPLL_CON0,
80 MFC_PLL_CON0,
81 AUD_PLL_CON0,
82 MUX_SEL_TOPC0,
83 MUX_SEL_TOPC1,
Naveen Krishna Chf5e127c2014-10-28 16:48:53 +053084 MUX_SEL_TOPC2,
Naveen Krishna Ch532abc32014-09-22 10:17:04 +053085 MUX_SEL_TOPC3,
Naveen Krishna Chf5e127c2014-10-28 16:48:53 +053086 DIV_TOPC0,
Naveen Krishna Ch532abc32014-09-22 10:17:04 +053087 DIV_TOPC1,
88 DIV_TOPC3,
89};
90
91static struct samsung_mux_clock topc_mux_clks[] __initdata = {
92 MUX(0, "mout_bus0_pll_ctrl", mout_bus0_pll_ctrl_p, MUX_SEL_TOPC0, 0, 1),
93 MUX(0, "mout_bus1_pll_ctrl", mout_bus1_pll_ctrl_p, MUX_SEL_TOPC0, 4, 1),
94 MUX(0, "mout_cc_pll_ctrl", mout_cc_pll_ctrl_p, MUX_SEL_TOPC0, 8, 1),
95 MUX(0, "mout_mfc_pll_ctrl", mout_mfc_pll_ctrl_p, MUX_SEL_TOPC0, 12, 1),
96
97 MUX(0, "mout_sclk_bus0_pll_cmuc", mout_sclk_bus0_pll_cmuc_p,
98 MUX_SEL_TOPC0, 16, 2),
99 MUX(0, "mout_sclk_bus1_pll_cmuc", mout_sclk_bus1_pll_cmuc_p,
100 MUX_SEL_TOPC0, 20, 1),
101 MUX(0, "mout_sclk_cc_pll_cmuc", mout_sclk_cc_pll_cmuc_p,
102 MUX_SEL_TOPC0, 24, 1),
103 MUX(0, "mout_sclk_mfc_pll_cmuc", mout_sclk_mfc_pll_cmuc_p,
104 MUX_SEL_TOPC0, 28, 1),
105
106 MUX(0, "mout_sclk_bus0_pll_out", mout_sclk_bus0_pll_out_p,
107 MUX_SEL_TOPC1, 16, 1),
108
Naveen Krishna Chf5e127c2014-10-28 16:48:53 +0530109 MUX(0, "mout_aclk_ccore_133", mout_topc_group2, MUX_SEL_TOPC2, 4, 2),
110
Tony K Nadackal49cab822014-12-17 13:03:37 +0530111 MUX(0, "mout_aclk_mscl_532", mout_topc_group2, MUX_SEL_TOPC3, 20, 2),
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530112 MUX(0, "mout_aclk_peris_66", mout_topc_group2, MUX_SEL_TOPC3, 24, 2),
113};
114
115static struct samsung_div_clock topc_div_clks[] __initdata = {
Naveen Krishna Chf5e127c2014-10-28 16:48:53 +0530116 DIV(DOUT_ACLK_CCORE_133, "dout_aclk_ccore_133", "mout_aclk_ccore_133",
117 DIV_TOPC0, 4, 4),
118
Tony K Nadackal49cab822014-12-17 13:03:37 +0530119 DIV(DOUT_ACLK_MSCL_532, "dout_aclk_mscl_532", "mout_aclk_mscl_532",
120 DIV_TOPC1, 20, 4),
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530121 DIV(DOUT_ACLK_PERIS, "dout_aclk_peris_66", "mout_aclk_peris_66",
122 DIV_TOPC1, 24, 4),
123
124 DIV(DOUT_SCLK_BUS0_PLL, "dout_sclk_bus0_pll", "mout_sclk_bus0_pll_out",
125 DIV_TOPC3, 0, 3),
126 DIV(DOUT_SCLK_BUS1_PLL, "dout_sclk_bus1_pll", "mout_bus1_pll_ctrl",
127 DIV_TOPC3, 8, 3),
128 DIV(DOUT_SCLK_CC_PLL, "dout_sclk_cc_pll", "mout_cc_pll_ctrl",
129 DIV_TOPC3, 12, 3),
130 DIV(DOUT_SCLK_MFC_PLL, "dout_sclk_mfc_pll", "mout_mfc_pll_ctrl",
131 DIV_TOPC3, 16, 3),
132};
133
Tony K Nadackal49cab822014-12-17 13:03:37 +0530134static struct samsung_gate_clock topc_gate_clks[] __initdata = {
135 GATE(ACLK_MSCL_532, "aclk_mscl_532", "dout_aclk_mscl_532",
136 ENABLE_ACLK_TOPC1, 20, 0, 0),
137};
138
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530139static struct samsung_pll_clock topc_pll_clks[] __initdata = {
140 PLL(pll_1451x, 0, "fout_bus0_pll", "fin_pll", BUS0_PLL_LOCK,
141 BUS0_PLL_CON0, NULL),
142 PLL(pll_1452x, 0, "fout_cc_pll", "fin_pll", CC_PLL_LOCK,
143 CC_PLL_CON0, NULL),
144 PLL(pll_1452x, 0, "fout_bus1_pll", "fin_pll", BUS1_DPLL_LOCK,
145 BUS1_DPLL_CON0, NULL),
146 PLL(pll_1452x, 0, "fout_mfc_pll", "fin_pll", MFC_PLL_LOCK,
147 MFC_PLL_CON0, NULL),
148 PLL(pll_1460x, 0, "fout_aud_pll", "fin_pll", AUD_PLL_LOCK,
149 AUD_PLL_CON0, NULL),
150};
151
152static struct samsung_cmu_info topc_cmu_info __initdata = {
153 .pll_clks = topc_pll_clks,
154 .nr_pll_clks = ARRAY_SIZE(topc_pll_clks),
155 .mux_clks = topc_mux_clks,
156 .nr_mux_clks = ARRAY_SIZE(topc_mux_clks),
157 .div_clks = topc_div_clks,
158 .nr_div_clks = ARRAY_SIZE(topc_div_clks),
Tony K Nadackal49cab822014-12-17 13:03:37 +0530159 .gate_clks = topc_gate_clks,
160 .nr_gate_clks = ARRAY_SIZE(topc_gate_clks),
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530161 .fixed_factor_clks = topc_fixed_factor_clks,
162 .nr_fixed_factor_clks = ARRAY_SIZE(topc_fixed_factor_clks),
163 .nr_clk_ids = TOPC_NR_CLK,
164 .clk_regs = topc_clk_regs,
165 .nr_clk_regs = ARRAY_SIZE(topc_clk_regs),
166};
167
168static void __init exynos7_clk_topc_init(struct device_node *np)
169{
170 samsung_cmu_register_one(np, &topc_cmu_info);
171}
172
173CLK_OF_DECLARE(exynos7_clk_topc, "samsung,exynos7-clock-topc",
174 exynos7_clk_topc_init);
175
176/* Register Offset definitions for CMU_TOP0 (0x105D0000) */
177#define MUX_SEL_TOP00 0x0200
178#define MUX_SEL_TOP01 0x0204
179#define MUX_SEL_TOP03 0x020C
180#define MUX_SEL_TOP0_PERIC3 0x023C
181#define DIV_TOP03 0x060C
182#define DIV_TOP0_PERIC3 0x063C
183#define ENABLE_SCLK_TOP0_PERIC3 0x0A3C
184
185/* List of parent clocks for Muxes in CMU_TOP0 */
186PNAME(mout_bus0_pll_p) = { "fin_pll", "dout_sclk_bus0_pll" };
187PNAME(mout_bus1_pll_p) = { "fin_pll", "dout_sclk_bus1_pll" };
188PNAME(mout_cc_pll_p) = { "fin_pll", "dout_sclk_cc_pll" };
189PNAME(mout_mfc_pll_p) = { "fin_pll", "dout_sclk_mfc_pll" };
190
191PNAME(mout_top0_half_bus0_pll_p) = {"mout_top0_bus0_pll",
192 "ffac_top0_bus0_pll_div2"};
193PNAME(mout_top0_half_bus1_pll_p) = {"mout_top0_bus1_pll",
194 "ffac_top0_bus1_pll_div2"};
195PNAME(mout_top0_half_cc_pll_p) = {"mout_top0_cc_pll",
196 "ffac_top0_cc_pll_div2"};
197PNAME(mout_top0_half_mfc_pll_p) = {"mout_top0_mfc_pll",
198 "ffac_top0_mfc_pll_div2"};
199
200PNAME(mout_top0_group1) = {"mout_top0_half_bus0_pll",
201 "mout_top0_half_bus1_pll", "mout_top0_half_cc_pll",
202 "mout_top0_half_mfc_pll"};
203
204static unsigned long top0_clk_regs[] __initdata = {
205 MUX_SEL_TOP00,
206 MUX_SEL_TOP01,
207 MUX_SEL_TOP03,
208 MUX_SEL_TOP0_PERIC3,
209 DIV_TOP03,
210 DIV_TOP0_PERIC3,
211 ENABLE_SCLK_TOP0_PERIC3,
212};
213
214static struct samsung_mux_clock top0_mux_clks[] __initdata = {
215 MUX(0, "mout_top0_mfc_pll", mout_mfc_pll_p, MUX_SEL_TOP00, 4, 1),
216 MUX(0, "mout_top0_cc_pll", mout_cc_pll_p, MUX_SEL_TOP00, 8, 1),
217 MUX(0, "mout_top0_bus1_pll", mout_bus1_pll_p, MUX_SEL_TOP00, 12, 1),
218 MUX(0, "mout_top0_bus0_pll", mout_bus0_pll_p, MUX_SEL_TOP00, 16, 1),
219
220 MUX(0, "mout_top0_half_mfc_pll", mout_top0_half_mfc_pll_p,
221 MUX_SEL_TOP01, 4, 1),
222 MUX(0, "mout_top0_half_cc_pll", mout_top0_half_cc_pll_p,
223 MUX_SEL_TOP01, 8, 1),
224 MUX(0, "mout_top0_half_bus1_pll", mout_top0_half_bus1_pll_p,
225 MUX_SEL_TOP01, 12, 1),
226 MUX(0, "mout_top0_half_bus0_pll", mout_top0_half_bus0_pll_p,
227 MUX_SEL_TOP01, 16, 1),
228
229 MUX(0, "mout_aclk_peric1_66", mout_top0_group1, MUX_SEL_TOP03, 12, 2),
230 MUX(0, "mout_aclk_peric0_66", mout_top0_group1, MUX_SEL_TOP03, 20, 2),
231
232 MUX(0, "mout_sclk_uart3", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 4, 2),
233 MUX(0, "mout_sclk_uart2", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 8, 2),
234 MUX(0, "mout_sclk_uart1", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 12, 2),
235 MUX(0, "mout_sclk_uart0", mout_top0_group1, MUX_SEL_TOP0_PERIC3, 16, 2),
236};
237
238static struct samsung_div_clock top0_div_clks[] __initdata = {
239 DIV(DOUT_ACLK_PERIC1, "dout_aclk_peric1_66", "mout_aclk_peric1_66",
240 DIV_TOP03, 12, 6),
241 DIV(DOUT_ACLK_PERIC0, "dout_aclk_peric0_66", "mout_aclk_peric0_66",
242 DIV_TOP03, 20, 6),
243
244 DIV(0, "dout_sclk_uart3", "mout_sclk_uart3", DIV_TOP0_PERIC3, 4, 4),
245 DIV(0, "dout_sclk_uart2", "mout_sclk_uart2", DIV_TOP0_PERIC3, 8, 4),
246 DIV(0, "dout_sclk_uart1", "mout_sclk_uart1", DIV_TOP0_PERIC3, 12, 4),
247 DIV(0, "dout_sclk_uart0", "mout_sclk_uart0", DIV_TOP0_PERIC3, 16, 4),
248};
249
250static struct samsung_gate_clock top0_gate_clks[] __initdata = {
251 GATE(CLK_SCLK_UART3, "sclk_uart3", "dout_sclk_uart3",
252 ENABLE_SCLK_TOP0_PERIC3, 4, 0, 0),
253 GATE(CLK_SCLK_UART2, "sclk_uart2", "dout_sclk_uart2",
254 ENABLE_SCLK_TOP0_PERIC3, 8, 0, 0),
255 GATE(CLK_SCLK_UART1, "sclk_uart1", "dout_sclk_uart1",
256 ENABLE_SCLK_TOP0_PERIC3, 12, 0, 0),
257 GATE(CLK_SCLK_UART0, "sclk_uart0", "dout_sclk_uart0",
258 ENABLE_SCLK_TOP0_PERIC3, 16, 0, 0),
259};
260
261static struct samsung_fixed_factor_clock top0_fixed_factor_clks[] __initdata = {
262 FFACTOR(0, "ffac_top0_bus0_pll_div2", "mout_top0_bus0_pll", 1, 2, 0),
263 FFACTOR(0, "ffac_top0_bus1_pll_div2", "mout_top0_bus1_pll", 1, 2, 0),
264 FFACTOR(0, "ffac_top0_cc_pll_div2", "mout_top0_cc_pll", 1, 2, 0),
265 FFACTOR(0, "ffac_top0_mfc_pll_div2", "mout_top0_mfc_pll", 1, 2, 0),
266};
267
268static struct samsung_cmu_info top0_cmu_info __initdata = {
269 .mux_clks = top0_mux_clks,
270 .nr_mux_clks = ARRAY_SIZE(top0_mux_clks),
271 .div_clks = top0_div_clks,
272 .nr_div_clks = ARRAY_SIZE(top0_div_clks),
273 .gate_clks = top0_gate_clks,
274 .nr_gate_clks = ARRAY_SIZE(top0_gate_clks),
275 .fixed_factor_clks = top0_fixed_factor_clks,
276 .nr_fixed_factor_clks = ARRAY_SIZE(top0_fixed_factor_clks),
277 .nr_clk_ids = TOP0_NR_CLK,
278 .clk_regs = top0_clk_regs,
279 .nr_clk_regs = ARRAY_SIZE(top0_clk_regs),
280};
281
282static void __init exynos7_clk_top0_init(struct device_node *np)
283{
284 samsung_cmu_register_one(np, &top0_cmu_info);
285}
286
287CLK_OF_DECLARE(exynos7_clk_top0, "samsung,exynos7-clock-top0",
288 exynos7_clk_top0_init);
289
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530290/* Register Offset definitions for CMU_TOP1 (0x105E0000) */
291#define MUX_SEL_TOP10 0x0200
292#define MUX_SEL_TOP11 0x0204
293#define MUX_SEL_TOP13 0x020C
294#define MUX_SEL_TOP1_FSYS0 0x0224
295#define MUX_SEL_TOP1_FSYS1 0x0228
296#define DIV_TOP13 0x060C
297#define DIV_TOP1_FSYS0 0x0624
298#define DIV_TOP1_FSYS1 0x0628
299#define ENABLE_ACLK_TOP13 0x080C
300#define ENABLE_SCLK_TOP1_FSYS0 0x0A24
301#define ENABLE_SCLK_TOP1_FSYS1 0x0A28
302
303/* List of parent clocks for Muxes in CMU_TOP1 */
304PNAME(mout_top1_bus0_pll_p) = { "fin_pll", "dout_sclk_bus0_pll" };
305PNAME(mout_top1_bus1_pll_p) = { "fin_pll", "dout_sclk_bus1_pll_b" };
306PNAME(mout_top1_cc_pll_p) = { "fin_pll", "dout_sclk_cc_pll_b" };
307PNAME(mout_top1_mfc_pll_p) = { "fin_pll", "dout_sclk_mfc_pll_b" };
308
309PNAME(mout_top1_half_bus0_pll_p) = {"mout_top1_bus0_pll",
310 "ffac_top1_bus0_pll_div2"};
311PNAME(mout_top1_half_bus1_pll_p) = {"mout_top1_bus1_pll",
312 "ffac_top1_bus1_pll_div2"};
313PNAME(mout_top1_half_cc_pll_p) = {"mout_top1_cc_pll",
314 "ffac_top1_cc_pll_div2"};
315PNAME(mout_top1_half_mfc_pll_p) = {"mout_top1_mfc_pll",
316 "ffac_top1_mfc_pll_div2"};
317
318PNAME(mout_top1_group1) = {"mout_top1_half_bus0_pll",
319 "mout_top1_half_bus1_pll", "mout_top1_half_cc_pll",
320 "mout_top1_half_mfc_pll"};
321
322static unsigned long top1_clk_regs[] __initdata = {
323 MUX_SEL_TOP10,
324 MUX_SEL_TOP11,
325 MUX_SEL_TOP13,
326 MUX_SEL_TOP1_FSYS0,
327 MUX_SEL_TOP1_FSYS1,
328 DIV_TOP13,
329 DIV_TOP1_FSYS0,
330 DIV_TOP1_FSYS1,
331 ENABLE_ACLK_TOP13,
332 ENABLE_SCLK_TOP1_FSYS0,
333 ENABLE_SCLK_TOP1_FSYS1,
334};
335
336static struct samsung_mux_clock top1_mux_clks[] __initdata = {
337 MUX(0, "mout_top1_mfc_pll", mout_top1_mfc_pll_p, MUX_SEL_TOP10, 4, 1),
338 MUX(0, "mout_top1_cc_pll", mout_top1_cc_pll_p, MUX_SEL_TOP10, 8, 1),
339 MUX(0, "mout_top1_bus1_pll", mout_top1_bus1_pll_p,
340 MUX_SEL_TOP10, 12, 1),
341 MUX(0, "mout_top1_bus0_pll", mout_top1_bus0_pll_p,
342 MUX_SEL_TOP10, 16, 1),
343
344 MUX(0, "mout_top1_half_mfc_pll", mout_top1_half_mfc_pll_p,
345 MUX_SEL_TOP11, 4, 1),
346 MUX(0, "mout_top1_half_cc_pll", mout_top1_half_cc_pll_p,
347 MUX_SEL_TOP11, 8, 1),
348 MUX(0, "mout_top1_half_bus1_pll", mout_top1_half_bus1_pll_p,
349 MUX_SEL_TOP11, 12, 1),
350 MUX(0, "mout_top1_half_bus0_pll", mout_top1_half_bus0_pll_p,
351 MUX_SEL_TOP11, 16, 1),
352
353 MUX(0, "mout_aclk_fsys1_200", mout_top1_group1, MUX_SEL_TOP13, 24, 2),
354 MUX(0, "mout_aclk_fsys0_200", mout_top1_group1, MUX_SEL_TOP13, 28, 2),
355
356 MUX(0, "mout_sclk_mmc2", mout_top1_group1, MUX_SEL_TOP1_FSYS0, 24, 2),
Vivek Gautam83f191a2014-11-21 19:05:51 +0530357 MUX(0, "mout_sclk_usbdrd300", mout_top1_group1,
358 MUX_SEL_TOP1_FSYS0, 28, 2),
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530359
360 MUX(0, "mout_sclk_mmc1", mout_top1_group1, MUX_SEL_TOP1_FSYS1, 24, 2),
361 MUX(0, "mout_sclk_mmc0", mout_top1_group1, MUX_SEL_TOP1_FSYS1, 28, 2),
362};
363
364static struct samsung_div_clock top1_div_clks[] __initdata = {
365 DIV(DOUT_ACLK_FSYS1_200, "dout_aclk_fsys1_200", "mout_aclk_fsys1_200",
366 DIV_TOP13, 24, 4),
367 DIV(DOUT_ACLK_FSYS0_200, "dout_aclk_fsys0_200", "mout_aclk_fsys0_200",
368 DIV_TOP13, 28, 4),
369
370 DIV(DOUT_SCLK_MMC2, "dout_sclk_mmc2", "mout_sclk_mmc2",
371 DIV_TOP1_FSYS0, 24, 4),
Vivek Gautam83f191a2014-11-21 19:05:51 +0530372 DIV(0, "dout_sclk_usbdrd300", "mout_sclk_usbdrd300",
373 DIV_TOP1_FSYS0, 28, 4),
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530374
375 DIV(DOUT_SCLK_MMC1, "dout_sclk_mmc1", "mout_sclk_mmc1",
376 DIV_TOP1_FSYS1, 24, 4),
377 DIV(DOUT_SCLK_MMC0, "dout_sclk_mmc0", "mout_sclk_mmc0",
378 DIV_TOP1_FSYS1, 28, 4),
379};
380
381static struct samsung_gate_clock top1_gate_clks[] __initdata = {
382 GATE(CLK_SCLK_MMC2, "sclk_mmc2", "dout_sclk_mmc2",
383 ENABLE_SCLK_TOP1_FSYS0, 24, CLK_SET_RATE_PARENT, 0),
Vivek Gautam83f191a2014-11-21 19:05:51 +0530384 GATE(0, "sclk_usbdrd300", "dout_sclk_usbdrd300",
385 ENABLE_SCLK_TOP1_FSYS0, 28, 0, 0),
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530386
387 GATE(CLK_SCLK_MMC1, "sclk_mmc1", "dout_sclk_mmc1",
388 ENABLE_SCLK_TOP1_FSYS1, 24, CLK_SET_RATE_PARENT, 0),
389 GATE(CLK_SCLK_MMC0, "sclk_mmc0", "dout_sclk_mmc0",
390 ENABLE_SCLK_TOP1_FSYS1, 28, CLK_SET_RATE_PARENT, 0),
391};
392
393static struct samsung_fixed_factor_clock top1_fixed_factor_clks[] __initdata = {
394 FFACTOR(0, "ffac_top1_bus0_pll_div2", "mout_top1_bus0_pll", 1, 2, 0),
395 FFACTOR(0, "ffac_top1_bus1_pll_div2", "mout_top1_bus1_pll", 1, 2, 0),
396 FFACTOR(0, "ffac_top1_cc_pll_div2", "mout_top1_cc_pll", 1, 2, 0),
397 FFACTOR(0, "ffac_top1_mfc_pll_div2", "mout_top1_mfc_pll", 1, 2, 0),
398};
399
400static struct samsung_cmu_info top1_cmu_info __initdata = {
401 .mux_clks = top1_mux_clks,
402 .nr_mux_clks = ARRAY_SIZE(top1_mux_clks),
403 .div_clks = top1_div_clks,
404 .nr_div_clks = ARRAY_SIZE(top1_div_clks),
405 .gate_clks = top1_gate_clks,
406 .nr_gate_clks = ARRAY_SIZE(top1_gate_clks),
407 .fixed_factor_clks = top1_fixed_factor_clks,
408 .nr_fixed_factor_clks = ARRAY_SIZE(top1_fixed_factor_clks),
409 .nr_clk_ids = TOP1_NR_CLK,
410 .clk_regs = top1_clk_regs,
411 .nr_clk_regs = ARRAY_SIZE(top1_clk_regs),
412};
413
414static void __init exynos7_clk_top1_init(struct device_node *np)
415{
416 samsung_cmu_register_one(np, &top1_cmu_info);
417}
418
419CLK_OF_DECLARE(exynos7_clk_top1, "samsung,exynos7-clock-top1",
420 exynos7_clk_top1_init);
421
Naveen Krishna Chf5e127c2014-10-28 16:48:53 +0530422/* Register Offset definitions for CMU_CCORE (0x105B0000) */
423#define MUX_SEL_CCORE 0x0200
424#define DIV_CCORE 0x0600
425#define ENABLE_ACLK_CCORE0 0x0800
426#define ENABLE_ACLK_CCORE1 0x0804
427#define ENABLE_PCLK_CCORE 0x0900
428
429/*
430 * List of parent clocks for Muxes in CMU_CCORE
431 */
432PNAME(mout_aclk_ccore_133_p) = { "fin_pll", "dout_aclk_ccore_133" };
433
434static unsigned long ccore_clk_regs[] __initdata = {
435 MUX_SEL_CCORE,
436 ENABLE_PCLK_CCORE,
437};
438
439static struct samsung_mux_clock ccore_mux_clks[] __initdata = {
440 MUX(0, "mout_aclk_ccore_133_user", mout_aclk_ccore_133_p,
441 MUX_SEL_CCORE, 1, 1),
442};
443
444static struct samsung_gate_clock ccore_gate_clks[] __initdata = {
445 GATE(PCLK_RTC, "pclk_rtc", "mout_aclk_ccore_133_user",
446 ENABLE_PCLK_CCORE, 8, 0, 0),
447};
448
449static struct samsung_cmu_info ccore_cmu_info __initdata = {
450 .mux_clks = ccore_mux_clks,
451 .nr_mux_clks = ARRAY_SIZE(ccore_mux_clks),
452 .gate_clks = ccore_gate_clks,
453 .nr_gate_clks = ARRAY_SIZE(ccore_gate_clks),
454 .nr_clk_ids = CCORE_NR_CLK,
455 .clk_regs = ccore_clk_regs,
456 .nr_clk_regs = ARRAY_SIZE(ccore_clk_regs),
457};
458
459static void __init exynos7_clk_ccore_init(struct device_node *np)
460{
461 samsung_cmu_register_one(np, &ccore_cmu_info);
462}
463
464CLK_OF_DECLARE(exynos7_clk_ccore, "samsung,exynos7-clock-ccore",
465 exynos7_clk_ccore_init);
466
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530467/* Register Offset definitions for CMU_PERIC0 (0x13610000) */
468#define MUX_SEL_PERIC0 0x0200
469#define ENABLE_PCLK_PERIC0 0x0900
470#define ENABLE_SCLK_PERIC0 0x0A00
471
472/* List of parent clocks for Muxes in CMU_PERIC0 */
473PNAME(mout_aclk_peric0_66_p) = { "fin_pll", "dout_aclk_peric0_66" };
474PNAME(mout_sclk_uart0_p) = { "fin_pll", "sclk_uart0" };
475
476static unsigned long peric0_clk_regs[] __initdata = {
477 MUX_SEL_PERIC0,
478 ENABLE_PCLK_PERIC0,
479 ENABLE_SCLK_PERIC0,
480};
481
482static struct samsung_mux_clock peric0_mux_clks[] __initdata = {
483 MUX(0, "mout_aclk_peric0_66_user", mout_aclk_peric0_66_p,
484 MUX_SEL_PERIC0, 0, 1),
485 MUX(0, "mout_sclk_uart0_user", mout_sclk_uart0_p,
486 MUX_SEL_PERIC0, 16, 1),
487};
488
489static struct samsung_gate_clock peric0_gate_clks[] __initdata = {
Naveen Krishna Ch57a2b482014-10-21 11:13:51 +0530490 GATE(PCLK_HSI2C0, "pclk_hsi2c0", "mout_aclk_peric0_66_user",
491 ENABLE_PCLK_PERIC0, 8, 0, 0),
492 GATE(PCLK_HSI2C1, "pclk_hsi2c1", "mout_aclk_peric0_66_user",
493 ENABLE_PCLK_PERIC0, 9, 0, 0),
494 GATE(PCLK_HSI2C4, "pclk_hsi2c4", "mout_aclk_peric0_66_user",
495 ENABLE_PCLK_PERIC0, 10, 0, 0),
496 GATE(PCLK_HSI2C5, "pclk_hsi2c5", "mout_aclk_peric0_66_user",
497 ENABLE_PCLK_PERIC0, 11, 0, 0),
498 GATE(PCLK_HSI2C9, "pclk_hsi2c9", "mout_aclk_peric0_66_user",
499 ENABLE_PCLK_PERIC0, 12, 0, 0),
500 GATE(PCLK_HSI2C10, "pclk_hsi2c10", "mout_aclk_peric0_66_user",
501 ENABLE_PCLK_PERIC0, 13, 0, 0),
502 GATE(PCLK_HSI2C11, "pclk_hsi2c11", "mout_aclk_peric0_66_user",
503 ENABLE_PCLK_PERIC0, 14, 0, 0),
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530504 GATE(PCLK_UART0, "pclk_uart0", "mout_aclk_peric0_66_user",
505 ENABLE_PCLK_PERIC0, 16, 0, 0),
Abhilash Kesavan932e9822014-10-28 16:48:55 +0530506 GATE(PCLK_ADCIF, "pclk_adcif", "mout_aclk_peric0_66_user",
507 ENABLE_PCLK_PERIC0, 20, 0, 0),
Naveen Krishna Ch2ab2dfe2014-10-28 16:48:54 +0530508 GATE(PCLK_PWM, "pclk_pwm", "mout_aclk_peric0_66_user",
509 ENABLE_PCLK_PERIC0, 21, 0, 0),
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530510
511 GATE(SCLK_UART0, "sclk_uart0_user", "mout_sclk_uart0_user",
512 ENABLE_SCLK_PERIC0, 16, 0, 0),
Naveen Krishna Ch2ab2dfe2014-10-28 16:48:54 +0530513 GATE(SCLK_PWM, "sclk_pwm", "fin_pll", ENABLE_SCLK_PERIC0, 21, 0, 0),
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530514};
515
516static struct samsung_cmu_info peric0_cmu_info __initdata = {
517 .mux_clks = peric0_mux_clks,
518 .nr_mux_clks = ARRAY_SIZE(peric0_mux_clks),
519 .gate_clks = peric0_gate_clks,
520 .nr_gate_clks = ARRAY_SIZE(peric0_gate_clks),
521 .nr_clk_ids = PERIC0_NR_CLK,
522 .clk_regs = peric0_clk_regs,
523 .nr_clk_regs = ARRAY_SIZE(peric0_clk_regs),
524};
525
526static void __init exynos7_clk_peric0_init(struct device_node *np)
527{
528 samsung_cmu_register_one(np, &peric0_cmu_info);
529}
530
531/* Register Offset definitions for CMU_PERIC1 (0x14C80000) */
532#define MUX_SEL_PERIC10 0x0200
533#define MUX_SEL_PERIC11 0x0204
534#define ENABLE_PCLK_PERIC1 0x0900
535#define ENABLE_SCLK_PERIC10 0x0A00
536
537CLK_OF_DECLARE(exynos7_clk_peric0, "samsung,exynos7-clock-peric0",
538 exynos7_clk_peric0_init);
539
540/* List of parent clocks for Muxes in CMU_PERIC1 */
541PNAME(mout_aclk_peric1_66_p) = { "fin_pll", "dout_aclk_peric1_66" };
542PNAME(mout_sclk_uart1_p) = { "fin_pll", "sclk_uart1" };
543PNAME(mout_sclk_uart2_p) = { "fin_pll", "sclk_uart2" };
544PNAME(mout_sclk_uart3_p) = { "fin_pll", "sclk_uart3" };
545
546static unsigned long peric1_clk_regs[] __initdata = {
547 MUX_SEL_PERIC10,
548 MUX_SEL_PERIC11,
549 ENABLE_PCLK_PERIC1,
550 ENABLE_SCLK_PERIC10,
551};
552
553static struct samsung_mux_clock peric1_mux_clks[] __initdata = {
554 MUX(0, "mout_aclk_peric1_66_user", mout_aclk_peric1_66_p,
555 MUX_SEL_PERIC10, 0, 1),
556
557 MUX(0, "mout_sclk_uart1_user", mout_sclk_uart1_p,
558 MUX_SEL_PERIC11, 20, 1),
559 MUX(0, "mout_sclk_uart2_user", mout_sclk_uart2_p,
560 MUX_SEL_PERIC11, 24, 1),
561 MUX(0, "mout_sclk_uart3_user", mout_sclk_uart3_p,
562 MUX_SEL_PERIC11, 28, 1),
563};
564
565static struct samsung_gate_clock peric1_gate_clks[] __initdata = {
Naveen Krishna Ch57a2b482014-10-21 11:13:51 +0530566 GATE(PCLK_HSI2C2, "pclk_hsi2c2", "mout_aclk_peric1_66_user",
567 ENABLE_PCLK_PERIC1, 4, 0, 0),
568 GATE(PCLK_HSI2C3, "pclk_hsi2c3", "mout_aclk_peric1_66_user",
569 ENABLE_PCLK_PERIC1, 5, 0, 0),
570 GATE(PCLK_HSI2C6, "pclk_hsi2c6", "mout_aclk_peric1_66_user",
571 ENABLE_PCLK_PERIC1, 6, 0, 0),
572 GATE(PCLK_HSI2C7, "pclk_hsi2c7", "mout_aclk_peric1_66_user",
573 ENABLE_PCLK_PERIC1, 7, 0, 0),
574 GATE(PCLK_HSI2C8, "pclk_hsi2c8", "mout_aclk_peric1_66_user",
575 ENABLE_PCLK_PERIC1, 8, 0, 0),
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530576 GATE(PCLK_UART1, "pclk_uart1", "mout_aclk_peric1_66_user",
577 ENABLE_PCLK_PERIC1, 9, 0, 0),
578 GATE(PCLK_UART2, "pclk_uart2", "mout_aclk_peric1_66_user",
579 ENABLE_PCLK_PERIC1, 10, 0, 0),
580 GATE(PCLK_UART3, "pclk_uart3", "mout_aclk_peric1_66_user",
581 ENABLE_PCLK_PERIC1, 11, 0, 0),
582
583 GATE(SCLK_UART1, "sclk_uart1_user", "mout_sclk_uart1_user",
584 ENABLE_SCLK_PERIC10, 9, 0, 0),
585 GATE(SCLK_UART2, "sclk_uart2_user", "mout_sclk_uart2_user",
586 ENABLE_SCLK_PERIC10, 10, 0, 0),
587 GATE(SCLK_UART3, "sclk_uart3_user", "mout_sclk_uart3_user",
588 ENABLE_SCLK_PERIC10, 11, 0, 0),
589};
590
591static struct samsung_cmu_info peric1_cmu_info __initdata = {
592 .mux_clks = peric1_mux_clks,
593 .nr_mux_clks = ARRAY_SIZE(peric1_mux_clks),
594 .gate_clks = peric1_gate_clks,
595 .nr_gate_clks = ARRAY_SIZE(peric1_gate_clks),
596 .nr_clk_ids = PERIC1_NR_CLK,
597 .clk_regs = peric1_clk_regs,
598 .nr_clk_regs = ARRAY_SIZE(peric1_clk_regs),
599};
600
601static void __init exynos7_clk_peric1_init(struct device_node *np)
602{
603 samsung_cmu_register_one(np, &peric1_cmu_info);
604}
605
606CLK_OF_DECLARE(exynos7_clk_peric1, "samsung,exynos7-clock-peric1",
607 exynos7_clk_peric1_init);
608
609/* Register Offset definitions for CMU_PERIS (0x10040000) */
610#define MUX_SEL_PERIS 0x0200
Naveen Krishna Ch2ab2dfe2014-10-28 16:48:54 +0530611#define ENABLE_PCLK_PERIS 0x0900
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530612#define ENABLE_PCLK_PERIS_SECURE_CHIPID 0x0910
Naveen Krishna Ch2ab2dfe2014-10-28 16:48:54 +0530613#define ENABLE_SCLK_PERIS 0x0A00
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530614#define ENABLE_SCLK_PERIS_SECURE_CHIPID 0x0A10
615
616/* List of parent clocks for Muxes in CMU_PERIS */
617PNAME(mout_aclk_peris_66_p) = { "fin_pll", "dout_aclk_peris_66" };
618
619static unsigned long peris_clk_regs[] __initdata = {
620 MUX_SEL_PERIS,
Naveen Krishna Ch2ab2dfe2014-10-28 16:48:54 +0530621 ENABLE_PCLK_PERIS,
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530622 ENABLE_PCLK_PERIS_SECURE_CHIPID,
Naveen Krishna Ch2ab2dfe2014-10-28 16:48:54 +0530623 ENABLE_SCLK_PERIS,
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530624 ENABLE_SCLK_PERIS_SECURE_CHIPID,
625};
626
627static struct samsung_mux_clock peris_mux_clks[] __initdata = {
628 MUX(0, "mout_aclk_peris_66_user",
629 mout_aclk_peris_66_p, MUX_SEL_PERIS, 0, 1),
630};
631
632static struct samsung_gate_clock peris_gate_clks[] __initdata = {
Naveen Krishna Ch2ab2dfe2014-10-28 16:48:54 +0530633 GATE(PCLK_WDT, "pclk_wdt", "mout_aclk_peris_66_user",
634 ENABLE_PCLK_PERIS, 6, 0, 0),
635 GATE(PCLK_TMU, "pclk_tmu_apbif", "mout_aclk_peris_66_user",
636 ENABLE_PCLK_PERIS, 10, 0, 0),
637
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530638 GATE(PCLK_CHIPID, "pclk_chipid", "mout_aclk_peris_66_user",
639 ENABLE_PCLK_PERIS_SECURE_CHIPID, 0, 0, 0),
640 GATE(SCLK_CHIPID, "sclk_chipid", "fin_pll",
641 ENABLE_SCLK_PERIS_SECURE_CHIPID, 0, 0, 0),
Naveen Krishna Ch2ab2dfe2014-10-28 16:48:54 +0530642
643 GATE(SCLK_TMU, "sclk_tmu", "fin_pll", ENABLE_SCLK_PERIS, 10, 0, 0),
Naveen Krishna Ch532abc32014-09-22 10:17:04 +0530644};
645
646static struct samsung_cmu_info peris_cmu_info __initdata = {
647 .mux_clks = peris_mux_clks,
648 .nr_mux_clks = ARRAY_SIZE(peris_mux_clks),
649 .gate_clks = peris_gate_clks,
650 .nr_gate_clks = ARRAY_SIZE(peris_gate_clks),
651 .nr_clk_ids = PERIS_NR_CLK,
652 .clk_regs = peris_clk_regs,
653 .nr_clk_regs = ARRAY_SIZE(peris_clk_regs),
654};
655
656static void __init exynos7_clk_peris_init(struct device_node *np)
657{
658 samsung_cmu_register_one(np, &peris_cmu_info);
659}
660
661CLK_OF_DECLARE(exynos7_clk_peris, "samsung,exynos7-clock-peris",
662 exynos7_clk_peris_init);
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530663
664/* Register Offset definitions for CMU_FSYS0 (0x10E90000) */
665#define MUX_SEL_FSYS00 0x0200
666#define MUX_SEL_FSYS01 0x0204
Vivek Gautam83f191a2014-11-21 19:05:51 +0530667#define MUX_SEL_FSYS02 0x0208
668#define ENABLE_ACLK_FSYS00 0x0800
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530669#define ENABLE_ACLK_FSYS01 0x0804
Vivek Gautam83f191a2014-11-21 19:05:51 +0530670#define ENABLE_SCLK_FSYS01 0x0A04
671#define ENABLE_SCLK_FSYS02 0x0A08
672#define ENABLE_SCLK_FSYS04 0x0A10
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530673
674/*
675 * List of parent clocks for Muxes in CMU_FSYS0
676 */
677PNAME(mout_aclk_fsys0_200_p) = { "fin_pll", "dout_aclk_fsys0_200" };
678PNAME(mout_sclk_mmc2_p) = { "fin_pll", "sclk_mmc2" };
679
Vivek Gautam83f191a2014-11-21 19:05:51 +0530680PNAME(mout_sclk_usbdrd300_p) = { "fin_pll", "sclk_usbdrd300" };
681PNAME(mout_phyclk_usbdrd300_udrd30_phyclk_p) = { "fin_pll",
682 "phyclk_usbdrd300_udrd30_phyclock" };
683PNAME(mout_phyclk_usbdrd300_udrd30_pipe_pclk_p) = { "fin_pll",
684 "phyclk_usbdrd300_udrd30_pipe_pclk" };
685
686/* fixed rate clocks used in the FSYS0 block */
687struct samsung_fixed_rate_clock fixed_rate_clks_fsys0[] __initdata = {
688 FRATE(0, "phyclk_usbdrd300_udrd30_phyclock", NULL,
689 CLK_IS_ROOT, 60000000),
690 FRATE(0, "phyclk_usbdrd300_udrd30_pipe_pclk", NULL,
691 CLK_IS_ROOT, 125000000),
692};
693
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530694static unsigned long fsys0_clk_regs[] __initdata = {
695 MUX_SEL_FSYS00,
696 MUX_SEL_FSYS01,
Vivek Gautam83f191a2014-11-21 19:05:51 +0530697 MUX_SEL_FSYS02,
698 ENABLE_ACLK_FSYS00,
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530699 ENABLE_ACLK_FSYS01,
Vivek Gautam83f191a2014-11-21 19:05:51 +0530700 ENABLE_SCLK_FSYS01,
701 ENABLE_SCLK_FSYS02,
702 ENABLE_SCLK_FSYS04,
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530703};
704
705static struct samsung_mux_clock fsys0_mux_clks[] __initdata = {
706 MUX(0, "mout_aclk_fsys0_200_user", mout_aclk_fsys0_200_p,
707 MUX_SEL_FSYS00, 24, 1),
708
709 MUX(0, "mout_sclk_mmc2_user", mout_sclk_mmc2_p, MUX_SEL_FSYS01, 24, 1),
Vivek Gautam83f191a2014-11-21 19:05:51 +0530710 MUX(0, "mout_sclk_usbdrd300_user", mout_sclk_usbdrd300_p,
711 MUX_SEL_FSYS01, 28, 1),
712
713 MUX(0, "mout_phyclk_usbdrd300_udrd30_pipe_pclk_user",
714 mout_phyclk_usbdrd300_udrd30_pipe_pclk_p,
715 MUX_SEL_FSYS02, 24, 1),
716 MUX(0, "mout_phyclk_usbdrd300_udrd30_phyclk_user",
717 mout_phyclk_usbdrd300_udrd30_phyclk_p,
718 MUX_SEL_FSYS02, 28, 1),
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530719};
720
721static struct samsung_gate_clock fsys0_gate_clks[] __initdata = {
Vivek Gautam83f191a2014-11-21 19:05:51 +0530722 GATE(ACLK_AXIUS_USBDRD30X_FSYS0X, "aclk_axius_usbdrd30x_fsys0x",
723 "mout_aclk_fsys0_200_user",
724 ENABLE_ACLK_FSYS00, 19, 0, 0),
725
726 GATE(ACLK_USBDRD300, "aclk_usbdrd300", "mout_aclk_fsys0_200_user",
727 ENABLE_ACLK_FSYS01, 29, 0, 0),
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530728 GATE(ACLK_MMC2, "aclk_mmc2", "mout_aclk_fsys0_200_user",
729 ENABLE_ACLK_FSYS01, 31, 0, 0),
Vivek Gautam83f191a2014-11-21 19:05:51 +0530730
731 GATE(SCLK_USBDRD300_SUSPENDCLK, "sclk_usbdrd300_suspendclk",
732 "mout_sclk_usbdrd300_user",
733 ENABLE_SCLK_FSYS01, 4, 0, 0),
734 GATE(SCLK_USBDRD300_REFCLK, "sclk_usbdrd300_refclk", "fin_pll",
735 ENABLE_SCLK_FSYS01, 8, 0, 0),
736
737 GATE(PHYCLK_USBDRD300_UDRD30_PIPE_PCLK_USER,
738 "phyclk_usbdrd300_udrd30_pipe_pclk_user",
739 "mout_phyclk_usbdrd300_udrd30_pipe_pclk_user",
740 ENABLE_SCLK_FSYS02, 24, 0, 0),
741 GATE(PHYCLK_USBDRD300_UDRD30_PHYCLK_USER,
742 "phyclk_usbdrd300_udrd30_phyclk_user",
743 "mout_phyclk_usbdrd300_udrd30_phyclk_user",
744 ENABLE_SCLK_FSYS02, 28, 0, 0),
745
746 GATE(OSCCLK_PHY_CLKOUT_USB30_PHY, "oscclk_phy_clkout_usb30_phy",
747 "fin_pll",
748 ENABLE_SCLK_FSYS04, 28, 0, 0),
Naveen Krishna Ch6d0c8c72014-10-21 11:13:52 +0530749};
750
751static struct samsung_cmu_info fsys0_cmu_info __initdata = {
752 .mux_clks = fsys0_mux_clks,
753 .nr_mux_clks = ARRAY_SIZE(fsys0_mux_clks),
754 .gate_clks = fsys0_gate_clks,
755 .nr_gate_clks = ARRAY_SIZE(fsys0_gate_clks),
756 .nr_clk_ids = TOP1_NR_CLK,
757 .clk_regs = fsys0_clk_regs,
758 .nr_clk_regs = ARRAY_SIZE(fsys0_clk_regs),
759};
760
761static void __init exynos7_clk_fsys0_init(struct device_node *np)
762{
763 samsung_cmu_register_one(np, &fsys0_cmu_info);
764}
765
766CLK_OF_DECLARE(exynos7_clk_fsys0, "samsung,exynos7-clock-fsys0",
767 exynos7_clk_fsys0_init);
768
769/* Register Offset definitions for CMU_FSYS1 (0x156E0000) */
770#define MUX_SEL_FSYS10 0x0200
771#define MUX_SEL_FSYS11 0x0204
772#define ENABLE_ACLK_FSYS1 0x0800
773
774/*
775 * List of parent clocks for Muxes in CMU_FSYS1
776 */
777PNAME(mout_aclk_fsys1_200_p) = { "fin_pll", "dout_aclk_fsys1_200" };
778PNAME(mout_sclk_mmc0_p) = { "fin_pll", "sclk_mmc0" };
779PNAME(mout_sclk_mmc1_p) = { "fin_pll", "sclk_mmc1" };
780
781static unsigned long fsys1_clk_regs[] __initdata = {
782 MUX_SEL_FSYS10,
783 MUX_SEL_FSYS11,
784 ENABLE_ACLK_FSYS1,
785};
786
787static struct samsung_mux_clock fsys1_mux_clks[] __initdata = {
788 MUX(0, "mout_aclk_fsys1_200_user", mout_aclk_fsys1_200_p,
789 MUX_SEL_FSYS10, 28, 1),
790
791 MUX(0, "mout_sclk_mmc1_user", mout_sclk_mmc1_p, MUX_SEL_FSYS11, 24, 1),
792 MUX(0, "mout_sclk_mmc0_user", mout_sclk_mmc0_p, MUX_SEL_FSYS11, 28, 1),
793};
794
795static struct samsung_gate_clock fsys1_gate_clks[] __initdata = {
796 GATE(ACLK_MMC1, "aclk_mmc1", "mout_aclk_fsys1_200_user",
797 ENABLE_ACLK_FSYS1, 29, 0, 0),
798 GATE(ACLK_MMC0, "aclk_mmc0", "mout_aclk_fsys1_200_user",
799 ENABLE_ACLK_FSYS1, 30, 0, 0),
800};
801
802static struct samsung_cmu_info fsys1_cmu_info __initdata = {
803 .mux_clks = fsys1_mux_clks,
804 .nr_mux_clks = ARRAY_SIZE(fsys1_mux_clks),
805 .gate_clks = fsys1_gate_clks,
806 .nr_gate_clks = ARRAY_SIZE(fsys1_gate_clks),
807 .nr_clk_ids = TOP1_NR_CLK,
808 .clk_regs = fsys1_clk_regs,
809 .nr_clk_regs = ARRAY_SIZE(fsys1_clk_regs),
810};
811
812static void __init exynos7_clk_fsys1_init(struct device_node *np)
813{
814 samsung_cmu_register_one(np, &fsys1_cmu_info);
815}
816
817CLK_OF_DECLARE(exynos7_clk_fsys1, "samsung,exynos7-clock-fsys1",
818 exynos7_clk_fsys1_init);
Tony K Nadackal49cab822014-12-17 13:03:37 +0530819
820#define MUX_SEL_MSCL 0x0200
821#define DIV_MSCL 0x0600
822#define ENABLE_ACLK_MSCL 0x0800
823#define ENABLE_PCLK_MSCL 0x0900
824
825/* List of parent clocks for Muxes in CMU_MSCL */
826PNAME(mout_aclk_mscl_532_user_p) = { "fin_pll", "aclk_mscl_532" };
827
828static unsigned long mscl_clk_regs[] __initdata = {
829 MUX_SEL_MSCL,
830 DIV_MSCL,
831 ENABLE_ACLK_MSCL,
832 ENABLE_PCLK_MSCL,
833};
834
835static struct samsung_mux_clock mscl_mux_clks[] __initdata = {
836 MUX(USERMUX_ACLK_MSCL_532, "usermux_aclk_mscl_532",
837 mout_aclk_mscl_532_user_p, MUX_SEL_MSCL, 0, 1),
838};
839static struct samsung_div_clock mscl_div_clks[] __initdata = {
840 DIV(DOUT_PCLK_MSCL, "dout_pclk_mscl", "usermux_aclk_mscl_532",
841 DIV_MSCL, 0, 3),
842};
843static struct samsung_gate_clock mscl_gate_clks[] __initdata = {
844
845 GATE(ACLK_MSCL_0, "aclk_mscl_0", "usermux_aclk_mscl_532",
846 ENABLE_ACLK_MSCL, 31, 0, 0),
847 GATE(ACLK_MSCL_1, "aclk_mscl_1", "usermux_aclk_mscl_532",
848 ENABLE_ACLK_MSCL, 30, 0, 0),
849 GATE(ACLK_JPEG, "aclk_jpeg", "usermux_aclk_mscl_532",
850 ENABLE_ACLK_MSCL, 29, 0, 0),
851 GATE(ACLK_G2D, "aclk_g2d", "usermux_aclk_mscl_532",
852 ENABLE_ACLK_MSCL, 28, 0, 0),
853 GATE(ACLK_LH_ASYNC_SI_MSCL_0, "aclk_lh_async_si_mscl_0",
854 "usermux_aclk_mscl_532",
855 ENABLE_ACLK_MSCL, 27, 0, 0),
856 GATE(ACLK_LH_ASYNC_SI_MSCL_1, "aclk_lh_async_si_mscl_1",
857 "usermux_aclk_mscl_532",
858 ENABLE_ACLK_MSCL, 26, 0, 0),
859 GATE(ACLK_XIU_MSCLX_0, "aclk_xiu_msclx_0", "usermux_aclk_mscl_532",
860 ENABLE_ACLK_MSCL, 25, 0, 0),
861 GATE(ACLK_XIU_MSCLX_1, "aclk_xiu_msclx_1", "usermux_aclk_mscl_532",
862 ENABLE_ACLK_MSCL, 24, 0, 0),
863 GATE(ACLK_AXI2ACEL_BRIDGE, "aclk_axi2acel_bridge",
864 "usermux_aclk_mscl_532",
865 ENABLE_ACLK_MSCL, 23, 0, 0),
866 GATE(ACLK_QE_MSCL_0, "aclk_qe_mscl_0", "usermux_aclk_mscl_532",
867 ENABLE_ACLK_MSCL, 22, 0, 0),
868 GATE(ACLK_QE_MSCL_1, "aclk_qe_mscl_1", "usermux_aclk_mscl_532",
869 ENABLE_ACLK_MSCL, 21, 0, 0),
870 GATE(ACLK_QE_JPEG, "aclk_qe_jpeg", "usermux_aclk_mscl_532",
871 ENABLE_ACLK_MSCL, 20, 0, 0),
872 GATE(ACLK_QE_G2D, "aclk_qe_g2d", "usermux_aclk_mscl_532",
873 ENABLE_ACLK_MSCL, 19, 0, 0),
874 GATE(ACLK_PPMU_MSCL_0, "aclk_ppmu_mscl_0", "usermux_aclk_mscl_532",
875 ENABLE_ACLK_MSCL, 18, 0, 0),
876 GATE(ACLK_PPMU_MSCL_1, "aclk_ppmu_mscl_1", "usermux_aclk_mscl_532",
877 ENABLE_ACLK_MSCL, 17, 0, 0),
878 GATE(ACLK_MSCLNP_133, "aclk_msclnp_133", "usermux_aclk_mscl_532",
879 ENABLE_ACLK_MSCL, 16, 0, 0),
880 GATE(ACLK_AHB2APB_MSCL0P, "aclk_ahb2apb_mscl0p",
881 "usermux_aclk_mscl_532",
882 ENABLE_ACLK_MSCL, 15, 0, 0),
883 GATE(ACLK_AHB2APB_MSCL1P, "aclk_ahb2apb_mscl1p",
884 "usermux_aclk_mscl_532",
885 ENABLE_ACLK_MSCL, 14, 0, 0),
886
887 GATE(PCLK_MSCL_0, "pclk_mscl_0", "dout_pclk_mscl",
888 ENABLE_PCLK_MSCL, 31, 0, 0),
889 GATE(PCLK_MSCL_1, "pclk_mscl_1", "dout_pclk_mscl",
890 ENABLE_PCLK_MSCL, 30, 0, 0),
891 GATE(PCLK_JPEG, "pclk_jpeg", "dout_pclk_mscl",
892 ENABLE_PCLK_MSCL, 29, 0, 0),
893 GATE(PCLK_G2D, "pclk_g2d", "dout_pclk_mscl",
894 ENABLE_PCLK_MSCL, 28, 0, 0),
895 GATE(PCLK_QE_MSCL_0, "pclk_qe_mscl_0", "dout_pclk_mscl",
896 ENABLE_PCLK_MSCL, 27, 0, 0),
897 GATE(PCLK_QE_MSCL_1, "pclk_qe_mscl_1", "dout_pclk_mscl",
898 ENABLE_PCLK_MSCL, 26, 0, 0),
899 GATE(PCLK_QE_JPEG, "pclk_qe_jpeg", "dout_pclk_mscl",
900 ENABLE_PCLK_MSCL, 25, 0, 0),
901 GATE(PCLK_QE_G2D, "pclk_qe_g2d", "dout_pclk_mscl",
902 ENABLE_PCLK_MSCL, 24, 0, 0),
903 GATE(PCLK_PPMU_MSCL_0, "pclk_ppmu_mscl_0", "dout_pclk_mscl",
904 ENABLE_PCLK_MSCL, 23, 0, 0),
905 GATE(PCLK_PPMU_MSCL_1, "pclk_ppmu_mscl_1", "dout_pclk_mscl",
906 ENABLE_PCLK_MSCL, 22, 0, 0),
907 GATE(PCLK_AXI2ACEL_BRIDGE, "pclk_axi2acel_bridge", "dout_pclk_mscl",
908 ENABLE_PCLK_MSCL, 21, 0, 0),
909 GATE(PCLK_PMU_MSCL, "pclk_pmu_mscl", "dout_pclk_mscl",
910 ENABLE_PCLK_MSCL, 20, 0, 0),
911};
912
913static struct samsung_cmu_info mscl_cmu_info __initdata = {
914 .mux_clks = mscl_mux_clks,
915 .nr_mux_clks = ARRAY_SIZE(mscl_mux_clks),
916 .div_clks = mscl_div_clks,
917 .nr_div_clks = ARRAY_SIZE(mscl_div_clks),
918 .gate_clks = mscl_gate_clks,
919 .nr_gate_clks = ARRAY_SIZE(mscl_gate_clks),
920 .nr_clk_ids = MSCL_NR_CLK,
921 .clk_regs = mscl_clk_regs,
922 .nr_clk_regs = ARRAY_SIZE(mscl_clk_regs),
923};
924
925static void __init exynos7_clk_mscl_init(struct device_node *np)
926{
927 samsung_cmu_register_one(np, &mscl_cmu_info);
928}
929
930CLK_OF_DECLARE(exynos7_clk_mscl, "samsung,exynos7-clock-mscl",
931 exynos7_clk_mscl_init);