xref: /linux/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml (revision eccda2744f0ffb0d5050c83c5ee415fadcd3670c)
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
66*eccda274SAngeloGioacchino Del Regno    maxItems: 5
672c905f6cSJohan Jonker
680d9a302dSRob Herring  resets:
69570df0a5SBiju Das    minItems: 1
70570df0a5SBiju Das    maxItems: 3
71570df0a5SBiju Das
72570df0a5SBiju Das  reset-names: true
730d9a302dSRob Herring
742c905f6cSJohan Jonker  "#cooling-cells":
752c905f6cSJohan Jonker    const: 2
762c905f6cSJohan Jonker
77e33dc2f3SLukasz Luba  dynamic-power-coefficient:
78e33dc2f3SLukasz Luba    $ref: '/schemas/types.yaml#/definitions/uint32'
79e33dc2f3SLukasz Luba    description:
80e33dc2f3SLukasz Luba      A u32 value that represents the running time dynamic
81e33dc2f3SLukasz Luba      power coefficient in units of uW/MHz/V^2. The
82e33dc2f3SLukasz Luba      coefficient can either be calculated from power
83e33dc2f3SLukasz Luba      measurements or derived by analysis.
84e33dc2f3SLukasz Luba
85e33dc2f3SLukasz Luba      The dynamic power consumption of the GPU is
86e33dc2f3SLukasz Luba      proportional to the square of the Voltage (V) and
87e33dc2f3SLukasz Luba      the clock frequency (f). The coefficient is used to
88e33dc2f3SLukasz Luba      calculate the dynamic power as below -
89e33dc2f3SLukasz Luba
90e33dc2f3SLukasz Luba      Pdyn = dynamic-power-coefficient * V^2 * f
91e33dc2f3SLukasz Luba
92e33dc2f3SLukasz Luba      where voltage is in V, frequency is in MHz.
93e33dc2f3SLukasz Luba
943f9a3345SKevin Hilman  dma-coherent: true
953f9a3345SKevin Hilman
96842b4aecSRob Herringrequired:
97842b4aecSRob Herring  - compatible
98842b4aecSRob Herring  - reg
99842b4aecSRob Herring  - interrupts
100842b4aecSRob Herring  - interrupt-names
101842b4aecSRob Herring  - clocks
102842b4aecSRob Herring
1037f464532SRob HerringadditionalProperties: false
1047f464532SRob Herring
105842b4aecSRob HerringallOf:
106842b4aecSRob Herring  - if:
107842b4aecSRob Herring      properties:
108842b4aecSRob Herring        compatible:
109842b4aecSRob Herring          contains:
110842b4aecSRob Herring            const: amlogic,meson-g12a-mali
111842b4aecSRob Herring    then:
112e82b8453SAngeloGioacchino Del Regno      properties:
113e82b8453SAngeloGioacchino Del Regno        power-domains:
114e82b8453SAngeloGioacchino Del Regno          maxItems: 1
115842b4aecSRob Herring      required:
116842b4aecSRob Herring        - resets
117a7a596cdSNicolas Boichat  - if:
118a7a596cdSNicolas Boichat      properties:
119a7a596cdSNicolas Boichat        compatible:
120a7a596cdSNicolas Boichat          contains:
1215dc6ce76SLad Prabhakar            enum:
1225dc6ce76SLad Prabhakar              - renesas,r9a07g044-mali
1235dc6ce76SLad Prabhakar              - renesas,r9a07g054-mali
124570df0a5SBiju Das    then:
125570df0a5SBiju Das      properties:
126570df0a5SBiju Das        interrupts:
127570df0a5SBiju Das          minItems: 4
128570df0a5SBiju Das        interrupt-names:
129570df0a5SBiju Das          minItems: 4
130570df0a5SBiju Das        clocks:
131570df0a5SBiju Das          minItems: 3
132570df0a5SBiju Das        clock-names:
133570df0a5SBiju Das          items:
134570df0a5SBiju Das            - const: gpu
135570df0a5SBiju Das            - const: bus
136570df0a5SBiju Das            - const: bus_ace
137e82b8453SAngeloGioacchino Del Regno        power-domains:
138e82b8453SAngeloGioacchino Del Regno          maxItems: 1
139570df0a5SBiju Das        resets:
140570df0a5SBiju Das          minItems: 3
141570df0a5SBiju Das        reset-names:
142570df0a5SBiju Das          items:
143570df0a5SBiju Das            - const: rst
144570df0a5SBiju Das            - const: axi_rst
145570df0a5SBiju Das            - const: ace_rst
146570df0a5SBiju Das      required:
147570df0a5SBiju Das        - clock-names
148570df0a5SBiju Das        - power-domains
149570df0a5SBiju Das        - resets
150570df0a5SBiju Das        - reset-names
151570df0a5SBiju Das  - if:
152570df0a5SBiju Das      properties:
153570df0a5SBiju Das        compatible:
154570df0a5SBiju Das          contains:
155a7a596cdSNicolas Boichat            const: mediatek,mt8183-mali
156a7a596cdSNicolas Boichat    then:
157a7a596cdSNicolas Boichat      properties:
158a7a596cdSNicolas Boichat        power-domains:
159a7a596cdSNicolas Boichat          minItems: 3
160*eccda274SAngeloGioacchino Del Regno          maxItems: 3
161a7a596cdSNicolas Boichat        power-domain-names:
162a7a596cdSNicolas Boichat          items:
163a7a596cdSNicolas Boichat            - const: core0
164a7a596cdSNicolas Boichat            - const: core1
165a7a596cdSNicolas Boichat            - const: core2
166a7a596cdSNicolas Boichat
167a7a596cdSNicolas Boichat      required:
168a7a596cdSNicolas Boichat        - sram-supply
169a7a596cdSNicolas Boichat        - power-domains
170a7a596cdSNicolas Boichat        - power-domain-names
171a7a596cdSNicolas Boichat    else:
172a7a596cdSNicolas Boichat      properties:
173a7a596cdSNicolas Boichat        sram-supply: false
174f1775c26SAlex Bee  - if:
175f1775c26SAlex Bee      properties:
176f1775c26SAlex Bee        compatible:
177f1775c26SAlex Bee          contains:
178f1775c26SAlex Bee            const: rockchip,rk3568-mali
179f1775c26SAlex Bee    then:
180f1775c26SAlex Bee      properties:
181f1775c26SAlex Bee        clocks:
182f1775c26SAlex Bee          minItems: 2
183f1775c26SAlex Bee        clock-names:
184f1775c26SAlex Bee          items:
185f1775c26SAlex Bee            - const: gpu
186f1775c26SAlex Bee            - const: bus
187e82b8453SAngeloGioacchino Del Regno        power-domains:
188e82b8453SAngeloGioacchino Del Regno          maxItems: 1
189f1775c26SAlex Bee      required:
190f1775c26SAlex Bee        - clock-names
191842b4aecSRob Herring
192842b4aecSRob Herringexamples:
193842b4aecSRob Herring  - |
194842b4aecSRob Herring    #include <dt-bindings/interrupt-controller/irq.h>
195842b4aecSRob Herring    #include <dt-bindings/interrupt-controller/arm-gic.h>
196842b4aecSRob Herring
197842b4aecSRob Herring    gpu@ffe40000 {
198842b4aecSRob Herring      compatible = "amlogic,meson-g12a-mali", "arm,mali-bifrost";
199842b4aecSRob Herring      reg = <0xffe40000 0x10000>;
200842b4aecSRob Herring      interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
201842b4aecSRob Herring             <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
202842b4aecSRob Herring             <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
203842b4aecSRob Herring      interrupt-names = "job", "mmu", "gpu";
204842b4aecSRob Herring      clocks = <&clk 1>;
205842b4aecSRob Herring      mali-supply = <&vdd_gpu>;
206842b4aecSRob Herring      operating-points-v2 = <&gpu_opp_table>;
207842b4aecSRob Herring      resets = <&reset 0>, <&reset 1>;
208842b4aecSRob Herring    };
209842b4aecSRob Herring
21029fc7695SRob Herring    gpu_opp_table: opp-table {
211842b4aecSRob Herring      compatible = "operating-points-v2";
212842b4aecSRob Herring
21351a21e0eSRob Herring      opp-533000000 {
214842b4aecSRob Herring        opp-hz = /bits/ 64 <533000000>;
215842b4aecSRob Herring        opp-microvolt = <1250000>;
216842b4aecSRob Herring      };
21751a21e0eSRob Herring      opp-450000000 {
218842b4aecSRob Herring        opp-hz = /bits/ 64 <450000000>;
219842b4aecSRob Herring        opp-microvolt = <1150000>;
220842b4aecSRob Herring      };
22151a21e0eSRob Herring      opp-400000000 {
222842b4aecSRob Herring        opp-hz = /bits/ 64 <400000000>;
223842b4aecSRob Herring        opp-microvolt = <1125000>;
224842b4aecSRob Herring      };
22551a21e0eSRob Herring      opp-350000000 {
226842b4aecSRob Herring        opp-hz = /bits/ 64 <350000000>;
227842b4aecSRob Herring        opp-microvolt = <1075000>;
228842b4aecSRob Herring      };
22951a21e0eSRob Herring      opp-266000000 {
230842b4aecSRob Herring        opp-hz = /bits/ 64 <266000000>;
231842b4aecSRob Herring        opp-microvolt = <1025000>;
232842b4aecSRob Herring      };
23351a21e0eSRob Herring      opp-160000000 {
234842b4aecSRob Herring        opp-hz = /bits/ 64 <160000000>;
235842b4aecSRob Herring        opp-microvolt = <925000>;
236842b4aecSRob Herring      };
23751a21e0eSRob Herring      opp-100000000 {
238842b4aecSRob Herring        opp-hz = /bits/ 64 <100000000>;
239842b4aecSRob Herring        opp-microvolt = <912500>;
240842b4aecSRob Herring      };
241842b4aecSRob Herring    };
242842b4aecSRob Herring
243842b4aecSRob Herring...
244