18cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 28cc087a1SEmmanuel Vadot%YAML 1.2 38cc087a1SEmmanuel Vadot--- 48cc087a1SEmmanuel Vadot 5fac71e4eSEmmanuel Vadot$id: http://devicetree.org/schemas/display/msm/gpu.yaml# 6fac71e4eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 78cc087a1SEmmanuel Vadot 88bab661aSEmmanuel Vadottitle: Adreno or Snapdragon GPUs 98cc087a1SEmmanuel Vadot 108cc087a1SEmmanuel Vadotmaintainers: 118cc087a1SEmmanuel Vadot - Rob Clark <robdclark@gmail.com> 128cc087a1SEmmanuel Vadot 13*0e8011faSEmmanuel Vadot# dtschema does not select nodes based on pattern+const, so add custom select 14*0e8011faSEmmanuel Vadot# as a work-around: 15*0e8011faSEmmanuel Vadotselect: 16*0e8011faSEmmanuel Vadot properties: 17*0e8011faSEmmanuel Vadot compatible: 18*0e8011faSEmmanuel Vadot contains: 19*0e8011faSEmmanuel Vadot enum: 20*0e8011faSEmmanuel Vadot - qcom,adreno 21*0e8011faSEmmanuel Vadot - amd,imageon 22*0e8011faSEmmanuel Vadot required: 23*0e8011faSEmmanuel Vadot - compatible 24*0e8011faSEmmanuel Vadot 258cc087a1SEmmanuel Vadotproperties: 268cc087a1SEmmanuel Vadot compatible: 278cc087a1SEmmanuel Vadot oneOf: 288cc087a1SEmmanuel Vadot - description: | 298cc087a1SEmmanuel Vadot The driver is parsing the compat string for Adreno to 30aa1a8ff2SEmmanuel Vadot figure out the chip-id. 31aa1a8ff2SEmmanuel Vadot items: 32*0e8011faSEmmanuel Vadot - pattern: '^qcom,adreno-[0-9a-f]{8}$' 33aa1a8ff2SEmmanuel Vadot - const: qcom,adreno 34aa1a8ff2SEmmanuel Vadot - description: | 35aa1a8ff2SEmmanuel Vadot The driver is parsing the compat string for Adreno to 368cc087a1SEmmanuel Vadot figure out the gpu-id and patch level. 378cc087a1SEmmanuel Vadot items: 3801950c46SEmmanuel Vadot - pattern: '^qcom,adreno-[3-7][0-9][0-9]\.[0-9]+$' 398cc087a1SEmmanuel Vadot - const: qcom,adreno 408cc087a1SEmmanuel Vadot - description: | 418cc087a1SEmmanuel Vadot The driver is parsing the compat string for Imageon to 428cc087a1SEmmanuel Vadot figure out the gpu-id and patch level. 438cc087a1SEmmanuel Vadot items: 448cc087a1SEmmanuel Vadot - pattern: '^amd,imageon-200\.[0-1]$' 458cc087a1SEmmanuel Vadot - const: amd,imageon 468cc087a1SEmmanuel Vadot 47*0e8011faSEmmanuel Vadot clocks: 48*0e8011faSEmmanuel Vadot minItems: 2 49*0e8011faSEmmanuel Vadot maxItems: 7 508cc087a1SEmmanuel Vadot 51*0e8011faSEmmanuel Vadot clock-names: 52*0e8011faSEmmanuel Vadot minItems: 2 53*0e8011faSEmmanuel Vadot maxItems: 7 548cc087a1SEmmanuel Vadot 558cc087a1SEmmanuel Vadot reg: 568cc087a1SEmmanuel Vadot minItems: 1 578cc087a1SEmmanuel Vadot maxItems: 3 588cc087a1SEmmanuel Vadot 598cc087a1SEmmanuel Vadot reg-names: 608cc087a1SEmmanuel Vadot minItems: 1 61*0e8011faSEmmanuel Vadot items: 62*0e8011faSEmmanuel Vadot - const: kgsl_3d0_reg_memory 63*0e8011faSEmmanuel Vadot - const: cx_mem 64*0e8011faSEmmanuel Vadot - const: cx_dbgc 658cc087a1SEmmanuel Vadot 668cc087a1SEmmanuel Vadot interrupts: 678cc087a1SEmmanuel Vadot maxItems: 1 688cc087a1SEmmanuel Vadot 698cc087a1SEmmanuel Vadot interrupt-names: 708cc087a1SEmmanuel Vadot maxItems: 1 718cc087a1SEmmanuel Vadot 728cc087a1SEmmanuel Vadot interconnects: 738cc087a1SEmmanuel Vadot minItems: 1 748cc087a1SEmmanuel Vadot maxItems: 2 758cc087a1SEmmanuel Vadot 768cc087a1SEmmanuel Vadot interconnect-names: 778cc087a1SEmmanuel Vadot minItems: 1 788cc087a1SEmmanuel Vadot items: 798cc087a1SEmmanuel Vadot - const: gfx-mem 808cc087a1SEmmanuel Vadot - const: ocmem 818cc087a1SEmmanuel Vadot 828cc087a1SEmmanuel Vadot iommus: 837ef62cebSEmmanuel Vadot minItems: 1 847ef62cebSEmmanuel Vadot maxItems: 64 858cc087a1SEmmanuel Vadot 868cc087a1SEmmanuel Vadot sram: 878cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle-array 888cc087a1SEmmanuel Vadot minItems: 1 898cc087a1SEmmanuel Vadot maxItems: 4 90c9ccf3a3SEmmanuel Vadot items: 91c9ccf3a3SEmmanuel Vadot maxItems: 1 928cc087a1SEmmanuel Vadot description: | 938cc087a1SEmmanuel Vadot phandles to one or more reserved on-chip SRAM regions. 948cc087a1SEmmanuel Vadot phandle to the On Chip Memory (OCMEM) that's present on some a3xx and 958cc087a1SEmmanuel Vadot a4xx Snapdragon SoCs. See 968cc087a1SEmmanuel Vadot Documentation/devicetree/bindings/sram/qcom,ocmem.yaml 978cc087a1SEmmanuel Vadot 988cc087a1SEmmanuel Vadot operating-points-v2: true 998cc087a1SEmmanuel Vadot opp-table: 1008cc087a1SEmmanuel Vadot type: object 1018cc087a1SEmmanuel Vadot 1028cc087a1SEmmanuel Vadot power-domains: 1038cc087a1SEmmanuel Vadot maxItems: 1 1048cc087a1SEmmanuel Vadot 1058cc087a1SEmmanuel Vadot zap-shader: 1068cc087a1SEmmanuel Vadot type: object 1077ef62cebSEmmanuel Vadot additionalProperties: false 1088cc087a1SEmmanuel Vadot description: | 1098cc087a1SEmmanuel Vadot For a5xx and a6xx devices this node contains a memory-region that 1108cc087a1SEmmanuel Vadot points to reserved memory to store the zap shader that can be used to 1118cc087a1SEmmanuel Vadot help bring the GPU out of secure mode. 1128cc087a1SEmmanuel Vadot properties: 1138cc087a1SEmmanuel Vadot memory-region: 114cb7aa33aSEmmanuel Vadot maxItems: 1 1158cc087a1SEmmanuel Vadot 1168cc087a1SEmmanuel Vadot firmware-name: 1178cc087a1SEmmanuel Vadot description: | 1188cc087a1SEmmanuel Vadot Default name of the firmware to load to the remote processor. 1198cc087a1SEmmanuel Vadot 1208cc087a1SEmmanuel Vadot "#cooling-cells": 1218cc087a1SEmmanuel Vadot const: 2 1228cc087a1SEmmanuel Vadot 1238cc087a1SEmmanuel Vadot nvmem-cell-names: 1248cc087a1SEmmanuel Vadot maxItems: 1 1258cc087a1SEmmanuel Vadot 1268cc087a1SEmmanuel Vadot nvmem-cells: 1278cc087a1SEmmanuel Vadot description: efuse registers 1288cc087a1SEmmanuel Vadot maxItems: 1 1298cc087a1SEmmanuel Vadot 1308cc087a1SEmmanuel Vadot qcom,gmu: 1318cc087a1SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle 1328cc087a1SEmmanuel Vadot description: | 1338cc087a1SEmmanuel Vadot For GMU attached devices a phandle to the GMU device that will 1348cc087a1SEmmanuel Vadot control the power for the GPU. 1358cc087a1SEmmanuel Vadot 1368cc087a1SEmmanuel Vadot 1378cc087a1SEmmanuel Vadotrequired: 1388cc087a1SEmmanuel Vadot - compatible 1398cc087a1SEmmanuel Vadot - reg 1408cc087a1SEmmanuel Vadot - interrupts 1418cc087a1SEmmanuel Vadot 1428cc087a1SEmmanuel VadotadditionalProperties: false 1438cc087a1SEmmanuel Vadot 1448cc087a1SEmmanuel VadotallOf: 1458cc087a1SEmmanuel Vadot - if: 1468cc087a1SEmmanuel Vadot properties: 1478cc087a1SEmmanuel Vadot compatible: 1488cc087a1SEmmanuel Vadot contains: 14901950c46SEmmanuel Vadot pattern: '^qcom,adreno-[3-5][0-9][0-9]\.[0-9]+$' 1508cc087a1SEmmanuel Vadot 1518cc087a1SEmmanuel Vadot then: 1528cc087a1SEmmanuel Vadot properties: 1538cc087a1SEmmanuel Vadot clocks: 1548cc087a1SEmmanuel Vadot minItems: 2 1558cc087a1SEmmanuel Vadot maxItems: 7 1568cc087a1SEmmanuel Vadot 1578cc087a1SEmmanuel Vadot clock-names: 1588cc087a1SEmmanuel Vadot items: 1598cc087a1SEmmanuel Vadot anyOf: 1608cc087a1SEmmanuel Vadot - const: core 1618cc087a1SEmmanuel Vadot description: GPU Core clock 1628cc087a1SEmmanuel Vadot - const: iface 1638cc087a1SEmmanuel Vadot description: GPU Interface clock 1648cc087a1SEmmanuel Vadot - const: mem 1658cc087a1SEmmanuel Vadot description: GPU Memory clock 1668cc087a1SEmmanuel Vadot - const: mem_iface 1678cc087a1SEmmanuel Vadot description: GPU Memory Interface clock 1688cc087a1SEmmanuel Vadot - const: alt_mem_iface 1698cc087a1SEmmanuel Vadot description: GPU Alternative Memory Interface clock 1708cc087a1SEmmanuel Vadot - const: gfx3d 1718cc087a1SEmmanuel Vadot description: GPU 3D engine clock 1728cc087a1SEmmanuel Vadot - const: rbbmtimer 1738cc087a1SEmmanuel Vadot description: GPU RBBM Timer for Adreno 5xx series 174cb7aa33aSEmmanuel Vadot - const: rbcpr 175cb7aa33aSEmmanuel Vadot description: GPU RB Core Power Reduction clock 1768cc087a1SEmmanuel Vadot minItems: 2 1778cc087a1SEmmanuel Vadot maxItems: 7 1788cc087a1SEmmanuel Vadot 1798cc087a1SEmmanuel Vadot required: 1808cc087a1SEmmanuel Vadot - clocks 1818cc087a1SEmmanuel Vadot - clock-names 182f126890aSEmmanuel Vadot 1838cc087a1SEmmanuel Vadot - if: 1848cc087a1SEmmanuel Vadot properties: 1858cc087a1SEmmanuel Vadot compatible: 1868cc087a1SEmmanuel Vadot contains: 187f126890aSEmmanuel Vadot enum: 188f126890aSEmmanuel Vadot - qcom,adreno-610.0 189f126890aSEmmanuel Vadot - qcom,adreno-619.1 190f126890aSEmmanuel Vadot then: 191f126890aSEmmanuel Vadot properties: 192f126890aSEmmanuel Vadot clocks: 193f126890aSEmmanuel Vadot minItems: 6 194f126890aSEmmanuel Vadot maxItems: 6 195f126890aSEmmanuel Vadot 196f126890aSEmmanuel Vadot clock-names: 197f126890aSEmmanuel Vadot items: 198f126890aSEmmanuel Vadot - const: core 199f126890aSEmmanuel Vadot description: GPU Core clock 200f126890aSEmmanuel Vadot - const: iface 201f126890aSEmmanuel Vadot description: GPU Interface clock 202f126890aSEmmanuel Vadot - const: mem_iface 203f126890aSEmmanuel Vadot description: GPU Memory Interface clock 204f126890aSEmmanuel Vadot - const: alt_mem_iface 205f126890aSEmmanuel Vadot description: GPU Alternative Memory Interface clock 206f126890aSEmmanuel Vadot - const: gmu 207f126890aSEmmanuel Vadot description: CX GMU clock 208f126890aSEmmanuel Vadot - const: xo 209f126890aSEmmanuel Vadot description: GPUCC clocksource clock 210f126890aSEmmanuel Vadot 211f126890aSEmmanuel Vadot reg-names: 212f126890aSEmmanuel Vadot minItems: 1 213f126890aSEmmanuel Vadot items: 214f126890aSEmmanuel Vadot - const: kgsl_3d0_reg_memory 215f126890aSEmmanuel Vadot - const: cx_dbgc 216f126890aSEmmanuel Vadot 217f126890aSEmmanuel Vadot required: 218f126890aSEmmanuel Vadot - clocks 219f126890aSEmmanuel Vadot - clock-names 220f126890aSEmmanuel Vadot else: 221f126890aSEmmanuel Vadot if: 222f126890aSEmmanuel Vadot properties: 223f126890aSEmmanuel Vadot compatible: 224f126890aSEmmanuel Vadot contains: 22501950c46SEmmanuel Vadot pattern: '^qcom,adreno-[67][0-9][0-9]\.[0-9]+$' 2268cc087a1SEmmanuel Vadot 227f126890aSEmmanuel Vadot then: # Starting with A6xx, the clocks are usually defined in the GMU node 2288cc087a1SEmmanuel Vadot properties: 2298cc087a1SEmmanuel Vadot clocks: false 2308cc087a1SEmmanuel Vadot clock-names: false 2318cc087a1SEmmanuel Vadot 232f126890aSEmmanuel Vadot reg-names: 233f126890aSEmmanuel Vadot minItems: 1 234f126890aSEmmanuel Vadot items: 235f126890aSEmmanuel Vadot - const: kgsl_3d0_reg_memory 236f126890aSEmmanuel Vadot - const: cx_mem 237f126890aSEmmanuel Vadot - const: cx_dbgc 238f126890aSEmmanuel Vadot 2398cc087a1SEmmanuel Vadotexamples: 2408cc087a1SEmmanuel Vadot - | 2418cc087a1SEmmanuel Vadot 2428cc087a1SEmmanuel Vadot // Example a3xx/4xx: 2438cc087a1SEmmanuel Vadot 2448cc087a1SEmmanuel Vadot #include <dt-bindings/clock/qcom,mmcc-msm8974.h> 2458cc087a1SEmmanuel Vadot #include <dt-bindings/clock/qcom,rpmcc.h> 2468cc087a1SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 2478cc087a1SEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 2488cc087a1SEmmanuel Vadot 2498cc087a1SEmmanuel Vadot gpu: gpu@fdb00000 { 2508cc087a1SEmmanuel Vadot compatible = "qcom,adreno-330.2", "qcom,adreno"; 2518cc087a1SEmmanuel Vadot 2528cc087a1SEmmanuel Vadot reg = <0xfdb00000 0x10000>; 2538cc087a1SEmmanuel Vadot reg-names = "kgsl_3d0_reg_memory"; 2548cc087a1SEmmanuel Vadot 2558cc087a1SEmmanuel Vadot clock-names = "core", "iface", "mem_iface"; 2568cc087a1SEmmanuel Vadot clocks = <&mmcc OXILI_GFX3D_CLK>, 2578cc087a1SEmmanuel Vadot <&mmcc OXILICX_AHB_CLK>, 2588cc087a1SEmmanuel Vadot <&mmcc OXILICX_AXI_CLK>; 2598cc087a1SEmmanuel Vadot 2608cc087a1SEmmanuel Vadot interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; 2618cc087a1SEmmanuel Vadot interrupt-names = "kgsl_3d0_irq"; 2628cc087a1SEmmanuel Vadot 2638cc087a1SEmmanuel Vadot sram = <&gpu_sram>; 2648cc087a1SEmmanuel Vadot power-domains = <&mmcc OXILICX_GDSC>; 2658cc087a1SEmmanuel Vadot operating-points-v2 = <&gpu_opp_table>; 2668cc087a1SEmmanuel Vadot iommus = <&gpu_iommu 0>; 2678cc087a1SEmmanuel Vadot #cooling-cells = <2>; 2688cc087a1SEmmanuel Vadot }; 2698cc087a1SEmmanuel Vadot 2708cc087a1SEmmanuel Vadot ocmem@fdd00000 { 2718cc087a1SEmmanuel Vadot compatible = "qcom,msm8974-ocmem"; 2728cc087a1SEmmanuel Vadot 2738cc087a1SEmmanuel Vadot reg = <0xfdd00000 0x2000>, 2748cc087a1SEmmanuel Vadot <0xfec00000 0x180000>; 2758cc087a1SEmmanuel Vadot reg-names = "ctrl", "mem"; 2768cc087a1SEmmanuel Vadot 2778cc087a1SEmmanuel Vadot clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>, 2788cc087a1SEmmanuel Vadot <&mmcc OCMEMCX_OCMEMNOC_CLK>; 2798cc087a1SEmmanuel Vadot clock-names = "core", "iface"; 2808cc087a1SEmmanuel Vadot 2818cc087a1SEmmanuel Vadot #address-cells = <1>; 2828cc087a1SEmmanuel Vadot #size-cells = <1>; 2838cc087a1SEmmanuel Vadot ranges = <0 0xfec00000 0x100000>; 2848cc087a1SEmmanuel Vadot 2858cc087a1SEmmanuel Vadot gpu_sram: gpu-sram@0 { 2868cc087a1SEmmanuel Vadot reg = <0x0 0x100000>; 2878cc087a1SEmmanuel Vadot }; 2888cc087a1SEmmanuel Vadot }; 2898cc087a1SEmmanuel Vadot - | 2908cc087a1SEmmanuel Vadot 2918cc087a1SEmmanuel Vadot // Example a6xx (with GMU): 2928cc087a1SEmmanuel Vadot 2938cc087a1SEmmanuel Vadot #include <dt-bindings/clock/qcom,gpucc-sdm845.h> 2948cc087a1SEmmanuel Vadot #include <dt-bindings/clock/qcom,gcc-sdm845.h> 2958cc087a1SEmmanuel Vadot #include <dt-bindings/power/qcom-rpmpd.h> 2968cc087a1SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 2978cc087a1SEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 2988cc087a1SEmmanuel Vadot #include <dt-bindings/interconnect/qcom,sdm845.h> 2998cc087a1SEmmanuel Vadot 3008cc087a1SEmmanuel Vadot reserved-memory { 3018cc087a1SEmmanuel Vadot #address-cells = <2>; 3028cc087a1SEmmanuel Vadot #size-cells = <2>; 3038cc087a1SEmmanuel Vadot 3048cc087a1SEmmanuel Vadot zap_shader_region: gpu@8f200000 { 3058cc087a1SEmmanuel Vadot compatible = "shared-dma-pool"; 3068cc087a1SEmmanuel Vadot reg = <0x0 0x90b00000 0x0 0xa00000>; 3078cc087a1SEmmanuel Vadot no-map; 3088cc087a1SEmmanuel Vadot }; 3098cc087a1SEmmanuel Vadot }; 3108cc087a1SEmmanuel Vadot 3118cc087a1SEmmanuel Vadot gpu@5000000 { 3128cc087a1SEmmanuel Vadot compatible = "qcom,adreno-630.2", "qcom,adreno"; 3138cc087a1SEmmanuel Vadot 3148cc087a1SEmmanuel Vadot reg = <0x5000000 0x40000>, <0x509e000 0x10>; 3158cc087a1SEmmanuel Vadot reg-names = "kgsl_3d0_reg_memory", "cx_mem"; 3168cc087a1SEmmanuel Vadot 3178cc087a1SEmmanuel Vadot #cooling-cells = <2>; 3188cc087a1SEmmanuel Vadot 3198cc087a1SEmmanuel Vadot interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>; 3208cc087a1SEmmanuel Vadot 3218cc087a1SEmmanuel Vadot iommus = <&adreno_smmu 0>; 3228cc087a1SEmmanuel Vadot 3238cc087a1SEmmanuel Vadot operating-points-v2 = <&gpu_opp_table>; 3248cc087a1SEmmanuel Vadot 3258cc087a1SEmmanuel Vadot interconnects = <&rsc_hlos MASTER_GFX3D &rsc_hlos SLAVE_EBI1>; 3268cc087a1SEmmanuel Vadot interconnect-names = "gfx-mem"; 3278cc087a1SEmmanuel Vadot 3288cc087a1SEmmanuel Vadot qcom,gmu = <&gmu>; 3298cc087a1SEmmanuel Vadot 3308cc087a1SEmmanuel Vadot gpu_opp_table: opp-table { 3318cc087a1SEmmanuel Vadot compatible = "operating-points-v2"; 3328cc087a1SEmmanuel Vadot 3338cc087a1SEmmanuel Vadot opp-430000000 { 3348cc087a1SEmmanuel Vadot opp-hz = /bits/ 64 <430000000>; 3358cc087a1SEmmanuel Vadot opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>; 3368cc087a1SEmmanuel Vadot opp-peak-kBps = <5412000>; 3378cc087a1SEmmanuel Vadot }; 3388cc087a1SEmmanuel Vadot 3398cc087a1SEmmanuel Vadot opp-355000000 { 3408cc087a1SEmmanuel Vadot opp-hz = /bits/ 64 <355000000>; 3418cc087a1SEmmanuel Vadot opp-level = <RPMH_REGULATOR_LEVEL_SVS>; 3428cc087a1SEmmanuel Vadot opp-peak-kBps = <3072000>; 3438cc087a1SEmmanuel Vadot }; 3448cc087a1SEmmanuel Vadot 3458cc087a1SEmmanuel Vadot opp-267000000 { 3468cc087a1SEmmanuel Vadot opp-hz = /bits/ 64 <267000000>; 3478cc087a1SEmmanuel Vadot opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>; 3488cc087a1SEmmanuel Vadot opp-peak-kBps = <3072000>; 3498cc087a1SEmmanuel Vadot }; 3508cc087a1SEmmanuel Vadot 3518cc087a1SEmmanuel Vadot opp-180000000 { 3528cc087a1SEmmanuel Vadot opp-hz = /bits/ 64 <180000000>; 3538cc087a1SEmmanuel Vadot opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>; 3548cc087a1SEmmanuel Vadot opp-peak-kBps = <1804000>; 3558cc087a1SEmmanuel Vadot }; 3568cc087a1SEmmanuel Vadot }; 3578cc087a1SEmmanuel Vadot 3588cc087a1SEmmanuel Vadot zap-shader { 3598cc087a1SEmmanuel Vadot memory-region = <&zap_shader_region>; 3608cc087a1SEmmanuel Vadot firmware-name = "qcom/LENOVO/81JL/qcdxkmsuc850.mbn"; 3618cc087a1SEmmanuel Vadot }; 3628cc087a1SEmmanuel Vadot }; 363