diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2022-09-15 04:01:22 +0200 |
---|---|---|
committer | Christian Marangi <ansuelsmth@gmail.com> | 2022-10-11 21:28:45 +0200 |
commit | 6f1b89babaa519afbbd8ea7f7d1cbcc855dbb31c (patch) | |
tree | aeb955d9214e5ec348352b00c4182be25d79d89e /target/linux/ipq806x/patches-5.15/121-08-clk-qcom-krait-cc-handle-secondary-mux-sourcing-out-.patch | |
parent | e5a3720a56c277c7e083dac335b6aa442aa58d98 (diff) | |
download | upstream-6f1b89babaa519afbbd8ea7f7d1cbcc855dbb31c.tar.gz upstream-6f1b89babaa519afbbd8ea7f7d1cbcc855dbb31c.tar.bz2 upstream-6f1b89babaa519afbbd8ea7f7d1cbcc855dbb31c.zip |
ipq806x: 5.15: add krait-cc modernization patch and fixup
Add multiple patch for krait-cc modernization and multiple fixup for the
driver. Also modify a patch to enable the qsb fixed clock and add pxo to
krait-cc node.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/patches-5.15/121-08-clk-qcom-krait-cc-handle-secondary-mux-sourcing-out-.patch')
-rw-r--r-- | target/linux/ipq806x/patches-5.15/121-08-clk-qcom-krait-cc-handle-secondary-mux-sourcing-out-.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches-5.15/121-08-clk-qcom-krait-cc-handle-secondary-mux-sourcing-out-.patch b/target/linux/ipq806x/patches-5.15/121-08-clk-qcom-krait-cc-handle-secondary-mux-sourcing-out-.patch new file mode 100644 index 0000000000..9e7081b40e --- /dev/null +++ b/target/linux/ipq806x/patches-5.15/121-08-clk-qcom-krait-cc-handle-secondary-mux-sourcing-out-.patch @@ -0,0 +1,75 @@ +From b6655ca513b3f1b40417287ab7f706409455fe48 Mon Sep 17 00:00:00 2001 +From: Christian Marangi <ansuelsmth@gmail.com> +Date: Thu, 15 Sep 2022 02:56:47 +0200 +Subject: [PATCH 8/9] clk: qcom: krait-cc: handle secondary mux sourcing out of + PXO + +The secondary mux can sourc out of PXO as the secondary MUX is attached +to QSB and to another mux that can source out of PXO or PLL8_VOTE. + +Many device may run with uncorrect configuration with the mux sourcing +out of PXO instead of PLL8_VOTE. + +To handle this case we add also PXO as required clocks and we check if +the frequency is currently set to PXO and force a correct rate if it's +the case. + +Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> +--- + drivers/clk/qcom/krait-cc.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c +index e4fb3ff2b5b5..717eff44b6a4 100644 +--- a/drivers/clk/qcom/krait-cc.c ++++ b/drivers/clk/qcom/krait-cc.c +@@ -317,7 +317,7 @@ static int krait_cc_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; + const struct of_device_id *id; +- unsigned long cur_rate, aux_rate, qsb_rate; ++ unsigned long cur_rate, aux_rate, qsb_rate, pxo_rate; + int cpu; + struct clk *clk; + struct clk **clks; +@@ -327,6 +327,15 @@ static int krait_cc_probe(struct platform_device *pdev) + if (!id) + return -ENODEV; + ++ clk = clk_get(dev, "pxo"); ++ if (IS_ERR(clk)) ++ clk = __clk_lookup("pxo_board"); ++ ++ if (IS_ERR_OR_NULL(clk)) ++ return clk == NULL ? -ENODEV : PTR_ERR(clk); ++ ++ pxo_rate = clk_get_rate(clk); ++ + /* + * Per Documentation qsb should be provided from DTS. + * To address old implementation, register the fixed clock anyway. +@@ -394,6 +403,10 @@ static int krait_cc_probe(struct platform_device *pdev) + dev_info(dev, "L2 @ QSB rate. Forcing new rate.\n"); + cur_rate = aux_rate; + } ++ if (cur_rate == pxo_rate) { ++ dev_info(dev, "L2 @ PXO rate. Forcing new rate.\n"); ++ cur_rate = aux_rate; ++ } + clk_set_rate(l2_pri_mux_clk, aux_rate); + clk_set_rate(l2_pri_mux_clk, 2); + clk_set_rate(l2_pri_mux_clk, cur_rate); +@@ -405,6 +418,10 @@ static int krait_cc_probe(struct platform_device *pdev) + dev_info(dev, "CPU%d @ QSB rate. Forcing new rate.\n", cpu); + cur_rate = aux_rate; + } ++ if (cur_rate ==pxo_rate) { ++ dev_info(dev, "CPU%d @ PXO rate. Forcing new rate.\n", cpu); ++ cur_rate = aux_rate; ++ } + + clk_set_rate(clk, aux_rate); + clk_set_rate(clk, 2); +-- +2.37.2 + |