xref: /openbmc/linux/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml (revision aeb737902d863834ca3f7adb928520a8c70add84)
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
68*aeb73790SAngeloGioacchino Del Regno  power-domain-names:
69*aeb73790SAngeloGioacchino Del Regno    minItems: 2
70*aeb73790SAngeloGioacchino Del Regno    maxItems: 5
71*aeb73790SAngeloGioacchino 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
119*aeb73790SAngeloGioacchino 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
144*aeb73790SAngeloGioacchino 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:
184f1775c26SAlex Bee            const: rockchip,rk3568-mali
185f1775c26SAlex Bee    then:
186f1775c26SAlex Bee      properties:
187f1775c26SAlex Bee        clocks:
188f1775c26SAlex Bee          minItems: 2
189f1775c26SAlex Bee        clock-names:
190f1775c26SAlex Bee          items:
191f1775c26SAlex Bee            - const: gpu
192f1775c26SAlex Bee            - const: bus
193e82b8453SAngeloGioacchino Del Regno        power-domains:
194e82b8453SAngeloGioacchino Del Regno          maxItems: 1
195*aeb73790SAngeloGioacchino Del Regno        power-domain-names: false
196f1775c26SAlex Bee      required:
197f1775c26SAlex Bee        - clock-names
198842b4aecSRob Herring
199842b4aecSRob Herringexamples:
200842b4aecSRob Herring  - |
201842b4aecSRob Herring    #include <dt-bindings/interrupt-controller/irq.h>
202842b4aecSRob Herring    #include <dt-bindings/interrupt-controller/arm-gic.h>
203842b4aecSRob Herring
204842b4aecSRob Herring    gpu@ffe40000 {
205842b4aecSRob Herring      compatible = "amlogic,meson-g12a-mali", "arm,mali-bifrost";
206842b4aecSRob Herring      reg = <0xffe40000 0x10000>;
207842b4aecSRob Herring      interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
208842b4aecSRob Herring             <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
209842b4aecSRob Herring             <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
210842b4aecSRob Herring      interrupt-names = "job", "mmu", "gpu";
211842b4aecSRob Herring      clocks = <&clk 1>;
212842b4aecSRob Herring      mali-supply = <&vdd_gpu>;
213842b4aecSRob Herring      operating-points-v2 = <&gpu_opp_table>;
214842b4aecSRob Herring      resets = <&reset 0>, <&reset 1>;
215842b4aecSRob Herring    };
216842b4aecSRob Herring
21729fc7695SRob Herring    gpu_opp_table: opp-table {
218842b4aecSRob Herring      compatible = "operating-points-v2";
219842b4aecSRob Herring
22051a21e0eSRob Herring      opp-533000000 {
221842b4aecSRob Herring        opp-hz = /bits/ 64 <533000000>;
222842b4aecSRob Herring        opp-microvolt = <1250000>;
223842b4aecSRob Herring      };
22451a21e0eSRob Herring      opp-450000000 {
225842b4aecSRob Herring        opp-hz = /bits/ 64 <450000000>;
226842b4aecSRob Herring        opp-microvolt = <1150000>;
227842b4aecSRob Herring      };
22851a21e0eSRob Herring      opp-400000000 {
229842b4aecSRob Herring        opp-hz = /bits/ 64 <400000000>;
230842b4aecSRob Herring        opp-microvolt = <1125000>;
231842b4aecSRob Herring      };
23251a21e0eSRob Herring      opp-350000000 {
233842b4aecSRob Herring        opp-hz = /bits/ 64 <350000000>;
234842b4aecSRob Herring        opp-microvolt = <1075000>;
235842b4aecSRob Herring      };
23651a21e0eSRob Herring      opp-266000000 {
237842b4aecSRob Herring        opp-hz = /bits/ 64 <266000000>;
238842b4aecSRob Herring        opp-microvolt = <1025000>;
239842b4aecSRob Herring      };
24051a21e0eSRob Herring      opp-160000000 {
241842b4aecSRob Herring        opp-hz = /bits/ 64 <160000000>;
242842b4aecSRob Herring        opp-microvolt = <925000>;
243842b4aecSRob Herring      };
24451a21e0eSRob Herring      opp-100000000 {
245842b4aecSRob Herring        opp-hz = /bits/ 64 <100000000>;
246842b4aecSRob Herring        opp-microvolt = <912500>;
247842b4aecSRob Herring      };
248842b4aecSRob Herring    };
249842b4aecSRob Herring
250842b4aecSRob Herring...
251