098-2-Documentation-cpufreq-add-qcom-krait-cpufreq-binding.patch 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. From c9ecd920324a647bf1f2b47f771c8f599cc7b551 Mon Sep 17 00:00:00 2001
  2. From: Ansuel Smith <[email protected]>
  3. Date: Sat, 22 Feb 2020 18:02:17 +0100
  4. Subject: [PATCH 2/8] Documentation: cpufreq: add qcom,krait-cache bindings
  5. Document dedicated cpufreq for Krait CPUs.
  6. Signed-off-by: Ansuel Smith <[email protected]>
  7. ---
  8. .../bindings/cpufreq/qcom-cpufreq-krait.yaml | 221 ++++++++++++++++++
  9. 1 file changed, 221 insertions(+)
  10. create mode 100644 Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-krait.yaml
  11. --- /dev/null
  12. +++ b/Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-krait.yaml
  13. @@ -0,0 +1,221 @@
  14. +# SPDX-License-Identifier: GPL-2.0
  15. +%YAML 1.2
  16. +---
  17. +$id: http://devicetree.org/schemas/cpufreq/qcom-cpufreq-krait.yaml#
  18. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  19. +
  20. +title: CPU Frequency scaling driver for Krait SoCs
  21. +
  22. +maintainers:
  23. + - Ansuel Smith <[email protected]>
  24. +
  25. +description: |
  26. + The krait cpufreq driver is a dedicated frequency scaling driver
  27. + based on cpufreq-dt generic driver that scale L2 cache and the
  28. + cores. TEST
  29. +
  30. + The L2 cache is scaled based on the max clk across all cores and
  31. + the clock is decided based on the opp-level set in the device tree.
  32. +
  33. + Different core freq can be linked to a specific l2 freq and the driver
  34. + on frequency change will scale the core and the l2 clk based of the
  35. + linked freq.
  36. +
  37. + On Krait SoC is present a bug and on every L2 clk change the driver
  38. + needs to set the clk to the idle freq before changing it to the new value.
  39. +
  40. + This requires the qcom cpufreq nvmem driver to parse the different opp
  41. + core clk and an additional opp table for the l2 scaling.
  42. +
  43. + If the driver detect broken config (for example missing opp-level) the
  44. + cpufreq driver skips the l2 scaling
  45. +
  46. + Referring to this example opp-level can be used to link a range of cpu freq
  47. + to a specific l2 freq:
  48. + cpu opp freq 384000000 has opp-level 0
  49. + l2 opp freq 384000000 has opp-level 0
  50. + The driver will scale l2 to 384000000
  51. +
  52. + cpu opp freq 600000000-1000000000 has opp-level 1
  53. + l2 opp freq 1000000000 has opp-level 1
  54. + The driver will scale l2 to 1000000000
  55. +
  56. +allOf:
  57. + - $ref: /schemas/cache-controller.yaml#
  58. +
  59. +select:
  60. + properties:
  61. + compatible:
  62. + items:
  63. + - enum:
  64. + - qcom,krait-cache
  65. +
  66. + required:
  67. + - compatible
  68. +
  69. +properties:
  70. + compatible:
  71. + items:
  72. + - const: qcom,krait-cache
  73. + - const: cache
  74. +
  75. + cache-level:
  76. + const: 2
  77. +
  78. + clocks:
  79. + maxItems: 1
  80. +
  81. + clock-names:
  82. + const: l2
  83. +
  84. + l2-supply: true
  85. +
  86. + operating-points-v2: true
  87. +
  88. +required:
  89. + - compatible
  90. + - cache-level
  91. + - clocks
  92. + - clock-names
  93. + - l2-supply
  94. + - operating-points-v2
  95. +
  96. +additionalProperties: false
  97. +
  98. +examples:
  99. + - |
  100. + cpus {
  101. + #address-cells = <1>;
  102. + #size-cells = <0>;
  103. +
  104. + cpu0: cpu@0 {
  105. + compatible = "qcom,krait";
  106. + enable-method = "qcom,kpss-acc-v1";
  107. + device_type = "cpu";
  108. + reg = <0>;
  109. + next-level-cache = <&L2>;
  110. + qcom,acc = <&acc0>;
  111. + qcom,saw = <&saw0>;
  112. + clocks = <&kraitcc 0>, <&kraitcc 4>;
  113. + clock-names = "cpu", "l2";
  114. + clock-latency = <100000>;
  115. + cpu-supply = <&smb208_s2a>;
  116. + operating-points-v2 = <&opp_table0>;
  117. + voltage-tolerance = <5>;
  118. + cooling-min-state = <0>;
  119. + cooling-max-state = <10>;
  120. + #cooling-cells = <2>;
  121. + cpu-idle-states = <&CPU_SPC>;
  122. + };
  123. +
  124. + /* ... */
  125. +
  126. + };
  127. +
  128. + opp_table0: opp_table0 {
  129. + compatible = "operating-points-v2-kryo-cpu";
  130. + nvmem-cells = <&speedbin_efuse>;
  131. +
  132. + opp-384000000 {
  133. + opp-hz = /bits/ 64 <384000000>;
  134. + opp-microvolt-speed0-pvs0-v0 = <1000000>;
  135. + opp-microvolt-speed0-pvs1-v0 = <925000>;
  136. + opp-microvolt-speed0-pvs2-v0 = <875000>;
  137. + opp-microvolt-speed0-pvs3-v0 = <800000>;
  138. + opp-supported-hw = <0x1>;
  139. + clock-latency-ns = <100000>;
  140. + opp-level = <0>;
  141. + };
  142. +
  143. + opp-600000000 {
  144. + opp-hz = /bits/ 64 <600000000>;
  145. + opp-microvolt-speed0-pvs0-v0 = <1050000>;
  146. + opp-microvolt-speed0-pvs1-v0 = <975000>;
  147. + opp-microvolt-speed0-pvs2-v0 = <925000>;
  148. + opp-microvolt-speed0-pvs3-v0 = <850000>;
  149. + opp-supported-hw = <0x1>;
  150. + clock-latency-ns = <100000>;
  151. + opp-level = <1>;
  152. + };
  153. +
  154. + opp-800000000 {
  155. + opp-hz = /bits/ 64 <800000000>;
  156. + opp-microvolt-speed0-pvs0-v0 = <1100000>;
  157. + opp-microvolt-speed0-pvs1-v0 = <1025000>;
  158. + opp-microvolt-speed0-pvs2-v0 = <995000>;
  159. + opp-microvolt-speed0-pvs3-v0 = <900000>;
  160. + opp-supported-hw = <0x1>;
  161. + clock-latency-ns = <100000>;
  162. + opp-level = <1>;
  163. + };
  164. +
  165. + opp-1000000000 {
  166. + opp-hz = /bits/ 64 <1000000000>;
  167. + opp-microvolt-speed0-pvs0-v0 = <1150000>;
  168. + opp-microvolt-speed0-pvs1-v0 = <1075000>;
  169. + opp-microvolt-speed0-pvs2-v0 = <1025000>;
  170. + opp-microvolt-speed0-pvs3-v0 = <950000>;
  171. + opp-supported-hw = <0x1>;
  172. + clock-latency-ns = <100000>;
  173. + opp-level = <1>;
  174. + };
  175. +
  176. + opp-1200000000 {
  177. + opp-hz = /bits/ 64 <1200000000>;
  178. + opp-microvolt-speed0-pvs0-v0 = <1200000>;
  179. + opp-microvolt-speed0-pvs1-v0 = <1125000>;
  180. + opp-microvolt-speed0-pvs2-v0 = <1075000>;
  181. + opp-microvolt-speed0-pvs3-v0 = <1000000>;
  182. + opp-supported-hw = <0x1>;
  183. + clock-latency-ns = <100000>;
  184. + opp-level = <2>;
  185. + };
  186. +
  187. + opp-1400000000 {
  188. + opp-hz = /bits/ 64 <1400000000>;
  189. + opp-microvolt-speed0-pvs0-v0 = <1250000>;
  190. + opp-microvolt-speed0-pvs1-v0 = <1175000>;
  191. + opp-microvolt-speed0-pvs2-v0 = <1125000>;
  192. + opp-microvolt-speed0-pvs3-v0 = <1050000>;
  193. + opp-supported-hw = <0x1>;
  194. + clock-latency-ns = <100000>;
  195. + opp-level = <2>;
  196. + };
  197. + };
  198. +
  199. + opp_table_l2: opp_table_l2 {
  200. + compatible = "operating-points-v2";
  201. +
  202. + opp-384000000 {
  203. + opp-hz = /bits/ 64 <384000000>;
  204. + opp-microvolt = <1100000>;
  205. + clock-latency-ns = <100000>;
  206. + opp-level = <0>;
  207. + };
  208. + opp-1000000000 {
  209. + opp-hz = /bits/ 64 <1000000000>;
  210. + opp-microvolt = <1100000>;
  211. + clock-latency-ns = <100000>;
  212. + opp-level = <1>;
  213. + };
  214. + opp-1200000000 {
  215. + opp-hz = /bits/ 64 <1200000000>;
  216. + opp-microvolt = <1150000>;
  217. + clock-latency-ns = <100000>;
  218. + opp-level = <2>;
  219. + };
  220. + };
  221. +
  222. + soc {
  223. + L2: l2-cache {
  224. + compatible = "qcom,krait-cache", "cache";
  225. + cache-level = <2>;
  226. +
  227. + clocks = <&kraitcc 4>;
  228. + clock-names = "l2";
  229. + l2-supply = <&smb208_s1a>;
  230. + operating-points-v2 = <&opp_table_l2>;
  231. + };
  232. + };
  233. +
  234. +...