Skip to content

Commit 165a5dc

Browse files
Imran Shaikandersson
authored andcommitted
clk: qcom: Add support for GPU Clock Controller on QCS8300
The QCS8300 GPU clock controller is a derivative of SA8775P, but has few additional clocks and minor differences. Hence, add support for QCS8300 GPU clock controller, by extending the SA8775P GPUCC. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Imran Shaik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent c703675 commit 165a5dc

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

drivers/clk/qcom/gpucc-sa8775p.c

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <linux/platform_device.h>
1313
#include <linux/regmap.h>
1414

15-
#include <dt-bindings/clock/qcom,sa8775p-gpucc.h>
15+
#include <dt-bindings/clock/qcom,qcs8300-gpucc.h>
1616

1717
#include "clk-alpha-pll.h"
1818
#include "clk-branch.h"
@@ -317,6 +317,24 @@ static struct clk_branch gpu_cc_crc_ahb_clk = {
317317
},
318318
};
319319

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+
320338
static struct clk_branch gpu_cc_cx_ff_clk = {
321339
.halt_reg = 0x914c,
322340
.halt_check = BRANCH_HALT,
@@ -420,6 +438,24 @@ static struct clk_branch gpu_cc_demet_clk = {
420438
},
421439
};
422440

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+
423459
static struct clk_branch gpu_cc_hlos1_vote_gpu_smmu_clk = {
424460
.halt_reg = 0x7000,
425461
.halt_check = BRANCH_HALT_VOTED,
@@ -499,6 +535,7 @@ static struct clk_regmap *gpu_cc_sa8775p_clocks[] = {
499535
[GPU_CC_AHB_CLK] = &gpu_cc_ahb_clk.clkr,
500536
[GPU_CC_CB_CLK] = &gpu_cc_cb_clk.clkr,
501537
[GPU_CC_CRC_AHB_CLK] = &gpu_cc_crc_ahb_clk.clkr,
538+
[GPU_CC_CX_ACCU_SHIFT_CLK] = NULL,
502539
[GPU_CC_CX_FF_CLK] = &gpu_cc_cx_ff_clk.clkr,
503540
[GPU_CC_CX_GMU_CLK] = &gpu_cc_cx_gmu_clk.clkr,
504541
[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[] = {
508545
[GPU_CC_DEMET_DIV_CLK_SRC] = &gpu_cc_demet_div_clk_src.clkr,
509546
[GPU_CC_FF_CLK_SRC] = &gpu_cc_ff_clk_src.clkr,
510547
[GPU_CC_GMU_CLK_SRC] = &gpu_cc_gmu_clk_src.clkr,
548+
[GPU_CC_GX_ACCU_SHIFT_CLK] = NULL,
511549
[GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK] = &gpu_cc_hlos1_vote_gpu_smmu_clk.clkr,
512550
[GPU_CC_HUB_AHB_DIV_CLK_SRC] = &gpu_cc_hub_ahb_div_clk_src.clkr,
513551
[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 = {
583621
};
584622

585623
static const struct of_device_id gpu_cc_sa8775p_match_table[] = {
624+
{ .compatible = "qcom,qcs8300-gpucc" },
586625
{ .compatible = "qcom,sa8775p-gpucc" },
587626
{ }
588627
};
@@ -596,6 +635,14 @@ static int gpu_cc_sa8775p_probe(struct platform_device *pdev)
596635
if (IS_ERR(regmap))
597636
return PTR_ERR(regmap);
598637

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+
599646
clk_lucid_evo_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config);
600647
clk_lucid_evo_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config);
601648

0 commit comments

Comments
 (0)