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-msm8974.h>
26 #include <dt-bindings/reset/qcom,gcc-msm8974.h>
29 #include "clk-regmap.h"
32 #include "clk-branch.h"
42 static const struct parent_map gcc_xo_gpll0_map[] = {
47 static const char * const gcc_xo_gpll0[] = {
52 static const struct parent_map gcc_xo_gpll0_gpll4_map[] = {
58 static const char * const gcc_xo_gpll0_gpll4[] = {
64 #define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
66 static struct clk_pll gpll0 = {
74 .clkr.hw.init = &(struct clk_init_data){
76 .parent_names = (const char *[]){ "xo" },
82 static struct clk_regmap gpll0_vote = {
84 .enable_mask = BIT(0),
85 .hw.init = &(struct clk_init_data){
87 .parent_names = (const char *[]){ "gpll0" },
89 .ops = &clk_pll_vote_ops,
93 static struct clk_rcg2 config_noc_clk_src = {
96 .parent_map = gcc_xo_gpll0_map,
97 .clkr.hw.init = &(struct clk_init_data){
98 .name = "config_noc_clk_src",
99 .parent_names = gcc_xo_gpll0,
101 .ops = &clk_rcg2_ops,
105 static struct clk_rcg2 periph_noc_clk_src = {
108 .parent_map = gcc_xo_gpll0_map,
109 .clkr.hw.init = &(struct clk_init_data){
110 .name = "periph_noc_clk_src",
111 .parent_names = gcc_xo_gpll0,
113 .ops = &clk_rcg2_ops,
117 static struct clk_rcg2 system_noc_clk_src = {
120 .parent_map = gcc_xo_gpll0_map,
121 .clkr.hw.init = &(struct clk_init_data){
122 .name = "system_noc_clk_src",
123 .parent_names = gcc_xo_gpll0,
125 .ops = &clk_rcg2_ops,
129 static struct clk_pll gpll1 = {
133 .config_reg = 0x0054,
135 .status_reg = 0x005c,
137 .clkr.hw.init = &(struct clk_init_data){
139 .parent_names = (const char *[]){ "xo" },
145 static struct clk_regmap gpll1_vote = {
146 .enable_reg = 0x1480,
147 .enable_mask = BIT(1),
148 .hw.init = &(struct clk_init_data){
149 .name = "gpll1_vote",
150 .parent_names = (const char *[]){ "gpll1" },
152 .ops = &clk_pll_vote_ops,
156 static struct clk_pll gpll4 = {
160 .config_reg = 0x1dd4,
162 .status_reg = 0x1ddc,
164 .clkr.hw.init = &(struct clk_init_data){
166 .parent_names = (const char *[]){ "xo" },
172 static struct clk_regmap gpll4_vote = {
173 .enable_reg = 0x1480,
174 .enable_mask = BIT(4),
175 .hw.init = &(struct clk_init_data){
176 .name = "gpll4_vote",
177 .parent_names = (const char *[]){ "gpll4" },
179 .ops = &clk_pll_vote_ops,
183 static const struct freq_tbl ftbl_gcc_usb30_master_clk[] = {
184 F(125000000, P_GPLL0, 1, 5, 24),
188 static struct clk_rcg2 usb30_master_clk_src = {
192 .parent_map = gcc_xo_gpll0_map,
193 .freq_tbl = ftbl_gcc_usb30_master_clk,
194 .clkr.hw.init = &(struct clk_init_data){
195 .name = "usb30_master_clk_src",
196 .parent_names = gcc_xo_gpll0,
198 .ops = &clk_rcg2_ops,
202 static const struct freq_tbl ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk[] = {
203 F(19200000, P_XO, 1, 0, 0),
204 F(37500000, P_GPLL0, 16, 0, 0),
205 F(50000000, P_GPLL0, 12, 0, 0),
209 static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = {
212 .parent_map = gcc_xo_gpll0_map,
213 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
214 .clkr.hw.init = &(struct clk_init_data){
215 .name = "blsp1_qup1_i2c_apps_clk_src",
216 .parent_names = gcc_xo_gpll0,
218 .ops = &clk_rcg2_ops,
222 static const struct freq_tbl ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk[] = {
223 F(960000, P_XO, 10, 1, 2),
224 F(4800000, P_XO, 4, 0, 0),
225 F(9600000, P_XO, 2, 0, 0),
226 F(15000000, P_GPLL0, 10, 1, 4),
227 F(19200000, P_XO, 1, 0, 0),
228 F(25000000, P_GPLL0, 12, 1, 2),
229 F(50000000, P_GPLL0, 12, 0, 0),
233 static struct clk_rcg2 blsp1_qup1_spi_apps_clk_src = {
237 .parent_map = gcc_xo_gpll0_map,
238 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
239 .clkr.hw.init = &(struct clk_init_data){
240 .name = "blsp1_qup1_spi_apps_clk_src",
241 .parent_names = gcc_xo_gpll0,
243 .ops = &clk_rcg2_ops,
247 static struct clk_rcg2 blsp1_qup2_i2c_apps_clk_src = {
250 .parent_map = gcc_xo_gpll0_map,
251 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
252 .clkr.hw.init = &(struct clk_init_data){
253 .name = "blsp1_qup2_i2c_apps_clk_src",
254 .parent_names = gcc_xo_gpll0,
256 .ops = &clk_rcg2_ops,
260 static struct clk_rcg2 blsp1_qup2_spi_apps_clk_src = {
264 .parent_map = gcc_xo_gpll0_map,
265 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
266 .clkr.hw.init = &(struct clk_init_data){
267 .name = "blsp1_qup2_spi_apps_clk_src",
268 .parent_names = gcc_xo_gpll0,
270 .ops = &clk_rcg2_ops,
274 static struct clk_rcg2 blsp1_qup3_i2c_apps_clk_src = {
277 .parent_map = gcc_xo_gpll0_map,
278 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
279 .clkr.hw.init = &(struct clk_init_data){
280 .name = "blsp1_qup3_i2c_apps_clk_src",
281 .parent_names = gcc_xo_gpll0,
283 .ops = &clk_rcg2_ops,
287 static struct clk_rcg2 blsp1_qup3_spi_apps_clk_src = {
291 .parent_map = gcc_xo_gpll0_map,
292 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
293 .clkr.hw.init = &(struct clk_init_data){
294 .name = "blsp1_qup3_spi_apps_clk_src",
295 .parent_names = gcc_xo_gpll0,
297 .ops = &clk_rcg2_ops,
301 static struct clk_rcg2 blsp1_qup4_i2c_apps_clk_src = {
304 .parent_map = gcc_xo_gpll0_map,
305 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
306 .clkr.hw.init = &(struct clk_init_data){
307 .name = "blsp1_qup4_i2c_apps_clk_src",
308 .parent_names = gcc_xo_gpll0,
310 .ops = &clk_rcg2_ops,
314 static struct clk_rcg2 blsp1_qup4_spi_apps_clk_src = {
318 .parent_map = gcc_xo_gpll0_map,
319 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
320 .clkr.hw.init = &(struct clk_init_data){
321 .name = "blsp1_qup4_spi_apps_clk_src",
322 .parent_names = gcc_xo_gpll0,
324 .ops = &clk_rcg2_ops,
328 static struct clk_rcg2 blsp1_qup5_i2c_apps_clk_src = {
331 .parent_map = gcc_xo_gpll0_map,
332 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
333 .clkr.hw.init = &(struct clk_init_data){
334 .name = "blsp1_qup5_i2c_apps_clk_src",
335 .parent_names = gcc_xo_gpll0,
337 .ops = &clk_rcg2_ops,
341 static struct clk_rcg2 blsp1_qup5_spi_apps_clk_src = {
345 .parent_map = gcc_xo_gpll0_map,
346 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
347 .clkr.hw.init = &(struct clk_init_data){
348 .name = "blsp1_qup5_spi_apps_clk_src",
349 .parent_names = gcc_xo_gpll0,
351 .ops = &clk_rcg2_ops,
355 static struct clk_rcg2 blsp1_qup6_i2c_apps_clk_src = {
358 .parent_map = gcc_xo_gpll0_map,
359 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
360 .clkr.hw.init = &(struct clk_init_data){
361 .name = "blsp1_qup6_i2c_apps_clk_src",
362 .parent_names = gcc_xo_gpll0,
364 .ops = &clk_rcg2_ops,
368 static struct clk_rcg2 blsp1_qup6_spi_apps_clk_src = {
372 .parent_map = gcc_xo_gpll0_map,
373 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
374 .clkr.hw.init = &(struct clk_init_data){
375 .name = "blsp1_qup6_spi_apps_clk_src",
376 .parent_names = gcc_xo_gpll0,
378 .ops = &clk_rcg2_ops,
382 static const struct freq_tbl ftbl_gcc_blsp1_2_uart1_6_apps_clk[] = {
383 F(3686400, P_GPLL0, 1, 96, 15625),
384 F(7372800, P_GPLL0, 1, 192, 15625),
385 F(14745600, P_GPLL0, 1, 384, 15625),
386 F(16000000, P_GPLL0, 5, 2, 15),
387 F(19200000, P_XO, 1, 0, 0),
388 F(24000000, P_GPLL0, 5, 1, 5),
389 F(32000000, P_GPLL0, 1, 4, 75),
390 F(40000000, P_GPLL0, 15, 0, 0),
391 F(46400000, P_GPLL0, 1, 29, 375),
392 F(48000000, P_GPLL0, 12.5, 0, 0),
393 F(51200000, P_GPLL0, 1, 32, 375),
394 F(56000000, P_GPLL0, 1, 7, 75),
395 F(58982400, P_GPLL0, 1, 1536, 15625),
396 F(60000000, P_GPLL0, 10, 0, 0),
397 F(63160000, P_GPLL0, 9.5, 0, 0),
401 static struct clk_rcg2 blsp1_uart1_apps_clk_src = {
405 .parent_map = gcc_xo_gpll0_map,
406 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
407 .clkr.hw.init = &(struct clk_init_data){
408 .name = "blsp1_uart1_apps_clk_src",
409 .parent_names = gcc_xo_gpll0,
411 .ops = &clk_rcg2_ops,
415 static struct clk_rcg2 blsp1_uart2_apps_clk_src = {
419 .parent_map = gcc_xo_gpll0_map,
420 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
421 .clkr.hw.init = &(struct clk_init_data){
422 .name = "blsp1_uart2_apps_clk_src",
423 .parent_names = gcc_xo_gpll0,
425 .ops = &clk_rcg2_ops,
429 static struct clk_rcg2 blsp1_uart3_apps_clk_src = {
433 .parent_map = gcc_xo_gpll0_map,
434 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
435 .clkr.hw.init = &(struct clk_init_data){
436 .name = "blsp1_uart3_apps_clk_src",
437 .parent_names = gcc_xo_gpll0,
439 .ops = &clk_rcg2_ops,
443 static struct clk_rcg2 blsp1_uart4_apps_clk_src = {
447 .parent_map = gcc_xo_gpll0_map,
448 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
449 .clkr.hw.init = &(struct clk_init_data){
450 .name = "blsp1_uart4_apps_clk_src",
451 .parent_names = gcc_xo_gpll0,
453 .ops = &clk_rcg2_ops,
457 static struct clk_rcg2 blsp1_uart5_apps_clk_src = {
461 .parent_map = gcc_xo_gpll0_map,
462 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
463 .clkr.hw.init = &(struct clk_init_data){
464 .name = "blsp1_uart5_apps_clk_src",
465 .parent_names = gcc_xo_gpll0,
467 .ops = &clk_rcg2_ops,
471 static struct clk_rcg2 blsp1_uart6_apps_clk_src = {
475 .parent_map = gcc_xo_gpll0_map,
476 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
477 .clkr.hw.init = &(struct clk_init_data){
478 .name = "blsp1_uart6_apps_clk_src",
479 .parent_names = gcc_xo_gpll0,
481 .ops = &clk_rcg2_ops,
485 static struct clk_rcg2 blsp2_qup1_i2c_apps_clk_src = {
488 .parent_map = gcc_xo_gpll0_map,
489 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
490 .clkr.hw.init = &(struct clk_init_data){
491 .name = "blsp2_qup1_i2c_apps_clk_src",
492 .parent_names = gcc_xo_gpll0,
494 .ops = &clk_rcg2_ops,
498 static struct clk_rcg2 blsp2_qup1_spi_apps_clk_src = {
502 .parent_map = gcc_xo_gpll0_map,
503 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
504 .clkr.hw.init = &(struct clk_init_data){
505 .name = "blsp2_qup1_spi_apps_clk_src",
506 .parent_names = gcc_xo_gpll0,
508 .ops = &clk_rcg2_ops,
512 static struct clk_rcg2 blsp2_qup2_i2c_apps_clk_src = {
515 .parent_map = gcc_xo_gpll0_map,
516 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
517 .clkr.hw.init = &(struct clk_init_data){
518 .name = "blsp2_qup2_i2c_apps_clk_src",
519 .parent_names = gcc_xo_gpll0,
521 .ops = &clk_rcg2_ops,
525 static struct clk_rcg2 blsp2_qup2_spi_apps_clk_src = {
529 .parent_map = gcc_xo_gpll0_map,
530 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
531 .clkr.hw.init = &(struct clk_init_data){
532 .name = "blsp2_qup2_spi_apps_clk_src",
533 .parent_names = gcc_xo_gpll0,
535 .ops = &clk_rcg2_ops,
539 static struct clk_rcg2 blsp2_qup3_i2c_apps_clk_src = {
542 .parent_map = gcc_xo_gpll0_map,
543 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
544 .clkr.hw.init = &(struct clk_init_data){
545 .name = "blsp2_qup3_i2c_apps_clk_src",
546 .parent_names = gcc_xo_gpll0,
548 .ops = &clk_rcg2_ops,
552 static struct clk_rcg2 blsp2_qup3_spi_apps_clk_src = {
556 .parent_map = gcc_xo_gpll0_map,
557 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
558 .clkr.hw.init = &(struct clk_init_data){
559 .name = "blsp2_qup3_spi_apps_clk_src",
560 .parent_names = gcc_xo_gpll0,
562 .ops = &clk_rcg2_ops,
566 static struct clk_rcg2 blsp2_qup4_i2c_apps_clk_src = {
569 .parent_map = gcc_xo_gpll0_map,
570 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
571 .clkr.hw.init = &(struct clk_init_data){
572 .name = "blsp2_qup4_i2c_apps_clk_src",
573 .parent_names = gcc_xo_gpll0,
575 .ops = &clk_rcg2_ops,
579 static struct clk_rcg2 blsp2_qup4_spi_apps_clk_src = {
583 .parent_map = gcc_xo_gpll0_map,
584 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
585 .clkr.hw.init = &(struct clk_init_data){
586 .name = "blsp2_qup4_spi_apps_clk_src",
587 .parent_names = gcc_xo_gpll0,
589 .ops = &clk_rcg2_ops,
593 static struct clk_rcg2 blsp2_qup5_i2c_apps_clk_src = {
596 .parent_map = gcc_xo_gpll0_map,
597 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
598 .clkr.hw.init = &(struct clk_init_data){
599 .name = "blsp2_qup5_i2c_apps_clk_src",
600 .parent_names = gcc_xo_gpll0,
602 .ops = &clk_rcg2_ops,
606 static struct clk_rcg2 blsp2_qup5_spi_apps_clk_src = {
610 .parent_map = gcc_xo_gpll0_map,
611 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
612 .clkr.hw.init = &(struct clk_init_data){
613 .name = "blsp2_qup5_spi_apps_clk_src",
614 .parent_names = gcc_xo_gpll0,
616 .ops = &clk_rcg2_ops,
620 static struct clk_rcg2 blsp2_qup6_i2c_apps_clk_src = {
623 .parent_map = gcc_xo_gpll0_map,
624 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_i2c_apps_clk,
625 .clkr.hw.init = &(struct clk_init_data){
626 .name = "blsp2_qup6_i2c_apps_clk_src",
627 .parent_names = gcc_xo_gpll0,
629 .ops = &clk_rcg2_ops,
633 static struct clk_rcg2 blsp2_qup6_spi_apps_clk_src = {
637 .parent_map = gcc_xo_gpll0_map,
638 .freq_tbl = ftbl_gcc_blsp1_2_qup1_6_spi_apps_clk,
639 .clkr.hw.init = &(struct clk_init_data){
640 .name = "blsp2_qup6_spi_apps_clk_src",
641 .parent_names = gcc_xo_gpll0,
643 .ops = &clk_rcg2_ops,
647 static struct clk_rcg2 blsp2_uart1_apps_clk_src = {
651 .parent_map = gcc_xo_gpll0_map,
652 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
653 .clkr.hw.init = &(struct clk_init_data){
654 .name = "blsp2_uart1_apps_clk_src",
655 .parent_names = gcc_xo_gpll0,
657 .ops = &clk_rcg2_ops,
661 static struct clk_rcg2 blsp2_uart2_apps_clk_src = {
665 .parent_map = gcc_xo_gpll0_map,
666 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
667 .clkr.hw.init = &(struct clk_init_data){
668 .name = "blsp2_uart2_apps_clk_src",
669 .parent_names = gcc_xo_gpll0,
671 .ops = &clk_rcg2_ops,
675 static struct clk_rcg2 blsp2_uart3_apps_clk_src = {
679 .parent_map = gcc_xo_gpll0_map,
680 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
681 .clkr.hw.init = &(struct clk_init_data){
682 .name = "blsp2_uart3_apps_clk_src",
683 .parent_names = gcc_xo_gpll0,
685 .ops = &clk_rcg2_ops,
689 static struct clk_rcg2 blsp2_uart4_apps_clk_src = {
693 .parent_map = gcc_xo_gpll0_map,
694 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
695 .clkr.hw.init = &(struct clk_init_data){
696 .name = "blsp2_uart4_apps_clk_src",
697 .parent_names = gcc_xo_gpll0,
699 .ops = &clk_rcg2_ops,
703 static struct clk_rcg2 blsp2_uart5_apps_clk_src = {
707 .parent_map = gcc_xo_gpll0_map,
708 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
709 .clkr.hw.init = &(struct clk_init_data){
710 .name = "blsp2_uart5_apps_clk_src",
711 .parent_names = gcc_xo_gpll0,
713 .ops = &clk_rcg2_ops,
717 static struct clk_rcg2 blsp2_uart6_apps_clk_src = {
721 .parent_map = gcc_xo_gpll0_map,
722 .freq_tbl = ftbl_gcc_blsp1_2_uart1_6_apps_clk,
723 .clkr.hw.init = &(struct clk_init_data){
724 .name = "blsp2_uart6_apps_clk_src",
725 .parent_names = gcc_xo_gpll0,
727 .ops = &clk_rcg2_ops,
731 static const struct freq_tbl ftbl_gcc_ce1_clk[] = {
732 F(50000000, P_GPLL0, 12, 0, 0),
733 F(75000000, P_GPLL0, 8, 0, 0),
734 F(100000000, P_GPLL0, 6, 0, 0),
735 F(150000000, P_GPLL0, 4, 0, 0),
739 static struct clk_rcg2 ce1_clk_src = {
742 .parent_map = gcc_xo_gpll0_map,
743 .freq_tbl = ftbl_gcc_ce1_clk,
744 .clkr.hw.init = &(struct clk_init_data){
745 .name = "ce1_clk_src",
746 .parent_names = gcc_xo_gpll0,
748 .ops = &clk_rcg2_ops,
752 static const struct freq_tbl ftbl_gcc_ce2_clk[] = {
753 F(50000000, P_GPLL0, 12, 0, 0),
754 F(75000000, P_GPLL0, 8, 0, 0),
755 F(100000000, P_GPLL0, 6, 0, 0),
756 F(150000000, P_GPLL0, 4, 0, 0),
760 static struct clk_rcg2 ce2_clk_src = {
763 .parent_map = gcc_xo_gpll0_map,
764 .freq_tbl = ftbl_gcc_ce2_clk,
765 .clkr.hw.init = &(struct clk_init_data){
766 .name = "ce2_clk_src",
767 .parent_names = gcc_xo_gpll0,
769 .ops = &clk_rcg2_ops,
773 static const struct freq_tbl ftbl_gcc_gp_clk[] = {
774 F(4800000, P_XO, 4, 0, 0),
775 F(6000000, P_GPLL0, 10, 1, 10),
776 F(6750000, P_GPLL0, 1, 1, 89),
777 F(8000000, P_GPLL0, 15, 1, 5),
778 F(9600000, P_XO, 2, 0, 0),
779 F(16000000, P_GPLL0, 1, 2, 75),
780 F(19200000, P_XO, 1, 0, 0),
781 F(24000000, P_GPLL0, 5, 1, 5),
786 static struct clk_rcg2 gp1_clk_src = {
790 .parent_map = gcc_xo_gpll0_map,
791 .freq_tbl = ftbl_gcc_gp_clk,
792 .clkr.hw.init = &(struct clk_init_data){
793 .name = "gp1_clk_src",
794 .parent_names = gcc_xo_gpll0,
796 .ops = &clk_rcg2_ops,
800 static struct clk_rcg2 gp2_clk_src = {
804 .parent_map = gcc_xo_gpll0_map,
805 .freq_tbl = ftbl_gcc_gp_clk,
806 .clkr.hw.init = &(struct clk_init_data){
807 .name = "gp2_clk_src",
808 .parent_names = gcc_xo_gpll0,
810 .ops = &clk_rcg2_ops,
814 static struct clk_rcg2 gp3_clk_src = {
818 .parent_map = gcc_xo_gpll0_map,
819 .freq_tbl = ftbl_gcc_gp_clk,
820 .clkr.hw.init = &(struct clk_init_data){
821 .name = "gp3_clk_src",
822 .parent_names = gcc_xo_gpll0,
824 .ops = &clk_rcg2_ops,
828 static const struct freq_tbl ftbl_gcc_pdm2_clk[] = {
829 F(60000000, P_GPLL0, 10, 0, 0),
833 static struct clk_rcg2 pdm2_clk_src = {
836 .parent_map = gcc_xo_gpll0_map,
837 .freq_tbl = ftbl_gcc_pdm2_clk,
838 .clkr.hw.init = &(struct clk_init_data){
839 .name = "pdm2_clk_src",
840 .parent_names = gcc_xo_gpll0,
842 .ops = &clk_rcg2_ops,
846 static const struct freq_tbl ftbl_gcc_sdcc1_4_apps_clk[] = {
847 F(144000, P_XO, 16, 3, 25),
848 F(400000, P_XO, 12, 1, 4),
849 F(20000000, P_GPLL0, 15, 1, 2),
850 F(25000000, P_GPLL0, 12, 1, 2),
851 F(50000000, P_GPLL0, 12, 0, 0),
852 F(100000000, P_GPLL0, 6, 0, 0),
853 F(200000000, P_GPLL0, 3, 0, 0),
857 static const struct freq_tbl ftbl_gcc_sdcc1_apps_clk_pro[] = {
858 F(144000, P_XO, 16, 3, 25),
859 F(400000, P_XO, 12, 1, 4),
860 F(20000000, P_GPLL0, 15, 1, 2),
861 F(25000000, P_GPLL0, 12, 1, 2),
862 F(50000000, P_GPLL0, 12, 0, 0),
863 F(100000000, P_GPLL0, 6, 0, 0),
864 F(192000000, P_GPLL4, 4, 0, 0),
865 F(200000000, P_GPLL0, 3, 0, 0),
866 F(384000000, P_GPLL4, 2, 0, 0),
870 static struct clk_init_data sdcc1_apps_clk_src_init = {
871 .name = "sdcc1_apps_clk_src",
872 .parent_names = gcc_xo_gpll0,
874 .ops = &clk_rcg2_ops,
877 static struct clk_rcg2 sdcc1_apps_clk_src = {
881 .parent_map = gcc_xo_gpll0_map,
882 .freq_tbl = ftbl_gcc_sdcc1_4_apps_clk,
883 .clkr.hw.init = &sdcc1_apps_clk_src_init,
886 static struct clk_rcg2 sdcc2_apps_clk_src = {
890 .parent_map = gcc_xo_gpll0_map,
891 .freq_tbl = ftbl_gcc_sdcc1_4_apps_clk,
892 .clkr.hw.init = &(struct clk_init_data){
893 .name = "sdcc2_apps_clk_src",
894 .parent_names = gcc_xo_gpll0,
896 .ops = &clk_rcg2_ops,
900 static struct clk_rcg2 sdcc3_apps_clk_src = {
904 .parent_map = gcc_xo_gpll0_map,
905 .freq_tbl = ftbl_gcc_sdcc1_4_apps_clk,
906 .clkr.hw.init = &(struct clk_init_data){
907 .name = "sdcc3_apps_clk_src",
908 .parent_names = gcc_xo_gpll0,
910 .ops = &clk_rcg2_ops,
914 static struct clk_rcg2 sdcc4_apps_clk_src = {
918 .parent_map = gcc_xo_gpll0_map,
919 .freq_tbl = ftbl_gcc_sdcc1_4_apps_clk,
920 .clkr.hw.init = &(struct clk_init_data){
921 .name = "sdcc4_apps_clk_src",
922 .parent_names = gcc_xo_gpll0,
924 .ops = &clk_rcg2_ops,
928 static const struct freq_tbl ftbl_gcc_tsif_ref_clk[] = {
929 F(105000, P_XO, 2, 1, 91),
933 static struct clk_rcg2 tsif_ref_clk_src = {
937 .parent_map = gcc_xo_gpll0_map,
938 .freq_tbl = ftbl_gcc_tsif_ref_clk,
939 .clkr.hw.init = &(struct clk_init_data){
940 .name = "tsif_ref_clk_src",
941 .parent_names = gcc_xo_gpll0,
943 .ops = &clk_rcg2_ops,
947 static const struct freq_tbl ftbl_gcc_usb30_mock_utmi_clk[] = {
948 F(60000000, P_GPLL0, 10, 0, 0),
952 static struct clk_rcg2 usb30_mock_utmi_clk_src = {
955 .parent_map = gcc_xo_gpll0_map,
956 .freq_tbl = ftbl_gcc_usb30_mock_utmi_clk,
957 .clkr.hw.init = &(struct clk_init_data){
958 .name = "usb30_mock_utmi_clk_src",
959 .parent_names = gcc_xo_gpll0,
961 .ops = &clk_rcg2_ops,
965 static const struct freq_tbl ftbl_gcc_usb_hs_system_clk[] = {
966 F(60000000, P_GPLL0, 10, 0, 0),
967 F(75000000, P_GPLL0, 8, 0, 0),
971 static struct clk_rcg2 usb_hs_system_clk_src = {
974 .parent_map = gcc_xo_gpll0_map,
975 .freq_tbl = ftbl_gcc_usb_hs_system_clk,
976 .clkr.hw.init = &(struct clk_init_data){
977 .name = "usb_hs_system_clk_src",
978 .parent_names = gcc_xo_gpll0,
980 .ops = &clk_rcg2_ops,
984 static const struct freq_tbl ftbl_gcc_usb_hsic_clk[] = {
985 F(480000000, P_GPLL1, 1, 0, 0),
989 static const struct parent_map usb_hsic_clk_src_map[] = {
994 static struct clk_rcg2 usb_hsic_clk_src = {
997 .parent_map = usb_hsic_clk_src_map,
998 .freq_tbl = ftbl_gcc_usb_hsic_clk,
999 .clkr.hw.init = &(struct clk_init_data){
1000 .name = "usb_hsic_clk_src",
1001 .parent_names = (const char *[]){
1006 .ops = &clk_rcg2_ops,
1010 static const struct freq_tbl ftbl_gcc_usb_hsic_io_cal_clk[] = {
1011 F(9600000, P_XO, 2, 0, 0),
1015 static struct clk_rcg2 usb_hsic_io_cal_clk_src = {
1018 .parent_map = gcc_xo_gpll0_map,
1019 .freq_tbl = ftbl_gcc_usb_hsic_io_cal_clk,
1020 .clkr.hw.init = &(struct clk_init_data){
1021 .name = "usb_hsic_io_cal_clk_src",
1022 .parent_names = gcc_xo_gpll0,
1024 .ops = &clk_rcg2_ops,
1028 static const struct freq_tbl ftbl_gcc_usb_hsic_system_clk[] = {
1029 F(60000000, P_GPLL0, 10, 0, 0),
1030 F(75000000, P_GPLL0, 8, 0, 0),
1034 static struct clk_rcg2 usb_hsic_system_clk_src = {
1037 .parent_map = gcc_xo_gpll0_map,
1038 .freq_tbl = ftbl_gcc_usb_hsic_system_clk,
1039 .clkr.hw.init = &(struct clk_init_data){
1040 .name = "usb_hsic_system_clk_src",
1041 .parent_names = gcc_xo_gpll0,
1043 .ops = &clk_rcg2_ops,
1047 static struct clk_regmap gcc_mmss_gpll0_clk_src = {
1048 .enable_reg = 0x1484,
1049 .enable_mask = BIT(26),
1050 .hw.init = &(struct clk_init_data){
1051 .name = "mmss_gpll0_vote",
1052 .parent_names = (const char *[]){
1056 .ops = &clk_branch_simple_ops,
1060 static struct clk_branch gcc_bam_dma_ahb_clk = {
1062 .halt_check = BRANCH_HALT_VOTED,
1064 .enable_reg = 0x1484,
1065 .enable_mask = BIT(12),
1066 .hw.init = &(struct clk_init_data){
1067 .name = "gcc_bam_dma_ahb_clk",
1068 .parent_names = (const char *[]){
1069 "periph_noc_clk_src",
1072 .ops = &clk_branch2_ops,
1077 static struct clk_branch gcc_blsp1_ahb_clk = {
1079 .halt_check = BRANCH_HALT_VOTED,
1081 .enable_reg = 0x1484,
1082 .enable_mask = BIT(17),
1083 .hw.init = &(struct clk_init_data){
1084 .name = "gcc_blsp1_ahb_clk",
1085 .parent_names = (const char *[]){
1086 "periph_noc_clk_src",
1089 .ops = &clk_branch2_ops,
1094 static struct clk_branch gcc_blsp1_qup1_i2c_apps_clk = {
1097 .enable_reg = 0x0648,
1098 .enable_mask = BIT(0),
1099 .hw.init = &(struct clk_init_data){
1100 .name = "gcc_blsp1_qup1_i2c_apps_clk",
1101 .parent_names = (const char *[]){
1102 "blsp1_qup1_i2c_apps_clk_src",
1105 .flags = CLK_SET_RATE_PARENT,
1106 .ops = &clk_branch2_ops,
1111 static struct clk_branch gcc_blsp1_qup1_spi_apps_clk = {
1114 .enable_reg = 0x0644,
1115 .enable_mask = BIT(0),
1116 .hw.init = &(struct clk_init_data){
1117 .name = "gcc_blsp1_qup1_spi_apps_clk",
1118 .parent_names = (const char *[]){
1119 "blsp1_qup1_spi_apps_clk_src",
1122 .flags = CLK_SET_RATE_PARENT,
1123 .ops = &clk_branch2_ops,
1128 static struct clk_branch gcc_blsp1_qup2_i2c_apps_clk = {
1131 .enable_reg = 0x06c8,
1132 .enable_mask = BIT(0),
1133 .hw.init = &(struct clk_init_data){
1134 .name = "gcc_blsp1_qup2_i2c_apps_clk",
1135 .parent_names = (const char *[]){
1136 "blsp1_qup2_i2c_apps_clk_src",
1139 .flags = CLK_SET_RATE_PARENT,
1140 .ops = &clk_branch2_ops,
1145 static struct clk_branch gcc_blsp1_qup2_spi_apps_clk = {
1148 .enable_reg = 0x06c4,
1149 .enable_mask = BIT(0),
1150 .hw.init = &(struct clk_init_data){
1151 .name = "gcc_blsp1_qup2_spi_apps_clk",
1152 .parent_names = (const char *[]){
1153 "blsp1_qup2_spi_apps_clk_src",
1156 .flags = CLK_SET_RATE_PARENT,
1157 .ops = &clk_branch2_ops,
1162 static struct clk_branch gcc_blsp1_qup3_i2c_apps_clk = {
1165 .enable_reg = 0x0748,
1166 .enable_mask = BIT(0),
1167 .hw.init = &(struct clk_init_data){
1168 .name = "gcc_blsp1_qup3_i2c_apps_clk",
1169 .parent_names = (const char *[]){
1170 "blsp1_qup3_i2c_apps_clk_src",
1173 .flags = CLK_SET_RATE_PARENT,
1174 .ops = &clk_branch2_ops,
1179 static struct clk_branch gcc_blsp1_qup3_spi_apps_clk = {
1182 .enable_reg = 0x0744,
1183 .enable_mask = BIT(0),
1184 .hw.init = &(struct clk_init_data){
1185 .name = "gcc_blsp1_qup3_spi_apps_clk",
1186 .parent_names = (const char *[]){
1187 "blsp1_qup3_spi_apps_clk_src",
1190 .flags = CLK_SET_RATE_PARENT,
1191 .ops = &clk_branch2_ops,
1196 static struct clk_branch gcc_blsp1_qup4_i2c_apps_clk = {
1199 .enable_reg = 0x07c8,
1200 .enable_mask = BIT(0),
1201 .hw.init = &(struct clk_init_data){
1202 .name = "gcc_blsp1_qup4_i2c_apps_clk",
1203 .parent_names = (const char *[]){
1204 "blsp1_qup4_i2c_apps_clk_src",
1207 .flags = CLK_SET_RATE_PARENT,
1208 .ops = &clk_branch2_ops,
1213 static struct clk_branch gcc_blsp1_qup4_spi_apps_clk = {
1216 .enable_reg = 0x07c4,
1217 .enable_mask = BIT(0),
1218 .hw.init = &(struct clk_init_data){
1219 .name = "gcc_blsp1_qup4_spi_apps_clk",
1220 .parent_names = (const char *[]){
1221 "blsp1_qup4_spi_apps_clk_src",
1224 .flags = CLK_SET_RATE_PARENT,
1225 .ops = &clk_branch2_ops,
1230 static struct clk_branch gcc_blsp1_qup5_i2c_apps_clk = {
1233 .enable_reg = 0x0848,
1234 .enable_mask = BIT(0),
1235 .hw.init = &(struct clk_init_data){
1236 .name = "gcc_blsp1_qup5_i2c_apps_clk",
1237 .parent_names = (const char *[]){
1238 "blsp1_qup5_i2c_apps_clk_src",
1241 .flags = CLK_SET_RATE_PARENT,
1242 .ops = &clk_branch2_ops,
1247 static struct clk_branch gcc_blsp1_qup5_spi_apps_clk = {
1250 .enable_reg = 0x0844,
1251 .enable_mask = BIT(0),
1252 .hw.init = &(struct clk_init_data){
1253 .name = "gcc_blsp1_qup5_spi_apps_clk",
1254 .parent_names = (const char *[]){
1255 "blsp1_qup5_spi_apps_clk_src",
1258 .flags = CLK_SET_RATE_PARENT,
1259 .ops = &clk_branch2_ops,
1264 static struct clk_branch gcc_blsp1_qup6_i2c_apps_clk = {
1267 .enable_reg = 0x08c8,
1268 .enable_mask = BIT(0),
1269 .hw.init = &(struct clk_init_data){
1270 .name = "gcc_blsp1_qup6_i2c_apps_clk",
1271 .parent_names = (const char *[]){
1272 "blsp1_qup6_i2c_apps_clk_src",
1275 .flags = CLK_SET_RATE_PARENT,
1276 .ops = &clk_branch2_ops,
1281 static struct clk_branch gcc_blsp1_qup6_spi_apps_clk = {
1284 .enable_reg = 0x08c4,
1285 .enable_mask = BIT(0),
1286 .hw.init = &(struct clk_init_data){
1287 .name = "gcc_blsp1_qup6_spi_apps_clk",
1288 .parent_names = (const char *[]){
1289 "blsp1_qup6_spi_apps_clk_src",
1292 .flags = CLK_SET_RATE_PARENT,
1293 .ops = &clk_branch2_ops,
1298 static struct clk_branch gcc_blsp1_uart1_apps_clk = {
1301 .enable_reg = 0x0684,
1302 .enable_mask = BIT(0),
1303 .hw.init = &(struct clk_init_data){
1304 .name = "gcc_blsp1_uart1_apps_clk",
1305 .parent_names = (const char *[]){
1306 "blsp1_uart1_apps_clk_src",
1309 .flags = CLK_SET_RATE_PARENT,
1310 .ops = &clk_branch2_ops,
1315 static struct clk_branch gcc_blsp1_uart2_apps_clk = {
1318 .enable_reg = 0x0704,
1319 .enable_mask = BIT(0),
1320 .hw.init = &(struct clk_init_data){
1321 .name = "gcc_blsp1_uart2_apps_clk",
1322 .parent_names = (const char *[]){
1323 "blsp1_uart2_apps_clk_src",
1326 .flags = CLK_SET_RATE_PARENT,
1327 .ops = &clk_branch2_ops,
1332 static struct clk_branch gcc_blsp1_uart3_apps_clk = {
1335 .enable_reg = 0x0784,
1336 .enable_mask = BIT(0),
1337 .hw.init = &(struct clk_init_data){
1338 .name = "gcc_blsp1_uart3_apps_clk",
1339 .parent_names = (const char *[]){
1340 "blsp1_uart3_apps_clk_src",
1343 .flags = CLK_SET_RATE_PARENT,
1344 .ops = &clk_branch2_ops,
1349 static struct clk_branch gcc_blsp1_uart4_apps_clk = {
1352 .enable_reg = 0x0804,
1353 .enable_mask = BIT(0),
1354 .hw.init = &(struct clk_init_data){
1355 .name = "gcc_blsp1_uart4_apps_clk",
1356 .parent_names = (const char *[]){
1357 "blsp1_uart4_apps_clk_src",
1360 .flags = CLK_SET_RATE_PARENT,
1361 .ops = &clk_branch2_ops,
1366 static struct clk_branch gcc_blsp1_uart5_apps_clk = {
1369 .enable_reg = 0x0884,
1370 .enable_mask = BIT(0),
1371 .hw.init = &(struct clk_init_data){
1372 .name = "gcc_blsp1_uart5_apps_clk",
1373 .parent_names = (const char *[]){
1374 "blsp1_uart5_apps_clk_src",
1377 .flags = CLK_SET_RATE_PARENT,
1378 .ops = &clk_branch2_ops,
1383 static struct clk_branch gcc_blsp1_uart6_apps_clk = {
1386 .enable_reg = 0x0904,
1387 .enable_mask = BIT(0),
1388 .hw.init = &(struct clk_init_data){
1389 .name = "gcc_blsp1_uart6_apps_clk",
1390 .parent_names = (const char *[]){
1391 "blsp1_uart6_apps_clk_src",
1394 .flags = CLK_SET_RATE_PARENT,
1395 .ops = &clk_branch2_ops,
1400 static struct clk_branch gcc_blsp2_ahb_clk = {
1402 .halt_check = BRANCH_HALT_VOTED,
1404 .enable_reg = 0x1484,
1405 .enable_mask = BIT(15),
1406 .hw.init = &(struct clk_init_data){
1407 .name = "gcc_blsp2_ahb_clk",
1408 .parent_names = (const char *[]){
1409 "periph_noc_clk_src",
1412 .ops = &clk_branch2_ops,
1417 static struct clk_branch gcc_blsp2_qup1_i2c_apps_clk = {
1420 .enable_reg = 0x0988,
1421 .enable_mask = BIT(0),
1422 .hw.init = &(struct clk_init_data){
1423 .name = "gcc_blsp2_qup1_i2c_apps_clk",
1424 .parent_names = (const char *[]){
1425 "blsp2_qup1_i2c_apps_clk_src",
1428 .flags = CLK_SET_RATE_PARENT,
1429 .ops = &clk_branch2_ops,
1434 static struct clk_branch gcc_blsp2_qup1_spi_apps_clk = {
1437 .enable_reg = 0x0984,
1438 .enable_mask = BIT(0),
1439 .hw.init = &(struct clk_init_data){
1440 .name = "gcc_blsp2_qup1_spi_apps_clk",
1441 .parent_names = (const char *[]){
1442 "blsp2_qup1_spi_apps_clk_src",
1445 .flags = CLK_SET_RATE_PARENT,
1446 .ops = &clk_branch2_ops,
1451 static struct clk_branch gcc_blsp2_qup2_i2c_apps_clk = {
1454 .enable_reg = 0x0a08,
1455 .enable_mask = BIT(0),
1456 .hw.init = &(struct clk_init_data){
1457 .name = "gcc_blsp2_qup2_i2c_apps_clk",
1458 .parent_names = (const char *[]){
1459 "blsp2_qup2_i2c_apps_clk_src",
1462 .flags = CLK_SET_RATE_PARENT,
1463 .ops = &clk_branch2_ops,
1468 static struct clk_branch gcc_blsp2_qup2_spi_apps_clk = {
1471 .enable_reg = 0x0a04,
1472 .enable_mask = BIT(0),
1473 .hw.init = &(struct clk_init_data){
1474 .name = "gcc_blsp2_qup2_spi_apps_clk",
1475 .parent_names = (const char *[]){
1476 "blsp2_qup2_spi_apps_clk_src",
1479 .flags = CLK_SET_RATE_PARENT,
1480 .ops = &clk_branch2_ops,
1485 static struct clk_branch gcc_blsp2_qup3_i2c_apps_clk = {
1488 .enable_reg = 0x0a88,
1489 .enable_mask = BIT(0),
1490 .hw.init = &(struct clk_init_data){
1491 .name = "gcc_blsp2_qup3_i2c_apps_clk",
1492 .parent_names = (const char *[]){
1493 "blsp2_qup3_i2c_apps_clk_src",
1496 .flags = CLK_SET_RATE_PARENT,
1497 .ops = &clk_branch2_ops,
1502 static struct clk_branch gcc_blsp2_qup3_spi_apps_clk = {
1505 .enable_reg = 0x0a84,
1506 .enable_mask = BIT(0),
1507 .hw.init = &(struct clk_init_data){
1508 .name = "gcc_blsp2_qup3_spi_apps_clk",
1509 .parent_names = (const char *[]){
1510 "blsp2_qup3_spi_apps_clk_src",
1513 .flags = CLK_SET_RATE_PARENT,
1514 .ops = &clk_branch2_ops,
1519 static struct clk_branch gcc_blsp2_qup4_i2c_apps_clk = {
1522 .enable_reg = 0x0b08,
1523 .enable_mask = BIT(0),
1524 .hw.init = &(struct clk_init_data){
1525 .name = "gcc_blsp2_qup4_i2c_apps_clk",
1526 .parent_names = (const char *[]){
1527 "blsp2_qup4_i2c_apps_clk_src",
1530 .flags = CLK_SET_RATE_PARENT,
1531 .ops = &clk_branch2_ops,
1536 static struct clk_branch gcc_blsp2_qup4_spi_apps_clk = {
1539 .enable_reg = 0x0b04,
1540 .enable_mask = BIT(0),
1541 .hw.init = &(struct clk_init_data){
1542 .name = "gcc_blsp2_qup4_spi_apps_clk",
1543 .parent_names = (const char *[]){
1544 "blsp2_qup4_spi_apps_clk_src",
1547 .flags = CLK_SET_RATE_PARENT,
1548 .ops = &clk_branch2_ops,
1553 static struct clk_branch gcc_blsp2_qup5_i2c_apps_clk = {
1556 .enable_reg = 0x0b88,
1557 .enable_mask = BIT(0),
1558 .hw.init = &(struct clk_init_data){
1559 .name = "gcc_blsp2_qup5_i2c_apps_clk",
1560 .parent_names = (const char *[]){
1561 "blsp2_qup5_i2c_apps_clk_src",
1564 .flags = CLK_SET_RATE_PARENT,
1565 .ops = &clk_branch2_ops,
1570 static struct clk_branch gcc_blsp2_qup5_spi_apps_clk = {
1573 .enable_reg = 0x0b84,
1574 .enable_mask = BIT(0),
1575 .hw.init = &(struct clk_init_data){
1576 .name = "gcc_blsp2_qup5_spi_apps_clk",
1577 .parent_names = (const char *[]){
1578 "blsp2_qup5_spi_apps_clk_src",
1581 .flags = CLK_SET_RATE_PARENT,
1582 .ops = &clk_branch2_ops,
1587 static struct clk_branch gcc_blsp2_qup6_i2c_apps_clk = {
1590 .enable_reg = 0x0c08,
1591 .enable_mask = BIT(0),
1592 .hw.init = &(struct clk_init_data){
1593 .name = "gcc_blsp2_qup6_i2c_apps_clk",
1594 .parent_names = (const char *[]){
1595 "blsp2_qup6_i2c_apps_clk_src",
1598 .flags = CLK_SET_RATE_PARENT,
1599 .ops = &clk_branch2_ops,
1604 static struct clk_branch gcc_blsp2_qup6_spi_apps_clk = {
1607 .enable_reg = 0x0c04,
1608 .enable_mask = BIT(0),
1609 .hw.init = &(struct clk_init_data){
1610 .name = "gcc_blsp2_qup6_spi_apps_clk",
1611 .parent_names = (const char *[]){
1612 "blsp2_qup6_spi_apps_clk_src",
1615 .flags = CLK_SET_RATE_PARENT,
1616 .ops = &clk_branch2_ops,
1621 static struct clk_branch gcc_blsp2_uart1_apps_clk = {
1624 .enable_reg = 0x09c4,
1625 .enable_mask = BIT(0),
1626 .hw.init = &(struct clk_init_data){
1627 .name = "gcc_blsp2_uart1_apps_clk",
1628 .parent_names = (const char *[]){
1629 "blsp2_uart1_apps_clk_src",
1632 .flags = CLK_SET_RATE_PARENT,
1633 .ops = &clk_branch2_ops,
1638 static struct clk_branch gcc_blsp2_uart2_apps_clk = {
1641 .enable_reg = 0x0a44,
1642 .enable_mask = BIT(0),
1643 .hw.init = &(struct clk_init_data){
1644 .name = "gcc_blsp2_uart2_apps_clk",
1645 .parent_names = (const char *[]){
1646 "blsp2_uart2_apps_clk_src",
1649 .flags = CLK_SET_RATE_PARENT,
1650 .ops = &clk_branch2_ops,
1655 static struct clk_branch gcc_blsp2_uart3_apps_clk = {
1658 .enable_reg = 0x0ac4,
1659 .enable_mask = BIT(0),
1660 .hw.init = &(struct clk_init_data){
1661 .name = "gcc_blsp2_uart3_apps_clk",
1662 .parent_names = (const char *[]){
1663 "blsp2_uart3_apps_clk_src",
1666 .flags = CLK_SET_RATE_PARENT,
1667 .ops = &clk_branch2_ops,
1672 static struct clk_branch gcc_blsp2_uart4_apps_clk = {
1675 .enable_reg = 0x0b44,
1676 .enable_mask = BIT(0),
1677 .hw.init = &(struct clk_init_data){
1678 .name = "gcc_blsp2_uart4_apps_clk",
1679 .parent_names = (const char *[]){
1680 "blsp2_uart4_apps_clk_src",
1683 .flags = CLK_SET_RATE_PARENT,
1684 .ops = &clk_branch2_ops,
1689 static struct clk_branch gcc_blsp2_uart5_apps_clk = {
1692 .enable_reg = 0x0bc4,
1693 .enable_mask = BIT(0),
1694 .hw.init = &(struct clk_init_data){
1695 .name = "gcc_blsp2_uart5_apps_clk",
1696 .parent_names = (const char *[]){
1697 "blsp2_uart5_apps_clk_src",
1700 .flags = CLK_SET_RATE_PARENT,
1701 .ops = &clk_branch2_ops,
1706 static struct clk_branch gcc_blsp2_uart6_apps_clk = {
1709 .enable_reg = 0x0c44,
1710 .enable_mask = BIT(0),
1711 .hw.init = &(struct clk_init_data){
1712 .name = "gcc_blsp2_uart6_apps_clk",
1713 .parent_names = (const char *[]){
1714 "blsp2_uart6_apps_clk_src",
1717 .flags = CLK_SET_RATE_PARENT,
1718 .ops = &clk_branch2_ops,
1723 static struct clk_branch gcc_boot_rom_ahb_clk = {
1725 .halt_check = BRANCH_HALT_VOTED,
1727 .enable_reg = 0x1484,
1728 .enable_mask = BIT(10),
1729 .hw.init = &(struct clk_init_data){
1730 .name = "gcc_boot_rom_ahb_clk",
1731 .parent_names = (const char *[]){
1732 "config_noc_clk_src",
1735 .ops = &clk_branch2_ops,
1740 static struct clk_branch gcc_ce1_ahb_clk = {
1742 .halt_check = BRANCH_HALT_VOTED,
1744 .enable_reg = 0x1484,
1745 .enable_mask = BIT(3),
1746 .hw.init = &(struct clk_init_data){
1747 .name = "gcc_ce1_ahb_clk",
1748 .parent_names = (const char *[]){
1749 "config_noc_clk_src",
1752 .ops = &clk_branch2_ops,
1757 static struct clk_branch gcc_ce1_axi_clk = {
1759 .halt_check = BRANCH_HALT_VOTED,
1761 .enable_reg = 0x1484,
1762 .enable_mask = BIT(4),
1763 .hw.init = &(struct clk_init_data){
1764 .name = "gcc_ce1_axi_clk",
1765 .parent_names = (const char *[]){
1766 "system_noc_clk_src",
1769 .ops = &clk_branch2_ops,
1774 static struct clk_branch gcc_ce1_clk = {
1776 .halt_check = BRANCH_HALT_VOTED,
1778 .enable_reg = 0x1484,
1779 .enable_mask = BIT(5),
1780 .hw.init = &(struct clk_init_data){
1781 .name = "gcc_ce1_clk",
1782 .parent_names = (const char *[]){
1786 .flags = CLK_SET_RATE_PARENT,
1787 .ops = &clk_branch2_ops,
1792 static struct clk_branch gcc_ce2_ahb_clk = {
1794 .halt_check = BRANCH_HALT_VOTED,
1796 .enable_reg = 0x1484,
1797 .enable_mask = BIT(0),
1798 .hw.init = &(struct clk_init_data){
1799 .name = "gcc_ce2_ahb_clk",
1800 .parent_names = (const char *[]){
1801 "config_noc_clk_src",
1804 .ops = &clk_branch2_ops,
1809 static struct clk_branch gcc_ce2_axi_clk = {
1811 .halt_check = BRANCH_HALT_VOTED,
1813 .enable_reg = 0x1484,
1814 .enable_mask = BIT(1),
1815 .hw.init = &(struct clk_init_data){
1816 .name = "gcc_ce2_axi_clk",
1817 .parent_names = (const char *[]){
1818 "system_noc_clk_src",
1821 .ops = &clk_branch2_ops,
1826 static struct clk_branch gcc_ce2_clk = {
1828 .halt_check = BRANCH_HALT_VOTED,
1830 .enable_reg = 0x1484,
1831 .enable_mask = BIT(2),
1832 .hw.init = &(struct clk_init_data){
1833 .name = "gcc_ce2_clk",
1834 .parent_names = (const char *[]){
1838 .flags = CLK_SET_RATE_PARENT,
1839 .ops = &clk_branch2_ops,
1844 static struct clk_branch gcc_gp1_clk = {
1847 .enable_reg = 0x1900,
1848 .enable_mask = BIT(0),
1849 .hw.init = &(struct clk_init_data){
1850 .name = "gcc_gp1_clk",
1851 .parent_names = (const char *[]){
1855 .flags = CLK_SET_RATE_PARENT,
1856 .ops = &clk_branch2_ops,
1861 static struct clk_branch gcc_gp2_clk = {
1864 .enable_reg = 0x1940,
1865 .enable_mask = BIT(0),
1866 .hw.init = &(struct clk_init_data){
1867 .name = "gcc_gp2_clk",
1868 .parent_names = (const char *[]){
1872 .flags = CLK_SET_RATE_PARENT,
1873 .ops = &clk_branch2_ops,
1878 static struct clk_branch gcc_gp3_clk = {
1881 .enable_reg = 0x1980,
1882 .enable_mask = BIT(0),
1883 .hw.init = &(struct clk_init_data){
1884 .name = "gcc_gp3_clk",
1885 .parent_names = (const char *[]){
1889 .flags = CLK_SET_RATE_PARENT,
1890 .ops = &clk_branch2_ops,
1895 static struct clk_branch gcc_lpass_q6_axi_clk = {
1898 .enable_reg = 0x11c0,
1899 .enable_mask = BIT(0),
1900 .hw.init = &(struct clk_init_data){
1901 .name = "gcc_lpass_q6_axi_clk",
1902 .parent_names = (const char *[]){
1903 "system_noc_clk_src",
1906 .ops = &clk_branch2_ops,
1911 static struct clk_branch gcc_mmss_noc_cfg_ahb_clk = {
1914 .enable_reg = 0x024c,
1915 .enable_mask = BIT(0),
1916 .hw.init = &(struct clk_init_data){
1917 .name = "gcc_mmss_noc_cfg_ahb_clk",
1918 .parent_names = (const char *[]){
1919 "config_noc_clk_src",
1922 .ops = &clk_branch2_ops,
1923 .flags = CLK_IGNORE_UNUSED,
1928 static struct clk_branch gcc_ocmem_noc_cfg_ahb_clk = {
1931 .enable_reg = 0x0248,
1932 .enable_mask = BIT(0),
1933 .hw.init = &(struct clk_init_data){
1934 .name = "gcc_ocmem_noc_cfg_ahb_clk",
1935 .parent_names = (const char *[]){
1936 "config_noc_clk_src",
1939 .ops = &clk_branch2_ops,
1944 static struct clk_branch gcc_mss_cfg_ahb_clk = {
1947 .enable_reg = 0x0280,
1948 .enable_mask = BIT(0),
1949 .hw.init = &(struct clk_init_data){
1950 .name = "gcc_mss_cfg_ahb_clk",
1951 .parent_names = (const char *[]){
1952 "config_noc_clk_src",
1955 .ops = &clk_branch2_ops,
1960 static struct clk_branch gcc_mss_q6_bimc_axi_clk = {
1963 .enable_reg = 0x0284,
1964 .enable_mask = BIT(0),
1965 .hw.init = &(struct clk_init_data){
1966 .name = "gcc_mss_q6_bimc_axi_clk",
1967 .flags = CLK_IS_ROOT,
1968 .ops = &clk_branch2_ops,
1973 static struct clk_branch gcc_pdm2_clk = {
1976 .enable_reg = 0x0ccc,
1977 .enable_mask = BIT(0),
1978 .hw.init = &(struct clk_init_data){
1979 .name = "gcc_pdm2_clk",
1980 .parent_names = (const char *[]){
1984 .flags = CLK_SET_RATE_PARENT,
1985 .ops = &clk_branch2_ops,
1990 static struct clk_branch gcc_pdm_ahb_clk = {
1993 .enable_reg = 0x0cc4,
1994 .enable_mask = BIT(0),
1995 .hw.init = &(struct clk_init_data){
1996 .name = "gcc_pdm_ahb_clk",
1997 .parent_names = (const char *[]){
1998 "periph_noc_clk_src",
2001 .ops = &clk_branch2_ops,
2006 static struct clk_branch gcc_prng_ahb_clk = {
2008 .halt_check = BRANCH_HALT_VOTED,
2010 .enable_reg = 0x1484,
2011 .enable_mask = BIT(13),
2012 .hw.init = &(struct clk_init_data){
2013 .name = "gcc_prng_ahb_clk",
2014 .parent_names = (const char *[]){
2015 "periph_noc_clk_src",
2018 .ops = &clk_branch2_ops,
2023 static struct clk_branch gcc_sdcc1_ahb_clk = {
2026 .enable_reg = 0x04c8,
2027 .enable_mask = BIT(0),
2028 .hw.init = &(struct clk_init_data){
2029 .name = "gcc_sdcc1_ahb_clk",
2030 .parent_names = (const char *[]){
2031 "periph_noc_clk_src",
2034 .ops = &clk_branch2_ops,
2039 static struct clk_branch gcc_sdcc1_apps_clk = {
2042 .enable_reg = 0x04c4,
2043 .enable_mask = BIT(0),
2044 .hw.init = &(struct clk_init_data){
2045 .name = "gcc_sdcc1_apps_clk",
2046 .parent_names = (const char *[]){
2047 "sdcc1_apps_clk_src",
2050 .flags = CLK_SET_RATE_PARENT,
2051 .ops = &clk_branch2_ops,
2056 static struct clk_branch gcc_sdcc1_cdccal_ff_clk = {
2059 .enable_reg = 0x04e8,
2060 .enable_mask = BIT(0),
2061 .hw.init = &(struct clk_init_data){
2062 .name = "gcc_sdcc1_cdccal_ff_clk",
2063 .parent_names = (const char *[]){
2067 .ops = &clk_branch2_ops,
2072 static struct clk_branch gcc_sdcc1_cdccal_sleep_clk = {
2075 .enable_reg = 0x04e4,
2076 .enable_mask = BIT(0),
2077 .hw.init = &(struct clk_init_data){
2078 .name = "gcc_sdcc1_cdccal_sleep_clk",
2079 .parent_names = (const char *[]){
2083 .ops = &clk_branch2_ops,
2088 static struct clk_branch gcc_sdcc2_ahb_clk = {
2091 .enable_reg = 0x0508,
2092 .enable_mask = BIT(0),
2093 .hw.init = &(struct clk_init_data){
2094 .name = "gcc_sdcc2_ahb_clk",
2095 .parent_names = (const char *[]){
2096 "periph_noc_clk_src",
2099 .ops = &clk_branch2_ops,
2104 static struct clk_branch gcc_sdcc2_apps_clk = {
2107 .enable_reg = 0x0504,
2108 .enable_mask = BIT(0),
2109 .hw.init = &(struct clk_init_data){
2110 .name = "gcc_sdcc2_apps_clk",
2111 .parent_names = (const char *[]){
2112 "sdcc2_apps_clk_src",
2115 .flags = CLK_SET_RATE_PARENT,
2116 .ops = &clk_branch2_ops,
2121 static struct clk_branch gcc_sdcc3_ahb_clk = {
2124 .enable_reg = 0x0548,
2125 .enable_mask = BIT(0),
2126 .hw.init = &(struct clk_init_data){
2127 .name = "gcc_sdcc3_ahb_clk",
2128 .parent_names = (const char *[]){
2129 "periph_noc_clk_src",
2132 .ops = &clk_branch2_ops,
2137 static struct clk_branch gcc_sdcc3_apps_clk = {
2140 .enable_reg = 0x0544,
2141 .enable_mask = BIT(0),
2142 .hw.init = &(struct clk_init_data){
2143 .name = "gcc_sdcc3_apps_clk",
2144 .parent_names = (const char *[]){
2145 "sdcc3_apps_clk_src",
2148 .flags = CLK_SET_RATE_PARENT,
2149 .ops = &clk_branch2_ops,
2154 static struct clk_branch gcc_sdcc4_ahb_clk = {
2157 .enable_reg = 0x0588,
2158 .enable_mask = BIT(0),
2159 .hw.init = &(struct clk_init_data){
2160 .name = "gcc_sdcc4_ahb_clk",
2161 .parent_names = (const char *[]){
2162 "periph_noc_clk_src",
2165 .ops = &clk_branch2_ops,
2170 static struct clk_branch gcc_sdcc4_apps_clk = {
2173 .enable_reg = 0x0584,
2174 .enable_mask = BIT(0),
2175 .hw.init = &(struct clk_init_data){
2176 .name = "gcc_sdcc4_apps_clk",
2177 .parent_names = (const char *[]){
2178 "sdcc4_apps_clk_src",
2181 .flags = CLK_SET_RATE_PARENT,
2182 .ops = &clk_branch2_ops,
2187 static struct clk_branch gcc_sys_noc_usb3_axi_clk = {
2190 .enable_reg = 0x0108,
2191 .enable_mask = BIT(0),
2192 .hw.init = &(struct clk_init_data){
2193 .name = "gcc_sys_noc_usb3_axi_clk",
2194 .parent_names = (const char *[]){
2195 "usb30_master_clk_src",
2198 .flags = CLK_SET_RATE_PARENT,
2199 .ops = &clk_branch2_ops,
2204 static struct clk_branch gcc_tsif_ahb_clk = {
2207 .enable_reg = 0x0d84,
2208 .enable_mask = BIT(0),
2209 .hw.init = &(struct clk_init_data){
2210 .name = "gcc_tsif_ahb_clk",
2211 .parent_names = (const char *[]){
2212 "periph_noc_clk_src",
2215 .ops = &clk_branch2_ops,
2220 static struct clk_branch gcc_tsif_ref_clk = {
2223 .enable_reg = 0x0d88,
2224 .enable_mask = BIT(0),
2225 .hw.init = &(struct clk_init_data){
2226 .name = "gcc_tsif_ref_clk",
2227 .parent_names = (const char *[]){
2231 .flags = CLK_SET_RATE_PARENT,
2232 .ops = &clk_branch2_ops,
2237 static struct clk_branch gcc_usb2a_phy_sleep_clk = {
2240 .enable_reg = 0x04ac,
2241 .enable_mask = BIT(0),
2242 .hw.init = &(struct clk_init_data){
2243 .name = "gcc_usb2a_phy_sleep_clk",
2244 .parent_names = (const char *[]){
2248 .ops = &clk_branch2_ops,
2253 static struct clk_branch gcc_usb2b_phy_sleep_clk = {
2256 .enable_reg = 0x04b4,
2257 .enable_mask = BIT(0),
2258 .hw.init = &(struct clk_init_data){
2259 .name = "gcc_usb2b_phy_sleep_clk",
2260 .parent_names = (const char *[]){
2264 .ops = &clk_branch2_ops,
2269 static struct clk_branch gcc_usb30_master_clk = {
2272 .enable_reg = 0x03c8,
2273 .enable_mask = BIT(0),
2274 .hw.init = &(struct clk_init_data){
2275 .name = "gcc_usb30_master_clk",
2276 .parent_names = (const char *[]){
2277 "usb30_master_clk_src",
2280 .flags = CLK_SET_RATE_PARENT,
2281 .ops = &clk_branch2_ops,
2286 static struct clk_branch gcc_usb30_mock_utmi_clk = {
2289 .enable_reg = 0x03d0,
2290 .enable_mask = BIT(0),
2291 .hw.init = &(struct clk_init_data){
2292 .name = "gcc_usb30_mock_utmi_clk",
2293 .parent_names = (const char *[]){
2294 "usb30_mock_utmi_clk_src",
2297 .flags = CLK_SET_RATE_PARENT,
2298 .ops = &clk_branch2_ops,
2303 static struct clk_branch gcc_usb30_sleep_clk = {
2306 .enable_reg = 0x03cc,
2307 .enable_mask = BIT(0),
2308 .hw.init = &(struct clk_init_data){
2309 .name = "gcc_usb30_sleep_clk",
2310 .parent_names = (const char *[]){
2314 .ops = &clk_branch2_ops,
2319 static struct clk_branch gcc_usb_hs_ahb_clk = {
2322 .enable_reg = 0x0488,
2323 .enable_mask = BIT(0),
2324 .hw.init = &(struct clk_init_data){
2325 .name = "gcc_usb_hs_ahb_clk",
2326 .parent_names = (const char *[]){
2327 "periph_noc_clk_src",
2330 .ops = &clk_branch2_ops,
2335 static struct clk_branch gcc_usb_hs_system_clk = {
2338 .enable_reg = 0x0484,
2339 .enable_mask = BIT(0),
2340 .hw.init = &(struct clk_init_data){
2341 .name = "gcc_usb_hs_system_clk",
2342 .parent_names = (const char *[]){
2343 "usb_hs_system_clk_src",
2346 .flags = CLK_SET_RATE_PARENT,
2347 .ops = &clk_branch2_ops,
2352 static struct clk_branch gcc_usb_hsic_ahb_clk = {
2355 .enable_reg = 0x0408,
2356 .enable_mask = BIT(0),
2357 .hw.init = &(struct clk_init_data){
2358 .name = "gcc_usb_hsic_ahb_clk",
2359 .parent_names = (const char *[]){
2360 "periph_noc_clk_src",
2363 .ops = &clk_branch2_ops,
2368 static struct clk_branch gcc_usb_hsic_clk = {
2371 .enable_reg = 0x0410,
2372 .enable_mask = BIT(0),
2373 .hw.init = &(struct clk_init_data){
2374 .name = "gcc_usb_hsic_clk",
2375 .parent_names = (const char *[]){
2379 .flags = CLK_SET_RATE_PARENT,
2380 .ops = &clk_branch2_ops,
2385 static struct clk_branch gcc_usb_hsic_io_cal_clk = {
2388 .enable_reg = 0x0414,
2389 .enable_mask = BIT(0),
2390 .hw.init = &(struct clk_init_data){
2391 .name = "gcc_usb_hsic_io_cal_clk",
2392 .parent_names = (const char *[]){
2393 "usb_hsic_io_cal_clk_src",
2396 .flags = CLK_SET_RATE_PARENT,
2397 .ops = &clk_branch2_ops,
2402 static struct clk_branch gcc_usb_hsic_io_cal_sleep_clk = {
2405 .enable_reg = 0x0418,
2406 .enable_mask = BIT(0),
2407 .hw.init = &(struct clk_init_data){
2408 .name = "gcc_usb_hsic_io_cal_sleep_clk",
2409 .parent_names = (const char *[]){
2413 .ops = &clk_branch2_ops,
2418 static struct clk_branch gcc_usb_hsic_system_clk = {
2421 .enable_reg = 0x040c,
2422 .enable_mask = BIT(0),
2423 .hw.init = &(struct clk_init_data){
2424 .name = "gcc_usb_hsic_system_clk",
2425 .parent_names = (const char *[]){
2426 "usb_hsic_system_clk_src",
2429 .flags = CLK_SET_RATE_PARENT,
2430 .ops = &clk_branch2_ops,
2435 static struct clk_regmap *gcc_msm8974_clocks[] = {
2436 [GPLL0] = &gpll0.clkr,
2437 [GPLL0_VOTE] = &gpll0_vote,
2438 [CONFIG_NOC_CLK_SRC] = &config_noc_clk_src.clkr,
2439 [PERIPH_NOC_CLK_SRC] = &periph_noc_clk_src.clkr,
2440 [SYSTEM_NOC_CLK_SRC] = &system_noc_clk_src.clkr,
2441 [GPLL1] = &gpll1.clkr,
2442 [GPLL1_VOTE] = &gpll1_vote,
2443 [USB30_MASTER_CLK_SRC] = &usb30_master_clk_src.clkr,
2444 [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,
2445 [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr,
2446 [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr,
2447 [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr,
2448 [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr,
2449 [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr,
2450 [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr,
2451 [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr,
2452 [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr,
2453 [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr,
2454 [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr,
2455 [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr,
2456 [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr,
2457 [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr,
2458 [BLSP1_UART3_APPS_CLK_SRC] = &blsp1_uart3_apps_clk_src.clkr,
2459 [BLSP1_UART4_APPS_CLK_SRC] = &blsp1_uart4_apps_clk_src.clkr,
2460 [BLSP1_UART5_APPS_CLK_SRC] = &blsp1_uart5_apps_clk_src.clkr,
2461 [BLSP1_UART6_APPS_CLK_SRC] = &blsp1_uart6_apps_clk_src.clkr,
2462 [BLSP2_QUP1_I2C_APPS_CLK_SRC] = &blsp2_qup1_i2c_apps_clk_src.clkr,
2463 [BLSP2_QUP1_SPI_APPS_CLK_SRC] = &blsp2_qup1_spi_apps_clk_src.clkr,
2464 [BLSP2_QUP2_I2C_APPS_CLK_SRC] = &blsp2_qup2_i2c_apps_clk_src.clkr,
2465 [BLSP2_QUP2_SPI_APPS_CLK_SRC] = &blsp2_qup2_spi_apps_clk_src.clkr,
2466 [BLSP2_QUP3_I2C_APPS_CLK_SRC] = &blsp2_qup3_i2c_apps_clk_src.clkr,
2467 [BLSP2_QUP3_SPI_APPS_CLK_SRC] = &blsp2_qup3_spi_apps_clk_src.clkr,
2468 [BLSP2_QUP4_I2C_APPS_CLK_SRC] = &blsp2_qup4_i2c_apps_clk_src.clkr,
2469 [BLSP2_QUP4_SPI_APPS_CLK_SRC] = &blsp2_qup4_spi_apps_clk_src.clkr,
2470 [BLSP2_QUP5_I2C_APPS_CLK_SRC] = &blsp2_qup5_i2c_apps_clk_src.clkr,
2471 [BLSP2_QUP5_SPI_APPS_CLK_SRC] = &blsp2_qup5_spi_apps_clk_src.clkr,
2472 [BLSP2_QUP6_I2C_APPS_CLK_SRC] = &blsp2_qup6_i2c_apps_clk_src.clkr,
2473 [BLSP2_QUP6_SPI_APPS_CLK_SRC] = &blsp2_qup6_spi_apps_clk_src.clkr,
2474 [BLSP2_UART1_APPS_CLK_SRC] = &blsp2_uart1_apps_clk_src.clkr,
2475 [BLSP2_UART2_APPS_CLK_SRC] = &blsp2_uart2_apps_clk_src.clkr,
2476 [BLSP2_UART3_APPS_CLK_SRC] = &blsp2_uart3_apps_clk_src.clkr,
2477 [BLSP2_UART4_APPS_CLK_SRC] = &blsp2_uart4_apps_clk_src.clkr,
2478 [BLSP2_UART5_APPS_CLK_SRC] = &blsp2_uart5_apps_clk_src.clkr,
2479 [BLSP2_UART6_APPS_CLK_SRC] = &blsp2_uart6_apps_clk_src.clkr,
2480 [CE1_CLK_SRC] = &ce1_clk_src.clkr,
2481 [CE2_CLK_SRC] = &ce2_clk_src.clkr,
2482 [GP1_CLK_SRC] = &gp1_clk_src.clkr,
2483 [GP2_CLK_SRC] = &gp2_clk_src.clkr,
2484 [GP3_CLK_SRC] = &gp3_clk_src.clkr,
2485 [PDM2_CLK_SRC] = &pdm2_clk_src.clkr,
2486 [SDCC1_APPS_CLK_SRC] = &sdcc1_apps_clk_src.clkr,
2487 [SDCC2_APPS_CLK_SRC] = &sdcc2_apps_clk_src.clkr,
2488 [SDCC3_APPS_CLK_SRC] = &sdcc3_apps_clk_src.clkr,
2489 [SDCC4_APPS_CLK_SRC] = &sdcc4_apps_clk_src.clkr,
2490 [TSIF_REF_CLK_SRC] = &tsif_ref_clk_src.clkr,
2491 [USB30_MOCK_UTMI_CLK_SRC] = &usb30_mock_utmi_clk_src.clkr,
2492 [USB_HS_SYSTEM_CLK_SRC] = &usb_hs_system_clk_src.clkr,
2493 [USB_HSIC_CLK_SRC] = &usb_hsic_clk_src.clkr,
2494 [USB_HSIC_IO_CAL_CLK_SRC] = &usb_hsic_io_cal_clk_src.clkr,
2495 [USB_HSIC_SYSTEM_CLK_SRC] = &usb_hsic_system_clk_src.clkr,
2496 [GCC_BAM_DMA_AHB_CLK] = &gcc_bam_dma_ahb_clk.clkr,
2497 [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr,
2498 [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr,
2499 [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr,
2500 [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr,
2501 [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr,
2502 [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr,
2503 [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr,
2504 [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr,
2505 [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr,
2506 [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr,
2507 [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr,
2508 [GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr,
2509 [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr,
2510 [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr,
2511 [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr,
2512 [GCC_BLSP1_UART3_APPS_CLK] = &gcc_blsp1_uart3_apps_clk.clkr,
2513 [GCC_BLSP1_UART4_APPS_CLK] = &gcc_blsp1_uart4_apps_clk.clkr,
2514 [GCC_BLSP1_UART5_APPS_CLK] = &gcc_blsp1_uart5_apps_clk.clkr,
2515 [GCC_BLSP1_UART6_APPS_CLK] = &gcc_blsp1_uart6_apps_clk.clkr,
2516 [GCC_BLSP2_AHB_CLK] = &gcc_blsp2_ahb_clk.clkr,
2517 [GCC_BLSP2_QUP1_I2C_APPS_CLK] = &gcc_blsp2_qup1_i2c_apps_clk.clkr,
2518 [GCC_BLSP2_QUP1_SPI_APPS_CLK] = &gcc_blsp2_qup1_spi_apps_clk.clkr,
2519 [GCC_BLSP2_QUP2_I2C_APPS_CLK] = &gcc_blsp2_qup2_i2c_apps_clk.clkr,
2520 [GCC_BLSP2_QUP2_SPI_APPS_CLK] = &gcc_blsp2_qup2_spi_apps_clk.clkr,
2521 [GCC_BLSP2_QUP3_I2C_APPS_CLK] = &gcc_blsp2_qup3_i2c_apps_clk.clkr,
2522 [GCC_BLSP2_QUP3_SPI_APPS_CLK] = &gcc_blsp2_qup3_spi_apps_clk.clkr,
2523 [GCC_BLSP2_QUP4_I2C_APPS_CLK] = &gcc_blsp2_qup4_i2c_apps_clk.clkr,
2524 [GCC_BLSP2_QUP4_SPI_APPS_CLK] = &gcc_blsp2_qup4_spi_apps_clk.clkr,
2525 [GCC_BLSP2_QUP5_I2C_APPS_CLK] = &gcc_blsp2_qup5_i2c_apps_clk.clkr,
2526 [GCC_BLSP2_QUP5_SPI_APPS_CLK] = &gcc_blsp2_qup5_spi_apps_clk.clkr,
2527 [GCC_BLSP2_QUP6_I2C_APPS_CLK] = &gcc_blsp2_qup6_i2c_apps_clk.clkr,
2528 [GCC_BLSP2_QUP6_SPI_APPS_CLK] = &gcc_blsp2_qup6_spi_apps_clk.clkr,
2529 [GCC_BLSP2_UART1_APPS_CLK] = &gcc_blsp2_uart1_apps_clk.clkr,
2530 [GCC_BLSP2_UART2_APPS_CLK] = &gcc_blsp2_uart2_apps_clk.clkr,
2531 [GCC_BLSP2_UART3_APPS_CLK] = &gcc_blsp2_uart3_apps_clk.clkr,
2532 [GCC_BLSP2_UART4_APPS_CLK] = &gcc_blsp2_uart4_apps_clk.clkr,
2533 [GCC_BLSP2_UART5_APPS_CLK] = &gcc_blsp2_uart5_apps_clk.clkr,
2534 [GCC_BLSP2_UART6_APPS_CLK] = &gcc_blsp2_uart6_apps_clk.clkr,
2535 [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr,
2536 [GCC_CE1_AHB_CLK] = &gcc_ce1_ahb_clk.clkr,
2537 [GCC_CE1_AXI_CLK] = &gcc_ce1_axi_clk.clkr,
2538 [GCC_CE1_CLK] = &gcc_ce1_clk.clkr,
2539 [GCC_CE2_AHB_CLK] = &gcc_ce2_ahb_clk.clkr,
2540 [GCC_CE2_AXI_CLK] = &gcc_ce2_axi_clk.clkr,
2541 [GCC_CE2_CLK] = &gcc_ce2_clk.clkr,
2542 [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
2543 [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
2544 [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
2545 [GCC_LPASS_Q6_AXI_CLK] = &gcc_lpass_q6_axi_clk.clkr,
2546 [GCC_MMSS_NOC_CFG_AHB_CLK] = &gcc_mmss_noc_cfg_ahb_clk.clkr,
2547 [GCC_OCMEM_NOC_CFG_AHB_CLK] = &gcc_ocmem_noc_cfg_ahb_clk.clkr,
2548 [GCC_MSS_CFG_AHB_CLK] = &gcc_mss_cfg_ahb_clk.clkr,
2549 [GCC_MSS_Q6_BIMC_AXI_CLK] = &gcc_mss_q6_bimc_axi_clk.clkr,
2550 [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr,
2551 [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
2552 [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
2553 [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr,
2554 [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr,
2555 [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
2556 [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
2557 [GCC_SDCC3_AHB_CLK] = &gcc_sdcc3_ahb_clk.clkr,
2558 [GCC_SDCC3_APPS_CLK] = &gcc_sdcc3_apps_clk.clkr,
2559 [GCC_SDCC4_AHB_CLK] = &gcc_sdcc4_ahb_clk.clkr,
2560 [GCC_SDCC4_APPS_CLK] = &gcc_sdcc4_apps_clk.clkr,
2561 [GCC_SYS_NOC_USB3_AXI_CLK] = &gcc_sys_noc_usb3_axi_clk.clkr,
2562 [GCC_TSIF_AHB_CLK] = &gcc_tsif_ahb_clk.clkr,
2563 [GCC_TSIF_REF_CLK] = &gcc_tsif_ref_clk.clkr,
2564 [GCC_USB2A_PHY_SLEEP_CLK] = &gcc_usb2a_phy_sleep_clk.clkr,
2565 [GCC_USB2B_PHY_SLEEP_CLK] = &gcc_usb2b_phy_sleep_clk.clkr,
2566 [GCC_USB30_MASTER_CLK] = &gcc_usb30_master_clk.clkr,
2567 [GCC_USB30_MOCK_UTMI_CLK] = &gcc_usb30_mock_utmi_clk.clkr,
2568 [GCC_USB30_SLEEP_CLK] = &gcc_usb30_sleep_clk.clkr,
2569 [GCC_USB_HS_AHB_CLK] = &gcc_usb_hs_ahb_clk.clkr,
2570 [GCC_USB_HS_SYSTEM_CLK] = &gcc_usb_hs_system_clk.clkr,
2571 [GCC_USB_HSIC_AHB_CLK] = &gcc_usb_hsic_ahb_clk.clkr,
2572 [GCC_USB_HSIC_CLK] = &gcc_usb_hsic_clk.clkr,
2573 [GCC_USB_HSIC_IO_CAL_CLK] = &gcc_usb_hsic_io_cal_clk.clkr,
2574 [GCC_USB_HSIC_IO_CAL_SLEEP_CLK] = &gcc_usb_hsic_io_cal_sleep_clk.clkr,
2575 [GCC_USB_HSIC_SYSTEM_CLK] = &gcc_usb_hsic_system_clk.clkr,
2576 [GCC_MMSS_GPLL0_CLK_SRC] = &gcc_mmss_gpll0_clk_src,
2578 [GPLL4_VOTE] = NULL,
2579 [GCC_SDCC1_CDCCAL_SLEEP_CLK] = NULL,
2580 [GCC_SDCC1_CDCCAL_FF_CLK] = NULL,
2583 static const struct qcom_reset_map gcc_msm8974_resets[] = {
2584 [GCC_SYSTEM_NOC_BCR] = { 0x0100 },
2585 [GCC_CONFIG_NOC_BCR] = { 0x0140 },
2586 [GCC_PERIPH_NOC_BCR] = { 0x0180 },
2587 [GCC_IMEM_BCR] = { 0x0200 },
2588 [GCC_MMSS_BCR] = { 0x0240 },
2589 [GCC_QDSS_BCR] = { 0x0300 },
2590 [GCC_USB_30_BCR] = { 0x03c0 },
2591 [GCC_USB3_PHY_BCR] = { 0x03fc },
2592 [GCC_USB_HS_HSIC_BCR] = { 0x0400 },
2593 [GCC_USB_HS_BCR] = { 0x0480 },
2594 [GCC_USB2A_PHY_BCR] = { 0x04a8 },
2595 [GCC_USB2B_PHY_BCR] = { 0x04b0 },
2596 [GCC_SDCC1_BCR] = { 0x04c0 },
2597 [GCC_SDCC2_BCR] = { 0x0500 },
2598 [GCC_SDCC3_BCR] = { 0x0540 },
2599 [GCC_SDCC4_BCR] = { 0x0580 },
2600 [GCC_BLSP1_BCR] = { 0x05c0 },
2601 [GCC_BLSP1_QUP1_BCR] = { 0x0640 },
2602 [GCC_BLSP1_UART1_BCR] = { 0x0680 },
2603 [GCC_BLSP1_QUP2_BCR] = { 0x06c0 },
2604 [GCC_BLSP1_UART2_BCR] = { 0x0700 },
2605 [GCC_BLSP1_QUP3_BCR] = { 0x0740 },
2606 [GCC_BLSP1_UART3_BCR] = { 0x0780 },
2607 [GCC_BLSP1_QUP4_BCR] = { 0x07c0 },
2608 [GCC_BLSP1_UART4_BCR] = { 0x0800 },
2609 [GCC_BLSP1_QUP5_BCR] = { 0x0840 },
2610 [GCC_BLSP1_UART5_BCR] = { 0x0880 },
2611 [GCC_BLSP1_QUP6_BCR] = { 0x08c0 },
2612 [GCC_BLSP1_UART6_BCR] = { 0x0900 },
2613 [GCC_BLSP2_BCR] = { 0x0940 },
2614 [GCC_BLSP2_QUP1_BCR] = { 0x0980 },
2615 [GCC_BLSP2_UART1_BCR] = { 0x09c0 },
2616 [GCC_BLSP2_QUP2_BCR] = { 0x0a00 },
2617 [GCC_BLSP2_UART2_BCR] = { 0x0a40 },
2618 [GCC_BLSP2_QUP3_BCR] = { 0x0a80 },
2619 [GCC_BLSP2_UART3_BCR] = { 0x0ac0 },
2620 [GCC_BLSP2_QUP4_BCR] = { 0x0b00 },
2621 [GCC_BLSP2_UART4_BCR] = { 0x0b40 },
2622 [GCC_BLSP2_QUP5_BCR] = { 0x0b80 },
2623 [GCC_BLSP2_UART5_BCR] = { 0x0bc0 },
2624 [GCC_BLSP2_QUP6_BCR] = { 0x0c00 },
2625 [GCC_BLSP2_UART6_BCR] = { 0x0c40 },
2626 [GCC_PDM_BCR] = { 0x0cc0 },
2627 [GCC_BAM_DMA_BCR] = { 0x0d40 },
2628 [GCC_TSIF_BCR] = { 0x0d80 },
2629 [GCC_TCSR_BCR] = { 0x0dc0 },
2630 [GCC_BOOT_ROM_BCR] = { 0x0e00 },
2631 [GCC_MSG_RAM_BCR] = { 0x0e40 },
2632 [GCC_TLMM_BCR] = { 0x0e80 },
2633 [GCC_MPM_BCR] = { 0x0ec0 },
2634 [GCC_SEC_CTRL_BCR] = { 0x0f40 },
2635 [GCC_SPMI_BCR] = { 0x0fc0 },
2636 [GCC_SPDM_BCR] = { 0x1000 },
2637 [GCC_CE1_BCR] = { 0x1040 },
2638 [GCC_CE2_BCR] = { 0x1080 },
2639 [GCC_BIMC_BCR] = { 0x1100 },
2640 [GCC_MPM_NON_AHB_RESET] = { 0x0ec4, 2 },
2641 [GCC_MPM_AHB_RESET] = { 0x0ec4, 1 },
2642 [GCC_SNOC_BUS_TIMEOUT0_BCR] = { 0x1240 },
2643 [GCC_SNOC_BUS_TIMEOUT2_BCR] = { 0x1248 },
2644 [GCC_PNOC_BUS_TIMEOUT0_BCR] = { 0x1280 },
2645 [GCC_PNOC_BUS_TIMEOUT1_BCR] = { 0x1288 },
2646 [GCC_PNOC_BUS_TIMEOUT2_BCR] = { 0x1290 },
2647 [GCC_PNOC_BUS_TIMEOUT3_BCR] = { 0x1298 },
2648 [GCC_PNOC_BUS_TIMEOUT4_BCR] = { 0x12a0 },
2649 [GCC_CNOC_BUS_TIMEOUT0_BCR] = { 0x12c0 },
2650 [GCC_CNOC_BUS_TIMEOUT1_BCR] = { 0x12c8 },
2651 [GCC_CNOC_BUS_TIMEOUT2_BCR] = { 0x12d0 },
2652 [GCC_CNOC_BUS_TIMEOUT3_BCR] = { 0x12d8 },
2653 [GCC_CNOC_BUS_TIMEOUT4_BCR] = { 0x12e0 },
2654 [GCC_CNOC_BUS_TIMEOUT5_BCR] = { 0x12e8 },
2655 [GCC_CNOC_BUS_TIMEOUT6_BCR] = { 0x12f0 },
2656 [GCC_DEHR_BCR] = { 0x1300 },
2657 [GCC_RBCPR_BCR] = { 0x1380 },
2658 [GCC_MSS_RESTART] = { 0x1680 },
2659 [GCC_LPASS_RESTART] = { 0x16c0 },
2660 [GCC_WCSS_RESTART] = { 0x1700 },
2661 [GCC_VENUS_RESTART] = { 0x1740 },
2664 static const struct regmap_config gcc_msm8974_regmap_config = {
2668 .max_register = 0x1fc0,
2672 static const struct qcom_cc_desc gcc_msm8974_desc = {
2673 .config = &gcc_msm8974_regmap_config,
2674 .clks = gcc_msm8974_clocks,
2675 .num_clks = ARRAY_SIZE(gcc_msm8974_clocks),
2676 .resets = gcc_msm8974_resets,
2677 .num_resets = ARRAY_SIZE(gcc_msm8974_resets),
2680 static const struct of_device_id gcc_msm8974_match_table[] = {
2681 { .compatible = "qcom,gcc-msm8974" },
2682 { .compatible = "qcom,gcc-msm8974pro" , .data = (void *)1UL },
2683 { .compatible = "qcom,gcc-msm8974pro-ac", .data = (void *)1UL },
2686 MODULE_DEVICE_TABLE(of, gcc_msm8974_match_table);
2688 static void msm8974_pro_clock_override(void)
2690 sdcc1_apps_clk_src_init.parent_names = gcc_xo_gpll0_gpll4;
2691 sdcc1_apps_clk_src_init.num_parents = 3;
2692 sdcc1_apps_clk_src.freq_tbl = ftbl_gcc_sdcc1_apps_clk_pro;
2693 sdcc1_apps_clk_src.parent_map = gcc_xo_gpll0_gpll4_map;
2695 gcc_msm8974_clocks[GPLL4] = &gpll4.clkr;
2696 gcc_msm8974_clocks[GPLL4_VOTE] = &gpll4_vote;
2697 gcc_msm8974_clocks[GCC_SDCC1_CDCCAL_SLEEP_CLK] =
2698 &gcc_sdcc1_cdccal_sleep_clk.clkr;
2699 gcc_msm8974_clocks[GCC_SDCC1_CDCCAL_FF_CLK] =
2700 &gcc_sdcc1_cdccal_ff_clk.clkr;
2703 static int gcc_msm8974_probe(struct platform_device *pdev)
2706 struct device *dev = &pdev->dev;
2708 const struct of_device_id *id;
2710 id = of_match_device(gcc_msm8974_match_table, dev);
2716 msm8974_pro_clock_override();
2718 /* Temporary until RPM clocks supported */
2719 clk = clk_register_fixed_rate(dev, "xo", NULL, CLK_IS_ROOT, 19200000);
2721 return PTR_ERR(clk);
2723 /* Should move to DT node? */
2724 clk = clk_register_fixed_rate(dev, "sleep_clk_src", NULL,
2725 CLK_IS_ROOT, 32768);
2727 return PTR_ERR(clk);
2729 return qcom_cc_probe(pdev, &gcc_msm8974_desc);
2732 static int gcc_msm8974_remove(struct platform_device *pdev)
2734 qcom_cc_remove(pdev);
2738 static struct platform_driver gcc_msm8974_driver = {
2739 .probe = gcc_msm8974_probe,
2740 .remove = gcc_msm8974_remove,
2742 .name = "gcc-msm8974",
2743 .of_match_table = gcc_msm8974_match_table,
2747 static int __init gcc_msm8974_init(void)
2749 return platform_driver_register(&gcc_msm8974_driver);
2751 core_initcall(gcc_msm8974_init);
2753 static void __exit gcc_msm8974_exit(void)
2755 platform_driver_unregister(&gcc_msm8974_driver);
2757 module_exit(gcc_msm8974_exit);
2759 MODULE_DESCRIPTION("QCOM GCC MSM8974 Driver");
2760 MODULE_LICENSE("GPL v2");
2761 MODULE_ALIAS("platform:gcc-msm8974");