xref: /freebsd/sys/contrib/device-tree/Bindings/gpu/arm,mali-bifrost.yaml (revision 354d7675fe12ace9cde344cb79c7ded792802f88)
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:
17c66ec88fSEmmanuel Vadot    items:
18c66ec88fSEmmanuel Vadot      - enum:
19c66ec88fSEmmanuel Vadot          - amlogic,meson-g12a-mali
205956d97fSEmmanuel Vadot          - mediatek,mt8183-mali
21c66ec88fSEmmanuel Vadot          - realtek,rtd1619-mali
22c66ec88fSEmmanuel Vadot          - rockchip,px30-mali
23*354d7675SEmmanuel Vadot          - rockchip,rk3568-mali
24c66ec88fSEmmanuel Vadot      - const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully discoverable
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel Vadot  reg:
27c66ec88fSEmmanuel Vadot    maxItems: 1
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel Vadot  interrupts:
30c66ec88fSEmmanuel Vadot    items:
31c66ec88fSEmmanuel Vadot      - description: Job interrupt
32c66ec88fSEmmanuel Vadot      - description: MMU interrupt
33c66ec88fSEmmanuel Vadot      - description: GPU interrupt
34c66ec88fSEmmanuel Vadot
35c66ec88fSEmmanuel Vadot  interrupt-names:
36c66ec88fSEmmanuel Vadot    items:
37c66ec88fSEmmanuel Vadot      - const: job
38c66ec88fSEmmanuel Vadot      - const: mmu
39c66ec88fSEmmanuel Vadot      - const: gpu
40c66ec88fSEmmanuel Vadot
41c66ec88fSEmmanuel Vadot  clocks:
42c66ec88fSEmmanuel Vadot    maxItems: 1
43c66ec88fSEmmanuel Vadot
44c66ec88fSEmmanuel Vadot  mali-supply: true
45c66ec88fSEmmanuel Vadot
465956d97fSEmmanuel Vadot  sram-supply: true
475956d97fSEmmanuel Vadot
48c66ec88fSEmmanuel Vadot  operating-points-v2: true
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel Vadot  power-domains:
515956d97fSEmmanuel Vadot    minItems: 1
525956d97fSEmmanuel Vadot    maxItems: 3
53c66ec88fSEmmanuel Vadot
54c66ec88fSEmmanuel Vadot  resets:
55c66ec88fSEmmanuel Vadot    maxItems: 2
56c66ec88fSEmmanuel Vadot
57c66ec88fSEmmanuel Vadot  "#cooling-cells":
58c66ec88fSEmmanuel Vadot    const: 2
59c66ec88fSEmmanuel Vadot
605def4c47SEmmanuel Vadot  dynamic-power-coefficient:
615def4c47SEmmanuel Vadot    $ref: '/schemas/types.yaml#/definitions/uint32'
625def4c47SEmmanuel Vadot    description:
635def4c47SEmmanuel Vadot      A u32 value that represents the running time dynamic
645def4c47SEmmanuel Vadot      power coefficient in units of uW/MHz/V^2. The
655def4c47SEmmanuel Vadot      coefficient can either be calculated from power
665def4c47SEmmanuel Vadot      measurements or derived by analysis.
675def4c47SEmmanuel Vadot
685def4c47SEmmanuel Vadot      The dynamic power consumption of the GPU is
695def4c47SEmmanuel Vadot      proportional to the square of the Voltage (V) and
705def4c47SEmmanuel Vadot      the clock frequency (f). The coefficient is used to
715def4c47SEmmanuel Vadot      calculate the dynamic power as below -
725def4c47SEmmanuel Vadot
735def4c47SEmmanuel Vadot      Pdyn = dynamic-power-coefficient * V^2 * f
745def4c47SEmmanuel Vadot
755def4c47SEmmanuel Vadot      where voltage is in V, frequency is in MHz.
765def4c47SEmmanuel Vadot
772eb4d8dcSEmmanuel Vadot  dma-coherent: true
782eb4d8dcSEmmanuel Vadot
79c66ec88fSEmmanuel Vadotrequired:
80c66ec88fSEmmanuel Vadot  - compatible
81c66ec88fSEmmanuel Vadot  - reg
82c66ec88fSEmmanuel Vadot  - interrupts
83c66ec88fSEmmanuel Vadot  - interrupt-names
84c66ec88fSEmmanuel Vadot  - clocks
85c66ec88fSEmmanuel Vadot
86c66ec88fSEmmanuel VadotadditionalProperties: false
87c66ec88fSEmmanuel Vadot
88c66ec88fSEmmanuel VadotallOf:
89c66ec88fSEmmanuel Vadot  - if:
90c66ec88fSEmmanuel Vadot      properties:
91c66ec88fSEmmanuel Vadot        compatible:
92c66ec88fSEmmanuel Vadot          contains:
93c66ec88fSEmmanuel Vadot            const: amlogic,meson-g12a-mali
94c66ec88fSEmmanuel Vadot    then:
95c66ec88fSEmmanuel Vadot      required:
96c66ec88fSEmmanuel Vadot        - resets
975956d97fSEmmanuel Vadot  - if:
985956d97fSEmmanuel Vadot      properties:
995956d97fSEmmanuel Vadot        compatible:
1005956d97fSEmmanuel Vadot          contains:
1015956d97fSEmmanuel Vadot            const: mediatek,mt8183-mali
1025956d97fSEmmanuel Vadot    then:
1035956d97fSEmmanuel Vadot      properties:
1045956d97fSEmmanuel Vadot        power-domains:
1055956d97fSEmmanuel Vadot          minItems: 3
1065956d97fSEmmanuel Vadot        power-domain-names:
1075956d97fSEmmanuel Vadot          items:
1085956d97fSEmmanuel Vadot            - const: core0
1095956d97fSEmmanuel Vadot            - const: core1
1105956d97fSEmmanuel Vadot            - const: core2
1115956d97fSEmmanuel Vadot
1125956d97fSEmmanuel Vadot      required:
1135956d97fSEmmanuel Vadot        - sram-supply
1145956d97fSEmmanuel Vadot        - power-domains
1155956d97fSEmmanuel Vadot        - power-domain-names
1165956d97fSEmmanuel Vadot    else:
1175956d97fSEmmanuel Vadot      properties:
1185956d97fSEmmanuel Vadot        power-domains:
1195956d97fSEmmanuel Vadot          maxItems: 1
1205956d97fSEmmanuel Vadot        sram-supply: false
121c66ec88fSEmmanuel Vadot
122c66ec88fSEmmanuel Vadotexamples:
123c66ec88fSEmmanuel Vadot  - |
124c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
125c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
126c66ec88fSEmmanuel Vadot
127c66ec88fSEmmanuel Vadot    gpu@ffe40000 {
128c66ec88fSEmmanuel Vadot      compatible = "amlogic,meson-g12a-mali", "arm,mali-bifrost";
129c66ec88fSEmmanuel Vadot      reg = <0xffe40000 0x10000>;
130c66ec88fSEmmanuel Vadot      interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
131c66ec88fSEmmanuel Vadot             <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
132c66ec88fSEmmanuel Vadot             <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
133c66ec88fSEmmanuel Vadot      interrupt-names = "job", "mmu", "gpu";
134c66ec88fSEmmanuel Vadot      clocks = <&clk 1>;
135c66ec88fSEmmanuel Vadot      mali-supply = <&vdd_gpu>;
136c66ec88fSEmmanuel Vadot      operating-points-v2 = <&gpu_opp_table>;
137c66ec88fSEmmanuel Vadot      resets = <&reset 0>, <&reset 1>;
138c66ec88fSEmmanuel Vadot    };
139c66ec88fSEmmanuel Vadot
140*354d7675SEmmanuel Vadot    gpu_opp_table: opp-table {
141c66ec88fSEmmanuel Vadot      compatible = "operating-points-v2";
142c66ec88fSEmmanuel Vadot
143c66ec88fSEmmanuel Vadot      opp-533000000 {
144c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <533000000>;
145c66ec88fSEmmanuel Vadot        opp-microvolt = <1250000>;
146c66ec88fSEmmanuel Vadot      };
147c66ec88fSEmmanuel Vadot      opp-450000000 {
148c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <450000000>;
149c66ec88fSEmmanuel Vadot        opp-microvolt = <1150000>;
150c66ec88fSEmmanuel Vadot      };
151c66ec88fSEmmanuel Vadot      opp-400000000 {
152c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <400000000>;
153c66ec88fSEmmanuel Vadot        opp-microvolt = <1125000>;
154c66ec88fSEmmanuel Vadot      };
155c66ec88fSEmmanuel Vadot      opp-350000000 {
156c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <350000000>;
157c66ec88fSEmmanuel Vadot        opp-microvolt = <1075000>;
158c66ec88fSEmmanuel Vadot      };
159c66ec88fSEmmanuel Vadot      opp-266000000 {
160c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <266000000>;
161c66ec88fSEmmanuel Vadot        opp-microvolt = <1025000>;
162c66ec88fSEmmanuel Vadot      };
163c66ec88fSEmmanuel Vadot      opp-160000000 {
164c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <160000000>;
165c66ec88fSEmmanuel Vadot        opp-microvolt = <925000>;
166c66ec88fSEmmanuel Vadot      };
167c66ec88fSEmmanuel Vadot      opp-100000000 {
168c66ec88fSEmmanuel Vadot        opp-hz = /bits/ 64 <100000000>;
169c66ec88fSEmmanuel Vadot        opp-microvolt = <912500>;
170c66ec88fSEmmanuel Vadot      };
171c66ec88fSEmmanuel Vadot    };
172c66ec88fSEmmanuel Vadot
173c66ec88fSEmmanuel Vadot...
174