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