xref: /linux/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml (revision 13a8fc8ae951ab746d5fd36254f9b1d6e938b15e)
1842b4aecSRob Herring# SPDX-License-Identifier: GPL-2.0-only
2842b4aecSRob Herring%YAML 1.2
3842b4aecSRob Herring---
4842b4aecSRob Herring$id: http://devicetree.org/schemas/gpu/arm,mali-bifrost.yaml#
5842b4aecSRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
6842b4aecSRob Herring
7842b4aecSRob Herringtitle: ARM Mali Bifrost GPU
8842b4aecSRob Herring
9842b4aecSRob Herringmaintainers:
10842b4aecSRob Herring  - Rob Herring <robh@kernel.org>
11842b4aecSRob Herring
12842b4aecSRob Herringproperties:
13842b4aecSRob Herring  $nodename:
14842b4aecSRob Herring    pattern: '^gpu@[a-f0-9]+$'
15842b4aecSRob Herring
16842b4aecSRob Herring  compatible:
175d82e74aSAlyssa Rosenzweig    oneOf:
185d82e74aSAlyssa Rosenzweig      - items:
19842b4aecSRob Herring          - enum:
20842b4aecSRob Herring              - amlogic,meson-g12a-mali
21a7a596cdSNicolas Boichat              - mediatek,mt8183-mali
220211b71cSAndreas Färber              - realtek,rtd1619-mali
23570df0a5SBiju Das              - renesas,r9a07g044-mali
245dc6ce76SLad Prabhakar              - renesas,r9a07g054-mali
25ad848dd5SHeiko Stuebner              - rockchip,px30-mali
2651ca8fcbSEzequiel Garcia              - rockchip,rk3568-mali
27842b4aecSRob Herring          - const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully discoverable
285d82e74aSAlyssa Rosenzweig      - items:
295d82e74aSAlyssa Rosenzweig          - enum:
305d82e74aSAlyssa Rosenzweig              - mediatek,mt8192-mali
315d82e74aSAlyssa Rosenzweig          - const: arm,mali-valhall-jm # Mali Valhall GPU model/revision is fully discoverable
32842b4aecSRob Herring
33842b4aecSRob Herring  reg:
34842b4aecSRob Herring    maxItems: 1
35842b4aecSRob Herring
36842b4aecSRob Herring  interrupts:
37570df0a5SBiju Das    minItems: 3
38842b4aecSRob Herring    items:
39842b4aecSRob Herring      - description: Job interrupt
40842b4aecSRob Herring      - description: MMU interrupt
41842b4aecSRob Herring      - description: GPU interrupt
42570df0a5SBiju Das      - description: Event interrupt
43842b4aecSRob Herring
44842b4aecSRob Herring  interrupt-names:
45570df0a5SBiju Das    minItems: 3
46842b4aecSRob Herring    items:
47842b4aecSRob Herring      - const: job
48842b4aecSRob Herring      - const: mmu
49842b4aecSRob Herring      - const: gpu
50570df0a5SBiju Das      - const: event
51842b4aecSRob Herring
52842b4aecSRob Herring  clocks:
53570df0a5SBiju Das    minItems: 1
54570df0a5SBiju Das    maxItems: 3
55570df0a5SBiju Das
56570df0a5SBiju Das  clock-names: true
57842b4aecSRob Herring
58f3dde260SRob Herring  mali-supply: true
59842b4aecSRob Herring
60a7a596cdSNicolas Boichat  sram-supply: true
61a7a596cdSNicolas Boichat
62842b4aecSRob Herring  operating-points-v2: true
63842b4aecSRob Herring
642c905f6cSJohan Jonker  power-domains:
65a7a596cdSNicolas Boichat    minItems: 1
66eccda274SAngeloGioacchino Del Regno    maxItems: 5
672c905f6cSJohan Jonker
68aeb73790SAngeloGioacchino Del Regno  power-domain-names:
69aeb73790SAngeloGioacchino Del Regno    minItems: 2
70aeb73790SAngeloGioacchino Del Regno    maxItems: 5
71aeb73790SAngeloGioacchino Del Regno
720d9a302dSRob Herring  resets:
73570df0a5SBiju Das    minItems: 1
74570df0a5SBiju Das    maxItems: 3
75570df0a5SBiju Das
76570df0a5SBiju Das  reset-names: true
770d9a302dSRob Herring
782c905f6cSJohan Jonker  "#cooling-cells":
792c905f6cSJohan Jonker    const: 2
802c905f6cSJohan Jonker
81e33dc2f3SLukasz Luba  dynamic-power-coefficient:
82e33dc2f3SLukasz Luba    $ref: '/schemas/types.yaml#/definitions/uint32'
83e33dc2f3SLukasz Luba    description:
84e33dc2f3SLukasz Luba      A u32 value that represents the running time dynamic
85e33dc2f3SLukasz Luba      power coefficient in units of uW/MHz/V^2. The
86e33dc2f3SLukasz Luba      coefficient can either be calculated from power
87e33dc2f3SLukasz Luba      measurements or derived by analysis.
88e33dc2f3SLukasz Luba
89e33dc2f3SLukasz Luba      The dynamic power consumption of the GPU is
90e33dc2f3SLukasz Luba      proportional to the square of the Voltage (V) and
91e33dc2f3SLukasz Luba      the clock frequency (f). The coefficient is used to
92e33dc2f3SLukasz Luba      calculate the dynamic power as below -
93e33dc2f3SLukasz Luba
94e33dc2f3SLukasz Luba      Pdyn = dynamic-power-coefficient * V^2 * f
95e33dc2f3SLukasz Luba
96e33dc2f3SLukasz Luba      where voltage is in V, frequency is in MHz.
97e33dc2f3SLukasz Luba
983f9a3345SKevin Hilman  dma-coherent: true
993f9a3345SKevin Hilman
100842b4aecSRob Herringrequired:
101842b4aecSRob Herring  - compatible
102842b4aecSRob Herring  - reg
103842b4aecSRob Herring  - interrupts
104842b4aecSRob Herring  - interrupt-names
105842b4aecSRob Herring  - clocks
106842b4aecSRob Herring
1077f464532SRob HerringadditionalProperties: false
1087f464532SRob Herring
109842b4aecSRob HerringallOf:
110842b4aecSRob Herring  - if:
111842b4aecSRob Herring      properties:
112842b4aecSRob Herring        compatible:
113842b4aecSRob Herring          contains:
114842b4aecSRob Herring            const: amlogic,meson-g12a-mali
115842b4aecSRob Herring    then:
116e82b8453SAngeloGioacchino Del Regno      properties:
117e82b8453SAngeloGioacchino Del Regno        power-domains:
118e82b8453SAngeloGioacchino Del Regno          maxItems: 1
119aeb73790SAngeloGioacchino Del Regno        power-domain-names: false
120842b4aecSRob Herring      required:
121842b4aecSRob Herring        - resets
122a7a596cdSNicolas Boichat  - if:
123a7a596cdSNicolas Boichat      properties:
124a7a596cdSNicolas Boichat        compatible:
125a7a596cdSNicolas Boichat          contains:
1265dc6ce76SLad Prabhakar            enum:
1275dc6ce76SLad Prabhakar              - renesas,r9a07g044-mali
1285dc6ce76SLad Prabhakar              - renesas,r9a07g054-mali
129570df0a5SBiju Das    then:
130570df0a5SBiju Das      properties:
131570df0a5SBiju Das        interrupts:
132570df0a5SBiju Das          minItems: 4
133570df0a5SBiju Das        interrupt-names:
134570df0a5SBiju Das          minItems: 4
135570df0a5SBiju Das        clocks:
136570df0a5SBiju Das          minItems: 3
137570df0a5SBiju Das        clock-names:
138570df0a5SBiju Das          items:
139570df0a5SBiju Das            - const: gpu
140570df0a5SBiju Das            - const: bus
141570df0a5SBiju Das            - const: bus_ace
142e82b8453SAngeloGioacchino Del Regno        power-domains:
143e82b8453SAngeloGioacchino Del Regno          maxItems: 1
144aeb73790SAngeloGioacchino Del Regno        power-domain-names: false
145570df0a5SBiju Das        resets:
146570df0a5SBiju Das          minItems: 3
147570df0a5SBiju Das        reset-names:
148570df0a5SBiju Das          items:
149570df0a5SBiju Das            - const: rst
150570df0a5SBiju Das            - const: axi_rst
151570df0a5SBiju Das            - const: ace_rst
152570df0a5SBiju Das      required:
153570df0a5SBiju Das        - clock-names
154570df0a5SBiju Das        - power-domains
155570df0a5SBiju Das        - resets
156570df0a5SBiju Das        - reset-names
157570df0a5SBiju Das  - if:
158570df0a5SBiju Das      properties:
159570df0a5SBiju Das        compatible:
160570df0a5SBiju Das          contains:
161a7a596cdSNicolas Boichat            const: mediatek,mt8183-mali
162a7a596cdSNicolas Boichat    then:
163a7a596cdSNicolas Boichat      properties:
164a7a596cdSNicolas Boichat        power-domains:
165a7a596cdSNicolas Boichat          minItems: 3
166eccda274SAngeloGioacchino Del Regno          maxItems: 3
167a7a596cdSNicolas Boichat        power-domain-names:
168a7a596cdSNicolas Boichat          items:
169a7a596cdSNicolas Boichat            - const: core0
170a7a596cdSNicolas Boichat            - const: core1
171a7a596cdSNicolas Boichat            - const: core2
172a7a596cdSNicolas Boichat
173a7a596cdSNicolas Boichat      required:
174a7a596cdSNicolas Boichat        - sram-supply
175a7a596cdSNicolas Boichat        - power-domains
176a7a596cdSNicolas Boichat        - power-domain-names
177a7a596cdSNicolas Boichat    else:
178a7a596cdSNicolas Boichat      properties:
179a7a596cdSNicolas Boichat        sram-supply: false
180f1775c26SAlex Bee  - if:
181f1775c26SAlex Bee      properties:
182f1775c26SAlex Bee        compatible:
183f1775c26SAlex Bee          contains:
184*13a8fc8aSAngeloGioacchino Del Regno            const: mediatek,mt8192-mali
185*13a8fc8aSAngeloGioacchino Del Regno    then:
186*13a8fc8aSAngeloGioacchino Del Regno      properties:
187*13a8fc8aSAngeloGioacchino Del Regno        power-domains:
188*13a8fc8aSAngeloGioacchino Del Regno          minItems: 5
189*13a8fc8aSAngeloGioacchino Del Regno        power-domain-names:
190*13a8fc8aSAngeloGioacchino Del Regno          items:
191*13a8fc8aSAngeloGioacchino Del Regno            - const: core0
192*13a8fc8aSAngeloGioacchino Del Regno            - const: core1
193*13a8fc8aSAngeloGioacchino Del Regno            - const: core2
194*13a8fc8aSAngeloGioacchino Del Regno            - const: core3
195*13a8fc8aSAngeloGioacchino Del Regno            - const: core4
196*13a8fc8aSAngeloGioacchino Del Regno      required:
197*13a8fc8aSAngeloGioacchino Del Regno        - power-domains
198*13a8fc8aSAngeloGioacchino Del Regno        - power-domain-names
199*13a8fc8aSAngeloGioacchino Del Regno  - if:
200*13a8fc8aSAngeloGioacchino Del Regno      properties:
201*13a8fc8aSAngeloGioacchino Del Regno        compatible:
202*13a8fc8aSAngeloGioacchino Del Regno          contains:
203f1775c26SAlex Bee            const: rockchip,rk3568-mali
204f1775c26SAlex Bee    then:
205f1775c26SAlex Bee      properties:
206f1775c26SAlex Bee        clocks:
207f1775c26SAlex Bee          minItems: 2
208f1775c26SAlex Bee        clock-names:
209f1775c26SAlex Bee          items:
210f1775c26SAlex Bee            - const: gpu
211f1775c26SAlex Bee            - const: bus
212e82b8453SAngeloGioacchino Del Regno        power-domains:
213e82b8453SAngeloGioacchino Del Regno          maxItems: 1
214aeb73790SAngeloGioacchino Del Regno        power-domain-names: false
215f1775c26SAlex Bee      required:
216f1775c26SAlex Bee        - clock-names
217842b4aecSRob Herring
218842b4aecSRob Herringexamples:
219842b4aecSRob Herring  - |
220842b4aecSRob Herring    #include <dt-bindings/interrupt-controller/irq.h>
221842b4aecSRob Herring    #include <dt-bindings/interrupt-controller/arm-gic.h>
222842b4aecSRob Herring
223842b4aecSRob Herring    gpu@ffe40000 {
224842b4aecSRob Herring      compatible = "amlogic,meson-g12a-mali", "arm,mali-bifrost";
225842b4aecSRob Herring      reg = <0xffe40000 0x10000>;
226842b4aecSRob Herring      interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
227842b4aecSRob Herring             <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
228842b4aecSRob Herring             <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
229842b4aecSRob Herring      interrupt-names = "job", "mmu", "gpu";
230842b4aecSRob Herring      clocks = <&clk 1>;
231842b4aecSRob Herring      mali-supply = <&vdd_gpu>;
232842b4aecSRob Herring      operating-points-v2 = <&gpu_opp_table>;
233842b4aecSRob Herring      resets = <&reset 0>, <&reset 1>;
234842b4aecSRob Herring    };
235842b4aecSRob Herring
23629fc7695SRob Herring    gpu_opp_table: opp-table {
237842b4aecSRob Herring      compatible = "operating-points-v2";
238842b4aecSRob Herring
23951a21e0eSRob Herring      opp-533000000 {
240842b4aecSRob Herring        opp-hz = /bits/ 64 <533000000>;
241842b4aecSRob Herring        opp-microvolt = <1250000>;
242842b4aecSRob Herring      };
24351a21e0eSRob Herring      opp-450000000 {
244842b4aecSRob Herring        opp-hz = /bits/ 64 <450000000>;
245842b4aecSRob Herring        opp-microvolt = <1150000>;
246842b4aecSRob Herring      };
24751a21e0eSRob Herring      opp-400000000 {
248842b4aecSRob Herring        opp-hz = /bits/ 64 <400000000>;
249842b4aecSRob Herring        opp-microvolt = <1125000>;
250842b4aecSRob Herring      };
25151a21e0eSRob Herring      opp-350000000 {
252842b4aecSRob Herring        opp-hz = /bits/ 64 <350000000>;
253842b4aecSRob Herring        opp-microvolt = <1075000>;
254842b4aecSRob Herring      };
25551a21e0eSRob Herring      opp-266000000 {
256842b4aecSRob Herring        opp-hz = /bits/ 64 <266000000>;
257842b4aecSRob Herring        opp-microvolt = <1025000>;
258842b4aecSRob Herring      };
25951a21e0eSRob Herring      opp-160000000 {
260842b4aecSRob Herring        opp-hz = /bits/ 64 <160000000>;
261842b4aecSRob Herring        opp-microvolt = <925000>;
262842b4aecSRob Herring      };
26351a21e0eSRob Herring      opp-100000000 {
264842b4aecSRob Herring        opp-hz = /bits/ 64 <100000000>;
265842b4aecSRob Herring        opp-microvolt = <912500>;
266842b4aecSRob Herring      };
267842b4aecSRob Herring    };
268842b4aecSRob Herring
269842b4aecSRob Herring...
270