2 * Copyright (c) 2014, The Linux Foundation. All rights reserved.
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #include <linux/kernel.h>
15 #include <linux/bitops.h>
16 #include <linux/err.h>
17 #include <linux/platform_device.h>
18 #include <linux/module.h>
20 #include <linux/of_device.h>
21 #include <linux/clk-provider.h>
22 #include <linux/regmap.h>
23 #include <linux/reset-controller.h>
25 #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
26 #include <dt-bindings/reset/qcom,gcc-ipq806x.h>
29 #include "clk-regmap.h"
32 #include "clk-branch.h"
35 static struct clk_pll pll0
= {
43 .clkr
.hw
.init
= &(struct clk_init_data
){
45 .parent_names
= (const char *[]){ "pxo" },
51 static struct clk_regmap pll0_vote
= {
53 .enable_mask
= BIT(0),
54 .hw
.init
= &(struct clk_init_data
){
56 .parent_names
= (const char *[]){ "pll0" },
58 .ops
= &clk_pll_vote_ops
,
62 static struct clk_pll pll3
= {
70 .clkr
.hw
.init
= &(struct clk_init_data
){
72 .parent_names
= (const char *[]){ "pxo" },
78 static struct clk_regmap pll4_vote
= {
80 .enable_mask
= BIT(4),
81 .hw
.init
= &(struct clk_init_data
){
83 .parent_names
= (const char *[]){ "pll4" },
85 .ops
= &clk_pll_vote_ops
,
89 static struct clk_pll pll8
= {
97 .clkr
.hw
.init
= &(struct clk_init_data
){
99 .parent_names
= (const char *[]){ "pxo" },
105 static struct clk_regmap pll8_vote
= {
106 .enable_reg
= 0x34c0,
107 .enable_mask
= BIT(8),
108 .hw
.init
= &(struct clk_init_data
){
110 .parent_names
= (const char *[]){ "pll8" },
112 .ops
= &clk_pll_vote_ops
,
116 static struct clk_pll pll14
= {
120 .config_reg
= 0x31d4,
122 .status_reg
= 0x31d8,
124 .clkr
.hw
.init
= &(struct clk_init_data
){
126 .parent_names
= (const char *[]){ "pxo" },
132 static struct clk_regmap pll14_vote
= {
133 .enable_reg
= 0x34c0,
134 .enable_mask
= BIT(14),
135 .hw
.init
= &(struct clk_init_data
){
136 .name
= "pll14_vote",
137 .parent_names
= (const char *[]){ "pll14" },
139 .ops
= &clk_pll_vote_ops
,
143 #define NSS_PLL_RATE(f, _l, _m, _n, i) \
152 static struct pll_freq_tbl pll18_freq_tbl
[] = {
153 NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625),
154 NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625),
157 static struct clk_pll pll18
= {
161 .config_reg
= 0x31b4,
163 .status_reg
= 0x31b8,
165 .post_div_shift
= 16,
167 .freq_tbl
= pll18_freq_tbl
,
168 .clkr
.hw
.init
= &(struct clk_init_data
){
170 .parent_names
= (const char *[]){ "pxo" },
186 static const struct parent_map gcc_pxo_pll8_map
[] = {
191 static const char * const gcc_pxo_pll8
[] = {
196 static const struct parent_map gcc_pxo_pll8_cxo_map
[] = {
202 static const char * const gcc_pxo_pll8_cxo
[] = {
208 static const struct parent_map gcc_pxo_pll3_map
[] = {
213 static const struct parent_map gcc_pxo_pll3_sata_map
[] = {
218 static const char * const gcc_pxo_pll3
[] = {
223 static const struct parent_map gcc_pxo_pll8_pll0
[] = {
229 static const char * const gcc_pxo_pll8_pll0_map
[] = {
235 static const struct parent_map gcc_pxo_pll8_pll14_pll18_pll0_map
[] = {
243 static const char * const gcc_pxo_pll8_pll14_pll18_pll0
[] = {
251 static struct freq_tbl clk_tbl_gsbi_uart
[] = {
252 { 1843200, P_PLL8
, 2, 6, 625 },
253 { 3686400, P_PLL8
, 2, 12, 625 },
254 { 7372800, P_PLL8
, 2, 24, 625 },
255 { 14745600, P_PLL8
, 2, 48, 625 },
256 { 16000000, P_PLL8
, 4, 1, 6 },
257 { 24000000, P_PLL8
, 4, 1, 4 },
258 { 32000000, P_PLL8
, 4, 1, 3 },
259 { 40000000, P_PLL8
, 1, 5, 48 },
260 { 46400000, P_PLL8
, 1, 29, 240 },
261 { 48000000, P_PLL8
, 4, 1, 2 },
262 { 51200000, P_PLL8
, 1, 2, 15 },
263 { 56000000, P_PLL8
, 1, 7, 48 },
264 { 58982400, P_PLL8
, 1, 96, 625 },
265 { 64000000, P_PLL8
, 2, 1, 3 },
269 static struct clk_rcg gsbi1_uart_src
= {
274 .mnctr_reset_bit
= 7,
275 .mnctr_mode_shift
= 5,
286 .parent_map
= gcc_pxo_pll8_map
,
288 .freq_tbl
= clk_tbl_gsbi_uart
,
290 .enable_reg
= 0x29d4,
291 .enable_mask
= BIT(11),
292 .hw
.init
= &(struct clk_init_data
){
293 .name
= "gsbi1_uart_src",
294 .parent_names
= gcc_pxo_pll8
,
297 .flags
= CLK_SET_PARENT_GATE
,
302 static struct clk_branch gsbi1_uart_clk
= {
306 .enable_reg
= 0x29d4,
307 .enable_mask
= BIT(9),
308 .hw
.init
= &(struct clk_init_data
){
309 .name
= "gsbi1_uart_clk",
310 .parent_names
= (const char *[]){
314 .ops
= &clk_branch_ops
,
315 .flags
= CLK_SET_RATE_PARENT
,
320 static struct clk_rcg gsbi2_uart_src
= {
325 .mnctr_reset_bit
= 7,
326 .mnctr_mode_shift
= 5,
337 .parent_map
= gcc_pxo_pll8_map
,
339 .freq_tbl
= clk_tbl_gsbi_uart
,
341 .enable_reg
= 0x29f4,
342 .enable_mask
= BIT(11),
343 .hw
.init
= &(struct clk_init_data
){
344 .name
= "gsbi2_uart_src",
345 .parent_names
= gcc_pxo_pll8
,
348 .flags
= CLK_SET_PARENT_GATE
,
353 static struct clk_branch gsbi2_uart_clk
= {
357 .enable_reg
= 0x29f4,
358 .enable_mask
= BIT(9),
359 .hw
.init
= &(struct clk_init_data
){
360 .name
= "gsbi2_uart_clk",
361 .parent_names
= (const char *[]){
365 .ops
= &clk_branch_ops
,
366 .flags
= CLK_SET_RATE_PARENT
,
371 static struct clk_rcg gsbi4_uart_src
= {
376 .mnctr_reset_bit
= 7,
377 .mnctr_mode_shift
= 5,
388 .parent_map
= gcc_pxo_pll8_map
,
390 .freq_tbl
= clk_tbl_gsbi_uart
,
392 .enable_reg
= 0x2a34,
393 .enable_mask
= BIT(11),
394 .hw
.init
= &(struct clk_init_data
){
395 .name
= "gsbi4_uart_src",
396 .parent_names
= gcc_pxo_pll8
,
399 .flags
= CLK_SET_PARENT_GATE
,
404 static struct clk_branch gsbi4_uart_clk
= {
408 .enable_reg
= 0x2a34,
409 .enable_mask
= BIT(9),
410 .hw
.init
= &(struct clk_init_data
){
411 .name
= "gsbi4_uart_clk",
412 .parent_names
= (const char *[]){
416 .ops
= &clk_branch_ops
,
417 .flags
= CLK_SET_RATE_PARENT
,
422 static struct clk_rcg gsbi5_uart_src
= {
427 .mnctr_reset_bit
= 7,
428 .mnctr_mode_shift
= 5,
439 .parent_map
= gcc_pxo_pll8_map
,
441 .freq_tbl
= clk_tbl_gsbi_uart
,
443 .enable_reg
= 0x2a54,
444 .enable_mask
= BIT(11),
445 .hw
.init
= &(struct clk_init_data
){
446 .name
= "gsbi5_uart_src",
447 .parent_names
= gcc_pxo_pll8
,
450 .flags
= CLK_SET_PARENT_GATE
,
455 static struct clk_branch gsbi5_uart_clk
= {
459 .enable_reg
= 0x2a54,
460 .enable_mask
= BIT(9),
461 .hw
.init
= &(struct clk_init_data
){
462 .name
= "gsbi5_uart_clk",
463 .parent_names
= (const char *[]){
467 .ops
= &clk_branch_ops
,
468 .flags
= CLK_SET_RATE_PARENT
,
473 static struct clk_rcg gsbi6_uart_src
= {
478 .mnctr_reset_bit
= 7,
479 .mnctr_mode_shift
= 5,
490 .parent_map
= gcc_pxo_pll8_map
,
492 .freq_tbl
= clk_tbl_gsbi_uart
,
494 .enable_reg
= 0x2a74,
495 .enable_mask
= BIT(11),
496 .hw
.init
= &(struct clk_init_data
){
497 .name
= "gsbi6_uart_src",
498 .parent_names
= gcc_pxo_pll8
,
501 .flags
= CLK_SET_PARENT_GATE
,
506 static struct clk_branch gsbi6_uart_clk
= {
510 .enable_reg
= 0x2a74,
511 .enable_mask
= BIT(9),
512 .hw
.init
= &(struct clk_init_data
){
513 .name
= "gsbi6_uart_clk",
514 .parent_names
= (const char *[]){
518 .ops
= &clk_branch_ops
,
519 .flags
= CLK_SET_RATE_PARENT
,
524 static struct clk_rcg gsbi7_uart_src
= {
529 .mnctr_reset_bit
= 7,
530 .mnctr_mode_shift
= 5,
541 .parent_map
= gcc_pxo_pll8_map
,
543 .freq_tbl
= clk_tbl_gsbi_uart
,
545 .enable_reg
= 0x2a94,
546 .enable_mask
= BIT(11),
547 .hw
.init
= &(struct clk_init_data
){
548 .name
= "gsbi7_uart_src",
549 .parent_names
= gcc_pxo_pll8
,
552 .flags
= CLK_SET_PARENT_GATE
,
557 static struct clk_branch gsbi7_uart_clk
= {
561 .enable_reg
= 0x2a94,
562 .enable_mask
= BIT(9),
563 .hw
.init
= &(struct clk_init_data
){
564 .name
= "gsbi7_uart_clk",
565 .parent_names
= (const char *[]){
569 .ops
= &clk_branch_ops
,
570 .flags
= CLK_SET_RATE_PARENT
,
575 static struct freq_tbl clk_tbl_gsbi_qup
[] = {
576 { 1100000, P_PXO
, 1, 2, 49 },
577 { 5400000, P_PXO
, 1, 1, 5 },
578 { 10800000, P_PXO
, 1, 2, 5 },
579 { 15060000, P_PLL8
, 1, 2, 51 },
580 { 24000000, P_PLL8
, 4, 1, 4 },
581 { 25000000, P_PXO
, 1, 0, 0 },
582 { 25600000, P_PLL8
, 1, 1, 15 },
583 { 48000000, P_PLL8
, 4, 1, 2 },
584 { 51200000, P_PLL8
, 1, 2, 15 },
588 static struct clk_rcg gsbi1_qup_src
= {
593 .mnctr_reset_bit
= 7,
594 .mnctr_mode_shift
= 5,
605 .parent_map
= gcc_pxo_pll8_map
,
607 .freq_tbl
= clk_tbl_gsbi_qup
,
609 .enable_reg
= 0x29cc,
610 .enable_mask
= BIT(11),
611 .hw
.init
= &(struct clk_init_data
){
612 .name
= "gsbi1_qup_src",
613 .parent_names
= gcc_pxo_pll8
,
616 .flags
= CLK_SET_PARENT_GATE
,
621 static struct clk_branch gsbi1_qup_clk
= {
625 .enable_reg
= 0x29cc,
626 .enable_mask
= BIT(9),
627 .hw
.init
= &(struct clk_init_data
){
628 .name
= "gsbi1_qup_clk",
629 .parent_names
= (const char *[]){ "gsbi1_qup_src" },
631 .ops
= &clk_branch_ops
,
632 .flags
= CLK_SET_RATE_PARENT
,
637 static struct clk_rcg gsbi2_qup_src
= {
642 .mnctr_reset_bit
= 7,
643 .mnctr_mode_shift
= 5,
654 .parent_map
= gcc_pxo_pll8_map
,
656 .freq_tbl
= clk_tbl_gsbi_qup
,
658 .enable_reg
= 0x29ec,
659 .enable_mask
= BIT(11),
660 .hw
.init
= &(struct clk_init_data
){
661 .name
= "gsbi2_qup_src",
662 .parent_names
= gcc_pxo_pll8
,
665 .flags
= CLK_SET_PARENT_GATE
,
670 static struct clk_branch gsbi2_qup_clk
= {
674 .enable_reg
= 0x29ec,
675 .enable_mask
= BIT(9),
676 .hw
.init
= &(struct clk_init_data
){
677 .name
= "gsbi2_qup_clk",
678 .parent_names
= (const char *[]){ "gsbi2_qup_src" },
680 .ops
= &clk_branch_ops
,
681 .flags
= CLK_SET_RATE_PARENT
,
686 static struct clk_rcg gsbi4_qup_src
= {
691 .mnctr_reset_bit
= 7,
692 .mnctr_mode_shift
= 5,
703 .parent_map
= gcc_pxo_pll8_map
,
705 .freq_tbl
= clk_tbl_gsbi_qup
,
707 .enable_reg
= 0x2a2c,
708 .enable_mask
= BIT(11),
709 .hw
.init
= &(struct clk_init_data
){
710 .name
= "gsbi4_qup_src",
711 .parent_names
= gcc_pxo_pll8
,
714 .flags
= CLK_SET_PARENT_GATE
,
719 static struct clk_branch gsbi4_qup_clk
= {
723 .enable_reg
= 0x2a2c,
724 .enable_mask
= BIT(9),
725 .hw
.init
= &(struct clk_init_data
){
726 .name
= "gsbi4_qup_clk",
727 .parent_names
= (const char *[]){ "gsbi4_qup_src" },
729 .ops
= &clk_branch_ops
,
730 .flags
= CLK_SET_RATE_PARENT
,
735 static struct clk_rcg gsbi5_qup_src
= {
740 .mnctr_reset_bit
= 7,
741 .mnctr_mode_shift
= 5,
752 .parent_map
= gcc_pxo_pll8_map
,
754 .freq_tbl
= clk_tbl_gsbi_qup
,
756 .enable_reg
= 0x2a4c,
757 .enable_mask
= BIT(11),
758 .hw
.init
= &(struct clk_init_data
){
759 .name
= "gsbi5_qup_src",
760 .parent_names
= gcc_pxo_pll8
,
763 .flags
= CLK_SET_PARENT_GATE
,
768 static struct clk_branch gsbi5_qup_clk
= {
772 .enable_reg
= 0x2a4c,
773 .enable_mask
= BIT(9),
774 .hw
.init
= &(struct clk_init_data
){
775 .name
= "gsbi5_qup_clk",
776 .parent_names
= (const char *[]){ "gsbi5_qup_src" },
778 .ops
= &clk_branch_ops
,
779 .flags
= CLK_SET_RATE_PARENT
,
784 static struct clk_rcg gsbi6_qup_src
= {
789 .mnctr_reset_bit
= 7,
790 .mnctr_mode_shift
= 5,
801 .parent_map
= gcc_pxo_pll8_map
,
803 .freq_tbl
= clk_tbl_gsbi_qup
,
805 .enable_reg
= 0x2a6c,
806 .enable_mask
= BIT(11),
807 .hw
.init
= &(struct clk_init_data
){
808 .name
= "gsbi6_qup_src",
809 .parent_names
= gcc_pxo_pll8
,
812 .flags
= CLK_SET_PARENT_GATE
,
817 static struct clk_branch gsbi6_qup_clk
= {
821 .enable_reg
= 0x2a6c,
822 .enable_mask
= BIT(9),
823 .hw
.init
= &(struct clk_init_data
){
824 .name
= "gsbi6_qup_clk",
825 .parent_names
= (const char *[]){ "gsbi6_qup_src" },
827 .ops
= &clk_branch_ops
,
828 .flags
= CLK_SET_RATE_PARENT
,
833 static struct clk_rcg gsbi7_qup_src
= {
838 .mnctr_reset_bit
= 7,
839 .mnctr_mode_shift
= 5,
850 .parent_map
= gcc_pxo_pll8_map
,
852 .freq_tbl
= clk_tbl_gsbi_qup
,
854 .enable_reg
= 0x2a8c,
855 .enable_mask
= BIT(11),
856 .hw
.init
= &(struct clk_init_data
){
857 .name
= "gsbi7_qup_src",
858 .parent_names
= gcc_pxo_pll8
,
861 .flags
= CLK_SET_PARENT_GATE
,
866 static struct clk_branch gsbi7_qup_clk
= {
870 .enable_reg
= 0x2a8c,
871 .enable_mask
= BIT(9),
872 .hw
.init
= &(struct clk_init_data
){
873 .name
= "gsbi7_qup_clk",
874 .parent_names
= (const char *[]){ "gsbi7_qup_src" },
876 .ops
= &clk_branch_ops
,
877 .flags
= CLK_SET_RATE_PARENT
,
882 static struct clk_branch gsbi1_h_clk
= {
888 .enable_reg
= 0x29c0,
889 .enable_mask
= BIT(4),
890 .hw
.init
= &(struct clk_init_data
){
891 .name
= "gsbi1_h_clk",
892 .ops
= &clk_branch_ops
,
897 static struct clk_branch gsbi2_h_clk
= {
903 .enable_reg
= 0x29e0,
904 .enable_mask
= BIT(4),
905 .hw
.init
= &(struct clk_init_data
){
906 .name
= "gsbi2_h_clk",
907 .ops
= &clk_branch_ops
,
912 static struct clk_branch gsbi4_h_clk
= {
918 .enable_reg
= 0x2a20,
919 .enable_mask
= BIT(4),
920 .hw
.init
= &(struct clk_init_data
){
921 .name
= "gsbi4_h_clk",
922 .ops
= &clk_branch_ops
,
927 static struct clk_branch gsbi5_h_clk
= {
933 .enable_reg
= 0x2a40,
934 .enable_mask
= BIT(4),
935 .hw
.init
= &(struct clk_init_data
){
936 .name
= "gsbi5_h_clk",
937 .ops
= &clk_branch_ops
,
942 static struct clk_branch gsbi6_h_clk
= {
948 .enable_reg
= 0x2a60,
949 .enable_mask
= BIT(4),
950 .hw
.init
= &(struct clk_init_data
){
951 .name
= "gsbi6_h_clk",
952 .ops
= &clk_branch_ops
,
957 static struct clk_branch gsbi7_h_clk
= {
963 .enable_reg
= 0x2a80,
964 .enable_mask
= BIT(4),
965 .hw
.init
= &(struct clk_init_data
){
966 .name
= "gsbi7_h_clk",
967 .ops
= &clk_branch_ops
,
972 static const struct freq_tbl clk_tbl_gp
[] = {
973 { 12500000, P_PXO
, 2, 0, 0 },
974 { 25000000, P_PXO
, 1, 0, 0 },
975 { 64000000, P_PLL8
, 2, 1, 3 },
976 { 76800000, P_PLL8
, 1, 1, 5 },
977 { 96000000, P_PLL8
, 4, 0, 0 },
978 { 128000000, P_PLL8
, 3, 0, 0 },
979 { 192000000, P_PLL8
, 2, 0, 0 },
983 static struct clk_rcg gp0_src
= {
988 .mnctr_reset_bit
= 7,
989 .mnctr_mode_shift
= 5,
1000 .parent_map
= gcc_pxo_pll8_cxo_map
,
1002 .freq_tbl
= clk_tbl_gp
,
1004 .enable_reg
= 0x2d24,
1005 .enable_mask
= BIT(11),
1006 .hw
.init
= &(struct clk_init_data
){
1008 .parent_names
= gcc_pxo_pll8_cxo
,
1010 .ops
= &clk_rcg_ops
,
1011 .flags
= CLK_SET_PARENT_GATE
,
1016 static struct clk_branch gp0_clk
= {
1020 .enable_reg
= 0x2d24,
1021 .enable_mask
= BIT(9),
1022 .hw
.init
= &(struct clk_init_data
){
1024 .parent_names
= (const char *[]){ "gp0_src" },
1026 .ops
= &clk_branch_ops
,
1027 .flags
= CLK_SET_RATE_PARENT
,
1032 static struct clk_rcg gp1_src
= {
1037 .mnctr_reset_bit
= 7,
1038 .mnctr_mode_shift
= 5,
1049 .parent_map
= gcc_pxo_pll8_cxo_map
,
1051 .freq_tbl
= clk_tbl_gp
,
1053 .enable_reg
= 0x2d44,
1054 .enable_mask
= BIT(11),
1055 .hw
.init
= &(struct clk_init_data
){
1057 .parent_names
= gcc_pxo_pll8_cxo
,
1059 .ops
= &clk_rcg_ops
,
1060 .flags
= CLK_SET_RATE_GATE
,
1065 static struct clk_branch gp1_clk
= {
1069 .enable_reg
= 0x2d44,
1070 .enable_mask
= BIT(9),
1071 .hw
.init
= &(struct clk_init_data
){
1073 .parent_names
= (const char *[]){ "gp1_src" },
1075 .ops
= &clk_branch_ops
,
1076 .flags
= CLK_SET_RATE_PARENT
,
1081 static struct clk_rcg gp2_src
= {
1086 .mnctr_reset_bit
= 7,
1087 .mnctr_mode_shift
= 5,
1098 .parent_map
= gcc_pxo_pll8_cxo_map
,
1100 .freq_tbl
= clk_tbl_gp
,
1102 .enable_reg
= 0x2d64,
1103 .enable_mask
= BIT(11),
1104 .hw
.init
= &(struct clk_init_data
){
1106 .parent_names
= gcc_pxo_pll8_cxo
,
1108 .ops
= &clk_rcg_ops
,
1109 .flags
= CLK_SET_RATE_GATE
,
1114 static struct clk_branch gp2_clk
= {
1118 .enable_reg
= 0x2d64,
1119 .enable_mask
= BIT(9),
1120 .hw
.init
= &(struct clk_init_data
){
1122 .parent_names
= (const char *[]){ "gp2_src" },
1124 .ops
= &clk_branch_ops
,
1125 .flags
= CLK_SET_RATE_PARENT
,
1130 static struct clk_branch pmem_clk
= {
1136 .enable_reg
= 0x25a0,
1137 .enable_mask
= BIT(4),
1138 .hw
.init
= &(struct clk_init_data
){
1140 .ops
= &clk_branch_ops
,
1145 static struct clk_rcg prng_src
= {
1153 .parent_map
= gcc_pxo_pll8_map
,
1156 .hw
.init
= &(struct clk_init_data
){
1158 .parent_names
= gcc_pxo_pll8
,
1160 .ops
= &clk_rcg_ops
,
1165 static struct clk_branch prng_clk
= {
1167 .halt_check
= BRANCH_HALT_VOTED
,
1170 .enable_reg
= 0x3080,
1171 .enable_mask
= BIT(10),
1172 .hw
.init
= &(struct clk_init_data
){
1174 .parent_names
= (const char *[]){ "prng_src" },
1176 .ops
= &clk_branch_ops
,
1181 static const struct freq_tbl clk_tbl_sdc
[] = {
1182 { 200000, P_PXO
, 2, 2, 125 },
1183 { 400000, P_PLL8
, 4, 1, 240 },
1184 { 16000000, P_PLL8
, 4, 1, 6 },
1185 { 17070000, P_PLL8
, 1, 2, 45 },
1186 { 20210000, P_PLL8
, 1, 1, 19 },
1187 { 24000000, P_PLL8
, 4, 1, 4 },
1188 { 48000000, P_PLL8
, 4, 1, 2 },
1189 { 64000000, P_PLL8
, 3, 1, 2 },
1190 { 96000000, P_PLL8
, 4, 0, 0 },
1191 { 192000000, P_PLL8
, 2, 0, 0 },
1195 static struct clk_rcg sdc1_src
= {
1200 .mnctr_reset_bit
= 7,
1201 .mnctr_mode_shift
= 5,
1212 .parent_map
= gcc_pxo_pll8_map
,
1214 .freq_tbl
= clk_tbl_sdc
,
1216 .enable_reg
= 0x282c,
1217 .enable_mask
= BIT(11),
1218 .hw
.init
= &(struct clk_init_data
){
1220 .parent_names
= gcc_pxo_pll8
,
1222 .ops
= &clk_rcg_ops
,
1223 .flags
= CLK_SET_RATE_GATE
,
1228 static struct clk_branch sdc1_clk
= {
1232 .enable_reg
= 0x282c,
1233 .enable_mask
= BIT(9),
1234 .hw
.init
= &(struct clk_init_data
){
1236 .parent_names
= (const char *[]){ "sdc1_src" },
1238 .ops
= &clk_branch_ops
,
1239 .flags
= CLK_SET_RATE_PARENT
,
1244 static struct clk_rcg sdc3_src
= {
1249 .mnctr_reset_bit
= 7,
1250 .mnctr_mode_shift
= 5,
1261 .parent_map
= gcc_pxo_pll8_map
,
1263 .freq_tbl
= clk_tbl_sdc
,
1265 .enable_reg
= 0x286c,
1266 .enable_mask
= BIT(11),
1267 .hw
.init
= &(struct clk_init_data
){
1269 .parent_names
= gcc_pxo_pll8
,
1271 .ops
= &clk_rcg_ops
,
1272 .flags
= CLK_SET_RATE_GATE
,
1277 static struct clk_branch sdc3_clk
= {
1281 .enable_reg
= 0x286c,
1282 .enable_mask
= BIT(9),
1283 .hw
.init
= &(struct clk_init_data
){
1285 .parent_names
= (const char *[]){ "sdc3_src" },
1287 .ops
= &clk_branch_ops
,
1288 .flags
= CLK_SET_RATE_PARENT
,
1293 static struct clk_branch sdc1_h_clk
= {
1299 .enable_reg
= 0x2820,
1300 .enable_mask
= BIT(4),
1301 .hw
.init
= &(struct clk_init_data
){
1302 .name
= "sdc1_h_clk",
1303 .ops
= &clk_branch_ops
,
1308 static struct clk_branch sdc3_h_clk
= {
1314 .enable_reg
= 0x2860,
1315 .enable_mask
= BIT(4),
1316 .hw
.init
= &(struct clk_init_data
){
1317 .name
= "sdc3_h_clk",
1318 .ops
= &clk_branch_ops
,
1323 static const struct freq_tbl clk_tbl_tsif_ref
[] = {
1324 { 105000, P_PXO
, 1, 1, 256 },
1328 static struct clk_rcg tsif_ref_src
= {
1333 .mnctr_reset_bit
= 7,
1334 .mnctr_mode_shift
= 5,
1345 .parent_map
= gcc_pxo_pll8_map
,
1347 .freq_tbl
= clk_tbl_tsif_ref
,
1349 .enable_reg
= 0x2710,
1350 .enable_mask
= BIT(11),
1351 .hw
.init
= &(struct clk_init_data
){
1352 .name
= "tsif_ref_src",
1353 .parent_names
= gcc_pxo_pll8
,
1355 .ops
= &clk_rcg_ops
,
1356 .flags
= CLK_SET_RATE_GATE
,
1361 static struct clk_branch tsif_ref_clk
= {
1365 .enable_reg
= 0x2710,
1366 .enable_mask
= BIT(9),
1367 .hw
.init
= &(struct clk_init_data
){
1368 .name
= "tsif_ref_clk",
1369 .parent_names
= (const char *[]){ "tsif_ref_src" },
1371 .ops
= &clk_branch_ops
,
1372 .flags
= CLK_SET_RATE_PARENT
,
1377 static struct clk_branch tsif_h_clk
= {
1383 .enable_reg
= 0x2700,
1384 .enable_mask
= BIT(4),
1385 .hw
.init
= &(struct clk_init_data
){
1386 .name
= "tsif_h_clk",
1387 .ops
= &clk_branch_ops
,
1392 static struct clk_branch dma_bam_h_clk
= {
1398 .enable_reg
= 0x25c0,
1399 .enable_mask
= BIT(4),
1400 .hw
.init
= &(struct clk_init_data
){
1401 .name
= "dma_bam_h_clk",
1402 .ops
= &clk_branch_ops
,
1407 static struct clk_branch adm0_clk
= {
1409 .halt_check
= BRANCH_HALT_VOTED
,
1412 .enable_reg
= 0x3080,
1413 .enable_mask
= BIT(2),
1414 .hw
.init
= &(struct clk_init_data
){
1416 .ops
= &clk_branch_ops
,
1421 static struct clk_branch adm0_pbus_clk
= {
1425 .halt_check
= BRANCH_HALT_VOTED
,
1428 .enable_reg
= 0x3080,
1429 .enable_mask
= BIT(3),
1430 .hw
.init
= &(struct clk_init_data
){
1431 .name
= "adm0_pbus_clk",
1432 .ops
= &clk_branch_ops
,
1437 static struct clk_branch pmic_arb0_h_clk
= {
1439 .halt_check
= BRANCH_HALT_VOTED
,
1442 .enable_reg
= 0x3080,
1443 .enable_mask
= BIT(8),
1444 .hw
.init
= &(struct clk_init_data
){
1445 .name
= "pmic_arb0_h_clk",
1446 .ops
= &clk_branch_ops
,
1451 static struct clk_branch pmic_arb1_h_clk
= {
1453 .halt_check
= BRANCH_HALT_VOTED
,
1456 .enable_reg
= 0x3080,
1457 .enable_mask
= BIT(9),
1458 .hw
.init
= &(struct clk_init_data
){
1459 .name
= "pmic_arb1_h_clk",
1460 .ops
= &clk_branch_ops
,
1465 static struct clk_branch pmic_ssbi2_clk
= {
1467 .halt_check
= BRANCH_HALT_VOTED
,
1470 .enable_reg
= 0x3080,
1471 .enable_mask
= BIT(7),
1472 .hw
.init
= &(struct clk_init_data
){
1473 .name
= "pmic_ssbi2_clk",
1474 .ops
= &clk_branch_ops
,
1479 static struct clk_branch rpm_msg_ram_h_clk
= {
1483 .halt_check
= BRANCH_HALT_VOTED
,
1486 .enable_reg
= 0x3080,
1487 .enable_mask
= BIT(6),
1488 .hw
.init
= &(struct clk_init_data
){
1489 .name
= "rpm_msg_ram_h_clk",
1490 .ops
= &clk_branch_ops
,
1495 static const struct freq_tbl clk_tbl_pcie_ref
[] = {
1496 { 100000000, P_PLL3
, 12, 0, 0 },
1500 static struct clk_rcg pcie_ref_src
= {
1508 .parent_map
= gcc_pxo_pll3_map
,
1510 .freq_tbl
= clk_tbl_pcie_ref
,
1512 .enable_reg
= 0x3860,
1513 .enable_mask
= BIT(11),
1514 .hw
.init
= &(struct clk_init_data
){
1515 .name
= "pcie_ref_src",
1516 .parent_names
= gcc_pxo_pll3
,
1518 .ops
= &clk_rcg_ops
,
1519 .flags
= CLK_SET_RATE_GATE
,
1524 static struct clk_branch pcie_ref_src_clk
= {
1528 .enable_reg
= 0x3860,
1529 .enable_mask
= BIT(9),
1530 .hw
.init
= &(struct clk_init_data
){
1531 .name
= "pcie_ref_src_clk",
1532 .parent_names
= (const char *[]){ "pcie_ref_src" },
1534 .ops
= &clk_branch_ops
,
1535 .flags
= CLK_SET_RATE_PARENT
,
1540 static struct clk_branch pcie_a_clk
= {
1544 .enable_reg
= 0x22c0,
1545 .enable_mask
= BIT(4),
1546 .hw
.init
= &(struct clk_init_data
){
1547 .name
= "pcie_a_clk",
1548 .ops
= &clk_branch_ops
,
1553 static struct clk_branch pcie_aux_clk
= {
1557 .enable_reg
= 0x22c8,
1558 .enable_mask
= BIT(4),
1559 .hw
.init
= &(struct clk_init_data
){
1560 .name
= "pcie_aux_clk",
1561 .ops
= &clk_branch_ops
,
1566 static struct clk_branch pcie_h_clk
= {
1570 .enable_reg
= 0x22cc,
1571 .enable_mask
= BIT(4),
1572 .hw
.init
= &(struct clk_init_data
){
1573 .name
= "pcie_h_clk",
1574 .ops
= &clk_branch_ops
,
1579 static struct clk_branch pcie_phy_clk
= {
1583 .enable_reg
= 0x22d0,
1584 .enable_mask
= BIT(4),
1585 .hw
.init
= &(struct clk_init_data
){
1586 .name
= "pcie_phy_clk",
1587 .ops
= &clk_branch_ops
,
1592 static struct clk_rcg pcie1_ref_src
= {
1600 .parent_map
= gcc_pxo_pll3_map
,
1602 .freq_tbl
= clk_tbl_pcie_ref
,
1604 .enable_reg
= 0x3aa0,
1605 .enable_mask
= BIT(11),
1606 .hw
.init
= &(struct clk_init_data
){
1607 .name
= "pcie1_ref_src",
1608 .parent_names
= gcc_pxo_pll3
,
1610 .ops
= &clk_rcg_ops
,
1611 .flags
= CLK_SET_RATE_GATE
,
1616 static struct clk_branch pcie1_ref_src_clk
= {
1620 .enable_reg
= 0x3aa0,
1621 .enable_mask
= BIT(9),
1622 .hw
.init
= &(struct clk_init_data
){
1623 .name
= "pcie1_ref_src_clk",
1624 .parent_names
= (const char *[]){ "pcie1_ref_src" },
1626 .ops
= &clk_branch_ops
,
1627 .flags
= CLK_SET_RATE_PARENT
,
1632 static struct clk_branch pcie1_a_clk
= {
1636 .enable_reg
= 0x3a80,
1637 .enable_mask
= BIT(4),
1638 .hw
.init
= &(struct clk_init_data
){
1639 .name
= "pcie1_a_clk",
1640 .ops
= &clk_branch_ops
,
1645 static struct clk_branch pcie1_aux_clk
= {
1649 .enable_reg
= 0x3a88,
1650 .enable_mask
= BIT(4),
1651 .hw
.init
= &(struct clk_init_data
){
1652 .name
= "pcie1_aux_clk",
1653 .ops
= &clk_branch_ops
,
1658 static struct clk_branch pcie1_h_clk
= {
1662 .enable_reg
= 0x3a8c,
1663 .enable_mask
= BIT(4),
1664 .hw
.init
= &(struct clk_init_data
){
1665 .name
= "pcie1_h_clk",
1666 .ops
= &clk_branch_ops
,
1671 static struct clk_branch pcie1_phy_clk
= {
1675 .enable_reg
= 0x3a90,
1676 .enable_mask
= BIT(4),
1677 .hw
.init
= &(struct clk_init_data
){
1678 .name
= "pcie1_phy_clk",
1679 .ops
= &clk_branch_ops
,
1684 static struct clk_rcg pcie2_ref_src
= {
1692 .parent_map
= gcc_pxo_pll3_map
,
1694 .freq_tbl
= clk_tbl_pcie_ref
,
1696 .enable_reg
= 0x3ae0,
1697 .enable_mask
= BIT(11),
1698 .hw
.init
= &(struct clk_init_data
){
1699 .name
= "pcie2_ref_src",
1700 .parent_names
= gcc_pxo_pll3
,
1702 .ops
= &clk_rcg_ops
,
1703 .flags
= CLK_SET_RATE_GATE
,
1708 static struct clk_branch pcie2_ref_src_clk
= {
1712 .enable_reg
= 0x3ae0,
1713 .enable_mask
= BIT(9),
1714 .hw
.init
= &(struct clk_init_data
){
1715 .name
= "pcie2_ref_src_clk",
1716 .parent_names
= (const char *[]){ "pcie2_ref_src" },
1718 .ops
= &clk_branch_ops
,
1719 .flags
= CLK_SET_RATE_PARENT
,
1724 static struct clk_branch pcie2_a_clk
= {
1728 .enable_reg
= 0x3ac0,
1729 .enable_mask
= BIT(4),
1730 .hw
.init
= &(struct clk_init_data
){
1731 .name
= "pcie2_a_clk",
1732 .ops
= &clk_branch_ops
,
1737 static struct clk_branch pcie2_aux_clk
= {
1741 .enable_reg
= 0x3ac8,
1742 .enable_mask
= BIT(4),
1743 .hw
.init
= &(struct clk_init_data
){
1744 .name
= "pcie2_aux_clk",
1745 .ops
= &clk_branch_ops
,
1750 static struct clk_branch pcie2_h_clk
= {
1754 .enable_reg
= 0x3acc,
1755 .enable_mask
= BIT(4),
1756 .hw
.init
= &(struct clk_init_data
){
1757 .name
= "pcie2_h_clk",
1758 .ops
= &clk_branch_ops
,
1763 static struct clk_branch pcie2_phy_clk
= {
1767 .enable_reg
= 0x3ad0,
1768 .enable_mask
= BIT(4),
1769 .hw
.init
= &(struct clk_init_data
){
1770 .name
= "pcie2_phy_clk",
1771 .ops
= &clk_branch_ops
,
1776 static const struct freq_tbl clk_tbl_sata_ref
[] = {
1777 { 100000000, P_PLL3
, 12, 0, 0 },
1781 static struct clk_rcg sata_ref_src
= {
1789 .parent_map
= gcc_pxo_pll3_sata_map
,
1791 .freq_tbl
= clk_tbl_sata_ref
,
1793 .enable_reg
= 0x2c08,
1794 .enable_mask
= BIT(7),
1795 .hw
.init
= &(struct clk_init_data
){
1796 .name
= "sata_ref_src",
1797 .parent_names
= gcc_pxo_pll3
,
1799 .ops
= &clk_rcg_ops
,
1800 .flags
= CLK_SET_RATE_GATE
,
1805 static struct clk_branch sata_rxoob_clk
= {
1809 .enable_reg
= 0x2c0c,
1810 .enable_mask
= BIT(4),
1811 .hw
.init
= &(struct clk_init_data
){
1812 .name
= "sata_rxoob_clk",
1813 .parent_names
= (const char *[]){ "sata_ref_src" },
1815 .ops
= &clk_branch_ops
,
1816 .flags
= CLK_SET_RATE_PARENT
,
1821 static struct clk_branch sata_pmalive_clk
= {
1825 .enable_reg
= 0x2c10,
1826 .enable_mask
= BIT(4),
1827 .hw
.init
= &(struct clk_init_data
){
1828 .name
= "sata_pmalive_clk",
1829 .parent_names
= (const char *[]){ "sata_ref_src" },
1831 .ops
= &clk_branch_ops
,
1832 .flags
= CLK_SET_RATE_PARENT
,
1837 static struct clk_branch sata_phy_ref_clk
= {
1841 .enable_reg
= 0x2c14,
1842 .enable_mask
= BIT(4),
1843 .hw
.init
= &(struct clk_init_data
){
1844 .name
= "sata_phy_ref_clk",
1845 .parent_names
= (const char *[]){ "pxo" },
1847 .ops
= &clk_branch_ops
,
1852 static struct clk_branch sata_a_clk
= {
1856 .enable_reg
= 0x2c20,
1857 .enable_mask
= BIT(4),
1858 .hw
.init
= &(struct clk_init_data
){
1859 .name
= "sata_a_clk",
1860 .ops
= &clk_branch_ops
,
1865 static struct clk_branch sata_h_clk
= {
1869 .enable_reg
= 0x2c00,
1870 .enable_mask
= BIT(4),
1871 .hw
.init
= &(struct clk_init_data
){
1872 .name
= "sata_h_clk",
1873 .ops
= &clk_branch_ops
,
1878 static struct clk_branch sfab_sata_s_h_clk
= {
1882 .enable_reg
= 0x2480,
1883 .enable_mask
= BIT(4),
1884 .hw
.init
= &(struct clk_init_data
){
1885 .name
= "sfab_sata_s_h_clk",
1886 .ops
= &clk_branch_ops
,
1891 static struct clk_branch sata_phy_cfg_clk
= {
1895 .enable_reg
= 0x2c40,
1896 .enable_mask
= BIT(4),
1897 .hw
.init
= &(struct clk_init_data
){
1898 .name
= "sata_phy_cfg_clk",
1899 .ops
= &clk_branch_ops
,
1904 static const struct freq_tbl clk_tbl_usb30_master
[] = {
1905 { 125000000, P_PLL0
, 1, 5, 32 },
1909 static struct clk_rcg usb30_master_clk_src
= {
1914 .mnctr_reset_bit
= 7,
1915 .mnctr_mode_shift
= 5,
1926 .parent_map
= gcc_pxo_pll8_pll0
,
1928 .freq_tbl
= clk_tbl_usb30_master
,
1930 .enable_reg
= 0x3b2c,
1931 .enable_mask
= BIT(11),
1932 .hw
.init
= &(struct clk_init_data
){
1933 .name
= "usb30_master_ref_src",
1934 .parent_names
= gcc_pxo_pll8_pll0_map
,
1936 .ops
= &clk_rcg_ops
,
1937 .flags
= CLK_SET_RATE_GATE
,
1942 static struct clk_branch usb30_0_branch_clk
= {
1946 .enable_reg
= 0x3b24,
1947 .enable_mask
= BIT(4),
1948 .hw
.init
= &(struct clk_init_data
){
1949 .name
= "usb30_0_branch_clk",
1950 .parent_names
= (const char *[]){ "usb30_master_ref_src", },
1952 .ops
= &clk_branch_ops
,
1953 .flags
= CLK_SET_RATE_PARENT
,
1958 static struct clk_branch usb30_1_branch_clk
= {
1962 .enable_reg
= 0x3b34,
1963 .enable_mask
= BIT(4),
1964 .hw
.init
= &(struct clk_init_data
){
1965 .name
= "usb30_1_branch_clk",
1966 .parent_names
= (const char *[]){ "usb30_master_ref_src", },
1968 .ops
= &clk_branch_ops
,
1969 .flags
= CLK_SET_RATE_PARENT
,
1974 static const struct freq_tbl clk_tbl_usb30_utmi
[] = {
1975 { 60000000, P_PLL8
, 1, 5, 32 },
1979 static struct clk_rcg usb30_utmi_clk
= {
1984 .mnctr_reset_bit
= 7,
1985 .mnctr_mode_shift
= 5,
1996 .parent_map
= gcc_pxo_pll8_pll0
,
1998 .freq_tbl
= clk_tbl_usb30_utmi
,
2000 .enable_reg
= 0x3b44,
2001 .enable_mask
= BIT(11),
2002 .hw
.init
= &(struct clk_init_data
){
2003 .name
= "usb30_utmi_clk",
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_utmi_clk_ctl
= {
2016 .enable_reg
= 0x3b48,
2017 .enable_mask
= BIT(4),
2018 .hw
.init
= &(struct clk_init_data
){
2019 .name
= "usb30_0_utmi_clk_ctl",
2020 .parent_names
= (const char *[]){ "usb30_utmi_clk", },
2022 .ops
= &clk_branch_ops
,
2023 .flags
= CLK_SET_RATE_PARENT
,
2028 static struct clk_branch usb30_1_utmi_clk_ctl
= {
2032 .enable_reg
= 0x3b4c,
2033 .enable_mask
= BIT(4),
2034 .hw
.init
= &(struct clk_init_data
){
2035 .name
= "usb30_1_utmi_clk_ctl",
2036 .parent_names
= (const char *[]){ "usb30_utmi_clk", },
2038 .ops
= &clk_branch_ops
,
2039 .flags
= CLK_SET_RATE_PARENT
,
2044 static const struct freq_tbl clk_tbl_usb
[] = {
2045 { 60000000, P_PLL8
, 1, 5, 32 },
2049 static struct clk_rcg usb_hs1_xcvr_clk_src
= {
2054 .mnctr_reset_bit
= 7,
2055 .mnctr_mode_shift
= 5,
2066 .parent_map
= gcc_pxo_pll8_pll0
,
2068 .freq_tbl
= clk_tbl_usb
,
2070 .enable_reg
= 0x2968,
2071 .enable_mask
= BIT(11),
2072 .hw
.init
= &(struct clk_init_data
){
2073 .name
= "usb_hs1_xcvr_src",
2074 .parent_names
= gcc_pxo_pll8_pll0_map
,
2076 .ops
= &clk_rcg_ops
,
2077 .flags
= CLK_SET_RATE_GATE
,
2082 static struct clk_branch usb_hs1_xcvr_clk
= {
2086 .enable_reg
= 0x290c,
2087 .enable_mask
= BIT(9),
2088 .hw
.init
= &(struct clk_init_data
){
2089 .name
= "usb_hs1_xcvr_clk",
2090 .parent_names
= (const char *[]){ "usb_hs1_xcvr_src" },
2092 .ops
= &clk_branch_ops
,
2093 .flags
= CLK_SET_RATE_PARENT
,
2098 static struct clk_branch usb_hs1_h_clk
= {
2104 .enable_reg
= 0x2900,
2105 .enable_mask
= BIT(4),
2106 .hw
.init
= &(struct clk_init_data
){
2107 .name
= "usb_hs1_h_clk",
2108 .ops
= &clk_branch_ops
,
2113 static struct clk_rcg usb_fs1_xcvr_clk_src
= {
2118 .mnctr_reset_bit
= 7,
2119 .mnctr_mode_shift
= 5,
2130 .parent_map
= gcc_pxo_pll8_pll0
,
2132 .freq_tbl
= clk_tbl_usb
,
2134 .enable_reg
= 0x2968,
2135 .enable_mask
= BIT(11),
2136 .hw
.init
= &(struct clk_init_data
){
2137 .name
= "usb_fs1_xcvr_src",
2138 .parent_names
= gcc_pxo_pll8_pll0_map
,
2140 .ops
= &clk_rcg_ops
,
2141 .flags
= CLK_SET_RATE_GATE
,
2146 static struct clk_branch usb_fs1_xcvr_clk
= {
2150 .enable_reg
= 0x2968,
2151 .enable_mask
= BIT(9),
2152 .hw
.init
= &(struct clk_init_data
){
2153 .name
= "usb_fs1_xcvr_clk",
2154 .parent_names
= (const char *[]){ "usb_fs1_xcvr_src", },
2156 .ops
= &clk_branch_ops
,
2157 .flags
= CLK_SET_RATE_PARENT
,
2162 static struct clk_branch usb_fs1_sys_clk
= {
2166 .enable_reg
= 0x296c,
2167 .enable_mask
= BIT(4),
2168 .hw
.init
= &(struct clk_init_data
){
2169 .name
= "usb_fs1_sys_clk",
2170 .parent_names
= (const char *[]){ "usb_fs1_xcvr_src", },
2172 .ops
= &clk_branch_ops
,
2173 .flags
= CLK_SET_RATE_PARENT
,
2178 static struct clk_branch usb_fs1_h_clk
= {
2182 .enable_reg
= 0x2960,
2183 .enable_mask
= BIT(4),
2184 .hw
.init
= &(struct clk_init_data
){
2185 .name
= "usb_fs1_h_clk",
2186 .ops
= &clk_branch_ops
,
2191 static struct clk_branch ebi2_clk
= {
2197 .enable_reg
= 0x3b00,
2198 .enable_mask
= BIT(4),
2199 .hw
.init
= &(struct clk_init_data
){
2201 .ops
= &clk_branch_ops
,
2206 static struct clk_branch ebi2_aon_clk
= {
2210 .enable_reg
= 0x3b00,
2211 .enable_mask
= BIT(8),
2212 .hw
.init
= &(struct clk_init_data
){
2213 .name
= "ebi2_always_on_clk",
2214 .ops
= &clk_branch_ops
,
2219 static const struct freq_tbl clk_tbl_gmac
[] = {
2220 { 133000000, P_PLL0
, 1, 50, 301 },
2221 { 266000000, P_PLL0
, 1, 127, 382 },
2225 static struct clk_dyn_rcg gmac_core1_src
= {
2226 .ns_reg
[0] = 0x3cac,
2227 .ns_reg
[1] = 0x3cb0,
2228 .md_reg
[0] = 0x3ca4,
2229 .md_reg
[1] = 0x3ca8,
2233 .mnctr_reset_bit
= 7,
2234 .mnctr_mode_shift
= 5,
2241 .mnctr_reset_bit
= 7,
2242 .mnctr_mode_shift
= 5,
2249 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2253 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2264 .freq_tbl
= clk_tbl_gmac
,
2266 .enable_reg
= 0x3ca0,
2267 .enable_mask
= BIT(1),
2268 .hw
.init
= &(struct clk_init_data
){
2269 .name
= "gmac_core1_src",
2270 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2272 .ops
= &clk_dyn_rcg_ops
,
2277 static struct clk_branch gmac_core1_clk
= {
2283 .enable_reg
= 0x3cb4,
2284 .enable_mask
= BIT(4),
2285 .hw
.init
= &(struct clk_init_data
){
2286 .name
= "gmac_core1_clk",
2287 .parent_names
= (const char *[]){
2291 .ops
= &clk_branch_ops
,
2292 .flags
= CLK_SET_RATE_PARENT
,
2297 static struct clk_dyn_rcg gmac_core2_src
= {
2298 .ns_reg
[0] = 0x3ccc,
2299 .ns_reg
[1] = 0x3cd0,
2300 .md_reg
[0] = 0x3cc4,
2301 .md_reg
[1] = 0x3cc8,
2305 .mnctr_reset_bit
= 7,
2306 .mnctr_mode_shift
= 5,
2313 .mnctr_reset_bit
= 7,
2314 .mnctr_mode_shift
= 5,
2321 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2325 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2336 .freq_tbl
= clk_tbl_gmac
,
2338 .enable_reg
= 0x3cc0,
2339 .enable_mask
= BIT(1),
2340 .hw
.init
= &(struct clk_init_data
){
2341 .name
= "gmac_core2_src",
2342 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2344 .ops
= &clk_dyn_rcg_ops
,
2349 static struct clk_branch gmac_core2_clk
= {
2355 .enable_reg
= 0x3cd4,
2356 .enable_mask
= BIT(4),
2357 .hw
.init
= &(struct clk_init_data
){
2358 .name
= "gmac_core2_clk",
2359 .parent_names
= (const char *[]){
2363 .ops
= &clk_branch_ops
,
2364 .flags
= CLK_SET_RATE_PARENT
,
2369 static struct clk_dyn_rcg gmac_core3_src
= {
2370 .ns_reg
[0] = 0x3cec,
2371 .ns_reg
[1] = 0x3cf0,
2372 .md_reg
[0] = 0x3ce4,
2373 .md_reg
[1] = 0x3ce8,
2377 .mnctr_reset_bit
= 7,
2378 .mnctr_mode_shift
= 5,
2385 .mnctr_reset_bit
= 7,
2386 .mnctr_mode_shift
= 5,
2393 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2397 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2408 .freq_tbl
= clk_tbl_gmac
,
2410 .enable_reg
= 0x3ce0,
2411 .enable_mask
= BIT(1),
2412 .hw
.init
= &(struct clk_init_data
){
2413 .name
= "gmac_core3_src",
2414 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2416 .ops
= &clk_dyn_rcg_ops
,
2421 static struct clk_branch gmac_core3_clk
= {
2427 .enable_reg
= 0x3cf4,
2428 .enable_mask
= BIT(4),
2429 .hw
.init
= &(struct clk_init_data
){
2430 .name
= "gmac_core3_clk",
2431 .parent_names
= (const char *[]){
2435 .ops
= &clk_branch_ops
,
2436 .flags
= CLK_SET_RATE_PARENT
,
2441 static struct clk_dyn_rcg gmac_core4_src
= {
2442 .ns_reg
[0] = 0x3d0c,
2443 .ns_reg
[1] = 0x3d10,
2444 .md_reg
[0] = 0x3d04,
2445 .md_reg
[1] = 0x3d08,
2449 .mnctr_reset_bit
= 7,
2450 .mnctr_mode_shift
= 5,
2457 .mnctr_reset_bit
= 7,
2458 .mnctr_mode_shift
= 5,
2465 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2469 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2480 .freq_tbl
= clk_tbl_gmac
,
2482 .enable_reg
= 0x3d00,
2483 .enable_mask
= BIT(1),
2484 .hw
.init
= &(struct clk_init_data
){
2485 .name
= "gmac_core4_src",
2486 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2488 .ops
= &clk_dyn_rcg_ops
,
2493 static struct clk_branch gmac_core4_clk
= {
2499 .enable_reg
= 0x3d14,
2500 .enable_mask
= BIT(4),
2501 .hw
.init
= &(struct clk_init_data
){
2502 .name
= "gmac_core4_clk",
2503 .parent_names
= (const char *[]){
2507 .ops
= &clk_branch_ops
,
2508 .flags
= CLK_SET_RATE_PARENT
,
2513 static const struct freq_tbl clk_tbl_nss_tcm
[] = {
2514 { 266000000, P_PLL0
, 3, 0, 0 },
2515 { 400000000, P_PLL0
, 2, 0, 0 },
2519 static struct clk_dyn_rcg nss_tcm_src
= {
2520 .ns_reg
[0] = 0x3dc4,
2521 .ns_reg
[1] = 0x3dc8,
2525 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2529 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2540 .freq_tbl
= clk_tbl_nss_tcm
,
2542 .enable_reg
= 0x3dc0,
2543 .enable_mask
= BIT(1),
2544 .hw
.init
= &(struct clk_init_data
){
2545 .name
= "nss_tcm_src",
2546 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2548 .ops
= &clk_dyn_rcg_ops
,
2553 static struct clk_branch nss_tcm_clk
= {
2557 .enable_reg
= 0x3dd0,
2558 .enable_mask
= BIT(6) | BIT(4),
2559 .hw
.init
= &(struct clk_init_data
){
2560 .name
= "nss_tcm_clk",
2561 .parent_names
= (const char *[]){
2565 .ops
= &clk_branch_ops
,
2566 .flags
= CLK_SET_RATE_PARENT
,
2571 static const struct freq_tbl clk_tbl_nss
[] = {
2572 { 110000000, P_PLL18
, 1, 1, 5 },
2573 { 275000000, P_PLL18
, 2, 0, 0 },
2574 { 550000000, P_PLL18
, 1, 0, 0 },
2575 { 733000000, P_PLL18
, 1, 0, 0 },
2579 static struct clk_dyn_rcg ubi32_core1_src_clk
= {
2580 .ns_reg
[0] = 0x3d2c,
2581 .ns_reg
[1] = 0x3d30,
2582 .md_reg
[0] = 0x3d24,
2583 .md_reg
[1] = 0x3d28,
2587 .mnctr_reset_bit
= 7,
2588 .mnctr_mode_shift
= 5,
2595 .mnctr_reset_bit
= 7,
2596 .mnctr_mode_shift
= 5,
2603 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2607 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2618 .freq_tbl
= clk_tbl_nss
,
2620 .enable_reg
= 0x3d20,
2621 .enable_mask
= BIT(1),
2622 .hw
.init
= &(struct clk_init_data
){
2623 .name
= "ubi32_core1_src_clk",
2624 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2626 .ops
= &clk_dyn_rcg_ops
,
2627 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
2632 static struct clk_dyn_rcg ubi32_core2_src_clk
= {
2633 .ns_reg
[0] = 0x3d4c,
2634 .ns_reg
[1] = 0x3d50,
2635 .md_reg
[0] = 0x3d44,
2636 .md_reg
[1] = 0x3d48,
2640 .mnctr_reset_bit
= 7,
2641 .mnctr_mode_shift
= 5,
2648 .mnctr_reset_bit
= 7,
2649 .mnctr_mode_shift
= 5,
2656 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2660 .parent_map
= gcc_pxo_pll8_pll14_pll18_pll0_map
,
2671 .freq_tbl
= clk_tbl_nss
,
2673 .enable_reg
= 0x3d40,
2674 .enable_mask
= BIT(1),
2675 .hw
.init
= &(struct clk_init_data
){
2676 .name
= "ubi32_core2_src_clk",
2677 .parent_names
= gcc_pxo_pll8_pll14_pll18_pll0
,
2679 .ops
= &clk_dyn_rcg_ops
,
2680 .flags
= CLK_SET_RATE_PARENT
| CLK_GET_RATE_NOCACHE
,
2685 static struct clk_regmap
*gcc_ipq806x_clks
[] = {
2686 [PLL0
] = &pll0
.clkr
,
2687 [PLL0_VOTE
] = &pll0_vote
,
2688 [PLL3
] = &pll3
.clkr
,
2689 [PLL4_VOTE
] = &pll4_vote
,
2690 [PLL8
] = &pll8
.clkr
,
2691 [PLL8_VOTE
] = &pll8_vote
,
2692 [PLL14
] = &pll14
.clkr
,
2693 [PLL14_VOTE
] = &pll14_vote
,
2694 [PLL18
] = &pll18
.clkr
,
2695 [GSBI1_UART_SRC
] = &gsbi1_uart_src
.clkr
,
2696 [GSBI1_UART_CLK
] = &gsbi1_uart_clk
.clkr
,
2697 [GSBI2_UART_SRC
] = &gsbi2_uart_src
.clkr
,
2698 [GSBI2_UART_CLK
] = &gsbi2_uart_clk
.clkr
,
2699 [GSBI4_UART_SRC
] = &gsbi4_uart_src
.clkr
,
2700 [GSBI4_UART_CLK
] = &gsbi4_uart_clk
.clkr
,
2701 [GSBI5_UART_SRC
] = &gsbi5_uart_src
.clkr
,
2702 [GSBI5_UART_CLK
] = &gsbi5_uart_clk
.clkr
,
2703 [GSBI6_UART_SRC
] = &gsbi6_uart_src
.clkr
,
2704 [GSBI6_UART_CLK
] = &gsbi6_uart_clk
.clkr
,
2705 [GSBI7_UART_SRC
] = &gsbi7_uart_src
.clkr
,
2706 [GSBI7_UART_CLK
] = &gsbi7_uart_clk
.clkr
,
2707 [GSBI1_QUP_SRC
] = &gsbi1_qup_src
.clkr
,
2708 [GSBI1_QUP_CLK
] = &gsbi1_qup_clk
.clkr
,
2709 [GSBI2_QUP_SRC
] = &gsbi2_qup_src
.clkr
,
2710 [GSBI2_QUP_CLK
] = &gsbi2_qup_clk
.clkr
,
2711 [GSBI4_QUP_SRC
] = &gsbi4_qup_src
.clkr
,
2712 [GSBI4_QUP_CLK
] = &gsbi4_qup_clk
.clkr
,
2713 [GSBI5_QUP_SRC
] = &gsbi5_qup_src
.clkr
,
2714 [GSBI5_QUP_CLK
] = &gsbi5_qup_clk
.clkr
,
2715 [GSBI6_QUP_SRC
] = &gsbi6_qup_src
.clkr
,
2716 [GSBI6_QUP_CLK
] = &gsbi6_qup_clk
.clkr
,
2717 [GSBI7_QUP_SRC
] = &gsbi7_qup_src
.clkr
,
2718 [GSBI7_QUP_CLK
] = &gsbi7_qup_clk
.clkr
,
2719 [GP0_SRC
] = &gp0_src
.clkr
,
2720 [GP0_CLK
] = &gp0_clk
.clkr
,
2721 [GP1_SRC
] = &gp1_src
.clkr
,
2722 [GP1_CLK
] = &gp1_clk
.clkr
,
2723 [GP2_SRC
] = &gp2_src
.clkr
,
2724 [GP2_CLK
] = &gp2_clk
.clkr
,
2725 [PMEM_A_CLK
] = &pmem_clk
.clkr
,
2726 [PRNG_SRC
] = &prng_src
.clkr
,
2727 [PRNG_CLK
] = &prng_clk
.clkr
,
2728 [SDC1_SRC
] = &sdc1_src
.clkr
,
2729 [SDC1_CLK
] = &sdc1_clk
.clkr
,
2730 [SDC3_SRC
] = &sdc3_src
.clkr
,
2731 [SDC3_CLK
] = &sdc3_clk
.clkr
,
2732 [TSIF_REF_SRC
] = &tsif_ref_src
.clkr
,
2733 [TSIF_REF_CLK
] = &tsif_ref_clk
.clkr
,
2734 [DMA_BAM_H_CLK
] = &dma_bam_h_clk
.clkr
,
2735 [GSBI1_H_CLK
] = &gsbi1_h_clk
.clkr
,
2736 [GSBI2_H_CLK
] = &gsbi2_h_clk
.clkr
,
2737 [GSBI4_H_CLK
] = &gsbi4_h_clk
.clkr
,
2738 [GSBI5_H_CLK
] = &gsbi5_h_clk
.clkr
,
2739 [GSBI6_H_CLK
] = &gsbi6_h_clk
.clkr
,
2740 [GSBI7_H_CLK
] = &gsbi7_h_clk
.clkr
,
2741 [TSIF_H_CLK
] = &tsif_h_clk
.clkr
,
2742 [SDC1_H_CLK
] = &sdc1_h_clk
.clkr
,
2743 [SDC3_H_CLK
] = &sdc3_h_clk
.clkr
,
2744 [ADM0_CLK
] = &adm0_clk
.clkr
,
2745 [ADM0_PBUS_CLK
] = &adm0_pbus_clk
.clkr
,
2746 [PCIE_A_CLK
] = &pcie_a_clk
.clkr
,
2747 [PCIE_AUX_CLK
] = &pcie_aux_clk
.clkr
,
2748 [PCIE_H_CLK
] = &pcie_h_clk
.clkr
,
2749 [PCIE_PHY_CLK
] = &pcie_phy_clk
.clkr
,
2750 [SFAB_SATA_S_H_CLK
] = &sfab_sata_s_h_clk
.clkr
,
2751 [PMIC_ARB0_H_CLK
] = &pmic_arb0_h_clk
.clkr
,
2752 [PMIC_ARB1_H_CLK
] = &pmic_arb1_h_clk
.clkr
,
2753 [PMIC_SSBI2_CLK
] = &pmic_ssbi2_clk
.clkr
,
2754 [RPM_MSG_RAM_H_CLK
] = &rpm_msg_ram_h_clk
.clkr
,
2755 [SATA_H_CLK
] = &sata_h_clk
.clkr
,
2756 [SATA_CLK_SRC
] = &sata_ref_src
.clkr
,
2757 [SATA_RXOOB_CLK
] = &sata_rxoob_clk
.clkr
,
2758 [SATA_PMALIVE_CLK
] = &sata_pmalive_clk
.clkr
,
2759 [SATA_PHY_REF_CLK
] = &sata_phy_ref_clk
.clkr
,
2760 [SATA_A_CLK
] = &sata_a_clk
.clkr
,
2761 [SATA_PHY_CFG_CLK
] = &sata_phy_cfg_clk
.clkr
,
2762 [PCIE_ALT_REF_SRC
] = &pcie_ref_src
.clkr
,
2763 [PCIE_ALT_REF_CLK
] = &pcie_ref_src_clk
.clkr
,
2764 [PCIE_1_A_CLK
] = &pcie1_a_clk
.clkr
,
2765 [PCIE_1_AUX_CLK
] = &pcie1_aux_clk
.clkr
,
2766 [PCIE_1_H_CLK
] = &pcie1_h_clk
.clkr
,
2767 [PCIE_1_PHY_CLK
] = &pcie1_phy_clk
.clkr
,
2768 [PCIE_1_ALT_REF_SRC
] = &pcie1_ref_src
.clkr
,
2769 [PCIE_1_ALT_REF_CLK
] = &pcie1_ref_src_clk
.clkr
,
2770 [PCIE_2_A_CLK
] = &pcie2_a_clk
.clkr
,
2771 [PCIE_2_AUX_CLK
] = &pcie2_aux_clk
.clkr
,
2772 [PCIE_2_H_CLK
] = &pcie2_h_clk
.clkr
,
2773 [PCIE_2_PHY_CLK
] = &pcie2_phy_clk
.clkr
,
2774 [PCIE_2_ALT_REF_SRC
] = &pcie2_ref_src
.clkr
,
2775 [PCIE_2_ALT_REF_CLK
] = &pcie2_ref_src_clk
.clkr
,
2776 [USB30_MASTER_SRC
] = &usb30_master_clk_src
.clkr
,
2777 [USB30_0_MASTER_CLK
] = &usb30_0_branch_clk
.clkr
,
2778 [USB30_1_MASTER_CLK
] = &usb30_1_branch_clk
.clkr
,
2779 [USB30_UTMI_SRC
] = &usb30_utmi_clk
.clkr
,
2780 [USB30_0_UTMI_CLK
] = &usb30_0_utmi_clk_ctl
.clkr
,
2781 [USB30_1_UTMI_CLK
] = &usb30_1_utmi_clk_ctl
.clkr
,
2782 [USB_HS1_H_CLK
] = &usb_hs1_h_clk
.clkr
,
2783 [USB_HS1_XCVR_SRC
] = &usb_hs1_xcvr_clk_src
.clkr
,
2784 [USB_HS1_XCVR_CLK
] = &usb_hs1_xcvr_clk
.clkr
,
2785 [USB_FS1_H_CLK
] = &usb_fs1_h_clk
.clkr
,
2786 [USB_FS1_XCVR_SRC
] = &usb_fs1_xcvr_clk_src
.clkr
,
2787 [USB_FS1_XCVR_CLK
] = &usb_fs1_xcvr_clk
.clkr
,
2788 [USB_FS1_SYSTEM_CLK
] = &usb_fs1_sys_clk
.clkr
,
2789 [EBI2_CLK
] = &ebi2_clk
.clkr
,
2790 [EBI2_AON_CLK
] = &ebi2_aon_clk
.clkr
,
2791 [GMAC_CORE1_CLK_SRC
] = &gmac_core1_src
.clkr
,
2792 [GMAC_CORE1_CLK
] = &gmac_core1_clk
.clkr
,
2793 [GMAC_CORE2_CLK_SRC
] = &gmac_core2_src
.clkr
,
2794 [GMAC_CORE2_CLK
] = &gmac_core2_clk
.clkr
,
2795 [GMAC_CORE3_CLK_SRC
] = &gmac_core3_src
.clkr
,
2796 [GMAC_CORE3_CLK
] = &gmac_core3_clk
.clkr
,
2797 [GMAC_CORE4_CLK_SRC
] = &gmac_core4_src
.clkr
,
2798 [GMAC_CORE4_CLK
] = &gmac_core4_clk
.clkr
,
2799 [UBI32_CORE1_CLK_SRC
] = &ubi32_core1_src_clk
.clkr
,
2800 [UBI32_CORE2_CLK_SRC
] = &ubi32_core2_src_clk
.clkr
,
2801 [NSSTCM_CLK_SRC
] = &nss_tcm_src
.clkr
,
2802 [NSSTCM_CLK
] = &nss_tcm_clk
.clkr
,
2805 static const struct qcom_reset_map gcc_ipq806x_resets
[] = {
2806 [QDSS_STM_RESET
] = { 0x2060, 6 },
2807 [AFAB_SMPSS_S_RESET
] = { 0x20b8, 2 },
2808 [AFAB_SMPSS_M1_RESET
] = { 0x20b8, 1 },
2809 [AFAB_SMPSS_M0_RESET
] = { 0x20b8, 0 },
2810 [AFAB_EBI1_CH0_RESET
] = { 0x20c0, 7 },
2811 [AFAB_EBI1_CH1_RESET
] = { 0x20c4, 7 },
2812 [SFAB_ADM0_M0_RESET
] = { 0x21e0, 7 },
2813 [SFAB_ADM0_M1_RESET
] = { 0x21e4, 7 },
2814 [SFAB_ADM0_M2_RESET
] = { 0x21e8, 7 },
2815 [ADM0_C2_RESET
] = { 0x220c, 4 },
2816 [ADM0_C1_RESET
] = { 0x220c, 3 },
2817 [ADM0_C0_RESET
] = { 0x220c, 2 },
2818 [ADM0_PBUS_RESET
] = { 0x220c, 1 },
2819 [ADM0_RESET
] = { 0x220c, 0 },
2820 [QDSS_CLKS_SW_RESET
] = { 0x2260, 5 },
2821 [QDSS_POR_RESET
] = { 0x2260, 4 },
2822 [QDSS_TSCTR_RESET
] = { 0x2260, 3 },
2823 [QDSS_HRESET_RESET
] = { 0x2260, 2 },
2824 [QDSS_AXI_RESET
] = { 0x2260, 1 },
2825 [QDSS_DBG_RESET
] = { 0x2260, 0 },
2826 [SFAB_PCIE_M_RESET
] = { 0x22d8, 1 },
2827 [SFAB_PCIE_S_RESET
] = { 0x22d8, 0 },
2828 [PCIE_EXT_RESET
] = { 0x22dc, 6 },
2829 [PCIE_PHY_RESET
] = { 0x22dc, 5 },
2830 [PCIE_PCI_RESET
] = { 0x22dc, 4 },
2831 [PCIE_POR_RESET
] = { 0x22dc, 3 },
2832 [PCIE_HCLK_RESET
] = { 0x22dc, 2 },
2833 [PCIE_ACLK_RESET
] = { 0x22dc, 0 },
2834 [SFAB_LPASS_RESET
] = { 0x23a0, 7 },
2835 [SFAB_AFAB_M_RESET
] = { 0x23e0, 7 },
2836 [AFAB_SFAB_M0_RESET
] = { 0x2420, 7 },
2837 [AFAB_SFAB_M1_RESET
] = { 0x2424, 7 },
2838 [SFAB_SATA_S_RESET
] = { 0x2480, 7 },
2839 [SFAB_DFAB_M_RESET
] = { 0x2500, 7 },
2840 [DFAB_SFAB_M_RESET
] = { 0x2520, 7 },
2841 [DFAB_SWAY0_RESET
] = { 0x2540, 7 },
2842 [DFAB_SWAY1_RESET
] = { 0x2544, 7 },
2843 [DFAB_ARB0_RESET
] = { 0x2560, 7 },
2844 [DFAB_ARB1_RESET
] = { 0x2564, 7 },
2845 [PPSS_PROC_RESET
] = { 0x2594, 1 },
2846 [PPSS_RESET
] = { 0x2594, 0 },
2847 [DMA_BAM_RESET
] = { 0x25c0, 7 },
2848 [SPS_TIC_H_RESET
] = { 0x2600, 7 },
2849 [SFAB_CFPB_M_RESET
] = { 0x2680, 7 },
2850 [SFAB_CFPB_S_RESET
] = { 0x26c0, 7 },
2851 [TSIF_H_RESET
] = { 0x2700, 7 },
2852 [CE1_H_RESET
] = { 0x2720, 7 },
2853 [CE1_CORE_RESET
] = { 0x2724, 7 },
2854 [CE1_SLEEP_RESET
] = { 0x2728, 7 },
2855 [CE2_H_RESET
] = { 0x2740, 7 },
2856 [CE2_CORE_RESET
] = { 0x2744, 7 },
2857 [SFAB_SFPB_M_RESET
] = { 0x2780, 7 },
2858 [SFAB_SFPB_S_RESET
] = { 0x27a0, 7 },
2859 [RPM_PROC_RESET
] = { 0x27c0, 7 },
2860 [PMIC_SSBI2_RESET
] = { 0x280c, 12 },
2861 [SDC1_RESET
] = { 0x2830, 0 },
2862 [SDC2_RESET
] = { 0x2850, 0 },
2863 [SDC3_RESET
] = { 0x2870, 0 },
2864 [SDC4_RESET
] = { 0x2890, 0 },
2865 [USB_HS1_RESET
] = { 0x2910, 0 },
2866 [USB_HSIC_RESET
] = { 0x2934, 0 },
2867 [USB_FS1_XCVR_RESET
] = { 0x2974, 1 },
2868 [USB_FS1_RESET
] = { 0x2974, 0 },
2869 [GSBI1_RESET
] = { 0x29dc, 0 },
2870 [GSBI2_RESET
] = { 0x29fc, 0 },
2871 [GSBI3_RESET
] = { 0x2a1c, 0 },
2872 [GSBI4_RESET
] = { 0x2a3c, 0 },
2873 [GSBI5_RESET
] = { 0x2a5c, 0 },
2874 [GSBI6_RESET
] = { 0x2a7c, 0 },
2875 [GSBI7_RESET
] = { 0x2a9c, 0 },
2876 [SPDM_RESET
] = { 0x2b6c, 0 },
2877 [SEC_CTRL_RESET
] = { 0x2b80, 7 },
2878 [TLMM_H_RESET
] = { 0x2ba0, 7 },
2879 [SFAB_SATA_M_RESET
] = { 0x2c18, 0 },
2880 [SATA_RESET
] = { 0x2c1c, 0 },
2881 [TSSC_RESET
] = { 0x2ca0, 7 },
2882 [PDM_RESET
] = { 0x2cc0, 12 },
2883 [MPM_H_RESET
] = { 0x2da0, 7 },
2884 [MPM_RESET
] = { 0x2da4, 0 },
2885 [SFAB_SMPSS_S_RESET
] = { 0x2e00, 7 },
2886 [PRNG_RESET
] = { 0x2e80, 12 },
2887 [SFAB_CE3_M_RESET
] = { 0x36c8, 1 },
2888 [SFAB_CE3_S_RESET
] = { 0x36c8, 0 },
2889 [CE3_SLEEP_RESET
] = { 0x36d0, 7 },
2890 [PCIE_1_M_RESET
] = { 0x3a98, 1 },
2891 [PCIE_1_S_RESET
] = { 0x3a98, 0 },
2892 [PCIE_1_EXT_RESET
] = { 0x3a9c, 6 },
2893 [PCIE_1_PHY_RESET
] = { 0x3a9c, 5 },
2894 [PCIE_1_PCI_RESET
] = { 0x3a9c, 4 },
2895 [PCIE_1_POR_RESET
] = { 0x3a9c, 3 },
2896 [PCIE_1_HCLK_RESET
] = { 0x3a9c, 2 },
2897 [PCIE_1_ACLK_RESET
] = { 0x3a9c, 0 },
2898 [PCIE_2_M_RESET
] = { 0x3ad8, 1 },
2899 [PCIE_2_S_RESET
] = { 0x3ad8, 0 },
2900 [PCIE_2_EXT_RESET
] = { 0x3adc, 6 },
2901 [PCIE_2_PHY_RESET
] = { 0x3adc, 5 },
2902 [PCIE_2_PCI_RESET
] = { 0x3adc, 4 },
2903 [PCIE_2_POR_RESET
] = { 0x3adc, 3 },
2904 [PCIE_2_HCLK_RESET
] = { 0x3adc, 2 },
2905 [PCIE_2_ACLK_RESET
] = { 0x3adc, 0 },
2906 [SFAB_USB30_S_RESET
] = { 0x3b54, 1 },
2907 [SFAB_USB30_M_RESET
] = { 0x3b54, 0 },
2908 [USB30_0_PORT2_HS_PHY_RESET
] = { 0x3b50, 5 },
2909 [USB30_0_MASTER_RESET
] = { 0x3b50, 4 },
2910 [USB30_0_SLEEP_RESET
] = { 0x3b50, 3 },
2911 [USB30_0_UTMI_PHY_RESET
] = { 0x3b50, 2 },
2912 [USB30_0_POWERON_RESET
] = { 0x3b50, 1 },
2913 [USB30_0_PHY_RESET
] = { 0x3b50, 0 },
2914 [USB30_1_MASTER_RESET
] = { 0x3b58, 4 },
2915 [USB30_1_SLEEP_RESET
] = { 0x3b58, 3 },
2916 [USB30_1_UTMI_PHY_RESET
] = { 0x3b58, 2 },
2917 [USB30_1_POWERON_RESET
] = { 0x3b58, 1 },
2918 [USB30_1_PHY_RESET
] = { 0x3b58, 0 },
2919 [NSSFB0_RESET
] = { 0x3b60, 6 },
2920 [NSSFB1_RESET
] = { 0x3b60, 7 },
2921 [UBI32_CORE1_CLKRST_CLAMP_RESET
] = { 0x3d3c, 3},
2922 [UBI32_CORE1_CLAMP_RESET
] = { 0x3d3c, 2 },
2923 [UBI32_CORE1_AHB_RESET
] = { 0x3d3c, 1 },
2924 [UBI32_CORE1_AXI_RESET
] = { 0x3d3c, 0 },
2925 [UBI32_CORE2_CLKRST_CLAMP_RESET
] = { 0x3d5c, 3 },
2926 [UBI32_CORE2_CLAMP_RESET
] = { 0x3d5c, 2 },
2927 [UBI32_CORE2_AHB_RESET
] = { 0x3d5c, 1 },
2928 [UBI32_CORE2_AXI_RESET
] = { 0x3d5c, 0 },
2929 [GMAC_CORE1_RESET
] = { 0x3cbc, 0 },
2930 [GMAC_CORE2_RESET
] = { 0x3cdc, 0 },
2931 [GMAC_CORE3_RESET
] = { 0x3cfc, 0 },
2932 [GMAC_CORE4_RESET
] = { 0x3d1c, 0 },
2933 [GMAC_AHB_RESET
] = { 0x3e24, 0 },
2934 [NSS_CH0_RST_RX_CLK_N_RESET
] = { 0x3b60, 0 },
2935 [NSS_CH0_RST_TX_CLK_N_RESET
] = { 0x3b60, 1 },
2936 [NSS_CH0_RST_RX_125M_N_RESET
] = { 0x3b60, 2 },
2937 [NSS_CH0_HW_RST_RX_125M_N_RESET
] = { 0x3b60, 3 },
2938 [NSS_CH0_RST_TX_125M_N_RESET
] = { 0x3b60, 4 },
2939 [NSS_CH1_RST_RX_CLK_N_RESET
] = { 0x3b60, 5 },
2940 [NSS_CH1_RST_TX_CLK_N_RESET
] = { 0x3b60, 6 },
2941 [NSS_CH1_RST_RX_125M_N_RESET
] = { 0x3b60, 7 },
2942 [NSS_CH1_HW_RST_RX_125M_N_RESET
] = { 0x3b60, 8 },
2943 [NSS_CH1_RST_TX_125M_N_RESET
] = { 0x3b60, 9 },
2944 [NSS_CH2_RST_RX_CLK_N_RESET
] = { 0x3b60, 10 },
2945 [NSS_CH2_RST_TX_CLK_N_RESET
] = { 0x3b60, 11 },
2946 [NSS_CH2_RST_RX_125M_N_RESET
] = { 0x3b60, 12 },
2947 [NSS_CH2_HW_RST_RX_125M_N_RESET
] = { 0x3b60, 13 },
2948 [NSS_CH2_RST_TX_125M_N_RESET
] = { 0x3b60, 14 },
2949 [NSS_CH3_RST_RX_CLK_N_RESET
] = { 0x3b60, 15 },
2950 [NSS_CH3_RST_TX_CLK_N_RESET
] = { 0x3b60, 16 },
2951 [NSS_CH3_RST_RX_125M_N_RESET
] = { 0x3b60, 17 },
2952 [NSS_CH3_HW_RST_RX_125M_N_RESET
] = { 0x3b60, 18 },
2953 [NSS_CH3_RST_TX_125M_N_RESET
] = { 0x3b60, 19 },
2954 [NSS_RST_RX_250M_125M_N_RESET
] = { 0x3b60, 20 },
2955 [NSS_RST_TX_250M_125M_N_RESET
] = { 0x3b60, 21 },
2956 [NSS_QSGMII_TXPI_RST_N_RESET
] = { 0x3b60, 22 },
2957 [NSS_QSGMII_CDR_RST_N_RESET
] = { 0x3b60, 23 },
2958 [NSS_SGMII2_CDR_RST_N_RESET
] = { 0x3b60, 24 },
2959 [NSS_SGMII3_CDR_RST_N_RESET
] = { 0x3b60, 25 },
2960 [NSS_CAL_PRBS_RST_N_RESET
] = { 0x3b60, 26 },
2961 [NSS_LCKDT_RST_N_RESET
] = { 0x3b60, 27 },
2962 [NSS_SRDS_N_RESET
] = { 0x3b60, 28 },
2965 static const struct regmap_config gcc_ipq806x_regmap_config
= {
2969 .max_register
= 0x3e40,
2973 static const struct qcom_cc_desc gcc_ipq806x_desc
= {
2974 .config
= &gcc_ipq806x_regmap_config
,
2975 .clks
= gcc_ipq806x_clks
,
2976 .num_clks
= ARRAY_SIZE(gcc_ipq806x_clks
),
2977 .resets
= gcc_ipq806x_resets
,
2978 .num_resets
= ARRAY_SIZE(gcc_ipq806x_resets
),
2981 static const struct of_device_id gcc_ipq806x_match_table
[] = {
2982 { .compatible
= "qcom,gcc-ipq8064" },
2985 MODULE_DEVICE_TABLE(of
, gcc_ipq806x_match_table
);
2987 static int gcc_ipq806x_probe(struct platform_device
*pdev
)
2989 struct device
*dev
= &pdev
->dev
;
2990 struct regmap
*regmap
;
2993 ret
= qcom_cc_register_board_clk(dev
, "cxo_board", "cxo", 25000000);
2997 ret
= qcom_cc_register_board_clk(dev
, "pxo_board", "pxo", 25000000);
3001 ret
= qcom_cc_probe(pdev
, &gcc_ipq806x_desc
);
3005 regmap
= dev_get_regmap(dev
, NULL
);
3009 /* Setup PLL18 static bits */
3010 regmap_update_bits(regmap
, 0x31a4, 0xffffffc0, 0x40000400);
3011 regmap_write(regmap
, 0x31b0, 0x3080);
3013 /* Set GMAC footswitch sleep/wakeup values */
3014 regmap_write(regmap
, 0x3cb8, 8);
3015 regmap_write(regmap
, 0x3cd8, 8);
3016 regmap_write(regmap
, 0x3cf8, 8);
3017 regmap_write(regmap
, 0x3d18, 8);
3022 static struct platform_driver gcc_ipq806x_driver
= {
3023 .probe
= gcc_ipq806x_probe
,
3025 .name
= "gcc-ipq806x",
3026 .of_match_table
= gcc_ipq806x_match_table
,
3030 static int __init
gcc_ipq806x_init(void)
3032 return platform_driver_register(&gcc_ipq806x_driver
);
3034 core_initcall(gcc_ipq806x_init
);
3036 static void __exit
gcc_ipq806x_exit(void)
3038 platform_driver_unregister(&gcc_ipq806x_driver
);
3040 module_exit(gcc_ipq806x_exit
);
3042 MODULE_DESCRIPTION("QCOM GCC IPQ806x Driver");
3043 MODULE_LICENSE("GPL v2");
3044 MODULE_ALIAS("platform:gcc-ipq806x");