Skip to content

Commit 5fce38e

Browse files
juhosgandersson
authored andcommitted
clk: qcom: apss-ipq-pll: use stromer ops for IPQ5018 to fix boot failure
Booting v6.8 results in a hang on various IPQ5018 based boards. Investigating the problem showed that the hang happens when the clk_alpha_pll_stromer_plus_set_rate() function tries to write into the PLL_MODE register of the APSS PLL. Checking the downstream code revealed that it uses [1] stromer specific operations for IPQ5018, whereas in the current code the stromer plus specific operations are used. The ops in the 'ipq_pll_stromer_plus' clock definition can't be changed since that is needed for IPQ5332, so add a new alpha pll clock declaration which uses the correct stromer ops and use this new clock for IPQ5018 to avoid the boot failure. Also, change pll_type in 'ipq5018_pll_data' to CLK_ALPHA_PLL_TYPE_STROMER to better reflect that it is a Stromer PLL and change the apss_ipq_pll_probe() function accordingly. 1. https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.4/drivers/clk/qcom/apss-ipq5018.c#L67 Cc: [email protected] Fixes: 50492f9 ("clk: qcom: apss-ipq-pll: add support for IPQ5018") Signed-off-by: Gabor Juhos <[email protected]> Tested-by: Kathiravan Thirumoorthy <[email protected]> Reviewed-by: Kathiravan Thirumoorthy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 4cece76 commit 5fce38e

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

drivers/clk/qcom/apss-ipq-pll.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,29 @@ static struct clk_alpha_pll ipq_pll_huayra = {
5555
},
5656
};
5757

58+
static struct clk_alpha_pll ipq_pll_stromer = {
59+
.offset = 0x0,
60+
/*
61+
* Reuse CLK_ALPHA_PLL_TYPE_STROMER_PLUS register offsets.
62+
* Although this is a bit confusing, but the offset values
63+
* are correct nevertheless.
64+
*/
65+
.regs = ipq_pll_offsets[CLK_ALPHA_PLL_TYPE_STROMER_PLUS],
66+
.flags = SUPPORTS_DYNAMIC_UPDATE,
67+
.clkr = {
68+
.enable_reg = 0x0,
69+
.enable_mask = BIT(0),
70+
.hw.init = &(const struct clk_init_data) {
71+
.name = "a53pll",
72+
.parent_data = &(const struct clk_parent_data) {
73+
.fw_name = "xo",
74+
},
75+
.num_parents = 1,
76+
.ops = &clk_alpha_pll_stromer_ops,
77+
},
78+
},
79+
};
80+
5881
static struct clk_alpha_pll ipq_pll_stromer_plus = {
5982
.offset = 0x0,
6083
.regs = ipq_pll_offsets[CLK_ALPHA_PLL_TYPE_STROMER_PLUS],
@@ -144,8 +167,8 @@ struct apss_pll_data {
144167
};
145168

146169
static const struct apss_pll_data ipq5018_pll_data = {
147-
.pll_type = CLK_ALPHA_PLL_TYPE_STROMER_PLUS,
148-
.pll = &ipq_pll_stromer_plus,
170+
.pll_type = CLK_ALPHA_PLL_TYPE_STROMER,
171+
.pll = &ipq_pll_stromer,
149172
.pll_config = &ipq5018_pll_config,
150173
};
151174

@@ -203,7 +226,8 @@ static int apss_ipq_pll_probe(struct platform_device *pdev)
203226

204227
if (data->pll_type == CLK_ALPHA_PLL_TYPE_HUAYRA)
205228
clk_alpha_pll_configure(data->pll, regmap, data->pll_config);
206-
else if (data->pll_type == CLK_ALPHA_PLL_TYPE_STROMER_PLUS)
229+
else if (data->pll_type == CLK_ALPHA_PLL_TYPE_STROMER ||
230+
data->pll_type == CLK_ALPHA_PLL_TYPE_STROMER_PLUS)
207231
clk_stromer_pll_configure(data->pll, regmap, data->pll_config);
208232

209233
ret = devm_clk_register_regmap(dev, &data->pll->clkr);

0 commit comments

Comments
 (0)