Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mainline panthor driver to 6.1 rkr1 #171

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpu/arm,mali-valhall-csf.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ARM Mali Valhall GPU

maintainers:
- Liviu Dudau <[email protected]>
- Boris Brezillon <[email protected]>

properties:
$nodename:
pattern: '^gpu@[a-f0-9]+$'

compatible:
oneOf:
- items:
- enum:
- rockchip,rk3588-mali
- const: arm,mali-valhall-csf # Mali Valhall GPU model/revision is fully discoverable

reg:
maxItems: 1

interrupts:
items:
- description: Job interrupt
- description: MMU interrupt
- description: GPU interrupt

interrupt-names:
items:
- const: job
- const: mmu
- const: gpu

clocks:
minItems: 1
maxItems: 3

clock-names:
minItems: 1
items:
- const: core
- const: coregroup
- const: stacks

mali-supply: true

operating-points-v2: true
opp-table:
type: object

power-domains:
minItems: 1
maxItems: 5

power-domain-names:
minItems: 1
maxItems: 5

sram-supply: true

"#cooling-cells":
const: 2

dynamic-power-coefficient:
$ref: /schemas/types.yaml#/definitions/uint32
description:
A u32 value that represents the running time dynamic
power coefficient in units of uW/MHz/V^2. The
coefficient can either be calculated from power
measurements or derived by analysis.

The dynamic power consumption of the GPU is
proportional to the square of the Voltage (V) and
the clock frequency (f). The coefficient is used to
calculate the dynamic power as below -

Pdyn = dynamic-power-coefficient * V^2 * f

where voltage is in V, frequency is in MHz.

dma-coherent: true

required:
- compatible
- reg
- interrupts
- interrupt-names
- clocks
- mali-supply

additionalProperties: false

allOf:
- if:
properties:
compatible:
contains:
const: rockchip,rk3588-mali
then:
properties:
clocks:
minItems: 3
power-domains:
maxItems: 1
power-domain-names: false

examples:
- |
#include <dt-bindings/clock/rockchip,rk3588-cru.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/rk3588-power.h>

gpu: gpu@fb000000 {
compatible = "rockchip,rk3588-mali", "arm,mali-valhall-csf";
reg = <0xfb000000 0x200000>;
interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH 0>,
<GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH 0>,
<GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH 0>;
interrupt-names = "job", "mmu", "gpu";
clock-names = "core", "coregroup", "stacks";
clocks = <&cru CLK_GPU>, <&cru CLK_GPU_COREGROUP>,
<&cru CLK_GPU_STACKS>;
power-domains = <&power RK3588_PD_GPU>;
operating-points-v2 = <&gpu_opp_table>;
mali-supply = <&vdd_gpu_s0>;
sram-supply = <&vdd_gpu_mem_s0>;

gpu_opp_table: opp-table {
compatible = "operating-points-v2";
opp-300000000 {
opp-hz = /bits/ 64 <300000000>;
opp-microvolt = <675000 675000 850000>;
};
opp-400000000 {
opp-hz = /bits/ 64 <400000000>;
opp-microvolt = <675000 675000 850000>;
};
};
};

...
6 changes: 6 additions & 0 deletions Documentation/driver-api/dma-buf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ DMA Fence Signalling Annotations
.. kernel-doc:: drivers/dma-buf/dma-fence.c
:doc: fence signalling annotation

DMA Fence Deadline Hints
~~~~~~~~~~~~~~~~~~~~~~~~

.. kernel-doc:: drivers/dma-buf/dma-fence.c
:doc: deadline hints

DMA Fences Functions Reference
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
5 changes: 5 additions & 0 deletions Documentation/gpu/driver-uapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ drm/i915 uAPI
=============

.. kernel-doc:: include/uapi/drm/i915_drm.h

drm/panthor uAPI
================

.. kernel-doc:: i
54 changes: 54 additions & 0 deletions Documentation/gpu/drm-mm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,42 @@ DRM MM Range Allocator Function References
.. kernel-doc:: drivers/gpu/drm/drm_mm.c
:export:

DRM GPU VA Manager
==================

Overview
--------

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:doc: Overview

Split and Merge
---------------

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:doc: Split and Merge

Locking
-------

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:doc: Locking

Examples
--------

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:doc: Examples

DRM GPU VA Manager Function References
--------------------------------------

.. kernel-doc:: include/drm/drm_gpuva_mgr.h
:internal:

.. kernel-doc:: drivers/gpu/drm/drm_gpuva_mgr.c
:export:

DRM Buddy Allocator
===================

Expand Down Expand Up @@ -493,6 +529,18 @@ DRM Sync Objects
.. kernel-doc:: drivers/gpu/drm/drm_syncobj.c
:export:

DRM Execution context
=====================

.. kernel-doc:: drivers/gpu/drm/drm_exec.c
:doc: Overview

.. kernel-doc:: include/drm/drm_exec.h
:internal:

.. kernel-doc:: drivers/gpu/drm/drm_exec.c
:export:

GPU Scheduler
=============

Expand All @@ -502,6 +550,12 @@ Overview
.. kernel-doc:: drivers/gpu/drm/scheduler/sched_main.c
:doc: Overview

Flow Control
------------

.. kernel-doc:: drivers/gpu/drm/scheduler/sched_main.c
:doc: Flow Control

Scheduler Function References
-----------------------------

Expand Down
11 changes: 11 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,17 @@ T: git git://anongit.freedesktop.org/drm/drm-misc
F: drivers/gpu/drm/panfrost/
F: include/uapi/drm/panfrost_drm.h

ARM MALI PANTHOR DRM DRIVER
M: Boris Brezillon <[email protected]>
M: Steven Price <[email protected]>
M: Liviu Dudau <[email protected]>
L: [email protected]
S: Supported
T: git git://anongit.freedesktop.org/drm/drm-misc
F: Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml
F: drivers/gpu/drm/panthor/
F: include/uapi/drm/panthor_drm.h

ARM MALI-DP DRM DRIVER
M: Liviu Dudau <[email protected]>
M: Brian Starkey <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/rockchip/overlay/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
khadas-edge2-cam2.dtbo \
khadas-edge2-cam3.dtbo \
rockchip-rk3588-opp-oc-24ghz.dtbo \
rockchip-rk3588-panthor-gpu.dtbo \
rk3588-can0-m0.dtbo \
rk3588-can1-m0.dtbo \
rk3588-can1-m1.dtbo \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/dts-v1/;
/plugin/;

/ {
fragment@0 {
target = <&gpu>;
__overlay__ {
status = "disabled";
};
};

fragment@1 {
target = <&gpu_panthor>;
__overlay__ {
status = "okay";
mali-supply = <&vdd_gpu_s0>;
};
};
};
56 changes: 56 additions & 0 deletions arch/arm64/boot/dts/rockchip/rk3588s.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2381,6 +2381,62 @@
status = "disabled";
};

gpu_panthor: gpu-panthor@fb000000 {
compatible = "rockchip,rk3588-mali", "arm,mali-valhall-csf";
reg = <0x0 0xfb000000 0x0 0x200000>;
#cooling-cells = <2>;
assigned-clocks = <&scmi_clk SCMI_CLK_GPU>;
assigned-clock-rates = <200000000>;
clocks = <&cru CLK_GPU>, <&cru CLK_GPU_COREGROUP>,
<&cru CLK_GPU_STACKS>;
clock-names = "core", "coregroup", "stacks";
dynamic-power-coefficient = <2982>;
interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "job", "mmu", "gpu";
operating-points-v2 = <&gpu_opp_table_panthor>;
power-domains = <&power RK3588_PD_GPU>;
status = "disabled";

gpu_opp_table_panthor: opp-table {
compatible = "operating-points-v2";

opp-300000000 {
opp-hz = /bits/ 64 <300000000>;
opp-microvolt = <675000 675000 850000>;
};
opp-400000000 {
opp-hz = /bits/ 64 <400000000>;
opp-microvolt = <675000 675000 850000>;
};
opp-500000000 {
opp-hz = /bits/ 64 <500000000>;
opp-microvolt = <675000 675000 850000>;
};
opp-600000000 {
opp-hz = /bits/ 64 <600000000>;
opp-microvolt = <675000 675000 850000>;
};
opp-700000000 {
opp-hz = /bits/ 64 <700000000>;
opp-microvolt = <700000 700000 850000>;
};
opp-800000000 {
opp-hz = /bits/ 64 <800000000>;
opp-microvolt = <750000 750000 850000>;
};
opp-900000000 {
opp-hz = /bits/ 64 <900000000>;
opp-microvolt = <800000 800000 850000>;
};
opp-1000000000 {
opp-hz = /bits/ 64 <1000000000>;
opp-microvolt = <850000 850000 850000>;
};
};
};

gpu_opp_table: gpu-opp-table {
compatible = "operating-points-v2";

Expand Down
Loading
Loading