1 // SPDX-License-Identifier: GPL-2.0+
3 * Amlogic Meson-G12A Clock Controller Driver
5 * Copyright (c) 2016 Baylibre SAS.
6 * Author: Michael Turquette <mturquette@baylibre.com>
8 * Copyright (c) 2018 Amlogic, inc.
9 * Author: Qiufang Dai <qiufang.dai@amlogic.com>
10 * Author: Jian Hu <jian.hu@amlogic.com>
13 #include <linux/clk-provider.h>
14 #include <linux/init.h>
15 #include <linux/of_device.h>
16 #include <linux/platform_device.h>
18 #include "clk-input.h"
21 #include "clk-regmap.h"
22 #include "vid-pll-div.h"
23 #include "meson-eeclk.h"
26 static DEFINE_SPINLOCK(meson_clk_lock
);
28 static struct clk_regmap g12a_fixed_pll_dco
= {
29 .data
= &(struct meson_clk_pll_data
){
31 .reg_off
= HHI_FIX_PLL_CNTL0
,
36 .reg_off
= HHI_FIX_PLL_CNTL0
,
41 .reg_off
= HHI_FIX_PLL_CNTL0
,
46 .reg_off
= HHI_FIX_PLL_CNTL1
,
51 .reg_off
= HHI_FIX_PLL_CNTL0
,
56 .reg_off
= HHI_FIX_PLL_CNTL0
,
61 .hw
.init
= &(struct clk_init_data
){
62 .name
= "fixed_pll_dco",
63 .ops
= &meson_clk_pll_ro_ops
,
64 .parent_names
= (const char *[]){ IN_PREFIX
"xtal" },
69 static struct clk_regmap g12a_fixed_pll
= {
70 .data
= &(struct clk_regmap_div_data
){
71 .offset
= HHI_FIX_PLL_CNTL0
,
74 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
76 .hw
.init
= &(struct clk_init_data
){
78 .ops
= &clk_regmap_divider_ro_ops
,
79 .parent_names
= (const char *[]){ "fixed_pll_dco" },
82 * This clock won't ever change at runtime so
83 * CLK_SET_RATE_PARENT is not required
89 * Internal sys pll emulation configuration parameters
91 static const struct reg_sequence g12a_sys_init_regs
[] = {
92 { .reg
= HHI_SYS_PLL_CNTL1
, .def
= 0x00000000 },
93 { .reg
= HHI_SYS_PLL_CNTL2
, .def
= 0x00000000 },
94 { .reg
= HHI_SYS_PLL_CNTL3
, .def
= 0x48681c00 },
95 { .reg
= HHI_SYS_PLL_CNTL4
, .def
= 0x88770290 },
96 { .reg
= HHI_SYS_PLL_CNTL5
, .def
= 0x39272000 },
97 { .reg
= HHI_SYS_PLL_CNTL6
, .def
= 0x56540000 },
100 static struct clk_regmap g12a_sys_pll_dco
= {
101 .data
= &(struct meson_clk_pll_data
){
103 .reg_off
= HHI_SYS_PLL_CNTL0
,
108 .reg_off
= HHI_SYS_PLL_CNTL0
,
113 .reg_off
= HHI_SYS_PLL_CNTL0
,
118 .reg_off
= HHI_SYS_PLL_CNTL0
,
123 .reg_off
= HHI_SYS_PLL_CNTL0
,
127 .init_regs
= g12a_sys_init_regs
,
128 .init_count
= ARRAY_SIZE(g12a_sys_init_regs
),
130 .hw
.init
= &(struct clk_init_data
){
131 .name
= "sys_pll_dco",
132 .ops
= &meson_clk_pll_ro_ops
,
133 .parent_names
= (const char *[]){ IN_PREFIX
"xtal" },
138 static struct clk_regmap g12a_sys_pll
= {
139 .data
= &(struct clk_regmap_div_data
){
140 .offset
= HHI_SYS_PLL_CNTL0
,
143 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
145 .hw
.init
= &(struct clk_init_data
){
147 .ops
= &clk_regmap_divider_ro_ops
,
148 .parent_names
= (const char *[]){ "sys_pll_dco" },
153 static struct clk_regmap g12b_sys1_pll_dco
= {
154 .data
= &(struct meson_clk_pll_data
){
156 .reg_off
= HHI_SYS1_PLL_CNTL0
,
161 .reg_off
= HHI_SYS1_PLL_CNTL0
,
166 .reg_off
= HHI_SYS1_PLL_CNTL0
,
171 .reg_off
= HHI_SYS1_PLL_CNTL0
,
176 .reg_off
= HHI_SYS1_PLL_CNTL0
,
181 .hw
.init
= &(struct clk_init_data
){
182 .name
= "sys1_pll_dco",
183 .ops
= &meson_clk_pll_ro_ops
,
184 .parent_names
= (const char *[]){ IN_PREFIX
"xtal" },
189 static struct clk_regmap g12b_sys1_pll
= {
190 .data
= &(struct clk_regmap_div_data
){
191 .offset
= HHI_SYS1_PLL_CNTL0
,
194 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
196 .hw
.init
= &(struct clk_init_data
){
198 .ops
= &clk_regmap_divider_ro_ops
,
199 .parent_names
= (const char *[]){ "sys1_pll_dco" },
204 static struct clk_regmap g12a_sys_pll_div16_en
= {
205 .data
= &(struct clk_regmap_gate_data
){
206 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
209 .hw
.init
= &(struct clk_init_data
) {
210 .name
= "sys_pll_div16_en",
211 .ops
= &clk_regmap_gate_ro_ops
,
212 .parent_names
= (const char *[]){ "sys_pll" },
215 * This clock is used to debug the sys_pll range
216 * Linux should not change it at runtime
221 static struct clk_regmap g12b_sys1_pll_div16_en
= {
222 .data
= &(struct clk_regmap_gate_data
){
223 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
226 .hw
.init
= &(struct clk_init_data
) {
227 .name
= "sys1_pll_div16_en",
228 .ops
= &clk_regmap_gate_ro_ops
,
229 .parent_names
= (const char *[]){ "sys1_pll" },
232 * This clock is used to debug the sys_pll range
233 * Linux should not change it at runtime
238 static struct clk_fixed_factor g12a_sys_pll_div16
= {
241 .hw
.init
= &(struct clk_init_data
){
242 .name
= "sys_pll_div16",
243 .ops
= &clk_fixed_factor_ops
,
244 .parent_names
= (const char *[]){ "sys_pll_div16_en" },
249 static struct clk_fixed_factor g12b_sys1_pll_div16
= {
252 .hw
.init
= &(struct clk_init_data
){
253 .name
= "sys1_pll_div16",
254 .ops
= &clk_fixed_factor_ops
,
255 .parent_names
= (const char *[]){ "sys1_pll_div16_en" },
260 /* Datasheet names this field as "premux0" */
261 static struct clk_regmap g12a_cpu_clk_premux0
= {
262 .data
= &(struct clk_regmap_mux_data
){
263 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
267 .hw
.init
= &(struct clk_init_data
){
268 .name
= "cpu_clk_dyn0_sel",
269 .ops
= &clk_regmap_mux_ro_ops
,
270 .parent_names
= (const char *[]){ IN_PREFIX
"xtal",
277 /* Datasheet names this field as "mux0_divn_tcnt" */
278 static struct clk_regmap g12a_cpu_clk_mux0_div
= {
279 .data
= &(struct clk_regmap_div_data
){
280 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
284 .hw
.init
= &(struct clk_init_data
){
285 .name
= "cpu_clk_dyn0_div",
286 .ops
= &clk_regmap_divider_ro_ops
,
287 .parent_names
= (const char *[]){ "cpu_clk_dyn0_sel" },
292 /* Datasheet names this field as "postmux0" */
293 static struct clk_regmap g12a_cpu_clk_postmux0
= {
294 .data
= &(struct clk_regmap_mux_data
){
295 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
299 .hw
.init
= &(struct clk_init_data
){
300 .name
= "cpu_clk_dyn0",
301 .ops
= &clk_regmap_mux_ro_ops
,
302 .parent_names
= (const char *[]){ "cpu_clk_dyn0_sel",
303 "cpu_clk_dyn0_div" },
308 /* Datasheet names this field as "premux1" */
309 static struct clk_regmap g12a_cpu_clk_premux1
= {
310 .data
= &(struct clk_regmap_mux_data
){
311 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
315 .hw
.init
= &(struct clk_init_data
){
316 .name
= "cpu_clk_dyn1_sel",
317 .ops
= &clk_regmap_mux_ro_ops
,
318 .parent_names
= (const char *[]){ IN_PREFIX
"xtal",
325 /* Datasheet names this field as "Mux1_divn_tcnt" */
326 static struct clk_regmap g12a_cpu_clk_mux1_div
= {
327 .data
= &(struct clk_regmap_div_data
){
328 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
332 .hw
.init
= &(struct clk_init_data
){
333 .name
= "cpu_clk_dyn1_div",
334 .ops
= &clk_regmap_divider_ro_ops
,
335 .parent_names
= (const char *[]){ "cpu_clk_dyn1_sel" },
340 /* Datasheet names this field as "postmux1" */
341 static struct clk_regmap g12a_cpu_clk_postmux1
= {
342 .data
= &(struct clk_regmap_mux_data
){
343 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
347 .hw
.init
= &(struct clk_init_data
){
348 .name
= "cpu_clk_dyn1",
349 .ops
= &clk_regmap_mux_ro_ops
,
350 .parent_names
= (const char *[]){ "cpu_clk_dyn1_sel",
351 "cpu_clk_dyn1_div" },
356 /* Datasheet names this field as "Final_dyn_mux_sel" */
357 static struct clk_regmap g12a_cpu_clk_dyn
= {
358 .data
= &(struct clk_regmap_mux_data
){
359 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
363 .hw
.init
= &(struct clk_init_data
){
364 .name
= "cpu_clk_dyn",
365 .ops
= &clk_regmap_mux_ro_ops
,
366 .parent_names
= (const char *[]){ "cpu_clk_dyn0",
372 /* Datasheet names this field as "Final_mux_sel" */
373 static struct clk_regmap g12a_cpu_clk
= {
374 .data
= &(struct clk_regmap_mux_data
){
375 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
379 .hw
.init
= &(struct clk_init_data
){
381 .ops
= &clk_regmap_mux_ro_ops
,
382 .parent_names
= (const char *[]){ "cpu_clk_dyn",
388 /* Datasheet names this field as "Final_mux_sel" */
389 static struct clk_regmap g12b_cpu_clk
= {
390 .data
= &(struct clk_regmap_mux_data
){
391 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
395 .hw
.init
= &(struct clk_init_data
){
397 .ops
= &clk_regmap_mux_ro_ops
,
398 .parent_names
= (const char *[]){ "cpu_clk_dyn",
404 /* Datasheet names this field as "premux0" */
405 static struct clk_regmap g12b_cpub_clk_premux0
= {
406 .data
= &(struct clk_regmap_mux_data
){
407 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
411 .hw
.init
= &(struct clk_init_data
){
412 .name
= "cpub_clk_dyn0_sel",
413 .ops
= &clk_regmap_mux_ro_ops
,
414 .parent_names
= (const char *[]){ IN_PREFIX
"xtal",
421 /* Datasheet names this field as "mux0_divn_tcnt" */
422 static struct clk_regmap g12b_cpub_clk_mux0_div
= {
423 .data
= &(struct clk_regmap_div_data
){
424 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
428 .hw
.init
= &(struct clk_init_data
){
429 .name
= "cpub_clk_dyn0_div",
430 .ops
= &clk_regmap_divider_ro_ops
,
431 .parent_names
= (const char *[]){ "cpub_clk_dyn0_sel" },
436 /* Datasheet names this field as "postmux0" */
437 static struct clk_regmap g12b_cpub_clk_postmux0
= {
438 .data
= &(struct clk_regmap_mux_data
){
439 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
443 .hw
.init
= &(struct clk_init_data
){
444 .name
= "cpub_clk_dyn0",
445 .ops
= &clk_regmap_mux_ro_ops
,
446 .parent_names
= (const char *[]){ "cpub_clk_dyn0_sel",
447 "cpub_clk_dyn0_div" },
452 /* Datasheet names this field as "premux1" */
453 static struct clk_regmap g12b_cpub_clk_premux1
= {
454 .data
= &(struct clk_regmap_mux_data
){
455 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
459 .hw
.init
= &(struct clk_init_data
){
460 .name
= "cpub_clk_dyn1_sel",
461 .ops
= &clk_regmap_mux_ro_ops
,
462 .parent_names
= (const char *[]){ IN_PREFIX
"xtal",
469 /* Datasheet names this field as "Mux1_divn_tcnt" */
470 static struct clk_regmap g12b_cpub_clk_mux1_div
= {
471 .data
= &(struct clk_regmap_div_data
){
472 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
476 .hw
.init
= &(struct clk_init_data
){
477 .name
= "cpub_clk_dyn1_div",
478 .ops
= &clk_regmap_divider_ro_ops
,
479 .parent_names
= (const char *[]){ "cpub_clk_dyn1_sel" },
484 /* Datasheet names this field as "postmux1" */
485 static struct clk_regmap g12b_cpub_clk_postmux1
= {
486 .data
= &(struct clk_regmap_mux_data
){
487 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
491 .hw
.init
= &(struct clk_init_data
){
492 .name
= "cpub_clk_dyn1",
493 .ops
= &clk_regmap_mux_ro_ops
,
494 .parent_names
= (const char *[]){ "cpub_clk_dyn1_sel",
495 "cpub_clk_dyn1_div" },
500 /* Datasheet names this field as "Final_dyn_mux_sel" */
501 static struct clk_regmap g12b_cpub_clk_dyn
= {
502 .data
= &(struct clk_regmap_mux_data
){
503 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
507 .hw
.init
= &(struct clk_init_data
){
508 .name
= "cpub_clk_dyn",
509 .ops
= &clk_regmap_mux_ro_ops
,
510 .parent_names
= (const char *[]){ "cpub_clk_dyn0",
516 /* Datasheet names this field as "Final_mux_sel" */
517 static struct clk_regmap g12b_cpub_clk
= {
518 .data
= &(struct clk_regmap_mux_data
){
519 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
523 .hw
.init
= &(struct clk_init_data
){
525 .ops
= &clk_regmap_mux_ro_ops
,
526 .parent_names
= (const char *[]){ "cpub_clk_dyn",
532 static struct clk_regmap g12a_cpu_clk_div16_en
= {
533 .data
= &(struct clk_regmap_gate_data
){
534 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
537 .hw
.init
= &(struct clk_init_data
) {
538 .name
= "cpu_clk_div16_en",
539 .ops
= &clk_regmap_gate_ro_ops
,
540 .parent_names
= (const char *[]){ "cpu_clk" },
543 * This clock is used to debug the cpu_clk range
544 * Linux should not change it at runtime
549 static struct clk_regmap g12b_cpub_clk_div16_en
= {
550 .data
= &(struct clk_regmap_gate_data
){
551 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
554 .hw
.init
= &(struct clk_init_data
) {
555 .name
= "cpub_clk_div16_en",
556 .ops
= &clk_regmap_gate_ro_ops
,
557 .parent_names
= (const char *[]){ "cpub_clk" },
560 * This clock is used to debug the cpu_clk range
561 * Linux should not change it at runtime
566 static struct clk_fixed_factor g12a_cpu_clk_div16
= {
569 .hw
.init
= &(struct clk_init_data
){
570 .name
= "cpu_clk_div16",
571 .ops
= &clk_fixed_factor_ops
,
572 .parent_names
= (const char *[]){ "cpu_clk_div16_en" },
577 static struct clk_fixed_factor g12b_cpub_clk_div16
= {
580 .hw
.init
= &(struct clk_init_data
){
581 .name
= "cpub_clk_div16",
582 .ops
= &clk_fixed_factor_ops
,
583 .parent_names
= (const char *[]){ "cpub_clk_div16_en" },
588 static struct clk_regmap g12a_cpu_clk_apb_div
= {
589 .data
= &(struct clk_regmap_div_data
){
590 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
593 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
595 .hw
.init
= &(struct clk_init_data
){
596 .name
= "cpu_clk_apb_div",
597 .ops
= &clk_regmap_divider_ro_ops
,
598 .parent_names
= (const char *[]){ "cpu_clk" },
603 static struct clk_regmap g12a_cpu_clk_apb
= {
604 .data
= &(struct clk_regmap_gate_data
){
605 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
608 .hw
.init
= &(struct clk_init_data
) {
609 .name
= "cpu_clk_apb",
610 .ops
= &clk_regmap_gate_ro_ops
,
611 .parent_names
= (const char *[]){ "cpu_clk_apb_div" },
614 * This clock is set by the ROM monitor code,
615 * Linux should not change it at runtime
620 static struct clk_regmap g12a_cpu_clk_atb_div
= {
621 .data
= &(struct clk_regmap_div_data
){
622 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
625 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
627 .hw
.init
= &(struct clk_init_data
){
628 .name
= "cpu_clk_atb_div",
629 .ops
= &clk_regmap_divider_ro_ops
,
630 .parent_names
= (const char *[]){ "cpu_clk" },
635 static struct clk_regmap g12a_cpu_clk_atb
= {
636 .data
= &(struct clk_regmap_gate_data
){
637 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
640 .hw
.init
= &(struct clk_init_data
) {
641 .name
= "cpu_clk_atb",
642 .ops
= &clk_regmap_gate_ro_ops
,
643 .parent_names
= (const char *[]){ "cpu_clk_atb_div" },
646 * This clock is set by the ROM monitor code,
647 * Linux should not change it at runtime
652 static struct clk_regmap g12a_cpu_clk_axi_div
= {
653 .data
= &(struct clk_regmap_div_data
){
654 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
657 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
659 .hw
.init
= &(struct clk_init_data
){
660 .name
= "cpu_clk_axi_div",
661 .ops
= &clk_regmap_divider_ro_ops
,
662 .parent_names
= (const char *[]){ "cpu_clk" },
667 static struct clk_regmap g12a_cpu_clk_axi
= {
668 .data
= &(struct clk_regmap_gate_data
){
669 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
672 .hw
.init
= &(struct clk_init_data
) {
673 .name
= "cpu_clk_axi",
674 .ops
= &clk_regmap_gate_ro_ops
,
675 .parent_names
= (const char *[]){ "cpu_clk_axi_div" },
678 * This clock is set by the ROM monitor code,
679 * Linux should not change it at runtime
684 static struct clk_regmap g12a_cpu_clk_trace_div
= {
685 .data
= &(struct clk_regmap_div_data
){
686 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
689 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
691 .hw
.init
= &(struct clk_init_data
){
692 .name
= "cpu_clk_trace_div",
693 .ops
= &clk_regmap_divider_ro_ops
,
694 .parent_names
= (const char *[]){ "cpu_clk" },
699 static struct clk_regmap g12a_cpu_clk_trace
= {
700 .data
= &(struct clk_regmap_gate_data
){
701 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
704 .hw
.init
= &(struct clk_init_data
) {
705 .name
= "cpu_clk_trace",
706 .ops
= &clk_regmap_gate_ro_ops
,
707 .parent_names
= (const char *[]){ "cpu_clk_trace_div" },
710 * This clock is set by the ROM monitor code,
711 * Linux should not change it at runtime
716 static struct clk_fixed_factor g12b_cpub_clk_div2
= {
719 .hw
.init
= &(struct clk_init_data
){
720 .name
= "cpub_clk_div2",
721 .ops
= &clk_fixed_factor_ops
,
722 .parent_names
= (const char *[]){ "cpub_clk" },
727 static struct clk_fixed_factor g12b_cpub_clk_div3
= {
730 .hw
.init
= &(struct clk_init_data
){
731 .name
= "cpub_clk_div3",
732 .ops
= &clk_fixed_factor_ops
,
733 .parent_names
= (const char *[]){ "cpub_clk" },
738 static struct clk_fixed_factor g12b_cpub_clk_div4
= {
741 .hw
.init
= &(struct clk_init_data
){
742 .name
= "cpub_clk_div4",
743 .ops
= &clk_fixed_factor_ops
,
744 .parent_names
= (const char *[]){ "cpub_clk" },
749 static struct clk_fixed_factor g12b_cpub_clk_div5
= {
752 .hw
.init
= &(struct clk_init_data
){
753 .name
= "cpub_clk_div5",
754 .ops
= &clk_fixed_factor_ops
,
755 .parent_names
= (const char *[]){ "cpub_clk" },
760 static struct clk_fixed_factor g12b_cpub_clk_div6
= {
763 .hw
.init
= &(struct clk_init_data
){
764 .name
= "cpub_clk_div6",
765 .ops
= &clk_fixed_factor_ops
,
766 .parent_names
= (const char *[]){ "cpub_clk" },
771 static struct clk_fixed_factor g12b_cpub_clk_div7
= {
774 .hw
.init
= &(struct clk_init_data
){
775 .name
= "cpub_clk_div7",
776 .ops
= &clk_fixed_factor_ops
,
777 .parent_names
= (const char *[]){ "cpub_clk" },
782 static struct clk_fixed_factor g12b_cpub_clk_div8
= {
785 .hw
.init
= &(struct clk_init_data
){
786 .name
= "cpub_clk_div8",
787 .ops
= &clk_fixed_factor_ops
,
788 .parent_names
= (const char *[]){ "cpub_clk" },
793 static u32 mux_table_cpub
[] = { 1, 2, 3, 4, 5, 6, 7 };
794 static struct clk_regmap g12b_cpub_clk_apb_sel
= {
795 .data
= &(struct clk_regmap_mux_data
){
796 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
799 .table
= mux_table_cpub
,
801 .hw
.init
= &(struct clk_init_data
){
802 .name
= "cpub_clk_apb_sel",
803 .ops
= &clk_regmap_mux_ro_ops
,
804 .parent_names
= (const char *[]){ "cpub_clk_div2",
815 static struct clk_regmap g12b_cpub_clk_apb
= {
816 .data
= &(struct clk_regmap_gate_data
){
817 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
819 .flags
= CLK_GATE_SET_TO_DISABLE
,
821 .hw
.init
= &(struct clk_init_data
) {
822 .name
= "cpub_clk_apb",
823 .ops
= &clk_regmap_gate_ro_ops
,
824 .parent_names
= (const char *[]){ "cpub_clk_apb_sel" },
827 * This clock is set by the ROM monitor code,
828 * Linux should not change it at runtime
833 static struct clk_regmap g12b_cpub_clk_atb_sel
= {
834 .data
= &(struct clk_regmap_mux_data
){
835 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
838 .table
= mux_table_cpub
,
840 .hw
.init
= &(struct clk_init_data
){
841 .name
= "cpub_clk_atb_sel",
842 .ops
= &clk_regmap_mux_ro_ops
,
843 .parent_names
= (const char *[]){ "cpub_clk_div2",
854 static struct clk_regmap g12b_cpub_clk_atb
= {
855 .data
= &(struct clk_regmap_gate_data
){
856 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
858 .flags
= CLK_GATE_SET_TO_DISABLE
,
860 .hw
.init
= &(struct clk_init_data
) {
861 .name
= "cpub_clk_atb",
862 .ops
= &clk_regmap_gate_ro_ops
,
863 .parent_names
= (const char *[]){ "cpub_clk_atb_sel" },
866 * This clock is set by the ROM monitor code,
867 * Linux should not change it at runtime
872 static struct clk_regmap g12b_cpub_clk_axi_sel
= {
873 .data
= &(struct clk_regmap_mux_data
){
874 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
877 .table
= mux_table_cpub
,
879 .hw
.init
= &(struct clk_init_data
){
880 .name
= "cpub_clk_axi_sel",
881 .ops
= &clk_regmap_mux_ro_ops
,
882 .parent_names
= (const char *[]){ "cpub_clk_div2",
893 static struct clk_regmap g12b_cpub_clk_axi
= {
894 .data
= &(struct clk_regmap_gate_data
){
895 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
897 .flags
= CLK_GATE_SET_TO_DISABLE
,
899 .hw
.init
= &(struct clk_init_data
) {
900 .name
= "cpub_clk_axi",
901 .ops
= &clk_regmap_gate_ro_ops
,
902 .parent_names
= (const char *[]){ "cpub_clk_axi_sel" },
905 * This clock is set by the ROM monitor code,
906 * Linux should not change it at runtime
911 static struct clk_regmap g12b_cpub_clk_trace_sel
= {
912 .data
= &(struct clk_regmap_mux_data
){
913 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
916 .table
= mux_table_cpub
,
918 .hw
.init
= &(struct clk_init_data
){
919 .name
= "cpub_clk_trace_sel",
920 .ops
= &clk_regmap_mux_ro_ops
,
921 .parent_names
= (const char *[]){ "cpub_clk_div2",
932 static struct clk_regmap g12b_cpub_clk_trace
= {
933 .data
= &(struct clk_regmap_gate_data
){
934 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
936 .flags
= CLK_GATE_SET_TO_DISABLE
,
938 .hw
.init
= &(struct clk_init_data
) {
939 .name
= "cpub_clk_trace",
940 .ops
= &clk_regmap_gate_ro_ops
,
941 .parent_names
= (const char *[]){ "cpub_clk_trace_sel" },
944 * This clock is set by the ROM monitor code,
945 * Linux should not change it at runtime
950 static const struct pll_mult_range g12a_gp0_pll_mult_range
= {
956 * Internal gp0 pll emulation configuration parameters
958 static const struct reg_sequence g12a_gp0_init_regs
[] = {
959 { .reg
= HHI_GP0_PLL_CNTL1
, .def
= 0x00000000 },
960 { .reg
= HHI_GP0_PLL_CNTL2
, .def
= 0x00000000 },
961 { .reg
= HHI_GP0_PLL_CNTL3
, .def
= 0x48681c00 },
962 { .reg
= HHI_GP0_PLL_CNTL4
, .def
= 0x33771290 },
963 { .reg
= HHI_GP0_PLL_CNTL5
, .def
= 0x39272000 },
964 { .reg
= HHI_GP0_PLL_CNTL6
, .def
= 0x56540000 },
967 static struct clk_regmap g12a_gp0_pll_dco
= {
968 .data
= &(struct meson_clk_pll_data
){
970 .reg_off
= HHI_GP0_PLL_CNTL0
,
975 .reg_off
= HHI_GP0_PLL_CNTL0
,
980 .reg_off
= HHI_GP0_PLL_CNTL0
,
985 .reg_off
= HHI_GP0_PLL_CNTL1
,
990 .reg_off
= HHI_GP0_PLL_CNTL0
,
995 .reg_off
= HHI_GP0_PLL_CNTL0
,
999 .range
= &g12a_gp0_pll_mult_range
,
1000 .init_regs
= g12a_gp0_init_regs
,
1001 .init_count
= ARRAY_SIZE(g12a_gp0_init_regs
),
1003 .hw
.init
= &(struct clk_init_data
){
1004 .name
= "gp0_pll_dco",
1005 .ops
= &meson_clk_pll_ops
,
1006 .parent_names
= (const char *[]){ IN_PREFIX
"xtal" },
1011 static struct clk_regmap g12a_gp0_pll
= {
1012 .data
= &(struct clk_regmap_div_data
){
1013 .offset
= HHI_GP0_PLL_CNTL0
,
1016 .flags
= (CLK_DIVIDER_POWER_OF_TWO
|
1017 CLK_DIVIDER_ROUND_CLOSEST
),
1019 .hw
.init
= &(struct clk_init_data
){
1021 .ops
= &clk_regmap_divider_ops
,
1022 .parent_names
= (const char *[]){ "gp0_pll_dco" },
1024 .flags
= CLK_SET_RATE_PARENT
,
1029 * Internal hifi pll emulation configuration parameters
1031 static const struct reg_sequence g12a_hifi_init_regs
[] = {
1032 { .reg
= HHI_HIFI_PLL_CNTL1
, .def
= 0x00000000 },
1033 { .reg
= HHI_HIFI_PLL_CNTL2
, .def
= 0x00000000 },
1034 { .reg
= HHI_HIFI_PLL_CNTL3
, .def
= 0x6a285c00 },
1035 { .reg
= HHI_HIFI_PLL_CNTL4
, .def
= 0x65771290 },
1036 { .reg
= HHI_HIFI_PLL_CNTL5
, .def
= 0x39272000 },
1037 { .reg
= HHI_HIFI_PLL_CNTL6
, .def
= 0x56540000 },
1040 static struct clk_regmap g12a_hifi_pll_dco
= {
1041 .data
= &(struct meson_clk_pll_data
){
1043 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1048 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1053 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1058 .reg_off
= HHI_HIFI_PLL_CNTL1
,
1063 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1068 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1072 .range
= &g12a_gp0_pll_mult_range
,
1073 .init_regs
= g12a_hifi_init_regs
,
1074 .init_count
= ARRAY_SIZE(g12a_hifi_init_regs
),
1075 .flags
= CLK_MESON_PLL_ROUND_CLOSEST
,
1077 .hw
.init
= &(struct clk_init_data
){
1078 .name
= "hifi_pll_dco",
1079 .ops
= &meson_clk_pll_ops
,
1080 .parent_names
= (const char *[]){ IN_PREFIX
"xtal" },
1085 static struct clk_regmap g12a_hifi_pll
= {
1086 .data
= &(struct clk_regmap_div_data
){
1087 .offset
= HHI_HIFI_PLL_CNTL0
,
1090 .flags
= (CLK_DIVIDER_POWER_OF_TWO
|
1091 CLK_DIVIDER_ROUND_CLOSEST
),
1093 .hw
.init
= &(struct clk_init_data
){
1095 .ops
= &clk_regmap_divider_ops
,
1096 .parent_names
= (const char *[]){ "hifi_pll_dco" },
1098 .flags
= CLK_SET_RATE_PARENT
,
1103 * The Meson G12A PCIE PLL is fined tuned to deliver a very precise
1104 * 100MHz reference clock for the PCIe Analog PHY, and thus requires
1105 * a strict register sequence to enable the PLL.
1107 static const struct reg_sequence g12a_pcie_pll_init_regs
[] = {
1108 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x20090496 },
1109 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x30090496 },
1110 { .reg
= HHI_PCIE_PLL_CNTL1
, .def
= 0x00000000 },
1111 { .reg
= HHI_PCIE_PLL_CNTL2
, .def
= 0x00001100 },
1112 { .reg
= HHI_PCIE_PLL_CNTL3
, .def
= 0x10058e00 },
1113 { .reg
= HHI_PCIE_PLL_CNTL4
, .def
= 0x000100c0 },
1114 { .reg
= HHI_PCIE_PLL_CNTL5
, .def
= 0x68000048 },
1115 { .reg
= HHI_PCIE_PLL_CNTL5
, .def
= 0x68000068, .delay_us
= 20 },
1116 { .reg
= HHI_PCIE_PLL_CNTL4
, .def
= 0x008100c0, .delay_us
= 10 },
1117 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x34090496 },
1118 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x14090496, .delay_us
= 10 },
1119 { .reg
= HHI_PCIE_PLL_CNTL2
, .def
= 0x00001000 },
1122 /* Keep a single entry table for recalc/round_rate() ops */
1123 static const struct pll_params_table g12a_pcie_pll_table
[] = {
1128 static struct clk_regmap g12a_pcie_pll_dco
= {
1129 .data
= &(struct meson_clk_pll_data
){
1131 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1136 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1141 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1146 .reg_off
= HHI_PCIE_PLL_CNTL1
,
1151 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1156 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1160 .table
= g12a_pcie_pll_table
,
1161 .init_regs
= g12a_pcie_pll_init_regs
,
1162 .init_count
= ARRAY_SIZE(g12a_pcie_pll_init_regs
),
1164 .hw
.init
= &(struct clk_init_data
){
1165 .name
= "pcie_pll_dco",
1166 .ops
= &meson_clk_pcie_pll_ops
,
1167 .parent_names
= (const char *[]){ IN_PREFIX
"xtal" },
1172 static struct clk_fixed_factor g12a_pcie_pll_dco_div2
= {
1175 .hw
.init
= &(struct clk_init_data
){
1176 .name
= "pcie_pll_dco_div2",
1177 .ops
= &clk_fixed_factor_ops
,
1178 .parent_names
= (const char *[]){ "pcie_pll_dco" },
1180 .flags
= CLK_SET_RATE_PARENT
,
1184 static struct clk_regmap g12a_pcie_pll_od
= {
1185 .data
= &(struct clk_regmap_div_data
){
1186 .offset
= HHI_PCIE_PLL_CNTL0
,
1189 .flags
= CLK_DIVIDER_ROUND_CLOSEST
|
1190 CLK_DIVIDER_ONE_BASED
|
1191 CLK_DIVIDER_ALLOW_ZERO
,
1193 .hw
.init
= &(struct clk_init_data
){
1194 .name
= "pcie_pll_od",
1195 .ops
= &clk_regmap_divider_ops
,
1196 .parent_names
= (const char *[]){ "pcie_pll_dco_div2" },
1198 .flags
= CLK_SET_RATE_PARENT
,
1202 static struct clk_fixed_factor g12a_pcie_pll
= {
1205 .hw
.init
= &(struct clk_init_data
){
1206 .name
= "pcie_pll_pll",
1207 .ops
= &clk_fixed_factor_ops
,
1208 .parent_names
= (const char *[]){ "pcie_pll_od" },
1210 .flags
= CLK_SET_RATE_PARENT
,
1214 static struct clk_regmap g12a_hdmi_pll_dco
= {
1215 .data
= &(struct meson_clk_pll_data
){
1217 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1222 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1227 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1232 .reg_off
= HHI_HDMI_PLL_CNTL1
,
1237 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1242 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1247 .hw
.init
= &(struct clk_init_data
){
1248 .name
= "hdmi_pll_dco",
1249 .ops
= &meson_clk_pll_ro_ops
,
1250 .parent_names
= (const char *[]){ IN_PREFIX
"xtal" },
1253 * Display directly handle hdmi pll registers ATM, we need
1254 * NOCACHE to keep our view of the clock as accurate as possible
1256 .flags
= CLK_GET_RATE_NOCACHE
,
1260 static struct clk_regmap g12a_hdmi_pll_od
= {
1261 .data
= &(struct clk_regmap_div_data
){
1262 .offset
= HHI_HDMI_PLL_CNTL0
,
1265 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1267 .hw
.init
= &(struct clk_init_data
){
1268 .name
= "hdmi_pll_od",
1269 .ops
= &clk_regmap_divider_ro_ops
,
1270 .parent_names
= (const char *[]){ "hdmi_pll_dco" },
1272 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
1276 static struct clk_regmap g12a_hdmi_pll_od2
= {
1277 .data
= &(struct clk_regmap_div_data
){
1278 .offset
= HHI_HDMI_PLL_CNTL0
,
1281 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1283 .hw
.init
= &(struct clk_init_data
){
1284 .name
= "hdmi_pll_od2",
1285 .ops
= &clk_regmap_divider_ro_ops
,
1286 .parent_names
= (const char *[]){ "hdmi_pll_od" },
1288 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
1292 static struct clk_regmap g12a_hdmi_pll
= {
1293 .data
= &(struct clk_regmap_div_data
){
1294 .offset
= HHI_HDMI_PLL_CNTL0
,
1297 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1299 .hw
.init
= &(struct clk_init_data
){
1301 .ops
= &clk_regmap_divider_ro_ops
,
1302 .parent_names
= (const char *[]){ "hdmi_pll_od2" },
1304 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
1308 static struct clk_fixed_factor g12a_fclk_div2_div
= {
1311 .hw
.init
= &(struct clk_init_data
){
1312 .name
= "fclk_div2_div",
1313 .ops
= &clk_fixed_factor_ops
,
1314 .parent_names
= (const char *[]){ "fixed_pll" },
1319 static struct clk_regmap g12a_fclk_div2
= {
1320 .data
= &(struct clk_regmap_gate_data
){
1321 .offset
= HHI_FIX_PLL_CNTL1
,
1324 .hw
.init
= &(struct clk_init_data
){
1325 .name
= "fclk_div2",
1326 .ops
= &clk_regmap_gate_ops
,
1327 .parent_names
= (const char *[]){ "fclk_div2_div" },
1332 static struct clk_fixed_factor g12a_fclk_div3_div
= {
1335 .hw
.init
= &(struct clk_init_data
){
1336 .name
= "fclk_div3_div",
1337 .ops
= &clk_fixed_factor_ops
,
1338 .parent_names
= (const char *[]){ "fixed_pll" },
1343 static struct clk_regmap g12a_fclk_div3
= {
1344 .data
= &(struct clk_regmap_gate_data
){
1345 .offset
= HHI_FIX_PLL_CNTL1
,
1348 .hw
.init
= &(struct clk_init_data
){
1349 .name
= "fclk_div3",
1350 .ops
= &clk_regmap_gate_ops
,
1351 .parent_names
= (const char *[]){ "fclk_div3_div" },
1354 * This clock is used by the resident firmware and is required
1355 * by the platform to operate correctly.
1356 * Until the following condition are met, we need this clock to
1357 * be marked as critical:
1358 * a) Mark the clock used by a firmware resource, if possible
1359 * b) CCF has a clock hand-off mechanism to make the sure the
1360 * clock stays on until the proper driver comes along
1362 .flags
= CLK_IS_CRITICAL
,
1366 static struct clk_fixed_factor g12a_fclk_div4_div
= {
1369 .hw
.init
= &(struct clk_init_data
){
1370 .name
= "fclk_div4_div",
1371 .ops
= &clk_fixed_factor_ops
,
1372 .parent_names
= (const char *[]){ "fixed_pll" },
1377 static struct clk_regmap g12a_fclk_div4
= {
1378 .data
= &(struct clk_regmap_gate_data
){
1379 .offset
= HHI_FIX_PLL_CNTL1
,
1382 .hw
.init
= &(struct clk_init_data
){
1383 .name
= "fclk_div4",
1384 .ops
= &clk_regmap_gate_ops
,
1385 .parent_names
= (const char *[]){ "fclk_div4_div" },
1390 static struct clk_fixed_factor g12a_fclk_div5_div
= {
1393 .hw
.init
= &(struct clk_init_data
){
1394 .name
= "fclk_div5_div",
1395 .ops
= &clk_fixed_factor_ops
,
1396 .parent_names
= (const char *[]){ "fixed_pll" },
1401 static struct clk_regmap g12a_fclk_div5
= {
1402 .data
= &(struct clk_regmap_gate_data
){
1403 .offset
= HHI_FIX_PLL_CNTL1
,
1406 .hw
.init
= &(struct clk_init_data
){
1407 .name
= "fclk_div5",
1408 .ops
= &clk_regmap_gate_ops
,
1409 .parent_names
= (const char *[]){ "fclk_div5_div" },
1414 static struct clk_fixed_factor g12a_fclk_div7_div
= {
1417 .hw
.init
= &(struct clk_init_data
){
1418 .name
= "fclk_div7_div",
1419 .ops
= &clk_fixed_factor_ops
,
1420 .parent_names
= (const char *[]){ "fixed_pll" },
1425 static struct clk_regmap g12a_fclk_div7
= {
1426 .data
= &(struct clk_regmap_gate_data
){
1427 .offset
= HHI_FIX_PLL_CNTL1
,
1430 .hw
.init
= &(struct clk_init_data
){
1431 .name
= "fclk_div7",
1432 .ops
= &clk_regmap_gate_ops
,
1433 .parent_names
= (const char *[]){ "fclk_div7_div" },
1438 static struct clk_fixed_factor g12a_fclk_div2p5_div
= {
1441 .hw
.init
= &(struct clk_init_data
){
1442 .name
= "fclk_div2p5_div",
1443 .ops
= &clk_fixed_factor_ops
,
1444 .parent_names
= (const char *[]){ "fixed_pll_dco" },
1449 static struct clk_regmap g12a_fclk_div2p5
= {
1450 .data
= &(struct clk_regmap_gate_data
){
1451 .offset
= HHI_FIX_PLL_CNTL1
,
1454 .hw
.init
= &(struct clk_init_data
){
1455 .name
= "fclk_div2p5",
1456 .ops
= &clk_regmap_gate_ops
,
1457 .parent_names
= (const char *[]){ "fclk_div2p5_div" },
1462 static struct clk_fixed_factor g12a_mpll_50m_div
= {
1465 .hw
.init
= &(struct clk_init_data
){
1466 .name
= "mpll_50m_div",
1467 .ops
= &clk_fixed_factor_ops
,
1468 .parent_names
= (const char *[]){ "fixed_pll_dco" },
1473 static struct clk_regmap g12a_mpll_50m
= {
1474 .data
= &(struct clk_regmap_mux_data
){
1475 .offset
= HHI_FIX_PLL_CNTL3
,
1479 .hw
.init
= &(struct clk_init_data
){
1481 .ops
= &clk_regmap_mux_ro_ops
,
1482 .parent_names
= (const char *[]){ IN_PREFIX
"xtal",
1488 static struct clk_fixed_factor g12a_mpll_prediv
= {
1491 .hw
.init
= &(struct clk_init_data
){
1492 .name
= "mpll_prediv",
1493 .ops
= &clk_fixed_factor_ops
,
1494 .parent_names
= (const char *[]){ "fixed_pll_dco" },
1499 static const struct reg_sequence g12a_mpll0_init_regs
[] = {
1500 { .reg
= HHI_MPLL_CNTL2
, .def
= 0x40000033 },
1503 static struct clk_regmap g12a_mpll0_div
= {
1504 .data
= &(struct meson_clk_mpll_data
){
1506 .reg_off
= HHI_MPLL_CNTL1
,
1511 .reg_off
= HHI_MPLL_CNTL1
,
1516 .reg_off
= HHI_MPLL_CNTL1
,
1521 .reg_off
= HHI_MPLL_CNTL1
,
1525 .lock
= &meson_clk_lock
,
1526 .init_regs
= g12a_mpll0_init_regs
,
1527 .init_count
= ARRAY_SIZE(g12a_mpll0_init_regs
),
1529 .hw
.init
= &(struct clk_init_data
){
1530 .name
= "mpll0_div",
1531 .ops
= &meson_clk_mpll_ops
,
1532 .parent_names
= (const char *[]){ "mpll_prediv" },
1537 static struct clk_regmap g12a_mpll0
= {
1538 .data
= &(struct clk_regmap_gate_data
){
1539 .offset
= HHI_MPLL_CNTL1
,
1542 .hw
.init
= &(struct clk_init_data
){
1544 .ops
= &clk_regmap_gate_ops
,
1545 .parent_names
= (const char *[]){ "mpll0_div" },
1547 .flags
= CLK_SET_RATE_PARENT
,
1551 static const struct reg_sequence g12a_mpll1_init_regs
[] = {
1552 { .reg
= HHI_MPLL_CNTL4
, .def
= 0x40000033 },
1555 static struct clk_regmap g12a_mpll1_div
= {
1556 .data
= &(struct meson_clk_mpll_data
){
1558 .reg_off
= HHI_MPLL_CNTL3
,
1563 .reg_off
= HHI_MPLL_CNTL3
,
1568 .reg_off
= HHI_MPLL_CNTL3
,
1573 .reg_off
= HHI_MPLL_CNTL3
,
1577 .lock
= &meson_clk_lock
,
1578 .init_regs
= g12a_mpll1_init_regs
,
1579 .init_count
= ARRAY_SIZE(g12a_mpll1_init_regs
),
1581 .hw
.init
= &(struct clk_init_data
){
1582 .name
= "mpll1_div",
1583 .ops
= &meson_clk_mpll_ops
,
1584 .parent_names
= (const char *[]){ "mpll_prediv" },
1589 static struct clk_regmap g12a_mpll1
= {
1590 .data
= &(struct clk_regmap_gate_data
){
1591 .offset
= HHI_MPLL_CNTL3
,
1594 .hw
.init
= &(struct clk_init_data
){
1596 .ops
= &clk_regmap_gate_ops
,
1597 .parent_names
= (const char *[]){ "mpll1_div" },
1599 .flags
= CLK_SET_RATE_PARENT
,
1603 static const struct reg_sequence g12a_mpll2_init_regs
[] = {
1604 { .reg
= HHI_MPLL_CNTL6
, .def
= 0x40000033 },
1607 static struct clk_regmap g12a_mpll2_div
= {
1608 .data
= &(struct meson_clk_mpll_data
){
1610 .reg_off
= HHI_MPLL_CNTL5
,
1615 .reg_off
= HHI_MPLL_CNTL5
,
1620 .reg_off
= HHI_MPLL_CNTL5
,
1625 .reg_off
= HHI_MPLL_CNTL5
,
1629 .lock
= &meson_clk_lock
,
1630 .init_regs
= g12a_mpll2_init_regs
,
1631 .init_count
= ARRAY_SIZE(g12a_mpll2_init_regs
),
1633 .hw
.init
= &(struct clk_init_data
){
1634 .name
= "mpll2_div",
1635 .ops
= &meson_clk_mpll_ops
,
1636 .parent_names
= (const char *[]){ "mpll_prediv" },
1641 static struct clk_regmap g12a_mpll2
= {
1642 .data
= &(struct clk_regmap_gate_data
){
1643 .offset
= HHI_MPLL_CNTL5
,
1646 .hw
.init
= &(struct clk_init_data
){
1648 .ops
= &clk_regmap_gate_ops
,
1649 .parent_names
= (const char *[]){ "mpll2_div" },
1651 .flags
= CLK_SET_RATE_PARENT
,
1655 static const struct reg_sequence g12a_mpll3_init_regs
[] = {
1656 { .reg
= HHI_MPLL_CNTL8
, .def
= 0x40000033 },
1659 static struct clk_regmap g12a_mpll3_div
= {
1660 .data
= &(struct meson_clk_mpll_data
){
1662 .reg_off
= HHI_MPLL_CNTL7
,
1667 .reg_off
= HHI_MPLL_CNTL7
,
1672 .reg_off
= HHI_MPLL_CNTL7
,
1677 .reg_off
= HHI_MPLL_CNTL7
,
1681 .lock
= &meson_clk_lock
,
1682 .init_regs
= g12a_mpll3_init_regs
,
1683 .init_count
= ARRAY_SIZE(g12a_mpll3_init_regs
),
1685 .hw
.init
= &(struct clk_init_data
){
1686 .name
= "mpll3_div",
1687 .ops
= &meson_clk_mpll_ops
,
1688 .parent_names
= (const char *[]){ "mpll_prediv" },
1693 static struct clk_regmap g12a_mpll3
= {
1694 .data
= &(struct clk_regmap_gate_data
){
1695 .offset
= HHI_MPLL_CNTL7
,
1698 .hw
.init
= &(struct clk_init_data
){
1700 .ops
= &clk_regmap_gate_ops
,
1701 .parent_names
= (const char *[]){ "mpll3_div" },
1703 .flags
= CLK_SET_RATE_PARENT
,
1707 static u32 mux_table_clk81
[] = { 0, 2, 3, 4, 5, 6, 7 };
1708 static const char * const clk81_parent_names
[] = {
1709 IN_PREFIX
"xtal", "fclk_div7", "mpll1", "mpll2", "fclk_div4",
1710 "fclk_div3", "fclk_div5"
1713 static struct clk_regmap g12a_mpeg_clk_sel
= {
1714 .data
= &(struct clk_regmap_mux_data
){
1715 .offset
= HHI_MPEG_CLK_CNTL
,
1718 .table
= mux_table_clk81
,
1720 .hw
.init
= &(struct clk_init_data
){
1721 .name
= "mpeg_clk_sel",
1722 .ops
= &clk_regmap_mux_ro_ops
,
1723 .parent_names
= clk81_parent_names
,
1724 .num_parents
= ARRAY_SIZE(clk81_parent_names
),
1728 static struct clk_regmap g12a_mpeg_clk_div
= {
1729 .data
= &(struct clk_regmap_div_data
){
1730 .offset
= HHI_MPEG_CLK_CNTL
,
1734 .hw
.init
= &(struct clk_init_data
){
1735 .name
= "mpeg_clk_div",
1736 .ops
= &clk_regmap_divider_ops
,
1737 .parent_names
= (const char *[]){ "mpeg_clk_sel" },
1739 .flags
= CLK_SET_RATE_PARENT
,
1743 static struct clk_regmap g12a_clk81
= {
1744 .data
= &(struct clk_regmap_gate_data
){
1745 .offset
= HHI_MPEG_CLK_CNTL
,
1748 .hw
.init
= &(struct clk_init_data
){
1750 .ops
= &clk_regmap_gate_ops
,
1751 .parent_names
= (const char *[]){ "mpeg_clk_div" },
1753 .flags
= (CLK_SET_RATE_PARENT
| CLK_IS_CRITICAL
),
1757 static const char * const g12a_sd_emmc_clk0_parent_names
[] = {
1758 IN_PREFIX
"xtal", "fclk_div2", "fclk_div3", "fclk_div5", "fclk_div7",
1761 * Following these parent clocks, we should also have had mpll2, mpll3
1762 * and gp0_pll but these clocks are too precious to be used here. All
1763 * the necessary rates for MMC and NAND operation can be acheived using
1764 * g12a_ee_core or fclk_div clocks
1769 static struct clk_regmap g12a_sd_emmc_a_clk0_sel
= {
1770 .data
= &(struct clk_regmap_mux_data
){
1771 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1775 .hw
.init
= &(struct clk_init_data
) {
1776 .name
= "sd_emmc_a_clk0_sel",
1777 .ops
= &clk_regmap_mux_ops
,
1778 .parent_names
= g12a_sd_emmc_clk0_parent_names
,
1779 .num_parents
= ARRAY_SIZE(g12a_sd_emmc_clk0_parent_names
),
1780 .flags
= CLK_SET_RATE_PARENT
,
1784 static struct clk_regmap g12a_sd_emmc_a_clk0_div
= {
1785 .data
= &(struct clk_regmap_div_data
){
1786 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1790 .hw
.init
= &(struct clk_init_data
) {
1791 .name
= "sd_emmc_a_clk0_div",
1792 .ops
= &clk_regmap_divider_ops
,
1793 .parent_names
= (const char *[]){ "sd_emmc_a_clk0_sel" },
1795 .flags
= CLK_SET_RATE_PARENT
,
1799 static struct clk_regmap g12a_sd_emmc_a_clk0
= {
1800 .data
= &(struct clk_regmap_gate_data
){
1801 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1804 .hw
.init
= &(struct clk_init_data
){
1805 .name
= "sd_emmc_a_clk0",
1806 .ops
= &clk_regmap_gate_ops
,
1807 .parent_names
= (const char *[]){ "sd_emmc_a_clk0_div" },
1809 .flags
= CLK_SET_RATE_PARENT
,
1814 static struct clk_regmap g12a_sd_emmc_b_clk0_sel
= {
1815 .data
= &(struct clk_regmap_mux_data
){
1816 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1820 .hw
.init
= &(struct clk_init_data
) {
1821 .name
= "sd_emmc_b_clk0_sel",
1822 .ops
= &clk_regmap_mux_ops
,
1823 .parent_names
= g12a_sd_emmc_clk0_parent_names
,
1824 .num_parents
= ARRAY_SIZE(g12a_sd_emmc_clk0_parent_names
),
1825 .flags
= CLK_SET_RATE_PARENT
,
1829 static struct clk_regmap g12a_sd_emmc_b_clk0_div
= {
1830 .data
= &(struct clk_regmap_div_data
){
1831 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1835 .hw
.init
= &(struct clk_init_data
) {
1836 .name
= "sd_emmc_b_clk0_div",
1837 .ops
= &clk_regmap_divider_ops
,
1838 .parent_names
= (const char *[]){ "sd_emmc_b_clk0_sel" },
1840 .flags
= CLK_SET_RATE_PARENT
,
1844 static struct clk_regmap g12a_sd_emmc_b_clk0
= {
1845 .data
= &(struct clk_regmap_gate_data
){
1846 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1849 .hw
.init
= &(struct clk_init_data
){
1850 .name
= "sd_emmc_b_clk0",
1851 .ops
= &clk_regmap_gate_ops
,
1852 .parent_names
= (const char *[]){ "sd_emmc_b_clk0_div" },
1854 .flags
= CLK_SET_RATE_PARENT
,
1858 /* EMMC/NAND clock */
1859 static struct clk_regmap g12a_sd_emmc_c_clk0_sel
= {
1860 .data
= &(struct clk_regmap_mux_data
){
1861 .offset
= HHI_NAND_CLK_CNTL
,
1865 .hw
.init
= &(struct clk_init_data
) {
1866 .name
= "sd_emmc_c_clk0_sel",
1867 .ops
= &clk_regmap_mux_ops
,
1868 .parent_names
= g12a_sd_emmc_clk0_parent_names
,
1869 .num_parents
= ARRAY_SIZE(g12a_sd_emmc_clk0_parent_names
),
1870 .flags
= CLK_SET_RATE_PARENT
,
1874 static struct clk_regmap g12a_sd_emmc_c_clk0_div
= {
1875 .data
= &(struct clk_regmap_div_data
){
1876 .offset
= HHI_NAND_CLK_CNTL
,
1880 .hw
.init
= &(struct clk_init_data
) {
1881 .name
= "sd_emmc_c_clk0_div",
1882 .ops
= &clk_regmap_divider_ops
,
1883 .parent_names
= (const char *[]){ "sd_emmc_c_clk0_sel" },
1885 .flags
= CLK_SET_RATE_PARENT
,
1889 static struct clk_regmap g12a_sd_emmc_c_clk0
= {
1890 .data
= &(struct clk_regmap_gate_data
){
1891 .offset
= HHI_NAND_CLK_CNTL
,
1894 .hw
.init
= &(struct clk_init_data
){
1895 .name
= "sd_emmc_c_clk0",
1896 .ops
= &clk_regmap_gate_ops
,
1897 .parent_names
= (const char *[]){ "sd_emmc_c_clk0_div" },
1899 .flags
= CLK_SET_RATE_PARENT
,
1905 static const char * const g12a_vpu_parent_names
[] = {
1906 "fclk_div3", "fclk_div4", "fclk_div5", "fclk_div7",
1907 "mpll1", "vid_pll", "hifi_pll", "gp0_pll",
1910 static struct clk_regmap g12a_vpu_0_sel
= {
1911 .data
= &(struct clk_regmap_mux_data
){
1912 .offset
= HHI_VPU_CLK_CNTL
,
1916 .hw
.init
= &(struct clk_init_data
){
1917 .name
= "vpu_0_sel",
1918 .ops
= &clk_regmap_mux_ops
,
1919 .parent_names
= g12a_vpu_parent_names
,
1920 .num_parents
= ARRAY_SIZE(g12a_vpu_parent_names
),
1921 .flags
= CLK_SET_RATE_NO_REPARENT
,
1925 static struct clk_regmap g12a_vpu_0_div
= {
1926 .data
= &(struct clk_regmap_div_data
){
1927 .offset
= HHI_VPU_CLK_CNTL
,
1931 .hw
.init
= &(struct clk_init_data
){
1932 .name
= "vpu_0_div",
1933 .ops
= &clk_regmap_divider_ops
,
1934 .parent_names
= (const char *[]){ "vpu_0_sel" },
1936 .flags
= CLK_SET_RATE_PARENT
,
1940 static struct clk_regmap g12a_vpu_0
= {
1941 .data
= &(struct clk_regmap_gate_data
){
1942 .offset
= HHI_VPU_CLK_CNTL
,
1945 .hw
.init
= &(struct clk_init_data
) {
1947 .ops
= &clk_regmap_gate_ops
,
1948 .parent_names
= (const char *[]){ "vpu_0_div" },
1950 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1954 static struct clk_regmap g12a_vpu_1_sel
= {
1955 .data
= &(struct clk_regmap_mux_data
){
1956 .offset
= HHI_VPU_CLK_CNTL
,
1960 .hw
.init
= &(struct clk_init_data
){
1961 .name
= "vpu_1_sel",
1962 .ops
= &clk_regmap_mux_ops
,
1963 .parent_names
= g12a_vpu_parent_names
,
1964 .num_parents
= ARRAY_SIZE(g12a_vpu_parent_names
),
1965 .flags
= CLK_SET_RATE_NO_REPARENT
,
1969 static struct clk_regmap g12a_vpu_1_div
= {
1970 .data
= &(struct clk_regmap_div_data
){
1971 .offset
= HHI_VPU_CLK_CNTL
,
1975 .hw
.init
= &(struct clk_init_data
){
1976 .name
= "vpu_1_div",
1977 .ops
= &clk_regmap_divider_ops
,
1978 .parent_names
= (const char *[]){ "vpu_1_sel" },
1980 .flags
= CLK_SET_RATE_PARENT
,
1984 static struct clk_regmap g12a_vpu_1
= {
1985 .data
= &(struct clk_regmap_gate_data
){
1986 .offset
= HHI_VPU_CLK_CNTL
,
1989 .hw
.init
= &(struct clk_init_data
) {
1991 .ops
= &clk_regmap_gate_ops
,
1992 .parent_names
= (const char *[]){ "vpu_1_div" },
1994 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1998 static struct clk_regmap g12a_vpu
= {
1999 .data
= &(struct clk_regmap_mux_data
){
2000 .offset
= HHI_VPU_CLK_CNTL
,
2004 .hw
.init
= &(struct clk_init_data
){
2006 .ops
= &clk_regmap_mux_ops
,
2008 * bit 31 selects from 2 possible parents:
2011 .parent_names
= (const char *[]){ "vpu_0", "vpu_1" },
2013 .flags
= CLK_SET_RATE_NO_REPARENT
,
2019 static const char * const g12a_vdec_parent_names
[] = {
2020 "fclk_div2p5", "fclk_div3", "fclk_div4", "fclk_div5", "fclk_div7",
2021 "hifi_pll", "gp0_pll",
2024 static struct clk_regmap g12a_vdec_1_sel
= {
2025 .data
= &(struct clk_regmap_mux_data
){
2026 .offset
= HHI_VDEC_CLK_CNTL
,
2029 .flags
= CLK_MUX_ROUND_CLOSEST
,
2031 .hw
.init
= &(struct clk_init_data
){
2032 .name
= "vdec_1_sel",
2033 .ops
= &clk_regmap_mux_ops
,
2034 .parent_names
= g12a_vdec_parent_names
,
2035 .num_parents
= ARRAY_SIZE(g12a_vdec_parent_names
),
2036 .flags
= CLK_SET_RATE_PARENT
,
2040 static struct clk_regmap g12a_vdec_1_div
= {
2041 .data
= &(struct clk_regmap_div_data
){
2042 .offset
= HHI_VDEC_CLK_CNTL
,
2045 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2047 .hw
.init
= &(struct clk_init_data
){
2048 .name
= "vdec_1_div",
2049 .ops
= &clk_regmap_divider_ops
,
2050 .parent_names
= (const char *[]){ "vdec_1_sel" },
2052 .flags
= CLK_SET_RATE_PARENT
,
2056 static struct clk_regmap g12a_vdec_1
= {
2057 .data
= &(struct clk_regmap_gate_data
){
2058 .offset
= HHI_VDEC_CLK_CNTL
,
2061 .hw
.init
= &(struct clk_init_data
) {
2063 .ops
= &clk_regmap_gate_ops
,
2064 .parent_names
= (const char *[]){ "vdec_1_div" },
2066 .flags
= CLK_SET_RATE_PARENT
,
2070 static struct clk_regmap g12a_vdec_hevcf_sel
= {
2071 .data
= &(struct clk_regmap_mux_data
){
2072 .offset
= HHI_VDEC2_CLK_CNTL
,
2075 .flags
= CLK_MUX_ROUND_CLOSEST
,
2077 .hw
.init
= &(struct clk_init_data
){
2078 .name
= "vdec_hevcf_sel",
2079 .ops
= &clk_regmap_mux_ops
,
2080 .parent_names
= g12a_vdec_parent_names
,
2081 .num_parents
= ARRAY_SIZE(g12a_vdec_parent_names
),
2082 .flags
= CLK_SET_RATE_PARENT
,
2086 static struct clk_regmap g12a_vdec_hevcf_div
= {
2087 .data
= &(struct clk_regmap_div_data
){
2088 .offset
= HHI_VDEC2_CLK_CNTL
,
2091 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2093 .hw
.init
= &(struct clk_init_data
){
2094 .name
= "vdec_hevcf_div",
2095 .ops
= &clk_regmap_divider_ops
,
2096 .parent_names
= (const char *[]){ "vdec_hevcf_sel" },
2098 .flags
= CLK_SET_RATE_PARENT
,
2102 static struct clk_regmap g12a_vdec_hevcf
= {
2103 .data
= &(struct clk_regmap_gate_data
){
2104 .offset
= HHI_VDEC2_CLK_CNTL
,
2107 .hw
.init
= &(struct clk_init_data
) {
2108 .name
= "vdec_hevcf",
2109 .ops
= &clk_regmap_gate_ops
,
2110 .parent_names
= (const char *[]){ "vdec_hevcf_div" },
2112 .flags
= CLK_SET_RATE_PARENT
,
2116 static struct clk_regmap g12a_vdec_hevc_sel
= {
2117 .data
= &(struct clk_regmap_mux_data
){
2118 .offset
= HHI_VDEC2_CLK_CNTL
,
2121 .flags
= CLK_MUX_ROUND_CLOSEST
,
2123 .hw
.init
= &(struct clk_init_data
){
2124 .name
= "vdec_hevc_sel",
2125 .ops
= &clk_regmap_mux_ops
,
2126 .parent_names
= g12a_vdec_parent_names
,
2127 .num_parents
= ARRAY_SIZE(g12a_vdec_parent_names
),
2128 .flags
= CLK_SET_RATE_PARENT
,
2132 static struct clk_regmap g12a_vdec_hevc_div
= {
2133 .data
= &(struct clk_regmap_div_data
){
2134 .offset
= HHI_VDEC2_CLK_CNTL
,
2137 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2139 .hw
.init
= &(struct clk_init_data
){
2140 .name
= "vdec_hevc_div",
2141 .ops
= &clk_regmap_divider_ops
,
2142 .parent_names
= (const char *[]){ "vdec_hevc_sel" },
2144 .flags
= CLK_SET_RATE_PARENT
,
2148 static struct clk_regmap g12a_vdec_hevc
= {
2149 .data
= &(struct clk_regmap_gate_data
){
2150 .offset
= HHI_VDEC2_CLK_CNTL
,
2153 .hw
.init
= &(struct clk_init_data
) {
2154 .name
= "vdec_hevc",
2155 .ops
= &clk_regmap_gate_ops
,
2156 .parent_names
= (const char *[]){ "vdec_hevc_div" },
2158 .flags
= CLK_SET_RATE_PARENT
,
2164 static const char * const g12a_vapb_parent_names
[] = {
2165 "fclk_div4", "fclk_div3", "fclk_div5", "fclk_div7",
2166 "mpll1", "vid_pll", "mpll2", "fclk_div2p5",
2169 static struct clk_regmap g12a_vapb_0_sel
= {
2170 .data
= &(struct clk_regmap_mux_data
){
2171 .offset
= HHI_VAPBCLK_CNTL
,
2175 .hw
.init
= &(struct clk_init_data
){
2176 .name
= "vapb_0_sel",
2177 .ops
= &clk_regmap_mux_ops
,
2178 .parent_names
= g12a_vapb_parent_names
,
2179 .num_parents
= ARRAY_SIZE(g12a_vapb_parent_names
),
2180 .flags
= CLK_SET_RATE_NO_REPARENT
,
2184 static struct clk_regmap g12a_vapb_0_div
= {
2185 .data
= &(struct clk_regmap_div_data
){
2186 .offset
= HHI_VAPBCLK_CNTL
,
2190 .hw
.init
= &(struct clk_init_data
){
2191 .name
= "vapb_0_div",
2192 .ops
= &clk_regmap_divider_ops
,
2193 .parent_names
= (const char *[]){ "vapb_0_sel" },
2195 .flags
= CLK_SET_RATE_PARENT
,
2199 static struct clk_regmap g12a_vapb_0
= {
2200 .data
= &(struct clk_regmap_gate_data
){
2201 .offset
= HHI_VAPBCLK_CNTL
,
2204 .hw
.init
= &(struct clk_init_data
) {
2206 .ops
= &clk_regmap_gate_ops
,
2207 .parent_names
= (const char *[]){ "vapb_0_div" },
2209 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2213 static struct clk_regmap g12a_vapb_1_sel
= {
2214 .data
= &(struct clk_regmap_mux_data
){
2215 .offset
= HHI_VAPBCLK_CNTL
,
2219 .hw
.init
= &(struct clk_init_data
){
2220 .name
= "vapb_1_sel",
2221 .ops
= &clk_regmap_mux_ops
,
2222 .parent_names
= g12a_vapb_parent_names
,
2223 .num_parents
= ARRAY_SIZE(g12a_vapb_parent_names
),
2224 .flags
= CLK_SET_RATE_NO_REPARENT
,
2228 static struct clk_regmap g12a_vapb_1_div
= {
2229 .data
= &(struct clk_regmap_div_data
){
2230 .offset
= HHI_VAPBCLK_CNTL
,
2234 .hw
.init
= &(struct clk_init_data
){
2235 .name
= "vapb_1_div",
2236 .ops
= &clk_regmap_divider_ops
,
2237 .parent_names
= (const char *[]){ "vapb_1_sel" },
2239 .flags
= CLK_SET_RATE_PARENT
,
2243 static struct clk_regmap g12a_vapb_1
= {
2244 .data
= &(struct clk_regmap_gate_data
){
2245 .offset
= HHI_VAPBCLK_CNTL
,
2248 .hw
.init
= &(struct clk_init_data
) {
2250 .ops
= &clk_regmap_gate_ops
,
2251 .parent_names
= (const char *[]){ "vapb_1_div" },
2253 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2257 static struct clk_regmap g12a_vapb_sel
= {
2258 .data
= &(struct clk_regmap_mux_data
){
2259 .offset
= HHI_VAPBCLK_CNTL
,
2263 .hw
.init
= &(struct clk_init_data
){
2265 .ops
= &clk_regmap_mux_ops
,
2267 * bit 31 selects from 2 possible parents:
2270 .parent_names
= (const char *[]){ "vapb_0", "vapb_1" },
2272 .flags
= CLK_SET_RATE_NO_REPARENT
,
2276 static struct clk_regmap g12a_vapb
= {
2277 .data
= &(struct clk_regmap_gate_data
){
2278 .offset
= HHI_VAPBCLK_CNTL
,
2281 .hw
.init
= &(struct clk_init_data
) {
2283 .ops
= &clk_regmap_gate_ops
,
2284 .parent_names
= (const char *[]){ "vapb_sel" },
2286 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2292 static struct clk_regmap g12a_vid_pll_div
= {
2293 .data
= &(struct meson_vid_pll_div_data
){
2295 .reg_off
= HHI_VID_PLL_CLK_DIV
,
2300 .reg_off
= HHI_VID_PLL_CLK_DIV
,
2305 .hw
.init
= &(struct clk_init_data
) {
2306 .name
= "vid_pll_div",
2307 .ops
= &meson_vid_pll_div_ro_ops
,
2308 .parent_names
= (const char *[]){ "hdmi_pll" },
2310 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
2314 static const char * const g12a_vid_pll_parent_names
[] = { "vid_pll_div",
2317 static struct clk_regmap g12a_vid_pll_sel
= {
2318 .data
= &(struct clk_regmap_mux_data
){
2319 .offset
= HHI_VID_PLL_CLK_DIV
,
2323 .hw
.init
= &(struct clk_init_data
){
2324 .name
= "vid_pll_sel",
2325 .ops
= &clk_regmap_mux_ops
,
2327 * bit 18 selects from 2 possible parents:
2328 * vid_pll_div or hdmi_pll
2330 .parent_names
= g12a_vid_pll_parent_names
,
2331 .num_parents
= ARRAY_SIZE(g12a_vid_pll_parent_names
),
2332 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2336 static struct clk_regmap g12a_vid_pll
= {
2337 .data
= &(struct clk_regmap_gate_data
){
2338 .offset
= HHI_VID_PLL_CLK_DIV
,
2341 .hw
.init
= &(struct clk_init_data
) {
2343 .ops
= &clk_regmap_gate_ops
,
2344 .parent_names
= (const char *[]){ "vid_pll_sel" },
2346 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2350 static const char * const g12a_vclk_parent_names
[] = {
2351 "vid_pll", "gp0_pll", "hifi_pll", "mpll1", "fclk_div3", "fclk_div4",
2352 "fclk_div5", "fclk_div7"
2355 static struct clk_regmap g12a_vclk_sel
= {
2356 .data
= &(struct clk_regmap_mux_data
){
2357 .offset
= HHI_VID_CLK_CNTL
,
2361 .hw
.init
= &(struct clk_init_data
){
2363 .ops
= &clk_regmap_mux_ops
,
2364 .parent_names
= g12a_vclk_parent_names
,
2365 .num_parents
= ARRAY_SIZE(g12a_vclk_parent_names
),
2366 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2370 static struct clk_regmap g12a_vclk2_sel
= {
2371 .data
= &(struct clk_regmap_mux_data
){
2372 .offset
= HHI_VIID_CLK_CNTL
,
2376 .hw
.init
= &(struct clk_init_data
){
2377 .name
= "vclk2_sel",
2378 .ops
= &clk_regmap_mux_ops
,
2379 .parent_names
= g12a_vclk_parent_names
,
2380 .num_parents
= ARRAY_SIZE(g12a_vclk_parent_names
),
2381 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2385 static struct clk_regmap g12a_vclk_input
= {
2386 .data
= &(struct clk_regmap_gate_data
){
2387 .offset
= HHI_VID_CLK_DIV
,
2390 .hw
.init
= &(struct clk_init_data
) {
2391 .name
= "vclk_input",
2392 .ops
= &clk_regmap_gate_ops
,
2393 .parent_names
= (const char *[]){ "vclk_sel" },
2395 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2399 static struct clk_regmap g12a_vclk2_input
= {
2400 .data
= &(struct clk_regmap_gate_data
){
2401 .offset
= HHI_VIID_CLK_DIV
,
2404 .hw
.init
= &(struct clk_init_data
) {
2405 .name
= "vclk2_input",
2406 .ops
= &clk_regmap_gate_ops
,
2407 .parent_names
= (const char *[]){ "vclk2_sel" },
2409 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2413 static struct clk_regmap g12a_vclk_div
= {
2414 .data
= &(struct clk_regmap_div_data
){
2415 .offset
= HHI_VID_CLK_DIV
,
2419 .hw
.init
= &(struct clk_init_data
){
2421 .ops
= &clk_regmap_divider_ops
,
2422 .parent_names
= (const char *[]){ "vclk_input" },
2424 .flags
= CLK_GET_RATE_NOCACHE
,
2428 static struct clk_regmap g12a_vclk2_div
= {
2429 .data
= &(struct clk_regmap_div_data
){
2430 .offset
= HHI_VIID_CLK_DIV
,
2434 .hw
.init
= &(struct clk_init_data
){
2435 .name
= "vclk2_div",
2436 .ops
= &clk_regmap_divider_ops
,
2437 .parent_names
= (const char *[]){ "vclk2_input" },
2439 .flags
= CLK_GET_RATE_NOCACHE
,
2443 static struct clk_regmap g12a_vclk
= {
2444 .data
= &(struct clk_regmap_gate_data
){
2445 .offset
= HHI_VID_CLK_CNTL
,
2448 .hw
.init
= &(struct clk_init_data
) {
2450 .ops
= &clk_regmap_gate_ops
,
2451 .parent_names
= (const char *[]){ "vclk_div" },
2453 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2457 static struct clk_regmap g12a_vclk2
= {
2458 .data
= &(struct clk_regmap_gate_data
){
2459 .offset
= HHI_VIID_CLK_CNTL
,
2462 .hw
.init
= &(struct clk_init_data
) {
2464 .ops
= &clk_regmap_gate_ops
,
2465 .parent_names
= (const char *[]){ "vclk2_div" },
2467 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2471 static struct clk_regmap g12a_vclk_div1
= {
2472 .data
= &(struct clk_regmap_gate_data
){
2473 .offset
= HHI_VID_CLK_CNTL
,
2476 .hw
.init
= &(struct clk_init_data
) {
2477 .name
= "vclk_div1",
2478 .ops
= &clk_regmap_gate_ops
,
2479 .parent_names
= (const char *[]){ "vclk" },
2481 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2485 static struct clk_regmap g12a_vclk_div2_en
= {
2486 .data
= &(struct clk_regmap_gate_data
){
2487 .offset
= HHI_VID_CLK_CNTL
,
2490 .hw
.init
= &(struct clk_init_data
) {
2491 .name
= "vclk_div2_en",
2492 .ops
= &clk_regmap_gate_ops
,
2493 .parent_names
= (const char *[]){ "vclk" },
2495 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2499 static struct clk_regmap g12a_vclk_div4_en
= {
2500 .data
= &(struct clk_regmap_gate_data
){
2501 .offset
= HHI_VID_CLK_CNTL
,
2504 .hw
.init
= &(struct clk_init_data
) {
2505 .name
= "vclk_div4_en",
2506 .ops
= &clk_regmap_gate_ops
,
2507 .parent_names
= (const char *[]){ "vclk" },
2509 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2513 static struct clk_regmap g12a_vclk_div6_en
= {
2514 .data
= &(struct clk_regmap_gate_data
){
2515 .offset
= HHI_VID_CLK_CNTL
,
2518 .hw
.init
= &(struct clk_init_data
) {
2519 .name
= "vclk_div6_en",
2520 .ops
= &clk_regmap_gate_ops
,
2521 .parent_names
= (const char *[]){ "vclk" },
2523 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2527 static struct clk_regmap g12a_vclk_div12_en
= {
2528 .data
= &(struct clk_regmap_gate_data
){
2529 .offset
= HHI_VID_CLK_CNTL
,
2532 .hw
.init
= &(struct clk_init_data
) {
2533 .name
= "vclk_div12_en",
2534 .ops
= &clk_regmap_gate_ops
,
2535 .parent_names
= (const char *[]){ "vclk" },
2537 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2541 static struct clk_regmap g12a_vclk2_div1
= {
2542 .data
= &(struct clk_regmap_gate_data
){
2543 .offset
= HHI_VIID_CLK_CNTL
,
2546 .hw
.init
= &(struct clk_init_data
) {
2547 .name
= "vclk2_div1",
2548 .ops
= &clk_regmap_gate_ops
,
2549 .parent_names
= (const char *[]){ "vclk2" },
2551 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2555 static struct clk_regmap g12a_vclk2_div2_en
= {
2556 .data
= &(struct clk_regmap_gate_data
){
2557 .offset
= HHI_VIID_CLK_CNTL
,
2560 .hw
.init
= &(struct clk_init_data
) {
2561 .name
= "vclk2_div2_en",
2562 .ops
= &clk_regmap_gate_ops
,
2563 .parent_names
= (const char *[]){ "vclk2" },
2565 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2569 static struct clk_regmap g12a_vclk2_div4_en
= {
2570 .data
= &(struct clk_regmap_gate_data
){
2571 .offset
= HHI_VIID_CLK_CNTL
,
2574 .hw
.init
= &(struct clk_init_data
) {
2575 .name
= "vclk2_div4_en",
2576 .ops
= &clk_regmap_gate_ops
,
2577 .parent_names
= (const char *[]){ "vclk2" },
2579 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2583 static struct clk_regmap g12a_vclk2_div6_en
= {
2584 .data
= &(struct clk_regmap_gate_data
){
2585 .offset
= HHI_VIID_CLK_CNTL
,
2588 .hw
.init
= &(struct clk_init_data
) {
2589 .name
= "vclk2_div6_en",
2590 .ops
= &clk_regmap_gate_ops
,
2591 .parent_names
= (const char *[]){ "vclk2" },
2593 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2597 static struct clk_regmap g12a_vclk2_div12_en
= {
2598 .data
= &(struct clk_regmap_gate_data
){
2599 .offset
= HHI_VIID_CLK_CNTL
,
2602 .hw
.init
= &(struct clk_init_data
) {
2603 .name
= "vclk2_div12_en",
2604 .ops
= &clk_regmap_gate_ops
,
2605 .parent_names
= (const char *[]){ "vclk2" },
2607 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2611 static struct clk_fixed_factor g12a_vclk_div2
= {
2614 .hw
.init
= &(struct clk_init_data
){
2615 .name
= "vclk_div2",
2616 .ops
= &clk_fixed_factor_ops
,
2617 .parent_names
= (const char *[]){ "vclk_div2_en" },
2622 static struct clk_fixed_factor g12a_vclk_div4
= {
2625 .hw
.init
= &(struct clk_init_data
){
2626 .name
= "vclk_div4",
2627 .ops
= &clk_fixed_factor_ops
,
2628 .parent_names
= (const char *[]){ "vclk_div4_en" },
2633 static struct clk_fixed_factor g12a_vclk_div6
= {
2636 .hw
.init
= &(struct clk_init_data
){
2637 .name
= "vclk_div6",
2638 .ops
= &clk_fixed_factor_ops
,
2639 .parent_names
= (const char *[]){ "vclk_div6_en" },
2644 static struct clk_fixed_factor g12a_vclk_div12
= {
2647 .hw
.init
= &(struct clk_init_data
){
2648 .name
= "vclk_div12",
2649 .ops
= &clk_fixed_factor_ops
,
2650 .parent_names
= (const char *[]){ "vclk_div12_en" },
2655 static struct clk_fixed_factor g12a_vclk2_div2
= {
2658 .hw
.init
= &(struct clk_init_data
){
2659 .name
= "vclk2_div2",
2660 .ops
= &clk_fixed_factor_ops
,
2661 .parent_names
= (const char *[]){ "vclk2_div2_en" },
2666 static struct clk_fixed_factor g12a_vclk2_div4
= {
2669 .hw
.init
= &(struct clk_init_data
){
2670 .name
= "vclk2_div4",
2671 .ops
= &clk_fixed_factor_ops
,
2672 .parent_names
= (const char *[]){ "vclk2_div4_en" },
2677 static struct clk_fixed_factor g12a_vclk2_div6
= {
2680 .hw
.init
= &(struct clk_init_data
){
2681 .name
= "vclk2_div6",
2682 .ops
= &clk_fixed_factor_ops
,
2683 .parent_names
= (const char *[]){ "vclk2_div6_en" },
2688 static struct clk_fixed_factor g12a_vclk2_div12
= {
2691 .hw
.init
= &(struct clk_init_data
){
2692 .name
= "vclk2_div12",
2693 .ops
= &clk_fixed_factor_ops
,
2694 .parent_names
= (const char *[]){ "vclk2_div12_en" },
2699 static u32 mux_table_cts_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
2700 static const char * const g12a_cts_parent_names
[] = {
2701 "vclk_div1", "vclk_div2", "vclk_div4", "vclk_div6",
2702 "vclk_div12", "vclk2_div1", "vclk2_div2", "vclk2_div4",
2703 "vclk2_div6", "vclk2_div12"
2706 static struct clk_regmap g12a_cts_enci_sel
= {
2707 .data
= &(struct clk_regmap_mux_data
){
2708 .offset
= HHI_VID_CLK_DIV
,
2711 .table
= mux_table_cts_sel
,
2713 .hw
.init
= &(struct clk_init_data
){
2714 .name
= "cts_enci_sel",
2715 .ops
= &clk_regmap_mux_ops
,
2716 .parent_names
= g12a_cts_parent_names
,
2717 .num_parents
= ARRAY_SIZE(g12a_cts_parent_names
),
2718 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2722 static struct clk_regmap g12a_cts_encp_sel
= {
2723 .data
= &(struct clk_regmap_mux_data
){
2724 .offset
= HHI_VID_CLK_DIV
,
2727 .table
= mux_table_cts_sel
,
2729 .hw
.init
= &(struct clk_init_data
){
2730 .name
= "cts_encp_sel",
2731 .ops
= &clk_regmap_mux_ops
,
2732 .parent_names
= g12a_cts_parent_names
,
2733 .num_parents
= ARRAY_SIZE(g12a_cts_parent_names
),
2734 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2738 static struct clk_regmap g12a_cts_vdac_sel
= {
2739 .data
= &(struct clk_regmap_mux_data
){
2740 .offset
= HHI_VIID_CLK_DIV
,
2743 .table
= mux_table_cts_sel
,
2745 .hw
.init
= &(struct clk_init_data
){
2746 .name
= "cts_vdac_sel",
2747 .ops
= &clk_regmap_mux_ops
,
2748 .parent_names
= g12a_cts_parent_names
,
2749 .num_parents
= ARRAY_SIZE(g12a_cts_parent_names
),
2750 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2754 /* TOFIX: add support for cts_tcon */
2755 static u32 mux_table_hdmi_tx_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
2756 static const char * const g12a_cts_hdmi_tx_parent_names
[] = {
2757 "vclk_div1", "vclk_div2", "vclk_div4", "vclk_div6",
2758 "vclk_div12", "vclk2_div1", "vclk2_div2", "vclk2_div4",
2759 "vclk2_div6", "vclk2_div12"
2762 static struct clk_regmap g12a_hdmi_tx_sel
= {
2763 .data
= &(struct clk_regmap_mux_data
){
2764 .offset
= HHI_HDMI_CLK_CNTL
,
2767 .table
= mux_table_hdmi_tx_sel
,
2769 .hw
.init
= &(struct clk_init_data
){
2770 .name
= "hdmi_tx_sel",
2771 .ops
= &clk_regmap_mux_ops
,
2772 .parent_names
= g12a_cts_hdmi_tx_parent_names
,
2773 .num_parents
= ARRAY_SIZE(g12a_cts_hdmi_tx_parent_names
),
2774 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2778 static struct clk_regmap g12a_cts_enci
= {
2779 .data
= &(struct clk_regmap_gate_data
){
2780 .offset
= HHI_VID_CLK_CNTL2
,
2783 .hw
.init
= &(struct clk_init_data
) {
2785 .ops
= &clk_regmap_gate_ops
,
2786 .parent_names
= (const char *[]){ "cts_enci_sel" },
2788 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2792 static struct clk_regmap g12a_cts_encp
= {
2793 .data
= &(struct clk_regmap_gate_data
){
2794 .offset
= HHI_VID_CLK_CNTL2
,
2797 .hw
.init
= &(struct clk_init_data
) {
2799 .ops
= &clk_regmap_gate_ops
,
2800 .parent_names
= (const char *[]){ "cts_encp_sel" },
2802 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2806 static struct clk_regmap g12a_cts_vdac
= {
2807 .data
= &(struct clk_regmap_gate_data
){
2808 .offset
= HHI_VID_CLK_CNTL2
,
2811 .hw
.init
= &(struct clk_init_data
) {
2813 .ops
= &clk_regmap_gate_ops
,
2814 .parent_names
= (const char *[]){ "cts_vdac_sel" },
2816 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2820 static struct clk_regmap g12a_hdmi_tx
= {
2821 .data
= &(struct clk_regmap_gate_data
){
2822 .offset
= HHI_VID_CLK_CNTL2
,
2825 .hw
.init
= &(struct clk_init_data
) {
2827 .ops
= &clk_regmap_gate_ops
,
2828 .parent_names
= (const char *[]){ "hdmi_tx_sel" },
2830 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2836 static const char * const g12a_hdmi_parent_names
[] = {
2837 IN_PREFIX
"xtal", "fclk_div4", "fclk_div3", "fclk_div5"
2840 static struct clk_regmap g12a_hdmi_sel
= {
2841 .data
= &(struct clk_regmap_mux_data
){
2842 .offset
= HHI_HDMI_CLK_CNTL
,
2845 .flags
= CLK_MUX_ROUND_CLOSEST
,
2847 .hw
.init
= &(struct clk_init_data
){
2849 .ops
= &clk_regmap_mux_ops
,
2850 .parent_names
= g12a_hdmi_parent_names
,
2851 .num_parents
= ARRAY_SIZE(g12a_hdmi_parent_names
),
2852 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2856 static struct clk_regmap g12a_hdmi_div
= {
2857 .data
= &(struct clk_regmap_div_data
){
2858 .offset
= HHI_HDMI_CLK_CNTL
,
2862 .hw
.init
= &(struct clk_init_data
){
2864 .ops
= &clk_regmap_divider_ops
,
2865 .parent_names
= (const char *[]){ "hdmi_sel" },
2867 .flags
= CLK_GET_RATE_NOCACHE
,
2871 static struct clk_regmap g12a_hdmi
= {
2872 .data
= &(struct clk_regmap_gate_data
){
2873 .offset
= HHI_HDMI_CLK_CNTL
,
2876 .hw
.init
= &(struct clk_init_data
) {
2878 .ops
= &clk_regmap_gate_ops
,
2879 .parent_names
= (const char *[]){ "hdmi_div" },
2881 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2886 * The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
2887 * muxed by a glitch-free switch.
2890 static const char * const g12a_mali_0_1_parent_names
[] = {
2891 IN_PREFIX
"xtal", "gp0_pll", "hihi_pll", "fclk_div2p5",
2892 "fclk_div3", "fclk_div4", "fclk_div5", "fclk_div7"
2895 static struct clk_regmap g12a_mali_0_sel
= {
2896 .data
= &(struct clk_regmap_mux_data
){
2897 .offset
= HHI_MALI_CLK_CNTL
,
2901 .hw
.init
= &(struct clk_init_data
){
2902 .name
= "mali_0_sel",
2903 .ops
= &clk_regmap_mux_ops
,
2904 .parent_names
= g12a_mali_0_1_parent_names
,
2906 .flags
= CLK_SET_RATE_NO_REPARENT
,
2910 static struct clk_regmap g12a_mali_0_div
= {
2911 .data
= &(struct clk_regmap_div_data
){
2912 .offset
= HHI_MALI_CLK_CNTL
,
2916 .hw
.init
= &(struct clk_init_data
){
2917 .name
= "mali_0_div",
2918 .ops
= &clk_regmap_divider_ops
,
2919 .parent_names
= (const char *[]){ "mali_0_sel" },
2921 .flags
= CLK_SET_RATE_NO_REPARENT
,
2925 static struct clk_regmap g12a_mali_0
= {
2926 .data
= &(struct clk_regmap_gate_data
){
2927 .offset
= HHI_MALI_CLK_CNTL
,
2930 .hw
.init
= &(struct clk_init_data
){
2932 .ops
= &clk_regmap_gate_ops
,
2933 .parent_names
= (const char *[]){ "mali_0_div" },
2935 .flags
= CLK_SET_RATE_PARENT
,
2939 static struct clk_regmap g12a_mali_1_sel
= {
2940 .data
= &(struct clk_regmap_mux_data
){
2941 .offset
= HHI_MALI_CLK_CNTL
,
2945 .hw
.init
= &(struct clk_init_data
){
2946 .name
= "mali_1_sel",
2947 .ops
= &clk_regmap_mux_ops
,
2948 .parent_names
= g12a_mali_0_1_parent_names
,
2950 .flags
= CLK_SET_RATE_NO_REPARENT
,
2954 static struct clk_regmap g12a_mali_1_div
= {
2955 .data
= &(struct clk_regmap_div_data
){
2956 .offset
= HHI_MALI_CLK_CNTL
,
2960 .hw
.init
= &(struct clk_init_data
){
2961 .name
= "mali_1_div",
2962 .ops
= &clk_regmap_divider_ops
,
2963 .parent_names
= (const char *[]){ "mali_1_sel" },
2965 .flags
= CLK_SET_RATE_NO_REPARENT
,
2969 static struct clk_regmap g12a_mali_1
= {
2970 .data
= &(struct clk_regmap_gate_data
){
2971 .offset
= HHI_MALI_CLK_CNTL
,
2974 .hw
.init
= &(struct clk_init_data
){
2976 .ops
= &clk_regmap_gate_ops
,
2977 .parent_names
= (const char *[]){ "mali_1_div" },
2979 .flags
= CLK_SET_RATE_PARENT
,
2983 static const char * const g12a_mali_parent_names
[] = {
2987 static struct clk_regmap g12a_mali
= {
2988 .data
= &(struct clk_regmap_mux_data
){
2989 .offset
= HHI_MALI_CLK_CNTL
,
2993 .hw
.init
= &(struct clk_init_data
){
2995 .ops
= &clk_regmap_mux_ops
,
2996 .parent_names
= g12a_mali_parent_names
,
2998 .flags
= CLK_SET_RATE_NO_REPARENT
,
3002 static struct clk_regmap g12a_ts_div
= {
3003 .data
= &(struct clk_regmap_div_data
){
3004 .offset
= HHI_TS_CLK_CNTL
,
3008 .hw
.init
= &(struct clk_init_data
){
3010 .ops
= &clk_regmap_divider_ro_ops
,
3011 .parent_names
= (const char *[]){ "xtal" },
3016 static struct clk_regmap g12a_ts
= {
3017 .data
= &(struct clk_regmap_gate_data
){
3018 .offset
= HHI_TS_CLK_CNTL
,
3021 .hw
.init
= &(struct clk_init_data
){
3023 .ops
= &clk_regmap_gate_ops
,
3024 .parent_names
= (const char *[]){ "ts_div" },
3029 /* Everything Else (EE) domain gates */
3030 static MESON_GATE(g12a_ddr
, HHI_GCLK_MPEG0
, 0);
3031 static MESON_GATE(g12a_dos
, HHI_GCLK_MPEG0
, 1);
3032 static MESON_GATE(g12a_audio_locker
, HHI_GCLK_MPEG0
, 2);
3033 static MESON_GATE(g12a_mipi_dsi_host
, HHI_GCLK_MPEG0
, 3);
3034 static MESON_GATE(g12a_eth_phy
, HHI_GCLK_MPEG0
, 4);
3035 static MESON_GATE(g12a_isa
, HHI_GCLK_MPEG0
, 5);
3036 static MESON_GATE(g12a_pl301
, HHI_GCLK_MPEG0
, 6);
3037 static MESON_GATE(g12a_periphs
, HHI_GCLK_MPEG0
, 7);
3038 static MESON_GATE(g12a_spicc_0
, HHI_GCLK_MPEG0
, 8);
3039 static MESON_GATE(g12a_i2c
, HHI_GCLK_MPEG0
, 9);
3040 static MESON_GATE(g12a_sana
, HHI_GCLK_MPEG0
, 10);
3041 static MESON_GATE(g12a_sd
, HHI_GCLK_MPEG0
, 11);
3042 static MESON_GATE(g12a_rng0
, HHI_GCLK_MPEG0
, 12);
3043 static MESON_GATE(g12a_uart0
, HHI_GCLK_MPEG0
, 13);
3044 static MESON_GATE(g12a_spicc_1
, HHI_GCLK_MPEG0
, 14);
3045 static MESON_GATE(g12a_hiu_reg
, HHI_GCLK_MPEG0
, 19);
3046 static MESON_GATE(g12a_mipi_dsi_phy
, HHI_GCLK_MPEG0
, 20);
3047 static MESON_GATE(g12a_assist_misc
, HHI_GCLK_MPEG0
, 23);
3048 static MESON_GATE(g12a_emmc_a
, HHI_GCLK_MPEG0
, 4);
3049 static MESON_GATE(g12a_emmc_b
, HHI_GCLK_MPEG0
, 25);
3050 static MESON_GATE(g12a_emmc_c
, HHI_GCLK_MPEG0
, 26);
3051 static MESON_GATE(g12a_audio_codec
, HHI_GCLK_MPEG0
, 28);
3053 static MESON_GATE(g12a_audio
, HHI_GCLK_MPEG1
, 0);
3054 static MESON_GATE(g12a_eth_core
, HHI_GCLK_MPEG1
, 3);
3055 static MESON_GATE(g12a_demux
, HHI_GCLK_MPEG1
, 4);
3056 static MESON_GATE(g12a_audio_ififo
, HHI_GCLK_MPEG1
, 11);
3057 static MESON_GATE(g12a_adc
, HHI_GCLK_MPEG1
, 13);
3058 static MESON_GATE(g12a_uart1
, HHI_GCLK_MPEG1
, 16);
3059 static MESON_GATE(g12a_g2d
, HHI_GCLK_MPEG1
, 20);
3060 static MESON_GATE(g12a_reset
, HHI_GCLK_MPEG1
, 23);
3061 static MESON_GATE(g12a_pcie_comb
, HHI_GCLK_MPEG1
, 24);
3062 static MESON_GATE(g12a_parser
, HHI_GCLK_MPEG1
, 25);
3063 static MESON_GATE(g12a_usb_general
, HHI_GCLK_MPEG1
, 26);
3064 static MESON_GATE(g12a_pcie_phy
, HHI_GCLK_MPEG1
, 27);
3065 static MESON_GATE(g12a_ahb_arb0
, HHI_GCLK_MPEG1
, 29);
3067 static MESON_GATE(g12a_ahb_data_bus
, HHI_GCLK_MPEG2
, 1);
3068 static MESON_GATE(g12a_ahb_ctrl_bus
, HHI_GCLK_MPEG2
, 2);
3069 static MESON_GATE(g12a_htx_hdcp22
, HHI_GCLK_MPEG2
, 3);
3070 static MESON_GATE(g12a_htx_pclk
, HHI_GCLK_MPEG2
, 4);
3071 static MESON_GATE(g12a_bt656
, HHI_GCLK_MPEG2
, 6);
3072 static MESON_GATE(g12a_usb1_to_ddr
, HHI_GCLK_MPEG2
, 8);
3073 static MESON_GATE(g12a_mmc_pclk
, HHI_GCLK_MPEG2
, 11);
3074 static MESON_GATE(g12a_uart2
, HHI_GCLK_MPEG2
, 15);
3075 static MESON_GATE(g12a_vpu_intr
, HHI_GCLK_MPEG2
, 25);
3076 static MESON_GATE(g12a_gic
, HHI_GCLK_MPEG2
, 30);
3078 static MESON_GATE(g12a_vclk2_venci0
, HHI_GCLK_OTHER
, 1);
3079 static MESON_GATE(g12a_vclk2_venci1
, HHI_GCLK_OTHER
, 2);
3080 static MESON_GATE(g12a_vclk2_vencp0
, HHI_GCLK_OTHER
, 3);
3081 static MESON_GATE(g12a_vclk2_vencp1
, HHI_GCLK_OTHER
, 4);
3082 static MESON_GATE(g12a_vclk2_venct0
, HHI_GCLK_OTHER
, 5);
3083 static MESON_GATE(g12a_vclk2_venct1
, HHI_GCLK_OTHER
, 6);
3084 static MESON_GATE(g12a_vclk2_other
, HHI_GCLK_OTHER
, 7);
3085 static MESON_GATE(g12a_vclk2_enci
, HHI_GCLK_OTHER
, 8);
3086 static MESON_GATE(g12a_vclk2_encp
, HHI_GCLK_OTHER
, 9);
3087 static MESON_GATE(g12a_dac_clk
, HHI_GCLK_OTHER
, 10);
3088 static MESON_GATE(g12a_aoclk_gate
, HHI_GCLK_OTHER
, 14);
3089 static MESON_GATE(g12a_iec958_gate
, HHI_GCLK_OTHER
, 16);
3090 static MESON_GATE(g12a_enc480p
, HHI_GCLK_OTHER
, 20);
3091 static MESON_GATE(g12a_rng1
, HHI_GCLK_OTHER
, 21);
3092 static MESON_GATE(g12a_vclk2_enct
, HHI_GCLK_OTHER
, 22);
3093 static MESON_GATE(g12a_vclk2_encl
, HHI_GCLK_OTHER
, 23);
3094 static MESON_GATE(g12a_vclk2_venclmmc
, HHI_GCLK_OTHER
, 24);
3095 static MESON_GATE(g12a_vclk2_vencl
, HHI_GCLK_OTHER
, 25);
3096 static MESON_GATE(g12a_vclk2_other1
, HHI_GCLK_OTHER
, 26);
3098 static MESON_GATE_RO(g12a_dma
, HHI_GCLK_OTHER2
, 0);
3099 static MESON_GATE_RO(g12a_efuse
, HHI_GCLK_OTHER2
, 1);
3100 static MESON_GATE_RO(g12a_rom_boot
, HHI_GCLK_OTHER2
, 2);
3101 static MESON_GATE_RO(g12a_reset_sec
, HHI_GCLK_OTHER2
, 3);
3102 static MESON_GATE_RO(g12a_sec_ahb_apb3
, HHI_GCLK_OTHER2
, 4);
3104 /* Array of all clocks provided by this provider */
3105 static struct clk_hw_onecell_data g12a_hw_onecell_data
= {
3107 [CLKID_SYS_PLL
] = &g12a_sys_pll
.hw
,
3108 [CLKID_FIXED_PLL
] = &g12a_fixed_pll
.hw
,
3109 [CLKID_FCLK_DIV2
] = &g12a_fclk_div2
.hw
,
3110 [CLKID_FCLK_DIV3
] = &g12a_fclk_div3
.hw
,
3111 [CLKID_FCLK_DIV4
] = &g12a_fclk_div4
.hw
,
3112 [CLKID_FCLK_DIV5
] = &g12a_fclk_div5
.hw
,
3113 [CLKID_FCLK_DIV7
] = &g12a_fclk_div7
.hw
,
3114 [CLKID_FCLK_DIV2P5
] = &g12a_fclk_div2p5
.hw
,
3115 [CLKID_GP0_PLL
] = &g12a_gp0_pll
.hw
,
3116 [CLKID_MPEG_SEL
] = &g12a_mpeg_clk_sel
.hw
,
3117 [CLKID_MPEG_DIV
] = &g12a_mpeg_clk_div
.hw
,
3118 [CLKID_CLK81
] = &g12a_clk81
.hw
,
3119 [CLKID_MPLL0
] = &g12a_mpll0
.hw
,
3120 [CLKID_MPLL1
] = &g12a_mpll1
.hw
,
3121 [CLKID_MPLL2
] = &g12a_mpll2
.hw
,
3122 [CLKID_MPLL3
] = &g12a_mpll3
.hw
,
3123 [CLKID_DDR
] = &g12a_ddr
.hw
,
3124 [CLKID_DOS
] = &g12a_dos
.hw
,
3125 [CLKID_AUDIO_LOCKER
] = &g12a_audio_locker
.hw
,
3126 [CLKID_MIPI_DSI_HOST
] = &g12a_mipi_dsi_host
.hw
,
3127 [CLKID_ETH_PHY
] = &g12a_eth_phy
.hw
,
3128 [CLKID_ISA
] = &g12a_isa
.hw
,
3129 [CLKID_PL301
] = &g12a_pl301
.hw
,
3130 [CLKID_PERIPHS
] = &g12a_periphs
.hw
,
3131 [CLKID_SPICC0
] = &g12a_spicc_0
.hw
,
3132 [CLKID_I2C
] = &g12a_i2c
.hw
,
3133 [CLKID_SANA
] = &g12a_sana
.hw
,
3134 [CLKID_SD
] = &g12a_sd
.hw
,
3135 [CLKID_RNG0
] = &g12a_rng0
.hw
,
3136 [CLKID_UART0
] = &g12a_uart0
.hw
,
3137 [CLKID_SPICC1
] = &g12a_spicc_1
.hw
,
3138 [CLKID_HIU_IFACE
] = &g12a_hiu_reg
.hw
,
3139 [CLKID_MIPI_DSI_PHY
] = &g12a_mipi_dsi_phy
.hw
,
3140 [CLKID_ASSIST_MISC
] = &g12a_assist_misc
.hw
,
3141 [CLKID_SD_EMMC_A
] = &g12a_emmc_a
.hw
,
3142 [CLKID_SD_EMMC_B
] = &g12a_emmc_b
.hw
,
3143 [CLKID_SD_EMMC_C
] = &g12a_emmc_c
.hw
,
3144 [CLKID_AUDIO_CODEC
] = &g12a_audio_codec
.hw
,
3145 [CLKID_AUDIO
] = &g12a_audio
.hw
,
3146 [CLKID_ETH
] = &g12a_eth_core
.hw
,
3147 [CLKID_DEMUX
] = &g12a_demux
.hw
,
3148 [CLKID_AUDIO_IFIFO
] = &g12a_audio_ififo
.hw
,
3149 [CLKID_ADC
] = &g12a_adc
.hw
,
3150 [CLKID_UART1
] = &g12a_uart1
.hw
,
3151 [CLKID_G2D
] = &g12a_g2d
.hw
,
3152 [CLKID_RESET
] = &g12a_reset
.hw
,
3153 [CLKID_PCIE_COMB
] = &g12a_pcie_comb
.hw
,
3154 [CLKID_PARSER
] = &g12a_parser
.hw
,
3155 [CLKID_USB
] = &g12a_usb_general
.hw
,
3156 [CLKID_PCIE_PHY
] = &g12a_pcie_phy
.hw
,
3157 [CLKID_AHB_ARB0
] = &g12a_ahb_arb0
.hw
,
3158 [CLKID_AHB_DATA_BUS
] = &g12a_ahb_data_bus
.hw
,
3159 [CLKID_AHB_CTRL_BUS
] = &g12a_ahb_ctrl_bus
.hw
,
3160 [CLKID_HTX_HDCP22
] = &g12a_htx_hdcp22
.hw
,
3161 [CLKID_HTX_PCLK
] = &g12a_htx_pclk
.hw
,
3162 [CLKID_BT656
] = &g12a_bt656
.hw
,
3163 [CLKID_USB1_DDR_BRIDGE
] = &g12a_usb1_to_ddr
.hw
,
3164 [CLKID_MMC_PCLK
] = &g12a_mmc_pclk
.hw
,
3165 [CLKID_UART2
] = &g12a_uart2
.hw
,
3166 [CLKID_VPU_INTR
] = &g12a_vpu_intr
.hw
,
3167 [CLKID_GIC
] = &g12a_gic
.hw
,
3168 [CLKID_SD_EMMC_A_CLK0_SEL
] = &g12a_sd_emmc_a_clk0_sel
.hw
,
3169 [CLKID_SD_EMMC_A_CLK0_DIV
] = &g12a_sd_emmc_a_clk0_div
.hw
,
3170 [CLKID_SD_EMMC_A_CLK0
] = &g12a_sd_emmc_a_clk0
.hw
,
3171 [CLKID_SD_EMMC_B_CLK0_SEL
] = &g12a_sd_emmc_b_clk0_sel
.hw
,
3172 [CLKID_SD_EMMC_B_CLK0_DIV
] = &g12a_sd_emmc_b_clk0_div
.hw
,
3173 [CLKID_SD_EMMC_B_CLK0
] = &g12a_sd_emmc_b_clk0
.hw
,
3174 [CLKID_SD_EMMC_C_CLK0_SEL
] = &g12a_sd_emmc_c_clk0_sel
.hw
,
3175 [CLKID_SD_EMMC_C_CLK0_DIV
] = &g12a_sd_emmc_c_clk0_div
.hw
,
3176 [CLKID_SD_EMMC_C_CLK0
] = &g12a_sd_emmc_c_clk0
.hw
,
3177 [CLKID_MPLL0_DIV
] = &g12a_mpll0_div
.hw
,
3178 [CLKID_MPLL1_DIV
] = &g12a_mpll1_div
.hw
,
3179 [CLKID_MPLL2_DIV
] = &g12a_mpll2_div
.hw
,
3180 [CLKID_MPLL3_DIV
] = &g12a_mpll3_div
.hw
,
3181 [CLKID_FCLK_DIV2_DIV
] = &g12a_fclk_div2_div
.hw
,
3182 [CLKID_FCLK_DIV3_DIV
] = &g12a_fclk_div3_div
.hw
,
3183 [CLKID_FCLK_DIV4_DIV
] = &g12a_fclk_div4_div
.hw
,
3184 [CLKID_FCLK_DIV5_DIV
] = &g12a_fclk_div5_div
.hw
,
3185 [CLKID_FCLK_DIV7_DIV
] = &g12a_fclk_div7_div
.hw
,
3186 [CLKID_FCLK_DIV2P5_DIV
] = &g12a_fclk_div2p5_div
.hw
,
3187 [CLKID_HIFI_PLL
] = &g12a_hifi_pll
.hw
,
3188 [CLKID_VCLK2_VENCI0
] = &g12a_vclk2_venci0
.hw
,
3189 [CLKID_VCLK2_VENCI1
] = &g12a_vclk2_venci1
.hw
,
3190 [CLKID_VCLK2_VENCP0
] = &g12a_vclk2_vencp0
.hw
,
3191 [CLKID_VCLK2_VENCP1
] = &g12a_vclk2_vencp1
.hw
,
3192 [CLKID_VCLK2_VENCT0
] = &g12a_vclk2_venct0
.hw
,
3193 [CLKID_VCLK2_VENCT1
] = &g12a_vclk2_venct1
.hw
,
3194 [CLKID_VCLK2_OTHER
] = &g12a_vclk2_other
.hw
,
3195 [CLKID_VCLK2_ENCI
] = &g12a_vclk2_enci
.hw
,
3196 [CLKID_VCLK2_ENCP
] = &g12a_vclk2_encp
.hw
,
3197 [CLKID_DAC_CLK
] = &g12a_dac_clk
.hw
,
3198 [CLKID_AOCLK
] = &g12a_aoclk_gate
.hw
,
3199 [CLKID_IEC958
] = &g12a_iec958_gate
.hw
,
3200 [CLKID_ENC480P
] = &g12a_enc480p
.hw
,
3201 [CLKID_RNG1
] = &g12a_rng1
.hw
,
3202 [CLKID_VCLK2_ENCT
] = &g12a_vclk2_enct
.hw
,
3203 [CLKID_VCLK2_ENCL
] = &g12a_vclk2_encl
.hw
,
3204 [CLKID_VCLK2_VENCLMMC
] = &g12a_vclk2_venclmmc
.hw
,
3205 [CLKID_VCLK2_VENCL
] = &g12a_vclk2_vencl
.hw
,
3206 [CLKID_VCLK2_OTHER1
] = &g12a_vclk2_other1
.hw
,
3207 [CLKID_FIXED_PLL_DCO
] = &g12a_fixed_pll_dco
.hw
,
3208 [CLKID_SYS_PLL_DCO
] = &g12a_sys_pll_dco
.hw
,
3209 [CLKID_GP0_PLL_DCO
] = &g12a_gp0_pll_dco
.hw
,
3210 [CLKID_HIFI_PLL_DCO
] = &g12a_hifi_pll_dco
.hw
,
3211 [CLKID_DMA
] = &g12a_dma
.hw
,
3212 [CLKID_EFUSE
] = &g12a_efuse
.hw
,
3213 [CLKID_ROM_BOOT
] = &g12a_rom_boot
.hw
,
3214 [CLKID_RESET_SEC
] = &g12a_reset_sec
.hw
,
3215 [CLKID_SEC_AHB_APB3
] = &g12a_sec_ahb_apb3
.hw
,
3216 [CLKID_MPLL_PREDIV
] = &g12a_mpll_prediv
.hw
,
3217 [CLKID_VPU_0_SEL
] = &g12a_vpu_0_sel
.hw
,
3218 [CLKID_VPU_0_DIV
] = &g12a_vpu_0_div
.hw
,
3219 [CLKID_VPU_0
] = &g12a_vpu_0
.hw
,
3220 [CLKID_VPU_1_SEL
] = &g12a_vpu_1_sel
.hw
,
3221 [CLKID_VPU_1_DIV
] = &g12a_vpu_1_div
.hw
,
3222 [CLKID_VPU_1
] = &g12a_vpu_1
.hw
,
3223 [CLKID_VPU
] = &g12a_vpu
.hw
,
3224 [CLKID_VAPB_0_SEL
] = &g12a_vapb_0_sel
.hw
,
3225 [CLKID_VAPB_0_DIV
] = &g12a_vapb_0_div
.hw
,
3226 [CLKID_VAPB_0
] = &g12a_vapb_0
.hw
,
3227 [CLKID_VAPB_1_SEL
] = &g12a_vapb_1_sel
.hw
,
3228 [CLKID_VAPB_1_DIV
] = &g12a_vapb_1_div
.hw
,
3229 [CLKID_VAPB_1
] = &g12a_vapb_1
.hw
,
3230 [CLKID_VAPB_SEL
] = &g12a_vapb_sel
.hw
,
3231 [CLKID_VAPB
] = &g12a_vapb
.hw
,
3232 [CLKID_HDMI_PLL_DCO
] = &g12a_hdmi_pll_dco
.hw
,
3233 [CLKID_HDMI_PLL_OD
] = &g12a_hdmi_pll_od
.hw
,
3234 [CLKID_HDMI_PLL_OD2
] = &g12a_hdmi_pll_od2
.hw
,
3235 [CLKID_HDMI_PLL
] = &g12a_hdmi_pll
.hw
,
3236 [CLKID_VID_PLL
] = &g12a_vid_pll_div
.hw
,
3237 [CLKID_VID_PLL_SEL
] = &g12a_vid_pll_sel
.hw
,
3238 [CLKID_VID_PLL_DIV
] = &g12a_vid_pll
.hw
,
3239 [CLKID_VCLK_SEL
] = &g12a_vclk_sel
.hw
,
3240 [CLKID_VCLK2_SEL
] = &g12a_vclk2_sel
.hw
,
3241 [CLKID_VCLK_INPUT
] = &g12a_vclk_input
.hw
,
3242 [CLKID_VCLK2_INPUT
] = &g12a_vclk2_input
.hw
,
3243 [CLKID_VCLK_DIV
] = &g12a_vclk_div
.hw
,
3244 [CLKID_VCLK2_DIV
] = &g12a_vclk2_div
.hw
,
3245 [CLKID_VCLK
] = &g12a_vclk
.hw
,
3246 [CLKID_VCLK2
] = &g12a_vclk2
.hw
,
3247 [CLKID_VCLK_DIV1
] = &g12a_vclk_div1
.hw
,
3248 [CLKID_VCLK_DIV2_EN
] = &g12a_vclk_div2_en
.hw
,
3249 [CLKID_VCLK_DIV4_EN
] = &g12a_vclk_div4_en
.hw
,
3250 [CLKID_VCLK_DIV6_EN
] = &g12a_vclk_div6_en
.hw
,
3251 [CLKID_VCLK_DIV12_EN
] = &g12a_vclk_div12_en
.hw
,
3252 [CLKID_VCLK2_DIV1
] = &g12a_vclk2_div1
.hw
,
3253 [CLKID_VCLK2_DIV2_EN
] = &g12a_vclk2_div2_en
.hw
,
3254 [CLKID_VCLK2_DIV4_EN
] = &g12a_vclk2_div4_en
.hw
,
3255 [CLKID_VCLK2_DIV6_EN
] = &g12a_vclk2_div6_en
.hw
,
3256 [CLKID_VCLK2_DIV12_EN
] = &g12a_vclk2_div12_en
.hw
,
3257 [CLKID_VCLK_DIV2
] = &g12a_vclk_div2
.hw
,
3258 [CLKID_VCLK_DIV4
] = &g12a_vclk_div4
.hw
,
3259 [CLKID_VCLK_DIV6
] = &g12a_vclk_div6
.hw
,
3260 [CLKID_VCLK_DIV12
] = &g12a_vclk_div12
.hw
,
3261 [CLKID_VCLK2_DIV2
] = &g12a_vclk2_div2
.hw
,
3262 [CLKID_VCLK2_DIV4
] = &g12a_vclk2_div4
.hw
,
3263 [CLKID_VCLK2_DIV6
] = &g12a_vclk2_div6
.hw
,
3264 [CLKID_VCLK2_DIV12
] = &g12a_vclk2_div12
.hw
,
3265 [CLKID_CTS_ENCI_SEL
] = &g12a_cts_enci_sel
.hw
,
3266 [CLKID_CTS_ENCP_SEL
] = &g12a_cts_encp_sel
.hw
,
3267 [CLKID_CTS_VDAC_SEL
] = &g12a_cts_vdac_sel
.hw
,
3268 [CLKID_HDMI_TX_SEL
] = &g12a_hdmi_tx_sel
.hw
,
3269 [CLKID_CTS_ENCI
] = &g12a_cts_enci
.hw
,
3270 [CLKID_CTS_ENCP
] = &g12a_cts_encp
.hw
,
3271 [CLKID_CTS_VDAC
] = &g12a_cts_vdac
.hw
,
3272 [CLKID_HDMI_TX
] = &g12a_hdmi_tx
.hw
,
3273 [CLKID_HDMI_SEL
] = &g12a_hdmi_sel
.hw
,
3274 [CLKID_HDMI_DIV
] = &g12a_hdmi_div
.hw
,
3275 [CLKID_HDMI
] = &g12a_hdmi
.hw
,
3276 [CLKID_MALI_0_SEL
] = &g12a_mali_0_sel
.hw
,
3277 [CLKID_MALI_0_DIV
] = &g12a_mali_0_div
.hw
,
3278 [CLKID_MALI_0
] = &g12a_mali_0
.hw
,
3279 [CLKID_MALI_1_SEL
] = &g12a_mali_1_sel
.hw
,
3280 [CLKID_MALI_1_DIV
] = &g12a_mali_1_div
.hw
,
3281 [CLKID_MALI_1
] = &g12a_mali_1
.hw
,
3282 [CLKID_MALI
] = &g12a_mali
.hw
,
3283 [CLKID_MPLL_50M_DIV
] = &g12a_mpll_50m_div
.hw
,
3284 [CLKID_MPLL_50M
] = &g12a_mpll_50m
.hw
,
3285 [CLKID_SYS_PLL_DIV16_EN
] = &g12a_sys_pll_div16_en
.hw
,
3286 [CLKID_SYS_PLL_DIV16
] = &g12a_sys_pll_div16
.hw
,
3287 [CLKID_CPU_CLK_DYN0_SEL
] = &g12a_cpu_clk_premux0
.hw
,
3288 [CLKID_CPU_CLK_DYN0_DIV
] = &g12a_cpu_clk_mux0_div
.hw
,
3289 [CLKID_CPU_CLK_DYN0
] = &g12a_cpu_clk_postmux0
.hw
,
3290 [CLKID_CPU_CLK_DYN1_SEL
] = &g12a_cpu_clk_premux1
.hw
,
3291 [CLKID_CPU_CLK_DYN1_DIV
] = &g12a_cpu_clk_mux1_div
.hw
,
3292 [CLKID_CPU_CLK_DYN1
] = &g12a_cpu_clk_postmux1
.hw
,
3293 [CLKID_CPU_CLK_DYN
] = &g12a_cpu_clk_dyn
.hw
,
3294 [CLKID_CPU_CLK
] = &g12a_cpu_clk
.hw
,
3295 [CLKID_CPU_CLK_DIV16_EN
] = &g12a_cpu_clk_div16_en
.hw
,
3296 [CLKID_CPU_CLK_DIV16
] = &g12a_cpu_clk_div16
.hw
,
3297 [CLKID_CPU_CLK_APB_DIV
] = &g12a_cpu_clk_apb_div
.hw
,
3298 [CLKID_CPU_CLK_APB
] = &g12a_cpu_clk_apb
.hw
,
3299 [CLKID_CPU_CLK_ATB_DIV
] = &g12a_cpu_clk_atb_div
.hw
,
3300 [CLKID_CPU_CLK_ATB
] = &g12a_cpu_clk_atb
.hw
,
3301 [CLKID_CPU_CLK_AXI_DIV
] = &g12a_cpu_clk_axi_div
.hw
,
3302 [CLKID_CPU_CLK_AXI
] = &g12a_cpu_clk_axi
.hw
,
3303 [CLKID_CPU_CLK_TRACE_DIV
] = &g12a_cpu_clk_trace_div
.hw
,
3304 [CLKID_CPU_CLK_TRACE
] = &g12a_cpu_clk_trace
.hw
,
3305 [CLKID_PCIE_PLL_DCO
] = &g12a_pcie_pll_dco
.hw
,
3306 [CLKID_PCIE_PLL_DCO_DIV2
] = &g12a_pcie_pll_dco_div2
.hw
,
3307 [CLKID_PCIE_PLL_OD
] = &g12a_pcie_pll_od
.hw
,
3308 [CLKID_PCIE_PLL
] = &g12a_pcie_pll
.hw
,
3309 [CLKID_VDEC_1_SEL
] = &g12a_vdec_1_sel
.hw
,
3310 [CLKID_VDEC_1_DIV
] = &g12a_vdec_1_div
.hw
,
3311 [CLKID_VDEC_1
] = &g12a_vdec_1
.hw
,
3312 [CLKID_VDEC_HEVC_SEL
] = &g12a_vdec_hevc_sel
.hw
,
3313 [CLKID_VDEC_HEVC_DIV
] = &g12a_vdec_hevc_div
.hw
,
3314 [CLKID_VDEC_HEVC
] = &g12a_vdec_hevc
.hw
,
3315 [CLKID_VDEC_HEVCF_SEL
] = &g12a_vdec_hevcf_sel
.hw
,
3316 [CLKID_VDEC_HEVCF_DIV
] = &g12a_vdec_hevcf_div
.hw
,
3317 [CLKID_VDEC_HEVCF
] = &g12a_vdec_hevcf
.hw
,
3318 [CLKID_TS_DIV
] = &g12a_ts_div
.hw
,
3319 [CLKID_TS
] = &g12a_ts
.hw
,
3325 static struct clk_hw_onecell_data g12b_hw_onecell_data
= {
3327 [CLKID_SYS_PLL
] = &g12a_sys_pll
.hw
,
3328 [CLKID_FIXED_PLL
] = &g12a_fixed_pll
.hw
,
3329 [CLKID_FCLK_DIV2
] = &g12a_fclk_div2
.hw
,
3330 [CLKID_FCLK_DIV3
] = &g12a_fclk_div3
.hw
,
3331 [CLKID_FCLK_DIV4
] = &g12a_fclk_div4
.hw
,
3332 [CLKID_FCLK_DIV5
] = &g12a_fclk_div5
.hw
,
3333 [CLKID_FCLK_DIV7
] = &g12a_fclk_div7
.hw
,
3334 [CLKID_FCLK_DIV2P5
] = &g12a_fclk_div2p5
.hw
,
3335 [CLKID_GP0_PLL
] = &g12a_gp0_pll
.hw
,
3336 [CLKID_MPEG_SEL
] = &g12a_mpeg_clk_sel
.hw
,
3337 [CLKID_MPEG_DIV
] = &g12a_mpeg_clk_div
.hw
,
3338 [CLKID_CLK81
] = &g12a_clk81
.hw
,
3339 [CLKID_MPLL0
] = &g12a_mpll0
.hw
,
3340 [CLKID_MPLL1
] = &g12a_mpll1
.hw
,
3341 [CLKID_MPLL2
] = &g12a_mpll2
.hw
,
3342 [CLKID_MPLL3
] = &g12a_mpll3
.hw
,
3343 [CLKID_DDR
] = &g12a_ddr
.hw
,
3344 [CLKID_DOS
] = &g12a_dos
.hw
,
3345 [CLKID_AUDIO_LOCKER
] = &g12a_audio_locker
.hw
,
3346 [CLKID_MIPI_DSI_HOST
] = &g12a_mipi_dsi_host
.hw
,
3347 [CLKID_ETH_PHY
] = &g12a_eth_phy
.hw
,
3348 [CLKID_ISA
] = &g12a_isa
.hw
,
3349 [CLKID_PL301
] = &g12a_pl301
.hw
,
3350 [CLKID_PERIPHS
] = &g12a_periphs
.hw
,
3351 [CLKID_SPICC0
] = &g12a_spicc_0
.hw
,
3352 [CLKID_I2C
] = &g12a_i2c
.hw
,
3353 [CLKID_SANA
] = &g12a_sana
.hw
,
3354 [CLKID_SD
] = &g12a_sd
.hw
,
3355 [CLKID_RNG0
] = &g12a_rng0
.hw
,
3356 [CLKID_UART0
] = &g12a_uart0
.hw
,
3357 [CLKID_SPICC1
] = &g12a_spicc_1
.hw
,
3358 [CLKID_HIU_IFACE
] = &g12a_hiu_reg
.hw
,
3359 [CLKID_MIPI_DSI_PHY
] = &g12a_mipi_dsi_phy
.hw
,
3360 [CLKID_ASSIST_MISC
] = &g12a_assist_misc
.hw
,
3361 [CLKID_SD_EMMC_A
] = &g12a_emmc_a
.hw
,
3362 [CLKID_SD_EMMC_B
] = &g12a_emmc_b
.hw
,
3363 [CLKID_SD_EMMC_C
] = &g12a_emmc_c
.hw
,
3364 [CLKID_AUDIO_CODEC
] = &g12a_audio_codec
.hw
,
3365 [CLKID_AUDIO
] = &g12a_audio
.hw
,
3366 [CLKID_ETH
] = &g12a_eth_core
.hw
,
3367 [CLKID_DEMUX
] = &g12a_demux
.hw
,
3368 [CLKID_AUDIO_IFIFO
] = &g12a_audio_ififo
.hw
,
3369 [CLKID_ADC
] = &g12a_adc
.hw
,
3370 [CLKID_UART1
] = &g12a_uart1
.hw
,
3371 [CLKID_G2D
] = &g12a_g2d
.hw
,
3372 [CLKID_RESET
] = &g12a_reset
.hw
,
3373 [CLKID_PCIE_COMB
] = &g12a_pcie_comb
.hw
,
3374 [CLKID_PARSER
] = &g12a_parser
.hw
,
3375 [CLKID_USB
] = &g12a_usb_general
.hw
,
3376 [CLKID_PCIE_PHY
] = &g12a_pcie_phy
.hw
,
3377 [CLKID_AHB_ARB0
] = &g12a_ahb_arb0
.hw
,
3378 [CLKID_AHB_DATA_BUS
] = &g12a_ahb_data_bus
.hw
,
3379 [CLKID_AHB_CTRL_BUS
] = &g12a_ahb_ctrl_bus
.hw
,
3380 [CLKID_HTX_HDCP22
] = &g12a_htx_hdcp22
.hw
,
3381 [CLKID_HTX_PCLK
] = &g12a_htx_pclk
.hw
,
3382 [CLKID_BT656
] = &g12a_bt656
.hw
,
3383 [CLKID_USB1_DDR_BRIDGE
] = &g12a_usb1_to_ddr
.hw
,
3384 [CLKID_MMC_PCLK
] = &g12a_mmc_pclk
.hw
,
3385 [CLKID_UART2
] = &g12a_uart2
.hw
,
3386 [CLKID_VPU_INTR
] = &g12a_vpu_intr
.hw
,
3387 [CLKID_GIC
] = &g12a_gic
.hw
,
3388 [CLKID_SD_EMMC_A_CLK0_SEL
] = &g12a_sd_emmc_a_clk0_sel
.hw
,
3389 [CLKID_SD_EMMC_A_CLK0_DIV
] = &g12a_sd_emmc_a_clk0_div
.hw
,
3390 [CLKID_SD_EMMC_A_CLK0
] = &g12a_sd_emmc_a_clk0
.hw
,
3391 [CLKID_SD_EMMC_B_CLK0_SEL
] = &g12a_sd_emmc_b_clk0_sel
.hw
,
3392 [CLKID_SD_EMMC_B_CLK0_DIV
] = &g12a_sd_emmc_b_clk0_div
.hw
,
3393 [CLKID_SD_EMMC_B_CLK0
] = &g12a_sd_emmc_b_clk0
.hw
,
3394 [CLKID_SD_EMMC_C_CLK0_SEL
] = &g12a_sd_emmc_c_clk0_sel
.hw
,
3395 [CLKID_SD_EMMC_C_CLK0_DIV
] = &g12a_sd_emmc_c_clk0_div
.hw
,
3396 [CLKID_SD_EMMC_C_CLK0
] = &g12a_sd_emmc_c_clk0
.hw
,
3397 [CLKID_MPLL0_DIV
] = &g12a_mpll0_div
.hw
,
3398 [CLKID_MPLL1_DIV
] = &g12a_mpll1_div
.hw
,
3399 [CLKID_MPLL2_DIV
] = &g12a_mpll2_div
.hw
,
3400 [CLKID_MPLL3_DIV
] = &g12a_mpll3_div
.hw
,
3401 [CLKID_FCLK_DIV2_DIV
] = &g12a_fclk_div2_div
.hw
,
3402 [CLKID_FCLK_DIV3_DIV
] = &g12a_fclk_div3_div
.hw
,
3403 [CLKID_FCLK_DIV4_DIV
] = &g12a_fclk_div4_div
.hw
,
3404 [CLKID_FCLK_DIV5_DIV
] = &g12a_fclk_div5_div
.hw
,
3405 [CLKID_FCLK_DIV7_DIV
] = &g12a_fclk_div7_div
.hw
,
3406 [CLKID_FCLK_DIV2P5_DIV
] = &g12a_fclk_div2p5_div
.hw
,
3407 [CLKID_HIFI_PLL
] = &g12a_hifi_pll
.hw
,
3408 [CLKID_VCLK2_VENCI0
] = &g12a_vclk2_venci0
.hw
,
3409 [CLKID_VCLK2_VENCI1
] = &g12a_vclk2_venci1
.hw
,
3410 [CLKID_VCLK2_VENCP0
] = &g12a_vclk2_vencp0
.hw
,
3411 [CLKID_VCLK2_VENCP1
] = &g12a_vclk2_vencp1
.hw
,
3412 [CLKID_VCLK2_VENCT0
] = &g12a_vclk2_venct0
.hw
,
3413 [CLKID_VCLK2_VENCT1
] = &g12a_vclk2_venct1
.hw
,
3414 [CLKID_VCLK2_OTHER
] = &g12a_vclk2_other
.hw
,
3415 [CLKID_VCLK2_ENCI
] = &g12a_vclk2_enci
.hw
,
3416 [CLKID_VCLK2_ENCP
] = &g12a_vclk2_encp
.hw
,
3417 [CLKID_DAC_CLK
] = &g12a_dac_clk
.hw
,
3418 [CLKID_AOCLK
] = &g12a_aoclk_gate
.hw
,
3419 [CLKID_IEC958
] = &g12a_iec958_gate
.hw
,
3420 [CLKID_ENC480P
] = &g12a_enc480p
.hw
,
3421 [CLKID_RNG1
] = &g12a_rng1
.hw
,
3422 [CLKID_VCLK2_ENCT
] = &g12a_vclk2_enct
.hw
,
3423 [CLKID_VCLK2_ENCL
] = &g12a_vclk2_encl
.hw
,
3424 [CLKID_VCLK2_VENCLMMC
] = &g12a_vclk2_venclmmc
.hw
,
3425 [CLKID_VCLK2_VENCL
] = &g12a_vclk2_vencl
.hw
,
3426 [CLKID_VCLK2_OTHER1
] = &g12a_vclk2_other1
.hw
,
3427 [CLKID_FIXED_PLL_DCO
] = &g12a_fixed_pll_dco
.hw
,
3428 [CLKID_SYS_PLL_DCO
] = &g12a_sys_pll_dco
.hw
,
3429 [CLKID_GP0_PLL_DCO
] = &g12a_gp0_pll_dco
.hw
,
3430 [CLKID_HIFI_PLL_DCO
] = &g12a_hifi_pll_dco
.hw
,
3431 [CLKID_DMA
] = &g12a_dma
.hw
,
3432 [CLKID_EFUSE
] = &g12a_efuse
.hw
,
3433 [CLKID_ROM_BOOT
] = &g12a_rom_boot
.hw
,
3434 [CLKID_RESET_SEC
] = &g12a_reset_sec
.hw
,
3435 [CLKID_SEC_AHB_APB3
] = &g12a_sec_ahb_apb3
.hw
,
3436 [CLKID_MPLL_PREDIV
] = &g12a_mpll_prediv
.hw
,
3437 [CLKID_VPU_0_SEL
] = &g12a_vpu_0_sel
.hw
,
3438 [CLKID_VPU_0_DIV
] = &g12a_vpu_0_div
.hw
,
3439 [CLKID_VPU_0
] = &g12a_vpu_0
.hw
,
3440 [CLKID_VPU_1_SEL
] = &g12a_vpu_1_sel
.hw
,
3441 [CLKID_VPU_1_DIV
] = &g12a_vpu_1_div
.hw
,
3442 [CLKID_VPU_1
] = &g12a_vpu_1
.hw
,
3443 [CLKID_VPU
] = &g12a_vpu
.hw
,
3444 [CLKID_VAPB_0_SEL
] = &g12a_vapb_0_sel
.hw
,
3445 [CLKID_VAPB_0_DIV
] = &g12a_vapb_0_div
.hw
,
3446 [CLKID_VAPB_0
] = &g12a_vapb_0
.hw
,
3447 [CLKID_VAPB_1_SEL
] = &g12a_vapb_1_sel
.hw
,
3448 [CLKID_VAPB_1_DIV
] = &g12a_vapb_1_div
.hw
,
3449 [CLKID_VAPB_1
] = &g12a_vapb_1
.hw
,
3450 [CLKID_VAPB_SEL
] = &g12a_vapb_sel
.hw
,
3451 [CLKID_VAPB
] = &g12a_vapb
.hw
,
3452 [CLKID_HDMI_PLL_DCO
] = &g12a_hdmi_pll_dco
.hw
,
3453 [CLKID_HDMI_PLL_OD
] = &g12a_hdmi_pll_od
.hw
,
3454 [CLKID_HDMI_PLL_OD2
] = &g12a_hdmi_pll_od2
.hw
,
3455 [CLKID_HDMI_PLL
] = &g12a_hdmi_pll
.hw
,
3456 [CLKID_VID_PLL
] = &g12a_vid_pll_div
.hw
,
3457 [CLKID_VID_PLL_SEL
] = &g12a_vid_pll_sel
.hw
,
3458 [CLKID_VID_PLL_DIV
] = &g12a_vid_pll
.hw
,
3459 [CLKID_VCLK_SEL
] = &g12a_vclk_sel
.hw
,
3460 [CLKID_VCLK2_SEL
] = &g12a_vclk2_sel
.hw
,
3461 [CLKID_VCLK_INPUT
] = &g12a_vclk_input
.hw
,
3462 [CLKID_VCLK2_INPUT
] = &g12a_vclk2_input
.hw
,
3463 [CLKID_VCLK_DIV
] = &g12a_vclk_div
.hw
,
3464 [CLKID_VCLK2_DIV
] = &g12a_vclk2_div
.hw
,
3465 [CLKID_VCLK
] = &g12a_vclk
.hw
,
3466 [CLKID_VCLK2
] = &g12a_vclk2
.hw
,
3467 [CLKID_VCLK_DIV1
] = &g12a_vclk_div1
.hw
,
3468 [CLKID_VCLK_DIV2_EN
] = &g12a_vclk_div2_en
.hw
,
3469 [CLKID_VCLK_DIV4_EN
] = &g12a_vclk_div4_en
.hw
,
3470 [CLKID_VCLK_DIV6_EN
] = &g12a_vclk_div6_en
.hw
,
3471 [CLKID_VCLK_DIV12_EN
] = &g12a_vclk_div12_en
.hw
,
3472 [CLKID_VCLK2_DIV1
] = &g12a_vclk2_div1
.hw
,
3473 [CLKID_VCLK2_DIV2_EN
] = &g12a_vclk2_div2_en
.hw
,
3474 [CLKID_VCLK2_DIV4_EN
] = &g12a_vclk2_div4_en
.hw
,
3475 [CLKID_VCLK2_DIV6_EN
] = &g12a_vclk2_div6_en
.hw
,
3476 [CLKID_VCLK2_DIV12_EN
] = &g12a_vclk2_div12_en
.hw
,
3477 [CLKID_VCLK_DIV2
] = &g12a_vclk_div2
.hw
,
3478 [CLKID_VCLK_DIV4
] = &g12a_vclk_div4
.hw
,
3479 [CLKID_VCLK_DIV6
] = &g12a_vclk_div6
.hw
,
3480 [CLKID_VCLK_DIV12
] = &g12a_vclk_div12
.hw
,
3481 [CLKID_VCLK2_DIV2
] = &g12a_vclk2_div2
.hw
,
3482 [CLKID_VCLK2_DIV4
] = &g12a_vclk2_div4
.hw
,
3483 [CLKID_VCLK2_DIV6
] = &g12a_vclk2_div6
.hw
,
3484 [CLKID_VCLK2_DIV12
] = &g12a_vclk2_div12
.hw
,
3485 [CLKID_CTS_ENCI_SEL
] = &g12a_cts_enci_sel
.hw
,
3486 [CLKID_CTS_ENCP_SEL
] = &g12a_cts_encp_sel
.hw
,
3487 [CLKID_CTS_VDAC_SEL
] = &g12a_cts_vdac_sel
.hw
,
3488 [CLKID_HDMI_TX_SEL
] = &g12a_hdmi_tx_sel
.hw
,
3489 [CLKID_CTS_ENCI
] = &g12a_cts_enci
.hw
,
3490 [CLKID_CTS_ENCP
] = &g12a_cts_encp
.hw
,
3491 [CLKID_CTS_VDAC
] = &g12a_cts_vdac
.hw
,
3492 [CLKID_HDMI_TX
] = &g12a_hdmi_tx
.hw
,
3493 [CLKID_HDMI_SEL
] = &g12a_hdmi_sel
.hw
,
3494 [CLKID_HDMI_DIV
] = &g12a_hdmi_div
.hw
,
3495 [CLKID_HDMI
] = &g12a_hdmi
.hw
,
3496 [CLKID_MALI_0_SEL
] = &g12a_mali_0_sel
.hw
,
3497 [CLKID_MALI_0_DIV
] = &g12a_mali_0_div
.hw
,
3498 [CLKID_MALI_0
] = &g12a_mali_0
.hw
,
3499 [CLKID_MALI_1_SEL
] = &g12a_mali_1_sel
.hw
,
3500 [CLKID_MALI_1_DIV
] = &g12a_mali_1_div
.hw
,
3501 [CLKID_MALI_1
] = &g12a_mali_1
.hw
,
3502 [CLKID_MALI
] = &g12a_mali
.hw
,
3503 [CLKID_MPLL_50M_DIV
] = &g12a_mpll_50m_div
.hw
,
3504 [CLKID_MPLL_50M
] = &g12a_mpll_50m
.hw
,
3505 [CLKID_SYS_PLL_DIV16_EN
] = &g12a_sys_pll_div16_en
.hw
,
3506 [CLKID_SYS_PLL_DIV16
] = &g12a_sys_pll_div16
.hw
,
3507 [CLKID_CPU_CLK_DYN0_SEL
] = &g12a_cpu_clk_premux0
.hw
,
3508 [CLKID_CPU_CLK_DYN0_DIV
] = &g12a_cpu_clk_mux0_div
.hw
,
3509 [CLKID_CPU_CLK_DYN0
] = &g12a_cpu_clk_postmux0
.hw
,
3510 [CLKID_CPU_CLK_DYN1_SEL
] = &g12a_cpu_clk_premux1
.hw
,
3511 [CLKID_CPU_CLK_DYN1_DIV
] = &g12a_cpu_clk_mux1_div
.hw
,
3512 [CLKID_CPU_CLK_DYN1
] = &g12a_cpu_clk_postmux1
.hw
,
3513 [CLKID_CPU_CLK_DYN
] = &g12a_cpu_clk_dyn
.hw
,
3514 [CLKID_CPU_CLK
] = &g12b_cpu_clk
.hw
,
3515 [CLKID_CPU_CLK_DIV16_EN
] = &g12a_cpu_clk_div16_en
.hw
,
3516 [CLKID_CPU_CLK_DIV16
] = &g12a_cpu_clk_div16
.hw
,
3517 [CLKID_CPU_CLK_APB_DIV
] = &g12a_cpu_clk_apb_div
.hw
,
3518 [CLKID_CPU_CLK_APB
] = &g12a_cpu_clk_apb
.hw
,
3519 [CLKID_CPU_CLK_ATB_DIV
] = &g12a_cpu_clk_atb_div
.hw
,
3520 [CLKID_CPU_CLK_ATB
] = &g12a_cpu_clk_atb
.hw
,
3521 [CLKID_CPU_CLK_AXI_DIV
] = &g12a_cpu_clk_axi_div
.hw
,
3522 [CLKID_CPU_CLK_AXI
] = &g12a_cpu_clk_axi
.hw
,
3523 [CLKID_CPU_CLK_TRACE_DIV
] = &g12a_cpu_clk_trace_div
.hw
,
3524 [CLKID_CPU_CLK_TRACE
] = &g12a_cpu_clk_trace
.hw
,
3525 [CLKID_PCIE_PLL_DCO
] = &g12a_pcie_pll_dco
.hw
,
3526 [CLKID_PCIE_PLL_DCO_DIV2
] = &g12a_pcie_pll_dco_div2
.hw
,
3527 [CLKID_PCIE_PLL_OD
] = &g12a_pcie_pll_od
.hw
,
3528 [CLKID_PCIE_PLL
] = &g12a_pcie_pll
.hw
,
3529 [CLKID_VDEC_1_SEL
] = &g12a_vdec_1_sel
.hw
,
3530 [CLKID_VDEC_1_DIV
] = &g12a_vdec_1_div
.hw
,
3531 [CLKID_VDEC_1
] = &g12a_vdec_1
.hw
,
3532 [CLKID_VDEC_HEVC_SEL
] = &g12a_vdec_hevc_sel
.hw
,
3533 [CLKID_VDEC_HEVC_DIV
] = &g12a_vdec_hevc_div
.hw
,
3534 [CLKID_VDEC_HEVC
] = &g12a_vdec_hevc
.hw
,
3535 [CLKID_VDEC_HEVCF_SEL
] = &g12a_vdec_hevcf_sel
.hw
,
3536 [CLKID_VDEC_HEVCF_DIV
] = &g12a_vdec_hevcf_div
.hw
,
3537 [CLKID_VDEC_HEVCF
] = &g12a_vdec_hevcf
.hw
,
3538 [CLKID_TS_DIV
] = &g12a_ts_div
.hw
,
3539 [CLKID_TS
] = &g12a_ts
.hw
,
3540 [CLKID_SYS1_PLL_DCO
] = &g12b_sys1_pll_dco
.hw
,
3541 [CLKID_SYS1_PLL
] = &g12b_sys1_pll
.hw
,
3542 [CLKID_SYS1_PLL_DIV16_EN
] = &g12b_sys1_pll_div16_en
.hw
,
3543 [CLKID_SYS1_PLL_DIV16
] = &g12b_sys1_pll_div16
.hw
,
3544 [CLKID_CPUB_CLK_DYN0_SEL
] = &g12b_cpub_clk_premux0
.hw
,
3545 [CLKID_CPUB_CLK_DYN0_DIV
] = &g12b_cpub_clk_mux0_div
.hw
,
3546 [CLKID_CPUB_CLK_DYN0
] = &g12b_cpub_clk_postmux0
.hw
,
3547 [CLKID_CPUB_CLK_DYN1_SEL
] = &g12b_cpub_clk_premux1
.hw
,
3548 [CLKID_CPUB_CLK_DYN1_DIV
] = &g12b_cpub_clk_mux1_div
.hw
,
3549 [CLKID_CPUB_CLK_DYN1
] = &g12b_cpub_clk_postmux1
.hw
,
3550 [CLKID_CPUB_CLK_DYN
] = &g12b_cpub_clk_dyn
.hw
,
3551 [CLKID_CPUB_CLK
] = &g12b_cpub_clk
.hw
,
3552 [CLKID_CPUB_CLK_DIV16_EN
] = &g12b_cpub_clk_div16_en
.hw
,
3553 [CLKID_CPUB_CLK_DIV16
] = &g12b_cpub_clk_div16
.hw
,
3554 [CLKID_CPUB_CLK_DIV2
] = &g12b_cpub_clk_div2
.hw
,
3555 [CLKID_CPUB_CLK_DIV3
] = &g12b_cpub_clk_div3
.hw
,
3556 [CLKID_CPUB_CLK_DIV4
] = &g12b_cpub_clk_div4
.hw
,
3557 [CLKID_CPUB_CLK_DIV5
] = &g12b_cpub_clk_div5
.hw
,
3558 [CLKID_CPUB_CLK_DIV6
] = &g12b_cpub_clk_div6
.hw
,
3559 [CLKID_CPUB_CLK_DIV7
] = &g12b_cpub_clk_div7
.hw
,
3560 [CLKID_CPUB_CLK_DIV8
] = &g12b_cpub_clk_div8
.hw
,
3561 [CLKID_CPUB_CLK_APB_SEL
] = &g12b_cpub_clk_apb_sel
.hw
,
3562 [CLKID_CPUB_CLK_APB
] = &g12b_cpub_clk_apb
.hw
,
3563 [CLKID_CPUB_CLK_ATB_SEL
] = &g12b_cpub_clk_atb_sel
.hw
,
3564 [CLKID_CPUB_CLK_ATB
] = &g12b_cpub_clk_atb
.hw
,
3565 [CLKID_CPUB_CLK_AXI_SEL
] = &g12b_cpub_clk_axi_sel
.hw
,
3566 [CLKID_CPUB_CLK_AXI
] = &g12b_cpub_clk_axi
.hw
,
3567 [CLKID_CPUB_CLK_TRACE_SEL
] = &g12b_cpub_clk_trace_sel
.hw
,
3568 [CLKID_CPUB_CLK_TRACE
] = &g12b_cpub_clk_trace
.hw
,
3574 /* Convenience table to populate regmap in .probe */
3575 static struct clk_regmap
*const g12a_clk_regmaps
[] = {
3580 &g12a_mipi_dsi_host
,
3621 &g12a_sd_emmc_a_clk0
,
3622 &g12a_sd_emmc_b_clk0
,
3623 &g12a_sd_emmc_c_clk0
,
3625 &g12a_sd_emmc_a_clk0_div
,
3626 &g12a_sd_emmc_b_clk0_div
,
3627 &g12a_sd_emmc_c_clk0_div
,
3629 &g12a_sd_emmc_a_clk0_sel
,
3630 &g12a_sd_emmc_b_clk0_sel
,
3631 &g12a_sd_emmc_c_clk0_sel
,
3660 &g12a_vclk2_venclmmc
,
3663 &g12a_fixed_pll_dco
,
3712 &g12a_vclk_div12_en
,
3714 &g12a_vclk2_div2_en
,
3715 &g12a_vclk2_div4_en
,
3716 &g12a_vclk2_div6_en
,
3717 &g12a_vclk2_div12_en
,
3737 &g12a_sys_pll_div16_en
,
3738 &g12a_cpu_clk_premux0
,
3739 &g12a_cpu_clk_mux0_div
,
3740 &g12a_cpu_clk_postmux0
,
3741 &g12a_cpu_clk_premux1
,
3742 &g12a_cpu_clk_mux1_div
,
3743 &g12a_cpu_clk_postmux1
,
3746 &g12a_cpu_clk_div16_en
,
3747 &g12a_cpu_clk_apb_div
,
3749 &g12a_cpu_clk_atb_div
,
3751 &g12a_cpu_clk_axi_div
,
3753 &g12a_cpu_clk_trace_div
,
3754 &g12a_cpu_clk_trace
,
3760 &g12a_vdec_hevc_sel
,
3761 &g12a_vdec_hevc_div
,
3763 &g12a_vdec_hevcf_sel
,
3764 &g12a_vdec_hevcf_div
,
3771 &g12b_sys1_pll_div16_en
,
3772 &g12b_cpub_clk_premux0
,
3773 &g12b_cpub_clk_mux0_div
,
3774 &g12b_cpub_clk_postmux0
,
3775 &g12b_cpub_clk_premux1
,
3776 &g12b_cpub_clk_mux1_div
,
3777 &g12b_cpub_clk_postmux1
,
3780 &g12b_cpub_clk_div16_en
,
3781 &g12b_cpub_clk_apb_sel
,
3783 &g12b_cpub_clk_atb_sel
,
3785 &g12b_cpub_clk_axi_sel
,
3787 &g12b_cpub_clk_trace_sel
,
3788 &g12b_cpub_clk_trace
,
3791 static const struct reg_sequence g12a_init_regs
[] = {
3792 { .reg
= HHI_MPLL_CNTL0
, .def
= 0x00000543 },
3795 static const struct meson_eeclkc_data g12a_clkc_data
= {
3796 .regmap_clks
= g12a_clk_regmaps
,
3797 .regmap_clk_num
= ARRAY_SIZE(g12a_clk_regmaps
),
3798 .hw_onecell_data
= &g12a_hw_onecell_data
,
3799 .init_regs
= g12a_init_regs
,
3800 .init_count
= ARRAY_SIZE(g12a_init_regs
),
3803 static const struct meson_eeclkc_data g12b_clkc_data
= {
3804 .regmap_clks
= g12a_clk_regmaps
,
3805 .regmap_clk_num
= ARRAY_SIZE(g12a_clk_regmaps
),
3806 .hw_onecell_data
= &g12b_hw_onecell_data
3809 static const struct of_device_id clkc_match_table
[] = {
3810 { .compatible
= "amlogic,g12a-clkc", .data
= &g12a_clkc_data
},
3811 { .compatible
= "amlogic,g12b-clkc", .data
= &g12b_clkc_data
},
3815 static struct platform_driver g12a_driver
= {
3816 .probe
= meson_eeclkc_probe
,
3818 .name
= "g12a-clkc",
3819 .of_match_table
= clkc_match_table
,
3823 builtin_platform_driver(g12a_driver
);