1 // SPDX-License-Identifier: GPL-2.0+
3 * Amlogic Meson-G12A Clock Controller Driver
5 * Copyright (c) 2016 Baylibre SAS.
6 * Author: Michael Turquette <mturquette@baylibre.com>
8 * Copyright (c) 2018 Amlogic, inc.
9 * Author: Qiufang Dai <qiufang.dai@amlogic.com>
10 * Author: Jian Hu <jian.hu@amlogic.com>
13 #include <linux/clk-provider.h>
14 #include <linux/init.h>
15 #include <linux/of_device.h>
16 #include <linux/platform_device.h>
17 #include <linux/clk.h>
21 #include "clk-regmap.h"
22 #include "clk-cpu-dyndiv.h"
23 #include "vid-pll-div.h"
24 #include "meson-eeclk.h"
27 static DEFINE_SPINLOCK(meson_clk_lock
);
29 static struct clk_regmap g12a_fixed_pll_dco
= {
30 .data
= &(struct meson_clk_pll_data
){
32 .reg_off
= HHI_FIX_PLL_CNTL0
,
37 .reg_off
= HHI_FIX_PLL_CNTL0
,
42 .reg_off
= HHI_FIX_PLL_CNTL0
,
47 .reg_off
= HHI_FIX_PLL_CNTL1
,
52 .reg_off
= HHI_FIX_PLL_CNTL0
,
57 .reg_off
= HHI_FIX_PLL_CNTL0
,
62 .hw
.init
= &(struct clk_init_data
){
63 .name
= "fixed_pll_dco",
64 .ops
= &meson_clk_pll_ro_ops
,
65 .parent_data
= &(const struct clk_parent_data
) {
72 static struct clk_regmap g12a_fixed_pll
= {
73 .data
= &(struct clk_regmap_div_data
){
74 .offset
= HHI_FIX_PLL_CNTL0
,
77 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
79 .hw
.init
= &(struct clk_init_data
){
81 .ops
= &clk_regmap_divider_ro_ops
,
82 .parent_hws
= (const struct clk_hw
*[]) {
83 &g12a_fixed_pll_dco
.hw
87 * This clock won't ever change at runtime so
88 * CLK_SET_RATE_PARENT is not required
93 static const struct pll_mult_range g12a_sys_pll_mult_range
= {
98 static struct clk_regmap g12a_sys_pll_dco
= {
99 .data
= &(struct meson_clk_pll_data
){
101 .reg_off
= HHI_SYS_PLL_CNTL0
,
106 .reg_off
= HHI_SYS_PLL_CNTL0
,
111 .reg_off
= HHI_SYS_PLL_CNTL0
,
116 .reg_off
= HHI_SYS_PLL_CNTL0
,
121 .reg_off
= HHI_SYS_PLL_CNTL0
,
125 .range
= &g12a_sys_pll_mult_range
,
127 .hw
.init
= &(struct clk_init_data
){
128 .name
= "sys_pll_dco",
129 .ops
= &meson_clk_pll_ops
,
130 .parent_data
= &(const struct clk_parent_data
) {
134 /* This clock feeds the CPU, avoid disabling it */
135 .flags
= CLK_IS_CRITICAL
,
139 static struct clk_regmap g12a_sys_pll
= {
140 .data
= &(struct clk_regmap_div_data
){
141 .offset
= HHI_SYS_PLL_CNTL0
,
144 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
146 .hw
.init
= &(struct clk_init_data
){
148 .ops
= &clk_regmap_divider_ops
,
149 .parent_hws
= (const struct clk_hw
*[]) {
153 .flags
= CLK_SET_RATE_PARENT
,
157 static struct clk_regmap g12b_sys1_pll_dco
= {
158 .data
= &(struct meson_clk_pll_data
){
160 .reg_off
= HHI_SYS1_PLL_CNTL0
,
165 .reg_off
= HHI_SYS1_PLL_CNTL0
,
170 .reg_off
= HHI_SYS1_PLL_CNTL0
,
175 .reg_off
= HHI_SYS1_PLL_CNTL0
,
180 .reg_off
= HHI_SYS1_PLL_CNTL0
,
184 .range
= &g12a_sys_pll_mult_range
,
186 .hw
.init
= &(struct clk_init_data
){
187 .name
= "sys1_pll_dco",
188 .ops
= &meson_clk_pll_ops
,
189 .parent_data
= &(const struct clk_parent_data
) {
193 /* This clock feeds the CPU, avoid disabling it */
194 .flags
= CLK_IS_CRITICAL
,
198 static struct clk_regmap g12b_sys1_pll
= {
199 .data
= &(struct clk_regmap_div_data
){
200 .offset
= HHI_SYS1_PLL_CNTL0
,
203 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
205 .hw
.init
= &(struct clk_init_data
){
207 .ops
= &clk_regmap_divider_ops
,
208 .parent_hws
= (const struct clk_hw
*[]) {
209 &g12b_sys1_pll_dco
.hw
212 .flags
= CLK_SET_RATE_PARENT
,
216 static struct clk_regmap g12a_sys_pll_div16_en
= {
217 .data
= &(struct clk_regmap_gate_data
){
218 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
221 .hw
.init
= &(struct clk_init_data
) {
222 .name
= "sys_pll_div16_en",
223 .ops
= &clk_regmap_gate_ro_ops
,
224 .parent_hws
= (const struct clk_hw
*[]) { &g12a_sys_pll
.hw
},
227 * This clock is used to debug the sys_pll range
228 * Linux should not change it at runtime
233 static struct clk_regmap g12b_sys1_pll_div16_en
= {
234 .data
= &(struct clk_regmap_gate_data
){
235 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
238 .hw
.init
= &(struct clk_init_data
) {
239 .name
= "sys1_pll_div16_en",
240 .ops
= &clk_regmap_gate_ro_ops
,
241 .parent_hws
= (const struct clk_hw
*[]) {
246 * This clock is used to debug the sys_pll range
247 * Linux should not change it at runtime
252 static struct clk_fixed_factor g12a_sys_pll_div16
= {
255 .hw
.init
= &(struct clk_init_data
){
256 .name
= "sys_pll_div16",
257 .ops
= &clk_fixed_factor_ops
,
258 .parent_hws
= (const struct clk_hw
*[]) {
259 &g12a_sys_pll_div16_en
.hw
265 static struct clk_fixed_factor g12b_sys1_pll_div16
= {
268 .hw
.init
= &(struct clk_init_data
){
269 .name
= "sys1_pll_div16",
270 .ops
= &clk_fixed_factor_ops
,
271 .parent_hws
= (const struct clk_hw
*[]) {
272 &g12b_sys1_pll_div16_en
.hw
278 static struct clk_fixed_factor g12a_fclk_div2_div
= {
281 .hw
.init
= &(struct clk_init_data
){
282 .name
= "fclk_div2_div",
283 .ops
= &clk_fixed_factor_ops
,
284 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
289 static struct clk_regmap g12a_fclk_div2
= {
290 .data
= &(struct clk_regmap_gate_data
){
291 .offset
= HHI_FIX_PLL_CNTL1
,
294 .hw
.init
= &(struct clk_init_data
){
296 .ops
= &clk_regmap_gate_ops
,
297 .parent_hws
= (const struct clk_hw
*[]) {
298 &g12a_fclk_div2_div
.hw
304 static struct clk_fixed_factor g12a_fclk_div3_div
= {
307 .hw
.init
= &(struct clk_init_data
){
308 .name
= "fclk_div3_div",
309 .ops
= &clk_fixed_factor_ops
,
310 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
315 static struct clk_regmap g12a_fclk_div3
= {
316 .data
= &(struct clk_regmap_gate_data
){
317 .offset
= HHI_FIX_PLL_CNTL1
,
320 .hw
.init
= &(struct clk_init_data
){
322 .ops
= &clk_regmap_gate_ops
,
323 .parent_hws
= (const struct clk_hw
*[]) {
324 &g12a_fclk_div3_div
.hw
328 * This clock is used by the resident firmware and is required
329 * by the platform to operate correctly.
330 * Until the following condition are met, we need this clock to
331 * be marked as critical:
332 * a) Mark the clock used by a firmware resource, if possible
333 * b) CCF has a clock hand-off mechanism to make the sure the
334 * clock stays on until the proper driver comes along
336 .flags
= CLK_IS_CRITICAL
,
340 /* Datasheet names this field as "premux0" */
341 static struct clk_regmap g12a_cpu_clk_premux0
= {
342 .data
= &(struct clk_regmap_mux_data
){
343 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
346 .flags
= CLK_MUX_ROUND_CLOSEST
,
348 .hw
.init
= &(struct clk_init_data
){
349 .name
= "cpu_clk_dyn0_sel",
350 .ops
= &clk_regmap_mux_ops
,
351 .parent_data
= (const struct clk_parent_data
[]) {
352 { .fw_name
= "xtal", },
353 { .hw
= &g12a_fclk_div2
.hw
},
354 { .hw
= &g12a_fclk_div3
.hw
},
357 .flags
= CLK_SET_RATE_PARENT
,
361 /* Datasheet names this field as "premux1" */
362 static struct clk_regmap g12a_cpu_clk_premux1
= {
363 .data
= &(struct clk_regmap_mux_data
){
364 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
368 .hw
.init
= &(struct clk_init_data
){
369 .name
= "cpu_clk_dyn1_sel",
370 .ops
= &clk_regmap_mux_ops
,
371 .parent_data
= (const struct clk_parent_data
[]) {
372 { .fw_name
= "xtal", },
373 { .hw
= &g12a_fclk_div2
.hw
},
374 { .hw
= &g12a_fclk_div3
.hw
},
377 /* This sub-tree is used a parking clock */
378 .flags
= CLK_SET_RATE_NO_REPARENT
382 /* Datasheet names this field as "mux0_divn_tcnt" */
383 static struct clk_regmap g12a_cpu_clk_mux0_div
= {
384 .data
= &(struct meson_clk_cpu_dyndiv_data
){
386 .reg_off
= HHI_SYS_CPU_CLK_CNTL0
,
391 .reg_off
= HHI_SYS_CPU_CLK_CNTL0
,
396 .hw
.init
= &(struct clk_init_data
){
397 .name
= "cpu_clk_dyn0_div",
398 .ops
= &meson_clk_cpu_dyndiv_ops
,
399 .parent_hws
= (const struct clk_hw
*[]) {
400 &g12a_cpu_clk_premux0
.hw
403 .flags
= CLK_SET_RATE_PARENT
,
407 /* Datasheet names this field as "postmux0" */
408 static struct clk_regmap g12a_cpu_clk_postmux0
= {
409 .data
= &(struct clk_regmap_mux_data
){
410 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
413 .flags
= CLK_MUX_ROUND_CLOSEST
,
415 .hw
.init
= &(struct clk_init_data
){
416 .name
= "cpu_clk_dyn0",
417 .ops
= &clk_regmap_mux_ops
,
418 .parent_hws
= (const struct clk_hw
*[]) {
419 &g12a_cpu_clk_premux0
.hw
,
420 &g12a_cpu_clk_mux0_div
.hw
,
423 .flags
= CLK_SET_RATE_PARENT
,
427 /* Datasheet names this field as "Mux1_divn_tcnt" */
428 static struct clk_regmap g12a_cpu_clk_mux1_div
= {
429 .data
= &(struct clk_regmap_div_data
){
430 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
434 .hw
.init
= &(struct clk_init_data
){
435 .name
= "cpu_clk_dyn1_div",
436 .ops
= &clk_regmap_divider_ro_ops
,
437 .parent_hws
= (const struct clk_hw
*[]) {
438 &g12a_cpu_clk_premux1
.hw
444 /* Datasheet names this field as "postmux1" */
445 static struct clk_regmap g12a_cpu_clk_postmux1
= {
446 .data
= &(struct clk_regmap_mux_data
){
447 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
451 .hw
.init
= &(struct clk_init_data
){
452 .name
= "cpu_clk_dyn1",
453 .ops
= &clk_regmap_mux_ops
,
454 .parent_hws
= (const struct clk_hw
*[]) {
455 &g12a_cpu_clk_premux1
.hw
,
456 &g12a_cpu_clk_mux1_div
.hw
,
459 /* This sub-tree is used a parking clock */
460 .flags
= CLK_SET_RATE_NO_REPARENT
,
464 /* Datasheet names this field as "Final_dyn_mux_sel" */
465 static struct clk_regmap g12a_cpu_clk_dyn
= {
466 .data
= &(struct clk_regmap_mux_data
){
467 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
470 .flags
= CLK_MUX_ROUND_CLOSEST
,
472 .hw
.init
= &(struct clk_init_data
){
473 .name
= "cpu_clk_dyn",
474 .ops
= &clk_regmap_mux_ops
,
475 .parent_hws
= (const struct clk_hw
*[]) {
476 &g12a_cpu_clk_postmux0
.hw
,
477 &g12a_cpu_clk_postmux1
.hw
,
480 .flags
= CLK_SET_RATE_PARENT
,
484 /* Datasheet names this field as "Final_mux_sel" */
485 static struct clk_regmap g12a_cpu_clk
= {
486 .data
= &(struct clk_regmap_mux_data
){
487 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
490 .flags
= CLK_MUX_ROUND_CLOSEST
,
492 .hw
.init
= &(struct clk_init_data
){
494 .ops
= &clk_regmap_mux_ops
,
495 .parent_hws
= (const struct clk_hw
*[]) {
496 &g12a_cpu_clk_dyn
.hw
,
500 .flags
= CLK_SET_RATE_PARENT
,
504 /* Datasheet names this field as "Final_mux_sel" */
505 static struct clk_regmap g12b_cpu_clk
= {
506 .data
= &(struct clk_regmap_mux_data
){
507 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
510 .flags
= CLK_MUX_ROUND_CLOSEST
,
512 .hw
.init
= &(struct clk_init_data
){
514 .ops
= &clk_regmap_mux_ops
,
515 .parent_hws
= (const struct clk_hw
*[]) {
516 &g12a_cpu_clk_dyn
.hw
,
520 .flags
= CLK_SET_RATE_PARENT
,
524 /* Datasheet names this field as "premux0" */
525 static struct clk_regmap g12b_cpub_clk_premux0
= {
526 .data
= &(struct clk_regmap_mux_data
){
527 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
530 .flags
= CLK_MUX_ROUND_CLOSEST
,
532 .hw
.init
= &(struct clk_init_data
){
533 .name
= "cpub_clk_dyn0_sel",
534 .ops
= &clk_regmap_mux_ops
,
535 .parent_data
= (const struct clk_parent_data
[]) {
536 { .fw_name
= "xtal", },
537 { .hw
= &g12a_fclk_div2
.hw
},
538 { .hw
= &g12a_fclk_div3
.hw
},
541 .flags
= CLK_SET_RATE_PARENT
,
545 /* Datasheet names this field as "mux0_divn_tcnt" */
546 static struct clk_regmap g12b_cpub_clk_mux0_div
= {
547 .data
= &(struct meson_clk_cpu_dyndiv_data
){
549 .reg_off
= HHI_SYS_CPUB_CLK_CNTL
,
554 .reg_off
= HHI_SYS_CPUB_CLK_CNTL
,
559 .hw
.init
= &(struct clk_init_data
){
560 .name
= "cpub_clk_dyn0_div",
561 .ops
= &meson_clk_cpu_dyndiv_ops
,
562 .parent_hws
= (const struct clk_hw
*[]) {
563 &g12b_cpub_clk_premux0
.hw
566 .flags
= CLK_SET_RATE_PARENT
,
570 /* Datasheet names this field as "postmux0" */
571 static struct clk_regmap g12b_cpub_clk_postmux0
= {
572 .data
= &(struct clk_regmap_mux_data
){
573 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
576 .flags
= CLK_MUX_ROUND_CLOSEST
,
578 .hw
.init
= &(struct clk_init_data
){
579 .name
= "cpub_clk_dyn0",
580 .ops
= &clk_regmap_mux_ops
,
581 .parent_hws
= (const struct clk_hw
*[]) {
582 &g12b_cpub_clk_premux0
.hw
,
583 &g12b_cpub_clk_mux0_div
.hw
586 .flags
= CLK_SET_RATE_PARENT
,
590 /* Datasheet names this field as "premux1" */
591 static struct clk_regmap g12b_cpub_clk_premux1
= {
592 .data
= &(struct clk_regmap_mux_data
){
593 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
597 .hw
.init
= &(struct clk_init_data
){
598 .name
= "cpub_clk_dyn1_sel",
599 .ops
= &clk_regmap_mux_ops
,
600 .parent_data
= (const struct clk_parent_data
[]) {
601 { .fw_name
= "xtal", },
602 { .hw
= &g12a_fclk_div2
.hw
},
603 { .hw
= &g12a_fclk_div3
.hw
},
606 /* This sub-tree is used a parking clock */
607 .flags
= CLK_SET_RATE_NO_REPARENT
,
611 /* Datasheet names this field as "Mux1_divn_tcnt" */
612 static struct clk_regmap g12b_cpub_clk_mux1_div
= {
613 .data
= &(struct clk_regmap_div_data
){
614 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
618 .hw
.init
= &(struct clk_init_data
){
619 .name
= "cpub_clk_dyn1_div",
620 .ops
= &clk_regmap_divider_ro_ops
,
621 .parent_hws
= (const struct clk_hw
*[]) {
622 &g12b_cpub_clk_premux1
.hw
628 /* Datasheet names this field as "postmux1" */
629 static struct clk_regmap g12b_cpub_clk_postmux1
= {
630 .data
= &(struct clk_regmap_mux_data
){
631 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
635 .hw
.init
= &(struct clk_init_data
){
636 .name
= "cpub_clk_dyn1",
637 .ops
= &clk_regmap_mux_ops
,
638 .parent_hws
= (const struct clk_hw
*[]) {
639 &g12b_cpub_clk_premux1
.hw
,
640 &g12b_cpub_clk_mux1_div
.hw
643 /* This sub-tree is used a parking clock */
644 .flags
= CLK_SET_RATE_NO_REPARENT
,
648 /* Datasheet names this field as "Final_dyn_mux_sel" */
649 static struct clk_regmap g12b_cpub_clk_dyn
= {
650 .data
= &(struct clk_regmap_mux_data
){
651 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
654 .flags
= CLK_MUX_ROUND_CLOSEST
,
656 .hw
.init
= &(struct clk_init_data
){
657 .name
= "cpub_clk_dyn",
658 .ops
= &clk_regmap_mux_ops
,
659 .parent_hws
= (const struct clk_hw
*[]) {
660 &g12b_cpub_clk_postmux0
.hw
,
661 &g12b_cpub_clk_postmux1
.hw
664 .flags
= CLK_SET_RATE_PARENT
,
668 /* Datasheet names this field as "Final_mux_sel" */
669 static struct clk_regmap g12b_cpub_clk
= {
670 .data
= &(struct clk_regmap_mux_data
){
671 .offset
= HHI_SYS_CPUB_CLK_CNTL
,
674 .flags
= CLK_MUX_ROUND_CLOSEST
,
676 .hw
.init
= &(struct clk_init_data
){
678 .ops
= &clk_regmap_mux_ops
,
679 .parent_hws
= (const struct clk_hw
*[]) {
680 &g12b_cpub_clk_dyn
.hw
,
684 .flags
= CLK_SET_RATE_PARENT
,
688 static struct clk_regmap sm1_gp1_pll
;
690 /* Datasheet names this field as "premux0" */
691 static struct clk_regmap sm1_dsu_clk_premux0
= {
692 .data
= &(struct clk_regmap_mux_data
){
693 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
697 .hw
.init
= &(struct clk_init_data
){
698 .name
= "dsu_clk_dyn0_sel",
699 .ops
= &clk_regmap_mux_ro_ops
,
700 .parent_data
= (const struct clk_parent_data
[]) {
701 { .fw_name
= "xtal", },
702 { .hw
= &g12a_fclk_div2
.hw
},
703 { .hw
= &g12a_fclk_div3
.hw
},
704 { .hw
= &sm1_gp1_pll
.hw
},
710 /* Datasheet names this field as "premux1" */
711 static struct clk_regmap sm1_dsu_clk_premux1
= {
712 .data
= &(struct clk_regmap_mux_data
){
713 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
717 .hw
.init
= &(struct clk_init_data
){
718 .name
= "dsu_clk_dyn1_sel",
719 .ops
= &clk_regmap_mux_ro_ops
,
720 .parent_data
= (const struct clk_parent_data
[]) {
721 { .fw_name
= "xtal", },
722 { .hw
= &g12a_fclk_div2
.hw
},
723 { .hw
= &g12a_fclk_div3
.hw
},
724 { .hw
= &sm1_gp1_pll
.hw
},
730 /* Datasheet names this field as "Mux0_divn_tcnt" */
731 static struct clk_regmap sm1_dsu_clk_mux0_div
= {
732 .data
= &(struct clk_regmap_div_data
){
733 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
737 .hw
.init
= &(struct clk_init_data
){
738 .name
= "dsu_clk_dyn0_div",
739 .ops
= &clk_regmap_divider_ro_ops
,
740 .parent_hws
= (const struct clk_hw
*[]) {
741 &sm1_dsu_clk_premux0
.hw
747 /* Datasheet names this field as "postmux0" */
748 static struct clk_regmap sm1_dsu_clk_postmux0
= {
749 .data
= &(struct clk_regmap_mux_data
){
750 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
754 .hw
.init
= &(struct clk_init_data
){
755 .name
= "dsu_clk_dyn0",
756 .ops
= &clk_regmap_mux_ro_ops
,
757 .parent_hws
= (const struct clk_hw
*[]) {
758 &sm1_dsu_clk_premux0
.hw
,
759 &sm1_dsu_clk_mux0_div
.hw
,
765 /* Datasheet names this field as "Mux1_divn_tcnt" */
766 static struct clk_regmap sm1_dsu_clk_mux1_div
= {
767 .data
= &(struct clk_regmap_div_data
){
768 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
772 .hw
.init
= &(struct clk_init_data
){
773 .name
= "dsu_clk_dyn1_div",
774 .ops
= &clk_regmap_divider_ro_ops
,
775 .parent_hws
= (const struct clk_hw
*[]) {
776 &sm1_dsu_clk_premux1
.hw
782 /* Datasheet names this field as "postmux1" */
783 static struct clk_regmap sm1_dsu_clk_postmux1
= {
784 .data
= &(struct clk_regmap_mux_data
){
785 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
789 .hw
.init
= &(struct clk_init_data
){
790 .name
= "dsu_clk_dyn1",
791 .ops
= &clk_regmap_mux_ro_ops
,
792 .parent_hws
= (const struct clk_hw
*[]) {
793 &sm1_dsu_clk_premux1
.hw
,
794 &sm1_dsu_clk_mux1_div
.hw
,
800 /* Datasheet names this field as "Final_dyn_mux_sel" */
801 static struct clk_regmap sm1_dsu_clk_dyn
= {
802 .data
= &(struct clk_regmap_mux_data
){
803 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
807 .hw
.init
= &(struct clk_init_data
){
808 .name
= "dsu_clk_dyn",
809 .ops
= &clk_regmap_mux_ro_ops
,
810 .parent_hws
= (const struct clk_hw
*[]) {
811 &sm1_dsu_clk_postmux0
.hw
,
812 &sm1_dsu_clk_postmux1
.hw
,
818 /* Datasheet names this field as "Final_mux_sel" */
819 static struct clk_regmap sm1_dsu_final_clk
= {
820 .data
= &(struct clk_regmap_mux_data
){
821 .offset
= HHI_SYS_CPU_CLK_CNTL5
,
825 .hw
.init
= &(struct clk_init_data
){
826 .name
= "dsu_clk_final",
827 .ops
= &clk_regmap_mux_ro_ops
,
828 .parent_hws
= (const struct clk_hw
*[]) {
836 /* Datasheet names this field as "Cpu_clk_sync_mux_sel" bit 0 */
837 static struct clk_regmap sm1_cpu1_clk
= {
838 .data
= &(struct clk_regmap_mux_data
){
839 .offset
= HHI_SYS_CPU_CLK_CNTL6
,
843 .hw
.init
= &(struct clk_init_data
){
845 .ops
= &clk_regmap_mux_ro_ops
,
846 .parent_hws
= (const struct clk_hw
*[]) {
848 /* This CPU also have a dedicated clock tree */
854 /* Datasheet names this field as "Cpu_clk_sync_mux_sel" bit 1 */
855 static struct clk_regmap sm1_cpu2_clk
= {
856 .data
= &(struct clk_regmap_mux_data
){
857 .offset
= HHI_SYS_CPU_CLK_CNTL6
,
861 .hw
.init
= &(struct clk_init_data
){
863 .ops
= &clk_regmap_mux_ro_ops
,
864 .parent_hws
= (const struct clk_hw
*[]) {
866 /* This CPU also have a dedicated clock tree */
872 /* Datasheet names this field as "Cpu_clk_sync_mux_sel" bit 2 */
873 static struct clk_regmap sm1_cpu3_clk
= {
874 .data
= &(struct clk_regmap_mux_data
){
875 .offset
= HHI_SYS_CPU_CLK_CNTL6
,
879 .hw
.init
= &(struct clk_init_data
){
881 .ops
= &clk_regmap_mux_ro_ops
,
882 .parent_hws
= (const struct clk_hw
*[]) {
884 /* This CPU also have a dedicated clock tree */
890 /* Datasheet names this field as "Cpu_clk_sync_mux_sel" bit 4 */
891 static struct clk_regmap sm1_dsu_clk
= {
892 .data
= &(struct clk_regmap_mux_data
){
893 .offset
= HHI_SYS_CPU_CLK_CNTL6
,
897 .hw
.init
= &(struct clk_init_data
){
899 .ops
= &clk_regmap_mux_ro_ops
,
900 .parent_hws
= (const struct clk_hw
*[]) {
902 &sm1_dsu_final_clk
.hw
,
908 static int g12a_cpu_clk_mux_notifier_cb(struct notifier_block
*nb
,
909 unsigned long event
, void *data
)
911 if (event
== POST_RATE_CHANGE
|| event
== PRE_RATE_CHANGE
) {
912 /* Wait for clock propagation before/after changing the mux */
920 static struct notifier_block g12a_cpu_clk_mux_nb
= {
921 .notifier_call
= g12a_cpu_clk_mux_notifier_cb
,
924 struct g12a_cpu_clk_postmux_nb_data
{
925 struct notifier_block nb
;
927 struct clk_hw
*cpu_clk_dyn
;
928 struct clk_hw
*cpu_clk_postmux0
;
929 struct clk_hw
*cpu_clk_postmux1
;
930 struct clk_hw
*cpu_clk_premux1
;
933 static int g12a_cpu_clk_postmux_notifier_cb(struct notifier_block
*nb
,
934 unsigned long event
, void *data
)
936 struct g12a_cpu_clk_postmux_nb_data
*nb_data
=
937 container_of(nb
, struct g12a_cpu_clk_postmux_nb_data
, nb
);
940 case PRE_RATE_CHANGE
:
942 * This notifier means cpu_clk_postmux0 clock will be changed
943 * to feed cpu_clk, this is the current path :
946 * \- cpu_clk_postmux0
947 * \- cpu_clk_muxX_div
949 * \- fclk_div3 or fclk_div2
952 * \- fclk_div3 or fclk_div2
955 /* Setup cpu_clk_premux1 to xtal */
956 clk_hw_set_parent(nb_data
->cpu_clk_premux1
,
959 /* Setup cpu_clk_postmux1 to bypass divider */
960 clk_hw_set_parent(nb_data
->cpu_clk_postmux1
,
961 nb_data
->cpu_clk_premux1
);
963 /* Switch to parking clk on cpu_clk_postmux1 */
964 clk_hw_set_parent(nb_data
->cpu_clk_dyn
,
965 nb_data
->cpu_clk_postmux1
);
968 * Now, cpu_clk is 24MHz in the current path :
971 * \- cpu_clk_postmux1
980 case POST_RATE_CHANGE
:
982 * The cpu_clk_postmux0 has ben updated, now switch back
983 * cpu_clk_dyn to cpu_clk_postmux0 and take the changes
987 /* Configure cpu_clk_dyn back to cpu_clk_postmux0 */
988 clk_hw_set_parent(nb_data
->cpu_clk_dyn
,
989 nb_data
->cpu_clk_postmux0
);
995 * \- cpu_clk_postmux0
996 * \- cpu_clk_muxX_div
998 * \- fclk_div3 or fclk_div2
1000 * \- cpu_clk_premux0
1001 * \- fclk_div3 or fclk_div2
1013 static struct g12a_cpu_clk_postmux_nb_data g12a_cpu_clk_postmux0_nb_data
= {
1014 .cpu_clk_dyn
= &g12a_cpu_clk_dyn
.hw
,
1015 .cpu_clk_postmux0
= &g12a_cpu_clk_postmux0
.hw
,
1016 .cpu_clk_postmux1
= &g12a_cpu_clk_postmux1
.hw
,
1017 .cpu_clk_premux1
= &g12a_cpu_clk_premux1
.hw
,
1018 .nb
.notifier_call
= g12a_cpu_clk_postmux_notifier_cb
,
1021 static struct g12a_cpu_clk_postmux_nb_data g12b_cpub_clk_postmux0_nb_data
= {
1022 .cpu_clk_dyn
= &g12b_cpub_clk_dyn
.hw
,
1023 .cpu_clk_postmux0
= &g12b_cpub_clk_postmux0
.hw
,
1024 .cpu_clk_postmux1
= &g12b_cpub_clk_postmux1
.hw
,
1025 .cpu_clk_premux1
= &g12b_cpub_clk_premux1
.hw
,
1026 .nb
.notifier_call
= g12a_cpu_clk_postmux_notifier_cb
,
1029 struct g12a_sys_pll_nb_data
{
1030 struct notifier_block nb
;
1031 struct clk_hw
*sys_pll
;
1032 struct clk_hw
*cpu_clk
;
1033 struct clk_hw
*cpu_clk_dyn
;
1036 static int g12a_sys_pll_notifier_cb(struct notifier_block
*nb
,
1037 unsigned long event
, void *data
)
1039 struct g12a_sys_pll_nb_data
*nb_data
=
1040 container_of(nb
, struct g12a_sys_pll_nb_data
, nb
);
1043 case PRE_RATE_CHANGE
:
1045 * This notifier means sys_pll clock will be changed
1046 * to feed cpu_clk, this the current path :
1052 /* Configure cpu_clk to use cpu_clk_dyn */
1053 clk_hw_set_parent(nb_data
->cpu_clk
,
1054 nb_data
->cpu_clk_dyn
);
1057 * Now, cpu_clk uses the dyn path
1061 * \- cpu_clk_dynX_sel
1062 * \- cpu_clk_dynX_div
1063 * \- xtal/fclk_div2/fclk_div3
1064 * \- xtal/fclk_div2/fclk_div3
1071 case POST_RATE_CHANGE
:
1073 * The sys_pll has ben updated, now switch back cpu_clk to
1077 /* Configure cpu_clk to use sys_pll */
1078 clk_hw_set_parent(nb_data
->cpu_clk
,
1096 static struct g12a_sys_pll_nb_data g12a_sys_pll_nb_data
= {
1097 .sys_pll
= &g12a_sys_pll
.hw
,
1098 .cpu_clk
= &g12a_cpu_clk
.hw
,
1099 .cpu_clk_dyn
= &g12a_cpu_clk_dyn
.hw
,
1100 .nb
.notifier_call
= g12a_sys_pll_notifier_cb
,
1103 /* G12B first CPU cluster uses sys1_pll */
1104 static struct g12a_sys_pll_nb_data g12b_cpu_clk_sys1_pll_nb_data
= {
1105 .sys_pll
= &g12b_sys1_pll
.hw
,
1106 .cpu_clk
= &g12b_cpu_clk
.hw
,
1107 .cpu_clk_dyn
= &g12a_cpu_clk_dyn
.hw
,
1108 .nb
.notifier_call
= g12a_sys_pll_notifier_cb
,
1111 /* G12B second CPU cluster uses sys_pll */
1112 static struct g12a_sys_pll_nb_data g12b_cpub_clk_sys_pll_nb_data
= {
1113 .sys_pll
= &g12a_sys_pll
.hw
,
1114 .cpu_clk
= &g12b_cpub_clk
.hw
,
1115 .cpu_clk_dyn
= &g12b_cpub_clk_dyn
.hw
,
1116 .nb
.notifier_call
= g12a_sys_pll_notifier_cb
,
1119 static struct clk_regmap g12a_cpu_clk_div16_en
= {
1120 .data
= &(struct clk_regmap_gate_data
){
1121 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1124 .hw
.init
= &(struct clk_init_data
) {
1125 .name
= "cpu_clk_div16_en",
1126 .ops
= &clk_regmap_gate_ro_ops
,
1127 .parent_hws
= (const struct clk_hw
*[]) {
1132 * This clock is used to debug the cpu_clk range
1133 * Linux should not change it at runtime
1138 static struct clk_regmap g12b_cpub_clk_div16_en
= {
1139 .data
= &(struct clk_regmap_gate_data
){
1140 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1143 .hw
.init
= &(struct clk_init_data
) {
1144 .name
= "cpub_clk_div16_en",
1145 .ops
= &clk_regmap_gate_ro_ops
,
1146 .parent_hws
= (const struct clk_hw
*[]) {
1151 * This clock is used to debug the cpu_clk range
1152 * Linux should not change it at runtime
1157 static struct clk_fixed_factor g12a_cpu_clk_div16
= {
1160 .hw
.init
= &(struct clk_init_data
){
1161 .name
= "cpu_clk_div16",
1162 .ops
= &clk_fixed_factor_ops
,
1163 .parent_hws
= (const struct clk_hw
*[]) {
1164 &g12a_cpu_clk_div16_en
.hw
1170 static struct clk_fixed_factor g12b_cpub_clk_div16
= {
1173 .hw
.init
= &(struct clk_init_data
){
1174 .name
= "cpub_clk_div16",
1175 .ops
= &clk_fixed_factor_ops
,
1176 .parent_hws
= (const struct clk_hw
*[]) {
1177 &g12b_cpub_clk_div16_en
.hw
1183 static struct clk_regmap g12a_cpu_clk_apb_div
= {
1184 .data
= &(struct clk_regmap_div_data
){
1185 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1188 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1190 .hw
.init
= &(struct clk_init_data
){
1191 .name
= "cpu_clk_apb_div",
1192 .ops
= &clk_regmap_divider_ro_ops
,
1193 .parent_hws
= (const struct clk_hw
*[]) { &g12a_cpu_clk
.hw
},
1198 static struct clk_regmap g12a_cpu_clk_apb
= {
1199 .data
= &(struct clk_regmap_gate_data
){
1200 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1203 .hw
.init
= &(struct clk_init_data
) {
1204 .name
= "cpu_clk_apb",
1205 .ops
= &clk_regmap_gate_ro_ops
,
1206 .parent_hws
= (const struct clk_hw
*[]) {
1207 &g12a_cpu_clk_apb_div
.hw
1211 * This clock is set by the ROM monitor code,
1212 * Linux should not change it at runtime
1217 static struct clk_regmap g12a_cpu_clk_atb_div
= {
1218 .data
= &(struct clk_regmap_div_data
){
1219 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1222 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1224 .hw
.init
= &(struct clk_init_data
){
1225 .name
= "cpu_clk_atb_div",
1226 .ops
= &clk_regmap_divider_ro_ops
,
1227 .parent_hws
= (const struct clk_hw
*[]) { &g12a_cpu_clk
.hw
},
1232 static struct clk_regmap g12a_cpu_clk_atb
= {
1233 .data
= &(struct clk_regmap_gate_data
){
1234 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1237 .hw
.init
= &(struct clk_init_data
) {
1238 .name
= "cpu_clk_atb",
1239 .ops
= &clk_regmap_gate_ro_ops
,
1240 .parent_hws
= (const struct clk_hw
*[]) {
1241 &g12a_cpu_clk_atb_div
.hw
1245 * This clock is set by the ROM monitor code,
1246 * Linux should not change it at runtime
1251 static struct clk_regmap g12a_cpu_clk_axi_div
= {
1252 .data
= &(struct clk_regmap_div_data
){
1253 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1256 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1258 .hw
.init
= &(struct clk_init_data
){
1259 .name
= "cpu_clk_axi_div",
1260 .ops
= &clk_regmap_divider_ro_ops
,
1261 .parent_hws
= (const struct clk_hw
*[]) { &g12a_cpu_clk
.hw
},
1266 static struct clk_regmap g12a_cpu_clk_axi
= {
1267 .data
= &(struct clk_regmap_gate_data
){
1268 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1271 .hw
.init
= &(struct clk_init_data
) {
1272 .name
= "cpu_clk_axi",
1273 .ops
= &clk_regmap_gate_ro_ops
,
1274 .parent_hws
= (const struct clk_hw
*[]) {
1275 &g12a_cpu_clk_axi_div
.hw
1279 * This clock is set by the ROM monitor code,
1280 * Linux should not change it at runtime
1285 static struct clk_regmap g12a_cpu_clk_trace_div
= {
1286 .data
= &(struct clk_regmap_div_data
){
1287 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1290 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1292 .hw
.init
= &(struct clk_init_data
){
1293 .name
= "cpu_clk_trace_div",
1294 .ops
= &clk_regmap_divider_ro_ops
,
1295 .parent_data
= &(const struct clk_parent_data
) {
1298 * G12A and G12B have different cpu_clks (with
1299 * different struct clk_hw). We fallback to the global
1300 * naming string mechanism so cpu_clk_trace_div picks
1301 * up the appropriate one.
1310 static struct clk_regmap g12a_cpu_clk_trace
= {
1311 .data
= &(struct clk_regmap_gate_data
){
1312 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1315 .hw
.init
= &(struct clk_init_data
) {
1316 .name
= "cpu_clk_trace",
1317 .ops
= &clk_regmap_gate_ro_ops
,
1318 .parent_hws
= (const struct clk_hw
*[]) {
1319 &g12a_cpu_clk_trace_div
.hw
1323 * This clock is set by the ROM monitor code,
1324 * Linux should not change it at runtime
1329 static struct clk_fixed_factor g12b_cpub_clk_div2
= {
1332 .hw
.init
= &(struct clk_init_data
){
1333 .name
= "cpub_clk_div2",
1334 .ops
= &clk_fixed_factor_ops
,
1335 .parent_hws
= (const struct clk_hw
*[]) {
1342 static struct clk_fixed_factor g12b_cpub_clk_div3
= {
1345 .hw
.init
= &(struct clk_init_data
){
1346 .name
= "cpub_clk_div3",
1347 .ops
= &clk_fixed_factor_ops
,
1348 .parent_hws
= (const struct clk_hw
*[]) {
1355 static struct clk_fixed_factor g12b_cpub_clk_div4
= {
1358 .hw
.init
= &(struct clk_init_data
){
1359 .name
= "cpub_clk_div4",
1360 .ops
= &clk_fixed_factor_ops
,
1361 .parent_hws
= (const struct clk_hw
*[]) {
1368 static struct clk_fixed_factor g12b_cpub_clk_div5
= {
1371 .hw
.init
= &(struct clk_init_data
){
1372 .name
= "cpub_clk_div5",
1373 .ops
= &clk_fixed_factor_ops
,
1374 .parent_hws
= (const struct clk_hw
*[]) {
1381 static struct clk_fixed_factor g12b_cpub_clk_div6
= {
1384 .hw
.init
= &(struct clk_init_data
){
1385 .name
= "cpub_clk_div6",
1386 .ops
= &clk_fixed_factor_ops
,
1387 .parent_hws
= (const struct clk_hw
*[]) {
1394 static struct clk_fixed_factor g12b_cpub_clk_div7
= {
1397 .hw
.init
= &(struct clk_init_data
){
1398 .name
= "cpub_clk_div7",
1399 .ops
= &clk_fixed_factor_ops
,
1400 .parent_hws
= (const struct clk_hw
*[]) {
1407 static struct clk_fixed_factor g12b_cpub_clk_div8
= {
1410 .hw
.init
= &(struct clk_init_data
){
1411 .name
= "cpub_clk_div8",
1412 .ops
= &clk_fixed_factor_ops
,
1413 .parent_hws
= (const struct clk_hw
*[]) {
1420 static u32 mux_table_cpub
[] = { 1, 2, 3, 4, 5, 6, 7 };
1421 static struct clk_regmap g12b_cpub_clk_apb_sel
= {
1422 .data
= &(struct clk_regmap_mux_data
){
1423 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1426 .table
= mux_table_cpub
,
1428 .hw
.init
= &(struct clk_init_data
){
1429 .name
= "cpub_clk_apb_sel",
1430 .ops
= &clk_regmap_mux_ro_ops
,
1431 .parent_hws
= (const struct clk_hw
*[]) {
1432 &g12b_cpub_clk_div2
.hw
,
1433 &g12b_cpub_clk_div3
.hw
,
1434 &g12b_cpub_clk_div4
.hw
,
1435 &g12b_cpub_clk_div5
.hw
,
1436 &g12b_cpub_clk_div6
.hw
,
1437 &g12b_cpub_clk_div7
.hw
,
1438 &g12b_cpub_clk_div8
.hw
1444 static struct clk_regmap g12b_cpub_clk_apb
= {
1445 .data
= &(struct clk_regmap_gate_data
){
1446 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1448 .flags
= CLK_GATE_SET_TO_DISABLE
,
1450 .hw
.init
= &(struct clk_init_data
) {
1451 .name
= "cpub_clk_apb",
1452 .ops
= &clk_regmap_gate_ro_ops
,
1453 .parent_hws
= (const struct clk_hw
*[]) {
1454 &g12b_cpub_clk_apb_sel
.hw
1458 * This clock is set by the ROM monitor code,
1459 * Linux should not change it at runtime
1464 static struct clk_regmap g12b_cpub_clk_atb_sel
= {
1465 .data
= &(struct clk_regmap_mux_data
){
1466 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1469 .table
= mux_table_cpub
,
1471 .hw
.init
= &(struct clk_init_data
){
1472 .name
= "cpub_clk_atb_sel",
1473 .ops
= &clk_regmap_mux_ro_ops
,
1474 .parent_hws
= (const struct clk_hw
*[]) {
1475 &g12b_cpub_clk_div2
.hw
,
1476 &g12b_cpub_clk_div3
.hw
,
1477 &g12b_cpub_clk_div4
.hw
,
1478 &g12b_cpub_clk_div5
.hw
,
1479 &g12b_cpub_clk_div6
.hw
,
1480 &g12b_cpub_clk_div7
.hw
,
1481 &g12b_cpub_clk_div8
.hw
1487 static struct clk_regmap g12b_cpub_clk_atb
= {
1488 .data
= &(struct clk_regmap_gate_data
){
1489 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1491 .flags
= CLK_GATE_SET_TO_DISABLE
,
1493 .hw
.init
= &(struct clk_init_data
) {
1494 .name
= "cpub_clk_atb",
1495 .ops
= &clk_regmap_gate_ro_ops
,
1496 .parent_hws
= (const struct clk_hw
*[]) {
1497 &g12b_cpub_clk_atb_sel
.hw
1501 * This clock is set by the ROM monitor code,
1502 * Linux should not change it at runtime
1507 static struct clk_regmap g12b_cpub_clk_axi_sel
= {
1508 .data
= &(struct clk_regmap_mux_data
){
1509 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1512 .table
= mux_table_cpub
,
1514 .hw
.init
= &(struct clk_init_data
){
1515 .name
= "cpub_clk_axi_sel",
1516 .ops
= &clk_regmap_mux_ro_ops
,
1517 .parent_hws
= (const struct clk_hw
*[]) {
1518 &g12b_cpub_clk_div2
.hw
,
1519 &g12b_cpub_clk_div3
.hw
,
1520 &g12b_cpub_clk_div4
.hw
,
1521 &g12b_cpub_clk_div5
.hw
,
1522 &g12b_cpub_clk_div6
.hw
,
1523 &g12b_cpub_clk_div7
.hw
,
1524 &g12b_cpub_clk_div8
.hw
1530 static struct clk_regmap g12b_cpub_clk_axi
= {
1531 .data
= &(struct clk_regmap_gate_data
){
1532 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1534 .flags
= CLK_GATE_SET_TO_DISABLE
,
1536 .hw
.init
= &(struct clk_init_data
) {
1537 .name
= "cpub_clk_axi",
1538 .ops
= &clk_regmap_gate_ro_ops
,
1539 .parent_hws
= (const struct clk_hw
*[]) {
1540 &g12b_cpub_clk_axi_sel
.hw
1544 * This clock is set by the ROM monitor code,
1545 * Linux should not change it at runtime
1550 static struct clk_regmap g12b_cpub_clk_trace_sel
= {
1551 .data
= &(struct clk_regmap_mux_data
){
1552 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1555 .table
= mux_table_cpub
,
1557 .hw
.init
= &(struct clk_init_data
){
1558 .name
= "cpub_clk_trace_sel",
1559 .ops
= &clk_regmap_mux_ro_ops
,
1560 .parent_hws
= (const struct clk_hw
*[]) {
1561 &g12b_cpub_clk_div2
.hw
,
1562 &g12b_cpub_clk_div3
.hw
,
1563 &g12b_cpub_clk_div4
.hw
,
1564 &g12b_cpub_clk_div5
.hw
,
1565 &g12b_cpub_clk_div6
.hw
,
1566 &g12b_cpub_clk_div7
.hw
,
1567 &g12b_cpub_clk_div8
.hw
1573 static struct clk_regmap g12b_cpub_clk_trace
= {
1574 .data
= &(struct clk_regmap_gate_data
){
1575 .offset
= HHI_SYS_CPUB_CLK_CNTL1
,
1577 .flags
= CLK_GATE_SET_TO_DISABLE
,
1579 .hw
.init
= &(struct clk_init_data
) {
1580 .name
= "cpub_clk_trace",
1581 .ops
= &clk_regmap_gate_ro_ops
,
1582 .parent_hws
= (const struct clk_hw
*[]) {
1583 &g12b_cpub_clk_trace_sel
.hw
1587 * This clock is set by the ROM monitor code,
1588 * Linux should not change it at runtime
1593 static const struct pll_mult_range g12a_gp0_pll_mult_range
= {
1599 * Internal gp0 pll emulation configuration parameters
1601 static const struct reg_sequence g12a_gp0_init_regs
[] = {
1602 { .reg
= HHI_GP0_PLL_CNTL1
, .def
= 0x00000000 },
1603 { .reg
= HHI_GP0_PLL_CNTL2
, .def
= 0x00000000 },
1604 { .reg
= HHI_GP0_PLL_CNTL3
, .def
= 0x48681c00 },
1605 { .reg
= HHI_GP0_PLL_CNTL4
, .def
= 0x33771290 },
1606 { .reg
= HHI_GP0_PLL_CNTL5
, .def
= 0x39272000 },
1607 { .reg
= HHI_GP0_PLL_CNTL6
, .def
= 0x56540000 },
1610 static struct clk_regmap g12a_gp0_pll_dco
= {
1611 .data
= &(struct meson_clk_pll_data
){
1613 .reg_off
= HHI_GP0_PLL_CNTL0
,
1618 .reg_off
= HHI_GP0_PLL_CNTL0
,
1623 .reg_off
= HHI_GP0_PLL_CNTL0
,
1628 .reg_off
= HHI_GP0_PLL_CNTL1
,
1633 .reg_off
= HHI_GP0_PLL_CNTL0
,
1638 .reg_off
= HHI_GP0_PLL_CNTL0
,
1642 .range
= &g12a_gp0_pll_mult_range
,
1643 .init_regs
= g12a_gp0_init_regs
,
1644 .init_count
= ARRAY_SIZE(g12a_gp0_init_regs
),
1646 .hw
.init
= &(struct clk_init_data
){
1647 .name
= "gp0_pll_dco",
1648 .ops
= &meson_clk_pll_ops
,
1649 .parent_data
= &(const struct clk_parent_data
) {
1656 static struct clk_regmap g12a_gp0_pll
= {
1657 .data
= &(struct clk_regmap_div_data
){
1658 .offset
= HHI_GP0_PLL_CNTL0
,
1661 .flags
= (CLK_DIVIDER_POWER_OF_TWO
|
1662 CLK_DIVIDER_ROUND_CLOSEST
),
1664 .hw
.init
= &(struct clk_init_data
){
1666 .ops
= &clk_regmap_divider_ops
,
1667 .parent_hws
= (const struct clk_hw
*[]) {
1668 &g12a_gp0_pll_dco
.hw
1671 .flags
= CLK_SET_RATE_PARENT
,
1675 static struct clk_regmap sm1_gp1_pll_dco
= {
1676 .data
= &(struct meson_clk_pll_data
){
1678 .reg_off
= HHI_GP1_PLL_CNTL0
,
1683 .reg_off
= HHI_GP1_PLL_CNTL0
,
1688 .reg_off
= HHI_GP1_PLL_CNTL0
,
1693 .reg_off
= HHI_GP1_PLL_CNTL1
,
1698 .reg_off
= HHI_GP1_PLL_CNTL0
,
1703 .reg_off
= HHI_GP1_PLL_CNTL0
,
1708 .hw
.init
= &(struct clk_init_data
){
1709 .name
= "gp1_pll_dco",
1710 .ops
= &meson_clk_pll_ro_ops
,
1711 .parent_data
= &(const struct clk_parent_data
) {
1715 /* This clock feeds the DSU, avoid disabling it */
1716 .flags
= CLK_IS_CRITICAL
,
1720 static struct clk_regmap sm1_gp1_pll
= {
1721 .data
= &(struct clk_regmap_div_data
){
1722 .offset
= HHI_GP1_PLL_CNTL0
,
1725 .flags
= (CLK_DIVIDER_POWER_OF_TWO
|
1726 CLK_DIVIDER_ROUND_CLOSEST
),
1728 .hw
.init
= &(struct clk_init_data
){
1730 .ops
= &clk_regmap_divider_ro_ops
,
1731 .parent_hws
= (const struct clk_hw
*[]) {
1739 * Internal hifi pll emulation configuration parameters
1741 static const struct reg_sequence g12a_hifi_init_regs
[] = {
1742 { .reg
= HHI_HIFI_PLL_CNTL1
, .def
= 0x00000000 },
1743 { .reg
= HHI_HIFI_PLL_CNTL2
, .def
= 0x00000000 },
1744 { .reg
= HHI_HIFI_PLL_CNTL3
, .def
= 0x6a285c00 },
1745 { .reg
= HHI_HIFI_PLL_CNTL4
, .def
= 0x65771290 },
1746 { .reg
= HHI_HIFI_PLL_CNTL5
, .def
= 0x39272000 },
1747 { .reg
= HHI_HIFI_PLL_CNTL6
, .def
= 0x56540000 },
1750 static struct clk_regmap g12a_hifi_pll_dco
= {
1751 .data
= &(struct meson_clk_pll_data
){
1753 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1758 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1763 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1768 .reg_off
= HHI_HIFI_PLL_CNTL1
,
1773 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1778 .reg_off
= HHI_HIFI_PLL_CNTL0
,
1782 .range
= &g12a_gp0_pll_mult_range
,
1783 .init_regs
= g12a_hifi_init_regs
,
1784 .init_count
= ARRAY_SIZE(g12a_hifi_init_regs
),
1785 .flags
= CLK_MESON_PLL_ROUND_CLOSEST
,
1787 .hw
.init
= &(struct clk_init_data
){
1788 .name
= "hifi_pll_dco",
1789 .ops
= &meson_clk_pll_ops
,
1790 .parent_data
= &(const struct clk_parent_data
) {
1797 static struct clk_regmap g12a_hifi_pll
= {
1798 .data
= &(struct clk_regmap_div_data
){
1799 .offset
= HHI_HIFI_PLL_CNTL0
,
1802 .flags
= (CLK_DIVIDER_POWER_OF_TWO
|
1803 CLK_DIVIDER_ROUND_CLOSEST
),
1805 .hw
.init
= &(struct clk_init_data
){
1807 .ops
= &clk_regmap_divider_ops
,
1808 .parent_hws
= (const struct clk_hw
*[]) {
1809 &g12a_hifi_pll_dco
.hw
1812 .flags
= CLK_SET_RATE_PARENT
,
1817 * The Meson G12A PCIE PLL is fined tuned to deliver a very precise
1818 * 100MHz reference clock for the PCIe Analog PHY, and thus requires
1819 * a strict register sequence to enable the PLL.
1821 static const struct reg_sequence g12a_pcie_pll_init_regs
[] = {
1822 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x20090496 },
1823 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x30090496 },
1824 { .reg
= HHI_PCIE_PLL_CNTL1
, .def
= 0x00000000 },
1825 { .reg
= HHI_PCIE_PLL_CNTL2
, .def
= 0x00001100 },
1826 { .reg
= HHI_PCIE_PLL_CNTL3
, .def
= 0x10058e00 },
1827 { .reg
= HHI_PCIE_PLL_CNTL4
, .def
= 0x000100c0 },
1828 { .reg
= HHI_PCIE_PLL_CNTL5
, .def
= 0x68000048 },
1829 { .reg
= HHI_PCIE_PLL_CNTL5
, .def
= 0x68000068, .delay_us
= 20 },
1830 { .reg
= HHI_PCIE_PLL_CNTL4
, .def
= 0x008100c0, .delay_us
= 10 },
1831 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x34090496 },
1832 { .reg
= HHI_PCIE_PLL_CNTL0
, .def
= 0x14090496, .delay_us
= 10 },
1833 { .reg
= HHI_PCIE_PLL_CNTL2
, .def
= 0x00001000 },
1836 /* Keep a single entry table for recalc/round_rate() ops */
1837 static const struct pll_params_table g12a_pcie_pll_table
[] = {
1842 static struct clk_regmap g12a_pcie_pll_dco
= {
1843 .data
= &(struct meson_clk_pll_data
){
1845 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1850 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1855 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1860 .reg_off
= HHI_PCIE_PLL_CNTL1
,
1865 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1870 .reg_off
= HHI_PCIE_PLL_CNTL0
,
1874 .table
= g12a_pcie_pll_table
,
1875 .init_regs
= g12a_pcie_pll_init_regs
,
1876 .init_count
= ARRAY_SIZE(g12a_pcie_pll_init_regs
),
1878 .hw
.init
= &(struct clk_init_data
){
1879 .name
= "pcie_pll_dco",
1880 .ops
= &meson_clk_pcie_pll_ops
,
1881 .parent_data
= &(const struct clk_parent_data
) {
1888 static struct clk_fixed_factor g12a_pcie_pll_dco_div2
= {
1891 .hw
.init
= &(struct clk_init_data
){
1892 .name
= "pcie_pll_dco_div2",
1893 .ops
= &clk_fixed_factor_ops
,
1894 .parent_hws
= (const struct clk_hw
*[]) {
1895 &g12a_pcie_pll_dco
.hw
1898 .flags
= CLK_SET_RATE_PARENT
,
1902 static struct clk_regmap g12a_pcie_pll_od
= {
1903 .data
= &(struct clk_regmap_div_data
){
1904 .offset
= HHI_PCIE_PLL_CNTL0
,
1907 .flags
= CLK_DIVIDER_ROUND_CLOSEST
|
1908 CLK_DIVIDER_ONE_BASED
|
1909 CLK_DIVIDER_ALLOW_ZERO
,
1911 .hw
.init
= &(struct clk_init_data
){
1912 .name
= "pcie_pll_od",
1913 .ops
= &clk_regmap_divider_ops
,
1914 .parent_hws
= (const struct clk_hw
*[]) {
1915 &g12a_pcie_pll_dco_div2
.hw
1918 .flags
= CLK_SET_RATE_PARENT
,
1922 static struct clk_fixed_factor g12a_pcie_pll
= {
1925 .hw
.init
= &(struct clk_init_data
){
1926 .name
= "pcie_pll_pll",
1927 .ops
= &clk_fixed_factor_ops
,
1928 .parent_hws
= (const struct clk_hw
*[]) {
1929 &g12a_pcie_pll_od
.hw
1932 .flags
= CLK_SET_RATE_PARENT
,
1936 static struct clk_regmap g12a_hdmi_pll_dco
= {
1937 .data
= &(struct meson_clk_pll_data
){
1939 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1944 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1949 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1954 .reg_off
= HHI_HDMI_PLL_CNTL1
,
1959 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1964 .reg_off
= HHI_HDMI_PLL_CNTL0
,
1969 .hw
.init
= &(struct clk_init_data
){
1970 .name
= "hdmi_pll_dco",
1971 .ops
= &meson_clk_pll_ro_ops
,
1972 .parent_data
= &(const struct clk_parent_data
) {
1977 * Display directly handle hdmi pll registers ATM, we need
1978 * NOCACHE to keep our view of the clock as accurate as possible
1980 .flags
= CLK_GET_RATE_NOCACHE
,
1984 static struct clk_regmap g12a_hdmi_pll_od
= {
1985 .data
= &(struct clk_regmap_div_data
){
1986 .offset
= HHI_HDMI_PLL_CNTL0
,
1989 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1991 .hw
.init
= &(struct clk_init_data
){
1992 .name
= "hdmi_pll_od",
1993 .ops
= &clk_regmap_divider_ro_ops
,
1994 .parent_hws
= (const struct clk_hw
*[]) {
1995 &g12a_hdmi_pll_dco
.hw
1998 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
2002 static struct clk_regmap g12a_hdmi_pll_od2
= {
2003 .data
= &(struct clk_regmap_div_data
){
2004 .offset
= HHI_HDMI_PLL_CNTL0
,
2007 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
2009 .hw
.init
= &(struct clk_init_data
){
2010 .name
= "hdmi_pll_od2",
2011 .ops
= &clk_regmap_divider_ro_ops
,
2012 .parent_hws
= (const struct clk_hw
*[]) {
2013 &g12a_hdmi_pll_od
.hw
2016 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
2020 static struct clk_regmap g12a_hdmi_pll
= {
2021 .data
= &(struct clk_regmap_div_data
){
2022 .offset
= HHI_HDMI_PLL_CNTL0
,
2025 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
2027 .hw
.init
= &(struct clk_init_data
){
2029 .ops
= &clk_regmap_divider_ro_ops
,
2030 .parent_hws
= (const struct clk_hw
*[]) {
2031 &g12a_hdmi_pll_od2
.hw
2034 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
2038 static struct clk_fixed_factor g12a_fclk_div4_div
= {
2041 .hw
.init
= &(struct clk_init_data
){
2042 .name
= "fclk_div4_div",
2043 .ops
= &clk_fixed_factor_ops
,
2044 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
2049 static struct clk_regmap g12a_fclk_div4
= {
2050 .data
= &(struct clk_regmap_gate_data
){
2051 .offset
= HHI_FIX_PLL_CNTL1
,
2054 .hw
.init
= &(struct clk_init_data
){
2055 .name
= "fclk_div4",
2056 .ops
= &clk_regmap_gate_ops
,
2057 .parent_hws
= (const struct clk_hw
*[]) {
2058 &g12a_fclk_div4_div
.hw
2064 static struct clk_fixed_factor g12a_fclk_div5_div
= {
2067 .hw
.init
= &(struct clk_init_data
){
2068 .name
= "fclk_div5_div",
2069 .ops
= &clk_fixed_factor_ops
,
2070 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
2075 static struct clk_regmap g12a_fclk_div5
= {
2076 .data
= &(struct clk_regmap_gate_data
){
2077 .offset
= HHI_FIX_PLL_CNTL1
,
2080 .hw
.init
= &(struct clk_init_data
){
2081 .name
= "fclk_div5",
2082 .ops
= &clk_regmap_gate_ops
,
2083 .parent_hws
= (const struct clk_hw
*[]) {
2084 &g12a_fclk_div5_div
.hw
2090 static struct clk_fixed_factor g12a_fclk_div7_div
= {
2093 .hw
.init
= &(struct clk_init_data
){
2094 .name
= "fclk_div7_div",
2095 .ops
= &clk_fixed_factor_ops
,
2096 .parent_hws
= (const struct clk_hw
*[]) { &g12a_fixed_pll
.hw
},
2101 static struct clk_regmap g12a_fclk_div7
= {
2102 .data
= &(struct clk_regmap_gate_data
){
2103 .offset
= HHI_FIX_PLL_CNTL1
,
2106 .hw
.init
= &(struct clk_init_data
){
2107 .name
= "fclk_div7",
2108 .ops
= &clk_regmap_gate_ops
,
2109 .parent_hws
= (const struct clk_hw
*[]) {
2110 &g12a_fclk_div7_div
.hw
2116 static struct clk_fixed_factor g12a_fclk_div2p5_div
= {
2119 .hw
.init
= &(struct clk_init_data
){
2120 .name
= "fclk_div2p5_div",
2121 .ops
= &clk_fixed_factor_ops
,
2122 .parent_hws
= (const struct clk_hw
*[]) {
2123 &g12a_fixed_pll_dco
.hw
2129 static struct clk_regmap g12a_fclk_div2p5
= {
2130 .data
= &(struct clk_regmap_gate_data
){
2131 .offset
= HHI_FIX_PLL_CNTL1
,
2134 .hw
.init
= &(struct clk_init_data
){
2135 .name
= "fclk_div2p5",
2136 .ops
= &clk_regmap_gate_ops
,
2137 .parent_hws
= (const struct clk_hw
*[]) {
2138 &g12a_fclk_div2p5_div
.hw
2144 static struct clk_fixed_factor g12a_mpll_50m_div
= {
2147 .hw
.init
= &(struct clk_init_data
){
2148 .name
= "mpll_50m_div",
2149 .ops
= &clk_fixed_factor_ops
,
2150 .parent_hws
= (const struct clk_hw
*[]) {
2151 &g12a_fixed_pll_dco
.hw
2157 static struct clk_regmap g12a_mpll_50m
= {
2158 .data
= &(struct clk_regmap_mux_data
){
2159 .offset
= HHI_FIX_PLL_CNTL3
,
2163 .hw
.init
= &(struct clk_init_data
){
2165 .ops
= &clk_regmap_mux_ro_ops
,
2166 .parent_data
= (const struct clk_parent_data
[]) {
2167 { .fw_name
= "xtal", },
2168 { .hw
= &g12a_mpll_50m_div
.hw
},
2174 static struct clk_fixed_factor g12a_mpll_prediv
= {
2177 .hw
.init
= &(struct clk_init_data
){
2178 .name
= "mpll_prediv",
2179 .ops
= &clk_fixed_factor_ops
,
2180 .parent_hws
= (const struct clk_hw
*[]) {
2181 &g12a_fixed_pll_dco
.hw
2187 static const struct reg_sequence g12a_mpll0_init_regs
[] = {
2188 { .reg
= HHI_MPLL_CNTL2
, .def
= 0x40000033 },
2191 static struct clk_regmap g12a_mpll0_div
= {
2192 .data
= &(struct meson_clk_mpll_data
){
2194 .reg_off
= HHI_MPLL_CNTL1
,
2199 .reg_off
= HHI_MPLL_CNTL1
,
2204 .reg_off
= HHI_MPLL_CNTL1
,
2209 .reg_off
= HHI_MPLL_CNTL1
,
2213 .lock
= &meson_clk_lock
,
2214 .init_regs
= g12a_mpll0_init_regs
,
2215 .init_count
= ARRAY_SIZE(g12a_mpll0_init_regs
),
2217 .hw
.init
= &(struct clk_init_data
){
2218 .name
= "mpll0_div",
2219 .ops
= &meson_clk_mpll_ops
,
2220 .parent_hws
= (const struct clk_hw
*[]) {
2221 &g12a_mpll_prediv
.hw
2227 static struct clk_regmap g12a_mpll0
= {
2228 .data
= &(struct clk_regmap_gate_data
){
2229 .offset
= HHI_MPLL_CNTL1
,
2232 .hw
.init
= &(struct clk_init_data
){
2234 .ops
= &clk_regmap_gate_ops
,
2235 .parent_hws
= (const struct clk_hw
*[]) { &g12a_mpll0_div
.hw
},
2237 .flags
= CLK_SET_RATE_PARENT
,
2241 static const struct reg_sequence g12a_mpll1_init_regs
[] = {
2242 { .reg
= HHI_MPLL_CNTL4
, .def
= 0x40000033 },
2245 static struct clk_regmap g12a_mpll1_div
= {
2246 .data
= &(struct meson_clk_mpll_data
){
2248 .reg_off
= HHI_MPLL_CNTL3
,
2253 .reg_off
= HHI_MPLL_CNTL3
,
2258 .reg_off
= HHI_MPLL_CNTL3
,
2263 .reg_off
= HHI_MPLL_CNTL3
,
2267 .lock
= &meson_clk_lock
,
2268 .init_regs
= g12a_mpll1_init_regs
,
2269 .init_count
= ARRAY_SIZE(g12a_mpll1_init_regs
),
2271 .hw
.init
= &(struct clk_init_data
){
2272 .name
= "mpll1_div",
2273 .ops
= &meson_clk_mpll_ops
,
2274 .parent_hws
= (const struct clk_hw
*[]) {
2275 &g12a_mpll_prediv
.hw
2281 static struct clk_regmap g12a_mpll1
= {
2282 .data
= &(struct clk_regmap_gate_data
){
2283 .offset
= HHI_MPLL_CNTL3
,
2286 .hw
.init
= &(struct clk_init_data
){
2288 .ops
= &clk_regmap_gate_ops
,
2289 .parent_hws
= (const struct clk_hw
*[]) { &g12a_mpll1_div
.hw
},
2291 .flags
= CLK_SET_RATE_PARENT
,
2295 static const struct reg_sequence g12a_mpll2_init_regs
[] = {
2296 { .reg
= HHI_MPLL_CNTL6
, .def
= 0x40000033 },
2299 static struct clk_regmap g12a_mpll2_div
= {
2300 .data
= &(struct meson_clk_mpll_data
){
2302 .reg_off
= HHI_MPLL_CNTL5
,
2307 .reg_off
= HHI_MPLL_CNTL5
,
2312 .reg_off
= HHI_MPLL_CNTL5
,
2317 .reg_off
= HHI_MPLL_CNTL5
,
2321 .lock
= &meson_clk_lock
,
2322 .init_regs
= g12a_mpll2_init_regs
,
2323 .init_count
= ARRAY_SIZE(g12a_mpll2_init_regs
),
2325 .hw
.init
= &(struct clk_init_data
){
2326 .name
= "mpll2_div",
2327 .ops
= &meson_clk_mpll_ops
,
2328 .parent_hws
= (const struct clk_hw
*[]) {
2329 &g12a_mpll_prediv
.hw
2335 static struct clk_regmap g12a_mpll2
= {
2336 .data
= &(struct clk_regmap_gate_data
){
2337 .offset
= HHI_MPLL_CNTL5
,
2340 .hw
.init
= &(struct clk_init_data
){
2342 .ops
= &clk_regmap_gate_ops
,
2343 .parent_hws
= (const struct clk_hw
*[]) { &g12a_mpll2_div
.hw
},
2345 .flags
= CLK_SET_RATE_PARENT
,
2349 static const struct reg_sequence g12a_mpll3_init_regs
[] = {
2350 { .reg
= HHI_MPLL_CNTL8
, .def
= 0x40000033 },
2353 static struct clk_regmap g12a_mpll3_div
= {
2354 .data
= &(struct meson_clk_mpll_data
){
2356 .reg_off
= HHI_MPLL_CNTL7
,
2361 .reg_off
= HHI_MPLL_CNTL7
,
2366 .reg_off
= HHI_MPLL_CNTL7
,
2371 .reg_off
= HHI_MPLL_CNTL7
,
2375 .lock
= &meson_clk_lock
,
2376 .init_regs
= g12a_mpll3_init_regs
,
2377 .init_count
= ARRAY_SIZE(g12a_mpll3_init_regs
),
2379 .hw
.init
= &(struct clk_init_data
){
2380 .name
= "mpll3_div",
2381 .ops
= &meson_clk_mpll_ops
,
2382 .parent_hws
= (const struct clk_hw
*[]) {
2383 &g12a_mpll_prediv
.hw
2389 static struct clk_regmap g12a_mpll3
= {
2390 .data
= &(struct clk_regmap_gate_data
){
2391 .offset
= HHI_MPLL_CNTL7
,
2394 .hw
.init
= &(struct clk_init_data
){
2396 .ops
= &clk_regmap_gate_ops
,
2397 .parent_hws
= (const struct clk_hw
*[]) { &g12a_mpll3_div
.hw
},
2399 .flags
= CLK_SET_RATE_PARENT
,
2403 static u32 mux_table_clk81
[] = { 0, 2, 3, 4, 5, 6, 7 };
2404 static const struct clk_parent_data clk81_parent_data
[] = {
2405 { .fw_name
= "xtal", },
2406 { .hw
= &g12a_fclk_div7
.hw
},
2407 { .hw
= &g12a_mpll1
.hw
},
2408 { .hw
= &g12a_mpll2
.hw
},
2409 { .hw
= &g12a_fclk_div4
.hw
},
2410 { .hw
= &g12a_fclk_div3
.hw
},
2411 { .hw
= &g12a_fclk_div5
.hw
},
2414 static struct clk_regmap g12a_mpeg_clk_sel
= {
2415 .data
= &(struct clk_regmap_mux_data
){
2416 .offset
= HHI_MPEG_CLK_CNTL
,
2419 .table
= mux_table_clk81
,
2421 .hw
.init
= &(struct clk_init_data
){
2422 .name
= "mpeg_clk_sel",
2423 .ops
= &clk_regmap_mux_ro_ops
,
2424 .parent_data
= clk81_parent_data
,
2425 .num_parents
= ARRAY_SIZE(clk81_parent_data
),
2429 static struct clk_regmap g12a_mpeg_clk_div
= {
2430 .data
= &(struct clk_regmap_div_data
){
2431 .offset
= HHI_MPEG_CLK_CNTL
,
2435 .hw
.init
= &(struct clk_init_data
){
2436 .name
= "mpeg_clk_div",
2437 .ops
= &clk_regmap_divider_ops
,
2438 .parent_hws
= (const struct clk_hw
*[]) {
2439 &g12a_mpeg_clk_sel
.hw
2442 .flags
= CLK_SET_RATE_PARENT
,
2446 static struct clk_regmap g12a_clk81
= {
2447 .data
= &(struct clk_regmap_gate_data
){
2448 .offset
= HHI_MPEG_CLK_CNTL
,
2451 .hw
.init
= &(struct clk_init_data
){
2453 .ops
= &clk_regmap_gate_ops
,
2454 .parent_hws
= (const struct clk_hw
*[]) {
2455 &g12a_mpeg_clk_div
.hw
2458 .flags
= (CLK_SET_RATE_PARENT
| CLK_IS_CRITICAL
),
2462 static const struct clk_parent_data g12a_sd_emmc_clk0_parent_data
[] = {
2463 { .fw_name
= "xtal", },
2464 { .hw
= &g12a_fclk_div2
.hw
},
2465 { .hw
= &g12a_fclk_div3
.hw
},
2466 { .hw
= &g12a_fclk_div5
.hw
},
2467 { .hw
= &g12a_fclk_div7
.hw
},
2469 * Following these parent clocks, we should also have had mpll2, mpll3
2470 * and gp0_pll but these clocks are too precious to be used here. All
2471 * the necessary rates for MMC and NAND operation can be acheived using
2472 * g12a_ee_core or fclk_div clocks
2477 static struct clk_regmap g12a_sd_emmc_a_clk0_sel
= {
2478 .data
= &(struct clk_regmap_mux_data
){
2479 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2483 .hw
.init
= &(struct clk_init_data
) {
2484 .name
= "sd_emmc_a_clk0_sel",
2485 .ops
= &clk_regmap_mux_ops
,
2486 .parent_data
= g12a_sd_emmc_clk0_parent_data
,
2487 .num_parents
= ARRAY_SIZE(g12a_sd_emmc_clk0_parent_data
),
2488 .flags
= CLK_SET_RATE_PARENT
,
2492 static struct clk_regmap g12a_sd_emmc_a_clk0_div
= {
2493 .data
= &(struct clk_regmap_div_data
){
2494 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2498 .hw
.init
= &(struct clk_init_data
) {
2499 .name
= "sd_emmc_a_clk0_div",
2500 .ops
= &clk_regmap_divider_ops
,
2501 .parent_hws
= (const struct clk_hw
*[]) {
2502 &g12a_sd_emmc_a_clk0_sel
.hw
2505 .flags
= CLK_SET_RATE_PARENT
,
2509 static struct clk_regmap g12a_sd_emmc_a_clk0
= {
2510 .data
= &(struct clk_regmap_gate_data
){
2511 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2514 .hw
.init
= &(struct clk_init_data
){
2515 .name
= "sd_emmc_a_clk0",
2516 .ops
= &clk_regmap_gate_ops
,
2517 .parent_hws
= (const struct clk_hw
*[]) {
2518 &g12a_sd_emmc_a_clk0_div
.hw
2521 .flags
= CLK_SET_RATE_PARENT
,
2526 static struct clk_regmap g12a_sd_emmc_b_clk0_sel
= {
2527 .data
= &(struct clk_regmap_mux_data
){
2528 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2532 .hw
.init
= &(struct clk_init_data
) {
2533 .name
= "sd_emmc_b_clk0_sel",
2534 .ops
= &clk_regmap_mux_ops
,
2535 .parent_data
= g12a_sd_emmc_clk0_parent_data
,
2536 .num_parents
= ARRAY_SIZE(g12a_sd_emmc_clk0_parent_data
),
2537 .flags
= CLK_SET_RATE_PARENT
,
2541 static struct clk_regmap g12a_sd_emmc_b_clk0_div
= {
2542 .data
= &(struct clk_regmap_div_data
){
2543 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2547 .hw
.init
= &(struct clk_init_data
) {
2548 .name
= "sd_emmc_b_clk0_div",
2549 .ops
= &clk_regmap_divider_ops
,
2550 .parent_hws
= (const struct clk_hw
*[]) {
2551 &g12a_sd_emmc_b_clk0_sel
.hw
2554 .flags
= CLK_SET_RATE_PARENT
,
2558 static struct clk_regmap g12a_sd_emmc_b_clk0
= {
2559 .data
= &(struct clk_regmap_gate_data
){
2560 .offset
= HHI_SD_EMMC_CLK_CNTL
,
2563 .hw
.init
= &(struct clk_init_data
){
2564 .name
= "sd_emmc_b_clk0",
2565 .ops
= &clk_regmap_gate_ops
,
2566 .parent_hws
= (const struct clk_hw
*[]) {
2567 &g12a_sd_emmc_b_clk0_div
.hw
2570 .flags
= CLK_SET_RATE_PARENT
,
2574 /* EMMC/NAND clock */
2575 static struct clk_regmap g12a_sd_emmc_c_clk0_sel
= {
2576 .data
= &(struct clk_regmap_mux_data
){
2577 .offset
= HHI_NAND_CLK_CNTL
,
2581 .hw
.init
= &(struct clk_init_data
) {
2582 .name
= "sd_emmc_c_clk0_sel",
2583 .ops
= &clk_regmap_mux_ops
,
2584 .parent_data
= g12a_sd_emmc_clk0_parent_data
,
2585 .num_parents
= ARRAY_SIZE(g12a_sd_emmc_clk0_parent_data
),
2586 .flags
= CLK_SET_RATE_PARENT
,
2590 static struct clk_regmap g12a_sd_emmc_c_clk0_div
= {
2591 .data
= &(struct clk_regmap_div_data
){
2592 .offset
= HHI_NAND_CLK_CNTL
,
2596 .hw
.init
= &(struct clk_init_data
) {
2597 .name
= "sd_emmc_c_clk0_div",
2598 .ops
= &clk_regmap_divider_ops
,
2599 .parent_hws
= (const struct clk_hw
*[]) {
2600 &g12a_sd_emmc_c_clk0_sel
.hw
2603 .flags
= CLK_SET_RATE_PARENT
,
2607 static struct clk_regmap g12a_sd_emmc_c_clk0
= {
2608 .data
= &(struct clk_regmap_gate_data
){
2609 .offset
= HHI_NAND_CLK_CNTL
,
2612 .hw
.init
= &(struct clk_init_data
){
2613 .name
= "sd_emmc_c_clk0",
2614 .ops
= &clk_regmap_gate_ops
,
2615 .parent_hws
= (const struct clk_hw
*[]) {
2616 &g12a_sd_emmc_c_clk0_div
.hw
2619 .flags
= CLK_SET_RATE_PARENT
,
2625 static struct clk_regmap g12a_vid_pll_div
= {
2626 .data
= &(struct meson_vid_pll_div_data
){
2628 .reg_off
= HHI_VID_PLL_CLK_DIV
,
2633 .reg_off
= HHI_VID_PLL_CLK_DIV
,
2638 .hw
.init
= &(struct clk_init_data
) {
2639 .name
= "vid_pll_div",
2640 .ops
= &meson_vid_pll_div_ro_ops
,
2641 .parent_hws
= (const struct clk_hw
*[]) { &g12a_hdmi_pll
.hw
},
2643 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
2647 static const struct clk_hw
*g12a_vid_pll_parent_hws
[] = {
2648 &g12a_vid_pll_div
.hw
,
2652 static struct clk_regmap g12a_vid_pll_sel
= {
2653 .data
= &(struct clk_regmap_mux_data
){
2654 .offset
= HHI_VID_PLL_CLK_DIV
,
2658 .hw
.init
= &(struct clk_init_data
){
2659 .name
= "vid_pll_sel",
2660 .ops
= &clk_regmap_mux_ops
,
2662 * bit 18 selects from 2 possible parents:
2663 * vid_pll_div or hdmi_pll
2665 .parent_hws
= g12a_vid_pll_parent_hws
,
2666 .num_parents
= ARRAY_SIZE(g12a_vid_pll_parent_hws
),
2667 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2671 static struct clk_regmap g12a_vid_pll
= {
2672 .data
= &(struct clk_regmap_gate_data
){
2673 .offset
= HHI_VID_PLL_CLK_DIV
,
2676 .hw
.init
= &(struct clk_init_data
) {
2678 .ops
= &clk_regmap_gate_ops
,
2679 .parent_hws
= (const struct clk_hw
*[]) {
2680 &g12a_vid_pll_sel
.hw
2683 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2689 static const struct clk_hw
*g12a_vpu_parent_hws
[] = {
2700 static struct clk_regmap g12a_vpu_0_sel
= {
2701 .data
= &(struct clk_regmap_mux_data
){
2702 .offset
= HHI_VPU_CLK_CNTL
,
2706 .hw
.init
= &(struct clk_init_data
){
2707 .name
= "vpu_0_sel",
2708 .ops
= &clk_regmap_mux_ops
,
2709 .parent_hws
= g12a_vpu_parent_hws
,
2710 .num_parents
= ARRAY_SIZE(g12a_vpu_parent_hws
),
2711 .flags
= CLK_SET_RATE_NO_REPARENT
,
2715 static struct clk_regmap g12a_vpu_0_div
= {
2716 .data
= &(struct clk_regmap_div_data
){
2717 .offset
= HHI_VPU_CLK_CNTL
,
2721 .hw
.init
= &(struct clk_init_data
){
2722 .name
= "vpu_0_div",
2723 .ops
= &clk_regmap_divider_ops
,
2724 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vpu_0_sel
.hw
},
2726 .flags
= CLK_SET_RATE_PARENT
,
2730 static struct clk_regmap g12a_vpu_0
= {
2731 .data
= &(struct clk_regmap_gate_data
){
2732 .offset
= HHI_VPU_CLK_CNTL
,
2735 .hw
.init
= &(struct clk_init_data
) {
2737 .ops
= &clk_regmap_gate_ops
,
2738 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vpu_0_div
.hw
},
2740 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2744 static struct clk_regmap g12a_vpu_1_sel
= {
2745 .data
= &(struct clk_regmap_mux_data
){
2746 .offset
= HHI_VPU_CLK_CNTL
,
2750 .hw
.init
= &(struct clk_init_data
){
2751 .name
= "vpu_1_sel",
2752 .ops
= &clk_regmap_mux_ops
,
2753 .parent_hws
= g12a_vpu_parent_hws
,
2754 .num_parents
= ARRAY_SIZE(g12a_vpu_parent_hws
),
2755 .flags
= CLK_SET_RATE_NO_REPARENT
,
2759 static struct clk_regmap g12a_vpu_1_div
= {
2760 .data
= &(struct clk_regmap_div_data
){
2761 .offset
= HHI_VPU_CLK_CNTL
,
2765 .hw
.init
= &(struct clk_init_data
){
2766 .name
= "vpu_1_div",
2767 .ops
= &clk_regmap_divider_ops
,
2768 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vpu_1_sel
.hw
},
2770 .flags
= CLK_SET_RATE_PARENT
,
2774 static struct clk_regmap g12a_vpu_1
= {
2775 .data
= &(struct clk_regmap_gate_data
){
2776 .offset
= HHI_VPU_CLK_CNTL
,
2779 .hw
.init
= &(struct clk_init_data
) {
2781 .ops
= &clk_regmap_gate_ops
,
2782 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vpu_1_div
.hw
},
2784 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2788 static struct clk_regmap g12a_vpu
= {
2789 .data
= &(struct clk_regmap_mux_data
){
2790 .offset
= HHI_VPU_CLK_CNTL
,
2794 .hw
.init
= &(struct clk_init_data
){
2796 .ops
= &clk_regmap_mux_ops
,
2798 * bit 31 selects from 2 possible parents:
2801 .parent_hws
= (const struct clk_hw
*[]) {
2806 .flags
= CLK_SET_RATE_NO_REPARENT
,
2812 static const struct clk_hw
*g12a_vdec_parent_hws
[] = {
2813 &g12a_fclk_div2p5
.hw
,
2822 static struct clk_regmap g12a_vdec_1_sel
= {
2823 .data
= &(struct clk_regmap_mux_data
){
2824 .offset
= HHI_VDEC_CLK_CNTL
,
2827 .flags
= CLK_MUX_ROUND_CLOSEST
,
2829 .hw
.init
= &(struct clk_init_data
){
2830 .name
= "vdec_1_sel",
2831 .ops
= &clk_regmap_mux_ops
,
2832 .parent_hws
= g12a_vdec_parent_hws
,
2833 .num_parents
= ARRAY_SIZE(g12a_vdec_parent_hws
),
2834 .flags
= CLK_SET_RATE_PARENT
,
2838 static struct clk_regmap g12a_vdec_1_div
= {
2839 .data
= &(struct clk_regmap_div_data
){
2840 .offset
= HHI_VDEC_CLK_CNTL
,
2843 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2845 .hw
.init
= &(struct clk_init_data
){
2846 .name
= "vdec_1_div",
2847 .ops
= &clk_regmap_divider_ops
,
2848 .parent_hws
= (const struct clk_hw
*[]) {
2852 .flags
= CLK_SET_RATE_PARENT
,
2856 static struct clk_regmap g12a_vdec_1
= {
2857 .data
= &(struct clk_regmap_gate_data
){
2858 .offset
= HHI_VDEC_CLK_CNTL
,
2861 .hw
.init
= &(struct clk_init_data
) {
2863 .ops
= &clk_regmap_gate_ops
,
2864 .parent_hws
= (const struct clk_hw
*[]) {
2868 .flags
= CLK_SET_RATE_PARENT
,
2872 static struct clk_regmap g12a_vdec_hevcf_sel
= {
2873 .data
= &(struct clk_regmap_mux_data
){
2874 .offset
= HHI_VDEC2_CLK_CNTL
,
2877 .flags
= CLK_MUX_ROUND_CLOSEST
,
2879 .hw
.init
= &(struct clk_init_data
){
2880 .name
= "vdec_hevcf_sel",
2881 .ops
= &clk_regmap_mux_ops
,
2882 .parent_hws
= g12a_vdec_parent_hws
,
2883 .num_parents
= ARRAY_SIZE(g12a_vdec_parent_hws
),
2884 .flags
= CLK_SET_RATE_PARENT
,
2888 static struct clk_regmap g12a_vdec_hevcf_div
= {
2889 .data
= &(struct clk_regmap_div_data
){
2890 .offset
= HHI_VDEC2_CLK_CNTL
,
2893 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2895 .hw
.init
= &(struct clk_init_data
){
2896 .name
= "vdec_hevcf_div",
2897 .ops
= &clk_regmap_divider_ops
,
2898 .parent_hws
= (const struct clk_hw
*[]) {
2899 &g12a_vdec_hevcf_sel
.hw
2902 .flags
= CLK_SET_RATE_PARENT
,
2906 static struct clk_regmap g12a_vdec_hevcf
= {
2907 .data
= &(struct clk_regmap_gate_data
){
2908 .offset
= HHI_VDEC2_CLK_CNTL
,
2911 .hw
.init
= &(struct clk_init_data
) {
2912 .name
= "vdec_hevcf",
2913 .ops
= &clk_regmap_gate_ops
,
2914 .parent_hws
= (const struct clk_hw
*[]) {
2915 &g12a_vdec_hevcf_div
.hw
2918 .flags
= CLK_SET_RATE_PARENT
,
2922 static struct clk_regmap g12a_vdec_hevc_sel
= {
2923 .data
= &(struct clk_regmap_mux_data
){
2924 .offset
= HHI_VDEC2_CLK_CNTL
,
2927 .flags
= CLK_MUX_ROUND_CLOSEST
,
2929 .hw
.init
= &(struct clk_init_data
){
2930 .name
= "vdec_hevc_sel",
2931 .ops
= &clk_regmap_mux_ops
,
2932 .parent_hws
= g12a_vdec_parent_hws
,
2933 .num_parents
= ARRAY_SIZE(g12a_vdec_parent_hws
),
2934 .flags
= CLK_SET_RATE_PARENT
,
2938 static struct clk_regmap g12a_vdec_hevc_div
= {
2939 .data
= &(struct clk_regmap_div_data
){
2940 .offset
= HHI_VDEC2_CLK_CNTL
,
2943 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2945 .hw
.init
= &(struct clk_init_data
){
2946 .name
= "vdec_hevc_div",
2947 .ops
= &clk_regmap_divider_ops
,
2948 .parent_hws
= (const struct clk_hw
*[]) {
2949 &g12a_vdec_hevc_sel
.hw
2952 .flags
= CLK_SET_RATE_PARENT
,
2956 static struct clk_regmap g12a_vdec_hevc
= {
2957 .data
= &(struct clk_regmap_gate_data
){
2958 .offset
= HHI_VDEC2_CLK_CNTL
,
2961 .hw
.init
= &(struct clk_init_data
) {
2962 .name
= "vdec_hevc",
2963 .ops
= &clk_regmap_gate_ops
,
2964 .parent_hws
= (const struct clk_hw
*[]) {
2965 &g12a_vdec_hevc_div
.hw
2968 .flags
= CLK_SET_RATE_PARENT
,
2974 static const struct clk_hw
*g12a_vapb_parent_hws
[] = {
2982 &g12a_fclk_div2p5
.hw
,
2985 static struct clk_regmap g12a_vapb_0_sel
= {
2986 .data
= &(struct clk_regmap_mux_data
){
2987 .offset
= HHI_VAPBCLK_CNTL
,
2991 .hw
.init
= &(struct clk_init_data
){
2992 .name
= "vapb_0_sel",
2993 .ops
= &clk_regmap_mux_ops
,
2994 .parent_hws
= g12a_vapb_parent_hws
,
2995 .num_parents
= ARRAY_SIZE(g12a_vapb_parent_hws
),
2996 .flags
= CLK_SET_RATE_NO_REPARENT
,
3000 static struct clk_regmap g12a_vapb_0_div
= {
3001 .data
= &(struct clk_regmap_div_data
){
3002 .offset
= HHI_VAPBCLK_CNTL
,
3006 .hw
.init
= &(struct clk_init_data
){
3007 .name
= "vapb_0_div",
3008 .ops
= &clk_regmap_divider_ops
,
3009 .parent_hws
= (const struct clk_hw
*[]) {
3013 .flags
= CLK_SET_RATE_PARENT
,
3017 static struct clk_regmap g12a_vapb_0
= {
3018 .data
= &(struct clk_regmap_gate_data
){
3019 .offset
= HHI_VAPBCLK_CNTL
,
3022 .hw
.init
= &(struct clk_init_data
) {
3024 .ops
= &clk_regmap_gate_ops
,
3025 .parent_hws
= (const struct clk_hw
*[]) {
3029 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3033 static struct clk_regmap g12a_vapb_1_sel
= {
3034 .data
= &(struct clk_regmap_mux_data
){
3035 .offset
= HHI_VAPBCLK_CNTL
,
3039 .hw
.init
= &(struct clk_init_data
){
3040 .name
= "vapb_1_sel",
3041 .ops
= &clk_regmap_mux_ops
,
3042 .parent_hws
= g12a_vapb_parent_hws
,
3043 .num_parents
= ARRAY_SIZE(g12a_vapb_parent_hws
),
3044 .flags
= CLK_SET_RATE_NO_REPARENT
,
3048 static struct clk_regmap g12a_vapb_1_div
= {
3049 .data
= &(struct clk_regmap_div_data
){
3050 .offset
= HHI_VAPBCLK_CNTL
,
3054 .hw
.init
= &(struct clk_init_data
){
3055 .name
= "vapb_1_div",
3056 .ops
= &clk_regmap_divider_ops
,
3057 .parent_hws
= (const struct clk_hw
*[]) {
3061 .flags
= CLK_SET_RATE_PARENT
,
3065 static struct clk_regmap g12a_vapb_1
= {
3066 .data
= &(struct clk_regmap_gate_data
){
3067 .offset
= HHI_VAPBCLK_CNTL
,
3070 .hw
.init
= &(struct clk_init_data
) {
3072 .ops
= &clk_regmap_gate_ops
,
3073 .parent_hws
= (const struct clk_hw
*[]) {
3077 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3081 static struct clk_regmap g12a_vapb_sel
= {
3082 .data
= &(struct clk_regmap_mux_data
){
3083 .offset
= HHI_VAPBCLK_CNTL
,
3087 .hw
.init
= &(struct clk_init_data
){
3089 .ops
= &clk_regmap_mux_ops
,
3091 * bit 31 selects from 2 possible parents:
3094 .parent_hws
= (const struct clk_hw
*[]) {
3099 .flags
= CLK_SET_RATE_NO_REPARENT
,
3103 static struct clk_regmap g12a_vapb
= {
3104 .data
= &(struct clk_regmap_gate_data
){
3105 .offset
= HHI_VAPBCLK_CNTL
,
3108 .hw
.init
= &(struct clk_init_data
) {
3110 .ops
= &clk_regmap_gate_ops
,
3111 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vapb_sel
.hw
},
3113 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3117 static const struct clk_hw
*g12a_vclk_parent_hws
[] = {
3128 static struct clk_regmap g12a_vclk_sel
= {
3129 .data
= &(struct clk_regmap_mux_data
){
3130 .offset
= HHI_VID_CLK_CNTL
,
3134 .hw
.init
= &(struct clk_init_data
){
3136 .ops
= &clk_regmap_mux_ops
,
3137 .parent_hws
= g12a_vclk_parent_hws
,
3138 .num_parents
= ARRAY_SIZE(g12a_vclk_parent_hws
),
3139 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3143 static struct clk_regmap g12a_vclk2_sel
= {
3144 .data
= &(struct clk_regmap_mux_data
){
3145 .offset
= HHI_VIID_CLK_CNTL
,
3149 .hw
.init
= &(struct clk_init_data
){
3150 .name
= "vclk2_sel",
3151 .ops
= &clk_regmap_mux_ops
,
3152 .parent_hws
= g12a_vclk_parent_hws
,
3153 .num_parents
= ARRAY_SIZE(g12a_vclk_parent_hws
),
3154 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3158 static struct clk_regmap g12a_vclk_input
= {
3159 .data
= &(struct clk_regmap_gate_data
){
3160 .offset
= HHI_VID_CLK_DIV
,
3163 .hw
.init
= &(struct clk_init_data
) {
3164 .name
= "vclk_input",
3165 .ops
= &clk_regmap_gate_ops
,
3166 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk_sel
.hw
},
3168 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3172 static struct clk_regmap g12a_vclk2_input
= {
3173 .data
= &(struct clk_regmap_gate_data
){
3174 .offset
= HHI_VIID_CLK_DIV
,
3177 .hw
.init
= &(struct clk_init_data
) {
3178 .name
= "vclk2_input",
3179 .ops
= &clk_regmap_gate_ops
,
3180 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2_sel
.hw
},
3182 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3186 static struct clk_regmap g12a_vclk_div
= {
3187 .data
= &(struct clk_regmap_div_data
){
3188 .offset
= HHI_VID_CLK_DIV
,
3192 .hw
.init
= &(struct clk_init_data
){
3194 .ops
= &clk_regmap_divider_ops
,
3195 .parent_hws
= (const struct clk_hw
*[]) {
3199 .flags
= CLK_GET_RATE_NOCACHE
,
3203 static struct clk_regmap g12a_vclk2_div
= {
3204 .data
= &(struct clk_regmap_div_data
){
3205 .offset
= HHI_VIID_CLK_DIV
,
3209 .hw
.init
= &(struct clk_init_data
){
3210 .name
= "vclk2_div",
3211 .ops
= &clk_regmap_divider_ops
,
3212 .parent_hws
= (const struct clk_hw
*[]) {
3213 &g12a_vclk2_input
.hw
3216 .flags
= CLK_GET_RATE_NOCACHE
,
3220 static struct clk_regmap g12a_vclk
= {
3221 .data
= &(struct clk_regmap_gate_data
){
3222 .offset
= HHI_VID_CLK_CNTL
,
3225 .hw
.init
= &(struct clk_init_data
) {
3227 .ops
= &clk_regmap_gate_ops
,
3228 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk_div
.hw
},
3230 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3234 static struct clk_regmap g12a_vclk2
= {
3235 .data
= &(struct clk_regmap_gate_data
){
3236 .offset
= HHI_VIID_CLK_CNTL
,
3239 .hw
.init
= &(struct clk_init_data
) {
3241 .ops
= &clk_regmap_gate_ops
,
3242 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2_div
.hw
},
3244 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3248 static struct clk_regmap g12a_vclk_div1
= {
3249 .data
= &(struct clk_regmap_gate_data
){
3250 .offset
= HHI_VID_CLK_CNTL
,
3253 .hw
.init
= &(struct clk_init_data
) {
3254 .name
= "vclk_div1",
3255 .ops
= &clk_regmap_gate_ops
,
3256 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3258 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3262 static struct clk_regmap g12a_vclk_div2_en
= {
3263 .data
= &(struct clk_regmap_gate_data
){
3264 .offset
= HHI_VID_CLK_CNTL
,
3267 .hw
.init
= &(struct clk_init_data
) {
3268 .name
= "vclk_div2_en",
3269 .ops
= &clk_regmap_gate_ops
,
3270 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3272 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3276 static struct clk_regmap g12a_vclk_div4_en
= {
3277 .data
= &(struct clk_regmap_gate_data
){
3278 .offset
= HHI_VID_CLK_CNTL
,
3281 .hw
.init
= &(struct clk_init_data
) {
3282 .name
= "vclk_div4_en",
3283 .ops
= &clk_regmap_gate_ops
,
3284 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3286 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3290 static struct clk_regmap g12a_vclk_div6_en
= {
3291 .data
= &(struct clk_regmap_gate_data
){
3292 .offset
= HHI_VID_CLK_CNTL
,
3295 .hw
.init
= &(struct clk_init_data
) {
3296 .name
= "vclk_div6_en",
3297 .ops
= &clk_regmap_gate_ops
,
3298 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3300 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3304 static struct clk_regmap g12a_vclk_div12_en
= {
3305 .data
= &(struct clk_regmap_gate_data
){
3306 .offset
= HHI_VID_CLK_CNTL
,
3309 .hw
.init
= &(struct clk_init_data
) {
3310 .name
= "vclk_div12_en",
3311 .ops
= &clk_regmap_gate_ops
,
3312 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk
.hw
},
3314 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3318 static struct clk_regmap g12a_vclk2_div1
= {
3319 .data
= &(struct clk_regmap_gate_data
){
3320 .offset
= HHI_VIID_CLK_CNTL
,
3323 .hw
.init
= &(struct clk_init_data
) {
3324 .name
= "vclk2_div1",
3325 .ops
= &clk_regmap_gate_ops
,
3326 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3328 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3332 static struct clk_regmap g12a_vclk2_div2_en
= {
3333 .data
= &(struct clk_regmap_gate_data
){
3334 .offset
= HHI_VIID_CLK_CNTL
,
3337 .hw
.init
= &(struct clk_init_data
) {
3338 .name
= "vclk2_div2_en",
3339 .ops
= &clk_regmap_gate_ops
,
3340 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3342 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3346 static struct clk_regmap g12a_vclk2_div4_en
= {
3347 .data
= &(struct clk_regmap_gate_data
){
3348 .offset
= HHI_VIID_CLK_CNTL
,
3351 .hw
.init
= &(struct clk_init_data
) {
3352 .name
= "vclk2_div4_en",
3353 .ops
= &clk_regmap_gate_ops
,
3354 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3356 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3360 static struct clk_regmap g12a_vclk2_div6_en
= {
3361 .data
= &(struct clk_regmap_gate_data
){
3362 .offset
= HHI_VIID_CLK_CNTL
,
3365 .hw
.init
= &(struct clk_init_data
) {
3366 .name
= "vclk2_div6_en",
3367 .ops
= &clk_regmap_gate_ops
,
3368 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3370 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3374 static struct clk_regmap g12a_vclk2_div12_en
= {
3375 .data
= &(struct clk_regmap_gate_data
){
3376 .offset
= HHI_VIID_CLK_CNTL
,
3379 .hw
.init
= &(struct clk_init_data
) {
3380 .name
= "vclk2_div12_en",
3381 .ops
= &clk_regmap_gate_ops
,
3382 .parent_hws
= (const struct clk_hw
*[]) { &g12a_vclk2
.hw
},
3384 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3388 static struct clk_fixed_factor g12a_vclk_div2
= {
3391 .hw
.init
= &(struct clk_init_data
){
3392 .name
= "vclk_div2",
3393 .ops
= &clk_fixed_factor_ops
,
3394 .parent_hws
= (const struct clk_hw
*[]) {
3395 &g12a_vclk_div2_en
.hw
3401 static struct clk_fixed_factor g12a_vclk_div4
= {
3404 .hw
.init
= &(struct clk_init_data
){
3405 .name
= "vclk_div4",
3406 .ops
= &clk_fixed_factor_ops
,
3407 .parent_hws
= (const struct clk_hw
*[]) {
3408 &g12a_vclk_div4_en
.hw
3414 static struct clk_fixed_factor g12a_vclk_div6
= {
3417 .hw
.init
= &(struct clk_init_data
){
3418 .name
= "vclk_div6",
3419 .ops
= &clk_fixed_factor_ops
,
3420 .parent_hws
= (const struct clk_hw
*[]) {
3421 &g12a_vclk_div6_en
.hw
3427 static struct clk_fixed_factor g12a_vclk_div12
= {
3430 .hw
.init
= &(struct clk_init_data
){
3431 .name
= "vclk_div12",
3432 .ops
= &clk_fixed_factor_ops
,
3433 .parent_hws
= (const struct clk_hw
*[]) {
3434 &g12a_vclk_div12_en
.hw
3440 static struct clk_fixed_factor g12a_vclk2_div2
= {
3443 .hw
.init
= &(struct clk_init_data
){
3444 .name
= "vclk2_div2",
3445 .ops
= &clk_fixed_factor_ops
,
3446 .parent_hws
= (const struct clk_hw
*[]) {
3447 &g12a_vclk2_div2_en
.hw
3453 static struct clk_fixed_factor g12a_vclk2_div4
= {
3456 .hw
.init
= &(struct clk_init_data
){
3457 .name
= "vclk2_div4",
3458 .ops
= &clk_fixed_factor_ops
,
3459 .parent_hws
= (const struct clk_hw
*[]) {
3460 &g12a_vclk2_div4_en
.hw
3466 static struct clk_fixed_factor g12a_vclk2_div6
= {
3469 .hw
.init
= &(struct clk_init_data
){
3470 .name
= "vclk2_div6",
3471 .ops
= &clk_fixed_factor_ops
,
3472 .parent_hws
= (const struct clk_hw
*[]) {
3473 &g12a_vclk2_div6_en
.hw
3479 static struct clk_fixed_factor g12a_vclk2_div12
= {
3482 .hw
.init
= &(struct clk_init_data
){
3483 .name
= "vclk2_div12",
3484 .ops
= &clk_fixed_factor_ops
,
3485 .parent_hws
= (const struct clk_hw
*[]) {
3486 &g12a_vclk2_div12_en
.hw
3492 static u32 mux_table_cts_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
3493 static const struct clk_hw
*g12a_cts_parent_hws
[] = {
3498 &g12a_vclk_div12
.hw
,
3499 &g12a_vclk2_div1
.hw
,
3500 &g12a_vclk2_div2
.hw
,
3501 &g12a_vclk2_div4
.hw
,
3502 &g12a_vclk2_div6
.hw
,
3503 &g12a_vclk2_div12
.hw
,
3506 static struct clk_regmap g12a_cts_enci_sel
= {
3507 .data
= &(struct clk_regmap_mux_data
){
3508 .offset
= HHI_VID_CLK_DIV
,
3511 .table
= mux_table_cts_sel
,
3513 .hw
.init
= &(struct clk_init_data
){
3514 .name
= "cts_enci_sel",
3515 .ops
= &clk_regmap_mux_ops
,
3516 .parent_hws
= g12a_cts_parent_hws
,
3517 .num_parents
= ARRAY_SIZE(g12a_cts_parent_hws
),
3518 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3522 static struct clk_regmap g12a_cts_encp_sel
= {
3523 .data
= &(struct clk_regmap_mux_data
){
3524 .offset
= HHI_VID_CLK_DIV
,
3527 .table
= mux_table_cts_sel
,
3529 .hw
.init
= &(struct clk_init_data
){
3530 .name
= "cts_encp_sel",
3531 .ops
= &clk_regmap_mux_ops
,
3532 .parent_hws
= g12a_cts_parent_hws
,
3533 .num_parents
= ARRAY_SIZE(g12a_cts_parent_hws
),
3534 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3538 static struct clk_regmap g12a_cts_vdac_sel
= {
3539 .data
= &(struct clk_regmap_mux_data
){
3540 .offset
= HHI_VIID_CLK_DIV
,
3543 .table
= mux_table_cts_sel
,
3545 .hw
.init
= &(struct clk_init_data
){
3546 .name
= "cts_vdac_sel",
3547 .ops
= &clk_regmap_mux_ops
,
3548 .parent_hws
= g12a_cts_parent_hws
,
3549 .num_parents
= ARRAY_SIZE(g12a_cts_parent_hws
),
3550 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3554 /* TOFIX: add support for cts_tcon */
3555 static u32 mux_table_hdmi_tx_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
3556 static const struct clk_hw
*g12a_cts_hdmi_tx_parent_hws
[] = {
3561 &g12a_vclk_div12
.hw
,
3562 &g12a_vclk2_div1
.hw
,
3563 &g12a_vclk2_div2
.hw
,
3564 &g12a_vclk2_div4
.hw
,
3565 &g12a_vclk2_div6
.hw
,
3566 &g12a_vclk2_div12
.hw
,
3569 static struct clk_regmap g12a_hdmi_tx_sel
= {
3570 .data
= &(struct clk_regmap_mux_data
){
3571 .offset
= HHI_HDMI_CLK_CNTL
,
3574 .table
= mux_table_hdmi_tx_sel
,
3576 .hw
.init
= &(struct clk_init_data
){
3577 .name
= "hdmi_tx_sel",
3578 .ops
= &clk_regmap_mux_ops
,
3579 .parent_hws
= g12a_cts_hdmi_tx_parent_hws
,
3580 .num_parents
= ARRAY_SIZE(g12a_cts_hdmi_tx_parent_hws
),
3581 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3585 static struct clk_regmap g12a_cts_enci
= {
3586 .data
= &(struct clk_regmap_gate_data
){
3587 .offset
= HHI_VID_CLK_CNTL2
,
3590 .hw
.init
= &(struct clk_init_data
) {
3592 .ops
= &clk_regmap_gate_ops
,
3593 .parent_hws
= (const struct clk_hw
*[]) {
3594 &g12a_cts_enci_sel
.hw
3597 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3601 static struct clk_regmap g12a_cts_encp
= {
3602 .data
= &(struct clk_regmap_gate_data
){
3603 .offset
= HHI_VID_CLK_CNTL2
,
3606 .hw
.init
= &(struct clk_init_data
) {
3608 .ops
= &clk_regmap_gate_ops
,
3609 .parent_hws
= (const struct clk_hw
*[]) {
3610 &g12a_cts_encp_sel
.hw
3613 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3617 static struct clk_regmap g12a_cts_vdac
= {
3618 .data
= &(struct clk_regmap_gate_data
){
3619 .offset
= HHI_VID_CLK_CNTL2
,
3622 .hw
.init
= &(struct clk_init_data
) {
3624 .ops
= &clk_regmap_gate_ops
,
3625 .parent_hws
= (const struct clk_hw
*[]) {
3626 &g12a_cts_vdac_sel
.hw
3629 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3633 static struct clk_regmap g12a_hdmi_tx
= {
3634 .data
= &(struct clk_regmap_gate_data
){
3635 .offset
= HHI_VID_CLK_CNTL2
,
3638 .hw
.init
= &(struct clk_init_data
) {
3640 .ops
= &clk_regmap_gate_ops
,
3641 .parent_hws
= (const struct clk_hw
*[]) {
3642 &g12a_hdmi_tx_sel
.hw
3645 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3651 static const struct clk_parent_data g12a_hdmi_parent_data
[] = {
3652 { .fw_name
= "xtal", },
3653 { .hw
= &g12a_fclk_div4
.hw
},
3654 { .hw
= &g12a_fclk_div3
.hw
},
3655 { .hw
= &g12a_fclk_div5
.hw
},
3658 static struct clk_regmap g12a_hdmi_sel
= {
3659 .data
= &(struct clk_regmap_mux_data
){
3660 .offset
= HHI_HDMI_CLK_CNTL
,
3663 .flags
= CLK_MUX_ROUND_CLOSEST
,
3665 .hw
.init
= &(struct clk_init_data
){
3667 .ops
= &clk_regmap_mux_ops
,
3668 .parent_data
= g12a_hdmi_parent_data
,
3669 .num_parents
= ARRAY_SIZE(g12a_hdmi_parent_data
),
3670 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
3674 static struct clk_regmap g12a_hdmi_div
= {
3675 .data
= &(struct clk_regmap_div_data
){
3676 .offset
= HHI_HDMI_CLK_CNTL
,
3680 .hw
.init
= &(struct clk_init_data
){
3682 .ops
= &clk_regmap_divider_ops
,
3683 .parent_hws
= (const struct clk_hw
*[]) { &g12a_hdmi_sel
.hw
},
3685 .flags
= CLK_GET_RATE_NOCACHE
,
3689 static struct clk_regmap g12a_hdmi
= {
3690 .data
= &(struct clk_regmap_gate_data
){
3691 .offset
= HHI_HDMI_CLK_CNTL
,
3694 .hw
.init
= &(struct clk_init_data
) {
3696 .ops
= &clk_regmap_gate_ops
,
3697 .parent_hws
= (const struct clk_hw
*[]) { &g12a_hdmi_div
.hw
},
3699 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
3704 * The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
3705 * muxed by a glitch-free switch.
3707 static const struct clk_parent_data g12a_mali_0_1_parent_data
[] = {
3708 { .fw_name
= "xtal", },
3709 { .hw
= &g12a_gp0_pll
.hw
},
3710 { .hw
= &g12a_hifi_pll
.hw
},
3711 { .hw
= &g12a_fclk_div2p5
.hw
},
3712 { .hw
= &g12a_fclk_div3
.hw
},
3713 { .hw
= &g12a_fclk_div4
.hw
},
3714 { .hw
= &g12a_fclk_div5
.hw
},
3715 { .hw
= &g12a_fclk_div7
.hw
},
3718 static struct clk_regmap g12a_mali_0_sel
= {
3719 .data
= &(struct clk_regmap_mux_data
){
3720 .offset
= HHI_MALI_CLK_CNTL
,
3724 .hw
.init
= &(struct clk_init_data
){
3725 .name
= "mali_0_sel",
3726 .ops
= &clk_regmap_mux_ops
,
3727 .parent_data
= g12a_mali_0_1_parent_data
,
3729 .flags
= CLK_SET_RATE_NO_REPARENT
,
3733 static struct clk_regmap g12a_mali_0_div
= {
3734 .data
= &(struct clk_regmap_div_data
){
3735 .offset
= HHI_MALI_CLK_CNTL
,
3739 .hw
.init
= &(struct clk_init_data
){
3740 .name
= "mali_0_div",
3741 .ops
= &clk_regmap_divider_ops
,
3742 .parent_hws
= (const struct clk_hw
*[]) {
3746 .flags
= CLK_SET_RATE_NO_REPARENT
,
3750 static struct clk_regmap g12a_mali_0
= {
3751 .data
= &(struct clk_regmap_gate_data
){
3752 .offset
= HHI_MALI_CLK_CNTL
,
3755 .hw
.init
= &(struct clk_init_data
){
3757 .ops
= &clk_regmap_gate_ops
,
3758 .parent_hws
= (const struct clk_hw
*[]) {
3762 .flags
= CLK_SET_RATE_PARENT
,
3766 static struct clk_regmap g12a_mali_1_sel
= {
3767 .data
= &(struct clk_regmap_mux_data
){
3768 .offset
= HHI_MALI_CLK_CNTL
,
3772 .hw
.init
= &(struct clk_init_data
){
3773 .name
= "mali_1_sel",
3774 .ops
= &clk_regmap_mux_ops
,
3775 .parent_data
= g12a_mali_0_1_parent_data
,
3777 .flags
= CLK_SET_RATE_NO_REPARENT
,
3781 static struct clk_regmap g12a_mali_1_div
= {
3782 .data
= &(struct clk_regmap_div_data
){
3783 .offset
= HHI_MALI_CLK_CNTL
,
3787 .hw
.init
= &(struct clk_init_data
){
3788 .name
= "mali_1_div",
3789 .ops
= &clk_regmap_divider_ops
,
3790 .parent_hws
= (const struct clk_hw
*[]) {
3794 .flags
= CLK_SET_RATE_NO_REPARENT
,
3798 static struct clk_regmap g12a_mali_1
= {
3799 .data
= &(struct clk_regmap_gate_data
){
3800 .offset
= HHI_MALI_CLK_CNTL
,
3803 .hw
.init
= &(struct clk_init_data
){
3805 .ops
= &clk_regmap_gate_ops
,
3806 .parent_hws
= (const struct clk_hw
*[]) {
3810 .flags
= CLK_SET_RATE_PARENT
,
3814 static const struct clk_hw
*g12a_mali_parent_hws
[] = {
3819 static struct clk_regmap g12a_mali
= {
3820 .data
= &(struct clk_regmap_mux_data
){
3821 .offset
= HHI_MALI_CLK_CNTL
,
3825 .hw
.init
= &(struct clk_init_data
){
3827 .ops
= &clk_regmap_mux_ops
,
3828 .parent_hws
= g12a_mali_parent_hws
,
3830 .flags
= CLK_SET_RATE_NO_REPARENT
,
3834 static struct clk_regmap g12a_ts_div
= {
3835 .data
= &(struct clk_regmap_div_data
){
3836 .offset
= HHI_TS_CLK_CNTL
,
3840 .hw
.init
= &(struct clk_init_data
){
3842 .ops
= &clk_regmap_divider_ro_ops
,
3843 .parent_data
= &(const struct clk_parent_data
) {
3850 static struct clk_regmap g12a_ts
= {
3851 .data
= &(struct clk_regmap_gate_data
){
3852 .offset
= HHI_TS_CLK_CNTL
,
3855 .hw
.init
= &(struct clk_init_data
){
3857 .ops
= &clk_regmap_gate_ops
,
3858 .parent_hws
= (const struct clk_hw
*[]) {
3865 /* SPICC SCLK source clock */
3867 static const struct clk_parent_data spicc_sclk_parent_data
[] = {
3868 { .fw_name
= "xtal", },
3869 { .hw
= &g12a_clk81
.hw
},
3870 { .hw
= &g12a_fclk_div4
.hw
},
3871 { .hw
= &g12a_fclk_div3
.hw
},
3872 { .hw
= &g12a_fclk_div5
.hw
},
3873 { .hw
= &g12a_fclk_div7
.hw
},
3876 static struct clk_regmap g12a_spicc0_sclk_sel
= {
3877 .data
= &(struct clk_regmap_mux_data
){
3878 .offset
= HHI_SPICC_CLK_CNTL
,
3882 .hw
.init
= &(struct clk_init_data
){
3883 .name
= "spicc0_sclk_sel",
3884 .ops
= &clk_regmap_mux_ops
,
3885 .parent_data
= spicc_sclk_parent_data
,
3886 .num_parents
= ARRAY_SIZE(spicc_sclk_parent_data
),
3890 static struct clk_regmap g12a_spicc0_sclk_div
= {
3891 .data
= &(struct clk_regmap_div_data
){
3892 .offset
= HHI_SPICC_CLK_CNTL
,
3896 .hw
.init
= &(struct clk_init_data
){
3897 .name
= "spicc0_sclk_div",
3898 .ops
= &clk_regmap_divider_ops
,
3899 .parent_hws
= (const struct clk_hw
*[]) {
3900 &g12a_spicc0_sclk_sel
.hw
3903 .flags
= CLK_SET_RATE_PARENT
,
3907 static struct clk_regmap g12a_spicc0_sclk
= {
3908 .data
= &(struct clk_regmap_gate_data
){
3909 .offset
= HHI_SPICC_CLK_CNTL
,
3912 .hw
.init
= &(struct clk_init_data
){
3913 .name
= "spicc0_sclk",
3914 .ops
= &clk_regmap_gate_ops
,
3915 .parent_hws
= (const struct clk_hw
*[]) {
3916 &g12a_spicc0_sclk_div
.hw
3919 .flags
= CLK_SET_RATE_PARENT
,
3923 static struct clk_regmap g12a_spicc1_sclk_sel
= {
3924 .data
= &(struct clk_regmap_mux_data
){
3925 .offset
= HHI_SPICC_CLK_CNTL
,
3929 .hw
.init
= &(struct clk_init_data
){
3930 .name
= "spicc1_sclk_sel",
3931 .ops
= &clk_regmap_mux_ops
,
3932 .parent_data
= spicc_sclk_parent_data
,
3933 .num_parents
= ARRAY_SIZE(spicc_sclk_parent_data
),
3937 static struct clk_regmap g12a_spicc1_sclk_div
= {
3938 .data
= &(struct clk_regmap_div_data
){
3939 .offset
= HHI_SPICC_CLK_CNTL
,
3943 .hw
.init
= &(struct clk_init_data
){
3944 .name
= "spicc1_sclk_div",
3945 .ops
= &clk_regmap_divider_ops
,
3946 .parent_hws
= (const struct clk_hw
*[]) {
3947 &g12a_spicc1_sclk_sel
.hw
3950 .flags
= CLK_SET_RATE_PARENT
,
3954 static struct clk_regmap g12a_spicc1_sclk
= {
3955 .data
= &(struct clk_regmap_gate_data
){
3956 .offset
= HHI_SPICC_CLK_CNTL
,
3959 .hw
.init
= &(struct clk_init_data
){
3960 .name
= "spicc1_sclk",
3961 .ops
= &clk_regmap_gate_ops
,
3962 .parent_hws
= (const struct clk_hw
*[]) {
3963 &g12a_spicc1_sclk_div
.hw
3966 .flags
= CLK_SET_RATE_PARENT
,
3970 #define MESON_GATE(_name, _reg, _bit) \
3971 MESON_PCLK(_name, _reg, _bit, &g12a_clk81.hw)
3973 #define MESON_GATE_RO(_name, _reg, _bit) \
3974 MESON_PCLK_RO(_name, _reg, _bit, &g12a_clk81.hw)
3976 /* Everything Else (EE) domain gates */
3977 static MESON_GATE(g12a_ddr
, HHI_GCLK_MPEG0
, 0);
3978 static MESON_GATE(g12a_dos
, HHI_GCLK_MPEG0
, 1);
3979 static MESON_GATE(g12a_audio_locker
, HHI_GCLK_MPEG0
, 2);
3980 static MESON_GATE(g12a_mipi_dsi_host
, HHI_GCLK_MPEG0
, 3);
3981 static MESON_GATE(g12a_eth_phy
, HHI_GCLK_MPEG0
, 4);
3982 static MESON_GATE(g12a_isa
, HHI_GCLK_MPEG0
, 5);
3983 static MESON_GATE(g12a_pl301
, HHI_GCLK_MPEG0
, 6);
3984 static MESON_GATE(g12a_periphs
, HHI_GCLK_MPEG0
, 7);
3985 static MESON_GATE(g12a_spicc_0
, HHI_GCLK_MPEG0
, 8);
3986 static MESON_GATE(g12a_i2c
, HHI_GCLK_MPEG0
, 9);
3987 static MESON_GATE(g12a_sana
, HHI_GCLK_MPEG0
, 10);
3988 static MESON_GATE(g12a_sd
, HHI_GCLK_MPEG0
, 11);
3989 static MESON_GATE(g12a_rng0
, HHI_GCLK_MPEG0
, 12);
3990 static MESON_GATE(g12a_uart0
, HHI_GCLK_MPEG0
, 13);
3991 static MESON_GATE(g12a_spicc_1
, HHI_GCLK_MPEG0
, 14);
3992 static MESON_GATE(g12a_hiu_reg
, HHI_GCLK_MPEG0
, 19);
3993 static MESON_GATE(g12a_mipi_dsi_phy
, HHI_GCLK_MPEG0
, 20);
3994 static MESON_GATE(g12a_assist_misc
, HHI_GCLK_MPEG0
, 23);
3995 static MESON_GATE(g12a_emmc_a
, HHI_GCLK_MPEG0
, 4);
3996 static MESON_GATE(g12a_emmc_b
, HHI_GCLK_MPEG0
, 25);
3997 static MESON_GATE(g12a_emmc_c
, HHI_GCLK_MPEG0
, 26);
3998 static MESON_GATE(g12a_audio_codec
, HHI_GCLK_MPEG0
, 28);
4000 static MESON_GATE(g12a_audio
, HHI_GCLK_MPEG1
, 0);
4001 static MESON_GATE(g12a_eth_core
, HHI_GCLK_MPEG1
, 3);
4002 static MESON_GATE(g12a_demux
, HHI_GCLK_MPEG1
, 4);
4003 static MESON_GATE(g12a_audio_ififo
, HHI_GCLK_MPEG1
, 11);
4004 static MESON_GATE(g12a_adc
, HHI_GCLK_MPEG1
, 13);
4005 static MESON_GATE(g12a_uart1
, HHI_GCLK_MPEG1
, 16);
4006 static MESON_GATE(g12a_g2d
, HHI_GCLK_MPEG1
, 20);
4007 static MESON_GATE(g12a_reset
, HHI_GCLK_MPEG1
, 23);
4008 static MESON_GATE(g12a_pcie_comb
, HHI_GCLK_MPEG1
, 24);
4009 static MESON_GATE(g12a_parser
, HHI_GCLK_MPEG1
, 25);
4010 static MESON_GATE(g12a_usb_general
, HHI_GCLK_MPEG1
, 26);
4011 static MESON_GATE(g12a_pcie_phy
, HHI_GCLK_MPEG1
, 27);
4012 static MESON_GATE(g12a_ahb_arb0
, HHI_GCLK_MPEG1
, 29);
4014 static MESON_GATE(g12a_ahb_data_bus
, HHI_GCLK_MPEG2
, 1);
4015 static MESON_GATE(g12a_ahb_ctrl_bus
, HHI_GCLK_MPEG2
, 2);
4016 static MESON_GATE(g12a_htx_hdcp22
, HHI_GCLK_MPEG2
, 3);
4017 static MESON_GATE(g12a_htx_pclk
, HHI_GCLK_MPEG2
, 4);
4018 static MESON_GATE(g12a_bt656
, HHI_GCLK_MPEG2
, 6);
4019 static MESON_GATE(g12a_usb1_to_ddr
, HHI_GCLK_MPEG2
, 8);
4020 static MESON_GATE(g12a_mmc_pclk
, HHI_GCLK_MPEG2
, 11);
4021 static MESON_GATE(g12a_uart2
, HHI_GCLK_MPEG2
, 15);
4022 static MESON_GATE(g12a_vpu_intr
, HHI_GCLK_MPEG2
, 25);
4023 static MESON_GATE(g12a_gic
, HHI_GCLK_MPEG2
, 30);
4025 static MESON_GATE(g12a_vclk2_venci0
, HHI_GCLK_OTHER
, 1);
4026 static MESON_GATE(g12a_vclk2_venci1
, HHI_GCLK_OTHER
, 2);
4027 static MESON_GATE(g12a_vclk2_vencp0
, HHI_GCLK_OTHER
, 3);
4028 static MESON_GATE(g12a_vclk2_vencp1
, HHI_GCLK_OTHER
, 4);
4029 static MESON_GATE(g12a_vclk2_venct0
, HHI_GCLK_OTHER
, 5);
4030 static MESON_GATE(g12a_vclk2_venct1
, HHI_GCLK_OTHER
, 6);
4031 static MESON_GATE(g12a_vclk2_other
, HHI_GCLK_OTHER
, 7);
4032 static MESON_GATE(g12a_vclk2_enci
, HHI_GCLK_OTHER
, 8);
4033 static MESON_GATE(g12a_vclk2_encp
, HHI_GCLK_OTHER
, 9);
4034 static MESON_GATE(g12a_dac_clk
, HHI_GCLK_OTHER
, 10);
4035 static MESON_GATE(g12a_aoclk_gate
, HHI_GCLK_OTHER
, 14);
4036 static MESON_GATE(g12a_iec958_gate
, HHI_GCLK_OTHER
, 16);
4037 static MESON_GATE(g12a_enc480p
, HHI_GCLK_OTHER
, 20);
4038 static MESON_GATE(g12a_rng1
, HHI_GCLK_OTHER
, 21);
4039 static MESON_GATE(g12a_vclk2_enct
, HHI_GCLK_OTHER
, 22);
4040 static MESON_GATE(g12a_vclk2_encl
, HHI_GCLK_OTHER
, 23);
4041 static MESON_GATE(g12a_vclk2_venclmmc
, HHI_GCLK_OTHER
, 24);
4042 static MESON_GATE(g12a_vclk2_vencl
, HHI_GCLK_OTHER
, 25);
4043 static MESON_GATE(g12a_vclk2_other1
, HHI_GCLK_OTHER
, 26);
4045 static MESON_GATE_RO(g12a_dma
, HHI_GCLK_OTHER2
, 0);
4046 static MESON_GATE_RO(g12a_efuse
, HHI_GCLK_OTHER2
, 1);
4047 static MESON_GATE_RO(g12a_rom_boot
, HHI_GCLK_OTHER2
, 2);
4048 static MESON_GATE_RO(g12a_reset_sec
, HHI_GCLK_OTHER2
, 3);
4049 static MESON_GATE_RO(g12a_sec_ahb_apb3
, HHI_GCLK_OTHER2
, 4);
4051 /* Array of all clocks provided by this provider */
4052 static struct clk_hw_onecell_data g12a_hw_onecell_data
= {
4054 [CLKID_SYS_PLL
] = &g12a_sys_pll
.hw
,
4055 [CLKID_FIXED_PLL
] = &g12a_fixed_pll
.hw
,
4056 [CLKID_FCLK_DIV2
] = &g12a_fclk_div2
.hw
,
4057 [CLKID_FCLK_DIV3
] = &g12a_fclk_div3
.hw
,
4058 [CLKID_FCLK_DIV4
] = &g12a_fclk_div4
.hw
,
4059 [CLKID_FCLK_DIV5
] = &g12a_fclk_div5
.hw
,
4060 [CLKID_FCLK_DIV7
] = &g12a_fclk_div7
.hw
,
4061 [CLKID_FCLK_DIV2P5
] = &g12a_fclk_div2p5
.hw
,
4062 [CLKID_GP0_PLL
] = &g12a_gp0_pll
.hw
,
4063 [CLKID_MPEG_SEL
] = &g12a_mpeg_clk_sel
.hw
,
4064 [CLKID_MPEG_DIV
] = &g12a_mpeg_clk_div
.hw
,
4065 [CLKID_CLK81
] = &g12a_clk81
.hw
,
4066 [CLKID_MPLL0
] = &g12a_mpll0
.hw
,
4067 [CLKID_MPLL1
] = &g12a_mpll1
.hw
,
4068 [CLKID_MPLL2
] = &g12a_mpll2
.hw
,
4069 [CLKID_MPLL3
] = &g12a_mpll3
.hw
,
4070 [CLKID_DDR
] = &g12a_ddr
.hw
,
4071 [CLKID_DOS
] = &g12a_dos
.hw
,
4072 [CLKID_AUDIO_LOCKER
] = &g12a_audio_locker
.hw
,
4073 [CLKID_MIPI_DSI_HOST
] = &g12a_mipi_dsi_host
.hw
,
4074 [CLKID_ETH_PHY
] = &g12a_eth_phy
.hw
,
4075 [CLKID_ISA
] = &g12a_isa
.hw
,
4076 [CLKID_PL301
] = &g12a_pl301
.hw
,
4077 [CLKID_PERIPHS
] = &g12a_periphs
.hw
,
4078 [CLKID_SPICC0
] = &g12a_spicc_0
.hw
,
4079 [CLKID_I2C
] = &g12a_i2c
.hw
,
4080 [CLKID_SANA
] = &g12a_sana
.hw
,
4081 [CLKID_SD
] = &g12a_sd
.hw
,
4082 [CLKID_RNG0
] = &g12a_rng0
.hw
,
4083 [CLKID_UART0
] = &g12a_uart0
.hw
,
4084 [CLKID_SPICC1
] = &g12a_spicc_1
.hw
,
4085 [CLKID_HIU_IFACE
] = &g12a_hiu_reg
.hw
,
4086 [CLKID_MIPI_DSI_PHY
] = &g12a_mipi_dsi_phy
.hw
,
4087 [CLKID_ASSIST_MISC
] = &g12a_assist_misc
.hw
,
4088 [CLKID_SD_EMMC_A
] = &g12a_emmc_a
.hw
,
4089 [CLKID_SD_EMMC_B
] = &g12a_emmc_b
.hw
,
4090 [CLKID_SD_EMMC_C
] = &g12a_emmc_c
.hw
,
4091 [CLKID_AUDIO_CODEC
] = &g12a_audio_codec
.hw
,
4092 [CLKID_AUDIO
] = &g12a_audio
.hw
,
4093 [CLKID_ETH
] = &g12a_eth_core
.hw
,
4094 [CLKID_DEMUX
] = &g12a_demux
.hw
,
4095 [CLKID_AUDIO_IFIFO
] = &g12a_audio_ififo
.hw
,
4096 [CLKID_ADC
] = &g12a_adc
.hw
,
4097 [CLKID_UART1
] = &g12a_uart1
.hw
,
4098 [CLKID_G2D
] = &g12a_g2d
.hw
,
4099 [CLKID_RESET
] = &g12a_reset
.hw
,
4100 [CLKID_PCIE_COMB
] = &g12a_pcie_comb
.hw
,
4101 [CLKID_PARSER
] = &g12a_parser
.hw
,
4102 [CLKID_USB
] = &g12a_usb_general
.hw
,
4103 [CLKID_PCIE_PHY
] = &g12a_pcie_phy
.hw
,
4104 [CLKID_AHB_ARB0
] = &g12a_ahb_arb0
.hw
,
4105 [CLKID_AHB_DATA_BUS
] = &g12a_ahb_data_bus
.hw
,
4106 [CLKID_AHB_CTRL_BUS
] = &g12a_ahb_ctrl_bus
.hw
,
4107 [CLKID_HTX_HDCP22
] = &g12a_htx_hdcp22
.hw
,
4108 [CLKID_HTX_PCLK
] = &g12a_htx_pclk
.hw
,
4109 [CLKID_BT656
] = &g12a_bt656
.hw
,
4110 [CLKID_USB1_DDR_BRIDGE
] = &g12a_usb1_to_ddr
.hw
,
4111 [CLKID_MMC_PCLK
] = &g12a_mmc_pclk
.hw
,
4112 [CLKID_UART2
] = &g12a_uart2
.hw
,
4113 [CLKID_VPU_INTR
] = &g12a_vpu_intr
.hw
,
4114 [CLKID_GIC
] = &g12a_gic
.hw
,
4115 [CLKID_SD_EMMC_A_CLK0_SEL
] = &g12a_sd_emmc_a_clk0_sel
.hw
,
4116 [CLKID_SD_EMMC_A_CLK0_DIV
] = &g12a_sd_emmc_a_clk0_div
.hw
,
4117 [CLKID_SD_EMMC_A_CLK0
] = &g12a_sd_emmc_a_clk0
.hw
,
4118 [CLKID_SD_EMMC_B_CLK0_SEL
] = &g12a_sd_emmc_b_clk0_sel
.hw
,
4119 [CLKID_SD_EMMC_B_CLK0_DIV
] = &g12a_sd_emmc_b_clk0_div
.hw
,
4120 [CLKID_SD_EMMC_B_CLK0
] = &g12a_sd_emmc_b_clk0
.hw
,
4121 [CLKID_SD_EMMC_C_CLK0_SEL
] = &g12a_sd_emmc_c_clk0_sel
.hw
,
4122 [CLKID_SD_EMMC_C_CLK0_DIV
] = &g12a_sd_emmc_c_clk0_div
.hw
,
4123 [CLKID_SD_EMMC_C_CLK0
] = &g12a_sd_emmc_c_clk0
.hw
,
4124 [CLKID_MPLL0_DIV
] = &g12a_mpll0_div
.hw
,
4125 [CLKID_MPLL1_DIV
] = &g12a_mpll1_div
.hw
,
4126 [CLKID_MPLL2_DIV
] = &g12a_mpll2_div
.hw
,
4127 [CLKID_MPLL3_DIV
] = &g12a_mpll3_div
.hw
,
4128 [CLKID_FCLK_DIV2_DIV
] = &g12a_fclk_div2_div
.hw
,
4129 [CLKID_FCLK_DIV3_DIV
] = &g12a_fclk_div3_div
.hw
,
4130 [CLKID_FCLK_DIV4_DIV
] = &g12a_fclk_div4_div
.hw
,
4131 [CLKID_FCLK_DIV5_DIV
] = &g12a_fclk_div5_div
.hw
,
4132 [CLKID_FCLK_DIV7_DIV
] = &g12a_fclk_div7_div
.hw
,
4133 [CLKID_FCLK_DIV2P5_DIV
] = &g12a_fclk_div2p5_div
.hw
,
4134 [CLKID_HIFI_PLL
] = &g12a_hifi_pll
.hw
,
4135 [CLKID_VCLK2_VENCI0
] = &g12a_vclk2_venci0
.hw
,
4136 [CLKID_VCLK2_VENCI1
] = &g12a_vclk2_venci1
.hw
,
4137 [CLKID_VCLK2_VENCP0
] = &g12a_vclk2_vencp0
.hw
,
4138 [CLKID_VCLK2_VENCP1
] = &g12a_vclk2_vencp1
.hw
,
4139 [CLKID_VCLK2_VENCT0
] = &g12a_vclk2_venct0
.hw
,
4140 [CLKID_VCLK2_VENCT1
] = &g12a_vclk2_venct1
.hw
,
4141 [CLKID_VCLK2_OTHER
] = &g12a_vclk2_other
.hw
,
4142 [CLKID_VCLK2_ENCI
] = &g12a_vclk2_enci
.hw
,
4143 [CLKID_VCLK2_ENCP
] = &g12a_vclk2_encp
.hw
,
4144 [CLKID_DAC_CLK
] = &g12a_dac_clk
.hw
,
4145 [CLKID_AOCLK
] = &g12a_aoclk_gate
.hw
,
4146 [CLKID_IEC958
] = &g12a_iec958_gate
.hw
,
4147 [CLKID_ENC480P
] = &g12a_enc480p
.hw
,
4148 [CLKID_RNG1
] = &g12a_rng1
.hw
,
4149 [CLKID_VCLK2_ENCT
] = &g12a_vclk2_enct
.hw
,
4150 [CLKID_VCLK2_ENCL
] = &g12a_vclk2_encl
.hw
,
4151 [CLKID_VCLK2_VENCLMMC
] = &g12a_vclk2_venclmmc
.hw
,
4152 [CLKID_VCLK2_VENCL
] = &g12a_vclk2_vencl
.hw
,
4153 [CLKID_VCLK2_OTHER1
] = &g12a_vclk2_other1
.hw
,
4154 [CLKID_FIXED_PLL_DCO
] = &g12a_fixed_pll_dco
.hw
,
4155 [CLKID_SYS_PLL_DCO
] = &g12a_sys_pll_dco
.hw
,
4156 [CLKID_GP0_PLL_DCO
] = &g12a_gp0_pll_dco
.hw
,
4157 [CLKID_HIFI_PLL_DCO
] = &g12a_hifi_pll_dco
.hw
,
4158 [CLKID_DMA
] = &g12a_dma
.hw
,
4159 [CLKID_EFUSE
] = &g12a_efuse
.hw
,
4160 [CLKID_ROM_BOOT
] = &g12a_rom_boot
.hw
,
4161 [CLKID_RESET_SEC
] = &g12a_reset_sec
.hw
,
4162 [CLKID_SEC_AHB_APB3
] = &g12a_sec_ahb_apb3
.hw
,
4163 [CLKID_MPLL_PREDIV
] = &g12a_mpll_prediv
.hw
,
4164 [CLKID_VPU_0_SEL
] = &g12a_vpu_0_sel
.hw
,
4165 [CLKID_VPU_0_DIV
] = &g12a_vpu_0_div
.hw
,
4166 [CLKID_VPU_0
] = &g12a_vpu_0
.hw
,
4167 [CLKID_VPU_1_SEL
] = &g12a_vpu_1_sel
.hw
,
4168 [CLKID_VPU_1_DIV
] = &g12a_vpu_1_div
.hw
,
4169 [CLKID_VPU_1
] = &g12a_vpu_1
.hw
,
4170 [CLKID_VPU
] = &g12a_vpu
.hw
,
4171 [CLKID_VAPB_0_SEL
] = &g12a_vapb_0_sel
.hw
,
4172 [CLKID_VAPB_0_DIV
] = &g12a_vapb_0_div
.hw
,
4173 [CLKID_VAPB_0
] = &g12a_vapb_0
.hw
,
4174 [CLKID_VAPB_1_SEL
] = &g12a_vapb_1_sel
.hw
,
4175 [CLKID_VAPB_1_DIV
] = &g12a_vapb_1_div
.hw
,
4176 [CLKID_VAPB_1
] = &g12a_vapb_1
.hw
,
4177 [CLKID_VAPB_SEL
] = &g12a_vapb_sel
.hw
,
4178 [CLKID_VAPB
] = &g12a_vapb
.hw
,
4179 [CLKID_HDMI_PLL_DCO
] = &g12a_hdmi_pll_dco
.hw
,
4180 [CLKID_HDMI_PLL_OD
] = &g12a_hdmi_pll_od
.hw
,
4181 [CLKID_HDMI_PLL_OD2
] = &g12a_hdmi_pll_od2
.hw
,
4182 [CLKID_HDMI_PLL
] = &g12a_hdmi_pll
.hw
,
4183 [CLKID_VID_PLL
] = &g12a_vid_pll_div
.hw
,
4184 [CLKID_VID_PLL_SEL
] = &g12a_vid_pll_sel
.hw
,
4185 [CLKID_VID_PLL_DIV
] = &g12a_vid_pll
.hw
,
4186 [CLKID_VCLK_SEL
] = &g12a_vclk_sel
.hw
,
4187 [CLKID_VCLK2_SEL
] = &g12a_vclk2_sel
.hw
,
4188 [CLKID_VCLK_INPUT
] = &g12a_vclk_input
.hw
,
4189 [CLKID_VCLK2_INPUT
] = &g12a_vclk2_input
.hw
,
4190 [CLKID_VCLK_DIV
] = &g12a_vclk_div
.hw
,
4191 [CLKID_VCLK2_DIV
] = &g12a_vclk2_div
.hw
,
4192 [CLKID_VCLK
] = &g12a_vclk
.hw
,
4193 [CLKID_VCLK2
] = &g12a_vclk2
.hw
,
4194 [CLKID_VCLK_DIV1
] = &g12a_vclk_div1
.hw
,
4195 [CLKID_VCLK_DIV2_EN
] = &g12a_vclk_div2_en
.hw
,
4196 [CLKID_VCLK_DIV4_EN
] = &g12a_vclk_div4_en
.hw
,
4197 [CLKID_VCLK_DIV6_EN
] = &g12a_vclk_div6_en
.hw
,
4198 [CLKID_VCLK_DIV12_EN
] = &g12a_vclk_div12_en
.hw
,
4199 [CLKID_VCLK2_DIV1
] = &g12a_vclk2_div1
.hw
,
4200 [CLKID_VCLK2_DIV2_EN
] = &g12a_vclk2_div2_en
.hw
,
4201 [CLKID_VCLK2_DIV4_EN
] = &g12a_vclk2_div4_en
.hw
,
4202 [CLKID_VCLK2_DIV6_EN
] = &g12a_vclk2_div6_en
.hw
,
4203 [CLKID_VCLK2_DIV12_EN
] = &g12a_vclk2_div12_en
.hw
,
4204 [CLKID_VCLK_DIV2
] = &g12a_vclk_div2
.hw
,
4205 [CLKID_VCLK_DIV4
] = &g12a_vclk_div4
.hw
,
4206 [CLKID_VCLK_DIV6
] = &g12a_vclk_div6
.hw
,
4207 [CLKID_VCLK_DIV12
] = &g12a_vclk_div12
.hw
,
4208 [CLKID_VCLK2_DIV2
] = &g12a_vclk2_div2
.hw
,
4209 [CLKID_VCLK2_DIV4
] = &g12a_vclk2_div4
.hw
,
4210 [CLKID_VCLK2_DIV6
] = &g12a_vclk2_div6
.hw
,
4211 [CLKID_VCLK2_DIV12
] = &g12a_vclk2_div12
.hw
,
4212 [CLKID_CTS_ENCI_SEL
] = &g12a_cts_enci_sel
.hw
,
4213 [CLKID_CTS_ENCP_SEL
] = &g12a_cts_encp_sel
.hw
,
4214 [CLKID_CTS_VDAC_SEL
] = &g12a_cts_vdac_sel
.hw
,
4215 [CLKID_HDMI_TX_SEL
] = &g12a_hdmi_tx_sel
.hw
,
4216 [CLKID_CTS_ENCI
] = &g12a_cts_enci
.hw
,
4217 [CLKID_CTS_ENCP
] = &g12a_cts_encp
.hw
,
4218 [CLKID_CTS_VDAC
] = &g12a_cts_vdac
.hw
,
4219 [CLKID_HDMI_TX
] = &g12a_hdmi_tx
.hw
,
4220 [CLKID_HDMI_SEL
] = &g12a_hdmi_sel
.hw
,
4221 [CLKID_HDMI_DIV
] = &g12a_hdmi_div
.hw
,
4222 [CLKID_HDMI
] = &g12a_hdmi
.hw
,
4223 [CLKID_MALI_0_SEL
] = &g12a_mali_0_sel
.hw
,
4224 [CLKID_MALI_0_DIV
] = &g12a_mali_0_div
.hw
,
4225 [CLKID_MALI_0
] = &g12a_mali_0
.hw
,
4226 [CLKID_MALI_1_SEL
] = &g12a_mali_1_sel
.hw
,
4227 [CLKID_MALI_1_DIV
] = &g12a_mali_1_div
.hw
,
4228 [CLKID_MALI_1
] = &g12a_mali_1
.hw
,
4229 [CLKID_MALI
] = &g12a_mali
.hw
,
4230 [CLKID_MPLL_50M_DIV
] = &g12a_mpll_50m_div
.hw
,
4231 [CLKID_MPLL_50M
] = &g12a_mpll_50m
.hw
,
4232 [CLKID_SYS_PLL_DIV16_EN
] = &g12a_sys_pll_div16_en
.hw
,
4233 [CLKID_SYS_PLL_DIV16
] = &g12a_sys_pll_div16
.hw
,
4234 [CLKID_CPU_CLK_DYN0_SEL
] = &g12a_cpu_clk_premux0
.hw
,
4235 [CLKID_CPU_CLK_DYN0_DIV
] = &g12a_cpu_clk_mux0_div
.hw
,
4236 [CLKID_CPU_CLK_DYN0
] = &g12a_cpu_clk_postmux0
.hw
,
4237 [CLKID_CPU_CLK_DYN1_SEL
] = &g12a_cpu_clk_premux1
.hw
,
4238 [CLKID_CPU_CLK_DYN1_DIV
] = &g12a_cpu_clk_mux1_div
.hw
,
4239 [CLKID_CPU_CLK_DYN1
] = &g12a_cpu_clk_postmux1
.hw
,
4240 [CLKID_CPU_CLK_DYN
] = &g12a_cpu_clk_dyn
.hw
,
4241 [CLKID_CPU_CLK
] = &g12a_cpu_clk
.hw
,
4242 [CLKID_CPU_CLK_DIV16_EN
] = &g12a_cpu_clk_div16_en
.hw
,
4243 [CLKID_CPU_CLK_DIV16
] = &g12a_cpu_clk_div16
.hw
,
4244 [CLKID_CPU_CLK_APB_DIV
] = &g12a_cpu_clk_apb_div
.hw
,
4245 [CLKID_CPU_CLK_APB
] = &g12a_cpu_clk_apb
.hw
,
4246 [CLKID_CPU_CLK_ATB_DIV
] = &g12a_cpu_clk_atb_div
.hw
,
4247 [CLKID_CPU_CLK_ATB
] = &g12a_cpu_clk_atb
.hw
,
4248 [CLKID_CPU_CLK_AXI_DIV
] = &g12a_cpu_clk_axi_div
.hw
,
4249 [CLKID_CPU_CLK_AXI
] = &g12a_cpu_clk_axi
.hw
,
4250 [CLKID_CPU_CLK_TRACE_DIV
] = &g12a_cpu_clk_trace_div
.hw
,
4251 [CLKID_CPU_CLK_TRACE
] = &g12a_cpu_clk_trace
.hw
,
4252 [CLKID_PCIE_PLL_DCO
] = &g12a_pcie_pll_dco
.hw
,
4253 [CLKID_PCIE_PLL_DCO_DIV2
] = &g12a_pcie_pll_dco_div2
.hw
,
4254 [CLKID_PCIE_PLL_OD
] = &g12a_pcie_pll_od
.hw
,
4255 [CLKID_PCIE_PLL
] = &g12a_pcie_pll
.hw
,
4256 [CLKID_VDEC_1_SEL
] = &g12a_vdec_1_sel
.hw
,
4257 [CLKID_VDEC_1_DIV
] = &g12a_vdec_1_div
.hw
,
4258 [CLKID_VDEC_1
] = &g12a_vdec_1
.hw
,
4259 [CLKID_VDEC_HEVC_SEL
] = &g12a_vdec_hevc_sel
.hw
,
4260 [CLKID_VDEC_HEVC_DIV
] = &g12a_vdec_hevc_div
.hw
,
4261 [CLKID_VDEC_HEVC
] = &g12a_vdec_hevc
.hw
,
4262 [CLKID_VDEC_HEVCF_SEL
] = &g12a_vdec_hevcf_sel
.hw
,
4263 [CLKID_VDEC_HEVCF_DIV
] = &g12a_vdec_hevcf_div
.hw
,
4264 [CLKID_VDEC_HEVCF
] = &g12a_vdec_hevcf
.hw
,
4265 [CLKID_TS_DIV
] = &g12a_ts_div
.hw
,
4266 [CLKID_TS
] = &g12a_ts
.hw
,
4267 [CLKID_SPICC0_SCLK_SEL
] = &g12a_spicc0_sclk_sel
.hw
,
4268 [CLKID_SPICC0_SCLK_DIV
] = &g12a_spicc0_sclk_div
.hw
,
4269 [CLKID_SPICC0_SCLK
] = &g12a_spicc0_sclk
.hw
,
4270 [CLKID_SPICC1_SCLK_SEL
] = &g12a_spicc1_sclk_sel
.hw
,
4271 [CLKID_SPICC1_SCLK_DIV
] = &g12a_spicc1_sclk_div
.hw
,
4272 [CLKID_SPICC1_SCLK
] = &g12a_spicc1_sclk
.hw
,
4278 static struct clk_hw_onecell_data g12b_hw_onecell_data
= {
4280 [CLKID_SYS_PLL
] = &g12a_sys_pll
.hw
,
4281 [CLKID_FIXED_PLL
] = &g12a_fixed_pll
.hw
,
4282 [CLKID_FCLK_DIV2
] = &g12a_fclk_div2
.hw
,
4283 [CLKID_FCLK_DIV3
] = &g12a_fclk_div3
.hw
,
4284 [CLKID_FCLK_DIV4
] = &g12a_fclk_div4
.hw
,
4285 [CLKID_FCLK_DIV5
] = &g12a_fclk_div5
.hw
,
4286 [CLKID_FCLK_DIV7
] = &g12a_fclk_div7
.hw
,
4287 [CLKID_FCLK_DIV2P5
] = &g12a_fclk_div2p5
.hw
,
4288 [CLKID_GP0_PLL
] = &g12a_gp0_pll
.hw
,
4289 [CLKID_MPEG_SEL
] = &g12a_mpeg_clk_sel
.hw
,
4290 [CLKID_MPEG_DIV
] = &g12a_mpeg_clk_div
.hw
,
4291 [CLKID_CLK81
] = &g12a_clk81
.hw
,
4292 [CLKID_MPLL0
] = &g12a_mpll0
.hw
,
4293 [CLKID_MPLL1
] = &g12a_mpll1
.hw
,
4294 [CLKID_MPLL2
] = &g12a_mpll2
.hw
,
4295 [CLKID_MPLL3
] = &g12a_mpll3
.hw
,
4296 [CLKID_DDR
] = &g12a_ddr
.hw
,
4297 [CLKID_DOS
] = &g12a_dos
.hw
,
4298 [CLKID_AUDIO_LOCKER
] = &g12a_audio_locker
.hw
,
4299 [CLKID_MIPI_DSI_HOST
] = &g12a_mipi_dsi_host
.hw
,
4300 [CLKID_ETH_PHY
] = &g12a_eth_phy
.hw
,
4301 [CLKID_ISA
] = &g12a_isa
.hw
,
4302 [CLKID_PL301
] = &g12a_pl301
.hw
,
4303 [CLKID_PERIPHS
] = &g12a_periphs
.hw
,
4304 [CLKID_SPICC0
] = &g12a_spicc_0
.hw
,
4305 [CLKID_I2C
] = &g12a_i2c
.hw
,
4306 [CLKID_SANA
] = &g12a_sana
.hw
,
4307 [CLKID_SD
] = &g12a_sd
.hw
,
4308 [CLKID_RNG0
] = &g12a_rng0
.hw
,
4309 [CLKID_UART0
] = &g12a_uart0
.hw
,
4310 [CLKID_SPICC1
] = &g12a_spicc_1
.hw
,
4311 [CLKID_HIU_IFACE
] = &g12a_hiu_reg
.hw
,
4312 [CLKID_MIPI_DSI_PHY
] = &g12a_mipi_dsi_phy
.hw
,
4313 [CLKID_ASSIST_MISC
] = &g12a_assist_misc
.hw
,
4314 [CLKID_SD_EMMC_A
] = &g12a_emmc_a
.hw
,
4315 [CLKID_SD_EMMC_B
] = &g12a_emmc_b
.hw
,
4316 [CLKID_SD_EMMC_C
] = &g12a_emmc_c
.hw
,
4317 [CLKID_AUDIO_CODEC
] = &g12a_audio_codec
.hw
,
4318 [CLKID_AUDIO
] = &g12a_audio
.hw
,
4319 [CLKID_ETH
] = &g12a_eth_core
.hw
,
4320 [CLKID_DEMUX
] = &g12a_demux
.hw
,
4321 [CLKID_AUDIO_IFIFO
] = &g12a_audio_ififo
.hw
,
4322 [CLKID_ADC
] = &g12a_adc
.hw
,
4323 [CLKID_UART1
] = &g12a_uart1
.hw
,
4324 [CLKID_G2D
] = &g12a_g2d
.hw
,
4325 [CLKID_RESET
] = &g12a_reset
.hw
,
4326 [CLKID_PCIE_COMB
] = &g12a_pcie_comb
.hw
,
4327 [CLKID_PARSER
] = &g12a_parser
.hw
,
4328 [CLKID_USB
] = &g12a_usb_general
.hw
,
4329 [CLKID_PCIE_PHY
] = &g12a_pcie_phy
.hw
,
4330 [CLKID_AHB_ARB0
] = &g12a_ahb_arb0
.hw
,
4331 [CLKID_AHB_DATA_BUS
] = &g12a_ahb_data_bus
.hw
,
4332 [CLKID_AHB_CTRL_BUS
] = &g12a_ahb_ctrl_bus
.hw
,
4333 [CLKID_HTX_HDCP22
] = &g12a_htx_hdcp22
.hw
,
4334 [CLKID_HTX_PCLK
] = &g12a_htx_pclk
.hw
,
4335 [CLKID_BT656
] = &g12a_bt656
.hw
,
4336 [CLKID_USB1_DDR_BRIDGE
] = &g12a_usb1_to_ddr
.hw
,
4337 [CLKID_MMC_PCLK
] = &g12a_mmc_pclk
.hw
,
4338 [CLKID_UART2
] = &g12a_uart2
.hw
,
4339 [CLKID_VPU_INTR
] = &g12a_vpu_intr
.hw
,
4340 [CLKID_GIC
] = &g12a_gic
.hw
,
4341 [CLKID_SD_EMMC_A_CLK0_SEL
] = &g12a_sd_emmc_a_clk0_sel
.hw
,
4342 [CLKID_SD_EMMC_A_CLK0_DIV
] = &g12a_sd_emmc_a_clk0_div
.hw
,
4343 [CLKID_SD_EMMC_A_CLK0
] = &g12a_sd_emmc_a_clk0
.hw
,
4344 [CLKID_SD_EMMC_B_CLK0_SEL
] = &g12a_sd_emmc_b_clk0_sel
.hw
,
4345 [CLKID_SD_EMMC_B_CLK0_DIV
] = &g12a_sd_emmc_b_clk0_div
.hw
,
4346 [CLKID_SD_EMMC_B_CLK0
] = &g12a_sd_emmc_b_clk0
.hw
,
4347 [CLKID_SD_EMMC_C_CLK0_SEL
] = &g12a_sd_emmc_c_clk0_sel
.hw
,
4348 [CLKID_SD_EMMC_C_CLK0_DIV
] = &g12a_sd_emmc_c_clk0_div
.hw
,
4349 [CLKID_SD_EMMC_C_CLK0
] = &g12a_sd_emmc_c_clk0
.hw
,
4350 [CLKID_MPLL0_DIV
] = &g12a_mpll0_div
.hw
,
4351 [CLKID_MPLL1_DIV
] = &g12a_mpll1_div
.hw
,
4352 [CLKID_MPLL2_DIV
] = &g12a_mpll2_div
.hw
,
4353 [CLKID_MPLL3_DIV
] = &g12a_mpll3_div
.hw
,
4354 [CLKID_FCLK_DIV2_DIV
] = &g12a_fclk_div2_div
.hw
,
4355 [CLKID_FCLK_DIV3_DIV
] = &g12a_fclk_div3_div
.hw
,
4356 [CLKID_FCLK_DIV4_DIV
] = &g12a_fclk_div4_div
.hw
,
4357 [CLKID_FCLK_DIV5_DIV
] = &g12a_fclk_div5_div
.hw
,
4358 [CLKID_FCLK_DIV7_DIV
] = &g12a_fclk_div7_div
.hw
,
4359 [CLKID_FCLK_DIV2P5_DIV
] = &g12a_fclk_div2p5_div
.hw
,
4360 [CLKID_HIFI_PLL
] = &g12a_hifi_pll
.hw
,
4361 [CLKID_VCLK2_VENCI0
] = &g12a_vclk2_venci0
.hw
,
4362 [CLKID_VCLK2_VENCI1
] = &g12a_vclk2_venci1
.hw
,
4363 [CLKID_VCLK2_VENCP0
] = &g12a_vclk2_vencp0
.hw
,
4364 [CLKID_VCLK2_VENCP1
] = &g12a_vclk2_vencp1
.hw
,
4365 [CLKID_VCLK2_VENCT0
] = &g12a_vclk2_venct0
.hw
,
4366 [CLKID_VCLK2_VENCT1
] = &g12a_vclk2_venct1
.hw
,
4367 [CLKID_VCLK2_OTHER
] = &g12a_vclk2_other
.hw
,
4368 [CLKID_VCLK2_ENCI
] = &g12a_vclk2_enci
.hw
,
4369 [CLKID_VCLK2_ENCP
] = &g12a_vclk2_encp
.hw
,
4370 [CLKID_DAC_CLK
] = &g12a_dac_clk
.hw
,
4371 [CLKID_AOCLK
] = &g12a_aoclk_gate
.hw
,
4372 [CLKID_IEC958
] = &g12a_iec958_gate
.hw
,
4373 [CLKID_ENC480P
] = &g12a_enc480p
.hw
,
4374 [CLKID_RNG1
] = &g12a_rng1
.hw
,
4375 [CLKID_VCLK2_ENCT
] = &g12a_vclk2_enct
.hw
,
4376 [CLKID_VCLK2_ENCL
] = &g12a_vclk2_encl
.hw
,
4377 [CLKID_VCLK2_VENCLMMC
] = &g12a_vclk2_venclmmc
.hw
,
4378 [CLKID_VCLK2_VENCL
] = &g12a_vclk2_vencl
.hw
,
4379 [CLKID_VCLK2_OTHER1
] = &g12a_vclk2_other1
.hw
,
4380 [CLKID_FIXED_PLL_DCO
] = &g12a_fixed_pll_dco
.hw
,
4381 [CLKID_SYS_PLL_DCO
] = &g12a_sys_pll_dco
.hw
,
4382 [CLKID_GP0_PLL_DCO
] = &g12a_gp0_pll_dco
.hw
,
4383 [CLKID_HIFI_PLL_DCO
] = &g12a_hifi_pll_dco
.hw
,
4384 [CLKID_DMA
] = &g12a_dma
.hw
,
4385 [CLKID_EFUSE
] = &g12a_efuse
.hw
,
4386 [CLKID_ROM_BOOT
] = &g12a_rom_boot
.hw
,
4387 [CLKID_RESET_SEC
] = &g12a_reset_sec
.hw
,
4388 [CLKID_SEC_AHB_APB3
] = &g12a_sec_ahb_apb3
.hw
,
4389 [CLKID_MPLL_PREDIV
] = &g12a_mpll_prediv
.hw
,
4390 [CLKID_VPU_0_SEL
] = &g12a_vpu_0_sel
.hw
,
4391 [CLKID_VPU_0_DIV
] = &g12a_vpu_0_div
.hw
,
4392 [CLKID_VPU_0
] = &g12a_vpu_0
.hw
,
4393 [CLKID_VPU_1_SEL
] = &g12a_vpu_1_sel
.hw
,
4394 [CLKID_VPU_1_DIV
] = &g12a_vpu_1_div
.hw
,
4395 [CLKID_VPU_1
] = &g12a_vpu_1
.hw
,
4396 [CLKID_VPU
] = &g12a_vpu
.hw
,
4397 [CLKID_VAPB_0_SEL
] = &g12a_vapb_0_sel
.hw
,
4398 [CLKID_VAPB_0_DIV
] = &g12a_vapb_0_div
.hw
,
4399 [CLKID_VAPB_0
] = &g12a_vapb_0
.hw
,
4400 [CLKID_VAPB_1_SEL
] = &g12a_vapb_1_sel
.hw
,
4401 [CLKID_VAPB_1_DIV
] = &g12a_vapb_1_div
.hw
,
4402 [CLKID_VAPB_1
] = &g12a_vapb_1
.hw
,
4403 [CLKID_VAPB_SEL
] = &g12a_vapb_sel
.hw
,
4404 [CLKID_VAPB
] = &g12a_vapb
.hw
,
4405 [CLKID_HDMI_PLL_DCO
] = &g12a_hdmi_pll_dco
.hw
,
4406 [CLKID_HDMI_PLL_OD
] = &g12a_hdmi_pll_od
.hw
,
4407 [CLKID_HDMI_PLL_OD2
] = &g12a_hdmi_pll_od2
.hw
,
4408 [CLKID_HDMI_PLL
] = &g12a_hdmi_pll
.hw
,
4409 [CLKID_VID_PLL
] = &g12a_vid_pll_div
.hw
,
4410 [CLKID_VID_PLL_SEL
] = &g12a_vid_pll_sel
.hw
,
4411 [CLKID_VID_PLL_DIV
] = &g12a_vid_pll
.hw
,
4412 [CLKID_VCLK_SEL
] = &g12a_vclk_sel
.hw
,
4413 [CLKID_VCLK2_SEL
] = &g12a_vclk2_sel
.hw
,
4414 [CLKID_VCLK_INPUT
] = &g12a_vclk_input
.hw
,
4415 [CLKID_VCLK2_INPUT
] = &g12a_vclk2_input
.hw
,
4416 [CLKID_VCLK_DIV
] = &g12a_vclk_div
.hw
,
4417 [CLKID_VCLK2_DIV
] = &g12a_vclk2_div
.hw
,
4418 [CLKID_VCLK
] = &g12a_vclk
.hw
,
4419 [CLKID_VCLK2
] = &g12a_vclk2
.hw
,
4420 [CLKID_VCLK_DIV1
] = &g12a_vclk_div1
.hw
,
4421 [CLKID_VCLK_DIV2_EN
] = &g12a_vclk_div2_en
.hw
,
4422 [CLKID_VCLK_DIV4_EN
] = &g12a_vclk_div4_en
.hw
,
4423 [CLKID_VCLK_DIV6_EN
] = &g12a_vclk_div6_en
.hw
,
4424 [CLKID_VCLK_DIV12_EN
] = &g12a_vclk_div12_en
.hw
,
4425 [CLKID_VCLK2_DIV1
] = &g12a_vclk2_div1
.hw
,
4426 [CLKID_VCLK2_DIV2_EN
] = &g12a_vclk2_div2_en
.hw
,
4427 [CLKID_VCLK2_DIV4_EN
] = &g12a_vclk2_div4_en
.hw
,
4428 [CLKID_VCLK2_DIV6_EN
] = &g12a_vclk2_div6_en
.hw
,
4429 [CLKID_VCLK2_DIV12_EN
] = &g12a_vclk2_div12_en
.hw
,
4430 [CLKID_VCLK_DIV2
] = &g12a_vclk_div2
.hw
,
4431 [CLKID_VCLK_DIV4
] = &g12a_vclk_div4
.hw
,
4432 [CLKID_VCLK_DIV6
] = &g12a_vclk_div6
.hw
,
4433 [CLKID_VCLK_DIV12
] = &g12a_vclk_div12
.hw
,
4434 [CLKID_VCLK2_DIV2
] = &g12a_vclk2_div2
.hw
,
4435 [CLKID_VCLK2_DIV4
] = &g12a_vclk2_div4
.hw
,
4436 [CLKID_VCLK2_DIV6
] = &g12a_vclk2_div6
.hw
,
4437 [CLKID_VCLK2_DIV12
] = &g12a_vclk2_div12
.hw
,
4438 [CLKID_CTS_ENCI_SEL
] = &g12a_cts_enci_sel
.hw
,
4439 [CLKID_CTS_ENCP_SEL
] = &g12a_cts_encp_sel
.hw
,
4440 [CLKID_CTS_VDAC_SEL
] = &g12a_cts_vdac_sel
.hw
,
4441 [CLKID_HDMI_TX_SEL
] = &g12a_hdmi_tx_sel
.hw
,
4442 [CLKID_CTS_ENCI
] = &g12a_cts_enci
.hw
,
4443 [CLKID_CTS_ENCP
] = &g12a_cts_encp
.hw
,
4444 [CLKID_CTS_VDAC
] = &g12a_cts_vdac
.hw
,
4445 [CLKID_HDMI_TX
] = &g12a_hdmi_tx
.hw
,
4446 [CLKID_HDMI_SEL
] = &g12a_hdmi_sel
.hw
,
4447 [CLKID_HDMI_DIV
] = &g12a_hdmi_div
.hw
,
4448 [CLKID_HDMI
] = &g12a_hdmi
.hw
,
4449 [CLKID_MALI_0_SEL
] = &g12a_mali_0_sel
.hw
,
4450 [CLKID_MALI_0_DIV
] = &g12a_mali_0_div
.hw
,
4451 [CLKID_MALI_0
] = &g12a_mali_0
.hw
,
4452 [CLKID_MALI_1_SEL
] = &g12a_mali_1_sel
.hw
,
4453 [CLKID_MALI_1_DIV
] = &g12a_mali_1_div
.hw
,
4454 [CLKID_MALI_1
] = &g12a_mali_1
.hw
,
4455 [CLKID_MALI
] = &g12a_mali
.hw
,
4456 [CLKID_MPLL_50M_DIV
] = &g12a_mpll_50m_div
.hw
,
4457 [CLKID_MPLL_50M
] = &g12a_mpll_50m
.hw
,
4458 [CLKID_SYS_PLL_DIV16_EN
] = &g12a_sys_pll_div16_en
.hw
,
4459 [CLKID_SYS_PLL_DIV16
] = &g12a_sys_pll_div16
.hw
,
4460 [CLKID_CPU_CLK_DYN0_SEL
] = &g12a_cpu_clk_premux0
.hw
,
4461 [CLKID_CPU_CLK_DYN0_DIV
] = &g12a_cpu_clk_mux0_div
.hw
,
4462 [CLKID_CPU_CLK_DYN0
] = &g12a_cpu_clk_postmux0
.hw
,
4463 [CLKID_CPU_CLK_DYN1_SEL
] = &g12a_cpu_clk_premux1
.hw
,
4464 [CLKID_CPU_CLK_DYN1_DIV
] = &g12a_cpu_clk_mux1_div
.hw
,
4465 [CLKID_CPU_CLK_DYN1
] = &g12a_cpu_clk_postmux1
.hw
,
4466 [CLKID_CPU_CLK_DYN
] = &g12a_cpu_clk_dyn
.hw
,
4467 [CLKID_CPU_CLK
] = &g12b_cpu_clk
.hw
,
4468 [CLKID_CPU_CLK_DIV16_EN
] = &g12a_cpu_clk_div16_en
.hw
,
4469 [CLKID_CPU_CLK_DIV16
] = &g12a_cpu_clk_div16
.hw
,
4470 [CLKID_CPU_CLK_APB_DIV
] = &g12a_cpu_clk_apb_div
.hw
,
4471 [CLKID_CPU_CLK_APB
] = &g12a_cpu_clk_apb
.hw
,
4472 [CLKID_CPU_CLK_ATB_DIV
] = &g12a_cpu_clk_atb_div
.hw
,
4473 [CLKID_CPU_CLK_ATB
] = &g12a_cpu_clk_atb
.hw
,
4474 [CLKID_CPU_CLK_AXI_DIV
] = &g12a_cpu_clk_axi_div
.hw
,
4475 [CLKID_CPU_CLK_AXI
] = &g12a_cpu_clk_axi
.hw
,
4476 [CLKID_CPU_CLK_TRACE_DIV
] = &g12a_cpu_clk_trace_div
.hw
,
4477 [CLKID_CPU_CLK_TRACE
] = &g12a_cpu_clk_trace
.hw
,
4478 [CLKID_PCIE_PLL_DCO
] = &g12a_pcie_pll_dco
.hw
,
4479 [CLKID_PCIE_PLL_DCO_DIV2
] = &g12a_pcie_pll_dco_div2
.hw
,
4480 [CLKID_PCIE_PLL_OD
] = &g12a_pcie_pll_od
.hw
,
4481 [CLKID_PCIE_PLL
] = &g12a_pcie_pll
.hw
,
4482 [CLKID_VDEC_1_SEL
] = &g12a_vdec_1_sel
.hw
,
4483 [CLKID_VDEC_1_DIV
] = &g12a_vdec_1_div
.hw
,
4484 [CLKID_VDEC_1
] = &g12a_vdec_1
.hw
,
4485 [CLKID_VDEC_HEVC_SEL
] = &g12a_vdec_hevc_sel
.hw
,
4486 [CLKID_VDEC_HEVC_DIV
] = &g12a_vdec_hevc_div
.hw
,
4487 [CLKID_VDEC_HEVC
] = &g12a_vdec_hevc
.hw
,
4488 [CLKID_VDEC_HEVCF_SEL
] = &g12a_vdec_hevcf_sel
.hw
,
4489 [CLKID_VDEC_HEVCF_DIV
] = &g12a_vdec_hevcf_div
.hw
,
4490 [CLKID_VDEC_HEVCF
] = &g12a_vdec_hevcf
.hw
,
4491 [CLKID_TS_DIV
] = &g12a_ts_div
.hw
,
4492 [CLKID_TS
] = &g12a_ts
.hw
,
4493 [CLKID_SYS1_PLL_DCO
] = &g12b_sys1_pll_dco
.hw
,
4494 [CLKID_SYS1_PLL
] = &g12b_sys1_pll
.hw
,
4495 [CLKID_SYS1_PLL_DIV16_EN
] = &g12b_sys1_pll_div16_en
.hw
,
4496 [CLKID_SYS1_PLL_DIV16
] = &g12b_sys1_pll_div16
.hw
,
4497 [CLKID_CPUB_CLK_DYN0_SEL
] = &g12b_cpub_clk_premux0
.hw
,
4498 [CLKID_CPUB_CLK_DYN0_DIV
] = &g12b_cpub_clk_mux0_div
.hw
,
4499 [CLKID_CPUB_CLK_DYN0
] = &g12b_cpub_clk_postmux0
.hw
,
4500 [CLKID_CPUB_CLK_DYN1_SEL
] = &g12b_cpub_clk_premux1
.hw
,
4501 [CLKID_CPUB_CLK_DYN1_DIV
] = &g12b_cpub_clk_mux1_div
.hw
,
4502 [CLKID_CPUB_CLK_DYN1
] = &g12b_cpub_clk_postmux1
.hw
,
4503 [CLKID_CPUB_CLK_DYN
] = &g12b_cpub_clk_dyn
.hw
,
4504 [CLKID_CPUB_CLK
] = &g12b_cpub_clk
.hw
,
4505 [CLKID_CPUB_CLK_DIV16_EN
] = &g12b_cpub_clk_div16_en
.hw
,
4506 [CLKID_CPUB_CLK_DIV16
] = &g12b_cpub_clk_div16
.hw
,
4507 [CLKID_CPUB_CLK_DIV2
] = &g12b_cpub_clk_div2
.hw
,
4508 [CLKID_CPUB_CLK_DIV3
] = &g12b_cpub_clk_div3
.hw
,
4509 [CLKID_CPUB_CLK_DIV4
] = &g12b_cpub_clk_div4
.hw
,
4510 [CLKID_CPUB_CLK_DIV5
] = &g12b_cpub_clk_div5
.hw
,
4511 [CLKID_CPUB_CLK_DIV6
] = &g12b_cpub_clk_div6
.hw
,
4512 [CLKID_CPUB_CLK_DIV7
] = &g12b_cpub_clk_div7
.hw
,
4513 [CLKID_CPUB_CLK_DIV8
] = &g12b_cpub_clk_div8
.hw
,
4514 [CLKID_CPUB_CLK_APB_SEL
] = &g12b_cpub_clk_apb_sel
.hw
,
4515 [CLKID_CPUB_CLK_APB
] = &g12b_cpub_clk_apb
.hw
,
4516 [CLKID_CPUB_CLK_ATB_SEL
] = &g12b_cpub_clk_atb_sel
.hw
,
4517 [CLKID_CPUB_CLK_ATB
] = &g12b_cpub_clk_atb
.hw
,
4518 [CLKID_CPUB_CLK_AXI_SEL
] = &g12b_cpub_clk_axi_sel
.hw
,
4519 [CLKID_CPUB_CLK_AXI
] = &g12b_cpub_clk_axi
.hw
,
4520 [CLKID_CPUB_CLK_TRACE_SEL
] = &g12b_cpub_clk_trace_sel
.hw
,
4521 [CLKID_CPUB_CLK_TRACE
] = &g12b_cpub_clk_trace
.hw
,
4522 [CLKID_SPICC0_SCLK_SEL
] = &g12a_spicc0_sclk_sel
.hw
,
4523 [CLKID_SPICC0_SCLK_DIV
] = &g12a_spicc0_sclk_div
.hw
,
4524 [CLKID_SPICC0_SCLK
] = &g12a_spicc0_sclk
.hw
,
4525 [CLKID_SPICC1_SCLK_SEL
] = &g12a_spicc1_sclk_sel
.hw
,
4526 [CLKID_SPICC1_SCLK_DIV
] = &g12a_spicc1_sclk_div
.hw
,
4527 [CLKID_SPICC1_SCLK
] = &g12a_spicc1_sclk
.hw
,
4533 static struct clk_hw_onecell_data sm1_hw_onecell_data
= {
4535 [CLKID_SYS_PLL
] = &g12a_sys_pll
.hw
,
4536 [CLKID_FIXED_PLL
] = &g12a_fixed_pll
.hw
,
4537 [CLKID_FCLK_DIV2
] = &g12a_fclk_div2
.hw
,
4538 [CLKID_FCLK_DIV3
] = &g12a_fclk_div3
.hw
,
4539 [CLKID_FCLK_DIV4
] = &g12a_fclk_div4
.hw
,
4540 [CLKID_FCLK_DIV5
] = &g12a_fclk_div5
.hw
,
4541 [CLKID_FCLK_DIV7
] = &g12a_fclk_div7
.hw
,
4542 [CLKID_FCLK_DIV2P5
] = &g12a_fclk_div2p5
.hw
,
4543 [CLKID_GP0_PLL
] = &g12a_gp0_pll
.hw
,
4544 [CLKID_MPEG_SEL
] = &g12a_mpeg_clk_sel
.hw
,
4545 [CLKID_MPEG_DIV
] = &g12a_mpeg_clk_div
.hw
,
4546 [CLKID_CLK81
] = &g12a_clk81
.hw
,
4547 [CLKID_MPLL0
] = &g12a_mpll0
.hw
,
4548 [CLKID_MPLL1
] = &g12a_mpll1
.hw
,
4549 [CLKID_MPLL2
] = &g12a_mpll2
.hw
,
4550 [CLKID_MPLL3
] = &g12a_mpll3
.hw
,
4551 [CLKID_DDR
] = &g12a_ddr
.hw
,
4552 [CLKID_DOS
] = &g12a_dos
.hw
,
4553 [CLKID_AUDIO_LOCKER
] = &g12a_audio_locker
.hw
,
4554 [CLKID_MIPI_DSI_HOST
] = &g12a_mipi_dsi_host
.hw
,
4555 [CLKID_ETH_PHY
] = &g12a_eth_phy
.hw
,
4556 [CLKID_ISA
] = &g12a_isa
.hw
,
4557 [CLKID_PL301
] = &g12a_pl301
.hw
,
4558 [CLKID_PERIPHS
] = &g12a_periphs
.hw
,
4559 [CLKID_SPICC0
] = &g12a_spicc_0
.hw
,
4560 [CLKID_I2C
] = &g12a_i2c
.hw
,
4561 [CLKID_SANA
] = &g12a_sana
.hw
,
4562 [CLKID_SD
] = &g12a_sd
.hw
,
4563 [CLKID_RNG0
] = &g12a_rng0
.hw
,
4564 [CLKID_UART0
] = &g12a_uart0
.hw
,
4565 [CLKID_SPICC1
] = &g12a_spicc_1
.hw
,
4566 [CLKID_HIU_IFACE
] = &g12a_hiu_reg
.hw
,
4567 [CLKID_MIPI_DSI_PHY
] = &g12a_mipi_dsi_phy
.hw
,
4568 [CLKID_ASSIST_MISC
] = &g12a_assist_misc
.hw
,
4569 [CLKID_SD_EMMC_A
] = &g12a_emmc_a
.hw
,
4570 [CLKID_SD_EMMC_B
] = &g12a_emmc_b
.hw
,
4571 [CLKID_SD_EMMC_C
] = &g12a_emmc_c
.hw
,
4572 [CLKID_AUDIO_CODEC
] = &g12a_audio_codec
.hw
,
4573 [CLKID_AUDIO
] = &g12a_audio
.hw
,
4574 [CLKID_ETH
] = &g12a_eth_core
.hw
,
4575 [CLKID_DEMUX
] = &g12a_demux
.hw
,
4576 [CLKID_AUDIO_IFIFO
] = &g12a_audio_ififo
.hw
,
4577 [CLKID_ADC
] = &g12a_adc
.hw
,
4578 [CLKID_UART1
] = &g12a_uart1
.hw
,
4579 [CLKID_G2D
] = &g12a_g2d
.hw
,
4580 [CLKID_RESET
] = &g12a_reset
.hw
,
4581 [CLKID_PCIE_COMB
] = &g12a_pcie_comb
.hw
,
4582 [CLKID_PARSER
] = &g12a_parser
.hw
,
4583 [CLKID_USB
] = &g12a_usb_general
.hw
,
4584 [CLKID_PCIE_PHY
] = &g12a_pcie_phy
.hw
,
4585 [CLKID_AHB_ARB0
] = &g12a_ahb_arb0
.hw
,
4586 [CLKID_AHB_DATA_BUS
] = &g12a_ahb_data_bus
.hw
,
4587 [CLKID_AHB_CTRL_BUS
] = &g12a_ahb_ctrl_bus
.hw
,
4588 [CLKID_HTX_HDCP22
] = &g12a_htx_hdcp22
.hw
,
4589 [CLKID_HTX_PCLK
] = &g12a_htx_pclk
.hw
,
4590 [CLKID_BT656
] = &g12a_bt656
.hw
,
4591 [CLKID_USB1_DDR_BRIDGE
] = &g12a_usb1_to_ddr
.hw
,
4592 [CLKID_MMC_PCLK
] = &g12a_mmc_pclk
.hw
,
4593 [CLKID_UART2
] = &g12a_uart2
.hw
,
4594 [CLKID_VPU_INTR
] = &g12a_vpu_intr
.hw
,
4595 [CLKID_GIC
] = &g12a_gic
.hw
,
4596 [CLKID_SD_EMMC_A_CLK0_SEL
] = &g12a_sd_emmc_a_clk0_sel
.hw
,
4597 [CLKID_SD_EMMC_A_CLK0_DIV
] = &g12a_sd_emmc_a_clk0_div
.hw
,
4598 [CLKID_SD_EMMC_A_CLK0
] = &g12a_sd_emmc_a_clk0
.hw
,
4599 [CLKID_SD_EMMC_B_CLK0_SEL
] = &g12a_sd_emmc_b_clk0_sel
.hw
,
4600 [CLKID_SD_EMMC_B_CLK0_DIV
] = &g12a_sd_emmc_b_clk0_div
.hw
,
4601 [CLKID_SD_EMMC_B_CLK0
] = &g12a_sd_emmc_b_clk0
.hw
,
4602 [CLKID_SD_EMMC_C_CLK0_SEL
] = &g12a_sd_emmc_c_clk0_sel
.hw
,
4603 [CLKID_SD_EMMC_C_CLK0_DIV
] = &g12a_sd_emmc_c_clk0_div
.hw
,
4604 [CLKID_SD_EMMC_C_CLK0
] = &g12a_sd_emmc_c_clk0
.hw
,
4605 [CLKID_MPLL0_DIV
] = &g12a_mpll0_div
.hw
,
4606 [CLKID_MPLL1_DIV
] = &g12a_mpll1_div
.hw
,
4607 [CLKID_MPLL2_DIV
] = &g12a_mpll2_div
.hw
,
4608 [CLKID_MPLL3_DIV
] = &g12a_mpll3_div
.hw
,
4609 [CLKID_FCLK_DIV2_DIV
] = &g12a_fclk_div2_div
.hw
,
4610 [CLKID_FCLK_DIV3_DIV
] = &g12a_fclk_div3_div
.hw
,
4611 [CLKID_FCLK_DIV4_DIV
] = &g12a_fclk_div4_div
.hw
,
4612 [CLKID_FCLK_DIV5_DIV
] = &g12a_fclk_div5_div
.hw
,
4613 [CLKID_FCLK_DIV7_DIV
] = &g12a_fclk_div7_div
.hw
,
4614 [CLKID_FCLK_DIV2P5_DIV
] = &g12a_fclk_div2p5_div
.hw
,
4615 [CLKID_HIFI_PLL
] = &g12a_hifi_pll
.hw
,
4616 [CLKID_VCLK2_VENCI0
] = &g12a_vclk2_venci0
.hw
,
4617 [CLKID_VCLK2_VENCI1
] = &g12a_vclk2_venci1
.hw
,
4618 [CLKID_VCLK2_VENCP0
] = &g12a_vclk2_vencp0
.hw
,
4619 [CLKID_VCLK2_VENCP1
] = &g12a_vclk2_vencp1
.hw
,
4620 [CLKID_VCLK2_VENCT0
] = &g12a_vclk2_venct0
.hw
,
4621 [CLKID_VCLK2_VENCT1
] = &g12a_vclk2_venct1
.hw
,
4622 [CLKID_VCLK2_OTHER
] = &g12a_vclk2_other
.hw
,
4623 [CLKID_VCLK2_ENCI
] = &g12a_vclk2_enci
.hw
,
4624 [CLKID_VCLK2_ENCP
] = &g12a_vclk2_encp
.hw
,
4625 [CLKID_DAC_CLK
] = &g12a_dac_clk
.hw
,
4626 [CLKID_AOCLK
] = &g12a_aoclk_gate
.hw
,
4627 [CLKID_IEC958
] = &g12a_iec958_gate
.hw
,
4628 [CLKID_ENC480P
] = &g12a_enc480p
.hw
,
4629 [CLKID_RNG1
] = &g12a_rng1
.hw
,
4630 [CLKID_VCLK2_ENCT
] = &g12a_vclk2_enct
.hw
,
4631 [CLKID_VCLK2_ENCL
] = &g12a_vclk2_encl
.hw
,
4632 [CLKID_VCLK2_VENCLMMC
] = &g12a_vclk2_venclmmc
.hw
,
4633 [CLKID_VCLK2_VENCL
] = &g12a_vclk2_vencl
.hw
,
4634 [CLKID_VCLK2_OTHER1
] = &g12a_vclk2_other1
.hw
,
4635 [CLKID_FIXED_PLL_DCO
] = &g12a_fixed_pll_dco
.hw
,
4636 [CLKID_SYS_PLL_DCO
] = &g12a_sys_pll_dco
.hw
,
4637 [CLKID_GP0_PLL_DCO
] = &g12a_gp0_pll_dco
.hw
,
4638 [CLKID_HIFI_PLL_DCO
] = &g12a_hifi_pll_dco
.hw
,
4639 [CLKID_DMA
] = &g12a_dma
.hw
,
4640 [CLKID_EFUSE
] = &g12a_efuse
.hw
,
4641 [CLKID_ROM_BOOT
] = &g12a_rom_boot
.hw
,
4642 [CLKID_RESET_SEC
] = &g12a_reset_sec
.hw
,
4643 [CLKID_SEC_AHB_APB3
] = &g12a_sec_ahb_apb3
.hw
,
4644 [CLKID_MPLL_PREDIV
] = &g12a_mpll_prediv
.hw
,
4645 [CLKID_VPU_0_SEL
] = &g12a_vpu_0_sel
.hw
,
4646 [CLKID_VPU_0_DIV
] = &g12a_vpu_0_div
.hw
,
4647 [CLKID_VPU_0
] = &g12a_vpu_0
.hw
,
4648 [CLKID_VPU_1_SEL
] = &g12a_vpu_1_sel
.hw
,
4649 [CLKID_VPU_1_DIV
] = &g12a_vpu_1_div
.hw
,
4650 [CLKID_VPU_1
] = &g12a_vpu_1
.hw
,
4651 [CLKID_VPU
] = &g12a_vpu
.hw
,
4652 [CLKID_VAPB_0_SEL
] = &g12a_vapb_0_sel
.hw
,
4653 [CLKID_VAPB_0_DIV
] = &g12a_vapb_0_div
.hw
,
4654 [CLKID_VAPB_0
] = &g12a_vapb_0
.hw
,
4655 [CLKID_VAPB_1_SEL
] = &g12a_vapb_1_sel
.hw
,
4656 [CLKID_VAPB_1_DIV
] = &g12a_vapb_1_div
.hw
,
4657 [CLKID_VAPB_1
] = &g12a_vapb_1
.hw
,
4658 [CLKID_VAPB_SEL
] = &g12a_vapb_sel
.hw
,
4659 [CLKID_VAPB
] = &g12a_vapb
.hw
,
4660 [CLKID_HDMI_PLL_DCO
] = &g12a_hdmi_pll_dco
.hw
,
4661 [CLKID_HDMI_PLL_OD
] = &g12a_hdmi_pll_od
.hw
,
4662 [CLKID_HDMI_PLL_OD2
] = &g12a_hdmi_pll_od2
.hw
,
4663 [CLKID_HDMI_PLL
] = &g12a_hdmi_pll
.hw
,
4664 [CLKID_VID_PLL
] = &g12a_vid_pll_div
.hw
,
4665 [CLKID_VID_PLL_SEL
] = &g12a_vid_pll_sel
.hw
,
4666 [CLKID_VID_PLL_DIV
] = &g12a_vid_pll
.hw
,
4667 [CLKID_VCLK_SEL
] = &g12a_vclk_sel
.hw
,
4668 [CLKID_VCLK2_SEL
] = &g12a_vclk2_sel
.hw
,
4669 [CLKID_VCLK_INPUT
] = &g12a_vclk_input
.hw
,
4670 [CLKID_VCLK2_INPUT
] = &g12a_vclk2_input
.hw
,
4671 [CLKID_VCLK_DIV
] = &g12a_vclk_div
.hw
,
4672 [CLKID_VCLK2_DIV
] = &g12a_vclk2_div
.hw
,
4673 [CLKID_VCLK
] = &g12a_vclk
.hw
,
4674 [CLKID_VCLK2
] = &g12a_vclk2
.hw
,
4675 [CLKID_VCLK_DIV1
] = &g12a_vclk_div1
.hw
,
4676 [CLKID_VCLK_DIV2_EN
] = &g12a_vclk_div2_en
.hw
,
4677 [CLKID_VCLK_DIV4_EN
] = &g12a_vclk_div4_en
.hw
,
4678 [CLKID_VCLK_DIV6_EN
] = &g12a_vclk_div6_en
.hw
,
4679 [CLKID_VCLK_DIV12_EN
] = &g12a_vclk_div12_en
.hw
,
4680 [CLKID_VCLK2_DIV1
] = &g12a_vclk2_div1
.hw
,
4681 [CLKID_VCLK2_DIV2_EN
] = &g12a_vclk2_div2_en
.hw
,
4682 [CLKID_VCLK2_DIV4_EN
] = &g12a_vclk2_div4_en
.hw
,
4683 [CLKID_VCLK2_DIV6_EN
] = &g12a_vclk2_div6_en
.hw
,
4684 [CLKID_VCLK2_DIV12_EN
] = &g12a_vclk2_div12_en
.hw
,
4685 [CLKID_VCLK_DIV2
] = &g12a_vclk_div2
.hw
,
4686 [CLKID_VCLK_DIV4
] = &g12a_vclk_div4
.hw
,
4687 [CLKID_VCLK_DIV6
] = &g12a_vclk_div6
.hw
,
4688 [CLKID_VCLK_DIV12
] = &g12a_vclk_div12
.hw
,
4689 [CLKID_VCLK2_DIV2
] = &g12a_vclk2_div2
.hw
,
4690 [CLKID_VCLK2_DIV4
] = &g12a_vclk2_div4
.hw
,
4691 [CLKID_VCLK2_DIV6
] = &g12a_vclk2_div6
.hw
,
4692 [CLKID_VCLK2_DIV12
] = &g12a_vclk2_div12
.hw
,
4693 [CLKID_CTS_ENCI_SEL
] = &g12a_cts_enci_sel
.hw
,
4694 [CLKID_CTS_ENCP_SEL
] = &g12a_cts_encp_sel
.hw
,
4695 [CLKID_CTS_VDAC_SEL
] = &g12a_cts_vdac_sel
.hw
,
4696 [CLKID_HDMI_TX_SEL
] = &g12a_hdmi_tx_sel
.hw
,
4697 [CLKID_CTS_ENCI
] = &g12a_cts_enci
.hw
,
4698 [CLKID_CTS_ENCP
] = &g12a_cts_encp
.hw
,
4699 [CLKID_CTS_VDAC
] = &g12a_cts_vdac
.hw
,
4700 [CLKID_HDMI_TX
] = &g12a_hdmi_tx
.hw
,
4701 [CLKID_HDMI_SEL
] = &g12a_hdmi_sel
.hw
,
4702 [CLKID_HDMI_DIV
] = &g12a_hdmi_div
.hw
,
4703 [CLKID_HDMI
] = &g12a_hdmi
.hw
,
4704 [CLKID_MALI_0_SEL
] = &g12a_mali_0_sel
.hw
,
4705 [CLKID_MALI_0_DIV
] = &g12a_mali_0_div
.hw
,
4706 [CLKID_MALI_0
] = &g12a_mali_0
.hw
,
4707 [CLKID_MALI_1_SEL
] = &g12a_mali_1_sel
.hw
,
4708 [CLKID_MALI_1_DIV
] = &g12a_mali_1_div
.hw
,
4709 [CLKID_MALI_1
] = &g12a_mali_1
.hw
,
4710 [CLKID_MALI
] = &g12a_mali
.hw
,
4711 [CLKID_MPLL_50M_DIV
] = &g12a_mpll_50m_div
.hw
,
4712 [CLKID_MPLL_50M
] = &g12a_mpll_50m
.hw
,
4713 [CLKID_SYS_PLL_DIV16_EN
] = &g12a_sys_pll_div16_en
.hw
,
4714 [CLKID_SYS_PLL_DIV16
] = &g12a_sys_pll_div16
.hw
,
4715 [CLKID_CPU_CLK_DYN0_SEL
] = &g12a_cpu_clk_premux0
.hw
,
4716 [CLKID_CPU_CLK_DYN0_DIV
] = &g12a_cpu_clk_mux0_div
.hw
,
4717 [CLKID_CPU_CLK_DYN0
] = &g12a_cpu_clk_postmux0
.hw
,
4718 [CLKID_CPU_CLK_DYN1_SEL
] = &g12a_cpu_clk_premux1
.hw
,
4719 [CLKID_CPU_CLK_DYN1_DIV
] = &g12a_cpu_clk_mux1_div
.hw
,
4720 [CLKID_CPU_CLK_DYN1
] = &g12a_cpu_clk_postmux1
.hw
,
4721 [CLKID_CPU_CLK_DYN
] = &g12a_cpu_clk_dyn
.hw
,
4722 [CLKID_CPU_CLK
] = &g12a_cpu_clk
.hw
,
4723 [CLKID_CPU_CLK_DIV16_EN
] = &g12a_cpu_clk_div16_en
.hw
,
4724 [CLKID_CPU_CLK_DIV16
] = &g12a_cpu_clk_div16
.hw
,
4725 [CLKID_CPU_CLK_APB_DIV
] = &g12a_cpu_clk_apb_div
.hw
,
4726 [CLKID_CPU_CLK_APB
] = &g12a_cpu_clk_apb
.hw
,
4727 [CLKID_CPU_CLK_ATB_DIV
] = &g12a_cpu_clk_atb_div
.hw
,
4728 [CLKID_CPU_CLK_ATB
] = &g12a_cpu_clk_atb
.hw
,
4729 [CLKID_CPU_CLK_AXI_DIV
] = &g12a_cpu_clk_axi_div
.hw
,
4730 [CLKID_CPU_CLK_AXI
] = &g12a_cpu_clk_axi
.hw
,
4731 [CLKID_CPU_CLK_TRACE_DIV
] = &g12a_cpu_clk_trace_div
.hw
,
4732 [CLKID_CPU_CLK_TRACE
] = &g12a_cpu_clk_trace
.hw
,
4733 [CLKID_PCIE_PLL_DCO
] = &g12a_pcie_pll_dco
.hw
,
4734 [CLKID_PCIE_PLL_DCO_DIV2
] = &g12a_pcie_pll_dco_div2
.hw
,
4735 [CLKID_PCIE_PLL_OD
] = &g12a_pcie_pll_od
.hw
,
4736 [CLKID_PCIE_PLL
] = &g12a_pcie_pll
.hw
,
4737 [CLKID_VDEC_1_SEL
] = &g12a_vdec_1_sel
.hw
,
4738 [CLKID_VDEC_1_DIV
] = &g12a_vdec_1_div
.hw
,
4739 [CLKID_VDEC_1
] = &g12a_vdec_1
.hw
,
4740 [CLKID_VDEC_HEVC_SEL
] = &g12a_vdec_hevc_sel
.hw
,
4741 [CLKID_VDEC_HEVC_DIV
] = &g12a_vdec_hevc_div
.hw
,
4742 [CLKID_VDEC_HEVC
] = &g12a_vdec_hevc
.hw
,
4743 [CLKID_VDEC_HEVCF_SEL
] = &g12a_vdec_hevcf_sel
.hw
,
4744 [CLKID_VDEC_HEVCF_DIV
] = &g12a_vdec_hevcf_div
.hw
,
4745 [CLKID_VDEC_HEVCF
] = &g12a_vdec_hevcf
.hw
,
4746 [CLKID_TS_DIV
] = &g12a_ts_div
.hw
,
4747 [CLKID_TS
] = &g12a_ts
.hw
,
4748 [CLKID_GP1_PLL_DCO
] = &sm1_gp1_pll_dco
.hw
,
4749 [CLKID_GP1_PLL
] = &sm1_gp1_pll
.hw
,
4750 [CLKID_DSU_CLK_DYN0_SEL
] = &sm1_dsu_clk_premux0
.hw
,
4751 [CLKID_DSU_CLK_DYN0_DIV
] = &sm1_dsu_clk_premux1
.hw
,
4752 [CLKID_DSU_CLK_DYN0
] = &sm1_dsu_clk_mux0_div
.hw
,
4753 [CLKID_DSU_CLK_DYN1_SEL
] = &sm1_dsu_clk_postmux0
.hw
,
4754 [CLKID_DSU_CLK_DYN1_DIV
] = &sm1_dsu_clk_mux1_div
.hw
,
4755 [CLKID_DSU_CLK_DYN1
] = &sm1_dsu_clk_postmux1
.hw
,
4756 [CLKID_DSU_CLK_DYN
] = &sm1_dsu_clk_dyn
.hw
,
4757 [CLKID_DSU_CLK_FINAL
] = &sm1_dsu_final_clk
.hw
,
4758 [CLKID_DSU_CLK
] = &sm1_dsu_clk
.hw
,
4759 [CLKID_CPU1_CLK
] = &sm1_cpu1_clk
.hw
,
4760 [CLKID_CPU2_CLK
] = &sm1_cpu2_clk
.hw
,
4761 [CLKID_CPU3_CLK
] = &sm1_cpu3_clk
.hw
,
4762 [CLKID_SPICC0_SCLK_SEL
] = &g12a_spicc0_sclk_sel
.hw
,
4763 [CLKID_SPICC0_SCLK_DIV
] = &g12a_spicc0_sclk_div
.hw
,
4764 [CLKID_SPICC0_SCLK
] = &g12a_spicc0_sclk
.hw
,
4765 [CLKID_SPICC1_SCLK_SEL
] = &g12a_spicc1_sclk_sel
.hw
,
4766 [CLKID_SPICC1_SCLK_DIV
] = &g12a_spicc1_sclk_div
.hw
,
4767 [CLKID_SPICC1_SCLK
] = &g12a_spicc1_sclk
.hw
,
4773 /* Convenience table to populate regmap in .probe */
4774 static struct clk_regmap
*const g12a_clk_regmaps
[] = {
4779 &g12a_mipi_dsi_host
,
4821 &g12a_sd_emmc_a_clk0
,
4822 &g12a_sd_emmc_b_clk0
,
4823 &g12a_sd_emmc_c_clk0
,
4825 &g12a_sd_emmc_a_clk0_div
,
4826 &g12a_sd_emmc_b_clk0_div
,
4827 &g12a_sd_emmc_c_clk0_div
,
4829 &g12a_sd_emmc_a_clk0_sel
,
4830 &g12a_sd_emmc_b_clk0_sel
,
4831 &g12a_sd_emmc_c_clk0_sel
,
4860 &g12a_vclk2_venclmmc
,
4863 &g12a_fixed_pll_dco
,
4912 &g12a_vclk_div12_en
,
4914 &g12a_vclk2_div2_en
,
4915 &g12a_vclk2_div4_en
,
4916 &g12a_vclk2_div6_en
,
4917 &g12a_vclk2_div12_en
,
4937 &g12a_sys_pll_div16_en
,
4938 &g12a_cpu_clk_premux0
,
4939 &g12a_cpu_clk_mux0_div
,
4940 &g12a_cpu_clk_postmux0
,
4941 &g12a_cpu_clk_premux1
,
4942 &g12a_cpu_clk_mux1_div
,
4943 &g12a_cpu_clk_postmux1
,
4946 &g12a_cpu_clk_div16_en
,
4947 &g12a_cpu_clk_apb_div
,
4949 &g12a_cpu_clk_atb_div
,
4951 &g12a_cpu_clk_axi_div
,
4953 &g12a_cpu_clk_trace_div
,
4954 &g12a_cpu_clk_trace
,
4960 &g12a_vdec_hevc_sel
,
4961 &g12a_vdec_hevc_div
,
4963 &g12a_vdec_hevcf_sel
,
4964 &g12a_vdec_hevcf_div
,
4971 &g12b_sys1_pll_div16_en
,
4972 &g12b_cpub_clk_premux0
,
4973 &g12b_cpub_clk_mux0_div
,
4974 &g12b_cpub_clk_postmux0
,
4975 &g12b_cpub_clk_premux1
,
4976 &g12b_cpub_clk_mux1_div
,
4977 &g12b_cpub_clk_postmux1
,
4980 &g12b_cpub_clk_div16_en
,
4981 &g12b_cpub_clk_apb_sel
,
4983 &g12b_cpub_clk_atb_sel
,
4985 &g12b_cpub_clk_axi_sel
,
4987 &g12b_cpub_clk_trace_sel
,
4988 &g12b_cpub_clk_trace
,
4991 &sm1_dsu_clk_premux0
,
4992 &sm1_dsu_clk_premux1
,
4993 &sm1_dsu_clk_mux0_div
,
4994 &sm1_dsu_clk_postmux0
,
4995 &sm1_dsu_clk_mux1_div
,
4996 &sm1_dsu_clk_postmux1
,
5003 &g12a_spicc0_sclk_sel
,
5004 &g12a_spicc0_sclk_div
,
5006 &g12a_spicc1_sclk_sel
,
5007 &g12a_spicc1_sclk_div
,
5011 static const struct reg_sequence g12a_init_regs
[] = {
5012 { .reg
= HHI_MPLL_CNTL0
, .def
= 0x00000543 },
5015 static int meson_g12a_dvfs_setup_common(struct platform_device
*pdev
,
5016 struct clk_hw
**hws
)
5018 const char *notifier_clk_name
;
5019 struct clk
*notifier_clk
;
5020 struct clk_hw
*xtal
;
5023 xtal
= clk_hw_get_parent_by_index(hws
[CLKID_CPU_CLK_DYN1_SEL
], 0);
5025 /* Setup clock notifier for cpu_clk_postmux0 */
5026 g12a_cpu_clk_postmux0_nb_data
.xtal
= xtal
;
5027 notifier_clk_name
= clk_hw_get_name(&g12a_cpu_clk_postmux0
.hw
);
5028 notifier_clk
= __clk_lookup(notifier_clk_name
);
5029 ret
= clk_notifier_register(notifier_clk
,
5030 &g12a_cpu_clk_postmux0_nb_data
.nb
);
5032 dev_err(&pdev
->dev
, "failed to register the cpu_clk_postmux0 notifier\n");
5036 /* Setup clock notifier for cpu_clk_dyn mux */
5037 notifier_clk_name
= clk_hw_get_name(&g12a_cpu_clk_dyn
.hw
);
5038 notifier_clk
= __clk_lookup(notifier_clk_name
);
5039 ret
= clk_notifier_register(notifier_clk
, &g12a_cpu_clk_mux_nb
);
5041 dev_err(&pdev
->dev
, "failed to register the cpu_clk_dyn notifier\n");
5048 static int meson_g12b_dvfs_setup(struct platform_device
*pdev
)
5050 struct clk_hw
**hws
= g12b_hw_onecell_data
.hws
;
5051 const char *notifier_clk_name
;
5052 struct clk
*notifier_clk
;
5053 struct clk_hw
*xtal
;
5056 ret
= meson_g12a_dvfs_setup_common(pdev
, hws
);
5060 xtal
= clk_hw_get_parent_by_index(hws
[CLKID_CPU_CLK_DYN1_SEL
], 0);
5062 /* Setup clock notifier for cpu_clk mux */
5063 notifier_clk_name
= clk_hw_get_name(&g12b_cpu_clk
.hw
);
5064 notifier_clk
= __clk_lookup(notifier_clk_name
);
5065 ret
= clk_notifier_register(notifier_clk
, &g12a_cpu_clk_mux_nb
);
5067 dev_err(&pdev
->dev
, "failed to register the cpu_clk notifier\n");
5071 /* Setup clock notifier for sys1_pll */
5072 notifier_clk_name
= clk_hw_get_name(&g12b_sys1_pll
.hw
);
5073 notifier_clk
= __clk_lookup(notifier_clk_name
);
5074 ret
= clk_notifier_register(notifier_clk
,
5075 &g12b_cpu_clk_sys1_pll_nb_data
.nb
);
5077 dev_err(&pdev
->dev
, "failed to register the sys1_pll notifier\n");
5081 /* Add notifiers for the second CPU cluster */
5083 /* Setup clock notifier for cpub_clk_postmux0 */
5084 g12b_cpub_clk_postmux0_nb_data
.xtal
= xtal
;
5085 notifier_clk_name
= clk_hw_get_name(&g12b_cpub_clk_postmux0
.hw
);
5086 notifier_clk
= __clk_lookup(notifier_clk_name
);
5087 ret
= clk_notifier_register(notifier_clk
,
5088 &g12b_cpub_clk_postmux0_nb_data
.nb
);
5090 dev_err(&pdev
->dev
, "failed to register the cpub_clk_postmux0 notifier\n");
5094 /* Setup clock notifier for cpub_clk_dyn mux */
5095 notifier_clk_name
= clk_hw_get_name(&g12b_cpub_clk_dyn
.hw
);
5096 notifier_clk
= __clk_lookup(notifier_clk_name
);
5097 ret
= clk_notifier_register(notifier_clk
, &g12a_cpu_clk_mux_nb
);
5099 dev_err(&pdev
->dev
, "failed to register the cpub_clk_dyn notifier\n");
5103 /* Setup clock notifier for cpub_clk mux */
5104 notifier_clk_name
= clk_hw_get_name(&g12b_cpub_clk
.hw
);
5105 notifier_clk
= __clk_lookup(notifier_clk_name
);
5106 ret
= clk_notifier_register(notifier_clk
, &g12a_cpu_clk_mux_nb
);
5108 dev_err(&pdev
->dev
, "failed to register the cpub_clk notifier\n");
5112 /* Setup clock notifier for sys_pll */
5113 notifier_clk_name
= clk_hw_get_name(&g12a_sys_pll
.hw
);
5114 notifier_clk
= __clk_lookup(notifier_clk_name
);
5115 ret
= clk_notifier_register(notifier_clk
,
5116 &g12b_cpub_clk_sys_pll_nb_data
.nb
);
5118 dev_err(&pdev
->dev
, "failed to register the sys_pll notifier\n");
5125 static int meson_g12a_dvfs_setup(struct platform_device
*pdev
)
5127 struct clk_hw
**hws
= g12a_hw_onecell_data
.hws
;
5128 const char *notifier_clk_name
;
5129 struct clk
*notifier_clk
;
5132 ret
= meson_g12a_dvfs_setup_common(pdev
, hws
);
5136 /* Setup clock notifier for cpu_clk mux */
5137 notifier_clk_name
= clk_hw_get_name(&g12a_cpu_clk
.hw
);
5138 notifier_clk
= __clk_lookup(notifier_clk_name
);
5139 ret
= clk_notifier_register(notifier_clk
, &g12a_cpu_clk_mux_nb
);
5141 dev_err(&pdev
->dev
, "failed to register the cpu_clk notifier\n");
5145 /* Setup clock notifier for sys_pll */
5146 notifier_clk_name
= clk_hw_get_name(&g12a_sys_pll
.hw
);
5147 notifier_clk
= __clk_lookup(notifier_clk_name
);
5148 ret
= clk_notifier_register(notifier_clk
, &g12a_sys_pll_nb_data
.nb
);
5150 dev_err(&pdev
->dev
, "failed to register the sys_pll notifier\n");
5157 struct meson_g12a_data
{
5158 const struct meson_eeclkc_data eeclkc_data
;
5159 int (*dvfs_setup
)(struct platform_device
*pdev
);
5162 static int meson_g12a_probe(struct platform_device
*pdev
)
5164 const struct meson_eeclkc_data
*eeclkc_data
;
5165 const struct meson_g12a_data
*g12a_data
;
5168 eeclkc_data
= of_device_get_match_data(&pdev
->dev
);
5172 ret
= meson_eeclkc_probe(pdev
);
5176 g12a_data
= container_of(eeclkc_data
, struct meson_g12a_data
,
5179 if (g12a_data
->dvfs_setup
)
5180 return g12a_data
->dvfs_setup(pdev
);
5185 static const struct meson_g12a_data g12a_clkc_data
= {
5187 .regmap_clks
= g12a_clk_regmaps
,
5188 .regmap_clk_num
= ARRAY_SIZE(g12a_clk_regmaps
),
5189 .hw_onecell_data
= &g12a_hw_onecell_data
,
5190 .init_regs
= g12a_init_regs
,
5191 .init_count
= ARRAY_SIZE(g12a_init_regs
),
5193 .dvfs_setup
= meson_g12a_dvfs_setup
,
5196 static const struct meson_g12a_data g12b_clkc_data
= {
5198 .regmap_clks
= g12a_clk_regmaps
,
5199 .regmap_clk_num
= ARRAY_SIZE(g12a_clk_regmaps
),
5200 .hw_onecell_data
= &g12b_hw_onecell_data
,
5202 .dvfs_setup
= meson_g12b_dvfs_setup
,
5205 static const struct meson_g12a_data sm1_clkc_data
= {
5207 .regmap_clks
= g12a_clk_regmaps
,
5208 .regmap_clk_num
= ARRAY_SIZE(g12a_clk_regmaps
),
5209 .hw_onecell_data
= &sm1_hw_onecell_data
,
5211 .dvfs_setup
= meson_g12a_dvfs_setup
,
5214 static const struct of_device_id clkc_match_table
[] = {
5216 .compatible
= "amlogic,g12a-clkc",
5217 .data
= &g12a_clkc_data
.eeclkc_data
5220 .compatible
= "amlogic,g12b-clkc",
5221 .data
= &g12b_clkc_data
.eeclkc_data
5224 .compatible
= "amlogic,sm1-clkc",
5225 .data
= &sm1_clkc_data
.eeclkc_data
5230 static struct platform_driver g12a_driver
= {
5231 .probe
= meson_g12a_probe
,
5233 .name
= "g12a-clkc",
5234 .of_match_table
= clkc_match_table
,
5238 builtin_platform_driver(g12a_driver
);