Skip to content

Commit 5374834

Browse files
kholkbebarino
authored andcommitted
clk: qcom: gpucc-msm8998: Allow fabia gpupll0 rate setting
The GPU PLL0 is not a fixed PLL and the rate can be set on it: this is necessary especially on boards which bootloader is setting a very low rate on this PLL before booting Linux, which would be unsuitable for postdividing to reach the maximum allowed Adreno GPU frequency of 710MHz (or, actually, even 670MHz..) on this SoC. To allow setting rates on the GPU PLL0, also define VCO boundaries and set the CLK_SET_RATE_PARENT flag to the GPU PLL0 postdivider. With this change, the Adreno GPU is now able to scale through all the available frequencies. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Link: https://lore.kernel.org/r/20210114221059.483390-12-angelogioacchino.delregno@somainline.org Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent a59c16c commit 5374834

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/clk/qcom/gpucc-msm8998.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ static struct clk_branch gpucc_cxo_clk = {
5050
},
5151
};
5252

53+
static struct pll_vco fabia_vco[] = {
54+
{ 249600000, 2000000000, 0 },
55+
{ 125000000, 1000000000, 1 },
56+
};
57+
5358
static const struct clk_div_table post_div_table_fabia_even[] = {
5459
{ 0x0, 1 },
5560
{ 0x1, 2 },
@@ -61,11 +66,13 @@ static const struct clk_div_table post_div_table_fabia_even[] = {
6166
static struct clk_alpha_pll gpupll0 = {
6267
.offset = 0x0,
6368
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_FABIA],
69+
.vco_table = fabia_vco,
70+
.num_vco = ARRAY_SIZE(fabia_vco),
6471
.clkr.hw.init = &(struct clk_init_data){
6572
.name = "gpupll0",
6673
.parent_hws = (const struct clk_hw *[]){ &gpucc_cxo_clk.clkr.hw },
6774
.num_parents = 1,
68-
.ops = &clk_alpha_pll_fixed_fabia_ops,
75+
.ops = &clk_alpha_pll_fabia_ops,
6976
},
7077
};
7178

@@ -80,6 +87,7 @@ static struct clk_alpha_pll_postdiv gpupll0_out_even = {
8087
.name = "gpupll0_out_even",
8188
.parent_hws = (const struct clk_hw *[]){ &gpupll0.clkr.hw },
8289
.num_parents = 1,
90+
.flags = CLK_SET_RATE_PARENT,
8391
.ops = &clk_alpha_pll_postdiv_fabia_ops,
8492
},
8593
};

0 commit comments

Comments
 (0)