Re: [PATCH 11/16] clk: qcom: krait-cc: force sec_mux to QSB

From
Stephen Boyd <sboyd@kernel.org>
Date
2022-03-15 22:47:10
Also in
linux-arm-msm, linux-clk, linux-tegra, lkml
Reply to
Ansuel Smith, 2022-03-13
Quoting Ansuel Smith (2022-03-13 12:04:14)
quoted hunk ↗ jump to hunk
Now that we have converted every driver to parent_data, it was
notice that the bootloader can't really leave the system in a
strange state where l2 or the cpu0/1 can be sourced in a number of ways
for example cpu1 sourcing out of qsb, l2 sourcing out of pxo.
To correctly reset the mux and the HFPLL force the sec_mux to QSB.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 drivers/clk/qcom/krait-cc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c
index 6530f10a546f..1bdc89c097e6 100644
--- a/drivers/clk/qcom/krait-cc.c
+++ b/drivers/clk/qcom/krait-cc.c
@@ -15,6 +15,8 @@
 
 #include "clk-krait.h"
 
+#define QSB_RATE       1
+
 static unsigned int sec_mux_map[] = {
        2,
        0,
@@ -178,6 +180,12 @@ krait_add_sec_mux(struct device *dev, struct clk *qsb, int id,
        if (ret)
                clk = ERR_PTR(ret);
 
+       /* Force the sec_mux to be set to QSB rate.
The comment start should be on a line alone

	/*
	 * Force the ...
quoted hunk ↗ jump to hunk
+        * This is needed to correctly set the parents and
+        * to later reset mux and HFPLL to a known freq.
+        */
+       clk_set_rate(clk, QSB_RATE);
+
 err_clk:
        if (unique_aux)
                kfree(parent_name);
Thread (31 messages) 31 messages, 4 authors, last reply 2022-03-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help