gpu.yaml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/display/msm/gpu.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Adreno or Snapdragon GPUs
  7. maintainers:
  8. - Rob Clark <robdclark@gmail.com>
  9. # dtschema does not select nodes based on pattern+const, so add custom select
  10. # as a work-around:
  11. select:
  12. properties:
  13. compatible:
  14. contains:
  15. enum:
  16. - qcom,adreno
  17. - amd,imageon
  18. required:
  19. - compatible
  20. properties:
  21. compatible:
  22. oneOf:
  23. - description: |
  24. The driver is parsing the compat string for Adreno to
  25. figure out the chip-id.
  26. items:
  27. - pattern: '^qcom,adreno-[0-9a-f]{8}$'
  28. - const: qcom,adreno
  29. - description: |
  30. The driver is parsing the compat string for Adreno to
  31. figure out the gpu-id and patch level.
  32. items:
  33. - pattern: '^qcom,adreno-[3-7][0-9][0-9]\.[0-9]+$'
  34. - const: qcom,adreno
  35. - description: |
  36. The driver is parsing the compat string for Imageon to
  37. figure out the gpu-id and patch level.
  38. items:
  39. - pattern: '^amd,imageon-200\.[0-1]$'
  40. - const: amd,imageon
  41. clocks:
  42. minItems: 2
  43. maxItems: 7
  44. clock-names:
  45. minItems: 2
  46. maxItems: 7
  47. reg:
  48. minItems: 1
  49. maxItems: 3
  50. reg-names:
  51. minItems: 1
  52. items:
  53. - const: kgsl_3d0_reg_memory
  54. - const: cx_mem
  55. - const: cx_dbgc
  56. interrupts:
  57. maxItems: 1
  58. interrupt-names:
  59. maxItems: 1
  60. interconnects:
  61. minItems: 1
  62. maxItems: 2
  63. interconnect-names:
  64. minItems: 1
  65. items:
  66. - const: gfx-mem
  67. - const: ocmem
  68. iommus:
  69. minItems: 1
  70. maxItems: 64
  71. sram:
  72. $ref: /schemas/types.yaml#/definitions/phandle-array
  73. minItems: 1
  74. maxItems: 4
  75. items:
  76. maxItems: 1
  77. description: |
  78. phandles to one or more reserved on-chip SRAM regions.
  79. phandle to the On Chip Memory (OCMEM) that's present on some a3xx and
  80. a4xx Snapdragon SoCs. See
  81. Documentation/devicetree/bindings/sram/qcom,ocmem.yaml
  82. operating-points-v2: true
  83. opp-table:
  84. type: object
  85. power-domains:
  86. maxItems: 1
  87. zap-shader:
  88. type: object
  89. additionalProperties: false
  90. description: |
  91. For a5xx and a6xx devices this node contains a memory-region that
  92. points to reserved memory to store the zap shader that can be used to
  93. help bring the GPU out of secure mode.
  94. properties:
  95. memory-region:
  96. maxItems: 1
  97. firmware-name:
  98. description: |
  99. Default name of the firmware to load to the remote processor.
  100. "#cooling-cells":
  101. const: 2
  102. nvmem-cell-names:
  103. maxItems: 1
  104. nvmem-cells:
  105. description: efuse registers
  106. maxItems: 1
  107. qcom,gmu:
  108. $ref: /schemas/types.yaml#/definitions/phandle
  109. description: |
  110. For GMU attached devices a phandle to the GMU device that will
  111. control the power for the GPU.
  112. required:
  113. - compatible
  114. - reg
  115. - interrupts
  116. additionalProperties: false
  117. allOf:
  118. - if:
  119. properties:
  120. compatible:
  121. contains:
  122. pattern: '^qcom,adreno-[3-5][0-9][0-9]\.[0-9]+$'
  123. then:
  124. properties:
  125. clocks:
  126. minItems: 2
  127. maxItems: 7
  128. clock-names:
  129. items:
  130. anyOf:
  131. - const: core
  132. description: GPU Core clock
  133. - const: iface
  134. description: GPU Interface clock
  135. - const: mem
  136. description: GPU Memory clock
  137. - const: mem_iface
  138. description: GPU Memory Interface clock
  139. - const: alt_mem_iface
  140. description: GPU Alternative Memory Interface clock
  141. - const: gfx3d
  142. description: GPU 3D engine clock
  143. - const: rbbmtimer
  144. description: GPU RBBM Timer for Adreno 5xx series
  145. - const: rbcpr
  146. description: GPU RB Core Power Reduction clock
  147. minItems: 2
  148. maxItems: 7
  149. required:
  150. - clocks
  151. - clock-names
  152. - if:
  153. properties:
  154. compatible:
  155. contains:
  156. enum:
  157. - qcom,adreno-610.0
  158. - qcom,adreno-619.1
  159. then:
  160. properties:
  161. clocks:
  162. minItems: 6
  163. maxItems: 6
  164. clock-names:
  165. items:
  166. - const: core
  167. description: GPU Core clock
  168. - const: iface
  169. description: GPU Interface clock
  170. - const: mem_iface
  171. description: GPU Memory Interface clock
  172. - const: alt_mem_iface
  173. description: GPU Alternative Memory Interface clock
  174. - const: gmu
  175. description: CX GMU clock
  176. - const: xo
  177. description: GPUCC clocksource clock
  178. reg-names:
  179. minItems: 1
  180. items:
  181. - const: kgsl_3d0_reg_memory
  182. - const: cx_dbgc
  183. required:
  184. - clocks
  185. - clock-names
  186. else:
  187. if:
  188. properties:
  189. compatible:
  190. contains:
  191. pattern: '^qcom,adreno-[67][0-9][0-9]\.[0-9]+$'
  192. then: # Starting with A6xx, the clocks are usually defined in the GMU node
  193. properties:
  194. clocks: false
  195. clock-names: false
  196. reg-names:
  197. minItems: 1
  198. items:
  199. - const: kgsl_3d0_reg_memory
  200. - const: cx_mem
  201. - const: cx_dbgc
  202. examples:
  203. - |
  204. // Example a3xx/4xx:
  205. #include <dt-bindings/clock/qcom,mmcc-msm8974.h>
  206. #include <dt-bindings/clock/qcom,rpmcc.h>
  207. #include <dt-bindings/interrupt-controller/irq.h>
  208. #include <dt-bindings/interrupt-controller/arm-gic.h>
  209. gpu: gpu@fdb00000 {
  210. compatible = "qcom,adreno-330.2", "qcom,adreno";
  211. reg = <0xfdb00000 0x10000>;
  212. reg-names = "kgsl_3d0_reg_memory";
  213. clock-names = "core", "iface", "mem_iface";
  214. clocks = <&mmcc OXILI_GFX3D_CLK>,
  215. <&mmcc OXILICX_AHB_CLK>,
  216. <&mmcc OXILICX_AXI_CLK>;
  217. interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
  218. interrupt-names = "kgsl_3d0_irq";
  219. sram = <&gpu_sram>;
  220. power-domains = <&mmcc OXILICX_GDSC>;
  221. operating-points-v2 = <&gpu_opp_table>;
  222. iommus = <&gpu_iommu 0>;
  223. #cooling-cells = <2>;
  224. };
  225. ocmem@fdd00000 {
  226. compatible = "qcom,msm8974-ocmem";
  227. reg = <0xfdd00000 0x2000>,
  228. <0xfec00000 0x180000>;
  229. reg-names = "ctrl", "mem";
  230. clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>,
  231. <&mmcc OCMEMCX_OCMEMNOC_CLK>;
  232. clock-names = "core", "iface";
  233. #address-cells = <1>;
  234. #size-cells = <1>;
  235. ranges = <0 0xfec00000 0x100000>;
  236. gpu_sram: gpu-sram@0 {
  237. reg = <0x0 0x100000>;
  238. };
  239. };
  240. - |
  241. // Example a6xx (with GMU):
  242. #include <dt-bindings/clock/qcom,gpucc-sdm845.h>
  243. #include <dt-bindings/clock/qcom,gcc-sdm845.h>
  244. #include <dt-bindings/power/qcom-rpmpd.h>
  245. #include <dt-bindings/interrupt-controller/irq.h>
  246. #include <dt-bindings/interrupt-controller/arm-gic.h>
  247. #include <dt-bindings/interconnect/qcom,sdm845.h>
  248. reserved-memory {
  249. #address-cells = <2>;
  250. #size-cells = <2>;
  251. zap_shader_region: gpu@8f200000 {
  252. compatible = "shared-dma-pool";
  253. reg = <0x0 0x90b00000 0x0 0xa00000>;
  254. no-map;
  255. };
  256. };
  257. gpu@5000000 {
  258. compatible = "qcom,adreno-630.2", "qcom,adreno";
  259. reg = <0x5000000 0x40000>, <0x509e000 0x10>;
  260. reg-names = "kgsl_3d0_reg_memory", "cx_mem";
  261. #cooling-cells = <2>;
  262. interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>;
  263. iommus = <&adreno_smmu 0>;
  264. operating-points-v2 = <&gpu_opp_table>;
  265. interconnects = <&rsc_hlos MASTER_GFX3D &rsc_hlos SLAVE_EBI1>;
  266. interconnect-names = "gfx-mem";
  267. qcom,gmu = <&gmu>;
  268. gpu_opp_table: opp-table {
  269. compatible = "operating-points-v2";
  270. opp-430000000 {
  271. opp-hz = /bits/ 64 <430000000>;
  272. opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
  273. opp-peak-kBps = <5412000>;
  274. };
  275. opp-355000000 {
  276. opp-hz = /bits/ 64 <355000000>;
  277. opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
  278. opp-peak-kBps = <3072000>;
  279. };
  280. opp-267000000 {
  281. opp-hz = /bits/ 64 <267000000>;
  282. opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
  283. opp-peak-kBps = <3072000>;
  284. };
  285. opp-180000000 {
  286. opp-hz = /bits/ 64 <180000000>;
  287. opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
  288. opp-peak-kBps = <1804000>;
  289. };
  290. };
  291. zap-shader {
  292. memory-region = <&zap_shader_region>;
  293. firmware-name = "qcom/LENOVO/81JL/qcdxkmsuc850.mbn";
  294. };
  295. };