1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2015 Endless Mobile, Inc.
4 * Author: Carlo Caione <carlo@endlessm.com>
6 * Copyright (c) 2016 BayLibre, Inc.
7 * Michael Turquette <mturquette@baylibre.com>
10 #include <linux/clk.h>
11 #include <linux/clk-provider.h>
12 #include <linux/init.h>
13 #include <linux/mfd/syscon.h>
14 #include <linux/of_address.h>
15 #include <linux/reset-controller.h>
16 #include <linux/slab.h>
17 #include <linux/regmap.h>
20 #include "clk-regmap.h"
24 static DEFINE_SPINLOCK(meson_clk_lock
);
26 struct meson8b_clk_reset
{
27 struct reset_controller_dev reset
;
28 struct regmap
*regmap
;
31 static const struct pll_params_table sys_pll_params_table
[] = {
55 static struct clk_fixed_rate meson8b_xtal
= {
56 .fixed_rate
= 24000000,
57 .hw
.init
= &(struct clk_init_data
){
60 .ops
= &clk_fixed_rate_ops
,
64 static struct clk_regmap meson8b_fixed_pll_dco
= {
65 .data
= &(struct meson_clk_pll_data
){
67 .reg_off
= HHI_MPLL_CNTL
,
72 .reg_off
= HHI_MPLL_CNTL
,
77 .reg_off
= HHI_MPLL_CNTL
,
82 .reg_off
= HHI_MPLL_CNTL2
,
87 .reg_off
= HHI_MPLL_CNTL
,
92 .reg_off
= HHI_MPLL_CNTL
,
97 .hw
.init
= &(struct clk_init_data
){
98 .name
= "fixed_pll_dco",
99 .ops
= &meson_clk_pll_ro_ops
,
100 .parent_data
= &(const struct clk_parent_data
) {
109 static struct clk_regmap meson8b_fixed_pll
= {
110 .data
= &(struct clk_regmap_div_data
){
111 .offset
= HHI_MPLL_CNTL
,
114 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
116 .hw
.init
= &(struct clk_init_data
){
118 .ops
= &clk_regmap_divider_ro_ops
,
119 .parent_hws
= (const struct clk_hw
*[]) {
120 &meson8b_fixed_pll_dco
.hw
124 * This clock won't ever change at runtime so
125 * CLK_SET_RATE_PARENT is not required
130 static struct clk_regmap meson8b_hdmi_pll_dco
= {
131 .data
= &(struct meson_clk_pll_data
){
133 .reg_off
= HHI_VID_PLL_CNTL
,
138 .reg_off
= HHI_VID_PLL_CNTL
,
143 .reg_off
= HHI_VID_PLL_CNTL
,
148 .reg_off
= HHI_VID_PLL_CNTL2
,
153 .reg_off
= HHI_VID_PLL_CNTL
,
158 .reg_off
= HHI_VID_PLL_CNTL
,
163 .hw
.init
= &(struct clk_init_data
){
164 /* sometimes also called "HPLL" or "HPLL PLL" */
165 .name
= "hdmi_pll_dco",
166 .ops
= &meson_clk_pll_ro_ops
,
167 .parent_data
= &(const struct clk_parent_data
) {
176 static struct clk_regmap meson8b_hdmi_pll_lvds_out
= {
177 .data
= &(struct clk_regmap_div_data
){
178 .offset
= HHI_VID_PLL_CNTL
,
181 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
183 .hw
.init
= &(struct clk_init_data
){
184 .name
= "hdmi_pll_lvds_out",
185 .ops
= &clk_regmap_divider_ro_ops
,
186 .parent_hws
= (const struct clk_hw
*[]) {
187 &meson8b_hdmi_pll_dco
.hw
190 .flags
= CLK_SET_RATE_PARENT
,
194 static struct clk_regmap meson8b_hdmi_pll_hdmi_out
= {
195 .data
= &(struct clk_regmap_div_data
){
196 .offset
= HHI_VID_PLL_CNTL
,
199 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
201 .hw
.init
= &(struct clk_init_data
){
202 .name
= "hdmi_pll_hdmi_out",
203 .ops
= &clk_regmap_divider_ro_ops
,
204 .parent_hws
= (const struct clk_hw
*[]) {
205 &meson8b_hdmi_pll_dco
.hw
208 .flags
= CLK_SET_RATE_PARENT
,
212 static struct clk_regmap meson8b_sys_pll_dco
= {
213 .data
= &(struct meson_clk_pll_data
){
215 .reg_off
= HHI_SYS_PLL_CNTL
,
220 .reg_off
= HHI_SYS_PLL_CNTL
,
225 .reg_off
= HHI_SYS_PLL_CNTL
,
230 .reg_off
= HHI_SYS_PLL_CNTL
,
235 .reg_off
= HHI_SYS_PLL_CNTL
,
239 .table
= sys_pll_params_table
,
241 .hw
.init
= &(struct clk_init_data
){
242 .name
= "sys_pll_dco",
243 .ops
= &meson_clk_pll_ops
,
244 .parent_data
= &(const struct clk_parent_data
) {
253 static struct clk_regmap meson8b_sys_pll
= {
254 .data
= &(struct clk_regmap_div_data
){
255 .offset
= HHI_SYS_PLL_CNTL
,
258 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
260 .hw
.init
= &(struct clk_init_data
){
262 .ops
= &clk_regmap_divider_ops
,
263 .parent_hws
= (const struct clk_hw
*[]) {
264 &meson8b_sys_pll_dco
.hw
267 .flags
= CLK_SET_RATE_PARENT
,
271 static struct clk_fixed_factor meson8b_fclk_div2_div
= {
274 .hw
.init
= &(struct clk_init_data
){
275 .name
= "fclk_div2_div",
276 .ops
= &clk_fixed_factor_ops
,
277 .parent_hws
= (const struct clk_hw
*[]) {
278 &meson8b_fixed_pll
.hw
284 static struct clk_regmap meson8b_fclk_div2
= {
285 .data
= &(struct clk_regmap_gate_data
){
286 .offset
= HHI_MPLL_CNTL6
,
289 .hw
.init
= &(struct clk_init_data
){
291 .ops
= &clk_regmap_gate_ops
,
292 .parent_hws
= (const struct clk_hw
*[]) {
293 &meson8b_fclk_div2_div
.hw
297 * FIXME: Ethernet with a RGMII PHYs is not working if
298 * fclk_div2 is disabled. it is currently unclear why this
299 * is. keep it enabled until the Ethernet driver knows how
300 * to manage this clock.
302 .flags
= CLK_IS_CRITICAL
,
306 static struct clk_fixed_factor meson8b_fclk_div3_div
= {
309 .hw
.init
= &(struct clk_init_data
){
310 .name
= "fclk_div3_div",
311 .ops
= &clk_fixed_factor_ops
,
312 .parent_hws
= (const struct clk_hw
*[]) {
313 &meson8b_fixed_pll
.hw
319 static struct clk_regmap meson8b_fclk_div3
= {
320 .data
= &(struct clk_regmap_gate_data
){
321 .offset
= HHI_MPLL_CNTL6
,
324 .hw
.init
= &(struct clk_init_data
){
326 .ops
= &clk_regmap_gate_ops
,
327 .parent_hws
= (const struct clk_hw
*[]) {
328 &meson8b_fclk_div3_div
.hw
334 static struct clk_fixed_factor meson8b_fclk_div4_div
= {
337 .hw
.init
= &(struct clk_init_data
){
338 .name
= "fclk_div4_div",
339 .ops
= &clk_fixed_factor_ops
,
340 .parent_hws
= (const struct clk_hw
*[]) {
341 &meson8b_fixed_pll
.hw
347 static struct clk_regmap meson8b_fclk_div4
= {
348 .data
= &(struct clk_regmap_gate_data
){
349 .offset
= HHI_MPLL_CNTL6
,
352 .hw
.init
= &(struct clk_init_data
){
354 .ops
= &clk_regmap_gate_ops
,
355 .parent_hws
= (const struct clk_hw
*[]) {
356 &meson8b_fclk_div4_div
.hw
362 static struct clk_fixed_factor meson8b_fclk_div5_div
= {
365 .hw
.init
= &(struct clk_init_data
){
366 .name
= "fclk_div5_div",
367 .ops
= &clk_fixed_factor_ops
,
368 .parent_hws
= (const struct clk_hw
*[]) {
369 &meson8b_fixed_pll
.hw
375 static struct clk_regmap meson8b_fclk_div5
= {
376 .data
= &(struct clk_regmap_gate_data
){
377 .offset
= HHI_MPLL_CNTL6
,
380 .hw
.init
= &(struct clk_init_data
){
382 .ops
= &clk_regmap_gate_ops
,
383 .parent_hws
= (const struct clk_hw
*[]) {
384 &meson8b_fclk_div5_div
.hw
390 static struct clk_fixed_factor meson8b_fclk_div7_div
= {
393 .hw
.init
= &(struct clk_init_data
){
394 .name
= "fclk_div7_div",
395 .ops
= &clk_fixed_factor_ops
,
396 .parent_hws
= (const struct clk_hw
*[]) {
397 &meson8b_fixed_pll
.hw
403 static struct clk_regmap meson8b_fclk_div7
= {
404 .data
= &(struct clk_regmap_gate_data
){
405 .offset
= HHI_MPLL_CNTL6
,
408 .hw
.init
= &(struct clk_init_data
){
410 .ops
= &clk_regmap_gate_ops
,
411 .parent_hws
= (const struct clk_hw
*[]) {
412 &meson8b_fclk_div7_div
.hw
418 static struct clk_regmap meson8b_mpll_prediv
= {
419 .data
= &(struct clk_regmap_div_data
){
420 .offset
= HHI_MPLL_CNTL5
,
424 .hw
.init
= &(struct clk_init_data
){
425 .name
= "mpll_prediv",
426 .ops
= &clk_regmap_divider_ro_ops
,
427 .parent_hws
= (const struct clk_hw
*[]) {
428 &meson8b_fixed_pll
.hw
434 static struct clk_regmap meson8b_mpll0_div
= {
435 .data
= &(struct meson_clk_mpll_data
){
437 .reg_off
= HHI_MPLL_CNTL7
,
442 .reg_off
= HHI_MPLL_CNTL7
,
447 .reg_off
= HHI_MPLL_CNTL7
,
452 .reg_off
= HHI_MPLL_CNTL
,
456 .lock
= &meson_clk_lock
,
458 .hw
.init
= &(struct clk_init_data
){
460 .ops
= &meson_clk_mpll_ops
,
461 .parent_hws
= (const struct clk_hw
*[]) {
462 &meson8b_mpll_prediv
.hw
468 static struct clk_regmap meson8b_mpll0
= {
469 .data
= &(struct clk_regmap_gate_data
){
470 .offset
= HHI_MPLL_CNTL7
,
473 .hw
.init
= &(struct clk_init_data
){
475 .ops
= &clk_regmap_gate_ops
,
476 .parent_hws
= (const struct clk_hw
*[]) {
477 &meson8b_mpll0_div
.hw
480 .flags
= CLK_SET_RATE_PARENT
,
484 static struct clk_regmap meson8b_mpll1_div
= {
485 .data
= &(struct meson_clk_mpll_data
){
487 .reg_off
= HHI_MPLL_CNTL8
,
492 .reg_off
= HHI_MPLL_CNTL8
,
497 .reg_off
= HHI_MPLL_CNTL8
,
501 .lock
= &meson_clk_lock
,
503 .hw
.init
= &(struct clk_init_data
){
505 .ops
= &meson_clk_mpll_ops
,
506 .parent_hws
= (const struct clk_hw
*[]) {
507 &meson8b_mpll_prediv
.hw
513 static struct clk_regmap meson8b_mpll1
= {
514 .data
= &(struct clk_regmap_gate_data
){
515 .offset
= HHI_MPLL_CNTL8
,
518 .hw
.init
= &(struct clk_init_data
){
520 .ops
= &clk_regmap_gate_ops
,
521 .parent_hws
= (const struct clk_hw
*[]) {
522 &meson8b_mpll1_div
.hw
525 .flags
= CLK_SET_RATE_PARENT
,
529 static struct clk_regmap meson8b_mpll2_div
= {
530 .data
= &(struct meson_clk_mpll_data
){
532 .reg_off
= HHI_MPLL_CNTL9
,
537 .reg_off
= HHI_MPLL_CNTL9
,
542 .reg_off
= HHI_MPLL_CNTL9
,
546 .lock
= &meson_clk_lock
,
548 .hw
.init
= &(struct clk_init_data
){
550 .ops
= &meson_clk_mpll_ops
,
551 .parent_hws
= (const struct clk_hw
*[]) {
552 &meson8b_mpll_prediv
.hw
558 static struct clk_regmap meson8b_mpll2
= {
559 .data
= &(struct clk_regmap_gate_data
){
560 .offset
= HHI_MPLL_CNTL9
,
563 .hw
.init
= &(struct clk_init_data
){
565 .ops
= &clk_regmap_gate_ops
,
566 .parent_hws
= (const struct clk_hw
*[]) {
567 &meson8b_mpll2_div
.hw
570 .flags
= CLK_SET_RATE_PARENT
,
574 static u32 mux_table_clk81
[] = { 6, 5, 7 };
575 static struct clk_regmap meson8b_mpeg_clk_sel
= {
576 .data
= &(struct clk_regmap_mux_data
){
577 .offset
= HHI_MPEG_CLK_CNTL
,
580 .table
= mux_table_clk81
,
582 .hw
.init
= &(struct clk_init_data
){
583 .name
= "mpeg_clk_sel",
584 .ops
= &clk_regmap_mux_ro_ops
,
586 * FIXME bits 14:12 selects from 8 possible parents:
587 * xtal, 1'b0 (wtf), fclk_div7, mpll_clkout1, mpll_clkout2,
588 * fclk_div4, fclk_div3, fclk_div5
590 .parent_hws
= (const struct clk_hw
*[]) {
591 &meson8b_fclk_div3
.hw
,
592 &meson8b_fclk_div4
.hw
,
593 &meson8b_fclk_div5
.hw
,
599 static struct clk_regmap meson8b_mpeg_clk_div
= {
600 .data
= &(struct clk_regmap_div_data
){
601 .offset
= HHI_MPEG_CLK_CNTL
,
605 .hw
.init
= &(struct clk_init_data
){
606 .name
= "mpeg_clk_div",
607 .ops
= &clk_regmap_divider_ro_ops
,
608 .parent_hws
= (const struct clk_hw
*[]) {
609 &meson8b_mpeg_clk_sel
.hw
615 static struct clk_regmap meson8b_clk81
= {
616 .data
= &(struct clk_regmap_gate_data
){
617 .offset
= HHI_MPEG_CLK_CNTL
,
620 .hw
.init
= &(struct clk_init_data
){
622 .ops
= &clk_regmap_gate_ops
,
623 .parent_hws
= (const struct clk_hw
*[]) {
624 &meson8b_mpeg_clk_div
.hw
627 .flags
= CLK_IS_CRITICAL
,
631 static struct clk_regmap meson8b_cpu_in_sel
= {
632 .data
= &(struct clk_regmap_mux_data
){
633 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
637 .hw
.init
= &(struct clk_init_data
){
638 .name
= "cpu_in_sel",
639 .ops
= &clk_regmap_mux_ops
,
640 .parent_data
= (const struct clk_parent_data
[]) {
641 { .fw_name
= "xtal", .name
= "xtal", .index
= -1, },
642 { .hw
= &meson8b_sys_pll
.hw
, },
645 .flags
= (CLK_SET_RATE_PARENT
|
646 CLK_SET_RATE_NO_REPARENT
),
650 static struct clk_fixed_factor meson8b_cpu_in_div2
= {
653 .hw
.init
= &(struct clk_init_data
){
654 .name
= "cpu_in_div2",
655 .ops
= &clk_fixed_factor_ops
,
656 .parent_hws
= (const struct clk_hw
*[]) {
657 &meson8b_cpu_in_sel
.hw
660 .flags
= CLK_SET_RATE_PARENT
,
664 static struct clk_fixed_factor meson8b_cpu_in_div3
= {
667 .hw
.init
= &(struct clk_init_data
){
668 .name
= "cpu_in_div3",
669 .ops
= &clk_fixed_factor_ops
,
670 .parent_hws
= (const struct clk_hw
*[]) {
671 &meson8b_cpu_in_sel
.hw
674 .flags
= CLK_SET_RATE_PARENT
,
678 static const struct clk_div_table cpu_scale_table
[] = {
679 { .val
= 1, .div
= 4 },
680 { .val
= 2, .div
= 6 },
681 { .val
= 3, .div
= 8 },
682 { .val
= 4, .div
= 10 },
683 { .val
= 5, .div
= 12 },
684 { .val
= 6, .div
= 14 },
685 { .val
= 7, .div
= 16 },
686 { .val
= 8, .div
= 18 },
690 static struct clk_regmap meson8b_cpu_scale_div
= {
691 .data
= &(struct clk_regmap_div_data
){
692 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
695 .table
= cpu_scale_table
,
696 .flags
= CLK_DIVIDER_ALLOW_ZERO
,
698 .hw
.init
= &(struct clk_init_data
){
699 .name
= "cpu_scale_div",
700 .ops
= &clk_regmap_divider_ops
,
701 .parent_hws
= (const struct clk_hw
*[]) {
702 &meson8b_cpu_in_sel
.hw
705 .flags
= CLK_SET_RATE_PARENT
,
709 static u32 mux_table_cpu_scale_out_sel
[] = { 0, 1, 3 };
710 static struct clk_regmap meson8b_cpu_scale_out_sel
= {
711 .data
= &(struct clk_regmap_mux_data
){
712 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
715 .table
= mux_table_cpu_scale_out_sel
,
717 .hw
.init
= &(struct clk_init_data
){
718 .name
= "cpu_scale_out_sel",
719 .ops
= &clk_regmap_mux_ops
,
721 * NOTE: We are skipping the parent with value 0x2 (which is
722 * meson8b_cpu_in_div3) because it results in a duty cycle of
723 * 33% which makes the system unstable and can result in a
724 * lockup of the whole system.
726 .parent_hws
= (const struct clk_hw
*[]) {
727 &meson8b_cpu_in_sel
.hw
,
728 &meson8b_cpu_in_div2
.hw
,
729 &meson8b_cpu_scale_div
.hw
,
732 .flags
= CLK_SET_RATE_PARENT
,
736 static struct clk_regmap meson8b_cpu_clk
= {
737 .data
= &(struct clk_regmap_mux_data
){
738 .offset
= HHI_SYS_CPU_CLK_CNTL0
,
742 .hw
.init
= &(struct clk_init_data
){
744 .ops
= &clk_regmap_mux_ops
,
745 .parent_data
= (const struct clk_parent_data
[]) {
746 { .fw_name
= "xtal", .name
= "xtal", .index
= -1, },
747 { .hw
= &meson8b_cpu_scale_out_sel
.hw
, },
750 .flags
= (CLK_SET_RATE_PARENT
|
751 CLK_SET_RATE_NO_REPARENT
|
756 static struct clk_regmap meson8b_nand_clk_sel
= {
757 .data
= &(struct clk_regmap_mux_data
){
758 .offset
= HHI_NAND_CLK_CNTL
,
761 .flags
= CLK_MUX_ROUND_CLOSEST
,
763 .hw
.init
= &(struct clk_init_data
){
764 .name
= "nand_clk_sel",
765 .ops
= &clk_regmap_mux_ops
,
766 /* FIXME all other parents are unknown: */
767 .parent_data
= (const struct clk_parent_data
[]) {
768 { .hw
= &meson8b_fclk_div4
.hw
, },
769 { .hw
= &meson8b_fclk_div3
.hw
, },
770 { .hw
= &meson8b_fclk_div5
.hw
, },
771 { .hw
= &meson8b_fclk_div7
.hw
, },
772 { .fw_name
= "xtal", .name
= "xtal", .index
= -1, },
775 .flags
= CLK_SET_RATE_PARENT
,
779 static struct clk_regmap meson8b_nand_clk_div
= {
780 .data
= &(struct clk_regmap_div_data
){
781 .offset
= HHI_NAND_CLK_CNTL
,
784 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
786 .hw
.init
= &(struct clk_init_data
){
787 .name
= "nand_clk_div",
788 .ops
= &clk_regmap_divider_ops
,
789 .parent_hws
= (const struct clk_hw
*[]) {
790 &meson8b_nand_clk_sel
.hw
793 .flags
= CLK_SET_RATE_PARENT
,
797 static struct clk_regmap meson8b_nand_clk_gate
= {
798 .data
= &(struct clk_regmap_gate_data
){
799 .offset
= HHI_NAND_CLK_CNTL
,
802 .hw
.init
= &(struct clk_init_data
){
803 .name
= "nand_clk_gate",
804 .ops
= &clk_regmap_gate_ops
,
805 .parent_hws
= (const struct clk_hw
*[]) {
806 &meson8b_nand_clk_div
.hw
809 .flags
= CLK_SET_RATE_PARENT
,
813 static struct clk_fixed_factor meson8b_cpu_clk_div2
= {
816 .hw
.init
= &(struct clk_init_data
){
817 .name
= "cpu_clk_div2",
818 .ops
= &clk_fixed_factor_ops
,
819 .parent_hws
= (const struct clk_hw
*[]) {
826 static struct clk_fixed_factor meson8b_cpu_clk_div3
= {
829 .hw
.init
= &(struct clk_init_data
){
830 .name
= "cpu_clk_div3",
831 .ops
= &clk_fixed_factor_ops
,
832 .parent_hws
= (const struct clk_hw
*[]) {
839 static struct clk_fixed_factor meson8b_cpu_clk_div4
= {
842 .hw
.init
= &(struct clk_init_data
){
843 .name
= "cpu_clk_div4",
844 .ops
= &clk_fixed_factor_ops
,
845 .parent_hws
= (const struct clk_hw
*[]) {
852 static struct clk_fixed_factor meson8b_cpu_clk_div5
= {
855 .hw
.init
= &(struct clk_init_data
){
856 .name
= "cpu_clk_div5",
857 .ops
= &clk_fixed_factor_ops
,
858 .parent_hws
= (const struct clk_hw
*[]) {
865 static struct clk_fixed_factor meson8b_cpu_clk_div6
= {
868 .hw
.init
= &(struct clk_init_data
){
869 .name
= "cpu_clk_div6",
870 .ops
= &clk_fixed_factor_ops
,
871 .parent_hws
= (const struct clk_hw
*[]) {
878 static struct clk_fixed_factor meson8b_cpu_clk_div7
= {
881 .hw
.init
= &(struct clk_init_data
){
882 .name
= "cpu_clk_div7",
883 .ops
= &clk_fixed_factor_ops
,
884 .parent_hws
= (const struct clk_hw
*[]) {
891 static struct clk_fixed_factor meson8b_cpu_clk_div8
= {
894 .hw
.init
= &(struct clk_init_data
){
895 .name
= "cpu_clk_div8",
896 .ops
= &clk_fixed_factor_ops
,
897 .parent_hws
= (const struct clk_hw
*[]) {
904 static u32 mux_table_apb
[] = { 1, 2, 3, 4, 5, 6, 7 };
905 static struct clk_regmap meson8b_apb_clk_sel
= {
906 .data
= &(struct clk_regmap_mux_data
){
907 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
910 .table
= mux_table_apb
,
912 .hw
.init
= &(struct clk_init_data
){
913 .name
= "apb_clk_sel",
914 .ops
= &clk_regmap_mux_ops
,
915 .parent_hws
= (const struct clk_hw
*[]) {
916 &meson8b_cpu_clk_div2
.hw
,
917 &meson8b_cpu_clk_div3
.hw
,
918 &meson8b_cpu_clk_div4
.hw
,
919 &meson8b_cpu_clk_div5
.hw
,
920 &meson8b_cpu_clk_div6
.hw
,
921 &meson8b_cpu_clk_div7
.hw
,
922 &meson8b_cpu_clk_div8
.hw
,
928 static struct clk_regmap meson8b_apb_clk_gate
= {
929 .data
= &(struct clk_regmap_gate_data
){
930 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
932 .flags
= CLK_GATE_SET_TO_DISABLE
,
934 .hw
.init
= &(struct clk_init_data
){
935 .name
= "apb_clk_dis",
936 .ops
= &clk_regmap_gate_ro_ops
,
937 .parent_hws
= (const struct clk_hw
*[]) {
938 &meson8b_apb_clk_sel
.hw
941 .flags
= CLK_SET_RATE_PARENT
,
945 static struct clk_regmap meson8b_periph_clk_sel
= {
946 .data
= &(struct clk_regmap_mux_data
){
947 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
951 .hw
.init
= &(struct clk_init_data
){
952 .name
= "periph_clk_sel",
953 .ops
= &clk_regmap_mux_ops
,
954 .parent_hws
= (const struct clk_hw
*[]) {
955 &meson8b_cpu_clk_div2
.hw
,
956 &meson8b_cpu_clk_div3
.hw
,
957 &meson8b_cpu_clk_div4
.hw
,
958 &meson8b_cpu_clk_div5
.hw
,
959 &meson8b_cpu_clk_div6
.hw
,
960 &meson8b_cpu_clk_div7
.hw
,
961 &meson8b_cpu_clk_div8
.hw
,
967 static struct clk_regmap meson8b_periph_clk_gate
= {
968 .data
= &(struct clk_regmap_gate_data
){
969 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
971 .flags
= CLK_GATE_SET_TO_DISABLE
,
973 .hw
.init
= &(struct clk_init_data
){
974 .name
= "periph_clk_dis",
975 .ops
= &clk_regmap_gate_ro_ops
,
976 .parent_hws
= (const struct clk_hw
*[]) {
977 &meson8b_periph_clk_sel
.hw
980 .flags
= CLK_SET_RATE_PARENT
,
984 static u32 mux_table_axi
[] = { 1, 2, 3, 4, 5, 6, 7 };
985 static struct clk_regmap meson8b_axi_clk_sel
= {
986 .data
= &(struct clk_regmap_mux_data
){
987 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
990 .table
= mux_table_axi
,
992 .hw
.init
= &(struct clk_init_data
){
993 .name
= "axi_clk_sel",
994 .ops
= &clk_regmap_mux_ops
,
995 .parent_hws
= (const struct clk_hw
*[]) {
996 &meson8b_cpu_clk_div2
.hw
,
997 &meson8b_cpu_clk_div3
.hw
,
998 &meson8b_cpu_clk_div4
.hw
,
999 &meson8b_cpu_clk_div5
.hw
,
1000 &meson8b_cpu_clk_div6
.hw
,
1001 &meson8b_cpu_clk_div7
.hw
,
1002 &meson8b_cpu_clk_div8
.hw
,
1008 static struct clk_regmap meson8b_axi_clk_gate
= {
1009 .data
= &(struct clk_regmap_gate_data
){
1010 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1012 .flags
= CLK_GATE_SET_TO_DISABLE
,
1014 .hw
.init
= &(struct clk_init_data
){
1015 .name
= "axi_clk_dis",
1016 .ops
= &clk_regmap_gate_ro_ops
,
1017 .parent_hws
= (const struct clk_hw
*[]) {
1018 &meson8b_axi_clk_sel
.hw
1021 .flags
= CLK_SET_RATE_PARENT
,
1025 static struct clk_regmap meson8b_l2_dram_clk_sel
= {
1026 .data
= &(struct clk_regmap_mux_data
){
1027 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1031 .hw
.init
= &(struct clk_init_data
){
1032 .name
= "l2_dram_clk_sel",
1033 .ops
= &clk_regmap_mux_ops
,
1034 .parent_hws
= (const struct clk_hw
*[]) {
1035 &meson8b_cpu_clk_div2
.hw
,
1036 &meson8b_cpu_clk_div3
.hw
,
1037 &meson8b_cpu_clk_div4
.hw
,
1038 &meson8b_cpu_clk_div5
.hw
,
1039 &meson8b_cpu_clk_div6
.hw
,
1040 &meson8b_cpu_clk_div7
.hw
,
1041 &meson8b_cpu_clk_div8
.hw
,
1047 static struct clk_regmap meson8b_l2_dram_clk_gate
= {
1048 .data
= &(struct clk_regmap_gate_data
){
1049 .offset
= HHI_SYS_CPU_CLK_CNTL1
,
1051 .flags
= CLK_GATE_SET_TO_DISABLE
,
1053 .hw
.init
= &(struct clk_init_data
){
1054 .name
= "l2_dram_clk_dis",
1055 .ops
= &clk_regmap_gate_ro_ops
,
1056 .parent_hws
= (const struct clk_hw
*[]) {
1057 &meson8b_l2_dram_clk_sel
.hw
1060 .flags
= CLK_SET_RATE_PARENT
,
1064 static struct clk_regmap meson8b_vid_pll_in_sel
= {
1065 .data
= &(struct clk_regmap_mux_data
){
1066 .offset
= HHI_VID_DIVIDER_CNTL
,
1070 .hw
.init
= &(struct clk_init_data
){
1071 .name
= "vid_pll_in_sel",
1072 .ops
= &clk_regmap_mux_ro_ops
,
1074 * TODO: depending on the SoC there is also a second parent:
1076 * Meson8b: hdmi_pll_dco
1077 * Meson8m2: vid2_pll
1079 .parent_hws
= (const struct clk_hw
*[]) {
1080 &meson8b_hdmi_pll_dco
.hw
1083 .flags
= CLK_SET_RATE_PARENT
,
1087 static struct clk_regmap meson8b_vid_pll_in_en
= {
1088 .data
= &(struct clk_regmap_gate_data
){
1089 .offset
= HHI_VID_DIVIDER_CNTL
,
1092 .hw
.init
= &(struct clk_init_data
){
1093 .name
= "vid_pll_in_en",
1094 .ops
= &clk_regmap_gate_ro_ops
,
1095 .parent_hws
= (const struct clk_hw
*[]) {
1096 &meson8b_vid_pll_in_sel
.hw
1099 .flags
= CLK_SET_RATE_PARENT
,
1103 static struct clk_regmap meson8b_vid_pll_pre_div
= {
1104 .data
= &(struct clk_regmap_div_data
){
1105 .offset
= HHI_VID_DIVIDER_CNTL
,
1109 .hw
.init
= &(struct clk_init_data
){
1110 .name
= "vid_pll_pre_div",
1111 .ops
= &clk_regmap_divider_ro_ops
,
1112 .parent_hws
= (const struct clk_hw
*[]) {
1113 &meson8b_vid_pll_in_en
.hw
1116 .flags
= CLK_SET_RATE_PARENT
,
1120 static struct clk_regmap meson8b_vid_pll_post_div
= {
1121 .data
= &(struct clk_regmap_div_data
){
1122 .offset
= HHI_VID_DIVIDER_CNTL
,
1126 .hw
.init
= &(struct clk_init_data
){
1127 .name
= "vid_pll_post_div",
1128 .ops
= &clk_regmap_divider_ro_ops
,
1129 .parent_hws
= (const struct clk_hw
*[]) {
1130 &meson8b_vid_pll_pre_div
.hw
1133 .flags
= CLK_SET_RATE_PARENT
,
1137 static struct clk_regmap meson8b_vid_pll
= {
1138 .data
= &(struct clk_regmap_mux_data
){
1139 .offset
= HHI_VID_DIVIDER_CNTL
,
1143 .hw
.init
= &(struct clk_init_data
){
1145 .ops
= &clk_regmap_mux_ro_ops
,
1146 /* TODO: parent 0x2 is vid_pll_pre_div_mult7_div2 */
1147 .parent_hws
= (const struct clk_hw
*[]) {
1148 &meson8b_vid_pll_pre_div
.hw
,
1149 &meson8b_vid_pll_post_div
.hw
,
1152 .flags
= CLK_SET_RATE_PARENT
,
1156 static struct clk_regmap meson8b_vid_pll_final_div
= {
1157 .data
= &(struct clk_regmap_div_data
){
1158 .offset
= HHI_VID_CLK_DIV
,
1162 .hw
.init
= &(struct clk_init_data
){
1163 .name
= "vid_pll_final_div",
1164 .ops
= &clk_regmap_divider_ro_ops
,
1165 .parent_hws
= (const struct clk_hw
*[]) {
1169 .flags
= CLK_SET_RATE_PARENT
,
1173 static const struct clk_hw
*meson8b_vclk_mux_parent_hws
[] = {
1174 &meson8b_vid_pll_final_div
.hw
,
1175 &meson8b_fclk_div4
.hw
,
1176 &meson8b_fclk_div3
.hw
,
1177 &meson8b_fclk_div5
.hw
,
1178 &meson8b_vid_pll_final_div
.hw
,
1179 &meson8b_fclk_div7
.hw
,
1183 static struct clk_regmap meson8b_vclk_in_sel
= {
1184 .data
= &(struct clk_regmap_mux_data
){
1185 .offset
= HHI_VID_CLK_CNTL
,
1189 .hw
.init
= &(struct clk_init_data
){
1190 .name
= "vclk_in_sel",
1191 .ops
= &clk_regmap_mux_ro_ops
,
1192 .parent_hws
= meson8b_vclk_mux_parent_hws
,
1193 .num_parents
= ARRAY_SIZE(meson8b_vclk_mux_parent_hws
),
1194 .flags
= CLK_SET_RATE_PARENT
,
1198 static struct clk_regmap meson8b_vclk_in_en
= {
1199 .data
= &(struct clk_regmap_gate_data
){
1200 .offset
= HHI_VID_CLK_DIV
,
1203 .hw
.init
= &(struct clk_init_data
){
1204 .name
= "vclk_in_en",
1205 .ops
= &clk_regmap_gate_ro_ops
,
1206 .parent_hws
= (const struct clk_hw
*[]) {
1207 &meson8b_vclk_in_sel
.hw
1210 .flags
= CLK_SET_RATE_PARENT
,
1214 static struct clk_regmap meson8b_vclk_div1_gate
= {
1215 .data
= &(struct clk_regmap_gate_data
){
1216 .offset
= HHI_VID_CLK_DIV
,
1219 .hw
.init
= &(struct clk_init_data
){
1220 .name
= "vclk_div1_en",
1221 .ops
= &clk_regmap_gate_ro_ops
,
1222 .parent_hws
= (const struct clk_hw
*[]) {
1223 &meson8b_vclk_in_en
.hw
1226 .flags
= CLK_SET_RATE_PARENT
,
1230 static struct clk_fixed_factor meson8b_vclk_div2_div
= {
1233 .hw
.init
= &(struct clk_init_data
){
1234 .name
= "vclk_div2",
1235 .ops
= &clk_fixed_factor_ops
,
1236 .parent_hws
= (const struct clk_hw
*[]) {
1237 &meson8b_vclk_in_en
.hw
1240 .flags
= CLK_SET_RATE_PARENT
,
1244 static struct clk_regmap meson8b_vclk_div2_div_gate
= {
1245 .data
= &(struct clk_regmap_gate_data
){
1246 .offset
= HHI_VID_CLK_DIV
,
1249 .hw
.init
= &(struct clk_init_data
){
1250 .name
= "vclk_div2_en",
1251 .ops
= &clk_regmap_gate_ro_ops
,
1252 .parent_hws
= (const struct clk_hw
*[]) {
1253 &meson8b_vclk_div2_div
.hw
1256 .flags
= CLK_SET_RATE_PARENT
,
1260 static struct clk_fixed_factor meson8b_vclk_div4_div
= {
1263 .hw
.init
= &(struct clk_init_data
){
1264 .name
= "vclk_div4",
1265 .ops
= &clk_fixed_factor_ops
,
1266 .parent_hws
= (const struct clk_hw
*[]) {
1267 &meson8b_vclk_in_en
.hw
1270 .flags
= CLK_SET_RATE_PARENT
,
1274 static struct clk_regmap meson8b_vclk_div4_div_gate
= {
1275 .data
= &(struct clk_regmap_gate_data
){
1276 .offset
= HHI_VID_CLK_DIV
,
1279 .hw
.init
= &(struct clk_init_data
){
1280 .name
= "vclk_div4_en",
1281 .ops
= &clk_regmap_gate_ro_ops
,
1282 .parent_hws
= (const struct clk_hw
*[]) {
1283 &meson8b_vclk_div4_div
.hw
1286 .flags
= CLK_SET_RATE_PARENT
,
1290 static struct clk_fixed_factor meson8b_vclk_div6_div
= {
1293 .hw
.init
= &(struct clk_init_data
){
1294 .name
= "vclk_div6",
1295 .ops
= &clk_fixed_factor_ops
,
1296 .parent_hws
= (const struct clk_hw
*[]) {
1297 &meson8b_vclk_in_en
.hw
1300 .flags
= CLK_SET_RATE_PARENT
,
1304 static struct clk_regmap meson8b_vclk_div6_div_gate
= {
1305 .data
= &(struct clk_regmap_gate_data
){
1306 .offset
= HHI_VID_CLK_DIV
,
1309 .hw
.init
= &(struct clk_init_data
){
1310 .name
= "vclk_div6_en",
1311 .ops
= &clk_regmap_gate_ro_ops
,
1312 .parent_hws
= (const struct clk_hw
*[]) {
1313 &meson8b_vclk_div6_div
.hw
1316 .flags
= CLK_SET_RATE_PARENT
,
1320 static struct clk_fixed_factor meson8b_vclk_div12_div
= {
1323 .hw
.init
= &(struct clk_init_data
){
1324 .name
= "vclk_div12",
1325 .ops
= &clk_fixed_factor_ops
,
1326 .parent_hws
= (const struct clk_hw
*[]) {
1327 &meson8b_vclk_in_en
.hw
1330 .flags
= CLK_SET_RATE_PARENT
,
1334 static struct clk_regmap meson8b_vclk_div12_div_gate
= {
1335 .data
= &(struct clk_regmap_gate_data
){
1336 .offset
= HHI_VID_CLK_DIV
,
1339 .hw
.init
= &(struct clk_init_data
){
1340 .name
= "vclk_div12_en",
1341 .ops
= &clk_regmap_gate_ro_ops
,
1342 .parent_hws
= (const struct clk_hw
*[]) {
1343 &meson8b_vclk_div12_div
.hw
1346 .flags
= CLK_SET_RATE_PARENT
,
1350 static struct clk_regmap meson8b_vclk2_in_sel
= {
1351 .data
= &(struct clk_regmap_mux_data
){
1352 .offset
= HHI_VIID_CLK_CNTL
,
1356 .hw
.init
= &(struct clk_init_data
){
1357 .name
= "vclk2_in_sel",
1358 .ops
= &clk_regmap_mux_ro_ops
,
1359 .parent_hws
= meson8b_vclk_mux_parent_hws
,
1360 .num_parents
= ARRAY_SIZE(meson8b_vclk_mux_parent_hws
),
1361 .flags
= CLK_SET_RATE_PARENT
,
1365 static struct clk_regmap meson8b_vclk2_clk_in_en
= {
1366 .data
= &(struct clk_regmap_gate_data
){
1367 .offset
= HHI_VIID_CLK_DIV
,
1370 .hw
.init
= &(struct clk_init_data
){
1371 .name
= "vclk2_in_en",
1372 .ops
= &clk_regmap_gate_ro_ops
,
1373 .parent_hws
= (const struct clk_hw
*[]) {
1374 &meson8b_vclk2_in_sel
.hw
1377 .flags
= CLK_SET_RATE_PARENT
,
1381 static struct clk_regmap meson8b_vclk2_div1_gate
= {
1382 .data
= &(struct clk_regmap_gate_data
){
1383 .offset
= HHI_VIID_CLK_DIV
,
1386 .hw
.init
= &(struct clk_init_data
){
1387 .name
= "vclk2_div1_en",
1388 .ops
= &clk_regmap_gate_ro_ops
,
1389 .parent_hws
= (const struct clk_hw
*[]) {
1390 &meson8b_vclk2_clk_in_en
.hw
1393 .flags
= CLK_SET_RATE_PARENT
,
1397 static struct clk_fixed_factor meson8b_vclk2_div2_div
= {
1400 .hw
.init
= &(struct clk_init_data
){
1401 .name
= "vclk2_div2",
1402 .ops
= &clk_fixed_factor_ops
,
1403 .parent_hws
= (const struct clk_hw
*[]) {
1404 &meson8b_vclk2_clk_in_en
.hw
1407 .flags
= CLK_SET_RATE_PARENT
,
1411 static struct clk_regmap meson8b_vclk2_div2_div_gate
= {
1412 .data
= &(struct clk_regmap_gate_data
){
1413 .offset
= HHI_VIID_CLK_DIV
,
1416 .hw
.init
= &(struct clk_init_data
){
1417 .name
= "vclk2_div2_en",
1418 .ops
= &clk_regmap_gate_ro_ops
,
1419 .parent_hws
= (const struct clk_hw
*[]) {
1420 &meson8b_vclk2_div2_div
.hw
1423 .flags
= CLK_SET_RATE_PARENT
,
1427 static struct clk_fixed_factor meson8b_vclk2_div4_div
= {
1430 .hw
.init
= &(struct clk_init_data
){
1431 .name
= "vclk2_div4",
1432 .ops
= &clk_fixed_factor_ops
,
1433 .parent_hws
= (const struct clk_hw
*[]) {
1434 &meson8b_vclk2_clk_in_en
.hw
1437 .flags
= CLK_SET_RATE_PARENT
,
1441 static struct clk_regmap meson8b_vclk2_div4_div_gate
= {
1442 .data
= &(struct clk_regmap_gate_data
){
1443 .offset
= HHI_VIID_CLK_DIV
,
1446 .hw
.init
= &(struct clk_init_data
){
1447 .name
= "vclk2_div4_en",
1448 .ops
= &clk_regmap_gate_ro_ops
,
1449 .parent_hws
= (const struct clk_hw
*[]) {
1450 &meson8b_vclk2_div4_div
.hw
1453 .flags
= CLK_SET_RATE_PARENT
,
1457 static struct clk_fixed_factor meson8b_vclk2_div6_div
= {
1460 .hw
.init
= &(struct clk_init_data
){
1461 .name
= "vclk2_div6",
1462 .ops
= &clk_fixed_factor_ops
,
1463 .parent_hws
= (const struct clk_hw
*[]) {
1464 &meson8b_vclk2_clk_in_en
.hw
1467 .flags
= CLK_SET_RATE_PARENT
,
1471 static struct clk_regmap meson8b_vclk2_div6_div_gate
= {
1472 .data
= &(struct clk_regmap_gate_data
){
1473 .offset
= HHI_VIID_CLK_DIV
,
1476 .hw
.init
= &(struct clk_init_data
){
1477 .name
= "vclk2_div6_en",
1478 .ops
= &clk_regmap_gate_ro_ops
,
1479 .parent_hws
= (const struct clk_hw
*[]) {
1480 &meson8b_vclk2_div6_div
.hw
1483 .flags
= CLK_SET_RATE_PARENT
,
1487 static struct clk_fixed_factor meson8b_vclk2_div12_div
= {
1490 .hw
.init
= &(struct clk_init_data
){
1491 .name
= "vclk2_div12",
1492 .ops
= &clk_fixed_factor_ops
,
1493 .parent_hws
= (const struct clk_hw
*[]) {
1494 &meson8b_vclk2_clk_in_en
.hw
1497 .flags
= CLK_SET_RATE_PARENT
,
1501 static struct clk_regmap meson8b_vclk2_div12_div_gate
= {
1502 .data
= &(struct clk_regmap_gate_data
){
1503 .offset
= HHI_VIID_CLK_DIV
,
1506 .hw
.init
= &(struct clk_init_data
){
1507 .name
= "vclk2_div12_en",
1508 .ops
= &clk_regmap_gate_ro_ops
,
1509 .parent_hws
= (const struct clk_hw
*[]) {
1510 &meson8b_vclk2_div12_div
.hw
1513 .flags
= CLK_SET_RATE_PARENT
,
1517 static const struct clk_hw
*meson8b_vclk_enc_mux_parent_hws
[] = {
1518 &meson8b_vclk_div1_gate
.hw
,
1519 &meson8b_vclk_div2_div_gate
.hw
,
1520 &meson8b_vclk_div4_div_gate
.hw
,
1521 &meson8b_vclk_div6_div_gate
.hw
,
1522 &meson8b_vclk_div12_div_gate
.hw
,
1525 static struct clk_regmap meson8b_cts_enct_sel
= {
1526 .data
= &(struct clk_regmap_mux_data
){
1527 .offset
= HHI_VID_CLK_DIV
,
1531 .hw
.init
= &(struct clk_init_data
){
1532 .name
= "cts_enct_sel",
1533 .ops
= &clk_regmap_mux_ro_ops
,
1534 .parent_hws
= meson8b_vclk_enc_mux_parent_hws
,
1535 .num_parents
= ARRAY_SIZE(meson8b_vclk_enc_mux_parent_hws
),
1536 .flags
= CLK_SET_RATE_PARENT
,
1540 static struct clk_regmap meson8b_cts_enct
= {
1541 .data
= &(struct clk_regmap_gate_data
){
1542 .offset
= HHI_VID_CLK_CNTL2
,
1545 .hw
.init
= &(struct clk_init_data
){
1547 .ops
= &clk_regmap_gate_ro_ops
,
1548 .parent_hws
= (const struct clk_hw
*[]) {
1549 &meson8b_cts_enct_sel
.hw
1552 .flags
= CLK_SET_RATE_PARENT
,
1556 static struct clk_regmap meson8b_cts_encp_sel
= {
1557 .data
= &(struct clk_regmap_mux_data
){
1558 .offset
= HHI_VID_CLK_DIV
,
1562 .hw
.init
= &(struct clk_init_data
){
1563 .name
= "cts_encp_sel",
1564 .ops
= &clk_regmap_mux_ro_ops
,
1565 .parent_hws
= meson8b_vclk_enc_mux_parent_hws
,
1566 .num_parents
= ARRAY_SIZE(meson8b_vclk_enc_mux_parent_hws
),
1567 .flags
= CLK_SET_RATE_PARENT
,
1571 static struct clk_regmap meson8b_cts_encp
= {
1572 .data
= &(struct clk_regmap_gate_data
){
1573 .offset
= HHI_VID_CLK_CNTL2
,
1576 .hw
.init
= &(struct clk_init_data
){
1578 .ops
= &clk_regmap_gate_ro_ops
,
1579 .parent_hws
= (const struct clk_hw
*[]) {
1580 &meson8b_cts_encp_sel
.hw
1583 .flags
= CLK_SET_RATE_PARENT
,
1587 static struct clk_regmap meson8b_cts_enci_sel
= {
1588 .data
= &(struct clk_regmap_mux_data
){
1589 .offset
= HHI_VID_CLK_DIV
,
1593 .hw
.init
= &(struct clk_init_data
){
1594 .name
= "cts_enci_sel",
1595 .ops
= &clk_regmap_mux_ro_ops
,
1596 .parent_hws
= meson8b_vclk_enc_mux_parent_hws
,
1597 .num_parents
= ARRAY_SIZE(meson8b_vclk_enc_mux_parent_hws
),
1598 .flags
= CLK_SET_RATE_PARENT
,
1602 static struct clk_regmap meson8b_cts_enci
= {
1603 .data
= &(struct clk_regmap_gate_data
){
1604 .offset
= HHI_VID_CLK_CNTL2
,
1607 .hw
.init
= &(struct clk_init_data
){
1609 .ops
= &clk_regmap_gate_ro_ops
,
1610 .parent_hws
= (const struct clk_hw
*[]) {
1611 &meson8b_cts_enci_sel
.hw
1614 .flags
= CLK_SET_RATE_PARENT
,
1618 static struct clk_regmap meson8b_hdmi_tx_pixel_sel
= {
1619 .data
= &(struct clk_regmap_mux_data
){
1620 .offset
= HHI_HDMI_CLK_CNTL
,
1624 .hw
.init
= &(struct clk_init_data
){
1625 .name
= "hdmi_tx_pixel_sel",
1626 .ops
= &clk_regmap_mux_ro_ops
,
1627 .parent_hws
= meson8b_vclk_enc_mux_parent_hws
,
1628 .num_parents
= ARRAY_SIZE(meson8b_vclk_enc_mux_parent_hws
),
1629 .flags
= CLK_SET_RATE_PARENT
,
1633 static struct clk_regmap meson8b_hdmi_tx_pixel
= {
1634 .data
= &(struct clk_regmap_gate_data
){
1635 .offset
= HHI_VID_CLK_CNTL2
,
1638 .hw
.init
= &(struct clk_init_data
){
1639 .name
= "hdmi_tx_pixel",
1640 .ops
= &clk_regmap_gate_ro_ops
,
1641 .parent_hws
= (const struct clk_hw
*[]) {
1642 &meson8b_hdmi_tx_pixel_sel
.hw
1645 .flags
= CLK_SET_RATE_PARENT
,
1649 static const struct clk_hw
*meson8b_vclk2_enc_mux_parent_hws
[] = {
1650 &meson8b_vclk2_div1_gate
.hw
,
1651 &meson8b_vclk2_div2_div_gate
.hw
,
1652 &meson8b_vclk2_div4_div_gate
.hw
,
1653 &meson8b_vclk2_div6_div_gate
.hw
,
1654 &meson8b_vclk2_div12_div_gate
.hw
,
1657 static struct clk_regmap meson8b_cts_encl_sel
= {
1658 .data
= &(struct clk_regmap_mux_data
){
1659 .offset
= HHI_VIID_CLK_DIV
,
1663 .hw
.init
= &(struct clk_init_data
){
1664 .name
= "cts_encl_sel",
1665 .ops
= &clk_regmap_mux_ro_ops
,
1666 .parent_hws
= meson8b_vclk2_enc_mux_parent_hws
,
1667 .num_parents
= ARRAY_SIZE(meson8b_vclk2_enc_mux_parent_hws
),
1668 .flags
= CLK_SET_RATE_PARENT
,
1672 static struct clk_regmap meson8b_cts_encl
= {
1673 .data
= &(struct clk_regmap_gate_data
){
1674 .offset
= HHI_VID_CLK_CNTL2
,
1677 .hw
.init
= &(struct clk_init_data
){
1679 .ops
= &clk_regmap_gate_ro_ops
,
1680 .parent_hws
= (const struct clk_hw
*[]) {
1681 &meson8b_cts_encl_sel
.hw
1684 .flags
= CLK_SET_RATE_PARENT
,
1688 static struct clk_regmap meson8b_cts_vdac0_sel
= {
1689 .data
= &(struct clk_regmap_mux_data
){
1690 .offset
= HHI_VIID_CLK_DIV
,
1694 .hw
.init
= &(struct clk_init_data
){
1695 .name
= "cts_vdac0_sel",
1696 .ops
= &clk_regmap_mux_ro_ops
,
1697 .parent_hws
= meson8b_vclk2_enc_mux_parent_hws
,
1698 .num_parents
= ARRAY_SIZE(meson8b_vclk2_enc_mux_parent_hws
),
1699 .flags
= CLK_SET_RATE_PARENT
,
1703 static struct clk_regmap meson8b_cts_vdac0
= {
1704 .data
= &(struct clk_regmap_gate_data
){
1705 .offset
= HHI_VID_CLK_CNTL2
,
1708 .hw
.init
= &(struct clk_init_data
){
1709 .name
= "cts_vdac0",
1710 .ops
= &clk_regmap_gate_ro_ops
,
1711 .parent_hws
= (const struct clk_hw
*[]) {
1712 &meson8b_cts_vdac0_sel
.hw
1715 .flags
= CLK_SET_RATE_PARENT
,
1719 static struct clk_regmap meson8b_hdmi_sys_sel
= {
1720 .data
= &(struct clk_regmap_mux_data
){
1721 .offset
= HHI_HDMI_CLK_CNTL
,
1724 .flags
= CLK_MUX_ROUND_CLOSEST
,
1726 .hw
.init
= &(struct clk_init_data
){
1727 .name
= "hdmi_sys_sel",
1728 .ops
= &clk_regmap_mux_ro_ops
,
1729 /* FIXME: all other parents are unknown */
1730 .parent_data
= &(const struct clk_parent_data
) {
1736 .flags
= CLK_SET_RATE_NO_REPARENT
,
1740 static struct clk_regmap meson8b_hdmi_sys_div
= {
1741 .data
= &(struct clk_regmap_div_data
){
1742 .offset
= HHI_HDMI_CLK_CNTL
,
1746 .hw
.init
= &(struct clk_init_data
){
1747 .name
= "hdmi_sys_div",
1748 .ops
= &clk_regmap_divider_ro_ops
,
1749 .parent_hws
= (const struct clk_hw
*[]) {
1750 &meson8b_hdmi_sys_sel
.hw
1753 .flags
= CLK_SET_RATE_PARENT
,
1757 static struct clk_regmap meson8b_hdmi_sys
= {
1758 .data
= &(struct clk_regmap_gate_data
){
1759 .offset
= HHI_HDMI_CLK_CNTL
,
1762 .hw
.init
= &(struct clk_init_data
) {
1764 .ops
= &clk_regmap_gate_ro_ops
,
1765 .parent_hws
= (const struct clk_hw
*[]) {
1766 &meson8b_hdmi_sys_div
.hw
1769 .flags
= CLK_SET_RATE_PARENT
,
1774 * The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
1775 * muxed by a glitch-free switch on Meson8b and Meson8m2. The CCF can
1776 * actually manage this glitch-free mux because it does top-to-bottom
1777 * updates the each clock tree and switches to the "inactive" one when
1778 * CLK_SET_RATE_GATE is set.
1779 * Meson8 only has mali_0 and no glitch-free mux.
1781 static const struct clk_parent_data meson8b_mali_0_1_parent_data
[] = {
1782 { .fw_name
= "xtal", .name
= "xtal", .index
= -1, },
1783 { .hw
= &meson8b_mpll2
.hw
, },
1784 { .hw
= &meson8b_mpll1
.hw
, },
1785 { .hw
= &meson8b_fclk_div7
.hw
, },
1786 { .hw
= &meson8b_fclk_div4
.hw
, },
1787 { .hw
= &meson8b_fclk_div3
.hw
, },
1788 { .hw
= &meson8b_fclk_div5
.hw
, },
1791 static u32 meson8b_mali_0_1_mux_table
[] = { 0, 2, 3, 4, 5, 6, 7 };
1793 static struct clk_regmap meson8b_mali_0_sel
= {
1794 .data
= &(struct clk_regmap_mux_data
){
1795 .offset
= HHI_MALI_CLK_CNTL
,
1798 .table
= meson8b_mali_0_1_mux_table
,
1800 .hw
.init
= &(struct clk_init_data
){
1801 .name
= "mali_0_sel",
1802 .ops
= &clk_regmap_mux_ops
,
1803 .parent_data
= meson8b_mali_0_1_parent_data
,
1804 .num_parents
= ARRAY_SIZE(meson8b_mali_0_1_parent_data
),
1806 * Don't propagate rate changes up because the only changeable
1807 * parents are mpll1 and mpll2 but we need those for audio and
1808 * RGMII (Ethernet). We don't want to change the audio or
1809 * Ethernet clocks when setting the GPU frequency.
1815 static struct clk_regmap meson8b_mali_0_div
= {
1816 .data
= &(struct clk_regmap_div_data
){
1817 .offset
= HHI_MALI_CLK_CNTL
,
1821 .hw
.init
= &(struct clk_init_data
){
1822 .name
= "mali_0_div",
1823 .ops
= &clk_regmap_divider_ops
,
1824 .parent_hws
= (const struct clk_hw
*[]) {
1825 &meson8b_mali_0_sel
.hw
1828 .flags
= CLK_SET_RATE_PARENT
,
1832 static struct clk_regmap meson8b_mali_0
= {
1833 .data
= &(struct clk_regmap_gate_data
){
1834 .offset
= HHI_MALI_CLK_CNTL
,
1837 .hw
.init
= &(struct clk_init_data
){
1839 .ops
= &clk_regmap_gate_ops
,
1840 .parent_hws
= (const struct clk_hw
*[]) {
1841 &meson8b_mali_0_div
.hw
1844 .flags
= CLK_SET_RATE_GATE
| CLK_SET_RATE_PARENT
,
1848 static struct clk_regmap meson8b_mali_1_sel
= {
1849 .data
= &(struct clk_regmap_mux_data
){
1850 .offset
= HHI_MALI_CLK_CNTL
,
1853 .table
= meson8b_mali_0_1_mux_table
,
1855 .hw
.init
= &(struct clk_init_data
){
1856 .name
= "mali_1_sel",
1857 .ops
= &clk_regmap_mux_ops
,
1858 .parent_data
= meson8b_mali_0_1_parent_data
,
1859 .num_parents
= ARRAY_SIZE(meson8b_mali_0_1_parent_data
),
1861 * Don't propagate rate changes up because the only changeable
1862 * parents are mpll1 and mpll2 but we need those for audio and
1863 * RGMII (Ethernet). We don't want to change the audio or
1864 * Ethernet clocks when setting the GPU frequency.
1870 static struct clk_regmap meson8b_mali_1_div
= {
1871 .data
= &(struct clk_regmap_div_data
){
1872 .offset
= HHI_MALI_CLK_CNTL
,
1876 .hw
.init
= &(struct clk_init_data
){
1877 .name
= "mali_1_div",
1878 .ops
= &clk_regmap_divider_ops
,
1879 .parent_hws
= (const struct clk_hw
*[]) {
1880 &meson8b_mali_1_sel
.hw
1883 .flags
= CLK_SET_RATE_PARENT
,
1887 static struct clk_regmap meson8b_mali_1
= {
1888 .data
= &(struct clk_regmap_gate_data
){
1889 .offset
= HHI_MALI_CLK_CNTL
,
1892 .hw
.init
= &(struct clk_init_data
){
1894 .ops
= &clk_regmap_gate_ops
,
1895 .parent_hws
= (const struct clk_hw
*[]) {
1896 &meson8b_mali_1_div
.hw
1899 .flags
= CLK_SET_RATE_GATE
| CLK_SET_RATE_PARENT
,
1903 static struct clk_regmap meson8b_mali
= {
1904 .data
= &(struct clk_regmap_mux_data
){
1905 .offset
= HHI_MALI_CLK_CNTL
,
1909 .hw
.init
= &(struct clk_init_data
){
1911 .ops
= &clk_regmap_mux_ops
,
1912 .parent_hws
= (const struct clk_hw
*[]) {
1917 .flags
= CLK_SET_RATE_PARENT
,
1921 static const struct pll_params_table meson8m2_gp_pll_params_table
[] = {
1926 static struct clk_regmap meson8m2_gp_pll_dco
= {
1927 .data
= &(struct meson_clk_pll_data
){
1929 .reg_off
= HHI_GP_PLL_CNTL
,
1934 .reg_off
= HHI_GP_PLL_CNTL
,
1939 .reg_off
= HHI_GP_PLL_CNTL
,
1944 .reg_off
= HHI_GP_PLL_CNTL
,
1949 .reg_off
= HHI_GP_PLL_CNTL
,
1953 .table
= meson8m2_gp_pll_params_table
,
1955 .hw
.init
= &(struct clk_init_data
){
1956 .name
= "gp_pll_dco",
1957 .ops
= &meson_clk_pll_ops
,
1958 .parent_data
= &(const struct clk_parent_data
) {
1967 static struct clk_regmap meson8m2_gp_pll
= {
1968 .data
= &(struct clk_regmap_div_data
){
1969 .offset
= HHI_GP_PLL_CNTL
,
1972 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
1974 .hw
.init
= &(struct clk_init_data
){
1976 .ops
= &clk_regmap_divider_ops
,
1977 .parent_hws
= (const struct clk_hw
*[]) {
1978 &meson8m2_gp_pll_dco
.hw
1981 .flags
= CLK_SET_RATE_PARENT
,
1985 static const struct clk_hw
*meson8b_vpu_0_1_parent_hws
[] = {
1986 &meson8b_fclk_div4
.hw
,
1987 &meson8b_fclk_div3
.hw
,
1988 &meson8b_fclk_div5
.hw
,
1989 &meson8b_fclk_div7
.hw
,
1992 static const struct clk_hw
*mmeson8m2_vpu_0_1_parent_hws
[] = {
1993 &meson8b_fclk_div4
.hw
,
1994 &meson8b_fclk_div3
.hw
,
1995 &meson8b_fclk_div5
.hw
,
1996 &meson8m2_gp_pll
.hw
,
1999 static struct clk_regmap meson8b_vpu_0_sel
= {
2000 .data
= &(struct clk_regmap_mux_data
){
2001 .offset
= HHI_VPU_CLK_CNTL
,
2005 .hw
.init
= &(struct clk_init_data
){
2006 .name
= "vpu_0_sel",
2007 .ops
= &clk_regmap_mux_ops
,
2008 .parent_hws
= meson8b_vpu_0_1_parent_hws
,
2009 .num_parents
= ARRAY_SIZE(meson8b_vpu_0_1_parent_hws
),
2010 .flags
= CLK_SET_RATE_PARENT
,
2014 static struct clk_regmap meson8m2_vpu_0_sel
= {
2015 .data
= &(struct clk_regmap_mux_data
){
2016 .offset
= HHI_VPU_CLK_CNTL
,
2020 .hw
.init
= &(struct clk_init_data
){
2021 .name
= "vpu_0_sel",
2022 .ops
= &clk_regmap_mux_ops
,
2023 .parent_hws
= mmeson8m2_vpu_0_1_parent_hws
,
2024 .num_parents
= ARRAY_SIZE(mmeson8m2_vpu_0_1_parent_hws
),
2025 .flags
= CLK_SET_RATE_PARENT
,
2029 static struct clk_regmap meson8b_vpu_0_div
= {
2030 .data
= &(struct clk_regmap_div_data
){
2031 .offset
= HHI_VPU_CLK_CNTL
,
2035 .hw
.init
= &(struct clk_init_data
){
2036 .name
= "vpu_0_div",
2037 .ops
= &clk_regmap_divider_ops
,
2038 .parent_data
= &(const struct clk_parent_data
) {
2041 * meson8b and meson8m2 have different vpu_0_sels (with
2042 * different struct clk_hw). We fallback to the global
2043 * naming string mechanism so vpu_0_div picks up the
2046 .name
= "vpu_0_sel",
2050 .flags
= CLK_SET_RATE_PARENT
,
2054 static struct clk_regmap meson8b_vpu_0
= {
2055 .data
= &(struct clk_regmap_gate_data
){
2056 .offset
= HHI_VPU_CLK_CNTL
,
2059 .hw
.init
= &(struct clk_init_data
) {
2061 .ops
= &clk_regmap_gate_ops
,
2062 .parent_hws
= (const struct clk_hw
*[]) {
2063 &meson8b_vpu_0_div
.hw
2066 .flags
= CLK_SET_RATE_PARENT
,
2070 static struct clk_regmap meson8b_vpu_1_sel
= {
2071 .data
= &(struct clk_regmap_mux_data
){
2072 .offset
= HHI_VPU_CLK_CNTL
,
2076 .hw
.init
= &(struct clk_init_data
){
2077 .name
= "vpu_1_sel",
2078 .ops
= &clk_regmap_mux_ops
,
2079 .parent_hws
= meson8b_vpu_0_1_parent_hws
,
2080 .num_parents
= ARRAY_SIZE(meson8b_vpu_0_1_parent_hws
),
2081 .flags
= CLK_SET_RATE_PARENT
,
2085 static struct clk_regmap meson8m2_vpu_1_sel
= {
2086 .data
= &(struct clk_regmap_mux_data
){
2087 .offset
= HHI_VPU_CLK_CNTL
,
2091 .hw
.init
= &(struct clk_init_data
){
2092 .name
= "vpu_1_sel",
2093 .ops
= &clk_regmap_mux_ops
,
2094 .parent_hws
= mmeson8m2_vpu_0_1_parent_hws
,
2095 .num_parents
= ARRAY_SIZE(mmeson8m2_vpu_0_1_parent_hws
),
2096 .flags
= CLK_SET_RATE_PARENT
,
2100 static struct clk_regmap meson8b_vpu_1_div
= {
2101 .data
= &(struct clk_regmap_div_data
){
2102 .offset
= HHI_VPU_CLK_CNTL
,
2106 .hw
.init
= &(struct clk_init_data
){
2107 .name
= "vpu_1_div",
2108 .ops
= &clk_regmap_divider_ops
,
2109 .parent_data
= &(const struct clk_parent_data
) {
2112 * meson8b and meson8m2 have different vpu_1_sels (with
2113 * different struct clk_hw). We fallback to the global
2114 * naming string mechanism so vpu_1_div picks up the
2117 .name
= "vpu_1_sel",
2121 .flags
= CLK_SET_RATE_PARENT
,
2125 static struct clk_regmap meson8b_vpu_1
= {
2126 .data
= &(struct clk_regmap_gate_data
){
2127 .offset
= HHI_VPU_CLK_CNTL
,
2130 .hw
.init
= &(struct clk_init_data
) {
2132 .ops
= &clk_regmap_gate_ops
,
2133 .parent_hws
= (const struct clk_hw
*[]) {
2134 &meson8b_vpu_1_div
.hw
2137 .flags
= CLK_SET_RATE_PARENT
,
2141 static struct clk_regmap meson8b_vpu
= {
2142 .data
= &(struct clk_regmap_mux_data
){
2143 .offset
= HHI_VPU_CLK_CNTL
,
2147 .hw
.init
= &(struct clk_init_data
){
2149 .ops
= &clk_regmap_mux_ops
,
2150 .parent_hws
= (const struct clk_hw
*[]) {
2155 .flags
= CLK_SET_RATE_NO_REPARENT
,
2159 static const struct clk_hw
*meson8b_vdec_parent_hws
[] = {
2160 &meson8b_fclk_div4
.hw
,
2161 &meson8b_fclk_div3
.hw
,
2162 &meson8b_fclk_div5
.hw
,
2163 &meson8b_fclk_div7
.hw
,
2168 static struct clk_regmap meson8b_vdec_1_sel
= {
2169 .data
= &(struct clk_regmap_mux_data
){
2170 .offset
= HHI_VDEC_CLK_CNTL
,
2173 .flags
= CLK_MUX_ROUND_CLOSEST
,
2175 .hw
.init
= &(struct clk_init_data
){
2176 .name
= "vdec_1_sel",
2177 .ops
= &clk_regmap_mux_ops
,
2178 .parent_hws
= meson8b_vdec_parent_hws
,
2179 .num_parents
= ARRAY_SIZE(meson8b_vdec_parent_hws
),
2180 .flags
= CLK_SET_RATE_PARENT
,
2184 static struct clk_regmap meson8b_vdec_1_1_div
= {
2185 .data
= &(struct clk_regmap_div_data
){
2186 .offset
= HHI_VDEC_CLK_CNTL
,
2189 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2191 .hw
.init
= &(struct clk_init_data
){
2192 .name
= "vdec_1_1_div",
2193 .ops
= &clk_regmap_divider_ops
,
2194 .parent_hws
= (const struct clk_hw
*[]) {
2195 &meson8b_vdec_1_sel
.hw
2198 .flags
= CLK_SET_RATE_PARENT
,
2202 static struct clk_regmap meson8b_vdec_1_1
= {
2203 .data
= &(struct clk_regmap_gate_data
){
2204 .offset
= HHI_VDEC_CLK_CNTL
,
2207 .hw
.init
= &(struct clk_init_data
) {
2209 .ops
= &clk_regmap_gate_ops
,
2210 .parent_hws
= (const struct clk_hw
*[]) {
2211 &meson8b_vdec_1_1_div
.hw
2214 .flags
= CLK_SET_RATE_PARENT
,
2218 static struct clk_regmap meson8b_vdec_1_2_div
= {
2219 .data
= &(struct clk_regmap_div_data
){
2220 .offset
= HHI_VDEC3_CLK_CNTL
,
2223 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2225 .hw
.init
= &(struct clk_init_data
){
2226 .name
= "vdec_1_2_div",
2227 .ops
= &clk_regmap_divider_ops
,
2228 .parent_hws
= (const struct clk_hw
*[]) {
2229 &meson8b_vdec_1_sel
.hw
2232 .flags
= CLK_SET_RATE_PARENT
,
2236 static struct clk_regmap meson8b_vdec_1_2
= {
2237 .data
= &(struct clk_regmap_gate_data
){
2238 .offset
= HHI_VDEC3_CLK_CNTL
,
2241 .hw
.init
= &(struct clk_init_data
) {
2243 .ops
= &clk_regmap_gate_ops
,
2244 .parent_hws
= (const struct clk_hw
*[]) {
2245 &meson8b_vdec_1_2_div
.hw
2248 .flags
= CLK_SET_RATE_PARENT
,
2252 static struct clk_regmap meson8b_vdec_1
= {
2253 .data
= &(struct clk_regmap_mux_data
){
2254 .offset
= HHI_VDEC3_CLK_CNTL
,
2257 .flags
= CLK_MUX_ROUND_CLOSEST
,
2259 .hw
.init
= &(struct clk_init_data
){
2261 .ops
= &clk_regmap_mux_ops
,
2262 .parent_hws
= (const struct clk_hw
*[]) {
2263 &meson8b_vdec_1_1
.hw
,
2264 &meson8b_vdec_1_2
.hw
,
2267 .flags
= CLK_SET_RATE_PARENT
,
2271 static struct clk_regmap meson8b_vdec_hcodec_sel
= {
2272 .data
= &(struct clk_regmap_mux_data
){
2273 .offset
= HHI_VDEC_CLK_CNTL
,
2276 .flags
= CLK_MUX_ROUND_CLOSEST
,
2278 .hw
.init
= &(struct clk_init_data
){
2279 .name
= "vdec_hcodec_sel",
2280 .ops
= &clk_regmap_mux_ops
,
2281 .parent_hws
= meson8b_vdec_parent_hws
,
2282 .num_parents
= ARRAY_SIZE(meson8b_vdec_parent_hws
),
2283 .flags
= CLK_SET_RATE_PARENT
,
2287 static struct clk_regmap meson8b_vdec_hcodec_div
= {
2288 .data
= &(struct clk_regmap_div_data
){
2289 .offset
= HHI_VDEC_CLK_CNTL
,
2292 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2294 .hw
.init
= &(struct clk_init_data
){
2295 .name
= "vdec_hcodec_div",
2296 .ops
= &clk_regmap_divider_ops
,
2297 .parent_hws
= (const struct clk_hw
*[]) {
2298 &meson8b_vdec_hcodec_sel
.hw
2301 .flags
= CLK_SET_RATE_PARENT
,
2305 static struct clk_regmap meson8b_vdec_hcodec
= {
2306 .data
= &(struct clk_regmap_gate_data
){
2307 .offset
= HHI_VDEC_CLK_CNTL
,
2310 .hw
.init
= &(struct clk_init_data
) {
2311 .name
= "vdec_hcodec",
2312 .ops
= &clk_regmap_gate_ops
,
2313 .parent_hws
= (const struct clk_hw
*[]) {
2314 &meson8b_vdec_hcodec_div
.hw
2317 .flags
= CLK_SET_RATE_PARENT
,
2321 static struct clk_regmap meson8b_vdec_2_sel
= {
2322 .data
= &(struct clk_regmap_mux_data
){
2323 .offset
= HHI_VDEC2_CLK_CNTL
,
2326 .flags
= CLK_MUX_ROUND_CLOSEST
,
2328 .hw
.init
= &(struct clk_init_data
){
2329 .name
= "vdec_2_sel",
2330 .ops
= &clk_regmap_mux_ops
,
2331 .parent_hws
= meson8b_vdec_parent_hws
,
2332 .num_parents
= ARRAY_SIZE(meson8b_vdec_parent_hws
),
2333 .flags
= CLK_SET_RATE_PARENT
,
2337 static struct clk_regmap meson8b_vdec_2_div
= {
2338 .data
= &(struct clk_regmap_div_data
){
2339 .offset
= HHI_VDEC2_CLK_CNTL
,
2342 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2344 .hw
.init
= &(struct clk_init_data
){
2345 .name
= "vdec_2_div",
2346 .ops
= &clk_regmap_divider_ops
,
2347 .parent_hws
= (const struct clk_hw
*[]) {
2348 &meson8b_vdec_2_sel
.hw
2351 .flags
= CLK_SET_RATE_PARENT
,
2355 static struct clk_regmap meson8b_vdec_2
= {
2356 .data
= &(struct clk_regmap_gate_data
){
2357 .offset
= HHI_VDEC2_CLK_CNTL
,
2360 .hw
.init
= &(struct clk_init_data
) {
2362 .ops
= &clk_regmap_gate_ops
,
2363 .parent_hws
= (const struct clk_hw
*[]) {
2364 &meson8b_vdec_2_div
.hw
2367 .flags
= CLK_SET_RATE_PARENT
,
2371 static struct clk_regmap meson8b_vdec_hevc_sel
= {
2372 .data
= &(struct clk_regmap_mux_data
){
2373 .offset
= HHI_VDEC2_CLK_CNTL
,
2376 .flags
= CLK_MUX_ROUND_CLOSEST
,
2378 .hw
.init
= &(struct clk_init_data
){
2379 .name
= "vdec_hevc_sel",
2380 .ops
= &clk_regmap_mux_ops
,
2381 .parent_hws
= meson8b_vdec_parent_hws
,
2382 .num_parents
= ARRAY_SIZE(meson8b_vdec_parent_hws
),
2383 .flags
= CLK_SET_RATE_PARENT
,
2387 static struct clk_regmap meson8b_vdec_hevc_div
= {
2388 .data
= &(struct clk_regmap_div_data
){
2389 .offset
= HHI_VDEC2_CLK_CNTL
,
2392 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2394 .hw
.init
= &(struct clk_init_data
){
2395 .name
= "vdec_hevc_div",
2396 .ops
= &clk_regmap_divider_ops
,
2397 .parent_hws
= (const struct clk_hw
*[]) {
2398 &meson8b_vdec_hevc_sel
.hw
2401 .flags
= CLK_SET_RATE_PARENT
,
2405 static struct clk_regmap meson8b_vdec_hevc_en
= {
2406 .data
= &(struct clk_regmap_gate_data
){
2407 .offset
= HHI_VDEC2_CLK_CNTL
,
2410 .hw
.init
= &(struct clk_init_data
) {
2411 .name
= "vdec_hevc_en",
2412 .ops
= &clk_regmap_gate_ops
,
2413 .parent_hws
= (const struct clk_hw
*[]) {
2414 &meson8b_vdec_hevc_div
.hw
2417 .flags
= CLK_SET_RATE_PARENT
,
2421 static struct clk_regmap meson8b_vdec_hevc
= {
2422 .data
= &(struct clk_regmap_mux_data
){
2423 .offset
= HHI_VDEC2_CLK_CNTL
,
2426 .flags
= CLK_MUX_ROUND_CLOSEST
,
2428 .hw
.init
= &(struct clk_init_data
){
2429 .name
= "vdec_hevc",
2430 .ops
= &clk_regmap_mux_ops
,
2431 /* TODO: The second parent is currently unknown */
2432 .parent_hws
= (const struct clk_hw
*[]) {
2433 &meson8b_vdec_hevc_en
.hw
2436 .flags
= CLK_SET_RATE_PARENT
,
2440 /* TODO: the clock at index 0 is "DDR_PLL" which we don't support yet */
2441 static const struct clk_hw
*meson8b_cts_amclk_parent_hws
[] = {
2447 static u32 meson8b_cts_amclk_mux_table
[] = { 1, 2, 3 };
2449 static struct clk_regmap meson8b_cts_amclk_sel
= {
2450 .data
= &(struct clk_regmap_mux_data
){
2451 .offset
= HHI_AUD_CLK_CNTL
,
2454 .table
= meson8b_cts_amclk_mux_table
,
2455 .flags
= CLK_MUX_ROUND_CLOSEST
,
2457 .hw
.init
= &(struct clk_init_data
){
2458 .name
= "cts_amclk_sel",
2459 .ops
= &clk_regmap_mux_ops
,
2460 .parent_hws
= meson8b_cts_amclk_parent_hws
,
2461 .num_parents
= ARRAY_SIZE(meson8b_cts_amclk_parent_hws
),
2465 static struct clk_regmap meson8b_cts_amclk_div
= {
2466 .data
= &(struct clk_regmap_div_data
) {
2467 .offset
= HHI_AUD_CLK_CNTL
,
2470 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2472 .hw
.init
= &(struct clk_init_data
){
2473 .name
= "cts_amclk_div",
2474 .ops
= &clk_regmap_divider_ops
,
2475 .parent_hws
= (const struct clk_hw
*[]) {
2476 &meson8b_cts_amclk_sel
.hw
2479 .flags
= CLK_SET_RATE_PARENT
,
2483 static struct clk_regmap meson8b_cts_amclk
= {
2484 .data
= &(struct clk_regmap_gate_data
){
2485 .offset
= HHI_AUD_CLK_CNTL
,
2488 .hw
.init
= &(struct clk_init_data
){
2489 .name
= "cts_amclk",
2490 .ops
= &clk_regmap_gate_ops
,
2491 .parent_hws
= (const struct clk_hw
*[]) {
2492 &meson8b_cts_amclk_div
.hw
2495 .flags
= CLK_SET_RATE_PARENT
,
2499 /* TODO: the clock at index 0 is "DDR_PLL" which we don't support yet */
2500 static const struct clk_hw
*meson8b_cts_mclk_i958_parent_hws
[] = {
2506 static u32 meson8b_cts_mclk_i958_mux_table
[] = { 1, 2, 3 };
2508 static struct clk_regmap meson8b_cts_mclk_i958_sel
= {
2509 .data
= &(struct clk_regmap_mux_data
){
2510 .offset
= HHI_AUD_CLK_CNTL2
,
2513 .table
= meson8b_cts_mclk_i958_mux_table
,
2514 .flags
= CLK_MUX_ROUND_CLOSEST
,
2516 .hw
.init
= &(struct clk_init_data
) {
2517 .name
= "cts_mclk_i958_sel",
2518 .ops
= &clk_regmap_mux_ops
,
2519 .parent_hws
= meson8b_cts_mclk_i958_parent_hws
,
2520 .num_parents
= ARRAY_SIZE(meson8b_cts_mclk_i958_parent_hws
),
2524 static struct clk_regmap meson8b_cts_mclk_i958_div
= {
2525 .data
= &(struct clk_regmap_div_data
){
2526 .offset
= HHI_AUD_CLK_CNTL2
,
2529 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2531 .hw
.init
= &(struct clk_init_data
) {
2532 .name
= "cts_mclk_i958_div",
2533 .ops
= &clk_regmap_divider_ops
,
2534 .parent_hws
= (const struct clk_hw
*[]) {
2535 &meson8b_cts_mclk_i958_sel
.hw
2538 .flags
= CLK_SET_RATE_PARENT
,
2542 static struct clk_regmap meson8b_cts_mclk_i958
= {
2543 .data
= &(struct clk_regmap_gate_data
){
2544 .offset
= HHI_AUD_CLK_CNTL2
,
2547 .hw
.init
= &(struct clk_init_data
){
2548 .name
= "cts_mclk_i958",
2549 .ops
= &clk_regmap_gate_ops
,
2550 .parent_hws
= (const struct clk_hw
*[]) {
2551 &meson8b_cts_mclk_i958_div
.hw
2554 .flags
= CLK_SET_RATE_PARENT
,
2558 static struct clk_regmap meson8b_cts_i958
= {
2559 .data
= &(struct clk_regmap_mux_data
){
2560 .offset
= HHI_AUD_CLK_CNTL2
,
2564 .hw
.init
= &(struct clk_init_data
){
2566 .ops
= &clk_regmap_mux_ops
,
2567 .parent_hws
= (const struct clk_hw
*[]) {
2568 &meson8b_cts_amclk
.hw
,
2569 &meson8b_cts_mclk_i958
.hw
2573 * The parent is specific to origin of the audio data. Let the
2574 * consumer choose the appropriate parent.
2576 .flags
= CLK_SET_RATE_PARENT
| CLK_SET_RATE_NO_REPARENT
,
2580 #define MESON_GATE(_name, _reg, _bit) \
2581 MESON_PCLK(_name, _reg, _bit, &meson8b_clk81.hw)
2583 /* Everything Else (EE) domain gates */
2585 static MESON_GATE(meson8b_ddr
, HHI_GCLK_MPEG0
, 0);
2586 static MESON_GATE(meson8b_dos
, HHI_GCLK_MPEG0
, 1);
2587 static MESON_GATE(meson8b_isa
, HHI_GCLK_MPEG0
, 5);
2588 static MESON_GATE(meson8b_pl301
, HHI_GCLK_MPEG0
, 6);
2589 static MESON_GATE(meson8b_periphs
, HHI_GCLK_MPEG0
, 7);
2590 static MESON_GATE(meson8b_spicc
, HHI_GCLK_MPEG0
, 8);
2591 static MESON_GATE(meson8b_i2c
, HHI_GCLK_MPEG0
, 9);
2592 static MESON_GATE(meson8b_sar_adc
, HHI_GCLK_MPEG0
, 10);
2593 static MESON_GATE(meson8b_smart_card
, HHI_GCLK_MPEG0
, 11);
2594 static MESON_GATE(meson8b_rng0
, HHI_GCLK_MPEG0
, 12);
2595 static MESON_GATE(meson8b_uart0
, HHI_GCLK_MPEG0
, 13);
2596 static MESON_GATE(meson8b_sdhc
, HHI_GCLK_MPEG0
, 14);
2597 static MESON_GATE(meson8b_stream
, HHI_GCLK_MPEG0
, 15);
2598 static MESON_GATE(meson8b_async_fifo
, HHI_GCLK_MPEG0
, 16);
2599 static MESON_GATE(meson8b_sdio
, HHI_GCLK_MPEG0
, 17);
2600 static MESON_GATE(meson8b_abuf
, HHI_GCLK_MPEG0
, 18);
2601 static MESON_GATE(meson8b_hiu_iface
, HHI_GCLK_MPEG0
, 19);
2602 static MESON_GATE(meson8b_assist_misc
, HHI_GCLK_MPEG0
, 23);
2603 static MESON_GATE(meson8b_spi
, HHI_GCLK_MPEG0
, 30);
2605 static MESON_GATE(meson8b_i2s_spdif
, HHI_GCLK_MPEG1
, 2);
2606 static MESON_GATE(meson8b_eth
, HHI_GCLK_MPEG1
, 3);
2607 static MESON_GATE(meson8b_demux
, HHI_GCLK_MPEG1
, 4);
2608 static MESON_GATE(meson8b_blkmv
, HHI_GCLK_MPEG1
, 14);
2609 static MESON_GATE(meson8b_aiu
, HHI_GCLK_MPEG1
, 15);
2610 static MESON_GATE(meson8b_uart1
, HHI_GCLK_MPEG1
, 16);
2611 static MESON_GATE(meson8b_g2d
, HHI_GCLK_MPEG1
, 20);
2612 static MESON_GATE(meson8b_usb0
, HHI_GCLK_MPEG1
, 21);
2613 static MESON_GATE(meson8b_usb1
, HHI_GCLK_MPEG1
, 22);
2614 static MESON_GATE(meson8b_reset
, HHI_GCLK_MPEG1
, 23);
2615 static MESON_GATE(meson8b_nand
, HHI_GCLK_MPEG1
, 24);
2616 static MESON_GATE(meson8b_dos_parser
, HHI_GCLK_MPEG1
, 25);
2617 static MESON_GATE(meson8b_usb
, HHI_GCLK_MPEG1
, 26);
2618 static MESON_GATE(meson8b_vdin1
, HHI_GCLK_MPEG1
, 28);
2619 static MESON_GATE(meson8b_ahb_arb0
, HHI_GCLK_MPEG1
, 29);
2620 static MESON_GATE(meson8b_efuse
, HHI_GCLK_MPEG1
, 30);
2621 static MESON_GATE(meson8b_boot_rom
, HHI_GCLK_MPEG1
, 31);
2623 static MESON_GATE(meson8b_ahb_data_bus
, HHI_GCLK_MPEG2
, 1);
2624 static MESON_GATE(meson8b_ahb_ctrl_bus
, HHI_GCLK_MPEG2
, 2);
2625 static MESON_GATE(meson8b_hdmi_intr_sync
, HHI_GCLK_MPEG2
, 3);
2626 static MESON_GATE(meson8b_hdmi_pclk
, HHI_GCLK_MPEG2
, 4);
2627 static MESON_GATE(meson8b_usb1_ddr_bridge
, HHI_GCLK_MPEG2
, 8);
2628 static MESON_GATE(meson8b_usb0_ddr_bridge
, HHI_GCLK_MPEG2
, 9);
2629 static MESON_GATE(meson8b_mmc_pclk
, HHI_GCLK_MPEG2
, 11);
2630 static MESON_GATE(meson8b_dvin
, HHI_GCLK_MPEG2
, 12);
2631 static MESON_GATE(meson8b_uart2
, HHI_GCLK_MPEG2
, 15);
2632 static MESON_GATE(meson8b_sana
, HHI_GCLK_MPEG2
, 22);
2633 static MESON_GATE(meson8b_vpu_intr
, HHI_GCLK_MPEG2
, 25);
2634 static MESON_GATE(meson8b_sec_ahb_ahb3_bridge
, HHI_GCLK_MPEG2
, 26);
2635 static MESON_GATE(meson8b_clk81_a9
, HHI_GCLK_MPEG2
, 29);
2637 static MESON_GATE(meson8b_vclk2_venci0
, HHI_GCLK_OTHER
, 1);
2638 static MESON_GATE(meson8b_vclk2_venci1
, HHI_GCLK_OTHER
, 2);
2639 static MESON_GATE(meson8b_vclk2_vencp0
, HHI_GCLK_OTHER
, 3);
2640 static MESON_GATE(meson8b_vclk2_vencp1
, HHI_GCLK_OTHER
, 4);
2641 static MESON_GATE(meson8b_gclk_venci_int
, HHI_GCLK_OTHER
, 8);
2642 static MESON_GATE(meson8b_gclk_vencp_int
, HHI_GCLK_OTHER
, 9);
2643 static MESON_GATE(meson8b_dac_clk
, HHI_GCLK_OTHER
, 10);
2644 static MESON_GATE(meson8b_aoclk_gate
, HHI_GCLK_OTHER
, 14);
2645 static MESON_GATE(meson8b_iec958_gate
, HHI_GCLK_OTHER
, 16);
2646 static MESON_GATE(meson8b_enc480p
, HHI_GCLK_OTHER
, 20);
2647 static MESON_GATE(meson8b_rng1
, HHI_GCLK_OTHER
, 21);
2648 static MESON_GATE(meson8b_gclk_vencl_int
, HHI_GCLK_OTHER
, 22);
2649 static MESON_GATE(meson8b_vclk2_venclmcc
, HHI_GCLK_OTHER
, 24);
2650 static MESON_GATE(meson8b_vclk2_vencl
, HHI_GCLK_OTHER
, 25);
2651 static MESON_GATE(meson8b_vclk2_other
, HHI_GCLK_OTHER
, 26);
2652 static MESON_GATE(meson8b_edp
, HHI_GCLK_OTHER
, 31);
2655 #define MESON_AIU_GLUE_GATE(_name, _reg, _bit) \
2656 MESON_PCLK(_name, _reg, _bit, &meson8b_aiu_glue.hw)
2658 static MESON_PCLK(meson8b_aiu_glue
, HHI_GCLK_MPEG1
, 6, &meson8b_aiu
.hw
);
2659 static MESON_AIU_GLUE_GATE(meson8b_iec958
, HHI_GCLK_MPEG1
, 7);
2660 static MESON_AIU_GLUE_GATE(meson8b_i2s_out
, HHI_GCLK_MPEG1
, 8);
2661 static MESON_AIU_GLUE_GATE(meson8b_amclk
, HHI_GCLK_MPEG1
, 9);
2662 static MESON_AIU_GLUE_GATE(meson8b_aififo2
, HHI_GCLK_MPEG1
, 10);
2663 static MESON_AIU_GLUE_GATE(meson8b_mixer
, HHI_GCLK_MPEG1
, 11);
2664 static MESON_AIU_GLUE_GATE(meson8b_mixer_iface
, HHI_GCLK_MPEG1
, 12);
2665 static MESON_AIU_GLUE_GATE(meson8b_adc
, HHI_GCLK_MPEG1
, 13);
2667 /* Always On (AO) domain gates */
2669 static MESON_GATE(meson8b_ao_media_cpu
, HHI_GCLK_AO
, 0);
2670 static MESON_GATE(meson8b_ao_ahb_sram
, HHI_GCLK_AO
, 1);
2671 static MESON_GATE(meson8b_ao_ahb_bus
, HHI_GCLK_AO
, 2);
2672 static MESON_GATE(meson8b_ao_iface
, HHI_GCLK_AO
, 3);
2674 static struct clk_hw_onecell_data meson8_hw_onecell_data
= {
2676 [CLKID_XTAL
] = &meson8b_xtal
.hw
,
2677 [CLKID_PLL_FIXED
] = &meson8b_fixed_pll
.hw
,
2678 [CLKID_PLL_VID
] = &meson8b_vid_pll
.hw
,
2679 [CLKID_PLL_SYS
] = &meson8b_sys_pll
.hw
,
2680 [CLKID_FCLK_DIV2
] = &meson8b_fclk_div2
.hw
,
2681 [CLKID_FCLK_DIV3
] = &meson8b_fclk_div3
.hw
,
2682 [CLKID_FCLK_DIV4
] = &meson8b_fclk_div4
.hw
,
2683 [CLKID_FCLK_DIV5
] = &meson8b_fclk_div5
.hw
,
2684 [CLKID_FCLK_DIV7
] = &meson8b_fclk_div7
.hw
,
2685 [CLKID_CPUCLK
] = &meson8b_cpu_clk
.hw
,
2686 [CLKID_MPEG_SEL
] = &meson8b_mpeg_clk_sel
.hw
,
2687 [CLKID_MPEG_DIV
] = &meson8b_mpeg_clk_div
.hw
,
2688 [CLKID_CLK81
] = &meson8b_clk81
.hw
,
2689 [CLKID_DDR
] = &meson8b_ddr
.hw
,
2690 [CLKID_DOS
] = &meson8b_dos
.hw
,
2691 [CLKID_ISA
] = &meson8b_isa
.hw
,
2692 [CLKID_PL301
] = &meson8b_pl301
.hw
,
2693 [CLKID_PERIPHS
] = &meson8b_periphs
.hw
,
2694 [CLKID_SPICC
] = &meson8b_spicc
.hw
,
2695 [CLKID_I2C
] = &meson8b_i2c
.hw
,
2696 [CLKID_SAR_ADC
] = &meson8b_sar_adc
.hw
,
2697 [CLKID_SMART_CARD
] = &meson8b_smart_card
.hw
,
2698 [CLKID_RNG0
] = &meson8b_rng0
.hw
,
2699 [CLKID_UART0
] = &meson8b_uart0
.hw
,
2700 [CLKID_SDHC
] = &meson8b_sdhc
.hw
,
2701 [CLKID_STREAM
] = &meson8b_stream
.hw
,
2702 [CLKID_ASYNC_FIFO
] = &meson8b_async_fifo
.hw
,
2703 [CLKID_SDIO
] = &meson8b_sdio
.hw
,
2704 [CLKID_ABUF
] = &meson8b_abuf
.hw
,
2705 [CLKID_HIU_IFACE
] = &meson8b_hiu_iface
.hw
,
2706 [CLKID_ASSIST_MISC
] = &meson8b_assist_misc
.hw
,
2707 [CLKID_SPI
] = &meson8b_spi
.hw
,
2708 [CLKID_I2S_SPDIF
] = &meson8b_i2s_spdif
.hw
,
2709 [CLKID_ETH
] = &meson8b_eth
.hw
,
2710 [CLKID_DEMUX
] = &meson8b_demux
.hw
,
2711 [CLKID_AIU_GLUE
] = &meson8b_aiu_glue
.hw
,
2712 [CLKID_IEC958
] = &meson8b_iec958
.hw
,
2713 [CLKID_I2S_OUT
] = &meson8b_i2s_out
.hw
,
2714 [CLKID_AMCLK
] = &meson8b_amclk
.hw
,
2715 [CLKID_AIFIFO2
] = &meson8b_aififo2
.hw
,
2716 [CLKID_MIXER
] = &meson8b_mixer
.hw
,
2717 [CLKID_MIXER_IFACE
] = &meson8b_mixer_iface
.hw
,
2718 [CLKID_ADC
] = &meson8b_adc
.hw
,
2719 [CLKID_BLKMV
] = &meson8b_blkmv
.hw
,
2720 [CLKID_AIU
] = &meson8b_aiu
.hw
,
2721 [CLKID_UART1
] = &meson8b_uart1
.hw
,
2722 [CLKID_G2D
] = &meson8b_g2d
.hw
,
2723 [CLKID_USB0
] = &meson8b_usb0
.hw
,
2724 [CLKID_USB1
] = &meson8b_usb1
.hw
,
2725 [CLKID_RESET
] = &meson8b_reset
.hw
,
2726 [CLKID_NAND
] = &meson8b_nand
.hw
,
2727 [CLKID_DOS_PARSER
] = &meson8b_dos_parser
.hw
,
2728 [CLKID_USB
] = &meson8b_usb
.hw
,
2729 [CLKID_VDIN1
] = &meson8b_vdin1
.hw
,
2730 [CLKID_AHB_ARB0
] = &meson8b_ahb_arb0
.hw
,
2731 [CLKID_EFUSE
] = &meson8b_efuse
.hw
,
2732 [CLKID_BOOT_ROM
] = &meson8b_boot_rom
.hw
,
2733 [CLKID_AHB_DATA_BUS
] = &meson8b_ahb_data_bus
.hw
,
2734 [CLKID_AHB_CTRL_BUS
] = &meson8b_ahb_ctrl_bus
.hw
,
2735 [CLKID_HDMI_INTR_SYNC
] = &meson8b_hdmi_intr_sync
.hw
,
2736 [CLKID_HDMI_PCLK
] = &meson8b_hdmi_pclk
.hw
,
2737 [CLKID_USB1_DDR_BRIDGE
] = &meson8b_usb1_ddr_bridge
.hw
,
2738 [CLKID_USB0_DDR_BRIDGE
] = &meson8b_usb0_ddr_bridge
.hw
,
2739 [CLKID_MMC_PCLK
] = &meson8b_mmc_pclk
.hw
,
2740 [CLKID_DVIN
] = &meson8b_dvin
.hw
,
2741 [CLKID_UART2
] = &meson8b_uart2
.hw
,
2742 [CLKID_SANA
] = &meson8b_sana
.hw
,
2743 [CLKID_VPU_INTR
] = &meson8b_vpu_intr
.hw
,
2744 [CLKID_SEC_AHB_AHB3_BRIDGE
] = &meson8b_sec_ahb_ahb3_bridge
.hw
,
2745 [CLKID_CLK81_A9
] = &meson8b_clk81_a9
.hw
,
2746 [CLKID_VCLK2_VENCI0
] = &meson8b_vclk2_venci0
.hw
,
2747 [CLKID_VCLK2_VENCI1
] = &meson8b_vclk2_venci1
.hw
,
2748 [CLKID_VCLK2_VENCP0
] = &meson8b_vclk2_vencp0
.hw
,
2749 [CLKID_VCLK2_VENCP1
] = &meson8b_vclk2_vencp1
.hw
,
2750 [CLKID_GCLK_VENCI_INT
] = &meson8b_gclk_venci_int
.hw
,
2751 [CLKID_GCLK_VENCP_INT
] = &meson8b_gclk_vencp_int
.hw
,
2752 [CLKID_DAC_CLK
] = &meson8b_dac_clk
.hw
,
2753 [CLKID_AOCLK_GATE
] = &meson8b_aoclk_gate
.hw
,
2754 [CLKID_IEC958_GATE
] = &meson8b_iec958_gate
.hw
,
2755 [CLKID_ENC480P
] = &meson8b_enc480p
.hw
,
2756 [CLKID_RNG1
] = &meson8b_rng1
.hw
,
2757 [CLKID_GCLK_VENCL_INT
] = &meson8b_gclk_vencl_int
.hw
,
2758 [CLKID_VCLK2_VENCLMCC
] = &meson8b_vclk2_venclmcc
.hw
,
2759 [CLKID_VCLK2_VENCL
] = &meson8b_vclk2_vencl
.hw
,
2760 [CLKID_VCLK2_OTHER
] = &meson8b_vclk2_other
.hw
,
2761 [CLKID_EDP
] = &meson8b_edp
.hw
,
2762 [CLKID_AO_MEDIA_CPU
] = &meson8b_ao_media_cpu
.hw
,
2763 [CLKID_AO_AHB_SRAM
] = &meson8b_ao_ahb_sram
.hw
,
2764 [CLKID_AO_AHB_BUS
] = &meson8b_ao_ahb_bus
.hw
,
2765 [CLKID_AO_IFACE
] = &meson8b_ao_iface
.hw
,
2766 [CLKID_MPLL0
] = &meson8b_mpll0
.hw
,
2767 [CLKID_MPLL1
] = &meson8b_mpll1
.hw
,
2768 [CLKID_MPLL2
] = &meson8b_mpll2
.hw
,
2769 [CLKID_MPLL0_DIV
] = &meson8b_mpll0_div
.hw
,
2770 [CLKID_MPLL1_DIV
] = &meson8b_mpll1_div
.hw
,
2771 [CLKID_MPLL2_DIV
] = &meson8b_mpll2_div
.hw
,
2772 [CLKID_CPU_IN_SEL
] = &meson8b_cpu_in_sel
.hw
,
2773 [CLKID_CPU_IN_DIV2
] = &meson8b_cpu_in_div2
.hw
,
2774 [CLKID_CPU_IN_DIV3
] = &meson8b_cpu_in_div3
.hw
,
2775 [CLKID_CPU_SCALE_DIV
] = &meson8b_cpu_scale_div
.hw
,
2776 [CLKID_CPU_SCALE_OUT_SEL
] = &meson8b_cpu_scale_out_sel
.hw
,
2777 [CLKID_MPLL_PREDIV
] = &meson8b_mpll_prediv
.hw
,
2778 [CLKID_FCLK_DIV2_DIV
] = &meson8b_fclk_div2_div
.hw
,
2779 [CLKID_FCLK_DIV3_DIV
] = &meson8b_fclk_div3_div
.hw
,
2780 [CLKID_FCLK_DIV4_DIV
] = &meson8b_fclk_div4_div
.hw
,
2781 [CLKID_FCLK_DIV5_DIV
] = &meson8b_fclk_div5_div
.hw
,
2782 [CLKID_FCLK_DIV7_DIV
] = &meson8b_fclk_div7_div
.hw
,
2783 [CLKID_NAND_SEL
] = &meson8b_nand_clk_sel
.hw
,
2784 [CLKID_NAND_DIV
] = &meson8b_nand_clk_div
.hw
,
2785 [CLKID_NAND_CLK
] = &meson8b_nand_clk_gate
.hw
,
2786 [CLKID_PLL_FIXED_DCO
] = &meson8b_fixed_pll_dco
.hw
,
2787 [CLKID_HDMI_PLL_DCO
] = &meson8b_hdmi_pll_dco
.hw
,
2788 [CLKID_PLL_SYS_DCO
] = &meson8b_sys_pll_dco
.hw
,
2789 [CLKID_CPU_CLK_DIV2
] = &meson8b_cpu_clk_div2
.hw
,
2790 [CLKID_CPU_CLK_DIV3
] = &meson8b_cpu_clk_div3
.hw
,
2791 [CLKID_CPU_CLK_DIV4
] = &meson8b_cpu_clk_div4
.hw
,
2792 [CLKID_CPU_CLK_DIV5
] = &meson8b_cpu_clk_div5
.hw
,
2793 [CLKID_CPU_CLK_DIV6
] = &meson8b_cpu_clk_div6
.hw
,
2794 [CLKID_CPU_CLK_DIV7
] = &meson8b_cpu_clk_div7
.hw
,
2795 [CLKID_CPU_CLK_DIV8
] = &meson8b_cpu_clk_div8
.hw
,
2796 [CLKID_APB_SEL
] = &meson8b_apb_clk_sel
.hw
,
2797 [CLKID_APB
] = &meson8b_apb_clk_gate
.hw
,
2798 [CLKID_PERIPH_SEL
] = &meson8b_periph_clk_sel
.hw
,
2799 [CLKID_PERIPH
] = &meson8b_periph_clk_gate
.hw
,
2800 [CLKID_AXI_SEL
] = &meson8b_axi_clk_sel
.hw
,
2801 [CLKID_AXI
] = &meson8b_axi_clk_gate
.hw
,
2802 [CLKID_L2_DRAM_SEL
] = &meson8b_l2_dram_clk_sel
.hw
,
2803 [CLKID_L2_DRAM
] = &meson8b_l2_dram_clk_gate
.hw
,
2804 [CLKID_HDMI_PLL_LVDS_OUT
] = &meson8b_hdmi_pll_lvds_out
.hw
,
2805 [CLKID_HDMI_PLL_HDMI_OUT
] = &meson8b_hdmi_pll_hdmi_out
.hw
,
2806 [CLKID_VID_PLL_IN_SEL
] = &meson8b_vid_pll_in_sel
.hw
,
2807 [CLKID_VID_PLL_IN_EN
] = &meson8b_vid_pll_in_en
.hw
,
2808 [CLKID_VID_PLL_PRE_DIV
] = &meson8b_vid_pll_pre_div
.hw
,
2809 [CLKID_VID_PLL_POST_DIV
] = &meson8b_vid_pll_post_div
.hw
,
2810 [CLKID_VID_PLL_FINAL_DIV
] = &meson8b_vid_pll_final_div
.hw
,
2811 [CLKID_VCLK_IN_SEL
] = &meson8b_vclk_in_sel
.hw
,
2812 [CLKID_VCLK_IN_EN
] = &meson8b_vclk_in_en
.hw
,
2813 [CLKID_VCLK_DIV1
] = &meson8b_vclk_div1_gate
.hw
,
2814 [CLKID_VCLK_DIV2_DIV
] = &meson8b_vclk_div2_div
.hw
,
2815 [CLKID_VCLK_DIV2
] = &meson8b_vclk_div2_div_gate
.hw
,
2816 [CLKID_VCLK_DIV4_DIV
] = &meson8b_vclk_div4_div
.hw
,
2817 [CLKID_VCLK_DIV4
] = &meson8b_vclk_div4_div_gate
.hw
,
2818 [CLKID_VCLK_DIV6_DIV
] = &meson8b_vclk_div6_div
.hw
,
2819 [CLKID_VCLK_DIV6
] = &meson8b_vclk_div6_div_gate
.hw
,
2820 [CLKID_VCLK_DIV12_DIV
] = &meson8b_vclk_div12_div
.hw
,
2821 [CLKID_VCLK_DIV12
] = &meson8b_vclk_div12_div_gate
.hw
,
2822 [CLKID_VCLK2_IN_SEL
] = &meson8b_vclk2_in_sel
.hw
,
2823 [CLKID_VCLK2_IN_EN
] = &meson8b_vclk2_clk_in_en
.hw
,
2824 [CLKID_VCLK2_DIV1
] = &meson8b_vclk2_div1_gate
.hw
,
2825 [CLKID_VCLK2_DIV2_DIV
] = &meson8b_vclk2_div2_div
.hw
,
2826 [CLKID_VCLK2_DIV2
] = &meson8b_vclk2_div2_div_gate
.hw
,
2827 [CLKID_VCLK2_DIV4_DIV
] = &meson8b_vclk2_div4_div
.hw
,
2828 [CLKID_VCLK2_DIV4
] = &meson8b_vclk2_div4_div_gate
.hw
,
2829 [CLKID_VCLK2_DIV6_DIV
] = &meson8b_vclk2_div6_div
.hw
,
2830 [CLKID_VCLK2_DIV6
] = &meson8b_vclk2_div6_div_gate
.hw
,
2831 [CLKID_VCLK2_DIV12_DIV
] = &meson8b_vclk2_div12_div
.hw
,
2832 [CLKID_VCLK2_DIV12
] = &meson8b_vclk2_div12_div_gate
.hw
,
2833 [CLKID_CTS_ENCT_SEL
] = &meson8b_cts_enct_sel
.hw
,
2834 [CLKID_CTS_ENCT
] = &meson8b_cts_enct
.hw
,
2835 [CLKID_CTS_ENCP_SEL
] = &meson8b_cts_encp_sel
.hw
,
2836 [CLKID_CTS_ENCP
] = &meson8b_cts_encp
.hw
,
2837 [CLKID_CTS_ENCI_SEL
] = &meson8b_cts_enci_sel
.hw
,
2838 [CLKID_CTS_ENCI
] = &meson8b_cts_enci
.hw
,
2839 [CLKID_HDMI_TX_PIXEL_SEL
] = &meson8b_hdmi_tx_pixel_sel
.hw
,
2840 [CLKID_HDMI_TX_PIXEL
] = &meson8b_hdmi_tx_pixel
.hw
,
2841 [CLKID_CTS_ENCL_SEL
] = &meson8b_cts_encl_sel
.hw
,
2842 [CLKID_CTS_ENCL
] = &meson8b_cts_encl
.hw
,
2843 [CLKID_CTS_VDAC0_SEL
] = &meson8b_cts_vdac0_sel
.hw
,
2844 [CLKID_CTS_VDAC0
] = &meson8b_cts_vdac0
.hw
,
2845 [CLKID_HDMI_SYS_SEL
] = &meson8b_hdmi_sys_sel
.hw
,
2846 [CLKID_HDMI_SYS_DIV
] = &meson8b_hdmi_sys_div
.hw
,
2847 [CLKID_HDMI_SYS
] = &meson8b_hdmi_sys
.hw
,
2848 [CLKID_MALI_0_SEL
] = &meson8b_mali_0_sel
.hw
,
2849 [CLKID_MALI_0_DIV
] = &meson8b_mali_0_div
.hw
,
2850 [CLKID_MALI
] = &meson8b_mali_0
.hw
,
2851 [CLKID_VPU_0_SEL
] = &meson8b_vpu_0_sel
.hw
,
2852 [CLKID_VPU_0_DIV
] = &meson8b_vpu_0_div
.hw
,
2853 [CLKID_VPU
] = &meson8b_vpu_0
.hw
,
2854 [CLKID_VDEC_1_SEL
] = &meson8b_vdec_1_sel
.hw
,
2855 [CLKID_VDEC_1_1_DIV
] = &meson8b_vdec_1_1_div
.hw
,
2856 [CLKID_VDEC_1
] = &meson8b_vdec_1_1
.hw
,
2857 [CLKID_VDEC_HCODEC_SEL
] = &meson8b_vdec_hcodec_sel
.hw
,
2858 [CLKID_VDEC_HCODEC_DIV
] = &meson8b_vdec_hcodec_div
.hw
,
2859 [CLKID_VDEC_HCODEC
] = &meson8b_vdec_hcodec
.hw
,
2860 [CLKID_VDEC_2_SEL
] = &meson8b_vdec_2_sel
.hw
,
2861 [CLKID_VDEC_2_DIV
] = &meson8b_vdec_2_div
.hw
,
2862 [CLKID_VDEC_2
] = &meson8b_vdec_2
.hw
,
2863 [CLKID_VDEC_HEVC_SEL
] = &meson8b_vdec_hevc_sel
.hw
,
2864 [CLKID_VDEC_HEVC_DIV
] = &meson8b_vdec_hevc_div
.hw
,
2865 [CLKID_VDEC_HEVC_EN
] = &meson8b_vdec_hevc_en
.hw
,
2866 [CLKID_VDEC_HEVC
] = &meson8b_vdec_hevc
.hw
,
2867 [CLKID_CTS_AMCLK_SEL
] = &meson8b_cts_amclk_sel
.hw
,
2868 [CLKID_CTS_AMCLK_DIV
] = &meson8b_cts_amclk_div
.hw
,
2869 [CLKID_CTS_AMCLK
] = &meson8b_cts_amclk
.hw
,
2870 [CLKID_CTS_MCLK_I958_SEL
] = &meson8b_cts_mclk_i958_sel
.hw
,
2871 [CLKID_CTS_MCLK_I958_DIV
] = &meson8b_cts_mclk_i958_div
.hw
,
2872 [CLKID_CTS_MCLK_I958
] = &meson8b_cts_mclk_i958
.hw
,
2873 [CLKID_CTS_I958
] = &meson8b_cts_i958
.hw
,
2874 [CLK_NR_CLKS
] = NULL
,
2879 static struct clk_hw_onecell_data meson8b_hw_onecell_data
= {
2881 [CLKID_XTAL
] = &meson8b_xtal
.hw
,
2882 [CLKID_PLL_FIXED
] = &meson8b_fixed_pll
.hw
,
2883 [CLKID_PLL_VID
] = &meson8b_vid_pll
.hw
,
2884 [CLKID_PLL_SYS
] = &meson8b_sys_pll
.hw
,
2885 [CLKID_FCLK_DIV2
] = &meson8b_fclk_div2
.hw
,
2886 [CLKID_FCLK_DIV3
] = &meson8b_fclk_div3
.hw
,
2887 [CLKID_FCLK_DIV4
] = &meson8b_fclk_div4
.hw
,
2888 [CLKID_FCLK_DIV5
] = &meson8b_fclk_div5
.hw
,
2889 [CLKID_FCLK_DIV7
] = &meson8b_fclk_div7
.hw
,
2890 [CLKID_CPUCLK
] = &meson8b_cpu_clk
.hw
,
2891 [CLKID_MPEG_SEL
] = &meson8b_mpeg_clk_sel
.hw
,
2892 [CLKID_MPEG_DIV
] = &meson8b_mpeg_clk_div
.hw
,
2893 [CLKID_CLK81
] = &meson8b_clk81
.hw
,
2894 [CLKID_DDR
] = &meson8b_ddr
.hw
,
2895 [CLKID_DOS
] = &meson8b_dos
.hw
,
2896 [CLKID_ISA
] = &meson8b_isa
.hw
,
2897 [CLKID_PL301
] = &meson8b_pl301
.hw
,
2898 [CLKID_PERIPHS
] = &meson8b_periphs
.hw
,
2899 [CLKID_SPICC
] = &meson8b_spicc
.hw
,
2900 [CLKID_I2C
] = &meson8b_i2c
.hw
,
2901 [CLKID_SAR_ADC
] = &meson8b_sar_adc
.hw
,
2902 [CLKID_SMART_CARD
] = &meson8b_smart_card
.hw
,
2903 [CLKID_RNG0
] = &meson8b_rng0
.hw
,
2904 [CLKID_UART0
] = &meson8b_uart0
.hw
,
2905 [CLKID_SDHC
] = &meson8b_sdhc
.hw
,
2906 [CLKID_STREAM
] = &meson8b_stream
.hw
,
2907 [CLKID_ASYNC_FIFO
] = &meson8b_async_fifo
.hw
,
2908 [CLKID_SDIO
] = &meson8b_sdio
.hw
,
2909 [CLKID_ABUF
] = &meson8b_abuf
.hw
,
2910 [CLKID_HIU_IFACE
] = &meson8b_hiu_iface
.hw
,
2911 [CLKID_ASSIST_MISC
] = &meson8b_assist_misc
.hw
,
2912 [CLKID_SPI
] = &meson8b_spi
.hw
,
2913 [CLKID_I2S_SPDIF
] = &meson8b_i2s_spdif
.hw
,
2914 [CLKID_ETH
] = &meson8b_eth
.hw
,
2915 [CLKID_DEMUX
] = &meson8b_demux
.hw
,
2916 [CLKID_AIU_GLUE
] = &meson8b_aiu_glue
.hw
,
2917 [CLKID_IEC958
] = &meson8b_iec958
.hw
,
2918 [CLKID_I2S_OUT
] = &meson8b_i2s_out
.hw
,
2919 [CLKID_AMCLK
] = &meson8b_amclk
.hw
,
2920 [CLKID_AIFIFO2
] = &meson8b_aififo2
.hw
,
2921 [CLKID_MIXER
] = &meson8b_mixer
.hw
,
2922 [CLKID_MIXER_IFACE
] = &meson8b_mixer_iface
.hw
,
2923 [CLKID_ADC
] = &meson8b_adc
.hw
,
2924 [CLKID_BLKMV
] = &meson8b_blkmv
.hw
,
2925 [CLKID_AIU
] = &meson8b_aiu
.hw
,
2926 [CLKID_UART1
] = &meson8b_uart1
.hw
,
2927 [CLKID_G2D
] = &meson8b_g2d
.hw
,
2928 [CLKID_USB0
] = &meson8b_usb0
.hw
,
2929 [CLKID_USB1
] = &meson8b_usb1
.hw
,
2930 [CLKID_RESET
] = &meson8b_reset
.hw
,
2931 [CLKID_NAND
] = &meson8b_nand
.hw
,
2932 [CLKID_DOS_PARSER
] = &meson8b_dos_parser
.hw
,
2933 [CLKID_USB
] = &meson8b_usb
.hw
,
2934 [CLKID_VDIN1
] = &meson8b_vdin1
.hw
,
2935 [CLKID_AHB_ARB0
] = &meson8b_ahb_arb0
.hw
,
2936 [CLKID_EFUSE
] = &meson8b_efuse
.hw
,
2937 [CLKID_BOOT_ROM
] = &meson8b_boot_rom
.hw
,
2938 [CLKID_AHB_DATA_BUS
] = &meson8b_ahb_data_bus
.hw
,
2939 [CLKID_AHB_CTRL_BUS
] = &meson8b_ahb_ctrl_bus
.hw
,
2940 [CLKID_HDMI_INTR_SYNC
] = &meson8b_hdmi_intr_sync
.hw
,
2941 [CLKID_HDMI_PCLK
] = &meson8b_hdmi_pclk
.hw
,
2942 [CLKID_USB1_DDR_BRIDGE
] = &meson8b_usb1_ddr_bridge
.hw
,
2943 [CLKID_USB0_DDR_BRIDGE
] = &meson8b_usb0_ddr_bridge
.hw
,
2944 [CLKID_MMC_PCLK
] = &meson8b_mmc_pclk
.hw
,
2945 [CLKID_DVIN
] = &meson8b_dvin
.hw
,
2946 [CLKID_UART2
] = &meson8b_uart2
.hw
,
2947 [CLKID_SANA
] = &meson8b_sana
.hw
,
2948 [CLKID_VPU_INTR
] = &meson8b_vpu_intr
.hw
,
2949 [CLKID_SEC_AHB_AHB3_BRIDGE
] = &meson8b_sec_ahb_ahb3_bridge
.hw
,
2950 [CLKID_CLK81_A9
] = &meson8b_clk81_a9
.hw
,
2951 [CLKID_VCLK2_VENCI0
] = &meson8b_vclk2_venci0
.hw
,
2952 [CLKID_VCLK2_VENCI1
] = &meson8b_vclk2_venci1
.hw
,
2953 [CLKID_VCLK2_VENCP0
] = &meson8b_vclk2_vencp0
.hw
,
2954 [CLKID_VCLK2_VENCP1
] = &meson8b_vclk2_vencp1
.hw
,
2955 [CLKID_GCLK_VENCI_INT
] = &meson8b_gclk_venci_int
.hw
,
2956 [CLKID_GCLK_VENCP_INT
] = &meson8b_gclk_vencp_int
.hw
,
2957 [CLKID_DAC_CLK
] = &meson8b_dac_clk
.hw
,
2958 [CLKID_AOCLK_GATE
] = &meson8b_aoclk_gate
.hw
,
2959 [CLKID_IEC958_GATE
] = &meson8b_iec958_gate
.hw
,
2960 [CLKID_ENC480P
] = &meson8b_enc480p
.hw
,
2961 [CLKID_RNG1
] = &meson8b_rng1
.hw
,
2962 [CLKID_GCLK_VENCL_INT
] = &meson8b_gclk_vencl_int
.hw
,
2963 [CLKID_VCLK2_VENCLMCC
] = &meson8b_vclk2_venclmcc
.hw
,
2964 [CLKID_VCLK2_VENCL
] = &meson8b_vclk2_vencl
.hw
,
2965 [CLKID_VCLK2_OTHER
] = &meson8b_vclk2_other
.hw
,
2966 [CLKID_EDP
] = &meson8b_edp
.hw
,
2967 [CLKID_AO_MEDIA_CPU
] = &meson8b_ao_media_cpu
.hw
,
2968 [CLKID_AO_AHB_SRAM
] = &meson8b_ao_ahb_sram
.hw
,
2969 [CLKID_AO_AHB_BUS
] = &meson8b_ao_ahb_bus
.hw
,
2970 [CLKID_AO_IFACE
] = &meson8b_ao_iface
.hw
,
2971 [CLKID_MPLL0
] = &meson8b_mpll0
.hw
,
2972 [CLKID_MPLL1
] = &meson8b_mpll1
.hw
,
2973 [CLKID_MPLL2
] = &meson8b_mpll2
.hw
,
2974 [CLKID_MPLL0_DIV
] = &meson8b_mpll0_div
.hw
,
2975 [CLKID_MPLL1_DIV
] = &meson8b_mpll1_div
.hw
,
2976 [CLKID_MPLL2_DIV
] = &meson8b_mpll2_div
.hw
,
2977 [CLKID_CPU_IN_SEL
] = &meson8b_cpu_in_sel
.hw
,
2978 [CLKID_CPU_IN_DIV2
] = &meson8b_cpu_in_div2
.hw
,
2979 [CLKID_CPU_IN_DIV3
] = &meson8b_cpu_in_div3
.hw
,
2980 [CLKID_CPU_SCALE_DIV
] = &meson8b_cpu_scale_div
.hw
,
2981 [CLKID_CPU_SCALE_OUT_SEL
] = &meson8b_cpu_scale_out_sel
.hw
,
2982 [CLKID_MPLL_PREDIV
] = &meson8b_mpll_prediv
.hw
,
2983 [CLKID_FCLK_DIV2_DIV
] = &meson8b_fclk_div2_div
.hw
,
2984 [CLKID_FCLK_DIV3_DIV
] = &meson8b_fclk_div3_div
.hw
,
2985 [CLKID_FCLK_DIV4_DIV
] = &meson8b_fclk_div4_div
.hw
,
2986 [CLKID_FCLK_DIV5_DIV
] = &meson8b_fclk_div5_div
.hw
,
2987 [CLKID_FCLK_DIV7_DIV
] = &meson8b_fclk_div7_div
.hw
,
2988 [CLKID_NAND_SEL
] = &meson8b_nand_clk_sel
.hw
,
2989 [CLKID_NAND_DIV
] = &meson8b_nand_clk_div
.hw
,
2990 [CLKID_NAND_CLK
] = &meson8b_nand_clk_gate
.hw
,
2991 [CLKID_PLL_FIXED_DCO
] = &meson8b_fixed_pll_dco
.hw
,
2992 [CLKID_HDMI_PLL_DCO
] = &meson8b_hdmi_pll_dco
.hw
,
2993 [CLKID_PLL_SYS_DCO
] = &meson8b_sys_pll_dco
.hw
,
2994 [CLKID_CPU_CLK_DIV2
] = &meson8b_cpu_clk_div2
.hw
,
2995 [CLKID_CPU_CLK_DIV3
] = &meson8b_cpu_clk_div3
.hw
,
2996 [CLKID_CPU_CLK_DIV4
] = &meson8b_cpu_clk_div4
.hw
,
2997 [CLKID_CPU_CLK_DIV5
] = &meson8b_cpu_clk_div5
.hw
,
2998 [CLKID_CPU_CLK_DIV6
] = &meson8b_cpu_clk_div6
.hw
,
2999 [CLKID_CPU_CLK_DIV7
] = &meson8b_cpu_clk_div7
.hw
,
3000 [CLKID_CPU_CLK_DIV8
] = &meson8b_cpu_clk_div8
.hw
,
3001 [CLKID_APB_SEL
] = &meson8b_apb_clk_sel
.hw
,
3002 [CLKID_APB
] = &meson8b_apb_clk_gate
.hw
,
3003 [CLKID_PERIPH_SEL
] = &meson8b_periph_clk_sel
.hw
,
3004 [CLKID_PERIPH
] = &meson8b_periph_clk_gate
.hw
,
3005 [CLKID_AXI_SEL
] = &meson8b_axi_clk_sel
.hw
,
3006 [CLKID_AXI
] = &meson8b_axi_clk_gate
.hw
,
3007 [CLKID_L2_DRAM_SEL
] = &meson8b_l2_dram_clk_sel
.hw
,
3008 [CLKID_L2_DRAM
] = &meson8b_l2_dram_clk_gate
.hw
,
3009 [CLKID_HDMI_PLL_LVDS_OUT
] = &meson8b_hdmi_pll_lvds_out
.hw
,
3010 [CLKID_HDMI_PLL_HDMI_OUT
] = &meson8b_hdmi_pll_hdmi_out
.hw
,
3011 [CLKID_VID_PLL_IN_SEL
] = &meson8b_vid_pll_in_sel
.hw
,
3012 [CLKID_VID_PLL_IN_EN
] = &meson8b_vid_pll_in_en
.hw
,
3013 [CLKID_VID_PLL_PRE_DIV
] = &meson8b_vid_pll_pre_div
.hw
,
3014 [CLKID_VID_PLL_POST_DIV
] = &meson8b_vid_pll_post_div
.hw
,
3015 [CLKID_VID_PLL_FINAL_DIV
] = &meson8b_vid_pll_final_div
.hw
,
3016 [CLKID_VCLK_IN_SEL
] = &meson8b_vclk_in_sel
.hw
,
3017 [CLKID_VCLK_IN_EN
] = &meson8b_vclk_in_en
.hw
,
3018 [CLKID_VCLK_DIV1
] = &meson8b_vclk_div1_gate
.hw
,
3019 [CLKID_VCLK_DIV2_DIV
] = &meson8b_vclk_div2_div
.hw
,
3020 [CLKID_VCLK_DIV2
] = &meson8b_vclk_div2_div_gate
.hw
,
3021 [CLKID_VCLK_DIV4_DIV
] = &meson8b_vclk_div4_div
.hw
,
3022 [CLKID_VCLK_DIV4
] = &meson8b_vclk_div4_div_gate
.hw
,
3023 [CLKID_VCLK_DIV6_DIV
] = &meson8b_vclk_div6_div
.hw
,
3024 [CLKID_VCLK_DIV6
] = &meson8b_vclk_div6_div_gate
.hw
,
3025 [CLKID_VCLK_DIV12_DIV
] = &meson8b_vclk_div12_div
.hw
,
3026 [CLKID_VCLK_DIV12
] = &meson8b_vclk_div12_div_gate
.hw
,
3027 [CLKID_VCLK2_IN_SEL
] = &meson8b_vclk2_in_sel
.hw
,
3028 [CLKID_VCLK2_IN_EN
] = &meson8b_vclk2_clk_in_en
.hw
,
3029 [CLKID_VCLK2_DIV1
] = &meson8b_vclk2_div1_gate
.hw
,
3030 [CLKID_VCLK2_DIV2_DIV
] = &meson8b_vclk2_div2_div
.hw
,
3031 [CLKID_VCLK2_DIV2
] = &meson8b_vclk2_div2_div_gate
.hw
,
3032 [CLKID_VCLK2_DIV4_DIV
] = &meson8b_vclk2_div4_div
.hw
,
3033 [CLKID_VCLK2_DIV4
] = &meson8b_vclk2_div4_div_gate
.hw
,
3034 [CLKID_VCLK2_DIV6_DIV
] = &meson8b_vclk2_div6_div
.hw
,
3035 [CLKID_VCLK2_DIV6
] = &meson8b_vclk2_div6_div_gate
.hw
,
3036 [CLKID_VCLK2_DIV12_DIV
] = &meson8b_vclk2_div12_div
.hw
,
3037 [CLKID_VCLK2_DIV12
] = &meson8b_vclk2_div12_div_gate
.hw
,
3038 [CLKID_CTS_ENCT_SEL
] = &meson8b_cts_enct_sel
.hw
,
3039 [CLKID_CTS_ENCT
] = &meson8b_cts_enct
.hw
,
3040 [CLKID_CTS_ENCP_SEL
] = &meson8b_cts_encp_sel
.hw
,
3041 [CLKID_CTS_ENCP
] = &meson8b_cts_encp
.hw
,
3042 [CLKID_CTS_ENCI_SEL
] = &meson8b_cts_enci_sel
.hw
,
3043 [CLKID_CTS_ENCI
] = &meson8b_cts_enci
.hw
,
3044 [CLKID_HDMI_TX_PIXEL_SEL
] = &meson8b_hdmi_tx_pixel_sel
.hw
,
3045 [CLKID_HDMI_TX_PIXEL
] = &meson8b_hdmi_tx_pixel
.hw
,
3046 [CLKID_CTS_ENCL_SEL
] = &meson8b_cts_encl_sel
.hw
,
3047 [CLKID_CTS_ENCL
] = &meson8b_cts_encl
.hw
,
3048 [CLKID_CTS_VDAC0_SEL
] = &meson8b_cts_vdac0_sel
.hw
,
3049 [CLKID_CTS_VDAC0
] = &meson8b_cts_vdac0
.hw
,
3050 [CLKID_HDMI_SYS_SEL
] = &meson8b_hdmi_sys_sel
.hw
,
3051 [CLKID_HDMI_SYS_DIV
] = &meson8b_hdmi_sys_div
.hw
,
3052 [CLKID_HDMI_SYS
] = &meson8b_hdmi_sys
.hw
,
3053 [CLKID_MALI_0_SEL
] = &meson8b_mali_0_sel
.hw
,
3054 [CLKID_MALI_0_DIV
] = &meson8b_mali_0_div
.hw
,
3055 [CLKID_MALI_0
] = &meson8b_mali_0
.hw
,
3056 [CLKID_MALI_1_SEL
] = &meson8b_mali_1_sel
.hw
,
3057 [CLKID_MALI_1_DIV
] = &meson8b_mali_1_div
.hw
,
3058 [CLKID_MALI_1
] = &meson8b_mali_1
.hw
,
3059 [CLKID_MALI
] = &meson8b_mali
.hw
,
3060 [CLKID_VPU_0_SEL
] = &meson8b_vpu_0_sel
.hw
,
3061 [CLKID_VPU_0_DIV
] = &meson8b_vpu_0_div
.hw
,
3062 [CLKID_VPU_0
] = &meson8b_vpu_0
.hw
,
3063 [CLKID_VPU_1_SEL
] = &meson8b_vpu_1_sel
.hw
,
3064 [CLKID_VPU_1_DIV
] = &meson8b_vpu_1_div
.hw
,
3065 [CLKID_VPU_1
] = &meson8b_vpu_1
.hw
,
3066 [CLKID_VPU
] = &meson8b_vpu
.hw
,
3067 [CLKID_VDEC_1_SEL
] = &meson8b_vdec_1_sel
.hw
,
3068 [CLKID_VDEC_1_1_DIV
] = &meson8b_vdec_1_1_div
.hw
,
3069 [CLKID_VDEC_1_1
] = &meson8b_vdec_1_1
.hw
,
3070 [CLKID_VDEC_1_2_DIV
] = &meson8b_vdec_1_2_div
.hw
,
3071 [CLKID_VDEC_1_2
] = &meson8b_vdec_1_2
.hw
,
3072 [CLKID_VDEC_1
] = &meson8b_vdec_1
.hw
,
3073 [CLKID_VDEC_HCODEC_SEL
] = &meson8b_vdec_hcodec_sel
.hw
,
3074 [CLKID_VDEC_HCODEC_DIV
] = &meson8b_vdec_hcodec_div
.hw
,
3075 [CLKID_VDEC_HCODEC
] = &meson8b_vdec_hcodec
.hw
,
3076 [CLKID_VDEC_2_SEL
] = &meson8b_vdec_2_sel
.hw
,
3077 [CLKID_VDEC_2_DIV
] = &meson8b_vdec_2_div
.hw
,
3078 [CLKID_VDEC_2
] = &meson8b_vdec_2
.hw
,
3079 [CLKID_VDEC_HEVC_SEL
] = &meson8b_vdec_hevc_sel
.hw
,
3080 [CLKID_VDEC_HEVC_DIV
] = &meson8b_vdec_hevc_div
.hw
,
3081 [CLKID_VDEC_HEVC_EN
] = &meson8b_vdec_hevc_en
.hw
,
3082 [CLKID_VDEC_HEVC
] = &meson8b_vdec_hevc
.hw
,
3083 [CLKID_CTS_AMCLK_SEL
] = &meson8b_cts_amclk_sel
.hw
,
3084 [CLKID_CTS_AMCLK_DIV
] = &meson8b_cts_amclk_div
.hw
,
3085 [CLKID_CTS_AMCLK
] = &meson8b_cts_amclk
.hw
,
3086 [CLKID_CTS_MCLK_I958_SEL
] = &meson8b_cts_mclk_i958_sel
.hw
,
3087 [CLKID_CTS_MCLK_I958_DIV
] = &meson8b_cts_mclk_i958_div
.hw
,
3088 [CLKID_CTS_MCLK_I958
] = &meson8b_cts_mclk_i958
.hw
,
3089 [CLKID_CTS_I958
] = &meson8b_cts_i958
.hw
,
3090 [CLK_NR_CLKS
] = NULL
,
3095 static struct clk_hw_onecell_data meson8m2_hw_onecell_data
= {
3097 [CLKID_XTAL
] = &meson8b_xtal
.hw
,
3098 [CLKID_PLL_FIXED
] = &meson8b_fixed_pll
.hw
,
3099 [CLKID_PLL_VID
] = &meson8b_vid_pll
.hw
,
3100 [CLKID_PLL_SYS
] = &meson8b_sys_pll
.hw
,
3101 [CLKID_FCLK_DIV2
] = &meson8b_fclk_div2
.hw
,
3102 [CLKID_FCLK_DIV3
] = &meson8b_fclk_div3
.hw
,
3103 [CLKID_FCLK_DIV4
] = &meson8b_fclk_div4
.hw
,
3104 [CLKID_FCLK_DIV5
] = &meson8b_fclk_div5
.hw
,
3105 [CLKID_FCLK_DIV7
] = &meson8b_fclk_div7
.hw
,
3106 [CLKID_CPUCLK
] = &meson8b_cpu_clk
.hw
,
3107 [CLKID_MPEG_SEL
] = &meson8b_mpeg_clk_sel
.hw
,
3108 [CLKID_MPEG_DIV
] = &meson8b_mpeg_clk_div
.hw
,
3109 [CLKID_CLK81
] = &meson8b_clk81
.hw
,
3110 [CLKID_DDR
] = &meson8b_ddr
.hw
,
3111 [CLKID_DOS
] = &meson8b_dos
.hw
,
3112 [CLKID_ISA
] = &meson8b_isa
.hw
,
3113 [CLKID_PL301
] = &meson8b_pl301
.hw
,
3114 [CLKID_PERIPHS
] = &meson8b_periphs
.hw
,
3115 [CLKID_SPICC
] = &meson8b_spicc
.hw
,
3116 [CLKID_I2C
] = &meson8b_i2c
.hw
,
3117 [CLKID_SAR_ADC
] = &meson8b_sar_adc
.hw
,
3118 [CLKID_SMART_CARD
] = &meson8b_smart_card
.hw
,
3119 [CLKID_RNG0
] = &meson8b_rng0
.hw
,
3120 [CLKID_UART0
] = &meson8b_uart0
.hw
,
3121 [CLKID_SDHC
] = &meson8b_sdhc
.hw
,
3122 [CLKID_STREAM
] = &meson8b_stream
.hw
,
3123 [CLKID_ASYNC_FIFO
] = &meson8b_async_fifo
.hw
,
3124 [CLKID_SDIO
] = &meson8b_sdio
.hw
,
3125 [CLKID_ABUF
] = &meson8b_abuf
.hw
,
3126 [CLKID_HIU_IFACE
] = &meson8b_hiu_iface
.hw
,
3127 [CLKID_ASSIST_MISC
] = &meson8b_assist_misc
.hw
,
3128 [CLKID_SPI
] = &meson8b_spi
.hw
,
3129 [CLKID_I2S_SPDIF
] = &meson8b_i2s_spdif
.hw
,
3130 [CLKID_ETH
] = &meson8b_eth
.hw
,
3131 [CLKID_DEMUX
] = &meson8b_demux
.hw
,
3132 [CLKID_AIU_GLUE
] = &meson8b_aiu_glue
.hw
,
3133 [CLKID_IEC958
] = &meson8b_iec958
.hw
,
3134 [CLKID_I2S_OUT
] = &meson8b_i2s_out
.hw
,
3135 [CLKID_AMCLK
] = &meson8b_amclk
.hw
,
3136 [CLKID_AIFIFO2
] = &meson8b_aififo2
.hw
,
3137 [CLKID_MIXER
] = &meson8b_mixer
.hw
,
3138 [CLKID_MIXER_IFACE
] = &meson8b_mixer_iface
.hw
,
3139 [CLKID_ADC
] = &meson8b_adc
.hw
,
3140 [CLKID_BLKMV
] = &meson8b_blkmv
.hw
,
3141 [CLKID_AIU
] = &meson8b_aiu
.hw
,
3142 [CLKID_UART1
] = &meson8b_uart1
.hw
,
3143 [CLKID_G2D
] = &meson8b_g2d
.hw
,
3144 [CLKID_USB0
] = &meson8b_usb0
.hw
,
3145 [CLKID_USB1
] = &meson8b_usb1
.hw
,
3146 [CLKID_RESET
] = &meson8b_reset
.hw
,
3147 [CLKID_NAND
] = &meson8b_nand
.hw
,
3148 [CLKID_DOS_PARSER
] = &meson8b_dos_parser
.hw
,
3149 [CLKID_USB
] = &meson8b_usb
.hw
,
3150 [CLKID_VDIN1
] = &meson8b_vdin1
.hw
,
3151 [CLKID_AHB_ARB0
] = &meson8b_ahb_arb0
.hw
,
3152 [CLKID_EFUSE
] = &meson8b_efuse
.hw
,
3153 [CLKID_BOOT_ROM
] = &meson8b_boot_rom
.hw
,
3154 [CLKID_AHB_DATA_BUS
] = &meson8b_ahb_data_bus
.hw
,
3155 [CLKID_AHB_CTRL_BUS
] = &meson8b_ahb_ctrl_bus
.hw
,
3156 [CLKID_HDMI_INTR_SYNC
] = &meson8b_hdmi_intr_sync
.hw
,
3157 [CLKID_HDMI_PCLK
] = &meson8b_hdmi_pclk
.hw
,
3158 [CLKID_USB1_DDR_BRIDGE
] = &meson8b_usb1_ddr_bridge
.hw
,
3159 [CLKID_USB0_DDR_BRIDGE
] = &meson8b_usb0_ddr_bridge
.hw
,
3160 [CLKID_MMC_PCLK
] = &meson8b_mmc_pclk
.hw
,
3161 [CLKID_DVIN
] = &meson8b_dvin
.hw
,
3162 [CLKID_UART2
] = &meson8b_uart2
.hw
,
3163 [CLKID_SANA
] = &meson8b_sana
.hw
,
3164 [CLKID_VPU_INTR
] = &meson8b_vpu_intr
.hw
,
3165 [CLKID_SEC_AHB_AHB3_BRIDGE
] = &meson8b_sec_ahb_ahb3_bridge
.hw
,
3166 [CLKID_CLK81_A9
] = &meson8b_clk81_a9
.hw
,
3167 [CLKID_VCLK2_VENCI0
] = &meson8b_vclk2_venci0
.hw
,
3168 [CLKID_VCLK2_VENCI1
] = &meson8b_vclk2_venci1
.hw
,
3169 [CLKID_VCLK2_VENCP0
] = &meson8b_vclk2_vencp0
.hw
,
3170 [CLKID_VCLK2_VENCP1
] = &meson8b_vclk2_vencp1
.hw
,
3171 [CLKID_GCLK_VENCI_INT
] = &meson8b_gclk_venci_int
.hw
,
3172 [CLKID_GCLK_VENCP_INT
] = &meson8b_gclk_vencp_int
.hw
,
3173 [CLKID_DAC_CLK
] = &meson8b_dac_clk
.hw
,
3174 [CLKID_AOCLK_GATE
] = &meson8b_aoclk_gate
.hw
,
3175 [CLKID_IEC958_GATE
] = &meson8b_iec958_gate
.hw
,
3176 [CLKID_ENC480P
] = &meson8b_enc480p
.hw
,
3177 [CLKID_RNG1
] = &meson8b_rng1
.hw
,
3178 [CLKID_GCLK_VENCL_INT
] = &meson8b_gclk_vencl_int
.hw
,
3179 [CLKID_VCLK2_VENCLMCC
] = &meson8b_vclk2_venclmcc
.hw
,
3180 [CLKID_VCLK2_VENCL
] = &meson8b_vclk2_vencl
.hw
,
3181 [CLKID_VCLK2_OTHER
] = &meson8b_vclk2_other
.hw
,
3182 [CLKID_EDP
] = &meson8b_edp
.hw
,
3183 [CLKID_AO_MEDIA_CPU
] = &meson8b_ao_media_cpu
.hw
,
3184 [CLKID_AO_AHB_SRAM
] = &meson8b_ao_ahb_sram
.hw
,
3185 [CLKID_AO_AHB_BUS
] = &meson8b_ao_ahb_bus
.hw
,
3186 [CLKID_AO_IFACE
] = &meson8b_ao_iface
.hw
,
3187 [CLKID_MPLL0
] = &meson8b_mpll0
.hw
,
3188 [CLKID_MPLL1
] = &meson8b_mpll1
.hw
,
3189 [CLKID_MPLL2
] = &meson8b_mpll2
.hw
,
3190 [CLKID_MPLL0_DIV
] = &meson8b_mpll0_div
.hw
,
3191 [CLKID_MPLL1_DIV
] = &meson8b_mpll1_div
.hw
,
3192 [CLKID_MPLL2_DIV
] = &meson8b_mpll2_div
.hw
,
3193 [CLKID_CPU_IN_SEL
] = &meson8b_cpu_in_sel
.hw
,
3194 [CLKID_CPU_IN_DIV2
] = &meson8b_cpu_in_div2
.hw
,
3195 [CLKID_CPU_IN_DIV3
] = &meson8b_cpu_in_div3
.hw
,
3196 [CLKID_CPU_SCALE_DIV
] = &meson8b_cpu_scale_div
.hw
,
3197 [CLKID_CPU_SCALE_OUT_SEL
] = &meson8b_cpu_scale_out_sel
.hw
,
3198 [CLKID_MPLL_PREDIV
] = &meson8b_mpll_prediv
.hw
,
3199 [CLKID_FCLK_DIV2_DIV
] = &meson8b_fclk_div2_div
.hw
,
3200 [CLKID_FCLK_DIV3_DIV
] = &meson8b_fclk_div3_div
.hw
,
3201 [CLKID_FCLK_DIV4_DIV
] = &meson8b_fclk_div4_div
.hw
,
3202 [CLKID_FCLK_DIV5_DIV
] = &meson8b_fclk_div5_div
.hw
,
3203 [CLKID_FCLK_DIV7_DIV
] = &meson8b_fclk_div7_div
.hw
,
3204 [CLKID_NAND_SEL
] = &meson8b_nand_clk_sel
.hw
,
3205 [CLKID_NAND_DIV
] = &meson8b_nand_clk_div
.hw
,
3206 [CLKID_NAND_CLK
] = &meson8b_nand_clk_gate
.hw
,
3207 [CLKID_PLL_FIXED_DCO
] = &meson8b_fixed_pll_dco
.hw
,
3208 [CLKID_HDMI_PLL_DCO
] = &meson8b_hdmi_pll_dco
.hw
,
3209 [CLKID_PLL_SYS_DCO
] = &meson8b_sys_pll_dco
.hw
,
3210 [CLKID_CPU_CLK_DIV2
] = &meson8b_cpu_clk_div2
.hw
,
3211 [CLKID_CPU_CLK_DIV3
] = &meson8b_cpu_clk_div3
.hw
,
3212 [CLKID_CPU_CLK_DIV4
] = &meson8b_cpu_clk_div4
.hw
,
3213 [CLKID_CPU_CLK_DIV5
] = &meson8b_cpu_clk_div5
.hw
,
3214 [CLKID_CPU_CLK_DIV6
] = &meson8b_cpu_clk_div6
.hw
,
3215 [CLKID_CPU_CLK_DIV7
] = &meson8b_cpu_clk_div7
.hw
,
3216 [CLKID_CPU_CLK_DIV8
] = &meson8b_cpu_clk_div8
.hw
,
3217 [CLKID_APB_SEL
] = &meson8b_apb_clk_sel
.hw
,
3218 [CLKID_APB
] = &meson8b_apb_clk_gate
.hw
,
3219 [CLKID_PERIPH_SEL
] = &meson8b_periph_clk_sel
.hw
,
3220 [CLKID_PERIPH
] = &meson8b_periph_clk_gate
.hw
,
3221 [CLKID_AXI_SEL
] = &meson8b_axi_clk_sel
.hw
,
3222 [CLKID_AXI
] = &meson8b_axi_clk_gate
.hw
,
3223 [CLKID_L2_DRAM_SEL
] = &meson8b_l2_dram_clk_sel
.hw
,
3224 [CLKID_L2_DRAM
] = &meson8b_l2_dram_clk_gate
.hw
,
3225 [CLKID_HDMI_PLL_LVDS_OUT
] = &meson8b_hdmi_pll_lvds_out
.hw
,
3226 [CLKID_HDMI_PLL_HDMI_OUT
] = &meson8b_hdmi_pll_hdmi_out
.hw
,
3227 [CLKID_VID_PLL_IN_SEL
] = &meson8b_vid_pll_in_sel
.hw
,
3228 [CLKID_VID_PLL_IN_EN
] = &meson8b_vid_pll_in_en
.hw
,
3229 [CLKID_VID_PLL_PRE_DIV
] = &meson8b_vid_pll_pre_div
.hw
,
3230 [CLKID_VID_PLL_POST_DIV
] = &meson8b_vid_pll_post_div
.hw
,
3231 [CLKID_VID_PLL_FINAL_DIV
] = &meson8b_vid_pll_final_div
.hw
,
3232 [CLKID_VCLK_IN_SEL
] = &meson8b_vclk_in_sel
.hw
,
3233 [CLKID_VCLK_IN_EN
] = &meson8b_vclk_in_en
.hw
,
3234 [CLKID_VCLK_DIV1
] = &meson8b_vclk_div1_gate
.hw
,
3235 [CLKID_VCLK_DIV2_DIV
] = &meson8b_vclk_div2_div
.hw
,
3236 [CLKID_VCLK_DIV2
] = &meson8b_vclk_div2_div_gate
.hw
,
3237 [CLKID_VCLK_DIV4_DIV
] = &meson8b_vclk_div4_div
.hw
,
3238 [CLKID_VCLK_DIV4
] = &meson8b_vclk_div4_div_gate
.hw
,
3239 [CLKID_VCLK_DIV6_DIV
] = &meson8b_vclk_div6_div
.hw
,
3240 [CLKID_VCLK_DIV6
] = &meson8b_vclk_div6_div_gate
.hw
,
3241 [CLKID_VCLK_DIV12_DIV
] = &meson8b_vclk_div12_div
.hw
,
3242 [CLKID_VCLK_DIV12
] = &meson8b_vclk_div12_div_gate
.hw
,
3243 [CLKID_VCLK2_IN_SEL
] = &meson8b_vclk2_in_sel
.hw
,
3244 [CLKID_VCLK2_IN_EN
] = &meson8b_vclk2_clk_in_en
.hw
,
3245 [CLKID_VCLK2_DIV1
] = &meson8b_vclk2_div1_gate
.hw
,
3246 [CLKID_VCLK2_DIV2_DIV
] = &meson8b_vclk2_div2_div
.hw
,
3247 [CLKID_VCLK2_DIV2
] = &meson8b_vclk2_div2_div_gate
.hw
,
3248 [CLKID_VCLK2_DIV4_DIV
] = &meson8b_vclk2_div4_div
.hw
,
3249 [CLKID_VCLK2_DIV4
] = &meson8b_vclk2_div4_div_gate
.hw
,
3250 [CLKID_VCLK2_DIV6_DIV
] = &meson8b_vclk2_div6_div
.hw
,
3251 [CLKID_VCLK2_DIV6
] = &meson8b_vclk2_div6_div_gate
.hw
,
3252 [CLKID_VCLK2_DIV12_DIV
] = &meson8b_vclk2_div12_div
.hw
,
3253 [CLKID_VCLK2_DIV12
] = &meson8b_vclk2_div12_div_gate
.hw
,
3254 [CLKID_CTS_ENCT_SEL
] = &meson8b_cts_enct_sel
.hw
,
3255 [CLKID_CTS_ENCT
] = &meson8b_cts_enct
.hw
,
3256 [CLKID_CTS_ENCP_SEL
] = &meson8b_cts_encp_sel
.hw
,
3257 [CLKID_CTS_ENCP
] = &meson8b_cts_encp
.hw
,
3258 [CLKID_CTS_ENCI_SEL
] = &meson8b_cts_enci_sel
.hw
,
3259 [CLKID_CTS_ENCI
] = &meson8b_cts_enci
.hw
,
3260 [CLKID_HDMI_TX_PIXEL_SEL
] = &meson8b_hdmi_tx_pixel_sel
.hw
,
3261 [CLKID_HDMI_TX_PIXEL
] = &meson8b_hdmi_tx_pixel
.hw
,
3262 [CLKID_CTS_ENCL_SEL
] = &meson8b_cts_encl_sel
.hw
,
3263 [CLKID_CTS_ENCL
] = &meson8b_cts_encl
.hw
,
3264 [CLKID_CTS_VDAC0_SEL
] = &meson8b_cts_vdac0_sel
.hw
,
3265 [CLKID_CTS_VDAC0
] = &meson8b_cts_vdac0
.hw
,
3266 [CLKID_HDMI_SYS_SEL
] = &meson8b_hdmi_sys_sel
.hw
,
3267 [CLKID_HDMI_SYS_DIV
] = &meson8b_hdmi_sys_div
.hw
,
3268 [CLKID_HDMI_SYS
] = &meson8b_hdmi_sys
.hw
,
3269 [CLKID_MALI_0_SEL
] = &meson8b_mali_0_sel
.hw
,
3270 [CLKID_MALI_0_DIV
] = &meson8b_mali_0_div
.hw
,
3271 [CLKID_MALI_0
] = &meson8b_mali_0
.hw
,
3272 [CLKID_MALI_1_SEL
] = &meson8b_mali_1_sel
.hw
,
3273 [CLKID_MALI_1_DIV
] = &meson8b_mali_1_div
.hw
,
3274 [CLKID_MALI_1
] = &meson8b_mali_1
.hw
,
3275 [CLKID_MALI
] = &meson8b_mali
.hw
,
3276 [CLKID_GP_PLL_DCO
] = &meson8m2_gp_pll_dco
.hw
,
3277 [CLKID_GP_PLL
] = &meson8m2_gp_pll
.hw
,
3278 [CLKID_VPU_0_SEL
] = &meson8m2_vpu_0_sel
.hw
,
3279 [CLKID_VPU_0_DIV
] = &meson8b_vpu_0_div
.hw
,
3280 [CLKID_VPU_0
] = &meson8b_vpu_0
.hw
,
3281 [CLKID_VPU_1_SEL
] = &meson8m2_vpu_1_sel
.hw
,
3282 [CLKID_VPU_1_DIV
] = &meson8b_vpu_1_div
.hw
,
3283 [CLKID_VPU_1
] = &meson8b_vpu_1
.hw
,
3284 [CLKID_VPU
] = &meson8b_vpu
.hw
,
3285 [CLKID_VDEC_1_SEL
] = &meson8b_vdec_1_sel
.hw
,
3286 [CLKID_VDEC_1_1_DIV
] = &meson8b_vdec_1_1_div
.hw
,
3287 [CLKID_VDEC_1_1
] = &meson8b_vdec_1_1
.hw
,
3288 [CLKID_VDEC_1_2_DIV
] = &meson8b_vdec_1_2_div
.hw
,
3289 [CLKID_VDEC_1_2
] = &meson8b_vdec_1_2
.hw
,
3290 [CLKID_VDEC_1
] = &meson8b_vdec_1
.hw
,
3291 [CLKID_VDEC_HCODEC_SEL
] = &meson8b_vdec_hcodec_sel
.hw
,
3292 [CLKID_VDEC_HCODEC_DIV
] = &meson8b_vdec_hcodec_div
.hw
,
3293 [CLKID_VDEC_HCODEC
] = &meson8b_vdec_hcodec
.hw
,
3294 [CLKID_VDEC_2_SEL
] = &meson8b_vdec_2_sel
.hw
,
3295 [CLKID_VDEC_2_DIV
] = &meson8b_vdec_2_div
.hw
,
3296 [CLKID_VDEC_2
] = &meson8b_vdec_2
.hw
,
3297 [CLKID_VDEC_HEVC_SEL
] = &meson8b_vdec_hevc_sel
.hw
,
3298 [CLKID_VDEC_HEVC_DIV
] = &meson8b_vdec_hevc_div
.hw
,
3299 [CLKID_VDEC_HEVC_EN
] = &meson8b_vdec_hevc_en
.hw
,
3300 [CLKID_VDEC_HEVC
] = &meson8b_vdec_hevc
.hw
,
3301 [CLKID_CTS_AMCLK_SEL
] = &meson8b_cts_amclk_sel
.hw
,
3302 [CLKID_CTS_AMCLK_DIV
] = &meson8b_cts_amclk_div
.hw
,
3303 [CLKID_CTS_AMCLK
] = &meson8b_cts_amclk
.hw
,
3304 [CLKID_CTS_MCLK_I958_SEL
] = &meson8b_cts_mclk_i958_sel
.hw
,
3305 [CLKID_CTS_MCLK_I958_DIV
] = &meson8b_cts_mclk_i958_div
.hw
,
3306 [CLKID_CTS_MCLK_I958
] = &meson8b_cts_mclk_i958
.hw
,
3307 [CLKID_CTS_I958
] = &meson8b_cts_i958
.hw
,
3308 [CLK_NR_CLKS
] = NULL
,
3313 static struct clk_regmap
*const meson8b_clk_regmaps
[] = {
3323 &meson8b_smart_card
,
3328 &meson8b_async_fifo
,
3332 &meson8b_assist_misc
,
3343 &meson8b_mixer_iface
,
3353 &meson8b_dos_parser
,
3359 &meson8b_ahb_data_bus
,
3360 &meson8b_ahb_ctrl_bus
,
3361 &meson8b_hdmi_intr_sync
,
3363 &meson8b_usb1_ddr_bridge
,
3364 &meson8b_usb0_ddr_bridge
,
3370 &meson8b_sec_ahb_ahb3_bridge
,
3372 &meson8b_vclk2_venci0
,
3373 &meson8b_vclk2_venci1
,
3374 &meson8b_vclk2_vencp0
,
3375 &meson8b_vclk2_vencp1
,
3376 &meson8b_gclk_venci_int
,
3377 &meson8b_gclk_vencp_int
,
3379 &meson8b_aoclk_gate
,
3380 &meson8b_iec958_gate
,
3383 &meson8b_gclk_vencl_int
,
3384 &meson8b_vclk2_venclmcc
,
3385 &meson8b_vclk2_vencl
,
3386 &meson8b_vclk2_other
,
3388 &meson8b_ao_media_cpu
,
3389 &meson8b_ao_ahb_sram
,
3390 &meson8b_ao_ahb_bus
,
3392 &meson8b_mpeg_clk_div
,
3393 &meson8b_mpeg_clk_sel
,
3402 &meson8b_cpu_in_sel
,
3403 &meson8b_cpu_scale_div
,
3404 &meson8b_cpu_scale_out_sel
,
3406 &meson8b_mpll_prediv
,
3412 &meson8b_nand_clk_sel
,
3413 &meson8b_nand_clk_div
,
3414 &meson8b_nand_clk_gate
,
3415 &meson8b_fixed_pll_dco
,
3416 &meson8b_hdmi_pll_dco
,
3417 &meson8b_sys_pll_dco
,
3418 &meson8b_apb_clk_sel
,
3419 &meson8b_apb_clk_gate
,
3420 &meson8b_periph_clk_sel
,
3421 &meson8b_periph_clk_gate
,
3422 &meson8b_axi_clk_sel
,
3423 &meson8b_axi_clk_gate
,
3424 &meson8b_l2_dram_clk_sel
,
3425 &meson8b_l2_dram_clk_gate
,
3426 &meson8b_hdmi_pll_lvds_out
,
3427 &meson8b_hdmi_pll_hdmi_out
,
3428 &meson8b_vid_pll_in_sel
,
3429 &meson8b_vid_pll_in_en
,
3430 &meson8b_vid_pll_pre_div
,
3431 &meson8b_vid_pll_post_div
,
3433 &meson8b_vid_pll_final_div
,
3434 &meson8b_vclk_in_sel
,
3435 &meson8b_vclk_in_en
,
3436 &meson8b_vclk_div1_gate
,
3437 &meson8b_vclk_div2_div_gate
,
3438 &meson8b_vclk_div4_div_gate
,
3439 &meson8b_vclk_div6_div_gate
,
3440 &meson8b_vclk_div12_div_gate
,
3441 &meson8b_vclk2_in_sel
,
3442 &meson8b_vclk2_clk_in_en
,
3443 &meson8b_vclk2_div1_gate
,
3444 &meson8b_vclk2_div2_div_gate
,
3445 &meson8b_vclk2_div4_div_gate
,
3446 &meson8b_vclk2_div6_div_gate
,
3447 &meson8b_vclk2_div12_div_gate
,
3448 &meson8b_cts_enct_sel
,
3450 &meson8b_cts_encp_sel
,
3452 &meson8b_cts_enci_sel
,
3454 &meson8b_hdmi_tx_pixel_sel
,
3455 &meson8b_hdmi_tx_pixel
,
3456 &meson8b_cts_encl_sel
,
3458 &meson8b_cts_vdac0_sel
,
3460 &meson8b_hdmi_sys_sel
,
3461 &meson8b_hdmi_sys_div
,
3463 &meson8b_mali_0_sel
,
3464 &meson8b_mali_0_div
,
3466 &meson8b_mali_1_sel
,
3467 &meson8b_mali_1_div
,
3470 &meson8m2_gp_pll_dco
,
3473 &meson8m2_vpu_0_sel
,
3477 &meson8m2_vpu_1_sel
,
3481 &meson8b_vdec_1_sel
,
3482 &meson8b_vdec_1_1_div
,
3484 &meson8b_vdec_1_2_div
,
3487 &meson8b_vdec_hcodec_sel
,
3488 &meson8b_vdec_hcodec_div
,
3489 &meson8b_vdec_hcodec
,
3490 &meson8b_vdec_2_sel
,
3491 &meson8b_vdec_2_div
,
3493 &meson8b_vdec_hevc_sel
,
3494 &meson8b_vdec_hevc_div
,
3495 &meson8b_vdec_hevc_en
,
3498 &meson8b_cts_amclk_sel
,
3499 &meson8b_cts_amclk_div
,
3500 &meson8b_cts_mclk_i958_sel
,
3501 &meson8b_cts_mclk_i958_div
,
3502 &meson8b_cts_mclk_i958
,
3506 static const struct meson8b_clk_reset_line
{
3509 } meson8b_clk_reset_bits
[] = {
3510 [CLKC_RESET_L2_CACHE_SOFT_RESET
] = {
3511 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 30
3513 [CLKC_RESET_AXI_64_TO_128_BRIDGE_A5_SOFT_RESET
] = {
3514 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 29
3516 [CLKC_RESET_SCU_SOFT_RESET
] = {
3517 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 28
3519 [CLKC_RESET_CPU3_SOFT_RESET
] = {
3520 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 27
3522 [CLKC_RESET_CPU2_SOFT_RESET
] = {
3523 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 26
3525 [CLKC_RESET_CPU1_SOFT_RESET
] = {
3526 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 25
3528 [CLKC_RESET_CPU0_SOFT_RESET
] = {
3529 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 24
3531 [CLKC_RESET_A5_GLOBAL_RESET
] = {
3532 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 18
3534 [CLKC_RESET_A5_AXI_SOFT_RESET
] = {
3535 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 17
3537 [CLKC_RESET_A5_ABP_SOFT_RESET
] = {
3538 .reg
= HHI_SYS_CPU_CLK_CNTL0
, .bit_idx
= 16
3540 [CLKC_RESET_AXI_64_TO_128_BRIDGE_MMC_SOFT_RESET
] = {
3541 .reg
= HHI_SYS_CPU_CLK_CNTL1
, .bit_idx
= 30
3543 [CLKC_RESET_VID_CLK_CNTL_SOFT_RESET
] = {
3544 .reg
= HHI_VID_CLK_CNTL
, .bit_idx
= 15
3546 [CLKC_RESET_VID_DIVIDER_CNTL_SOFT_RESET_POST
] = {
3547 .reg
= HHI_VID_DIVIDER_CNTL
, .bit_idx
= 7
3549 [CLKC_RESET_VID_DIVIDER_CNTL_SOFT_RESET_PRE
] = {
3550 .reg
= HHI_VID_DIVIDER_CNTL
, .bit_idx
= 3
3552 [CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_POST
] = {
3553 .reg
= HHI_VID_DIVIDER_CNTL
, .bit_idx
= 1
3555 [CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_PRE
] = {
3556 .reg
= HHI_VID_DIVIDER_CNTL
, .bit_idx
= 0
3560 static int meson8b_clk_reset_update(struct reset_controller_dev
*rcdev
,
3561 unsigned long id
, bool assert)
3563 struct meson8b_clk_reset
*meson8b_clk_reset
=
3564 container_of(rcdev
, struct meson8b_clk_reset
, reset
);
3565 unsigned long flags
;
3566 const struct meson8b_clk_reset_line
*reset
;
3568 if (id
>= ARRAY_SIZE(meson8b_clk_reset_bits
))
3571 reset
= &meson8b_clk_reset_bits
[id
];
3573 spin_lock_irqsave(&meson_clk_lock
, flags
);
3576 regmap_update_bits(meson8b_clk_reset
->regmap
, reset
->reg
,
3577 BIT(reset
->bit_idx
), BIT(reset
->bit_idx
));
3579 regmap_update_bits(meson8b_clk_reset
->regmap
, reset
->reg
,
3580 BIT(reset
->bit_idx
), 0);
3582 spin_unlock_irqrestore(&meson_clk_lock
, flags
);
3587 static int meson8b_clk_reset_assert(struct reset_controller_dev
*rcdev
,
3590 return meson8b_clk_reset_update(rcdev
, id
, true);
3593 static int meson8b_clk_reset_deassert(struct reset_controller_dev
*rcdev
,
3596 return meson8b_clk_reset_update(rcdev
, id
, false);
3599 static const struct reset_control_ops meson8b_clk_reset_ops
= {
3600 .assert = meson8b_clk_reset_assert
,
3601 .deassert
= meson8b_clk_reset_deassert
,
3604 struct meson8b_nb_data
{
3605 struct notifier_block nb
;
3606 struct clk_hw
*cpu_clk
;
3609 static int meson8b_cpu_clk_notifier_cb(struct notifier_block
*nb
,
3610 unsigned long event
, void *data
)
3612 struct meson8b_nb_data
*nb_data
=
3613 container_of(nb
, struct meson8b_nb_data
, nb
);
3614 struct clk_hw
*parent_clk
;
3618 case PRE_RATE_CHANGE
:
3620 parent_clk
= clk_hw_get_parent_by_index(nb_data
->cpu_clk
, 0);
3623 case POST_RATE_CHANGE
:
3624 /* cpu_scale_out_sel */
3625 parent_clk
= clk_hw_get_parent_by_index(nb_data
->cpu_clk
, 1);
3632 ret
= clk_hw_set_parent(nb_data
->cpu_clk
, parent_clk
);
3634 return notifier_from_errno(ret
);
3641 static struct meson8b_nb_data meson8b_cpu_nb_data
= {
3642 .nb
.notifier_call
= meson8b_cpu_clk_notifier_cb
,
3645 static const struct regmap_config clkc_regmap_config
= {
3651 static void __init
meson8b_clkc_init_common(struct device_node
*np
,
3652 struct clk_hw_onecell_data
*clk_hw_onecell_data
)
3654 struct meson8b_clk_reset
*rstc
;
3655 const char *notifier_clk_name
;
3656 struct clk
*notifier_clk
;
3657 void __iomem
*clk_base
;
3661 map
= syscon_node_to_regmap(of_get_parent(np
));
3663 pr_info("failed to get HHI regmap - Trying obsolete regs\n");
3665 /* Generic clocks, PLLs and some of the reset-bits */
3666 clk_base
= of_iomap(np
, 1);
3668 pr_err("%s: Unable to map clk base\n", __func__
);
3672 map
= regmap_init_mmio(NULL
, clk_base
, &clkc_regmap_config
);
3677 rstc
= kzalloc(sizeof(*rstc
), GFP_KERNEL
);
3681 /* Reset Controller */
3683 rstc
->reset
.ops
= &meson8b_clk_reset_ops
;
3684 rstc
->reset
.nr_resets
= ARRAY_SIZE(meson8b_clk_reset_bits
);
3685 rstc
->reset
.of_node
= np
;
3686 ret
= reset_controller_register(&rstc
->reset
);
3688 pr_err("%s: Failed to register clkc reset controller: %d\n",
3693 /* Populate regmap for the regmap backed clocks */
3694 for (i
= 0; i
< ARRAY_SIZE(meson8b_clk_regmaps
); i
++)
3695 meson8b_clk_regmaps
[i
]->map
= map
;
3698 * always skip CLKID_UNUSED and also skip XTAL if the .dtb provides the
3699 * XTAL clock as input.
3701 if (!IS_ERR(of_clk_get_by_name(np
, "xtal")))
3702 i
= CLKID_PLL_FIXED
;
3706 /* register all clks */
3707 for (; i
< CLK_NR_CLKS
; i
++) {
3708 /* array might be sparse */
3709 if (!clk_hw_onecell_data
->hws
[i
])
3712 ret
= of_clk_hw_register(np
, clk_hw_onecell_data
->hws
[i
]);
3717 meson8b_cpu_nb_data
.cpu_clk
= clk_hw_onecell_data
->hws
[CLKID_CPUCLK
];
3720 * FIXME we shouldn't program the muxes in notifier handlers. The
3721 * tricky programming sequence will be handled by the forthcoming
3722 * coordinated clock rates mechanism once that feature is released.
3724 notifier_clk_name
= clk_hw_get_name(&meson8b_cpu_scale_out_sel
.hw
);
3725 notifier_clk
= __clk_lookup(notifier_clk_name
);
3726 ret
= clk_notifier_register(notifier_clk
, &meson8b_cpu_nb_data
.nb
);
3728 pr_err("%s: failed to register the CPU clock notifier\n",
3733 ret
= of_clk_add_hw_provider(np
, of_clk_hw_onecell_get
,
3734 clk_hw_onecell_data
);
3736 pr_err("%s: failed to register clock provider\n", __func__
);
3739 static void __init
meson8_clkc_init(struct device_node
*np
)
3741 return meson8b_clkc_init_common(np
, &meson8_hw_onecell_data
);
3744 static void __init
meson8b_clkc_init(struct device_node
*np
)
3746 return meson8b_clkc_init_common(np
, &meson8b_hw_onecell_data
);
3749 static void __init
meson8m2_clkc_init(struct device_node
*np
)
3751 return meson8b_clkc_init_common(np
, &meson8m2_hw_onecell_data
);
3754 CLK_OF_DECLARE_DRIVER(meson8_clkc
, "amlogic,meson8-clkc",
3756 CLK_OF_DECLARE_DRIVER(meson8b_clkc
, "amlogic,meson8b-clkc",
3758 CLK_OF_DECLARE_DRIVER(meson8m2_clkc
, "amlogic,meson8m2-clkc",
3759 meson8m2_clkc_init
);