139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. Content-Type: text/plain; charset="utf-8"
  2. MIME-Version: 1.0
  3. Content-Transfer-Encoding: 7bit
  4. Subject: [v3,08/13] clk: qcom: Add IPQ806X's HFPLLs
  5. From: Stephen Boyd <sboyd@codeaurora.org>
  6. X-Patchwork-Id: 6063241
  7. Message-Id: <1426920332-9340-9-git-send-email-sboyd@codeaurora.org>
  8. To: Mike Turquette <mturquette@linaro.org>, Stephen Boyd <sboyd@codeaurora.org>
  9. Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
  10. linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
  11. Viresh Kumar <viresh.kumar@linaro.org>
  12. Date: Fri, 20 Mar 2015 23:45:27 -0700
  13. Describe the HFPLLs present on IPQ806X devices.
  14. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  15. ---
  16. drivers/clk/qcom/gcc-ipq806x.c | 83 ++++++++++++++++++++++++++++++++++++++++++
  17. 1 file changed, 83 insertions(+)
  18. --- a/drivers/clk/qcom/gcc-ipq806x.c
  19. +++ b/drivers/clk/qcom/gcc-ipq806x.c
  20. @@ -30,6 +30,7 @@
  21. #include "clk-pll.h"
  22. #include "clk-rcg.h"
  23. #include "clk-branch.h"
  24. +#include "clk-hfpll.h"
  25. #include "reset.h"
  26. static struct clk_pll pll0 = {
  27. @@ -102,6 +103,85 @@ static struct clk_regmap pll8_vote = {
  28. },
  29. };
  30. +static struct hfpll_data hfpll0_data = {
  31. + .mode_reg = 0x3200,
  32. + .l_reg = 0x3208,
  33. + .m_reg = 0x320c,
  34. + .n_reg = 0x3210,
  35. + .config_reg = 0x3204,
  36. + .status_reg = 0x321c,
  37. + .config_val = 0x7845c665,
  38. + .droop_reg = 0x3214,
  39. + .droop_val = 0x0108c000,
  40. + .min_rate = 600000000UL,
  41. + .max_rate = 1800000000UL,
  42. +};
  43. +
  44. +static struct clk_hfpll hfpll0 = {
  45. + .d = &hfpll0_data,
  46. + .clkr.hw.init = &(struct clk_init_data){
  47. + .parent_names = (const char *[]){ "pxo" },
  48. + .num_parents = 1,
  49. + .name = "hfpll0",
  50. + .ops = &clk_ops_hfpll,
  51. + .flags = CLK_IGNORE_UNUSED,
  52. + },
  53. + .lock = __SPIN_LOCK_UNLOCKED(hfpll0.lock),
  54. +};
  55. +
  56. +static struct hfpll_data hfpll1_data = {
  57. + .mode_reg = 0x3240,
  58. + .l_reg = 0x3248,
  59. + .m_reg = 0x324c,
  60. + .n_reg = 0x3250,
  61. + .config_reg = 0x3244,
  62. + .status_reg = 0x325c,
  63. + .config_val = 0x7845c665,
  64. + .droop_reg = 0x3314,
  65. + .droop_val = 0x0108c000,
  66. + .min_rate = 600000000UL,
  67. + .max_rate = 1800000000UL,
  68. +};
  69. +
  70. +static struct clk_hfpll hfpll1 = {
  71. + .d = &hfpll1_data,
  72. + .clkr.hw.init = &(struct clk_init_data){
  73. + .parent_names = (const char *[]){ "pxo" },
  74. + .num_parents = 1,
  75. + .name = "hfpll1",
  76. + .ops = &clk_ops_hfpll,
  77. + .flags = CLK_IGNORE_UNUSED,
  78. + },
  79. + .lock = __SPIN_LOCK_UNLOCKED(hfpll1.lock),
  80. +};
  81. +
  82. +static struct hfpll_data hfpll_l2_data = {
  83. + .mode_reg = 0x3300,
  84. + .l_reg = 0x3308,
  85. + .m_reg = 0x330c,
  86. + .n_reg = 0x3310,
  87. + .config_reg = 0x3304,
  88. + .status_reg = 0x331c,
  89. + .config_val = 0x7845c665,
  90. + .droop_reg = 0x3314,
  91. + .droop_val = 0x0108c000,
  92. + .min_rate = 600000000UL,
  93. + .max_rate = 1800000000UL,
  94. +};
  95. +
  96. +static struct clk_hfpll hfpll_l2 = {
  97. + .d = &hfpll_l2_data,
  98. + .clkr.hw.init = &(struct clk_init_data){
  99. + .parent_names = (const char *[]){ "pxo" },
  100. + .num_parents = 1,
  101. + .name = "hfpll_l2",
  102. + .ops = &clk_ops_hfpll,
  103. + .flags = CLK_IGNORE_UNUSED,
  104. + },
  105. + .lock = __SPIN_LOCK_UNLOCKED(hfpll_l2.lock),
  106. +};
  107. +
  108. +
  109. static struct clk_pll pll14 = {
  110. .l_reg = 0x31c4,
  111. .m_reg = 0x31c8,
  112. @@ -2261,6 +2341,9 @@ static struct clk_regmap *gcc_ipq806x_cl
  113. [USB_FS1_XCVR_SRC] = &usb_fs1_xcvr_clk_src.clkr,
  114. [USB_FS1_XCVR_CLK] = &usb_fs1_xcvr_clk.clkr,
  115. [USB_FS1_SYSTEM_CLK] = &usb_fs1_sys_clk.clkr,
  116. + [PLL9] = &hfpll0.clkr,
  117. + [PLL10] = &hfpll1.clkr,
  118. + [PLL12] = &hfpll_l2.clkr,
  119. };
  120. static const struct qcom_reset_map gcc_ipq806x_resets[] = {