1 // SPDX-License-Identifier: GPL-2.0-only 2 /* 3 * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. 4 */ 5 6 #include <linux/err.h> 7 #include <linux/kernel.h> 8 #include <linux/module.h> 9 #include <linux/of_device.h> 10 #include <linux/clk-provider.h> 11 #include <linux/regmap.h> 12 #include <linux/reset-controller.h> 13 14 #include <dt-bindings/clock/qcom,gcc-sm6115.h> 15 16 #include "clk-alpha-pll.h" 17 #include "clk-branch.h" 18 #include "clk-pll.h" 19 #include "clk-rcg.h" 20 #include "clk-regmap.h" 21 #include "clk-regmap-divider.h" 22 #include "common.h" 23 #include "gdsc.h" 24 #include "reset.h" 25 26 enum { 27 P_BI_TCXO, 28 P_GPLL0_OUT_AUX2, 29 P_GPLL0_OUT_EARLY, 30 P_GPLL10_OUT_MAIN, 31 P_GPLL11_OUT_MAIN, 32 P_GPLL3_OUT_EARLY, 33 P_GPLL4_OUT_MAIN, 34 P_GPLL6_OUT_EARLY, 35 P_GPLL6_OUT_MAIN, 36 P_GPLL7_OUT_MAIN, 37 P_GPLL8_OUT_EARLY, 38 P_GPLL8_OUT_MAIN, 39 P_GPLL9_OUT_EARLY, 40 P_GPLL9_OUT_MAIN, 41 P_SLEEP_CLK, 42 }; 43 44 static struct pll_vco default_vco[] = { 45 { 500000000, 1000000000, 2 }, 46 }; 47 48 static struct pll_vco gpll9_vco[] = { 49 { 500000000, 1250000000, 0 }, 50 }; 51 52 static struct pll_vco gpll10_vco[] = { 53 { 750000000, 1500000000, 1 }, 54 }; 55 56 static struct clk_alpha_pll gpll0 = { 57 .offset = 0x0, 58 .vco_table = default_vco, 59 .num_vco = ARRAY_SIZE(default_vco), 60 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 61 .clkr = { 62 .enable_reg = 0x79000, 63 .enable_mask = BIT(0), 64 .hw.init = &(struct clk_init_data){ 65 .name = "gpll0", 66 .parent_data = &(const struct clk_parent_data){ 67 .fw_name = "bi_tcxo", 68 }, 69 .num_parents = 1, 70 .ops = &clk_alpha_pll_ops, 71 }, 72 }, 73 }; 74 75 static const struct clk_div_table post_div_table_gpll0_out_aux2[] = { 76 { 0x1, 2 }, 77 { } 78 }; 79 80 static struct clk_alpha_pll_postdiv gpll0_out_aux2 = { 81 .offset = 0x0, 82 .post_div_shift = 8, 83 .post_div_table = post_div_table_gpll0_out_aux2, 84 .num_post_div = ARRAY_SIZE(post_div_table_gpll0_out_aux2), 85 .width = 4, 86 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 87 .clkr.hw.init = &(struct clk_init_data){ 88 .name = "gpll0_out_aux2", 89 .parent_hws = (const struct clk_hw *[]){ &gpll0.clkr.hw }, 90 .num_parents = 1, 91 .ops = &clk_alpha_pll_postdiv_ro_ops, 92 }, 93 }; 94 95 static const struct clk_div_table post_div_table_gpll0_out_main[] = { 96 { 0x0, 1 }, 97 { } 98 }; 99 100 static struct clk_alpha_pll_postdiv gpll0_out_main = { 101 .offset = 0x0, 102 .post_div_shift = 8, 103 .post_div_table = post_div_table_gpll0_out_main, 104 .num_post_div = ARRAY_SIZE(post_div_table_gpll0_out_main), 105 .width = 4, 106 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 107 .clkr.hw.init = &(struct clk_init_data){ 108 .name = "gpll0_out_main", 109 .parent_hws = (const struct clk_hw *[]){ &gpll0.clkr.hw }, 110 .num_parents = 1, 111 .ops = &clk_alpha_pll_postdiv_ro_ops, 112 }, 113 }; 114 115 /* 1152MHz configuration */ 116 static const struct alpha_pll_config gpll10_config = { 117 .l = 0x3c, 118 .vco_val = 0x1 << 20, 119 .vco_mask = GENMASK(21, 20), 120 .main_output_mask = BIT(0), 121 .config_ctl_val = 0x4001055b, 122 .test_ctl_hi1_val = 0x1, 123 .test_ctl_hi_mask = 0x1, 124 }; 125 126 static struct clk_alpha_pll gpll10 = { 127 .offset = 0xa000, 128 .vco_table = gpll10_vco, 129 .num_vco = ARRAY_SIZE(gpll10_vco), 130 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 131 .clkr = { 132 .enable_reg = 0x79000, 133 .enable_mask = BIT(10), 134 .hw.init = &(struct clk_init_data){ 135 .name = "gpll10", 136 .parent_data = &(const struct clk_parent_data){ 137 .fw_name = "bi_tcxo", 138 }, 139 .num_parents = 1, 140 .ops = &clk_alpha_pll_ops, 141 }, 142 }, 143 }; 144 145 static const struct clk_div_table post_div_table_gpll10_out_main[] = { 146 { 0x0, 1 }, 147 { } 148 }; 149 150 static struct clk_alpha_pll_postdiv gpll10_out_main = { 151 .offset = 0xa000, 152 .post_div_shift = 8, 153 .post_div_table = post_div_table_gpll10_out_main, 154 .num_post_div = ARRAY_SIZE(post_div_table_gpll10_out_main), 155 .width = 4, 156 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 157 .clkr.hw.init = &(struct clk_init_data){ 158 .name = "gpll10_out_main", 159 .parent_hws = (const struct clk_hw *[]){ &gpll10.clkr.hw }, 160 .num_parents = 1, 161 .flags = CLK_SET_RATE_PARENT, 162 .ops = &clk_alpha_pll_postdiv_ops, 163 }, 164 }; 165 166 /* 600MHz configuration */ 167 static const struct alpha_pll_config gpll11_config = { 168 .l = 0x1F, 169 .alpha = 0x0, 170 .alpha_hi = 0x40, 171 .alpha_en_mask = BIT(24), 172 .vco_val = 0x2 << 20, 173 .vco_mask = GENMASK(21, 20), 174 .config_ctl_val = 0x4001055b, 175 .test_ctl_hi1_val = 0x1, 176 .test_ctl_hi_mask = 0x1, 177 }; 178 179 static struct clk_alpha_pll gpll11 = { 180 .offset = 0xb000, 181 .vco_table = default_vco, 182 .num_vco = ARRAY_SIZE(default_vco), 183 .flags = SUPPORTS_DYNAMIC_UPDATE, 184 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 185 .clkr = { 186 .enable_reg = 0x79000, 187 .enable_mask = BIT(11), 188 .hw.init = &(struct clk_init_data){ 189 .name = "gpll11", 190 .parent_data = &(const struct clk_parent_data){ 191 .fw_name = "bi_tcxo", 192 }, 193 .num_parents = 1, 194 .ops = &clk_alpha_pll_ops, 195 }, 196 }, 197 }; 198 199 static const struct clk_div_table post_div_table_gpll11_out_main[] = { 200 { 0x0, 1 }, 201 { } 202 }; 203 204 static struct clk_alpha_pll_postdiv gpll11_out_main = { 205 .offset = 0xb000, 206 .post_div_shift = 8, 207 .post_div_table = post_div_table_gpll11_out_main, 208 .num_post_div = ARRAY_SIZE(post_div_table_gpll11_out_main), 209 .width = 4, 210 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 211 .clkr.hw.init = &(struct clk_init_data){ 212 .name = "gpll11_out_main", 213 .parent_hws = (const struct clk_hw *[]){ &gpll11.clkr.hw }, 214 .num_parents = 1, 215 .flags = CLK_SET_RATE_PARENT, 216 .ops = &clk_alpha_pll_postdiv_ops, 217 }, 218 }; 219 220 static struct clk_alpha_pll gpll3 = { 221 .offset = 0x3000, 222 .vco_table = default_vco, 223 .num_vco = ARRAY_SIZE(default_vco), 224 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 225 .clkr = { 226 .enable_reg = 0x79000, 227 .enable_mask = BIT(3), 228 .hw.init = &(struct clk_init_data){ 229 .name = "gpll3", 230 .parent_data = &(const struct clk_parent_data){ 231 .fw_name = "bi_tcxo", 232 }, 233 .num_parents = 1, 234 .ops = &clk_alpha_pll_ops, 235 }, 236 }, 237 }; 238 239 static struct clk_alpha_pll gpll4 = { 240 .offset = 0x4000, 241 .vco_table = default_vco, 242 .num_vco = ARRAY_SIZE(default_vco), 243 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 244 .clkr = { 245 .enable_reg = 0x79000, 246 .enable_mask = BIT(4), 247 .hw.init = &(struct clk_init_data){ 248 .name = "gpll4", 249 .parent_data = &(const struct clk_parent_data){ 250 .fw_name = "bi_tcxo", 251 }, 252 .num_parents = 1, 253 .ops = &clk_alpha_pll_ops, 254 }, 255 }, 256 }; 257 258 static const struct clk_div_table post_div_table_gpll4_out_main[] = { 259 { 0x0, 1 }, 260 { } 261 }; 262 263 static struct clk_alpha_pll_postdiv gpll4_out_main = { 264 .offset = 0x4000, 265 .post_div_shift = 8, 266 .post_div_table = post_div_table_gpll4_out_main, 267 .num_post_div = ARRAY_SIZE(post_div_table_gpll4_out_main), 268 .width = 4, 269 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 270 .clkr.hw.init = &(struct clk_init_data){ 271 .name = "gpll4_out_main", 272 .parent_hws = (const struct clk_hw *[]){ &gpll4.clkr.hw }, 273 .num_parents = 1, 274 .ops = &clk_alpha_pll_postdiv_ro_ops, 275 }, 276 }; 277 278 static struct clk_alpha_pll gpll6 = { 279 .offset = 0x6000, 280 .vco_table = default_vco, 281 .num_vco = ARRAY_SIZE(default_vco), 282 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 283 .clkr = { 284 .enable_reg = 0x79000, 285 .enable_mask = BIT(6), 286 .hw.init = &(struct clk_init_data){ 287 .name = "gpll6", 288 .parent_data = &(const struct clk_parent_data){ 289 .fw_name = "bi_tcxo", 290 }, 291 .num_parents = 1, 292 .ops = &clk_alpha_pll_ops, 293 }, 294 }, 295 }; 296 297 static const struct clk_div_table post_div_table_gpll6_out_main[] = { 298 { 0x1, 2 }, 299 { } 300 }; 301 302 static struct clk_alpha_pll_postdiv gpll6_out_main = { 303 .offset = 0x6000, 304 .post_div_shift = 8, 305 .post_div_table = post_div_table_gpll6_out_main, 306 .num_post_div = ARRAY_SIZE(post_div_table_gpll6_out_main), 307 .width = 4, 308 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 309 .clkr.hw.init = &(struct clk_init_data){ 310 .name = "gpll6_out_main", 311 .parent_hws = (const struct clk_hw *[]){ &gpll6.clkr.hw }, 312 .num_parents = 1, 313 .ops = &clk_alpha_pll_postdiv_ro_ops, 314 }, 315 }; 316 317 static struct clk_alpha_pll gpll7 = { 318 .offset = 0x7000, 319 .vco_table = default_vco, 320 .num_vco = ARRAY_SIZE(default_vco), 321 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 322 .clkr = { 323 .enable_reg = 0x79000, 324 .enable_mask = BIT(7), 325 .hw.init = &(struct clk_init_data){ 326 .name = "gpll7", 327 .parent_data = &(const struct clk_parent_data){ 328 .fw_name = "bi_tcxo", 329 }, 330 .num_parents = 1, 331 .ops = &clk_alpha_pll_ops, 332 }, 333 }, 334 }; 335 336 static const struct clk_div_table post_div_table_gpll7_out_main[] = { 337 { 0x0, 1 }, 338 { } 339 }; 340 341 static struct clk_alpha_pll_postdiv gpll7_out_main = { 342 .offset = 0x7000, 343 .post_div_shift = 8, 344 .post_div_table = post_div_table_gpll7_out_main, 345 .num_post_div = ARRAY_SIZE(post_div_table_gpll7_out_main), 346 .width = 4, 347 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 348 .clkr.hw.init = &(struct clk_init_data){ 349 .name = "gpll7_out_main", 350 .parent_hws = (const struct clk_hw *[]){ &gpll7.clkr.hw }, 351 .num_parents = 1, 352 .ops = &clk_alpha_pll_postdiv_ro_ops, 353 }, 354 }; 355 356 /* 800MHz configuration */ 357 static const struct alpha_pll_config gpll8_config = { 358 .l = 0x29, 359 .alpha = 0xAAAAAAAA, 360 .alpha_hi = 0xAA, 361 .alpha_en_mask = BIT(24), 362 .vco_val = 0x2 << 20, 363 .vco_mask = GENMASK(21, 20), 364 .main_output_mask = BIT(0), 365 .early_output_mask = BIT(3), 366 .post_div_val = 0x1 << 8, 367 .post_div_mask = GENMASK(11, 8), 368 .config_ctl_val = 0x4001055b, 369 .test_ctl_hi1_val = 0x1, 370 .test_ctl_hi_mask = 0x1, 371 }; 372 373 static struct clk_alpha_pll gpll8 = { 374 .offset = 0x8000, 375 .vco_table = default_vco, 376 .num_vco = ARRAY_SIZE(default_vco), 377 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 378 .flags = SUPPORTS_DYNAMIC_UPDATE, 379 .clkr = { 380 .enable_reg = 0x79000, 381 .enable_mask = BIT(8), 382 .hw.init = &(struct clk_init_data){ 383 .name = "gpll8", 384 .parent_data = &(const struct clk_parent_data){ 385 .fw_name = "bi_tcxo", 386 }, 387 .num_parents = 1, 388 .ops = &clk_alpha_pll_ops, 389 }, 390 }, 391 }; 392 393 static const struct clk_div_table post_div_table_gpll8_out_main[] = { 394 { 0x1, 2 }, 395 { } 396 }; 397 398 static struct clk_alpha_pll_postdiv gpll8_out_main = { 399 .offset = 0x8000, 400 .post_div_shift = 8, 401 .post_div_table = post_div_table_gpll8_out_main, 402 .num_post_div = ARRAY_SIZE(post_div_table_gpll8_out_main), 403 .width = 4, 404 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], 405 .clkr.hw.init = &(struct clk_init_data){ 406 .name = "gpll8_out_main", 407 .parent_hws = (const struct clk_hw *[]){ &gpll8.clkr.hw }, 408 .num_parents = 1, 409 .flags = CLK_SET_RATE_PARENT, 410 .ops = &clk_alpha_pll_postdiv_ro_ops, 411 }, 412 }; 413 414 /* 1152MHz configuration */ 415 static const struct alpha_pll_config gpll9_config = { 416 .l = 0x3C, 417 .alpha = 0x0, 418 .post_div_val = 0x1 << 8, 419 .post_div_mask = GENMASK(9, 8), 420 .main_output_mask = BIT(0), 421 .config_ctl_val = 0x00004289, 422 .test_ctl_mask = GENMASK(31, 0), 423 .test_ctl_val = 0x08000000, 424 }; 425 426 static struct clk_alpha_pll gpll9 = { 427 .offset = 0x9000, 428 .vco_table = gpll9_vco, 429 .num_vco = ARRAY_SIZE(gpll9_vco), 430 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_BRAMMO_EVO], 431 .clkr = { 432 .enable_reg = 0x79000, 433 .enable_mask = BIT(9), 434 .hw.init = &(struct clk_init_data){ 435 .name = "gpll9", 436 .parent_data = &(const struct clk_parent_data){ 437 .fw_name = "bi_tcxo", 438 }, 439 .num_parents = 1, 440 .ops = &clk_alpha_pll_ops, 441 }, 442 }, 443 }; 444 445 static const struct clk_div_table post_div_table_gpll9_out_main[] = { 446 { 0x1, 2 }, 447 { } 448 }; 449 450 static struct clk_alpha_pll_postdiv gpll9_out_main = { 451 .offset = 0x9000, 452 .post_div_shift = 8, 453 .post_div_table = post_div_table_gpll9_out_main, 454 .num_post_div = ARRAY_SIZE(post_div_table_gpll9_out_main), 455 .width = 2, 456 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_BRAMMO_EVO], 457 .clkr.hw.init = &(struct clk_init_data){ 458 .name = "gpll9_out_main", 459 .parent_hws = (const struct clk_hw *[]){ &gpll9.clkr.hw }, 460 .num_parents = 1, 461 .flags = CLK_SET_RATE_PARENT, 462 .ops = &clk_alpha_pll_postdiv_ops, 463 }, 464 }; 465 466 static const struct parent_map gcc_parent_map_0[] = { 467 { P_BI_TCXO, 0 }, 468 { P_GPLL0_OUT_EARLY, 1 }, 469 { P_GPLL0_OUT_AUX2, 2 }, 470 }; 471 472 static const struct clk_parent_data gcc_parents_0[] = { 473 { .fw_name = "bi_tcxo" }, 474 { .hw = &gpll0.clkr.hw }, 475 { .hw = &gpll0_out_aux2.clkr.hw }, 476 }; 477 478 static const struct parent_map gcc_parent_map_1[] = { 479 { P_BI_TCXO, 0 }, 480 { P_GPLL0_OUT_EARLY, 1 }, 481 { P_GPLL0_OUT_AUX2, 2 }, 482 { P_GPLL6_OUT_MAIN, 4 }, 483 }; 484 485 static const struct clk_parent_data gcc_parents_1[] = { 486 { .fw_name = "bi_tcxo" }, 487 { .hw = &gpll0.clkr.hw }, 488 { .hw = &gpll0_out_aux2.clkr.hw }, 489 { .hw = &gpll6_out_main.clkr.hw }, 490 }; 491 492 static const struct parent_map gcc_parent_map_2[] = { 493 { P_BI_TCXO, 0 }, 494 { P_GPLL0_OUT_EARLY, 1 }, 495 { P_GPLL0_OUT_AUX2, 2 }, 496 { P_SLEEP_CLK, 5 }, 497 }; 498 499 static const struct clk_parent_data gcc_parents_2[] = { 500 { .fw_name = "bi_tcxo" }, 501 { .hw = &gpll0.clkr.hw }, 502 { .hw = &gpll0_out_aux2.clkr.hw }, 503 { .fw_name = "sleep_clk" }, 504 }; 505 506 static const struct parent_map gcc_parent_map_3[] = { 507 { P_BI_TCXO, 0 }, 508 { P_GPLL0_OUT_EARLY, 1 }, 509 { P_GPLL9_OUT_EARLY, 2 }, 510 { P_GPLL10_OUT_MAIN, 3 }, 511 { P_GPLL9_OUT_MAIN, 5 }, 512 }; 513 514 static const struct clk_parent_data gcc_parents_3[] = { 515 { .fw_name = "bi_tcxo" }, 516 { .hw = &gpll0.clkr.hw }, 517 { .hw = &gpll9.clkr.hw }, 518 { .hw = &gpll10_out_main.clkr.hw }, 519 { .hw = &gpll9_out_main.clkr.hw }, 520 }; 521 522 static const struct parent_map gcc_parent_map_4[] = { 523 { P_BI_TCXO, 0 }, 524 { P_GPLL0_OUT_EARLY, 1 }, 525 { P_GPLL0_OUT_AUX2, 2 }, 526 { P_GPLL4_OUT_MAIN, 5 }, 527 }; 528 529 static const struct clk_parent_data gcc_parents_4[] = { 530 { .fw_name = "bi_tcxo" }, 531 { .hw = &gpll0.clkr.hw }, 532 { .hw = &gpll0_out_aux2.clkr.hw }, 533 { .hw = &gpll4_out_main.clkr.hw }, 534 }; 535 536 static const struct parent_map gcc_parent_map_5[] = { 537 { P_BI_TCXO, 0 }, 538 { P_GPLL0_OUT_EARLY, 1 }, 539 { P_GPLL8_OUT_EARLY, 2 }, 540 { P_GPLL10_OUT_MAIN, 3 }, 541 { P_GPLL8_OUT_MAIN, 4 }, 542 { P_GPLL9_OUT_MAIN, 5 }, 543 }; 544 545 static const struct clk_parent_data gcc_parents_5[] = { 546 { .fw_name = "bi_tcxo" }, 547 { .hw = &gpll0.clkr.hw }, 548 { .hw = &gpll8.clkr.hw }, 549 { .hw = &gpll10_out_main.clkr.hw }, 550 { .hw = &gpll8_out_main.clkr.hw }, 551 { .hw = &gpll9_out_main.clkr.hw }, 552 }; 553 554 static const struct parent_map gcc_parent_map_6[] = { 555 { P_BI_TCXO, 0 }, 556 { P_GPLL0_OUT_EARLY, 1 }, 557 { P_GPLL8_OUT_EARLY, 2 }, 558 { P_GPLL10_OUT_MAIN, 3 }, 559 { P_GPLL6_OUT_MAIN, 4 }, 560 { P_GPLL9_OUT_MAIN, 5 }, 561 { P_GPLL3_OUT_EARLY, 6 }, 562 }; 563 564 static const struct clk_parent_data gcc_parents_6[] = { 565 { .fw_name = "bi_tcxo" }, 566 { .hw = &gpll0.clkr.hw }, 567 { .hw = &gpll8.clkr.hw }, 568 { .hw = &gpll10_out_main.clkr.hw }, 569 { .hw = &gpll6_out_main.clkr.hw }, 570 { .hw = &gpll9_out_main.clkr.hw }, 571 { .hw = &gpll3.clkr.hw }, 572 }; 573 574 static const struct parent_map gcc_parent_map_7[] = { 575 { P_BI_TCXO, 0 }, 576 { P_GPLL0_OUT_EARLY, 1 }, 577 { P_GPLL0_OUT_AUX2, 2 }, 578 { P_GPLL10_OUT_MAIN, 3 }, 579 { P_GPLL4_OUT_MAIN, 5 }, 580 { P_GPLL3_OUT_EARLY, 6 }, 581 }; 582 583 static const struct clk_parent_data gcc_parents_7[] = { 584 { .fw_name = "bi_tcxo" }, 585 { .hw = &gpll0.clkr.hw }, 586 { .hw = &gpll0_out_aux2.clkr.hw }, 587 { .hw = &gpll10_out_main.clkr.hw }, 588 { .hw = &gpll4_out_main.clkr.hw }, 589 { .hw = &gpll3.clkr.hw }, 590 }; 591 592 static const struct parent_map gcc_parent_map_8[] = { 593 { P_BI_TCXO, 0 }, 594 { P_GPLL0_OUT_EARLY, 1 }, 595 { P_GPLL8_OUT_EARLY, 2 }, 596 { P_GPLL10_OUT_MAIN, 3 }, 597 { P_GPLL8_OUT_MAIN, 4 }, 598 { P_GPLL9_OUT_MAIN, 5 }, 599 { P_GPLL3_OUT_EARLY, 6 }, 600 }; 601 602 static const struct clk_parent_data gcc_parents_8[] = { 603 { .fw_name = "bi_tcxo" }, 604 { .hw = &gpll0.clkr.hw }, 605 { .hw = &gpll8.clkr.hw }, 606 { .hw = &gpll10_out_main.clkr.hw }, 607 { .hw = &gpll8_out_main.clkr.hw }, 608 { .hw = &gpll9_out_main.clkr.hw }, 609 { .hw = &gpll3.clkr.hw }, 610 }; 611 612 static const struct parent_map gcc_parent_map_9[] = { 613 { P_BI_TCXO, 0 }, 614 { P_GPLL0_OUT_EARLY, 1 }, 615 { P_GPLL0_OUT_AUX2, 2 }, 616 { P_GPLL10_OUT_MAIN, 3 }, 617 { P_GPLL8_OUT_MAIN, 4 }, 618 { P_GPLL9_OUT_MAIN, 5 }, 619 { P_GPLL3_OUT_EARLY, 6 }, 620 }; 621 622 static const struct clk_parent_data gcc_parents_9[] = { 623 { .fw_name = "bi_tcxo" }, 624 { .hw = &gpll0.clkr.hw }, 625 { .hw = &gpll0_out_aux2.clkr.hw }, 626 { .hw = &gpll10_out_main.clkr.hw }, 627 { .hw = &gpll8_out_main.clkr.hw }, 628 { .hw = &gpll9_out_main.clkr.hw }, 629 { .hw = &gpll3.clkr.hw }, 630 }; 631 632 static const struct parent_map gcc_parent_map_10[] = { 633 { P_BI_TCXO, 0 }, 634 { P_GPLL0_OUT_EARLY, 1 }, 635 { P_GPLL8_OUT_EARLY, 2 }, 636 { P_GPLL10_OUT_MAIN, 3 }, 637 { P_GPLL6_OUT_EARLY, 4 }, 638 { P_GPLL9_OUT_MAIN, 5 }, 639 }; 640 641 static const struct clk_parent_data gcc_parents_10[] = { 642 { .fw_name = "bi_tcxo" }, 643 { .hw = &gpll0.clkr.hw }, 644 { .hw = &gpll8.clkr.hw }, 645 { .hw = &gpll10_out_main.clkr.hw }, 646 { .hw = &gpll6.clkr.hw }, 647 { .hw = &gpll9_out_main.clkr.hw }, 648 }; 649 650 static const struct parent_map gcc_parent_map_11[] = { 651 { P_BI_TCXO, 0 }, 652 { P_GPLL0_OUT_EARLY, 1 }, 653 { P_GPLL0_OUT_AUX2, 2 }, 654 { P_GPLL7_OUT_MAIN, 3 }, 655 { P_GPLL4_OUT_MAIN, 5 }, 656 }; 657 658 static const struct clk_parent_data gcc_parents_11[] = { 659 { .fw_name = "bi_tcxo" }, 660 { .hw = &gpll0.clkr.hw }, 661 { .hw = &gpll0_out_aux2.clkr.hw }, 662 { .hw = &gpll7_out_main.clkr.hw }, 663 { .hw = &gpll4_out_main.clkr.hw }, 664 }; 665 666 static const struct parent_map gcc_parent_map_12[] = { 667 { P_BI_TCXO, 0 }, 668 { P_SLEEP_CLK, 5 }, 669 }; 670 671 static const struct clk_parent_data gcc_parents_12[] = { 672 { .fw_name = "bi_tcxo" }, 673 { .fw_name = "sleep_clk" }, 674 }; 675 676 static const struct parent_map gcc_parent_map_13[] = { 677 { P_BI_TCXO, 0 }, 678 { P_GPLL11_OUT_MAIN, 1 }, 679 }; 680 681 static const struct clk_parent_data gcc_parents_13[] = { 682 { .fw_name = "bi_tcxo" }, 683 { .hw = &gpll11_out_main.clkr.hw }, 684 }; 685 686 static const struct freq_tbl ftbl_gcc_camss_axi_clk_src[] = { 687 F(19200000, P_BI_TCXO, 1, 0, 0), 688 F(150000000, P_GPLL0_OUT_AUX2, 2, 0, 0), 689 F(200000000, P_GPLL0_OUT_AUX2, 1.5, 0, 0), 690 F(300000000, P_GPLL0_OUT_AUX2, 1, 0, 0), 691 { } 692 }; 693 694 static struct clk_rcg2 gcc_camss_axi_clk_src = { 695 .cmd_rcgr = 0x5802c, 696 .mnd_width = 0, 697 .hid_width = 5, 698 .parent_map = gcc_parent_map_7, 699 .freq_tbl = ftbl_gcc_camss_axi_clk_src, 700 .clkr.hw.init = &(struct clk_init_data){ 701 .name = "gcc_camss_axi_clk_src", 702 .parent_data = gcc_parents_7, 703 .num_parents = ARRAY_SIZE(gcc_parents_7), 704 .flags = CLK_SET_RATE_PARENT, 705 .ops = &clk_rcg2_shared_ops, 706 }, 707 }; 708 709 static const struct freq_tbl ftbl_gcc_camss_cci_clk_src[] = { 710 F(19200000, P_BI_TCXO, 1, 0, 0), 711 F(37500000, P_GPLL0_OUT_AUX2, 8, 0, 0), 712 { } 713 }; 714 715 static struct clk_rcg2 gcc_camss_cci_clk_src = { 716 .cmd_rcgr = 0x56000, 717 .mnd_width = 0, 718 .hid_width = 5, 719 .parent_map = gcc_parent_map_9, 720 .freq_tbl = ftbl_gcc_camss_cci_clk_src, 721 .clkr.hw.init = &(struct clk_init_data){ 722 .name = "gcc_camss_cci_clk_src", 723 .parent_data = gcc_parents_9, 724 .num_parents = ARRAY_SIZE(gcc_parents_9), 725 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 726 .ops = &clk_rcg2_shared_ops, 727 }, 728 }; 729 730 static const struct freq_tbl ftbl_gcc_camss_csi0phytimer_clk_src[] = { 731 F(19200000, P_BI_TCXO, 1, 0, 0), 732 F(100000000, P_GPLL0_OUT_AUX2, 3, 0, 0), 733 F(200000000, P_GPLL0_OUT_AUX2, 1.5, 0, 0), 734 F(268800000, P_GPLL4_OUT_MAIN, 3, 0, 0), 735 { } 736 }; 737 738 static struct clk_rcg2 gcc_camss_csi0phytimer_clk_src = { 739 .cmd_rcgr = 0x59000, 740 .mnd_width = 0, 741 .hid_width = 5, 742 .parent_map = gcc_parent_map_4, 743 .freq_tbl = ftbl_gcc_camss_csi0phytimer_clk_src, 744 .clkr.hw.init = &(struct clk_init_data){ 745 .name = "gcc_camss_csi0phytimer_clk_src", 746 .parent_data = gcc_parents_4, 747 .num_parents = ARRAY_SIZE(gcc_parents_4), 748 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 749 .ops = &clk_rcg2_shared_ops, 750 }, 751 }; 752 753 static struct clk_rcg2 gcc_camss_csi1phytimer_clk_src = { 754 .cmd_rcgr = 0x5901c, 755 .mnd_width = 0, 756 .hid_width = 5, 757 .parent_map = gcc_parent_map_4, 758 .freq_tbl = ftbl_gcc_camss_csi0phytimer_clk_src, 759 .clkr.hw.init = &(struct clk_init_data){ 760 .name = "gcc_camss_csi1phytimer_clk_src", 761 .parent_data = gcc_parents_4, 762 .num_parents = ARRAY_SIZE(gcc_parents_4), 763 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 764 .ops = &clk_rcg2_shared_ops, 765 }, 766 }; 767 768 static struct clk_rcg2 gcc_camss_csi2phytimer_clk_src = { 769 .cmd_rcgr = 0x59038, 770 .mnd_width = 0, 771 .hid_width = 5, 772 .parent_map = gcc_parent_map_4, 773 .freq_tbl = ftbl_gcc_camss_csi0phytimer_clk_src, 774 .clkr.hw.init = &(struct clk_init_data){ 775 .name = "gcc_camss_csi2phytimer_clk_src", 776 .parent_data = gcc_parents_4, 777 .num_parents = ARRAY_SIZE(gcc_parents_4), 778 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 779 .ops = &clk_rcg2_shared_ops, 780 }, 781 }; 782 783 static const struct freq_tbl ftbl_gcc_camss_mclk0_clk_src[] = { 784 F(19200000, P_BI_TCXO, 1, 0, 0), 785 F(24000000, P_GPLL9_OUT_MAIN, 1, 1, 24), 786 F(64000000, P_GPLL9_OUT_MAIN, 1, 1, 9), 787 { } 788 }; 789 790 static struct clk_rcg2 gcc_camss_mclk0_clk_src = { 791 .cmd_rcgr = 0x51000, 792 .mnd_width = 8, 793 .hid_width = 5, 794 .parent_map = gcc_parent_map_3, 795 .freq_tbl = ftbl_gcc_camss_mclk0_clk_src, 796 .clkr.hw.init = &(struct clk_init_data){ 797 .name = "gcc_camss_mclk0_clk_src", 798 .parent_data = gcc_parents_3, 799 .num_parents = ARRAY_SIZE(gcc_parents_3), 800 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 801 .ops = &clk_rcg2_shared_ops, 802 }, 803 }; 804 805 static struct clk_rcg2 gcc_camss_mclk1_clk_src = { 806 .cmd_rcgr = 0x5101c, 807 .mnd_width = 8, 808 .hid_width = 5, 809 .parent_map = gcc_parent_map_3, 810 .freq_tbl = ftbl_gcc_camss_mclk0_clk_src, 811 .clkr.hw.init = &(struct clk_init_data){ 812 .name = "gcc_camss_mclk1_clk_src", 813 .parent_data = gcc_parents_3, 814 .num_parents = ARRAY_SIZE(gcc_parents_3), 815 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 816 .ops = &clk_rcg2_shared_ops, 817 }, 818 }; 819 820 static struct clk_rcg2 gcc_camss_mclk2_clk_src = { 821 .cmd_rcgr = 0x51038, 822 .mnd_width = 8, 823 .hid_width = 5, 824 .parent_map = gcc_parent_map_3, 825 .freq_tbl = ftbl_gcc_camss_mclk0_clk_src, 826 .clkr.hw.init = &(struct clk_init_data){ 827 .name = "gcc_camss_mclk2_clk_src", 828 .parent_data = gcc_parents_3, 829 .num_parents = ARRAY_SIZE(gcc_parents_3), 830 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 831 .ops = &clk_rcg2_shared_ops, 832 }, 833 }; 834 835 static struct clk_rcg2 gcc_camss_mclk3_clk_src = { 836 .cmd_rcgr = 0x51054, 837 .mnd_width = 8, 838 .hid_width = 5, 839 .parent_map = gcc_parent_map_3, 840 .freq_tbl = ftbl_gcc_camss_mclk0_clk_src, 841 .clkr.hw.init = &(struct clk_init_data){ 842 .name = "gcc_camss_mclk3_clk_src", 843 .parent_data = gcc_parents_3, 844 .num_parents = ARRAY_SIZE(gcc_parents_3), 845 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 846 .ops = &clk_rcg2_shared_ops, 847 }, 848 }; 849 850 static const struct freq_tbl ftbl_gcc_camss_ope_ahb_clk_src[] = { 851 F(19200000, P_BI_TCXO, 1, 0, 0), 852 F(171428571, P_GPLL0_OUT_EARLY, 3.5, 0, 0), 853 F(240000000, P_GPLL0_OUT_EARLY, 2.5, 0, 0), 854 { } 855 }; 856 857 static struct clk_rcg2 gcc_camss_ope_ahb_clk_src = { 858 .cmd_rcgr = 0x55024, 859 .mnd_width = 0, 860 .hid_width = 5, 861 .parent_map = gcc_parent_map_8, 862 .freq_tbl = ftbl_gcc_camss_ope_ahb_clk_src, 863 .clkr.hw.init = &(struct clk_init_data){ 864 .name = "gcc_camss_ope_ahb_clk_src", 865 .parent_data = gcc_parents_8, 866 .num_parents = ARRAY_SIZE(gcc_parents_8), 867 .flags = CLK_SET_RATE_PARENT, 868 .ops = &clk_rcg2_shared_ops, 869 }, 870 }; 871 872 static const struct freq_tbl ftbl_gcc_camss_ope_clk_src[] = { 873 F(19200000, P_BI_TCXO, 1, 0, 0), 874 F(200000000, P_GPLL8_OUT_MAIN, 2, 0, 0), 875 F(266600000, P_GPLL8_OUT_MAIN, 1, 0, 0), 876 F(465000000, P_GPLL8_OUT_MAIN, 1, 0, 0), 877 F(576000000, P_GPLL9_OUT_MAIN, 1, 0, 0), 878 { } 879 }; 880 881 static struct clk_rcg2 gcc_camss_ope_clk_src = { 882 .cmd_rcgr = 0x55004, 883 .mnd_width = 0, 884 .hid_width = 5, 885 .parent_map = gcc_parent_map_8, 886 .freq_tbl = ftbl_gcc_camss_ope_clk_src, 887 .clkr.hw.init = &(struct clk_init_data){ 888 .name = "gcc_camss_ope_clk_src", 889 .parent_data = gcc_parents_8, 890 .num_parents = ARRAY_SIZE(gcc_parents_8), 891 .flags = CLK_SET_RATE_PARENT, 892 .ops = &clk_rcg2_shared_ops, 893 }, 894 }; 895 896 static const struct freq_tbl ftbl_gcc_camss_tfe_0_clk_src[] = { 897 F(19200000, P_BI_TCXO, 1, 0, 0), 898 F(128000000, P_GPLL10_OUT_MAIN, 9, 0, 0), 899 F(135529412, P_GPLL10_OUT_MAIN, 8.5, 0, 0), 900 F(144000000, P_GPLL10_OUT_MAIN, 8, 0, 0), 901 F(153600000, P_GPLL10_OUT_MAIN, 7.5, 0, 0), 902 F(164571429, P_GPLL10_OUT_MAIN, 7, 0, 0), 903 F(177230769, P_GPLL10_OUT_MAIN, 6.5, 0, 0), 904 F(192000000, P_GPLL10_OUT_MAIN, 6, 0, 0), 905 F(209454545, P_GPLL10_OUT_MAIN, 5.5, 0, 0), 906 F(230400000, P_GPLL10_OUT_MAIN, 5, 0, 0), 907 F(256000000, P_GPLL10_OUT_MAIN, 4.5, 0, 0), 908 F(288000000, P_GPLL10_OUT_MAIN, 4, 0, 0), 909 F(329142857, P_GPLL10_OUT_MAIN, 3.5, 0, 0), 910 F(384000000, P_GPLL10_OUT_MAIN, 3, 0, 0), 911 F(460800000, P_GPLL10_OUT_MAIN, 2.5, 0, 0), 912 F(576000000, P_GPLL10_OUT_MAIN, 2, 0, 0), 913 { } 914 }; 915 916 static struct clk_rcg2 gcc_camss_tfe_0_clk_src = { 917 .cmd_rcgr = 0x52004, 918 .mnd_width = 8, 919 .hid_width = 5, 920 .parent_map = gcc_parent_map_5, 921 .freq_tbl = ftbl_gcc_camss_tfe_0_clk_src, 922 .clkr.hw.init = &(struct clk_init_data){ 923 .name = "gcc_camss_tfe_0_clk_src", 924 .parent_data = gcc_parents_5, 925 .num_parents = ARRAY_SIZE(gcc_parents_5), 926 .flags = CLK_SET_RATE_PARENT, 927 .ops = &clk_rcg2_shared_ops, 928 }, 929 }; 930 931 static const struct freq_tbl ftbl_gcc_camss_tfe_0_csid_clk_src[] = { 932 F(19200000, P_BI_TCXO, 1, 0, 0), 933 F(120000000, P_GPLL0_OUT_EARLY, 5, 0, 0), 934 F(192000000, P_GPLL6_OUT_MAIN, 2, 0, 0), 935 F(240000000, P_GPLL0_OUT_EARLY, 2.5, 0, 0), 936 F(384000000, P_GPLL6_OUT_MAIN, 1, 0, 0), 937 F(426400000, P_GPLL3_OUT_EARLY, 2.5, 0, 0), 938 { } 939 }; 940 941 static struct clk_rcg2 gcc_camss_tfe_0_csid_clk_src = { 942 .cmd_rcgr = 0x52094, 943 .mnd_width = 0, 944 .hid_width = 5, 945 .parent_map = gcc_parent_map_6, 946 .freq_tbl = ftbl_gcc_camss_tfe_0_csid_clk_src, 947 .clkr.hw.init = &(struct clk_init_data){ 948 .name = "gcc_camss_tfe_0_csid_clk_src", 949 .parent_data = gcc_parents_6, 950 .num_parents = ARRAY_SIZE(gcc_parents_6), 951 .flags = CLK_SET_RATE_PARENT, 952 .ops = &clk_rcg2_shared_ops, 953 }, 954 }; 955 956 static struct clk_rcg2 gcc_camss_tfe_1_clk_src = { 957 .cmd_rcgr = 0x52024, 958 .mnd_width = 8, 959 .hid_width = 5, 960 .parent_map = gcc_parent_map_5, 961 .freq_tbl = ftbl_gcc_camss_tfe_0_clk_src, 962 .clkr.hw.init = &(struct clk_init_data){ 963 .name = "gcc_camss_tfe_1_clk_src", 964 .parent_data = gcc_parents_5, 965 .num_parents = ARRAY_SIZE(gcc_parents_5), 966 .flags = CLK_SET_RATE_PARENT, 967 .ops = &clk_rcg2_shared_ops, 968 }, 969 }; 970 971 static struct clk_rcg2 gcc_camss_tfe_1_csid_clk_src = { 972 .cmd_rcgr = 0x520b4, 973 .mnd_width = 0, 974 .hid_width = 5, 975 .parent_map = gcc_parent_map_6, 976 .freq_tbl = ftbl_gcc_camss_tfe_0_csid_clk_src, 977 .clkr.hw.init = &(struct clk_init_data){ 978 .name = "gcc_camss_tfe_1_csid_clk_src", 979 .parent_data = gcc_parents_6, 980 .num_parents = ARRAY_SIZE(gcc_parents_6), 981 .flags = CLK_SET_RATE_PARENT, 982 .ops = &clk_rcg2_shared_ops, 983 }, 984 }; 985 986 static struct clk_rcg2 gcc_camss_tfe_2_clk_src = { 987 .cmd_rcgr = 0x52044, 988 .mnd_width = 8, 989 .hid_width = 5, 990 .parent_map = gcc_parent_map_5, 991 .freq_tbl = ftbl_gcc_camss_tfe_0_clk_src, 992 .clkr.hw.init = &(struct clk_init_data){ 993 .name = "gcc_camss_tfe_2_clk_src", 994 .parent_data = gcc_parents_5, 995 .num_parents = ARRAY_SIZE(gcc_parents_5), 996 .flags = CLK_SET_RATE_PARENT, 997 .ops = &clk_rcg2_shared_ops, 998 }, 999 }; 1000 1001 static struct clk_rcg2 gcc_camss_tfe_2_csid_clk_src = { 1002 .cmd_rcgr = 0x520d4, 1003 .mnd_width = 0, 1004 .hid_width = 5, 1005 .parent_map = gcc_parent_map_6, 1006 .freq_tbl = ftbl_gcc_camss_tfe_0_csid_clk_src, 1007 .clkr.hw.init = &(struct clk_init_data){ 1008 .name = "gcc_camss_tfe_2_csid_clk_src", 1009 .parent_data = gcc_parents_6, 1010 .num_parents = ARRAY_SIZE(gcc_parents_6), 1011 .flags = CLK_SET_RATE_PARENT, 1012 .ops = &clk_rcg2_shared_ops, 1013 }, 1014 }; 1015 1016 static const struct freq_tbl ftbl_gcc_camss_tfe_cphy_rx_clk_src[] = { 1017 F(19200000, P_BI_TCXO, 1, 0, 0), 1018 F(240000000, P_GPLL0_OUT_EARLY, 2.5, 0, 0), 1019 F(341333333, P_GPLL6_OUT_EARLY, 1, 4, 9), 1020 F(384000000, P_GPLL6_OUT_EARLY, 2, 0, 0), 1021 { } 1022 }; 1023 1024 static struct clk_rcg2 gcc_camss_tfe_cphy_rx_clk_src = { 1025 .cmd_rcgr = 0x52064, 1026 .mnd_width = 16, 1027 .hid_width = 5, 1028 .parent_map = gcc_parent_map_10, 1029 .freq_tbl = ftbl_gcc_camss_tfe_cphy_rx_clk_src, 1030 .clkr.hw.init = &(struct clk_init_data){ 1031 .name = "gcc_camss_tfe_cphy_rx_clk_src", 1032 .parent_data = gcc_parents_10, 1033 .num_parents = ARRAY_SIZE(gcc_parents_10), 1034 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 1035 .ops = &clk_rcg2_shared_ops, 1036 }, 1037 }; 1038 1039 static const struct freq_tbl ftbl_gcc_camss_top_ahb_clk_src[] = { 1040 F(19200000, P_BI_TCXO, 1, 0, 0), 1041 F(40000000, P_GPLL0_OUT_AUX2, 7.5, 0, 0), 1042 F(80000000, P_GPLL0_OUT_EARLY, 7.5, 0, 0), 1043 { } 1044 }; 1045 1046 static struct clk_rcg2 gcc_camss_top_ahb_clk_src = { 1047 .cmd_rcgr = 0x58010, 1048 .mnd_width = 0, 1049 .hid_width = 5, 1050 .parent_map = gcc_parent_map_7, 1051 .freq_tbl = ftbl_gcc_camss_top_ahb_clk_src, 1052 .clkr.hw.init = &(struct clk_init_data){ 1053 .name = "gcc_camss_top_ahb_clk_src", 1054 .parent_data = gcc_parents_7, 1055 .num_parents = ARRAY_SIZE(gcc_parents_7), 1056 .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, 1057 .ops = &clk_rcg2_shared_ops, 1058 }, 1059 }; 1060 1061 static const struct freq_tbl ftbl_gcc_gp1_clk_src[] = { 1062 F(25000000, P_GPLL0_OUT_AUX2, 12, 0, 0), 1063 F(50000000, P_GPLL0_OUT_AUX2, 6, 0, 0), 1064 F(100000000, P_GPLL0_OUT_AUX2, 3, 0, 0), 1065 F(200000000, P_GPLL0_OUT_AUX2, 1.5, 0, 0), 1066 { } 1067 }; 1068 1069 static struct clk_rcg2 gcc_gp1_clk_src = { 1070 .cmd_rcgr = 0x4d004, 1071 .mnd_width = 8, 1072 .hid_width = 5, 1073 .parent_map = gcc_parent_map_2, 1074 .freq_tbl = ftbl_gcc_gp1_clk_src, 1075 .clkr.hw.init = &(struct clk_init_data){ 1076 .name = "gcc_gp1_clk_src", 1077 .parent_data = gcc_parents_2, 1078 .num_parents = ARRAY_SIZE(gcc_parents_2), 1079 .ops = &clk_rcg2_ops, 1080 }, 1081 }; 1082 1083 static struct clk_rcg2 gcc_gp2_clk_src = { 1084 .cmd_rcgr = 0x4e004, 1085 .mnd_width = 8, 1086 .hid_width = 5, 1087 .parent_map = gcc_parent_map_2, 1088 .freq_tbl = ftbl_gcc_gp1_clk_src, 1089 .clkr.hw.init = &(struct clk_init_data){ 1090 .name = "gcc_gp2_clk_src", 1091 .parent_data = gcc_parents_2, 1092 .num_parents = ARRAY_SIZE(gcc_parents_2), 1093 .ops = &clk_rcg2_ops, 1094 }, 1095 }; 1096 1097 static struct clk_rcg2 gcc_gp3_clk_src = { 1098 .cmd_rcgr = 0x4f004, 1099 .mnd_width = 8, 1100 .hid_width = 5, 1101 .parent_map = gcc_parent_map_2, 1102 .freq_tbl = ftbl_gcc_gp1_clk_src, 1103 .clkr.hw.init = &(struct clk_init_data){ 1104 .name = "gcc_gp3_clk_src", 1105 .parent_data = gcc_parents_2, 1106 .num_parents = ARRAY_SIZE(gcc_parents_2), 1107 .ops = &clk_rcg2_ops, 1108 }, 1109 }; 1110 1111 static const struct freq_tbl ftbl_gcc_pdm2_clk_src[] = { 1112 F(19200000, P_BI_TCXO, 1, 0, 0), 1113 F(60000000, P_GPLL0_OUT_AUX2, 5, 0, 0), 1114 { } 1115 }; 1116 1117 static struct clk_rcg2 gcc_pdm2_clk_src = { 1118 .cmd_rcgr = 0x20010, 1119 .mnd_width = 0, 1120 .hid_width = 5, 1121 .parent_map = gcc_parent_map_0, 1122 .freq_tbl = ftbl_gcc_pdm2_clk_src, 1123 .clkr.hw.init = &(struct clk_init_data){ 1124 .name = "gcc_pdm2_clk_src", 1125 .parent_data = gcc_parents_0, 1126 .num_parents = ARRAY_SIZE(gcc_parents_0), 1127 .ops = &clk_rcg2_shared_ops, 1128 }, 1129 }; 1130 1131 static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = { 1132 F(7372800, P_GPLL0_OUT_AUX2, 1, 384, 15625), 1133 F(14745600, P_GPLL0_OUT_AUX2, 1, 768, 15625), 1134 F(19200000, P_BI_TCXO, 1, 0, 0), 1135 F(29491200, P_GPLL0_OUT_AUX2, 1, 1536, 15625), 1136 F(32000000, P_GPLL0_OUT_AUX2, 1, 8, 75), 1137 F(48000000, P_GPLL0_OUT_AUX2, 1, 4, 25), 1138 F(64000000, P_GPLL0_OUT_AUX2, 1, 16, 75), 1139 F(75000000, P_GPLL0_OUT_AUX2, 4, 0, 0), 1140 F(80000000, P_GPLL0_OUT_AUX2, 1, 4, 15), 1141 F(96000000, P_GPLL0_OUT_AUX2, 1, 8, 25), 1142 F(100000000, P_GPLL0_OUT_AUX2, 3, 0, 0), 1143 F(102400000, P_GPLL0_OUT_AUX2, 1, 128, 375), 1144 F(112000000, P_GPLL0_OUT_AUX2, 1, 28, 75), 1145 F(117964800, P_GPLL0_OUT_AUX2, 1, 6144, 15625), 1146 F(120000000, P_GPLL0_OUT_AUX2, 2.5, 0, 0), 1147 F(128000000, P_GPLL6_OUT_MAIN, 3, 0, 0), 1148 { } 1149 }; 1150 1151 static struct clk_init_data gcc_qupv3_wrap0_s0_clk_src_init = { 1152 .name = "gcc_qupv3_wrap0_s0_clk_src", 1153 .parent_data = gcc_parents_1, 1154 .num_parents = ARRAY_SIZE(gcc_parents_1), 1155 .ops = &clk_rcg2_ops, 1156 }; 1157 1158 static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = { 1159 .cmd_rcgr = 0x1f148, 1160 .mnd_width = 16, 1161 .hid_width = 5, 1162 .parent_map = gcc_parent_map_1, 1163 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 1164 .clkr.hw.init = &gcc_qupv3_wrap0_s0_clk_src_init, 1165 }; 1166 1167 static struct clk_init_data gcc_qupv3_wrap0_s1_clk_src_init = { 1168 .name = "gcc_qupv3_wrap0_s1_clk_src", 1169 .parent_data = gcc_parents_1, 1170 .num_parents = ARRAY_SIZE(gcc_parents_1), 1171 .ops = &clk_rcg2_ops, 1172 }; 1173 1174 static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = { 1175 .cmd_rcgr = 0x1f278, 1176 .mnd_width = 16, 1177 .hid_width = 5, 1178 .parent_map = gcc_parent_map_1, 1179 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 1180 .clkr.hw.init = &gcc_qupv3_wrap0_s1_clk_src_init, 1181 }; 1182 1183 static struct clk_init_data gcc_qupv3_wrap0_s2_clk_src_init = { 1184 .name = "gcc_qupv3_wrap0_s2_clk_src", 1185 .parent_data = gcc_parents_1, 1186 .num_parents = ARRAY_SIZE(gcc_parents_1), 1187 .ops = &clk_rcg2_ops, 1188 }; 1189 1190 static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = { 1191 .cmd_rcgr = 0x1f3a8, 1192 .mnd_width = 16, 1193 .hid_width = 5, 1194 .parent_map = gcc_parent_map_1, 1195 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 1196 .clkr.hw.init = &gcc_qupv3_wrap0_s2_clk_src_init, 1197 }; 1198 1199 static struct clk_init_data gcc_qupv3_wrap0_s3_clk_src_init = { 1200 .name = "gcc_qupv3_wrap0_s3_clk_src", 1201 .parent_data = gcc_parents_1, 1202 .num_parents = ARRAY_SIZE(gcc_parents_1), 1203 .ops = &clk_rcg2_ops, 1204 }; 1205 1206 static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = { 1207 .cmd_rcgr = 0x1f4d8, 1208 .mnd_width = 16, 1209 .hid_width = 5, 1210 .parent_map = gcc_parent_map_1, 1211 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 1212 .clkr.hw.init = &gcc_qupv3_wrap0_s3_clk_src_init, 1213 }; 1214 1215 static struct clk_init_data gcc_qupv3_wrap0_s4_clk_src_init = { 1216 .name = "gcc_qupv3_wrap0_s4_clk_src", 1217 .parent_data = gcc_parents_1, 1218 .num_parents = ARRAY_SIZE(gcc_parents_1), 1219 .ops = &clk_rcg2_ops, 1220 }; 1221 1222 static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = { 1223 .cmd_rcgr = 0x1f608, 1224 .mnd_width = 16, 1225 .hid_width = 5, 1226 .parent_map = gcc_parent_map_1, 1227 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 1228 .clkr.hw.init = &gcc_qupv3_wrap0_s4_clk_src_init, 1229 }; 1230 1231 static struct clk_init_data gcc_qupv3_wrap0_s5_clk_src_init = { 1232 .name = "gcc_qupv3_wrap0_s5_clk_src", 1233 .parent_data = gcc_parents_1, 1234 .num_parents = ARRAY_SIZE(gcc_parents_1), 1235 .ops = &clk_rcg2_ops, 1236 }; 1237 1238 static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = { 1239 .cmd_rcgr = 0x1f738, 1240 .mnd_width = 16, 1241 .hid_width = 5, 1242 .parent_map = gcc_parent_map_1, 1243 .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src, 1244 .clkr.hw.init = &gcc_qupv3_wrap0_s5_clk_src_init, 1245 }; 1246 1247 static const struct freq_tbl ftbl_gcc_sdcc1_apps_clk_src[] = { 1248 F(144000, P_BI_TCXO, 16, 3, 25), 1249 F(400000, P_BI_TCXO, 12, 1, 4), 1250 F(20000000, P_GPLL0_OUT_AUX2, 5, 1, 3), 1251 F(25000000, P_GPLL0_OUT_AUX2, 6, 1, 2), 1252 F(50000000, P_GPLL0_OUT_AUX2, 6, 0, 0), 1253 F(100000000, P_GPLL0_OUT_AUX2, 3, 0, 0), 1254 F(192000000, P_GPLL6_OUT_MAIN, 2, 0, 0), 1255 F(384000000, P_GPLL6_OUT_MAIN, 1, 0, 0), 1256 { } 1257 }; 1258 1259 static struct clk_rcg2 gcc_sdcc1_apps_clk_src = { 1260 .cmd_rcgr = 0x38028, 1261 .mnd_width = 8, 1262 .hid_width = 5, 1263 .parent_map = gcc_parent_map_1, 1264 .freq_tbl = ftbl_gcc_sdcc1_apps_clk_src, 1265 .clkr.hw.init = &(struct clk_init_data){ 1266 .name = "gcc_sdcc1_apps_clk_src", 1267 .parent_data = gcc_parents_1, 1268 .num_parents = ARRAY_SIZE(gcc_parents_1), 1269 .ops = &clk_rcg2_floor_ops, 1270 }, 1271 }; 1272 1273 static const struct freq_tbl ftbl_gcc_sdcc1_ice_core_clk_src[] = { 1274 F(75000000, P_GPLL0_OUT_AUX2, 4, 0, 0), 1275 F(100000000, P_GPLL0_OUT_AUX2, 3, 0, 0), 1276 F(150000000, P_GPLL0_OUT_AUX2, 2, 0, 0), 1277 F(200000000, P_GPLL0_OUT_EARLY, 3, 0, 0), 1278 F(300000000, P_GPLL0_OUT_AUX2, 1, 0, 0), 1279 { } 1280 }; 1281 1282 static struct clk_rcg2 gcc_sdcc1_ice_core_clk_src = { 1283 .cmd_rcgr = 0x38010, 1284 .mnd_width = 0, 1285 .hid_width = 5, 1286 .parent_map = gcc_parent_map_0, 1287 .freq_tbl = ftbl_gcc_sdcc1_ice_core_clk_src, 1288 .clkr.hw.init = &(struct clk_init_data){ 1289 .name = "gcc_sdcc1_ice_core_clk_src", 1290 .parent_data = gcc_parents_0, 1291 .num_parents = ARRAY_SIZE(gcc_parents_0), 1292 .ops = &clk_rcg2_ops, 1293 }, 1294 }; 1295 1296 static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = { 1297 F(400000, P_BI_TCXO, 12, 1, 4), 1298 F(19200000, P_BI_TCXO, 1, 0, 0), 1299 F(25000000, P_GPLL0_OUT_AUX2, 12, 0, 0), 1300 F(50000000, P_GPLL0_OUT_AUX2, 6, 0, 0), 1301 F(100000000, P_GPLL0_OUT_AUX2, 3, 0, 0), 1302 F(200000000, P_GPLL0_OUT_EARLY, 3, 0, 0), 1303 { } 1304 }; 1305 1306 static struct clk_rcg2 gcc_sdcc2_apps_clk_src = { 1307 .cmd_rcgr = 0x1e00c, 1308 .mnd_width = 8, 1309 .hid_width = 5, 1310 .parent_map = gcc_parent_map_11, 1311 .freq_tbl = ftbl_gcc_sdcc2_apps_clk_src, 1312 .clkr.hw.init = &(struct clk_init_data){ 1313 .name = "gcc_sdcc2_apps_clk_src", 1314 .parent_data = gcc_parents_11, 1315 .num_parents = ARRAY_SIZE(gcc_parents_11), 1316 .ops = &clk_rcg2_floor_ops, 1317 .flags = CLK_OPS_PARENT_ENABLE, 1318 }, 1319 }; 1320 1321 static const struct freq_tbl ftbl_gcc_ufs_phy_axi_clk_src[] = { 1322 F(25000000, P_GPLL0_OUT_AUX2, 12, 0, 0), 1323 F(50000000, P_GPLL0_OUT_AUX2, 6, 0, 0), 1324 F(100000000, P_GPLL0_OUT_AUX2, 3, 0, 0), 1325 F(200000000, P_GPLL0_OUT_EARLY, 3, 0, 0), 1326 F(240000000, P_GPLL0_OUT_EARLY, 2.5, 0, 0), 1327 { } 1328 }; 1329 1330 static struct clk_rcg2 gcc_ufs_phy_axi_clk_src = { 1331 .cmd_rcgr = 0x45020, 1332 .mnd_width = 8, 1333 .hid_width = 5, 1334 .parent_map = gcc_parent_map_0, 1335 .freq_tbl = ftbl_gcc_ufs_phy_axi_clk_src, 1336 .clkr.hw.init = &(struct clk_init_data){ 1337 .name = "gcc_ufs_phy_axi_clk_src", 1338 .parent_data = gcc_parents_0, 1339 .num_parents = ARRAY_SIZE(gcc_parents_0), 1340 .ops = &clk_rcg2_shared_ops, 1341 }, 1342 }; 1343 1344 static const struct freq_tbl ftbl_gcc_ufs_phy_ice_core_clk_src[] = { 1345 F(37500000, P_GPLL0_OUT_AUX2, 8, 0, 0), 1346 F(75000000, P_GPLL0_OUT_AUX2, 4, 0, 0), 1347 F(150000000, P_GPLL0_OUT_AUX2, 2, 0, 0), 1348 F(300000000, P_GPLL0_OUT_AUX2, 1, 0, 0), 1349 { } 1350 }; 1351 1352 static struct clk_rcg2 gcc_ufs_phy_ice_core_clk_src = { 1353 .cmd_rcgr = 0x45048, 1354 .mnd_width = 0, 1355 .hid_width = 5, 1356 .parent_map = gcc_parent_map_0, 1357 .freq_tbl = ftbl_gcc_ufs_phy_ice_core_clk_src, 1358 .clkr.hw.init = &(struct clk_init_data){ 1359 .name = "gcc_ufs_phy_ice_core_clk_src", 1360 .parent_data = gcc_parents_0, 1361 .num_parents = ARRAY_SIZE(gcc_parents_0), 1362 .ops = &clk_rcg2_shared_ops, 1363 }, 1364 }; 1365 1366 static const struct freq_tbl ftbl_gcc_ufs_phy_phy_aux_clk_src[] = { 1367 F(9600000, P_BI_TCXO, 2, 0, 0), 1368 F(19200000, P_BI_TCXO, 1, 0, 0), 1369 { } 1370 }; 1371 1372 static struct clk_rcg2 gcc_ufs_phy_phy_aux_clk_src = { 1373 .cmd_rcgr = 0x4507c, 1374 .mnd_width = 0, 1375 .hid_width = 5, 1376 .parent_map = gcc_parent_map_0, 1377 .freq_tbl = ftbl_gcc_ufs_phy_phy_aux_clk_src, 1378 .clkr.hw.init = &(struct clk_init_data){ 1379 .name = "gcc_ufs_phy_phy_aux_clk_src", 1380 .parent_data = gcc_parents_0, 1381 .num_parents = ARRAY_SIZE(gcc_parents_0), 1382 .ops = &clk_rcg2_ops, 1383 }, 1384 }; 1385 1386 static const struct freq_tbl ftbl_gcc_ufs_phy_unipro_core_clk_src[] = { 1387 F(37500000, P_GPLL0_OUT_AUX2, 8, 0, 0), 1388 F(75000000, P_GPLL0_OUT_AUX2, 4, 0, 0), 1389 F(150000000, P_GPLL0_OUT_AUX2, 2, 0, 0), 1390 { } 1391 }; 1392 1393 static struct clk_rcg2 gcc_ufs_phy_unipro_core_clk_src = { 1394 .cmd_rcgr = 0x45060, 1395 .mnd_width = 0, 1396 .hid_width = 5, 1397 .parent_map = gcc_parent_map_0, 1398 .freq_tbl = ftbl_gcc_ufs_phy_unipro_core_clk_src, 1399 .clkr.hw.init = &(struct clk_init_data){ 1400 .name = "gcc_ufs_phy_unipro_core_clk_src", 1401 .parent_data = gcc_parents_0, 1402 .num_parents = ARRAY_SIZE(gcc_parents_0), 1403 .ops = &clk_rcg2_shared_ops, 1404 }, 1405 }; 1406 1407 static const struct freq_tbl ftbl_gcc_usb30_prim_master_clk_src[] = { 1408 F(66666667, P_GPLL0_OUT_AUX2, 4.5, 0, 0), 1409 F(133333333, P_GPLL0_OUT_EARLY, 4.5, 0, 0), 1410 F(200000000, P_GPLL0_OUT_EARLY, 3, 0, 0), 1411 F(240000000, P_GPLL0_OUT_EARLY, 2.5, 0, 0), 1412 { } 1413 }; 1414 1415 static struct clk_rcg2 gcc_usb30_prim_master_clk_src = { 1416 .cmd_rcgr = 0x1a01c, 1417 .mnd_width = 8, 1418 .hid_width = 5, 1419 .parent_map = gcc_parent_map_0, 1420 .freq_tbl = ftbl_gcc_usb30_prim_master_clk_src, 1421 .clkr.hw.init = &(struct clk_init_data){ 1422 .name = "gcc_usb30_prim_master_clk_src", 1423 .parent_data = gcc_parents_0, 1424 .num_parents = ARRAY_SIZE(gcc_parents_0), 1425 .ops = &clk_rcg2_shared_ops, 1426 }, 1427 }; 1428 1429 static const struct freq_tbl ftbl_gcc_usb30_prim_mock_utmi_clk_src[] = { 1430 F(19200000, P_BI_TCXO, 1, 0, 0), 1431 { } 1432 }; 1433 1434 static struct clk_rcg2 gcc_usb30_prim_mock_utmi_clk_src = { 1435 .cmd_rcgr = 0x1a034, 1436 .mnd_width = 0, 1437 .hid_width = 5, 1438 .parent_map = gcc_parent_map_0, 1439 .freq_tbl = ftbl_gcc_usb30_prim_mock_utmi_clk_src, 1440 .clkr.hw.init = &(struct clk_init_data){ 1441 .name = "gcc_usb30_prim_mock_utmi_clk_src", 1442 .parent_data = gcc_parents_0, 1443 .num_parents = ARRAY_SIZE(gcc_parents_0), 1444 .ops = &clk_rcg2_ops, 1445 }, 1446 }; 1447 1448 static struct clk_regmap_div gcc_usb30_prim_mock_utmi_postdiv_clk_src = { 1449 .reg = 0x1a04c, 1450 .shift = 0, 1451 .width = 2, 1452 .clkr.hw.init = &(struct clk_init_data) { 1453 .name = "gcc_usb30_prim_mock_utmi_postdiv_clk_src", 1454 .parent_hws = (const struct clk_hw *[]) { 1455 &gcc_usb30_prim_mock_utmi_clk_src.clkr.hw }, 1456 .num_parents = 1, 1457 .ops = &clk_regmap_div_ro_ops, 1458 }, 1459 }; 1460 1461 static struct clk_rcg2 gcc_usb3_prim_phy_aux_clk_src = { 1462 .cmd_rcgr = 0x1a060, 1463 .mnd_width = 0, 1464 .hid_width = 5, 1465 .parent_map = gcc_parent_map_12, 1466 .freq_tbl = ftbl_gcc_usb30_prim_mock_utmi_clk_src, 1467 .clkr.hw.init = &(struct clk_init_data){ 1468 .name = "gcc_usb3_prim_phy_aux_clk_src", 1469 .parent_data = gcc_parents_12, 1470 .num_parents = ARRAY_SIZE(gcc_parents_12), 1471 .ops = &clk_rcg2_ops, 1472 }, 1473 }; 1474 1475 static const struct freq_tbl ftbl_gcc_video_venus_clk_src[] = { 1476 F(133333333, P_GPLL11_OUT_MAIN, 4.5, 0, 0), 1477 F(240000000, P_GPLL11_OUT_MAIN, 2.5, 0, 0), 1478 F(300000000, P_GPLL11_OUT_MAIN, 2, 0, 0), 1479 F(384000000, P_GPLL11_OUT_MAIN, 2, 0, 0), 1480 { } 1481 }; 1482 1483 static struct clk_rcg2 gcc_video_venus_clk_src = { 1484 .cmd_rcgr = 0x58060, 1485 .mnd_width = 0, 1486 .hid_width = 5, 1487 .parent_map = gcc_parent_map_13, 1488 .freq_tbl = ftbl_gcc_video_venus_clk_src, 1489 .clkr.hw.init = &(struct clk_init_data){ 1490 .name = "gcc_video_venus_clk_src", 1491 .parent_data = gcc_parents_13, 1492 .num_parents = ARRAY_SIZE(gcc_parents_13), 1493 .flags = CLK_SET_RATE_PARENT, 1494 .ops = &clk_rcg2_shared_ops, 1495 }, 1496 }; 1497 1498 static struct clk_branch gcc_ahb2phy_csi_clk = { 1499 .halt_reg = 0x1d004, 1500 .halt_check = BRANCH_HALT, 1501 .hwcg_reg = 0x1d004, 1502 .hwcg_bit = 1, 1503 .clkr = { 1504 .enable_reg = 0x1d004, 1505 .enable_mask = BIT(0), 1506 .hw.init = &(struct clk_init_data){ 1507 .name = "gcc_ahb2phy_csi_clk", 1508 .ops = &clk_branch2_ops, 1509 }, 1510 }, 1511 }; 1512 1513 static struct clk_branch gcc_ahb2phy_usb_clk = { 1514 .halt_reg = 0x1d008, 1515 .halt_check = BRANCH_HALT, 1516 .hwcg_reg = 0x1d008, 1517 .hwcg_bit = 1, 1518 .clkr = { 1519 .enable_reg = 0x1d008, 1520 .enable_mask = BIT(0), 1521 .hw.init = &(struct clk_init_data){ 1522 .name = "gcc_ahb2phy_usb_clk", 1523 .ops = &clk_branch2_ops, 1524 }, 1525 }, 1526 }; 1527 1528 static struct clk_branch gcc_bimc_gpu_axi_clk = { 1529 .halt_reg = 0x71154, 1530 .halt_check = BRANCH_HALT_DELAY, 1531 .hwcg_reg = 0x71154, 1532 .hwcg_bit = 1, 1533 .clkr = { 1534 .enable_reg = 0x71154, 1535 .enable_mask = BIT(0), 1536 .hw.init = &(struct clk_init_data){ 1537 .name = "gcc_bimc_gpu_axi_clk", 1538 .ops = &clk_branch2_ops, 1539 }, 1540 }, 1541 }; 1542 1543 static struct clk_branch gcc_boot_rom_ahb_clk = { 1544 .halt_reg = 0x23004, 1545 .halt_check = BRANCH_HALT_VOTED, 1546 .hwcg_reg = 0x23004, 1547 .hwcg_bit = 1, 1548 .clkr = { 1549 .enable_reg = 0x79004, 1550 .enable_mask = BIT(10), 1551 .hw.init = &(struct clk_init_data){ 1552 .name = "gcc_boot_rom_ahb_clk", 1553 .ops = &clk_branch2_ops, 1554 }, 1555 }, 1556 }; 1557 1558 static struct clk_branch gcc_cam_throttle_nrt_clk = { 1559 .halt_reg = 0x17070, 1560 .halt_check = BRANCH_HALT_VOTED, 1561 .hwcg_reg = 0x17070, 1562 .hwcg_bit = 1, 1563 .clkr = { 1564 .enable_reg = 0x79004, 1565 .enable_mask = BIT(27), 1566 .hw.init = &(struct clk_init_data){ 1567 .name = "gcc_cam_throttle_nrt_clk", 1568 .ops = &clk_branch2_ops, 1569 }, 1570 }, 1571 }; 1572 1573 static struct clk_branch gcc_cam_throttle_rt_clk = { 1574 .halt_reg = 0x1706c, 1575 .halt_check = BRANCH_HALT_VOTED, 1576 .hwcg_reg = 0x1706c, 1577 .hwcg_bit = 1, 1578 .clkr = { 1579 .enable_reg = 0x79004, 1580 .enable_mask = BIT(26), 1581 .hw.init = &(struct clk_init_data){ 1582 .name = "gcc_cam_throttle_rt_clk", 1583 .ops = &clk_branch2_ops, 1584 }, 1585 }, 1586 }; 1587 1588 static struct clk_branch gcc_camera_ahb_clk = { 1589 .halt_reg = 0x17008, 1590 .halt_check = BRANCH_HALT_DELAY, 1591 .hwcg_reg = 0x17008, 1592 .hwcg_bit = 1, 1593 .clkr = { 1594 .enable_reg = 0x17008, 1595 .enable_mask = BIT(0), 1596 .hw.init = &(struct clk_init_data){ 1597 .name = "gcc_camera_ahb_clk", 1598 .flags = CLK_IS_CRITICAL, 1599 .ops = &clk_branch2_ops, 1600 }, 1601 }, 1602 }; 1603 1604 static struct clk_branch gcc_camera_xo_clk = { 1605 .halt_reg = 0x17028, 1606 .halt_check = BRANCH_HALT, 1607 .clkr = { 1608 .enable_reg = 0x17028, 1609 .enable_mask = BIT(0), 1610 .hw.init = &(struct clk_init_data){ 1611 .name = "gcc_camera_xo_clk", 1612 .flags = CLK_IS_CRITICAL, 1613 .ops = &clk_branch2_ops, 1614 }, 1615 }, 1616 }; 1617 1618 static struct clk_branch gcc_camss_axi_clk = { 1619 .halt_reg = 0x58044, 1620 .halt_check = BRANCH_HALT, 1621 .clkr = { 1622 .enable_reg = 0x58044, 1623 .enable_mask = BIT(0), 1624 .hw.init = &(struct clk_init_data){ 1625 .name = "gcc_camss_axi_clk", 1626 .parent_hws = (const struct clk_hw *[]){ 1627 &gcc_camss_axi_clk_src.clkr.hw, 1628 }, 1629 .num_parents = 1, 1630 .flags = CLK_SET_RATE_PARENT, 1631 .ops = &clk_branch2_ops, 1632 }, 1633 }, 1634 }; 1635 1636 static struct clk_branch gcc_camss_camnoc_atb_clk = { 1637 .halt_reg = 0x5804c, 1638 .halt_check = BRANCH_HALT_DELAY, 1639 .hwcg_reg = 0x5804c, 1640 .hwcg_bit = 1, 1641 .clkr = { 1642 .enable_reg = 0x5804c, 1643 .enable_mask = BIT(0), 1644 .hw.init = &(struct clk_init_data){ 1645 .name = "gcc_camss_camnoc_atb_clk", 1646 .ops = &clk_branch2_ops, 1647 }, 1648 }, 1649 }; 1650 1651 static struct clk_branch gcc_camss_camnoc_nts_xo_clk = { 1652 .halt_reg = 0x58050, 1653 .halt_check = BRANCH_HALT_DELAY, 1654 .hwcg_reg = 0x58050, 1655 .hwcg_bit = 1, 1656 .clkr = { 1657 .enable_reg = 0x58050, 1658 .enable_mask = BIT(0), 1659 .hw.init = &(struct clk_init_data){ 1660 .name = "gcc_camss_camnoc_nts_xo_clk", 1661 .ops = &clk_branch2_ops, 1662 }, 1663 }, 1664 }; 1665 1666 static struct clk_branch gcc_camss_cci_0_clk = { 1667 .halt_reg = 0x56018, 1668 .halt_check = BRANCH_HALT, 1669 .clkr = { 1670 .enable_reg = 0x56018, 1671 .enable_mask = BIT(0), 1672 .hw.init = &(struct clk_init_data){ 1673 .name = "gcc_camss_cci_0_clk", 1674 .parent_hws = (const struct clk_hw *[]){ 1675 &gcc_camss_cci_clk_src.clkr.hw, 1676 }, 1677 .num_parents = 1, 1678 .flags = CLK_SET_RATE_PARENT, 1679 .ops = &clk_branch2_ops, 1680 }, 1681 }, 1682 }; 1683 1684 static struct clk_branch gcc_camss_cphy_0_clk = { 1685 .halt_reg = 0x52088, 1686 .halt_check = BRANCH_HALT, 1687 .clkr = { 1688 .enable_reg = 0x52088, 1689 .enable_mask = BIT(0), 1690 .hw.init = &(struct clk_init_data){ 1691 .name = "gcc_camss_cphy_0_clk", 1692 .parent_hws = (const struct clk_hw *[]){ 1693 &gcc_camss_tfe_cphy_rx_clk_src.clkr.hw, 1694 }, 1695 .num_parents = 1, 1696 .flags = CLK_SET_RATE_PARENT, 1697 .ops = &clk_branch2_ops, 1698 }, 1699 }, 1700 }; 1701 1702 static struct clk_branch gcc_camss_cphy_1_clk = { 1703 .halt_reg = 0x5208c, 1704 .halt_check = BRANCH_HALT, 1705 .clkr = { 1706 .enable_reg = 0x5208c, 1707 .enable_mask = BIT(0), 1708 .hw.init = &(struct clk_init_data){ 1709 .name = "gcc_camss_cphy_1_clk", 1710 .parent_hws = (const struct clk_hw *[]){ 1711 &gcc_camss_tfe_cphy_rx_clk_src.clkr.hw, 1712 }, 1713 .num_parents = 1, 1714 .flags = CLK_SET_RATE_PARENT, 1715 .ops = &clk_branch2_ops, 1716 }, 1717 }, 1718 }; 1719 1720 static struct clk_branch gcc_camss_cphy_2_clk = { 1721 .halt_reg = 0x52090, 1722 .halt_check = BRANCH_HALT, 1723 .clkr = { 1724 .enable_reg = 0x52090, 1725 .enable_mask = BIT(0), 1726 .hw.init = &(struct clk_init_data){ 1727 .name = "gcc_camss_cphy_2_clk", 1728 .parent_hws = (const struct clk_hw *[]){ 1729 &gcc_camss_tfe_cphy_rx_clk_src.clkr.hw, 1730 }, 1731 .num_parents = 1, 1732 .flags = CLK_SET_RATE_PARENT, 1733 .ops = &clk_branch2_ops, 1734 }, 1735 }, 1736 }; 1737 1738 static struct clk_branch gcc_camss_csi0phytimer_clk = { 1739 .halt_reg = 0x59018, 1740 .halt_check = BRANCH_HALT, 1741 .clkr = { 1742 .enable_reg = 0x59018, 1743 .enable_mask = BIT(0), 1744 .hw.init = &(struct clk_init_data){ 1745 .name = "gcc_camss_csi0phytimer_clk", 1746 .parent_hws = (const struct clk_hw *[]){ 1747 &gcc_camss_csi0phytimer_clk_src.clkr.hw, 1748 }, 1749 .num_parents = 1, 1750 .flags = CLK_SET_RATE_PARENT, 1751 .ops = &clk_branch2_ops, 1752 }, 1753 }, 1754 }; 1755 1756 static struct clk_branch gcc_camss_csi1phytimer_clk = { 1757 .halt_reg = 0x59034, 1758 .halt_check = BRANCH_HALT, 1759 .clkr = { 1760 .enable_reg = 0x59034, 1761 .enable_mask = BIT(0), 1762 .hw.init = &(struct clk_init_data){ 1763 .name = "gcc_camss_csi1phytimer_clk", 1764 .parent_hws = (const struct clk_hw *[]){ 1765 &gcc_camss_csi1phytimer_clk_src.clkr.hw, 1766 }, 1767 .num_parents = 1, 1768 .flags = CLK_SET_RATE_PARENT, 1769 .ops = &clk_branch2_ops, 1770 }, 1771 }, 1772 }; 1773 1774 static struct clk_branch gcc_camss_csi2phytimer_clk = { 1775 .halt_reg = 0x59050, 1776 .halt_check = BRANCH_HALT, 1777 .clkr = { 1778 .enable_reg = 0x59050, 1779 .enable_mask = BIT(0), 1780 .hw.init = &(struct clk_init_data){ 1781 .name = "gcc_camss_csi2phytimer_clk", 1782 .parent_hws = (const struct clk_hw *[]){ 1783 &gcc_camss_csi2phytimer_clk_src.clkr.hw, 1784 }, 1785 .num_parents = 1, 1786 .flags = CLK_SET_RATE_PARENT, 1787 .ops = &clk_branch2_ops, 1788 }, 1789 }, 1790 }; 1791 1792 static struct clk_branch gcc_camss_mclk0_clk = { 1793 .halt_reg = 0x51018, 1794 .halt_check = BRANCH_HALT, 1795 .clkr = { 1796 .enable_reg = 0x51018, 1797 .enable_mask = BIT(0), 1798 .hw.init = &(struct clk_init_data){ 1799 .name = "gcc_camss_mclk0_clk", 1800 .parent_hws = (const struct clk_hw *[]){ 1801 &gcc_camss_mclk0_clk_src.clkr.hw, 1802 }, 1803 .num_parents = 1, 1804 .flags = CLK_SET_RATE_PARENT, 1805 .ops = &clk_branch2_ops, 1806 }, 1807 }, 1808 }; 1809 1810 static struct clk_branch gcc_camss_mclk1_clk = { 1811 .halt_reg = 0x51034, 1812 .halt_check = BRANCH_HALT, 1813 .clkr = { 1814 .enable_reg = 0x51034, 1815 .enable_mask = BIT(0), 1816 .hw.init = &(struct clk_init_data){ 1817 .name = "gcc_camss_mclk1_clk", 1818 .parent_hws = (const struct clk_hw *[]){ 1819 &gcc_camss_mclk1_clk_src.clkr.hw, 1820 }, 1821 .num_parents = 1, 1822 .flags = CLK_SET_RATE_PARENT, 1823 .ops = &clk_branch2_ops, 1824 }, 1825 }, 1826 }; 1827 1828 static struct clk_branch gcc_camss_mclk2_clk = { 1829 .halt_reg = 0x51050, 1830 .halt_check = BRANCH_HALT, 1831 .clkr = { 1832 .enable_reg = 0x51050, 1833 .enable_mask = BIT(0), 1834 .hw.init = &(struct clk_init_data){ 1835 .name = "gcc_camss_mclk2_clk", 1836 .parent_hws = (const struct clk_hw *[]){ 1837 &gcc_camss_mclk2_clk_src.clkr.hw, 1838 }, 1839 .num_parents = 1, 1840 .flags = CLK_SET_RATE_PARENT, 1841 .ops = &clk_branch2_ops, 1842 }, 1843 }, 1844 }; 1845 1846 static struct clk_branch gcc_camss_mclk3_clk = { 1847 .halt_reg = 0x5106c, 1848 .halt_check = BRANCH_HALT, 1849 .clkr = { 1850 .enable_reg = 0x5106c, 1851 .enable_mask = BIT(0), 1852 .hw.init = &(struct clk_init_data){ 1853 .name = "gcc_camss_mclk3_clk", 1854 .parent_hws = (const struct clk_hw *[]){ 1855 &gcc_camss_mclk3_clk_src.clkr.hw, 1856 }, 1857 .num_parents = 1, 1858 .flags = CLK_SET_RATE_PARENT, 1859 .ops = &clk_branch2_ops, 1860 }, 1861 }, 1862 }; 1863 1864 static struct clk_branch gcc_camss_nrt_axi_clk = { 1865 .halt_reg = 0x58054, 1866 .halt_check = BRANCH_HALT, 1867 .clkr = { 1868 .enable_reg = 0x58054, 1869 .enable_mask = BIT(0), 1870 .hw.init = &(struct clk_init_data){ 1871 .name = "gcc_camss_nrt_axi_clk", 1872 .ops = &clk_branch2_ops, 1873 }, 1874 }, 1875 }; 1876 1877 static struct clk_branch gcc_camss_ope_ahb_clk = { 1878 .halt_reg = 0x5503c, 1879 .halt_check = BRANCH_HALT, 1880 .clkr = { 1881 .enable_reg = 0x5503c, 1882 .enable_mask = BIT(0), 1883 .hw.init = &(struct clk_init_data){ 1884 .name = "gcc_camss_ope_ahb_clk", 1885 .parent_hws = (const struct clk_hw *[]){ 1886 &gcc_camss_ope_ahb_clk_src.clkr.hw, 1887 }, 1888 .num_parents = 1, 1889 .flags = CLK_SET_RATE_PARENT, 1890 .ops = &clk_branch2_ops, 1891 }, 1892 }, 1893 }; 1894 1895 static struct clk_branch gcc_camss_ope_clk = { 1896 .halt_reg = 0x5501c, 1897 .halt_check = BRANCH_HALT, 1898 .clkr = { 1899 .enable_reg = 0x5501c, 1900 .enable_mask = BIT(0), 1901 .hw.init = &(struct clk_init_data){ 1902 .name = "gcc_camss_ope_clk", 1903 .parent_hws = (const struct clk_hw *[]){ 1904 &gcc_camss_ope_clk_src.clkr.hw, 1905 }, 1906 .num_parents = 1, 1907 .flags = CLK_SET_RATE_PARENT, 1908 .ops = &clk_branch2_ops, 1909 }, 1910 }, 1911 }; 1912 1913 static struct clk_branch gcc_camss_rt_axi_clk = { 1914 .halt_reg = 0x5805c, 1915 .halt_check = BRANCH_HALT, 1916 .clkr = { 1917 .enable_reg = 0x5805c, 1918 .enable_mask = BIT(0), 1919 .hw.init = &(struct clk_init_data){ 1920 .name = "gcc_camss_rt_axi_clk", 1921 .ops = &clk_branch2_ops, 1922 }, 1923 }, 1924 }; 1925 1926 static struct clk_branch gcc_camss_tfe_0_clk = { 1927 .halt_reg = 0x5201c, 1928 .halt_check = BRANCH_HALT, 1929 .clkr = { 1930 .enable_reg = 0x5201c, 1931 .enable_mask = BIT(0), 1932 .hw.init = &(struct clk_init_data){ 1933 .name = "gcc_camss_tfe_0_clk", 1934 .parent_hws = (const struct clk_hw *[]){ 1935 &gcc_camss_tfe_0_clk_src.clkr.hw, 1936 }, 1937 .num_parents = 1, 1938 .flags = CLK_SET_RATE_PARENT, 1939 .ops = &clk_branch2_ops, 1940 }, 1941 }, 1942 }; 1943 1944 static struct clk_branch gcc_camss_tfe_0_cphy_rx_clk = { 1945 .halt_reg = 0x5207c, 1946 .halt_check = BRANCH_HALT, 1947 .clkr = { 1948 .enable_reg = 0x5207c, 1949 .enable_mask = BIT(0), 1950 .hw.init = &(struct clk_init_data){ 1951 .name = "gcc_camss_tfe_0_cphy_rx_clk", 1952 .parent_hws = (const struct clk_hw *[]){ 1953 &gcc_camss_tfe_cphy_rx_clk_src.clkr.hw, 1954 }, 1955 .num_parents = 1, 1956 .flags = CLK_SET_RATE_PARENT, 1957 .ops = &clk_branch2_ops, 1958 }, 1959 }, 1960 }; 1961 1962 static struct clk_branch gcc_camss_tfe_0_csid_clk = { 1963 .halt_reg = 0x520ac, 1964 .halt_check = BRANCH_HALT, 1965 .clkr = { 1966 .enable_reg = 0x520ac, 1967 .enable_mask = BIT(0), 1968 .hw.init = &(struct clk_init_data){ 1969 .name = "gcc_camss_tfe_0_csid_clk", 1970 .parent_hws = (const struct clk_hw *[]){ 1971 &gcc_camss_tfe_0_csid_clk_src.clkr.hw, 1972 }, 1973 .num_parents = 1, 1974 .flags = CLK_SET_RATE_PARENT, 1975 .ops = &clk_branch2_ops, 1976 }, 1977 }, 1978 }; 1979 1980 static struct clk_branch gcc_camss_tfe_1_clk = { 1981 .halt_reg = 0x5203c, 1982 .halt_check = BRANCH_HALT, 1983 .clkr = { 1984 .enable_reg = 0x5203c, 1985 .enable_mask = BIT(0), 1986 .hw.init = &(struct clk_init_data){ 1987 .name = "gcc_camss_tfe_1_clk", 1988 .parent_hws = (const struct clk_hw *[]){ 1989 &gcc_camss_tfe_1_clk_src.clkr.hw, 1990 }, 1991 .num_parents = 1, 1992 .flags = CLK_SET_RATE_PARENT, 1993 .ops = &clk_branch2_ops, 1994 }, 1995 }, 1996 }; 1997 1998 static struct clk_branch gcc_camss_tfe_1_cphy_rx_clk = { 1999 .halt_reg = 0x52080, 2000 .halt_check = BRANCH_HALT, 2001 .clkr = { 2002 .enable_reg = 0x52080, 2003 .enable_mask = BIT(0), 2004 .hw.init = &(struct clk_init_data){ 2005 .name = "gcc_camss_tfe_1_cphy_rx_clk", 2006 .parent_hws = (const struct clk_hw *[]){ 2007 &gcc_camss_tfe_cphy_rx_clk_src.clkr.hw, 2008 }, 2009 .num_parents = 1, 2010 .flags = CLK_SET_RATE_PARENT, 2011 .ops = &clk_branch2_ops, 2012 }, 2013 }, 2014 }; 2015 2016 static struct clk_branch gcc_camss_tfe_1_csid_clk = { 2017 .halt_reg = 0x520cc, 2018 .halt_check = BRANCH_HALT, 2019 .clkr = { 2020 .enable_reg = 0x520cc, 2021 .enable_mask = BIT(0), 2022 .hw.init = &(struct clk_init_data){ 2023 .name = "gcc_camss_tfe_1_csid_clk", 2024 .parent_hws = (const struct clk_hw *[]){ 2025 &gcc_camss_tfe_1_csid_clk_src.clkr.hw, 2026 }, 2027 .num_parents = 1, 2028 .flags = CLK_SET_RATE_PARENT, 2029 .ops = &clk_branch2_ops, 2030 }, 2031 }, 2032 }; 2033 2034 static struct clk_branch gcc_camss_tfe_2_clk = { 2035 .halt_reg = 0x5205c, 2036 .halt_check = BRANCH_HALT, 2037 .clkr = { 2038 .enable_reg = 0x5205c, 2039 .enable_mask = BIT(0), 2040 .hw.init = &(struct clk_init_data){ 2041 .name = "gcc_camss_tfe_2_clk", 2042 .parent_hws = (const struct clk_hw *[]){ 2043 &gcc_camss_tfe_2_clk_src.clkr.hw, 2044 }, 2045 .num_parents = 1, 2046 .flags = CLK_SET_RATE_PARENT, 2047 .ops = &clk_branch2_ops, 2048 }, 2049 }, 2050 }; 2051 2052 static struct clk_branch gcc_camss_tfe_2_cphy_rx_clk = { 2053 .halt_reg = 0x52084, 2054 .halt_check = BRANCH_HALT, 2055 .clkr = { 2056 .enable_reg = 0x52084, 2057 .enable_mask = BIT(0), 2058 .hw.init = &(struct clk_init_data){ 2059 .name = "gcc_camss_tfe_2_cphy_rx_clk", 2060 .parent_hws = (const struct clk_hw *[]){ 2061 &gcc_camss_tfe_cphy_rx_clk_src.clkr.hw, 2062 }, 2063 .num_parents = 1, 2064 .flags = CLK_SET_RATE_PARENT, 2065 .ops = &clk_branch2_ops, 2066 }, 2067 }, 2068 }; 2069 2070 static struct clk_branch gcc_camss_tfe_2_csid_clk = { 2071 .halt_reg = 0x520ec, 2072 .halt_check = BRANCH_HALT, 2073 .clkr = { 2074 .enable_reg = 0x520ec, 2075 .enable_mask = BIT(0), 2076 .hw.init = &(struct clk_init_data){ 2077 .name = "gcc_camss_tfe_2_csid_clk", 2078 .parent_hws = (const struct clk_hw *[]){ 2079 &gcc_camss_tfe_2_csid_clk_src.clkr.hw, 2080 }, 2081 .num_parents = 1, 2082 .flags = CLK_SET_RATE_PARENT, 2083 .ops = &clk_branch2_ops, 2084 }, 2085 }, 2086 }; 2087 2088 static struct clk_branch gcc_camss_top_ahb_clk = { 2089 .halt_reg = 0x58028, 2090 .halt_check = BRANCH_HALT, 2091 .clkr = { 2092 .enable_reg = 0x58028, 2093 .enable_mask = BIT(0), 2094 .hw.init = &(struct clk_init_data){ 2095 .name = "gcc_camss_top_ahb_clk", 2096 .parent_hws = (const struct clk_hw *[]){ 2097 &gcc_camss_top_ahb_clk_src.clkr.hw, 2098 }, 2099 .num_parents = 1, 2100 .flags = CLK_SET_RATE_PARENT, 2101 .ops = &clk_branch2_ops, 2102 }, 2103 }, 2104 }; 2105 2106 static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = { 2107 .halt_reg = 0x1a084, 2108 .halt_check = BRANCH_HALT, 2109 .hwcg_reg = 0x1a084, 2110 .hwcg_bit = 1, 2111 .clkr = { 2112 .enable_reg = 0x1a084, 2113 .enable_mask = BIT(0), 2114 .hw.init = &(struct clk_init_data){ 2115 .name = "gcc_cfg_noc_usb3_prim_axi_clk", 2116 .parent_hws = (const struct clk_hw *[]){ 2117 &gcc_usb30_prim_master_clk_src.clkr.hw, 2118 }, 2119 .num_parents = 1, 2120 .flags = CLK_SET_RATE_PARENT, 2121 .ops = &clk_branch2_ops, 2122 }, 2123 }, 2124 }; 2125 2126 static struct clk_branch gcc_cpuss_gnoc_clk = { 2127 .halt_reg = 0x2b004, 2128 .halt_check = BRANCH_HALT_VOTED, 2129 .hwcg_reg = 0x2b004, 2130 .hwcg_bit = 1, 2131 .clkr = { 2132 .enable_reg = 0x79004, 2133 .enable_mask = BIT(22), 2134 .hw.init = &(struct clk_init_data){ 2135 .name = "gcc_cpuss_gnoc_clk", 2136 .flags = CLK_IS_CRITICAL, 2137 .ops = &clk_branch2_ops, 2138 }, 2139 }, 2140 }; 2141 2142 static struct clk_branch gcc_disp_ahb_clk = { 2143 .halt_reg = 0x1700c, 2144 .halt_check = BRANCH_HALT, 2145 .hwcg_reg = 0x1700c, 2146 .hwcg_bit = 1, 2147 .clkr = { 2148 .enable_reg = 0x1700c, 2149 .enable_mask = BIT(0), 2150 .hw.init = &(struct clk_init_data){ 2151 .name = "gcc_disp_ahb_clk", 2152 .flags = CLK_IS_CRITICAL, 2153 .ops = &clk_branch2_ops, 2154 }, 2155 }, 2156 }; 2157 2158 static struct clk_regmap_div gcc_disp_gpll0_clk_src = { 2159 .reg = 0x17058, 2160 .shift = 0, 2161 .width = 2, 2162 .clkr.hw.init = &(struct clk_init_data) { 2163 .name = "gcc_disp_gpll0_clk_src", 2164 .parent_hws = (const struct clk_hw *[]){ &gpll0.clkr.hw }, 2165 .num_parents = 1, 2166 .ops = &clk_regmap_div_ops, 2167 }, 2168 }; 2169 2170 static struct clk_branch gcc_disp_gpll0_div_clk_src = { 2171 .halt_check = BRANCH_HALT_DELAY, 2172 .clkr = { 2173 .enable_reg = 0x79004, 2174 .enable_mask = BIT(20), 2175 .hw.init = &(struct clk_init_data){ 2176 .name = "gcc_disp_gpll0_div_clk_src", 2177 .parent_hws = (const struct clk_hw *[]){ 2178 &gcc_disp_gpll0_clk_src.clkr.hw, 2179 }, 2180 .num_parents = 1, 2181 .flags = CLK_SET_RATE_PARENT, 2182 .ops = &clk_branch2_ops, 2183 }, 2184 }, 2185 }; 2186 2187 static struct clk_branch gcc_disp_hf_axi_clk = { 2188 .halt_reg = 0x17020, 2189 .halt_check = BRANCH_HALT, 2190 .hwcg_reg = 0x17020, 2191 .hwcg_bit = 1, 2192 .clkr = { 2193 .enable_reg = 0x17020, 2194 .enable_mask = BIT(0), 2195 .hw.init = &(struct clk_init_data){ 2196 .name = "gcc_disp_hf_axi_clk", 2197 .ops = &clk_branch2_ops, 2198 }, 2199 }, 2200 }; 2201 2202 static struct clk_branch gcc_disp_throttle_core_clk = { 2203 .halt_reg = 0x17064, 2204 .halt_check = BRANCH_HALT_VOTED, 2205 .hwcg_reg = 0x17064, 2206 .hwcg_bit = 1, 2207 .clkr = { 2208 .enable_reg = 0x7900c, 2209 .enable_mask = BIT(5), 2210 .hw.init = &(struct clk_init_data){ 2211 .name = "gcc_disp_throttle_core_clk", 2212 .ops = &clk_branch2_ops, 2213 }, 2214 }, 2215 }; 2216 2217 static struct clk_branch gcc_disp_xo_clk = { 2218 .halt_reg = 0x1702c, 2219 .halt_check = BRANCH_HALT, 2220 .clkr = { 2221 .enable_reg = 0x1702c, 2222 .enable_mask = BIT(0), 2223 .hw.init = &(struct clk_init_data){ 2224 .name = "gcc_disp_xo_clk", 2225 .flags = CLK_IS_CRITICAL, 2226 .ops = &clk_branch2_ops, 2227 }, 2228 }, 2229 }; 2230 2231 static struct clk_branch gcc_gp1_clk = { 2232 .halt_reg = 0x4d000, 2233 .halt_check = BRANCH_HALT, 2234 .clkr = { 2235 .enable_reg = 0x4d000, 2236 .enable_mask = BIT(0), 2237 .hw.init = &(struct clk_init_data){ 2238 .name = "gcc_gp1_clk", 2239 .parent_hws = (const struct clk_hw *[]){ 2240 &gcc_gp1_clk_src.clkr.hw, 2241 }, 2242 .num_parents = 1, 2243 .flags = CLK_SET_RATE_PARENT, 2244 .ops = &clk_branch2_ops, 2245 }, 2246 }, 2247 }; 2248 2249 static struct clk_branch gcc_gp2_clk = { 2250 .halt_reg = 0x4e000, 2251 .halt_check = BRANCH_HALT, 2252 .clkr = { 2253 .enable_reg = 0x4e000, 2254 .enable_mask = BIT(0), 2255 .hw.init = &(struct clk_init_data){ 2256 .name = "gcc_gp2_clk", 2257 .parent_hws = (const struct clk_hw *[]){ 2258 &gcc_gp2_clk_src.clkr.hw, 2259 }, 2260 .num_parents = 1, 2261 .flags = CLK_SET_RATE_PARENT, 2262 .ops = &clk_branch2_ops, 2263 }, 2264 }, 2265 }; 2266 2267 static struct clk_branch gcc_gp3_clk = { 2268 .halt_reg = 0x4f000, 2269 .halt_check = BRANCH_HALT, 2270 .clkr = { 2271 .enable_reg = 0x4f000, 2272 .enable_mask = BIT(0), 2273 .hw.init = &(struct clk_init_data){ 2274 .name = "gcc_gp3_clk", 2275 .parent_hws = (const struct clk_hw *[]){ 2276 &gcc_gp3_clk_src.clkr.hw, 2277 }, 2278 .num_parents = 1, 2279 .flags = CLK_SET_RATE_PARENT, 2280 .ops = &clk_branch2_ops, 2281 }, 2282 }, 2283 }; 2284 2285 static struct clk_branch gcc_gpu_cfg_ahb_clk = { 2286 .halt_reg = 0x36004, 2287 .halt_check = BRANCH_HALT, 2288 .hwcg_reg = 0x36004, 2289 .hwcg_bit = 1, 2290 .clkr = { 2291 .enable_reg = 0x36004, 2292 .enable_mask = BIT(0), 2293 .hw.init = &(struct clk_init_data){ 2294 .name = "gcc_gpu_cfg_ahb_clk", 2295 .flags = CLK_IS_CRITICAL, 2296 .ops = &clk_branch2_ops, 2297 }, 2298 }, 2299 }; 2300 2301 static struct clk_branch gcc_gpu_gpll0_clk_src = { 2302 .halt_check = BRANCH_HALT_DELAY, 2303 .clkr = { 2304 .enable_reg = 0x79004, 2305 .enable_mask = BIT(15), 2306 .hw.init = &(struct clk_init_data){ 2307 .name = "gcc_gpu_gpll0_clk_src", 2308 .parent_hws = (const struct clk_hw *[]){ 2309 &gpll0.clkr.hw, 2310 }, 2311 .num_parents = 1, 2312 .flags = CLK_SET_RATE_PARENT, 2313 .ops = &clk_branch2_ops, 2314 }, 2315 }, 2316 }; 2317 2318 static struct clk_branch gcc_gpu_gpll0_div_clk_src = { 2319 .halt_check = BRANCH_HALT_DELAY, 2320 .clkr = { 2321 .enable_reg = 0x79004, 2322 .enable_mask = BIT(16), 2323 .hw.init = &(struct clk_init_data){ 2324 .name = "gcc_gpu_gpll0_div_clk_src", 2325 .parent_hws = (const struct clk_hw *[]){ 2326 &gpll0_out_aux2.clkr.hw, 2327 }, 2328 .num_parents = 1, 2329 .flags = CLK_SET_RATE_PARENT, 2330 .ops = &clk_branch2_ops, 2331 }, 2332 }, 2333 }; 2334 2335 static struct clk_branch gcc_gpu_iref_clk = { 2336 .halt_reg = 0x36100, 2337 .halt_check = BRANCH_HALT_DELAY, 2338 .clkr = { 2339 .enable_reg = 0x36100, 2340 .enable_mask = BIT(0), 2341 .hw.init = &(struct clk_init_data){ 2342 .name = "gcc_gpu_iref_clk", 2343 .ops = &clk_branch2_ops, 2344 }, 2345 }, 2346 }; 2347 2348 static struct clk_branch gcc_gpu_memnoc_gfx_clk = { 2349 .halt_reg = 0x3600c, 2350 .halt_check = BRANCH_VOTED, 2351 .hwcg_reg = 0x3600c, 2352 .hwcg_bit = 1, 2353 .clkr = { 2354 .enable_reg = 0x3600c, 2355 .enable_mask = BIT(0), 2356 .hw.init = &(struct clk_init_data){ 2357 .name = "gcc_gpu_memnoc_gfx_clk", 2358 .ops = &clk_branch2_ops, 2359 }, 2360 }, 2361 }; 2362 2363 static struct clk_branch gcc_gpu_snoc_dvm_gfx_clk = { 2364 .halt_reg = 0x36018, 2365 .halt_check = BRANCH_HALT, 2366 .clkr = { 2367 .enable_reg = 0x36018, 2368 .enable_mask = BIT(0), 2369 .hw.init = &(struct clk_init_data){ 2370 .name = "gcc_gpu_snoc_dvm_gfx_clk", 2371 .ops = &clk_branch2_ops, 2372 }, 2373 }, 2374 }; 2375 2376 static struct clk_branch gcc_gpu_throttle_core_clk = { 2377 .halt_reg = 0x36048, 2378 .halt_check = BRANCH_HALT_VOTED, 2379 .hwcg_reg = 0x36048, 2380 .hwcg_bit = 1, 2381 .clkr = { 2382 .enable_reg = 0x79004, 2383 .enable_mask = BIT(31), 2384 .hw.init = &(struct clk_init_data){ 2385 .name = "gcc_gpu_throttle_core_clk", 2386 .ops = &clk_branch2_ops, 2387 }, 2388 }, 2389 }; 2390 2391 static struct clk_branch gcc_pdm2_clk = { 2392 .halt_reg = 0x2000c, 2393 .halt_check = BRANCH_HALT, 2394 .clkr = { 2395 .enable_reg = 0x2000c, 2396 .enable_mask = BIT(0), 2397 .hw.init = &(struct clk_init_data){ 2398 .name = "gcc_pdm2_clk", 2399 .parent_hws = (const struct clk_hw *[]){ 2400 &gcc_pdm2_clk_src.clkr.hw, 2401 }, 2402 .num_parents = 1, 2403 .flags = CLK_SET_RATE_PARENT, 2404 .ops = &clk_branch2_ops, 2405 }, 2406 }, 2407 }; 2408 2409 static struct clk_branch gcc_pdm_ahb_clk = { 2410 .halt_reg = 0x20004, 2411 .halt_check = BRANCH_HALT, 2412 .hwcg_reg = 0x20004, 2413 .hwcg_bit = 1, 2414 .clkr = { 2415 .enable_reg = 0x20004, 2416 .enable_mask = BIT(0), 2417 .hw.init = &(struct clk_init_data){ 2418 .name = "gcc_pdm_ahb_clk", 2419 .ops = &clk_branch2_ops, 2420 }, 2421 }, 2422 }; 2423 2424 static struct clk_branch gcc_pdm_xo4_clk = { 2425 .halt_reg = 0x20008, 2426 .halt_check = BRANCH_HALT, 2427 .clkr = { 2428 .enable_reg = 0x20008, 2429 .enable_mask = BIT(0), 2430 .hw.init = &(struct clk_init_data){ 2431 .name = "gcc_pdm_xo4_clk", 2432 .ops = &clk_branch2_ops, 2433 }, 2434 }, 2435 }; 2436 2437 static struct clk_branch gcc_prng_ahb_clk = { 2438 .halt_reg = 0x21004, 2439 .halt_check = BRANCH_HALT_VOTED, 2440 .hwcg_reg = 0x21004, 2441 .hwcg_bit = 1, 2442 .clkr = { 2443 .enable_reg = 0x79004, 2444 .enable_mask = BIT(13), 2445 .hw.init = &(struct clk_init_data){ 2446 .name = "gcc_prng_ahb_clk", 2447 .ops = &clk_branch2_ops, 2448 }, 2449 }, 2450 }; 2451 2452 static struct clk_branch gcc_qmip_camera_nrt_ahb_clk = { 2453 .halt_reg = 0x17014, 2454 .halt_check = BRANCH_HALT_VOTED, 2455 .hwcg_reg = 0x17014, 2456 .hwcg_bit = 1, 2457 .clkr = { 2458 .enable_reg = 0x7900c, 2459 .enable_mask = BIT(0), 2460 .hw.init = &(struct clk_init_data){ 2461 .name = "gcc_qmip_camera_nrt_ahb_clk", 2462 .ops = &clk_branch2_ops, 2463 }, 2464 }, 2465 }; 2466 2467 static struct clk_branch gcc_qmip_camera_rt_ahb_clk = { 2468 .halt_reg = 0x17060, 2469 .halt_check = BRANCH_HALT_VOTED, 2470 .hwcg_reg = 0x17060, 2471 .hwcg_bit = 1, 2472 .clkr = { 2473 .enable_reg = 0x7900c, 2474 .enable_mask = BIT(2), 2475 .hw.init = &(struct clk_init_data){ 2476 .name = "gcc_qmip_camera_rt_ahb_clk", 2477 .ops = &clk_branch2_ops, 2478 }, 2479 }, 2480 }; 2481 2482 static struct clk_branch gcc_qmip_disp_ahb_clk = { 2483 .halt_reg = 0x17018, 2484 .halt_check = BRANCH_HALT_VOTED, 2485 .hwcg_reg = 0x17018, 2486 .hwcg_bit = 1, 2487 .clkr = { 2488 .enable_reg = 0x7900c, 2489 .enable_mask = BIT(1), 2490 .hw.init = &(struct clk_init_data){ 2491 .name = "gcc_qmip_disp_ahb_clk", 2492 .ops = &clk_branch2_ops, 2493 }, 2494 }, 2495 }; 2496 2497 static struct clk_branch gcc_qmip_gpu_cfg_ahb_clk = { 2498 .halt_reg = 0x36040, 2499 .halt_check = BRANCH_HALT_VOTED, 2500 .hwcg_reg = 0x36040, 2501 .hwcg_bit = 1, 2502 .clkr = { 2503 .enable_reg = 0x7900c, 2504 .enable_mask = BIT(4), 2505 .hw.init = &(struct clk_init_data){ 2506 .name = "gcc_qmip_gpu_cfg_ahb_clk", 2507 .ops = &clk_branch2_ops, 2508 }, 2509 }, 2510 }; 2511 2512 static struct clk_branch gcc_qmip_video_vcodec_ahb_clk = { 2513 .halt_reg = 0x17010, 2514 .halt_check = BRANCH_HALT_VOTED, 2515 .hwcg_reg = 0x17010, 2516 .hwcg_bit = 1, 2517 .clkr = { 2518 .enable_reg = 0x79004, 2519 .enable_mask = BIT(25), 2520 .hw.init = &(struct clk_init_data){ 2521 .name = "gcc_qmip_video_vcodec_ahb_clk", 2522 .ops = &clk_branch2_ops, 2523 }, 2524 }, 2525 }; 2526 2527 static struct clk_branch gcc_qupv3_wrap0_core_2x_clk = { 2528 .halt_reg = 0x1f014, 2529 .halt_check = BRANCH_HALT_VOTED, 2530 .clkr = { 2531 .enable_reg = 0x7900c, 2532 .enable_mask = BIT(9), 2533 .hw.init = &(struct clk_init_data){ 2534 .name = "gcc_qupv3_wrap0_core_2x_clk", 2535 .ops = &clk_branch2_ops, 2536 }, 2537 }, 2538 }; 2539 2540 static struct clk_branch gcc_qupv3_wrap0_core_clk = { 2541 .halt_reg = 0x1f00c, 2542 .halt_check = BRANCH_HALT_VOTED, 2543 .clkr = { 2544 .enable_reg = 0x7900c, 2545 .enable_mask = BIT(8), 2546 .hw.init = &(struct clk_init_data){ 2547 .name = "gcc_qupv3_wrap0_core_clk", 2548 .ops = &clk_branch2_ops, 2549 }, 2550 }, 2551 }; 2552 2553 static struct clk_branch gcc_qupv3_wrap0_s0_clk = { 2554 .halt_reg = 0x1f144, 2555 .halt_check = BRANCH_HALT_VOTED, 2556 .clkr = { 2557 .enable_reg = 0x7900c, 2558 .enable_mask = BIT(10), 2559 .hw.init = &(struct clk_init_data){ 2560 .name = "gcc_qupv3_wrap0_s0_clk", 2561 .parent_hws = (const struct clk_hw *[]){ 2562 &gcc_qupv3_wrap0_s0_clk_src.clkr.hw, 2563 }, 2564 .num_parents = 1, 2565 .flags = CLK_SET_RATE_PARENT, 2566 .ops = &clk_branch2_ops, 2567 }, 2568 }, 2569 }; 2570 2571 static struct clk_branch gcc_qupv3_wrap0_s1_clk = { 2572 .halt_reg = 0x1f274, 2573 .halt_check = BRANCH_HALT_VOTED, 2574 .clkr = { 2575 .enable_reg = 0x7900c, 2576 .enable_mask = BIT(11), 2577 .hw.init = &(struct clk_init_data){ 2578 .name = "gcc_qupv3_wrap0_s1_clk", 2579 .parent_hws = (const struct clk_hw *[]){ 2580 &gcc_qupv3_wrap0_s1_clk_src.clkr.hw, 2581 }, 2582 .num_parents = 1, 2583 .flags = CLK_SET_RATE_PARENT, 2584 .ops = &clk_branch2_ops, 2585 }, 2586 }, 2587 }; 2588 2589 static struct clk_branch gcc_qupv3_wrap0_s2_clk = { 2590 .halt_reg = 0x1f3a4, 2591 .halt_check = BRANCH_HALT_VOTED, 2592 .clkr = { 2593 .enable_reg = 0x7900c, 2594 .enable_mask = BIT(12), 2595 .hw.init = &(struct clk_init_data){ 2596 .name = "gcc_qupv3_wrap0_s2_clk", 2597 .parent_hws = (const struct clk_hw *[]){ 2598 &gcc_qupv3_wrap0_s2_clk_src.clkr.hw, 2599 }, 2600 .num_parents = 1, 2601 .flags = CLK_SET_RATE_PARENT, 2602 .ops = &clk_branch2_ops, 2603 }, 2604 }, 2605 }; 2606 2607 static struct clk_branch gcc_qupv3_wrap0_s3_clk = { 2608 .halt_reg = 0x1f4d4, 2609 .halt_check = BRANCH_HALT_VOTED, 2610 .clkr = { 2611 .enable_reg = 0x7900c, 2612 .enable_mask = BIT(13), 2613 .hw.init = &(struct clk_init_data){ 2614 .name = "gcc_qupv3_wrap0_s3_clk", 2615 .parent_hws = (const struct clk_hw *[]){ 2616 &gcc_qupv3_wrap0_s3_clk_src.clkr.hw, 2617 }, 2618 .num_parents = 1, 2619 .flags = CLK_SET_RATE_PARENT, 2620 .ops = &clk_branch2_ops, 2621 }, 2622 }, 2623 }; 2624 2625 static struct clk_branch gcc_qupv3_wrap0_s4_clk = { 2626 .halt_reg = 0x1f604, 2627 .halt_check = BRANCH_HALT_VOTED, 2628 .clkr = { 2629 .enable_reg = 0x7900c, 2630 .enable_mask = BIT(14), 2631 .hw.init = &(struct clk_init_data){ 2632 .name = "gcc_qupv3_wrap0_s4_clk", 2633 .parent_hws = (const struct clk_hw *[]){ 2634 &gcc_qupv3_wrap0_s4_clk_src.clkr.hw, 2635 }, 2636 .num_parents = 1, 2637 .flags = CLK_SET_RATE_PARENT, 2638 .ops = &clk_branch2_ops, 2639 }, 2640 }, 2641 }; 2642 2643 static struct clk_branch gcc_qupv3_wrap0_s5_clk = { 2644 .halt_reg = 0x1f734, 2645 .halt_check = BRANCH_HALT_VOTED, 2646 .clkr = { 2647 .enable_reg = 0x7900c, 2648 .enable_mask = BIT(15), 2649 .hw.init = &(struct clk_init_data){ 2650 .name = "gcc_qupv3_wrap0_s5_clk", 2651 .parent_hws = (const struct clk_hw *[]){ 2652 &gcc_qupv3_wrap0_s5_clk_src.clkr.hw, 2653 }, 2654 .num_parents = 1, 2655 .flags = CLK_SET_RATE_PARENT, 2656 .ops = &clk_branch2_ops, 2657 }, 2658 }, 2659 }; 2660 2661 static struct clk_branch gcc_qupv3_wrap_0_m_ahb_clk = { 2662 .halt_reg = 0x1f004, 2663 .halt_check = BRANCH_HALT_VOTED, 2664 .hwcg_reg = 0x1f004, 2665 .hwcg_bit = 1, 2666 .clkr = { 2667 .enable_reg = 0x7900c, 2668 .enable_mask = BIT(6), 2669 .hw.init = &(struct clk_init_data){ 2670 .name = "gcc_qupv3_wrap_0_m_ahb_clk", 2671 .ops = &clk_branch2_ops, 2672 }, 2673 }, 2674 }; 2675 2676 static struct clk_branch gcc_qupv3_wrap_0_s_ahb_clk = { 2677 .halt_reg = 0x1f008, 2678 .halt_check = BRANCH_HALT_VOTED, 2679 .hwcg_reg = 0x1f008, 2680 .hwcg_bit = 1, 2681 .clkr = { 2682 .enable_reg = 0x7900c, 2683 .enable_mask = BIT(7), 2684 .hw.init = &(struct clk_init_data){ 2685 .name = "gcc_qupv3_wrap_0_s_ahb_clk", 2686 .ops = &clk_branch2_ops, 2687 }, 2688 }, 2689 }; 2690 2691 static struct clk_branch gcc_sdcc1_ahb_clk = { 2692 .halt_reg = 0x38008, 2693 .halt_check = BRANCH_HALT, 2694 .clkr = { 2695 .enable_reg = 0x38008, 2696 .enable_mask = BIT(0), 2697 .hw.init = &(struct clk_init_data){ 2698 .name = "gcc_sdcc1_ahb_clk", 2699 .ops = &clk_branch2_ops, 2700 }, 2701 }, 2702 }; 2703 2704 static struct clk_branch gcc_sdcc1_apps_clk = { 2705 .halt_reg = 0x38004, 2706 .halt_check = BRANCH_HALT, 2707 .clkr = { 2708 .enable_reg = 0x38004, 2709 .enable_mask = BIT(0), 2710 .hw.init = &(struct clk_init_data){ 2711 .name = "gcc_sdcc1_apps_clk", 2712 .parent_hws = (const struct clk_hw *[]){ 2713 &gcc_sdcc1_apps_clk_src.clkr.hw, 2714 }, 2715 .num_parents = 1, 2716 .flags = CLK_SET_RATE_PARENT /* | CLK_ENABLE_HAND_OFF */, 2717 .ops = &clk_branch2_ops, 2718 }, 2719 }, 2720 }; 2721 2722 static struct clk_branch gcc_sdcc1_ice_core_clk = { 2723 .halt_reg = 0x3800c, 2724 .halt_check = BRANCH_HALT, 2725 .hwcg_reg = 0x3800c, 2726 .hwcg_bit = 1, 2727 .clkr = { 2728 .enable_reg = 0x3800c, 2729 .enable_mask = BIT(0), 2730 .hw.init = &(struct clk_init_data){ 2731 .name = "gcc_sdcc1_ice_core_clk", 2732 .parent_hws = (const struct clk_hw *[]){ 2733 &gcc_sdcc1_ice_core_clk_src.clkr.hw, 2734 }, 2735 .num_parents = 1, 2736 .flags = CLK_SET_RATE_PARENT, 2737 .ops = &clk_branch2_ops, 2738 }, 2739 }, 2740 }; 2741 2742 static struct clk_branch gcc_sdcc2_ahb_clk = { 2743 .halt_reg = 0x1e008, 2744 .halt_check = BRANCH_HALT, 2745 .clkr = { 2746 .enable_reg = 0x1e008, 2747 .enable_mask = BIT(0), 2748 .hw.init = &(struct clk_init_data){ 2749 .name = "gcc_sdcc2_ahb_clk", 2750 .ops = &clk_branch2_ops, 2751 }, 2752 }, 2753 }; 2754 2755 static struct clk_branch gcc_sdcc2_apps_clk = { 2756 .halt_reg = 0x1e004, 2757 .halt_check = BRANCH_HALT, 2758 .clkr = { 2759 .enable_reg = 0x1e004, 2760 .enable_mask = BIT(0), 2761 .hw.init = &(struct clk_init_data){ 2762 .name = "gcc_sdcc2_apps_clk", 2763 .parent_hws = (const struct clk_hw *[]){ 2764 &gcc_sdcc2_apps_clk_src.clkr.hw, 2765 }, 2766 .num_parents = 1, 2767 .flags = CLK_SET_RATE_PARENT, 2768 .ops = &clk_branch2_ops, 2769 }, 2770 }, 2771 }; 2772 2773 static struct clk_branch gcc_sys_noc_cpuss_ahb_clk = { 2774 .halt_reg = 0x2b06c, 2775 .halt_check = BRANCH_HALT_VOTED, 2776 .hwcg_reg = 0x2b06c, 2777 .hwcg_bit = 1, 2778 .clkr = { 2779 .enable_reg = 0x79004, 2780 .enable_mask = BIT(0), 2781 .hw.init = &(struct clk_init_data){ 2782 .name = "gcc_sys_noc_cpuss_ahb_clk", 2783 .flags = CLK_IS_CRITICAL, 2784 .ops = &clk_branch2_ops, 2785 }, 2786 }, 2787 }; 2788 2789 static struct clk_branch gcc_sys_noc_ufs_phy_axi_clk = { 2790 .halt_reg = 0x45098, 2791 .halt_check = BRANCH_HALT, 2792 .clkr = { 2793 .enable_reg = 0x45098, 2794 .enable_mask = BIT(0), 2795 .hw.init = &(struct clk_init_data){ 2796 .name = "gcc_sys_noc_ufs_phy_axi_clk", 2797 .parent_hws = (const struct clk_hw *[]){ 2798 &gcc_ufs_phy_axi_clk_src.clkr.hw, 2799 }, 2800 .num_parents = 1, 2801 .flags = CLK_SET_RATE_PARENT, 2802 .ops = &clk_branch2_ops, 2803 }, 2804 }, 2805 }; 2806 2807 static struct clk_branch gcc_sys_noc_usb3_prim_axi_clk = { 2808 .halt_reg = 0x1a080, 2809 .halt_check = BRANCH_HALT, 2810 .hwcg_reg = 0x1a080, 2811 .hwcg_bit = 1, 2812 .clkr = { 2813 .enable_reg = 0x1a080, 2814 .enable_mask = BIT(0), 2815 .hw.init = &(struct clk_init_data){ 2816 .name = "gcc_sys_noc_usb3_prim_axi_clk", 2817 .parent_hws = (const struct clk_hw *[]){ 2818 &gcc_usb30_prim_master_clk_src.clkr.hw, 2819 }, 2820 .num_parents = 1, 2821 .flags = CLK_SET_RATE_PARENT, 2822 .ops = &clk_branch2_ops, 2823 }, 2824 }, 2825 }; 2826 2827 static struct clk_branch gcc_ufs_clkref_clk = { 2828 .halt_reg = 0x8c000, 2829 .halt_check = BRANCH_HALT, 2830 .clkr = { 2831 .enable_reg = 0x8c000, 2832 .enable_mask = BIT(0), 2833 .hw.init = &(struct clk_init_data){ 2834 .name = "gcc_ufs_clkref_clk", 2835 .ops = &clk_branch2_ops, 2836 }, 2837 }, 2838 }; 2839 2840 static struct clk_branch gcc_ufs_phy_ahb_clk = { 2841 .halt_reg = 0x45014, 2842 .halt_check = BRANCH_HALT, 2843 .hwcg_reg = 0x45014, 2844 .hwcg_bit = 1, 2845 .clkr = { 2846 .enable_reg = 0x45014, 2847 .enable_mask = BIT(0), 2848 .hw.init = &(struct clk_init_data){ 2849 .name = "gcc_ufs_phy_ahb_clk", 2850 .ops = &clk_branch2_ops, 2851 }, 2852 }, 2853 }; 2854 2855 static struct clk_branch gcc_ufs_phy_axi_clk = { 2856 .halt_reg = 0x45010, 2857 .halt_check = BRANCH_HALT, 2858 .hwcg_reg = 0x45010, 2859 .hwcg_bit = 1, 2860 .clkr = { 2861 .enable_reg = 0x45010, 2862 .enable_mask = BIT(0), 2863 .hw.init = &(struct clk_init_data){ 2864 .name = "gcc_ufs_phy_axi_clk", 2865 .parent_hws = (const struct clk_hw *[]){ 2866 &gcc_ufs_phy_axi_clk_src.clkr.hw, 2867 }, 2868 .num_parents = 1, 2869 .flags = CLK_SET_RATE_PARENT, 2870 .ops = &clk_branch2_ops, 2871 }, 2872 }, 2873 }; 2874 2875 static struct clk_branch gcc_ufs_phy_ice_core_clk = { 2876 .halt_reg = 0x45044, 2877 .halt_check = BRANCH_HALT, 2878 .hwcg_reg = 0x45044, 2879 .hwcg_bit = 1, 2880 .clkr = { 2881 .enable_reg = 0x45044, 2882 .enable_mask = BIT(0), 2883 .hw.init = &(struct clk_init_data){ 2884 .name = "gcc_ufs_phy_ice_core_clk", 2885 .parent_hws = (const struct clk_hw *[]){ 2886 &gcc_ufs_phy_ice_core_clk_src.clkr.hw, 2887 }, 2888 .num_parents = 1, 2889 .flags = CLK_SET_RATE_PARENT, 2890 .ops = &clk_branch2_ops, 2891 }, 2892 }, 2893 }; 2894 2895 static struct clk_branch gcc_ufs_phy_phy_aux_clk = { 2896 .halt_reg = 0x45078, 2897 .halt_check = BRANCH_HALT, 2898 .hwcg_reg = 0x45078, 2899 .hwcg_bit = 1, 2900 .clkr = { 2901 .enable_reg = 0x45078, 2902 .enable_mask = BIT(0), 2903 .hw.init = &(struct clk_init_data){ 2904 .name = "gcc_ufs_phy_phy_aux_clk", 2905 .parent_hws = (const struct clk_hw *[]){ 2906 &gcc_ufs_phy_phy_aux_clk_src.clkr.hw, 2907 }, 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_ufs_phy_rx_symbol_0_clk = { 2916 .halt_reg = 0x4501c, 2917 .halt_check = BRANCH_HALT_SKIP, 2918 .clkr = { 2919 .enable_reg = 0x4501c, 2920 .enable_mask = BIT(0), 2921 .hw.init = &(struct clk_init_data){ 2922 .name = "gcc_ufs_phy_rx_symbol_0_clk", 2923 .ops = &clk_branch2_ops, 2924 }, 2925 }, 2926 }; 2927 2928 static struct clk_branch gcc_ufs_phy_tx_symbol_0_clk = { 2929 .halt_reg = 0x45018, 2930 .halt_check = BRANCH_HALT_SKIP, 2931 .clkr = { 2932 .enable_reg = 0x45018, 2933 .enable_mask = BIT(0), 2934 .hw.init = &(struct clk_init_data){ 2935 .name = "gcc_ufs_phy_tx_symbol_0_clk", 2936 .ops = &clk_branch2_ops, 2937 }, 2938 }, 2939 }; 2940 2941 static struct clk_branch gcc_ufs_phy_unipro_core_clk = { 2942 .halt_reg = 0x45040, 2943 .halt_check = BRANCH_HALT, 2944 .hwcg_reg = 0x45040, 2945 .hwcg_bit = 1, 2946 .clkr = { 2947 .enable_reg = 0x45040, 2948 .enable_mask = BIT(0), 2949 .hw.init = &(struct clk_init_data){ 2950 .name = "gcc_ufs_phy_unipro_core_clk", 2951 .parent_hws = (const struct clk_hw *[]){ 2952 &gcc_ufs_phy_unipro_core_clk_src.clkr.hw, 2953 }, 2954 .num_parents = 1, 2955 .flags = CLK_SET_RATE_PARENT, 2956 .ops = &clk_branch2_ops, 2957 }, 2958 }, 2959 }; 2960 2961 static struct clk_branch gcc_usb30_prim_master_clk = { 2962 .halt_reg = 0x1a010, 2963 .halt_check = BRANCH_HALT, 2964 .clkr = { 2965 .enable_reg = 0x1a010, 2966 .enable_mask = BIT(0), 2967 .hw.init = &(struct clk_init_data){ 2968 .name = "gcc_usb30_prim_master_clk", 2969 .parent_hws = (const struct clk_hw *[]){ 2970 &gcc_usb30_prim_master_clk_src.clkr.hw, 2971 }, 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_usb30_prim_mock_utmi_clk = { 2980 .halt_reg = 0x1a018, 2981 .halt_check = BRANCH_HALT, 2982 .clkr = { 2983 .enable_reg = 0x1a018, 2984 .enable_mask = BIT(0), 2985 .hw.init = &(struct clk_init_data){ 2986 .name = "gcc_usb30_prim_mock_utmi_clk", 2987 .parent_hws = (const struct clk_hw *[]){ 2988 &gcc_usb30_prim_mock_utmi_postdiv_clk_src.clkr.hw, 2989 }, 2990 .num_parents = 1, 2991 .flags = CLK_SET_RATE_PARENT, 2992 .ops = &clk_branch2_ops, 2993 }, 2994 }, 2995 }; 2996 2997 static struct clk_branch gcc_usb30_prim_sleep_clk = { 2998 .halt_reg = 0x1a014, 2999 .halt_check = BRANCH_HALT, 3000 .clkr = { 3001 .enable_reg = 0x1a014, 3002 .enable_mask = BIT(0), 3003 .hw.init = &(struct clk_init_data){ 3004 .name = "gcc_usb30_prim_sleep_clk", 3005 .ops = &clk_branch2_ops, 3006 }, 3007 }, 3008 }; 3009 3010 static struct clk_branch gcc_usb3_prim_clkref_clk = { 3011 .halt_reg = 0x9f000, 3012 .halt_check = BRANCH_HALT, 3013 .clkr = { 3014 .enable_reg = 0x9f000, 3015 .enable_mask = BIT(0), 3016 .hw.init = &(struct clk_init_data){ 3017 .name = "gcc_usb3_prim_clkref_clk", 3018 .ops = &clk_branch2_ops, 3019 }, 3020 }, 3021 }; 3022 3023 static struct clk_branch gcc_usb3_prim_phy_com_aux_clk = { 3024 .halt_reg = 0x1a054, 3025 .halt_check = BRANCH_HALT, 3026 .clkr = { 3027 .enable_reg = 0x1a054, 3028 .enable_mask = BIT(0), 3029 .hw.init = &(struct clk_init_data){ 3030 .name = "gcc_usb3_prim_phy_com_aux_clk", 3031 .parent_hws = (const struct clk_hw *[]){ 3032 &gcc_usb3_prim_phy_aux_clk_src.clkr.hw, 3033 }, 3034 .num_parents = 1, 3035 .flags = CLK_SET_RATE_PARENT, 3036 .ops = &clk_branch2_ops, 3037 }, 3038 }, 3039 }; 3040 3041 static struct clk_branch gcc_usb3_prim_phy_pipe_clk = { 3042 .halt_reg = 0x1a058, 3043 .halt_check = BRANCH_HALT_SKIP, 3044 .hwcg_reg = 0x1a058, 3045 .hwcg_bit = 1, 3046 .clkr = { 3047 .enable_reg = 0x1a058, 3048 .enable_mask = BIT(0), 3049 .hw.init = &(struct clk_init_data){ 3050 .name = "gcc_usb3_prim_phy_pipe_clk", 3051 .ops = &clk_branch2_ops, 3052 }, 3053 }, 3054 }; 3055 3056 static struct clk_branch gcc_vcodec0_axi_clk = { 3057 .halt_reg = 0x6e008, 3058 .halt_check = BRANCH_HALT, 3059 .clkr = { 3060 .enable_reg = 0x6e008, 3061 .enable_mask = BIT(0), 3062 .hw.init = &(struct clk_init_data){ 3063 .name = "gcc_vcodec0_axi_clk", 3064 .ops = &clk_branch2_ops, 3065 }, 3066 }, 3067 }; 3068 3069 static struct clk_branch gcc_venus_ahb_clk = { 3070 .halt_reg = 0x6e010, 3071 .halt_check = BRANCH_HALT, 3072 .clkr = { 3073 .enable_reg = 0x6e010, 3074 .enable_mask = BIT(0), 3075 .hw.init = &(struct clk_init_data){ 3076 .name = "gcc_venus_ahb_clk", 3077 .ops = &clk_branch2_ops, 3078 }, 3079 }, 3080 }; 3081 3082 static struct clk_branch gcc_venus_ctl_axi_clk = { 3083 .halt_reg = 0x6e004, 3084 .halt_check = BRANCH_HALT, 3085 .clkr = { 3086 .enable_reg = 0x6e004, 3087 .enable_mask = BIT(0), 3088 .hw.init = &(struct clk_init_data){ 3089 .name = "gcc_venus_ctl_axi_clk", 3090 .ops = &clk_branch2_ops, 3091 }, 3092 }, 3093 }; 3094 3095 static struct clk_branch gcc_video_ahb_clk = { 3096 .halt_reg = 0x17004, 3097 .halt_check = BRANCH_HALT, 3098 .hwcg_reg = 0x17004, 3099 .hwcg_bit = 1, 3100 .clkr = { 3101 .enable_reg = 0x17004, 3102 .enable_mask = BIT(0), 3103 .hw.init = &(struct clk_init_data){ 3104 .name = "gcc_video_ahb_clk", 3105 .ops = &clk_branch2_ops, 3106 }, 3107 }, 3108 }; 3109 3110 static struct clk_branch gcc_video_axi0_clk = { 3111 .halt_reg = 0x1701c, 3112 .halt_check = BRANCH_HALT, 3113 .hwcg_reg = 0x1701c, 3114 .hwcg_bit = 1, 3115 .clkr = { 3116 .enable_reg = 0x1701c, 3117 .enable_mask = BIT(0), 3118 .hw.init = &(struct clk_init_data){ 3119 .name = "gcc_video_axi0_clk", 3120 .ops = &clk_branch2_ops, 3121 }, 3122 }, 3123 }; 3124 3125 static struct clk_branch gcc_video_throttle_core_clk = { 3126 .halt_reg = 0x17068, 3127 .halt_check = BRANCH_HALT_VOTED, 3128 .hwcg_reg = 0x17068, 3129 .hwcg_bit = 1, 3130 .clkr = { 3131 .enable_reg = 0x79004, 3132 .enable_mask = BIT(28), 3133 .hw.init = &(struct clk_init_data){ 3134 .name = "gcc_video_throttle_core_clk", 3135 .ops = &clk_branch2_ops, 3136 }, 3137 }, 3138 }; 3139 3140 static struct clk_branch gcc_video_vcodec0_sys_clk = { 3141 .halt_reg = 0x580a4, 3142 .halt_check = BRANCH_HALT_DELAY, 3143 .hwcg_reg = 0x580a4, 3144 .hwcg_bit = 1, 3145 .clkr = { 3146 .enable_reg = 0x580a4, 3147 .enable_mask = BIT(0), 3148 .hw.init = &(struct clk_init_data){ 3149 .name = "gcc_video_vcodec0_sys_clk", 3150 .parent_hws = (const struct clk_hw *[]){ 3151 &gcc_video_venus_clk_src.clkr.hw, 3152 }, 3153 .num_parents = 1, 3154 .flags = CLK_SET_RATE_PARENT, 3155 .ops = &clk_branch2_ops, 3156 }, 3157 }, 3158 }; 3159 3160 static struct clk_branch gcc_video_venus_ctl_clk = { 3161 .halt_reg = 0x5808c, 3162 .halt_check = BRANCH_HALT, 3163 .clkr = { 3164 .enable_reg = 0x5808c, 3165 .enable_mask = BIT(0), 3166 .hw.init = &(struct clk_init_data){ 3167 .name = "gcc_video_venus_ctl_clk", 3168 .parent_hws = (const struct clk_hw *[]){ 3169 &gcc_video_venus_clk_src.clkr.hw, 3170 }, 3171 .num_parents = 1, 3172 .flags = CLK_SET_RATE_PARENT, 3173 .ops = &clk_branch2_ops, 3174 }, 3175 }, 3176 }; 3177 3178 static struct clk_branch gcc_video_xo_clk = { 3179 .halt_reg = 0x17024, 3180 .halt_check = BRANCH_HALT, 3181 .clkr = { 3182 .enable_reg = 0x17024, 3183 .enable_mask = BIT(0), 3184 .hw.init = &(struct clk_init_data){ 3185 .name = "gcc_video_xo_clk", 3186 .ops = &clk_branch2_ops, 3187 }, 3188 }, 3189 }; 3190 3191 static struct gdsc gcc_camss_top_gdsc = { 3192 .gdscr = 0x58004, 3193 .pd = { 3194 .name = "gcc_camss_top", 3195 }, 3196 .pwrsts = PWRSTS_OFF_ON, 3197 }; 3198 3199 static struct gdsc gcc_ufs_phy_gdsc = { 3200 .gdscr = 0x45004, 3201 .pd = { 3202 .name = "gcc_ufs_phy", 3203 }, 3204 .pwrsts = PWRSTS_OFF_ON, 3205 }; 3206 3207 static struct gdsc gcc_usb30_prim_gdsc = { 3208 .gdscr = 0x1a004, 3209 .pd = { 3210 .name = "gcc_usb30_prim", 3211 }, 3212 .pwrsts = PWRSTS_OFF_ON, 3213 }; 3214 3215 static struct gdsc gcc_vcodec0_gdsc = { 3216 .gdscr = 0x58098, 3217 .pd = { 3218 .name = "gcc_vcodec0", 3219 }, 3220 .pwrsts = PWRSTS_OFF_ON, 3221 }; 3222 3223 static struct gdsc gcc_venus_gdsc = { 3224 .gdscr = 0x5807c, 3225 .pd = { 3226 .name = "gcc_venus", 3227 }, 3228 .pwrsts = PWRSTS_OFF_ON, 3229 }; 3230 3231 static struct gdsc hlos1_vote_turing_mmu_tbu1_gdsc = { 3232 .gdscr = 0x7d060, 3233 .pd = { 3234 .name = "hlos1_vote_turing_mmu_tbu1", 3235 }, 3236 .pwrsts = PWRSTS_OFF_ON, 3237 .flags = VOTABLE, 3238 }; 3239 3240 static struct gdsc hlos1_vote_turing_mmu_tbu0_gdsc = { 3241 .gdscr = 0x7d07c, 3242 .pd = { 3243 .name = "hlos1_vote_turing_mmu_tbu0", 3244 }, 3245 .pwrsts = PWRSTS_OFF_ON, 3246 .flags = VOTABLE, 3247 }; 3248 3249 static struct gdsc hlos1_vote_mm_snoc_mmu_tbu_rt_gdsc = { 3250 .gdscr = 0x7d074, 3251 .pd = { 3252 .name = "hlos1_vote_mm_snoc_mmu_tbu_rt", 3253 }, 3254 .pwrsts = PWRSTS_OFF_ON, 3255 .flags = VOTABLE, 3256 }; 3257 3258 static struct gdsc hlos1_vote_mm_snoc_mmu_tbu_nrt_gdsc = { 3259 .gdscr = 0x7d078, 3260 .pd = { 3261 .name = "hlos1_vote_mm_snoc_mmu_tbu_nrt", 3262 }, 3263 .pwrsts = PWRSTS_OFF_ON, 3264 .flags = VOTABLE, 3265 }; 3266 3267 static struct clk_regmap *gcc_sm6115_clocks[] = { 3268 [GCC_AHB2PHY_CSI_CLK] = &gcc_ahb2phy_csi_clk.clkr, 3269 [GCC_AHB2PHY_USB_CLK] = &gcc_ahb2phy_usb_clk.clkr, 3270 [GCC_BIMC_GPU_AXI_CLK] = &gcc_bimc_gpu_axi_clk.clkr, 3271 [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr, 3272 [GCC_CAM_THROTTLE_NRT_CLK] = &gcc_cam_throttle_nrt_clk.clkr, 3273 [GCC_CAM_THROTTLE_RT_CLK] = &gcc_cam_throttle_rt_clk.clkr, 3274 [GCC_CAMERA_AHB_CLK] = &gcc_camera_ahb_clk.clkr, 3275 [GCC_CAMERA_XO_CLK] = &gcc_camera_xo_clk.clkr, 3276 [GCC_CAMSS_AXI_CLK] = &gcc_camss_axi_clk.clkr, 3277 [GCC_CAMSS_AXI_CLK_SRC] = &gcc_camss_axi_clk_src.clkr, 3278 [GCC_CAMSS_CAMNOC_ATB_CLK] = &gcc_camss_camnoc_atb_clk.clkr, 3279 [GCC_CAMSS_CAMNOC_NTS_XO_CLK] = &gcc_camss_camnoc_nts_xo_clk.clkr, 3280 [GCC_CAMSS_CCI_0_CLK] = &gcc_camss_cci_0_clk.clkr, 3281 [GCC_CAMSS_CCI_CLK_SRC] = &gcc_camss_cci_clk_src.clkr, 3282 [GCC_CAMSS_CPHY_0_CLK] = &gcc_camss_cphy_0_clk.clkr, 3283 [GCC_CAMSS_CPHY_1_CLK] = &gcc_camss_cphy_1_clk.clkr, 3284 [GCC_CAMSS_CPHY_2_CLK] = &gcc_camss_cphy_2_clk.clkr, 3285 [GCC_CAMSS_CSI0PHYTIMER_CLK] = &gcc_camss_csi0phytimer_clk.clkr, 3286 [GCC_CAMSS_CSI0PHYTIMER_CLK_SRC] = &gcc_camss_csi0phytimer_clk_src.clkr, 3287 [GCC_CAMSS_CSI1PHYTIMER_CLK] = &gcc_camss_csi1phytimer_clk.clkr, 3288 [GCC_CAMSS_CSI1PHYTIMER_CLK_SRC] = &gcc_camss_csi1phytimer_clk_src.clkr, 3289 [GCC_CAMSS_CSI2PHYTIMER_CLK] = &gcc_camss_csi2phytimer_clk.clkr, 3290 [GCC_CAMSS_CSI2PHYTIMER_CLK_SRC] = &gcc_camss_csi2phytimer_clk_src.clkr, 3291 [GCC_CAMSS_MCLK0_CLK] = &gcc_camss_mclk0_clk.clkr, 3292 [GCC_CAMSS_MCLK0_CLK_SRC] = &gcc_camss_mclk0_clk_src.clkr, 3293 [GCC_CAMSS_MCLK1_CLK] = &gcc_camss_mclk1_clk.clkr, 3294 [GCC_CAMSS_MCLK1_CLK_SRC] = &gcc_camss_mclk1_clk_src.clkr, 3295 [GCC_CAMSS_MCLK2_CLK] = &gcc_camss_mclk2_clk.clkr, 3296 [GCC_CAMSS_MCLK2_CLK_SRC] = &gcc_camss_mclk2_clk_src.clkr, 3297 [GCC_CAMSS_MCLK3_CLK] = &gcc_camss_mclk3_clk.clkr, 3298 [GCC_CAMSS_MCLK3_CLK_SRC] = &gcc_camss_mclk3_clk_src.clkr, 3299 [GCC_CAMSS_NRT_AXI_CLK] = &gcc_camss_nrt_axi_clk.clkr, 3300 [GCC_CAMSS_OPE_AHB_CLK] = &gcc_camss_ope_ahb_clk.clkr, 3301 [GCC_CAMSS_OPE_AHB_CLK_SRC] = &gcc_camss_ope_ahb_clk_src.clkr, 3302 [GCC_CAMSS_OPE_CLK] = &gcc_camss_ope_clk.clkr, 3303 [GCC_CAMSS_OPE_CLK_SRC] = &gcc_camss_ope_clk_src.clkr, 3304 [GCC_CAMSS_RT_AXI_CLK] = &gcc_camss_rt_axi_clk.clkr, 3305 [GCC_CAMSS_TFE_0_CLK] = &gcc_camss_tfe_0_clk.clkr, 3306 [GCC_CAMSS_TFE_0_CLK_SRC] = &gcc_camss_tfe_0_clk_src.clkr, 3307 [GCC_CAMSS_TFE_0_CPHY_RX_CLK] = &gcc_camss_tfe_0_cphy_rx_clk.clkr, 3308 [GCC_CAMSS_TFE_0_CSID_CLK] = &gcc_camss_tfe_0_csid_clk.clkr, 3309 [GCC_CAMSS_TFE_0_CSID_CLK_SRC] = &gcc_camss_tfe_0_csid_clk_src.clkr, 3310 [GCC_CAMSS_TFE_1_CLK] = &gcc_camss_tfe_1_clk.clkr, 3311 [GCC_CAMSS_TFE_1_CLK_SRC] = &gcc_camss_tfe_1_clk_src.clkr, 3312 [GCC_CAMSS_TFE_1_CPHY_RX_CLK] = &gcc_camss_tfe_1_cphy_rx_clk.clkr, 3313 [GCC_CAMSS_TFE_1_CSID_CLK] = &gcc_camss_tfe_1_csid_clk.clkr, 3314 [GCC_CAMSS_TFE_1_CSID_CLK_SRC] = &gcc_camss_tfe_1_csid_clk_src.clkr, 3315 [GCC_CAMSS_TFE_2_CLK] = &gcc_camss_tfe_2_clk.clkr, 3316 [GCC_CAMSS_TFE_2_CLK_SRC] = &gcc_camss_tfe_2_clk_src.clkr, 3317 [GCC_CAMSS_TFE_2_CPHY_RX_CLK] = &gcc_camss_tfe_2_cphy_rx_clk.clkr, 3318 [GCC_CAMSS_TFE_2_CSID_CLK] = &gcc_camss_tfe_2_csid_clk.clkr, 3319 [GCC_CAMSS_TFE_2_CSID_CLK_SRC] = &gcc_camss_tfe_2_csid_clk_src.clkr, 3320 [GCC_CAMSS_TFE_CPHY_RX_CLK_SRC] = &gcc_camss_tfe_cphy_rx_clk_src.clkr, 3321 [GCC_CAMSS_TOP_AHB_CLK] = &gcc_camss_top_ahb_clk.clkr, 3322 [GCC_CAMSS_TOP_AHB_CLK_SRC] = &gcc_camss_top_ahb_clk_src.clkr, 3323 [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr, 3324 [GCC_CPUSS_GNOC_CLK] = &gcc_cpuss_gnoc_clk.clkr, 3325 [GCC_DISP_AHB_CLK] = &gcc_disp_ahb_clk.clkr, 3326 [GCC_DISP_GPLL0_CLK_SRC] = &gcc_disp_gpll0_clk_src.clkr, 3327 [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr, 3328 [GCC_DISP_HF_AXI_CLK] = &gcc_disp_hf_axi_clk.clkr, 3329 [GCC_DISP_THROTTLE_CORE_CLK] = &gcc_disp_throttle_core_clk.clkr, 3330 [GCC_DISP_XO_CLK] = &gcc_disp_xo_clk.clkr, 3331 [GCC_GP1_CLK] = &gcc_gp1_clk.clkr, 3332 [GCC_GP1_CLK_SRC] = &gcc_gp1_clk_src.clkr, 3333 [GCC_GP2_CLK] = &gcc_gp2_clk.clkr, 3334 [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr, 3335 [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, 3336 [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr, 3337 [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr, 3338 [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr, 3339 [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr, 3340 [GCC_GPU_IREF_CLK] = &gcc_gpu_iref_clk.clkr, 3341 [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr, 3342 [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr, 3343 [GCC_GPU_THROTTLE_CORE_CLK] = &gcc_gpu_throttle_core_clk.clkr, 3344 [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr, 3345 [GCC_PDM2_CLK_SRC] = &gcc_pdm2_clk_src.clkr, 3346 [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr, 3347 [GCC_PDM_XO4_CLK] = &gcc_pdm_xo4_clk.clkr, 3348 [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr, 3349 [GCC_QMIP_CAMERA_NRT_AHB_CLK] = &gcc_qmip_camera_nrt_ahb_clk.clkr, 3350 [GCC_QMIP_CAMERA_RT_AHB_CLK] = &gcc_qmip_camera_rt_ahb_clk.clkr, 3351 [GCC_QMIP_DISP_AHB_CLK] = &gcc_qmip_disp_ahb_clk.clkr, 3352 [GCC_QMIP_GPU_CFG_AHB_CLK] = &gcc_qmip_gpu_cfg_ahb_clk.clkr, 3353 [GCC_QMIP_VIDEO_VCODEC_AHB_CLK] = &gcc_qmip_video_vcodec_ahb_clk.clkr, 3354 [GCC_QUPV3_WRAP0_CORE_2X_CLK] = &gcc_qupv3_wrap0_core_2x_clk.clkr, 3355 [GCC_QUPV3_WRAP0_CORE_CLK] = &gcc_qupv3_wrap0_core_clk.clkr, 3356 [GCC_QUPV3_WRAP0_S0_CLK] = &gcc_qupv3_wrap0_s0_clk.clkr, 3357 [GCC_QUPV3_WRAP0_S0_CLK_SRC] = &gcc_qupv3_wrap0_s0_clk_src.clkr, 3358 [GCC_QUPV3_WRAP0_S1_CLK] = &gcc_qupv3_wrap0_s1_clk.clkr, 3359 [GCC_QUPV3_WRAP0_S1_CLK_SRC] = &gcc_qupv3_wrap0_s1_clk_src.clkr, 3360 [GCC_QUPV3_WRAP0_S2_CLK] = &gcc_qupv3_wrap0_s2_clk.clkr, 3361 [GCC_QUPV3_WRAP0_S2_CLK_SRC] = &gcc_qupv3_wrap0_s2_clk_src.clkr, 3362 [GCC_QUPV3_WRAP0_S3_CLK] = &gcc_qupv3_wrap0_s3_clk.clkr, 3363 [GCC_QUPV3_WRAP0_S3_CLK_SRC] = &gcc_qupv3_wrap0_s3_clk_src.clkr, 3364 [GCC_QUPV3_WRAP0_S4_CLK] = &gcc_qupv3_wrap0_s4_clk.clkr, 3365 [GCC_QUPV3_WRAP0_S4_CLK_SRC] = &gcc_qupv3_wrap0_s4_clk_src.clkr, 3366 [GCC_QUPV3_WRAP0_S5_CLK] = &gcc_qupv3_wrap0_s5_clk.clkr, 3367 [GCC_QUPV3_WRAP0_S5_CLK_SRC] = &gcc_qupv3_wrap0_s5_clk_src.clkr, 3368 [GCC_QUPV3_WRAP_0_M_AHB_CLK] = &gcc_qupv3_wrap_0_m_ahb_clk.clkr, 3369 [GCC_QUPV3_WRAP_0_S_AHB_CLK] = &gcc_qupv3_wrap_0_s_ahb_clk.clkr, 3370 [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr, 3371 [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr, 3372 [GCC_SDCC1_APPS_CLK_SRC] = &gcc_sdcc1_apps_clk_src.clkr, 3373 [GCC_SDCC1_ICE_CORE_CLK] = &gcc_sdcc1_ice_core_clk.clkr, 3374 [GCC_SDCC1_ICE_CORE_CLK_SRC] = &gcc_sdcc1_ice_core_clk_src.clkr, 3375 [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr, 3376 [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr, 3377 [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr, 3378 [GCC_SYS_NOC_CPUSS_AHB_CLK] = &gcc_sys_noc_cpuss_ahb_clk.clkr, 3379 [GCC_SYS_NOC_UFS_PHY_AXI_CLK] = &gcc_sys_noc_ufs_phy_axi_clk.clkr, 3380 [GCC_SYS_NOC_USB3_PRIM_AXI_CLK] = &gcc_sys_noc_usb3_prim_axi_clk.clkr, 3381 [GCC_UFS_CLKREF_CLK] = &gcc_ufs_clkref_clk.clkr, 3382 [GCC_UFS_PHY_AHB_CLK] = &gcc_ufs_phy_ahb_clk.clkr, 3383 [GCC_UFS_PHY_AXI_CLK] = &gcc_ufs_phy_axi_clk.clkr, 3384 [GCC_UFS_PHY_AXI_CLK_SRC] = &gcc_ufs_phy_axi_clk_src.clkr, 3385 [GCC_UFS_PHY_ICE_CORE_CLK] = &gcc_ufs_phy_ice_core_clk.clkr, 3386 [GCC_UFS_PHY_ICE_CORE_CLK_SRC] = &gcc_ufs_phy_ice_core_clk_src.clkr, 3387 [GCC_UFS_PHY_PHY_AUX_CLK] = &gcc_ufs_phy_phy_aux_clk.clkr, 3388 [GCC_UFS_PHY_PHY_AUX_CLK_SRC] = &gcc_ufs_phy_phy_aux_clk_src.clkr, 3389 [GCC_UFS_PHY_RX_SYMBOL_0_CLK] = &gcc_ufs_phy_rx_symbol_0_clk.clkr, 3390 [GCC_UFS_PHY_TX_SYMBOL_0_CLK] = &gcc_ufs_phy_tx_symbol_0_clk.clkr, 3391 [GCC_UFS_PHY_UNIPRO_CORE_CLK] = &gcc_ufs_phy_unipro_core_clk.clkr, 3392 [GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC] = 3393 &gcc_ufs_phy_unipro_core_clk_src.clkr, 3394 [GCC_USB30_PRIM_MASTER_CLK] = &gcc_usb30_prim_master_clk.clkr, 3395 [GCC_USB30_PRIM_MASTER_CLK_SRC] = &gcc_usb30_prim_master_clk_src.clkr, 3396 [GCC_USB30_PRIM_MOCK_UTMI_CLK] = &gcc_usb30_prim_mock_utmi_clk.clkr, 3397 [GCC_USB30_PRIM_MOCK_UTMI_CLK_SRC] = 3398 &gcc_usb30_prim_mock_utmi_clk_src.clkr, 3399 [GCC_USB30_PRIM_MOCK_UTMI_POSTDIV_CLK_SRC] = 3400 &gcc_usb30_prim_mock_utmi_postdiv_clk_src.clkr, 3401 [GCC_USB30_PRIM_SLEEP_CLK] = &gcc_usb30_prim_sleep_clk.clkr, 3402 [GCC_USB3_PRIM_CLKREF_CLK] = &gcc_usb3_prim_clkref_clk.clkr, 3403 [GCC_USB3_PRIM_PHY_AUX_CLK_SRC] = &gcc_usb3_prim_phy_aux_clk_src.clkr, 3404 [GCC_USB3_PRIM_PHY_COM_AUX_CLK] = &gcc_usb3_prim_phy_com_aux_clk.clkr, 3405 [GCC_USB3_PRIM_PHY_PIPE_CLK] = &gcc_usb3_prim_phy_pipe_clk.clkr, 3406 [GCC_VCODEC0_AXI_CLK] = &gcc_vcodec0_axi_clk.clkr, 3407 [GCC_VENUS_AHB_CLK] = &gcc_venus_ahb_clk.clkr, 3408 [GCC_VENUS_CTL_AXI_CLK] = &gcc_venus_ctl_axi_clk.clkr, 3409 [GCC_VIDEO_AHB_CLK] = &gcc_video_ahb_clk.clkr, 3410 [GCC_VIDEO_AXI0_CLK] = &gcc_video_axi0_clk.clkr, 3411 [GCC_VIDEO_THROTTLE_CORE_CLK] = &gcc_video_throttle_core_clk.clkr, 3412 [GCC_VIDEO_VCODEC0_SYS_CLK] = &gcc_video_vcodec0_sys_clk.clkr, 3413 [GCC_VIDEO_VENUS_CLK_SRC] = &gcc_video_venus_clk_src.clkr, 3414 [GCC_VIDEO_VENUS_CTL_CLK] = &gcc_video_venus_ctl_clk.clkr, 3415 [GCC_VIDEO_XO_CLK] = &gcc_video_xo_clk.clkr, 3416 [GPLL0] = &gpll0.clkr, 3417 [GPLL0_OUT_AUX2] = &gpll0_out_aux2.clkr, 3418 [GPLL0_OUT_MAIN] = &gpll0_out_main.clkr, 3419 [GPLL10] = &gpll10.clkr, 3420 [GPLL10_OUT_MAIN] = &gpll10_out_main.clkr, 3421 [GPLL11] = &gpll11.clkr, 3422 [GPLL11_OUT_MAIN] = &gpll11_out_main.clkr, 3423 [GPLL3] = &gpll3.clkr, 3424 [GPLL4] = &gpll4.clkr, 3425 [GPLL4_OUT_MAIN] = &gpll4_out_main.clkr, 3426 [GPLL6] = &gpll6.clkr, 3427 [GPLL6_OUT_MAIN] = &gpll6_out_main.clkr, 3428 [GPLL7] = &gpll7.clkr, 3429 [GPLL7_OUT_MAIN] = &gpll7_out_main.clkr, 3430 [GPLL8] = &gpll8.clkr, 3431 [GPLL8_OUT_MAIN] = &gpll8_out_main.clkr, 3432 [GPLL9] = &gpll9.clkr, 3433 [GPLL9_OUT_MAIN] = &gpll9_out_main.clkr, 3434 }; 3435 3436 static const struct qcom_reset_map gcc_sm6115_resets[] = { 3437 [GCC_QUSB2PHY_PRIM_BCR] = { 0x1c000 }, 3438 [GCC_QUSB2PHY_SEC_BCR] = { 0x1c004 }, 3439 [GCC_SDCC1_BCR] = { 0x38000 }, 3440 [GCC_SDCC2_BCR] = { 0x1e000 }, 3441 [GCC_UFS_PHY_BCR] = { 0x45000 }, 3442 [GCC_USB30_PRIM_BCR] = { 0x1a000 }, 3443 [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x1d000 }, 3444 [GCC_USB3PHY_PHY_PRIM_SP0_BCR] = { 0x1b008 }, 3445 [GCC_USB3_PHY_PRIM_SP0_BCR] = { 0x1b000 }, 3446 [GCC_VCODEC0_BCR] = { 0x58094 }, 3447 [GCC_VENUS_BCR] = { 0x58078 }, 3448 [GCC_VIDEO_INTERFACE_BCR] = { 0x6e000 }, 3449 }; 3450 3451 static struct gdsc *gcc_sm6115_gdscs[] = { 3452 [GCC_CAMSS_TOP_GDSC] = &gcc_camss_top_gdsc, 3453 [GCC_UFS_PHY_GDSC] = &gcc_ufs_phy_gdsc, 3454 [GCC_USB30_PRIM_GDSC] = &gcc_usb30_prim_gdsc, 3455 [GCC_VCODEC0_GDSC] = &gcc_vcodec0_gdsc, 3456 [GCC_VENUS_GDSC] = &gcc_venus_gdsc, 3457 [HLOS1_VOTE_TURING_MMU_TBU1_GDSC] = &hlos1_vote_turing_mmu_tbu1_gdsc, 3458 [HLOS1_VOTE_TURING_MMU_TBU0_GDSC] = &hlos1_vote_turing_mmu_tbu0_gdsc, 3459 [HLOS1_VOTE_MM_SNOC_MMU_TBU_RT_GDSC] = &hlos1_vote_mm_snoc_mmu_tbu_rt_gdsc, 3460 [HLOS1_VOTE_MM_SNOC_MMU_TBU_NRT_GDSC] = &hlos1_vote_mm_snoc_mmu_tbu_nrt_gdsc, 3461 }; 3462 3463 static const struct clk_rcg_dfs_data gcc_dfs_clocks[] = { 3464 DEFINE_RCG_DFS(gcc_qupv3_wrap0_s0_clk_src), 3465 DEFINE_RCG_DFS(gcc_qupv3_wrap0_s1_clk_src), 3466 DEFINE_RCG_DFS(gcc_qupv3_wrap0_s2_clk_src), 3467 DEFINE_RCG_DFS(gcc_qupv3_wrap0_s3_clk_src), 3468 DEFINE_RCG_DFS(gcc_qupv3_wrap0_s4_clk_src), 3469 DEFINE_RCG_DFS(gcc_qupv3_wrap0_s5_clk_src), 3470 }; 3471 3472 static const struct regmap_config gcc_sm6115_regmap_config = { 3473 .reg_bits = 32, 3474 .reg_stride = 4, 3475 .val_bits = 32, 3476 .max_register = 0xc7000, 3477 .fast_io = true, 3478 }; 3479 3480 static const struct qcom_cc_desc gcc_sm6115_desc = { 3481 .config = &gcc_sm6115_regmap_config, 3482 .clks = gcc_sm6115_clocks, 3483 .num_clks = ARRAY_SIZE(gcc_sm6115_clocks), 3484 .resets = gcc_sm6115_resets, 3485 .num_resets = ARRAY_SIZE(gcc_sm6115_resets), 3486 .gdscs = gcc_sm6115_gdscs, 3487 .num_gdscs = ARRAY_SIZE(gcc_sm6115_gdscs), 3488 }; 3489 3490 static const struct of_device_id gcc_sm6115_match_table[] = { 3491 { .compatible = "qcom,gcc-sm6115" }, 3492 { } 3493 }; 3494 MODULE_DEVICE_TABLE(of, gcc_sm6115_match_table); 3495 3496 static int gcc_sm6115_probe(struct platform_device *pdev) 3497 { 3498 struct regmap *regmap; 3499 int ret; 3500 3501 regmap = qcom_cc_map(pdev, &gcc_sm6115_desc); 3502 if (IS_ERR(regmap)) 3503 return PTR_ERR(regmap); 3504 3505 ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, 3506 ARRAY_SIZE(gcc_dfs_clocks)); 3507 if (ret) 3508 return ret; 3509 3510 clk_alpha_pll_configure(&gpll8, regmap, &gpll8_config); 3511 clk_alpha_pll_configure(&gpll9, regmap, &gpll9_config); 3512 clk_alpha_pll_configure(&gpll10, regmap, &gpll10_config); 3513 clk_alpha_pll_configure(&gpll11, regmap, &gpll11_config); 3514 3515 return qcom_cc_really_probe(pdev, &gcc_sm6115_desc, regmap); 3516 } 3517 3518 static struct platform_driver gcc_sm6115_driver = { 3519 .probe = gcc_sm6115_probe, 3520 .driver = { 3521 .name = "gcc-sm6115", 3522 .of_match_table = gcc_sm6115_match_table, 3523 }, 3524 }; 3525 3526 static int __init gcc_sm6115_init(void) 3527 { 3528 return platform_driver_register(&gcc_sm6115_driver); 3529 } 3530 subsys_initcall(gcc_sm6115_init); 3531 3532 static void __exit gcc_sm6115_exit(void) 3533 { 3534 platform_driver_unregister(&gcc_sm6115_driver); 3535 } 3536 module_exit(gcc_sm6115_exit); 3537 3538 MODULE_DESCRIPTION("QTI GCC SM6115 and SM4250 Driver"); 3539 MODULE_LICENSE("GPL v2"); 3540 MODULE_ALIAS("platform:gcc-sm6115"); 3541