100-v5.18-07-linux-next-clk-qcom-gcc-ipq806x-add-additional-freq-nss-cores.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. From 512ea2edfe15ffa2cd839b3a31d768145f2edc20 Mon Sep 17 00:00:00 2001
  2. From: Ansuel Smith <[email protected]>
  3. Date: Sat, 26 Feb 2022 14:52:27 +0100
  4. Subject: [PATCH 07/14] clk: qcom: gcc-ipq806x: add additional freq nss cores
  5. Ipq8065 SoC (an evolution of ipq8064 SoC) contains nss cores that can be
  6. clocked to 800MHz. Add these missing freq to the gcc driver.
  7. Set the freq_tbl for the ubi32_cores to the correct values based on the
  8. machine compatible.
  9. Signed-off-by: Ansuel Smith <[email protected]>
  10. Reviewed-by: Stephen Boyd <[email protected]>
  11. Tested-by: Jonathan McDowell <[email protected]>
  12. Signed-off-by: Bjorn Andersson <[email protected]>
  13. Link: https://lore.kernel.org/r/[email protected]
  14. ---
  15. drivers/clk/qcom/gcc-ipq806x.c | 24 +++++++++++++++++++++---
  16. 1 file changed, 21 insertions(+), 3 deletions(-)
  17. --- a/drivers/clk/qcom/gcc-ipq806x.c
  18. +++ b/drivers/clk/qcom/gcc-ipq806x.c
  19. @@ -232,7 +232,9 @@ static struct clk_regmap pll14_vote = {
  20. static struct pll_freq_tbl pll18_freq_tbl[] = {
  21. NSS_PLL_RATE(550000000, 44, 0, 1, 0x01495625),
  22. + NSS_PLL_RATE(600000000, 48, 0, 1, 0x01495625),
  23. NSS_PLL_RATE(733000000, 58, 16, 25, 0x014b5625),
  24. + NSS_PLL_RATE(800000000, 64, 0, 1, 0x01495625),
  25. };
  26. static struct clk_pll pll18 = {
  27. @@ -2698,7 +2700,7 @@ static struct clk_branch nss_tcm_clk = {
  28. },
  29. };
  30. -static const struct freq_tbl clk_tbl_nss[] = {
  31. +static const struct freq_tbl clk_tbl_nss_ipq8064[] = {
  32. { 110000000, P_PLL18, 1, 1, 5 },
  33. { 275000000, P_PLL18, 2, 0, 0 },
  34. { 550000000, P_PLL18, 1, 0, 0 },
  35. @@ -2706,6 +2708,14 @@ static const struct freq_tbl clk_tbl_nss
  36. { }
  37. };
  38. +static const struct freq_tbl clk_tbl_nss_ipq8065[] = {
  39. + { 110000000, P_PLL18, 1, 1, 5 },
  40. + { 275000000, P_PLL18, 2, 0, 0 },
  41. + { 600000000, P_PLL18, 1, 0, 0 },
  42. + { 800000000, P_PLL18, 1, 0, 0 },
  43. + { }
  44. +};
  45. +
  46. static struct clk_dyn_rcg ubi32_core1_src_clk = {
  47. .ns_reg[0] = 0x3d2c,
  48. .ns_reg[1] = 0x3d30,
  49. @@ -2745,7 +2755,7 @@ static struct clk_dyn_rcg ubi32_core1_sr
  50. .pre_div_width = 2,
  51. },
  52. .mux_sel_bit = 0,
  53. - .freq_tbl = clk_tbl_nss,
  54. + /* nss freq table is selected based on the SoC compatible */
  55. .clkr = {
  56. .enable_reg = 0x3d20,
  57. .enable_mask = BIT(1),
  58. @@ -2798,7 +2808,7 @@ static struct clk_dyn_rcg ubi32_core2_sr
  59. .pre_div_width = 2,
  60. },
  61. .mux_sel_bit = 0,
  62. - .freq_tbl = clk_tbl_nss,
  63. + /* nss freq table is selected based on the SoC compatible */
  64. .clkr = {
  65. .enable_reg = 0x3d40,
  66. .enable_mask = BIT(1),
  67. @@ -3131,6 +3141,14 @@ static int gcc_ipq806x_probe(struct plat
  68. if (ret)
  69. return ret;
  70. + if (of_machine_is_compatible("qcom,ipq8065")) {
  71. + ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
  72. + ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
  73. + } else {
  74. + ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8064;
  75. + ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8064;
  76. + }
  77. +
  78. ret = qcom_cc_probe(pdev, &gcc_ipq806x_desc);
  79. if (ret)
  80. return ret;