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