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>
16 #include <linux/platform_device.h>
17 #include <linux/clk.h>
18 #include <linux/module.h>
22 #include "clk-regmap.h"
23 #include "clk-cpu-dyndiv.h"
24 #include "vid-pll-div.h"
26 #include "meson-eeclk.h"
29 #include <dt-bindings/clock/g12a-clkc.h>
31 static struct clk_regmap g12a_fixed_pll_dco
= {
32 .data
= &(struct meson_clk_pll_data
){
34 .reg_off
= HHI_FIX_PLL_CNTL0
,
39 .reg_off
= HHI_FIX_PLL_CNTL0
,
44 .reg_off
= HHI_FIX_PLL_CNTL0
,
49 .reg_off
= HHI_FIX_PLL_CNTL1
,
54 .reg_off
= HHI_FIX_PLL_CNTL0
,
59 .reg_off
= HHI_FIX_PLL_CNTL0
,
64 .hw
.init
= &(struct clk_init_data
){
65 .name
= "fixed_pll_dco",
66 .ops
= &meson_clk_pll_ro_ops
,
67 .parent_data
= &(const struct clk_parent_data
) {
74 static struct clk_regmap g12a_fixed_pll
= {
75 .data
= &(struct clk_regmap_div_data
){
76 .offset
= HHI_FIX_PLL_CNTL0
,
79 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
81 .hw
.init
= &(struct clk_init_data
){
83 .ops
= &clk_regmap_divider_ro_ops
,
84 .parent_hws
= (const struct clk_hw
*[]) {
85 &g12a_fixed_pll_dco
.hw
89 * This clock won't ever change at runtime so
90 * CLK_SET_RATE_PARENT is not required
95 static const struct pll_mult_range g12a_sys_pll_mult_range
= {
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 .range
= &g12a_sys_pll_mult_range
,
129 .hw
.init
= &(struct clk_init_data
){
130 .name
= "sys_pll_dco",
131 .ops
= &meson_clk_pll_ops
,
132 .parent_data
= &(const struct clk_parent_data
) {
136 /* This clock feeds the CPU, avoid disabling it */
137 .flags
= CLK_IS_CRITICAL
,
141 static struct clk_regmap g12a_sys_pll
= {
142 .data
= &(struct clk_regmap_div_data
){
143 .offset
= HHI_SYS_PLL_CNTL0
,
146 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
148 .hw
.init
= &(struct clk_init_data
){
150 .ops
= &clk_regmap_divider_ops
,
151 .parent_hws
= (const struct clk_hw
*[]) {
155 .flags
= CLK_SET_RATE_PARENT
,
159 static struct clk_regmap g12b_sys1_pll_dco
= {
160 .data
= &(struct meson_clk_pll_data
){
162 .reg_off
= HHI_SYS1_PLL_CNTL0
,
167 .reg_off
= HHI_SYS1_PLL_CNTL0
,
172 .reg_off
= HHI_SYS1_PLL_CNTL0
,
177 .reg_off
= HHI_SYS1_PLL_CNTL0
,
182 .reg_off
= HHI_SYS1_PLL_CNTL0
,
186 .range
= &g12a_sys_pll_mult_range
,
188 .hw
.init
= &(struct clk_init_data
){
189 .name
= "sys1_pll_dco",
190 .ops
= &meson_clk_pll_ops
,
191 .parent_data
= &(const struct clk_parent_data
) {
195 /* This clock feeds the CPU, avoid disabling it */
196 .flags
= CLK_IS_CRITICAL
,
200 static struct clk_regmap g12b_sys1_pll
= {
201 .data
= &(struct clk_regmap_div_data
){
202 .offset
= HHI_SYS1_PLL_CNTL0
,
205 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
207 .hw
.init
= &(struct clk_init_data
){
209 .ops
= &clk_regmap_divider_ops
,
210 .parent_hws
= (const struct clk_hw
*[]) {
211 &g12b_sys1_pll_dco
.hw
214 .flags
= CLK_SET_RATE_PARENT
,
218 static struct clk_regmap g12a_sys_pll_div16_en
= {
219 .data
= &(struct clk_regmap_gate_data
){
220 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
223 .hw
.init
= &(struct clk_init_data
) {
224 .name
= "sys_pll_div16_en",
225 .ops
= &clk_regmap_gate_ro_ops
,
226 .parent_hws
= (const struct clk_hw
*[]) { &g12a_sys_pll
.hw
},
229 * This clock is used to debug the sys_pll range
230 * Linux should not change it at runtime
235 static struct clk_regmap g12b_sys1_pll_div16_en
= {
236 .data
= &(struct clk_regmap_gate_data
){
237 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
240 .hw
.init
= &(struct clk_init_data
) {
241 .name
= "sys1_pll_div16_en",
242 .ops
= &clk_regmap_gate_ro_ops
,
243 .parent_hws
= (const struct clk_hw
*[]) {
248 * This clock is used to debug the sys_pll range
249 * Linux should not change it at runtime
254 static struct clk_fixed_factor g12a_sys_pll_div16
= {
257 .hw
.init
= &(struct clk_init_data
){
258 .name
= "sys_pll_div16",
259 .ops
= &clk_fixed_factor_ops
,
260 .parent_hws
= (const struct clk_hw
*[]) {
261 &g12a_sys_pll_div16_en
.hw
267 static struct clk_fixed_factor g12b_sys1_pll_div16
= {
270 .hw
.init
= &(struct clk_init_data
){
271 .name
= "sys1_pll_div16",
272 .ops
= &clk_fixed_factor_ops
,
273 .parent_hws
= (const struct clk_hw
*[]) {
274 &g12b_sys1_pll_div16_en
.hw
280 static struct clk_fixed_factor g12a_fclk_div2_div
= {
283 .hw
.init
= &(struct clk_init_data
){
284 .name
= "fclk_div2_div",
285 .ops
= &clk_fixed_factor_ops
,
286 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
291 static struct clk_regmap g12a_fclk_div2
= {
292 .data
= &(struct clk_regmap_gate_data
){
293 .offset
= HHI_FIX_PLL_CNTL1
,
296 .hw
.init
= &(struct clk_init_data
){
298 .ops
= &clk_regmap_gate_ops
,
299 .parent_hws
= (const struct clk_hw
*[]) {
300 &g12a_fclk_div2_div
.hw
304 * Similar to fclk_div3, it seems that this clock is used by
305 * the resident firmware and is required by the platform to
307 * Until the following condition are met, we need this clock to
308 * be marked as critical:
309 * a) Mark the clock used by a firmware resource, if possible
310 * b) CCF has a clock hand-off mechanism to make the sure the
311 * clock stays on until the proper driver comes along
313 .flags
= CLK_IS_CRITICAL
,
317 static struct clk_fixed_factor g12a_fclk_div3_div
= {
320 .hw
.init
= &(struct clk_init_data
){
321 .name
= "fclk_div3_div",
322 .ops
= &clk_fixed_factor_ops
,
323 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
328 static struct clk_regmap g12a_fclk_div3
= {
329 .data
= &(struct clk_regmap_gate_data
){
330 .offset
= HHI_FIX_PLL_CNTL1
,
333 .hw
.init
= &(struct clk_init_data
){
335 .ops
= &clk_regmap_gate_ops
,
336 .parent_hws
= (const struct clk_hw
*[]) {
337 &g12a_fclk_div3_div
.hw
341 * This clock is used by the resident firmware and is required
342 * by the platform to operate correctly.
343 * Until the following condition are met, we need this clock to
344 * be marked as critical:
345 * a) Mark the clock used by a firmware resource, if possible
346 * b) CCF has a clock hand-off mechanism to make the sure the
347 * clock stays on until the proper driver comes along
349 .flags
= CLK_IS_CRITICAL
,
353 /* Datasheet names this field as "premux0" */
354 static struct clk_regmap g12a_cpu_clk_premux0
= {
355 .data
= &(struct clk_regmap_mux_data
){
356 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
359 .flags
= CLK_MUX_ROUND_CLOSEST
,
361 .hw
.init
= &(struct clk_init_data
){
362 .name
= "cpu_clk_dyn0_sel",
363 .ops
= &clk_regmap_mux_ops
,
364 .parent_data
= (const struct clk_parent_data
[]) {
365 { .fw_name
= "xtal", },
366 { .hw
= &g12a_fclk_div2
.hw
},
367 { .hw
= &g12a_fclk_div3
.hw
},
370 .flags
= CLK_SET_RATE_PARENT
,
374 /* Datasheet names this field as "premux1" */
375 static struct clk_regmap g12a_cpu_clk_premux1
= {
376 .data
= &(struct clk_regmap_mux_data
){
377 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
381 .hw
.init
= &(struct clk_init_data
){
382 .name
= "cpu_clk_dyn1_sel",
383 .ops
= &clk_regmap_mux_ops
,
384 .parent_data
= (const struct clk_parent_data
[]) {
385 { .fw_name
= "xtal", },
386 { .hw
= &g12a_fclk_div2
.hw
},
387 { .hw
= &g12a_fclk_div3
.hw
},
390 /* This sub-tree is used a parking clock */
391 .flags
= CLK_SET_RATE_NO_REPARENT
395 /* Datasheet names this field as "mux0_divn_tcnt" */
396 static struct clk_regmap g12a_cpu_clk_mux0_div
= {
397 .data
= &(struct meson_clk_cpu_dyndiv_data
){
399 .reg_off
= HHI_SYS_CPU_CLK_CNTL0
,
404 .reg_off
= HHI_SYS_CPU_CLK_CNTL0
,
409 .hw
.init
= &(struct clk_init_data
){
410 .name
= "cpu_clk_dyn0_div",
411 .ops
= &meson_clk_cpu_dyndiv_ops
,
412 .parent_hws
= (const struct clk_hw
*[]) {
413 &g12a_cpu_clk_premux0
.hw
416 .flags
= CLK_SET_RATE_PARENT
,
420 /* Datasheet names this field as "postmux0" */
421 static struct clk_regmap g12a_cpu_clk_postmux0
= {
422 .data
= &(struct clk_regmap_mux_data
){
423 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
426 .flags
= CLK_MUX_ROUND_CLOSEST
,
428 .hw
.init
= &(struct clk_init_data
){
429 .name
= "cpu_clk_dyn0",
430 .ops
= &clk_regmap_mux_ops
,
431 .parent_hws
= (const struct clk_hw
*[]) {
432 &g12a_cpu_clk_premux0
.hw
,
433 &g12a_cpu_clk_mux0_div
.hw
,
436 .flags
= CLK_SET_RATE_PARENT
,
440 /* Datasheet names this field as "Mux1_divn_tcnt" */
441 static struct clk_regmap g12a_cpu_clk_mux1_div
= {
442 .data
= &(struct clk_regmap_div_data
){
443 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
447 .hw
.init
= &(struct clk_init_data
){
448 .name
= "cpu_clk_dyn1_div",
449 .ops
= &clk_regmap_divider_ro_ops
,
450 .parent_hws
= (const struct clk_hw
*[]) {
451 &g12a_cpu_clk_premux1
.hw
457 /* Datasheet names this field as "postmux1" */
458 static struct clk_regmap g12a_cpu_clk_postmux1
= {
459 .data
= &(struct clk_regmap_mux_data
){
460 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
464 .hw
.init
= &(struct clk_init_data
){
465 .name
= "cpu_clk_dyn1",
466 .ops
= &clk_regmap_mux_ops
,
467 .parent_hws
= (const struct clk_hw
*[]) {
468 &g12a_cpu_clk_premux1
.hw
,
469 &g12a_cpu_clk_mux1_div
.hw
,
472 /* This sub-tree is used a parking clock */
473 .flags
= CLK_SET_RATE_NO_REPARENT
,
477 /* Datasheet names this field as "Final_dyn_mux_sel" */
478 static struct clk_regmap g12a_cpu_clk_dyn
= {
479 .data
= &(struct clk_regmap_mux_data
){
480 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
483 .flags
= CLK_MUX_ROUND_CLOSEST
,
485 .hw
.init
= &(struct clk_init_data
){
486 .name
= "cpu_clk_dyn",
487 .ops
= &clk_regmap_mux_ops
,
488 .parent_hws
= (const struct clk_hw
*[]) {
489 &g12a_cpu_clk_postmux0
.hw
,
490 &g12a_cpu_clk_postmux1
.hw
,
493 .flags
= CLK_SET_RATE_PARENT
,
497 /* Datasheet names this field as "Final_mux_sel" */
498 static struct clk_regmap g12a_cpu_clk
= {
499 .data
= &(struct clk_regmap_mux_data
){
500 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
503 .flags
= CLK_MUX_ROUND_CLOSEST
,
505 .hw
.init
= &(struct clk_init_data
){
507 .ops
= &clk_regmap_mux_ops
,
508 .parent_hws
= (const struct clk_hw
*[]) {
509 &g12a_cpu_clk_dyn
.hw
,
513 .flags
= CLK_SET_RATE_PARENT
,
517 /* Datasheet names this field as "Final_mux_sel" */
518 static struct clk_regmap g12b_cpu_clk
= {
519 .data
= &(struct clk_regmap_mux_data
){
520 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
523 .flags
= CLK_MUX_ROUND_CLOSEST
,
525 .hw
.init
= &(struct clk_init_data
){
527 .ops
= &clk_regmap_mux_ops
,
528 .parent_hws
= (const struct clk_hw
*[]) {
529 &g12a_cpu_clk_dyn
.hw
,
533 .flags
= CLK_SET_RATE_PARENT
,
537 /* Datasheet names this field as "premux0" */
538 static struct clk_regmap g12b_cpub_clk_premux0
= {
539 .data
= &(struct clk_regmap_mux_data
){
540 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
543 .flags
= CLK_MUX_ROUND_CLOSEST
,
545 .hw
.init
= &(struct clk_init_data
){
546 .name
= "cpub_clk_dyn0_sel",
547 .ops
= &clk_regmap_mux_ops
,
548 .parent_data
= (const struct clk_parent_data
[]) {
549 { .fw_name
= "xtal", },
550 { .hw
= &g12a_fclk_div2
.hw
},
551 { .hw
= &g12a_fclk_div3
.hw
},
554 .flags
= CLK_SET_RATE_PARENT
,
558 /* Datasheet names this field as "mux0_divn_tcnt" */
559 static struct clk_regmap g12b_cpub_clk_mux0_div
= {
560 .data
= &(struct meson_clk_cpu_dyndiv_data
){
562 .reg_off
= HHI_SYS_CPUB_CLK_CNTL
,
567 .reg_off
= HHI_SYS_CPUB_CLK_CNTL
,
572 .hw
.init
= &(struct clk_init_data
){
573 .name
= "cpub_clk_dyn0_div",
574 .ops
= &meson_clk_cpu_dyndiv_ops
,
575 .parent_hws
= (const struct clk_hw
*[]) {
576 &g12b_cpub_clk_premux0
.hw
579 .flags
= CLK_SET_RATE_PARENT
,
583 /* Datasheet names this field as "postmux0" */
584 static struct clk_regmap g12b_cpub_clk_postmux0
= {
585 .data
= &(struct clk_regmap_mux_data
){
586 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
589 .flags
= CLK_MUX_ROUND_CLOSEST
,
591 .hw
.init
= &(struct clk_init_data
){
592 .name
= "cpub_clk_dyn0",
593 .ops
= &clk_regmap_mux_ops
,
594 .parent_hws
= (const struct clk_hw
*[]) {
595 &g12b_cpub_clk_premux0
.hw
,
596 &g12b_cpub_clk_mux0_div
.hw
599 .flags
= CLK_SET_RATE_PARENT
,
603 /* Datasheet names this field as "premux1" */
604 static struct clk_regmap g12b_cpub_clk_premux1
= {
605 .data
= &(struct clk_regmap_mux_data
){
606 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
610 .hw
.init
= &(struct clk_init_data
){
611 .name
= "cpub_clk_dyn1_sel",
612 .ops
= &clk_regmap_mux_ops
,
613 .parent_data
= (const struct clk_parent_data
[]) {
614 { .fw_name
= "xtal", },
615 { .hw
= &g12a_fclk_div2
.hw
},
616 { .hw
= &g12a_fclk_div3
.hw
},
619 /* This sub-tree is used a parking clock */
620 .flags
= CLK_SET_RATE_NO_REPARENT
,
624 /* Datasheet names this field as "Mux1_divn_tcnt" */
625 static struct clk_regmap g12b_cpub_clk_mux1_div
= {
626 .data
= &(struct clk_regmap_div_data
){
627 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
631 .hw
.init
= &(struct clk_init_data
){
632 .name
= "cpub_clk_dyn1_div",
633 .ops
= &clk_regmap_divider_ro_ops
,
634 .parent_hws
= (const struct clk_hw
*[]) {
635 &g12b_cpub_clk_premux1
.hw
641 /* Datasheet names this field as "postmux1" */
642 static struct clk_regmap g12b_cpub_clk_postmux1
= {
643 .data
= &(struct clk_regmap_mux_data
){
644 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
648 .hw
.init
= &(struct clk_init_data
){
649 .name
= "cpub_clk_dyn1",
650 .ops
= &clk_regmap_mux_ops
,
651 .parent_hws
= (const struct clk_hw
*[]) {
652 &g12b_cpub_clk_premux1
.hw
,
653 &g12b_cpub_clk_mux1_div
.hw
656 /* This sub-tree is used a parking clock */
657 .flags
= CLK_SET_RATE_NO_REPARENT
,
661 /* Datasheet names this field as "Final_dyn_mux_sel" */
662 static struct clk_regmap g12b_cpub_clk_dyn
= {
663 .data
= &(struct clk_regmap_mux_data
){
664 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
667 .flags
= CLK_MUX_ROUND_CLOSEST
,
669 .hw
.init
= &(struct clk_init_data
){
670 .name
= "cpub_clk_dyn",
671 .ops
= &clk_regmap_mux_ops
,
672 .parent_hws
= (const struct clk_hw
*[]) {
673 &g12b_cpub_clk_postmux0
.hw
,
674 &g12b_cpub_clk_postmux1
.hw
677 .flags
= CLK_SET_RATE_PARENT
,
681 /* Datasheet names this field as "Final_mux_sel" */
682 static struct clk_regmap g12b_cpub_clk
= {
683 .data
= &(struct clk_regmap_mux_data
){
684 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
687 .flags
= CLK_MUX_ROUND_CLOSEST
,
689 .hw
.init
= &(struct clk_init_data
){
691 .ops
= &clk_regmap_mux_ops
,
692 .parent_hws
= (const struct clk_hw
*[]) {
693 &g12b_cpub_clk_dyn
.hw
,
697 .flags
= CLK_SET_RATE_PARENT
,
701 static struct clk_regmap sm1_gp1_pll
;
703 /* Datasheet names this field as "premux0" */
704 static struct clk_regmap sm1_dsu_clk_premux0
= {
705 .data
= &(struct clk_regmap_mux_data
){
706 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
710 .hw
.init
= &(struct clk_init_data
){
711 .name
= "dsu_clk_dyn0_sel",
712 .ops
= &clk_regmap_mux_ro_ops
,
713 .parent_data
= (const struct clk_parent_data
[]) {
714 { .fw_name
= "xtal", },
715 { .hw
= &g12a_fclk_div2
.hw
},
716 { .hw
= &g12a_fclk_div3
.hw
},
717 { .hw
= &sm1_gp1_pll
.hw
},
723 /* Datasheet names this field as "premux1" */
724 static struct clk_regmap sm1_dsu_clk_premux1
= {
725 .data
= &(struct clk_regmap_mux_data
){
726 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
730 .hw
.init
= &(struct clk_init_data
){
731 .name
= "dsu_clk_dyn1_sel",
732 .ops
= &clk_regmap_mux_ro_ops
,
733 .parent_data
= (const struct clk_parent_data
[]) {
734 { .fw_name
= "xtal", },
735 { .hw
= &g12a_fclk_div2
.hw
},
736 { .hw
= &g12a_fclk_div3
.hw
},
737 { .hw
= &sm1_gp1_pll
.hw
},
743 /* Datasheet names this field as "Mux0_divn_tcnt" */
744 static struct clk_regmap sm1_dsu_clk_mux0_div
= {
745 .data
= &(struct clk_regmap_div_data
){
746 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
750 .hw
.init
= &(struct clk_init_data
){
751 .name
= "dsu_clk_dyn0_div",
752 .ops
= &clk_regmap_divider_ro_ops
,
753 .parent_hws
= (const struct clk_hw
*[]) {
754 &sm1_dsu_clk_premux0
.hw
760 /* Datasheet names this field as "postmux0" */
761 static struct clk_regmap sm1_dsu_clk_postmux0
= {
762 .data
= &(struct clk_regmap_mux_data
){
763 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
767 .hw
.init
= &(struct clk_init_data
){
768 .name
= "dsu_clk_dyn0",
769 .ops
= &clk_regmap_mux_ro_ops
,
770 .parent_hws
= (const struct clk_hw
*[]) {
771 &sm1_dsu_clk_premux0
.hw
,
772 &sm1_dsu_clk_mux0_div
.hw
,
778 /* Datasheet names this field as "Mux1_divn_tcnt" */
779 static struct clk_regmap sm1_dsu_clk_mux1_div
= {
780 .data
= &(struct clk_regmap_div_data
){
781 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
785 .hw
.init
= &(struct clk_init_data
){
786 .name
= "dsu_clk_dyn1_div",
787 .ops
= &clk_regmap_divider_ro_ops
,
788 .parent_hws
= (const struct clk_hw
*[]) {
789 &sm1_dsu_clk_premux1
.hw
795 /* Datasheet names this field as "postmux1" */
796 static struct clk_regmap sm1_dsu_clk_postmux1
= {
797 .data
= &(struct clk_regmap_mux_data
){
798 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
802 .hw
.init
= &(struct clk_init_data
){
803 .name
= "dsu_clk_dyn1",
804 .ops
= &clk_regmap_mux_ro_ops
,
805 .parent_hws
= (const struct clk_hw
*[]) {
806 &sm1_dsu_clk_premux1
.hw
,
807 &sm1_dsu_clk_mux1_div
.hw
,
813 /* Datasheet names this field as "Final_dyn_mux_sel" */
814 static struct clk_regmap sm1_dsu_clk_dyn
= {
815 .data
= &(struct clk_regmap_mux_data
){
816 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
820 .hw
.init
= &(struct clk_init_data
){
821 .name
= "dsu_clk_dyn",
822 .ops
= &clk_regmap_mux_ro_ops
,
823 .parent_hws
= (const struct clk_hw
*[]) {
824 &sm1_dsu_clk_postmux0
.hw
,
825 &sm1_dsu_clk_postmux1
.hw
,
831 /* Datasheet names this field as "Final_mux_sel" */
832 static struct clk_regmap sm1_dsu_final_clk
= {
833 .data
= &(struct clk_regmap_mux_data
){
834 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
838 .hw
.init
= &(struct clk_init_data
){
839 .name
= "dsu_clk_final",
840 .ops
= &clk_regmap_mux_ro_ops
,
841 .parent_hws
= (const struct clk_hw
*[]) {
849 /* Datasheet names this field as "Cpu_clk_sync_mux_sel" bit 0 */
850 static struct clk_regmap sm1_cpu1_clk
= {
851 .data
= &(struct clk_regmap_mux_data
){
852 .offset
= HHI_SYS_CPU_CLK_CNTL6
,
856 .hw
.init
= &(struct clk_init_data
){
858 .ops
= &clk_regmap_mux_ro_ops
,
859 .parent_hws
= (const struct clk_hw
*[]) {
861 /* This CPU also have a dedicated clock tree */
867 /* Datasheet names this field as "Cpu_clk_sync_mux_sel" bit 1 */
868 static struct clk_regmap sm1_cpu2_clk
= {
869 .data
= &(struct clk_regmap_mux_data
){
870 .offset
= HHI_SYS_CPU_CLK_CNTL6
,
874 .hw
.init
= &(struct clk_init_data
){
876 .ops
= &clk_regmap_mux_ro_ops
,
877 .parent_hws
= (const struct clk_hw
*[]) {
879 /* This CPU also have a dedicated clock tree */
885 /* Datasheet names this field as "Cpu_clk_sync_mux_sel" bit 2 */
886 static struct clk_regmap sm1_cpu3_clk
= {
887 .data
= &(struct clk_regmap_mux_data
){
888 .offset
= HHI_SYS_CPU_CLK_CNTL6
,
892 .hw
.init
= &(struct clk_init_data
){
894 .ops
= &clk_regmap_mux_ro_ops
,
895 .parent_hws
= (const struct clk_hw
*[]) {
897 /* This CPU also have a dedicated clock tree */
903 /* Datasheet names this field as "Cpu_clk_sync_mux_sel" bit 4 */
904 static struct clk_regmap sm1_dsu_clk
= {
905 .data
= &(struct clk_regmap_mux_data
){
906 .offset
= HHI_SYS_CPU_CLK_CNTL6
,
910 .hw
.init
= &(struct clk_init_data
){
912 .ops
= &clk_regmap_mux_ro_ops
,
913 .parent_hws
= (const struct clk_hw
*[]) {
915 &sm1_dsu_final_clk
.hw
,
921 static int g12a_cpu_clk_mux_notifier_cb(struct notifier_block
*nb
,
922 unsigned long event
, void *data
)
924 if (event
== POST_RATE_CHANGE
|| event
== PRE_RATE_CHANGE
) {
925 /* Wait for clock propagation before/after changing the mux */
933 static struct notifier_block g12a_cpu_clk_mux_nb
= {
934 .notifier_call
= g12a_cpu_clk_mux_notifier_cb
,
937 struct g12a_cpu_clk_postmux_nb_data
{
938 struct notifier_block nb
;
940 struct clk_hw
*cpu_clk_dyn
;
941 struct clk_hw
*cpu_clk_postmux0
;
942 struct clk_hw
*cpu_clk_postmux1
;
943 struct clk_hw
*cpu_clk_premux1
;
946 static int g12a_cpu_clk_postmux_notifier_cb(struct notifier_block
*nb
,
947 unsigned long event
, void *data
)
949 struct g12a_cpu_clk_postmux_nb_data
*nb_data
=
950 container_of(nb
, struct g12a_cpu_clk_postmux_nb_data
, nb
);
953 case PRE_RATE_CHANGE
:
955 * This notifier means cpu_clk_postmux0 clock will be changed
956 * to feed cpu_clk, this is the current path :
959 * \- cpu_clk_postmux0
960 * \- cpu_clk_muxX_div
962 * \- fclk_div3 or fclk_div2
965 * \- fclk_div3 or fclk_div2
968 /* Setup cpu_clk_premux1 to xtal */
969 clk_hw_set_parent(nb_data
->cpu_clk_premux1
,
972 /* Setup cpu_clk_postmux1 to bypass divider */
973 clk_hw_set_parent(nb_data
->cpu_clk_postmux1
,
974 nb_data
->cpu_clk_premux1
);
976 /* Switch to parking clk on cpu_clk_postmux1 */
977 clk_hw_set_parent(nb_data
->cpu_clk_dyn
,
978 nb_data
->cpu_clk_postmux1
);
981 * Now, cpu_clk is 24MHz in the current path :
984 * \- cpu_clk_postmux1
993 case POST_RATE_CHANGE
:
995 * The cpu_clk_postmux0 has ben updated, now switch back
996 * cpu_clk_dyn to cpu_clk_postmux0 and take the changes
1000 /* Configure cpu_clk_dyn back to cpu_clk_postmux0 */
1001 clk_hw_set_parent(nb_data
->cpu_clk_dyn
,
1002 nb_data
->cpu_clk_postmux0
);
1008 * \- cpu_clk_postmux0
1009 * \- cpu_clk_muxX_div
1010 * \- cpu_clk_premux0
1011 * \- fclk_div3 or fclk_div2
1013 * \- cpu_clk_premux0
1014 * \- fclk_div3 or fclk_div2
1026 static struct g12a_cpu_clk_postmux_nb_data g12a_cpu_clk_postmux0_nb_data
= {
1027 .cpu_clk_dyn
= &g12a_cpu_clk_dyn
.hw
,
1028 .cpu_clk_postmux0
= &g12a_cpu_clk_postmux0
.hw
,
1029 .cpu_clk_postmux1
= &g12a_cpu_clk_postmux1
.hw
,
1030 .cpu_clk_premux1
= &g12a_cpu_clk_premux1
.hw
,
1031 .nb
.notifier_call
= g12a_cpu_clk_postmux_notifier_cb
,
1034 static struct g12a_cpu_clk_postmux_nb_data g12b_cpub_clk_postmux0_nb_data
= {
1035 .cpu_clk_dyn
= &g12b_cpub_clk_dyn
.hw
,
1036 .cpu_clk_postmux0
= &g12b_cpub_clk_postmux0
.hw
,
1037 .cpu_clk_postmux1
= &g12b_cpub_clk_postmux1
.hw
,
1038 .cpu_clk_premux1
= &g12b_cpub_clk_premux1
.hw
,
1039 .nb
.notifier_call
= g12a_cpu_clk_postmux_notifier_cb
,
1042 struct g12a_sys_pll_nb_data
{
1043 struct notifier_block nb
;
1044 struct clk_hw
*sys_pll
;
1045 struct clk_hw
*cpu_clk
;
1046 struct clk_hw
*cpu_clk_dyn
;
1049 static int g12a_sys_pll_notifier_cb(struct notifier_block
*nb
,
1050 unsigned long event
, void *data
)
1052 struct g12a_sys_pll_nb_data
*nb_data
=
1053 container_of(nb
, struct g12a_sys_pll_nb_data
, nb
);
1056 case PRE_RATE_CHANGE
:
1058 * This notifier means sys_pll clock will be changed
1059 * to feed cpu_clk, this the current path :
1065 /* Configure cpu_clk to use cpu_clk_dyn */
1066 clk_hw_set_parent(nb_data
->cpu_clk
,
1067 nb_data
->cpu_clk_dyn
);
1070 * Now, cpu_clk uses the dyn path
1074 * \- cpu_clk_dynX_sel
1075 * \- cpu_clk_dynX_div
1076 * \- xtal/fclk_div2/fclk_div3
1077 * \- xtal/fclk_div2/fclk_div3
1084 case POST_RATE_CHANGE
:
1086 * The sys_pll has ben updated, now switch back cpu_clk to
1090 /* Configure cpu_clk to use sys_pll */
1091 clk_hw_set_parent(nb_data
->cpu_clk
,
1109 static struct g12a_sys_pll_nb_data g12a_sys_pll_nb_data
= {
1110 .sys_pll
= &g12a_sys_pll
.hw
,
1111 .cpu_clk
= &g12a_cpu_clk
.hw
,
1112 .cpu_clk_dyn
= &g12a_cpu_clk_dyn
.hw
,
1113 .nb
.notifier_call
= g12a_sys_pll_notifier_cb
,
1116 /* G12B first CPU cluster uses sys1_pll */
1117 static struct g12a_sys_pll_nb_data g12b_cpu_clk_sys1_pll_nb_data
= {
1118 .sys_pll
= &g12b_sys1_pll
.hw
,
1119 .cpu_clk
= &g12b_cpu_clk
.hw
,
1120 .cpu_clk_dyn
= &g12a_cpu_clk_dyn
.hw
,
1121 .nb
.notifier_call
= g12a_sys_pll_notifier_cb
,
1124 /* G12B second CPU cluster uses sys_pll */
1125 static struct g12a_sys_pll_nb_data g12b_cpub_clk_sys_pll_nb_data
= {
1126 .sys_pll
= &g12a_sys_pll
.hw
,
1127 .cpu_clk
= &g12b_cpub_clk
.hw
,
1128 .cpu_clk_dyn
= &g12b_cpub_clk_dyn
.hw
,
1129 .nb
.notifier_call
= g12a_sys_pll_notifier_cb
,
1132 static struct clk_regmap g12a_cpu_clk_div16_en
= {
1133 .data
= &(struct clk_regmap_gate_data
){
1134 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1137 .hw
.init
= &(struct clk_init_data
) {
1138 .name
= "cpu_clk_div16_en",
1139 .ops
= &clk_regmap_gate_ro_ops
,
1140 .parent_hws
= (const struct clk_hw
*[]) {
1145 * This clock is used to debug the cpu_clk range
1146 * Linux should not change it at runtime
1151 static struct clk_regmap g12b_cpub_clk_div16_en
= {
1152 .data
= &(struct clk_regmap_gate_data
){
1153 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1156 .hw
.init
= &(struct clk_init_data
) {
1157 .name
= "cpub_clk_div16_en",
1158 .ops
= &clk_regmap_gate_ro_ops
,
1159 .parent_hws
= (const struct clk_hw
*[]) {
1164 * This clock is used to debug the cpu_clk range
1165 * Linux should not change it at runtime
1170 static struct clk_fixed_factor g12a_cpu_clk_div16
= {
1173 .hw
.init
= &(struct clk_init_data
){
1174 .name
= "cpu_clk_div16",
1175 .ops
= &clk_fixed_factor_ops
,
1176 .parent_hws
= (const struct clk_hw
*[]) {
1177 &g12a_cpu_clk_div16_en
.hw
1183 static struct clk_fixed_factor g12b_cpub_clk_div16
= {
1186 .hw
.init
= &(struct clk_init_data
){
1187 .name
= "cpub_clk_div16",
1188 .ops
= &clk_fixed_factor_ops
,
1189 .parent_hws
= (const struct clk_hw
*[]) {
1190 &g12b_cpub_clk_div16_en
.hw
1196 static struct clk_regmap g12a_cpu_clk_apb_div
= {
1197 .data
= &(struct clk_regmap_div_data
){
1198 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1201 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1203 .hw
.init
= &(struct clk_init_data
){
1204 .name
= "cpu_clk_apb_div",
1205 .ops
= &clk_regmap_divider_ro_ops
,
1206 .parent_hws
= (const struct clk_hw
*[]) { &g12a_cpu_clk
.hw
},
1211 static struct clk_regmap g12a_cpu_clk_apb
= {
1212 .data
= &(struct clk_regmap_gate_data
){
1213 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1216 .hw
.init
= &(struct clk_init_data
) {
1217 .name
= "cpu_clk_apb",
1218 .ops
= &clk_regmap_gate_ro_ops
,
1219 .parent_hws
= (const struct clk_hw
*[]) {
1220 &g12a_cpu_clk_apb_div
.hw
1224 * This clock is set by the ROM monitor code,
1225 * Linux should not change it at runtime
1230 static struct clk_regmap g12a_cpu_clk_atb_div
= {
1231 .data
= &(struct clk_regmap_div_data
){
1232 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1235 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1237 .hw
.init
= &(struct clk_init_data
){
1238 .name
= "cpu_clk_atb_div",
1239 .ops
= &clk_regmap_divider_ro_ops
,
1240 .parent_hws
= (const struct clk_hw
*[]) { &g12a_cpu_clk
.hw
},
1245 static struct clk_regmap g12a_cpu_clk_atb
= {
1246 .data
= &(struct clk_regmap_gate_data
){
1247 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1250 .hw
.init
= &(struct clk_init_data
) {
1251 .name
= "cpu_clk_atb",
1252 .ops
= &clk_regmap_gate_ro_ops
,
1253 .parent_hws
= (const struct clk_hw
*[]) {
1254 &g12a_cpu_clk_atb_div
.hw
1258 * This clock is set by the ROM monitor code,
1259 * Linux should not change it at runtime
1264 static struct clk_regmap g12a_cpu_clk_axi_div
= {
1265 .data
= &(struct clk_regmap_div_data
){
1266 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1269 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1271 .hw
.init
= &(struct clk_init_data
){
1272 .name
= "cpu_clk_axi_div",
1273 .ops
= &clk_regmap_divider_ro_ops
,
1274 .parent_hws
= (const struct clk_hw
*[]) { &g12a_cpu_clk
.hw
},
1279 static struct clk_regmap g12a_cpu_clk_axi
= {
1280 .data
= &(struct clk_regmap_gate_data
){
1281 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1284 .hw
.init
= &(struct clk_init_data
) {
1285 .name
= "cpu_clk_axi",
1286 .ops
= &clk_regmap_gate_ro_ops
,
1287 .parent_hws
= (const struct clk_hw
*[]) {
1288 &g12a_cpu_clk_axi_div
.hw
1292 * This clock is set by the ROM monitor code,
1293 * Linux should not change it at runtime
1298 static struct clk_regmap g12a_cpu_clk_trace_div
= {
1299 .data
= &(struct clk_regmap_div_data
){
1300 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1303 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1305 .hw
.init
= &(struct clk_init_data
){
1306 .name
= "cpu_clk_trace_div",
1307 .ops
= &clk_regmap_divider_ro_ops
,
1308 .parent_data
= &(const struct clk_parent_data
) {
1311 * G12A and G12B have different cpu_clks (with
1312 * different struct clk_hw). We fallback to the global
1313 * naming string mechanism so cpu_clk_trace_div picks
1314 * up the appropriate one.
1323 static struct clk_regmap g12a_cpu_clk_trace
= {
1324 .data
= &(struct clk_regmap_gate_data
){
1325 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1328 .hw
.init
= &(struct clk_init_data
) {
1329 .name
= "cpu_clk_trace",
1330 .ops
= &clk_regmap_gate_ro_ops
,
1331 .parent_hws
= (const struct clk_hw
*[]) {
1332 &g12a_cpu_clk_trace_div
.hw
1336 * This clock is set by the ROM monitor code,
1337 * Linux should not change it at runtime
1342 static struct clk_fixed_factor g12b_cpub_clk_div2
= {
1345 .hw
.init
= &(struct clk_init_data
){
1346 .name
= "cpub_clk_div2",
1347 .ops
= &clk_fixed_factor_ops
,
1348 .parent_hws
= (const struct clk_hw
*[]) {
1355 static struct clk_fixed_factor g12b_cpub_clk_div3
= {
1358 .hw
.init
= &(struct clk_init_data
){
1359 .name
= "cpub_clk_div3",
1360 .ops
= &clk_fixed_factor_ops
,
1361 .parent_hws
= (const struct clk_hw
*[]) {
1368 static struct clk_fixed_factor g12b_cpub_clk_div4
= {
1371 .hw
.init
= &(struct clk_init_data
){
1372 .name
= "cpub_clk_div4",
1373 .ops
= &clk_fixed_factor_ops
,
1374 .parent_hws
= (const struct clk_hw
*[]) {
1381 static struct clk_fixed_factor g12b_cpub_clk_div5
= {
1384 .hw
.init
= &(struct clk_init_data
){
1385 .name
= "cpub_clk_div5",
1386 .ops
= &clk_fixed_factor_ops
,
1387 .parent_hws
= (const struct clk_hw
*[]) {
1394 static struct clk_fixed_factor g12b_cpub_clk_div6
= {
1397 .hw
.init
= &(struct clk_init_data
){
1398 .name
= "cpub_clk_div6",
1399 .ops
= &clk_fixed_factor_ops
,
1400 .parent_hws
= (const struct clk_hw
*[]) {
1407 static struct clk_fixed_factor g12b_cpub_clk_div7
= {
1410 .hw
.init
= &(struct clk_init_data
){
1411 .name
= "cpub_clk_div7",
1412 .ops
= &clk_fixed_factor_ops
,
1413 .parent_hws
= (const struct clk_hw
*[]) {
1420 static struct clk_fixed_factor g12b_cpub_clk_div8
= {
1423 .hw
.init
= &(struct clk_init_data
){
1424 .name
= "cpub_clk_div8",
1425 .ops
= &clk_fixed_factor_ops
,
1426 .parent_hws
= (const struct clk_hw
*[]) {
1433 static u32 mux_table_cpub
[] = { 1, 2, 3, 4, 5, 6, 7 };
1434 static struct clk_regmap g12b_cpub_clk_apb_sel
= {
1435 .data
= &(struct clk_regmap_mux_data
){
1436 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1439 .table
= mux_table_cpub
,
1441 .hw
.init
= &(struct clk_init_data
){
1442 .name
= "cpub_clk_apb_sel",
1443 .ops
= &clk_regmap_mux_ro_ops
,
1444 .parent_hws
= (const struct clk_hw
*[]) {
1445 &g12b_cpub_clk_div2
.hw
,
1446 &g12b_cpub_clk_div3
.hw
,
1447 &g12b_cpub_clk_div4
.hw
,
1448 &g12b_cpub_clk_div5
.hw
,
1449 &g12b_cpub_clk_div6
.hw
,
1450 &g12b_cpub_clk_div7
.hw
,
1451 &g12b_cpub_clk_div8
.hw
1457 static struct clk_regmap g12b_cpub_clk_apb
= {
1458 .data
= &(struct clk_regmap_gate_data
){
1459 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1461 .flags
= CLK_GATE_SET_TO_DISABLE
,
1463 .hw
.init
= &(struct clk_init_data
) {
1464 .name
= "cpub_clk_apb",
1465 .ops
= &clk_regmap_gate_ro_ops
,
1466 .parent_hws
= (const struct clk_hw
*[]) {
1467 &g12b_cpub_clk_apb_sel
.hw
1471 * This clock is set by the ROM monitor code,
1472 * Linux should not change it at runtime
1477 static struct clk_regmap g12b_cpub_clk_atb_sel
= {
1478 .data
= &(struct clk_regmap_mux_data
){
1479 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1482 .table
= mux_table_cpub
,
1484 .hw
.init
= &(struct clk_init_data
){
1485 .name
= "cpub_clk_atb_sel",
1486 .ops
= &clk_regmap_mux_ro_ops
,
1487 .parent_hws
= (const struct clk_hw
*[]) {
1488 &g12b_cpub_clk_div2
.hw
,
1489 &g12b_cpub_clk_div3
.hw
,
1490 &g12b_cpub_clk_div4
.hw
,
1491 &g12b_cpub_clk_div5
.hw
,
1492 &g12b_cpub_clk_div6
.hw
,
1493 &g12b_cpub_clk_div7
.hw
,
1494 &g12b_cpub_clk_div8
.hw
1500 static struct clk_regmap g12b_cpub_clk_atb
= {
1501 .data
= &(struct clk_regmap_gate_data
){
1502 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1504 .flags
= CLK_GATE_SET_TO_DISABLE
,
1506 .hw
.init
= &(struct clk_init_data
) {
1507 .name
= "cpub_clk_atb",
1508 .ops
= &clk_regmap_gate_ro_ops
,
1509 .parent_hws
= (const struct clk_hw
*[]) {
1510 &g12b_cpub_clk_atb_sel
.hw
1514 * This clock is set by the ROM monitor code,
1515 * Linux should not change it at runtime
1520 static struct clk_regmap g12b_cpub_clk_axi_sel
= {
1521 .data
= &(struct clk_regmap_mux_data
){
1522 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1525 .table
= mux_table_cpub
,
1527 .hw
.init
= &(struct clk_init_data
){
1528 .name
= "cpub_clk_axi_sel",
1529 .ops
= &clk_regmap_mux_ro_ops
,
1530 .parent_hws
= (const struct clk_hw
*[]) {
1531 &g12b_cpub_clk_div2
.hw
,
1532 &g12b_cpub_clk_div3
.hw
,
1533 &g12b_cpub_clk_div4
.hw
,
1534 &g12b_cpub_clk_div5
.hw
,
1535 &g12b_cpub_clk_div6
.hw
,
1536 &g12b_cpub_clk_div7
.hw
,
1537 &g12b_cpub_clk_div8
.hw
1543 static struct clk_regmap g12b_cpub_clk_axi
= {
1544 .data
= &(struct clk_regmap_gate_data
){
1545 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1547 .flags
= CLK_GATE_SET_TO_DISABLE
,
1549 .hw
.init
= &(struct clk_init_data
) {
1550 .name
= "cpub_clk_axi",
1551 .ops
= &clk_regmap_gate_ro_ops
,
1552 .parent_hws
= (const struct clk_hw
*[]) {
1553 &g12b_cpub_clk_axi_sel
.hw
1557 * This clock is set by the ROM monitor code,
1558 * Linux should not change it at runtime
1563 static struct clk_regmap g12b_cpub_clk_trace_sel
= {
1564 .data
= &(struct clk_regmap_mux_data
){
1565 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1568 .table
= mux_table_cpub
,
1570 .hw
.init
= &(struct clk_init_data
){
1571 .name
= "cpub_clk_trace_sel",
1572 .ops
= &clk_regmap_mux_ro_ops
,
1573 .parent_hws
= (const struct clk_hw
*[]) {
1574 &g12b_cpub_clk_div2
.hw
,
1575 &g12b_cpub_clk_div3
.hw
,
1576 &g12b_cpub_clk_div4
.hw
,
1577 &g12b_cpub_clk_div5
.hw
,
1578 &g12b_cpub_clk_div6
.hw
,
1579 &g12b_cpub_clk_div7
.hw
,
1580 &g12b_cpub_clk_div8
.hw
1586 static struct clk_regmap g12b_cpub_clk_trace
= {
1587 .data
= &(struct clk_regmap_gate_data
){
1588 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1590 .flags
= CLK_GATE_SET_TO_DISABLE
,
1592 .hw
.init
= &(struct clk_init_data
) {
1593 .name
= "cpub_clk_trace",
1594 .ops
= &clk_regmap_gate_ro_ops
,
1595 .parent_hws
= (const struct clk_hw
*[]) {
1596 &g12b_cpub_clk_trace_sel
.hw
1600 * This clock is set by the ROM monitor code,
1601 * Linux should not change it at runtime
1606 static const struct pll_mult_range g12a_gp0_pll_mult_range
= {
1612 * Internal gp0 pll emulation configuration parameters
1614 static const struct reg_sequence g12a_gp0_init_regs
[] = {
1615 { .reg
= HHI_GP0_PLL_CNTL1
, .def
= 0x00000000 },
1616 { .reg
= HHI_GP0_PLL_CNTL2
, .def
= 0x00000000 },
1617 { .reg
= HHI_GP0_PLL_CNTL3
, .def
= 0x48681c00 },
1618 { .reg
= HHI_GP0_PLL_CNTL4
, .def
= 0x33771290 },
1619 { .reg
= HHI_GP0_PLL_CNTL5
, .def
= 0x39272000 },
1620 { .reg
= HHI_GP0_PLL_CNTL6
, .def
= 0x56540000 },
1623 static struct clk_regmap g12a_gp0_pll_dco
= {
1624 .data
= &(struct meson_clk_pll_data
){
1626 .reg_off
= HHI_GP0_PLL_CNTL0
,
1631 .reg_off
= HHI_GP0_PLL_CNTL0
,
1636 .reg_off
= HHI_GP0_PLL_CNTL0
,
1641 .reg_off
= HHI_GP0_PLL_CNTL1
,
1646 .reg_off
= HHI_GP0_PLL_CNTL0
,
1651 .reg_off
= HHI_GP0_PLL_CNTL0
,
1655 .range
= &g12a_gp0_pll_mult_range
,
1656 .init_regs
= g12a_gp0_init_regs
,
1657 .init_count
= ARRAY_SIZE(g12a_gp0_init_regs
),
1659 .hw
.init
= &(struct clk_init_data
){
1660 .name
= "gp0_pll_dco",
1661 .ops
= &meson_clk_pll_ops
,
1662 .parent_data
= &(const struct clk_parent_data
) {
1669 static struct clk_regmap g12a_gp0_pll
= {
1670 .data
= &(struct clk_regmap_div_data
){
1671 .offset
= HHI_GP0_PLL_CNTL0
,
1674 .flags
= (CLK_DIVIDER_POWER_OF_TWO
|
1675 CLK_DIVIDER_ROUND_CLOSEST
),
1677 .hw
.init
= &(struct clk_init_data
){
1679 .ops
= &clk_regmap_divider_ops
,
1680 .parent_hws
= (const struct clk_hw
*[]) {
1681 &g12a_gp0_pll_dco
.hw
1684 .flags
= CLK_SET_RATE_PARENT
,
1688 static struct clk_regmap sm1_gp1_pll_dco
= {
1689 .data
= &(struct meson_clk_pll_data
){
1691 .reg_off
= HHI_GP1_PLL_CNTL0
,
1696 .reg_off
= HHI_GP1_PLL_CNTL0
,
1701 .reg_off
= HHI_GP1_PLL_CNTL0
,
1706 .reg_off
= HHI_GP1_PLL_CNTL1
,
1711 .reg_off
= HHI_GP1_PLL_CNTL0
,
1716 .reg_off
= HHI_GP1_PLL_CNTL0
,
1721 .hw
.init
= &(struct clk_init_data
){
1722 .name
= "gp1_pll_dco",
1723 .ops
= &meson_clk_pll_ro_ops
,
1724 .parent_data
= &(const struct clk_parent_data
) {
1728 /* This clock feeds the DSU, avoid disabling it */
1729 .flags
= CLK_IS_CRITICAL
,
1733 static struct clk_regmap sm1_gp1_pll
= {
1734 .data
= &(struct clk_regmap_div_data
){
1735 .offset
= HHI_GP1_PLL_CNTL0
,
1738 .flags
= (CLK_DIVIDER_POWER_OF_TWO
|
1739 CLK_DIVIDER_ROUND_CLOSEST
),
1741 .hw
.init
= &(struct clk_init_data
){
1743 .ops
= &clk_regmap_divider_ro_ops
,
1744 .parent_hws
= (const struct clk_hw
*[]) {
1752 * Internal hifi pll emulation configuration parameters
1754 static const struct reg_sequence g12a_hifi_init_regs
[] = {
1755 { .reg
= HHI_HIFI_PLL_CNTL1
, .def
= 0x00000000 },
1756 { .reg
= HHI_HIFI_PLL_CNTL2
, .def
= 0x00000000 },
1757 { .reg
= HHI_HIFI_PLL_CNTL3
, .def
= 0x6a285c00 },
1758 { .reg
= HHI_HIFI_PLL_CNTL4
, .def
= 0x65771290 },
1759 { .reg
= HHI_HIFI_PLL_CNTL5
, .def
= 0x39272000 },
1760 { .reg
= HHI_HIFI_PLL_CNTL6
, .def
= 0x56540000 },
1763 static struct clk_regmap g12a_hifi_pll_dco
= {
1764 .data
= &(struct meson_clk_pll_data
){
1766 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1771 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1776 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1781 .reg_off
= HHI_HIFI_PLL_CNTL1
,
1786 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1791 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1795 .range
= &g12a_gp0_pll_mult_range
,
1796 .init_regs
= g12a_hifi_init_regs
,
1797 .init_count
= ARRAY_SIZE(g12a_hifi_init_regs
),
1798 .flags
= CLK_MESON_PLL_ROUND_CLOSEST
,
1800 .hw
.init
= &(struct clk_init_data
){
1801 .name
= "hifi_pll_dco",
1802 .ops
= &meson_clk_pll_ops
,
1803 .parent_data
= &(const struct clk_parent_data
) {
1810 static struct clk_regmap g12a_hifi_pll
= {
1811 .data
= &(struct clk_regmap_div_data
){
1812 .offset
= HHI_HIFI_PLL_CNTL0
,
1815 .flags
= (CLK_DIVIDER_POWER_OF_TWO
|
1816 CLK_DIVIDER_ROUND_CLOSEST
),
1818 .hw
.init
= &(struct clk_init_data
){
1820 .ops
= &clk_regmap_divider_ops
,
1821 .parent_hws
= (const struct clk_hw
*[]) {
1822 &g12a_hifi_pll_dco
.hw
1825 .flags
= CLK_SET_RATE_PARENT
,
1830 * The Meson G12A PCIE PLL is fined tuned to deliver a very precise
1831 * 100MHz reference clock for the PCIe Analog PHY, and thus requires
1832 * a strict register sequence to enable the PLL.
1834 static const struct reg_sequence g12a_pcie_pll_init_regs
[] = {
1835 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x20090496 },
1836 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x30090496 },
1837 { .reg
= HHI_PCIE_PLL_CNTL1
, .def
= 0x00000000 },
1838 { .reg
= HHI_PCIE_PLL_CNTL2
, .def
= 0x00001100 },
1839 { .reg
= HHI_PCIE_PLL_CNTL3
, .def
= 0x10058e00 },
1840 { .reg
= HHI_PCIE_PLL_CNTL4
, .def
= 0x000100c0 },
1841 { .reg
= HHI_PCIE_PLL_CNTL5
, .def
= 0x68000048 },
1842 { .reg
= HHI_PCIE_PLL_CNTL5
, .def
= 0x68000068, .delay_us
= 20 },
1843 { .reg
= HHI_PCIE_PLL_CNTL4
, .def
= 0x008100c0, .delay_us
= 10 },
1844 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x34090496 },
1845 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x14090496, .delay_us
= 10 },
1846 { .reg
= HHI_PCIE_PLL_CNTL2
, .def
= 0x00001000 },
1849 /* Keep a single entry table for recalc/round_rate() ops */
1850 static const struct pll_params_table g12a_pcie_pll_table
[] = {
1855 static struct clk_regmap g12a_pcie_pll_dco
= {
1856 .data
= &(struct meson_clk_pll_data
){
1858 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1863 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1868 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1873 .reg_off
= HHI_PCIE_PLL_CNTL1
,
1878 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1883 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1887 .table
= g12a_pcie_pll_table
,
1888 .init_regs
= g12a_pcie_pll_init_regs
,
1889 .init_count
= ARRAY_SIZE(g12a_pcie_pll_init_regs
),
1891 .hw
.init
= &(struct clk_init_data
){
1892 .name
= "pcie_pll_dco",
1893 .ops
= &meson_clk_pcie_pll_ops
,
1894 .parent_data
= &(const struct clk_parent_data
) {
1901 static struct clk_fixed_factor g12a_pcie_pll_dco_div2
= {
1904 .hw
.init
= &(struct clk_init_data
){
1905 .name
= "pcie_pll_dco_div2",
1906 .ops
= &clk_fixed_factor_ops
,
1907 .parent_hws
= (const struct clk_hw
*[]) {
1908 &g12a_pcie_pll_dco
.hw
1911 .flags
= CLK_SET_RATE_PARENT
,
1915 static struct clk_regmap g12a_pcie_pll_od
= {
1916 .data
= &(struct clk_regmap_div_data
){
1917 .offset
= HHI_PCIE_PLL_CNTL0
,
1920 .flags
= CLK_DIVIDER_ROUND_CLOSEST
|
1921 CLK_DIVIDER_ONE_BASED
|
1922 CLK_DIVIDER_ALLOW_ZERO
,
1924 .hw
.init
= &(struct clk_init_data
){
1925 .name
= "pcie_pll_od",
1926 .ops
= &clk_regmap_divider_ops
,
1927 .parent_hws
= (const struct clk_hw
*[]) {
1928 &g12a_pcie_pll_dco_div2
.hw
1931 .flags
= CLK_SET_RATE_PARENT
,
1935 static struct clk_fixed_factor g12a_pcie_pll
= {
1938 .hw
.init
= &(struct clk_init_data
){
1939 .name
= "pcie_pll_pll",
1940 .ops
= &clk_fixed_factor_ops
,
1941 .parent_hws
= (const struct clk_hw
*[]) {
1942 &g12a_pcie_pll_od
.hw
1945 .flags
= CLK_SET_RATE_PARENT
,
1949 static struct clk_regmap g12a_hdmi_pll_dco
= {
1950 .data
= &(struct meson_clk_pll_data
){
1952 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1957 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1962 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1967 .reg_off
= HHI_HDMI_PLL_CNTL1
,
1972 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1977 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1982 .hw
.init
= &(struct clk_init_data
){
1983 .name
= "hdmi_pll_dco",
1984 .ops
= &meson_clk_pll_ro_ops
,
1985 .parent_data
= &(const struct clk_parent_data
) {
1990 * Display directly handle hdmi pll registers ATM, we need
1991 * NOCACHE to keep our view of the clock as accurate as possible
1993 .flags
= CLK_GET_RATE_NOCACHE
,
1997 static struct clk_regmap g12a_hdmi_pll_od
= {
1998 .data
= &(struct clk_regmap_div_data
){
1999 .offset
= HHI_HDMI_PLL_CNTL0
,
2002 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
2004 .hw
.init
= &(struct clk_init_data
){
2005 .name
= "hdmi_pll_od",
2006 .ops
= &clk_regmap_divider_ro_ops
,
2007 .parent_hws
= (const struct clk_hw
*[]) {
2008 &g12a_hdmi_pll_dco
.hw
2011 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
2015 static struct clk_regmap g12a_hdmi_pll_od2
= {
2016 .data
= &(struct clk_regmap_div_data
){
2017 .offset
= HHI_HDMI_PLL_CNTL0
,
2020 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
2022 .hw
.init
= &(struct clk_init_data
){
2023 .name
= "hdmi_pll_od2",
2024 .ops
= &clk_regmap_divider_ro_ops
,
2025 .parent_hws
= (const struct clk_hw
*[]) {
2026 &g12a_hdmi_pll_od
.hw
2029 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
2033 static struct clk_regmap g12a_hdmi_pll
= {
2034 .data
= &(struct clk_regmap_div_data
){
2035 .offset
= HHI_HDMI_PLL_CNTL0
,
2038 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
2040 .hw
.init
= &(struct clk_init_data
){
2042 .ops
= &clk_regmap_divider_ro_ops
,
2043 .parent_hws
= (const struct clk_hw
*[]) {
2044 &g12a_hdmi_pll_od2
.hw
2047 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
2051 static struct clk_fixed_factor g12a_fclk_div4_div
= {
2054 .hw
.init
= &(struct clk_init_data
){
2055 .name
= "fclk_div4_div",
2056 .ops
= &clk_fixed_factor_ops
,
2057 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
2062 static struct clk_regmap g12a_fclk_div4
= {
2063 .data
= &(struct clk_regmap_gate_data
){
2064 .offset
= HHI_FIX_PLL_CNTL1
,
2067 .hw
.init
= &(struct clk_init_data
){
2068 .name
= "fclk_div4",
2069 .ops
= &clk_regmap_gate_ops
,
2070 .parent_hws
= (const struct clk_hw
*[]) {
2071 &g12a_fclk_div4_div
.hw
2077 static struct clk_fixed_factor g12a_fclk_div5_div
= {
2080 .hw
.init
= &(struct clk_init_data
){
2081 .name
= "fclk_div5_div",
2082 .ops
= &clk_fixed_factor_ops
,
2083 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
2088 static struct clk_regmap g12a_fclk_div5
= {
2089 .data
= &(struct clk_regmap_gate_data
){
2090 .offset
= HHI_FIX_PLL_CNTL1
,
2093 .hw
.init
= &(struct clk_init_data
){
2094 .name
= "fclk_div5",
2095 .ops
= &clk_regmap_gate_ops
,
2096 .parent_hws
= (const struct clk_hw
*[]) {
2097 &g12a_fclk_div5_div
.hw
2103 static struct clk_fixed_factor g12a_fclk_div7_div
= {
2106 .hw
.init
= &(struct clk_init_data
){
2107 .name
= "fclk_div7_div",
2108 .ops
= &clk_fixed_factor_ops
,
2109 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
2114 static struct clk_regmap g12a_fclk_div7
= {
2115 .data
= &(struct clk_regmap_gate_data
){
2116 .offset
= HHI_FIX_PLL_CNTL1
,
2119 .hw
.init
= &(struct clk_init_data
){
2120 .name
= "fclk_div7",
2121 .ops
= &clk_regmap_gate_ops
,
2122 .parent_hws
= (const struct clk_hw
*[]) {
2123 &g12a_fclk_div7_div
.hw
2129 static struct clk_fixed_factor g12a_fclk_div2p5_div
= {
2132 .hw
.init
= &(struct clk_init_data
){
2133 .name
= "fclk_div2p5_div",
2134 .ops
= &clk_fixed_factor_ops
,
2135 .parent_hws
= (const struct clk_hw
*[]) {
2136 &g12a_fixed_pll_dco
.hw
2142 static struct clk_regmap g12a_fclk_div2p5
= {
2143 .data
= &(struct clk_regmap_gate_data
){
2144 .offset
= HHI_FIX_PLL_CNTL1
,
2147 .hw
.init
= &(struct clk_init_data
){
2148 .name
= "fclk_div2p5",
2149 .ops
= &clk_regmap_gate_ops
,
2150 .parent_hws
= (const struct clk_hw
*[]) {
2151 &g12a_fclk_div2p5_div
.hw
2157 static struct clk_fixed_factor g12a_mpll_50m_div
= {
2160 .hw
.init
= &(struct clk_init_data
){
2161 .name
= "mpll_50m_div",
2162 .ops
= &clk_fixed_factor_ops
,
2163 .parent_hws
= (const struct clk_hw
*[]) {
2164 &g12a_fixed_pll_dco
.hw
2170 static struct clk_regmap g12a_mpll_50m
= {
2171 .data
= &(struct clk_regmap_mux_data
){
2172 .offset
= HHI_FIX_PLL_CNTL3
,
2176 .hw
.init
= &(struct clk_init_data
){
2178 .ops
= &clk_regmap_mux_ro_ops
,
2179 .parent_data
= (const struct clk_parent_data
[]) {
2180 { .fw_name
= "xtal", },
2181 { .hw
= &g12a_mpll_50m_div
.hw
},
2187 static struct clk_fixed_factor g12a_mpll_prediv
= {
2190 .hw
.init
= &(struct clk_init_data
){
2191 .name
= "mpll_prediv",
2192 .ops
= &clk_fixed_factor_ops
,
2193 .parent_hws
= (const struct clk_hw
*[]) {
2194 &g12a_fixed_pll_dco
.hw
2200 static const struct reg_sequence g12a_mpll0_init_regs
[] = {
2201 { .reg
= HHI_MPLL_CNTL2
, .def
= 0x40000033 },
2204 static struct clk_regmap g12a_mpll0_div
= {
2205 .data
= &(struct meson_clk_mpll_data
){
2207 .reg_off
= HHI_MPLL_CNTL1
,
2212 .reg_off
= HHI_MPLL_CNTL1
,
2217 .reg_off
= HHI_MPLL_CNTL1
,
2222 .reg_off
= HHI_MPLL_CNTL1
,
2226 .init_regs
= g12a_mpll0_init_regs
,
2227 .init_count
= ARRAY_SIZE(g12a_mpll0_init_regs
),
2229 .hw
.init
= &(struct clk_init_data
){
2230 .name
= "mpll0_div",
2231 .ops
= &meson_clk_mpll_ops
,
2232 .parent_hws
= (const struct clk_hw
*[]) {
2233 &g12a_mpll_prediv
.hw
2239 static struct clk_regmap g12a_mpll0
= {
2240 .data
= &(struct clk_regmap_gate_data
){
2241 .offset
= HHI_MPLL_CNTL1
,
2244 .hw
.init
= &(struct clk_init_data
){
2246 .ops
= &clk_regmap_gate_ops
,
2247 .parent_hws
= (const struct clk_hw
*[]) { &g12a_mpll0_div
.hw
},
2249 .flags
= CLK_SET_RATE_PARENT
,
2253 static const struct reg_sequence g12a_mpll1_init_regs
[] = {
2254 { .reg
= HHI_MPLL_CNTL4
, .def
= 0x40000033 },
2257 static struct clk_regmap g12a_mpll1_div
= {
2258 .data
= &(struct meson_clk_mpll_data
){
2260 .reg_off
= HHI_MPLL_CNTL3
,
2265 .reg_off
= HHI_MPLL_CNTL3
,
2270 .reg_off
= HHI_MPLL_CNTL3
,
2275 .reg_off
= HHI_MPLL_CNTL3
,
2279 .init_regs
= g12a_mpll1_init_regs
,
2280 .init_count
= ARRAY_SIZE(g12a_mpll1_init_regs
),
2282 .hw
.init
= &(struct clk_init_data
){
2283 .name
= "mpll1_div",
2284 .ops
= &meson_clk_mpll_ops
,
2285 .parent_hws
= (const struct clk_hw
*[]) {
2286 &g12a_mpll_prediv
.hw
2292 static struct clk_regmap g12a_mpll1
= {
2293 .data
= &(struct clk_regmap_gate_data
){
2294 .offset
= HHI_MPLL_CNTL3
,
2297 .hw
.init
= &(struct clk_init_data
){
2299 .ops
= &clk_regmap_gate_ops
,
2300 .parent_hws
= (const struct clk_hw
*[]) { &g12a_mpll1_div
.hw
},
2302 .flags
= CLK_SET_RATE_PARENT
,
2306 static const struct reg_sequence g12a_mpll2_init_regs
[] = {
2307 { .reg
= HHI_MPLL_CNTL6
, .def
= 0x40000033 },
2310 static struct clk_regmap g12a_mpll2_div
= {
2311 .data
= &(struct meson_clk_mpll_data
){
2313 .reg_off
= HHI_MPLL_CNTL5
,
2318 .reg_off
= HHI_MPLL_CNTL5
,
2323 .reg_off
= HHI_MPLL_CNTL5
,
2328 .reg_off
= HHI_MPLL_CNTL5
,
2332 .init_regs
= g12a_mpll2_init_regs
,
2333 .init_count
= ARRAY_SIZE(g12a_mpll2_init_regs
),
2335 .hw
.init
= &(struct clk_init_data
){
2336 .name
= "mpll2_div",
2337 .ops
= &meson_clk_mpll_ops
,
2338 .parent_hws
= (const struct clk_hw
*[]) {
2339 &g12a_mpll_prediv
.hw
2345 static struct clk_regmap g12a_mpll2
= {
2346 .data
= &(struct clk_regmap_gate_data
){
2347 .offset
= HHI_MPLL_CNTL5
,
2350 .hw
.init
= &(struct clk_init_data
){
2352 .ops
= &clk_regmap_gate_ops
,
2353 .parent_hws
= (const struct clk_hw
*[]) { &g12a_mpll2_div
.hw
},
2355 .flags
= CLK_SET_RATE_PARENT
,
2359 static const struct reg_sequence g12a_mpll3_init_regs
[] = {
2360 { .reg
= HHI_MPLL_CNTL8
, .def
= 0x40000033 },
2363 static struct clk_regmap g12a_mpll3_div
= {
2364 .data
= &(struct meson_clk_mpll_data
){
2366 .reg_off
= HHI_MPLL_CNTL7
,
2371 .reg_off
= HHI_MPLL_CNTL7
,
2376 .reg_off
= HHI_MPLL_CNTL7
,
2381 .reg_off
= HHI_MPLL_CNTL7
,
2385 .init_regs
= g12a_mpll3_init_regs
,
2386 .init_count
= ARRAY_SIZE(g12a_mpll3_init_regs
),
2388 .hw
.init
= &(struct clk_init_data
){
2389 .name
= "mpll3_div",
2390 .ops
= &meson_clk_mpll_ops
,
2391 .parent_hws
= (const struct clk_hw
*[]) {
2392 &g12a_mpll_prediv
.hw
2398 static struct clk_regmap g12a_mpll3
= {
2399 .data
= &(struct clk_regmap_gate_data
){
2400 .offset
= HHI_MPLL_CNTL7
,
2403 .hw
.init
= &(struct clk_init_data
){
2405 .ops
= &clk_regmap_gate_ops
,
2406 .parent_hws
= (const struct clk_hw
*[]) { &g12a_mpll3_div
.hw
},
2408 .flags
= CLK_SET_RATE_PARENT
,
2412 static u32 mux_table_clk81
[] = { 0, 2, 3, 4, 5, 6, 7 };
2413 static const struct clk_parent_data clk81_parent_data
[] = {
2414 { .fw_name
= "xtal", },
2415 { .hw
= &g12a_fclk_div7
.hw
},
2416 { .hw
= &g12a_mpll1
.hw
},
2417 { .hw
= &g12a_mpll2
.hw
},
2418 { .hw
= &g12a_fclk_div4
.hw
},
2419 { .hw
= &g12a_fclk_div3
.hw
},
2420 { .hw
= &g12a_fclk_div5
.hw
},
2423 static struct clk_regmap g12a_mpeg_clk_sel
= {
2424 .data
= &(struct clk_regmap_mux_data
){
2425 .offset
= HHI_MPEG_CLK_CNTL
,
2428 .table
= mux_table_clk81
,
2430 .hw
.init
= &(struct clk_init_data
){
2431 .name
= "mpeg_clk_sel",
2432 .ops
= &clk_regmap_mux_ro_ops
,
2433 .parent_data
= clk81_parent_data
,
2434 .num_parents
= ARRAY_SIZE(clk81_parent_data
),
2438 static struct clk_regmap g12a_mpeg_clk_div
= {
2439 .data
= &(struct clk_regmap_div_data
){
2440 .offset
= HHI_MPEG_CLK_CNTL
,
2444 .hw
.init
= &(struct clk_init_data
){
2445 .name
= "mpeg_clk_div",
2446 .ops
= &clk_regmap_divider_ops
,
2447 .parent_hws
= (const struct clk_hw
*[]) {
2448 &g12a_mpeg_clk_sel
.hw
2451 .flags
= CLK_SET_RATE_PARENT
,
2455 static struct clk_regmap g12a_clk81
= {
2456 .data
= &(struct clk_regmap_gate_data
){
2457 .offset
= HHI_MPEG_CLK_CNTL
,
2460 .hw
.init
= &(struct clk_init_data
){
2462 .ops
= &clk_regmap_gate_ops
,
2463 .parent_hws
= (const struct clk_hw
*[]) {
2464 &g12a_mpeg_clk_div
.hw
2467 .flags
= (CLK_SET_RATE_PARENT
| CLK_IS_CRITICAL
),
2471 static const struct clk_parent_data g12a_sd_emmc_clk0_parent_data
[] = {
2472 { .fw_name
= "xtal", },
2473 { .hw
= &g12a_fclk_div2
.hw
},
2474 { .hw
= &g12a_fclk_div3
.hw
},
2475 { .hw
= &g12a_fclk_div5
.hw
},
2476 { .hw
= &g12a_fclk_div7
.hw
},
2478 * Following these parent clocks, we should also have had mpll2, mpll3
2479 * and gp0_pll but these clocks are too precious to be used here. All
2480 * the necessary rates for MMC and NAND operation can be acheived using
2481 * g12a_ee_core or fclk_div clocks
2486 static struct clk_regmap g12a_sd_emmc_a_clk0_sel
= {
2487 .data
= &(struct clk_regmap_mux_data
){
2488 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2492 .hw
.init
= &(struct clk_init_data
) {
2493 .name
= "sd_emmc_a_clk0_sel",
2494 .ops
= &clk_regmap_mux_ops
,
2495 .parent_data
= g12a_sd_emmc_clk0_parent_data
,
2496 .num_parents
= ARRAY_SIZE(g12a_sd_emmc_clk0_parent_data
),
2497 .flags
= CLK_SET_RATE_PARENT
,
2501 static struct clk_regmap g12a_sd_emmc_a_clk0_div
= {
2502 .data
= &(struct clk_regmap_div_data
){
2503 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2507 .hw
.init
= &(struct clk_init_data
) {
2508 .name
= "sd_emmc_a_clk0_div",
2509 .ops
= &clk_regmap_divider_ops
,
2510 .parent_hws
= (const struct clk_hw
*[]) {
2511 &g12a_sd_emmc_a_clk0_sel
.hw
2514 .flags
= CLK_SET_RATE_PARENT
,
2518 static struct clk_regmap g12a_sd_emmc_a_clk0
= {
2519 .data
= &(struct clk_regmap_gate_data
){
2520 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2523 .hw
.init
= &(struct clk_init_data
){
2524 .name
= "sd_emmc_a_clk0",
2525 .ops
= &clk_regmap_gate_ops
,
2526 .parent_hws
= (const struct clk_hw
*[]) {
2527 &g12a_sd_emmc_a_clk0_div
.hw
2530 .flags
= CLK_SET_RATE_PARENT
,
2535 static struct clk_regmap g12a_sd_emmc_b_clk0_sel
= {
2536 .data
= &(struct clk_regmap_mux_data
){
2537 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2541 .hw
.init
= &(struct clk_init_data
) {
2542 .name
= "sd_emmc_b_clk0_sel",
2543 .ops
= &clk_regmap_mux_ops
,
2544 .parent_data
= g12a_sd_emmc_clk0_parent_data
,
2545 .num_parents
= ARRAY_SIZE(g12a_sd_emmc_clk0_parent_data
),
2546 .flags
= CLK_SET_RATE_PARENT
,
2550 static struct clk_regmap g12a_sd_emmc_b_clk0_div
= {
2551 .data
= &(struct clk_regmap_div_data
){
2552 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2556 .hw
.init
= &(struct clk_init_data
) {
2557 .name
= "sd_emmc_b_clk0_div",
2558 .ops
= &clk_regmap_divider_ops
,
2559 .parent_hws
= (const struct clk_hw
*[]) {
2560 &g12a_sd_emmc_b_clk0_sel
.hw
2563 .flags
= CLK_SET_RATE_PARENT
,
2567 static struct clk_regmap g12a_sd_emmc_b_clk0
= {
2568 .data
= &(struct clk_regmap_gate_data
){
2569 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2572 .hw
.init
= &(struct clk_init_data
){
2573 .name
= "sd_emmc_b_clk0",
2574 .ops
= &clk_regmap_gate_ops
,
2575 .parent_hws
= (const struct clk_hw
*[]) {
2576 &g12a_sd_emmc_b_clk0_div
.hw
2579 .flags
= CLK_SET_RATE_PARENT
,
2583 /* EMMC/NAND clock */
2584 static struct clk_regmap g12a_sd_emmc_c_clk0_sel
= {
2585 .data
= &(struct clk_regmap_mux_data
){
2586 .offset
= HHI_NAND_CLK_CNTL
,
2590 .hw
.init
= &(struct clk_init_data
) {
2591 .name
= "sd_emmc_c_clk0_sel",
2592 .ops
= &clk_regmap_mux_ops
,
2593 .parent_data
= g12a_sd_emmc_clk0_parent_data
,
2594 .num_parents
= ARRAY_SIZE(g12a_sd_emmc_clk0_parent_data
),
2595 .flags
= CLK_SET_RATE_PARENT
,
2599 static struct clk_regmap g12a_sd_emmc_c_clk0_div
= {
2600 .data
= &(struct clk_regmap_div_data
){
2601 .offset
= HHI_NAND_CLK_CNTL
,
2605 .hw
.init
= &(struct clk_init_data
) {
2606 .name
= "sd_emmc_c_clk0_div",
2607 .ops
= &clk_regmap_divider_ops
,
2608 .parent_hws
= (const struct clk_hw
*[]) {
2609 &g12a_sd_emmc_c_clk0_sel
.hw
2612 .flags
= CLK_SET_RATE_PARENT
,
2616 static struct clk_regmap g12a_sd_emmc_c_clk0
= {
2617 .data
= &(struct clk_regmap_gate_data
){
2618 .offset
= HHI_NAND_CLK_CNTL
,
2621 .hw
.init
= &(struct clk_init_data
){
2622 .name
= "sd_emmc_c_clk0",
2623 .ops
= &clk_regmap_gate_ops
,
2624 .parent_hws
= (const struct clk_hw
*[]) {
2625 &g12a_sd_emmc_c_clk0_div
.hw
2628 .flags
= CLK_SET_RATE_PARENT
,
2634 static struct clk_regmap g12a_vid_pll_div
= {
2635 .data
= &(struct meson_vid_pll_div_data
){
2637 .reg_off
= HHI_VID_PLL_CLK_DIV
,
2642 .reg_off
= HHI_VID_PLL_CLK_DIV
,
2647 .hw
.init
= &(struct clk_init_data
) {
2648 .name
= "vid_pll_div",
2649 .ops
= &meson_vid_pll_div_ro_ops
,
2650 .parent_hws
= (const struct clk_hw
*[]) { &g12a_hdmi_pll
.hw
},
2652 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
2656 static const struct clk_hw
*g12a_vid_pll_parent_hws
[] = {
2657 &g12a_vid_pll_div
.hw
,
2661 static struct clk_regmap g12a_vid_pll_sel
= {
2662 .data
= &(struct clk_regmap_mux_data
){
2663 .offset
= HHI_VID_PLL_CLK_DIV
,
2667 .hw
.init
= &(struct clk_init_data
){
2668 .name
= "vid_pll_sel",
2669 .ops
= &clk_regmap_mux_ops
,
2671 * bit 18 selects from 2 possible parents:
2672 * vid_pll_div or hdmi_pll
2674 .parent_hws
= g12a_vid_pll_parent_hws
,
2675 .num_parents
= ARRAY_SIZE(g12a_vid_pll_parent_hws
),
2676 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2680 static struct clk_regmap g12a_vid_pll
= {
2681 .data
= &(struct clk_regmap_gate_data
){
2682 .offset
= HHI_VID_PLL_CLK_DIV
,
2685 .hw
.init
= &(struct clk_init_data
) {
2687 .ops
= &clk_regmap_gate_ops
,
2688 .parent_hws
= (const struct clk_hw
*[]) {
2689 &g12a_vid_pll_sel
.hw
2692 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2698 static const struct clk_hw
*g12a_vpu_parent_hws
[] = {
2709 static struct clk_regmap g12a_vpu_0_sel
= {
2710 .data
= &(struct clk_regmap_mux_data
){
2711 .offset
= HHI_VPU_CLK_CNTL
,
2715 .hw
.init
= &(struct clk_init_data
){
2716 .name
= "vpu_0_sel",
2717 .ops
= &clk_regmap_mux_ops
,
2718 .parent_hws
= g12a_vpu_parent_hws
,
2719 .num_parents
= ARRAY_SIZE(g12a_vpu_parent_hws
),
2720 .flags
= CLK_SET_RATE_NO_REPARENT
,
2724 static struct clk_regmap g12a_vpu_0_div
= {
2725 .data
= &(struct clk_regmap_div_data
){
2726 .offset
= HHI_VPU_CLK_CNTL
,
2730 .hw
.init
= &(struct clk_init_data
){
2731 .name
= "vpu_0_div",
2732 .ops
= &clk_regmap_divider_ops
,
2733 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vpu_0_sel
.hw
},
2735 .flags
= CLK_SET_RATE_PARENT
,
2739 static struct clk_regmap g12a_vpu_0
= {
2740 .data
= &(struct clk_regmap_gate_data
){
2741 .offset
= HHI_VPU_CLK_CNTL
,
2744 .hw
.init
= &(struct clk_init_data
) {
2746 .ops
= &clk_regmap_gate_ops
,
2747 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vpu_0_div
.hw
},
2749 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2753 static struct clk_regmap g12a_vpu_1_sel
= {
2754 .data
= &(struct clk_regmap_mux_data
){
2755 .offset
= HHI_VPU_CLK_CNTL
,
2759 .hw
.init
= &(struct clk_init_data
){
2760 .name
= "vpu_1_sel",
2761 .ops
= &clk_regmap_mux_ops
,
2762 .parent_hws
= g12a_vpu_parent_hws
,
2763 .num_parents
= ARRAY_SIZE(g12a_vpu_parent_hws
),
2764 .flags
= CLK_SET_RATE_NO_REPARENT
,
2768 static struct clk_regmap g12a_vpu_1_div
= {
2769 .data
= &(struct clk_regmap_div_data
){
2770 .offset
= HHI_VPU_CLK_CNTL
,
2774 .hw
.init
= &(struct clk_init_data
){
2775 .name
= "vpu_1_div",
2776 .ops
= &clk_regmap_divider_ops
,
2777 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vpu_1_sel
.hw
},
2779 .flags
= CLK_SET_RATE_PARENT
,
2783 static struct clk_regmap g12a_vpu_1
= {
2784 .data
= &(struct clk_regmap_gate_data
){
2785 .offset
= HHI_VPU_CLK_CNTL
,
2788 .hw
.init
= &(struct clk_init_data
) {
2790 .ops
= &clk_regmap_gate_ops
,
2791 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vpu_1_div
.hw
},
2793 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2797 static struct clk_regmap g12a_vpu
= {
2798 .data
= &(struct clk_regmap_mux_data
){
2799 .offset
= HHI_VPU_CLK_CNTL
,
2803 .hw
.init
= &(struct clk_init_data
){
2805 .ops
= &clk_regmap_mux_ops
,
2807 * bit 31 selects from 2 possible parents:
2810 .parent_hws
= (const struct clk_hw
*[]) {
2815 .flags
= CLK_SET_RATE_NO_REPARENT
,
2821 static const struct clk_hw
*g12a_vdec_parent_hws
[] = {
2822 &g12a_fclk_div2p5
.hw
,
2831 static struct clk_regmap g12a_vdec_1_sel
= {
2832 .data
= &(struct clk_regmap_mux_data
){
2833 .offset
= HHI_VDEC_CLK_CNTL
,
2836 .flags
= CLK_MUX_ROUND_CLOSEST
,
2838 .hw
.init
= &(struct clk_init_data
){
2839 .name
= "vdec_1_sel",
2840 .ops
= &clk_regmap_mux_ops
,
2841 .parent_hws
= g12a_vdec_parent_hws
,
2842 .num_parents
= ARRAY_SIZE(g12a_vdec_parent_hws
),
2843 .flags
= CLK_SET_RATE_PARENT
,
2847 static struct clk_regmap g12a_vdec_1_div
= {
2848 .data
= &(struct clk_regmap_div_data
){
2849 .offset
= HHI_VDEC_CLK_CNTL
,
2852 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2854 .hw
.init
= &(struct clk_init_data
){
2855 .name
= "vdec_1_div",
2856 .ops
= &clk_regmap_divider_ops
,
2857 .parent_hws
= (const struct clk_hw
*[]) {
2861 .flags
= CLK_SET_RATE_PARENT
,
2865 static struct clk_regmap g12a_vdec_1
= {
2866 .data
= &(struct clk_regmap_gate_data
){
2867 .offset
= HHI_VDEC_CLK_CNTL
,
2870 .hw
.init
= &(struct clk_init_data
) {
2872 .ops
= &clk_regmap_gate_ops
,
2873 .parent_hws
= (const struct clk_hw
*[]) {
2877 .flags
= CLK_SET_RATE_PARENT
,
2881 static struct clk_regmap g12a_vdec_hevcf_sel
= {
2882 .data
= &(struct clk_regmap_mux_data
){
2883 .offset
= HHI_VDEC2_CLK_CNTL
,
2886 .flags
= CLK_MUX_ROUND_CLOSEST
,
2888 .hw
.init
= &(struct clk_init_data
){
2889 .name
= "vdec_hevcf_sel",
2890 .ops
= &clk_regmap_mux_ops
,
2891 .parent_hws
= g12a_vdec_parent_hws
,
2892 .num_parents
= ARRAY_SIZE(g12a_vdec_parent_hws
),
2893 .flags
= CLK_SET_RATE_PARENT
,
2897 static struct clk_regmap g12a_vdec_hevcf_div
= {
2898 .data
= &(struct clk_regmap_div_data
){
2899 .offset
= HHI_VDEC2_CLK_CNTL
,
2902 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2904 .hw
.init
= &(struct clk_init_data
){
2905 .name
= "vdec_hevcf_div",
2906 .ops
= &clk_regmap_divider_ops
,
2907 .parent_hws
= (const struct clk_hw
*[]) {
2908 &g12a_vdec_hevcf_sel
.hw
2911 .flags
= CLK_SET_RATE_PARENT
,
2915 static struct clk_regmap g12a_vdec_hevcf
= {
2916 .data
= &(struct clk_regmap_gate_data
){
2917 .offset
= HHI_VDEC2_CLK_CNTL
,
2920 .hw
.init
= &(struct clk_init_data
) {
2921 .name
= "vdec_hevcf",
2922 .ops
= &clk_regmap_gate_ops
,
2923 .parent_hws
= (const struct clk_hw
*[]) {
2924 &g12a_vdec_hevcf_div
.hw
2927 .flags
= CLK_SET_RATE_PARENT
,
2931 static struct clk_regmap g12a_vdec_hevc_sel
= {
2932 .data
= &(struct clk_regmap_mux_data
){
2933 .offset
= HHI_VDEC2_CLK_CNTL
,
2936 .flags
= CLK_MUX_ROUND_CLOSEST
,
2938 .hw
.init
= &(struct clk_init_data
){
2939 .name
= "vdec_hevc_sel",
2940 .ops
= &clk_regmap_mux_ops
,
2941 .parent_hws
= g12a_vdec_parent_hws
,
2942 .num_parents
= ARRAY_SIZE(g12a_vdec_parent_hws
),
2943 .flags
= CLK_SET_RATE_PARENT
,
2947 static struct clk_regmap g12a_vdec_hevc_div
= {
2948 .data
= &(struct clk_regmap_div_data
){
2949 .offset
= HHI_VDEC2_CLK_CNTL
,
2952 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2954 .hw
.init
= &(struct clk_init_data
){
2955 .name
= "vdec_hevc_div",
2956 .ops
= &clk_regmap_divider_ops
,
2957 .parent_hws
= (const struct clk_hw
*[]) {
2958 &g12a_vdec_hevc_sel
.hw
2961 .flags
= CLK_SET_RATE_PARENT
,
2965 static struct clk_regmap g12a_vdec_hevc
= {
2966 .data
= &(struct clk_regmap_gate_data
){
2967 .offset
= HHI_VDEC2_CLK_CNTL
,
2970 .hw
.init
= &(struct clk_init_data
) {
2971 .name
= "vdec_hevc",
2972 .ops
= &clk_regmap_gate_ops
,
2973 .parent_hws
= (const struct clk_hw
*[]) {
2974 &g12a_vdec_hevc_div
.hw
2977 .flags
= CLK_SET_RATE_PARENT
,
2983 static const struct clk_hw
*g12a_vapb_parent_hws
[] = {
2991 &g12a_fclk_div2p5
.hw
,
2994 static struct clk_regmap g12a_vapb_0_sel
= {
2995 .data
= &(struct clk_regmap_mux_data
){
2996 .offset
= HHI_VAPBCLK_CNTL
,
3000 .hw
.init
= &(struct clk_init_data
){
3001 .name
= "vapb_0_sel",
3002 .ops
= &clk_regmap_mux_ops
,
3003 .parent_hws
= g12a_vapb_parent_hws
,
3004 .num_parents
= ARRAY_SIZE(g12a_vapb_parent_hws
),
3005 .flags
= CLK_SET_RATE_NO_REPARENT
,
3009 static struct clk_regmap g12a_vapb_0_div
= {
3010 .data
= &(struct clk_regmap_div_data
){
3011 .offset
= HHI_VAPBCLK_CNTL
,
3015 .hw
.init
= &(struct clk_init_data
){
3016 .name
= "vapb_0_div",
3017 .ops
= &clk_regmap_divider_ops
,
3018 .parent_hws
= (const struct clk_hw
*[]) {
3022 .flags
= CLK_SET_RATE_PARENT
,
3026 static struct clk_regmap g12a_vapb_0
= {
3027 .data
= &(struct clk_regmap_gate_data
){
3028 .offset
= HHI_VAPBCLK_CNTL
,
3031 .hw
.init
= &(struct clk_init_data
) {
3033 .ops
= &clk_regmap_gate_ops
,
3034 .parent_hws
= (const struct clk_hw
*[]) {
3038 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3042 static struct clk_regmap g12a_vapb_1_sel
= {
3043 .data
= &(struct clk_regmap_mux_data
){
3044 .offset
= HHI_VAPBCLK_CNTL
,
3048 .hw
.init
= &(struct clk_init_data
){
3049 .name
= "vapb_1_sel",
3050 .ops
= &clk_regmap_mux_ops
,
3051 .parent_hws
= g12a_vapb_parent_hws
,
3052 .num_parents
= ARRAY_SIZE(g12a_vapb_parent_hws
),
3053 .flags
= CLK_SET_RATE_NO_REPARENT
,
3057 static struct clk_regmap g12a_vapb_1_div
= {
3058 .data
= &(struct clk_regmap_div_data
){
3059 .offset
= HHI_VAPBCLK_CNTL
,
3063 .hw
.init
= &(struct clk_init_data
){
3064 .name
= "vapb_1_div",
3065 .ops
= &clk_regmap_divider_ops
,
3066 .parent_hws
= (const struct clk_hw
*[]) {
3070 .flags
= CLK_SET_RATE_PARENT
,
3074 static struct clk_regmap g12a_vapb_1
= {
3075 .data
= &(struct clk_regmap_gate_data
){
3076 .offset
= HHI_VAPBCLK_CNTL
,
3079 .hw
.init
= &(struct clk_init_data
) {
3081 .ops
= &clk_regmap_gate_ops
,
3082 .parent_hws
= (const struct clk_hw
*[]) {
3086 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3090 static struct clk_regmap g12a_vapb_sel
= {
3091 .data
= &(struct clk_regmap_mux_data
){
3092 .offset
= HHI_VAPBCLK_CNTL
,
3096 .hw
.init
= &(struct clk_init_data
){
3098 .ops
= &clk_regmap_mux_ops
,
3100 * bit 31 selects from 2 possible parents:
3103 .parent_hws
= (const struct clk_hw
*[]) {
3108 .flags
= CLK_SET_RATE_NO_REPARENT
,
3112 static struct clk_regmap g12a_vapb
= {
3113 .data
= &(struct clk_regmap_gate_data
){
3114 .offset
= HHI_VAPBCLK_CNTL
,
3117 .hw
.init
= &(struct clk_init_data
) {
3119 .ops
= &clk_regmap_gate_ops
,
3120 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vapb_sel
.hw
},
3122 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3126 static const struct clk_hw
*g12a_vclk_parent_hws
[] = {
3137 static struct clk_regmap g12a_vclk_sel
= {
3138 .data
= &(struct clk_regmap_mux_data
){
3139 .offset
= HHI_VID_CLK_CNTL
,
3143 .hw
.init
= &(struct clk_init_data
){
3145 .ops
= &clk_regmap_mux_ops
,
3146 .parent_hws
= g12a_vclk_parent_hws
,
3147 .num_parents
= ARRAY_SIZE(g12a_vclk_parent_hws
),
3148 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3152 static struct clk_regmap g12a_vclk2_sel
= {
3153 .data
= &(struct clk_regmap_mux_data
){
3154 .offset
= HHI_VIID_CLK_CNTL
,
3158 .hw
.init
= &(struct clk_init_data
){
3159 .name
= "vclk2_sel",
3160 .ops
= &clk_regmap_mux_ops
,
3161 .parent_hws
= g12a_vclk_parent_hws
,
3162 .num_parents
= ARRAY_SIZE(g12a_vclk_parent_hws
),
3163 .flags
= CLK_SET_RATE_NO_REPARENT
,
3167 static struct clk_regmap g12a_vclk_input
= {
3168 .data
= &(struct clk_regmap_gate_data
){
3169 .offset
= HHI_VID_CLK_DIV
,
3172 .hw
.init
= &(struct clk_init_data
) {
3173 .name
= "vclk_input",
3174 .ops
= &clk_regmap_gate_ops
,
3175 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk_sel
.hw
},
3177 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3181 static struct clk_regmap g12a_vclk2_input
= {
3182 .data
= &(struct clk_regmap_gate_data
){
3183 .offset
= HHI_VIID_CLK_DIV
,
3186 .hw
.init
= &(struct clk_init_data
) {
3187 .name
= "vclk2_input",
3188 .ops
= &clk_regmap_gate_ops
,
3189 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2_sel
.hw
},
3194 static struct clk_regmap g12a_vclk_div
= {
3195 .data
= &(struct clk_regmap_div_data
){
3196 .offset
= HHI_VID_CLK_DIV
,
3200 .hw
.init
= &(struct clk_init_data
){
3202 .ops
= &clk_regmap_divider_ops
,
3203 .parent_hws
= (const struct clk_hw
*[]) {
3207 .flags
= CLK_GET_RATE_NOCACHE
,
3211 static struct clk_regmap g12a_vclk2_div
= {
3212 .data
= &(struct meson_vclk_div_data
){
3214 .reg_off
= HHI_VIID_CLK_DIV
,
3219 .reg_off
= HHI_VIID_CLK_DIV
,
3224 .reg_off
= HHI_VIID_CLK_DIV
,
3228 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
3230 .hw
.init
= &(struct clk_init_data
){
3231 .name
= "vclk2_div",
3232 .ops
= &meson_vclk_div_ops
,
3233 .parent_hws
= (const struct clk_hw
*[]) {
3234 &g12a_vclk2_input
.hw
3237 .flags
= CLK_SET_RATE_GATE
,
3241 static struct clk_regmap g12a_vclk
= {
3242 .data
= &(struct clk_regmap_gate_data
){
3243 .offset
= HHI_VID_CLK_CNTL
,
3246 .hw
.init
= &(struct clk_init_data
) {
3248 .ops
= &clk_regmap_gate_ops
,
3249 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk_div
.hw
},
3251 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3255 static struct clk_regmap g12a_vclk2
= {
3256 .data
= &(struct meson_vclk_gate_data
){
3258 .reg_off
= HHI_VIID_CLK_CNTL
,
3263 .reg_off
= HHI_VIID_CLK_CNTL
,
3268 .hw
.init
= &(struct clk_init_data
) {
3270 .ops
= &meson_vclk_gate_ops
,
3271 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2_div
.hw
},
3273 .flags
= CLK_SET_RATE_PARENT
,
3277 static struct clk_regmap g12a_vclk_div1
= {
3278 .data
= &(struct clk_regmap_gate_data
){
3279 .offset
= HHI_VID_CLK_CNTL
,
3282 .hw
.init
= &(struct clk_init_data
) {
3283 .name
= "vclk_div1",
3284 .ops
= &clk_regmap_gate_ops
,
3285 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3287 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3291 static struct clk_regmap g12a_vclk_div2_en
= {
3292 .data
= &(struct clk_regmap_gate_data
){
3293 .offset
= HHI_VID_CLK_CNTL
,
3296 .hw
.init
= &(struct clk_init_data
) {
3297 .name
= "vclk_div2_en",
3298 .ops
= &clk_regmap_gate_ops
,
3299 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3301 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3305 static struct clk_regmap g12a_vclk_div4_en
= {
3306 .data
= &(struct clk_regmap_gate_data
){
3307 .offset
= HHI_VID_CLK_CNTL
,
3310 .hw
.init
= &(struct clk_init_data
) {
3311 .name
= "vclk_div4_en",
3312 .ops
= &clk_regmap_gate_ops
,
3313 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3315 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3319 static struct clk_regmap g12a_vclk_div6_en
= {
3320 .data
= &(struct clk_regmap_gate_data
){
3321 .offset
= HHI_VID_CLK_CNTL
,
3324 .hw
.init
= &(struct clk_init_data
) {
3325 .name
= "vclk_div6_en",
3326 .ops
= &clk_regmap_gate_ops
,
3327 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3329 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3333 static struct clk_regmap g12a_vclk_div12_en
= {
3334 .data
= &(struct clk_regmap_gate_data
){
3335 .offset
= HHI_VID_CLK_CNTL
,
3338 .hw
.init
= &(struct clk_init_data
) {
3339 .name
= "vclk_div12_en",
3340 .ops
= &clk_regmap_gate_ops
,
3341 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3343 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3347 static struct clk_regmap g12a_vclk2_div1
= {
3348 .data
= &(struct clk_regmap_gate_data
){
3349 .offset
= HHI_VIID_CLK_CNTL
,
3352 .hw
.init
= &(struct clk_init_data
) {
3353 .name
= "vclk2_div1",
3354 .ops
= &clk_regmap_gate_ops
,
3355 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3357 .flags
= CLK_SET_RATE_PARENT
,
3361 static struct clk_regmap g12a_vclk2_div2_en
= {
3362 .data
= &(struct clk_regmap_gate_data
){
3363 .offset
= HHI_VIID_CLK_CNTL
,
3366 .hw
.init
= &(struct clk_init_data
) {
3367 .name
= "vclk2_div2_en",
3368 .ops
= &clk_regmap_gate_ops
,
3369 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3371 .flags
= CLK_SET_RATE_PARENT
,
3375 static struct clk_regmap g12a_vclk2_div4_en
= {
3376 .data
= &(struct clk_regmap_gate_data
){
3377 .offset
= HHI_VIID_CLK_CNTL
,
3380 .hw
.init
= &(struct clk_init_data
) {
3381 .name
= "vclk2_div4_en",
3382 .ops
= &clk_regmap_gate_ops
,
3383 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3385 .flags
= CLK_SET_RATE_PARENT
,
3389 static struct clk_regmap g12a_vclk2_div6_en
= {
3390 .data
= &(struct clk_regmap_gate_data
){
3391 .offset
= HHI_VIID_CLK_CNTL
,
3394 .hw
.init
= &(struct clk_init_data
) {
3395 .name
= "vclk2_div6_en",
3396 .ops
= &clk_regmap_gate_ops
,
3397 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3399 .flags
= CLK_SET_RATE_PARENT
,
3403 static struct clk_regmap g12a_vclk2_div12_en
= {
3404 .data
= &(struct clk_regmap_gate_data
){
3405 .offset
= HHI_VIID_CLK_CNTL
,
3408 .hw
.init
= &(struct clk_init_data
) {
3409 .name
= "vclk2_div12_en",
3410 .ops
= &clk_regmap_gate_ops
,
3411 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3413 .flags
= CLK_SET_RATE_PARENT
,
3417 static struct clk_fixed_factor g12a_vclk_div2
= {
3420 .hw
.init
= &(struct clk_init_data
){
3421 .name
= "vclk_div2",
3422 .ops
= &clk_fixed_factor_ops
,
3423 .parent_hws
= (const struct clk_hw
*[]) {
3424 &g12a_vclk_div2_en
.hw
3430 static struct clk_fixed_factor g12a_vclk_div4
= {
3433 .hw
.init
= &(struct clk_init_data
){
3434 .name
= "vclk_div4",
3435 .ops
= &clk_fixed_factor_ops
,
3436 .parent_hws
= (const struct clk_hw
*[]) {
3437 &g12a_vclk_div4_en
.hw
3443 static struct clk_fixed_factor g12a_vclk_div6
= {
3446 .hw
.init
= &(struct clk_init_data
){
3447 .name
= "vclk_div6",
3448 .ops
= &clk_fixed_factor_ops
,
3449 .parent_hws
= (const struct clk_hw
*[]) {
3450 &g12a_vclk_div6_en
.hw
3456 static struct clk_fixed_factor g12a_vclk_div12
= {
3459 .hw
.init
= &(struct clk_init_data
){
3460 .name
= "vclk_div12",
3461 .ops
= &clk_fixed_factor_ops
,
3462 .parent_hws
= (const struct clk_hw
*[]) {
3463 &g12a_vclk_div12_en
.hw
3469 static struct clk_fixed_factor g12a_vclk2_div2
= {
3472 .hw
.init
= &(struct clk_init_data
){
3473 .name
= "vclk2_div2",
3474 .ops
= &clk_fixed_factor_ops
,
3475 .parent_hws
= (const struct clk_hw
*[]) {
3476 &g12a_vclk2_div2_en
.hw
3479 .flags
= CLK_SET_RATE_PARENT
,
3483 static struct clk_fixed_factor g12a_vclk2_div4
= {
3486 .hw
.init
= &(struct clk_init_data
){
3487 .name
= "vclk2_div4",
3488 .ops
= &clk_fixed_factor_ops
,
3489 .parent_hws
= (const struct clk_hw
*[]) {
3490 &g12a_vclk2_div4_en
.hw
3493 .flags
= CLK_SET_RATE_PARENT
,
3497 static struct clk_fixed_factor g12a_vclk2_div6
= {
3500 .hw
.init
= &(struct clk_init_data
){
3501 .name
= "vclk2_div6",
3502 .ops
= &clk_fixed_factor_ops
,
3503 .parent_hws
= (const struct clk_hw
*[]) {
3504 &g12a_vclk2_div6_en
.hw
3507 .flags
= CLK_SET_RATE_PARENT
,
3511 static struct clk_fixed_factor g12a_vclk2_div12
= {
3514 .hw
.init
= &(struct clk_init_data
){
3515 .name
= "vclk2_div12",
3516 .ops
= &clk_fixed_factor_ops
,
3517 .parent_hws
= (const struct clk_hw
*[]) {
3518 &g12a_vclk2_div12_en
.hw
3521 .flags
= CLK_SET_RATE_PARENT
,
3525 static u32 mux_table_cts_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
3526 static const struct clk_hw
*g12a_cts_parent_hws
[] = {
3531 &g12a_vclk_div12
.hw
,
3532 &g12a_vclk2_div1
.hw
,
3533 &g12a_vclk2_div2
.hw
,
3534 &g12a_vclk2_div4
.hw
,
3535 &g12a_vclk2_div6
.hw
,
3536 &g12a_vclk2_div12
.hw
,
3539 static struct clk_regmap g12a_cts_enci_sel
= {
3540 .data
= &(struct clk_regmap_mux_data
){
3541 .offset
= HHI_VID_CLK_DIV
,
3544 .table
= mux_table_cts_sel
,
3546 .hw
.init
= &(struct clk_init_data
){
3547 .name
= "cts_enci_sel",
3548 .ops
= &clk_regmap_mux_ops
,
3549 .parent_hws
= g12a_cts_parent_hws
,
3550 .num_parents
= ARRAY_SIZE(g12a_cts_parent_hws
),
3551 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3555 static struct clk_regmap g12a_cts_encp_sel
= {
3556 .data
= &(struct clk_regmap_mux_data
){
3557 .offset
= HHI_VID_CLK_DIV
,
3560 .table
= mux_table_cts_sel
,
3562 .hw
.init
= &(struct clk_init_data
){
3563 .name
= "cts_encp_sel",
3564 .ops
= &clk_regmap_mux_ops
,
3565 .parent_hws
= g12a_cts_parent_hws
,
3566 .num_parents
= ARRAY_SIZE(g12a_cts_parent_hws
),
3567 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3571 static struct clk_regmap g12a_cts_encl_sel
= {
3572 .data
= &(struct clk_regmap_mux_data
){
3573 .offset
= HHI_VIID_CLK_DIV
,
3576 .table
= mux_table_cts_sel
,
3578 .hw
.init
= &(struct clk_init_data
){
3579 .name
= "cts_encl_sel",
3580 .ops
= &clk_regmap_mux_ops
,
3581 .parent_hws
= g12a_cts_parent_hws
,
3582 .num_parents
= ARRAY_SIZE(g12a_cts_parent_hws
),
3583 .flags
= CLK_SET_RATE_PARENT
| CLK_SET_RATE_NO_REPARENT
,
3587 static struct clk_regmap g12a_cts_vdac_sel
= {
3588 .data
= &(struct clk_regmap_mux_data
){
3589 .offset
= HHI_VIID_CLK_DIV
,
3592 .table
= mux_table_cts_sel
,
3594 .hw
.init
= &(struct clk_init_data
){
3595 .name
= "cts_vdac_sel",
3596 .ops
= &clk_regmap_mux_ops
,
3597 .parent_hws
= g12a_cts_parent_hws
,
3598 .num_parents
= ARRAY_SIZE(g12a_cts_parent_hws
),
3599 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3603 /* TOFIX: add support for cts_tcon */
3604 static u32 mux_table_hdmi_tx_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
3605 static const struct clk_hw
*g12a_cts_hdmi_tx_parent_hws
[] = {
3610 &g12a_vclk_div12
.hw
,
3611 &g12a_vclk2_div1
.hw
,
3612 &g12a_vclk2_div2
.hw
,
3613 &g12a_vclk2_div4
.hw
,
3614 &g12a_vclk2_div6
.hw
,
3615 &g12a_vclk2_div12
.hw
,
3618 static struct clk_regmap g12a_hdmi_tx_sel
= {
3619 .data
= &(struct clk_regmap_mux_data
){
3620 .offset
= HHI_HDMI_CLK_CNTL
,
3623 .table
= mux_table_hdmi_tx_sel
,
3625 .hw
.init
= &(struct clk_init_data
){
3626 .name
= "hdmi_tx_sel",
3627 .ops
= &clk_regmap_mux_ops
,
3628 .parent_hws
= g12a_cts_hdmi_tx_parent_hws
,
3629 .num_parents
= ARRAY_SIZE(g12a_cts_hdmi_tx_parent_hws
),
3630 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3634 static struct clk_regmap g12a_cts_enci
= {
3635 .data
= &(struct clk_regmap_gate_data
){
3636 .offset
= HHI_VID_CLK_CNTL2
,
3639 .hw
.init
= &(struct clk_init_data
) {
3641 .ops
= &clk_regmap_gate_ops
,
3642 .parent_hws
= (const struct clk_hw
*[]) {
3643 &g12a_cts_enci_sel
.hw
3646 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3650 static struct clk_regmap g12a_cts_encp
= {
3651 .data
= &(struct clk_regmap_gate_data
){
3652 .offset
= HHI_VID_CLK_CNTL2
,
3655 .hw
.init
= &(struct clk_init_data
) {
3657 .ops
= &clk_regmap_gate_ops
,
3658 .parent_hws
= (const struct clk_hw
*[]) {
3659 &g12a_cts_encp_sel
.hw
3662 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3666 static struct clk_regmap g12a_cts_encl
= {
3667 .data
= &(struct clk_regmap_gate_data
){
3668 .offset
= HHI_VID_CLK_CNTL2
,
3671 .hw
.init
= &(struct clk_init_data
) {
3673 .ops
= &clk_regmap_gate_ops
,
3674 .parent_hws
= (const struct clk_hw
*[]) {
3675 &g12a_cts_encl_sel
.hw
3678 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3682 static struct clk_regmap g12a_cts_vdac
= {
3683 .data
= &(struct clk_regmap_gate_data
){
3684 .offset
= HHI_VID_CLK_CNTL2
,
3687 .hw
.init
= &(struct clk_init_data
) {
3689 .ops
= &clk_regmap_gate_ops
,
3690 .parent_hws
= (const struct clk_hw
*[]) {
3691 &g12a_cts_vdac_sel
.hw
3694 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3698 static struct clk_regmap g12a_hdmi_tx
= {
3699 .data
= &(struct clk_regmap_gate_data
){
3700 .offset
= HHI_VID_CLK_CNTL2
,
3703 .hw
.init
= &(struct clk_init_data
) {
3705 .ops
= &clk_regmap_gate_ops
,
3706 .parent_hws
= (const struct clk_hw
*[]) {
3707 &g12a_hdmi_tx_sel
.hw
3710 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3714 /* MIPI DSI Host Clocks */
3716 static const struct clk_hw
*g12a_mipi_dsi_pxclk_parent_hws
[] = {
3722 &g12a_fclk_div2p5
.hw
,
3727 static struct clk_regmap g12a_mipi_dsi_pxclk_sel
= {
3728 .data
= &(struct clk_regmap_mux_data
){
3729 .offset
= HHI_MIPIDSI_PHY_CLK_CNTL
,
3732 .flags
= CLK_MUX_ROUND_CLOSEST
,
3734 .hw
.init
= &(struct clk_init_data
){
3735 .name
= "mipi_dsi_pxclk_sel",
3736 .ops
= &clk_regmap_mux_ops
,
3737 .parent_hws
= g12a_mipi_dsi_pxclk_parent_hws
,
3738 .num_parents
= ARRAY_SIZE(g12a_mipi_dsi_pxclk_parent_hws
),
3739 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_SET_RATE_PARENT
,
3744 * FIXME: Force as bypass by forcing a single /1 table entry, and doensn't on boot value
3745 * when setting a clock whith this node in the clock path, but doesn't garantee the divider
3746 * is at /1 at boot until a rate is set.
3748 static const struct clk_div_table g12a_mipi_dsi_pxclk_div_table
[] = {
3749 { .val
= 0, .div
= 1 },
3753 static struct clk_regmap g12a_mipi_dsi_pxclk_div
= {
3754 .data
= &(struct clk_regmap_div_data
){
3755 .offset
= HHI_MIPIDSI_PHY_CLK_CNTL
,
3758 .table
= g12a_mipi_dsi_pxclk_div_table
,
3760 .hw
.init
= &(struct clk_init_data
){
3761 .name
= "mipi_dsi_pxclk_div",
3762 .ops
= &clk_regmap_divider_ops
,
3763 .parent_hws
= (const struct clk_hw
*[]) {
3764 &g12a_mipi_dsi_pxclk_sel
.hw
3767 .flags
= CLK_SET_RATE_PARENT
,
3771 static struct clk_regmap g12a_mipi_dsi_pxclk
= {
3772 .data
= &(struct clk_regmap_gate_data
){
3773 .offset
= HHI_MIPIDSI_PHY_CLK_CNTL
,
3776 .hw
.init
= &(struct clk_init_data
) {
3777 .name
= "mipi_dsi_pxclk",
3778 .ops
= &clk_regmap_gate_ops
,
3779 .parent_hws
= (const struct clk_hw
*[]) {
3780 &g12a_mipi_dsi_pxclk_div
.hw
3783 .flags
= CLK_SET_RATE_PARENT
,
3787 /* MIPI ISP Clocks */
3789 static const struct clk_parent_data g12b_mipi_isp_parent_data
[] = {
3790 { .fw_name
= "xtal", },
3791 { .hw
= &g12a_gp0_pll
.hw
},
3792 { .hw
= &g12a_hifi_pll
.hw
},
3793 { .hw
= &g12a_fclk_div2p5
.hw
},
3794 { .hw
= &g12a_fclk_div3
.hw
},
3795 { .hw
= &g12a_fclk_div4
.hw
},
3796 { .hw
= &g12a_fclk_div5
.hw
},
3797 { .hw
= &g12a_fclk_div7
.hw
},
3800 static struct clk_regmap g12b_mipi_isp_sel
= {
3801 .data
= &(struct clk_regmap_mux_data
){
3802 .offset
= HHI_ISP_CLK_CNTL
,
3806 .hw
.init
= &(struct clk_init_data
){
3807 .name
= "mipi_isp_sel",
3808 .ops
= &clk_regmap_mux_ops
,
3809 .parent_data
= g12b_mipi_isp_parent_data
,
3810 .num_parents
= ARRAY_SIZE(g12b_mipi_isp_parent_data
),
3814 static struct clk_regmap g12b_mipi_isp_div
= {
3815 .data
= &(struct clk_regmap_div_data
){
3816 .offset
= HHI_ISP_CLK_CNTL
,
3820 .hw
.init
= &(struct clk_init_data
){
3821 .name
= "mipi_isp_div",
3822 .ops
= &clk_regmap_divider_ops
,
3823 .parent_hws
= (const struct clk_hw
*[]) {
3824 &g12b_mipi_isp_sel
.hw
3827 .flags
= CLK_SET_RATE_PARENT
,
3831 static struct clk_regmap g12b_mipi_isp
= {
3832 .data
= &(struct clk_regmap_gate_data
){
3833 .offset
= HHI_ISP_CLK_CNTL
,
3836 .hw
.init
= &(struct clk_init_data
) {
3838 .ops
= &clk_regmap_gate_ops
,
3839 .parent_hws
= (const struct clk_hw
*[]) {
3840 &g12b_mipi_isp_div
.hw
3843 .flags
= CLK_SET_RATE_PARENT
,
3849 static const struct clk_parent_data g12a_hdmi_parent_data
[] = {
3850 { .fw_name
= "xtal", },
3851 { .hw
= &g12a_fclk_div4
.hw
},
3852 { .hw
= &g12a_fclk_div3
.hw
},
3853 { .hw
= &g12a_fclk_div5
.hw
},
3856 static struct clk_regmap g12a_hdmi_sel
= {
3857 .data
= &(struct clk_regmap_mux_data
){
3858 .offset
= HHI_HDMI_CLK_CNTL
,
3861 .flags
= CLK_MUX_ROUND_CLOSEST
,
3863 .hw
.init
= &(struct clk_init_data
){
3865 .ops
= &clk_regmap_mux_ops
,
3866 .parent_data
= g12a_hdmi_parent_data
,
3867 .num_parents
= ARRAY_SIZE(g12a_hdmi_parent_data
),
3868 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3872 static struct clk_regmap g12a_hdmi_div
= {
3873 .data
= &(struct clk_regmap_div_data
){
3874 .offset
= HHI_HDMI_CLK_CNTL
,
3878 .hw
.init
= &(struct clk_init_data
){
3880 .ops
= &clk_regmap_divider_ops
,
3881 .parent_hws
= (const struct clk_hw
*[]) { &g12a_hdmi_sel
.hw
},
3883 .flags
= CLK_GET_RATE_NOCACHE
,
3887 static struct clk_regmap g12a_hdmi
= {
3888 .data
= &(struct clk_regmap_gate_data
){
3889 .offset
= HHI_HDMI_CLK_CNTL
,
3892 .hw
.init
= &(struct clk_init_data
) {
3894 .ops
= &clk_regmap_gate_ops
,
3895 .parent_hws
= (const struct clk_hw
*[]) { &g12a_hdmi_div
.hw
},
3897 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3902 * The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
3903 * muxed by a glitch-free switch. The CCF can manage this glitch-free
3904 * mux because it does top-to-bottom updates the each clock tree and
3905 * switches to the "inactive" one when CLK_SET_RATE_GATE is set.
3907 static const struct clk_parent_data g12a_mali_0_1_parent_data
[] = {
3908 { .fw_name
= "xtal", },
3909 { .hw
= &g12a_gp0_pll
.hw
},
3910 { .hw
= &g12a_hifi_pll
.hw
},
3911 { .hw
= &g12a_fclk_div2p5
.hw
},
3912 { .hw
= &g12a_fclk_div3
.hw
},
3913 { .hw
= &g12a_fclk_div4
.hw
},
3914 { .hw
= &g12a_fclk_div5
.hw
},
3915 { .hw
= &g12a_fclk_div7
.hw
},
3918 static struct clk_regmap g12a_mali_0_sel
= {
3919 .data
= &(struct clk_regmap_mux_data
){
3920 .offset
= HHI_MALI_CLK_CNTL
,
3924 .hw
.init
= &(struct clk_init_data
){
3925 .name
= "mali_0_sel",
3926 .ops
= &clk_regmap_mux_ops
,
3927 .parent_data
= g12a_mali_0_1_parent_data
,
3930 * Don't request the parent to change the rate because
3931 * all GPU frequencies can be derived from the fclk_*
3932 * clocks and one special GP0_PLL setting. This is
3933 * important because we need the MPLL clocks for audio.
3939 static struct clk_regmap g12a_mali_0_div
= {
3940 .data
= &(struct clk_regmap_div_data
){
3941 .offset
= HHI_MALI_CLK_CNTL
,
3945 .hw
.init
= &(struct clk_init_data
){
3946 .name
= "mali_0_div",
3947 .ops
= &clk_regmap_divider_ops
,
3948 .parent_hws
= (const struct clk_hw
*[]) {
3952 .flags
= CLK_SET_RATE_PARENT
,
3956 static struct clk_regmap g12a_mali_0
= {
3957 .data
= &(struct clk_regmap_gate_data
){
3958 .offset
= HHI_MALI_CLK_CNTL
,
3961 .hw
.init
= &(struct clk_init_data
){
3963 .ops
= &clk_regmap_gate_ops
,
3964 .parent_hws
= (const struct clk_hw
*[]) {
3968 .flags
= CLK_SET_RATE_GATE
| CLK_SET_RATE_PARENT
,
3972 static struct clk_regmap g12a_mali_1_sel
= {
3973 .data
= &(struct clk_regmap_mux_data
){
3974 .offset
= HHI_MALI_CLK_CNTL
,
3978 .hw
.init
= &(struct clk_init_data
){
3979 .name
= "mali_1_sel",
3980 .ops
= &clk_regmap_mux_ops
,
3981 .parent_data
= g12a_mali_0_1_parent_data
,
3984 * Don't request the parent to change the rate because
3985 * all GPU frequencies can be derived from the fclk_*
3986 * clocks and one special GP0_PLL setting. This is
3987 * important because we need the MPLL clocks for audio.
3993 static struct clk_regmap g12a_mali_1_div
= {
3994 .data
= &(struct clk_regmap_div_data
){
3995 .offset
= HHI_MALI_CLK_CNTL
,
3999 .hw
.init
= &(struct clk_init_data
){
4000 .name
= "mali_1_div",
4001 .ops
= &clk_regmap_divider_ops
,
4002 .parent_hws
= (const struct clk_hw
*[]) {
4006 .flags
= CLK_SET_RATE_PARENT
,
4010 static struct clk_regmap g12a_mali_1
= {
4011 .data
= &(struct clk_regmap_gate_data
){
4012 .offset
= HHI_MALI_CLK_CNTL
,
4015 .hw
.init
= &(struct clk_init_data
){
4017 .ops
= &clk_regmap_gate_ops
,
4018 .parent_hws
= (const struct clk_hw
*[]) {
4022 .flags
= CLK_SET_RATE_GATE
| CLK_SET_RATE_PARENT
,
4026 static const struct clk_hw
*g12a_mali_parent_hws
[] = {
4031 static struct clk_regmap g12a_mali
= {
4032 .data
= &(struct clk_regmap_mux_data
){
4033 .offset
= HHI_MALI_CLK_CNTL
,
4037 .hw
.init
= &(struct clk_init_data
){
4039 .ops
= &clk_regmap_mux_ops
,
4040 .parent_hws
= g12a_mali_parent_hws
,
4042 .flags
= CLK_SET_RATE_PARENT
,
4046 static struct clk_regmap g12a_ts_div
= {
4047 .data
= &(struct clk_regmap_div_data
){
4048 .offset
= HHI_TS_CLK_CNTL
,
4052 .hw
.init
= &(struct clk_init_data
){
4054 .ops
= &clk_regmap_divider_ro_ops
,
4055 .parent_data
= &(const struct clk_parent_data
) {
4062 static struct clk_regmap g12a_ts
= {
4063 .data
= &(struct clk_regmap_gate_data
){
4064 .offset
= HHI_TS_CLK_CNTL
,
4067 .hw
.init
= &(struct clk_init_data
){
4069 .ops
= &clk_regmap_gate_ops
,
4070 .parent_hws
= (const struct clk_hw
*[]) {
4077 /* SPICC SCLK source clock */
4079 static const struct clk_parent_data spicc_sclk_parent_data
[] = {
4080 { .fw_name
= "xtal", },
4081 { .hw
= &g12a_clk81
.hw
},
4082 { .hw
= &g12a_fclk_div4
.hw
},
4083 { .hw
= &g12a_fclk_div3
.hw
},
4084 { .hw
= &g12a_fclk_div5
.hw
},
4085 { .hw
= &g12a_fclk_div7
.hw
},
4088 static struct clk_regmap g12a_spicc0_sclk_sel
= {
4089 .data
= &(struct clk_regmap_mux_data
){
4090 .offset
= HHI_SPICC_CLK_CNTL
,
4094 .hw
.init
= &(struct clk_init_data
){
4095 .name
= "spicc0_sclk_sel",
4096 .ops
= &clk_regmap_mux_ops
,
4097 .parent_data
= spicc_sclk_parent_data
,
4098 .num_parents
= ARRAY_SIZE(spicc_sclk_parent_data
),
4102 static struct clk_regmap g12a_spicc0_sclk_div
= {
4103 .data
= &(struct clk_regmap_div_data
){
4104 .offset
= HHI_SPICC_CLK_CNTL
,
4108 .hw
.init
= &(struct clk_init_data
){
4109 .name
= "spicc0_sclk_div",
4110 .ops
= &clk_regmap_divider_ops
,
4111 .parent_hws
= (const struct clk_hw
*[]) {
4112 &g12a_spicc0_sclk_sel
.hw
4115 .flags
= CLK_SET_RATE_PARENT
,
4119 static struct clk_regmap g12a_spicc0_sclk
= {
4120 .data
= &(struct clk_regmap_gate_data
){
4121 .offset
= HHI_SPICC_CLK_CNTL
,
4124 .hw
.init
= &(struct clk_init_data
){
4125 .name
= "spicc0_sclk",
4126 .ops
= &clk_regmap_gate_ops
,
4127 .parent_hws
= (const struct clk_hw
*[]) {
4128 &g12a_spicc0_sclk_div
.hw
4131 .flags
= CLK_SET_RATE_PARENT
,
4135 static struct clk_regmap g12a_spicc1_sclk_sel
= {
4136 .data
= &(struct clk_regmap_mux_data
){
4137 .offset
= HHI_SPICC_CLK_CNTL
,
4141 .hw
.init
= &(struct clk_init_data
){
4142 .name
= "spicc1_sclk_sel",
4143 .ops
= &clk_regmap_mux_ops
,
4144 .parent_data
= spicc_sclk_parent_data
,
4145 .num_parents
= ARRAY_SIZE(spicc_sclk_parent_data
),
4149 static struct clk_regmap g12a_spicc1_sclk_div
= {
4150 .data
= &(struct clk_regmap_div_data
){
4151 .offset
= HHI_SPICC_CLK_CNTL
,
4155 .hw
.init
= &(struct clk_init_data
){
4156 .name
= "spicc1_sclk_div",
4157 .ops
= &clk_regmap_divider_ops
,
4158 .parent_hws
= (const struct clk_hw
*[]) {
4159 &g12a_spicc1_sclk_sel
.hw
4162 .flags
= CLK_SET_RATE_PARENT
,
4166 static struct clk_regmap g12a_spicc1_sclk
= {
4167 .data
= &(struct clk_regmap_gate_data
){
4168 .offset
= HHI_SPICC_CLK_CNTL
,
4171 .hw
.init
= &(struct clk_init_data
){
4172 .name
= "spicc1_sclk",
4173 .ops
= &clk_regmap_gate_ops
,
4174 .parent_hws
= (const struct clk_hw
*[]) {
4175 &g12a_spicc1_sclk_div
.hw
4178 .flags
= CLK_SET_RATE_PARENT
,
4182 /* Neural Network Accelerator source clock */
4184 static const struct clk_parent_data nna_clk_parent_data
[] = {
4185 { .fw_name
= "xtal", },
4186 { .hw
= &g12a_gp0_pll
.hw
, },
4187 { .hw
= &g12a_hifi_pll
.hw
, },
4188 { .hw
= &g12a_fclk_div2p5
.hw
, },
4189 { .hw
= &g12a_fclk_div3
.hw
, },
4190 { .hw
= &g12a_fclk_div4
.hw
, },
4191 { .hw
= &g12a_fclk_div5
.hw
, },
4192 { .hw
= &g12a_fclk_div7
.hw
},
4195 static struct clk_regmap sm1_nna_axi_clk_sel
= {
4196 .data
= &(struct clk_regmap_mux_data
){
4197 .offset
= HHI_NNA_CLK_CNTL
,
4201 .hw
.init
= &(struct clk_init_data
){
4202 .name
= "nna_axi_clk_sel",
4203 .ops
= &clk_regmap_mux_ops
,
4204 .parent_data
= nna_clk_parent_data
,
4205 .num_parents
= ARRAY_SIZE(nna_clk_parent_data
),
4209 static struct clk_regmap sm1_nna_axi_clk_div
= {
4210 .data
= &(struct clk_regmap_div_data
){
4211 .offset
= HHI_NNA_CLK_CNTL
,
4215 .hw
.init
= &(struct clk_init_data
){
4216 .name
= "nna_axi_clk_div",
4217 .ops
= &clk_regmap_divider_ops
,
4218 .parent_hws
= (const struct clk_hw
*[]) {
4219 &sm1_nna_axi_clk_sel
.hw
4222 .flags
= CLK_SET_RATE_PARENT
,
4226 static struct clk_regmap sm1_nna_axi_clk
= {
4227 .data
= &(struct clk_regmap_gate_data
){
4228 .offset
= HHI_NNA_CLK_CNTL
,
4231 .hw
.init
= &(struct clk_init_data
){
4232 .name
= "nna_axi_clk",
4233 .ops
= &clk_regmap_gate_ops
,
4234 .parent_hws
= (const struct clk_hw
*[]) {
4235 &sm1_nna_axi_clk_div
.hw
4238 .flags
= CLK_SET_RATE_PARENT
,
4242 static struct clk_regmap sm1_nna_core_clk_sel
= {
4243 .data
= &(struct clk_regmap_mux_data
){
4244 .offset
= HHI_NNA_CLK_CNTL
,
4248 .hw
.init
= &(struct clk_init_data
){
4249 .name
= "nna_core_clk_sel",
4250 .ops
= &clk_regmap_mux_ops
,
4251 .parent_data
= nna_clk_parent_data
,
4252 .num_parents
= ARRAY_SIZE(nna_clk_parent_data
),
4256 static struct clk_regmap sm1_nna_core_clk_div
= {
4257 .data
= &(struct clk_regmap_div_data
){
4258 .offset
= HHI_NNA_CLK_CNTL
,
4262 .hw
.init
= &(struct clk_init_data
){
4263 .name
= "nna_core_clk_div",
4264 .ops
= &clk_regmap_divider_ops
,
4265 .parent_hws
= (const struct clk_hw
*[]) {
4266 &sm1_nna_core_clk_sel
.hw
4269 .flags
= CLK_SET_RATE_PARENT
,
4273 static struct clk_regmap sm1_nna_core_clk
= {
4274 .data
= &(struct clk_regmap_gate_data
){
4275 .offset
= HHI_NNA_CLK_CNTL
,
4278 .hw
.init
= &(struct clk_init_data
){
4279 .name
= "nna_core_clk",
4280 .ops
= &clk_regmap_gate_ops
,
4281 .parent_hws
= (const struct clk_hw
*[]) {
4282 &sm1_nna_core_clk_div
.hw
4285 .flags
= CLK_SET_RATE_PARENT
,
4289 #define MESON_GATE(_name, _reg, _bit) \
4290 MESON_PCLK(_name, _reg, _bit, &g12a_clk81.hw)
4292 #define MESON_GATE_RO(_name, _reg, _bit) \
4293 MESON_PCLK_RO(_name, _reg, _bit, &g12a_clk81.hw)
4295 /* Everything Else (EE) domain gates */
4296 static MESON_GATE(g12a_ddr
, HHI_GCLK_MPEG0
, 0);
4297 static MESON_GATE(g12a_dos
, HHI_GCLK_MPEG0
, 1);
4298 static MESON_GATE(g12a_audio_locker
, HHI_GCLK_MPEG0
, 2);
4299 static MESON_GATE(g12a_mipi_dsi_host
, HHI_GCLK_MPEG0
, 3);
4300 static MESON_GATE(g12a_eth_phy
, HHI_GCLK_MPEG0
, 4);
4301 static MESON_GATE(g12a_isa
, HHI_GCLK_MPEG0
, 5);
4302 static MESON_GATE(g12a_pl301
, HHI_GCLK_MPEG0
, 6);
4303 static MESON_GATE(g12a_periphs
, HHI_GCLK_MPEG0
, 7);
4304 static MESON_GATE(g12a_spicc_0
, HHI_GCLK_MPEG0
, 8);
4305 static MESON_GATE(g12a_i2c
, HHI_GCLK_MPEG0
, 9);
4306 static MESON_GATE(g12a_sana
, HHI_GCLK_MPEG0
, 10);
4307 static MESON_GATE(g12a_sd
, HHI_GCLK_MPEG0
, 11);
4308 static MESON_GATE(g12a_rng0
, HHI_GCLK_MPEG0
, 12);
4309 static MESON_GATE(g12a_uart0
, HHI_GCLK_MPEG0
, 13);
4310 static MESON_GATE(g12a_spicc_1
, HHI_GCLK_MPEG0
, 14);
4311 static MESON_GATE(g12a_hiu_reg
, HHI_GCLK_MPEG0
, 19);
4312 static MESON_GATE(g12a_mipi_dsi_phy
, HHI_GCLK_MPEG0
, 20);
4313 static MESON_GATE(g12a_assist_misc
, HHI_GCLK_MPEG0
, 23);
4314 static MESON_GATE(g12a_emmc_a
, HHI_GCLK_MPEG0
, 4);
4315 static MESON_GATE(g12a_emmc_b
, HHI_GCLK_MPEG0
, 25);
4316 static MESON_GATE(g12a_emmc_c
, HHI_GCLK_MPEG0
, 26);
4317 static MESON_GATE(g12a_audio_codec
, HHI_GCLK_MPEG0
, 28);
4319 static MESON_GATE(g12a_audio
, HHI_GCLK_MPEG1
, 0);
4320 static MESON_GATE(g12a_eth_core
, HHI_GCLK_MPEG1
, 3);
4321 static MESON_GATE(g12a_demux
, HHI_GCLK_MPEG1
, 4);
4322 static MESON_GATE(g12a_audio_ififo
, HHI_GCLK_MPEG1
, 11);
4323 static MESON_GATE(g12a_adc
, HHI_GCLK_MPEG1
, 13);
4324 static MESON_GATE(g12a_uart1
, HHI_GCLK_MPEG1
, 16);
4325 static MESON_GATE(g12a_g2d
, HHI_GCLK_MPEG1
, 20);
4326 static MESON_GATE(g12a_reset
, HHI_GCLK_MPEG1
, 23);
4327 static MESON_GATE(g12a_pcie_comb
, HHI_GCLK_MPEG1
, 24);
4328 static MESON_GATE(g12a_parser
, HHI_GCLK_MPEG1
, 25);
4329 static MESON_GATE(g12a_usb_general
, HHI_GCLK_MPEG1
, 26);
4330 static MESON_GATE(g12a_pcie_phy
, HHI_GCLK_MPEG1
, 27);
4331 static MESON_GATE(g12a_ahb_arb0
, HHI_GCLK_MPEG1
, 29);
4333 static MESON_GATE(g12a_ahb_data_bus
, HHI_GCLK_MPEG2
, 1);
4334 static MESON_GATE(g12a_ahb_ctrl_bus
, HHI_GCLK_MPEG2
, 2);
4335 static MESON_GATE(g12a_htx_hdcp22
, HHI_GCLK_MPEG2
, 3);
4336 static MESON_GATE(g12a_htx_pclk
, HHI_GCLK_MPEG2
, 4);
4337 static MESON_GATE(g12a_bt656
, HHI_GCLK_MPEG2
, 6);
4338 static MESON_GATE(g12a_usb1_to_ddr
, HHI_GCLK_MPEG2
, 8);
4339 static MESON_GATE(g12b_mipi_isp_gate
, HHI_GCLK_MPEG2
, 17);
4340 static MESON_GATE(g12a_mmc_pclk
, HHI_GCLK_MPEG2
, 11);
4341 static MESON_GATE(g12a_uart2
, HHI_GCLK_MPEG2
, 15);
4342 static MESON_GATE(g12a_vpu_intr
, HHI_GCLK_MPEG2
, 25);
4343 static MESON_GATE(g12b_csi_phy1
, HHI_GCLK_MPEG2
, 28);
4344 static MESON_GATE(g12b_csi_phy0
, HHI_GCLK_MPEG2
, 29);
4345 static MESON_GATE(g12a_gic
, HHI_GCLK_MPEG2
, 30);
4347 static MESON_GATE(g12a_vclk2_venci0
, HHI_GCLK_OTHER
, 1);
4348 static MESON_GATE(g12a_vclk2_venci1
, HHI_GCLK_OTHER
, 2);
4349 static MESON_GATE(g12a_vclk2_vencp0
, HHI_GCLK_OTHER
, 3);
4350 static MESON_GATE(g12a_vclk2_vencp1
, HHI_GCLK_OTHER
, 4);
4351 static MESON_GATE(g12a_vclk2_venct0
, HHI_GCLK_OTHER
, 5);
4352 static MESON_GATE(g12a_vclk2_venct1
, HHI_GCLK_OTHER
, 6);
4353 static MESON_GATE(g12a_vclk2_other
, HHI_GCLK_OTHER
, 7);
4354 static MESON_GATE(g12a_vclk2_enci
, HHI_GCLK_OTHER
, 8);
4355 static MESON_GATE(g12a_vclk2_encp
, HHI_GCLK_OTHER
, 9);
4356 static MESON_GATE(g12a_dac_clk
, HHI_GCLK_OTHER
, 10);
4357 static MESON_GATE(g12a_aoclk_gate
, HHI_GCLK_OTHER
, 14);
4358 static MESON_GATE(g12a_iec958_gate
, HHI_GCLK_OTHER
, 16);
4359 static MESON_GATE(g12a_enc480p
, HHI_GCLK_OTHER
, 20);
4360 static MESON_GATE(g12a_rng1
, HHI_GCLK_OTHER
, 21);
4361 static MESON_GATE(g12a_vclk2_enct
, HHI_GCLK_OTHER
, 22);
4362 static MESON_GATE(g12a_vclk2_encl
, HHI_GCLK_OTHER
, 23);
4363 static MESON_GATE(g12a_vclk2_venclmmc
, HHI_GCLK_OTHER
, 24);
4364 static MESON_GATE(g12a_vclk2_vencl
, HHI_GCLK_OTHER
, 25);
4365 static MESON_GATE(g12a_vclk2_other1
, HHI_GCLK_OTHER
, 26);
4367 static MESON_GATE_RO(g12a_dma
, HHI_GCLK_OTHER2
, 0);
4368 static MESON_GATE_RO(g12a_efuse
, HHI_GCLK_OTHER2
, 1);
4369 static MESON_GATE_RO(g12a_rom_boot
, HHI_GCLK_OTHER2
, 2);
4370 static MESON_GATE_RO(g12a_reset_sec
, HHI_GCLK_OTHER2
, 3);
4371 static MESON_GATE_RO(g12a_sec_ahb_apb3
, HHI_GCLK_OTHER2
, 4);
4373 /* Array of all clocks provided by this provider */
4374 static struct clk_hw
*g12a_hw_clks
[] = {
4375 [CLKID_SYS_PLL
] = &g12a_sys_pll
.hw
,
4376 [CLKID_FIXED_PLL
] = &g12a_fixed_pll
.hw
,
4377 [CLKID_FCLK_DIV2
] = &g12a_fclk_div2
.hw
,
4378 [CLKID_FCLK_DIV3
] = &g12a_fclk_div3
.hw
,
4379 [CLKID_FCLK_DIV4
] = &g12a_fclk_div4
.hw
,
4380 [CLKID_FCLK_DIV5
] = &g12a_fclk_div5
.hw
,
4381 [CLKID_FCLK_DIV7
] = &g12a_fclk_div7
.hw
,
4382 [CLKID_FCLK_DIV2P5
] = &g12a_fclk_div2p5
.hw
,
4383 [CLKID_GP0_PLL
] = &g12a_gp0_pll
.hw
,
4384 [CLKID_MPEG_SEL
] = &g12a_mpeg_clk_sel
.hw
,
4385 [CLKID_MPEG_DIV
] = &g12a_mpeg_clk_div
.hw
,
4386 [CLKID_CLK81
] = &g12a_clk81
.hw
,
4387 [CLKID_MPLL0
] = &g12a_mpll0
.hw
,
4388 [CLKID_MPLL1
] = &g12a_mpll1
.hw
,
4389 [CLKID_MPLL2
] = &g12a_mpll2
.hw
,
4390 [CLKID_MPLL3
] = &g12a_mpll3
.hw
,
4391 [CLKID_DDR
] = &g12a_ddr
.hw
,
4392 [CLKID_DOS
] = &g12a_dos
.hw
,
4393 [CLKID_AUDIO_LOCKER
] = &g12a_audio_locker
.hw
,
4394 [CLKID_MIPI_DSI_HOST
] = &g12a_mipi_dsi_host
.hw
,
4395 [CLKID_ETH_PHY
] = &g12a_eth_phy
.hw
,
4396 [CLKID_ISA
] = &g12a_isa
.hw
,
4397 [CLKID_PL301
] = &g12a_pl301
.hw
,
4398 [CLKID_PERIPHS
] = &g12a_periphs
.hw
,
4399 [CLKID_SPICC0
] = &g12a_spicc_0
.hw
,
4400 [CLKID_I2C
] = &g12a_i2c
.hw
,
4401 [CLKID_SANA
] = &g12a_sana
.hw
,
4402 [CLKID_SD
] = &g12a_sd
.hw
,
4403 [CLKID_RNG0
] = &g12a_rng0
.hw
,
4404 [CLKID_UART0
] = &g12a_uart0
.hw
,
4405 [CLKID_SPICC1
] = &g12a_spicc_1
.hw
,
4406 [CLKID_HIU_IFACE
] = &g12a_hiu_reg
.hw
,
4407 [CLKID_MIPI_DSI_PHY
] = &g12a_mipi_dsi_phy
.hw
,
4408 [CLKID_ASSIST_MISC
] = &g12a_assist_misc
.hw
,
4409 [CLKID_SD_EMMC_A
] = &g12a_emmc_a
.hw
,
4410 [CLKID_SD_EMMC_B
] = &g12a_emmc_b
.hw
,
4411 [CLKID_SD_EMMC_C
] = &g12a_emmc_c
.hw
,
4412 [CLKID_AUDIO_CODEC
] = &g12a_audio_codec
.hw
,
4413 [CLKID_AUDIO
] = &g12a_audio
.hw
,
4414 [CLKID_ETH
] = &g12a_eth_core
.hw
,
4415 [CLKID_DEMUX
] = &g12a_demux
.hw
,
4416 [CLKID_AUDIO_IFIFO
] = &g12a_audio_ififo
.hw
,
4417 [CLKID_ADC
] = &g12a_adc
.hw
,
4418 [CLKID_UART1
] = &g12a_uart1
.hw
,
4419 [CLKID_G2D
] = &g12a_g2d
.hw
,
4420 [CLKID_RESET
] = &g12a_reset
.hw
,
4421 [CLKID_PCIE_COMB
] = &g12a_pcie_comb
.hw
,
4422 [CLKID_PARSER
] = &g12a_parser
.hw
,
4423 [CLKID_USB
] = &g12a_usb_general
.hw
,
4424 [CLKID_PCIE_PHY
] = &g12a_pcie_phy
.hw
,
4425 [CLKID_AHB_ARB0
] = &g12a_ahb_arb0
.hw
,
4426 [CLKID_AHB_DATA_BUS
] = &g12a_ahb_data_bus
.hw
,
4427 [CLKID_AHB_CTRL_BUS
] = &g12a_ahb_ctrl_bus
.hw
,
4428 [CLKID_HTX_HDCP22
] = &g12a_htx_hdcp22
.hw
,
4429 [CLKID_HTX_PCLK
] = &g12a_htx_pclk
.hw
,
4430 [CLKID_BT656
] = &g12a_bt656
.hw
,
4431 [CLKID_USB1_DDR_BRIDGE
] = &g12a_usb1_to_ddr
.hw
,
4432 [CLKID_MMC_PCLK
] = &g12a_mmc_pclk
.hw
,
4433 [CLKID_UART2
] = &g12a_uart2
.hw
,
4434 [CLKID_VPU_INTR
] = &g12a_vpu_intr
.hw
,
4435 [CLKID_GIC
] = &g12a_gic
.hw
,
4436 [CLKID_SD_EMMC_A_CLK0_SEL
] = &g12a_sd_emmc_a_clk0_sel
.hw
,
4437 [CLKID_SD_EMMC_A_CLK0_DIV
] = &g12a_sd_emmc_a_clk0_div
.hw
,
4438 [CLKID_SD_EMMC_A_CLK0
] = &g12a_sd_emmc_a_clk0
.hw
,
4439 [CLKID_SD_EMMC_B_CLK0_SEL
] = &g12a_sd_emmc_b_clk0_sel
.hw
,
4440 [CLKID_SD_EMMC_B_CLK0_DIV
] = &g12a_sd_emmc_b_clk0_div
.hw
,
4441 [CLKID_SD_EMMC_B_CLK0
] = &g12a_sd_emmc_b_clk0
.hw
,
4442 [CLKID_SD_EMMC_C_CLK0_SEL
] = &g12a_sd_emmc_c_clk0_sel
.hw
,
4443 [CLKID_SD_EMMC_C_CLK0_DIV
] = &g12a_sd_emmc_c_clk0_div
.hw
,
4444 [CLKID_SD_EMMC_C_CLK0
] = &g12a_sd_emmc_c_clk0
.hw
,
4445 [CLKID_MPLL0_DIV
] = &g12a_mpll0_div
.hw
,
4446 [CLKID_MPLL1_DIV
] = &g12a_mpll1_div
.hw
,
4447 [CLKID_MPLL2_DIV
] = &g12a_mpll2_div
.hw
,
4448 [CLKID_MPLL3_DIV
] = &g12a_mpll3_div
.hw
,
4449 [CLKID_FCLK_DIV2_DIV
] = &g12a_fclk_div2_div
.hw
,
4450 [CLKID_FCLK_DIV3_DIV
] = &g12a_fclk_div3_div
.hw
,
4451 [CLKID_FCLK_DIV4_DIV
] = &g12a_fclk_div4_div
.hw
,
4452 [CLKID_FCLK_DIV5_DIV
] = &g12a_fclk_div5_div
.hw
,
4453 [CLKID_FCLK_DIV7_DIV
] = &g12a_fclk_div7_div
.hw
,
4454 [CLKID_FCLK_DIV2P5_DIV
] = &g12a_fclk_div2p5_div
.hw
,
4455 [CLKID_HIFI_PLL
] = &g12a_hifi_pll
.hw
,
4456 [CLKID_VCLK2_VENCI0
] = &g12a_vclk2_venci0
.hw
,
4457 [CLKID_VCLK2_VENCI1
] = &g12a_vclk2_venci1
.hw
,
4458 [CLKID_VCLK2_VENCP0
] = &g12a_vclk2_vencp0
.hw
,
4459 [CLKID_VCLK2_VENCP1
] = &g12a_vclk2_vencp1
.hw
,
4460 [CLKID_VCLK2_VENCT0
] = &g12a_vclk2_venct0
.hw
,
4461 [CLKID_VCLK2_VENCT1
] = &g12a_vclk2_venct1
.hw
,
4462 [CLKID_VCLK2_OTHER
] = &g12a_vclk2_other
.hw
,
4463 [CLKID_VCLK2_ENCI
] = &g12a_vclk2_enci
.hw
,
4464 [CLKID_VCLK2_ENCP
] = &g12a_vclk2_encp
.hw
,
4465 [CLKID_DAC_CLK
] = &g12a_dac_clk
.hw
,
4466 [CLKID_AOCLK
] = &g12a_aoclk_gate
.hw
,
4467 [CLKID_IEC958
] = &g12a_iec958_gate
.hw
,
4468 [CLKID_ENC480P
] = &g12a_enc480p
.hw
,
4469 [CLKID_RNG1
] = &g12a_rng1
.hw
,
4470 [CLKID_VCLK2_ENCT
] = &g12a_vclk2_enct
.hw
,
4471 [CLKID_VCLK2_ENCL
] = &g12a_vclk2_encl
.hw
,
4472 [CLKID_VCLK2_VENCLMMC
] = &g12a_vclk2_venclmmc
.hw
,
4473 [CLKID_VCLK2_VENCL
] = &g12a_vclk2_vencl
.hw
,
4474 [CLKID_VCLK2_OTHER1
] = &g12a_vclk2_other1
.hw
,
4475 [CLKID_FIXED_PLL_DCO
] = &g12a_fixed_pll_dco
.hw
,
4476 [CLKID_SYS_PLL_DCO
] = &g12a_sys_pll_dco
.hw
,
4477 [CLKID_GP0_PLL_DCO
] = &g12a_gp0_pll_dco
.hw
,
4478 [CLKID_HIFI_PLL_DCO
] = &g12a_hifi_pll_dco
.hw
,
4479 [CLKID_DMA
] = &g12a_dma
.hw
,
4480 [CLKID_EFUSE
] = &g12a_efuse
.hw
,
4481 [CLKID_ROM_BOOT
] = &g12a_rom_boot
.hw
,
4482 [CLKID_RESET_SEC
] = &g12a_reset_sec
.hw
,
4483 [CLKID_SEC_AHB_APB3
] = &g12a_sec_ahb_apb3
.hw
,
4484 [CLKID_MPLL_PREDIV
] = &g12a_mpll_prediv
.hw
,
4485 [CLKID_VPU_0_SEL
] = &g12a_vpu_0_sel
.hw
,
4486 [CLKID_VPU_0_DIV
] = &g12a_vpu_0_div
.hw
,
4487 [CLKID_VPU_0
] = &g12a_vpu_0
.hw
,
4488 [CLKID_VPU_1_SEL
] = &g12a_vpu_1_sel
.hw
,
4489 [CLKID_VPU_1_DIV
] = &g12a_vpu_1_div
.hw
,
4490 [CLKID_VPU_1
] = &g12a_vpu_1
.hw
,
4491 [CLKID_VPU
] = &g12a_vpu
.hw
,
4492 [CLKID_VAPB_0_SEL
] = &g12a_vapb_0_sel
.hw
,
4493 [CLKID_VAPB_0_DIV
] = &g12a_vapb_0_div
.hw
,
4494 [CLKID_VAPB_0
] = &g12a_vapb_0
.hw
,
4495 [CLKID_VAPB_1_SEL
] = &g12a_vapb_1_sel
.hw
,
4496 [CLKID_VAPB_1_DIV
] = &g12a_vapb_1_div
.hw
,
4497 [CLKID_VAPB_1
] = &g12a_vapb_1
.hw
,
4498 [CLKID_VAPB_SEL
] = &g12a_vapb_sel
.hw
,
4499 [CLKID_VAPB
] = &g12a_vapb
.hw
,
4500 [CLKID_HDMI_PLL_DCO
] = &g12a_hdmi_pll_dco
.hw
,
4501 [CLKID_HDMI_PLL_OD
] = &g12a_hdmi_pll_od
.hw
,
4502 [CLKID_HDMI_PLL_OD2
] = &g12a_hdmi_pll_od2
.hw
,
4503 [CLKID_HDMI_PLL
] = &g12a_hdmi_pll
.hw
,
4504 [CLKID_VID_PLL
] = &g12a_vid_pll_div
.hw
,
4505 [CLKID_VID_PLL_SEL
] = &g12a_vid_pll_sel
.hw
,
4506 [CLKID_VID_PLL_DIV
] = &g12a_vid_pll
.hw
,
4507 [CLKID_VCLK_SEL
] = &g12a_vclk_sel
.hw
,
4508 [CLKID_VCLK2_SEL
] = &g12a_vclk2_sel
.hw
,
4509 [CLKID_VCLK_INPUT
] = &g12a_vclk_input
.hw
,
4510 [CLKID_VCLK2_INPUT
] = &g12a_vclk2_input
.hw
,
4511 [CLKID_VCLK_DIV
] = &g12a_vclk_div
.hw
,
4512 [CLKID_VCLK2_DIV
] = &g12a_vclk2_div
.hw
,
4513 [CLKID_VCLK
] = &g12a_vclk
.hw
,
4514 [CLKID_VCLK2
] = &g12a_vclk2
.hw
,
4515 [CLKID_VCLK_DIV1
] = &g12a_vclk_div1
.hw
,
4516 [CLKID_VCLK_DIV2_EN
] = &g12a_vclk_div2_en
.hw
,
4517 [CLKID_VCLK_DIV4_EN
] = &g12a_vclk_div4_en
.hw
,
4518 [CLKID_VCLK_DIV6_EN
] = &g12a_vclk_div6_en
.hw
,
4519 [CLKID_VCLK_DIV12_EN
] = &g12a_vclk_div12_en
.hw
,
4520 [CLKID_VCLK2_DIV1
] = &g12a_vclk2_div1
.hw
,
4521 [CLKID_VCLK2_DIV2_EN
] = &g12a_vclk2_div2_en
.hw
,
4522 [CLKID_VCLK2_DIV4_EN
] = &g12a_vclk2_div4_en
.hw
,
4523 [CLKID_VCLK2_DIV6_EN
] = &g12a_vclk2_div6_en
.hw
,
4524 [CLKID_VCLK2_DIV12_EN
] = &g12a_vclk2_div12_en
.hw
,
4525 [CLKID_VCLK_DIV2
] = &g12a_vclk_div2
.hw
,
4526 [CLKID_VCLK_DIV4
] = &g12a_vclk_div4
.hw
,
4527 [CLKID_VCLK_DIV6
] = &g12a_vclk_div6
.hw
,
4528 [CLKID_VCLK_DIV12
] = &g12a_vclk_div12
.hw
,
4529 [CLKID_VCLK2_DIV2
] = &g12a_vclk2_div2
.hw
,
4530 [CLKID_VCLK2_DIV4
] = &g12a_vclk2_div4
.hw
,
4531 [CLKID_VCLK2_DIV6
] = &g12a_vclk2_div6
.hw
,
4532 [CLKID_VCLK2_DIV12
] = &g12a_vclk2_div12
.hw
,
4533 [CLKID_CTS_ENCI_SEL
] = &g12a_cts_enci_sel
.hw
,
4534 [CLKID_CTS_ENCP_SEL
] = &g12a_cts_encp_sel
.hw
,
4535 [CLKID_CTS_ENCL_SEL
] = &g12a_cts_encl_sel
.hw
,
4536 [CLKID_CTS_VDAC_SEL
] = &g12a_cts_vdac_sel
.hw
,
4537 [CLKID_HDMI_TX_SEL
] = &g12a_hdmi_tx_sel
.hw
,
4538 [CLKID_CTS_ENCI
] = &g12a_cts_enci
.hw
,
4539 [CLKID_CTS_ENCP
] = &g12a_cts_encp
.hw
,
4540 [CLKID_CTS_ENCL
] = &g12a_cts_encl
.hw
,
4541 [CLKID_CTS_VDAC
] = &g12a_cts_vdac
.hw
,
4542 [CLKID_HDMI_TX
] = &g12a_hdmi_tx
.hw
,
4543 [CLKID_HDMI_SEL
] = &g12a_hdmi_sel
.hw
,
4544 [CLKID_HDMI_DIV
] = &g12a_hdmi_div
.hw
,
4545 [CLKID_HDMI
] = &g12a_hdmi
.hw
,
4546 [CLKID_MALI_0_SEL
] = &g12a_mali_0_sel
.hw
,
4547 [CLKID_MALI_0_DIV
] = &g12a_mali_0_div
.hw
,
4548 [CLKID_MALI_0
] = &g12a_mali_0
.hw
,
4549 [CLKID_MALI_1_SEL
] = &g12a_mali_1_sel
.hw
,
4550 [CLKID_MALI_1_DIV
] = &g12a_mali_1_div
.hw
,
4551 [CLKID_MALI_1
] = &g12a_mali_1
.hw
,
4552 [CLKID_MALI
] = &g12a_mali
.hw
,
4553 [CLKID_MPLL_50M_DIV
] = &g12a_mpll_50m_div
.hw
,
4554 [CLKID_MPLL_50M
] = &g12a_mpll_50m
.hw
,
4555 [CLKID_SYS_PLL_DIV16_EN
] = &g12a_sys_pll_div16_en
.hw
,
4556 [CLKID_SYS_PLL_DIV16
] = &g12a_sys_pll_div16
.hw
,
4557 [CLKID_CPU_CLK_DYN0_SEL
] = &g12a_cpu_clk_premux0
.hw
,
4558 [CLKID_CPU_CLK_DYN0_DIV
] = &g12a_cpu_clk_mux0_div
.hw
,
4559 [CLKID_CPU_CLK_DYN0
] = &g12a_cpu_clk_postmux0
.hw
,
4560 [CLKID_CPU_CLK_DYN1_SEL
] = &g12a_cpu_clk_premux1
.hw
,
4561 [CLKID_CPU_CLK_DYN1_DIV
] = &g12a_cpu_clk_mux1_div
.hw
,
4562 [CLKID_CPU_CLK_DYN1
] = &g12a_cpu_clk_postmux1
.hw
,
4563 [CLKID_CPU_CLK_DYN
] = &g12a_cpu_clk_dyn
.hw
,
4564 [CLKID_CPU_CLK
] = &g12a_cpu_clk
.hw
,
4565 [CLKID_CPU_CLK_DIV16_EN
] = &g12a_cpu_clk_div16_en
.hw
,
4566 [CLKID_CPU_CLK_DIV16
] = &g12a_cpu_clk_div16
.hw
,
4567 [CLKID_CPU_CLK_APB_DIV
] = &g12a_cpu_clk_apb_div
.hw
,
4568 [CLKID_CPU_CLK_APB
] = &g12a_cpu_clk_apb
.hw
,
4569 [CLKID_CPU_CLK_ATB_DIV
] = &g12a_cpu_clk_atb_div
.hw
,
4570 [CLKID_CPU_CLK_ATB
] = &g12a_cpu_clk_atb
.hw
,
4571 [CLKID_CPU_CLK_AXI_DIV
] = &g12a_cpu_clk_axi_div
.hw
,
4572 [CLKID_CPU_CLK_AXI
] = &g12a_cpu_clk_axi
.hw
,
4573 [CLKID_CPU_CLK_TRACE_DIV
] = &g12a_cpu_clk_trace_div
.hw
,
4574 [CLKID_CPU_CLK_TRACE
] = &g12a_cpu_clk_trace
.hw
,
4575 [CLKID_PCIE_PLL_DCO
] = &g12a_pcie_pll_dco
.hw
,
4576 [CLKID_PCIE_PLL_DCO_DIV2
] = &g12a_pcie_pll_dco_div2
.hw
,
4577 [CLKID_PCIE_PLL_OD
] = &g12a_pcie_pll_od
.hw
,
4578 [CLKID_PCIE_PLL
] = &g12a_pcie_pll
.hw
,
4579 [CLKID_VDEC_1_SEL
] = &g12a_vdec_1_sel
.hw
,
4580 [CLKID_VDEC_1_DIV
] = &g12a_vdec_1_div
.hw
,
4581 [CLKID_VDEC_1
] = &g12a_vdec_1
.hw
,
4582 [CLKID_VDEC_HEVC_SEL
] = &g12a_vdec_hevc_sel
.hw
,
4583 [CLKID_VDEC_HEVC_DIV
] = &g12a_vdec_hevc_div
.hw
,
4584 [CLKID_VDEC_HEVC
] = &g12a_vdec_hevc
.hw
,
4585 [CLKID_VDEC_HEVCF_SEL
] = &g12a_vdec_hevcf_sel
.hw
,
4586 [CLKID_VDEC_HEVCF_DIV
] = &g12a_vdec_hevcf_div
.hw
,
4587 [CLKID_VDEC_HEVCF
] = &g12a_vdec_hevcf
.hw
,
4588 [CLKID_TS_DIV
] = &g12a_ts_div
.hw
,
4589 [CLKID_TS
] = &g12a_ts
.hw
,
4590 [CLKID_SPICC0_SCLK_SEL
] = &g12a_spicc0_sclk_sel
.hw
,
4591 [CLKID_SPICC0_SCLK_DIV
] = &g12a_spicc0_sclk_div
.hw
,
4592 [CLKID_SPICC0_SCLK
] = &g12a_spicc0_sclk
.hw
,
4593 [CLKID_SPICC1_SCLK_SEL
] = &g12a_spicc1_sclk_sel
.hw
,
4594 [CLKID_SPICC1_SCLK_DIV
] = &g12a_spicc1_sclk_div
.hw
,
4595 [CLKID_SPICC1_SCLK
] = &g12a_spicc1_sclk
.hw
,
4596 [CLKID_MIPI_DSI_PXCLK_SEL
] = &g12a_mipi_dsi_pxclk_sel
.hw
,
4597 [CLKID_MIPI_DSI_PXCLK_DIV
] = &g12a_mipi_dsi_pxclk_div
.hw
,
4598 [CLKID_MIPI_DSI_PXCLK
] = &g12a_mipi_dsi_pxclk
.hw
,
4601 static struct clk_hw
*g12b_hw_clks
[] = {
4602 [CLKID_SYS_PLL
] = &g12a_sys_pll
.hw
,
4603 [CLKID_FIXED_PLL
] = &g12a_fixed_pll
.hw
,
4604 [CLKID_FCLK_DIV2
] = &g12a_fclk_div2
.hw
,
4605 [CLKID_FCLK_DIV3
] = &g12a_fclk_div3
.hw
,
4606 [CLKID_FCLK_DIV4
] = &g12a_fclk_div4
.hw
,
4607 [CLKID_FCLK_DIV5
] = &g12a_fclk_div5
.hw
,
4608 [CLKID_FCLK_DIV7
] = &g12a_fclk_div7
.hw
,
4609 [CLKID_FCLK_DIV2P5
] = &g12a_fclk_div2p5
.hw
,
4610 [CLKID_GP0_PLL
] = &g12a_gp0_pll
.hw
,
4611 [CLKID_MPEG_SEL
] = &g12a_mpeg_clk_sel
.hw
,
4612 [CLKID_MPEG_DIV
] = &g12a_mpeg_clk_div
.hw
,
4613 [CLKID_CLK81
] = &g12a_clk81
.hw
,
4614 [CLKID_MPLL0
] = &g12a_mpll0
.hw
,
4615 [CLKID_MPLL1
] = &g12a_mpll1
.hw
,
4616 [CLKID_MPLL2
] = &g12a_mpll2
.hw
,
4617 [CLKID_MPLL3
] = &g12a_mpll3
.hw
,
4618 [CLKID_DDR
] = &g12a_ddr
.hw
,
4619 [CLKID_DOS
] = &g12a_dos
.hw
,
4620 [CLKID_AUDIO_LOCKER
] = &g12a_audio_locker
.hw
,
4621 [CLKID_MIPI_DSI_HOST
] = &g12a_mipi_dsi_host
.hw
,
4622 [CLKID_ETH_PHY
] = &g12a_eth_phy
.hw
,
4623 [CLKID_ISA
] = &g12a_isa
.hw
,
4624 [CLKID_PL301
] = &g12a_pl301
.hw
,
4625 [CLKID_PERIPHS
] = &g12a_periphs
.hw
,
4626 [CLKID_SPICC0
] = &g12a_spicc_0
.hw
,
4627 [CLKID_I2C
] = &g12a_i2c
.hw
,
4628 [CLKID_SANA
] = &g12a_sana
.hw
,
4629 [CLKID_SD
] = &g12a_sd
.hw
,
4630 [CLKID_RNG0
] = &g12a_rng0
.hw
,
4631 [CLKID_UART0
] = &g12a_uart0
.hw
,
4632 [CLKID_SPICC1
] = &g12a_spicc_1
.hw
,
4633 [CLKID_HIU_IFACE
] = &g12a_hiu_reg
.hw
,
4634 [CLKID_MIPI_DSI_PHY
] = &g12a_mipi_dsi_phy
.hw
,
4635 [CLKID_ASSIST_MISC
] = &g12a_assist_misc
.hw
,
4636 [CLKID_SD_EMMC_A
] = &g12a_emmc_a
.hw
,
4637 [CLKID_SD_EMMC_B
] = &g12a_emmc_b
.hw
,
4638 [CLKID_SD_EMMC_C
] = &g12a_emmc_c
.hw
,
4639 [CLKID_AUDIO_CODEC
] = &g12a_audio_codec
.hw
,
4640 [CLKID_AUDIO
] = &g12a_audio
.hw
,
4641 [CLKID_ETH
] = &g12a_eth_core
.hw
,
4642 [CLKID_DEMUX
] = &g12a_demux
.hw
,
4643 [CLKID_AUDIO_IFIFO
] = &g12a_audio_ififo
.hw
,
4644 [CLKID_ADC
] = &g12a_adc
.hw
,
4645 [CLKID_UART1
] = &g12a_uart1
.hw
,
4646 [CLKID_G2D
] = &g12a_g2d
.hw
,
4647 [CLKID_RESET
] = &g12a_reset
.hw
,
4648 [CLKID_PCIE_COMB
] = &g12a_pcie_comb
.hw
,
4649 [CLKID_PARSER
] = &g12a_parser
.hw
,
4650 [CLKID_USB
] = &g12a_usb_general
.hw
,
4651 [CLKID_PCIE_PHY
] = &g12a_pcie_phy
.hw
,
4652 [CLKID_AHB_ARB0
] = &g12a_ahb_arb0
.hw
,
4653 [CLKID_AHB_DATA_BUS
] = &g12a_ahb_data_bus
.hw
,
4654 [CLKID_AHB_CTRL_BUS
] = &g12a_ahb_ctrl_bus
.hw
,
4655 [CLKID_HTX_HDCP22
] = &g12a_htx_hdcp22
.hw
,
4656 [CLKID_HTX_PCLK
] = &g12a_htx_pclk
.hw
,
4657 [CLKID_BT656
] = &g12a_bt656
.hw
,
4658 [CLKID_USB1_DDR_BRIDGE
] = &g12a_usb1_to_ddr
.hw
,
4659 [CLKID_MMC_PCLK
] = &g12a_mmc_pclk
.hw
,
4660 [CLKID_UART2
] = &g12a_uart2
.hw
,
4661 [CLKID_VPU_INTR
] = &g12a_vpu_intr
.hw
,
4662 [CLKID_GIC
] = &g12a_gic
.hw
,
4663 [CLKID_SD_EMMC_A_CLK0_SEL
] = &g12a_sd_emmc_a_clk0_sel
.hw
,
4664 [CLKID_SD_EMMC_A_CLK0_DIV
] = &g12a_sd_emmc_a_clk0_div
.hw
,
4665 [CLKID_SD_EMMC_A_CLK0
] = &g12a_sd_emmc_a_clk0
.hw
,
4666 [CLKID_SD_EMMC_B_CLK0_SEL
] = &g12a_sd_emmc_b_clk0_sel
.hw
,
4667 [CLKID_SD_EMMC_B_CLK0_DIV
] = &g12a_sd_emmc_b_clk0_div
.hw
,
4668 [CLKID_SD_EMMC_B_CLK0
] = &g12a_sd_emmc_b_clk0
.hw
,
4669 [CLKID_SD_EMMC_C_CLK0_SEL
] = &g12a_sd_emmc_c_clk0_sel
.hw
,
4670 [CLKID_SD_EMMC_C_CLK0_DIV
] = &g12a_sd_emmc_c_clk0_div
.hw
,
4671 [CLKID_SD_EMMC_C_CLK0
] = &g12a_sd_emmc_c_clk0
.hw
,
4672 [CLKID_MPLL0_DIV
] = &g12a_mpll0_div
.hw
,
4673 [CLKID_MPLL1_DIV
] = &g12a_mpll1_div
.hw
,
4674 [CLKID_MPLL2_DIV
] = &g12a_mpll2_div
.hw
,
4675 [CLKID_MPLL3_DIV
] = &g12a_mpll3_div
.hw
,
4676 [CLKID_FCLK_DIV2_DIV
] = &g12a_fclk_div2_div
.hw
,
4677 [CLKID_FCLK_DIV3_DIV
] = &g12a_fclk_div3_div
.hw
,
4678 [CLKID_FCLK_DIV4_DIV
] = &g12a_fclk_div4_div
.hw
,
4679 [CLKID_FCLK_DIV5_DIV
] = &g12a_fclk_div5_div
.hw
,
4680 [CLKID_FCLK_DIV7_DIV
] = &g12a_fclk_div7_div
.hw
,
4681 [CLKID_FCLK_DIV2P5_DIV
] = &g12a_fclk_div2p5_div
.hw
,
4682 [CLKID_HIFI_PLL
] = &g12a_hifi_pll
.hw
,
4683 [CLKID_VCLK2_VENCI0
] = &g12a_vclk2_venci0
.hw
,
4684 [CLKID_VCLK2_VENCI1
] = &g12a_vclk2_venci1
.hw
,
4685 [CLKID_VCLK2_VENCP0
] = &g12a_vclk2_vencp0
.hw
,
4686 [CLKID_VCLK2_VENCP1
] = &g12a_vclk2_vencp1
.hw
,
4687 [CLKID_VCLK2_VENCT0
] = &g12a_vclk2_venct0
.hw
,
4688 [CLKID_VCLK2_VENCT1
] = &g12a_vclk2_venct1
.hw
,
4689 [CLKID_VCLK2_OTHER
] = &g12a_vclk2_other
.hw
,
4690 [CLKID_VCLK2_ENCI
] = &g12a_vclk2_enci
.hw
,
4691 [CLKID_VCLK2_ENCP
] = &g12a_vclk2_encp
.hw
,
4692 [CLKID_DAC_CLK
] = &g12a_dac_clk
.hw
,
4693 [CLKID_AOCLK
] = &g12a_aoclk_gate
.hw
,
4694 [CLKID_IEC958
] = &g12a_iec958_gate
.hw
,
4695 [CLKID_ENC480P
] = &g12a_enc480p
.hw
,
4696 [CLKID_RNG1
] = &g12a_rng1
.hw
,
4697 [CLKID_VCLK2_ENCT
] = &g12a_vclk2_enct
.hw
,
4698 [CLKID_VCLK2_ENCL
] = &g12a_vclk2_encl
.hw
,
4699 [CLKID_VCLK2_VENCLMMC
] = &g12a_vclk2_venclmmc
.hw
,
4700 [CLKID_VCLK2_VENCL
] = &g12a_vclk2_vencl
.hw
,
4701 [CLKID_VCLK2_OTHER1
] = &g12a_vclk2_other1
.hw
,
4702 [CLKID_FIXED_PLL_DCO
] = &g12a_fixed_pll_dco
.hw
,
4703 [CLKID_SYS_PLL_DCO
] = &g12a_sys_pll_dco
.hw
,
4704 [CLKID_GP0_PLL_DCO
] = &g12a_gp0_pll_dco
.hw
,
4705 [CLKID_HIFI_PLL_DCO
] = &g12a_hifi_pll_dco
.hw
,
4706 [CLKID_DMA
] = &g12a_dma
.hw
,
4707 [CLKID_EFUSE
] = &g12a_efuse
.hw
,
4708 [CLKID_ROM_BOOT
] = &g12a_rom_boot
.hw
,
4709 [CLKID_RESET_SEC
] = &g12a_reset_sec
.hw
,
4710 [CLKID_SEC_AHB_APB3
] = &g12a_sec_ahb_apb3
.hw
,
4711 [CLKID_MPLL_PREDIV
] = &g12a_mpll_prediv
.hw
,
4712 [CLKID_VPU_0_SEL
] = &g12a_vpu_0_sel
.hw
,
4713 [CLKID_VPU_0_DIV
] = &g12a_vpu_0_div
.hw
,
4714 [CLKID_VPU_0
] = &g12a_vpu_0
.hw
,
4715 [CLKID_VPU_1_SEL
] = &g12a_vpu_1_sel
.hw
,
4716 [CLKID_VPU_1_DIV
] = &g12a_vpu_1_div
.hw
,
4717 [CLKID_VPU_1
] = &g12a_vpu_1
.hw
,
4718 [CLKID_VPU
] = &g12a_vpu
.hw
,
4719 [CLKID_VAPB_0_SEL
] = &g12a_vapb_0_sel
.hw
,
4720 [CLKID_VAPB_0_DIV
] = &g12a_vapb_0_div
.hw
,
4721 [CLKID_VAPB_0
] = &g12a_vapb_0
.hw
,
4722 [CLKID_VAPB_1_SEL
] = &g12a_vapb_1_sel
.hw
,
4723 [CLKID_VAPB_1_DIV
] = &g12a_vapb_1_div
.hw
,
4724 [CLKID_VAPB_1
] = &g12a_vapb_1
.hw
,
4725 [CLKID_VAPB_SEL
] = &g12a_vapb_sel
.hw
,
4726 [CLKID_VAPB
] = &g12a_vapb
.hw
,
4727 [CLKID_HDMI_PLL_DCO
] = &g12a_hdmi_pll_dco
.hw
,
4728 [CLKID_HDMI_PLL_OD
] = &g12a_hdmi_pll_od
.hw
,
4729 [CLKID_HDMI_PLL_OD2
] = &g12a_hdmi_pll_od2
.hw
,
4730 [CLKID_HDMI_PLL
] = &g12a_hdmi_pll
.hw
,
4731 [CLKID_VID_PLL
] = &g12a_vid_pll_div
.hw
,
4732 [CLKID_VID_PLL_SEL
] = &g12a_vid_pll_sel
.hw
,
4733 [CLKID_VID_PLL_DIV
] = &g12a_vid_pll
.hw
,
4734 [CLKID_VCLK_SEL
] = &g12a_vclk_sel
.hw
,
4735 [CLKID_VCLK2_SEL
] = &g12a_vclk2_sel
.hw
,
4736 [CLKID_VCLK_INPUT
] = &g12a_vclk_input
.hw
,
4737 [CLKID_VCLK2_INPUT
] = &g12a_vclk2_input
.hw
,
4738 [CLKID_VCLK_DIV
] = &g12a_vclk_div
.hw
,
4739 [CLKID_VCLK2_DIV
] = &g12a_vclk2_div
.hw
,
4740 [CLKID_VCLK
] = &g12a_vclk
.hw
,
4741 [CLKID_VCLK2
] = &g12a_vclk2
.hw
,
4742 [CLKID_VCLK_DIV1
] = &g12a_vclk_div1
.hw
,
4743 [CLKID_VCLK_DIV2_EN
] = &g12a_vclk_div2_en
.hw
,
4744 [CLKID_VCLK_DIV4_EN
] = &g12a_vclk_div4_en
.hw
,
4745 [CLKID_VCLK_DIV6_EN
] = &g12a_vclk_div6_en
.hw
,
4746 [CLKID_VCLK_DIV12_EN
] = &g12a_vclk_div12_en
.hw
,
4747 [CLKID_VCLK2_DIV1
] = &g12a_vclk2_div1
.hw
,
4748 [CLKID_VCLK2_DIV2_EN
] = &g12a_vclk2_div2_en
.hw
,
4749 [CLKID_VCLK2_DIV4_EN
] = &g12a_vclk2_div4_en
.hw
,
4750 [CLKID_VCLK2_DIV6_EN
] = &g12a_vclk2_div6_en
.hw
,
4751 [CLKID_VCLK2_DIV12_EN
] = &g12a_vclk2_div12_en
.hw
,
4752 [CLKID_VCLK_DIV2
] = &g12a_vclk_div2
.hw
,
4753 [CLKID_VCLK_DIV4
] = &g12a_vclk_div4
.hw
,
4754 [CLKID_VCLK_DIV6
] = &g12a_vclk_div6
.hw
,
4755 [CLKID_VCLK_DIV12
] = &g12a_vclk_div12
.hw
,
4756 [CLKID_VCLK2_DIV2
] = &g12a_vclk2_div2
.hw
,
4757 [CLKID_VCLK2_DIV4
] = &g12a_vclk2_div4
.hw
,
4758 [CLKID_VCLK2_DIV6
] = &g12a_vclk2_div6
.hw
,
4759 [CLKID_VCLK2_DIV12
] = &g12a_vclk2_div12
.hw
,
4760 [CLKID_CTS_ENCI_SEL
] = &g12a_cts_enci_sel
.hw
,
4761 [CLKID_CTS_ENCP_SEL
] = &g12a_cts_encp_sel
.hw
,
4762 [CLKID_CTS_ENCL_SEL
] = &g12a_cts_encl_sel
.hw
,
4763 [CLKID_CTS_VDAC_SEL
] = &g12a_cts_vdac_sel
.hw
,
4764 [CLKID_HDMI_TX_SEL
] = &g12a_hdmi_tx_sel
.hw
,
4765 [CLKID_CTS_ENCI
] = &g12a_cts_enci
.hw
,
4766 [CLKID_CTS_ENCP
] = &g12a_cts_encp
.hw
,
4767 [CLKID_CTS_ENCL
] = &g12a_cts_encl
.hw
,
4768 [CLKID_CTS_VDAC
] = &g12a_cts_vdac
.hw
,
4769 [CLKID_HDMI_TX
] = &g12a_hdmi_tx
.hw
,
4770 [CLKID_HDMI_SEL
] = &g12a_hdmi_sel
.hw
,
4771 [CLKID_HDMI_DIV
] = &g12a_hdmi_div
.hw
,
4772 [CLKID_HDMI
] = &g12a_hdmi
.hw
,
4773 [CLKID_MALI_0_SEL
] = &g12a_mali_0_sel
.hw
,
4774 [CLKID_MALI_0_DIV
] = &g12a_mali_0_div
.hw
,
4775 [CLKID_MALI_0
] = &g12a_mali_0
.hw
,
4776 [CLKID_MALI_1_SEL
] = &g12a_mali_1_sel
.hw
,
4777 [CLKID_MALI_1_DIV
] = &g12a_mali_1_div
.hw
,
4778 [CLKID_MALI_1
] = &g12a_mali_1
.hw
,
4779 [CLKID_MALI
] = &g12a_mali
.hw
,
4780 [CLKID_MPLL_50M_DIV
] = &g12a_mpll_50m_div
.hw
,
4781 [CLKID_MPLL_50M
] = &g12a_mpll_50m
.hw
,
4782 [CLKID_SYS_PLL_DIV16_EN
] = &g12a_sys_pll_div16_en
.hw
,
4783 [CLKID_SYS_PLL_DIV16
] = &g12a_sys_pll_div16
.hw
,
4784 [CLKID_CPU_CLK_DYN0_SEL
] = &g12a_cpu_clk_premux0
.hw
,
4785 [CLKID_CPU_CLK_DYN0_DIV
] = &g12a_cpu_clk_mux0_div
.hw
,
4786 [CLKID_CPU_CLK_DYN0
] = &g12a_cpu_clk_postmux0
.hw
,
4787 [CLKID_CPU_CLK_DYN1_SEL
] = &g12a_cpu_clk_premux1
.hw
,
4788 [CLKID_CPU_CLK_DYN1_DIV
] = &g12a_cpu_clk_mux1_div
.hw
,
4789 [CLKID_CPU_CLK_DYN1
] = &g12a_cpu_clk_postmux1
.hw
,
4790 [CLKID_CPU_CLK_DYN
] = &g12a_cpu_clk_dyn
.hw
,
4791 [CLKID_CPU_CLK
] = &g12b_cpu_clk
.hw
,
4792 [CLKID_CPU_CLK_DIV16_EN
] = &g12a_cpu_clk_div16_en
.hw
,
4793 [CLKID_CPU_CLK_DIV16
] = &g12a_cpu_clk_div16
.hw
,
4794 [CLKID_CPU_CLK_APB_DIV
] = &g12a_cpu_clk_apb_div
.hw
,
4795 [CLKID_CPU_CLK_APB
] = &g12a_cpu_clk_apb
.hw
,
4796 [CLKID_CPU_CLK_ATB_DIV
] = &g12a_cpu_clk_atb_div
.hw
,
4797 [CLKID_CPU_CLK_ATB
] = &g12a_cpu_clk_atb
.hw
,
4798 [CLKID_CPU_CLK_AXI_DIV
] = &g12a_cpu_clk_axi_div
.hw
,
4799 [CLKID_CPU_CLK_AXI
] = &g12a_cpu_clk_axi
.hw
,
4800 [CLKID_CPU_CLK_TRACE_DIV
] = &g12a_cpu_clk_trace_div
.hw
,
4801 [CLKID_CPU_CLK_TRACE
] = &g12a_cpu_clk_trace
.hw
,
4802 [CLKID_PCIE_PLL_DCO
] = &g12a_pcie_pll_dco
.hw
,
4803 [CLKID_PCIE_PLL_DCO_DIV2
] = &g12a_pcie_pll_dco_div2
.hw
,
4804 [CLKID_PCIE_PLL_OD
] = &g12a_pcie_pll_od
.hw
,
4805 [CLKID_PCIE_PLL
] = &g12a_pcie_pll
.hw
,
4806 [CLKID_VDEC_1_SEL
] = &g12a_vdec_1_sel
.hw
,
4807 [CLKID_VDEC_1_DIV
] = &g12a_vdec_1_div
.hw
,
4808 [CLKID_VDEC_1
] = &g12a_vdec_1
.hw
,
4809 [CLKID_VDEC_HEVC_SEL
] = &g12a_vdec_hevc_sel
.hw
,
4810 [CLKID_VDEC_HEVC_DIV
] = &g12a_vdec_hevc_div
.hw
,
4811 [CLKID_VDEC_HEVC
] = &g12a_vdec_hevc
.hw
,
4812 [CLKID_VDEC_HEVCF_SEL
] = &g12a_vdec_hevcf_sel
.hw
,
4813 [CLKID_VDEC_HEVCF_DIV
] = &g12a_vdec_hevcf_div
.hw
,
4814 [CLKID_VDEC_HEVCF
] = &g12a_vdec_hevcf
.hw
,
4815 [CLKID_TS_DIV
] = &g12a_ts_div
.hw
,
4816 [CLKID_TS
] = &g12a_ts
.hw
,
4817 [CLKID_SYS1_PLL_DCO
] = &g12b_sys1_pll_dco
.hw
,
4818 [CLKID_SYS1_PLL
] = &g12b_sys1_pll
.hw
,
4819 [CLKID_SYS1_PLL_DIV16_EN
] = &g12b_sys1_pll_div16_en
.hw
,
4820 [CLKID_SYS1_PLL_DIV16
] = &g12b_sys1_pll_div16
.hw
,
4821 [CLKID_CPUB_CLK_DYN0_SEL
] = &g12b_cpub_clk_premux0
.hw
,
4822 [CLKID_CPUB_CLK_DYN0_DIV
] = &g12b_cpub_clk_mux0_div
.hw
,
4823 [CLKID_CPUB_CLK_DYN0
] = &g12b_cpub_clk_postmux0
.hw
,
4824 [CLKID_CPUB_CLK_DYN1_SEL
] = &g12b_cpub_clk_premux1
.hw
,
4825 [CLKID_CPUB_CLK_DYN1_DIV
] = &g12b_cpub_clk_mux1_div
.hw
,
4826 [CLKID_CPUB_CLK_DYN1
] = &g12b_cpub_clk_postmux1
.hw
,
4827 [CLKID_CPUB_CLK_DYN
] = &g12b_cpub_clk_dyn
.hw
,
4828 [CLKID_CPUB_CLK
] = &g12b_cpub_clk
.hw
,
4829 [CLKID_CPUB_CLK_DIV16_EN
] = &g12b_cpub_clk_div16_en
.hw
,
4830 [CLKID_CPUB_CLK_DIV16
] = &g12b_cpub_clk_div16
.hw
,
4831 [CLKID_CPUB_CLK_DIV2
] = &g12b_cpub_clk_div2
.hw
,
4832 [CLKID_CPUB_CLK_DIV3
] = &g12b_cpub_clk_div3
.hw
,
4833 [CLKID_CPUB_CLK_DIV4
] = &g12b_cpub_clk_div4
.hw
,
4834 [CLKID_CPUB_CLK_DIV5
] = &g12b_cpub_clk_div5
.hw
,
4835 [CLKID_CPUB_CLK_DIV6
] = &g12b_cpub_clk_div6
.hw
,
4836 [CLKID_CPUB_CLK_DIV7
] = &g12b_cpub_clk_div7
.hw
,
4837 [CLKID_CPUB_CLK_DIV8
] = &g12b_cpub_clk_div8
.hw
,
4838 [CLKID_CPUB_CLK_APB_SEL
] = &g12b_cpub_clk_apb_sel
.hw
,
4839 [CLKID_CPUB_CLK_APB
] = &g12b_cpub_clk_apb
.hw
,
4840 [CLKID_CPUB_CLK_ATB_SEL
] = &g12b_cpub_clk_atb_sel
.hw
,
4841 [CLKID_CPUB_CLK_ATB
] = &g12b_cpub_clk_atb
.hw
,
4842 [CLKID_CPUB_CLK_AXI_SEL
] = &g12b_cpub_clk_axi_sel
.hw
,
4843 [CLKID_CPUB_CLK_AXI
] = &g12b_cpub_clk_axi
.hw
,
4844 [CLKID_CPUB_CLK_TRACE_SEL
] = &g12b_cpub_clk_trace_sel
.hw
,
4845 [CLKID_CPUB_CLK_TRACE
] = &g12b_cpub_clk_trace
.hw
,
4846 [CLKID_SPICC0_SCLK_SEL
] = &g12a_spicc0_sclk_sel
.hw
,
4847 [CLKID_SPICC0_SCLK_DIV
] = &g12a_spicc0_sclk_div
.hw
,
4848 [CLKID_SPICC0_SCLK
] = &g12a_spicc0_sclk
.hw
,
4849 [CLKID_SPICC1_SCLK_SEL
] = &g12a_spicc1_sclk_sel
.hw
,
4850 [CLKID_SPICC1_SCLK_DIV
] = &g12a_spicc1_sclk_div
.hw
,
4851 [CLKID_SPICC1_SCLK
] = &g12a_spicc1_sclk
.hw
,
4852 [CLKID_NNA_AXI_CLK_SEL
] = &sm1_nna_axi_clk_sel
.hw
,
4853 [CLKID_NNA_AXI_CLK_DIV
] = &sm1_nna_axi_clk_div
.hw
,
4854 [CLKID_NNA_AXI_CLK
] = &sm1_nna_axi_clk
.hw
,
4855 [CLKID_NNA_CORE_CLK_SEL
] = &sm1_nna_core_clk_sel
.hw
,
4856 [CLKID_NNA_CORE_CLK_DIV
] = &sm1_nna_core_clk_div
.hw
,
4857 [CLKID_NNA_CORE_CLK
] = &sm1_nna_core_clk
.hw
,
4858 [CLKID_MIPI_DSI_PXCLK_SEL
] = &g12a_mipi_dsi_pxclk_sel
.hw
,
4859 [CLKID_MIPI_DSI_PXCLK_DIV
] = &g12a_mipi_dsi_pxclk_div
.hw
,
4860 [CLKID_MIPI_DSI_PXCLK
] = &g12a_mipi_dsi_pxclk
.hw
,
4861 [CLKID_MIPI_ISP_SEL
] = &g12b_mipi_isp_sel
.hw
,
4862 [CLKID_MIPI_ISP_DIV
] = &g12b_mipi_isp_div
.hw
,
4863 [CLKID_MIPI_ISP
] = &g12b_mipi_isp
.hw
,
4864 [CLKID_MIPI_ISP_GATE
] = &g12b_mipi_isp_gate
.hw
,
4865 [CLKID_MIPI_ISP_CSI_PHY0
] = &g12b_csi_phy0
.hw
,
4866 [CLKID_MIPI_ISP_CSI_PHY1
] = &g12b_csi_phy1
.hw
,
4869 static struct clk_hw
*sm1_hw_clks
[] = {
4870 [CLKID_SYS_PLL
] = &g12a_sys_pll
.hw
,
4871 [CLKID_FIXED_PLL
] = &g12a_fixed_pll
.hw
,
4872 [CLKID_FCLK_DIV2
] = &g12a_fclk_div2
.hw
,
4873 [CLKID_FCLK_DIV3
] = &g12a_fclk_div3
.hw
,
4874 [CLKID_FCLK_DIV4
] = &g12a_fclk_div4
.hw
,
4875 [CLKID_FCLK_DIV5
] = &g12a_fclk_div5
.hw
,
4876 [CLKID_FCLK_DIV7
] = &g12a_fclk_div7
.hw
,
4877 [CLKID_FCLK_DIV2P5
] = &g12a_fclk_div2p5
.hw
,
4878 [CLKID_GP0_PLL
] = &g12a_gp0_pll
.hw
,
4879 [CLKID_MPEG_SEL
] = &g12a_mpeg_clk_sel
.hw
,
4880 [CLKID_MPEG_DIV
] = &g12a_mpeg_clk_div
.hw
,
4881 [CLKID_CLK81
] = &g12a_clk81
.hw
,
4882 [CLKID_MPLL0
] = &g12a_mpll0
.hw
,
4883 [CLKID_MPLL1
] = &g12a_mpll1
.hw
,
4884 [CLKID_MPLL2
] = &g12a_mpll2
.hw
,
4885 [CLKID_MPLL3
] = &g12a_mpll3
.hw
,
4886 [CLKID_DDR
] = &g12a_ddr
.hw
,
4887 [CLKID_DOS
] = &g12a_dos
.hw
,
4888 [CLKID_AUDIO_LOCKER
] = &g12a_audio_locker
.hw
,
4889 [CLKID_MIPI_DSI_HOST
] = &g12a_mipi_dsi_host
.hw
,
4890 [CLKID_ETH_PHY
] = &g12a_eth_phy
.hw
,
4891 [CLKID_ISA
] = &g12a_isa
.hw
,
4892 [CLKID_PL301
] = &g12a_pl301
.hw
,
4893 [CLKID_PERIPHS
] = &g12a_periphs
.hw
,
4894 [CLKID_SPICC0
] = &g12a_spicc_0
.hw
,
4895 [CLKID_I2C
] = &g12a_i2c
.hw
,
4896 [CLKID_SANA
] = &g12a_sana
.hw
,
4897 [CLKID_SD
] = &g12a_sd
.hw
,
4898 [CLKID_RNG0
] = &g12a_rng0
.hw
,
4899 [CLKID_UART0
] = &g12a_uart0
.hw
,
4900 [CLKID_SPICC1
] = &g12a_spicc_1
.hw
,
4901 [CLKID_HIU_IFACE
] = &g12a_hiu_reg
.hw
,
4902 [CLKID_MIPI_DSI_PHY
] = &g12a_mipi_dsi_phy
.hw
,
4903 [CLKID_ASSIST_MISC
] = &g12a_assist_misc
.hw
,
4904 [CLKID_SD_EMMC_A
] = &g12a_emmc_a
.hw
,
4905 [CLKID_SD_EMMC_B
] = &g12a_emmc_b
.hw
,
4906 [CLKID_SD_EMMC_C
] = &g12a_emmc_c
.hw
,
4907 [CLKID_AUDIO_CODEC
] = &g12a_audio_codec
.hw
,
4908 [CLKID_AUDIO
] = &g12a_audio
.hw
,
4909 [CLKID_ETH
] = &g12a_eth_core
.hw
,
4910 [CLKID_DEMUX
] = &g12a_demux
.hw
,
4911 [CLKID_AUDIO_IFIFO
] = &g12a_audio_ififo
.hw
,
4912 [CLKID_ADC
] = &g12a_adc
.hw
,
4913 [CLKID_UART1
] = &g12a_uart1
.hw
,
4914 [CLKID_G2D
] = &g12a_g2d
.hw
,
4915 [CLKID_RESET
] = &g12a_reset
.hw
,
4916 [CLKID_PCIE_COMB
] = &g12a_pcie_comb
.hw
,
4917 [CLKID_PARSER
] = &g12a_parser
.hw
,
4918 [CLKID_USB
] = &g12a_usb_general
.hw
,
4919 [CLKID_PCIE_PHY
] = &g12a_pcie_phy
.hw
,
4920 [CLKID_AHB_ARB0
] = &g12a_ahb_arb0
.hw
,
4921 [CLKID_AHB_DATA_BUS
] = &g12a_ahb_data_bus
.hw
,
4922 [CLKID_AHB_CTRL_BUS
] = &g12a_ahb_ctrl_bus
.hw
,
4923 [CLKID_HTX_HDCP22
] = &g12a_htx_hdcp22
.hw
,
4924 [CLKID_HTX_PCLK
] = &g12a_htx_pclk
.hw
,
4925 [CLKID_BT656
] = &g12a_bt656
.hw
,
4926 [CLKID_USB1_DDR_BRIDGE
] = &g12a_usb1_to_ddr
.hw
,
4927 [CLKID_MMC_PCLK
] = &g12a_mmc_pclk
.hw
,
4928 [CLKID_UART2
] = &g12a_uart2
.hw
,
4929 [CLKID_VPU_INTR
] = &g12a_vpu_intr
.hw
,
4930 [CLKID_GIC
] = &g12a_gic
.hw
,
4931 [CLKID_SD_EMMC_A_CLK0_SEL
] = &g12a_sd_emmc_a_clk0_sel
.hw
,
4932 [CLKID_SD_EMMC_A_CLK0_DIV
] = &g12a_sd_emmc_a_clk0_div
.hw
,
4933 [CLKID_SD_EMMC_A_CLK0
] = &g12a_sd_emmc_a_clk0
.hw
,
4934 [CLKID_SD_EMMC_B_CLK0_SEL
] = &g12a_sd_emmc_b_clk0_sel
.hw
,
4935 [CLKID_SD_EMMC_B_CLK0_DIV
] = &g12a_sd_emmc_b_clk0_div
.hw
,
4936 [CLKID_SD_EMMC_B_CLK0
] = &g12a_sd_emmc_b_clk0
.hw
,
4937 [CLKID_SD_EMMC_C_CLK0_SEL
] = &g12a_sd_emmc_c_clk0_sel
.hw
,
4938 [CLKID_SD_EMMC_C_CLK0_DIV
] = &g12a_sd_emmc_c_clk0_div
.hw
,
4939 [CLKID_SD_EMMC_C_CLK0
] = &g12a_sd_emmc_c_clk0
.hw
,
4940 [CLKID_MPLL0_DIV
] = &g12a_mpll0_div
.hw
,
4941 [CLKID_MPLL1_DIV
] = &g12a_mpll1_div
.hw
,
4942 [CLKID_MPLL2_DIV
] = &g12a_mpll2_div
.hw
,
4943 [CLKID_MPLL3_DIV
] = &g12a_mpll3_div
.hw
,
4944 [CLKID_FCLK_DIV2_DIV
] = &g12a_fclk_div2_div
.hw
,
4945 [CLKID_FCLK_DIV3_DIV
] = &g12a_fclk_div3_div
.hw
,
4946 [CLKID_FCLK_DIV4_DIV
] = &g12a_fclk_div4_div
.hw
,
4947 [CLKID_FCLK_DIV5_DIV
] = &g12a_fclk_div5_div
.hw
,
4948 [CLKID_FCLK_DIV7_DIV
] = &g12a_fclk_div7_div
.hw
,
4949 [CLKID_FCLK_DIV2P5_DIV
] = &g12a_fclk_div2p5_div
.hw
,
4950 [CLKID_HIFI_PLL
] = &g12a_hifi_pll
.hw
,
4951 [CLKID_VCLK2_VENCI0
] = &g12a_vclk2_venci0
.hw
,
4952 [CLKID_VCLK2_VENCI1
] = &g12a_vclk2_venci1
.hw
,
4953 [CLKID_VCLK2_VENCP0
] = &g12a_vclk2_vencp0
.hw
,
4954 [CLKID_VCLK2_VENCP1
] = &g12a_vclk2_vencp1
.hw
,
4955 [CLKID_VCLK2_VENCT0
] = &g12a_vclk2_venct0
.hw
,
4956 [CLKID_VCLK2_VENCT1
] = &g12a_vclk2_venct1
.hw
,
4957 [CLKID_VCLK2_OTHER
] = &g12a_vclk2_other
.hw
,
4958 [CLKID_VCLK2_ENCI
] = &g12a_vclk2_enci
.hw
,
4959 [CLKID_VCLK2_ENCP
] = &g12a_vclk2_encp
.hw
,
4960 [CLKID_DAC_CLK
] = &g12a_dac_clk
.hw
,
4961 [CLKID_AOCLK
] = &g12a_aoclk_gate
.hw
,
4962 [CLKID_IEC958
] = &g12a_iec958_gate
.hw
,
4963 [CLKID_ENC480P
] = &g12a_enc480p
.hw
,
4964 [CLKID_RNG1
] = &g12a_rng1
.hw
,
4965 [CLKID_VCLK2_ENCT
] = &g12a_vclk2_enct
.hw
,
4966 [CLKID_VCLK2_ENCL
] = &g12a_vclk2_encl
.hw
,
4967 [CLKID_VCLK2_VENCLMMC
] = &g12a_vclk2_venclmmc
.hw
,
4968 [CLKID_VCLK2_VENCL
] = &g12a_vclk2_vencl
.hw
,
4969 [CLKID_VCLK2_OTHER1
] = &g12a_vclk2_other1
.hw
,
4970 [CLKID_FIXED_PLL_DCO
] = &g12a_fixed_pll_dco
.hw
,
4971 [CLKID_SYS_PLL_DCO
] = &g12a_sys_pll_dco
.hw
,
4972 [CLKID_GP0_PLL_DCO
] = &g12a_gp0_pll_dco
.hw
,
4973 [CLKID_HIFI_PLL_DCO
] = &g12a_hifi_pll_dco
.hw
,
4974 [CLKID_DMA
] = &g12a_dma
.hw
,
4975 [CLKID_EFUSE
] = &g12a_efuse
.hw
,
4976 [CLKID_ROM_BOOT
] = &g12a_rom_boot
.hw
,
4977 [CLKID_RESET_SEC
] = &g12a_reset_sec
.hw
,
4978 [CLKID_SEC_AHB_APB3
] = &g12a_sec_ahb_apb3
.hw
,
4979 [CLKID_MPLL_PREDIV
] = &g12a_mpll_prediv
.hw
,
4980 [CLKID_VPU_0_SEL
] = &g12a_vpu_0_sel
.hw
,
4981 [CLKID_VPU_0_DIV
] = &g12a_vpu_0_div
.hw
,
4982 [CLKID_VPU_0
] = &g12a_vpu_0
.hw
,
4983 [CLKID_VPU_1_SEL
] = &g12a_vpu_1_sel
.hw
,
4984 [CLKID_VPU_1_DIV
] = &g12a_vpu_1_div
.hw
,
4985 [CLKID_VPU_1
] = &g12a_vpu_1
.hw
,
4986 [CLKID_VPU
] = &g12a_vpu
.hw
,
4987 [CLKID_VAPB_0_SEL
] = &g12a_vapb_0_sel
.hw
,
4988 [CLKID_VAPB_0_DIV
] = &g12a_vapb_0_div
.hw
,
4989 [CLKID_VAPB_0
] = &g12a_vapb_0
.hw
,
4990 [CLKID_VAPB_1_SEL
] = &g12a_vapb_1_sel
.hw
,
4991 [CLKID_VAPB_1_DIV
] = &g12a_vapb_1_div
.hw
,
4992 [CLKID_VAPB_1
] = &g12a_vapb_1
.hw
,
4993 [CLKID_VAPB_SEL
] = &g12a_vapb_sel
.hw
,
4994 [CLKID_VAPB
] = &g12a_vapb
.hw
,
4995 [CLKID_HDMI_PLL_DCO
] = &g12a_hdmi_pll_dco
.hw
,
4996 [CLKID_HDMI_PLL_OD
] = &g12a_hdmi_pll_od
.hw
,
4997 [CLKID_HDMI_PLL_OD2
] = &g12a_hdmi_pll_od2
.hw
,
4998 [CLKID_HDMI_PLL
] = &g12a_hdmi_pll
.hw
,
4999 [CLKID_VID_PLL
] = &g12a_vid_pll_div
.hw
,
5000 [CLKID_VID_PLL_SEL
] = &g12a_vid_pll_sel
.hw
,
5001 [CLKID_VID_PLL_DIV
] = &g12a_vid_pll
.hw
,
5002 [CLKID_VCLK_SEL
] = &g12a_vclk_sel
.hw
,
5003 [CLKID_VCLK2_SEL
] = &g12a_vclk2_sel
.hw
,
5004 [CLKID_VCLK_INPUT
] = &g12a_vclk_input
.hw
,
5005 [CLKID_VCLK2_INPUT
] = &g12a_vclk2_input
.hw
,
5006 [CLKID_VCLK_DIV
] = &g12a_vclk_div
.hw
,
5007 [CLKID_VCLK2_DIV
] = &g12a_vclk2_div
.hw
,
5008 [CLKID_VCLK
] = &g12a_vclk
.hw
,
5009 [CLKID_VCLK2
] = &g12a_vclk2
.hw
,
5010 [CLKID_VCLK_DIV1
] = &g12a_vclk_div1
.hw
,
5011 [CLKID_VCLK_DIV2_EN
] = &g12a_vclk_div2_en
.hw
,
5012 [CLKID_VCLK_DIV4_EN
] = &g12a_vclk_div4_en
.hw
,
5013 [CLKID_VCLK_DIV6_EN
] = &g12a_vclk_div6_en
.hw
,
5014 [CLKID_VCLK_DIV12_EN
] = &g12a_vclk_div12_en
.hw
,
5015 [CLKID_VCLK2_DIV1
] = &g12a_vclk2_div1
.hw
,
5016 [CLKID_VCLK2_DIV2_EN
] = &g12a_vclk2_div2_en
.hw
,
5017 [CLKID_VCLK2_DIV4_EN
] = &g12a_vclk2_div4_en
.hw
,
5018 [CLKID_VCLK2_DIV6_EN
] = &g12a_vclk2_div6_en
.hw
,
5019 [CLKID_VCLK2_DIV12_EN
] = &g12a_vclk2_div12_en
.hw
,
5020 [CLKID_VCLK_DIV2
] = &g12a_vclk_div2
.hw
,
5021 [CLKID_VCLK_DIV4
] = &g12a_vclk_div4
.hw
,
5022 [CLKID_VCLK_DIV6
] = &g12a_vclk_div6
.hw
,
5023 [CLKID_VCLK_DIV12
] = &g12a_vclk_div12
.hw
,
5024 [CLKID_VCLK2_DIV2
] = &g12a_vclk2_div2
.hw
,
5025 [CLKID_VCLK2_DIV4
] = &g12a_vclk2_div4
.hw
,
5026 [CLKID_VCLK2_DIV6
] = &g12a_vclk2_div6
.hw
,
5027 [CLKID_VCLK2_DIV12
] = &g12a_vclk2_div12
.hw
,
5028 [CLKID_CTS_ENCI_SEL
] = &g12a_cts_enci_sel
.hw
,
5029 [CLKID_CTS_ENCP_SEL
] = &g12a_cts_encp_sel
.hw
,
5030 [CLKID_CTS_ENCL_SEL
] = &g12a_cts_encl_sel
.hw
,
5031 [CLKID_CTS_VDAC_SEL
] = &g12a_cts_vdac_sel
.hw
,
5032 [CLKID_HDMI_TX_SEL
] = &g12a_hdmi_tx_sel
.hw
,
5033 [CLKID_CTS_ENCI
] = &g12a_cts_enci
.hw
,
5034 [CLKID_CTS_ENCP
] = &g12a_cts_encp
.hw
,
5035 [CLKID_CTS_ENCL
] = &g12a_cts_encl
.hw
,
5036 [CLKID_CTS_VDAC
] = &g12a_cts_vdac
.hw
,
5037 [CLKID_HDMI_TX
] = &g12a_hdmi_tx
.hw
,
5038 [CLKID_HDMI_SEL
] = &g12a_hdmi_sel
.hw
,
5039 [CLKID_HDMI_DIV
] = &g12a_hdmi_div
.hw
,
5040 [CLKID_HDMI
] = &g12a_hdmi
.hw
,
5041 [CLKID_MALI_0_SEL
] = &g12a_mali_0_sel
.hw
,
5042 [CLKID_MALI_0_DIV
] = &g12a_mali_0_div
.hw
,
5043 [CLKID_MALI_0
] = &g12a_mali_0
.hw
,
5044 [CLKID_MALI_1_SEL
] = &g12a_mali_1_sel
.hw
,
5045 [CLKID_MALI_1_DIV
] = &g12a_mali_1_div
.hw
,
5046 [CLKID_MALI_1
] = &g12a_mali_1
.hw
,
5047 [CLKID_MALI
] = &g12a_mali
.hw
,
5048 [CLKID_MPLL_50M_DIV
] = &g12a_mpll_50m_div
.hw
,
5049 [CLKID_MPLL_50M
] = &g12a_mpll_50m
.hw
,
5050 [CLKID_SYS_PLL_DIV16_EN
] = &g12a_sys_pll_div16_en
.hw
,
5051 [CLKID_SYS_PLL_DIV16
] = &g12a_sys_pll_div16
.hw
,
5052 [CLKID_CPU_CLK_DYN0_SEL
] = &g12a_cpu_clk_premux0
.hw
,
5053 [CLKID_CPU_CLK_DYN0_DIV
] = &g12a_cpu_clk_mux0_div
.hw
,
5054 [CLKID_CPU_CLK_DYN0
] = &g12a_cpu_clk_postmux0
.hw
,
5055 [CLKID_CPU_CLK_DYN1_SEL
] = &g12a_cpu_clk_premux1
.hw
,
5056 [CLKID_CPU_CLK_DYN1_DIV
] = &g12a_cpu_clk_mux1_div
.hw
,
5057 [CLKID_CPU_CLK_DYN1
] = &g12a_cpu_clk_postmux1
.hw
,
5058 [CLKID_CPU_CLK_DYN
] = &g12a_cpu_clk_dyn
.hw
,
5059 [CLKID_CPU_CLK
] = &g12a_cpu_clk
.hw
,
5060 [CLKID_CPU_CLK_DIV16_EN
] = &g12a_cpu_clk_div16_en
.hw
,
5061 [CLKID_CPU_CLK_DIV16
] = &g12a_cpu_clk_div16
.hw
,
5062 [CLKID_CPU_CLK_APB_DIV
] = &g12a_cpu_clk_apb_div
.hw
,
5063 [CLKID_CPU_CLK_APB
] = &g12a_cpu_clk_apb
.hw
,
5064 [CLKID_CPU_CLK_ATB_DIV
] = &g12a_cpu_clk_atb_div
.hw
,
5065 [CLKID_CPU_CLK_ATB
] = &g12a_cpu_clk_atb
.hw
,
5066 [CLKID_CPU_CLK_AXI_DIV
] = &g12a_cpu_clk_axi_div
.hw
,
5067 [CLKID_CPU_CLK_AXI
] = &g12a_cpu_clk_axi
.hw
,
5068 [CLKID_CPU_CLK_TRACE_DIV
] = &g12a_cpu_clk_trace_div
.hw
,
5069 [CLKID_CPU_CLK_TRACE
] = &g12a_cpu_clk_trace
.hw
,
5070 [CLKID_PCIE_PLL_DCO
] = &g12a_pcie_pll_dco
.hw
,
5071 [CLKID_PCIE_PLL_DCO_DIV2
] = &g12a_pcie_pll_dco_div2
.hw
,
5072 [CLKID_PCIE_PLL_OD
] = &g12a_pcie_pll_od
.hw
,
5073 [CLKID_PCIE_PLL
] = &g12a_pcie_pll
.hw
,
5074 [CLKID_VDEC_1_SEL
] = &g12a_vdec_1_sel
.hw
,
5075 [CLKID_VDEC_1_DIV
] = &g12a_vdec_1_div
.hw
,
5076 [CLKID_VDEC_1
] = &g12a_vdec_1
.hw
,
5077 [CLKID_VDEC_HEVC_SEL
] = &g12a_vdec_hevc_sel
.hw
,
5078 [CLKID_VDEC_HEVC_DIV
] = &g12a_vdec_hevc_div
.hw
,
5079 [CLKID_VDEC_HEVC
] = &g12a_vdec_hevc
.hw
,
5080 [CLKID_VDEC_HEVCF_SEL
] = &g12a_vdec_hevcf_sel
.hw
,
5081 [CLKID_VDEC_HEVCF_DIV
] = &g12a_vdec_hevcf_div
.hw
,
5082 [CLKID_VDEC_HEVCF
] = &g12a_vdec_hevcf
.hw
,
5083 [CLKID_TS_DIV
] = &g12a_ts_div
.hw
,
5084 [CLKID_TS
] = &g12a_ts
.hw
,
5085 [CLKID_GP1_PLL_DCO
] = &sm1_gp1_pll_dco
.hw
,
5086 [CLKID_GP1_PLL
] = &sm1_gp1_pll
.hw
,
5087 [CLKID_DSU_CLK_DYN0_SEL
] = &sm1_dsu_clk_premux0
.hw
,
5088 [CLKID_DSU_CLK_DYN0_DIV
] = &sm1_dsu_clk_premux1
.hw
,
5089 [CLKID_DSU_CLK_DYN0
] = &sm1_dsu_clk_mux0_div
.hw
,
5090 [CLKID_DSU_CLK_DYN1_SEL
] = &sm1_dsu_clk_postmux0
.hw
,
5091 [CLKID_DSU_CLK_DYN1_DIV
] = &sm1_dsu_clk_mux1_div
.hw
,
5092 [CLKID_DSU_CLK_DYN1
] = &sm1_dsu_clk_postmux1
.hw
,
5093 [CLKID_DSU_CLK_DYN
] = &sm1_dsu_clk_dyn
.hw
,
5094 [CLKID_DSU_CLK_FINAL
] = &sm1_dsu_final_clk
.hw
,
5095 [CLKID_DSU_CLK
] = &sm1_dsu_clk
.hw
,
5096 [CLKID_CPU1_CLK
] = &sm1_cpu1_clk
.hw
,
5097 [CLKID_CPU2_CLK
] = &sm1_cpu2_clk
.hw
,
5098 [CLKID_CPU3_CLK
] = &sm1_cpu3_clk
.hw
,
5099 [CLKID_SPICC0_SCLK_SEL
] = &g12a_spicc0_sclk_sel
.hw
,
5100 [CLKID_SPICC0_SCLK_DIV
] = &g12a_spicc0_sclk_div
.hw
,
5101 [CLKID_SPICC0_SCLK
] = &g12a_spicc0_sclk
.hw
,
5102 [CLKID_SPICC1_SCLK_SEL
] = &g12a_spicc1_sclk_sel
.hw
,
5103 [CLKID_SPICC1_SCLK_DIV
] = &g12a_spicc1_sclk_div
.hw
,
5104 [CLKID_SPICC1_SCLK
] = &g12a_spicc1_sclk
.hw
,
5105 [CLKID_NNA_AXI_CLK_SEL
] = &sm1_nna_axi_clk_sel
.hw
,
5106 [CLKID_NNA_AXI_CLK_DIV
] = &sm1_nna_axi_clk_div
.hw
,
5107 [CLKID_NNA_AXI_CLK
] = &sm1_nna_axi_clk
.hw
,
5108 [CLKID_NNA_CORE_CLK_SEL
] = &sm1_nna_core_clk_sel
.hw
,
5109 [CLKID_NNA_CORE_CLK_DIV
] = &sm1_nna_core_clk_div
.hw
,
5110 [CLKID_NNA_CORE_CLK
] = &sm1_nna_core_clk
.hw
,
5111 [CLKID_MIPI_DSI_PXCLK_SEL
] = &g12a_mipi_dsi_pxclk_sel
.hw
,
5112 [CLKID_MIPI_DSI_PXCLK_DIV
] = &g12a_mipi_dsi_pxclk_div
.hw
,
5113 [CLKID_MIPI_DSI_PXCLK
] = &g12a_mipi_dsi_pxclk
.hw
,
5116 /* Convenience table to populate regmap in .probe */
5117 static struct clk_regmap
*const g12a_clk_regmaps
[] = {
5122 &g12a_mipi_dsi_host
,
5164 &g12a_sd_emmc_a_clk0
,
5165 &g12a_sd_emmc_b_clk0
,
5166 &g12a_sd_emmc_c_clk0
,
5168 &g12a_sd_emmc_a_clk0_div
,
5169 &g12a_sd_emmc_b_clk0_div
,
5170 &g12a_sd_emmc_c_clk0_div
,
5172 &g12a_sd_emmc_a_clk0_sel
,
5173 &g12a_sd_emmc_b_clk0_sel
,
5174 &g12a_sd_emmc_c_clk0_sel
,
5203 &g12a_vclk2_venclmmc
,
5206 &g12a_fixed_pll_dco
,
5255 &g12a_vclk_div12_en
,
5257 &g12a_vclk2_div2_en
,
5258 &g12a_vclk2_div4_en
,
5259 &g12a_vclk2_div6_en
,
5260 &g12a_vclk2_div12_en
,
5282 &g12a_sys_pll_div16_en
,
5283 &g12a_cpu_clk_premux0
,
5284 &g12a_cpu_clk_mux0_div
,
5285 &g12a_cpu_clk_postmux0
,
5286 &g12a_cpu_clk_premux1
,
5287 &g12a_cpu_clk_mux1_div
,
5288 &g12a_cpu_clk_postmux1
,
5291 &g12a_cpu_clk_div16_en
,
5292 &g12a_cpu_clk_apb_div
,
5294 &g12a_cpu_clk_atb_div
,
5296 &g12a_cpu_clk_axi_div
,
5298 &g12a_cpu_clk_trace_div
,
5299 &g12a_cpu_clk_trace
,
5305 &g12a_vdec_hevc_sel
,
5306 &g12a_vdec_hevc_div
,
5308 &g12a_vdec_hevcf_sel
,
5309 &g12a_vdec_hevcf_div
,
5316 &g12b_sys1_pll_div16_en
,
5317 &g12b_cpub_clk_premux0
,
5318 &g12b_cpub_clk_mux0_div
,
5319 &g12b_cpub_clk_postmux0
,
5320 &g12b_cpub_clk_premux1
,
5321 &g12b_cpub_clk_mux1_div
,
5322 &g12b_cpub_clk_postmux1
,
5325 &g12b_cpub_clk_div16_en
,
5326 &g12b_cpub_clk_apb_sel
,
5328 &g12b_cpub_clk_atb_sel
,
5330 &g12b_cpub_clk_axi_sel
,
5332 &g12b_cpub_clk_trace_sel
,
5333 &g12b_cpub_clk_trace
,
5336 &sm1_dsu_clk_premux0
,
5337 &sm1_dsu_clk_premux1
,
5338 &sm1_dsu_clk_mux0_div
,
5339 &sm1_dsu_clk_postmux0
,
5340 &sm1_dsu_clk_mux1_div
,
5341 &sm1_dsu_clk_postmux1
,
5348 &g12a_spicc0_sclk_sel
,
5349 &g12a_spicc0_sclk_div
,
5351 &g12a_spicc1_sclk_sel
,
5352 &g12a_spicc1_sclk_div
,
5354 &sm1_nna_axi_clk_sel
,
5355 &sm1_nna_axi_clk_div
,
5357 &sm1_nna_core_clk_sel
,
5358 &sm1_nna_core_clk_div
,
5360 &g12a_mipi_dsi_pxclk_sel
,
5361 &g12a_mipi_dsi_pxclk_div
,
5362 &g12a_mipi_dsi_pxclk
,
5366 &g12b_mipi_isp_gate
,
5371 static const struct reg_sequence g12a_init_regs
[] = {
5372 { .reg
= HHI_MPLL_CNTL0
, .def
= 0x00000543 },
5375 #define DVFS_CON_ID "dvfs"
5377 static int meson_g12a_dvfs_setup_common(struct device
*dev
,
5378 struct clk_hw
**hws
)
5380 struct clk
*notifier_clk
;
5381 struct clk_hw
*xtal
;
5384 xtal
= clk_hw_get_parent_by_index(hws
[CLKID_CPU_CLK_DYN1_SEL
], 0);
5386 /* Setup clock notifier for cpu_clk_postmux0 */
5387 g12a_cpu_clk_postmux0_nb_data
.xtal
= xtal
;
5388 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12a_cpu_clk_postmux0
.hw
,
5390 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5391 &g12a_cpu_clk_postmux0_nb_data
.nb
);
5393 dev_err(dev
, "failed to register the cpu_clk_postmux0 notifier\n");
5397 /* Setup clock notifier for cpu_clk_dyn mux */
5398 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12a_cpu_clk_dyn
.hw
,
5400 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5401 &g12a_cpu_clk_mux_nb
);
5403 dev_err(dev
, "failed to register the cpu_clk_dyn notifier\n");
5410 static int meson_g12b_dvfs_setup(struct platform_device
*pdev
)
5412 struct clk_hw
**hws
= g12b_hw_clks
;
5413 struct device
*dev
= &pdev
->dev
;
5414 struct clk
*notifier_clk
;
5415 struct clk_hw
*xtal
;
5418 ret
= meson_g12a_dvfs_setup_common(dev
, hws
);
5422 xtal
= clk_hw_get_parent_by_index(hws
[CLKID_CPU_CLK_DYN1_SEL
], 0);
5424 /* Setup clock notifier for cpu_clk mux */
5425 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12b_cpu_clk
.hw
,
5427 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5428 &g12a_cpu_clk_mux_nb
);
5430 dev_err(dev
, "failed to register the cpu_clk notifier\n");
5434 /* Setup clock notifier for sys1_pll */
5435 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12b_sys1_pll
.hw
,
5437 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5438 &g12b_cpu_clk_sys1_pll_nb_data
.nb
);
5440 dev_err(dev
, "failed to register the sys1_pll notifier\n");
5444 /* Add notifiers for the second CPU cluster */
5446 /* Setup clock notifier for cpub_clk_postmux0 */
5447 g12b_cpub_clk_postmux0_nb_data
.xtal
= xtal
;
5448 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12b_cpub_clk_postmux0
.hw
,
5450 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5451 &g12b_cpub_clk_postmux0_nb_data
.nb
);
5453 dev_err(dev
, "failed to register the cpub_clk_postmux0 notifier\n");
5457 /* Setup clock notifier for cpub_clk_dyn mux */
5458 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12b_cpub_clk_dyn
.hw
, "dvfs");
5459 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5460 &g12a_cpu_clk_mux_nb
);
5462 dev_err(dev
, "failed to register the cpub_clk_dyn notifier\n");
5466 /* Setup clock notifier for cpub_clk mux */
5467 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12b_cpub_clk
.hw
, DVFS_CON_ID
);
5468 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5469 &g12a_cpu_clk_mux_nb
);
5471 dev_err(dev
, "failed to register the cpub_clk notifier\n");
5475 /* Setup clock notifier for sys_pll */
5476 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12a_sys_pll
.hw
, DVFS_CON_ID
);
5477 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5478 &g12b_cpub_clk_sys_pll_nb_data
.nb
);
5480 dev_err(dev
, "failed to register the sys_pll notifier\n");
5487 static int meson_g12a_dvfs_setup(struct platform_device
*pdev
)
5489 struct clk_hw
**hws
= g12a_hw_clks
;
5490 struct device
*dev
= &pdev
->dev
;
5491 struct clk
*notifier_clk
;
5494 ret
= meson_g12a_dvfs_setup_common(dev
, hws
);
5498 /* Setup clock notifier for cpu_clk mux */
5499 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12a_cpu_clk
.hw
, DVFS_CON_ID
);
5500 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5501 &g12a_cpu_clk_mux_nb
);
5503 dev_err(dev
, "failed to register the cpu_clk notifier\n");
5507 /* Setup clock notifier for sys_pll */
5508 notifier_clk
= devm_clk_hw_get_clk(dev
, &g12a_sys_pll
.hw
, DVFS_CON_ID
);
5509 ret
= devm_clk_notifier_register(dev
, notifier_clk
,
5510 &g12a_sys_pll_nb_data
.nb
);
5512 dev_err(dev
, "failed to register the sys_pll notifier\n");
5519 struct meson_g12a_data
{
5520 const struct meson_eeclkc_data eeclkc_data
;
5521 int (*dvfs_setup
)(struct platform_device
*pdev
);
5524 static int meson_g12a_probe(struct platform_device
*pdev
)
5526 const struct meson_eeclkc_data
*eeclkc_data
;
5527 const struct meson_g12a_data
*g12a_data
;
5530 eeclkc_data
= of_device_get_match_data(&pdev
->dev
);
5534 ret
= meson_eeclkc_probe(pdev
);
5538 g12a_data
= container_of(eeclkc_data
, struct meson_g12a_data
,
5541 if (g12a_data
->dvfs_setup
)
5542 return g12a_data
->dvfs_setup(pdev
);
5547 static const struct meson_g12a_data g12a_clkc_data
= {
5549 .regmap_clks
= g12a_clk_regmaps
,
5550 .regmap_clk_num
= ARRAY_SIZE(g12a_clk_regmaps
),
5552 .hws
= g12a_hw_clks
,
5553 .num
= ARRAY_SIZE(g12a_hw_clks
),
5555 .init_regs
= g12a_init_regs
,
5556 .init_count
= ARRAY_SIZE(g12a_init_regs
),
5558 .dvfs_setup
= meson_g12a_dvfs_setup
,
5561 static const struct meson_g12a_data g12b_clkc_data
= {
5563 .regmap_clks
= g12a_clk_regmaps
,
5564 .regmap_clk_num
= ARRAY_SIZE(g12a_clk_regmaps
),
5566 .hws
= g12b_hw_clks
,
5567 .num
= ARRAY_SIZE(g12b_hw_clks
),
5570 .dvfs_setup
= meson_g12b_dvfs_setup
,
5573 static const struct meson_g12a_data sm1_clkc_data
= {
5575 .regmap_clks
= g12a_clk_regmaps
,
5576 .regmap_clk_num
= ARRAY_SIZE(g12a_clk_regmaps
),
5579 .num
= ARRAY_SIZE(sm1_hw_clks
),
5582 .dvfs_setup
= meson_g12a_dvfs_setup
,
5585 static const struct of_device_id clkc_match_table
[] = {
5587 .compatible
= "amlogic,g12a-clkc",
5588 .data
= &g12a_clkc_data
.eeclkc_data
5591 .compatible
= "amlogic,g12b-clkc",
5592 .data
= &g12b_clkc_data
.eeclkc_data
5595 .compatible
= "amlogic,sm1-clkc",
5596 .data
= &sm1_clkc_data
.eeclkc_data
5600 MODULE_DEVICE_TABLE(of
, clkc_match_table
);
5602 static struct platform_driver g12a_driver
= {
5603 .probe
= meson_g12a_probe
,
5605 .name
= "g12a-clkc",
5606 .of_match_table
= clkc_match_table
,
5609 module_platform_driver(g12a_driver
);
5611 MODULE_DESCRIPTION("Amlogic G12/SM1 Main Clock Controller driver");
5612 MODULE_LICENSE("GPL");
5613 MODULE_IMPORT_NS("CLK_MESON");