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