2
0

002-v6.2-04-clk-qcom-krait-cc-handle-secondary-mux-sourcing-out-.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From e5dc1a4c01510da8438dddfdf4200b79d73990dc Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Wed, 9 Nov 2022 01:56:29 +0100
  4. Subject: [PATCH 4/6] clk: qcom: krait-cc: handle secondary mux sourcing out of
  5. acpu_aux
  6. Some bootloader may leave the system in an even more undefined state
  7. with the secondary mux of L2 or other cores sourcing out of the acpu_aux
  8. parent. This results in the clk set to the PXO rate or a PLL8 rate.
  9. The current logic to reset the mux and set them to a defined state only
  10. handle if the mux are configured to source out of QSB. Change this and
  11. force a new and defined state if the current clk is lower than the aux
  12. rate. This way we can handle any wrong configuration where the mux is
  13. sourcing out of QSB (rate 225MHz, currently set to a virtual rate of 1),
  14. PXO rate (rate 25MHz) or PLL8 (needs to be configured to run at 384Mhz).
  15. Signed-off-by: Christian Marangi <[email protected]>
  16. Signed-off-by: Bjorn Andersson <[email protected]>
  17. Link: https://lore.kernel.org/r/[email protected]
  18. ---
  19. drivers/clk/qcom/krait-cc.c | 8 ++++----
  20. 1 file changed, 4 insertions(+), 4 deletions(-)
  21. --- a/drivers/clk/qcom/krait-cc.c
  22. +++ b/drivers/clk/qcom/krait-cc.c
  23. @@ -383,8 +383,8 @@ static int krait_cc_probe(struct platfor
  24. */
  25. cur_rate = clk_get_rate(l2_pri_mux_clk);
  26. aux_rate = 384000000;
  27. - if (cur_rate == 1) {
  28. - pr_info("L2 @ QSB rate. Forcing new rate.\n");
  29. + if (cur_rate < aux_rate) {
  30. + pr_info("L2 @ Undefined rate. Forcing new rate.\n");
  31. cur_rate = aux_rate;
  32. }
  33. clk_set_rate(l2_pri_mux_clk, aux_rate);
  34. @@ -394,8 +394,8 @@ static int krait_cc_probe(struct platfor
  35. for_each_possible_cpu(cpu) {
  36. clk = clks[cpu];
  37. cur_rate = clk_get_rate(clk);
  38. - if (cur_rate == 1) {
  39. - pr_info("CPU%d @ QSB rate. Forcing new rate.\n", cpu);
  40. + if (cur_rate < aux_rate) {
  41. + pr_info("CPU%d @ Undefined rate. Forcing new rate.\n", cpu);
  42. cur_rate = aux_rate;
  43. }