xref: /freebsd/sys/contrib/device-tree/Bindings/gpu/arm,mali-bifrost.yaml (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/gpu/arm,mali-bifrost.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: ARM Mali Bifrost GPU
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Rob Herring <robh@kernel.org>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotproperties:
13c66ec88fSEmmanuel Vadot  $nodename:
14c66ec88fSEmmanuel Vadot    pattern: '^gpu@[a-f0-9]+$'
15c66ec88fSEmmanuel Vadot
16c66ec88fSEmmanuel Vadot  compatible:
17b97ee269SEmmanuel Vadot    oneOf:
18b97ee269SEmmanuel Vadot      - items:
19c66ec88fSEmmanuel Vadot          - enum:
20c66ec88fSEmmanuel Vadot              - amlogic,meson-g12a-mali
215956d97fSEmmanuel Vadot              - mediatek,mt8183-mali
22fac71e4eSEmmanuel Vadot              - mediatek,mt8183b-mali
23fac71e4eSEmmanuel Vadot              - mediatek,mt8186-mali
24c66ec88fSEmmanuel Vadot              - realtek,rtd1619-mali
25e67e8565SEmmanuel Vadot              - renesas,r9a07g044-mali
26c9ccf3a3SEmmanuel Vadot              - renesas,r9a07g054-mali
27c66ec88fSEmmanuel Vadot              - rockchip,px30-mali
28354d7675SEmmanuel Vadot              - rockchip,rk3568-mali
29c66ec88fSEmmanuel Vadot          - const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully discoverable
30b97ee269SEmmanuel Vadot      - items:
31b97ee269SEmmanuel Vadot          - enum:
32fac71e4eSEmmanuel Vadot              - mediatek,mt8195-mali
33fac71e4eSEmmanuel Vadot          - const: mediatek,mt8192-mali
34fac71e4eSEmmanuel Vadot          - const: arm,mali-valhall-jm # Mali Valhall GPU model/revision is fully discoverable
35fac71e4eSEmmanuel Vadot      - items:
36fac71e4eSEmmanuel Vadot          - enum:
37b97ee269SEmmanuel Vadot              - mediatek,mt8192-mali
38b97ee269SEmmanuel Vadot          - const: arm,mali-valhall-jm # Mali Valhall GPU model/revision is fully discoverable
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  reg:
41c66ec88fSEmmanuel Vadot    maxItems: 1
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot  interrupts:
44e67e8565SEmmanuel Vadot    minItems: 3
45c66ec88fSEmmanuel Vadot    items:
46c66ec88fSEmmanuel Vadot      - description: Job interrupt
47c66ec88fSEmmanuel Vadot      - description: MMU interrupt
48c66ec88fSEmmanuel Vadot      - description: GPU interrupt
49e67e8565SEmmanuel Vadot      - description: Event interrupt
50c66ec88fSEmmanuel Vadot
51c66ec88fSEmmanuel Vadot  interrupt-names:
52e67e8565SEmmanuel Vadot    minItems: 3
53c66ec88fSEmmanuel Vadot    items:
54c66ec88fSEmmanuel Vadot      - const: job
55c66ec88fSEmmanuel Vadot      - const: mmu
56c66ec88fSEmmanuel Vadot      - const: gpu
57e67e8565SEmmanuel Vadot      - const: event
58c66ec88fSEmmanuel Vadot
59c66ec88fSEmmanuel Vadot  clocks:
60e67e8565SEmmanuel Vadot    minItems: 1
61e67e8565SEmmanuel Vadot    maxItems: 3
62e67e8565SEmmanuel Vadot
63e67e8565SEmmanuel Vadot  clock-names: true
64c66ec88fSEmmanuel Vadot
65c66ec88fSEmmanuel Vadot  mali-supply: true
66c66ec88fSEmmanuel Vadot
675956d97fSEmmanuel Vadot  sram-supply: true
685956d97fSEmmanuel Vadot
69c66ec88fSEmmanuel Vadot  operating-points-v2: true
70c66ec88fSEmmanuel Vadot
71c66ec88fSEmmanuel Vadot  power-domains:
725956d97fSEmmanuel Vadot    minItems: 1
73fac71e4eSEmmanuel Vadot    maxItems: 5
74fac71e4eSEmmanuel Vadot
75fac71e4eSEmmanuel Vadot  power-domain-names:
76fac71e4eSEmmanuel Vadot    minItems: 2
77fac71e4eSEmmanuel Vadot    maxItems: 5
78c66ec88fSEmmanuel Vadot
79c66ec88fSEmmanuel Vadot  resets:
80e67e8565SEmmanuel Vadot    minItems: 1
81e67e8565SEmmanuel Vadot    maxItems: 3
82e67e8565SEmmanuel Vadot
83e67e8565SEmmanuel Vadot  reset-names: true
84c66ec88fSEmmanuel Vadot
85c66ec88fSEmmanuel Vadot  "#cooling-cells":
86c66ec88fSEmmanuel Vadot    const: 2
87c66ec88fSEmmanuel Vadot
885def4c47SEmmanuel Vadot  dynamic-power-coefficient:
89*f126890aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
905def4c47SEmmanuel Vadot    description:
915def4c47SEmmanuel Vadot      A u32 value that represents the running time dynamic
925def4c47SEmmanuel Vadot      power coefficient in units of uW/MHz/V^2. The
935def4c47SEmmanuel Vadot      coefficient can either be calculated from power
945def4c47SEmmanuel Vadot      measurements or derived by analysis.
955def4c47SEmmanuel Vadot
965def4c47SEmmanuel Vadot      The dynamic power consumption of the GPU is
975def4c47SEmmanuel Vadot      proportional to the square of the Voltage (V) and
985def4c47SEmmanuel Vadot      the clock frequency (f). The coefficient is used to
995def4c47SEmmanuel Vadot      calculate the dynamic power as below -
1005def4c47SEmmanuel Vadot
1015def4c47SEmmanuel Vadot      Pdyn = dynamic-power-coefficient * V^2 * f
1025def4c47SEmmanuel Vadot
1035def4c47SEmmanuel Vadot      where voltage is in V, frequency is in MHz.
1045def4c47SEmmanuel Vadot
1052eb4d8dcSEmmanuel Vadot  dma-coherent: true
1062eb4d8dcSEmmanuel Vadot
107fac71e4eSEmmanuel Vadot  nvmem-cell-names:
108fac71e4eSEmmanuel Vadot    items:
109fac71e4eSEmmanuel Vadot      - const: speed-bin
110fac71e4eSEmmanuel Vadot
111fac71e4eSEmmanuel Vadot  nvmem-cells:
112fac71e4eSEmmanuel Vadot    maxItems: 1
113fac71e4eSEmmanuel Vadot
114c66ec88fSEmmanuel Vadotrequired:
115c66ec88fSEmmanuel Vadot  - compatible
116c66ec88fSEmmanuel Vadot  - reg
117c66ec88fSEmmanuel Vadot  - interrupts
118c66ec88fSEmmanuel Vadot  - interrupt-names
119c66ec88fSEmmanuel Vadot  - clocks
120c66ec88fSEmmanuel Vadot
121c66ec88fSEmmanuel VadotadditionalProperties: false
122c66ec88fSEmmanuel Vadot
123c66ec88fSEmmanuel VadotallOf:
124c66ec88fSEmmanuel Vadot  - if:
125c66ec88fSEmmanuel Vadot      properties:
126c66ec88fSEmmanuel Vadot        compatible:
127c66ec88fSEmmanuel Vadot          contains:
128c66ec88fSEmmanuel Vadot            const: amlogic,meson-g12a-mali
129c66ec88fSEmmanuel Vadot    then:
130fac71e4eSEmmanuel Vadot      properties:
131fac71e4eSEmmanuel Vadot        power-domains:
132fac71e4eSEmmanuel Vadot          maxItems: 1
133fac71e4eSEmmanuel Vadot        power-domain-names: false
134c66ec88fSEmmanuel Vadot      required:
135c66ec88fSEmmanuel Vadot        - resets
1365956d97fSEmmanuel Vadot  - if:
1375956d97fSEmmanuel Vadot      properties:
1385956d97fSEmmanuel Vadot        compatible:
1395956d97fSEmmanuel Vadot          contains:
140c9ccf3a3SEmmanuel Vadot            enum:
141c9ccf3a3SEmmanuel Vadot              - renesas,r9a07g044-mali
142c9ccf3a3SEmmanuel Vadot              - renesas,r9a07g054-mali
143e67e8565SEmmanuel Vadot    then:
144e67e8565SEmmanuel Vadot      properties:
145e67e8565SEmmanuel Vadot        interrupts:
146e67e8565SEmmanuel Vadot          minItems: 4
147e67e8565SEmmanuel Vadot        interrupt-names:
148e67e8565SEmmanuel Vadot          minItems: 4
149e67e8565SEmmanuel Vadot        clocks:
150e67e8565SEmmanuel Vadot          minItems: 3
151e67e8565SEmmanuel Vadot        clock-names:
152e67e8565SEmmanuel Vadot          items:
153e67e8565SEmmanuel Vadot            - const: gpu
154e67e8565SEmmanuel Vadot            - const: bus
155e67e8565SEmmanuel Vadot            - const: bus_ace
156fac71e4eSEmmanuel Vadot        power-domains:
157fac71e4eSEmmanuel Vadot          maxItems: 1
158fac71e4eSEmmanuel Vadot        power-domain-names: false
159e67e8565SEmmanuel Vadot        resets:
160e67e8565SEmmanuel Vadot          minItems: 3
161e67e8565SEmmanuel Vadot        reset-names:
162e67e8565SEmmanuel Vadot          items:
163e67e8565SEmmanuel Vadot            - const: rst
164e67e8565SEmmanuel Vadot            - const: axi_rst
165e67e8565SEmmanuel Vadot            - const: ace_rst
166e67e8565SEmmanuel Vadot      required:
167e67e8565SEmmanuel Vadot        - clock-names
168e67e8565SEmmanuel Vadot        - power-domains
169e67e8565SEmmanuel Vadot        - resets
170e67e8565SEmmanuel Vadot        - reset-names
171e67e8565SEmmanuel Vadot  - if:
172e67e8565SEmmanuel Vadot      properties:
173e67e8565SEmmanuel Vadot        compatible:
174e67e8565SEmmanuel Vadot          contains:
1755956d97fSEmmanuel Vadot            const: mediatek,mt8183-mali
1765956d97fSEmmanuel Vadot    then:
1775956d97fSEmmanuel Vadot      properties:
1785956d97fSEmmanuel Vadot        power-domains:
1795956d97fSEmmanuel Vadot          minItems: 3
180fac71e4eSEmmanuel Vadot          maxItems: 3
1815956d97fSEmmanuel Vadot        power-domain-names:
1825956d97fSEmmanuel Vadot          items:
1835956d97fSEmmanuel Vadot            - const: core0
1845956d97fSEmmanuel Vadot            - const: core1
1855956d97fSEmmanuel Vadot            - const: core2
1865956d97fSEmmanuel Vadot
1875956d97fSEmmanuel Vadot      required:
1885956d97fSEmmanuel Vadot        - sram-supply
1895956d97fSEmmanuel Vadot        - power-domains
1905956d97fSEmmanuel Vadot        - power-domain-names
1915956d97fSEmmanuel Vadot    else:
1925956d97fSEmmanuel Vadot      properties:
1935956d97fSEmmanuel Vadot        sram-supply: false
194c9ccf3a3SEmmanuel Vadot  - if:
195c9ccf3a3SEmmanuel Vadot      properties:
196c9ccf3a3SEmmanuel Vadot        compatible:
197c9ccf3a3SEmmanuel Vadot          contains:
198fac71e4eSEmmanuel Vadot            const: mediatek,mt8183b-mali
199fac71e4eSEmmanuel Vadot    then:
200fac71e4eSEmmanuel Vadot      properties:
201fac71e4eSEmmanuel Vadot        power-domains:
202fac71e4eSEmmanuel Vadot          minItems: 3
203fac71e4eSEmmanuel Vadot          maxItems: 3
204fac71e4eSEmmanuel Vadot        power-domain-names:
205fac71e4eSEmmanuel Vadot          items:
206fac71e4eSEmmanuel Vadot            - const: core0
207fac71e4eSEmmanuel Vadot            - const: core1
208fac71e4eSEmmanuel Vadot            - const: core2
209fac71e4eSEmmanuel Vadot      required:
210fac71e4eSEmmanuel Vadot        - power-domains
211fac71e4eSEmmanuel Vadot        - power-domain-names
212fac71e4eSEmmanuel Vadot  - if:
213fac71e4eSEmmanuel Vadot      properties:
214fac71e4eSEmmanuel Vadot        compatible:
215fac71e4eSEmmanuel Vadot          contains:
216fac71e4eSEmmanuel Vadot            const: mediatek,mt8186-mali
217fac71e4eSEmmanuel Vadot    then:
218fac71e4eSEmmanuel Vadot      properties:
219fac71e4eSEmmanuel Vadot        power-domains:
220fac71e4eSEmmanuel Vadot          minItems: 2
221fac71e4eSEmmanuel Vadot          maxItems: 2
222fac71e4eSEmmanuel Vadot        power-domain-names:
223fac71e4eSEmmanuel Vadot          items:
224fac71e4eSEmmanuel Vadot            - const: core0
225fac71e4eSEmmanuel Vadot            - const: core1
226fac71e4eSEmmanuel Vadot      required:
227fac71e4eSEmmanuel Vadot        - power-domains
228fac71e4eSEmmanuel Vadot        - power-domain-names
229fac71e4eSEmmanuel Vadot  - if:
230fac71e4eSEmmanuel Vadot      properties:
231fac71e4eSEmmanuel Vadot        compatible:
232fac71e4eSEmmanuel Vadot          contains:
233fac71e4eSEmmanuel Vadot            const: mediatek,mt8192-mali
234fac71e4eSEmmanuel Vadot    then:
235fac71e4eSEmmanuel Vadot      properties:
236fac71e4eSEmmanuel Vadot        power-domains:
237fac71e4eSEmmanuel Vadot          minItems: 5
238fac71e4eSEmmanuel Vadot        power-domain-names:
239fac71e4eSEmmanuel Vadot          items:
240fac71e4eSEmmanuel Vadot            - const: core0
241fac71e4eSEmmanuel Vadot            - const: core1
242fac71e4eSEmmanuel Vadot            - const: core2
243fac71e4eSEmmanuel Vadot            - const: core3
244fac71e4eSEmmanuel Vadot            - const: core4
245fac71e4eSEmmanuel Vadot      required:
246fac71e4eSEmmanuel Vadot        - power-domains
247fac71e4eSEmmanuel Vadot        - power-domain-names
248fac71e4eSEmmanuel Vadot  - if:
249fac71e4eSEmmanuel Vadot      properties:
250fac71e4eSEmmanuel Vadot        compatible:
251fac71e4eSEmmanuel Vadot          contains:
252c9ccf3a3SEmmanuel Vadot            const: rockchip,rk3568-mali
253c9ccf3a3SEmmanuel Vadot    then:
254c9ccf3a3SEmmanuel Vadot      properties:
255c9ccf3a3SEmmanuel Vadot        clocks:
256c9ccf3a3SEmmanuel Vadot          minItems: 2
257c9ccf3a3SEmmanuel Vadot        clock-names:
258c9ccf3a3SEmmanuel Vadot          items:
259c9ccf3a3SEmmanuel Vadot            - const: gpu
260c9ccf3a3SEmmanuel Vadot            - const: bus
261fac71e4eSEmmanuel Vadot        power-domains:
262fac71e4eSEmmanuel Vadot          maxItems: 1
263fac71e4eSEmmanuel Vadot        power-domain-names: false
264c9ccf3a3SEmmanuel Vadot      required:
265c9ccf3a3SEmmanuel Vadot        - clock-names
266c66ec88fSEmmanuel Vadot
267c66ec88fSEmmanuel Vadotexamples:
268c66ec88fSEmmanuel Vadot  - |
269c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
270c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
271c66ec88fSEmmanuel Vadot
272c66ec88fSEmmanuel Vadot    gpu@ffe40000 {
273c66ec88fSEmmanuel Vadot      compatible = "amlogic,meson-g12a-mali", "arm,mali-bifrost";
274c66ec88fSEmmanuel Vadot      reg = <0xffe40000 0x10000>;
275c66ec88fSEmmanuel Vadot      interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
276c66ec88fSEmmanuel Vadot             <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
277c66ec88fSEmmanuel Vadot             <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
278c66ec88fSEmmanuel Vadot      interrupt-names = "job", "mmu", "gpu";
279c66ec88fSEmmanuel Vadot      clocks = <&clk 1>;
280c66ec88fSEmmanuel Vadot      mali-supply = <&vdd_gpu>;
281c66ec88fSEmmanuel Vadot      operating-points-v2 = <&gpu_opp_table>;
282c66ec88fSEmmanuel Vadot      resets = <&reset 0>, <&reset 1>;
283c66ec88fSEmmanuel Vadot    };
284c66ec88fSEmmanuel Vadot
285354d7675SEmmanuel Vadot    gpu_opp_table: opp-table {
286c66ec88fSEmmanuel Vadot      compatible = "operating-points-v2";
287c66ec88fSEmmanuel Vadot
288c66ec88fSEmmanuel Vadot      opp-533000000 {
289c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <533000000>;
290c66ec88fSEmmanuel Vadot        opp-microvolt = <1250000>;
291c66ec88fSEmmanuel Vadot      };
292c66ec88fSEmmanuel Vadot      opp-450000000 {
293c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <450000000>;
294c66ec88fSEmmanuel Vadot        opp-microvolt = <1150000>;
295c66ec88fSEmmanuel Vadot      };
296c66ec88fSEmmanuel Vadot      opp-400000000 {
297c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <400000000>;
298c66ec88fSEmmanuel Vadot        opp-microvolt = <1125000>;
299c66ec88fSEmmanuel Vadot      };
300c66ec88fSEmmanuel Vadot      opp-350000000 {
301c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <350000000>;
302c66ec88fSEmmanuel Vadot        opp-microvolt = <1075000>;
303c66ec88fSEmmanuel Vadot      };
304c66ec88fSEmmanuel Vadot      opp-266000000 {
305c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <266000000>;
306c66ec88fSEmmanuel Vadot        opp-microvolt = <1025000>;
307c66ec88fSEmmanuel Vadot      };
308c66ec88fSEmmanuel Vadot      opp-160000000 {
309c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <160000000>;
310c66ec88fSEmmanuel Vadot        opp-microvolt = <925000>;
311c66ec88fSEmmanuel Vadot      };
312c66ec88fSEmmanuel Vadot      opp-100000000 {
313c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <100000000>;
314c66ec88fSEmmanuel Vadot        opp-microvolt = <912500>;
315c66ec88fSEmmanuel Vadot      };
316c66ec88fSEmmanuel Vadot    };
317c66ec88fSEmmanuel Vadot
318c66ec88fSEmmanuel Vadot...
319