opp-v2-kryo-cpu.yaml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/opp/opp-v2-kryo-cpu.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Qualcomm Technologies, Inc. NVMEM OPP
  7. maintainers:
  8. - Ilia Lin <ilia.lin@kernel.org>
  9. allOf:
  10. - $ref: opp-v2-base.yaml#
  11. description: |
  12. In certain Qualcomm Technologies, Inc. SoCs like APQ8096 and MSM8996,
  13. the CPU frequencies subset and voltage value of each OPP varies based on
  14. the silicon variant in use.
  15. Qualcomm Technologies, Inc. Process Voltage Scaling Tables
  16. defines the voltage and frequency value based on the speedbin blown in
  17. the efuse combination.
  18. The qcom-cpufreq-nvmem driver reads the efuse value from the SoC to provide
  19. the OPP framework with required information (existing HW bitmap).
  20. This is used to determine the voltage and frequency value for each OPP of
  21. operating-points-v2 table when it is parsed by the OPP framework.
  22. properties:
  23. compatible:
  24. enum:
  25. - operating-points-v2-krait-cpu
  26. - operating-points-v2-kryo-cpu
  27. nvmem-cells:
  28. description: |
  29. A phandle pointing to a nvmem-cells node representing the
  30. efuse registers that has information about the
  31. speedbin that is used to select the right frequency/voltage
  32. value pair.
  33. opp-shared: true
  34. patternProperties:
  35. '^opp-?[0-9]+$':
  36. type: object
  37. additionalProperties: false
  38. properties:
  39. opp-hz: true
  40. opp-microvolt: true
  41. opp-peak-kBps: true
  42. opp-supported-hw:
  43. description: |
  44. A single 32 bit bitmap value, representing compatible HW.
  45. Bitmap for MSM8996 format:
  46. 0: MSM8996, speedbin 0
  47. 1: MSM8996, speedbin 1
  48. 2: MSM8996, speedbin 2
  49. 3: MSM8996, speedbin 3
  50. 4-31: unused
  51. Bitmap for MSM8996SG format (speedbin shifted of 4 left):
  52. 0-3: unused
  53. 4: MSM8996SG, speedbin 0
  54. 5: MSM8996SG, speedbin 1
  55. 6: MSM8996SG, speedbin 2
  56. 7-31: unused
  57. Bitmap for IPQ806x SoC:
  58. 0: IPQ8062
  59. 1: IPQ8064/IPQ8066/IPQ8068
  60. 2: IPQ8065/IPQ8069
  61. 3-31: unused
  62. Other platforms use bits directly corresponding to speedbin index.
  63. clock-latency-ns: true
  64. required-opps: true
  65. patternProperties:
  66. '^opp-microvolt-speed[0-9]+-pvs[0-9]+$': true
  67. required:
  68. - opp-hz
  69. required:
  70. - compatible
  71. if:
  72. required:
  73. - nvmem-cells
  74. then:
  75. patternProperties:
  76. '^opp-?[0-9]+$':
  77. required:
  78. - opp-supported-hw
  79. additionalProperties: false
  80. examples:
  81. - |
  82. / {
  83. model = "Qualcomm Technologies, Inc. DB820c";
  84. compatible = "arrow,apq8096-db820c", "qcom,apq8096-sbc", "qcom,apq8096";
  85. #address-cells = <2>;
  86. #size-cells = <2>;
  87. cpus {
  88. #address-cells = <2>;
  89. #size-cells = <0>;
  90. CPU0: cpu@0 {
  91. device_type = "cpu";
  92. compatible = "qcom,kryo";
  93. reg = <0x0 0x0>;
  94. enable-method = "psci";
  95. cpu-idle-states = <&CPU_SLEEP_0>;
  96. capacity-dmips-mhz = <1024>;
  97. clocks = <&kryocc 0>;
  98. operating-points-v2 = <&cluster0_opp>;
  99. power-domains = <&cpr>;
  100. power-domain-names = "cpr";
  101. #cooling-cells = <2>;
  102. next-level-cache = <&L2_0>;
  103. L2_0: l2-cache {
  104. compatible = "cache";
  105. cache-level = <2>;
  106. cache-unified;
  107. };
  108. };
  109. CPU1: cpu@1 {
  110. device_type = "cpu";
  111. compatible = "qcom,kryo";
  112. reg = <0x0 0x1>;
  113. enable-method = "psci";
  114. cpu-idle-states = <&CPU_SLEEP_0>;
  115. capacity-dmips-mhz = <1024>;
  116. clocks = <&kryocc 0>;
  117. operating-points-v2 = <&cluster0_opp>;
  118. power-domains = <&cpr>;
  119. power-domain-names = "cpr";
  120. #cooling-cells = <2>;
  121. next-level-cache = <&L2_0>;
  122. };
  123. CPU2: cpu@100 {
  124. device_type = "cpu";
  125. compatible = "qcom,kryo";
  126. reg = <0x0 0x100>;
  127. enable-method = "psci";
  128. cpu-idle-states = <&CPU_SLEEP_0>;
  129. capacity-dmips-mhz = <1024>;
  130. clocks = <&kryocc 1>;
  131. operating-points-v2 = <&cluster1_opp>;
  132. power-domains = <&cpr>;
  133. power-domain-names = "cpr";
  134. #cooling-cells = <2>;
  135. next-level-cache = <&L2_1>;
  136. L2_1: l2-cache {
  137. compatible = "cache";
  138. cache-level = <2>;
  139. cache-unified;
  140. };
  141. };
  142. CPU3: cpu@101 {
  143. device_type = "cpu";
  144. compatible = "qcom,kryo";
  145. reg = <0x0 0x101>;
  146. enable-method = "psci";
  147. cpu-idle-states = <&CPU_SLEEP_0>;
  148. capacity-dmips-mhz = <1024>;
  149. clocks = <&kryocc 1>;
  150. operating-points-v2 = <&cluster1_opp>;
  151. power-domains = <&cpr>;
  152. power-domain-names = "cpr";
  153. #cooling-cells = <2>;
  154. next-level-cache = <&L2_1>;
  155. };
  156. cpu-map {
  157. cluster0 {
  158. core0 {
  159. cpu = <&CPU0>;
  160. };
  161. core1 {
  162. cpu = <&CPU1>;
  163. };
  164. };
  165. cluster1 {
  166. core0 {
  167. cpu = <&CPU2>;
  168. };
  169. core1 {
  170. cpu = <&CPU3>;
  171. };
  172. };
  173. };
  174. };
  175. cluster0_opp: opp-table-0 {
  176. compatible = "operating-points-v2-kryo-cpu";
  177. nvmem-cells = <&speedbin_efuse>;
  178. opp-shared;
  179. opp-307200000 {
  180. opp-hz = /bits/ 64 <307200000>;
  181. opp-microvolt = <905000 905000 1140000>;
  182. opp-supported-hw = <0x7>;
  183. clock-latency-ns = <200000>;
  184. required-opps = <&cpr_opp1>;
  185. };
  186. opp-1401600000 {
  187. opp-hz = /bits/ 64 <1401600000>;
  188. opp-microvolt = <1140000 905000 1140000>;
  189. opp-supported-hw = <0x5>;
  190. clock-latency-ns = <200000>;
  191. required-opps = <&cpr_opp2>;
  192. };
  193. opp-1593600000 {
  194. opp-hz = /bits/ 64 <1593600000>;
  195. opp-microvolt = <1140000 905000 1140000>;
  196. opp-supported-hw = <0x1>;
  197. clock-latency-ns = <200000>;
  198. required-opps = <&cpr_opp3>;
  199. };
  200. };
  201. cluster1_opp: opp-table-1 {
  202. compatible = "operating-points-v2-kryo-cpu";
  203. nvmem-cells = <&speedbin_efuse>;
  204. opp-shared;
  205. opp-307200000 {
  206. opp-hz = /bits/ 64 <307200000>;
  207. opp-microvolt = <905000 905000 1140000>;
  208. opp-supported-hw = <0x7>;
  209. clock-latency-ns = <200000>;
  210. required-opps = <&cpr_opp1>;
  211. };
  212. opp-1804800000 {
  213. opp-hz = /bits/ 64 <1804800000>;
  214. opp-microvolt = <1140000 905000 1140000>;
  215. opp-supported-hw = <0x6>;
  216. clock-latency-ns = <200000>;
  217. required-opps = <&cpr_opp4>;
  218. };
  219. opp-1900800000 {
  220. opp-hz = /bits/ 64 <1900800000>;
  221. opp-microvolt = <1140000 905000 1140000>;
  222. opp-supported-hw = <0x4>;
  223. clock-latency-ns = <200000>;
  224. required-opps = <&cpr_opp5>;
  225. };
  226. opp-2150400000 {
  227. opp-hz = /bits/ 64 <2150400000>;
  228. opp-microvolt = <1140000 905000 1140000>;
  229. opp-supported-hw = <0x1>;
  230. clock-latency-ns = <200000>;
  231. required-opps = <&cpr_opp6>;
  232. };
  233. };
  234. /* Dummy opp table to give example for named opp-microvolt */
  235. opp-table-2 {
  236. compatible = "operating-points-v2-krait-cpu";
  237. nvmem-cells = <&speedbin_efuse>;
  238. opp-384000000 {
  239. opp-hz = /bits/ 64 <384000000>;
  240. opp-microvolt-speed0-pvs0 = <1000000 950000 1050000>;
  241. opp-microvolt-speed0-pvs1 = <925000 878750 971250>;
  242. opp-microvolt-speed0-pvs2 = <875000 831250 918750>;
  243. opp-microvolt-speed0-pvs3 = <800000 760000 840000>;
  244. opp-supported-hw = <0x7>;
  245. clock-latency-ns = <100000>;
  246. };
  247. };
  248. smem {
  249. compatible = "qcom,smem";
  250. memory-region = <&smem_mem>;
  251. hwlocks = <&tcsr_mutex 3>;
  252. };
  253. soc {
  254. #address-cells = <1>;
  255. #size-cells = <1>;
  256. qfprom: qfprom@74000 {
  257. compatible = "qcom,msm8996-qfprom", "qcom,qfprom";
  258. reg = <0x00074000 0x8ff>;
  259. #address-cells = <1>;
  260. #size-cells = <1>;
  261. speedbin_efuse: speedbin@133 {
  262. reg = <0x133 0x1>;
  263. bits = <5 3>;
  264. };
  265. };
  266. };
  267. };