12
12
#include <linux/platform_device.h>
13
13
#include <linux/regmap.h>
14
14
15
- #include <dt-bindings/clock/qcom,sa8775p -gpucc.h>
15
+ #include <dt-bindings/clock/qcom,qcs8300 -gpucc.h>
16
16
17
17
#include "clk-alpha-pll.h"
18
18
#include "clk-branch.h"
@@ -317,6 +317,24 @@ static struct clk_branch gpu_cc_crc_ahb_clk = {
317
317
},
318
318
};
319
319
320
+ static struct clk_branch gpu_cc_cx_accu_shift_clk = {
321
+ .halt_reg = 0x95e8 ,
322
+ .halt_check = BRANCH_HALT ,
323
+ .clkr = {
324
+ .enable_reg = 0x95e8 ,
325
+ .enable_mask = BIT (0 ),
326
+ .hw .init = & (const struct clk_init_data ){
327
+ .name = "gpu_cc_cx_accu_shift_clk" ,
328
+ .parent_hws = (const struct clk_hw * []){
329
+ & gpu_cc_xo_clk_src .clkr .hw ,
330
+ },
331
+ .num_parents = 1 ,
332
+ .flags = CLK_SET_RATE_PARENT ,
333
+ .ops = & clk_branch2_ops ,
334
+ },
335
+ },
336
+ };
337
+
320
338
static struct clk_branch gpu_cc_cx_ff_clk = {
321
339
.halt_reg = 0x914c ,
322
340
.halt_check = BRANCH_HALT ,
@@ -420,6 +438,24 @@ static struct clk_branch gpu_cc_demet_clk = {
420
438
},
421
439
};
422
440
441
+ static struct clk_branch gpu_cc_gx_accu_shift_clk = {
442
+ .halt_reg = 0x95e4 ,
443
+ .halt_check = BRANCH_HALT ,
444
+ .clkr = {
445
+ .enable_reg = 0x95e4 ,
446
+ .enable_mask = BIT (0 ),
447
+ .hw .init = & (const struct clk_init_data ){
448
+ .name = "gpu_cc_gx_accu_shift_clk" ,
449
+ .parent_hws = (const struct clk_hw * []){
450
+ & gpu_cc_xo_clk_src .clkr .hw ,
451
+ },
452
+ .num_parents = 1 ,
453
+ .flags = CLK_SET_RATE_PARENT ,
454
+ .ops = & clk_branch2_ops ,
455
+ },
456
+ },
457
+ };
458
+
423
459
static struct clk_branch gpu_cc_hlos1_vote_gpu_smmu_clk = {
424
460
.halt_reg = 0x7000 ,
425
461
.halt_check = BRANCH_HALT_VOTED ,
@@ -499,6 +535,7 @@ static struct clk_regmap *gpu_cc_sa8775p_clocks[] = {
499
535
[GPU_CC_AHB_CLK ] = & gpu_cc_ahb_clk .clkr ,
500
536
[GPU_CC_CB_CLK ] = & gpu_cc_cb_clk .clkr ,
501
537
[GPU_CC_CRC_AHB_CLK ] = & gpu_cc_crc_ahb_clk .clkr ,
538
+ [GPU_CC_CX_ACCU_SHIFT_CLK ] = NULL ,
502
539
[GPU_CC_CX_FF_CLK ] = & gpu_cc_cx_ff_clk .clkr ,
503
540
[GPU_CC_CX_GMU_CLK ] = & gpu_cc_cx_gmu_clk .clkr ,
504
541
[GPU_CC_CX_SNOC_DVM_CLK ] = & gpu_cc_cx_snoc_dvm_clk .clkr ,
@@ -508,6 +545,7 @@ static struct clk_regmap *gpu_cc_sa8775p_clocks[] = {
508
545
[GPU_CC_DEMET_DIV_CLK_SRC ] = & gpu_cc_demet_div_clk_src .clkr ,
509
546
[GPU_CC_FF_CLK_SRC ] = & gpu_cc_ff_clk_src .clkr ,
510
547
[GPU_CC_GMU_CLK_SRC ] = & gpu_cc_gmu_clk_src .clkr ,
548
+ [GPU_CC_GX_ACCU_SHIFT_CLK ] = NULL ,
511
549
[GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK ] = & gpu_cc_hlos1_vote_gpu_smmu_clk .clkr ,
512
550
[GPU_CC_HUB_AHB_DIV_CLK_SRC ] = & gpu_cc_hub_ahb_div_clk_src .clkr ,
513
551
[GPU_CC_HUB_AON_CLK ] = & gpu_cc_hub_aon_clk .clkr ,
@@ -583,6 +621,7 @@ static const struct qcom_cc_desc gpu_cc_sa8775p_desc = {
583
621
};
584
622
585
623
static const struct of_device_id gpu_cc_sa8775p_match_table [] = {
624
+ { .compatible = "qcom,qcs8300-gpucc" },
586
625
{ .compatible = "qcom,sa8775p-gpucc" },
587
626
{ }
588
627
};
@@ -596,6 +635,14 @@ static int gpu_cc_sa8775p_probe(struct platform_device *pdev)
596
635
if (IS_ERR (regmap ))
597
636
return PTR_ERR (regmap );
598
637
638
+ if (of_device_is_compatible (pdev -> dev .of_node , "qcom,qcs8300-gpucc" )) {
639
+ gpu_cc_pll0_config .l = 0x31 ;
640
+ gpu_cc_pll0_config .alpha = 0xe555 ;
641
+
642
+ gpu_cc_sa8775p_clocks [GPU_CC_CX_ACCU_SHIFT_CLK ] = & gpu_cc_cx_accu_shift_clk .clkr ;
643
+ gpu_cc_sa8775p_clocks [GPU_CC_GX_ACCU_SHIFT_CLK ] = & gpu_cc_gx_accu_shift_clk .clkr ;
644
+ }
645
+
599
646
clk_lucid_evo_pll_configure (& gpu_cc_pll0 , regmap , & gpu_cc_pll0_config );
600
647
clk_lucid_evo_pll_configure (& gpu_cc_pll1 , regmap , & gpu_cc_pll1_config );
601
648
0 commit comments