Adreno or Snapdragon GPUs

Schema identifier ($id): "http://devicetree.org/schemas/display/msm/gpu.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Rob Clark <robdclark@gmail.com>"

Automatic schema selection (select) #

Properties and child nodes (properties) #

compatible — required here #

Rule for matching array elements (contains)

Allowed values (enum): "qcom,adreno", "amd,imageon"

Required in this object (required): "compatible"

Properties and child nodes (properties) #

compatible — required here #

Exactly one of these rules must match (oneOf) #

Rule 1

The driver is parsing the compat string for Adreno to figure out the chip-id.

Array item rules (items)

Item 1

String pattern (pattern): "^qcom,adreno-[0-9a-f]{8}$"

Item 2

Exact value (const): "qcom,adreno"

Rule 2

The driver is parsing the compat string for Adreno to figure out the gpu-id and patch level.

Array item rules (items)

Item 1

String pattern (pattern): "^qcom,adreno-[3-7][0-9][0-9]\\.[0-9]+$"

Item 2

Exact value (const): "qcom,adreno"

Rule 3

The driver is parsing the compat string for Imageon to figure out the gpu-id and patch level.

Array item rules (items)

Item 1

String pattern (pattern): "^amd,imageon-200\\.[0-1]$"

Item 2

Exact value (const): "amd,imageon"

clocks — not listed as required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 7

clock-names — not listed as required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 7

reg — required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 3

reg-names — not listed as required here #

Minimum number of items (minItems): 1

Array item rules (items) #

Item 1

Exact value (const): "kgsl_3d0_reg_memory"

Item 2

Exact value (const): "cx_mem"

Item 3

Exact value (const): "cx_dbgc"

interrupts — required here #

Maximum number of items (maxItems): 1

interrupt-names — not listed as required here #

Maximum number of items (maxItems): 1

interconnects — not listed as required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 2

interconnect-names — not listed as required here #

Minimum number of items (minItems): 1

Array item rules (items) #

Item 1

Exact value (const): "gfx-mem"

Item 2

Exact value (const): "ocmem"

iommus — not listed as required here #

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 64

sram — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 4

Array item rules (items) #

Maximum number of items (maxItems): 1

phandles to one or more reserved on-chip SRAM regions. phandle to the On Chip Memory (OCMEM) that's present on some a3xx and a4xx Snapdragon SoCs. See Documentation/devicetree/bindings/sram/qcom,ocmem.yaml

operating-points-v2 — not listed as required here #

true — No constraints added by this property rule.

opp-table — not listed as required here #

Value type (type): "object"

power-domains — not listed as required here #

Maximum number of items (maxItems): 1

zap-shader — not listed as required here #

Value type (type): "object"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

For a5xx and a6xx devices this node contains a memory-region that points to reserved memory to store the zap shader that can be used to help bring the GPU out of secure mode.

Properties and child nodes (properties) #

memory-region — not listed as required here

Maximum number of items (maxItems): 1

firmware-name — not listed as required here

Default name of the firmware to load to the remote processor.

#cooling-cells — not listed as required here #

Exact value (const): 2

nvmem-cell-names — not listed as required here #

Maximum number of items (maxItems): 1

nvmem-cells — not listed as required here #

efuse registers

Maximum number of items (maxItems): 1

qcom,gmu — not listed as required here #

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle

For GMU attached devices a phandle to the GMU device that will control the power for the GPU.

Required in this object (required): "compatible", "reg", "interrupts"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

All of these rules must match (allOf) #

Rule 1 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exactly one of these rules must match (oneOf)

Rule 1

String pattern (pattern): "^qcom,adreno-305\\.[0-9]+$"

Rule 2

String pattern (pattern): "^qcom,adreno-330\\.[0-9]+$"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 3

Maximum number of items (maxItems): 3

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "core"

GPU Core clock

Item 2

Exact value (const): "iface"

GPU Interface clock

Item 3

Exact value (const): "mem_iface"

GPU Memory Interface clock

Rule 2 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

String pattern (pattern): "^qcom,adreno-306\\.[0-9]+$"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 5

Maximum number of items (maxItems): 6

clock-names — not listed as required here

Exactly one of these rules must match (oneOf)

Rule 1

Array item rules (items)

Item 1

Exact value (const): "core"

GPU Core clock

Item 2

Exact value (const): "iface"

GPU Interface clock

Item 3

Exact value (const): "mem_iface"

GPU Memory Interface clock

Item 4

Exact value (const): "alt_mem_iface"

GPU Alternative Memory Interface clock

Item 5

Exact value (const): "gfx3d"

GPU 3D engine clock

Rule 2

Array item rules (items)

Item 1

Exact value (const): "core"

GPU Core clock

Item 2

Exact value (const): "iface"

GPU Interface clock

Item 3

Exact value (const): "mem"

GPU Memory clock

Item 4

Exact value (const): "mem_iface"

GPU Memory Interface clock

Item 5

Exact value (const): "alt_mem_iface"

GPU Alternative Memory Interface clock

Item 6

Exact value (const): "gfx3d"

GPU 3D engine clock

Rule 3 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

String pattern (pattern): "^qcom,adreno-320\\.[0-9]+$"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 4

Maximum number of items (maxItems): 4

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "core"

GPU Core clock

Item 2

Exact value (const): "iface"

GPU Interface clock

Item 3

Exact value (const): "mem"

GPU Memory clock

Item 4

Exact value (const): "mem_iface"

GPU Memory Interface clock

Rule 4 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

String pattern (pattern): "^qcom,adreno-405\\.[0-9]+$"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 7

Maximum number of items (maxItems): 7

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "core"

GPU Core clock

Item 2

Exact value (const): "iface"

GPU Interface clock

Item 3

Exact value (const): "mem"

GPU Memory clock

Item 4

Exact value (const): "mem_iface"

GPU Memory Interface clock

Item 5

Exact value (const): "alt_mem_iface"

GPU Alternative Memory Interface clock

Item 6

Exact value (const): "gfx3d"

GPU 3D engine clock

Item 7

Exact value (const): "rbbmtimer"

GPU RBBM Timer for Adreno 5xx series

Rule 5 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

String pattern (pattern): "^qcom,adreno-50[56]\\.[0-9]+$"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 6

Maximum number of items (maxItems): 6

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "core"

GPU Core clock

Item 2

Exact value (const): "iface"

GPU Interface clock

Item 3

Exact value (const): "mem_iface"

GPU Memory Interface clock

Item 4

Exact value (const): "alt_mem_iface"

GPU Alternative Memory Interface clock

Item 5

Exact value (const): "rbbmtimer"

GPU RBBM Timer for Adreno 5xx series

Item 6

Exact value (const): "alwayson"

GPU AON clock

Rule 6 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exactly one of these rules must match (oneOf)

Rule 1

String pattern (pattern): "^qcom,adreno-508\\.[0-9]+$"

Rule 2

String pattern (pattern): "^qcom,adreno-509\\.[0-9]+$"

Rule 3

String pattern (pattern): "^qcom,adreno-512\\.[0-9]+$"

Rule 4

String pattern (pattern): "^qcom,adreno-540\\.[0-9]+$"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 6

Maximum number of items (maxItems): 6

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "iface"

GPU Interface clock

Item 2

Exact value (const): "rbbmtimer"

GPU RBBM Timer for Adreno 5xx series

Item 3

Exact value (const): "mem"

GPU Memory clock

Item 4

Exact value (const): "mem_iface"

GPU Memory Interface clock

Item 5

Exact value (const): "rbcpr"

GPU RB Core Power Reduction clock

Item 6

Exact value (const): "core"

GPU Core clock

Rule 7 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

String pattern (pattern): "^qcom,adreno-510\\.[0-9]+$"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 6

Maximum number of items (maxItems): 6

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "core"

GPU Core clock

Item 2

Exact value (const): "iface"

GPU Interface clock

Item 3

Exact value (const): "mem"

GPU Memory clock

Item 4

Exact value (const): "mem_iface"

GPU Memory Interface clock

Item 5

Exact value (const): "rbbmtimer"

GPU RBBM Timer for Adreno 5xx series

Item 6

Exact value (const): "alwayson"

GPU AON clock

Rule 8 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

String pattern (pattern): "^qcom,adreno-530\\.[0-9]+$"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 5

Maximum number of items (maxItems): 5

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "core"

GPU Core clock

Item 2

Exact value (const): "iface"

GPU Interface clock

Item 3

Exact value (const): "rbbmtimer"

GPU RBBM Timer for Adreno 5xx series

Item 4

Exact value (const): "mem"

GPU Memory clock

Item 5

Exact value (const): "mem_iface"

GPU Memory Interface clock

Rule 9 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "qcom,adreno-610.0", "qcom,adreno-619.1", "qcom,adreno-07000200"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — required here

Minimum number of items (minItems): 6

Maximum number of items (maxItems): 6

clock-names — required here

Array item rules (items)

Item 1

Exact value (const): "core"

GPU Core clock

Item 2

Exact value (const): "iface"

GPU Interface clock

Item 3

Exact value (const): "mem_iface"

GPU Memory Interface clock

Item 4

Exact value (const): "alt_mem_iface"

GPU Alternative Memory Interface clock

Item 5

Exact value (const): "gmu"

CX GMU clock

Item 6

Exact value (const): "xo"

GPUCC clocksource clock

Required in this object (required): "clocks", "clock-names"

Rule 10 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exact value (const): "qcom,adreno-612.0"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — required here

Array item rules (items)

Item 1

GPU Core clock

clock-names — required here

Array item rules (items)

Item 1

Exact value (const): "core"

reg — not listed as required here

Minimum number of items (minItems): 3

Maximum number of items (maxItems): 3

reg-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "kgsl_3d0_reg_memory"

Item 2

Exact value (const): "cx_mem"

Item 3

Exact value (const): "cx_dbgc"

Required in this object (required): "clocks", "clock-names"

Rule 11 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Allowed values (enum): "qcom,adreno-615.0", "qcom,adreno-618.0", "qcom,adreno-619.0", "qcom,adreno-621.0", "qcom,adreno-623.0", "qcom,adreno-630.2", "qcom,adreno-635.0", "qcom,adreno-640.1", "qcom,adreno-650.2", "qcom,adreno-660.1", "qcom,adreno-663.0", "qcom,adreno-680.1", "qcom,adreno-690.0", "qcom,adreno-730.1", "qcom,adreno-43030c00", "qcom,adreno-43050a01", "qcom,adreno-43050c01", "qcom,adreno-43051401"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

false — Not permitted by this property rule.

clock-names — not listed as required here

false — Not permitted by this property rule.

reg-names — not listed as required here

Minimum number of items (minItems): 1

Array item rules (items)

Item 1

Exact value (const): "kgsl_3d0_reg_memory"

Item 2

Exact value (const): "cx_mem"

Item 3

Exact value (const): "cx_dbgc"

Examples (examples) #


// Example a3xx/4xx:

#include <dt-bindings/clock/qcom,mmcc-msm8974.h>
#include <dt-bindings/clock/qcom,rpmcc.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>

gpu: gpu@fdb00000 {
    compatible = "qcom,adreno-330.2", "qcom,adreno";

    reg = <0xfdb00000 0x10000>;
    reg-names = "kgsl_3d0_reg_memory";

    clock-names = "core", "iface", "mem_iface";
    clocks = <&mmcc OXILI_GFX3D_CLK>,
             <&mmcc OXILICX_AHB_CLK>,
             <&mmcc OXILICX_AXI_CLK>;

    interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
    interrupt-names = "kgsl_3d0_irq";

    sram = <&gpu_sram>;
    power-domains = <&mmcc OXILICX_GDSC>;
    operating-points-v2 = <&gpu_opp_table>;
    iommus = <&gpu_iommu 0>;
    #cooling-cells = <2>;
};

ocmem@fdd00000 {
    compatible = "qcom,msm8974-ocmem";

    reg = <0xfdd00000 0x2000>,
          <0xfec00000 0x180000>;
    reg-names = "ctrl", "mem";

    clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>,
             <&mmcc OCMEMCX_OCMEMNOC_CLK>;
    clock-names = "core", "iface";

    #address-cells = <1>;
    #size-cells = <1>;
    ranges = <0 0xfec00000 0x100000>;

    gpu_sram: gpu-sram@0 {
        reg = <0x0 0x100000>;
    };
};

// Example a6xx (with GMU):

#include <dt-bindings/clock/qcom,gpucc-sdm845.h>
#include <dt-bindings/clock/qcom,gcc-sdm845.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interconnect/qcom,sdm845.h>

reserved-memory {
    #address-cells = <2>;
    #size-cells = <2>;

    zap_shader_region: gpu@8f200000 {
        compatible = "shared-dma-pool";
        reg = <0x0 0x90b00000 0x0 0xa00000>;
        no-map;
    };
};

gpu@5000000 {
    compatible = "qcom,adreno-630.2", "qcom,adreno";

    reg = <0x5000000 0x40000>, <0x509e000 0x10>;
    reg-names = "kgsl_3d0_reg_memory", "cx_mem";

    #cooling-cells = <2>;

    interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>;

    iommus = <&adreno_smmu 0>;

    operating-points-v2 = <&gpu_opp_table>;

    interconnects = <&rsc_hlos MASTER_GFX3D &rsc_hlos SLAVE_EBI1>;
    interconnect-names = "gfx-mem";

    qcom,gmu = <&gmu>;

    gpu_opp_table: opp-table {
        compatible = "operating-points-v2";

        opp-430000000 {
            opp-hz = /bits/ 64 <430000000>;
            opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
            opp-peak-kBps = <5412000>;
        };

        opp-355000000 {
            opp-hz = /bits/ 64 <355000000>;
            opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
            opp-peak-kBps = <3072000>;
        };

        opp-267000000 {
            opp-hz = /bits/ 64 <267000000>;
            opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
            opp-peak-kBps = <3072000>;
        };

        opp-180000000 {
            opp-hz = /bits/ 64 <180000000>;
            opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
            opp-peak-kBps = <1804000>;
        };
    };

    zap-shader {
        memory-region = <&zap_shader_region>;
        firmware-name = "qcom/LENOVO/81JL/qcdxkmsuc850.mbn";
    };
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Line 13: dtschema does not select nodes based on pattern+const, so add custom select

Line 14: as a work-around:

Line 438: Starting with A6xx, the clocks are usually defined in the GMU node

Edit this page