1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2016 AmLogic, Inc.
4 * Michael Turquette <mturquette@baylibre.com>
7 #include <linux/clk-provider.h>
8 #include <linux/init.h>
9 #include <linux/mod_devicetable.h>
10 #include <linux/platform_device.h>
11 #include <linux/module.h>
14 #include "clk-regmap.h"
17 #include "meson-eeclk.h"
18 #include "vid-pll-div.h"
20 #include <dt-bindings/clock/gxbb-clkc.h>
22 static const struct pll_params_table gxbb_gp0_pll_params_table
[] = {
57 static const struct pll_params_table gxl_gp0_pll_params_table
[] = {
86 static struct clk_regmap gxbb_fixed_pll_dco
= {
87 .data
= &(struct meson_clk_pll_data
){
89 .reg_off
= HHI_MPLL_CNTL
,
94 .reg_off
= HHI_MPLL_CNTL
,
99 .reg_off
= HHI_MPLL_CNTL
,
104 .reg_off
= HHI_MPLL_CNTL2
,
109 .reg_off
= HHI_MPLL_CNTL
,
114 .reg_off
= HHI_MPLL_CNTL
,
119 .hw
.init
= &(struct clk_init_data
){
120 .name
= "fixed_pll_dco",
121 .ops
= &meson_clk_pll_ro_ops
,
122 .parent_data
= &(const struct clk_parent_data
) {
129 static struct clk_regmap gxbb_fixed_pll
= {
130 .data
= &(struct clk_regmap_div_data
){
131 .offset
= HHI_MPLL_CNTL
,
134 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
136 .hw
.init
= &(struct clk_init_data
){
138 .ops
= &clk_regmap_divider_ro_ops
,
139 .parent_hws
= (const struct clk_hw
*[]) {
140 &gxbb_fixed_pll_dco
.hw
144 * This clock won't ever change at runtime so
145 * CLK_SET_RATE_PARENT is not required
150 static struct clk_fixed_factor gxbb_hdmi_pll_pre_mult
= {
153 .hw
.init
= &(struct clk_init_data
){
154 .name
= "hdmi_pll_pre_mult",
155 .ops
= &clk_fixed_factor_ops
,
156 .parent_data
= &(const struct clk_parent_data
) {
163 static struct clk_regmap gxbb_hdmi_pll_dco
= {
164 .data
= &(struct meson_clk_pll_data
){
166 .reg_off
= HHI_HDMI_PLL_CNTL
,
171 .reg_off
= HHI_HDMI_PLL_CNTL
,
176 .reg_off
= HHI_HDMI_PLL_CNTL
,
181 .reg_off
= HHI_HDMI_PLL_CNTL2
,
186 .reg_off
= HHI_HDMI_PLL_CNTL
,
191 .reg_off
= HHI_HDMI_PLL_CNTL
,
196 .hw
.init
= &(struct clk_init_data
){
197 .name
= "hdmi_pll_dco",
198 .ops
= &meson_clk_pll_ro_ops
,
199 .parent_hws
= (const struct clk_hw
*[]) {
200 &gxbb_hdmi_pll_pre_mult
.hw
204 * Display directly handle hdmi pll registers ATM, we need
205 * NOCACHE to keep our view of the clock as accurate as possible
207 .flags
= CLK_GET_RATE_NOCACHE
,
211 static struct clk_regmap gxl_hdmi_pll_dco
= {
212 .data
= &(struct meson_clk_pll_data
){
214 .reg_off
= HHI_HDMI_PLL_CNTL
,
219 .reg_off
= HHI_HDMI_PLL_CNTL
,
224 .reg_off
= HHI_HDMI_PLL_CNTL
,
229 * On gxl, there is a register shift due to
230 * HHI_HDMI_PLL_CNTL1 which does not exist on gxbb,
231 * so we use the HHI_HDMI_PLL_CNTL2 define from GXBB
232 * instead which is defined at the same offset.
235 .reg_off
= HHI_HDMI_PLL_CNTL2
,
240 .reg_off
= HHI_HDMI_PLL_CNTL
,
245 .reg_off
= HHI_HDMI_PLL_CNTL
,
250 .hw
.init
= &(struct clk_init_data
){
251 .name
= "hdmi_pll_dco",
252 .ops
= &meson_clk_pll_ro_ops
,
253 .parent_data
= &(const struct clk_parent_data
) {
258 * Display directly handle hdmi pll registers ATM, we need
259 * NOCACHE to keep our view of the clock as accurate as possible
261 .flags
= CLK_GET_RATE_NOCACHE
,
265 static struct clk_regmap gxbb_hdmi_pll_od
= {
266 .data
= &(struct clk_regmap_div_data
){
267 .offset
= HHI_HDMI_PLL_CNTL2
,
270 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
272 .hw
.init
= &(struct clk_init_data
){
273 .name
= "hdmi_pll_od",
274 .ops
= &clk_regmap_divider_ro_ops
,
275 .parent_hws
= (const struct clk_hw
*[]) {
276 &gxbb_hdmi_pll_dco
.hw
279 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
283 static struct clk_regmap gxbb_hdmi_pll_od2
= {
284 .data
= &(struct clk_regmap_div_data
){
285 .offset
= HHI_HDMI_PLL_CNTL2
,
288 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
290 .hw
.init
= &(struct clk_init_data
){
291 .name
= "hdmi_pll_od2",
292 .ops
= &clk_regmap_divider_ro_ops
,
293 .parent_hws
= (const struct clk_hw
*[]) {
297 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
301 static struct clk_regmap gxbb_hdmi_pll
= {
302 .data
= &(struct clk_regmap_div_data
){
303 .offset
= HHI_HDMI_PLL_CNTL2
,
306 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
308 .hw
.init
= &(struct clk_init_data
){
310 .ops
= &clk_regmap_divider_ro_ops
,
311 .parent_hws
= (const struct clk_hw
*[]) {
312 &gxbb_hdmi_pll_od2
.hw
315 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
319 static struct clk_regmap gxl_hdmi_pll_od
= {
320 .data
= &(struct clk_regmap_div_data
){
321 .offset
= HHI_HDMI_PLL_CNTL
+ 8,
324 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
326 .hw
.init
= &(struct clk_init_data
){
327 .name
= "hdmi_pll_od",
328 .ops
= &clk_regmap_divider_ro_ops
,
329 .parent_hws
= (const struct clk_hw
*[]) {
333 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
337 static struct clk_regmap gxl_hdmi_pll_od2
= {
338 .data
= &(struct clk_regmap_div_data
){
339 .offset
= HHI_HDMI_PLL_CNTL
+ 8,
342 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
344 .hw
.init
= &(struct clk_init_data
){
345 .name
= "hdmi_pll_od2",
346 .ops
= &clk_regmap_divider_ro_ops
,
347 .parent_hws
= (const struct clk_hw
*[]) {
351 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
355 static struct clk_regmap gxl_hdmi_pll
= {
356 .data
= &(struct clk_regmap_div_data
){
357 .offset
= HHI_HDMI_PLL_CNTL
+ 8,
360 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
362 .hw
.init
= &(struct clk_init_data
){
364 .ops
= &clk_regmap_divider_ro_ops
,
365 .parent_hws
= (const struct clk_hw
*[]) {
369 .flags
= CLK_GET_RATE_NOCACHE
| CLK_SET_RATE_PARENT
,
373 static struct clk_regmap gxbb_sys_pll_dco
= {
374 .data
= &(struct meson_clk_pll_data
){
376 .reg_off
= HHI_SYS_PLL_CNTL
,
381 .reg_off
= HHI_SYS_PLL_CNTL
,
386 .reg_off
= HHI_SYS_PLL_CNTL
,
391 .reg_off
= HHI_SYS_PLL_CNTL
,
396 .reg_off
= HHI_SYS_PLL_CNTL
,
401 .hw
.init
= &(struct clk_init_data
){
402 .name
= "sys_pll_dco",
403 .ops
= &meson_clk_pll_ro_ops
,
404 .parent_data
= &(const struct clk_parent_data
) {
411 static struct clk_regmap gxbb_sys_pll
= {
412 .data
= &(struct clk_regmap_div_data
){
413 .offset
= HHI_SYS_PLL_CNTL
,
416 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
418 .hw
.init
= &(struct clk_init_data
){
420 .ops
= &clk_regmap_divider_ro_ops
,
421 .parent_hws
= (const struct clk_hw
*[]) {
425 .flags
= CLK_SET_RATE_PARENT
,
429 static const struct reg_sequence gxbb_gp0_init_regs
[] = {
430 { .reg
= HHI_GP0_PLL_CNTL2
, .def
= 0x69c80000 },
431 { .reg
= HHI_GP0_PLL_CNTL3
, .def
= 0x0a5590c4 },
432 { .reg
= HHI_GP0_PLL_CNTL4
, .def
= 0x0000500d },
435 static struct clk_regmap gxbb_gp0_pll_dco
= {
436 .data
= &(struct meson_clk_pll_data
){
438 .reg_off
= HHI_GP0_PLL_CNTL
,
443 .reg_off
= HHI_GP0_PLL_CNTL
,
448 .reg_off
= HHI_GP0_PLL_CNTL
,
453 .reg_off
= HHI_GP0_PLL_CNTL
,
458 .reg_off
= HHI_GP0_PLL_CNTL
,
462 .table
= gxbb_gp0_pll_params_table
,
463 .init_regs
= gxbb_gp0_init_regs
,
464 .init_count
= ARRAY_SIZE(gxbb_gp0_init_regs
),
466 .hw
.init
= &(struct clk_init_data
){
467 .name
= "gp0_pll_dco",
468 .ops
= &meson_clk_pll_ops
,
469 .parent_data
= &(const struct clk_parent_data
) {
476 static const struct reg_sequence gxl_gp0_init_regs
[] = {
477 { .reg
= HHI_GP0_PLL_CNTL1
, .def
= 0xc084b000 },
478 { .reg
= HHI_GP0_PLL_CNTL2
, .def
= 0xb75020be },
479 { .reg
= HHI_GP0_PLL_CNTL3
, .def
= 0x0a59a288 },
480 { .reg
= HHI_GP0_PLL_CNTL4
, .def
= 0xc000004d },
481 { .reg
= HHI_GP0_PLL_CNTL5
, .def
= 0x00078000 },
484 static struct clk_regmap gxl_gp0_pll_dco
= {
485 .data
= &(struct meson_clk_pll_data
){
487 .reg_off
= HHI_GP0_PLL_CNTL
,
492 .reg_off
= HHI_GP0_PLL_CNTL
,
497 .reg_off
= HHI_GP0_PLL_CNTL
,
502 .reg_off
= HHI_GP0_PLL_CNTL1
,
507 .reg_off
= HHI_GP0_PLL_CNTL
,
512 .reg_off
= HHI_GP0_PLL_CNTL
,
516 .table
= gxl_gp0_pll_params_table
,
517 .init_regs
= gxl_gp0_init_regs
,
518 .init_count
= ARRAY_SIZE(gxl_gp0_init_regs
),
520 .hw
.init
= &(struct clk_init_data
){
521 .name
= "gp0_pll_dco",
522 .ops
= &meson_clk_pll_ops
,
523 .parent_data
= &(const struct clk_parent_data
) {
530 static struct clk_regmap gxbb_gp0_pll
= {
531 .data
= &(struct clk_regmap_div_data
){
532 .offset
= HHI_GP0_PLL_CNTL
,
535 .flags
= CLK_DIVIDER_POWER_OF_TWO
,
537 .hw
.init
= &(struct clk_init_data
){
539 .ops
= &clk_regmap_divider_ops
,
540 .parent_data
= &(const struct clk_parent_data
) {
543 * GXL and GXBB have different gp0_pll_dco (with
544 * different struct clk_hw). We fallback to the global
545 * naming string mechanism so gp0_pll picks up the
548 .name
= "gp0_pll_dco",
552 .flags
= CLK_SET_RATE_PARENT
,
556 static struct clk_fixed_factor gxbb_fclk_div2_div
= {
559 .hw
.init
= &(struct clk_init_data
){
560 .name
= "fclk_div2_div",
561 .ops
= &clk_fixed_factor_ops
,
562 .parent_hws
= (const struct clk_hw
*[]) {
569 static struct clk_regmap gxbb_fclk_div2
= {
570 .data
= &(struct clk_regmap_gate_data
){
571 .offset
= HHI_MPLL_CNTL6
,
574 .hw
.init
= &(struct clk_init_data
){
576 .ops
= &clk_regmap_gate_ops
,
577 .parent_hws
= (const struct clk_hw
*[]) {
578 &gxbb_fclk_div2_div
.hw
581 .flags
= CLK_IS_CRITICAL
,
585 static struct clk_fixed_factor gxbb_fclk_div3_div
= {
588 .hw
.init
= &(struct clk_init_data
){
589 .name
= "fclk_div3_div",
590 .ops
= &clk_fixed_factor_ops
,
591 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
596 static struct clk_regmap gxbb_fclk_div3
= {
597 .data
= &(struct clk_regmap_gate_data
){
598 .offset
= HHI_MPLL_CNTL6
,
601 .hw
.init
= &(struct clk_init_data
){
603 .ops
= &clk_regmap_gate_ops
,
604 .parent_hws
= (const struct clk_hw
*[]) {
605 &gxbb_fclk_div3_div
.hw
610 * This clock, as fdiv2, is used by the SCPI FW and is required
611 * by the platform to operate correctly.
612 * Until the following condition are met, we need this clock to
613 * be marked as critical:
614 * a) The SCPI generic driver claims and enable all the clocks
616 * b) CCF has a clock hand-off mechanism to make the sure the
617 * clock stays on until the proper driver comes along
619 .flags
= CLK_IS_CRITICAL
,
623 static struct clk_fixed_factor gxbb_fclk_div4_div
= {
626 .hw
.init
= &(struct clk_init_data
){
627 .name
= "fclk_div4_div",
628 .ops
= &clk_fixed_factor_ops
,
629 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
634 static struct clk_regmap gxbb_fclk_div4
= {
635 .data
= &(struct clk_regmap_gate_data
){
636 .offset
= HHI_MPLL_CNTL6
,
639 .hw
.init
= &(struct clk_init_data
){
641 .ops
= &clk_regmap_gate_ops
,
642 .parent_hws
= (const struct clk_hw
*[]) {
643 &gxbb_fclk_div4_div
.hw
649 static struct clk_fixed_factor gxbb_fclk_div5_div
= {
652 .hw
.init
= &(struct clk_init_data
){
653 .name
= "fclk_div5_div",
654 .ops
= &clk_fixed_factor_ops
,
655 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
660 static struct clk_regmap gxbb_fclk_div5
= {
661 .data
= &(struct clk_regmap_gate_data
){
662 .offset
= HHI_MPLL_CNTL6
,
665 .hw
.init
= &(struct clk_init_data
){
667 .ops
= &clk_regmap_gate_ops
,
668 .parent_hws
= (const struct clk_hw
*[]) {
669 &gxbb_fclk_div5_div
.hw
675 static struct clk_fixed_factor gxbb_fclk_div7_div
= {
678 .hw
.init
= &(struct clk_init_data
){
679 .name
= "fclk_div7_div",
680 .ops
= &clk_fixed_factor_ops
,
681 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
686 static struct clk_regmap gxbb_fclk_div7
= {
687 .data
= &(struct clk_regmap_gate_data
){
688 .offset
= HHI_MPLL_CNTL6
,
691 .hw
.init
= &(struct clk_init_data
){
693 .ops
= &clk_regmap_gate_ops
,
694 .parent_hws
= (const struct clk_hw
*[]) {
695 &gxbb_fclk_div7_div
.hw
701 static struct clk_regmap gxbb_mpll_prediv
= {
702 .data
= &(struct clk_regmap_div_data
){
703 .offset
= HHI_MPLL_CNTL5
,
707 .hw
.init
= &(struct clk_init_data
){
708 .name
= "mpll_prediv",
709 .ops
= &clk_regmap_divider_ro_ops
,
710 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_fixed_pll
.hw
},
715 static struct clk_regmap gxbb_mpll0_div
= {
716 .data
= &(struct meson_clk_mpll_data
){
718 .reg_off
= HHI_MPLL_CNTL7
,
723 .reg_off
= HHI_MPLL_CNTL
,
728 .reg_off
= HHI_MPLL_CNTL7
,
733 .hw
.init
= &(struct clk_init_data
){
735 .ops
= &meson_clk_mpll_ops
,
736 .parent_hws
= (const struct clk_hw
*[]) {
743 static struct clk_regmap gxl_mpll0_div
= {
744 .data
= &(struct meson_clk_mpll_data
){
746 .reg_off
= HHI_MPLL_CNTL7
,
751 .reg_off
= HHI_MPLL_CNTL7
,
756 .reg_off
= HHI_MPLL_CNTL7
,
761 .hw
.init
= &(struct clk_init_data
){
763 .ops
= &meson_clk_mpll_ops
,
764 .parent_hws
= (const struct clk_hw
*[]) {
771 static struct clk_regmap gxbb_mpll0
= {
772 .data
= &(struct clk_regmap_gate_data
){
773 .offset
= HHI_MPLL_CNTL7
,
776 .hw
.init
= &(struct clk_init_data
){
778 .ops
= &clk_regmap_gate_ops
,
779 .parent_data
= &(const struct clk_parent_data
) {
782 * GXL and GXBB have different SDM_EN registers. We
783 * fallback to the global naming string mechanism so
784 * mpll0_div picks up the appropriate one.
790 .flags
= CLK_SET_RATE_PARENT
,
794 static struct clk_regmap gxbb_mpll1_div
= {
795 .data
= &(struct meson_clk_mpll_data
){
797 .reg_off
= HHI_MPLL_CNTL8
,
802 .reg_off
= HHI_MPLL_CNTL8
,
807 .reg_off
= HHI_MPLL_CNTL8
,
812 .hw
.init
= &(struct clk_init_data
){
814 .ops
= &meson_clk_mpll_ops
,
815 .parent_hws
= (const struct clk_hw
*[]) {
822 static struct clk_regmap gxbb_mpll1
= {
823 .data
= &(struct clk_regmap_gate_data
){
824 .offset
= HHI_MPLL_CNTL8
,
827 .hw
.init
= &(struct clk_init_data
){
829 .ops
= &clk_regmap_gate_ops
,
830 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_mpll1_div
.hw
},
832 .flags
= CLK_SET_RATE_PARENT
,
836 static struct clk_regmap gxbb_mpll2_div
= {
837 .data
= &(struct meson_clk_mpll_data
){
839 .reg_off
= HHI_MPLL_CNTL9
,
844 .reg_off
= HHI_MPLL_CNTL9
,
849 .reg_off
= HHI_MPLL_CNTL9
,
854 .hw
.init
= &(struct clk_init_data
){
856 .ops
= &meson_clk_mpll_ops
,
857 .parent_hws
= (const struct clk_hw
*[]) {
864 static struct clk_regmap gxbb_mpll2
= {
865 .data
= &(struct clk_regmap_gate_data
){
866 .offset
= HHI_MPLL_CNTL9
,
869 .hw
.init
= &(struct clk_init_data
){
871 .ops
= &clk_regmap_gate_ops
,
872 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_mpll2_div
.hw
},
874 .flags
= CLK_SET_RATE_PARENT
,
878 static u32 mux_table_clk81
[] = { 0, 2, 3, 4, 5, 6, 7 };
879 static const struct clk_parent_data clk81_parent_data
[] = {
880 { .fw_name
= "xtal", },
881 { .hw
= &gxbb_fclk_div7
.hw
},
882 { .hw
= &gxbb_mpll1
.hw
},
883 { .hw
= &gxbb_mpll2
.hw
},
884 { .hw
= &gxbb_fclk_div4
.hw
},
885 { .hw
= &gxbb_fclk_div3
.hw
},
886 { .hw
= &gxbb_fclk_div5
.hw
},
889 static struct clk_regmap gxbb_mpeg_clk_sel
= {
890 .data
= &(struct clk_regmap_mux_data
){
891 .offset
= HHI_MPEG_CLK_CNTL
,
894 .table
= mux_table_clk81
,
896 .hw
.init
= &(struct clk_init_data
){
897 .name
= "mpeg_clk_sel",
898 .ops
= &clk_regmap_mux_ro_ops
,
900 * bits 14:12 selects from 8 possible parents:
901 * xtal, 1'b0 (wtf), fclk_div7, mpll_clkout1, mpll_clkout2,
902 * fclk_div4, fclk_div3, fclk_div5
904 .parent_data
= clk81_parent_data
,
905 .num_parents
= ARRAY_SIZE(clk81_parent_data
),
909 static struct clk_regmap gxbb_mpeg_clk_div
= {
910 .data
= &(struct clk_regmap_div_data
){
911 .offset
= HHI_MPEG_CLK_CNTL
,
915 .hw
.init
= &(struct clk_init_data
){
916 .name
= "mpeg_clk_div",
917 .ops
= &clk_regmap_divider_ro_ops
,
918 .parent_hws
= (const struct clk_hw
*[]) {
919 &gxbb_mpeg_clk_sel
.hw
925 /* the mother of dragons gates */
926 static struct clk_regmap gxbb_clk81
= {
927 .data
= &(struct clk_regmap_gate_data
){
928 .offset
= HHI_MPEG_CLK_CNTL
,
931 .hw
.init
= &(struct clk_init_data
){
933 .ops
= &clk_regmap_gate_ops
,
934 .parent_hws
= (const struct clk_hw
*[]) {
935 &gxbb_mpeg_clk_div
.hw
938 .flags
= CLK_IS_CRITICAL
,
942 static struct clk_regmap gxbb_sar_adc_clk_sel
= {
943 .data
= &(struct clk_regmap_mux_data
){
944 .offset
= HHI_SAR_CLK_CNTL
,
948 .hw
.init
= &(struct clk_init_data
){
949 .name
= "sar_adc_clk_sel",
950 .ops
= &clk_regmap_mux_ops
,
951 /* NOTE: The datasheet doesn't list the parents for bit 10 */
952 .parent_data
= (const struct clk_parent_data
[]) {
953 { .fw_name
= "xtal", },
954 { .hw
= &gxbb_clk81
.hw
},
960 static struct clk_regmap gxbb_sar_adc_clk_div
= {
961 .data
= &(struct clk_regmap_div_data
){
962 .offset
= HHI_SAR_CLK_CNTL
,
966 .hw
.init
= &(struct clk_init_data
){
967 .name
= "sar_adc_clk_div",
968 .ops
= &clk_regmap_divider_ops
,
969 .parent_hws
= (const struct clk_hw
*[]) {
970 &gxbb_sar_adc_clk_sel
.hw
973 .flags
= CLK_SET_RATE_PARENT
,
977 static struct clk_regmap gxbb_sar_adc_clk
= {
978 .data
= &(struct clk_regmap_gate_data
){
979 .offset
= HHI_SAR_CLK_CNTL
,
982 .hw
.init
= &(struct clk_init_data
){
983 .name
= "sar_adc_clk",
984 .ops
= &clk_regmap_gate_ops
,
985 .parent_hws
= (const struct clk_hw
*[]) {
986 &gxbb_sar_adc_clk_div
.hw
989 .flags
= CLK_SET_RATE_PARENT
,
994 * The MALI IP is clocked by two identical clocks (mali_0 and mali_1)
995 * muxed by a glitch-free switch. The CCF can manage this glitch-free
996 * mux because it does top-to-bottom updates the each clock tree and
997 * switches to the "inactive" one when CLK_SET_RATE_GATE is set.
1000 static const struct clk_parent_data gxbb_mali_0_1_parent_data
[] = {
1001 { .fw_name
= "xtal", },
1002 { .hw
= &gxbb_gp0_pll
.hw
},
1003 { .hw
= &gxbb_mpll2
.hw
},
1004 { .hw
= &gxbb_mpll1
.hw
},
1005 { .hw
= &gxbb_fclk_div7
.hw
},
1006 { .hw
= &gxbb_fclk_div4
.hw
},
1007 { .hw
= &gxbb_fclk_div3
.hw
},
1008 { .hw
= &gxbb_fclk_div5
.hw
},
1011 static struct clk_regmap gxbb_mali_0_sel
= {
1012 .data
= &(struct clk_regmap_mux_data
){
1013 .offset
= HHI_MALI_CLK_CNTL
,
1017 .hw
.init
= &(struct clk_init_data
){
1018 .name
= "mali_0_sel",
1019 .ops
= &clk_regmap_mux_ops
,
1020 .parent_data
= gxbb_mali_0_1_parent_data
,
1023 * Don't request the parent to change the rate because
1024 * all GPU frequencies can be derived from the fclk_*
1025 * clocks and one special GP0_PLL setting. This is
1026 * important because we need the MPLL clocks for audio.
1032 static struct clk_regmap gxbb_mali_0_div
= {
1033 .data
= &(struct clk_regmap_div_data
){
1034 .offset
= HHI_MALI_CLK_CNTL
,
1038 .hw
.init
= &(struct clk_init_data
){
1039 .name
= "mali_0_div",
1040 .ops
= &clk_regmap_divider_ops
,
1041 .parent_hws
= (const struct clk_hw
*[]) {
1045 .flags
= CLK_SET_RATE_PARENT
,
1049 static struct clk_regmap gxbb_mali_0
= {
1050 .data
= &(struct clk_regmap_gate_data
){
1051 .offset
= HHI_MALI_CLK_CNTL
,
1054 .hw
.init
= &(struct clk_init_data
){
1056 .ops
= &clk_regmap_gate_ops
,
1057 .parent_hws
= (const struct clk_hw
*[]) {
1061 .flags
= CLK_SET_RATE_GATE
| CLK_SET_RATE_PARENT
,
1065 static struct clk_regmap gxbb_mali_1_sel
= {
1066 .data
= &(struct clk_regmap_mux_data
){
1067 .offset
= HHI_MALI_CLK_CNTL
,
1071 .hw
.init
= &(struct clk_init_data
){
1072 .name
= "mali_1_sel",
1073 .ops
= &clk_regmap_mux_ops
,
1074 .parent_data
= gxbb_mali_0_1_parent_data
,
1077 * Don't request the parent to change the rate because
1078 * all GPU frequencies can be derived from the fclk_*
1079 * clocks and one special GP0_PLL setting. This is
1080 * important because we need the MPLL clocks for audio.
1086 static struct clk_regmap gxbb_mali_1_div
= {
1087 .data
= &(struct clk_regmap_div_data
){
1088 .offset
= HHI_MALI_CLK_CNTL
,
1092 .hw
.init
= &(struct clk_init_data
){
1093 .name
= "mali_1_div",
1094 .ops
= &clk_regmap_divider_ops
,
1095 .parent_hws
= (const struct clk_hw
*[]) {
1099 .flags
= CLK_SET_RATE_PARENT
,
1103 static struct clk_regmap gxbb_mali_1
= {
1104 .data
= &(struct clk_regmap_gate_data
){
1105 .offset
= HHI_MALI_CLK_CNTL
,
1108 .hw
.init
= &(struct clk_init_data
){
1110 .ops
= &clk_regmap_gate_ops
,
1111 .parent_hws
= (const struct clk_hw
*[]) {
1115 .flags
= CLK_SET_RATE_GATE
| CLK_SET_RATE_PARENT
,
1119 static const struct clk_hw
*gxbb_mali_parent_hws
[] = {
1124 static struct clk_regmap gxbb_mali
= {
1125 .data
= &(struct clk_regmap_mux_data
){
1126 .offset
= HHI_MALI_CLK_CNTL
,
1130 .hw
.init
= &(struct clk_init_data
){
1132 .ops
= &clk_regmap_mux_ops
,
1133 .parent_hws
= gxbb_mali_parent_hws
,
1135 .flags
= CLK_SET_RATE_PARENT
,
1139 static struct clk_regmap gxbb_cts_amclk_sel
= {
1140 .data
= &(struct clk_regmap_mux_data
){
1141 .offset
= HHI_AUD_CLK_CNTL
,
1144 .table
= (u32
[]){ 1, 2, 3 },
1145 .flags
= CLK_MUX_ROUND_CLOSEST
,
1147 .hw
.init
= &(struct clk_init_data
){
1148 .name
= "cts_amclk_sel",
1149 .ops
= &clk_regmap_mux_ops
,
1150 .parent_hws
= (const struct clk_hw
*[]) {
1159 static struct clk_regmap gxbb_cts_amclk_div
= {
1160 .data
= &(struct clk_regmap_div_data
) {
1161 .offset
= HHI_AUD_CLK_CNTL
,
1164 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1166 .hw
.init
= &(struct clk_init_data
){
1167 .name
= "cts_amclk_div",
1168 .ops
= &clk_regmap_divider_ops
,
1169 .parent_hws
= (const struct clk_hw
*[]) {
1170 &gxbb_cts_amclk_sel
.hw
1173 .flags
= CLK_SET_RATE_PARENT
,
1177 static struct clk_regmap gxbb_cts_amclk
= {
1178 .data
= &(struct clk_regmap_gate_data
){
1179 .offset
= HHI_AUD_CLK_CNTL
,
1182 .hw
.init
= &(struct clk_init_data
){
1183 .name
= "cts_amclk",
1184 .ops
= &clk_regmap_gate_ops
,
1185 .parent_hws
= (const struct clk_hw
*[]) {
1186 &gxbb_cts_amclk_div
.hw
1189 .flags
= CLK_SET_RATE_PARENT
,
1193 static struct clk_regmap gxbb_cts_mclk_i958_sel
= {
1194 .data
= &(struct clk_regmap_mux_data
){
1195 .offset
= HHI_AUD_CLK_CNTL2
,
1198 .table
= (u32
[]){ 1, 2, 3 },
1199 .flags
= CLK_MUX_ROUND_CLOSEST
,
1201 .hw
.init
= &(struct clk_init_data
) {
1202 .name
= "cts_mclk_i958_sel",
1203 .ops
= &clk_regmap_mux_ops
,
1204 .parent_hws
= (const struct clk_hw
*[]) {
1213 static struct clk_regmap gxbb_cts_mclk_i958_div
= {
1214 .data
= &(struct clk_regmap_div_data
){
1215 .offset
= HHI_AUD_CLK_CNTL2
,
1218 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1220 .hw
.init
= &(struct clk_init_data
) {
1221 .name
= "cts_mclk_i958_div",
1222 .ops
= &clk_regmap_divider_ops
,
1223 .parent_hws
= (const struct clk_hw
*[]) {
1224 &gxbb_cts_mclk_i958_sel
.hw
1227 .flags
= CLK_SET_RATE_PARENT
,
1231 static struct clk_regmap gxbb_cts_mclk_i958
= {
1232 .data
= &(struct clk_regmap_gate_data
){
1233 .offset
= HHI_AUD_CLK_CNTL2
,
1236 .hw
.init
= &(struct clk_init_data
){
1237 .name
= "cts_mclk_i958",
1238 .ops
= &clk_regmap_gate_ops
,
1239 .parent_hws
= (const struct clk_hw
*[]) {
1240 &gxbb_cts_mclk_i958_div
.hw
1243 .flags
= CLK_SET_RATE_PARENT
,
1247 static struct clk_regmap gxbb_cts_i958
= {
1248 .data
= &(struct clk_regmap_mux_data
){
1249 .offset
= HHI_AUD_CLK_CNTL2
,
1253 .hw
.init
= &(struct clk_init_data
){
1255 .ops
= &clk_regmap_mux_ops
,
1256 .parent_hws
= (const struct clk_hw
*[]) {
1258 &gxbb_cts_mclk_i958
.hw
1262 *The parent is specific to origin of the audio data. Let the
1263 * consumer choose the appropriate parent
1265 .flags
= CLK_SET_RATE_PARENT
| CLK_SET_RATE_NO_REPARENT
,
1269 static const struct clk_parent_data gxbb_32k_clk_parent_data
[] = {
1270 { .fw_name
= "xtal", },
1272 * FIXME: This clock is provided by the ao clock controller but the
1273 * clock is not yet part of the binding of this controller, so string
1274 * name must be use to set this parent.
1276 { .name
= "cts_slow_oscin", .index
= -1 },
1277 { .hw
= &gxbb_fclk_div3
.hw
},
1278 { .hw
= &gxbb_fclk_div5
.hw
},
1281 static struct clk_regmap gxbb_32k_clk_sel
= {
1282 .data
= &(struct clk_regmap_mux_data
){
1283 .offset
= HHI_32K_CLK_CNTL
,
1287 .hw
.init
= &(struct clk_init_data
){
1288 .name
= "32k_clk_sel",
1289 .ops
= &clk_regmap_mux_ops
,
1290 .parent_data
= gxbb_32k_clk_parent_data
,
1292 .flags
= CLK_SET_RATE_PARENT
,
1296 static struct clk_regmap gxbb_32k_clk_div
= {
1297 .data
= &(struct clk_regmap_div_data
){
1298 .offset
= HHI_32K_CLK_CNTL
,
1302 .hw
.init
= &(struct clk_init_data
){
1303 .name
= "32k_clk_div",
1304 .ops
= &clk_regmap_divider_ops
,
1305 .parent_hws
= (const struct clk_hw
*[]) {
1306 &gxbb_32k_clk_sel
.hw
1309 .flags
= CLK_SET_RATE_PARENT
| CLK_DIVIDER_ROUND_CLOSEST
,
1313 static struct clk_regmap gxbb_32k_clk
= {
1314 .data
= &(struct clk_regmap_gate_data
){
1315 .offset
= HHI_32K_CLK_CNTL
,
1318 .hw
.init
= &(struct clk_init_data
){
1320 .ops
= &clk_regmap_gate_ops
,
1321 .parent_hws
= (const struct clk_hw
*[]) {
1322 &gxbb_32k_clk_div
.hw
1325 .flags
= CLK_SET_RATE_PARENT
,
1329 static const struct clk_parent_data gxbb_sd_emmc_clk0_parent_data
[] = {
1330 { .fw_name
= "xtal", },
1331 { .hw
= &gxbb_fclk_div2
.hw
},
1332 { .hw
= &gxbb_fclk_div3
.hw
},
1333 { .hw
= &gxbb_fclk_div5
.hw
},
1334 { .hw
= &gxbb_fclk_div7
.hw
},
1336 * Following these parent clocks, we should also have had mpll2, mpll3
1337 * and gp0_pll but these clocks are too precious to be used here. All
1338 * the necessary rates for MMC and NAND operation can be acheived using
1339 * xtal or fclk_div clocks
1344 static struct clk_regmap gxbb_sd_emmc_a_clk0_sel
= {
1345 .data
= &(struct clk_regmap_mux_data
){
1346 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1350 .hw
.init
= &(struct clk_init_data
) {
1351 .name
= "sd_emmc_a_clk0_sel",
1352 .ops
= &clk_regmap_mux_ops
,
1353 .parent_data
= gxbb_sd_emmc_clk0_parent_data
,
1354 .num_parents
= ARRAY_SIZE(gxbb_sd_emmc_clk0_parent_data
),
1355 .flags
= CLK_SET_RATE_PARENT
,
1359 static struct clk_regmap gxbb_sd_emmc_a_clk0_div
= {
1360 .data
= &(struct clk_regmap_div_data
){
1361 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1364 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1366 .hw
.init
= &(struct clk_init_data
) {
1367 .name
= "sd_emmc_a_clk0_div",
1368 .ops
= &clk_regmap_divider_ops
,
1369 .parent_hws
= (const struct clk_hw
*[]) {
1370 &gxbb_sd_emmc_a_clk0_sel
.hw
1373 .flags
= CLK_SET_RATE_PARENT
,
1377 static struct clk_regmap gxbb_sd_emmc_a_clk0
= {
1378 .data
= &(struct clk_regmap_gate_data
){
1379 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1382 .hw
.init
= &(struct clk_init_data
){
1383 .name
= "sd_emmc_a_clk0",
1384 .ops
= &clk_regmap_gate_ops
,
1385 .parent_hws
= (const struct clk_hw
*[]) {
1386 &gxbb_sd_emmc_a_clk0_div
.hw
1389 .flags
= CLK_SET_RATE_PARENT
,
1394 static struct clk_regmap gxbb_sd_emmc_b_clk0_sel
= {
1395 .data
= &(struct clk_regmap_mux_data
){
1396 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1400 .hw
.init
= &(struct clk_init_data
) {
1401 .name
= "sd_emmc_b_clk0_sel",
1402 .ops
= &clk_regmap_mux_ops
,
1403 .parent_data
= gxbb_sd_emmc_clk0_parent_data
,
1404 .num_parents
= ARRAY_SIZE(gxbb_sd_emmc_clk0_parent_data
),
1405 .flags
= CLK_SET_RATE_PARENT
,
1409 static struct clk_regmap gxbb_sd_emmc_b_clk0_div
= {
1410 .data
= &(struct clk_regmap_div_data
){
1411 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1414 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1416 .hw
.init
= &(struct clk_init_data
) {
1417 .name
= "sd_emmc_b_clk0_div",
1418 .ops
= &clk_regmap_divider_ops
,
1419 .parent_hws
= (const struct clk_hw
*[]) {
1420 &gxbb_sd_emmc_b_clk0_sel
.hw
1423 .flags
= CLK_SET_RATE_PARENT
,
1427 static struct clk_regmap gxbb_sd_emmc_b_clk0
= {
1428 .data
= &(struct clk_regmap_gate_data
){
1429 .offset
= HHI_SD_EMMC_CLK_CNTL
,
1432 .hw
.init
= &(struct clk_init_data
){
1433 .name
= "sd_emmc_b_clk0",
1434 .ops
= &clk_regmap_gate_ops
,
1435 .parent_hws
= (const struct clk_hw
*[]) {
1436 &gxbb_sd_emmc_b_clk0_div
.hw
1439 .flags
= CLK_SET_RATE_PARENT
,
1443 /* EMMC/NAND clock */
1444 static struct clk_regmap gxbb_sd_emmc_c_clk0_sel
= {
1445 .data
= &(struct clk_regmap_mux_data
){
1446 .offset
= HHI_NAND_CLK_CNTL
,
1450 .hw
.init
= &(struct clk_init_data
) {
1451 .name
= "sd_emmc_c_clk0_sel",
1452 .ops
= &clk_regmap_mux_ops
,
1453 .parent_data
= gxbb_sd_emmc_clk0_parent_data
,
1454 .num_parents
= ARRAY_SIZE(gxbb_sd_emmc_clk0_parent_data
),
1455 .flags
= CLK_SET_RATE_PARENT
,
1459 static struct clk_regmap gxbb_sd_emmc_c_clk0_div
= {
1460 .data
= &(struct clk_regmap_div_data
){
1461 .offset
= HHI_NAND_CLK_CNTL
,
1464 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
1466 .hw
.init
= &(struct clk_init_data
) {
1467 .name
= "sd_emmc_c_clk0_div",
1468 .ops
= &clk_regmap_divider_ops
,
1469 .parent_hws
= (const struct clk_hw
*[]) {
1470 &gxbb_sd_emmc_c_clk0_sel
.hw
1473 .flags
= CLK_SET_RATE_PARENT
,
1477 static struct clk_regmap gxbb_sd_emmc_c_clk0
= {
1478 .data
= &(struct clk_regmap_gate_data
){
1479 .offset
= HHI_NAND_CLK_CNTL
,
1482 .hw
.init
= &(struct clk_init_data
){
1483 .name
= "sd_emmc_c_clk0",
1484 .ops
= &clk_regmap_gate_ops
,
1485 .parent_hws
= (const struct clk_hw
*[]) {
1486 &gxbb_sd_emmc_c_clk0_div
.hw
1489 .flags
= CLK_SET_RATE_PARENT
,
1495 static const struct clk_hw
*gxbb_vpu_parent_hws
[] = {
1502 static struct clk_regmap gxbb_vpu_0_sel
= {
1503 .data
= &(struct clk_regmap_mux_data
){
1504 .offset
= HHI_VPU_CLK_CNTL
,
1508 .hw
.init
= &(struct clk_init_data
){
1509 .name
= "vpu_0_sel",
1510 .ops
= &clk_regmap_mux_ops
,
1512 * bits 9:10 selects from 4 possible parents:
1513 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1515 .parent_hws
= gxbb_vpu_parent_hws
,
1516 .num_parents
= ARRAY_SIZE(gxbb_vpu_parent_hws
),
1517 .flags
= CLK_SET_RATE_NO_REPARENT
,
1521 static struct clk_regmap gxbb_vpu_0_div
= {
1522 .data
= &(struct clk_regmap_div_data
){
1523 .offset
= HHI_VPU_CLK_CNTL
,
1527 .hw
.init
= &(struct clk_init_data
){
1528 .name
= "vpu_0_div",
1529 .ops
= &clk_regmap_divider_ops
,
1530 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vpu_0_sel
.hw
},
1532 .flags
= CLK_SET_RATE_PARENT
,
1536 static struct clk_regmap gxbb_vpu_0
= {
1537 .data
= &(struct clk_regmap_gate_data
){
1538 .offset
= HHI_VPU_CLK_CNTL
,
1541 .hw
.init
= &(struct clk_init_data
) {
1543 .ops
= &clk_regmap_gate_ops
,
1544 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vpu_0_div
.hw
},
1546 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1550 static struct clk_regmap gxbb_vpu_1_sel
= {
1551 .data
= &(struct clk_regmap_mux_data
){
1552 .offset
= HHI_VPU_CLK_CNTL
,
1556 .hw
.init
= &(struct clk_init_data
){
1557 .name
= "vpu_1_sel",
1558 .ops
= &clk_regmap_mux_ops
,
1560 * bits 25:26 selects from 4 possible parents:
1561 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1563 .parent_hws
= gxbb_vpu_parent_hws
,
1564 .num_parents
= ARRAY_SIZE(gxbb_vpu_parent_hws
),
1565 .flags
= CLK_SET_RATE_NO_REPARENT
,
1569 static struct clk_regmap gxbb_vpu_1_div
= {
1570 .data
= &(struct clk_regmap_div_data
){
1571 .offset
= HHI_VPU_CLK_CNTL
,
1575 .hw
.init
= &(struct clk_init_data
){
1576 .name
= "vpu_1_div",
1577 .ops
= &clk_regmap_divider_ops
,
1578 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vpu_1_sel
.hw
},
1580 .flags
= CLK_SET_RATE_PARENT
,
1584 static struct clk_regmap gxbb_vpu_1
= {
1585 .data
= &(struct clk_regmap_gate_data
){
1586 .offset
= HHI_VPU_CLK_CNTL
,
1589 .hw
.init
= &(struct clk_init_data
) {
1591 .ops
= &clk_regmap_gate_ops
,
1592 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vpu_1_div
.hw
},
1594 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1598 static struct clk_regmap gxbb_vpu
= {
1599 .data
= &(struct clk_regmap_mux_data
){
1600 .offset
= HHI_VPU_CLK_CNTL
,
1604 .hw
.init
= &(struct clk_init_data
){
1606 .ops
= &clk_regmap_mux_ops
,
1608 * bit 31 selects from 2 possible parents:
1611 .parent_hws
= (const struct clk_hw
*[]) {
1616 .flags
= CLK_SET_RATE_NO_REPARENT
,
1622 static const struct clk_hw
*gxbb_vapb_parent_hws
[] = {
1629 static struct clk_regmap gxbb_vapb_0_sel
= {
1630 .data
= &(struct clk_regmap_mux_data
){
1631 .offset
= HHI_VAPBCLK_CNTL
,
1635 .hw
.init
= &(struct clk_init_data
){
1636 .name
= "vapb_0_sel",
1637 .ops
= &clk_regmap_mux_ops
,
1639 * bits 9:10 selects from 4 possible parents:
1640 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1642 .parent_hws
= gxbb_vapb_parent_hws
,
1643 .num_parents
= ARRAY_SIZE(gxbb_vapb_parent_hws
),
1644 .flags
= CLK_SET_RATE_NO_REPARENT
,
1648 static struct clk_regmap gxbb_vapb_0_div
= {
1649 .data
= &(struct clk_regmap_div_data
){
1650 .offset
= HHI_VAPBCLK_CNTL
,
1654 .hw
.init
= &(struct clk_init_data
){
1655 .name
= "vapb_0_div",
1656 .ops
= &clk_regmap_divider_ops
,
1657 .parent_hws
= (const struct clk_hw
*[]) {
1661 .flags
= CLK_SET_RATE_PARENT
,
1665 static struct clk_regmap gxbb_vapb_0
= {
1666 .data
= &(struct clk_regmap_gate_data
){
1667 .offset
= HHI_VAPBCLK_CNTL
,
1670 .hw
.init
= &(struct clk_init_data
) {
1672 .ops
= &clk_regmap_gate_ops
,
1673 .parent_hws
= (const struct clk_hw
*[]) {
1677 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1681 static struct clk_regmap gxbb_vapb_1_sel
= {
1682 .data
= &(struct clk_regmap_mux_data
){
1683 .offset
= HHI_VAPBCLK_CNTL
,
1687 .hw
.init
= &(struct clk_init_data
){
1688 .name
= "vapb_1_sel",
1689 .ops
= &clk_regmap_mux_ops
,
1691 * bits 25:26 selects from 4 possible parents:
1692 * fclk_div4, fclk_div3, fclk_div5, fclk_div7,
1694 .parent_hws
= gxbb_vapb_parent_hws
,
1695 .num_parents
= ARRAY_SIZE(gxbb_vapb_parent_hws
),
1696 .flags
= CLK_SET_RATE_NO_REPARENT
,
1700 static struct clk_regmap gxbb_vapb_1_div
= {
1701 .data
= &(struct clk_regmap_div_data
){
1702 .offset
= HHI_VAPBCLK_CNTL
,
1706 .hw
.init
= &(struct clk_init_data
){
1707 .name
= "vapb_1_div",
1708 .ops
= &clk_regmap_divider_ops
,
1709 .parent_hws
= (const struct clk_hw
*[]) {
1713 .flags
= CLK_SET_RATE_PARENT
,
1717 static struct clk_regmap gxbb_vapb_1
= {
1718 .data
= &(struct clk_regmap_gate_data
){
1719 .offset
= HHI_VAPBCLK_CNTL
,
1722 .hw
.init
= &(struct clk_init_data
) {
1724 .ops
= &clk_regmap_gate_ops
,
1725 .parent_hws
= (const struct clk_hw
*[]) {
1729 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1733 static struct clk_regmap gxbb_vapb_sel
= {
1734 .data
= &(struct clk_regmap_mux_data
){
1735 .offset
= HHI_VAPBCLK_CNTL
,
1739 .hw
.init
= &(struct clk_init_data
){
1741 .ops
= &clk_regmap_mux_ops
,
1743 * bit 31 selects from 2 possible parents:
1746 .parent_hws
= (const struct clk_hw
*[]) {
1751 .flags
= CLK_SET_RATE_NO_REPARENT
,
1755 static struct clk_regmap gxbb_vapb
= {
1756 .data
= &(struct clk_regmap_gate_data
){
1757 .offset
= HHI_VAPBCLK_CNTL
,
1760 .hw
.init
= &(struct clk_init_data
) {
1762 .ops
= &clk_regmap_gate_ops
,
1763 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vapb_sel
.hw
},
1765 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1771 static struct clk_regmap gxbb_vid_pll_div
= {
1772 .data
= &(struct meson_vid_pll_div_data
){
1774 .reg_off
= HHI_VID_PLL_CLK_DIV
,
1779 .reg_off
= HHI_VID_PLL_CLK_DIV
,
1784 .hw
.init
= &(struct clk_init_data
) {
1785 .name
= "vid_pll_div",
1786 .ops
= &meson_vid_pll_div_ro_ops
,
1787 .parent_data
= &(const struct clk_parent_data
) {
1790 * GXL and GXBB have different hdmi_plls (with
1791 * different struct clk_hw). We fallback to the global
1792 * naming string mechanism so vid_pll_div picks up the
1799 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
1803 static const struct clk_parent_data gxbb_vid_pll_parent_data
[] = {
1804 { .hw
= &gxbb_vid_pll_div
.hw
},
1807 * GXL and GXBB have different hdmi_plls (with
1808 * different struct clk_hw). We fallback to the global
1809 * naming string mechanism so vid_pll_div picks up the
1812 { .name
= "hdmi_pll", .index
= -1 },
1815 static struct clk_regmap gxbb_vid_pll_sel
= {
1816 .data
= &(struct clk_regmap_mux_data
){
1817 .offset
= HHI_VID_PLL_CLK_DIV
,
1821 .hw
.init
= &(struct clk_init_data
){
1822 .name
= "vid_pll_sel",
1823 .ops
= &clk_regmap_mux_ops
,
1825 * bit 18 selects from 2 possible parents:
1826 * vid_pll_div or hdmi_pll
1828 .parent_data
= gxbb_vid_pll_parent_data
,
1829 .num_parents
= ARRAY_SIZE(gxbb_vid_pll_parent_data
),
1830 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
1834 static struct clk_regmap gxbb_vid_pll
= {
1835 .data
= &(struct clk_regmap_gate_data
){
1836 .offset
= HHI_VID_PLL_CLK_DIV
,
1839 .hw
.init
= &(struct clk_init_data
) {
1841 .ops
= &clk_regmap_gate_ops
,
1842 .parent_hws
= (const struct clk_hw
*[]) {
1843 &gxbb_vid_pll_sel
.hw
1846 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1850 static const struct clk_hw
*gxbb_vclk_parent_hws
[] = {
1860 static struct clk_regmap gxbb_vclk_sel
= {
1861 .data
= &(struct clk_regmap_mux_data
){
1862 .offset
= HHI_VID_CLK_CNTL
,
1866 .hw
.init
= &(struct clk_init_data
){
1868 .ops
= &clk_regmap_mux_ops
,
1870 * bits 16:18 selects from 8 possible parents:
1871 * vid_pll, fclk_div4, fclk_div3, fclk_div5,
1872 * vid_pll, fclk_div7, mp1
1874 .parent_hws
= gxbb_vclk_parent_hws
,
1875 .num_parents
= ARRAY_SIZE(gxbb_vclk_parent_hws
),
1876 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
1880 static struct clk_regmap gxbb_vclk2_sel
= {
1881 .data
= &(struct clk_regmap_mux_data
){
1882 .offset
= HHI_VIID_CLK_CNTL
,
1886 .hw
.init
= &(struct clk_init_data
){
1887 .name
= "vclk2_sel",
1888 .ops
= &clk_regmap_mux_ops
,
1890 * bits 16:18 selects from 8 possible parents:
1891 * vid_pll, fclk_div4, fclk_div3, fclk_div5,
1892 * vid_pll, fclk_div7, mp1
1894 .parent_hws
= gxbb_vclk_parent_hws
,
1895 .num_parents
= ARRAY_SIZE(gxbb_vclk_parent_hws
),
1896 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
1900 static struct clk_regmap gxbb_vclk_input
= {
1901 .data
= &(struct clk_regmap_gate_data
){
1902 .offset
= HHI_VID_CLK_DIV
,
1905 .hw
.init
= &(struct clk_init_data
) {
1906 .name
= "vclk_input",
1907 .ops
= &clk_regmap_gate_ops
,
1908 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk_sel
.hw
},
1910 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1914 static struct clk_regmap gxbb_vclk2_input
= {
1915 .data
= &(struct clk_regmap_gate_data
){
1916 .offset
= HHI_VIID_CLK_DIV
,
1919 .hw
.init
= &(struct clk_init_data
) {
1920 .name
= "vclk2_input",
1921 .ops
= &clk_regmap_gate_ops
,
1922 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2_sel
.hw
},
1924 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1928 static struct clk_regmap gxbb_vclk_div
= {
1929 .data
= &(struct clk_regmap_div_data
){
1930 .offset
= HHI_VID_CLK_DIV
,
1934 .hw
.init
= &(struct clk_init_data
){
1936 .ops
= &clk_regmap_divider_ops
,
1937 .parent_hws
= (const struct clk_hw
*[]) {
1941 .flags
= CLK_GET_RATE_NOCACHE
,
1945 static struct clk_regmap gxbb_vclk2_div
= {
1946 .data
= &(struct clk_regmap_div_data
){
1947 .offset
= HHI_VIID_CLK_DIV
,
1951 .hw
.init
= &(struct clk_init_data
){
1952 .name
= "vclk2_div",
1953 .ops
= &clk_regmap_divider_ops
,
1954 .parent_hws
= (const struct clk_hw
*[]) {
1955 &gxbb_vclk2_input
.hw
1958 .flags
= CLK_GET_RATE_NOCACHE
,
1962 static struct clk_regmap gxbb_vclk
= {
1963 .data
= &(struct clk_regmap_gate_data
){
1964 .offset
= HHI_VID_CLK_CNTL
,
1967 .hw
.init
= &(struct clk_init_data
) {
1969 .ops
= &clk_regmap_gate_ops
,
1970 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk_div
.hw
},
1972 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1976 static struct clk_regmap gxbb_vclk2
= {
1977 .data
= &(struct clk_regmap_gate_data
){
1978 .offset
= HHI_VIID_CLK_CNTL
,
1981 .hw
.init
= &(struct clk_init_data
) {
1983 .ops
= &clk_regmap_gate_ops
,
1984 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2_div
.hw
},
1986 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
1990 static struct clk_regmap gxbb_vclk_div1
= {
1991 .data
= &(struct clk_regmap_gate_data
){
1992 .offset
= HHI_VID_CLK_CNTL
,
1995 .hw
.init
= &(struct clk_init_data
) {
1996 .name
= "vclk_div1",
1997 .ops
= &clk_regmap_gate_ops
,
1998 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
2000 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2004 static struct clk_regmap gxbb_vclk_div2_en
= {
2005 .data
= &(struct clk_regmap_gate_data
){
2006 .offset
= HHI_VID_CLK_CNTL
,
2009 .hw
.init
= &(struct clk_init_data
) {
2010 .name
= "vclk_div2_en",
2011 .ops
= &clk_regmap_gate_ops
,
2012 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
2014 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2018 static struct clk_regmap gxbb_vclk_div4_en
= {
2019 .data
= &(struct clk_regmap_gate_data
){
2020 .offset
= HHI_VID_CLK_CNTL
,
2023 .hw
.init
= &(struct clk_init_data
) {
2024 .name
= "vclk_div4_en",
2025 .ops
= &clk_regmap_gate_ops
,
2026 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
2028 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2032 static struct clk_regmap gxbb_vclk_div6_en
= {
2033 .data
= &(struct clk_regmap_gate_data
){
2034 .offset
= HHI_VID_CLK_CNTL
,
2037 .hw
.init
= &(struct clk_init_data
) {
2038 .name
= "vclk_div6_en",
2039 .ops
= &clk_regmap_gate_ops
,
2040 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
2042 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2046 static struct clk_regmap gxbb_vclk_div12_en
= {
2047 .data
= &(struct clk_regmap_gate_data
){
2048 .offset
= HHI_VID_CLK_CNTL
,
2051 .hw
.init
= &(struct clk_init_data
) {
2052 .name
= "vclk_div12_en",
2053 .ops
= &clk_regmap_gate_ops
,
2054 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk
.hw
},
2056 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2060 static struct clk_regmap gxbb_vclk2_div1
= {
2061 .data
= &(struct clk_regmap_gate_data
){
2062 .offset
= HHI_VIID_CLK_CNTL
,
2065 .hw
.init
= &(struct clk_init_data
) {
2066 .name
= "vclk2_div1",
2067 .ops
= &clk_regmap_gate_ops
,
2068 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2070 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2074 static struct clk_regmap gxbb_vclk2_div2_en
= {
2075 .data
= &(struct clk_regmap_gate_data
){
2076 .offset
= HHI_VIID_CLK_CNTL
,
2079 .hw
.init
= &(struct clk_init_data
) {
2080 .name
= "vclk2_div2_en",
2081 .ops
= &clk_regmap_gate_ops
,
2082 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2084 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2088 static struct clk_regmap gxbb_vclk2_div4_en
= {
2089 .data
= &(struct clk_regmap_gate_data
){
2090 .offset
= HHI_VIID_CLK_CNTL
,
2093 .hw
.init
= &(struct clk_init_data
) {
2094 .name
= "vclk2_div4_en",
2095 .ops
= &clk_regmap_gate_ops
,
2096 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2098 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2102 static struct clk_regmap gxbb_vclk2_div6_en
= {
2103 .data
= &(struct clk_regmap_gate_data
){
2104 .offset
= HHI_VIID_CLK_CNTL
,
2107 .hw
.init
= &(struct clk_init_data
) {
2108 .name
= "vclk2_div6_en",
2109 .ops
= &clk_regmap_gate_ops
,
2110 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2112 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2116 static struct clk_regmap gxbb_vclk2_div12_en
= {
2117 .data
= &(struct clk_regmap_gate_data
){
2118 .offset
= HHI_VIID_CLK_CNTL
,
2121 .hw
.init
= &(struct clk_init_data
) {
2122 .name
= "vclk2_div12_en",
2123 .ops
= &clk_regmap_gate_ops
,
2124 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_vclk2
.hw
},
2126 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2130 static struct clk_fixed_factor gxbb_vclk_div2
= {
2133 .hw
.init
= &(struct clk_init_data
){
2134 .name
= "vclk_div2",
2135 .ops
= &clk_fixed_factor_ops
,
2136 .parent_hws
= (const struct clk_hw
*[]) {
2137 &gxbb_vclk_div2_en
.hw
2143 static struct clk_fixed_factor gxbb_vclk_div4
= {
2146 .hw
.init
= &(struct clk_init_data
){
2147 .name
= "vclk_div4",
2148 .ops
= &clk_fixed_factor_ops
,
2149 .parent_hws
= (const struct clk_hw
*[]) {
2150 &gxbb_vclk_div4_en
.hw
2156 static struct clk_fixed_factor gxbb_vclk_div6
= {
2159 .hw
.init
= &(struct clk_init_data
){
2160 .name
= "vclk_div6",
2161 .ops
= &clk_fixed_factor_ops
,
2162 .parent_hws
= (const struct clk_hw
*[]) {
2163 &gxbb_vclk_div6_en
.hw
2169 static struct clk_fixed_factor gxbb_vclk_div12
= {
2172 .hw
.init
= &(struct clk_init_data
){
2173 .name
= "vclk_div12",
2174 .ops
= &clk_fixed_factor_ops
,
2175 .parent_hws
= (const struct clk_hw
*[]) {
2176 &gxbb_vclk_div12_en
.hw
2182 static struct clk_fixed_factor gxbb_vclk2_div2
= {
2185 .hw
.init
= &(struct clk_init_data
){
2186 .name
= "vclk2_div2",
2187 .ops
= &clk_fixed_factor_ops
,
2188 .parent_hws
= (const struct clk_hw
*[]) {
2189 &gxbb_vclk2_div2_en
.hw
2195 static struct clk_fixed_factor gxbb_vclk2_div4
= {
2198 .hw
.init
= &(struct clk_init_data
){
2199 .name
= "vclk2_div4",
2200 .ops
= &clk_fixed_factor_ops
,
2201 .parent_hws
= (const struct clk_hw
*[]) {
2202 &gxbb_vclk2_div4_en
.hw
2208 static struct clk_fixed_factor gxbb_vclk2_div6
= {
2211 .hw
.init
= &(struct clk_init_data
){
2212 .name
= "vclk2_div6",
2213 .ops
= &clk_fixed_factor_ops
,
2214 .parent_hws
= (const struct clk_hw
*[]) {
2215 &gxbb_vclk2_div6_en
.hw
2221 static struct clk_fixed_factor gxbb_vclk2_div12
= {
2224 .hw
.init
= &(struct clk_init_data
){
2225 .name
= "vclk2_div12",
2226 .ops
= &clk_fixed_factor_ops
,
2227 .parent_hws
= (const struct clk_hw
*[]) {
2228 &gxbb_vclk2_div12_en
.hw
2234 static u32 mux_table_cts_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
2235 static const struct clk_hw
*gxbb_cts_parent_hws
[] = {
2240 &gxbb_vclk_div12
.hw
,
2241 &gxbb_vclk2_div1
.hw
,
2242 &gxbb_vclk2_div2
.hw
,
2243 &gxbb_vclk2_div4
.hw
,
2244 &gxbb_vclk2_div6
.hw
,
2245 &gxbb_vclk2_div12
.hw
,
2248 static struct clk_regmap gxbb_cts_enci_sel
= {
2249 .data
= &(struct clk_regmap_mux_data
){
2250 .offset
= HHI_VID_CLK_DIV
,
2253 .table
= mux_table_cts_sel
,
2255 .hw
.init
= &(struct clk_init_data
){
2256 .name
= "cts_enci_sel",
2257 .ops
= &clk_regmap_mux_ops
,
2258 .parent_hws
= gxbb_cts_parent_hws
,
2259 .num_parents
= ARRAY_SIZE(gxbb_cts_parent_hws
),
2260 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2264 static struct clk_regmap gxbb_cts_encp_sel
= {
2265 .data
= &(struct clk_regmap_mux_data
){
2266 .offset
= HHI_VID_CLK_DIV
,
2269 .table
= mux_table_cts_sel
,
2271 .hw
.init
= &(struct clk_init_data
){
2272 .name
= "cts_encp_sel",
2273 .ops
= &clk_regmap_mux_ops
,
2274 .parent_hws
= gxbb_cts_parent_hws
,
2275 .num_parents
= ARRAY_SIZE(gxbb_cts_parent_hws
),
2276 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2280 static struct clk_regmap gxbb_cts_vdac_sel
= {
2281 .data
= &(struct clk_regmap_mux_data
){
2282 .offset
= HHI_VIID_CLK_DIV
,
2285 .table
= mux_table_cts_sel
,
2287 .hw
.init
= &(struct clk_init_data
){
2288 .name
= "cts_vdac_sel",
2289 .ops
= &clk_regmap_mux_ops
,
2290 .parent_hws
= gxbb_cts_parent_hws
,
2291 .num_parents
= ARRAY_SIZE(gxbb_cts_parent_hws
),
2292 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2296 /* TOFIX: add support for cts_tcon */
2297 static u32 mux_table_hdmi_tx_sel
[] = { 0, 1, 2, 3, 4, 8, 9, 10, 11, 12 };
2298 static const struct clk_hw
*gxbb_cts_hdmi_tx_parent_hws
[] = {
2303 &gxbb_vclk_div12
.hw
,
2304 &gxbb_vclk2_div1
.hw
,
2305 &gxbb_vclk2_div2
.hw
,
2306 &gxbb_vclk2_div4
.hw
,
2307 &gxbb_vclk2_div6
.hw
,
2308 &gxbb_vclk2_div12
.hw
,
2311 static struct clk_regmap gxbb_hdmi_tx_sel
= {
2312 .data
= &(struct clk_regmap_mux_data
){
2313 .offset
= HHI_HDMI_CLK_CNTL
,
2316 .table
= mux_table_hdmi_tx_sel
,
2318 .hw
.init
= &(struct clk_init_data
){
2319 .name
= "hdmi_tx_sel",
2320 .ops
= &clk_regmap_mux_ops
,
2322 * bits 31:28 selects from 12 possible parents:
2323 * vclk_div1, vclk_div2, vclk_div4, vclk_div6, vclk_div12
2324 * vclk2_div1, vclk2_div2, vclk2_div4, vclk2_div6, vclk2_div12,
2327 .parent_hws
= gxbb_cts_hdmi_tx_parent_hws
,
2328 .num_parents
= ARRAY_SIZE(gxbb_cts_hdmi_tx_parent_hws
),
2329 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2333 static struct clk_regmap gxbb_cts_enci
= {
2334 .data
= &(struct clk_regmap_gate_data
){
2335 .offset
= HHI_VID_CLK_CNTL2
,
2338 .hw
.init
= &(struct clk_init_data
) {
2340 .ops
= &clk_regmap_gate_ops
,
2341 .parent_hws
= (const struct clk_hw
*[]) {
2342 &gxbb_cts_enci_sel
.hw
2345 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2349 static struct clk_regmap gxbb_cts_encp
= {
2350 .data
= &(struct clk_regmap_gate_data
){
2351 .offset
= HHI_VID_CLK_CNTL2
,
2354 .hw
.init
= &(struct clk_init_data
) {
2356 .ops
= &clk_regmap_gate_ops
,
2357 .parent_hws
= (const struct clk_hw
*[]) {
2358 &gxbb_cts_encp_sel
.hw
2361 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2365 static struct clk_regmap gxbb_cts_vdac
= {
2366 .data
= &(struct clk_regmap_gate_data
){
2367 .offset
= HHI_VID_CLK_CNTL2
,
2370 .hw
.init
= &(struct clk_init_data
) {
2372 .ops
= &clk_regmap_gate_ops
,
2373 .parent_hws
= (const struct clk_hw
*[]) {
2374 &gxbb_cts_vdac_sel
.hw
2377 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2381 static struct clk_regmap gxbb_hdmi_tx
= {
2382 .data
= &(struct clk_regmap_gate_data
){
2383 .offset
= HHI_VID_CLK_CNTL2
,
2386 .hw
.init
= &(struct clk_init_data
) {
2388 .ops
= &clk_regmap_gate_ops
,
2389 .parent_hws
= (const struct clk_hw
*[]) {
2390 &gxbb_hdmi_tx_sel
.hw
2393 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2399 static const struct clk_parent_data gxbb_hdmi_parent_data
[] = {
2400 { .fw_name
= "xtal", },
2401 { .hw
= &gxbb_fclk_div4
.hw
},
2402 { .hw
= &gxbb_fclk_div3
.hw
},
2403 { .hw
= &gxbb_fclk_div5
.hw
},
2406 static struct clk_regmap gxbb_hdmi_sel
= {
2407 .data
= &(struct clk_regmap_mux_data
){
2408 .offset
= HHI_HDMI_CLK_CNTL
,
2411 .flags
= CLK_MUX_ROUND_CLOSEST
,
2413 .hw
.init
= &(struct clk_init_data
){
2415 .ops
= &clk_regmap_mux_ops
,
2416 .parent_data
= gxbb_hdmi_parent_data
,
2417 .num_parents
= ARRAY_SIZE(gxbb_hdmi_parent_data
),
2418 .flags
= CLK_SET_RATE_NO_REPARENT
| CLK_GET_RATE_NOCACHE
,
2422 static struct clk_regmap gxbb_hdmi_div
= {
2423 .data
= &(struct clk_regmap_div_data
){
2424 .offset
= HHI_HDMI_CLK_CNTL
,
2428 .hw
.init
= &(struct clk_init_data
){
2430 .ops
= &clk_regmap_divider_ops
,
2431 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_hdmi_sel
.hw
},
2433 .flags
= CLK_GET_RATE_NOCACHE
,
2437 static struct clk_regmap gxbb_hdmi
= {
2438 .data
= &(struct clk_regmap_gate_data
){
2439 .offset
= HHI_HDMI_CLK_CNTL
,
2442 .hw
.init
= &(struct clk_init_data
) {
2444 .ops
= &clk_regmap_gate_ops
,
2445 .parent_hws
= (const struct clk_hw
*[]) { &gxbb_hdmi_div
.hw
},
2447 .flags
= CLK_SET_RATE_PARENT
| CLK_IGNORE_UNUSED
,
2453 static const struct clk_hw
*gxbb_vdec_parent_hws
[] = {
2460 static struct clk_regmap gxbb_vdec_1_sel
= {
2461 .data
= &(struct clk_regmap_mux_data
){
2462 .offset
= HHI_VDEC_CLK_CNTL
,
2465 .flags
= CLK_MUX_ROUND_CLOSEST
,
2467 .hw
.init
= &(struct clk_init_data
){
2468 .name
= "vdec_1_sel",
2469 .ops
= &clk_regmap_mux_ops
,
2470 .parent_hws
= gxbb_vdec_parent_hws
,
2471 .num_parents
= ARRAY_SIZE(gxbb_vdec_parent_hws
),
2472 .flags
= CLK_SET_RATE_PARENT
,
2476 static struct clk_regmap gxbb_vdec_1_div
= {
2477 .data
= &(struct clk_regmap_div_data
){
2478 .offset
= HHI_VDEC_CLK_CNTL
,
2481 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2483 .hw
.init
= &(struct clk_init_data
){
2484 .name
= "vdec_1_div",
2485 .ops
= &clk_regmap_divider_ops
,
2486 .parent_hws
= (const struct clk_hw
*[]) {
2490 .flags
= CLK_SET_RATE_PARENT
,
2494 static struct clk_regmap gxbb_vdec_1
= {
2495 .data
= &(struct clk_regmap_gate_data
){
2496 .offset
= HHI_VDEC_CLK_CNTL
,
2499 .hw
.init
= &(struct clk_init_data
) {
2501 .ops
= &clk_regmap_gate_ops
,
2502 .parent_hws
= (const struct clk_hw
*[]) {
2506 .flags
= CLK_SET_RATE_PARENT
,
2510 static struct clk_regmap gxbb_vdec_hevc_sel
= {
2511 .data
= &(struct clk_regmap_mux_data
){
2512 .offset
= HHI_VDEC2_CLK_CNTL
,
2515 .flags
= CLK_MUX_ROUND_CLOSEST
,
2517 .hw
.init
= &(struct clk_init_data
){
2518 .name
= "vdec_hevc_sel",
2519 .ops
= &clk_regmap_mux_ops
,
2520 .parent_hws
= gxbb_vdec_parent_hws
,
2521 .num_parents
= ARRAY_SIZE(gxbb_vdec_parent_hws
),
2522 .flags
= CLK_SET_RATE_PARENT
,
2526 static struct clk_regmap gxbb_vdec_hevc_div
= {
2527 .data
= &(struct clk_regmap_div_data
){
2528 .offset
= HHI_VDEC2_CLK_CNTL
,
2531 .flags
= CLK_DIVIDER_ROUND_CLOSEST
,
2533 .hw
.init
= &(struct clk_init_data
){
2534 .name
= "vdec_hevc_div",
2535 .ops
= &clk_regmap_divider_ops
,
2536 .parent_hws
= (const struct clk_hw
*[]) {
2537 &gxbb_vdec_hevc_sel
.hw
2540 .flags
= CLK_SET_RATE_PARENT
,
2544 static struct clk_regmap gxbb_vdec_hevc
= {
2545 .data
= &(struct clk_regmap_gate_data
){
2546 .offset
= HHI_VDEC2_CLK_CNTL
,
2549 .hw
.init
= &(struct clk_init_data
) {
2550 .name
= "vdec_hevc",
2551 .ops
= &clk_regmap_gate_ops
,
2552 .parent_hws
= (const struct clk_hw
*[]) {
2553 &gxbb_vdec_hevc_div
.hw
2556 .flags
= CLK_SET_RATE_PARENT
,
2560 static u32 mux_table_gen_clk
[] = { 0, 4, 5, 6, 7, 8,
2561 9, 10, 11, 13, 14, };
2562 static const struct clk_parent_data gen_clk_parent_data
[] = {
2563 { .fw_name
= "xtal", },
2564 { .hw
= &gxbb_vdec_1
.hw
},
2565 { .hw
= &gxbb_vdec_hevc
.hw
},
2566 { .hw
= &gxbb_mpll0
.hw
},
2567 { .hw
= &gxbb_mpll1
.hw
},
2568 { .hw
= &gxbb_mpll2
.hw
},
2569 { .hw
= &gxbb_fclk_div4
.hw
},
2570 { .hw
= &gxbb_fclk_div3
.hw
},
2571 { .hw
= &gxbb_fclk_div5
.hw
},
2572 { .hw
= &gxbb_fclk_div7
.hw
},
2573 { .hw
= &gxbb_gp0_pll
.hw
},
2576 static struct clk_regmap gxbb_gen_clk_sel
= {
2577 .data
= &(struct clk_regmap_mux_data
){
2578 .offset
= HHI_GEN_CLK_CNTL
,
2581 .table
= mux_table_gen_clk
,
2583 .hw
.init
= &(struct clk_init_data
){
2584 .name
= "gen_clk_sel",
2585 .ops
= &clk_regmap_mux_ops
,
2587 * bits 15:12 selects from 14 possible parents:
2588 * xtal, [rtc_oscin_i], [sys_cpu_div16], [ddr_dpll_pt],
2589 * vid_pll, vid2_pll (hevc), mpll0, mpll1, mpll2, fdiv4,
2590 * fdiv3, fdiv5, [cts_msr_clk], fdiv7, gp0_pll
2592 .parent_data
= gen_clk_parent_data
,
2593 .num_parents
= ARRAY_SIZE(gen_clk_parent_data
),
2597 static struct clk_regmap gxbb_gen_clk_div
= {
2598 .data
= &(struct clk_regmap_div_data
){
2599 .offset
= HHI_GEN_CLK_CNTL
,
2603 .hw
.init
= &(struct clk_init_data
){
2604 .name
= "gen_clk_div",
2605 .ops
= &clk_regmap_divider_ops
,
2606 .parent_hws
= (const struct clk_hw
*[]) {
2607 &gxbb_gen_clk_sel
.hw
2610 .flags
= CLK_SET_RATE_PARENT
,
2614 static struct clk_regmap gxbb_gen_clk
= {
2615 .data
= &(struct clk_regmap_gate_data
){
2616 .offset
= HHI_GEN_CLK_CNTL
,
2619 .hw
.init
= &(struct clk_init_data
){
2621 .ops
= &clk_regmap_gate_ops
,
2622 .parent_hws
= (const struct clk_hw
*[]) {
2623 &gxbb_gen_clk_div
.hw
2626 .flags
= CLK_SET_RATE_PARENT
,
2630 #define MESON_GATE(_name, _reg, _bit) \
2631 MESON_PCLK(_name, _reg, _bit, &gxbb_clk81.hw)
2633 /* Everything Else (EE) domain gates */
2634 static MESON_GATE(gxbb_ddr
, HHI_GCLK_MPEG0
, 0);
2635 static MESON_GATE(gxbb_dos
, HHI_GCLK_MPEG0
, 1);
2636 static MESON_GATE(gxbb_isa
, HHI_GCLK_MPEG0
, 5);
2637 static MESON_GATE(gxbb_pl301
, HHI_GCLK_MPEG0
, 6);
2638 static MESON_GATE(gxbb_periphs
, HHI_GCLK_MPEG0
, 7);
2639 static MESON_GATE(gxbb_spicc
, HHI_GCLK_MPEG0
, 8);
2640 static MESON_GATE(gxbb_i2c
, HHI_GCLK_MPEG0
, 9);
2641 static MESON_GATE(gxbb_sana
, HHI_GCLK_MPEG0
, 10);
2642 static MESON_GATE(gxbb_smart_card
, HHI_GCLK_MPEG0
, 11);
2643 static MESON_GATE(gxbb_rng0
, HHI_GCLK_MPEG0
, 12);
2644 static MESON_GATE(gxbb_uart0
, HHI_GCLK_MPEG0
, 13);
2645 static MESON_GATE(gxbb_sdhc
, HHI_GCLK_MPEG0
, 14);
2646 static MESON_GATE(gxbb_stream
, HHI_GCLK_MPEG0
, 15);
2647 static MESON_GATE(gxbb_async_fifo
, HHI_GCLK_MPEG0
, 16);
2648 static MESON_GATE(gxbb_sdio
, HHI_GCLK_MPEG0
, 17);
2649 static MESON_GATE(gxbb_abuf
, HHI_GCLK_MPEG0
, 18);
2650 static MESON_GATE(gxbb_hiu_iface
, HHI_GCLK_MPEG0
, 19);
2651 static MESON_GATE(gxbb_assist_misc
, HHI_GCLK_MPEG0
, 23);
2652 static MESON_GATE(gxbb_emmc_a
, HHI_GCLK_MPEG0
, 24);
2653 static MESON_GATE(gxbb_emmc_b
, HHI_GCLK_MPEG0
, 25);
2654 static MESON_GATE(gxbb_emmc_c
, HHI_GCLK_MPEG0
, 26);
2655 static MESON_GATE(gxl_acodec
, HHI_GCLK_MPEG0
, 28);
2656 static MESON_GATE(gxbb_spi
, HHI_GCLK_MPEG0
, 30);
2658 static MESON_GATE(gxbb_i2s_spdif
, HHI_GCLK_MPEG1
, 2);
2659 static MESON_GATE(gxbb_eth
, HHI_GCLK_MPEG1
, 3);
2660 static MESON_GATE(gxbb_demux
, HHI_GCLK_MPEG1
, 4);
2661 static MESON_GATE(gxbb_blkmv
, HHI_GCLK_MPEG1
, 14);
2662 static MESON_GATE(gxbb_aiu
, HHI_GCLK_MPEG1
, 15);
2663 static MESON_GATE(gxbb_uart1
, HHI_GCLK_MPEG1
, 16);
2664 static MESON_GATE(gxbb_g2d
, HHI_GCLK_MPEG1
, 20);
2665 static MESON_GATE(gxbb_usb0
, HHI_GCLK_MPEG1
, 21);
2666 static MESON_GATE(gxbb_usb1
, HHI_GCLK_MPEG1
, 22);
2667 static MESON_GATE(gxbb_reset
, HHI_GCLK_MPEG1
, 23);
2668 static MESON_GATE(gxbb_nand
, HHI_GCLK_MPEG1
, 24);
2669 static MESON_GATE(gxbb_dos_parser
, HHI_GCLK_MPEG1
, 25);
2670 static MESON_GATE(gxbb_usb
, HHI_GCLK_MPEG1
, 26);
2671 static MESON_GATE(gxbb_vdin1
, HHI_GCLK_MPEG1
, 28);
2672 static MESON_GATE(gxbb_ahb_arb0
, HHI_GCLK_MPEG1
, 29);
2673 static MESON_GATE(gxbb_efuse
, HHI_GCLK_MPEG1
, 30);
2674 static MESON_GATE(gxbb_boot_rom
, HHI_GCLK_MPEG1
, 31);
2676 static MESON_GATE(gxbb_ahb_data_bus
, HHI_GCLK_MPEG2
, 1);
2677 static MESON_GATE(gxbb_ahb_ctrl_bus
, HHI_GCLK_MPEG2
, 2);
2678 static MESON_GATE(gxbb_hdmi_intr_sync
, HHI_GCLK_MPEG2
, 3);
2679 static MESON_GATE(gxbb_hdmi_pclk
, HHI_GCLK_MPEG2
, 4);
2680 static MESON_GATE(gxbb_usb1_ddr_bridge
, HHI_GCLK_MPEG2
, 8);
2681 static MESON_GATE(gxbb_usb0_ddr_bridge
, HHI_GCLK_MPEG2
, 9);
2682 static MESON_GATE(gxbb_mmc_pclk
, HHI_GCLK_MPEG2
, 11);
2683 static MESON_GATE(gxbb_dvin
, HHI_GCLK_MPEG2
, 12);
2684 static MESON_GATE(gxbb_uart2
, HHI_GCLK_MPEG2
, 15);
2685 static MESON_GATE(gxbb_sar_adc
, HHI_GCLK_MPEG2
, 22);
2686 static MESON_GATE(gxbb_vpu_intr
, HHI_GCLK_MPEG2
, 25);
2687 static MESON_GATE(gxbb_sec_ahb_ahb3_bridge
, HHI_GCLK_MPEG2
, 26);
2688 static MESON_GATE(gxbb_clk81_a53
, HHI_GCLK_MPEG2
, 29);
2690 static MESON_GATE(gxbb_vclk2_venci0
, HHI_GCLK_OTHER
, 1);
2691 static MESON_GATE(gxbb_vclk2_venci1
, HHI_GCLK_OTHER
, 2);
2692 static MESON_GATE(gxbb_vclk2_vencp0
, HHI_GCLK_OTHER
, 3);
2693 static MESON_GATE(gxbb_vclk2_vencp1
, HHI_GCLK_OTHER
, 4);
2694 static MESON_GATE(gxbb_gclk_venci_int0
, HHI_GCLK_OTHER
, 8);
2695 static MESON_GATE(gxbb_gclk_vencp_int
, HHI_GCLK_OTHER
, 9);
2696 static MESON_GATE(gxbb_dac_clk
, HHI_GCLK_OTHER
, 10);
2697 static MESON_GATE(gxbb_aoclk_gate
, HHI_GCLK_OTHER
, 14);
2698 static MESON_GATE(gxbb_iec958_gate
, HHI_GCLK_OTHER
, 16);
2699 static MESON_GATE(gxbb_enc480p
, HHI_GCLK_OTHER
, 20);
2700 static MESON_GATE(gxbb_rng1
, HHI_GCLK_OTHER
, 21);
2701 static MESON_GATE(gxbb_gclk_venci_int1
, HHI_GCLK_OTHER
, 22);
2702 static MESON_GATE(gxbb_vclk2_venclmcc
, HHI_GCLK_OTHER
, 24);
2703 static MESON_GATE(gxbb_vclk2_vencl
, HHI_GCLK_OTHER
, 25);
2704 static MESON_GATE(gxbb_vclk_other
, HHI_GCLK_OTHER
, 26);
2705 static MESON_GATE(gxbb_edp
, HHI_GCLK_OTHER
, 31);
2707 /* Always On (AO) domain gates */
2709 static MESON_GATE(gxbb_ao_media_cpu
, HHI_GCLK_AO
, 0);
2710 static MESON_GATE(gxbb_ao_ahb_sram
, HHI_GCLK_AO
, 1);
2711 static MESON_GATE(gxbb_ao_ahb_bus
, HHI_GCLK_AO
, 2);
2712 static MESON_GATE(gxbb_ao_iface
, HHI_GCLK_AO
, 3);
2713 static MESON_GATE(gxbb_ao_i2c
, HHI_GCLK_AO
, 4);
2716 static MESON_PCLK(gxbb_aiu_glue
, HHI_GCLK_MPEG1
, 6, &gxbb_aiu
.hw
);
2717 static MESON_PCLK(gxbb_iec958
, HHI_GCLK_MPEG1
, 7, &gxbb_aiu_glue
.hw
);
2718 static MESON_PCLK(gxbb_i2s_out
, HHI_GCLK_MPEG1
, 8, &gxbb_aiu_glue
.hw
);
2719 static MESON_PCLK(gxbb_amclk
, HHI_GCLK_MPEG1
, 9, &gxbb_aiu_glue
.hw
);
2720 static MESON_PCLK(gxbb_aififo2
, HHI_GCLK_MPEG1
, 10, &gxbb_aiu_glue
.hw
);
2721 static MESON_PCLK(gxbb_mixer
, HHI_GCLK_MPEG1
, 11, &gxbb_aiu_glue
.hw
);
2722 static MESON_PCLK(gxbb_mixer_iface
, HHI_GCLK_MPEG1
, 12, &gxbb_aiu_glue
.hw
);
2723 static MESON_PCLK(gxbb_adc
, HHI_GCLK_MPEG1
, 13, &gxbb_aiu_glue
.hw
);
2725 /* Array of all clocks provided by this provider */
2727 static struct clk_hw
*gxbb_hw_clks
[] = {
2728 [CLKID_SYS_PLL
] = &gxbb_sys_pll
.hw
,
2729 [CLKID_HDMI_PLL
] = &gxbb_hdmi_pll
.hw
,
2730 [CLKID_FIXED_PLL
] = &gxbb_fixed_pll
.hw
,
2731 [CLKID_FCLK_DIV2
] = &gxbb_fclk_div2
.hw
,
2732 [CLKID_FCLK_DIV3
] = &gxbb_fclk_div3
.hw
,
2733 [CLKID_FCLK_DIV4
] = &gxbb_fclk_div4
.hw
,
2734 [CLKID_FCLK_DIV5
] = &gxbb_fclk_div5
.hw
,
2735 [CLKID_FCLK_DIV7
] = &gxbb_fclk_div7
.hw
,
2736 [CLKID_GP0_PLL
] = &gxbb_gp0_pll
.hw
,
2737 [CLKID_MPEG_SEL
] = &gxbb_mpeg_clk_sel
.hw
,
2738 [CLKID_MPEG_DIV
] = &gxbb_mpeg_clk_div
.hw
,
2739 [CLKID_CLK81
] = &gxbb_clk81
.hw
,
2740 [CLKID_MPLL0
] = &gxbb_mpll0
.hw
,
2741 [CLKID_MPLL1
] = &gxbb_mpll1
.hw
,
2742 [CLKID_MPLL2
] = &gxbb_mpll2
.hw
,
2743 [CLKID_DDR
] = &gxbb_ddr
.hw
,
2744 [CLKID_DOS
] = &gxbb_dos
.hw
,
2745 [CLKID_ISA
] = &gxbb_isa
.hw
,
2746 [CLKID_PL301
] = &gxbb_pl301
.hw
,
2747 [CLKID_PERIPHS
] = &gxbb_periphs
.hw
,
2748 [CLKID_SPICC
] = &gxbb_spicc
.hw
,
2749 [CLKID_I2C
] = &gxbb_i2c
.hw
,
2750 [CLKID_SAR_ADC
] = &gxbb_sar_adc
.hw
,
2751 [CLKID_SMART_CARD
] = &gxbb_smart_card
.hw
,
2752 [CLKID_RNG0
] = &gxbb_rng0
.hw
,
2753 [CLKID_UART0
] = &gxbb_uart0
.hw
,
2754 [CLKID_SDHC
] = &gxbb_sdhc
.hw
,
2755 [CLKID_STREAM
] = &gxbb_stream
.hw
,
2756 [CLKID_ASYNC_FIFO
] = &gxbb_async_fifo
.hw
,
2757 [CLKID_SDIO
] = &gxbb_sdio
.hw
,
2758 [CLKID_ABUF
] = &gxbb_abuf
.hw
,
2759 [CLKID_HIU_IFACE
] = &gxbb_hiu_iface
.hw
,
2760 [CLKID_ASSIST_MISC
] = &gxbb_assist_misc
.hw
,
2761 [CLKID_SPI
] = &gxbb_spi
.hw
,
2762 [CLKID_I2S_SPDIF
] = &gxbb_i2s_spdif
.hw
,
2763 [CLKID_ETH
] = &gxbb_eth
.hw
,
2764 [CLKID_DEMUX
] = &gxbb_demux
.hw
,
2765 [CLKID_AIU_GLUE
] = &gxbb_aiu_glue
.hw
,
2766 [CLKID_IEC958
] = &gxbb_iec958
.hw
,
2767 [CLKID_I2S_OUT
] = &gxbb_i2s_out
.hw
,
2768 [CLKID_AMCLK
] = &gxbb_amclk
.hw
,
2769 [CLKID_AIFIFO2
] = &gxbb_aififo2
.hw
,
2770 [CLKID_MIXER
] = &gxbb_mixer
.hw
,
2771 [CLKID_MIXER_IFACE
] = &gxbb_mixer_iface
.hw
,
2772 [CLKID_ADC
] = &gxbb_adc
.hw
,
2773 [CLKID_BLKMV
] = &gxbb_blkmv
.hw
,
2774 [CLKID_AIU
] = &gxbb_aiu
.hw
,
2775 [CLKID_UART1
] = &gxbb_uart1
.hw
,
2776 [CLKID_G2D
] = &gxbb_g2d
.hw
,
2777 [CLKID_USB0
] = &gxbb_usb0
.hw
,
2778 [CLKID_USB1
] = &gxbb_usb1
.hw
,
2779 [CLKID_RESET
] = &gxbb_reset
.hw
,
2780 [CLKID_NAND
] = &gxbb_nand
.hw
,
2781 [CLKID_DOS_PARSER
] = &gxbb_dos_parser
.hw
,
2782 [CLKID_USB
] = &gxbb_usb
.hw
,
2783 [CLKID_VDIN1
] = &gxbb_vdin1
.hw
,
2784 [CLKID_AHB_ARB0
] = &gxbb_ahb_arb0
.hw
,
2785 [CLKID_EFUSE
] = &gxbb_efuse
.hw
,
2786 [CLKID_BOOT_ROM
] = &gxbb_boot_rom
.hw
,
2787 [CLKID_AHB_DATA_BUS
] = &gxbb_ahb_data_bus
.hw
,
2788 [CLKID_AHB_CTRL_BUS
] = &gxbb_ahb_ctrl_bus
.hw
,
2789 [CLKID_HDMI_INTR_SYNC
] = &gxbb_hdmi_intr_sync
.hw
,
2790 [CLKID_HDMI_PCLK
] = &gxbb_hdmi_pclk
.hw
,
2791 [CLKID_USB1_DDR_BRIDGE
] = &gxbb_usb1_ddr_bridge
.hw
,
2792 [CLKID_USB0_DDR_BRIDGE
] = &gxbb_usb0_ddr_bridge
.hw
,
2793 [CLKID_MMC_PCLK
] = &gxbb_mmc_pclk
.hw
,
2794 [CLKID_DVIN
] = &gxbb_dvin
.hw
,
2795 [CLKID_UART2
] = &gxbb_uart2
.hw
,
2796 [CLKID_SANA
] = &gxbb_sana
.hw
,
2797 [CLKID_VPU_INTR
] = &gxbb_vpu_intr
.hw
,
2798 [CLKID_SEC_AHB_AHB3_BRIDGE
] = &gxbb_sec_ahb_ahb3_bridge
.hw
,
2799 [CLKID_CLK81_A53
] = &gxbb_clk81_a53
.hw
,
2800 [CLKID_VCLK2_VENCI0
] = &gxbb_vclk2_venci0
.hw
,
2801 [CLKID_VCLK2_VENCI1
] = &gxbb_vclk2_venci1
.hw
,
2802 [CLKID_VCLK2_VENCP0
] = &gxbb_vclk2_vencp0
.hw
,
2803 [CLKID_VCLK2_VENCP1
] = &gxbb_vclk2_vencp1
.hw
,
2804 [CLKID_GCLK_VENCI_INT0
] = &gxbb_gclk_venci_int0
.hw
,
2805 [CLKID_GCLK_VENCI_INT
] = &gxbb_gclk_vencp_int
.hw
,
2806 [CLKID_DAC_CLK
] = &gxbb_dac_clk
.hw
,
2807 [CLKID_AOCLK_GATE
] = &gxbb_aoclk_gate
.hw
,
2808 [CLKID_IEC958_GATE
] = &gxbb_iec958_gate
.hw
,
2809 [CLKID_ENC480P
] = &gxbb_enc480p
.hw
,
2810 [CLKID_RNG1
] = &gxbb_rng1
.hw
,
2811 [CLKID_GCLK_VENCI_INT1
] = &gxbb_gclk_venci_int1
.hw
,
2812 [CLKID_VCLK2_VENCLMCC
] = &gxbb_vclk2_venclmcc
.hw
,
2813 [CLKID_VCLK2_VENCL
] = &gxbb_vclk2_vencl
.hw
,
2814 [CLKID_VCLK_OTHER
] = &gxbb_vclk_other
.hw
,
2815 [CLKID_EDP
] = &gxbb_edp
.hw
,
2816 [CLKID_AO_MEDIA_CPU
] = &gxbb_ao_media_cpu
.hw
,
2817 [CLKID_AO_AHB_SRAM
] = &gxbb_ao_ahb_sram
.hw
,
2818 [CLKID_AO_AHB_BUS
] = &gxbb_ao_ahb_bus
.hw
,
2819 [CLKID_AO_IFACE
] = &gxbb_ao_iface
.hw
,
2820 [CLKID_AO_I2C
] = &gxbb_ao_i2c
.hw
,
2821 [CLKID_SD_EMMC_A
] = &gxbb_emmc_a
.hw
,
2822 [CLKID_SD_EMMC_B
] = &gxbb_emmc_b
.hw
,
2823 [CLKID_SD_EMMC_C
] = &gxbb_emmc_c
.hw
,
2824 [CLKID_SAR_ADC_CLK
] = &gxbb_sar_adc_clk
.hw
,
2825 [CLKID_SAR_ADC_SEL
] = &gxbb_sar_adc_clk_sel
.hw
,
2826 [CLKID_SAR_ADC_DIV
] = &gxbb_sar_adc_clk_div
.hw
,
2827 [CLKID_MALI_0_SEL
] = &gxbb_mali_0_sel
.hw
,
2828 [CLKID_MALI_0_DIV
] = &gxbb_mali_0_div
.hw
,
2829 [CLKID_MALI_0
] = &gxbb_mali_0
.hw
,
2830 [CLKID_MALI_1_SEL
] = &gxbb_mali_1_sel
.hw
,
2831 [CLKID_MALI_1_DIV
] = &gxbb_mali_1_div
.hw
,
2832 [CLKID_MALI_1
] = &gxbb_mali_1
.hw
,
2833 [CLKID_MALI
] = &gxbb_mali
.hw
,
2834 [CLKID_CTS_AMCLK
] = &gxbb_cts_amclk
.hw
,
2835 [CLKID_CTS_AMCLK_SEL
] = &gxbb_cts_amclk_sel
.hw
,
2836 [CLKID_CTS_AMCLK_DIV
] = &gxbb_cts_amclk_div
.hw
,
2837 [CLKID_CTS_MCLK_I958
] = &gxbb_cts_mclk_i958
.hw
,
2838 [CLKID_CTS_MCLK_I958_SEL
] = &gxbb_cts_mclk_i958_sel
.hw
,
2839 [CLKID_CTS_MCLK_I958_DIV
] = &gxbb_cts_mclk_i958_div
.hw
,
2840 [CLKID_CTS_I958
] = &gxbb_cts_i958
.hw
,
2841 [CLKID_32K_CLK
] = &gxbb_32k_clk
.hw
,
2842 [CLKID_32K_CLK_SEL
] = &gxbb_32k_clk_sel
.hw
,
2843 [CLKID_32K_CLK_DIV
] = &gxbb_32k_clk_div
.hw
,
2844 [CLKID_SD_EMMC_A_CLK0_SEL
] = &gxbb_sd_emmc_a_clk0_sel
.hw
,
2845 [CLKID_SD_EMMC_A_CLK0_DIV
] = &gxbb_sd_emmc_a_clk0_div
.hw
,
2846 [CLKID_SD_EMMC_A_CLK0
] = &gxbb_sd_emmc_a_clk0
.hw
,
2847 [CLKID_SD_EMMC_B_CLK0_SEL
] = &gxbb_sd_emmc_b_clk0_sel
.hw
,
2848 [CLKID_SD_EMMC_B_CLK0_DIV
] = &gxbb_sd_emmc_b_clk0_div
.hw
,
2849 [CLKID_SD_EMMC_B_CLK0
] = &gxbb_sd_emmc_b_clk0
.hw
,
2850 [CLKID_SD_EMMC_C_CLK0_SEL
] = &gxbb_sd_emmc_c_clk0_sel
.hw
,
2851 [CLKID_SD_EMMC_C_CLK0_DIV
] = &gxbb_sd_emmc_c_clk0_div
.hw
,
2852 [CLKID_SD_EMMC_C_CLK0
] = &gxbb_sd_emmc_c_clk0
.hw
,
2853 [CLKID_VPU_0_SEL
] = &gxbb_vpu_0_sel
.hw
,
2854 [CLKID_VPU_0_DIV
] = &gxbb_vpu_0_div
.hw
,
2855 [CLKID_VPU_0
] = &gxbb_vpu_0
.hw
,
2856 [CLKID_VPU_1_SEL
] = &gxbb_vpu_1_sel
.hw
,
2857 [CLKID_VPU_1_DIV
] = &gxbb_vpu_1_div
.hw
,
2858 [CLKID_VPU_1
] = &gxbb_vpu_1
.hw
,
2859 [CLKID_VPU
] = &gxbb_vpu
.hw
,
2860 [CLKID_VAPB_0_SEL
] = &gxbb_vapb_0_sel
.hw
,
2861 [CLKID_VAPB_0_DIV
] = &gxbb_vapb_0_div
.hw
,
2862 [CLKID_VAPB_0
] = &gxbb_vapb_0
.hw
,
2863 [CLKID_VAPB_1_SEL
] = &gxbb_vapb_1_sel
.hw
,
2864 [CLKID_VAPB_1_DIV
] = &gxbb_vapb_1_div
.hw
,
2865 [CLKID_VAPB_1
] = &gxbb_vapb_1
.hw
,
2866 [CLKID_VAPB_SEL
] = &gxbb_vapb_sel
.hw
,
2867 [CLKID_VAPB
] = &gxbb_vapb
.hw
,
2868 [CLKID_HDMI_PLL_PRE_MULT
] = &gxbb_hdmi_pll_pre_mult
.hw
,
2869 [CLKID_MPLL0_DIV
] = &gxbb_mpll0_div
.hw
,
2870 [CLKID_MPLL1_DIV
] = &gxbb_mpll1_div
.hw
,
2871 [CLKID_MPLL2_DIV
] = &gxbb_mpll2_div
.hw
,
2872 [CLKID_MPLL_PREDIV
] = &gxbb_mpll_prediv
.hw
,
2873 [CLKID_FCLK_DIV2_DIV
] = &gxbb_fclk_div2_div
.hw
,
2874 [CLKID_FCLK_DIV3_DIV
] = &gxbb_fclk_div3_div
.hw
,
2875 [CLKID_FCLK_DIV4_DIV
] = &gxbb_fclk_div4_div
.hw
,
2876 [CLKID_FCLK_DIV5_DIV
] = &gxbb_fclk_div5_div
.hw
,
2877 [CLKID_FCLK_DIV7_DIV
] = &gxbb_fclk_div7_div
.hw
,
2878 [CLKID_VDEC_1_SEL
] = &gxbb_vdec_1_sel
.hw
,
2879 [CLKID_VDEC_1_DIV
] = &gxbb_vdec_1_div
.hw
,
2880 [CLKID_VDEC_1
] = &gxbb_vdec_1
.hw
,
2881 [CLKID_VDEC_HEVC_SEL
] = &gxbb_vdec_hevc_sel
.hw
,
2882 [CLKID_VDEC_HEVC_DIV
] = &gxbb_vdec_hevc_div
.hw
,
2883 [CLKID_VDEC_HEVC
] = &gxbb_vdec_hevc
.hw
,
2884 [CLKID_GEN_CLK_SEL
] = &gxbb_gen_clk_sel
.hw
,
2885 [CLKID_GEN_CLK_DIV
] = &gxbb_gen_clk_div
.hw
,
2886 [CLKID_GEN_CLK
] = &gxbb_gen_clk
.hw
,
2887 [CLKID_FIXED_PLL_DCO
] = &gxbb_fixed_pll_dco
.hw
,
2888 [CLKID_HDMI_PLL_DCO
] = &gxbb_hdmi_pll_dco
.hw
,
2889 [CLKID_HDMI_PLL_OD
] = &gxbb_hdmi_pll_od
.hw
,
2890 [CLKID_HDMI_PLL_OD2
] = &gxbb_hdmi_pll_od2
.hw
,
2891 [CLKID_SYS_PLL_DCO
] = &gxbb_sys_pll_dco
.hw
,
2892 [CLKID_GP0_PLL_DCO
] = &gxbb_gp0_pll_dco
.hw
,
2893 [CLKID_VID_PLL_DIV
] = &gxbb_vid_pll_div
.hw
,
2894 [CLKID_VID_PLL_SEL
] = &gxbb_vid_pll_sel
.hw
,
2895 [CLKID_VID_PLL
] = &gxbb_vid_pll
.hw
,
2896 [CLKID_VCLK_SEL
] = &gxbb_vclk_sel
.hw
,
2897 [CLKID_VCLK2_SEL
] = &gxbb_vclk2_sel
.hw
,
2898 [CLKID_VCLK_INPUT
] = &gxbb_vclk_input
.hw
,
2899 [CLKID_VCLK2_INPUT
] = &gxbb_vclk2_input
.hw
,
2900 [CLKID_VCLK_DIV
] = &gxbb_vclk_div
.hw
,
2901 [CLKID_VCLK2_DIV
] = &gxbb_vclk2_div
.hw
,
2902 [CLKID_VCLK
] = &gxbb_vclk
.hw
,
2903 [CLKID_VCLK2
] = &gxbb_vclk2
.hw
,
2904 [CLKID_VCLK_DIV1
] = &gxbb_vclk_div1
.hw
,
2905 [CLKID_VCLK_DIV2_EN
] = &gxbb_vclk_div2_en
.hw
,
2906 [CLKID_VCLK_DIV2
] = &gxbb_vclk_div2
.hw
,
2907 [CLKID_VCLK_DIV4_EN
] = &gxbb_vclk_div4_en
.hw
,
2908 [CLKID_VCLK_DIV4
] = &gxbb_vclk_div4
.hw
,
2909 [CLKID_VCLK_DIV6_EN
] = &gxbb_vclk_div6_en
.hw
,
2910 [CLKID_VCLK_DIV6
] = &gxbb_vclk_div6
.hw
,
2911 [CLKID_VCLK_DIV12_EN
] = &gxbb_vclk_div12_en
.hw
,
2912 [CLKID_VCLK_DIV12
] = &gxbb_vclk_div12
.hw
,
2913 [CLKID_VCLK2_DIV1
] = &gxbb_vclk2_div1
.hw
,
2914 [CLKID_VCLK2_DIV2_EN
] = &gxbb_vclk2_div2_en
.hw
,
2915 [CLKID_VCLK2_DIV2
] = &gxbb_vclk2_div2
.hw
,
2916 [CLKID_VCLK2_DIV4_EN
] = &gxbb_vclk2_div4_en
.hw
,
2917 [CLKID_VCLK2_DIV4
] = &gxbb_vclk2_div4
.hw
,
2918 [CLKID_VCLK2_DIV6_EN
] = &gxbb_vclk2_div6_en
.hw
,
2919 [CLKID_VCLK2_DIV6
] = &gxbb_vclk2_div6
.hw
,
2920 [CLKID_VCLK2_DIV12_EN
] = &gxbb_vclk2_div12_en
.hw
,
2921 [CLKID_VCLK2_DIV12
] = &gxbb_vclk2_div12
.hw
,
2922 [CLKID_CTS_ENCI_SEL
] = &gxbb_cts_enci_sel
.hw
,
2923 [CLKID_CTS_ENCP_SEL
] = &gxbb_cts_encp_sel
.hw
,
2924 [CLKID_CTS_VDAC_SEL
] = &gxbb_cts_vdac_sel
.hw
,
2925 [CLKID_HDMI_TX_SEL
] = &gxbb_hdmi_tx_sel
.hw
,
2926 [CLKID_CTS_ENCI
] = &gxbb_cts_enci
.hw
,
2927 [CLKID_CTS_ENCP
] = &gxbb_cts_encp
.hw
,
2928 [CLKID_CTS_VDAC
] = &gxbb_cts_vdac
.hw
,
2929 [CLKID_HDMI_TX
] = &gxbb_hdmi_tx
.hw
,
2930 [CLKID_HDMI_SEL
] = &gxbb_hdmi_sel
.hw
,
2931 [CLKID_HDMI_DIV
] = &gxbb_hdmi_div
.hw
,
2932 [CLKID_HDMI
] = &gxbb_hdmi
.hw
,
2935 static struct clk_hw
*gxl_hw_clks
[] = {
2936 [CLKID_SYS_PLL
] = &gxbb_sys_pll
.hw
,
2937 [CLKID_HDMI_PLL
] = &gxl_hdmi_pll
.hw
,
2938 [CLKID_FIXED_PLL
] = &gxbb_fixed_pll
.hw
,
2939 [CLKID_FCLK_DIV2
] = &gxbb_fclk_div2
.hw
,
2940 [CLKID_FCLK_DIV3
] = &gxbb_fclk_div3
.hw
,
2941 [CLKID_FCLK_DIV4
] = &gxbb_fclk_div4
.hw
,
2942 [CLKID_FCLK_DIV5
] = &gxbb_fclk_div5
.hw
,
2943 [CLKID_FCLK_DIV7
] = &gxbb_fclk_div7
.hw
,
2944 [CLKID_GP0_PLL
] = &gxbb_gp0_pll
.hw
,
2945 [CLKID_MPEG_SEL
] = &gxbb_mpeg_clk_sel
.hw
,
2946 [CLKID_MPEG_DIV
] = &gxbb_mpeg_clk_div
.hw
,
2947 [CLKID_CLK81
] = &gxbb_clk81
.hw
,
2948 [CLKID_MPLL0
] = &gxbb_mpll0
.hw
,
2949 [CLKID_MPLL1
] = &gxbb_mpll1
.hw
,
2950 [CLKID_MPLL2
] = &gxbb_mpll2
.hw
,
2951 [CLKID_DDR
] = &gxbb_ddr
.hw
,
2952 [CLKID_DOS
] = &gxbb_dos
.hw
,
2953 [CLKID_ISA
] = &gxbb_isa
.hw
,
2954 [CLKID_PL301
] = &gxbb_pl301
.hw
,
2955 [CLKID_PERIPHS
] = &gxbb_periphs
.hw
,
2956 [CLKID_SPICC
] = &gxbb_spicc
.hw
,
2957 [CLKID_I2C
] = &gxbb_i2c
.hw
,
2958 [CLKID_SAR_ADC
] = &gxbb_sar_adc
.hw
,
2959 [CLKID_SMART_CARD
] = &gxbb_smart_card
.hw
,
2960 [CLKID_RNG0
] = &gxbb_rng0
.hw
,
2961 [CLKID_UART0
] = &gxbb_uart0
.hw
,
2962 [CLKID_SDHC
] = &gxbb_sdhc
.hw
,
2963 [CLKID_STREAM
] = &gxbb_stream
.hw
,
2964 [CLKID_ASYNC_FIFO
] = &gxbb_async_fifo
.hw
,
2965 [CLKID_SDIO
] = &gxbb_sdio
.hw
,
2966 [CLKID_ABUF
] = &gxbb_abuf
.hw
,
2967 [CLKID_HIU_IFACE
] = &gxbb_hiu_iface
.hw
,
2968 [CLKID_ASSIST_MISC
] = &gxbb_assist_misc
.hw
,
2969 [CLKID_SPI
] = &gxbb_spi
.hw
,
2970 [CLKID_I2S_SPDIF
] = &gxbb_i2s_spdif
.hw
,
2971 [CLKID_ETH
] = &gxbb_eth
.hw
,
2972 [CLKID_DEMUX
] = &gxbb_demux
.hw
,
2973 [CLKID_AIU_GLUE
] = &gxbb_aiu_glue
.hw
,
2974 [CLKID_IEC958
] = &gxbb_iec958
.hw
,
2975 [CLKID_I2S_OUT
] = &gxbb_i2s_out
.hw
,
2976 [CLKID_AMCLK
] = &gxbb_amclk
.hw
,
2977 [CLKID_AIFIFO2
] = &gxbb_aififo2
.hw
,
2978 [CLKID_MIXER
] = &gxbb_mixer
.hw
,
2979 [CLKID_MIXER_IFACE
] = &gxbb_mixer_iface
.hw
,
2980 [CLKID_ADC
] = &gxbb_adc
.hw
,
2981 [CLKID_BLKMV
] = &gxbb_blkmv
.hw
,
2982 [CLKID_AIU
] = &gxbb_aiu
.hw
,
2983 [CLKID_UART1
] = &gxbb_uart1
.hw
,
2984 [CLKID_G2D
] = &gxbb_g2d
.hw
,
2985 [CLKID_USB0
] = &gxbb_usb0
.hw
,
2986 [CLKID_USB1
] = &gxbb_usb1
.hw
,
2987 [CLKID_RESET
] = &gxbb_reset
.hw
,
2988 [CLKID_NAND
] = &gxbb_nand
.hw
,
2989 [CLKID_DOS_PARSER
] = &gxbb_dos_parser
.hw
,
2990 [CLKID_USB
] = &gxbb_usb
.hw
,
2991 [CLKID_VDIN1
] = &gxbb_vdin1
.hw
,
2992 [CLKID_AHB_ARB0
] = &gxbb_ahb_arb0
.hw
,
2993 [CLKID_EFUSE
] = &gxbb_efuse
.hw
,
2994 [CLKID_BOOT_ROM
] = &gxbb_boot_rom
.hw
,
2995 [CLKID_AHB_DATA_BUS
] = &gxbb_ahb_data_bus
.hw
,
2996 [CLKID_AHB_CTRL_BUS
] = &gxbb_ahb_ctrl_bus
.hw
,
2997 [CLKID_HDMI_INTR_SYNC
] = &gxbb_hdmi_intr_sync
.hw
,
2998 [CLKID_HDMI_PCLK
] = &gxbb_hdmi_pclk
.hw
,
2999 [CLKID_USB1_DDR_BRIDGE
] = &gxbb_usb1_ddr_bridge
.hw
,
3000 [CLKID_USB0_DDR_BRIDGE
] = &gxbb_usb0_ddr_bridge
.hw
,
3001 [CLKID_MMC_PCLK
] = &gxbb_mmc_pclk
.hw
,
3002 [CLKID_DVIN
] = &gxbb_dvin
.hw
,
3003 [CLKID_UART2
] = &gxbb_uart2
.hw
,
3004 [CLKID_SANA
] = &gxbb_sana
.hw
,
3005 [CLKID_VPU_INTR
] = &gxbb_vpu_intr
.hw
,
3006 [CLKID_SEC_AHB_AHB3_BRIDGE
] = &gxbb_sec_ahb_ahb3_bridge
.hw
,
3007 [CLKID_CLK81_A53
] = &gxbb_clk81_a53
.hw
,
3008 [CLKID_VCLK2_VENCI0
] = &gxbb_vclk2_venci0
.hw
,
3009 [CLKID_VCLK2_VENCI1
] = &gxbb_vclk2_venci1
.hw
,
3010 [CLKID_VCLK2_VENCP0
] = &gxbb_vclk2_vencp0
.hw
,
3011 [CLKID_VCLK2_VENCP1
] = &gxbb_vclk2_vencp1
.hw
,
3012 [CLKID_GCLK_VENCI_INT0
] = &gxbb_gclk_venci_int0
.hw
,
3013 [CLKID_GCLK_VENCI_INT
] = &gxbb_gclk_vencp_int
.hw
,
3014 [CLKID_DAC_CLK
] = &gxbb_dac_clk
.hw
,
3015 [CLKID_AOCLK_GATE
] = &gxbb_aoclk_gate
.hw
,
3016 [CLKID_IEC958_GATE
] = &gxbb_iec958_gate
.hw
,
3017 [CLKID_ENC480P
] = &gxbb_enc480p
.hw
,
3018 [CLKID_RNG1
] = &gxbb_rng1
.hw
,
3019 [CLKID_GCLK_VENCI_INT1
] = &gxbb_gclk_venci_int1
.hw
,
3020 [CLKID_VCLK2_VENCLMCC
] = &gxbb_vclk2_venclmcc
.hw
,
3021 [CLKID_VCLK2_VENCL
] = &gxbb_vclk2_vencl
.hw
,
3022 [CLKID_VCLK_OTHER
] = &gxbb_vclk_other
.hw
,
3023 [CLKID_EDP
] = &gxbb_edp
.hw
,
3024 [CLKID_AO_MEDIA_CPU
] = &gxbb_ao_media_cpu
.hw
,
3025 [CLKID_AO_AHB_SRAM
] = &gxbb_ao_ahb_sram
.hw
,
3026 [CLKID_AO_AHB_BUS
] = &gxbb_ao_ahb_bus
.hw
,
3027 [CLKID_AO_IFACE
] = &gxbb_ao_iface
.hw
,
3028 [CLKID_AO_I2C
] = &gxbb_ao_i2c
.hw
,
3029 [CLKID_SD_EMMC_A
] = &gxbb_emmc_a
.hw
,
3030 [CLKID_SD_EMMC_B
] = &gxbb_emmc_b
.hw
,
3031 [CLKID_SD_EMMC_C
] = &gxbb_emmc_c
.hw
,
3032 [CLKID_SAR_ADC_CLK
] = &gxbb_sar_adc_clk
.hw
,
3033 [CLKID_SAR_ADC_SEL
] = &gxbb_sar_adc_clk_sel
.hw
,
3034 [CLKID_SAR_ADC_DIV
] = &gxbb_sar_adc_clk_div
.hw
,
3035 [CLKID_MALI_0_SEL
] = &gxbb_mali_0_sel
.hw
,
3036 [CLKID_MALI_0_DIV
] = &gxbb_mali_0_div
.hw
,
3037 [CLKID_MALI_0
] = &gxbb_mali_0
.hw
,
3038 [CLKID_MALI_1_SEL
] = &gxbb_mali_1_sel
.hw
,
3039 [CLKID_MALI_1_DIV
] = &gxbb_mali_1_div
.hw
,
3040 [CLKID_MALI_1
] = &gxbb_mali_1
.hw
,
3041 [CLKID_MALI
] = &gxbb_mali
.hw
,
3042 [CLKID_CTS_AMCLK
] = &gxbb_cts_amclk
.hw
,
3043 [CLKID_CTS_AMCLK_SEL
] = &gxbb_cts_amclk_sel
.hw
,
3044 [CLKID_CTS_AMCLK_DIV
] = &gxbb_cts_amclk_div
.hw
,
3045 [CLKID_CTS_MCLK_I958
] = &gxbb_cts_mclk_i958
.hw
,
3046 [CLKID_CTS_MCLK_I958_SEL
] = &gxbb_cts_mclk_i958_sel
.hw
,
3047 [CLKID_CTS_MCLK_I958_DIV
] = &gxbb_cts_mclk_i958_div
.hw
,
3048 [CLKID_CTS_I958
] = &gxbb_cts_i958
.hw
,
3049 [CLKID_32K_CLK
] = &gxbb_32k_clk
.hw
,
3050 [CLKID_32K_CLK_SEL
] = &gxbb_32k_clk_sel
.hw
,
3051 [CLKID_32K_CLK_DIV
] = &gxbb_32k_clk_div
.hw
,
3052 [CLKID_SD_EMMC_A_CLK0_SEL
] = &gxbb_sd_emmc_a_clk0_sel
.hw
,
3053 [CLKID_SD_EMMC_A_CLK0_DIV
] = &gxbb_sd_emmc_a_clk0_div
.hw
,
3054 [CLKID_SD_EMMC_A_CLK0
] = &gxbb_sd_emmc_a_clk0
.hw
,
3055 [CLKID_SD_EMMC_B_CLK0_SEL
] = &gxbb_sd_emmc_b_clk0_sel
.hw
,
3056 [CLKID_SD_EMMC_B_CLK0_DIV
] = &gxbb_sd_emmc_b_clk0_div
.hw
,
3057 [CLKID_SD_EMMC_B_CLK0
] = &gxbb_sd_emmc_b_clk0
.hw
,
3058 [CLKID_SD_EMMC_C_CLK0_SEL
] = &gxbb_sd_emmc_c_clk0_sel
.hw
,
3059 [CLKID_SD_EMMC_C_CLK0_DIV
] = &gxbb_sd_emmc_c_clk0_div
.hw
,
3060 [CLKID_SD_EMMC_C_CLK0
] = &gxbb_sd_emmc_c_clk0
.hw
,
3061 [CLKID_VPU_0_SEL
] = &gxbb_vpu_0_sel
.hw
,
3062 [CLKID_VPU_0_DIV
] = &gxbb_vpu_0_div
.hw
,
3063 [CLKID_VPU_0
] = &gxbb_vpu_0
.hw
,
3064 [CLKID_VPU_1_SEL
] = &gxbb_vpu_1_sel
.hw
,
3065 [CLKID_VPU_1_DIV
] = &gxbb_vpu_1_div
.hw
,
3066 [CLKID_VPU_1
] = &gxbb_vpu_1
.hw
,
3067 [CLKID_VPU
] = &gxbb_vpu
.hw
,
3068 [CLKID_VAPB_0_SEL
] = &gxbb_vapb_0_sel
.hw
,
3069 [CLKID_VAPB_0_DIV
] = &gxbb_vapb_0_div
.hw
,
3070 [CLKID_VAPB_0
] = &gxbb_vapb_0
.hw
,
3071 [CLKID_VAPB_1_SEL
] = &gxbb_vapb_1_sel
.hw
,
3072 [CLKID_VAPB_1_DIV
] = &gxbb_vapb_1_div
.hw
,
3073 [CLKID_VAPB_1
] = &gxbb_vapb_1
.hw
,
3074 [CLKID_VAPB_SEL
] = &gxbb_vapb_sel
.hw
,
3075 [CLKID_VAPB
] = &gxbb_vapb
.hw
,
3076 [CLKID_MPLL0_DIV
] = &gxl_mpll0_div
.hw
,
3077 [CLKID_MPLL1_DIV
] = &gxbb_mpll1_div
.hw
,
3078 [CLKID_MPLL2_DIV
] = &gxbb_mpll2_div
.hw
,
3079 [CLKID_MPLL_PREDIV
] = &gxbb_mpll_prediv
.hw
,
3080 [CLKID_FCLK_DIV2_DIV
] = &gxbb_fclk_div2_div
.hw
,
3081 [CLKID_FCLK_DIV3_DIV
] = &gxbb_fclk_div3_div
.hw
,
3082 [CLKID_FCLK_DIV4_DIV
] = &gxbb_fclk_div4_div
.hw
,
3083 [CLKID_FCLK_DIV5_DIV
] = &gxbb_fclk_div5_div
.hw
,
3084 [CLKID_FCLK_DIV7_DIV
] = &gxbb_fclk_div7_div
.hw
,
3085 [CLKID_VDEC_1_SEL
] = &gxbb_vdec_1_sel
.hw
,
3086 [CLKID_VDEC_1_DIV
] = &gxbb_vdec_1_div
.hw
,
3087 [CLKID_VDEC_1
] = &gxbb_vdec_1
.hw
,
3088 [CLKID_VDEC_HEVC_SEL
] = &gxbb_vdec_hevc_sel
.hw
,
3089 [CLKID_VDEC_HEVC_DIV
] = &gxbb_vdec_hevc_div
.hw
,
3090 [CLKID_VDEC_HEVC
] = &gxbb_vdec_hevc
.hw
,
3091 [CLKID_GEN_CLK_SEL
] = &gxbb_gen_clk_sel
.hw
,
3092 [CLKID_GEN_CLK_DIV
] = &gxbb_gen_clk_div
.hw
,
3093 [CLKID_GEN_CLK
] = &gxbb_gen_clk
.hw
,
3094 [CLKID_FIXED_PLL_DCO
] = &gxbb_fixed_pll_dco
.hw
,
3095 [CLKID_HDMI_PLL_DCO
] = &gxl_hdmi_pll_dco
.hw
,
3096 [CLKID_HDMI_PLL_OD
] = &gxl_hdmi_pll_od
.hw
,
3097 [CLKID_HDMI_PLL_OD2
] = &gxl_hdmi_pll_od2
.hw
,
3098 [CLKID_SYS_PLL_DCO
] = &gxbb_sys_pll_dco
.hw
,
3099 [CLKID_GP0_PLL_DCO
] = &gxl_gp0_pll_dco
.hw
,
3100 [CLKID_VID_PLL_DIV
] = &gxbb_vid_pll_div
.hw
,
3101 [CLKID_VID_PLL_SEL
] = &gxbb_vid_pll_sel
.hw
,
3102 [CLKID_VID_PLL
] = &gxbb_vid_pll
.hw
,
3103 [CLKID_VCLK_SEL
] = &gxbb_vclk_sel
.hw
,
3104 [CLKID_VCLK2_SEL
] = &gxbb_vclk2_sel
.hw
,
3105 [CLKID_VCLK_INPUT
] = &gxbb_vclk_input
.hw
,
3106 [CLKID_VCLK2_INPUT
] = &gxbb_vclk2_input
.hw
,
3107 [CLKID_VCLK_DIV
] = &gxbb_vclk_div
.hw
,
3108 [CLKID_VCLK2_DIV
] = &gxbb_vclk2_div
.hw
,
3109 [CLKID_VCLK
] = &gxbb_vclk
.hw
,
3110 [CLKID_VCLK2
] = &gxbb_vclk2
.hw
,
3111 [CLKID_VCLK_DIV1
] = &gxbb_vclk_div1
.hw
,
3112 [CLKID_VCLK_DIV2_EN
] = &gxbb_vclk_div2_en
.hw
,
3113 [CLKID_VCLK_DIV2
] = &gxbb_vclk_div2
.hw
,
3114 [CLKID_VCLK_DIV4_EN
] = &gxbb_vclk_div4_en
.hw
,
3115 [CLKID_VCLK_DIV4
] = &gxbb_vclk_div4
.hw
,
3116 [CLKID_VCLK_DIV6_EN
] = &gxbb_vclk_div6_en
.hw
,
3117 [CLKID_VCLK_DIV6
] = &gxbb_vclk_div6
.hw
,
3118 [CLKID_VCLK_DIV12_EN
] = &gxbb_vclk_div12_en
.hw
,
3119 [CLKID_VCLK_DIV12
] = &gxbb_vclk_div12
.hw
,
3120 [CLKID_VCLK2_DIV1
] = &gxbb_vclk2_div1
.hw
,
3121 [CLKID_VCLK2_DIV2_EN
] = &gxbb_vclk2_div2_en
.hw
,
3122 [CLKID_VCLK2_DIV2
] = &gxbb_vclk2_div2
.hw
,
3123 [CLKID_VCLK2_DIV4_EN
] = &gxbb_vclk2_div4_en
.hw
,
3124 [CLKID_VCLK2_DIV4
] = &gxbb_vclk2_div4
.hw
,
3125 [CLKID_VCLK2_DIV6_EN
] = &gxbb_vclk2_div6_en
.hw
,
3126 [CLKID_VCLK2_DIV6
] = &gxbb_vclk2_div6
.hw
,
3127 [CLKID_VCLK2_DIV12_EN
] = &gxbb_vclk2_div12_en
.hw
,
3128 [CLKID_VCLK2_DIV12
] = &gxbb_vclk2_div12
.hw
,
3129 [CLKID_CTS_ENCI_SEL
] = &gxbb_cts_enci_sel
.hw
,
3130 [CLKID_CTS_ENCP_SEL
] = &gxbb_cts_encp_sel
.hw
,
3131 [CLKID_CTS_VDAC_SEL
] = &gxbb_cts_vdac_sel
.hw
,
3132 [CLKID_HDMI_TX_SEL
] = &gxbb_hdmi_tx_sel
.hw
,
3133 [CLKID_CTS_ENCI
] = &gxbb_cts_enci
.hw
,
3134 [CLKID_CTS_ENCP
] = &gxbb_cts_encp
.hw
,
3135 [CLKID_CTS_VDAC
] = &gxbb_cts_vdac
.hw
,
3136 [CLKID_HDMI_TX
] = &gxbb_hdmi_tx
.hw
,
3137 [CLKID_HDMI_SEL
] = &gxbb_hdmi_sel
.hw
,
3138 [CLKID_HDMI_DIV
] = &gxbb_hdmi_div
.hw
,
3139 [CLKID_HDMI
] = &gxbb_hdmi
.hw
,
3140 [CLKID_ACODEC
] = &gxl_acodec
.hw
,
3143 static struct clk_regmap
*const gxbb_clk_regmaps
[] = {
3191 &gxbb_hdmi_intr_sync
,
3193 &gxbb_usb1_ddr_bridge
,
3194 &gxbb_usb0_ddr_bridge
,
3200 &gxbb_sec_ahb_ahb3_bridge
,
3206 &gxbb_gclk_venci_int0
,
3207 &gxbb_gclk_vencp_int
,
3213 &gxbb_gclk_venci_int1
,
3214 &gxbb_vclk2_venclmcc
,
3230 &gxbb_cts_mclk_i958
,
3232 &gxbb_sd_emmc_a_clk0
,
3233 &gxbb_sd_emmc_b_clk0
,
3234 &gxbb_sd_emmc_c_clk0
,
3241 &gxbb_sar_adc_clk_div
,
3244 &gxbb_cts_mclk_i958_div
,
3246 &gxbb_sd_emmc_a_clk0_div
,
3247 &gxbb_sd_emmc_b_clk0_div
,
3248 &gxbb_sd_emmc_c_clk0_div
,
3254 &gxbb_sar_adc_clk_sel
,
3258 &gxbb_cts_amclk_sel
,
3259 &gxbb_cts_mclk_i958_sel
,
3262 &gxbb_sd_emmc_a_clk0_sel
,
3263 &gxbb_sd_emmc_b_clk0_sel
,
3264 &gxbb_sd_emmc_c_clk0_sel
,
3277 &gxbb_cts_amclk_div
,
3289 &gxbb_vdec_hevc_sel
,
3290 &gxbb_vdec_hevc_div
,
3295 &gxbb_fixed_pll_dco
,
3309 &gxbb_vclk_div12_en
,
3315 &gxbb_vclk2_div2_en
,
3316 &gxbb_vclk2_div4_en
,
3317 &gxbb_vclk2_div6_en
,
3318 &gxbb_vclk2_div12_en
,
3337 static struct clk_regmap
*const gxl_clk_regmaps
[] = {
3385 &gxbb_hdmi_intr_sync
,
3387 &gxbb_usb1_ddr_bridge
,
3388 &gxbb_usb0_ddr_bridge
,
3394 &gxbb_sec_ahb_ahb3_bridge
,
3400 &gxbb_gclk_venci_int0
,
3401 &gxbb_gclk_vencp_int
,
3407 &gxbb_gclk_venci_int1
,
3408 &gxbb_vclk2_venclmcc
,
3424 &gxbb_cts_mclk_i958
,
3426 &gxbb_sd_emmc_a_clk0
,
3427 &gxbb_sd_emmc_b_clk0
,
3428 &gxbb_sd_emmc_c_clk0
,
3435 &gxbb_sar_adc_clk_div
,
3438 &gxbb_cts_mclk_i958_div
,
3440 &gxbb_sd_emmc_a_clk0_div
,
3441 &gxbb_sd_emmc_b_clk0_div
,
3442 &gxbb_sd_emmc_c_clk0_div
,
3448 &gxbb_sar_adc_clk_sel
,
3452 &gxbb_cts_amclk_sel
,
3453 &gxbb_cts_mclk_i958_sel
,
3456 &gxbb_sd_emmc_a_clk0_sel
,
3457 &gxbb_sd_emmc_b_clk0_sel
,
3458 &gxbb_sd_emmc_c_clk0_sel
,
3471 &gxbb_cts_amclk_div
,
3483 &gxbb_vdec_hevc_sel
,
3484 &gxbb_vdec_hevc_div
,
3489 &gxbb_fixed_pll_dco
,
3503 &gxbb_vclk_div12_en
,
3509 &gxbb_vclk2_div2_en
,
3510 &gxbb_vclk2_div4_en
,
3511 &gxbb_vclk2_div6_en
,
3512 &gxbb_vclk2_div12_en
,
3532 static const struct meson_eeclkc_data gxbb_clkc_data
= {
3533 .regmap_clks
= gxbb_clk_regmaps
,
3534 .regmap_clk_num
= ARRAY_SIZE(gxbb_clk_regmaps
),
3536 .hws
= gxbb_hw_clks
,
3537 .num
= ARRAY_SIZE(gxbb_hw_clks
),
3541 static const struct meson_eeclkc_data gxl_clkc_data
= {
3542 .regmap_clks
= gxl_clk_regmaps
,
3543 .regmap_clk_num
= ARRAY_SIZE(gxl_clk_regmaps
),
3546 .num
= ARRAY_SIZE(gxl_hw_clks
),
3550 static const struct of_device_id clkc_match_table
[] = {
3551 { .compatible
= "amlogic,gxbb-clkc", .data
= &gxbb_clkc_data
},
3552 { .compatible
= "amlogic,gxl-clkc", .data
= &gxl_clkc_data
},
3555 MODULE_DEVICE_TABLE(of
, clkc_match_table
);
3557 static struct platform_driver gxbb_driver
= {
3558 .probe
= meson_eeclkc_probe
,
3560 .name
= "gxbb-clkc",
3561 .of_match_table
= clkc_match_table
,
3564 module_platform_driver(gxbb_driver
);
3566 MODULE_DESCRIPTION("Amlogic GXBB Main Clock Controller driver");
3567 MODULE_LICENSE("GPL");
3568 MODULE_IMPORT_NS("CLK_MESON");