1# SPDX-License-Identifier: GPL-2.0-only
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/gpu/arm,mali-bifrost.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: ARM Mali Bifrost GPU
8
9maintainers:
10  - Rob Herring <robh@kernel.org>
11
12properties:
13  $nodename:
14    pattern: '^gpu@[a-f0-9]+$'
15
16  compatible:
17    oneOf:
18      - items:
19          - enum:
20              - amlogic,meson-g12a-mali
21              - mediatek,mt8183-mali
22              - realtek,rtd1619-mali
23              - renesas,r9a07g044-mali
24              - renesas,r9a07g054-mali
25              - rockchip,px30-mali
26              - rockchip,rk3568-mali
27          - const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully discoverable
28      - items:
29          - enum:
30              - mediatek,mt8192-mali
31          - const: arm,mali-valhall-jm # Mali Valhall GPU model/revision is fully discoverable
32
33  reg:
34    maxItems: 1
35
36  interrupts:
37    minItems: 3
38    items:
39      - description: Job interrupt
40      - description: MMU interrupt
41      - description: GPU interrupt
42      - description: Event interrupt
43
44  interrupt-names:
45    minItems: 3
46    items:
47      - const: job
48      - const: mmu
49      - const: gpu
50      - const: event
51
52  clocks:
53    minItems: 1
54    maxItems: 3
55
56  clock-names: true
57
58  mali-supply: true
59
60  sram-supply: true
61
62  operating-points-v2: true
63
64  power-domains:
65    minItems: 1
66    maxItems: 3
67
68  resets:
69    minItems: 1
70    maxItems: 3
71
72  reset-names: true
73
74  "#cooling-cells":
75    const: 2
76
77  dynamic-power-coefficient:
78    $ref: '/schemas/types.yaml#/definitions/uint32'
79    description:
80      A u32 value that represents the running time dynamic
81      power coefficient in units of uW/MHz/V^2. The
82      coefficient can either be calculated from power
83      measurements or derived by analysis.
84
85      The dynamic power consumption of the GPU is
86      proportional to the square of the Voltage (V) and
87      the clock frequency (f). The coefficient is used to
88      calculate the dynamic power as below -
89
90      Pdyn = dynamic-power-coefficient * V^2 * f
91
92      where voltage is in V, frequency is in MHz.
93
94  dma-coherent: true
95
96required:
97  - compatible
98  - reg
99  - interrupts
100  - interrupt-names
101  - clocks
102
103additionalProperties: false
104
105allOf:
106  - if:
107      properties:
108        compatible:
109          contains:
110            const: amlogic,meson-g12a-mali
111    then:
112      required:
113        - resets
114  - if:
115      properties:
116        compatible:
117          contains:
118            enum:
119              - renesas,r9a07g044-mali
120              - renesas,r9a07g054-mali
121    then:
122      properties:
123        interrupts:
124          minItems: 4
125        interrupt-names:
126          minItems: 4
127        clocks:
128          minItems: 3
129        clock-names:
130          items:
131            - const: gpu
132            - const: bus
133            - const: bus_ace
134        resets:
135          minItems: 3
136        reset-names:
137          items:
138            - const: rst
139            - const: axi_rst
140            - const: ace_rst
141      required:
142        - clock-names
143        - power-domains
144        - resets
145        - reset-names
146  - if:
147      properties:
148        compatible:
149          contains:
150            const: mediatek,mt8183-mali
151    then:
152      properties:
153        power-domains:
154          minItems: 3
155        power-domain-names:
156          items:
157            - const: core0
158            - const: core1
159            - const: core2
160
161      required:
162        - sram-supply
163        - power-domains
164        - power-domain-names
165    else:
166      properties:
167        power-domains:
168          maxItems: 1
169        sram-supply: false
170  - if:
171      properties:
172        compatible:
173          contains:
174            const: rockchip,rk3568-mali
175    then:
176      properties:
177        clocks:
178          minItems: 2
179        clock-names:
180          items:
181            - const: gpu
182            - const: bus
183      required:
184        - clock-names
185
186examples:
187  - |
188    #include <dt-bindings/interrupt-controller/irq.h>
189    #include <dt-bindings/interrupt-controller/arm-gic.h>
190
191    gpu@ffe40000 {
192      compatible = "amlogic,meson-g12a-mali", "arm,mali-bifrost";
193      reg = <0xffe40000 0x10000>;
194      interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
195             <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
196             <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
197      interrupt-names = "job", "mmu", "gpu";
198      clocks = <&clk 1>;
199      mali-supply = <&vdd_gpu>;
200      operating-points-v2 = <&gpu_opp_table>;
201      resets = <&reset 0>, <&reset 1>;
202    };
203
204    gpu_opp_table: opp-table {
205      compatible = "operating-points-v2";
206
207      opp-533000000 {
208        opp-hz = /bits/ 64 <533000000>;
209        opp-microvolt = <1250000>;
210      };
211      opp-450000000 {
212        opp-hz = /bits/ 64 <450000000>;
213        opp-microvolt = <1150000>;
214      };
215      opp-400000000 {
216        opp-hz = /bits/ 64 <400000000>;
217        opp-microvolt = <1125000>;
218      };
219      opp-350000000 {
220        opp-hz = /bits/ 64 <350000000>;
221        opp-microvolt = <1075000>;
222      };
223      opp-266000000 {
224        opp-hz = /bits/ 64 <266000000>;
225        opp-microvolt = <1025000>;
226      };
227      opp-160000000 {
228        opp-hz = /bits/ 64 <160000000>;
229        opp-microvolt = <925000>;
230      };
231      opp-100000000 {
232        opp-hz = /bits/ 64 <100000000>;
233        opp-microvolt = <912500>;
234      };
235    };
236
237...
238