xref: /src/sys/contrib/device-tree/Bindings/gpu/arm,mali-valhall-csf.yaml (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1a8091808SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2a8091808SEmmanuel Vadot%YAML 1.2
3a8091808SEmmanuel Vadot---
4a8091808SEmmanuel Vadot$id: http://devicetree.org/schemas/gpu/arm,mali-valhall-csf.yaml#
5a8091808SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6a8091808SEmmanuel Vadot
7a8091808SEmmanuel Vadottitle: ARM Mali Valhall GPU
8a8091808SEmmanuel Vadot
9a8091808SEmmanuel Vadotmaintainers:
10a8091808SEmmanuel Vadot  - Liviu Dudau <liviu.dudau@arm.com>
11a8091808SEmmanuel Vadot  - Boris Brezillon <boris.brezillon@collabora.com>
12a8091808SEmmanuel Vadot
13a8091808SEmmanuel Vadotproperties:
14a8091808SEmmanuel Vadot  $nodename:
15a8091808SEmmanuel Vadot    pattern: '^gpu@[a-f0-9]+$'
16a8091808SEmmanuel Vadot
17a8091808SEmmanuel Vadot  compatible:
18a8091808SEmmanuel Vadot    oneOf:
19a8091808SEmmanuel Vadot      - items:
20a8091808SEmmanuel Vadot          - enum:
21a8091808SEmmanuel Vadot              - rockchip,rk3588-mali
22a8091808SEmmanuel Vadot          - const: arm,mali-valhall-csf   # Mali Valhall GPU model/revision is fully discoverable
23a8091808SEmmanuel Vadot
24a8091808SEmmanuel Vadot  reg:
25a8091808SEmmanuel Vadot    maxItems: 1
26a8091808SEmmanuel Vadot
27a8091808SEmmanuel Vadot  interrupts:
28a8091808SEmmanuel Vadot    items:
29a8091808SEmmanuel Vadot      - description: Job interrupt
30a8091808SEmmanuel Vadot      - description: MMU interrupt
31a8091808SEmmanuel Vadot      - description: GPU interrupt
32a8091808SEmmanuel Vadot
33a8091808SEmmanuel Vadot  interrupt-names:
34a8091808SEmmanuel Vadot    items:
35a8091808SEmmanuel Vadot      - const: job
36a8091808SEmmanuel Vadot      - const: mmu
37a8091808SEmmanuel Vadot      - const: gpu
38a8091808SEmmanuel Vadot
39a8091808SEmmanuel Vadot  clocks:
40a8091808SEmmanuel Vadot    minItems: 1
41a8091808SEmmanuel Vadot    maxItems: 3
42a8091808SEmmanuel Vadot
43a8091808SEmmanuel Vadot  clock-names:
44a8091808SEmmanuel Vadot    minItems: 1
45a8091808SEmmanuel Vadot    items:
46a8091808SEmmanuel Vadot      - const: core
47a8091808SEmmanuel Vadot      - const: coregroup
48a8091808SEmmanuel Vadot      - const: stacks
49a8091808SEmmanuel Vadot
50a8091808SEmmanuel Vadot  mali-supply: true
51a8091808SEmmanuel Vadot
52a8091808SEmmanuel Vadot  operating-points-v2: true
53a8091808SEmmanuel Vadot  opp-table:
54a8091808SEmmanuel Vadot    type: object
55a8091808SEmmanuel Vadot
56a8091808SEmmanuel Vadot  power-domains:
57a8091808SEmmanuel Vadot    minItems: 1
58a8091808SEmmanuel Vadot    maxItems: 5
59a8091808SEmmanuel Vadot
60a8091808SEmmanuel Vadot  power-domain-names:
61a8091808SEmmanuel Vadot    minItems: 1
62a8091808SEmmanuel Vadot    maxItems: 5
63a8091808SEmmanuel Vadot
64a8091808SEmmanuel Vadot  sram-supply: true
65a8091808SEmmanuel Vadot
66a8091808SEmmanuel Vadot  "#cooling-cells":
67a8091808SEmmanuel Vadot    const: 2
68a8091808SEmmanuel Vadot
69a8091808SEmmanuel Vadot  dynamic-power-coefficient:
70a8091808SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
71a8091808SEmmanuel Vadot    description:
72a8091808SEmmanuel Vadot      A u32 value that represents the running time dynamic
73a8091808SEmmanuel Vadot      power coefficient in units of uW/MHz/V^2. The
74a8091808SEmmanuel Vadot      coefficient can either be calculated from power
75a8091808SEmmanuel Vadot      measurements or derived by analysis.
76a8091808SEmmanuel Vadot
77a8091808SEmmanuel Vadot      The dynamic power consumption of the GPU is
78a8091808SEmmanuel Vadot      proportional to the square of the Voltage (V) and
79a8091808SEmmanuel Vadot      the clock frequency (f). The coefficient is used to
80a8091808SEmmanuel Vadot      calculate the dynamic power as below -
81a8091808SEmmanuel Vadot
82a8091808SEmmanuel Vadot      Pdyn = dynamic-power-coefficient * V^2 * f
83a8091808SEmmanuel Vadot
84a8091808SEmmanuel Vadot      where voltage is in V, frequency is in MHz.
85a8091808SEmmanuel Vadot
86a8091808SEmmanuel Vadot  dma-coherent: true
87a8091808SEmmanuel Vadot
88a8091808SEmmanuel Vadotrequired:
89a8091808SEmmanuel Vadot  - compatible
90a8091808SEmmanuel Vadot  - reg
91a8091808SEmmanuel Vadot  - interrupts
92a8091808SEmmanuel Vadot  - interrupt-names
93a8091808SEmmanuel Vadot  - clocks
94a8091808SEmmanuel Vadot  - mali-supply
95a8091808SEmmanuel Vadot
96a8091808SEmmanuel VadotadditionalProperties: false
97a8091808SEmmanuel Vadot
98a8091808SEmmanuel VadotallOf:
99a8091808SEmmanuel Vadot  - if:
100a8091808SEmmanuel Vadot      properties:
101a8091808SEmmanuel Vadot        compatible:
102a8091808SEmmanuel Vadot          contains:
103a8091808SEmmanuel Vadot            const: rockchip,rk3588-mali
104a8091808SEmmanuel Vadot    then:
105a8091808SEmmanuel Vadot      properties:
106a8091808SEmmanuel Vadot        clocks:
107a8091808SEmmanuel Vadot          minItems: 3
108a8091808SEmmanuel Vadot        power-domains:
109a8091808SEmmanuel Vadot          maxItems: 1
110a8091808SEmmanuel Vadot        power-domain-names: false
111a8091808SEmmanuel Vadot
112a8091808SEmmanuel Vadotexamples:
113a8091808SEmmanuel Vadot  - |
114a8091808SEmmanuel Vadot    #include <dt-bindings/clock/rockchip,rk3588-cru.h>
115a8091808SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
116a8091808SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
117a8091808SEmmanuel Vadot    #include <dt-bindings/power/rk3588-power.h>
118a8091808SEmmanuel Vadot
119a8091808SEmmanuel Vadot    gpu: gpu@fb000000 {
120a8091808SEmmanuel Vadot        compatible = "rockchip,rk3588-mali", "arm,mali-valhall-csf";
121a8091808SEmmanuel Vadot        reg = <0xfb000000 0x200000>;
122a8091808SEmmanuel Vadot        interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH 0>,
123a8091808SEmmanuel Vadot                     <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH 0>,
124a8091808SEmmanuel Vadot                     <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH 0>;
125a8091808SEmmanuel Vadot        interrupt-names = "job", "mmu", "gpu";
126a8091808SEmmanuel Vadot        clock-names = "core", "coregroup", "stacks";
127a8091808SEmmanuel Vadot        clocks = <&cru CLK_GPU>, <&cru CLK_GPU_COREGROUP>,
128a8091808SEmmanuel Vadot                 <&cru CLK_GPU_STACKS>;
129a8091808SEmmanuel Vadot        power-domains = <&power RK3588_PD_GPU>;
130a8091808SEmmanuel Vadot        operating-points-v2 = <&gpu_opp_table>;
131a8091808SEmmanuel Vadot        mali-supply = <&vdd_gpu_s0>;
132a8091808SEmmanuel Vadot        sram-supply = <&vdd_gpu_mem_s0>;
133a8091808SEmmanuel Vadot
134a8091808SEmmanuel Vadot        gpu_opp_table: opp-table {
135a8091808SEmmanuel Vadot            compatible = "operating-points-v2";
136a8091808SEmmanuel Vadot            opp-300000000 {
137a8091808SEmmanuel Vadot                opp-hz = /bits/ 64 <300000000>;
138a8091808SEmmanuel Vadot                opp-microvolt = <675000 675000 850000>;
139a8091808SEmmanuel Vadot            };
140a8091808SEmmanuel Vadot            opp-400000000 {
141a8091808SEmmanuel Vadot                opp-hz = /bits/ 64 <400000000>;
142a8091808SEmmanuel Vadot                opp-microvolt = <675000 675000 850000>;
143a8091808SEmmanuel Vadot            };
144a8091808SEmmanuel Vadot        };
145a8091808SEmmanuel Vadot    };
146a8091808SEmmanuel Vadot
147a8091808SEmmanuel Vadot...
148