1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2014, The Linux Foundation. All rights reserved.
6 #include <linux/kernel.h>
7 #include <linux/bitops.h>
9 #include <linux/platform_device.h>
10 #include <linux/module.h>
12 #include <linux/of_device.h>
13 #include <linux/clk-provider.h>
14 #include <linux/regmap.h>
15 #include <linux/reset-controller.h>
17 #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
18 #include <dt-bindings/reset/qcom,gcc-ipq806x.h>
21 #include "clk-regmap.h"
24 #include "clk-branch.h"
25 #include "clk-hfpll.h"
28 static struct clk_pll pll0
= {
36 .clkr
.hw
.init
= &(struct clk_init_data
){
38 .parent_names
= (const char *[]){ "pxo" },
44 static struct clk_regmap pll0_vote
= {
46 .enable_mask
= BIT(0),
47 .hw
.init
= &(struct clk_init_data
){
49 .parent_names
= (const char *[]){ "pll0" },
51 .ops
= &clk_pll_vote_ops
,
55 static struct clk_pll pll3
= {
63 .clkr
.hw
.init
= &(struct clk_init_data
){
65 .parent_names
= (const char *[]){ "pxo" },
71 static struct clk_regmap pll4_vote
= {
73 .enable_mask
= BIT(4),
74 .hw
.init
= &(struct clk_init_data
){
76 .parent_names
= (const char *[]){ "pll4" },
78 .ops
= &clk_pll_vote_ops
,
82 static struct clk_pll pll8
= {
90 .clkr
.hw
.init
= &(struct clk_init_data
){
92 .parent_names
= (const char *[]){ "pxo" },
98 static struct clk_regmap pll8_vote
= {
100 .enable_mask
= BIT(8),
101 .hw
.init
= &(struct clk_init_data
){
103 .parent_names
= (const char *[]){ "pll8" },
105 .ops
= &clk_pll_vote_ops
,
109 static struct hfpll_data hfpll0_data
= {
114 .config_reg
= 0x3204,
115 .status_reg
= 0x321c,
116 .config_val
= 0x7845c665,
118 .droop_val
= 0x0108c000,
119 .min_rate
= 600000000UL,
120 .max_rate
= 1800000000UL,
123 static struct clk_hfpll hfpll0
= {
125 .clkr
.hw
.init
= &(struct clk_init_data
){
126 .parent_names
= (const char *[]){ "pxo" },
129 .ops
= &clk_ops_hfpll
,
130 .flags
= CLK_IGNORE_UNUSED
,
132 .lock
= __SPIN_LOCK_UNLOCKED(hfpll0
.lock
),
135 static struct hfpll_data hfpll1_data
= {
140 .config_reg
= 0x3244,
141 .status_reg
= 0x325c,
142 .config_val
= 0x7845c665,
144 .droop_val
= 0x0108c000,
145 .min_rate
= 600000000UL,
146 .max_rate
= 1800000000UL,
149 static struct clk_hfpll hfpll1
= {
151 .clkr
.hw
.init
= &(struct clk_init_data
){
152 .parent_names
= (const char *[]){ "pxo" },
155 .ops
= &clk_ops_hfpll
,
156 .flags
= CLK_IGNORE_UNUSED
,
158 .lock
= __SPIN_LOCK_UNLOCKED(hfpll1
.lock
),
161 static struct hfpll_data hfpll_l2_data
= {
166 .config_reg
= 0x3304,
167 .status_reg
= 0x331c,
168 .config_val
= 0x7845c665,
170 .droop_val
= 0x0108c000,
171 .min_rate
= 600000000UL,
172 .max_rate
= 1800000000UL,
175 static struct clk_hfpll hfpll_l2
= {
177 .clkr
.hw
.init
= &(struct clk_init_data
){
178 .parent_names
= (const char *[]){ "pxo" },
181 .ops
= &clk_ops_hfpll
,
182 .flags
= CLK_IGNORE_UNUSED
,
184 .lock
= __SPIN_LOCK_UNLOCKED(hfpll_l2
.lock
),
187 static struct clk_pll pll14
= {
191 .config_reg
= 0x31d4,
193 .status_reg
= 0x31d8,
195 .clkr
.hw
.init
= &(struct clk_init_data
){
197 .parent_names
= (const char *[]){ "pxo" },
203 static struct clk_regmap pll14_vote
= {
204 .enable_reg
= 0x34c0,
205 .enable_mask
= BIT(14),
206 .hw
.init
= &(struct clk_init_data
){
207 .name
= "pll14_vote",
208 .parent_names
= (const char *[]){ "pll14" },
210 .ops
= &clk_pll_vote_ops
,
214 #define NSS_PLL_RATE(f, _l, _m, _n, i) \
223 static struct pll_freq_tbl pll18_freq_tbl
[] = {
224 NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625),
225 NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625),
228 static struct clk_pll pll18
= {
232 .config_reg
= 0x31b4,
234 .status_reg
= 0x31b8,
236 .post_div_shift
= 16,
238 .freq_tbl
= pll18_freq_tbl
,
239 .clkr
.hw
.init
= &(struct clk_init_data
){
241 .parent_names
= (const char *[]){ "pxo" },
257 static const struct parent_map gcc_pxo_pll8_map
[] = {
262 static const char * const gcc_pxo_pll8
[] = {
267 static const struct parent_map gcc_pxo_pll8_cxo_map
[] = {
273 static const char * const gcc_pxo_pll8_cxo
[] = {
279 static const struct parent_map gcc_pxo_pll3_map
[] = {
284 static const struct parent_map gcc_pxo_pll3_sata_map
[] = {
289 static const char * const gcc_pxo_pll3
[] = {
294 static const struct parent_map gcc_pxo_pll8_pll0
[] = {
300 static const char * const gcc_pxo_pll8_pll0_map
[] = {
306 static const struct parent_map gcc_pxo_pll8_pll14_pll18_pll0_map
[] = {
314 static const char * const gcc_pxo_pll8_pll14_pll18_pll0
[] = {
322 static struct freq_tbl clk_tbl_gsbi_uart
[] = {
323 { 1843200, P_PLL8
, 2, 6, 625 },
324 { 3686400, P_PLL8
, 2, 12, 625 },
325 { 7372800, P_PLL8
, 2, 24, 625 },
326 { 14745600, P_PLL8
, 2, 48, 625 },
327 { 16000000, P_PLL8
, 4, 1, 6 },
328 { 24000000, P_PLL8
, 4, 1, 4 },
329 { 32000000, P_PLL8
, 4, 1, 3 },
330 { 40000000, P_PLL8
, 1, 5, 48 },
331 { 46400000, P_PLL8
, 1, 29, 240 },
332 { 48000000, P_PLL8
, 4, 1, 2 },
333 { 51200000, P_PLL8
, 1, 2, 15 },
334 { 56000000, P_PLL8
, 1, 7, 48 },
335 { 58982400, P_PLL8
, 1, 96, 625 },
336 { 64000000, P_PLL8
, 2, 1, 3 },
340 static struct clk_rcg gsbi1_uart_src
= {
345 .mnctr_reset_bit
= 7,
346 .mnctr_mode_shift
= 5,
357 .parent_map
= gcc_pxo_pll8_map
,
359 .freq_tbl
= clk_tbl_gsbi_uart
,
361 .enable_reg
= 0x29d4,
362 .enable_mask
= BIT(11),
363 .hw
.init
= &(struct clk_init_data
){
364 .name
= "gsbi1_uart_src",
365 .parent_names
= gcc_pxo_pll8
,
368 .flags
= CLK_SET_PARENT_GATE
,
373 static struct clk_branch gsbi1_uart_clk
= {
377 .enable_reg
= 0x29d4,
378 .enable_mask
= BIT(9),
379 .hw
.init
= &(struct clk_init_data
){
380 .name
= "gsbi1_uart_clk",
381 .parent_names
= (const char *[]){
385 .ops
= &clk_branch_ops
,
386 .flags
= CLK_SET_RATE_PARENT
,
391 static struct clk_rcg gsbi2_uart_src
= {
396 .mnctr_reset_bit
= 7,
397 .mnctr_mode_shift
= 5,
408 .parent_map
= gcc_pxo_pll8_map
,
410 .freq_tbl
= clk_tbl_gsbi_uart
,
412 .enable_reg
= 0x29f4,
413 .enable_mask
= BIT(11),
414 .hw
.init
= &(struct clk_init_data
){
415 .name
= "gsbi2_uart_src",
416 .parent_names
= gcc_pxo_pll8
,
419 .flags
= CLK_SET_PARENT_GATE
,
424 static struct clk_branch gsbi2_uart_clk
= {
428 .enable_reg
= 0x29f4,
429 .enable_mask
= BIT(9),
430 .hw
.init
= &(struct clk_init_data
){
431 .name
= "gsbi2_uart_clk",
432 .parent_names
= (const char *[]){
436 .ops
= &clk_branch_ops
,
437 .flags
= CLK_SET_RATE_PARENT
,
442 static struct clk_rcg gsbi4_uart_src
= {
447 .mnctr_reset_bit
= 7,
448 .mnctr_mode_shift
= 5,
459 .parent_map
= gcc_pxo_pll8_map
,
461 .freq_tbl
= clk_tbl_gsbi_uart
,
463 .enable_reg
= 0x2a34,
464 .enable_mask
= BIT(11),
465 .hw
.init
= &(struct clk_init_data
){
466 .name
= "gsbi4_uart_src",
467 .parent_names
= gcc_pxo_pll8
,
470 .flags
= CLK_SET_PARENT_GATE
,
475 static struct clk_branch gsbi4_uart_clk
= {
479 .enable_reg
= 0x2a34,
480 .enable_mask
= BIT(9),
481 .hw
.init
= &(struct clk_init_data
){
482 .name
= "gsbi4_uart_clk",
483 .parent_names
= (const char *[]){
487 .ops
= &clk_branch_ops
,
488 .flags
= CLK_SET_RATE_PARENT
,
493 static struct clk_rcg gsbi5_uart_src
= {
498 .mnctr_reset_bit
= 7,
499 .mnctr_mode_shift
= 5,
510 .parent_map
= gcc_pxo_pll8_map
,
512 .freq_tbl
= clk_tbl_gsbi_uart
,
514 .enable_reg
= 0x2a54,
515 .enable_mask
= BIT(11),
516 .hw
.init
= &(struct clk_init_data
){
517 .name
= "gsbi5_uart_src",
518 .parent_names
= gcc_pxo_pll8
,
521 .flags
= CLK_SET_PARENT_GATE
,
526 static struct clk_branch gsbi5_uart_clk
= {
530 .enable_reg
= 0x2a54,
531 .enable_mask
= BIT(9),
532 .hw
.init
= &(struct clk_init_data
){
533 .name
= "gsbi5_uart_clk",
534 .parent_names
= (const char *[]){
538 .ops
= &clk_branch_ops
,
539 .flags
= CLK_SET_RATE_PARENT
,
544 static struct clk_rcg gsbi6_uart_src
= {
549 .mnctr_reset_bit
= 7,
550 .mnctr_mode_shift
= 5,
561 .parent_map
= gcc_pxo_pll8_map
,
563 .freq_tbl
= clk_tbl_gsbi_uart
,
565 .enable_reg
= 0x2a74,
566 .enable_mask
= BIT(11),
567 .hw
.init
= &(struct clk_init_data
){
568 .name
= "gsbi6_uart_src",
569 .parent_names
= gcc_pxo_pll8
,
572 .flags
= CLK_SET_PARENT_GATE
,
577 static struct clk_branch gsbi6_uart_clk
= {
581 .enable_reg
= 0x2a74,
582 .enable_mask
= BIT(9),
583 .hw
.init
= &(struct clk_init_data
){
584 .name
= "gsbi6_uart_clk",
585 .parent_names
= (const char *[]){
589 .ops
= &clk_branch_ops
,
590 .flags
= CLK_SET_RATE_PARENT
,
595 static struct clk_rcg gsbi7_uart_src
= {
600 .mnctr_reset_bit
= 7,
601 .mnctr_mode_shift
= 5,
612 .parent_map
= gcc_pxo_pll8_map
,
614 .freq_tbl
= clk_tbl_gsbi_uart
,
616 .enable_reg
= 0x2a94,
617 .enable_mask
= BIT(11),
618 .hw
.init
= &(struct clk_init_data
){
619 .name
= "gsbi7_uart_src",
620 .parent_names
= gcc_pxo_pll8
,
623 .flags
= CLK_SET_PARENT_GATE
,
628 static struct clk_branch gsbi7_uart_clk
= {
632 .enable_reg
= 0x2a94,
633 .enable_mask
= BIT(9),
634 .hw
.init
= &(struct clk_init_data
){
635 .name
= "gsbi7_uart_clk",
636 .parent_names
= (const char *[]){
640 .ops
= &clk_branch_ops
,
641 .flags
= CLK_SET_RATE_PARENT
,
646 static struct freq_tbl clk_tbl_gsbi_qup
[] = {
647 { 1100000, P_PXO
, 1, 2, 49 },
648 { 5400000, P_PXO
, 1, 1, 5 },
649 { 10800000, P_PXO
, 1, 2, 5 },
650 { 15060000, P_PLL8
, 1, 2, 51 },
651 { 24000000, P_PLL8
, 4, 1, 4 },
652 { 25000000, P_PXO
, 1, 0, 0 },
653 { 25600000, P_PLL8
, 1, 1, 15 },
654 { 48000000, P_PLL8
, 4, 1, 2 },
655 { 51200000, P_PLL8
, 1, 2, 15 },
659 static struct clk_rcg gsbi1_qup_src
= {
664 .mnctr_reset_bit
= 7,
665 .mnctr_mode_shift
= 5,
676 .parent_map
= gcc_pxo_pll8_map
,
678 .freq_tbl
= clk_tbl_gsbi_qup
,
680 .enable_reg
= 0x29cc,
681 .enable_mask
= BIT(11),
682 .hw
.init
= &(struct clk_init_data
){
683 .name
= "gsbi1_qup_src",
684 .parent_names
= gcc_pxo_pll8
,
687 .flags
= CLK_SET_PARENT_GATE
,
692 static struct clk_branch gsbi1_qup_clk
= {
696 .enable_reg
= 0x29cc,
697 .enable_mask
= BIT(9),
698 .hw
.init
= &(struct clk_init_data
){
699 .name
= "gsbi1_qup_clk",
700 .parent_names
= (const char *[]){ "gsbi1_qup_src" },
702 .ops
= &clk_branch_ops
,
703 .flags
= CLK_SET_RATE_PARENT
,
708 static struct clk_rcg gsbi2_qup_src
= {
713 .mnctr_reset_bit
= 7,
714 .mnctr_mode_shift
= 5,
725 .parent_map
= gcc_pxo_pll8_map
,
727 .freq_tbl
= clk_tbl_gsbi_qup
,
729 .enable_reg
= 0x29ec,
730 .enable_mask
= BIT(11),
731 .hw
.init
= &(struct clk_init_data
){
732 .name
= "gsbi2_qup_src",
733 .parent_names
= gcc_pxo_pll8
,
736 .flags
= CLK_SET_PARENT_GATE
,
741 static struct clk_branch gsbi2_qup_clk
= {
745 .enable_reg
= 0x29ec,
746 .enable_mask
= BIT(9),
747 .hw
.init
= &(struct clk_init_data
){
748 .name
= "gsbi2_qup_clk",
749 .parent_names
= (const char *[]){ "gsbi2_qup_src" },
751 .ops
= &clk_branch_ops
,
752 .flags
= CLK_SET_RATE_PARENT
,
757 static struct clk_rcg gsbi4_qup_src
= {
762 .mnctr_reset_bit
= 7,
763 .mnctr_mode_shift
= 5,
774 .parent_map
= gcc_pxo_pll8_map
,
776 .freq_tbl
= clk_tbl_gsbi_qup
,
778 .enable_reg
= 0x2a2c,
779 .enable_mask
= BIT(11),
780 .hw
.init
= &(struct clk_init_data
){
781 .name
= "gsbi4_qup_src",
782 .parent_names
= gcc_pxo_pll8
,
785 .flags
= CLK_SET_PARENT_GATE
,
790 static struct clk_branch gsbi4_qup_clk
= {
794 .enable_reg
= 0x2a2c,
795 .enable_mask
= BIT(9),
796 .hw
.init
= &(struct clk_init_data
){
797 .name
= "gsbi4_qup_clk",
798 .parent_names
= (const char *[]){ "gsbi4_qup_src" },
800 .ops
= &clk_branch_ops
,
801 .flags
= CLK_SET_RATE_PARENT
,
806 static struct clk_rcg gsbi5_qup_src
= {
811 .mnctr_reset_bit
= 7,
812 .mnctr_mode_shift
= 5,
823 .parent_map
= gcc_pxo_pll8_map
,
825 .freq_tbl
= clk_tbl_gsbi_qup
,
827 .enable_reg
= 0x2a4c,
828 .enable_mask
= BIT(11),
829 .hw
.init
= &(struct clk_init_data
){
830 .name
= "gsbi5_qup_src",
831 .parent_names
= gcc_pxo_pll8
,
834 .flags
= CLK_SET_PARENT_GATE
,
839 static struct clk_branch gsbi5_qup_clk
= {
843 .enable_reg
= 0x2a4c,
844 .enable_mask
= BIT(9),
845 .hw
.init
= &(struct clk_init_data
){
846 .name
= "gsbi5_qup_clk",
847 .parent_names
= (const char *[]){ "gsbi5_qup_src" },
849 .ops
= &clk_branch_ops
,
850 .flags
= CLK_SET_RATE_PARENT
,
855 static struct clk_rcg gsbi6_qup_src
= {
860 .mnctr_reset_bit
= 7,
861 .mnctr_mode_shift
= 5,
872 .parent_map
= gcc_pxo_pll8_map
,
874 .freq_tbl
= clk_tbl_gsbi_qup
,
876 .enable_reg
= 0x2a6c,
877 .enable_mask
= BIT(11),
878 .hw
.init
= &(struct clk_init_data
){
879 .name
= "gsbi6_qup_src",
880 .parent_names
= gcc_pxo_pll8
,
883 .flags
= CLK_SET_PARENT_GATE
,
888 static struct clk_branch gsbi6_qup_clk
= {
892 .enable_reg
= 0x2a6c,
893 .enable_mask
= BIT(9),
894 .hw
.init
= &(struct clk_init_data
){
895 .name
= "gsbi6_qup_clk",
896 .parent_names
= (const char *[]){ "gsbi6_qup_src" },
898 .ops
= &clk_branch_ops
,
899 .flags
= CLK_SET_RATE_PARENT
,
904 static struct clk_rcg gsbi7_qup_src
= {
909 .mnctr_reset_bit
= 7,
910 .mnctr_mode_shift
= 5,
921 .parent_map
= gcc_pxo_pll8_map
,
923 .freq_tbl
= clk_tbl_gsbi_qup
,
925 .enable_reg
= 0x2a8c,
926 .enable_mask
= BIT(11),
927 .hw
.init
= &(struct clk_init_data
){
928 .name
= "gsbi7_qup_src",
929 .parent_names
= gcc_pxo_pll8
,
932 .flags
= CLK_SET_PARENT_GATE
,
937 static struct clk_branch gsbi7_qup_clk
= {
941 .enable_reg
= 0x2a8c,
942 .enable_mask
= BIT(9),
943 .hw
.init
= &(struct clk_init_data
){
944 .name
= "gsbi7_qup_clk",
945 .parent_names
= (const char *[]){ "gsbi7_qup_src" },
947 .ops
= &clk_branch_ops
,
948 .flags
= CLK_SET_RATE_PARENT
,
953 static struct clk_branch gsbi1_h_clk
= {
959 .enable_reg
= 0x29c0,
960 .enable_mask
= BIT(4),
961 .hw
.init
= &(struct clk_init_data
){
962 .name
= "gsbi1_h_clk",
963 .ops
= &clk_branch_ops
,
968 static struct clk_branch gsbi2_h_clk
= {
974 .enable_reg
= 0x29e0,
975 .enable_mask
= BIT(4),
976 .hw
.init
= &(struct clk_init_data
){
977 .name
= "gsbi2_h_clk",
978 .ops
= &clk_branch_ops
,
983 static struct clk_branch gsbi4_h_clk
= {
989 .enable_reg
= 0x2a20,
990 .enable_mask
= BIT(4),
991 .hw
.init
= &(struct clk_init_data
){
992 .name
= "gsbi4_h_clk",
993 .ops
= &clk_branch_ops
,
998 static struct clk_branch gsbi5_h_clk
= {
1004 .enable_reg
= 0x2a40,
1005 .enable_mask
= BIT(4),
1006 .hw
.init
= &(struct clk_init_data
){
1007 .name
= "gsbi5_h_clk",
1008 .ops
= &clk_branch_ops
,
1013 static struct clk_branch gsbi6_h_clk
= {
1019 .enable_reg
= 0x2a60,
1020 .enable_mask
= BIT(4),
1021 .hw
.init
= &(struct clk_init_data
){
1022 .name
= "gsbi6_h_clk",
1023 .ops
= &clk_branch_ops
,
1028 static struct clk_branch gsbi7_h_clk
= {
1034 .enable_reg
= 0x2a80,
1035 .enable_mask
= BIT(4),
1036 .hw
.init
= &(struct clk_init_data
){
1037 .name
= "gsbi7_h_clk",
1038 .ops
= &clk_branch_ops
,
1043 static const struct freq_tbl clk_tbl_gp
[] = {
1044 { 12500000, P_PXO
, 2, 0, 0 },
1045 { 25000000, P_PXO
, 1, 0, 0 },
1046 { 64000000, P_PLL8
, 2, 1, 3 },
1047 { 76800000, P_PLL8
, 1, 1, 5 },
1048 { 96000000, P_PLL8
, 4, 0, 0 },
1049 { 128000000, P_PLL8
, 3, 0, 0 },
1050 { 192000000, P_PLL8
, 2, 0, 0 },
1054 static struct clk_rcg gp0_src
= {
1059 .mnctr_reset_bit
= 7,
1060 .mnctr_mode_shift
= 5,
1071 .parent_map
= gcc_pxo_pll8_cxo_map
,
1073 .freq_tbl
= clk_tbl_gp
,
1075 .enable_reg
= 0x2d24,
1076 .enable_mask
= BIT(11),
1077 .hw
.init
= &(struct clk_init_data
){
1079 .parent_names
= gcc_pxo_pll8_cxo
,
1081 .ops
= &clk_rcg_ops
,
1082 .flags
= CLK_SET_PARENT_GATE
,
1087 static struct clk_branch gp0_clk
= {
1091 .enable_reg
= 0x2d24,
1092 .enable_mask
= BIT(9),
1093 .hw
.init
= &(struct clk_init_data
){
1095 .parent_names
= (const char *[]){ "gp0_src" },
1097 .ops
= &clk_branch_ops
,
1098 .flags
= CLK_SET_RATE_PARENT
,
1103 static struct clk_rcg gp1_src
= {
1108 .mnctr_reset_bit
= 7,
1109 .mnctr_mode_shift
= 5,
1120 .parent_map
= gcc_pxo_pll8_cxo_map
,
1122 .freq_tbl
= clk_tbl_gp
,
1124 .enable_reg
= 0x2d44,
1125 .enable_mask
= BIT(11),
1126 .hw
.init
= &(struct clk_init_data
){
1128 .parent_names
= gcc_pxo_pll8_cxo
,
1130 .ops
= &clk_rcg_ops
,
1131 .flags
= CLK_SET_RATE_GATE
,
1136 static struct clk_branch gp1_clk
= {
1140 .enable_reg
= 0x2d44,
1141 .enable_mask
= BIT(9),
1142 .hw
.init
= &(struct clk_init_data
){
1144 .parent_names
= (const char *[]){ "gp1_src" },
1146 .ops
= &clk_branch_ops
,
1147 .flags
= CLK_SET_RATE_PARENT
,
1152 static struct clk_rcg gp2_src
= {
1157 .mnctr_reset_bit
= 7,
1158 .mnctr_mode_shift
= 5,
1169 .parent_map
= gcc_pxo_pll8_cxo_map
,
1171 .freq_tbl
= clk_tbl_gp
,
1173 .enable_reg
= 0x2d64,
1174 .enable_mask
= BIT(11),
1175 .hw
.init
= &(struct clk_init_data
){
1177 .parent_names
= gcc_pxo_pll8_cxo
,
1179 .ops
= &clk_rcg_ops
,
1180 .flags
= CLK_SET_RATE_GATE
,
1185 static struct clk_branch gp2_clk
= {
1189 .enable_reg
= 0x2d64,
1190 .enable_mask
= BIT(9),
1191 .hw
.init
= &(struct clk_init_data
){
1193 .parent_names
= (const char *[]){ "gp2_src" },
1195 .ops
= &clk_branch_ops
,
1196 .flags
= CLK_SET_RATE_PARENT
,
1201 static struct clk_branch pmem_clk
= {
1207 .enable_reg
= 0x25a0,
1208 .enable_mask
= BIT(4),
1209 .hw
.init
= &(struct clk_init_data
){
1211 .ops
= &clk_branch_ops
,
1216 static struct clk_rcg prng_src
= {
1224 .parent_map
= gcc_pxo_pll8_map
,
1227 .enable_reg
= 0x2e80,
1228 .enable_mask
= BIT(11),
1229 .hw
.init
= &(struct clk_init_data
){
1231 .parent_names
= gcc_pxo_pll8
,
1233 .ops
= &clk_rcg_ops
,
1238 static struct clk_branch prng_clk
= {
1240 .halt_check
= BRANCH_HALT_VOTED
,
1243 .enable_reg
= 0x3080,
1244 .enable_mask
= BIT(10),
1245 .hw
.init
= &(struct clk_init_data
){
1247 .parent_names
= (const char *[]){ "prng_src" },
1249 .ops
= &clk_branch_ops
,
1254 static const struct freq_tbl clk_tbl_sdc
[] = {
1255 { 200000, P_PXO
, 2, 2, 125 },
1256 { 400000, P_PLL8
, 4, 1, 240 },
1257 { 16000000, P_PLL8
, 4, 1, 6 },
1258 { 17070000, P_PLL8
, 1, 2, 45 },
1259 { 20210000, P_PLL8
, 1, 1, 19 },
1260 { 24000000, P_PLL8
, 4, 1, 4 },
1261 { 48000000, P_PLL8
, 4, 1, 2 },
1262 { 64000000, P_PLL8
, 3, 1, 2 },
1263 { 96000000, P_PLL8
, 4, 0, 0 },
1264 { 192000000, P_PLL8
, 2, 0, 0 },
1268 static struct clk_rcg sdc1_src
= {
1273 .mnctr_reset_bit
= 7,
1274 .mnctr_mode_shift
= 5,
1285 .parent_map
= gcc_pxo_pll8_map
,
1287 .freq_tbl
= clk_tbl_sdc
,
1289 .enable_reg
= 0x282c,
1290 .enable_mask
= BIT(11),
1291 .hw
.init
= &(struct clk_init_data
){
1293 .parent_names
= gcc_pxo_pll8
,
1295 .ops
= &clk_rcg_ops
,
1300 static struct clk_branch sdc1_clk
= {
1304 .enable_reg
= 0x282c,
1305 .enable_mask
= BIT(9),
1306 .hw
.init
= &(struct clk_init_data
){
1308 .parent_names
= (const char *[]){ "sdc1_src" },
1310 .ops
= &clk_branch_ops
,
1311 .flags
= CLK_SET_RATE_PARENT
,
1316 static struct clk_rcg sdc3_src
= {
1321 .mnctr_reset_bit
= 7,
1322 .mnctr_mode_shift
= 5,
1333 .parent_map
= gcc_pxo_pll8_map
,
1335 .freq_tbl
= clk_tbl_sdc
,
1337 .enable_reg
= 0x286c,
1338 .enable_mask
= BIT(11),
1339 .hw
.init
= &(struct clk_init_data
){
1341 .parent_names
= gcc_pxo_pll8
,
1343 .ops
= &clk_rcg_ops
,
1348 static struct clk_branch sdc3_clk
= {
1352 .enable_reg
= 0x286c,
1353 .enable_mask
= BIT(9),
1354 .hw
.init
= &(struct clk_init_data
){
1356 .parent_names
= (const char *[]){ "sdc3_src" },
1358 .ops
= &clk_branch_ops
,
1359 .flags
= CLK_SET_RATE_PARENT
,
1364 static struct clk_branch sdc1_h_clk
= {
1370 .enable_reg
= 0x2820,
1371 .enable_mask
= BIT(4),
1372 .hw
.init
= &(struct clk_init_data
){
1373 .name
= "sdc1_h_clk",
1374 .ops
= &clk_branch_ops
,
1379 static struct clk_branch sdc3_h_clk
= {
1385 .enable_reg
= 0x2860,
1386 .enable_mask
= BIT(4),
1387 .hw
.init
= &(struct clk_init_data
){
1388 .name
= "sdc3_h_clk",
1389 .ops
= &clk_branch_ops
,
1394 static const struct freq_tbl clk_tbl_tsif_ref
[] = {
1395 { 105000, P_PXO
, 1, 1, 256 },
1399 static struct clk_rcg tsif_ref_src
= {
1404 .mnctr_reset_bit
= 7,
1405 .mnctr_mode_shift
= 5,
1416 .parent_map
= gcc_pxo_pll8_map
,
1418 .freq_tbl
= clk_tbl_tsif_ref
,
1420 .enable_reg
= 0x2710,
1421 .enable_mask
= BIT(11),
1422 .hw
.init
= &(struct clk_init_data
){
1423 .name
= "tsif_ref_src",
1424 .parent_names
= gcc_pxo_pll8
,
1426 .ops
= &clk_rcg_ops
,
1431 static struct clk_branch tsif_ref_clk
= {
1435 .enable_reg
= 0x2710,
1436 .enable_mask
= BIT(9),
1437 .hw
.init
= &(struct clk_init_data
){
1438 .name
= "tsif_ref_clk",
1439 .parent_names
= (const char *[]){ "tsif_ref_src" },
1441 .ops
= &clk_branch_ops
,
1442 .flags
= CLK_SET_RATE_PARENT
,
1447 static struct clk_branch tsif_h_clk
= {
1453 .enable_reg
= 0x2700,
1454 .enable_mask
= BIT(4),
1455 .hw
.init
= &(struct clk_init_data
){
1456 .name
= "tsif_h_clk",
1457 .ops
= &clk_branch_ops
,
1462 static struct clk_branch dma_bam_h_clk
= {
1468 .enable_reg
= 0x25c0,
1469 .enable_mask
= BIT(4),
1470 .hw
.init
= &(struct clk_init_data
){
1471 .name
= "dma_bam_h_clk",
1472 .ops
= &clk_branch_ops
,
1477 static struct clk_branch adm0_clk
= {
1479 .halt_check
= BRANCH_HALT_VOTED
,
1482 .enable_reg
= 0x3080,
1483 .enable_mask
= BIT(2),
1484 .hw
.init
= &(struct clk_init_data
){
1486 .ops
= &clk_branch_ops
,
1491 static struct clk_branch adm0_pbus_clk
= {
1495 .halt_check
= BRANCH_HALT_VOTED
,
1498 .enable_reg
= 0x3080,
1499 .enable_mask
= BIT(3),
1500 .hw
.init
= &(struct clk_init_data
){
1501 .name
= "adm0_pbus_clk",
1502 .ops
= &clk_branch_ops
,
1507 static struct clk_branch pmic_arb0_h_clk
= {
1509 .halt_check
= BRANCH_HALT_VOTED
,
1512 .enable_reg
= 0x3080,
1513 .enable_mask
= BIT(8),
1514 .hw
.init
= &(struct clk_init_data
){
1515 .name
= "pmic_arb0_h_clk",
1516 .ops
= &clk_branch_ops
,
1521 static struct clk_branch pmic_arb1_h_clk
= {
1523 .halt_check
= BRANCH_HALT_VOTED
,
1526 .enable_reg
= 0x3080,
1527 .enable_mask
= BIT(9),
1528 .hw
.init
= &(struct clk_init_data
){
1529 .name
= "pmic_arb1_h_clk",
1530 .ops
= &clk_branch_ops
,
1535 static struct clk_branch pmic_ssbi2_clk
= {
1537 .halt_check
= BRANCH_HALT_VOTED
,
1540 .enable_reg
= 0x3080,
1541 .enable_mask
= BIT(7),
1542 .hw
.init
= &(struct clk_init_data
){
1543 .name
= "pmic_ssbi2_clk",
1544 .ops
= &clk_branch_ops
,
1549 static struct clk_branch rpm_msg_ram_h_clk
= {
1553 .halt_check
= BRANCH_HALT_VOTED
,
1556 .enable_reg
= 0x3080,
1557 .enable_mask
= BIT(6),
1558 .hw
.init
= &(struct clk_init_data
){
1559 .name
= "rpm_msg_ram_h_clk",
1560 .ops
= &clk_branch_ops
,
1565 static const struct freq_tbl clk_tbl_pcie_ref
[] = {
1566 { 100000000, P_PLL3
, 12, 0, 0 },
1570 static struct clk_rcg pcie_ref_src
= {
1578 .parent_map
= gcc_pxo_pll3_map
,
1580 .freq_tbl
= clk_tbl_pcie_ref
,
1582 .enable_reg
= 0x3860,
1583 .enable_mask
= BIT(11),
1584 .hw
.init
= &(struct clk_init_data
){
1585 .name
= "pcie_ref_src",
1586 .parent_names
= gcc_pxo_pll3
,
1588 .ops
= &clk_rcg_ops
,
1589 .flags
= CLK_SET_RATE_GATE
,
1594 static struct clk_branch pcie_ref_src_clk
= {
1598 .enable_reg
= 0x3860,
1599 .enable_mask
= BIT(9),
1600 .hw
.init
= &(struct clk_init_data
){
1601 .name
= "pcie_ref_src_clk",
1602 .parent_names
= (const char *[]){ "pcie_ref_src" },
1604 .ops
= &clk_branch_ops
,
1605 .flags
= CLK_SET_RATE_PARENT
,
1610 static struct clk_branch pcie_a_clk
= {
1614 .enable_reg
= 0x22c0,
1615 .enable_mask
= BIT(4),
1616 .hw
.init
= &(struct clk_init_data
){
1617 .name
= "pcie_a_clk",
1618 .ops
= &clk_branch_ops
,
1623 static struct clk_branch pcie_aux_clk
= {
1627 .enable_reg
= 0x22c8,
1628 .enable_mask
= BIT(4),
1629 .hw
.init
= &(struct clk_init_data
){
1630 .name
= "pcie_aux_clk",
1631 .ops
= &clk_branch_ops
,
1636 static struct clk_branch pcie_h_clk
= {
1640 .enable_reg
= 0x22cc,
1641 .enable_mask
= BIT(4),
1642 .hw
.init
= &(struct clk_init_data
){
1643 .name
= "pcie_h_clk",
1644 .ops
= &clk_branch_ops
,
1649 static struct clk_branch pcie_phy_clk
= {
1653 .enable_reg
= 0x22d0,
1654 .enable_mask
= BIT(4),
1655 .hw
.init
= &(struct clk_init_data
){
1656 .name
= "pcie_phy_clk",
1657 .ops
= &clk_branch_ops
,
1662 static struct clk_rcg pcie1_ref_src
= {
1670 .parent_map
= gcc_pxo_pll3_map
,
1672 .freq_tbl
= clk_tbl_pcie_ref
,
1674 .enable_reg
= 0x3aa0,
1675 .enable_mask
= BIT(11),
1676 .hw
.init
= &(struct clk_init_data
){
1677 .name
= "pcie1_ref_src",
1678 .parent_names
= gcc_pxo_pll3
,
1680 .ops
= &clk_rcg_ops
,
1681 .flags
= CLK_SET_RATE_GATE
,
1686 static struct clk_branch pcie1_ref_src_clk
= {
1690 .enable_reg
= 0x3aa0,
1691 .enable_mask
= BIT(9),
1692 .hw
.init
= &(struct clk_init_data
){
1693 .name
= "pcie1_ref_src_clk",
1694 .parent_names
= (const char *[]){ "pcie1_ref_src" },
1696 .ops
= &clk_branch_ops
,
1697 .flags
= CLK_SET_RATE_PARENT
,
1702 static struct clk_branch pcie1_a_clk
= {
1706 .enable_reg
= 0x3a80,
1707 .enable_mask
= BIT(4),
1708 .hw
.init
= &(struct clk_init_data
){
1709 .name
= "pcie1_a_clk",
1710 .ops
= &clk_branch_ops
,
1715 static struct clk_branch pcie1_aux_clk
= {
1719 .enable_reg
= 0x3a88,
1720 .enable_mask
= BIT(4),
1721 .hw
.init
= &(struct clk_init_data
){
1722 .name
= "pcie1_aux_clk",
1723 .ops
= &clk_branch_ops
,
1728 static struct clk_branch pcie1_h_clk
= {
1732 .enable_reg
= 0x3a8c,
1733 .enable_mask
= BIT(4),
1734 .hw
.init
= &(struct clk_init_data
){
1735 .name
= "pcie1_h_clk",
1736 .ops
= &clk_branch_ops
,
1741 static struct clk_branch pcie1_phy_clk
= {
1745 .enable_reg
= 0x3a90,
1746 .enable_mask
= BIT(4),
1747 .hw
.init
= &(struct clk_init_data
){
1748 .name
= "pcie1_phy_clk",
1749 .ops
= &clk_branch_ops
,
1754 static struct clk_rcg pcie2_ref_src
= {
1762 .parent_map
= gcc_pxo_pll3_map
,
1764 .freq_tbl
= clk_tbl_pcie_ref
,
1766 .enable_reg
= 0x3ae0,
1767 .enable_mask
= BIT(11),
1768 .hw
.init
= &(struct clk_init_data
){
1769 .name
= "pcie2_ref_src",
1770 .parent_names
= gcc_pxo_pll3
,
1772 .ops
= &clk_rcg_ops
,
1773 .flags
= CLK_SET_RATE_GATE
,
1778 static struct clk_branch pcie2_ref_src_clk
= {
1782 .enable_reg
= 0x3ae0,
1783 .enable_mask
= BIT(9),
1784 .hw
.init
= &(struct clk_init_data
){
1785 .name
= "pcie2_ref_src_clk",
1786 .parent_names
= (const char *[]){ "pcie2_ref_src" },
1788 .ops
= &clk_branch_ops
,
1789 .flags
= CLK_SET_RATE_PARENT
,
1794 static struct clk_branch pcie2_a_clk
= {
1798 .enable_reg
= 0x3ac0,
1799 .enable_mask
= BIT(4),
1800 .hw
.init
= &(struct clk_init_data
){
1801 .name
= "pcie2_a_clk",
1802 .ops
= &clk_branch_ops
,
1807 static struct clk_branch pcie2_aux_clk
= {
1811 .enable_reg
= 0x3ac8,
1812 .enable_mask
= BIT(4),
1813 .hw
.init
= &(struct clk_init_data
){
1814 .name
= "pcie2_aux_clk",
1815 .ops
= &clk_branch_ops
,
1820 static struct clk_branch pcie2_h_clk
= {
1824 .enable_reg
= 0x3acc,
1825 .enable_mask
= BIT(4),
1826 .hw
.init
= &(struct clk_init_data
){
1827 .name
= "pcie2_h_clk",
1828 .ops
= &clk_branch_ops
,
1833 static struct clk_branch pcie2_phy_clk
= {
1837 .enable_reg
= 0x3ad0,
1838 .enable_mask
= BIT(4),
1839 .hw
.init
= &(struct clk_init_data
){
1840 .name
= "pcie2_phy_clk",
1841 .ops
= &clk_branch_ops
,
1846 static const struct freq_tbl clk_tbl_sata_ref
[] = {
1847 { 100000000, P_PLL3
, 12, 0, 0 },
1851 static struct clk_rcg sata_ref_src
= {
1859 .parent_map
= gcc_pxo_pll3_sata_map
,
1861 .freq_tbl
= clk_tbl_sata_ref
,
1863 .enable_reg
= 0x2c08,
1864 .enable_mask
= BIT(7),
1865 .hw
.init
= &(struct clk_init_data
){
1866 .name
= "sata_ref_src",
1867 .parent_names
= gcc_pxo_pll3
,
1869 .ops
= &clk_rcg_ops
,
1870 .flags
= CLK_SET_RATE_GATE
,
1875 static struct clk_branch sata_rxoob_clk
= {
1879 .enable_reg
= 0x2c0c,
1880 .enable_mask
= BIT(4),
1881 .hw
.init
= &(struct clk_init_data
){
1882 .name
= "sata_rxoob_clk",
1883 .parent_names
= (const char *[]){ "sata_ref_src" },
1885 .ops
= &clk_branch_ops
,
1886 .flags
= CLK_SET_RATE_PARENT
,
1891 static struct clk_branch sata_pmalive_clk
= {
1895 .enable_reg
= 0x2c10,
1896 .enable_mask
= BIT(4),
1897 .hw
.init
= &(struct clk_init_data
){
1898 .name
= "sata_pmalive_clk",
1899 .parent_names
= (const char *[]){ "sata_ref_src" },
1901 .ops
= &clk_branch_ops
,
1902 .flags
= CLK_SET_RATE_PARENT
,
1907 static struct clk_branch sata_phy_ref_clk
= {
1911 .enable_reg
= 0x2c14,
1912 .enable_mask
= BIT(4),
1913 .hw
.init
= &(struct clk_init_data
){
1914 .name
= "sata_phy_ref_clk",
1915 .parent_names
= (const char *[]){ "pxo" },
1917 .ops
= &clk_branch_ops
,
1922 static struct clk_branch sata_a_clk
= {
1926 .enable_reg
= 0x2c20,
1927 .enable_mask
= BIT(4),
1928 .hw
.init
= &(struct clk_init_data
){
1929 .name
= "sata_a_clk",
1930 .ops
= &clk_branch_ops
,
1935 static struct clk_branch sata_h_clk
= {
1939 .enable_reg
= 0x2c00,
1940 .enable_mask
= BIT(4),
1941 .hw
.init
= &(struct clk_init_data
){
1942 .name
= "sata_h_clk",
1943 .ops
= &clk_branch_ops
,
1948 static struct clk_branch sfab_sata_s_h_clk
= {
1952 .enable_reg
= 0x2480,
1953 .enable_mask
= BIT(4),
1954 .hw
.init
= &(struct clk_init_data
){
1955 .name
= "sfab_sata_s_h_clk",
1956 .ops
= &clk_branch_ops
,
1961 static struct clk_branch sata_phy_cfg_clk
= {
1965 .enable_reg
= 0x2c40,
1966 .enable_mask
= BIT(4),
1967 .hw
.init
= &(struct clk_init_data
){
1968 .name
= "sata_phy_cfg_clk",
1969 .ops
= &clk_branch_ops
,
1974 static const struct freq_tbl clk_tbl_usb30_master
[] = {
1975 { 125000000, P_PLL0
, 1, 5, 32 },
1979 static struct clk_rcg usb30_master_clk_src
= {
1984 .mnctr_reset_bit
= 7,
1985 .mnctr_mode_shift
= 5,
1996 .parent_map
= gcc_pxo_pll8_pll0
,
1998 .freq_tbl
= clk_tbl_usb30_master
,
2000 .enable_reg
= 0x3b2c,
2001 .enable_mask
= BIT(11),
2002 .hw
.init
= &(struct clk_init_data
){
2003 .name
= "usb30_master_ref_src",
2004 .parent_names
= gcc_pxo_pll8_pll0_map
,
2006 .ops
= &clk_rcg_ops
,
2007 .flags
= CLK_SET_RATE_GATE
,
2012 static struct clk_branch usb30_0_branch_clk
= {
2016 .enable_reg
= 0x3b24,
2017 .enable_mask
= BIT(4),
2018 .hw
.init
= &(struct clk_init_data
){
2019 .name
= "usb30_0_branch_clk",
2020 .parent_names
= (const char *[]){ "usb30_master_ref_src", },
2022 .ops
= &clk_branch_ops
,
2023 .flags
= CLK_SET_RATE_PARENT
,
2028 static struct clk_branch usb30_1_branch_clk
= {
2032 .enable_reg
= 0x3b34,
2033 .enable_mask
= BIT(4),
2034 .hw
.init
= &(struct clk_init_data
){
2035 .name
= "usb30_1_branch_clk",
2036 .parent_names
= (const char *[]){ "usb30_master_ref_src", },
2038 .ops
= &clk_branch_ops
,
2039 .flags
= CLK_SET_RATE_PARENT
,
2044 static const struct freq_tbl clk_tbl_usb30_utmi
[] = {
2045 { 60000000, P_PLL8
, 1, 5, 32 },
2049 static struct clk_rcg usb30_utmi_clk
= {
2054 .mnctr_reset_bit
= 7,
2055 .mnctr_mode_shift
= 5,
2066 .parent_map
= gcc_pxo_pll8_pll0
,
2068 .freq_tbl
= clk_tbl_usb30_utmi
,
2070 .enable_reg
= 0x3b44,
2071 .enable_mask
= BIT(11),
2072 .hw
.init
= &(struct clk_init_data
){
2073 .name
= "usb30_utmi_clk",
2074 .parent_names
= gcc_pxo_pll8_pll0_map
,
2076 .ops
= &clk_rcg_ops
,
2077 .flags
= CLK_SET_RATE_GATE
,
2082 static struct clk_branch usb30_0_utmi_clk_ctl
= {
2086 .enable_reg
= 0x3b48,
2087 .enable_mask
= BIT(4),
2088 .hw
.init
= &(struct clk_init_data
){
2089 .name
= "usb30_0_utmi_clk_ctl",
2090 .parent_names
= (const char *[]){ "usb30_utmi_clk", },
2092 .ops
= &clk_branch_ops
,
2093 .flags
= CLK_SET_RATE_PARENT
,
2098 static struct clk_branch usb30_1_utmi_clk_ctl
= {
2102 .enable_reg
= 0x3b4c,
2103 .enable_mask
= BIT(4),
2104 .hw
.init
= &(struct clk_init_data
){
2105 .name
= "usb30_1_utmi_clk_ctl",
2106 .parent_names
= (const char *[]){ "usb30_utmi_clk", },
2108 .ops
= &clk_branch_ops
,
2109 .flags
= CLK_SET_RATE_PARENT
,
2114 static const struct freq_tbl clk_tbl_usb
[] = {
2115 { 60000000, P_PLL8
, 1, 5, 32 },
2119 static struct clk_rcg usb_hs1_xcvr_clk_src
= {
2124 .mnctr_reset_bit
= 7,
2125 .mnctr_mode_shift
= 5,
2136 .parent_map
= gcc_pxo_pll8_pll0
,
2138 .freq_tbl
= clk_tbl_usb
,
2140 .enable_reg
= 0x2968,
2141 .enable_mask
= BIT(11),
2142 .hw
.init
= &(struct clk_init_data
){
2143 .name
= "usb_hs1_xcvr_src",
2144 .parent_names
= gcc_pxo_pll8_pll0_map
,
2146 .ops
= &clk_rcg_ops
,
2147 .flags
= CLK_SET_RATE_GATE
,
2152 static struct clk_branch usb_hs1_xcvr_clk
= {
2156 .enable_reg
= 0x290c,
2157 .enable_mask
= BIT(9),
2158 .hw
.init
= &(struct clk_init_data
){
2159 .name
= "usb_hs1_xcvr_clk",
2160 .parent_names
= (const char *[]){ "usb_hs1_xcvr_src" },
2162 .ops
= &clk_branch_ops
,
2163 .flags
= CLK_SET_RATE_PARENT
,
2168 static struct clk_branch usb_hs1_h_clk
= {
2174 .enable_reg
= 0x2900,
2175 .enable_mask
= BIT(4),
2176 .hw
.init
= &(struct clk_init_data
){
2177 .name
= "usb_hs1_h_clk",
2178 .ops
= &clk_branch_ops
,
2183 static struct clk_rcg usb_fs1_xcvr_clk_src
= {
2188 .mnctr_reset_bit
= 7,
2189 .mnctr_mode_shift
= 5,
2200 .parent_map
= gcc_pxo_pll8_pll0
,
2202 .freq_tbl
= clk_tbl_usb
,
2204 .enable_reg
= 0x2968,
2205 .enable_mask
= BIT(11),
2206 .hw
.init
= &(struct clk_init_data
){
2207 .name
= "usb_fs1_xcvr_src",
2208 .parent_names
= gcc_pxo_pll8_pll0_map
,
2210 .ops
= &clk_rcg_ops
,
2211 .flags
= CLK_SET_RATE_GATE
,
2216 static struct clk_branch usb_fs1_xcvr_clk
= {
2220 .enable_reg
= 0x2968,
2221 .enable_mask
= BIT(9),
2222 .hw
.init
= &(struct clk_init_data
){
2223 .name
= "usb_fs1_xcvr_clk",
2224 .parent_names
= (const char *[]){ "usb_fs1_xcvr_src", },
2226 .ops
= &clk_branch_ops
,
2227 .flags
= CLK_SET_RATE_PARENT
,
2232 static struct clk_branch usb_fs1_sys_clk
= {
2236 .enable_reg
= 0x296c,
2237 .enable_mask
= BIT(4),
2238 .hw
.init
= &(struct clk_init_data
){
2239 .name
= "usb_fs1_sys_clk",
2240 .parent_names
= (const char *[]){ "usb_fs1_xcvr_src", },
2242 .ops
= &clk_branch_ops
,
2243 .flags
= CLK_SET_RATE_PARENT
,
2248 static struct clk_branch usb_fs1_h_clk
= {
2252 .enable_reg
= 0x2960,
2253 .enable_mask
= BIT(4),
2254 .hw
.init
= &(struct clk_init_data
){
2255 .name
= "usb_fs1_h_clk",
2256 .ops
= &clk_branch_ops
,
2261 static struct clk_branch ebi2_clk
= {
2267 .enable_reg
= 0x3b00,
2268 .enable_mask
= BIT(4),
2269 .hw
.init
= &(struct clk_init_data
){
2271 .ops
= &clk_branch_ops
,
2276 static struct clk_branch ebi2_aon_clk
= {
2280 .enable_reg
= 0x3b00,
2281 .enable_mask
= BIT(8),
2282 .hw
.init
= &(struct clk_init_data
){
2283 .name
= "ebi2_always_on_clk",
2284 .ops
= &clk_branch_ops
,
2289 static const struct freq_tbl clk_tbl_gmac
[] = {
2290 { 133000000, P_PLL0
, 1, 50, 301 },
2291 { 266000000, P_PLL0
, 1, 127, 382 },
2295 static struct clk_dyn_rcg gmac_core1_src
= {
2296 .ns_reg
[0] = 0x3cac,
2297 .ns_reg
[1] = 0x3cb0,
2298 .md_reg
[0] = 0x3ca4,
2299 .md_reg
[1] = 0x3ca8,
2303 .mnctr_reset_bit
= 7,
2304 .mnctr_mode_shift
= 5,
2311 .mnctr_reset_bit
= 7,
2312 .mnctr_mode_shift
= 5,
2319 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2323 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2334 .freq_tbl
= clk_tbl_gmac
,
2336 .enable_reg
= 0x3ca0,
2337 .enable_mask
= BIT(1),
2338 .hw
.init
= &(struct clk_init_data
){
2339 .name
= "gmac_core1_src",
2340 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2342 .ops
= &clk_dyn_rcg_ops
,
2347 static struct clk_branch gmac_core1_clk
= {
2353 .enable_reg
= 0x3cb4,
2354 .enable_mask
= BIT(4),
2355 .hw
.init
= &(struct clk_init_data
){
2356 .name
= "gmac_core1_clk",
2357 .parent_names
= (const char *[]){
2361 .ops
= &clk_branch_ops
,
2362 .flags
= CLK_SET_RATE_PARENT
,
2367 static struct clk_dyn_rcg gmac_core2_src
= {
2368 .ns_reg
[0] = 0x3ccc,
2369 .ns_reg
[1] = 0x3cd0,
2370 .md_reg
[0] = 0x3cc4,
2371 .md_reg
[1] = 0x3cc8,
2375 .mnctr_reset_bit
= 7,
2376 .mnctr_mode_shift
= 5,
2383 .mnctr_reset_bit
= 7,
2384 .mnctr_mode_shift
= 5,
2391 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2395 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2406 .freq_tbl
= clk_tbl_gmac
,
2408 .enable_reg
= 0x3cc0,
2409 .enable_mask
= BIT(1),
2410 .hw
.init
= &(struct clk_init_data
){
2411 .name
= "gmac_core2_src",
2412 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2414 .ops
= &clk_dyn_rcg_ops
,
2419 static struct clk_branch gmac_core2_clk
= {
2425 .enable_reg
= 0x3cd4,
2426 .enable_mask
= BIT(4),
2427 .hw
.init
= &(struct clk_init_data
){
2428 .name
= "gmac_core2_clk",
2429 .parent_names
= (const char *[]){
2433 .ops
= &clk_branch_ops
,
2434 .flags
= CLK_SET_RATE_PARENT
,
2439 static struct clk_dyn_rcg gmac_core3_src
= {
2440 .ns_reg
[0] = 0x3cec,
2441 .ns_reg
[1] = 0x3cf0,
2442 .md_reg
[0] = 0x3ce4,
2443 .md_reg
[1] = 0x3ce8,
2447 .mnctr_reset_bit
= 7,
2448 .mnctr_mode_shift
= 5,
2455 .mnctr_reset_bit
= 7,
2456 .mnctr_mode_shift
= 5,
2463 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2467 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2478 .freq_tbl
= clk_tbl_gmac
,
2480 .enable_reg
= 0x3ce0,
2481 .enable_mask
= BIT(1),
2482 .hw
.init
= &(struct clk_init_data
){
2483 .name
= "gmac_core3_src",
2484 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2486 .ops
= &clk_dyn_rcg_ops
,
2491 static struct clk_branch gmac_core3_clk
= {
2497 .enable_reg
= 0x3cf4,
2498 .enable_mask
= BIT(4),
2499 .hw
.init
= &(struct clk_init_data
){
2500 .name
= "gmac_core3_clk",
2501 .parent_names
= (const char *[]){
2505 .ops
= &clk_branch_ops
,
2506 .flags
= CLK_SET_RATE_PARENT
,
2511 static struct clk_dyn_rcg gmac_core4_src
= {
2512 .ns_reg
[0] = 0x3d0c,
2513 .ns_reg
[1] = 0x3d10,
2514 .md_reg
[0] = 0x3d04,
2515 .md_reg
[1] = 0x3d08,
2519 .mnctr_reset_bit
= 7,
2520 .mnctr_mode_shift
= 5,
2527 .mnctr_reset_bit
= 7,
2528 .mnctr_mode_shift
= 5,
2535 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2539 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2550 .freq_tbl
= clk_tbl_gmac
,
2552 .enable_reg
= 0x3d00,
2553 .enable_mask
= BIT(1),
2554 .hw
.init
= &(struct clk_init_data
){
2555 .name
= "gmac_core4_src",
2556 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2558 .ops
= &clk_dyn_rcg_ops
,
2563 static struct clk_branch gmac_core4_clk
= {
2569 .enable_reg
= 0x3d14,
2570 .enable_mask
= BIT(4),
2571 .hw
.init
= &(struct clk_init_data
){
2572 .name
= "gmac_core4_clk",
2573 .parent_names
= (const char *[]){
2577 .ops
= &clk_branch_ops
,
2578 .flags
= CLK_SET_RATE_PARENT
,
2583 static const struct freq_tbl clk_tbl_nss_tcm
[] = {
2584 { 266000000, P_PLL0
, 3, 0, 0 },
2585 { 400000000, P_PLL0
, 2, 0, 0 },
2589 static struct clk_dyn_rcg nss_tcm_src
= {
2590 .ns_reg
[0] = 0x3dc4,
2591 .ns_reg
[1] = 0x3dc8,
2595 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2599 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2610 .freq_tbl
= clk_tbl_nss_tcm
,
2612 .enable_reg
= 0x3dc0,
2613 .enable_mask
= BIT(1),
2614 .hw
.init
= &(struct clk_init_data
){
2615 .name
= "nss_tcm_src",
2616 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2618 .ops
= &clk_dyn_rcg_ops
,
2623 static struct clk_branch nss_tcm_clk
= {
2627 .enable_reg
= 0x3dd0,
2628 .enable_mask
= BIT(6) | BIT(4),
2629 .hw
.init
= &(struct clk_init_data
){
2630 .name
= "nss_tcm_clk",
2631 .parent_names
= (const char *[]){
2635 .ops
= &clk_branch_ops
,
2636 .flags
= CLK_SET_RATE_PARENT
,
2641 static const struct freq_tbl clk_tbl_nss
[] = {
2642 { 110000000, P_PLL18
, 1, 1, 5 },
2643 { 275000000, P_PLL18
, 2, 0, 0 },
2644 { 550000000, P_PLL18
, 1, 0, 0 },
2645 { 733000000, P_PLL18
, 1, 0, 0 },
2649 static struct clk_dyn_rcg ubi32_core1_src_clk
= {
2650 .ns_reg
[0] = 0x3d2c,
2651 .ns_reg
[1] = 0x3d30,
2652 .md_reg
[0] = 0x3d24,
2653 .md_reg
[1] = 0x3d28,
2657 .mnctr_reset_bit
= 7,
2658 .mnctr_mode_shift
= 5,
2665 .mnctr_reset_bit
= 7,
2666 .mnctr_mode_shift
= 5,
2673 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2677 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2688 .freq_tbl
= clk_tbl_nss
,
2690 .enable_reg
= 0x3d20,
2691 .enable_mask
= BIT(1),
2692 .hw
.init
= &(struct clk_init_data
){
2693 .name
= "ubi32_core1_src_clk",
2694 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2696 .ops
= &clk_dyn_rcg_ops
,
2697 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
2702 static struct clk_dyn_rcg ubi32_core2_src_clk
= {
2703 .ns_reg
[0] = 0x3d4c,
2704 .ns_reg
[1] = 0x3d50,
2705 .md_reg
[0] = 0x3d44,
2706 .md_reg
[1] = 0x3d48,
2710 .mnctr_reset_bit
= 7,
2711 .mnctr_mode_shift
= 5,
2718 .mnctr_reset_bit
= 7,
2719 .mnctr_mode_shift
= 5,
2726 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2730 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2741 .freq_tbl
= clk_tbl_nss
,
2743 .enable_reg
= 0x3d40,
2744 .enable_mask
= BIT(1),
2745 .hw
.init
= &(struct clk_init_data
){
2746 .name
= "ubi32_core2_src_clk",
2747 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2749 .ops
= &clk_dyn_rcg_ops
,
2750 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
2755 static struct clk_regmap
*gcc_ipq806x_clks
[] = {
2756 [PLL0
] = &pll0
.clkr
,
2757 [PLL0_VOTE
] = &pll0_vote
,
2758 [PLL3
] = &pll3
.clkr
,
2759 [PLL4_VOTE
] = &pll4_vote
,
2760 [PLL8
] = &pll8
.clkr
,
2761 [PLL8_VOTE
] = &pll8_vote
,
2762 [PLL14
] = &pll14
.clkr
,
2763 [PLL14_VOTE
] = &pll14_vote
,
2764 [PLL18
] = &pll18
.clkr
,
2765 [GSBI1_UART_SRC
] = &gsbi1_uart_src
.clkr
,
2766 [GSBI1_UART_CLK
] = &gsbi1_uart_clk
.clkr
,
2767 [GSBI2_UART_SRC
] = &gsbi2_uart_src
.clkr
,
2768 [GSBI2_UART_CLK
] = &gsbi2_uart_clk
.clkr
,
2769 [GSBI4_UART_SRC
] = &gsbi4_uart_src
.clkr
,
2770 [GSBI4_UART_CLK
] = &gsbi4_uart_clk
.clkr
,
2771 [GSBI5_UART_SRC
] = &gsbi5_uart_src
.clkr
,
2772 [GSBI5_UART_CLK
] = &gsbi5_uart_clk
.clkr
,
2773 [GSBI6_UART_SRC
] = &gsbi6_uart_src
.clkr
,
2774 [GSBI6_UART_CLK
] = &gsbi6_uart_clk
.clkr
,
2775 [GSBI7_UART_SRC
] = &gsbi7_uart_src
.clkr
,
2776 [GSBI7_UART_CLK
] = &gsbi7_uart_clk
.clkr
,
2777 [GSBI1_QUP_SRC
] = &gsbi1_qup_src
.clkr
,
2778 [GSBI1_QUP_CLK
] = &gsbi1_qup_clk
.clkr
,
2779 [GSBI2_QUP_SRC
] = &gsbi2_qup_src
.clkr
,
2780 [GSBI2_QUP_CLK
] = &gsbi2_qup_clk
.clkr
,
2781 [GSBI4_QUP_SRC
] = &gsbi4_qup_src
.clkr
,
2782 [GSBI4_QUP_CLK
] = &gsbi4_qup_clk
.clkr
,
2783 [GSBI5_QUP_SRC
] = &gsbi5_qup_src
.clkr
,
2784 [GSBI5_QUP_CLK
] = &gsbi5_qup_clk
.clkr
,
2785 [GSBI6_QUP_SRC
] = &gsbi6_qup_src
.clkr
,
2786 [GSBI6_QUP_CLK
] = &gsbi6_qup_clk
.clkr
,
2787 [GSBI7_QUP_SRC
] = &gsbi7_qup_src
.clkr
,
2788 [GSBI7_QUP_CLK
] = &gsbi7_qup_clk
.clkr
,
2789 [GP0_SRC
] = &gp0_src
.clkr
,
2790 [GP0_CLK
] = &gp0_clk
.clkr
,
2791 [GP1_SRC
] = &gp1_src
.clkr
,
2792 [GP1_CLK
] = &gp1_clk
.clkr
,
2793 [GP2_SRC
] = &gp2_src
.clkr
,
2794 [GP2_CLK
] = &gp2_clk
.clkr
,
2795 [PMEM_A_CLK
] = &pmem_clk
.clkr
,
2796 [PRNG_SRC
] = &prng_src
.clkr
,
2797 [PRNG_CLK
] = &prng_clk
.clkr
,
2798 [SDC1_SRC
] = &sdc1_src
.clkr
,
2799 [SDC1_CLK
] = &sdc1_clk
.clkr
,
2800 [SDC3_SRC
] = &sdc3_src
.clkr
,
2801 [SDC3_CLK
] = &sdc3_clk
.clkr
,
2802 [TSIF_REF_SRC
] = &tsif_ref_src
.clkr
,
2803 [TSIF_REF_CLK
] = &tsif_ref_clk
.clkr
,
2804 [DMA_BAM_H_CLK
] = &dma_bam_h_clk
.clkr
,
2805 [GSBI1_H_CLK
] = &gsbi1_h_clk
.clkr
,
2806 [GSBI2_H_CLK
] = &gsbi2_h_clk
.clkr
,
2807 [GSBI4_H_CLK
] = &gsbi4_h_clk
.clkr
,
2808 [GSBI5_H_CLK
] = &gsbi5_h_clk
.clkr
,
2809 [GSBI6_H_CLK
] = &gsbi6_h_clk
.clkr
,
2810 [GSBI7_H_CLK
] = &gsbi7_h_clk
.clkr
,
2811 [TSIF_H_CLK
] = &tsif_h_clk
.clkr
,
2812 [SDC1_H_CLK
] = &sdc1_h_clk
.clkr
,
2813 [SDC3_H_CLK
] = &sdc3_h_clk
.clkr
,
2814 [ADM0_CLK
] = &adm0_clk
.clkr
,
2815 [ADM0_PBUS_CLK
] = &adm0_pbus_clk
.clkr
,
2816 [PCIE_A_CLK
] = &pcie_a_clk
.clkr
,
2817 [PCIE_AUX_CLK
] = &pcie_aux_clk
.clkr
,
2818 [PCIE_H_CLK
] = &pcie_h_clk
.clkr
,
2819 [PCIE_PHY_CLK
] = &pcie_phy_clk
.clkr
,
2820 [SFAB_SATA_S_H_CLK
] = &sfab_sata_s_h_clk
.clkr
,
2821 [PMIC_ARB0_H_CLK
] = &pmic_arb0_h_clk
.clkr
,
2822 [PMIC_ARB1_H_CLK
] = &pmic_arb1_h_clk
.clkr
,
2823 [PMIC_SSBI2_CLK
] = &pmic_ssbi2_clk
.clkr
,
2824 [RPM_MSG_RAM_H_CLK
] = &rpm_msg_ram_h_clk
.clkr
,
2825 [SATA_H_CLK
] = &sata_h_clk
.clkr
,
2826 [SATA_CLK_SRC
] = &sata_ref_src
.clkr
,
2827 [SATA_RXOOB_CLK
] = &sata_rxoob_clk
.clkr
,
2828 [SATA_PMALIVE_CLK
] = &sata_pmalive_clk
.clkr
,
2829 [SATA_PHY_REF_CLK
] = &sata_phy_ref_clk
.clkr
,
2830 [SATA_A_CLK
] = &sata_a_clk
.clkr
,
2831 [SATA_PHY_CFG_CLK
] = &sata_phy_cfg_clk
.clkr
,
2832 [PCIE_ALT_REF_SRC
] = &pcie_ref_src
.clkr
,
2833 [PCIE_ALT_REF_CLK
] = &pcie_ref_src_clk
.clkr
,
2834 [PCIE_1_A_CLK
] = &pcie1_a_clk
.clkr
,
2835 [PCIE_1_AUX_CLK
] = &pcie1_aux_clk
.clkr
,
2836 [PCIE_1_H_CLK
] = &pcie1_h_clk
.clkr
,
2837 [PCIE_1_PHY_CLK
] = &pcie1_phy_clk
.clkr
,
2838 [PCIE_1_ALT_REF_SRC
] = &pcie1_ref_src
.clkr
,
2839 [PCIE_1_ALT_REF_CLK
] = &pcie1_ref_src_clk
.clkr
,
2840 [PCIE_2_A_CLK
] = &pcie2_a_clk
.clkr
,
2841 [PCIE_2_AUX_CLK
] = &pcie2_aux_clk
.clkr
,
2842 [PCIE_2_H_CLK
] = &pcie2_h_clk
.clkr
,
2843 [PCIE_2_PHY_CLK
] = &pcie2_phy_clk
.clkr
,
2844 [PCIE_2_ALT_REF_SRC
] = &pcie2_ref_src
.clkr
,
2845 [PCIE_2_ALT_REF_CLK
] = &pcie2_ref_src_clk
.clkr
,
2846 [USB30_MASTER_SRC
] = &usb30_master_clk_src
.clkr
,
2847 [USB30_0_MASTER_CLK
] = &usb30_0_branch_clk
.clkr
,
2848 [USB30_1_MASTER_CLK
] = &usb30_1_branch_clk
.clkr
,
2849 [USB30_UTMI_SRC
] = &usb30_utmi_clk
.clkr
,
2850 [USB30_0_UTMI_CLK
] = &usb30_0_utmi_clk_ctl
.clkr
,
2851 [USB30_1_UTMI_CLK
] = &usb30_1_utmi_clk_ctl
.clkr
,
2852 [USB_HS1_H_CLK
] = &usb_hs1_h_clk
.clkr
,
2853 [USB_HS1_XCVR_SRC
] = &usb_hs1_xcvr_clk_src
.clkr
,
2854 [USB_HS1_XCVR_CLK
] = &usb_hs1_xcvr_clk
.clkr
,
2855 [USB_FS1_H_CLK
] = &usb_fs1_h_clk
.clkr
,
2856 [USB_FS1_XCVR_SRC
] = &usb_fs1_xcvr_clk_src
.clkr
,
2857 [USB_FS1_XCVR_CLK
] = &usb_fs1_xcvr_clk
.clkr
,
2858 [USB_FS1_SYSTEM_CLK
] = &usb_fs1_sys_clk
.clkr
,
2859 [EBI2_CLK
] = &ebi2_clk
.clkr
,
2860 [EBI2_AON_CLK
] = &ebi2_aon_clk
.clkr
,
2861 [GMAC_CORE1_CLK_SRC
] = &gmac_core1_src
.clkr
,
2862 [GMAC_CORE1_CLK
] = &gmac_core1_clk
.clkr
,
2863 [GMAC_CORE2_CLK_SRC
] = &gmac_core2_src
.clkr
,
2864 [GMAC_CORE2_CLK
] = &gmac_core2_clk
.clkr
,
2865 [GMAC_CORE3_CLK_SRC
] = &gmac_core3_src
.clkr
,
2866 [GMAC_CORE3_CLK
] = &gmac_core3_clk
.clkr
,
2867 [GMAC_CORE4_CLK_SRC
] = &gmac_core4_src
.clkr
,
2868 [GMAC_CORE4_CLK
] = &gmac_core4_clk
.clkr
,
2869 [UBI32_CORE1_CLK_SRC
] = &ubi32_core1_src_clk
.clkr
,
2870 [UBI32_CORE2_CLK_SRC
] = &ubi32_core2_src_clk
.clkr
,
2871 [NSSTCM_CLK_SRC
] = &nss_tcm_src
.clkr
,
2872 [NSSTCM_CLK
] = &nss_tcm_clk
.clkr
,
2873 [PLL9
] = &hfpll0
.clkr
,
2874 [PLL10
] = &hfpll1
.clkr
,
2875 [PLL12
] = &hfpll_l2
.clkr
,
2878 static const struct qcom_reset_map gcc_ipq806x_resets
[] = {
2879 [QDSS_STM_RESET
] = { 0x2060, 6 },
2880 [AFAB_SMPSS_S_RESET
] = { 0x20b8, 2 },
2881 [AFAB_SMPSS_M1_RESET
] = { 0x20b8, 1 },
2882 [AFAB_SMPSS_M0_RESET
] = { 0x20b8, 0 },
2883 [AFAB_EBI1_CH0_RESET
] = { 0x20c0, 7 },
2884 [AFAB_EBI1_CH1_RESET
] = { 0x20c4, 7 },
2885 [SFAB_ADM0_M0_RESET
] = { 0x21e0, 7 },
2886 [SFAB_ADM0_M1_RESET
] = { 0x21e4, 7 },
2887 [SFAB_ADM0_M2_RESET
] = { 0x21e8, 7 },
2888 [ADM0_C2_RESET
] = { 0x220c, 4 },
2889 [ADM0_C1_RESET
] = { 0x220c, 3 },
2890 [ADM0_C0_RESET
] = { 0x220c, 2 },
2891 [ADM0_PBUS_RESET
] = { 0x220c, 1 },
2892 [ADM0_RESET
] = { 0x220c, 0 },
2893 [QDSS_CLKS_SW_RESET
] = { 0x2260, 5 },
2894 [QDSS_POR_RESET
] = { 0x2260, 4 },
2895 [QDSS_TSCTR_RESET
] = { 0x2260, 3 },
2896 [QDSS_HRESET_RESET
] = { 0x2260, 2 },
2897 [QDSS_AXI_RESET
] = { 0x2260, 1 },
2898 [QDSS_DBG_RESET
] = { 0x2260, 0 },
2899 [SFAB_PCIE_M_RESET
] = { 0x22d8, 1 },
2900 [SFAB_PCIE_S_RESET
] = { 0x22d8, 0 },
2901 [PCIE_EXT_RESET
] = { 0x22dc, 6 },
2902 [PCIE_PHY_RESET
] = { 0x22dc, 5 },
2903 [PCIE_PCI_RESET
] = { 0x22dc, 4 },
2904 [PCIE_POR_RESET
] = { 0x22dc, 3 },
2905 [PCIE_HCLK_RESET
] = { 0x22dc, 2 },
2906 [PCIE_ACLK_RESET
] = { 0x22dc, 0 },
2907 [SFAB_LPASS_RESET
] = { 0x23a0, 7 },
2908 [SFAB_AFAB_M_RESET
] = { 0x23e0, 7 },
2909 [AFAB_SFAB_M0_RESET
] = { 0x2420, 7 },
2910 [AFAB_SFAB_M1_RESET
] = { 0x2424, 7 },
2911 [SFAB_SATA_S_RESET
] = { 0x2480, 7 },
2912 [SFAB_DFAB_M_RESET
] = { 0x2500, 7 },
2913 [DFAB_SFAB_M_RESET
] = { 0x2520, 7 },
2914 [DFAB_SWAY0_RESET
] = { 0x2540, 7 },
2915 [DFAB_SWAY1_RESET
] = { 0x2544, 7 },
2916 [DFAB_ARB0_RESET
] = { 0x2560, 7 },
2917 [DFAB_ARB1_RESET
] = { 0x2564, 7 },
2918 [PPSS_PROC_RESET
] = { 0x2594, 1 },
2919 [PPSS_RESET
] = { 0x2594, 0 },
2920 [DMA_BAM_RESET
] = { 0x25c0, 7 },
2921 [SPS_TIC_H_RESET
] = { 0x2600, 7 },
2922 [SFAB_CFPB_M_RESET
] = { 0x2680, 7 },
2923 [SFAB_CFPB_S_RESET
] = { 0x26c0, 7 },
2924 [TSIF_H_RESET
] = { 0x2700, 7 },
2925 [CE1_H_RESET
] = { 0x2720, 7 },
2926 [CE1_CORE_RESET
] = { 0x2724, 7 },
2927 [CE1_SLEEP_RESET
] = { 0x2728, 7 },
2928 [CE2_H_RESET
] = { 0x2740, 7 },
2929 [CE2_CORE_RESET
] = { 0x2744, 7 },
2930 [SFAB_SFPB_M_RESET
] = { 0x2780, 7 },
2931 [SFAB_SFPB_S_RESET
] = { 0x27a0, 7 },
2932 [RPM_PROC_RESET
] = { 0x27c0, 7 },
2933 [PMIC_SSBI2_RESET
] = { 0x280c, 12 },
2934 [SDC1_RESET
] = { 0x2830, 0 },
2935 [SDC2_RESET
] = { 0x2850, 0 },
2936 [SDC3_RESET
] = { 0x2870, 0 },
2937 [SDC4_RESET
] = { 0x2890, 0 },
2938 [USB_HS1_RESET
] = { 0x2910, 0 },
2939 [USB_HSIC_RESET
] = { 0x2934, 0 },
2940 [USB_FS1_XCVR_RESET
] = { 0x2974, 1 },
2941 [USB_FS1_RESET
] = { 0x2974, 0 },
2942 [GSBI1_RESET
] = { 0x29dc, 0 },
2943 [GSBI2_RESET
] = { 0x29fc, 0 },
2944 [GSBI3_RESET
] = { 0x2a1c, 0 },
2945 [GSBI4_RESET
] = { 0x2a3c, 0 },
2946 [GSBI5_RESET
] = { 0x2a5c, 0 },
2947 [GSBI6_RESET
] = { 0x2a7c, 0 },
2948 [GSBI7_RESET
] = { 0x2a9c, 0 },
2949 [SPDM_RESET
] = { 0x2b6c, 0 },
2950 [SEC_CTRL_RESET
] = { 0x2b80, 7 },
2951 [TLMM_H_RESET
] = { 0x2ba0, 7 },
2952 [SFAB_SATA_M_RESET
] = { 0x2c18, 0 },
2953 [SATA_RESET
] = { 0x2c1c, 0 },
2954 [TSSC_RESET
] = { 0x2ca0, 7 },
2955 [PDM_RESET
] = { 0x2cc0, 12 },
2956 [MPM_H_RESET
] = { 0x2da0, 7 },
2957 [MPM_RESET
] = { 0x2da4, 0 },
2958 [SFAB_SMPSS_S_RESET
] = { 0x2e00, 7 },
2959 [PRNG_RESET
] = { 0x2e80, 12 },
2960 [SFAB_CE3_M_RESET
] = { 0x36c8, 1 },
2961 [SFAB_CE3_S_RESET
] = { 0x36c8, 0 },
2962 [CE3_SLEEP_RESET
] = { 0x36d0, 7 },
2963 [PCIE_1_M_RESET
] = { 0x3a98, 1 },
2964 [PCIE_1_S_RESET
] = { 0x3a98, 0 },
2965 [PCIE_1_EXT_RESET
] = { 0x3a9c, 6 },
2966 [PCIE_1_PHY_RESET
] = { 0x3a9c, 5 },
2967 [PCIE_1_PCI_RESET
] = { 0x3a9c, 4 },
2968 [PCIE_1_POR_RESET
] = { 0x3a9c, 3 },
2969 [PCIE_1_HCLK_RESET
] = { 0x3a9c, 2 },
2970 [PCIE_1_ACLK_RESET
] = { 0x3a9c, 0 },
2971 [PCIE_2_M_RESET
] = { 0x3ad8, 1 },
2972 [PCIE_2_S_RESET
] = { 0x3ad8, 0 },
2973 [PCIE_2_EXT_RESET
] = { 0x3adc, 6 },
2974 [PCIE_2_PHY_RESET
] = { 0x3adc, 5 },
2975 [PCIE_2_PCI_RESET
] = { 0x3adc, 4 },
2976 [PCIE_2_POR_RESET
] = { 0x3adc, 3 },
2977 [PCIE_2_HCLK_RESET
] = { 0x3adc, 2 },
2978 [PCIE_2_ACLK_RESET
] = { 0x3adc, 0 },
2979 [SFAB_USB30_S_RESET
] = { 0x3b54, 1 },
2980 [SFAB_USB30_M_RESET
] = { 0x3b54, 0 },
2981 [USB30_0_PORT2_HS_PHY_RESET
] = { 0x3b50, 5 },
2982 [USB30_0_MASTER_RESET
] = { 0x3b50, 4 },
2983 [USB30_0_SLEEP_RESET
] = { 0x3b50, 3 },
2984 [USB30_0_UTMI_PHY_RESET
] = { 0x3b50, 2 },
2985 [USB30_0_POWERON_RESET
] = { 0x3b50, 1 },
2986 [USB30_0_PHY_RESET
] = { 0x3b50, 0 },
2987 [USB30_1_MASTER_RESET
] = { 0x3b58, 4 },
2988 [USB30_1_SLEEP_RESET
] = { 0x3b58, 3 },
2989 [USB30_1_UTMI_PHY_RESET
] = { 0x3b58, 2 },
2990 [USB30_1_POWERON_RESET
] = { 0x3b58, 1 },
2991 [USB30_1_PHY_RESET
] = { 0x3b58, 0 },
2992 [NSSFB0_RESET
] = { 0x3b60, 6 },
2993 [NSSFB1_RESET
] = { 0x3b60, 7 },
2994 [UBI32_CORE1_CLKRST_CLAMP_RESET
] = { 0x3d3c, 3},
2995 [UBI32_CORE1_CLAMP_RESET
] = { 0x3d3c, 2 },
2996 [UBI32_CORE1_AHB_RESET
] = { 0x3d3c, 1 },
2997 [UBI32_CORE1_AXI_RESET
] = { 0x3d3c, 0 },
2998 [UBI32_CORE2_CLKRST_CLAMP_RESET
] = { 0x3d5c, 3 },
2999 [UBI32_CORE2_CLAMP_RESET
] = { 0x3d5c, 2 },
3000 [UBI32_CORE2_AHB_RESET
] = { 0x3d5c, 1 },
3001 [UBI32_CORE2_AXI_RESET
] = { 0x3d5c, 0 },
3002 [GMAC_CORE1_RESET
] = { 0x3cbc, 0 },
3003 [GMAC_CORE2_RESET
] = { 0x3cdc, 0 },
3004 [GMAC_CORE3_RESET
] = { 0x3cfc, 0 },
3005 [GMAC_CORE4_RESET
] = { 0x3d1c, 0 },
3006 [GMAC_AHB_RESET
] = { 0x3e24, 0 },
3007 [NSS_CH0_RST_RX_CLK_N_RESET
] = { 0x3b60, 0 },
3008 [NSS_CH0_RST_TX_CLK_N_RESET
] = { 0x3b60, 1 },
3009 [NSS_CH0_RST_RX_125M_N_RESET
] = { 0x3b60, 2 },
3010 [NSS_CH0_HW_RST_RX_125M_N_RESET
] = { 0x3b60, 3 },
3011 [NSS_CH0_RST_TX_125M_N_RESET
] = { 0x3b60, 4 },
3012 [NSS_CH1_RST_RX_CLK_N_RESET
] = { 0x3b60, 5 },
3013 [NSS_CH1_RST_TX_CLK_N_RESET
] = { 0x3b60, 6 },
3014 [NSS_CH1_RST_RX_125M_N_RESET
] = { 0x3b60, 7 },
3015 [NSS_CH1_HW_RST_RX_125M_N_RESET
] = { 0x3b60, 8 },
3016 [NSS_CH1_RST_TX_125M_N_RESET
] = { 0x3b60, 9 },
3017 [NSS_CH2_RST_RX_CLK_N_RESET
] = { 0x3b60, 10 },
3018 [NSS_CH2_RST_TX_CLK_N_RESET
] = { 0x3b60, 11 },
3019 [NSS_CH2_RST_RX_125M_N_RESET
] = { 0x3b60, 12 },
3020 [NSS_CH2_HW_RST_RX_125M_N_RESET
] = { 0x3b60, 13 },
3021 [NSS_CH2_RST_TX_125M_N_RESET
] = { 0x3b60, 14 },
3022 [NSS_CH3_RST_RX_CLK_N_RESET
] = { 0x3b60, 15 },
3023 [NSS_CH3_RST_TX_CLK_N_RESET
] = { 0x3b60, 16 },
3024 [NSS_CH3_RST_RX_125M_N_RESET
] = { 0x3b60, 17 },
3025 [NSS_CH3_HW_RST_RX_125M_N_RESET
] = { 0x3b60, 18 },
3026 [NSS_CH3_RST_TX_125M_N_RESET
] = { 0x3b60, 19 },
3027 [NSS_RST_RX_250M_125M_N_RESET
] = { 0x3b60, 20 },
3028 [NSS_RST_TX_250M_125M_N_RESET
] = { 0x3b60, 21 },
3029 [NSS_QSGMII_TXPI_RST_N_RESET
] = { 0x3b60, 22 },
3030 [NSS_QSGMII_CDR_RST_N_RESET
] = { 0x3b60, 23 },
3031 [NSS_SGMII2_CDR_RST_N_RESET
] = { 0x3b60, 24 },
3032 [NSS_SGMII3_CDR_RST_N_RESET
] = { 0x3b60, 25 },
3033 [NSS_CAL_PRBS_RST_N_RESET
] = { 0x3b60, 26 },
3034 [NSS_LCKDT_RST_N_RESET
] = { 0x3b60, 27 },
3035 [NSS_SRDS_N_RESET
] = { 0x3b60, 28 },
3038 static const struct regmap_config gcc_ipq806x_regmap_config
= {
3042 .max_register
= 0x3e40,
3046 static const struct qcom_cc_desc gcc_ipq806x_desc
= {
3047 .config
= &gcc_ipq806x_regmap_config
,
3048 .clks
= gcc_ipq806x_clks
,
3049 .num_clks
= ARRAY_SIZE(gcc_ipq806x_clks
),
3050 .resets
= gcc_ipq806x_resets
,
3051 .num_resets
= ARRAY_SIZE(gcc_ipq806x_resets
),
3054 static const struct of_device_id gcc_ipq806x_match_table
[] = {
3055 { .compatible
= "qcom,gcc-ipq8064" },
3058 MODULE_DEVICE_TABLE(of
, gcc_ipq806x_match_table
);
3060 static int gcc_ipq806x_probe(struct platform_device
*pdev
)
3062 struct device
*dev
= &pdev
->dev
;
3063 struct regmap
*regmap
;
3066 ret
= qcom_cc_register_board_clk(dev
, "cxo_board", "cxo", 25000000);
3070 ret
= qcom_cc_register_board_clk(dev
, "pxo_board", "pxo", 25000000);
3074 ret
= qcom_cc_probe(pdev
, &gcc_ipq806x_desc
);
3078 regmap
= dev_get_regmap(dev
, NULL
);
3082 /* Setup PLL18 static bits */
3083 regmap_update_bits(regmap
, 0x31a4, 0xffffffc0, 0x40000400);
3084 regmap_write(regmap
, 0x31b0, 0x3080);
3086 /* Set GMAC footswitch sleep/wakeup values */
3087 regmap_write(regmap
, 0x3cb8, 8);
3088 regmap_write(regmap
, 0x3cd8, 8);
3089 regmap_write(regmap
, 0x3cf8, 8);
3090 regmap_write(regmap
, 0x3d18, 8);
3092 return of_platform_populate(pdev
->dev
.of_node
, NULL
, NULL
, &pdev
->dev
);
3095 static struct platform_driver gcc_ipq806x_driver
= {
3096 .probe
= gcc_ipq806x_probe
,
3098 .name
= "gcc-ipq806x",
3099 .of_match_table
= gcc_ipq806x_match_table
,
3103 static int __init
gcc_ipq806x_init(void)
3105 return platform_driver_register(&gcc_ipq806x_driver
);
3107 core_initcall(gcc_ipq806x_init
);
3109 static void __exit
gcc_ipq806x_exit(void)
3111 platform_driver_unregister(&gcc_ipq806x_driver
);
3113 module_exit(gcc_ipq806x_exit
);
3115 MODULE_DESCRIPTION("QCOM GCC IPQ806x Driver");
3116 MODULE_LICENSE("GPL v2");
3117 MODULE_ALIAS("platform:gcc-ipq806x");