clk: qcom: ipq8074: SW workaround for UBI32 PLL lock
authorRobert Marko <robimarko@gmail.com>
Sun, 15 May 2022 21:00:39 +0000 (23:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:46 +0000 (14:23 +0200)
[ Upstream commit 3401ea2856ef84f39b75f0dc5ebcaeda81cb90ec ]

UBI32 Huayra PLL fails to lock in 5 us in some SoC silicon and thus it
will cause the wait_for_pll() to timeout and thus return the error
indicating that the PLL failed to lock.

This is bug in Huayra PLL HW for which SW workaround
is to set bit 26 of TEST_CTL register.

This is ported from the QCA 5.4 based downstream kernel.

Fixes: b8e7e519625f ("clk: qcom: ipq8074: add remaining PLL’s")
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220515210048.483898-2-robimarko@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/qcom/gcc-ipq8074.c

index 1a5141da7e23300a2bb631a4b47fd9c50dab3036..b4291ba53c785d509eceac020e83d5dab339d4cc 100644 (file)
@@ -4805,6 +4805,9 @@ static int gcc_ipq8074_probe(struct platform_device *pdev)
        if (IS_ERR(regmap))
                return PTR_ERR(regmap);
 
+       /* SW Workaround for UBI32 Huayra PLL */
+       regmap_update_bits(regmap, 0x2501c, BIT(26), BIT(26));
+
        clk_alpha_pll_configure(&ubi32_pll_main, regmap, &ubi32_pll_config);
        clk_alpha_pll_configure(&nss_crypto_pll_main, regmap,
                                &nss_crypto_pll_config);