blob: f4cc1bd4d6e353244aac4cc1404c886fec050888 [file] [log] [blame]
Deepak Katragadda575a45f2016-10-11 15:06:56 -07001/*
Deepak Katragadda125fe372017-03-01 10:28:24 -08002 * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
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.
12 */
13
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>
19#include <linux/of.h>
20#include <linux/of_device.h>
21#include <linux/clk.h>
22#include <linux/clk-provider.h>
23#include <linux/regmap.h>
24#include <linux/reset-controller.h>
25
Kyle Yan6a20fae2017-02-14 13:34:41 -080026#include <dt-bindings/clock/qcom,gcc-sdm845.h>
Deepak Katragadda575a45f2016-10-11 15:06:56 -070027
28#include "common.h"
29#include "clk-regmap.h"
30#include "clk-pll.h"
31#include "clk-rcg.h"
32#include "clk-branch.h"
33#include "reset.h"
34#include "clk-alpha-pll.h"
Kyle Yan6a20fae2017-02-14 13:34:41 -080035#include "vdd-level-sdm845.h"
Deepak Katragadda575a45f2016-10-11 15:06:56 -070036
37#define GCC_APCS_CLOCK_SLEEP_ENA_VOTE_OFFSET 0x52008
38#define CPUSS_AHB_CLK_SLEEP_ENA BIT(21)
39#define GCC_MMSS_MISC 0x09FFC
40#define GCC_GPU_MISC 0x71028
41
42#define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
43
44static DEFINE_VDD_REGULATORS(vdd_cx, VDD_CX_NUM, 1, vdd_corner);
45static DEFINE_VDD_REGULATORS(vdd_cx_ao, VDD_CX_NUM, 1, vdd_corner);
46
47enum {
48 P_BI_TCXO,
49 P_AUD_REF_CLK,
50 P_CORE_BI_PLL_TEST_SE,
51 P_GPLL0_OUT_EVEN,
52 P_GPLL0_OUT_MAIN,
Deepak Katragadda575a45f2016-10-11 15:06:56 -070053 P_GPLL4_OUT_MAIN,
54 P_SLEEP_CLK,
55};
56
57static const struct parent_map gcc_parent_map_0[] = {
58 { P_BI_TCXO, 0 },
59 { P_GPLL0_OUT_MAIN, 1 },
60 { P_GPLL0_OUT_EVEN, 6 },
61 { P_CORE_BI_PLL_TEST_SE, 7 },
62};
63
64static const char * const gcc_parent_names_0[] = {
65 "bi_tcxo",
66 "gpll0",
67 "gpll0_out_even",
68 "core_bi_pll_test_se",
69};
70
71static const struct parent_map gcc_parent_map_1[] = {
72 { P_BI_TCXO, 0 },
73 { P_GPLL0_OUT_MAIN, 1 },
74 { P_SLEEP_CLK, 5 },
75 { P_GPLL0_OUT_EVEN, 6 },
76 { P_CORE_BI_PLL_TEST_SE, 7 },
77};
78
79static const char * const gcc_parent_names_1[] = {
80 "bi_tcxo",
81 "gpll0",
82 "core_pi_sleep_clk",
83 "gpll0_out_even",
84 "core_bi_pll_test_se",
85};
86
87static const struct parent_map gcc_parent_map_2[] = {
88 { P_BI_TCXO, 0 },
89 { P_SLEEP_CLK, 5 },
90 { P_CORE_BI_PLL_TEST_SE, 7 },
91};
92
93static const char * const gcc_parent_names_2[] = {
94 "bi_tcxo",
95 "core_pi_sleep_clk",
96 "core_bi_pll_test_se",
97};
98
99static const struct parent_map gcc_parent_map_3[] = {
100 { P_BI_TCXO, 0 },
101 { P_GPLL0_OUT_MAIN, 1 },
102 { P_CORE_BI_PLL_TEST_SE, 7 },
103};
104
105static const char * const gcc_parent_names_3[] = {
106 "bi_tcxo",
107 "gpll0",
108 "core_bi_pll_test_se",
109};
110
111static const struct parent_map gcc_parent_map_4[] = {
112 { P_BI_TCXO, 0 },
113 { P_CORE_BI_PLL_TEST_SE, 7 },
114};
115
116static const char * const gcc_parent_names_4[] = {
117 "bi_tcxo",
118 "core_bi_pll_test_se",
119};
120
121static const struct parent_map gcc_parent_map_5[] = {
122 { P_BI_TCXO, 0 },
123 { P_GPLL0_OUT_MAIN, 1 },
Deepak Katragadda125fe372017-03-01 10:28:24 -0800124 { P_GPLL4_OUT_MAIN, 5 },
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700125 { P_GPLL0_OUT_EVEN, 6 },
126 { P_CORE_BI_PLL_TEST_SE, 7 },
127};
128
129static const char * const gcc_parent_names_5[] = {
130 "bi_tcxo",
131 "gpll0",
Deepak Katragadda125fe372017-03-01 10:28:24 -0800132 "gpll4",
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700133 "gpll0_out_even",
134 "core_bi_pll_test_se",
135};
136
137static const struct parent_map gcc_parent_map_6[] = {
138 { P_BI_TCXO, 0 },
139 { P_GPLL0_OUT_MAIN, 1 },
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700140 { P_AUD_REF_CLK, 2 },
141 { P_GPLL0_OUT_EVEN, 6 },
142 { P_CORE_BI_PLL_TEST_SE, 7 },
143};
144
Deepak Katragadda125fe372017-03-01 10:28:24 -0800145static const char * const gcc_parent_names_6[] = {
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700146 "bi_tcxo",
147 "gpll0",
148 "aud_ref_clk",
149 "gpll0_out_even",
150 "core_bi_pll_test_se",
151};
152
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700153static struct pll_vco fabia_vco[] = {
154 { 250000000, 2000000000, 0 },
155 { 125000000, 1000000000, 1 },
156};
157
158static struct clk_alpha_pll gpll0 = {
159 .offset = 0x0,
160 .vco_table = fabia_vco,
161 .num_vco = ARRAY_SIZE(fabia_vco),
162 .type = FABIA_PLL,
163 .clkr = {
164 .enable_reg = 0x52000,
165 .enable_mask = BIT(0),
166 .hw.init = &(struct clk_init_data){
167 .name = "gpll0",
168 .parent_names = (const char *[]){ "bi_tcxo" },
169 .num_parents = 1,
170 .ops = &clk_fabia_fixed_pll_ops,
171 },
172 },
173};
174
175static const struct clk_div_table post_div_table_fabia_even[] = {
176 { 0x0, 1 },
177 { 0x1, 2 },
178 { 0x3, 4 },
179 { 0x7, 8 },
Stephen Boyd9e3b0a32017-03-07 05:30:31 -0800180 { }
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700181};
182
183static struct clk_alpha_pll_postdiv gpll0_out_even = {
184 .offset = 0x0,
185 .post_div_shift = 8,
186 .post_div_table = post_div_table_fabia_even,
187 .num_post_div = ARRAY_SIZE(post_div_table_fabia_even),
188 .width = 4,
189 .clkr.hw.init = &(struct clk_init_data){
190 .name = "gpll0_out_even",
191 .parent_names = (const char *[]){ "gpll0" },
192 .num_parents = 1,
193 .ops = &clk_generic_pll_postdiv_ops,
194 },
195};
196
197static struct clk_alpha_pll gpll1 = {
198 .offset = 0x1000,
199 .vco_table = fabia_vco,
200 .num_vco = ARRAY_SIZE(fabia_vco),
201 .type = FABIA_PLL,
202 .clkr = {
203 .enable_reg = 0x52000,
204 .enable_mask = BIT(1),
205 .hw.init = &(struct clk_init_data){
206 .name = "gpll1",
207 .parent_names = (const char *[]){ "bi_tcxo" },
208 .num_parents = 1,
209 .ops = &clk_fabia_fixed_pll_ops,
210 VDD_CX_FMAX_MAP1(MIN, 1066000000),
211 },
212 },
213};
214
215static const struct freq_tbl ftbl_gcc_cpuss_ahb_clk_src[] = {
216 F(19200000, P_BI_TCXO, 1, 0, 0),
217 F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
218 F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
219 { }
220};
221
222static struct clk_rcg2 gcc_cpuss_ahb_clk_src = {
223 .cmd_rcgr = 0x48014,
224 .mnd_width = 0,
225 .hid_width = 5,
226 .parent_map = gcc_parent_map_0,
227 .freq_tbl = ftbl_gcc_cpuss_ahb_clk_src,
228 .clkr.hw.init = &(struct clk_init_data){
229 .name = "gcc_cpuss_ahb_clk_src",
230 .parent_names = gcc_parent_names_0,
231 .num_parents = 4,
232 .flags = CLK_SET_RATE_PARENT,
233 .ops = &clk_rcg2_ops,
234 VDD_CX_FMAX_MAP3_AO(
235 MIN, 19200000,
236 LOW, 50000000,
237 NOMINAL, 100000000),
238 },
239};
240
241static const struct freq_tbl ftbl_gcc_cpuss_rbcpr_clk_src[] = {
242 F(19200000, P_BI_TCXO, 1, 0, 0),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700243 { }
244};
245
246static struct clk_rcg2 gcc_cpuss_rbcpr_clk_src = {
247 .cmd_rcgr = 0x4815c,
248 .mnd_width = 0,
249 .hid_width = 5,
250 .parent_map = gcc_parent_map_3,
251 .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
252 .clkr.hw.init = &(struct clk_init_data){
253 .name = "gcc_cpuss_rbcpr_clk_src",
254 .parent_names = gcc_parent_names_3,
255 .num_parents = 3,
256 .flags = CLK_SET_RATE_PARENT,
257 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800258 VDD_CX_FMAX_MAP1(
259 MIN, 19200000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700260 },
261};
262
263static const struct freq_tbl ftbl_gcc_gp1_clk_src[] = {
264 F(25000000, P_GPLL0_OUT_EVEN, 12, 0, 0),
265 F(50000000, P_GPLL0_OUT_EVEN, 6, 0, 0),
266 F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
267 F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
268 { }
269};
270
271static struct clk_rcg2 gcc_gp1_clk_src = {
272 .cmd_rcgr = 0x64004,
273 .mnd_width = 8,
274 .hid_width = 5,
275 .parent_map = gcc_parent_map_1,
276 .freq_tbl = ftbl_gcc_gp1_clk_src,
277 .clkr.hw.init = &(struct clk_init_data){
278 .name = "gcc_gp1_clk_src",
279 .parent_names = gcc_parent_names_1,
280 .num_parents = 5,
281 .flags = CLK_SET_RATE_PARENT,
282 .ops = &clk_rcg2_ops,
283 VDD_CX_FMAX_MAP4(
284 MIN, 19200000,
285 LOWER, 50000000,
286 LOW, 100000000,
287 NOMINAL, 200000000),
288 },
289};
290
291static struct clk_rcg2 gcc_gp2_clk_src = {
292 .cmd_rcgr = 0x65004,
293 .mnd_width = 8,
294 .hid_width = 5,
295 .parent_map = gcc_parent_map_1,
296 .freq_tbl = ftbl_gcc_gp1_clk_src,
297 .clkr.hw.init = &(struct clk_init_data){
298 .name = "gcc_gp2_clk_src",
299 .parent_names = gcc_parent_names_1,
300 .num_parents = 5,
301 .flags = CLK_SET_RATE_PARENT,
302 .ops = &clk_rcg2_ops,
303 VDD_CX_FMAX_MAP4(
304 MIN, 19200000,
305 LOWER, 50000000,
306 LOW, 100000000,
307 NOMINAL, 200000000),
308 },
309};
310
311static struct clk_rcg2 gcc_gp3_clk_src = {
312 .cmd_rcgr = 0x66004,
313 .mnd_width = 8,
314 .hid_width = 5,
315 .parent_map = gcc_parent_map_1,
316 .freq_tbl = ftbl_gcc_gp1_clk_src,
317 .clkr.hw.init = &(struct clk_init_data){
318 .name = "gcc_gp3_clk_src",
319 .parent_names = gcc_parent_names_1,
320 .num_parents = 5,
321 .flags = CLK_SET_RATE_PARENT,
322 .ops = &clk_rcg2_ops,
323 VDD_CX_FMAX_MAP4(
324 MIN, 19200000,
325 LOWER, 50000000,
326 LOW, 100000000,
327 NOMINAL, 200000000),
328 },
329};
330
331static const struct freq_tbl ftbl_gcc_mmss_qm_core_clk_src[] = {
332 F(75000000, P_GPLL0_OUT_EVEN, 4, 0, 0),
333 F(150000000, P_GPLL0_OUT_EVEN, 2, 0, 0),
334 F(300000000, P_GPLL0_OUT_MAIN, 2, 0, 0),
335 { }
336};
337
338static struct clk_rcg2 gcc_mmss_qm_core_clk_src = {
339 .cmd_rcgr = 0xb040,
340 .mnd_width = 0,
341 .hid_width = 5,
342 .parent_map = gcc_parent_map_0,
343 .freq_tbl = ftbl_gcc_mmss_qm_core_clk_src,
344 .clkr.hw.init = &(struct clk_init_data){
345 .name = "gcc_mmss_qm_core_clk_src",
346 .parent_names = gcc_parent_names_0,
347 .num_parents = 4,
348 .flags = CLK_SET_RATE_PARENT,
349 .ops = &clk_rcg2_ops,
350 VDD_CX_FMAX_MAP3(
351 MIN, 75000000,
352 LOWER, 150000000,
353 LOW, 300000000),
354 },
355};
356
357static const struct freq_tbl ftbl_gcc_pcie_0_aux_clk_src[] = {
358 F(9600000, P_BI_TCXO, 2, 0, 0),
359 F(19200000, P_BI_TCXO, 1, 0, 0),
360 { }
361};
362
363static struct clk_rcg2 gcc_pcie_0_aux_clk_src = {
364 .cmd_rcgr = 0x6b028,
365 .mnd_width = 16,
366 .hid_width = 5,
367 .parent_map = gcc_parent_map_2,
368 .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
369 .clkr.hw.init = &(struct clk_init_data){
370 .name = "gcc_pcie_0_aux_clk_src",
371 .parent_names = gcc_parent_names_2,
372 .num_parents = 3,
373 .flags = CLK_SET_RATE_PARENT,
374 .ops = &clk_rcg2_ops,
375 VDD_CX_FMAX_MAP2(
376 MIN, 9600000,
377 LOW, 19200000),
378 },
379};
380
381static struct clk_rcg2 gcc_pcie_1_aux_clk_src = {
382 .cmd_rcgr = 0x8d028,
383 .mnd_width = 16,
384 .hid_width = 5,
385 .parent_map = gcc_parent_map_2,
386 .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
387 .clkr.hw.init = &(struct clk_init_data){
388 .name = "gcc_pcie_1_aux_clk_src",
389 .parent_names = gcc_parent_names_2,
390 .num_parents = 3,
391 .flags = CLK_SET_RATE_PARENT,
392 .ops = &clk_rcg2_ops,
393 VDD_CX_FMAX_MAP2(
394 MIN, 9600000,
395 LOW, 19200000),
396 },
397};
398
399static const struct freq_tbl ftbl_gcc_pcie_phy_refgen_clk_src[] = {
400 F(19200000, P_BI_TCXO, 1, 0, 0),
401 F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
402 { }
403};
404
405static struct clk_rcg2 gcc_pcie_phy_refgen_clk_src = {
406 .cmd_rcgr = 0x6f014,
407 .mnd_width = 0,
408 .hid_width = 5,
409 .parent_map = gcc_parent_map_0,
410 .freq_tbl = ftbl_gcc_pcie_phy_refgen_clk_src,
411 .clkr.hw.init = &(struct clk_init_data){
412 .name = "gcc_pcie_phy_refgen_clk_src",
413 .parent_names = gcc_parent_names_0,
414 .num_parents = 4,
415 .flags = CLK_SET_RATE_PARENT,
416 .ops = &clk_rcg2_ops,
417 VDD_CX_FMAX_MAP2(
418 MIN, 19200000,
419 LOW, 100000000),
420 },
421};
422
423static const struct freq_tbl ftbl_gcc_pdm2_clk_src[] = {
424 F(19200000, P_BI_TCXO, 1, 0, 0),
425 F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
426 { }
427};
428
429static struct clk_rcg2 gcc_pdm2_clk_src = {
430 .cmd_rcgr = 0x33010,
431 .mnd_width = 0,
432 .hid_width = 5,
433 .parent_map = gcc_parent_map_0,
434 .freq_tbl = ftbl_gcc_pdm2_clk_src,
435 .clkr.hw.init = &(struct clk_init_data){
436 .name = "gcc_pdm2_clk_src",
437 .parent_names = gcc_parent_names_0,
438 .num_parents = 4,
439 .flags = CLK_SET_RATE_PARENT,
440 .ops = &clk_rcg2_ops,
441 VDD_CX_FMAX_MAP3(
442 MIN, 9600000,
443 LOWER, 19200000,
444 LOW, 60000000),
445 },
446};
447
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700448static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = {
Deepak Katragadda125fe372017-03-01 10:28:24 -0800449 F(7372800, P_GPLL0_OUT_EVEN, 1, 384, 15625),
450 F(14745600, P_GPLL0_OUT_EVEN, 1, 768, 15625),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700451 F(19200000, P_BI_TCXO, 1, 0, 0),
Deepak Katragadda125fe372017-03-01 10:28:24 -0800452 F(29491200, P_GPLL0_OUT_EVEN, 1, 1536, 15625),
453 F(32000000, P_GPLL0_OUT_EVEN, 1, 8, 75),
454 F(48000000, P_GPLL0_OUT_EVEN, 1, 4, 25),
455 F(64000000, P_GPLL0_OUT_EVEN, 1, 16, 75),
456 F(80000000, P_GPLL0_OUT_EVEN, 1, 4, 15),
457 F(96000000, P_GPLL0_OUT_EVEN, 1, 8, 25),
458 F(100000000, P_GPLL0_OUT_EVEN, 3, 0, 0),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700459 { }
460};
461
462static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = {
463 .cmd_rcgr = 0x17034,
464 .mnd_width = 16,
465 .hid_width = 5,
466 .parent_map = gcc_parent_map_0,
467 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
468 .enable_safe_config = true,
469 .clkr.hw.init = &(struct clk_init_data){
470 .name = "gcc_qupv3_wrap0_s0_clk_src",
471 .parent_names = gcc_parent_names_0,
472 .num_parents = 4,
473 .flags = CLK_SET_RATE_PARENT,
474 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800475 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700476 MIN, 19200000,
477 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800478 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700479 },
480};
481
482static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = {
483 .cmd_rcgr = 0x17164,
484 .mnd_width = 16,
485 .hid_width = 5,
486 .parent_map = gcc_parent_map_0,
487 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
488 .enable_safe_config = true,
489 .clkr.hw.init = &(struct clk_init_data){
490 .name = "gcc_qupv3_wrap0_s1_clk_src",
491 .parent_names = gcc_parent_names_0,
492 .num_parents = 4,
493 .flags = CLK_SET_RATE_PARENT,
494 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800495 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700496 MIN, 19200000,
497 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800498 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700499 },
500};
501
502static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = {
503 .cmd_rcgr = 0x17294,
504 .mnd_width = 16,
505 .hid_width = 5,
506 .parent_map = gcc_parent_map_0,
507 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
508 .enable_safe_config = true,
509 .clkr.hw.init = &(struct clk_init_data){
510 .name = "gcc_qupv3_wrap0_s2_clk_src",
511 .parent_names = gcc_parent_names_0,
512 .num_parents = 4,
513 .flags = CLK_SET_RATE_PARENT,
514 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800515 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700516 MIN, 19200000,
517 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800518 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700519 },
520};
521
522static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = {
523 .cmd_rcgr = 0x173c4,
524 .mnd_width = 16,
525 .hid_width = 5,
526 .parent_map = gcc_parent_map_0,
527 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
528 .enable_safe_config = true,
529 .clkr.hw.init = &(struct clk_init_data){
530 .name = "gcc_qupv3_wrap0_s3_clk_src",
531 .parent_names = gcc_parent_names_0,
532 .num_parents = 4,
533 .flags = CLK_SET_RATE_PARENT,
534 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800535 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700536 MIN, 19200000,
537 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800538 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700539 },
540};
541
542static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = {
543 .cmd_rcgr = 0x174f4,
544 .mnd_width = 16,
545 .hid_width = 5,
546 .parent_map = gcc_parent_map_0,
547 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
548 .enable_safe_config = true,
549 .clkr.hw.init = &(struct clk_init_data){
550 .name = "gcc_qupv3_wrap0_s4_clk_src",
551 .parent_names = gcc_parent_names_0,
552 .num_parents = 4,
553 .flags = CLK_SET_RATE_PARENT,
554 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800555 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700556 MIN, 19200000,
557 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800558 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700559 },
560};
561
562static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = {
563 .cmd_rcgr = 0x17624,
564 .mnd_width = 16,
565 .hid_width = 5,
566 .parent_map = gcc_parent_map_0,
567 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
568 .enable_safe_config = true,
569 .clkr.hw.init = &(struct clk_init_data){
570 .name = "gcc_qupv3_wrap0_s5_clk_src",
571 .parent_names = gcc_parent_names_0,
572 .num_parents = 4,
573 .flags = CLK_SET_RATE_PARENT,
574 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800575 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700576 MIN, 19200000,
577 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800578 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700579 },
580};
581
582static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = {
583 .cmd_rcgr = 0x17754,
584 .mnd_width = 16,
585 .hid_width = 5,
586 .parent_map = gcc_parent_map_0,
587 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
588 .enable_safe_config = true,
589 .clkr.hw.init = &(struct clk_init_data){
590 .name = "gcc_qupv3_wrap0_s6_clk_src",
591 .parent_names = gcc_parent_names_0,
592 .num_parents = 4,
593 .flags = CLK_SET_RATE_PARENT,
594 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800595 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700596 MIN, 19200000,
597 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800598 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700599 },
600};
601
602static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = {
603 .cmd_rcgr = 0x17884,
604 .mnd_width = 16,
605 .hid_width = 5,
606 .parent_map = gcc_parent_map_0,
607 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
608 .enable_safe_config = true,
609 .clkr.hw.init = &(struct clk_init_data){
610 .name = "gcc_qupv3_wrap0_s7_clk_src",
611 .parent_names = gcc_parent_names_0,
612 .num_parents = 4,
613 .flags = CLK_SET_RATE_PARENT,
614 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800615 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700616 MIN, 19200000,
617 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800618 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700619 },
620};
621
622static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
623 .cmd_rcgr = 0x18018,
624 .mnd_width = 16,
625 .hid_width = 5,
626 .parent_map = gcc_parent_map_0,
627 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
628 .enable_safe_config = true,
629 .clkr.hw.init = &(struct clk_init_data){
630 .name = "gcc_qupv3_wrap1_s0_clk_src",
631 .parent_names = gcc_parent_names_0,
632 .num_parents = 4,
633 .flags = CLK_SET_RATE_PARENT,
634 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800635 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700636 MIN, 19200000,
637 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800638 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700639 },
640};
641
642static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
643 .cmd_rcgr = 0x18148,
644 .mnd_width = 16,
645 .hid_width = 5,
646 .parent_map = gcc_parent_map_0,
647 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
648 .enable_safe_config = true,
649 .clkr.hw.init = &(struct clk_init_data){
650 .name = "gcc_qupv3_wrap1_s1_clk_src",
651 .parent_names = gcc_parent_names_0,
652 .num_parents = 4,
653 .flags = CLK_SET_RATE_PARENT,
654 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800655 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700656 MIN, 19200000,
657 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800658 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700659 },
660};
661
662static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = {
663 .cmd_rcgr = 0x18278,
664 .mnd_width = 16,
665 .hid_width = 5,
666 .parent_map = gcc_parent_map_0,
667 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
668 .enable_safe_config = true,
669 .clkr.hw.init = &(struct clk_init_data){
670 .name = "gcc_qupv3_wrap1_s2_clk_src",
671 .parent_names = gcc_parent_names_0,
672 .num_parents = 4,
673 .flags = CLK_SET_RATE_PARENT,
674 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800675 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700676 MIN, 19200000,
677 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800678 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700679 },
680};
681
682static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
683 .cmd_rcgr = 0x183a8,
684 .mnd_width = 16,
685 .hid_width = 5,
686 .parent_map = gcc_parent_map_0,
687 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
688 .enable_safe_config = true,
689 .clkr.hw.init = &(struct clk_init_data){
690 .name = "gcc_qupv3_wrap1_s3_clk_src",
691 .parent_names = gcc_parent_names_0,
692 .num_parents = 4,
693 .flags = CLK_SET_RATE_PARENT,
694 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800695 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700696 MIN, 19200000,
697 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800698 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700699 },
700};
701
702static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
703 .cmd_rcgr = 0x184d8,
704 .mnd_width = 16,
705 .hid_width = 5,
706 .parent_map = gcc_parent_map_0,
707 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
708 .enable_safe_config = true,
709 .clkr.hw.init = &(struct clk_init_data){
710 .name = "gcc_qupv3_wrap1_s4_clk_src",
711 .parent_names = gcc_parent_names_0,
712 .num_parents = 4,
713 .flags = CLK_SET_RATE_PARENT,
714 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800715 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700716 MIN, 19200000,
717 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800718 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700719 },
720};
721
722static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
723 .cmd_rcgr = 0x18608,
724 .mnd_width = 16,
725 .hid_width = 5,
726 .parent_map = gcc_parent_map_0,
727 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
728 .enable_safe_config = true,
729 .clkr.hw.init = &(struct clk_init_data){
730 .name = "gcc_qupv3_wrap1_s5_clk_src",
731 .parent_names = gcc_parent_names_0,
732 .num_parents = 4,
733 .flags = CLK_SET_RATE_PARENT,
734 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800735 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700736 MIN, 19200000,
737 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800738 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700739 },
740};
741
742static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
743 .cmd_rcgr = 0x18738,
744 .mnd_width = 16,
745 .hid_width = 5,
746 .parent_map = gcc_parent_map_0,
747 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
748 .enable_safe_config = true,
749 .clkr.hw.init = &(struct clk_init_data){
750 .name = "gcc_qupv3_wrap1_s6_clk_src",
751 .parent_names = gcc_parent_names_0,
752 .num_parents = 4,
753 .flags = CLK_SET_RATE_PARENT,
754 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800755 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700756 MIN, 19200000,
757 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800758 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700759 },
760};
761
762static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {
763 .cmd_rcgr = 0x18868,
764 .mnd_width = 16,
765 .hid_width = 5,
766 .parent_map = gcc_parent_map_0,
767 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
768 .enable_safe_config = true,
769 .clkr.hw.init = &(struct clk_init_data){
770 .name = "gcc_qupv3_wrap1_s7_clk_src",
771 .parent_names = gcc_parent_names_0,
772 .num_parents = 4,
773 .flags = CLK_SET_RATE_PARENT,
774 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800775 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700776 MIN, 19200000,
777 LOWER, 75000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800778 LOW, 100000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700779 },
780};
781
782static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = {
783 F(19200000, P_BI_TCXO, 1, 0, 0),
784 F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
785 F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
786 { }
787};
788
789static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
790 .cmd_rcgr = 0x1400c,
791 .mnd_width = 8,
792 .hid_width = 5,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800793 .parent_map = gcc_parent_map_5,
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700794 .freq_tbl = ftbl_gcc_sdcc2_apps_clk_src,
795 .enable_safe_config = true,
796 .clkr.hw.init = &(struct clk_init_data){
797 .name = "gcc_sdcc2_apps_clk_src",
Deepak Katragadda125fe372017-03-01 10:28:24 -0800798 .parent_names = gcc_parent_names_5,
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700799 .num_parents = 5,
800 .flags = CLK_SET_RATE_PARENT,
801 .ops = &clk_rcg2_ops,
802 VDD_CX_FMAX_MAP4(
803 MIN, 9600000,
804 LOWER, 19200000,
805 LOW, 100000000,
806 LOW_L1, 200000000),
807 },
808};
809
810static const struct freq_tbl ftbl_gcc_sdcc4_apps_clk_src[] = {
811 F(9600000, P_BI_TCXO, 2, 0, 0),
812 F(19200000, P_BI_TCXO, 1, 0, 0),
813 F(50000000, P_GPLL0_OUT_MAIN, 12, 0, 0),
814 F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
815 { }
816};
817
818static struct clk_rcg2 gcc_sdcc4_apps_clk_src = {
819 .cmd_rcgr = 0x1600c,
820 .mnd_width = 8,
821 .hid_width = 5,
822 .parent_map = gcc_parent_map_3,
823 .freq_tbl = ftbl_gcc_sdcc4_apps_clk_src,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800824 .enable_safe_config = true,
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700825 .clkr.hw.init = &(struct clk_init_data){
826 .name = "gcc_sdcc4_apps_clk_src",
827 .parent_names = gcc_parent_names_3,
828 .num_parents = 3,
829 .flags = CLK_SET_RATE_PARENT,
830 .ops = &clk_rcg2_ops,
831 VDD_CX_FMAX_MAP4(
832 MIN, 9600000,
833 LOWER, 19200000,
834 LOW, 50000000,
835 NOMINAL, 100000000),
836 },
837};
838
839static const struct freq_tbl ftbl_gcc_tsif_ref_clk_src[] = {
840 F(105495, P_BI_TCXO, 2, 1, 91),
841 { }
842};
843
844static struct clk_rcg2 gcc_tsif_ref_clk_src = {
845 .cmd_rcgr = 0x36010,
846 .mnd_width = 8,
847 .hid_width = 5,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800848 .parent_map = gcc_parent_map_6,
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700849 .freq_tbl = ftbl_gcc_tsif_ref_clk_src,
850 .clkr.hw.init = &(struct clk_init_data){
851 .name = "gcc_tsif_ref_clk_src",
Deepak Katragadda125fe372017-03-01 10:28:24 -0800852 .parent_names = gcc_parent_names_6,
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700853 .num_parents = 5,
854 .flags = CLK_SET_RATE_PARENT,
855 .ops = &clk_rcg2_ops,
856 VDD_CX_FMAX_MAP1(
857 MIN, 105495),
858 },
859};
860
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700861static struct clk_rcg2 gcc_ufs_card_axi_clk_src = {
862 .cmd_rcgr = 0x7501c,
863 .mnd_width = 8,
864 .hid_width = 5,
865 .parent_map = gcc_parent_map_0,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800866 .freq_tbl = ftbl_gcc_gp1_clk_src,
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700867 .enable_safe_config = true,
868 .clkr.hw.init = &(struct clk_init_data){
869 .name = "gcc_ufs_card_axi_clk_src",
870 .parent_names = gcc_parent_names_0,
871 .num_parents = 4,
872 .flags = CLK_SET_RATE_PARENT,
873 .ops = &clk_rcg2_ops,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800874 VDD_CX_FMAX_MAP3(
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700875 MIN, 50000000,
876 LOW, 100000000,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800877 NOMINAL, 200000000),
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700878 },
879};
880
881static const struct freq_tbl ftbl_gcc_ufs_card_ice_core_clk_src[] = {
882 F(37500000, P_GPLL0_OUT_EVEN, 8, 0, 0),
883 F(75000000, P_GPLL0_OUT_EVEN, 4, 0, 0),
884 F(150000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
885 F(300000000, P_GPLL0_OUT_MAIN, 2, 0, 0),
886 { }
887};
888
889static struct clk_rcg2 gcc_ufs_card_ice_core_clk_src = {
890 .cmd_rcgr = 0x7505c,
891 .mnd_width = 0,
892 .hid_width = 5,
893 .parent_map = gcc_parent_map_0,
894 .freq_tbl = ftbl_gcc_ufs_card_ice_core_clk_src,
895 .enable_safe_config = true,
896 .clkr.hw.init = &(struct clk_init_data){
897 .name = "gcc_ufs_card_ice_core_clk_src",
898 .parent_names = gcc_parent_names_0,
899 .num_parents = 4,
900 .flags = CLK_SET_RATE_PARENT,
901 .ops = &clk_rcg2_ops,
902 VDD_CX_FMAX_MAP3(
903 MIN, 75000000,
904 LOW, 150000000,
905 NOMINAL, 300000000),
906 },
907};
908
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700909static struct clk_rcg2 gcc_ufs_card_phy_aux_clk_src = {
910 .cmd_rcgr = 0x75090,
911 .mnd_width = 0,
912 .hid_width = 5,
913 .parent_map = gcc_parent_map_4,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800914 .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700915 .clkr.hw.init = &(struct clk_init_data){
916 .name = "gcc_ufs_card_phy_aux_clk_src",
917 .parent_names = gcc_parent_names_4,
918 .num_parents = 2,
919 .flags = CLK_SET_RATE_PARENT,
920 .ops = &clk_rcg2_ops,
921 VDD_CX_FMAX_MAP1(
922 MIN, 19200000),
923 },
924};
925
926static const struct freq_tbl ftbl_gcc_ufs_card_unipro_core_clk_src[] = {
927 F(37500000, P_GPLL0_OUT_EVEN, 8, 0, 0),
928 F(75000000, P_GPLL0_OUT_MAIN, 8, 0, 0),
929 F(150000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
930 { }
931};
932
933static struct clk_rcg2 gcc_ufs_card_unipro_core_clk_src = {
934 .cmd_rcgr = 0x75074,
935 .mnd_width = 0,
936 .hid_width = 5,
937 .parent_map = gcc_parent_map_0,
938 .freq_tbl = ftbl_gcc_ufs_card_unipro_core_clk_src,
939 .enable_safe_config = true,
940 .clkr.hw.init = &(struct clk_init_data){
941 .name = "gcc_ufs_card_unipro_core_clk_src",
942 .parent_names = gcc_parent_names_0,
943 .num_parents = 4,
944 .flags = CLK_SET_RATE_PARENT,
945 .ops = &clk_rcg2_ops,
946 VDD_CX_FMAX_MAP3(
947 MIN, 37500000,
948 LOW, 75000000,
949 NOMINAL, 150000000),
950 },
951};
952
Deepak Katragadda125fe372017-03-01 10:28:24 -0800953static const struct freq_tbl ftbl_gcc_ufs_phy_axi_clk_src[] = {
954 F(25000000, P_GPLL0_OUT_EVEN, 12, 0, 0),
955 F(50000000, P_GPLL0_OUT_EVEN, 6, 0, 0),
956 F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
957 F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
958 F(240000000, P_GPLL0_OUT_MAIN, 2.5, 0, 0),
959 { }
960};
961
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700962static struct clk_rcg2 gcc_ufs_phy_axi_clk_src = {
963 .cmd_rcgr = 0x7701c,
964 .mnd_width = 8,
965 .hid_width = 5,
966 .parent_map = gcc_parent_map_0,
Deepak Katragadda125fe372017-03-01 10:28:24 -0800967 .freq_tbl = ftbl_gcc_ufs_phy_axi_clk_src,
Deepak Katragadda575a45f2016-10-11 15:06:56 -0700968 .enable_safe_config = true,
969 .clkr.hw.init = &(struct clk_init_data){
970 .name = "gcc_ufs_phy_axi_clk_src",
971 .parent_names = gcc_parent_names_0,
972 .num_parents = 4,
973 .flags = CLK_SET_RATE_PARENT,
974 .ops = &clk_rcg2_ops,
975 VDD_CX_FMAX_MAP4(
976 MIN, 50000000,
977 LOW, 100000000,
978 NOMINAL, 200000000,
979 HIGH, 240000000),
980 },
981};
982
983static struct clk_rcg2 gcc_ufs_phy_ice_core_clk_src = {
984 .cmd_rcgr = 0x7705c,
985 .mnd_width = 0,
986 .hid_width = 5,
987 .parent_map = gcc_parent_map_0,
988 .freq_tbl = ftbl_gcc_ufs_card_ice_core_clk_src,
989 .enable_safe_config = true,
990 .clkr.hw.init = &(struct clk_init_data){
991 .name = "gcc_ufs_phy_ice_core_clk_src",
992 .parent_names = gcc_parent_names_0,
993 .num_parents = 4,
994 .flags = CLK_SET_RATE_PARENT,
995 .ops = &clk_rcg2_ops,
996 VDD_CX_FMAX_MAP3(
997 MIN, 75000000,
998 LOW, 150000000,
999 NOMINAL, 300000000),
1000 },
1001};
1002
1003static struct clk_rcg2 gcc_ufs_phy_phy_aux_clk_src = {
1004 .cmd_rcgr = 0x77090,
1005 .mnd_width = 0,
1006 .hid_width = 5,
1007 .parent_map = gcc_parent_map_4,
1008 .freq_tbl = ftbl_gcc_pcie_0_aux_clk_src,
1009 .clkr.hw.init = &(struct clk_init_data){
1010 .name = "gcc_ufs_phy_phy_aux_clk_src",
1011 .parent_names = gcc_parent_names_4,
1012 .num_parents = 2,
1013 .flags = CLK_SET_RATE_PARENT,
1014 .ops = &clk_rcg2_ops,
1015 VDD_CX_FMAX_MAP1(
1016 MIN, 19200000),
1017 },
1018};
1019
1020static struct clk_rcg2 gcc_ufs_phy_unipro_core_clk_src = {
1021 .cmd_rcgr = 0x77074,
1022 .mnd_width = 0,
1023 .hid_width = 5,
1024 .parent_map = gcc_parent_map_0,
1025 .freq_tbl = ftbl_gcc_ufs_card_unipro_core_clk_src,
1026 .clkr.hw.init = &(struct clk_init_data){
1027 .name = "gcc_ufs_phy_unipro_core_clk_src",
1028 .parent_names = gcc_parent_names_0,
1029 .num_parents = 4,
1030 .flags = CLK_SET_RATE_PARENT,
1031 .ops = &clk_rcg2_ops,
1032 VDD_CX_FMAX_MAP3(
1033 MIN, 37500000,
1034 LOW, 75000000,
1035 NOMINAL, 150000000),
1036 },
1037};
1038
1039static const struct freq_tbl ftbl_gcc_usb30_prim_master_clk_src[] = {
1040 F(33333333, P_GPLL0_OUT_EVEN, 9, 0, 0),
1041 F(66666667, P_GPLL0_OUT_EVEN, 4.5, 0, 0),
1042 F(133333333, P_GPLL0_OUT_MAIN, 4.5, 0, 0),
1043 F(200000000, P_GPLL0_OUT_MAIN, 3, 0, 0),
1044 F(240000000, P_GPLL0_OUT_MAIN, 2.5, 0, 0),
1045 { }
1046};
1047
1048static struct clk_rcg2 gcc_usb30_prim_master_clk_src = {
1049 .cmd_rcgr = 0xf018,
1050 .mnd_width = 8,
1051 .hid_width = 5,
1052 .parent_map = gcc_parent_map_0,
1053 .freq_tbl = ftbl_gcc_usb30_prim_master_clk_src,
1054 .enable_safe_config = true,
1055 .clkr.hw.init = &(struct clk_init_data){
1056 .name = "gcc_usb30_prim_master_clk_src",
1057 .parent_names = gcc_parent_names_0,
1058 .num_parents = 4,
1059 .flags = CLK_SET_RATE_PARENT,
1060 .ops = &clk_rcg2_ops,
1061 VDD_CX_FMAX_MAP5(
1062 MIN, 33333333,
1063 LOWER, 66666667,
1064 LOW, 133333333,
1065 NOMINAL, 200000000,
1066 HIGH, 240000000),
1067 },
1068};
1069
1070static const struct freq_tbl ftbl_gcc_usb30_prim_mock_utmi_clk_src[] = {
1071 F(20000000, P_GPLL0_OUT_EVEN, 15, 0, 0),
1072 F(40000000, P_GPLL0_OUT_EVEN, 7.5, 0, 0),
1073 F(60000000, P_GPLL0_OUT_MAIN, 10, 0, 0),
1074 { }
1075};
1076
1077static struct clk_rcg2 gcc_usb30_prim_mock_utmi_clk_src = {
1078 .cmd_rcgr = 0xf030,
1079 .mnd_width = 0,
1080 .hid_width = 5,
1081 .parent_map = gcc_parent_map_0,
1082 .freq_tbl = ftbl_gcc_usb30_prim_mock_utmi_clk_src,
1083 .enable_safe_config = true,
1084 .clkr.hw.init = &(struct clk_init_data){
1085 .name = "gcc_usb30_prim_mock_utmi_clk_src",
1086 .parent_names = gcc_parent_names_0,
1087 .num_parents = 4,
1088 .flags = CLK_SET_RATE_PARENT,
1089 .ops = &clk_rcg2_ops,
1090 VDD_CX_FMAX_MAP3(
1091 MIN, 19200000,
1092 LOWER, 40000000,
1093 LOW, 60000000),
1094 },
1095};
1096
1097static struct clk_rcg2 gcc_usb30_sec_master_clk_src = {
1098 .cmd_rcgr = 0x10018,
1099 .mnd_width = 8,
1100 .hid_width = 5,
1101 .parent_map = gcc_parent_map_0,
1102 .freq_tbl = ftbl_gcc_usb30_prim_master_clk_src,
1103 .clkr.hw.init = &(struct clk_init_data){
1104 .name = "gcc_usb30_sec_master_clk_src",
1105 .parent_names = gcc_parent_names_0,
1106 .num_parents = 4,
1107 .flags = CLK_SET_RATE_PARENT,
1108 .ops = &clk_rcg2_ops,
1109 VDD_CX_FMAX_MAP5(
1110 MIN, 33333333,
1111 LOWER, 66666667,
1112 LOW, 133333333,
1113 NOMINAL, 200000000,
1114 HIGH, 240000000),
1115 },
1116};
1117
1118static struct clk_rcg2 gcc_usb30_sec_mock_utmi_clk_src = {
1119 .cmd_rcgr = 0x10030,
1120 .mnd_width = 0,
1121 .hid_width = 5,
1122 .parent_map = gcc_parent_map_0,
1123 .freq_tbl = ftbl_gcc_usb30_prim_mock_utmi_clk_src,
1124 .clkr.hw.init = &(struct clk_init_data){
1125 .name = "gcc_usb30_sec_mock_utmi_clk_src",
1126 .parent_names = gcc_parent_names_0,
1127 .num_parents = 4,
1128 .flags = CLK_SET_RATE_PARENT,
1129 .ops = &clk_rcg2_ops,
1130 VDD_CX_FMAX_MAP3(
1131 MIN, 19200000,
1132 LOWER, 40000000,
1133 LOW, 60000000),
1134 },
1135};
1136
1137static struct clk_rcg2 gcc_usb3_prim_phy_aux_clk_src = {
1138 .cmd_rcgr = 0xf05c,
1139 .mnd_width = 0,
1140 .hid_width = 5,
1141 .parent_map = gcc_parent_map_2,
Deepak Katragadda125fe372017-03-01 10:28:24 -08001142 .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
Deepak Katragadda575a45f2016-10-11 15:06:56 -07001143 .clkr.hw.init = &(struct clk_init_data){
1144 .name = "gcc_usb3_prim_phy_aux_clk_src",
1145 .parent_names = gcc_parent_names_2,
1146 .num_parents = 3,
1147 .flags = CLK_SET_RATE_PARENT,
1148 .ops = &clk_rcg2_ops,
1149 VDD_CX_FMAX_MAP1(
1150 MIN, 19200000),
1151 },
1152};
1153
1154static struct clk_rcg2 gcc_usb3_sec_phy_aux_clk_src = {
1155 .cmd_rcgr = 0x1005c,
1156 .mnd_width = 0,
1157 .hid_width = 5,
1158 .parent_map = gcc_parent_map_2,
Deepak Katragadda125fe372017-03-01 10:28:24 -08001159 .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
Deepak Katragadda575a45f2016-10-11 15:06:56 -07001160 .enable_safe_config = true,
1161 .clkr.hw.init = &(struct clk_init_data){
1162 .name = "gcc_usb3_sec_phy_aux_clk_src",
1163 .parent_names = gcc_parent_names_2,
1164 .num_parents = 3,
1165 .flags = CLK_SET_RATE_PARENT,
1166 .ops = &clk_rcg2_ops,
1167 VDD_CX_FMAX_MAP1(
1168 MIN, 19200000),
1169 },
1170};
1171
1172static struct clk_branch gcc_aggre_noc_pcie_tbu_clk = {
1173 .halt_reg = 0x90014,
1174 .halt_check = BRANCH_HALT,
1175 .clkr = {
1176 .enable_reg = 0x90014,
1177 .enable_mask = BIT(0),
1178 .hw.init = &(struct clk_init_data){
1179 .name = "gcc_aggre_noc_pcie_tbu_clk",
1180 .ops = &clk_branch2_ops,
1181 },
1182 },
1183};
1184
1185static struct clk_branch gcc_aggre_ufs_card_axi_clk = {
1186 .halt_reg = 0x82028,
1187 .halt_check = BRANCH_HALT,
1188 .clkr = {
1189 .enable_reg = 0x82028,
1190 .enable_mask = BIT(0),
1191 .hw.init = &(struct clk_init_data){
1192 .name = "gcc_aggre_ufs_card_axi_clk",
1193 .parent_names = (const char *[]){
1194 "gcc_ufs_card_axi_clk_src",
1195 },
1196 .num_parents = 1,
1197 .flags = CLK_SET_RATE_PARENT,
1198 .ops = &clk_branch2_ops,
1199 },
1200 },
1201};
1202
1203static struct clk_branch gcc_aggre_ufs_phy_axi_clk = {
1204 .halt_reg = 0x82024,
1205 .halt_check = BRANCH_HALT,
1206 .clkr = {
1207 .enable_reg = 0x82024,
1208 .enable_mask = BIT(0),
1209 .hw.init = &(struct clk_init_data){
1210 .name = "gcc_aggre_ufs_phy_axi_clk",
1211 .parent_names = (const char *[]){
1212 "gcc_ufs_phy_axi_clk_src",
1213 },
1214 .num_parents = 1,
1215 .flags = CLK_SET_RATE_PARENT,
1216 .ops = &clk_branch2_ops,
1217 },
1218 },
1219};
1220
1221static struct clk_branch gcc_aggre_usb3_prim_axi_clk = {
1222 .halt_reg = 0x8201c,
1223 .halt_check = BRANCH_HALT,
1224 .clkr = {
1225 .enable_reg = 0x8201c,
1226 .enable_mask = BIT(0),
1227 .hw.init = &(struct clk_init_data){
1228 .name = "gcc_aggre_usb3_prim_axi_clk",
1229 .parent_names = (const char *[]){
1230 "gcc_usb30_prim_master_clk_src",
1231 },
1232 .num_parents = 1,
1233 .flags = CLK_SET_RATE_PARENT,
1234 .ops = &clk_branch2_ops,
1235 },
1236 },
1237};
1238
1239static struct clk_branch gcc_aggre_usb3_sec_axi_clk = {
1240 .halt_reg = 0x82020,
1241 .halt_check = BRANCH_HALT,
1242 .clkr = {
1243 .enable_reg = 0x82020,
1244 .enable_mask = BIT(0),
1245 .hw.init = &(struct clk_init_data){
1246 .name = "gcc_aggre_usb3_sec_axi_clk",
1247 .parent_names = (const char *[]){
1248 "gcc_usb30_sec_master_clk_src",
1249 },
1250 .num_parents = 1,
1251 .flags = CLK_SET_RATE_PARENT,
1252 .ops = &clk_branch2_ops,
1253 },
1254 },
1255};
1256
1257static struct clk_branch gcc_boot_rom_ahb_clk = {
1258 .halt_reg = 0x38004,
1259 .halt_check = BRANCH_HALT_VOTED,
1260 .clkr = {
1261 .enable_reg = 0x52004,
1262 .enable_mask = BIT(10),
1263 .hw.init = &(struct clk_init_data){
1264 .name = "gcc_boot_rom_ahb_clk",
1265 .ops = &clk_branch2_ops,
1266 },
1267 },
1268};
1269
1270static struct clk_branch gcc_camera_ahb_clk = {
1271 .halt_reg = 0xb008,
1272 .halt_check = BRANCH_HALT,
1273 .clkr = {
1274 .enable_reg = 0xb008,
1275 .enable_mask = BIT(0),
1276 .hw.init = &(struct clk_init_data){
1277 .name = "gcc_camera_ahb_clk",
1278 .ops = &clk_branch2_ops,
1279 },
1280 },
1281};
1282
1283static struct clk_branch gcc_camera_axi_clk = {
1284 .halt_reg = 0xb020,
1285 .halt_check = BRANCH_VOTED,
1286 .clkr = {
1287 .enable_reg = 0xb020,
1288 .enable_mask = BIT(0),
1289 .hw.init = &(struct clk_init_data){
1290 .name = "gcc_camera_axi_clk",
1291 .ops = &clk_branch2_ops,
1292 },
1293 },
1294};
1295
1296static struct clk_branch gcc_camera_xo_clk = {
1297 .halt_reg = 0xb02c,
1298 .halt_check = BRANCH_HALT,
1299 .clkr = {
1300 .enable_reg = 0xb02c,
1301 .enable_mask = BIT(0),
1302 .hw.init = &(struct clk_init_data){
1303 .name = "gcc_camera_xo_clk",
1304 .ops = &clk_branch2_ops,
1305 },
1306 },
1307};
1308
1309static struct clk_branch gcc_ce1_ahb_clk = {
1310 .halt_reg = 0x4100c,
1311 .halt_check = BRANCH_HALT_VOTED,
1312 .clkr = {
1313 .enable_reg = 0x52004,
1314 .enable_mask = BIT(3),
1315 .hw.init = &(struct clk_init_data){
1316 .name = "gcc_ce1_ahb_clk",
1317 .ops = &clk_branch2_ops,
1318 },
1319 },
1320};
1321
1322static struct clk_branch gcc_ce1_axi_clk = {
1323 .halt_reg = 0x41008,
1324 .halt_check = BRANCH_HALT_VOTED,
1325 .clkr = {
1326 .enable_reg = 0x52004,
1327 .enable_mask = BIT(4),
1328 .hw.init = &(struct clk_init_data){
1329 .name = "gcc_ce1_axi_clk",
1330 .ops = &clk_branch2_ops,
1331 },
1332 },
1333};
1334
1335static struct clk_branch gcc_ce1_clk = {
1336 .halt_reg = 0x41004,
1337 .halt_check = BRANCH_HALT_VOTED,
1338 .clkr = {
1339 .enable_reg = 0x52004,
1340 .enable_mask = BIT(5),
1341 .hw.init = &(struct clk_init_data){
1342 .name = "gcc_ce1_clk",
1343 .ops = &clk_branch2_ops,
1344 },
1345 },
1346};
1347
1348static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = {
1349 .halt_reg = 0x502c,
1350 .halt_check = BRANCH_HALT,
1351 .clkr = {
1352 .enable_reg = 0x502c,
1353 .enable_mask = BIT(0),
1354 .hw.init = &(struct clk_init_data){
1355 .name = "gcc_cfg_noc_usb3_prim_axi_clk",
1356 .parent_names = (const char *[]){
1357 "gcc_usb30_prim_master_clk_src",
1358 },
1359 .num_parents = 1,
1360 .flags = CLK_SET_RATE_PARENT,
1361 .ops = &clk_branch2_ops,
1362 },
1363 },
1364};
1365
1366static struct clk_branch gcc_cfg_noc_usb3_sec_axi_clk = {
1367 .halt_reg = 0x5030,
1368 .halt_check = BRANCH_HALT,
1369 .clkr = {
1370 .enable_reg = 0x5030,
1371 .enable_mask = BIT(0),
1372 .hw.init = &(struct clk_init_data){
1373 .name = "gcc_cfg_noc_usb3_sec_axi_clk",
1374 .parent_names = (const char *[]){
1375 "gcc_usb30_sec_master_clk_src",
1376 },
1377 .num_parents = 1,
1378 .flags = CLK_SET_RATE_PARENT,
1379 .ops = &clk_branch2_ops,
1380 },
1381 },
1382};
1383
1384static struct clk_branch gcc_cpuss_ahb_clk = {
1385 .halt_reg = 0x48000,
1386 .halt_check = BRANCH_HALT_VOTED,
1387 .clkr = {
1388 .enable_reg = 0x52004,
1389 .enable_mask = BIT(21),
1390 .hw.init = &(struct clk_init_data){
1391 .name = "gcc_cpuss_ahb_clk",
1392 .parent_names = (const char *[]){
1393 "gcc_cpuss_ahb_clk_src",
1394 },
1395 .num_parents = 1,
1396 .flags = CLK_SET_RATE_PARENT,
1397 .ops = &clk_branch2_ops,
1398 },
1399 },
1400};
1401
1402static struct clk_branch gcc_cpuss_dvm_bus_clk = {
1403 .halt_reg = 0x48190,
1404 .halt_check = BRANCH_HALT,
1405 .clkr = {
1406 .enable_reg = 0x48190,
1407 .enable_mask = BIT(0),
1408 .hw.init = &(struct clk_init_data){
1409 .name = "gcc_cpuss_dvm_bus_clk",
1410 .ops = &clk_branch2_ops,
1411 },
1412 },
1413};
1414
1415static struct clk_branch gcc_cpuss_gnoc_clk = {
1416 .halt_reg = 0x48004,
1417 .halt_check = BRANCH_HALT_VOTED,
1418 .clkr = {
1419 .enable_reg = 0x52004,
1420 .enable_mask = BIT(22),
1421 .hw.init = &(struct clk_init_data){
1422 .name = "gcc_cpuss_gnoc_clk",
1423 .ops = &clk_branch2_ops,
1424 },
1425 },
1426};
1427
1428static struct clk_branch gcc_cpuss_rbcpr_clk = {
1429 .halt_reg = 0x48008,
1430 .halt_check = BRANCH_HALT,
1431 .clkr = {
1432 .enable_reg = 0x48008,
1433 .enable_mask = BIT(0),
1434 .hw.init = &(struct clk_init_data){
1435 .name = "gcc_cpuss_rbcpr_clk",
1436 .parent_names = (const char *[]){
1437 "gcc_cpuss_rbcpr_clk_src",
1438 },
1439 .num_parents = 1,
1440 .flags = CLK_SET_RATE_PARENT,
1441 .ops = &clk_branch2_ops,
1442 },
1443 },
1444};
1445
1446static struct clk_branch gcc_cxo_tx1_clkref_clk = {
1447 .halt_reg = 0x8c020,
1448 .halt_check = BRANCH_HALT,
1449 .clkr = {
1450 .enable_reg = 0x8c020,
1451 .enable_mask = BIT(0),
1452 .hw.init = &(struct clk_init_data){
1453 .name = "gcc_cxo_tx1_clkref_clk",
1454 .ops = &clk_branch2_ops,
1455 },
1456 },
1457};
1458
1459static struct clk_branch gcc_ddrss_gpu_axi_clk = {
1460 .halt_reg = 0x44038,
1461 .halt_check = BRANCH_HALT,
1462 .clkr = {
1463 .enable_reg = 0x44038,
1464 .enable_mask = BIT(0),
1465 .hw.init = &(struct clk_init_data){
1466 .name = "gcc_ddrss_gpu_axi_clk",
1467 .ops = &clk_branch2_ops,
1468 },
1469 },
1470};
1471
1472static struct clk_branch gcc_disp_ahb_clk = {
1473 .halt_reg = 0xb00c,
1474 .halt_check = BRANCH_HALT,
1475 .clkr = {
1476 .enable_reg = 0xb00c,
1477 .enable_mask = BIT(0),
1478 .hw.init = &(struct clk_init_data){
1479 .name = "gcc_disp_ahb_clk",
1480 .ops = &clk_branch2_ops,
1481 },
1482 },
1483};
1484
1485static struct clk_branch gcc_disp_axi_clk = {
1486 .halt_reg = 0xb024,
1487 .halt_check = BRANCH_VOTED,
1488 .clkr = {
1489 .enable_reg = 0xb024,
1490 .enable_mask = BIT(0),
1491 .hw.init = &(struct clk_init_data){
1492 .name = "gcc_disp_axi_clk",
1493 .ops = &clk_branch2_ops,
1494 },
1495 },
1496};
1497
1498static struct clk_gate2 gcc_disp_gpll0_clk_src = {
1499 .udelay = 500,
1500 .clkr = {
1501 .enable_reg = 0x52004,
1502 .enable_mask = BIT(18),
1503 .hw.init = &(struct clk_init_data){
1504 .name = "gcc_disp_gpll0_clk_src",
1505 .parent_names = (const char *[]){
1506 "gpll0",
1507 },
1508 .num_parents = 1,
1509 .flags = CLK_SET_RATE_PARENT,
1510 .ops = &clk_gate2_ops,
1511 },
1512 },
1513};
1514
1515static struct clk_gate2 gcc_disp_gpll0_div_clk_src = {
1516 .udelay = 500,
1517 .clkr = {
1518 .enable_reg = 0x52004,
1519 .enable_mask = BIT(19),
1520 .hw.init = &(struct clk_init_data){
1521 .name = "gcc_disp_gpll0_div_clk_src",
1522 .parent_names = (const char *[]){
1523 "gpll0_out_even",
1524 },
1525 .num_parents = 1,
1526 .flags = CLK_SET_RATE_PARENT,
1527 .ops = &clk_gate2_ops,
1528 },
1529 },
1530};
1531
1532static struct clk_branch gcc_disp_xo_clk = {
1533 .halt_reg = 0xb030,
1534 .halt_check = BRANCH_HALT,
1535 .clkr = {
1536 .enable_reg = 0xb030,
1537 .enable_mask = BIT(0),
1538 .hw.init = &(struct clk_init_data){
1539 .name = "gcc_disp_xo_clk",
1540 .ops = &clk_branch2_ops,
1541 },
1542 },
1543};
1544
1545static struct clk_branch gcc_gp1_clk = {
1546 .halt_reg = 0x64000,
1547 .halt_check = BRANCH_HALT,
1548 .clkr = {
1549 .enable_reg = 0x64000,
1550 .enable_mask = BIT(0),
1551 .hw.init = &(struct clk_init_data){
1552 .name = "gcc_gp1_clk",
1553 .parent_names = (const char *[]){
1554 "gcc_gp1_clk_src",
1555 },
1556 .num_parents = 1,
1557 .flags = CLK_SET_RATE_PARENT,
1558 .ops = &clk_branch2_ops,
1559 },
1560 },
1561};
1562
1563static struct clk_branch gcc_gp2_clk = {
1564 .halt_reg = 0x65000,
1565 .halt_check = BRANCH_HALT,
1566 .clkr = {
1567 .enable_reg = 0x65000,
1568 .enable_mask = BIT(0),
1569 .hw.init = &(struct clk_init_data){
1570 .name = "gcc_gp2_clk",
1571 .parent_names = (const char *[]){
1572 "gcc_gp2_clk_src",
1573 },
1574 .num_parents = 1,
1575 .flags = CLK_SET_RATE_PARENT,
1576 .ops = &clk_branch2_ops,
1577 },
1578 },
1579};
1580
1581static struct clk_branch gcc_gp3_clk = {
1582 .halt_reg = 0x66000,
1583 .halt_check = BRANCH_HALT,
1584 .clkr = {
1585 .enable_reg = 0x66000,
1586 .enable_mask = BIT(0),
1587 .hw.init = &(struct clk_init_data){
1588 .name = "gcc_gp3_clk",
1589 .parent_names = (const char *[]){
1590 "gcc_gp3_clk_src",
1591 },
1592 .num_parents = 1,
1593 .flags = CLK_SET_RATE_PARENT,
1594 .ops = &clk_branch2_ops,
1595 },
1596 },
1597};
1598
1599static struct clk_branch gcc_gpu_cfg_ahb_clk = {
1600 .halt_reg = 0x71004,
1601 .halt_check = BRANCH_HALT,
1602 .clkr = {
1603 .enable_reg = 0x71004,
1604 .enable_mask = BIT(0),
1605 .hw.init = &(struct clk_init_data){
1606 .name = "gcc_gpu_cfg_ahb_clk",
1607 .ops = &clk_branch2_ops,
1608 },
1609 },
1610};
1611
1612static struct clk_gate2 gcc_gpu_gpll0_clk_src = {
1613 .udelay = 500,
1614 .clkr = {
1615 .enable_reg = 0x52004,
1616 .enable_mask = BIT(15),
1617 .hw.init = &(struct clk_init_data){
1618 .name = "gcc_gpu_gpll0_clk_src",
1619 .parent_names = (const char *[]){
1620 "gpll0",
1621 },
1622 .num_parents = 1,
1623 .flags = CLK_SET_RATE_PARENT,
1624 .ops = &clk_gate2_ops,
1625 },
1626 },
1627};
1628
1629static struct clk_gate2 gcc_gpu_gpll0_div_clk_src = {
1630 .udelay = 500,
1631 .clkr = {
1632 .enable_reg = 0x52004,
1633 .enable_mask = BIT(16),
1634 .hw.init = &(struct clk_init_data){
1635 .name = "gcc_gpu_gpll0_div_clk_src",
1636 .parent_names = (const char *[]){
1637 "gpll0_out_even",
1638 },
1639 .num_parents = 1,
1640 .flags = CLK_SET_RATE_PARENT,
1641 .ops = &clk_gate2_ops,
1642 },
1643 },
1644};
1645
1646static struct clk_branch gcc_gpu_memnoc_gfx_clk = {
1647 .halt_reg = 0x7100c,
1648 .halt_check = BRANCH_HALT,
1649 .clkr = {
1650 .enable_reg = 0x7100c,
1651 .enable_mask = BIT(0),
1652 .hw.init = &(struct clk_init_data){
1653 .name = "gcc_gpu_memnoc_gfx_clk",
1654 .ops = &clk_branch2_ops,
1655 },
1656 },
1657};
1658
1659static struct clk_branch gcc_gpu_snoc_dvm_gfx_clk = {
1660 .halt_reg = 0x71018,
1661 .halt_check = BRANCH_HALT,
1662 .clkr = {
1663 .enable_reg = 0x71018,
1664 .enable_mask = BIT(0),
1665 .hw.init = &(struct clk_init_data){
1666 .name = "gcc_gpu_snoc_dvm_gfx_clk",
1667 .ops = &clk_branch2_ops,
1668 },
1669 },
1670};
1671
1672static struct clk_branch gcc_mmss_qm_ahb_clk = {
1673 .halt_reg = 0xb05c,
1674 .halt_check = BRANCH_HALT,
1675 .clkr = {
1676 .enable_reg = 0xb05c,
1677 .enable_mask = BIT(0),
1678 .hw.init = &(struct clk_init_data){
1679 .name = "gcc_mmss_qm_ahb_clk",
1680 .ops = &clk_branch2_ops,
1681 },
1682 },
1683};
1684
1685static struct clk_branch gcc_mmss_qm_core_clk = {
1686 .halt_reg = 0xb038,
1687 .halt_check = BRANCH_HALT,
1688 .clkr = {
1689 .enable_reg = 0xb038,
1690 .enable_mask = BIT(0),
1691 .hw.init = &(struct clk_init_data){
1692 .name = "gcc_mmss_qm_core_clk",
1693 .parent_names = (const char *[]){
1694 "gcc_mmss_qm_core_clk_src",
1695 },
1696 .num_parents = 1,
1697 .flags = CLK_SET_RATE_PARENT,
1698 .ops = &clk_branch2_ops,
1699 },
1700 },
1701};
1702
1703static struct clk_branch gcc_mss_axis2_clk = {
1704 .halt_reg = 0x8a008,
1705 .halt_check = BRANCH_HALT,
1706 .clkr = {
1707 .enable_reg = 0x8a008,
1708 .enable_mask = BIT(0),
1709 .hw.init = &(struct clk_init_data){
1710 .name = "gcc_mss_axis2_clk",
1711 .ops = &clk_branch2_ops,
1712 },
1713 },
1714};
1715
1716static struct clk_branch gcc_mss_cfg_ahb_clk = {
1717 .halt_reg = 0x8a000,
1718 .halt_check = BRANCH_HALT,
1719 .clkr = {
1720 .enable_reg = 0x8a000,
1721 .enable_mask = BIT(0),
1722 .hw.init = &(struct clk_init_data){
1723 .name = "gcc_mss_cfg_ahb_clk",
1724 .ops = &clk_branch2_ops,
1725 },
1726 },
1727};
1728
1729static struct clk_gate2 gcc_mss_gpll0_div_clk_src = {
1730 .udelay = 500,
1731 .clkr = {
1732 .enable_reg = 0x52004,
1733 .enable_mask = BIT(17),
1734 .hw.init = &(struct clk_init_data){
1735 .name = "gcc_mss_gpll0_div_clk_src",
1736 .ops = &clk_gate2_ops,
1737 },
1738 },
1739};
1740
1741static struct clk_branch gcc_mss_mfab_axis_clk = {
1742 .halt_reg = 0x8a004,
1743 .halt_check = BRANCH_VOTED,
1744 .clkr = {
1745 .enable_reg = 0x8a004,
1746 .enable_mask = BIT(0),
1747 .hw.init = &(struct clk_init_data){
1748 .name = "gcc_mss_mfab_axis_clk",
1749 .ops = &clk_branch2_ops,
1750 },
1751 },
1752};
1753
1754static struct clk_branch gcc_mss_q6_memnoc_axi_clk = {
1755 .halt_reg = 0x8a154,
1756 .halt_check = BRANCH_VOTED,
1757 .clkr = {
1758 .enable_reg = 0x8a154,
1759 .enable_mask = BIT(0),
1760 .hw.init = &(struct clk_init_data){
1761 .name = "gcc_mss_q6_memnoc_axi_clk",
1762 .ops = &clk_branch2_ops,
1763 },
1764 },
1765};
1766
1767static struct clk_branch gcc_mss_snoc_axi_clk = {
1768 .halt_reg = 0x8a150,
1769 .halt_check = BRANCH_HALT,
1770 .clkr = {
1771 .enable_reg = 0x8a150,
1772 .enable_mask = BIT(0),
1773 .hw.init = &(struct clk_init_data){
1774 .name = "gcc_mss_snoc_axi_clk",
1775 .ops = &clk_branch2_ops,
1776 },
1777 },
1778};
1779
1780static struct clk_branch gcc_pcie_0_aux_clk = {
1781 .halt_reg = 0x6b01c,
1782 .halt_check = BRANCH_HALT_VOTED,
1783 .clkr = {
1784 .enable_reg = 0x5200c,
1785 .enable_mask = BIT(3),
1786 .hw.init = &(struct clk_init_data){
1787 .name = "gcc_pcie_0_aux_clk",
1788 .parent_names = (const char *[]){
1789 "gcc_pcie_0_aux_clk_src",
1790 },
1791 .num_parents = 1,
1792 .flags = CLK_SET_RATE_PARENT,
1793 .ops = &clk_branch2_ops,
1794 },
1795 },
1796};
1797
1798static struct clk_branch gcc_pcie_0_cfg_ahb_clk = {
1799 .halt_reg = 0x6b018,
1800 .halt_check = BRANCH_HALT_VOTED,
1801 .clkr = {
1802 .enable_reg = 0x5200c,
1803 .enable_mask = BIT(2),
1804 .hw.init = &(struct clk_init_data){
1805 .name = "gcc_pcie_0_cfg_ahb_clk",
1806 .ops = &clk_branch2_ops,
1807 },
1808 },
1809};
1810
1811static struct clk_branch gcc_pcie_0_clkref_clk = {
1812 .halt_reg = 0x8c00c,
1813 .halt_check = BRANCH_HALT,
1814 .clkr = {
1815 .enable_reg = 0x8c00c,
1816 .enable_mask = BIT(0),
1817 .hw.init = &(struct clk_init_data){
1818 .name = "gcc_pcie_0_clkref_clk",
1819 .ops = &clk_branch2_ops,
1820 },
1821 },
1822};
1823
1824static struct clk_branch gcc_pcie_0_mstr_axi_clk = {
1825 .halt_reg = 0x6b014,
1826 .halt_check = BRANCH_HALT_VOTED,
1827 .clkr = {
1828 .enable_reg = 0x5200c,
1829 .enable_mask = BIT(1),
1830 .hw.init = &(struct clk_init_data){
1831 .name = "gcc_pcie_0_mstr_axi_clk",
1832 .ops = &clk_branch2_ops,
1833 },
1834 },
1835};
1836
1837static struct clk_gate2 gcc_pcie_0_pipe_clk = {
1838 .udelay = 500,
1839 .clkr = {
1840 .enable_reg = 0x5200c,
1841 .enable_mask = BIT(4),
1842 .hw.init = &(struct clk_init_data){
1843 .name = "gcc_pcie_0_pipe_clk",
1844 .ops = &clk_gate2_ops,
1845 },
1846 },
1847};
1848
1849static struct clk_branch gcc_pcie_0_slv_axi_clk = {
1850 .halt_reg = 0x6b010,
1851 .halt_check = BRANCH_HALT_VOTED,
1852 .clkr = {
1853 .enable_reg = 0x5200c,
1854 .enable_mask = BIT(0),
1855 .hw.init = &(struct clk_init_data){
1856 .name = "gcc_pcie_0_slv_axi_clk",
1857 .ops = &clk_branch2_ops,
1858 },
1859 },
1860};
1861
1862static struct clk_branch gcc_pcie_0_slv_q2a_axi_clk = {
1863 .halt_reg = 0x6b00c,
1864 .halt_check = BRANCH_HALT_VOTED,
1865 .clkr = {
1866 .enable_reg = 0x5200c,
1867 .enable_mask = BIT(5),
1868 .hw.init = &(struct clk_init_data){
1869 .name = "gcc_pcie_0_slv_q2a_axi_clk",
1870 .ops = &clk_branch2_ops,
1871 },
1872 },
1873};
1874
1875static struct clk_branch gcc_pcie_1_aux_clk = {
1876 .halt_reg = 0x8d01c,
1877 .halt_check = BRANCH_HALT_VOTED,
1878 .clkr = {
1879 .enable_reg = 0x52004,
1880 .enable_mask = BIT(29),
1881 .hw.init = &(struct clk_init_data){
1882 .name = "gcc_pcie_1_aux_clk",
1883 .parent_names = (const char *[]){
1884 "gcc_pcie_1_aux_clk_src",
1885 },
1886 .num_parents = 1,
1887 .flags = CLK_SET_RATE_PARENT,
1888 .ops = &clk_branch2_ops,
1889 },
1890 },
1891};
1892
1893static struct clk_branch gcc_pcie_1_cfg_ahb_clk = {
1894 .halt_reg = 0x8d018,
1895 .halt_check = BRANCH_HALT_VOTED,
1896 .clkr = {
1897 .enable_reg = 0x52004,
1898 .enable_mask = BIT(28),
1899 .hw.init = &(struct clk_init_data){
1900 .name = "gcc_pcie_1_cfg_ahb_clk",
1901 .ops = &clk_branch2_ops,
1902 },
1903 },
1904};
1905
1906static struct clk_branch gcc_pcie_1_clkref_clk = {
1907 .halt_reg = 0x8c02c,
1908 .halt_check = BRANCH_HALT,
1909 .clkr = {
1910 .enable_reg = 0x8c02c,
1911 .enable_mask = BIT(0),
1912 .hw.init = &(struct clk_init_data){
1913 .name = "gcc_pcie_1_clkref_clk",
1914 .ops = &clk_branch2_ops,
1915 },
1916 },
1917};
1918
1919static struct clk_branch gcc_pcie_1_mstr_axi_clk = {
1920 .halt_reg = 0x8d014,
1921 .halt_check = BRANCH_HALT_VOTED,
1922 .clkr = {
1923 .enable_reg = 0x52004,
1924 .enable_mask = BIT(27),
1925 .hw.init = &(struct clk_init_data){
1926 .name = "gcc_pcie_1_mstr_axi_clk",
1927 .ops = &clk_branch2_ops,
1928 },
1929 },
1930};
1931
1932static struct clk_gate2 gcc_pcie_1_pipe_clk = {
1933 .udelay = 500,
1934 .clkr = {
1935 .enable_reg = 0x52004,
1936 .enable_mask = BIT(30),
1937 .hw.init = &(struct clk_init_data){
1938 .name = "gcc_pcie_1_pipe_clk",
1939 .ops = &clk_gate2_ops,
1940 },
1941 },
1942};
1943
1944static struct clk_branch gcc_pcie_1_slv_axi_clk = {
1945 .halt_reg = 0x8d010,
1946 .halt_check = BRANCH_HALT_VOTED,
1947 .clkr = {
1948 .enable_reg = 0x52004,
1949 .enable_mask = BIT(26),
1950 .hw.init = &(struct clk_init_data){
1951 .name = "gcc_pcie_1_slv_axi_clk",
1952 .ops = &clk_branch2_ops,
1953 },
1954 },
1955};
1956
1957static struct clk_branch gcc_pcie_1_slv_q2a_axi_clk = {
1958 .halt_reg = 0x8d00c,
1959 .halt_check = BRANCH_HALT_VOTED,
1960 .clkr = {
1961 .enable_reg = 0x52004,
1962 .enable_mask = BIT(25),
1963 .hw.init = &(struct clk_init_data){
1964 .name = "gcc_pcie_1_slv_q2a_axi_clk",
1965 .ops = &clk_branch2_ops,
1966 },
1967 },
1968};
1969
1970static struct clk_branch gcc_pcie_phy_aux_clk = {
1971 .halt_reg = 0x6f004,
1972 .halt_check = BRANCH_HALT,
1973 .clkr = {
1974 .enable_reg = 0x6f004,
1975 .enable_mask = BIT(0),
1976 .hw.init = &(struct clk_init_data){
1977 .name = "gcc_pcie_phy_aux_clk",
1978 .parent_names = (const char *[]){
1979 "gcc_pcie_0_aux_clk_src",
1980 },
1981 .num_parents = 1,
1982 .flags = CLK_SET_RATE_PARENT,
1983 .ops = &clk_branch2_ops,
1984 },
1985 },
1986};
1987
1988static struct clk_branch gcc_pcie_phy_refgen_clk = {
1989 .halt_reg = 0x6f02c,
1990 .halt_check = BRANCH_HALT,
1991 .clkr = {
1992 .enable_reg = 0x6f02c,
1993 .enable_mask = BIT(0),
1994 .hw.init = &(struct clk_init_data){
1995 .name = "gcc_pcie_phy_refgen_clk",
1996 .parent_names = (const char *[]){
1997 "gcc_pcie_phy_refgen_clk_src",
1998 },
1999 .num_parents = 1,
2000 .flags = CLK_SET_RATE_PARENT,
2001 .ops = &clk_branch2_ops,
2002 },
2003 },
2004};
2005
2006static struct clk_branch gcc_pdm2_clk = {
2007 .halt_reg = 0x3300c,
2008 .halt_check = BRANCH_HALT,
2009 .clkr = {
2010 .enable_reg = 0x3300c,
2011 .enable_mask = BIT(0),
2012 .hw.init = &(struct clk_init_data){
2013 .name = "gcc_pdm2_clk",
2014 .parent_names = (const char *[]){
2015 "gcc_pdm2_clk_src",
2016 },
2017 .num_parents = 1,
2018 .flags = CLK_SET_RATE_PARENT,
2019 .ops = &clk_branch2_ops,
2020 },
2021 },
2022};
2023
2024static struct clk_branch gcc_pdm_ahb_clk = {
2025 .halt_reg = 0x33004,
2026 .halt_check = BRANCH_HALT,
2027 .clkr = {
2028 .enable_reg = 0x33004,
2029 .enable_mask = BIT(0),
2030 .hw.init = &(struct clk_init_data){
2031 .name = "gcc_pdm_ahb_clk",
2032 .ops = &clk_branch2_ops,
2033 },
2034 },
2035};
2036
2037static struct clk_branch gcc_pdm_xo4_clk = {
2038 .halt_reg = 0x33008,
2039 .halt_check = BRANCH_HALT,
2040 .clkr = {
2041 .enable_reg = 0x33008,
2042 .enable_mask = BIT(0),
2043 .hw.init = &(struct clk_init_data){
2044 .name = "gcc_pdm_xo4_clk",
2045 .ops = &clk_branch2_ops,
2046 },
2047 },
2048};
2049
2050static struct clk_branch gcc_prng_ahb_clk = {
2051 .halt_reg = 0x34004,
2052 .halt_check = BRANCH_HALT_VOTED,
2053 .clkr = {
2054 .enable_reg = 0x52004,
2055 .enable_mask = BIT(13),
2056 .hw.init = &(struct clk_init_data){
2057 .name = "gcc_prng_ahb_clk",
2058 .ops = &clk_branch2_ops,
2059 },
2060 },
2061};
2062
2063static struct clk_branch gcc_qmip_camera_ahb_clk = {
2064 .halt_reg = 0xb014,
2065 .halt_check = BRANCH_HALT,
2066 .clkr = {
2067 .enable_reg = 0xb014,
2068 .enable_mask = BIT(0),
2069 .hw.init = &(struct clk_init_data){
2070 .name = "gcc_qmip_camera_ahb_clk",
2071 .ops = &clk_branch2_ops,
2072 },
2073 },
2074};
2075
2076static struct clk_branch gcc_qmip_disp_ahb_clk = {
2077 .halt_reg = 0xb018,
2078 .halt_check = BRANCH_HALT,
2079 .clkr = {
2080 .enable_reg = 0xb018,
2081 .enable_mask = BIT(0),
2082 .hw.init = &(struct clk_init_data){
2083 .name = "gcc_qmip_disp_ahb_clk",
2084 .ops = &clk_branch2_ops,
2085 },
2086 },
2087};
2088
2089static struct clk_branch gcc_qmip_video_ahb_clk = {
2090 .halt_reg = 0xb010,
2091 .halt_check = BRANCH_HALT,
2092 .clkr = {
2093 .enable_reg = 0xb010,
2094 .enable_mask = BIT(0),
2095 .hw.init = &(struct clk_init_data){
2096 .name = "gcc_qmip_video_ahb_clk",
2097 .ops = &clk_branch2_ops,
2098 },
2099 },
2100};
2101
2102static struct clk_branch gcc_qupv3_wrap0_core_2x_clk = {
2103 .halt_reg = 0x17014,
2104 .halt_check = BRANCH_HALT_VOTED,
2105 .clkr = {
2106 .enable_reg = 0x5200c,
2107 .enable_mask = BIT(9),
2108 .hw.init = &(struct clk_init_data){
2109 .name = "gcc_qupv3_wrap0_core_2x_clk",
Deepak Katragadda575a45f2016-10-11 15:06:56 -07002110 .ops = &clk_branch2_ops,
2111 },
2112 },
2113};
2114
2115static struct clk_branch gcc_qupv3_wrap0_core_clk = {
2116 .halt_reg = 0x1700c,
2117 .halt_check = BRANCH_HALT_VOTED,
2118 .clkr = {
2119 .enable_reg = 0x5200c,
2120 .enable_mask = BIT(8),
2121 .hw.init = &(struct clk_init_data){
2122 .name = "gcc_qupv3_wrap0_core_clk",
Deepak Katragadda575a45f2016-10-11 15:06:56 -07002123 .ops = &clk_branch2_ops,
2124 },
2125 },
2126};
2127
2128static struct clk_branch gcc_qupv3_wrap0_s0_clk = {
2129 .halt_reg = 0x17030,
2130 .halt_check = BRANCH_HALT_VOTED,
2131 .clkr = {
2132 .enable_reg = 0x5200c,
2133 .enable_mask = BIT(10),
2134 .hw.init = &(struct clk_init_data){
2135 .name = "gcc_qupv3_wrap0_s0_clk",
2136 .parent_names = (const char *[]){
2137 "gcc_qupv3_wrap0_s0_clk_src",
2138 },
2139 .num_parents = 1,
2140 .flags = CLK_SET_RATE_PARENT,
2141 .ops = &clk_branch2_ops,
2142 },
2143 },
2144};
2145
2146static struct clk_branch gcc_qupv3_wrap0_s1_clk = {
2147 .halt_reg = 0x17160,
2148 .halt_check = BRANCH_HALT_VOTED,
2149 .clkr = {
2150 .enable_reg = 0x5200c,
2151 .enable_mask = BIT(11),
2152 .hw.init = &(struct clk_init_data){
2153 .name = "gcc_qupv3_wrap0_s1_clk",
2154 .parent_names = (const char *[]){
2155 "gcc_qupv3_wrap0_s1_clk_src",
2156 },
2157 .num_parents = 1,
2158 .flags = CLK_SET_RATE_PARENT,
2159 .ops = &clk_branch2_ops,
2160 },
2161 },
2162};
2163
2164static struct clk_branch gcc_qupv3_wrap0_s2_clk = {
2165 .halt_reg = 0x17290,
2166 .halt_check = BRANCH_HALT_VOTED,
2167 .clkr = {
2168 .enable_reg = 0x5200c,
2169 .enable_mask = BIT(12),
2170 .hw.init = &(struct clk_init_data){
2171 .name = "gcc_qupv3_wrap0_s2_clk",
2172 .parent_names = (const char *[]){
2173 "gcc_qupv3_wrap0_s2_clk_src",
2174 },
2175 .num_parents = 1,
2176 .flags = CLK_SET_RATE_PARENT,
2177 .ops = &clk_branch2_ops,
2178 },
2179 },
2180};
2181
2182static struct clk_branch gcc_qupv3_wrap0_s3_clk = {
2183 .halt_reg = 0x173c0,
2184 .halt_check = BRANCH_HALT_VOTED,
2185 .clkr = {
2186 .enable_reg = 0x5200c,
2187 .enable_mask = BIT(13),
2188 .hw.init = &(struct clk_init_data){
2189 .name = "gcc_qupv3_wrap0_s3_clk",
2190 .parent_names = (const char *[]){
2191 "gcc_qupv3_wrap0_s3_clk_src",
2192 },
2193 .num_parents = 1,
2194 .flags = CLK_SET_RATE_PARENT,
2195 .ops = &clk_branch2_ops,
2196 },
2197 },
2198};
2199
2200static struct clk_branch gcc_qupv3_wrap0_s4_clk = {
2201 .halt_reg = 0x174f0,
2202 .halt_check = BRANCH_HALT_VOTED,
2203 .clkr = {
2204 .enable_reg = 0x5200c,
2205 .enable_mask = BIT(14),
2206 .hw.init = &(struct clk_init_data){
2207 .name = "gcc_qupv3_wrap0_s4_clk",
2208 .parent_names = (const char *[]){
2209 "gcc_qupv3_wrap0_s4_clk_src",
2210 },
2211 .num_parents = 1,
2212 .flags = CLK_SET_RATE_PARENT,
2213 .ops = &clk_branch2_ops,
2214 },
2215 },
2216};
2217
2218static struct clk_branch gcc_qupv3_wrap0_s5_clk = {
2219 .halt_reg = 0x17620,
2220 .halt_check = BRANCH_HALT_VOTED,
2221 .clkr = {
2222 .enable_reg = 0x5200c,
2223 .enable_mask = BIT(15),
2224 .hw.init = &(struct clk_init_data){
2225 .name = "gcc_qupv3_wrap0_s5_clk",
2226 .parent_names = (const char *[]){
2227 "gcc_qupv3_wrap0_s5_clk_src",
2228 },
2229 .num_parents = 1,
2230 .flags = CLK_SET_RATE_PARENT,
2231 .ops = &clk_branch2_ops,
2232 },
2233 },
2234};
2235
2236static struct clk_branch gcc_qupv3_wrap0_s6_clk = {
2237 .halt_reg = 0x17750,
2238 .halt_check = BRANCH_HALT_VOTED,
2239 .clkr = {
2240 .enable_reg = 0x5200c,
2241 .enable_mask = BIT(16),
2242 .hw.init = &(struct clk_init_data){
2243 .name = "gcc_qupv3_wrap0_s6_clk",
2244 .parent_names = (const char *[]){
2245 "gcc_qupv3_wrap0_s6_clk_src",
2246 },
2247 .num_parents = 1,
2248 .flags = CLK_SET_RATE_PARENT,
2249 .ops = &clk_branch2_ops,
2250 },
2251 },
2252};
2253
2254static struct clk_branch gcc_qupv3_wrap0_s7_clk = {
2255 .halt_reg = 0x17880,
2256 .halt_check = BRANCH_HALT_VOTED,
2257 .clkr = {
2258 .enable_reg = 0x5200c,
2259 .enable_mask = BIT(17),
2260 .hw.init = &(struct clk_init_data){
2261 .name = "gcc_qupv3_wrap0_s7_clk",
2262 .parent_names = (const char *[]){
2263 "gcc_qupv3_wrap0_s7_clk_src",
2264 },
2265 .num_parents = 1,
2266 .flags = CLK_SET_RATE_PARENT,
2267 .ops = &clk_branch2_ops,
2268 },
2269 },
2270};
2271
2272static struct clk_branch gcc_qupv3_wrap1_core_2x_clk = {
2273 .halt_reg = 0x18004,
2274 .halt_check = BRANCH_HALT_VOTED,
2275 .clkr = {
2276 .enable_reg = 0x5200c,
2277 .enable_mask = BIT(18),
2278 .hw.init = &(struct clk_init_data){
2279 .name = "gcc_qupv3_wrap1_core_2x_clk",
Deepak Katragadda575a45f2016-10-11 15:06:56 -07002280 .ops = &clk_branch2_ops,
2281 },
2282 },
2283};
2284
2285static struct clk_branch gcc_qupv3_wrap1_core_clk = {
2286 .halt_reg = 0x18008,
2287 .halt_check = BRANCH_HALT_VOTED,
2288 .clkr = {
2289 .enable_reg = 0x5200c,
2290 .enable_mask = BIT(19),
2291 .hw.init = &(struct clk_init_data){
2292 .name = "gcc_qupv3_wrap1_core_clk",
Deepak Katragadda575a45f2016-10-11 15:06:56 -07002293 .ops = &clk_branch2_ops,
2294 },
2295 },
2296};
2297
2298static struct clk_branch gcc_qupv3_wrap1_s0_clk = {
2299 .halt_reg = 0x18014,
2300 .halt_check = BRANCH_HALT_VOTED,
2301 .clkr = {
2302 .enable_reg = 0x5200c,
2303 .enable_mask = BIT(22),
2304 .hw.init = &(struct clk_init_data){
2305 .name = "gcc_qupv3_wrap1_s0_clk",
2306 .parent_names = (const char *[]){
2307 "gcc_qupv3_wrap1_s0_clk_src",
2308 },
2309 .num_parents = 1,
2310 .flags = CLK_SET_RATE_PARENT,
2311 .ops = &clk_branch2_ops,
2312 },
2313 },
2314};
2315
2316static struct clk_branch gcc_qupv3_wrap1_s1_clk = {
2317 .halt_reg = 0x18144,
2318 .halt_check = BRANCH_HALT_VOTED,
2319 .clkr = {
2320 .enable_reg = 0x5200c,
2321 .enable_mask = BIT(23),
2322 .hw.init = &(struct clk_init_data){
2323 .name = "gcc_qupv3_wrap1_s1_clk",
2324 .parent_names = (const char *[]){
2325 "gcc_qupv3_wrap1_s1_clk_src",
2326 },
2327 .num_parents = 1,
2328 .flags = CLK_SET_RATE_PARENT,
2329 .ops = &clk_branch2_ops,
2330 },
2331 },
2332};
2333
2334static struct clk_branch gcc_qupv3_wrap1_s2_clk = {
2335 .halt_reg = 0x18274,
2336 .halt_check = BRANCH_HALT_VOTED,
2337 .clkr = {
2338 .enable_reg = 0x5200c,
2339 .enable_mask = BIT(24),
2340 .hw.init = &(struct clk_init_data){
2341 .name = "gcc_qupv3_wrap1_s2_clk",
2342 .parent_names = (const char *[]){
2343 "gcc_qupv3_wrap1_s2_clk_src",
2344 },
2345 .num_parents = 1,
2346 .flags = CLK_SET_RATE_PARENT,
2347 .ops = &clk_branch2_ops,
2348 },
2349 },
2350};
2351
2352static struct clk_branch gcc_qupv3_wrap1_s3_clk = {
2353 .halt_reg = 0x183a4,
2354 .halt_check = BRANCH_HALT_VOTED,
2355 .clkr = {
2356 .enable_reg = 0x5200c,
2357 .enable_mask = BIT(25),
2358 .hw.init = &(struct clk_init_data){
2359 .name = "gcc_qupv3_wrap1_s3_clk",
2360 .parent_names = (const char *[]){
2361 "gcc_qupv3_wrap1_s3_clk_src",
2362 },
2363 .num_parents = 1,
2364 .flags = CLK_SET_RATE_PARENT,
2365 .ops = &clk_branch2_ops,
2366 },
2367 },
2368};
2369
2370static struct clk_branch gcc_qupv3_wrap1_s4_clk = {
2371 .halt_reg = 0x184d4,
2372 .halt_check = BRANCH_HALT_VOTED,
2373 .clkr = {
2374 .enable_reg = 0x5200c,
2375 .enable_mask = BIT(26),
2376 .hw.init = &(struct clk_init_data){
2377 .name = "gcc_qupv3_wrap1_s4_clk",
2378 .parent_names = (const char *[]){
2379 "gcc_qupv3_wrap1_s4_clk_src",
2380 },
2381 .num_parents = 1,
2382 .flags = CLK_SET_RATE_PARENT,
2383 .ops = &clk_branch2_ops,
2384 },
2385 },
2386};
2387
2388static struct clk_branch gcc_qupv3_wrap1_s5_clk = {
2389 .halt_reg = 0x18604,
2390 .halt_check = BRANCH_HALT_VOTED,
2391 .clkr = {
2392 .enable_reg = 0x5200c,
2393 .enable_mask = BIT(27),
2394 .hw.init = &(struct clk_init_data){
2395 .name = "gcc_qupv3_wrap1_s5_clk",
2396 .parent_names = (const char *[]){
2397 "gcc_qupv3_wrap1_s5_clk_src",
2398 },
2399 .num_parents = 1,
2400 .flags = CLK_SET_RATE_PARENT,
2401 .ops = &clk_branch2_ops,
2402 },
2403 },
2404};
2405
2406static struct clk_branch gcc_qupv3_wrap1_s6_clk = {
2407 .halt_reg = 0x18734,
2408 .halt_check = BRANCH_HALT_VOTED,
2409 .clkr = {
2410 .enable_reg = 0x5200c,
2411 .enable_mask = BIT(28),
2412 .hw.init = &(struct clk_init_data){
2413 .name = "gcc_qupv3_wrap1_s6_clk",
2414 .parent_names = (const char *[]){
2415 "gcc_qupv3_wrap1_s6_clk_src",
2416 },
2417 .num_parents = 1,
2418 .flags = CLK_SET_RATE_PARENT,
2419 .ops = &clk_branch2_ops,
2420 },
2421 },
2422};
2423
2424static struct clk_branch gcc_qupv3_wrap1_s7_clk = {
2425 .halt_reg = 0x18864,
2426 .halt_check = BRANCH_HALT_VOTED,
2427 .clkr = {
2428 .enable_reg = 0x5200c,
2429 .enable_mask = BIT(29),
2430 .hw.init = &(struct clk_init_data){
2431 .name = "gcc_qupv3_wrap1_s7_clk",
2432 .parent_names = (const char *[]){
2433 "gcc_qupv3_wrap1_s7_clk_src",
2434 },
2435 .num_parents = 1,
2436 .flags = CLK_SET_RATE_PARENT,
2437 .ops = &clk_branch2_ops,
2438 },
2439 },
2440};
2441
2442static struct clk_branch gcc_qupv3_wrap_0_m_ahb_clk = {
2443 .halt_reg = 0x17004,
2444 .halt_check = BRANCH_HALT_VOTED,
2445 .clkr = {
2446 .enable_reg = 0x5200c,
2447 .enable_mask = BIT(6),
2448 .hw.init = &(struct clk_init_data){
2449 .name = "gcc_qupv3_wrap_0_m_ahb_clk",
2450 .ops = &clk_branch2_ops,
2451 },
2452 },
2453};
2454
2455static struct clk_branch gcc_qupv3_wrap_0_s_ahb_clk = {
2456 .halt_reg = 0x17008,
2457 .halt_check = BRANCH_HALT_VOTED,
2458 .clkr = {
2459 .enable_reg = 0x5200c,
2460 .enable_mask = BIT(7),
2461 .hw.init = &(struct clk_init_data){
2462 .name = "gcc_qupv3_wrap_0_s_ahb_clk",
2463 .ops = &clk_branch2_ops,
2464 },
2465 },
2466};
2467
2468static struct clk_branch gcc_qupv3_wrap_1_m_ahb_clk = {
2469 .halt_reg = 0x1800c,
2470 .halt_check = BRANCH_HALT_VOTED,
2471 .clkr = {
2472 .enable_reg = 0x5200c,
2473 .enable_mask = BIT(20),
2474 .hw.init = &(struct clk_init_data){
2475 .name = "gcc_qupv3_wrap_1_m_ahb_clk",
2476 .ops = &clk_branch2_ops,
2477 },
2478 },
2479};
2480
2481static struct clk_branch gcc_qupv3_wrap_1_s_ahb_clk = {
2482 .halt_reg = 0x18010,
2483 .halt_check = BRANCH_HALT_VOTED,
2484 .clkr = {
2485 .enable_reg = 0x5200c,
2486 .enable_mask = BIT(21),
2487 .hw.init = &(struct clk_init_data){
2488 .name = "gcc_qupv3_wrap_1_s_ahb_clk",
2489 .ops = &clk_branch2_ops,
2490 },
2491 },
2492};
2493
2494static struct clk_branch gcc_rx1_usb2_clkref_clk = {
2495 .halt_reg = 0x8c014,
2496 .halt_check = BRANCH_HALT,
2497 .clkr = {
2498 .enable_reg = 0x8c014,
2499 .enable_mask = BIT(0),
2500 .hw.init = &(struct clk_init_data){
2501 .name = "gcc_rx1_usb2_clkref_clk",
2502 .ops = &clk_branch2_ops,
2503 },
2504 },
2505};
2506
2507static struct clk_branch gcc_rx2_qlink_clkref_clk = {
2508 .halt_reg = 0x8c018,
2509 .halt_check = BRANCH_HALT,
2510 .clkr = {
2511 .enable_reg = 0x8c018,
2512 .enable_mask = BIT(0),
2513 .hw.init = &(struct clk_init_data){
2514 .name = "gcc_rx2_qlink_clkref_clk",
2515 .ops = &clk_branch2_ops,
2516 },
2517 },
2518};
2519
2520static struct clk_branch gcc_rx3_modem_clkref_clk = {
2521 .halt_reg = 0x8c01c,
2522 .halt_check = BRANCH_HALT,
2523 .clkr = {
2524 .enable_reg = 0x8c01c,
2525 .enable_mask = BIT(0),
2526 .hw.init = &(struct clk_init_data){
2527 .name = "gcc_rx3_modem_clkref_clk",
2528 .ops = &clk_branch2_ops,
2529 },
2530 },
2531};
2532
2533static struct clk_branch gcc_sdcc2_ahb_clk = {
2534 .halt_reg = 0x14008,
2535 .halt_check = BRANCH_HALT,
2536 .clkr = {
2537 .enable_reg = 0x14008,
2538 .enable_mask = BIT(0),
2539 .hw.init = &(struct clk_init_data){
2540 .name = "gcc_sdcc2_ahb_clk",
2541 .ops = &clk_branch2_ops,
2542 },
2543 },
2544};
2545
2546static struct clk_branch gcc_sdcc2_apps_clk = {
2547 .halt_reg = 0x14004,
2548 .halt_check = BRANCH_HALT,
2549 .clkr = {
2550 .enable_reg = 0x14004,
2551 .enable_mask = BIT(0),
2552 .hw.init = &(struct clk_init_data){
2553 .name = "gcc_sdcc2_apps_clk",
2554 .parent_names = (const char *[]){
2555 "gcc_sdcc2_apps_clk_src",
2556 },
2557 .num_parents = 1,
2558 .flags = CLK_SET_RATE_PARENT,
2559 .ops = &clk_branch2_ops,
2560 },
2561 },
2562};
2563
2564static struct clk_branch gcc_sdcc4_ahb_clk = {
2565 .halt_reg = 0x16008,
2566 .halt_check = BRANCH_HALT,
2567 .clkr = {
2568 .enable_reg = 0x16008,
2569 .enable_mask = BIT(0),
2570 .hw.init = &(struct clk_init_data){
2571 .name = "gcc_sdcc4_ahb_clk",
2572 .ops = &clk_branch2_ops,
2573 },
2574 },
2575};
2576
2577static struct clk_branch gcc_sdcc4_apps_clk = {
2578 .halt_reg = 0x16004,
2579 .halt_check = BRANCH_HALT,
2580 .clkr = {
2581 .enable_reg = 0x16004,
2582 .enable_mask = BIT(0),
2583 .hw.init = &(struct clk_init_data){
2584 .name = "gcc_sdcc4_apps_clk",
2585 .parent_names = (const char *[]){
2586 "gcc_sdcc4_apps_clk_src",
2587 },
2588 .num_parents = 1,
2589 .flags = CLK_SET_RATE_PARENT,
2590 .ops = &clk_branch2_ops,
2591 },
2592 },
2593};
2594
2595static struct clk_branch gcc_sys_noc_cpuss_ahb_clk = {
2596 .halt_reg = 0x414c,
2597 .halt_check = BRANCH_HALT_VOTED,
2598 .clkr = {
2599 .enable_reg = 0x52004,
2600 .enable_mask = BIT(0),
2601 .hw.init = &(struct clk_init_data){
2602 .name = "gcc_sys_noc_cpuss_ahb_clk",
2603 .parent_names = (const char *[]){
2604 "gcc_cpuss_ahb_clk_src",
2605 },
2606 .num_parents = 1,
2607 .flags = CLK_SET_RATE_PARENT,
2608 .ops = &clk_branch2_ops,
2609 },
2610 },
2611};
2612
2613static struct clk_branch gcc_tsif_ahb_clk = {
2614 .halt_reg = 0x36004,
2615 .halt_check = BRANCH_HALT,
2616 .clkr = {
2617 .enable_reg = 0x36004,
2618 .enable_mask = BIT(0),
2619 .hw.init = &(struct clk_init_data){
2620 .name = "gcc_tsif_ahb_clk",
2621 .ops = &clk_branch2_ops,
2622 },
2623 },
2624};
2625
2626static struct clk_branch gcc_tsif_inactivity_timers_clk = {
2627 .halt_reg = 0x3600c,
2628 .halt_check = BRANCH_HALT,
2629 .clkr = {
2630 .enable_reg = 0x3600c,
2631 .enable_mask = BIT(0),
2632 .hw.init = &(struct clk_init_data){
2633 .name = "gcc_tsif_inactivity_timers_clk",
2634 .ops = &clk_branch2_ops,
2635 },
2636 },
2637};
2638
2639static struct clk_branch gcc_tsif_ref_clk = {
2640 .halt_reg = 0x36008,
2641 .halt_check = BRANCH_HALT,
2642 .clkr = {
2643 .enable_reg = 0x36008,
2644 .enable_mask = BIT(0),
2645 .hw.init = &(struct clk_init_data){
2646 .name = "gcc_tsif_ref_clk",
2647 .parent_names = (const char *[]){
2648 "gcc_tsif_ref_clk_src",
2649 },
2650 .num_parents = 1,
2651 .flags = CLK_SET_RATE_PARENT,
2652 .ops = &clk_branch2_ops,
2653 },
2654 },
2655};
2656
2657static struct clk_branch gcc_ufs_card_ahb_clk = {
2658 .halt_reg = 0x75010,
2659 .halt_check = BRANCH_HALT,
2660 .clkr = {
2661 .enable_reg = 0x75010,
2662 .enable_mask = BIT(0),
2663 .hw.init = &(struct clk_init_data){
2664 .name = "gcc_ufs_card_ahb_clk",
2665 .ops = &clk_branch2_ops,
2666 },
2667 },
2668};
2669
2670static struct clk_branch gcc_ufs_card_axi_clk = {
2671 .halt_reg = 0x7500c,
2672 .halt_check = BRANCH_HALT,
2673 .clkr = {
2674 .enable_reg = 0x7500c,
2675 .enable_mask = BIT(0),
2676 .hw.init = &(struct clk_init_data){
2677 .name = "gcc_ufs_card_axi_clk",
2678 .parent_names = (const char *[]){
2679 "gcc_ufs_card_axi_clk_src",
2680 },
2681 .num_parents = 1,
2682 .flags = CLK_SET_RATE_PARENT,
2683 .ops = &clk_branch2_ops,
2684 },
2685 },
2686};
2687
2688static struct clk_branch gcc_ufs_card_clkref_clk = {
2689 .halt_reg = 0x8c004,
2690 .halt_check = BRANCH_HALT,
2691 .clkr = {
2692 .enable_reg = 0x8c004,
2693 .enable_mask = BIT(0),
2694 .hw.init = &(struct clk_init_data){
2695 .name = "gcc_ufs_card_clkref_clk",
2696 .ops = &clk_branch2_ops,
2697 },
2698 },
2699};
2700
2701static struct clk_branch gcc_ufs_card_ice_core_clk = {
2702 .halt_reg = 0x75058,
2703 .halt_check = BRANCH_HALT,
2704 .clkr = {
2705 .enable_reg = 0x75058,
2706 .enable_mask = BIT(0),
2707 .hw.init = &(struct clk_init_data){
2708 .name = "gcc_ufs_card_ice_core_clk",
2709 .parent_names = (const char *[]){
2710 "gcc_ufs_card_ice_core_clk_src",
2711 },
2712 .num_parents = 1,
2713 .flags = CLK_SET_RATE_PARENT,
2714 .ops = &clk_branch2_ops,
2715 },
2716 },
2717};
2718
2719static struct clk_branch gcc_ufs_card_phy_aux_clk = {
2720 .halt_reg = 0x7508c,
2721 .halt_check = BRANCH_HALT,
2722 .clkr = {
2723 .enable_reg = 0x7508c,
2724 .enable_mask = BIT(0),
2725 .hw.init = &(struct clk_init_data){
2726 .name = "gcc_ufs_card_phy_aux_clk",
2727 .parent_names = (const char *[]){
2728 "gcc_ufs_card_phy_aux_clk_src",
2729 },
2730 .num_parents = 1,
2731 .flags = CLK_SET_RATE_PARENT,
2732 .ops = &clk_branch2_ops,
2733 },
2734 },
2735};
2736
2737static struct clk_gate2 gcc_ufs_card_rx_symbol_0_clk = {
2738 .udelay = 500,
2739 .clkr = {
2740 .enable_reg = 0x75018,
2741 .enable_mask = BIT(0),
2742 .hw.init = &(struct clk_init_data){
2743 .name = "gcc_ufs_card_rx_symbol_0_clk",
2744 .ops = &clk_gate2_ops,
2745 },
2746 },
2747};
2748
2749static struct clk_gate2 gcc_ufs_card_rx_symbol_1_clk = {
2750 .udelay = 500,
2751 .clkr = {
2752 .enable_reg = 0x750a8,
2753 .enable_mask = BIT(0),
2754 .hw.init = &(struct clk_init_data){
2755 .name = "gcc_ufs_card_rx_symbol_1_clk",
2756 .ops = &clk_gate2_ops,
2757 },
2758 },
2759};
2760
2761static struct clk_gate2 gcc_ufs_card_tx_symbol_0_clk = {
2762 .udelay = 500,
2763 .clkr = {
2764 .enable_reg = 0x75014,
2765 .enable_mask = BIT(0),
2766 .hw.init = &(struct clk_init_data){
2767 .name = "gcc_ufs_card_tx_symbol_0_clk",
2768 .ops = &clk_gate2_ops,
2769 },
2770 },
2771};
2772
2773static struct clk_branch gcc_ufs_card_unipro_core_clk = {
2774 .halt_reg = 0x75054,
2775 .halt_check = BRANCH_HALT,
2776 .clkr = {
2777 .enable_reg = 0x75054,
2778 .enable_mask = BIT(0),
2779 .hw.init = &(struct clk_init_data){
2780 .name = "gcc_ufs_card_unipro_core_clk",
2781 .parent_names = (const char *[]){
2782 "gcc_ufs_card_unipro_core_clk_src",
2783 },
2784 .num_parents = 1,
2785 .flags = CLK_SET_RATE_PARENT,
2786 .ops = &clk_branch2_ops,
2787 },
2788 },
2789};
2790
2791static struct clk_branch gcc_ufs_mem_clkref_clk = {
2792 .halt_reg = 0x8c000,
2793 .halt_check = BRANCH_HALT,
2794 .clkr = {
2795 .enable_reg = 0x8c000,
2796 .enable_mask = BIT(0),
2797 .hw.init = &(struct clk_init_data){
2798 .name = "gcc_ufs_mem_clkref_clk",
2799 .ops = &clk_branch2_ops,
2800 },
2801 },
2802};
2803
2804static struct clk_branch gcc_ufs_phy_ahb_clk = {
2805 .halt_reg = 0x77010,
2806 .halt_check = BRANCH_HALT,
2807 .clkr = {
2808 .enable_reg = 0x77010,
2809 .enable_mask = BIT(0),
2810 .hw.init = &(struct clk_init_data){
2811 .name = "gcc_ufs_phy_ahb_clk",
2812 .ops = &clk_branch2_ops,
2813 },
2814 },
2815};
2816
2817static struct clk_branch gcc_ufs_phy_axi_clk = {
2818 .halt_reg = 0x7700c,
2819 .halt_check = BRANCH_HALT,
2820 .clkr = {
2821 .enable_reg = 0x7700c,
2822 .enable_mask = BIT(0),
2823 .hw.init = &(struct clk_init_data){
2824 .name = "gcc_ufs_phy_axi_clk",
2825 .parent_names = (const char *[]){
2826 "gcc_ufs_phy_axi_clk_src",
2827 },
2828 .num_parents = 1,
2829 .flags = CLK_SET_RATE_PARENT,
2830 .ops = &clk_branch2_ops,
2831 },
2832 },
2833};
2834
2835static struct clk_branch gcc_ufs_phy_ice_core_clk = {
2836 .halt_reg = 0x77058,
2837 .halt_check = BRANCH_HALT,
2838 .clkr = {
2839 .enable_reg = 0x77058,
2840 .enable_mask = BIT(0),
2841 .hw.init = &(struct clk_init_data){
2842 .name = "gcc_ufs_phy_ice_core_clk",
2843 .parent_names = (const char *[]){
2844 "gcc_ufs_phy_ice_core_clk_src",
2845 },
2846 .num_parents = 1,
2847 .flags = CLK_SET_RATE_PARENT,
2848 .ops = &clk_branch2_ops,
2849 },
2850 },
2851};
2852
2853static struct clk_branch gcc_ufs_phy_phy_aux_clk = {
2854 .halt_reg = 0x7708c,
2855 .halt_check = BRANCH_HALT,
2856 .clkr = {
2857 .enable_reg = 0x7708c,
2858 .enable_mask = BIT(0),
2859 .hw.init = &(struct clk_init_data){
2860 .name = "gcc_ufs_phy_phy_aux_clk",
2861 .parent_names = (const char *[]){
2862 "gcc_ufs_phy_phy_aux_clk_src",
2863 },
2864 .num_parents = 1,
2865 .flags = CLK_SET_RATE_PARENT,
2866 .ops = &clk_branch2_ops,
2867 },
2868 },
2869};
2870
2871static struct clk_gate2 gcc_ufs_phy_rx_symbol_0_clk = {
2872 .udelay = 500,
2873 .clkr = {
2874 .enable_reg = 0x77018,
2875 .enable_mask = BIT(0),
2876 .hw.init = &(struct clk_init_data){
2877 .name = "gcc_ufs_phy_rx_symbol_0_clk",
2878 .ops = &clk_gate2_ops,
2879 },
2880 },
2881};
2882
2883static struct clk_gate2 gcc_ufs_phy_rx_symbol_1_clk = {
2884 .udelay = 500,
2885 .clkr = {
2886 .enable_reg = 0x770a8,
2887 .enable_mask = BIT(0),
2888 .hw.init = &(struct clk_init_data){
2889 .name = "gcc_ufs_phy_rx_symbol_1_clk",
2890 .ops = &clk_gate2_ops,
2891 },
2892 },
2893};
2894
2895static struct clk_gate2 gcc_ufs_phy_tx_symbol_0_clk = {
2896 .udelay = 500,
2897 .clkr = {
2898 .enable_reg = 0x77014,
2899 .enable_mask = BIT(0),
2900 .hw.init = &(struct clk_init_data){
2901 .name = "gcc_ufs_phy_tx_symbol_0_clk",
2902 .ops = &clk_gate2_ops,
2903 },
2904 },
2905};
2906
2907static struct clk_branch gcc_ufs_phy_unipro_core_clk = {
2908 .halt_reg = 0x77054,
2909 .halt_check = BRANCH_HALT,
2910 .clkr = {
2911 .enable_reg = 0x77054,
2912 .enable_mask = BIT(0),
2913 .hw.init = &(struct clk_init_data){
2914 .name = "gcc_ufs_phy_unipro_core_clk",
2915 .parent_names = (const char *[]){
2916 "gcc_ufs_phy_unipro_core_clk_src",
2917 },
2918 .num_parents = 1,
2919 .flags = CLK_SET_RATE_PARENT,
2920 .ops = &clk_branch2_ops,
2921 },
2922 },
2923};
2924
2925static struct clk_branch gcc_usb30_prim_master_clk = {
2926 .halt_reg = 0xf00c,
2927 .halt_check = BRANCH_HALT,
2928 .clkr = {
2929 .enable_reg = 0xf00c,
2930 .enable_mask = BIT(0),
2931 .hw.init = &(struct clk_init_data){
2932 .name = "gcc_usb30_prim_master_clk",
2933 .parent_names = (const char *[]){
2934 "gcc_usb30_prim_master_clk_src",
2935 },
2936 .num_parents = 1,
2937 .flags = CLK_SET_RATE_PARENT,
2938 .ops = &clk_branch2_ops,
2939 },
2940 },
2941};
2942
2943static struct clk_branch gcc_usb30_prim_mock_utmi_clk = {
2944 .halt_reg = 0xf014,
2945 .halt_check = BRANCH_HALT,
2946 .clkr = {
2947 .enable_reg = 0xf014,
2948 .enable_mask = BIT(0),
2949 .hw.init = &(struct clk_init_data){
2950 .name = "gcc_usb30_prim_mock_utmi_clk",
2951 .parent_names = (const char *[]){
2952 "gcc_usb30_prim_mock_utmi_clk_src",
2953 },
2954 .num_parents = 1,
2955 .flags = CLK_SET_RATE_PARENT,
2956 .ops = &clk_branch2_ops,
2957 },
2958 },
2959};
2960
2961static struct clk_branch gcc_usb30_prim_sleep_clk = {
2962 .halt_reg = 0xf010,
2963 .halt_check = BRANCH_HALT,
2964 .clkr = {
2965 .enable_reg = 0xf010,
2966 .enable_mask = BIT(0),
2967 .hw.init = &(struct clk_init_data){
2968 .name = "gcc_usb30_prim_sleep_clk",
2969 .ops = &clk_branch2_ops,
2970 },
2971 },
2972};
2973
2974static struct clk_branch gcc_usb30_sec_master_clk = {
2975 .halt_reg = 0x1000c,
2976 .halt_check = BRANCH_HALT,
2977 .clkr = {
2978 .enable_reg = 0x1000c,
2979 .enable_mask = BIT(0),
2980 .hw.init = &(struct clk_init_data){
2981 .name = "gcc_usb30_sec_master_clk",
2982 .parent_names = (const char *[]){
2983 "gcc_usb30_sec_master_clk_src",
2984 },
2985 .num_parents = 1,
2986 .flags = CLK_SET_RATE_PARENT,
2987 .ops = &clk_branch2_ops,
2988 },
2989 },
2990};
2991
2992static struct clk_branch gcc_usb30_sec_mock_utmi_clk = {
2993 .halt_reg = 0x10014,
2994 .halt_check = BRANCH_HALT,
2995 .clkr = {
2996 .enable_reg = 0x10014,
2997 .enable_mask = BIT(0),
2998 .hw.init = &(struct clk_init_data){
2999 .name = "gcc_usb30_sec_mock_utmi_clk",
3000 .parent_names = (const char *[]){
3001 "gcc_usb30_sec_mock_utmi_clk_src",
3002 },
3003 .num_parents = 1,
3004 .flags = CLK_SET_RATE_PARENT,
3005 .ops = &clk_branch2_ops,
3006 },
3007 },
3008};
3009
3010static struct clk_branch gcc_usb30_sec_sleep_clk = {
3011 .halt_reg = 0x10010,
3012 .halt_check = BRANCH_HALT,
3013 .clkr = {
3014 .enable_reg = 0x10010,
3015 .enable_mask = BIT(0),
3016 .hw.init = &(struct clk_init_data){
3017 .name = "gcc_usb30_sec_sleep_clk",
3018 .ops = &clk_branch2_ops,
3019 },
3020 },
3021};
3022
3023static struct clk_branch gcc_usb3_prim_clkref_clk = {
3024 .halt_reg = 0x8c008,
3025 .halt_check = BRANCH_HALT,
3026 .clkr = {
3027 .enable_reg = 0x8c008,
3028 .enable_mask = BIT(0),
3029 .hw.init = &(struct clk_init_data){
3030 .name = "gcc_usb3_prim_clkref_clk",
3031 .ops = &clk_branch2_ops,
3032 },
3033 },
3034};
3035
3036static struct clk_branch gcc_usb3_prim_phy_aux_clk = {
3037 .halt_reg = 0xf04c,
3038 .halt_check = BRANCH_HALT,
3039 .clkr = {
3040 .enable_reg = 0xf04c,
3041 .enable_mask = BIT(0),
3042 .hw.init = &(struct clk_init_data){
3043 .name = "gcc_usb3_prim_phy_aux_clk",
3044 .parent_names = (const char *[]){
3045 "gcc_usb3_prim_phy_aux_clk_src",
3046 },
3047 .num_parents = 1,
3048 .flags = CLK_SET_RATE_PARENT,
3049 .ops = &clk_branch2_ops,
3050 },
3051 },
3052};
3053
3054static struct clk_branch gcc_usb3_prim_phy_com_aux_clk = {
3055 .halt_reg = 0xf050,
3056 .halt_check = BRANCH_HALT,
3057 .clkr = {
3058 .enable_reg = 0xf050,
3059 .enable_mask = BIT(0),
3060 .hw.init = &(struct clk_init_data){
3061 .name = "gcc_usb3_prim_phy_com_aux_clk",
3062 .parent_names = (const char *[]){
3063 "gcc_usb3_prim_phy_aux_clk_src",
3064 },
3065 .num_parents = 1,
3066 .flags = CLK_SET_RATE_PARENT,
3067 .ops = &clk_branch2_ops,
3068 },
3069 },
3070};
3071
3072static struct clk_gate2 gcc_usb3_prim_phy_pipe_clk = {
3073 .udelay = 500,
3074 .clkr = {
3075 .enable_reg = 0xf054,
3076 .enable_mask = BIT(0),
3077 .hw.init = &(struct clk_init_data){
3078 .name = "gcc_usb3_prim_phy_pipe_clk",
3079 .ops = &clk_gate2_ops,
3080 },
3081 },
3082};
3083
3084static struct clk_branch gcc_usb3_sec_clkref_clk = {
3085 .halt_reg = 0x8c028,
3086 .halt_check = BRANCH_HALT,
3087 .clkr = {
3088 .enable_reg = 0x8c028,
3089 .enable_mask = BIT(0),
3090 .hw.init = &(struct clk_init_data){
3091 .name = "gcc_usb3_sec_clkref_clk",
3092 .ops = &clk_branch2_ops,
3093 },
3094 },
3095};
3096
3097static struct clk_branch gcc_usb3_sec_phy_aux_clk = {
3098 .halt_reg = 0x1004c,
3099 .halt_check = BRANCH_HALT,
3100 .clkr = {
3101 .enable_reg = 0x1004c,
3102 .enable_mask = BIT(0),
3103 .hw.init = &(struct clk_init_data){
3104 .name = "gcc_usb3_sec_phy_aux_clk",
3105 .parent_names = (const char *[]){
3106 "gcc_usb3_sec_phy_aux_clk_src",
3107 },
3108 .num_parents = 1,
3109 .flags = CLK_SET_RATE_PARENT,
3110 .ops = &clk_branch2_ops,
3111 },
3112 },
3113};
3114
3115static struct clk_branch gcc_usb3_sec_phy_com_aux_clk = {
3116 .halt_reg = 0x10050,
3117 .halt_check = BRANCH_HALT,
3118 .clkr = {
3119 .enable_reg = 0x10050,
3120 .enable_mask = BIT(0),
3121 .hw.init = &(struct clk_init_data){
3122 .name = "gcc_usb3_sec_phy_com_aux_clk",
3123 .parent_names = (const char *[]){
3124 "gcc_usb3_sec_phy_aux_clk_src",
3125 },
3126 .num_parents = 1,
3127 .flags = CLK_SET_RATE_PARENT,
3128 .ops = &clk_branch2_ops,
3129 },
3130 },
3131};
3132
3133static struct clk_gate2 gcc_usb3_sec_phy_pipe_clk = {
3134 .udelay = 500,
3135 .clkr = {
3136 .enable_reg = 0x10054,
3137 .enable_mask = BIT(0),
3138 .hw.init = &(struct clk_init_data){
3139 .name = "gcc_usb3_sec_phy_pipe_clk",
3140 .ops = &clk_gate2_ops,
3141 },
3142 },
3143};
3144
3145static struct clk_branch gcc_usb_phy_cfg_ahb2phy_clk = {
3146 .halt_reg = 0x6a004,
3147 .halt_check = BRANCH_HALT,
3148 .clkr = {
3149 .enable_reg = 0x6a004,
3150 .enable_mask = BIT(0),
3151 .hw.init = &(struct clk_init_data){
3152 .name = "gcc_usb_phy_cfg_ahb2phy_clk",
3153 .ops = &clk_branch2_ops,
3154 },
3155 },
3156};
3157
3158static struct clk_branch gcc_video_ahb_clk = {
3159 .halt_reg = 0xb004,
3160 .halt_check = BRANCH_HALT,
3161 .clkr = {
3162 .enable_reg = 0xb004,
3163 .enable_mask = BIT(0),
3164 .hw.init = &(struct clk_init_data){
3165 .name = "gcc_video_ahb_clk",
3166 .ops = &clk_branch2_ops,
3167 },
3168 },
3169};
3170
3171static struct clk_branch gcc_video_axi_clk = {
3172 .halt_reg = 0xb01c,
3173 .halt_check = BRANCH_VOTED,
3174 .clkr = {
3175 .enable_reg = 0xb01c,
3176 .enable_mask = BIT(0),
3177 .hw.init = &(struct clk_init_data){
3178 .name = "gcc_video_axi_clk",
3179 .ops = &clk_branch2_ops,
3180 },
3181 },
3182};
3183
3184static struct clk_branch gcc_video_xo_clk = {
3185 .halt_reg = 0xb028,
3186 .halt_check = BRANCH_HALT,
3187 .clkr = {
3188 .enable_reg = 0xb028,
3189 .enable_mask = BIT(0),
3190 .hw.init = &(struct clk_init_data){
3191 .name = "gcc_video_xo_clk",
3192 .ops = &clk_branch2_ops,
3193 },
3194 },
3195};
3196
Kyle Yan6a20fae2017-02-14 13:34:41 -08003197static struct clk_regmap *gcc_sdm845_clocks[] = {
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003198 [GCC_AGGRE_NOC_PCIE_TBU_CLK] = &gcc_aggre_noc_pcie_tbu_clk.clkr,
3199 [GCC_AGGRE_UFS_CARD_AXI_CLK] = &gcc_aggre_ufs_card_axi_clk.clkr,
3200 [GCC_AGGRE_UFS_PHY_AXI_CLK] = &gcc_aggre_ufs_phy_axi_clk.clkr,
3201 [GCC_AGGRE_USB3_PRIM_AXI_CLK] = &gcc_aggre_usb3_prim_axi_clk.clkr,
3202 [GCC_AGGRE_USB3_SEC_AXI_CLK] = &gcc_aggre_usb3_sec_axi_clk.clkr,
3203 [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr,
3204 [GCC_CAMERA_AHB_CLK] = &gcc_camera_ahb_clk.clkr,
3205 [GCC_CAMERA_AXI_CLK] = &gcc_camera_axi_clk.clkr,
3206 [GCC_CAMERA_XO_CLK] = &gcc_camera_xo_clk.clkr,
3207 [GCC_CE1_AHB_CLK] = &gcc_ce1_ahb_clk.clkr,
3208 [GCC_CE1_AXI_CLK] = &gcc_ce1_axi_clk.clkr,
3209 [GCC_CE1_CLK] = &gcc_ce1_clk.clkr,
3210 [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr,
3211 [GCC_CFG_NOC_USB3_SEC_AXI_CLK] = &gcc_cfg_noc_usb3_sec_axi_clk.clkr,
3212 [GCC_CPUSS_AHB_CLK] = &gcc_cpuss_ahb_clk.clkr,
3213 [GCC_CPUSS_AHB_CLK_SRC] = &gcc_cpuss_ahb_clk_src.clkr,
3214 [GCC_CPUSS_DVM_BUS_CLK] = &gcc_cpuss_dvm_bus_clk.clkr,
3215 [GCC_CPUSS_GNOC_CLK] = &gcc_cpuss_gnoc_clk.clkr,
3216 [GCC_CPUSS_RBCPR_CLK] = &gcc_cpuss_rbcpr_clk.clkr,
3217 [GCC_CPUSS_RBCPR_CLK_SRC] = &gcc_cpuss_rbcpr_clk_src.clkr,
3218 [GCC_CXO_TX1_CLKREF_CLK] = &gcc_cxo_tx1_clkref_clk.clkr,
3219 [GCC_DDRSS_GPU_AXI_CLK] = &gcc_ddrss_gpu_axi_clk.clkr,
3220 [GCC_DISP_AHB_CLK] = &gcc_disp_ahb_clk.clkr,
3221 [GCC_DISP_AXI_CLK] = &gcc_disp_axi_clk.clkr,
3222 [GCC_DISP_GPLL0_CLK_SRC] = &gcc_disp_gpll0_clk_src.clkr,
3223 [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr,
3224 [GCC_DISP_XO_CLK] = &gcc_disp_xo_clk.clkr,
3225 [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
3226 [GCC_GP1_CLK_SRC] = &gcc_gp1_clk_src.clkr,
3227 [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
3228 [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr,
3229 [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
3230 [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr,
3231 [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr,
3232 [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr,
3233 [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr,
3234 [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr,
3235 [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr,
3236 [GCC_MMSS_QM_AHB_CLK] = &gcc_mmss_qm_ahb_clk.clkr,
3237 [GCC_MMSS_QM_CORE_CLK] = &gcc_mmss_qm_core_clk.clkr,
3238 [GCC_MMSS_QM_CORE_CLK_SRC] = &gcc_mmss_qm_core_clk_src.clkr,
3239 [GCC_MSS_AXIS2_CLK] = &gcc_mss_axis2_clk.clkr,
3240 [GCC_MSS_CFG_AHB_CLK] = &gcc_mss_cfg_ahb_clk.clkr,
3241 [GCC_MSS_GPLL0_DIV_CLK_SRC] = &gcc_mss_gpll0_div_clk_src.clkr,
3242 [GCC_MSS_MFAB_AXIS_CLK] = &gcc_mss_mfab_axis_clk.clkr,
3243 [GCC_MSS_Q6_MEMNOC_AXI_CLK] = &gcc_mss_q6_memnoc_axi_clk.clkr,
3244 [GCC_MSS_SNOC_AXI_CLK] = &gcc_mss_snoc_axi_clk.clkr,
3245 [GCC_PCIE_0_AUX_CLK] = &gcc_pcie_0_aux_clk.clkr,
3246 [GCC_PCIE_0_AUX_CLK_SRC] = &gcc_pcie_0_aux_clk_src.clkr,
3247 [GCC_PCIE_0_CFG_AHB_CLK] = &gcc_pcie_0_cfg_ahb_clk.clkr,
3248 [GCC_PCIE_0_CLKREF_CLK] = &gcc_pcie_0_clkref_clk.clkr,
3249 [GCC_PCIE_0_MSTR_AXI_CLK] = &gcc_pcie_0_mstr_axi_clk.clkr,
3250 [GCC_PCIE_0_PIPE_CLK] = &gcc_pcie_0_pipe_clk.clkr,
3251 [GCC_PCIE_0_SLV_AXI_CLK] = &gcc_pcie_0_slv_axi_clk.clkr,
3252 [GCC_PCIE_0_SLV_Q2A_AXI_CLK] = &gcc_pcie_0_slv_q2a_axi_clk.clkr,
3253 [GCC_PCIE_1_AUX_CLK] = &gcc_pcie_1_aux_clk.clkr,
3254 [GCC_PCIE_1_AUX_CLK_SRC] = &gcc_pcie_1_aux_clk_src.clkr,
3255 [GCC_PCIE_1_CFG_AHB_CLK] = &gcc_pcie_1_cfg_ahb_clk.clkr,
3256 [GCC_PCIE_1_CLKREF_CLK] = &gcc_pcie_1_clkref_clk.clkr,
3257 [GCC_PCIE_1_MSTR_AXI_CLK] = &gcc_pcie_1_mstr_axi_clk.clkr,
3258 [GCC_PCIE_1_PIPE_CLK] = &gcc_pcie_1_pipe_clk.clkr,
3259 [GCC_PCIE_1_SLV_AXI_CLK] = &gcc_pcie_1_slv_axi_clk.clkr,
3260 [GCC_PCIE_1_SLV_Q2A_AXI_CLK] = &gcc_pcie_1_slv_q2a_axi_clk.clkr,
3261 [GCC_PCIE_PHY_AUX_CLK] = &gcc_pcie_phy_aux_clk.clkr,
3262 [GCC_PCIE_PHY_REFGEN_CLK] = &gcc_pcie_phy_refgen_clk.clkr,
3263 [GCC_PCIE_PHY_REFGEN_CLK_SRC] = &gcc_pcie_phy_refgen_clk_src.clkr,
3264 [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr,
3265 [GCC_PDM2_CLK_SRC] = &gcc_pdm2_clk_src.clkr,
3266 [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr,
3267 [GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr,
3268 [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
3269 [GCC_QMIP_CAMERA_AHB_CLK] = &gcc_qmip_camera_ahb_clk.clkr,
3270 [GCC_QMIP_DISP_AHB_CLK] = &gcc_qmip_disp_ahb_clk.clkr,
3271 [GCC_QMIP_VIDEO_AHB_CLK] = &gcc_qmip_video_ahb_clk.clkr,
3272 [GCC_QUPV3_WRAP0_CORE_2X_CLK] = &gcc_qupv3_wrap0_core_2x_clk.clkr,
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003273 [GCC_QUPV3_WRAP0_CORE_CLK] = &gcc_qupv3_wrap0_core_clk.clkr,
3274 [GCC_QUPV3_WRAP0_S0_CLK] = &gcc_qupv3_wrap0_s0_clk.clkr,
3275 [GCC_QUPV3_WRAP0_S0_CLK_SRC] = &gcc_qupv3_wrap0_s0_clk_src.clkr,
3276 [GCC_QUPV3_WRAP0_S1_CLK] = &gcc_qupv3_wrap0_s1_clk.clkr,
3277 [GCC_QUPV3_WRAP0_S1_CLK_SRC] = &gcc_qupv3_wrap0_s1_clk_src.clkr,
3278 [GCC_QUPV3_WRAP0_S2_CLK] = &gcc_qupv3_wrap0_s2_clk.clkr,
3279 [GCC_QUPV3_WRAP0_S2_CLK_SRC] = &gcc_qupv3_wrap0_s2_clk_src.clkr,
3280 [GCC_QUPV3_WRAP0_S3_CLK] = &gcc_qupv3_wrap0_s3_clk.clkr,
3281 [GCC_QUPV3_WRAP0_S3_CLK_SRC] = &gcc_qupv3_wrap0_s3_clk_src.clkr,
3282 [GCC_QUPV3_WRAP0_S4_CLK] = &gcc_qupv3_wrap0_s4_clk.clkr,
3283 [GCC_QUPV3_WRAP0_S4_CLK_SRC] = &gcc_qupv3_wrap0_s4_clk_src.clkr,
3284 [GCC_QUPV3_WRAP0_S5_CLK] = &gcc_qupv3_wrap0_s5_clk.clkr,
3285 [GCC_QUPV3_WRAP0_S5_CLK_SRC] = &gcc_qupv3_wrap0_s5_clk_src.clkr,
3286 [GCC_QUPV3_WRAP0_S6_CLK] = &gcc_qupv3_wrap0_s6_clk.clkr,
3287 [GCC_QUPV3_WRAP0_S6_CLK_SRC] = &gcc_qupv3_wrap0_s6_clk_src.clkr,
3288 [GCC_QUPV3_WRAP0_S7_CLK] = &gcc_qupv3_wrap0_s7_clk.clkr,
3289 [GCC_QUPV3_WRAP0_S7_CLK_SRC] = &gcc_qupv3_wrap0_s7_clk_src.clkr,
3290 [GCC_QUPV3_WRAP1_CORE_2X_CLK] = &gcc_qupv3_wrap1_core_2x_clk.clkr,
3291 [GCC_QUPV3_WRAP1_CORE_CLK] = &gcc_qupv3_wrap1_core_clk.clkr,
3292 [GCC_QUPV3_WRAP1_S0_CLK] = &gcc_qupv3_wrap1_s0_clk.clkr,
3293 [GCC_QUPV3_WRAP1_S0_CLK_SRC] = &gcc_qupv3_wrap1_s0_clk_src.clkr,
3294 [GCC_QUPV3_WRAP1_S1_CLK] = &gcc_qupv3_wrap1_s1_clk.clkr,
3295 [GCC_QUPV3_WRAP1_S1_CLK_SRC] = &gcc_qupv3_wrap1_s1_clk_src.clkr,
3296 [GCC_QUPV3_WRAP1_S2_CLK] = &gcc_qupv3_wrap1_s2_clk.clkr,
3297 [GCC_QUPV3_WRAP1_S2_CLK_SRC] = &gcc_qupv3_wrap1_s2_clk_src.clkr,
3298 [GCC_QUPV3_WRAP1_S3_CLK] = &gcc_qupv3_wrap1_s3_clk.clkr,
3299 [GCC_QUPV3_WRAP1_S3_CLK_SRC] = &gcc_qupv3_wrap1_s3_clk_src.clkr,
3300 [GCC_QUPV3_WRAP1_S4_CLK] = &gcc_qupv3_wrap1_s4_clk.clkr,
3301 [GCC_QUPV3_WRAP1_S4_CLK_SRC] = &gcc_qupv3_wrap1_s4_clk_src.clkr,
3302 [GCC_QUPV3_WRAP1_S5_CLK] = &gcc_qupv3_wrap1_s5_clk.clkr,
3303 [GCC_QUPV3_WRAP1_S5_CLK_SRC] = &gcc_qupv3_wrap1_s5_clk_src.clkr,
3304 [GCC_QUPV3_WRAP1_S6_CLK] = &gcc_qupv3_wrap1_s6_clk.clkr,
3305 [GCC_QUPV3_WRAP1_S6_CLK_SRC] = &gcc_qupv3_wrap1_s6_clk_src.clkr,
3306 [GCC_QUPV3_WRAP1_S7_CLK] = &gcc_qupv3_wrap1_s7_clk.clkr,
3307 [GCC_QUPV3_WRAP1_S7_CLK_SRC] = &gcc_qupv3_wrap1_s7_clk_src.clkr,
3308 [GCC_QUPV3_WRAP_0_M_AHB_CLK] = &gcc_qupv3_wrap_0_m_ahb_clk.clkr,
3309 [GCC_QUPV3_WRAP_0_S_AHB_CLK] = &gcc_qupv3_wrap_0_s_ahb_clk.clkr,
3310 [GCC_QUPV3_WRAP_1_M_AHB_CLK] = &gcc_qupv3_wrap_1_m_ahb_clk.clkr,
3311 [GCC_QUPV3_WRAP_1_S_AHB_CLK] = &gcc_qupv3_wrap_1_s_ahb_clk.clkr,
3312 [GCC_RX1_USB2_CLKREF_CLK] = &gcc_rx1_usb2_clkref_clk.clkr,
3313 [GCC_RX2_QLINK_CLKREF_CLK] = &gcc_rx2_qlink_clkref_clk.clkr,
3314 [GCC_RX3_MODEM_CLKREF_CLK] = &gcc_rx3_modem_clkref_clk.clkr,
3315 [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr,
3316 [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr,
3317 [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr,
3318 [GCC_SDCC4_AHB_CLK] = &gcc_sdcc4_ahb_clk.clkr,
3319 [GCC_SDCC4_APPS_CLK] = &gcc_sdcc4_apps_clk.clkr,
3320 [GCC_SDCC4_APPS_CLK_SRC] = &gcc_sdcc4_apps_clk_src.clkr,
3321 [GCC_SYS_NOC_CPUSS_AHB_CLK] = &gcc_sys_noc_cpuss_ahb_clk.clkr,
3322 [GCC_TSIF_AHB_CLK] = &gcc_tsif_ahb_clk.clkr,
3323 [GCC_TSIF_INACTIVITY_TIMERS_CLK] =
3324 &gcc_tsif_inactivity_timers_clk.clkr,
3325 [GCC_TSIF_REF_CLK] = &gcc_tsif_ref_clk.clkr,
3326 [GCC_TSIF_REF_CLK_SRC] = &gcc_tsif_ref_clk_src.clkr,
3327 [GCC_UFS_CARD_AHB_CLK] = &gcc_ufs_card_ahb_clk.clkr,
3328 [GCC_UFS_CARD_AXI_CLK] = &gcc_ufs_card_axi_clk.clkr,
3329 [GCC_UFS_CARD_AXI_CLK_SRC] = &gcc_ufs_card_axi_clk_src.clkr,
3330 [GCC_UFS_CARD_CLKREF_CLK] = &gcc_ufs_card_clkref_clk.clkr,
3331 [GCC_UFS_CARD_ICE_CORE_CLK] = &gcc_ufs_card_ice_core_clk.clkr,
3332 [GCC_UFS_CARD_ICE_CORE_CLK_SRC] = &gcc_ufs_card_ice_core_clk_src.clkr,
3333 [GCC_UFS_CARD_PHY_AUX_CLK] = &gcc_ufs_card_phy_aux_clk.clkr,
3334 [GCC_UFS_CARD_PHY_AUX_CLK_SRC] = &gcc_ufs_card_phy_aux_clk_src.clkr,
3335 [GCC_UFS_CARD_RX_SYMBOL_0_CLK] = &gcc_ufs_card_rx_symbol_0_clk.clkr,
3336 [GCC_UFS_CARD_RX_SYMBOL_1_CLK] = &gcc_ufs_card_rx_symbol_1_clk.clkr,
3337 [GCC_UFS_CARD_TX_SYMBOL_0_CLK] = &gcc_ufs_card_tx_symbol_0_clk.clkr,
3338 [GCC_UFS_CARD_UNIPRO_CORE_CLK] = &gcc_ufs_card_unipro_core_clk.clkr,
3339 [GCC_UFS_CARD_UNIPRO_CORE_CLK_SRC] =
3340 &gcc_ufs_card_unipro_core_clk_src.clkr,
3341 [GCC_UFS_MEM_CLKREF_CLK] = &gcc_ufs_mem_clkref_clk.clkr,
3342 [GCC_UFS_PHY_AHB_CLK] = &gcc_ufs_phy_ahb_clk.clkr,
3343 [GCC_UFS_PHY_AXI_CLK] = &gcc_ufs_phy_axi_clk.clkr,
3344 [GCC_UFS_PHY_AXI_CLK_SRC] = &gcc_ufs_phy_axi_clk_src.clkr,
3345 [GCC_UFS_PHY_ICE_CORE_CLK] = &gcc_ufs_phy_ice_core_clk.clkr,
3346 [GCC_UFS_PHY_ICE_CORE_CLK_SRC] = &gcc_ufs_phy_ice_core_clk_src.clkr,
3347 [GCC_UFS_PHY_PHY_AUX_CLK] = &gcc_ufs_phy_phy_aux_clk.clkr,
3348 [GCC_UFS_PHY_PHY_AUX_CLK_SRC] = &gcc_ufs_phy_phy_aux_clk_src.clkr,
3349 [GCC_UFS_PHY_RX_SYMBOL_0_CLK] = &gcc_ufs_phy_rx_symbol_0_clk.clkr,
3350 [GCC_UFS_PHY_RX_SYMBOL_1_CLK] = &gcc_ufs_phy_rx_symbol_1_clk.clkr,
3351 [GCC_UFS_PHY_TX_SYMBOL_0_CLK] = &gcc_ufs_phy_tx_symbol_0_clk.clkr,
3352 [GCC_UFS_PHY_UNIPRO_CORE_CLK] = &gcc_ufs_phy_unipro_core_clk.clkr,
3353 [GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC] =
3354 &gcc_ufs_phy_unipro_core_clk_src.clkr,
3355 [GCC_USB30_PRIM_MASTER_CLK] = &gcc_usb30_prim_master_clk.clkr,
3356 [GCC_USB30_PRIM_MASTER_CLK_SRC] = &gcc_usb30_prim_master_clk_src.clkr,
3357 [GCC_USB30_PRIM_MOCK_UTMI_CLK] = &gcc_usb30_prim_mock_utmi_clk.clkr,
3358 [GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC] =
3359 &gcc_usb30_prim_mock_utmi_clk_src.clkr,
3360 [GCC_USB30_PRIM_SLEEP_CLK] = &gcc_usb30_prim_sleep_clk.clkr,
3361 [GCC_USB30_SEC_MASTER_CLK] = &gcc_usb30_sec_master_clk.clkr,
3362 [GCC_USB30_SEC_MASTER_CLK_SRC] = &gcc_usb30_sec_master_clk_src.clkr,
3363 [GCC_USB30_SEC_MOCK_UTMI_CLK] = &gcc_usb30_sec_mock_utmi_clk.clkr,
3364 [GCC_USB30_SEC_MOCK_UTMI_CLK_SRC] =
3365 &gcc_usb30_sec_mock_utmi_clk_src.clkr,
3366 [GCC_USB30_SEC_SLEEP_CLK] = &gcc_usb30_sec_sleep_clk.clkr,
3367 [GCC_USB3_PRIM_CLKREF_CLK] = &gcc_usb3_prim_clkref_clk.clkr,
3368 [GCC_USB3_PRIM_PHY_AUX_CLK] = &gcc_usb3_prim_phy_aux_clk.clkr,
3369 [GCC_USB3_PRIM_PHY_AUX_CLK_SRC] = &gcc_usb3_prim_phy_aux_clk_src.clkr,
3370 [GCC_USB3_PRIM_PHY_COM_AUX_CLK] = &gcc_usb3_prim_phy_com_aux_clk.clkr,
3371 [GCC_USB3_PRIM_PHY_PIPE_CLK] = &gcc_usb3_prim_phy_pipe_clk.clkr,
3372 [GCC_USB3_SEC_CLKREF_CLK] = &gcc_usb3_sec_clkref_clk.clkr,
3373 [GCC_USB3_SEC_PHY_AUX_CLK] = &gcc_usb3_sec_phy_aux_clk.clkr,
3374 [GCC_USB3_SEC_PHY_AUX_CLK_SRC] = &gcc_usb3_sec_phy_aux_clk_src.clkr,
3375 [GCC_USB3_SEC_PHY_COM_AUX_CLK] = &gcc_usb3_sec_phy_com_aux_clk.clkr,
3376 [GCC_USB3_SEC_PHY_PIPE_CLK] = &gcc_usb3_sec_phy_pipe_clk.clkr,
3377 [GCC_USB_PHY_CFG_AHB2PHY_CLK] = &gcc_usb_phy_cfg_ahb2phy_clk.clkr,
3378 [GCC_VIDEO_AHB_CLK] = &gcc_video_ahb_clk.clkr,
3379 [GCC_VIDEO_AXI_CLK] = &gcc_video_axi_clk.clkr,
3380 [GCC_VIDEO_XO_CLK] = &gcc_video_xo_clk.clkr,
3381 [GPLL0] = &gpll0.clkr,
3382 [GPLL0_OUT_EVEN] = &gpll0_out_even.clkr,
3383 [GPLL1] = &gpll1.clkr,
3384};
3385
Kyle Yan6a20fae2017-02-14 13:34:41 -08003386static const struct qcom_reset_map gcc_sdm845_resets[] = {
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003387 [GCC_GPU_BCR] = { 0x71000 },
3388 [GCC_MMSS_BCR] = { 0xb000 },
3389 [GCC_PCIE_0_BCR] = { 0x6b000 },
3390 [GCC_PCIE_1_BCR] = { 0x8d000 },
3391 [GCC_PCIE_PHY_BCR] = { 0x6f000 },
3392 [GCC_PDM_BCR] = { 0x33000 },
3393 [GCC_PRNG_BCR] = { 0x34000 },
3394 [GCC_QUPV3_WRAPPER_0_BCR] = { 0x17000 },
3395 [GCC_QUPV3_WRAPPER_1_BCR] = { 0x18000 },
Deepak Katragadda15e9aca2017-03-14 14:10:59 -07003396 [GCC_QUSB2PHY_PRIM_BCR] = { 0x12000 },
3397 [GCC_QUSB2PHY_SEC_BCR] = { 0x12004 },
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003398 [GCC_SDCC2_BCR] = { 0x14000 },
3399 [GCC_SDCC4_BCR] = { 0x16000 },
3400 [GCC_TSIF_BCR] = { 0x36000 },
3401 [GCC_UFS_CARD_BCR] = { 0x75000 },
3402 [GCC_UFS_PHY_BCR] = { 0x77000 },
3403 [GCC_USB30_PRIM_BCR] = { 0xf000 },
3404 [GCC_USB30_SEC_BCR] = { 0x10000 },
Deepak Katragadda15e9aca2017-03-14 14:10:59 -07003405 [GCC_USB3_PHY_PRIM_BCR] = { 0x50000 },
3406 [GCC_USB3PHY_PHY_PRIM_BCR] = { 0x50004 },
3407 [GCC_USB3_DP_PHY_PRIM_BCR] = { 0x50008 },
3408 [GCC_USB3_PHY_SEC_BCR] = { 0x5000c },
3409 [GCC_USB3PHY_PHY_SEC_BCR] = { 0x50010 },
3410 [GCC_USB3_DP_PHY_SEC_BCR] = { 0x50014 },
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003411 [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 },
3412};
3413
Kyle Yan6a20fae2017-02-14 13:34:41 -08003414static const struct regmap_config gcc_sdm845_regmap_config = {
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003415 .reg_bits = 32,
3416 .reg_stride = 4,
3417 .val_bits = 32,
3418 .max_register = 0x182090,
3419 .fast_io = true,
3420};
3421
Kyle Yan6a20fae2017-02-14 13:34:41 -08003422static const struct qcom_cc_desc gcc_sdm845_desc = {
3423 .config = &gcc_sdm845_regmap_config,
3424 .clks = gcc_sdm845_clocks,
3425 .num_clks = ARRAY_SIZE(gcc_sdm845_clocks),
3426 .resets = gcc_sdm845_resets,
3427 .num_resets = ARRAY_SIZE(gcc_sdm845_resets),
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003428};
3429
Kyle Yan6a20fae2017-02-14 13:34:41 -08003430static const struct of_device_id gcc_sdm845_match_table[] = {
3431 { .compatible = "qcom,gcc-sdm845" },
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003432 { }
3433};
Kyle Yan6a20fae2017-02-14 13:34:41 -08003434MODULE_DEVICE_TABLE(of, gcc_sdm845_match_table);
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003435
Kyle Yan6a20fae2017-02-14 13:34:41 -08003436static int gcc_sdm845_probe(struct platform_device *pdev)
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003437{
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003438 struct regmap *regmap;
Osvaldo Banuelos3084b3a32017-02-15 13:10:33 -08003439 int ret = 0;
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003440
Kyle Yan6a20fae2017-02-14 13:34:41 -08003441 regmap = qcom_cc_map(pdev, &gcc_sdm845_desc);
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003442 if (IS_ERR(regmap))
3443 return PTR_ERR(regmap);
3444
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003445 /*
3446 * Set the CPUSS_AHB_CLK_SLEEP_ENA bit to allow the cpuss_ahb_clk to be
3447 * turned off by hardware during certain apps low power modes.
3448 */
3449 regmap_update_bits(regmap, GCC_APCS_CLOCK_SLEEP_ENA_VOTE_OFFSET,
3450 CPUSS_AHB_CLK_SLEEP_ENA, CPUSS_AHB_CLK_SLEEP_ENA);
3451
3452 vdd_cx.regulator[0] = devm_regulator_get(&pdev->dev, "vdd_cx");
3453 if (IS_ERR(vdd_cx.regulator[0])) {
3454 if (!(PTR_ERR(vdd_cx.regulator[0]) == -EPROBE_DEFER))
3455 dev_err(&pdev->dev,
3456 "Unable to get vdd_cx regulator\n");
3457 return PTR_ERR(vdd_cx.regulator[0]);
3458 }
3459
3460 vdd_cx_ao.regulator[0] = devm_regulator_get(&pdev->dev, "vdd_cx_ao");
3461 if (IS_ERR(vdd_cx_ao.regulator[0])) {
3462 if (!(PTR_ERR(vdd_cx_ao.regulator[0]) == -EPROBE_DEFER))
3463 dev_err(&pdev->dev,
3464 "Unable to get vdd_cx_ao regulator\n");
3465 return PTR_ERR(vdd_cx_ao.regulator[0]);
3466 }
3467
Kyle Yan6a20fae2017-02-14 13:34:41 -08003468 ret = qcom_cc_really_probe(pdev, &gcc_sdm845_desc, regmap);
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003469 if (ret) {
3470 dev_err(&pdev->dev, "Failed to register GCC clocks\n");
3471 return ret;
3472 }
3473
3474 /* Disable the GPLL0 active input to MMSS and GPU via MISC registers */
3475 regmap_update_bits(regmap, GCC_MMSS_MISC, 0x3, 0x3);
3476 regmap_update_bits(regmap, GCC_GPU_MISC, 0x3, 0x3);
3477
3478 /* Keep these HMSS clocks enabled always */
3479 clk_prepare_enable(gcc_cpuss_ahb_clk.clkr.hw.clk);
3480 clk_prepare_enable(gcc_cpuss_dvm_bus_clk.clkr.hw.clk);
3481 clk_prepare_enable(gcc_cpuss_gnoc_clk.clkr.hw.clk);
3482
3483 /* Keep the core XO clock enabled always */
3484 clk_prepare_enable(gcc_camera_xo_clk.clkr.hw.clk);
3485 clk_prepare_enable(gcc_disp_xo_clk.clkr.hw.clk);
3486 clk_prepare_enable(gcc_video_xo_clk.clkr.hw.clk);
3487
3488 /* Enable for core register access */
3489 clk_prepare_enable(gcc_gpu_cfg_ahb_clk.clkr.hw.clk);
3490 clk_prepare_enable(gcc_disp_ahb_clk.clkr.hw.clk);
3491 clk_prepare_enable(gcc_camera_ahb_clk.clkr.hw.clk);
3492 clk_prepare_enable(gcc_video_ahb_clk.clkr.hw.clk);
3493
3494 /*
3495 * TODO:
3496 * 1. Support HW clock measurement
3497 * 2. Support UFS clock hw_ctrl
3498 * 3. Support mux clock interface for pcie pipe clocks
3499 * 4. QUPv3 support
3500 */
3501
3502 dev_info(&pdev->dev, "Registered GCC clocks\n");
3503 return ret;
3504}
3505
Kyle Yan6a20fae2017-02-14 13:34:41 -08003506static struct platform_driver gcc_sdm845_driver = {
3507 .probe = gcc_sdm845_probe,
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003508 .driver = {
Kyle Yan6a20fae2017-02-14 13:34:41 -08003509 .name = "gcc-sdm845",
3510 .of_match_table = gcc_sdm845_match_table,
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003511 },
3512};
3513
Kyle Yan6a20fae2017-02-14 13:34:41 -08003514static int __init gcc_sdm845_init(void)
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003515{
Kyle Yan6a20fae2017-02-14 13:34:41 -08003516 return platform_driver_register(&gcc_sdm845_driver);
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003517}
Kyle Yan6a20fae2017-02-14 13:34:41 -08003518core_initcall(gcc_sdm845_init);
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003519
Kyle Yan6a20fae2017-02-14 13:34:41 -08003520static void __exit gcc_sdm845_exit(void)
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003521{
Kyle Yan6a20fae2017-02-14 13:34:41 -08003522 platform_driver_unregister(&gcc_sdm845_driver);
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003523}
Kyle Yan6a20fae2017-02-14 13:34:41 -08003524module_exit(gcc_sdm845_exit);
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003525
Kyle Yan6a20fae2017-02-14 13:34:41 -08003526MODULE_DESCRIPTION("QTI GCC SDM845 Driver");
Deepak Katragadda575a45f2016-10-11 15:06:56 -07003527MODULE_LICENSE("GPL v2");
Kyle Yan6a20fae2017-02-14 13:34:41 -08003528MODULE_ALIAS("platform:gcc-sdm845");