xref: /openbmc/linux/drivers/clk/meson/gxbb.c (revision 8e774e02)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (c) 2016 AmLogic, Inc.
4  * Michael Turquette <mturquette@baylibre.com>
5  */
6 
7 #include <linux/clk-provider.h>
8 #include <linux/init.h>
9 #include <linux/of_device.h>
10 #include <linux/platform_device.h>
11 
12 #include "gxbb.h"
13 #include "clk-input.h"
14 #include "clk-regmap.h"
15 #include "clk-pll.h"
16 #include "clk-mpll.h"
17 #include "meson-eeclk.h"
18 #include "vid-pll-div.h"
19 
20 #define IN_PREFIX "ee-in-"
21 
22 static DEFINE_SPINLOCK(meson_clk_lock);
23 
24 static const struct pll_params_table gxbb_gp0_pll_params_table[] = {
25 	PLL_PARAMS(32, 1),
26 	PLL_PARAMS(33, 1),
27 	PLL_PARAMS(34, 1),
28 	PLL_PARAMS(35, 1),
29 	PLL_PARAMS(36, 1),
30 	PLL_PARAMS(37, 1),
31 	PLL_PARAMS(38, 1),
32 	PLL_PARAMS(39, 1),
33 	PLL_PARAMS(40, 1),
34 	PLL_PARAMS(41, 1),
35 	PLL_PARAMS(42, 1),
36 	PLL_PARAMS(43, 1),
37 	PLL_PARAMS(44, 1),
38 	PLL_PARAMS(45, 1),
39 	PLL_PARAMS(46, 1),
40 	PLL_PARAMS(47, 1),
41 	PLL_PARAMS(48, 1),
42 	PLL_PARAMS(49, 1),
43 	PLL_PARAMS(50, 1),
44 	PLL_PARAMS(51, 1),
45 	PLL_PARAMS(52, 1),
46 	PLL_PARAMS(53, 1),
47 	PLL_PARAMS(54, 1),
48 	PLL_PARAMS(55, 1),
49 	PLL_PARAMS(56, 1),
50 	PLL_PARAMS(57, 1),
51 	PLL_PARAMS(58, 1),
52 	PLL_PARAMS(59, 1),
53 	PLL_PARAMS(60, 1),
54 	PLL_PARAMS(61, 1),
55 	PLL_PARAMS(62, 1),
56 	{ /* sentinel */ },
57 };
58 
59 static const struct pll_params_table gxl_gp0_pll_params_table[] = {
60 	PLL_PARAMS(42, 1),
61 	PLL_PARAMS(43, 1),
62 	PLL_PARAMS(44, 1),
63 	PLL_PARAMS(45, 1),
64 	PLL_PARAMS(46, 1),
65 	PLL_PARAMS(47, 1),
66 	PLL_PARAMS(48, 1),
67 	PLL_PARAMS(49, 1),
68 	PLL_PARAMS(50, 1),
69 	PLL_PARAMS(51, 1),
70 	PLL_PARAMS(52, 1),
71 	PLL_PARAMS(53, 1),
72 	PLL_PARAMS(54, 1),
73 	PLL_PARAMS(55, 1),
74 	PLL_PARAMS(56, 1),
75 	PLL_PARAMS(57, 1),
76 	PLL_PARAMS(58, 1),
77 	PLL_PARAMS(59, 1),
78 	PLL_PARAMS(60, 1),
79 	PLL_PARAMS(61, 1),
80 	PLL_PARAMS(62, 1),
81 	PLL_PARAMS(63, 1),
82 	PLL_PARAMS(64, 1),
83 	PLL_PARAMS(65, 1),
84 	PLL_PARAMS(66, 1),
85 	{ /* sentinel */ },
86 };
87 
88 static struct clk_regmap gxbb_fixed_pll_dco = {
89 	.data = &(struct meson_clk_pll_data){
90 		.en = {
91 			.reg_off = HHI_MPLL_CNTL,
92 			.shift   = 30,
93 			.width   = 1,
94 		},
95 		.m = {
96 			.reg_off = HHI_MPLL_CNTL,
97 			.shift   = 0,
98 			.width   = 9,
99 		},
100 		.n = {
101 			.reg_off = HHI_MPLL_CNTL,
102 			.shift   = 9,
103 			.width   = 5,
104 		},
105 		.frac = {
106 			.reg_off = HHI_MPLL_CNTL2,
107 			.shift   = 0,
108 			.width   = 12,
109 		},
110 		.l = {
111 			.reg_off = HHI_MPLL_CNTL,
112 			.shift   = 31,
113 			.width   = 1,
114 		},
115 		.rst = {
116 			.reg_off = HHI_MPLL_CNTL,
117 			.shift   = 29,
118 			.width   = 1,
119 		},
120 	},
121 	.hw.init = &(struct clk_init_data){
122 		.name = "fixed_pll_dco",
123 		.ops = &meson_clk_pll_ro_ops,
124 		.parent_names = (const char *[]){ IN_PREFIX "xtal" },
125 		.num_parents = 1,
126 	},
127 };
128 
129 static struct clk_regmap gxbb_fixed_pll = {
130 	.data = &(struct clk_regmap_div_data){
131 		.offset = HHI_MPLL_CNTL,
132 		.shift = 16,
133 		.width = 2,
134 		.flags = CLK_DIVIDER_POWER_OF_TWO,
135 	},
136 	.hw.init = &(struct clk_init_data){
137 		.name = "fixed_pll",
138 		.ops = &clk_regmap_divider_ro_ops,
139 		.parent_names = (const char *[]){ "fixed_pll_dco" },
140 		.num_parents = 1,
141 		/*
142 		 * This clock won't ever change at runtime so
143 		 * CLK_SET_RATE_PARENT is not required
144 		 */
145 	},
146 };
147 
148 static struct clk_fixed_factor gxbb_hdmi_pll_pre_mult = {
149 	.mult = 2,
150 	.div = 1,
151 	.hw.init = &(struct clk_init_data){
152 		.name = "hdmi_pll_pre_mult",
153 		.ops = &clk_fixed_factor_ops,
154 		.parent_names = (const char *[]){ IN_PREFIX "xtal" },
155 		.num_parents = 1,
156 	},
157 };
158 
159 static struct clk_regmap gxbb_hdmi_pll_dco = {
160 	.data = &(struct meson_clk_pll_data){
161 		.en = {
162 			.reg_off = HHI_HDMI_PLL_CNTL,
163 			.shift   = 30,
164 			.width   = 1,
165 		},
166 		.m = {
167 			.reg_off = HHI_HDMI_PLL_CNTL,
168 			.shift   = 0,
169 			.width   = 9,
170 		},
171 		.n = {
172 			.reg_off = HHI_HDMI_PLL_CNTL,
173 			.shift   = 9,
174 			.width   = 5,
175 		},
176 		.frac = {
177 			.reg_off = HHI_HDMI_PLL_CNTL2,
178 			.shift   = 0,
179 			.width   = 12,
180 		},
181 		.l = {
182 			.reg_off = HHI_HDMI_PLL_CNTL,
183 			.shift   = 31,
184 			.width   = 1,
185 		},
186 		.rst = {
187 			.reg_off = HHI_HDMI_PLL_CNTL,
188 			.shift   = 28,
189 			.width   = 1,
190 		},
191 	},
192 	.hw.init = &(struct clk_init_data){
193 		.name = "hdmi_pll_dco",
194 		.ops = &meson_clk_pll_ro_ops,
195 		.parent_names = (const char *[]){ "hdmi_pll_pre_mult" },
196 		.num_parents = 1,
197 		/*
198 		 * Display directly handle hdmi pll registers ATM, we need
199 		 * NOCACHE to keep our view of the clock as accurate as possible
200 		 */
201 		.flags = CLK_GET_RATE_NOCACHE,
202 	},
203 };
204 
205 static struct clk_regmap gxl_hdmi_pll_dco = {
206 	.data = &(struct meson_clk_pll_data){
207 		.en = {
208 			.reg_off = HHI_HDMI_PLL_CNTL,
209 			.shift   = 30,
210 			.width   = 1,
211 		},
212 		.m = {
213 			.reg_off = HHI_HDMI_PLL_CNTL,
214 			.shift   = 0,
215 			.width   = 9,
216 		},
217 		.n = {
218 			.reg_off = HHI_HDMI_PLL_CNTL,
219 			.shift   = 9,
220 			.width   = 5,
221 		},
222 		/*
223 		 * On gxl, there is a register shift due to
224 		 * HHI_HDMI_PLL_CNTL1 which does not exist on gxbb,
225 		 * so we use the HHI_HDMI_PLL_CNTL2 define from GXBB
226 		 * instead which is defined at the same offset.
227 		 */
228 		.frac = {
229 			.reg_off = HHI_HDMI_PLL_CNTL2,
230 			.shift   = 0,
231 			.width   = 10,
232 		},
233 		.l = {
234 			.reg_off = HHI_HDMI_PLL_CNTL,
235 			.shift   = 31,
236 			.width   = 1,
237 		},
238 		.rst = {
239 			.reg_off = HHI_HDMI_PLL_CNTL,
240 			.shift   = 28,
241 			.width   = 1,
242 		},
243 	},
244 	.hw.init = &(struct clk_init_data){
245 		.name = "hdmi_pll_dco",
246 		.ops = &meson_clk_pll_ro_ops,
247 		.parent_names = (const char *[]){ IN_PREFIX "xtal" },
248 		.num_parents = 1,
249 		/*
250 		 * Display directly handle hdmi pll registers ATM, we need
251 		 * NOCACHE to keep our view of the clock as accurate as possible
252 		 */
253 		.flags = CLK_GET_RATE_NOCACHE,
254 	},
255 };
256 
257 static struct clk_regmap gxbb_hdmi_pll_od = {
258 	.data = &(struct clk_regmap_div_data){
259 		.offset = HHI_HDMI_PLL_CNTL2,
260 		.shift = 16,
261 		.width = 2,
262 		.flags = CLK_DIVIDER_POWER_OF_TWO,
263 	},
264 	.hw.init = &(struct clk_init_data){
265 		.name = "hdmi_pll_od",
266 		.ops = &clk_regmap_divider_ro_ops,
267 		.parent_names = (const char *[]){ "hdmi_pll_dco" },
268 		.num_parents = 1,
269 		.flags = CLK_GET_RATE_NOCACHE | CLK_SET_RATE_PARENT,
270 	},
271 };
272 
273 static struct clk_regmap gxbb_hdmi_pll_od2 = {
274 	.data = &(struct clk_regmap_div_data){
275 		.offset = HHI_HDMI_PLL_CNTL2,
276 		.shift = 22,
277 		.width = 2,
278 		.flags = CLK_DIVIDER_POWER_OF_TWO,
279 	},
280 	.hw.init = &(struct clk_init_data){
281 		.name = "hdmi_pll_od2",
282 		.ops = &clk_regmap_divider_ro_ops,
283 		.parent_names = (const char *[]){ "hdmi_pll_od" },
284 		.num_parents = 1,
285 		.flags = CLK_GET_RATE_NOCACHE | CLK_SET_RATE_PARENT,
286 	},
287 };
288 
289 static struct clk_regmap gxbb_hdmi_pll = {
290 	.data = &(struct clk_regmap_div_data){
291 		.offset = HHI_HDMI_PLL_CNTL2,
292 		.shift = 18,
293 		.width = 2,
294 		.flags = CLK_DIVIDER_POWER_OF_TWO,
295 	},
296 	.hw.init = &(struct clk_init_data){
297 		.name = "hdmi_pll",
298 		.ops = &clk_regmap_divider_ro_ops,
299 		.parent_names = (const char *[]){ "hdmi_pll_od2" },
300 		.num_parents = 1,
301 		.flags = CLK_GET_RATE_NOCACHE | CLK_SET_RATE_PARENT,
302 	},
303 };
304 
305 static struct clk_regmap gxl_hdmi_pll_od = {
306 	.data = &(struct clk_regmap_div_data){
307 		.offset = HHI_HDMI_PLL_CNTL + 8,
308 		.shift = 21,
309 		.width = 2,
310 		.flags = CLK_DIVIDER_POWER_OF_TWO,
311 	},
312 	.hw.init = &(struct clk_init_data){
313 		.name = "hdmi_pll_od",
314 		.ops = &clk_regmap_divider_ro_ops,
315 		.parent_names = (const char *[]){ "hdmi_pll_dco" },
316 		.num_parents = 1,
317 		.flags = CLK_GET_RATE_NOCACHE | CLK_SET_RATE_PARENT,
318 	},
319 };
320 
321 static struct clk_regmap gxl_hdmi_pll_od2 = {
322 	.data = &(struct clk_regmap_div_data){
323 		.offset = HHI_HDMI_PLL_CNTL + 8,
324 		.shift = 23,
325 		.width = 2,
326 		.flags = CLK_DIVIDER_POWER_OF_TWO,
327 	},
328 	.hw.init = &(struct clk_init_data){
329 		.name = "hdmi_pll_od2",
330 		.ops = &clk_regmap_divider_ro_ops,
331 		.parent_names = (const char *[]){ "hdmi_pll_od" },
332 		.num_parents = 1,
333 		.flags = CLK_GET_RATE_NOCACHE | CLK_SET_RATE_PARENT,
334 	},
335 };
336 
337 static struct clk_regmap gxl_hdmi_pll = {
338 	.data = &(struct clk_regmap_div_data){
339 		.offset = HHI_HDMI_PLL_CNTL + 8,
340 		.shift = 19,
341 		.width = 2,
342 		.flags = CLK_DIVIDER_POWER_OF_TWO,
343 	},
344 	.hw.init = &(struct clk_init_data){
345 		.name = "hdmi_pll",
346 		.ops = &clk_regmap_divider_ro_ops,
347 		.parent_names = (const char *[]){ "hdmi_pll_od2" },
348 		.num_parents = 1,
349 		.flags = CLK_GET_RATE_NOCACHE | CLK_SET_RATE_PARENT,
350 	},
351 };
352 
353 static struct clk_regmap gxbb_sys_pll_dco = {
354 	.data = &(struct meson_clk_pll_data){
355 		.en = {
356 			.reg_off = HHI_SYS_PLL_CNTL,
357 			.shift   = 30,
358 			.width   = 1,
359 		},
360 		.m = {
361 			.reg_off = HHI_SYS_PLL_CNTL,
362 			.shift   = 0,
363 			.width   = 9,
364 		},
365 		.n = {
366 			.reg_off = HHI_SYS_PLL_CNTL,
367 			.shift   = 9,
368 			.width   = 5,
369 		},
370 		.l = {
371 			.reg_off = HHI_SYS_PLL_CNTL,
372 			.shift   = 31,
373 			.width   = 1,
374 		},
375 		.rst = {
376 			.reg_off = HHI_SYS_PLL_CNTL,
377 			.shift   = 29,
378 			.width   = 1,
379 		},
380 	},
381 	.hw.init = &(struct clk_init_data){
382 		.name = "sys_pll_dco",
383 		.ops = &meson_clk_pll_ro_ops,
384 		.parent_names = (const char *[]){ IN_PREFIX "xtal" },
385 		.num_parents = 1,
386 	},
387 };
388 
389 static struct clk_regmap gxbb_sys_pll = {
390 	.data = &(struct clk_regmap_div_data){
391 		.offset = HHI_SYS_PLL_CNTL,
392 		.shift = 10,
393 		.width = 2,
394 		.flags = CLK_DIVIDER_POWER_OF_TWO,
395 	},
396 	.hw.init = &(struct clk_init_data){
397 		.name = "sys_pll",
398 		.ops = &clk_regmap_divider_ro_ops,
399 		.parent_names = (const char *[]){ "sys_pll_dco" },
400 		.num_parents = 1,
401 		.flags = CLK_SET_RATE_PARENT,
402 	},
403 };
404 
405 static const struct reg_sequence gxbb_gp0_init_regs[] = {
406 	{ .reg = HHI_GP0_PLL_CNTL2,	.def = 0x69c80000 },
407 	{ .reg = HHI_GP0_PLL_CNTL3,	.def = 0x0a5590c4 },
408 	{ .reg = HHI_GP0_PLL_CNTL4,	.def = 0x0000500d },
409 };
410 
411 static struct clk_regmap gxbb_gp0_pll_dco = {
412 	.data = &(struct meson_clk_pll_data){
413 		.en = {
414 			.reg_off = HHI_GP0_PLL_CNTL,
415 			.shift   = 30,
416 			.width   = 1,
417 		},
418 		.m = {
419 			.reg_off = HHI_GP0_PLL_CNTL,
420 			.shift   = 0,
421 			.width   = 9,
422 		},
423 		.n = {
424 			.reg_off = HHI_GP0_PLL_CNTL,
425 			.shift   = 9,
426 			.width   = 5,
427 		},
428 		.l = {
429 			.reg_off = HHI_GP0_PLL_CNTL,
430 			.shift   = 31,
431 			.width   = 1,
432 		},
433 		.rst = {
434 			.reg_off = HHI_GP0_PLL_CNTL,
435 			.shift   = 29,
436 			.width   = 1,
437 		},
438 		.table = gxbb_gp0_pll_params_table,
439 		.init_regs = gxbb_gp0_init_regs,
440 		.init_count = ARRAY_SIZE(gxbb_gp0_init_regs),
441 	},
442 	.hw.init = &(struct clk_init_data){
443 		.name = "gp0_pll_dco",
444 		.ops = &meson_clk_pll_ops,
445 		.parent_names = (const char *[]){ IN_PREFIX "xtal" },
446 		.num_parents = 1,
447 	},
448 };
449 
450 static const struct reg_sequence gxl_gp0_init_regs[] = {
451 	{ .reg = HHI_GP0_PLL_CNTL1,	.def = 0xc084b000 },
452 	{ .reg = HHI_GP0_PLL_CNTL2,	.def = 0xb75020be },
453 	{ .reg = HHI_GP0_PLL_CNTL3,	.def = 0x0a59a288 },
454 	{ .reg = HHI_GP0_PLL_CNTL4,	.def = 0xc000004d },
455 	{ .reg = HHI_GP0_PLL_CNTL5,	.def = 0x00078000 },
456 };
457 
458 static struct clk_regmap gxl_gp0_pll_dco = {
459 	.data = &(struct meson_clk_pll_data){
460 		.en = {
461 			.reg_off = HHI_GP0_PLL_CNTL,
462 			.shift   = 30,
463 			.width   = 1,
464 		},
465 		.m = {
466 			.reg_off = HHI_GP0_PLL_CNTL,
467 			.shift   = 0,
468 			.width   = 9,
469 		},
470 		.n = {
471 			.reg_off = HHI_GP0_PLL_CNTL,
472 			.shift   = 9,
473 			.width   = 5,
474 		},
475 		.frac = {
476 			.reg_off = HHI_GP0_PLL_CNTL1,
477 			.shift   = 0,
478 			.width   = 10,
479 		},
480 		.l = {
481 			.reg_off = HHI_GP0_PLL_CNTL,
482 			.shift   = 31,
483 			.width   = 1,
484 		},
485 		.rst = {
486 			.reg_off = HHI_GP0_PLL_CNTL,
487 			.shift   = 29,
488 			.width   = 1,
489 		},
490 		.table = gxl_gp0_pll_params_table,
491 		.init_regs = gxl_gp0_init_regs,
492 		.init_count = ARRAY_SIZE(gxl_gp0_init_regs),
493 	},
494 	.hw.init = &(struct clk_init_data){
495 		.name = "gp0_pll_dco",
496 		.ops = &meson_clk_pll_ops,
497 		.parent_names = (const char *[]){ IN_PREFIX "xtal" },
498 		.num_parents = 1,
499 	},
500 };
501 
502 static struct clk_regmap gxbb_gp0_pll = {
503 	.data = &(struct clk_regmap_div_data){
504 		.offset = HHI_GP0_PLL_CNTL,
505 		.shift = 16,
506 		.width = 2,
507 		.flags = CLK_DIVIDER_POWER_OF_TWO,
508 	},
509 	.hw.init = &(struct clk_init_data){
510 		.name = "gp0_pll",
511 		.ops = &clk_regmap_divider_ops,
512 		.parent_names = (const char *[]){ "gp0_pll_dco" },
513 		.num_parents = 1,
514 		.flags = CLK_SET_RATE_PARENT,
515 	},
516 };
517 
518 static struct clk_fixed_factor gxbb_fclk_div2_div = {
519 	.mult = 1,
520 	.div = 2,
521 	.hw.init = &(struct clk_init_data){
522 		.name = "fclk_div2_div",
523 		.ops = &clk_fixed_factor_ops,
524 		.parent_names = (const char *[]){ "fixed_pll" },
525 		.num_parents = 1,
526 	},
527 };
528 
529 static struct clk_regmap gxbb_fclk_div2 = {
530 	.data = &(struct clk_regmap_gate_data){
531 		.offset = HHI_MPLL_CNTL6,
532 		.bit_idx = 27,
533 	},
534 	.hw.init = &(struct clk_init_data){
535 		.name = "fclk_div2",
536 		.ops = &clk_regmap_gate_ops,
537 		.parent_names = (const char *[]){ "fclk_div2_div" },
538 		.num_parents = 1,
539 		.flags = CLK_IS_CRITICAL,
540 	},
541 };
542 
543 static struct clk_fixed_factor gxbb_fclk_div3_div = {
544 	.mult = 1,
545 	.div = 3,
546 	.hw.init = &(struct clk_init_data){
547 		.name = "fclk_div3_div",
548 		.ops = &clk_fixed_factor_ops,
549 		.parent_names = (const char *[]){ "fixed_pll" },
550 		.num_parents = 1,
551 	},
552 };
553 
554 static struct clk_regmap gxbb_fclk_div3 = {
555 	.data = &(struct clk_regmap_gate_data){
556 		.offset = HHI_MPLL_CNTL6,
557 		.bit_idx = 28,
558 	},
559 	.hw.init = &(struct clk_init_data){
560 		.name = "fclk_div3",
561 		.ops = &clk_regmap_gate_ops,
562 		.parent_names = (const char *[]){ "fclk_div3_div" },
563 		.num_parents = 1,
564 		/*
565 		 * FIXME:
566 		 * This clock, as fdiv2, is used by the SCPI FW and is required
567 		 * by the platform to operate correctly.
568 		 * Until the following condition are met, we need this clock to
569 		 * be marked as critical:
570 		 * a) The SCPI generic driver claims and enable all the clocks
571 		 *    it needs
572 		 * b) CCF has a clock hand-off mechanism to make the sure the
573 		 *    clock stays on until the proper driver comes along
574 		 */
575 		.flags = CLK_IS_CRITICAL,
576 	},
577 };
578 
579 static struct clk_fixed_factor gxbb_fclk_div4_div = {
580 	.mult = 1,
581 	.div = 4,
582 	.hw.init = &(struct clk_init_data){
583 		.name = "fclk_div4_div",
584 		.ops = &clk_fixed_factor_ops,
585 		.parent_names = (const char *[]){ "fixed_pll" },
586 		.num_parents = 1,
587 	},
588 };
589 
590 static struct clk_regmap gxbb_fclk_div4 = {
591 	.data = &(struct clk_regmap_gate_data){
592 		.offset = HHI_MPLL_CNTL6,
593 		.bit_idx = 29,
594 	},
595 	.hw.init = &(struct clk_init_data){
596 		.name = "fclk_div4",
597 		.ops = &clk_regmap_gate_ops,
598 		.parent_names = (const char *[]){ "fclk_div4_div" },
599 		.num_parents = 1,
600 	},
601 };
602 
603 static struct clk_fixed_factor gxbb_fclk_div5_div = {
604 	.mult = 1,
605 	.div = 5,
606 	.hw.init = &(struct clk_init_data){
607 		.name = "fclk_div5_div",
608 		.ops = &clk_fixed_factor_ops,
609 		.parent_names = (const char *[]){ "fixed_pll" },
610 		.num_parents = 1,
611 	},
612 };
613 
614 static struct clk_regmap gxbb_fclk_div5 = {
615 	.data = &(struct clk_regmap_gate_data){
616 		.offset = HHI_MPLL_CNTL6,
617 		.bit_idx = 30,
618 	},
619 	.hw.init = &(struct clk_init_data){
620 		.name = "fclk_div5",
621 		.ops = &clk_regmap_gate_ops,
622 		.parent_names = (const char *[]){ "fclk_div5_div" },
623 		.num_parents = 1,
624 	},
625 };
626 
627 static struct clk_fixed_factor gxbb_fclk_div7_div = {
628 	.mult = 1,
629 	.div = 7,
630 	.hw.init = &(struct clk_init_data){
631 		.name = "fclk_div7_div",
632 		.ops = &clk_fixed_factor_ops,
633 		.parent_names = (const char *[]){ "fixed_pll" },
634 		.num_parents = 1,
635 	},
636 };
637 
638 static struct clk_regmap gxbb_fclk_div7 = {
639 	.data = &(struct clk_regmap_gate_data){
640 		.offset = HHI_MPLL_CNTL6,
641 		.bit_idx = 31,
642 	},
643 	.hw.init = &(struct clk_init_data){
644 		.name = "fclk_div7",
645 		.ops = &clk_regmap_gate_ops,
646 		.parent_names = (const char *[]){ "fclk_div7_div" },
647 		.num_parents = 1,
648 	},
649 };
650 
651 static struct clk_regmap gxbb_mpll_prediv = {
652 	.data = &(struct clk_regmap_div_data){
653 		.offset = HHI_MPLL_CNTL5,
654 		.shift = 12,
655 		.width = 1,
656 	},
657 	.hw.init = &(struct clk_init_data){
658 		.name = "mpll_prediv",
659 		.ops = &clk_regmap_divider_ro_ops,
660 		.parent_names = (const char *[]){ "fixed_pll" },
661 		.num_parents = 1,
662 	},
663 };
664 
665 static struct clk_regmap gxbb_mpll0_div = {
666 	.data = &(struct meson_clk_mpll_data){
667 		.sdm = {
668 			.reg_off = HHI_MPLL_CNTL7,
669 			.shift   = 0,
670 			.width   = 14,
671 		},
672 		.sdm_en = {
673 			.reg_off = HHI_MPLL_CNTL7,
674 			.shift   = 15,
675 			.width	 = 1,
676 		},
677 		.n2 = {
678 			.reg_off = HHI_MPLL_CNTL7,
679 			.shift   = 16,
680 			.width   = 9,
681 		},
682 		.lock = &meson_clk_lock,
683 	},
684 	.hw.init = &(struct clk_init_data){
685 		.name = "mpll0_div",
686 		.ops = &meson_clk_mpll_ops,
687 		.parent_names = (const char *[]){ "mpll_prediv" },
688 		.num_parents = 1,
689 	},
690 };
691 
692 static struct clk_regmap gxbb_mpll0 = {
693 	.data = &(struct clk_regmap_gate_data){
694 		.offset = HHI_MPLL_CNTL7,
695 		.bit_idx = 14,
696 	},
697 	.hw.init = &(struct clk_init_data){
698 		.name = "mpll0",
699 		.ops = &clk_regmap_gate_ops,
700 		.parent_names = (const char *[]){ "mpll0_div" },
701 		.num_parents = 1,
702 		.flags = CLK_SET_RATE_PARENT,
703 	},
704 };
705 
706 static struct clk_regmap gxbb_mpll1_div = {
707 	.data = &(struct meson_clk_mpll_data){
708 		.sdm = {
709 			.reg_off = HHI_MPLL_CNTL8,
710 			.shift   = 0,
711 			.width   = 14,
712 		},
713 		.sdm_en = {
714 			.reg_off = HHI_MPLL_CNTL8,
715 			.shift   = 15,
716 			.width	 = 1,
717 		},
718 		.n2 = {
719 			.reg_off = HHI_MPLL_CNTL8,
720 			.shift   = 16,
721 			.width   = 9,
722 		},
723 		.lock = &meson_clk_lock,
724 	},
725 	.hw.init = &(struct clk_init_data){
726 		.name = "mpll1_div",
727 		.ops = &meson_clk_mpll_ops,
728 		.parent_names = (const char *[]){ "mpll_prediv" },
729 		.num_parents = 1,
730 	},
731 };
732 
733 static struct clk_regmap gxbb_mpll1 = {
734 	.data = &(struct clk_regmap_gate_data){
735 		.offset = HHI_MPLL_CNTL8,
736 		.bit_idx = 14,
737 	},
738 	.hw.init = &(struct clk_init_data){
739 		.name = "mpll1",
740 		.ops = &clk_regmap_gate_ops,
741 		.parent_names = (const char *[]){ "mpll1_div" },
742 		.num_parents = 1,
743 		.flags = CLK_SET_RATE_PARENT,
744 	},
745 };
746 
747 static struct clk_regmap gxbb_mpll2_div = {
748 	.data = &(struct meson_clk_mpll_data){
749 		.sdm = {
750 			.reg_off = HHI_MPLL_CNTL9,
751 			.shift   = 0,
752 			.width   = 14,
753 		},
754 		.sdm_en = {
755 			.reg_off = HHI_MPLL_CNTL9,
756 			.shift   = 15,
757 			.width	 = 1,
758 		},
759 		.n2 = {
760 			.reg_off = HHI_MPLL_CNTL9,
761 			.shift   = 16,
762 			.width   = 9,
763 		},
764 		.lock = &meson_clk_lock,
765 	},
766 	.hw.init = &(struct clk_init_data){
767 		.name = "mpll2_div",
768 		.ops = &meson_clk_mpll_ops,
769 		.parent_names = (const char *[]){ "mpll_prediv" },
770 		.num_parents = 1,
771 	},
772 };
773 
774 static struct clk_regmap gxbb_mpll2 = {
775 	.data = &(struct clk_regmap_gate_data){
776 		.offset = HHI_MPLL_CNTL9,
777 		.bit_idx = 14,
778 	},
779 	.hw.init = &(struct clk_init_data){
780 		.name = "mpll2",
781 		.ops = &clk_regmap_gate_ops,
782 		.parent_names = (const char *[]){ "mpll2_div" },
783 		.num_parents = 1,
784 		.flags = CLK_SET_RATE_PARENT,
785 	},
786 };
787 
788 static u32 mux_table_clk81[]	= { 0, 2, 3, 4, 5, 6, 7 };
789 static const char * const clk81_parent_names[] = {
790 	IN_PREFIX "xtal", "fclk_div7", "mpll1", "mpll2", "fclk_div4",
791 	"fclk_div3", "fclk_div5"
792 };
793 
794 static struct clk_regmap gxbb_mpeg_clk_sel = {
795 	.data = &(struct clk_regmap_mux_data){
796 		.offset = HHI_MPEG_CLK_CNTL,
797 		.mask = 0x7,
798 		.shift = 12,
799 		.table = mux_table_clk81,
800 	},
801 	.hw.init = &(struct clk_init_data){
802 		.name = "mpeg_clk_sel",
803 		.ops = &clk_regmap_mux_ro_ops,
804 		/*
805 		 * bits 14:12 selects from 8 possible parents:
806 		 * xtal, 1'b0 (wtf), fclk_div7, mpll_clkout1, mpll_clkout2,
807 		 * fclk_div4, fclk_div3, fclk_div5
808 		 */
809 		.parent_names = clk81_parent_names,
810 		.num_parents = ARRAY_SIZE(clk81_parent_names),
811 	},
812 };
813 
814 static struct clk_regmap gxbb_mpeg_clk_div = {
815 	.data = &(struct clk_regmap_div_data){
816 		.offset = HHI_MPEG_CLK_CNTL,
817 		.shift = 0,
818 		.width = 7,
819 	},
820 	.hw.init = &(struct clk_init_data){
821 		.name = "mpeg_clk_div",
822 		.ops = &clk_regmap_divider_ro_ops,
823 		.parent_names = (const char *[]){ "mpeg_clk_sel" },
824 		.num_parents = 1,
825 	},
826 };
827 
828 /* the mother of dragons gates */
829 static struct clk_regmap gxbb_clk81 = {
830 	.data = &(struct clk_regmap_gate_data){
831 		.offset = HHI_MPEG_CLK_CNTL,
832 		.bit_idx = 7,
833 	},
834 	.hw.init = &(struct clk_init_data){
835 		.name = "clk81",
836 		.ops = &clk_regmap_gate_ops,
837 		.parent_names = (const char *[]){ "mpeg_clk_div" },
838 		.num_parents = 1,
839 		.flags = CLK_IS_CRITICAL,
840 	},
841 };
842 
843 static struct clk_regmap gxbb_sar_adc_clk_sel = {
844 	.data = &(struct clk_regmap_mux_data){
845 		.offset = HHI_SAR_CLK_CNTL,
846 		.mask = 0x3,
847 		.shift = 9,
848 	},
849 	.hw.init = &(struct clk_init_data){
850 		.name = "sar_adc_clk_sel",
851 		.ops = &clk_regmap_mux_ops,
852 		/* NOTE: The datasheet doesn't list the parents for bit 10 */
853 		.parent_names = (const char *[]){ IN_PREFIX "xtal", "clk81", },
854 		.num_parents = 2,
855 	},
856 };
857 
858 static struct clk_regmap gxbb_sar_adc_clk_div = {
859 	.data = &(struct clk_regmap_div_data){
860 		.offset = HHI_SAR_CLK_CNTL,
861 		.shift = 0,
862 		.width = 8,
863 	},
864 	.hw.init = &(struct clk_init_data){
865 		.name = "sar_adc_clk_div",
866 		.ops = &clk_regmap_divider_ops,
867 		.parent_names = (const char *[]){ "sar_adc_clk_sel" },
868 		.num_parents = 1,
869 	},
870 };
871 
872 static struct clk_regmap gxbb_sar_adc_clk = {
873 	.data = &(struct clk_regmap_gate_data){
874 		.offset = HHI_SAR_CLK_CNTL,
875 		.bit_idx = 8,
876 	},
877 	.hw.init = &(struct clk_init_data){
878 		.name = "sar_adc_clk",
879 		.ops = &clk_regmap_gate_ops,
880 		.parent_names = (const char *[]){ "sar_adc_clk_div" },
881 		.num_parents = 1,
882 		.flags = CLK_SET_RATE_PARENT,
883 	},
884 };
885 
886 /*
887  * The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
888  * muxed by a glitch-free switch.
889  */
890 
891 static const char * const gxbb_mali_0_1_parent_names[] = {
892 	IN_PREFIX "xtal", "gp0_pll", "mpll2", "mpll1", "fclk_div7",
893 	"fclk_div4", "fclk_div3", "fclk_div5"
894 };
895 
896 static struct clk_regmap gxbb_mali_0_sel = {
897 	.data = &(struct clk_regmap_mux_data){
898 		.offset = HHI_MALI_CLK_CNTL,
899 		.mask = 0x7,
900 		.shift = 9,
901 	},
902 	.hw.init = &(struct clk_init_data){
903 		.name = "mali_0_sel",
904 		.ops = &clk_regmap_mux_ops,
905 		/*
906 		 * bits 10:9 selects from 8 possible parents:
907 		 * xtal, gp0_pll, mpll2, mpll1, fclk_div7,
908 		 * fclk_div4, fclk_div3, fclk_div5
909 		 */
910 		.parent_names = gxbb_mali_0_1_parent_names,
911 		.num_parents = 8,
912 		.flags = CLK_SET_RATE_NO_REPARENT,
913 	},
914 };
915 
916 static struct clk_regmap gxbb_mali_0_div = {
917 	.data = &(struct clk_regmap_div_data){
918 		.offset = HHI_MALI_CLK_CNTL,
919 		.shift = 0,
920 		.width = 7,
921 	},
922 	.hw.init = &(struct clk_init_data){
923 		.name = "mali_0_div",
924 		.ops = &clk_regmap_divider_ops,
925 		.parent_names = (const char *[]){ "mali_0_sel" },
926 		.num_parents = 1,
927 		.flags = CLK_SET_RATE_NO_REPARENT,
928 	},
929 };
930 
931 static struct clk_regmap gxbb_mali_0 = {
932 	.data = &(struct clk_regmap_gate_data){
933 		.offset = HHI_MALI_CLK_CNTL,
934 		.bit_idx = 8,
935 	},
936 	.hw.init = &(struct clk_init_data){
937 		.name = "mali_0",
938 		.ops = &clk_regmap_gate_ops,
939 		.parent_names = (const char *[]){ "mali_0_div" },
940 		.num_parents = 1,
941 		.flags = CLK_SET_RATE_PARENT,
942 	},
943 };
944 
945 static struct clk_regmap gxbb_mali_1_sel = {
946 	.data = &(struct clk_regmap_mux_data){
947 		.offset = HHI_MALI_CLK_CNTL,
948 		.mask = 0x7,
949 		.shift = 25,
950 	},
951 	.hw.init = &(struct clk_init_data){
952 		.name = "mali_1_sel",
953 		.ops = &clk_regmap_mux_ops,
954 		/*
955 		 * bits 10:9 selects from 8 possible parents:
956 		 * xtal, gp0_pll, mpll2, mpll1, fclk_div7,
957 		 * fclk_div4, fclk_div3, fclk_div5
958 		 */
959 		.parent_names = gxbb_mali_0_1_parent_names,
960 		.num_parents = 8,
961 		.flags = CLK_SET_RATE_NO_REPARENT,
962 	},
963 };
964 
965 static struct clk_regmap gxbb_mali_1_div = {
966 	.data = &(struct clk_regmap_div_data){
967 		.offset = HHI_MALI_CLK_CNTL,
968 		.shift = 16,
969 		.width = 7,
970 	},
971 	.hw.init = &(struct clk_init_data){
972 		.name = "mali_1_div",
973 		.ops = &clk_regmap_divider_ops,
974 		.parent_names = (const char *[]){ "mali_1_sel" },
975 		.num_parents = 1,
976 		.flags = CLK_SET_RATE_NO_REPARENT,
977 	},
978 };
979 
980 static struct clk_regmap gxbb_mali_1 = {
981 	.data = &(struct clk_regmap_gate_data){
982 		.offset = HHI_MALI_CLK_CNTL,
983 		.bit_idx = 24,
984 	},
985 	.hw.init = &(struct clk_init_data){
986 		.name = "mali_1",
987 		.ops = &clk_regmap_gate_ops,
988 		.parent_names = (const char *[]){ "mali_1_div" },
989 		.num_parents = 1,
990 		.flags = CLK_SET_RATE_PARENT,
991 	},
992 };
993 
994 static const char * const gxbb_mali_parent_names[] = {
995 	"mali_0", "mali_1"
996 };
997 
998 static struct clk_regmap gxbb_mali = {
999 	.data = &(struct clk_regmap_mux_data){
1000 		.offset = HHI_MALI_CLK_CNTL,
1001 		.mask = 1,
1002 		.shift = 31,
1003 	},
1004 	.hw.init = &(struct clk_init_data){
1005 		.name = "mali",
1006 		.ops = &clk_regmap_mux_ops,
1007 		.parent_names = gxbb_mali_parent_names,
1008 		.num_parents = 2,
1009 		.flags = CLK_SET_RATE_NO_REPARENT,
1010 	},
1011 };
1012 
1013 static struct clk_regmap gxbb_cts_amclk_sel = {
1014 	.data = &(struct clk_regmap_mux_data){
1015 		.offset = HHI_AUD_CLK_CNTL,
1016 		.mask = 0x3,
1017 		.shift = 9,
1018 		.table = (u32[]){ 1, 2, 3 },
1019 		.flags = CLK_MUX_ROUND_CLOSEST,
1020 	},
1021 	.hw.init = &(struct clk_init_data){
1022 		.name = "cts_amclk_sel",
1023 		.ops = &clk_regmap_mux_ops,
1024 		.parent_names = (const char *[]){ "mpll0", "mpll1", "mpll2" },
1025 		.num_parents = 3,
1026 	},
1027 };
1028 
1029 static struct clk_regmap gxbb_cts_amclk_div = {
1030 	.data = &(struct clk_regmap_div_data) {
1031 		.offset = HHI_AUD_CLK_CNTL,
1032 		.shift = 0,
1033 		.width = 8,
1034 		.flags = CLK_DIVIDER_ROUND_CLOSEST,
1035 	},
1036 	.hw.init = &(struct clk_init_data){
1037 		.name = "cts_amclk_div",
1038 		.ops = &clk_regmap_divider_ops,
1039 		.parent_names = (const char *[]){ "cts_amclk_sel" },
1040 		.num_parents = 1,
1041 		.flags = CLK_SET_RATE_PARENT,
1042 	},
1043 };
1044 
1045 static struct clk_regmap gxbb_cts_amclk = {
1046 	.data = &(struct clk_regmap_gate_data){
1047 		.offset = HHI_AUD_CLK_CNTL,
1048 		.bit_idx = 8,
1049 	},
1050 	.hw.init = &(struct clk_init_data){
1051 		.name = "cts_amclk",
1052 		.ops = &clk_regmap_gate_ops,
1053 		.parent_names = (const char *[]){ "cts_amclk_div" },
1054 		.num_parents = 1,
1055 		.flags = CLK_SET_RATE_PARENT,
1056 	},
1057 };
1058 
1059 static struct clk_regmap gxbb_cts_mclk_i958_sel = {
1060 	.data = &(struct clk_regmap_mux_data){
1061 		.offset = HHI_AUD_CLK_CNTL2,
1062 		.mask = 0x3,
1063 		.shift = 25,
1064 		.table = (u32[]){ 1, 2, 3 },
1065 		.flags = CLK_MUX_ROUND_CLOSEST,
1066 	},
1067 	.hw.init = &(struct clk_init_data) {
1068 		.name = "cts_mclk_i958_sel",
1069 		.ops = &clk_regmap_mux_ops,
1070 		.parent_names = (const char *[]){ "mpll0", "mpll1", "mpll2" },
1071 		.num_parents = 3,
1072 	},
1073 };
1074 
1075 static struct clk_regmap gxbb_cts_mclk_i958_div = {
1076 	.data = &(struct clk_regmap_div_data){
1077 		.offset = HHI_AUD_CLK_CNTL2,
1078 		.shift = 16,
1079 		.width = 8,
1080 		.flags = CLK_DIVIDER_ROUND_CLOSEST,
1081 	},
1082 	.hw.init = &(struct clk_init_data) {
1083 		.name = "cts_mclk_i958_div",
1084 		.ops = &clk_regmap_divider_ops,
1085 		.parent_names = (const char *[]){ "cts_mclk_i958_sel" },
1086 		.num_parents = 1,
1087 		.flags = CLK_SET_RATE_PARENT,
1088 	},
1089 };
1090 
1091 static struct clk_regmap gxbb_cts_mclk_i958 = {
1092 	.data = &(struct clk_regmap_gate_data){
1093 		.offset = HHI_AUD_CLK_CNTL2,
1094 		.bit_idx = 24,
1095 	},
1096 	.hw.init = &(struct clk_init_data){
1097 		.name = "cts_mclk_i958",
1098 		.ops = &clk_regmap_gate_ops,
1099 		.parent_names = (const char *[]){ "cts_mclk_i958_div" },
1100 		.num_parents = 1,
1101 		.flags = CLK_SET_RATE_PARENT,
1102 	},
1103 };
1104 
1105 static struct clk_regmap gxbb_cts_i958 = {
1106 	.data = &(struct clk_regmap_mux_data){
1107 		.offset = HHI_AUD_CLK_CNTL2,
1108 		.mask = 0x1,
1109 		.shift = 27,
1110 		},
1111 	.hw.init = &(struct clk_init_data){
1112 		.name = "cts_i958",
1113 		.ops = &clk_regmap_mux_ops,
1114 		.parent_names = (const char *[]){ "cts_amclk", "cts_mclk_i958" },
1115 		.num_parents = 2,
1116 		/*
1117 		 *The parent is specific to origin of the audio data. Let the
1118 		 * consumer choose the appropriate parent
1119 		 */
1120 		.flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
1121 	},
1122 };
1123 
1124 static struct clk_regmap gxbb_32k_clk_div = {
1125 	.data = &(struct clk_regmap_div_data){
1126 		.offset = HHI_32K_CLK_CNTL,
1127 		.shift = 0,
1128 		.width = 14,
1129 	},
1130 	.hw.init = &(struct clk_init_data){
1131 		.name = "32k_clk_div",
1132 		.ops = &clk_regmap_divider_ops,
1133 		.parent_names = (const char *[]){ "32k_clk_sel" },
1134 		.num_parents = 1,
1135 		.flags = CLK_SET_RATE_PARENT | CLK_DIVIDER_ROUND_CLOSEST,
1136 	},
1137 };
1138 
1139 static struct clk_regmap gxbb_32k_clk = {
1140 	.data = &(struct clk_regmap_gate_data){
1141 		.offset = HHI_32K_CLK_CNTL,
1142 		.bit_idx = 15,
1143 	},
1144 	.hw.init = &(struct clk_init_data){
1145 		.name = "32k_clk",
1146 		.ops = &clk_regmap_gate_ops,
1147 		.parent_names = (const char *[]){ "32k_clk_div" },
1148 		.num_parents = 1,
1149 		.flags = CLK_SET_RATE_PARENT,
1150 	},
1151 };
1152 
1153 static const char * const gxbb_32k_clk_parent_names[] = {
1154 	IN_PREFIX "xtal", "cts_slow_oscin", "fclk_div3", "fclk_div5"
1155 };
1156 
1157 static struct clk_regmap gxbb_32k_clk_sel = {
1158 	.data = &(struct clk_regmap_mux_data){
1159 		.offset = HHI_32K_CLK_CNTL,
1160 		.mask = 0x3,
1161 		.shift = 16,
1162 		},
1163 	.hw.init = &(struct clk_init_data){
1164 		.name = "32k_clk_sel",
1165 		.ops = &clk_regmap_mux_ops,
1166 		.parent_names = gxbb_32k_clk_parent_names,
1167 		.num_parents = 4,
1168 		.flags = CLK_SET_RATE_PARENT,
1169 	},
1170 };
1171 
1172 static const char * const gxbb_sd_emmc_clk0_parent_names[] = {
1173 	IN_PREFIX "xtal", "fclk_div2", "fclk_div3", "fclk_div5", "fclk_div7",
1174 
1175 	/*
1176 	 * Following these parent clocks, we should also have had mpll2, mpll3
1177 	 * and gp0_pll but these clocks are too precious to be used here. All
1178 	 * the necessary rates for MMC and NAND operation can be acheived using
1179 	 * xtal or fclk_div clocks
1180 	 */
1181 };
1182 
1183 /* SDIO clock */
1184 static struct clk_regmap gxbb_sd_emmc_a_clk0_sel = {
1185 	.data = &(struct clk_regmap_mux_data){
1186 		.offset = HHI_SD_EMMC_CLK_CNTL,
1187 		.mask = 0x7,
1188 		.shift = 9,
1189 	},
1190 	.hw.init = &(struct clk_init_data) {
1191 		.name = "sd_emmc_a_clk0_sel",
1192 		.ops = &clk_regmap_mux_ops,
1193 		.parent_names = gxbb_sd_emmc_clk0_parent_names,
1194 		.num_parents = ARRAY_SIZE(gxbb_sd_emmc_clk0_parent_names),
1195 		.flags = CLK_SET_RATE_PARENT,
1196 	},
1197 };
1198 
1199 static struct clk_regmap gxbb_sd_emmc_a_clk0_div = {
1200 	.data = &(struct clk_regmap_div_data){
1201 		.offset = HHI_SD_EMMC_CLK_CNTL,
1202 		.shift = 0,
1203 		.width = 7,
1204 		.flags = CLK_DIVIDER_ROUND_CLOSEST,
1205 	},
1206 	.hw.init = &(struct clk_init_data) {
1207 		.name = "sd_emmc_a_clk0_div",
1208 		.ops = &clk_regmap_divider_ops,
1209 		.parent_names = (const char *[]){ "sd_emmc_a_clk0_sel" },
1210 		.num_parents = 1,
1211 		.flags = CLK_SET_RATE_PARENT,
1212 	},
1213 };
1214 
1215 static struct clk_regmap gxbb_sd_emmc_a_clk0 = {
1216 	.data = &(struct clk_regmap_gate_data){
1217 		.offset = HHI_SD_EMMC_CLK_CNTL,
1218 		.bit_idx = 7,
1219 	},
1220 	.hw.init = &(struct clk_init_data){
1221 		.name = "sd_emmc_a_clk0",
1222 		.ops = &clk_regmap_gate_ops,
1223 		.parent_names = (const char *[]){ "sd_emmc_a_clk0_div" },
1224 		.num_parents = 1,
1225 		.flags = CLK_SET_RATE_PARENT,
1226 	},
1227 };
1228 
1229 /* SDcard clock */
1230 static struct clk_regmap gxbb_sd_emmc_b_clk0_sel = {
1231 	.data = &(struct clk_regmap_mux_data){
1232 		.offset = HHI_SD_EMMC_CLK_CNTL,
1233 		.mask = 0x7,
1234 		.shift = 25,
1235 	},
1236 	.hw.init = &(struct clk_init_data) {
1237 		.name = "sd_emmc_b_clk0_sel",
1238 		.ops = &clk_regmap_mux_ops,
1239 		.parent_names = gxbb_sd_emmc_clk0_parent_names,
1240 		.num_parents = ARRAY_SIZE(gxbb_sd_emmc_clk0_parent_names),
1241 		.flags = CLK_SET_RATE_PARENT,
1242 	},
1243 };
1244 
1245 static struct clk_regmap gxbb_sd_emmc_b_clk0_div = {
1246 	.data = &(struct clk_regmap_div_data){
1247 		.offset = HHI_SD_EMMC_CLK_CNTL,
1248 		.shift = 16,
1249 		.width = 7,
1250 		.flags = CLK_DIVIDER_ROUND_CLOSEST,
1251 	},
1252 	.hw.init = &(struct clk_init_data) {
1253 		.name = "sd_emmc_b_clk0_div",
1254 		.ops = &clk_regmap_divider_ops,
1255 		.parent_names = (const char *[]){ "sd_emmc_b_clk0_sel" },
1256 		.num_parents = 1,
1257 		.flags = CLK_SET_RATE_PARENT,
1258 	},
1259 };
1260 
1261 static struct clk_regmap gxbb_sd_emmc_b_clk0 = {
1262 	.data = &(struct clk_regmap_gate_data){
1263 		.offset = HHI_SD_EMMC_CLK_CNTL,
1264 		.bit_idx = 23,
1265 	},
1266 	.hw.init = &(struct clk_init_data){
1267 		.name = "sd_emmc_b_clk0",
1268 		.ops = &clk_regmap_gate_ops,
1269 		.parent_names = (const char *[]){ "sd_emmc_b_clk0_div" },
1270 		.num_parents = 1,
1271 		.flags = CLK_SET_RATE_PARENT,
1272 	},
1273 };
1274 
1275 /* EMMC/NAND clock */
1276 static struct clk_regmap gxbb_sd_emmc_c_clk0_sel = {
1277 	.data = &(struct clk_regmap_mux_data){
1278 		.offset = HHI_NAND_CLK_CNTL,
1279 		.mask = 0x7,
1280 		.shift = 9,
1281 	},
1282 	.hw.init = &(struct clk_init_data) {
1283 		.name = "sd_emmc_c_clk0_sel",
1284 		.ops = &clk_regmap_mux_ops,
1285 		.parent_names = gxbb_sd_emmc_clk0_parent_names,
1286 		.num_parents = ARRAY_SIZE(gxbb_sd_emmc_clk0_parent_names),
1287 		.flags = CLK_SET_RATE_PARENT,
1288 	},
1289 };
1290 
1291 static struct clk_regmap gxbb_sd_emmc_c_clk0_div = {
1292 	.data = &(struct clk_regmap_div_data){
1293 		.offset = HHI_NAND_CLK_CNTL,
1294 		.shift = 0,
1295 		.width = 7,
1296 		.flags = CLK_DIVIDER_ROUND_CLOSEST,
1297 	},
1298 	.hw.init = &(struct clk_init_data) {
1299 		.name = "sd_emmc_c_clk0_div",
1300 		.ops = &clk_regmap_divider_ops,
1301 		.parent_names = (const char *[]){ "sd_emmc_c_clk0_sel" },
1302 		.num_parents = 1,
1303 		.flags = CLK_SET_RATE_PARENT,
1304 	},
1305 };
1306 
1307 static struct clk_regmap gxbb_sd_emmc_c_clk0 = {
1308 	.data = &(struct clk_regmap_gate_data){
1309 		.offset = HHI_NAND_CLK_CNTL,
1310 		.bit_idx = 7,
1311 	},
1312 	.hw.init = &(struct clk_init_data){
1313 		.name = "sd_emmc_c_clk0",
1314 		.ops = &clk_regmap_gate_ops,
1315 		.parent_names = (const char *[]){ "sd_emmc_c_clk0_div" },
1316 		.num_parents = 1,
1317 		.flags = CLK_SET_RATE_PARENT,
1318 	},
1319 };
1320 
1321 /* VPU Clock */
1322 
1323 static const char * const gxbb_vpu_parent_names[] = {
1324 	"fclk_div4", "fclk_div3", "fclk_div5", "fclk_div7"
1325 };
1326 
1327 static struct clk_regmap gxbb_vpu_0_sel = {
1328 	.data = &(struct clk_regmap_mux_data){
1329 		.offset = HHI_VPU_CLK_CNTL,
1330 		.mask = 0x3,
1331 		.shift = 9,
1332 	},
1333 	.hw.init = &(struct clk_init_data){
1334 		.name = "vpu_0_sel",
1335 		.ops = &clk_regmap_mux_ops,
1336 		/*
1337 		 * bits 9:10 selects from 4 possible parents:
1338 		 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1339 		 */
1340 		.parent_names = gxbb_vpu_parent_names,
1341 		.num_parents = ARRAY_SIZE(gxbb_vpu_parent_names),
1342 		.flags = CLK_SET_RATE_NO_REPARENT,
1343 	},
1344 };
1345 
1346 static struct clk_regmap gxbb_vpu_0_div = {
1347 	.data = &(struct clk_regmap_div_data){
1348 		.offset = HHI_VPU_CLK_CNTL,
1349 		.shift = 0,
1350 		.width = 7,
1351 	},
1352 	.hw.init = &(struct clk_init_data){
1353 		.name = "vpu_0_div",
1354 		.ops = &clk_regmap_divider_ops,
1355 		.parent_names = (const char *[]){ "vpu_0_sel" },
1356 		.num_parents = 1,
1357 		.flags = CLK_SET_RATE_PARENT,
1358 	},
1359 };
1360 
1361 static struct clk_regmap gxbb_vpu_0 = {
1362 	.data = &(struct clk_regmap_gate_data){
1363 		.offset = HHI_VPU_CLK_CNTL,
1364 		.bit_idx = 8,
1365 	},
1366 	.hw.init = &(struct clk_init_data) {
1367 		.name = "vpu_0",
1368 		.ops = &clk_regmap_gate_ops,
1369 		.parent_names = (const char *[]){ "vpu_0_div" },
1370 		.num_parents = 1,
1371 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1372 	},
1373 };
1374 
1375 static struct clk_regmap gxbb_vpu_1_sel = {
1376 	.data = &(struct clk_regmap_mux_data){
1377 		.offset = HHI_VPU_CLK_CNTL,
1378 		.mask = 0x3,
1379 		.shift = 25,
1380 	},
1381 	.hw.init = &(struct clk_init_data){
1382 		.name = "vpu_1_sel",
1383 		.ops = &clk_regmap_mux_ops,
1384 		/*
1385 		 * bits 25:26 selects from 4 possible parents:
1386 		 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1387 		 */
1388 		.parent_names = gxbb_vpu_parent_names,
1389 		.num_parents = ARRAY_SIZE(gxbb_vpu_parent_names),
1390 		.flags = CLK_SET_RATE_NO_REPARENT,
1391 	},
1392 };
1393 
1394 static struct clk_regmap gxbb_vpu_1_div = {
1395 	.data = &(struct clk_regmap_div_data){
1396 		.offset = HHI_VPU_CLK_CNTL,
1397 		.shift = 16,
1398 		.width = 7,
1399 	},
1400 	.hw.init = &(struct clk_init_data){
1401 		.name = "vpu_1_div",
1402 		.ops = &clk_regmap_divider_ops,
1403 		.parent_names = (const char *[]){ "vpu_1_sel" },
1404 		.num_parents = 1,
1405 		.flags = CLK_SET_RATE_PARENT,
1406 	},
1407 };
1408 
1409 static struct clk_regmap gxbb_vpu_1 = {
1410 	.data = &(struct clk_regmap_gate_data){
1411 		.offset = HHI_VPU_CLK_CNTL,
1412 		.bit_idx = 24,
1413 	},
1414 	.hw.init = &(struct clk_init_data) {
1415 		.name = "vpu_1",
1416 		.ops = &clk_regmap_gate_ops,
1417 		.parent_names = (const char *[]){ "vpu_1_div" },
1418 		.num_parents = 1,
1419 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1420 	},
1421 };
1422 
1423 static struct clk_regmap gxbb_vpu = {
1424 	.data = &(struct clk_regmap_mux_data){
1425 		.offset = HHI_VPU_CLK_CNTL,
1426 		.mask = 1,
1427 		.shift = 31,
1428 	},
1429 	.hw.init = &(struct clk_init_data){
1430 		.name = "vpu",
1431 		.ops = &clk_regmap_mux_ops,
1432 		/*
1433 		 * bit 31 selects from 2 possible parents:
1434 		 * vpu_0 or vpu_1
1435 		 */
1436 		.parent_names = (const char *[]){ "vpu_0", "vpu_1" },
1437 		.num_parents = 2,
1438 		.flags = CLK_SET_RATE_NO_REPARENT,
1439 	},
1440 };
1441 
1442 /* VAPB Clock */
1443 
1444 static const char * const gxbb_vapb_parent_names[] = {
1445 	"fclk_div4", "fclk_div3", "fclk_div5", "fclk_div7"
1446 };
1447 
1448 static struct clk_regmap gxbb_vapb_0_sel = {
1449 	.data = &(struct clk_regmap_mux_data){
1450 		.offset = HHI_VAPBCLK_CNTL,
1451 		.mask = 0x3,
1452 		.shift = 9,
1453 	},
1454 	.hw.init = &(struct clk_init_data){
1455 		.name = "vapb_0_sel",
1456 		.ops = &clk_regmap_mux_ops,
1457 		/*
1458 		 * bits 9:10 selects from 4 possible parents:
1459 		 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1460 		 */
1461 		.parent_names = gxbb_vapb_parent_names,
1462 		.num_parents = ARRAY_SIZE(gxbb_vapb_parent_names),
1463 		.flags = CLK_SET_RATE_NO_REPARENT,
1464 	},
1465 };
1466 
1467 static struct clk_regmap gxbb_vapb_0_div = {
1468 	.data = &(struct clk_regmap_div_data){
1469 		.offset = HHI_VAPBCLK_CNTL,
1470 		.shift = 0,
1471 		.width = 7,
1472 	},
1473 	.hw.init = &(struct clk_init_data){
1474 		.name = "vapb_0_div",
1475 		.ops = &clk_regmap_divider_ops,
1476 		.parent_names = (const char *[]){ "vapb_0_sel" },
1477 		.num_parents = 1,
1478 		.flags = CLK_SET_RATE_PARENT,
1479 	},
1480 };
1481 
1482 static struct clk_regmap gxbb_vapb_0 = {
1483 	.data = &(struct clk_regmap_gate_data){
1484 		.offset = HHI_VAPBCLK_CNTL,
1485 		.bit_idx = 8,
1486 	},
1487 	.hw.init = &(struct clk_init_data) {
1488 		.name = "vapb_0",
1489 		.ops = &clk_regmap_gate_ops,
1490 		.parent_names = (const char *[]){ "vapb_0_div" },
1491 		.num_parents = 1,
1492 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1493 	},
1494 };
1495 
1496 static struct clk_regmap gxbb_vapb_1_sel = {
1497 	.data = &(struct clk_regmap_mux_data){
1498 		.offset = HHI_VAPBCLK_CNTL,
1499 		.mask = 0x3,
1500 		.shift = 25,
1501 	},
1502 	.hw.init = &(struct clk_init_data){
1503 		.name = "vapb_1_sel",
1504 		.ops = &clk_regmap_mux_ops,
1505 		/*
1506 		 * bits 25:26 selects from 4 possible parents:
1507 		 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1508 		 */
1509 		.parent_names = gxbb_vapb_parent_names,
1510 		.num_parents = ARRAY_SIZE(gxbb_vapb_parent_names),
1511 		.flags = CLK_SET_RATE_NO_REPARENT,
1512 	},
1513 };
1514 
1515 static struct clk_regmap gxbb_vapb_1_div = {
1516 	.data = &(struct clk_regmap_div_data){
1517 		.offset = HHI_VAPBCLK_CNTL,
1518 		.shift = 16,
1519 		.width = 7,
1520 	},
1521 	.hw.init = &(struct clk_init_data){
1522 		.name = "vapb_1_div",
1523 		.ops = &clk_regmap_divider_ops,
1524 		.parent_names = (const char *[]){ "vapb_1_sel" },
1525 		.num_parents = 1,
1526 		.flags = CLK_SET_RATE_PARENT,
1527 	},
1528 };
1529 
1530 static struct clk_regmap gxbb_vapb_1 = {
1531 	.data = &(struct clk_regmap_gate_data){
1532 		.offset = HHI_VAPBCLK_CNTL,
1533 		.bit_idx = 24,
1534 	},
1535 	.hw.init = &(struct clk_init_data) {
1536 		.name = "vapb_1",
1537 		.ops = &clk_regmap_gate_ops,
1538 		.parent_names = (const char *[]){ "vapb_1_div" },
1539 		.num_parents = 1,
1540 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1541 	},
1542 };
1543 
1544 static struct clk_regmap gxbb_vapb_sel = {
1545 	.data = &(struct clk_regmap_mux_data){
1546 		.offset = HHI_VAPBCLK_CNTL,
1547 		.mask = 1,
1548 		.shift = 31,
1549 	},
1550 	.hw.init = &(struct clk_init_data){
1551 		.name = "vapb_sel",
1552 		.ops = &clk_regmap_mux_ops,
1553 		/*
1554 		 * bit 31 selects from 2 possible parents:
1555 		 * vapb_0 or vapb_1
1556 		 */
1557 		.parent_names = (const char *[]){ "vapb_0", "vapb_1" },
1558 		.num_parents = 2,
1559 		.flags = CLK_SET_RATE_NO_REPARENT,
1560 	},
1561 };
1562 
1563 static struct clk_regmap gxbb_vapb = {
1564 	.data = &(struct clk_regmap_gate_data){
1565 		.offset = HHI_VAPBCLK_CNTL,
1566 		.bit_idx = 30,
1567 	},
1568 	.hw.init = &(struct clk_init_data) {
1569 		.name = "vapb",
1570 		.ops = &clk_regmap_gate_ops,
1571 		.parent_names = (const char *[]){ "vapb_sel" },
1572 		.num_parents = 1,
1573 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1574 	},
1575 };
1576 
1577 /* Video Clocks */
1578 
1579 static struct clk_regmap gxbb_vid_pll_div = {
1580 	.data = &(struct meson_vid_pll_div_data){
1581 		.val = {
1582 			.reg_off = HHI_VID_PLL_CLK_DIV,
1583 			.shift   = 0,
1584 			.width   = 15,
1585 		},
1586 		.sel = {
1587 			.reg_off = HHI_VID_PLL_CLK_DIV,
1588 			.shift   = 16,
1589 			.width   = 2,
1590 		},
1591 	},
1592 	.hw.init = &(struct clk_init_data) {
1593 		.name = "vid_pll_div",
1594 		.ops = &meson_vid_pll_div_ro_ops,
1595 		.parent_names = (const char *[]){ "hdmi_pll" },
1596 		.num_parents = 1,
1597 		.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
1598 	},
1599 };
1600 
1601 static const char * const gxbb_vid_pll_parent_names[] = { "vid_pll_div", "hdmi_pll" };
1602 
1603 static struct clk_regmap gxbb_vid_pll_sel = {
1604 	.data = &(struct clk_regmap_mux_data){
1605 		.offset = HHI_VID_PLL_CLK_DIV,
1606 		.mask = 0x1,
1607 		.shift = 18,
1608 	},
1609 	.hw.init = &(struct clk_init_data){
1610 		.name = "vid_pll_sel",
1611 		.ops = &clk_regmap_mux_ops,
1612 		/*
1613 		 * bit 18 selects from 2 possible parents:
1614 		 * vid_pll_div or hdmi_pll
1615 		 */
1616 		.parent_names = gxbb_vid_pll_parent_names,
1617 		.num_parents = ARRAY_SIZE(gxbb_vid_pll_parent_names),
1618 		.flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE,
1619 	},
1620 };
1621 
1622 static struct clk_regmap gxbb_vid_pll = {
1623 	.data = &(struct clk_regmap_gate_data){
1624 		.offset = HHI_VID_PLL_CLK_DIV,
1625 		.bit_idx = 19,
1626 	},
1627 	.hw.init = &(struct clk_init_data) {
1628 		.name = "vid_pll",
1629 		.ops = &clk_regmap_gate_ops,
1630 		.parent_names = (const char *[]){ "vid_pll_sel" },
1631 		.num_parents = 1,
1632 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1633 	},
1634 };
1635 
1636 static const char * const gxbb_vclk_parent_names[] = {
1637 	"vid_pll", "fclk_div4", "fclk_div3", "fclk_div5", "vid_pll",
1638 	"fclk_div7", "mpll1",
1639 };
1640 
1641 static struct clk_regmap gxbb_vclk_sel = {
1642 	.data = &(struct clk_regmap_mux_data){
1643 		.offset = HHI_VID_CLK_CNTL,
1644 		.mask = 0x7,
1645 		.shift = 16,
1646 	},
1647 	.hw.init = &(struct clk_init_data){
1648 		.name = "vclk_sel",
1649 		.ops = &clk_regmap_mux_ops,
1650 		/*
1651 		 * bits 16:18 selects from 8 possible parents:
1652 		 * vid_pll, fclk_div4, fclk_div3, fclk_div5,
1653 		 * vid_pll, fclk_div7, mp1
1654 		 */
1655 		.parent_names = gxbb_vclk_parent_names,
1656 		.num_parents = ARRAY_SIZE(gxbb_vclk_parent_names),
1657 		.flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE,
1658 	},
1659 };
1660 
1661 static struct clk_regmap gxbb_vclk2_sel = {
1662 	.data = &(struct clk_regmap_mux_data){
1663 		.offset = HHI_VIID_CLK_CNTL,
1664 		.mask = 0x7,
1665 		.shift = 16,
1666 	},
1667 	.hw.init = &(struct clk_init_data){
1668 		.name = "vclk2_sel",
1669 		.ops = &clk_regmap_mux_ops,
1670 		/*
1671 		 * bits 16:18 selects from 8 possible parents:
1672 		 * vid_pll, fclk_div4, fclk_div3, fclk_div5,
1673 		 * vid_pll, fclk_div7, mp1
1674 		 */
1675 		.parent_names = gxbb_vclk_parent_names,
1676 		.num_parents = ARRAY_SIZE(gxbb_vclk_parent_names),
1677 		.flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE,
1678 	},
1679 };
1680 
1681 static struct clk_regmap gxbb_vclk_input = {
1682 	.data = &(struct clk_regmap_gate_data){
1683 		.offset = HHI_VID_CLK_DIV,
1684 		.bit_idx = 16,
1685 	},
1686 	.hw.init = &(struct clk_init_data) {
1687 		.name = "vclk_input",
1688 		.ops = &clk_regmap_gate_ops,
1689 		.parent_names = (const char *[]){ "vclk_sel" },
1690 		.num_parents = 1,
1691 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1692 	},
1693 };
1694 
1695 static struct clk_regmap gxbb_vclk2_input = {
1696 	.data = &(struct clk_regmap_gate_data){
1697 		.offset = HHI_VIID_CLK_DIV,
1698 		.bit_idx = 16,
1699 	},
1700 	.hw.init = &(struct clk_init_data) {
1701 		.name = "vclk2_input",
1702 		.ops = &clk_regmap_gate_ops,
1703 		.parent_names = (const char *[]){ "vclk2_sel" },
1704 		.num_parents = 1,
1705 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1706 	},
1707 };
1708 
1709 static struct clk_regmap gxbb_vclk_div = {
1710 	.data = &(struct clk_regmap_div_data){
1711 		.offset = HHI_VID_CLK_DIV,
1712 		.shift = 0,
1713 		.width = 8,
1714 	},
1715 	.hw.init = &(struct clk_init_data){
1716 		.name = "vclk_div",
1717 		.ops = &clk_regmap_divider_ops,
1718 		.parent_names = (const char *[]){ "vclk_input" },
1719 		.num_parents = 1,
1720 		.flags = CLK_GET_RATE_NOCACHE,
1721 	},
1722 };
1723 
1724 static struct clk_regmap gxbb_vclk2_div = {
1725 	.data = &(struct clk_regmap_div_data){
1726 		.offset = HHI_VIID_CLK_DIV,
1727 		.shift = 0,
1728 		.width = 8,
1729 	},
1730 	.hw.init = &(struct clk_init_data){
1731 		.name = "vclk2_div",
1732 		.ops = &clk_regmap_divider_ops,
1733 		.parent_names = (const char *[]){ "vclk2_input" },
1734 		.num_parents = 1,
1735 		.flags = CLK_GET_RATE_NOCACHE,
1736 	},
1737 };
1738 
1739 static struct clk_regmap gxbb_vclk = {
1740 	.data = &(struct clk_regmap_gate_data){
1741 		.offset = HHI_VID_CLK_CNTL,
1742 		.bit_idx = 19,
1743 	},
1744 	.hw.init = &(struct clk_init_data) {
1745 		.name = "vclk",
1746 		.ops = &clk_regmap_gate_ops,
1747 		.parent_names = (const char *[]){ "vclk_div" },
1748 		.num_parents = 1,
1749 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1750 	},
1751 };
1752 
1753 static struct clk_regmap gxbb_vclk2 = {
1754 	.data = &(struct clk_regmap_gate_data){
1755 		.offset = HHI_VIID_CLK_CNTL,
1756 		.bit_idx = 19,
1757 	},
1758 	.hw.init = &(struct clk_init_data) {
1759 		.name = "vclk2",
1760 		.ops = &clk_regmap_gate_ops,
1761 		.parent_names = (const char *[]){ "vclk2_div" },
1762 		.num_parents = 1,
1763 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1764 	},
1765 };
1766 
1767 static struct clk_regmap gxbb_vclk_div1 = {
1768 	.data = &(struct clk_regmap_gate_data){
1769 		.offset = HHI_VID_CLK_CNTL,
1770 		.bit_idx = 0,
1771 	},
1772 	.hw.init = &(struct clk_init_data) {
1773 		.name = "vclk_div1",
1774 		.ops = &clk_regmap_gate_ops,
1775 		.parent_names = (const char *[]){ "vclk" },
1776 		.num_parents = 1,
1777 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1778 	},
1779 };
1780 
1781 static struct clk_regmap gxbb_vclk_div2_en = {
1782 	.data = &(struct clk_regmap_gate_data){
1783 		.offset = HHI_VID_CLK_CNTL,
1784 		.bit_idx = 1,
1785 	},
1786 	.hw.init = &(struct clk_init_data) {
1787 		.name = "vclk_div2_en",
1788 		.ops = &clk_regmap_gate_ops,
1789 		.parent_names = (const char *[]){ "vclk" },
1790 		.num_parents = 1,
1791 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1792 	},
1793 };
1794 
1795 static struct clk_regmap gxbb_vclk_div4_en = {
1796 	.data = &(struct clk_regmap_gate_data){
1797 		.offset = HHI_VID_CLK_CNTL,
1798 		.bit_idx = 2,
1799 	},
1800 	.hw.init = &(struct clk_init_data) {
1801 		.name = "vclk_div4_en",
1802 		.ops = &clk_regmap_gate_ops,
1803 		.parent_names = (const char *[]){ "vclk" },
1804 		.num_parents = 1,
1805 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1806 	},
1807 };
1808 
1809 static struct clk_regmap gxbb_vclk_div6_en = {
1810 	.data = &(struct clk_regmap_gate_data){
1811 		.offset = HHI_VID_CLK_CNTL,
1812 		.bit_idx = 3,
1813 	},
1814 	.hw.init = &(struct clk_init_data) {
1815 		.name = "vclk_div6_en",
1816 		.ops = &clk_regmap_gate_ops,
1817 		.parent_names = (const char *[]){ "vclk" },
1818 		.num_parents = 1,
1819 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1820 	},
1821 };
1822 
1823 static struct clk_regmap gxbb_vclk_div12_en = {
1824 	.data = &(struct clk_regmap_gate_data){
1825 		.offset = HHI_VID_CLK_CNTL,
1826 		.bit_idx = 4,
1827 	},
1828 	.hw.init = &(struct clk_init_data) {
1829 		.name = "vclk_div12_en",
1830 		.ops = &clk_regmap_gate_ops,
1831 		.parent_names = (const char *[]){ "vclk" },
1832 		.num_parents = 1,
1833 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1834 	},
1835 };
1836 
1837 static struct clk_regmap gxbb_vclk2_div1 = {
1838 	.data = &(struct clk_regmap_gate_data){
1839 		.offset = HHI_VIID_CLK_CNTL,
1840 		.bit_idx = 0,
1841 	},
1842 	.hw.init = &(struct clk_init_data) {
1843 		.name = "vclk2_div1",
1844 		.ops = &clk_regmap_gate_ops,
1845 		.parent_names = (const char *[]){ "vclk2" },
1846 		.num_parents = 1,
1847 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1848 	},
1849 };
1850 
1851 static struct clk_regmap gxbb_vclk2_div2_en = {
1852 	.data = &(struct clk_regmap_gate_data){
1853 		.offset = HHI_VIID_CLK_CNTL,
1854 		.bit_idx = 1,
1855 	},
1856 	.hw.init = &(struct clk_init_data) {
1857 		.name = "vclk2_div2_en",
1858 		.ops = &clk_regmap_gate_ops,
1859 		.parent_names = (const char *[]){ "vclk2" },
1860 		.num_parents = 1,
1861 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1862 	},
1863 };
1864 
1865 static struct clk_regmap gxbb_vclk2_div4_en = {
1866 	.data = &(struct clk_regmap_gate_data){
1867 		.offset = HHI_VIID_CLK_CNTL,
1868 		.bit_idx = 2,
1869 	},
1870 	.hw.init = &(struct clk_init_data) {
1871 		.name = "vclk2_div4_en",
1872 		.ops = &clk_regmap_gate_ops,
1873 		.parent_names = (const char *[]){ "vclk2" },
1874 		.num_parents = 1,
1875 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1876 	},
1877 };
1878 
1879 static struct clk_regmap gxbb_vclk2_div6_en = {
1880 	.data = &(struct clk_regmap_gate_data){
1881 		.offset = HHI_VIID_CLK_CNTL,
1882 		.bit_idx = 3,
1883 	},
1884 	.hw.init = &(struct clk_init_data) {
1885 		.name = "vclk2_div6_en",
1886 		.ops = &clk_regmap_gate_ops,
1887 		.parent_names = (const char *[]){ "vclk2" },
1888 		.num_parents = 1,
1889 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1890 	},
1891 };
1892 
1893 static struct clk_regmap gxbb_vclk2_div12_en = {
1894 	.data = &(struct clk_regmap_gate_data){
1895 		.offset = HHI_VIID_CLK_CNTL,
1896 		.bit_idx = 4,
1897 	},
1898 	.hw.init = &(struct clk_init_data) {
1899 		.name = "vclk2_div12_en",
1900 		.ops = &clk_regmap_gate_ops,
1901 		.parent_names = (const char *[]){ "vclk2" },
1902 		.num_parents = 1,
1903 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
1904 	},
1905 };
1906 
1907 static struct clk_fixed_factor gxbb_vclk_div2 = {
1908 	.mult = 1,
1909 	.div = 2,
1910 	.hw.init = &(struct clk_init_data){
1911 		.name = "vclk_div2",
1912 		.ops = &clk_fixed_factor_ops,
1913 		.parent_names = (const char *[]){ "vclk_div2_en" },
1914 		.num_parents = 1,
1915 	},
1916 };
1917 
1918 static struct clk_fixed_factor gxbb_vclk_div4 = {
1919 	.mult = 1,
1920 	.div = 4,
1921 	.hw.init = &(struct clk_init_data){
1922 		.name = "vclk_div4",
1923 		.ops = &clk_fixed_factor_ops,
1924 		.parent_names = (const char *[]){ "vclk_div4_en" },
1925 		.num_parents = 1,
1926 	},
1927 };
1928 
1929 static struct clk_fixed_factor gxbb_vclk_div6 = {
1930 	.mult = 1,
1931 	.div = 6,
1932 	.hw.init = &(struct clk_init_data){
1933 		.name = "vclk_div6",
1934 		.ops = &clk_fixed_factor_ops,
1935 		.parent_names = (const char *[]){ "vclk_div6_en" },
1936 		.num_parents = 1,
1937 	},
1938 };
1939 
1940 static struct clk_fixed_factor gxbb_vclk_div12 = {
1941 	.mult = 1,
1942 	.div = 12,
1943 	.hw.init = &(struct clk_init_data){
1944 		.name = "vclk_div12",
1945 		.ops = &clk_fixed_factor_ops,
1946 		.parent_names = (const char *[]){ "vclk_div12_en" },
1947 		.num_parents = 1,
1948 	},
1949 };
1950 
1951 static struct clk_fixed_factor gxbb_vclk2_div2 = {
1952 	.mult = 1,
1953 	.div = 2,
1954 	.hw.init = &(struct clk_init_data){
1955 		.name = "vclk2_div2",
1956 		.ops = &clk_fixed_factor_ops,
1957 		.parent_names = (const char *[]){ "vclk2_div2_en" },
1958 		.num_parents = 1,
1959 	},
1960 };
1961 
1962 static struct clk_fixed_factor gxbb_vclk2_div4 = {
1963 	.mult = 1,
1964 	.div = 4,
1965 	.hw.init = &(struct clk_init_data){
1966 		.name = "vclk2_div4",
1967 		.ops = &clk_fixed_factor_ops,
1968 		.parent_names = (const char *[]){ "vclk2_div4_en" },
1969 		.num_parents = 1,
1970 	},
1971 };
1972 
1973 static struct clk_fixed_factor gxbb_vclk2_div6 = {
1974 	.mult = 1,
1975 	.div = 6,
1976 	.hw.init = &(struct clk_init_data){
1977 		.name = "vclk2_div6",
1978 		.ops = &clk_fixed_factor_ops,
1979 		.parent_names = (const char *[]){ "vclk2_div6_en" },
1980 		.num_parents = 1,
1981 	},
1982 };
1983 
1984 static struct clk_fixed_factor gxbb_vclk2_div12 = {
1985 	.mult = 1,
1986 	.div = 12,
1987 	.hw.init = &(struct clk_init_data){
1988 		.name = "vclk2_div12",
1989 		.ops = &clk_fixed_factor_ops,
1990 		.parent_names = (const char *[]){ "vclk2_div12_en" },
1991 		.num_parents = 1,
1992 	},
1993 };
1994 
1995 static u32 mux_table_cts_sel[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
1996 static const char * const gxbb_cts_parent_names[] = {
1997 	"vclk_div1", "vclk_div2", "vclk_div4", "vclk_div6",
1998 	"vclk_div12", "vclk2_div1", "vclk2_div2", "vclk2_div4",
1999 	"vclk2_div6", "vclk2_div12"
2000 };
2001 
2002 static struct clk_regmap gxbb_cts_enci_sel = {
2003 	.data = &(struct clk_regmap_mux_data){
2004 		.offset = HHI_VID_CLK_DIV,
2005 		.mask = 0xf,
2006 		.shift = 28,
2007 		.table = mux_table_cts_sel,
2008 	},
2009 	.hw.init = &(struct clk_init_data){
2010 		.name = "cts_enci_sel",
2011 		.ops = &clk_regmap_mux_ops,
2012 		.parent_names = gxbb_cts_parent_names,
2013 		.num_parents = ARRAY_SIZE(gxbb_cts_parent_names),
2014 		.flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE,
2015 	},
2016 };
2017 
2018 static struct clk_regmap gxbb_cts_encp_sel = {
2019 	.data = &(struct clk_regmap_mux_data){
2020 		.offset = HHI_VID_CLK_DIV,
2021 		.mask = 0xf,
2022 		.shift = 20,
2023 		.table = mux_table_cts_sel,
2024 	},
2025 	.hw.init = &(struct clk_init_data){
2026 		.name = "cts_encp_sel",
2027 		.ops = &clk_regmap_mux_ops,
2028 		.parent_names = gxbb_cts_parent_names,
2029 		.num_parents = ARRAY_SIZE(gxbb_cts_parent_names),
2030 		.flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE,
2031 	},
2032 };
2033 
2034 static struct clk_regmap gxbb_cts_vdac_sel = {
2035 	.data = &(struct clk_regmap_mux_data){
2036 		.offset = HHI_VIID_CLK_DIV,
2037 		.mask = 0xf,
2038 		.shift = 28,
2039 		.table = mux_table_cts_sel,
2040 	},
2041 	.hw.init = &(struct clk_init_data){
2042 		.name = "cts_vdac_sel",
2043 		.ops = &clk_regmap_mux_ops,
2044 		.parent_names = gxbb_cts_parent_names,
2045 		.num_parents = ARRAY_SIZE(gxbb_cts_parent_names),
2046 		.flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE,
2047 	},
2048 };
2049 
2050 /* TOFIX: add support for cts_tcon */
2051 static u32 mux_table_hdmi_tx_sel[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
2052 static const char * const gxbb_cts_hdmi_tx_parent_names[] = {
2053 	"vclk_div1", "vclk_div2", "vclk_div4", "vclk_div6",
2054 	"vclk_div12", "vclk2_div1", "vclk2_div2", "vclk2_div4",
2055 	"vclk2_div6", "vclk2_div12"
2056 };
2057 
2058 static struct clk_regmap gxbb_hdmi_tx_sel = {
2059 	.data = &(struct clk_regmap_mux_data){
2060 		.offset = HHI_HDMI_CLK_CNTL,
2061 		.mask = 0xf,
2062 		.shift = 16,
2063 		.table = mux_table_hdmi_tx_sel,
2064 	},
2065 	.hw.init = &(struct clk_init_data){
2066 		.name = "hdmi_tx_sel",
2067 		.ops = &clk_regmap_mux_ops,
2068 		/*
2069 		 * bits 31:28 selects from 12 possible parents:
2070 		 * vclk_div1, vclk_div2, vclk_div4, vclk_div6, vclk_div12
2071 		 * vclk2_div1, vclk2_div2, vclk2_div4, vclk2_div6, vclk2_div12,
2072 		 * cts_tcon
2073 		 */
2074 		.parent_names = gxbb_cts_hdmi_tx_parent_names,
2075 		.num_parents = ARRAY_SIZE(gxbb_cts_hdmi_tx_parent_names),
2076 		.flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE,
2077 	},
2078 };
2079 
2080 static struct clk_regmap gxbb_cts_enci = {
2081 	.data = &(struct clk_regmap_gate_data){
2082 		.offset = HHI_VID_CLK_CNTL2,
2083 		.bit_idx = 0,
2084 	},
2085 	.hw.init = &(struct clk_init_data) {
2086 		.name = "cts_enci",
2087 		.ops = &clk_regmap_gate_ops,
2088 		.parent_names = (const char *[]){ "cts_enci_sel" },
2089 		.num_parents = 1,
2090 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
2091 	},
2092 };
2093 
2094 static struct clk_regmap gxbb_cts_encp = {
2095 	.data = &(struct clk_regmap_gate_data){
2096 		.offset = HHI_VID_CLK_CNTL2,
2097 		.bit_idx = 2,
2098 	},
2099 	.hw.init = &(struct clk_init_data) {
2100 		.name = "cts_encp",
2101 		.ops = &clk_regmap_gate_ops,
2102 		.parent_names = (const char *[]){ "cts_encp_sel" },
2103 		.num_parents = 1,
2104 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
2105 	},
2106 };
2107 
2108 static struct clk_regmap gxbb_cts_vdac = {
2109 	.data = &(struct clk_regmap_gate_data){
2110 		.offset = HHI_VID_CLK_CNTL2,
2111 		.bit_idx = 4,
2112 	},
2113 	.hw.init = &(struct clk_init_data) {
2114 		.name = "cts_vdac",
2115 		.ops = &clk_regmap_gate_ops,
2116 		.parent_names = (const char *[]){ "cts_vdac_sel" },
2117 		.num_parents = 1,
2118 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
2119 	},
2120 };
2121 
2122 static struct clk_regmap gxbb_hdmi_tx = {
2123 	.data = &(struct clk_regmap_gate_data){
2124 		.offset = HHI_VID_CLK_CNTL2,
2125 		.bit_idx = 5,
2126 	},
2127 	.hw.init = &(struct clk_init_data) {
2128 		.name = "hdmi_tx",
2129 		.ops = &clk_regmap_gate_ops,
2130 		.parent_names = (const char *[]){ "hdmi_tx_sel" },
2131 		.num_parents = 1,
2132 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
2133 	},
2134 };
2135 
2136 /* HDMI Clocks */
2137 
2138 static const char * const gxbb_hdmi_parent_names[] = {
2139 	IN_PREFIX "xtal", "fclk_div4", "fclk_div3", "fclk_div5"
2140 };
2141 
2142 static struct clk_regmap gxbb_hdmi_sel = {
2143 	.data = &(struct clk_regmap_mux_data){
2144 		.offset = HHI_HDMI_CLK_CNTL,
2145 		.mask = 0x3,
2146 		.shift = 9,
2147 		.flags = CLK_MUX_ROUND_CLOSEST,
2148 	},
2149 	.hw.init = &(struct clk_init_data){
2150 		.name = "hdmi_sel",
2151 		.ops = &clk_regmap_mux_ops,
2152 		.parent_names = gxbb_hdmi_parent_names,
2153 		.num_parents = ARRAY_SIZE(gxbb_hdmi_parent_names),
2154 		.flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE,
2155 	},
2156 };
2157 
2158 static struct clk_regmap gxbb_hdmi_div = {
2159 	.data = &(struct clk_regmap_div_data){
2160 		.offset = HHI_HDMI_CLK_CNTL,
2161 		.shift = 0,
2162 		.width = 7,
2163 	},
2164 	.hw.init = &(struct clk_init_data){
2165 		.name = "hdmi_div",
2166 		.ops = &clk_regmap_divider_ops,
2167 		.parent_names = (const char *[]){ "hdmi_sel" },
2168 		.num_parents = 1,
2169 		.flags = CLK_GET_RATE_NOCACHE,
2170 	},
2171 };
2172 
2173 static struct clk_regmap gxbb_hdmi = {
2174 	.data = &(struct clk_regmap_gate_data){
2175 		.offset = HHI_HDMI_CLK_CNTL,
2176 		.bit_idx = 8,
2177 	},
2178 	.hw.init = &(struct clk_init_data) {
2179 		.name = "hdmi",
2180 		.ops = &clk_regmap_gate_ops,
2181 		.parent_names = (const char *[]){ "hdmi_div" },
2182 		.num_parents = 1,
2183 		.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
2184 	},
2185 };
2186 
2187 /* VDEC clocks */
2188 
2189 static const char * const gxbb_vdec_parent_names[] = {
2190 	"fclk_div4", "fclk_div3", "fclk_div5", "fclk_div7"
2191 };
2192 
2193 static struct clk_regmap gxbb_vdec_1_sel = {
2194 	.data = &(struct clk_regmap_mux_data){
2195 		.offset = HHI_VDEC_CLK_CNTL,
2196 		.mask = 0x3,
2197 		.shift = 9,
2198 		.flags = CLK_MUX_ROUND_CLOSEST,
2199 	},
2200 	.hw.init = &(struct clk_init_data){
2201 		.name = "vdec_1_sel",
2202 		.ops = &clk_regmap_mux_ops,
2203 		.parent_names = gxbb_vdec_parent_names,
2204 		.num_parents = ARRAY_SIZE(gxbb_vdec_parent_names),
2205 		.flags = CLK_SET_RATE_PARENT,
2206 	},
2207 };
2208 
2209 static struct clk_regmap gxbb_vdec_1_div = {
2210 	.data = &(struct clk_regmap_div_data){
2211 		.offset = HHI_VDEC_CLK_CNTL,
2212 		.shift = 0,
2213 		.width = 7,
2214 		.flags = CLK_DIVIDER_ROUND_CLOSEST,
2215 	},
2216 	.hw.init = &(struct clk_init_data){
2217 		.name = "vdec_1_div",
2218 		.ops = &clk_regmap_divider_ops,
2219 		.parent_names = (const char *[]){ "vdec_1_sel" },
2220 		.num_parents = 1,
2221 		.flags = CLK_SET_RATE_PARENT,
2222 	},
2223 };
2224 
2225 static struct clk_regmap gxbb_vdec_1 = {
2226 	.data = &(struct clk_regmap_gate_data){
2227 		.offset = HHI_VDEC_CLK_CNTL,
2228 		.bit_idx = 8,
2229 	},
2230 	.hw.init = &(struct clk_init_data) {
2231 		.name = "vdec_1",
2232 		.ops = &clk_regmap_gate_ops,
2233 		.parent_names = (const char *[]){ "vdec_1_div" },
2234 		.num_parents = 1,
2235 		.flags = CLK_SET_RATE_PARENT,
2236 	},
2237 };
2238 
2239 static struct clk_regmap gxbb_vdec_hevc_sel = {
2240 	.data = &(struct clk_regmap_mux_data){
2241 		.offset = HHI_VDEC2_CLK_CNTL,
2242 		.mask = 0x3,
2243 		.shift = 25,
2244 		.flags = CLK_MUX_ROUND_CLOSEST,
2245 	},
2246 	.hw.init = &(struct clk_init_data){
2247 		.name = "vdec_hevc_sel",
2248 		.ops = &clk_regmap_mux_ops,
2249 		.parent_names = gxbb_vdec_parent_names,
2250 		.num_parents = ARRAY_SIZE(gxbb_vdec_parent_names),
2251 		.flags = CLK_SET_RATE_PARENT,
2252 	},
2253 };
2254 
2255 static struct clk_regmap gxbb_vdec_hevc_div = {
2256 	.data = &(struct clk_regmap_div_data){
2257 		.offset = HHI_VDEC2_CLK_CNTL,
2258 		.shift = 16,
2259 		.width = 7,
2260 		.flags = CLK_DIVIDER_ROUND_CLOSEST,
2261 	},
2262 	.hw.init = &(struct clk_init_data){
2263 		.name = "vdec_hevc_div",
2264 		.ops = &clk_regmap_divider_ops,
2265 		.parent_names = (const char *[]){ "vdec_hevc_sel" },
2266 		.num_parents = 1,
2267 		.flags = CLK_SET_RATE_PARENT,
2268 	},
2269 };
2270 
2271 static struct clk_regmap gxbb_vdec_hevc = {
2272 	.data = &(struct clk_regmap_gate_data){
2273 		.offset = HHI_VDEC2_CLK_CNTL,
2274 		.bit_idx = 24,
2275 	},
2276 	.hw.init = &(struct clk_init_data) {
2277 		.name = "vdec_hevc",
2278 		.ops = &clk_regmap_gate_ops,
2279 		.parent_names = (const char *[]){ "vdec_hevc_div" },
2280 		.num_parents = 1,
2281 		.flags = CLK_SET_RATE_PARENT,
2282 	},
2283 };
2284 
2285 static u32 mux_table_gen_clk[]	= { 0, 4, 5, 6, 7, 8,
2286 				    9, 10, 11, 13, 14, };
2287 static const char * const gen_clk_parent_names[] = {
2288 	IN_PREFIX "xtal", "vdec_1", "vdec_hevc", "mpll0", "mpll1", "mpll2",
2289 	"fclk_div4", "fclk_div3", "fclk_div5", "fclk_div7", "gp0_pll",
2290 };
2291 
2292 static struct clk_regmap gxbb_gen_clk_sel = {
2293 	.data = &(struct clk_regmap_mux_data){
2294 		.offset = HHI_GEN_CLK_CNTL,
2295 		.mask = 0xf,
2296 		.shift = 12,
2297 		.table = mux_table_gen_clk,
2298 	},
2299 	.hw.init = &(struct clk_init_data){
2300 		.name = "gen_clk_sel",
2301 		.ops = &clk_regmap_mux_ops,
2302 		/*
2303 		 * bits 15:12 selects from 14 possible parents:
2304 		 * xtal, [rtc_oscin_i], [sys_cpu_div16], [ddr_dpll_pt],
2305 		 * vid_pll, vid2_pll (hevc), mpll0, mpll1, mpll2, fdiv4,
2306 		 * fdiv3, fdiv5, [cts_msr_clk], fdiv7, gp0_pll
2307 		 */
2308 		.parent_names = gen_clk_parent_names,
2309 		.num_parents = ARRAY_SIZE(gen_clk_parent_names),
2310 	},
2311 };
2312 
2313 static struct clk_regmap gxbb_gen_clk_div = {
2314 	.data = &(struct clk_regmap_div_data){
2315 		.offset = HHI_GEN_CLK_CNTL,
2316 		.shift = 0,
2317 		.width = 11,
2318 	},
2319 	.hw.init = &(struct clk_init_data){
2320 		.name = "gen_clk_div",
2321 		.ops = &clk_regmap_divider_ops,
2322 		.parent_names = (const char *[]){ "gen_clk_sel" },
2323 		.num_parents = 1,
2324 		.flags = CLK_SET_RATE_PARENT,
2325 	},
2326 };
2327 
2328 static struct clk_regmap gxbb_gen_clk = {
2329 	.data = &(struct clk_regmap_gate_data){
2330 		.offset = HHI_GEN_CLK_CNTL,
2331 		.bit_idx = 7,
2332 	},
2333 	.hw.init = &(struct clk_init_data){
2334 		.name = "gen_clk",
2335 		.ops = &clk_regmap_gate_ops,
2336 		.parent_names = (const char *[]){ "gen_clk_div" },
2337 		.num_parents = 1,
2338 		.flags = CLK_SET_RATE_PARENT,
2339 	},
2340 };
2341 
2342 /* Everything Else (EE) domain gates */
2343 static MESON_GATE(gxbb_ddr, HHI_GCLK_MPEG0, 0);
2344 static MESON_GATE(gxbb_dos, HHI_GCLK_MPEG0, 1);
2345 static MESON_GATE(gxbb_isa, HHI_GCLK_MPEG0, 5);
2346 static MESON_GATE(gxbb_pl301, HHI_GCLK_MPEG0, 6);
2347 static MESON_GATE(gxbb_periphs, HHI_GCLK_MPEG0, 7);
2348 static MESON_GATE(gxbb_spicc, HHI_GCLK_MPEG0, 8);
2349 static MESON_GATE(gxbb_i2c, HHI_GCLK_MPEG0, 9);
2350 static MESON_GATE(gxbb_sana, HHI_GCLK_MPEG0, 10);
2351 static MESON_GATE(gxbb_smart_card, HHI_GCLK_MPEG0, 11);
2352 static MESON_GATE(gxbb_rng0, HHI_GCLK_MPEG0, 12);
2353 static MESON_GATE(gxbb_uart0, HHI_GCLK_MPEG0, 13);
2354 static MESON_GATE(gxbb_sdhc, HHI_GCLK_MPEG0, 14);
2355 static MESON_GATE(gxbb_stream, HHI_GCLK_MPEG0, 15);
2356 static MESON_GATE(gxbb_async_fifo, HHI_GCLK_MPEG0, 16);
2357 static MESON_GATE(gxbb_sdio, HHI_GCLK_MPEG0, 17);
2358 static MESON_GATE(gxbb_abuf, HHI_GCLK_MPEG0, 18);
2359 static MESON_GATE(gxbb_hiu_iface, HHI_GCLK_MPEG0, 19);
2360 static MESON_GATE(gxbb_assist_misc, HHI_GCLK_MPEG0, 23);
2361 static MESON_GATE(gxbb_emmc_a, HHI_GCLK_MPEG0, 24);
2362 static MESON_GATE(gxbb_emmc_b, HHI_GCLK_MPEG0, 25);
2363 static MESON_GATE(gxbb_emmc_c, HHI_GCLK_MPEG0, 26);
2364 static MESON_GATE(gxbb_spi, HHI_GCLK_MPEG0, 30);
2365 
2366 static MESON_GATE(gxbb_i2s_spdif, HHI_GCLK_MPEG1, 2);
2367 static MESON_GATE(gxbb_eth, HHI_GCLK_MPEG1, 3);
2368 static MESON_GATE(gxbb_demux, HHI_GCLK_MPEG1, 4);
2369 static MESON_GATE(gxbb_aiu_glue, HHI_GCLK_MPEG1, 6);
2370 static MESON_GATE(gxbb_iec958, HHI_GCLK_MPEG1, 7);
2371 static MESON_GATE(gxbb_i2s_out, HHI_GCLK_MPEG1, 8);
2372 static MESON_GATE(gxbb_amclk, HHI_GCLK_MPEG1, 9);
2373 static MESON_GATE(gxbb_aififo2, HHI_GCLK_MPEG1, 10);
2374 static MESON_GATE(gxbb_mixer, HHI_GCLK_MPEG1, 11);
2375 static MESON_GATE(gxbb_mixer_iface, HHI_GCLK_MPEG1, 12);
2376 static MESON_GATE(gxbb_adc, HHI_GCLK_MPEG1, 13);
2377 static MESON_GATE(gxbb_blkmv, HHI_GCLK_MPEG1, 14);
2378 static MESON_GATE(gxbb_aiu, HHI_GCLK_MPEG1, 15);
2379 static MESON_GATE(gxbb_uart1, HHI_GCLK_MPEG1, 16);
2380 static MESON_GATE(gxbb_g2d, HHI_GCLK_MPEG1, 20);
2381 static MESON_GATE(gxbb_usb0, HHI_GCLK_MPEG1, 21);
2382 static MESON_GATE(gxbb_usb1, HHI_GCLK_MPEG1, 22);
2383 static MESON_GATE(gxbb_reset, HHI_GCLK_MPEG1, 23);
2384 static MESON_GATE(gxbb_nand, HHI_GCLK_MPEG1, 24);
2385 static MESON_GATE(gxbb_dos_parser, HHI_GCLK_MPEG1, 25);
2386 static MESON_GATE(gxbb_usb, HHI_GCLK_MPEG1, 26);
2387 static MESON_GATE(gxbb_vdin1, HHI_GCLK_MPEG1, 28);
2388 static MESON_GATE(gxbb_ahb_arb0, HHI_GCLK_MPEG1, 29);
2389 static MESON_GATE(gxbb_efuse, HHI_GCLK_MPEG1, 30);
2390 static MESON_GATE(gxbb_boot_rom, HHI_GCLK_MPEG1, 31);
2391 
2392 static MESON_GATE(gxbb_ahb_data_bus, HHI_GCLK_MPEG2, 1);
2393 static MESON_GATE(gxbb_ahb_ctrl_bus, HHI_GCLK_MPEG2, 2);
2394 static MESON_GATE(gxbb_hdmi_intr_sync, HHI_GCLK_MPEG2, 3);
2395 static MESON_GATE(gxbb_hdmi_pclk, HHI_GCLK_MPEG2, 4);
2396 static MESON_GATE(gxbb_usb1_ddr_bridge, HHI_GCLK_MPEG2, 8);
2397 static MESON_GATE(gxbb_usb0_ddr_bridge, HHI_GCLK_MPEG2, 9);
2398 static MESON_GATE(gxbb_mmc_pclk, HHI_GCLK_MPEG2, 11);
2399 static MESON_GATE(gxbb_dvin, HHI_GCLK_MPEG2, 12);
2400 static MESON_GATE(gxbb_uart2, HHI_GCLK_MPEG2, 15);
2401 static MESON_GATE(gxbb_sar_adc, HHI_GCLK_MPEG2, 22);
2402 static MESON_GATE(gxbb_vpu_intr, HHI_GCLK_MPEG2, 25);
2403 static MESON_GATE(gxbb_sec_ahb_ahb3_bridge, HHI_GCLK_MPEG2, 26);
2404 static MESON_GATE(gxbb_clk81_a53, HHI_GCLK_MPEG2, 29);
2405 
2406 static MESON_GATE(gxbb_vclk2_venci0, HHI_GCLK_OTHER, 1);
2407 static MESON_GATE(gxbb_vclk2_venci1, HHI_GCLK_OTHER, 2);
2408 static MESON_GATE(gxbb_vclk2_vencp0, HHI_GCLK_OTHER, 3);
2409 static MESON_GATE(gxbb_vclk2_vencp1, HHI_GCLK_OTHER, 4);
2410 static MESON_GATE(gxbb_gclk_venci_int0, HHI_GCLK_OTHER, 8);
2411 static MESON_GATE(gxbb_gclk_vencp_int, HHI_GCLK_OTHER, 9);
2412 static MESON_GATE(gxbb_dac_clk, HHI_GCLK_OTHER, 10);
2413 static MESON_GATE(gxbb_aoclk_gate, HHI_GCLK_OTHER, 14);
2414 static MESON_GATE(gxbb_iec958_gate, HHI_GCLK_OTHER, 16);
2415 static MESON_GATE(gxbb_enc480p, HHI_GCLK_OTHER, 20);
2416 static MESON_GATE(gxbb_rng1, HHI_GCLK_OTHER, 21);
2417 static MESON_GATE(gxbb_gclk_venci_int1, HHI_GCLK_OTHER, 22);
2418 static MESON_GATE(gxbb_vclk2_venclmcc, HHI_GCLK_OTHER, 24);
2419 static MESON_GATE(gxbb_vclk2_vencl, HHI_GCLK_OTHER, 25);
2420 static MESON_GATE(gxbb_vclk_other, HHI_GCLK_OTHER, 26);
2421 static MESON_GATE(gxbb_edp, HHI_GCLK_OTHER, 31);
2422 
2423 /* Always On (AO) domain gates */
2424 
2425 static MESON_GATE(gxbb_ao_media_cpu, HHI_GCLK_AO, 0);
2426 static MESON_GATE(gxbb_ao_ahb_sram, HHI_GCLK_AO, 1);
2427 static MESON_GATE(gxbb_ao_ahb_bus, HHI_GCLK_AO, 2);
2428 static MESON_GATE(gxbb_ao_iface, HHI_GCLK_AO, 3);
2429 static MESON_GATE(gxbb_ao_i2c, HHI_GCLK_AO, 4);
2430 
2431 /* Array of all clocks provided by this provider */
2432 
2433 static struct clk_hw_onecell_data gxbb_hw_onecell_data = {
2434 	.hws = {
2435 		[CLKID_SYS_PLL]		    = &gxbb_sys_pll.hw,
2436 		[CLKID_HDMI_PLL]	    = &gxbb_hdmi_pll.hw,
2437 		[CLKID_FIXED_PLL]	    = &gxbb_fixed_pll.hw,
2438 		[CLKID_FCLK_DIV2]	    = &gxbb_fclk_div2.hw,
2439 		[CLKID_FCLK_DIV3]	    = &gxbb_fclk_div3.hw,
2440 		[CLKID_FCLK_DIV4]	    = &gxbb_fclk_div4.hw,
2441 		[CLKID_FCLK_DIV5]	    = &gxbb_fclk_div5.hw,
2442 		[CLKID_FCLK_DIV7]	    = &gxbb_fclk_div7.hw,
2443 		[CLKID_GP0_PLL]		    = &gxbb_gp0_pll.hw,
2444 		[CLKID_MPEG_SEL]	    = &gxbb_mpeg_clk_sel.hw,
2445 		[CLKID_MPEG_DIV]	    = &gxbb_mpeg_clk_div.hw,
2446 		[CLKID_CLK81]		    = &gxbb_clk81.hw,
2447 		[CLKID_MPLL0]		    = &gxbb_mpll0.hw,
2448 		[CLKID_MPLL1]		    = &gxbb_mpll1.hw,
2449 		[CLKID_MPLL2]		    = &gxbb_mpll2.hw,
2450 		[CLKID_DDR]		    = &gxbb_ddr.hw,
2451 		[CLKID_DOS]		    = &gxbb_dos.hw,
2452 		[CLKID_ISA]		    = &gxbb_isa.hw,
2453 		[CLKID_PL301]		    = &gxbb_pl301.hw,
2454 		[CLKID_PERIPHS]		    = &gxbb_periphs.hw,
2455 		[CLKID_SPICC]		    = &gxbb_spicc.hw,
2456 		[CLKID_I2C]		    = &gxbb_i2c.hw,
2457 		[CLKID_SAR_ADC]		    = &gxbb_sar_adc.hw,
2458 		[CLKID_SMART_CARD]	    = &gxbb_smart_card.hw,
2459 		[CLKID_RNG0]		    = &gxbb_rng0.hw,
2460 		[CLKID_UART0]		    = &gxbb_uart0.hw,
2461 		[CLKID_SDHC]		    = &gxbb_sdhc.hw,
2462 		[CLKID_STREAM]		    = &gxbb_stream.hw,
2463 		[CLKID_ASYNC_FIFO]	    = &gxbb_async_fifo.hw,
2464 		[CLKID_SDIO]		    = &gxbb_sdio.hw,
2465 		[CLKID_ABUF]		    = &gxbb_abuf.hw,
2466 		[CLKID_HIU_IFACE]	    = &gxbb_hiu_iface.hw,
2467 		[CLKID_ASSIST_MISC]	    = &gxbb_assist_misc.hw,
2468 		[CLKID_SPI]		    = &gxbb_spi.hw,
2469 		[CLKID_I2S_SPDIF]	    = &gxbb_i2s_spdif.hw,
2470 		[CLKID_ETH]		    = &gxbb_eth.hw,
2471 		[CLKID_DEMUX]		    = &gxbb_demux.hw,
2472 		[CLKID_AIU_GLUE]	    = &gxbb_aiu_glue.hw,
2473 		[CLKID_IEC958]		    = &gxbb_iec958.hw,
2474 		[CLKID_I2S_OUT]		    = &gxbb_i2s_out.hw,
2475 		[CLKID_AMCLK]		    = &gxbb_amclk.hw,
2476 		[CLKID_AIFIFO2]		    = &gxbb_aififo2.hw,
2477 		[CLKID_MIXER]		    = &gxbb_mixer.hw,
2478 		[CLKID_MIXER_IFACE]	    = &gxbb_mixer_iface.hw,
2479 		[CLKID_ADC]		    = &gxbb_adc.hw,
2480 		[CLKID_BLKMV]		    = &gxbb_blkmv.hw,
2481 		[CLKID_AIU]		    = &gxbb_aiu.hw,
2482 		[CLKID_UART1]		    = &gxbb_uart1.hw,
2483 		[CLKID_G2D]		    = &gxbb_g2d.hw,
2484 		[CLKID_USB0]		    = &gxbb_usb0.hw,
2485 		[CLKID_USB1]		    = &gxbb_usb1.hw,
2486 		[CLKID_RESET]		    = &gxbb_reset.hw,
2487 		[CLKID_NAND]		    = &gxbb_nand.hw,
2488 		[CLKID_DOS_PARSER]	    = &gxbb_dos_parser.hw,
2489 		[CLKID_USB]		    = &gxbb_usb.hw,
2490 		[CLKID_VDIN1]		    = &gxbb_vdin1.hw,
2491 		[CLKID_AHB_ARB0]	    = &gxbb_ahb_arb0.hw,
2492 		[CLKID_EFUSE]		    = &gxbb_efuse.hw,
2493 		[CLKID_BOOT_ROM]	    = &gxbb_boot_rom.hw,
2494 		[CLKID_AHB_DATA_BUS]	    = &gxbb_ahb_data_bus.hw,
2495 		[CLKID_AHB_CTRL_BUS]	    = &gxbb_ahb_ctrl_bus.hw,
2496 		[CLKID_HDMI_INTR_SYNC]	    = &gxbb_hdmi_intr_sync.hw,
2497 		[CLKID_HDMI_PCLK]	    = &gxbb_hdmi_pclk.hw,
2498 		[CLKID_USB1_DDR_BRIDGE]	    = &gxbb_usb1_ddr_bridge.hw,
2499 		[CLKID_USB0_DDR_BRIDGE]	    = &gxbb_usb0_ddr_bridge.hw,
2500 		[CLKID_MMC_PCLK]	    = &gxbb_mmc_pclk.hw,
2501 		[CLKID_DVIN]		    = &gxbb_dvin.hw,
2502 		[CLKID_UART2]		    = &gxbb_uart2.hw,
2503 		[CLKID_SANA]		    = &gxbb_sana.hw,
2504 		[CLKID_VPU_INTR]	    = &gxbb_vpu_intr.hw,
2505 		[CLKID_SEC_AHB_AHB3_BRIDGE] = &gxbb_sec_ahb_ahb3_bridge.hw,
2506 		[CLKID_CLK81_A53]	    = &gxbb_clk81_a53.hw,
2507 		[CLKID_VCLK2_VENCI0]	    = &gxbb_vclk2_venci0.hw,
2508 		[CLKID_VCLK2_VENCI1]	    = &gxbb_vclk2_venci1.hw,
2509 		[CLKID_VCLK2_VENCP0]	    = &gxbb_vclk2_vencp0.hw,
2510 		[CLKID_VCLK2_VENCP1]	    = &gxbb_vclk2_vencp1.hw,
2511 		[CLKID_GCLK_VENCI_INT0]	    = &gxbb_gclk_venci_int0.hw,
2512 		[CLKID_GCLK_VENCI_INT]	    = &gxbb_gclk_vencp_int.hw,
2513 		[CLKID_DAC_CLK]		    = &gxbb_dac_clk.hw,
2514 		[CLKID_AOCLK_GATE]	    = &gxbb_aoclk_gate.hw,
2515 		[CLKID_IEC958_GATE]	    = &gxbb_iec958_gate.hw,
2516 		[CLKID_ENC480P]		    = &gxbb_enc480p.hw,
2517 		[CLKID_RNG1]		    = &gxbb_rng1.hw,
2518 		[CLKID_GCLK_VENCI_INT1]	    = &gxbb_gclk_venci_int1.hw,
2519 		[CLKID_VCLK2_VENCLMCC]	    = &gxbb_vclk2_venclmcc.hw,
2520 		[CLKID_VCLK2_VENCL]	    = &gxbb_vclk2_vencl.hw,
2521 		[CLKID_VCLK_OTHER]	    = &gxbb_vclk_other.hw,
2522 		[CLKID_EDP]		    = &gxbb_edp.hw,
2523 		[CLKID_AO_MEDIA_CPU]	    = &gxbb_ao_media_cpu.hw,
2524 		[CLKID_AO_AHB_SRAM]	    = &gxbb_ao_ahb_sram.hw,
2525 		[CLKID_AO_AHB_BUS]	    = &gxbb_ao_ahb_bus.hw,
2526 		[CLKID_AO_IFACE]	    = &gxbb_ao_iface.hw,
2527 		[CLKID_AO_I2C]		    = &gxbb_ao_i2c.hw,
2528 		[CLKID_SD_EMMC_A]	    = &gxbb_emmc_a.hw,
2529 		[CLKID_SD_EMMC_B]	    = &gxbb_emmc_b.hw,
2530 		[CLKID_SD_EMMC_C]	    = &gxbb_emmc_c.hw,
2531 		[CLKID_SAR_ADC_CLK]	    = &gxbb_sar_adc_clk.hw,
2532 		[CLKID_SAR_ADC_SEL]	    = &gxbb_sar_adc_clk_sel.hw,
2533 		[CLKID_SAR_ADC_DIV]	    = &gxbb_sar_adc_clk_div.hw,
2534 		[CLKID_MALI_0_SEL]	    = &gxbb_mali_0_sel.hw,
2535 		[CLKID_MALI_0_DIV]	    = &gxbb_mali_0_div.hw,
2536 		[CLKID_MALI_0]		    = &gxbb_mali_0.hw,
2537 		[CLKID_MALI_1_SEL]	    = &gxbb_mali_1_sel.hw,
2538 		[CLKID_MALI_1_DIV]	    = &gxbb_mali_1_div.hw,
2539 		[CLKID_MALI_1]		    = &gxbb_mali_1.hw,
2540 		[CLKID_MALI]		    = &gxbb_mali.hw,
2541 		[CLKID_CTS_AMCLK]	    = &gxbb_cts_amclk.hw,
2542 		[CLKID_CTS_AMCLK_SEL]	    = &gxbb_cts_amclk_sel.hw,
2543 		[CLKID_CTS_AMCLK_DIV]	    = &gxbb_cts_amclk_div.hw,
2544 		[CLKID_CTS_MCLK_I958]	    = &gxbb_cts_mclk_i958.hw,
2545 		[CLKID_CTS_MCLK_I958_SEL]   = &gxbb_cts_mclk_i958_sel.hw,
2546 		[CLKID_CTS_MCLK_I958_DIV]   = &gxbb_cts_mclk_i958_div.hw,
2547 		[CLKID_CTS_I958]	    = &gxbb_cts_i958.hw,
2548 		[CLKID_32K_CLK]		    = &gxbb_32k_clk.hw,
2549 		[CLKID_32K_CLK_SEL]	    = &gxbb_32k_clk_sel.hw,
2550 		[CLKID_32K_CLK_DIV]	    = &gxbb_32k_clk_div.hw,
2551 		[CLKID_SD_EMMC_A_CLK0_SEL]  = &gxbb_sd_emmc_a_clk0_sel.hw,
2552 		[CLKID_SD_EMMC_A_CLK0_DIV]  = &gxbb_sd_emmc_a_clk0_div.hw,
2553 		[CLKID_SD_EMMC_A_CLK0]	    = &gxbb_sd_emmc_a_clk0.hw,
2554 		[CLKID_SD_EMMC_B_CLK0_SEL]  = &gxbb_sd_emmc_b_clk0_sel.hw,
2555 		[CLKID_SD_EMMC_B_CLK0_DIV]  = &gxbb_sd_emmc_b_clk0_div.hw,
2556 		[CLKID_SD_EMMC_B_CLK0]	    = &gxbb_sd_emmc_b_clk0.hw,
2557 		[CLKID_SD_EMMC_C_CLK0_SEL]  = &gxbb_sd_emmc_c_clk0_sel.hw,
2558 		[CLKID_SD_EMMC_C_CLK0_DIV]  = &gxbb_sd_emmc_c_clk0_div.hw,
2559 		[CLKID_SD_EMMC_C_CLK0]	    = &gxbb_sd_emmc_c_clk0.hw,
2560 		[CLKID_VPU_0_SEL]	    = &gxbb_vpu_0_sel.hw,
2561 		[CLKID_VPU_0_DIV]	    = &gxbb_vpu_0_div.hw,
2562 		[CLKID_VPU_0]		    = &gxbb_vpu_0.hw,
2563 		[CLKID_VPU_1_SEL]	    = &gxbb_vpu_1_sel.hw,
2564 		[CLKID_VPU_1_DIV]	    = &gxbb_vpu_1_div.hw,
2565 		[CLKID_VPU_1]		    = &gxbb_vpu_1.hw,
2566 		[CLKID_VPU]		    = &gxbb_vpu.hw,
2567 		[CLKID_VAPB_0_SEL]	    = &gxbb_vapb_0_sel.hw,
2568 		[CLKID_VAPB_0_DIV]	    = &gxbb_vapb_0_div.hw,
2569 		[CLKID_VAPB_0]		    = &gxbb_vapb_0.hw,
2570 		[CLKID_VAPB_1_SEL]	    = &gxbb_vapb_1_sel.hw,
2571 		[CLKID_VAPB_1_DIV]	    = &gxbb_vapb_1_div.hw,
2572 		[CLKID_VAPB_1]		    = &gxbb_vapb_1.hw,
2573 		[CLKID_VAPB_SEL]	    = &gxbb_vapb_sel.hw,
2574 		[CLKID_VAPB]		    = &gxbb_vapb.hw,
2575 		[CLKID_HDMI_PLL_PRE_MULT]   = &gxbb_hdmi_pll_pre_mult.hw,
2576 		[CLKID_MPLL0_DIV]	    = &gxbb_mpll0_div.hw,
2577 		[CLKID_MPLL1_DIV]	    = &gxbb_mpll1_div.hw,
2578 		[CLKID_MPLL2_DIV]	    = &gxbb_mpll2_div.hw,
2579 		[CLKID_MPLL_PREDIV]	    = &gxbb_mpll_prediv.hw,
2580 		[CLKID_FCLK_DIV2_DIV]	    = &gxbb_fclk_div2_div.hw,
2581 		[CLKID_FCLK_DIV3_DIV]	    = &gxbb_fclk_div3_div.hw,
2582 		[CLKID_FCLK_DIV4_DIV]	    = &gxbb_fclk_div4_div.hw,
2583 		[CLKID_FCLK_DIV5_DIV]	    = &gxbb_fclk_div5_div.hw,
2584 		[CLKID_FCLK_DIV7_DIV]	    = &gxbb_fclk_div7_div.hw,
2585 		[CLKID_VDEC_1_SEL]	    = &gxbb_vdec_1_sel.hw,
2586 		[CLKID_VDEC_1_DIV]	    = &gxbb_vdec_1_div.hw,
2587 		[CLKID_VDEC_1]		    = &gxbb_vdec_1.hw,
2588 		[CLKID_VDEC_HEVC_SEL]	    = &gxbb_vdec_hevc_sel.hw,
2589 		[CLKID_VDEC_HEVC_DIV]	    = &gxbb_vdec_hevc_div.hw,
2590 		[CLKID_VDEC_HEVC]	    = &gxbb_vdec_hevc.hw,
2591 		[CLKID_GEN_CLK_SEL]	    = &gxbb_gen_clk_sel.hw,
2592 		[CLKID_GEN_CLK_DIV]	    = &gxbb_gen_clk_div.hw,
2593 		[CLKID_GEN_CLK]		    = &gxbb_gen_clk.hw,
2594 		[CLKID_FIXED_PLL_DCO]	    = &gxbb_fixed_pll_dco.hw,
2595 		[CLKID_HDMI_PLL_DCO]	    = &gxbb_hdmi_pll_dco.hw,
2596 		[CLKID_HDMI_PLL_OD]	    = &gxbb_hdmi_pll_od.hw,
2597 		[CLKID_HDMI_PLL_OD2]	    = &gxbb_hdmi_pll_od2.hw,
2598 		[CLKID_SYS_PLL_DCO]	    = &gxbb_sys_pll_dco.hw,
2599 		[CLKID_GP0_PLL_DCO]	    = &gxbb_gp0_pll_dco.hw,
2600 		[CLKID_VID_PLL_DIV]	    = &gxbb_vid_pll_div.hw,
2601 		[CLKID_VID_PLL_SEL]	    = &gxbb_vid_pll_sel.hw,
2602 		[CLKID_VID_PLL]		    = &gxbb_vid_pll.hw,
2603 		[CLKID_VCLK_SEL]	    = &gxbb_vclk_sel.hw,
2604 		[CLKID_VCLK2_SEL]	    = &gxbb_vclk2_sel.hw,
2605 		[CLKID_VCLK_INPUT]	    = &gxbb_vclk_input.hw,
2606 		[CLKID_VCLK2_INPUT]	    = &gxbb_vclk2_input.hw,
2607 		[CLKID_VCLK_DIV]	    = &gxbb_vclk_div.hw,
2608 		[CLKID_VCLK2_DIV]	    = &gxbb_vclk2_div.hw,
2609 		[CLKID_VCLK]		    = &gxbb_vclk.hw,
2610 		[CLKID_VCLK2]		    = &gxbb_vclk2.hw,
2611 		[CLKID_VCLK_DIV1]	    = &gxbb_vclk_div1.hw,
2612 		[CLKID_VCLK_DIV2_EN]	    = &gxbb_vclk_div2_en.hw,
2613 		[CLKID_VCLK_DIV2]	    = &gxbb_vclk_div2.hw,
2614 		[CLKID_VCLK_DIV4_EN]	    = &gxbb_vclk_div4_en.hw,
2615 		[CLKID_VCLK_DIV4]	    = &gxbb_vclk_div4.hw,
2616 		[CLKID_VCLK_DIV6_EN]	    = &gxbb_vclk_div6_en.hw,
2617 		[CLKID_VCLK_DIV6]	    = &gxbb_vclk_div6.hw,
2618 		[CLKID_VCLK_DIV12_EN]	    = &gxbb_vclk_div12_en.hw,
2619 		[CLKID_VCLK_DIV12]	    = &gxbb_vclk_div12.hw,
2620 		[CLKID_VCLK2_DIV1]	    = &gxbb_vclk2_div1.hw,
2621 		[CLKID_VCLK2_DIV2_EN]	    = &gxbb_vclk2_div2_en.hw,
2622 		[CLKID_VCLK2_DIV2]	    = &gxbb_vclk2_div2.hw,
2623 		[CLKID_VCLK2_DIV4_EN]	    = &gxbb_vclk2_div4_en.hw,
2624 		[CLKID_VCLK2_DIV4]	    = &gxbb_vclk2_div4.hw,
2625 		[CLKID_VCLK2_DIV6_EN]	    = &gxbb_vclk2_div6_en.hw,
2626 		[CLKID_VCLK2_DIV6]	    = &gxbb_vclk2_div6.hw,
2627 		[CLKID_VCLK2_DIV12_EN]	    = &gxbb_vclk2_div12_en.hw,
2628 		[CLKID_VCLK2_DIV12]	    = &gxbb_vclk2_div12.hw,
2629 		[CLKID_CTS_ENCI_SEL]	    = &gxbb_cts_enci_sel.hw,
2630 		[CLKID_CTS_ENCP_SEL]	    = &gxbb_cts_encp_sel.hw,
2631 		[CLKID_CTS_VDAC_SEL]	    = &gxbb_cts_vdac_sel.hw,
2632 		[CLKID_HDMI_TX_SEL]	    = &gxbb_hdmi_tx_sel.hw,
2633 		[CLKID_CTS_ENCI]	    = &gxbb_cts_enci.hw,
2634 		[CLKID_CTS_ENCP]	    = &gxbb_cts_encp.hw,
2635 		[CLKID_CTS_VDAC]	    = &gxbb_cts_vdac.hw,
2636 		[CLKID_HDMI_TX]		    = &gxbb_hdmi_tx.hw,
2637 		[CLKID_HDMI_SEL]	    = &gxbb_hdmi_sel.hw,
2638 		[CLKID_HDMI_DIV]	    = &gxbb_hdmi_div.hw,
2639 		[CLKID_HDMI]		    = &gxbb_hdmi.hw,
2640 		[NR_CLKS]		    = NULL,
2641 	},
2642 	.num = NR_CLKS,
2643 };
2644 
2645 static struct clk_hw_onecell_data gxl_hw_onecell_data = {
2646 	.hws = {
2647 		[CLKID_SYS_PLL]		    = &gxbb_sys_pll.hw,
2648 		[CLKID_HDMI_PLL]	    = &gxl_hdmi_pll.hw,
2649 		[CLKID_FIXED_PLL]	    = &gxbb_fixed_pll.hw,
2650 		[CLKID_FCLK_DIV2]	    = &gxbb_fclk_div2.hw,
2651 		[CLKID_FCLK_DIV3]	    = &gxbb_fclk_div3.hw,
2652 		[CLKID_FCLK_DIV4]	    = &gxbb_fclk_div4.hw,
2653 		[CLKID_FCLK_DIV5]	    = &gxbb_fclk_div5.hw,
2654 		[CLKID_FCLK_DIV7]	    = &gxbb_fclk_div7.hw,
2655 		[CLKID_GP0_PLL]		    = &gxbb_gp0_pll.hw,
2656 		[CLKID_MPEG_SEL]	    = &gxbb_mpeg_clk_sel.hw,
2657 		[CLKID_MPEG_DIV]	    = &gxbb_mpeg_clk_div.hw,
2658 		[CLKID_CLK81]		    = &gxbb_clk81.hw,
2659 		[CLKID_MPLL0]		    = &gxbb_mpll0.hw,
2660 		[CLKID_MPLL1]		    = &gxbb_mpll1.hw,
2661 		[CLKID_MPLL2]		    = &gxbb_mpll2.hw,
2662 		[CLKID_DDR]		    = &gxbb_ddr.hw,
2663 		[CLKID_DOS]		    = &gxbb_dos.hw,
2664 		[CLKID_ISA]		    = &gxbb_isa.hw,
2665 		[CLKID_PL301]		    = &gxbb_pl301.hw,
2666 		[CLKID_PERIPHS]		    = &gxbb_periphs.hw,
2667 		[CLKID_SPICC]		    = &gxbb_spicc.hw,
2668 		[CLKID_I2C]		    = &gxbb_i2c.hw,
2669 		[CLKID_SAR_ADC]		    = &gxbb_sar_adc.hw,
2670 		[CLKID_SMART_CARD]	    = &gxbb_smart_card.hw,
2671 		[CLKID_RNG0]		    = &gxbb_rng0.hw,
2672 		[CLKID_UART0]		    = &gxbb_uart0.hw,
2673 		[CLKID_SDHC]		    = &gxbb_sdhc.hw,
2674 		[CLKID_STREAM]		    = &gxbb_stream.hw,
2675 		[CLKID_ASYNC_FIFO]	    = &gxbb_async_fifo.hw,
2676 		[CLKID_SDIO]		    = &gxbb_sdio.hw,
2677 		[CLKID_ABUF]		    = &gxbb_abuf.hw,
2678 		[CLKID_HIU_IFACE]	    = &gxbb_hiu_iface.hw,
2679 		[CLKID_ASSIST_MISC]	    = &gxbb_assist_misc.hw,
2680 		[CLKID_SPI]		    = &gxbb_spi.hw,
2681 		[CLKID_I2S_SPDIF]	    = &gxbb_i2s_spdif.hw,
2682 		[CLKID_ETH]		    = &gxbb_eth.hw,
2683 		[CLKID_DEMUX]		    = &gxbb_demux.hw,
2684 		[CLKID_AIU_GLUE]	    = &gxbb_aiu_glue.hw,
2685 		[CLKID_IEC958]		    = &gxbb_iec958.hw,
2686 		[CLKID_I2S_OUT]		    = &gxbb_i2s_out.hw,
2687 		[CLKID_AMCLK]		    = &gxbb_amclk.hw,
2688 		[CLKID_AIFIFO2]		    = &gxbb_aififo2.hw,
2689 		[CLKID_MIXER]		    = &gxbb_mixer.hw,
2690 		[CLKID_MIXER_IFACE]	    = &gxbb_mixer_iface.hw,
2691 		[CLKID_ADC]		    = &gxbb_adc.hw,
2692 		[CLKID_BLKMV]		    = &gxbb_blkmv.hw,
2693 		[CLKID_AIU]		    = &gxbb_aiu.hw,
2694 		[CLKID_UART1]		    = &gxbb_uart1.hw,
2695 		[CLKID_G2D]		    = &gxbb_g2d.hw,
2696 		[CLKID_USB0]		    = &gxbb_usb0.hw,
2697 		[CLKID_USB1]		    = &gxbb_usb1.hw,
2698 		[CLKID_RESET]		    = &gxbb_reset.hw,
2699 		[CLKID_NAND]		    = &gxbb_nand.hw,
2700 		[CLKID_DOS_PARSER]	    = &gxbb_dos_parser.hw,
2701 		[CLKID_USB]		    = &gxbb_usb.hw,
2702 		[CLKID_VDIN1]		    = &gxbb_vdin1.hw,
2703 		[CLKID_AHB_ARB0]	    = &gxbb_ahb_arb0.hw,
2704 		[CLKID_EFUSE]		    = &gxbb_efuse.hw,
2705 		[CLKID_BOOT_ROM]	    = &gxbb_boot_rom.hw,
2706 		[CLKID_AHB_DATA_BUS]	    = &gxbb_ahb_data_bus.hw,
2707 		[CLKID_AHB_CTRL_BUS]	    = &gxbb_ahb_ctrl_bus.hw,
2708 		[CLKID_HDMI_INTR_SYNC]	    = &gxbb_hdmi_intr_sync.hw,
2709 		[CLKID_HDMI_PCLK]	    = &gxbb_hdmi_pclk.hw,
2710 		[CLKID_USB1_DDR_BRIDGE]	    = &gxbb_usb1_ddr_bridge.hw,
2711 		[CLKID_USB0_DDR_BRIDGE]	    = &gxbb_usb0_ddr_bridge.hw,
2712 		[CLKID_MMC_PCLK]	    = &gxbb_mmc_pclk.hw,
2713 		[CLKID_DVIN]		    = &gxbb_dvin.hw,
2714 		[CLKID_UART2]		    = &gxbb_uart2.hw,
2715 		[CLKID_SANA]		    = &gxbb_sana.hw,
2716 		[CLKID_VPU_INTR]	    = &gxbb_vpu_intr.hw,
2717 		[CLKID_SEC_AHB_AHB3_BRIDGE] = &gxbb_sec_ahb_ahb3_bridge.hw,
2718 		[CLKID_CLK81_A53]	    = &gxbb_clk81_a53.hw,
2719 		[CLKID_VCLK2_VENCI0]	    = &gxbb_vclk2_venci0.hw,
2720 		[CLKID_VCLK2_VENCI1]	    = &gxbb_vclk2_venci1.hw,
2721 		[CLKID_VCLK2_VENCP0]	    = &gxbb_vclk2_vencp0.hw,
2722 		[CLKID_VCLK2_VENCP1]	    = &gxbb_vclk2_vencp1.hw,
2723 		[CLKID_GCLK_VENCI_INT0]	    = &gxbb_gclk_venci_int0.hw,
2724 		[CLKID_GCLK_VENCI_INT]	    = &gxbb_gclk_vencp_int.hw,
2725 		[CLKID_DAC_CLK]		    = &gxbb_dac_clk.hw,
2726 		[CLKID_AOCLK_GATE]	    = &gxbb_aoclk_gate.hw,
2727 		[CLKID_IEC958_GATE]	    = &gxbb_iec958_gate.hw,
2728 		[CLKID_ENC480P]		    = &gxbb_enc480p.hw,
2729 		[CLKID_RNG1]		    = &gxbb_rng1.hw,
2730 		[CLKID_GCLK_VENCI_INT1]	    = &gxbb_gclk_venci_int1.hw,
2731 		[CLKID_VCLK2_VENCLMCC]	    = &gxbb_vclk2_venclmcc.hw,
2732 		[CLKID_VCLK2_VENCL]	    = &gxbb_vclk2_vencl.hw,
2733 		[CLKID_VCLK_OTHER]	    = &gxbb_vclk_other.hw,
2734 		[CLKID_EDP]		    = &gxbb_edp.hw,
2735 		[CLKID_AO_MEDIA_CPU]	    = &gxbb_ao_media_cpu.hw,
2736 		[CLKID_AO_AHB_SRAM]	    = &gxbb_ao_ahb_sram.hw,
2737 		[CLKID_AO_AHB_BUS]	    = &gxbb_ao_ahb_bus.hw,
2738 		[CLKID_AO_IFACE]	    = &gxbb_ao_iface.hw,
2739 		[CLKID_AO_I2C]		    = &gxbb_ao_i2c.hw,
2740 		[CLKID_SD_EMMC_A]	    = &gxbb_emmc_a.hw,
2741 		[CLKID_SD_EMMC_B]	    = &gxbb_emmc_b.hw,
2742 		[CLKID_SD_EMMC_C]	    = &gxbb_emmc_c.hw,
2743 		[CLKID_SAR_ADC_CLK]	    = &gxbb_sar_adc_clk.hw,
2744 		[CLKID_SAR_ADC_SEL]	    = &gxbb_sar_adc_clk_sel.hw,
2745 		[CLKID_SAR_ADC_DIV]	    = &gxbb_sar_adc_clk_div.hw,
2746 		[CLKID_MALI_0_SEL]	    = &gxbb_mali_0_sel.hw,
2747 		[CLKID_MALI_0_DIV]	    = &gxbb_mali_0_div.hw,
2748 		[CLKID_MALI_0]		    = &gxbb_mali_0.hw,
2749 		[CLKID_MALI_1_SEL]	    = &gxbb_mali_1_sel.hw,
2750 		[CLKID_MALI_1_DIV]	    = &gxbb_mali_1_div.hw,
2751 		[CLKID_MALI_1]		    = &gxbb_mali_1.hw,
2752 		[CLKID_MALI]		    = &gxbb_mali.hw,
2753 		[CLKID_CTS_AMCLK]	    = &gxbb_cts_amclk.hw,
2754 		[CLKID_CTS_AMCLK_SEL]	    = &gxbb_cts_amclk_sel.hw,
2755 		[CLKID_CTS_AMCLK_DIV]	    = &gxbb_cts_amclk_div.hw,
2756 		[CLKID_CTS_MCLK_I958]	    = &gxbb_cts_mclk_i958.hw,
2757 		[CLKID_CTS_MCLK_I958_SEL]   = &gxbb_cts_mclk_i958_sel.hw,
2758 		[CLKID_CTS_MCLK_I958_DIV]   = &gxbb_cts_mclk_i958_div.hw,
2759 		[CLKID_CTS_I958]	    = &gxbb_cts_i958.hw,
2760 		[CLKID_32K_CLK]		    = &gxbb_32k_clk.hw,
2761 		[CLKID_32K_CLK_SEL]	    = &gxbb_32k_clk_sel.hw,
2762 		[CLKID_32K_CLK_DIV]	    = &gxbb_32k_clk_div.hw,
2763 		[CLKID_SD_EMMC_A_CLK0_SEL]  = &gxbb_sd_emmc_a_clk0_sel.hw,
2764 		[CLKID_SD_EMMC_A_CLK0_DIV]  = &gxbb_sd_emmc_a_clk0_div.hw,
2765 		[CLKID_SD_EMMC_A_CLK0]	    = &gxbb_sd_emmc_a_clk0.hw,
2766 		[CLKID_SD_EMMC_B_CLK0_SEL]  = &gxbb_sd_emmc_b_clk0_sel.hw,
2767 		[CLKID_SD_EMMC_B_CLK0_DIV]  = &gxbb_sd_emmc_b_clk0_div.hw,
2768 		[CLKID_SD_EMMC_B_CLK0]	    = &gxbb_sd_emmc_b_clk0.hw,
2769 		[CLKID_SD_EMMC_C_CLK0_SEL]  = &gxbb_sd_emmc_c_clk0_sel.hw,
2770 		[CLKID_SD_EMMC_C_CLK0_DIV]  = &gxbb_sd_emmc_c_clk0_div.hw,
2771 		[CLKID_SD_EMMC_C_CLK0]	    = &gxbb_sd_emmc_c_clk0.hw,
2772 		[CLKID_VPU_0_SEL]	    = &gxbb_vpu_0_sel.hw,
2773 		[CLKID_VPU_0_DIV]	    = &gxbb_vpu_0_div.hw,
2774 		[CLKID_VPU_0]		    = &gxbb_vpu_0.hw,
2775 		[CLKID_VPU_1_SEL]	    = &gxbb_vpu_1_sel.hw,
2776 		[CLKID_VPU_1_DIV]	    = &gxbb_vpu_1_div.hw,
2777 		[CLKID_VPU_1]		    = &gxbb_vpu_1.hw,
2778 		[CLKID_VPU]		    = &gxbb_vpu.hw,
2779 		[CLKID_VAPB_0_SEL]	    = &gxbb_vapb_0_sel.hw,
2780 		[CLKID_VAPB_0_DIV]	    = &gxbb_vapb_0_div.hw,
2781 		[CLKID_VAPB_0]		    = &gxbb_vapb_0.hw,
2782 		[CLKID_VAPB_1_SEL]	    = &gxbb_vapb_1_sel.hw,
2783 		[CLKID_VAPB_1_DIV]	    = &gxbb_vapb_1_div.hw,
2784 		[CLKID_VAPB_1]		    = &gxbb_vapb_1.hw,
2785 		[CLKID_VAPB_SEL]	    = &gxbb_vapb_sel.hw,
2786 		[CLKID_VAPB]		    = &gxbb_vapb.hw,
2787 		[CLKID_MPLL0_DIV]	    = &gxbb_mpll0_div.hw,
2788 		[CLKID_MPLL1_DIV]	    = &gxbb_mpll1_div.hw,
2789 		[CLKID_MPLL2_DIV]	    = &gxbb_mpll2_div.hw,
2790 		[CLKID_MPLL_PREDIV]	    = &gxbb_mpll_prediv.hw,
2791 		[CLKID_FCLK_DIV2_DIV]	    = &gxbb_fclk_div2_div.hw,
2792 		[CLKID_FCLK_DIV3_DIV]	    = &gxbb_fclk_div3_div.hw,
2793 		[CLKID_FCLK_DIV4_DIV]	    = &gxbb_fclk_div4_div.hw,
2794 		[CLKID_FCLK_DIV5_DIV]	    = &gxbb_fclk_div5_div.hw,
2795 		[CLKID_FCLK_DIV7_DIV]	    = &gxbb_fclk_div7_div.hw,
2796 		[CLKID_VDEC_1_SEL]	    = &gxbb_vdec_1_sel.hw,
2797 		[CLKID_VDEC_1_DIV]	    = &gxbb_vdec_1_div.hw,
2798 		[CLKID_VDEC_1]		    = &gxbb_vdec_1.hw,
2799 		[CLKID_VDEC_HEVC_SEL]	    = &gxbb_vdec_hevc_sel.hw,
2800 		[CLKID_VDEC_HEVC_DIV]	    = &gxbb_vdec_hevc_div.hw,
2801 		[CLKID_VDEC_HEVC]	    = &gxbb_vdec_hevc.hw,
2802 		[CLKID_GEN_CLK_SEL]	    = &gxbb_gen_clk_sel.hw,
2803 		[CLKID_GEN_CLK_DIV]	    = &gxbb_gen_clk_div.hw,
2804 		[CLKID_GEN_CLK]		    = &gxbb_gen_clk.hw,
2805 		[CLKID_FIXED_PLL_DCO]	    = &gxbb_fixed_pll_dco.hw,
2806 		[CLKID_HDMI_PLL_DCO]	    = &gxl_hdmi_pll_dco.hw,
2807 		[CLKID_HDMI_PLL_OD]	    = &gxl_hdmi_pll_od.hw,
2808 		[CLKID_HDMI_PLL_OD2]	    = &gxl_hdmi_pll_od2.hw,
2809 		[CLKID_SYS_PLL_DCO]	    = &gxbb_sys_pll_dco.hw,
2810 		[CLKID_GP0_PLL_DCO]	    = &gxl_gp0_pll_dco.hw,
2811 		[CLKID_VID_PLL_DIV]	    = &gxbb_vid_pll_div.hw,
2812 		[CLKID_VID_PLL_SEL]	    = &gxbb_vid_pll_sel.hw,
2813 		[CLKID_VID_PLL]		    = &gxbb_vid_pll.hw,
2814 		[CLKID_VCLK_SEL]	    = &gxbb_vclk_sel.hw,
2815 		[CLKID_VCLK2_SEL]	    = &gxbb_vclk2_sel.hw,
2816 		[CLKID_VCLK_INPUT]	    = &gxbb_vclk_input.hw,
2817 		[CLKID_VCLK2_INPUT]	    = &gxbb_vclk2_input.hw,
2818 		[CLKID_VCLK_DIV]	    = &gxbb_vclk_div.hw,
2819 		[CLKID_VCLK2_DIV]	    = &gxbb_vclk2_div.hw,
2820 		[CLKID_VCLK]		    = &gxbb_vclk.hw,
2821 		[CLKID_VCLK2]		    = &gxbb_vclk2.hw,
2822 		[CLKID_VCLK_DIV1]	    = &gxbb_vclk_div1.hw,
2823 		[CLKID_VCLK_DIV2_EN]	    = &gxbb_vclk_div2_en.hw,
2824 		[CLKID_VCLK_DIV2]	    = &gxbb_vclk_div2.hw,
2825 		[CLKID_VCLK_DIV4_EN]	    = &gxbb_vclk_div4_en.hw,
2826 		[CLKID_VCLK_DIV4]	    = &gxbb_vclk_div4.hw,
2827 		[CLKID_VCLK_DIV6_EN]	    = &gxbb_vclk_div6_en.hw,
2828 		[CLKID_VCLK_DIV6]	    = &gxbb_vclk_div6.hw,
2829 		[CLKID_VCLK_DIV12_EN]	    = &gxbb_vclk_div12_en.hw,
2830 		[CLKID_VCLK_DIV12]	    = &gxbb_vclk_div12.hw,
2831 		[CLKID_VCLK2_DIV1]	    = &gxbb_vclk2_div1.hw,
2832 		[CLKID_VCLK2_DIV2_EN]	    = &gxbb_vclk2_div2_en.hw,
2833 		[CLKID_VCLK2_DIV2]	    = &gxbb_vclk2_div2.hw,
2834 		[CLKID_VCLK2_DIV4_EN]	    = &gxbb_vclk2_div4_en.hw,
2835 		[CLKID_VCLK2_DIV4]	    = &gxbb_vclk2_div4.hw,
2836 		[CLKID_VCLK2_DIV6_EN]	    = &gxbb_vclk2_div6_en.hw,
2837 		[CLKID_VCLK2_DIV6]	    = &gxbb_vclk2_div6.hw,
2838 		[CLKID_VCLK2_DIV12_EN]	    = &gxbb_vclk2_div12_en.hw,
2839 		[CLKID_VCLK2_DIV12]	    = &gxbb_vclk2_div12.hw,
2840 		[CLKID_CTS_ENCI_SEL]	    = &gxbb_cts_enci_sel.hw,
2841 		[CLKID_CTS_ENCP_SEL]	    = &gxbb_cts_encp_sel.hw,
2842 		[CLKID_CTS_VDAC_SEL]	    = &gxbb_cts_vdac_sel.hw,
2843 		[CLKID_HDMI_TX_SEL]	    = &gxbb_hdmi_tx_sel.hw,
2844 		[CLKID_CTS_ENCI]	    = &gxbb_cts_enci.hw,
2845 		[CLKID_CTS_ENCP]	    = &gxbb_cts_encp.hw,
2846 		[CLKID_CTS_VDAC]	    = &gxbb_cts_vdac.hw,
2847 		[CLKID_HDMI_TX]		    = &gxbb_hdmi_tx.hw,
2848 		[CLKID_HDMI_SEL]	    = &gxbb_hdmi_sel.hw,
2849 		[CLKID_HDMI_DIV]	    = &gxbb_hdmi_div.hw,
2850 		[CLKID_HDMI]		    = &gxbb_hdmi.hw,
2851 		[NR_CLKS]		    = NULL,
2852 	},
2853 	.num = NR_CLKS,
2854 };
2855 
2856 static struct clk_regmap *const gxbb_clk_regmaps[] = {
2857 	&gxbb_clk81,
2858 	&gxbb_ddr,
2859 	&gxbb_dos,
2860 	&gxbb_isa,
2861 	&gxbb_pl301,
2862 	&gxbb_periphs,
2863 	&gxbb_spicc,
2864 	&gxbb_i2c,
2865 	&gxbb_sar_adc,
2866 	&gxbb_smart_card,
2867 	&gxbb_rng0,
2868 	&gxbb_uart0,
2869 	&gxbb_sdhc,
2870 	&gxbb_stream,
2871 	&gxbb_async_fifo,
2872 	&gxbb_sdio,
2873 	&gxbb_abuf,
2874 	&gxbb_hiu_iface,
2875 	&gxbb_assist_misc,
2876 	&gxbb_spi,
2877 	&gxbb_i2s_spdif,
2878 	&gxbb_eth,
2879 	&gxbb_demux,
2880 	&gxbb_aiu_glue,
2881 	&gxbb_iec958,
2882 	&gxbb_i2s_out,
2883 	&gxbb_amclk,
2884 	&gxbb_aififo2,
2885 	&gxbb_mixer,
2886 	&gxbb_mixer_iface,
2887 	&gxbb_adc,
2888 	&gxbb_blkmv,
2889 	&gxbb_aiu,
2890 	&gxbb_uart1,
2891 	&gxbb_g2d,
2892 	&gxbb_usb0,
2893 	&gxbb_usb1,
2894 	&gxbb_reset,
2895 	&gxbb_nand,
2896 	&gxbb_dos_parser,
2897 	&gxbb_usb,
2898 	&gxbb_vdin1,
2899 	&gxbb_ahb_arb0,
2900 	&gxbb_efuse,
2901 	&gxbb_boot_rom,
2902 	&gxbb_ahb_data_bus,
2903 	&gxbb_ahb_ctrl_bus,
2904 	&gxbb_hdmi_intr_sync,
2905 	&gxbb_hdmi_pclk,
2906 	&gxbb_usb1_ddr_bridge,
2907 	&gxbb_usb0_ddr_bridge,
2908 	&gxbb_mmc_pclk,
2909 	&gxbb_dvin,
2910 	&gxbb_uart2,
2911 	&gxbb_sana,
2912 	&gxbb_vpu_intr,
2913 	&gxbb_sec_ahb_ahb3_bridge,
2914 	&gxbb_clk81_a53,
2915 	&gxbb_vclk2_venci0,
2916 	&gxbb_vclk2_venci1,
2917 	&gxbb_vclk2_vencp0,
2918 	&gxbb_vclk2_vencp1,
2919 	&gxbb_gclk_venci_int0,
2920 	&gxbb_gclk_vencp_int,
2921 	&gxbb_dac_clk,
2922 	&gxbb_aoclk_gate,
2923 	&gxbb_iec958_gate,
2924 	&gxbb_enc480p,
2925 	&gxbb_rng1,
2926 	&gxbb_gclk_venci_int1,
2927 	&gxbb_vclk2_venclmcc,
2928 	&gxbb_vclk2_vencl,
2929 	&gxbb_vclk_other,
2930 	&gxbb_edp,
2931 	&gxbb_ao_media_cpu,
2932 	&gxbb_ao_ahb_sram,
2933 	&gxbb_ao_ahb_bus,
2934 	&gxbb_ao_iface,
2935 	&gxbb_ao_i2c,
2936 	&gxbb_emmc_a,
2937 	&gxbb_emmc_b,
2938 	&gxbb_emmc_c,
2939 	&gxbb_sar_adc_clk,
2940 	&gxbb_mali_0,
2941 	&gxbb_mali_1,
2942 	&gxbb_cts_amclk,
2943 	&gxbb_cts_mclk_i958,
2944 	&gxbb_32k_clk,
2945 	&gxbb_sd_emmc_a_clk0,
2946 	&gxbb_sd_emmc_b_clk0,
2947 	&gxbb_sd_emmc_c_clk0,
2948 	&gxbb_vpu_0,
2949 	&gxbb_vpu_1,
2950 	&gxbb_vapb_0,
2951 	&gxbb_vapb_1,
2952 	&gxbb_vapb,
2953 	&gxbb_mpeg_clk_div,
2954 	&gxbb_sar_adc_clk_div,
2955 	&gxbb_mali_0_div,
2956 	&gxbb_mali_1_div,
2957 	&gxbb_cts_mclk_i958_div,
2958 	&gxbb_32k_clk_div,
2959 	&gxbb_sd_emmc_a_clk0_div,
2960 	&gxbb_sd_emmc_b_clk0_div,
2961 	&gxbb_sd_emmc_c_clk0_div,
2962 	&gxbb_vpu_0_div,
2963 	&gxbb_vpu_1_div,
2964 	&gxbb_vapb_0_div,
2965 	&gxbb_vapb_1_div,
2966 	&gxbb_mpeg_clk_sel,
2967 	&gxbb_sar_adc_clk_sel,
2968 	&gxbb_mali_0_sel,
2969 	&gxbb_mali_1_sel,
2970 	&gxbb_mali,
2971 	&gxbb_cts_amclk_sel,
2972 	&gxbb_cts_mclk_i958_sel,
2973 	&gxbb_cts_i958,
2974 	&gxbb_32k_clk_sel,
2975 	&gxbb_sd_emmc_a_clk0_sel,
2976 	&gxbb_sd_emmc_b_clk0_sel,
2977 	&gxbb_sd_emmc_c_clk0_sel,
2978 	&gxbb_vpu_0_sel,
2979 	&gxbb_vpu_1_sel,
2980 	&gxbb_vpu,
2981 	&gxbb_vapb_0_sel,
2982 	&gxbb_vapb_1_sel,
2983 	&gxbb_vapb_sel,
2984 	&gxbb_mpll0,
2985 	&gxbb_mpll1,
2986 	&gxbb_mpll2,
2987 	&gxbb_mpll0_div,
2988 	&gxbb_mpll1_div,
2989 	&gxbb_mpll2_div,
2990 	&gxbb_cts_amclk_div,
2991 	&gxbb_fixed_pll,
2992 	&gxbb_sys_pll,
2993 	&gxbb_mpll_prediv,
2994 	&gxbb_fclk_div2,
2995 	&gxbb_fclk_div3,
2996 	&gxbb_fclk_div4,
2997 	&gxbb_fclk_div5,
2998 	&gxbb_fclk_div7,
2999 	&gxbb_vdec_1_sel,
3000 	&gxbb_vdec_1_div,
3001 	&gxbb_vdec_1,
3002 	&gxbb_vdec_hevc_sel,
3003 	&gxbb_vdec_hevc_div,
3004 	&gxbb_vdec_hevc,
3005 	&gxbb_gen_clk_sel,
3006 	&gxbb_gen_clk_div,
3007 	&gxbb_gen_clk,
3008 	&gxbb_fixed_pll_dco,
3009 	&gxbb_sys_pll_dco,
3010 	&gxbb_gp0_pll,
3011 	&gxbb_vid_pll,
3012 	&gxbb_vid_pll_sel,
3013 	&gxbb_vid_pll_div,
3014 	&gxbb_vclk,
3015 	&gxbb_vclk_sel,
3016 	&gxbb_vclk_div,
3017 	&gxbb_vclk_input,
3018 	&gxbb_vclk_div1,
3019 	&gxbb_vclk_div2_en,
3020 	&gxbb_vclk_div4_en,
3021 	&gxbb_vclk_div6_en,
3022 	&gxbb_vclk_div12_en,
3023 	&gxbb_vclk2,
3024 	&gxbb_vclk2_sel,
3025 	&gxbb_vclk2_div,
3026 	&gxbb_vclk2_input,
3027 	&gxbb_vclk2_div1,
3028 	&gxbb_vclk2_div2_en,
3029 	&gxbb_vclk2_div4_en,
3030 	&gxbb_vclk2_div6_en,
3031 	&gxbb_vclk2_div12_en,
3032 	&gxbb_cts_enci,
3033 	&gxbb_cts_enci_sel,
3034 	&gxbb_cts_encp,
3035 	&gxbb_cts_encp_sel,
3036 	&gxbb_cts_vdac,
3037 	&gxbb_cts_vdac_sel,
3038 	&gxbb_hdmi_tx,
3039 	&gxbb_hdmi_tx_sel,
3040 	&gxbb_hdmi_sel,
3041 	&gxbb_hdmi_div,
3042 	&gxbb_hdmi,
3043 	&gxbb_gp0_pll_dco,
3044 	&gxbb_hdmi_pll,
3045 	&gxbb_hdmi_pll_od,
3046 	&gxbb_hdmi_pll_od2,
3047 	&gxbb_hdmi_pll_dco,
3048 };
3049 
3050 static struct clk_regmap *const gxl_clk_regmaps[] = {
3051 	&gxbb_clk81,
3052 	&gxbb_ddr,
3053 	&gxbb_dos,
3054 	&gxbb_isa,
3055 	&gxbb_pl301,
3056 	&gxbb_periphs,
3057 	&gxbb_spicc,
3058 	&gxbb_i2c,
3059 	&gxbb_sar_adc,
3060 	&gxbb_smart_card,
3061 	&gxbb_rng0,
3062 	&gxbb_uart0,
3063 	&gxbb_sdhc,
3064 	&gxbb_stream,
3065 	&gxbb_async_fifo,
3066 	&gxbb_sdio,
3067 	&gxbb_abuf,
3068 	&gxbb_hiu_iface,
3069 	&gxbb_assist_misc,
3070 	&gxbb_spi,
3071 	&gxbb_i2s_spdif,
3072 	&gxbb_eth,
3073 	&gxbb_demux,
3074 	&gxbb_aiu_glue,
3075 	&gxbb_iec958,
3076 	&gxbb_i2s_out,
3077 	&gxbb_amclk,
3078 	&gxbb_aififo2,
3079 	&gxbb_mixer,
3080 	&gxbb_mixer_iface,
3081 	&gxbb_adc,
3082 	&gxbb_blkmv,
3083 	&gxbb_aiu,
3084 	&gxbb_uart1,
3085 	&gxbb_g2d,
3086 	&gxbb_usb0,
3087 	&gxbb_usb1,
3088 	&gxbb_reset,
3089 	&gxbb_nand,
3090 	&gxbb_dos_parser,
3091 	&gxbb_usb,
3092 	&gxbb_vdin1,
3093 	&gxbb_ahb_arb0,
3094 	&gxbb_efuse,
3095 	&gxbb_boot_rom,
3096 	&gxbb_ahb_data_bus,
3097 	&gxbb_ahb_ctrl_bus,
3098 	&gxbb_hdmi_intr_sync,
3099 	&gxbb_hdmi_pclk,
3100 	&gxbb_usb1_ddr_bridge,
3101 	&gxbb_usb0_ddr_bridge,
3102 	&gxbb_mmc_pclk,
3103 	&gxbb_dvin,
3104 	&gxbb_uart2,
3105 	&gxbb_sana,
3106 	&gxbb_vpu_intr,
3107 	&gxbb_sec_ahb_ahb3_bridge,
3108 	&gxbb_clk81_a53,
3109 	&gxbb_vclk2_venci0,
3110 	&gxbb_vclk2_venci1,
3111 	&gxbb_vclk2_vencp0,
3112 	&gxbb_vclk2_vencp1,
3113 	&gxbb_gclk_venci_int0,
3114 	&gxbb_gclk_vencp_int,
3115 	&gxbb_dac_clk,
3116 	&gxbb_aoclk_gate,
3117 	&gxbb_iec958_gate,
3118 	&gxbb_enc480p,
3119 	&gxbb_rng1,
3120 	&gxbb_gclk_venci_int1,
3121 	&gxbb_vclk2_venclmcc,
3122 	&gxbb_vclk2_vencl,
3123 	&gxbb_vclk_other,
3124 	&gxbb_edp,
3125 	&gxbb_ao_media_cpu,
3126 	&gxbb_ao_ahb_sram,
3127 	&gxbb_ao_ahb_bus,
3128 	&gxbb_ao_iface,
3129 	&gxbb_ao_i2c,
3130 	&gxbb_emmc_a,
3131 	&gxbb_emmc_b,
3132 	&gxbb_emmc_c,
3133 	&gxbb_sar_adc_clk,
3134 	&gxbb_mali_0,
3135 	&gxbb_mali_1,
3136 	&gxbb_cts_amclk,
3137 	&gxbb_cts_mclk_i958,
3138 	&gxbb_32k_clk,
3139 	&gxbb_sd_emmc_a_clk0,
3140 	&gxbb_sd_emmc_b_clk0,
3141 	&gxbb_sd_emmc_c_clk0,
3142 	&gxbb_vpu_0,
3143 	&gxbb_vpu_1,
3144 	&gxbb_vapb_0,
3145 	&gxbb_vapb_1,
3146 	&gxbb_vapb,
3147 	&gxbb_mpeg_clk_div,
3148 	&gxbb_sar_adc_clk_div,
3149 	&gxbb_mali_0_div,
3150 	&gxbb_mali_1_div,
3151 	&gxbb_cts_mclk_i958_div,
3152 	&gxbb_32k_clk_div,
3153 	&gxbb_sd_emmc_a_clk0_div,
3154 	&gxbb_sd_emmc_b_clk0_div,
3155 	&gxbb_sd_emmc_c_clk0_div,
3156 	&gxbb_vpu_0_div,
3157 	&gxbb_vpu_1_div,
3158 	&gxbb_vapb_0_div,
3159 	&gxbb_vapb_1_div,
3160 	&gxbb_mpeg_clk_sel,
3161 	&gxbb_sar_adc_clk_sel,
3162 	&gxbb_mali_0_sel,
3163 	&gxbb_mali_1_sel,
3164 	&gxbb_mali,
3165 	&gxbb_cts_amclk_sel,
3166 	&gxbb_cts_mclk_i958_sel,
3167 	&gxbb_cts_i958,
3168 	&gxbb_32k_clk_sel,
3169 	&gxbb_sd_emmc_a_clk0_sel,
3170 	&gxbb_sd_emmc_b_clk0_sel,
3171 	&gxbb_sd_emmc_c_clk0_sel,
3172 	&gxbb_vpu_0_sel,
3173 	&gxbb_vpu_1_sel,
3174 	&gxbb_vpu,
3175 	&gxbb_vapb_0_sel,
3176 	&gxbb_vapb_1_sel,
3177 	&gxbb_vapb_sel,
3178 	&gxbb_mpll0,
3179 	&gxbb_mpll1,
3180 	&gxbb_mpll2,
3181 	&gxbb_mpll0_div,
3182 	&gxbb_mpll1_div,
3183 	&gxbb_mpll2_div,
3184 	&gxbb_cts_amclk_div,
3185 	&gxbb_fixed_pll,
3186 	&gxbb_sys_pll,
3187 	&gxbb_mpll_prediv,
3188 	&gxbb_fclk_div2,
3189 	&gxbb_fclk_div3,
3190 	&gxbb_fclk_div4,
3191 	&gxbb_fclk_div5,
3192 	&gxbb_fclk_div7,
3193 	&gxbb_vdec_1_sel,
3194 	&gxbb_vdec_1_div,
3195 	&gxbb_vdec_1,
3196 	&gxbb_vdec_hevc_sel,
3197 	&gxbb_vdec_hevc_div,
3198 	&gxbb_vdec_hevc,
3199 	&gxbb_gen_clk_sel,
3200 	&gxbb_gen_clk_div,
3201 	&gxbb_gen_clk,
3202 	&gxbb_fixed_pll_dco,
3203 	&gxbb_sys_pll_dco,
3204 	&gxbb_gp0_pll,
3205 	&gxbb_vid_pll,
3206 	&gxbb_vid_pll_sel,
3207 	&gxbb_vid_pll_div,
3208 	&gxbb_vclk,
3209 	&gxbb_vclk_sel,
3210 	&gxbb_vclk_div,
3211 	&gxbb_vclk_input,
3212 	&gxbb_vclk_div1,
3213 	&gxbb_vclk_div2_en,
3214 	&gxbb_vclk_div4_en,
3215 	&gxbb_vclk_div6_en,
3216 	&gxbb_vclk_div12_en,
3217 	&gxbb_vclk2,
3218 	&gxbb_vclk2_sel,
3219 	&gxbb_vclk2_div,
3220 	&gxbb_vclk2_input,
3221 	&gxbb_vclk2_div1,
3222 	&gxbb_vclk2_div2_en,
3223 	&gxbb_vclk2_div4_en,
3224 	&gxbb_vclk2_div6_en,
3225 	&gxbb_vclk2_div12_en,
3226 	&gxbb_cts_enci,
3227 	&gxbb_cts_enci_sel,
3228 	&gxbb_cts_encp,
3229 	&gxbb_cts_encp_sel,
3230 	&gxbb_cts_vdac,
3231 	&gxbb_cts_vdac_sel,
3232 	&gxbb_hdmi_tx,
3233 	&gxbb_hdmi_tx_sel,
3234 	&gxbb_hdmi_sel,
3235 	&gxbb_hdmi_div,
3236 	&gxbb_hdmi,
3237 	&gxl_gp0_pll_dco,
3238 	&gxl_hdmi_pll,
3239 	&gxl_hdmi_pll_od,
3240 	&gxl_hdmi_pll_od2,
3241 	&gxl_hdmi_pll_dco,
3242 };
3243 
3244 static const struct meson_eeclkc_data gxbb_clkc_data = {
3245 	.regmap_clks = gxbb_clk_regmaps,
3246 	.regmap_clk_num = ARRAY_SIZE(gxbb_clk_regmaps),
3247 	.hw_onecell_data = &gxbb_hw_onecell_data,
3248 };
3249 
3250 static const struct meson_eeclkc_data gxl_clkc_data = {
3251 	.regmap_clks = gxl_clk_regmaps,
3252 	.regmap_clk_num = ARRAY_SIZE(gxl_clk_regmaps),
3253 	.hw_onecell_data = &gxl_hw_onecell_data,
3254 };
3255 
3256 static const struct of_device_id clkc_match_table[] = {
3257 	{ .compatible = "amlogic,gxbb-clkc", .data = &gxbb_clkc_data },
3258 	{ .compatible = "amlogic,gxl-clkc", .data = &gxl_clkc_data },
3259 	{},
3260 };
3261 
3262 static struct platform_driver gxbb_driver = {
3263 	.probe		= meson_eeclkc_probe,
3264 	.driver		= {
3265 		.name	= "gxbb-clkc",
3266 		.of_match_table = clkc_match_table,
3267 	},
3268 };
3269 
3270 builtin_platform_driver(gxbb_driver);
3271