blob: 1c327d5de98cbc4c0f0a3dde25a6c4fb6ebb2843 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/*
2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 * Author: Chanwoo Choi <cw00.choi@samsung.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 * Common Clock Framework support for Exynos5433 SoC.
10 */
11
12#include <linux/clk-provider.h>
13#include <linux/of.h>
14#include <linux/of_address.h>
15
16#include <dt-bindings/clock/exynos5433.h>
17
18#include "clk.h"
19#include "clk-cpu.h"
20#include "clk-pll.h"
21
22/*
23 * Register offset definitions for CMU_TOP
24 */
25#define ISP_PLL_LOCK 0x0000
26#define AUD_PLL_LOCK 0x0004
27#define ISP_PLL_CON0 0x0100
28#define ISP_PLL_CON1 0x0104
29#define ISP_PLL_FREQ_DET 0x0108
30#define AUD_PLL_CON0 0x0110
31#define AUD_PLL_CON1 0x0114
32#define AUD_PLL_CON2 0x0118
33#define AUD_PLL_FREQ_DET 0x011c
34#define MUX_SEL_TOP0 0x0200
35#define MUX_SEL_TOP1 0x0204
36#define MUX_SEL_TOP2 0x0208
37#define MUX_SEL_TOP3 0x020c
38#define MUX_SEL_TOP4 0x0210
39#define MUX_SEL_TOP_MSCL 0x0220
40#define MUX_SEL_TOP_CAM1 0x0224
41#define MUX_SEL_TOP_DISP 0x0228
42#define MUX_SEL_TOP_FSYS0 0x0230
43#define MUX_SEL_TOP_FSYS1 0x0234
44#define MUX_SEL_TOP_PERIC0 0x0238
45#define MUX_SEL_TOP_PERIC1 0x023c
46#define MUX_ENABLE_TOP0 0x0300
47#define MUX_ENABLE_TOP1 0x0304
48#define MUX_ENABLE_TOP2 0x0308
49#define MUX_ENABLE_TOP3 0x030c
50#define MUX_ENABLE_TOP4 0x0310
51#define MUX_ENABLE_TOP_MSCL 0x0320
52#define MUX_ENABLE_TOP_CAM1 0x0324
53#define MUX_ENABLE_TOP_DISP 0x0328
54#define MUX_ENABLE_TOP_FSYS0 0x0330
55#define MUX_ENABLE_TOP_FSYS1 0x0334
56#define MUX_ENABLE_TOP_PERIC0 0x0338
57#define MUX_ENABLE_TOP_PERIC1 0x033c
58#define MUX_STAT_TOP0 0x0400
59#define MUX_STAT_TOP1 0x0404
60#define MUX_STAT_TOP2 0x0408
61#define MUX_STAT_TOP3 0x040c
62#define MUX_STAT_TOP4 0x0410
63#define MUX_STAT_TOP_MSCL 0x0420
64#define MUX_STAT_TOP_CAM1 0x0424
65#define MUX_STAT_TOP_FSYS0 0x0430
66#define MUX_STAT_TOP_FSYS1 0x0434
67#define MUX_STAT_TOP_PERIC0 0x0438
68#define MUX_STAT_TOP_PERIC1 0x043c
69#define DIV_TOP0 0x0600
70#define DIV_TOP1 0x0604
71#define DIV_TOP2 0x0608
72#define DIV_TOP3 0x060c
73#define DIV_TOP4 0x0610
74#define DIV_TOP_MSCL 0x0618
75#define DIV_TOP_CAM10 0x061c
76#define DIV_TOP_CAM11 0x0620
77#define DIV_TOP_FSYS0 0x062c
78#define DIV_TOP_FSYS1 0x0630
79#define DIV_TOP_FSYS2 0x0634
80#define DIV_TOP_PERIC0 0x0638
81#define DIV_TOP_PERIC1 0x063c
82#define DIV_TOP_PERIC2 0x0640
83#define DIV_TOP_PERIC3 0x0644
84#define DIV_TOP_PERIC4 0x0648
85#define DIV_TOP_PLL_FREQ_DET 0x064c
86#define DIV_STAT_TOP0 0x0700
87#define DIV_STAT_TOP1 0x0704
88#define DIV_STAT_TOP2 0x0708
89#define DIV_STAT_TOP3 0x070c
90#define DIV_STAT_TOP4 0x0710
91#define DIV_STAT_TOP_MSCL 0x0718
92#define DIV_STAT_TOP_CAM10 0x071c
93#define DIV_STAT_TOP_CAM11 0x0720
94#define DIV_STAT_TOP_FSYS0 0x072c
95#define DIV_STAT_TOP_FSYS1 0x0730
96#define DIV_STAT_TOP_FSYS2 0x0734
97#define DIV_STAT_TOP_PERIC0 0x0738
98#define DIV_STAT_TOP_PERIC1 0x073c
99#define DIV_STAT_TOP_PERIC2 0x0740
100#define DIV_STAT_TOP_PERIC3 0x0744
101#define DIV_STAT_TOP_PLL_FREQ_DET 0x074c
102#define ENABLE_ACLK_TOP 0x0800
103#define ENABLE_SCLK_TOP 0x0a00
104#define ENABLE_SCLK_TOP_MSCL 0x0a04
105#define ENABLE_SCLK_TOP_CAM1 0x0a08
106#define ENABLE_SCLK_TOP_DISP 0x0a0c
107#define ENABLE_SCLK_TOP_FSYS 0x0a10
108#define ENABLE_SCLK_TOP_PERIC 0x0a14
109#define ENABLE_IP_TOP 0x0b00
110#define ENABLE_CMU_TOP 0x0c00
111#define ENABLE_CMU_TOP_DIV_STAT 0x0c04
112
113static const unsigned long top_clk_regs[] __initconst = {
114 ISP_PLL_LOCK,
115 AUD_PLL_LOCK,
116 ISP_PLL_CON0,
117 ISP_PLL_CON1,
118 ISP_PLL_FREQ_DET,
119 AUD_PLL_CON0,
120 AUD_PLL_CON1,
121 AUD_PLL_CON2,
122 AUD_PLL_FREQ_DET,
123 MUX_SEL_TOP0,
124 MUX_SEL_TOP1,
125 MUX_SEL_TOP2,
126 MUX_SEL_TOP3,
127 MUX_SEL_TOP4,
128 MUX_SEL_TOP_MSCL,
129 MUX_SEL_TOP_CAM1,
130 MUX_SEL_TOP_DISP,
131 MUX_SEL_TOP_FSYS0,
132 MUX_SEL_TOP_FSYS1,
133 MUX_SEL_TOP_PERIC0,
134 MUX_SEL_TOP_PERIC1,
135 MUX_ENABLE_TOP0,
136 MUX_ENABLE_TOP1,
137 MUX_ENABLE_TOP2,
138 MUX_ENABLE_TOP3,
139 MUX_ENABLE_TOP4,
140 MUX_ENABLE_TOP_MSCL,
141 MUX_ENABLE_TOP_CAM1,
142 MUX_ENABLE_TOP_DISP,
143 MUX_ENABLE_TOP_FSYS0,
144 MUX_ENABLE_TOP_FSYS1,
145 MUX_ENABLE_TOP_PERIC0,
146 MUX_ENABLE_TOP_PERIC1,
147 DIV_TOP0,
148 DIV_TOP1,
149 DIV_TOP2,
150 DIV_TOP3,
151 DIV_TOP4,
152 DIV_TOP_MSCL,
153 DIV_TOP_CAM10,
154 DIV_TOP_CAM11,
155 DIV_TOP_FSYS0,
156 DIV_TOP_FSYS1,
157 DIV_TOP_FSYS2,
158 DIV_TOP_PERIC0,
159 DIV_TOP_PERIC1,
160 DIV_TOP_PERIC2,
161 DIV_TOP_PERIC3,
162 DIV_TOP_PERIC4,
163 DIV_TOP_PLL_FREQ_DET,
164 ENABLE_ACLK_TOP,
165 ENABLE_SCLK_TOP,
166 ENABLE_SCLK_TOP_MSCL,
167 ENABLE_SCLK_TOP_CAM1,
168 ENABLE_SCLK_TOP_DISP,
169 ENABLE_SCLK_TOP_FSYS,
170 ENABLE_SCLK_TOP_PERIC,
171 ENABLE_IP_TOP,
172 ENABLE_CMU_TOP,
173 ENABLE_CMU_TOP_DIV_STAT,
174};
175
176/* list of all parent clock list */
177PNAME(mout_aud_pll_p) = { "oscclk", "fout_aud_pll", };
178PNAME(mout_isp_pll_p) = { "oscclk", "fout_isp_pll", };
179PNAME(mout_aud_pll_user_p) = { "oscclk", "mout_aud_pll", };
180PNAME(mout_mphy_pll_user_p) = { "oscclk", "sclk_mphy_pll", };
181PNAME(mout_mfc_pll_user_p) = { "oscclk", "sclk_mfc_pll", };
182PNAME(mout_bus_pll_user_p) = { "oscclk", "sclk_bus_pll", };
183PNAME(mout_bus_pll_user_t_p) = { "oscclk", "mout_bus_pll_user", };
184PNAME(mout_mphy_pll_user_t_p) = { "oscclk", "mout_mphy_pll_user", };
185
186PNAME(mout_bus_mfc_pll_user_p) = { "mout_bus_pll_user", "mout_mfc_pll_user",};
187PNAME(mout_mfc_bus_pll_user_p) = { "mout_mfc_pll_user", "mout_bus_pll_user",};
188PNAME(mout_aclk_cam1_552_b_p) = { "mout_aclk_cam1_552_a",
189 "mout_mfc_pll_user", };
190PNAME(mout_aclk_cam1_552_a_p) = { "mout_isp_pll", "mout_bus_pll_user", };
191
192PNAME(mout_aclk_mfc_400_c_p) = { "mout_aclk_mfc_400_b",
193 "mout_mphy_pll_user", };
194PNAME(mout_aclk_mfc_400_b_p) = { "mout_aclk_mfc_400_a",
195 "mout_bus_pll_user", };
196PNAME(mout_aclk_mfc_400_a_p) = { "mout_mfc_pll_user", "mout_isp_pll", };
197
198PNAME(mout_bus_mphy_pll_user_p) = { "mout_bus_pll_user",
199 "mout_mphy_pll_user", };
200PNAME(mout_aclk_mscl_b_p) = { "mout_aclk_mscl_400_a",
201 "mout_mphy_pll_user", };
202PNAME(mout_aclk_g2d_400_b_p) = { "mout_aclk_g2d_400_a",
203 "mout_mphy_pll_user", };
204
205PNAME(mout_sclk_jpeg_c_p) = { "mout_sclk_jpeg_b", "mout_mphy_pll_user",};
206PNAME(mout_sclk_jpeg_b_p) = { "mout_sclk_jpeg_a", "mout_mfc_pll_user", };
207
208PNAME(mout_sclk_mmc2_b_p) = { "mout_sclk_mmc2_a", "mout_mfc_pll_user",};
209PNAME(mout_sclk_mmc1_b_p) = { "mout_sclk_mmc1_a", "mout_mfc_pll_user",};
210PNAME(mout_sclk_mmc0_d_p) = { "mout_sclk_mmc0_c", "mout_isp_pll", };
211PNAME(mout_sclk_mmc0_c_p) = { "mout_sclk_mmc0_b", "mout_mphy_pll_user",};
212PNAME(mout_sclk_mmc0_b_p) = { "mout_sclk_mmc0_a", "mout_mfc_pll_user", };
213
214PNAME(mout_sclk_spdif_p) = { "sclk_audio0", "sclk_audio1",
215 "oscclk", "ioclk_spdif_extclk", };
216PNAME(mout_sclk_audio1_p) = { "ioclk_audiocdclk1", "oscclk",
217 "mout_aud_pll_user_t",};
218PNAME(mout_sclk_audio0_p) = { "ioclk_audiocdclk0", "oscclk",
219 "mout_aud_pll_user_t",};
220
221PNAME(mout_sclk_hdmi_spdif_p) = { "sclk_audio1", "ioclk_spdif_extclk", };
222
223static const struct samsung_fixed_factor_clock top_fixed_factor_clks[] __initconst = {
224 FFACTOR(0, "oscclk_efuse_common", "oscclk", 1, 1, 0),
225};
226
227static const struct samsung_fixed_rate_clock top_fixed_clks[] __initconst = {
228 /* Xi2s{0|1}CDCLK input clock for I2S/PCM */
229 FRATE(0, "ioclk_audiocdclk1", NULL, 0, 100000000),
230 FRATE(0, "ioclk_audiocdclk0", NULL, 0, 100000000),
231 /* Xi2s1SDI input clock for SPDIF */
232 FRATE(0, "ioclk_spdif_extclk", NULL, 0, 100000000),
233 /* XspiCLK[4:0] input clock for SPI */
234 FRATE(0, "ioclk_spi4_clk_in", NULL, 0, 50000000),
235 FRATE(0, "ioclk_spi3_clk_in", NULL, 0, 50000000),
236 FRATE(0, "ioclk_spi2_clk_in", NULL, 0, 50000000),
237 FRATE(0, "ioclk_spi1_clk_in", NULL, 0, 50000000),
238 FRATE(0, "ioclk_spi0_clk_in", NULL, 0, 50000000),
239 /* Xi2s1SCLK input clock for I2S1_BCLK */
240 FRATE(0, "ioclk_i2s1_bclk_in", NULL, 0, 12288000),
241};
242
243static const struct samsung_mux_clock top_mux_clks[] __initconst = {
244 /* MUX_SEL_TOP0 */
245 MUX(CLK_MOUT_AUD_PLL, "mout_aud_pll", mout_aud_pll_p, MUX_SEL_TOP0,
246 4, 1),
247 MUX(CLK_MOUT_ISP_PLL, "mout_isp_pll", mout_isp_pll_p, MUX_SEL_TOP0,
248 0, 1),
249
250 /* MUX_SEL_TOP1 */
251 MUX(CLK_MOUT_AUD_PLL_USER_T, "mout_aud_pll_user_t",
252 mout_aud_pll_user_p, MUX_SEL_TOP1, 12, 1),
253 MUX(CLK_MOUT_MPHY_PLL_USER, "mout_mphy_pll_user", mout_mphy_pll_user_p,
254 MUX_SEL_TOP1, 8, 1),
255 MUX(CLK_MOUT_MFC_PLL_USER, "mout_mfc_pll_user", mout_mfc_pll_user_p,
256 MUX_SEL_TOP1, 4, 1),
257 MUX(CLK_MOUT_BUS_PLL_USER, "mout_bus_pll_user", mout_bus_pll_user_p,
258 MUX_SEL_TOP1, 0, 1),
259
260 /* MUX_SEL_TOP2 */
261 MUX(CLK_MOUT_ACLK_HEVC_400, "mout_aclk_hevc_400",
262 mout_bus_mfc_pll_user_p, MUX_SEL_TOP2, 28, 1),
263 MUX(CLK_MOUT_ACLK_CAM1_333, "mout_aclk_cam1_333",
264 mout_mfc_bus_pll_user_p, MUX_SEL_TOP2, 16, 1),
265 MUX(CLK_MOUT_ACLK_CAM1_552_B, "mout_aclk_cam1_552_b",
266 mout_aclk_cam1_552_b_p, MUX_SEL_TOP2, 12, 1),
267 MUX(CLK_MOUT_ACLK_CAM1_552_A, "mout_aclk_cam1_552_a",
268 mout_aclk_cam1_552_a_p, MUX_SEL_TOP2, 8, 1),
269 MUX(CLK_MOUT_ACLK_ISP_DIS_400, "mout_aclk_isp_dis_400",
270 mout_bus_mfc_pll_user_p, MUX_SEL_TOP2, 4, 1),
271 MUX(CLK_MOUT_ACLK_ISP_400, "mout_aclk_isp_400",
272 mout_bus_mfc_pll_user_p, MUX_SEL_TOP2, 0, 1),
273
274 /* MUX_SEL_TOP3 */
275 MUX(CLK_MOUT_ACLK_BUS0_400, "mout_aclk_bus0_400",
276 mout_bus_mphy_pll_user_p, MUX_SEL_TOP3, 20, 1),
277 MUX(CLK_MOUT_ACLK_MSCL_400_B, "mout_aclk_mscl_400_b",
278 mout_aclk_mscl_b_p, MUX_SEL_TOP3, 16, 1),
279 MUX(CLK_MOUT_ACLK_MSCL_400_A, "mout_aclk_mscl_400_a",
280 mout_bus_mfc_pll_user_p, MUX_SEL_TOP3, 12, 1),
281 MUX(CLK_MOUT_ACLK_GSCL_333, "mout_aclk_gscl_333",
282 mout_mfc_bus_pll_user_p, MUX_SEL_TOP3, 8, 1),
283 MUX(CLK_MOUT_ACLK_G2D_400_B, "mout_aclk_g2d_400_b",
284 mout_aclk_g2d_400_b_p, MUX_SEL_TOP3, 4, 1),
285 MUX(CLK_MOUT_ACLK_G2D_400_A, "mout_aclk_g2d_400_a",
286 mout_bus_mfc_pll_user_p, MUX_SEL_TOP3, 0, 1),
287
288 /* MUX_SEL_TOP4 */
289 MUX(CLK_MOUT_ACLK_MFC_400_C, "mout_aclk_mfc_400_c",
290 mout_aclk_mfc_400_c_p, MUX_SEL_TOP4, 8, 1),
291 MUX(CLK_MOUT_ACLK_MFC_400_B, "mout_aclk_mfc_400_b",
292 mout_aclk_mfc_400_b_p, MUX_SEL_TOP4, 4, 1),
293 MUX(CLK_MOUT_ACLK_MFC_400_A, "mout_aclk_mfc_400_a",
294 mout_aclk_mfc_400_a_p, MUX_SEL_TOP4, 0, 1),
295
296 /* MUX_SEL_TOP_MSCL */
297 MUX(CLK_MOUT_SCLK_JPEG_C, "mout_sclk_jpeg_c", mout_sclk_jpeg_c_p,
298 MUX_SEL_TOP_MSCL, 8, 1),
299 MUX(CLK_MOUT_SCLK_JPEG_B, "mout_sclk_jpeg_b", mout_sclk_jpeg_b_p,
300 MUX_SEL_TOP_MSCL, 4, 1),
301 MUX(CLK_MOUT_SCLK_JPEG_A, "mout_sclk_jpeg_a", mout_bus_pll_user_t_p,
302 MUX_SEL_TOP_MSCL, 0, 1),
303
304 /* MUX_SEL_TOP_CAM1 */
305 MUX(CLK_MOUT_SCLK_ISP_SENSOR2, "mout_sclk_isp_sensor2",
306 mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 24, 1),
307 MUX(CLK_MOUT_SCLK_ISP_SENSOR1, "mout_sclk_isp_sensor1",
308 mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 20, 1),
309 MUX(CLK_MOUT_SCLK_ISP_SENSOR0, "mout_sclk_isp_sensor0",
310 mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 16, 1),
311 MUX(CLK_MOUT_SCLK_ISP_UART, "mout_sclk_isp_uart",
312 mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 8, 1),
313 MUX(CLK_MOUT_SCLK_ISP_SPI1, "mout_sclk_isp_spi1",
314 mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 4, 1),
315 MUX(CLK_MOUT_SCLK_ISP_SPI0, "mout_sclk_isp_spi0",
316 mout_bus_pll_user_t_p, MUX_SEL_TOP_CAM1, 0, 1),
317
318 /* MUX_SEL_TOP_FSYS0 */
319 MUX(CLK_MOUT_SCLK_MMC2_B, "mout_sclk_mmc2_b", mout_sclk_mmc2_b_p,
320 MUX_SEL_TOP_FSYS0, 28, 1),
321 MUX(CLK_MOUT_SCLK_MMC2_A, "mout_sclk_mmc2_a", mout_bus_pll_user_t_p,
322 MUX_SEL_TOP_FSYS0, 24, 1),
323 MUX(CLK_MOUT_SCLK_MMC1_B, "mout_sclk_mmc1_b", mout_sclk_mmc1_b_p,
324 MUX_SEL_TOP_FSYS0, 20, 1),
325 MUX(CLK_MOUT_SCLK_MMC1_A, "mout_sclk_mmc1_a", mout_bus_pll_user_t_p,
326 MUX_SEL_TOP_FSYS0, 16, 1),
327 MUX(CLK_MOUT_SCLK_MMC0_D, "mout_sclk_mmc0_d", mout_sclk_mmc0_d_p,
328 MUX_SEL_TOP_FSYS0, 12, 1),
329 MUX(CLK_MOUT_SCLK_MMC0_C, "mout_sclk_mmc0_c", mout_sclk_mmc0_c_p,
330 MUX_SEL_TOP_FSYS0, 8, 1),
331 MUX(CLK_MOUT_SCLK_MMC0_B, "mout_sclk_mmc0_b", mout_sclk_mmc0_b_p,
332 MUX_SEL_TOP_FSYS0, 4, 1),
333 MUX(CLK_MOUT_SCLK_MMC0_A, "mout_sclk_mmc0_a", mout_bus_pll_user_t_p,
334 MUX_SEL_TOP_FSYS0, 0, 1),
335
336 /* MUX_SEL_TOP_FSYS1 */
337 MUX(CLK_MOUT_SCLK_PCIE_100, "mout_sclk_pcie_100", mout_bus_pll_user_t_p,
338 MUX_SEL_TOP_FSYS1, 12, 1),
339 MUX(CLK_MOUT_SCLK_UFSUNIPRO, "mout_sclk_ufsunipro",
340 mout_mphy_pll_user_t_p, MUX_SEL_TOP_FSYS1, 8, 1),
341 MUX(CLK_MOUT_SCLK_USBHOST30, "mout_sclk_usbhost30",
342 mout_bus_pll_user_t_p, MUX_SEL_TOP_FSYS1, 4, 1),
343 MUX(CLK_MOUT_SCLK_USBDRD30, "mout_sclk_usbdrd30",
344 mout_bus_pll_user_t_p, MUX_SEL_TOP_FSYS1, 0, 1),
345
346 /* MUX_SEL_TOP_PERIC0 */
347 MUX(CLK_MOUT_SCLK_SPI4, "mout_sclk_spi4", mout_bus_pll_user_t_p,
348 MUX_SEL_TOP_PERIC0, 28, 1),
349 MUX(CLK_MOUT_SCLK_SPI3, "mout_sclk_spi3", mout_bus_pll_user_t_p,
350 MUX_SEL_TOP_PERIC0, 24, 1),
351 MUX(CLK_MOUT_SCLK_UART2, "mout_sclk_uart2", mout_bus_pll_user_t_p,
352 MUX_SEL_TOP_PERIC0, 20, 1),
353 MUX(CLK_MOUT_SCLK_UART1, "mout_sclk_uart1", mout_bus_pll_user_t_p,
354 MUX_SEL_TOP_PERIC0, 16, 1),
355 MUX(CLK_MOUT_SCLK_UART0, "mout_sclk_uart0", mout_bus_pll_user_t_p,
356 MUX_SEL_TOP_PERIC0, 12, 1),
357 MUX(CLK_MOUT_SCLK_SPI2, "mout_sclk_spi2", mout_bus_pll_user_t_p,
358 MUX_SEL_TOP_PERIC0, 8, 1),
359 MUX(CLK_MOUT_SCLK_SPI1, "mout_sclk_spi1", mout_bus_pll_user_t_p,
360 MUX_SEL_TOP_PERIC0, 4, 1),
361 MUX(CLK_MOUT_SCLK_SPI0, "mout_sclk_spi0", mout_bus_pll_user_t_p,
362 MUX_SEL_TOP_PERIC0, 0, 1),
363
364 /* MUX_SEL_TOP_PERIC1 */
365 MUX(CLK_MOUT_SCLK_SLIMBUS, "mout_sclk_slimbus", mout_aud_pll_user_p,
366 MUX_SEL_TOP_PERIC1, 16, 1),
367 MUX(CLK_MOUT_SCLK_SPDIF, "mout_sclk_spdif", mout_sclk_spdif_p,
368 MUX_SEL_TOP_PERIC1, 12, 2),
369 MUX(CLK_MOUT_SCLK_AUDIO1, "mout_sclk_audio1", mout_sclk_audio1_p,
370 MUX_SEL_TOP_PERIC1, 4, 2),
371 MUX(CLK_MOUT_SCLK_AUDIO0, "mout_sclk_audio0", mout_sclk_audio0_p,
372 MUX_SEL_TOP_PERIC1, 0, 2),
373
374 /* MUX_SEL_TOP_DISP */
375 MUX(CLK_MOUT_SCLK_HDMI_SPDIF, "mout_sclk_hdmi_spdif",
376 mout_sclk_hdmi_spdif_p, MUX_SEL_TOP_DISP, 0, 1),
377};
378
379static const struct samsung_div_clock top_div_clks[] __initconst = {
380 /* DIV_TOP0 */
381 DIV(CLK_DIV_ACLK_CAM1_333, "div_aclk_cam1_333", "mout_aclk_cam1_333",
382 DIV_TOP0, 28, 3),
383 DIV(CLK_DIV_ACLK_CAM1_400, "div_aclk_cam1_400", "mout_bus_pll_user",
384 DIV_TOP0, 24, 3),
385 DIV(CLK_DIV_ACLK_CAM1_552, "div_aclk_cam1_552", "mout_aclk_cam1_552_b",
386 DIV_TOP0, 20, 3),
387 DIV(CLK_DIV_ACLK_CAM0_333, "div_aclk_cam0_333", "mout_mfc_pll_user",
388 DIV_TOP0, 16, 3),
389 DIV(CLK_DIV_ACLK_CAM0_400, "div_aclk_cam0_400", "mout_bus_pll_user",
390 DIV_TOP0, 12, 3),
391 DIV(CLK_DIV_ACLK_CAM0_552, "div_aclk_cam0_552", "mout_isp_pll",
392 DIV_TOP0, 8, 3),
393 DIV(CLK_DIV_ACLK_ISP_DIS_400, "div_aclk_isp_dis_400",
394 "mout_aclk_isp_dis_400", DIV_TOP0, 4, 4),
395 DIV(CLK_DIV_ACLK_ISP_400, "div_aclk_isp_400",
396 "mout_aclk_isp_400", DIV_TOP0, 0, 4),
397
398 /* DIV_TOP1 */
399 DIV(CLK_DIV_ACLK_GSCL_111, "div_aclk_gscl_111", "mout_aclk_gscl_333",
400 DIV_TOP1, 28, 3),
401 DIV(CLK_DIV_ACLK_GSCL_333, "div_aclk_gscl_333", "mout_aclk_gscl_333",
402 DIV_TOP1, 24, 3),
403 DIV(CLK_DIV_ACLK_HEVC_400, "div_aclk_hevc_400", "mout_aclk_hevc_400",
404 DIV_TOP1, 20, 3),
405 DIV(CLK_DIV_ACLK_MFC_400, "div_aclk_mfc_400", "mout_aclk_mfc_400_c",
406 DIV_TOP1, 12, 3),
407 DIV(CLK_DIV_ACLK_G2D_266, "div_aclk_g2d_266", "mout_bus_pll_user",
408 DIV_TOP1, 8, 3),
409 DIV(CLK_DIV_ACLK_G2D_400, "div_aclk_g2d_400", "mout_aclk_g2d_400_b",
410 DIV_TOP1, 0, 3),
411
412 /* DIV_TOP2 */
413 DIV(CLK_DIV_ACLK_MSCL_400, "div_aclk_mscl_400", "mout_aclk_mscl_400_b",
414 DIV_TOP2, 4, 3),
415 DIV(CLK_DIV_ACLK_FSYS_200, "div_aclk_fsys_200", "mout_bus_pll_user",
416 DIV_TOP2, 0, 3),
417
418 /* DIV_TOP3 */
419 DIV(CLK_DIV_ACLK_IMEM_SSSX_266, "div_aclk_imem_sssx_266",
420 "mout_bus_pll_user", DIV_TOP3, 24, 3),
421 DIV(CLK_DIV_ACLK_IMEM_200, "div_aclk_imem_200",
422 "mout_bus_pll_user", DIV_TOP3, 20, 3),
423 DIV(CLK_DIV_ACLK_IMEM_266, "div_aclk_imem_266",
424 "mout_bus_pll_user", DIV_TOP3, 16, 3),
425 DIV(CLK_DIV_ACLK_PERIC_66_B, "div_aclk_peric_66_b",
426 "div_aclk_peric_66_a", DIV_TOP3, 12, 3),
427 DIV(CLK_DIV_ACLK_PERIC_66_A, "div_aclk_peric_66_a",
428 "mout_bus_pll_user", DIV_TOP3, 8, 3),
429 DIV(CLK_DIV_ACLK_PERIS_66_B, "div_aclk_peris_66_b",
430 "div_aclk_peris_66_a", DIV_TOP3, 4, 3),
431 DIV(CLK_DIV_ACLK_PERIS_66_A, "div_aclk_peris_66_a",
432 "mout_bus_pll_user", DIV_TOP3, 0, 3),
433
434 /* DIV_TOP4 */
435 DIV(CLK_DIV_ACLK_G3D_400, "div_aclk_g3d_400", "mout_bus_pll_user",
436 DIV_TOP4, 8, 3),
437 DIV(CLK_DIV_ACLK_BUS0_400, "div_aclk_bus0_400", "mout_aclk_bus0_400",
438 DIV_TOP4, 4, 3),
439 DIV(CLK_DIV_ACLK_BUS1_400, "div_aclk_bus1_400", "mout_bus_pll_user",
440 DIV_TOP4, 0, 3),
441
442 /* DIV_TOP_MSCL */
443 DIV(CLK_DIV_SCLK_JPEG, "div_sclk_jpeg", "mout_sclk_jpeg_c",
444 DIV_TOP_MSCL, 0, 4),
445
446 /* DIV_TOP_CAM10 */
447 DIV(CLK_DIV_SCLK_ISP_UART, "div_sclk_isp_uart", "mout_sclk_isp_uart",
448 DIV_TOP_CAM10, 24, 5),
449 DIV(CLK_DIV_SCLK_ISP_SPI1_B, "div_sclk_isp_spi1_b",
450 "div_sclk_isp_spi1_a", DIV_TOP_CAM10, 16, 8),
451 DIV(CLK_DIV_SCLK_ISP_SPI1_A, "div_sclk_isp_spi1_a",
452 "mout_sclk_isp_spi1", DIV_TOP_CAM10, 12, 4),
453 DIV(CLK_DIV_SCLK_ISP_SPI0_B, "div_sclk_isp_spi0_b",
454 "div_sclk_isp_spi0_a", DIV_TOP_CAM10, 4, 8),
455 DIV(CLK_DIV_SCLK_ISP_SPI0_A, "div_sclk_isp_spi0_a",
456 "mout_sclk_isp_spi0", DIV_TOP_CAM10, 0, 4),
457
458 /* DIV_TOP_CAM11 */
459 DIV(CLK_DIV_SCLK_ISP_SENSOR2_B, "div_sclk_isp_sensor2_b",
460 "div_sclk_isp_sensor2_a", DIV_TOP_CAM11, 20, 4),
461 DIV(CLK_DIV_SCLK_ISP_SENSOR2_A, "div_sclk_isp_sensor2_a",
462 "mout_sclk_isp_sensor2", DIV_TOP_CAM11, 16, 4),
463 DIV(CLK_DIV_SCLK_ISP_SENSOR1_B, "div_sclk_isp_sensor1_b",
464 "div_sclk_isp_sensor1_a", DIV_TOP_CAM11, 12, 4),
465 DIV(CLK_DIV_SCLK_ISP_SENSOR1_A, "div_sclk_isp_sensor1_a",
466 "mout_sclk_isp_sensor1", DIV_TOP_CAM11, 8, 4),
467 DIV(CLK_DIV_SCLK_ISP_SENSOR0_B, "div_sclk_isp_sensor0_b",
468 "div_sclk_isp_sensor0_a", DIV_TOP_CAM11, 4, 4),
469 DIV(CLK_DIV_SCLK_ISP_SENSOR0_A, "div_sclk_isp_sensor0_a",
470 "mout_sclk_isp_sensor0", DIV_TOP_CAM11, 0, 4),
471
472 /* DIV_TOP_FSYS0 */
473 DIV(CLK_DIV_SCLK_MMC1_B, "div_sclk_mmc1_b", "div_sclk_mmc1_a",
474 DIV_TOP_FSYS0, 16, 8),
475 DIV(CLK_DIV_SCLK_MMC1_A, "div_sclk_mmc1_a", "mout_sclk_mmc1_b",
476 DIV_TOP_FSYS0, 12, 4),
477 DIV_F(CLK_DIV_SCLK_MMC0_B, "div_sclk_mmc0_b", "div_sclk_mmc0_a",
478 DIV_TOP_FSYS0, 4, 8, CLK_SET_RATE_PARENT, 0),
479 DIV_F(CLK_DIV_SCLK_MMC0_A, "div_sclk_mmc0_a", "mout_sclk_mmc0_d",
480 DIV_TOP_FSYS0, 0, 4, CLK_SET_RATE_PARENT, 0),
481
482 /* DIV_TOP_FSYS1 */
483 DIV(CLK_DIV_SCLK_MMC2_B, "div_sclk_mmc2_b", "div_sclk_mmc2_a",
484 DIV_TOP_FSYS1, 4, 8),
485 DIV(CLK_DIV_SCLK_MMC2_A, "div_sclk_mmc2_a", "mout_sclk_mmc2_b",
486 DIV_TOP_FSYS1, 0, 4),
487
488 /* DIV_TOP_FSYS2 */
489 DIV(CLK_DIV_SCLK_PCIE_100, "div_sclk_pcie_100", "mout_sclk_pcie_100",
490 DIV_TOP_FSYS2, 12, 3),
491 DIV(CLK_DIV_SCLK_USBHOST30, "div_sclk_usbhost30",
492 "mout_sclk_usbhost30", DIV_TOP_FSYS2, 8, 4),
493 DIV(CLK_DIV_SCLK_UFSUNIPRO, "div_sclk_ufsunipro",
494 "mout_sclk_ufsunipro", DIV_TOP_FSYS2, 4, 4),
495 DIV(CLK_DIV_SCLK_USBDRD30, "div_sclk_usbdrd30", "mout_sclk_usbdrd30",
496 DIV_TOP_FSYS2, 0, 4),
497
498 /* DIV_TOP_PERIC0 */
499 DIV(CLK_DIV_SCLK_SPI1_B, "div_sclk_spi1_b", "div_sclk_spi1_a",
500 DIV_TOP_PERIC0, 16, 8),
501 DIV(CLK_DIV_SCLK_SPI1_A, "div_sclk_spi1_a", "mout_sclk_spi1",
502 DIV_TOP_PERIC0, 12, 4),
503 DIV(CLK_DIV_SCLK_SPI0_B, "div_sclk_spi0_b", "div_sclk_spi0_a",
504 DIV_TOP_PERIC0, 4, 8),
505 DIV(CLK_DIV_SCLK_SPI0_A, "div_sclk_spi0_a", "mout_sclk_spi0",
506 DIV_TOP_PERIC0, 0, 4),
507
508 /* DIV_TOP_PERIC1 */
509 DIV(CLK_DIV_SCLK_SPI2_B, "div_sclk_spi2_b", "div_sclk_spi2_a",
510 DIV_TOP_PERIC1, 4, 8),
511 DIV(CLK_DIV_SCLK_SPI2_A, "div_sclk_spi2_a", "mout_sclk_spi2",
512 DIV_TOP_PERIC1, 0, 4),
513
514 /* DIV_TOP_PERIC2 */
515 DIV(CLK_DIV_SCLK_UART2, "div_sclk_uart2", "mout_sclk_uart2",
516 DIV_TOP_PERIC2, 8, 4),
517 DIV(CLK_DIV_SCLK_UART1, "div_sclk_uart1", "mout_sclk_uart0",
518 DIV_TOP_PERIC2, 4, 4),
519 DIV(CLK_DIV_SCLK_UART0, "div_sclk_uart0", "mout_sclk_uart1",
520 DIV_TOP_PERIC2, 0, 4),
521
522 /* DIV_TOP_PERIC3 */
523 DIV(CLK_DIV_SCLK_I2S1, "div_sclk_i2s1", "sclk_audio1",
524 DIV_TOP_PERIC3, 16, 6),
525 DIV(CLK_DIV_SCLK_PCM1, "div_sclk_pcm1", "sclk_audio1",
526 DIV_TOP_PERIC3, 8, 8),
527 DIV(CLK_DIV_SCLK_AUDIO1, "div_sclk_audio1", "mout_sclk_audio1",
528 DIV_TOP_PERIC3, 4, 4),
529 DIV(CLK_DIV_SCLK_AUDIO0, "div_sclk_audio0", "mout_sclk_audio0",
530 DIV_TOP_PERIC3, 0, 4),
531
532 /* DIV_TOP_PERIC4 */
533 DIV(CLK_DIV_SCLK_SPI4_B, "div_sclk_spi4_b", "div_sclk_spi4_a",
534 DIV_TOP_PERIC4, 16, 8),
535 DIV(CLK_DIV_SCLK_SPI4_A, "div_sclk_spi4_a", "mout_sclk_spi4",
536 DIV_TOP_PERIC4, 12, 4),
537 DIV(CLK_DIV_SCLK_SPI3_B, "div_sclk_spi3_b", "div_sclk_spi3_a",
538 DIV_TOP_PERIC4, 4, 8),
539 DIV(CLK_DIV_SCLK_SPI3_A, "div_sclk_spi3_a", "mout_sclk_spi3",
540 DIV_TOP_PERIC4, 0, 4),
541};
542
543static const struct samsung_gate_clock top_gate_clks[] __initconst = {
544 /* ENABLE_ACLK_TOP */
545 GATE(CLK_ACLK_G3D_400, "aclk_g3d_400", "div_aclk_g3d_400",
546 ENABLE_ACLK_TOP, 30, CLK_IS_CRITICAL, 0),
547 GATE(CLK_ACLK_IMEM_SSX_266, "aclk_imem_ssx_266",
548 "div_aclk_imem_sssx_266", ENABLE_ACLK_TOP,
549 29, CLK_IGNORE_UNUSED, 0),
550 GATE(CLK_ACLK_BUS0_400, "aclk_bus0_400", "div_aclk_bus0_400",
551 ENABLE_ACLK_TOP, 26,
552 CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
553 GATE(CLK_ACLK_BUS1_400, "aclk_bus1_400", "div_aclk_bus1_400",
554 ENABLE_ACLK_TOP, 25,
555 CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
556 GATE(CLK_ACLK_IMEM_200, "aclk_imem_200", "div_aclk_imem_266",
557 ENABLE_ACLK_TOP, 24,
558 CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
559 GATE(CLK_ACLK_IMEM_266, "aclk_imem_266", "div_aclk_imem_200",
560 ENABLE_ACLK_TOP, 23,
561 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
562 GATE(CLK_ACLK_PERIC_66, "aclk_peric_66", "div_aclk_peric_66_b",
563 ENABLE_ACLK_TOP, 22,
564 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
565 GATE(CLK_ACLK_PERIS_66, "aclk_peris_66", "div_aclk_peris_66_b",
566 ENABLE_ACLK_TOP, 21,
567 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
568 GATE(CLK_ACLK_MSCL_400, "aclk_mscl_400", "div_aclk_mscl_400",
569 ENABLE_ACLK_TOP, 19,
570 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
571 GATE(CLK_ACLK_FSYS_200, "aclk_fsys_200", "div_aclk_fsys_200",
572 ENABLE_ACLK_TOP, 18,
573 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
574 GATE(CLK_ACLK_GSCL_111, "aclk_gscl_111", "div_aclk_gscl_111",
575 ENABLE_ACLK_TOP, 15,
576 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
577 GATE(CLK_ACLK_GSCL_333, "aclk_gscl_333", "div_aclk_gscl_333",
578 ENABLE_ACLK_TOP, 14,
579 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
580 GATE(CLK_ACLK_CAM1_333, "aclk_cam1_333", "div_aclk_cam1_333",
581 ENABLE_ACLK_TOP, 13,
582 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
583 GATE(CLK_ACLK_CAM1_400, "aclk_cam1_400", "div_aclk_cam1_400",
584 ENABLE_ACLK_TOP, 12,
585 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
586 GATE(CLK_ACLK_CAM1_552, "aclk_cam1_552", "div_aclk_cam1_552",
587 ENABLE_ACLK_TOP, 11,
588 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
589 GATE(CLK_ACLK_CAM0_333, "aclk_cam0_333", "div_aclk_cam0_333",
590 ENABLE_ACLK_TOP, 10,
591 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
592 GATE(CLK_ACLK_CAM0_400, "aclk_cam0_400", "div_aclk_cam0_400",
593 ENABLE_ACLK_TOP, 9,
594 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
595 GATE(CLK_ACLK_CAM0_552, "aclk_cam0_552", "div_aclk_cam0_552",
596 ENABLE_ACLK_TOP, 8,
597 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
598 GATE(CLK_ACLK_ISP_DIS_400, "aclk_isp_dis_400", "div_aclk_isp_dis_400",
599 ENABLE_ACLK_TOP, 7,
600 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
601 GATE(CLK_ACLK_ISP_400, "aclk_isp_400", "div_aclk_isp_400",
602 ENABLE_ACLK_TOP, 6,
603 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
604 GATE(CLK_ACLK_HEVC_400, "aclk_hevc_400", "div_aclk_hevc_400",
605 ENABLE_ACLK_TOP, 5,
606 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
607 GATE(CLK_ACLK_MFC_400, "aclk_mfc_400", "div_aclk_mfc_400",
608 ENABLE_ACLK_TOP, 3,
609 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
610 GATE(CLK_ACLK_G2D_266, "aclk_g2d_266", "div_aclk_g2d_266",
611 ENABLE_ACLK_TOP, 2,
612 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
613 GATE(CLK_ACLK_G2D_400, "aclk_g2d_400", "div_aclk_g2d_400",
614 ENABLE_ACLK_TOP, 0,
615 CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0),
616
617 /* ENABLE_SCLK_TOP_MSCL */
618 GATE(CLK_SCLK_JPEG_MSCL, "sclk_jpeg_mscl", "div_sclk_jpeg",
619 ENABLE_SCLK_TOP_MSCL, 0, CLK_SET_RATE_PARENT, 0),
620
621 /* ENABLE_SCLK_TOP_CAM1 */
622 GATE(CLK_SCLK_ISP_SENSOR2, "sclk_isp_sensor2", "div_sclk_isp_sensor2_b",
623 ENABLE_SCLK_TOP_CAM1, 7, 0, 0),
624 GATE(CLK_SCLK_ISP_SENSOR1, "sclk_isp_sensor1", "div_sclk_isp_sensor1_b",
625 ENABLE_SCLK_TOP_CAM1, 6, 0, 0),
626 GATE(CLK_SCLK_ISP_SENSOR0, "sclk_isp_sensor0", "div_sclk_isp_sensor0_b",
627 ENABLE_SCLK_TOP_CAM1, 5, 0, 0),
628 GATE(CLK_SCLK_ISP_MCTADC_CAM1, "sclk_isp_mctadc_cam1", "oscclk",
629 ENABLE_SCLK_TOP_CAM1, 4, 0, 0),
630 GATE(CLK_SCLK_ISP_UART_CAM1, "sclk_isp_uart_cam1", "div_sclk_isp_uart",
631 ENABLE_SCLK_TOP_CAM1, 2, 0, 0),
632 GATE(CLK_SCLK_ISP_SPI1_CAM1, "sclk_isp_spi1_cam1", "div_sclk_isp_spi1_b",
633 ENABLE_SCLK_TOP_CAM1, 1, 0, 0),
634 GATE(CLK_SCLK_ISP_SPI0_CAM1, "sclk_isp_spi0_cam1", "div_sclk_isp_spi0_b",
635 ENABLE_SCLK_TOP_CAM1, 0, 0, 0),
636
637 /* ENABLE_SCLK_TOP_DISP */
638 GATE(CLK_SCLK_HDMI_SPDIF_DISP, "sclk_hdmi_spdif_disp",
639 "mout_sclk_hdmi_spdif", ENABLE_SCLK_TOP_DISP, 0,
640 CLK_IGNORE_UNUSED, 0),
641
642 /* ENABLE_SCLK_TOP_FSYS */
643 GATE(CLK_SCLK_PCIE_100_FSYS, "sclk_pcie_100_fsys", "div_sclk_pcie_100",
644 ENABLE_SCLK_TOP_FSYS, 7, CLK_IGNORE_UNUSED, 0),
645 GATE(CLK_SCLK_MMC2_FSYS, "sclk_mmc2_fsys", "div_sclk_mmc2_b",
646 ENABLE_SCLK_TOP_FSYS, 6, CLK_SET_RATE_PARENT, 0),
647 GATE(CLK_SCLK_MMC1_FSYS, "sclk_mmc1_fsys", "div_sclk_mmc1_b",
648 ENABLE_SCLK_TOP_FSYS, 5, CLK_SET_RATE_PARENT, 0),
649 GATE(CLK_SCLK_MMC0_FSYS, "sclk_mmc0_fsys", "div_sclk_mmc0_b",
650 ENABLE_SCLK_TOP_FSYS, 4, CLK_SET_RATE_PARENT, 0),
651 GATE(CLK_SCLK_UFSUNIPRO_FSYS, "sclk_ufsunipro_fsys",
652 "div_sclk_ufsunipro", ENABLE_SCLK_TOP_FSYS,
653 3, CLK_SET_RATE_PARENT, 0),
654 GATE(CLK_SCLK_USBHOST30_FSYS, "sclk_usbhost30_fsys",
655 "div_sclk_usbhost30", ENABLE_SCLK_TOP_FSYS,
656 1, CLK_SET_RATE_PARENT, 0),
657 GATE(CLK_SCLK_USBDRD30_FSYS, "sclk_usbdrd30_fsys",
658 "div_sclk_usbdrd30", ENABLE_SCLK_TOP_FSYS,
659 0, CLK_SET_RATE_PARENT, 0),
660
661 /* ENABLE_SCLK_TOP_PERIC */
662 GATE(CLK_SCLK_SPI4_PERIC, "sclk_spi4_peric", "div_sclk_spi4_b",
663 ENABLE_SCLK_TOP_PERIC, 12, CLK_SET_RATE_PARENT, 0),
664 GATE(CLK_SCLK_SPI3_PERIC, "sclk_spi3_peric", "div_sclk_spi3_b",
665 ENABLE_SCLK_TOP_PERIC, 11, CLK_SET_RATE_PARENT, 0),
666 GATE(CLK_SCLK_SPDIF_PERIC, "sclk_spdif_peric", "mout_sclk_spdif",
667 ENABLE_SCLK_TOP_PERIC, 9, CLK_SET_RATE_PARENT, 0),
668 GATE(CLK_SCLK_I2S1_PERIC, "sclk_i2s1_peric", "div_sclk_i2s1",
669 ENABLE_SCLK_TOP_PERIC, 8, CLK_SET_RATE_PARENT, 0),
670 GATE(CLK_SCLK_PCM1_PERIC, "sclk_pcm1_peric", "div_sclk_pcm1",
671 ENABLE_SCLK_TOP_PERIC, 7, CLK_SET_RATE_PARENT, 0),
672 GATE(CLK_SCLK_UART2_PERIC, "sclk_uart2_peric", "div_sclk_uart2",
673 ENABLE_SCLK_TOP_PERIC, 5, CLK_SET_RATE_PARENT |
674 CLK_IGNORE_UNUSED, 0),
675 GATE(CLK_SCLK_UART1_PERIC, "sclk_uart1_peric", "div_sclk_uart1",
676 ENABLE_SCLK_TOP_PERIC, 4, CLK_SET_RATE_PARENT |
677 CLK_IGNORE_UNUSED, 0),
678 GATE(CLK_SCLK_UART0_PERIC, "sclk_uart0_peric", "div_sclk_uart0",
679 ENABLE_SCLK_TOP_PERIC, 3, CLK_SET_RATE_PARENT |
680 CLK_IGNORE_UNUSED, 0),
681 GATE(CLK_SCLK_SPI2_PERIC, "sclk_spi2_peric", "div_sclk_spi2_b",
682 ENABLE_SCLK_TOP_PERIC, 2, CLK_SET_RATE_PARENT, 0),
683 GATE(CLK_SCLK_SPI1_PERIC, "sclk_spi1_peric", "div_sclk_spi1_b",
684 ENABLE_SCLK_TOP_PERIC, 1, CLK_SET_RATE_PARENT, 0),
685 GATE(CLK_SCLK_SPI0_PERIC, "sclk_spi0_peric", "div_sclk_spi0_b",
686 ENABLE_SCLK_TOP_PERIC, 0, CLK_SET_RATE_PARENT, 0),
687
688 /* MUX_ENABLE_TOP_PERIC1 */
689 GATE(CLK_SCLK_SLIMBUS, "sclk_slimbus", "mout_sclk_slimbus",
690 MUX_ENABLE_TOP_PERIC1, 16, 0, 0),
691 GATE(CLK_SCLK_AUDIO1, "sclk_audio1", "div_sclk_audio1",
692 MUX_ENABLE_TOP_PERIC1, 4, 0, 0),
693 GATE(CLK_SCLK_AUDIO0, "sclk_audio0", "div_sclk_audio0",
694 MUX_ENABLE_TOP_PERIC1, 0, 0, 0),
695};
696
697/*
698 * ATLAS_PLL & APOLLO_PLL & MEM0_PLL & MEM1_PLL & BUS_PLL & MFC_PLL
699 * & MPHY_PLL & G3D_PLL & DISP_PLL & ISP_PLL
700 */
701static const struct samsung_pll_rate_table exynos5433_pll_rates[] __initconst = {
702 PLL_35XX_RATE(2500000000U, 625, 6, 0),
703 PLL_35XX_RATE(2400000000U, 500, 5, 0),
704 PLL_35XX_RATE(2300000000U, 575, 6, 0),
705 PLL_35XX_RATE(2200000000U, 550, 6, 0),
706 PLL_35XX_RATE(2100000000U, 350, 4, 0),
707 PLL_35XX_RATE(2000000000U, 500, 6, 0),
708 PLL_35XX_RATE(1900000000U, 475, 6, 0),
709 PLL_35XX_RATE(1800000000U, 375, 5, 0),
710 PLL_35XX_RATE(1700000000U, 425, 6, 0),
711 PLL_35XX_RATE(1600000000U, 400, 6, 0),
712 PLL_35XX_RATE(1500000000U, 250, 4, 0),
713 PLL_35XX_RATE(1400000000U, 350, 6, 0),
714 PLL_35XX_RATE(1332000000U, 222, 4, 0),
715 PLL_35XX_RATE(1300000000U, 325, 6, 0),
716 PLL_35XX_RATE(1200000000U, 500, 5, 1),
717 PLL_35XX_RATE(1100000000U, 550, 6, 1),
718 PLL_35XX_RATE(1086000000U, 362, 4, 1),
719 PLL_35XX_RATE(1066000000U, 533, 6, 1),
720 PLL_35XX_RATE(1000000000U, 500, 6, 1),
721 PLL_35XX_RATE(933000000U, 311, 4, 1),
722 PLL_35XX_RATE(921000000U, 307, 4, 1),
723 PLL_35XX_RATE(900000000U, 375, 5, 1),
724 PLL_35XX_RATE(825000000U, 275, 4, 1),
725 PLL_35XX_RATE(800000000U, 400, 6, 1),
726 PLL_35XX_RATE(733000000U, 733, 12, 1),
727 PLL_35XX_RATE(700000000U, 175, 3, 1),
728 PLL_35XX_RATE(666000000U, 222, 4, 1),
729 PLL_35XX_RATE(633000000U, 211, 4, 1),
730 PLL_35XX_RATE(600000000U, 500, 5, 2),
731 PLL_35XX_RATE(552000000U, 460, 5, 2),
732 PLL_35XX_RATE(550000000U, 550, 6, 2),
733 PLL_35XX_RATE(543000000U, 362, 4, 2),
734 PLL_35XX_RATE(533000000U, 533, 6, 2),
735 PLL_35XX_RATE(500000000U, 500, 6, 2),
736 PLL_35XX_RATE(444000000U, 370, 5, 2),
737 PLL_35XX_RATE(420000000U, 350, 5, 2),
738 PLL_35XX_RATE(400000000U, 400, 6, 2),
739 PLL_35XX_RATE(350000000U, 350, 6, 2),
740 PLL_35XX_RATE(333000000U, 222, 4, 2),
741 PLL_35XX_RATE(300000000U, 500, 5, 3),
742 PLL_35XX_RATE(278000000U, 556, 6, 3),
743 PLL_35XX_RATE(266000000U, 532, 6, 3),
744 PLL_35XX_RATE(250000000U, 500, 6, 3),
745 PLL_35XX_RATE(200000000U, 400, 6, 3),
746 PLL_35XX_RATE(166000000U, 332, 6, 3),
747 PLL_35XX_RATE(160000000U, 320, 6, 3),
748 PLL_35XX_RATE(133000000U, 532, 6, 4),
749 PLL_35XX_RATE(100000000U, 400, 6, 4),
750 { /* sentinel */ }
751};
752
753/* AUD_PLL */
754static const struct samsung_pll_rate_table exynos5433_aud_pll_rates[] __initconst = {
755 PLL_36XX_RATE(400000000U, 200, 3, 2, 0),
756 PLL_36XX_RATE(393216003U, 197, 3, 2, -25690),
757 PLL_36XX_RATE(384000000U, 128, 2, 2, 0),
758 PLL_36XX_RATE(368639991U, 246, 4, 2, -15729),
759 PLL_36XX_RATE(361507202U, 181, 3, 2, -16148),
760 PLL_36XX_RATE(338687988U, 113, 2, 2, -6816),
761 PLL_36XX_RATE(294912002U, 98, 1, 3, 19923),
762 PLL_36XX_RATE(288000000U, 96, 1, 3, 0),
763 PLL_36XX_RATE(252000000U, 84, 1, 3, 0),
764 { /* sentinel */ }
765};
766
767static const struct samsung_pll_clock top_pll_clks[] __initconst = {
768 PLL(pll_35xx, CLK_FOUT_ISP_PLL, "fout_isp_pll", "oscclk",
769 ISP_PLL_LOCK, ISP_PLL_CON0, exynos5433_pll_rates),
770 PLL(pll_36xx, CLK_FOUT_AUD_PLL, "fout_aud_pll", "oscclk",
771 AUD_PLL_LOCK, AUD_PLL_CON0, exynos5433_aud_pll_rates),
772};
773
774static const struct samsung_cmu_info top_cmu_info __initconst = {
775 .pll_clks = top_pll_clks,
776 .nr_pll_clks = ARRAY_SIZE(top_pll_clks),
777 .mux_clks = top_mux_clks,
778 .nr_mux_clks = ARRAY_SIZE(top_mux_clks),
779 .div_clks = top_div_clks,
780 .nr_div_clks = ARRAY_SIZE(top_div_clks),
781 .gate_clks = top_gate_clks,
782 .nr_gate_clks = ARRAY_SIZE(top_gate_clks),
783 .fixed_clks = top_fixed_clks,
784 .nr_fixed_clks = ARRAY_SIZE(top_fixed_clks),
785 .fixed_factor_clks = top_fixed_factor_clks,
786 .nr_fixed_factor_clks = ARRAY_SIZE(top_fixed_factor_clks),
787 .nr_clk_ids = TOP_NR_CLK,
788 .clk_regs = top_clk_regs,
789 .nr_clk_regs = ARRAY_SIZE(top_clk_regs),
790};
791
792static void __init exynos5433_cmu_top_init(struct device_node *np)
793{
794 samsung_cmu_register_one(np, &top_cmu_info);
795}
796CLK_OF_DECLARE(exynos5433_cmu_top, "samsung,exynos5433-cmu-top",
797 exynos5433_cmu_top_init);
798
799/*
800 * Register offset definitions for CMU_CPIF
801 */
802#define MPHY_PLL_LOCK 0x0000
803#define MPHY_PLL_CON0 0x0100
804#define MPHY_PLL_CON1 0x0104
805#define MPHY_PLL_FREQ_DET 0x010c
806#define MUX_SEL_CPIF0 0x0200
807#define DIV_CPIF 0x0600
808#define ENABLE_SCLK_CPIF 0x0a00
809
810static const unsigned long cpif_clk_regs[] __initconst = {
811 MPHY_PLL_LOCK,
812 MPHY_PLL_CON0,
813 MPHY_PLL_CON1,
814 MPHY_PLL_FREQ_DET,
815 MUX_SEL_CPIF0,
816 DIV_CPIF,
817 ENABLE_SCLK_CPIF,
818};
819
820/* list of all parent clock list */
821PNAME(mout_mphy_pll_p) = { "oscclk", "fout_mphy_pll", };
822
823static const struct samsung_pll_clock cpif_pll_clks[] __initconst = {
824 PLL(pll_35xx, CLK_FOUT_MPHY_PLL, "fout_mphy_pll", "oscclk",
825 MPHY_PLL_LOCK, MPHY_PLL_CON0, exynos5433_pll_rates),
826};
827
828static const struct samsung_mux_clock cpif_mux_clks[] __initconst = {
829 /* MUX_SEL_CPIF0 */
830 MUX(CLK_MOUT_MPHY_PLL, "mout_mphy_pll", mout_mphy_pll_p, MUX_SEL_CPIF0,
831 0, 1),
832};
833
834static const struct samsung_div_clock cpif_div_clks[] __initconst = {
835 /* DIV_CPIF */
836 DIV(CLK_DIV_SCLK_MPHY, "div_sclk_mphy", "mout_mphy_pll", DIV_CPIF,
837 0, 6),
838};
839
840static const struct samsung_gate_clock cpif_gate_clks[] __initconst = {
841 /* ENABLE_SCLK_CPIF */
842 GATE(CLK_SCLK_MPHY_PLL, "sclk_mphy_pll", "mout_mphy_pll",
843 ENABLE_SCLK_CPIF, 9, CLK_IGNORE_UNUSED, 0),
844 GATE(CLK_SCLK_UFS_MPHY, "sclk_ufs_mphy", "div_sclk_mphy",
845 ENABLE_SCLK_CPIF, 4, 0, 0),
846};
847
848static const struct samsung_cmu_info cpif_cmu_info __initconst = {
849 .pll_clks = cpif_pll_clks,
850 .nr_pll_clks = ARRAY_SIZE(cpif_pll_clks),
851 .mux_clks = cpif_mux_clks,
852 .nr_mux_clks = ARRAY_SIZE(cpif_mux_clks),
853 .div_clks = cpif_div_clks,
854 .nr_div_clks = ARRAY_SIZE(cpif_div_clks),
855 .gate_clks = cpif_gate_clks,
856 .nr_gate_clks = ARRAY_SIZE(cpif_gate_clks),
857 .nr_clk_ids = CPIF_NR_CLK,
858 .clk_regs = cpif_clk_regs,
859 .nr_clk_regs = ARRAY_SIZE(cpif_clk_regs),
860};
861
862static void __init exynos5433_cmu_cpif_init(struct device_node *np)
863{
864 samsung_cmu_register_one(np, &cpif_cmu_info);
865}
866CLK_OF_DECLARE(exynos5433_cmu_cpif, "samsung,exynos5433-cmu-cpif",
867 exynos5433_cmu_cpif_init);
868
869/*
870 * Register offset definitions for CMU_MIF
871 */
872#define MEM0_PLL_LOCK 0x0000
873#define MEM1_PLL_LOCK 0x0004
874#define BUS_PLL_LOCK 0x0008
875#define MFC_PLL_LOCK 0x000c
876#define MEM0_PLL_CON0 0x0100
877#define MEM0_PLL_CON1 0x0104
878#define MEM0_PLL_FREQ_DET 0x010c
879#define MEM1_PLL_CON0 0x0110
880#define MEM1_PLL_CON1 0x0114
881#define MEM1_PLL_FREQ_DET 0x011c
882#define BUS_PLL_CON0 0x0120
883#define BUS_PLL_CON1 0x0124
884#define BUS_PLL_FREQ_DET 0x012c
885#define MFC_PLL_CON0 0x0130
886#define MFC_PLL_CON1 0x0134
887#define MFC_PLL_FREQ_DET 0x013c
888#define MUX_SEL_MIF0 0x0200
889#define MUX_SEL_MIF1 0x0204
890#define MUX_SEL_MIF2 0x0208
891#define MUX_SEL_MIF3 0x020c
892#define MUX_SEL_MIF4 0x0210
893#define MUX_SEL_MIF5 0x0214
894#define MUX_SEL_MIF6 0x0218
895#define MUX_SEL_MIF7 0x021c
896#define MUX_ENABLE_MIF0 0x0300
897#define MUX_ENABLE_MIF1 0x0304
898#define MUX_ENABLE_MIF2 0x0308
899#define MUX_ENABLE_MIF3 0x030c
900#define MUX_ENABLE_MIF4 0x0310
901#define MUX_ENABLE_MIF5 0x0314
902#define MUX_ENABLE_MIF6 0x0318
903#define MUX_ENABLE_MIF7 0x031c
904#define MUX_STAT_MIF0 0x0400
905#define MUX_STAT_MIF1 0x0404
906#define MUX_STAT_MIF2 0x0408
907#define MUX_STAT_MIF3 0x040c
908#define MUX_STAT_MIF4 0x0410
909#define MUX_STAT_MIF5 0x0414
910#define MUX_STAT_MIF6 0x0418
911#define MUX_STAT_MIF7 0x041c
912#define DIV_MIF1 0x0604
913#define DIV_MIF2 0x0608
914#define DIV_MIF3 0x060c
915#define DIV_MIF4 0x0610
916#define DIV_MIF5 0x0614
917#define DIV_MIF_PLL_FREQ_DET 0x0618
918#define DIV_STAT_MIF1 0x0704
919#define DIV_STAT_MIF2 0x0708
920#define DIV_STAT_MIF3 0x070c
921#define DIV_STAT_MIF4 0x0710
922#define DIV_STAT_MIF5 0x0714
923#define DIV_STAT_MIF_PLL_FREQ_DET 0x0718
924#define ENABLE_ACLK_MIF0 0x0800
925#define ENABLE_ACLK_MIF1 0x0804
926#define ENABLE_ACLK_MIF2 0x0808
927#define ENABLE_ACLK_MIF3 0x080c
928#define ENABLE_PCLK_MIF 0x0900
929#define ENABLE_PCLK_MIF_SECURE_DREX0_TZ 0x0904
930#define ENABLE_PCLK_MIF_SECURE_DREX1_TZ 0x0908
931#define ENABLE_PCLK_MIF_SECURE_MONOTONIC_CNT 0x090c
932#define ENABLE_PCLK_MIF_SECURE_RTC 0x0910
933#define ENABLE_SCLK_MIF 0x0a00
934#define ENABLE_IP_MIF0 0x0b00
935#define ENABLE_IP_MIF1 0x0b04
936#define ENABLE_IP_MIF2 0x0b08
937#define ENABLE_IP_MIF3 0x0b0c
938#define ENABLE_IP_MIF_SECURE_DREX0_TZ 0x0b10
939#define ENABLE_IP_MIF_SECURE_DREX1_TZ 0x0b14
940#define ENABLE_IP_MIF_SECURE_MONOTONIC_CNT 0x0b18
941#define ENABLE_IP_MIF_SECURE_RTC 0x0b1c
942#define CLKOUT_CMU_MIF 0x0c00
943#define CLKOUT_CMU_MIF_DIV_STAT 0x0c04
944#define DREX_FREQ_CTRL0 0x1000
945#define DREX_FREQ_CTRL1 0x1004
946#define PAUSE 0x1008
947#define DDRPHY_LOCK_CTRL 0x100c
948
949static const unsigned long mif_clk_regs[] __initconst = {
950 MEM0_PLL_LOCK,
951 MEM1_PLL_LOCK,
952 BUS_PLL_LOCK,
953 MFC_PLL_LOCK,
954 MEM0_PLL_CON0,
955 MEM0_PLL_CON1,
956 MEM0_PLL_FREQ_DET,
957 MEM1_PLL_CON0,
958 MEM1_PLL_CON1,
959 MEM1_PLL_FREQ_DET,
960 BUS_PLL_CON0,
961 BUS_PLL_CON1,
962 BUS_PLL_FREQ_DET,
963 MFC_PLL_CON0,
964 MFC_PLL_CON1,
965 MFC_PLL_FREQ_DET,
966 MUX_SEL_MIF0,
967 MUX_SEL_MIF1,
968 MUX_SEL_MIF2,
969 MUX_SEL_MIF3,
970 MUX_SEL_MIF4,
971 MUX_SEL_MIF5,
972 MUX_SEL_MIF6,
973 MUX_SEL_MIF7,
974 MUX_ENABLE_MIF0,
975 MUX_ENABLE_MIF1,
976 MUX_ENABLE_MIF2,
977 MUX_ENABLE_MIF3,
978 MUX_ENABLE_MIF4,
979 MUX_ENABLE_MIF5,
980 MUX_ENABLE_MIF6,
981 MUX_ENABLE_MIF7,
982 DIV_MIF1,
983 DIV_MIF2,
984 DIV_MIF3,
985 DIV_MIF4,
986 DIV_MIF5,
987 DIV_MIF_PLL_FREQ_DET,
988 ENABLE_ACLK_MIF0,
989 ENABLE_ACLK_MIF1,
990 ENABLE_ACLK_MIF2,
991 ENABLE_ACLK_MIF3,
992 ENABLE_PCLK_MIF,
993 ENABLE_PCLK_MIF_SECURE_DREX0_TZ,
994 ENABLE_PCLK_MIF_SECURE_DREX1_TZ,
995 ENABLE_PCLK_MIF_SECURE_MONOTONIC_CNT,
996 ENABLE_PCLK_MIF_SECURE_RTC,
997 ENABLE_SCLK_MIF,
998 ENABLE_IP_MIF0,
999 ENABLE_IP_MIF1,
1000 ENABLE_IP_MIF2,
1001 ENABLE_IP_MIF3,
1002 ENABLE_IP_MIF_SECURE_DREX0_TZ,
1003 ENABLE_IP_MIF_SECURE_DREX1_TZ,
1004 ENABLE_IP_MIF_SECURE_MONOTONIC_CNT,
1005 ENABLE_IP_MIF_SECURE_RTC,
1006 CLKOUT_CMU_MIF,
1007 CLKOUT_CMU_MIF_DIV_STAT,
1008 DREX_FREQ_CTRL0,
1009 DREX_FREQ_CTRL1,
1010 PAUSE,
1011 DDRPHY_LOCK_CTRL,
1012};
1013
1014static const struct samsung_pll_clock mif_pll_clks[] __initconst = {
1015 PLL(pll_35xx, CLK_FOUT_MEM0_PLL, "fout_mem0_pll", "oscclk",
1016 MEM0_PLL_LOCK, MEM0_PLL_CON0, exynos5433_pll_rates),
1017 PLL(pll_35xx, CLK_FOUT_MEM1_PLL, "fout_mem1_pll", "oscclk",
1018 MEM1_PLL_LOCK, MEM1_PLL_CON0, exynos5433_pll_rates),
1019 PLL(pll_35xx, CLK_FOUT_BUS_PLL, "fout_bus_pll", "oscclk",
1020 BUS_PLL_LOCK, BUS_PLL_CON0, exynos5433_pll_rates),
1021 PLL(pll_35xx, CLK_FOUT_MFC_PLL, "fout_mfc_pll", "oscclk",
1022 MFC_PLL_LOCK, MFC_PLL_CON0, exynos5433_pll_rates),
1023};
1024
1025/* list of all parent clock list */
1026PNAME(mout_mfc_pll_div2_p) = { "mout_mfc_pll", "dout_mfc_pll", };
1027PNAME(mout_bus_pll_div2_p) = { "mout_bus_pll", "dout_bus_pll", };
1028PNAME(mout_mem1_pll_div2_p) = { "mout_mem1_pll", "dout_mem1_pll", };
1029PNAME(mout_mem0_pll_div2_p) = { "mout_mem0_pll", "dout_mem0_pll", };
1030PNAME(mout_mfc_pll_p) = { "oscclk", "fout_mfc_pll", };
1031PNAME(mout_bus_pll_p) = { "oscclk", "fout_bus_pll", };
1032PNAME(mout_mem1_pll_p) = { "oscclk", "fout_mem1_pll", };
1033PNAME(mout_mem0_pll_p) = { "oscclk", "fout_mem0_pll", };
1034
1035PNAME(mout_clk2x_phy_c_p) = { "mout_mem0_pll_div2", "mout_clkm_phy_b", };
1036PNAME(mout_clk2x_phy_b_p) = { "mout_bus_pll_div2", "mout_clkm_phy_a", };
1037PNAME(mout_clk2x_phy_a_p) = { "mout_bus_pll_div2", "mout_mfc_pll_div2", };
1038PNAME(mout_clkm_phy_b_p) = { "mout_mem1_pll_div2", "mout_clkm_phy_a", };
1039
1040PNAME(mout_aclk_mifnm_200_p) = { "mout_mem0_pll_div2", "div_mif_pre", };
1041PNAME(mout_aclk_mifnm_400_p) = { "mout_mem1_pll_div2", "mout_bus_pll_div2",};
1042
1043PNAME(mout_aclk_disp_333_b_p) = { "mout_aclk_disp_333_a",
1044 "mout_bus_pll_div2", };
1045PNAME(mout_aclk_disp_333_a_p) = { "mout_mfc_pll_div2", "sclk_mphy_pll", };
1046
1047PNAME(mout_sclk_decon_vclk_c_p) = { "mout_sclk_decon_vclk_b",
1048 "sclk_mphy_pll", };
1049PNAME(mout_sclk_decon_vclk_b_p) = { "mout_sclk_decon_vclk_a",
1050 "mout_mfc_pll_div2", };
1051PNAME(mout_sclk_decon_p) = { "oscclk", "mout_bus_pll_div2", };
1052PNAME(mout_sclk_decon_eclk_c_p) = { "mout_sclk_decon_eclk_b",
1053 "sclk_mphy_pll", };
1054PNAME(mout_sclk_decon_eclk_b_p) = { "mout_sclk_decon_eclk_a",
1055 "mout_mfc_pll_div2", };
1056
1057PNAME(mout_sclk_decon_tv_eclk_c_p) = { "mout_sclk_decon_tv_eclk_b",
1058 "sclk_mphy_pll", };
1059PNAME(mout_sclk_decon_tv_eclk_b_p) = { "mout_sclk_decon_tv_eclk_a",
1060 "mout_mfc_pll_div2", };
1061PNAME(mout_sclk_dsd_c_p) = { "mout_sclk_dsd_b", "mout_bus_pll_div2", };
1062PNAME(mout_sclk_dsd_b_p) = { "mout_sclk_dsd_a", "sclk_mphy_pll", };
1063PNAME(mout_sclk_dsd_a_p) = { "oscclk", "mout_mfc_pll_div2", };
1064
1065PNAME(mout_sclk_dsim0_c_p) = { "mout_sclk_dsim0_b", "sclk_mphy_pll", };
1066PNAME(mout_sclk_dsim0_b_p) = { "mout_sclk_dsim0_a", "mout_mfc_pll_div2" };
1067
1068PNAME(mout_sclk_decon_tv_vclk_c_p) = { "mout_sclk_decon_tv_vclk_b",
1069 "sclk_mphy_pll", };
1070PNAME(mout_sclk_decon_tv_vclk_b_p) = { "mout_sclk_decon_tv_vclk_a",
1071 "mout_mfc_pll_div2", };
1072PNAME(mout_sclk_dsim1_c_p) = { "mout_sclk_dsim1_b", "sclk_mphy_pll", };
1073PNAME(mout_sclk_dsim1_b_p) = { "mout_sclk_dsim1_a", "mout_mfc_pll_div2",};
1074
1075static const struct samsung_fixed_factor_clock mif_fixed_factor_clks[] __initconst = {
1076 /* dout_{mfc|bus|mem1|mem0}_pll is half fixed rate from parent mux */
1077 FFACTOR(CLK_DOUT_MFC_PLL, "dout_mfc_pll", "mout_mfc_pll", 1, 1, 0),
1078 FFACTOR(CLK_DOUT_BUS_PLL, "dout_bus_pll", "mout_bus_pll", 1, 1, 0),
1079 FFACTOR(CLK_DOUT_MEM1_PLL, "dout_mem1_pll", "mout_mem1_pll", 1, 1, 0),
1080 FFACTOR(CLK_DOUT_MEM0_PLL, "dout_mem0_pll", "mout_mem0_pll", 1, 1, 0),
1081};
1082
1083static const struct samsung_mux_clock mif_mux_clks[] __initconst = {
1084 /* MUX_SEL_MIF0 */
1085 MUX(CLK_MOUT_MFC_PLL_DIV2, "mout_mfc_pll_div2", mout_mfc_pll_div2_p,
1086 MUX_SEL_MIF0, 28, 1),
1087 MUX(CLK_MOUT_BUS_PLL_DIV2, "mout_bus_pll_div2", mout_bus_pll_div2_p,
1088 MUX_SEL_MIF0, 24, 1),
1089 MUX(CLK_MOUT_MEM1_PLL_DIV2, "mout_mem1_pll_div2", mout_mem1_pll_div2_p,
1090 MUX_SEL_MIF0, 20, 1),
1091 MUX(CLK_MOUT_MEM0_PLL_DIV2, "mout_mem0_pll_div2", mout_mem0_pll_div2_p,
1092 MUX_SEL_MIF0, 16, 1),
1093 MUX(CLK_MOUT_MFC_PLL, "mout_mfc_pll", mout_mfc_pll_p, MUX_SEL_MIF0,
1094 12, 1),
1095 MUX(CLK_MOUT_BUS_PLL, "mout_bus_pll", mout_bus_pll_p, MUX_SEL_MIF0,
1096 8, 1),
1097 MUX(CLK_MOUT_MEM1_PLL, "mout_mem1_pll", mout_mem1_pll_p, MUX_SEL_MIF0,
1098 4, 1),
1099 MUX(CLK_MOUT_MEM0_PLL, "mout_mem0_pll", mout_mem0_pll_p, MUX_SEL_MIF0,
1100 0, 1),
1101
1102 /* MUX_SEL_MIF1 */
1103 MUX(CLK_MOUT_CLK2X_PHY_C, "mout_clk2x_phy_c", mout_clk2x_phy_c_p,
1104 MUX_SEL_MIF1, 24, 1),
1105 MUX(CLK_MOUT_CLK2X_PHY_B, "mout_clk2x_phy_b", mout_clk2x_phy_b_p,
1106 MUX_SEL_MIF1, 20, 1),
1107 MUX(CLK_MOUT_CLK2X_PHY_A, "mout_clk2x_phy_a", mout_clk2x_phy_a_p,
1108 MUX_SEL_MIF1, 16, 1),
1109 MUX(CLK_MOUT_CLKM_PHY_C, "mout_clkm_phy_c", mout_clk2x_phy_c_p,
1110 MUX_SEL_MIF1, 12, 1),
1111 MUX(CLK_MOUT_CLKM_PHY_B, "mout_clkm_phy_b", mout_clkm_phy_b_p,
1112 MUX_SEL_MIF1, 8, 1),
1113 MUX(CLK_MOUT_CLKM_PHY_A, "mout_clkm_phy_a", mout_clk2x_phy_a_p,
1114 MUX_SEL_MIF1, 4, 1),
1115
1116 /* MUX_SEL_MIF2 */
1117 MUX(CLK_MOUT_ACLK_MIFNM_200, "mout_aclk_mifnm_200",
1118 mout_aclk_mifnm_200_p, MUX_SEL_MIF2, 8, 1),
1119 MUX(CLK_MOUT_ACLK_MIFNM_400, "mout_aclk_mifnm_400",
1120 mout_aclk_mifnm_400_p, MUX_SEL_MIF2, 0, 1),
1121
1122 /* MUX_SEL_MIF3 */
1123 MUX(CLK_MOUT_ACLK_DISP_333_B, "mout_aclk_disp_333_b",
1124 mout_aclk_disp_333_b_p, MUX_SEL_MIF3, 4, 1),
1125 MUX(CLK_MOUT_ACLK_DISP_333_A, "mout_aclk_disp_333_a",
1126 mout_aclk_disp_333_a_p, MUX_SEL_MIF3, 0, 1),
1127
1128 /* MUX_SEL_MIF4 */
1129 MUX(CLK_MOUT_SCLK_DECON_VCLK_C, "mout_sclk_decon_vclk_c",
1130 mout_sclk_decon_vclk_c_p, MUX_SEL_MIF4, 24, 1),
1131 MUX(CLK_MOUT_SCLK_DECON_VCLK_B, "mout_sclk_decon_vclk_b",
1132 mout_sclk_decon_vclk_b_p, MUX_SEL_MIF4, 20, 1),
1133 MUX(CLK_MOUT_SCLK_DECON_VCLK_A, "mout_sclk_decon_vclk_a",
1134 mout_sclk_decon_p, MUX_SEL_MIF4, 16, 1),
1135 MUX(CLK_MOUT_SCLK_DECON_ECLK_C, "mout_sclk_decon_eclk_c",
1136 mout_sclk_decon_eclk_c_p, MUX_SEL_MIF4, 8, 1),
1137 MUX(CLK_MOUT_SCLK_DECON_ECLK_B, "mout_sclk_decon_eclk_b",
1138 mout_sclk_decon_eclk_b_p, MUX_SEL_MIF4, 4, 1),
1139 MUX(CLK_MOUT_SCLK_DECON_ECLK_A, "mout_sclk_decon_eclk_a",
1140 mout_sclk_decon_p, MUX_SEL_MIF4, 0, 1),
1141
1142 /* MUX_SEL_MIF5 */
1143 MUX(CLK_MOUT_SCLK_DECON_TV_ECLK_C, "mout_sclk_decon_tv_eclk_c",
1144 mout_sclk_decon_tv_eclk_c_p, MUX_SEL_MIF5, 24, 1),
1145 MUX(CLK_MOUT_SCLK_DECON_TV_ECLK_B, "mout_sclk_decon_tv_eclk_b",
1146 mout_sclk_decon_tv_eclk_b_p, MUX_SEL_MIF5, 20, 1),
1147 MUX(CLK_MOUT_SCLK_DECON_TV_ECLK_A, "mout_sclk_decon_tv_eclk_a",
1148 mout_sclk_decon_p, MUX_SEL_MIF5, 16, 1),
1149 MUX(CLK_MOUT_SCLK_DSD_C, "mout_sclk_dsd_c", mout_sclk_dsd_c_p,
1150 MUX_SEL_MIF5, 8, 1),
1151 MUX(CLK_MOUT_SCLK_DSD_B, "mout_sclk_dsd_b", mout_sclk_dsd_b_p,
1152 MUX_SEL_MIF5, 4, 1),
1153 MUX(CLK_MOUT_SCLK_DSD_A, "mout_sclk_dsd_a", mout_sclk_dsd_a_p,
1154 MUX_SEL_MIF5, 0, 1),
1155
1156 /* MUX_SEL_MIF6 */
1157 MUX(CLK_MOUT_SCLK_DSIM0_C, "mout_sclk_dsim0_c", mout_sclk_dsim0_c_p,
1158 MUX_SEL_MIF6, 8, 1),
1159 MUX(CLK_MOUT_SCLK_DSIM0_B, "mout_sclk_dsim0_b", mout_sclk_dsim0_b_p,
1160 MUX_SEL_MIF6, 4, 1),
1161 MUX(CLK_MOUT_SCLK_DSIM0_A, "mout_sclk_dsim0_a", mout_sclk_decon_p,
1162 MUX_SEL_MIF6, 0, 1),
1163
1164 /* MUX_SEL_MIF7 */
1165 MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_C, "mout_sclk_decon_tv_vclk_c",
1166 mout_sclk_decon_tv_vclk_c_p, MUX_SEL_MIF7, 24, 1),
1167 MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_B, "mout_sclk_decon_tv_vclk_b",
1168 mout_sclk_decon_tv_vclk_b_p, MUX_SEL_MIF7, 20, 1),
1169 MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_A, "mout_sclk_decon_tv_vclk_a",
1170 mout_sclk_decon_p, MUX_SEL_MIF7, 16, 1),
1171 MUX(CLK_MOUT_SCLK_DSIM1_C, "mout_sclk_dsim1_c", mout_sclk_dsim1_c_p,
1172 MUX_SEL_MIF7, 8, 1),
1173 MUX(CLK_MOUT_SCLK_DSIM1_B, "mout_sclk_dsim1_b", mout_sclk_dsim1_b_p,
1174 MUX_SEL_MIF7, 4, 1),
1175 MUX(CLK_MOUT_SCLK_DSIM1_A, "mout_sclk_dsim1_a", mout_sclk_decon_p,
1176 MUX_SEL_MIF7, 0, 1),
1177};
1178
1179static const struct samsung_div_clock mif_div_clks[] __initconst = {
1180 /* DIV_MIF1 */
1181 DIV(CLK_DIV_SCLK_HPM_MIF, "div_sclk_hpm_mif", "div_clk2x_phy",
1182 DIV_MIF1, 16, 2),
1183 DIV(CLK_DIV_ACLK_DREX1, "div_aclk_drex1", "div_clk2x_phy", DIV_MIF1,
1184 12, 2),
1185 DIV(CLK_DIV_ACLK_DREX0, "div_aclk_drex0", "div_clk2x_phy", DIV_MIF1,
1186 8, 2),
1187 DIV(CLK_DIV_CLK2XPHY, "div_clk2x_phy", "mout_clk2x_phy_c", DIV_MIF1,
1188 4, 4),
1189
1190 /* DIV_MIF2 */
1191 DIV(CLK_DIV_ACLK_MIF_266, "div_aclk_mif_266", "mout_bus_pll_div2",
1192 DIV_MIF2, 20, 3),
1193 DIV(CLK_DIV_ACLK_MIFND_133, "div_aclk_mifnd_133", "div_mif_pre",
1194 DIV_MIF2, 16, 4),
1195 DIV(CLK_DIV_ACLK_MIF_133, "div_aclk_mif_133", "div_mif_pre",
1196 DIV_MIF2, 12, 4),
1197 DIV(CLK_DIV_ACLK_MIFNM_200, "div_aclk_mifnm_200",
1198 "mout_aclk_mifnm_200", DIV_MIF2, 8, 3),
1199 DIV(CLK_DIV_ACLK_MIF_200, "div_aclk_mif_200", "div_aclk_mif_400",
1200 DIV_MIF2, 4, 2),
1201 DIV(CLK_DIV_ACLK_MIF_400, "div_aclk_mif_400", "mout_aclk_mifnm_400",
1202 DIV_MIF2, 0, 3),
1203
1204 /* DIV_MIF3 */
1205 DIV(CLK_DIV_ACLK_BUS2_400, "div_aclk_bus2_400", "div_mif_pre",
1206 DIV_MIF3, 16, 4),
1207 DIV(CLK_DIV_ACLK_DISP_333, "div_aclk_disp_333", "mout_aclk_disp_333_b",
1208 DIV_MIF3, 4, 3),
1209 DIV(CLK_DIV_ACLK_CPIF_200, "div_aclk_cpif_200", "mout_aclk_mifnm_200",
1210 DIV_MIF3, 0, 3),
1211
1212 /* DIV_MIF4 */
1213 DIV(CLK_DIV_SCLK_DSIM1, "div_sclk_dsim1", "mout_sclk_dsim1_c",
1214 DIV_MIF4, 24, 4),
1215 DIV(CLK_DIV_SCLK_DECON_TV_VCLK, "div_sclk_decon_tv_vclk",
1216 "mout_sclk_decon_tv_vclk_c", DIV_MIF4, 20, 4),
1217 DIV(CLK_DIV_SCLK_DSIM0, "div_sclk_dsim0", "mout_sclk_dsim0_c",
1218 DIV_MIF4, 16, 4),
1219 DIV(CLK_DIV_SCLK_DSD, "div_sclk_dsd", "mout_sclk_dsd_c",
1220 DIV_MIF4, 12, 4),
1221 DIV(CLK_DIV_SCLK_DECON_TV_ECLK, "div_sclk_decon_tv_eclk",
1222 "mout_sclk_decon_tv_eclk_c", DIV_MIF4, 8, 4),
1223 DIV(CLK_DIV_SCLK_DECON_VCLK, "div_sclk_decon_vclk",
1224 "mout_sclk_decon_vclk_c", DIV_MIF4, 4, 4),
1225 DIV(CLK_DIV_SCLK_DECON_ECLK, "div_sclk_decon_eclk",
1226 "mout_sclk_decon_eclk_c", DIV_MIF4, 0, 4),
1227
1228 /* DIV_MIF5 */
1229 DIV(CLK_DIV_MIF_PRE, "div_mif_pre", "mout_bus_pll_div2", DIV_MIF5,
1230 0, 3),
1231};
1232
1233static const struct samsung_gate_clock mif_gate_clks[] __initconst = {
1234 /* ENABLE_ACLK_MIF0 */
1235 GATE(CLK_CLK2X_PHY1, "clk2k_phy1", "div_clk2x_phy", ENABLE_ACLK_MIF0,
1236 19, CLK_IGNORE_UNUSED, 0),
1237 GATE(CLK_CLK2X_PHY0, "clk2x_phy0", "div_clk2x_phy", ENABLE_ACLK_MIF0,
1238 18, CLK_IGNORE_UNUSED, 0),
1239 GATE(CLK_CLKM_PHY1, "clkm_phy1", "mout_clkm_phy_c", ENABLE_ACLK_MIF0,
1240 17, CLK_IGNORE_UNUSED, 0),
1241 GATE(CLK_CLKM_PHY0, "clkm_phy0", "mout_clkm_phy_c", ENABLE_ACLK_MIF0,
1242 16, CLK_IGNORE_UNUSED, 0),
1243 GATE(CLK_RCLK_DREX1, "rclk_drex1", "oscclk", ENABLE_ACLK_MIF0,
1244 15, CLK_IGNORE_UNUSED, 0),
1245 GATE(CLK_RCLK_DREX0, "rclk_drex0", "oscclk", ENABLE_ACLK_MIF0,
1246 14, CLK_IGNORE_UNUSED, 0),
1247 GATE(CLK_ACLK_DREX1_TZ, "aclk_drex1_tz", "div_aclk_drex1",
1248 ENABLE_ACLK_MIF0, 13, CLK_IGNORE_UNUSED, 0),
1249 GATE(CLK_ACLK_DREX0_TZ, "aclk_drex0_tz", "div_aclk_drex0",
1250 ENABLE_ACLK_MIF0, 12, CLK_IGNORE_UNUSED, 0),
1251 GATE(CLK_ACLK_DREX1_PEREV, "aclk_drex1_perev", "div_aclk_drex1",
1252 ENABLE_ACLK_MIF0, 11, CLK_IGNORE_UNUSED, 0),
1253 GATE(CLK_ACLK_DREX0_PEREV, "aclk_drex0_perev", "div_aclk_drex0",
1254 ENABLE_ACLK_MIF0, 10, CLK_IGNORE_UNUSED, 0),
1255 GATE(CLK_ACLK_DREX1_MEMIF, "aclk_drex1_memif", "div_aclk_drex1",
1256 ENABLE_ACLK_MIF0, 9, CLK_IGNORE_UNUSED, 0),
1257 GATE(CLK_ACLK_DREX0_MEMIF, "aclk_drex0_memif", "div_aclk_drex0",
1258 ENABLE_ACLK_MIF0, 8, CLK_IGNORE_UNUSED, 0),
1259 GATE(CLK_ACLK_DREX1_SCH, "aclk_drex1_sch", "div_aclk_drex1",
1260 ENABLE_ACLK_MIF0, 7, CLK_IGNORE_UNUSED, 0),
1261 GATE(CLK_ACLK_DREX0_SCH, "aclk_drex0_sch", "div_aclk_drex0",
1262 ENABLE_ACLK_MIF0, 6, CLK_IGNORE_UNUSED, 0),
1263 GATE(CLK_ACLK_DREX1_BUSIF, "aclk_drex1_busif", "div_aclk_drex1",
1264 ENABLE_ACLK_MIF0, 5, CLK_IGNORE_UNUSED, 0),
1265 GATE(CLK_ACLK_DREX0_BUSIF, "aclk_drex0_busif", "div_aclk_drex0",
1266 ENABLE_ACLK_MIF0, 4, CLK_IGNORE_UNUSED, 0),
1267 GATE(CLK_ACLK_DREX1_BUSIF_RD, "aclk_drex1_busif_rd", "div_aclk_drex1",
1268 ENABLE_ACLK_MIF0, 3, CLK_IGNORE_UNUSED, 0),
1269 GATE(CLK_ACLK_DREX0_BUSIF_RD, "aclk_drex0_busif_rd", "div_aclk_drex0",
1270 ENABLE_ACLK_MIF0, 2, CLK_IGNORE_UNUSED, 0),
1271 GATE(CLK_ACLK_DREX1, "aclk_drex1", "div_aclk_drex1",
1272 ENABLE_ACLK_MIF0, 2, CLK_IGNORE_UNUSED, 0),
1273 GATE(CLK_ACLK_DREX0, "aclk_drex0", "div_aclk_drex0",
1274 ENABLE_ACLK_MIF0, 1, CLK_IGNORE_UNUSED, 0),
1275
1276 /* ENABLE_ACLK_MIF1 */
1277 GATE(CLK_ACLK_ASYNCAXIS_MIF_IMEM, "aclk_asyncaxis_mif_imem",
1278 "div_aclk_mif_200", ENABLE_ACLK_MIF1, 28,
1279 CLK_IGNORE_UNUSED, 0),
1280 GATE(CLK_ACLK_ASYNCAXIS_NOC_P_CCI, "aclk_asyncaxis_noc_p_cci",
1281 "div_aclk_mif_200", ENABLE_ACLK_MIF1,
1282 27, CLK_IGNORE_UNUSED, 0),
1283 GATE(CLK_ACLK_ASYNCAXIM_NOC_P_CCI, "aclk_asyncaxim_noc_p_cci",
1284 "div_aclk_mif_133", ENABLE_ACLK_MIF1,
1285 26, CLK_IGNORE_UNUSED, 0),
1286 GATE(CLK_ACLK_ASYNCAXIS_CP1, "aclk_asyncaxis_cp1",
1287 "div_aclk_mifnm_200", ENABLE_ACLK_MIF1,
1288 25, CLK_IGNORE_UNUSED, 0),
1289 GATE(CLK_ACLK_ASYNCAXIM_CP1, "aclk_asyncaxim_cp1",
1290 "div_aclk_drex1", ENABLE_ACLK_MIF1,
1291 24, CLK_IGNORE_UNUSED, 0),
1292 GATE(CLK_ACLK_ASYNCAXIS_CP0, "aclk_asyncaxis_cp0",
1293 "div_aclk_mifnm_200", ENABLE_ACLK_MIF1,
1294 23, CLK_IGNORE_UNUSED, 0),
1295 GATE(CLK_ACLK_ASYNCAXIM_CP0, "aclk_asyncaxim_cp0",
1296 "div_aclk_drex0", ENABLE_ACLK_MIF1,
1297 22, CLK_IGNORE_UNUSED, 0),
1298 GATE(CLK_ACLK_ASYNCAXIS_DREX1_3, "aclk_asyncaxis_drex1_3",
1299 "div_aclk_mif_133", ENABLE_ACLK_MIF1,
1300 21, CLK_IGNORE_UNUSED, 0),
1301 GATE(CLK_ACLK_ASYNCAXIM_DREX1_3, "aclk_asyncaxim_drex1_3",
1302 "div_aclk_drex1", ENABLE_ACLK_MIF1,
1303 20, CLK_IGNORE_UNUSED, 0),
1304 GATE(CLK_ACLK_ASYNCAXIS_DREX1_1, "aclk_asyncaxis_drex1_1",
1305 "div_aclk_mif_133", ENABLE_ACLK_MIF1,
1306 19, CLK_IGNORE_UNUSED, 0),
1307 GATE(CLK_ACLK_ASYNCAXIM_DREX1_1, "aclk_asyncaxim_drex1_1",
1308 "div_aclk_drex1", ENABLE_ACLK_MIF1,
1309 18, CLK_IGNORE_UNUSED, 0),
1310 GATE(CLK_ACLK_ASYNCAXIS_DREX1_0, "aclk_asyncaxis_drex1_0",
1311 "div_aclk_mif_133", ENABLE_ACLK_MIF1,
1312 17, CLK_IGNORE_UNUSED, 0),
1313 GATE(CLK_ACLK_ASYNCAXIM_DREX1_0, "aclk_asyncaxim_drex1_0",
1314 "div_aclk_drex1", ENABLE_ACLK_MIF1,
1315 16, CLK_IGNORE_UNUSED, 0),
1316 GATE(CLK_ACLK_ASYNCAXIS_DREX0_3, "aclk_asyncaxis_drex0_3",
1317 "div_aclk_mif_133", ENABLE_ACLK_MIF1,
1318 15, CLK_IGNORE_UNUSED, 0),
1319 GATE(CLK_ACLK_ASYNCAXIM_DREX0_3, "aclk_asyncaxim_drex0_3",
1320 "div_aclk_drex0", ENABLE_ACLK_MIF1,
1321 14, CLK_IGNORE_UNUSED, 0),
1322 GATE(CLK_ACLK_ASYNCAXIS_DREX0_1, "aclk_asyncaxis_drex0_1",
1323 "div_aclk_mif_133", ENABLE_ACLK_MIF1,
1324 13, CLK_IGNORE_UNUSED, 0),
1325 GATE(CLK_ACLK_ASYNCAXIM_DREX0_1, "aclk_asyncaxim_drex0_1",
1326 "div_aclk_drex0", ENABLE_ACLK_MIF1,
1327 12, CLK_IGNORE_UNUSED, 0),
1328 GATE(CLK_ACLK_ASYNCAXIS_DREX0_0, "aclk_asyncaxis_drex0_0",
1329 "div_aclk_mif_133", ENABLE_ACLK_MIF1,
1330 11, CLK_IGNORE_UNUSED, 0),
1331 GATE(CLK_ACLK_ASYNCAXIM_DREX0_0, "aclk_asyncaxim_drex0_0",
1332 "div_aclk_drex0", ENABLE_ACLK_MIF1,
1333 10, CLK_IGNORE_UNUSED, 0),
1334 GATE(CLK_ACLK_AHB2APB_MIF2P, "aclk_ahb2apb_mif2p", "div_aclk_mif_133",
1335 ENABLE_ACLK_MIF1, 9, CLK_IGNORE_UNUSED, 0),
1336 GATE(CLK_ACLK_AHB2APB_MIF1P, "aclk_ahb2apb_mif1p", "div_aclk_mif_133",
1337 ENABLE_ACLK_MIF1, 8, CLK_IGNORE_UNUSED, 0),
1338 GATE(CLK_ACLK_AHB2APB_MIF0P, "aclk_ahb2apb_mif0p", "div_aclk_mif_133",
1339 ENABLE_ACLK_MIF1, 7, CLK_IGNORE_UNUSED, 0),
1340 GATE(CLK_ACLK_IXIU_CCI, "aclk_ixiu_cci", "div_aclk_mif_400",
1341 ENABLE_ACLK_MIF1, 6, CLK_IGNORE_UNUSED, 0),
1342 GATE(CLK_ACLK_XIU_MIFSFRX, "aclk_xiu_mifsfrx", "div_aclk_mif_200",
1343 ENABLE_ACLK_MIF1, 5, CLK_IGNORE_UNUSED, 0),
1344 GATE(CLK_ACLK_MIFNP_133, "aclk_mifnp_133", "div_aclk_mif_133",
1345 ENABLE_ACLK_MIF1, 4, CLK_IGNORE_UNUSED, 0),
1346 GATE(CLK_ACLK_MIFNM_200, "aclk_mifnm_200", "div_aclk_mifnm_200",
1347 ENABLE_ACLK_MIF1, 3, CLK_IGNORE_UNUSED, 0),
1348 GATE(CLK_ACLK_MIFND_133, "aclk_mifnd_133", "div_aclk_mifnd_133",
1349 ENABLE_ACLK_MIF1, 2, CLK_IGNORE_UNUSED, 0),
1350 GATE(CLK_ACLK_MIFND_400, "aclk_mifnd_400", "div_aclk_mif_400",
1351 ENABLE_ACLK_MIF1, 1, CLK_IGNORE_UNUSED, 0),
1352 GATE(CLK_ACLK_CCI, "aclk_cci", "div_aclk_mif_400", ENABLE_ACLK_MIF1,
1353 0, CLK_IGNORE_UNUSED, 0),
1354
1355 /* ENABLE_ACLK_MIF2 */
1356 GATE(CLK_ACLK_MIFND_266, "aclk_mifnd_266", "div_aclk_mif_266",
1357 ENABLE_ACLK_MIF2, 20, CLK_IGNORE_UNUSED, 0),
1358 GATE(CLK_ACLK_PPMU_DREX1S3, "aclk_ppmu_drex1s3", "div_aclk_drex1",
1359 ENABLE_ACLK_MIF2, 17, CLK_IGNORE_UNUSED, 0),
1360 GATE(CLK_ACLK_PPMU_DREX1S1, "aclk_ppmu_drex1s1", "div_aclk_drex1",
1361 ENABLE_ACLK_MIF2, 16, CLK_IGNORE_UNUSED, 0),
1362 GATE(CLK_ACLK_PPMU_DREX1S0, "aclk_ppmu_drex1s0", "div_aclk_drex1",
1363 ENABLE_ACLK_MIF2, 15, CLK_IGNORE_UNUSED, 0),
1364 GATE(CLK_ACLK_PPMU_DREX0S3, "aclk_ppmu_drex0s3", "div_aclk_drex0",
1365 ENABLE_ACLK_MIF2, 14, CLK_IGNORE_UNUSED, 0),
1366 GATE(CLK_ACLK_PPMU_DREX0S1, "aclk_ppmu_drex0s1", "div_aclk_drex0",
1367 ENABLE_ACLK_MIF2, 13, CLK_IGNORE_UNUSED, 0),
1368 GATE(CLK_ACLK_PPMU_DREX0S0, "aclk_ppmu_drex0s0", "div_aclk_drex0",
1369 ENABLE_ACLK_MIF2, 12, CLK_IGNORE_UNUSED, 0),
1370 GATE(CLK_ACLK_AXIDS_CCI_MIFSFRX, "aclk_axids_cci_mifsfrx",
1371 "div_aclk_mif_200", ENABLE_ACLK_MIF2, 7,
1372 CLK_IGNORE_UNUSED, 0),
1373 GATE(CLK_ACLK_AXISYNCDNS_CCI, "aclk_axisyncdns_cci",
1374 "div_aclk_mif_400", ENABLE_ACLK_MIF2,
1375 5, CLK_IGNORE_UNUSED, 0),
1376 GATE(CLK_ACLK_AXISYNCDN_CCI, "aclk_axisyncdn_cci", "div_aclk_mif_400",
1377 ENABLE_ACLK_MIF2, 4, CLK_IGNORE_UNUSED, 0),
1378 GATE(CLK_ACLK_AXISYNCDN_NOC_D, "aclk_axisyncdn_noc_d",
1379 "div_aclk_mif_200", ENABLE_ACLK_MIF2,
1380 3, CLK_IGNORE_UNUSED, 0),
1381 GATE(CLK_ACLK_ASYNCAPBS_MIF_CSSYS, "aclk_asyncapbs_mif_cssys",
1382 "div_aclk_mifnd_133", ENABLE_ACLK_MIF2, 0, 0, 0),
1383
1384 /* ENABLE_ACLK_MIF3 */
1385 GATE(CLK_ACLK_BUS2_400, "aclk_bus2_400", "div_aclk_bus2_400",
1386 ENABLE_ACLK_MIF3, 4,
1387 CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
1388 GATE(CLK_ACLK_DISP_333, "aclk_disp_333", "div_aclk_disp_333",
1389 ENABLE_ACLK_MIF3, 1,
1390 CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, 0),
1391 GATE(CLK_ACLK_CPIF_200, "aclk_cpif_200", "div_aclk_cpif_200",
1392 ENABLE_ACLK_MIF3, 0,
1393 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
1394
1395 /* ENABLE_PCLK_MIF */
1396 GATE(CLK_PCLK_PPMU_DREX1S3, "pclk_ppmu_drex1s3", "div_aclk_drex1",
1397 ENABLE_PCLK_MIF, 29, CLK_IGNORE_UNUSED, 0),
1398 GATE(CLK_PCLK_PPMU_DREX1S1, "pclk_ppmu_drex1s1", "div_aclk_drex1",
1399 ENABLE_PCLK_MIF, 28, CLK_IGNORE_UNUSED, 0),
1400 GATE(CLK_PCLK_PPMU_DREX1S0, "pclk_ppmu_drex1s0", "div_aclk_drex1",
1401 ENABLE_PCLK_MIF, 27, CLK_IGNORE_UNUSED, 0),
1402 GATE(CLK_PCLK_PPMU_DREX0S3, "pclk_ppmu_drex0s3", "div_aclk_drex0",
1403 ENABLE_PCLK_MIF, 26, CLK_IGNORE_UNUSED, 0),
1404 GATE(CLK_PCLK_PPMU_DREX0S1, "pclk_ppmu_drex0s1", "div_aclk_drex0",
1405 ENABLE_PCLK_MIF, 25, CLK_IGNORE_UNUSED, 0),
1406 GATE(CLK_PCLK_PPMU_DREX0S0, "pclk_ppmu_drex0s0", "div_aclk_drex0",
1407 ENABLE_PCLK_MIF, 24, CLK_IGNORE_UNUSED, 0),
1408 GATE(CLK_PCLK_ASYNCAXI_NOC_P_CCI, "pclk_asyncaxi_noc_p_cci",
1409 "div_aclk_mif_133", ENABLE_PCLK_MIF, 21,
1410 CLK_IGNORE_UNUSED, 0),
1411 GATE(CLK_PCLK_ASYNCAXI_CP1, "pclk_asyncaxi_cp1", "div_aclk_mif_133",
1412 ENABLE_PCLK_MIF, 19, 0, 0),
1413 GATE(CLK_PCLK_ASYNCAXI_CP0, "pclk_asyncaxi_cp0", "div_aclk_mif_133",
1414 ENABLE_PCLK_MIF, 18, 0, 0),
1415 GATE(CLK_PCLK_ASYNCAXI_DREX1_3, "pclk_asyncaxi_drex1_3",
1416 "div_aclk_mif_133", ENABLE_PCLK_MIF, 17, 0, 0),
1417 GATE(CLK_PCLK_ASYNCAXI_DREX1_1, "pclk_asyncaxi_drex1_1",
1418 "div_aclk_mif_133", ENABLE_PCLK_MIF, 16, 0, 0),
1419 GATE(CLK_PCLK_ASYNCAXI_DREX1_0, "pclk_asyncaxi_drex1_0",
1420 "div_aclk_mif_133", ENABLE_PCLK_MIF, 15, 0, 0),
1421 GATE(CLK_PCLK_ASYNCAXI_DREX0_3, "pclk_asyncaxi_drex0_3",
1422 "div_aclk_mif_133", ENABLE_PCLK_MIF, 14, 0, 0),
1423 GATE(CLK_PCLK_ASYNCAXI_DREX0_1, "pclk_asyncaxi_drex0_1",
1424 "div_aclk_mif_133", ENABLE_PCLK_MIF, 13, 0, 0),
1425 GATE(CLK_PCLK_ASYNCAXI_DREX0_0, "pclk_asyncaxi_drex0_0",
1426 "div_aclk_mif_133", ENABLE_PCLK_MIF, 12, 0, 0),
1427 GATE(CLK_PCLK_MIFSRVND_133, "pclk_mifsrvnd_133", "div_aclk_mif_133",
1428 ENABLE_PCLK_MIF, 11, 0, 0),
1429 GATE(CLK_PCLK_PMU_MIF, "pclk_pmu_mif", "div_aclk_mif_133",
1430 ENABLE_PCLK_MIF, 10, CLK_IGNORE_UNUSED, 0),
1431 GATE(CLK_PCLK_SYSREG_MIF, "pclk_sysreg_mif", "div_aclk_mif_133",
1432 ENABLE_PCLK_MIF, 9, CLK_IGNORE_UNUSED, 0),
1433 GATE(CLK_PCLK_GPIO_ALIVE, "pclk_gpio_alive", "div_aclk_mif_133",
1434 ENABLE_PCLK_MIF, 8, CLK_IGNORE_UNUSED, 0),
1435 GATE(CLK_PCLK_ABB, "pclk_abb", "div_aclk_mif_133",
1436 ENABLE_PCLK_MIF, 7, 0, 0),
1437 GATE(CLK_PCLK_PMU_APBIF, "pclk_pmu_apbif", "div_aclk_mif_133",
1438 ENABLE_PCLK_MIF, 6, CLK_IGNORE_UNUSED, 0),
1439 GATE(CLK_PCLK_DDR_PHY1, "pclk_ddr_phy1", "div_aclk_mif_133",
1440 ENABLE_PCLK_MIF, 5, 0, 0),
1441 GATE(CLK_PCLK_DREX1, "pclk_drex1", "div_aclk_mif_133",
1442 ENABLE_PCLK_MIF, 3, CLK_IGNORE_UNUSED, 0),
1443 GATE(CLK_PCLK_DDR_PHY0, "pclk_ddr_phy0", "div_aclk_mif_133",
1444 ENABLE_PCLK_MIF, 2, 0, 0),
1445 GATE(CLK_PCLK_DREX0, "pclk_drex0", "div_aclk_mif_133",
1446 ENABLE_PCLK_MIF, 0, CLK_IGNORE_UNUSED, 0),
1447
1448 /* ENABLE_PCLK_MIF_SECURE_DREX0_TZ */
1449 GATE(CLK_PCLK_DREX0_TZ, "pclk_drex0_tz", "div_aclk_mif_133",
1450 ENABLE_PCLK_MIF_SECURE_DREX0_TZ, 0,
1451 CLK_IGNORE_UNUSED, 0),
1452
1453 /* ENABLE_PCLK_MIF_SECURE_DREX1_TZ */
1454 GATE(CLK_PCLK_DREX1_TZ, "pclk_drex1_tz", "div_aclk_mif_133",
1455 ENABLE_PCLK_MIF_SECURE_DREX1_TZ, 0,
1456 CLK_IGNORE_UNUSED, 0),
1457
1458 /* ENABLE_PCLK_MIF_SECURE_MONOTONIC_CNT */
1459 GATE(CLK_PCLK_MONOTONIC_CNT, "pclk_monotonic_cnt", "div_aclk_mif_133",
1460 ENABLE_PCLK_MIF_SECURE_MONOTONIC_CNT, 0, 0, 0),
1461
1462 /* ENABLE_PCLK_MIF_SECURE_RTC */
1463 GATE(CLK_PCLK_RTC, "pclk_rtc", "div_aclk_mif_133",
1464 ENABLE_PCLK_MIF_SECURE_RTC, 0, 0, 0),
1465
1466 /* ENABLE_SCLK_MIF */
1467 GATE(CLK_SCLK_DSIM1_DISP, "sclk_dsim1_disp", "div_sclk_dsim1",
1468 ENABLE_SCLK_MIF, 15, CLK_IGNORE_UNUSED, 0),
1469 GATE(CLK_SCLK_DECON_TV_VCLK_DISP, "sclk_decon_tv_vclk_disp",
1470 "div_sclk_decon_tv_vclk", ENABLE_SCLK_MIF,
1471 14, CLK_IGNORE_UNUSED, 0),
1472 GATE(CLK_SCLK_DSIM0_DISP, "sclk_dsim0_disp", "div_sclk_dsim0",
1473 ENABLE_SCLK_MIF, 9, CLK_IGNORE_UNUSED, 0),
1474 GATE(CLK_SCLK_DSD_DISP, "sclk_dsd_disp", "div_sclk_dsd",
1475 ENABLE_SCLK_MIF, 8, CLK_IGNORE_UNUSED, 0),
1476 GATE(CLK_SCLK_DECON_TV_ECLK_DISP, "sclk_decon_tv_eclk_disp",
1477 "div_sclk_decon_tv_eclk", ENABLE_SCLK_MIF,
1478 7, CLK_IGNORE_UNUSED, 0),
1479 GATE(CLK_SCLK_DECON_VCLK_DISP, "sclk_decon_vclk_disp",
1480 "div_sclk_decon_vclk", ENABLE_SCLK_MIF,
1481 6, CLK_IGNORE_UNUSED, 0),
1482 GATE(CLK_SCLK_DECON_ECLK_DISP, "sclk_decon_eclk_disp",
1483 "div_sclk_decon_eclk", ENABLE_SCLK_MIF,
1484 5, CLK_IGNORE_UNUSED, 0),
1485 GATE(CLK_SCLK_HPM_MIF, "sclk_hpm_mif", "div_sclk_hpm_mif",
1486 ENABLE_SCLK_MIF, 4,
1487 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
1488 GATE(CLK_SCLK_MFC_PLL, "sclk_mfc_pll", "mout_mfc_pll_div2",
1489 ENABLE_SCLK_MIF, 3, CLK_IGNORE_UNUSED, 0),
1490 GATE(CLK_SCLK_BUS_PLL, "sclk_bus_pll", "mout_bus_pll_div2",
1491 ENABLE_SCLK_MIF, 2, CLK_IGNORE_UNUSED, 0),
1492 GATE(CLK_SCLK_BUS_PLL_APOLLO, "sclk_bus_pll_apollo", "sclk_bus_pll",
1493 ENABLE_SCLK_MIF, 1, CLK_IGNORE_UNUSED, 0),
1494 GATE(CLK_SCLK_BUS_PLL_ATLAS, "sclk_bus_pll_atlas", "sclk_bus_pll",
1495 ENABLE_SCLK_MIF, 0, CLK_IGNORE_UNUSED, 0),
1496};
1497
1498static const struct samsung_cmu_info mif_cmu_info __initconst = {
1499 .pll_clks = mif_pll_clks,
1500 .nr_pll_clks = ARRAY_SIZE(mif_pll_clks),
1501 .mux_clks = mif_mux_clks,
1502 .nr_mux_clks = ARRAY_SIZE(mif_mux_clks),
1503 .div_clks = mif_div_clks,
1504 .nr_div_clks = ARRAY_SIZE(mif_div_clks),
1505 .gate_clks = mif_gate_clks,
1506 .nr_gate_clks = ARRAY_SIZE(mif_gate_clks),
1507 .fixed_factor_clks = mif_fixed_factor_clks,
1508 .nr_fixed_factor_clks = ARRAY_SIZE(mif_fixed_factor_clks),
1509 .nr_clk_ids = MIF_NR_CLK,
1510 .clk_regs = mif_clk_regs,
1511 .nr_clk_regs = ARRAY_SIZE(mif_clk_regs),
1512};
1513
1514static void __init exynos5433_cmu_mif_init(struct device_node *np)
1515{
1516 samsung_cmu_register_one(np, &mif_cmu_info);
1517}
1518CLK_OF_DECLARE(exynos5433_cmu_mif, "samsung,exynos5433-cmu-mif",
1519 exynos5433_cmu_mif_init);
1520
1521/*
1522 * Register offset definitions for CMU_PERIC
1523 */
1524#define DIV_PERIC 0x0600
1525#define DIV_STAT_PERIC 0x0700
1526#define ENABLE_ACLK_PERIC 0x0800
1527#define ENABLE_PCLK_PERIC0 0x0900
1528#define ENABLE_PCLK_PERIC1 0x0904
1529#define ENABLE_SCLK_PERIC 0x0A00
1530#define ENABLE_IP_PERIC0 0x0B00
1531#define ENABLE_IP_PERIC1 0x0B04
1532#define ENABLE_IP_PERIC2 0x0B08
1533
1534static const unsigned long peric_clk_regs[] __initconst = {
1535 DIV_PERIC,
1536 ENABLE_ACLK_PERIC,
1537 ENABLE_PCLK_PERIC0,
1538 ENABLE_PCLK_PERIC1,
1539 ENABLE_SCLK_PERIC,
1540 ENABLE_IP_PERIC0,
1541 ENABLE_IP_PERIC1,
1542 ENABLE_IP_PERIC2,
1543};
1544
1545static const struct samsung_div_clock peric_div_clks[] __initconst = {
1546 /* DIV_PERIC */
1547 DIV(CLK_DIV_SCLK_SCI, "div_sclk_sci", "oscclk", DIV_PERIC, 4, 4),
1548 DIV(CLK_DIV_SCLK_SC_IN, "div_sclk_sc_in", "oscclk", DIV_PERIC, 0, 4),
1549};
1550
1551static const struct samsung_gate_clock peric_gate_clks[] __initconst = {
1552 /* ENABLE_ACLK_PERIC */
1553 GATE(CLK_ACLK_AHB2APB_PERIC2P, "aclk_ahb2apb_peric2p", "aclk_peric_66",
1554 ENABLE_ACLK_PERIC, 3, CLK_IGNORE_UNUSED, 0),
1555 GATE(CLK_ACLK_AHB2APB_PERIC1P, "aclk_ahb2apb_peric1p", "aclk_peric_66",
1556 ENABLE_ACLK_PERIC, 2, CLK_IGNORE_UNUSED, 0),
1557 GATE(CLK_ACLK_AHB2APB_PERIC0P, "aclk_ahb2apb_peric0p", "aclk_peric_66",
1558 ENABLE_ACLK_PERIC, 1, CLK_IGNORE_UNUSED, 0),
1559 GATE(CLK_ACLK_PERICNP_66, "aclk_pericnp_66", "aclk_peric_66",
1560 ENABLE_ACLK_PERIC, 0, CLK_IGNORE_UNUSED, 0),
1561
1562 /* ENABLE_PCLK_PERIC0 */
1563 GATE(CLK_PCLK_SCI, "pclk_sci", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1564 31, CLK_SET_RATE_PARENT, 0),
1565 GATE(CLK_PCLK_GPIO_FINGER, "pclk_gpio_finger", "aclk_peric_66",
1566 ENABLE_PCLK_PERIC0, 30, CLK_IGNORE_UNUSED, 0),
1567 GATE(CLK_PCLK_GPIO_ESE, "pclk_gpio_ese", "aclk_peric_66",
1568 ENABLE_PCLK_PERIC0, 29, CLK_IGNORE_UNUSED, 0),
1569 GATE(CLK_PCLK_PWM, "pclk_pwm", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1570 28, CLK_SET_RATE_PARENT, 0),
1571 GATE(CLK_PCLK_SPDIF, "pclk_spdif", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1572 26, CLK_SET_RATE_PARENT, 0),
1573 GATE(CLK_PCLK_PCM1, "pclk_pcm1", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1574 25, CLK_SET_RATE_PARENT, 0),
1575 GATE(CLK_PCLK_I2S1, "pclk_i2s", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1576 24, CLK_SET_RATE_PARENT, 0),
1577 GATE(CLK_PCLK_SPI2, "pclk_spi2", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1578 23, CLK_SET_RATE_PARENT, 0),
1579 GATE(CLK_PCLK_SPI1, "pclk_spi1", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1580 22, CLK_SET_RATE_PARENT, 0),
1581 GATE(CLK_PCLK_SPI0, "pclk_spi0", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1582 21, CLK_SET_RATE_PARENT, 0),
1583 GATE(CLK_PCLK_ADCIF, "pclk_adcif", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1584 20, CLK_SET_RATE_PARENT, 0),
1585 GATE(CLK_PCLK_GPIO_TOUCH, "pclk_gpio_touch", "aclk_peric_66",
1586 ENABLE_PCLK_PERIC0, 19, CLK_IGNORE_UNUSED, 0),
1587 GATE(CLK_PCLK_GPIO_NFC, "pclk_gpio_nfc", "aclk_peric_66",
1588 ENABLE_PCLK_PERIC0, 18, CLK_IGNORE_UNUSED, 0),
1589 GATE(CLK_PCLK_GPIO_PERIC, "pclk_gpio_peric", "aclk_peric_66",
1590 ENABLE_PCLK_PERIC0, 17, CLK_IGNORE_UNUSED, 0),
1591 GATE(CLK_PCLK_PMU_PERIC, "pclk_pmu_peric", "aclk_peric_66",
1592 ENABLE_PCLK_PERIC0, 16, CLK_SET_RATE_PARENT, 0),
1593 GATE(CLK_PCLK_SYSREG_PERIC, "pclk_sysreg_peric", "aclk_peric_66",
1594 ENABLE_PCLK_PERIC0, 15,
1595 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
1596 GATE(CLK_PCLK_UART2, "pclk_uart2", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1597 14, CLK_SET_RATE_PARENT, 0),
1598 GATE(CLK_PCLK_UART1, "pclk_uart1", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1599 13, CLK_SET_RATE_PARENT, 0),
1600 GATE(CLK_PCLK_UART0, "pclk_uart0", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1601 12, CLK_SET_RATE_PARENT, 0),
1602 GATE(CLK_PCLK_HSI2C3, "pclk_hsi2c3", "aclk_peric_66",
1603 ENABLE_PCLK_PERIC0, 11, CLK_SET_RATE_PARENT, 0),
1604 GATE(CLK_PCLK_HSI2C2, "pclk_hsi2c2", "aclk_peric_66",
1605 ENABLE_PCLK_PERIC0, 10, CLK_SET_RATE_PARENT, 0),
1606 GATE(CLK_PCLK_HSI2C1, "pclk_hsi2c1", "aclk_peric_66",
1607 ENABLE_PCLK_PERIC0, 9, CLK_SET_RATE_PARENT, 0),
1608 GATE(CLK_PCLK_HSI2C0, "pclk_hsi2c0", "aclk_peric_66",
1609 ENABLE_PCLK_PERIC0, 8, CLK_SET_RATE_PARENT, 0),
1610 GATE(CLK_PCLK_I2C7, "pclk_i2c7", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1611 7, CLK_SET_RATE_PARENT, 0),
1612 GATE(CLK_PCLK_I2C6, "pclk_i2c6", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1613 6, CLK_SET_RATE_PARENT, 0),
1614 GATE(CLK_PCLK_I2C5, "pclk_i2c5", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1615 5, CLK_SET_RATE_PARENT, 0),
1616 GATE(CLK_PCLK_I2C4, "pclk_i2c4", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1617 4, CLK_SET_RATE_PARENT, 0),
1618 GATE(CLK_PCLK_I2C3, "pclk_i2c3", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1619 3, CLK_SET_RATE_PARENT, 0),
1620 GATE(CLK_PCLK_I2C2, "pclk_i2c2", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1621 2, CLK_SET_RATE_PARENT, 0),
1622 GATE(CLK_PCLK_I2C1, "pclk_i2c1", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1623 1, CLK_SET_RATE_PARENT, 0),
1624 GATE(CLK_PCLK_I2C0, "pclk_i2c0", "aclk_peric_66", ENABLE_PCLK_PERIC0,
1625 0, CLK_SET_RATE_PARENT, 0),
1626
1627 /* ENABLE_PCLK_PERIC1 */
1628 GATE(CLK_PCLK_SPI4, "pclk_spi4", "aclk_peric_66", ENABLE_PCLK_PERIC1,
1629 9, CLK_SET_RATE_PARENT, 0),
1630 GATE(CLK_PCLK_SPI3, "pclk_spi3", "aclk_peric_66", ENABLE_PCLK_PERIC1,
1631 8, CLK_SET_RATE_PARENT, 0),
1632 GATE(CLK_PCLK_HSI2C11, "pclk_hsi2c11", "aclk_peric_66",
1633 ENABLE_PCLK_PERIC1, 7, CLK_SET_RATE_PARENT, 0),
1634 GATE(CLK_PCLK_HSI2C10, "pclk_hsi2c10", "aclk_peric_66",
1635 ENABLE_PCLK_PERIC1, 6, CLK_SET_RATE_PARENT, 0),
1636 GATE(CLK_PCLK_HSI2C9, "pclk_hsi2c9", "aclk_peric_66",
1637 ENABLE_PCLK_PERIC1, 5, CLK_SET_RATE_PARENT, 0),
1638 GATE(CLK_PCLK_HSI2C8, "pclk_hsi2c8", "aclk_peric_66",
1639 ENABLE_PCLK_PERIC1, 4, CLK_SET_RATE_PARENT, 0),
1640 GATE(CLK_PCLK_HSI2C7, "pclk_hsi2c7", "aclk_peric_66",
1641 ENABLE_PCLK_PERIC1, 3, CLK_SET_RATE_PARENT, 0),
1642 GATE(CLK_PCLK_HSI2C6, "pclk_hsi2c6", "aclk_peric_66",
1643 ENABLE_PCLK_PERIC1, 2, CLK_SET_RATE_PARENT, 0),
1644 GATE(CLK_PCLK_HSI2C5, "pclk_hsi2c5", "aclk_peric_66",
1645 ENABLE_PCLK_PERIC1, 1, CLK_SET_RATE_PARENT, 0),
1646 GATE(CLK_PCLK_HSI2C4, "pclk_hsi2c4", "aclk_peric_66",
1647 ENABLE_PCLK_PERIC1, 0, CLK_SET_RATE_PARENT, 0),
1648
1649 /* ENABLE_SCLK_PERIC */
1650 GATE(CLK_SCLK_IOCLK_SPI4, "sclk_ioclk_spi4", "ioclk_spi4_clk_in",
1651 ENABLE_SCLK_PERIC, 21, CLK_SET_RATE_PARENT, 0),
1652 GATE(CLK_SCLK_IOCLK_SPI3, "sclk_ioclk_spi3", "ioclk_spi3_clk_in",
1653 ENABLE_SCLK_PERIC, 20, CLK_SET_RATE_PARENT, 0),
1654 GATE(CLK_SCLK_SPI4, "sclk_spi4", "sclk_spi4_peric", ENABLE_SCLK_PERIC,
1655 19, CLK_SET_RATE_PARENT, 0),
1656 GATE(CLK_SCLK_SPI3, "sclk_spi3", "sclk_spi3_peric", ENABLE_SCLK_PERIC,
1657 18, CLK_SET_RATE_PARENT, 0),
1658 GATE(CLK_SCLK_SCI, "sclk_sci", "div_sclk_sci", ENABLE_SCLK_PERIC,
1659 17, 0, 0),
1660 GATE(CLK_SCLK_SC_IN, "sclk_sc_in", "div_sclk_sc_in", ENABLE_SCLK_PERIC,
1661 16, 0, 0),
1662 GATE(CLK_SCLK_PWM, "sclk_pwm", "oscclk", ENABLE_SCLK_PERIC, 15, 0, 0),
1663 GATE(CLK_SCLK_IOCLK_SPI2, "sclk_ioclk_spi2", "ioclk_spi2_clk_in",
1664 ENABLE_SCLK_PERIC, 13, CLK_SET_RATE_PARENT, 0),
1665 GATE(CLK_SCLK_IOCLK_SPI1, "sclk_ioclk_spi1", "ioclk_spi1_clk_in",
1666 ENABLE_SCLK_PERIC, 12, CLK_SET_RATE_PARENT, 0),
1667 GATE(CLK_SCLK_IOCLK_SPI0, "sclk_ioclk_spi0", "ioclk_spi0_clk_in",
1668 ENABLE_SCLK_PERIC, 11, CLK_SET_RATE_PARENT, 0),
1669 GATE(CLK_SCLK_IOCLK_I2S1_BCLK, "sclk_ioclk_i2s1_bclk",
1670 "ioclk_i2s1_bclk_in", ENABLE_SCLK_PERIC, 10,
1671 CLK_SET_RATE_PARENT, 0),
1672 GATE(CLK_SCLK_SPDIF, "sclk_spdif", "sclk_spdif_peric",
1673 ENABLE_SCLK_PERIC, 8, CLK_SET_RATE_PARENT, 0),
1674 GATE(CLK_SCLK_PCM1, "sclk_pcm1", "sclk_pcm1_peric",
1675 ENABLE_SCLK_PERIC, 7, CLK_SET_RATE_PARENT, 0),
1676 GATE(CLK_SCLK_I2S1, "sclk_i2s1", "sclk_i2s1_peric",
1677 ENABLE_SCLK_PERIC, 6,
1678 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
1679 GATE(CLK_SCLK_SPI2, "sclk_spi2", "sclk_spi2_peric", ENABLE_SCLK_PERIC,
1680 5, CLK_SET_RATE_PARENT, 0),
1681 GATE(CLK_SCLK_SPI1, "sclk_spi1", "sclk_spi1_peric", ENABLE_SCLK_PERIC,
1682 4, CLK_SET_RATE_PARENT, 0),
1683 GATE(CLK_SCLK_SPI0, "sclk_spi0", "sclk_spi0_peric", ENABLE_SCLK_PERIC,
1684 3, CLK_SET_RATE_PARENT, 0),
1685 GATE(CLK_SCLK_UART2, "sclk_uart2", "sclk_uart2_peric",
1686 ENABLE_SCLK_PERIC, 2,
1687 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
1688 GATE(CLK_SCLK_UART1, "sclk_uart1", "sclk_uart1_peric",
1689 ENABLE_SCLK_PERIC, 1,
1690 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
1691 GATE(CLK_SCLK_UART0, "sclk_uart0", "sclk_uart0_peric",
1692 ENABLE_SCLK_PERIC, 0,
1693 CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0),
1694};
1695
1696static const struct samsung_cmu_info peric_cmu_info __initconst = {
1697 .div_clks = peric_div_clks,
1698 .nr_div_clks = ARRAY_SIZE(peric_div_clks),
1699 .gate_clks = peric_gate_clks,
1700 .nr_gate_clks = ARRAY_SIZE(peric_gate_clks),
1701 .nr_clk_ids = PERIC_NR_CLK,
1702 .clk_regs = peric_clk_regs,
1703 .nr_clk_regs = ARRAY_SIZE(peric_clk_regs),
1704};
1705
1706static void __init exynos5433_cmu_peric_init(struct device_node *np)
1707{
1708 samsung_cmu_register_one(np, &peric_cmu_info);
1709}
1710
1711CLK_OF_DECLARE(exynos5433_cmu_peric, "samsung,exynos5433-cmu-peric",
1712 exynos5433_cmu_peric_init);
1713
1714/*
1715 * Register offset definitions for CMU_PERIS
1716 */
1717#define ENABLE_ACLK_PERIS 0x0800
1718#define ENABLE_PCLK_PERIS 0x0900
1719#define ENABLE_PCLK_PERIS_SECURE_TZPC 0x0904
1720#define ENABLE_PCLK_PERIS_SECURE_SECKEY_APBIF 0x0908
1721#define ENABLE_PCLK_PERIS_SECURE_CHIPID_APBIF 0x090c
1722#define ENABLE_PCLK_PERIS_SECURE_TOPRTC 0x0910
1723#define ENABLE_PCLK_PERIS_SECURE_CUSTOM_EFUSE_APBIF 0x0914
1724#define ENABLE_PCLK_PERIS_SECURE_ANTIRBK_CNT_APBIF 0x0918
1725#define ENABLE_PCLK_PERIS_SECURE_OTP_CON_APBIF 0x091c
1726#define ENABLE_SCLK_PERIS 0x0a00
1727#define ENABLE_SCLK_PERIS_SECURE_SECKEY 0x0a04
1728#define ENABLE_SCLK_PERIS_SECURE_CHIPID 0x0a08
1729#define ENABLE_SCLK_PERIS_SECURE_TOPRTC 0x0a0c
1730#define ENABLE_SCLK_PERIS_SECURE_CUSTOM_EFUSE 0x0a10
1731#define ENABLE_SCLK_PERIS_SECURE_ANTIRBK_CNT 0x0a14
1732#define ENABLE_SCLK_PERIS_SECURE_OTP_CON 0x0a18
1733#define ENABLE_IP_PERIS0 0x0b00
1734#define ENABLE_IP_PERIS1 0x0b04
1735#define ENABLE_IP_PERIS_SECURE_TZPC 0x0b08
1736#define ENABLE_IP_PERIS_SECURE_SECKEY 0x0b0c
1737#define ENABLE_IP_PERIS_SECURE_CHIPID 0x0b10
1738#define ENABLE_IP_PERIS_SECURE_TOPRTC 0x0b14
1739#define ENABLE_IP_PERIS_SECURE_CUSTOM_EFUSE 0x0b18
1740#define ENABLE_IP_PERIS_SECURE_ANTIBRK_CNT 0x0b1c
1741#define ENABLE_IP_PERIS_SECURE_OTP_CON 0x0b20
1742
1743static const unsigned long peris_clk_regs[] __initconst = {
1744 ENABLE_ACLK_PERIS,
1745 ENABLE_PCLK_PERIS,
1746 ENABLE_PCLK_PERIS_SECURE_TZPC,
1747 ENABLE_PCLK_PERIS_SECURE_SECKEY_APBIF,
1748 ENABLE_PCLK_PERIS_SECURE_CHIPID_APBIF,
1749 ENABLE_PCLK_PERIS_SECURE_TOPRTC,
1750 ENABLE_PCLK_PERIS_SECURE_CUSTOM_EFUSE_APBIF,
1751 ENABLE_PCLK_PERIS_SECURE_ANTIRBK_CNT_APBIF,
1752 ENABLE_PCLK_PERIS_SECURE_OTP_CON_APBIF,
1753 ENABLE_SCLK_PERIS,
1754 ENABLE_SCLK_PERIS_SECURE_SECKEY,
1755 ENABLE_SCLK_PERIS_SECURE_CHIPID,
1756 ENABLE_SCLK_PERIS_SECURE_TOPRTC,
1757 ENABLE_SCLK_PERIS_SECURE_CUSTOM_EFUSE,
1758 ENABLE_SCLK_PERIS_SECURE_ANTIRBK_CNT,
1759 ENABLE_SCLK_PERIS_SECURE_OTP_CON,
1760 ENABLE_IP_PERIS0,
1761 ENABLE_IP_PERIS1,
1762 ENABLE_IP_PERIS_SECURE_TZPC,
1763 ENABLE_IP_PERIS_SECURE_SECKEY,
1764 ENABLE_IP_PERIS_SECURE_CHIPID,
1765 ENABLE_IP_PERIS_SECURE_TOPRTC,
1766 ENABLE_IP_PERIS_SECURE_CUSTOM_EFUSE,
1767 ENABLE_IP_PERIS_SECURE_ANTIBRK_CNT,
1768 ENABLE_IP_PERIS_SECURE_OTP_CON,
1769};
1770
1771static const struct samsung_gate_clock peris_gate_clks[] __initconst = {
1772 /* ENABLE_ACLK_PERIS */
1773 GATE(CLK_ACLK_AHB2APB_PERIS1P, "aclk_ahb2apb_peris1p", "aclk_peris_66",
1774 ENABLE_ACLK_PERIS, 2, CLK_IGNORE_UNUSED, 0),
1775 GATE(CLK_ACLK_AHB2APB_PERIS0P, "aclk_ahb2apb_peris0p", "aclk_peris_66",
1776 ENABLE_ACLK_PERIS, 1, CLK_IGNORE_UNUSED, 0),
1777 GATE(CLK_ACLK_PERISNP_66, "aclk_perisnp_66", "aclk_peris_66",
1778 ENABLE_ACLK_PERIS, 0, CLK_IGNORE_UNUSED, 0),
1779
1780 /* ENABLE_PCLK_PERIS */
1781 GATE(CLK_PCLK_HPM_APBIF, "pclk_hpm_apbif", "aclk_peris_66",
1782 ENABLE_PCLK_PERIS, 30, CLK_IGNORE_UNUSED, 0),
1783 GATE(CLK_PCLK_TMU1_APBIF, "pclk_tmu1_apbif", "aclk_peris_66",
1784 ENABLE_PCLK_PERIS, 24, CLK_IGNORE_UNUSED, 0),
1785 GATE(CLK_PCLK_TMU0_APBIF, "pclk_tmu0_apbif", "aclk_peris_66",
1786 ENABLE_PCLK_PERIS, 23, CLK_IGNORE_UNUSED, 0),
1787 GATE(CLK_PCLK_PMU_PERIS, "pclk_pmu_peris", "aclk_peris_66",
1788 ENABLE_PCLK_PERIS, 22, CLK_IGNORE_UNUSED, 0),
1789 GATE(CLK_PCLK_SYSREG_PERIS, "pclk_sysreg_peris", "aclk_peris_66",
1790 ENABLE_PCLK_PERIS, 21, CLK_IGNORE_UNUSED, 0),
1791 GATE(CLK_PCLK_CMU_TOP_APBIF, "pclk_cmu_top_apbif", "aclk_peris_66",
1792 ENABLE_PCLK_PERIS, 20, CLK_IGNORE_UNUSED, 0),
1793 GATE(CLK_PCLK_WDT_APOLLO, "pclk_wdt_apollo", "aclk_peris_66",
1794 ENABLE_PCLK_PERIS, 17, CLK_IGNORE_UNUSED, 0),
1795 GATE(CLK_PCLK_WDT_ATLAS, "pclk_wdt_atlas", "aclk_peris_66",
1796 ENABLE_PCLK_PERIS, 16, CLK_IGNORE_UNUSED, 0),
1797 GATE(CLK_PCLK_MCT, "pclk_mct", "aclk_peris_66",
1798 ENABLE_PCLK_PERIS, 15, CLK_IGNORE_UNUSED, 0),
1799 GATE(CLK_PCLK_HDMI_CEC, "pclk_hdmi_cec", "aclk_peris_66",
1800 ENABLE_PCLK_PERIS, 14, CLK_IGNORE_UNUSED, 0),
1801
1802 /* ENABLE_PCLK_PERIS_SECURE_TZPC */
1803 GATE(CLK_PCLK_TZPC12, "pclk_tzpc12", "aclk_peris_66",
1804 ENABLE_PCLK_PERIS_SECURE_TZPC, 12, CLK_IGNORE_UNUSED, 0),
1805 GATE(CLK_PCLK_TZPC11, "pclk_tzpc11", "aclk_peris_66",
1806 ENABLE_PCLK_PERIS_SECURE_TZPC, 11, CLK_IGNORE_UNUSED, 0),
1807 GATE(CLK_PCLK_TZPC10, "pclk_tzpc10", "aclk_peris_66",
1808 ENABLE_PCLK_PERIS_SECURE_TZPC, 10, CLK_IGNORE_UNUSED, 0),
1809 GATE(CLK_PCLK_TZPC9, "pclk_tzpc9", "aclk_peris_66",
1810 ENABLE_PCLK_PERIS_SECURE_TZPC, 9, CLK_IGNORE_UNUSED, 0),
1811 GATE(CLK_PCLK_TZPC8, "pclk_tzpc8", "aclk_peris_66",
1812 ENABLE_PCLK_PERIS_SECURE_TZPC, 8, CLK_IGNORE_UNUSED, 0),
1813 GATE(CLK_PCLK_TZPC7, "pclk_tzpc7", "aclk_peris_66",
1814 ENABLE_PCLK_PERIS_SECURE_TZPC, 7, CLK_IGNORE_UNUSED, 0),
1815 GATE(CLK_PCLK_TZPC6, "pclk_tzpc6", "aclk_peris_66",
1816 ENABLE_PCLK_PERIS_SECURE_TZPC, 6, CLK_IGNORE_UNUSED, 0),
1817 GATE(CLK_PCLK_TZPC5, "pclk_tzpc5", "aclk_peris_66",
1818 ENABLE_PCLK_PERIS_SECURE_TZPC, 5, CLK_IGNORE_UNUSED, 0),
1819 GATE(CLK_PCLK_TZPC4, "pclk_tzpc4", "aclk_peris_66",
1820 ENABLE_PCLK_PERIS_SECURE_TZPC, 4, CLK_IGNORE_UNUSED, 0),
1821 GATE(CLK_PCLK_TZPC3, "pclk_tzpc3", "aclk_peris_66",
1822 ENABLE_PCLK_PERIS_SECURE_TZPC, 3, CLK_IGNORE_UNUSED, 0),
1823 GATE(CLK_PCLK_TZPC2, "pclk_tzpc2", "aclk_peris_66",
1824 ENABLE_PCLK_PERIS_SECURE_TZPC, 2, CLK_IGNORE_UNUSED, 0),
1825 GATE(CLK_PCLK_TZPC1, "pclk_tzpc1", "aclk_peris_66",
1826 ENABLE_PCLK_PERIS_SECURE_TZPC, 1, CLK_IGNORE_UNUSED, 0),
1827 GATE(CLK_PCLK_TZPC0, "pclk_tzpc0", "aclk_peris_66",
1828 ENABLE_PCLK_PERIS_SECURE_TZPC, 0, CLK_IGNORE_UNUSED, 0),
1829
1830 /* ENABLE_PCLK_PERIS_SECURE_SECKEY_APBIF */
1831 GATE(CLK_PCLK_SECKEY_APBIF, "pclk_seckey_apbif", "aclk_peris_66",
1832 ENABLE_PCLK_PERIS_SECURE_SECKEY_APBIF, 0, CLK_IGNORE_UNUSED, 0),
1833
1834 /* ENABLE_PCLK_PERIS_SECURE_CHIPID_APBIF */
1835 GATE(CLK_PCLK_CHIPID_APBIF, "pclk_chipid_apbif", "aclk_peris_66",
1836 ENABLE_PCLK_PERIS_SECURE_CHIPID_APBIF, 0, CLK_IGNORE_UNUSED, 0),
1837
1838 /* ENABLE_PCLK_PERIS_SECURE_TOPRTC */
1839 GATE(CLK_PCLK_TOPRTC, "pclk_toprtc", "aclk_peris_66",
1840 ENABLE_PCLK_PERIS_SECURE_TOPRTC, 0, 0, 0),
1841
1842 /* ENABLE_PCLK_PERIS_SECURE_CUSTOM_EFUSE_APBIF */
1843 GATE(CLK_PCLK_CUSTOM_EFUSE_APBIF, "pclk_custom_efuse_apbif",
1844 "aclk_peris_66",
1845 ENABLE_PCLK_PERIS_SECURE_CUSTOM_EFUSE_APBIF, 0, 0, 0),
1846
1847 /* ENABLE_PCLK_PERIS_SECURE_ANTIRBK_CNT_APBIF */
1848 GATE(CLK_PCLK_ANTIRBK_CNT_APBIF, "pclk_antirbk_cnt_apbif",
1849 "aclk_peris_66",
1850 ENABLE_PCLK_PERIS_SECURE_ANTIRBK_CNT_APBIF, 0, 0, 0),
1851
1852 /* ENABLE_PCLK_PERIS_SECURE_OTP_CON_APBIF */
1853 GATE(CLK_PCLK_OTP_CON_APBIF, "pclk_otp_con_apbif",
1854 "aclk_peris_66",
1855 ENABLE_PCLK_PERIS_SECURE_OTP_CON_APBIF, 0, 0, 0),
1856
1857 /* ENABLE_SCLK_PERIS */
1858 GATE(CLK_SCLK_ASV_TB, "sclk_asv_tb", "oscclk_efuse_common",
1859 ENABLE_SCLK_PERIS, 10, 0, 0),
1860 GATE(CLK_SCLK_TMU1, "sclk_tmu1", "oscclk_efuse_common",
1861 ENABLE_SCLK_PERIS, 4, 0, 0),
1862 GATE(CLK_SCLK_TMU0, "sclk_tmu0", "oscclk_efuse_common",
1863 ENABLE_SCLK_PERIS, 3, 0, 0),
1864
1865 /* ENABLE_SCLK_PERIS_SECURE_SECKEY */
1866 GATE(CLK_SCLK_SECKEY, "sclk_seckey", "oscclk_efuse_common",
1867 ENABLE_SCLK_PERIS_SECURE_SECKEY, 0, CLK_IGNORE_UNUSED, 0),
1868
1869 /* ENABLE_SCLK_PERIS_SECURE_CHIPID */
1870 GATE(CLK_SCLK_CHIPID, "sclk_chipid", "oscclk_efuse_common",
1871 ENABLE_SCLK_PERIS_SECURE_CHIPID, 0, CLK_IGNORE_UNUSED, 0),
1872
1873 /* ENABLE_SCLK_PERIS_SECURE_TOPRTC */
1874 GATE(CLK_SCLK_TOPRTC, "sclk_toprtc", "oscclk_efuse_common",
1875 ENABLE_SCLK_PERIS_SECURE_TOPRTC, 0, 0, 0),
1876
1877 /* ENABLE_SCLK_PERIS_SECURE_CUSTOM_EFUSE */
1878 GATE(CLK_SCLK_CUSTOM_EFUSE, "sclk_custom_efuse", "oscclk_efuse_common",
1879 ENABLE_SCLK_PERIS_SECURE_CUSTOM_EFUSE, 0, 0, 0),
1880
1881 /* ENABLE_SCLK_PERIS_SECURE_ANTIRBK_CNT */
1882 GATE(CLK_SCLK_ANTIRBK_CNT, "sclk_antirbk_cnt", "oscclk_efuse_common",
1883 ENABLE_SCLK_PERIS_SECURE_ANTIRBK_CNT, 0, 0, 0),
1884
1885 /* ENABLE_SCLK_PERIS_SECURE_OTP_CON */
1886 GATE(CLK_SCLK_OTP_CON, "sclk_otp_con", "oscclk_efuse_common",
1887 ENABLE_SCLK_PERIS_SECURE_OTP_CON, 0, 0, 0),
1888};
1889
1890static const struct samsung_cmu_info peris_cmu_info __initconst = {
1891 .gate_clks = peris_gate_clks,
1892 .nr_gate_clks = ARRAY_SIZE(peris_gate_clks),
1893 .nr_clk_ids = PERIS_NR_CLK,
1894 .clk_regs = peris_clk_regs,
1895 .nr_clk_regs = ARRAY_SIZE(peris_clk_regs),
1896};
1897
1898static void __init exynos5433_cmu_peris_init(struct device_node *np)
1899{
1900 samsung_cmu_register_one(np, &peris_cmu_info);
1901}
1902
1903CLK_OF_DECLARE(exynos5433_cmu_peris, "samsung,exynos5433-cmu-peris",
1904 exynos5433_cmu_peris_init);
1905
1906/*
1907 * Register offset definitions for CMU_FSYS
1908 */
1909#define MUX_SEL_FSYS0 0x0200
1910#define MUX_SEL_FSYS1 0x0204
1911#define MUX_SEL_FSYS2 0x0208
1912#define MUX_SEL_FSYS3 0x020c
1913#define MUX_SEL_FSYS4 0x0210
1914#define MUX_ENABLE_FSYS0 0x0300
1915#define MUX_ENABLE_FSYS1 0x0304
1916#define MUX_ENABLE_FSYS2 0x0308
1917#define MUX_ENABLE_FSYS3 0x030c
1918#define MUX_ENABLE_FSYS4 0x0310
1919#define MUX_STAT_FSYS0 0x0400
1920#define MUX_STAT_FSYS1 0x0404
1921#define MUX_STAT_FSYS2 0x0408
1922#define MUX_STAT_FSYS3 0x040c
1923#define MUX_STAT_FSYS4 0x0410
1924#define MUX_IGNORE_FSYS2 0x0508
1925#define MUX_IGNORE_FSYS3 0x050c
1926#define ENABLE_ACLK_FSYS0 0x0800
1927#define ENABLE_ACLK_FSYS1 0x0804
1928#define ENABLE_PCLK_FSYS 0x0900
1929#define ENABLE_SCLK_FSYS 0x0a00
1930#define ENABLE_IP_FSYS0 0x0b00
1931#define ENABLE_IP_FSYS1 0x0b04
1932
1933/* list of all parent clock list */
1934PNAME(mout_sclk_ufs_mphy_user_p) = { "oscclk", "sclk_ufs_mphy", };
1935PNAME(mout_aclk_fsys_200_user_p) = { "oscclk", "aclk_fsys_200", };
1936PNAME(mout_sclk_pcie_100_user_p) = { "oscclk", "sclk_pcie_100_fsys",};
1937PNAME(mout_sclk_ufsunipro_user_p) = { "oscclk", "sclk_ufsunipro_fsys",};
1938PNAME(mout_sclk_mmc2_user_p) = { "oscclk", "sclk_mmc2_fsys", };
1939PNAME(mout_sclk_mmc1_user_p) = { "oscclk", "sclk_mmc1_fsys", };
1940PNAME(mout_sclk_mmc0_user_p) = { "oscclk", "sclk_mmc0_fsys", };
1941PNAME(mout_sclk_usbhost30_user_p) = { "oscclk", "sclk_usbhost30_fsys",};
1942PNAME(mout_sclk_usbdrd30_user_p) = { "oscclk", "sclk_usbdrd30_fsys", };
1943
1944PNAME(mout_phyclk_usbhost30_uhost30_pipe_pclk_user_p)
1945 = { "oscclk", "phyclk_usbhost30_uhost30_pipe_pclk_phy", };
1946PNAME(mout_phyclk_usbhost30_uhost30_phyclock_user_p)
1947 = { "oscclk", "phyclk_usbhost30_uhost30_phyclock_phy", };
1948PNAME(mout_phyclk_usbhost20_phy_hsic1_p)
1949 = { "oscclk", "phyclk_usbhost20_phy_hsic1_phy", };
1950PNAME(mout_phyclk_usbhost20_phy_clk48mohci_user_p)
1951 = { "oscclk", "phyclk_usbhost20_phy_clk48mohci_phy", };
1952PNAME(mout_phyclk_usbhost20_phy_phyclock_user_p)
1953 = { "oscclk", "phyclk_usbhost20_phy_phyclock_phy", };
1954PNAME(mout_phyclk_usbhost20_phy_freeclk_user_p)
1955 = { "oscclk", "phyclk_usbhost20_phy_freeclk_phy", };
1956PNAME(mout_phyclk_usbdrd30_udrd30_pipe_pclk_p)
1957 = { "oscclk", "phyclk_usbdrd30_udrd30_pipe_pclk_phy", };
1958PNAME(mout_phyclk_usbdrd30_udrd30_phyclock_user_p)
1959 = { "oscclk", "phyclk_usbdrd30_udrd30_phyclock_phy", };
1960PNAME(mout_phyclk_ufs_rx1_symbol_user_p)
1961 = { "oscclk", "phyclk_ufs_rx1_symbol_phy", };
1962PNAME(mout_phyclk_ufs_rx0_symbol_user_p)
1963 = { "oscclk", "phyclk_ufs_rx0_symbol_phy", };
1964PNAME(mout_phyclk_ufs_tx1_symbol_user_p)
1965 = { "oscclk", "phyclk_ufs_tx1_symbol_phy", };
1966PNAME(mout_phyclk_ufs_tx0_symbol_user_p)
1967 = { "oscclk", "phyclk_ufs_tx0_symbol_phy", };
1968PNAME(mout_phyclk_lli_mphy_to_ufs_user_p)
1969 = { "oscclk", "phyclk_lli_mphy_to_ufs_phy", };
1970PNAME(mout_sclk_mphy_p)
1971 = { "mout_sclk_ufs_mphy_user",
1972 "mout_phyclk_lli_mphy_to_ufs_user", };
1973
1974static const unsigned long fsys_clk_regs[] __initconst = {
1975 MUX_SEL_FSYS0,
1976 MUX_SEL_FSYS1,
1977 MUX_SEL_FSYS2,
1978 MUX_SEL_FSYS3,
1979 MUX_SEL_FSYS4,
1980 MUX_ENABLE_FSYS0,
1981 MUX_ENABLE_FSYS1,
1982 MUX_ENABLE_FSYS2,
1983 MUX_ENABLE_FSYS3,
1984 MUX_ENABLE_FSYS4,
1985 MUX_IGNORE_FSYS2,
1986 MUX_IGNORE_FSYS3,
1987 ENABLE_ACLK_FSYS0,
1988 ENABLE_ACLK_FSYS1,
1989 ENABLE_PCLK_FSYS,
1990 ENABLE_SCLK_FSYS,
1991 ENABLE_IP_FSYS0,
1992 ENABLE_IP_FSYS1,
1993};
1994
1995static const struct samsung_fixed_rate_clock fsys_fixed_clks[] __initconst = {
1996 /* PHY clocks from USBDRD30_PHY */
1997 FRATE(CLK_PHYCLK_USBDRD30_UDRD30_PHYCLOCK_PHY,
1998 "phyclk_usbdrd30_udrd30_phyclock_phy", NULL,
1999 0, 60000000),
2000 FRATE(CLK_PHYCLK_USBDRD30_UDRD30_PIPE_PCLK_PHY,
2001 "phyclk_usbdrd30_udrd30_pipe_pclk_phy", NULL,
2002 0, 125000000),
2003 /* PHY clocks from USBHOST30_PHY */
2004 FRATE(CLK_PHYCLK_USBHOST30_UHOST30_PHYCLOCK_PHY,
2005 "phyclk_usbhost30_uhost30_phyclock_phy", NULL,
2006 0, 60000000),
2007 FRATE(CLK_PHYCLK_USBHOST30_UHOST30_PIPE_PCLK_PHY,
2008 "phyclk_usbhost30_uhost30_pipe_pclk_phy", NULL,
2009 0, 125000000),
2010 /* PHY clocks from USBHOST20_PHY */
2011 FRATE(CLK_PHYCLK_USBHOST20_PHY_FREECLK_PHY,
2012 "phyclk_usbhost20_phy_freeclk_phy", NULL, 0, 60000000),
2013 FRATE(CLK_PHYCLK_USBHOST20_PHY_PHYCLOCK_PHY,
2014 "phyclk_usbhost20_phy_phyclock_phy", NULL, 0, 60000000),
2015 FRATE(CLK_PHYCLK_USBHOST20_PHY_CLK48MOHCI_PHY,
2016 "phyclk_usbhost20_phy_clk48mohci_phy", NULL,
2017 0, 48000000),
2018 FRATE(CLK_PHYCLK_USBHOST20_PHY_HSIC1_PHY,
2019 "phyclk_usbhost20_phy_hsic1_phy", NULL, 0,
2020 60000000),
2021 /* PHY clocks from UFS_PHY */
2022 FRATE(CLK_PHYCLK_UFS_TX0_SYMBOL_PHY, "phyclk_ufs_tx0_symbol_phy",
2023 NULL, 0, 300000000),
2024 FRATE(CLK_PHYCLK_UFS_RX0_SYMBOL_PHY, "phyclk_ufs_rx0_symbol_phy",
2025 NULL, 0, 300000000),
2026 FRATE(CLK_PHYCLK_UFS_TX1_SYMBOL_PHY, "phyclk_ufs_tx1_symbol_phy",
2027 NULL, 0, 300000000),
2028 FRATE(CLK_PHYCLK_UFS_RX1_SYMBOL_PHY, "phyclk_ufs_rx1_symbol_phy",
2029 NULL, 0, 300000000),
2030 /* PHY clocks from LLI_PHY */
2031 FRATE(CLK_PHYCLK_LLI_MPHY_TO_UFS_PHY, "phyclk_lli_mphy_to_ufs_phy",
2032 NULL, 0, 26000000),
2033};
2034
2035static const struct samsung_mux_clock fsys_mux_clks[] __initconst = {
2036 /* MUX_SEL_FSYS0 */
2037 MUX(CLK_MOUT_SCLK_UFS_MPHY_USER, "mout_sclk_ufs_mphy_user",
2038 mout_sclk_ufs_mphy_user_p, MUX_SEL_FSYS0, 4, 1),
2039 MUX(CLK_MOUT_ACLK_FSYS_200_USER, "mout_aclk_fsys_200_user",
2040 mout_aclk_fsys_200_user_p, MUX_SEL_FSYS0, 0, 1),
2041
2042 /* MUX_SEL_FSYS1 */
2043 MUX(CLK_MOUT_SCLK_PCIE_100_USER, "mout_sclk_pcie_100_user",
2044 mout_sclk_pcie_100_user_p, MUX_SEL_FSYS1, 28, 1),
2045 MUX(CLK_MOUT_SCLK_UFSUNIPRO_USER, "mout_sclk_ufsunipro_user",
2046 mout_sclk_ufsunipro_user_p, MUX_SEL_FSYS1, 24, 1),
2047 MUX(CLK_MOUT_SCLK_MMC2_USER, "mout_sclk_mmc2_user",
2048 mout_sclk_mmc2_user_p, MUX_SEL_FSYS1, 20, 1),
2049 MUX(CLK_MOUT_SCLK_MMC1_USER, "mout_sclk_mmc1_user",
2050 mout_sclk_mmc1_user_p, MUX_SEL_FSYS1, 16, 1),
2051 MUX(CLK_MOUT_SCLK_MMC0_USER, "mout_sclk_mmc0_user",
2052 mout_sclk_mmc0_user_p, MUX_SEL_FSYS1, 12, 1),
2053 MUX(CLK_MOUT_SCLK_USBHOST30_USER, "mout_sclk_usbhost30_user",
2054 mout_sclk_usbhost30_user_p, MUX_SEL_FSYS1, 4, 1),
2055 MUX(CLK_MOUT_SCLK_USBDRD30_USER, "mout_sclk_usbdrd30_user",
2056 mout_sclk_usbdrd30_user_p, MUX_SEL_FSYS1, 0, 1),
2057
2058 /* MUX_SEL_FSYS2 */
2059 MUX(CLK_MOUT_PHYCLK_USBHOST30_UHOST30_PIPE_PCLK_USER,
2060 "mout_phyclk_usbhost30_uhost30_pipe_pclk_user",
2061 mout_phyclk_usbhost30_uhost30_pipe_pclk_user_p,
2062 MUX_SEL_FSYS2, 28, 1),
2063 MUX(CLK_MOUT_PHYCLK_USBHOST30_UHOST30_PHYCLOCK_USER,
2064 "mout_phyclk_usbhost30_uhost30_phyclock_user",
2065 mout_phyclk_usbhost30_uhost30_phyclock_user_p,
2066 MUX_SEL_FSYS2, 24, 1),
2067 MUX(CLK_MOUT_PHYCLK_USBHOST20_PHY_HSIC1_USER,
2068 "mout_phyclk_usbhost20_phy_hsic1",
2069 mout_phyclk_usbhost20_phy_hsic1_p,
2070 MUX_SEL_FSYS2, 20, 1),
2071 MUX(CLK_MOUT_PHYCLK_USBHOST20_PHY_CLK48MOHCI_USER,
2072 "mout_phyclk_usbhost20_phy_clk48mohci_user",
2073 mout_phyclk_usbhost20_phy_clk48mohci_user_p,
2074 MUX_SEL_FSYS2, 16, 1),
2075 MUX(CLK_MOUT_PHYCLK_USBHOST20_PHY_PHYCLOCK_USER,
2076 "mout_phyclk_usbhost20_phy_phyclock_user",
2077 mout_phyclk_usbhost20_phy_phyclock_user_p,
2078 MUX_SEL_FSYS2, 12, 1),
2079 MUX(CLK_MOUT_PHYCLK_USBHOST20_PHY_PHY_FREECLK_USER,
2080 "mout_phyclk_usbhost20_phy_freeclk_user",
2081 mout_phyclk_usbhost20_phy_freeclk_user_p,
2082 MUX_SEL_FSYS2, 8, 1),
2083 MUX(CLK_MOUT_PHYCLK_USBDRD30_UDRD30_PIPE_PCLK_USER,
2084 "mout_phyclk_usbdrd30_udrd30_pipe_pclk_user",
2085 mout_phyclk_usbdrd30_udrd30_pipe_pclk_p,
2086 MUX_SEL_FSYS2, 4, 1),
2087 MUX(CLK_MOUT_PHYCLK_USBDRD30_UDRD30_PHYCLOCK_USER,
2088 "mout_phyclk_usbdrd30_udrd30_phyclock_user",
2089 mout_phyclk_usbdrd30_udrd30_phyclock_user_p,
2090 MUX_SEL_FSYS2, 0, 1),
2091
2092 /* MUX_SEL_FSYS3 */
2093 MUX(CLK_MOUT_PHYCLK_UFS_RX1_SYMBOL_USER,
2094 "mout_phyclk_ufs_rx1_symbol_user",
2095 mout_phyclk_ufs_rx1_symbol_user_p,
2096 MUX_SEL_FSYS3, 16, 1),
2097 MUX(CLK_MOUT_PHYCLK_UFS_RX0_SYMBOL_USER,
2098 "mout_phyclk_ufs_rx0_symbol_user",
2099 mout_phyclk_ufs_rx0_symbol_user_p,
2100 MUX_SEL_FSYS3, 12, 1),
2101 MUX(CLK_MOUT_PHYCLK_UFS_TX1_SYMBOL_USER,
2102 "mout_phyclk_ufs_tx1_symbol_user",
2103 mout_phyclk_ufs_tx1_symbol_user_p,
2104 MUX_SEL_FSYS3, 8, 1),
2105 MUX(CLK_MOUT_PHYCLK_UFS_TX0_SYMBOL_USER,
2106 "mout_phyclk_ufs_tx0_symbol_user",
2107 mout_phyclk_ufs_tx0_symbol_user_p,
2108 MUX_SEL_FSYS3, 4, 1),
2109 MUX(CLK_MOUT_PHYCLK_LLI_MPHY_TO_UFS_USER,
2110 "mout_phyclk_lli_mphy_to_ufs_user",
2111 mout_phyclk_lli_mphy_to_ufs_user_p,
2112 MUX_SEL_FSYS3, 0, 1),
2113
2114 /* MUX_SEL_FSYS4 */
2115 MUX(CLK_MOUT_SCLK_MPHY, "mout_sclk_mphy", mout_sclk_mphy_p,
2116 MUX_SEL_FSYS4, 0, 1),
2117};
2118
2119static const struct samsung_gate_clock fsys_gate_clks[] __initconst = {
2120 /* ENABLE_ACLK_FSYS0 */
2121 GATE(CLK_ACLK_PCIE, "aclk_pcie", "mout_aclk_fsys_200_user",
2122 ENABLE_ACLK_FSYS0, 13, CLK_IGNORE_UNUSED, 0),
2123 GATE(CLK_ACLK_PDMA1, "aclk_pdma1", "mout_aclk_fsys_200_user",
2124 ENABLE_ACLK_FSYS0, 11, CLK_IGNORE_UNUSED, 0),
2125 GATE(CLK_ACLK_TSI, "aclk_tsi", "mout_aclk_fsys_200_user",
2126 ENABLE_ACLK_FSYS0, 10, CLK_IGNORE_UNUSED, 0),
2127 GATE(CLK_ACLK_MMC2, "aclk_mmc2", "mout_aclk_fsys_200_user",
2128 ENABLE_ACLK_FSYS0, 8, CLK_IGNORE_UNUSED, 0),
2129 GATE(CLK_ACLK_MMC1, "aclk_mmc1", "mout_aclk_fsys_200_user",
2130 ENABLE_ACLK_FSYS0, 7, CLK_IGNORE_UNUSED, 0),
2131 GATE(CLK_ACLK_MMC0, "aclk_mmc0", "mout_aclk_fsys_200_user",
2132 ENABLE_ACLK_FSYS0, 6, CLK_IGNORE_UNUSED, 0),
2133 GATE(CLK_ACLK_UFS, "aclk_ufs", "mout_aclk_fsys_200_user",
2134 ENABLE_ACLK_FSYS0, 5, CLK_IGNORE_UNUSED, 0),
2135 GATE(CLK_ACLK_USBHOST20, "aclk_usbhost20", "mout_aclk_fsys_200_user",
2136 ENABLE_ACLK_FSYS0, 3, CLK_IGNORE_UNUSED, 0),
2137 GATE(CLK_ACLK_USBHOST30, "aclk_usbhost30", "mout_aclk_fsys_200_user",
2138 ENABLE_ACLK_FSYS0, 2, CLK_IGNORE_UNUSED, 0),
2139 GATE(CLK_ACLK_USBDRD30, "aclk_usbdrd30", "mout_aclk_fsys_200_user",
2140 ENABLE_ACLK_FSYS0, 1, CLK_IGNORE_UNUSED, 0),
2141 GATE(CLK_ACLK_PDMA0, "aclk_pdma0", "mout_aclk_fsys_200_user",
2142 ENABLE_ACLK_FSYS0, 0, CLK_IGNORE_UNUSED, 0),
2143
2144 /* ENABLE_ACLK_FSYS1 */
2145 GATE(CLK_ACLK_XIU_FSYSPX, "aclk_xiu_fsyspx", "mout_aclk_fsys_200_user",
2146 ENABLE_ACLK_FSYS1, 27, CLK_IGNORE_UNUSED, 0),
2147 GATE(CLK_ACLK_AHB_USBLINKH1, "aclk_ahb_usblinkh1",
2148 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2149 26, CLK_IGNORE_UNUSED, 0),
2150 GATE(CLK_ACLK_SMMU_PDMA1, "aclk_smmu_pdma1", "mout_aclk_fsys_200_user",
2151 ENABLE_ACLK_FSYS1, 25, CLK_IGNORE_UNUSED, 0),
2152 GATE(CLK_ACLK_BTS_PCIE, "aclk_bts_pcie", "mout_aclk_fsys_200_user",
2153 ENABLE_ACLK_FSYS1, 24, CLK_IGNORE_UNUSED, 0),
2154 GATE(CLK_ACLK_AXIUS_PDMA1, "aclk_axius_pdma1",
2155 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2156 22, CLK_IGNORE_UNUSED, 0),
2157 GATE(CLK_ACLK_SMMU_PDMA0, "aclk_smmu_pdma0", "mout_aclk_fsys_200_user",
2158 ENABLE_ACLK_FSYS1, 17, CLK_IGNORE_UNUSED, 0),
2159 GATE(CLK_ACLK_BTS_UFS, "aclk_bts_ufs", "mout_aclk_fsys_200_user",
2160 ENABLE_ACLK_FSYS1, 14, CLK_IGNORE_UNUSED, 0),
2161 GATE(CLK_ACLK_BTS_USBHOST30, "aclk_bts_usbhost30",
2162 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2163 13, 0, 0),
2164 GATE(CLK_ACLK_BTS_USBDRD30, "aclk_bts_usbdrd30",
2165 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2166 12, 0, 0),
2167 GATE(CLK_ACLK_AXIUS_PDMA0, "aclk_axius_pdma0",
2168 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2169 11, CLK_IGNORE_UNUSED, 0),
2170 GATE(CLK_ACLK_AXIUS_USBHS, "aclk_axius_usbhs",
2171 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2172 10, CLK_IGNORE_UNUSED, 0),
2173 GATE(CLK_ACLK_AXIUS_FSYSSX, "aclk_axius_fsyssx",
2174 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2175 9, CLK_IGNORE_UNUSED, 0),
2176 GATE(CLK_ACLK_AHB2APB_FSYSP, "aclk_ahb2apb_fsysp",
2177 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2178 8, CLK_IGNORE_UNUSED, 0),
2179 GATE(CLK_ACLK_AHB2AXI_USBHS, "aclk_ahb2axi_usbhs",
2180 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2181 7, CLK_IGNORE_UNUSED, 0),
2182 GATE(CLK_ACLK_AHB_USBLINKH0, "aclk_ahb_usblinkh0",
2183 "mout_aclk_fsys_200_user", ENABLE_ACLK_FSYS1,
2184 6, CLK_IGNORE_UNUSED, 0),
2185 GATE(CLK_ACLK_AHB_USBHS, "aclk_ahb_usbhs", "mout_aclk_fsys_200_user",
2186 ENABLE_ACLK_FSYS1, 5, CLK_IGNORE_UNUSED, 0),
2187 GATE(CLK_ACLK_AHB_FSYSH, "aclk_ahb_fsysh", "mout_aclk_fsys_200_user",
2188 ENABLE_ACLK_FSYS1, 4, CLK_IGNORE_UNUSED, 0),
2189 GATE(CLK_ACLK_XIU_FSYSX, "aclk_xiu_fsysx", "mout_aclk_fsys_200_user",
2190 ENABLE_ACLK_FSYS1, 3, CLK_IGNORE_UNUSED, 0),
2191 GATE(CLK_ACLK_XIU_FSYSSX, "aclk_xiu_fsyssx", "mout_aclk_fsys_200_user",
2192 ENABLE_ACLK_FSYS1, 2, CLK_IGNORE_UNUSED, 0),
2193 GATE(CLK_ACLK_FSYSNP_200, "aclk_fsysnp_200", "mout_aclk_fsys_200_user",
2194 ENABLE_ACLK_FSYS1, 1, CLK_IGNORE_UNUSED, 0),
2195 GATE(CLK_ACLK_FSYSND_200, "aclk_fsysnd_200", "mout_aclk_fsys_200_user",
2196 ENABLE_ACLK_FSYS1, 0, CLK_IGNORE_UNUSED, 0),
2197
2198 /* ENABLE_PCLK_FSYS */
2199 GATE(CLK_PCLK_PCIE_CTRL, "pclk_pcie_ctrl", "mout_aclk_fsys_200_user",
2200 ENABLE_PCLK_FSYS, 17, CLK_IGNORE_UNUSED, 0),
2201 GATE(CLK_PCLK_SMMU_PDMA1, "pclk_smmu_pdma1", "mout_aclk_fsys_200_user",
2202 ENABLE_PCLK_FSYS, 16, CLK_IGNORE_UNUSED, 0),
2203 GATE(CLK_PCLK_PCIE_PHY, "pclk_pcie_phy", "mout_aclk_fsys_200_user",
2204 ENABLE_PCLK_FSYS, 14, CLK_IGNORE_UNUSED, 0),
2205 GATE(CLK_PCLK_BTS_PCIE, "pclk_bts_pcie", "mout_aclk_fsys_200_user",
2206 ENABLE_PCLK_FSYS, 13, CLK_IGNORE_UNUSED, 0),
2207 GATE(CLK_PCLK_SMMU_PDMA0, "pclk_smmu_pdma0", "mout_aclk_fsys_200_user",
2208 ENABLE_PCLK_FSYS, 8, CLK_IGNORE_UNUSED, 0),
2209 GATE(CLK_PCLK_BTS_UFS, "pclk_bts_ufs", "mout_aclk_fsys_200_user",
2210 ENABLE_PCLK_FSYS, 5, 0, 0),
2211 GATE(CLK_PCLK_BTS_USBHOST30, "pclk_bts_usbhost30",
2212 "mout_aclk_fsys_200_user", ENABLE_PCLK_FSYS, 4, 0, 0),
2213 GATE(CLK_PCLK_BTS_USBDRD30, "pclk_bts_usbdrd30",
2214 "mout_aclk_fsys_200_user", ENABLE_PCLK_FSYS, 3, 0, 0),
2215 GATE(CLK_PCLK_GPIO_FSYS, "pclk_gpio_fsys", "mout_aclk_fsys_200_user",
2216 ENABLE_PCLK_FSYS, 2, CLK_IGNORE_UNUSED, 0),
2217 GATE(CLK_PCLK_PMU_FSYS, "pclk_pmu_fsys", "mout_aclk_fsys_200_user",
2218 ENABLE_PCLK_FSYS, 1, CLK_IGNORE_UNUSED, 0),
2219 GATE(CLK_PCLK_SYSREG_FSYS, "pclk_sysreg_fsys",
2220 "mout_aclk_fsys_200_user", ENABLE_PCLK_FSYS,
2221 0, CLK_IGNORE_UNUSED, 0),
2222
2223 /* ENABLE_SCLK_FSYS */
2224 GATE(CLK_SCLK_PCIE_100, "sclk_pcie_100", "mout_sclk_pcie_100_user",
2225 ENABLE_SCLK_FSYS, 21, 0, 0),
2226 GATE(CLK_PHYCLK_USBHOST30_UHOST30_PIPE_PCLK,
2227 "phyclk_usbhost30_uhost30_pipe_pclk",
2228 "mout_phyclk_usbhost30_uhost30_pipe_pclk_user",
2229 ENABLE_SCLK_FSYS, 18, 0, 0),
2230 GATE(CLK_PHYCLK_USBHOST30_UHOST30_PHYCLOCK,
2231 "phyclk_usbhost30_uhost30_phyclock",
2232 "mout_phyclk_usbhost30_uhost30_phyclock_user",
2233 ENABLE_SCLK_FSYS, 17, 0, 0),
2234 GATE(CLK_PHYCLK_UFS_RX1_SYMBOL, "phyclk_ufs_rx1_symbol",
2235 "mout_phyclk_ufs_rx1_symbol_user", ENABLE_SCLK_FSYS,
2236 16, 0, 0),
2237 GATE(CLK_PHYCLK_UFS_RX0_SYMBOL, "phyclk_ufs_rx0_symbol",
2238 "mout_phyclk_ufs_rx0_symbol_user", ENABLE_SCLK_FSYS,
2239 15, 0, 0),
2240 GATE(CLK_PHYCLK_UFS_TX1_SYMBOL, "phyclk_ufs_tx1_symbol",
2241 "mout_phyclk_ufs_tx1_symbol_user", ENABLE_SCLK_FSYS,
2242 14, 0, 0),
2243 GATE(CLK_PHYCLK_UFS_TX0_SYMBOL, "phyclk_ufs_tx0_symbol",
2244 "mout_phyclk_ufs_tx0_symbol_user", ENABLE_SCLK_FSYS,
2245 13, 0, 0),
2246 GATE(CLK_PHYCLK_USBHOST20_PHY_HSIC1, "phyclk_usbhost20_phy_hsic1",
2247 "mout_phyclk_usbhost20_phy_hsic1", ENABLE_SCLK_FSYS,
2248 12, 0, 0),
2249 GATE(CLK_PHYCLK_USBHOST20_PHY_CLK48MOHCI,
2250 "phyclk_usbhost20_phy_clk48mohci",
2251 "mout_phyclk_usbhost20_phy_clk48mohci_user",
2252 ENABLE_SCLK_FSYS, 11, 0, 0),
2253 GATE(CLK_PHYCLK_USBHOST20_PHY_PHYCLOCK,
2254 "phyclk_usbhost20_phy_phyclock",
2255 "mout_phyclk_usbhost20_phy_phyclock_user",
2256 ENABLE_SCLK_FSYS, 10, 0, 0),
2257 GATE(CLK_PHYCLK_USBHOST20_PHY_FREECLK,
2258 "phyclk_usbhost20_phy_freeclk",
2259 "mout_phyclk_usbhost20_phy_freeclk_user",
2260 ENABLE_SCLK_FSYS, 9, 0, 0),
2261 GATE(CLK_PHYCLK_USBDRD30_UDRD30_PIPE_PCLK,
2262 "phyclk_usbdrd30_udrd30_pipe_pclk",
2263 "mout_phyclk_usbdrd30_udrd30_pipe_pclk_user",
2264 ENABLE_SCLK_FSYS, 8, 0, 0),
2265 GATE(CLK_PHYCLK_USBDRD30_UDRD30_PHYCLOCK,
2266 "phyclk_usbdrd30_udrd30_phyclock",
2267 "mout_phyclk_usbdrd30_udrd30_phyclock_user",
2268 ENABLE_SCLK_FSYS, 7, 0, 0),
2269 GATE(CLK_SCLK_MPHY, "sclk_mphy", "mout_sclk_mphy",
2270 ENABLE_SCLK_FSYS, 6, 0, 0),
2271 GATE(CLK_SCLK_UFSUNIPRO, "sclk_ufsunipro", "mout_sclk_ufsunipro_user",
2272 ENABLE_SCLK_FSYS, 5, 0, 0),
2273 GATE(CLK_SCLK_MMC2, "sclk_mmc2", "mout_sclk_mmc2_user",
2274 ENABLE_SCLK_FSYS, 4, CLK_SET_RATE_PARENT, 0),
2275 GATE(CLK_SCLK_MMC1, "sclk_mmc1", "mout_sclk_mmc1_user",
2276 ENABLE_SCLK_FSYS, 3, CLK_SET_RATE_PARENT, 0),
2277 GATE(CLK_SCLK_MMC0, "sclk_mmc0", "mout_sclk_mmc0_user",
2278 ENABLE_SCLK_FSYS, 2, CLK_SET_RATE_PARENT, 0),
2279 GATE(CLK_SCLK_USBHOST30, "sclk_usbhost30", "mout_sclk_usbhost30_user",
2280 ENABLE_SCLK_FSYS, 1, 0, 0),
2281 GATE(CLK_SCLK_USBDRD30, "sclk_usbdrd30", "mout_sclk_usbdrd30_user",
2282 ENABLE_SCLK_FSYS, 0, 0, 0),
2283
2284 /* ENABLE_IP_FSYS0 */
2285 GATE(CLK_PCIE, "pcie", "sclk_pcie_100", ENABLE_IP_FSYS0, 17, 0, 0),
2286 GATE(CLK_PDMA1, "pdma1", "aclk_pdma1", ENABLE_IP_FSYS0, 15, 0, 0),
2287 GATE(CLK_PDMA0, "pdma0", "aclk_pdma0", ENABLE_IP_FSYS0, 0, 0, 0),
2288};
2289
2290static const struct samsung_cmu_info fsys_cmu_info __initconst = {
2291 .mux_clks = fsys_mux_clks,
2292 .nr_mux_clks = ARRAY_SIZE(fsys_mux_clks),
2293 .gate_clks = fsys_gate_clks,
2294 .nr_gate_clks = ARRAY_SIZE(fsys_gate_clks),
2295 .fixed_clks = fsys_fixed_clks,
2296 .nr_fixed_clks = ARRAY_SIZE(fsys_fixed_clks),
2297 .nr_clk_ids = FSYS_NR_CLK,
2298 .clk_regs = fsys_clk_regs,
2299 .nr_clk_regs = ARRAY_SIZE(fsys_clk_regs),
2300};
2301
2302static void __init exynos5433_cmu_fsys_init(struct device_node *np)
2303{
2304 samsung_cmu_register_one(np, &fsys_cmu_info);
2305}
2306
2307CLK_OF_DECLARE(exynos5433_cmu_fsys, "samsung,exynos5433-cmu-fsys",
2308 exynos5433_cmu_fsys_init);
2309
2310/*
2311 * Register offset definitions for CMU_G2D
2312 */
2313#define MUX_SEL_G2D0 0x0200
2314#define MUX_SEL_ENABLE_G2D0 0x0300
2315#define MUX_SEL_STAT_G2D0 0x0400
2316#define DIV_G2D 0x0600
2317#define DIV_STAT_G2D 0x0700
2318#define DIV_ENABLE_ACLK_G2D 0x0800
2319#define DIV_ENABLE_ACLK_G2D_SECURE_SMMU_G2D 0x0804
2320#define DIV_ENABLE_PCLK_G2D 0x0900
2321#define DIV_ENABLE_PCLK_G2D_SECURE_SMMU_G2D 0x0904
2322#define DIV_ENABLE_IP_G2D0 0x0b00
2323#define DIV_ENABLE_IP_G2D1 0x0b04
2324#define DIV_ENABLE_IP_G2D_SECURE_SMMU_G2D 0x0b08
2325
2326static const unsigned long g2d_clk_regs[] __initconst = {
2327 MUX_SEL_G2D0,
2328 MUX_SEL_ENABLE_G2D0,
2329 DIV_G2D,
2330 DIV_ENABLE_ACLK_G2D,
2331 DIV_ENABLE_ACLK_G2D_SECURE_SMMU_G2D,
2332 DIV_ENABLE_PCLK_G2D,
2333 DIV_ENABLE_PCLK_G2D_SECURE_SMMU_G2D,
2334 DIV_ENABLE_IP_G2D0,
2335 DIV_ENABLE_IP_G2D1,
2336 DIV_ENABLE_IP_G2D_SECURE_SMMU_G2D,
2337};
2338
2339/* list of all parent clock list */
2340PNAME(mout_aclk_g2d_266_user_p) = { "oscclk", "aclk_g2d_266", };
2341PNAME(mout_aclk_g2d_400_user_p) = { "oscclk", "aclk_g2d_400", };
2342
2343static const struct samsung_mux_clock g2d_mux_clks[] __initconst = {
2344 /* MUX_SEL_G2D0 */
2345 MUX(CLK_MUX_ACLK_G2D_266_USER, "mout_aclk_g2d_266_user",
2346 mout_aclk_g2d_266_user_p, MUX_SEL_G2D0, 4, 1),
2347 MUX(CLK_MUX_ACLK_G2D_400_USER, "mout_aclk_g2d_400_user",
2348 mout_aclk_g2d_400_user_p, MUX_SEL_G2D0, 0, 1),
2349};
2350
2351static const struct samsung_div_clock g2d_div_clks[] __initconst = {
2352 /* DIV_G2D */
2353 DIV(CLK_DIV_PCLK_G2D, "div_pclk_g2d", "mout_aclk_g2d_266_user",
2354 DIV_G2D, 0, 2),
2355};
2356
2357static const struct samsung_gate_clock g2d_gate_clks[] __initconst = {
2358 /* DIV_ENABLE_ACLK_G2D */
2359 GATE(CLK_ACLK_SMMU_MDMA1, "aclk_smmu_mdma1", "mout_aclk_g2d_266_user",
2360 DIV_ENABLE_ACLK_G2D, 12, 0, 0),
2361 GATE(CLK_ACLK_BTS_MDMA1, "aclk_bts_mdam1", "mout_aclk_g2d_266_user",
2362 DIV_ENABLE_ACLK_G2D, 11, 0, 0),
2363 GATE(CLK_ACLK_BTS_G2D, "aclk_bts_g2d", "mout_aclk_g2d_400_user",
2364 DIV_ENABLE_ACLK_G2D, 10, 0, 0),
2365 GATE(CLK_ACLK_ALB_G2D, "aclk_alb_g2d", "mout_aclk_g2d_400_user",
2366 DIV_ENABLE_ACLK_G2D, 9, 0, 0),
2367 GATE(CLK_ACLK_AXIUS_G2DX, "aclk_axius_g2dx", "mout_aclk_g2d_400_user",
2368 DIV_ENABLE_ACLK_G2D, 8, 0, 0),
2369 GATE(CLK_ACLK_ASYNCAXI_SYSX, "aclk_asyncaxi_sysx",
2370 "mout_aclk_g2d_400_user", DIV_ENABLE_ACLK_G2D,
2371 7, 0, 0),
2372 GATE(CLK_ACLK_AHB2APB_G2D1P, "aclk_ahb2apb_g2d1p", "div_pclk_g2d",
2373 DIV_ENABLE_ACLK_G2D, 6, CLK_IGNORE_UNUSED, 0),
2374 GATE(CLK_ACLK_AHB2APB_G2D0P, "aclk_ahb2apb_g2d0p", "div_pclk_g2d",
2375 DIV_ENABLE_ACLK_G2D, 5, CLK_IGNORE_UNUSED, 0),
2376 GATE(CLK_ACLK_XIU_G2DX, "aclk_xiu_g2dx", "mout_aclk_g2d_400_user",
2377 DIV_ENABLE_ACLK_G2D, 4, CLK_IGNORE_UNUSED, 0),
2378 GATE(CLK_ACLK_G2DNP_133, "aclk_g2dnp_133", "div_pclk_g2d",
2379 DIV_ENABLE_ACLK_G2D, 3, CLK_IGNORE_UNUSED, 0),
2380 GATE(CLK_ACLK_G2DND_400, "aclk_g2dnd_400", "mout_aclk_g2d_400_user",
2381 DIV_ENABLE_ACLK_G2D, 2, CLK_IGNORE_UNUSED, 0),
2382 GATE(CLK_ACLK_MDMA1, "aclk_mdma1", "mout_aclk_g2d_266_user",
2383 DIV_ENABLE_ACLK_G2D, 1, 0, 0),
2384 GATE(CLK_ACLK_G2D, "aclk_g2d", "mout_aclk_g2d_400_user",
2385 DIV_ENABLE_ACLK_G2D, 0, 0, 0),
2386
2387 /* DIV_ENABLE_ACLK_G2D_SECURE_SMMU_G2D */
2388 GATE(CLK_ACLK_SMMU_G2D, "aclk_smmu_g2d", "mout_aclk_g2d_400_user",
2389 DIV_ENABLE_ACLK_G2D_SECURE_SMMU_G2D, 0, 0, 0),
2390
2391 /* DIV_ENABLE_PCLK_G2D */
2392 GATE(CLK_PCLK_SMMU_MDMA1, "pclk_smmu_mdma1", "div_pclk_g2d",
2393 DIV_ENABLE_PCLK_G2D, 7, 0, 0),
2394 GATE(CLK_PCLK_BTS_MDMA1, "pclk_bts_mdam1", "div_pclk_g2d",
2395 DIV_ENABLE_PCLK_G2D, 6, 0, 0),
2396 GATE(CLK_PCLK_BTS_G2D, "pclk_bts_g2d", "div_pclk_g2d",
2397 DIV_ENABLE_PCLK_G2D, 5, 0, 0),
2398 GATE(CLK_PCLK_ALB_G2D, "pclk_alb_g2d", "div_pclk_g2d",
2399 DIV_ENABLE_PCLK_G2D, 4, 0, 0),
2400 GATE(CLK_PCLK_ASYNCAXI_SYSX, "pclk_asyncaxi_sysx", "div_pclk_g2d",
2401 DIV_ENABLE_PCLK_G2D, 3, 0, 0),
2402 GATE(CLK_PCLK_PMU_G2D, "pclk_pmu_g2d", "div_pclk_g2d",
2403 DIV_ENABLE_PCLK_G2D, 2, CLK_IGNORE_UNUSED, 0),
2404 GATE(CLK_PCLK_SYSREG_G2D, "pclk_sysreg_g2d", "div_pclk_g2d",
2405 DIV_ENABLE_PCLK_G2D, 1, CLK_IGNORE_UNUSED, 0),
2406 GATE(CLK_PCLK_G2D, "pclk_g2d", "div_pclk_g2d", DIV_ENABLE_PCLK_G2D,
2407 0, 0, 0),
2408
2409 /* DIV_ENABLE_PCLK_G2D_SECURE_SMMU_G2D */
2410 GATE(CLK_PCLK_SMMU_G2D, "pclk_smmu_g2d", "div_pclk_g2d",
2411 DIV_ENABLE_PCLK_G2D_SECURE_SMMU_G2D, 0, 0, 0),
2412};
2413
2414static const struct samsung_cmu_info g2d_cmu_info __initconst = {
2415 .mux_clks = g2d_mux_clks,
2416 .nr_mux_clks = ARRAY_SIZE(g2d_mux_clks),
2417 .div_clks = g2d_div_clks,
2418 .nr_div_clks = ARRAY_SIZE(g2d_div_clks),
2419 .gate_clks = g2d_gate_clks,
2420 .nr_gate_clks = ARRAY_SIZE(g2d_gate_clks),
2421 .nr_clk_ids = G2D_NR_CLK,
2422 .clk_regs = g2d_clk_regs,
2423 .nr_clk_regs = ARRAY_SIZE(g2d_clk_regs),
2424};
2425
2426static void __init exynos5433_cmu_g2d_init(struct device_node *np)
2427{
2428 samsung_cmu_register_one(np, &g2d_cmu_info);
2429}
2430
2431CLK_OF_DECLARE(exynos5433_cmu_g2d, "samsung,exynos5433-cmu-g2d",
2432 exynos5433_cmu_g2d_init);
2433
2434/*
2435 * Register offset definitions for CMU_DISP
2436 */
2437#define DISP_PLL_LOCK 0x0000
2438#define DISP_PLL_CON0 0x0100
2439#define DISP_PLL_CON1 0x0104
2440#define DISP_PLL_FREQ_DET 0x0108
2441#define MUX_SEL_DISP0 0x0200
2442#define MUX_SEL_DISP1 0x0204
2443#define MUX_SEL_DISP2 0x0208
2444#define MUX_SEL_DISP3 0x020c
2445#define MUX_SEL_DISP4 0x0210
2446#define MUX_ENABLE_DISP0 0x0300
2447#define MUX_ENABLE_DISP1 0x0304
2448#define MUX_ENABLE_DISP2 0x0308
2449#define MUX_ENABLE_DISP3 0x030c
2450#define MUX_ENABLE_DISP4 0x0310
2451#define MUX_STAT_DISP0 0x0400
2452#define MUX_STAT_DISP1 0x0404
2453#define MUX_STAT_DISP2 0x0408
2454#define MUX_STAT_DISP3 0x040c
2455#define MUX_STAT_DISP4 0x0410
2456#define MUX_IGNORE_DISP2 0x0508
2457#define DIV_DISP 0x0600
2458#define DIV_DISP_PLL_FREQ_DET 0x0604
2459#define DIV_STAT_DISP 0x0700
2460#define DIV_STAT_DISP_PLL_FREQ_DET 0x0704
2461#define ENABLE_ACLK_DISP0 0x0800
2462#define ENABLE_ACLK_DISP1 0x0804
2463#define ENABLE_PCLK_DISP 0x0900
2464#define ENABLE_SCLK_DISP 0x0a00
2465#define ENABLE_IP_DISP0 0x0b00
2466#define ENABLE_IP_DISP1 0x0b04
2467#define CLKOUT_CMU_DISP 0x0c00
2468#define CLKOUT_CMU_DISP_DIV_STAT 0x0c04
2469
2470static const unsigned long disp_clk_regs[] __initconst = {
2471 DISP_PLL_LOCK,
2472 DISP_PLL_CON0,
2473 DISP_PLL_CON1,
2474 DISP_PLL_FREQ_DET,
2475 MUX_SEL_DISP0,
2476 MUX_SEL_DISP1,
2477 MUX_SEL_DISP2,
2478 MUX_SEL_DISP3,
2479 MUX_SEL_DISP4,
2480 MUX_ENABLE_DISP0,
2481 MUX_ENABLE_DISP1,
2482 MUX_ENABLE_DISP2,
2483 MUX_ENABLE_DISP3,
2484 MUX_ENABLE_DISP4,
2485 MUX_IGNORE_DISP2,
2486 DIV_DISP,
2487 DIV_DISP_PLL_FREQ_DET,
2488 ENABLE_ACLK_DISP0,
2489 ENABLE_ACLK_DISP1,
2490 ENABLE_PCLK_DISP,
2491 ENABLE_SCLK_DISP,
2492 ENABLE_IP_DISP0,
2493 ENABLE_IP_DISP1,
2494 CLKOUT_CMU_DISP,
2495 CLKOUT_CMU_DISP_DIV_STAT,
2496};
2497
2498/* list of all parent clock list */
2499PNAME(mout_disp_pll_p) = { "oscclk", "fout_disp_pll", };
2500PNAME(mout_sclk_dsim1_user_p) = { "oscclk", "sclk_dsim1_disp", };
2501PNAME(mout_sclk_dsim0_user_p) = { "oscclk", "sclk_dsim0_disp", };
2502PNAME(mout_sclk_dsd_user_p) = { "oscclk", "sclk_dsd_disp", };
2503PNAME(mout_sclk_decon_tv_eclk_user_p) = { "oscclk",
2504 "sclk_decon_tv_eclk_disp", };
2505PNAME(mout_sclk_decon_vclk_user_p) = { "oscclk",
2506 "sclk_decon_vclk_disp", };
2507PNAME(mout_sclk_decon_eclk_user_p) = { "oscclk",
2508 "sclk_decon_eclk_disp", };
2509PNAME(mout_sclk_decon_tv_vlkc_user_p) = { "oscclk",
2510 "sclk_decon_tv_vclk_disp", };
2511PNAME(mout_aclk_disp_333_user_p) = { "oscclk", "aclk_disp_333", };
2512
2513PNAME(mout_phyclk_mipidphy1_bitclkdiv8_user_p) = { "oscclk",
2514 "phyclk_mipidphy1_bitclkdiv8_phy", };
2515PNAME(mout_phyclk_mipidphy1_rxclkesc0_user_p) = { "oscclk",
2516 "phyclk_mipidphy1_rxclkesc0_phy", };
2517PNAME(mout_phyclk_mipidphy0_bitclkdiv8_user_p) = { "oscclk",
2518 "phyclk_mipidphy0_bitclkdiv8_phy", };
2519PNAME(mout_phyclk_mipidphy0_rxclkesc0_user_p) = { "oscclk",
2520 "phyclk_mipidphy0_rxclkesc0_phy", };
2521PNAME(mout_phyclk_hdmiphy_tmds_clko_user_p) = { "oscclk",
2522 "phyclk_hdmiphy_tmds_clko_phy", };
2523PNAME(mout_phyclk_hdmiphy_pixel_clko_user_p) = { "oscclk",
2524 "phyclk_hdmiphy_pixel_clko_phy", };
2525
2526PNAME(mout_sclk_dsim0_p) = { "mout_disp_pll",
2527 "mout_sclk_dsim0_user", };
2528PNAME(mout_sclk_decon_tv_eclk_p) = { "mout_disp_pll",
2529 "mout_sclk_decon_tv_eclk_user", };
2530PNAME(mout_sclk_decon_vclk_p) = { "mout_disp_pll",
2531 "mout_sclk_decon_vclk_user", };
2532PNAME(mout_sclk_decon_eclk_p) = { "mout_disp_pll",
2533 "mout_sclk_decon_eclk_user", };
2534
2535PNAME(mout_sclk_dsim1_b_disp_p) = { "mout_sclk_dsim1_a_disp",
2536 "mout_sclk_dsim1_user", };
2537PNAME(mout_sclk_decon_tv_vclk_c_disp_p) = {
2538 "mout_phyclk_hdmiphy_pixel_clko_user",
2539 "mout_sclk_decon_tv_vclk_b_disp", };
2540PNAME(mout_sclk_decon_tv_vclk_b_disp_p) = { "mout_sclk_decon_tv_vclk_a_disp",
2541 "mout_sclk_decon_tv_vclk_user", };
2542
2543static const struct samsung_pll_clock disp_pll_clks[] __initconst = {
2544 PLL(pll_35xx, CLK_FOUT_DISP_PLL, "fout_disp_pll", "oscclk",
2545 DISP_PLL_LOCK, DISP_PLL_CON0, exynos5433_pll_rates),
2546};
2547
2548static const struct samsung_fixed_factor_clock disp_fixed_factor_clks[] __initconst = {
2549 /*
2550 * sclk_rgb_{vclk|tv_vclk} is half clock of sclk_decon_{vclk|tv_vclk}.
2551 * The divider has fixed value (2) between sclk_rgb_{vclk|tv_vclk}
2552 * and sclk_decon_{vclk|tv_vclk}.
2553 */
2554 FFACTOR(CLK_SCLK_RGB_VCLK, "sclk_rgb_vclk", "sclk_decon_vclk",
2555 1, 2, 0),
2556 FFACTOR(CLK_SCLK_RGB_TV_VCLK, "sclk_rgb_tv_vclk", "sclk_decon_tv_vclk",
2557 1, 2, 0),
2558};
2559
2560static const struct samsung_fixed_rate_clock disp_fixed_clks[] __initconst = {
2561 /* PHY clocks from MIPI_DPHY1 */
2562 FRATE(0, "phyclk_mipidphy1_bitclkdiv8_phy", NULL, 0, 188000000),
2563 FRATE(0, "phyclk_mipidphy1_rxclkesc0_phy", NULL, 0, 100000000),
2564 /* PHY clocks from MIPI_DPHY0 */
2565 FRATE(CLK_PHYCLK_MIPIDPHY0_BITCLKDIV8_PHY, "phyclk_mipidphy0_bitclkdiv8_phy",
2566 NULL, 0, 188000000),
2567 FRATE(CLK_PHYCLK_MIPIDPHY0_RXCLKESC0_PHY, "phyclk_mipidphy0_rxclkesc0_phy",
2568 NULL, 0, 100000000),
2569 /* PHY clocks from HDMI_PHY */
2570 FRATE(CLK_PHYCLK_HDMIPHY_TMDS_CLKO_PHY, "phyclk_hdmiphy_tmds_clko_phy",
2571 NULL, 0, 300000000),
2572 FRATE(CLK_PHYCLK_HDMIPHY_PIXEL_CLKO_PHY, "phyclk_hdmiphy_pixel_clko_phy",
2573 NULL, 0, 166000000),
2574};
2575
2576static const struct samsung_mux_clock disp_mux_clks[] __initconst = {
2577 /* MUX_SEL_DISP0 */
2578 MUX(CLK_MOUT_DISP_PLL, "mout_disp_pll", mout_disp_pll_p, MUX_SEL_DISP0,
2579 0, 1),
2580
2581 /* MUX_SEL_DISP1 */
2582 MUX(CLK_MOUT_SCLK_DSIM1_USER, "mout_sclk_dsim1_user",
2583 mout_sclk_dsim1_user_p, MUX_SEL_DISP1, 28, 1),
2584 MUX(CLK_MOUT_SCLK_DSIM0_USER, "mout_sclk_dsim0_user",
2585 mout_sclk_dsim0_user_p, MUX_SEL_DISP1, 24, 1),
2586 MUX(CLK_MOUT_SCLK_DSD_USER, "mout_sclk_dsd_user", mout_sclk_dsd_user_p,
2587 MUX_SEL_DISP1, 20, 1),
2588 MUX(CLK_MOUT_SCLK_DECON_TV_ECLK_USER, "mout_sclk_decon_tv_eclk_user",
2589 mout_sclk_decon_tv_eclk_user_p, MUX_SEL_DISP1, 16, 1),
2590 MUX(CLK_MOUT_SCLK_DECON_VCLK_USER, "mout_sclk_decon_vclk_user",
2591 mout_sclk_decon_vclk_user_p, MUX_SEL_DISP1, 12, 1),
2592 MUX(CLK_MOUT_SCLK_DECON_ECLK_USER, "mout_sclk_decon_eclk_user",
2593 mout_sclk_decon_eclk_user_p, MUX_SEL_DISP1, 8, 1),
2594 MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_USER, "mout_sclk_decon_tv_vclk_user",
2595 mout_sclk_decon_tv_vlkc_user_p, MUX_SEL_DISP1, 4, 1),
2596 MUX(CLK_MOUT_ACLK_DISP_333_USER, "mout_aclk_disp_333_user",
2597 mout_aclk_disp_333_user_p, MUX_SEL_DISP1, 0, 1),
2598
2599 /* MUX_SEL_DISP2 */
2600 MUX(CLK_MOUT_PHYCLK_MIPIDPHY1_BITCLKDIV8_USER,
2601 "mout_phyclk_mipidphy1_bitclkdiv8_user",
2602 mout_phyclk_mipidphy1_bitclkdiv8_user_p, MUX_SEL_DISP2,
2603 20, 1),
2604 MUX(CLK_MOUT_PHYCLK_MIPIDPHY1_RXCLKESC0_USER,
2605 "mout_phyclk_mipidphy1_rxclkesc0_user",
2606 mout_phyclk_mipidphy1_rxclkesc0_user_p, MUX_SEL_DISP2,
2607 16, 1),
2608 MUX(CLK_MOUT_PHYCLK_MIPIDPHY0_BITCLKDIV8_USER,
2609 "mout_phyclk_mipidphy0_bitclkdiv8_user",
2610 mout_phyclk_mipidphy0_bitclkdiv8_user_p, MUX_SEL_DISP2,
2611 12, 1),
2612 MUX(CLK_MOUT_PHYCLK_MIPIDPHY0_RXCLKESC0_USER,
2613 "mout_phyclk_mipidphy0_rxclkesc0_user",
2614 mout_phyclk_mipidphy0_rxclkesc0_user_p, MUX_SEL_DISP2,
2615 8, 1),
2616 MUX(CLK_MOUT_PHYCLK_HDMIPHY_TMDS_CLKO_USER,
2617 "mout_phyclk_hdmiphy_tmds_clko_user",
2618 mout_phyclk_hdmiphy_tmds_clko_user_p, MUX_SEL_DISP2,
2619 4, 1),
2620 MUX(CLK_MOUT_PHYCLK_HDMIPHY_PIXEL_CLKO_USER,
2621 "mout_phyclk_hdmiphy_pixel_clko_user",
2622 mout_phyclk_hdmiphy_pixel_clko_user_p, MUX_SEL_DISP2,
2623 0, 1),
2624
2625 /* MUX_SEL_DISP3 */
2626 MUX(CLK_MOUT_SCLK_DSIM0, "mout_sclk_dsim0", mout_sclk_dsim0_p,
2627 MUX_SEL_DISP3, 12, 1),
2628 MUX(CLK_MOUT_SCLK_DECON_TV_ECLK, "mout_sclk_decon_tv_eclk",
2629 mout_sclk_decon_tv_eclk_p, MUX_SEL_DISP3, 8, 1),
2630 MUX(CLK_MOUT_SCLK_DECON_VCLK, "mout_sclk_decon_vclk",
2631 mout_sclk_decon_vclk_p, MUX_SEL_DISP3, 4, 1),
2632 MUX(CLK_MOUT_SCLK_DECON_ECLK, "mout_sclk_decon_eclk",
2633 mout_sclk_decon_eclk_p, MUX_SEL_DISP3, 0, 1),
2634
2635 /* MUX_SEL_DISP4 */
2636 MUX(CLK_MOUT_SCLK_DSIM1_B_DISP, "mout_sclk_dsim1_b_disp",
2637 mout_sclk_dsim1_b_disp_p, MUX_SEL_DISP4, 16, 1),
2638 MUX(CLK_MOUT_SCLK_DSIM1_A_DISP, "mout_sclk_dsim1_a_disp",
2639 mout_sclk_dsim0_p, MUX_SEL_DISP4, 12, 1),
2640 MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_C_DISP,
2641 "mout_sclk_decon_tv_vclk_c_disp",
2642 mout_sclk_decon_tv_vclk_c_disp_p, MUX_SEL_DISP4, 8, 1),
2643 MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_B_DISP,
2644 "mout_sclk_decon_tv_vclk_b_disp",
2645 mout_sclk_decon_tv_vclk_b_disp_p, MUX_SEL_DISP4, 4, 1),
2646 MUX(CLK_MOUT_SCLK_DECON_TV_VCLK_A_DISP,
2647 "mout_sclk_decon_tv_vclk_a_disp",
2648 mout_sclk_decon_vclk_p, MUX_SEL_DISP4, 0, 1),
2649};
2650
2651static const struct samsung_div_clock disp_div_clks[] __initconst = {
2652 /* DIV_DISP */
2653 DIV(CLK_DIV_SCLK_DSIM1_DISP, "div_sclk_dsim1_disp",
2654 "mout_sclk_dsim1_b_disp", DIV_DISP, 24, 3),
2655 DIV(CLK_DIV_SCLK_DECON_TV_VCLK_DISP, "div_sclk_decon_tv_vclk_disp",
2656 "mout_sclk_decon_tv_vclk_c_disp", DIV_DISP, 20, 3),
2657 DIV(CLK_DIV_SCLK_DSIM0_DISP, "div_sclk_dsim0_disp", "mout_sclk_dsim0",
2658 DIV_DISP, 16, 3),
2659 DIV(CLK_DIV_SCLK_DECON_TV_ECLK_DISP, "div_sclk_decon_tv_eclk_disp",
2660 "mout_sclk_decon_tv_eclk", DIV_DISP, 12, 3),
2661 DIV(CLK_DIV_SCLK_DECON_VCLK_DISP, "div_sclk_decon_vclk_disp",
2662 "mout_sclk_decon_vclk", DIV_DISP, 8, 3),
2663 DIV(CLK_DIV_SCLK_DECON_ECLK_DISP, "div_sclk_decon_eclk_disp",
2664 "mout_sclk_decon_eclk", DIV_DISP, 4, 3),
2665 DIV(CLK_DIV_PCLK_DISP, "div_pclk_disp", "mout_aclk_disp_333_user",
2666 DIV_DISP, 0, 2),
2667};
2668
2669static const struct samsung_gate_clock disp_gate_clks[] __initconst = {
2670 /* ENABLE_ACLK_DISP0 */
2671 GATE(CLK_ACLK_DECON_TV, "aclk_decon_tv", "mout_aclk_disp_333_user",
2672 ENABLE_ACLK_DISP0, 2, 0, 0),
2673 GATE(CLK_ACLK_DECON, "aclk_decon", "mout_aclk_disp_333_user",
2674 ENABLE_ACLK_DISP0, 0, 0, 0),
2675
2676 /* ENABLE_ACLK_DISP1 */
2677 GATE(CLK_ACLK_SMMU_TV1X, "aclk_smmu_tv1x", "mout_aclk_disp_333_user",
2678 ENABLE_ACLK_DISP1, 25, 0, 0),
2679 GATE(CLK_ACLK_SMMU_TV0X, "aclk_smmu_tv0x", "mout_aclk_disp_333_user",
2680 ENABLE_ACLK_DISP1, 24, 0, 0),
2681 GATE(CLK_ACLK_SMMU_DECON1X, "aclk_smmu_decon1x",
2682 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 23, 0, 0),
2683 GATE(CLK_ACLK_SMMU_DECON0X, "aclk_smmu_decon0x",
2684 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 22, 0, 0),
2685 GATE(CLK_ACLK_BTS_DECON_TV_M3, "aclk_bts_decon_tv_m3",
2686 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 21, 0, 0),
2687 GATE(CLK_ACLK_BTS_DECON_TV_M2, "aclk_bts_decon_tv_m2",
2688 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 20, 0, 0),
2689 GATE(CLK_ACLK_BTS_DECON_TV_M1, "aclk_bts_decon_tv_m1",
2690 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 19, 0, 0),
2691 GATE(CLK_ACLK_BTS_DECON_TV_M0, "aclk-bts_decon_tv_m0",
2692 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 18, 0, 0),
2693 GATE(CLK_ACLK_BTS_DECON_NM4, "aclk_bts_decon_nm4",
2694 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 17, 0, 0),
2695 GATE(CLK_ACLK_BTS_DECON_NM3, "aclk_bts_decon_nm3",
2696 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 16, 0, 0),
2697 GATE(CLK_ACLK_BTS_DECON_NM2, "aclk_bts_decon_nm2",
2698 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 15, 0, 0),
2699 GATE(CLK_ACLK_BTS_DECON_NM1, "aclk_bts_decon_nm1",
2700 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 14, 0, 0),
2701 GATE(CLK_ACLK_BTS_DECON_NM0, "aclk_bts_decon_nm0",
2702 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 13, 0, 0),
2703 GATE(CLK_ACLK_AHB2APB_DISPSFR2P, "aclk_ahb2apb_dispsfr2p",
2704 "div_pclk_disp", ENABLE_ACLK_DISP1,
2705 12, CLK_IGNORE_UNUSED, 0),
2706 GATE(CLK_ACLK_AHB2APB_DISPSFR1P, "aclk_ahb2apb_dispsfr1p",
2707 "div_pclk_disp", ENABLE_ACLK_DISP1,
2708 11, CLK_IGNORE_UNUSED, 0),
2709 GATE(CLK_ACLK_AHB2APB_DISPSFR0P, "aclk_ahb2apb_dispsfr0p",
2710 "div_pclk_disp", ENABLE_ACLK_DISP1,
2711 10, CLK_IGNORE_UNUSED, 0),
2712 GATE(CLK_ACLK_AHB_DISPH, "aclk_ahb_disph", "div_pclk_disp",
2713 ENABLE_ACLK_DISP1, 8, CLK_IGNORE_UNUSED, 0),
2714 GATE(CLK_ACLK_XIU_TV1X, "aclk_xiu_tv1x", "mout_aclk_disp_333_user",
2715 ENABLE_ACLK_DISP1, 7, 0, 0),
2716 GATE(CLK_ACLK_XIU_TV0X, "aclk_xiu_tv0x", "mout_aclk_disp_333_user",
2717 ENABLE_ACLK_DISP1, 6, 0, 0),
2718 GATE(CLK_ACLK_XIU_DECON1X, "aclk_xiu_decon1x",
2719 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 5, 0, 0),
2720 GATE(CLK_ACLK_XIU_DECON0X, "aclk_xiu_decon0x",
2721 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 4, 0, 0),
2722 GATE(CLK_ACLK_XIU_DISP1X, "aclk_xiu_disp1x", "mout_aclk_disp_333_user",
2723 ENABLE_ACLK_DISP1, 3, CLK_IGNORE_UNUSED, 0),
2724 GATE(CLK_ACLK_XIU_DISPNP_100, "aclk_xiu_dispnp_100", "div_pclk_disp",
2725 ENABLE_ACLK_DISP1, 2, CLK_IGNORE_UNUSED, 0),
2726 GATE(CLK_ACLK_DISP1ND_333, "aclk_disp1nd_333",
2727 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1, 1,
2728 CLK_IGNORE_UNUSED, 0),
2729 GATE(CLK_ACLK_DISP0ND_333, "aclk_disp0nd_333",
2730 "mout_aclk_disp_333_user", ENABLE_ACLK_DISP1,
2731 0, CLK_IGNORE_UNUSED, 0),
2732
2733 /* ENABLE_PCLK_DISP */
2734 GATE(CLK_PCLK_SMMU_TV1X, "pclk_smmu_tv1x", "div_pclk_disp",
2735 ENABLE_PCLK_DISP, 23, 0, 0),
2736 GATE(CLK_PCLK_SMMU_TV0X, "pclk_smmu_tv0x", "div_pclk_disp",
2737 ENABLE_PCLK_DISP, 22, 0, 0),
2738 GATE(CLK_PCLK_SMMU_DECON1X, "pclk_smmu_decon1x", "div_pclk_disp",
2739 ENABLE_PCLK_DISP, 21, 0, 0),
2740 GATE(CLK_PCLK_SMMU_DECON0X, "pclk_smmu_decon0x", "div_pclk_disp",
2741 ENABLE_PCLK_DISP, 20, 0, 0),
2742 GATE(CLK_PCLK_BTS_DECON_TV_M3, "pclk_bts_decon_tv_m3", "div_pclk_disp",
2743 ENABLE_PCLK_DISP, 19, 0, 0),
2744 GATE(CLK_PCLK_BTS_DECON_TV_M2, "pclk_bts_decon_tv_m2", "div_pclk_disp",
2745 ENABLE_PCLK_DISP, 18, 0, 0),
2746 GATE(CLK_PCLK_BTS_DECON_TV_M1, "pclk_bts_decon_tv_m1", "div_pclk_disp",
2747 ENABLE_PCLK_DISP, 17, 0, 0),
2748 GATE(CLK_PCLK_BTS_DECON_TV_M0, "pclk_bts_decon_tv_m0", "div_pclk_disp",
2749 ENABLE_PCLK_DISP, 16, 0, 0),
2750 GATE(CLK_PCLK_BTS_DECONM4, "pclk_bts_deconm4", "div_pclk_disp",
2751 ENABLE_PCLK_DISP, 15, 0, 0),
2752 GATE(CLK_PCLK_BTS_DECONM3, "pclk_bts_deconm3", "div_pclk_disp",
2753 ENABLE_PCLK_DISP, 14, 0, 0),
2754 GATE(CLK_PCLK_BTS_DECONM2, "pclk_bts_deconm2", "div_pclk_disp",
2755 ENABLE_PCLK_DISP, 13, 0, 0),
2756 GATE(CLK_PCLK_BTS_DECONM1, "pclk_bts_deconm1", "div_pclk_disp",
2757 ENABLE_PCLK_DISP, 12, 0, 0),
2758 GATE(CLK_PCLK_BTS_DECONM0, "pclk_bts_deconm0", "div_pclk_disp",
2759 ENABLE_PCLK_DISP, 11, 0, 0),
2760 GATE(CLK_PCLK_MIC1, "pclk_mic1", "div_pclk_disp",
2761 ENABLE_PCLK_DISP, 10, 0, 0),
2762 GATE(CLK_PCLK_PMU_DISP, "pclk_pmu_disp", "div_pclk_disp",
2763 ENABLE_PCLK_DISP, 9, CLK_IGNORE_UNUSED, 0),
2764 GATE(CLK_PCLK_SYSREG_DISP, "pclk_sysreg_disp", "div_pclk_disp",
2765 ENABLE_PCLK_DISP, 8, CLK_IGNORE_UNUSED, 0),
2766 GATE(CLK_PCLK_HDMIPHY, "pclk_hdmiphy", "div_pclk_disp",
2767 ENABLE_PCLK_DISP, 7, 0, 0),
2768 GATE(CLK_PCLK_HDMI, "pclk_hdmi", "div_pclk_disp",
2769 ENABLE_PCLK_DISP, 6, 0, 0),
2770 GATE(CLK_PCLK_MIC0, "pclk_mic0", "div_pclk_disp",
2771 ENABLE_PCLK_DISP, 5, 0, 0),
2772 GATE(CLK_PCLK_DSIM1, "pclk_dsim1", "div_pclk_disp",
2773 ENABLE_PCLK_DISP, 3, 0, 0),
2774 GATE(CLK_PCLK_DSIM0, "pclk_dsim0", "div_pclk_disp",
2775 ENABLE_PCLK_DISP, 2, 0, 0),
2776 GATE(CLK_PCLK_DECON_TV, "pclk_decon_tv", "div_pclk_disp",
2777 ENABLE_PCLK_DISP, 1, 0, 0),
2778 GATE(CLK_PCLK_DECON, "pclk_decon", "div_pclk_disp",
2779 ENABLE_PCLK_DISP, 0, 0, 0),
2780
2781 /* ENABLE_SCLK_DISP */
2782 GATE(CLK_PHYCLK_MIPIDPHY1_BITCLKDIV8, "phyclk_mipidphy1_bitclkdiv8",
2783 "mout_phyclk_mipidphy1_bitclkdiv8_user",
2784 ENABLE_SCLK_DISP, 26, 0, 0),
2785 GATE(CLK_PHYCLK_MIPIDPHY1_RXCLKESC0, "phyclk_mipidphy1_rxclkesc0",
2786 "mout_phyclk_mipidphy1_rxclkesc0_user",
2787 ENABLE_SCLK_DISP, 25, 0, 0),
2788 GATE(CLK_SCLK_RGB_TV_VCLK_TO_DSIM1, "sclk_rgb_tv_vclk_to_dsim1",
2789 "sclk_rgb_tv_vclk", ENABLE_SCLK_DISP, 24, 0, 0),
2790 GATE(CLK_SCLK_RGB_TV_VCLK_TO_MIC1, "sclk_rgb_tv_vclk_to_mic1",
2791 "sclk_rgb_tv_vclk", ENABLE_SCLK_DISP, 23, 0, 0),
2792 GATE(CLK_SCLK_DSIM1, "sclk_dsim1", "div_sclk_dsim1_disp",
2793 ENABLE_SCLK_DISP, 22, 0, 0),
2794 GATE(CLK_SCLK_DECON_TV_VCLK, "sclk_decon_tv_vclk",
2795 "div_sclk_decon_tv_vclk_disp",
2796 ENABLE_SCLK_DISP, 21, 0, 0),
2797 GATE(CLK_PHYCLK_MIPIDPHY0_BITCLKDIV8, "phyclk_mipidphy0_bitclkdiv8",
2798 "mout_phyclk_mipidphy0_bitclkdiv8_user",
2799 ENABLE_SCLK_DISP, 15, 0, 0),
2800 GATE(CLK_PHYCLK_MIPIDPHY0_RXCLKESC0, "phyclk_mipidphy0_rxclkesc0",
2801 "mout_phyclk_mipidphy0_rxclkesc0_user",
2802 ENABLE_SCLK_DISP, 14, 0, 0),
2803 GATE(CLK_PHYCLK_HDMIPHY_TMDS_CLKO, "phyclk_hdmiphy_tmds_clko",
2804 "mout_phyclk_hdmiphy_tmds_clko_user",
2805 ENABLE_SCLK_DISP, 13, 0, 0),
2806 GATE(CLK_PHYCLK_HDMI_PIXEL, "phyclk_hdmi_pixel",
2807 "sclk_rgb_tv_vclk", ENABLE_SCLK_DISP, 12, 0, 0),
2808 GATE(CLK_SCLK_RGB_VCLK_TO_SMIES, "sclk_rgb_vclk_to_smies",
2809 "sclk_rgb_vclk", ENABLE_SCLK_DISP, 11, 0, 0),
2810 GATE(CLK_SCLK_RGB_VCLK_TO_DSIM0, "sclk_rgb_vclk_to_dsim0",
2811 "sclk_rgb_vclk", ENABLE_SCLK_DISP, 9, 0, 0),
2812 GATE(CLK_SCLK_RGB_VCLK_TO_MIC0, "sclk_rgb_vclk_to_mic0",
2813 "sclk_rgb_vclk", ENABLE_SCLK_DISP, 8, 0, 0),
2814 GATE(CLK_SCLK_DSD, "sclk_dsd", "mout_sclk_dsd_user",
2815 ENABLE_SCLK_DISP, 7, 0, 0),
2816 GATE(CLK_SCLK_HDMI_SPDIF, "sclk_hdmi_spdif", "sclk_hdmi_spdif_disp",
2817 ENABLE_SCLK_DISP, 6, 0, 0),
2818 GATE(CLK_SCLK_DSIM0, "sclk_dsim0", "div_sclk_dsim0_disp",
2819 ENABLE_SCLK_DISP, 5, 0, 0),
2820 GATE(CLK_SCLK_DECON_TV_ECLK, "sclk_decon_tv_eclk",
2821 "div_sclk_decon_tv_eclk_disp",
2822 ENABLE_SCLK_DISP, 4, 0, 0),
2823 GATE(CLK_SCLK_DECON_VCLK, "sclk_decon_vclk",
2824 "div_sclk_decon_vclk_disp", ENABLE_SCLK_DISP, 3, 0, 0),
2825 GATE(CLK_SCLK_DECON_ECLK, "sclk_decon_eclk",
2826 "div_sclk_decon_eclk_disp", ENABLE_SCLK_DISP, 2, 0, 0),
2827};
2828
2829static const struct samsung_cmu_info disp_cmu_info __initconst = {
2830 .pll_clks = disp_pll_clks,
2831 .nr_pll_clks = ARRAY_SIZE(disp_pll_clks),
2832 .mux_clks = disp_mux_clks,
2833 .nr_mux_clks = ARRAY_SIZE(disp_mux_clks),
2834 .div_clks = disp_div_clks,
2835 .nr_div_clks = ARRAY_SIZE(disp_div_clks),
2836 .gate_clks = disp_gate_clks,
2837 .nr_gate_clks = ARRAY_SIZE(disp_gate_clks),
2838 .fixed_clks = disp_fixed_clks,
2839 .nr_fixed_clks = ARRAY_SIZE(disp_fixed_clks),
2840 .fixed_factor_clks = disp_fixed_factor_clks,
2841 .nr_fixed_factor_clks = ARRAY_SIZE(disp_fixed_factor_clks),
2842 .nr_clk_ids = DISP_NR_CLK,
2843 .clk_regs = disp_clk_regs,
2844 .nr_clk_regs = ARRAY_SIZE(disp_clk_regs),
2845};
2846
2847static void __init exynos5433_cmu_disp_init(struct device_node *np)
2848{
2849 samsung_cmu_register_one(np, &disp_cmu_info);
2850}
2851
2852CLK_OF_DECLARE(exynos5433_cmu_disp, "samsung,exynos5433-cmu-disp",
2853 exynos5433_cmu_disp_init);
2854
2855/*
2856 * Register offset definitions for CMU_AUD
2857 */
2858#define MUX_SEL_AUD0 0x0200
2859#define MUX_SEL_AUD1 0x0204
2860#define MUX_ENABLE_AUD0 0x0300
2861#define MUX_ENABLE_AUD1 0x0304
2862#define MUX_STAT_AUD0 0x0400
2863#define DIV_AUD0 0x0600
2864#define DIV_AUD1 0x0604
2865#define DIV_STAT_AUD0 0x0700
2866#define DIV_STAT_AUD1 0x0704
2867#define ENABLE_ACLK_AUD 0x0800
2868#define ENABLE_PCLK_AUD 0x0900
2869#define ENABLE_SCLK_AUD0 0x0a00
2870#define ENABLE_SCLK_AUD1 0x0a04
2871#define ENABLE_IP_AUD0 0x0b00
2872#define ENABLE_IP_AUD1 0x0b04
2873
2874static const unsigned long aud_clk_regs[] __initconst = {
2875 MUX_SEL_AUD0,
2876 MUX_SEL_AUD1,
2877 MUX_ENABLE_AUD0,
2878 MUX_ENABLE_AUD1,
2879 DIV_AUD0,
2880 DIV_AUD1,
2881 ENABLE_ACLK_AUD,
2882 ENABLE_PCLK_AUD,
2883 ENABLE_SCLK_AUD0,
2884 ENABLE_SCLK_AUD1,
2885 ENABLE_IP_AUD0,
2886 ENABLE_IP_AUD1,
2887};
2888
2889/* list of all parent clock list */
2890PNAME(mout_aud_pll_user_aud_p) = { "oscclk", "fout_aud_pll", };
2891PNAME(mout_sclk_aud_pcm_p) = { "mout_aud_pll_user", "ioclk_audiocdclk0",};
2892
2893static const struct samsung_fixed_rate_clock aud_fixed_clks[] __initconst = {
2894 FRATE(0, "ioclk_jtag_tclk", NULL, 0, 33000000),
2895 FRATE(0, "ioclk_slimbus_clk", NULL, 0, 25000000),
2896 FRATE(0, "ioclk_i2s_bclk", NULL, 0, 50000000),
2897};
2898
2899static const struct samsung_mux_clock aud_mux_clks[] __initconst = {
2900 /* MUX_SEL_AUD0 */
2901 MUX(CLK_MOUT_AUD_PLL_USER, "mout_aud_pll_user",
2902 mout_aud_pll_user_aud_p, MUX_SEL_AUD0, 0, 1),
2903
2904 /* MUX_SEL_AUD1 */
2905 MUX(CLK_MOUT_SCLK_AUD_PCM, "mout_sclk_aud_pcm", mout_sclk_aud_pcm_p,
2906 MUX_SEL_AUD1, 8, 1),
2907 MUX(CLK_MOUT_SCLK_AUD_I2S, "mout_sclk_aud_i2s", mout_sclk_aud_pcm_p,
2908 MUX_SEL_AUD1, 0, 1),
2909};
2910
2911static const struct samsung_div_clock aud_div_clks[] __initconst = {
2912 /* DIV_AUD0 */
2913 DIV(CLK_DIV_ATCLK_AUD, "div_atclk_aud", "div_aud_ca5", DIV_AUD0,
2914 12, 4),
2915 DIV(CLK_DIV_PCLK_DBG_AUD, "div_pclk_dbg_aud", "div_aud_ca5", DIV_AUD0,
2916 8, 4),
2917 DIV(CLK_DIV_ACLK_AUD, "div_aclk_aud", "div_aud_ca5", DIV_AUD0,
2918 4, 4),
2919 DIV(CLK_DIV_AUD_CA5, "div_aud_ca5", "mout_aud_pll_user", DIV_AUD0,
2920 0, 4),
2921
2922 /* DIV_AUD1 */
2923 DIV(CLK_DIV_SCLK_AUD_SLIMBUS, "div_sclk_aud_slimbus",
2924 "mout_aud_pll_user", DIV_AUD1, 16, 5),
2925 DIV(CLK_DIV_SCLK_AUD_UART, "div_sclk_aud_uart", "mout_aud_pll_user",
2926 DIV_AUD1, 12, 4),
2927 DIV(CLK_DIV_SCLK_AUD_PCM, "div_sclk_aud_pcm", "mout_sclk_aud_pcm",
2928 DIV_AUD1, 4, 8),
2929 DIV(CLK_DIV_SCLK_AUD_I2S, "div_sclk_aud_i2s", "mout_sclk_aud_i2s",
2930 DIV_AUD1, 0, 4),
2931};
2932
2933static const struct samsung_gate_clock aud_gate_clks[] __initconst = {
2934 /* ENABLE_ACLK_AUD */
2935 GATE(CLK_ACLK_INTR_CTRL, "aclk_intr_ctrl", "div_aclk_aud",
2936 ENABLE_ACLK_AUD, 12, 0, 0),
2937 GATE(CLK_ACLK_SMMU_LPASSX, "aclk_smmu_lpassx", "div_aclk_aud",
2938 ENABLE_ACLK_AUD, 7, 0, 0),
2939 GATE(CLK_ACLK_XIU_LPASSX, "aclk_xiu_lpassx", "div_aclk_aud",
2940 ENABLE_ACLK_AUD, 0, 4, 0),
2941 GATE(CLK_ACLK_AUDNP_133, "aclk_audnp_133", "div_aclk_aud",
2942 ENABLE_ACLK_AUD, 0, 3, 0),
2943 GATE(CLK_ACLK_AUDND_133, "aclk_audnd_133", "div_aclk_aud",
2944 ENABLE_ACLK_AUD, 0, 2, 0),
2945 GATE(CLK_ACLK_SRAMC, "aclk_sramc", "div_aclk_aud", ENABLE_ACLK_AUD,
2946 0, 1, 0),
2947 GATE(CLK_ACLK_DMAC, "aclk_dmac", "div_aclk_aud", ENABLE_ACLK_AUD,
2948 0, CLK_IGNORE_UNUSED, 0),
2949
2950 /* ENABLE_PCLK_AUD */
2951 GATE(CLK_PCLK_WDT1, "pclk_wdt1", "div_aclk_aud", ENABLE_PCLK_AUD,
2952 13, 0, 0),
2953 GATE(CLK_PCLK_WDT0, "pclk_wdt0", "div_aclk_aud", ENABLE_PCLK_AUD,
2954 12, 0, 0),
2955 GATE(CLK_PCLK_SFR1, "pclk_sfr1", "div_aclk_aud", ENABLE_PCLK_AUD,
2956 11, 0, 0),
2957 GATE(CLK_PCLK_SMMU_LPASSX, "pclk_smmu_lpassx", "div_aclk_aud",
2958 ENABLE_PCLK_AUD, 10, 0, 0),
2959 GATE(CLK_PCLK_GPIO_AUD, "pclk_gpio_aud", "div_aclk_aud",
2960 ENABLE_PCLK_AUD, 9, CLK_IGNORE_UNUSED, 0),
2961 GATE(CLK_PCLK_PMU_AUD, "pclk_pmu_aud", "div_aclk_aud",
2962 ENABLE_PCLK_AUD, 8, CLK_IGNORE_UNUSED, 0),
2963 GATE(CLK_PCLK_SYSREG_AUD, "pclk_sysreg_aud", "div_aclk_aud",
2964 ENABLE_PCLK_AUD, 7, CLK_IGNORE_UNUSED, 0),
2965 GATE(CLK_PCLK_AUD_SLIMBUS, "pclk_aud_slimbus", "div_aclk_aud",
2966 ENABLE_PCLK_AUD, 6, 0, 0),
2967 GATE(CLK_PCLK_AUD_UART, "pclk_aud_uart", "div_aclk_aud",
2968 ENABLE_PCLK_AUD, 5, 0, 0),
2969 GATE(CLK_PCLK_AUD_PCM, "pclk_aud_pcm", "div_aclk_aud",
2970 ENABLE_PCLK_AUD, 4, 0, 0),
2971 GATE(CLK_PCLK_AUD_I2S, "pclk_aud_i2s", "div_aclk_aud",
2972 ENABLE_PCLK_AUD, 3, 0, 0),
2973 GATE(CLK_PCLK_TIMER, "pclk_timer", "div_aclk_aud", ENABLE_PCLK_AUD,
2974 2, 0, 0),
2975 GATE(CLK_PCLK_SFR0_CTRL, "pclk_sfr0_ctrl", "div_aclk_aud",
2976 ENABLE_PCLK_AUD, 0, 0, 0),
2977
2978 /* ENABLE_SCLK_AUD0 */
2979 GATE(CLK_ATCLK_AUD, "atclk_aud", "div_atclk_aud", ENABLE_SCLK_AUD0,
2980 2, CLK_IGNORE_UNUSED, 0),
2981 GATE(CLK_PCLK_DBG_AUD, "pclk_dbg_aud", "div_pclk_dbg_aud",
2982 ENABLE_SCLK_AUD0, 1, 0, 0),
2983 GATE(CLK_SCLK_AUD_CA5, "sclk_aud_ca5", "div_aud_ca5", ENABLE_SCLK_AUD0,
2984 0, 0, 0),
2985
2986 /* ENABLE_SCLK_AUD1 */
2987 GATE(CLK_SCLK_JTAG_TCK, "sclk_jtag_tck", "ioclk_jtag_tclk",
2988 ENABLE_SCLK_AUD1, 6, 0, 0),
2989 GATE(CLK_SCLK_SLIMBUS_CLKIN, "sclk_slimbus_clkin", "ioclk_slimbus_clk",
2990 ENABLE_SCLK_AUD1, 5, 0, 0),
2991 GATE(CLK_SCLK_AUD_SLIMBUS, "sclk_aud_slimbus", "div_sclk_aud_slimbus",
2992 ENABLE_SCLK_AUD1, 4, 0, 0),
2993 GATE(CLK_SCLK_AUD_UART, "sclk_aud_uart", "div_sclk_aud_uart",
2994 ENABLE_SCLK_AUD1, 3, CLK_IGNORE_UNUSED, 0),
2995 GATE(CLK_SCLK_AUD_PCM, "sclk_aud_pcm", "div_sclk_aud_pcm",
2996 ENABLE_SCLK_AUD1, 2, 0, 0),
2997 GATE(CLK_SCLK_I2S_BCLK, "sclk_i2s_bclk", "ioclk_i2s_bclk",
2998 ENABLE_SCLK_AUD1, 1, CLK_IGNORE_UNUSED, 0),
2999 GATE(CLK_SCLK_AUD_I2S, "sclk_aud_i2s", "div_sclk_aud_i2s",
3000 ENABLE_SCLK_AUD1, 0, CLK_IGNORE_UNUSED, 0),
3001};
3002
3003static const struct samsung_cmu_info aud_cmu_info __initconst = {
3004 .mux_clks = aud_mux_clks,
3005 .nr_mux_clks = ARRAY_SIZE(aud_mux_clks),
3006 .div_clks = aud_div_clks,
3007 .nr_div_clks = ARRAY_SIZE(aud_div_clks),
3008 .gate_clks = aud_gate_clks,
3009 .nr_gate_clks = ARRAY_SIZE(aud_gate_clks),
3010 .fixed_clks = aud_fixed_clks,
3011 .nr_fixed_clks = ARRAY_SIZE(aud_fixed_clks),
3012 .nr_clk_ids = AUD_NR_CLK,
3013 .clk_regs = aud_clk_regs,
3014 .nr_clk_regs = ARRAY_SIZE(aud_clk_regs),
3015};
3016
3017static void __init exynos5433_cmu_aud_init(struct device_node *np)
3018{
3019 samsung_cmu_register_one(np, &aud_cmu_info);
3020}
3021CLK_OF_DECLARE(exynos5433_cmu_aud, "samsung,exynos5433-cmu-aud",
3022 exynos5433_cmu_aud_init);
3023
3024
3025/*
3026 * Register offset definitions for CMU_BUS{0|1|2}
3027 */
3028#define DIV_BUS 0x0600
3029#define DIV_STAT_BUS 0x0700
3030#define ENABLE_ACLK_BUS 0x0800
3031#define ENABLE_PCLK_BUS 0x0900
3032#define ENABLE_IP_BUS0 0x0b00
3033#define ENABLE_IP_BUS1 0x0b04
3034
3035#define MUX_SEL_BUS2 0x0200 /* Only for CMU_BUS2 */
3036#define MUX_ENABLE_BUS2 0x0300 /* Only for CMU_BUS2 */
3037#define MUX_STAT_BUS2 0x0400 /* Only for CMU_BUS2 */
3038
3039/* list of all parent clock list */
3040PNAME(mout_aclk_bus2_400_p) = { "oscclk", "aclk_bus2_400", };
3041
3042#define CMU_BUS_COMMON_CLK_REGS \
3043 DIV_BUS, \
3044 ENABLE_ACLK_BUS, \
3045 ENABLE_PCLK_BUS, \
3046 ENABLE_IP_BUS0, \
3047 ENABLE_IP_BUS1
3048
3049static const unsigned long bus01_clk_regs[] __initconst = {
3050 CMU_BUS_COMMON_CLK_REGS,
3051};
3052
3053static const unsigned long bus2_clk_regs[] __initconst = {
3054 MUX_SEL_BUS2,
3055 MUX_ENABLE_BUS2,
3056 CMU_BUS_COMMON_CLK_REGS,
3057};
3058
3059static const struct samsung_div_clock bus0_div_clks[] __initconst = {
3060 /* DIV_BUS0 */
3061 DIV(CLK_DIV_PCLK_BUS_133, "div_pclk_bus0_133", "aclk_bus0_400",
3062 DIV_BUS, 0, 3),
3063};
3064
3065/* CMU_BUS0 clocks */
3066static const struct samsung_gate_clock bus0_gate_clks[] __initconst = {
3067 /* ENABLE_ACLK_BUS0 */
3068 GATE(CLK_ACLK_AHB2APB_BUSP, "aclk_ahb2apb_bus0p", "div_pclk_bus0_133",
3069 ENABLE_ACLK_BUS, 4, CLK_IGNORE_UNUSED, 0),
3070 GATE(CLK_ACLK_BUSNP_133, "aclk_bus0np_133", "div_pclk_bus0_133",
3071 ENABLE_ACLK_BUS, 2, CLK_IGNORE_UNUSED, 0),
3072 GATE(CLK_ACLK_BUSND_400, "aclk_bus0nd_400", "aclk_bus0_400",
3073 ENABLE_ACLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
3074
3075 /* ENABLE_PCLK_BUS0 */
3076 GATE(CLK_PCLK_BUSSRVND_133, "pclk_bus0srvnd_133", "div_pclk_bus0_133",
3077 ENABLE_PCLK_BUS, 2, 0, 0),
3078 GATE(CLK_PCLK_PMU_BUS, "pclk_pmu_bus0", "div_pclk_bus0_133",
3079 ENABLE_PCLK_BUS, 1, CLK_IGNORE_UNUSED, 0),
3080 GATE(CLK_PCLK_SYSREG_BUS, "pclk_sysreg_bus0", "div_pclk_bus0_133",
3081 ENABLE_PCLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
3082};
3083
3084/* CMU_BUS1 clocks */
3085static const struct samsung_div_clock bus1_div_clks[] __initconst = {
3086 /* DIV_BUS1 */
3087 DIV(CLK_DIV_PCLK_BUS_133, "div_pclk_bus1_133", "aclk_bus1_400",
3088 DIV_BUS, 0, 3),
3089};
3090
3091static const struct samsung_gate_clock bus1_gate_clks[] __initconst = {
3092 /* ENABLE_ACLK_BUS1 */
3093 GATE(CLK_ACLK_AHB2APB_BUSP, "aclk_ahb2apb_bus1p", "div_pclk_bus1_133",
3094 ENABLE_ACLK_BUS, 4, CLK_IGNORE_UNUSED, 0),
3095 GATE(CLK_ACLK_BUSNP_133, "aclk_bus1np_133", "div_pclk_bus1_133",
3096 ENABLE_ACLK_BUS, 2, CLK_IGNORE_UNUSED, 0),
3097 GATE(CLK_ACLK_BUSND_400, "aclk_bus1nd_400", "aclk_bus1_400",
3098 ENABLE_ACLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
3099
3100 /* ENABLE_PCLK_BUS1 */
3101 GATE(CLK_PCLK_BUSSRVND_133, "pclk_bus1srvnd_133", "div_pclk_bus1_133",
3102 ENABLE_PCLK_BUS, 2, 0, 0),
3103 GATE(CLK_PCLK_PMU_BUS, "pclk_pmu_bus1", "div_pclk_bus1_133",
3104 ENABLE_PCLK_BUS, 1, CLK_IGNORE_UNUSED, 0),
3105 GATE(CLK_PCLK_SYSREG_BUS, "pclk_sysreg_bus1", "div_pclk_bus1_133",
3106 ENABLE_PCLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
3107};
3108
3109/* CMU_BUS2 clocks */
3110static const struct samsung_mux_clock bus2_mux_clks[] __initconst = {
3111 /* MUX_SEL_BUS2 */
3112 MUX(CLK_MOUT_ACLK_BUS2_400_USER, "mout_aclk_bus2_400_user",
3113 mout_aclk_bus2_400_p, MUX_SEL_BUS2, 0, 1),
3114};
3115
3116static const struct samsung_div_clock bus2_div_clks[] __initconst = {
3117 /* DIV_BUS2 */
3118 DIV(CLK_DIV_PCLK_BUS_133, "div_pclk_bus2_133",
3119 "mout_aclk_bus2_400_user", DIV_BUS, 0, 3),
3120};
3121
3122static const struct samsung_gate_clock bus2_gate_clks[] __initconst = {
3123 /* ENABLE_ACLK_BUS2 */
3124 GATE(CLK_ACLK_AHB2APB_BUSP, "aclk_ahb2apb_bus2p", "div_pclk_bus2_133",
3125 ENABLE_ACLK_BUS, 3, CLK_IGNORE_UNUSED, 0),
3126 GATE(CLK_ACLK_BUSNP_133, "aclk_bus2np_133", "div_pclk_bus2_133",
3127 ENABLE_ACLK_BUS, 2, CLK_IGNORE_UNUSED, 0),
3128 GATE(CLK_ACLK_BUS2BEND_400, "aclk_bus2bend_400",
3129 "mout_aclk_bus2_400_user", ENABLE_ACLK_BUS,
3130 1, CLK_IGNORE_UNUSED, 0),
3131 GATE(CLK_ACLK_BUS2RTND_400, "aclk_bus2rtnd_400",
3132 "mout_aclk_bus2_400_user", ENABLE_ACLK_BUS,
3133 0, CLK_IGNORE_UNUSED, 0),
3134
3135 /* ENABLE_PCLK_BUS2 */
3136 GATE(CLK_PCLK_BUSSRVND_133, "pclk_bus2srvnd_133", "div_pclk_bus2_133",
3137 ENABLE_PCLK_BUS, 2, 0, 0),
3138 GATE(CLK_PCLK_PMU_BUS, "pclk_pmu_bus2", "div_pclk_bus2_133",
3139 ENABLE_PCLK_BUS, 1, CLK_IGNORE_UNUSED, 0),
3140 GATE(CLK_PCLK_SYSREG_BUS, "pclk_sysreg_bus2", "div_pclk_bus2_133",
3141 ENABLE_PCLK_BUS, 0, CLK_IGNORE_UNUSED, 0),
3142};
3143
3144#define CMU_BUS_INFO_CLKS(id) \
3145 .div_clks = bus##id##_div_clks, \
3146 .nr_div_clks = ARRAY_SIZE(bus##id##_div_clks), \
3147 .gate_clks = bus##id##_gate_clks, \
3148 .nr_gate_clks = ARRAY_SIZE(bus##id##_gate_clks), \
3149 .nr_clk_ids = BUSx_NR_CLK
3150
3151static const struct samsung_cmu_info bus0_cmu_info __initconst = {
3152 CMU_BUS_INFO_CLKS(0),
3153 .clk_regs = bus01_clk_regs,
3154 .nr_clk_regs = ARRAY_SIZE(bus01_clk_regs),
3155};
3156
3157static const struct samsung_cmu_info bus1_cmu_info __initconst = {
3158 CMU_BUS_INFO_CLKS(1),
3159 .clk_regs = bus01_clk_regs,
3160 .nr_clk_regs = ARRAY_SIZE(bus01_clk_regs),
3161};
3162
3163static const struct samsung_cmu_info bus2_cmu_info __initconst = {
3164 CMU_BUS_INFO_CLKS(2),
3165 .mux_clks = bus2_mux_clks,
3166 .nr_mux_clks = ARRAY_SIZE(bus2_mux_clks),
3167 .clk_regs = bus2_clk_regs,
3168 .nr_clk_regs = ARRAY_SIZE(bus2_clk_regs),
3169};
3170
3171#define exynos5433_cmu_bus_init(id) \
3172static void __init exynos5433_cmu_bus##id##_init(struct device_node *np)\
3173{ \
3174 samsung_cmu_register_one(np, &bus##id##_cmu_info); \
3175} \
3176CLK_OF_DECLARE(exynos5433_cmu_bus##id, \
3177 "samsung,exynos5433-cmu-bus"#id, \
3178 exynos5433_cmu_bus##id##_init)
3179
3180exynos5433_cmu_bus_init(0);
3181exynos5433_cmu_bus_init(1);
3182exynos5433_cmu_bus_init(2);
3183
3184/*
3185 * Register offset definitions for CMU_G3D
3186 */
3187#define G3D_PLL_LOCK 0x0000
3188#define G3D_PLL_CON0 0x0100
3189#define G3D_PLL_CON1 0x0104
3190#define G3D_PLL_FREQ_DET 0x010c
3191#define MUX_SEL_G3D 0x0200
3192#define MUX_ENABLE_G3D 0x0300
3193#define MUX_STAT_G3D 0x0400
3194#define DIV_G3D 0x0600
3195#define DIV_G3D_PLL_FREQ_DET 0x0604
3196#define DIV_STAT_G3D 0x0700
3197#define DIV_STAT_G3D_PLL_FREQ_DET 0x0704
3198#define ENABLE_ACLK_G3D 0x0800
3199#define ENABLE_PCLK_G3D 0x0900
3200#define ENABLE_SCLK_G3D 0x0a00
3201#define ENABLE_IP_G3D0 0x0b00
3202#define ENABLE_IP_G3D1 0x0b04
3203#define CLKOUT_CMU_G3D 0x0c00
3204#define CLKOUT_CMU_G3D_DIV_STAT 0x0c04
3205#define CLK_STOPCTRL 0x1000
3206
3207static const unsigned long g3d_clk_regs[] __initconst = {
3208 G3D_PLL_LOCK,
3209 G3D_PLL_CON0,
3210 G3D_PLL_CON1,
3211 G3D_PLL_FREQ_DET,
3212 MUX_SEL_G3D,
3213 MUX_ENABLE_G3D,
3214 DIV_G3D,
3215 DIV_G3D_PLL_FREQ_DET,
3216 ENABLE_ACLK_G3D,
3217 ENABLE_PCLK_G3D,
3218 ENABLE_SCLK_G3D,
3219 ENABLE_IP_G3D0,
3220 ENABLE_IP_G3D1,
3221 CLKOUT_CMU_G3D,
3222 CLKOUT_CMU_G3D_DIV_STAT,
3223 CLK_STOPCTRL,
3224};
3225
3226/* list of all parent clock list */
3227PNAME(mout_aclk_g3d_400_p) = { "mout_g3d_pll", "aclk_g3d_400", };
3228PNAME(mout_g3d_pll_p) = { "oscclk", "fout_g3d_pll", };
3229
3230static const struct samsung_pll_clock g3d_pll_clks[] __initconst = {
3231 PLL(pll_35xx, CLK_FOUT_G3D_PLL, "fout_g3d_pll", "oscclk",
3232 G3D_PLL_LOCK, G3D_PLL_CON0, exynos5433_pll_rates),
3233};
3234
3235static const struct samsung_mux_clock g3d_mux_clks[] __initconst = {
3236 /* MUX_SEL_G3D */
3237 MUX_F(CLK_MOUT_ACLK_G3D_400, "mout_aclk_g3d_400", mout_aclk_g3d_400_p,
3238 MUX_SEL_G3D, 8, 1, CLK_SET_RATE_PARENT, 0),
3239 MUX_F(CLK_MOUT_G3D_PLL, "mout_g3d_pll", mout_g3d_pll_p,
3240 MUX_SEL_G3D, 0, 1, CLK_SET_RATE_PARENT, 0),
3241};
3242
3243static const struct samsung_div_clock g3d_div_clks[] __initconst = {
3244 /* DIV_G3D */
3245 DIV(CLK_DIV_SCLK_HPM_G3D, "div_sclk_hpm_g3d", "mout_g3d_pll", DIV_G3D,
3246 8, 2),
3247 DIV(CLK_DIV_PCLK_G3D, "div_pclk_g3d", "div_aclk_g3d", DIV_G3D,
3248 4, 3),
3249 DIV_F(CLK_DIV_ACLK_G3D, "div_aclk_g3d", "mout_aclk_g3d_400", DIV_G3D,
3250 0, 3, CLK_SET_RATE_PARENT, 0),
3251};
3252
3253static const struct samsung_gate_clock g3d_gate_clks[] __initconst = {
3254 /* ENABLE_ACLK_G3D */
3255 GATE(CLK_ACLK_BTS_G3D1, "aclk_bts_g3d1", "div_aclk_g3d",
3256 ENABLE_ACLK_G3D, 7, 0, 0),
3257 GATE(CLK_ACLK_BTS_G3D0, "aclk_bts_g3d0", "div_aclk_g3d",
3258 ENABLE_ACLK_G3D, 6, 0, 0),
3259 GATE(CLK_ACLK_ASYNCAPBS_G3D, "aclk_asyncapbs_g3d", "div_pclk_g3d",
3260 ENABLE_ACLK_G3D, 5, CLK_IGNORE_UNUSED, 0),
3261 GATE(CLK_ACLK_ASYNCAPBM_G3D, "aclk_asyncapbm_g3d", "div_aclk_g3d",
3262 ENABLE_ACLK_G3D, 4, CLK_IGNORE_UNUSED, 0),
3263 GATE(CLK_ACLK_AHB2APB_G3DP, "aclk_ahb2apb_g3dp", "div_pclk_g3d",
3264 ENABLE_ACLK_G3D, 3, CLK_IGNORE_UNUSED, 0),
3265 GATE(CLK_ACLK_G3DNP_150, "aclk_g3dnp_150", "div_pclk_g3d",
3266 ENABLE_ACLK_G3D, 2, CLK_IGNORE_UNUSED, 0),
3267 GATE(CLK_ACLK_G3DND_600, "aclk_g3dnd_600", "div_aclk_g3d",
3268 ENABLE_ACLK_G3D, 1, CLK_IGNORE_UNUSED, 0),
3269 GATE(CLK_ACLK_G3D, "aclk_g3d", "div_aclk_g3d",
3270 ENABLE_ACLK_G3D, 0, CLK_SET_RATE_PARENT, 0),
3271
3272 /* ENABLE_PCLK_G3D */
3273 GATE(CLK_PCLK_BTS_G3D1, "pclk_bts_g3d1", "div_pclk_g3d",
3274 ENABLE_PCLK_G3D, 3, 0, 0),
3275 GATE(CLK_PCLK_BTS_G3D0, "pclk_bts_g3d0", "div_pclk_g3d",
3276 ENABLE_PCLK_G3D, 2, 0, 0),
3277 GATE(CLK_PCLK_PMU_G3D, "pclk_pmu_g3d", "div_pclk_g3d",
3278 ENABLE_PCLK_G3D, 1, CLK_IGNORE_UNUSED, 0),
3279 GATE(CLK_PCLK_SYSREG_G3D, "pclk_sysreg_g3d", "div_pclk_g3d",
3280 ENABLE_PCLK_G3D, 0, CLK_IGNORE_UNUSED, 0),
3281
3282 /* ENABLE_SCLK_G3D */
3283 GATE(CLK_SCLK_HPM_G3D, "sclk_hpm_g3d", "div_sclk_hpm_g3d",
3284 ENABLE_SCLK_G3D, 0, 0, 0),
3285};
3286
3287static const struct samsung_cmu_info g3d_cmu_info __initconst = {
3288 .pll_clks = g3d_pll_clks,
3289 .nr_pll_clks = ARRAY_SIZE(g3d_pll_clks),
3290 .mux_clks = g3d_mux_clks,
3291 .nr_mux_clks = ARRAY_SIZE(g3d_mux_clks),
3292 .div_clks = g3d_div_clks,
3293 .nr_div_clks = ARRAY_SIZE(g3d_div_clks),
3294 .gate_clks = g3d_gate_clks,
3295 .nr_gate_clks = ARRAY_SIZE(g3d_gate_clks),
3296 .nr_clk_ids = G3D_NR_CLK,
3297 .clk_regs = g3d_clk_regs,
3298 .nr_clk_regs = ARRAY_SIZE(g3d_clk_regs),
3299};
3300
3301static void __init exynos5433_cmu_g3d_init(struct device_node *np)
3302{
3303 samsung_cmu_register_one(np, &g3d_cmu_info);
3304}
3305CLK_OF_DECLARE(exynos5433_cmu_g3d, "samsung,exynos5433-cmu-g3d",
3306 exynos5433_cmu_g3d_init);
3307
3308/*
3309 * Register offset definitions for CMU_GSCL
3310 */
3311#define MUX_SEL_GSCL 0x0200
3312#define MUX_ENABLE_GSCL 0x0300
3313#define MUX_STAT_GSCL 0x0400
3314#define ENABLE_ACLK_GSCL 0x0800
3315#define ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL0 0x0804
3316#define ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL1 0x0808
3317#define ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL2 0x080c
3318#define ENABLE_PCLK_GSCL 0x0900
3319#define ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL0 0x0904
3320#define ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL1 0x0908
3321#define ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL2 0x090c
3322#define ENABLE_IP_GSCL0 0x0b00
3323#define ENABLE_IP_GSCL1 0x0b04
3324#define ENABLE_IP_GSCL_SECURE_SMMU_GSCL0 0x0b08
3325#define ENABLE_IP_GSCL_SECURE_SMMU_GSCL1 0x0b0c
3326#define ENABLE_IP_GSCL_SECURE_SMMU_GSCL2 0x0b10
3327
3328static const unsigned long gscl_clk_regs[] __initconst = {
3329 MUX_SEL_GSCL,
3330 MUX_ENABLE_GSCL,
3331 ENABLE_ACLK_GSCL,
3332 ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL0,
3333 ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL1,
3334 ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL2,
3335 ENABLE_PCLK_GSCL,
3336 ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL0,
3337 ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL1,
3338 ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL2,
3339 ENABLE_IP_GSCL0,
3340 ENABLE_IP_GSCL1,
3341 ENABLE_IP_GSCL_SECURE_SMMU_GSCL0,
3342 ENABLE_IP_GSCL_SECURE_SMMU_GSCL1,
3343 ENABLE_IP_GSCL_SECURE_SMMU_GSCL2,
3344};
3345
3346/* list of all parent clock list */
3347PNAME(aclk_gscl_111_user_p) = { "oscclk", "aclk_gscl_111", };
3348PNAME(aclk_gscl_333_user_p) = { "oscclk", "aclk_gscl_333", };
3349
3350static const struct samsung_mux_clock gscl_mux_clks[] __initconst = {
3351 /* MUX_SEL_GSCL */
3352 MUX(CLK_MOUT_ACLK_GSCL_111_USER, "mout_aclk_gscl_111_user",
3353 aclk_gscl_111_user_p, MUX_SEL_GSCL, 4, 1),
3354 MUX(CLK_MOUT_ACLK_GSCL_333_USER, "mout_aclk_gscl_333_user",
3355 aclk_gscl_333_user_p, MUX_SEL_GSCL, 0, 1),
3356};
3357
3358static const struct samsung_gate_clock gscl_gate_clks[] __initconst = {
3359 /* ENABLE_ACLK_GSCL */
3360 GATE(CLK_ACLK_BTS_GSCL2, "aclk_bts_gscl2", "mout_aclk_gscl_333_user",
3361 ENABLE_ACLK_GSCL, 11, 0, 0),
3362 GATE(CLK_ACLK_BTS_GSCL1, "aclk_bts_gscl1", "mout_aclk_gscl_333_user",
3363 ENABLE_ACLK_GSCL, 10, 0, 0),
3364 GATE(CLK_ACLK_BTS_GSCL0, "aclk_bts_gscl0", "mout_aclk_gscl_333_user",
3365 ENABLE_ACLK_GSCL, 9, 0, 0),
3366 GATE(CLK_ACLK_AHB2APB_GSCLP, "aclk_ahb2apb_gsclp",
3367 "mout_aclk_gscl_111_user", ENABLE_ACLK_GSCL,
3368 8, CLK_IGNORE_UNUSED, 0),
3369 GATE(CLK_ACLK_XIU_GSCLX, "aclk_xiu_gsclx", "mout_aclk_gscl_333_user",
3370 ENABLE_ACLK_GSCL, 7, 0, 0),
3371 GATE(CLK_ACLK_GSCLNP_111, "aclk_gsclnp_111", "mout_aclk_gscl_111_user",
3372 ENABLE_ACLK_GSCL, 6, CLK_IGNORE_UNUSED, 0),
3373 GATE(CLK_ACLK_GSCLRTND_333, "aclk_gsclrtnd_333",
3374 "mout_aclk_gscl_333_user", ENABLE_ACLK_GSCL, 5,
3375 CLK_IGNORE_UNUSED, 0),
3376 GATE(CLK_ACLK_GSCLBEND_333, "aclk_gsclbend_333",
3377 "mout_aclk_gscl_333_user", ENABLE_ACLK_GSCL, 4,
3378 CLK_IGNORE_UNUSED, 0),
3379 GATE(CLK_ACLK_GSD, "aclk_gsd", "mout_aclk_gscl_333_user",
3380 ENABLE_ACLK_GSCL, 3, 0, 0),
3381 GATE(CLK_ACLK_GSCL2, "aclk_gscl2", "mout_aclk_gscl_333_user",
3382 ENABLE_ACLK_GSCL, 2, 0, 0),
3383 GATE(CLK_ACLK_GSCL1, "aclk_gscl1", "mout_aclk_gscl_333_user",
3384 ENABLE_ACLK_GSCL, 1, 0, 0),
3385 GATE(CLK_ACLK_GSCL0, "aclk_gscl0", "mout_aclk_gscl_333_user",
3386 ENABLE_ACLK_GSCL, 0, 0, 0),
3387
3388 /* ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL0 */
3389 GATE(CLK_ACLK_SMMU_GSCL0, "aclk_smmu_gscl0", "mout_aclk_gscl_333_user",
3390 ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL0, 0, 0, 0),
3391
3392 /* ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL1 */
3393 GATE(CLK_ACLK_SMMU_GSCL1, "aclk_smmu_gscl1", "mout_aclk_gscl_333_user",
3394 ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL1, 0, 0, 0),
3395
3396 /* ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL2 */
3397 GATE(CLK_ACLK_SMMU_GSCL2, "aclk_smmu_gscl2", "mout_aclk_gscl_333_user",
3398 ENABLE_ACLK_GSCL_SECURE_SMMU_GSCL2, 0, 0, 0),
3399
3400 /* ENABLE_PCLK_GSCL */
3401 GATE(CLK_PCLK_BTS_GSCL2, "pclk_bts_gscl2", "mout_aclk_gscl_111_user",
3402 ENABLE_PCLK_GSCL, 7, 0, 0),
3403 GATE(CLK_PCLK_BTS_GSCL1, "pclk_bts_gscl1", "mout_aclk_gscl_111_user",
3404 ENABLE_PCLK_GSCL, 6, 0, 0),
3405 GATE(CLK_PCLK_BTS_GSCL0, "pclk_bts_gscl0", "mout_aclk_gscl_111_user",
3406 ENABLE_PCLK_GSCL, 5, 0, 0),
3407 GATE(CLK_PCLK_PMU_GSCL, "pclk_pmu_gscl", "mout_aclk_gscl_111_user",
3408 ENABLE_PCLK_GSCL, 4, CLK_IGNORE_UNUSED, 0),
3409 GATE(CLK_PCLK_SYSREG_GSCL, "pclk_sysreg_gscl",
3410 "mout_aclk_gscl_111_user", ENABLE_PCLK_GSCL,
3411 3, CLK_IGNORE_UNUSED, 0),
3412 GATE(CLK_PCLK_GSCL2, "pclk_gscl2", "mout_aclk_gscl_111_user",
3413 ENABLE_PCLK_GSCL, 2, 0, 0),
3414 GATE(CLK_PCLK_GSCL1, "pclk_gscl1", "mout_aclk_gscl_111_user",
3415 ENABLE_PCLK_GSCL, 1, 0, 0),
3416 GATE(CLK_PCLK_GSCL0, "pclk_gscl0", "mout_aclk_gscl_111_user",
3417 ENABLE_PCLK_GSCL, 0, 0, 0),
3418
3419 /* ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL0 */
3420 GATE(CLK_PCLK_SMMU_GSCL0, "pclk_smmu_gscl0", "mout_aclk_gscl_111_user",
3421 ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL0, 0, 0, 0),
3422
3423 /* ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL1 */
3424 GATE(CLK_PCLK_SMMU_GSCL1, "pclk_smmu_gscl1", "mout_aclk_gscl_111_user",
3425 ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL1, 0, 0, 0),
3426
3427 /* ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL2 */
3428 GATE(CLK_PCLK_SMMU_GSCL2, "pclk_smmu_gscl2", "mout_aclk_gscl_111_user",
3429 ENABLE_PCLK_GSCL_SECURE_SMMU_GSCL2, 0, 0, 0),
3430};
3431
3432static const struct samsung_cmu_info gscl_cmu_info __initconst = {
3433 .mux_clks = gscl_mux_clks,
3434 .nr_mux_clks = ARRAY_SIZE(gscl_mux_clks),
3435 .gate_clks = gscl_gate_clks,
3436 .nr_gate_clks = ARRAY_SIZE(gscl_gate_clks),
3437 .nr_clk_ids = GSCL_NR_CLK,
3438 .clk_regs = gscl_clk_regs,
3439 .nr_clk_regs = ARRAY_SIZE(gscl_clk_regs),
3440};
3441
3442static void __init exynos5433_cmu_gscl_init(struct device_node *np)
3443{
3444 samsung_cmu_register_one(np, &gscl_cmu_info);
3445}
3446CLK_OF_DECLARE(exynos5433_cmu_gscl, "samsung,exynos5433-cmu-gscl",
3447 exynos5433_cmu_gscl_init);
3448
3449/*
3450 * Register offset definitions for CMU_APOLLO
3451 */
3452#define APOLLO_PLL_LOCK 0x0000
3453#define APOLLO_PLL_CON0 0x0100
3454#define APOLLO_PLL_CON1 0x0104
3455#define APOLLO_PLL_FREQ_DET 0x010c
3456#define MUX_SEL_APOLLO0 0x0200
3457#define MUX_SEL_APOLLO1 0x0204
3458#define MUX_SEL_APOLLO2 0x0208
3459#define MUX_ENABLE_APOLLO0 0x0300
3460#define MUX_ENABLE_APOLLO1 0x0304
3461#define MUX_ENABLE_APOLLO2 0x0308
3462#define MUX_STAT_APOLLO0 0x0400
3463#define MUX_STAT_APOLLO1 0x0404
3464#define MUX_STAT_APOLLO2 0x0408
3465#define DIV_APOLLO0 0x0600
3466#define DIV_APOLLO1 0x0604
3467#define DIV_APOLLO_PLL_FREQ_DET 0x0608
3468#define DIV_STAT_APOLLO0 0x0700
3469#define DIV_STAT_APOLLO1 0x0704
3470#define DIV_STAT_APOLLO_PLL_FREQ_DET 0x0708
3471#define ENABLE_ACLK_APOLLO 0x0800
3472#define ENABLE_PCLK_APOLLO 0x0900
3473#define ENABLE_SCLK_APOLLO 0x0a00
3474#define ENABLE_IP_APOLLO0 0x0b00
3475#define ENABLE_IP_APOLLO1 0x0b04
3476#define CLKOUT_CMU_APOLLO 0x0c00
3477#define CLKOUT_CMU_APOLLO_DIV_STAT 0x0c04
3478#define ARMCLK_STOPCTRL 0x1000
3479#define APOLLO_PWR_CTRL 0x1020
3480#define APOLLO_PWR_CTRL2 0x1024
3481#define APOLLO_INTR_SPREAD_ENABLE 0x1080
3482#define APOLLO_INTR_SPREAD_USE_STANDBYWFI 0x1084
3483#define APOLLO_INTR_SPREAD_BLOCKING_DURATION 0x1088
3484
3485static const unsigned long apollo_clk_regs[] __initconst = {
3486 APOLLO_PLL_LOCK,
3487 APOLLO_PLL_CON0,
3488 APOLLO_PLL_CON1,
3489 APOLLO_PLL_FREQ_DET,
3490 MUX_SEL_APOLLO0,
3491 MUX_SEL_APOLLO1,
3492 MUX_SEL_APOLLO2,
3493 MUX_ENABLE_APOLLO0,
3494 MUX_ENABLE_APOLLO1,
3495 MUX_ENABLE_APOLLO2,
3496 DIV_APOLLO0,
3497 DIV_APOLLO1,
3498 DIV_APOLLO_PLL_FREQ_DET,
3499 ENABLE_ACLK_APOLLO,
3500 ENABLE_PCLK_APOLLO,
3501 ENABLE_SCLK_APOLLO,
3502 ENABLE_IP_APOLLO0,
3503 ENABLE_IP_APOLLO1,
3504 CLKOUT_CMU_APOLLO,
3505 CLKOUT_CMU_APOLLO_DIV_STAT,
3506 ARMCLK_STOPCTRL,
3507 APOLLO_PWR_CTRL,
3508 APOLLO_PWR_CTRL2,
3509 APOLLO_INTR_SPREAD_ENABLE,
3510 APOLLO_INTR_SPREAD_USE_STANDBYWFI,
3511 APOLLO_INTR_SPREAD_BLOCKING_DURATION,
3512};
3513
3514/* list of all parent clock list */
3515PNAME(mout_apollo_pll_p) = { "oscclk", "fout_apollo_pll", };
3516PNAME(mout_bus_pll_apollo_user_p) = { "oscclk", "sclk_bus_pll_apollo", };
3517PNAME(mout_apollo_p) = { "mout_apollo_pll",
3518 "mout_bus_pll_apollo_user", };
3519
3520static const struct samsung_pll_clock apollo_pll_clks[] __initconst = {
3521 PLL(pll_35xx, CLK_FOUT_APOLLO_PLL, "fout_apollo_pll", "oscclk",
3522 APOLLO_PLL_LOCK, APOLLO_PLL_CON0, exynos5433_pll_rates),
3523};
3524
3525static const struct samsung_mux_clock apollo_mux_clks[] __initconst = {
3526 /* MUX_SEL_APOLLO0 */
3527 MUX_F(CLK_MOUT_APOLLO_PLL, "mout_apollo_pll", mout_apollo_pll_p,
3528 MUX_SEL_APOLLO0, 0, 1, CLK_SET_RATE_PARENT |
3529 CLK_RECALC_NEW_RATES, 0),
3530
3531 /* MUX_SEL_APOLLO1 */
3532 MUX(CLK_MOUT_BUS_PLL_APOLLO_USER, "mout_bus_pll_apollo_user",
3533 mout_bus_pll_apollo_user_p, MUX_SEL_APOLLO1, 0, 1),
3534
3535 /* MUX_SEL_APOLLO2 */
3536 MUX_F(CLK_MOUT_APOLLO, "mout_apollo", mout_apollo_p, MUX_SEL_APOLLO2,
3537 0, 1, CLK_SET_RATE_PARENT, 0),
3538};
3539
3540static const struct samsung_div_clock apollo_div_clks[] __initconst = {
3541 /* DIV_APOLLO0 */
3542 DIV_F(CLK_DIV_CNTCLK_APOLLO, "div_cntclk_apollo", "div_apollo2",
3543 DIV_APOLLO0, 24, 3, CLK_GET_RATE_NOCACHE,
3544 CLK_DIVIDER_READ_ONLY),
3545 DIV_F(CLK_DIV_PCLK_DBG_APOLLO, "div_pclk_dbg_apollo", "div_apollo2",
3546 DIV_APOLLO0, 20, 3, CLK_GET_RATE_NOCACHE,
3547 CLK_DIVIDER_READ_ONLY),
3548 DIV_F(CLK_DIV_ATCLK_APOLLO, "div_atclk_apollo", "div_apollo2",
3549 DIV_APOLLO0, 16, 3, CLK_GET_RATE_NOCACHE,
3550 CLK_DIVIDER_READ_ONLY),
3551 DIV_F(CLK_DIV_PCLK_APOLLO, "div_pclk_apollo", "div_apollo2",
3552 DIV_APOLLO0, 12, 3, CLK_GET_RATE_NOCACHE,
3553 CLK_DIVIDER_READ_ONLY),
3554 DIV_F(CLK_DIV_ACLK_APOLLO, "div_aclk_apollo", "div_apollo2",
3555 DIV_APOLLO0, 8, 3, CLK_GET_RATE_NOCACHE,
3556 CLK_DIVIDER_READ_ONLY),
3557 DIV_F(CLK_DIV_APOLLO2, "div_apollo2", "div_apollo1",
3558 DIV_APOLLO0, 4, 3, CLK_SET_RATE_PARENT, 0),
3559 DIV_F(CLK_DIV_APOLLO1, "div_apollo1", "mout_apollo",
3560 DIV_APOLLO0, 0, 3, CLK_SET_RATE_PARENT, 0),
3561
3562 /* DIV_APOLLO1 */
3563 DIV_F(CLK_DIV_SCLK_HPM_APOLLO, "div_sclk_hpm_apollo", "mout_apollo",
3564 DIV_APOLLO1, 4, 3, CLK_GET_RATE_NOCACHE,
3565 CLK_DIVIDER_READ_ONLY),
3566 DIV_F(CLK_DIV_APOLLO_PLL, "div_apollo_pll", "mout_apollo",
3567 DIV_APOLLO1, 0, 3, CLK_GET_RATE_NOCACHE,
3568 CLK_DIVIDER_READ_ONLY),
3569};
3570
3571static const struct samsung_gate_clock apollo_gate_clks[] __initconst = {
3572 /* ENABLE_ACLK_APOLLO */
3573 GATE(CLK_ACLK_ASATBSLV_APOLLO_3_CSSYS, "aclk_asatbslv_apollo_3_cssys",
3574 "div_atclk_apollo", ENABLE_ACLK_APOLLO,
3575 6, CLK_IGNORE_UNUSED, 0),
3576 GATE(CLK_ACLK_ASATBSLV_APOLLO_2_CSSYS, "aclk_asatbslv_apollo_2_cssys",
3577 "div_atclk_apollo", ENABLE_ACLK_APOLLO,
3578 5, CLK_IGNORE_UNUSED, 0),
3579 GATE(CLK_ACLK_ASATBSLV_APOLLO_1_CSSYS, "aclk_asatbslv_apollo_1_cssys",
3580 "div_atclk_apollo", ENABLE_ACLK_APOLLO,
3581 4, CLK_IGNORE_UNUSED, 0),
3582 GATE(CLK_ACLK_ASATBSLV_APOLLO_0_CSSYS, "aclk_asatbslv_apollo_0_cssys",
3583 "div_atclk_apollo", ENABLE_ACLK_APOLLO,
3584 3, CLK_IGNORE_UNUSED, 0),
3585 GATE(CLK_ACLK_ASYNCACES_APOLLO_CCI, "aclk_asyncaces_apollo_cci",
3586 "div_aclk_apollo", ENABLE_ACLK_APOLLO,
3587 2, CLK_IGNORE_UNUSED, 0),
3588 GATE(CLK_ACLK_AHB2APB_APOLLOP, "aclk_ahb2apb_apollop",
3589 "div_pclk_apollo", ENABLE_ACLK_APOLLO,
3590 1, CLK_IGNORE_UNUSED, 0),
3591 GATE(CLK_ACLK_APOLLONP_200, "aclk_apollonp_200",
3592 "div_pclk_apollo", ENABLE_ACLK_APOLLO,
3593 0, CLK_IGNORE_UNUSED, 0),
3594
3595 /* ENABLE_PCLK_APOLLO */
3596 GATE(CLK_PCLK_ASAPBMST_CSSYS_APOLLO, "pclk_asapbmst_cssys_apollo",
3597 "div_pclk_dbg_apollo", ENABLE_PCLK_APOLLO,
3598 2, CLK_IGNORE_UNUSED, 0),
3599 GATE(CLK_PCLK_PMU_APOLLO, "pclk_pmu_apollo", "div_pclk_apollo",
3600 ENABLE_PCLK_APOLLO, 1, CLK_IGNORE_UNUSED, 0),
3601 GATE(CLK_PCLK_SYSREG_APOLLO, "pclk_sysreg_apollo",
3602 "div_pclk_apollo", ENABLE_PCLK_APOLLO,
3603 0, CLK_IGNORE_UNUSED, 0),
3604
3605 /* ENABLE_SCLK_APOLLO */
3606 GATE(CLK_CNTCLK_APOLLO, "cntclk_apollo", "div_cntclk_apollo",
3607 ENABLE_SCLK_APOLLO, 3, CLK_IGNORE_UNUSED, 0),
3608 GATE(CLK_SCLK_HPM_APOLLO, "sclk_hpm_apollo", "div_sclk_hpm_apollo",
3609 ENABLE_SCLK_APOLLO, 1, CLK_IGNORE_UNUSED, 0),
3610};
3611
3612#define E5433_APOLLO_DIV0(cntclk, pclk_dbg, atclk, pclk, aclk) \
3613 (((cntclk) << 24) | ((pclk_dbg) << 20) | ((atclk) << 16) | \
3614 ((pclk) << 12) | ((aclk) << 8))
3615
3616#define E5433_APOLLO_DIV1(hpm, copy) \
3617 (((hpm) << 4) | ((copy) << 0))
3618
3619static const struct exynos_cpuclk_cfg_data exynos5433_apolloclk_d[] __initconst = {
3620 { 1300000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
3621 { 1200000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
3622 { 1100000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
3623 { 1000000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
3624 { 900000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
3625 { 800000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
3626 { 700000, E5433_APOLLO_DIV0(3, 7, 7, 7, 2), E5433_APOLLO_DIV1(7, 1), },
3627 { 600000, E5433_APOLLO_DIV0(3, 7, 7, 7, 1), E5433_APOLLO_DIV1(7, 1), },
3628 { 500000, E5433_APOLLO_DIV0(3, 7, 7, 7, 1), E5433_APOLLO_DIV1(7, 1), },
3629 { 400000, E5433_APOLLO_DIV0(3, 7, 7, 7, 1), E5433_APOLLO_DIV1(7, 1), },
3630 { 0 },
3631};
3632
3633static void __init exynos5433_cmu_apollo_init(struct device_node *np)
3634{
3635 void __iomem *reg_base;
3636 struct samsung_clk_provider *ctx;
3637
3638 reg_base = of_iomap(np, 0);
3639 if (!reg_base) {
3640 panic("%s: failed to map registers\n", __func__);
3641 return;
3642 }
3643
3644 ctx = samsung_clk_init(np, reg_base, APOLLO_NR_CLK);
3645 if (!ctx) {
3646 panic("%s: unable to allocate ctx\n", __func__);
3647 return;
3648 }
3649
3650 samsung_clk_register_pll(ctx, apollo_pll_clks,
3651 ARRAY_SIZE(apollo_pll_clks), reg_base);
3652 samsung_clk_register_mux(ctx, apollo_mux_clks,
3653 ARRAY_SIZE(apollo_mux_clks));
3654 samsung_clk_register_div(ctx, apollo_div_clks,
3655 ARRAY_SIZE(apollo_div_clks));
3656 samsung_clk_register_gate(ctx, apollo_gate_clks,
3657 ARRAY_SIZE(apollo_gate_clks));
3658
3659 exynos_register_cpu_clock(ctx, CLK_SCLK_APOLLO, "apolloclk",
3660 mout_apollo_p[0], mout_apollo_p[1], 0x200,
3661 exynos5433_apolloclk_d, ARRAY_SIZE(exynos5433_apolloclk_d),
3662 CLK_CPU_HAS_E5433_REGS_LAYOUT);
3663
3664 samsung_clk_sleep_init(reg_base, apollo_clk_regs,
3665 ARRAY_SIZE(apollo_clk_regs));
3666
3667 samsung_clk_of_add_provider(np, ctx);
3668}
3669CLK_OF_DECLARE(exynos5433_cmu_apollo, "samsung,exynos5433-cmu-apollo",
3670 exynos5433_cmu_apollo_init);
3671
3672/*
3673 * Register offset definitions for CMU_ATLAS
3674 */
3675#define ATLAS_PLL_LOCK 0x0000
3676#define ATLAS_PLL_CON0 0x0100
3677#define ATLAS_PLL_CON1 0x0104
3678#define ATLAS_PLL_FREQ_DET 0x010c
3679#define MUX_SEL_ATLAS0 0x0200
3680#define MUX_SEL_ATLAS1 0x0204
3681#define MUX_SEL_ATLAS2 0x0208
3682#define MUX_ENABLE_ATLAS0 0x0300
3683#define MUX_ENABLE_ATLAS1 0x0304
3684#define MUX_ENABLE_ATLAS2 0x0308
3685#define MUX_STAT_ATLAS0 0x0400
3686#define MUX_STAT_ATLAS1 0x0404
3687#define MUX_STAT_ATLAS2 0x0408
3688#define DIV_ATLAS0 0x0600
3689#define DIV_ATLAS1 0x0604
3690#define DIV_ATLAS_PLL_FREQ_DET 0x0608
3691#define DIV_STAT_ATLAS0 0x0700
3692#define DIV_STAT_ATLAS1 0x0704
3693#define DIV_STAT_ATLAS_PLL_FREQ_DET 0x0708
3694#define ENABLE_ACLK_ATLAS 0x0800
3695#define ENABLE_PCLK_ATLAS 0x0900
3696#define ENABLE_SCLK_ATLAS 0x0a00
3697#define ENABLE_IP_ATLAS0 0x0b00
3698#define ENABLE_IP_ATLAS1 0x0b04
3699#define CLKOUT_CMU_ATLAS 0x0c00
3700#define CLKOUT_CMU_ATLAS_DIV_STAT 0x0c04
3701#define ARMCLK_STOPCTRL 0x1000
3702#define ATLAS_PWR_CTRL 0x1020
3703#define ATLAS_PWR_CTRL2 0x1024
3704#define ATLAS_INTR_SPREAD_ENABLE 0x1080
3705#define ATLAS_INTR_SPREAD_USE_STANDBYWFI 0x1084
3706#define ATLAS_INTR_SPREAD_BLOCKING_DURATION 0x1088
3707
3708static const unsigned long atlas_clk_regs[] __initconst = {
3709 ATLAS_PLL_LOCK,
3710 ATLAS_PLL_CON0,
3711 ATLAS_PLL_CON1,
3712 ATLAS_PLL_FREQ_DET,
3713 MUX_SEL_ATLAS0,
3714 MUX_SEL_ATLAS1,
3715 MUX_SEL_ATLAS2,
3716 MUX_ENABLE_ATLAS0,
3717 MUX_ENABLE_ATLAS1,
3718 MUX_ENABLE_ATLAS2,
3719 DIV_ATLAS0,
3720 DIV_ATLAS1,
3721 DIV_ATLAS_PLL_FREQ_DET,
3722 ENABLE_ACLK_ATLAS,
3723 ENABLE_PCLK_ATLAS,
3724 ENABLE_SCLK_ATLAS,
3725 ENABLE_IP_ATLAS0,
3726 ENABLE_IP_ATLAS1,
3727 CLKOUT_CMU_ATLAS,
3728 CLKOUT_CMU_ATLAS_DIV_STAT,
3729 ARMCLK_STOPCTRL,
3730 ATLAS_PWR_CTRL,
3731 ATLAS_PWR_CTRL2,
3732 ATLAS_INTR_SPREAD_ENABLE,
3733 ATLAS_INTR_SPREAD_USE_STANDBYWFI,
3734 ATLAS_INTR_SPREAD_BLOCKING_DURATION,
3735};
3736
3737/* list of all parent clock list */
3738PNAME(mout_atlas_pll_p) = { "oscclk", "fout_atlas_pll", };
3739PNAME(mout_bus_pll_atlas_user_p) = { "oscclk", "sclk_bus_pll_atlas", };
3740PNAME(mout_atlas_p) = { "mout_atlas_pll",
3741 "mout_bus_pll_atlas_user", };
3742
3743static const struct samsung_pll_clock atlas_pll_clks[] __initconst = {
3744 PLL(pll_35xx, CLK_FOUT_ATLAS_PLL, "fout_atlas_pll", "oscclk",
3745 ATLAS_PLL_LOCK, ATLAS_PLL_CON0, exynos5433_pll_rates),
3746};
3747
3748static const struct samsung_mux_clock atlas_mux_clks[] __initconst = {
3749 /* MUX_SEL_ATLAS0 */
3750 MUX_F(CLK_MOUT_ATLAS_PLL, "mout_atlas_pll", mout_atlas_pll_p,
3751 MUX_SEL_ATLAS0, 0, 1, CLK_SET_RATE_PARENT |
3752 CLK_RECALC_NEW_RATES, 0),
3753
3754 /* MUX_SEL_ATLAS1 */
3755 MUX(CLK_MOUT_BUS_PLL_ATLAS_USER, "mout_bus_pll_atlas_user",
3756 mout_bus_pll_atlas_user_p, MUX_SEL_ATLAS1, 0, 1),
3757
3758 /* MUX_SEL_ATLAS2 */
3759 MUX_F(CLK_MOUT_ATLAS, "mout_atlas", mout_atlas_p, MUX_SEL_ATLAS2,
3760 0, 1, CLK_SET_RATE_PARENT, 0),
3761};
3762
3763static const struct samsung_div_clock atlas_div_clks[] __initconst = {
3764 /* DIV_ATLAS0 */
3765 DIV_F(CLK_DIV_CNTCLK_ATLAS, "div_cntclk_atlas", "div_atlas2",
3766 DIV_ATLAS0, 24, 3, CLK_GET_RATE_NOCACHE,
3767 CLK_DIVIDER_READ_ONLY),
3768 DIV_F(CLK_DIV_PCLK_DBG_ATLAS, "div_pclk_dbg_atlas", "div_atclk_atlas",
3769 DIV_ATLAS0, 20, 3, CLK_GET_RATE_NOCACHE,
3770 CLK_DIVIDER_READ_ONLY),
3771 DIV_F(CLK_DIV_ATCLK_ATLASO, "div_atclk_atlas", "div_atlas2",
3772 DIV_ATLAS0, 16, 3, CLK_GET_RATE_NOCACHE,
3773 CLK_DIVIDER_READ_ONLY),
3774 DIV_F(CLK_DIV_PCLK_ATLAS, "div_pclk_atlas", "div_atlas2",
3775 DIV_ATLAS0, 12, 3, CLK_GET_RATE_NOCACHE,
3776 CLK_DIVIDER_READ_ONLY),
3777 DIV_F(CLK_DIV_ACLK_ATLAS, "div_aclk_atlas", "div_atlas2",
3778 DIV_ATLAS0, 8, 3, CLK_GET_RATE_NOCACHE,
3779 CLK_DIVIDER_READ_ONLY),
3780 DIV_F(CLK_DIV_ATLAS2, "div_atlas2", "div_atlas1",
3781 DIV_ATLAS0, 4, 3, CLK_SET_RATE_PARENT, 0),
3782 DIV_F(CLK_DIV_ATLAS1, "div_atlas1", "mout_atlas",
3783 DIV_ATLAS0, 0, 3, CLK_SET_RATE_PARENT, 0),
3784
3785 /* DIV_ATLAS1 */
3786 DIV_F(CLK_DIV_SCLK_HPM_ATLAS, "div_sclk_hpm_atlas", "mout_atlas",
3787 DIV_ATLAS1, 4, 3, CLK_GET_RATE_NOCACHE,
3788 CLK_DIVIDER_READ_ONLY),
3789 DIV_F(CLK_DIV_ATLAS_PLL, "div_atlas_pll", "mout_atlas",
3790 DIV_ATLAS1, 0, 3, CLK_GET_RATE_NOCACHE,
3791 CLK_DIVIDER_READ_ONLY),
3792};
3793
3794static const struct samsung_gate_clock atlas_gate_clks[] __initconst = {
3795 /* ENABLE_ACLK_ATLAS */
3796 GATE(CLK_ACLK_ATB_AUD_CSSYS, "aclk_atb_aud_cssys",
3797 "div_atclk_atlas", ENABLE_ACLK_ATLAS,
3798 9, CLK_IGNORE_UNUSED, 0),
3799 GATE(CLK_ACLK_ATB_APOLLO3_CSSYS, "aclk_atb_apollo3_cssys",
3800 "div_atclk_atlas", ENABLE_ACLK_ATLAS,
3801 8, CLK_IGNORE_UNUSED, 0),
3802 GATE(CLK_ACLK_ATB_APOLLO2_CSSYS, "aclk_atb_apollo2_cssys",
3803 "div_atclk_atlas", ENABLE_ACLK_ATLAS,
3804 7, CLK_IGNORE_UNUSED, 0),
3805 GATE(CLK_ACLK_ATB_APOLLO1_CSSYS, "aclk_atb_apollo1_cssys",
3806 "div_atclk_atlas", ENABLE_ACLK_ATLAS,
3807 6, CLK_IGNORE_UNUSED, 0),
3808 GATE(CLK_ACLK_ATB_APOLLO0_CSSYS, "aclk_atb_apollo0_cssys",
3809 "div_atclk_atlas", ENABLE_ACLK_ATLAS,
3810 5, CLK_IGNORE_UNUSED, 0),
3811 GATE(CLK_ACLK_ASYNCAHBS_CSSYS_SSS, "aclk_asyncahbs_cssys_sss",
3812 "div_atclk_atlas", ENABLE_ACLK_ATLAS,
3813 4, CLK_IGNORE_UNUSED, 0),
3814 GATE(CLK_ACLK_ASYNCAXIS_CSSYS_CCIX, "aclk_asyncaxis_cssys_ccix",
3815 "div_pclk_dbg_atlas", ENABLE_ACLK_ATLAS,
3816 3, CLK_IGNORE_UNUSED, 0),
3817 GATE(CLK_ACLK_ASYNCACES_ATLAS_CCI, "aclk_asyncaces_atlas_cci",
3818 "div_aclk_atlas", ENABLE_ACLK_ATLAS,
3819 2, CLK_IGNORE_UNUSED, 0),
3820 GATE(CLK_ACLK_AHB2APB_ATLASP, "aclk_ahb2apb_atlasp", "div_pclk_atlas",
3821 ENABLE_ACLK_ATLAS, 1, CLK_IGNORE_UNUSED, 0),
3822 GATE(CLK_ACLK_ATLASNP_200, "aclk_atlasnp_200", "div_pclk_atlas",
3823 ENABLE_ACLK_ATLAS, 0, CLK_IGNORE_UNUSED, 0),
3824
3825 /* ENABLE_PCLK_ATLAS */
3826 GATE(CLK_PCLK_ASYNCAPB_AUD_CSSYS, "pclk_asyncapb_aud_cssys",
3827 "div_pclk_dbg_atlas", ENABLE_PCLK_ATLAS,
3828 5, CLK_IGNORE_UNUSED, 0),
3829 GATE(CLK_PCLK_ASYNCAPB_ISP_CSSYS, "pclk_asyncapb_isp_cssys",
3830 "div_pclk_dbg_atlas", ENABLE_PCLK_ATLAS,
3831 4, CLK_IGNORE_UNUSED, 0),
3832 GATE(CLK_PCLK_ASYNCAPB_APOLLO_CSSYS, "pclk_asyncapb_apollo_cssys",
3833 "div_pclk_dbg_atlas", ENABLE_PCLK_ATLAS,
3834 3, CLK_IGNORE_UNUSED, 0),
3835 GATE(CLK_PCLK_PMU_ATLAS, "pclk_pmu_atlas", "div_pclk_atlas",
3836 ENABLE_PCLK_ATLAS, 2, CLK_IGNORE_UNUSED, 0),
3837 GATE(CLK_PCLK_SYSREG_ATLAS, "pclk_sysreg_atlas", "div_pclk_atlas",
3838 ENABLE_PCLK_ATLAS, 1, CLK_IGNORE_UNUSED, 0),
3839 GATE(CLK_PCLK_SECJTAG, "pclk_secjtag", "div_pclk_dbg_atlas",
3840 ENABLE_PCLK_ATLAS, 0, CLK_IGNORE_UNUSED, 0),
3841
3842 /* ENABLE_SCLK_ATLAS */
3843 GATE(CLK_CNTCLK_ATLAS, "cntclk_atlas", "div_cntclk_atlas",
3844 ENABLE_SCLK_ATLAS, 10, CLK_IGNORE_UNUSED, 0),
3845 GATE(CLK_SCLK_HPM_ATLAS, "sclk_hpm_atlas", "div_sclk_hpm_atlas",
3846 ENABLE_SCLK_ATLAS, 7, CLK_IGNORE_UNUSED, 0),
3847 GATE(CLK_TRACECLK, "traceclk", "div_atclk_atlas",
3848 ENABLE_SCLK_ATLAS, 6, CLK_IGNORE_UNUSED, 0),
3849 GATE(CLK_CTMCLK, "ctmclk", "div_atclk_atlas",
3850 ENABLE_SCLK_ATLAS, 5, CLK_IGNORE_UNUSED, 0),
3851 GATE(CLK_HCLK_CSSYS, "hclk_cssys", "div_atclk_atlas",
3852 ENABLE_SCLK_ATLAS, 4, CLK_IGNORE_UNUSED, 0),
3853 GATE(CLK_PCLK_DBG_CSSYS, "pclk_dbg_cssys", "div_pclk_dbg_atlas",
3854 ENABLE_SCLK_ATLAS, 3, CLK_IGNORE_UNUSED, 0),
3855 GATE(CLK_PCLK_DBG, "pclk_dbg", "div_pclk_dbg_atlas",
3856 ENABLE_SCLK_ATLAS, 2, CLK_IGNORE_UNUSED, 0),
3857 GATE(CLK_ATCLK, "atclk", "div_atclk_atlas",
3858 ENABLE_SCLK_ATLAS, 1, CLK_IGNORE_UNUSED, 0),
3859};
3860
3861#define E5433_ATLAS_DIV0(cntclk, pclk_dbg, atclk, pclk, aclk) \
3862 (((cntclk) << 24) | ((pclk_dbg) << 20) | ((atclk) << 16) | \
3863 ((pclk) << 12) | ((aclk) << 8))
3864
3865#define E5433_ATLAS_DIV1(hpm, copy) \
3866 (((hpm) << 4) | ((copy) << 0))
3867
3868static const struct exynos_cpuclk_cfg_data exynos5433_atlasclk_d[] __initconst = {
3869 { 1900000, E5433_ATLAS_DIV0(7, 7, 7, 7, 4), E5433_ATLAS_DIV1(7, 1), },
3870 { 1800000, E5433_ATLAS_DIV0(7, 7, 7, 7, 4), E5433_ATLAS_DIV1(7, 1), },
3871 { 1700000, E5433_ATLAS_DIV0(7, 7, 7, 7, 4), E5433_ATLAS_DIV1(7, 1), },
3872 { 1600000, E5433_ATLAS_DIV0(7, 7, 7, 7, 4), E5433_ATLAS_DIV1(7, 1), },
3873 { 1500000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
3874 { 1400000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
3875 { 1300000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
3876 { 1200000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
3877 { 1100000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
3878 { 1000000, E5433_ATLAS_DIV0(7, 7, 7, 7, 3), E5433_ATLAS_DIV1(7, 1), },
3879 { 900000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
3880 { 800000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
3881 { 700000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
3882 { 600000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
3883 { 500000, E5433_ATLAS_DIV0(7, 7, 7, 7, 2), E5433_ATLAS_DIV1(7, 1), },
3884 { 0 },
3885};
3886
3887static void __init exynos5433_cmu_atlas_init(struct device_node *np)
3888{
3889 void __iomem *reg_base;
3890 struct samsung_clk_provider *ctx;
3891
3892 reg_base = of_iomap(np, 0);
3893 if (!reg_base) {
3894 panic("%s: failed to map registers\n", __func__);
3895 return;
3896 }
3897
3898 ctx = samsung_clk_init(np, reg_base, ATLAS_NR_CLK);
3899 if (!ctx) {
3900 panic("%s: unable to allocate ctx\n", __func__);
3901 return;
3902 }
3903
3904 samsung_clk_register_pll(ctx, atlas_pll_clks,
3905 ARRAY_SIZE(atlas_pll_clks), reg_base);
3906 samsung_clk_register_mux(ctx, atlas_mux_clks,
3907 ARRAY_SIZE(atlas_mux_clks));
3908 samsung_clk_register_div(ctx, atlas_div_clks,
3909 ARRAY_SIZE(atlas_div_clks));
3910 samsung_clk_register_gate(ctx, atlas_gate_clks,
3911 ARRAY_SIZE(atlas_gate_clks));
3912
3913 exynos_register_cpu_clock(ctx, CLK_SCLK_ATLAS, "atlasclk",
3914 mout_atlas_p[0], mout_atlas_p[1], 0x200,
3915 exynos5433_atlasclk_d, ARRAY_SIZE(exynos5433_atlasclk_d),
3916 CLK_CPU_HAS_E5433_REGS_LAYOUT);
3917
3918 samsung_clk_sleep_init(reg_base, atlas_clk_regs,
3919 ARRAY_SIZE(atlas_clk_regs));
3920
3921 samsung_clk_of_add_provider(np, ctx);
3922}
3923CLK_OF_DECLARE(exynos5433_cmu_atlas, "samsung,exynos5433-cmu-atlas",
3924 exynos5433_cmu_atlas_init);
3925
3926/*
3927 * Register offset definitions for CMU_MSCL
3928 */
3929#define MUX_SEL_MSCL0 0x0200
3930#define MUX_SEL_MSCL1 0x0204
3931#define MUX_ENABLE_MSCL0 0x0300
3932#define MUX_ENABLE_MSCL1 0x0304
3933#define MUX_STAT_MSCL0 0x0400
3934#define MUX_STAT_MSCL1 0x0404
3935#define DIV_MSCL 0x0600
3936#define DIV_STAT_MSCL 0x0700
3937#define ENABLE_ACLK_MSCL 0x0800
3938#define ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER0 0x0804
3939#define ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER1 0x0808
3940#define ENABLE_ACLK_MSCL_SECURE_SMMU_JPEG 0x080c
3941#define ENABLE_PCLK_MSCL 0x0900
3942#define ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER0 0x0904
3943#define ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER1 0x0908
3944#define ENABLE_PCLK_MSCL_SECURE_SMMU_JPEG 0x090c
3945#define ENABLE_SCLK_MSCL 0x0a00
3946#define ENABLE_IP_MSCL0 0x0b00
3947#define ENABLE_IP_MSCL1 0x0b04
3948#define ENABLE_IP_MSCL_SECURE_SMMU_M2MSCALER0 0x0b08
3949#define ENABLE_IP_MSCL_SECURE_SMMU_M2MSCALER1 0x0b0c
3950#define ENABLE_IP_MSCL_SECURE_SMMU_JPEG 0x0b10
3951
3952static const unsigned long mscl_clk_regs[] __initconst = {
3953 MUX_SEL_MSCL0,
3954 MUX_SEL_MSCL1,
3955 MUX_ENABLE_MSCL0,
3956 MUX_ENABLE_MSCL1,
3957 DIV_MSCL,
3958 ENABLE_ACLK_MSCL,
3959 ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER0,
3960 ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER1,
3961 ENABLE_ACLK_MSCL_SECURE_SMMU_JPEG,
3962 ENABLE_PCLK_MSCL,
3963 ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER0,
3964 ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER1,
3965 ENABLE_PCLK_MSCL_SECURE_SMMU_JPEG,
3966 ENABLE_SCLK_MSCL,
3967 ENABLE_IP_MSCL0,
3968 ENABLE_IP_MSCL1,
3969 ENABLE_IP_MSCL_SECURE_SMMU_M2MSCALER0,
3970 ENABLE_IP_MSCL_SECURE_SMMU_M2MSCALER1,
3971 ENABLE_IP_MSCL_SECURE_SMMU_JPEG,
3972};
3973
3974/* list of all parent clock list */
3975PNAME(mout_sclk_jpeg_user_p) = { "oscclk", "sclk_jpeg_mscl", };
3976PNAME(mout_aclk_mscl_400_user_p) = { "oscclk", "aclk_mscl_400", };
3977PNAME(mout_sclk_jpeg_p) = { "mout_sclk_jpeg_user",
3978 "mout_aclk_mscl_400_user", };
3979
3980static const struct samsung_mux_clock mscl_mux_clks[] __initconst = {
3981 /* MUX_SEL_MSCL0 */
3982 MUX(CLK_MOUT_SCLK_JPEG_USER, "mout_sclk_jpeg_user",
3983 mout_sclk_jpeg_user_p, MUX_SEL_MSCL0, 4, 1),
3984 MUX(CLK_MOUT_ACLK_MSCL_400_USER, "mout_aclk_mscl_400_user",
3985 mout_aclk_mscl_400_user_p, MUX_SEL_MSCL0, 0, 1),
3986
3987 /* MUX_SEL_MSCL1 */
3988 MUX(CLK_MOUT_SCLK_JPEG, "mout_sclk_jpeg", mout_sclk_jpeg_p,
3989 MUX_SEL_MSCL1, 0, 1),
3990};
3991
3992static const struct samsung_div_clock mscl_div_clks[] __initconst = {
3993 /* DIV_MSCL */
3994 DIV(CLK_DIV_PCLK_MSCL, "div_pclk_mscl", "mout_aclk_mscl_400_user",
3995 DIV_MSCL, 0, 3),
3996};
3997
3998static const struct samsung_gate_clock mscl_gate_clks[] __initconst = {
3999 /* ENABLE_ACLK_MSCL */
4000 GATE(CLK_ACLK_BTS_JPEG, "aclk_bts_jpeg", "mout_aclk_mscl_400_user",
4001 ENABLE_ACLK_MSCL, 9, 0, 0),
4002 GATE(CLK_ACLK_BTS_M2MSCALER1, "aclk_bts_m2mscaler1",
4003 "mout_aclk_mscl_400_user", ENABLE_ACLK_MSCL, 8, 0, 0),
4004 GATE(CLK_ACLK_BTS_M2MSCALER0, "aclk_bts_m2mscaler0",
4005 "mout_aclk_mscl_400_user", ENABLE_ACLK_MSCL, 7, 0, 0),
4006 GATE(CLK_ACLK_AHB2APB_MSCL0P, "aclk_abh2apb_mscl0p", "div_pclk_mscl",
4007 ENABLE_ACLK_MSCL, 6, CLK_IGNORE_UNUSED, 0),
4008 GATE(CLK_ACLK_XIU_MSCLX, "aclk_xiu_msclx", "mout_aclk_mscl_400_user",
4009 ENABLE_ACLK_MSCL, 5, CLK_IGNORE_UNUSED, 0),
4010 GATE(CLK_ACLK_MSCLNP_100, "aclk_msclnp_100", "div_pclk_mscl",
4011 ENABLE_ACLK_MSCL, 4, CLK_IGNORE_UNUSED, 0),
4012 GATE(CLK_ACLK_MSCLND_400, "aclk_msclnd_400", "mout_aclk_mscl_400_user",
4013 ENABLE_ACLK_MSCL, 3, CLK_IGNORE_UNUSED, 0),
4014 GATE(CLK_ACLK_JPEG, "aclk_jpeg", "mout_aclk_mscl_400_user",
4015 ENABLE_ACLK_MSCL, 2, 0, 0),
4016 GATE(CLK_ACLK_M2MSCALER1, "aclk_m2mscaler1", "mout_aclk_mscl_400_user",
4017 ENABLE_ACLK_MSCL, 1, 0, 0),
4018 GATE(CLK_ACLK_M2MSCALER0, "aclk_m2mscaler0", "mout_aclk_mscl_400_user",
4019 ENABLE_ACLK_MSCL, 0, 0, 0),
4020
4021 /* ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER0 */
4022 GATE(CLK_ACLK_SMMU_M2MSCALER0, "aclk_smmu_m2mscaler0",
4023 "mout_aclk_mscl_400_user",
4024 ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER0,
4025 0, CLK_IGNORE_UNUSED, 0),
4026
4027 /* ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER1 */
4028 GATE(CLK_ACLK_SMMU_M2MSCALER1, "aclk_smmu_m2mscaler1",
4029 "mout_aclk_mscl_400_user",
4030 ENABLE_ACLK_MSCL_SECURE_SMMU_M2MSCALER1,
4031 0, CLK_IGNORE_UNUSED, 0),
4032
4033 /* ENABLE_ACLK_MSCL_SECURE_SMMU_JPEG */
4034 GATE(CLK_ACLK_SMMU_JPEG, "aclk_smmu_jpeg", "mout_aclk_mscl_400_user",
4035 ENABLE_ACLK_MSCL_SECURE_SMMU_JPEG,
4036 0, CLK_IGNORE_UNUSED, 0),
4037
4038 /* ENABLE_PCLK_MSCL */
4039 GATE(CLK_PCLK_BTS_JPEG, "pclk_bts_jpeg", "div_pclk_mscl",
4040 ENABLE_PCLK_MSCL, 7, 0, 0),
4041 GATE(CLK_PCLK_BTS_M2MSCALER1, "pclk_bts_m2mscaler1", "div_pclk_mscl",
4042 ENABLE_PCLK_MSCL, 6, 0, 0),
4043 GATE(CLK_PCLK_BTS_M2MSCALER0, "pclk_bts_m2mscaler0", "div_pclk_mscl",
4044 ENABLE_PCLK_MSCL, 5, 0, 0),
4045 GATE(CLK_PCLK_PMU_MSCL, "pclk_pmu_mscl", "div_pclk_mscl",
4046 ENABLE_PCLK_MSCL, 4, CLK_IGNORE_UNUSED, 0),
4047 GATE(CLK_PCLK_SYSREG_MSCL, "pclk_sysreg_mscl", "div_pclk_mscl",
4048 ENABLE_PCLK_MSCL, 3, CLK_IGNORE_UNUSED, 0),
4049 GATE(CLK_PCLK_JPEG, "pclk_jpeg", "div_pclk_mscl",
4050 ENABLE_PCLK_MSCL, 2, 0, 0),
4051 GATE(CLK_PCLK_M2MSCALER1, "pclk_m2mscaler1", "div_pclk_mscl",
4052 ENABLE_PCLK_MSCL, 1, 0, 0),
4053 GATE(CLK_PCLK_M2MSCALER0, "pclk_m2mscaler0", "div_pclk_mscl",
4054 ENABLE_PCLK_MSCL, 0, 0, 0),
4055
4056 /* ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER0 */
4057 GATE(CLK_PCLK_SMMU_M2MSCALER0, "pclk_smmu_m2mscaler0", "div_pclk_mscl",
4058 ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER0,
4059 0, CLK_IGNORE_UNUSED, 0),
4060
4061 /* ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER1 */
4062 GATE(CLK_PCLK_SMMU_M2MSCALER1, "pclk_smmu_m2mscaler1", "div_pclk_mscl",
4063 ENABLE_PCLK_MSCL_SECURE_SMMU_M2MSCALER1,
4064 0, CLK_IGNORE_UNUSED, 0),
4065
4066 /* ENABLE_PCLK_MSCL_SECURE_SMMU_JPEG */
4067 GATE(CLK_PCLK_SMMU_JPEG, "pclk_smmu_jpeg", "div_pclk_mscl",
4068 ENABLE_PCLK_MSCL_SECURE_SMMU_JPEG,
4069 0, CLK_IGNORE_UNUSED, 0),
4070
4071 /* ENABLE_SCLK_MSCL */
4072 GATE(CLK_SCLK_JPEG, "sclk_jpeg", "mout_sclk_jpeg", ENABLE_SCLK_MSCL, 0,
4073 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0),
4074};
4075
4076static const struct samsung_cmu_info mscl_cmu_info __initconst = {
4077 .mux_clks = mscl_mux_clks,
4078 .nr_mux_clks = ARRAY_SIZE(mscl_mux_clks),
4079 .div_clks = mscl_div_clks,
4080 .nr_div_clks = ARRAY_SIZE(mscl_div_clks),
4081 .gate_clks = mscl_gate_clks,
4082 .nr_gate_clks = ARRAY_SIZE(mscl_gate_clks),
4083 .nr_clk_ids = MSCL_NR_CLK,
4084 .clk_regs = mscl_clk_regs,
4085 .nr_clk_regs = ARRAY_SIZE(mscl_clk_regs),
4086};
4087
4088static void __init exynos5433_cmu_mscl_init(struct device_node *np)
4089{
4090 samsung_cmu_register_one(np, &mscl_cmu_info);
4091}
4092CLK_OF_DECLARE(exynos5433_cmu_mscl, "samsung,exynos5433-cmu-mscl",
4093 exynos5433_cmu_mscl_init);
4094
4095/*
4096 * Register offset definitions for CMU_MFC
4097 */
4098#define MUX_SEL_MFC 0x0200
4099#define MUX_ENABLE_MFC 0x0300
4100#define MUX_STAT_MFC 0x0400
4101#define DIV_MFC 0x0600
4102#define DIV_STAT_MFC 0x0700
4103#define ENABLE_ACLK_MFC 0x0800
4104#define ENABLE_ACLK_MFC_SECURE_SMMU_MFC 0x0804
4105#define ENABLE_PCLK_MFC 0x0900
4106#define ENABLE_PCLK_MFC_SECURE_SMMU_MFC 0x0904
4107#define ENABLE_IP_MFC0 0x0b00
4108#define ENABLE_IP_MFC1 0x0b04
4109#define ENABLE_IP_MFC_SECURE_SMMU_MFC 0x0b08
4110
4111static const unsigned long mfc_clk_regs[] __initconst = {
4112 MUX_SEL_MFC,
4113 MUX_ENABLE_MFC,
4114 DIV_MFC,
4115 ENABLE_ACLK_MFC,
4116 ENABLE_ACLK_MFC_SECURE_SMMU_MFC,
4117 ENABLE_PCLK_MFC,
4118 ENABLE_PCLK_MFC_SECURE_SMMU_MFC,
4119 ENABLE_IP_MFC0,
4120 ENABLE_IP_MFC1,
4121 ENABLE_IP_MFC_SECURE_SMMU_MFC,
4122};
4123
4124PNAME(mout_aclk_mfc_400_user_p) = { "oscclk", "aclk_mfc_400", };
4125
4126static const struct samsung_mux_clock mfc_mux_clks[] __initconst = {
4127 /* MUX_SEL_MFC */
4128 MUX(CLK_MOUT_ACLK_MFC_400_USER, "mout_aclk_mfc_400_user",
4129 mout_aclk_mfc_400_user_p, MUX_SEL_MFC, 0, 0),
4130};
4131
4132static const struct samsung_div_clock mfc_div_clks[] __initconst = {
4133 /* DIV_MFC */
4134 DIV(CLK_DIV_PCLK_MFC, "div_pclk_mfc", "mout_aclk_mfc_400_user",
4135 DIV_MFC, 0, 2),
4136};
4137
4138static const struct samsung_gate_clock mfc_gate_clks[] __initconst = {
4139 /* ENABLE_ACLK_MFC */
4140 GATE(CLK_ACLK_BTS_MFC_1, "aclk_bts_mfc_1", "mout_aclk_mfc_400_user",
4141 ENABLE_ACLK_MFC, 6, 0, 0),
4142 GATE(CLK_ACLK_BTS_MFC_0, "aclk_bts_mfc_0", "mout_aclk_mfc_400_user",
4143 ENABLE_ACLK_MFC, 5, 0, 0),
4144 GATE(CLK_ACLK_AHB2APB_MFCP, "aclk_ahb2apb_mfcp", "div_pclk_mfc",
4145 ENABLE_ACLK_MFC, 4, CLK_IGNORE_UNUSED, 0),
4146 GATE(CLK_ACLK_XIU_MFCX, "aclk_xiu_mfcx", "mout_aclk_mfc_400_user",
4147 ENABLE_ACLK_MFC, 3, CLK_IGNORE_UNUSED, 0),
4148 GATE(CLK_ACLK_MFCNP_100, "aclk_mfcnp_100", "div_pclk_mfc",
4149 ENABLE_ACLK_MFC, 2, CLK_IGNORE_UNUSED, 0),
4150 GATE(CLK_ACLK_MFCND_400, "aclk_mfcnd_400", "mout_aclk_mfc_400_user",
4151 ENABLE_ACLK_MFC, 1, CLK_IGNORE_UNUSED, 0),
4152 GATE(CLK_ACLK_MFC, "aclk_mfc", "mout_aclk_mfc_400_user",
4153 ENABLE_ACLK_MFC, 0, 0, 0),
4154
4155 /* ENABLE_ACLK_MFC_SECURE_SMMU_MFC */
4156 GATE(CLK_ACLK_SMMU_MFC_1, "aclk_smmu_mfc_1", "mout_aclk_mfc_400_user",
4157 ENABLE_ACLK_MFC_SECURE_SMMU_MFC,
4158 1, CLK_IGNORE_UNUSED, 0),
4159 GATE(CLK_ACLK_SMMU_MFC_0, "aclk_smmu_mfc_0", "mout_aclk_mfc_400_user",
4160 ENABLE_ACLK_MFC_SECURE_SMMU_MFC,
4161 0, CLK_IGNORE_UNUSED, 0),
4162
4163 /* ENABLE_PCLK_MFC */
4164 GATE(CLK_PCLK_BTS_MFC_1, "pclk_bts_mfc_1", "div_pclk_mfc",
4165 ENABLE_PCLK_MFC, 4, 0, 0),
4166 GATE(CLK_PCLK_BTS_MFC_0, "pclk_bts_mfc_0", "div_pclk_mfc",
4167 ENABLE_PCLK_MFC, 3, 0, 0),
4168 GATE(CLK_PCLK_PMU_MFC, "pclk_pmu_mfc", "div_pclk_mfc",
4169 ENABLE_PCLK_MFC, 2, CLK_IGNORE_UNUSED, 0),
4170 GATE(CLK_PCLK_SYSREG_MFC, "pclk_sysreg_mfc", "div_pclk_mfc",
4171 ENABLE_PCLK_MFC, 1, CLK_IGNORE_UNUSED, 0),
4172 GATE(CLK_PCLK_MFC, "pclk_mfc", "div_pclk_mfc",
4173 ENABLE_PCLK_MFC, 4, CLK_IGNORE_UNUSED, 0),
4174
4175 /* ENABLE_PCLK_MFC_SECURE_SMMU_MFC */
4176 GATE(CLK_PCLK_SMMU_MFC_1, "pclk_smmu_mfc_1", "div_pclk_mfc",
4177 ENABLE_PCLK_MFC_SECURE_SMMU_MFC,
4178 1, CLK_IGNORE_UNUSED, 0),
4179 GATE(CLK_PCLK_SMMU_MFC_0, "pclk_smmu_mfc_0", "div_pclk_mfc",
4180 ENABLE_PCLK_MFC_SECURE_SMMU_MFC,
4181 0, CLK_IGNORE_UNUSED, 0),
4182};
4183
4184static const struct samsung_cmu_info mfc_cmu_info __initconst = {
4185 .mux_clks = mfc_mux_clks,
4186 .nr_mux_clks = ARRAY_SIZE(mfc_mux_clks),
4187 .div_clks = mfc_div_clks,
4188 .nr_div_clks = ARRAY_SIZE(mfc_div_clks),
4189 .gate_clks = mfc_gate_clks,
4190 .nr_gate_clks = ARRAY_SIZE(mfc_gate_clks),
4191 .nr_clk_ids = MFC_NR_CLK,
4192 .clk_regs = mfc_clk_regs,
4193 .nr_clk_regs = ARRAY_SIZE(mfc_clk_regs),
4194};
4195
4196static void __init exynos5433_cmu_mfc_init(struct device_node *np)
4197{
4198 samsung_cmu_register_one(np, &mfc_cmu_info);
4199}
4200CLK_OF_DECLARE(exynos5433_cmu_mfc, "samsung,exynos5433-cmu-mfc",
4201 exynos5433_cmu_mfc_init);
4202
4203/*
4204 * Register offset definitions for CMU_HEVC
4205 */
4206#define MUX_SEL_HEVC 0x0200
4207#define MUX_ENABLE_HEVC 0x0300
4208#define MUX_STAT_HEVC 0x0400
4209#define DIV_HEVC 0x0600
4210#define DIV_STAT_HEVC 0x0700
4211#define ENABLE_ACLK_HEVC 0x0800
4212#define ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC 0x0804
4213#define ENABLE_PCLK_HEVC 0x0900
4214#define ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC 0x0904
4215#define ENABLE_IP_HEVC0 0x0b00
4216#define ENABLE_IP_HEVC1 0x0b04
4217#define ENABLE_IP_HEVC_SECURE_SMMU_HEVC 0x0b08
4218
4219static const unsigned long hevc_clk_regs[] __initconst = {
4220 MUX_SEL_HEVC,
4221 MUX_ENABLE_HEVC,
4222 DIV_HEVC,
4223 ENABLE_ACLK_HEVC,
4224 ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC,
4225 ENABLE_PCLK_HEVC,
4226 ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC,
4227 ENABLE_IP_HEVC0,
4228 ENABLE_IP_HEVC1,
4229 ENABLE_IP_HEVC_SECURE_SMMU_HEVC,
4230};
4231
4232PNAME(mout_aclk_hevc_400_user_p) = { "oscclk", "aclk_hevc_400", };
4233
4234static const struct samsung_mux_clock hevc_mux_clks[] __initconst = {
4235 /* MUX_SEL_HEVC */
4236 MUX(CLK_MOUT_ACLK_HEVC_400_USER, "mout_aclk_hevc_400_user",
4237 mout_aclk_hevc_400_user_p, MUX_SEL_HEVC, 0, 0),
4238};
4239
4240static const struct samsung_div_clock hevc_div_clks[] __initconst = {
4241 /* DIV_HEVC */
4242 DIV(CLK_DIV_PCLK_HEVC, "div_pclk_hevc", "mout_aclk_hevc_400_user",
4243 DIV_HEVC, 0, 2),
4244};
4245
4246static const struct samsung_gate_clock hevc_gate_clks[] __initconst = {
4247 /* ENABLE_ACLK_HEVC */
4248 GATE(CLK_ACLK_BTS_HEVC_1, "aclk_bts_hevc_1", "mout_aclk_hevc_400_user",
4249 ENABLE_ACLK_HEVC, 6, 0, 0),
4250 GATE(CLK_ACLK_BTS_HEVC_0, "aclk_bts_hevc_0", "mout_aclk_hevc_400_user",
4251 ENABLE_ACLK_HEVC, 5, 0, 0),
4252 GATE(CLK_ACLK_AHB2APB_HEVCP, "aclk_ahb2apb_hevcp", "div_pclk_hevc",
4253 ENABLE_ACLK_HEVC, 4, CLK_IGNORE_UNUSED, 0),
4254 GATE(CLK_ACLK_XIU_HEVCX, "aclk_xiu_hevcx", "mout_aclk_hevc_400_user",
4255 ENABLE_ACLK_HEVC, 3, CLK_IGNORE_UNUSED, 0),
4256 GATE(CLK_ACLK_HEVCNP_100, "aclk_hevcnp_100", "div_pclk_hevc",
4257 ENABLE_ACLK_HEVC, 2, CLK_IGNORE_UNUSED, 0),
4258 GATE(CLK_ACLK_HEVCND_400, "aclk_hevcnd_400", "mout_aclk_hevc_400_user",
4259 ENABLE_ACLK_HEVC, 1, CLK_IGNORE_UNUSED, 0),
4260 GATE(CLK_ACLK_HEVC, "aclk_hevc", "mout_aclk_hevc_400_user",
4261 ENABLE_ACLK_HEVC, 0, 0, 0),
4262
4263 /* ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC */
4264 GATE(CLK_ACLK_SMMU_HEVC_1, "aclk_smmu_hevc_1",
4265 "mout_aclk_hevc_400_user",
4266 ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC,
4267 1, CLK_IGNORE_UNUSED, 0),
4268 GATE(CLK_ACLK_SMMU_HEVC_0, "aclk_smmu_hevc_0",
4269 "mout_aclk_hevc_400_user",
4270 ENABLE_ACLK_HEVC_SECURE_SMMU_HEVC,
4271 0, CLK_IGNORE_UNUSED, 0),
4272
4273 /* ENABLE_PCLK_HEVC */
4274 GATE(CLK_PCLK_BTS_HEVC_1, "pclk_bts_hevc_1", "div_pclk_hevc",
4275 ENABLE_PCLK_HEVC, 4, 0, 0),
4276 GATE(CLK_PCLK_BTS_HEVC_0, "pclk_bts_hevc_0", "div_pclk_hevc",
4277 ENABLE_PCLK_HEVC, 3, 0, 0),
4278 GATE(CLK_PCLK_PMU_HEVC, "pclk_pmu_hevc", "div_pclk_hevc",
4279 ENABLE_PCLK_HEVC, 2, CLK_IGNORE_UNUSED, 0),
4280 GATE(CLK_PCLK_SYSREG_HEVC, "pclk_sysreg_hevc", "div_pclk_hevc",
4281 ENABLE_PCLK_HEVC, 1, CLK_IGNORE_UNUSED, 0),
4282 GATE(CLK_PCLK_HEVC, "pclk_hevc", "div_pclk_hevc",
4283 ENABLE_PCLK_HEVC, 4, CLK_IGNORE_UNUSED, 0),
4284
4285 /* ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC */
4286 GATE(CLK_PCLK_SMMU_HEVC_1, "pclk_smmu_hevc_1", "div_pclk_hevc",
4287 ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC,
4288 1, CLK_IGNORE_UNUSED, 0),
4289 GATE(CLK_PCLK_SMMU_HEVC_0, "pclk_smmu_hevc_0", "div_pclk_hevc",
4290 ENABLE_PCLK_HEVC_SECURE_SMMU_HEVC,
4291 0, CLK_IGNORE_UNUSED, 0),
4292};
4293
4294static const struct samsung_cmu_info hevc_cmu_info __initconst = {
4295 .mux_clks = hevc_mux_clks,
4296 .nr_mux_clks = ARRAY_SIZE(hevc_mux_clks),
4297 .div_clks = hevc_div_clks,
4298 .nr_div_clks = ARRAY_SIZE(hevc_div_clks),
4299 .gate_clks = hevc_gate_clks,
4300 .nr_gate_clks = ARRAY_SIZE(hevc_gate_clks),
4301 .nr_clk_ids = HEVC_NR_CLK,
4302 .clk_regs = hevc_clk_regs,
4303 .nr_clk_regs = ARRAY_SIZE(hevc_clk_regs),
4304};
4305
4306static void __init exynos5433_cmu_hevc_init(struct device_node *np)
4307{
4308 samsung_cmu_register_one(np, &hevc_cmu_info);
4309}
4310CLK_OF_DECLARE(exynos5433_cmu_hevc, "samsung,exynos5433-cmu-hevc",
4311 exynos5433_cmu_hevc_init);
4312
4313/*
4314 * Register offset definitions for CMU_ISP
4315 */
4316#define MUX_SEL_ISP 0x0200
4317#define MUX_ENABLE_ISP 0x0300
4318#define MUX_STAT_ISP 0x0400
4319#define DIV_ISP 0x0600
4320#define DIV_STAT_ISP 0x0700
4321#define ENABLE_ACLK_ISP0 0x0800
4322#define ENABLE_ACLK_ISP1 0x0804
4323#define ENABLE_ACLK_ISP2 0x0808
4324#define ENABLE_PCLK_ISP 0x0900
4325#define ENABLE_SCLK_ISP 0x0a00
4326#define ENABLE_IP_ISP0 0x0b00
4327#define ENABLE_IP_ISP1 0x0b04
4328#define ENABLE_IP_ISP2 0x0b08
4329#define ENABLE_IP_ISP3 0x0b0c
4330
4331static const unsigned long isp_clk_regs[] __initconst = {
4332 MUX_SEL_ISP,
4333 MUX_ENABLE_ISP,
4334 DIV_ISP,
4335 ENABLE_ACLK_ISP0,
4336 ENABLE_ACLK_ISP1,
4337 ENABLE_ACLK_ISP2,
4338 ENABLE_PCLK_ISP,
4339 ENABLE_SCLK_ISP,
4340 ENABLE_IP_ISP0,
4341 ENABLE_IP_ISP1,
4342 ENABLE_IP_ISP2,
4343 ENABLE_IP_ISP3,
4344};
4345
4346PNAME(mout_aclk_isp_dis_400_user_p) = { "oscclk", "aclk_isp_dis_400", };
4347PNAME(mout_aclk_isp_400_user_p) = { "oscclk", "aclk_isp_400", };
4348
4349static const struct samsung_mux_clock isp_mux_clks[] __initconst = {
4350 /* MUX_SEL_ISP */
4351 MUX(CLK_MOUT_ACLK_ISP_DIS_400_USER, "mout_aclk_isp_dis_400_user",
4352 mout_aclk_isp_dis_400_user_p, MUX_SEL_ISP, 4, 0),
4353 MUX(CLK_MOUT_ACLK_ISP_400_USER, "mout_aclk_isp_400_user",
4354 mout_aclk_isp_400_user_p, MUX_SEL_ISP, 0, 0),
4355};
4356
4357static const struct samsung_div_clock isp_div_clks[] __initconst = {
4358 /* DIV_ISP */
4359 DIV(CLK_DIV_PCLK_ISP_DIS, "div_pclk_isp_dis",
4360 "mout_aclk_isp_dis_400_user", DIV_ISP, 12, 3),
4361 DIV(CLK_DIV_PCLK_ISP, "div_pclk_isp", "mout_aclk_isp_400_user",
4362 DIV_ISP, 8, 3),
4363 DIV(CLK_DIV_ACLK_ISP_D_200, "div_aclk_isp_d_200",
4364 "mout_aclk_isp_400_user", DIV_ISP, 4, 3),
4365 DIV(CLK_DIV_ACLK_ISP_C_200, "div_aclk_isp_c_200",
4366 "mout_aclk_isp_400_user", DIV_ISP, 0, 3),
4367};
4368
4369static const struct samsung_gate_clock isp_gate_clks[] __initconst = {
4370 /* ENABLE_ACLK_ISP0 */
4371 GATE(CLK_ACLK_ISP_D_GLUE, "aclk_isp_d_glue", "mout_aclk_isp_400_user",
4372 ENABLE_ACLK_ISP0, 6, CLK_IGNORE_UNUSED, 0),
4373 GATE(CLK_ACLK_SCALERP, "aclk_scalerp", "mout_aclk_isp_400_user",
4374 ENABLE_ACLK_ISP0, 5, 0, 0),
4375 GATE(CLK_ACLK_3DNR, "aclk_3dnr", "mout_aclk_isp_400_user",
4376 ENABLE_ACLK_ISP0, 4, 0, 0),
4377 GATE(CLK_ACLK_DIS, "aclk_dis", "mout_aclk_isp_dis_400_user",
4378 ENABLE_ACLK_ISP0, 3, 0, 0),
4379 GATE(CLK_ACLK_SCALERC, "aclk_scalerc", "mout_aclk_isp_400_user",
4380 ENABLE_ACLK_ISP0, 2, 0, 0),
4381 GATE(CLK_ACLK_DRC, "aclk_drc", "mout_aclk_isp_400_user",
4382 ENABLE_ACLK_ISP0, 1, 0, 0),
4383 GATE(CLK_ACLK_ISP, "aclk_isp", "mout_aclk_isp_400_user",
4384 ENABLE_ACLK_ISP0, 0, 0, 0),
4385
4386 /* ENABLE_ACLK_ISP1 */
4387 GATE(CLK_ACLK_AXIUS_SCALERP, "aclk_axius_scalerp",
4388 "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
4389 17, CLK_IGNORE_UNUSED, 0),
4390 GATE(CLK_ACLK_AXIUS_SCALERC, "aclk_axius_scalerc",
4391 "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
4392 16, CLK_IGNORE_UNUSED, 0),
4393 GATE(CLK_ACLK_AXIUS_DRC, "aclk_axius_drc",
4394 "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
4395 15, CLK_IGNORE_UNUSED, 0),
4396 GATE(CLK_ACLK_ASYNCAHBM_ISP2P, "aclk_asyncahbm_isp2p",
4397 "div_pclk_isp", ENABLE_ACLK_ISP1,
4398 14, CLK_IGNORE_UNUSED, 0),
4399 GATE(CLK_ACLK_ASYNCAHBM_ISP1P, "aclk_asyncahbm_isp1p",
4400 "div_pclk_isp", ENABLE_ACLK_ISP1,
4401 13, CLK_IGNORE_UNUSED, 0),
4402 GATE(CLK_ACLK_ASYNCAXIS_DIS1, "aclk_asyncaxis_dis1",
4403 "mout_aclk_isp_dis_400_user", ENABLE_ACLK_ISP1,
4404 12, CLK_IGNORE_UNUSED, 0),
4405 GATE(CLK_ACLK_ASYNCAXIS_DIS0, "aclk_asyncaxis_dis0",
4406 "mout_aclk_isp_dis_400_user", ENABLE_ACLK_ISP1,
4407 11, CLK_IGNORE_UNUSED, 0),
4408 GATE(CLK_ACLK_ASYNCAXIM_DIS1, "aclk_asyncaxim_dis1",
4409 "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
4410 10, CLK_IGNORE_UNUSED, 0),
4411 GATE(CLK_ACLK_ASYNCAXIM_DIS0, "aclk_asyncaxim_dis0",
4412 "mout_aclk_isp_400_user", ENABLE_ACLK_ISP1,
4413 9, CLK_IGNORE_UNUSED, 0),
4414 GATE(CLK_ACLK_ASYNCAXIM_ISP2P, "aclk_asyncaxim_isp2p",
4415 "div_aclk_isp_d_200", ENABLE_ACLK_ISP1,
4416 8, CLK_IGNORE_UNUSED, 0),
4417 GATE(CLK_ACLK_ASYNCAXIM_ISP1P, "aclk_asyncaxim_isp1p",
4418 "div_aclk_isp_c_200", ENABLE_ACLK_ISP1,
4419 7, CLK_IGNORE_UNUSED, 0),
4420 GATE(CLK_ACLK_AHB2APB_ISP2P, "aclk_ahb2apb_isp2p", "div_pclk_isp",
4421 ENABLE_ACLK_ISP1, 6, CLK_IGNORE_UNUSED, 0),
4422 GATE(CLK_ACLK_AHB2APB_ISP1P, "aclk_ahb2apb_isp1p", "div_pclk_isp",
4423 ENABLE_ACLK_ISP1, 5, CLK_IGNORE_UNUSED, 0),
4424 GATE(CLK_ACLK_AXI2APB_ISP2P, "aclk_axi2apb_isp2p",
4425 "div_aclk_isp_d_200", ENABLE_ACLK_ISP1,
4426 4, CLK_IGNORE_UNUSED, 0),
4427 GATE(CLK_ACLK_AXI2APB_ISP1P, "aclk_axi2apb_isp1p",
4428 "div_aclk_isp_c_200", ENABLE_ACLK_ISP1,
4429 3, CLK_IGNORE_UNUSED, 0),
4430 GATE(CLK_ACLK_XIU_ISPEX1, "aclk_xiu_ispex1", "mout_aclk_isp_400_user",
4431 ENABLE_ACLK_ISP1, 2, CLK_IGNORE_UNUSED, 0),
4432 GATE(CLK_ACLK_XIU_ISPEX0, "aclk_xiu_ispex0", "mout_aclk_isp_400_user",
4433 ENABLE_ACLK_ISP1, 1, CLK_IGNORE_UNUSED, 0),
4434 GATE(CLK_ACLK_ISPND_400, "aclk_ispnd_400", "mout_aclk_isp_400_user",
4435 ENABLE_ACLK_ISP1, 1, CLK_IGNORE_UNUSED, 0),
4436
4437 /* ENABLE_ACLK_ISP2 */
4438 GATE(CLK_ACLK_SMMU_SCALERP, "aclk_smmu_scalerp",
4439 "mout_aclk_isp_400_user", ENABLE_ACLK_ISP2,
4440 13, CLK_IGNORE_UNUSED, 0),
4441 GATE(CLK_ACLK_SMMU_3DNR, "aclk_smmu_3dnr", "mout_aclk_isp_400_user",
4442 ENABLE_ACLK_ISP2, 12, CLK_IGNORE_UNUSED, 0),
4443 GATE(CLK_ACLK_SMMU_DIS1, "aclk_smmu_dis1", "mout_aclk_isp_400_user",
4444 ENABLE_ACLK_ISP2, 11, CLK_IGNORE_UNUSED, 0),
4445 GATE(CLK_ACLK_SMMU_DIS0, "aclk_smmu_dis0", "mout_aclk_isp_400_user",
4446 ENABLE_ACLK_ISP2, 10, CLK_IGNORE_UNUSED, 0),
4447 GATE(CLK_ACLK_SMMU_SCALERC, "aclk_smmu_scalerc",
4448 "mout_aclk_isp_400_user", ENABLE_ACLK_ISP2,
4449 9, CLK_IGNORE_UNUSED, 0),
4450 GATE(CLK_ACLK_SMMU_DRC, "aclk_smmu_drc", "mout_aclk_isp_400_user",
4451 ENABLE_ACLK_ISP2, 8, CLK_IGNORE_UNUSED, 0),
4452 GATE(CLK_ACLK_SMMU_ISP, "aclk_smmu_isp", "mout_aclk_isp_400_user",
4453 ENABLE_ACLK_ISP2, 7, CLK_IGNORE_UNUSED, 0),
4454 GATE(CLK_ACLK_BTS_SCALERP, "aclk_bts_scalerp",
4455 "mout_aclk_isp_400_user", ENABLE_ACLK_ISP2,
4456 6, CLK_IGNORE_UNUSED, 0),
4457 GATE(CLK_ACLK_BTS_3DR, "aclk_bts_3dnr", "mout_aclk_isp_400_user",
4458 ENABLE_ACLK_ISP2, 5, CLK_IGNORE_UNUSED, 0),
4459 GATE(CLK_ACLK_BTS_DIS1, "aclk_bts_dis1", "mout_aclk_isp_400_user",
4460 ENABLE_ACLK_ISP2, 4, CLK_IGNORE_UNUSED, 0),
4461 GATE(CLK_ACLK_BTS_DIS0, "aclk_bts_dis0", "mout_aclk_isp_400_user",
4462 ENABLE_ACLK_ISP2, 3, CLK_IGNORE_UNUSED, 0),
4463 GATE(CLK_ACLK_BTS_SCALERC, "aclk_bts_scalerc",
4464 "mout_aclk_isp_400_user", ENABLE_ACLK_ISP2,
4465 2, CLK_IGNORE_UNUSED, 0),
4466 GATE(CLK_ACLK_BTS_DRC, "aclk_bts_drc", "mout_aclk_isp_400_user",
4467 ENABLE_ACLK_ISP2, 1, CLK_IGNORE_UNUSED, 0),
4468 GATE(CLK_ACLK_BTS_ISP, "aclk_bts_isp", "mout_aclk_isp_400_user",
4469 ENABLE_ACLK_ISP2, 0, CLK_IGNORE_UNUSED, 0),
4470
4471 /* ENABLE_PCLK_ISP */
4472 GATE(CLK_PCLK_SMMU_SCALERP, "pclk_smmu_scalerp", "div_aclk_isp_d_200",
4473 ENABLE_PCLK_ISP, 25, CLK_IGNORE_UNUSED, 0),
4474 GATE(CLK_PCLK_SMMU_3DNR, "pclk_smmu_3dnr", "div_aclk_isp_d_200",
4475 ENABLE_PCLK_ISP, 24, CLK_IGNORE_UNUSED, 0),
4476 GATE(CLK_PCLK_SMMU_DIS1, "pclk_smmu_dis1", "div_aclk_isp_d_200",
4477 ENABLE_PCLK_ISP, 23, CLK_IGNORE_UNUSED, 0),
4478 GATE(CLK_PCLK_SMMU_DIS0, "pclk_smmu_dis0", "div_aclk_isp_d_200",
4479 ENABLE_PCLK_ISP, 22, CLK_IGNORE_UNUSED, 0),
4480 GATE(CLK_PCLK_SMMU_SCALERC, "pclk_smmu_scalerc", "div_aclk_isp_c_200",
4481 ENABLE_PCLK_ISP, 21, CLK_IGNORE_UNUSED, 0),
4482 GATE(CLK_PCLK_SMMU_DRC, "pclk_smmu_drc", "div_aclk_isp_c_200",
4483 ENABLE_PCLK_ISP, 20, CLK_IGNORE_UNUSED, 0),
4484 GATE(CLK_PCLK_SMMU_ISP, "pclk_smmu_isp", "div_aclk_isp_c_200",
4485 ENABLE_PCLK_ISP, 19, CLK_IGNORE_UNUSED, 0),
4486 GATE(CLK_PCLK_BTS_SCALERP, "pclk_bts_scalerp", "div_pclk_isp",
4487 ENABLE_PCLK_ISP, 18, CLK_IGNORE_UNUSED, 0),
4488 GATE(CLK_PCLK_BTS_3DNR, "pclk_bts_3dnr", "div_pclk_isp",
4489 ENABLE_PCLK_ISP, 17, CLK_IGNORE_UNUSED, 0),
4490 GATE(CLK_PCLK_BTS_DIS1, "pclk_bts_dis1", "div_pclk_isp",
4491 ENABLE_PCLK_ISP, 16, CLK_IGNORE_UNUSED, 0),
4492 GATE(CLK_PCLK_BTS_DIS0, "pclk_bts_dis0", "div_pclk_isp",
4493 ENABLE_PCLK_ISP, 15, CLK_IGNORE_UNUSED, 0),
4494 GATE(CLK_PCLK_BTS_SCALERC, "pclk_bts_scalerc", "div_pclk_isp",
4495 ENABLE_PCLK_ISP, 14, CLK_IGNORE_UNUSED, 0),
4496 GATE(CLK_PCLK_BTS_DRC, "pclk_bts_drc", "div_pclk_isp",
4497 ENABLE_PCLK_ISP, 13, CLK_IGNORE_UNUSED, 0),
4498 GATE(CLK_PCLK_BTS_ISP, "pclk_bts_isp", "div_pclk_isp",
4499 ENABLE_PCLK_ISP, 12, CLK_IGNORE_UNUSED, 0),
4500 GATE(CLK_PCLK_ASYNCAXI_DIS1, "pclk_asyncaxi_dis1", "div_pclk_isp",
4501 ENABLE_PCLK_ISP, 11, CLK_IGNORE_UNUSED, 0),
4502 GATE(CLK_PCLK_ASYNCAXI_DIS0, "pclk_asyncaxi_dis0", "div_pclk_isp",
4503 ENABLE_PCLK_ISP, 10, CLK_IGNORE_UNUSED, 0),
4504 GATE(CLK_PCLK_PMU_ISP, "pclk_pmu_isp", "div_pclk_isp",
4505 ENABLE_PCLK_ISP, 9, CLK_IGNORE_UNUSED, 0),
4506 GATE(CLK_PCLK_SYSREG_ISP, "pclk_sysreg_isp", "div_pclk_isp",
4507 ENABLE_PCLK_ISP, 8, CLK_IGNORE_UNUSED, 0),
4508 GATE(CLK_PCLK_CMU_ISP_LOCAL, "pclk_cmu_isp_local",
4509 "div_aclk_isp_c_200", ENABLE_PCLK_ISP,
4510 7, CLK_IGNORE_UNUSED, 0),
4511 GATE(CLK_PCLK_SCALERP, "pclk_scalerp", "div_aclk_isp_d_200",
4512 ENABLE_PCLK_ISP, 6, CLK_IGNORE_UNUSED, 0),
4513 GATE(CLK_PCLK_3DNR, "pclk_3dnr", "div_aclk_isp_d_200",
4514 ENABLE_PCLK_ISP, 5, CLK_IGNORE_UNUSED, 0),
4515 GATE(CLK_PCLK_DIS_CORE, "pclk_dis_core", "div_pclk_isp_dis",
4516 ENABLE_PCLK_ISP, 4, CLK_IGNORE_UNUSED, 0),
4517 GATE(CLK_PCLK_DIS, "pclk_dis", "div_aclk_isp_d_200",
4518 ENABLE_PCLK_ISP, 3, CLK_IGNORE_UNUSED, 0),
4519 GATE(CLK_PCLK_SCALERC, "pclk_scalerc", "div_aclk_isp_c_200",
4520 ENABLE_PCLK_ISP, 2, CLK_IGNORE_UNUSED, 0),
4521 GATE(CLK_PCLK_DRC, "pclk_drc", "div_aclk_isp_c_200",
4522 ENABLE_PCLK_ISP, 1, CLK_IGNORE_UNUSED, 0),
4523 GATE(CLK_PCLK_ISP, "pclk_isp", "div_aclk_isp_c_200",
4524 ENABLE_PCLK_ISP, 0, CLK_IGNORE_UNUSED, 0),
4525
4526 /* ENABLE_SCLK_ISP */
4527 GATE(CLK_SCLK_PIXELASYNCS_DIS, "sclk_pixelasyncs_dis",
4528 "mout_aclk_isp_dis_400_user", ENABLE_SCLK_ISP,
4529 5, CLK_IGNORE_UNUSED, 0),
4530 GATE(CLK_SCLK_PIXELASYNCM_DIS, "sclk_pixelasyncm_dis",
4531 "mout_aclk_isp_dis_400_user", ENABLE_SCLK_ISP,
4532 4, CLK_IGNORE_UNUSED, 0),
4533 GATE(CLK_SCLK_PIXELASYNCS_SCALERP, "sclk_pixelasyncs_scalerp",
4534 "mout_aclk_isp_400_user", ENABLE_SCLK_ISP,
4535 3, CLK_IGNORE_UNUSED, 0),
4536 GATE(CLK_SCLK_PIXELASYNCM_ISPD, "sclk_pixelasyncm_ispd",
4537 "mout_aclk_isp_400_user", ENABLE_SCLK_ISP,
4538 2, CLK_IGNORE_UNUSED, 0),
4539 GATE(CLK_SCLK_PIXELASYNCS_ISPC, "sclk_pixelasyncs_ispc",
4540 "mout_aclk_isp_400_user", ENABLE_SCLK_ISP,
4541 1, CLK_IGNORE_UNUSED, 0),
4542 GATE(CLK_SCLK_PIXELASYNCM_ISPC, "sclk_pixelasyncm_ispc",
4543 "mout_aclk_isp_400_user", ENABLE_SCLK_ISP,
4544 0, CLK_IGNORE_UNUSED, 0),
4545};
4546
4547static const struct samsung_cmu_info isp_cmu_info __initconst = {
4548 .mux_clks = isp_mux_clks,
4549 .nr_mux_clks = ARRAY_SIZE(isp_mux_clks),
4550 .div_clks = isp_div_clks,
4551 .nr_div_clks = ARRAY_SIZE(isp_div_clks),
4552 .gate_clks = isp_gate_clks,
4553 .nr_gate_clks = ARRAY_SIZE(isp_gate_clks),
4554 .nr_clk_ids = ISP_NR_CLK,
4555 .clk_regs = isp_clk_regs,
4556 .nr_clk_regs = ARRAY_SIZE(isp_clk_regs),
4557};
4558
4559static void __init exynos5433_cmu_isp_init(struct device_node *np)
4560{
4561 samsung_cmu_register_one(np, &isp_cmu_info);
4562}
4563CLK_OF_DECLARE(exynos5433_cmu_isp, "samsung,exynos5433-cmu-isp",
4564 exynos5433_cmu_isp_init);
4565
4566/*
4567 * Register offset definitions for CMU_CAM0
4568 */
4569#define MUX_SEL_CAM00 0x0200
4570#define MUX_SEL_CAM01 0x0204
4571#define MUX_SEL_CAM02 0x0208
4572#define MUX_SEL_CAM03 0x020c
4573#define MUX_SEL_CAM04 0x0210
4574#define MUX_ENABLE_CAM00 0x0300
4575#define MUX_ENABLE_CAM01 0x0304
4576#define MUX_ENABLE_CAM02 0x0308
4577#define MUX_ENABLE_CAM03 0x030c
4578#define MUX_ENABLE_CAM04 0x0310
4579#define MUX_STAT_CAM00 0x0400
4580#define MUX_STAT_CAM01 0x0404
4581#define MUX_STAT_CAM02 0x0408
4582#define MUX_STAT_CAM03 0x040c
4583#define MUX_STAT_CAM04 0x0410
4584#define MUX_IGNORE_CAM01 0x0504
4585#define DIV_CAM00 0x0600
4586#define DIV_CAM01 0x0604
4587#define DIV_CAM02 0x0608
4588#define DIV_CAM03 0x060c
4589#define DIV_STAT_CAM00 0x0700
4590#define DIV_STAT_CAM01 0x0704
4591#define DIV_STAT_CAM02 0x0708
4592#define DIV_STAT_CAM03 0x070c
4593#define ENABLE_ACLK_CAM00 0X0800
4594#define ENABLE_ACLK_CAM01 0X0804
4595#define ENABLE_ACLK_CAM02 0X0808
4596#define ENABLE_PCLK_CAM0 0X0900
4597#define ENABLE_SCLK_CAM0 0X0a00
4598#define ENABLE_IP_CAM00 0X0b00
4599#define ENABLE_IP_CAM01 0X0b04
4600#define ENABLE_IP_CAM02 0X0b08
4601#define ENABLE_IP_CAM03 0X0b0C
4602
4603static const unsigned long cam0_clk_regs[] __initconst = {
4604 MUX_SEL_CAM00,
4605 MUX_SEL_CAM01,
4606 MUX_SEL_CAM02,
4607 MUX_SEL_CAM03,
4608 MUX_SEL_CAM04,
4609 MUX_ENABLE_CAM00,
4610 MUX_ENABLE_CAM01,
4611 MUX_ENABLE_CAM02,
4612 MUX_ENABLE_CAM03,
4613 MUX_ENABLE_CAM04,
4614 MUX_IGNORE_CAM01,
4615 DIV_CAM00,
4616 DIV_CAM01,
4617 DIV_CAM02,
4618 DIV_CAM03,
4619 ENABLE_ACLK_CAM00,
4620 ENABLE_ACLK_CAM01,
4621 ENABLE_ACLK_CAM02,
4622 ENABLE_PCLK_CAM0,
4623 ENABLE_SCLK_CAM0,
4624 ENABLE_IP_CAM00,
4625 ENABLE_IP_CAM01,
4626 ENABLE_IP_CAM02,
4627 ENABLE_IP_CAM03,
4628};
4629PNAME(mout_aclk_cam0_333_user_p) = { "oscclk", "aclk_cam0_333", };
4630PNAME(mout_aclk_cam0_400_user_p) = { "oscclk", "aclk_cam0_400", };
4631PNAME(mout_aclk_cam0_552_user_p) = { "oscclk", "aclk_cam0_552", };
4632
4633PNAME(mout_phyclk_rxbyteclkhs0_s4_user_p) = { "oscclk",
4634 "phyclk_rxbyteclkhs0_s4_phy", };
4635PNAME(mout_phyclk_rxbyteclkhs0_s2a_user_p) = { "oscclk",
4636 "phyclk_rxbyteclkhs0_s2a_phy", };
4637
4638PNAME(mout_aclk_lite_d_b_p) = { "mout_aclk_lite_d_a",
4639 "mout_aclk_cam0_333_user", };
4640PNAME(mout_aclk_lite_d_a_p) = { "mout_aclk_cam0_552_user",
4641 "mout_aclk_cam0_400_user", };
4642PNAME(mout_aclk_lite_b_b_p) = { "mout_aclk_lite_b_a",
4643 "mout_aclk_cam0_333_user", };
4644PNAME(mout_aclk_lite_b_a_p) = { "mout_aclk_cam0_552_user",
4645 "mout_aclk_cam0_400_user", };
4646PNAME(mout_aclk_lite_a_b_p) = { "mout_aclk_lite_a_a",
4647 "mout_aclk_cam0_333_user", };
4648PNAME(mout_aclk_lite_a_a_p) = { "mout_aclk_cam0_552_user",
4649 "mout_aclk_cam0_400_user", };
4650PNAME(mout_aclk_cam0_400_p) = { "mout_aclk_cam0_400_user",
4651 "mout_aclk_cam0_333_user", };
4652
4653PNAME(mout_aclk_csis1_b_p) = { "mout_aclk_csis1_a",
4654 "mout_aclk_cam0_333_user" };
4655PNAME(mout_aclk_csis1_a_p) = { "mout_aclk_cam0_552_user",
4656 "mout_aclk_cam0_400_user", };
4657PNAME(mout_aclk_csis0_b_p) = { "mout_aclk_csis0_a",
4658 "mout_aclk_cam0_333_user", };
4659PNAME(mout_aclk_csis0_a_p) = { "mout_aclk_cam0_552_user",
4660 "mout_aclk-cam0_400_user", };
4661PNAME(mout_aclk_3aa1_b_p) = { "mout_aclk_3aa1_a",
4662 "mout_aclk_cam0_333_user", };
4663PNAME(mout_aclk_3aa1_a_p) = { "mout_aclk_cam0_552_user",
4664 "mout_aclk_cam0_400_user", };
4665PNAME(mout_aclk_3aa0_b_p) = { "mout_aclk_3aa0_a",
4666 "mout_aclk_cam0_333_user", };
4667PNAME(mout_aclk_3aa0_a_p) = { "mout_aclk_cam0_552_user",
4668 "mout_aclk_cam0_400_user", };
4669
4670PNAME(mout_sclk_lite_freecnt_c_p) = { "mout_sclk_lite_freecnt_b",
4671 "div_pclk_lite_d", };
4672PNAME(mout_sclk_lite_freecnt_b_p) = { "mout_sclk_lite_freecnt_a",
4673 "div_pclk_pixelasync_lite_c", };
4674PNAME(mout_sclk_lite_freecnt_a_p) = { "div_pclk_lite_a",
4675 "div_pclk_lite_b", };
4676PNAME(mout_sclk_pixelasync_lite_c_b_p) = { "mout_sclk_pixelasync_lite_c_a",
4677 "mout_aclk_cam0_333_user", };
4678PNAME(mout_sclk_pixelasync_lite_c_a_p) = { "mout_aclk_cam0_552_user",
4679 "mout_aclk_cam0_400_user", };
4680PNAME(mout_sclk_pixelasync_lite_c_init_b_p) = {
4681 "mout_sclk_pixelasync_lite_c_init_a",
4682 "mout_aclk_cam0_400_user", };
4683PNAME(mout_sclk_pixelasync_lite_c_init_a_p) = {
4684 "mout_aclk_cam0_552_user",
4685 "mout_aclk_cam0_400_user", };
4686
4687static const struct samsung_fixed_rate_clock cam0_fixed_clks[] __initconst = {
4688 FRATE(CLK_PHYCLK_RXBYTEECLKHS0_S4_PHY, "phyclk_rxbyteclkhs0_s4_phy",
4689 NULL, 0, 100000000),
4690 FRATE(CLK_PHYCLK_RXBYTEECLKHS0_S2A_PHY, "phyclk_rxbyteclkhs0_s2a_phy",
4691 NULL, 0, 100000000),
4692};
4693
4694static const struct samsung_mux_clock cam0_mux_clks[] __initconst = {
4695 /* MUX_SEL_CAM00 */
4696 MUX(CLK_MOUT_ACLK_CAM0_333_USER, "mout_aclk_cam0_333_user",
4697 mout_aclk_cam0_333_user_p, MUX_SEL_CAM00, 8, 1),
4698 MUX(CLK_MOUT_ACLK_CAM0_400_USER, "mout_aclk_cam0_400_user",
4699 mout_aclk_cam0_400_user_p, MUX_SEL_CAM00, 4, 1),
4700 MUX(CLK_MOUT_ACLK_CAM0_552_USER, "mout_aclk_cam0_552_user",
4701 mout_aclk_cam0_552_user_p, MUX_SEL_CAM00, 0, 1),
4702
4703 /* MUX_SEL_CAM01 */
4704 MUX(CLK_MOUT_PHYCLK_RXBYTECLKHS0_S4_USER,
4705 "mout_phyclk_rxbyteclkhs0_s4_user",
4706 mout_phyclk_rxbyteclkhs0_s4_user_p,
4707 MUX_SEL_CAM01, 4, 1),
4708 MUX(CLK_MOUT_PHYCLK_RXBYTECLKHS0_S2A_USER,
4709 "mout_phyclk_rxbyteclkhs0_s2a_user",
4710 mout_phyclk_rxbyteclkhs0_s2a_user_p,
4711 MUX_SEL_CAM01, 0, 1),
4712
4713 /* MUX_SEL_CAM02 */
4714 MUX(CLK_MOUT_ACLK_LITE_D_B, "mout_aclk_lite_d_b", mout_aclk_lite_d_b_p,
4715 MUX_SEL_CAM02, 24, 1),
4716 MUX(CLK_MOUT_ACLK_LITE_D_A, "mout_aclk_lite_d_a", mout_aclk_lite_d_a_p,
4717 MUX_SEL_CAM02, 20, 1),
4718 MUX(CLK_MOUT_ACLK_LITE_B_B, "mout_aclk_lite_b_b", mout_aclk_lite_b_b_p,
4719 MUX_SEL_CAM02, 16, 1),
4720 MUX(CLK_MOUT_ACLK_LITE_B_A, "mout_aclk_lite_b_a", mout_aclk_lite_b_a_p,
4721 MUX_SEL_CAM02, 12, 1),
4722 MUX(CLK_MOUT_ACLK_LITE_A_B, "mout_aclk_lite_a_b", mout_aclk_lite_a_b_p,
4723 MUX_SEL_CAM02, 8, 1),
4724 MUX(CLK_MOUT_ACLK_LITE_A_A, "mout_aclk_lite_a_a", mout_aclk_lite_a_a_p,
4725 MUX_SEL_CAM02, 4, 1),
4726 MUX(CLK_MOUT_ACLK_CAM0_400, "mout_aclk_cam0_400", mout_aclk_cam0_400_p,
4727 MUX_SEL_CAM02, 0, 1),
4728
4729 /* MUX_SEL_CAM03 */
4730 MUX(CLK_MOUT_ACLK_CSIS1_B, "mout_aclk_csis1_b", mout_aclk_csis1_b_p,
4731 MUX_SEL_CAM03, 28, 1),
4732 MUX(CLK_MOUT_ACLK_CSIS1_A, "mout_aclk_csis1_a", mout_aclk_csis1_a_p,
4733 MUX_SEL_CAM03, 24, 1),
4734 MUX(CLK_MOUT_ACLK_CSIS0_B, "mout_aclk_csis0_b", mout_aclk_csis0_b_p,
4735 MUX_SEL_CAM03, 20, 1),
4736 MUX(CLK_MOUT_ACLK_CSIS0_A, "mout_aclk_csis0_a", mout_aclk_csis0_a_p,
4737 MUX_SEL_CAM03, 16, 1),
4738 MUX(CLK_MOUT_ACLK_3AA1_B, "mout_aclk_3aa1_b", mout_aclk_3aa1_b_p,
4739 MUX_SEL_CAM03, 12, 1),
4740 MUX(CLK_MOUT_ACLK_3AA1_A, "mout_aclk_3aa1_a", mout_aclk_3aa1_a_p,
4741 MUX_SEL_CAM03, 8, 1),
4742 MUX(CLK_MOUT_ACLK_3AA0_B, "mout_aclk_3aa0_b", mout_aclk_3aa0_b_p,
4743 MUX_SEL_CAM03, 4, 1),
4744 MUX(CLK_MOUT_ACLK_3AA0_A, "mout_aclk_3aa0_a", mout_aclk_3aa0_a_p,
4745 MUX_SEL_CAM03, 0, 1),
4746
4747 /* MUX_SEL_CAM04 */
4748 MUX(CLK_MOUT_SCLK_LITE_FREECNT_C, "mout_sclk_lite_freecnt_c",
4749 mout_sclk_lite_freecnt_c_p, MUX_SEL_CAM04, 24, 1),
4750 MUX(CLK_MOUT_SCLK_LITE_FREECNT_B, "mout_sclk_lite_freecnt_b",
4751 mout_sclk_lite_freecnt_b_p, MUX_SEL_CAM04, 20, 1),
4752 MUX(CLK_MOUT_SCLK_LITE_FREECNT_A, "mout_sclk_lite_freecnt_a",
4753 mout_sclk_lite_freecnt_a_p, MUX_SEL_CAM04, 16, 1),
4754 MUX(CLK_MOUT_SCLK_PIXELASYNC_LITE_C_B, "mout_sclk_pixelasync_lite_c_b",
4755 mout_sclk_pixelasync_lite_c_b_p, MUX_SEL_CAM04, 12, 1),
4756 MUX(CLK_MOUT_SCLK_PIXELASYNC_LITE_C_A, "mout_sclk_pixelasync_lite_c_a",
4757 mout_sclk_pixelasync_lite_c_a_p, MUX_SEL_CAM04, 8, 1),
4758 MUX(CLK_MOUT_SCLK_PIXELASYNC_LITE_C_INIT_B,
4759 "mout_sclk_pixelasync_lite_c_init_b",
4760 mout_sclk_pixelasync_lite_c_init_b_p,
4761 MUX_SEL_CAM04, 4, 1),
4762 MUX(CLK_MOUT_SCLK_PIXELASYNC_LITE_C_INIT_A,
4763 "mout_sclk_pixelasync_lite_c_init_a",
4764 mout_sclk_pixelasync_lite_c_init_a_p,
4765 MUX_SEL_CAM04, 0, 1),
4766};
4767
4768static const struct samsung_div_clock cam0_div_clks[] __initconst = {
4769 /* DIV_CAM00 */
4770 DIV(CLK_DIV_PCLK_CAM0_50, "div_pclk_cam0_50", "div_aclk_cam0_200",
4771 DIV_CAM00, 8, 2),
4772 DIV(CLK_DIV_ACLK_CAM0_200, "div_aclk_cam0_200", "mout_aclk_cam0_400",
4773 DIV_CAM00, 4, 3),
4774 DIV(CLK_DIV_ACLK_CAM0_BUS_400, "div_aclk_cam0_bus_400",
4775 "mout_aclk_cam0_400", DIV_CAM00, 0, 3),
4776
4777 /* DIV_CAM01 */
4778 DIV(CLK_DIV_PCLK_LITE_D, "div_pclk_lite_d", "div_aclk_lite_d",
4779 DIV_CAM01, 20, 2),
4780 DIV(CLK_DIV_ACLK_LITE_D, "div_aclk_lite_d", "mout_aclk_lite_d_b",
4781 DIV_CAM01, 16, 3),
4782 DIV(CLK_DIV_PCLK_LITE_B, "div_pclk_lite_b", "div_aclk_lite_b",
4783 DIV_CAM01, 12, 2),
4784 DIV(CLK_DIV_ACLK_LITE_B, "div_aclk_lite_b", "mout_aclk_lite_b_b",
4785 DIV_CAM01, 8, 3),
4786 DIV(CLK_DIV_PCLK_LITE_A, "div_pclk_lite_a", "div_aclk_lite_a",
4787 DIV_CAM01, 4, 2),
4788 DIV(CLK_DIV_ACLK_LITE_A, "div_aclk_lite_a", "mout_aclk_lite_a_b",
4789 DIV_CAM01, 0, 3),
4790
4791 /* DIV_CAM02 */
4792 DIV(CLK_DIV_ACLK_CSIS1, "div_aclk_csis1", "mout_aclk_csis1_b",
4793 DIV_CAM02, 20, 3),
4794 DIV(CLK_DIV_ACLK_CSIS0, "div_aclk_csis0", "mout_aclk_csis0_b",
4795 DIV_CAM02, 16, 3),
4796 DIV(CLK_DIV_PCLK_3AA1, "div_pclk_3aa1", "div_aclk_3aa1",
4797 DIV_CAM02, 12, 2),
4798 DIV(CLK_DIV_ACLK_3AA1, "div_aclk_3aa1", "mout_aclk_3aa1_b",
4799 DIV_CAM02, 8, 3),
4800 DIV(CLK_DIV_PCLK_3AA0, "div_pclk_3aa0", "div_aclk_3aa0",
4801 DIV_CAM02, 4, 2),
4802 DIV(CLK_DIV_ACLK_3AA0, "div_aclk_3aa0", "mout_aclk_3aa0_b",
4803 DIV_CAM02, 0, 3),
4804
4805 /* DIV_CAM03 */
4806 DIV(CLK_DIV_SCLK_PIXELASYNC_LITE_C, "div_sclk_pixelasync_lite_c",
4807 "mout_sclk_pixelasync_lite_c_b", DIV_CAM03, 8, 3),
4808 DIV(CLK_DIV_PCLK_PIXELASYNC_LITE_C, "div_pclk_pixelasync_lite_c",
4809 "div_sclk_pixelasync_lite_c_init", DIV_CAM03, 4, 2),
4810 DIV(CLK_DIV_SCLK_PIXELASYNC_LITE_C_INIT,
4811 "div_sclk_pixelasync_lite_c_init",
4812 "mout_sclk_pixelasync_lite_c_init_b", DIV_CAM03, 0, 3),
4813};
4814
4815static const struct samsung_gate_clock cam0_gate_clks[] __initconst = {
4816 /* ENABLE_ACLK_CAM00 */
4817 GATE(CLK_ACLK_CSIS1, "aclk_csis1", "div_aclk_csis1", ENABLE_ACLK_CAM00,
4818 6, 0, 0),
4819 GATE(CLK_ACLK_CSIS0, "aclk_csis0", "div_aclk_csis0", ENABLE_ACLK_CAM00,
4820 5, 0, 0),
4821 GATE(CLK_ACLK_3AA1, "aclk_3aa1", "div_aclk_3aa1", ENABLE_ACLK_CAM00,
4822 4, 0, 0),
4823 GATE(CLK_ACLK_3AA0, "aclk_3aa0", "div_aclk_3aa0", ENABLE_ACLK_CAM00,
4824 3, 0, 0),
4825 GATE(CLK_ACLK_LITE_D, "aclk_lite_d", "div_aclk_lite_d",
4826 ENABLE_ACLK_CAM00, 2, 0, 0),
4827 GATE(CLK_ACLK_LITE_B, "aclk_lite_b", "div_aclk_lite_b",
4828 ENABLE_ACLK_CAM00, 1, 0, 0),
4829 GATE(CLK_ACLK_LITE_A, "aclk_lite_a", "div_aclk_lite_a",
4830 ENABLE_ACLK_CAM00, 0, 0, 0),
4831
4832 /* ENABLE_ACLK_CAM01 */
4833 GATE(CLK_ACLK_AHBSYNCDN, "aclk_ahbsyncdn", "div_aclk_cam0_200",
4834 ENABLE_ACLK_CAM01, 31, CLK_IGNORE_UNUSED, 0),
4835 GATE(CLK_ACLK_AXIUS_LITE_D, "aclk_axius_lite_d", "div_aclk_cam0_bus_400",
4836 ENABLE_ACLK_CAM01, 30, CLK_IGNORE_UNUSED, 0),
4837 GATE(CLK_ACLK_AXIUS_LITE_B, "aclk_axius_lite_b", "div_aclk_cam0_bus_400",
4838 ENABLE_ACLK_CAM01, 29, CLK_IGNORE_UNUSED, 0),
4839 GATE(CLK_ACLK_AXIUS_LITE_A, "aclk_axius_lite_a", "div_aclk_cam0_bus_400",
4840 ENABLE_ACLK_CAM01, 28, CLK_IGNORE_UNUSED, 0),
4841 GATE(CLK_ACLK_ASYNCAPBM_3AA1, "aclk_asyncapbm_3aa1", "div_pclk_3aa1",
4842 ENABLE_ACLK_CAM01, 27, CLK_IGNORE_UNUSED, 0),
4843 GATE(CLK_ACLK_ASYNCAPBS_3AA1, "aclk_asyncapbs_3aa1", "div_aclk_3aa1",
4844 ENABLE_ACLK_CAM01, 26, CLK_IGNORE_UNUSED, 0),
4845 GATE(CLK_ACLK_ASYNCAPBM_3AA0, "aclk_asyncapbm_3aa0", "div_pclk_3aa0",
4846 ENABLE_ACLK_CAM01, 25, CLK_IGNORE_UNUSED, 0),
4847 GATE(CLK_ACLK_ASYNCAPBS_3AA0, "aclk_asyncapbs_3aa0", "div_aclk_3aa0",
4848 ENABLE_ACLK_CAM01, 24, CLK_IGNORE_UNUSED, 0),
4849 GATE(CLK_ACLK_ASYNCAPBM_LITE_D, "aclk_asyncapbm_lite_d",
4850 "div_pclk_lite_d", ENABLE_ACLK_CAM01,
4851 23, CLK_IGNORE_UNUSED, 0),
4852 GATE(CLK_ACLK_ASYNCAPBS_LITE_D, "aclk_asyncapbs_lite_d",
4853 "div_aclk_cam0_200", ENABLE_ACLK_CAM01,
4854 22, CLK_IGNORE_UNUSED, 0),
4855 GATE(CLK_ACLK_ASYNCAPBM_LITE_B, "aclk_asyncapbm_lite_b",
4856 "div_pclk_lite_b", ENABLE_ACLK_CAM01,
4857 21, CLK_IGNORE_UNUSED, 0),
4858 GATE(CLK_ACLK_ASYNCAPBS_LITE_B, "aclk_asyncapbs_lite_b",
4859 "div_aclk_cam0_200", ENABLE_ACLK_CAM01,
4860 20, CLK_IGNORE_UNUSED, 0),
4861 GATE(CLK_ACLK_ASYNCAPBM_LITE_A, "aclk_asyncapbm_lite_a",
4862 "div_pclk_lite_a", ENABLE_ACLK_CAM01,
4863 19, CLK_IGNORE_UNUSED, 0),
4864 GATE(CLK_ACLK_ASYNCAPBS_LITE_A, "aclk_asyncapbs_lite_a",
4865 "div_aclk_cam0_200", ENABLE_ACLK_CAM01,
4866 18, CLK_IGNORE_UNUSED, 0),
4867 GATE(CLK_ACLK_ASYNCAXIM_ISP0P, "aclk_asyncaxim_isp0p",
4868 "div_aclk_cam0_200", ENABLE_ACLK_CAM01,
4869 17, CLK_IGNORE_UNUSED, 0),
4870 GATE(CLK_ACLK_ASYNCAXIM_3AA1, "aclk_asyncaxim_3aa1",
4871 "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
4872 16, CLK_IGNORE_UNUSED, 0),
4873 GATE(CLK_ACLK_ASYNCAXIS_3AA1, "aclk_asyncaxis_3aa1",
4874 "div_aclk_3aa1", ENABLE_ACLK_CAM01,
4875 15, CLK_IGNORE_UNUSED, 0),
4876 GATE(CLK_ACLK_ASYNCAXIM_3AA0, "aclk_asyncaxim_3aa0",
4877 "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
4878 14, CLK_IGNORE_UNUSED, 0),
4879 GATE(CLK_ACLK_ASYNCAXIS_3AA0, "aclk_asyncaxis_3aa0",
4880 "div_aclk_3aa0", ENABLE_ACLK_CAM01,
4881 13, CLK_IGNORE_UNUSED, 0),
4882 GATE(CLK_ACLK_ASYNCAXIM_LITE_D, "aclk_asyncaxim_lite_d",
4883 "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
4884 12, CLK_IGNORE_UNUSED, 0),
4885 GATE(CLK_ACLK_ASYNCAXIS_LITE_D, "aclk_asyncaxis_lite_d",
4886 "div_aclk_lite_d", ENABLE_ACLK_CAM01,
4887 11, CLK_IGNORE_UNUSED, 0),
4888 GATE(CLK_ACLK_ASYNCAXIM_LITE_B, "aclk_asyncaxim_lite_b",
4889 "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
4890 10, CLK_IGNORE_UNUSED, 0),
4891 GATE(CLK_ACLK_ASYNCAXIS_LITE_B, "aclk_asyncaxis_lite_b",
4892 "div_aclk_lite_b", ENABLE_ACLK_CAM01,
4893 9, CLK_IGNORE_UNUSED, 0),
4894 GATE(CLK_ACLK_ASYNCAXIM_LITE_A, "aclk_asyncaxim_lite_a",
4895 "div_aclk_cam0_bus_400", ENABLE_ACLK_CAM01,
4896 8, CLK_IGNORE_UNUSED, 0),
4897 GATE(CLK_ACLK_ASYNCAXIS_LITE_A, "aclk_asyncaxis_lite_a",
4898 "div_aclk_lite_a", ENABLE_ACLK_CAM01,
4899 7, CLK_IGNORE_UNUSED, 0),
4900 GATE(CLK_ACLK_AHB2APB_ISPSFRP, "aclk_ahb2apb_ispsfrp",
4901 "div_pclk_cam0_50", ENABLE_ACLK_CAM01,
4902 6, CLK_IGNORE_UNUSED, 0),
4903 GATE(CLK_ACLK_AXI2APB_ISP0P, "aclk_axi2apb_isp0p", "div_aclk_cam0_200",
4904 ENABLE_ACLK_CAM01, 5, CLK_IGNORE_UNUSED, 0),
4905 GATE(CLK_ACLK_AXI2AHB_ISP0P, "aclk_axi2ahb_isp0p", "div_aclk_cam0_200",
4906 ENABLE_ACLK_CAM01, 4, CLK_IGNORE_UNUSED, 0),
4907 GATE(CLK_ACLK_XIU_IS0X, "aclk_xiu_is0x", "div_aclk_cam0_200",
4908 ENABLE_ACLK_CAM01, 3, CLK_IGNORE_UNUSED, 0),
4909 GATE(CLK_ACLK_XIU_ISP0EX, "aclk_xiu_isp0ex", "div_aclk_cam0_bus_400",
4910 ENABLE_ACLK_CAM01, 2, CLK_IGNORE_UNUSED, 0),
4911 GATE(CLK_ACLK_CAM0NP_276, "aclk_cam0np_276", "div_aclk_cam0_200",
4912 ENABLE_ACLK_CAM01, 1, CLK_IGNORE_UNUSED, 0),
4913 GATE(CLK_ACLK_CAM0ND_400, "aclk_cam0nd_400", "div_aclk_cam0_bus_400",
4914 ENABLE_ACLK_CAM01, 0, CLK_IGNORE_UNUSED, 0),
4915
4916 /* ENABLE_ACLK_CAM02 */
4917 GATE(CLK_ACLK_SMMU_3AA1, "aclk_smmu_3aa1", "div_aclk_cam0_bus_400",
4918 ENABLE_ACLK_CAM02, 9, CLK_IGNORE_UNUSED, 0),
4919 GATE(CLK_ACLK_SMMU_3AA0, "aclk_smmu_3aa0", "div_aclk_cam0_bus_400",
4920 ENABLE_ACLK_CAM02, 8, CLK_IGNORE_UNUSED, 0),
4921 GATE(CLK_ACLK_SMMU_LITE_D, "aclk_smmu_lite_d", "div_aclk_cam0_bus_400",
4922 ENABLE_ACLK_CAM02, 7, CLK_IGNORE_UNUSED, 0),
4923 GATE(CLK_ACLK_SMMU_LITE_B, "aclk_smmu_lite_b", "div_aclk_cam0_bus_400",
4924 ENABLE_ACLK_CAM02, 6, CLK_IGNORE_UNUSED, 0),
4925 GATE(CLK_ACLK_SMMU_LITE_A, "aclk_smmu_lite_a", "div_aclk_cam0_bus_400",
4926 ENABLE_ACLK_CAM02, 5, CLK_IGNORE_UNUSED, 0),
4927 GATE(CLK_ACLK_BTS_3AA1, "aclk_bts_3aa1", "div_aclk_cam0_bus_400",
4928 ENABLE_ACLK_CAM02, 4, CLK_IGNORE_UNUSED, 0),
4929 GATE(CLK_ACLK_BTS_3AA0, "aclk_bts_3aa0", "div_aclk_cam0_bus_400",
4930 ENABLE_ACLK_CAM02, 3, CLK_IGNORE_UNUSED, 0),
4931 GATE(CLK_ACLK_BTS_LITE_D, "aclk_bts_lite_d", "div_aclk_cam0_bus_400",
4932 ENABLE_ACLK_CAM02, 2, CLK_IGNORE_UNUSED, 0),
4933 GATE(CLK_ACLK_BTS_LITE_B, "aclk_bts_lite_b", "div_aclk_cam0_bus_400",
4934 ENABLE_ACLK_CAM02, 1, CLK_IGNORE_UNUSED, 0),
4935 GATE(CLK_ACLK_BTS_LITE_A, "aclk_bts_lite_a", "div_aclk_cam0_bus_400",
4936 ENABLE_ACLK_CAM02, 0, CLK_IGNORE_UNUSED, 0),
4937
4938 /* ENABLE_PCLK_CAM0 */
4939 GATE(CLK_PCLK_SMMU_3AA1, "pclk_smmu_3aa1", "div_aclk_cam0_200",
4940 ENABLE_PCLK_CAM0, 25, CLK_IGNORE_UNUSED, 0),
4941 GATE(CLK_PCLK_SMMU_3AA0, "pclk_smmu_3aa0", "div_aclk_cam0_200",
4942 ENABLE_PCLK_CAM0, 24, CLK_IGNORE_UNUSED, 0),
4943 GATE(CLK_PCLK_SMMU_LITE_D, "pclk_smmu_lite_d", "div_aclk_cam0_200",
4944 ENABLE_PCLK_CAM0, 23, CLK_IGNORE_UNUSED, 0),
4945 GATE(CLK_PCLK_SMMU_LITE_B, "pclk_smmu_lite_b", "div_aclk_cam0_200",
4946 ENABLE_PCLK_CAM0, 22, CLK_IGNORE_UNUSED, 0),
4947 GATE(CLK_PCLK_SMMU_LITE_A, "pclk_smmu_lite_a", "div_aclk_cam0_200",
4948 ENABLE_PCLK_CAM0, 21, CLK_IGNORE_UNUSED, 0),
4949 GATE(CLK_PCLK_BTS_3AA1, "pclk_bts_3aa1", "div_pclk_cam0_50",
4950 ENABLE_PCLK_CAM0, 20, CLK_IGNORE_UNUSED, 0),
4951 GATE(CLK_PCLK_BTS_3AA0, "pclk_bts_3aa0", "div_pclk_cam0_50",
4952 ENABLE_PCLK_CAM0, 19, CLK_IGNORE_UNUSED, 0),
4953 GATE(CLK_PCLK_BTS_LITE_D, "pclk_bts_lite_d", "div_pclk_cam0_50",
4954 ENABLE_PCLK_CAM0, 18, CLK_IGNORE_UNUSED, 0),
4955 GATE(CLK_PCLK_BTS_LITE_B, "pclk_bts_lite_b", "div_pclk_cam0_50",
4956 ENABLE_PCLK_CAM0, 17, CLK_IGNORE_UNUSED, 0),
4957 GATE(CLK_PCLK_BTS_LITE_A, "pclk_bts_lite_a", "div_pclk_cam0_50",
4958 ENABLE_PCLK_CAM0, 16, CLK_IGNORE_UNUSED, 0),
4959 GATE(CLK_PCLK_ASYNCAXI_CAM1, "pclk_asyncaxi_cam1", "div_pclk_cam0_50",
4960 ENABLE_PCLK_CAM0, 15, CLK_IGNORE_UNUSED, 0),
4961 GATE(CLK_PCLK_ASYNCAXI_3AA1, "pclk_asyncaxi_3aa1", "div_pclk_cam0_50",
4962 ENABLE_PCLK_CAM0, 14, CLK_IGNORE_UNUSED, 0),
4963 GATE(CLK_PCLK_ASYNCAXI_3AA0, "pclk_asyncaxi_3aa0", "div_pclk_cam0_50",
4964 ENABLE_PCLK_CAM0, 13, CLK_IGNORE_UNUSED, 0),
4965 GATE(CLK_PCLK_ASYNCAXI_LITE_D, "pclk_asyncaxi_lite_d",
4966 "div_pclk_cam0_50", ENABLE_PCLK_CAM0,
4967 12, CLK_IGNORE_UNUSED, 0),
4968 GATE(CLK_PCLK_ASYNCAXI_LITE_B, "pclk_asyncaxi_lite_b",
4969 "div_pclk_cam0_50", ENABLE_PCLK_CAM0,
4970 11, CLK_IGNORE_UNUSED, 0),
4971 GATE(CLK_PCLK_ASYNCAXI_LITE_A, "pclk_asyncaxi_lite_a",
4972 "div_pclk_cam0_50", ENABLE_PCLK_CAM0,
4973 10, CLK_IGNORE_UNUSED, 0),
4974 GATE(CLK_PCLK_PMU_CAM0, "pclk_pmu_cam0", "div_pclk_cam0_50",
4975 ENABLE_PCLK_CAM0, 9, CLK_IGNORE_UNUSED, 0),
4976 GATE(CLK_PCLK_SYSREG_CAM0, "pclk_sysreg_cam0", "div_pclk_cam0_50",
4977 ENABLE_PCLK_CAM0, 8, CLK_IGNORE_UNUSED, 0),
4978 GATE(CLK_PCLK_CMU_CAM0_LOCAL, "pclk_cmu_cam0_local",
4979 "div_aclk_cam0_200", ENABLE_PCLK_CAM0,
4980 7, CLK_IGNORE_UNUSED, 0),
4981 GATE(CLK_PCLK_CSIS1, "pclk_csis1", "div_aclk_cam0_200",
4982 ENABLE_PCLK_CAM0, 6, CLK_IGNORE_UNUSED, 0),
4983 GATE(CLK_PCLK_CSIS0, "pclk_csis0", "div_aclk_cam0_200",
4984 ENABLE_PCLK_CAM0, 5, CLK_IGNORE_UNUSED, 0),
4985 GATE(CLK_PCLK_3AA1, "pclk_3aa1", "div_pclk_3aa1",
4986 ENABLE_PCLK_CAM0, 4, CLK_IGNORE_UNUSED, 0),
4987 GATE(CLK_PCLK_3AA0, "pclk_3aa0", "div_pclk_3aa0",
4988 ENABLE_PCLK_CAM0, 3, CLK_IGNORE_UNUSED, 0),
4989 GATE(CLK_PCLK_LITE_D, "pclk_lite_d", "div_pclk_lite_d",
4990 ENABLE_PCLK_CAM0, 2, CLK_IGNORE_UNUSED, 0),
4991 GATE(CLK_PCLK_LITE_B, "pclk_lite_b", "div_pclk_lite_b",
4992 ENABLE_PCLK_CAM0, 1, CLK_IGNORE_UNUSED, 0),
4993 GATE(CLK_PCLK_LITE_A, "pclk_lite_a", "div_pclk_lite_a",
4994 ENABLE_PCLK_CAM0, 0, CLK_IGNORE_UNUSED, 0),
4995
4996 /* ENABLE_SCLK_CAM0 */
4997 GATE(CLK_PHYCLK_RXBYTECLKHS0_S4, "phyclk_rxbyteclkhs0_s4",
4998 "mout_phyclk_rxbyteclkhs0_s4_user",
4999 ENABLE_SCLK_CAM0, 8, 0, 0),
5000 GATE(CLK_PHYCLK_RXBYTECLKHS0_S2A, "phyclk_rxbyteclkhs0_s2a",
5001 "mout_phyclk_rxbyteclkhs0_s2a_user",
5002 ENABLE_SCLK_CAM0, 7, 0, 0),
5003 GATE(CLK_SCLK_LITE_FREECNT, "sclk_lite_freecnt",
5004 "mout_sclk_lite_freecnt_c", ENABLE_SCLK_CAM0, 6, 0, 0),
5005 GATE(CLK_SCLK_PIXELASYNCM_3AA1, "sclk_pixelasycm_3aa1",
5006 "div_aclk_3aa1", ENABLE_SCLK_CAM0, 5, 0, 0),
5007 GATE(CLK_SCLK_PIXELASYNCM_3AA0, "sclk_pixelasycm_3aa0",
5008 "div_aclk_3aa0", ENABLE_SCLK_CAM0, 4, 0, 0),
5009 GATE(CLK_SCLK_PIXELASYNCS_3AA0, "sclk_pixelasycs_3aa0",
5010 "div_aclk_3aa0", ENABLE_SCLK_CAM0, 3, 0, 0),
5011 GATE(CLK_SCLK_PIXELASYNCM_LITE_C, "sclk_pixelasyncm_lite_c",
5012 "div_sclk_pixelasync_lite_c",
5013 ENABLE_SCLK_CAM0, 2, 0, 0),
5014 GATE(CLK_SCLK_PIXELASYNCM_LITE_C_INIT, "sclk_pixelasyncm_lite_c_init",
5015 "div_sclk_pixelasync_lite_c_init",
5016 ENABLE_SCLK_CAM0, 1, 0, 0),
5017 GATE(CLK_SCLK_PIXELASYNCS_LITE_C_INIT, "sclk_pixelasyncs_lite_c_init",
5018 "div_sclk_pixelasync_lite_c",
5019 ENABLE_SCLK_CAM0, 0, 0, 0),
5020};
5021
5022static const struct samsung_cmu_info cam0_cmu_info __initconst = {
5023 .mux_clks = cam0_mux_clks,
5024 .nr_mux_clks = ARRAY_SIZE(cam0_mux_clks),
5025 .div_clks = cam0_div_clks,
5026 .nr_div_clks = ARRAY_SIZE(cam0_div_clks),
5027 .gate_clks = cam0_gate_clks,
5028 .nr_gate_clks = ARRAY_SIZE(cam0_gate_clks),
5029 .fixed_clks = cam0_fixed_clks,
5030 .nr_fixed_clks = ARRAY_SIZE(cam0_fixed_clks),
5031 .nr_clk_ids = CAM0_NR_CLK,
5032 .clk_regs = cam0_clk_regs,
5033 .nr_clk_regs = ARRAY_SIZE(cam0_clk_regs),
5034};
5035
5036static void __init exynos5433_cmu_cam0_init(struct device_node *np)
5037{
5038 samsung_cmu_register_one(np, &cam0_cmu_info);
5039}
5040CLK_OF_DECLARE(exynos5433_cmu_cam0, "samsung,exynos5433-cmu-cam0",
5041 exynos5433_cmu_cam0_init);
5042
5043/*
5044 * Register offset definitions for CMU_CAM1
5045 */
5046#define MUX_SEL_CAM10 0x0200
5047#define MUX_SEL_CAM11 0x0204
5048#define MUX_SEL_CAM12 0x0208
5049#define MUX_ENABLE_CAM10 0x0300
5050#define MUX_ENABLE_CAM11 0x0304
5051#define MUX_ENABLE_CAM12 0x0308
5052#define MUX_STAT_CAM10 0x0400
5053#define MUX_STAT_CAM11 0x0404
5054#define MUX_STAT_CAM12 0x0408
5055#define MUX_IGNORE_CAM11 0x0504
5056#define DIV_CAM10 0x0600
5057#define DIV_CAM11 0x0604
5058#define DIV_STAT_CAM10 0x0700
5059#define DIV_STAT_CAM11 0x0704
5060#define ENABLE_ACLK_CAM10 0X0800
5061#define ENABLE_ACLK_CAM11 0X0804
5062#define ENABLE_ACLK_CAM12 0X0808
5063#define ENABLE_PCLK_CAM1 0X0900
5064#define ENABLE_SCLK_CAM1 0X0a00
5065#define ENABLE_IP_CAM10 0X0b00
5066#define ENABLE_IP_CAM11 0X0b04
5067#define ENABLE_IP_CAM12 0X0b08
5068
5069static const unsigned long cam1_clk_regs[] __initconst = {
5070 MUX_SEL_CAM10,
5071 MUX_SEL_CAM11,
5072 MUX_SEL_CAM12,
5073 MUX_ENABLE_CAM10,
5074 MUX_ENABLE_CAM11,
5075 MUX_ENABLE_CAM12,
5076 MUX_IGNORE_CAM11,
5077 DIV_CAM10,
5078 DIV_CAM11,
5079 ENABLE_ACLK_CAM10,
5080 ENABLE_ACLK_CAM11,
5081 ENABLE_ACLK_CAM12,
5082 ENABLE_PCLK_CAM1,
5083 ENABLE_SCLK_CAM1,
5084 ENABLE_IP_CAM10,
5085 ENABLE_IP_CAM11,
5086 ENABLE_IP_CAM12,
5087};
5088
5089PNAME(mout_sclk_isp_uart_user_p) = { "oscclk", "sclk_isp_uart_cam1", };
5090PNAME(mout_sclk_isp_spi1_user_p) = { "oscclk", "sclk_isp_spi1_cam1", };
5091PNAME(mout_sclk_isp_spi0_user_p) = { "oscclk", "sclk_isp_spi0_cam1", };
5092
5093PNAME(mout_aclk_cam1_333_user_p) = { "oscclk", "aclk_cam1_333", };
5094PNAME(mout_aclk_cam1_400_user_p) = { "oscclk", "aclk_cam1_400", };
5095PNAME(mout_aclk_cam1_552_user_p) = { "oscclk", "aclk_cam1_552", };
5096
5097PNAME(mout_phyclk_rxbyteclkhs0_s2b_user_p) = { "oscclk",
5098 "phyclk_rxbyteclkhs0_s2b_phy", };
5099
5100PNAME(mout_aclk_csis2_b_p) = { "mout_aclk_csis2_a",
5101 "mout_aclk_cam1_333_user", };
5102PNAME(mout_aclk_csis2_a_p) = { "mout_aclk_cam1_552_user",
5103 "mout_aclk_cam1_400_user", };
5104
5105PNAME(mout_aclk_fd_b_p) = { "mout_aclk_fd_a",
5106 "mout_aclk_cam1_333_user", };
5107PNAME(mout_aclk_fd_a_p) = { "mout_aclk_cam1_552_user",
5108 "mout_aclk_cam1_400_user", };
5109
5110PNAME(mout_aclk_lite_c_b_p) = { "mout_aclk_lite_c_a",
5111 "mout_aclk_cam1_333_user", };
5112PNAME(mout_aclk_lite_c_a_p) = { "mout_aclk_cam1_552_user",
5113 "mout_aclk_cam1_400_user", };
5114
5115static const struct samsung_fixed_rate_clock cam1_fixed_clks[] __initconst = {
5116 FRATE(CLK_PHYCLK_RXBYTEECLKHS0_S2B, "phyclk_rxbyteclkhs0_s2b_phy", NULL,
5117 0, 100000000),
5118};
5119
5120static const struct samsung_mux_clock cam1_mux_clks[] __initconst = {
5121 /* MUX_SEL_CAM10 */
5122 MUX(CLK_MOUT_SCLK_ISP_UART_USER, "mout_sclk_isp_uart_user",
5123 mout_sclk_isp_uart_user_p, MUX_SEL_CAM10, 20, 1),
5124 MUX(CLK_MOUT_SCLK_ISP_SPI1_USER, "mout_sclk_isp_spi1_user",
5125 mout_sclk_isp_spi1_user_p, MUX_SEL_CAM10, 16, 1),
5126 MUX(CLK_MOUT_SCLK_ISP_SPI0_USER, "mout_sclk_isp_spi0_user",
5127 mout_sclk_isp_spi0_user_p, MUX_SEL_CAM10, 12, 1),
5128 MUX(CLK_MOUT_ACLK_CAM1_333_USER, "mout_aclk_cam1_333_user",
5129 mout_aclk_cam1_333_user_p, MUX_SEL_CAM10, 8, 1),
5130 MUX(CLK_MOUT_ACLK_CAM1_400_USER, "mout_aclk_cam1_400_user",
5131 mout_aclk_cam1_400_user_p, MUX_SEL_CAM10, 4, 1),
5132 MUX(CLK_MOUT_ACLK_CAM1_552_USER, "mout_aclk_cam1_552_user",
5133 mout_aclk_cam1_552_user_p, MUX_SEL_CAM10, 0, 1),
5134
5135 /* MUX_SEL_CAM11 */
5136 MUX(CLK_MOUT_PHYCLK_RXBYTECLKHS0_S2B_USER,
5137 "mout_phyclk_rxbyteclkhs0_s2b_user",
5138 mout_phyclk_rxbyteclkhs0_s2b_user_p,
5139 MUX_SEL_CAM11, 0, 1),
5140
5141 /* MUX_SEL_CAM12 */
5142 MUX(CLK_MOUT_ACLK_CSIS2_B, "mout_aclk_csis2_b", mout_aclk_csis2_b_p,
5143 MUX_SEL_CAM12, 20, 1),
5144 MUX(CLK_MOUT_ACLK_CSIS2_A, "mout_aclk_csis2_a", mout_aclk_csis2_a_p,
5145 MUX_SEL_CAM12, 16, 1),
5146 MUX(CLK_MOUT_ACLK_FD_B, "mout_aclk_fd_b", mout_aclk_fd_b_p,
5147 MUX_SEL_CAM12, 12, 1),
5148 MUX(CLK_MOUT_ACLK_FD_A, "mout_aclk_fd_a", mout_aclk_fd_a_p,
5149 MUX_SEL_CAM12, 8, 1),
5150 MUX(CLK_MOUT_ACLK_LITE_C_B, "mout_aclk_lite_c_b", mout_aclk_lite_c_b_p,
5151 MUX_SEL_CAM12, 4, 1),
5152 MUX(CLK_MOUT_ACLK_LITE_C_A, "mout_aclk_lite_c_a", mout_aclk_lite_c_a_p,
5153 MUX_SEL_CAM12, 0, 1),
5154};
5155
5156static const struct samsung_div_clock cam1_div_clks[] __initconst = {
5157 /* DIV_CAM10 */
5158 DIV(CLK_DIV_SCLK_ISP_MPWM, "div_sclk_isp_mpwm",
5159 "div_pclk_cam1_83", DIV_CAM10, 16, 2),
5160 DIV(CLK_DIV_PCLK_CAM1_83, "div_pclk_cam1_83",
5161 "mout_aclk_cam1_333_user", DIV_CAM10, 12, 2),
5162 DIV(CLK_DIV_PCLK_CAM1_166, "div_pclk_cam1_166",
5163 "mout_aclk_cam1_333_user", DIV_CAM10, 8, 2),
5164 DIV(CLK_DIV_PCLK_DBG_CAM1, "div_pclk_dbg_cam1",
5165 "mout_aclk_cam1_552_user", DIV_CAM10, 4, 3),
5166 DIV(CLK_DIV_ATCLK_CAM1, "div_atclk_cam1", "mout_aclk_cam1_552_user",
5167 DIV_CAM10, 0, 3),
5168
5169 /* DIV_CAM11 */
5170 DIV(CLK_DIV_ACLK_CSIS2, "div_aclk_csis2", "mout_aclk_csis2_b",
5171 DIV_CAM11, 16, 3),
5172 DIV(CLK_DIV_PCLK_FD, "div_pclk_fd", "div_aclk_fd", DIV_CAM11, 12, 2),
5173 DIV(CLK_DIV_ACLK_FD, "div_aclk_fd", "mout_aclk_fd_b", DIV_CAM11, 8, 3),
5174 DIV(CLK_DIV_PCLK_LITE_C, "div_pclk_lite_c", "div_aclk_lite_c",
5175 DIV_CAM11, 4, 2),
5176 DIV(CLK_DIV_ACLK_LITE_C, "div_aclk_lite_c", "mout_aclk_lite_c_b",
5177 DIV_CAM11, 0, 3),
5178};
5179
5180static const struct samsung_gate_clock cam1_gate_clks[] __initconst = {
5181 /* ENABLE_ACLK_CAM10 */
5182 GATE(CLK_ACLK_ISP_GIC, "aclk_isp_gic", "mout_aclk_cam1_333_user",
5183 ENABLE_ACLK_CAM10, 4, 0, 0),
5184 GATE(CLK_ACLK_FD, "aclk_fd", "div_aclk_fd",
5185 ENABLE_ACLK_CAM10, 3, 0, 0),
5186 GATE(CLK_ACLK_LITE_C, "aclk_lite_c", "div_aclk_lite_c",
5187 ENABLE_ACLK_CAM10, 1, 0, 0),
5188 GATE(CLK_ACLK_CSIS2, "aclk_csis2", "div_aclk_csis2",
5189 ENABLE_ACLK_CAM10, 0, 0, 0),
5190
5191 /* ENABLE_ACLK_CAM11 */
5192 GATE(CLK_ACLK_ASYNCAPBM_FD, "aclk_asyncapbm_fd", "div_pclk_fd",
5193 ENABLE_ACLK_CAM11, 29, CLK_IGNORE_UNUSED, 0),
5194 GATE(CLK_ACLK_ASYNCAPBS_FD, "aclk_asyncapbs_fd", "div_pclk_cam1_166",
5195 ENABLE_ACLK_CAM11, 28, CLK_IGNORE_UNUSED, 0),
5196 GATE(CLK_ACLK_ASYNCAPBM_LITE_C, "aclk_asyncapbm_lite_c",
5197 "div_pclk_lite_c", ENABLE_ACLK_CAM11,
5198 27, CLK_IGNORE_UNUSED, 0),
5199 GATE(CLK_ACLK_ASYNCAPBS_LITE_C, "aclk_asyncapbs_lite_c",
5200 "div_pclk_cam1_166", ENABLE_ACLK_CAM11,
5201 26, CLK_IGNORE_UNUSED, 0),
5202 GATE(CLK_ACLK_ASYNCAHBS_SFRISP2H2, "aclk_asyncahbs_sfrisp2h2",
5203 "div_pclk_cam1_83", ENABLE_ACLK_CAM11,
5204 25, CLK_IGNORE_UNUSED, 0),
5205 GATE(CLK_ACLK_ASYNCAHBS_SFRISP2H1, "aclk_asyncahbs_sfrisp2h1",
5206 "div_pclk_cam1_83", ENABLE_ACLK_CAM11,
5207 24, CLK_IGNORE_UNUSED, 0),
5208 GATE(CLK_ACLK_ASYNCAXIM_CA5, "aclk_asyncaxim_ca5",
5209 "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
5210 23, CLK_IGNORE_UNUSED, 0),
5211 GATE(CLK_ACLK_ASYNCAXIS_CA5, "aclk_asyncaxis_ca5",
5212 "mout_aclk_cam1_552_user", ENABLE_ACLK_CAM11,
5213 22, CLK_IGNORE_UNUSED, 0),
5214 GATE(CLK_ACLK_ASYNCAXIS_ISPX2, "aclk_asyncaxis_ispx2",
5215 "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
5216 21, CLK_IGNORE_UNUSED, 0),
5217 GATE(CLK_ACLK_ASYNCAXIS_ISPX1, "aclk_asyncaxis_ispx1",
5218 "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
5219 20, CLK_IGNORE_UNUSED, 0),
5220 GATE(CLK_ACLK_ASYNCAXIS_ISPX0, "aclk_asyncaxis_ispx0",
5221 "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
5222 19, CLK_IGNORE_UNUSED, 0),
5223 GATE(CLK_ACLK_ASYNCAXIM_ISPEX, "aclk_asyncaxim_ispex",
5224 "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM11,
5225 18, CLK_IGNORE_UNUSED, 0),
5226 GATE(CLK_ACLK_ASYNCAXIM_ISP3P, "aclk_asyncaxim_isp3p",
5227 "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM11,
5228 17, CLK_IGNORE_UNUSED, 0),
5229 GATE(CLK_ACLK_ASYNCAXIS_ISP3P, "aclk_asyncaxis_isp3p",
5230 "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
5231 16, CLK_IGNORE_UNUSED, 0),
5232 GATE(CLK_ACLK_ASYNCAXIM_FD, "aclk_asyncaxim_fd",
5233 "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM11,
5234 15, CLK_IGNORE_UNUSED, 0),
5235 GATE(CLK_ACLK_ASYNCAXIS_FD, "aclk_asyncaxis_fd", "div_aclk_fd",
5236 ENABLE_ACLK_CAM11, 14, CLK_IGNORE_UNUSED, 0),
5237 GATE(CLK_ACLK_ASYNCAXIM_LITE_C, "aclk_asyncaxim_lite_c",
5238 "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM11,
5239 13, CLK_IGNORE_UNUSED, 0),
5240 GATE(CLK_ACLK_ASYNCAXIS_LITE_C, "aclk_asyncaxis_lite_c",
5241 "div_aclk_lite_c", ENABLE_ACLK_CAM11,
5242 12, CLK_IGNORE_UNUSED, 0),
5243 GATE(CLK_ACLK_AHB2APB_ISP5P, "aclk_ahb2apb_isp5p", "div_pclk_cam1_83",
5244 ENABLE_ACLK_CAM11, 11, CLK_IGNORE_UNUSED, 0),
5245 GATE(CLK_ACLK_AHB2APB_ISP3P, "aclk_ahb2apb_isp3p", "div_pclk_cam1_83",
5246 ENABLE_ACLK_CAM11, 10, CLK_IGNORE_UNUSED, 0),
5247 GATE(CLK_ACLK_AXI2APB_ISP3P, "aclk_axi2apb_isp3p",
5248 "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM11,
5249 9, CLK_IGNORE_UNUSED, 0),
5250 GATE(CLK_ACLK_AHB_SFRISP2H, "aclk_ahb_sfrisp2h", "div_pclk_cam1_83",
5251 ENABLE_ACLK_CAM11, 8, CLK_IGNORE_UNUSED, 0),
5252 GATE(CLK_ACLK_AXI_ISP_HX_R, "aclk_axi_isp_hx_r", "div_pclk_cam1_166",
5253 ENABLE_ACLK_CAM11, 7, CLK_IGNORE_UNUSED, 0),
5254 GATE(CLK_ACLK_AXI_ISP_CX_R, "aclk_axi_isp_cx_r", "div_pclk_cam1_166",
5255 ENABLE_ACLK_CAM11, 6, CLK_IGNORE_UNUSED, 0),
5256 GATE(CLK_ACLK_AXI_ISP_HX, "aclk_axi_isp_hx", "mout_aclk_cam1_333_user",
5257 ENABLE_ACLK_CAM11, 5, CLK_IGNORE_UNUSED, 0),
5258 GATE(CLK_ACLK_AXI_ISP_CX, "aclk_axi_isp_cx", "mout_aclk_cam1_333_user",
5259 ENABLE_ACLK_CAM11, 4, CLK_IGNORE_UNUSED, 0),
5260 GATE(CLK_ACLK_XIU_ISPX, "aclk_xiu_ispx", "mout_aclk_cam1_333_user",
5261 ENABLE_ACLK_CAM11, 3, CLK_IGNORE_UNUSED, 0),
5262 GATE(CLK_ACLK_XIU_ISPEX, "aclk_xiu_ispex", "mout_aclk_cam1_400_user",
5263 ENABLE_ACLK_CAM11, 2, CLK_IGNORE_UNUSED, 0),
5264 GATE(CLK_ACLK_CAM1NP_333, "aclk_cam1np_333", "mout_aclk_cam1_333_user",
5265 ENABLE_ACLK_CAM11, 1, CLK_IGNORE_UNUSED, 0),
5266 GATE(CLK_ACLK_CAM1ND_400, "aclk_cam1nd_400", "mout_aclk_cam1_400_user",
5267 ENABLE_ACLK_CAM11, 0, CLK_IGNORE_UNUSED, 0),
5268
5269 /* ENABLE_ACLK_CAM12 */
5270 GATE(CLK_ACLK_SMMU_ISPCPU, "aclk_smmu_ispcpu",
5271 "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM12,
5272 10, CLK_IGNORE_UNUSED, 0),
5273 GATE(CLK_ACLK_SMMU_FD, "aclk_smmu_fd", "mout_aclk_cam1_400_user",
5274 ENABLE_ACLK_CAM12, 9, CLK_IGNORE_UNUSED, 0),
5275 GATE(CLK_ACLK_SMMU_LITE_C, "aclk_smmu_lite_c",
5276 "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM12,
5277 8, CLK_IGNORE_UNUSED, 0),
5278 GATE(CLK_ACLK_BTS_ISP3P, "aclk_bts_isp3p", "mout_aclk_cam1_400_user",
5279 ENABLE_ACLK_CAM12, 7, CLK_IGNORE_UNUSED, 0),
5280 GATE(CLK_ACLK_BTS_FD, "aclk_bts_fd", "mout_aclk_cam1_400_user",
5281 ENABLE_ACLK_CAM12, 6, CLK_IGNORE_UNUSED, 0),
5282 GATE(CLK_ACLK_BTS_LITE_C, "aclk_bts_lite_c", "mout_aclk_cam1_400_user",
5283 ENABLE_ACLK_CAM12, 5, CLK_IGNORE_UNUSED, 0),
5284 GATE(CLK_ACLK_AHBDN_SFRISP2H, "aclk_ahbdn_sfrisp2h",
5285 "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM12,
5286 4, CLK_IGNORE_UNUSED, 0),
5287 GATE(CLK_ACLK_AHBDN_ISP5P, "aclk_aclk-shbdn_isp5p",
5288 "mout_aclk_cam1_333_user", ENABLE_ACLK_CAM12,
5289 3, CLK_IGNORE_UNUSED, 0),
5290 GATE(CLK_ACLK_AXIUS_ISP3P, "aclk_axius_isp3p",
5291 "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM12,
5292 2, CLK_IGNORE_UNUSED, 0),
5293 GATE(CLK_ACLK_AXIUS_FD, "aclk_axius_fd", "mout_aclk_cam1_400_user",
5294 ENABLE_ACLK_CAM12, 1, CLK_IGNORE_UNUSED, 0),
5295 GATE(CLK_ACLK_AXIUS_LITE_C, "aclk_axius_lite_c",
5296 "mout_aclk_cam1_400_user", ENABLE_ACLK_CAM12,
5297 0, CLK_IGNORE_UNUSED, 0),
5298
5299 /* ENABLE_PCLK_CAM1 */
5300 GATE(CLK_PCLK_SMMU_ISPCPU, "pclk_smmu_ispcpu", "div_pclk_cam1_166",
5301 ENABLE_PCLK_CAM1, 27, CLK_IGNORE_UNUSED, 0),
5302 GATE(CLK_PCLK_SMMU_FD, "pclk_smmu_fd", "div_pclk_cam1_166",
5303 ENABLE_PCLK_CAM1, 26, CLK_IGNORE_UNUSED, 0),
5304 GATE(CLK_PCLK_SMMU_LITE_C, "pclk_smmu_lite_c", "div_pclk_cam1_166",
5305 ENABLE_PCLK_CAM1, 25, CLK_IGNORE_UNUSED, 0),
5306 GATE(CLK_PCLK_BTS_ISP3P, "pclk_bts_isp3p", "div_pclk_cam1_83",
5307 ENABLE_PCLK_CAM1, 24, CLK_IGNORE_UNUSED, 0),
5308 GATE(CLK_PCLK_BTS_FD, "pclk_bts_fd", "div_pclk_cam1_83",
5309 ENABLE_PCLK_CAM1, 23, CLK_IGNORE_UNUSED, 0),
5310 GATE(CLK_PCLK_BTS_LITE_C, "pclk_bts_lite_c", "div_pclk_cam1_83",
5311 ENABLE_PCLK_CAM1, 22, CLK_IGNORE_UNUSED, 0),
5312 GATE(CLK_PCLK_ASYNCAXIM_CA5, "pclk_asyncaxim_ca5", "div_pclk_cam1_166",
5313 ENABLE_PCLK_CAM1, 21, CLK_IGNORE_UNUSED, 0),
5314 GATE(CLK_PCLK_ASYNCAXIM_ISPEX, "pclk_asyncaxim_ispex",
5315 "div_pclk_cam1_83", ENABLE_PCLK_CAM1,
5316 20, CLK_IGNORE_UNUSED, 0),
5317 GATE(CLK_PCLK_ASYNCAXIM_ISP3P, "pclk_asyncaxim_isp3p",
5318 "div_pclk_cam1_83", ENABLE_PCLK_CAM1,
5319 19, CLK_IGNORE_UNUSED, 0),
5320 GATE(CLK_PCLK_ASYNCAXIM_FD, "pclk_asyncaxim_fd", "div_pclk_cam1_83",
5321 ENABLE_PCLK_CAM1, 18, CLK_IGNORE_UNUSED, 0),
5322 GATE(CLK_PCLK_ASYNCAXIM_LITE_C, "pclk_asyncaxim_lite_c",
5323 "div_pclk_cam1_83", ENABLE_PCLK_CAM1,
5324 17, CLK_IGNORE_UNUSED, 0),
5325 GATE(CLK_PCLK_PMU_CAM1, "pclk_pmu_cam1", "div_pclk_cam1_83",
5326 ENABLE_PCLK_CAM1, 16, CLK_IGNORE_UNUSED, 0),
5327 GATE(CLK_PCLK_SYSREG_CAM1, "pclk_sysreg_cam1", "div_pclk_cam1_83",
5328 ENABLE_PCLK_CAM1, 15, CLK_IGNORE_UNUSED, 0),
5329 GATE(CLK_PCLK_CMU_CAM1_LOCAL, "pclk_cmu_cam1_local",
5330 "div_pclk_cam1_166", ENABLE_PCLK_CAM1,
5331 14, CLK_IGNORE_UNUSED, 0),
5332 GATE(CLK_PCLK_ISP_MCTADC, "pclk_isp_mctadc", "div_pclk_cam1_83",
5333 ENABLE_PCLK_CAM1, 13, CLK_IGNORE_UNUSED, 0),
5334 GATE(CLK_PCLK_ISP_WDT, "pclk_isp_wdt", "div_pclk_cam1_83",
5335 ENABLE_PCLK_CAM1, 12, CLK_IGNORE_UNUSED, 0),
5336 GATE(CLK_PCLK_ISP_PWM, "pclk_isp_pwm", "div_pclk_cam1_83",
5337 ENABLE_PCLK_CAM1, 11, CLK_IGNORE_UNUSED, 0),
5338 GATE(CLK_PCLK_ISP_UART, "pclk_isp_uart", "div_pclk_cam1_83",
5339 ENABLE_PCLK_CAM1, 10, CLK_IGNORE_UNUSED, 0),
5340 GATE(CLK_PCLK_ISP_MCUCTL, "pclk_isp_mcuctl", "div_pclk_cam1_83",
5341 ENABLE_PCLK_CAM1, 9, CLK_IGNORE_UNUSED, 0),
5342 GATE(CLK_PCLK_ISP_SPI1, "pclk_isp_spi1", "div_pclk_cam1_83",
5343 ENABLE_PCLK_CAM1, 8, CLK_IGNORE_UNUSED, 0),
5344 GATE(CLK_PCLK_ISP_SPI0, "pclk_isp_spi0", "div_pclk_cam1_83",
5345 ENABLE_PCLK_CAM1, 7, CLK_IGNORE_UNUSED, 0),
5346 GATE(CLK_PCLK_ISP_I2C2, "pclk_isp_i2c2", "div_pclk_cam1_83",
5347 ENABLE_PCLK_CAM1, 6, CLK_IGNORE_UNUSED, 0),
5348 GATE(CLK_PCLK_ISP_I2C1, "pclk_isp_i2c1", "div_pclk_cam1_83",
5349 ENABLE_PCLK_CAM1, 5, CLK_IGNORE_UNUSED, 0),
5350 GATE(CLK_PCLK_ISP_I2C0, "pclk_isp_i2c0", "div_pclk_cam1_83",
5351 ENABLE_PCLK_CAM1, 4, CLK_IGNORE_UNUSED, 0),
5352 GATE(CLK_PCLK_ISP_MPWM, "pclk_isp_mpwm", "div_pclk_cam1_83",
5353 ENABLE_PCLK_CAM1, 3, CLK_IGNORE_UNUSED, 0),
5354 GATE(CLK_PCLK_FD, "pclk_fd", "div_pclk_fd",
5355 ENABLE_PCLK_CAM1, 3, CLK_IGNORE_UNUSED, 0),
5356 GATE(CLK_PCLK_LITE_C, "pclk_lite_c", "div_pclk_lite_c",
5357 ENABLE_PCLK_CAM1, 1, CLK_IGNORE_UNUSED, 0),
5358 GATE(CLK_PCLK_CSIS2, "pclk_csis2", "div_pclk_cam1_166",
5359 ENABLE_PCLK_CAM1, 0, CLK_IGNORE_UNUSED, 0),
5360
5361 /* ENABLE_SCLK_CAM1 */
5362 GATE(CLK_SCLK_ISP_I2C2, "sclk_isp_i2c2", "oscclk", ENABLE_SCLK_CAM1,
5363 15, 0, 0),
5364 GATE(CLK_SCLK_ISP_I2C1, "sclk_isp_i2c1", "oscclk", ENABLE_SCLK_CAM1,
5365 14, 0, 0),
5366 GATE(CLK_SCLK_ISP_I2C0, "sclk_isp_i2c0", "oscclk", ENABLE_SCLK_CAM1,
5367 13, 0, 0),
5368 GATE(CLK_SCLK_ISP_PWM, "sclk_isp_pwm", "oscclk", ENABLE_SCLK_CAM1,
5369 12, 0, 0),
5370 GATE(CLK_PHYCLK_RXBYTECLKHS0_S2B, "phyclk_rxbyteclkhs0_s2b",
5371 "mout_phyclk_rxbyteclkhs0_s2b_user",
5372 ENABLE_SCLK_CAM1, 11, 0, 0),
5373 GATE(CLK_SCLK_LITE_C_FREECNT, "sclk_lite_c_freecnt", "div_pclk_lite_c",
5374 ENABLE_SCLK_CAM1, 10, 0, 0),
5375 GATE(CLK_SCLK_PIXELASYNCM_FD, "sclk_pixelasyncm_fd", "div_aclk_fd",
5376 ENABLE_SCLK_CAM1, 9, 0, 0),
5377 GATE(CLK_SCLK_ISP_MCTADC, "sclk_isp_mctadc", "sclk_isp_mctadc_cam1",
5378 ENABLE_SCLK_CAM1, 7, 0, 0),
5379 GATE(CLK_SCLK_ISP_UART, "sclk_isp_uart", "mout_sclk_isp_uart_user",
5380 ENABLE_SCLK_CAM1, 6, 0, 0),
5381 GATE(CLK_SCLK_ISP_SPI1, "sclk_isp_spi1", "mout_sclk_isp_spi1_user",
5382 ENABLE_SCLK_CAM1, 5, 0, 0),
5383 GATE(CLK_SCLK_ISP_SPI0, "sclk_isp_spi0", "mout_sclk_isp_spi0_user",
5384 ENABLE_SCLK_CAM1, 4, 0, 0),
5385 GATE(CLK_SCLK_ISP_MPWM, "sclk_isp_mpwm", "div_sclk_isp_mpwm",
5386 ENABLE_SCLK_CAM1, 3, 0, 0),
5387 GATE(CLK_PCLK_DBG_ISP, "sclk_dbg_isp", "div_pclk_dbg_cam1",
5388 ENABLE_SCLK_CAM1, 2, 0, 0),
5389 GATE(CLK_ATCLK_ISP, "atclk_isp", "div_atclk_cam1",
5390 ENABLE_SCLK_CAM1, 1, 0, 0),
5391 GATE(CLK_SCLK_ISP_CA5, "sclk_isp_ca5", "mout_aclk_cam1_552_user",
5392 ENABLE_SCLK_CAM1, 0, 0, 0),
5393};
5394
5395static const struct samsung_cmu_info cam1_cmu_info __initconst = {
5396 .mux_clks = cam1_mux_clks,
5397 .nr_mux_clks = ARRAY_SIZE(cam1_mux_clks),
5398 .div_clks = cam1_div_clks,
5399 .nr_div_clks = ARRAY_SIZE(cam1_div_clks),
5400 .gate_clks = cam1_gate_clks,
5401 .nr_gate_clks = ARRAY_SIZE(cam1_gate_clks),
5402 .fixed_clks = cam1_fixed_clks,
5403 .nr_fixed_clks = ARRAY_SIZE(cam1_fixed_clks),
5404 .nr_clk_ids = CAM1_NR_CLK,
5405 .clk_regs = cam1_clk_regs,
5406 .nr_clk_regs = ARRAY_SIZE(cam1_clk_regs),
5407};
5408
5409static void __init exynos5433_cmu_cam1_init(struct device_node *np)
5410{
5411 samsung_cmu_register_one(np, &cam1_cmu_info);
5412}
5413CLK_OF_DECLARE(exynos5433_cmu_cam1, "samsung,exynos5433-cmu-cam1",
5414 exynos5433_cmu_cam1_init);