2 * Copyright (c) 2013, 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-msm8960.h>
26 #include <dt-bindings/reset/qcom,gcc-msm8960.h>
28 #include "clk-regmap.h"
31 #include "clk-branch.h"
34 static struct clk_pll pll3
= {
42 .clkr
.hw
.init
= &(struct clk_init_data
){
44 .parent_names
= (const char *[]){ "pxo" },
50 static struct clk_pll pll8
= {
58 .clkr
.hw
.init
= &(struct clk_init_data
){
60 .parent_names
= (const char *[]){ "pxo" },
66 static struct clk_regmap pll8_vote
= {
68 .enable_mask
= BIT(8),
69 .hw
.init
= &(struct clk_init_data
){
71 .parent_names
= (const char *[]){ "pll8" },
73 .ops
= &clk_pll_vote_ops
,
77 static struct clk_pll pll14
= {
85 .clkr
.hw
.init
= &(struct clk_init_data
){
87 .parent_names
= (const char *[]){ "pxo" },
93 static struct clk_regmap pll14_vote
= {
95 .enable_mask
= BIT(14),
96 .hw
.init
= &(struct clk_init_data
){
98 .parent_names
= (const char *[]){ "pll14" },
100 .ops
= &clk_pll_vote_ops
,
108 static const u8 gcc_pxo_pll8_map
[] = {
113 static const char *gcc_pxo_pll8
[] = {
118 static const u8 gcc_pxo_pll8_cxo_map
[] = {
124 static const char *gcc_pxo_pll8_cxo
[] = {
130 static struct freq_tbl clk_tbl_gsbi_uart
[] = {
131 { 1843200, P_PLL8
, 2, 6, 625 },
132 { 3686400, P_PLL8
, 2, 12, 625 },
133 { 7372800, P_PLL8
, 2, 24, 625 },
134 { 14745600, P_PLL8
, 2, 48, 625 },
135 { 16000000, P_PLL8
, 4, 1, 6 },
136 { 24000000, P_PLL8
, 4, 1, 4 },
137 { 32000000, P_PLL8
, 4, 1, 3 },
138 { 40000000, P_PLL8
, 1, 5, 48 },
139 { 46400000, P_PLL8
, 1, 29, 240 },
140 { 48000000, P_PLL8
, 4, 1, 2 },
141 { 51200000, P_PLL8
, 1, 2, 15 },
142 { 56000000, P_PLL8
, 1, 7, 48 },
143 { 58982400, P_PLL8
, 1, 96, 625 },
144 { 64000000, P_PLL8
, 2, 1, 3 },
148 static struct clk_rcg gsbi1_uart_src
= {
153 .mnctr_reset_bit
= 7,
154 .mnctr_mode_shift
= 5,
165 .parent_map
= gcc_pxo_pll8_map
,
167 .freq_tbl
= clk_tbl_gsbi_uart
,
169 .enable_reg
= 0x29d4,
170 .enable_mask
= BIT(11),
171 .hw
.init
= &(struct clk_init_data
){
172 .name
= "gsbi1_uart_src",
173 .parent_names
= gcc_pxo_pll8
,
176 .flags
= CLK_SET_PARENT_GATE
,
181 static struct clk_branch gsbi1_uart_clk
= {
185 .enable_reg
= 0x29d4,
186 .enable_mask
= BIT(9),
187 .hw
.init
= &(struct clk_init_data
){
188 .name
= "gsbi1_uart_clk",
189 .parent_names
= (const char *[]){
193 .ops
= &clk_branch_ops
,
194 .flags
= CLK_SET_RATE_PARENT
,
199 static struct clk_rcg gsbi2_uart_src
= {
204 .mnctr_reset_bit
= 7,
205 .mnctr_mode_shift
= 5,
216 .parent_map
= gcc_pxo_pll8_map
,
218 .freq_tbl
= clk_tbl_gsbi_uart
,
220 .enable_reg
= 0x29f4,
221 .enable_mask
= BIT(11),
222 .hw
.init
= &(struct clk_init_data
){
223 .name
= "gsbi2_uart_src",
224 .parent_names
= gcc_pxo_pll8
,
227 .flags
= CLK_SET_PARENT_GATE
,
232 static struct clk_branch gsbi2_uart_clk
= {
236 .enable_reg
= 0x29f4,
237 .enable_mask
= BIT(9),
238 .hw
.init
= &(struct clk_init_data
){
239 .name
= "gsbi2_uart_clk",
240 .parent_names
= (const char *[]){
244 .ops
= &clk_branch_ops
,
245 .flags
= CLK_SET_RATE_PARENT
,
250 static struct clk_rcg gsbi3_uart_src
= {
255 .mnctr_reset_bit
= 7,
256 .mnctr_mode_shift
= 5,
267 .parent_map
= gcc_pxo_pll8_map
,
269 .freq_tbl
= clk_tbl_gsbi_uart
,
271 .enable_reg
= 0x2a14,
272 .enable_mask
= BIT(11),
273 .hw
.init
= &(struct clk_init_data
){
274 .name
= "gsbi3_uart_src",
275 .parent_names
= gcc_pxo_pll8
,
278 .flags
= CLK_SET_PARENT_GATE
,
283 static struct clk_branch gsbi3_uart_clk
= {
287 .enable_reg
= 0x2a14,
288 .enable_mask
= BIT(9),
289 .hw
.init
= &(struct clk_init_data
){
290 .name
= "gsbi3_uart_clk",
291 .parent_names
= (const char *[]){
295 .ops
= &clk_branch_ops
,
296 .flags
= CLK_SET_RATE_PARENT
,
301 static struct clk_rcg gsbi4_uart_src
= {
306 .mnctr_reset_bit
= 7,
307 .mnctr_mode_shift
= 5,
318 .parent_map
= gcc_pxo_pll8_map
,
320 .freq_tbl
= clk_tbl_gsbi_uart
,
322 .enable_reg
= 0x2a34,
323 .enable_mask
= BIT(11),
324 .hw
.init
= &(struct clk_init_data
){
325 .name
= "gsbi4_uart_src",
326 .parent_names
= gcc_pxo_pll8
,
329 .flags
= CLK_SET_PARENT_GATE
,
334 static struct clk_branch gsbi4_uart_clk
= {
338 .enable_reg
= 0x2a34,
339 .enable_mask
= BIT(9),
340 .hw
.init
= &(struct clk_init_data
){
341 .name
= "gsbi4_uart_clk",
342 .parent_names
= (const char *[]){
346 .ops
= &clk_branch_ops
,
347 .flags
= CLK_SET_RATE_PARENT
,
352 static struct clk_rcg gsbi5_uart_src
= {
357 .mnctr_reset_bit
= 7,
358 .mnctr_mode_shift
= 5,
369 .parent_map
= gcc_pxo_pll8_map
,
371 .freq_tbl
= clk_tbl_gsbi_uart
,
373 .enable_reg
= 0x2a54,
374 .enable_mask
= BIT(11),
375 .hw
.init
= &(struct clk_init_data
){
376 .name
= "gsbi5_uart_src",
377 .parent_names
= gcc_pxo_pll8
,
380 .flags
= CLK_SET_PARENT_GATE
,
385 static struct clk_branch gsbi5_uart_clk
= {
389 .enable_reg
= 0x2a54,
390 .enable_mask
= BIT(9),
391 .hw
.init
= &(struct clk_init_data
){
392 .name
= "gsbi5_uart_clk",
393 .parent_names
= (const char *[]){
397 .ops
= &clk_branch_ops
,
398 .flags
= CLK_SET_RATE_PARENT
,
403 static struct clk_rcg gsbi6_uart_src
= {
408 .mnctr_reset_bit
= 7,
409 .mnctr_mode_shift
= 5,
420 .parent_map
= gcc_pxo_pll8_map
,
422 .freq_tbl
= clk_tbl_gsbi_uart
,
424 .enable_reg
= 0x2a74,
425 .enable_mask
= BIT(11),
426 .hw
.init
= &(struct clk_init_data
){
427 .name
= "gsbi6_uart_src",
428 .parent_names
= gcc_pxo_pll8
,
431 .flags
= CLK_SET_PARENT_GATE
,
436 static struct clk_branch gsbi6_uart_clk
= {
440 .enable_reg
= 0x2a74,
441 .enable_mask
= BIT(9),
442 .hw
.init
= &(struct clk_init_data
){
443 .name
= "gsbi6_uart_clk",
444 .parent_names
= (const char *[]){
448 .ops
= &clk_branch_ops
,
449 .flags
= CLK_SET_RATE_PARENT
,
454 static struct clk_rcg gsbi7_uart_src
= {
459 .mnctr_reset_bit
= 7,
460 .mnctr_mode_shift
= 5,
471 .parent_map
= gcc_pxo_pll8_map
,
473 .freq_tbl
= clk_tbl_gsbi_uart
,
475 .enable_reg
= 0x2a94,
476 .enable_mask
= BIT(11),
477 .hw
.init
= &(struct clk_init_data
){
478 .name
= "gsbi7_uart_src",
479 .parent_names
= gcc_pxo_pll8
,
482 .flags
= CLK_SET_PARENT_GATE
,
487 static struct clk_branch gsbi7_uart_clk
= {
491 .enable_reg
= 0x2a94,
492 .enable_mask
= BIT(9),
493 .hw
.init
= &(struct clk_init_data
){
494 .name
= "gsbi7_uart_clk",
495 .parent_names
= (const char *[]){
499 .ops
= &clk_branch_ops
,
500 .flags
= CLK_SET_RATE_PARENT
,
505 static struct clk_rcg gsbi8_uart_src
= {
510 .mnctr_reset_bit
= 7,
511 .mnctr_mode_shift
= 5,
522 .parent_map
= gcc_pxo_pll8_map
,
524 .freq_tbl
= clk_tbl_gsbi_uart
,
526 .enable_reg
= 0x2ab4,
527 .enable_mask
= BIT(11),
528 .hw
.init
= &(struct clk_init_data
){
529 .name
= "gsbi8_uart_src",
530 .parent_names
= gcc_pxo_pll8
,
533 .flags
= CLK_SET_PARENT_GATE
,
538 static struct clk_branch gsbi8_uart_clk
= {
542 .enable_reg
= 0x2ab4,
543 .enable_mask
= BIT(9),
544 .hw
.init
= &(struct clk_init_data
){
545 .name
= "gsbi8_uart_clk",
546 .parent_names
= (const char *[]){ "gsbi8_uart_src" },
548 .ops
= &clk_branch_ops
,
549 .flags
= CLK_SET_RATE_PARENT
,
554 static struct clk_rcg gsbi9_uart_src
= {
559 .mnctr_reset_bit
= 7,
560 .mnctr_mode_shift
= 5,
571 .parent_map
= gcc_pxo_pll8_map
,
573 .freq_tbl
= clk_tbl_gsbi_uart
,
575 .enable_reg
= 0x2ad4,
576 .enable_mask
= BIT(11),
577 .hw
.init
= &(struct clk_init_data
){
578 .name
= "gsbi9_uart_src",
579 .parent_names
= gcc_pxo_pll8
,
582 .flags
= CLK_SET_PARENT_GATE
,
587 static struct clk_branch gsbi9_uart_clk
= {
591 .enable_reg
= 0x2ad4,
592 .enable_mask
= BIT(9),
593 .hw
.init
= &(struct clk_init_data
){
594 .name
= "gsbi9_uart_clk",
595 .parent_names
= (const char *[]){ "gsbi9_uart_src" },
597 .ops
= &clk_branch_ops
,
598 .flags
= CLK_SET_RATE_PARENT
,
603 static struct clk_rcg gsbi10_uart_src
= {
608 .mnctr_reset_bit
= 7,
609 .mnctr_mode_shift
= 5,
620 .parent_map
= gcc_pxo_pll8_map
,
622 .freq_tbl
= clk_tbl_gsbi_uart
,
624 .enable_reg
= 0x2af4,
625 .enable_mask
= BIT(11),
626 .hw
.init
= &(struct clk_init_data
){
627 .name
= "gsbi10_uart_src",
628 .parent_names
= gcc_pxo_pll8
,
631 .flags
= CLK_SET_PARENT_GATE
,
636 static struct clk_branch gsbi10_uart_clk
= {
640 .enable_reg
= 0x2af4,
641 .enable_mask
= BIT(9),
642 .hw
.init
= &(struct clk_init_data
){
643 .name
= "gsbi10_uart_clk",
644 .parent_names
= (const char *[]){ "gsbi10_uart_src" },
646 .ops
= &clk_branch_ops
,
647 .flags
= CLK_SET_RATE_PARENT
,
652 static struct clk_rcg gsbi11_uart_src
= {
657 .mnctr_reset_bit
= 7,
658 .mnctr_mode_shift
= 5,
669 .parent_map
= gcc_pxo_pll8_map
,
671 .freq_tbl
= clk_tbl_gsbi_uart
,
673 .enable_reg
= 0x2b14,
674 .enable_mask
= BIT(11),
675 .hw
.init
= &(struct clk_init_data
){
676 .name
= "gsbi11_uart_src",
677 .parent_names
= gcc_pxo_pll8
,
680 .flags
= CLK_SET_PARENT_GATE
,
685 static struct clk_branch gsbi11_uart_clk
= {
689 .enable_reg
= 0x2b14,
690 .enable_mask
= BIT(9),
691 .hw
.init
= &(struct clk_init_data
){
692 .name
= "gsbi11_uart_clk",
693 .parent_names
= (const char *[]){ "gsbi11_uart_src" },
695 .ops
= &clk_branch_ops
,
696 .flags
= CLK_SET_RATE_PARENT
,
701 static struct clk_rcg gsbi12_uart_src
= {
706 .mnctr_reset_bit
= 7,
707 .mnctr_mode_shift
= 5,
718 .parent_map
= gcc_pxo_pll8_map
,
720 .freq_tbl
= clk_tbl_gsbi_uart
,
722 .enable_reg
= 0x2b34,
723 .enable_mask
= BIT(11),
724 .hw
.init
= &(struct clk_init_data
){
725 .name
= "gsbi12_uart_src",
726 .parent_names
= gcc_pxo_pll8
,
729 .flags
= CLK_SET_PARENT_GATE
,
734 static struct clk_branch gsbi12_uart_clk
= {
738 .enable_reg
= 0x2b34,
739 .enable_mask
= BIT(9),
740 .hw
.init
= &(struct clk_init_data
){
741 .name
= "gsbi12_uart_clk",
742 .parent_names
= (const char *[]){ "gsbi12_uart_src" },
744 .ops
= &clk_branch_ops
,
745 .flags
= CLK_SET_RATE_PARENT
,
750 static struct freq_tbl clk_tbl_gsbi_qup
[] = {
751 { 1100000, P_PXO
, 1, 2, 49 },
752 { 5400000, P_PXO
, 1, 1, 5 },
753 { 10800000, P_PXO
, 1, 2, 5 },
754 { 15060000, P_PLL8
, 1, 2, 51 },
755 { 24000000, P_PLL8
, 4, 1, 4 },
756 { 25600000, P_PLL8
, 1, 1, 15 },
757 { 27000000, P_PXO
, 1, 0, 0 },
758 { 48000000, P_PLL8
, 4, 1, 2 },
759 { 51200000, P_PLL8
, 1, 2, 15 },
763 static struct clk_rcg gsbi1_qup_src
= {
768 .mnctr_reset_bit
= 7,
769 .mnctr_mode_shift
= 5,
780 .parent_map
= gcc_pxo_pll8_map
,
782 .freq_tbl
= clk_tbl_gsbi_qup
,
784 .enable_reg
= 0x29cc,
785 .enable_mask
= BIT(11),
786 .hw
.init
= &(struct clk_init_data
){
787 .name
= "gsbi1_qup_src",
788 .parent_names
= gcc_pxo_pll8
,
791 .flags
= CLK_SET_PARENT_GATE
,
796 static struct clk_branch gsbi1_qup_clk
= {
800 .enable_reg
= 0x29cc,
801 .enable_mask
= BIT(9),
802 .hw
.init
= &(struct clk_init_data
){
803 .name
= "gsbi1_qup_clk",
804 .parent_names
= (const char *[]){ "gsbi1_qup_src" },
806 .ops
= &clk_branch_ops
,
807 .flags
= CLK_SET_RATE_PARENT
,
812 static struct clk_rcg gsbi2_qup_src
= {
817 .mnctr_reset_bit
= 7,
818 .mnctr_mode_shift
= 5,
829 .parent_map
= gcc_pxo_pll8_map
,
831 .freq_tbl
= clk_tbl_gsbi_qup
,
833 .enable_reg
= 0x29ec,
834 .enable_mask
= BIT(11),
835 .hw
.init
= &(struct clk_init_data
){
836 .name
= "gsbi2_qup_src",
837 .parent_names
= gcc_pxo_pll8
,
840 .flags
= CLK_SET_PARENT_GATE
,
845 static struct clk_branch gsbi2_qup_clk
= {
849 .enable_reg
= 0x29ec,
850 .enable_mask
= BIT(9),
851 .hw
.init
= &(struct clk_init_data
){
852 .name
= "gsbi2_qup_clk",
853 .parent_names
= (const char *[]){ "gsbi2_qup_src" },
855 .ops
= &clk_branch_ops
,
856 .flags
= CLK_SET_RATE_PARENT
,
861 static struct clk_rcg gsbi3_qup_src
= {
866 .mnctr_reset_bit
= 7,
867 .mnctr_mode_shift
= 5,
878 .parent_map
= gcc_pxo_pll8_map
,
880 .freq_tbl
= clk_tbl_gsbi_qup
,
882 .enable_reg
= 0x2a0c,
883 .enable_mask
= BIT(11),
884 .hw
.init
= &(struct clk_init_data
){
885 .name
= "gsbi3_qup_src",
886 .parent_names
= gcc_pxo_pll8
,
889 .flags
= CLK_SET_PARENT_GATE
,
894 static struct clk_branch gsbi3_qup_clk
= {
898 .enable_reg
= 0x2a0c,
899 .enable_mask
= BIT(9),
900 .hw
.init
= &(struct clk_init_data
){
901 .name
= "gsbi3_qup_clk",
902 .parent_names
= (const char *[]){ "gsbi3_qup_src" },
904 .ops
= &clk_branch_ops
,
905 .flags
= CLK_SET_RATE_PARENT
,
910 static struct clk_rcg gsbi4_qup_src
= {
915 .mnctr_reset_bit
= 7,
916 .mnctr_mode_shift
= 5,
927 .parent_map
= gcc_pxo_pll8_map
,
929 .freq_tbl
= clk_tbl_gsbi_qup
,
931 .enable_reg
= 0x2a2c,
932 .enable_mask
= BIT(11),
933 .hw
.init
= &(struct clk_init_data
){
934 .name
= "gsbi4_qup_src",
935 .parent_names
= gcc_pxo_pll8
,
938 .flags
= CLK_SET_PARENT_GATE
,
943 static struct clk_branch gsbi4_qup_clk
= {
947 .enable_reg
= 0x2a2c,
948 .enable_mask
= BIT(9),
949 .hw
.init
= &(struct clk_init_data
){
950 .name
= "gsbi4_qup_clk",
951 .parent_names
= (const char *[]){ "gsbi4_qup_src" },
953 .ops
= &clk_branch_ops
,
954 .flags
= CLK_SET_RATE_PARENT
,
959 static struct clk_rcg gsbi5_qup_src
= {
964 .mnctr_reset_bit
= 7,
965 .mnctr_mode_shift
= 5,
976 .parent_map
= gcc_pxo_pll8_map
,
978 .freq_tbl
= clk_tbl_gsbi_qup
,
980 .enable_reg
= 0x2a4c,
981 .enable_mask
= BIT(11),
982 .hw
.init
= &(struct clk_init_data
){
983 .name
= "gsbi5_qup_src",
984 .parent_names
= gcc_pxo_pll8
,
987 .flags
= CLK_SET_PARENT_GATE
,
992 static struct clk_branch gsbi5_qup_clk
= {
996 .enable_reg
= 0x2a4c,
997 .enable_mask
= BIT(9),
998 .hw
.init
= &(struct clk_init_data
){
999 .name
= "gsbi5_qup_clk",
1000 .parent_names
= (const char *[]){ "gsbi5_qup_src" },
1002 .ops
= &clk_branch_ops
,
1003 .flags
= CLK_SET_RATE_PARENT
,
1008 static struct clk_rcg gsbi6_qup_src
= {
1013 .mnctr_reset_bit
= 7,
1014 .mnctr_mode_shift
= 5,
1025 .parent_map
= gcc_pxo_pll8_map
,
1027 .freq_tbl
= clk_tbl_gsbi_qup
,
1029 .enable_reg
= 0x2a6c,
1030 .enable_mask
= BIT(11),
1031 .hw
.init
= &(struct clk_init_data
){
1032 .name
= "gsbi6_qup_src",
1033 .parent_names
= gcc_pxo_pll8
,
1035 .ops
= &clk_rcg_ops
,
1036 .flags
= CLK_SET_PARENT_GATE
,
1041 static struct clk_branch gsbi6_qup_clk
= {
1045 .enable_reg
= 0x2a6c,
1046 .enable_mask
= BIT(9),
1047 .hw
.init
= &(struct clk_init_data
){
1048 .name
= "gsbi6_qup_clk",
1049 .parent_names
= (const char *[]){ "gsbi6_qup_src" },
1051 .ops
= &clk_branch_ops
,
1052 .flags
= CLK_SET_RATE_PARENT
,
1057 static struct clk_rcg gsbi7_qup_src
= {
1062 .mnctr_reset_bit
= 7,
1063 .mnctr_mode_shift
= 5,
1074 .parent_map
= gcc_pxo_pll8_map
,
1076 .freq_tbl
= clk_tbl_gsbi_qup
,
1078 .enable_reg
= 0x2a8c,
1079 .enable_mask
= BIT(11),
1080 .hw
.init
= &(struct clk_init_data
){
1081 .name
= "gsbi7_qup_src",
1082 .parent_names
= gcc_pxo_pll8
,
1084 .ops
= &clk_rcg_ops
,
1085 .flags
= CLK_SET_PARENT_GATE
,
1090 static struct clk_branch gsbi7_qup_clk
= {
1094 .enable_reg
= 0x2a8c,
1095 .enable_mask
= BIT(9),
1096 .hw
.init
= &(struct clk_init_data
){
1097 .name
= "gsbi7_qup_clk",
1098 .parent_names
= (const char *[]){ "gsbi7_qup_src" },
1100 .ops
= &clk_branch_ops
,
1101 .flags
= CLK_SET_RATE_PARENT
,
1106 static struct clk_rcg gsbi8_qup_src
= {
1111 .mnctr_reset_bit
= 7,
1112 .mnctr_mode_shift
= 5,
1123 .parent_map
= gcc_pxo_pll8_map
,
1125 .freq_tbl
= clk_tbl_gsbi_qup
,
1127 .enable_reg
= 0x2aac,
1128 .enable_mask
= BIT(11),
1129 .hw
.init
= &(struct clk_init_data
){
1130 .name
= "gsbi8_qup_src",
1131 .parent_names
= gcc_pxo_pll8
,
1133 .ops
= &clk_rcg_ops
,
1134 .flags
= CLK_SET_PARENT_GATE
,
1139 static struct clk_branch gsbi8_qup_clk
= {
1143 .enable_reg
= 0x2aac,
1144 .enable_mask
= BIT(9),
1145 .hw
.init
= &(struct clk_init_data
){
1146 .name
= "gsbi8_qup_clk",
1147 .parent_names
= (const char *[]){ "gsbi8_qup_src" },
1149 .ops
= &clk_branch_ops
,
1150 .flags
= CLK_SET_RATE_PARENT
,
1155 static struct clk_rcg gsbi9_qup_src
= {
1160 .mnctr_reset_bit
= 7,
1161 .mnctr_mode_shift
= 5,
1172 .parent_map
= gcc_pxo_pll8_map
,
1174 .freq_tbl
= clk_tbl_gsbi_qup
,
1176 .enable_reg
= 0x2acc,
1177 .enable_mask
= BIT(11),
1178 .hw
.init
= &(struct clk_init_data
){
1179 .name
= "gsbi9_qup_src",
1180 .parent_names
= gcc_pxo_pll8
,
1182 .ops
= &clk_rcg_ops
,
1183 .flags
= CLK_SET_PARENT_GATE
,
1188 static struct clk_branch gsbi9_qup_clk
= {
1192 .enable_reg
= 0x2acc,
1193 .enable_mask
= BIT(9),
1194 .hw
.init
= &(struct clk_init_data
){
1195 .name
= "gsbi9_qup_clk",
1196 .parent_names
= (const char *[]){ "gsbi9_qup_src" },
1198 .ops
= &clk_branch_ops
,
1199 .flags
= CLK_SET_RATE_PARENT
,
1204 static struct clk_rcg gsbi10_qup_src
= {
1209 .mnctr_reset_bit
= 7,
1210 .mnctr_mode_shift
= 5,
1221 .parent_map
= gcc_pxo_pll8_map
,
1223 .freq_tbl
= clk_tbl_gsbi_qup
,
1225 .enable_reg
= 0x2aec,
1226 .enable_mask
= BIT(11),
1227 .hw
.init
= &(struct clk_init_data
){
1228 .name
= "gsbi10_qup_src",
1229 .parent_names
= gcc_pxo_pll8
,
1231 .ops
= &clk_rcg_ops
,
1232 .flags
= CLK_SET_PARENT_GATE
,
1237 static struct clk_branch gsbi10_qup_clk
= {
1241 .enable_reg
= 0x2aec,
1242 .enable_mask
= BIT(9),
1243 .hw
.init
= &(struct clk_init_data
){
1244 .name
= "gsbi10_qup_clk",
1245 .parent_names
= (const char *[]){ "gsbi10_qup_src" },
1247 .ops
= &clk_branch_ops
,
1248 .flags
= CLK_SET_RATE_PARENT
,
1253 static struct clk_rcg gsbi11_qup_src
= {
1258 .mnctr_reset_bit
= 7,
1259 .mnctr_mode_shift
= 5,
1270 .parent_map
= gcc_pxo_pll8_map
,
1272 .freq_tbl
= clk_tbl_gsbi_qup
,
1274 .enable_reg
= 0x2b0c,
1275 .enable_mask
= BIT(11),
1276 .hw
.init
= &(struct clk_init_data
){
1277 .name
= "gsbi11_qup_src",
1278 .parent_names
= gcc_pxo_pll8
,
1280 .ops
= &clk_rcg_ops
,
1281 .flags
= CLK_SET_PARENT_GATE
,
1286 static struct clk_branch gsbi11_qup_clk
= {
1290 .enable_reg
= 0x2b0c,
1291 .enable_mask
= BIT(9),
1292 .hw
.init
= &(struct clk_init_data
){
1293 .name
= "gsbi11_qup_clk",
1294 .parent_names
= (const char *[]){ "gsbi11_qup_src" },
1296 .ops
= &clk_branch_ops
,
1297 .flags
= CLK_SET_RATE_PARENT
,
1302 static struct clk_rcg gsbi12_qup_src
= {
1307 .mnctr_reset_bit
= 7,
1308 .mnctr_mode_shift
= 5,
1319 .parent_map
= gcc_pxo_pll8_map
,
1321 .freq_tbl
= clk_tbl_gsbi_qup
,
1323 .enable_reg
= 0x2b2c,
1324 .enable_mask
= BIT(11),
1325 .hw
.init
= &(struct clk_init_data
){
1326 .name
= "gsbi12_qup_src",
1327 .parent_names
= gcc_pxo_pll8
,
1329 .ops
= &clk_rcg_ops
,
1330 .flags
= CLK_SET_PARENT_GATE
,
1335 static struct clk_branch gsbi12_qup_clk
= {
1339 .enable_reg
= 0x2b2c,
1340 .enable_mask
= BIT(9),
1341 .hw
.init
= &(struct clk_init_data
){
1342 .name
= "gsbi12_qup_clk",
1343 .parent_names
= (const char *[]){ "gsbi12_qup_src" },
1345 .ops
= &clk_branch_ops
,
1346 .flags
= CLK_SET_RATE_PARENT
,
1351 static const struct freq_tbl clk_tbl_gp
[] = {
1352 { 9600000, P_CXO
, 2, 0, 0 },
1353 { 13500000, P_PXO
, 2, 0, 0 },
1354 { 19200000, P_CXO
, 1, 0, 0 },
1355 { 27000000, P_PXO
, 1, 0, 0 },
1356 { 64000000, P_PLL8
, 2, 1, 3 },
1357 { 76800000, P_PLL8
, 1, 1, 5 },
1358 { 96000000, P_PLL8
, 4, 0, 0 },
1359 { 128000000, P_PLL8
, 3, 0, 0 },
1360 { 192000000, P_PLL8
, 2, 0, 0 },
1364 static struct clk_rcg gp0_src
= {
1369 .mnctr_reset_bit
= 7,
1370 .mnctr_mode_shift
= 5,
1381 .parent_map
= gcc_pxo_pll8_cxo_map
,
1383 .freq_tbl
= clk_tbl_gp
,
1385 .enable_reg
= 0x2d24,
1386 .enable_mask
= BIT(11),
1387 .hw
.init
= &(struct clk_init_data
){
1389 .parent_names
= gcc_pxo_pll8_cxo
,
1391 .ops
= &clk_rcg_ops
,
1392 .flags
= CLK_SET_PARENT_GATE
,
1397 static struct clk_branch gp0_clk
= {
1401 .enable_reg
= 0x2d24,
1402 .enable_mask
= BIT(9),
1403 .hw
.init
= &(struct clk_init_data
){
1405 .parent_names
= (const char *[]){ "gp0_src" },
1407 .ops
= &clk_branch_ops
,
1408 .flags
= CLK_SET_RATE_PARENT
,
1413 static struct clk_rcg gp1_src
= {
1418 .mnctr_reset_bit
= 7,
1419 .mnctr_mode_shift
= 5,
1430 .parent_map
= gcc_pxo_pll8_cxo_map
,
1432 .freq_tbl
= clk_tbl_gp
,
1434 .enable_reg
= 0x2d44,
1435 .enable_mask
= BIT(11),
1436 .hw
.init
= &(struct clk_init_data
){
1438 .parent_names
= gcc_pxo_pll8_cxo
,
1440 .ops
= &clk_rcg_ops
,
1441 .flags
= CLK_SET_RATE_GATE
,
1446 static struct clk_branch gp1_clk
= {
1450 .enable_reg
= 0x2d44,
1451 .enable_mask
= BIT(9),
1452 .hw
.init
= &(struct clk_init_data
){
1454 .parent_names
= (const char *[]){ "gp1_src" },
1456 .ops
= &clk_branch_ops
,
1457 .flags
= CLK_SET_RATE_PARENT
,
1462 static struct clk_rcg gp2_src
= {
1467 .mnctr_reset_bit
= 7,
1468 .mnctr_mode_shift
= 5,
1479 .parent_map
= gcc_pxo_pll8_cxo_map
,
1481 .freq_tbl
= clk_tbl_gp
,
1483 .enable_reg
= 0x2d64,
1484 .enable_mask
= BIT(11),
1485 .hw
.init
= &(struct clk_init_data
){
1487 .parent_names
= gcc_pxo_pll8_cxo
,
1489 .ops
= &clk_rcg_ops
,
1490 .flags
= CLK_SET_RATE_GATE
,
1495 static struct clk_branch gp2_clk
= {
1499 .enable_reg
= 0x2d64,
1500 .enable_mask
= BIT(9),
1501 .hw
.init
= &(struct clk_init_data
){
1503 .parent_names
= (const char *[]){ "gp2_src" },
1505 .ops
= &clk_branch_ops
,
1506 .flags
= CLK_SET_RATE_PARENT
,
1511 static struct clk_branch pmem_clk
= {
1517 .enable_reg
= 0x25a0,
1518 .enable_mask
= BIT(4),
1519 .hw
.init
= &(struct clk_init_data
){
1521 .ops
= &clk_branch_ops
,
1522 .flags
= CLK_IS_ROOT
,
1527 static struct clk_rcg prng_src
= {
1535 .parent_map
= gcc_pxo_pll8_map
,
1538 .hw
.init
= &(struct clk_init_data
){
1540 .parent_names
= gcc_pxo_pll8
,
1542 .ops
= &clk_rcg_ops
,
1547 static struct clk_branch prng_clk
= {
1549 .halt_check
= BRANCH_HALT_VOTED
,
1552 .enable_reg
= 0x3080,
1553 .enable_mask
= BIT(10),
1554 .hw
.init
= &(struct clk_init_data
){
1556 .parent_names
= (const char *[]){ "prng_src" },
1558 .ops
= &clk_branch_ops
,
1563 static const struct freq_tbl clk_tbl_sdc
[] = {
1564 { 144000, P_PXO
, 3, 2, 125 },
1565 { 400000, P_PLL8
, 4, 1, 240 },
1566 { 16000000, P_PLL8
, 4, 1, 6 },
1567 { 17070000, P_PLL8
, 1, 2, 45 },
1568 { 20210000, P_PLL8
, 1, 1, 19 },
1569 { 24000000, P_PLL8
, 4, 1, 4 },
1570 { 48000000, P_PLL8
, 4, 1, 2 },
1571 { 64000000, P_PLL8
, 3, 1, 2 },
1572 { 96000000, P_PLL8
, 4, 0, 0 },
1573 { 192000000, P_PLL8
, 2, 0, 0 },
1577 static struct clk_rcg sdc1_src
= {
1582 .mnctr_reset_bit
= 7,
1583 .mnctr_mode_shift
= 5,
1594 .parent_map
= gcc_pxo_pll8_map
,
1596 .freq_tbl
= clk_tbl_sdc
,
1598 .enable_reg
= 0x282c,
1599 .enable_mask
= BIT(11),
1600 .hw
.init
= &(struct clk_init_data
){
1602 .parent_names
= gcc_pxo_pll8
,
1604 .ops
= &clk_rcg_ops
,
1605 .flags
= CLK_SET_RATE_GATE
,
1610 static struct clk_branch sdc1_clk
= {
1614 .enable_reg
= 0x282c,
1615 .enable_mask
= BIT(9),
1616 .hw
.init
= &(struct clk_init_data
){
1618 .parent_names
= (const char *[]){ "sdc1_src" },
1620 .ops
= &clk_branch_ops
,
1621 .flags
= CLK_SET_RATE_PARENT
,
1626 static struct clk_rcg sdc2_src
= {
1631 .mnctr_reset_bit
= 7,
1632 .mnctr_mode_shift
= 5,
1643 .parent_map
= gcc_pxo_pll8_map
,
1645 .freq_tbl
= clk_tbl_sdc
,
1647 .enable_reg
= 0x284c,
1648 .enable_mask
= BIT(11),
1649 .hw
.init
= &(struct clk_init_data
){
1651 .parent_names
= gcc_pxo_pll8
,
1653 .ops
= &clk_rcg_ops
,
1654 .flags
= CLK_SET_RATE_GATE
,
1659 static struct clk_branch sdc2_clk
= {
1663 .enable_reg
= 0x284c,
1664 .enable_mask
= BIT(9),
1665 .hw
.init
= &(struct clk_init_data
){
1667 .parent_names
= (const char *[]){ "sdc2_src" },
1669 .ops
= &clk_branch_ops
,
1670 .flags
= CLK_SET_RATE_PARENT
,
1675 static struct clk_rcg sdc3_src
= {
1680 .mnctr_reset_bit
= 7,
1681 .mnctr_mode_shift
= 5,
1692 .parent_map
= gcc_pxo_pll8_map
,
1694 .freq_tbl
= clk_tbl_sdc
,
1696 .enable_reg
= 0x286c,
1697 .enable_mask
= BIT(11),
1698 .hw
.init
= &(struct clk_init_data
){
1700 .parent_names
= gcc_pxo_pll8
,
1702 .ops
= &clk_rcg_ops
,
1703 .flags
= CLK_SET_RATE_GATE
,
1708 static struct clk_branch sdc3_clk
= {
1712 .enable_reg
= 0x286c,
1713 .enable_mask
= BIT(9),
1714 .hw
.init
= &(struct clk_init_data
){
1716 .parent_names
= (const char *[]){ "sdc3_src" },
1718 .ops
= &clk_branch_ops
,
1719 .flags
= CLK_SET_RATE_PARENT
,
1724 static struct clk_rcg sdc4_src
= {
1729 .mnctr_reset_bit
= 7,
1730 .mnctr_mode_shift
= 5,
1741 .parent_map
= gcc_pxo_pll8_map
,
1743 .freq_tbl
= clk_tbl_sdc
,
1745 .enable_reg
= 0x288c,
1746 .enable_mask
= BIT(11),
1747 .hw
.init
= &(struct clk_init_data
){
1749 .parent_names
= gcc_pxo_pll8
,
1751 .ops
= &clk_rcg_ops
,
1752 .flags
= CLK_SET_RATE_GATE
,
1757 static struct clk_branch sdc4_clk
= {
1761 .enable_reg
= 0x288c,
1762 .enable_mask
= BIT(9),
1763 .hw
.init
= &(struct clk_init_data
){
1765 .parent_names
= (const char *[]){ "sdc4_src" },
1767 .ops
= &clk_branch_ops
,
1768 .flags
= CLK_SET_RATE_PARENT
,
1773 static struct clk_rcg sdc5_src
= {
1778 .mnctr_reset_bit
= 7,
1779 .mnctr_mode_shift
= 5,
1790 .parent_map
= gcc_pxo_pll8_map
,
1792 .freq_tbl
= clk_tbl_sdc
,
1794 .enable_reg
= 0x28ac,
1795 .enable_mask
= BIT(11),
1796 .hw
.init
= &(struct clk_init_data
){
1798 .parent_names
= gcc_pxo_pll8
,
1800 .ops
= &clk_rcg_ops
,
1801 .flags
= CLK_SET_RATE_GATE
,
1806 static struct clk_branch sdc5_clk
= {
1810 .enable_reg
= 0x28ac,
1811 .enable_mask
= BIT(9),
1812 .hw
.init
= &(struct clk_init_data
){
1814 .parent_names
= (const char *[]){ "sdc5_src" },
1816 .ops
= &clk_branch_ops
,
1817 .flags
= CLK_SET_RATE_PARENT
,
1822 static const struct freq_tbl clk_tbl_tsif_ref
[] = {
1823 { 105000, P_PXO
, 1, 1, 256 },
1827 static struct clk_rcg tsif_ref_src
= {
1832 .mnctr_reset_bit
= 7,
1833 .mnctr_mode_shift
= 5,
1844 .parent_map
= gcc_pxo_pll8_map
,
1846 .freq_tbl
= clk_tbl_tsif_ref
,
1848 .enable_reg
= 0x2710,
1849 .enable_mask
= BIT(11),
1850 .hw
.init
= &(struct clk_init_data
){
1851 .name
= "tsif_ref_src",
1852 .parent_names
= gcc_pxo_pll8
,
1854 .ops
= &clk_rcg_ops
,
1855 .flags
= CLK_SET_RATE_GATE
,
1860 static struct clk_branch tsif_ref_clk
= {
1864 .enable_reg
= 0x2710,
1865 .enable_mask
= BIT(9),
1866 .hw
.init
= &(struct clk_init_data
){
1867 .name
= "tsif_ref_clk",
1868 .parent_names
= (const char *[]){ "tsif_ref_src" },
1870 .ops
= &clk_branch_ops
,
1871 .flags
= CLK_SET_RATE_PARENT
,
1876 static const struct freq_tbl clk_tbl_usb
[] = {
1877 { 60000000, P_PLL8
, 1, 5, 32 },
1881 static struct clk_rcg usb_hs1_xcvr_src
= {
1886 .mnctr_reset_bit
= 7,
1887 .mnctr_mode_shift
= 5,
1898 .parent_map
= gcc_pxo_pll8_map
,
1900 .freq_tbl
= clk_tbl_usb
,
1902 .enable_reg
= 0x290c,
1903 .enable_mask
= BIT(11),
1904 .hw
.init
= &(struct clk_init_data
){
1905 .name
= "usb_hs1_xcvr_src",
1906 .parent_names
= gcc_pxo_pll8
,
1908 .ops
= &clk_rcg_ops
,
1909 .flags
= CLK_SET_RATE_GATE
,
1914 static struct clk_branch usb_hs1_xcvr_clk
= {
1918 .enable_reg
= 0x290c,
1919 .enable_mask
= BIT(9),
1920 .hw
.init
= &(struct clk_init_data
){
1921 .name
= "usb_hs1_xcvr_clk",
1922 .parent_names
= (const char *[]){ "usb_hs1_xcvr_src" },
1924 .ops
= &clk_branch_ops
,
1925 .flags
= CLK_SET_RATE_PARENT
,
1930 static struct clk_rcg usb_hsic_xcvr_fs_src
= {
1935 .mnctr_reset_bit
= 7,
1936 .mnctr_mode_shift
= 5,
1947 .parent_map
= gcc_pxo_pll8_map
,
1949 .freq_tbl
= clk_tbl_usb
,
1951 .enable_reg
= 0x2928,
1952 .enable_mask
= BIT(11),
1953 .hw
.init
= &(struct clk_init_data
){
1954 .name
= "usb_hsic_xcvr_fs_src",
1955 .parent_names
= gcc_pxo_pll8
,
1957 .ops
= &clk_rcg_ops
,
1958 .flags
= CLK_SET_RATE_GATE
,
1963 static const char *usb_hsic_xcvr_fs_src_p
[] = { "usb_hsic_xcvr_fs_src" };
1965 static struct clk_branch usb_hsic_xcvr_fs_clk
= {
1969 .enable_reg
= 0x2928,
1970 .enable_mask
= BIT(9),
1971 .hw
.init
= &(struct clk_init_data
){
1972 .name
= "usb_hsic_xcvr_fs_clk",
1973 .parent_names
= usb_hsic_xcvr_fs_src_p
,
1975 .ops
= &clk_branch_ops
,
1976 .flags
= CLK_SET_RATE_PARENT
,
1981 static struct clk_branch usb_hsic_system_clk
= {
1985 .enable_reg
= 0x292c,
1986 .enable_mask
= BIT(4),
1987 .hw
.init
= &(struct clk_init_data
){
1988 .parent_names
= usb_hsic_xcvr_fs_src_p
,
1990 .name
= "usb_hsic_system_clk",
1991 .ops
= &clk_branch_ops
,
1992 .flags
= CLK_SET_RATE_PARENT
,
1997 static struct clk_branch usb_hsic_hsic_clk
= {
2001 .enable_reg
= 0x2b44,
2002 .enable_mask
= BIT(0),
2003 .hw
.init
= &(struct clk_init_data
){
2004 .parent_names
= (const char *[]){ "pll14_vote" },
2006 .name
= "usb_hsic_hsic_clk",
2007 .ops
= &clk_branch_ops
,
2012 static struct clk_branch usb_hsic_hsio_cal_clk
= {
2016 .enable_reg
= 0x2b48,
2017 .enable_mask
= BIT(0),
2018 .hw
.init
= &(struct clk_init_data
){
2019 .name
= "usb_hsic_hsio_cal_clk",
2020 .ops
= &clk_branch_ops
,
2021 .flags
= CLK_IS_ROOT
,
2026 static struct clk_rcg usb_fs1_xcvr_fs_src
= {
2031 .mnctr_reset_bit
= 7,
2032 .mnctr_mode_shift
= 5,
2043 .parent_map
= gcc_pxo_pll8_map
,
2045 .freq_tbl
= clk_tbl_usb
,
2047 .enable_reg
= 0x2968,
2048 .enable_mask
= BIT(11),
2049 .hw
.init
= &(struct clk_init_data
){
2050 .name
= "usb_fs1_xcvr_fs_src",
2051 .parent_names
= gcc_pxo_pll8
,
2053 .ops
= &clk_rcg_ops
,
2054 .flags
= CLK_SET_RATE_GATE
,
2059 static const char *usb_fs1_xcvr_fs_src_p
[] = { "usb_fs1_xcvr_fs_src" };
2061 static struct clk_branch usb_fs1_xcvr_fs_clk
= {
2065 .enable_reg
= 0x2968,
2066 .enable_mask
= BIT(9),
2067 .hw
.init
= &(struct clk_init_data
){
2068 .name
= "usb_fs1_xcvr_fs_clk",
2069 .parent_names
= usb_fs1_xcvr_fs_src_p
,
2071 .ops
= &clk_branch_ops
,
2072 .flags
= CLK_SET_RATE_PARENT
,
2077 static struct clk_branch usb_fs1_system_clk
= {
2081 .enable_reg
= 0x296c,
2082 .enable_mask
= BIT(4),
2083 .hw
.init
= &(struct clk_init_data
){
2084 .parent_names
= usb_fs1_xcvr_fs_src_p
,
2086 .name
= "usb_fs1_system_clk",
2087 .ops
= &clk_branch_ops
,
2088 .flags
= CLK_SET_RATE_PARENT
,
2093 static struct clk_rcg usb_fs2_xcvr_fs_src
= {
2098 .mnctr_reset_bit
= 7,
2099 .mnctr_mode_shift
= 5,
2110 .parent_map
= gcc_pxo_pll8_map
,
2112 .freq_tbl
= clk_tbl_usb
,
2114 .enable_reg
= 0x2988,
2115 .enable_mask
= BIT(11),
2116 .hw
.init
= &(struct clk_init_data
){
2117 .name
= "usb_fs2_xcvr_fs_src",
2118 .parent_names
= gcc_pxo_pll8
,
2120 .ops
= &clk_rcg_ops
,
2121 .flags
= CLK_SET_RATE_GATE
,
2126 static const char *usb_fs2_xcvr_fs_src_p
[] = { "usb_fs2_xcvr_fs_src" };
2128 static struct clk_branch usb_fs2_xcvr_fs_clk
= {
2132 .enable_reg
= 0x2988,
2133 .enable_mask
= BIT(9),
2134 .hw
.init
= &(struct clk_init_data
){
2135 .name
= "usb_fs2_xcvr_fs_clk",
2136 .parent_names
= usb_fs2_xcvr_fs_src_p
,
2138 .ops
= &clk_branch_ops
,
2139 .flags
= CLK_SET_RATE_PARENT
,
2144 static struct clk_branch usb_fs2_system_clk
= {
2148 .enable_reg
= 0x298c,
2149 .enable_mask
= BIT(4),
2150 .hw
.init
= &(struct clk_init_data
){
2151 .name
= "usb_fs2_system_clk",
2152 .parent_names
= usb_fs2_xcvr_fs_src_p
,
2154 .ops
= &clk_branch_ops
,
2155 .flags
= CLK_SET_RATE_PARENT
,
2160 static struct clk_branch ce1_core_clk
= {
2166 .enable_reg
= 0x2724,
2167 .enable_mask
= BIT(4),
2168 .hw
.init
= &(struct clk_init_data
){
2169 .name
= "ce1_core_clk",
2170 .ops
= &clk_branch_ops
,
2171 .flags
= CLK_IS_ROOT
,
2176 static struct clk_branch ce1_h_clk
= {
2180 .enable_reg
= 0x2720,
2181 .enable_mask
= BIT(4),
2182 .hw
.init
= &(struct clk_init_data
){
2183 .name
= "ce1_h_clk",
2184 .ops
= &clk_branch_ops
,
2185 .flags
= CLK_IS_ROOT
,
2190 static struct clk_branch dma_bam_h_clk
= {
2196 .enable_reg
= 0x25c0,
2197 .enable_mask
= BIT(4),
2198 .hw
.init
= &(struct clk_init_data
){
2199 .name
= "dma_bam_h_clk",
2200 .ops
= &clk_branch_ops
,
2201 .flags
= CLK_IS_ROOT
,
2206 static struct clk_branch gsbi1_h_clk
= {
2212 .enable_reg
= 0x29c0,
2213 .enable_mask
= BIT(4),
2214 .hw
.init
= &(struct clk_init_data
){
2215 .name
= "gsbi1_h_clk",
2216 .ops
= &clk_branch_ops
,
2217 .flags
= CLK_IS_ROOT
,
2222 static struct clk_branch gsbi2_h_clk
= {
2228 .enable_reg
= 0x29e0,
2229 .enable_mask
= BIT(4),
2230 .hw
.init
= &(struct clk_init_data
){
2231 .name
= "gsbi2_h_clk",
2232 .ops
= &clk_branch_ops
,
2233 .flags
= CLK_IS_ROOT
,
2238 static struct clk_branch gsbi3_h_clk
= {
2244 .enable_reg
= 0x2a00,
2245 .enable_mask
= BIT(4),
2246 .hw
.init
= &(struct clk_init_data
){
2247 .name
= "gsbi3_h_clk",
2248 .ops
= &clk_branch_ops
,
2249 .flags
= CLK_IS_ROOT
,
2254 static struct clk_branch gsbi4_h_clk
= {
2260 .enable_reg
= 0x2a20,
2261 .enable_mask
= BIT(4),
2262 .hw
.init
= &(struct clk_init_data
){
2263 .name
= "gsbi4_h_clk",
2264 .ops
= &clk_branch_ops
,
2265 .flags
= CLK_IS_ROOT
,
2270 static struct clk_branch gsbi5_h_clk
= {
2276 .enable_reg
= 0x2a40,
2277 .enable_mask
= BIT(4),
2278 .hw
.init
= &(struct clk_init_data
){
2279 .name
= "gsbi5_h_clk",
2280 .ops
= &clk_branch_ops
,
2281 .flags
= CLK_IS_ROOT
,
2286 static struct clk_branch gsbi6_h_clk
= {
2292 .enable_reg
= 0x2a60,
2293 .enable_mask
= BIT(4),
2294 .hw
.init
= &(struct clk_init_data
){
2295 .name
= "gsbi6_h_clk",
2296 .ops
= &clk_branch_ops
,
2297 .flags
= CLK_IS_ROOT
,
2302 static struct clk_branch gsbi7_h_clk
= {
2308 .enable_reg
= 0x2a80,
2309 .enable_mask
= BIT(4),
2310 .hw
.init
= &(struct clk_init_data
){
2311 .name
= "gsbi7_h_clk",
2312 .ops
= &clk_branch_ops
,
2313 .flags
= CLK_IS_ROOT
,
2318 static struct clk_branch gsbi8_h_clk
= {
2324 .enable_reg
= 0x2aa0,
2325 .enable_mask
= BIT(4),
2326 .hw
.init
= &(struct clk_init_data
){
2327 .name
= "gsbi8_h_clk",
2328 .ops
= &clk_branch_ops
,
2329 .flags
= CLK_IS_ROOT
,
2334 static struct clk_branch gsbi9_h_clk
= {
2340 .enable_reg
= 0x2ac0,
2341 .enable_mask
= BIT(4),
2342 .hw
.init
= &(struct clk_init_data
){
2343 .name
= "gsbi9_h_clk",
2344 .ops
= &clk_branch_ops
,
2345 .flags
= CLK_IS_ROOT
,
2350 static struct clk_branch gsbi10_h_clk
= {
2356 .enable_reg
= 0x2ae0,
2357 .enable_mask
= BIT(4),
2358 .hw
.init
= &(struct clk_init_data
){
2359 .name
= "gsbi10_h_clk",
2360 .ops
= &clk_branch_ops
,
2361 .flags
= CLK_IS_ROOT
,
2366 static struct clk_branch gsbi11_h_clk
= {
2372 .enable_reg
= 0x2b00,
2373 .enable_mask
= BIT(4),
2374 .hw
.init
= &(struct clk_init_data
){
2375 .name
= "gsbi11_h_clk",
2376 .ops
= &clk_branch_ops
,
2377 .flags
= CLK_IS_ROOT
,
2382 static struct clk_branch gsbi12_h_clk
= {
2388 .enable_reg
= 0x2b20,
2389 .enable_mask
= BIT(4),
2390 .hw
.init
= &(struct clk_init_data
){
2391 .name
= "gsbi12_h_clk",
2392 .ops
= &clk_branch_ops
,
2393 .flags
= CLK_IS_ROOT
,
2398 static struct clk_branch tsif_h_clk
= {
2404 .enable_reg
= 0x2700,
2405 .enable_mask
= BIT(4),
2406 .hw
.init
= &(struct clk_init_data
){
2407 .name
= "tsif_h_clk",
2408 .ops
= &clk_branch_ops
,
2409 .flags
= CLK_IS_ROOT
,
2414 static struct clk_branch usb_fs1_h_clk
= {
2418 .enable_reg
= 0x2960,
2419 .enable_mask
= BIT(4),
2420 .hw
.init
= &(struct clk_init_data
){
2421 .name
= "usb_fs1_h_clk",
2422 .ops
= &clk_branch_ops
,
2423 .flags
= CLK_IS_ROOT
,
2428 static struct clk_branch usb_fs2_h_clk
= {
2432 .enable_reg
= 0x2980,
2433 .enable_mask
= BIT(4),
2434 .hw
.init
= &(struct clk_init_data
){
2435 .name
= "usb_fs2_h_clk",
2436 .ops
= &clk_branch_ops
,
2437 .flags
= CLK_IS_ROOT
,
2442 static struct clk_branch usb_hs1_h_clk
= {
2448 .enable_reg
= 0x2900,
2449 .enable_mask
= BIT(4),
2450 .hw
.init
= &(struct clk_init_data
){
2451 .name
= "usb_hs1_h_clk",
2452 .ops
= &clk_branch_ops
,
2453 .flags
= CLK_IS_ROOT
,
2458 static struct clk_branch usb_hsic_h_clk
= {
2462 .enable_reg
= 0x2920,
2463 .enable_mask
= BIT(4),
2464 .hw
.init
= &(struct clk_init_data
){
2465 .name
= "usb_hsic_h_clk",
2466 .ops
= &clk_branch_ops
,
2467 .flags
= CLK_IS_ROOT
,
2472 static struct clk_branch sdc1_h_clk
= {
2478 .enable_reg
= 0x2820,
2479 .enable_mask
= BIT(4),
2480 .hw
.init
= &(struct clk_init_data
){
2481 .name
= "sdc1_h_clk",
2482 .ops
= &clk_branch_ops
,
2483 .flags
= CLK_IS_ROOT
,
2488 static struct clk_branch sdc2_h_clk
= {
2494 .enable_reg
= 0x2840,
2495 .enable_mask
= BIT(4),
2496 .hw
.init
= &(struct clk_init_data
){
2497 .name
= "sdc2_h_clk",
2498 .ops
= &clk_branch_ops
,
2499 .flags
= CLK_IS_ROOT
,
2504 static struct clk_branch sdc3_h_clk
= {
2510 .enable_reg
= 0x2860,
2511 .enable_mask
= BIT(4),
2512 .hw
.init
= &(struct clk_init_data
){
2513 .name
= "sdc3_h_clk",
2514 .ops
= &clk_branch_ops
,
2515 .flags
= CLK_IS_ROOT
,
2520 static struct clk_branch sdc4_h_clk
= {
2526 .enable_reg
= 0x2880,
2527 .enable_mask
= BIT(4),
2528 .hw
.init
= &(struct clk_init_data
){
2529 .name
= "sdc4_h_clk",
2530 .ops
= &clk_branch_ops
,
2531 .flags
= CLK_IS_ROOT
,
2536 static struct clk_branch sdc5_h_clk
= {
2542 .enable_reg
= 0x28a0,
2543 .enable_mask
= BIT(4),
2544 .hw
.init
= &(struct clk_init_data
){
2545 .name
= "sdc5_h_clk",
2546 .ops
= &clk_branch_ops
,
2547 .flags
= CLK_IS_ROOT
,
2552 static struct clk_branch adm0_clk
= {
2554 .halt_check
= BRANCH_HALT_VOTED
,
2557 .enable_reg
= 0x3080,
2558 .enable_mask
= BIT(2),
2559 .hw
.init
= &(struct clk_init_data
){
2561 .ops
= &clk_branch_ops
,
2562 .flags
= CLK_IS_ROOT
,
2567 static struct clk_branch adm0_pbus_clk
= {
2571 .halt_check
= BRANCH_HALT_VOTED
,
2574 .enable_reg
= 0x3080,
2575 .enable_mask
= BIT(3),
2576 .hw
.init
= &(struct clk_init_data
){
2577 .name
= "adm0_pbus_clk",
2578 .ops
= &clk_branch_ops
,
2579 .flags
= CLK_IS_ROOT
,
2584 static struct clk_branch pmic_arb0_h_clk
= {
2586 .halt_check
= BRANCH_HALT_VOTED
,
2589 .enable_reg
= 0x3080,
2590 .enable_mask
= BIT(8),
2591 .hw
.init
= &(struct clk_init_data
){
2592 .name
= "pmic_arb0_h_clk",
2593 .ops
= &clk_branch_ops
,
2594 .flags
= CLK_IS_ROOT
,
2599 static struct clk_branch pmic_arb1_h_clk
= {
2601 .halt_check
= BRANCH_HALT_VOTED
,
2604 .enable_reg
= 0x3080,
2605 .enable_mask
= BIT(9),
2606 .hw
.init
= &(struct clk_init_data
){
2607 .name
= "pmic_arb1_h_clk",
2608 .ops
= &clk_branch_ops
,
2609 .flags
= CLK_IS_ROOT
,
2614 static struct clk_branch pmic_ssbi2_clk
= {
2616 .halt_check
= BRANCH_HALT_VOTED
,
2619 .enable_reg
= 0x3080,
2620 .enable_mask
= BIT(7),
2621 .hw
.init
= &(struct clk_init_data
){
2622 .name
= "pmic_ssbi2_clk",
2623 .ops
= &clk_branch_ops
,
2624 .flags
= CLK_IS_ROOT
,
2629 static struct clk_branch rpm_msg_ram_h_clk
= {
2633 .halt_check
= BRANCH_HALT_VOTED
,
2636 .enable_reg
= 0x3080,
2637 .enable_mask
= BIT(6),
2638 .hw
.init
= &(struct clk_init_data
){
2639 .name
= "rpm_msg_ram_h_clk",
2640 .ops
= &clk_branch_ops
,
2641 .flags
= CLK_IS_ROOT
,
2646 static struct clk_regmap
*gcc_msm8960_clks
[] = {
2647 [PLL3
] = &pll3
.clkr
,
2648 [PLL8
] = &pll8
.clkr
,
2649 [PLL8_VOTE
] = &pll8_vote
,
2650 [PLL14
] = &pll14
.clkr
,
2651 [PLL14_VOTE
] = &pll14_vote
,
2652 [GSBI1_UART_SRC
] = &gsbi1_uart_src
.clkr
,
2653 [GSBI1_UART_CLK
] = &gsbi1_uart_clk
.clkr
,
2654 [GSBI2_UART_SRC
] = &gsbi2_uart_src
.clkr
,
2655 [GSBI2_UART_CLK
] = &gsbi2_uart_clk
.clkr
,
2656 [GSBI3_UART_SRC
] = &gsbi3_uart_src
.clkr
,
2657 [GSBI3_UART_CLK
] = &gsbi3_uart_clk
.clkr
,
2658 [GSBI4_UART_SRC
] = &gsbi4_uart_src
.clkr
,
2659 [GSBI4_UART_CLK
] = &gsbi4_uart_clk
.clkr
,
2660 [GSBI5_UART_SRC
] = &gsbi5_uart_src
.clkr
,
2661 [GSBI5_UART_CLK
] = &gsbi5_uart_clk
.clkr
,
2662 [GSBI6_UART_SRC
] = &gsbi6_uart_src
.clkr
,
2663 [GSBI6_UART_CLK
] = &gsbi6_uart_clk
.clkr
,
2664 [GSBI7_UART_SRC
] = &gsbi7_uart_src
.clkr
,
2665 [GSBI7_UART_CLK
] = &gsbi7_uart_clk
.clkr
,
2666 [GSBI8_UART_SRC
] = &gsbi8_uart_src
.clkr
,
2667 [GSBI8_UART_CLK
] = &gsbi8_uart_clk
.clkr
,
2668 [GSBI9_UART_SRC
] = &gsbi9_uart_src
.clkr
,
2669 [GSBI9_UART_CLK
] = &gsbi9_uart_clk
.clkr
,
2670 [GSBI10_UART_SRC
] = &gsbi10_uart_src
.clkr
,
2671 [GSBI10_UART_CLK
] = &gsbi10_uart_clk
.clkr
,
2672 [GSBI11_UART_SRC
] = &gsbi11_uart_src
.clkr
,
2673 [GSBI11_UART_CLK
] = &gsbi11_uart_clk
.clkr
,
2674 [GSBI12_UART_SRC
] = &gsbi12_uart_src
.clkr
,
2675 [GSBI12_UART_CLK
] = &gsbi12_uart_clk
.clkr
,
2676 [GSBI1_QUP_SRC
] = &gsbi1_qup_src
.clkr
,
2677 [GSBI1_QUP_CLK
] = &gsbi1_qup_clk
.clkr
,
2678 [GSBI2_QUP_SRC
] = &gsbi2_qup_src
.clkr
,
2679 [GSBI2_QUP_CLK
] = &gsbi2_qup_clk
.clkr
,
2680 [GSBI3_QUP_SRC
] = &gsbi3_qup_src
.clkr
,
2681 [GSBI3_QUP_CLK
] = &gsbi3_qup_clk
.clkr
,
2682 [GSBI4_QUP_SRC
] = &gsbi4_qup_src
.clkr
,
2683 [GSBI4_QUP_CLK
] = &gsbi4_qup_clk
.clkr
,
2684 [GSBI5_QUP_SRC
] = &gsbi5_qup_src
.clkr
,
2685 [GSBI5_QUP_CLK
] = &gsbi5_qup_clk
.clkr
,
2686 [GSBI6_QUP_SRC
] = &gsbi6_qup_src
.clkr
,
2687 [GSBI6_QUP_CLK
] = &gsbi6_qup_clk
.clkr
,
2688 [GSBI7_QUP_SRC
] = &gsbi7_qup_src
.clkr
,
2689 [GSBI7_QUP_CLK
] = &gsbi7_qup_clk
.clkr
,
2690 [GSBI8_QUP_SRC
] = &gsbi8_qup_src
.clkr
,
2691 [GSBI8_QUP_CLK
] = &gsbi8_qup_clk
.clkr
,
2692 [GSBI9_QUP_SRC
] = &gsbi9_qup_src
.clkr
,
2693 [GSBI9_QUP_CLK
] = &gsbi9_qup_clk
.clkr
,
2694 [GSBI10_QUP_SRC
] = &gsbi10_qup_src
.clkr
,
2695 [GSBI10_QUP_CLK
] = &gsbi10_qup_clk
.clkr
,
2696 [GSBI11_QUP_SRC
] = &gsbi11_qup_src
.clkr
,
2697 [GSBI11_QUP_CLK
] = &gsbi11_qup_clk
.clkr
,
2698 [GSBI12_QUP_SRC
] = &gsbi12_qup_src
.clkr
,
2699 [GSBI12_QUP_CLK
] = &gsbi12_qup_clk
.clkr
,
2700 [GP0_SRC
] = &gp0_src
.clkr
,
2701 [GP0_CLK
] = &gp0_clk
.clkr
,
2702 [GP1_SRC
] = &gp1_src
.clkr
,
2703 [GP1_CLK
] = &gp1_clk
.clkr
,
2704 [GP2_SRC
] = &gp2_src
.clkr
,
2705 [GP2_CLK
] = &gp2_clk
.clkr
,
2706 [PMEM_A_CLK
] = &pmem_clk
.clkr
,
2707 [PRNG_SRC
] = &prng_src
.clkr
,
2708 [PRNG_CLK
] = &prng_clk
.clkr
,
2709 [SDC1_SRC
] = &sdc1_src
.clkr
,
2710 [SDC1_CLK
] = &sdc1_clk
.clkr
,
2711 [SDC2_SRC
] = &sdc2_src
.clkr
,
2712 [SDC2_CLK
] = &sdc2_clk
.clkr
,
2713 [SDC3_SRC
] = &sdc3_src
.clkr
,
2714 [SDC3_CLK
] = &sdc3_clk
.clkr
,
2715 [SDC4_SRC
] = &sdc4_src
.clkr
,
2716 [SDC4_CLK
] = &sdc4_clk
.clkr
,
2717 [SDC5_SRC
] = &sdc5_src
.clkr
,
2718 [SDC5_CLK
] = &sdc5_clk
.clkr
,
2719 [TSIF_REF_SRC
] = &tsif_ref_src
.clkr
,
2720 [TSIF_REF_CLK
] = &tsif_ref_clk
.clkr
,
2721 [USB_HS1_XCVR_SRC
] = &usb_hs1_xcvr_src
.clkr
,
2722 [USB_HS1_XCVR_CLK
] = &usb_hs1_xcvr_clk
.clkr
,
2723 [USB_HSIC_XCVR_FS_SRC
] = &usb_hsic_xcvr_fs_src
.clkr
,
2724 [USB_HSIC_XCVR_FS_CLK
] = &usb_hsic_xcvr_fs_clk
.clkr
,
2725 [USB_HSIC_SYSTEM_CLK
] = &usb_hsic_system_clk
.clkr
,
2726 [USB_HSIC_HSIC_CLK
] = &usb_hsic_hsic_clk
.clkr
,
2727 [USB_HSIC_HSIO_CAL_CLK
] = &usb_hsic_hsio_cal_clk
.clkr
,
2728 [USB_FS1_XCVR_FS_SRC
] = &usb_fs1_xcvr_fs_src
.clkr
,
2729 [USB_FS1_XCVR_FS_CLK
] = &usb_fs1_xcvr_fs_clk
.clkr
,
2730 [USB_FS1_SYSTEM_CLK
] = &usb_fs1_system_clk
.clkr
,
2731 [USB_FS2_XCVR_FS_SRC
] = &usb_fs2_xcvr_fs_src
.clkr
,
2732 [USB_FS2_XCVR_FS_CLK
] = &usb_fs2_xcvr_fs_clk
.clkr
,
2733 [USB_FS2_SYSTEM_CLK
] = &usb_fs2_system_clk
.clkr
,
2734 [CE1_CORE_CLK
] = &ce1_core_clk
.clkr
,
2735 [CE1_H_CLK
] = &ce1_h_clk
.clkr
,
2736 [DMA_BAM_H_CLK
] = &dma_bam_h_clk
.clkr
,
2737 [GSBI1_H_CLK
] = &gsbi1_h_clk
.clkr
,
2738 [GSBI2_H_CLK
] = &gsbi2_h_clk
.clkr
,
2739 [GSBI3_H_CLK
] = &gsbi3_h_clk
.clkr
,
2740 [GSBI4_H_CLK
] = &gsbi4_h_clk
.clkr
,
2741 [GSBI5_H_CLK
] = &gsbi5_h_clk
.clkr
,
2742 [GSBI6_H_CLK
] = &gsbi6_h_clk
.clkr
,
2743 [GSBI7_H_CLK
] = &gsbi7_h_clk
.clkr
,
2744 [GSBI8_H_CLK
] = &gsbi8_h_clk
.clkr
,
2745 [GSBI9_H_CLK
] = &gsbi9_h_clk
.clkr
,
2746 [GSBI10_H_CLK
] = &gsbi10_h_clk
.clkr
,
2747 [GSBI11_H_CLK
] = &gsbi11_h_clk
.clkr
,
2748 [GSBI12_H_CLK
] = &gsbi12_h_clk
.clkr
,
2749 [TSIF_H_CLK
] = &tsif_h_clk
.clkr
,
2750 [USB_FS1_H_CLK
] = &usb_fs1_h_clk
.clkr
,
2751 [USB_FS2_H_CLK
] = &usb_fs2_h_clk
.clkr
,
2752 [USB_HS1_H_CLK
] = &usb_hs1_h_clk
.clkr
,
2753 [USB_HSIC_H_CLK
] = &usb_hsic_h_clk
.clkr
,
2754 [SDC1_H_CLK
] = &sdc1_h_clk
.clkr
,
2755 [SDC2_H_CLK
] = &sdc2_h_clk
.clkr
,
2756 [SDC3_H_CLK
] = &sdc3_h_clk
.clkr
,
2757 [SDC4_H_CLK
] = &sdc4_h_clk
.clkr
,
2758 [SDC5_H_CLK
] = &sdc5_h_clk
.clkr
,
2759 [ADM0_CLK
] = &adm0_clk
.clkr
,
2760 [ADM0_PBUS_CLK
] = &adm0_pbus_clk
.clkr
,
2761 [PMIC_ARB0_H_CLK
] = &pmic_arb0_h_clk
.clkr
,
2762 [PMIC_ARB1_H_CLK
] = &pmic_arb1_h_clk
.clkr
,
2763 [PMIC_SSBI2_CLK
] = &pmic_ssbi2_clk
.clkr
,
2764 [RPM_MSG_RAM_H_CLK
] = &rpm_msg_ram_h_clk
.clkr
,
2767 static const struct qcom_reset_map gcc_msm8960_resets
[] = {
2768 [SFAB_MSS_Q6_SW_RESET
] = { 0x2040, 7 },
2769 [SFAB_MSS_Q6_FW_RESET
] = { 0x2044, 7 },
2770 [QDSS_STM_RESET
] = { 0x2060, 6 },
2771 [AFAB_SMPSS_S_RESET
] = { 0x20b8, 2 },
2772 [AFAB_SMPSS_M1_RESET
] = { 0x20b8, 1 },
2773 [AFAB_SMPSS_M0_RESET
] = { 0x20b8 },
2774 [AFAB_EBI1_CH0_RESET
] = { 0x20c0, 7 },
2775 [AFAB_EBI1_CH1_RESET
] = { 0x20c4, 7},
2776 [SFAB_ADM0_M0_RESET
] = { 0x21e0, 7 },
2777 [SFAB_ADM0_M1_RESET
] = { 0x21e4, 7 },
2778 [SFAB_ADM0_M2_RESET
] = { 0x21e8, 7 },
2779 [ADM0_C2_RESET
] = { 0x220c, 4},
2780 [ADM0_C1_RESET
] = { 0x220c, 3},
2781 [ADM0_C0_RESET
] = { 0x220c, 2},
2782 [ADM0_PBUS_RESET
] = { 0x220c, 1 },
2783 [ADM0_RESET
] = { 0x220c },
2784 [QDSS_CLKS_SW_RESET
] = { 0x2260, 5 },
2785 [QDSS_POR_RESET
] = { 0x2260, 4 },
2786 [QDSS_TSCTR_RESET
] = { 0x2260, 3 },
2787 [QDSS_HRESET_RESET
] = { 0x2260, 2 },
2788 [QDSS_AXI_RESET
] = { 0x2260, 1 },
2789 [QDSS_DBG_RESET
] = { 0x2260 },
2790 [PCIE_A_RESET
] = { 0x22c0, 7 },
2791 [PCIE_AUX_RESET
] = { 0x22c8, 7 },
2792 [PCIE_H_RESET
] = { 0x22d0, 7 },
2793 [SFAB_PCIE_M_RESET
] = { 0x22d4, 1 },
2794 [SFAB_PCIE_S_RESET
] = { 0x22d4 },
2795 [SFAB_MSS_M_RESET
] = { 0x2340, 7 },
2796 [SFAB_USB3_M_RESET
] = { 0x2360, 7 },
2797 [SFAB_RIVA_M_RESET
] = { 0x2380, 7 },
2798 [SFAB_LPASS_RESET
] = { 0x23a0, 7 },
2799 [SFAB_AFAB_M_RESET
] = { 0x23e0, 7 },
2800 [AFAB_SFAB_M0_RESET
] = { 0x2420, 7 },
2801 [AFAB_SFAB_M1_RESET
] = { 0x2424, 7 },
2802 [SFAB_SATA_S_RESET
] = { 0x2480, 7 },
2803 [SFAB_DFAB_M_RESET
] = { 0x2500, 7 },
2804 [DFAB_SFAB_M_RESET
] = { 0x2520, 7 },
2805 [DFAB_SWAY0_RESET
] = { 0x2540, 7 },
2806 [DFAB_SWAY1_RESET
] = { 0x2544, 7 },
2807 [DFAB_ARB0_RESET
] = { 0x2560, 7 },
2808 [DFAB_ARB1_RESET
] = { 0x2564, 7 },
2809 [PPSS_PROC_RESET
] = { 0x2594, 1 },
2810 [PPSS_RESET
] = { 0x2594},
2811 [DMA_BAM_RESET
] = { 0x25c0, 7 },
2812 [SIC_TIC_RESET
] = { 0x2600, 7 },
2813 [SLIMBUS_H_RESET
] = { 0x2620, 7 },
2814 [SFAB_CFPB_M_RESET
] = { 0x2680, 7 },
2815 [SFAB_CFPB_S_RESET
] = { 0x26c0, 7 },
2816 [TSIF_H_RESET
] = { 0x2700, 7 },
2817 [CE1_H_RESET
] = { 0x2720, 7 },
2818 [CE1_CORE_RESET
] = { 0x2724, 7 },
2819 [CE1_SLEEP_RESET
] = { 0x2728, 7 },
2820 [CE2_H_RESET
] = { 0x2740, 7 },
2821 [CE2_CORE_RESET
] = { 0x2744, 7 },
2822 [SFAB_SFPB_M_RESET
] = { 0x2780, 7 },
2823 [SFAB_SFPB_S_RESET
] = { 0x27a0, 7 },
2824 [RPM_PROC_RESET
] = { 0x27c0, 7 },
2825 [PMIC_SSBI2_RESET
] = { 0x270c, 12 },
2826 [SDC1_RESET
] = { 0x2830 },
2827 [SDC2_RESET
] = { 0x2850 },
2828 [SDC3_RESET
] = { 0x2870 },
2829 [SDC4_RESET
] = { 0x2890 },
2830 [SDC5_RESET
] = { 0x28b0 },
2831 [DFAB_A2_RESET
] = { 0x28c0, 7 },
2832 [USB_HS1_RESET
] = { 0x2910 },
2833 [USB_HSIC_RESET
] = { 0x2934 },
2834 [USB_FS1_XCVR_RESET
] = { 0x2974, 1 },
2835 [USB_FS1_RESET
] = { 0x2974 },
2836 [USB_FS2_XCVR_RESET
] = { 0x2994, 1 },
2837 [USB_FS2_RESET
] = { 0x2994 },
2838 [GSBI1_RESET
] = { 0x29dc },
2839 [GSBI2_RESET
] = { 0x29fc },
2840 [GSBI3_RESET
] = { 0x2a1c },
2841 [GSBI4_RESET
] = { 0x2a3c },
2842 [GSBI5_RESET
] = { 0x2a5c },
2843 [GSBI6_RESET
] = { 0x2a7c },
2844 [GSBI7_RESET
] = { 0x2a9c },
2845 [GSBI8_RESET
] = { 0x2abc },
2846 [GSBI9_RESET
] = { 0x2adc },
2847 [GSBI10_RESET
] = { 0x2afc },
2848 [GSBI11_RESET
] = { 0x2b1c },
2849 [GSBI12_RESET
] = { 0x2b3c },
2850 [SPDM_RESET
] = { 0x2b6c },
2851 [TLMM_H_RESET
] = { 0x2ba0, 7 },
2852 [SFAB_MSS_S_RESET
] = { 0x2c00, 7 },
2853 [MSS_SLP_RESET
] = { 0x2c60, 7 },
2854 [MSS_Q6SW_JTAG_RESET
] = { 0x2c68, 7 },
2855 [MSS_Q6FW_JTAG_RESET
] = { 0x2c6c, 7 },
2856 [MSS_RESET
] = { 0x2c64 },
2857 [SATA_H_RESET
] = { 0x2c80, 7 },
2858 [SATA_RXOOB_RESE
] = { 0x2c8c, 7 },
2859 [SATA_PMALIVE_RESET
] = { 0x2c90, 7 },
2860 [SATA_SFAB_M_RESET
] = { 0x2c98, 7 },
2861 [TSSC_RESET
] = { 0x2ca0, 7 },
2862 [PDM_RESET
] = { 0x2cc0, 12 },
2863 [MPM_H_RESET
] = { 0x2da0, 7 },
2864 [MPM_RESET
] = { 0x2da4 },
2865 [SFAB_SMPSS_S_RESET
] = { 0x2e00, 7 },
2866 [PRNG_RESET
] = { 0x2e80, 12 },
2867 [RIVA_RESET
] = { 0x35e0 },
2870 static const struct regmap_config gcc_msm8960_regmap_config
= {
2874 .max_register
= 0x3660,
2878 static const struct of_device_id gcc_msm8960_match_table
[] = {
2879 { .compatible
= "qcom,gcc-msm8960" },
2882 MODULE_DEVICE_TABLE(of
, gcc_msm8960_match_table
);
2885 struct qcom_reset_controller reset
;
2886 struct clk_onecell_data data
;
2890 static int gcc_msm8960_probe(struct platform_device
*pdev
)
2893 struct resource
*res
;
2895 struct device
*dev
= &pdev
->dev
;
2897 struct clk_onecell_data
*data
;
2899 struct regmap
*regmap
;
2901 struct qcom_reset_controller
*reset
;
2904 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
2905 base
= devm_ioremap_resource(dev
, res
);
2907 return PTR_ERR(base
);
2909 regmap
= devm_regmap_init_mmio(dev
, base
, &gcc_msm8960_regmap_config
);
2911 return PTR_ERR(regmap
);
2913 num_clks
= ARRAY_SIZE(gcc_msm8960_clks
);
2914 cc
= devm_kzalloc(dev
, sizeof(*cc
) + sizeof(*clks
) * num_clks
,
2922 data
->clk_num
= num_clks
;
2924 /* Temporary until RPM clocks supported */
2925 clk
= clk_register_fixed_rate(dev
, "cxo", NULL
, CLK_IS_ROOT
, 19200000);
2927 return PTR_ERR(clk
);
2929 clk
= clk_register_fixed_rate(dev
, "pxo", NULL
, CLK_IS_ROOT
, 27000000);
2931 return PTR_ERR(clk
);
2933 for (i
= 0; i
< num_clks
; i
++) {
2934 if (!gcc_msm8960_clks
[i
])
2936 clk
= devm_clk_register_regmap(dev
, gcc_msm8960_clks
[i
]);
2938 return PTR_ERR(clk
);
2942 ret
= of_clk_add_provider(dev
->of_node
, of_clk_src_onecell_get
, data
);
2947 reset
->rcdev
.of_node
= dev
->of_node
;
2948 reset
->rcdev
.ops
= &qcom_reset_ops
,
2949 reset
->rcdev
.owner
= THIS_MODULE
,
2950 reset
->rcdev
.nr_resets
= ARRAY_SIZE(gcc_msm8960_resets
),
2951 reset
->regmap
= regmap
;
2952 reset
->reset_map
= gcc_msm8960_resets
,
2953 platform_set_drvdata(pdev
, &reset
->rcdev
);
2955 ret
= reset_controller_register(&reset
->rcdev
);
2957 of_clk_del_provider(dev
->of_node
);
2962 static int gcc_msm8960_remove(struct platform_device
*pdev
)
2964 of_clk_del_provider(pdev
->dev
.of_node
);
2965 reset_controller_unregister(platform_get_drvdata(pdev
));
2969 static struct platform_driver gcc_msm8960_driver
= {
2970 .probe
= gcc_msm8960_probe
,
2971 .remove
= gcc_msm8960_remove
,
2973 .name
= "gcc-msm8960",
2974 .owner
= THIS_MODULE
,
2975 .of_match_table
= gcc_msm8960_match_table
,
2979 static int __init
gcc_msm8960_init(void)
2981 return platform_driver_register(&gcc_msm8960_driver
);
2983 core_initcall(gcc_msm8960_init
);
2985 static void __exit
gcc_msm8960_exit(void)
2987 platform_driver_unregister(&gcc_msm8960_driver
);
2989 module_exit(gcc_msm8960_exit
);
2991 MODULE_DESCRIPTION("QCOM GCC MSM8960 Driver");
2992 MODULE_LICENSE("GPL v2");
2993 MODULE_ALIAS("platform:gcc-msm8960");