linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 01/11] clk: qcom: ipq8074: fix NSS core PLL-s
@ 2022-05-15 21:00 Robert Marko
  2022-05-15 21:00 ` [PATCH v4 02/11] clk: qcom: ipq8074: SW workaround for UBI32 PLL lock Robert Marko
                   ` (10 more replies)
  0 siblings, 11 replies; 18+ messages in thread
From: Robert Marko @ 2022-05-15 21:00 UTC (permalink / raw)
  To: bjorn.andersson, agross, mturquette, sboyd, robh+dt,
	krzysztof.kozlowski+dt, tdas, absahu, linux-arm-msm, linux-clk,
	devicetree, linux-kernel, dmitry.baryshkov
  Cc: Robert Marko

Like in IPQ6018 the NSS related Alpha PLL-s require initial configuration
to work.

So, obtain the regmap that is required for the Alpha PLL configuration
and thus utilize the qcom_cc_really_probe() as we already have the regmap.
Then utilize the Alpha PLL configs from the downstream QCA 5.4 based
kernel to configure them.

This fixes the UBI32 and NSS crypto PLL-s failing to get enabled by the
kernel.

Fixes: b8e7e519625f ("clk: qcom: ipq8074: add remaining PLL’s")
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
 drivers/clk/qcom/gcc-ipq8074.c | 39 +++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/gcc-ipq8074.c b/drivers/clk/qcom/gcc-ipq8074.c
index 541016db3c4b..1a5141da7e23 100644
--- a/drivers/clk/qcom/gcc-ipq8074.c
+++ b/drivers/clk/qcom/gcc-ipq8074.c
@@ -4371,6 +4371,33 @@ static struct clk_branch gcc_pcie0_axi_s_bridge_clk = {
 	},
 };
 
+static const struct alpha_pll_config ubi32_pll_config = {
+	.l = 0x4e,
+	.config_ctl_val = 0x200d4aa8,
+	.config_ctl_hi_val = 0x3c2,
+	.main_output_mask = BIT(0),
+	.aux_output_mask = BIT(1),
+	.pre_div_val = 0x0,
+	.pre_div_mask = BIT(12),
+	.post_div_val = 0x0,
+	.post_div_mask = GENMASK(9, 8),
+};
+
+static const struct alpha_pll_config nss_crypto_pll_config = {
+	.l = 0x3e,
+	.alpha = 0x0,
+	.alpha_hi = 0x80,
+	.config_ctl_val = 0x4001055b,
+	.main_output_mask = BIT(0),
+	.pre_div_val = 0x0,
+	.pre_div_mask = GENMASK(14, 12),
+	.post_div_val = 0x1 << 8,
+	.post_div_mask = GENMASK(11, 8),
+	.vco_mask = GENMASK(21, 20),
+	.vco_val = 0x0,
+	.alpha_en_mask = BIT(24),
+};
+
 static struct clk_hw *gcc_ipq8074_hws[] = {
 	&gpll0_out_main_div2.hw,
 	&gpll6_out_main_div2.hw,
@@ -4772,7 +4799,17 @@ static const struct qcom_cc_desc gcc_ipq8074_desc = {
 
 static int gcc_ipq8074_probe(struct platform_device *pdev)
 {
-	return qcom_cc_probe(pdev, &gcc_ipq8074_desc);
+	struct regmap *regmap;
+
+	regmap = qcom_cc_map(pdev, &gcc_ipq8074_desc);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
+
+	clk_alpha_pll_configure(&ubi32_pll_main, regmap, &ubi32_pll_config);
+	clk_alpha_pll_configure(&nss_crypto_pll_main, regmap,
+				&nss_crypto_pll_config);
+
+	return qcom_cc_really_probe(pdev, &gcc_ipq8074_desc, regmap);
 }
 
 static struct platform_driver gcc_ipq8074_driver = {
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-07-29 23:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-15 21:00 [PATCH v4 01/11] clk: qcom: ipq8074: fix NSS core PLL-s Robert Marko
2022-05-15 21:00 ` [PATCH v4 02/11] clk: qcom: ipq8074: SW workaround for UBI32 PLL lock Robert Marko
2022-05-15 21:00 ` [PATCH v4 03/11] clk: qcom: ipq8074: fix NSS port frequency tables Robert Marko
2022-05-15 21:00 ` [PATCH v4 04/11] dt-bindings: clock: qcom: ipq8074: add PPE crypto clock Robert Marko
2022-05-15 21:00 ` [PATCH v4 05/11] clk: " Robert Marko
2022-05-15 21:00 ` [PATCH v4 06/11] clk: qcom: ipq8074: set BRANCH_HALT_DELAY flag for UBI clocks Robert Marko
2022-05-15 21:00 ` [PATCH v4 07/11] dt-bindings: clocks: qcom,gcc-ipq8074: support power domains Robert Marko
2022-05-17  8:11   ` Krzysztof Kozlowski
2022-05-15 21:00 ` [PATCH v4 08/11] dt-bindings: clock: qcom: ipq8074: add USB GDSCs Robert Marko
2022-05-17  8:12   ` Krzysztof Kozlowski
2022-05-15 21:00 ` [PATCH v4 09/11] clk: " Robert Marko
2022-05-15 21:00 ` [PATCH v4 10/11] clk: qcom: ipq8074: dont disable gcc_sleep_clk_src Robert Marko
2022-07-11 21:10   ` Stephen Boyd
2022-07-11 21:14     ` Robert Marko
2022-07-29 23:27       ` Stephen Boyd
2022-05-15 21:00 ` [PATCH v4 11/11] arm64: dts: ipq8074: add USB power domains Robert Marko
2022-07-03  3:56   ` (subset) " Bjorn Andersson
2022-07-03  3:56 ` (subset) [PATCH v4 01/11] clk: qcom: ipq8074: fix NSS core PLL-s Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).