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-msm8660.h>
26 #include <dt-bindings/reset/qcom,gcc-msm8660.h>
28 #include "clk-regmap.h"
31 #include "clk-branch.h"
34 static struct clk_pll pll8
= {
42 .clkr
.hw
.init
= &(struct clk_init_data
){
44 .parent_names
= (const char *[]){ "pxo" },
50 static struct clk_regmap pll8_vote
= {
52 .enable_mask
= BIT(8),
53 .hw
.init
= &(struct clk_init_data
){
55 .parent_names
= (const char *[]){ "pll8" },
57 .ops
= &clk_pll_vote_ops
,
65 static const u8 gcc_pxo_pll8_map
[] = {
70 static const char *gcc_pxo_pll8
[] = {
75 static const u8 gcc_pxo_pll8_cxo_map
[] = {
81 static const char *gcc_pxo_pll8_cxo
[] = {
87 static struct freq_tbl clk_tbl_gsbi_uart
[] = {
88 { 1843200, P_PLL8
, 2, 6, 625 },
89 { 3686400, P_PLL8
, 2, 12, 625 },
90 { 7372800, P_PLL8
, 2, 24, 625 },
91 { 14745600, P_PLL8
, 2, 48, 625 },
92 { 16000000, P_PLL8
, 4, 1, 6 },
93 { 24000000, P_PLL8
, 4, 1, 4 },
94 { 32000000, P_PLL8
, 4, 1, 3 },
95 { 40000000, P_PLL8
, 1, 5, 48 },
96 { 46400000, P_PLL8
, 1, 29, 240 },
97 { 48000000, P_PLL8
, 4, 1, 2 },
98 { 51200000, P_PLL8
, 1, 2, 15 },
99 { 56000000, P_PLL8
, 1, 7, 48 },
100 { 58982400, P_PLL8
, 1, 96, 625 },
101 { 64000000, P_PLL8
, 2, 1, 3 },
105 static struct clk_rcg gsbi1_uart_src
= {
110 .mnctr_reset_bit
= 7,
111 .mnctr_mode_shift
= 5,
122 .parent_map
= gcc_pxo_pll8_map
,
124 .freq_tbl
= clk_tbl_gsbi_uart
,
126 .enable_reg
= 0x29d4,
127 .enable_mask
= BIT(11),
128 .hw
.init
= &(struct clk_init_data
){
129 .name
= "gsbi1_uart_src",
130 .parent_names
= gcc_pxo_pll8
,
133 .flags
= CLK_SET_PARENT_GATE
,
138 static struct clk_branch gsbi1_uart_clk
= {
142 .enable_reg
= 0x29d4,
143 .enable_mask
= BIT(9),
144 .hw
.init
= &(struct clk_init_data
){
145 .name
= "gsbi1_uart_clk",
146 .parent_names
= (const char *[]){
150 .ops
= &clk_branch_ops
,
151 .flags
= CLK_SET_RATE_PARENT
,
156 static struct clk_rcg gsbi2_uart_src
= {
161 .mnctr_reset_bit
= 7,
162 .mnctr_mode_shift
= 5,
173 .parent_map
= gcc_pxo_pll8_map
,
175 .freq_tbl
= clk_tbl_gsbi_uart
,
177 .enable_reg
= 0x29f4,
178 .enable_mask
= BIT(11),
179 .hw
.init
= &(struct clk_init_data
){
180 .name
= "gsbi2_uart_src",
181 .parent_names
= gcc_pxo_pll8
,
184 .flags
= CLK_SET_PARENT_GATE
,
189 static struct clk_branch gsbi2_uart_clk
= {
193 .enable_reg
= 0x29f4,
194 .enable_mask
= BIT(9),
195 .hw
.init
= &(struct clk_init_data
){
196 .name
= "gsbi2_uart_clk",
197 .parent_names
= (const char *[]){
201 .ops
= &clk_branch_ops
,
202 .flags
= CLK_SET_RATE_PARENT
,
207 static struct clk_rcg gsbi3_uart_src
= {
212 .mnctr_reset_bit
= 7,
213 .mnctr_mode_shift
= 5,
224 .parent_map
= gcc_pxo_pll8_map
,
226 .freq_tbl
= clk_tbl_gsbi_uart
,
228 .enable_reg
= 0x2a14,
229 .enable_mask
= BIT(11),
230 .hw
.init
= &(struct clk_init_data
){
231 .name
= "gsbi3_uart_src",
232 .parent_names
= gcc_pxo_pll8
,
235 .flags
= CLK_SET_PARENT_GATE
,
240 static struct clk_branch gsbi3_uart_clk
= {
244 .enable_reg
= 0x2a14,
245 .enable_mask
= BIT(9),
246 .hw
.init
= &(struct clk_init_data
){
247 .name
= "gsbi3_uart_clk",
248 .parent_names
= (const char *[]){
252 .ops
= &clk_branch_ops
,
253 .flags
= CLK_SET_RATE_PARENT
,
258 static struct clk_rcg gsbi4_uart_src
= {
263 .mnctr_reset_bit
= 7,
264 .mnctr_mode_shift
= 5,
275 .parent_map
= gcc_pxo_pll8_map
,
277 .freq_tbl
= clk_tbl_gsbi_uart
,
279 .enable_reg
= 0x2a34,
280 .enable_mask
= BIT(11),
281 .hw
.init
= &(struct clk_init_data
){
282 .name
= "gsbi4_uart_src",
283 .parent_names
= gcc_pxo_pll8
,
286 .flags
= CLK_SET_PARENT_GATE
,
291 static struct clk_branch gsbi4_uart_clk
= {
295 .enable_reg
= 0x2a34,
296 .enable_mask
= BIT(9),
297 .hw
.init
= &(struct clk_init_data
){
298 .name
= "gsbi4_uart_clk",
299 .parent_names
= (const char *[]){
303 .ops
= &clk_branch_ops
,
304 .flags
= CLK_SET_RATE_PARENT
,
309 static struct clk_rcg gsbi5_uart_src
= {
314 .mnctr_reset_bit
= 7,
315 .mnctr_mode_shift
= 5,
326 .parent_map
= gcc_pxo_pll8_map
,
328 .freq_tbl
= clk_tbl_gsbi_uart
,
330 .enable_reg
= 0x2a54,
331 .enable_mask
= BIT(11),
332 .hw
.init
= &(struct clk_init_data
){
333 .name
= "gsbi5_uart_src",
334 .parent_names
= gcc_pxo_pll8
,
337 .flags
= CLK_SET_PARENT_GATE
,
342 static struct clk_branch gsbi5_uart_clk
= {
346 .enable_reg
= 0x2a54,
347 .enable_mask
= BIT(9),
348 .hw
.init
= &(struct clk_init_data
){
349 .name
= "gsbi5_uart_clk",
350 .parent_names
= (const char *[]){
354 .ops
= &clk_branch_ops
,
355 .flags
= CLK_SET_RATE_PARENT
,
360 static struct clk_rcg gsbi6_uart_src
= {
365 .mnctr_reset_bit
= 7,
366 .mnctr_mode_shift
= 5,
377 .parent_map
= gcc_pxo_pll8_map
,
379 .freq_tbl
= clk_tbl_gsbi_uart
,
381 .enable_reg
= 0x2a74,
382 .enable_mask
= BIT(11),
383 .hw
.init
= &(struct clk_init_data
){
384 .name
= "gsbi6_uart_src",
385 .parent_names
= gcc_pxo_pll8
,
388 .flags
= CLK_SET_PARENT_GATE
,
393 static struct clk_branch gsbi6_uart_clk
= {
397 .enable_reg
= 0x2a74,
398 .enable_mask
= BIT(9),
399 .hw
.init
= &(struct clk_init_data
){
400 .name
= "gsbi6_uart_clk",
401 .parent_names
= (const char *[]){
405 .ops
= &clk_branch_ops
,
406 .flags
= CLK_SET_RATE_PARENT
,
411 static struct clk_rcg gsbi7_uart_src
= {
416 .mnctr_reset_bit
= 7,
417 .mnctr_mode_shift
= 5,
428 .parent_map
= gcc_pxo_pll8_map
,
430 .freq_tbl
= clk_tbl_gsbi_uart
,
432 .enable_reg
= 0x2a94,
433 .enable_mask
= BIT(11),
434 .hw
.init
= &(struct clk_init_data
){
435 .name
= "gsbi7_uart_src",
436 .parent_names
= gcc_pxo_pll8
,
439 .flags
= CLK_SET_PARENT_GATE
,
444 static struct clk_branch gsbi7_uart_clk
= {
448 .enable_reg
= 0x2a94,
449 .enable_mask
= BIT(9),
450 .hw
.init
= &(struct clk_init_data
){
451 .name
= "gsbi7_uart_clk",
452 .parent_names
= (const char *[]){
456 .ops
= &clk_branch_ops
,
457 .flags
= CLK_SET_RATE_PARENT
,
462 static struct clk_rcg gsbi8_uart_src
= {
467 .mnctr_reset_bit
= 7,
468 .mnctr_mode_shift
= 5,
479 .parent_map
= gcc_pxo_pll8_map
,
481 .freq_tbl
= clk_tbl_gsbi_uart
,
483 .enable_reg
= 0x2ab4,
484 .enable_mask
= BIT(11),
485 .hw
.init
= &(struct clk_init_data
){
486 .name
= "gsbi8_uart_src",
487 .parent_names
= gcc_pxo_pll8
,
490 .flags
= CLK_SET_PARENT_GATE
,
495 static struct clk_branch gsbi8_uart_clk
= {
499 .enable_reg
= 0x2ab4,
500 .enable_mask
= BIT(9),
501 .hw
.init
= &(struct clk_init_data
){
502 .name
= "gsbi8_uart_clk",
503 .parent_names
= (const char *[]){ "gsbi8_uart_src" },
505 .ops
= &clk_branch_ops
,
506 .flags
= CLK_SET_RATE_PARENT
,
511 static struct clk_rcg gsbi9_uart_src
= {
516 .mnctr_reset_bit
= 7,
517 .mnctr_mode_shift
= 5,
528 .parent_map
= gcc_pxo_pll8_map
,
530 .freq_tbl
= clk_tbl_gsbi_uart
,
532 .enable_reg
= 0x2ad4,
533 .enable_mask
= BIT(11),
534 .hw
.init
= &(struct clk_init_data
){
535 .name
= "gsbi9_uart_src",
536 .parent_names
= gcc_pxo_pll8
,
539 .flags
= CLK_SET_PARENT_GATE
,
544 static struct clk_branch gsbi9_uart_clk
= {
548 .enable_reg
= 0x2ad4,
549 .enable_mask
= BIT(9),
550 .hw
.init
= &(struct clk_init_data
){
551 .name
= "gsbi9_uart_clk",
552 .parent_names
= (const char *[]){ "gsbi9_uart_src" },
554 .ops
= &clk_branch_ops
,
555 .flags
= CLK_SET_RATE_PARENT
,
560 static struct clk_rcg gsbi10_uart_src
= {
565 .mnctr_reset_bit
= 7,
566 .mnctr_mode_shift
= 5,
577 .parent_map
= gcc_pxo_pll8_map
,
579 .freq_tbl
= clk_tbl_gsbi_uart
,
581 .enable_reg
= 0x2af4,
582 .enable_mask
= BIT(11),
583 .hw
.init
= &(struct clk_init_data
){
584 .name
= "gsbi10_uart_src",
585 .parent_names
= gcc_pxo_pll8
,
588 .flags
= CLK_SET_PARENT_GATE
,
593 static struct clk_branch gsbi10_uart_clk
= {
597 .enable_reg
= 0x2af4,
598 .enable_mask
= BIT(9),
599 .hw
.init
= &(struct clk_init_data
){
600 .name
= "gsbi10_uart_clk",
601 .parent_names
= (const char *[]){ "gsbi10_uart_src" },
603 .ops
= &clk_branch_ops
,
604 .flags
= CLK_SET_RATE_PARENT
,
609 static struct clk_rcg gsbi11_uart_src
= {
614 .mnctr_reset_bit
= 7,
615 .mnctr_mode_shift
= 5,
626 .parent_map
= gcc_pxo_pll8_map
,
628 .freq_tbl
= clk_tbl_gsbi_uart
,
630 .enable_reg
= 0x2b14,
631 .enable_mask
= BIT(11),
632 .hw
.init
= &(struct clk_init_data
){
633 .name
= "gsbi11_uart_src",
634 .parent_names
= gcc_pxo_pll8
,
637 .flags
= CLK_SET_PARENT_GATE
,
642 static struct clk_branch gsbi11_uart_clk
= {
646 .enable_reg
= 0x2b14,
647 .enable_mask
= BIT(9),
648 .hw
.init
= &(struct clk_init_data
){
649 .name
= "gsbi11_uart_clk",
650 .parent_names
= (const char *[]){ "gsbi11_uart_src" },
652 .ops
= &clk_branch_ops
,
653 .flags
= CLK_SET_RATE_PARENT
,
658 static struct clk_rcg gsbi12_uart_src
= {
663 .mnctr_reset_bit
= 7,
664 .mnctr_mode_shift
= 5,
675 .parent_map
= gcc_pxo_pll8_map
,
677 .freq_tbl
= clk_tbl_gsbi_uart
,
679 .enable_reg
= 0x2b34,
680 .enable_mask
= BIT(11),
681 .hw
.init
= &(struct clk_init_data
){
682 .name
= "gsbi12_uart_src",
683 .parent_names
= gcc_pxo_pll8
,
686 .flags
= CLK_SET_PARENT_GATE
,
691 static struct clk_branch gsbi12_uart_clk
= {
695 .enable_reg
= 0x2b34,
696 .enable_mask
= BIT(9),
697 .hw
.init
= &(struct clk_init_data
){
698 .name
= "gsbi12_uart_clk",
699 .parent_names
= (const char *[]){ "gsbi12_uart_src" },
701 .ops
= &clk_branch_ops
,
702 .flags
= CLK_SET_RATE_PARENT
,
707 static struct freq_tbl clk_tbl_gsbi_qup
[] = {
708 { 1100000, P_PXO
, 1, 2, 49 },
709 { 5400000, P_PXO
, 1, 1, 5 },
710 { 10800000, P_PXO
, 1, 2, 5 },
711 { 15060000, P_PLL8
, 1, 2, 51 },
712 { 24000000, P_PLL8
, 4, 1, 4 },
713 { 25600000, P_PLL8
, 1, 1, 15 },
714 { 27000000, P_PXO
, 1, 0, 0 },
715 { 48000000, P_PLL8
, 4, 1, 2 },
716 { 51200000, P_PLL8
, 1, 2, 15 },
720 static struct clk_rcg gsbi1_qup_src
= {
725 .mnctr_reset_bit
= 7,
726 .mnctr_mode_shift
= 5,
737 .parent_map
= gcc_pxo_pll8_map
,
739 .freq_tbl
= clk_tbl_gsbi_qup
,
741 .enable_reg
= 0x29cc,
742 .enable_mask
= BIT(11),
743 .hw
.init
= &(struct clk_init_data
){
744 .name
= "gsbi1_qup_src",
745 .parent_names
= gcc_pxo_pll8
,
748 .flags
= CLK_SET_PARENT_GATE
,
753 static struct clk_branch gsbi1_qup_clk
= {
757 .enable_reg
= 0x29cc,
758 .enable_mask
= BIT(9),
759 .hw
.init
= &(struct clk_init_data
){
760 .name
= "gsbi1_qup_clk",
761 .parent_names
= (const char *[]){ "gsbi1_qup_src" },
763 .ops
= &clk_branch_ops
,
764 .flags
= CLK_SET_RATE_PARENT
,
769 static struct clk_rcg gsbi2_qup_src
= {
774 .mnctr_reset_bit
= 7,
775 .mnctr_mode_shift
= 5,
786 .parent_map
= gcc_pxo_pll8_map
,
788 .freq_tbl
= clk_tbl_gsbi_qup
,
790 .enable_reg
= 0x29ec,
791 .enable_mask
= BIT(11),
792 .hw
.init
= &(struct clk_init_data
){
793 .name
= "gsbi2_qup_src",
794 .parent_names
= gcc_pxo_pll8
,
797 .flags
= CLK_SET_PARENT_GATE
,
802 static struct clk_branch gsbi2_qup_clk
= {
806 .enable_reg
= 0x29ec,
807 .enable_mask
= BIT(9),
808 .hw
.init
= &(struct clk_init_data
){
809 .name
= "gsbi2_qup_clk",
810 .parent_names
= (const char *[]){ "gsbi2_qup_src" },
812 .ops
= &clk_branch_ops
,
813 .flags
= CLK_SET_RATE_PARENT
,
818 static struct clk_rcg gsbi3_qup_src
= {
823 .mnctr_reset_bit
= 7,
824 .mnctr_mode_shift
= 5,
835 .parent_map
= gcc_pxo_pll8_map
,
837 .freq_tbl
= clk_tbl_gsbi_qup
,
839 .enable_reg
= 0x2a0c,
840 .enable_mask
= BIT(11),
841 .hw
.init
= &(struct clk_init_data
){
842 .name
= "gsbi3_qup_src",
843 .parent_names
= gcc_pxo_pll8
,
846 .flags
= CLK_SET_PARENT_GATE
,
851 static struct clk_branch gsbi3_qup_clk
= {
855 .enable_reg
= 0x2a0c,
856 .enable_mask
= BIT(9),
857 .hw
.init
= &(struct clk_init_data
){
858 .name
= "gsbi3_qup_clk",
859 .parent_names
= (const char *[]){ "gsbi3_qup_src" },
861 .ops
= &clk_branch_ops
,
862 .flags
= CLK_SET_RATE_PARENT
,
867 static struct clk_rcg gsbi4_qup_src
= {
872 .mnctr_reset_bit
= 7,
873 .mnctr_mode_shift
= 5,
884 .parent_map
= gcc_pxo_pll8_map
,
886 .freq_tbl
= clk_tbl_gsbi_qup
,
888 .enable_reg
= 0x2a2c,
889 .enable_mask
= BIT(11),
890 .hw
.init
= &(struct clk_init_data
){
891 .name
= "gsbi4_qup_src",
892 .parent_names
= gcc_pxo_pll8
,
895 .flags
= CLK_SET_PARENT_GATE
,
900 static struct clk_branch gsbi4_qup_clk
= {
904 .enable_reg
= 0x2a2c,
905 .enable_mask
= BIT(9),
906 .hw
.init
= &(struct clk_init_data
){
907 .name
= "gsbi4_qup_clk",
908 .parent_names
= (const char *[]){ "gsbi4_qup_src" },
910 .ops
= &clk_branch_ops
,
911 .flags
= CLK_SET_RATE_PARENT
,
916 static struct clk_rcg gsbi5_qup_src
= {
921 .mnctr_reset_bit
= 7,
922 .mnctr_mode_shift
= 5,
933 .parent_map
= gcc_pxo_pll8_map
,
935 .freq_tbl
= clk_tbl_gsbi_qup
,
937 .enable_reg
= 0x2a4c,
938 .enable_mask
= BIT(11),
939 .hw
.init
= &(struct clk_init_data
){
940 .name
= "gsbi5_qup_src",
941 .parent_names
= gcc_pxo_pll8
,
944 .flags
= CLK_SET_PARENT_GATE
,
949 static struct clk_branch gsbi5_qup_clk
= {
953 .enable_reg
= 0x2a4c,
954 .enable_mask
= BIT(9),
955 .hw
.init
= &(struct clk_init_data
){
956 .name
= "gsbi5_qup_clk",
957 .parent_names
= (const char *[]){ "gsbi5_qup_src" },
959 .ops
= &clk_branch_ops
,
960 .flags
= CLK_SET_RATE_PARENT
,
965 static struct clk_rcg gsbi6_qup_src
= {
970 .mnctr_reset_bit
= 7,
971 .mnctr_mode_shift
= 5,
982 .parent_map
= gcc_pxo_pll8_map
,
984 .freq_tbl
= clk_tbl_gsbi_qup
,
986 .enable_reg
= 0x2a6c,
987 .enable_mask
= BIT(11),
988 .hw
.init
= &(struct clk_init_data
){
989 .name
= "gsbi6_qup_src",
990 .parent_names
= gcc_pxo_pll8
,
993 .flags
= CLK_SET_PARENT_GATE
,
998 static struct clk_branch gsbi6_qup_clk
= {
1002 .enable_reg
= 0x2a6c,
1003 .enable_mask
= BIT(9),
1004 .hw
.init
= &(struct clk_init_data
){
1005 .name
= "gsbi6_qup_clk",
1006 .parent_names
= (const char *[]){ "gsbi6_qup_src" },
1008 .ops
= &clk_branch_ops
,
1009 .flags
= CLK_SET_RATE_PARENT
,
1014 static struct clk_rcg gsbi7_qup_src
= {
1019 .mnctr_reset_bit
= 7,
1020 .mnctr_mode_shift
= 5,
1031 .parent_map
= gcc_pxo_pll8_map
,
1033 .freq_tbl
= clk_tbl_gsbi_qup
,
1035 .enable_reg
= 0x2a8c,
1036 .enable_mask
= BIT(11),
1037 .hw
.init
= &(struct clk_init_data
){
1038 .name
= "gsbi7_qup_src",
1039 .parent_names
= gcc_pxo_pll8
,
1041 .ops
= &clk_rcg_ops
,
1042 .flags
= CLK_SET_PARENT_GATE
,
1047 static struct clk_branch gsbi7_qup_clk
= {
1051 .enable_reg
= 0x2a8c,
1052 .enable_mask
= BIT(9),
1053 .hw
.init
= &(struct clk_init_data
){
1054 .name
= "gsbi7_qup_clk",
1055 .parent_names
= (const char *[]){ "gsbi7_qup_src" },
1057 .ops
= &clk_branch_ops
,
1058 .flags
= CLK_SET_RATE_PARENT
,
1063 static struct clk_rcg gsbi8_qup_src
= {
1068 .mnctr_reset_bit
= 7,
1069 .mnctr_mode_shift
= 5,
1080 .parent_map
= gcc_pxo_pll8_map
,
1082 .freq_tbl
= clk_tbl_gsbi_qup
,
1084 .enable_reg
= 0x2aac,
1085 .enable_mask
= BIT(11),
1086 .hw
.init
= &(struct clk_init_data
){
1087 .name
= "gsbi8_qup_src",
1088 .parent_names
= gcc_pxo_pll8
,
1090 .ops
= &clk_rcg_ops
,
1091 .flags
= CLK_SET_PARENT_GATE
,
1096 static struct clk_branch gsbi8_qup_clk
= {
1100 .enable_reg
= 0x2aac,
1101 .enable_mask
= BIT(9),
1102 .hw
.init
= &(struct clk_init_data
){
1103 .name
= "gsbi8_qup_clk",
1104 .parent_names
= (const char *[]){ "gsbi8_qup_src" },
1106 .ops
= &clk_branch_ops
,
1107 .flags
= CLK_SET_RATE_PARENT
,
1112 static struct clk_rcg gsbi9_qup_src
= {
1117 .mnctr_reset_bit
= 7,
1118 .mnctr_mode_shift
= 5,
1129 .parent_map
= gcc_pxo_pll8_map
,
1131 .freq_tbl
= clk_tbl_gsbi_qup
,
1133 .enable_reg
= 0x2acc,
1134 .enable_mask
= BIT(11),
1135 .hw
.init
= &(struct clk_init_data
){
1136 .name
= "gsbi9_qup_src",
1137 .parent_names
= gcc_pxo_pll8
,
1139 .ops
= &clk_rcg_ops
,
1140 .flags
= CLK_SET_PARENT_GATE
,
1145 static struct clk_branch gsbi9_qup_clk
= {
1149 .enable_reg
= 0x2acc,
1150 .enable_mask
= BIT(9),
1151 .hw
.init
= &(struct clk_init_data
){
1152 .name
= "gsbi9_qup_clk",
1153 .parent_names
= (const char *[]){ "gsbi9_qup_src" },
1155 .ops
= &clk_branch_ops
,
1156 .flags
= CLK_SET_RATE_PARENT
,
1161 static struct clk_rcg gsbi10_qup_src
= {
1166 .mnctr_reset_bit
= 7,
1167 .mnctr_mode_shift
= 5,
1178 .parent_map
= gcc_pxo_pll8_map
,
1180 .freq_tbl
= clk_tbl_gsbi_qup
,
1182 .enable_reg
= 0x2aec,
1183 .enable_mask
= BIT(11),
1184 .hw
.init
= &(struct clk_init_data
){
1185 .name
= "gsbi10_qup_src",
1186 .parent_names
= gcc_pxo_pll8
,
1188 .ops
= &clk_rcg_ops
,
1189 .flags
= CLK_SET_PARENT_GATE
,
1194 static struct clk_branch gsbi10_qup_clk
= {
1198 .enable_reg
= 0x2aec,
1199 .enable_mask
= BIT(9),
1200 .hw
.init
= &(struct clk_init_data
){
1201 .name
= "gsbi10_qup_clk",
1202 .parent_names
= (const char *[]){ "gsbi10_qup_src" },
1204 .ops
= &clk_branch_ops
,
1205 .flags
= CLK_SET_RATE_PARENT
,
1210 static struct clk_rcg gsbi11_qup_src
= {
1215 .mnctr_reset_bit
= 7,
1216 .mnctr_mode_shift
= 5,
1227 .parent_map
= gcc_pxo_pll8_map
,
1229 .freq_tbl
= clk_tbl_gsbi_qup
,
1231 .enable_reg
= 0x2b0c,
1232 .enable_mask
= BIT(11),
1233 .hw
.init
= &(struct clk_init_data
){
1234 .name
= "gsbi11_qup_src",
1235 .parent_names
= gcc_pxo_pll8
,
1237 .ops
= &clk_rcg_ops
,
1238 .flags
= CLK_SET_PARENT_GATE
,
1243 static struct clk_branch gsbi11_qup_clk
= {
1247 .enable_reg
= 0x2b0c,
1248 .enable_mask
= BIT(9),
1249 .hw
.init
= &(struct clk_init_data
){
1250 .name
= "gsbi11_qup_clk",
1251 .parent_names
= (const char *[]){ "gsbi11_qup_src" },
1253 .ops
= &clk_branch_ops
,
1254 .flags
= CLK_SET_RATE_PARENT
,
1259 static struct clk_rcg gsbi12_qup_src
= {
1264 .mnctr_reset_bit
= 7,
1265 .mnctr_mode_shift
= 5,
1276 .parent_map
= gcc_pxo_pll8_map
,
1278 .freq_tbl
= clk_tbl_gsbi_qup
,
1280 .enable_reg
= 0x2b2c,
1281 .enable_mask
= BIT(11),
1282 .hw
.init
= &(struct clk_init_data
){
1283 .name
= "gsbi12_qup_src",
1284 .parent_names
= gcc_pxo_pll8
,
1286 .ops
= &clk_rcg_ops
,
1287 .flags
= CLK_SET_PARENT_GATE
,
1292 static struct clk_branch gsbi12_qup_clk
= {
1296 .enable_reg
= 0x2b2c,
1297 .enable_mask
= BIT(9),
1298 .hw
.init
= &(struct clk_init_data
){
1299 .name
= "gsbi12_qup_clk",
1300 .parent_names
= (const char *[]){ "gsbi12_qup_src" },
1302 .ops
= &clk_branch_ops
,
1303 .flags
= CLK_SET_RATE_PARENT
,
1308 static const struct freq_tbl clk_tbl_gp
[] = {
1309 { 9600000, P_CXO
, 2, 0, 0 },
1310 { 13500000, P_PXO
, 2, 0, 0 },
1311 { 19200000, P_CXO
, 1, 0, 0 },
1312 { 27000000, P_PXO
, 1, 0, 0 },
1313 { 64000000, P_PLL8
, 2, 1, 3 },
1314 { 76800000, P_PLL8
, 1, 1, 5 },
1315 { 96000000, P_PLL8
, 4, 0, 0 },
1316 { 128000000, P_PLL8
, 3, 0, 0 },
1317 { 192000000, P_PLL8
, 2, 0, 0 },
1321 static struct clk_rcg gp0_src
= {
1326 .mnctr_reset_bit
= 7,
1327 .mnctr_mode_shift
= 5,
1338 .parent_map
= gcc_pxo_pll8_cxo_map
,
1340 .freq_tbl
= clk_tbl_gp
,
1342 .enable_reg
= 0x2d24,
1343 .enable_mask
= BIT(11),
1344 .hw
.init
= &(struct clk_init_data
){
1346 .parent_names
= gcc_pxo_pll8_cxo
,
1348 .ops
= &clk_rcg_ops
,
1349 .flags
= CLK_SET_PARENT_GATE
,
1354 static struct clk_branch gp0_clk
= {
1358 .enable_reg
= 0x2d24,
1359 .enable_mask
= BIT(9),
1360 .hw
.init
= &(struct clk_init_data
){
1362 .parent_names
= (const char *[]){ "gp0_src" },
1364 .ops
= &clk_branch_ops
,
1365 .flags
= CLK_SET_RATE_PARENT
,
1370 static struct clk_rcg gp1_src
= {
1375 .mnctr_reset_bit
= 7,
1376 .mnctr_mode_shift
= 5,
1387 .parent_map
= gcc_pxo_pll8_cxo_map
,
1389 .freq_tbl
= clk_tbl_gp
,
1391 .enable_reg
= 0x2d44,
1392 .enable_mask
= BIT(11),
1393 .hw
.init
= &(struct clk_init_data
){
1395 .parent_names
= gcc_pxo_pll8_cxo
,
1397 .ops
= &clk_rcg_ops
,
1398 .flags
= CLK_SET_RATE_GATE
,
1403 static struct clk_branch gp1_clk
= {
1407 .enable_reg
= 0x2d44,
1408 .enable_mask
= BIT(9),
1409 .hw
.init
= &(struct clk_init_data
){
1411 .parent_names
= (const char *[]){ "gp1_src" },
1413 .ops
= &clk_branch_ops
,
1414 .flags
= CLK_SET_RATE_PARENT
,
1419 static struct clk_rcg gp2_src
= {
1424 .mnctr_reset_bit
= 7,
1425 .mnctr_mode_shift
= 5,
1436 .parent_map
= gcc_pxo_pll8_cxo_map
,
1438 .freq_tbl
= clk_tbl_gp
,
1440 .enable_reg
= 0x2d64,
1441 .enable_mask
= BIT(11),
1442 .hw
.init
= &(struct clk_init_data
){
1444 .parent_names
= gcc_pxo_pll8_cxo
,
1446 .ops
= &clk_rcg_ops
,
1447 .flags
= CLK_SET_RATE_GATE
,
1452 static struct clk_branch gp2_clk
= {
1456 .enable_reg
= 0x2d64,
1457 .enable_mask
= BIT(9),
1458 .hw
.init
= &(struct clk_init_data
){
1460 .parent_names
= (const char *[]){ "gp2_src" },
1462 .ops
= &clk_branch_ops
,
1463 .flags
= CLK_SET_RATE_PARENT
,
1468 static struct clk_branch pmem_clk
= {
1474 .enable_reg
= 0x25a0,
1475 .enable_mask
= BIT(4),
1476 .hw
.init
= &(struct clk_init_data
){
1478 .ops
= &clk_branch_ops
,
1479 .flags
= CLK_IS_ROOT
,
1484 static struct clk_rcg prng_src
= {
1492 .parent_map
= gcc_pxo_pll8_map
,
1495 .init
= &(struct clk_init_data
){
1497 .parent_names
= gcc_pxo_pll8
,
1499 .ops
= &clk_rcg_ops
,
1504 static struct clk_branch prng_clk
= {
1506 .halt_check
= BRANCH_HALT_VOTED
,
1509 .enable_reg
= 0x3080,
1510 .enable_mask
= BIT(10),
1511 .hw
.init
= &(struct clk_init_data
){
1513 .parent_names
= (const char *[]){ "prng_src" },
1515 .ops
= &clk_branch_ops
,
1520 static const struct freq_tbl clk_tbl_sdc
[] = {
1521 { 144000, P_PXO
, 3, 2, 125 },
1522 { 400000, P_PLL8
, 4, 1, 240 },
1523 { 16000000, P_PLL8
, 4, 1, 6 },
1524 { 17070000, P_PLL8
, 1, 2, 45 },
1525 { 20210000, P_PLL8
, 1, 1, 19 },
1526 { 24000000, P_PLL8
, 4, 1, 4 },
1527 { 48000000, P_PLL8
, 4, 1, 2 },
1531 static struct clk_rcg sdc1_src
= {
1536 .mnctr_reset_bit
= 7,
1537 .mnctr_mode_shift
= 5,
1548 .parent_map
= gcc_pxo_pll8_map
,
1550 .freq_tbl
= clk_tbl_sdc
,
1552 .enable_reg
= 0x282c,
1553 .enable_mask
= BIT(11),
1554 .hw
.init
= &(struct clk_init_data
){
1556 .parent_names
= gcc_pxo_pll8
,
1558 .ops
= &clk_rcg_ops
,
1559 .flags
= CLK_SET_RATE_GATE
,
1564 static struct clk_branch sdc1_clk
= {
1568 .enable_reg
= 0x282c,
1569 .enable_mask
= BIT(9),
1570 .hw
.init
= &(struct clk_init_data
){
1572 .parent_names
= (const char *[]){ "sdc1_src" },
1574 .ops
= &clk_branch_ops
,
1575 .flags
= CLK_SET_RATE_PARENT
,
1580 static struct clk_rcg sdc2_src
= {
1585 .mnctr_reset_bit
= 7,
1586 .mnctr_mode_shift
= 5,
1597 .parent_map
= gcc_pxo_pll8_map
,
1599 .freq_tbl
= clk_tbl_sdc
,
1601 .enable_reg
= 0x284c,
1602 .enable_mask
= BIT(11),
1603 .hw
.init
= &(struct clk_init_data
){
1605 .parent_names
= gcc_pxo_pll8
,
1607 .ops
= &clk_rcg_ops
,
1608 .flags
= CLK_SET_RATE_GATE
,
1613 static struct clk_branch sdc2_clk
= {
1617 .enable_reg
= 0x284c,
1618 .enable_mask
= BIT(9),
1619 .hw
.init
= &(struct clk_init_data
){
1621 .parent_names
= (const char *[]){ "sdc2_src" },
1623 .ops
= &clk_branch_ops
,
1624 .flags
= CLK_SET_RATE_PARENT
,
1629 static struct clk_rcg sdc3_src
= {
1634 .mnctr_reset_bit
= 7,
1635 .mnctr_mode_shift
= 5,
1646 .parent_map
= gcc_pxo_pll8_map
,
1648 .freq_tbl
= clk_tbl_sdc
,
1650 .enable_reg
= 0x286c,
1651 .enable_mask
= BIT(11),
1652 .hw
.init
= &(struct clk_init_data
){
1654 .parent_names
= gcc_pxo_pll8
,
1656 .ops
= &clk_rcg_ops
,
1657 .flags
= CLK_SET_RATE_GATE
,
1662 static struct clk_branch sdc3_clk
= {
1666 .enable_reg
= 0x286c,
1667 .enable_mask
= BIT(9),
1668 .hw
.init
= &(struct clk_init_data
){
1670 .parent_names
= (const char *[]){ "sdc3_src" },
1672 .ops
= &clk_branch_ops
,
1673 .flags
= CLK_SET_RATE_PARENT
,
1678 static struct clk_rcg sdc4_src
= {
1683 .mnctr_reset_bit
= 7,
1684 .mnctr_mode_shift
= 5,
1695 .parent_map
= gcc_pxo_pll8_map
,
1697 .freq_tbl
= clk_tbl_sdc
,
1699 .enable_reg
= 0x288c,
1700 .enable_mask
= BIT(11),
1701 .hw
.init
= &(struct clk_init_data
){
1703 .parent_names
= gcc_pxo_pll8
,
1705 .ops
= &clk_rcg_ops
,
1706 .flags
= CLK_SET_RATE_GATE
,
1711 static struct clk_branch sdc4_clk
= {
1715 .enable_reg
= 0x288c,
1716 .enable_mask
= BIT(9),
1717 .hw
.init
= &(struct clk_init_data
){
1719 .parent_names
= (const char *[]){ "sdc4_src" },
1721 .ops
= &clk_branch_ops
,
1722 .flags
= CLK_SET_RATE_PARENT
,
1727 static struct clk_rcg sdc5_src
= {
1732 .mnctr_reset_bit
= 7,
1733 .mnctr_mode_shift
= 5,
1744 .parent_map
= gcc_pxo_pll8_map
,
1746 .freq_tbl
= clk_tbl_sdc
,
1748 .enable_reg
= 0x28ac,
1749 .enable_mask
= BIT(11),
1750 .hw
.init
= &(struct clk_init_data
){
1752 .parent_names
= gcc_pxo_pll8
,
1754 .ops
= &clk_rcg_ops
,
1755 .flags
= CLK_SET_RATE_GATE
,
1760 static struct clk_branch sdc5_clk
= {
1764 .enable_reg
= 0x28ac,
1765 .enable_mask
= BIT(9),
1766 .hw
.init
= &(struct clk_init_data
){
1768 .parent_names
= (const char *[]){ "sdc5_src" },
1770 .ops
= &clk_branch_ops
,
1771 .flags
= CLK_SET_RATE_PARENT
,
1776 static const struct freq_tbl clk_tbl_tsif_ref
[] = {
1777 { 105000, P_PXO
, 1, 1, 256 },
1781 static struct clk_rcg tsif_ref_src
= {
1786 .mnctr_reset_bit
= 7,
1787 .mnctr_mode_shift
= 5,
1798 .parent_map
= gcc_pxo_pll8_map
,
1800 .freq_tbl
= clk_tbl_tsif_ref
,
1802 .enable_reg
= 0x2710,
1803 .enable_mask
= BIT(11),
1804 .hw
.init
= &(struct clk_init_data
){
1805 .name
= "tsif_ref_src",
1806 .parent_names
= gcc_pxo_pll8
,
1808 .ops
= &clk_rcg_ops
,
1809 .flags
= CLK_SET_RATE_GATE
,
1814 static struct clk_branch tsif_ref_clk
= {
1818 .enable_reg
= 0x2710,
1819 .enable_mask
= BIT(9),
1820 .hw
.init
= &(struct clk_init_data
){
1821 .name
= "tsif_ref_clk",
1822 .parent_names
= (const char *[]){ "tsif_ref_src" },
1824 .ops
= &clk_branch_ops
,
1825 .flags
= CLK_SET_RATE_PARENT
,
1830 static const struct freq_tbl clk_tbl_usb
[] = {
1831 { 60000000, P_PLL8
, 1, 5, 32 },
1835 static struct clk_rcg usb_hs1_xcvr_src
= {
1840 .mnctr_reset_bit
= 7,
1841 .mnctr_mode_shift
= 5,
1852 .parent_map
= gcc_pxo_pll8_map
,
1854 .freq_tbl
= clk_tbl_usb
,
1856 .enable_reg
= 0x290c,
1857 .enable_mask
= BIT(11),
1858 .hw
.init
= &(struct clk_init_data
){
1859 .name
= "usb_hs1_xcvr_src",
1860 .parent_names
= gcc_pxo_pll8
,
1862 .ops
= &clk_rcg_ops
,
1863 .flags
= CLK_SET_RATE_GATE
,
1868 static struct clk_branch usb_hs1_xcvr_clk
= {
1872 .enable_reg
= 0x290c,
1873 .enable_mask
= BIT(9),
1874 .hw
.init
= &(struct clk_init_data
){
1875 .name
= "usb_hs1_xcvr_clk",
1876 .parent_names
= (const char *[]){ "usb_hs1_xcvr_src" },
1878 .ops
= &clk_branch_ops
,
1879 .flags
= CLK_SET_RATE_PARENT
,
1884 static struct clk_rcg usb_fs1_xcvr_fs_src
= {
1889 .mnctr_reset_bit
= 7,
1890 .mnctr_mode_shift
= 5,
1901 .parent_map
= gcc_pxo_pll8_map
,
1903 .freq_tbl
= clk_tbl_usb
,
1905 .enable_reg
= 0x2968,
1906 .enable_mask
= BIT(11),
1907 .hw
.init
= &(struct clk_init_data
){
1908 .name
= "usb_fs1_xcvr_fs_src",
1909 .parent_names
= gcc_pxo_pll8
,
1911 .ops
= &clk_rcg_ops
,
1912 .flags
= CLK_SET_RATE_GATE
,
1917 static const char *usb_fs1_xcvr_fs_src_p
[] = { "usb_fs1_xcvr_fs_src" };
1919 static struct clk_branch usb_fs1_xcvr_fs_clk
= {
1923 .enable_reg
= 0x2968,
1924 .enable_mask
= BIT(9),
1925 .hw
.init
= &(struct clk_init_data
){
1926 .name
= "usb_fs1_xcvr_fs_clk",
1927 .parent_names
= usb_fs1_xcvr_fs_src_p
,
1929 .ops
= &clk_branch_ops
,
1930 .flags
= CLK_SET_RATE_PARENT
,
1935 static struct clk_branch usb_fs1_system_clk
= {
1939 .enable_reg
= 0x296c,
1940 .enable_mask
= BIT(4),
1941 .hw
.init
= &(struct clk_init_data
){
1942 .parent_names
= usb_fs1_xcvr_fs_src_p
,
1944 .name
= "usb_fs1_system_clk",
1945 .ops
= &clk_branch_ops
,
1946 .flags
= CLK_SET_RATE_PARENT
,
1951 static struct clk_rcg usb_fs2_xcvr_fs_src
= {
1956 .mnctr_reset_bit
= 7,
1957 .mnctr_mode_shift
= 5,
1968 .parent_map
= gcc_pxo_pll8_map
,
1970 .freq_tbl
= clk_tbl_usb
,
1972 .enable_reg
= 0x2988,
1973 .enable_mask
= BIT(11),
1974 .hw
.init
= &(struct clk_init_data
){
1975 .name
= "usb_fs2_xcvr_fs_src",
1976 .parent_names
= gcc_pxo_pll8
,
1978 .ops
= &clk_rcg_ops
,
1979 .flags
= CLK_SET_RATE_GATE
,
1984 static const char *usb_fs2_xcvr_fs_src_p
[] = { "usb_fs2_xcvr_fs_src" };
1986 static struct clk_branch usb_fs2_xcvr_fs_clk
= {
1990 .enable_reg
= 0x2988,
1991 .enable_mask
= BIT(9),
1992 .hw
.init
= &(struct clk_init_data
){
1993 .name
= "usb_fs2_xcvr_fs_clk",
1994 .parent_names
= usb_fs2_xcvr_fs_src_p
,
1996 .ops
= &clk_branch_ops
,
1997 .flags
= CLK_SET_RATE_PARENT
,
2002 static struct clk_branch usb_fs2_system_clk
= {
2006 .enable_reg
= 0x298c,
2007 .enable_mask
= BIT(4),
2008 .hw
.init
= &(struct clk_init_data
){
2009 .name
= "usb_fs2_system_clk",
2010 .parent_names
= usb_fs2_xcvr_fs_src_p
,
2012 .ops
= &clk_branch_ops
,
2013 .flags
= CLK_SET_RATE_PARENT
,
2018 static struct clk_branch gsbi1_h_clk
= {
2022 .enable_reg
= 0x29c0,
2023 .enable_mask
= BIT(4),
2024 .hw
.init
= &(struct clk_init_data
){
2025 .name
= "gsbi1_h_clk",
2026 .ops
= &clk_branch_ops
,
2027 .flags
= CLK_IS_ROOT
,
2032 static struct clk_branch gsbi2_h_clk
= {
2036 .enable_reg
= 0x29e0,
2037 .enable_mask
= BIT(4),
2038 .hw
.init
= &(struct clk_init_data
){
2039 .name
= "gsbi2_h_clk",
2040 .ops
= &clk_branch_ops
,
2041 .flags
= CLK_IS_ROOT
,
2046 static struct clk_branch gsbi3_h_clk
= {
2050 .enable_reg
= 0x2a00,
2051 .enable_mask
= BIT(4),
2052 .hw
.init
= &(struct clk_init_data
){
2053 .name
= "gsbi3_h_clk",
2054 .ops
= &clk_branch_ops
,
2055 .flags
= CLK_IS_ROOT
,
2060 static struct clk_branch gsbi4_h_clk
= {
2064 .enable_reg
= 0x2a20,
2065 .enable_mask
= BIT(4),
2066 .hw
.init
= &(struct clk_init_data
){
2067 .name
= "gsbi4_h_clk",
2068 .ops
= &clk_branch_ops
,
2069 .flags
= CLK_IS_ROOT
,
2074 static struct clk_branch gsbi5_h_clk
= {
2078 .enable_reg
= 0x2a40,
2079 .enable_mask
= BIT(4),
2080 .hw
.init
= &(struct clk_init_data
){
2081 .name
= "gsbi5_h_clk",
2082 .ops
= &clk_branch_ops
,
2083 .flags
= CLK_IS_ROOT
,
2088 static struct clk_branch gsbi6_h_clk
= {
2092 .enable_reg
= 0x2a60,
2093 .enable_mask
= BIT(4),
2094 .hw
.init
= &(struct clk_init_data
){
2095 .name
= "gsbi6_h_clk",
2096 .ops
= &clk_branch_ops
,
2097 .flags
= CLK_IS_ROOT
,
2102 static struct clk_branch gsbi7_h_clk
= {
2106 .enable_reg
= 0x2a80,
2107 .enable_mask
= BIT(4),
2108 .hw
.init
= &(struct clk_init_data
){
2109 .name
= "gsbi7_h_clk",
2110 .ops
= &clk_branch_ops
,
2111 .flags
= CLK_IS_ROOT
,
2116 static struct clk_branch gsbi8_h_clk
= {
2120 .enable_reg
= 0x2aa0,
2121 .enable_mask
= BIT(4),
2122 .hw
.init
= &(struct clk_init_data
){
2123 .name
= "gsbi8_h_clk",
2124 .ops
= &clk_branch_ops
,
2125 .flags
= CLK_IS_ROOT
,
2130 static struct clk_branch gsbi9_h_clk
= {
2134 .enable_reg
= 0x2ac0,
2135 .enable_mask
= BIT(4),
2136 .hw
.init
= &(struct clk_init_data
){
2137 .name
= "gsbi9_h_clk",
2138 .ops
= &clk_branch_ops
,
2139 .flags
= CLK_IS_ROOT
,
2144 static struct clk_branch gsbi10_h_clk
= {
2148 .enable_reg
= 0x2ae0,
2149 .enable_mask
= BIT(4),
2150 .hw
.init
= &(struct clk_init_data
){
2151 .name
= "gsbi10_h_clk",
2152 .ops
= &clk_branch_ops
,
2153 .flags
= CLK_IS_ROOT
,
2158 static struct clk_branch gsbi11_h_clk
= {
2162 .enable_reg
= 0x2b00,
2163 .enable_mask
= BIT(4),
2164 .hw
.init
= &(struct clk_init_data
){
2165 .name
= "gsbi11_h_clk",
2166 .ops
= &clk_branch_ops
,
2167 .flags
= CLK_IS_ROOT
,
2172 static struct clk_branch gsbi12_h_clk
= {
2176 .enable_reg
= 0x2b20,
2177 .enable_mask
= BIT(4),
2178 .hw
.init
= &(struct clk_init_data
){
2179 .name
= "gsbi12_h_clk",
2180 .ops
= &clk_branch_ops
,
2181 .flags
= CLK_IS_ROOT
,
2186 static struct clk_branch tsif_h_clk
= {
2190 .enable_reg
= 0x2700,
2191 .enable_mask
= BIT(4),
2192 .hw
.init
= &(struct clk_init_data
){
2193 .name
= "tsif_h_clk",
2194 .ops
= &clk_branch_ops
,
2195 .flags
= CLK_IS_ROOT
,
2200 static struct clk_branch usb_fs1_h_clk
= {
2204 .enable_reg
= 0x2960,
2205 .enable_mask
= BIT(4),
2206 .hw
.init
= &(struct clk_init_data
){
2207 .name
= "usb_fs1_h_clk",
2208 .ops
= &clk_branch_ops
,
2209 .flags
= CLK_IS_ROOT
,
2214 static struct clk_branch usb_fs2_h_clk
= {
2218 .enable_reg
= 0x2980,
2219 .enable_mask
= BIT(4),
2220 .hw
.init
= &(struct clk_init_data
){
2221 .name
= "usb_fs2_h_clk",
2222 .ops
= &clk_branch_ops
,
2223 .flags
= CLK_IS_ROOT
,
2228 static struct clk_branch usb_hs1_h_clk
= {
2232 .enable_reg
= 0x2900,
2233 .enable_mask
= BIT(4),
2234 .hw
.init
= &(struct clk_init_data
){
2235 .name
= "usb_hs1_h_clk",
2236 .ops
= &clk_branch_ops
,
2237 .flags
= CLK_IS_ROOT
,
2242 static struct clk_branch sdc1_h_clk
= {
2246 .enable_reg
= 0x2820,
2247 .enable_mask
= BIT(4),
2248 .hw
.init
= &(struct clk_init_data
){
2249 .name
= "sdc1_h_clk",
2250 .ops
= &clk_branch_ops
,
2251 .flags
= CLK_IS_ROOT
,
2256 static struct clk_branch sdc2_h_clk
= {
2260 .enable_reg
= 0x2840,
2261 .enable_mask
= BIT(4),
2262 .hw
.init
= &(struct clk_init_data
){
2263 .name
= "sdc2_h_clk",
2264 .ops
= &clk_branch_ops
,
2265 .flags
= CLK_IS_ROOT
,
2270 static struct clk_branch sdc3_h_clk
= {
2274 .enable_reg
= 0x2860,
2275 .enable_mask
= BIT(4),
2276 .hw
.init
= &(struct clk_init_data
){
2277 .name
= "sdc3_h_clk",
2278 .ops
= &clk_branch_ops
,
2279 .flags
= CLK_IS_ROOT
,
2284 static struct clk_branch sdc4_h_clk
= {
2288 .enable_reg
= 0x2880,
2289 .enable_mask
= BIT(4),
2290 .hw
.init
= &(struct clk_init_data
){
2291 .name
= "sdc4_h_clk",
2292 .ops
= &clk_branch_ops
,
2293 .flags
= CLK_IS_ROOT
,
2298 static struct clk_branch sdc5_h_clk
= {
2302 .enable_reg
= 0x28a0,
2303 .enable_mask
= BIT(4),
2304 .hw
.init
= &(struct clk_init_data
){
2305 .name
= "sdc5_h_clk",
2306 .ops
= &clk_branch_ops
,
2307 .flags
= CLK_IS_ROOT
,
2312 static struct clk_branch adm0_clk
= {
2314 .halt_check
= BRANCH_HALT_VOTED
,
2317 .enable_reg
= 0x3080,
2318 .enable_mask
= BIT(2),
2319 .hw
.init
= &(struct clk_init_data
){
2321 .ops
= &clk_branch_ops
,
2322 .flags
= CLK_IS_ROOT
,
2327 static struct clk_branch adm0_pbus_clk
= {
2329 .halt_check
= BRANCH_HALT_VOTED
,
2332 .enable_reg
= 0x3080,
2333 .enable_mask
= BIT(3),
2334 .hw
.init
= &(struct clk_init_data
){
2335 .name
= "adm0_pbus_clk",
2336 .ops
= &clk_branch_ops
,
2337 .flags
= CLK_IS_ROOT
,
2342 static struct clk_branch adm1_clk
= {
2345 .halt_check
= BRANCH_HALT_VOTED
,
2347 .enable_reg
= 0x3080,
2348 .enable_mask
= BIT(4),
2349 .hw
.init
= &(struct clk_init_data
){
2351 .ops
= &clk_branch_ops
,
2352 .flags
= CLK_IS_ROOT
,
2357 static struct clk_branch adm1_pbus_clk
= {
2360 .halt_check
= BRANCH_HALT_VOTED
,
2362 .enable_reg
= 0x3080,
2363 .enable_mask
= BIT(5),
2364 .hw
.init
= &(struct clk_init_data
){
2365 .name
= "adm1_pbus_clk",
2366 .ops
= &clk_branch_ops
,
2367 .flags
= CLK_IS_ROOT
,
2372 static struct clk_branch modem_ahb1_h_clk
= {
2375 .halt_check
= BRANCH_HALT_VOTED
,
2377 .enable_reg
= 0x3080,
2378 .enable_mask
= BIT(0),
2379 .hw
.init
= &(struct clk_init_data
){
2380 .name
= "modem_ahb1_h_clk",
2381 .ops
= &clk_branch_ops
,
2382 .flags
= CLK_IS_ROOT
,
2387 static struct clk_branch modem_ahb2_h_clk
= {
2390 .halt_check
= BRANCH_HALT_VOTED
,
2392 .enable_reg
= 0x3080,
2393 .enable_mask
= BIT(1),
2394 .hw
.init
= &(struct clk_init_data
){
2395 .name
= "modem_ahb2_h_clk",
2396 .ops
= &clk_branch_ops
,
2397 .flags
= CLK_IS_ROOT
,
2402 static struct clk_branch pmic_arb0_h_clk
= {
2404 .halt_check
= BRANCH_HALT_VOTED
,
2407 .enable_reg
= 0x3080,
2408 .enable_mask
= BIT(8),
2409 .hw
.init
= &(struct clk_init_data
){
2410 .name
= "pmic_arb0_h_clk",
2411 .ops
= &clk_branch_ops
,
2412 .flags
= CLK_IS_ROOT
,
2417 static struct clk_branch pmic_arb1_h_clk
= {
2419 .halt_check
= BRANCH_HALT_VOTED
,
2422 .enable_reg
= 0x3080,
2423 .enable_mask
= BIT(9),
2424 .hw
.init
= &(struct clk_init_data
){
2425 .name
= "pmic_arb1_h_clk",
2426 .ops
= &clk_branch_ops
,
2427 .flags
= CLK_IS_ROOT
,
2432 static struct clk_branch pmic_ssbi2_clk
= {
2434 .halt_check
= BRANCH_HALT_VOTED
,
2437 .enable_reg
= 0x3080,
2438 .enable_mask
= BIT(7),
2439 .hw
.init
= &(struct clk_init_data
){
2440 .name
= "pmic_ssbi2_clk",
2441 .ops
= &clk_branch_ops
,
2442 .flags
= CLK_IS_ROOT
,
2447 static struct clk_branch rpm_msg_ram_h_clk
= {
2451 .halt_check
= BRANCH_HALT_VOTED
,
2454 .enable_reg
= 0x3080,
2455 .enable_mask
= BIT(6),
2456 .hw
.init
= &(struct clk_init_data
){
2457 .name
= "rpm_msg_ram_h_clk",
2458 .ops
= &clk_branch_ops
,
2459 .flags
= CLK_IS_ROOT
,
2464 static struct clk_regmap
*gcc_msm8660_clks
[] = {
2465 [PLL8
] = &pll8
.clkr
,
2466 [PLL8_VOTE
] = &pll8_vote
,
2467 [GSBI1_UART_SRC
] = &gsbi1_uart_src
.clkr
,
2468 [GSBI1_UART_CLK
] = &gsbi1_uart_clk
.clkr
,
2469 [GSBI2_UART_SRC
] = &gsbi2_uart_src
.clkr
,
2470 [GSBI2_UART_CLK
] = &gsbi2_uart_clk
.clkr
,
2471 [GSBI3_UART_SRC
] = &gsbi3_uart_src
.clkr
,
2472 [GSBI3_UART_CLK
] = &gsbi3_uart_clk
.clkr
,
2473 [GSBI4_UART_SRC
] = &gsbi4_uart_src
.clkr
,
2474 [GSBI4_UART_CLK
] = &gsbi4_uart_clk
.clkr
,
2475 [GSBI5_UART_SRC
] = &gsbi5_uart_src
.clkr
,
2476 [GSBI5_UART_CLK
] = &gsbi5_uart_clk
.clkr
,
2477 [GSBI6_UART_SRC
] = &gsbi6_uart_src
.clkr
,
2478 [GSBI6_UART_CLK
] = &gsbi6_uart_clk
.clkr
,
2479 [GSBI7_UART_SRC
] = &gsbi7_uart_src
.clkr
,
2480 [GSBI7_UART_CLK
] = &gsbi7_uart_clk
.clkr
,
2481 [GSBI8_UART_SRC
] = &gsbi8_uart_src
.clkr
,
2482 [GSBI8_UART_CLK
] = &gsbi8_uart_clk
.clkr
,
2483 [GSBI9_UART_SRC
] = &gsbi9_uart_src
.clkr
,
2484 [GSBI9_UART_CLK
] = &gsbi9_uart_clk
.clkr
,
2485 [GSBI10_UART_SRC
] = &gsbi10_uart_src
.clkr
,
2486 [GSBI10_UART_CLK
] = &gsbi10_uart_clk
.clkr
,
2487 [GSBI11_UART_SRC
] = &gsbi11_uart_src
.clkr
,
2488 [GSBI11_UART_CLK
] = &gsbi11_uart_clk
.clkr
,
2489 [GSBI12_UART_SRC
] = &gsbi12_uart_src
.clkr
,
2490 [GSBI12_UART_CLK
] = &gsbi12_uart_clk
.clkr
,
2491 [GSBI1_QUP_SRC
] = &gsbi1_qup_src
.clkr
,
2492 [GSBI1_QUP_CLK
] = &gsbi1_qup_clk
.clkr
,
2493 [GSBI2_QUP_SRC
] = &gsbi2_qup_src
.clkr
,
2494 [GSBI2_QUP_CLK
] = &gsbi2_qup_clk
.clkr
,
2495 [GSBI3_QUP_SRC
] = &gsbi3_qup_src
.clkr
,
2496 [GSBI3_QUP_CLK
] = &gsbi3_qup_clk
.clkr
,
2497 [GSBI4_QUP_SRC
] = &gsbi4_qup_src
.clkr
,
2498 [GSBI4_QUP_CLK
] = &gsbi4_qup_clk
.clkr
,
2499 [GSBI5_QUP_SRC
] = &gsbi5_qup_src
.clkr
,
2500 [GSBI5_QUP_CLK
] = &gsbi5_qup_clk
.clkr
,
2501 [GSBI6_QUP_SRC
] = &gsbi6_qup_src
.clkr
,
2502 [GSBI6_QUP_CLK
] = &gsbi6_qup_clk
.clkr
,
2503 [GSBI7_QUP_SRC
] = &gsbi7_qup_src
.clkr
,
2504 [GSBI7_QUP_CLK
] = &gsbi7_qup_clk
.clkr
,
2505 [GSBI8_QUP_SRC
] = &gsbi8_qup_src
.clkr
,
2506 [GSBI8_QUP_CLK
] = &gsbi8_qup_clk
.clkr
,
2507 [GSBI9_QUP_SRC
] = &gsbi9_qup_src
.clkr
,
2508 [GSBI9_QUP_CLK
] = &gsbi9_qup_clk
.clkr
,
2509 [GSBI10_QUP_SRC
] = &gsbi10_qup_src
.clkr
,
2510 [GSBI10_QUP_CLK
] = &gsbi10_qup_clk
.clkr
,
2511 [GSBI11_QUP_SRC
] = &gsbi11_qup_src
.clkr
,
2512 [GSBI11_QUP_CLK
] = &gsbi11_qup_clk
.clkr
,
2513 [GSBI12_QUP_SRC
] = &gsbi12_qup_src
.clkr
,
2514 [GSBI12_QUP_CLK
] = &gsbi12_qup_clk
.clkr
,
2515 [GP0_SRC
] = &gp0_src
.clkr
,
2516 [GP0_CLK
] = &gp0_clk
.clkr
,
2517 [GP1_SRC
] = &gp1_src
.clkr
,
2518 [GP1_CLK
] = &gp1_clk
.clkr
,
2519 [GP2_SRC
] = &gp2_src
.clkr
,
2520 [GP2_CLK
] = &gp2_clk
.clkr
,
2521 [PMEM_CLK
] = &pmem_clk
.clkr
,
2522 [PRNG_SRC
] = &prng_src
.clkr
,
2523 [PRNG_CLK
] = &prng_clk
.clkr
,
2524 [SDC1_SRC
] = &sdc1_src
.clkr
,
2525 [SDC1_CLK
] = &sdc1_clk
.clkr
,
2526 [SDC2_SRC
] = &sdc2_src
.clkr
,
2527 [SDC2_CLK
] = &sdc2_clk
.clkr
,
2528 [SDC3_SRC
] = &sdc3_src
.clkr
,
2529 [SDC3_CLK
] = &sdc3_clk
.clkr
,
2530 [SDC4_SRC
] = &sdc4_src
.clkr
,
2531 [SDC4_CLK
] = &sdc4_clk
.clkr
,
2532 [SDC5_SRC
] = &sdc5_src
.clkr
,
2533 [SDC5_CLK
] = &sdc5_clk
.clkr
,
2534 [TSIF_REF_SRC
] = &tsif_ref_src
.clkr
,
2535 [TSIF_REF_CLK
] = &tsif_ref_clk
.clkr
,
2536 [USB_HS1_XCVR_SRC
] = &usb_hs1_xcvr_src
.clkr
,
2537 [USB_HS1_XCVR_CLK
] = &usb_hs1_xcvr_clk
.clkr
,
2538 [USB_FS1_XCVR_FS_SRC
] = &usb_fs1_xcvr_fs_src
.clkr
,
2539 [USB_FS1_XCVR_FS_CLK
] = &usb_fs1_xcvr_fs_clk
.clkr
,
2540 [USB_FS1_SYSTEM_CLK
] = &usb_fs1_system_clk
.clkr
,
2541 [USB_FS2_XCVR_FS_SRC
] = &usb_fs2_xcvr_fs_src
.clkr
,
2542 [USB_FS2_XCVR_FS_CLK
] = &usb_fs2_xcvr_fs_clk
.clkr
,
2543 [USB_FS2_SYSTEM_CLK
] = &usb_fs2_system_clk
.clkr
,
2544 [GSBI1_H_CLK
] = &gsbi1_h_clk
.clkr
,
2545 [GSBI2_H_CLK
] = &gsbi2_h_clk
.clkr
,
2546 [GSBI3_H_CLK
] = &gsbi3_h_clk
.clkr
,
2547 [GSBI4_H_CLK
] = &gsbi4_h_clk
.clkr
,
2548 [GSBI5_H_CLK
] = &gsbi5_h_clk
.clkr
,
2549 [GSBI6_H_CLK
] = &gsbi6_h_clk
.clkr
,
2550 [GSBI7_H_CLK
] = &gsbi7_h_clk
.clkr
,
2551 [GSBI8_H_CLK
] = &gsbi8_h_clk
.clkr
,
2552 [GSBI9_H_CLK
] = &gsbi9_h_clk
.clkr
,
2553 [GSBI10_H_CLK
] = &gsbi10_h_clk
.clkr
,
2554 [GSBI11_H_CLK
] = &gsbi11_h_clk
.clkr
,
2555 [GSBI12_H_CLK
] = &gsbi12_h_clk
.clkr
,
2556 [TSIF_H_CLK
] = &tsif_h_clk
.clkr
,
2557 [USB_FS1_H_CLK
] = &usb_fs1_h_clk
.clkr
,
2558 [USB_FS2_H_CLK
] = &usb_fs2_h_clk
.clkr
,
2559 [USB_HS1_H_CLK
] = &usb_hs1_h_clk
.clkr
,
2560 [SDC1_H_CLK
] = &sdc1_h_clk
.clkr
,
2561 [SDC2_H_CLK
] = &sdc2_h_clk
.clkr
,
2562 [SDC3_H_CLK
] = &sdc3_h_clk
.clkr
,
2563 [SDC4_H_CLK
] = &sdc4_h_clk
.clkr
,
2564 [SDC5_H_CLK
] = &sdc5_h_clk
.clkr
,
2565 [ADM0_CLK
] = &adm0_clk
.clkr
,
2566 [ADM0_PBUS_CLK
] = &adm0_pbus_clk
.clkr
,
2567 [ADM1_CLK
] = &adm1_clk
.clkr
,
2568 [ADM1_PBUS_CLK
] = &adm1_pbus_clk
.clkr
,
2569 [MODEM_AHB1_H_CLK
] = &modem_ahb1_h_clk
.clkr
,
2570 [MODEM_AHB2_H_CLK
] = &modem_ahb2_h_clk
.clkr
,
2571 [PMIC_ARB0_H_CLK
] = &pmic_arb0_h_clk
.clkr
,
2572 [PMIC_ARB1_H_CLK
] = &pmic_arb1_h_clk
.clkr
,
2573 [PMIC_SSBI2_CLK
] = &pmic_ssbi2_clk
.clkr
,
2574 [RPM_MSG_RAM_H_CLK
] = &rpm_msg_ram_h_clk
.clkr
,
2577 static const struct qcom_reset_map gcc_msm8660_resets
[] = {
2578 [AFAB_CORE_RESET
] = { 0x2080, 7 },
2579 [SCSS_SYS_RESET
] = { 0x20b4, 1 },
2580 [SCSS_SYS_POR_RESET
] = { 0x20b4 },
2581 [AFAB_SMPSS_S_RESET
] = { 0x20b8, 2 },
2582 [AFAB_SMPSS_M1_RESET
] = { 0x20b8, 1 },
2583 [AFAB_SMPSS_M0_RESET
] = { 0x20b8 },
2584 [AFAB_EBI1_S_RESET
] = { 0x20c0, 7 },
2585 [SFAB_CORE_RESET
] = { 0x2120, 7 },
2586 [SFAB_ADM0_M0_RESET
] = { 0x21e0, 7 },
2587 [SFAB_ADM0_M1_RESET
] = { 0x21e4, 7 },
2588 [SFAB_ADM0_M2_RESET
] = { 0x21e4, 7 },
2589 [ADM0_C2_RESET
] = { 0x220c, 4 },
2590 [ADM0_C1_RESET
] = { 0x220c, 3 },
2591 [ADM0_C0_RESET
] = { 0x220c, 2 },
2592 [ADM0_PBUS_RESET
] = { 0x220c, 1 },
2593 [ADM0_RESET
] = { 0x220c },
2594 [SFAB_ADM1_M0_RESET
] = { 0x2220, 7 },
2595 [SFAB_ADM1_M1_RESET
] = { 0x2224, 7 },
2596 [SFAB_ADM1_M2_RESET
] = { 0x2228, 7 },
2597 [MMFAB_ADM1_M3_RESET
] = { 0x2240, 7 },
2598 [ADM1_C3_RESET
] = { 0x226c, 5 },
2599 [ADM1_C2_RESET
] = { 0x226c, 4 },
2600 [ADM1_C1_RESET
] = { 0x226c, 3 },
2601 [ADM1_C0_RESET
] = { 0x226c, 2 },
2602 [ADM1_PBUS_RESET
] = { 0x226c, 1 },
2603 [ADM1_RESET
] = { 0x226c },
2604 [IMEM0_RESET
] = { 0x2280, 7 },
2605 [SFAB_LPASS_Q6_RESET
] = { 0x23a0, 7 },
2606 [SFAB_AFAB_M_RESET
] = { 0x23e0, 7 },
2607 [AFAB_SFAB_M0_RESET
] = { 0x2420, 7 },
2608 [AFAB_SFAB_M1_RESET
] = { 0x2424, 7 },
2609 [DFAB_CORE_RESET
] = { 0x24ac, 7 },
2610 [SFAB_DFAB_M_RESET
] = { 0x2500, 7 },
2611 [DFAB_SFAB_M_RESET
] = { 0x2520, 7 },
2612 [DFAB_SWAY0_RESET
] = { 0x2540, 7 },
2613 [DFAB_SWAY1_RESET
] = { 0x2544, 7 },
2614 [DFAB_ARB0_RESET
] = { 0x2560, 7 },
2615 [DFAB_ARB1_RESET
] = { 0x2564, 7 },
2616 [PPSS_PROC_RESET
] = { 0x2594, 1 },
2617 [PPSS_RESET
] = { 0x2594 },
2618 [PMEM_RESET
] = { 0x25a0, 7 },
2619 [DMA_BAM_RESET
] = { 0x25c0, 7 },
2620 [SIC_RESET
] = { 0x25e0, 7 },
2621 [SPS_TIC_RESET
] = { 0x2600, 7 },
2622 [CFBP0_RESET
] = { 0x2650, 7 },
2623 [CFBP1_RESET
] = { 0x2654, 7 },
2624 [CFBP2_RESET
] = { 0x2658, 7 },
2625 [EBI2_RESET
] = { 0x2664, 7 },
2626 [SFAB_CFPB_M_RESET
] = { 0x2680, 7 },
2627 [CFPB_MASTER_RESET
] = { 0x26a0, 7 },
2628 [SFAB_CFPB_S_RESET
] = { 0x26c0, 7 },
2629 [CFPB_SPLITTER_RESET
] = { 0x26e0, 7 },
2630 [TSIF_RESET
] = { 0x2700, 7 },
2631 [CE1_RESET
] = { 0x2720, 7 },
2632 [CE2_RESET
] = { 0x2740, 7 },
2633 [SFAB_SFPB_M_RESET
] = { 0x2780, 7 },
2634 [SFAB_SFPB_S_RESET
] = { 0x27a0, 7 },
2635 [RPM_PROC_RESET
] = { 0x27c0, 7 },
2636 [RPM_BUS_RESET
] = { 0x27c4, 7 },
2637 [RPM_MSG_RAM_RESET
] = { 0x27e0, 7 },
2638 [PMIC_ARB0_RESET
] = { 0x2800, 7 },
2639 [PMIC_ARB1_RESET
] = { 0x2804, 7 },
2640 [PMIC_SSBI2_RESET
] = { 0x280c, 12 },
2641 [SDC1_RESET
] = { 0x2830 },
2642 [SDC2_RESET
] = { 0x2850 },
2643 [SDC3_RESET
] = { 0x2870 },
2644 [SDC4_RESET
] = { 0x2890 },
2645 [SDC5_RESET
] = { 0x28b0 },
2646 [USB_HS1_RESET
] = { 0x2910 },
2647 [USB_HS2_XCVR_RESET
] = { 0x2934, 1 },
2648 [USB_HS2_RESET
] = { 0x2934 },
2649 [USB_FS1_XCVR_RESET
] = { 0x2974, 1 },
2650 [USB_FS1_RESET
] = { 0x2974 },
2651 [USB_FS2_XCVR_RESET
] = { 0x2994, 1 },
2652 [USB_FS2_RESET
] = { 0x2994 },
2653 [GSBI1_RESET
] = { 0x29dc },
2654 [GSBI2_RESET
] = { 0x29fc },
2655 [GSBI3_RESET
] = { 0x2a1c },
2656 [GSBI4_RESET
] = { 0x2a3c },
2657 [GSBI5_RESET
] = { 0x2a5c },
2658 [GSBI6_RESET
] = { 0x2a7c },
2659 [GSBI7_RESET
] = { 0x2a9c },
2660 [GSBI8_RESET
] = { 0x2abc },
2661 [GSBI9_RESET
] = { 0x2adc },
2662 [GSBI10_RESET
] = { 0x2afc },
2663 [GSBI11_RESET
] = { 0x2b1c },
2664 [GSBI12_RESET
] = { 0x2b3c },
2665 [SPDM_RESET
] = { 0x2b6c },
2666 [SEC_CTRL_RESET
] = { 0x2b80, 7 },
2667 [TLMM_H_RESET
] = { 0x2ba0, 7 },
2668 [TLMM_RESET
] = { 0x2ba4, 7 },
2669 [MARRM_PWRON_RESET
] = { 0x2bd4, 1 },
2670 [MARM_RESET
] = { 0x2bd4 },
2671 [MAHB1_RESET
] = { 0x2be4, 7 },
2672 [SFAB_MSS_S_RESET
] = { 0x2c00, 7 },
2673 [MAHB2_RESET
] = { 0x2c20, 7 },
2674 [MODEM_SW_AHB_RESET
] = { 0x2c48, 1 },
2675 [MODEM_RESET
] = { 0x2c48 },
2676 [SFAB_MSS_MDM1_RESET
] = { 0x2c4c, 1 },
2677 [SFAB_MSS_MDM0_RESET
] = { 0x2c4c },
2678 [MSS_SLP_RESET
] = { 0x2c60, 7 },
2679 [MSS_MARM_SAW_RESET
] = { 0x2c68, 1 },
2680 [MSS_WDOG_RESET
] = { 0x2c68 },
2681 [TSSC_RESET
] = { 0x2ca0, 7 },
2682 [PDM_RESET
] = { 0x2cc0, 12 },
2683 [SCSS_CORE0_RESET
] = { 0x2d60, 1 },
2684 [SCSS_CORE0_POR_RESET
] = { 0x2d60 },
2685 [SCSS_CORE1_RESET
] = { 0x2d80, 1 },
2686 [SCSS_CORE1_POR_RESET
] = { 0x2d80 },
2687 [MPM_RESET
] = { 0x2da4, 1 },
2688 [EBI1_1X_DIV_RESET
] = { 0x2dec, 9 },
2689 [EBI1_RESET
] = { 0x2dec, 7 },
2690 [SFAB_SMPSS_S_RESET
] = { 0x2e00, 7 },
2691 [USB_PHY0_RESET
] = { 0x2e20 },
2692 [USB_PHY1_RESET
] = { 0x2e40 },
2693 [PRNG_RESET
] = { 0x2e80, 12 },
2696 static const struct regmap_config gcc_msm8660_regmap_config
= {
2700 .max_register
= 0x363c,
2704 static const struct of_device_id gcc_msm8660_match_table
[] = {
2705 { .compatible
= "qcom,gcc-msm8660" },
2708 MODULE_DEVICE_TABLE(of
, gcc_msm8660_match_table
);
2711 struct qcom_reset_controller reset
;
2712 struct clk_onecell_data data
;
2716 static int gcc_msm8660_probe(struct platform_device
*pdev
)
2719 struct resource
*res
;
2721 struct device
*dev
= &pdev
->dev
;
2723 struct clk_onecell_data
*data
;
2725 struct regmap
*regmap
;
2727 struct qcom_reset_controller
*reset
;
2730 res
= platform_get_resource(pdev
, IORESOURCE_MEM
, 0);
2731 base
= devm_ioremap_resource(dev
, res
);
2733 return PTR_ERR(base
);
2735 regmap
= devm_regmap_init_mmio(dev
, base
, &gcc_msm8660_regmap_config
);
2737 return PTR_ERR(regmap
);
2739 num_clks
= ARRAY_SIZE(gcc_msm8660_clks
);
2740 cc
= devm_kzalloc(dev
, sizeof(*cc
) + sizeof(*clks
) * num_clks
,
2748 data
->clk_num
= num_clks
;
2750 /* Temporary until RPM clocks supported */
2751 clk
= clk_register_fixed_rate(dev
, "cxo", NULL
, CLK_IS_ROOT
, 19200000);
2753 return PTR_ERR(clk
);
2755 clk
= clk_register_fixed_rate(dev
, "pxo", NULL
, CLK_IS_ROOT
, 27000000);
2757 return PTR_ERR(clk
);
2759 for (i
= 0; i
< num_clks
; i
++) {
2760 if (!gcc_msm8660_clks
[i
])
2762 clk
= devm_clk_register_regmap(dev
, gcc_msm8660_clks
[i
]);
2764 return PTR_ERR(clk
);
2768 ret
= of_clk_add_provider(dev
->of_node
, of_clk_src_onecell_get
, data
);
2773 reset
->rcdev
.of_node
= dev
->of_node
;
2774 reset
->rcdev
.ops
= &qcom_reset_ops
,
2775 reset
->rcdev
.owner
= THIS_MODULE
,
2776 reset
->rcdev
.nr_resets
= ARRAY_SIZE(gcc_msm8660_resets
),
2777 reset
->regmap
= regmap
;
2778 reset
->reset_map
= gcc_msm8660_resets
,
2779 platform_set_drvdata(pdev
, &reset
->rcdev
);
2781 ret
= reset_controller_register(&reset
->rcdev
);
2783 of_clk_del_provider(dev
->of_node
);
2788 static int gcc_msm8660_remove(struct platform_device
*pdev
)
2790 of_clk_del_provider(pdev
->dev
.of_node
);
2791 reset_controller_unregister(platform_get_drvdata(pdev
));
2795 static struct platform_driver gcc_msm8660_driver
= {
2796 .probe
= gcc_msm8660_probe
,
2797 .remove
= gcc_msm8660_remove
,
2799 .name
= "gcc-msm8660",
2800 .owner
= THIS_MODULE
,
2801 .of_match_table
= gcc_msm8660_match_table
,
2805 static int __init
gcc_msm8660_init(void)
2807 return platform_driver_register(&gcc_msm8660_driver
);
2809 core_initcall(gcc_msm8660_init
);
2811 static void __exit
gcc_msm8660_exit(void)
2813 platform_driver_unregister(&gcc_msm8660_driver
);
2815 module_exit(gcc_msm8660_exit
);
2817 MODULE_DESCRIPTION("GCC MSM 8660 Driver");
2818 MODULE_LICENSE("GPL v2");
2819 MODULE_ALIAS("platform:gcc-msm8660");