1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
4 */
5
6 #include <linux/kernel.h>
7 #include <linux/err.h>
8 #include <linux/platform_device.h>
9 #include <linux/module.h>
10 #include <linux/of.h>
11 #include <linux/of_device.h>
12 #include <linux/clk-provider.h>
13 #include <linux/regmap.h>
14
15 #include <linux/reset-controller.h>
16 #include <dt-bindings/clock/qcom,gcc-ipq6018.h>
17 #include <dt-bindings/reset/qcom,gcc-ipq6018.h>
18
19 #include "common.h"
20 #include "clk-regmap.h"
21 #include "clk-pll.h"
22 #include "clk-rcg.h"
23 #include "clk-branch.h"
24 #include "clk-alpha-pll.h"
25 #include "clk-regmap-divider.h"
26 #include "clk-regmap-mux.h"
27 #include "reset.h"
28
29 #define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
30
31 enum {
32 P_XO,
33 P_BIAS_PLL,
34 P_UNIPHY0_RX,
35 P_UNIPHY0_TX,
36 P_UNIPHY1_RX,
37 P_BIAS_PLL_NSS_NOC,
38 P_UNIPHY1_TX,
39 P_PCIE20_PHY0_PIPE,
40 P_USB3PHY_0_PIPE,
41 P_GPLL0,
42 P_GPLL0_DIV2,
43 P_GPLL2,
44 P_GPLL4,
45 P_GPLL6,
46 P_SLEEP_CLK,
47 P_UBI32_PLL,
48 P_NSS_CRYPTO_PLL,
49 P_PI_SLEEP,
50 };
51
52 static struct clk_alpha_pll gpll0_main = {
53 .offset = 0x21000,
54 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
55 .clkr = {
56 .enable_reg = 0x0b000,
57 .enable_mask = BIT(0),
58 .hw.init = &(struct clk_init_data){
59 .name = "gpll0_main",
60 .parent_data = &(const struct clk_parent_data){
61 .fw_name = "xo",
62 },
63 .num_parents = 1,
64 .ops = &clk_alpha_pll_ops,
65 },
66 },
67 };
68
69 static struct clk_fixed_factor gpll0_out_main_div2 = {
70 .mult = 1,
71 .div = 2,
72 .hw.init = &(struct clk_init_data){
73 .name = "gpll0_out_main_div2",
74 .parent_hws = (const struct clk_hw *[]){
75 &gpll0_main.clkr.hw },
76 .num_parents = 1,
77 .ops = &clk_fixed_factor_ops,
78 },
79 };
80
81 static struct clk_alpha_pll_postdiv gpll0 = {
82 .offset = 0x21000,
83 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
84 .width = 4,
85 .clkr.hw.init = &(struct clk_init_data){
86 .name = "gpll0",
87 .parent_hws = (const struct clk_hw *[]){
88 &gpll0_main.clkr.hw },
89 .num_parents = 1,
90 .ops = &clk_alpha_pll_postdiv_ro_ops,
91 },
92 };
93
94 static const struct clk_parent_data gcc_xo_gpll0_gpll0_out_main_div2[] = {
95 { .fw_name = "xo" },
96 { .hw = &gpll0.clkr.hw},
97 { .hw = &gpll0_out_main_div2.hw},
98 };
99
100 static const struct parent_map gcc_xo_gpll0_gpll0_out_main_div2_map[] = {
101 { P_XO, 0 },
102 { P_GPLL0, 1 },
103 { P_GPLL0_DIV2, 4 },
104 };
105
106 static struct clk_alpha_pll ubi32_pll_main = {
107 .offset = 0x25000,
108 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_HUAYRA],
109 .flags = SUPPORTS_DYNAMIC_UPDATE,
110 .clkr = {
111 .enable_reg = 0x0b000,
112 .enable_mask = BIT(6),
113 .hw.init = &(struct clk_init_data){
114 .name = "ubi32_pll_main",
115 .parent_data = &(const struct clk_parent_data){
116 .fw_name = "xo",
117 },
118 .num_parents = 1,
119 .ops = &clk_alpha_pll_huayra_ops,
120 },
121 },
122 };
123
124 static struct clk_alpha_pll_postdiv ubi32_pll = {
125 .offset = 0x25000,
126 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_HUAYRA],
127 .width = 2,
128 .clkr.hw.init = &(struct clk_init_data){
129 .name = "ubi32_pll",
130 .parent_hws = (const struct clk_hw *[]){
131 &ubi32_pll_main.clkr.hw },
132 .num_parents = 1,
133 .ops = &clk_alpha_pll_postdiv_ro_ops,
134 .flags = CLK_SET_RATE_PARENT,
135 },
136 };
137
138 static struct clk_alpha_pll gpll6_main = {
139 .offset = 0x37000,
140 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_BRAMMO],
141 .clkr = {
142 .enable_reg = 0x0b000,
143 .enable_mask = BIT(7),
144 .hw.init = &(struct clk_init_data){
145 .name = "gpll6_main",
146 .parent_data = &(const struct clk_parent_data){
147 .fw_name = "xo",
148 },
149 .num_parents = 1,
150 .ops = &clk_alpha_pll_ops,
151 },
152 },
153 };
154
155 static struct clk_alpha_pll_postdiv gpll6 = {
156 .offset = 0x37000,
157 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_BRAMMO],
158 .width = 2,
159 .clkr.hw.init = &(struct clk_init_data){
160 .name = "gpll6",
161 .parent_hws = (const struct clk_hw *[]){
162 &gpll6_main.clkr.hw },
163 .num_parents = 1,
164 .ops = &clk_alpha_pll_postdiv_ro_ops,
165 },
166 };
167
168 static struct clk_alpha_pll gpll4_main = {
169 .offset = 0x24000,
170 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
171 .clkr = {
172 .enable_reg = 0x0b000,
173 .enable_mask = BIT(5),
174 .hw.init = &(struct clk_init_data){
175 .name = "gpll4_main",
176 .parent_data = &(const struct clk_parent_data){
177 .fw_name = "xo",
178 },
179 .num_parents = 1,
180 .ops = &clk_alpha_pll_ops,
181 },
182 },
183 };
184
185 static struct clk_alpha_pll_postdiv gpll4 = {
186 .offset = 0x24000,
187 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
188 .width = 4,
189 .clkr.hw.init = &(struct clk_init_data){
190 .name = "gpll4",
191 .parent_hws = (const struct clk_hw *[]){
192 &gpll4_main.clkr.hw },
193 .num_parents = 1,
194 .ops = &clk_alpha_pll_postdiv_ro_ops,
195 },
196 };
197
198 static const struct freq_tbl ftbl_pcnoc_bfdcd_clk_src[] = {
199 F(24000000, P_XO, 1, 0, 0),
200 F(50000000, P_GPLL0, 16, 0, 0),
201 F(100000000, P_GPLL0, 8, 0, 0),
202 { }
203 };
204
205 static struct clk_rcg2 pcnoc_bfdcd_clk_src = {
206 .cmd_rcgr = 0x27000,
207 .freq_tbl = ftbl_pcnoc_bfdcd_clk_src,
208 .hid_width = 5,
209 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
210 .clkr.hw.init = &(struct clk_init_data){
211 .name = "pcnoc_bfdcd_clk_src",
212 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
213 .num_parents = 3,
214 .ops = &clk_rcg2_ops,
215 },
216 };
217
218 static struct clk_alpha_pll gpll2_main = {
219 .offset = 0x4a000,
220 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
221 .clkr = {
222 .enable_reg = 0x0b000,
223 .enable_mask = BIT(2),
224 .hw.init = &(struct clk_init_data){
225 .name = "gpll2_main",
226 .parent_data = &(const struct clk_parent_data){
227 .fw_name = "xo",
228 },
229 .num_parents = 1,
230 .ops = &clk_alpha_pll_ops,
231 },
232 },
233 };
234
235 static struct clk_alpha_pll_postdiv gpll2 = {
236 .offset = 0x4a000,
237 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
238 .width = 4,
239 .clkr.hw.init = &(struct clk_init_data){
240 .name = "gpll2",
241 .parent_hws = (const struct clk_hw *[]){
242 &gpll2_main.clkr.hw },
243 .num_parents = 1,
244 .ops = &clk_alpha_pll_postdiv_ro_ops,
245 },
246 };
247
248 static struct clk_alpha_pll nss_crypto_pll_main = {
249 .offset = 0x22000,
250 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
251 .clkr = {
252 .enable_reg = 0x0b000,
253 .enable_mask = BIT(4),
254 .hw.init = &(struct clk_init_data){
255 .name = "nss_crypto_pll_main",
256 .parent_data = &(const struct clk_parent_data){
257 .fw_name = "xo",
258 },
259 .num_parents = 1,
260 .ops = &clk_alpha_pll_ops,
261 },
262 },
263 };
264
265 static struct clk_alpha_pll_postdiv nss_crypto_pll = {
266 .offset = 0x22000,
267 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
268 .width = 4,
269 .clkr.hw.init = &(struct clk_init_data){
270 .name = "nss_crypto_pll",
271 .parent_hws = (const struct clk_hw *[]){
272 &nss_crypto_pll_main.clkr.hw },
273 .num_parents = 1,
274 .ops = &clk_alpha_pll_postdiv_ro_ops,
275 },
276 };
277
278 static const struct freq_tbl ftbl_qdss_tsctr_clk_src[] = {
279 F(160000000, P_GPLL0_DIV2, 2.5, 0, 0),
280 F(320000000, P_GPLL0, 2.5, 0, 0),
281 F(600000000, P_GPLL4, 2, 0, 0),
282 { }
283 };
284
285 static const struct clk_parent_data gcc_xo_gpll4_gpll0_gpll6_gpll0_div2[] = {
286 { .fw_name = "xo" },
287 { .hw = &gpll4.clkr.hw },
288 { .hw = &gpll0.clkr.hw },
289 { .hw = &gpll6.clkr.hw },
290 { .hw = &gpll0_out_main_div2.hw },
291 };
292
293 static const struct parent_map gcc_xo_gpll4_gpll0_gpll6_gpll0_div2_map[] = {
294 { P_XO, 0 },
295 { P_GPLL4, 1 },
296 { P_GPLL0, 2 },
297 { P_GPLL6, 3 },
298 { P_GPLL0_DIV2, 4 },
299 };
300
301 static struct clk_rcg2 qdss_tsctr_clk_src = {
302 .cmd_rcgr = 0x29064,
303 .freq_tbl = ftbl_qdss_tsctr_clk_src,
304 .hid_width = 5,
305 .parent_map = gcc_xo_gpll4_gpll0_gpll6_gpll0_div2_map,
306 .clkr.hw.init = &(struct clk_init_data){
307 .name = "qdss_tsctr_clk_src",
308 .parent_data = gcc_xo_gpll4_gpll0_gpll6_gpll0_div2,
309 .num_parents = 5,
310 .ops = &clk_rcg2_ops,
311 },
312 };
313
314 static struct clk_fixed_factor qdss_dap_sync_clk_src = {
315 .mult = 1,
316 .div = 4,
317 .hw.init = &(struct clk_init_data){
318 .name = "qdss_dap_sync_clk_src",
319 .parent_hws = (const struct clk_hw *[]){
320 &qdss_tsctr_clk_src.clkr.hw },
321 .num_parents = 1,
322 .ops = &clk_fixed_factor_ops,
323 },
324 };
325
326 static const struct freq_tbl ftbl_qdss_at_clk_src[] = {
327 F(66670000, P_GPLL0_DIV2, 6, 0, 0),
328 F(240000000, P_GPLL4, 5, 0, 0),
329 { }
330 };
331
332 static struct clk_rcg2 qdss_at_clk_src = {
333 .cmd_rcgr = 0x2900c,
334 .freq_tbl = ftbl_qdss_at_clk_src,
335 .hid_width = 5,
336 .parent_map = gcc_xo_gpll4_gpll0_gpll6_gpll0_div2_map,
337 .clkr.hw.init = &(struct clk_init_data){
338 .name = "qdss_at_clk_src",
339 .parent_data = gcc_xo_gpll4_gpll0_gpll6_gpll0_div2,
340 .num_parents = 5,
341 .ops = &clk_rcg2_ops,
342 },
343 };
344
345 static struct clk_fixed_factor qdss_tsctr_div2_clk_src = {
346 .mult = 1,
347 .div = 2,
348 .hw.init = &(struct clk_init_data){
349 .name = "qdss_tsctr_div2_clk_src",
350 .parent_hws = (const struct clk_hw *[]){
351 &qdss_tsctr_clk_src.clkr.hw },
352 .num_parents = 1,
353 .flags = CLK_SET_RATE_PARENT,
354 .ops = &clk_fixed_factor_ops,
355 },
356 };
357
358 static const struct freq_tbl ftbl_nss_ppe_clk_src[] = {
359 F(24000000, P_XO, 1, 0, 0),
360 F(300000000, P_BIAS_PLL, 1, 0, 0),
361 { }
362 };
363
364 static const struct clk_parent_data gcc_xo_bias_gpll0_gpll4_nss_ubi32[] = {
365 { .fw_name = "xo" },
366 { .fw_name = "bias_pll_cc_clk" },
367 { .hw = &gpll0.clkr.hw },
368 { .hw = &gpll4.clkr.hw },
369 { .hw = &nss_crypto_pll.clkr.hw },
370 { .hw = &ubi32_pll.clkr.hw },
371 };
372
373 static const struct parent_map gcc_xo_bias_gpll0_gpll4_nss_ubi32_map[] = {
374 { P_XO, 0 },
375 { P_BIAS_PLL, 1 },
376 { P_GPLL0, 2 },
377 { P_GPLL4, 3 },
378 { P_NSS_CRYPTO_PLL, 4 },
379 { P_UBI32_PLL, 5 },
380 };
381
382 static struct clk_rcg2 nss_ppe_clk_src = {
383 .cmd_rcgr = 0x68080,
384 .freq_tbl = ftbl_nss_ppe_clk_src,
385 .hid_width = 5,
386 .parent_map = gcc_xo_bias_gpll0_gpll4_nss_ubi32_map,
387 .clkr.hw.init = &(struct clk_init_data){
388 .name = "nss_ppe_clk_src",
389 .parent_data = gcc_xo_bias_gpll0_gpll4_nss_ubi32,
390 .num_parents = 6,
391 .ops = &clk_rcg2_ops,
392 },
393 };
394
395 static struct clk_branch gcc_xo_clk_src = {
396 .halt_reg = 0x30018,
397 .clkr = {
398 .enable_reg = 0x30018,
399 .enable_mask = BIT(1),
400 .hw.init = &(struct clk_init_data){
401 .name = "gcc_xo_clk_src",
402 .parent_data = &(const struct clk_parent_data){
403 .fw_name = "xo",
404 },
405 .num_parents = 1,
406 .flags = CLK_SET_RATE_PARENT,
407 .ops = &clk_branch2_ops,
408 },
409 },
410 };
411
412 static const struct freq_tbl ftbl_nss_ce_clk_src[] = {
413 F(24000000, P_XO, 1, 0, 0),
414 F(200000000, P_GPLL0, 4, 0, 0),
415 { }
416 };
417
418 static const struct clk_parent_data gcc_xo_gpll0[] = {
419 { .fw_name = "xo" },
420 { .hw = &gpll0.clkr.hw },
421 };
422
423 static const struct parent_map gcc_xo_gpll0_map[] = {
424 { P_XO, 0 },
425 { P_GPLL0, 1 },
426 };
427
428 static struct clk_rcg2 nss_ce_clk_src = {
429 .cmd_rcgr = 0x68098,
430 .freq_tbl = ftbl_nss_ce_clk_src,
431 .hid_width = 5,
432 .parent_map = gcc_xo_gpll0_map,
433 .clkr.hw.init = &(struct clk_init_data){
434 .name = "nss_ce_clk_src",
435 .parent_data = gcc_xo_gpll0,
436 .num_parents = 2,
437 .ops = &clk_rcg2_ops,
438 },
439 };
440
441 static struct clk_branch gcc_sleep_clk_src = {
442 .halt_reg = 0x30000,
443 .clkr = {
444 .enable_reg = 0x30000,
445 .enable_mask = BIT(1),
446 .hw.init = &(struct clk_init_data){
447 .name = "gcc_sleep_clk_src",
448 .parent_data = &(const struct clk_parent_data){
449 .fw_name = "sleep_clk",
450 },
451 .num_parents = 1,
452 .ops = &clk_branch2_ops,
453 },
454 },
455 };
456
457 static const struct freq_tbl ftbl_snoc_nssnoc_bfdcd_clk_src[] = {
458 F(24000000, P_XO, 1, 0, 0),
459 F(50000000, P_GPLL0_DIV2, 8, 0, 0),
460 F(100000000, P_GPLL0, 8, 0, 0),
461 F(133333333, P_GPLL0, 6, 0, 0),
462 F(160000000, P_GPLL0, 5, 0, 0),
463 F(200000000, P_GPLL0, 4, 0, 0),
464 F(266666667, P_GPLL0, 3, 0, 0),
465 { }
466 };
467
468 static const struct clk_parent_data
469 gcc_xo_gpll0_gpll6_gpll0_out_main_div2[] = {
470 { .fw_name = "xo" },
471 { .hw = &gpll0.clkr.hw },
472 { .hw = &gpll6.clkr.hw },
473 { .hw = &gpll0_out_main_div2.hw },
474 };
475
476 static const struct parent_map gcc_xo_gpll0_gpll6_gpll0_out_main_div2_map[] = {
477 { P_XO, 0 },
478 { P_GPLL0, 1 },
479 { P_GPLL6, 2 },
480 { P_GPLL0_DIV2, 3 },
481 };
482
483 static struct clk_rcg2 snoc_nssnoc_bfdcd_clk_src = {
484 .cmd_rcgr = 0x76054,
485 .freq_tbl = ftbl_snoc_nssnoc_bfdcd_clk_src,
486 .hid_width = 5,
487 .parent_map = gcc_xo_gpll0_gpll6_gpll0_out_main_div2_map,
488 .clkr.hw.init = &(struct clk_init_data){
489 .name = "snoc_nssnoc_bfdcd_clk_src",
490 .parent_data = gcc_xo_gpll0_gpll6_gpll0_out_main_div2,
491 .num_parents = 4,
492 .ops = &clk_rcg2_ops,
493 },
494 };
495
496 static const struct freq_tbl ftbl_apss_ahb_clk_src[] = {
497 F(24000000, P_XO, 1, 0, 0),
498 F(25000000, P_GPLL0_DIV2, 16, 0, 0),
499 F(50000000, P_GPLL0, 16, 0, 0),
500 F(100000000, P_GPLL0, 8, 0, 0),
501 { }
502 };
503
504 static struct clk_rcg2 apss_ahb_clk_src = {
505 .cmd_rcgr = 0x46000,
506 .freq_tbl = ftbl_apss_ahb_clk_src,
507 .hid_width = 5,
508 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
509 .clkr.hw.init = &(struct clk_init_data){
510 .name = "apss_ahb_clk_src",
511 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
512 .num_parents = 3,
513 .ops = &clk_rcg2_ops,
514 },
515 };
516
517 static const struct freq_tbl ftbl_nss_port5_rx_clk_src[] = {
518 F(24000000, P_XO, 1, 0, 0),
519 F(25000000, P_UNIPHY1_RX, 12.5, 0, 0),
520 F(25000000, P_UNIPHY0_RX, 5, 0, 0),
521 F(78125000, P_UNIPHY1_RX, 4, 0, 0),
522 F(125000000, P_UNIPHY1_RX, 2.5, 0, 0),
523 F(125000000, P_UNIPHY0_RX, 1, 0, 0),
524 F(156250000, P_UNIPHY1_RX, 2, 0, 0),
525 F(312500000, P_UNIPHY1_RX, 1, 0, 0),
526 { }
527 };
528
529 static const struct clk_parent_data
530 gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias[] = {
531 { .fw_name = "xo" },
532 { .fw_name = "uniphy0_gcc_rx_clk" },
533 { .fw_name = "uniphy0_gcc_tx_clk" },
534 { .fw_name = "uniphy1_gcc_rx_clk" },
535 { .fw_name = "uniphy1_gcc_tx_clk" },
536 { .hw = &ubi32_pll.clkr.hw },
537 { .fw_name = "bias_pll_cc_clk" },
538 };
539
540 static const struct parent_map
541 gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias_map[] = {
542 { P_XO, 0 },
543 { P_UNIPHY0_RX, 1 },
544 { P_UNIPHY0_TX, 2 },
545 { P_UNIPHY1_RX, 3 },
546 { P_UNIPHY1_TX, 4 },
547 { P_UBI32_PLL, 5 },
548 { P_BIAS_PLL, 6 },
549 };
550
551 static struct clk_rcg2 nss_port5_rx_clk_src = {
552 .cmd_rcgr = 0x68060,
553 .freq_tbl = ftbl_nss_port5_rx_clk_src,
554 .hid_width = 5,
555 .parent_map = gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias_map,
556 .clkr.hw.init = &(struct clk_init_data){
557 .name = "nss_port5_rx_clk_src",
558 .parent_data = gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias,
559 .num_parents = 7,
560 .ops = &clk_rcg2_ops,
561 },
562 };
563
564 static const struct freq_tbl ftbl_nss_port5_tx_clk_src[] = {
565 F(24000000, P_XO, 1, 0, 0),
566 F(25000000, P_UNIPHY1_TX, 12.5, 0, 0),
567 F(25000000, P_UNIPHY0_TX, 5, 0, 0),
568 F(78125000, P_UNIPHY1_TX, 4, 0, 0),
569 F(125000000, P_UNIPHY1_TX, 2.5, 0, 0),
570 F(125000000, P_UNIPHY0_TX, 1, 0, 0),
571 F(156250000, P_UNIPHY1_TX, 2, 0, 0),
572 F(312500000, P_UNIPHY1_TX, 1, 0, 0),
573 { }
574 };
575
576 static const struct clk_parent_data
577 gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias[] = {
578 { .fw_name = "xo" },
579 { .fw_name = "uniphy0_gcc_tx_clk" },
580 { .fw_name = "uniphy0_gcc_rx_clk" },
581 { .fw_name = "uniphy1_gcc_tx_clk" },
582 { .fw_name = "uniphy1_gcc_rx_clk" },
583 { .hw = &ubi32_pll.clkr.hw },
584 { .fw_name = "bias_pll_cc_clk" },
585 };
586
587 static const struct parent_map
588 gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias_map[] = {
589 { P_XO, 0 },
590 { P_UNIPHY0_TX, 1 },
591 { P_UNIPHY0_RX, 2 },
592 { P_UNIPHY1_TX, 3 },
593 { P_UNIPHY1_RX, 4 },
594 { P_UBI32_PLL, 5 },
595 { P_BIAS_PLL, 6 },
596 };
597
598 static struct clk_rcg2 nss_port5_tx_clk_src = {
599 .cmd_rcgr = 0x68068,
600 .freq_tbl = ftbl_nss_port5_tx_clk_src,
601 .hid_width = 5,
602 .parent_map = gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias_map,
603 .clkr.hw.init = &(struct clk_init_data){
604 .name = "nss_port5_tx_clk_src",
605 .parent_data = gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias,
606 .num_parents = 7,
607 .ops = &clk_rcg2_ops,
608 },
609 };
610
611 static const struct freq_tbl ftbl_pcie_axi_clk_src[] = {
612 F(24000000, P_XO, 1, 0, 0),
613 F(200000000, P_GPLL0, 4, 0, 0),
614 F(240000000, P_GPLL4, 5, 0, 0),
615 { }
616 };
617
618 static const struct freq_tbl ftbl_pcie_rchng_clk_src[] = {
619 F(24000000, P_XO, 1, 0, 0),
620 F(100000000, P_GPLL0, 8, 0, 0),
621 { }
622 };
623
624 static const struct clk_parent_data gcc_xo_gpll0_gpll4[] = {
625 { .fw_name = "xo" },
626 { .hw = &gpll0.clkr.hw },
627 { .hw = &gpll4.clkr.hw },
628 };
629
630 static const struct parent_map gcc_xo_gpll0_gpll4_map[] = {
631 { P_XO, 0 },
632 { P_GPLL0, 1 },
633 { P_GPLL4, 2 },
634 };
635
636 static struct clk_rcg2 pcie0_axi_clk_src = {
637 .cmd_rcgr = 0x75054,
638 .freq_tbl = ftbl_pcie_axi_clk_src,
639 .hid_width = 5,
640 .parent_map = gcc_xo_gpll0_gpll4_map,
641 .clkr.hw.init = &(struct clk_init_data){
642 .name = "pcie0_axi_clk_src",
643 .parent_data = gcc_xo_gpll0_gpll4,
644 .num_parents = 3,
645 .ops = &clk_rcg2_ops,
646 },
647 };
648
649 static const struct freq_tbl ftbl_usb0_master_clk_src[] = {
650 F(80000000, P_GPLL0_DIV2, 5, 0, 0),
651 F(100000000, P_GPLL0, 8, 0, 0),
652 F(133330000, P_GPLL0, 6, 0, 0),
653 F(200000000, P_GPLL0, 4, 0, 0),
654 { }
655 };
656
657 static const struct clk_parent_data gcc_xo_gpll0_out_main_div2_gpll0[] = {
658 { .fw_name = "xo" },
659 { .hw = &gpll0_out_main_div2.hw },
660 { .hw = &gpll0.clkr.hw },
661 };
662
663 static const struct parent_map gcc_xo_gpll0_out_main_div2_gpll0_map[] = {
664 { P_XO, 0 },
665 { P_GPLL0_DIV2, 2 },
666 { P_GPLL0, 1 },
667 };
668
669 static struct clk_rcg2 usb0_master_clk_src = {
670 .cmd_rcgr = 0x3e00c,
671 .freq_tbl = ftbl_usb0_master_clk_src,
672 .mnd_width = 8,
673 .hid_width = 5,
674 .parent_map = gcc_xo_gpll0_out_main_div2_gpll0_map,
675 .clkr.hw.init = &(struct clk_init_data){
676 .name = "usb0_master_clk_src",
677 .parent_data = gcc_xo_gpll0_out_main_div2_gpll0,
678 .num_parents = 3,
679 .ops = &clk_rcg2_ops,
680 },
681 };
682
683 static struct clk_regmap_div apss_ahb_postdiv_clk_src = {
684 .reg = 0x46018,
685 .shift = 4,
686 .width = 4,
687 .clkr = {
688 .hw.init = &(struct clk_init_data){
689 .name = "apss_ahb_postdiv_clk_src",
690 .parent_hws = (const struct clk_hw *[]){
691 &apss_ahb_clk_src.clkr.hw },
692 .num_parents = 1,
693 .ops = &clk_regmap_div_ops,
694 },
695 },
696 };
697
698 static struct clk_fixed_factor gcc_xo_div4_clk_src = {
699 .mult = 1,
700 .div = 4,
701 .hw.init = &(struct clk_init_data){
702 .name = "gcc_xo_div4_clk_src",
703 .parent_hws = (const struct clk_hw *[]){
704 &gcc_xo_clk_src.clkr.hw },
705 .num_parents = 1,
706 .ops = &clk_fixed_factor_ops,
707 .flags = CLK_SET_RATE_PARENT,
708 },
709 };
710
711 static const struct freq_tbl ftbl_nss_port1_rx_clk_src[] = {
712 F(24000000, P_XO, 1, 0, 0),
713 F(25000000, P_UNIPHY0_RX, 5, 0, 0),
714 F(125000000, P_UNIPHY0_RX, 1, 0, 0),
715 { }
716 };
717
718 static const struct clk_parent_data gcc_xo_uniphy0_rx_tx_ubi32_bias[] = {
719 { .fw_name = "xo" },
720 { .fw_name = "uniphy0_gcc_rx_clk" },
721 { .fw_name = "uniphy0_gcc_tx_clk" },
722 { .hw = &ubi32_pll.clkr.hw },
723 { .fw_name = "bias_pll_cc_clk" },
724 };
725
726 static const struct parent_map gcc_xo_uniphy0_rx_tx_ubi32_bias_map[] = {
727 { P_XO, 0 },
728 { P_UNIPHY0_RX, 1 },
729 { P_UNIPHY0_TX, 2 },
730 { P_UBI32_PLL, 5 },
731 { P_BIAS_PLL, 6 },
732 };
733
734 static struct clk_rcg2 nss_port1_rx_clk_src = {
735 .cmd_rcgr = 0x68020,
736 .freq_tbl = ftbl_nss_port1_rx_clk_src,
737 .hid_width = 5,
738 .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map,
739 .clkr.hw.init = &(struct clk_init_data){
740 .name = "nss_port1_rx_clk_src",
741 .parent_data = gcc_xo_uniphy0_rx_tx_ubi32_bias,
742 .num_parents = 5,
743 .ops = &clk_rcg2_ops,
744 },
745 };
746
747 static const struct freq_tbl ftbl_nss_port1_tx_clk_src[] = {
748 F(24000000, P_XO, 1, 0, 0),
749 F(25000000, P_UNIPHY0_TX, 5, 0, 0),
750 F(125000000, P_UNIPHY0_TX, 1, 0, 0),
751 { }
752 };
753
754 static const struct clk_parent_data gcc_xo_uniphy0_tx_rx_ubi32_bias[] = {
755 { .fw_name = "xo" },
756 { .fw_name = "uniphy0_gcc_tx_clk" },
757 { .fw_name = "uniphy0_gcc_rx_clk" },
758 { .hw = &ubi32_pll.clkr.hw },
759 { .fw_name = "bias_pll_cc_clk" },
760 };
761
762 static const struct parent_map gcc_xo_uniphy0_tx_rx_ubi32_bias_map[] = {
763 { P_XO, 0 },
764 { P_UNIPHY0_TX, 1 },
765 { P_UNIPHY0_RX, 2 },
766 { P_UBI32_PLL, 5 },
767 { P_BIAS_PLL, 6 },
768 };
769
770 static struct clk_rcg2 nss_port1_tx_clk_src = {
771 .cmd_rcgr = 0x68028,
772 .freq_tbl = ftbl_nss_port1_tx_clk_src,
773 .hid_width = 5,
774 .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map,
775 .clkr.hw.init = &(struct clk_init_data){
776 .name = "nss_port1_tx_clk_src",
777 .parent_data = gcc_xo_uniphy0_tx_rx_ubi32_bias,
778 .num_parents = 5,
779 .ops = &clk_rcg2_ops,
780 },
781 };
782
783 static struct clk_rcg2 nss_port2_rx_clk_src = {
784 .cmd_rcgr = 0x68030,
785 .freq_tbl = ftbl_nss_port1_rx_clk_src,
786 .hid_width = 5,
787 .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map,
788 .clkr.hw.init = &(struct clk_init_data){
789 .name = "nss_port2_rx_clk_src",
790 .parent_data = gcc_xo_uniphy0_rx_tx_ubi32_bias,
791 .num_parents = 5,
792 .ops = &clk_rcg2_ops,
793 },
794 };
795
796 static struct clk_rcg2 nss_port2_tx_clk_src = {
797 .cmd_rcgr = 0x68038,
798 .freq_tbl = ftbl_nss_port1_tx_clk_src,
799 .hid_width = 5,
800 .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map,
801 .clkr.hw.init = &(struct clk_init_data){
802 .name = "nss_port2_tx_clk_src",
803 .parent_data = gcc_xo_uniphy0_tx_rx_ubi32_bias,
804 .num_parents = 5,
805 .ops = &clk_rcg2_ops,
806 },
807 };
808
809 static struct clk_rcg2 nss_port3_rx_clk_src = {
810 .cmd_rcgr = 0x68040,
811 .freq_tbl = ftbl_nss_port1_rx_clk_src,
812 .hid_width = 5,
813 .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map,
814 .clkr.hw.init = &(struct clk_init_data){
815 .name = "nss_port3_rx_clk_src",
816 .parent_data = gcc_xo_uniphy0_rx_tx_ubi32_bias,
817 .num_parents = 5,
818 .ops = &clk_rcg2_ops,
819 },
820 };
821
822 static struct clk_rcg2 nss_port3_tx_clk_src = {
823 .cmd_rcgr = 0x68048,
824 .freq_tbl = ftbl_nss_port1_tx_clk_src,
825 .hid_width = 5,
826 .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map,
827 .clkr.hw.init = &(struct clk_init_data){
828 .name = "nss_port3_tx_clk_src",
829 .parent_data = gcc_xo_uniphy0_tx_rx_ubi32_bias,
830 .num_parents = 5,
831 .ops = &clk_rcg2_ops,
832 },
833 };
834
835 static struct clk_rcg2 nss_port4_rx_clk_src = {
836 .cmd_rcgr = 0x68050,
837 .freq_tbl = ftbl_nss_port1_rx_clk_src,
838 .hid_width = 5,
839 .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map,
840 .clkr.hw.init = &(struct clk_init_data){
841 .name = "nss_port4_rx_clk_src",
842 .parent_data = gcc_xo_uniphy0_rx_tx_ubi32_bias,
843 .num_parents = 5,
844 .ops = &clk_rcg2_ops,
845 },
846 };
847
848 static struct clk_rcg2 nss_port4_tx_clk_src = {
849 .cmd_rcgr = 0x68058,
850 .freq_tbl = ftbl_nss_port1_tx_clk_src,
851 .hid_width = 5,
852 .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map,
853 .clkr.hw.init = &(struct clk_init_data){
854 .name = "nss_port4_tx_clk_src",
855 .parent_data = gcc_xo_uniphy0_tx_rx_ubi32_bias,
856 .num_parents = 5,
857 .ops = &clk_rcg2_ops,
858 },
859 };
860
861 static struct clk_regmap_div nss_port5_rx_div_clk_src = {
862 .reg = 0x68440,
863 .shift = 0,
864 .width = 4,
865 .clkr = {
866 .hw.init = &(struct clk_init_data){
867 .name = "nss_port5_rx_div_clk_src",
868 .parent_hws = (const struct clk_hw *[]){
869 &nss_port5_rx_clk_src.clkr.hw },
870 .num_parents = 1,
871 .ops = &clk_regmap_div_ops,
872 .flags = CLK_SET_RATE_PARENT,
873 },
874 },
875 };
876
877 static struct clk_regmap_div nss_port5_tx_div_clk_src = {
878 .reg = 0x68444,
879 .shift = 0,
880 .width = 4,
881 .clkr = {
882 .hw.init = &(struct clk_init_data){
883 .name = "nss_port5_tx_div_clk_src",
884 .parent_hws = (const struct clk_hw *[]){
885 &nss_port5_tx_clk_src.clkr.hw },
886 .num_parents = 1,
887 .ops = &clk_regmap_div_ops,
888 .flags = CLK_SET_RATE_PARENT,
889 },
890 },
891 };
892
893 static const struct freq_tbl ftbl_apss_axi_clk_src[] = {
894 F(24000000, P_XO, 1, 0, 0),
895 F(100000000, P_GPLL0_DIV2, 4, 0, 0),
896 F(200000000, P_GPLL0, 4, 0, 0),
897 F(308570000, P_GPLL6, 3.5, 0, 0),
898 F(400000000, P_GPLL0, 2, 0, 0),
899 F(533000000, P_GPLL0, 1.5, 0, 0),
900 { }
901 };
902
903 static const struct clk_parent_data gcc_xo_gpll0_gpll6_ubi32_gpll0_div2[] = {
904 { .fw_name = "xo" },
905 { .hw = &gpll0.clkr.hw },
906 { .hw = &gpll6.clkr.hw },
907 { .hw = &ubi32_pll.clkr.hw },
908 { .hw = &gpll0_out_main_div2.hw },
909 };
910
911 static const struct parent_map
912 gcc_xo_gpll0_gpll6_ubi32_gpll0_div2_map[] = {
913 { P_XO, 0 },
914 { P_GPLL0, 1 },
915 { P_GPLL6, 2 },
916 { P_UBI32_PLL, 3 },
917 { P_GPLL0_DIV2, 6 },
918 };
919
920 static struct clk_rcg2 apss_axi_clk_src = {
921 .cmd_rcgr = 0x38048,
922 .freq_tbl = ftbl_apss_axi_clk_src,
923 .hid_width = 5,
924 .parent_map = gcc_xo_gpll0_gpll6_ubi32_gpll0_div2_map,
925 .clkr.hw.init = &(struct clk_init_data){
926 .name = "apss_axi_clk_src",
927 .parent_data = gcc_xo_gpll0_gpll6_ubi32_gpll0_div2,
928 .num_parents = 5,
929 .ops = &clk_rcg2_ops,
930 },
931 };
932
933 static const struct freq_tbl ftbl_nss_crypto_clk_src[] = {
934 F(24000000, P_XO, 1, 0, 0),
935 F(300000000, P_NSS_CRYPTO_PLL, 2, 0, 0),
936 { }
937 };
938
939 static const struct clk_parent_data gcc_xo_nss_crypto_pll_gpll0[] = {
940 { .fw_name = "xo" },
941 { .hw = &nss_crypto_pll.clkr.hw },
942 { .hw = &gpll0.clkr.hw },
943 };
944
945 static const struct parent_map gcc_xo_nss_crypto_pll_gpll0_map[] = {
946 { P_XO, 0 },
947 { P_NSS_CRYPTO_PLL, 1 },
948 { P_GPLL0, 2 },
949 };
950
951 static struct clk_rcg2 nss_crypto_clk_src = {
952 .cmd_rcgr = 0x68144,
953 .freq_tbl = ftbl_nss_crypto_clk_src,
954 .mnd_width = 16,
955 .hid_width = 5,
956 .parent_map = gcc_xo_nss_crypto_pll_gpll0_map,
957 .clkr.hw.init = &(struct clk_init_data){
958 .name = "nss_crypto_clk_src",
959 .parent_data = gcc_xo_nss_crypto_pll_gpll0,
960 .num_parents = 3,
961 .ops = &clk_rcg2_ops,
962 },
963 };
964
965 static struct clk_regmap_div nss_port1_rx_div_clk_src = {
966 .reg = 0x68400,
967 .shift = 0,
968 .width = 4,
969 .clkr = {
970 .hw.init = &(struct clk_init_data){
971 .name = "nss_port1_rx_div_clk_src",
972 .parent_hws = (const struct clk_hw *[]){
973 &nss_port1_rx_clk_src.clkr.hw },
974 .num_parents = 1,
975 .ops = &clk_regmap_div_ops,
976 .flags = CLK_SET_RATE_PARENT,
977 },
978 },
979 };
980
981 static struct clk_regmap_div nss_port1_tx_div_clk_src = {
982 .reg = 0x68404,
983 .shift = 0,
984 .width = 4,
985 .clkr = {
986 .hw.init = &(struct clk_init_data){
987 .name = "nss_port1_tx_div_clk_src",
988 .parent_hws = (const struct clk_hw *[]){
989 &nss_port1_tx_clk_src.clkr.hw },
990 .num_parents = 1,
991 .ops = &clk_regmap_div_ops,
992 .flags = CLK_SET_RATE_PARENT,
993 },
994 },
995 };
996
997 static struct clk_regmap_div nss_port2_rx_div_clk_src = {
998 .reg = 0x68410,
999 .shift = 0,
1000 .width = 4,
1001 .clkr = {
1002 .hw.init = &(struct clk_init_data){
1003 .name = "nss_port2_rx_div_clk_src",
1004 .parent_hws = (const struct clk_hw *[]){
1005 &nss_port2_rx_clk_src.clkr.hw },
1006 .num_parents = 1,
1007 .ops = &clk_regmap_div_ops,
1008 .flags = CLK_SET_RATE_PARENT,
1009 },
1010 },
1011 };
1012
1013 static struct clk_regmap_div nss_port2_tx_div_clk_src = {
1014 .reg = 0x68414,
1015 .shift = 0,
1016 .width = 4,
1017 .clkr = {
1018 .hw.init = &(struct clk_init_data){
1019 .name = "nss_port2_tx_div_clk_src",
1020 .parent_hws = (const struct clk_hw *[]){
1021 &nss_port2_tx_clk_src.clkr.hw },
1022 .num_parents = 1,
1023 .ops = &clk_regmap_div_ops,
1024 .flags = CLK_SET_RATE_PARENT,
1025 },
1026 },
1027 };
1028
1029 static struct clk_regmap_div nss_port3_rx_div_clk_src = {
1030 .reg = 0x68420,
1031 .shift = 0,
1032 .width = 4,
1033 .clkr = {
1034 .hw.init = &(struct clk_init_data){
1035 .name = "nss_port3_rx_div_clk_src",
1036 .parent_hws = (const struct clk_hw *[]){
1037 &nss_port3_rx_clk_src.clkr.hw },
1038 .num_parents = 1,
1039 .ops = &clk_regmap_div_ops,
1040 .flags = CLK_SET_RATE_PARENT,
1041 },
1042 },
1043 };
1044
1045 static struct clk_regmap_div nss_port3_tx_div_clk_src = {
1046 .reg = 0x68424,
1047 .shift = 0,
1048 .width = 4,
1049 .clkr = {
1050 .hw.init = &(struct clk_init_data){
1051 .name = "nss_port3_tx_div_clk_src",
1052 .parent_hws = (const struct clk_hw *[]){
1053 &nss_port3_tx_clk_src.clkr.hw },
1054 .num_parents = 1,
1055 .ops = &clk_regmap_div_ops,
1056 .flags = CLK_SET_RATE_PARENT,
1057 },
1058 },
1059 };
1060
1061 static struct clk_regmap_div nss_port4_rx_div_clk_src = {
1062 .reg = 0x68430,
1063 .shift = 0,
1064 .width = 4,
1065 .clkr = {
1066 .hw.init = &(struct clk_init_data){
1067 .name = "nss_port4_rx_div_clk_src",
1068 .parent_hws = (const struct clk_hw *[]){
1069 &nss_port4_rx_clk_src.clkr.hw },
1070 .num_parents = 1,
1071 .ops = &clk_regmap_div_ops,
1072 .flags = CLK_SET_RATE_PARENT,
1073 },
1074 },
1075 };
1076
1077 static struct clk_regmap_div nss_port4_tx_div_clk_src = {
1078 .reg = 0x68434,
1079 .shift = 0,
1080 .width = 4,
1081 .clkr = {
1082 .hw.init = &(struct clk_init_data){
1083 .name = "nss_port4_tx_div_clk_src",
1084 .parent_hws = (const struct clk_hw *[]){
1085 &nss_port4_tx_clk_src.clkr.hw },
1086 .num_parents = 1,
1087 .ops = &clk_regmap_div_ops,
1088 .flags = CLK_SET_RATE_PARENT,
1089 },
1090 },
1091 };
1092
1093 static const struct freq_tbl ftbl_nss_ubi_clk_src[] = {
1094 F(24000000, P_XO, 1, 0, 0),
1095 F(149760000, P_UBI32_PLL, 10, 0, 0),
1096 F(187200000, P_UBI32_PLL, 8, 0, 0),
1097 F(249600000, P_UBI32_PLL, 6, 0, 0),
1098 F(374400000, P_UBI32_PLL, 4, 0, 0),
1099 F(748800000, P_UBI32_PLL, 2, 0, 0),
1100 F(1497600000, P_UBI32_PLL, 1, 0, 0),
1101 { }
1102 };
1103
1104 static const struct clk_parent_data
1105 gcc_xo_ubi32_pll_gpll0_gpll2_gpll4_gpll6[] = {
1106 { .fw_name = "xo" },
1107 { .hw = &ubi32_pll.clkr.hw },
1108 { .hw = &gpll0.clkr.hw },
1109 { .hw = &gpll2.clkr.hw },
1110 { .hw = &gpll4.clkr.hw },
1111 { .hw = &gpll6.clkr.hw },
1112 };
1113
1114 static const struct parent_map gcc_xo_ubi32_gpll0_gpll2_gpll4_gpll6_map[] = {
1115 { P_XO, 0 },
1116 { P_UBI32_PLL, 1 },
1117 { P_GPLL0, 2 },
1118 { P_GPLL2, 3 },
1119 { P_GPLL4, 4 },
1120 { P_GPLL6, 5 },
1121 };
1122
1123 static struct clk_rcg2 nss_ubi0_clk_src = {
1124 .cmd_rcgr = 0x68104,
1125 .freq_tbl = ftbl_nss_ubi_clk_src,
1126 .hid_width = 5,
1127 .parent_map = gcc_xo_ubi32_gpll0_gpll2_gpll4_gpll6_map,
1128 .clkr.hw.init = &(struct clk_init_data){
1129 .name = "nss_ubi0_clk_src",
1130 .parent_data = gcc_xo_ubi32_pll_gpll0_gpll2_gpll4_gpll6,
1131 .num_parents = 6,
1132 .ops = &clk_rcg2_ops,
1133 .flags = CLK_SET_RATE_PARENT,
1134 },
1135 };
1136
1137 static const struct freq_tbl ftbl_adss_pwm_clk_src[] = {
1138 F(24000000, P_XO, 1, 0, 0),
1139 F(100000000, P_GPLL0, 8, 0, 0),
1140 { }
1141 };
1142
1143 static struct clk_rcg2 adss_pwm_clk_src = {
1144 .cmd_rcgr = 0x1c008,
1145 .freq_tbl = ftbl_adss_pwm_clk_src,
1146 .hid_width = 5,
1147 .parent_map = gcc_xo_gpll0_map,
1148 .clkr.hw.init = &(struct clk_init_data){
1149 .name = "adss_pwm_clk_src",
1150 .parent_data = gcc_xo_gpll0,
1151 .num_parents = 2,
1152 .ops = &clk_rcg2_ops,
1153 },
1154 };
1155
1156 static const struct freq_tbl ftbl_blsp1_qup_i2c_apps_clk_src[] = {
1157 F(24000000, P_XO, 1, 0, 0),
1158 F(25000000, P_GPLL0_DIV2, 16, 0, 0),
1159 F(50000000, P_GPLL0, 16, 0, 0),
1160 { }
1161 };
1162
1163 static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = {
1164 .cmd_rcgr = 0x0200c,
1165 .freq_tbl = ftbl_blsp1_qup_i2c_apps_clk_src,
1166 .hid_width = 5,
1167 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1168 .clkr.hw.init = &(struct clk_init_data){
1169 .name = "blsp1_qup1_i2c_apps_clk_src",
1170 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1171 .num_parents = 3,
1172 .ops = &clk_rcg2_ops,
1173 },
1174 };
1175
1176 static const struct freq_tbl ftbl_blsp1_qup_spi_apps_clk_src[] = {
1177 F(960000, P_XO, 10, 2, 5),
1178 F(4800000, P_XO, 5, 0, 0),
1179 F(9600000, P_XO, 2, 4, 5),
1180 F(12500000, P_GPLL0_DIV2, 16, 1, 2),
1181 F(16000000, P_GPLL0, 10, 1, 5),
1182 F(24000000, P_XO, 1, 0, 0),
1183 F(25000000, P_GPLL0, 16, 1, 2),
1184 F(50000000, P_GPLL0, 16, 0, 0),
1185 { }
1186 };
1187
1188 static struct clk_rcg2 blsp1_qup1_spi_apps_clk_src = {
1189 .cmd_rcgr = 0x02024,
1190 .freq_tbl = ftbl_blsp1_qup_spi_apps_clk_src,
1191 .mnd_width = 8,
1192 .hid_width = 5,
1193 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1194 .clkr.hw.init = &(struct clk_init_data){
1195 .name = "blsp1_qup1_spi_apps_clk_src",
1196 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1197 .num_parents = 3,
1198 .ops = &clk_rcg2_ops,
1199 },
1200 };
1201
1202 static struct clk_rcg2 blsp1_qup2_i2c_apps_clk_src = {
1203 .cmd_rcgr = 0x03000,
1204 .freq_tbl = ftbl_blsp1_qup_i2c_apps_clk_src,
1205 .hid_width = 5,
1206 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1207 .clkr.hw.init = &(struct clk_init_data){
1208 .name = "blsp1_qup2_i2c_apps_clk_src",
1209 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1210 .num_parents = 3,
1211 .ops = &clk_rcg2_ops,
1212 },
1213 };
1214
1215 static struct clk_rcg2 blsp1_qup2_spi_apps_clk_src = {
1216 .cmd_rcgr = 0x03014,
1217 .freq_tbl = ftbl_blsp1_qup_spi_apps_clk_src,
1218 .mnd_width = 8,
1219 .hid_width = 5,
1220 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1221 .clkr.hw.init = &(struct clk_init_data){
1222 .name = "blsp1_qup2_spi_apps_clk_src",
1223 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1224 .num_parents = 3,
1225 .ops = &clk_rcg2_ops,
1226 },
1227 };
1228
1229 static struct clk_rcg2 blsp1_qup3_i2c_apps_clk_src = {
1230 .cmd_rcgr = 0x04000,
1231 .freq_tbl = ftbl_blsp1_qup_i2c_apps_clk_src,
1232 .hid_width = 5,
1233 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1234 .clkr.hw.init = &(struct clk_init_data){
1235 .name = "blsp1_qup3_i2c_apps_clk_src",
1236 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1237 .num_parents = 3,
1238 .ops = &clk_rcg2_ops,
1239 },
1240 };
1241
1242 static struct clk_rcg2 blsp1_qup3_spi_apps_clk_src = {
1243 .cmd_rcgr = 0x04014,
1244 .freq_tbl = ftbl_blsp1_qup_spi_apps_clk_src,
1245 .mnd_width = 8,
1246 .hid_width = 5,
1247 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1248 .clkr.hw.init = &(struct clk_init_data){
1249 .name = "blsp1_qup3_spi_apps_clk_src",
1250 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1251 .num_parents = 3,
1252 .ops = &clk_rcg2_ops,
1253 },
1254 };
1255
1256 static struct clk_rcg2 blsp1_qup4_i2c_apps_clk_src = {
1257 .cmd_rcgr = 0x05000,
1258 .freq_tbl = ftbl_blsp1_qup_i2c_apps_clk_src,
1259 .hid_width = 5,
1260 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1261 .clkr.hw.init = &(struct clk_init_data){
1262 .name = "blsp1_qup4_i2c_apps_clk_src",
1263 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1264 .num_parents = 3,
1265 .ops = &clk_rcg2_ops,
1266 },
1267 };
1268
1269 static struct clk_rcg2 blsp1_qup4_spi_apps_clk_src = {
1270 .cmd_rcgr = 0x05014,
1271 .freq_tbl = ftbl_blsp1_qup_spi_apps_clk_src,
1272 .mnd_width = 8,
1273 .hid_width = 5,
1274 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1275 .clkr.hw.init = &(struct clk_init_data){
1276 .name = "blsp1_qup4_spi_apps_clk_src",
1277 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1278 .num_parents = 3,
1279 .ops = &clk_rcg2_ops,
1280 },
1281 };
1282
1283 static struct clk_rcg2 blsp1_qup5_i2c_apps_clk_src = {
1284 .cmd_rcgr = 0x06000,
1285 .freq_tbl = ftbl_blsp1_qup_i2c_apps_clk_src,
1286 .hid_width = 5,
1287 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1288 .clkr.hw.init = &(struct clk_init_data){
1289 .name = "blsp1_qup5_i2c_apps_clk_src",
1290 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1291 .num_parents = 3,
1292 .ops = &clk_rcg2_ops,
1293 },
1294 };
1295
1296 static struct clk_rcg2 blsp1_qup5_spi_apps_clk_src = {
1297 .cmd_rcgr = 0x06014,
1298 .freq_tbl = ftbl_blsp1_qup_spi_apps_clk_src,
1299 .mnd_width = 8,
1300 .hid_width = 5,
1301 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1302 .clkr.hw.init = &(struct clk_init_data){
1303 .name = "blsp1_qup5_spi_apps_clk_src",
1304 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1305 .num_parents = 3,
1306 .ops = &clk_rcg2_ops,
1307 },
1308 };
1309
1310 static struct clk_rcg2 blsp1_qup6_i2c_apps_clk_src = {
1311 .cmd_rcgr = 0x07000,
1312 .freq_tbl = ftbl_blsp1_qup_i2c_apps_clk_src,
1313 .hid_width = 5,
1314 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1315 .clkr.hw.init = &(struct clk_init_data){
1316 .name = "blsp1_qup6_i2c_apps_clk_src",
1317 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1318 .num_parents = 3,
1319 .ops = &clk_rcg2_ops,
1320 },
1321 };
1322
1323 static struct clk_rcg2 blsp1_qup6_spi_apps_clk_src = {
1324 .cmd_rcgr = 0x07014,
1325 .freq_tbl = ftbl_blsp1_qup_spi_apps_clk_src,
1326 .mnd_width = 8,
1327 .hid_width = 5,
1328 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1329 .clkr.hw.init = &(struct clk_init_data){
1330 .name = "blsp1_qup6_spi_apps_clk_src",
1331 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1332 .num_parents = 3,
1333 .ops = &clk_rcg2_ops,
1334 },
1335 };
1336
1337 static const struct freq_tbl ftbl_blsp1_uart_apps_clk_src[] = {
1338 F(3686400, P_GPLL0_DIV2, 1, 144, 15625),
1339 F(7372800, P_GPLL0_DIV2, 1, 288, 15625),
1340 F(14745600, P_GPLL0_DIV2, 1, 576, 15625),
1341 F(16000000, P_GPLL0_DIV2, 5, 1, 5),
1342 F(24000000, P_XO, 1, 0, 0),
1343 F(24000000, P_GPLL0, 1, 3, 100),
1344 F(25000000, P_GPLL0, 16, 1, 2),
1345 F(32000000, P_GPLL0, 1, 1, 25),
1346 F(40000000, P_GPLL0, 1, 1, 20),
1347 F(46400000, P_GPLL0, 1, 29, 500),
1348 F(48000000, P_GPLL0, 1, 3, 50),
1349 F(51200000, P_GPLL0, 1, 8, 125),
1350 F(56000000, P_GPLL0, 1, 7, 100),
1351 F(58982400, P_GPLL0, 1, 1152, 15625),
1352 F(60000000, P_GPLL0, 1, 3, 40),
1353 F(64000000, P_GPLL0, 12.5, 1, 1),
1354 { }
1355 };
1356
1357 static struct clk_rcg2 blsp1_uart1_apps_clk_src = {
1358 .cmd_rcgr = 0x02044,
1359 .freq_tbl = ftbl_blsp1_uart_apps_clk_src,
1360 .mnd_width = 16,
1361 .hid_width = 5,
1362 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1363 .clkr.hw.init = &(struct clk_init_data){
1364 .name = "blsp1_uart1_apps_clk_src",
1365 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1366 .num_parents = 3,
1367 .ops = &clk_rcg2_ops,
1368 },
1369 };
1370
1371 static struct clk_rcg2 blsp1_uart2_apps_clk_src = {
1372 .cmd_rcgr = 0x03034,
1373 .freq_tbl = ftbl_blsp1_uart_apps_clk_src,
1374 .mnd_width = 16,
1375 .hid_width = 5,
1376 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1377 .clkr.hw.init = &(struct clk_init_data){
1378 .name = "blsp1_uart2_apps_clk_src",
1379 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1380 .num_parents = 3,
1381 .ops = &clk_rcg2_ops,
1382 },
1383 };
1384
1385 static struct clk_rcg2 blsp1_uart3_apps_clk_src = {
1386 .cmd_rcgr = 0x04034,
1387 .freq_tbl = ftbl_blsp1_uart_apps_clk_src,
1388 .mnd_width = 16,
1389 .hid_width = 5,
1390 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1391 .clkr.hw.init = &(struct clk_init_data){
1392 .name = "blsp1_uart3_apps_clk_src",
1393 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1394 .num_parents = 3,
1395 .ops = &clk_rcg2_ops,
1396 },
1397 };
1398
1399 static struct clk_rcg2 blsp1_uart4_apps_clk_src = {
1400 .cmd_rcgr = 0x05034,
1401 .freq_tbl = ftbl_blsp1_uart_apps_clk_src,
1402 .mnd_width = 16,
1403 .hid_width = 5,
1404 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1405 .clkr.hw.init = &(struct clk_init_data){
1406 .name = "blsp1_uart4_apps_clk_src",
1407 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1408 .num_parents = 3,
1409 .ops = &clk_rcg2_ops,
1410 },
1411 };
1412
1413 static struct clk_rcg2 blsp1_uart5_apps_clk_src = {
1414 .cmd_rcgr = 0x06034,
1415 .freq_tbl = ftbl_blsp1_uart_apps_clk_src,
1416 .mnd_width = 16,
1417 .hid_width = 5,
1418 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1419 .clkr.hw.init = &(struct clk_init_data){
1420 .name = "blsp1_uart5_apps_clk_src",
1421 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1422 .num_parents = 3,
1423 .ops = &clk_rcg2_ops,
1424 },
1425 };
1426
1427 static struct clk_rcg2 blsp1_uart6_apps_clk_src = {
1428 .cmd_rcgr = 0x07034,
1429 .freq_tbl = ftbl_blsp1_uart_apps_clk_src,
1430 .mnd_width = 16,
1431 .hid_width = 5,
1432 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1433 .clkr.hw.init = &(struct clk_init_data){
1434 .name = "blsp1_uart6_apps_clk_src",
1435 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1436 .num_parents = 3,
1437 .ops = &clk_rcg2_ops,
1438 },
1439 };
1440
1441 static const struct freq_tbl ftbl_crypto_clk_src[] = {
1442 F(40000000, P_GPLL0_DIV2, 10, 0, 0),
1443 F(80000000, P_GPLL0, 10, 0, 0),
1444 F(100000000, P_GPLL0, 8, 0, 0),
1445 F(160000000, P_GPLL0, 5, 0, 0),
1446 { }
1447 };
1448
1449 static struct clk_rcg2 crypto_clk_src = {
1450 .cmd_rcgr = 0x16004,
1451 .freq_tbl = ftbl_crypto_clk_src,
1452 .hid_width = 5,
1453 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1454 .clkr.hw.init = &(struct clk_init_data){
1455 .name = "crypto_clk_src",
1456 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1457 .num_parents = 3,
1458 .ops = &clk_rcg2_ops,
1459 },
1460 };
1461
1462 static const struct freq_tbl ftbl_gp_clk_src[] = {
1463 F(24000000, P_XO, 1, 0, 0),
1464 F(50000000, P_GPLL0_DIV2, 8, 0, 0),
1465 F(100000000, P_GPLL0, 8, 0, 0),
1466 F(200000000, P_GPLL0, 4, 0, 0),
1467 F(266666666, P_GPLL0, 3, 0, 0),
1468 { }
1469 };
1470
1471 static const struct clk_parent_data gcc_xo_gpll0_gpll6_gpll0_sleep_clk[] = {
1472 { .fw_name = "xo" },
1473 { .hw = &gpll0.clkr.hw },
1474 { .hw = &gpll6.clkr.hw },
1475 { .hw = &gpll0_out_main_div2.hw },
1476 { .fw_name = "sleep_clk" },
1477 };
1478
1479 static const struct parent_map gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map[] = {
1480 { P_XO, 0 },
1481 { P_GPLL0, 1 },
1482 { P_GPLL6, 2 },
1483 { P_GPLL0_DIV2, 4 },
1484 { P_SLEEP_CLK, 6 },
1485 };
1486
1487 static struct clk_rcg2 gp1_clk_src = {
1488 .cmd_rcgr = 0x08004,
1489 .freq_tbl = ftbl_gp_clk_src,
1490 .mnd_width = 8,
1491 .hid_width = 5,
1492 .parent_map = gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map,
1493 .clkr.hw.init = &(struct clk_init_data){
1494 .name = "gp1_clk_src",
1495 .parent_data = gcc_xo_gpll0_gpll6_gpll0_sleep_clk,
1496 .num_parents = 5,
1497 .ops = &clk_rcg2_ops,
1498 },
1499 };
1500
1501 static struct clk_rcg2 gp2_clk_src = {
1502 .cmd_rcgr = 0x09004,
1503 .freq_tbl = ftbl_gp_clk_src,
1504 .mnd_width = 8,
1505 .hid_width = 5,
1506 .parent_map = gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map,
1507 .clkr.hw.init = &(struct clk_init_data){
1508 .name = "gp2_clk_src",
1509 .parent_data = gcc_xo_gpll0_gpll6_gpll0_sleep_clk,
1510 .num_parents = 5,
1511 .ops = &clk_rcg2_ops,
1512 },
1513 };
1514
1515 static struct clk_rcg2 gp3_clk_src = {
1516 .cmd_rcgr = 0x0a004,
1517 .freq_tbl = ftbl_gp_clk_src,
1518 .mnd_width = 8,
1519 .hid_width = 5,
1520 .parent_map = gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map,
1521 .clkr.hw.init = &(struct clk_init_data){
1522 .name = "gp3_clk_src",
1523 .parent_data = gcc_xo_gpll0_gpll6_gpll0_sleep_clk,
1524 .num_parents = 5,
1525 .ops = &clk_rcg2_ops,
1526 },
1527 };
1528
1529 static struct clk_fixed_factor nss_ppe_cdiv_clk_src = {
1530 .mult = 1,
1531 .div = 4,
1532 .hw.init = &(struct clk_init_data){
1533 .name = "nss_ppe_cdiv_clk_src",
1534 .parent_hws = (const struct clk_hw *[]){
1535 &nss_ppe_clk_src.clkr.hw },
1536 .num_parents = 1,
1537 .ops = &clk_fixed_factor_ops,
1538 .flags = CLK_SET_RATE_PARENT,
1539 },
1540 };
1541
1542 static struct clk_regmap_div nss_ubi0_div_clk_src = {
1543 .reg = 0x68118,
1544 .shift = 0,
1545 .width = 4,
1546 .clkr = {
1547 .hw.init = &(struct clk_init_data){
1548 .name = "nss_ubi0_div_clk_src",
1549 .parent_hws = (const struct clk_hw *[]){
1550 &nss_ubi0_clk_src.clkr.hw },
1551 .num_parents = 1,
1552 .ops = &clk_regmap_div_ro_ops,
1553 .flags = CLK_SET_RATE_PARENT,
1554 },
1555 },
1556 };
1557
1558 static const struct freq_tbl ftbl_pcie_aux_clk_src[] = {
1559 F(24000000, P_XO, 1, 0, 0),
1560 };
1561
1562 static const struct clk_parent_data gcc_xo_gpll0_core_pi_sleep_clk[] = {
1563 { .fw_name = "xo" },
1564 { .hw = &gpll0.clkr.hw },
1565 { .fw_name = "sleep_clk" },
1566 };
1567
1568 static const struct parent_map gcc_xo_gpll0_core_pi_sleep_clk_map[] = {
1569 { P_XO, 0 },
1570 { P_GPLL0, 2 },
1571 { P_PI_SLEEP, 6 },
1572 };
1573
1574 static struct clk_rcg2 pcie0_aux_clk_src = {
1575 .cmd_rcgr = 0x75024,
1576 .freq_tbl = ftbl_pcie_aux_clk_src,
1577 .mnd_width = 16,
1578 .hid_width = 5,
1579 .parent_map = gcc_xo_gpll0_core_pi_sleep_clk_map,
1580 .clkr.hw.init = &(struct clk_init_data){
1581 .name = "pcie0_aux_clk_src",
1582 .parent_data = gcc_xo_gpll0_core_pi_sleep_clk,
1583 .num_parents = 3,
1584 .ops = &clk_rcg2_ops,
1585 },
1586 };
1587
1588 static const struct clk_parent_data gcc_pcie20_phy0_pipe_clk_xo[] = {
1589 { .fw_name = "pcie20_phy0_pipe_clk" },
1590 { .fw_name = "xo" },
1591 };
1592
1593 static const struct parent_map gcc_pcie20_phy0_pipe_clk_xo_map[] = {
1594 { P_PCIE20_PHY0_PIPE, 0 },
1595 { P_XO, 2 },
1596 };
1597
1598 static struct clk_regmap_mux pcie0_pipe_clk_src = {
1599 .reg = 0x7501c,
1600 .shift = 8,
1601 .width = 2,
1602 .parent_map = gcc_pcie20_phy0_pipe_clk_xo_map,
1603 .clkr = {
1604 .hw.init = &(struct clk_init_data){
1605 .name = "pcie0_pipe_clk_src",
1606 .parent_data = gcc_pcie20_phy0_pipe_clk_xo,
1607 .num_parents = 2,
1608 .ops = &clk_regmap_mux_closest_ops,
1609 .flags = CLK_SET_RATE_PARENT,
1610 },
1611 },
1612 };
1613
1614 static const struct freq_tbl ftbl_sdcc_apps_clk_src[] = {
1615 F(144000, P_XO, 16, 12, 125),
1616 F(400000, P_XO, 12, 1, 5),
1617 F(24000000, P_GPLL2, 12, 1, 4),
1618 F(48000000, P_GPLL2, 12, 1, 2),
1619 F(96000000, P_GPLL2, 12, 0, 0),
1620 F(177777778, P_GPLL0, 4.5, 0, 0),
1621 F(192000000, P_GPLL2, 6, 0, 0),
1622 F(384000000, P_GPLL2, 3, 0, 0),
1623 { }
1624 };
1625
1626 static const struct clk_parent_data
1627 gcc_xo_gpll0_gpll2_gpll0_out_main_div2[] = {
1628 { .fw_name = "xo" },
1629 { .hw = &gpll0.clkr.hw },
1630 { .hw = &gpll2.clkr.hw },
1631 { .hw = &gpll0_out_main_div2.hw },
1632 };
1633
1634 static const struct parent_map gcc_xo_gpll0_gpll2_gpll0_out_main_div2_map[] = {
1635 { P_XO, 0 },
1636 { P_GPLL0, 1 },
1637 { P_GPLL2, 2 },
1638 { P_GPLL0_DIV2, 4 },
1639 };
1640
1641 static struct clk_rcg2 sdcc1_apps_clk_src = {
1642 .cmd_rcgr = 0x42004,
1643 .freq_tbl = ftbl_sdcc_apps_clk_src,
1644 .mnd_width = 8,
1645 .hid_width = 5,
1646 .parent_map = gcc_xo_gpll0_gpll2_gpll0_out_main_div2_map,
1647 .clkr.hw.init = &(struct clk_init_data){
1648 .name = "sdcc1_apps_clk_src",
1649 .parent_data = gcc_xo_gpll0_gpll2_gpll0_out_main_div2,
1650 .num_parents = 4,
1651 .ops = &clk_rcg2_floor_ops,
1652 },
1653 };
1654
1655 static const struct freq_tbl ftbl_usb_aux_clk_src[] = {
1656 F(24000000, P_XO, 1, 0, 0),
1657 { }
1658 };
1659
1660 static struct clk_rcg2 usb0_aux_clk_src = {
1661 .cmd_rcgr = 0x3e05c,
1662 .freq_tbl = ftbl_usb_aux_clk_src,
1663 .mnd_width = 16,
1664 .hid_width = 5,
1665 .parent_map = gcc_xo_gpll0_core_pi_sleep_clk_map,
1666 .clkr.hw.init = &(struct clk_init_data){
1667 .name = "usb0_aux_clk_src",
1668 .parent_data = gcc_xo_gpll0_core_pi_sleep_clk,
1669 .num_parents = 3,
1670 .ops = &clk_rcg2_ops,
1671 },
1672 };
1673
1674 static const struct freq_tbl ftbl_usb_mock_utmi_clk_src[] = {
1675 F(24000000, P_XO, 1, 0, 0),
1676 F(60000000, P_GPLL6, 6, 1, 3),
1677 { }
1678 };
1679
1680 static const struct clk_parent_data
1681 gcc_xo_gpll6_gpll0_gpll0_out_main_div2[] = {
1682 { .fw_name = "xo" },
1683 { .hw = &gpll6.clkr.hw },
1684 { .hw = &gpll0.clkr.hw },
1685 { .hw = &gpll0_out_main_div2.hw },
1686 };
1687
1688 static const struct parent_map gcc_xo_gpll6_gpll0_gpll0_out_main_div2_map[] = {
1689 { P_XO, 0 },
1690 { P_GPLL6, 1 },
1691 { P_GPLL0, 3 },
1692 { P_GPLL0_DIV2, 4 },
1693 };
1694
1695 static struct clk_rcg2 usb0_mock_utmi_clk_src = {
1696 .cmd_rcgr = 0x3e020,
1697 .freq_tbl = ftbl_usb_mock_utmi_clk_src,
1698 .mnd_width = 8,
1699 .hid_width = 5,
1700 .parent_map = gcc_xo_gpll6_gpll0_gpll0_out_main_div2_map,
1701 .clkr.hw.init = &(struct clk_init_data){
1702 .name = "usb0_mock_utmi_clk_src",
1703 .parent_data = gcc_xo_gpll6_gpll0_gpll0_out_main_div2,
1704 .num_parents = 4,
1705 .ops = &clk_rcg2_ops,
1706 },
1707 };
1708
1709 static const struct clk_parent_data gcc_usb3phy_0_cc_pipe_clk_xo[] = {
1710 { .fw_name = "usb3phy_0_cc_pipe_clk" },
1711 { .fw_name = "xo" },
1712 };
1713
1714 static const struct parent_map gcc_usb3phy_0_cc_pipe_clk_xo_map[] = {
1715 { P_USB3PHY_0_PIPE, 0 },
1716 { P_XO, 2 },
1717 };
1718
1719 static struct clk_regmap_mux usb0_pipe_clk_src = {
1720 .reg = 0x3e048,
1721 .shift = 8,
1722 .width = 2,
1723 .parent_map = gcc_usb3phy_0_cc_pipe_clk_xo_map,
1724 .clkr = {
1725 .hw.init = &(struct clk_init_data){
1726 .name = "usb0_pipe_clk_src",
1727 .parent_data = gcc_usb3phy_0_cc_pipe_clk_xo,
1728 .num_parents = 2,
1729 .ops = &clk_regmap_mux_closest_ops,
1730 .flags = CLK_SET_RATE_PARENT,
1731 },
1732 },
1733 };
1734
1735 static const struct freq_tbl ftbl_sdcc_ice_core_clk_src[] = {
1736 F(80000000, P_GPLL0_DIV2, 5, 0, 0),
1737 F(160000000, P_GPLL0, 5, 0, 0),
1738 F(216000000, P_GPLL6, 5, 0, 0),
1739 F(308570000, P_GPLL6, 3.5, 0, 0),
1740 };
1741
1742 static const struct clk_parent_data gcc_xo_gpll0_gpll6_gpll0_div2[] = {
1743 { .fw_name = "xo"},
1744 { .hw = &gpll0.clkr.hw },
1745 { .hw = &gpll6.clkr.hw },
1746 { .hw = &gpll0_out_main_div2.hw },
1747 };
1748
1749 static const struct parent_map gcc_xo_gpll0_gpll6_gpll0_div2_map[] = {
1750 { P_XO, 0 },
1751 { P_GPLL0, 1 },
1752 { P_GPLL6, 2 },
1753 { P_GPLL0_DIV2, 4 },
1754 };
1755
1756 static struct clk_rcg2 sdcc1_ice_core_clk_src = {
1757 .cmd_rcgr = 0x5d000,
1758 .freq_tbl = ftbl_sdcc_ice_core_clk_src,
1759 .mnd_width = 8,
1760 .hid_width = 5,
1761 .parent_map = gcc_xo_gpll0_gpll6_gpll0_div2_map,
1762 .clkr.hw.init = &(struct clk_init_data){
1763 .name = "sdcc1_ice_core_clk_src",
1764 .parent_data = gcc_xo_gpll0_gpll6_gpll0_div2,
1765 .num_parents = 4,
1766 .ops = &clk_rcg2_ops,
1767 },
1768 };
1769
1770 static const struct freq_tbl ftbl_qdss_stm_clk_src[] = {
1771 F(24000000, P_XO, 1, 0, 0),
1772 F(50000000, P_GPLL0_DIV2, 8, 0, 0),
1773 F(100000000, P_GPLL0, 8, 0, 0),
1774 F(200000000, P_GPLL0, 4, 0, 0),
1775 { }
1776 };
1777
1778 static struct clk_rcg2 qdss_stm_clk_src = {
1779 .cmd_rcgr = 0x2902C,
1780 .freq_tbl = ftbl_qdss_stm_clk_src,
1781 .hid_width = 5,
1782 .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map,
1783 .clkr.hw.init = &(struct clk_init_data){
1784 .name = "qdss_stm_clk_src",
1785 .parent_data = gcc_xo_gpll0_gpll0_out_main_div2,
1786 .num_parents = 3,
1787 .ops = &clk_rcg2_ops,
1788 },
1789 };
1790
1791 static const struct freq_tbl ftbl_qdss_traceclkin_clk_src[] = {
1792 F(80000000, P_GPLL0_DIV2, 5, 0, 0),
1793 F(160000000, P_GPLL0, 5, 0, 0),
1794 F(300000000, P_GPLL4, 4, 0, 0),
1795 { }
1796 };
1797
1798 static const struct clk_parent_data gcc_xo_gpll4_gpll0_gpll0_div2[] = {
1799 { .fw_name = "xo" },
1800 { .hw = &gpll4.clkr.hw },
1801 { .hw = &gpll0.clkr.hw },
1802 { .hw = &gpll0_out_main_div2.hw },
1803 };
1804
1805 static const struct parent_map gcc_xo_gpll4_gpll0_gpll0_div2_map[] = {
1806 { P_XO, 0 },
1807 { P_GPLL4, 1 },
1808 { P_GPLL0, 2 },
1809 { P_GPLL0_DIV2, 4 },
1810 };
1811
1812 static struct clk_rcg2 qdss_traceclkin_clk_src = {
1813 .cmd_rcgr = 0x29048,
1814 .freq_tbl = ftbl_qdss_traceclkin_clk_src,
1815 .hid_width = 5,
1816 .parent_map = gcc_xo_gpll4_gpll0_gpll0_div2_map,
1817 .clkr.hw.init = &(struct clk_init_data){
1818 .name = "qdss_traceclkin_clk_src",
1819 .parent_data = gcc_xo_gpll4_gpll0_gpll0_div2,
1820 .num_parents = 4,
1821 .ops = &clk_rcg2_ops,
1822 },
1823 };
1824
1825 static struct clk_rcg2 usb1_mock_utmi_clk_src = {
1826 .cmd_rcgr = 0x3f020,
1827 .freq_tbl = ftbl_usb_mock_utmi_clk_src,
1828 .mnd_width = 8,
1829 .hid_width = 5,
1830 .parent_map = gcc_xo_gpll6_gpll0_gpll0_out_main_div2_map,
1831 .clkr.hw.init = &(struct clk_init_data){
1832 .name = "usb1_mock_utmi_clk_src",
1833 .parent_data = gcc_xo_gpll6_gpll0_gpll0_out_main_div2,
1834 .num_parents = 4,
1835 .ops = &clk_rcg2_ops,
1836 },
1837 };
1838
1839 static struct clk_branch gcc_adss_pwm_clk = {
1840 .halt_reg = 0x1c020,
1841 .clkr = {
1842 .enable_reg = 0x1c020,
1843 .enable_mask = BIT(0),
1844 .hw.init = &(struct clk_init_data){
1845 .name = "gcc_adss_pwm_clk",
1846 .parent_hws = (const struct clk_hw *[]){
1847 &adss_pwm_clk_src.clkr.hw },
1848 .num_parents = 1,
1849 .flags = CLK_SET_RATE_PARENT,
1850 .ops = &clk_branch2_ops,
1851 },
1852 },
1853 };
1854
1855 static struct clk_branch gcc_apss_ahb_clk = {
1856 .halt_reg = 0x4601c,
1857 .halt_check = BRANCH_HALT_VOTED,
1858 .clkr = {
1859 .enable_reg = 0x0b004,
1860 .enable_mask = BIT(14),
1861 .hw.init = &(struct clk_init_data){
1862 .name = "gcc_apss_ahb_clk",
1863 .parent_hws = (const struct clk_hw *[]){
1864 &apss_ahb_postdiv_clk_src.clkr.hw },
1865 .num_parents = 1,
1866 .flags = CLK_SET_RATE_PARENT,
1867 .ops = &clk_branch2_ops,
1868 },
1869 },
1870 };
1871
1872 static const struct freq_tbl ftbl_system_noc_bfdcd_clk_src[] = {
1873 F(24000000, P_XO, 1, 0, 0),
1874 F(50000000, P_GPLL0_DIV2, 8, 0, 0),
1875 F(100000000, P_GPLL0, 8, 0, 0),
1876 F(133333333, P_GPLL0, 6, 0, 0),
1877 F(160000000, P_GPLL0, 5, 0, 0),
1878 F(200000000, P_GPLL0, 4, 0, 0),
1879 F(266666667, P_GPLL0, 3, 0, 0),
1880 { }
1881 };
1882
1883 static struct clk_rcg2 system_noc_bfdcd_clk_src = {
1884 .cmd_rcgr = 0x26004,
1885 .freq_tbl = ftbl_system_noc_bfdcd_clk_src,
1886 .hid_width = 5,
1887 .parent_map = gcc_xo_gpll0_gpll6_gpll0_out_main_div2_map,
1888 .clkr.hw.init = &(struct clk_init_data){
1889 .name = "system_noc_bfdcd_clk_src",
1890 .parent_data = gcc_xo_gpll0_gpll6_gpll0_out_main_div2,
1891 .num_parents = 4,
1892 .ops = &clk_rcg2_ops,
1893 },
1894 };
1895
1896 static const struct freq_tbl ftbl_ubi32_mem_noc_bfdcd_clk_src[] = {
1897 F(24000000, P_XO, 1, 0, 0),
1898 F(307670000, P_BIAS_PLL_NSS_NOC, 1.5, 0, 0),
1899 F(533333333, P_GPLL0, 1.5, 0, 0),
1900 { }
1901 };
1902
1903 static const struct clk_parent_data
1904 gcc_xo_gpll0_gpll2_bias_pll_nss_noc_clk[] = {
1905 { .fw_name = "xo" },
1906 { .hw = &gpll0.clkr.hw },
1907 { .hw = &gpll2.clkr.hw },
1908 { .fw_name = "bias_pll_nss_noc_clk" },
1909 };
1910
1911 static const struct parent_map gcc_xo_gpll0_gpll2_bias_pll_nss_noc_clk_map[] = {
1912 { P_XO, 0 },
1913 { P_GPLL0, 1 },
1914 { P_GPLL2, 3 },
1915 { P_BIAS_PLL_NSS_NOC, 4 },
1916 };
1917
1918 static struct clk_rcg2 ubi32_mem_noc_bfdcd_clk_src = {
1919 .cmd_rcgr = 0x68088,
1920 .freq_tbl = ftbl_ubi32_mem_noc_bfdcd_clk_src,
1921 .hid_width = 5,
1922 .parent_map = gcc_xo_gpll0_gpll2_bias_pll_nss_noc_clk_map,
1923 .clkr.hw.init = &(struct clk_init_data){
1924 .name = "ubi32_mem_noc_bfdcd_clk_src",
1925 .parent_data = gcc_xo_gpll0_gpll2_bias_pll_nss_noc_clk,
1926 .num_parents = 4,
1927 .ops = &clk_rcg2_ops,
1928 },
1929 };
1930
1931 static struct clk_branch gcc_apss_axi_clk = {
1932 .halt_reg = 0x46020,
1933 .halt_check = BRANCH_HALT_VOTED,
1934 .clkr = {
1935 .enable_reg = 0x0b004,
1936 .enable_mask = BIT(13),
1937 .hw.init = &(struct clk_init_data){
1938 .name = "gcc_apss_axi_clk",
1939 .parent_hws = (const struct clk_hw *[]){
1940 &apss_axi_clk_src.clkr.hw },
1941 .num_parents = 1,
1942 .flags = CLK_SET_RATE_PARENT,
1943 .ops = &clk_branch2_ops,
1944 },
1945 },
1946 };
1947
1948 static struct clk_branch gcc_blsp1_ahb_clk = {
1949 .halt_reg = 0x01008,
1950 .halt_check = BRANCH_HALT_VOTED,
1951 .clkr = {
1952 .enable_reg = 0x0b004,
1953 .enable_mask = BIT(10),
1954 .hw.init = &(struct clk_init_data){
1955 .name = "gcc_blsp1_ahb_clk",
1956 .parent_hws = (const struct clk_hw *[]){
1957 &pcnoc_bfdcd_clk_src.clkr.hw },
1958 .num_parents = 1,
1959 .flags = CLK_SET_RATE_PARENT,
1960 .ops = &clk_branch2_ops,
1961 },
1962 },
1963 };
1964
1965 static struct clk_branch gcc_blsp1_qup1_i2c_apps_clk = {
1966 .halt_reg = 0x02008,
1967 .clkr = {
1968 .enable_reg = 0x02008,
1969 .enable_mask = BIT(0),
1970 .hw.init = &(struct clk_init_data){
1971 .name = "gcc_blsp1_qup1_i2c_apps_clk",
1972 .parent_hws = (const struct clk_hw *[]){
1973 &blsp1_qup1_i2c_apps_clk_src.clkr.hw },
1974 .num_parents = 1,
1975 .flags = CLK_SET_RATE_PARENT,
1976 .ops = &clk_branch2_ops,
1977 },
1978 },
1979 };
1980
1981 static struct clk_branch gcc_blsp1_qup1_spi_apps_clk = {
1982 .halt_reg = 0x02004,
1983 .clkr = {
1984 .enable_reg = 0x02004,
1985 .enable_mask = BIT(0),
1986 .hw.init = &(struct clk_init_data){
1987 .name = "gcc_blsp1_qup1_spi_apps_clk",
1988 .parent_hws = (const struct clk_hw *[]){
1989 &blsp1_qup1_spi_apps_clk_src.clkr.hw },
1990 .num_parents = 1,
1991 .flags = CLK_SET_RATE_PARENT,
1992 .ops = &clk_branch2_ops,
1993 },
1994 },
1995 };
1996
1997 static struct clk_branch gcc_blsp1_qup2_i2c_apps_clk = {
1998 .halt_reg = 0x03010,
1999 .clkr = {
2000 .enable_reg = 0x03010,
2001 .enable_mask = BIT(0),
2002 .hw.init = &(struct clk_init_data){
2003 .name = "gcc_blsp1_qup2_i2c_apps_clk",
2004 .parent_hws = (const struct clk_hw *[]){
2005 &blsp1_qup2_i2c_apps_clk_src.clkr.hw },
2006 .num_parents = 1,
2007 .flags = CLK_SET_RATE_PARENT,
2008 .ops = &clk_branch2_ops,
2009 },
2010 },
2011 };
2012
2013 static struct clk_branch gcc_blsp1_qup2_spi_apps_clk = {
2014 .halt_reg = 0x0300c,
2015 .clkr = {
2016 .enable_reg = 0x0300c,
2017 .enable_mask = BIT(0),
2018 .hw.init = &(struct clk_init_data){
2019 .name = "gcc_blsp1_qup2_spi_apps_clk",
2020 .parent_hws = (const struct clk_hw *[]){
2021 &blsp1_qup2_spi_apps_clk_src.clkr.hw },
2022 .num_parents = 1,
2023 .flags = CLK_SET_RATE_PARENT,
2024 .ops = &clk_branch2_ops,
2025 },
2026 },
2027 };
2028
2029 static struct clk_branch gcc_blsp1_qup3_i2c_apps_clk = {
2030 .halt_reg = 0x04010,
2031 .clkr = {
2032 .enable_reg = 0x04010,
2033 .enable_mask = BIT(0),
2034 .hw.init = &(struct clk_init_data){
2035 .name = "gcc_blsp1_qup3_i2c_apps_clk",
2036 .parent_hws = (const struct clk_hw *[]){
2037 &blsp1_qup3_i2c_apps_clk_src.clkr.hw },
2038 .num_parents = 1,
2039 .flags = CLK_SET_RATE_PARENT,
2040 .ops = &clk_branch2_ops,
2041 },
2042 },
2043 };
2044
2045 static struct clk_branch gcc_blsp1_qup3_spi_apps_clk = {
2046 .halt_reg = 0x0400c,
2047 .clkr = {
2048 .enable_reg = 0x0400c,
2049 .enable_mask = BIT(0),
2050 .hw.init = &(struct clk_init_data){
2051 .name = "gcc_blsp1_qup3_spi_apps_clk",
2052 .parent_hws = (const struct clk_hw *[]){
2053 &blsp1_qup3_spi_apps_clk_src.clkr.hw },
2054 .num_parents = 1,
2055 .flags = CLK_SET_RATE_PARENT,
2056 .ops = &clk_branch2_ops,
2057 },
2058 },
2059 };
2060
2061 static struct clk_branch gcc_blsp1_qup4_i2c_apps_clk = {
2062 .halt_reg = 0x05010,
2063 .clkr = {
2064 .enable_reg = 0x05010,
2065 .enable_mask = BIT(0),
2066 .hw.init = &(struct clk_init_data){
2067 .name = "gcc_blsp1_qup4_i2c_apps_clk",
2068 .parent_hws = (const struct clk_hw *[]){
2069 &blsp1_qup4_i2c_apps_clk_src.clkr.hw },
2070 .num_parents = 1,
2071 .flags = CLK_SET_RATE_PARENT,
2072 .ops = &clk_branch2_ops,
2073 },
2074 },
2075 };
2076
2077 static struct clk_branch gcc_blsp1_qup4_spi_apps_clk = {
2078 .halt_reg = 0x0500c,
2079 .clkr = {
2080 .enable_reg = 0x0500c,
2081 .enable_mask = BIT(0),
2082 .hw.init = &(struct clk_init_data){
2083 .name = "gcc_blsp1_qup4_spi_apps_clk",
2084 .parent_hws = (const struct clk_hw *[]){
2085 &blsp1_qup4_spi_apps_clk_src.clkr.hw },
2086 .num_parents = 1,
2087 .flags = CLK_SET_RATE_PARENT,
2088 .ops = &clk_branch2_ops,
2089 },
2090 },
2091 };
2092
2093 static struct clk_branch gcc_blsp1_qup5_i2c_apps_clk = {
2094 .halt_reg = 0x06010,
2095 .clkr = {
2096 .enable_reg = 0x06010,
2097 .enable_mask = BIT(0),
2098 .hw.init = &(struct clk_init_data){
2099 .name = "gcc_blsp1_qup5_i2c_apps_clk",
2100 .parent_hws = (const struct clk_hw *[]){
2101 &blsp1_qup5_i2c_apps_clk_src.clkr.hw },
2102 .num_parents = 1,
2103 .flags = CLK_SET_RATE_PARENT,
2104 .ops = &clk_branch2_ops,
2105 },
2106 },
2107 };
2108
2109 static struct clk_branch gcc_blsp1_qup5_spi_apps_clk = {
2110 .halt_reg = 0x0600c,
2111 .clkr = {
2112 .enable_reg = 0x0600c,
2113 .enable_mask = BIT(0),
2114 .hw.init = &(struct clk_init_data){
2115 .name = "gcc_blsp1_qup5_spi_apps_clk",
2116 .parent_hws = (const struct clk_hw *[]){
2117 &blsp1_qup5_spi_apps_clk_src.clkr.hw },
2118 .num_parents = 1,
2119 .flags = CLK_SET_RATE_PARENT,
2120 .ops = &clk_branch2_ops,
2121 },
2122 },
2123 };
2124
2125 static struct clk_branch gcc_blsp1_qup6_spi_apps_clk = {
2126 .halt_reg = 0x0700c,
2127 .clkr = {
2128 .enable_reg = 0x0700c,
2129 .enable_mask = BIT(0),
2130 .hw.init = &(struct clk_init_data){
2131 .name = "gcc_blsp1_qup6_spi_apps_clk",
2132 .parent_hws = (const struct clk_hw *[]){
2133 &blsp1_qup6_spi_apps_clk_src.clkr.hw },
2134 .num_parents = 1,
2135 .flags = CLK_SET_RATE_PARENT,
2136 .ops = &clk_branch2_ops,
2137 },
2138 },
2139 };
2140
2141 static struct clk_branch gcc_blsp1_uart1_apps_clk = {
2142 .halt_reg = 0x0203c,
2143 .clkr = {
2144 .enable_reg = 0x0203c,
2145 .enable_mask = BIT(0),
2146 .hw.init = &(struct clk_init_data){
2147 .name = "gcc_blsp1_uart1_apps_clk",
2148 .parent_hws = (const struct clk_hw *[]){
2149 &blsp1_uart1_apps_clk_src.clkr.hw },
2150 .num_parents = 1,
2151 .flags = CLK_SET_RATE_PARENT,
2152 .ops = &clk_branch2_ops,
2153 },
2154 },
2155 };
2156
2157 static struct clk_branch gcc_blsp1_uart2_apps_clk = {
2158 .halt_reg = 0x0302c,
2159 .clkr = {
2160 .enable_reg = 0x0302c,
2161 .enable_mask = BIT(0),
2162 .hw.init = &(struct clk_init_data){
2163 .name = "gcc_blsp1_uart2_apps_clk",
2164 .parent_hws = (const struct clk_hw *[]){
2165 &blsp1_uart2_apps_clk_src.clkr.hw },
2166 .num_parents = 1,
2167 .flags = CLK_SET_RATE_PARENT,
2168 .ops = &clk_branch2_ops,
2169 },
2170 },
2171 };
2172
2173 static struct clk_branch gcc_blsp1_uart3_apps_clk = {
2174 .halt_reg = 0x0402c,
2175 .clkr = {
2176 .enable_reg = 0x0402c,
2177 .enable_mask = BIT(0),
2178 .hw.init = &(struct clk_init_data){
2179 .name = "gcc_blsp1_uart3_apps_clk",
2180 .parent_hws = (const struct clk_hw *[]){
2181 &blsp1_uart3_apps_clk_src.clkr.hw },
2182 .num_parents = 1,
2183 .flags = CLK_SET_RATE_PARENT,
2184 .ops = &clk_branch2_ops,
2185 },
2186 },
2187 };
2188
2189 static struct clk_branch gcc_blsp1_uart4_apps_clk = {
2190 .halt_reg = 0x0502c,
2191 .clkr = {
2192 .enable_reg = 0x0502c,
2193 .enable_mask = BIT(0),
2194 .hw.init = &(struct clk_init_data){
2195 .name = "gcc_blsp1_uart4_apps_clk",
2196 .parent_hws = (const struct clk_hw *[]){
2197 &blsp1_uart4_apps_clk_src.clkr.hw },
2198 .num_parents = 1,
2199 .flags = CLK_SET_RATE_PARENT,
2200 .ops = &clk_branch2_ops,
2201 },
2202 },
2203 };
2204
2205 static struct clk_branch gcc_blsp1_uart5_apps_clk = {
2206 .halt_reg = 0x0602c,
2207 .clkr = {
2208 .enable_reg = 0x0602c,
2209 .enable_mask = BIT(0),
2210 .hw.init = &(struct clk_init_data){
2211 .name = "gcc_blsp1_uart5_apps_clk",
2212 .parent_hws = (const struct clk_hw *[]){
2213 &blsp1_uart5_apps_clk_src.clkr.hw },
2214 .num_parents = 1,
2215 .flags = CLK_SET_RATE_PARENT,
2216 .ops = &clk_branch2_ops,
2217 },
2218 },
2219 };
2220
2221 static struct clk_branch gcc_blsp1_uart6_apps_clk = {
2222 .halt_reg = 0x0702c,
2223 .clkr = {
2224 .enable_reg = 0x0702c,
2225 .enable_mask = BIT(0),
2226 .hw.init = &(struct clk_init_data){
2227 .name = "gcc_blsp1_uart6_apps_clk",
2228 .parent_hws = (const struct clk_hw *[]){
2229 &blsp1_uart6_apps_clk_src.clkr.hw },
2230 .num_parents = 1,
2231 .flags = CLK_SET_RATE_PARENT,
2232 .ops = &clk_branch2_ops,
2233 },
2234 },
2235 };
2236
2237 static struct clk_branch gcc_crypto_ahb_clk = {
2238 .halt_reg = 0x16024,
2239 .halt_check = BRANCH_HALT_VOTED,
2240 .clkr = {
2241 .enable_reg = 0x0b004,
2242 .enable_mask = BIT(0),
2243 .hw.init = &(struct clk_init_data){
2244 .name = "gcc_crypto_ahb_clk",
2245 .parent_hws = (const struct clk_hw *[]){
2246 &pcnoc_bfdcd_clk_src.clkr.hw },
2247 .num_parents = 1,
2248 .flags = CLK_SET_RATE_PARENT,
2249 .ops = &clk_branch2_ops,
2250 },
2251 },
2252 };
2253
2254 static struct clk_branch gcc_crypto_axi_clk = {
2255 .halt_reg = 0x16020,
2256 .halt_check = BRANCH_HALT_VOTED,
2257 .clkr = {
2258 .enable_reg = 0x0b004,
2259 .enable_mask = BIT(1),
2260 .hw.init = &(struct clk_init_data){
2261 .name = "gcc_crypto_axi_clk",
2262 .parent_hws = (const struct clk_hw *[]){
2263 &pcnoc_bfdcd_clk_src.clkr.hw },
2264 .num_parents = 1,
2265 .flags = CLK_SET_RATE_PARENT,
2266 .ops = &clk_branch2_ops,
2267 },
2268 },
2269 };
2270
2271 static struct clk_branch gcc_crypto_clk = {
2272 .halt_reg = 0x1601c,
2273 .halt_check = BRANCH_HALT_VOTED,
2274 .clkr = {
2275 .enable_reg = 0x0b004,
2276 .enable_mask = BIT(2),
2277 .hw.init = &(struct clk_init_data){
2278 .name = "gcc_crypto_clk",
2279 .parent_hws = (const struct clk_hw *[]){
2280 &crypto_clk_src.clkr.hw },
2281 .num_parents = 1,
2282 .flags = CLK_SET_RATE_PARENT,
2283 .ops = &clk_branch2_ops,
2284 },
2285 },
2286 };
2287
2288 static struct clk_fixed_factor gpll6_out_main_div2 = {
2289 .mult = 1,
2290 .div = 2,
2291 .hw.init = &(struct clk_init_data){
2292 .name = "gpll6_out_main_div2",
2293 .parent_hws = (const struct clk_hw *[]){
2294 &gpll6_main.clkr.hw },
2295 .num_parents = 1,
2296 .ops = &clk_fixed_factor_ops,
2297 .flags = CLK_SET_RATE_PARENT,
2298 },
2299 };
2300
2301 static struct clk_branch gcc_xo_clk = {
2302 .halt_reg = 0x30030,
2303 .clkr = {
2304 .enable_reg = 0x30030,
2305 .enable_mask = BIT(0),
2306 .hw.init = &(struct clk_init_data){
2307 .name = "gcc_xo_clk",
2308 .parent_hws = (const struct clk_hw *[]){
2309 &gcc_xo_clk_src.clkr.hw },
2310 .num_parents = 1,
2311 .flags = CLK_SET_RATE_PARENT,
2312 .ops = &clk_branch2_ops,
2313 },
2314 },
2315 };
2316
2317 static struct clk_branch gcc_gp1_clk = {
2318 .halt_reg = 0x08000,
2319 .clkr = {
2320 .enable_reg = 0x08000,
2321 .enable_mask = BIT(0),
2322 .hw.init = &(struct clk_init_data){
2323 .name = "gcc_gp1_clk",
2324 .parent_hws = (const struct clk_hw *[]){
2325 &gp1_clk_src.clkr.hw },
2326 .num_parents = 1,
2327 .flags = CLK_SET_RATE_PARENT,
2328 .ops = &clk_branch2_ops,
2329 },
2330 },
2331 };
2332
2333 static struct clk_branch gcc_gp2_clk = {
2334 .halt_reg = 0x09000,
2335 .clkr = {
2336 .enable_reg = 0x09000,
2337 .enable_mask = BIT(0),
2338 .hw.init = &(struct clk_init_data){
2339 .name = "gcc_gp2_clk",
2340 .parent_hws = (const struct clk_hw *[]){
2341 &gp2_clk_src.clkr.hw },
2342 .num_parents = 1,
2343 .flags = CLK_SET_RATE_PARENT,
2344 .ops = &clk_branch2_ops,
2345 },
2346 },
2347 };
2348
2349 static struct clk_branch gcc_gp3_clk = {
2350 .halt_reg = 0x0a000,
2351 .clkr = {
2352 .enable_reg = 0x0a000,
2353 .enable_mask = BIT(0),
2354 .hw.init = &(struct clk_init_data){
2355 .name = "gcc_gp3_clk",
2356 .parent_hws = (const struct clk_hw *[]){
2357 &gp3_clk_src.clkr.hw },
2358 .num_parents = 1,
2359 .flags = CLK_SET_RATE_PARENT,
2360 .ops = &clk_branch2_ops,
2361 },
2362 },
2363 };
2364
2365 static struct clk_branch gcc_mdio_ahb_clk = {
2366 .halt_reg = 0x58004,
2367 .clkr = {
2368 .enable_reg = 0x58004,
2369 .enable_mask = BIT(0),
2370 .hw.init = &(struct clk_init_data){
2371 .name = "gcc_mdio_ahb_clk",
2372 .parent_hws = (const struct clk_hw *[]){
2373 &pcnoc_bfdcd_clk_src.clkr.hw },
2374 .num_parents = 1,
2375 .flags = CLK_SET_RATE_PARENT,
2376 .ops = &clk_branch2_ops,
2377 },
2378 },
2379 };
2380
2381 static struct clk_branch gcc_crypto_ppe_clk = {
2382 .halt_reg = 0x68310,
2383 .clkr = {
2384 .enable_reg = 0x68310,
2385 .enable_mask = BIT(0),
2386 .hw.init = &(struct clk_init_data){
2387 .name = "gcc_crypto_ppe_clk",
2388 .parent_hws = (const struct clk_hw *[]){
2389 &nss_ppe_clk_src.clkr.hw },
2390 .num_parents = 1,
2391 .flags = CLK_SET_RATE_PARENT,
2392 .ops = &clk_branch2_ops,
2393 },
2394 },
2395 };
2396
2397 static struct clk_branch gcc_nss_ce_apb_clk = {
2398 .halt_reg = 0x68174,
2399 .clkr = {
2400 .enable_reg = 0x68174,
2401 .enable_mask = BIT(0),
2402 .hw.init = &(struct clk_init_data){
2403 .name = "gcc_nss_ce_apb_clk",
2404 .parent_hws = (const struct clk_hw *[]){
2405 &nss_ce_clk_src.clkr.hw },
2406 .num_parents = 1,
2407 .flags = CLK_SET_RATE_PARENT,
2408 .ops = &clk_branch2_ops,
2409 },
2410 },
2411 };
2412
2413 static struct clk_branch gcc_nss_ce_axi_clk = {
2414 .halt_reg = 0x68170,
2415 .clkr = {
2416 .enable_reg = 0x68170,
2417 .enable_mask = BIT(0),
2418 .hw.init = &(struct clk_init_data){
2419 .name = "gcc_nss_ce_axi_clk",
2420 .parent_hws = (const struct clk_hw *[]){
2421 &nss_ce_clk_src.clkr.hw },
2422 .num_parents = 1,
2423 .flags = CLK_SET_RATE_PARENT,
2424 .ops = &clk_branch2_ops,
2425 },
2426 },
2427 };
2428
2429 static struct clk_branch gcc_nss_cfg_clk = {
2430 .halt_reg = 0x68160,
2431 .clkr = {
2432 .enable_reg = 0x68160,
2433 .enable_mask = BIT(0),
2434 .hw.init = &(struct clk_init_data){
2435 .name = "gcc_nss_cfg_clk",
2436 .parent_hws = (const struct clk_hw *[]){
2437 &pcnoc_bfdcd_clk_src.clkr.hw },
2438 .num_parents = 1,
2439 .flags = CLK_SET_RATE_PARENT,
2440 .ops = &clk_branch2_ops,
2441 },
2442 },
2443 };
2444
2445 static struct clk_branch gcc_nss_crypto_clk = {
2446 .halt_reg = 0x68164,
2447 .clkr = {
2448 .enable_reg = 0x68164,
2449 .enable_mask = BIT(0),
2450 .hw.init = &(struct clk_init_data){
2451 .name = "gcc_nss_crypto_clk",
2452 .parent_hws = (const struct clk_hw *[]){
2453 &nss_crypto_clk_src.clkr.hw },
2454 .num_parents = 1,
2455 .flags = CLK_SET_RATE_PARENT,
2456 .ops = &clk_branch2_ops,
2457 },
2458 },
2459 };
2460
2461 static struct clk_branch gcc_nss_csr_clk = {
2462 .halt_reg = 0x68318,
2463 .clkr = {
2464 .enable_reg = 0x68318,
2465 .enable_mask = BIT(0),
2466 .hw.init = &(struct clk_init_data){
2467 .name = "gcc_nss_csr_clk",
2468 .parent_hws = (const struct clk_hw *[]){
2469 &nss_ce_clk_src.clkr.hw },
2470 .num_parents = 1,
2471 .flags = CLK_SET_RATE_PARENT,
2472 .ops = &clk_branch2_ops,
2473 },
2474 },
2475 };
2476
2477 static struct clk_branch gcc_nss_edma_cfg_clk = {
2478 .halt_reg = 0x6819C,
2479 .clkr = {
2480 .enable_reg = 0x6819C,
2481 .enable_mask = BIT(0),
2482 .hw.init = &(struct clk_init_data){
2483 .name = "gcc_nss_edma_cfg_clk",
2484 .parent_hws = (const struct clk_hw *[]){
2485 &nss_ppe_clk_src.clkr.hw },
2486 .num_parents = 1,
2487 .flags = CLK_SET_RATE_PARENT,
2488 .ops = &clk_branch2_ops,
2489 },
2490 },
2491 };
2492
2493 static struct clk_branch gcc_nss_edma_clk = {
2494 .halt_reg = 0x68198,
2495 .clkr = {
2496 .enable_reg = 0x68198,
2497 .enable_mask = BIT(0),
2498 .hw.init = &(struct clk_init_data){
2499 .name = "gcc_nss_edma_clk",
2500 .parent_hws = (const struct clk_hw *[]){
2501 &nss_ppe_clk_src.clkr.hw },
2502 .num_parents = 1,
2503 .flags = CLK_SET_RATE_PARENT,
2504 .ops = &clk_branch2_ops,
2505 },
2506 },
2507 };
2508
2509 static struct clk_branch gcc_nss_noc_clk = {
2510 .halt_reg = 0x68168,
2511 .clkr = {
2512 .enable_reg = 0x68168,
2513 .enable_mask = BIT(0),
2514 .hw.init = &(struct clk_init_data){
2515 .name = "gcc_nss_noc_clk",
2516 .parent_hws = (const struct clk_hw *[]){
2517 &snoc_nssnoc_bfdcd_clk_src.clkr.hw },
2518 .num_parents = 1,
2519 .flags = CLK_SET_RATE_PARENT,
2520 .ops = &clk_branch2_ops,
2521 },
2522 },
2523 };
2524
2525 static struct clk_branch gcc_ubi0_utcm_clk = {
2526 .halt_reg = 0x2606c,
2527 .clkr = {
2528 .enable_reg = 0x2606c,
2529 .enable_mask = BIT(0),
2530 .hw.init = &(struct clk_init_data){
2531 .name = "gcc_ubi0_utcm_clk",
2532 .parent_hws = (const struct clk_hw *[]){
2533 &snoc_nssnoc_bfdcd_clk_src.clkr.hw },
2534 .num_parents = 1,
2535 .flags = CLK_SET_RATE_PARENT,
2536 .ops = &clk_branch2_ops,
2537 },
2538 },
2539 };
2540
2541 static struct clk_branch gcc_snoc_nssnoc_clk = {
2542 .halt_reg = 0x26070,
2543 .clkr = {
2544 .enable_reg = 0x26070,
2545 .enable_mask = BIT(0),
2546 .hw.init = &(struct clk_init_data){
2547 .name = "gcc_snoc_nssnoc_clk",
2548 .parent_hws = (const struct clk_hw *[]){
2549 &snoc_nssnoc_bfdcd_clk_src.clkr.hw },
2550 .num_parents = 1,
2551 .flags = CLK_SET_RATE_PARENT,
2552 .ops = &clk_branch2_ops,
2553 },
2554 },
2555 };
2556
2557 static const struct freq_tbl ftbl_wcss_ahb_clk_src[] = {
2558 F(24000000, P_XO, 1, 0, 0),
2559 F(133333333, P_GPLL0, 6, 0, 0),
2560 { }
2561 };
2562
2563 static const struct freq_tbl ftbl_q6_axi_clk_src[] = {
2564 F(24000000, P_XO, 1, 0, 0),
2565 F(400000000, P_GPLL0, 2, 0, 0),
2566 { }
2567 };
2568
2569 static struct clk_rcg2 wcss_ahb_clk_src = {
2570 .cmd_rcgr = 0x59020,
2571 .freq_tbl = ftbl_wcss_ahb_clk_src,
2572 .hid_width = 5,
2573 .parent_map = gcc_xo_gpll0_map,
2574 .clkr.hw.init = &(struct clk_init_data){
2575 .name = "wcss_ahb_clk_src",
2576 .parent_data = gcc_xo_gpll0,
2577 .num_parents = 2,
2578 .ops = &clk_rcg2_ops,
2579 },
2580 };
2581
2582 static const struct clk_parent_data gcc_xo_gpll0_gpll2_gpll4_gpll6[] = {
2583 { .fw_name = "xo" },
2584 { .hw = &gpll0.clkr.hw },
2585 { .hw = &gpll2.clkr.hw },
2586 { .hw = &gpll4.clkr.hw },
2587 { .hw = &gpll6.clkr.hw },
2588 };
2589
2590 static const struct parent_map gcc_xo_gpll0_gpll2_gpll4_gpll6_map[] = {
2591 { P_XO, 0 },
2592 { P_GPLL0, 1 },
2593 { P_GPLL2, 2 },
2594 { P_GPLL4, 3 },
2595 { P_GPLL6, 4 },
2596 };
2597
2598 static struct clk_rcg2 q6_axi_clk_src = {
2599 .cmd_rcgr = 0x59120,
2600 .freq_tbl = ftbl_q6_axi_clk_src,
2601 .hid_width = 5,
2602 .parent_map = gcc_xo_gpll0_gpll2_gpll4_gpll6_map,
2603 .clkr.hw.init = &(struct clk_init_data){
2604 .name = "q6_axi_clk_src",
2605 .parent_data = gcc_xo_gpll0_gpll2_gpll4_gpll6,
2606 .num_parents = 5,
2607 .ops = &clk_rcg2_ops,
2608 },
2609 };
2610
2611 static const struct freq_tbl ftbl_lpass_core_axim_clk_src[] = {
2612 F(24000000, P_XO, 1, 0, 0),
2613 F(100000000, P_GPLL0, 8, 0, 0),
2614 { }
2615 };
2616
2617 static struct clk_rcg2 lpass_core_axim_clk_src = {
2618 .cmd_rcgr = 0x1F020,
2619 .freq_tbl = ftbl_lpass_core_axim_clk_src,
2620 .hid_width = 5,
2621 .parent_map = gcc_xo_gpll0_map,
2622 .clkr.hw.init = &(struct clk_init_data){
2623 .name = "lpass_core_axim_clk_src",
2624 .parent_data = gcc_xo_gpll0,
2625 .num_parents = 2,
2626 .ops = &clk_rcg2_ops,
2627 },
2628 };
2629
2630 static const struct freq_tbl ftbl_lpass_snoc_cfg_clk_src[] = {
2631 F(24000000, P_XO, 1, 0, 0),
2632 F(266666667, P_GPLL0, 3, 0, 0),
2633 { }
2634 };
2635
2636 static struct clk_rcg2 lpass_snoc_cfg_clk_src = {
2637 .cmd_rcgr = 0x1F040,
2638 .freq_tbl = ftbl_lpass_snoc_cfg_clk_src,
2639 .hid_width = 5,
2640 .parent_map = gcc_xo_gpll0_map,
2641 .clkr.hw.init = &(struct clk_init_data){
2642 .name = "lpass_snoc_cfg_clk_src",
2643 .parent_data = gcc_xo_gpll0,
2644 .num_parents = 2,
2645 .ops = &clk_rcg2_ops,
2646 },
2647 };
2648
2649 static const struct freq_tbl ftbl_lpass_q6_axim_clk_src[] = {
2650 F(24000000, P_XO, 1, 0, 0),
2651 F(400000000, P_GPLL0, 2, 0, 0),
2652 { }
2653 };
2654
2655 static struct clk_rcg2 lpass_q6_axim_clk_src = {
2656 .cmd_rcgr = 0x1F008,
2657 .freq_tbl = ftbl_lpass_q6_axim_clk_src,
2658 .hid_width = 5,
2659 .parent_map = gcc_xo_gpll0_map,
2660 .clkr.hw.init = &(struct clk_init_data){
2661 .name = "lpass_q6_axim_clk_src",
2662 .parent_data = gcc_xo_gpll0,
2663 .num_parents = 2,
2664 .ops = &clk_rcg2_ops,
2665 },
2666 };
2667
2668 static struct freq_tbl ftbl_rbcpr_wcss_clk_src[] = {
2669 F(24000000, P_XO, 1, 0, 0),
2670 F(50000000, P_GPLL0, 16, 0, 0),
2671 { }
2672 };
2673
2674 static struct clk_rcg2 rbcpr_wcss_clk_src = {
2675 .cmd_rcgr = 0x3a00c,
2676 .freq_tbl = ftbl_rbcpr_wcss_clk_src,
2677 .hid_width = 5,
2678 .parent_map = gcc_xo_gpll0_out_main_div2_gpll0_map,
2679 .clkr.hw.init = &(struct clk_init_data){
2680 .name = "rbcpr_wcss_clk_src",
2681 .parent_data = gcc_xo_gpll0_out_main_div2_gpll0,
2682 .num_parents = 3,
2683 .ops = &clk_rcg2_ops,
2684 },
2685 };
2686
2687 static struct clk_branch gcc_lpass_core_axim_clk = {
2688 .halt_reg = 0x1F028,
2689 .clkr = {
2690 .enable_reg = 0x1F028,
2691 .enable_mask = BIT(0),
2692 .hw.init = &(struct clk_init_data){
2693 .name = "gcc_lpass_core_axim_clk",
2694 .parent_hws = (const struct clk_hw *[]){
2695 &lpass_core_axim_clk_src.clkr.hw },
2696 .num_parents = 1,
2697 .flags = CLK_SET_RATE_PARENT,
2698 .ops = &clk_branch2_ops,
2699 },
2700 },
2701 };
2702
2703 static struct clk_branch gcc_lpass_snoc_cfg_clk = {
2704 .halt_reg = 0x1F048,
2705 .clkr = {
2706 .enable_reg = 0x1F048,
2707 .enable_mask = BIT(0),
2708 .hw.init = &(struct clk_init_data){
2709 .name = "gcc_lpass_snoc_cfg_clk",
2710 .parent_hws = (const struct clk_hw *[]){
2711 &lpass_snoc_cfg_clk_src.clkr.hw },
2712 .num_parents = 1,
2713 .flags = CLK_SET_RATE_PARENT,
2714 .ops = &clk_branch2_ops,
2715 },
2716 },
2717 };
2718
2719 static struct clk_branch gcc_lpass_q6_axim_clk = {
2720 .halt_reg = 0x1F010,
2721 .clkr = {
2722 .enable_reg = 0x1F010,
2723 .enable_mask = BIT(0),
2724 .hw.init = &(struct clk_init_data){
2725 .name = "gcc_lpass_q6_axim_clk",
2726 .parent_hws = (const struct clk_hw *[]){
2727 &lpass_q6_axim_clk_src.clkr.hw },
2728 .num_parents = 1,
2729 .flags = CLK_SET_RATE_PARENT,
2730 .ops = &clk_branch2_ops,
2731 },
2732 },
2733 };
2734
2735 static struct clk_branch gcc_lpass_q6_atbm_at_clk = {
2736 .halt_reg = 0x1F018,
2737 .clkr = {
2738 .enable_reg = 0x1F018,
2739 .enable_mask = BIT(0),
2740 .hw.init = &(struct clk_init_data){
2741 .name = "gcc_lpass_q6_atbm_at_clk",
2742 .parent_hws = (const struct clk_hw *[]){
2743 &qdss_at_clk_src.clkr.hw },
2744 .num_parents = 1,
2745 .flags = CLK_SET_RATE_PARENT,
2746 .ops = &clk_branch2_ops,
2747 },
2748 },
2749 };
2750
2751 static struct clk_branch gcc_lpass_q6_pclkdbg_clk = {
2752 .halt_reg = 0x1F01C,
2753 .clkr = {
2754 .enable_reg = 0x1F01C,
2755 .enable_mask = BIT(0),
2756 .hw.init = &(struct clk_init_data){
2757 .name = "gcc_lpass_q6_pclkdbg_clk",
2758 .parent_hws = (const struct clk_hw *[]){
2759 &qdss_dap_sync_clk_src.hw },
2760 .num_parents = 1,
2761 .flags = CLK_SET_RATE_PARENT,
2762 .ops = &clk_branch2_ops,
2763 },
2764 },
2765 };
2766
2767 static struct clk_branch gcc_lpass_q6ss_tsctr_1to2_clk = {
2768 .halt_reg = 0x1F014,
2769 .clkr = {
2770 .enable_reg = 0x1F014,
2771 .enable_mask = BIT(0),
2772 .hw.init = &(struct clk_init_data){
2773 .name = "gcc_lpass_q6ss_tsctr_1to2_clk",
2774 .parent_hws = (const struct clk_hw *[]){
2775 &qdss_tsctr_div2_clk_src.hw },
2776 .num_parents = 1,
2777 .flags = CLK_SET_RATE_PARENT,
2778 .ops = &clk_branch2_ops,
2779 },
2780 },
2781 };
2782
2783 static struct clk_branch gcc_lpass_q6ss_trig_clk = {
2784 .halt_reg = 0x1F038,
2785 .clkr = {
2786 .enable_reg = 0x1F038,
2787 .enable_mask = BIT(0),
2788 .hw.init = &(struct clk_init_data){
2789 .name = "gcc_lpass_q6ss_trig_clk",
2790 .parent_hws = (const struct clk_hw *[]){
2791 &qdss_dap_sync_clk_src.hw },
2792 .num_parents = 1,
2793 .flags = CLK_SET_RATE_PARENT,
2794 .ops = &clk_branch2_ops,
2795 },
2796 },
2797 };
2798
2799 static struct clk_branch gcc_lpass_tbu_clk = {
2800 .halt_reg = 0x12094,
2801 .clkr = {
2802 .enable_reg = 0xb00c,
2803 .enable_mask = BIT(10),
2804 .hw.init = &(struct clk_init_data){
2805 .name = "gcc_lpass_tbu_clk",
2806 .parent_hws = (const struct clk_hw *[]){
2807 &lpass_q6_axim_clk_src.clkr.hw },
2808 .num_parents = 1,
2809 .flags = CLK_SET_RATE_PARENT,
2810 .ops = &clk_branch2_ops,
2811 },
2812 },
2813 };
2814
2815 static struct clk_branch gcc_pcnoc_lpass_clk = {
2816 .halt_reg = 0x27020,
2817 .clkr = {
2818 .enable_reg = 0x27020,
2819 .enable_mask = BIT(0),
2820 .hw.init = &(struct clk_init_data){
2821 .name = "gcc_pcnoc_lpass_clk",
2822 .parent_hws = (const struct clk_hw *[]){
2823 &lpass_core_axim_clk_src.clkr.hw },
2824 .num_parents = 1,
2825 .flags = CLK_SET_RATE_PARENT,
2826 .ops = &clk_branch2_ops,
2827 },
2828 },
2829 };
2830
2831 static struct clk_branch gcc_mem_noc_lpass_clk = {
2832 .halt_reg = 0x1D044,
2833 .clkr = {
2834 .enable_reg = 0x1D044,
2835 .enable_mask = BIT(0),
2836 .hw.init = &(struct clk_init_data){
2837 .name = "gcc_mem_noc_lpass_clk",
2838 .parent_hws = (const struct clk_hw *[]){
2839 &lpass_q6_axim_clk_src.clkr.hw },
2840 .num_parents = 1,
2841 .flags = CLK_SET_RATE_PARENT,
2842 .ops = &clk_branch2_ops,
2843 },
2844 },
2845 };
2846
2847 static struct clk_branch gcc_snoc_lpass_cfg_clk = {
2848 .halt_reg = 0x26074,
2849 .clkr = {
2850 .enable_reg = 0x26074,
2851 .enable_mask = BIT(0),
2852 .hw.init = &(struct clk_init_data){
2853 .name = "gcc_snoc_lpass_cfg_clk",
2854 .parent_hws = (const struct clk_hw *[]){
2855 &lpass_snoc_cfg_clk_src.clkr.hw },
2856 .num_parents = 1,
2857 .flags = CLK_SET_RATE_PARENT,
2858 .ops = &clk_branch2_ops,
2859 },
2860 },
2861 };
2862
2863 static struct clk_branch gcc_mem_noc_ubi32_clk = {
2864 .halt_reg = 0x1D03C,
2865 .clkr = {
2866 .enable_reg = 0x1D03C,
2867 .enable_mask = BIT(0),
2868 .hw.init = &(struct clk_init_data){
2869 .name = "gcc_mem_noc_ubi32_clk",
2870 .parent_hws = (const struct clk_hw *[]){
2871 &ubi32_mem_noc_bfdcd_clk_src.clkr.hw },
2872 .num_parents = 1,
2873 .flags = CLK_SET_RATE_PARENT,
2874 .ops = &clk_branch2_ops,
2875 },
2876 },
2877 };
2878
2879 static struct clk_branch gcc_nss_port1_rx_clk = {
2880 .halt_reg = 0x68240,
2881 .clkr = {
2882 .enable_reg = 0x68240,
2883 .enable_mask = BIT(0),
2884 .hw.init = &(struct clk_init_data){
2885 .name = "gcc_nss_port1_rx_clk",
2886 .parent_hws = (const struct clk_hw *[]){
2887 &nss_port1_rx_div_clk_src.clkr.hw },
2888 .num_parents = 1,
2889 .flags = CLK_SET_RATE_PARENT,
2890 .ops = &clk_branch2_ops,
2891 },
2892 },
2893 };
2894
2895 static struct clk_branch gcc_nss_port1_tx_clk = {
2896 .halt_reg = 0x68244,
2897 .clkr = {
2898 .enable_reg = 0x68244,
2899 .enable_mask = BIT(0),
2900 .hw.init = &(struct clk_init_data){
2901 .name = "gcc_nss_port1_tx_clk",
2902 .parent_hws = (const struct clk_hw *[]){
2903 &nss_port1_tx_div_clk_src.clkr.hw },
2904 .num_parents = 1,
2905 .flags = CLK_SET_RATE_PARENT,
2906 .ops = &clk_branch2_ops,
2907 },
2908 },
2909 };
2910
2911 static struct clk_branch gcc_nss_port2_rx_clk = {
2912 .halt_reg = 0x68248,
2913 .clkr = {
2914 .enable_reg = 0x68248,
2915 .enable_mask = BIT(0),
2916 .hw.init = &(struct clk_init_data){
2917 .name = "gcc_nss_port2_rx_clk",
2918 .parent_hws = (const struct clk_hw *[]){
2919 &nss_port2_rx_div_clk_src.clkr.hw },
2920 .num_parents = 1,
2921 .flags = CLK_SET_RATE_PARENT,
2922 .ops = &clk_branch2_ops,
2923 },
2924 },
2925 };
2926
2927 static struct clk_branch gcc_nss_port2_tx_clk = {
2928 .halt_reg = 0x6824c,
2929 .clkr = {
2930 .enable_reg = 0x6824c,
2931 .enable_mask = BIT(0),
2932 .hw.init = &(struct clk_init_data){
2933 .name = "gcc_nss_port2_tx_clk",
2934 .parent_hws = (const struct clk_hw *[]){
2935 &nss_port2_tx_div_clk_src.clkr.hw },
2936 .num_parents = 1,
2937 .flags = CLK_SET_RATE_PARENT,
2938 .ops = &clk_branch2_ops,
2939 },
2940 },
2941 };
2942
2943 static struct clk_branch gcc_nss_port3_rx_clk = {
2944 .halt_reg = 0x68250,
2945 .clkr = {
2946 .enable_reg = 0x68250,
2947 .enable_mask = BIT(0),
2948 .hw.init = &(struct clk_init_data){
2949 .name = "gcc_nss_port3_rx_clk",
2950 .parent_hws = (const struct clk_hw *[]){
2951 &nss_port3_rx_div_clk_src.clkr.hw },
2952 .num_parents = 1,
2953 .flags = CLK_SET_RATE_PARENT,
2954 .ops = &clk_branch2_ops,
2955 },
2956 },
2957 };
2958
2959 static struct clk_branch gcc_nss_port3_tx_clk = {
2960 .halt_reg = 0x68254,
2961 .clkr = {
2962 .enable_reg = 0x68254,
2963 .enable_mask = BIT(0),
2964 .hw.init = &(struct clk_init_data){
2965 .name = "gcc_nss_port3_tx_clk",
2966 .parent_hws = (const struct clk_hw *[]){
2967 &nss_port3_tx_div_clk_src.clkr.hw },
2968 .num_parents = 1,
2969 .flags = CLK_SET_RATE_PARENT,
2970 .ops = &clk_branch2_ops,
2971 },
2972 },
2973 };
2974
2975 static struct clk_branch gcc_nss_port4_rx_clk = {
2976 .halt_reg = 0x68258,
2977 .clkr = {
2978 .enable_reg = 0x68258,
2979 .enable_mask = BIT(0),
2980 .hw.init = &(struct clk_init_data){
2981 .name = "gcc_nss_port4_rx_clk",
2982 .parent_hws = (const struct clk_hw *[]){
2983 &nss_port4_rx_div_clk_src.clkr.hw },
2984 .num_parents = 1,
2985 .flags = CLK_SET_RATE_PARENT,
2986 .ops = &clk_branch2_ops,
2987 },
2988 },
2989 };
2990
2991 static struct clk_branch gcc_nss_port4_tx_clk = {
2992 .halt_reg = 0x6825c,
2993 .clkr = {
2994 .enable_reg = 0x6825c,
2995 .enable_mask = BIT(0),
2996 .hw.init = &(struct clk_init_data){
2997 .name = "gcc_nss_port4_tx_clk",
2998 .parent_hws = (const struct clk_hw *[]){
2999 &nss_port4_tx_div_clk_src.clkr.hw },
3000 .num_parents = 1,
3001 .flags = CLK_SET_RATE_PARENT,
3002 .ops = &clk_branch2_ops,
3003 },
3004 },
3005 };
3006
3007 static struct clk_branch gcc_nss_port5_rx_clk = {
3008 .halt_reg = 0x68260,
3009 .clkr = {
3010 .enable_reg = 0x68260,
3011 .enable_mask = BIT(0),
3012 .hw.init = &(struct clk_init_data){
3013 .name = "gcc_nss_port5_rx_clk",
3014 .parent_hws = (const struct clk_hw *[]){
3015 &nss_port5_rx_div_clk_src.clkr.hw },
3016 .num_parents = 1,
3017 .flags = CLK_SET_RATE_PARENT,
3018 .ops = &clk_branch2_ops,
3019 },
3020 },
3021 };
3022
3023 static struct clk_branch gcc_nss_port5_tx_clk = {
3024 .halt_reg = 0x68264,
3025 .clkr = {
3026 .enable_reg = 0x68264,
3027 .enable_mask = BIT(0),
3028 .hw.init = &(struct clk_init_data){
3029 .name = "gcc_nss_port5_tx_clk",
3030 .parent_hws = (const struct clk_hw *[]){
3031 &nss_port5_tx_div_clk_src.clkr.hw },
3032 .num_parents = 1,
3033 .flags = CLK_SET_RATE_PARENT,
3034 .ops = &clk_branch2_ops,
3035 },
3036 },
3037 };
3038
3039 static struct clk_branch gcc_nss_ppe_cfg_clk = {
3040 .halt_reg = 0x68194,
3041 .clkr = {
3042 .enable_reg = 0x68194,
3043 .enable_mask = BIT(0),
3044 .hw.init = &(struct clk_init_data){
3045 .name = "gcc_nss_ppe_cfg_clk",
3046 .parent_hws = (const struct clk_hw *[]){
3047 &nss_ppe_clk_src.clkr.hw },
3048 .num_parents = 1,
3049 .flags = CLK_SET_RATE_PARENT,
3050 .ops = &clk_branch2_ops,
3051 },
3052 },
3053 };
3054
3055 static struct clk_branch gcc_nss_ppe_clk = {
3056 .halt_reg = 0x68190,
3057 .clkr = {
3058 .enable_reg = 0x68190,
3059 .enable_mask = BIT(0),
3060 .hw.init = &(struct clk_init_data){
3061 .name = "gcc_nss_ppe_clk",
3062 .parent_hws = (const struct clk_hw *[]){
3063 &nss_ppe_clk_src.clkr.hw },
3064 .num_parents = 1,
3065 .flags = CLK_SET_RATE_PARENT,
3066 .ops = &clk_branch2_ops,
3067 },
3068 },
3069 };
3070
3071 static struct clk_branch gcc_nss_ppe_ipe_clk = {
3072 .halt_reg = 0x68338,
3073 .clkr = {
3074 .enable_reg = 0x68338,
3075 .enable_mask = BIT(0),
3076 .hw.init = &(struct clk_init_data){
3077 .name = "gcc_nss_ppe_ipe_clk",
3078 .parent_hws = (const struct clk_hw *[]){
3079 &nss_ppe_clk_src.clkr.hw },
3080 .num_parents = 1,
3081 .flags = CLK_SET_RATE_PARENT,
3082 .ops = &clk_branch2_ops,
3083 },
3084 },
3085 };
3086
3087 static struct clk_branch gcc_nss_ptp_ref_clk = {
3088 .halt_reg = 0x6816C,
3089 .clkr = {
3090 .enable_reg = 0x6816C,
3091 .enable_mask = BIT(0),
3092 .hw.init = &(struct clk_init_data){
3093 .name = "gcc_nss_ptp_ref_clk",
3094 .parent_hws = (const struct clk_hw *[]){
3095 &nss_ppe_cdiv_clk_src.hw },
3096 .num_parents = 1,
3097 .flags = CLK_SET_RATE_PARENT,
3098 .ops = &clk_branch2_ops,
3099 },
3100 },
3101 };
3102
3103 static struct clk_branch gcc_nssnoc_ce_apb_clk = {
3104 .halt_reg = 0x6830C,
3105 .clkr = {
3106 .enable_reg = 0x6830C,
3107 .enable_mask = BIT(0),
3108 .hw.init = &(struct clk_init_data){
3109 .name = "gcc_nssnoc_ce_apb_clk",
3110 .parent_hws = (const struct clk_hw *[]){
3111 &nss_ce_clk_src.clkr.hw },
3112 .num_parents = 1,
3113 .flags = CLK_SET_RATE_PARENT,
3114 .ops = &clk_branch2_ops,
3115 },
3116 },
3117 };
3118
3119 static struct clk_branch gcc_nssnoc_ce_axi_clk = {
3120 .halt_reg = 0x68308,
3121 .clkr = {
3122 .enable_reg = 0x68308,
3123 .enable_mask = BIT(0),
3124 .hw.init = &(struct clk_init_data){
3125 .name = "gcc_nssnoc_ce_axi_clk",
3126 .parent_hws = (const struct clk_hw *[]){
3127 &nss_ce_clk_src.clkr.hw },
3128 .num_parents = 1,
3129 .flags = CLK_SET_RATE_PARENT,
3130 .ops = &clk_branch2_ops,
3131 },
3132 },
3133 };
3134
3135 static struct clk_branch gcc_nssnoc_crypto_clk = {
3136 .halt_reg = 0x68314,
3137 .clkr = {
3138 .enable_reg = 0x68314,
3139 .enable_mask = BIT(0),
3140 .hw.init = &(struct clk_init_data){
3141 .name = "gcc_nssnoc_crypto_clk",
3142 .parent_hws = (const struct clk_hw *[]){
3143 &nss_crypto_clk_src.clkr.hw },
3144 .num_parents = 1,
3145 .flags = CLK_SET_RATE_PARENT,
3146 .ops = &clk_branch2_ops,
3147 },
3148 },
3149 };
3150
3151 static struct clk_branch gcc_nssnoc_ppe_cfg_clk = {
3152 .halt_reg = 0x68304,
3153 .clkr = {
3154 .enable_reg = 0x68304,
3155 .enable_mask = BIT(0),
3156 .hw.init = &(struct clk_init_data){
3157 .name = "gcc_nssnoc_ppe_cfg_clk",
3158 .parent_hws = (const struct clk_hw *[]){
3159 &nss_ppe_clk_src.clkr.hw },
3160 .flags = CLK_SET_RATE_PARENT,
3161 .ops = &clk_branch2_ops,
3162 },
3163 },
3164 };
3165
3166 static struct clk_branch gcc_nssnoc_ppe_clk = {
3167 .halt_reg = 0x68300,
3168 .clkr = {
3169 .enable_reg = 0x68300,
3170 .enable_mask = BIT(0),
3171 .hw.init = &(struct clk_init_data){
3172 .name = "gcc_nssnoc_ppe_clk",
3173 .parent_hws = (const struct clk_hw *[]){
3174 &nss_ppe_clk_src.clkr.hw },
3175 .num_parents = 1,
3176 .flags = CLK_SET_RATE_PARENT,
3177 .ops = &clk_branch2_ops,
3178 },
3179 },
3180 };
3181
3182 static struct clk_branch gcc_nssnoc_qosgen_ref_clk = {
3183 .halt_reg = 0x68180,
3184 .clkr = {
3185 .enable_reg = 0x68180,
3186 .enable_mask = BIT(0),
3187 .hw.init = &(struct clk_init_data){
3188 .name = "gcc_nssnoc_qosgen_ref_clk",
3189 .parent_hws = (const struct clk_hw *[]){
3190 &gcc_xo_clk_src.clkr.hw },
3191 .num_parents = 1,
3192 .flags = CLK_SET_RATE_PARENT,
3193 .ops = &clk_branch2_ops,
3194 },
3195 },
3196 };
3197
3198 static struct clk_branch gcc_nssnoc_snoc_clk = {
3199 .halt_reg = 0x68188,
3200 .clkr = {
3201 .enable_reg = 0x68188,
3202 .enable_mask = BIT(0),
3203 .hw.init = &(struct clk_init_data){
3204 .name = "gcc_nssnoc_snoc_clk",
3205 .parent_hws = (const struct clk_hw *[]){
3206 &system_noc_bfdcd_clk_src.clkr.hw },
3207 .num_parents = 1,
3208 .flags = CLK_SET_RATE_PARENT,
3209 .ops = &clk_branch2_ops,
3210 },
3211 },
3212 };
3213
3214 static struct clk_branch gcc_nssnoc_timeout_ref_clk = {
3215 .halt_reg = 0x68184,
3216 .clkr = {
3217 .enable_reg = 0x68184,
3218 .enable_mask = BIT(0),
3219 .hw.init = &(struct clk_init_data){
3220 .name = "gcc_nssnoc_timeout_ref_clk",
3221 .parent_hws = (const struct clk_hw *[]){
3222 &gcc_xo_div4_clk_src.hw },
3223 .num_parents = 1,
3224 .flags = CLK_SET_RATE_PARENT,
3225 .ops = &clk_branch2_ops,
3226 },
3227 },
3228 };
3229
3230 static struct clk_branch gcc_nssnoc_ubi0_ahb_clk = {
3231 .halt_reg = 0x68270,
3232 .clkr = {
3233 .enable_reg = 0x68270,
3234 .enable_mask = BIT(0),
3235 .hw.init = &(struct clk_init_data){
3236 .name = "gcc_nssnoc_ubi0_ahb_clk",
3237 .parent_hws = (const struct clk_hw *[]){
3238 &nss_ce_clk_src.clkr.hw },
3239 .num_parents = 1,
3240 .flags = CLK_SET_RATE_PARENT,
3241 .ops = &clk_branch2_ops,
3242 },
3243 },
3244 };
3245
3246 static struct clk_branch gcc_port1_mac_clk = {
3247 .halt_reg = 0x68320,
3248 .clkr = {
3249 .enable_reg = 0x68320,
3250 .enable_mask = BIT(0),
3251 .hw.init = &(struct clk_init_data){
3252 .name = "gcc_port1_mac_clk",
3253 .parent_hws = (const struct clk_hw *[]){
3254 &nss_ppe_clk_src.clkr.hw },
3255 .num_parents = 1,
3256 .flags = CLK_SET_RATE_PARENT,
3257 .ops = &clk_branch2_ops,
3258 },
3259 },
3260 };
3261
3262 static struct clk_branch gcc_port2_mac_clk = {
3263 .halt_reg = 0x68324,
3264 .clkr = {
3265 .enable_reg = 0x68324,
3266 .enable_mask = BIT(0),
3267 .hw.init = &(struct clk_init_data){
3268 .name = "gcc_port2_mac_clk",
3269 .parent_hws = (const struct clk_hw *[]){
3270 &nss_ppe_clk_src.clkr.hw },
3271 .num_parents = 1,
3272 .flags = CLK_SET_RATE_PARENT,
3273 .ops = &clk_branch2_ops,
3274 },
3275 },
3276 };
3277
3278 static struct clk_branch gcc_port3_mac_clk = {
3279 .halt_reg = 0x68328,
3280 .clkr = {
3281 .enable_reg = 0x68328,
3282 .enable_mask = BIT(0),
3283 .hw.init = &(struct clk_init_data){
3284 .name = "gcc_port3_mac_clk",
3285 .parent_hws = (const struct clk_hw *[]){
3286 &nss_ppe_clk_src.clkr.hw },
3287 .num_parents = 1,
3288 .flags = CLK_SET_RATE_PARENT,
3289 .ops = &clk_branch2_ops,
3290 },
3291 },
3292 };
3293
3294 static struct clk_branch gcc_port4_mac_clk = {
3295 .halt_reg = 0x6832c,
3296 .clkr = {
3297 .enable_reg = 0x6832c,
3298 .enable_mask = BIT(0),
3299 .hw.init = &(struct clk_init_data){
3300 .name = "gcc_port4_mac_clk",
3301 .parent_hws = (const struct clk_hw *[]){
3302 &nss_ppe_clk_src.clkr.hw },
3303 .num_parents = 1,
3304 .flags = CLK_SET_RATE_PARENT,
3305 .ops = &clk_branch2_ops,
3306 },
3307 },
3308 };
3309
3310 static struct clk_branch gcc_port5_mac_clk = {
3311 .halt_reg = 0x68330,
3312 .clkr = {
3313 .enable_reg = 0x68330,
3314 .enable_mask = BIT(0),
3315 .hw.init = &(struct clk_init_data){
3316 .name = "gcc_port5_mac_clk",
3317 .parent_hws = (const struct clk_hw *[]){
3318 &nss_ppe_clk_src.clkr.hw },
3319 .num_parents = 1,
3320 .flags = CLK_SET_RATE_PARENT,
3321 .ops = &clk_branch2_ops,
3322 },
3323 },
3324 };
3325
3326 static struct clk_branch gcc_ubi0_ahb_clk = {
3327 .halt_reg = 0x6820C,
3328 .halt_check = BRANCH_HALT_DELAY,
3329 .clkr = {
3330 .enable_reg = 0x6820C,
3331 .enable_mask = BIT(0),
3332 .hw.init = &(struct clk_init_data){
3333 .name = "gcc_ubi0_ahb_clk",
3334 .parent_hws = (const struct clk_hw *[]){
3335 &nss_ce_clk_src.clkr.hw },
3336 .num_parents = 1,
3337 .flags = CLK_SET_RATE_PARENT,
3338 .ops = &clk_branch2_ops,
3339 },
3340 },
3341 };
3342
3343 static struct clk_branch gcc_ubi0_axi_clk = {
3344 .halt_reg = 0x68200,
3345 .halt_check = BRANCH_HALT_DELAY,
3346 .clkr = {
3347 .enable_reg = 0x68200,
3348 .enable_mask = BIT(0),
3349 .hw.init = &(struct clk_init_data){
3350 .name = "gcc_ubi0_axi_clk",
3351 .parent_hws = (const struct clk_hw *[]){
3352 &ubi32_mem_noc_bfdcd_clk_src.clkr.hw },
3353 .num_parents = 1,
3354 .flags = CLK_SET_RATE_PARENT,
3355 .ops = &clk_branch2_ops,
3356 },
3357 },
3358 };
3359
3360 static struct clk_branch gcc_ubi0_nc_axi_clk = {
3361 .halt_reg = 0x68204,
3362 .halt_check = BRANCH_HALT_DELAY,
3363 .clkr = {
3364 .enable_reg = 0x68204,
3365 .enable_mask = BIT(0),
3366 .hw.init = &(struct clk_init_data){
3367 .name = "gcc_ubi0_nc_axi_clk",
3368 .parent_hws = (const struct clk_hw *[]){
3369 &snoc_nssnoc_bfdcd_clk_src.clkr.hw },
3370 .num_parents = 1,
3371 .flags = CLK_SET_RATE_PARENT,
3372 .ops = &clk_branch2_ops,
3373 },
3374 },
3375 };
3376
3377 static struct clk_branch gcc_ubi0_core_clk = {
3378 .halt_reg = 0x68210,
3379 .halt_check = BRANCH_HALT_DELAY,
3380 .clkr = {
3381 .enable_reg = 0x68210,
3382 .enable_mask = BIT(0),
3383 .hw.init = &(struct clk_init_data){
3384 .name = "gcc_ubi0_core_clk",
3385 .parent_hws = (const struct clk_hw *[]){
3386 &nss_ubi0_div_clk_src.clkr.hw },
3387 .num_parents = 1,
3388 .flags = CLK_SET_RATE_PARENT,
3389 .ops = &clk_branch2_ops,
3390 },
3391 },
3392 };
3393
3394 static struct clk_branch gcc_pcie0_ahb_clk = {
3395 .halt_reg = 0x75010,
3396 .clkr = {
3397 .enable_reg = 0x75010,
3398 .enable_mask = BIT(0),
3399 .hw.init = &(struct clk_init_data){
3400 .name = "gcc_pcie0_ahb_clk",
3401 .parent_hws = (const struct clk_hw *[]){
3402 &pcnoc_bfdcd_clk_src.clkr.hw },
3403 .num_parents = 1,
3404 .flags = CLK_SET_RATE_PARENT,
3405 .ops = &clk_branch2_ops,
3406 },
3407 },
3408 };
3409
3410 static struct clk_branch gcc_pcie0_aux_clk = {
3411 .halt_reg = 0x75014,
3412 .clkr = {
3413 .enable_reg = 0x75014,
3414 .enable_mask = BIT(0),
3415 .hw.init = &(struct clk_init_data){
3416 .name = "gcc_pcie0_aux_clk",
3417 .parent_hws = (const struct clk_hw *[]){
3418 &pcie0_aux_clk_src.clkr.hw },
3419 .num_parents = 1,
3420 .flags = CLK_SET_RATE_PARENT,
3421 .ops = &clk_branch2_ops,
3422 },
3423 },
3424 };
3425
3426 static struct clk_branch gcc_pcie0_axi_m_clk = {
3427 .halt_reg = 0x75008,
3428 .clkr = {
3429 .enable_reg = 0x75008,
3430 .enable_mask = BIT(0),
3431 .hw.init = &(struct clk_init_data){
3432 .name = "gcc_pcie0_axi_m_clk",
3433 .parent_hws = (const struct clk_hw *[]){
3434 &pcie0_axi_clk_src.clkr.hw },
3435 .num_parents = 1,
3436 .flags = CLK_SET_RATE_PARENT,
3437 .ops = &clk_branch2_ops,
3438 },
3439 },
3440 };
3441
3442 static struct clk_branch gcc_pcie0_axi_s_clk = {
3443 .halt_reg = 0x7500c,
3444 .clkr = {
3445 .enable_reg = 0x7500c,
3446 .enable_mask = BIT(0),
3447 .hw.init = &(struct clk_init_data){
3448 .name = "gcc_pcie0_axi_s_clk",
3449 .parent_hws = (const struct clk_hw *[]){
3450 &pcie0_axi_clk_src.clkr.hw },
3451 .num_parents = 1,
3452 .flags = CLK_SET_RATE_PARENT,
3453 .ops = &clk_branch2_ops,
3454 },
3455 },
3456 };
3457
3458 static struct clk_branch gcc_sys_noc_pcie0_axi_clk = {
3459 .halt_reg = 0x26048,
3460 .clkr = {
3461 .enable_reg = 0x26048,
3462 .enable_mask = BIT(0),
3463 .hw.init = &(struct clk_init_data){
3464 .name = "gcc_sys_noc_pcie0_axi_clk",
3465 .parent_hws = (const struct clk_hw *[]){
3466 &pcie0_axi_clk_src.clkr.hw },
3467 .num_parents = 1,
3468 .flags = CLK_SET_RATE_PARENT,
3469 .ops = &clk_branch2_ops,
3470 },
3471 },
3472 };
3473
3474 static struct clk_branch gcc_pcie0_pipe_clk = {
3475 .halt_reg = 0x75018,
3476 .halt_check = BRANCH_HALT_DELAY,
3477 .clkr = {
3478 .enable_reg = 0x75018,
3479 .enable_mask = BIT(0),
3480 .hw.init = &(struct clk_init_data){
3481 .name = "gcc_pcie0_pipe_clk",
3482 .parent_hws = (const struct clk_hw *[]){
3483 &pcie0_pipe_clk_src.clkr.hw },
3484 .num_parents = 1,
3485 .flags = CLK_SET_RATE_PARENT,
3486 .ops = &clk_branch2_ops,
3487 },
3488 },
3489 };
3490
3491 static struct clk_branch gcc_prng_ahb_clk = {
3492 .halt_reg = 0x13004,
3493 .halt_check = BRANCH_HALT_VOTED,
3494 .clkr = {
3495 .enable_reg = 0x0b004,
3496 .enable_mask = BIT(8),
3497 .hw.init = &(struct clk_init_data){
3498 .name = "gcc_prng_ahb_clk",
3499 .parent_hws = (const struct clk_hw *[]){
3500 &pcnoc_bfdcd_clk_src.clkr.hw },
3501 .num_parents = 1,
3502 .flags = CLK_SET_RATE_PARENT,
3503 .ops = &clk_branch2_ops,
3504 },
3505 },
3506 };
3507
3508 static struct clk_branch gcc_qdss_dap_clk = {
3509 .halt_reg = 0x29084,
3510 .clkr = {
3511 .enable_reg = 0x29084,
3512 .enable_mask = BIT(0),
3513 .hw.init = &(struct clk_init_data){
3514 .name = "gcc_qdss_dap_clk",
3515 .parent_hws = (const struct clk_hw *[]){
3516 &qdss_dap_sync_clk_src.hw },
3517 .num_parents = 1,
3518 .flags = CLK_SET_RATE_PARENT,
3519 .ops = &clk_branch2_ops,
3520 },
3521 },
3522 };
3523
3524 static struct clk_branch gcc_qpic_ahb_clk = {
3525 .halt_reg = 0x57024,
3526 .clkr = {
3527 .enable_reg = 0x57024,
3528 .enable_mask = BIT(0),
3529 .hw.init = &(struct clk_init_data){
3530 .name = "gcc_qpic_ahb_clk",
3531 .parent_hws = (const struct clk_hw *[]){
3532 &pcnoc_bfdcd_clk_src.clkr.hw },
3533 .num_parents = 1,
3534 .flags = CLK_SET_RATE_PARENT,
3535 .ops = &clk_branch2_ops,
3536 },
3537 },
3538 };
3539
3540 static struct clk_branch gcc_qpic_clk = {
3541 .halt_reg = 0x57020,
3542 .clkr = {
3543 .enable_reg = 0x57020,
3544 .enable_mask = BIT(0),
3545 .hw.init = &(struct clk_init_data){
3546 .name = "gcc_qpic_clk",
3547 .parent_hws = (const struct clk_hw *[]){
3548 &pcnoc_bfdcd_clk_src.clkr.hw },
3549 .num_parents = 1,
3550 .flags = CLK_SET_RATE_PARENT,
3551 .ops = &clk_branch2_ops,
3552 },
3553 },
3554 };
3555
3556 static struct clk_branch gcc_sdcc1_ahb_clk = {
3557 .halt_reg = 0x4201c,
3558 .clkr = {
3559 .enable_reg = 0x4201c,
3560 .enable_mask = BIT(0),
3561 .hw.init = &(struct clk_init_data){
3562 .name = "gcc_sdcc1_ahb_clk",
3563 .parent_hws = (const struct clk_hw *[]){
3564 &pcnoc_bfdcd_clk_src.clkr.hw },
3565 .num_parents = 1,
3566 .flags = CLK_SET_RATE_PARENT,
3567 .ops = &clk_branch2_ops,
3568 },
3569 },
3570 };
3571
3572 static struct clk_branch gcc_sdcc1_apps_clk = {
3573 .halt_reg = 0x42018,
3574 .clkr = {
3575 .enable_reg = 0x42018,
3576 .enable_mask = BIT(0),
3577 .hw.init = &(struct clk_init_data){
3578 .name = "gcc_sdcc1_apps_clk",
3579 .parent_hws = (const struct clk_hw *[]){
3580 &sdcc1_apps_clk_src.clkr.hw },
3581 .num_parents = 1,
3582 .flags = CLK_SET_RATE_PARENT,
3583 .ops = &clk_branch2_ops,
3584 },
3585 },
3586 };
3587
3588 static struct clk_branch gcc_uniphy0_ahb_clk = {
3589 .halt_reg = 0x56008,
3590 .clkr = {
3591 .enable_reg = 0x56008,
3592 .enable_mask = BIT(0),
3593 .hw.init = &(struct clk_init_data){
3594 .name = "gcc_uniphy0_ahb_clk",
3595 .parent_hws = (const struct clk_hw *[]){
3596 &pcnoc_bfdcd_clk_src.clkr.hw },
3597 .num_parents = 1,
3598 .flags = CLK_SET_RATE_PARENT,
3599 .ops = &clk_branch2_ops,
3600 },
3601 },
3602 };
3603
3604 static struct clk_branch gcc_uniphy0_port1_rx_clk = {
3605 .halt_reg = 0x56010,
3606 .clkr = {
3607 .enable_reg = 0x56010,
3608 .enable_mask = BIT(0),
3609 .hw.init = &(struct clk_init_data){
3610 .name = "gcc_uniphy0_port1_rx_clk",
3611 .parent_hws = (const struct clk_hw *[]){
3612 &nss_port1_rx_div_clk_src.clkr.hw },
3613 .num_parents = 1,
3614 .flags = CLK_SET_RATE_PARENT,
3615 .ops = &clk_branch2_ops,
3616 },
3617 },
3618 };
3619
3620 static struct clk_branch gcc_uniphy0_port1_tx_clk = {
3621 .halt_reg = 0x56014,
3622 .clkr = {
3623 .enable_reg = 0x56014,
3624 .enable_mask = BIT(0),
3625 .hw.init = &(struct clk_init_data){
3626 .name = "gcc_uniphy0_port1_tx_clk",
3627 .parent_hws = (const struct clk_hw *[]){
3628 &nss_port1_tx_div_clk_src.clkr.hw },
3629 .num_parents = 1,
3630 .flags = CLK_SET_RATE_PARENT,
3631 .ops = &clk_branch2_ops,
3632 },
3633 },
3634 };
3635
3636 static struct clk_branch gcc_uniphy0_port2_rx_clk = {
3637 .halt_reg = 0x56018,
3638 .clkr = {
3639 .enable_reg = 0x56018,
3640 .enable_mask = BIT(0),
3641 .hw.init = &(struct clk_init_data){
3642 .name = "gcc_uniphy0_port2_rx_clk",
3643 .parent_hws = (const struct clk_hw *[]){
3644 &nss_port2_rx_div_clk_src.clkr.hw },
3645 .num_parents = 1,
3646 .flags = CLK_SET_RATE_PARENT,
3647 .ops = &clk_branch2_ops,
3648 },
3649 },
3650 };
3651
3652 static struct clk_branch gcc_uniphy0_port2_tx_clk = {
3653 .halt_reg = 0x5601c,
3654 .clkr = {
3655 .enable_reg = 0x5601c,
3656 .enable_mask = BIT(0),
3657 .hw.init = &(struct clk_init_data){
3658 .name = "gcc_uniphy0_port2_tx_clk",
3659 .parent_hws = (const struct clk_hw *[]){
3660 &nss_port2_tx_div_clk_src.clkr.hw },
3661 .num_parents = 1,
3662 .flags = CLK_SET_RATE_PARENT,
3663 .ops = &clk_branch2_ops,
3664 },
3665 },
3666 };
3667
3668 static struct clk_branch gcc_uniphy0_port3_rx_clk = {
3669 .halt_reg = 0x56020,
3670 .clkr = {
3671 .enable_reg = 0x56020,
3672 .enable_mask = BIT(0),
3673 .hw.init = &(struct clk_init_data){
3674 .name = "gcc_uniphy0_port3_rx_clk",
3675 .parent_hws = (const struct clk_hw *[]){
3676 &nss_port3_rx_div_clk_src.clkr.hw },
3677 .num_parents = 1,
3678 .flags = CLK_SET_RATE_PARENT,
3679 .ops = &clk_branch2_ops,
3680 },
3681 },
3682 };
3683
3684 static struct clk_branch gcc_uniphy0_port3_tx_clk = {
3685 .halt_reg = 0x56024,
3686 .clkr = {
3687 .enable_reg = 0x56024,
3688 .enable_mask = BIT(0),
3689 .hw.init = &(struct clk_init_data){
3690 .name = "gcc_uniphy0_port3_tx_clk",
3691 .parent_hws = (const struct clk_hw *[]){
3692 &nss_port3_tx_div_clk_src.clkr.hw },
3693 .num_parents = 1,
3694 .flags = CLK_SET_RATE_PARENT,
3695 .ops = &clk_branch2_ops,
3696 },
3697 },
3698 };
3699
3700 static struct clk_branch gcc_uniphy0_port4_rx_clk = {
3701 .halt_reg = 0x56028,
3702 .clkr = {
3703 .enable_reg = 0x56028,
3704 .enable_mask = BIT(0),
3705 .hw.init = &(struct clk_init_data){
3706 .name = "gcc_uniphy0_port4_rx_clk",
3707 .parent_hws = (const struct clk_hw *[]){
3708 &nss_port4_rx_div_clk_src.clkr.hw },
3709 .num_parents = 1,
3710 .flags = CLK_SET_RATE_PARENT,
3711 .ops = &clk_branch2_ops,
3712 },
3713 },
3714 };
3715
3716 static struct clk_branch gcc_uniphy0_port4_tx_clk = {
3717 .halt_reg = 0x5602c,
3718 .clkr = {
3719 .enable_reg = 0x5602c,
3720 .enable_mask = BIT(0),
3721 .hw.init = &(struct clk_init_data){
3722 .name = "gcc_uniphy0_port4_tx_clk",
3723 .parent_hws = (const struct clk_hw *[]){
3724 &nss_port4_tx_div_clk_src.clkr.hw },
3725 .num_parents = 1,
3726 .flags = CLK_SET_RATE_PARENT,
3727 .ops = &clk_branch2_ops,
3728 },
3729 },
3730 };
3731
3732 static struct clk_branch gcc_uniphy0_port5_rx_clk = {
3733 .halt_reg = 0x56030,
3734 .clkr = {
3735 .enable_reg = 0x56030,
3736 .enable_mask = BIT(0),
3737 .hw.init = &(struct clk_init_data){
3738 .name = "gcc_uniphy0_port5_rx_clk",
3739 .parent_hws = (const struct clk_hw *[]){
3740 &nss_port5_rx_div_clk_src.clkr.hw },
3741 .num_parents = 1,
3742 .flags = CLK_SET_RATE_PARENT,
3743 .ops = &clk_branch2_ops,
3744 },
3745 },
3746 };
3747
3748 static struct clk_branch gcc_uniphy0_port5_tx_clk = {
3749 .halt_reg = 0x56034,
3750 .clkr = {
3751 .enable_reg = 0x56034,
3752 .enable_mask = BIT(0),
3753 .hw.init = &(struct clk_init_data){
3754 .name = "gcc_uniphy0_port5_tx_clk",
3755 .parent_hws = (const struct clk_hw *[]){
3756 &nss_port5_tx_div_clk_src.clkr.hw },
3757 .num_parents = 1,
3758 .flags = CLK_SET_RATE_PARENT,
3759 .ops = &clk_branch2_ops,
3760 },
3761 },
3762 };
3763
3764 static struct clk_branch gcc_uniphy0_sys_clk = {
3765 .halt_reg = 0x5600C,
3766 .clkr = {
3767 .enable_reg = 0x5600C,
3768 .enable_mask = BIT(0),
3769 .hw.init = &(struct clk_init_data){
3770 .name = "gcc_uniphy0_sys_clk",
3771 .parent_hws = (const struct clk_hw *[]){
3772 &gcc_xo_clk_src.clkr.hw },
3773 .num_parents = 1,
3774 .flags = CLK_SET_RATE_PARENT,
3775 .ops = &clk_branch2_ops,
3776 },
3777 },
3778 };
3779
3780 static struct clk_branch gcc_uniphy1_ahb_clk = {
3781 .halt_reg = 0x56108,
3782 .clkr = {
3783 .enable_reg = 0x56108,
3784 .enable_mask = BIT(0),
3785 .hw.init = &(struct clk_init_data){
3786 .name = "gcc_uniphy1_ahb_clk",
3787 .parent_hws = (const struct clk_hw *[]){
3788 &pcnoc_bfdcd_clk_src.clkr.hw },
3789 .num_parents = 1,
3790 .flags = CLK_SET_RATE_PARENT,
3791 .ops = &clk_branch2_ops,
3792 },
3793 },
3794 };
3795
3796 static struct clk_branch gcc_uniphy1_port5_rx_clk = {
3797 .halt_reg = 0x56110,
3798 .clkr = {
3799 .enable_reg = 0x56110,
3800 .enable_mask = BIT(0),
3801 .hw.init = &(struct clk_init_data){
3802 .name = "gcc_uniphy1_port5_rx_clk",
3803 .parent_hws = (const struct clk_hw *[]){
3804 &nss_port5_rx_div_clk_src.clkr.hw },
3805 .num_parents = 1,
3806 .flags = CLK_SET_RATE_PARENT,
3807 .ops = &clk_branch2_ops,
3808 },
3809 },
3810 };
3811
3812 static struct clk_branch gcc_uniphy1_port5_tx_clk = {
3813 .halt_reg = 0x56114,
3814 .clkr = {
3815 .enable_reg = 0x56114,
3816 .enable_mask = BIT(0),
3817 .hw.init = &(struct clk_init_data){
3818 .name = "gcc_uniphy1_port5_tx_clk",
3819 .parent_hws = (const struct clk_hw *[]){
3820 &nss_port5_tx_div_clk_src.clkr.hw },
3821 .num_parents = 1,
3822 .flags = CLK_SET_RATE_PARENT,
3823 .ops = &clk_branch2_ops,
3824 },
3825 },
3826 };
3827
3828 static struct clk_branch gcc_uniphy1_sys_clk = {
3829 .halt_reg = 0x5610C,
3830 .clkr = {
3831 .enable_reg = 0x5610C,
3832 .enable_mask = BIT(0),
3833 .hw.init = &(struct clk_init_data){
3834 .name = "gcc_uniphy1_sys_clk",
3835 .parent_hws = (const struct clk_hw *[]){
3836 &gcc_xo_clk_src.clkr.hw },
3837 .num_parents = 1,
3838 .flags = CLK_SET_RATE_PARENT,
3839 .ops = &clk_branch2_ops,
3840 },
3841 },
3842 };
3843
3844 static struct clk_branch gcc_usb0_aux_clk = {
3845 .halt_reg = 0x3e044,
3846 .clkr = {
3847 .enable_reg = 0x3e044,
3848 .enable_mask = BIT(0),
3849 .hw.init = &(struct clk_init_data){
3850 .name = "gcc_usb0_aux_clk",
3851 .parent_hws = (const struct clk_hw *[]){
3852 &usb0_aux_clk_src.clkr.hw },
3853 .num_parents = 1,
3854 .flags = CLK_SET_RATE_PARENT,
3855 .ops = &clk_branch2_ops,
3856 },
3857 },
3858 };
3859
3860 static struct clk_branch gcc_usb0_master_clk = {
3861 .halt_reg = 0x3e000,
3862 .clkr = {
3863 .enable_reg = 0x3e000,
3864 .enable_mask = BIT(0),
3865 .hw.init = &(struct clk_init_data){
3866 .name = "gcc_usb0_master_clk",
3867 .parent_hws = (const struct clk_hw *[]){
3868 &usb0_master_clk_src.clkr.hw },
3869 .num_parents = 1,
3870 .flags = CLK_SET_RATE_PARENT,
3871 .ops = &clk_branch2_ops,
3872 },
3873 },
3874 };
3875
3876 static struct clk_branch gcc_snoc_bus_timeout2_ahb_clk = {
3877 .halt_reg = 0x47014,
3878 .clkr = {
3879 .enable_reg = 0x47014,
3880 .enable_mask = BIT(0),
3881 .hw.init = &(struct clk_init_data){
3882 .name = "gcc_snoc_bus_timeout2_ahb_clk",
3883 .parent_hws = (const struct clk_hw *[]){
3884 &usb0_master_clk_src.clkr.hw },
3885 .num_parents = 1,
3886 .flags = CLK_SET_RATE_PARENT,
3887 .ops = &clk_branch2_ops,
3888 },
3889 },
3890 };
3891
3892 static struct clk_rcg2 pcie0_rchng_clk_src = {
3893 .cmd_rcgr = 0x75070,
3894 .freq_tbl = ftbl_pcie_rchng_clk_src,
3895 .hid_width = 5,
3896 .parent_map = gcc_xo_gpll0_map,
3897 .clkr.hw.init = &(struct clk_init_data){
3898 .name = "pcie0_rchng_clk_src",
3899 .parent_data = gcc_xo_gpll0,
3900 .num_parents = 2,
3901 .ops = &clk_rcg2_ops,
3902 },
3903 };
3904
3905 static struct clk_branch gcc_pcie0_rchng_clk = {
3906 .halt_reg = 0x75070,
3907 .clkr = {
3908 .enable_reg = 0x75070,
3909 .enable_mask = BIT(1),
3910 .hw.init = &(struct clk_init_data){
3911 .name = "gcc_pcie0_rchng_clk",
3912 .parent_hws = (const struct clk_hw *[]){
3913 &pcie0_rchng_clk_src.clkr.hw },
3914 .num_parents = 1,
3915 .flags = CLK_SET_RATE_PARENT,
3916 .ops = &clk_branch2_ops,
3917 },
3918 },
3919 };
3920
3921 static struct clk_branch gcc_pcie0_axi_s_bridge_clk = {
3922 .halt_reg = 0x75048,
3923 .clkr = {
3924 .enable_reg = 0x75048,
3925 .enable_mask = BIT(0),
3926 .hw.init = &(struct clk_init_data){
3927 .name = "gcc_pcie0_axi_s_bridge_clk",
3928 .parent_hws = (const struct clk_hw *[]){
3929 &pcie0_axi_clk_src.clkr.hw },
3930 .num_parents = 1,
3931 .flags = CLK_SET_RATE_PARENT,
3932 .ops = &clk_branch2_ops,
3933 },
3934 },
3935 };
3936
3937 static struct clk_branch gcc_sys_noc_usb0_axi_clk = {
3938 .halt_reg = 0x26040,
3939 .clkr = {
3940 .enable_reg = 0x26040,
3941 .enable_mask = BIT(0),
3942 .hw.init = &(struct clk_init_data){
3943 .name = "gcc_sys_noc_usb0_axi_clk",
3944 .parent_hws = (const struct clk_hw *[]){
3945 &usb0_master_clk_src.clkr.hw },
3946 .num_parents = 1,
3947 .flags = CLK_SET_RATE_PARENT,
3948 .ops = &clk_branch2_ops,
3949 },
3950 },
3951 };
3952
3953 static struct clk_branch gcc_usb0_mock_utmi_clk = {
3954 .halt_reg = 0x3e008,
3955 .clkr = {
3956 .enable_reg = 0x3e008,
3957 .enable_mask = BIT(0),
3958 .hw.init = &(struct clk_init_data){
3959 .name = "gcc_usb0_mock_utmi_clk",
3960 .parent_hws = (const struct clk_hw *[]){
3961 &usb0_mock_utmi_clk_src.clkr.hw },
3962 .num_parents = 1,
3963 .flags = CLK_SET_RATE_PARENT,
3964 .ops = &clk_branch2_ops,
3965 },
3966 },
3967 };
3968
3969 static struct clk_branch gcc_usb0_phy_cfg_ahb_clk = {
3970 .halt_reg = 0x3e080,
3971 .clkr = {
3972 .enable_reg = 0x3e080,
3973 .enable_mask = BIT(0),
3974 .hw.init = &(struct clk_init_data){
3975 .name = "gcc_usb0_phy_cfg_ahb_clk",
3976 .parent_hws = (const struct clk_hw *[]){
3977 &pcnoc_bfdcd_clk_src.clkr.hw },
3978 .num_parents = 1,
3979 .flags = CLK_SET_RATE_PARENT,
3980 .ops = &clk_branch2_ops,
3981 },
3982 },
3983 };
3984
3985 static struct clk_branch gcc_usb0_pipe_clk = {
3986 .halt_reg = 0x3e040,
3987 .halt_check = BRANCH_HALT_DELAY,
3988 .clkr = {
3989 .enable_reg = 0x3e040,
3990 .enable_mask = BIT(0),
3991 .hw.init = &(struct clk_init_data){
3992 .name = "gcc_usb0_pipe_clk",
3993 .parent_hws = (const struct clk_hw *[]){
3994 &usb0_pipe_clk_src.clkr.hw },
3995 .num_parents = 1,
3996 .flags = CLK_SET_RATE_PARENT,
3997 .ops = &clk_branch2_ops,
3998 },
3999 },
4000 };
4001
4002 static struct clk_branch gcc_usb0_sleep_clk = {
4003 .halt_reg = 0x3e004,
4004 .clkr = {
4005 .enable_reg = 0x3e004,
4006 .enable_mask = BIT(0),
4007 .hw.init = &(struct clk_init_data){
4008 .name = "gcc_usb0_sleep_clk",
4009 .parent_hws = (const struct clk_hw *[]){
4010 &gcc_sleep_clk_src.clkr.hw },
4011 .num_parents = 1,
4012 .flags = CLK_SET_RATE_PARENT,
4013 .ops = &clk_branch2_ops,
4014 },
4015 },
4016 };
4017
4018 static struct clk_branch gcc_usb1_master_clk = {
4019 .halt_reg = 0x3f000,
4020 .clkr = {
4021 .enable_reg = 0x3f000,
4022 .enable_mask = BIT(0),
4023 .hw.init = &(struct clk_init_data){
4024 .name = "gcc_usb1_master_clk",
4025 .parent_hws = (const struct clk_hw *[]){
4026 &pcnoc_bfdcd_clk_src.clkr.hw },
4027 .num_parents = 1,
4028 .flags = CLK_SET_RATE_PARENT,
4029 .ops = &clk_branch2_ops,
4030 },
4031 },
4032 };
4033
4034 static struct clk_branch gcc_usb1_mock_utmi_clk = {
4035 .halt_reg = 0x3f008,
4036 .clkr = {
4037 .enable_reg = 0x3f008,
4038 .enable_mask = BIT(0),
4039 .hw.init = &(struct clk_init_data){
4040 .name = "gcc_usb1_mock_utmi_clk",
4041 .parent_hws = (const struct clk_hw *[]){
4042 &usb1_mock_utmi_clk_src.clkr.hw },
4043 .num_parents = 1,
4044 .flags = CLK_SET_RATE_PARENT,
4045 .ops = &clk_branch2_ops,
4046 },
4047 },
4048 };
4049
4050 static struct clk_branch gcc_usb1_phy_cfg_ahb_clk = {
4051 .halt_reg = 0x3f080,
4052 .clkr = {
4053 .enable_reg = 0x3f080,
4054 .enable_mask = BIT(0),
4055 .hw.init = &(struct clk_init_data){
4056 .name = "gcc_usb1_phy_cfg_ahb_clk",
4057 .parent_hws = (const struct clk_hw *[]){
4058 &pcnoc_bfdcd_clk_src.clkr.hw },
4059 .num_parents = 1,
4060 .flags = CLK_SET_RATE_PARENT,
4061 .ops = &clk_branch2_ops,
4062 },
4063 },
4064 };
4065
4066 static struct clk_branch gcc_usb1_sleep_clk = {
4067 .halt_reg = 0x3f004,
4068 .clkr = {
4069 .enable_reg = 0x3f004,
4070 .enable_mask = BIT(0),
4071 .hw.init = &(struct clk_init_data){
4072 .name = "gcc_usb1_sleep_clk",
4073 .parent_hws = (const struct clk_hw *[]){
4074 &gcc_sleep_clk_src.clkr.hw },
4075 .num_parents = 1,
4076 .flags = CLK_SET_RATE_PARENT,
4077 .ops = &clk_branch2_ops,
4078 },
4079 },
4080 };
4081
4082 static struct clk_branch gcc_cmn_12gpll_ahb_clk = {
4083 .halt_reg = 0x56308,
4084 .clkr = {
4085 .enable_reg = 0x56308,
4086 .enable_mask = BIT(0),
4087 .hw.init = &(struct clk_init_data){
4088 .name = "gcc_cmn_12gpll_ahb_clk",
4089 .parent_hws = (const struct clk_hw *[]){
4090 &pcnoc_bfdcd_clk_src.clkr.hw },
4091 .num_parents = 1,
4092 .flags = CLK_SET_RATE_PARENT,
4093 .ops = &clk_branch2_ops,
4094 },
4095 },
4096 };
4097
4098 static struct clk_branch gcc_cmn_12gpll_sys_clk = {
4099 .halt_reg = 0x5630c,
4100 .clkr = {
4101 .enable_reg = 0x5630c,
4102 .enable_mask = BIT(0),
4103 .hw.init = &(struct clk_init_data){
4104 .name = "gcc_cmn_12gpll_sys_clk",
4105 .parent_hws = (const struct clk_hw *[]){
4106 &gcc_xo_clk_src.clkr.hw },
4107 .num_parents = 1,
4108 .flags = CLK_SET_RATE_PARENT,
4109 .ops = &clk_branch2_ops,
4110 },
4111 },
4112 };
4113
4114 static struct clk_branch gcc_sdcc1_ice_core_clk = {
4115 .halt_reg = 0x5d014,
4116 .clkr = {
4117 .enable_reg = 0x5d014,
4118 .enable_mask = BIT(0),
4119 .hw.init = &(struct clk_init_data){
4120 .name = "gcc_sdcc1_ice_core_clk",
4121 .parent_hws = (const struct clk_hw *[]){
4122 &sdcc1_ice_core_clk_src.clkr.hw },
4123 .num_parents = 1,
4124 .flags = CLK_SET_RATE_PARENT,
4125 .ops = &clk_branch2_ops,
4126 },
4127 },
4128 };
4129
4130 static struct clk_branch gcc_dcc_clk = {
4131 .halt_reg = 0x77004,
4132 .clkr = {
4133 .enable_reg = 0x77004,
4134 .enable_mask = BIT(0),
4135 .hw.init = &(struct clk_init_data){
4136 .name = "gcc_dcc_clk",
4137 .parent_hws = (const struct clk_hw *[]){
4138 &pcnoc_bfdcd_clk_src.clkr.hw },
4139 .num_parents = 1,
4140 .flags = CLK_SET_RATE_PARENT,
4141 .ops = &clk_branch2_ops,
4142 },
4143 },
4144 };
4145
4146 static const struct alpha_pll_config ubi32_pll_config = {
4147 .l = 0x3e,
4148 .alpha = 0x57,
4149 .config_ctl_val = 0x240d6aa8,
4150 .config_ctl_hi_val = 0x3c2,
4151 .main_output_mask = BIT(0),
4152 .aux_output_mask = BIT(1),
4153 .pre_div_val = 0x0,
4154 .pre_div_mask = BIT(12),
4155 .post_div_val = 0x0,
4156 .post_div_mask = GENMASK(9, 8),
4157 };
4158
4159 static const struct alpha_pll_config nss_crypto_pll_config = {
4160 .l = 0x32,
4161 .alpha = 0x0,
4162 .alpha_hi = 0x0,
4163 .config_ctl_val = 0x4001055b,
4164 .main_output_mask = BIT(0),
4165 .pre_div_val = 0x0,
4166 .pre_div_mask = GENMASK(14, 12),
4167 .post_div_val = 0x1 << 8,
4168 .post_div_mask = GENMASK(11, 8),
4169 .vco_mask = GENMASK(21, 20),
4170 .vco_val = 0x0,
4171 .alpha_en_mask = BIT(24),
4172 };
4173
4174 static struct clk_hw *gcc_ipq6018_hws[] = {
4175 &gpll0_out_main_div2.hw,
4176 &gcc_xo_div4_clk_src.hw,
4177 &nss_ppe_cdiv_clk_src.hw,
4178 &gpll6_out_main_div2.hw,
4179 &qdss_dap_sync_clk_src.hw,
4180 &qdss_tsctr_div2_clk_src.hw,
4181 };
4182
4183 static struct clk_regmap *gcc_ipq6018_clks[] = {
4184 [GPLL0_MAIN] = &gpll0_main.clkr,
4185 [GPLL0] = &gpll0.clkr,
4186 [UBI32_PLL_MAIN] = &ubi32_pll_main.clkr,
4187 [UBI32_PLL] = &ubi32_pll.clkr,
4188 [GPLL6_MAIN] = &gpll6_main.clkr,
4189 [GPLL6] = &gpll6.clkr,
4190 [GPLL4_MAIN] = &gpll4_main.clkr,
4191 [GPLL4] = &gpll4.clkr,
4192 [PCNOC_BFDCD_CLK_SRC] = &pcnoc_bfdcd_clk_src.clkr,
4193 [GPLL2_MAIN] = &gpll2_main.clkr,
4194 [GPLL2] = &gpll2.clkr,
4195 [NSS_CRYPTO_PLL_MAIN] = &nss_crypto_pll_main.clkr,
4196 [NSS_CRYPTO_PLL] = &nss_crypto_pll.clkr,
4197 [QDSS_TSCTR_CLK_SRC] = &qdss_tsctr_clk_src.clkr,
4198 [QDSS_AT_CLK_SRC] = &qdss_at_clk_src.clkr,
4199 [NSS_PPE_CLK_SRC] = &nss_ppe_clk_src.clkr,
4200 [GCC_XO_CLK_SRC] = &gcc_xo_clk_src.clkr,
4201 [SYSTEM_NOC_BFDCD_CLK_SRC] = &system_noc_bfdcd_clk_src.clkr,
4202 [SNOC_NSSNOC_BFDCD_CLK_SRC] = &snoc_nssnoc_bfdcd_clk_src.clkr,
4203 [NSS_CE_CLK_SRC] = &nss_ce_clk_src.clkr,
4204 [GCC_SLEEP_CLK_SRC] = &gcc_sleep_clk_src.clkr,
4205 [APSS_AHB_CLK_SRC] = &apss_ahb_clk_src.clkr,
4206 [NSS_PORT5_RX_CLK_SRC] = &nss_port5_rx_clk_src.clkr,
4207 [NSS_PORT5_TX_CLK_SRC] = &nss_port5_tx_clk_src.clkr,
4208 [UBI32_MEM_NOC_BFDCD_CLK_SRC] = &ubi32_mem_noc_bfdcd_clk_src.clkr,
4209 [PCIE0_AXI_CLK_SRC] = &pcie0_axi_clk_src.clkr,
4210 [USB0_MASTER_CLK_SRC] = &usb0_master_clk_src.clkr,
4211 [APSS_AHB_POSTDIV_CLK_SRC] = &apss_ahb_postdiv_clk_src.clkr,
4212 [NSS_PORT1_RX_CLK_SRC] = &nss_port1_rx_clk_src.clkr,
4213 [NSS_PORT1_TX_CLK_SRC] = &nss_port1_tx_clk_src.clkr,
4214 [NSS_PORT2_RX_CLK_SRC] = &nss_port2_rx_clk_src.clkr,
4215 [NSS_PORT2_TX_CLK_SRC] = &nss_port2_tx_clk_src.clkr,
4216 [NSS_PORT3_RX_CLK_SRC] = &nss_port3_rx_clk_src.clkr,
4217 [NSS_PORT3_TX_CLK_SRC] = &nss_port3_tx_clk_src.clkr,
4218 [NSS_PORT4_RX_CLK_SRC] = &nss_port4_rx_clk_src.clkr,
4219 [NSS_PORT4_TX_CLK_SRC] = &nss_port4_tx_clk_src.clkr,
4220 [NSS_PORT5_RX_DIV_CLK_SRC] = &nss_port5_rx_div_clk_src.clkr,
4221 [NSS_PORT5_TX_DIV_CLK_SRC] = &nss_port5_tx_div_clk_src.clkr,
4222 [APSS_AXI_CLK_SRC] = &apss_axi_clk_src.clkr,
4223 [NSS_CRYPTO_CLK_SRC] = &nss_crypto_clk_src.clkr,
4224 [NSS_PORT1_RX_DIV_CLK_SRC] = &nss_port1_rx_div_clk_src.clkr,
4225 [NSS_PORT1_TX_DIV_CLK_SRC] = &nss_port1_tx_div_clk_src.clkr,
4226 [NSS_PORT2_RX_DIV_CLK_SRC] = &nss_port2_rx_div_clk_src.clkr,
4227 [NSS_PORT2_TX_DIV_CLK_SRC] = &nss_port2_tx_div_clk_src.clkr,
4228 [NSS_PORT3_RX_DIV_CLK_SRC] = &nss_port3_rx_div_clk_src.clkr,
4229 [NSS_PORT3_TX_DIV_CLK_SRC] = &nss_port3_tx_div_clk_src.clkr,
4230 [NSS_PORT4_RX_DIV_CLK_SRC] = &nss_port4_rx_div_clk_src.clkr,
4231 [NSS_PORT4_TX_DIV_CLK_SRC] = &nss_port4_tx_div_clk_src.clkr,
4232 [NSS_UBI0_CLK_SRC] = &nss_ubi0_clk_src.clkr,
4233 [ADSS_PWM_CLK_SRC] = &adss_pwm_clk_src.clkr,
4234 [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,
4235 [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr,
4236 [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr,
4237 [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr,
4238 [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr,
4239 [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr,
4240 [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr,
4241 [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr,
4242 [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr,
4243 [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr,
4244 [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr,
4245 [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr,
4246 [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr,
4247 [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr,
4248 [BLSP1_UART3_APPS_CLK_SRC] = &blsp1_uart3_apps_clk_src.clkr,
4249 [BLSP1_UART4_APPS_CLK_SRC] = &blsp1_uart4_apps_clk_src.clkr,
4250 [BLSP1_UART5_APPS_CLK_SRC] = &blsp1_uart5_apps_clk_src.clkr,
4251 [BLSP1_UART6_APPS_CLK_SRC] = &blsp1_uart6_apps_clk_src.clkr,
4252 [CRYPTO_CLK_SRC] = &crypto_clk_src.clkr,
4253 [GP1_CLK_SRC] = &gp1_clk_src.clkr,
4254 [GP2_CLK_SRC] = &gp2_clk_src.clkr,
4255 [GP3_CLK_SRC] = &gp3_clk_src.clkr,
4256 [NSS_UBI0_DIV_CLK_SRC] = &nss_ubi0_div_clk_src.clkr,
4257 [PCIE0_AUX_CLK_SRC] = &pcie0_aux_clk_src.clkr,
4258 [PCIE0_PIPE_CLK_SRC] = &pcie0_pipe_clk_src.clkr,
4259 [SDCC1_APPS_CLK_SRC] = &sdcc1_apps_clk_src.clkr,
4260 [USB0_AUX_CLK_SRC] = &usb0_aux_clk_src.clkr,
4261 [USB0_MOCK_UTMI_CLK_SRC] = &usb0_mock_utmi_clk_src.clkr,
4262 [USB0_PIPE_CLK_SRC] = &usb0_pipe_clk_src.clkr,
4263 [USB1_MOCK_UTMI_CLK_SRC] = &usb1_mock_utmi_clk_src.clkr,
4264 [GCC_ADSS_PWM_CLK] = &gcc_adss_pwm_clk.clkr,
4265 [GCC_APSS_AHB_CLK] = &gcc_apss_ahb_clk.clkr,
4266 [GCC_APSS_AXI_CLK] = &gcc_apss_axi_clk.clkr,
4267 [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr,
4268 [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr,
4269 [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr,
4270 [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr,
4271 [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr,
4272 [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr,
4273 [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr,
4274 [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr,
4275 [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr,
4276 [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr,
4277 [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr,
4278 [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr,
4279 [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr,
4280 [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr,
4281 [GCC_BLSP1_UART3_APPS_CLK] = &gcc_blsp1_uart3_apps_clk.clkr,
4282 [GCC_BLSP1_UART4_APPS_CLK] = &gcc_blsp1_uart4_apps_clk.clkr,
4283 [GCC_BLSP1_UART5_APPS_CLK] = &gcc_blsp1_uart5_apps_clk.clkr,
4284 [GCC_BLSP1_UART6_APPS_CLK] = &gcc_blsp1_uart6_apps_clk.clkr,
4285 [GCC_CRYPTO_AHB_CLK] = &gcc_crypto_ahb_clk.clkr,
4286 [GCC_CRYPTO_AXI_CLK] = &gcc_crypto_axi_clk.clkr,
4287 [GCC_CRYPTO_CLK] = &gcc_crypto_clk.clkr,
4288 [GCC_XO_CLK] = &gcc_xo_clk.clkr,
4289 [GCC_GP1_CLK] = &gcc_gp1_clk.clkr,
4290 [GCC_GP2_CLK] = &gcc_gp2_clk.clkr,
4291 [GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
4292 [GCC_MDIO_AHB_CLK] = &gcc_mdio_ahb_clk.clkr,
4293 [GCC_CRYPTO_PPE_CLK] = &gcc_crypto_ppe_clk.clkr,
4294 [GCC_NSS_CE_APB_CLK] = &gcc_nss_ce_apb_clk.clkr,
4295 [GCC_NSS_CE_AXI_CLK] = &gcc_nss_ce_axi_clk.clkr,
4296 [GCC_NSS_CFG_CLK] = &gcc_nss_cfg_clk.clkr,
4297 [GCC_NSS_CRYPTO_CLK] = &gcc_nss_crypto_clk.clkr,
4298 [GCC_NSS_CSR_CLK] = &gcc_nss_csr_clk.clkr,
4299 [GCC_NSS_EDMA_CFG_CLK] = &gcc_nss_edma_cfg_clk.clkr,
4300 [GCC_NSS_EDMA_CLK] = &gcc_nss_edma_clk.clkr,
4301 [GCC_NSS_NOC_CLK] = &gcc_nss_noc_clk.clkr,
4302 [GCC_UBI0_UTCM_CLK] = &gcc_ubi0_utcm_clk.clkr,
4303 [GCC_SNOC_NSSNOC_CLK] = &gcc_snoc_nssnoc_clk.clkr,
4304 [GCC_NSS_PORT1_RX_CLK] = &gcc_nss_port1_rx_clk.clkr,
4305 [GCC_NSS_PORT1_TX_CLK] = &gcc_nss_port1_tx_clk.clkr,
4306 [GCC_NSS_PORT2_RX_CLK] = &gcc_nss_port2_rx_clk.clkr,
4307 [GCC_NSS_PORT2_TX_CLK] = &gcc_nss_port2_tx_clk.clkr,
4308 [GCC_NSS_PORT3_RX_CLK] = &gcc_nss_port3_rx_clk.clkr,
4309 [GCC_NSS_PORT3_TX_CLK] = &gcc_nss_port3_tx_clk.clkr,
4310 [GCC_NSS_PORT4_RX_CLK] = &gcc_nss_port4_rx_clk.clkr,
4311 [GCC_NSS_PORT4_TX_CLK] = &gcc_nss_port4_tx_clk.clkr,
4312 [GCC_NSS_PORT5_RX_CLK] = &gcc_nss_port5_rx_clk.clkr,
4313 [GCC_NSS_PORT5_TX_CLK] = &gcc_nss_port5_tx_clk.clkr,
4314 [GCC_NSS_PPE_CFG_CLK] = &gcc_nss_ppe_cfg_clk.clkr,
4315 [GCC_NSS_PPE_CLK] = &gcc_nss_ppe_clk.clkr,
4316 [GCC_NSS_PPE_IPE_CLK] = &gcc_nss_ppe_ipe_clk.clkr,
4317 [GCC_NSS_PTP_REF_CLK] = &gcc_nss_ptp_ref_clk.clkr,
4318 [GCC_NSSNOC_CE_APB_CLK] = &gcc_nssnoc_ce_apb_clk.clkr,
4319 [GCC_NSSNOC_CE_AXI_CLK] = &gcc_nssnoc_ce_axi_clk.clkr,
4320 [GCC_NSSNOC_CRYPTO_CLK] = &gcc_nssnoc_crypto_clk.clkr,
4321 [GCC_NSSNOC_PPE_CFG_CLK] = &gcc_nssnoc_ppe_cfg_clk.clkr,
4322 [GCC_NSSNOC_PPE_CLK] = &gcc_nssnoc_ppe_clk.clkr,
4323 [GCC_NSSNOC_QOSGEN_REF_CLK] = &gcc_nssnoc_qosgen_ref_clk.clkr,
4324 [GCC_NSSNOC_SNOC_CLK] = &gcc_nssnoc_snoc_clk.clkr,
4325 [GCC_NSSNOC_TIMEOUT_REF_CLK] = &gcc_nssnoc_timeout_ref_clk.clkr,
4326 [GCC_NSSNOC_UBI0_AHB_CLK] = &gcc_nssnoc_ubi0_ahb_clk.clkr,
4327 [GCC_PORT1_MAC_CLK] = &gcc_port1_mac_clk.clkr,
4328 [GCC_PORT2_MAC_CLK] = &gcc_port2_mac_clk.clkr,
4329 [GCC_PORT3_MAC_CLK] = &gcc_port3_mac_clk.clkr,
4330 [GCC_PORT4_MAC_CLK] = &gcc_port4_mac_clk.clkr,
4331 [GCC_PORT5_MAC_CLK] = &gcc_port5_mac_clk.clkr,
4332 [GCC_UBI0_AHB_CLK] = &gcc_ubi0_ahb_clk.clkr,
4333 [GCC_UBI0_AXI_CLK] = &gcc_ubi0_axi_clk.clkr,
4334 [GCC_UBI0_NC_AXI_CLK] = &gcc_ubi0_nc_axi_clk.clkr,
4335 [GCC_UBI0_CORE_CLK] = &gcc_ubi0_core_clk.clkr,
4336 [GCC_PCIE0_AHB_CLK] = &gcc_pcie0_ahb_clk.clkr,
4337 [GCC_PCIE0_AUX_CLK] = &gcc_pcie0_aux_clk.clkr,
4338 [GCC_PCIE0_AXI_M_CLK] = &gcc_pcie0_axi_m_clk.clkr,
4339 [GCC_PCIE0_AXI_S_CLK] = &gcc_pcie0_axi_s_clk.clkr,
4340 [GCC_SYS_NOC_PCIE0_AXI_CLK] = &gcc_sys_noc_pcie0_axi_clk.clkr,
4341 [GCC_PCIE0_PIPE_CLK] = &gcc_pcie0_pipe_clk.clkr,
4342 [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr,
4343 [GCC_QDSS_DAP_CLK] = &gcc_qdss_dap_clk.clkr,
4344 [GCC_QPIC_AHB_CLK] = &gcc_qpic_ahb_clk.clkr,
4345 [GCC_QPIC_CLK] = &gcc_qpic_clk.clkr,
4346 [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr,
4347 [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr,
4348 [GCC_UNIPHY0_AHB_CLK] = &gcc_uniphy0_ahb_clk.clkr,
4349 [GCC_UNIPHY0_PORT1_RX_CLK] = &gcc_uniphy0_port1_rx_clk.clkr,
4350 [GCC_UNIPHY0_PORT1_TX_CLK] = &gcc_uniphy0_port1_tx_clk.clkr,
4351 [GCC_UNIPHY0_PORT2_RX_CLK] = &gcc_uniphy0_port2_rx_clk.clkr,
4352 [GCC_UNIPHY0_PORT2_TX_CLK] = &gcc_uniphy0_port2_tx_clk.clkr,
4353 [GCC_UNIPHY0_PORT3_RX_CLK] = &gcc_uniphy0_port3_rx_clk.clkr,
4354 [GCC_UNIPHY0_PORT3_TX_CLK] = &gcc_uniphy0_port3_tx_clk.clkr,
4355 [GCC_UNIPHY0_PORT4_RX_CLK] = &gcc_uniphy0_port4_rx_clk.clkr,
4356 [GCC_UNIPHY0_PORT4_TX_CLK] = &gcc_uniphy0_port4_tx_clk.clkr,
4357 [GCC_UNIPHY0_PORT5_RX_CLK] = &gcc_uniphy0_port5_rx_clk.clkr,
4358 [GCC_UNIPHY0_PORT5_TX_CLK] = &gcc_uniphy0_port5_tx_clk.clkr,
4359 [GCC_UNIPHY0_SYS_CLK] = &gcc_uniphy0_sys_clk.clkr,
4360 [GCC_UNIPHY1_AHB_CLK] = &gcc_uniphy1_ahb_clk.clkr,
4361 [GCC_UNIPHY1_PORT5_RX_CLK] = &gcc_uniphy1_port5_rx_clk.clkr,
4362 [GCC_UNIPHY1_PORT5_TX_CLK] = &gcc_uniphy1_port5_tx_clk.clkr,
4363 [GCC_UNIPHY1_SYS_CLK] = &gcc_uniphy1_sys_clk.clkr,
4364 [GCC_USB0_AUX_CLK] = &gcc_usb0_aux_clk.clkr,
4365 [GCC_SYS_NOC_USB0_AXI_CLK] = &gcc_sys_noc_usb0_axi_clk.clkr,
4366 [GCC_SNOC_BUS_TIMEOUT2_AHB_CLK] = &gcc_snoc_bus_timeout2_ahb_clk.clkr,
4367 [GCC_USB0_MASTER_CLK] = &gcc_usb0_master_clk.clkr,
4368 [GCC_USB0_MOCK_UTMI_CLK] = &gcc_usb0_mock_utmi_clk.clkr,
4369 [GCC_USB0_PHY_CFG_AHB_CLK] = &gcc_usb0_phy_cfg_ahb_clk.clkr,
4370 [GCC_USB0_PIPE_CLK] = &gcc_usb0_pipe_clk.clkr,
4371 [GCC_USB0_SLEEP_CLK] = &gcc_usb0_sleep_clk.clkr,
4372 [GCC_USB1_MASTER_CLK] = &gcc_usb1_master_clk.clkr,
4373 [GCC_USB1_MOCK_UTMI_CLK] = &gcc_usb1_mock_utmi_clk.clkr,
4374 [GCC_USB1_PHY_CFG_AHB_CLK] = &gcc_usb1_phy_cfg_ahb_clk.clkr,
4375 [GCC_USB1_SLEEP_CLK] = &gcc_usb1_sleep_clk.clkr,
4376 [GCC_CMN_12GPLL_AHB_CLK] = &gcc_cmn_12gpll_ahb_clk.clkr,
4377 [GCC_CMN_12GPLL_SYS_CLK] = &gcc_cmn_12gpll_sys_clk.clkr,
4378 [GCC_SDCC1_ICE_CORE_CLK] = &gcc_sdcc1_ice_core_clk.clkr,
4379 [SDCC1_ICE_CORE_CLK_SRC] = &sdcc1_ice_core_clk_src.clkr,
4380 [GCC_DCC_CLK] = &gcc_dcc_clk.clkr,
4381 [PCIE0_RCHNG_CLK_SRC] = &pcie0_rchng_clk_src.clkr,
4382 [GCC_PCIE0_AXI_S_BRIDGE_CLK] = &gcc_pcie0_axi_s_bridge_clk.clkr,
4383 [PCIE0_RCHNG_CLK] = &gcc_pcie0_rchng_clk.clkr,
4384 [WCSS_AHB_CLK_SRC] = &wcss_ahb_clk_src.clkr,
4385 [Q6_AXI_CLK_SRC] = &q6_axi_clk_src.clkr,
4386 [RBCPR_WCSS_CLK_SRC] = &rbcpr_wcss_clk_src.clkr,
4387 [GCC_LPASS_CORE_AXIM_CLK] = &gcc_lpass_core_axim_clk.clkr,
4388 [LPASS_CORE_AXIM_CLK_SRC] = &lpass_core_axim_clk_src.clkr,
4389 [GCC_LPASS_SNOC_CFG_CLK] = &gcc_lpass_snoc_cfg_clk.clkr,
4390 [LPASS_SNOC_CFG_CLK_SRC] = &lpass_snoc_cfg_clk_src.clkr,
4391 [GCC_LPASS_Q6_AXIM_CLK] = &gcc_lpass_q6_axim_clk.clkr,
4392 [LPASS_Q6_AXIM_CLK_SRC] = &lpass_q6_axim_clk_src.clkr,
4393 [GCC_LPASS_Q6_ATBM_AT_CLK] = &gcc_lpass_q6_atbm_at_clk.clkr,
4394 [GCC_LPASS_Q6_PCLKDBG_CLK] = &gcc_lpass_q6_pclkdbg_clk.clkr,
4395 [GCC_LPASS_Q6SS_TSCTR_1TO2_CLK] = &gcc_lpass_q6ss_tsctr_1to2_clk.clkr,
4396 [GCC_LPASS_Q6SS_TRIG_CLK] = &gcc_lpass_q6ss_trig_clk.clkr,
4397 [GCC_LPASS_TBU_CLK] = &gcc_lpass_tbu_clk.clkr,
4398 [GCC_PCNOC_LPASS_CLK] = &gcc_pcnoc_lpass_clk.clkr,
4399 [GCC_MEM_NOC_UBI32_CLK] = &gcc_mem_noc_ubi32_clk.clkr,
4400 [GCC_MEM_NOC_LPASS_CLK] = &gcc_mem_noc_lpass_clk.clkr,
4401 [GCC_SNOC_LPASS_CFG_CLK] = &gcc_snoc_lpass_cfg_clk.clkr,
4402 [QDSS_STM_CLK_SRC] = &qdss_stm_clk_src.clkr,
4403 [QDSS_TRACECLKIN_CLK_SRC] = &qdss_traceclkin_clk_src.clkr,
4404 };
4405
4406 static const struct qcom_reset_map gcc_ipq6018_resets[] = {
4407 [GCC_BLSP1_BCR] = { 0x01000, 0 },
4408 [GCC_BLSP1_QUP1_BCR] = { 0x02000, 0 },
4409 [GCC_BLSP1_UART1_BCR] = { 0x02038, 0 },
4410 [GCC_BLSP1_QUP2_BCR] = { 0x03008, 0 },
4411 [GCC_BLSP1_UART2_BCR] = { 0x03028, 0 },
4412 [GCC_BLSP1_QUP3_BCR] = { 0x04008, 0 },
4413 [GCC_BLSP1_UART3_BCR] = { 0x04028, 0 },
4414 [GCC_BLSP1_QUP4_BCR] = { 0x05008, 0 },
4415 [GCC_BLSP1_UART4_BCR] = { 0x05028, 0 },
4416 [GCC_BLSP1_QUP5_BCR] = { 0x06008, 0 },
4417 [GCC_BLSP1_UART5_BCR] = { 0x06028, 0 },
4418 [GCC_BLSP1_QUP6_BCR] = { 0x07008, 0 },
4419 [GCC_BLSP1_UART6_BCR] = { 0x07028, 0 },
4420 [GCC_IMEM_BCR] = { 0x0e000, 0 },
4421 [GCC_SMMU_BCR] = { 0x12000, 0 },
4422 [GCC_APSS_TCU_BCR] = { 0x12050, 0 },
4423 [GCC_SMMU_XPU_BCR] = { 0x12054, 0 },
4424 [GCC_PCNOC_TBU_BCR] = { 0x12058, 0 },
4425 [GCC_SMMU_CFG_BCR] = { 0x1208c, 0 },
4426 [GCC_PRNG_BCR] = { 0x13000, 0 },
4427 [GCC_BOOT_ROM_BCR] = { 0x13008, 0 },
4428 [GCC_CRYPTO_BCR] = { 0x16000, 0 },
4429 [GCC_WCSS_BCR] = { 0x18000, 0 },
4430 [GCC_WCSS_Q6_BCR] = { 0x18100, 0 },
4431 [GCC_NSS_BCR] = { 0x19000, 0 },
4432 [GCC_SEC_CTRL_BCR] = { 0x1a000, 0 },
4433 [GCC_ADSS_BCR] = { 0x1c000, 0 },
4434 [GCC_DDRSS_BCR] = { 0x1e000, 0 },
4435 [GCC_SYSTEM_NOC_BCR] = { 0x26000, 0 },
4436 [GCC_PCNOC_BCR] = { 0x27018, 0 },
4437 [GCC_TCSR_BCR] = { 0x28000, 0 },
4438 [GCC_QDSS_BCR] = { 0x29000, 0 },
4439 [GCC_DCD_BCR] = { 0x2a000, 0 },
4440 [GCC_MSG_RAM_BCR] = { 0x2b000, 0 },
4441 [GCC_MPM_BCR] = { 0x2c000, 0 },
4442 [GCC_SPDM_BCR] = { 0x2f000, 0 },
4443 [GCC_RBCPR_BCR] = { 0x33000, 0 },
4444 [GCC_RBCPR_MX_BCR] = { 0x33014, 0 },
4445 [GCC_TLMM_BCR] = { 0x34000, 0 },
4446 [GCC_RBCPR_WCSS_BCR] = { 0x3a000, 0 },
4447 [GCC_USB0_PHY_BCR] = { 0x3e034, 0 },
4448 [GCC_USB3PHY_0_PHY_BCR] = { 0x3e03c, 0 },
4449 [GCC_USB0_BCR] = { 0x3e070, 0 },
4450 [GCC_USB1_BCR] = { 0x3f070, 0 },
4451 [GCC_QUSB2_0_PHY_BCR] = { 0x4103c, 0 },
4452 [GCC_QUSB2_1_PHY_BCR] = { 0x41040, 0 },
4453 [GCC_SDCC1_BCR] = { 0x42000, 0 },
4454 [GCC_SNOC_BUS_TIMEOUT0_BCR] = { 0x47000, 0 },
4455 [GCC_SNOC_BUS_TIMEOUT1_BCR] = { 0x47008, 0 },
4456 [GCC_SNOC_BUS_TIMEOUT2_BCR] = { 0x47010, 0 },
4457 [GCC_PCNOC_BUS_TIMEOUT0_BCR] = { 0x48000, 0 },
4458 [GCC_PCNOC_BUS_TIMEOUT1_BCR] = { 0x48008, 0 },
4459 [GCC_PCNOC_BUS_TIMEOUT2_BCR] = { 0x48010, 0 },
4460 [GCC_PCNOC_BUS_TIMEOUT3_BCR] = { 0x48018, 0 },
4461 [GCC_PCNOC_BUS_TIMEOUT4_BCR] = { 0x48020, 0 },
4462 [GCC_PCNOC_BUS_TIMEOUT5_BCR] = { 0x48028, 0 },
4463 [GCC_PCNOC_BUS_TIMEOUT6_BCR] = { 0x48030, 0 },
4464 [GCC_PCNOC_BUS_TIMEOUT7_BCR] = { 0x48038, 0 },
4465 [GCC_PCNOC_BUS_TIMEOUT8_BCR] = { 0x48040, 0 },
4466 [GCC_PCNOC_BUS_TIMEOUT9_BCR] = { 0x48048, 0 },
4467 [GCC_UNIPHY0_BCR] = { 0x56000, 0 },
4468 [GCC_UNIPHY1_BCR] = { 0x56100, 0 },
4469 [GCC_CMN_12GPLL_BCR] = { 0x56300, 0 },
4470 [GCC_QPIC_BCR] = { 0x57018, 0 },
4471 [GCC_MDIO_BCR] = { 0x58000, 0 },
4472 [GCC_WCSS_CORE_TBU_BCR] = { 0x66000, 0 },
4473 [GCC_WCSS_Q6_TBU_BCR] = { 0x67000, 0 },
4474 [GCC_USB0_TBU_BCR] = { 0x6a000, 0 },
4475 [GCC_PCIE0_TBU_BCR] = { 0x6b000, 0 },
4476 [GCC_NSS_NOC_TBU_BCR] = { 0x6e000, 0 },
4477 [GCC_PCIE0_BCR] = { 0x75004, 0 },
4478 [GCC_PCIE0_PHY_BCR] = { 0x75038, 0 },
4479 [GCC_PCIE0PHY_PHY_BCR] = { 0x7503c, 0 },
4480 [GCC_PCIE0_LINK_DOWN_BCR] = { 0x75044, 0 },
4481 [GCC_DCC_BCR] = { 0x77000, 0 },
4482 [GCC_APC0_VOLTAGE_DROOP_DETECTOR_BCR] = { 0x78000, 0 },
4483 [GCC_SMMU_CATS_BCR] = { 0x7c000, 0 },
4484 [GCC_UBI0_AXI_ARES] = { 0x68010, 0 },
4485 [GCC_UBI0_AHB_ARES] = { 0x68010, 1 },
4486 [GCC_UBI0_NC_AXI_ARES] = { 0x68010, 2 },
4487 [GCC_UBI0_DBG_ARES] = { 0x68010, 3 },
4488 [GCC_UBI0_CORE_CLAMP_ENABLE] = { 0x68010, 4 },
4489 [GCC_UBI0_CLKRST_CLAMP_ENABLE] = { 0x68010, 5 },
4490 [GCC_UBI0_UTCM_ARES] = { 0x68010, 6 },
4491 [GCC_UBI0_CORE_ARES] = { 0x68010, 7 },
4492 [GCC_NSS_CFG_ARES] = { 0x68010, 16 },
4493 [GCC_NSS_NOC_ARES] = { 0x68010, 18 },
4494 [GCC_NSS_CRYPTO_ARES] = { 0x68010, 19 },
4495 [GCC_NSS_CSR_ARES] = { 0x68010, 20 },
4496 [GCC_NSS_CE_APB_ARES] = { 0x68010, 21 },
4497 [GCC_NSS_CE_AXI_ARES] = { 0x68010, 22 },
4498 [GCC_NSSNOC_CE_APB_ARES] = { 0x68010, 23 },
4499 [GCC_NSSNOC_CE_AXI_ARES] = { 0x68010, 24 },
4500 [GCC_NSSNOC_UBI0_AHB_ARES] = { 0x68010, 25 },
4501 [GCC_NSSNOC_SNOC_ARES] = { 0x68010, 27 },
4502 [GCC_NSSNOC_CRYPTO_ARES] = { 0x68010, 28 },
4503 [GCC_NSSNOC_ATB_ARES] = { 0x68010, 29 },
4504 [GCC_NSSNOC_QOSGEN_REF_ARES] = { 0x68010, 30 },
4505 [GCC_NSSNOC_TIMEOUT_REF_ARES] = { 0x68010, 31 },
4506 [GCC_PCIE0_PIPE_ARES] = { 0x75040, 0 },
4507 [GCC_PCIE0_SLEEP_ARES] = { 0x75040, 1 },
4508 [GCC_PCIE0_CORE_STICKY_ARES] = { 0x75040, 2 },
4509 [GCC_PCIE0_AXI_MASTER_ARES] = { 0x75040, 3 },
4510 [GCC_PCIE0_AXI_SLAVE_ARES] = { 0x75040, 4 },
4511 [GCC_PCIE0_AHB_ARES] = { 0x75040, 5 },
4512 [GCC_PCIE0_AXI_MASTER_STICKY_ARES] = { 0x75040, 6 },
4513 [GCC_PCIE0_AXI_SLAVE_STICKY_ARES] = { 0x75040, 7 },
4514 [GCC_PPE_FULL_RESET] = { .reg = 0x68014, .bitmask = 0xf0000 },
4515 [GCC_UNIPHY0_SOFT_RESET] = { .reg = 0x56004, .bitmask = 0x3ff2 },
4516 [GCC_UNIPHY0_XPCS_RESET] = { 0x56004, 2 },
4517 [GCC_UNIPHY1_SOFT_RESET] = { .reg = 0x56104, .bitmask = 0x32 },
4518 [GCC_UNIPHY1_XPCS_RESET] = { 0x56104, 2 },
4519 [GCC_EDMA_HW_RESET] = { .reg = 0x68014, .bitmask = 0x300000 },
4520 [GCC_NSSPORT1_RESET] = { .reg = 0x68014, .bitmask = 0x1000003 },
4521 [GCC_NSSPORT2_RESET] = { .reg = 0x68014, .bitmask = 0x200000c },
4522 [GCC_NSSPORT3_RESET] = { .reg = 0x68014, .bitmask = 0x4000030 },
4523 [GCC_NSSPORT4_RESET] = { .reg = 0x68014, .bitmask = 0x8000300 },
4524 [GCC_NSSPORT5_RESET] = { .reg = 0x68014, .bitmask = 0x10000c00 },
4525 [GCC_UNIPHY0_PORT1_ARES] = { .reg = 0x56004, .bitmask = 0x30 },
4526 [GCC_UNIPHY0_PORT2_ARES] = { .reg = 0x56004, .bitmask = 0xc0 },
4527 [GCC_UNIPHY0_PORT3_ARES] = { .reg = 0x56004, .bitmask = 0x300 },
4528 [GCC_UNIPHY0_PORT4_ARES] = { .reg = 0x56004, .bitmask = 0xc00 },
4529 [GCC_UNIPHY0_PORT5_ARES] = { .reg = 0x56004, .bitmask = 0x3000 },
4530 [GCC_UNIPHY0_PORT_4_5_RESET] = { .reg = 0x56004, .bitmask = 0x3c02 },
4531 [GCC_UNIPHY0_PORT_4_RESET] = { .reg = 0x56004, .bitmask = 0xc02 },
4532 [GCC_LPASS_BCR] = {0x1F000, 0},
4533 [GCC_UBI32_TBU_BCR] = {0x65000, 0},
4534 [GCC_LPASS_TBU_BCR] = {0x6C000, 0},
4535 [GCC_WCSSAON_RESET] = {0x59010, 0},
4536 [GCC_LPASS_Q6_AXIM_ARES] = {0x1F004, 0},
4537 [GCC_LPASS_Q6SS_TSCTR_1TO2_ARES] = {0x1F004, 1},
4538 [GCC_LPASS_Q6SS_TRIG_ARES] = {0x1F004, 2},
4539 [GCC_LPASS_Q6_ATBM_AT_ARES] = {0x1F004, 3},
4540 [GCC_LPASS_Q6_PCLKDBG_ARES] = {0x1F004, 4},
4541 [GCC_LPASS_CORE_AXIM_ARES] = {0x1F004, 5},
4542 [GCC_LPASS_SNOC_CFG_ARES] = {0x1F004, 6},
4543 [GCC_WCSS_DBG_ARES] = {0x59008, 0},
4544 [GCC_WCSS_ECAHB_ARES] = {0x59008, 1},
4545 [GCC_WCSS_ACMT_ARES] = {0x59008, 2},
4546 [GCC_WCSS_DBG_BDG_ARES] = {0x59008, 3},
4547 [GCC_WCSS_AHB_S_ARES] = {0x59008, 4},
4548 [GCC_WCSS_AXI_M_ARES] = {0x59008, 5},
4549 [GCC_Q6SS_DBG_ARES] = {0x59110, 0},
4550 [GCC_Q6_AHB_S_ARES] = {0x59110, 1},
4551 [GCC_Q6_AHB_ARES] = {0x59110, 2},
4552 [GCC_Q6_AXIM2_ARES] = {0x59110, 3},
4553 [GCC_Q6_AXIM_ARES] = {0x59110, 4},
4554 };
4555
4556 static const struct of_device_id gcc_ipq6018_match_table[] = {
4557 { .compatible = "qcom,gcc-ipq6018" },
4558 { }
4559 };
4560 MODULE_DEVICE_TABLE(of, gcc_ipq6018_match_table);
4561
4562 static const struct regmap_config gcc_ipq6018_regmap_config = {
4563 .reg_bits = 32,
4564 .reg_stride = 4,
4565 .val_bits = 32,
4566 .max_register = 0x7fffc,
4567 .fast_io = true,
4568 };
4569
4570 static const struct qcom_cc_desc gcc_ipq6018_desc = {
4571 .config = &gcc_ipq6018_regmap_config,
4572 .clks = gcc_ipq6018_clks,
4573 .num_clks = ARRAY_SIZE(gcc_ipq6018_clks),
4574 .resets = gcc_ipq6018_resets,
4575 .num_resets = ARRAY_SIZE(gcc_ipq6018_resets),
4576 .clk_hws = gcc_ipq6018_hws,
4577 .num_clk_hws = ARRAY_SIZE(gcc_ipq6018_hws),
4578 };
4579
gcc_ipq6018_probe(struct platform_device * pdev)4580 static int gcc_ipq6018_probe(struct platform_device *pdev)
4581 {
4582 struct regmap *regmap;
4583
4584 regmap = qcom_cc_map(pdev, &gcc_ipq6018_desc);
4585 if (IS_ERR(regmap))
4586 return PTR_ERR(regmap);
4587
4588 /* Disable SW_COLLAPSE for USB0 GDSCR */
4589 regmap_update_bits(regmap, 0x3e078, BIT(0), 0x0);
4590 /* Enable SW_OVERRIDE for USB0 GDSCR */
4591 regmap_update_bits(regmap, 0x3e078, BIT(2), BIT(2));
4592 /* Disable SW_COLLAPSE for USB1 GDSCR */
4593 regmap_update_bits(regmap, 0x3f078, BIT(0), 0x0);
4594 /* Enable SW_OVERRIDE for USB1 GDSCR */
4595 regmap_update_bits(regmap, 0x3f078, BIT(2), BIT(2));
4596
4597 /* SW Workaround for UBI Huyara PLL */
4598 regmap_update_bits(regmap, 0x2501c, BIT(26), BIT(26));
4599
4600 clk_alpha_pll_configure(&ubi32_pll_main, regmap, &ubi32_pll_config);
4601
4602 clk_alpha_pll_configure(&nss_crypto_pll_main, regmap,
4603 &nss_crypto_pll_config);
4604
4605 return qcom_cc_really_probe(pdev, &gcc_ipq6018_desc, regmap);
4606 }
4607
4608 static struct platform_driver gcc_ipq6018_driver = {
4609 .probe = gcc_ipq6018_probe,
4610 .driver = {
4611 .name = "qcom,gcc-ipq6018",
4612 .of_match_table = gcc_ipq6018_match_table,
4613 },
4614 };
4615
gcc_ipq6018_init(void)4616 static int __init gcc_ipq6018_init(void)
4617 {
4618 return platform_driver_register(&gcc_ipq6018_driver);
4619 }
4620 core_initcall(gcc_ipq6018_init);
4621
gcc_ipq6018_exit(void)4622 static void __exit gcc_ipq6018_exit(void)
4623 {
4624 platform_driver_unregister(&gcc_ipq6018_driver);
4625 }
4626 module_exit(gcc_ipq6018_exit);
4627
4628 MODULE_DESCRIPTION("Qualcomm Technologies, Inc. GCC IPQ6018 Driver");
4629 MODULE_LICENSE("GPL v2");
4630