mmcc-msm8996.c (84547B)
1// SPDX-License-Identifier: GPL-2.0-only 2/*x 3 * Copyright (c) 2015, The Linux Foundation. All rights reserved. 4 */ 5 6#include <linux/kernel.h> 7#include <linux/bitops.h> 8#include <linux/err.h> 9#include <linux/platform_device.h> 10#include <linux/module.h> 11#include <linux/of.h> 12#include <linux/of_device.h> 13#include <linux/clk-provider.h> 14#include <linux/regmap.h> 15#include <linux/reset-controller.h> 16#include <linux/clk.h> 17 18#include <dt-bindings/clock/qcom,mmcc-msm8996.h> 19 20#include "common.h" 21#include "clk-regmap.h" 22#include "clk-regmap-divider.h" 23#include "clk-alpha-pll.h" 24#include "clk-rcg.h" 25#include "clk-branch.h" 26#include "reset.h" 27#include "gdsc.h" 28 29enum { 30 P_XO, 31 P_MMPLL0, 32 P_GPLL0, 33 P_GPLL0_DIV, 34 P_MMPLL1, 35 P_MMPLL9, 36 P_MMPLL2, 37 P_MMPLL8, 38 P_MMPLL3, 39 P_DSI0PLL, 40 P_DSI1PLL, 41 P_MMPLL5, 42 P_HDMIPLL, 43 P_DSI0PLL_BYTE, 44 P_DSI1PLL_BYTE, 45 P_MMPLL4, 46}; 47 48static const struct parent_map mmss_xo_hdmi_map[] = { 49 { P_XO, 0 }, 50 { P_HDMIPLL, 1 } 51}; 52 53static const char * const mmss_xo_hdmi[] = { 54 "xo", 55 "hdmipll" 56}; 57 58static const struct parent_map mmss_xo_dsi0pll_dsi1pll_map[] = { 59 { P_XO, 0 }, 60 { P_DSI0PLL, 1 }, 61 { P_DSI1PLL, 2 } 62}; 63 64static const char * const mmss_xo_dsi0pll_dsi1pll[] = { 65 "xo", 66 "dsi0pll", 67 "dsi1pll" 68}; 69 70static const struct parent_map mmss_xo_gpll0_gpll0_div_map[] = { 71 { P_XO, 0 }, 72 { P_GPLL0, 5 }, 73 { P_GPLL0_DIV, 6 } 74}; 75 76static const char * const mmss_xo_gpll0_gpll0_div[] = { 77 "xo", 78 "gpll0", 79 "gpll0_div" 80}; 81 82static const struct parent_map mmss_xo_dsibyte_map[] = { 83 { P_XO, 0 }, 84 { P_DSI0PLL_BYTE, 1 }, 85 { P_DSI1PLL_BYTE, 2 } 86}; 87 88static const char * const mmss_xo_dsibyte[] = { 89 "xo", 90 "dsi0pllbyte", 91 "dsi1pllbyte" 92}; 93 94static const struct parent_map mmss_xo_mmpll0_gpll0_gpll0_div_map[] = { 95 { P_XO, 0 }, 96 { P_MMPLL0, 1 }, 97 { P_GPLL0, 5 }, 98 { P_GPLL0_DIV, 6 } 99}; 100 101static const char * const mmss_xo_mmpll0_gpll0_gpll0_div[] = { 102 "xo", 103 "mmpll0", 104 "gpll0", 105 "gpll0_div" 106}; 107 108static const struct parent_map mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div_map[] = { 109 { P_XO, 0 }, 110 { P_MMPLL0, 1 }, 111 { P_MMPLL1, 2 }, 112 { P_GPLL0, 5 }, 113 { P_GPLL0_DIV, 6 } 114}; 115 116static const char * const mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div[] = { 117 "xo", 118 "mmpll0", 119 "mmpll1", 120 "gpll0", 121 "gpll0_div" 122}; 123 124static const struct parent_map mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div_map[] = { 125 { P_XO, 0 }, 126 { P_MMPLL0, 1 }, 127 { P_MMPLL3, 3 }, 128 { P_GPLL0, 5 }, 129 { P_GPLL0_DIV, 6 } 130}; 131 132static const char * const mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div[] = { 133 "xo", 134 "mmpll0", 135 "mmpll3", 136 "gpll0", 137 "gpll0_div" 138}; 139 140static const struct parent_map mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div_map[] = { 141 { P_XO, 0 }, 142 { P_MMPLL0, 1 }, 143 { P_MMPLL5, 2 }, 144 { P_GPLL0, 5 }, 145 { P_GPLL0_DIV, 6 } 146}; 147 148static const char * const mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div[] = { 149 "xo", 150 "mmpll0", 151 "mmpll5", 152 "gpll0", 153 "gpll0_div" 154}; 155 156static const struct parent_map mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map[] = { 157 { P_XO, 0 }, 158 { P_MMPLL0, 1 }, 159 { P_MMPLL4, 3 }, 160 { P_GPLL0, 5 }, 161 { P_GPLL0_DIV, 6 } 162}; 163 164static const char * const mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div[] = { 165 "xo", 166 "mmpll0", 167 "mmpll4", 168 "gpll0", 169 "gpll0_div" 170}; 171 172static const struct parent_map mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_map[] = { 173 { P_XO, 0 }, 174 { P_MMPLL0, 1 }, 175 { P_MMPLL9, 2 }, 176 { P_MMPLL2, 3 }, 177 { P_MMPLL8, 4 }, 178 { P_GPLL0, 5 } 179}; 180 181static const char * const mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0[] = { 182 "xo", 183 "mmpll0", 184 "mmpll9", 185 "mmpll2", 186 "mmpll8", 187 "gpll0" 188}; 189 190static const struct parent_map mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_gpll0_div_map[] = { 191 { P_XO, 0 }, 192 { P_MMPLL0, 1 }, 193 { P_MMPLL9, 2 }, 194 { P_MMPLL2, 3 }, 195 { P_MMPLL8, 4 }, 196 { P_GPLL0, 5 }, 197 { P_GPLL0_DIV, 6 } 198}; 199 200static const char * const mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_gpll0_div[] = { 201 "xo", 202 "mmpll0", 203 "mmpll9", 204 "mmpll2", 205 "mmpll8", 206 "gpll0", 207 "gpll0_div" 208}; 209 210static const struct parent_map mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map[] = { 211 { P_XO, 0 }, 212 { P_MMPLL0, 1 }, 213 { P_MMPLL1, 2 }, 214 { P_MMPLL4, 3 }, 215 { P_MMPLL3, 4 }, 216 { P_GPLL0, 5 }, 217 { P_GPLL0_DIV, 6 } 218}; 219 220static const char * const mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div[] = { 221 "xo", 222 "mmpll0", 223 "mmpll1", 224 "mmpll4", 225 "mmpll3", 226 "gpll0", 227 "gpll0_div" 228}; 229 230static struct clk_fixed_factor gpll0_div = { 231 .mult = 1, 232 .div = 2, 233 .hw.init = &(struct clk_init_data){ 234 .name = "gpll0_div", 235 .parent_names = (const char *[]){ "gpll0" }, 236 .num_parents = 1, 237 .ops = &clk_fixed_factor_ops, 238 }, 239}; 240 241static struct pll_vco mmpll_p_vco[] = { 242 { 250000000, 500000000, 3 }, 243 { 500000000, 1000000000, 2 }, 244 { 1000000000, 1500000000, 1 }, 245 { 1500000000, 2000000000, 0 }, 246}; 247 248static struct pll_vco mmpll_gfx_vco[] = { 249 { 400000000, 1000000000, 2 }, 250 { 1000000000, 1500000000, 1 }, 251 { 1500000000, 2000000000, 0 }, 252}; 253 254static struct pll_vco mmpll_t_vco[] = { 255 { 500000000, 1500000000, 0 }, 256}; 257 258static struct clk_alpha_pll mmpll0_early = { 259 .offset = 0x0, 260 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 261 .vco_table = mmpll_p_vco, 262 .num_vco = ARRAY_SIZE(mmpll_p_vco), 263 .clkr = { 264 .enable_reg = 0x100, 265 .enable_mask = BIT(0), 266 .hw.init = &(struct clk_init_data){ 267 .name = "mmpll0_early", 268 .parent_names = (const char *[]){ "xo" }, 269 .num_parents = 1, 270 .ops = &clk_alpha_pll_ops, 271 }, 272 }, 273}; 274 275static struct clk_alpha_pll_postdiv mmpll0 = { 276 .offset = 0x0, 277 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 278 .width = 4, 279 .clkr.hw.init = &(struct clk_init_data){ 280 .name = "mmpll0", 281 .parent_names = (const char *[]){ "mmpll0_early" }, 282 .num_parents = 1, 283 .ops = &clk_alpha_pll_postdiv_ops, 284 .flags = CLK_SET_RATE_PARENT, 285 }, 286}; 287 288static struct clk_alpha_pll mmpll1_early = { 289 .offset = 0x30, 290 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 291 .vco_table = mmpll_p_vco, 292 .num_vco = ARRAY_SIZE(mmpll_p_vco), 293 .clkr = { 294 .enable_reg = 0x100, 295 .enable_mask = BIT(1), 296 .hw.init = &(struct clk_init_data){ 297 .name = "mmpll1_early", 298 .parent_names = (const char *[]){ "xo" }, 299 .num_parents = 1, 300 .ops = &clk_alpha_pll_ops, 301 } 302 }, 303}; 304 305static struct clk_alpha_pll_postdiv mmpll1 = { 306 .offset = 0x30, 307 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 308 .width = 4, 309 .clkr.hw.init = &(struct clk_init_data){ 310 .name = "mmpll1", 311 .parent_names = (const char *[]){ "mmpll1_early" }, 312 .num_parents = 1, 313 .ops = &clk_alpha_pll_postdiv_ops, 314 .flags = CLK_SET_RATE_PARENT, 315 }, 316}; 317 318static struct clk_alpha_pll mmpll2_early = { 319 .offset = 0x4100, 320 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 321 .vco_table = mmpll_gfx_vco, 322 .num_vco = ARRAY_SIZE(mmpll_gfx_vco), 323 .clkr.hw.init = &(struct clk_init_data){ 324 .name = "mmpll2_early", 325 .parent_names = (const char *[]){ "xo" }, 326 .num_parents = 1, 327 .ops = &clk_alpha_pll_ops, 328 }, 329}; 330 331static struct clk_alpha_pll_postdiv mmpll2 = { 332 .offset = 0x4100, 333 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 334 .width = 4, 335 .clkr.hw.init = &(struct clk_init_data){ 336 .name = "mmpll2", 337 .parent_names = (const char *[]){ "mmpll2_early" }, 338 .num_parents = 1, 339 .ops = &clk_alpha_pll_postdiv_ops, 340 .flags = CLK_SET_RATE_PARENT, 341 }, 342}; 343 344static struct clk_alpha_pll mmpll3_early = { 345 .offset = 0x60, 346 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 347 .vco_table = mmpll_p_vco, 348 .num_vco = ARRAY_SIZE(mmpll_p_vco), 349 .clkr.hw.init = &(struct clk_init_data){ 350 .name = "mmpll3_early", 351 .parent_names = (const char *[]){ "xo" }, 352 .num_parents = 1, 353 .ops = &clk_alpha_pll_ops, 354 }, 355}; 356 357static struct clk_alpha_pll_postdiv mmpll3 = { 358 .offset = 0x60, 359 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 360 .width = 4, 361 .clkr.hw.init = &(struct clk_init_data){ 362 .name = "mmpll3", 363 .parent_names = (const char *[]){ "mmpll3_early" }, 364 .num_parents = 1, 365 .ops = &clk_alpha_pll_postdiv_ops, 366 .flags = CLK_SET_RATE_PARENT, 367 }, 368}; 369 370static struct clk_alpha_pll mmpll4_early = { 371 .offset = 0x90, 372 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 373 .vco_table = mmpll_t_vco, 374 .num_vco = ARRAY_SIZE(mmpll_t_vco), 375 .clkr.hw.init = &(struct clk_init_data){ 376 .name = "mmpll4_early", 377 .parent_names = (const char *[]){ "xo" }, 378 .num_parents = 1, 379 .ops = &clk_alpha_pll_ops, 380 }, 381}; 382 383static struct clk_alpha_pll_postdiv mmpll4 = { 384 .offset = 0x90, 385 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 386 .width = 2, 387 .clkr.hw.init = &(struct clk_init_data){ 388 .name = "mmpll4", 389 .parent_names = (const char *[]){ "mmpll4_early" }, 390 .num_parents = 1, 391 .ops = &clk_alpha_pll_postdiv_ops, 392 .flags = CLK_SET_RATE_PARENT, 393 }, 394}; 395 396static struct clk_alpha_pll mmpll5_early = { 397 .offset = 0xc0, 398 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 399 .vco_table = mmpll_p_vco, 400 .num_vco = ARRAY_SIZE(mmpll_p_vco), 401 .clkr.hw.init = &(struct clk_init_data){ 402 .name = "mmpll5_early", 403 .parent_names = (const char *[]){ "xo" }, 404 .num_parents = 1, 405 .ops = &clk_alpha_pll_ops, 406 }, 407}; 408 409static struct clk_alpha_pll_postdiv mmpll5 = { 410 .offset = 0xc0, 411 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 412 .width = 4, 413 .clkr.hw.init = &(struct clk_init_data){ 414 .name = "mmpll5", 415 .parent_names = (const char *[]){ "mmpll5_early" }, 416 .num_parents = 1, 417 .ops = &clk_alpha_pll_postdiv_ops, 418 .flags = CLK_SET_RATE_PARENT, 419 }, 420}; 421 422static struct clk_alpha_pll mmpll8_early = { 423 .offset = 0x4130, 424 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 425 .vco_table = mmpll_gfx_vco, 426 .num_vco = ARRAY_SIZE(mmpll_gfx_vco), 427 .clkr.hw.init = &(struct clk_init_data){ 428 .name = "mmpll8_early", 429 .parent_names = (const char *[]){ "xo" }, 430 .num_parents = 1, 431 .ops = &clk_alpha_pll_ops, 432 }, 433}; 434 435static struct clk_alpha_pll_postdiv mmpll8 = { 436 .offset = 0x4130, 437 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 438 .width = 4, 439 .clkr.hw.init = &(struct clk_init_data){ 440 .name = "mmpll8", 441 .parent_names = (const char *[]){ "mmpll8_early" }, 442 .num_parents = 1, 443 .ops = &clk_alpha_pll_postdiv_ops, 444 .flags = CLK_SET_RATE_PARENT, 445 }, 446}; 447 448static struct clk_alpha_pll mmpll9_early = { 449 .offset = 0x4200, 450 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 451 .vco_table = mmpll_t_vco, 452 .num_vco = ARRAY_SIZE(mmpll_t_vco), 453 .clkr.hw.init = &(struct clk_init_data){ 454 .name = "mmpll9_early", 455 .parent_names = (const char *[]){ "xo" }, 456 .num_parents = 1, 457 .ops = &clk_alpha_pll_ops, 458 }, 459}; 460 461static struct clk_alpha_pll_postdiv mmpll9 = { 462 .offset = 0x4200, 463 .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], 464 .width = 2, 465 .clkr.hw.init = &(struct clk_init_data){ 466 .name = "mmpll9", 467 .parent_names = (const char *[]){ "mmpll9_early" }, 468 .num_parents = 1, 469 .ops = &clk_alpha_pll_postdiv_ops, 470 .flags = CLK_SET_RATE_PARENT, 471 }, 472}; 473 474static const struct freq_tbl ftbl_ahb_clk_src[] = { 475 F(19200000, P_XO, 1, 0, 0), 476 F(40000000, P_GPLL0_DIV, 7.5, 0, 0), 477 F(80000000, P_MMPLL0, 10, 0, 0), 478 { } 479}; 480 481static struct clk_rcg2 ahb_clk_src = { 482 .cmd_rcgr = 0x5000, 483 .hid_width = 5, 484 .parent_map = mmss_xo_mmpll0_gpll0_gpll0_div_map, 485 .freq_tbl = ftbl_ahb_clk_src, 486 .clkr.hw.init = &(struct clk_init_data){ 487 .name = "ahb_clk_src", 488 .parent_names = mmss_xo_mmpll0_gpll0_gpll0_div, 489 .num_parents = 4, 490 .ops = &clk_rcg2_ops, 491 }, 492}; 493 494static const struct freq_tbl ftbl_axi_clk_src[] = { 495 F(19200000, P_XO, 1, 0, 0), 496 F(75000000, P_GPLL0_DIV, 4, 0, 0), 497 F(100000000, P_GPLL0, 6, 0, 0), 498 F(171430000, P_GPLL0, 3.5, 0, 0), 499 F(200000000, P_GPLL0, 3, 0, 0), 500 F(320000000, P_MMPLL0, 2.5, 0, 0), 501 F(400000000, P_MMPLL0, 2, 0, 0), 502 { } 503}; 504 505static struct clk_rcg2 axi_clk_src = { 506 .cmd_rcgr = 0x5040, 507 .hid_width = 5, 508 .parent_map = mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div_map, 509 .freq_tbl = ftbl_axi_clk_src, 510 .clkr.hw.init = &(struct clk_init_data){ 511 .name = "axi_clk_src", 512 .parent_names = mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div, 513 .num_parents = 5, 514 .ops = &clk_rcg2_ops, 515 }, 516}; 517 518static struct clk_rcg2 maxi_clk_src = { 519 .cmd_rcgr = 0x5090, 520 .hid_width = 5, 521 .parent_map = mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div_map, 522 .freq_tbl = ftbl_axi_clk_src, 523 .clkr.hw.init = &(struct clk_init_data){ 524 .name = "maxi_clk_src", 525 .parent_names = mmss_xo_mmpll0_mmpll1_gpll0_gpll0_div, 526 .num_parents = 5, 527 .ops = &clk_rcg2_ops, 528 }, 529}; 530 531static struct clk_rcg2_gfx3d gfx3d_clk_src = { 532 .rcg = { 533 .cmd_rcgr = 0x4000, 534 .hid_width = 5, 535 .parent_map = mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_map, 536 .clkr.hw.init = &(struct clk_init_data){ 537 .name = "gfx3d_clk_src", 538 .parent_names = mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0, 539 .num_parents = 6, 540 .ops = &clk_gfx3d_ops, 541 .flags = CLK_SET_RATE_PARENT, 542 }, 543 }, 544 .hws = (struct clk_hw*[]) { 545 &mmpll9.clkr.hw, 546 &mmpll2.clkr.hw, 547 &mmpll8.clkr.hw 548 }, 549}; 550 551static const struct freq_tbl ftbl_rbbmtimer_clk_src[] = { 552 F(19200000, P_XO, 1, 0, 0), 553 { } 554}; 555 556static struct clk_rcg2 rbbmtimer_clk_src = { 557 .cmd_rcgr = 0x4090, 558 .hid_width = 5, 559 .parent_map = mmss_xo_mmpll0_gpll0_gpll0_div_map, 560 .freq_tbl = ftbl_rbbmtimer_clk_src, 561 .clkr.hw.init = &(struct clk_init_data){ 562 .name = "rbbmtimer_clk_src", 563 .parent_names = mmss_xo_mmpll0_gpll0_gpll0_div, 564 .num_parents = 4, 565 .ops = &clk_rcg2_ops, 566 }, 567}; 568 569static struct clk_rcg2 isense_clk_src = { 570 .cmd_rcgr = 0x4010, 571 .hid_width = 5, 572 .parent_map = mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_gpll0_div_map, 573 .clkr.hw.init = &(struct clk_init_data){ 574 .name = "isense_clk_src", 575 .parent_names = mmss_xo_mmpll0_mmpll9_mmpll2_mmpll8_gpll0_gpll0_div, 576 .num_parents = 7, 577 .ops = &clk_rcg2_ops, 578 }, 579}; 580 581static const struct freq_tbl ftbl_rbcpr_clk_src[] = { 582 F(19200000, P_XO, 1, 0, 0), 583 F(50000000, P_GPLL0, 12, 0, 0), 584 { } 585}; 586 587static struct clk_rcg2 rbcpr_clk_src = { 588 .cmd_rcgr = 0x4060, 589 .hid_width = 5, 590 .parent_map = mmss_xo_mmpll0_gpll0_gpll0_div_map, 591 .freq_tbl = ftbl_rbcpr_clk_src, 592 .clkr.hw.init = &(struct clk_init_data){ 593 .name = "rbcpr_clk_src", 594 .parent_names = mmss_xo_mmpll0_gpll0_gpll0_div, 595 .num_parents = 4, 596 .ops = &clk_rcg2_ops, 597 }, 598}; 599 600static const struct freq_tbl ftbl_video_core_clk_src[] = { 601 F(75000000, P_GPLL0_DIV, 4, 0, 0), 602 F(150000000, P_GPLL0, 4, 0, 0), 603 F(346666667, P_MMPLL3, 3, 0, 0), 604 F(520000000, P_MMPLL3, 2, 0, 0), 605 { } 606}; 607 608static struct clk_rcg2 video_core_clk_src = { 609 .cmd_rcgr = 0x1000, 610 .mnd_width = 8, 611 .hid_width = 5, 612 .parent_map = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div_map, 613 .freq_tbl = ftbl_video_core_clk_src, 614 .clkr.hw.init = &(struct clk_init_data){ 615 .name = "video_core_clk_src", 616 .parent_names = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div, 617 .num_parents = 5, 618 .ops = &clk_rcg2_ops, 619 }, 620}; 621 622static struct clk_rcg2 video_subcore0_clk_src = { 623 .cmd_rcgr = 0x1060, 624 .mnd_width = 8, 625 .hid_width = 5, 626 .parent_map = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div_map, 627 .freq_tbl = ftbl_video_core_clk_src, 628 .clkr.hw.init = &(struct clk_init_data){ 629 .name = "video_subcore0_clk_src", 630 .parent_names = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div, 631 .num_parents = 5, 632 .ops = &clk_rcg2_ops, 633 }, 634}; 635 636static struct clk_rcg2 video_subcore1_clk_src = { 637 .cmd_rcgr = 0x1080, 638 .mnd_width = 8, 639 .hid_width = 5, 640 .parent_map = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div_map, 641 .freq_tbl = ftbl_video_core_clk_src, 642 .clkr.hw.init = &(struct clk_init_data){ 643 .name = "video_subcore1_clk_src", 644 .parent_names = mmss_xo_mmpll0_mmpll3_gpll0_gpll0_div, 645 .num_parents = 5, 646 .ops = &clk_rcg2_ops, 647 }, 648}; 649 650static struct clk_rcg2 pclk0_clk_src = { 651 .cmd_rcgr = 0x2000, 652 .mnd_width = 8, 653 .hid_width = 5, 654 .parent_map = mmss_xo_dsi0pll_dsi1pll_map, 655 .clkr.hw.init = &(struct clk_init_data){ 656 .name = "pclk0_clk_src", 657 .parent_names = mmss_xo_dsi0pll_dsi1pll, 658 .num_parents = 3, 659 .ops = &clk_pixel_ops, 660 .flags = CLK_SET_RATE_PARENT, 661 }, 662}; 663 664static struct clk_rcg2 pclk1_clk_src = { 665 .cmd_rcgr = 0x2020, 666 .mnd_width = 8, 667 .hid_width = 5, 668 .parent_map = mmss_xo_dsi0pll_dsi1pll_map, 669 .clkr.hw.init = &(struct clk_init_data){ 670 .name = "pclk1_clk_src", 671 .parent_names = mmss_xo_dsi0pll_dsi1pll, 672 .num_parents = 3, 673 .ops = &clk_pixel_ops, 674 .flags = CLK_SET_RATE_PARENT, 675 }, 676}; 677 678static const struct freq_tbl ftbl_mdp_clk_src[] = { 679 F(85714286, P_GPLL0, 7, 0, 0), 680 F(100000000, P_GPLL0, 6, 0, 0), 681 F(150000000, P_GPLL0, 4, 0, 0), 682 F(171428571, P_GPLL0, 3.5, 0, 0), 683 F(200000000, P_GPLL0, 3, 0, 0), 684 F(275000000, P_MMPLL5, 3, 0, 0), 685 F(300000000, P_GPLL0, 2, 0, 0), 686 F(330000000, P_MMPLL5, 2.5, 0, 0), 687 F(412500000, P_MMPLL5, 2, 0, 0), 688 { } 689}; 690 691static struct clk_rcg2 mdp_clk_src = { 692 .cmd_rcgr = 0x2040, 693 .hid_width = 5, 694 .parent_map = mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div_map, 695 .freq_tbl = ftbl_mdp_clk_src, 696 .clkr.hw.init = &(struct clk_init_data){ 697 .name = "mdp_clk_src", 698 .parent_names = mmss_xo_mmpll0_mmpll5_gpll0_gpll0_div, 699 .num_parents = 5, 700 .ops = &clk_rcg2_ops, 701 }, 702}; 703 704static struct freq_tbl extpclk_freq_tbl[] = { 705 { .src = P_HDMIPLL }, 706 { } 707}; 708 709static struct clk_rcg2 extpclk_clk_src = { 710 .cmd_rcgr = 0x2060, 711 .hid_width = 5, 712 .parent_map = mmss_xo_hdmi_map, 713 .freq_tbl = extpclk_freq_tbl, 714 .clkr.hw.init = &(struct clk_init_data){ 715 .name = "extpclk_clk_src", 716 .parent_names = mmss_xo_hdmi, 717 .num_parents = 2, 718 .ops = &clk_byte_ops, 719 .flags = CLK_SET_RATE_PARENT, 720 }, 721}; 722 723static struct freq_tbl ftbl_mdss_vsync_clk[] = { 724 F(19200000, P_XO, 1, 0, 0), 725 { } 726}; 727 728static struct clk_rcg2 vsync_clk_src = { 729 .cmd_rcgr = 0x2080, 730 .hid_width = 5, 731 .parent_map = mmss_xo_gpll0_gpll0_div_map, 732 .freq_tbl = ftbl_mdss_vsync_clk, 733 .clkr.hw.init = &(struct clk_init_data){ 734 .name = "vsync_clk_src", 735 .parent_names = mmss_xo_gpll0_gpll0_div, 736 .num_parents = 3, 737 .ops = &clk_rcg2_ops, 738 }, 739}; 740 741static struct freq_tbl ftbl_mdss_hdmi_clk[] = { 742 F(19200000, P_XO, 1, 0, 0), 743 { } 744}; 745 746static struct clk_rcg2 hdmi_clk_src = { 747 .cmd_rcgr = 0x2100, 748 .hid_width = 5, 749 .parent_map = mmss_xo_gpll0_gpll0_div_map, 750 .freq_tbl = ftbl_mdss_hdmi_clk, 751 .clkr.hw.init = &(struct clk_init_data){ 752 .name = "hdmi_clk_src", 753 .parent_names = mmss_xo_gpll0_gpll0_div, 754 .num_parents = 3, 755 .ops = &clk_rcg2_ops, 756 }, 757}; 758 759static struct clk_rcg2 byte0_clk_src = { 760 .cmd_rcgr = 0x2120, 761 .hid_width = 5, 762 .parent_map = mmss_xo_dsibyte_map, 763 .clkr.hw.init = &(struct clk_init_data){ 764 .name = "byte0_clk_src", 765 .parent_names = mmss_xo_dsibyte, 766 .num_parents = 3, 767 .ops = &clk_byte2_ops, 768 .flags = CLK_SET_RATE_PARENT, 769 }, 770}; 771 772static struct clk_rcg2 byte1_clk_src = { 773 .cmd_rcgr = 0x2140, 774 .hid_width = 5, 775 .parent_map = mmss_xo_dsibyte_map, 776 .clkr.hw.init = &(struct clk_init_data){ 777 .name = "byte1_clk_src", 778 .parent_names = mmss_xo_dsibyte, 779 .num_parents = 3, 780 .ops = &clk_byte2_ops, 781 .flags = CLK_SET_RATE_PARENT, 782 }, 783}; 784 785static struct freq_tbl ftbl_mdss_esc0_1_clk[] = { 786 F(19200000, P_XO, 1, 0, 0), 787 { } 788}; 789 790static struct clk_rcg2 esc0_clk_src = { 791 .cmd_rcgr = 0x2160, 792 .hid_width = 5, 793 .parent_map = mmss_xo_dsibyte_map, 794 .freq_tbl = ftbl_mdss_esc0_1_clk, 795 .clkr.hw.init = &(struct clk_init_data){ 796 .name = "esc0_clk_src", 797 .parent_names = mmss_xo_dsibyte, 798 .num_parents = 3, 799 .ops = &clk_rcg2_ops, 800 }, 801}; 802 803static struct clk_rcg2 esc1_clk_src = { 804 .cmd_rcgr = 0x2180, 805 .hid_width = 5, 806 .parent_map = mmss_xo_dsibyte_map, 807 .freq_tbl = ftbl_mdss_esc0_1_clk, 808 .clkr.hw.init = &(struct clk_init_data){ 809 .name = "esc1_clk_src", 810 .parent_names = mmss_xo_dsibyte, 811 .num_parents = 3, 812 .ops = &clk_rcg2_ops, 813 }, 814}; 815 816static const struct freq_tbl ftbl_camss_gp0_clk_src[] = { 817 F(10000, P_XO, 16, 1, 120), 818 F(24000, P_XO, 16, 1, 50), 819 F(6000000, P_GPLL0_DIV, 10, 1, 5), 820 F(12000000, P_GPLL0_DIV, 1, 1, 25), 821 F(13000000, P_GPLL0_DIV, 2, 13, 150), 822 F(24000000, P_GPLL0_DIV, 1, 2, 25), 823 { } 824}; 825 826static struct clk_rcg2 camss_gp0_clk_src = { 827 .cmd_rcgr = 0x3420, 828 .mnd_width = 8, 829 .hid_width = 5, 830 .parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map, 831 .freq_tbl = ftbl_camss_gp0_clk_src, 832 .clkr.hw.init = &(struct clk_init_data){ 833 .name = "camss_gp0_clk_src", 834 .parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div, 835 .num_parents = 5, 836 .ops = &clk_rcg2_ops, 837 }, 838}; 839 840static struct clk_rcg2 camss_gp1_clk_src = { 841 .cmd_rcgr = 0x3450, 842 .mnd_width = 8, 843 .hid_width = 5, 844 .parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map, 845 .freq_tbl = ftbl_camss_gp0_clk_src, 846 .clkr.hw.init = &(struct clk_init_data){ 847 .name = "camss_gp1_clk_src", 848 .parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div, 849 .num_parents = 5, 850 .ops = &clk_rcg2_ops, 851 }, 852}; 853 854static const struct freq_tbl ftbl_mclk0_clk_src[] = { 855 F(4800000, P_XO, 4, 0, 0), 856 F(6000000, P_GPLL0_DIV, 10, 1, 5), 857 F(8000000, P_GPLL0_DIV, 1, 2, 75), 858 F(9600000, P_XO, 2, 0, 0), 859 F(16666667, P_GPLL0_DIV, 2, 1, 9), 860 F(19200000, P_XO, 1, 0, 0), 861 F(24000000, P_GPLL0_DIV, 1, 2, 25), 862 F(33333333, P_GPLL0_DIV, 1, 1, 9), 863 F(48000000, P_GPLL0, 1, 2, 25), 864 F(66666667, P_GPLL0, 1, 1, 9), 865 { } 866}; 867 868static struct clk_rcg2 mclk0_clk_src = { 869 .cmd_rcgr = 0x3360, 870 .mnd_width = 8, 871 .hid_width = 5, 872 .parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map, 873 .freq_tbl = ftbl_mclk0_clk_src, 874 .clkr.hw.init = &(struct clk_init_data){ 875 .name = "mclk0_clk_src", 876 .parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div, 877 .num_parents = 5, 878 .ops = &clk_rcg2_ops, 879 }, 880}; 881 882static struct clk_rcg2 mclk1_clk_src = { 883 .cmd_rcgr = 0x3390, 884 .mnd_width = 8, 885 .hid_width = 5, 886 .parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map, 887 .freq_tbl = ftbl_mclk0_clk_src, 888 .clkr.hw.init = &(struct clk_init_data){ 889 .name = "mclk1_clk_src", 890 .parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div, 891 .num_parents = 5, 892 .ops = &clk_rcg2_ops, 893 }, 894}; 895 896static struct clk_rcg2 mclk2_clk_src = { 897 .cmd_rcgr = 0x33c0, 898 .mnd_width = 8, 899 .hid_width = 5, 900 .parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map, 901 .freq_tbl = ftbl_mclk0_clk_src, 902 .clkr.hw.init = &(struct clk_init_data){ 903 .name = "mclk2_clk_src", 904 .parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div, 905 .num_parents = 5, 906 .ops = &clk_rcg2_ops, 907 }, 908}; 909 910static struct clk_rcg2 mclk3_clk_src = { 911 .cmd_rcgr = 0x33f0, 912 .mnd_width = 8, 913 .hid_width = 5, 914 .parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map, 915 .freq_tbl = ftbl_mclk0_clk_src, 916 .clkr.hw.init = &(struct clk_init_data){ 917 .name = "mclk3_clk_src", 918 .parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div, 919 .num_parents = 5, 920 .ops = &clk_rcg2_ops, 921 }, 922}; 923 924static const struct freq_tbl ftbl_cci_clk_src[] = { 925 F(19200000, P_XO, 1, 0, 0), 926 F(37500000, P_GPLL0, 16, 0, 0), 927 F(50000000, P_GPLL0, 12, 0, 0), 928 F(100000000, P_GPLL0, 6, 0, 0), 929 { } 930}; 931 932static struct clk_rcg2 cci_clk_src = { 933 .cmd_rcgr = 0x3300, 934 .mnd_width = 8, 935 .hid_width = 5, 936 .parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map, 937 .freq_tbl = ftbl_cci_clk_src, 938 .clkr.hw.init = &(struct clk_init_data){ 939 .name = "cci_clk_src", 940 .parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div, 941 .num_parents = 5, 942 .ops = &clk_rcg2_ops, 943 }, 944}; 945 946static const struct freq_tbl ftbl_csi0phytimer_clk_src[] = { 947 F(100000000, P_GPLL0_DIV, 3, 0, 0), 948 F(200000000, P_GPLL0, 3, 0, 0), 949 F(266666667, P_MMPLL0, 3, 0, 0), 950 { } 951}; 952 953static struct clk_rcg2 csi0phytimer_clk_src = { 954 .cmd_rcgr = 0x3000, 955 .hid_width = 5, 956 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 957 .freq_tbl = ftbl_csi0phytimer_clk_src, 958 .clkr.hw.init = &(struct clk_init_data){ 959 .name = "csi0phytimer_clk_src", 960 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 961 .num_parents = 7, 962 .ops = &clk_rcg2_ops, 963 }, 964}; 965 966static struct clk_rcg2 csi1phytimer_clk_src = { 967 .cmd_rcgr = 0x3030, 968 .hid_width = 5, 969 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 970 .freq_tbl = ftbl_csi0phytimer_clk_src, 971 .clkr.hw.init = &(struct clk_init_data){ 972 .name = "csi1phytimer_clk_src", 973 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 974 .num_parents = 7, 975 .ops = &clk_rcg2_ops, 976 }, 977}; 978 979static struct clk_rcg2 csi2phytimer_clk_src = { 980 .cmd_rcgr = 0x3060, 981 .hid_width = 5, 982 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 983 .freq_tbl = ftbl_csi0phytimer_clk_src, 984 .clkr.hw.init = &(struct clk_init_data){ 985 .name = "csi2phytimer_clk_src", 986 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 987 .num_parents = 7, 988 .ops = &clk_rcg2_ops, 989 }, 990}; 991 992static const struct freq_tbl ftbl_csiphy0_3p_clk_src[] = { 993 F(100000000, P_GPLL0_DIV, 3, 0, 0), 994 F(200000000, P_GPLL0, 3, 0, 0), 995 F(320000000, P_MMPLL4, 3, 0, 0), 996 F(384000000, P_MMPLL4, 2.5, 0, 0), 997 { } 998}; 999 1000static struct clk_rcg2 csiphy0_3p_clk_src = { 1001 .cmd_rcgr = 0x3240, 1002 .hid_width = 5, 1003 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1004 .freq_tbl = ftbl_csiphy0_3p_clk_src, 1005 .clkr.hw.init = &(struct clk_init_data){ 1006 .name = "csiphy0_3p_clk_src", 1007 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1008 .num_parents = 7, 1009 .ops = &clk_rcg2_ops, 1010 }, 1011}; 1012 1013static struct clk_rcg2 csiphy1_3p_clk_src = { 1014 .cmd_rcgr = 0x3260, 1015 .hid_width = 5, 1016 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1017 .freq_tbl = ftbl_csiphy0_3p_clk_src, 1018 .clkr.hw.init = &(struct clk_init_data){ 1019 .name = "csiphy1_3p_clk_src", 1020 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1021 .num_parents = 7, 1022 .ops = &clk_rcg2_ops, 1023 }, 1024}; 1025 1026static struct clk_rcg2 csiphy2_3p_clk_src = { 1027 .cmd_rcgr = 0x3280, 1028 .hid_width = 5, 1029 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1030 .freq_tbl = ftbl_csiphy0_3p_clk_src, 1031 .clkr.hw.init = &(struct clk_init_data){ 1032 .name = "csiphy2_3p_clk_src", 1033 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1034 .num_parents = 7, 1035 .ops = &clk_rcg2_ops, 1036 }, 1037}; 1038 1039static const struct freq_tbl ftbl_jpeg0_clk_src[] = { 1040 F(75000000, P_GPLL0_DIV, 4, 0, 0), 1041 F(150000000, P_GPLL0, 4, 0, 0), 1042 F(228571429, P_MMPLL0, 3.5, 0, 0), 1043 F(266666667, P_MMPLL0, 3, 0, 0), 1044 F(320000000, P_MMPLL0, 2.5, 0, 0), 1045 F(480000000, P_MMPLL4, 2, 0, 0), 1046 { } 1047}; 1048 1049static struct clk_rcg2 jpeg0_clk_src = { 1050 .cmd_rcgr = 0x3500, 1051 .hid_width = 5, 1052 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1053 .freq_tbl = ftbl_jpeg0_clk_src, 1054 .clkr.hw.init = &(struct clk_init_data){ 1055 .name = "jpeg0_clk_src", 1056 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1057 .num_parents = 7, 1058 .ops = &clk_rcg2_ops, 1059 }, 1060}; 1061 1062static const struct freq_tbl ftbl_jpeg2_clk_src[] = { 1063 F(75000000, P_GPLL0_DIV, 4, 0, 0), 1064 F(150000000, P_GPLL0, 4, 0, 0), 1065 F(228571429, P_MMPLL0, 3.5, 0, 0), 1066 F(266666667, P_MMPLL0, 3, 0, 0), 1067 F(320000000, P_MMPLL0, 2.5, 0, 0), 1068 { } 1069}; 1070 1071static struct clk_rcg2 jpeg2_clk_src = { 1072 .cmd_rcgr = 0x3540, 1073 .hid_width = 5, 1074 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1075 .freq_tbl = ftbl_jpeg2_clk_src, 1076 .clkr.hw.init = &(struct clk_init_data){ 1077 .name = "jpeg2_clk_src", 1078 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1079 .num_parents = 7, 1080 .ops = &clk_rcg2_ops, 1081 }, 1082}; 1083 1084static struct clk_rcg2 jpeg_dma_clk_src = { 1085 .cmd_rcgr = 0x3560, 1086 .hid_width = 5, 1087 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1088 .freq_tbl = ftbl_jpeg0_clk_src, 1089 .clkr.hw.init = &(struct clk_init_data){ 1090 .name = "jpeg_dma_clk_src", 1091 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1092 .num_parents = 7, 1093 .ops = &clk_rcg2_ops, 1094 }, 1095}; 1096 1097static const struct freq_tbl ftbl_vfe0_clk_src[] = { 1098 F(75000000, P_GPLL0_DIV, 4, 0, 0), 1099 F(100000000, P_GPLL0_DIV, 3, 0, 0), 1100 F(300000000, P_GPLL0, 2, 0, 0), 1101 F(320000000, P_MMPLL0, 2.5, 0, 0), 1102 F(480000000, P_MMPLL4, 2, 0, 0), 1103 F(600000000, P_GPLL0, 1, 0, 0), 1104 { } 1105}; 1106 1107static struct clk_rcg2 vfe0_clk_src = { 1108 .cmd_rcgr = 0x3600, 1109 .hid_width = 5, 1110 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1111 .freq_tbl = ftbl_vfe0_clk_src, 1112 .clkr.hw.init = &(struct clk_init_data){ 1113 .name = "vfe0_clk_src", 1114 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1115 .num_parents = 7, 1116 .ops = &clk_rcg2_ops, 1117 }, 1118}; 1119 1120static struct clk_rcg2 vfe1_clk_src = { 1121 .cmd_rcgr = 0x3620, 1122 .hid_width = 5, 1123 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1124 .freq_tbl = ftbl_vfe0_clk_src, 1125 .clkr.hw.init = &(struct clk_init_data){ 1126 .name = "vfe1_clk_src", 1127 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1128 .num_parents = 7, 1129 .ops = &clk_rcg2_ops, 1130 }, 1131}; 1132 1133static const struct freq_tbl ftbl_cpp_clk_src[] = { 1134 F(100000000, P_GPLL0_DIV, 3, 0, 0), 1135 F(200000000, P_GPLL0, 3, 0, 0), 1136 F(320000000, P_MMPLL0, 2.5, 0, 0), 1137 F(480000000, P_MMPLL4, 2, 0, 0), 1138 F(640000000, P_MMPLL4, 1.5, 0, 0), 1139 { } 1140}; 1141 1142static struct clk_rcg2 cpp_clk_src = { 1143 .cmd_rcgr = 0x3640, 1144 .hid_width = 5, 1145 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1146 .freq_tbl = ftbl_cpp_clk_src, 1147 .clkr.hw.init = &(struct clk_init_data){ 1148 .name = "cpp_clk_src", 1149 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1150 .num_parents = 7, 1151 .ops = &clk_rcg2_ops, 1152 }, 1153}; 1154 1155static const struct freq_tbl ftbl_csi0_clk_src[] = { 1156 F(100000000, P_GPLL0_DIV, 3, 0, 0), 1157 F(200000000, P_GPLL0, 3, 0, 0), 1158 F(266666667, P_MMPLL0, 3, 0, 0), 1159 F(480000000, P_MMPLL4, 2, 0, 0), 1160 F(600000000, P_GPLL0, 1, 0, 0), 1161 { } 1162}; 1163 1164static struct clk_rcg2 csi0_clk_src = { 1165 .cmd_rcgr = 0x3090, 1166 .hid_width = 5, 1167 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1168 .freq_tbl = ftbl_csi0_clk_src, 1169 .clkr.hw.init = &(struct clk_init_data){ 1170 .name = "csi0_clk_src", 1171 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1172 .num_parents = 7, 1173 .ops = &clk_rcg2_ops, 1174 }, 1175}; 1176 1177static struct clk_rcg2 csi1_clk_src = { 1178 .cmd_rcgr = 0x3100, 1179 .hid_width = 5, 1180 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1181 .freq_tbl = ftbl_csi0_clk_src, 1182 .clkr.hw.init = &(struct clk_init_data){ 1183 .name = "csi1_clk_src", 1184 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1185 .num_parents = 7, 1186 .ops = &clk_rcg2_ops, 1187 }, 1188}; 1189 1190static struct clk_rcg2 csi2_clk_src = { 1191 .cmd_rcgr = 0x3160, 1192 .hid_width = 5, 1193 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1194 .freq_tbl = ftbl_csi0_clk_src, 1195 .clkr.hw.init = &(struct clk_init_data){ 1196 .name = "csi2_clk_src", 1197 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1198 .num_parents = 7, 1199 .ops = &clk_rcg2_ops, 1200 }, 1201}; 1202 1203static struct clk_rcg2 csi3_clk_src = { 1204 .cmd_rcgr = 0x31c0, 1205 .hid_width = 5, 1206 .parent_map = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div_map, 1207 .freq_tbl = ftbl_csi0_clk_src, 1208 .clkr.hw.init = &(struct clk_init_data){ 1209 .name = "csi3_clk_src", 1210 .parent_names = mmss_xo_mmpll0_mmpll1_mmpll4_mmpll3_gpll0_gpll0_div, 1211 .num_parents = 7, 1212 .ops = &clk_rcg2_ops, 1213 }, 1214}; 1215 1216static const struct freq_tbl ftbl_fd_core_clk_src[] = { 1217 F(100000000, P_GPLL0_DIV, 3, 0, 0), 1218 F(200000000, P_GPLL0, 3, 0, 0), 1219 F(400000000, P_MMPLL0, 2, 0, 0), 1220 { } 1221}; 1222 1223static struct clk_rcg2 fd_core_clk_src = { 1224 .cmd_rcgr = 0x3b00, 1225 .hid_width = 5, 1226 .parent_map = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div_map, 1227 .freq_tbl = ftbl_fd_core_clk_src, 1228 .clkr.hw.init = &(struct clk_init_data){ 1229 .name = "fd_core_clk_src", 1230 .parent_names = mmss_xo_mmpll0_mmpll4_gpll0_gpll0_div, 1231 .num_parents = 5, 1232 .ops = &clk_rcg2_ops, 1233 }, 1234}; 1235 1236static struct clk_branch mmss_mmagic_ahb_clk = { 1237 .halt_reg = 0x5024, 1238 .clkr = { 1239 .enable_reg = 0x5024, 1240 .enable_mask = BIT(0), 1241 .hw.init = &(struct clk_init_data){ 1242 .name = "mmss_mmagic_ahb_clk", 1243 .parent_names = (const char *[]){ "ahb_clk_src" }, 1244 .num_parents = 1, 1245 .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 1246 .ops = &clk_branch2_ops, 1247 }, 1248 }, 1249}; 1250 1251static struct clk_branch mmss_mmagic_cfg_ahb_clk = { 1252 .halt_reg = 0x5054, 1253 .clkr = { 1254 .enable_reg = 0x5054, 1255 .enable_mask = BIT(0), 1256 .hw.init = &(struct clk_init_data){ 1257 .name = "mmss_mmagic_cfg_ahb_clk", 1258 .parent_names = (const char *[]){ "ahb_clk_src" }, 1259 .num_parents = 1, 1260 .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 1261 .ops = &clk_branch2_ops, 1262 }, 1263 }, 1264}; 1265 1266static struct clk_branch mmss_misc_ahb_clk = { 1267 .halt_reg = 0x5018, 1268 .clkr = { 1269 .enable_reg = 0x5018, 1270 .enable_mask = BIT(0), 1271 .hw.init = &(struct clk_init_data){ 1272 .name = "mmss_misc_ahb_clk", 1273 .parent_names = (const char *[]){ "ahb_clk_src" }, 1274 .num_parents = 1, 1275 .flags = CLK_SET_RATE_PARENT, 1276 .ops = &clk_branch2_ops, 1277 }, 1278 }, 1279}; 1280 1281static struct clk_branch mmss_misc_cxo_clk = { 1282 .halt_reg = 0x5014, 1283 .clkr = { 1284 .enable_reg = 0x5014, 1285 .enable_mask = BIT(0), 1286 .hw.init = &(struct clk_init_data){ 1287 .name = "mmss_misc_cxo_clk", 1288 .parent_names = (const char *[]){ "xo" }, 1289 .num_parents = 1, 1290 .ops = &clk_branch2_ops, 1291 }, 1292 }, 1293}; 1294 1295static struct clk_branch mmss_mmagic_maxi_clk = { 1296 .halt_reg = 0x5074, 1297 .clkr = { 1298 .enable_reg = 0x5074, 1299 .enable_mask = BIT(0), 1300 .hw.init = &(struct clk_init_data){ 1301 .name = "mmss_mmagic_maxi_clk", 1302 .parent_names = (const char *[]){ "maxi_clk_src" }, 1303 .num_parents = 1, 1304 .flags = CLK_SET_RATE_PARENT, 1305 .ops = &clk_branch2_ops, 1306 }, 1307 }, 1308}; 1309 1310static struct clk_branch mmagic_camss_axi_clk = { 1311 .halt_reg = 0x3c44, 1312 .clkr = { 1313 .enable_reg = 0x3c44, 1314 .enable_mask = BIT(0), 1315 .hw.init = &(struct clk_init_data){ 1316 .name = "mmagic_camss_axi_clk", 1317 .parent_names = (const char *[]){ "axi_clk_src" }, 1318 .num_parents = 1, 1319 .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 1320 .ops = &clk_branch2_ops, 1321 }, 1322 }, 1323}; 1324 1325static struct clk_branch mmagic_camss_noc_cfg_ahb_clk = { 1326 .halt_reg = 0x3c48, 1327 .clkr = { 1328 .enable_reg = 0x3c48, 1329 .enable_mask = BIT(0), 1330 .hw.init = &(struct clk_init_data){ 1331 .name = "mmagic_camss_noc_cfg_ahb_clk", 1332 .parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" }, 1333 .num_parents = 1, 1334 .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 1335 .ops = &clk_branch2_ops, 1336 }, 1337 }, 1338}; 1339 1340static struct clk_branch smmu_vfe_ahb_clk = { 1341 .halt_reg = 0x3c04, 1342 .clkr = { 1343 .enable_reg = 0x3c04, 1344 .enable_mask = BIT(0), 1345 .hw.init = &(struct clk_init_data){ 1346 .name = "smmu_vfe_ahb_clk", 1347 .parent_names = (const char *[]){ "ahb_clk_src" }, 1348 .num_parents = 1, 1349 .flags = CLK_SET_RATE_PARENT, 1350 .ops = &clk_branch2_ops, 1351 }, 1352 }, 1353}; 1354 1355static struct clk_branch smmu_vfe_axi_clk = { 1356 .halt_reg = 0x3c08, 1357 .clkr = { 1358 .enable_reg = 0x3c08, 1359 .enable_mask = BIT(0), 1360 .hw.init = &(struct clk_init_data){ 1361 .name = "smmu_vfe_axi_clk", 1362 .parent_names = (const char *[]){ "axi_clk_src" }, 1363 .num_parents = 1, 1364 .flags = CLK_SET_RATE_PARENT, 1365 .ops = &clk_branch2_ops, 1366 }, 1367 }, 1368}; 1369 1370static struct clk_branch smmu_cpp_ahb_clk = { 1371 .halt_reg = 0x3c14, 1372 .clkr = { 1373 .enable_reg = 0x3c14, 1374 .enable_mask = BIT(0), 1375 .hw.init = &(struct clk_init_data){ 1376 .name = "smmu_cpp_ahb_clk", 1377 .parent_names = (const char *[]){ "ahb_clk_src" }, 1378 .num_parents = 1, 1379 .flags = CLK_SET_RATE_PARENT, 1380 .ops = &clk_branch2_ops, 1381 }, 1382 }, 1383}; 1384 1385static struct clk_branch smmu_cpp_axi_clk = { 1386 .halt_reg = 0x3c18, 1387 .clkr = { 1388 .enable_reg = 0x3c18, 1389 .enable_mask = BIT(0), 1390 .hw.init = &(struct clk_init_data){ 1391 .name = "smmu_cpp_axi_clk", 1392 .parent_names = (const char *[]){ "axi_clk_src" }, 1393 .num_parents = 1, 1394 .flags = CLK_SET_RATE_PARENT, 1395 .ops = &clk_branch2_ops, 1396 }, 1397 }, 1398}; 1399 1400static struct clk_branch smmu_jpeg_ahb_clk = { 1401 .halt_reg = 0x3c24, 1402 .clkr = { 1403 .enable_reg = 0x3c24, 1404 .enable_mask = BIT(0), 1405 .hw.init = &(struct clk_init_data){ 1406 .name = "smmu_jpeg_ahb_clk", 1407 .parent_names = (const char *[]){ "ahb_clk_src" }, 1408 .num_parents = 1, 1409 .flags = CLK_SET_RATE_PARENT, 1410 .ops = &clk_branch2_ops, 1411 }, 1412 }, 1413}; 1414 1415static struct clk_branch smmu_jpeg_axi_clk = { 1416 .halt_reg = 0x3c28, 1417 .clkr = { 1418 .enable_reg = 0x3c28, 1419 .enable_mask = BIT(0), 1420 .hw.init = &(struct clk_init_data){ 1421 .name = "smmu_jpeg_axi_clk", 1422 .parent_names = (const char *[]){ "axi_clk_src" }, 1423 .num_parents = 1, 1424 .flags = CLK_SET_RATE_PARENT, 1425 .ops = &clk_branch2_ops, 1426 }, 1427 }, 1428}; 1429 1430static struct clk_branch mmagic_mdss_axi_clk = { 1431 .halt_reg = 0x2474, 1432 .clkr = { 1433 .enable_reg = 0x2474, 1434 .enable_mask = BIT(0), 1435 .hw.init = &(struct clk_init_data){ 1436 .name = "mmagic_mdss_axi_clk", 1437 .parent_names = (const char *[]){ "axi_clk_src" }, 1438 .num_parents = 1, 1439 .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 1440 .ops = &clk_branch2_ops, 1441 }, 1442 }, 1443}; 1444 1445static struct clk_branch mmagic_mdss_noc_cfg_ahb_clk = { 1446 .halt_reg = 0x2478, 1447 .clkr = { 1448 .enable_reg = 0x2478, 1449 .enable_mask = BIT(0), 1450 .hw.init = &(struct clk_init_data){ 1451 .name = "mmagic_mdss_noc_cfg_ahb_clk", 1452 .parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" }, 1453 .num_parents = 1, 1454 .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 1455 .ops = &clk_branch2_ops, 1456 }, 1457 }, 1458}; 1459 1460static struct clk_branch smmu_rot_ahb_clk = { 1461 .halt_reg = 0x2444, 1462 .clkr = { 1463 .enable_reg = 0x2444, 1464 .enable_mask = BIT(0), 1465 .hw.init = &(struct clk_init_data){ 1466 .name = "smmu_rot_ahb_clk", 1467 .parent_names = (const char *[]){ "ahb_clk_src" }, 1468 .num_parents = 1, 1469 .flags = CLK_SET_RATE_PARENT, 1470 .ops = &clk_branch2_ops, 1471 }, 1472 }, 1473}; 1474 1475static struct clk_branch smmu_rot_axi_clk = { 1476 .halt_reg = 0x2448, 1477 .clkr = { 1478 .enable_reg = 0x2448, 1479 .enable_mask = BIT(0), 1480 .hw.init = &(struct clk_init_data){ 1481 .name = "smmu_rot_axi_clk", 1482 .parent_names = (const char *[]){ "axi_clk_src" }, 1483 .num_parents = 1, 1484 .flags = CLK_SET_RATE_PARENT, 1485 .ops = &clk_branch2_ops, 1486 }, 1487 }, 1488}; 1489 1490static struct clk_branch smmu_mdp_ahb_clk = { 1491 .halt_reg = 0x2454, 1492 .clkr = { 1493 .enable_reg = 0x2454, 1494 .enable_mask = BIT(0), 1495 .hw.init = &(struct clk_init_data){ 1496 .name = "smmu_mdp_ahb_clk", 1497 .parent_names = (const char *[]){ "ahb_clk_src" }, 1498 .num_parents = 1, 1499 .flags = CLK_SET_RATE_PARENT, 1500 .ops = &clk_branch2_ops, 1501 }, 1502 }, 1503}; 1504 1505static struct clk_branch smmu_mdp_axi_clk = { 1506 .halt_reg = 0x2458, 1507 .clkr = { 1508 .enable_reg = 0x2458, 1509 .enable_mask = BIT(0), 1510 .hw.init = &(struct clk_init_data){ 1511 .name = "smmu_mdp_axi_clk", 1512 .parent_names = (const char *[]){ "axi_clk_src" }, 1513 .num_parents = 1, 1514 .flags = CLK_SET_RATE_PARENT, 1515 .ops = &clk_branch2_ops, 1516 }, 1517 }, 1518}; 1519 1520static struct clk_branch mmagic_video_axi_clk = { 1521 .halt_reg = 0x1194, 1522 .clkr = { 1523 .enable_reg = 0x1194, 1524 .enable_mask = BIT(0), 1525 .hw.init = &(struct clk_init_data){ 1526 .name = "mmagic_video_axi_clk", 1527 .parent_names = (const char *[]){ "axi_clk_src" }, 1528 .num_parents = 1, 1529 .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 1530 .ops = &clk_branch2_ops, 1531 }, 1532 }, 1533}; 1534 1535static struct clk_branch mmagic_video_noc_cfg_ahb_clk = { 1536 .halt_reg = 0x1198, 1537 .clkr = { 1538 .enable_reg = 0x1198, 1539 .enable_mask = BIT(0), 1540 .hw.init = &(struct clk_init_data){ 1541 .name = "mmagic_video_noc_cfg_ahb_clk", 1542 .parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" }, 1543 .num_parents = 1, 1544 .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 1545 .ops = &clk_branch2_ops, 1546 }, 1547 }, 1548}; 1549 1550static struct clk_branch smmu_video_ahb_clk = { 1551 .halt_reg = 0x1174, 1552 .clkr = { 1553 .enable_reg = 0x1174, 1554 .enable_mask = BIT(0), 1555 .hw.init = &(struct clk_init_data){ 1556 .name = "smmu_video_ahb_clk", 1557 .parent_names = (const char *[]){ "ahb_clk_src" }, 1558 .num_parents = 1, 1559 .flags = CLK_SET_RATE_PARENT, 1560 .ops = &clk_branch2_ops, 1561 }, 1562 }, 1563}; 1564 1565static struct clk_branch smmu_video_axi_clk = { 1566 .halt_reg = 0x1178, 1567 .clkr = { 1568 .enable_reg = 0x1178, 1569 .enable_mask = BIT(0), 1570 .hw.init = &(struct clk_init_data){ 1571 .name = "smmu_video_axi_clk", 1572 .parent_names = (const char *[]){ "axi_clk_src" }, 1573 .num_parents = 1, 1574 .flags = CLK_SET_RATE_PARENT, 1575 .ops = &clk_branch2_ops, 1576 }, 1577 }, 1578}; 1579 1580static struct clk_branch mmagic_bimc_noc_cfg_ahb_clk = { 1581 .halt_reg = 0x5298, 1582 .clkr = { 1583 .enable_reg = 0x5298, 1584 .enable_mask = BIT(0), 1585 .hw.init = &(struct clk_init_data){ 1586 .name = "mmagic_bimc_noc_cfg_ahb_clk", 1587 .parent_names = (const char *[]){ "gcc_mmss_noc_cfg_ahb_clk" }, 1588 .num_parents = 1, 1589 .flags = CLK_SET_RATE_PARENT, 1590 .ops = &clk_branch2_ops, 1591 }, 1592 }, 1593}; 1594 1595static struct clk_branch gpu_gx_gfx3d_clk = { 1596 .halt_reg = 0x4028, 1597 .clkr = { 1598 .enable_reg = 0x4028, 1599 .enable_mask = BIT(0), 1600 .hw.init = &(struct clk_init_data){ 1601 .name = "gpu_gx_gfx3d_clk", 1602 .parent_names = (const char *[]){ "gfx3d_clk_src" }, 1603 .num_parents = 1, 1604 .flags = CLK_SET_RATE_PARENT, 1605 .ops = &clk_branch2_ops, 1606 }, 1607 }, 1608}; 1609 1610static struct clk_branch gpu_gx_rbbmtimer_clk = { 1611 .halt_reg = 0x40b0, 1612 .clkr = { 1613 .enable_reg = 0x40b0, 1614 .enable_mask = BIT(0), 1615 .hw.init = &(struct clk_init_data){ 1616 .name = "gpu_gx_rbbmtimer_clk", 1617 .parent_names = (const char *[]){ "rbbmtimer_clk_src" }, 1618 .num_parents = 1, 1619 .flags = CLK_SET_RATE_PARENT, 1620 .ops = &clk_branch2_ops, 1621 }, 1622 }, 1623}; 1624 1625static struct clk_branch gpu_ahb_clk = { 1626 .halt_reg = 0x403c, 1627 .clkr = { 1628 .enable_reg = 0x403c, 1629 .enable_mask = BIT(0), 1630 .hw.init = &(struct clk_init_data){ 1631 .name = "gpu_ahb_clk", 1632 .parent_names = (const char *[]){ "ahb_clk_src" }, 1633 .num_parents = 1, 1634 .flags = CLK_SET_RATE_PARENT, 1635 .ops = &clk_branch2_ops, 1636 }, 1637 }, 1638}; 1639 1640static struct clk_branch gpu_aon_isense_clk = { 1641 .halt_reg = 0x4044, 1642 .clkr = { 1643 .enable_reg = 0x4044, 1644 .enable_mask = BIT(0), 1645 .hw.init = &(struct clk_init_data){ 1646 .name = "gpu_aon_isense_clk", 1647 .parent_names = (const char *[]){ "isense_clk_src" }, 1648 .num_parents = 1, 1649 .flags = CLK_SET_RATE_PARENT, 1650 .ops = &clk_branch2_ops, 1651 }, 1652 }, 1653}; 1654 1655static struct clk_branch vmem_maxi_clk = { 1656 .halt_reg = 0x1204, 1657 .clkr = { 1658 .enable_reg = 0x1204, 1659 .enable_mask = BIT(0), 1660 .hw.init = &(struct clk_init_data){ 1661 .name = "vmem_maxi_clk", 1662 .parent_names = (const char *[]){ "maxi_clk_src" }, 1663 .num_parents = 1, 1664 .flags = CLK_SET_RATE_PARENT, 1665 .ops = &clk_branch2_ops, 1666 }, 1667 }, 1668}; 1669 1670static struct clk_branch vmem_ahb_clk = { 1671 .halt_reg = 0x1208, 1672 .clkr = { 1673 .enable_reg = 0x1208, 1674 .enable_mask = BIT(0), 1675 .hw.init = &(struct clk_init_data){ 1676 .name = "vmem_ahb_clk", 1677 .parent_names = (const char *[]){ "ahb_clk_src" }, 1678 .num_parents = 1, 1679 .flags = CLK_SET_RATE_PARENT, 1680 .ops = &clk_branch2_ops, 1681 }, 1682 }, 1683}; 1684 1685static struct clk_branch mmss_rbcpr_clk = { 1686 .halt_reg = 0x4084, 1687 .clkr = { 1688 .enable_reg = 0x4084, 1689 .enable_mask = BIT(0), 1690 .hw.init = &(struct clk_init_data){ 1691 .name = "mmss_rbcpr_clk", 1692 .parent_names = (const char *[]){ "rbcpr_clk_src" }, 1693 .num_parents = 1, 1694 .flags = CLK_SET_RATE_PARENT, 1695 .ops = &clk_branch2_ops, 1696 }, 1697 }, 1698}; 1699 1700static struct clk_branch mmss_rbcpr_ahb_clk = { 1701 .halt_reg = 0x4088, 1702 .clkr = { 1703 .enable_reg = 0x4088, 1704 .enable_mask = BIT(0), 1705 .hw.init = &(struct clk_init_data){ 1706 .name = "mmss_rbcpr_ahb_clk", 1707 .parent_names = (const char *[]){ "ahb_clk_src" }, 1708 .num_parents = 1, 1709 .flags = CLK_SET_RATE_PARENT, 1710 .ops = &clk_branch2_ops, 1711 }, 1712 }, 1713}; 1714 1715static struct clk_branch video_core_clk = { 1716 .halt_reg = 0x1028, 1717 .clkr = { 1718 .enable_reg = 0x1028, 1719 .enable_mask = BIT(0), 1720 .hw.init = &(struct clk_init_data){ 1721 .name = "video_core_clk", 1722 .parent_names = (const char *[]){ "video_core_clk_src" }, 1723 .num_parents = 1, 1724 .flags = CLK_SET_RATE_PARENT, 1725 .ops = &clk_branch2_ops, 1726 }, 1727 }, 1728}; 1729 1730static struct clk_branch video_axi_clk = { 1731 .halt_reg = 0x1034, 1732 .clkr = { 1733 .enable_reg = 0x1034, 1734 .enable_mask = BIT(0), 1735 .hw.init = &(struct clk_init_data){ 1736 .name = "video_axi_clk", 1737 .parent_names = (const char *[]){ "axi_clk_src" }, 1738 .num_parents = 1, 1739 .flags = CLK_SET_RATE_PARENT, 1740 .ops = &clk_branch2_ops, 1741 }, 1742 }, 1743}; 1744 1745static struct clk_branch video_maxi_clk = { 1746 .halt_reg = 0x1038, 1747 .clkr = { 1748 .enable_reg = 0x1038, 1749 .enable_mask = BIT(0), 1750 .hw.init = &(struct clk_init_data){ 1751 .name = "video_maxi_clk", 1752 .parent_names = (const char *[]){ "maxi_clk_src" }, 1753 .num_parents = 1, 1754 .flags = CLK_SET_RATE_PARENT, 1755 .ops = &clk_branch2_ops, 1756 }, 1757 }, 1758}; 1759 1760static struct clk_branch video_ahb_clk = { 1761 .halt_reg = 0x1030, 1762 .clkr = { 1763 .enable_reg = 0x1030, 1764 .enable_mask = BIT(0), 1765 .hw.init = &(struct clk_init_data){ 1766 .name = "video_ahb_clk", 1767 .parent_names = (const char *[]){ "ahb_clk_src" }, 1768 .num_parents = 1, 1769 .flags = CLK_SET_RATE_PARENT, 1770 .ops = &clk_branch2_ops, 1771 }, 1772 }, 1773}; 1774 1775static struct clk_branch video_subcore0_clk = { 1776 .halt_reg = 0x1048, 1777 .clkr = { 1778 .enable_reg = 0x1048, 1779 .enable_mask = BIT(0), 1780 .hw.init = &(struct clk_init_data){ 1781 .name = "video_subcore0_clk", 1782 .parent_names = (const char *[]){ "video_subcore0_clk_src" }, 1783 .num_parents = 1, 1784 .flags = CLK_SET_RATE_PARENT, 1785 .ops = &clk_branch2_ops, 1786 }, 1787 }, 1788}; 1789 1790static struct clk_branch video_subcore1_clk = { 1791 .halt_reg = 0x104c, 1792 .clkr = { 1793 .enable_reg = 0x104c, 1794 .enable_mask = BIT(0), 1795 .hw.init = &(struct clk_init_data){ 1796 .name = "video_subcore1_clk", 1797 .parent_names = (const char *[]){ "video_subcore1_clk_src" }, 1798 .num_parents = 1, 1799 .flags = CLK_SET_RATE_PARENT, 1800 .ops = &clk_branch2_ops, 1801 }, 1802 }, 1803}; 1804 1805static struct clk_branch mdss_ahb_clk = { 1806 .halt_reg = 0x2308, 1807 .clkr = { 1808 .enable_reg = 0x2308, 1809 .enable_mask = BIT(0), 1810 .hw.init = &(struct clk_init_data){ 1811 .name = "mdss_ahb_clk", 1812 .parent_names = (const char *[]){ "ahb_clk_src" }, 1813 .num_parents = 1, 1814 .flags = CLK_SET_RATE_PARENT, 1815 .ops = &clk_branch2_ops, 1816 }, 1817 }, 1818}; 1819 1820static struct clk_branch mdss_hdmi_ahb_clk = { 1821 .halt_reg = 0x230c, 1822 .clkr = { 1823 .enable_reg = 0x230c, 1824 .enable_mask = BIT(0), 1825 .hw.init = &(struct clk_init_data){ 1826 .name = "mdss_hdmi_ahb_clk", 1827 .parent_names = (const char *[]){ "ahb_clk_src" }, 1828 .num_parents = 1, 1829 .flags = CLK_SET_RATE_PARENT, 1830 .ops = &clk_branch2_ops, 1831 }, 1832 }, 1833}; 1834 1835static struct clk_branch mdss_axi_clk = { 1836 .halt_reg = 0x2310, 1837 .clkr = { 1838 .enable_reg = 0x2310, 1839 .enable_mask = BIT(0), 1840 .hw.init = &(struct clk_init_data){ 1841 .name = "mdss_axi_clk", 1842 .parent_names = (const char *[]){ "axi_clk_src" }, 1843 .num_parents = 1, 1844 .flags = CLK_SET_RATE_PARENT, 1845 .ops = &clk_branch2_ops, 1846 }, 1847 }, 1848}; 1849 1850static struct clk_branch mdss_pclk0_clk = { 1851 .halt_reg = 0x2314, 1852 .clkr = { 1853 .enable_reg = 0x2314, 1854 .enable_mask = BIT(0), 1855 .hw.init = &(struct clk_init_data){ 1856 .name = "mdss_pclk0_clk", 1857 .parent_names = (const char *[]){ "pclk0_clk_src" }, 1858 .num_parents = 1, 1859 .flags = CLK_SET_RATE_PARENT, 1860 .ops = &clk_branch2_ops, 1861 }, 1862 }, 1863}; 1864 1865static struct clk_branch mdss_pclk1_clk = { 1866 .halt_reg = 0x2318, 1867 .clkr = { 1868 .enable_reg = 0x2318, 1869 .enable_mask = BIT(0), 1870 .hw.init = &(struct clk_init_data){ 1871 .name = "mdss_pclk1_clk", 1872 .parent_names = (const char *[]){ "pclk1_clk_src" }, 1873 .num_parents = 1, 1874 .flags = CLK_SET_RATE_PARENT, 1875 .ops = &clk_branch2_ops, 1876 }, 1877 }, 1878}; 1879 1880static struct clk_branch mdss_mdp_clk = { 1881 .halt_reg = 0x231c, 1882 .clkr = { 1883 .enable_reg = 0x231c, 1884 .enable_mask = BIT(0), 1885 .hw.init = &(struct clk_init_data){ 1886 .name = "mdss_mdp_clk", 1887 .parent_names = (const char *[]){ "mdp_clk_src" }, 1888 .num_parents = 1, 1889 .flags = CLK_SET_RATE_PARENT, 1890 .ops = &clk_branch2_ops, 1891 }, 1892 }, 1893}; 1894 1895static struct clk_branch mdss_extpclk_clk = { 1896 .halt_reg = 0x2324, 1897 .clkr = { 1898 .enable_reg = 0x2324, 1899 .enable_mask = BIT(0), 1900 .hw.init = &(struct clk_init_data){ 1901 .name = "mdss_extpclk_clk", 1902 .parent_names = (const char *[]){ "extpclk_clk_src" }, 1903 .num_parents = 1, 1904 .flags = CLK_SET_RATE_PARENT, 1905 .ops = &clk_branch2_ops, 1906 }, 1907 }, 1908}; 1909 1910static struct clk_branch mdss_vsync_clk = { 1911 .halt_reg = 0x2328, 1912 .clkr = { 1913 .enable_reg = 0x2328, 1914 .enable_mask = BIT(0), 1915 .hw.init = &(struct clk_init_data){ 1916 .name = "mdss_vsync_clk", 1917 .parent_names = (const char *[]){ "vsync_clk_src" }, 1918 .num_parents = 1, 1919 .flags = CLK_SET_RATE_PARENT, 1920 .ops = &clk_branch2_ops, 1921 }, 1922 }, 1923}; 1924 1925static struct clk_branch mdss_hdmi_clk = { 1926 .halt_reg = 0x2338, 1927 .clkr = { 1928 .enable_reg = 0x2338, 1929 .enable_mask = BIT(0), 1930 .hw.init = &(struct clk_init_data){ 1931 .name = "mdss_hdmi_clk", 1932 .parent_names = (const char *[]){ "hdmi_clk_src" }, 1933 .num_parents = 1, 1934 .flags = CLK_SET_RATE_PARENT, 1935 .ops = &clk_branch2_ops, 1936 }, 1937 }, 1938}; 1939 1940static struct clk_branch mdss_byte0_clk = { 1941 .halt_reg = 0x233c, 1942 .clkr = { 1943 .enable_reg = 0x233c, 1944 .enable_mask = BIT(0), 1945 .hw.init = &(struct clk_init_data){ 1946 .name = "mdss_byte0_clk", 1947 .parent_names = (const char *[]){ "byte0_clk_src" }, 1948 .num_parents = 1, 1949 .flags = CLK_SET_RATE_PARENT, 1950 .ops = &clk_branch2_ops, 1951 }, 1952 }, 1953}; 1954 1955static struct clk_branch mdss_byte1_clk = { 1956 .halt_reg = 0x2340, 1957 .clkr = { 1958 .enable_reg = 0x2340, 1959 .enable_mask = BIT(0), 1960 .hw.init = &(struct clk_init_data){ 1961 .name = "mdss_byte1_clk", 1962 .parent_names = (const char *[]){ "byte1_clk_src" }, 1963 .num_parents = 1, 1964 .flags = CLK_SET_RATE_PARENT, 1965 .ops = &clk_branch2_ops, 1966 }, 1967 }, 1968}; 1969 1970static struct clk_branch mdss_esc0_clk = { 1971 .halt_reg = 0x2344, 1972 .clkr = { 1973 .enable_reg = 0x2344, 1974 .enable_mask = BIT(0), 1975 .hw.init = &(struct clk_init_data){ 1976 .name = "mdss_esc0_clk", 1977 .parent_names = (const char *[]){ "esc0_clk_src" }, 1978 .num_parents = 1, 1979 .flags = CLK_SET_RATE_PARENT, 1980 .ops = &clk_branch2_ops, 1981 }, 1982 }, 1983}; 1984 1985static struct clk_branch mdss_esc1_clk = { 1986 .halt_reg = 0x2348, 1987 .clkr = { 1988 .enable_reg = 0x2348, 1989 .enable_mask = BIT(0), 1990 .hw.init = &(struct clk_init_data){ 1991 .name = "mdss_esc1_clk", 1992 .parent_names = (const char *[]){ "esc1_clk_src" }, 1993 .num_parents = 1, 1994 .flags = CLK_SET_RATE_PARENT, 1995 .ops = &clk_branch2_ops, 1996 }, 1997 }, 1998}; 1999 2000static struct clk_branch camss_top_ahb_clk = { 2001 .halt_reg = 0x3484, 2002 .clkr = { 2003 .enable_reg = 0x3484, 2004 .enable_mask = BIT(0), 2005 .hw.init = &(struct clk_init_data){ 2006 .name = "camss_top_ahb_clk", 2007 .parent_names = (const char *[]){ "ahb_clk_src" }, 2008 .num_parents = 1, 2009 .flags = CLK_SET_RATE_PARENT, 2010 .ops = &clk_branch2_ops, 2011 }, 2012 }, 2013}; 2014 2015static struct clk_branch camss_ahb_clk = { 2016 .halt_reg = 0x348c, 2017 .clkr = { 2018 .enable_reg = 0x348c, 2019 .enable_mask = BIT(0), 2020 .hw.init = &(struct clk_init_data){ 2021 .name = "camss_ahb_clk", 2022 .parent_names = (const char *[]){ "ahb_clk_src" }, 2023 .num_parents = 1, 2024 .flags = CLK_SET_RATE_PARENT, 2025 .ops = &clk_branch2_ops, 2026 }, 2027 }, 2028}; 2029 2030static struct clk_branch camss_micro_ahb_clk = { 2031 .halt_reg = 0x3494, 2032 .clkr = { 2033 .enable_reg = 0x3494, 2034 .enable_mask = BIT(0), 2035 .hw.init = &(struct clk_init_data){ 2036 .name = "camss_micro_ahb_clk", 2037 .parent_names = (const char *[]){ "ahb_clk_src" }, 2038 .num_parents = 1, 2039 .flags = CLK_SET_RATE_PARENT, 2040 .ops = &clk_branch2_ops, 2041 }, 2042 }, 2043}; 2044 2045static struct clk_branch camss_gp0_clk = { 2046 .halt_reg = 0x3444, 2047 .clkr = { 2048 .enable_reg = 0x3444, 2049 .enable_mask = BIT(0), 2050 .hw.init = &(struct clk_init_data){ 2051 .name = "camss_gp0_clk", 2052 .parent_names = (const char *[]){ "camss_gp0_clk_src" }, 2053 .num_parents = 1, 2054 .flags = CLK_SET_RATE_PARENT, 2055 .ops = &clk_branch2_ops, 2056 }, 2057 }, 2058}; 2059 2060static struct clk_branch camss_gp1_clk = { 2061 .halt_reg = 0x3474, 2062 .clkr = { 2063 .enable_reg = 0x3474, 2064 .enable_mask = BIT(0), 2065 .hw.init = &(struct clk_init_data){ 2066 .name = "camss_gp1_clk", 2067 .parent_names = (const char *[]){ "camss_gp1_clk_src" }, 2068 .num_parents = 1, 2069 .flags = CLK_SET_RATE_PARENT, 2070 .ops = &clk_branch2_ops, 2071 }, 2072 }, 2073}; 2074 2075static struct clk_branch camss_mclk0_clk = { 2076 .halt_reg = 0x3384, 2077 .clkr = { 2078 .enable_reg = 0x3384, 2079 .enable_mask = BIT(0), 2080 .hw.init = &(struct clk_init_data){ 2081 .name = "camss_mclk0_clk", 2082 .parent_names = (const char *[]){ "mclk0_clk_src" }, 2083 .num_parents = 1, 2084 .flags = CLK_SET_RATE_PARENT, 2085 .ops = &clk_branch2_ops, 2086 }, 2087 }, 2088}; 2089 2090static struct clk_branch camss_mclk1_clk = { 2091 .halt_reg = 0x33b4, 2092 .clkr = { 2093 .enable_reg = 0x33b4, 2094 .enable_mask = BIT(0), 2095 .hw.init = &(struct clk_init_data){ 2096 .name = "camss_mclk1_clk", 2097 .parent_names = (const char *[]){ "mclk1_clk_src" }, 2098 .num_parents = 1, 2099 .flags = CLK_SET_RATE_PARENT, 2100 .ops = &clk_branch2_ops, 2101 }, 2102 }, 2103}; 2104 2105static struct clk_branch camss_mclk2_clk = { 2106 .halt_reg = 0x33e4, 2107 .clkr = { 2108 .enable_reg = 0x33e4, 2109 .enable_mask = BIT(0), 2110 .hw.init = &(struct clk_init_data){ 2111 .name = "camss_mclk2_clk", 2112 .parent_names = (const char *[]){ "mclk2_clk_src" }, 2113 .num_parents = 1, 2114 .flags = CLK_SET_RATE_PARENT, 2115 .ops = &clk_branch2_ops, 2116 }, 2117 }, 2118}; 2119 2120static struct clk_branch camss_mclk3_clk = { 2121 .halt_reg = 0x3414, 2122 .clkr = { 2123 .enable_reg = 0x3414, 2124 .enable_mask = BIT(0), 2125 .hw.init = &(struct clk_init_data){ 2126 .name = "camss_mclk3_clk", 2127 .parent_names = (const char *[]){ "mclk3_clk_src" }, 2128 .num_parents = 1, 2129 .flags = CLK_SET_RATE_PARENT, 2130 .ops = &clk_branch2_ops, 2131 }, 2132 }, 2133}; 2134 2135static struct clk_branch camss_cci_clk = { 2136 .halt_reg = 0x3344, 2137 .clkr = { 2138 .enable_reg = 0x3344, 2139 .enable_mask = BIT(0), 2140 .hw.init = &(struct clk_init_data){ 2141 .name = "camss_cci_clk", 2142 .parent_names = (const char *[]){ "cci_clk_src" }, 2143 .num_parents = 1, 2144 .flags = CLK_SET_RATE_PARENT, 2145 .ops = &clk_branch2_ops, 2146 }, 2147 }, 2148}; 2149 2150static struct clk_branch camss_cci_ahb_clk = { 2151 .halt_reg = 0x3348, 2152 .clkr = { 2153 .enable_reg = 0x3348, 2154 .enable_mask = BIT(0), 2155 .hw.init = &(struct clk_init_data){ 2156 .name = "camss_cci_ahb_clk", 2157 .parent_names = (const char *[]){ "ahb_clk_src" }, 2158 .num_parents = 1, 2159 .flags = CLK_SET_RATE_PARENT, 2160 .ops = &clk_branch2_ops, 2161 }, 2162 }, 2163}; 2164 2165static struct clk_branch camss_csi0phytimer_clk = { 2166 .halt_reg = 0x3024, 2167 .clkr = { 2168 .enable_reg = 0x3024, 2169 .enable_mask = BIT(0), 2170 .hw.init = &(struct clk_init_data){ 2171 .name = "camss_csi0phytimer_clk", 2172 .parent_names = (const char *[]){ "csi0phytimer_clk_src" }, 2173 .num_parents = 1, 2174 .flags = CLK_SET_RATE_PARENT, 2175 .ops = &clk_branch2_ops, 2176 }, 2177 }, 2178}; 2179 2180static struct clk_branch camss_csi1phytimer_clk = { 2181 .halt_reg = 0x3054, 2182 .clkr = { 2183 .enable_reg = 0x3054, 2184 .enable_mask = BIT(0), 2185 .hw.init = &(struct clk_init_data){ 2186 .name = "camss_csi1phytimer_clk", 2187 .parent_names = (const char *[]){ "csi1phytimer_clk_src" }, 2188 .num_parents = 1, 2189 .flags = CLK_SET_RATE_PARENT, 2190 .ops = &clk_branch2_ops, 2191 }, 2192 }, 2193}; 2194 2195static struct clk_branch camss_csi2phytimer_clk = { 2196 .halt_reg = 0x3084, 2197 .clkr = { 2198 .enable_reg = 0x3084, 2199 .enable_mask = BIT(0), 2200 .hw.init = &(struct clk_init_data){ 2201 .name = "camss_csi2phytimer_clk", 2202 .parent_names = (const char *[]){ "csi2phytimer_clk_src" }, 2203 .num_parents = 1, 2204 .flags = CLK_SET_RATE_PARENT, 2205 .ops = &clk_branch2_ops, 2206 }, 2207 }, 2208}; 2209 2210static struct clk_branch camss_csiphy0_3p_clk = { 2211 .halt_reg = 0x3234, 2212 .clkr = { 2213 .enable_reg = 0x3234, 2214 .enable_mask = BIT(0), 2215 .hw.init = &(struct clk_init_data){ 2216 .name = "camss_csiphy0_3p_clk", 2217 .parent_names = (const char *[]){ "csiphy0_3p_clk_src" }, 2218 .num_parents = 1, 2219 .flags = CLK_SET_RATE_PARENT, 2220 .ops = &clk_branch2_ops, 2221 }, 2222 }, 2223}; 2224 2225static struct clk_branch camss_csiphy1_3p_clk = { 2226 .halt_reg = 0x3254, 2227 .clkr = { 2228 .enable_reg = 0x3254, 2229 .enable_mask = BIT(0), 2230 .hw.init = &(struct clk_init_data){ 2231 .name = "camss_csiphy1_3p_clk", 2232 .parent_names = (const char *[]){ "csiphy1_3p_clk_src" }, 2233 .num_parents = 1, 2234 .flags = CLK_SET_RATE_PARENT, 2235 .ops = &clk_branch2_ops, 2236 }, 2237 }, 2238}; 2239 2240static struct clk_branch camss_csiphy2_3p_clk = { 2241 .halt_reg = 0x3274, 2242 .clkr = { 2243 .enable_reg = 0x3274, 2244 .enable_mask = BIT(0), 2245 .hw.init = &(struct clk_init_data){ 2246 .name = "camss_csiphy2_3p_clk", 2247 .parent_names = (const char *[]){ "csiphy2_3p_clk_src" }, 2248 .num_parents = 1, 2249 .flags = CLK_SET_RATE_PARENT, 2250 .ops = &clk_branch2_ops, 2251 }, 2252 }, 2253}; 2254 2255static struct clk_branch camss_jpeg0_clk = { 2256 .halt_reg = 0x35a8, 2257 .clkr = { 2258 .enable_reg = 0x35a8, 2259 .enable_mask = BIT(0), 2260 .hw.init = &(struct clk_init_data){ 2261 .name = "camss_jpeg0_clk", 2262 .parent_names = (const char *[]){ "jpeg0_clk_src" }, 2263 .num_parents = 1, 2264 .flags = CLK_SET_RATE_PARENT, 2265 .ops = &clk_branch2_ops, 2266 }, 2267 }, 2268}; 2269 2270static struct clk_branch camss_jpeg2_clk = { 2271 .halt_reg = 0x35b0, 2272 .clkr = { 2273 .enable_reg = 0x35b0, 2274 .enable_mask = BIT(0), 2275 .hw.init = &(struct clk_init_data){ 2276 .name = "camss_jpeg2_clk", 2277 .parent_names = (const char *[]){ "jpeg2_clk_src" }, 2278 .num_parents = 1, 2279 .flags = CLK_SET_RATE_PARENT, 2280 .ops = &clk_branch2_ops, 2281 }, 2282 }, 2283}; 2284 2285static struct clk_branch camss_jpeg_dma_clk = { 2286 .halt_reg = 0x35c0, 2287 .clkr = { 2288 .enable_reg = 0x35c0, 2289 .enable_mask = BIT(0), 2290 .hw.init = &(struct clk_init_data){ 2291 .name = "camss_jpeg_dma_clk", 2292 .parent_names = (const char *[]){ "jpeg_dma_clk_src" }, 2293 .num_parents = 1, 2294 .flags = CLK_SET_RATE_PARENT, 2295 .ops = &clk_branch2_ops, 2296 }, 2297 }, 2298}; 2299 2300static struct clk_branch camss_jpeg_ahb_clk = { 2301 .halt_reg = 0x35b4, 2302 .clkr = { 2303 .enable_reg = 0x35b4, 2304 .enable_mask = BIT(0), 2305 .hw.init = &(struct clk_init_data){ 2306 .name = "camss_jpeg_ahb_clk", 2307 .parent_names = (const char *[]){ "ahb_clk_src" }, 2308 .num_parents = 1, 2309 .flags = CLK_SET_RATE_PARENT, 2310 .ops = &clk_branch2_ops, 2311 }, 2312 }, 2313}; 2314 2315static struct clk_branch camss_jpeg_axi_clk = { 2316 .halt_reg = 0x35b8, 2317 .clkr = { 2318 .enable_reg = 0x35b8, 2319 .enable_mask = BIT(0), 2320 .hw.init = &(struct clk_init_data){ 2321 .name = "camss_jpeg_axi_clk", 2322 .parent_names = (const char *[]){ "axi_clk_src" }, 2323 .num_parents = 1, 2324 .flags = CLK_SET_RATE_PARENT, 2325 .ops = &clk_branch2_ops, 2326 }, 2327 }, 2328}; 2329 2330static struct clk_branch camss_vfe_ahb_clk = { 2331 .halt_reg = 0x36b8, 2332 .clkr = { 2333 .enable_reg = 0x36b8, 2334 .enable_mask = BIT(0), 2335 .hw.init = &(struct clk_init_data){ 2336 .name = "camss_vfe_ahb_clk", 2337 .parent_names = (const char *[]){ "ahb_clk_src" }, 2338 .num_parents = 1, 2339 .flags = CLK_SET_RATE_PARENT, 2340 .ops = &clk_branch2_ops, 2341 }, 2342 }, 2343}; 2344 2345static struct clk_branch camss_vfe_axi_clk = { 2346 .halt_reg = 0x36bc, 2347 .clkr = { 2348 .enable_reg = 0x36bc, 2349 .enable_mask = BIT(0), 2350 .hw.init = &(struct clk_init_data){ 2351 .name = "camss_vfe_axi_clk", 2352 .parent_names = (const char *[]){ "axi_clk_src" }, 2353 .num_parents = 1, 2354 .flags = CLK_SET_RATE_PARENT, 2355 .ops = &clk_branch2_ops, 2356 }, 2357 }, 2358}; 2359 2360static struct clk_branch camss_vfe0_clk = { 2361 .halt_reg = 0x36a8, 2362 .clkr = { 2363 .enable_reg = 0x36a8, 2364 .enable_mask = BIT(0), 2365 .hw.init = &(struct clk_init_data){ 2366 .name = "camss_vfe0_clk", 2367 .parent_names = (const char *[]){ "vfe0_clk_src" }, 2368 .num_parents = 1, 2369 .flags = CLK_SET_RATE_PARENT, 2370 .ops = &clk_branch2_ops, 2371 }, 2372 }, 2373}; 2374 2375static struct clk_branch camss_vfe0_stream_clk = { 2376 .halt_reg = 0x3720, 2377 .clkr = { 2378 .enable_reg = 0x3720, 2379 .enable_mask = BIT(0), 2380 .hw.init = &(struct clk_init_data){ 2381 .name = "camss_vfe0_stream_clk", 2382 .parent_names = (const char *[]){ "vfe0_clk_src" }, 2383 .num_parents = 1, 2384 .flags = CLK_SET_RATE_PARENT, 2385 .ops = &clk_branch2_ops, 2386 }, 2387 }, 2388}; 2389 2390static struct clk_branch camss_vfe0_ahb_clk = { 2391 .halt_reg = 0x3668, 2392 .clkr = { 2393 .enable_reg = 0x3668, 2394 .enable_mask = BIT(0), 2395 .hw.init = &(struct clk_init_data){ 2396 .name = "camss_vfe0_ahb_clk", 2397 .parent_names = (const char *[]){ "ahb_clk_src" }, 2398 .num_parents = 1, 2399 .flags = CLK_SET_RATE_PARENT, 2400 .ops = &clk_branch2_ops, 2401 }, 2402 }, 2403}; 2404 2405static struct clk_branch camss_vfe1_clk = { 2406 .halt_reg = 0x36ac, 2407 .clkr = { 2408 .enable_reg = 0x36ac, 2409 .enable_mask = BIT(0), 2410 .hw.init = &(struct clk_init_data){ 2411 .name = "camss_vfe1_clk", 2412 .parent_names = (const char *[]){ "vfe1_clk_src" }, 2413 .num_parents = 1, 2414 .flags = CLK_SET_RATE_PARENT, 2415 .ops = &clk_branch2_ops, 2416 }, 2417 }, 2418}; 2419 2420static struct clk_branch camss_vfe1_stream_clk = { 2421 .halt_reg = 0x3724, 2422 .clkr = { 2423 .enable_reg = 0x3724, 2424 .enable_mask = BIT(0), 2425 .hw.init = &(struct clk_init_data){ 2426 .name = "camss_vfe1_stream_clk", 2427 .parent_names = (const char *[]){ "vfe1_clk_src" }, 2428 .num_parents = 1, 2429 .flags = CLK_SET_RATE_PARENT, 2430 .ops = &clk_branch2_ops, 2431 }, 2432 }, 2433}; 2434 2435static struct clk_branch camss_vfe1_ahb_clk = { 2436 .halt_reg = 0x3678, 2437 .clkr = { 2438 .enable_reg = 0x3678, 2439 .enable_mask = BIT(0), 2440 .hw.init = &(struct clk_init_data){ 2441 .name = "camss_vfe1_ahb_clk", 2442 .parent_names = (const char *[]){ "ahb_clk_src" }, 2443 .num_parents = 1, 2444 .flags = CLK_SET_RATE_PARENT, 2445 .ops = &clk_branch2_ops, 2446 }, 2447 }, 2448}; 2449 2450static struct clk_branch camss_csi_vfe0_clk = { 2451 .halt_reg = 0x3704, 2452 .clkr = { 2453 .enable_reg = 0x3704, 2454 .enable_mask = BIT(0), 2455 .hw.init = &(struct clk_init_data){ 2456 .name = "camss_csi_vfe0_clk", 2457 .parent_names = (const char *[]){ "vfe0_clk_src" }, 2458 .num_parents = 1, 2459 .flags = CLK_SET_RATE_PARENT, 2460 .ops = &clk_branch2_ops, 2461 }, 2462 }, 2463}; 2464 2465static struct clk_branch camss_csi_vfe1_clk = { 2466 .halt_reg = 0x3714, 2467 .clkr = { 2468 .enable_reg = 0x3714, 2469 .enable_mask = BIT(0), 2470 .hw.init = &(struct clk_init_data){ 2471 .name = "camss_csi_vfe1_clk", 2472 .parent_names = (const char *[]){ "vfe1_clk_src" }, 2473 .num_parents = 1, 2474 .flags = CLK_SET_RATE_PARENT, 2475 .ops = &clk_branch2_ops, 2476 }, 2477 }, 2478}; 2479 2480static struct clk_branch camss_cpp_vbif_ahb_clk = { 2481 .halt_reg = 0x36c8, 2482 .clkr = { 2483 .enable_reg = 0x36c8, 2484 .enable_mask = BIT(0), 2485 .hw.init = &(struct clk_init_data){ 2486 .name = "camss_cpp_vbif_ahb_clk", 2487 .parent_names = (const char *[]){ "ahb_clk_src" }, 2488 .num_parents = 1, 2489 .flags = CLK_SET_RATE_PARENT, 2490 .ops = &clk_branch2_ops, 2491 }, 2492 }, 2493}; 2494 2495static struct clk_branch camss_cpp_axi_clk = { 2496 .halt_reg = 0x36c4, 2497 .clkr = { 2498 .enable_reg = 0x36c4, 2499 .enable_mask = BIT(0), 2500 .hw.init = &(struct clk_init_data){ 2501 .name = "camss_cpp_axi_clk", 2502 .parent_names = (const char *[]){ "axi_clk_src" }, 2503 .num_parents = 1, 2504 .flags = CLK_SET_RATE_PARENT, 2505 .ops = &clk_branch2_ops, 2506 }, 2507 }, 2508}; 2509 2510static struct clk_branch camss_cpp_clk = { 2511 .halt_reg = 0x36b0, 2512 .clkr = { 2513 .enable_reg = 0x36b0, 2514 .enable_mask = BIT(0), 2515 .hw.init = &(struct clk_init_data){ 2516 .name = "camss_cpp_clk", 2517 .parent_names = (const char *[]){ "cpp_clk_src" }, 2518 .num_parents = 1, 2519 .flags = CLK_SET_RATE_PARENT, 2520 .ops = &clk_branch2_ops, 2521 }, 2522 }, 2523}; 2524 2525static struct clk_branch camss_cpp_ahb_clk = { 2526 .halt_reg = 0x36b4, 2527 .clkr = { 2528 .enable_reg = 0x36b4, 2529 .enable_mask = BIT(0), 2530 .hw.init = &(struct clk_init_data){ 2531 .name = "camss_cpp_ahb_clk", 2532 .parent_names = (const char *[]){ "ahb_clk_src" }, 2533 .num_parents = 1, 2534 .flags = CLK_SET_RATE_PARENT, 2535 .ops = &clk_branch2_ops, 2536 }, 2537 }, 2538}; 2539 2540static struct clk_branch camss_csi0_clk = { 2541 .halt_reg = 0x30b4, 2542 .clkr = { 2543 .enable_reg = 0x30b4, 2544 .enable_mask = BIT(0), 2545 .hw.init = &(struct clk_init_data){ 2546 .name = "camss_csi0_clk", 2547 .parent_names = (const char *[]){ "csi0_clk_src" }, 2548 .num_parents = 1, 2549 .flags = CLK_SET_RATE_PARENT, 2550 .ops = &clk_branch2_ops, 2551 }, 2552 }, 2553}; 2554 2555static struct clk_branch camss_csi0_ahb_clk = { 2556 .halt_reg = 0x30bc, 2557 .clkr = { 2558 .enable_reg = 0x30bc, 2559 .enable_mask = BIT(0), 2560 .hw.init = &(struct clk_init_data){ 2561 .name = "camss_csi0_ahb_clk", 2562 .parent_names = (const char *[]){ "ahb_clk_src" }, 2563 .num_parents = 1, 2564 .flags = CLK_SET_RATE_PARENT, 2565 .ops = &clk_branch2_ops, 2566 }, 2567 }, 2568}; 2569 2570static struct clk_branch camss_csi0phy_clk = { 2571 .halt_reg = 0x30c4, 2572 .clkr = { 2573 .enable_reg = 0x30c4, 2574 .enable_mask = BIT(0), 2575 .hw.init = &(struct clk_init_data){ 2576 .name = "camss_csi0phy_clk", 2577 .parent_names = (const char *[]){ "csi0_clk_src" }, 2578 .num_parents = 1, 2579 .flags = CLK_SET_RATE_PARENT, 2580 .ops = &clk_branch2_ops, 2581 }, 2582 }, 2583}; 2584 2585static struct clk_branch camss_csi0rdi_clk = { 2586 .halt_reg = 0x30d4, 2587 .clkr = { 2588 .enable_reg = 0x30d4, 2589 .enable_mask = BIT(0), 2590 .hw.init = &(struct clk_init_data){ 2591 .name = "camss_csi0rdi_clk", 2592 .parent_names = (const char *[]){ "csi0_clk_src" }, 2593 .num_parents = 1, 2594 .flags = CLK_SET_RATE_PARENT, 2595 .ops = &clk_branch2_ops, 2596 }, 2597 }, 2598}; 2599 2600static struct clk_branch camss_csi0pix_clk = { 2601 .halt_reg = 0x30e4, 2602 .clkr = { 2603 .enable_reg = 0x30e4, 2604 .enable_mask = BIT(0), 2605 .hw.init = &(struct clk_init_data){ 2606 .name = "camss_csi0pix_clk", 2607 .parent_names = (const char *[]){ "csi0_clk_src" }, 2608 .num_parents = 1, 2609 .flags = CLK_SET_RATE_PARENT, 2610 .ops = &clk_branch2_ops, 2611 }, 2612 }, 2613}; 2614 2615static struct clk_branch camss_csi1_clk = { 2616 .halt_reg = 0x3124, 2617 .clkr = { 2618 .enable_reg = 0x3124, 2619 .enable_mask = BIT(0), 2620 .hw.init = &(struct clk_init_data){ 2621 .name = "camss_csi1_clk", 2622 .parent_names = (const char *[]){ "csi1_clk_src" }, 2623 .num_parents = 1, 2624 .flags = CLK_SET_RATE_PARENT, 2625 .ops = &clk_branch2_ops, 2626 }, 2627 }, 2628}; 2629 2630static struct clk_branch camss_csi1_ahb_clk = { 2631 .halt_reg = 0x3128, 2632 .clkr = { 2633 .enable_reg = 0x3128, 2634 .enable_mask = BIT(0), 2635 .hw.init = &(struct clk_init_data){ 2636 .name = "camss_csi1_ahb_clk", 2637 .parent_names = (const char *[]){ "ahb_clk_src" }, 2638 .num_parents = 1, 2639 .flags = CLK_SET_RATE_PARENT, 2640 .ops = &clk_branch2_ops, 2641 }, 2642 }, 2643}; 2644 2645static struct clk_branch camss_csi1phy_clk = { 2646 .halt_reg = 0x3134, 2647 .clkr = { 2648 .enable_reg = 0x3134, 2649 .enable_mask = BIT(0), 2650 .hw.init = &(struct clk_init_data){ 2651 .name = "camss_csi1phy_clk", 2652 .parent_names = (const char *[]){ "csi1_clk_src" }, 2653 .num_parents = 1, 2654 .flags = CLK_SET_RATE_PARENT, 2655 .ops = &clk_branch2_ops, 2656 }, 2657 }, 2658}; 2659 2660static struct clk_branch camss_csi1rdi_clk = { 2661 .halt_reg = 0x3144, 2662 .clkr = { 2663 .enable_reg = 0x3144, 2664 .enable_mask = BIT(0), 2665 .hw.init = &(struct clk_init_data){ 2666 .name = "camss_csi1rdi_clk", 2667 .parent_names = (const char *[]){ "csi1_clk_src" }, 2668 .num_parents = 1, 2669 .flags = CLK_SET_RATE_PARENT, 2670 .ops = &clk_branch2_ops, 2671 }, 2672 }, 2673}; 2674 2675static struct clk_branch camss_csi1pix_clk = { 2676 .halt_reg = 0x3154, 2677 .clkr = { 2678 .enable_reg = 0x3154, 2679 .enable_mask = BIT(0), 2680 .hw.init = &(struct clk_init_data){ 2681 .name = "camss_csi1pix_clk", 2682 .parent_names = (const char *[]){ "csi1_clk_src" }, 2683 .num_parents = 1, 2684 .flags = CLK_SET_RATE_PARENT, 2685 .ops = &clk_branch2_ops, 2686 }, 2687 }, 2688}; 2689 2690static struct clk_branch camss_csi2_clk = { 2691 .halt_reg = 0x3184, 2692 .clkr = { 2693 .enable_reg = 0x3184, 2694 .enable_mask = BIT(0), 2695 .hw.init = &(struct clk_init_data){ 2696 .name = "camss_csi2_clk", 2697 .parent_names = (const char *[]){ "csi2_clk_src" }, 2698 .num_parents = 1, 2699 .flags = CLK_SET_RATE_PARENT, 2700 .ops = &clk_branch2_ops, 2701 }, 2702 }, 2703}; 2704 2705static struct clk_branch camss_csi2_ahb_clk = { 2706 .halt_reg = 0x3188, 2707 .clkr = { 2708 .enable_reg = 0x3188, 2709 .enable_mask = BIT(0), 2710 .hw.init = &(struct clk_init_data){ 2711 .name = "camss_csi2_ahb_clk", 2712 .parent_names = (const char *[]){ "ahb_clk_src" }, 2713 .num_parents = 1, 2714 .flags = CLK_SET_RATE_PARENT, 2715 .ops = &clk_branch2_ops, 2716 }, 2717 }, 2718}; 2719 2720static struct clk_branch camss_csi2phy_clk = { 2721 .halt_reg = 0x3194, 2722 .clkr = { 2723 .enable_reg = 0x3194, 2724 .enable_mask = BIT(0), 2725 .hw.init = &(struct clk_init_data){ 2726 .name = "camss_csi2phy_clk", 2727 .parent_names = (const char *[]){ "csi2_clk_src" }, 2728 .num_parents = 1, 2729 .flags = CLK_SET_RATE_PARENT, 2730 .ops = &clk_branch2_ops, 2731 }, 2732 }, 2733}; 2734 2735static struct clk_branch camss_csi2rdi_clk = { 2736 .halt_reg = 0x31a4, 2737 .clkr = { 2738 .enable_reg = 0x31a4, 2739 .enable_mask = BIT(0), 2740 .hw.init = &(struct clk_init_data){ 2741 .name = "camss_csi2rdi_clk", 2742 .parent_names = (const char *[]){ "csi2_clk_src" }, 2743 .num_parents = 1, 2744 .flags = CLK_SET_RATE_PARENT, 2745 .ops = &clk_branch2_ops, 2746 }, 2747 }, 2748}; 2749 2750static struct clk_branch camss_csi2pix_clk = { 2751 .halt_reg = 0x31b4, 2752 .clkr = { 2753 .enable_reg = 0x31b4, 2754 .enable_mask = BIT(0), 2755 .hw.init = &(struct clk_init_data){ 2756 .name = "camss_csi2pix_clk", 2757 .parent_names = (const char *[]){ "csi2_clk_src" }, 2758 .num_parents = 1, 2759 .flags = CLK_SET_RATE_PARENT, 2760 .ops = &clk_branch2_ops, 2761 }, 2762 }, 2763}; 2764 2765static struct clk_branch camss_csi3_clk = { 2766 .halt_reg = 0x31e4, 2767 .clkr = { 2768 .enable_reg = 0x31e4, 2769 .enable_mask = BIT(0), 2770 .hw.init = &(struct clk_init_data){ 2771 .name = "camss_csi3_clk", 2772 .parent_names = (const char *[]){ "csi3_clk_src" }, 2773 .num_parents = 1, 2774 .flags = CLK_SET_RATE_PARENT, 2775 .ops = &clk_branch2_ops, 2776 }, 2777 }, 2778}; 2779 2780static struct clk_branch camss_csi3_ahb_clk = { 2781 .halt_reg = 0x31e8, 2782 .clkr = { 2783 .enable_reg = 0x31e8, 2784 .enable_mask = BIT(0), 2785 .hw.init = &(struct clk_init_data){ 2786 .name = "camss_csi3_ahb_clk", 2787 .parent_names = (const char *[]){ "ahb_clk_src" }, 2788 .num_parents = 1, 2789 .flags = CLK_SET_RATE_PARENT, 2790 .ops = &clk_branch2_ops, 2791 }, 2792 }, 2793}; 2794 2795static struct clk_branch camss_csi3phy_clk = { 2796 .halt_reg = 0x31f4, 2797 .clkr = { 2798 .enable_reg = 0x31f4, 2799 .enable_mask = BIT(0), 2800 .hw.init = &(struct clk_init_data){ 2801 .name = "camss_csi3phy_clk", 2802 .parent_names = (const char *[]){ "csi3_clk_src" }, 2803 .num_parents = 1, 2804 .flags = CLK_SET_RATE_PARENT, 2805 .ops = &clk_branch2_ops, 2806 }, 2807 }, 2808}; 2809 2810static struct clk_branch camss_csi3rdi_clk = { 2811 .halt_reg = 0x3204, 2812 .clkr = { 2813 .enable_reg = 0x3204, 2814 .enable_mask = BIT(0), 2815 .hw.init = &(struct clk_init_data){ 2816 .name = "camss_csi3rdi_clk", 2817 .parent_names = (const char *[]){ "csi3_clk_src" }, 2818 .num_parents = 1, 2819 .flags = CLK_SET_RATE_PARENT, 2820 .ops = &clk_branch2_ops, 2821 }, 2822 }, 2823}; 2824 2825static struct clk_branch camss_csi3pix_clk = { 2826 .halt_reg = 0x3214, 2827 .clkr = { 2828 .enable_reg = 0x3214, 2829 .enable_mask = BIT(0), 2830 .hw.init = &(struct clk_init_data){ 2831 .name = "camss_csi3pix_clk", 2832 .parent_names = (const char *[]){ "csi3_clk_src" }, 2833 .num_parents = 1, 2834 .flags = CLK_SET_RATE_PARENT, 2835 .ops = &clk_branch2_ops, 2836 }, 2837 }, 2838}; 2839 2840static struct clk_branch camss_ispif_ahb_clk = { 2841 .halt_reg = 0x3224, 2842 .clkr = { 2843 .enable_reg = 0x3224, 2844 .enable_mask = BIT(0), 2845 .hw.init = &(struct clk_init_data){ 2846 .name = "camss_ispif_ahb_clk", 2847 .parent_names = (const char *[]){ "ahb_clk_src" }, 2848 .num_parents = 1, 2849 .flags = CLK_SET_RATE_PARENT, 2850 .ops = &clk_branch2_ops, 2851 }, 2852 }, 2853}; 2854 2855static struct clk_branch fd_core_clk = { 2856 .halt_reg = 0x3b68, 2857 .clkr = { 2858 .enable_reg = 0x3b68, 2859 .enable_mask = BIT(0), 2860 .hw.init = &(struct clk_init_data){ 2861 .name = "fd_core_clk", 2862 .parent_names = (const char *[]){ "fd_core_clk_src" }, 2863 .num_parents = 1, 2864 .flags = CLK_SET_RATE_PARENT, 2865 .ops = &clk_branch2_ops, 2866 }, 2867 }, 2868}; 2869 2870static struct clk_branch fd_core_uar_clk = { 2871 .halt_reg = 0x3b6c, 2872 .clkr = { 2873 .enable_reg = 0x3b6c, 2874 .enable_mask = BIT(0), 2875 .hw.init = &(struct clk_init_data){ 2876 .name = "fd_core_uar_clk", 2877 .parent_names = (const char *[]){ "fd_core_clk_src" }, 2878 .num_parents = 1, 2879 .flags = CLK_SET_RATE_PARENT, 2880 .ops = &clk_branch2_ops, 2881 }, 2882 }, 2883}; 2884 2885static struct clk_branch fd_ahb_clk = { 2886 .halt_reg = 0x3ba74, 2887 .clkr = { 2888 .enable_reg = 0x3ba74, 2889 .enable_mask = BIT(0), 2890 .hw.init = &(struct clk_init_data){ 2891 .name = "fd_ahb_clk", 2892 .parent_names = (const char *[]){ "ahb_clk_src" }, 2893 .num_parents = 1, 2894 .flags = CLK_SET_RATE_PARENT, 2895 .ops = &clk_branch2_ops, 2896 }, 2897 }, 2898}; 2899 2900static struct clk_hw *mmcc_msm8996_hws[] = { 2901 &gpll0_div.hw, 2902}; 2903 2904static struct gdsc mmagic_bimc_gdsc = { 2905 .gdscr = 0x529c, 2906 .pd = { 2907 .name = "mmagic_bimc", 2908 }, 2909 .pwrsts = PWRSTS_OFF_ON, 2910 .flags = ALWAYS_ON, 2911}; 2912 2913static struct gdsc mmagic_video_gdsc = { 2914 .gdscr = 0x119c, 2915 .gds_hw_ctrl = 0x120c, 2916 .pd = { 2917 .name = "mmagic_video", 2918 }, 2919 .pwrsts = PWRSTS_OFF_ON, 2920 .flags = VOTABLE | ALWAYS_ON, 2921}; 2922 2923static struct gdsc mmagic_mdss_gdsc = { 2924 .gdscr = 0x247c, 2925 .gds_hw_ctrl = 0x2480, 2926 .pd = { 2927 .name = "mmagic_mdss", 2928 }, 2929 .pwrsts = PWRSTS_OFF_ON, 2930 .flags = VOTABLE | ALWAYS_ON, 2931}; 2932 2933static struct gdsc mmagic_camss_gdsc = { 2934 .gdscr = 0x3c4c, 2935 .gds_hw_ctrl = 0x3c50, 2936 .pd = { 2937 .name = "mmagic_camss", 2938 }, 2939 .pwrsts = PWRSTS_OFF_ON, 2940 .flags = VOTABLE | ALWAYS_ON, 2941}; 2942 2943static struct gdsc venus_gdsc = { 2944 .gdscr = 0x1024, 2945 .cxcs = (unsigned int []){ 0x1028, 0x1034, 0x1038 }, 2946 .cxc_count = 3, 2947 .pd = { 2948 .name = "venus", 2949 }, 2950 .parent = &mmagic_video_gdsc.pd, 2951 .pwrsts = PWRSTS_OFF_ON, 2952}; 2953 2954static struct gdsc venus_core0_gdsc = { 2955 .gdscr = 0x1040, 2956 .cxcs = (unsigned int []){ 0x1048 }, 2957 .cxc_count = 1, 2958 .pd = { 2959 .name = "venus_core0", 2960 }, 2961 .parent = &venus_gdsc.pd, 2962 .pwrsts = PWRSTS_OFF_ON, 2963 .flags = HW_CTRL, 2964}; 2965 2966static struct gdsc venus_core1_gdsc = { 2967 .gdscr = 0x1044, 2968 .cxcs = (unsigned int []){ 0x104c }, 2969 .cxc_count = 1, 2970 .pd = { 2971 .name = "venus_core1", 2972 }, 2973 .parent = &venus_gdsc.pd, 2974 .pwrsts = PWRSTS_OFF_ON, 2975 .flags = HW_CTRL, 2976}; 2977 2978static struct gdsc camss_gdsc = { 2979 .gdscr = 0x34a0, 2980 .cxcs = (unsigned int []){ 0x36bc, 0x36c4 }, 2981 .cxc_count = 2, 2982 .pd = { 2983 .name = "camss", 2984 }, 2985 .parent = &mmagic_camss_gdsc.pd, 2986 .pwrsts = PWRSTS_OFF_ON, 2987}; 2988 2989static struct gdsc vfe0_gdsc = { 2990 .gdscr = 0x3664, 2991 .cxcs = (unsigned int []){ 0x36a8 }, 2992 .cxc_count = 1, 2993 .pd = { 2994 .name = "vfe0", 2995 }, 2996 .parent = &camss_gdsc.pd, 2997 .pwrsts = PWRSTS_OFF_ON, 2998}; 2999 3000static struct gdsc vfe1_gdsc = { 3001 .gdscr = 0x3674, 3002 .cxcs = (unsigned int []){ 0x36ac }, 3003 .cxc_count = 1, 3004 .pd = { 3005 .name = "vfe1", 3006 }, 3007 .parent = &camss_gdsc.pd, 3008 .pwrsts = PWRSTS_OFF_ON, 3009}; 3010 3011static struct gdsc jpeg_gdsc = { 3012 .gdscr = 0x35a4, 3013 .cxcs = (unsigned int []){ 0x35a8, 0x35b0, 0x35c0, 0x35b8 }, 3014 .cxc_count = 4, 3015 .pd = { 3016 .name = "jpeg", 3017 }, 3018 .parent = &camss_gdsc.pd, 3019 .pwrsts = PWRSTS_OFF_ON, 3020}; 3021 3022static struct gdsc cpp_gdsc = { 3023 .gdscr = 0x36d4, 3024 .cxcs = (unsigned int []){ 0x36b0 }, 3025 .cxc_count = 1, 3026 .pd = { 3027 .name = "cpp", 3028 }, 3029 .parent = &camss_gdsc.pd, 3030 .pwrsts = PWRSTS_OFF_ON, 3031}; 3032 3033static struct gdsc fd_gdsc = { 3034 .gdscr = 0x3b64, 3035 .cxcs = (unsigned int []){ 0x3b68, 0x3b6c }, 3036 .cxc_count = 2, 3037 .pd = { 3038 .name = "fd", 3039 }, 3040 .parent = &camss_gdsc.pd, 3041 .pwrsts = PWRSTS_OFF_ON, 3042}; 3043 3044static struct gdsc mdss_gdsc = { 3045 .gdscr = 0x2304, 3046 .cxcs = (unsigned int []){ 0x2310, 0x231c }, 3047 .cxc_count = 2, 3048 .pd = { 3049 .name = "mdss", 3050 }, 3051 .parent = &mmagic_mdss_gdsc.pd, 3052 .pwrsts = PWRSTS_OFF_ON, 3053}; 3054 3055static struct gdsc gpu_gdsc = { 3056 .gdscr = 0x4034, 3057 .gds_hw_ctrl = 0x4038, 3058 .pd = { 3059 .name = "gpu", 3060 }, 3061 .pwrsts = PWRSTS_OFF_ON, 3062 .flags = VOTABLE, 3063}; 3064 3065static struct gdsc gpu_gx_gdsc = { 3066 .gdscr = 0x4024, 3067 .clamp_io_ctrl = 0x4300, 3068 .cxcs = (unsigned int []){ 0x4028 }, 3069 .cxc_count = 1, 3070 .pd = { 3071 .name = "gpu_gx", 3072 }, 3073 .pwrsts = PWRSTS_OFF_ON, 3074 .parent = &gpu_gdsc.pd, 3075 .flags = CLAMP_IO, 3076 .supply = "vdd-gfx", 3077}; 3078 3079static struct clk_regmap *mmcc_msm8996_clocks[] = { 3080 [MMPLL0_EARLY] = &mmpll0_early.clkr, 3081 [MMPLL0_PLL] = &mmpll0.clkr, 3082 [MMPLL1_EARLY] = &mmpll1_early.clkr, 3083 [MMPLL1_PLL] = &mmpll1.clkr, 3084 [MMPLL2_EARLY] = &mmpll2_early.clkr, 3085 [MMPLL2_PLL] = &mmpll2.clkr, 3086 [MMPLL3_EARLY] = &mmpll3_early.clkr, 3087 [MMPLL3_PLL] = &mmpll3.clkr, 3088 [MMPLL4_EARLY] = &mmpll4_early.clkr, 3089 [MMPLL4_PLL] = &mmpll4.clkr, 3090 [MMPLL5_EARLY] = &mmpll5_early.clkr, 3091 [MMPLL5_PLL] = &mmpll5.clkr, 3092 [MMPLL8_EARLY] = &mmpll8_early.clkr, 3093 [MMPLL8_PLL] = &mmpll8.clkr, 3094 [MMPLL9_EARLY] = &mmpll9_early.clkr, 3095 [MMPLL9_PLL] = &mmpll9.clkr, 3096 [AHB_CLK_SRC] = &ahb_clk_src.clkr, 3097 [AXI_CLK_SRC] = &axi_clk_src.clkr, 3098 [MAXI_CLK_SRC] = &maxi_clk_src.clkr, 3099 [GFX3D_CLK_SRC] = &gfx3d_clk_src.rcg.clkr, 3100 [RBBMTIMER_CLK_SRC] = &rbbmtimer_clk_src.clkr, 3101 [ISENSE_CLK_SRC] = &isense_clk_src.clkr, 3102 [RBCPR_CLK_SRC] = &rbcpr_clk_src.clkr, 3103 [VIDEO_CORE_CLK_SRC] = &video_core_clk_src.clkr, 3104 [VIDEO_SUBCORE0_CLK_SRC] = &video_subcore0_clk_src.clkr, 3105 [VIDEO_SUBCORE1_CLK_SRC] = &video_subcore1_clk_src.clkr, 3106 [PCLK0_CLK_SRC] = &pclk0_clk_src.clkr, 3107 [PCLK1_CLK_SRC] = &pclk1_clk_src.clkr, 3108 [MDP_CLK_SRC] = &mdp_clk_src.clkr, 3109 [EXTPCLK_CLK_SRC] = &extpclk_clk_src.clkr, 3110 [VSYNC_CLK_SRC] = &vsync_clk_src.clkr, 3111 [HDMI_CLK_SRC] = &hdmi_clk_src.clkr, 3112 [BYTE0_CLK_SRC] = &byte0_clk_src.clkr, 3113 [BYTE1_CLK_SRC] = &byte1_clk_src.clkr, 3114 [ESC0_CLK_SRC] = &esc0_clk_src.clkr, 3115 [ESC1_CLK_SRC] = &esc1_clk_src.clkr, 3116 [CAMSS_GP0_CLK_SRC] = &camss_gp0_clk_src.clkr, 3117 [CAMSS_GP1_CLK_SRC] = &camss_gp1_clk_src.clkr, 3118 [MCLK0_CLK_SRC] = &mclk0_clk_src.clkr, 3119 [MCLK1_CLK_SRC] = &mclk1_clk_src.clkr, 3120 [MCLK2_CLK_SRC] = &mclk2_clk_src.clkr, 3121 [MCLK3_CLK_SRC] = &mclk3_clk_src.clkr, 3122 [CCI_CLK_SRC] = &cci_clk_src.clkr, 3123 [CSI0PHYTIMER_CLK_SRC] = &csi0phytimer_clk_src.clkr, 3124 [CSI1PHYTIMER_CLK_SRC] = &csi1phytimer_clk_src.clkr, 3125 [CSI2PHYTIMER_CLK_SRC] = &csi2phytimer_clk_src.clkr, 3126 [CSIPHY0_3P_CLK_SRC] = &csiphy0_3p_clk_src.clkr, 3127 [CSIPHY1_3P_CLK_SRC] = &csiphy1_3p_clk_src.clkr, 3128 [CSIPHY2_3P_CLK_SRC] = &csiphy2_3p_clk_src.clkr, 3129 [JPEG0_CLK_SRC] = &jpeg0_clk_src.clkr, 3130 [JPEG2_CLK_SRC] = &jpeg2_clk_src.clkr, 3131 [JPEG_DMA_CLK_SRC] = &jpeg_dma_clk_src.clkr, 3132 [VFE0_CLK_SRC] = &vfe0_clk_src.clkr, 3133 [VFE1_CLK_SRC] = &vfe1_clk_src.clkr, 3134 [CPP_CLK_SRC] = &cpp_clk_src.clkr, 3135 [CSI0_CLK_SRC] = &csi0_clk_src.clkr, 3136 [CSI1_CLK_SRC] = &csi1_clk_src.clkr, 3137 [CSI2_CLK_SRC] = &csi2_clk_src.clkr, 3138 [CSI3_CLK_SRC] = &csi3_clk_src.clkr, 3139 [FD_CORE_CLK_SRC] = &fd_core_clk_src.clkr, 3140 [MMSS_MMAGIC_AHB_CLK] = &mmss_mmagic_ahb_clk.clkr, 3141 [MMSS_MMAGIC_CFG_AHB_CLK] = &mmss_mmagic_cfg_ahb_clk.clkr, 3142 [MMSS_MISC_AHB_CLK] = &mmss_misc_ahb_clk.clkr, 3143 [MMSS_MISC_CXO_CLK] = &mmss_misc_cxo_clk.clkr, 3144 [MMSS_MMAGIC_MAXI_CLK] = &mmss_mmagic_maxi_clk.clkr, 3145 [MMAGIC_CAMSS_AXI_CLK] = &mmagic_camss_axi_clk.clkr, 3146 [MMAGIC_CAMSS_NOC_CFG_AHB_CLK] = &mmagic_camss_noc_cfg_ahb_clk.clkr, 3147 [SMMU_VFE_AHB_CLK] = &smmu_vfe_ahb_clk.clkr, 3148 [SMMU_VFE_AXI_CLK] = &smmu_vfe_axi_clk.clkr, 3149 [SMMU_CPP_AHB_CLK] = &smmu_cpp_ahb_clk.clkr, 3150 [SMMU_CPP_AXI_CLK] = &smmu_cpp_axi_clk.clkr, 3151 [SMMU_JPEG_AHB_CLK] = &smmu_jpeg_ahb_clk.clkr, 3152 [SMMU_JPEG_AXI_CLK] = &smmu_jpeg_axi_clk.clkr, 3153 [MMAGIC_MDSS_AXI_CLK] = &mmagic_mdss_axi_clk.clkr, 3154 [MMAGIC_MDSS_NOC_CFG_AHB_CLK] = &mmagic_mdss_noc_cfg_ahb_clk.clkr, 3155 [SMMU_ROT_AHB_CLK] = &smmu_rot_ahb_clk.clkr, 3156 [SMMU_ROT_AXI_CLK] = &smmu_rot_axi_clk.clkr, 3157 [SMMU_MDP_AHB_CLK] = &smmu_mdp_ahb_clk.clkr, 3158 [SMMU_MDP_AXI_CLK] = &smmu_mdp_axi_clk.clkr, 3159 [MMAGIC_VIDEO_AXI_CLK] = &mmagic_video_axi_clk.clkr, 3160 [MMAGIC_VIDEO_NOC_CFG_AHB_CLK] = &mmagic_video_noc_cfg_ahb_clk.clkr, 3161 [SMMU_VIDEO_AHB_CLK] = &smmu_video_ahb_clk.clkr, 3162 [SMMU_VIDEO_AXI_CLK] = &smmu_video_axi_clk.clkr, 3163 [MMAGIC_BIMC_NOC_CFG_AHB_CLK] = &mmagic_bimc_noc_cfg_ahb_clk.clkr, 3164 [GPU_GX_GFX3D_CLK] = &gpu_gx_gfx3d_clk.clkr, 3165 [GPU_GX_RBBMTIMER_CLK] = &gpu_gx_rbbmtimer_clk.clkr, 3166 [GPU_AHB_CLK] = &gpu_ahb_clk.clkr, 3167 [GPU_AON_ISENSE_CLK] = &gpu_aon_isense_clk.clkr, 3168 [VMEM_MAXI_CLK] = &vmem_maxi_clk.clkr, 3169 [VMEM_AHB_CLK] = &vmem_ahb_clk.clkr, 3170 [MMSS_RBCPR_CLK] = &mmss_rbcpr_clk.clkr, 3171 [MMSS_RBCPR_AHB_CLK] = &mmss_rbcpr_ahb_clk.clkr, 3172 [VIDEO_CORE_CLK] = &video_core_clk.clkr, 3173 [VIDEO_AXI_CLK] = &video_axi_clk.clkr, 3174 [VIDEO_MAXI_CLK] = &video_maxi_clk.clkr, 3175 [VIDEO_AHB_CLK] = &video_ahb_clk.clkr, 3176 [VIDEO_SUBCORE0_CLK] = &video_subcore0_clk.clkr, 3177 [VIDEO_SUBCORE1_CLK] = &video_subcore1_clk.clkr, 3178 [MDSS_AHB_CLK] = &mdss_ahb_clk.clkr, 3179 [MDSS_HDMI_AHB_CLK] = &mdss_hdmi_ahb_clk.clkr, 3180 [MDSS_AXI_CLK] = &mdss_axi_clk.clkr, 3181 [MDSS_PCLK0_CLK] = &mdss_pclk0_clk.clkr, 3182 [MDSS_PCLK1_CLK] = &mdss_pclk1_clk.clkr, 3183 [MDSS_MDP_CLK] = &mdss_mdp_clk.clkr, 3184 [MDSS_EXTPCLK_CLK] = &mdss_extpclk_clk.clkr, 3185 [MDSS_VSYNC_CLK] = &mdss_vsync_clk.clkr, 3186 [MDSS_HDMI_CLK] = &mdss_hdmi_clk.clkr, 3187 [MDSS_BYTE0_CLK] = &mdss_byte0_clk.clkr, 3188 [MDSS_BYTE1_CLK] = &mdss_byte1_clk.clkr, 3189 [MDSS_ESC0_CLK] = &mdss_esc0_clk.clkr, 3190 [MDSS_ESC1_CLK] = &mdss_esc1_clk.clkr, 3191 [CAMSS_TOP_AHB_CLK] = &camss_top_ahb_clk.clkr, 3192 [CAMSS_AHB_CLK] = &camss_ahb_clk.clkr, 3193 [CAMSS_MICRO_AHB_CLK] = &camss_micro_ahb_clk.clkr, 3194 [CAMSS_GP0_CLK] = &camss_gp0_clk.clkr, 3195 [CAMSS_GP1_CLK] = &camss_gp1_clk.clkr, 3196 [CAMSS_MCLK0_CLK] = &camss_mclk0_clk.clkr, 3197 [CAMSS_MCLK1_CLK] = &camss_mclk1_clk.clkr, 3198 [CAMSS_MCLK2_CLK] = &camss_mclk2_clk.clkr, 3199 [CAMSS_MCLK3_CLK] = &camss_mclk3_clk.clkr, 3200 [CAMSS_CCI_CLK] = &camss_cci_clk.clkr, 3201 [CAMSS_CCI_AHB_CLK] = &camss_cci_ahb_clk.clkr, 3202 [CAMSS_CSI0PHYTIMER_CLK] = &camss_csi0phytimer_clk.clkr, 3203 [CAMSS_CSI1PHYTIMER_CLK] = &camss_csi1phytimer_clk.clkr, 3204 [CAMSS_CSI2PHYTIMER_CLK] = &camss_csi2phytimer_clk.clkr, 3205 [CAMSS_CSIPHY0_3P_CLK] = &camss_csiphy0_3p_clk.clkr, 3206 [CAMSS_CSIPHY1_3P_CLK] = &camss_csiphy1_3p_clk.clkr, 3207 [CAMSS_CSIPHY2_3P_CLK] = &camss_csiphy2_3p_clk.clkr, 3208 [CAMSS_JPEG0_CLK] = &camss_jpeg0_clk.clkr, 3209 [CAMSS_JPEG2_CLK] = &camss_jpeg2_clk.clkr, 3210 [CAMSS_JPEG_DMA_CLK] = &camss_jpeg_dma_clk.clkr, 3211 [CAMSS_JPEG_AHB_CLK] = &camss_jpeg_ahb_clk.clkr, 3212 [CAMSS_JPEG_AXI_CLK] = &camss_jpeg_axi_clk.clkr, 3213 [CAMSS_VFE_AHB_CLK] = &camss_vfe_ahb_clk.clkr, 3214 [CAMSS_VFE_AXI_CLK] = &camss_vfe_axi_clk.clkr, 3215 [CAMSS_VFE0_CLK] = &camss_vfe0_clk.clkr, 3216 [CAMSS_VFE0_STREAM_CLK] = &camss_vfe0_stream_clk.clkr, 3217 [CAMSS_VFE0_AHB_CLK] = &camss_vfe0_ahb_clk.clkr, 3218 [CAMSS_VFE1_CLK] = &camss_vfe1_clk.clkr, 3219 [CAMSS_VFE1_STREAM_CLK] = &camss_vfe1_stream_clk.clkr, 3220 [CAMSS_VFE1_AHB_CLK] = &camss_vfe1_ahb_clk.clkr, 3221 [CAMSS_CSI_VFE0_CLK] = &camss_csi_vfe0_clk.clkr, 3222 [CAMSS_CSI_VFE1_CLK] = &camss_csi_vfe1_clk.clkr, 3223 [CAMSS_CPP_VBIF_AHB_CLK] = &camss_cpp_vbif_ahb_clk.clkr, 3224 [CAMSS_CPP_AXI_CLK] = &camss_cpp_axi_clk.clkr, 3225 [CAMSS_CPP_CLK] = &camss_cpp_clk.clkr, 3226 [CAMSS_CPP_AHB_CLK] = &camss_cpp_ahb_clk.clkr, 3227 [CAMSS_CSI0_CLK] = &camss_csi0_clk.clkr, 3228 [CAMSS_CSI0_AHB_CLK] = &camss_csi0_ahb_clk.clkr, 3229 [CAMSS_CSI0PHY_CLK] = &camss_csi0phy_clk.clkr, 3230 [CAMSS_CSI0RDI_CLK] = &camss_csi0rdi_clk.clkr, 3231 [CAMSS_CSI0PIX_CLK] = &camss_csi0pix_clk.clkr, 3232 [CAMSS_CSI1_CLK] = &camss_csi1_clk.clkr, 3233 [CAMSS_CSI1_AHB_CLK] = &camss_csi1_ahb_clk.clkr, 3234 [CAMSS_CSI1PHY_CLK] = &camss_csi1phy_clk.clkr, 3235 [CAMSS_CSI1RDI_CLK] = &camss_csi1rdi_clk.clkr, 3236 [CAMSS_CSI1PIX_CLK] = &camss_csi1pix_clk.clkr, 3237 [CAMSS_CSI2_CLK] = &camss_csi2_clk.clkr, 3238 [CAMSS_CSI2_AHB_CLK] = &camss_csi2_ahb_clk.clkr, 3239 [CAMSS_CSI2PHY_CLK] = &camss_csi2phy_clk.clkr, 3240 [CAMSS_CSI2RDI_CLK] = &camss_csi2rdi_clk.clkr, 3241 [CAMSS_CSI2PIX_CLK] = &camss_csi2pix_clk.clkr, 3242 [CAMSS_CSI3_CLK] = &camss_csi3_clk.clkr, 3243 [CAMSS_CSI3_AHB_CLK] = &camss_csi3_ahb_clk.clkr, 3244 [CAMSS_CSI3PHY_CLK] = &camss_csi3phy_clk.clkr, 3245 [CAMSS_CSI3RDI_CLK] = &camss_csi3rdi_clk.clkr, 3246 [CAMSS_CSI3PIX_CLK] = &camss_csi3pix_clk.clkr, 3247 [CAMSS_ISPIF_AHB_CLK] = &camss_ispif_ahb_clk.clkr, 3248 [FD_CORE_CLK] = &fd_core_clk.clkr, 3249 [FD_CORE_UAR_CLK] = &fd_core_uar_clk.clkr, 3250 [FD_AHB_CLK] = &fd_ahb_clk.clkr, 3251}; 3252 3253static struct gdsc *mmcc_msm8996_gdscs[] = { 3254 [MMAGIC_BIMC_GDSC] = &mmagic_bimc_gdsc, 3255 [MMAGIC_VIDEO_GDSC] = &mmagic_video_gdsc, 3256 [MMAGIC_MDSS_GDSC] = &mmagic_mdss_gdsc, 3257 [MMAGIC_CAMSS_GDSC] = &mmagic_camss_gdsc, 3258 [VENUS_GDSC] = &venus_gdsc, 3259 [VENUS_CORE0_GDSC] = &venus_core0_gdsc, 3260 [VENUS_CORE1_GDSC] = &venus_core1_gdsc, 3261 [CAMSS_GDSC] = &camss_gdsc, 3262 [VFE0_GDSC] = &vfe0_gdsc, 3263 [VFE1_GDSC] = &vfe1_gdsc, 3264 [JPEG_GDSC] = &jpeg_gdsc, 3265 [CPP_GDSC] = &cpp_gdsc, 3266 [FD_GDSC] = &fd_gdsc, 3267 [MDSS_GDSC] = &mdss_gdsc, 3268 [GPU_GDSC] = &gpu_gdsc, 3269 [GPU_GX_GDSC] = &gpu_gx_gdsc, 3270}; 3271 3272static const struct qcom_reset_map mmcc_msm8996_resets[] = { 3273 [MMAGICAHB_BCR] = { 0x5020 }, 3274 [MMAGIC_CFG_BCR] = { 0x5050 }, 3275 [MISC_BCR] = { 0x5010 }, 3276 [BTO_BCR] = { 0x5030 }, 3277 [MMAGICAXI_BCR] = { 0x5060 }, 3278 [MMAGICMAXI_BCR] = { 0x5070 }, 3279 [DSA_BCR] = { 0x50a0 }, 3280 [MMAGIC_CAMSS_BCR] = { 0x3c40 }, 3281 [THROTTLE_CAMSS_BCR] = { 0x3c30 }, 3282 [SMMU_VFE_BCR] = { 0x3c00 }, 3283 [SMMU_CPP_BCR] = { 0x3c10 }, 3284 [SMMU_JPEG_BCR] = { 0x3c20 }, 3285 [MMAGIC_MDSS_BCR] = { 0x2470 }, 3286 [THROTTLE_MDSS_BCR] = { 0x2460 }, 3287 [SMMU_ROT_BCR] = { 0x2440 }, 3288 [SMMU_MDP_BCR] = { 0x2450 }, 3289 [MMAGIC_VIDEO_BCR] = { 0x1190 }, 3290 [THROTTLE_VIDEO_BCR] = { 0x1180 }, 3291 [SMMU_VIDEO_BCR] = { 0x1170 }, 3292 [MMAGIC_BIMC_BCR] = { 0x5290 }, 3293 [GPU_GX_BCR] = { 0x4020 }, 3294 [GPU_BCR] = { 0x4030 }, 3295 [GPU_AON_BCR] = { 0x4040 }, 3296 [VMEM_BCR] = { 0x1200 }, 3297 [MMSS_RBCPR_BCR] = { 0x4080 }, 3298 [VIDEO_BCR] = { 0x1020 }, 3299 [MDSS_BCR] = { 0x2300 }, 3300 [CAMSS_TOP_BCR] = { 0x3480 }, 3301 [CAMSS_AHB_BCR] = { 0x3488 }, 3302 [CAMSS_MICRO_BCR] = { 0x3490 }, 3303 [CAMSS_CCI_BCR] = { 0x3340 }, 3304 [CAMSS_PHY0_BCR] = { 0x3020 }, 3305 [CAMSS_PHY1_BCR] = { 0x3050 }, 3306 [CAMSS_PHY2_BCR] = { 0x3080 }, 3307 [CAMSS_CSIPHY0_3P_BCR] = { 0x3230 }, 3308 [CAMSS_CSIPHY1_3P_BCR] = { 0x3250 }, 3309 [CAMSS_CSIPHY2_3P_BCR] = { 0x3270 }, 3310 [CAMSS_JPEG_BCR] = { 0x35a0 }, 3311 [CAMSS_VFE_BCR] = { 0x36a0 }, 3312 [CAMSS_VFE0_BCR] = { 0x3660 }, 3313 [CAMSS_VFE1_BCR] = { 0x3670 }, 3314 [CAMSS_CSI_VFE0_BCR] = { 0x3700 }, 3315 [CAMSS_CSI_VFE1_BCR] = { 0x3710 }, 3316 [CAMSS_CPP_TOP_BCR] = { 0x36c0 }, 3317 [CAMSS_CPP_BCR] = { 0x36d0 }, 3318 [CAMSS_CSI0_BCR] = { 0x30b0 }, 3319 [CAMSS_CSI0RDI_BCR] = { 0x30d0 }, 3320 [CAMSS_CSI0PIX_BCR] = { 0x30e0 }, 3321 [CAMSS_CSI1_BCR] = { 0x3120 }, 3322 [CAMSS_CSI1RDI_BCR] = { 0x3140 }, 3323 [CAMSS_CSI1PIX_BCR] = { 0x3150 }, 3324 [CAMSS_CSI2_BCR] = { 0x3180 }, 3325 [CAMSS_CSI2RDI_BCR] = { 0x31a0 }, 3326 [CAMSS_CSI2PIX_BCR] = { 0x31b0 }, 3327 [CAMSS_CSI3_BCR] = { 0x31e0 }, 3328 [CAMSS_CSI3RDI_BCR] = { 0x3200 }, 3329 [CAMSS_CSI3PIX_BCR] = { 0x3210 }, 3330 [CAMSS_ISPIF_BCR] = { 0x3220 }, 3331 [FD_BCR] = { 0x3b60 }, 3332 [MMSS_SPDM_RM_BCR] = { 0x300 }, 3333}; 3334 3335static const struct regmap_config mmcc_msm8996_regmap_config = { 3336 .reg_bits = 32, 3337 .reg_stride = 4, 3338 .val_bits = 32, 3339 .max_register = 0xb008, 3340 .fast_io = true, 3341}; 3342 3343static const struct qcom_cc_desc mmcc_msm8996_desc = { 3344 .config = &mmcc_msm8996_regmap_config, 3345 .clks = mmcc_msm8996_clocks, 3346 .num_clks = ARRAY_SIZE(mmcc_msm8996_clocks), 3347 .resets = mmcc_msm8996_resets, 3348 .num_resets = ARRAY_SIZE(mmcc_msm8996_resets), 3349 .gdscs = mmcc_msm8996_gdscs, 3350 .num_gdscs = ARRAY_SIZE(mmcc_msm8996_gdscs), 3351 .clk_hws = mmcc_msm8996_hws, 3352 .num_clk_hws = ARRAY_SIZE(mmcc_msm8996_hws), 3353}; 3354 3355static const struct of_device_id mmcc_msm8996_match_table[] = { 3356 { .compatible = "qcom,mmcc-msm8996" }, 3357 { } 3358}; 3359MODULE_DEVICE_TABLE(of, mmcc_msm8996_match_table); 3360 3361static int mmcc_msm8996_probe(struct platform_device *pdev) 3362{ 3363 struct regmap *regmap; 3364 3365 regmap = qcom_cc_map(pdev, &mmcc_msm8996_desc); 3366 if (IS_ERR(regmap)) 3367 return PTR_ERR(regmap); 3368 3369 /* Disable the AHB DCD */ 3370 regmap_update_bits(regmap, 0x50d8, BIT(31), 0); 3371 /* Disable the NoC FSM for mmss_mmagic_cfg_ahb_clk */ 3372 regmap_update_bits(regmap, 0x5054, BIT(15), 0); 3373 3374 return qcom_cc_really_probe(pdev, &mmcc_msm8996_desc, regmap); 3375} 3376 3377static struct platform_driver mmcc_msm8996_driver = { 3378 .probe = mmcc_msm8996_probe, 3379 .driver = { 3380 .name = "mmcc-msm8996", 3381 .of_match_table = mmcc_msm8996_match_table, 3382 }, 3383}; 3384module_platform_driver(mmcc_msm8996_driver); 3385 3386MODULE_DESCRIPTION("QCOM MMCC MSM8996 Driver"); 3387MODULE_LICENSE("GPL v2"); 3388MODULE_ALIAS("platform:mmcc-msm8996");