gpu.yaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  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: 1
  43. maxItems: 7
  44. clock-names:
  45. minItems: 1
  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. oneOf:
  123. - pattern: '^qcom,adreno-305\.[0-9]+$'
  124. - pattern: '^qcom,adreno-330\.[0-9]+$'
  125. then:
  126. properties:
  127. clocks:
  128. minItems: 3
  129. maxItems: 3
  130. clock-names:
  131. items:
  132. - const: core
  133. description: GPU Core clock
  134. - const: iface
  135. description: GPU Interface clock
  136. - const: mem_iface
  137. description: GPU Memory Interface clock
  138. - if:
  139. properties:
  140. compatible:
  141. contains:
  142. pattern: '^qcom,adreno-306\.[0-9]+$'
  143. then:
  144. properties:
  145. clocks:
  146. minItems: 5
  147. maxItems: 6
  148. clock-names:
  149. oneOf:
  150. - items:
  151. - const: core
  152. description: GPU Core clock
  153. - const: iface
  154. description: GPU Interface clock
  155. - const: mem_iface
  156. description: GPU Memory Interface clock
  157. - const: alt_mem_iface
  158. description: GPU Alternative Memory Interface clock
  159. - const: gfx3d
  160. description: GPU 3D engine clock
  161. - items:
  162. - const: core
  163. description: GPU Core clock
  164. - const: iface
  165. description: GPU Interface clock
  166. - const: mem
  167. description: GPU Memory clock
  168. - const: mem_iface
  169. description: GPU Memory Interface clock
  170. - const: alt_mem_iface
  171. description: GPU Alternative Memory Interface clock
  172. - const: gfx3d
  173. description: GPU 3D engine clock
  174. - if:
  175. properties:
  176. compatible:
  177. contains:
  178. pattern: '^qcom,adreno-320\.[0-9]+$'
  179. then:
  180. properties:
  181. clocks:
  182. minItems: 4
  183. maxItems: 4
  184. clock-names:
  185. items:
  186. - const: core
  187. description: GPU Core clock
  188. - const: iface
  189. description: GPU Interface clock
  190. - const: mem
  191. description: GPU Memory clock
  192. - const: mem_iface
  193. description: GPU Memory Interface clock
  194. - if:
  195. properties:
  196. compatible:
  197. contains:
  198. pattern: '^qcom,adreno-405\.[0-9]+$'
  199. then:
  200. properties:
  201. clocks:
  202. minItems: 7
  203. maxItems: 7
  204. clock-names:
  205. items:
  206. - const: core
  207. description: GPU Core clock
  208. - const: iface
  209. description: GPU Interface clock
  210. - const: mem
  211. description: GPU Memory clock
  212. - const: mem_iface
  213. description: GPU Memory Interface clock
  214. - const: alt_mem_iface
  215. description: GPU Alternative Memory Interface clock
  216. - const: gfx3d
  217. description: GPU 3D engine clock
  218. - const: rbbmtimer
  219. description: GPU RBBM Timer for Adreno 5xx series
  220. - if:
  221. properties:
  222. compatible:
  223. contains:
  224. pattern: '^qcom,adreno-50[56]\.[0-9]+$'
  225. then:
  226. properties:
  227. clocks:
  228. minItems: 6
  229. maxItems: 6
  230. clock-names:
  231. items:
  232. - const: core
  233. description: GPU Core clock
  234. - const: iface
  235. description: GPU Interface clock
  236. - const: mem_iface
  237. description: GPU Memory Interface clock
  238. - const: alt_mem_iface
  239. description: GPU Alternative Memory Interface clock
  240. - const: rbbmtimer
  241. description: GPU RBBM Timer for Adreno 5xx series
  242. - const: alwayson
  243. description: GPU AON clock
  244. - if:
  245. properties:
  246. compatible:
  247. contains:
  248. oneOf:
  249. - pattern: '^qcom,adreno-508\.[0-9]+$'
  250. - pattern: '^qcom,adreno-509\.[0-9]+$'
  251. - pattern: '^qcom,adreno-512\.[0-9]+$'
  252. - pattern: '^qcom,adreno-540\.[0-9]+$'
  253. then:
  254. properties:
  255. clocks:
  256. minItems: 6
  257. maxItems: 6
  258. clock-names:
  259. items:
  260. - const: iface
  261. description: GPU Interface clock
  262. - const: rbbmtimer
  263. description: GPU RBBM Timer for Adreno 5xx series
  264. - const: mem
  265. description: GPU Memory clock
  266. - const: mem_iface
  267. description: GPU Memory Interface clock
  268. - const: rbcpr
  269. description: GPU RB Core Power Reduction clock
  270. - const: core
  271. description: GPU Core clock
  272. - if:
  273. properties:
  274. compatible:
  275. contains:
  276. pattern: '^qcom,adreno-510\.[0-9]+$'
  277. then:
  278. properties:
  279. clocks:
  280. minItems: 6
  281. maxItems: 6
  282. clock-names:
  283. items:
  284. - const: core
  285. description: GPU Core clock
  286. - const: iface
  287. description: GPU Interface clock
  288. - const: mem
  289. description: GPU Memory clock
  290. - const: mem_iface
  291. description: GPU Memory Interface clock
  292. - const: rbbmtimer
  293. description: GPU RBBM Timer for Adreno 5xx series
  294. - const: alwayson
  295. description: GPU AON clock
  296. - if:
  297. properties:
  298. compatible:
  299. contains:
  300. pattern: '^qcom,adreno-530\.[0-9]+$'
  301. then:
  302. properties:
  303. clocks:
  304. minItems: 5
  305. maxItems: 5
  306. clock-names:
  307. items:
  308. - const: core
  309. description: GPU Core clock
  310. - const: iface
  311. description: GPU Interface clock
  312. - const: rbbmtimer
  313. description: GPU RBBM Timer for Adreno 5xx series
  314. - const: mem
  315. description: GPU Memory clock
  316. - const: mem_iface
  317. description: GPU Memory Interface clock
  318. - if:
  319. properties:
  320. compatible:
  321. contains:
  322. enum:
  323. - qcom,adreno-610.0
  324. - qcom,adreno-619.1
  325. - qcom,adreno-07000200
  326. then:
  327. properties:
  328. clocks:
  329. minItems: 6
  330. maxItems: 6
  331. clock-names:
  332. items:
  333. - const: core
  334. description: GPU Core clock
  335. - const: iface
  336. description: GPU Interface clock
  337. - const: mem_iface
  338. description: GPU Memory Interface clock
  339. - const: alt_mem_iface
  340. description: GPU Alternative Memory Interface clock
  341. - const: gmu
  342. description: CX GMU clock
  343. - const: xo
  344. description: GPUCC clocksource clock
  345. required:
  346. - clocks
  347. - clock-names
  348. - if:
  349. properties:
  350. compatible:
  351. contains:
  352. const: qcom,adreno-612.0
  353. then:
  354. properties:
  355. clocks:
  356. items:
  357. - description: GPU Core clock
  358. clock-names:
  359. items:
  360. - const: core
  361. reg:
  362. minItems: 3
  363. maxItems: 3
  364. reg-names:
  365. items:
  366. - const: kgsl_3d0_reg_memory
  367. - const: cx_mem
  368. - const: cx_dbgc
  369. required:
  370. - clocks
  371. - clock-names
  372. - if:
  373. properties:
  374. compatible:
  375. contains:
  376. enum:
  377. - qcom,adreno-615.0
  378. - qcom,adreno-618.0
  379. - qcom,adreno-619.0
  380. - qcom,adreno-621.0
  381. - qcom,adreno-623.0
  382. - qcom,adreno-630.2
  383. - qcom,adreno-635.0
  384. - qcom,adreno-640.1
  385. - qcom,adreno-650.2
  386. - qcom,adreno-660.1
  387. - qcom,adreno-663.0
  388. - qcom,adreno-680.1
  389. - qcom,adreno-690.0
  390. - qcom,adreno-730.1
  391. - qcom,adreno-43030c00
  392. - qcom,adreno-43050a01
  393. - qcom,adreno-43050c01
  394. - qcom,adreno-43051401
  395. then: # Starting with A6xx, the clocks are usually defined in the GMU node
  396. properties:
  397. clocks: false
  398. clock-names: false
  399. reg-names:
  400. minItems: 1
  401. items:
  402. - const: kgsl_3d0_reg_memory
  403. - const: cx_mem
  404. - const: cx_dbgc
  405. examples:
  406. - |
  407. // Example a3xx/4xx:
  408. #include <dt-bindings/clock/qcom,mmcc-msm8974.h>
  409. #include <dt-bindings/clock/qcom,rpmcc.h>
  410. #include <dt-bindings/interrupt-controller/irq.h>
  411. #include <dt-bindings/interrupt-controller/arm-gic.h>
  412. gpu: gpu@fdb00000 {
  413. compatible = "qcom,adreno-330.2", "qcom,adreno";
  414. reg = <0xfdb00000 0x10000>;
  415. reg-names = "kgsl_3d0_reg_memory";
  416. clock-names = "core", "iface", "mem_iface";
  417. clocks = <&mmcc OXILI_GFX3D_CLK>,
  418. <&mmcc OXILICX_AHB_CLK>,
  419. <&mmcc OXILICX_AXI_CLK>;
  420. interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
  421. interrupt-names = "kgsl_3d0_irq";
  422. sram = <&gpu_sram>;
  423. power-domains = <&mmcc OXILICX_GDSC>;
  424. operating-points-v2 = <&gpu_opp_table>;
  425. iommus = <&gpu_iommu 0>;
  426. #cooling-cells = <2>;
  427. };
  428. ocmem@fdd00000 {
  429. compatible = "qcom,msm8974-ocmem";
  430. reg = <0xfdd00000 0x2000>,
  431. <0xfec00000 0x180000>;
  432. reg-names = "ctrl", "mem";
  433. clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>,
  434. <&mmcc OCMEMCX_OCMEMNOC_CLK>;
  435. clock-names = "core", "iface";
  436. #address-cells = <1>;
  437. #size-cells = <1>;
  438. ranges = <0 0xfec00000 0x100000>;
  439. gpu_sram: gpu-sram@0 {
  440. reg = <0x0 0x100000>;
  441. };
  442. };
  443. - |
  444. // Example a6xx (with GMU):
  445. #include <dt-bindings/clock/qcom,gpucc-sdm845.h>
  446. #include <dt-bindings/clock/qcom,gcc-sdm845.h>
  447. #include <dt-bindings/power/qcom-rpmpd.h>
  448. #include <dt-bindings/interrupt-controller/irq.h>
  449. #include <dt-bindings/interrupt-controller/arm-gic.h>
  450. #include <dt-bindings/interconnect/qcom,sdm845.h>
  451. reserved-memory {
  452. #address-cells = <2>;
  453. #size-cells = <2>;
  454. zap_shader_region: gpu@8f200000 {
  455. compatible = "shared-dma-pool";
  456. reg = <0x0 0x90b00000 0x0 0xa00000>;
  457. no-map;
  458. };
  459. };
  460. gpu@5000000 {
  461. compatible = "qcom,adreno-630.2", "qcom,adreno";
  462. reg = <0x5000000 0x40000>, <0x509e000 0x10>;
  463. reg-names = "kgsl_3d0_reg_memory", "cx_mem";
  464. #cooling-cells = <2>;
  465. interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>;
  466. iommus = <&adreno_smmu 0>;
  467. operating-points-v2 = <&gpu_opp_table>;
  468. interconnects = <&rsc_hlos MASTER_GFX3D &rsc_hlos SLAVE_EBI1>;
  469. interconnect-names = "gfx-mem";
  470. qcom,gmu = <&gmu>;
  471. gpu_opp_table: opp-table {
  472. compatible = "operating-points-v2";
  473. opp-430000000 {
  474. opp-hz = /bits/ 64 <430000000>;
  475. opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
  476. opp-peak-kBps = <5412000>;
  477. };
  478. opp-355000000 {
  479. opp-hz = /bits/ 64 <355000000>;
  480. opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
  481. opp-peak-kBps = <3072000>;
  482. };
  483. opp-267000000 {
  484. opp-hz = /bits/ 64 <267000000>;
  485. opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
  486. opp-peak-kBps = <3072000>;
  487. };
  488. opp-180000000 {
  489. opp-hz = /bits/ 64 <180000000>;
  490. opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
  491. opp-peak-kBps = <1804000>;
  492. };
  493. };
  494. zap-shader {
  495. memory-region = <&zap_shader_region>;
  496. firmware-name = "qcom/LENOVO/81JL/qcdxkmsuc850.mbn";
  497. };
  498. };