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_hlos1_vote_lpass_core_smmu_clk = { 2734 .halt_reg = 0x7d010, 2735 .halt_check = BRANCH_HALT_VOTED, 2736 .clkr = { 2737 .enable_reg = 0x7d010, 2738 .enable_mask = BIT(0), 2739 .hw.init = &(struct clk_init_data){ 2740 .name = "hlos1_vote_lpass_core_smmu_clk", 2741 .ops = &clk_branch2_ops, 2742 }, 2743 }, 2744 }; 2745 2746 static struct clk_branch gcc_hlos1_vote_lpass_adsp_smmu_clk = { 2747 .halt_reg = 0x7d014, 2748 .halt_check = BRANCH_HALT_VOTED, 2749 .clkr = { 2750 .enable_reg = 0x7d014, 2751 .enable_mask = BIT(0), 2752 .hw.init = &(struct clk_init_data){ 2753 .name = "hlos1_vote_lpass_adsp_smmu_clk", 2754 .ops = &clk_branch2_ops, 2755 }, 2756 }, 2757 }; 2758 2759 static struct clk_branch gcc_ufs_rx_cfg_clk = { 2760 .halt_reg = 0x75014, 2761 .clkr = { 2762 .enable_reg = 0x75014, 2763 .enable_mask = BIT(0), 2764 .hw.init = &(struct clk_init_data){ 2765 .name = "gcc_ufs_rx_cfg_clk", 2766 .parent_names = (const char *[]){ "ufs_rx_cfg_clk_src" }, 2767 .num_parents = 1, 2768 .flags = CLK_SET_RATE_PARENT, 2769 .ops = &clk_branch2_ops, 2770 }, 2771 }, 2772 }; 2773 2774 static struct clk_branch gcc_ufs_tx_symbol_0_clk = { 2775 .halt_reg = 0x75018, 2776 .clkr = { 2777 .enable_reg = 0x75018, 2778 .enable_mask = BIT(0), 2779 .hw.init = &(struct clk_init_data){ 2780 .name = "gcc_ufs_tx_symbol_0_clk", 2781 .parent_names = (const char *[]){ "ufs_tx_symbol_0_clk_src" }, 2782 .num_parents = 1, 2783 .flags = CLK_SET_RATE_PARENT, 2784 .ops = &clk_branch2_ops, 2785 }, 2786 }, 2787 }; 2788 2789 static struct clk_branch gcc_ufs_rx_symbol_0_clk = { 2790 .halt_reg = 0x7501c, 2791 .clkr = { 2792 .enable_reg = 0x7501c, 2793 .enable_mask = BIT(0), 2794 .hw.init = &(struct clk_init_data){ 2795 .name = "gcc_ufs_rx_symbol_0_clk", 2796 .parent_names = (const char *[]){ "ufs_rx_symbol_0_clk_src" }, 2797 .num_parents = 1, 2798 .flags = CLK_SET_RATE_PARENT, 2799 .ops = &clk_branch2_ops, 2800 }, 2801 }, 2802 }; 2803 2804 static struct clk_branch gcc_ufs_rx_symbol_1_clk = { 2805 .halt_reg = 0x75020, 2806 .clkr = { 2807 .enable_reg = 0x75020, 2808 .enable_mask = BIT(0), 2809 .hw.init = &(struct clk_init_data){ 2810 .name = "gcc_ufs_rx_symbol_1_clk", 2811 .parent_names = (const char *[]){ "ufs_rx_symbol_1_clk_src" }, 2812 .num_parents = 1, 2813 .flags = CLK_SET_RATE_PARENT, 2814 .ops = &clk_branch2_ops, 2815 }, 2816 }, 2817 }; 2818 2819 static struct clk_fixed_factor ufs_ice_core_postdiv_clk_src = { 2820 .mult = 1, 2821 .div = 2, 2822 .hw.init = &(struct clk_init_data){ 2823 .name = "ufs_ice_core_postdiv_clk_src", 2824 .parent_names = (const char *[]){ "ufs_ice_core_clk_src" }, 2825 .num_parents = 1, 2826 .flags = CLK_SET_RATE_PARENT, 2827 .ops = &clk_fixed_factor_ops, 2828 }, 2829 }; 2830 2831 static struct clk_branch gcc_ufs_unipro_core_clk = { 2832 .halt_reg = 0x7600c, 2833 .clkr = { 2834 .enable_reg = 0x7600c, 2835 .enable_mask = BIT(0), 2836 .hw.init = &(struct clk_init_data){ 2837 .name = "gcc_ufs_unipro_core_clk", 2838 .parent_names = (const char *[]){ "ufs_ice_core_postdiv_clk_src" }, 2839 .num_parents = 1, 2840 .flags = CLK_SET_RATE_PARENT, 2841 .ops = &clk_branch2_ops, 2842 }, 2843 }, 2844 }; 2845 2846 static struct clk_branch gcc_ufs_ice_core_clk = { 2847 .halt_reg = 0x76010, 2848 .clkr = { 2849 .enable_reg = 0x76010, 2850 .enable_mask = BIT(0), 2851 .hw.init = &(struct clk_init_data){ 2852 .name = "gcc_ufs_ice_core_clk", 2853 .parent_names = (const char *[]){ "ufs_ice_core_clk_src" }, 2854 .num_parents = 1, 2855 .flags = CLK_SET_RATE_PARENT, 2856 .ops = &clk_branch2_ops, 2857 }, 2858 }, 2859 }; 2860 2861 static struct clk_branch gcc_ufs_sys_clk_core_clk = { 2862 .halt_check = BRANCH_HALT_DELAY, 2863 .clkr = { 2864 .enable_reg = 0x76030, 2865 .enable_mask = BIT(0), 2866 .hw.init = &(struct clk_init_data){ 2867 .name = "gcc_ufs_sys_clk_core_clk", 2868 .ops = &clk_branch2_ops, 2869 }, 2870 }, 2871 }; 2872 2873 static struct clk_branch gcc_ufs_tx_symbol_clk_core_clk = { 2874 .halt_check = BRANCH_HALT_DELAY, 2875 .clkr = { 2876 .enable_reg = 0x76034, 2877 .enable_mask = BIT(0), 2878 .hw.init = &(struct clk_init_data){ 2879 .name = "gcc_ufs_tx_symbol_clk_core_clk", 2880 .ops = &clk_branch2_ops, 2881 }, 2882 }, 2883 }; 2884 2885 static struct clk_branch gcc_aggre0_snoc_axi_clk = { 2886 .halt_reg = 0x81008, 2887 .clkr = { 2888 .enable_reg = 0x81008, 2889 .enable_mask = BIT(0), 2890 .hw.init = &(struct clk_init_data){ 2891 .name = "gcc_aggre0_snoc_axi_clk", 2892 .parent_names = (const char *[]){ "system_noc_clk_src" }, 2893 .num_parents = 1, 2894 .flags = CLK_SET_RATE_PARENT, 2895 .ops = &clk_branch2_ops, 2896 }, 2897 }, 2898 }; 2899 2900 static struct clk_branch gcc_aggre0_cnoc_ahb_clk = { 2901 .halt_reg = 0x8100c, 2902 .clkr = { 2903 .enable_reg = 0x8100c, 2904 .enable_mask = BIT(0), 2905 .hw.init = &(struct clk_init_data){ 2906 .name = "gcc_aggre0_cnoc_ahb_clk", 2907 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2908 .num_parents = 1, 2909 .flags = CLK_SET_RATE_PARENT, 2910 .ops = &clk_branch2_ops, 2911 }, 2912 }, 2913 }; 2914 2915 static struct clk_branch gcc_smmu_aggre0_axi_clk = { 2916 .halt_reg = 0x81014, 2917 .clkr = { 2918 .enable_reg = 0x81014, 2919 .enable_mask = BIT(0), 2920 .hw.init = &(struct clk_init_data){ 2921 .name = "gcc_smmu_aggre0_axi_clk", 2922 .parent_names = (const char *[]){ "system_noc_clk_src" }, 2923 .num_parents = 1, 2924 .flags = CLK_SET_RATE_PARENT, 2925 .ops = &clk_branch2_ops, 2926 }, 2927 }, 2928 }; 2929 2930 static struct clk_branch gcc_smmu_aggre0_ahb_clk = { 2931 .halt_reg = 0x81018, 2932 .clkr = { 2933 .enable_reg = 0x81018, 2934 .enable_mask = BIT(0), 2935 .hw.init = &(struct clk_init_data){ 2936 .name = "gcc_smmu_aggre0_ahb_clk", 2937 .parent_names = (const char *[]){ "config_noc_clk_src" }, 2938 .num_parents = 1, 2939 .flags = CLK_SET_RATE_PARENT, 2940 .ops = &clk_branch2_ops, 2941 }, 2942 }, 2943 }; 2944 2945 static struct clk_branch gcc_aggre2_ufs_axi_clk = { 2946 .halt_reg = 0x83014, 2947 .clkr = { 2948 .enable_reg = 0x83014, 2949 .enable_mask = BIT(0), 2950 .hw.init = &(struct clk_init_data){ 2951 .name = "gcc_aggre2_ufs_axi_clk", 2952 .parent_names = (const char *[]){ "ufs_axi_clk_src" }, 2953 .num_parents = 1, 2954 .flags = CLK_SET_RATE_PARENT, 2955 .ops = &clk_branch2_ops, 2956 }, 2957 }, 2958 }; 2959 2960 static struct clk_branch gcc_aggre2_usb3_axi_clk = { 2961 .halt_reg = 0x83018, 2962 .clkr = { 2963 .enable_reg = 0x83018, 2964 .enable_mask = BIT(0), 2965 .hw.init = &(struct clk_init_data){ 2966 .name = "gcc_aggre2_usb3_axi_clk", 2967 .parent_names = (const char *[]){ "usb30_master_clk_src" }, 2968 .num_parents = 1, 2969 .flags = CLK_SET_RATE_PARENT, 2970 .ops = &clk_branch2_ops, 2971 }, 2972 }, 2973 }; 2974 2975 static struct clk_branch gcc_qspi_ahb_clk = { 2976 .halt_reg = 0x8b004, 2977 .clkr = { 2978 .enable_reg = 0x8b004, 2979 .enable_mask = BIT(0), 2980 .hw.init = &(struct clk_init_data){ 2981 .name = "gcc_qspi_ahb_clk", 2982 .parent_names = (const char *[]){ "periph_noc_clk_src" }, 2983 .num_parents = 1, 2984 .flags = CLK_SET_RATE_PARENT, 2985 .ops = &clk_branch2_ops, 2986 }, 2987 }, 2988 }; 2989 2990 static struct clk_branch gcc_qspi_ser_clk = { 2991 .halt_reg = 0x8b008, 2992 .clkr = { 2993 .enable_reg = 0x8b008, 2994 .enable_mask = BIT(0), 2995 .hw.init = &(struct clk_init_data){ 2996 .name = "gcc_qspi_ser_clk", 2997 .parent_names = (const char *[]){ "qspi_ser_clk_src" }, 2998 .num_parents = 1, 2999 .flags = CLK_SET_RATE_PARENT, 3000 .ops = &clk_branch2_ops, 3001 }, 3002 }, 3003 }; 3004 3005 static struct clk_branch gcc_usb3_clkref_clk = { 3006 .halt_reg = 0x8800C, 3007 .clkr = { 3008 .enable_reg = 0x8800C, 3009 .enable_mask = BIT(0), 3010 .hw.init = &(struct clk_init_data){ 3011 .name = "gcc_usb3_clkref_clk", 3012 .parent_names = (const char *[]){ "xo" }, 3013 .num_parents = 1, 3014 .ops = &clk_branch2_ops, 3015 }, 3016 }, 3017 }; 3018 3019 static struct clk_branch gcc_hdmi_clkref_clk = { 3020 .halt_reg = 0x88000, 3021 .clkr = { 3022 .enable_reg = 0x88000, 3023 .enable_mask = BIT(0), 3024 .hw.init = &(struct clk_init_data){ 3025 .name = "gcc_hdmi_clkref_clk", 3026 .parent_names = (const char *[]){ "xo" }, 3027 .num_parents = 1, 3028 .ops = &clk_branch2_ops, 3029 }, 3030 }, 3031 }; 3032 3033 static struct clk_branch gcc_ufs_clkref_clk = { 3034 .halt_reg = 0x88008, 3035 .clkr = { 3036 .enable_reg = 0x88008, 3037 .enable_mask = BIT(0), 3038 .hw.init = &(struct clk_init_data){ 3039 .name = "gcc_ufs_clkref_clk", 3040 .parent_names = (const char *[]){ "xo" }, 3041 .num_parents = 1, 3042 .ops = &clk_branch2_ops, 3043 }, 3044 }, 3045 }; 3046 3047 static struct clk_branch gcc_pcie_clkref_clk = { 3048 .halt_reg = 0x88010, 3049 .clkr = { 3050 .enable_reg = 0x88010, 3051 .enable_mask = BIT(0), 3052 .hw.init = &(struct clk_init_data){ 3053 .name = "gcc_pcie_clkref_clk", 3054 .parent_names = (const char *[]){ "xo" }, 3055 .num_parents = 1, 3056 .ops = &clk_branch2_ops, 3057 }, 3058 }, 3059 }; 3060 3061 static struct clk_branch gcc_rx2_usb2_clkref_clk = { 3062 .halt_reg = 0x88014, 3063 .clkr = { 3064 .enable_reg = 0x88014, 3065 .enable_mask = BIT(0), 3066 .hw.init = &(struct clk_init_data){ 3067 .name = "gcc_rx2_usb2_clkref_clk", 3068 .parent_names = (const char *[]){ "xo" }, 3069 .num_parents = 1, 3070 .ops = &clk_branch2_ops, 3071 }, 3072 }, 3073 }; 3074 3075 static struct clk_branch gcc_rx1_usb2_clkref_clk = { 3076 .halt_reg = 0x88018, 3077 .clkr = { 3078 .enable_reg = 0x88018, 3079 .enable_mask = BIT(0), 3080 .hw.init = &(struct clk_init_data){ 3081 .name = "gcc_rx1_usb2_clkref_clk", 3082 .parent_names = (const char *[]){ "xo" }, 3083 .num_parents = 1, 3084 .ops = &clk_branch2_ops, 3085 }, 3086 }, 3087 }; 3088 3089 static struct clk_hw *gcc_msm8996_hws[] = { 3090 &xo.hw, 3091 &gpll0_early_div.hw, 3092 &ufs_tx_cfg_clk_src.hw, 3093 &ufs_rx_cfg_clk_src.hw, 3094 &ufs_ice_core_postdiv_clk_src.hw, 3095 }; 3096 3097 static struct gdsc aggre0_noc_gdsc = { 3098 .gdscr = 0x81004, 3099 .gds_hw_ctrl = 0x81028, 3100 .pd = { 3101 .name = "aggre0_noc", 3102 }, 3103 .pwrsts = PWRSTS_OFF_ON, 3104 .flags = VOTABLE, 3105 }; 3106 3107 static struct gdsc hlos1_vote_aggre0_noc_gdsc = { 3108 .gdscr = 0x7d024, 3109 .pd = { 3110 .name = "hlos1_vote_aggre0_noc", 3111 }, 3112 .pwrsts = PWRSTS_OFF_ON, 3113 .flags = VOTABLE, 3114 }; 3115 3116 static struct gdsc hlos1_vote_lpass_adsp_gdsc = { 3117 .gdscr = 0x7d034, 3118 .pd = { 3119 .name = "hlos1_vote_lpass_adsp", 3120 }, 3121 .pwrsts = PWRSTS_OFF_ON, 3122 .flags = VOTABLE, 3123 }; 3124 3125 static struct gdsc hlos1_vote_lpass_core_gdsc = { 3126 .gdscr = 0x7d038, 3127 .pd = { 3128 .name = "hlos1_vote_lpass_core", 3129 }, 3130 .pwrsts = PWRSTS_OFF_ON, 3131 .flags = VOTABLE, 3132 }; 3133 3134 static struct gdsc usb30_gdsc = { 3135 .gdscr = 0xf004, 3136 .pd = { 3137 .name = "usb30", 3138 }, 3139 .pwrsts = PWRSTS_OFF_ON, 3140 }; 3141 3142 static struct gdsc pcie0_gdsc = { 3143 .gdscr = 0x6b004, 3144 .pd = { 3145 .name = "pcie0", 3146 }, 3147 .pwrsts = PWRSTS_OFF_ON, 3148 }; 3149 3150 static struct gdsc pcie1_gdsc = { 3151 .gdscr = 0x6d004, 3152 .pd = { 3153 .name = "pcie1", 3154 }, 3155 .pwrsts = PWRSTS_OFF_ON, 3156 }; 3157 3158 static struct gdsc pcie2_gdsc = { 3159 .gdscr = 0x6e004, 3160 .pd = { 3161 .name = "pcie2", 3162 }, 3163 .pwrsts = PWRSTS_OFF_ON, 3164 }; 3165 3166 static struct gdsc ufs_gdsc = { 3167 .gdscr = 0x75004, 3168 .pd = { 3169 .name = "ufs", 3170 }, 3171 .pwrsts = PWRSTS_OFF_ON, 3172 }; 3173 3174 static struct clk_regmap *gcc_msm8996_clocks[] = { 3175 [GPLL0_EARLY] = &gpll0_early.clkr, 3176 [GPLL0] = &gpll0.clkr, 3177 [GPLL4_EARLY] = &gpll4_early.clkr, 3178 [GPLL4] = &gpll4.clkr, 3179 [SYSTEM_NOC_CLK_SRC] = &system_noc_clk_src.clkr, 3180 [CONFIG_NOC_CLK_SRC] = &config_noc_clk_src.clkr, 3181 [PERIPH_NOC_CLK_SRC] = &periph_noc_clk_src.clkr, 3182 [USB30_MASTER_CLK_SRC] = &usb30_master_clk_src.clkr, 3183 [USB30_MOCK_UTMI_CLK_SRC] = &usb30_mock_utmi_clk_src.clkr, 3184 [USB3_PHY_AUX_CLK_SRC] = &usb3_phy_aux_clk_src.clkr, 3185 [USB20_MASTER_CLK_SRC] = &usb20_master_clk_src.clkr, 3186 [USB20_MOCK_UTMI_CLK_SRC] = &usb20_mock_utmi_clk_src.clkr, 3187 [SDCC1_APPS_CLK_SRC] = &sdcc1_apps_clk_src.clkr, 3188 [SDCC1_ICE_CORE_CLK_SRC] = &sdcc1_ice_core_clk_src.clkr, 3189 [SDCC2_APPS_CLK_SRC] = &sdcc2_apps_clk_src.clkr, 3190 [SDCC3_APPS_CLK_SRC] = &sdcc3_apps_clk_src.clkr, 3191 [SDCC4_APPS_CLK_SRC] = &sdcc4_apps_clk_src.clkr, 3192 [BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr, 3193 [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr, 3194 [BLSP1_UART1_APPS_CLK_SRC] = &blsp1_uart1_apps_clk_src.clkr, 3195 [BLSP1_QUP2_SPI_APPS_CLK_SRC] = &blsp1_qup2_spi_apps_clk_src.clkr, 3196 [BLSP1_QUP2_I2C_APPS_CLK_SRC] = &blsp1_qup2_i2c_apps_clk_src.clkr, 3197 [BLSP1_UART2_APPS_CLK_SRC] = &blsp1_uart2_apps_clk_src.clkr, 3198 [BLSP1_QUP3_SPI_APPS_CLK_SRC] = &blsp1_qup3_spi_apps_clk_src.clkr, 3199 [BLSP1_QUP3_I2C_APPS_CLK_SRC] = &blsp1_qup3_i2c_apps_clk_src.clkr, 3200 [BLSP1_UART3_APPS_CLK_SRC] = &blsp1_uart3_apps_clk_src.clkr, 3201 [BLSP1_QUP4_SPI_APPS_CLK_SRC] = &blsp1_qup4_spi_apps_clk_src.clkr, 3202 [BLSP1_QUP4_I2C_APPS_CLK_SRC] = &blsp1_qup4_i2c_apps_clk_src.clkr, 3203 [BLSP1_UART4_APPS_CLK_SRC] = &blsp1_uart4_apps_clk_src.clkr, 3204 [BLSP1_QUP5_SPI_APPS_CLK_SRC] = &blsp1_qup5_spi_apps_clk_src.clkr, 3205 [BLSP1_QUP5_I2C_APPS_CLK_SRC] = &blsp1_qup5_i2c_apps_clk_src.clkr, 3206 [BLSP1_UART5_APPS_CLK_SRC] = &blsp1_uart5_apps_clk_src.clkr, 3207 [BLSP1_QUP6_SPI_APPS_CLK_SRC] = &blsp1_qup6_spi_apps_clk_src.clkr, 3208 [BLSP1_QUP6_I2C_APPS_CLK_SRC] = &blsp1_qup6_i2c_apps_clk_src.clkr, 3209 [BLSP1_UART6_APPS_CLK_SRC] = &blsp1_uart6_apps_clk_src.clkr, 3210 [BLSP2_QUP1_SPI_APPS_CLK_SRC] = &blsp2_qup1_spi_apps_clk_src.clkr, 3211 [BLSP2_QUP1_I2C_APPS_CLK_SRC] = &blsp2_qup1_i2c_apps_clk_src.clkr, 3212 [BLSP2_UART1_APPS_CLK_SRC] = &blsp2_uart1_apps_clk_src.clkr, 3213 [BLSP2_QUP2_SPI_APPS_CLK_SRC] = &blsp2_qup2_spi_apps_clk_src.clkr, 3214 [BLSP2_QUP2_I2C_APPS_CLK_SRC] = &blsp2_qup2_i2c_apps_clk_src.clkr, 3215 [BLSP2_UART2_APPS_CLK_SRC] = &blsp2_uart2_apps_clk_src.clkr, 3216 [BLSP2_QUP3_SPI_APPS_CLK_SRC] = &blsp2_qup3_spi_apps_clk_src.clkr, 3217 [BLSP2_QUP3_I2C_APPS_CLK_SRC] = &blsp2_qup3_i2c_apps_clk_src.clkr, 3218 [BLSP2_UART3_APPS_CLK_SRC] = &blsp2_uart3_apps_clk_src.clkr, 3219 [BLSP2_QUP4_SPI_APPS_CLK_SRC] = &blsp2_qup4_spi_apps_clk_src.clkr, 3220 [BLSP2_QUP4_I2C_APPS_CLK_SRC] = &blsp2_qup4_i2c_apps_clk_src.clkr, 3221 [BLSP2_UART4_APPS_CLK_SRC] = &blsp2_uart4_apps_clk_src.clkr, 3222 [BLSP2_QUP5_SPI_APPS_CLK_SRC] = &blsp2_qup5_spi_apps_clk_src.clkr, 3223 [BLSP2_QUP5_I2C_APPS_CLK_SRC] = &blsp2_qup5_i2c_apps_clk_src.clkr, 3224 [BLSP2_UART5_APPS_CLK_SRC] = &blsp2_uart5_apps_clk_src.clkr, 3225 [BLSP2_QUP6_SPI_APPS_CLK_SRC] = &blsp2_qup6_spi_apps_clk_src.clkr, 3226 [BLSP2_QUP6_I2C_APPS_CLK_SRC] = &blsp2_qup6_i2c_apps_clk_src.clkr, 3227 [BLSP2_UART6_APPS_CLK_SRC] = &blsp2_uart6_apps_clk_src.clkr, 3228 [PDM2_CLK_SRC] = &pdm2_clk_src.clkr, 3229 [TSIF_REF_CLK_SRC] = &tsif_ref_clk_src.clkr, 3230 [GCC_SLEEP_CLK_SRC] = &gcc_sleep_clk_src.clkr, 3231 [HMSS_RBCPR_CLK_SRC] = &hmss_rbcpr_clk_src.clkr, 3232 [HMSS_GPLL0_CLK_SRC] = &hmss_gpll0_clk_src.clkr, 3233 [GP1_CLK_SRC] = &gp1_clk_src.clkr, 3234 [GP2_CLK_SRC] = &gp2_clk_src.clkr, 3235 [GP3_CLK_SRC] = &gp3_clk_src.clkr, 3236 [PCIE_AUX_CLK_SRC] = &pcie_aux_clk_src.clkr, 3237 [UFS_AXI_CLK_SRC] = &ufs_axi_clk_src.clkr, 3238 [UFS_ICE_CORE_CLK_SRC] = &ufs_ice_core_clk_src.clkr, 3239 [QSPI_SER_CLK_SRC] = &qspi_ser_clk_src.clkr, 3240 [GCC_SYS_NOC_USB3_AXI_CLK] = &gcc_sys_noc_usb3_axi_clk.clkr, 3241 [GCC_SYS_NOC_UFS_AXI_CLK] = &gcc_sys_noc_ufs_axi_clk.clkr, 3242 [GCC_PERIPH_NOC_USB20_AHB_CLK] = &gcc_periph_noc_usb20_ahb_clk.clkr, 3243 [GCC_MMSS_NOC_CFG_AHB_CLK] = &gcc_mmss_noc_cfg_ahb_clk.clkr, 3244 [GCC_MMSS_BIMC_GFX_CLK] = &gcc_mmss_bimc_gfx_clk.clkr, 3245 [GCC_USB30_MASTER_CLK] = &gcc_usb30_master_clk.clkr, 3246 [GCC_USB30_SLEEP_CLK] = &gcc_usb30_sleep_clk.clkr, 3247 [GCC_USB30_MOCK_UTMI_CLK] = &gcc_usb30_mock_utmi_clk.clkr, 3248 [GCC_USB3_PHY_AUX_CLK] = &gcc_usb3_phy_aux_clk.clkr, 3249 [GCC_USB3_PHY_PIPE_CLK] = &gcc_usb3_phy_pipe_clk.clkr, 3250 [GCC_USB20_MASTER_CLK] = &gcc_usb20_master_clk.clkr, 3251 [GCC_USB20_SLEEP_CLK] = &gcc_usb20_sleep_clk.clkr, 3252 [GCC_USB20_MOCK_UTMI_CLK] = &gcc_usb20_mock_utmi_clk.clkr, 3253 [GCC_USB_PHY_CFG_AHB2PHY_CLK] = &gcc_usb_phy_cfg_ahb2phy_clk.clkr, 3254 [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr, 3255 [GCC_SDCC1_AHB_CLK] = &gcc_sdcc1_ahb_clk.clkr, 3256 [GCC_SDCC1_ICE_CORE_CLK] = &gcc_sdcc1_ice_core_clk.clkr, 3257 [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr, 3258 [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr, 3259 [GCC_SDCC3_APPS_CLK] = &gcc_sdcc3_apps_clk.clkr, 3260 [GCC_SDCC3_AHB_CLK] = &gcc_sdcc3_ahb_clk.clkr, 3261 [GCC_SDCC4_APPS_CLK] = &gcc_sdcc4_apps_clk.clkr, 3262 [GCC_SDCC4_AHB_CLK] = &gcc_sdcc4_ahb_clk.clkr, 3263 [GCC_BLSP1_AHB_CLK] = &gcc_blsp1_ahb_clk.clkr, 3264 [GCC_BLSP1_SLEEP_CLK] = &gcc_blsp1_sleep_clk.clkr, 3265 [GCC_BLSP1_QUP1_SPI_APPS_CLK] = &gcc_blsp1_qup1_spi_apps_clk.clkr, 3266 [GCC_BLSP1_QUP1_I2C_APPS_CLK] = &gcc_blsp1_qup1_i2c_apps_clk.clkr, 3267 [GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr, 3268 [GCC_BLSP1_QUP2_SPI_APPS_CLK] = &gcc_blsp1_qup2_spi_apps_clk.clkr, 3269 [GCC_BLSP1_QUP2_I2C_APPS_CLK] = &gcc_blsp1_qup2_i2c_apps_clk.clkr, 3270 [GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr, 3271 [GCC_BLSP1_QUP3_SPI_APPS_CLK] = &gcc_blsp1_qup3_spi_apps_clk.clkr, 3272 [GCC_BLSP1_QUP3_I2C_APPS_CLK] = &gcc_blsp1_qup3_i2c_apps_clk.clkr, 3273 [GCC_BLSP1_UART3_APPS_CLK] = &gcc_blsp1_uart3_apps_clk.clkr, 3274 [GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr, 3275 [GCC_BLSP1_QUP4_I2C_APPS_CLK] = &gcc_blsp1_qup4_i2c_apps_clk.clkr, 3276 [GCC_BLSP1_UART4_APPS_CLK] = &gcc_blsp1_uart4_apps_clk.clkr, 3277 [GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr, 3278 [GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr, 3279 [GCC_BLSP1_UART5_APPS_CLK] = &gcc_blsp1_uart5_apps_clk.clkr, 3280 [GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr, 3281 [GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr, 3282 [GCC_BLSP1_UART6_APPS_CLK] = &gcc_blsp1_uart6_apps_clk.clkr, 3283 [GCC_BLSP2_AHB_CLK] = &gcc_blsp2_ahb_clk.clkr, 3284 [GCC_BLSP2_SLEEP_CLK] = &gcc_blsp2_sleep_clk.clkr, 3285 [GCC_BLSP2_QUP1_SPI_APPS_CLK] = &gcc_blsp2_qup1_spi_apps_clk.clkr, 3286 [GCC_BLSP2_QUP1_I2C_APPS_CLK] = &gcc_blsp2_qup1_i2c_apps_clk.clkr, 3287 [GCC_BLSP2_UART1_APPS_CLK] = &gcc_blsp2_uart1_apps_clk.clkr, 3288 [GCC_BLSP2_QUP2_SPI_APPS_CLK] = &gcc_blsp2_qup2_spi_apps_clk.clkr, 3289 [GCC_BLSP2_QUP2_I2C_APPS_CLK] = &gcc_blsp2_qup2_i2c_apps_clk.clkr, 3290 [GCC_BLSP2_UART2_APPS_CLK] = &gcc_blsp2_uart2_apps_clk.clkr, 3291 [GCC_BLSP2_QUP3_SPI_APPS_CLK] = &gcc_blsp2_qup3_spi_apps_clk.clkr, 3292 [GCC_BLSP2_QUP3_I2C_APPS_CLK] = &gcc_blsp2_qup3_i2c_apps_clk.clkr, 3293 [GCC_BLSP2_UART3_APPS_CLK] = &gcc_blsp2_uart3_apps_clk.clkr, 3294 [GCC_BLSP2_QUP4_SPI_APPS_CLK] = &gcc_blsp2_qup4_spi_apps_clk.clkr, 3295 [GCC_BLSP2_QUP4_I2C_APPS_CLK] = &gcc_blsp2_qup4_i2c_apps_clk.clkr, 3296 [GCC_BLSP2_UART4_APPS_CLK] = &gcc_blsp2_uart4_apps_clk.clkr, 3297 [GCC_BLSP2_QUP5_SPI_APPS_CLK] = &gcc_blsp2_qup5_spi_apps_clk.clkr, 3298 [GCC_BLSP2_QUP5_I2C_APPS_CLK] = &gcc_blsp2_qup5_i2c_apps_clk.clkr, 3299 [GCC_BLSP2_UART5_APPS_CLK] = &gcc_blsp2_uart5_apps_clk.clkr, 3300 [GCC_BLSP2_QUP6_SPI_APPS_CLK] = &gcc_blsp2_qup6_spi_apps_clk.clkr, 3301 [GCC_BLSP2_QUP6_I2C_APPS_CLK] = &gcc_blsp2_qup6_i2c_apps_clk.clkr, 3302 [GCC_BLSP2_UART6_APPS_CLK] = &gcc_blsp2_uart6_apps_clk.clkr, 3303 [GCC_PDM_AHB_CLK] = &gcc_pdm_ahb_clk.clkr, 3304 [GCC_PDM2_CLK] = &gcc_pdm2_clk.clkr, 3305 [GCC_PRNG_AHB_CLK] = &gcc_prng_ahb_clk.clkr, 3306 [GCC_TSIF_AHB_CLK] = &gcc_tsif_ahb_clk.clkr, 3307 [GCC_TSIF_REF_CLK] = &gcc_tsif_ref_clk.clkr, 3308 [GCC_TSIF_INACTIVITY_TIMERS_CLK] = &gcc_tsif_inactivity_timers_clk.clkr, 3309 [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr, 3310 [GCC_BIMC_GFX_CLK] = &gcc_bimc_gfx_clk.clkr, 3311 [GCC_HMSS_RBCPR_CLK] = &gcc_hmss_rbcpr_clk.clkr, 3312 [GCC_GP1_CLK] = &gcc_gp1_clk.clkr, 3313 [GCC_GP2_CLK] = &gcc_gp2_clk.clkr, 3314 [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, 3315 [GCC_PCIE_0_SLV_AXI_CLK] = &gcc_pcie_0_slv_axi_clk.clkr, 3316 [GCC_PCIE_0_MSTR_AXI_CLK] = &gcc_pcie_0_mstr_axi_clk.clkr, 3317 [GCC_PCIE_0_CFG_AHB_CLK] = &gcc_pcie_0_cfg_ahb_clk.clkr, 3318 [GCC_PCIE_0_AUX_CLK] = &gcc_pcie_0_aux_clk.clkr, 3319 [GCC_PCIE_0_PIPE_CLK] = &gcc_pcie_0_pipe_clk.clkr, 3320 [GCC_PCIE_1_SLV_AXI_CLK] = &gcc_pcie_1_slv_axi_clk.clkr, 3321 [GCC_PCIE_1_MSTR_AXI_CLK] = &gcc_pcie_1_mstr_axi_clk.clkr, 3322 [GCC_PCIE_1_CFG_AHB_CLK] = &gcc_pcie_1_cfg_ahb_clk.clkr, 3323 [GCC_PCIE_1_AUX_CLK] = &gcc_pcie_1_aux_clk.clkr, 3324 [GCC_PCIE_1_PIPE_CLK] = &gcc_pcie_1_pipe_clk.clkr, 3325 [GCC_PCIE_2_SLV_AXI_CLK] = &gcc_pcie_2_slv_axi_clk.clkr, 3326 [GCC_PCIE_2_MSTR_AXI_CLK] = &gcc_pcie_2_mstr_axi_clk.clkr, 3327 [GCC_PCIE_2_CFG_AHB_CLK] = &gcc_pcie_2_cfg_ahb_clk.clkr, 3328 [GCC_PCIE_2_AUX_CLK] = &gcc_pcie_2_aux_clk.clkr, 3329 [GCC_PCIE_2_PIPE_CLK] = &gcc_pcie_2_pipe_clk.clkr, 3330 [GCC_PCIE_PHY_CFG_AHB_CLK] = &gcc_pcie_phy_cfg_ahb_clk.clkr, 3331 [GCC_PCIE_PHY_AUX_CLK] = &gcc_pcie_phy_aux_clk.clkr, 3332 [GCC_UFS_AXI_CLK] = &gcc_ufs_axi_clk.clkr, 3333 [GCC_UFS_AHB_CLK] = &gcc_ufs_ahb_clk.clkr, 3334 [GCC_UFS_TX_CFG_CLK] = &gcc_ufs_tx_cfg_clk.clkr, 3335 [GCC_UFS_RX_CFG_CLK] = &gcc_ufs_rx_cfg_clk.clkr, 3336 [GCC_HLOS1_VOTE_LPASS_CORE_SMMU_CLK] = &gcc_hlos1_vote_lpass_core_smmu_clk.clkr, 3337 [GCC_HLOS1_VOTE_LPASS_ADSP_SMMU_CLK] = &gcc_hlos1_vote_lpass_adsp_smmu_clk.clkr, 3338 [GCC_UFS_TX_SYMBOL_0_CLK] = &gcc_ufs_tx_symbol_0_clk.clkr, 3339 [GCC_UFS_RX_SYMBOL_0_CLK] = &gcc_ufs_rx_symbol_0_clk.clkr, 3340 [GCC_UFS_RX_SYMBOL_1_CLK] = &gcc_ufs_rx_symbol_1_clk.clkr, 3341 [GCC_UFS_UNIPRO_CORE_CLK] = &gcc_ufs_unipro_core_clk.clkr, 3342 [GCC_UFS_ICE_CORE_CLK] = &gcc_ufs_ice_core_clk.clkr, 3343 [GCC_UFS_SYS_CLK_CORE_CLK] = &gcc_ufs_sys_clk_core_clk.clkr, 3344 [GCC_UFS_TX_SYMBOL_CLK_CORE_CLK] = &gcc_ufs_tx_symbol_clk_core_clk.clkr, 3345 [GCC_AGGRE0_SNOC_AXI_CLK] = &gcc_aggre0_snoc_axi_clk.clkr, 3346 [GCC_AGGRE0_CNOC_AHB_CLK] = &gcc_aggre0_cnoc_ahb_clk.clkr, 3347 [GCC_SMMU_AGGRE0_AXI_CLK] = &gcc_smmu_aggre0_axi_clk.clkr, 3348 [GCC_SMMU_AGGRE0_AHB_CLK] = &gcc_smmu_aggre0_ahb_clk.clkr, 3349 [GCC_AGGRE2_UFS_AXI_CLK] = &gcc_aggre2_ufs_axi_clk.clkr, 3350 [GCC_AGGRE2_USB3_AXI_CLK] = &gcc_aggre2_usb3_axi_clk.clkr, 3351 [GCC_QSPI_AHB_CLK] = &gcc_qspi_ahb_clk.clkr, 3352 [GCC_QSPI_SER_CLK] = &gcc_qspi_ser_clk.clkr, 3353 [GCC_USB3_CLKREF_CLK] = &gcc_usb3_clkref_clk.clkr, 3354 [GCC_HDMI_CLKREF_CLK] = &gcc_hdmi_clkref_clk.clkr, 3355 [GCC_UFS_CLKREF_CLK] = &gcc_ufs_clkref_clk.clkr, 3356 [GCC_PCIE_CLKREF_CLK] = &gcc_pcie_clkref_clk.clkr, 3357 [GCC_RX2_USB2_CLKREF_CLK] = &gcc_rx2_usb2_clkref_clk.clkr, 3358 [GCC_RX1_USB2_CLKREF_CLK] = &gcc_rx1_usb2_clkref_clk.clkr, 3359 }; 3360 3361 static struct gdsc *gcc_msm8996_gdscs[] = { 3362 [AGGRE0_NOC_GDSC] = &aggre0_noc_gdsc, 3363 [HLOS1_VOTE_AGGRE0_NOC_GDSC] = &hlos1_vote_aggre0_noc_gdsc, 3364 [HLOS1_VOTE_LPASS_ADSP_GDSC] = &hlos1_vote_lpass_adsp_gdsc, 3365 [HLOS1_VOTE_LPASS_CORE_GDSC] = &hlos1_vote_lpass_core_gdsc, 3366 [USB30_GDSC] = &usb30_gdsc, 3367 [PCIE0_GDSC] = &pcie0_gdsc, 3368 [PCIE1_GDSC] = &pcie1_gdsc, 3369 [PCIE2_GDSC] = &pcie2_gdsc, 3370 [UFS_GDSC] = &ufs_gdsc, 3371 }; 3372 3373 static const struct qcom_reset_map gcc_msm8996_resets[] = { 3374 [GCC_SYSTEM_NOC_BCR] = { 0x4000 }, 3375 [GCC_CONFIG_NOC_BCR] = { 0x5000 }, 3376 [GCC_PERIPH_NOC_BCR] = { 0x6000 }, 3377 [GCC_IMEM_BCR] = { 0x8000 }, 3378 [GCC_MMSS_BCR] = { 0x9000 }, 3379 [GCC_PIMEM_BCR] = { 0x0a000 }, 3380 [GCC_QDSS_BCR] = { 0x0c000 }, 3381 [GCC_USB_30_BCR] = { 0x0f000 }, 3382 [GCC_USB_20_BCR] = { 0x12000 }, 3383 [GCC_QUSB2PHY_PRIM_BCR] = { 0x12038 }, 3384 [GCC_QUSB2PHY_SEC_BCR] = { 0x1203c }, 3385 [GCC_USB3_PHY_BCR] = { 0x50020 }, 3386 [GCC_USB3PHY_PHY_BCR] = { 0x50024 }, 3387 [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 }, 3388 [GCC_SDCC1_BCR] = { 0x13000 }, 3389 [GCC_SDCC2_BCR] = { 0x14000 }, 3390 [GCC_SDCC3_BCR] = { 0x15000 }, 3391 [GCC_SDCC4_BCR] = { 0x16000 }, 3392 [GCC_BLSP1_BCR] = { 0x17000 }, 3393 [GCC_BLSP1_QUP1_BCR] = { 0x19000 }, 3394 [GCC_BLSP1_UART1_BCR] = { 0x1a000 }, 3395 [GCC_BLSP1_QUP2_BCR] = { 0x1b000 }, 3396 [GCC_BLSP1_UART2_BCR] = { 0x1c000 }, 3397 [GCC_BLSP1_QUP3_BCR] = { 0x1d000 }, 3398 [GCC_BLSP1_UART3_BCR] = { 0x1e000 }, 3399 [GCC_BLSP1_QUP4_BCR] = { 0x1f000 }, 3400 [GCC_BLSP1_UART4_BCR] = { 0x20000 }, 3401 [GCC_BLSP1_QUP5_BCR] = { 0x21000 }, 3402 [GCC_BLSP1_UART5_BCR] = { 0x22000 }, 3403 [GCC_BLSP1_QUP6_BCR] = { 0x23000 }, 3404 [GCC_BLSP1_UART6_BCR] = { 0x24000 }, 3405 [GCC_BLSP2_BCR] = { 0x25000 }, 3406 [GCC_BLSP2_QUP1_BCR] = { 0x26000 }, 3407 [GCC_BLSP2_UART1_BCR] = { 0x27000 }, 3408 [GCC_BLSP2_QUP2_BCR] = { 0x28000 }, 3409 [GCC_BLSP2_UART2_BCR] = { 0x29000 }, 3410 [GCC_BLSP2_QUP3_BCR] = { 0x2a000 }, 3411 [GCC_BLSP2_UART3_BCR] = { 0x2b000 }, 3412 [GCC_BLSP2_QUP4_BCR] = { 0x2c000 }, 3413 [GCC_BLSP2_UART4_BCR] = { 0x2d000 }, 3414 [GCC_BLSP2_QUP5_BCR] = { 0x2e000 }, 3415 [GCC_BLSP2_UART5_BCR] = { 0x2f000 }, 3416 [GCC_BLSP2_QUP6_BCR] = { 0x30000 }, 3417 [GCC_BLSP2_UART6_BCR] = { 0x31000 }, 3418 [GCC_PDM_BCR] = { 0x33000 }, 3419 [GCC_PRNG_BCR] = { 0x34000 }, 3420 [GCC_TSIF_BCR] = { 0x36000 }, 3421 [GCC_TCSR_BCR] = { 0x37000 }, 3422 [GCC_BOOT_ROM_BCR] = { 0x38000 }, 3423 [GCC_MSG_RAM_BCR] = { 0x39000 }, 3424 [GCC_TLMM_BCR] = { 0x3a000 }, 3425 [GCC_MPM_BCR] = { 0x3b000 }, 3426 [GCC_SEC_CTRL_BCR] = { 0x3d000 }, 3427 [GCC_SPMI_BCR] = { 0x3f000 }, 3428 [GCC_SPDM_BCR] = { 0x40000 }, 3429 [GCC_CE1_BCR] = { 0x41000 }, 3430 [GCC_BIMC_BCR] = { 0x44000 }, 3431 [GCC_SNOC_BUS_TIMEOUT0_BCR] = { 0x49000 }, 3432 [GCC_SNOC_BUS_TIMEOUT2_BCR] = { 0x49008 }, 3433 [GCC_SNOC_BUS_TIMEOUT1_BCR] = { 0x49010 }, 3434 [GCC_SNOC_BUS_TIMEOUT3_BCR] = { 0x49018 }, 3435 [GCC_SNOC_BUS_TIMEOUT_EXTREF_BCR] = { 0x49020 }, 3436 [GCC_PNOC_BUS_TIMEOUT0_BCR] = { 0x4a000 }, 3437 [GCC_PNOC_BUS_TIMEOUT1_BCR] = { 0x4a008 }, 3438 [GCC_PNOC_BUS_TIMEOUT2_BCR] = { 0x4a010 }, 3439 [GCC_PNOC_BUS_TIMEOUT3_BCR] = { 0x4a018 }, 3440 [GCC_PNOC_BUS_TIMEOUT4_BCR] = { 0x4a020 }, 3441 [GCC_CNOC_BUS_TIMEOUT0_BCR] = { 0x4b000 }, 3442 [GCC_CNOC_BUS_TIMEOUT1_BCR] = { 0x4b008 }, 3443 [GCC_CNOC_BUS_TIMEOUT2_BCR] = { 0x4b010 }, 3444 [GCC_CNOC_BUS_TIMEOUT3_BCR] = { 0x4b018 }, 3445 [GCC_CNOC_BUS_TIMEOUT4_BCR] = { 0x4b020 }, 3446 [GCC_CNOC_BUS_TIMEOUT5_BCR] = { 0x4b028 }, 3447 [GCC_CNOC_BUS_TIMEOUT6_BCR] = { 0x4b030 }, 3448 [GCC_CNOC_BUS_TIMEOUT7_BCR] = { 0x4b038 }, 3449 [GCC_CNOC_BUS_TIMEOUT8_BCR] = { 0x80000 }, 3450 [GCC_CNOC_BUS_TIMEOUT9_BCR] = { 0x80008 }, 3451 [GCC_CNOC_BUS_TIMEOUT_EXTREF_BCR] = { 0x80010 }, 3452 [GCC_APB2JTAG_BCR] = { 0x4c000 }, 3453 [GCC_RBCPR_CX_BCR] = { 0x4e000 }, 3454 [GCC_RBCPR_MX_BCR] = { 0x4f000 }, 3455 [GCC_PCIE_0_BCR] = { 0x6b000 }, 3456 [GCC_PCIE_0_PHY_BCR] = { 0x6c01c }, 3457 [GCC_PCIE_1_BCR] = { 0x6d000 }, 3458 [GCC_PCIE_1_PHY_BCR] = { 0x6d038 }, 3459 [GCC_PCIE_2_BCR] = { 0x6e000 }, 3460 [GCC_PCIE_2_PHY_BCR] = { 0x6e038 }, 3461 [GCC_PCIE_PHY_BCR] = { 0x6f000 }, 3462 [GCC_PCIE_PHY_COM_BCR] = { 0x6f014 }, 3463 [GCC_PCIE_PHY_COM_NOCSR_BCR] = { 0x6f00c }, 3464 [GCC_DCD_BCR] = { 0x70000 }, 3465 [GCC_OBT_ODT_BCR] = { 0x73000 }, 3466 [GCC_UFS_BCR] = { 0x75000 }, 3467 [GCC_SSC_BCR] = { 0x63000 }, 3468 [GCC_VS_BCR] = { 0x7a000 }, 3469 [GCC_AGGRE0_NOC_BCR] = { 0x81000 }, 3470 [GCC_AGGRE1_NOC_BCR] = { 0x82000 }, 3471 [GCC_AGGRE2_NOC_BCR] = { 0x83000 }, 3472 [GCC_DCC_BCR] = { 0x84000 }, 3473 [GCC_IPA_BCR] = { 0x89000 }, 3474 [GCC_QSPI_BCR] = { 0x8b000 }, 3475 [GCC_SKL_BCR] = { 0x8c000 }, 3476 [GCC_MSMPU_BCR] = { 0x8d000 }, 3477 [GCC_MSS_Q6_BCR] = { 0x8e000 }, 3478 [GCC_QREFS_VBG_CAL_BCR] = { 0x88020 }, 3479 [GCC_MSS_RESTART] = { 0x8f008 }, 3480 }; 3481 3482 static const struct regmap_config gcc_msm8996_regmap_config = { 3483 .reg_bits = 32, 3484 .reg_stride = 4, 3485 .val_bits = 32, 3486 .max_register = 0x8f010, 3487 .fast_io = true, 3488 }; 3489 3490 static const struct qcom_cc_desc gcc_msm8996_desc = { 3491 .config = &gcc_msm8996_regmap_config, 3492 .clks = gcc_msm8996_clocks, 3493 .num_clks = ARRAY_SIZE(gcc_msm8996_clocks), 3494 .resets = gcc_msm8996_resets, 3495 .num_resets = ARRAY_SIZE(gcc_msm8996_resets), 3496 .gdscs = gcc_msm8996_gdscs, 3497 .num_gdscs = ARRAY_SIZE(gcc_msm8996_gdscs), 3498 }; 3499 3500 static const struct of_device_id gcc_msm8996_match_table[] = { 3501 { .compatible = "qcom,gcc-msm8996" }, 3502 { } 3503 }; 3504 MODULE_DEVICE_TABLE(of, gcc_msm8996_match_table); 3505 3506 static int gcc_msm8996_probe(struct platform_device *pdev) 3507 { 3508 struct device *dev = &pdev->dev; 3509 int i, ret; 3510 struct regmap *regmap; 3511 3512 regmap = qcom_cc_map(pdev, &gcc_msm8996_desc); 3513 if (IS_ERR(regmap)) 3514 return PTR_ERR(regmap); 3515 3516 /* 3517 * Set the HMSS_AHB_CLK_SLEEP_ENA bit to allow the hmss_ahb_clk to be 3518 * turned off by hardware during certain apps low power modes. 3519 */ 3520 regmap_update_bits(regmap, 0x52008, BIT(21), BIT(21)); 3521 3522 for (i = 0; i < ARRAY_SIZE(gcc_msm8996_hws); i++) { 3523 ret = devm_clk_hw_register(dev, gcc_msm8996_hws[i]); 3524 if (ret) 3525 return ret; 3526 } 3527 3528 return qcom_cc_really_probe(pdev, &gcc_msm8996_desc, regmap); 3529 } 3530 3531 static struct platform_driver gcc_msm8996_driver = { 3532 .probe = gcc_msm8996_probe, 3533 .driver = { 3534 .name = "gcc-msm8996", 3535 .of_match_table = gcc_msm8996_match_table, 3536 }, 3537 }; 3538 3539 static int __init gcc_msm8996_init(void) 3540 { 3541 return platform_driver_register(&gcc_msm8996_driver); 3542 } 3543 core_initcall(gcc_msm8996_init); 3544 3545 static void __exit gcc_msm8996_exit(void) 3546 { 3547 platform_driver_unregister(&gcc_msm8996_driver); 3548 } 3549 module_exit(gcc_msm8996_exit); 3550 3551 MODULE_DESCRIPTION("QCOM GCC MSM8996 Driver"); 3552 MODULE_LICENSE("GPL v2"); 3553 MODULE_ALIAS("platform:gcc-msm8996"); 3554