1 /* 2 * Copyright (c) 2015, The Linux Foundation. All rights reserved. 3 * 4 * This software is licensed under the terms of the GNU General Public 5 * License version 2, as published by the Free Software Foundation, and 6 * may be copied, distributed, and modified under those terms. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 */ 13 14 #include <linux/kernel.h> 15 #include <linux/bitops.h> 16 #include <linux/err.h> 17 #include <linux/platform_device.h> 18 #include <linux/module.h> 19 #include <linux/of.h> 20 #include <linux/of_device.h> 21 #include <linux/clk-provider.h> 22 #include <linux/regmap.h> 23 #include <linux/reset-controller.h> 24 25 #include <dt-bindings/clock/qcom,gcc-msm8996.h> 26 27 #include "common.h" 28 #include "clk-regmap.h" 29 #include "clk-alpha-pll.h" 30 #include "clk-rcg.h" 31 #include "clk-branch.h" 32 #include "reset.h" 33 #include "gdsc.h" 34 35 #define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) } 36 37 enum { 38 P_XO, 39 P_GPLL0, 40 P_GPLL2, 41 P_GPLL3, 42 P_GPLL1, 43 P_GPLL2_EARLY, 44 P_GPLL0_EARLY_DIV, 45 P_SLEEP_CLK, 46 P_GPLL4, 47 P_AUD_REF_CLK, 48 P_GPLL1_EARLY_DIV 49 }; 50 51 static const struct parent_map gcc_sleep_clk_map[] = { 52 { P_SLEEP_CLK, 5 } 53 }; 54 55 static const char * const gcc_sleep_clk[] = { 56 "sleep_clk" 57 }; 58 59 static const struct parent_map gcc_xo_gpll0_map[] = { 60 { P_XO, 0 }, 61 { P_GPLL0, 1 } 62 }; 63 64 static const char * const gcc_xo_gpll0[] = { 65 "xo", 66 "gpll0" 67 }; 68 69 static const struct parent_map gcc_xo_sleep_clk_map[] = { 70 { P_XO, 0 }, 71 { P_SLEEP_CLK, 5 } 72 }; 73 74 static const char * const gcc_xo_sleep_clk[] = { 75 "xo", 76 "sleep_clk" 77 }; 78 79 static const struct parent_map gcc_xo_gpll0_gpll0_early_div_map[] = { 80 { P_XO, 0 }, 81 { P_GPLL0, 1 }, 82 { P_GPLL0_EARLY_DIV, 6 } 83 }; 84 85 static const char * const gcc_xo_gpll0_gpll0_early_div[] = { 86 "xo", 87 "gpll0", 88 "gpll0_early_div" 89 }; 90 91 static const struct parent_map gcc_xo_gpll0_gpll4_map[] = { 92 { P_XO, 0 }, 93 { P_GPLL0, 1 }, 94 { P_GPLL4, 5 } 95 }; 96 97 static const char * const gcc_xo_gpll0_gpll4[] = { 98 "xo", 99 "gpll0", 100 "gpll4" 101 }; 102 103 static const struct parent_map gcc_xo_gpll0_aud_ref_clk_map[] = { 104 { P_XO, 0 }, 105 { P_GPLL0, 1 }, 106 { P_AUD_REF_CLK, 2 } 107 }; 108 109 static const char * const gcc_xo_gpll0_aud_ref_clk[] = { 110 "xo", 111 "gpll0", 112 "aud_ref_clk" 113 }; 114 115 static const struct parent_map gcc_xo_gpll0_sleep_clk_gpll0_early_div_map[] = { 116 { P_XO, 0 }, 117 { P_GPLL0, 1 }, 118 { P_SLEEP_CLK, 5 }, 119 { P_GPLL0_EARLY_DIV, 6 } 120 }; 121 122 static const char * const gcc_xo_gpll0_sleep_clk_gpll0_early_div[] = { 123 "xo", 124 "gpll0", 125 "sleep_clk", 126 "gpll0_early_div" 127 }; 128 129 static const struct parent_map gcc_xo_gpll0_gpll4_gpll0_early_div_map[] = { 130 { P_XO, 0 }, 131 { P_GPLL0, 1 }, 132 { P_GPLL4, 5 }, 133 { P_GPLL0_EARLY_DIV, 6 } 134 }; 135 136 static const char * const gcc_xo_gpll0_gpll4_gpll0_early_div[] = { 137 "xo", 138 "gpll0", 139 "gpll4", 140 "gpll0_early_div" 141 }; 142 143 static const struct parent_map gcc_xo_gpll0_gpll2_gpll3_gpll0_early_div_map[] = { 144 { P_XO, 0 }, 145 { P_GPLL0, 1 }, 146 { P_GPLL2, 2 }, 147 { P_GPLL3, 3 }, 148 { P_GPLL0_EARLY_DIV, 6 } 149 }; 150 151 static const char * const gcc_xo_gpll0_gpll2_gpll3_gpll0_early_div[] = { 152 "xo", 153 "gpll0", 154 "gpll2", 155 "gpll3", 156 "gpll0_early_div" 157 }; 158 159 static const struct parent_map gcc_xo_gpll0_gpll1_early_div_gpll1_gpll4_gpll0_early_div_map[] = { 160 { P_XO, 0 }, 161 { P_GPLL0, 1 }, 162 { P_GPLL1_EARLY_DIV, 3 }, 163 { P_GPLL1, 4 }, 164 { P_GPLL4, 5 }, 165 { P_GPLL0_EARLY_DIV, 6 } 166 }; 167 168 static const char * const gcc_xo_gpll0_gpll1_early_div_gpll1_gpll4_gpll0_early_div[] = { 169 "xo", 170 "gpll0", 171 "gpll1_early_div", 172 "gpll1", 173 "gpll4", 174 "gpll0_early_div" 175 }; 176 177 static const struct parent_map gcc_xo_gpll0_gpll2_gpll3_gpll1_gpll2_early_gpll0_early_div_map[] = { 178 { P_XO, 0 }, 179 { P_GPLL0, 1 }, 180 { P_GPLL2, 2 }, 181 { P_GPLL3, 3 }, 182 { P_GPLL1, 4 }, 183 { P_GPLL2_EARLY, 5 }, 184 { P_GPLL0_EARLY_DIV, 6 } 185 }; 186 187 static const char * const gcc_xo_gpll0_gpll2_gpll3_gpll1_gpll2_early_gpll0_early_div[] = { 188 "xo", 189 "gpll0", 190 "gpll2", 191 "gpll3", 192 "gpll1", 193 "gpll2_early", 194 "gpll0_early_div" 195 }; 196 197 static const struct parent_map gcc_xo_gpll0_gpll2_gpll3_gpll1_gpll4_gpll0_early_div_map[] = { 198 { P_XO, 0 }, 199 { P_GPLL0, 1 }, 200 { P_GPLL2, 2 }, 201 { P_GPLL3, 3 }, 202 { P_GPLL1, 4 }, 203 { P_GPLL4, 5 }, 204 { P_GPLL0_EARLY_DIV, 6 } 205 }; 206 207 static const char * const gcc_xo_gpll0_gpll2_gpll3_gpll1_gpll4_gpll0_early_div[] = { 208 "xo", 209 "gpll0", 210 "gpll2", 211 "gpll3", 212 "gpll1", 213 "gpll4", 214 "gpll0_early_div" 215 }; 216 217 static struct clk_fixed_factor xo = { 218 .mult = 1, 219 .div = 1, 220 .hw.init = &(struct clk_init_data){ 221 .name = "xo", 222 .parent_names = (const char *[]){ "xo_board" }, 223 .num_parents = 1, 224 .ops = &clk_fixed_factor_ops, 225 }, 226 }; 227 228 static struct clk_alpha_pll gpll0_early = { 229 .offset = 0x00000, 230 .clkr = { 231 .enable_reg = 0x52000, 232 .enable_mask = BIT(0), 233 .hw.init = &(struct clk_init_data){ 234 .name = "gpll0_early", 235 .parent_names = (const char *[]){ "xo" }, 236 .num_parents = 1, 237 .ops = &clk_alpha_pll_ops, 238 }, 239 }, 240 }; 241 242 static struct clk_fixed_factor gpll0_early_div = { 243 .mult = 1, 244 .div = 2, 245 .hw.init = &(struct clk_init_data){ 246 .name = "gpll0_early_div", 247 .parent_names = (const char *[]){ "gpll0_early" }, 248 .num_parents = 1, 249 .ops = &clk_fixed_factor_ops, 250 }, 251 }; 252 253 static struct clk_alpha_pll_postdiv gpll0 = { 254 .offset = 0x00000, 255 .clkr.hw.init = &(struct clk_init_data){ 256 .name = "gpll0", 257 .parent_names = (const char *[]){ "gpll0_early" }, 258 .num_parents = 1, 259 .ops = &clk_alpha_pll_postdiv_ops, 260 }, 261 }; 262 263 static struct clk_alpha_pll gpll4_early = { 264 .offset = 0x77000, 265 .clkr = { 266 .enable_reg = 0x52000, 267 .enable_mask = BIT(4), 268 .hw.init = &(struct clk_init_data){ 269 .name = "gpll4_early", 270 .parent_names = (const char *[]){ "xo" }, 271 .num_parents = 1, 272 .ops = &clk_alpha_pll_ops, 273 }, 274 }, 275 }; 276 277 static struct clk_alpha_pll_postdiv gpll4 = { 278 .offset = 0x77000, 279 .clkr.hw.init = &(struct clk_init_data){ 280 .name = "gpll4", 281 .parent_names = (const char *[]){ "gpll4_early" }, 282 .num_parents = 1, 283 .ops = &clk_alpha_pll_postdiv_ops, 284 }, 285 }; 286 287 static const struct freq_tbl ftbl_system_noc_clk_src[] = { 288 F(19200000, P_XO, 1, 0, 0), 289 F(50000000, P_GPLL0_EARLY_DIV, 6, 0, 0), 290 F(100000000, P_GPLL0, 6, 0, 0), 291 F(150000000, P_GPLL0, 4, 0, 0), 292 F(200000000, P_GPLL0, 3, 0, 0), 293 F(240000000, P_GPLL0, 2.5, 0, 0), 294 { } 295 }; 296 297 static struct clk_rcg2 system_noc_clk_src = { 298 .cmd_rcgr = 0x0401c, 299 .hid_width = 5, 300 .parent_map = gcc_xo_gpll0_gpll2_gpll3_gpll1_gpll2_early_gpll0_early_div_map, 301 .freq_tbl = ftbl_system_noc_clk_src, 302 .clkr.hw.init = &(struct clk_init_data){ 303 .name = "system_noc_clk_src", 304 .parent_names = gcc_xo_gpll0_gpll2_gpll3_gpll1_gpll2_early_gpll0_early_div, 305 .num_parents = 7, 306 .ops = &clk_rcg2_ops, 307 }, 308 }; 309 310 static const struct freq_tbl ftbl_config_noc_clk_src[] = { 311 F(19200000, P_XO, 1, 0, 0), 312 F(37500000, P_GPLL0, 16, 0, 0), 313 F(75000000, P_GPLL0, 8, 0, 0), 314 { } 315 }; 316 317 static struct clk_rcg2 config_noc_clk_src = { 318 .cmd_rcgr = 0x0500c, 319 .hid_width = 5, 320 .parent_map = gcc_xo_gpll0_map, 321 .freq_tbl = ftbl_config_noc_clk_src, 322 .clkr.hw.init = &(struct clk_init_data){ 323 .name = "config_noc_clk_src", 324 .parent_names = gcc_xo_gpll0, 325 .num_parents = 2, 326 .ops = &clk_rcg2_ops, 327 }, 328 }; 329 330 static const struct freq_tbl ftbl_periph_noc_clk_src[] = { 331 F(19200000, P_XO, 1, 0, 0), 332 F(37500000, P_GPLL0, 16, 0, 0), 333 F(50000000, P_GPLL0, 12, 0, 0), 334 F(75000000, P_GPLL0, 8, 0, 0), 335 F(100000000, P_GPLL0, 6, 0, 0), 336 { } 337 }; 338 339 static struct clk_rcg2 periph_noc_clk_src = { 340 .cmd_rcgr = 0x06014, 341 .hid_width = 5, 342 .parent_map = gcc_xo_gpll0_map, 343 .freq_tbl = ftbl_periph_noc_clk_src, 344 .clkr.hw.init = &(struct clk_init_data){ 345 .name = "periph_noc_clk_src", 346 .parent_names = gcc_xo_gpll0, 347 .num_parents = 2, 348 .ops = &clk_rcg2_ops, 349 }, 350 }; 351 352 static const struct freq_tbl ftbl_usb30_master_clk_src[] = { 353 F(19200000, P_XO, 1, 0, 0), 354 F(120000000, P_GPLL0, 5, 0, 0), 355 F(150000000, P_GPLL0, 4, 0, 0), 356 { } 357 }; 358 359 static struct clk_rcg2 usb30_master_clk_src = { 360 .cmd_rcgr = 0x0f014, 361 .mnd_width = 8, 362 .hid_width = 5, 363 .parent_map = gcc_xo_gpll0_gpll0_early_div_map, 364 .freq_tbl = ftbl_usb30_master_clk_src, 365 .clkr.hw.init = &(struct clk_init_data){ 366 .name = "usb30_master_clk_src", 367 .parent_names = gcc_xo_gpll0_gpll0_early_div, 368 .num_parents = 3, 369 .ops = &clk_rcg2_ops, 370 }, 371 }; 372 373 static const struct freq_tbl ftbl_usb30_mock_utmi_clk_src[] = { 374 F(19200000, P_XO, 1, 0, 0), 375 { } 376 }; 377 378 static struct clk_rcg2 usb30_mock_utmi_clk_src = { 379 .cmd_rcgr = 0x0f028, 380 .hid_width = 5, 381 .parent_map = gcc_xo_gpll0_gpll0_early_div_map, 382 .freq_tbl = ftbl_usb30_mock_utmi_clk_src, 383 .clkr.hw.init = &(struct clk_init_data){ 384 .name = "usb30_mock_utmi_clk_src", 385 .parent_names = gcc_xo_gpll0_gpll0_early_div, 386 .num_parents = 3, 387 .ops = &clk_rcg2_ops, 388 }, 389 }; 390 391 static const struct freq_tbl ftbl_usb3_phy_aux_clk_src[] = { 392 F(1200000, P_XO, 16, 0, 0), 393 { } 394 }; 395 396 static struct clk_rcg2 usb3_phy_aux_clk_src = { 397 .cmd_rcgr = 0x5000c, 398 .hid_width = 5, 399 .parent_map = gcc_xo_sleep_clk_map, 400 .freq_tbl = ftbl_usb3_phy_aux_clk_src, 401 .clkr.hw.init = &(struct clk_init_data){ 402 .name = "usb3_phy_aux_clk_src", 403 .parent_names = gcc_xo_sleep_clk, 404 .num_parents = 2, 405 .ops = &clk_rcg2_ops, 406 }, 407 }; 408 409 static const struct freq_tbl ftbl_usb20_master_clk_src[] = { 410 F(120000000, P_GPLL0, 5, 0, 0), 411 { } 412 }; 413 414 static struct clk_rcg2 usb20_master_clk_src = { 415 .cmd_rcgr = 0x12010, 416 .mnd_width = 8, 417 .hid_width = 5, 418 .parent_map = gcc_xo_gpll0_gpll0_early_div_map, 419 .freq_tbl = ftbl_usb20_master_clk_src, 420 .clkr.hw.init = &(struct clk_init_data){ 421 .name = "usb20_master_clk_src", 422 .parent_names = gcc_xo_gpll0_gpll0_early_div, 423 .num_parents = 3, 424 .ops = &clk_rcg2_ops, 425 }, 426 }; 427 428 static struct clk_rcg2 usb20_mock_utmi_clk_src = { 429 .cmd_rcgr = 0x12024, 430 .hid_width = 5, 431 .parent_map = gcc_xo_gpll0_gpll0_early_div_map, 432 .freq_tbl = ftbl_usb30_mock_utmi_clk_src, 433 .clkr.hw.init = &(struct clk_init_data){ 434 .name = "usb20_mock_utmi_clk_src", 435 .parent_names = gcc_xo_gpll0_gpll0_early_div, 436 .num_parents = 3, 437 .ops = &clk_rcg2_ops, 438 }, 439 }; 440 441 static const struct freq_tbl ftbl_sdcc1_apps_clk_src[] = { 442 F(144000, P_XO, 16, 3, 25), 443 F(400000, P_XO, 12, 1, 4), 444 F(20000000, P_GPLL0, 15, 1, 2), 445 F(25000000, P_GPLL0, 12, 1, 2), 446 F(50000000, P_GPLL0, 12, 0, 0), 447 F(96000000, P_GPLL4, 4, 0, 0), 448 F(192000000, P_GPLL4, 2, 0, 0), 449 F(384000000, P_GPLL4, 1, 0, 0), 450 { } 451 }; 452 453 static struct clk_rcg2 sdcc1_apps_clk_src = { 454 .cmd_rcgr = 0x13010, 455 .mnd_width = 8, 456 .hid_width = 5, 457 .parent_map = gcc_xo_gpll0_gpll4_gpll0_early_div_map, 458 .freq_tbl = ftbl_sdcc1_apps_clk_src, 459 .clkr.hw.init = &(struct clk_init_data){ 460 .name = "sdcc1_apps_clk_src", 461 .parent_names = gcc_xo_gpll0_gpll4_gpll0_early_div, 462 .num_parents = 4, 463 .ops = &clk_rcg2_floor_ops, 464 }, 465 }; 466 467 static struct freq_tbl ftbl_sdcc1_ice_core_clk_src[] = { 468 F(19200000, P_XO, 1, 0, 0), 469 F(150000000, P_GPLL0, 4, 0, 0), 470 F(300000000, P_GPLL0, 2, 0, 0), 471 { } 472 }; 473 474 static struct clk_rcg2 sdcc1_ice_core_clk_src = { 475 .cmd_rcgr = 0x13024, 476 .hid_width = 5, 477 .parent_map = gcc_xo_gpll0_gpll4_gpll0_early_div_map, 478 .freq_tbl = ftbl_sdcc1_ice_core_clk_src, 479 .clkr.hw.init = &(struct clk_init_data){ 480 .name = "sdcc1_ice_core_clk_src", 481 .parent_names = gcc_xo_gpll0_gpll4_gpll0_early_div, 482 .num_parents = 4, 483 .ops = &clk_rcg2_ops, 484 }, 485 }; 486 487 static const struct freq_tbl ftbl_sdcc2_apps_clk_src[] = { 488 F(144000, P_XO, 16, 3, 25), 489 F(400000, P_XO, 12, 1, 4), 490 F(20000000, P_GPLL0, 15, 1, 2), 491 F(25000000, P_GPLL0, 12, 1, 2), 492 F(50000000, P_GPLL0, 12, 0, 0), 493 F(100000000, P_GPLL0, 6, 0, 0), 494 F(200000000, P_GPLL0, 3, 0, 0), 495 { } 496 }; 497 498 static struct clk_rcg2 sdcc2_apps_clk_src = { 499 .cmd_rcgr = 0x14010, 500 .mnd_width = 8, 501 .hid_width = 5, 502 .parent_map = gcc_xo_gpll0_gpll4_map, 503 .freq_tbl = ftbl_sdcc2_apps_clk_src, 504 .clkr.hw.init = &(struct clk_init_data){ 505 .name = "sdcc2_apps_clk_src", 506 .parent_names = gcc_xo_gpll0_gpll4, 507 .num_parents = 3, 508 .ops = &clk_rcg2_floor_ops, 509 }, 510 }; 511 512 static struct clk_rcg2 sdcc3_apps_clk_src = { 513 .cmd_rcgr = 0x15010, 514 .mnd_width = 8, 515 .hid_width = 5, 516 .parent_map = gcc_xo_gpll0_gpll4_map, 517 .freq_tbl = ftbl_sdcc2_apps_clk_src, 518 .clkr.hw.init = &(struct clk_init_data){ 519 .name = "sdcc3_apps_clk_src", 520 .parent_names = gcc_xo_gpll0_gpll4, 521 .num_parents = 3, 522 .ops = &clk_rcg2_floor_ops, 523 }, 524 }; 525 526 static const struct freq_tbl ftbl_sdcc4_apps_clk_src[] = { 527 F(144000, P_XO, 16, 3, 25), 528 F(400000, P_XO, 12, 1, 4), 529 F(20000000, P_GPLL0, 15, 1, 2), 530 F(25000000, P_GPLL0, 12, 1, 2), 531 F(50000000, P_GPLL0, 12, 0, 0), 532 F(100000000, P_GPLL0, 6, 0, 0), 533 { } 534 }; 535 536 static struct clk_rcg2 sdcc4_apps_clk_src = { 537 .cmd_rcgr = 0x16010, 538 .mnd_width = 8, 539 .hid_width = 5, 540 .parent_map = gcc_xo_gpll0_map, 541 .freq_tbl = ftbl_sdcc4_apps_clk_src, 542 .clkr.hw.init = &(struct clk_init_data){ 543 .name = "sdcc4_apps_clk_src", 544 .parent_names = gcc_xo_gpll0, 545 .num_parents = 2, 546 .ops = &clk_rcg2_floor_ops, 547 }, 548 }; 549 550 static const struct freq_tbl ftbl_blsp1_qup1_spi_apps_clk_src[] = { 551 F(960000, P_XO, 10, 1, 2), 552 F(4800000, P_XO, 4, 0, 0), 553 F(9600000, P_XO, 2, 0, 0), 554 F(15000000, P_GPLL0, 10, 1, 4), 555 F(19200000, P_XO, 1, 0, 0), 556 F(25000000, P_GPLL0, 12, 1, 2), 557 F(50000000, P_GPLL0, 12, 0, 0), 558 { } 559 }; 560 561 static struct clk_rcg2 blsp1_qup1_spi_apps_clk_src = { 562 .cmd_rcgr = 0x1900c, 563 .mnd_width = 8, 564 .hid_width = 5, 565 .parent_map = gcc_xo_gpll0_map, 566 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 567 .clkr.hw.init = &(struct clk_init_data){ 568 .name = "blsp1_qup1_spi_apps_clk_src", 569 .parent_names = gcc_xo_gpll0, 570 .num_parents = 2, 571 .ops = &clk_rcg2_ops, 572 }, 573 }; 574 575 static const struct freq_tbl ftbl_blsp1_qup1_i2c_apps_clk_src[] = { 576 F(19200000, P_XO, 1, 0, 0), 577 F(50000000, P_GPLL0, 12, 0, 0), 578 { } 579 }; 580 581 static struct clk_rcg2 blsp1_qup1_i2c_apps_clk_src = { 582 .cmd_rcgr = 0x19020, 583 .hid_width = 5, 584 .parent_map = gcc_xo_gpll0_map, 585 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 586 .clkr.hw.init = &(struct clk_init_data){ 587 .name = "blsp1_qup1_i2c_apps_clk_src", 588 .parent_names = gcc_xo_gpll0, 589 .num_parents = 2, 590 .ops = &clk_rcg2_ops, 591 }, 592 }; 593 594 static const struct freq_tbl ftbl_blsp1_uart1_apps_clk_src[] = { 595 F(3686400, P_GPLL0, 1, 96, 15625), 596 F(7372800, P_GPLL0, 1, 192, 15625), 597 F(14745600, P_GPLL0, 1, 384, 15625), 598 F(16000000, P_GPLL0, 5, 2, 15), 599 F(19200000, P_XO, 1, 0, 0), 600 F(24000000, P_GPLL0, 5, 1, 5), 601 F(32000000, P_GPLL0, 1, 4, 75), 602 F(40000000, P_GPLL0, 15, 0, 0), 603 F(46400000, P_GPLL0, 1, 29, 375), 604 F(48000000, P_GPLL0, 12.5, 0, 0), 605 F(51200000, P_GPLL0, 1, 32, 375), 606 F(56000000, P_GPLL0, 1, 7, 75), 607 F(58982400, P_GPLL0, 1, 1536, 15625), 608 F(60000000, P_GPLL0, 10, 0, 0), 609 F(63157895, P_GPLL0, 9.5, 0, 0), 610 { } 611 }; 612 613 static struct clk_rcg2 blsp1_uart1_apps_clk_src = { 614 .cmd_rcgr = 0x1a00c, 615 .mnd_width = 16, 616 .hid_width = 5, 617 .parent_map = gcc_xo_gpll0_map, 618 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 619 .clkr.hw.init = &(struct clk_init_data){ 620 .name = "blsp1_uart1_apps_clk_src", 621 .parent_names = gcc_xo_gpll0, 622 .num_parents = 2, 623 .ops = &clk_rcg2_ops, 624 }, 625 }; 626 627 static struct clk_rcg2 blsp1_qup2_spi_apps_clk_src = { 628 .cmd_rcgr = 0x1b00c, 629 .mnd_width = 8, 630 .hid_width = 5, 631 .parent_map = gcc_xo_gpll0_map, 632 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 633 .clkr.hw.init = &(struct clk_init_data){ 634 .name = "blsp1_qup2_spi_apps_clk_src", 635 .parent_names = gcc_xo_gpll0, 636 .num_parents = 2, 637 .ops = &clk_rcg2_ops, 638 }, 639 }; 640 641 static struct clk_rcg2 blsp1_qup2_i2c_apps_clk_src = { 642 .cmd_rcgr = 0x1b020, 643 .hid_width = 5, 644 .parent_map = gcc_xo_gpll0_map, 645 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 646 .clkr.hw.init = &(struct clk_init_data){ 647 .name = "blsp1_qup2_i2c_apps_clk_src", 648 .parent_names = gcc_xo_gpll0, 649 .num_parents = 2, 650 .ops = &clk_rcg2_ops, 651 }, 652 }; 653 654 static struct clk_rcg2 blsp1_uart2_apps_clk_src = { 655 .cmd_rcgr = 0x1c00c, 656 .mnd_width = 16, 657 .hid_width = 5, 658 .parent_map = gcc_xo_gpll0_map, 659 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 660 .clkr.hw.init = &(struct clk_init_data){ 661 .name = "blsp1_uart2_apps_clk_src", 662 .parent_names = gcc_xo_gpll0, 663 .num_parents = 2, 664 .ops = &clk_rcg2_ops, 665 }, 666 }; 667 668 static struct clk_rcg2 blsp1_qup3_spi_apps_clk_src = { 669 .cmd_rcgr = 0x1d00c, 670 .mnd_width = 8, 671 .hid_width = 5, 672 .parent_map = gcc_xo_gpll0_map, 673 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 674 .clkr.hw.init = &(struct clk_init_data){ 675 .name = "blsp1_qup3_spi_apps_clk_src", 676 .parent_names = gcc_xo_gpll0, 677 .num_parents = 2, 678 .ops = &clk_rcg2_ops, 679 }, 680 }; 681 682 static struct clk_rcg2 blsp1_qup3_i2c_apps_clk_src = { 683 .cmd_rcgr = 0x1d020, 684 .hid_width = 5, 685 .parent_map = gcc_xo_gpll0_map, 686 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 687 .clkr.hw.init = &(struct clk_init_data){ 688 .name = "blsp1_qup3_i2c_apps_clk_src", 689 .parent_names = gcc_xo_gpll0, 690 .num_parents = 2, 691 .ops = &clk_rcg2_ops, 692 }, 693 }; 694 695 static struct clk_rcg2 blsp1_uart3_apps_clk_src = { 696 .cmd_rcgr = 0x1e00c, 697 .mnd_width = 16, 698 .hid_width = 5, 699 .parent_map = gcc_xo_gpll0_map, 700 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 701 .clkr.hw.init = &(struct clk_init_data){ 702 .name = "blsp1_uart3_apps_clk_src", 703 .parent_names = gcc_xo_gpll0, 704 .num_parents = 2, 705 .ops = &clk_rcg2_ops, 706 }, 707 }; 708 709 static struct clk_rcg2 blsp1_qup4_spi_apps_clk_src = { 710 .cmd_rcgr = 0x1f00c, 711 .mnd_width = 8, 712 .hid_width = 5, 713 .parent_map = gcc_xo_gpll0_map, 714 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 715 .clkr.hw.init = &(struct clk_init_data){ 716 .name = "blsp1_qup4_spi_apps_clk_src", 717 .parent_names = gcc_xo_gpll0, 718 .num_parents = 2, 719 .ops = &clk_rcg2_ops, 720 }, 721 }; 722 723 static struct clk_rcg2 blsp1_qup4_i2c_apps_clk_src = { 724 .cmd_rcgr = 0x1f020, 725 .hid_width = 5, 726 .parent_map = gcc_xo_gpll0_map, 727 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 728 .clkr.hw.init = &(struct clk_init_data){ 729 .name = "blsp1_qup4_i2c_apps_clk_src", 730 .parent_names = gcc_xo_gpll0, 731 .num_parents = 2, 732 .ops = &clk_rcg2_ops, 733 }, 734 }; 735 736 static struct clk_rcg2 blsp1_uart4_apps_clk_src = { 737 .cmd_rcgr = 0x2000c, 738 .mnd_width = 16, 739 .hid_width = 5, 740 .parent_map = gcc_xo_gpll0_map, 741 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 742 .clkr.hw.init = &(struct clk_init_data){ 743 .name = "blsp1_uart4_apps_clk_src", 744 .parent_names = gcc_xo_gpll0, 745 .num_parents = 2, 746 .ops = &clk_rcg2_ops, 747 }, 748 }; 749 750 static struct clk_rcg2 blsp1_qup5_spi_apps_clk_src = { 751 .cmd_rcgr = 0x2100c, 752 .mnd_width = 8, 753 .hid_width = 5, 754 .parent_map = gcc_xo_gpll0_map, 755 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 756 .clkr.hw.init = &(struct clk_init_data){ 757 .name = "blsp1_qup5_spi_apps_clk_src", 758 .parent_names = gcc_xo_gpll0, 759 .num_parents = 2, 760 .ops = &clk_rcg2_ops, 761 }, 762 }; 763 764 static struct clk_rcg2 blsp1_qup5_i2c_apps_clk_src = { 765 .cmd_rcgr = 0x21020, 766 .hid_width = 5, 767 .parent_map = gcc_xo_gpll0_map, 768 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 769 .clkr.hw.init = &(struct clk_init_data){ 770 .name = "blsp1_qup5_i2c_apps_clk_src", 771 .parent_names = gcc_xo_gpll0, 772 .num_parents = 2, 773 .ops = &clk_rcg2_ops, 774 }, 775 }; 776 777 static struct clk_rcg2 blsp1_uart5_apps_clk_src = { 778 .cmd_rcgr = 0x2200c, 779 .mnd_width = 16, 780 .hid_width = 5, 781 .parent_map = gcc_xo_gpll0_map, 782 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 783 .clkr.hw.init = &(struct clk_init_data){ 784 .name = "blsp1_uart5_apps_clk_src", 785 .parent_names = gcc_xo_gpll0, 786 .num_parents = 2, 787 .ops = &clk_rcg2_ops, 788 }, 789 }; 790 791 static struct clk_rcg2 blsp1_qup6_spi_apps_clk_src = { 792 .cmd_rcgr = 0x2300c, 793 .mnd_width = 8, 794 .hid_width = 5, 795 .parent_map = gcc_xo_gpll0_map, 796 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 797 .clkr.hw.init = &(struct clk_init_data){ 798 .name = "blsp1_qup6_spi_apps_clk_src", 799 .parent_names = gcc_xo_gpll0, 800 .num_parents = 2, 801 .ops = &clk_rcg2_ops, 802 }, 803 }; 804 805 static struct clk_rcg2 blsp1_qup6_i2c_apps_clk_src = { 806 .cmd_rcgr = 0x23020, 807 .hid_width = 5, 808 .parent_map = gcc_xo_gpll0_map, 809 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 810 .clkr.hw.init = &(struct clk_init_data){ 811 .name = "blsp1_qup6_i2c_apps_clk_src", 812 .parent_names = gcc_xo_gpll0, 813 .num_parents = 2, 814 .ops = &clk_rcg2_ops, 815 }, 816 }; 817 818 static struct clk_rcg2 blsp1_uart6_apps_clk_src = { 819 .cmd_rcgr = 0x2400c, 820 .mnd_width = 16, 821 .hid_width = 5, 822 .parent_map = gcc_xo_gpll0_map, 823 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 824 .clkr.hw.init = &(struct clk_init_data){ 825 .name = "blsp1_uart6_apps_clk_src", 826 .parent_names = gcc_xo_gpll0, 827 .num_parents = 2, 828 .ops = &clk_rcg2_ops, 829 }, 830 }; 831 832 static struct clk_rcg2 blsp2_qup1_spi_apps_clk_src = { 833 .cmd_rcgr = 0x2600c, 834 .mnd_width = 8, 835 .hid_width = 5, 836 .parent_map = gcc_xo_gpll0_map, 837 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 838 .clkr.hw.init = &(struct clk_init_data){ 839 .name = "blsp2_qup1_spi_apps_clk_src", 840 .parent_names = gcc_xo_gpll0, 841 .num_parents = 2, 842 .ops = &clk_rcg2_ops, 843 }, 844 }; 845 846 static struct clk_rcg2 blsp2_qup1_i2c_apps_clk_src = { 847 .cmd_rcgr = 0x26020, 848 .hid_width = 5, 849 .parent_map = gcc_xo_gpll0_map, 850 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 851 .clkr.hw.init = &(struct clk_init_data){ 852 .name = "blsp2_qup1_i2c_apps_clk_src", 853 .parent_names = gcc_xo_gpll0, 854 .num_parents = 2, 855 .ops = &clk_rcg2_ops, 856 }, 857 }; 858 859 static struct clk_rcg2 blsp2_uart1_apps_clk_src = { 860 .cmd_rcgr = 0x2700c, 861 .mnd_width = 16, 862 .hid_width = 5, 863 .parent_map = gcc_xo_gpll0_map, 864 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 865 .clkr.hw.init = &(struct clk_init_data){ 866 .name = "blsp2_uart1_apps_clk_src", 867 .parent_names = gcc_xo_gpll0, 868 .num_parents = 2, 869 .ops = &clk_rcg2_ops, 870 }, 871 }; 872 873 static struct clk_rcg2 blsp2_qup2_spi_apps_clk_src = { 874 .cmd_rcgr = 0x2800c, 875 .mnd_width = 8, 876 .hid_width = 5, 877 .parent_map = gcc_xo_gpll0_map, 878 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 879 .clkr.hw.init = &(struct clk_init_data){ 880 .name = "blsp2_qup2_spi_apps_clk_src", 881 .parent_names = gcc_xo_gpll0, 882 .num_parents = 2, 883 .ops = &clk_rcg2_ops, 884 }, 885 }; 886 887 static struct clk_rcg2 blsp2_qup2_i2c_apps_clk_src = { 888 .cmd_rcgr = 0x28020, 889 .hid_width = 5, 890 .parent_map = gcc_xo_gpll0_map, 891 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 892 .clkr.hw.init = &(struct clk_init_data){ 893 .name = "blsp2_qup2_i2c_apps_clk_src", 894 .parent_names = gcc_xo_gpll0, 895 .num_parents = 2, 896 .ops = &clk_rcg2_ops, 897 }, 898 }; 899 900 static struct clk_rcg2 blsp2_uart2_apps_clk_src = { 901 .cmd_rcgr = 0x2900c, 902 .mnd_width = 16, 903 .hid_width = 5, 904 .parent_map = gcc_xo_gpll0_map, 905 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 906 .clkr.hw.init = &(struct clk_init_data){ 907 .name = "blsp2_uart2_apps_clk_src", 908 .parent_names = gcc_xo_gpll0, 909 .num_parents = 2, 910 .ops = &clk_rcg2_ops, 911 }, 912 }; 913 914 static struct clk_rcg2 blsp2_qup3_spi_apps_clk_src = { 915 .cmd_rcgr = 0x2a00c, 916 .mnd_width = 8, 917 .hid_width = 5, 918 .parent_map = gcc_xo_gpll0_map, 919 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 920 .clkr.hw.init = &(struct clk_init_data){ 921 .name = "blsp2_qup3_spi_apps_clk_src", 922 .parent_names = gcc_xo_gpll0, 923 .num_parents = 2, 924 .ops = &clk_rcg2_ops, 925 }, 926 }; 927 928 static struct clk_rcg2 blsp2_qup3_i2c_apps_clk_src = { 929 .cmd_rcgr = 0x2a020, 930 .hid_width = 5, 931 .parent_map = gcc_xo_gpll0_map, 932 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 933 .clkr.hw.init = &(struct clk_init_data){ 934 .name = "blsp2_qup3_i2c_apps_clk_src", 935 .parent_names = gcc_xo_gpll0, 936 .num_parents = 2, 937 .ops = &clk_rcg2_ops, 938 }, 939 }; 940 941 static struct clk_rcg2 blsp2_uart3_apps_clk_src = { 942 .cmd_rcgr = 0x2b00c, 943 .mnd_width = 16, 944 .hid_width = 5, 945 .parent_map = gcc_xo_gpll0_map, 946 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 947 .clkr.hw.init = &(struct clk_init_data){ 948 .name = "blsp2_uart3_apps_clk_src", 949 .parent_names = gcc_xo_gpll0, 950 .num_parents = 2, 951 .ops = &clk_rcg2_ops, 952 }, 953 }; 954 955 static struct clk_rcg2 blsp2_qup4_spi_apps_clk_src = { 956 .cmd_rcgr = 0x2c00c, 957 .mnd_width = 8, 958 .hid_width = 5, 959 .parent_map = gcc_xo_gpll0_map, 960 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 961 .clkr.hw.init = &(struct clk_init_data){ 962 .name = "blsp2_qup4_spi_apps_clk_src", 963 .parent_names = gcc_xo_gpll0, 964 .num_parents = 2, 965 .ops = &clk_rcg2_ops, 966 }, 967 }; 968 969 static struct clk_rcg2 blsp2_qup4_i2c_apps_clk_src = { 970 .cmd_rcgr = 0x2c020, 971 .hid_width = 5, 972 .parent_map = gcc_xo_gpll0_map, 973 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 974 .clkr.hw.init = &(struct clk_init_data){ 975 .name = "blsp2_qup4_i2c_apps_clk_src", 976 .parent_names = gcc_xo_gpll0, 977 .num_parents = 2, 978 .ops = &clk_rcg2_ops, 979 }, 980 }; 981 982 static struct clk_rcg2 blsp2_uart4_apps_clk_src = { 983 .cmd_rcgr = 0x2d00c, 984 .mnd_width = 16, 985 .hid_width = 5, 986 .parent_map = gcc_xo_gpll0_map, 987 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 988 .clkr.hw.init = &(struct clk_init_data){ 989 .name = "blsp2_uart4_apps_clk_src", 990 .parent_names = gcc_xo_gpll0, 991 .num_parents = 2, 992 .ops = &clk_rcg2_ops, 993 }, 994 }; 995 996 static struct clk_rcg2 blsp2_qup5_spi_apps_clk_src = { 997 .cmd_rcgr = 0x2e00c, 998 .mnd_width = 8, 999 .hid_width = 5, 1000 .parent_map = gcc_xo_gpll0_map, 1001 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 1002 .clkr.hw.init = &(struct clk_init_data){ 1003 .name = "blsp2_qup5_spi_apps_clk_src", 1004 .parent_names = gcc_xo_gpll0, 1005 .num_parents = 2, 1006 .ops = &clk_rcg2_ops, 1007 }, 1008 }; 1009 1010 static struct clk_rcg2 blsp2_qup5_i2c_apps_clk_src = { 1011 .cmd_rcgr = 0x2e020, 1012 .hid_width = 5, 1013 .parent_map = gcc_xo_gpll0_map, 1014 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 1015 .clkr.hw.init = &(struct clk_init_data){ 1016 .name = "blsp2_qup5_i2c_apps_clk_src", 1017 .parent_names = gcc_xo_gpll0, 1018 .num_parents = 2, 1019 .ops = &clk_rcg2_ops, 1020 }, 1021 }; 1022 1023 static struct clk_rcg2 blsp2_uart5_apps_clk_src = { 1024 .cmd_rcgr = 0x2f00c, 1025 .mnd_width = 16, 1026 .hid_width = 5, 1027 .parent_map = gcc_xo_gpll0_map, 1028 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 1029 .clkr.hw.init = &(struct clk_init_data){ 1030 .name = "blsp2_uart5_apps_clk_src", 1031 .parent_names = gcc_xo_gpll0, 1032 .num_parents = 2, 1033 .ops = &clk_rcg2_ops, 1034 }, 1035 }; 1036 1037 static struct clk_rcg2 blsp2_qup6_spi_apps_clk_src = { 1038 .cmd_rcgr = 0x3000c, 1039 .mnd_width = 8, 1040 .hid_width = 5, 1041 .parent_map = gcc_xo_gpll0_map, 1042 .freq_tbl = ftbl_blsp1_qup1_spi_apps_clk_src, 1043 .clkr.hw.init = &(struct clk_init_data){ 1044 .name = "blsp2_qup6_spi_apps_clk_src", 1045 .parent_names = gcc_xo_gpll0, 1046 .num_parents = 2, 1047 .ops = &clk_rcg2_ops, 1048 }, 1049 }; 1050 1051 static struct clk_rcg2 blsp2_qup6_i2c_apps_clk_src = { 1052 .cmd_rcgr = 0x30020, 1053 .hid_width = 5, 1054 .parent_map = gcc_xo_gpll0_map, 1055 .freq_tbl = ftbl_blsp1_qup1_i2c_apps_clk_src, 1056 .clkr.hw.init = &(struct clk_init_data){ 1057 .name = "blsp2_qup6_i2c_apps_clk_src", 1058 .parent_names = gcc_xo_gpll0, 1059 .num_parents = 2, 1060 .ops = &clk_rcg2_ops, 1061 }, 1062 }; 1063 1064 static struct clk_rcg2 blsp2_uart6_apps_clk_src = { 1065 .cmd_rcgr = 0x3100c, 1066 .mnd_width = 16, 1067 .hid_width = 5, 1068 .parent_map = gcc_xo_gpll0_map, 1069 .freq_tbl = ftbl_blsp1_uart1_apps_clk_src, 1070 .clkr.hw.init = &(struct clk_init_data){ 1071 .name = "blsp2_uart6_apps_clk_src", 1072 .parent_names = gcc_xo_gpll0, 1073 .num_parents = 2, 1074 .ops = &clk_rcg2_ops, 1075 }, 1076 }; 1077 1078 static const struct freq_tbl ftbl_pdm2_clk_src[] = { 1079 F(60000000, P_GPLL0, 10, 0, 0), 1080 { } 1081 }; 1082 1083 static struct clk_rcg2 pdm2_clk_src = { 1084 .cmd_rcgr = 0x33010, 1085 .hid_width = 5, 1086 .parent_map = gcc_xo_gpll0_map, 1087 .freq_tbl = ftbl_pdm2_clk_src, 1088 .clkr.hw.init = &(struct clk_init_data){ 1089 .name = "pdm2_clk_src", 1090 .parent_names = gcc_xo_gpll0, 1091 .num_parents = 2, 1092 .ops = &clk_rcg2_ops, 1093 }, 1094 }; 1095 1096 static const struct freq_tbl ftbl_tsif_ref_clk_src[] = { 1097 F(105495, P_XO, 1, 1, 182), 1098 { } 1099 }; 1100 1101 static struct clk_rcg2 tsif_ref_clk_src = { 1102 .cmd_rcgr = 0x36010, 1103 .mnd_width = 8, 1104 .hid_width = 5, 1105 .parent_map = gcc_xo_gpll0_aud_ref_clk_map, 1106 .freq_tbl = ftbl_tsif_ref_clk_src, 1107 .clkr.hw.init = &(struct clk_init_data){ 1108 .name = "tsif_ref_clk_src", 1109 .parent_names = gcc_xo_gpll0_aud_ref_clk, 1110 .num_parents = 3, 1111 .ops = &clk_rcg2_ops, 1112 }, 1113 }; 1114 1115 static struct clk_rcg2 gcc_sleep_clk_src = { 1116 .cmd_rcgr = 0x43014, 1117 .hid_width = 5, 1118 .parent_map = gcc_sleep_clk_map, 1119 .clkr.hw.init = &(struct clk_init_data){ 1120 .name = "gcc_sleep_clk_src", 1121 .parent_names = gcc_sleep_clk, 1122 .num_parents = 1, 1123 .ops = &clk_rcg2_ops, 1124 }, 1125 }; 1126 1127 static struct clk_rcg2 hmss_rbcpr_clk_src = { 1128 .cmd_rcgr = 0x48040, 1129 .hid_width = 5, 1130 .parent_map = gcc_xo_gpll0_map, 1131 .freq_tbl = ftbl_usb30_mock_utmi_clk_src, 1132 .clkr.hw.init = &(struct clk_init_data){ 1133 .name = "hmss_rbcpr_clk_src", 1134 .parent_names = gcc_xo_gpll0, 1135 .num_parents = 2, 1136 .ops = &clk_rcg2_ops, 1137 }, 1138 }; 1139 1140 static struct clk_rcg2 hmss_gpll0_clk_src = { 1141 .cmd_rcgr = 0x48058, 1142 .hid_width = 5, 1143 .parent_map = gcc_xo_gpll0_map, 1144 .clkr.hw.init = &(struct clk_init_data){ 1145 .name = "hmss_gpll0_clk_src", 1146 .parent_names = gcc_xo_gpll0, 1147 .num_parents = 2, 1148 .ops = &clk_rcg2_ops, 1149 }, 1150 }; 1151 1152 static const struct freq_tbl ftbl_gp1_clk_src[] = { 1153 F(19200000, P_XO, 1, 0, 0), 1154 F(100000000, P_GPLL0, 6, 0, 0), 1155 F(200000000, P_GPLL0, 3, 0, 0), 1156 { } 1157 }; 1158 1159 static struct clk_rcg2 gp1_clk_src = { 1160 .cmd_rcgr = 0x64004, 1161 .mnd_width = 8, 1162 .hid_width = 5, 1163 .parent_map = gcc_xo_gpll0_sleep_clk_gpll0_early_div_map, 1164 .freq_tbl = ftbl_gp1_clk_src, 1165 .clkr.hw.init = &(struct clk_init_data){ 1166 .name = "gp1_clk_src", 1167 .parent_names = gcc_xo_gpll0_sleep_clk_gpll0_early_div, 1168 .num_parents = 4, 1169 .ops = &clk_rcg2_ops, 1170 }, 1171 }; 1172 1173 static struct clk_rcg2 gp2_clk_src = { 1174 .cmd_rcgr = 0x65004, 1175 .mnd_width = 8, 1176 .hid_width = 5, 1177 .parent_map = gcc_xo_gpll0_sleep_clk_gpll0_early_div_map, 1178 .freq_tbl = ftbl_gp1_clk_src, 1179 .clkr.hw.init = &(struct clk_init_data){ 1180 .name = "gp2_clk_src", 1181 .parent_names = gcc_xo_gpll0_sleep_clk_gpll0_early_div, 1182 .num_parents = 4, 1183 .ops = &clk_rcg2_ops, 1184 }, 1185 }; 1186 1187 static struct clk_rcg2 gp3_clk_src = { 1188 .cmd_rcgr = 0x66004, 1189 .mnd_width = 8, 1190 .hid_width = 5, 1191 .parent_map = gcc_xo_gpll0_sleep_clk_gpll0_early_div_map, 1192 .freq_tbl = ftbl_gp1_clk_src, 1193 .clkr.hw.init = &(struct clk_init_data){ 1194 .name = "gp3_clk_src", 1195 .parent_names = gcc_xo_gpll0_sleep_clk_gpll0_early_div, 1196 .num_parents = 4, 1197 .ops = &clk_rcg2_ops, 1198 }, 1199 }; 1200 1201 static const struct freq_tbl ftbl_pcie_aux_clk_src[] = { 1202 F(1010526, P_XO, 1, 1, 19), 1203 { } 1204 }; 1205 1206 static struct clk_rcg2 pcie_aux_clk_src = { 1207 .cmd_rcgr = 0x6c000, 1208 .mnd_width = 16, 1209 .hid_width = 5, 1210 .parent_map = gcc_xo_sleep_clk_map, 1211 .freq_tbl = ftbl_pcie_aux_clk_src, 1212 .clkr.hw.init = &(struct clk_init_data){ 1213 .name = "pcie_aux_clk_src", 1214 .parent_names = gcc_xo_sleep_clk, 1215 .num_parents = 2, 1216 .ops = &clk_rcg2_ops, 1217 }, 1218 }; 1219 1220 static const struct freq_tbl ftbl_ufs_axi_clk_src[] = { 1221 F(100000000, P_GPLL0, 6, 0, 0), 1222 F(200000000, P_GPLL0, 3, 0, 0), 1223 F(240000000, P_GPLL0, 2.5, 0, 0), 1224 { } 1225 }; 1226 1227 static struct clk_rcg2 ufs_axi_clk_src = { 1228 .cmd_rcgr = 0x75024, 1229 .mnd_width = 8, 1230 .hid_width = 5, 1231 .parent_map = gcc_xo_gpll0_map, 1232 .freq_tbl = ftbl_ufs_axi_clk_src, 1233 .clkr.hw.init = &(struct clk_init_data){ 1234 .name = "ufs_axi_clk_src", 1235 .parent_names = gcc_xo_gpll0, 1236 .num_parents = 2, 1237 .ops = &clk_rcg2_ops, 1238 }, 1239 }; 1240 1241 static const struct freq_tbl ftbl_ufs_ice_core_clk_src[] = { 1242 F(19200000, P_XO, 1, 0, 0), 1243 F(150000000, P_GPLL0, 4, 0, 0), 1244 F(300000000, P_GPLL0, 2, 0, 0), 1245 { } 1246 }; 1247 1248 static struct clk_rcg2 ufs_ice_core_clk_src = { 1249 .cmd_rcgr = 0x76014, 1250 .hid_width = 5, 1251 .parent_map = gcc_xo_gpll0_map, 1252 .freq_tbl = ftbl_ufs_ice_core_clk_src, 1253 .clkr.hw.init = &(struct clk_init_data){ 1254 .name = "ufs_ice_core_clk_src", 1255 .parent_names = gcc_xo_gpll0, 1256 .num_parents = 2, 1257 .ops = &clk_rcg2_ops, 1258 }, 1259 }; 1260 1261 static const struct freq_tbl ftbl_qspi_ser_clk_src[] = { 1262 F(75000000, P_GPLL0, 8, 0, 0), 1263 F(150000000, P_GPLL0, 4, 0, 0), 1264 F(256000000, P_GPLL4, 1.5, 0, 0), 1265 F(300000000, P_GPLL0, 2, 0, 0), 1266 { } 1267 }; 1268 1269 static struct clk_rcg2 qspi_ser_clk_src = { 1270 .cmd_rcgr = 0x8b00c, 1271 .hid_width = 5, 1272 .parent_map = gcc_xo_gpll0_gpll1_early_div_gpll1_gpll4_gpll0_early_div_map, 1273 .freq_tbl = ftbl_qspi_ser_clk_src, 1274 .clkr.hw.init = &(struct clk_init_data){ 1275 .name = "qspi_ser_clk_src", 1276 .parent_names = gcc_xo_gpll0_gpll1_early_div_gpll1_gpll4_gpll0_early_div, 1277 .num_parents = 6, 1278 .ops = &clk_rcg2_ops, 1279 }, 1280 }; 1281 1282 static struct clk_branch gcc_sys_noc_usb3_axi_clk = { 1283 .halt_reg = 0x0f03c, 1284 .clkr = { 1285 .enable_reg = 0x0f03c, 1286 .enable_mask = BIT(0), 1287 .hw.init = &(struct clk_init_data){ 1288 .name = "gcc_sys_noc_usb3_axi_clk", 1289 .parent_names = (const char *[]){ "usb30_master_clk_src" }, 1290 .num_parents = 1, 1291 .flags = CLK_SET_RATE_PARENT, 1292 .ops = &clk_branch2_ops, 1293 }, 1294 }, 1295 }; 1296 1297 static struct clk_branch gcc_sys_noc_ufs_axi_clk = { 1298 .halt_reg = 0x75038, 1299 .clkr = { 1300 .enable_reg = 0x75038, 1301 .enable_mask = BIT(0), 1302 .hw.init = &(struct clk_init_data){ 1303 .name = "gcc_sys_noc_ufs_axi_clk", 1304 .parent_names = (const char *[]){ "ufs_axi_clk_src" }, 1305 .num_parents = 1, 1306 .flags = CLK_SET_RATE_PARENT, 1307 .ops = &clk_branch2_ops, 1308 }, 1309 }, 1310 }; 1311 1312 static struct clk_branch gcc_periph_noc_usb20_ahb_clk = { 1313 .halt_reg = 0x6010, 1314 .clkr = { 1315 .enable_reg = 0x6010, 1316 .enable_mask = BIT(0), 1317 .hw.init = &(struct clk_init_data){ 1318 .name = "gcc_periph_noc_usb20_ahb_clk", 1319 .parent_names = (const char *[]){ "usb20_master_clk_src" }, 1320 .num_parents = 1, 1321 .flags = CLK_SET_RATE_PARENT, 1322 .ops = &clk_branch2_ops, 1323 }, 1324 }, 1325 }; 1326 1327 static struct clk_branch gcc_mmss_noc_cfg_ahb_clk = { 1328 .halt_reg = 0x9008, 1329 .clkr = { 1330 .enable_reg = 0x9008, 1331 .enable_mask = BIT(0), 1332 .hw.init = &(struct clk_init_data){ 1333 .name = "gcc_mmss_noc_cfg_ahb_clk", 1334 .parent_names = (const char *[]){ "config_noc_clk_src" }, 1335 .num_parents = 1, 1336 .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 1337 .ops = &clk_branch2_ops, 1338 }, 1339 }, 1340 }; 1341 1342 static struct clk_branch gcc_mmss_bimc_gfx_clk = { 1343 .halt_reg = 0x9010, 1344 .clkr = { 1345 .enable_reg = 0x9010, 1346 .enable_mask = BIT(0), 1347 .hw.init = &(struct clk_init_data){ 1348 .name = "gcc_mmss_bimc_gfx_clk", 1349 .flags = CLK_SET_RATE_PARENT, 1350 .ops = &clk_branch2_ops, 1351 }, 1352 }, 1353 }; 1354 1355 static struct clk_branch gcc_usb30_master_clk = { 1356 .halt_reg = 0x0f008, 1357 .clkr = { 1358 .enable_reg = 0x0f008, 1359 .enable_mask = BIT(0), 1360 .hw.init = &(struct clk_init_data){ 1361 .name = "gcc_usb30_master_clk", 1362 .parent_names = (const char *[]){ "usb30_master_clk_src" }, 1363 .num_parents = 1, 1364 .flags = CLK_SET_RATE_PARENT, 1365 .ops = &clk_branch2_ops, 1366 }, 1367 }, 1368 }; 1369 1370 static struct clk_branch gcc_usb30_sleep_clk = { 1371 .halt_reg = 0x0f00c, 1372 .clkr = { 1373 .enable_reg = 0x0f00c, 1374 .enable_mask = BIT(0), 1375 .hw.init = &(struct clk_init_data){ 1376 .name = "gcc_usb30_sleep_clk", 1377 .parent_names = (const char *[]){ "gcc_sleep_clk_src" }, 1378 .num_parents = 1, 1379 .flags = CLK_SET_RATE_PARENT, 1380 .ops = &clk_branch2_ops, 1381 }, 1382 }, 1383 }; 1384 1385 static struct clk_branch gcc_usb30_mock_utmi_clk = { 1386 .halt_reg = 0x0f010, 1387 .clkr = { 1388 .enable_reg = 0x0f010, 1389 .enable_mask = BIT(0), 1390 .hw.init = &(struct clk_init_data){ 1391 .name = "gcc_usb30_mock_utmi_clk", 1392 .parent_names = (const char *[]){ "usb30_mock_utmi_clk_src" }, 1393 .num_parents = 1, 1394 .flags = CLK_SET_RATE_PARENT, 1395 .ops = &clk_branch2_ops, 1396 }, 1397 }, 1398 }; 1399 1400 static struct clk_branch gcc_usb3_phy_aux_clk = { 1401 .halt_reg = 0x50000, 1402 .clkr = { 1403 .enable_reg = 0x50000, 1404 .enable_mask = BIT(0), 1405 .hw.init = &(struct clk_init_data){ 1406 .name = "gcc_usb3_phy_aux_clk", 1407 .parent_names = (const char *[]){ "usb3_phy_aux_clk_src" }, 1408 .num_parents = 1, 1409 .flags = CLK_SET_RATE_PARENT, 1410 .ops = &clk_branch2_ops, 1411 }, 1412 }, 1413 }; 1414 1415 static struct clk_branch gcc_usb3_phy_pipe_clk = { 1416 .halt_reg = 0x50004, 1417 .clkr = { 1418 .enable_reg = 0x50004, 1419 .enable_mask = BIT(0), 1420 .hw.init = &(struct clk_init_data){ 1421 .name = "gcc_usb3_phy_pipe_clk", 1422 .parent_names = (const char *[]){ "usb3_phy_pipe_clk_src" }, 1423 .num_parents = 1, 1424 .flags = CLK_SET_RATE_PARENT, 1425 .ops = &clk_branch2_ops, 1426 }, 1427 }, 1428 }; 1429 1430 static struct clk_branch gcc_usb20_master_clk = { 1431 .halt_reg = 0x12004, 1432 .clkr = { 1433 .enable_reg = 0x12004, 1434 .enable_mask = BIT(0), 1435 .hw.init = &(struct clk_init_data){ 1436 .name = "gcc_usb20_master_clk", 1437 .parent_names = (const char *[]){ "usb20_master_clk_src" }, 1438 .num_parents = 1, 1439 .flags = CLK_SET_RATE_PARENT, 1440 .ops = &clk_branch2_ops, 1441 }, 1442 }, 1443 }; 1444 1445 static struct clk_branch gcc_usb20_sleep_clk = { 1446 .halt_reg = 0x12008, 1447 .clkr = { 1448 .enable_reg = 0x12008, 1449 .enable_mask = BIT(0), 1450 .hw.init = &(struct clk_init_data){ 1451 .name = "gcc_usb20_sleep_clk", 1452 .parent_names = (const char *[]){ "gcc_sleep_clk_src" }, 1453 .num_parents = 1, 1454 .flags = CLK_SET_RATE_PARENT, 1455 .ops = &clk_branch2_ops, 1456 }, 1457 }, 1458 }; 1459 1460 static struct clk_branch gcc_usb20_mock_utmi_clk = { 1461 .halt_reg = 0x1200c, 1462 .clkr = { 1463 .enable_reg = 0x1200c, 1464 .enable_mask = BIT(0), 1465 .hw.init = &(struct clk_init_data){ 1466 .name = "gcc_usb20_mock_utmi_clk", 1467 .parent_names = (const char *[]){ "usb20_mock_utmi_clk_src" }, 1468 .num_parents = 1, 1469 .flags = CLK_SET_RATE_PARENT, 1470 .ops = &clk_branch2_ops, 1471 }, 1472 }, 1473 }; 1474 1475 static struct clk_branch gcc_usb_phy_cfg_ahb2phy_clk = { 1476 .halt_reg = 0x6a004, 1477 .clkr = { 1478 .enable_reg = 0x6a004, 1479 .enable_mask = BIT(0), 1480 .hw.init = &(struct clk_init_data){ 1481 .name = "gcc_usb_phy_cfg_ahb2phy_clk", 1482 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 1483 .num_parents = 1, 1484 .flags = CLK_SET_RATE_PARENT, 1485 .ops = &clk_branch2_ops, 1486 }, 1487 }, 1488 }; 1489 1490 static struct clk_branch gcc_sdcc1_apps_clk = { 1491 .halt_reg = 0x13004, 1492 .clkr = { 1493 .enable_reg = 0x13004, 1494 .enable_mask = BIT(0), 1495 .hw.init = &(struct clk_init_data){ 1496 .name = "gcc_sdcc1_apps_clk", 1497 .parent_names = (const char *[]){ "sdcc1_apps_clk_src" }, 1498 .num_parents = 1, 1499 .flags = CLK_SET_RATE_PARENT, 1500 .ops = &clk_branch2_ops, 1501 }, 1502 }, 1503 }; 1504 1505 static struct clk_branch gcc_sdcc1_ahb_clk = { 1506 .halt_reg = 0x13008, 1507 .clkr = { 1508 .enable_reg = 0x13008, 1509 .enable_mask = BIT(0), 1510 .hw.init = &(struct clk_init_data){ 1511 .name = "gcc_sdcc1_ahb_clk", 1512 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 1513 .num_parents = 1, 1514 .flags = CLK_SET_RATE_PARENT, 1515 .ops = &clk_branch2_ops, 1516 }, 1517 }, 1518 }; 1519 1520 static struct clk_branch gcc_sdcc1_ice_core_clk = { 1521 .halt_reg = 0x13038, 1522 .clkr = { 1523 .enable_reg = 0x13038, 1524 .enable_mask = BIT(0), 1525 .hw.init = &(struct clk_init_data){ 1526 .name = "gcc_sdcc1_ice_core_clk", 1527 .parent_names = (const char *[]){ "sdcc1_ice_core_clk_src" }, 1528 .num_parents = 1, 1529 .flags = CLK_SET_RATE_PARENT, 1530 .ops = &clk_branch2_ops, 1531 }, 1532 }, 1533 }; 1534 1535 static struct clk_branch gcc_sdcc2_apps_clk = { 1536 .halt_reg = 0x14004, 1537 .clkr = { 1538 .enable_reg = 0x14004, 1539 .enable_mask = BIT(0), 1540 .hw.init = &(struct clk_init_data){ 1541 .name = "gcc_sdcc2_apps_clk", 1542 .parent_names = (const char *[]){ "sdcc2_apps_clk_src" }, 1543 .num_parents = 1, 1544 .flags = CLK_SET_RATE_PARENT, 1545 .ops = &clk_branch2_ops, 1546 }, 1547 }, 1548 }; 1549 1550 static struct clk_branch gcc_sdcc2_ahb_clk = { 1551 .halt_reg = 0x14008, 1552 .clkr = { 1553 .enable_reg = 0x14008, 1554 .enable_mask = BIT(0), 1555 .hw.init = &(struct clk_init_data){ 1556 .name = "gcc_sdcc2_ahb_clk", 1557 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 1558 .num_parents = 1, 1559 .flags = CLK_SET_RATE_PARENT, 1560 .ops = &clk_branch2_ops, 1561 }, 1562 }, 1563 }; 1564 1565 static struct clk_branch gcc_sdcc3_apps_clk = { 1566 .halt_reg = 0x15004, 1567 .clkr = { 1568 .enable_reg = 0x15004, 1569 .enable_mask = BIT(0), 1570 .hw.init = &(struct clk_init_data){ 1571 .name = "gcc_sdcc3_apps_clk", 1572 .parent_names = (const char *[]){ "sdcc3_apps_clk_src" }, 1573 .num_parents = 1, 1574 .flags = CLK_SET_RATE_PARENT, 1575 .ops = &clk_branch2_ops, 1576 }, 1577 }, 1578 }; 1579 1580 static struct clk_branch gcc_sdcc3_ahb_clk = { 1581 .halt_reg = 0x15008, 1582 .clkr = { 1583 .enable_reg = 0x15008, 1584 .enable_mask = BIT(0), 1585 .hw.init = &(struct clk_init_data){ 1586 .name = "gcc_sdcc3_ahb_clk", 1587 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 1588 .num_parents = 1, 1589 .flags = CLK_SET_RATE_PARENT, 1590 .ops = &clk_branch2_ops, 1591 }, 1592 }, 1593 }; 1594 1595 static struct clk_branch gcc_sdcc4_apps_clk = { 1596 .halt_reg = 0x16004, 1597 .clkr = { 1598 .enable_reg = 0x16004, 1599 .enable_mask = BIT(0), 1600 .hw.init = &(struct clk_init_data){ 1601 .name = "gcc_sdcc4_apps_clk", 1602 .parent_names = (const char *[]){ "sdcc4_apps_clk_src" }, 1603 .num_parents = 1, 1604 .flags = CLK_SET_RATE_PARENT, 1605 .ops = &clk_branch2_ops, 1606 }, 1607 }, 1608 }; 1609 1610 static struct clk_branch gcc_sdcc4_ahb_clk = { 1611 .halt_reg = 0x16008, 1612 .clkr = { 1613 .enable_reg = 0x16008, 1614 .enable_mask = BIT(0), 1615 .hw.init = &(struct clk_init_data){ 1616 .name = "gcc_sdcc4_ahb_clk", 1617 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 1618 .num_parents = 1, 1619 .flags = CLK_SET_RATE_PARENT, 1620 .ops = &clk_branch2_ops, 1621 }, 1622 }, 1623 }; 1624 1625 static struct clk_branch gcc_blsp1_ahb_clk = { 1626 .halt_reg = 0x17004, 1627 .halt_check = BRANCH_HALT_VOTED, 1628 .clkr = { 1629 .enable_reg = 0x52004, 1630 .enable_mask = BIT(17), 1631 .hw.init = &(struct clk_init_data){ 1632 .name = "gcc_blsp1_ahb_clk", 1633 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 1634 .num_parents = 1, 1635 .flags = CLK_SET_RATE_PARENT, 1636 .ops = &clk_branch2_ops, 1637 }, 1638 }, 1639 }; 1640 1641 static struct clk_branch gcc_blsp1_sleep_clk = { 1642 .halt_reg = 0x17008, 1643 .halt_check = BRANCH_HALT_VOTED, 1644 .clkr = { 1645 .enable_reg = 0x52004, 1646 .enable_mask = BIT(16), 1647 .hw.init = &(struct clk_init_data){ 1648 .name = "gcc_blsp1_sleep_clk", 1649 .parent_names = (const char *[]){ "gcc_sleep_clk_src" }, 1650 .num_parents = 1, 1651 .flags = CLK_SET_RATE_PARENT, 1652 .ops = &clk_branch2_ops, 1653 }, 1654 }, 1655 }; 1656 1657 static struct clk_branch gcc_blsp1_qup1_spi_apps_clk = { 1658 .halt_reg = 0x19004, 1659 .clkr = { 1660 .enable_reg = 0x19004, 1661 .enable_mask = BIT(0), 1662 .hw.init = &(struct clk_init_data){ 1663 .name = "gcc_blsp1_qup1_spi_apps_clk", 1664 .parent_names = (const char *[]){ "blsp1_qup1_spi_apps_clk_src" }, 1665 .num_parents = 1, 1666 .flags = CLK_SET_RATE_PARENT, 1667 .ops = &clk_branch2_ops, 1668 }, 1669 }, 1670 }; 1671 1672 static struct clk_branch gcc_blsp1_qup1_i2c_apps_clk = { 1673 .halt_reg = 0x19008, 1674 .clkr = { 1675 .enable_reg = 0x19008, 1676 .enable_mask = BIT(0), 1677 .hw.init = &(struct clk_init_data){ 1678 .name = "gcc_blsp1_qup1_i2c_apps_clk", 1679 .parent_names = (const char *[]){ "blsp1_qup1_i2c_apps_clk_src" }, 1680 .num_parents = 1, 1681 .flags = CLK_SET_RATE_PARENT, 1682 .ops = &clk_branch2_ops, 1683 }, 1684 }, 1685 }; 1686 1687 static struct clk_branch gcc_blsp1_uart1_apps_clk = { 1688 .halt_reg = 0x1a004, 1689 .clkr = { 1690 .enable_reg = 0x1a004, 1691 .enable_mask = BIT(0), 1692 .hw.init = &(struct clk_init_data){ 1693 .name = "gcc_blsp1_uart1_apps_clk", 1694 .parent_names = (const char *[]){ "blsp1_uart1_apps_clk_src" }, 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_blsp1_qup2_spi_apps_clk = { 1703 .halt_reg = 0x1b004, 1704 .clkr = { 1705 .enable_reg = 0x1b004, 1706 .enable_mask = BIT(0), 1707 .hw.init = &(struct clk_init_data){ 1708 .name = "gcc_blsp1_qup2_spi_apps_clk", 1709 .parent_names = (const char *[]){ "blsp1_qup2_spi_apps_clk_src" }, 1710 .num_parents = 1, 1711 .flags = CLK_SET_RATE_PARENT, 1712 .ops = &clk_branch2_ops, 1713 }, 1714 }, 1715 }; 1716 1717 static struct clk_branch gcc_blsp1_qup2_i2c_apps_clk = { 1718 .halt_reg = 0x1b008, 1719 .clkr = { 1720 .enable_reg = 0x1b008, 1721 .enable_mask = BIT(0), 1722 .hw.init = &(struct clk_init_data){ 1723 .name = "gcc_blsp1_qup2_i2c_apps_clk", 1724 .parent_names = (const char *[]){ "blsp1_qup2_i2c_apps_clk_src" }, 1725 .num_parents = 1, 1726 .flags = CLK_SET_RATE_PARENT, 1727 .ops = &clk_branch2_ops, 1728 }, 1729 }, 1730 }; 1731 1732 static struct clk_branch gcc_blsp1_uart2_apps_clk = { 1733 .halt_reg = 0x1c004, 1734 .clkr = { 1735 .enable_reg = 0x1c004, 1736 .enable_mask = BIT(0), 1737 .hw.init = &(struct clk_init_data){ 1738 .name = "gcc_blsp1_uart2_apps_clk", 1739 .parent_names = (const char *[]){ "blsp1_uart2_apps_clk_src" }, 1740 .num_parents = 1, 1741 .flags = CLK_SET_RATE_PARENT, 1742 .ops = &clk_branch2_ops, 1743 }, 1744 }, 1745 }; 1746 1747 static struct clk_branch gcc_blsp1_qup3_spi_apps_clk = { 1748 .halt_reg = 0x1d004, 1749 .clkr = { 1750 .enable_reg = 0x1d004, 1751 .enable_mask = BIT(0), 1752 .hw.init = &(struct clk_init_data){ 1753 .name = "gcc_blsp1_qup3_spi_apps_clk", 1754 .parent_names = (const char *[]){ "blsp1_qup3_spi_apps_clk_src" }, 1755 .num_parents = 1, 1756 .flags = CLK_SET_RATE_PARENT, 1757 .ops = &clk_branch2_ops, 1758 }, 1759 }, 1760 }; 1761 1762 static struct clk_branch gcc_blsp1_qup3_i2c_apps_clk = { 1763 .halt_reg = 0x1d008, 1764 .clkr = { 1765 .enable_reg = 0x1d008, 1766 .enable_mask = BIT(0), 1767 .hw.init = &(struct clk_init_data){ 1768 .name = "gcc_blsp1_qup3_i2c_apps_clk", 1769 .parent_names = (const char *[]){ "blsp1_qup3_i2c_apps_clk_src" }, 1770 .num_parents = 1, 1771 .flags = CLK_SET_RATE_PARENT, 1772 .ops = &clk_branch2_ops, 1773 }, 1774 }, 1775 }; 1776 1777 static struct clk_branch gcc_blsp1_uart3_apps_clk = { 1778 .halt_reg = 0x1e004, 1779 .clkr = { 1780 .enable_reg = 0x1e004, 1781 .enable_mask = BIT(0), 1782 .hw.init = &(struct clk_init_data){ 1783 .name = "gcc_blsp1_uart3_apps_clk", 1784 .parent_names = (const char *[]){ "blsp1_uart3_apps_clk_src" }, 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_blsp1_qup4_spi_apps_clk = { 1793 .halt_reg = 0x1f004, 1794 .clkr = { 1795 .enable_reg = 0x1f004, 1796 .enable_mask = BIT(0), 1797 .hw.init = &(struct clk_init_data){ 1798 .name = "gcc_blsp1_qup4_spi_apps_clk", 1799 .parent_names = (const char *[]){ "blsp1_qup4_spi_apps_clk_src" }, 1800 .num_parents = 1, 1801 .flags = CLK_SET_RATE_PARENT, 1802 .ops = &clk_branch2_ops, 1803 }, 1804 }, 1805 }; 1806 1807 static struct clk_branch gcc_blsp1_qup4_i2c_apps_clk = { 1808 .halt_reg = 0x1f008, 1809 .clkr = { 1810 .enable_reg = 0x1f008, 1811 .enable_mask = BIT(0), 1812 .hw.init = &(struct clk_init_data){ 1813 .name = "gcc_blsp1_qup4_i2c_apps_clk", 1814 .parent_names = (const char *[]){ "blsp1_qup4_i2c_apps_clk_src" }, 1815 .num_parents = 1, 1816 .flags = CLK_SET_RATE_PARENT, 1817 .ops = &clk_branch2_ops, 1818 }, 1819 }, 1820 }; 1821 1822 static struct clk_branch gcc_blsp1_uart4_apps_clk = { 1823 .halt_reg = 0x20004, 1824 .clkr = { 1825 .enable_reg = 0x20004, 1826 .enable_mask = BIT(0), 1827 .hw.init = &(struct clk_init_data){ 1828 .name = "gcc_blsp1_uart4_apps_clk", 1829 .parent_names = (const char *[]){ "blsp1_uart4_apps_clk_src" }, 1830 .num_parents = 1, 1831 .flags = CLK_SET_RATE_PARENT, 1832 .ops = &clk_branch2_ops, 1833 }, 1834 }, 1835 }; 1836 1837 static struct clk_branch gcc_blsp1_qup5_spi_apps_clk = { 1838 .halt_reg = 0x21004, 1839 .clkr = { 1840 .enable_reg = 0x21004, 1841 .enable_mask = BIT(0), 1842 .hw.init = &(struct clk_init_data){ 1843 .name = "gcc_blsp1_qup5_spi_apps_clk", 1844 .parent_names = (const char *[]){ "blsp1_qup5_spi_apps_clk_src" }, 1845 .num_parents = 1, 1846 .flags = CLK_SET_RATE_PARENT, 1847 .ops = &clk_branch2_ops, 1848 }, 1849 }, 1850 }; 1851 1852 static struct clk_branch gcc_blsp1_qup5_i2c_apps_clk = { 1853 .halt_reg = 0x21008, 1854 .clkr = { 1855 .enable_reg = 0x21008, 1856 .enable_mask = BIT(0), 1857 .hw.init = &(struct clk_init_data){ 1858 .name = "gcc_blsp1_qup5_i2c_apps_clk", 1859 .parent_names = (const char *[]){ "blsp1_qup5_i2c_apps_clk_src" }, 1860 .num_parents = 1, 1861 .flags = CLK_SET_RATE_PARENT, 1862 .ops = &clk_branch2_ops, 1863 }, 1864 }, 1865 }; 1866 1867 static struct clk_branch gcc_blsp1_uart5_apps_clk = { 1868 .halt_reg = 0x22004, 1869 .clkr = { 1870 .enable_reg = 0x22004, 1871 .enable_mask = BIT(0), 1872 .hw.init = &(struct clk_init_data){ 1873 .name = "gcc_blsp1_uart5_apps_clk", 1874 .parent_names = (const char *[]){ "blsp1_uart5_apps_clk_src" }, 1875 .num_parents = 1, 1876 .flags = CLK_SET_RATE_PARENT, 1877 .ops = &clk_branch2_ops, 1878 }, 1879 }, 1880 }; 1881 1882 static struct clk_branch gcc_blsp1_qup6_spi_apps_clk = { 1883 .halt_reg = 0x23004, 1884 .clkr = { 1885 .enable_reg = 0x23004, 1886 .enable_mask = BIT(0), 1887 .hw.init = &(struct clk_init_data){ 1888 .name = "gcc_blsp1_qup6_spi_apps_clk", 1889 .parent_names = (const char *[]){ "blsp1_qup6_spi_apps_clk_src" }, 1890 .num_parents = 1, 1891 .flags = CLK_SET_RATE_PARENT, 1892 .ops = &clk_branch2_ops, 1893 }, 1894 }, 1895 }; 1896 1897 static struct clk_branch gcc_blsp1_qup6_i2c_apps_clk = { 1898 .halt_reg = 0x23008, 1899 .clkr = { 1900 .enable_reg = 0x23008, 1901 .enable_mask = BIT(0), 1902 .hw.init = &(struct clk_init_data){ 1903 .name = "gcc_blsp1_qup6_i2c_apps_clk", 1904 .parent_names = (const char *[]){ "blsp1_qup6_i2c_apps_clk_src" }, 1905 .num_parents = 1, 1906 .flags = CLK_SET_RATE_PARENT, 1907 .ops = &clk_branch2_ops, 1908 }, 1909 }, 1910 }; 1911 1912 static struct clk_branch gcc_blsp1_uart6_apps_clk = { 1913 .halt_reg = 0x24004, 1914 .clkr = { 1915 .enable_reg = 0x24004, 1916 .enable_mask = BIT(0), 1917 .hw.init = &(struct clk_init_data){ 1918 .name = "gcc_blsp1_uart6_apps_clk", 1919 .parent_names = (const char *[]){ "blsp1_uart6_apps_clk_src" }, 1920 .num_parents = 1, 1921 .flags = CLK_SET_RATE_PARENT, 1922 .ops = &clk_branch2_ops, 1923 }, 1924 }, 1925 }; 1926 1927 static struct clk_branch gcc_blsp2_ahb_clk = { 1928 .halt_reg = 0x25004, 1929 .halt_check = BRANCH_HALT_VOTED, 1930 .clkr = { 1931 .enable_reg = 0x52004, 1932 .enable_mask = BIT(15), 1933 .hw.init = &(struct clk_init_data){ 1934 .name = "gcc_blsp2_ahb_clk", 1935 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 1936 .num_parents = 1, 1937 .flags = CLK_SET_RATE_PARENT, 1938 .ops = &clk_branch2_ops, 1939 }, 1940 }, 1941 }; 1942 1943 static struct clk_branch gcc_blsp2_sleep_clk = { 1944 .halt_reg = 0x25008, 1945 .halt_check = BRANCH_HALT_VOTED, 1946 .clkr = { 1947 .enable_reg = 0x52004, 1948 .enable_mask = BIT(14), 1949 .hw.init = &(struct clk_init_data){ 1950 .name = "gcc_blsp2_sleep_clk", 1951 .parent_names = (const char *[]){ "gcc_sleep_clk_src" }, 1952 .num_parents = 1, 1953 .flags = CLK_SET_RATE_PARENT, 1954 .ops = &clk_branch2_ops, 1955 }, 1956 }, 1957 }; 1958 1959 static struct clk_branch gcc_blsp2_qup1_spi_apps_clk = { 1960 .halt_reg = 0x26004, 1961 .clkr = { 1962 .enable_reg = 0x26004, 1963 .enable_mask = BIT(0), 1964 .hw.init = &(struct clk_init_data){ 1965 .name = "gcc_blsp2_qup1_spi_apps_clk", 1966 .parent_names = (const char *[]){ "blsp2_qup1_spi_apps_clk_src" }, 1967 .num_parents = 1, 1968 .flags = CLK_SET_RATE_PARENT, 1969 .ops = &clk_branch2_ops, 1970 }, 1971 }, 1972 }; 1973 1974 static struct clk_branch gcc_blsp2_qup1_i2c_apps_clk = { 1975 .halt_reg = 0x26008, 1976 .clkr = { 1977 .enable_reg = 0x26008, 1978 .enable_mask = BIT(0), 1979 .hw.init = &(struct clk_init_data){ 1980 .name = "gcc_blsp2_qup1_i2c_apps_clk", 1981 .parent_names = (const char *[]){ "blsp2_qup1_i2c_apps_clk_src" }, 1982 .num_parents = 1, 1983 .flags = CLK_SET_RATE_PARENT, 1984 .ops = &clk_branch2_ops, 1985 }, 1986 }, 1987 }; 1988 1989 static struct clk_branch gcc_blsp2_uart1_apps_clk = { 1990 .halt_reg = 0x27004, 1991 .clkr = { 1992 .enable_reg = 0x27004, 1993 .enable_mask = BIT(0), 1994 .hw.init = &(struct clk_init_data){ 1995 .name = "gcc_blsp2_uart1_apps_clk", 1996 .parent_names = (const char *[]){ "blsp2_uart1_apps_clk_src" }, 1997 .num_parents = 1, 1998 .flags = CLK_SET_RATE_PARENT, 1999 .ops = &clk_branch2_ops, 2000 }, 2001 }, 2002 }; 2003 2004 static struct clk_branch gcc_blsp2_qup2_spi_apps_clk = { 2005 .halt_reg = 0x28004, 2006 .clkr = { 2007 .enable_reg = 0x28004, 2008 .enable_mask = BIT(0), 2009 .hw.init = &(struct clk_init_data){ 2010 .name = "gcc_blsp2_qup2_spi_apps_clk", 2011 .parent_names = (const char *[]){ "blsp2_qup2_spi_apps_clk_src" }, 2012 .num_parents = 1, 2013 .flags = CLK_SET_RATE_PARENT, 2014 .ops = &clk_branch2_ops, 2015 }, 2016 }, 2017 }; 2018 2019 static struct clk_branch gcc_blsp2_qup2_i2c_apps_clk = { 2020 .halt_reg = 0x28008, 2021 .clkr = { 2022 .enable_reg = 0x28008, 2023 .enable_mask = BIT(0), 2024 .hw.init = &(struct clk_init_data){ 2025 .name = "gcc_blsp2_qup2_i2c_apps_clk", 2026 .parent_names = (const char *[]){ "blsp2_qup2_i2c_apps_clk_src" }, 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_blsp2_uart2_apps_clk = { 2035 .halt_reg = 0x29004, 2036 .clkr = { 2037 .enable_reg = 0x29004, 2038 .enable_mask = BIT(0), 2039 .hw.init = &(struct clk_init_data){ 2040 .name = "gcc_blsp2_uart2_apps_clk", 2041 .parent_names = (const char *[]){ "blsp2_uart2_apps_clk_src" }, 2042 .num_parents = 1, 2043 .flags = CLK_SET_RATE_PARENT, 2044 .ops = &clk_branch2_ops, 2045 }, 2046 }, 2047 }; 2048 2049 static struct clk_branch gcc_blsp2_qup3_spi_apps_clk = { 2050 .halt_reg = 0x2a004, 2051 .clkr = { 2052 .enable_reg = 0x2a004, 2053 .enable_mask = BIT(0), 2054 .hw.init = &(struct clk_init_data){ 2055 .name = "gcc_blsp2_qup3_spi_apps_clk", 2056 .parent_names = (const char *[]){ "blsp2_qup3_spi_apps_clk_src" }, 2057 .num_parents = 1, 2058 .flags = CLK_SET_RATE_PARENT, 2059 .ops = &clk_branch2_ops, 2060 }, 2061 }, 2062 }; 2063 2064 static struct clk_branch gcc_blsp2_qup3_i2c_apps_clk = { 2065 .halt_reg = 0x2a008, 2066 .clkr = { 2067 .enable_reg = 0x2a008, 2068 .enable_mask = BIT(0), 2069 .hw.init = &(struct clk_init_data){ 2070 .name = "gcc_blsp2_qup3_i2c_apps_clk", 2071 .parent_names = (const char *[]){ "blsp2_qup3_i2c_apps_clk_src" }, 2072 .num_parents = 1, 2073 .flags = CLK_SET_RATE_PARENT, 2074 .ops = &clk_branch2_ops, 2075 }, 2076 }, 2077 }; 2078 2079 static struct clk_branch gcc_blsp2_uart3_apps_clk = { 2080 .halt_reg = 0x2b004, 2081 .clkr = { 2082 .enable_reg = 0x2b004, 2083 .enable_mask = BIT(0), 2084 .hw.init = &(struct clk_init_data){ 2085 .name = "gcc_blsp2_uart3_apps_clk", 2086 .parent_names = (const char *[]){ "blsp2_uart3_apps_clk_src" }, 2087 .num_parents = 1, 2088 .flags = CLK_SET_RATE_PARENT, 2089 .ops = &clk_branch2_ops, 2090 }, 2091 }, 2092 }; 2093 2094 static struct clk_branch gcc_blsp2_qup4_spi_apps_clk = { 2095 .halt_reg = 0x2c004, 2096 .clkr = { 2097 .enable_reg = 0x2c004, 2098 .enable_mask = BIT(0), 2099 .hw.init = &(struct clk_init_data){ 2100 .name = "gcc_blsp2_qup4_spi_apps_clk", 2101 .parent_names = (const char *[]){ "blsp2_qup4_spi_apps_clk_src" }, 2102 .num_parents = 1, 2103 .flags = CLK_SET_RATE_PARENT, 2104 .ops = &clk_branch2_ops, 2105 }, 2106 }, 2107 }; 2108 2109 static struct clk_branch gcc_blsp2_qup4_i2c_apps_clk = { 2110 .halt_reg = 0x2c008, 2111 .clkr = { 2112 .enable_reg = 0x2c008, 2113 .enable_mask = BIT(0), 2114 .hw.init = &(struct clk_init_data){ 2115 .name = "gcc_blsp2_qup4_i2c_apps_clk", 2116 .parent_names = (const char *[]){ "blsp2_qup4_i2c_apps_clk_src" }, 2117 .num_parents = 1, 2118 .flags = CLK_SET_RATE_PARENT, 2119 .ops = &clk_branch2_ops, 2120 }, 2121 }, 2122 }; 2123 2124 static struct clk_branch gcc_blsp2_uart4_apps_clk = { 2125 .halt_reg = 0x2d004, 2126 .clkr = { 2127 .enable_reg = 0x2d004, 2128 .enable_mask = BIT(0), 2129 .hw.init = &(struct clk_init_data){ 2130 .name = "gcc_blsp2_uart4_apps_clk", 2131 .parent_names = (const char *[]){ "blsp2_uart4_apps_clk_src" }, 2132 .num_parents = 1, 2133 .flags = CLK_SET_RATE_PARENT, 2134 .ops = &clk_branch2_ops, 2135 }, 2136 }, 2137 }; 2138 2139 static struct clk_branch gcc_blsp2_qup5_spi_apps_clk = { 2140 .halt_reg = 0x2e004, 2141 .clkr = { 2142 .enable_reg = 0x2e004, 2143 .enable_mask = BIT(0), 2144 .hw.init = &(struct clk_init_data){ 2145 .name = "gcc_blsp2_qup5_spi_apps_clk", 2146 .parent_names = (const char *[]){ "blsp2_qup5_spi_apps_clk_src" }, 2147 .num_parents = 1, 2148 .flags = CLK_SET_RATE_PARENT, 2149 .ops = &clk_branch2_ops, 2150 }, 2151 }, 2152 }; 2153 2154 static struct clk_branch gcc_blsp2_qup5_i2c_apps_clk = { 2155 .halt_reg = 0x2e008, 2156 .clkr = { 2157 .enable_reg = 0x2e008, 2158 .enable_mask = BIT(0), 2159 .hw.init = &(struct clk_init_data){ 2160 .name = "gcc_blsp2_qup5_i2c_apps_clk", 2161 .parent_names = (const char *[]){ "blsp2_qup5_i2c_apps_clk_src" }, 2162 .num_parents = 1, 2163 .flags = CLK_SET_RATE_PARENT, 2164 .ops = &clk_branch2_ops, 2165 }, 2166 }, 2167 }; 2168 2169 static struct clk_branch gcc_blsp2_uart5_apps_clk = { 2170 .halt_reg = 0x2f004, 2171 .clkr = { 2172 .enable_reg = 0x2f004, 2173 .enable_mask = BIT(0), 2174 .hw.init = &(struct clk_init_data){ 2175 .name = "gcc_blsp2_uart5_apps_clk", 2176 .parent_names = (const char *[]){ "blsp2_uart5_apps_clk_src" }, 2177 .num_parents = 1, 2178 .flags = CLK_SET_RATE_PARENT, 2179 .ops = &clk_branch2_ops, 2180 }, 2181 }, 2182 }; 2183 2184 static struct clk_branch gcc_blsp2_qup6_spi_apps_clk = { 2185 .halt_reg = 0x30004, 2186 .clkr = { 2187 .enable_reg = 0x30004, 2188 .enable_mask = BIT(0), 2189 .hw.init = &(struct clk_init_data){ 2190 .name = "gcc_blsp2_qup6_spi_apps_clk", 2191 .parent_names = (const char *[]){ "blsp2_qup6_spi_apps_clk_src" }, 2192 .num_parents = 1, 2193 .flags = CLK_SET_RATE_PARENT, 2194 .ops = &clk_branch2_ops, 2195 }, 2196 }, 2197 }; 2198 2199 static struct clk_branch gcc_blsp2_qup6_i2c_apps_clk = { 2200 .halt_reg = 0x30008, 2201 .clkr = { 2202 .enable_reg = 0x30008, 2203 .enable_mask = BIT(0), 2204 .hw.init = &(struct clk_init_data){ 2205 .name = "gcc_blsp2_qup6_i2c_apps_clk", 2206 .parent_names = (const char *[]){ "blsp2_qup6_i2c_apps_clk_src" }, 2207 .num_parents = 1, 2208 .flags = CLK_SET_RATE_PARENT, 2209 .ops = &clk_branch2_ops, 2210 }, 2211 }, 2212 }; 2213 2214 static struct clk_branch gcc_blsp2_uart6_apps_clk = { 2215 .halt_reg = 0x31004, 2216 .clkr = { 2217 .enable_reg = 0x31004, 2218 .enable_mask = BIT(0), 2219 .hw.init = &(struct clk_init_data){ 2220 .name = "gcc_blsp2_uart6_apps_clk", 2221 .parent_names = (const char *[]){ "blsp2_uart6_apps_clk_src" }, 2222 .num_parents = 1, 2223 .flags = CLK_SET_RATE_PARENT, 2224 .ops = &clk_branch2_ops, 2225 }, 2226 }, 2227 }; 2228 2229 static struct clk_branch gcc_pdm_ahb_clk = { 2230 .halt_reg = 0x33004, 2231 .clkr = { 2232 .enable_reg = 0x33004, 2233 .enable_mask = BIT(0), 2234 .hw.init = &(struct clk_init_data){ 2235 .name = "gcc_pdm_ahb_clk", 2236 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 2237 .num_parents = 1, 2238 .flags = CLK_SET_RATE_PARENT, 2239 .ops = &clk_branch2_ops, 2240 }, 2241 }, 2242 }; 2243 2244 static struct clk_branch gcc_pdm2_clk = { 2245 .halt_reg = 0x3300c, 2246 .clkr = { 2247 .enable_reg = 0x3300c, 2248 .enable_mask = BIT(0), 2249 .hw.init = &(struct clk_init_data){ 2250 .name = "gcc_pdm2_clk", 2251 .parent_names = (const char *[]){ "pdm2_clk_src" }, 2252 .num_parents = 1, 2253 .flags = CLK_SET_RATE_PARENT, 2254 .ops = &clk_branch2_ops, 2255 }, 2256 }, 2257 }; 2258 2259 static struct clk_branch gcc_prng_ahb_clk = { 2260 .halt_reg = 0x34004, 2261 .halt_check = BRANCH_HALT_VOTED, 2262 .clkr = { 2263 .enable_reg = 0x52004, 2264 .enable_mask = BIT(13), 2265 .hw.init = &(struct clk_init_data){ 2266 .name = "gcc_prng_ahb_clk", 2267 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2268 .num_parents = 1, 2269 .flags = CLK_SET_RATE_PARENT, 2270 .ops = &clk_branch2_ops, 2271 }, 2272 }, 2273 }; 2274 2275 static struct clk_branch gcc_tsif_ahb_clk = { 2276 .halt_reg = 0x36004, 2277 .clkr = { 2278 .enable_reg = 0x36004, 2279 .enable_mask = BIT(0), 2280 .hw.init = &(struct clk_init_data){ 2281 .name = "gcc_tsif_ahb_clk", 2282 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 2283 .num_parents = 1, 2284 .flags = CLK_SET_RATE_PARENT, 2285 .ops = &clk_branch2_ops, 2286 }, 2287 }, 2288 }; 2289 2290 static struct clk_branch gcc_tsif_ref_clk = { 2291 .halt_reg = 0x36008, 2292 .clkr = { 2293 .enable_reg = 0x36008, 2294 .enable_mask = BIT(0), 2295 .hw.init = &(struct clk_init_data){ 2296 .name = "gcc_tsif_ref_clk", 2297 .parent_names = (const char *[]){ "tsif_ref_clk_src" }, 2298 .num_parents = 1, 2299 .flags = CLK_SET_RATE_PARENT, 2300 .ops = &clk_branch2_ops, 2301 }, 2302 }, 2303 }; 2304 2305 static struct clk_branch gcc_tsif_inactivity_timers_clk = { 2306 .halt_reg = 0x3600c, 2307 .clkr = { 2308 .enable_reg = 0x3600c, 2309 .enable_mask = BIT(0), 2310 .hw.init = &(struct clk_init_data){ 2311 .name = "gcc_tsif_inactivity_timers_clk", 2312 .parent_names = (const char *[]){ "gcc_sleep_clk_src" }, 2313 .num_parents = 1, 2314 .flags = CLK_SET_RATE_PARENT, 2315 .ops = &clk_branch2_ops, 2316 }, 2317 }, 2318 }; 2319 2320 static struct clk_branch gcc_boot_rom_ahb_clk = { 2321 .halt_reg = 0x38004, 2322 .halt_check = BRANCH_HALT_VOTED, 2323 .clkr = { 2324 .enable_reg = 0x52004, 2325 .enable_mask = BIT(10), 2326 .hw.init = &(struct clk_init_data){ 2327 .name = "gcc_boot_rom_ahb_clk", 2328 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2329 .num_parents = 1, 2330 .flags = CLK_SET_RATE_PARENT, 2331 .ops = &clk_branch2_ops, 2332 }, 2333 }, 2334 }; 2335 2336 static struct clk_branch gcc_bimc_gfx_clk = { 2337 .halt_reg = 0x46018, 2338 .clkr = { 2339 .enable_reg = 0x46018, 2340 .enable_mask = BIT(0), 2341 .hw.init = &(struct clk_init_data){ 2342 .name = "gcc_bimc_gfx_clk", 2343 .flags = CLK_SET_RATE_PARENT, 2344 .ops = &clk_branch2_ops, 2345 }, 2346 }, 2347 }; 2348 2349 static struct clk_branch gcc_hmss_rbcpr_clk = { 2350 .halt_reg = 0x4800c, 2351 .clkr = { 2352 .enable_reg = 0x4800c, 2353 .enable_mask = BIT(0), 2354 .hw.init = &(struct clk_init_data){ 2355 .name = "gcc_hmss_rbcpr_clk", 2356 .parent_names = (const char *[]){ "hmss_rbcpr_clk_src" }, 2357 .num_parents = 1, 2358 .flags = CLK_SET_RATE_PARENT, 2359 .ops = &clk_branch2_ops, 2360 }, 2361 }, 2362 }; 2363 2364 static struct clk_branch gcc_gp1_clk = { 2365 .halt_reg = 0x64000, 2366 .clkr = { 2367 .enable_reg = 0x64000, 2368 .enable_mask = BIT(0), 2369 .hw.init = &(struct clk_init_data){ 2370 .name = "gcc_gp1_clk", 2371 .parent_names = (const char *[]){ "gp1_clk_src" }, 2372 .num_parents = 1, 2373 .flags = CLK_SET_RATE_PARENT, 2374 .ops = &clk_branch2_ops, 2375 }, 2376 }, 2377 }; 2378 2379 static struct clk_branch gcc_gp2_clk = { 2380 .halt_reg = 0x65000, 2381 .clkr = { 2382 .enable_reg = 0x65000, 2383 .enable_mask = BIT(0), 2384 .hw.init = &(struct clk_init_data){ 2385 .name = "gcc_gp2_clk", 2386 .parent_names = (const char *[]){ "gp2_clk_src" }, 2387 .num_parents = 1, 2388 .flags = CLK_SET_RATE_PARENT, 2389 .ops = &clk_branch2_ops, 2390 }, 2391 }, 2392 }; 2393 2394 static struct clk_branch gcc_gp3_clk = { 2395 .halt_reg = 0x66000, 2396 .clkr = { 2397 .enable_reg = 0x66000, 2398 .enable_mask = BIT(0), 2399 .hw.init = &(struct clk_init_data){ 2400 .name = "gcc_gp3_clk", 2401 .parent_names = (const char *[]){ "gp3_clk_src" }, 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_pcie_0_slv_axi_clk = { 2410 .halt_reg = 0x6b008, 2411 .clkr = { 2412 .enable_reg = 0x6b008, 2413 .enable_mask = BIT(0), 2414 .hw.init = &(struct clk_init_data){ 2415 .name = "gcc_pcie_0_slv_axi_clk", 2416 .parent_names = (const char *[]){ "system_noc_clk_src" }, 2417 .num_parents = 1, 2418 .flags = CLK_SET_RATE_PARENT, 2419 .ops = &clk_branch2_ops, 2420 }, 2421 }, 2422 }; 2423 2424 static struct clk_branch gcc_pcie_0_mstr_axi_clk = { 2425 .halt_reg = 0x6b00c, 2426 .clkr = { 2427 .enable_reg = 0x6b00c, 2428 .enable_mask = BIT(0), 2429 .hw.init = &(struct clk_init_data){ 2430 .name = "gcc_pcie_0_mstr_axi_clk", 2431 .parent_names = (const char *[]){ "system_noc_clk_src" }, 2432 .num_parents = 1, 2433 .flags = CLK_SET_RATE_PARENT, 2434 .ops = &clk_branch2_ops, 2435 }, 2436 }, 2437 }; 2438 2439 static struct clk_branch gcc_pcie_0_cfg_ahb_clk = { 2440 .halt_reg = 0x6b010, 2441 .clkr = { 2442 .enable_reg = 0x6b010, 2443 .enable_mask = BIT(0), 2444 .hw.init = &(struct clk_init_data){ 2445 .name = "gcc_pcie_0_cfg_ahb_clk", 2446 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2447 .num_parents = 1, 2448 .flags = CLK_SET_RATE_PARENT, 2449 .ops = &clk_branch2_ops, 2450 }, 2451 }, 2452 }; 2453 2454 static struct clk_branch gcc_pcie_0_aux_clk = { 2455 .halt_reg = 0x6b014, 2456 .clkr = { 2457 .enable_reg = 0x6b014, 2458 .enable_mask = BIT(0), 2459 .hw.init = &(struct clk_init_data){ 2460 .name = "gcc_pcie_0_aux_clk", 2461 .parent_names = (const char *[]){ "pcie_aux_clk_src" }, 2462 .num_parents = 1, 2463 .flags = CLK_SET_RATE_PARENT, 2464 .ops = &clk_branch2_ops, 2465 }, 2466 }, 2467 }; 2468 2469 static struct clk_branch gcc_pcie_0_pipe_clk = { 2470 .halt_reg = 0x6b018, 2471 .clkr = { 2472 .enable_reg = 0x6b018, 2473 .enable_mask = BIT(0), 2474 .hw.init = &(struct clk_init_data){ 2475 .name = "gcc_pcie_0_pipe_clk", 2476 .parent_names = (const char *[]){ "pcie_0_pipe_clk_src" }, 2477 .num_parents = 1, 2478 .flags = CLK_SET_RATE_PARENT, 2479 .ops = &clk_branch2_ops, 2480 }, 2481 }, 2482 }; 2483 2484 static struct clk_branch gcc_pcie_1_slv_axi_clk = { 2485 .halt_reg = 0x6d008, 2486 .clkr = { 2487 .enable_reg = 0x6d008, 2488 .enable_mask = BIT(0), 2489 .hw.init = &(struct clk_init_data){ 2490 .name = "gcc_pcie_1_slv_axi_clk", 2491 .parent_names = (const char *[]){ "system_noc_clk_src" }, 2492 .num_parents = 1, 2493 .flags = CLK_SET_RATE_PARENT, 2494 .ops = &clk_branch2_ops, 2495 }, 2496 }, 2497 }; 2498 2499 static struct clk_branch gcc_pcie_1_mstr_axi_clk = { 2500 .halt_reg = 0x6d00c, 2501 .clkr = { 2502 .enable_reg = 0x6d00c, 2503 .enable_mask = BIT(0), 2504 .hw.init = &(struct clk_init_data){ 2505 .name = "gcc_pcie_1_mstr_axi_clk", 2506 .parent_names = (const char *[]){ "system_noc_clk_src" }, 2507 .num_parents = 1, 2508 .flags = CLK_SET_RATE_PARENT, 2509 .ops = &clk_branch2_ops, 2510 }, 2511 }, 2512 }; 2513 2514 static struct clk_branch gcc_pcie_1_cfg_ahb_clk = { 2515 .halt_reg = 0x6d010, 2516 .clkr = { 2517 .enable_reg = 0x6d010, 2518 .enable_mask = BIT(0), 2519 .hw.init = &(struct clk_init_data){ 2520 .name = "gcc_pcie_1_cfg_ahb_clk", 2521 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2522 .num_parents = 1, 2523 .flags = CLK_SET_RATE_PARENT, 2524 .ops = &clk_branch2_ops, 2525 }, 2526 }, 2527 }; 2528 2529 static struct clk_branch gcc_pcie_1_aux_clk = { 2530 .halt_reg = 0x6d014, 2531 .clkr = { 2532 .enable_reg = 0x6d014, 2533 .enable_mask = BIT(0), 2534 .hw.init = &(struct clk_init_data){ 2535 .name = "gcc_pcie_1_aux_clk", 2536 .parent_names = (const char *[]){ "pcie_aux_clk_src" }, 2537 .num_parents = 1, 2538 .flags = CLK_SET_RATE_PARENT, 2539 .ops = &clk_branch2_ops, 2540 }, 2541 }, 2542 }; 2543 2544 static struct clk_branch gcc_pcie_1_pipe_clk = { 2545 .halt_reg = 0x6d018, 2546 .clkr = { 2547 .enable_reg = 0x6d018, 2548 .enable_mask = BIT(0), 2549 .hw.init = &(struct clk_init_data){ 2550 .name = "gcc_pcie_1_pipe_clk", 2551 .parent_names = (const char *[]){ "pcie_1_pipe_clk_src" }, 2552 .num_parents = 1, 2553 .flags = CLK_SET_RATE_PARENT, 2554 .ops = &clk_branch2_ops, 2555 }, 2556 }, 2557 }; 2558 2559 static struct clk_branch gcc_pcie_2_slv_axi_clk = { 2560 .halt_reg = 0x6e008, 2561 .clkr = { 2562 .enable_reg = 0x6e008, 2563 .enable_mask = BIT(0), 2564 .hw.init = &(struct clk_init_data){ 2565 .name = "gcc_pcie_2_slv_axi_clk", 2566 .parent_names = (const char *[]){ "system_noc_clk_src" }, 2567 .num_parents = 1, 2568 .flags = CLK_SET_RATE_PARENT, 2569 .ops = &clk_branch2_ops, 2570 }, 2571 }, 2572 }; 2573 2574 static struct clk_branch gcc_pcie_2_mstr_axi_clk = { 2575 .halt_reg = 0x6e00c, 2576 .clkr = { 2577 .enable_reg = 0x6e00c, 2578 .enable_mask = BIT(0), 2579 .hw.init = &(struct clk_init_data){ 2580 .name = "gcc_pcie_2_mstr_axi_clk", 2581 .parent_names = (const char *[]){ "system_noc_clk_src" }, 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_pcie_2_cfg_ahb_clk = { 2590 .halt_reg = 0x6e010, 2591 .clkr = { 2592 .enable_reg = 0x6e010, 2593 .enable_mask = BIT(0), 2594 .hw.init = &(struct clk_init_data){ 2595 .name = "gcc_pcie_2_cfg_ahb_clk", 2596 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2597 .num_parents = 1, 2598 .flags = CLK_SET_RATE_PARENT, 2599 .ops = &clk_branch2_ops, 2600 }, 2601 }, 2602 }; 2603 2604 static struct clk_branch gcc_pcie_2_aux_clk = { 2605 .halt_reg = 0x6e014, 2606 .clkr = { 2607 .enable_reg = 0x6e014, 2608 .enable_mask = BIT(0), 2609 .hw.init = &(struct clk_init_data){ 2610 .name = "gcc_pcie_2_aux_clk", 2611 .parent_names = (const char *[]){ "pcie_aux_clk_src" }, 2612 .num_parents = 1, 2613 .flags = CLK_SET_RATE_PARENT, 2614 .ops = &clk_branch2_ops, 2615 }, 2616 }, 2617 }; 2618 2619 static struct clk_branch gcc_pcie_2_pipe_clk = { 2620 .halt_reg = 0x6e018, 2621 .clkr = { 2622 .enable_reg = 0x6e018, 2623 .enable_mask = BIT(0), 2624 .hw.init = &(struct clk_init_data){ 2625 .name = "gcc_pcie_2_pipe_clk", 2626 .parent_names = (const char *[]){ "pcie_2_pipe_clk_src" }, 2627 .num_parents = 1, 2628 .flags = CLK_SET_RATE_PARENT, 2629 .ops = &clk_branch2_ops, 2630 }, 2631 }, 2632 }; 2633 2634 static struct clk_branch gcc_pcie_phy_cfg_ahb_clk = { 2635 .halt_reg = 0x6f004, 2636 .clkr = { 2637 .enable_reg = 0x6f004, 2638 .enable_mask = BIT(0), 2639 .hw.init = &(struct clk_init_data){ 2640 .name = "gcc_pcie_phy_cfg_ahb_clk", 2641 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2642 .num_parents = 1, 2643 .flags = CLK_SET_RATE_PARENT, 2644 .ops = &clk_branch2_ops, 2645 }, 2646 }, 2647 }; 2648 2649 static struct clk_branch gcc_pcie_phy_aux_clk = { 2650 .halt_reg = 0x6f008, 2651 .clkr = { 2652 .enable_reg = 0x6f008, 2653 .enable_mask = BIT(0), 2654 .hw.init = &(struct clk_init_data){ 2655 .name = "gcc_pcie_phy_aux_clk", 2656 .parent_names = (const char *[]){ "pcie_aux_clk_src" }, 2657 .num_parents = 1, 2658 .flags = CLK_SET_RATE_PARENT, 2659 .ops = &clk_branch2_ops, 2660 }, 2661 }, 2662 }; 2663 2664 static struct clk_branch gcc_ufs_axi_clk = { 2665 .halt_reg = 0x75008, 2666 .clkr = { 2667 .enable_reg = 0x75008, 2668 .enable_mask = BIT(0), 2669 .hw.init = &(struct clk_init_data){ 2670 .name = "gcc_ufs_axi_clk", 2671 .parent_names = (const char *[]){ "ufs_axi_clk_src" }, 2672 .num_parents = 1, 2673 .flags = CLK_SET_RATE_PARENT, 2674 .ops = &clk_branch2_ops, 2675 }, 2676 }, 2677 }; 2678 2679 static struct clk_branch gcc_ufs_ahb_clk = { 2680 .halt_reg = 0x7500c, 2681 .clkr = { 2682 .enable_reg = 0x7500c, 2683 .enable_mask = BIT(0), 2684 .hw.init = &(struct clk_init_data){ 2685 .name = "gcc_ufs_ahb_clk", 2686 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2687 .num_parents = 1, 2688 .flags = CLK_SET_RATE_PARENT, 2689 .ops = &clk_branch2_ops, 2690 }, 2691 }, 2692 }; 2693 2694 static struct clk_fixed_factor ufs_tx_cfg_clk_src = { 2695 .mult = 1, 2696 .div = 16, 2697 .hw.init = &(struct clk_init_data){ 2698 .name = "ufs_tx_cfg_clk_src", 2699 .parent_names = (const char *[]){ "ufs_axi_clk_src" }, 2700 .num_parents = 1, 2701 .flags = CLK_SET_RATE_PARENT, 2702 .ops = &clk_fixed_factor_ops, 2703 }, 2704 }; 2705 2706 static struct clk_branch gcc_ufs_tx_cfg_clk = { 2707 .halt_reg = 0x75010, 2708 .clkr = { 2709 .enable_reg = 0x75010, 2710 .enable_mask = BIT(0), 2711 .hw.init = &(struct clk_init_data){ 2712 .name = "gcc_ufs_tx_cfg_clk", 2713 .parent_names = (const char *[]){ "ufs_tx_cfg_clk_src" }, 2714 .num_parents = 1, 2715 .flags = CLK_SET_RATE_PARENT, 2716 .ops = &clk_branch2_ops, 2717 }, 2718 }, 2719 }; 2720 2721 static struct clk_fixed_factor ufs_rx_cfg_clk_src = { 2722 .mult = 1, 2723 .div = 16, 2724 .hw.init = &(struct clk_init_data){ 2725 .name = "ufs_rx_cfg_clk_src", 2726 .parent_names = (const char *[]){ "ufs_axi_clk_src" }, 2727 .num_parents = 1, 2728 .flags = CLK_SET_RATE_PARENT, 2729 .ops = &clk_fixed_factor_ops, 2730 }, 2731 }; 2732 2733 static struct clk_branch gcc_ufs_rx_cfg_clk = { 2734 .halt_reg = 0x75014, 2735 .clkr = { 2736 .enable_reg = 0x75014, 2737 .enable_mask = BIT(0), 2738 .hw.init = &(struct clk_init_data){ 2739 .name = "gcc_ufs_rx_cfg_clk", 2740 .parent_names = (const char *[]){ "ufs_rx_cfg_clk_src" }, 2741 .num_parents = 1, 2742 .flags = CLK_SET_RATE_PARENT, 2743 .ops = &clk_branch2_ops, 2744 }, 2745 }, 2746 }; 2747 2748 static struct clk_branch gcc_ufs_tx_symbol_0_clk = { 2749 .halt_reg = 0x75018, 2750 .clkr = { 2751 .enable_reg = 0x75018, 2752 .enable_mask = BIT(0), 2753 .hw.init = &(struct clk_init_data){ 2754 .name = "gcc_ufs_tx_symbol_0_clk", 2755 .parent_names = (const char *[]){ "ufs_tx_symbol_0_clk_src" }, 2756 .num_parents = 1, 2757 .flags = CLK_SET_RATE_PARENT, 2758 .ops = &clk_branch2_ops, 2759 }, 2760 }, 2761 }; 2762 2763 static struct clk_branch gcc_ufs_rx_symbol_0_clk = { 2764 .halt_reg = 0x7501c, 2765 .clkr = { 2766 .enable_reg = 0x7501c, 2767 .enable_mask = BIT(0), 2768 .hw.init = &(struct clk_init_data){ 2769 .name = "gcc_ufs_rx_symbol_0_clk", 2770 .parent_names = (const char *[]){ "ufs_rx_symbol_0_clk_src" }, 2771 .num_parents = 1, 2772 .flags = CLK_SET_RATE_PARENT, 2773 .ops = &clk_branch2_ops, 2774 }, 2775 }, 2776 }; 2777 2778 static struct clk_branch gcc_ufs_rx_symbol_1_clk = { 2779 .halt_reg = 0x75020, 2780 .clkr = { 2781 .enable_reg = 0x75020, 2782 .enable_mask = BIT(0), 2783 .hw.init = &(struct clk_init_data){ 2784 .name = "gcc_ufs_rx_symbol_1_clk", 2785 .parent_names = (const char *[]){ "ufs_rx_symbol_1_clk_src" }, 2786 .num_parents = 1, 2787 .flags = CLK_SET_RATE_PARENT, 2788 .ops = &clk_branch2_ops, 2789 }, 2790 }, 2791 }; 2792 2793 static struct clk_fixed_factor ufs_ice_core_postdiv_clk_src = { 2794 .mult = 1, 2795 .div = 2, 2796 .hw.init = &(struct clk_init_data){ 2797 .name = "ufs_ice_core_postdiv_clk_src", 2798 .parent_names = (const char *[]){ "ufs_ice_core_clk_src" }, 2799 .num_parents = 1, 2800 .flags = CLK_SET_RATE_PARENT, 2801 .ops = &clk_fixed_factor_ops, 2802 }, 2803 }; 2804 2805 static struct clk_branch gcc_ufs_unipro_core_clk = { 2806 .halt_reg = 0x7600c, 2807 .clkr = { 2808 .enable_reg = 0x7600c, 2809 .enable_mask = BIT(0), 2810 .hw.init = &(struct clk_init_data){ 2811 .name = "gcc_ufs_unipro_core_clk", 2812 .parent_names = (const char *[]){ "ufs_ice_core_postdiv_clk_src" }, 2813 .num_parents = 1, 2814 .flags = CLK_SET_RATE_PARENT, 2815 .ops = &clk_branch2_ops, 2816 }, 2817 }, 2818 }; 2819 2820 static struct clk_branch gcc_ufs_ice_core_clk = { 2821 .halt_reg = 0x76010, 2822 .clkr = { 2823 .enable_reg = 0x76010, 2824 .enable_mask = BIT(0), 2825 .hw.init = &(struct clk_init_data){ 2826 .name = "gcc_ufs_ice_core_clk", 2827 .parent_names = (const char *[]){ "ufs_ice_core_clk_src" }, 2828 .num_parents = 1, 2829 .flags = CLK_SET_RATE_PARENT, 2830 .ops = &clk_branch2_ops, 2831 }, 2832 }, 2833 }; 2834 2835 static struct clk_branch gcc_ufs_sys_clk_core_clk = { 2836 .halt_check = BRANCH_HALT_DELAY, 2837 .clkr = { 2838 .enable_reg = 0x76030, 2839 .enable_mask = BIT(0), 2840 .hw.init = &(struct clk_init_data){ 2841 .name = "gcc_ufs_sys_clk_core_clk", 2842 .ops = &clk_branch2_ops, 2843 }, 2844 }, 2845 }; 2846 2847 static struct clk_branch gcc_ufs_tx_symbol_clk_core_clk = { 2848 .halt_check = BRANCH_HALT_DELAY, 2849 .clkr = { 2850 .enable_reg = 0x76034, 2851 .enable_mask = BIT(0), 2852 .hw.init = &(struct clk_init_data){ 2853 .name = "gcc_ufs_tx_symbol_clk_core_clk", 2854 .ops = &clk_branch2_ops, 2855 }, 2856 }, 2857 }; 2858 2859 static struct clk_branch gcc_aggre0_snoc_axi_clk = { 2860 .halt_reg = 0x81008, 2861 .clkr = { 2862 .enable_reg = 0x81008, 2863 .enable_mask = BIT(0), 2864 .hw.init = &(struct clk_init_data){ 2865 .name = "gcc_aggre0_snoc_axi_clk", 2866 .parent_names = (const char *[]){ "system_noc_clk_src" }, 2867 .num_parents = 1, 2868 .flags = CLK_SET_RATE_PARENT, 2869 .ops = &clk_branch2_ops, 2870 }, 2871 }, 2872 }; 2873 2874 static struct clk_branch gcc_aggre0_cnoc_ahb_clk = { 2875 .halt_reg = 0x8100c, 2876 .clkr = { 2877 .enable_reg = 0x8100c, 2878 .enable_mask = BIT(0), 2879 .hw.init = &(struct clk_init_data){ 2880 .name = "gcc_aggre0_cnoc_ahb_clk", 2881 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2882 .num_parents = 1, 2883 .flags = CLK_SET_RATE_PARENT, 2884 .ops = &clk_branch2_ops, 2885 }, 2886 }, 2887 }; 2888 2889 static struct clk_branch gcc_smmu_aggre0_axi_clk = { 2890 .halt_reg = 0x81014, 2891 .clkr = { 2892 .enable_reg = 0x81014, 2893 .enable_mask = BIT(0), 2894 .hw.init = &(struct clk_init_data){ 2895 .name = "gcc_smmu_aggre0_axi_clk", 2896 .parent_names = (const char *[]){ "system_noc_clk_src" }, 2897 .num_parents = 1, 2898 .flags = CLK_SET_RATE_PARENT, 2899 .ops = &clk_branch2_ops, 2900 }, 2901 }, 2902 }; 2903 2904 static struct clk_branch gcc_smmu_aggre0_ahb_clk = { 2905 .halt_reg = 0x81018, 2906 .clkr = { 2907 .enable_reg = 0x81018, 2908 .enable_mask = BIT(0), 2909 .hw.init = &(struct clk_init_data){ 2910 .name = "gcc_smmu_aggre0_ahb_clk", 2911 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2912 .num_parents = 1, 2913 .flags = CLK_SET_RATE_PARENT, 2914 .ops = &clk_branch2_ops, 2915 }, 2916 }, 2917 }; 2918 2919 static struct clk_branch gcc_aggre2_ufs_axi_clk = { 2920 .halt_reg = 0x83014, 2921 .clkr = { 2922 .enable_reg = 0x83014, 2923 .enable_mask = BIT(0), 2924 .hw.init = &(struct clk_init_data){ 2925 .name = "gcc_aggre2_ufs_axi_clk", 2926 .parent_names = (const char *[]){ "ufs_axi_clk_src" }, 2927 .num_parents = 1, 2928 .flags = CLK_SET_RATE_PARENT, 2929 .ops = &clk_branch2_ops, 2930 }, 2931 }, 2932 }; 2933 2934 static struct clk_branch gcc_aggre2_usb3_axi_clk = { 2935 .halt_reg = 0x83018, 2936 .clkr = { 2937 .enable_reg = 0x83018, 2938 .enable_mask = BIT(0), 2939 .hw.init = &(struct clk_init_data){ 2940 .name = "gcc_aggre2_usb3_axi_clk", 2941 .parent_names = (const char *[]){ "usb30_master_clk_src" }, 2942 .num_parents = 1, 2943 .flags = CLK_SET_RATE_PARENT, 2944 .ops = &clk_branch2_ops, 2945 }, 2946 }, 2947 }; 2948 2949 static struct clk_branch gcc_qspi_ahb_clk = { 2950 .halt_reg = 0x8b004, 2951 .clkr = { 2952 .enable_reg = 0x8b004, 2953 .enable_mask = BIT(0), 2954 .hw.init = &(struct clk_init_data){ 2955 .name = "gcc_qspi_ahb_clk", 2956 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 2957 .num_parents = 1, 2958 .flags = CLK_SET_RATE_PARENT, 2959 .ops = &clk_branch2_ops, 2960 }, 2961 }, 2962 }; 2963 2964 static struct clk_branch gcc_qspi_ser_clk = { 2965 .halt_reg = 0x8b008, 2966 .clkr = { 2967 .enable_reg = 0x8b008, 2968 .enable_mask = BIT(0), 2969 .hw.init = &(struct clk_init_data){ 2970 .name = "gcc_qspi_ser_clk", 2971 .parent_names = (const char *[]){ "qspi_ser_clk_src" }, 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_usb3_clkref_clk = { 2980 .halt_reg = 0x8800C, 2981 .clkr = { 2982 .enable_reg = 0x8800C, 2983 .enable_mask = BIT(0), 2984 .hw.init = &(struct clk_init_data){ 2985 .name = "gcc_usb3_clkref_clk", 2986 .parent_names = (const char *[]){ "xo" }, 2987 .num_parents = 1, 2988 .ops = &clk_branch2_ops, 2989 }, 2990 }, 2991 }; 2992 2993 static struct clk_branch gcc_hdmi_clkref_clk = { 2994 .halt_reg = 0x88000, 2995 .clkr = { 2996 .enable_reg = 0x88000, 2997 .enable_mask = BIT(0), 2998 .hw.init = &(struct clk_init_data){ 2999 .name = "gcc_hdmi_clkref_clk", 3000 .parent_names = (const char *[]){ "xo" }, 3001 .num_parents = 1, 3002 .ops = &clk_branch2_ops, 3003 }, 3004 }, 3005 }; 3006 3007 static struct clk_branch gcc_ufs_clkref_clk = { 3008 .halt_reg = 0x88008, 3009 .clkr = { 3010 .enable_reg = 0x88008, 3011 .enable_mask = BIT(0), 3012 .hw.init = &(struct clk_init_data){ 3013 .name = "gcc_ufs_clkref_clk", 3014 .parent_names = (const char *[]){ "xo" }, 3015 .num_parents = 1, 3016 .ops = &clk_branch2_ops, 3017 }, 3018 }, 3019 }; 3020 3021 static struct clk_branch gcc_pcie_clkref_clk = { 3022 .halt_reg = 0x88010, 3023 .clkr = { 3024 .enable_reg = 0x88010, 3025 .enable_mask = BIT(0), 3026 .hw.init = &(struct clk_init_data){ 3027 .name = "gcc_pcie_clkref_clk", 3028 .parent_names = (const char *[]){ "xo" }, 3029 .num_parents = 1, 3030 .ops = &clk_branch2_ops, 3031 }, 3032 }, 3033 }; 3034 3035 static struct clk_branch gcc_rx2_usb2_clkref_clk = { 3036 .halt_reg = 0x88014, 3037 .clkr = { 3038 .enable_reg = 0x88014, 3039 .enable_mask = BIT(0), 3040 .hw.init = &(struct clk_init_data){ 3041 .name = "gcc_rx2_usb2_clkref_clk", 3042 .parent_names = (const char *[]){ "xo" }, 3043 .num_parents = 1, 3044 .ops = &clk_branch2_ops, 3045 }, 3046 }, 3047 }; 3048 3049 static struct clk_branch gcc_rx1_usb2_clkref_clk = { 3050 .halt_reg = 0x88018, 3051 .clkr = { 3052 .enable_reg = 0x88018, 3053 .enable_mask = BIT(0), 3054 .hw.init = &(struct clk_init_data){ 3055 .name = "gcc_rx1_usb2_clkref_clk", 3056 .parent_names = (const char *[]){ "xo" }, 3057 .num_parents = 1, 3058 .ops = &clk_branch2_ops, 3059 }, 3060 }, 3061 }; 3062 3063 static struct clk_hw *gcc_msm8996_hws[] = { 3064 &xo.hw, 3065 &gpll0_early_div.hw, 3066 &ufs_tx_cfg_clk_src.hw, 3067 &ufs_rx_cfg_clk_src.hw, 3068 &ufs_ice_core_postdiv_clk_src.hw, 3069 }; 3070 3071 static struct gdsc aggre0_noc_gdsc = { 3072 .gdscr = 0x81004, 3073 .gds_hw_ctrl = 0x81028, 3074 .pd = { 3075 .name = "aggre0_noc", 3076 }, 3077 .pwrsts = PWRSTS_OFF_ON, 3078 .flags = VOTABLE, 3079 }; 3080 3081 static struct gdsc hlos1_vote_aggre0_noc_gdsc = { 3082 .gdscr = 0x7d024, 3083 .pd = { 3084 .name = "hlos1_vote_aggre0_noc", 3085 }, 3086 .pwrsts = PWRSTS_OFF_ON, 3087 .flags = VOTABLE, 3088 }; 3089 3090 static struct gdsc hlos1_vote_lpass_adsp_gdsc = { 3091 .gdscr = 0x7d034, 3092 .pd = { 3093 .name = "hlos1_vote_lpass_adsp", 3094 }, 3095 .pwrsts = PWRSTS_OFF_ON, 3096 .flags = VOTABLE, 3097 }; 3098 3099 static struct gdsc hlos1_vote_lpass_core_gdsc = { 3100 .gdscr = 0x7d038, 3101 .pd = { 3102 .name = "hlos1_vote_lpass_core", 3103 }, 3104 .pwrsts = PWRSTS_OFF_ON, 3105 .flags = VOTABLE, 3106 }; 3107 3108 static struct gdsc usb30_gdsc = { 3109 .gdscr = 0xf004, 3110 .pd = { 3111 .name = "usb30", 3112 }, 3113 .pwrsts = PWRSTS_OFF_ON, 3114 }; 3115 3116 static struct gdsc pcie0_gdsc = { 3117 .gdscr = 0x6b004, 3118 .pd = { 3119 .name = "pcie0", 3120 }, 3121 .pwrsts = PWRSTS_OFF_ON, 3122 }; 3123 3124 static struct gdsc pcie1_gdsc = { 3125 .gdscr = 0x6d004, 3126 .pd = { 3127 .name = "pcie1", 3128 }, 3129 .pwrsts = PWRSTS_OFF_ON, 3130 }; 3131 3132 static struct gdsc pcie2_gdsc = { 3133 .gdscr = 0x6e004, 3134 .pd = { 3135 .name = "pcie2", 3136 }, 3137 .pwrsts = PWRSTS_OFF_ON, 3138 }; 3139 3140 static struct gdsc ufs_gdsc = { 3141 .gdscr = 0x75004, 3142 .pd = { 3143 .name = "ufs", 3144 }, 3145 .pwrsts = PWRSTS_OFF_ON, 3146 }; 3147 3148 static struct clk_regmap *gcc_msm8996_clocks[] = { 3149 [GPLL0_EARLY] = &gpll0_early.clkr, 3150 [GPLL0] = &gpll0.clkr, 3151 [GPLL4_EARLY] = &gpll4_early.clkr, 3152 [GPLL4] = &gpll4.clkr, 3153 [SYSTEM_NOC_CLK_SRC] = &system_noc_clk_src.clkr, 3154 [CONFIG_NOC_CLK_SRC] = &config_noc_clk_src.clkr, 3155 [PERIPH_NOC_CLK_SRC] = &periph_noc_clk_src.clkr, 3156 [USB30_MASTER_CLK_SRC] = &usb30_master_clk_src.clkr, 3157 [USB30_MOCK_UTMI_CLK_SRC] = &usb30_mock_utmi_clk_src.clkr, 3158 [USB3_PHY_AUX_CLK_SRC] = &usb3_phy_aux_clk_src.clkr, 3159 [USB20_MASTER_CLK_SRC] = &usb20_master_clk_src.clkr, 3160 [USB20_MOCK_UTMI_CLK_SRC] = &usb20_mock_utmi_clk_src.clkr, 3161 [SDCC1_APPS_CLK_SRC] = &sdcc1_apps_clk_src.clkr, 3162 [SDCC1_ICE_CORE_CLK_SRC] = &sdcc1_ice_core_clk_src.clkr, 3163 [SDCC2_APPS_CLK_SRC] = &sdcc2_apps_clk_src.clkr, 3164 [SDCC3_APPS_CLK_SRC] = &sdcc3_apps_clk_src.clkr, 3165 [SDCC4_APPS_CLK_SRC] = &sdcc4_apps_clk_src.clkr, 3166 [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr, 3167 [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr, 3168 [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr, 3169 [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr, 3170 [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr, 3171 [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr, 3172 [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr, 3173 [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr, 3174 [BLSP1_UART3_APPS_CLK_SRC] = &blsp1_uart3_apps_clk_src.clkr, 3175 [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr, 3176 [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr, 3177 [BLSP1_UART4_APPS_CLK_SRC] = &blsp1_uart4_apps_clk_src.clkr, 3178 [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr, 3179 [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr, 3180 [BLSP1_UART5_APPS_CLK_SRC] = &blsp1_uart5_apps_clk_src.clkr, 3181 [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr, 3182 [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr, 3183 [BLSP1_UART6_APPS_CLK_SRC] = &blsp1_uart6_apps_clk_src.clkr, 3184 [BLSP2_QUP1_SPI_APPS_CLK_SRC] = &blsp2_qup1_spi_apps_clk_src.clkr, 3185 [BLSP2_QUP1_I2C_APPS_CLK_SRC] = &blsp2_qup1_i2c_apps_clk_src.clkr, 3186 [BLSP2_UART1_APPS_CLK_SRC] = &blsp2_uart1_apps_clk_src.clkr, 3187 [BLSP2_QUP2_SPI_APPS_CLK_SRC] = &blsp2_qup2_spi_apps_clk_src.clkr, 3188 [BLSP2_QUP2_I2C_APPS_CLK_SRC] = &blsp2_qup2_i2c_apps_clk_src.clkr, 3189 [BLSP2_UART2_APPS_CLK_SRC] = &blsp2_uart2_apps_clk_src.clkr, 3190 [BLSP2_QUP3_SPI_APPS_CLK_SRC] = &blsp2_qup3_spi_apps_clk_src.clkr, 3191 [BLSP2_QUP3_I2C_APPS_CLK_SRC] = &blsp2_qup3_i2c_apps_clk_src.clkr, 3192 [BLSP2_UART3_APPS_CLK_SRC] = &blsp2_uart3_apps_clk_src.clkr, 3193 [BLSP2_QUP4_SPI_APPS_CLK_SRC] = &blsp2_qup4_spi_apps_clk_src.clkr, 3194 [BLSP2_QUP4_I2C_APPS_CLK_SRC] = &blsp2_qup4_i2c_apps_clk_src.clkr, 3195 [BLSP2_UART4_APPS_CLK_SRC] = &blsp2_uart4_apps_clk_src.clkr, 3196 [BLSP2_QUP5_SPI_APPS_CLK_SRC] = &blsp2_qup5_spi_apps_clk_src.clkr, 3197 [BLSP2_QUP5_I2C_APPS_CLK_SRC] = &blsp2_qup5_i2c_apps_clk_src.clkr, 3198 [BLSP2_UART5_APPS_CLK_SRC] = &blsp2_uart5_apps_clk_src.clkr, 3199 [BLSP2_QUP6_SPI_APPS_CLK_SRC] = &blsp2_qup6_spi_apps_clk_src.clkr, 3200 [BLSP2_QUP6_I2C_APPS_CLK_SRC] = &blsp2_qup6_i2c_apps_clk_src.clkr, 3201 [BLSP2_UART6_APPS_CLK_SRC] = &blsp2_uart6_apps_clk_src.clkr, 3202 [PDM2_CLK_SRC] = &pdm2_clk_src.clkr, 3203 [TSIF_REF_CLK_SRC] = &tsif_ref_clk_src.clkr, 3204 [GCC_SLEEP_CLK_SRC] = &gcc_sleep_clk_src.clkr, 3205 [HMSS_RBCPR_CLK_SRC] = &hmss_rbcpr_clk_src.clkr, 3206 [HMSS_GPLL0_CLK_SRC] = &hmss_gpll0_clk_src.clkr, 3207 [GP1_CLK_SRC] = &gp1_clk_src.clkr, 3208 [GP2_CLK_SRC] = &gp2_clk_src.clkr, 3209 [GP3_CLK_SRC] = &gp3_clk_src.clkr, 3210 [PCIE_AUX_CLK_SRC] = &pcie_aux_clk_src.clkr, 3211 [UFS_AXI_CLK_SRC] = &ufs_axi_clk_src.clkr, 3212 [UFS_ICE_CORE_CLK_SRC] = &ufs_ice_core_clk_src.clkr, 3213 [QSPI_SER_CLK_SRC] = &qspi_ser_clk_src.clkr, 3214 [GCC_SYS_NOC_USB3_AXI_CLK] = &gcc_sys_noc_usb3_axi_clk.clkr, 3215 [GCC_SYS_NOC_UFS_AXI_CLK] = &gcc_sys_noc_ufs_axi_clk.clkr, 3216 [GCC_PERIPH_NOC_USB20_AHB_CLK] = &gcc_periph_noc_usb20_ahb_clk.clkr, 3217 [GCC_MMSS_NOC_CFG_AHB_CLK] = &gcc_mmss_noc_cfg_ahb_clk.clkr, 3218 [GCC_MMSS_BIMC_GFX_CLK] = &gcc_mmss_bimc_gfx_clk.clkr, 3219 [GCC_USB30_MASTER_CLK] = &gcc_usb30_master_clk.clkr, 3220 [GCC_USB30_SLEEP_CLK] = &gcc_usb30_sleep_clk.clkr, 3221 [GCC_USB30_MOCK_UTMI_CLK] = &gcc_usb30_mock_utmi_clk.clkr, 3222 [GCC_USB3_PHY_AUX_CLK] = &gcc_usb3_phy_aux_clk.clkr, 3223 [GCC_USB3_PHY_PIPE_CLK] = &gcc_usb3_phy_pipe_clk.clkr, 3224 [GCC_USB20_MASTER_CLK] = &gcc_usb20_master_clk.clkr, 3225 [GCC_USB20_SLEEP_CLK] = &gcc_usb20_sleep_clk.clkr, 3226 [GCC_USB20_MOCK_UTMI_CLK] = &gcc_usb20_mock_utmi_clk.clkr, 3227 [GCC_USB_PHY_CFG_AHB2PHY_CLK] = &gcc_usb_phy_cfg_ahb2phy_clk.clkr, 3228 [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr, 3229 [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr, 3230 [GCC_SDCC1_ICE_CORE_CLK] = &gcc_sdcc1_ice_core_clk.clkr, 3231 [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr, 3232 [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr, 3233 [GCC_SDCC3_APPS_CLK] = &gcc_sdcc3_apps_clk.clkr, 3234 [GCC_SDCC3_AHB_CLK] = &gcc_sdcc3_ahb_clk.clkr, 3235 [GCC_SDCC4_APPS_CLK] = &gcc_sdcc4_apps_clk.clkr, 3236 [GCC_SDCC4_AHB_CLK] = &gcc_sdcc4_ahb_clk.clkr, 3237 [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr, 3238 [GCC_BLSP1_SLEEP_CLK] = &gcc_blsp1_sleep_clk.clkr, 3239 [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr, 3240 [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr, 3241 [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr, 3242 [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr, 3243 [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr, 3244 [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr, 3245 [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr, 3246 [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr, 3247 [GCC_BLSP1_UART3_APPS_CLK] = &gcc_blsp1_uart3_apps_clk.clkr, 3248 [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr, 3249 [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr, 3250 [GCC_BLSP1_UART4_APPS_CLK] = &gcc_blsp1_uart4_apps_clk.clkr, 3251 [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr, 3252 [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr, 3253 [GCC_BLSP1_UART5_APPS_CLK] = &gcc_blsp1_uart5_apps_clk.clkr, 3254 [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr, 3255 [GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr, 3256 [GCC_BLSP1_UART6_APPS_CLK] = &gcc_blsp1_uart6_apps_clk.clkr, 3257 [GCC_BLSP2_AHB_CLK] = &gcc_blsp2_ahb_clk.clkr, 3258 [GCC_BLSP2_SLEEP_CLK] = &gcc_blsp2_sleep_clk.clkr, 3259 [GCC_BLSP2_QUP1_SPI_APPS_CLK] = &gcc_blsp2_qup1_spi_apps_clk.clkr, 3260 [GCC_BLSP2_QUP1_I2C_APPS_CLK] = &gcc_blsp2_qup1_i2c_apps_clk.clkr, 3261 [GCC_BLSP2_UART1_APPS_CLK] = &gcc_blsp2_uart1_apps_clk.clkr, 3262 [GCC_BLSP2_QUP2_SPI_APPS_CLK] = &gcc_blsp2_qup2_spi_apps_clk.clkr, 3263 [GCC_BLSP2_QUP2_I2C_APPS_CLK] = &gcc_blsp2_qup2_i2c_apps_clk.clkr, 3264 [GCC_BLSP2_UART2_APPS_CLK] = &gcc_blsp2_uart2_apps_clk.clkr, 3265 [GCC_BLSP2_QUP3_SPI_APPS_CLK] = &gcc_blsp2_qup3_spi_apps_clk.clkr, 3266 [GCC_BLSP2_QUP3_I2C_APPS_CLK] = &gcc_blsp2_qup3_i2c_apps_clk.clkr, 3267 [GCC_BLSP2_UART3_APPS_CLK] = &gcc_blsp2_uart3_apps_clk.clkr, 3268 [GCC_BLSP2_QUP4_SPI_APPS_CLK] = &gcc_blsp2_qup4_spi_apps_clk.clkr, 3269 [GCC_BLSP2_QUP4_I2C_APPS_CLK] = &gcc_blsp2_qup4_i2c_apps_clk.clkr, 3270 [GCC_BLSP2_UART4_APPS_CLK] = &gcc_blsp2_uart4_apps_clk.clkr, 3271 [GCC_BLSP2_QUP5_SPI_APPS_CLK] = &gcc_blsp2_qup5_spi_apps_clk.clkr, 3272 [GCC_BLSP2_QUP5_I2C_APPS_CLK] = &gcc_blsp2_qup5_i2c_apps_clk.clkr, 3273 [GCC_BLSP2_UART5_APPS_CLK] = &gcc_blsp2_uart5_apps_clk.clkr, 3274 [GCC_BLSP2_QUP6_SPI_APPS_CLK] = &gcc_blsp2_qup6_spi_apps_clk.clkr, 3275 [GCC_BLSP2_QUP6_I2C_APPS_CLK] = &gcc_blsp2_qup6_i2c_apps_clk.clkr, 3276 [GCC_BLSP2_UART6_APPS_CLK] = &gcc_blsp2_uart6_apps_clk.clkr, 3277 [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr, 3278 [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr, 3279 [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr, 3280 [GCC_TSIF_AHB_CLK] = &gcc_tsif_ahb_clk.clkr, 3281 [GCC_TSIF_REF_CLK] = &gcc_tsif_ref_clk.clkr, 3282 [GCC_TSIF_INACTIVITY_TIMERS_CLK] = &gcc_tsif_inactivity_timers_clk.clkr, 3283 [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr, 3284 [GCC_BIMC_GFX_CLK] = &gcc_bimc_gfx_clk.clkr, 3285 [GCC_HMSS_RBCPR_CLK] = &gcc_hmss_rbcpr_clk.clkr, 3286 [GCC_GP1_CLK] = &gcc_gp1_clk.clkr, 3287 [GCC_GP2_CLK] = &gcc_gp2_clk.clkr, 3288 [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, 3289 [GCC_PCIE_0_SLV_AXI_CLK] = &gcc_pcie_0_slv_axi_clk.clkr, 3290 [GCC_PCIE_0_MSTR_AXI_CLK] = &gcc_pcie_0_mstr_axi_clk.clkr, 3291 [GCC_PCIE_0_CFG_AHB_CLK] = &gcc_pcie_0_cfg_ahb_clk.clkr, 3292 [GCC_PCIE_0_AUX_CLK] = &gcc_pcie_0_aux_clk.clkr, 3293 [GCC_PCIE_0_PIPE_CLK] = &gcc_pcie_0_pipe_clk.clkr, 3294 [GCC_PCIE_1_SLV_AXI_CLK] = &gcc_pcie_1_slv_axi_clk.clkr, 3295 [GCC_PCIE_1_MSTR_AXI_CLK] = &gcc_pcie_1_mstr_axi_clk.clkr, 3296 [GCC_PCIE_1_CFG_AHB_CLK] = &gcc_pcie_1_cfg_ahb_clk.clkr, 3297 [GCC_PCIE_1_AUX_CLK] = &gcc_pcie_1_aux_clk.clkr, 3298 [GCC_PCIE_1_PIPE_CLK] = &gcc_pcie_1_pipe_clk.clkr, 3299 [GCC_PCIE_2_SLV_AXI_CLK] = &gcc_pcie_2_slv_axi_clk.clkr, 3300 [GCC_PCIE_2_MSTR_AXI_CLK] = &gcc_pcie_2_mstr_axi_clk.clkr, 3301 [GCC_PCIE_2_CFG_AHB_CLK] = &gcc_pcie_2_cfg_ahb_clk.clkr, 3302 [GCC_PCIE_2_AUX_CLK] = &gcc_pcie_2_aux_clk.clkr, 3303 [GCC_PCIE_2_PIPE_CLK] = &gcc_pcie_2_pipe_clk.clkr, 3304 [GCC_PCIE_PHY_CFG_AHB_CLK] = &gcc_pcie_phy_cfg_ahb_clk.clkr, 3305 [GCC_PCIE_PHY_AUX_CLK] = &gcc_pcie_phy_aux_clk.clkr, 3306 [GCC_UFS_AXI_CLK] = &gcc_ufs_axi_clk.clkr, 3307 [GCC_UFS_AHB_CLK] = &gcc_ufs_ahb_clk.clkr, 3308 [GCC_UFS_TX_CFG_CLK] = &gcc_ufs_tx_cfg_clk.clkr, 3309 [GCC_UFS_RX_CFG_CLK] = &gcc_ufs_rx_cfg_clk.clkr, 3310 [GCC_UFS_TX_SYMBOL_0_CLK] = &gcc_ufs_tx_symbol_0_clk.clkr, 3311 [GCC_UFS_RX_SYMBOL_0_CLK] = &gcc_ufs_rx_symbol_0_clk.clkr, 3312 [GCC_UFS_RX_SYMBOL_1_CLK] = &gcc_ufs_rx_symbol_1_clk.clkr, 3313 [GCC_UFS_UNIPRO_CORE_CLK] = &gcc_ufs_unipro_core_clk.clkr, 3314 [GCC_UFS_ICE_CORE_CLK] = &gcc_ufs_ice_core_clk.clkr, 3315 [GCC_UFS_SYS_CLK_CORE_CLK] = &gcc_ufs_sys_clk_core_clk.clkr, 3316 [GCC_UFS_TX_SYMBOL_CLK_CORE_CLK] = &gcc_ufs_tx_symbol_clk_core_clk.clkr, 3317 [GCC_AGGRE0_SNOC_AXI_CLK] = &gcc_aggre0_snoc_axi_clk.clkr, 3318 [GCC_AGGRE0_CNOC_AHB_CLK] = &gcc_aggre0_cnoc_ahb_clk.clkr, 3319 [GCC_SMMU_AGGRE0_AXI_CLK] = &gcc_smmu_aggre0_axi_clk.clkr, 3320 [GCC_SMMU_AGGRE0_AHB_CLK] = &gcc_smmu_aggre0_ahb_clk.clkr, 3321 [GCC_AGGRE2_UFS_AXI_CLK] = &gcc_aggre2_ufs_axi_clk.clkr, 3322 [GCC_AGGRE2_USB3_AXI_CLK] = &gcc_aggre2_usb3_axi_clk.clkr, 3323 [GCC_QSPI_AHB_CLK] = &gcc_qspi_ahb_clk.clkr, 3324 [GCC_QSPI_SER_CLK] = &gcc_qspi_ser_clk.clkr, 3325 [GCC_USB3_CLKREF_CLK] = &gcc_usb3_clkref_clk.clkr, 3326 [GCC_HDMI_CLKREF_CLK] = &gcc_hdmi_clkref_clk.clkr, 3327 [GCC_UFS_CLKREF_CLK] = &gcc_ufs_clkref_clk.clkr, 3328 [GCC_PCIE_CLKREF_CLK] = &gcc_pcie_clkref_clk.clkr, 3329 [GCC_RX2_USB2_CLKREF_CLK] = &gcc_rx2_usb2_clkref_clk.clkr, 3330 [GCC_RX1_USB2_CLKREF_CLK] = &gcc_rx1_usb2_clkref_clk.clkr, 3331 }; 3332 3333 static struct gdsc *gcc_msm8996_gdscs[] = { 3334 [AGGRE0_NOC_GDSC] = &aggre0_noc_gdsc, 3335 [HLOS1_VOTE_AGGRE0_NOC_GDSC] = &hlos1_vote_aggre0_noc_gdsc, 3336 [HLOS1_VOTE_LPASS_ADSP_GDSC] = &hlos1_vote_lpass_adsp_gdsc, 3337 [HLOS1_VOTE_LPASS_CORE_GDSC] = &hlos1_vote_lpass_core_gdsc, 3338 [USB30_GDSC] = &usb30_gdsc, 3339 [PCIE0_GDSC] = &pcie0_gdsc, 3340 [PCIE1_GDSC] = &pcie1_gdsc, 3341 [PCIE2_GDSC] = &pcie2_gdsc, 3342 [UFS_GDSC] = &ufs_gdsc, 3343 }; 3344 3345 static const struct qcom_reset_map gcc_msm8996_resets[] = { 3346 [GCC_SYSTEM_NOC_BCR] = { 0x4000 }, 3347 [GCC_CONFIG_NOC_BCR] = { 0x5000 }, 3348 [GCC_PERIPH_NOC_BCR] = { 0x6000 }, 3349 [GCC_IMEM_BCR] = { 0x8000 }, 3350 [GCC_MMSS_BCR] = { 0x9000 }, 3351 [GCC_PIMEM_BCR] = { 0x0a000 }, 3352 [GCC_QDSS_BCR] = { 0x0c000 }, 3353 [GCC_USB_30_BCR] = { 0x0f000 }, 3354 [GCC_USB_20_BCR] = { 0x12000 }, 3355 [GCC_QUSB2PHY_PRIM_BCR] = { 0x12038 }, 3356 [GCC_QUSB2PHY_SEC_BCR] = { 0x1203c }, 3357 [GCC_USB3_PHY_BCR] = { 0x50020 }, 3358 [GCC_USB3PHY_PHY_BCR] = { 0x50024 }, 3359 [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 }, 3360 [GCC_SDCC1_BCR] = { 0x13000 }, 3361 [GCC_SDCC2_BCR] = { 0x14000 }, 3362 [GCC_SDCC3_BCR] = { 0x15000 }, 3363 [GCC_SDCC4_BCR] = { 0x16000 }, 3364 [GCC_BLSP1_BCR] = { 0x17000 }, 3365 [GCC_BLSP1_QUP1_BCR] = { 0x19000 }, 3366 [GCC_BLSP1_UART1_BCR] = { 0x1a000 }, 3367 [GCC_BLSP1_QUP2_BCR] = { 0x1b000 }, 3368 [GCC_BLSP1_UART2_BCR] = { 0x1c000 }, 3369 [GCC_BLSP1_QUP3_BCR] = { 0x1d000 }, 3370 [GCC_BLSP1_UART3_BCR] = { 0x1e000 }, 3371 [GCC_BLSP1_QUP4_BCR] = { 0x1f000 }, 3372 [GCC_BLSP1_UART4_BCR] = { 0x20000 }, 3373 [GCC_BLSP1_QUP5_BCR] = { 0x21000 }, 3374 [GCC_BLSP1_UART5_BCR] = { 0x22000 }, 3375 [GCC_BLSP1_QUP6_BCR] = { 0x23000 }, 3376 [GCC_BLSP1_UART6_BCR] = { 0x24000 }, 3377 [GCC_BLSP2_BCR] = { 0x25000 }, 3378 [GCC_BLSP2_QUP1_BCR] = { 0x26000 }, 3379 [GCC_BLSP2_UART1_BCR] = { 0x27000 }, 3380 [GCC_BLSP2_QUP2_BCR] = { 0x28000 }, 3381 [GCC_BLSP2_UART2_BCR] = { 0x29000 }, 3382 [GCC_BLSP2_QUP3_BCR] = { 0x2a000 }, 3383 [GCC_BLSP2_UART3_BCR] = { 0x2b000 }, 3384 [GCC_BLSP2_QUP4_BCR] = { 0x2c000 }, 3385 [GCC_BLSP2_UART4_BCR] = { 0x2d000 }, 3386 [GCC_BLSP2_QUP5_BCR] = { 0x2e000 }, 3387 [GCC_BLSP2_UART5_BCR] = { 0x2f000 }, 3388 [GCC_BLSP2_QUP6_BCR] = { 0x30000 }, 3389 [GCC_BLSP2_UART6_BCR] = { 0x31000 }, 3390 [GCC_PDM_BCR] = { 0x33000 }, 3391 [GCC_PRNG_BCR] = { 0x34000 }, 3392 [GCC_TSIF_BCR] = { 0x36000 }, 3393 [GCC_TCSR_BCR] = { 0x37000 }, 3394 [GCC_BOOT_ROM_BCR] = { 0x38000 }, 3395 [GCC_MSG_RAM_BCR] = { 0x39000 }, 3396 [GCC_TLMM_BCR] = { 0x3a000 }, 3397 [GCC_MPM_BCR] = { 0x3b000 }, 3398 [GCC_SEC_CTRL_BCR] = { 0x3d000 }, 3399 [GCC_SPMI_BCR] = { 0x3f000 }, 3400 [GCC_SPDM_BCR] = { 0x40000 }, 3401 [GCC_CE1_BCR] = { 0x41000 }, 3402 [GCC_BIMC_BCR] = { 0x44000 }, 3403 [GCC_SNOC_BUS_TIMEOUT0_BCR] = { 0x49000 }, 3404 [GCC_SNOC_BUS_TIMEOUT2_BCR] = { 0x49008 }, 3405 [GCC_SNOC_BUS_TIMEOUT1_BCR] = { 0x49010 }, 3406 [GCC_SNOC_BUS_TIMEOUT3_BCR] = { 0x49018 }, 3407 [GCC_SNOC_BUS_TIMEOUT_EXTREF_BCR] = { 0x49020 }, 3408 [GCC_PNOC_BUS_TIMEOUT0_BCR] = { 0x4a000 }, 3409 [GCC_PNOC_BUS_TIMEOUT1_BCR] = { 0x4a008 }, 3410 [GCC_PNOC_BUS_TIMEOUT2_BCR] = { 0x4a010 }, 3411 [GCC_PNOC_BUS_TIMEOUT3_BCR] = { 0x4a018 }, 3412 [GCC_PNOC_BUS_TIMEOUT4_BCR] = { 0x4a020 }, 3413 [GCC_CNOC_BUS_TIMEOUT0_BCR] = { 0x4b000 }, 3414 [GCC_CNOC_BUS_TIMEOUT1_BCR] = { 0x4b008 }, 3415 [GCC_CNOC_BUS_TIMEOUT2_BCR] = { 0x4b010 }, 3416 [GCC_CNOC_BUS_TIMEOUT3_BCR] = { 0x4b018 }, 3417 [GCC_CNOC_BUS_TIMEOUT4_BCR] = { 0x4b020 }, 3418 [GCC_CNOC_BUS_TIMEOUT5_BCR] = { 0x4b028 }, 3419 [GCC_CNOC_BUS_TIMEOUT6_BCR] = { 0x4b030 }, 3420 [GCC_CNOC_BUS_TIMEOUT7_BCR] = { 0x4b038 }, 3421 [GCC_CNOC_BUS_TIMEOUT8_BCR] = { 0x80000 }, 3422 [GCC_CNOC_BUS_TIMEOUT9_BCR] = { 0x80008 }, 3423 [GCC_CNOC_BUS_TIMEOUT_EXTREF_BCR] = { 0x80010 }, 3424 [GCC_APB2JTAG_BCR] = { 0x4c000 }, 3425 [GCC_RBCPR_CX_BCR] = { 0x4e000 }, 3426 [GCC_RBCPR_MX_BCR] = { 0x4f000 }, 3427 [GCC_PCIE_0_BCR] = { 0x6b000 }, 3428 [GCC_PCIE_0_PHY_BCR] = { 0x6c01c }, 3429 [GCC_PCIE_1_BCR] = { 0x6d000 }, 3430 [GCC_PCIE_1_PHY_BCR] = { 0x6d038 }, 3431 [GCC_PCIE_2_BCR] = { 0x6e000 }, 3432 [GCC_PCIE_2_PHY_BCR] = { 0x6e038 }, 3433 [GCC_PCIE_PHY_BCR] = { 0x6f000 }, 3434 [GCC_PCIE_PHY_COM_BCR] = { 0x6f014 }, 3435 [GCC_PCIE_PHY_COM_NOCSR_BCR] = { 0x6f00c }, 3436 [GCC_DCD_BCR] = { 0x70000 }, 3437 [GCC_OBT_ODT_BCR] = { 0x73000 }, 3438 [GCC_UFS_BCR] = { 0x75000 }, 3439 [GCC_SSC_BCR] = { 0x63000 }, 3440 [GCC_VS_BCR] = { 0x7a000 }, 3441 [GCC_AGGRE0_NOC_BCR] = { 0x81000 }, 3442 [GCC_AGGRE1_NOC_BCR] = { 0x82000 }, 3443 [GCC_AGGRE2_NOC_BCR] = { 0x83000 }, 3444 [GCC_DCC_BCR] = { 0x84000 }, 3445 [GCC_IPA_BCR] = { 0x89000 }, 3446 [GCC_QSPI_BCR] = { 0x8b000 }, 3447 [GCC_SKL_BCR] = { 0x8c000 }, 3448 [GCC_MSMPU_BCR] = { 0x8d000 }, 3449 [GCC_MSS_Q6_BCR] = { 0x8e000 }, 3450 [GCC_QREFS_VBG_CAL_BCR] = { 0x88020 }, 3451 [GCC_MSS_RESTART] = { 0x8f008 }, 3452 }; 3453 3454 static const struct regmap_config gcc_msm8996_regmap_config = { 3455 .reg_bits = 32, 3456 .reg_stride = 4, 3457 .val_bits = 32, 3458 .max_register = 0x8f010, 3459 .fast_io = true, 3460 }; 3461 3462 static const struct qcom_cc_desc gcc_msm8996_desc = { 3463 .config = &gcc_msm8996_regmap_config, 3464 .clks = gcc_msm8996_clocks, 3465 .num_clks = ARRAY_SIZE(gcc_msm8996_clocks), 3466 .resets = gcc_msm8996_resets, 3467 .num_resets = ARRAY_SIZE(gcc_msm8996_resets), 3468 .gdscs = gcc_msm8996_gdscs, 3469 .num_gdscs = ARRAY_SIZE(gcc_msm8996_gdscs), 3470 }; 3471 3472 static const struct of_device_id gcc_msm8996_match_table[] = { 3473 { .compatible = "qcom,gcc-msm8996" }, 3474 { } 3475 }; 3476 MODULE_DEVICE_TABLE(of, gcc_msm8996_match_table); 3477 3478 static int gcc_msm8996_probe(struct platform_device *pdev) 3479 { 3480 struct device *dev = &pdev->dev; 3481 int i, ret; 3482 struct regmap *regmap; 3483 3484 regmap = qcom_cc_map(pdev, &gcc_msm8996_desc); 3485 if (IS_ERR(regmap)) 3486 return PTR_ERR(regmap); 3487 3488 /* 3489 * Set the HMSS_AHB_CLK_SLEEP_ENA bit to allow the hmss_ahb_clk to be 3490 * turned off by hardware during certain apps low power modes. 3491 */ 3492 regmap_update_bits(regmap, 0x52008, BIT(21), BIT(21)); 3493 3494 for (i = 0; i < ARRAY_SIZE(gcc_msm8996_hws); i++) { 3495 ret = devm_clk_hw_register(dev, gcc_msm8996_hws[i]); 3496 if (ret) 3497 return ret; 3498 } 3499 3500 return qcom_cc_really_probe(pdev, &gcc_msm8996_desc, regmap); 3501 } 3502 3503 static struct platform_driver gcc_msm8996_driver = { 3504 .probe = gcc_msm8996_probe, 3505 .driver = { 3506 .name = "gcc-msm8996", 3507 .of_match_table = gcc_msm8996_match_table, 3508 }, 3509 }; 3510 3511 static int __init gcc_msm8996_init(void) 3512 { 3513 return platform_driver_register(&gcc_msm8996_driver); 3514 } 3515 core_initcall(gcc_msm8996_init); 3516 3517 static void __exit gcc_msm8996_exit(void) 3518 { 3519 platform_driver_unregister(&gcc_msm8996_driver); 3520 } 3521 module_exit(gcc_msm8996_exit); 3522 3523 MODULE_DESCRIPTION("QCOM GCC MSM8996 Driver"); 3524 MODULE_LICENSE("GPL v2"); 3525 MODULE_ALIAS("platform:gcc-msm8996"); 3526