2024-03-26 16:53:43

by Sebastian Reichel

[permalink] [raw]
Subject: [PATCH v2 0/4] RK3588 GPU support

Hi,

Panthor has landed in linux-next including the DT bindings, so it is
time to add the necessary DT changes to support the GPU on RK3588.
This adds support at SoC level and support for the EVB1 as well as
the Rock 5B, which covers both variants found in RK3588 boards:

1. Having dedicated regulators for GPU core and GPU memory. This
is handled by coupling both regulators.
2. Having a shared regulator for GPU core and GPU memory.

I prepared a branch with the GPU DT changes (and the panthor driver
changes for testing, consdering they do not clash) based on Heiko's
for-next branch:

https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux/-/commits/rk3588-gpu

Changes since PATCHv1:
- https://lore.kernel.org/all/[email protected]/
- remove always-on from the GPU regulator in the Rock 5B patch
- add comment to the always-on for the GPU regulators in the EVB1 patch
- add explanation for the always-on in the EVB1 commit description

Greetings,

-- Sebastian

Boris Brezillon (3):
arm64: dts: rockchip: rk3588: Add GPU nodes
arm64: dts: rockchip: rk3588-rock5b: Enable GPU
arm64: dts: rockchip: rk3588-evb1: Enable GPU

Sebastian Reichel (1):
arm64: defconfig: support Mali CSF-based GPUs

.../boot/dts/rockchip/rk3588-evb1-v10.dts | 14 +++++
.../boot/dts/rockchip/rk3588-rock-5b.dts | 5 ++
arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 56 +++++++++++++++++++
arch/arm64/configs/defconfig | 1 +
4 files changed, 76 insertions(+)

--
2.43.0



2024-03-26 16:53:50

by Sebastian Reichel

[permalink] [raw]
Subject: [PATCH v2 2/4] arm64: dts: rockchip: rk3588: Add GPU nodes

From: Boris Brezillon <[email protected]>

Add Mali GPU Node to the RK3588 SoC DT including GPU clock
operating points

Signed-off-by: Boris Brezillon <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
---
arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 56 +++++++++++++++++++++++
1 file changed, 56 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
index 87b83c87bd55..89d40cff635f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
@@ -501,6 +501,62 @@ usb_host2_xhci: usb@fcd00000 {
status = "disabled";
};

+ gpu: gpu@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 0>,
+ <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH 0>,
+ <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH 0>;
+ interrupt-names = "job", "mmu", "gpu";
+ operating-points-v2 = <&gpu_opp_table>;
+ power-domains = <&power RK3588_PD_GPU>;
+ status = "disabled";
+
+ 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>;
+ };
+ 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>;
+ };
+ };
+ };
+
pmu1grf: syscon@fd58a000 {
compatible = "rockchip,rk3588-pmugrf", "syscon", "simple-mfd";
reg = <0x0 0xfd58a000 0x0 0x10000>;
--
2.43.0


2024-03-26 16:54:06

by Sebastian Reichel

[permalink] [raw]
Subject: [PATCH v2 4/4] arm64: dts: rockchip: rk3588-evb1: Enable GPU

From: Boris Brezillon <[email protected]>

Enable the Mali GPU in the RK3588 EVB1.

This marks the GPU regulators as always-on, because the generic
coupler regulator logic from the kernel can only handle them
when they are marked as always-on. Technically it's okay to
disable the regulators, when the GPU is not used.

Considering the RK3588 EVB1 is not battery powered, the slightly
increased power consumption for keeping the regulator always
enabled is not a big deal. Thus it's better to enable GPU support
than wait for a better solution.

Signed-off-by: Boris Brezillon <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
---
arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts
index de30c2632b8e..56c019b25fa8 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-evb1-v10.dts
@@ -281,6 +281,12 @@ &gmac0_rgmii_clk
status = "okay";
};

+&gpu {
+ mali-supply = <&vdd_gpu_s0>;
+ sram-supply = <&vdd_gpu_mem_s0>;
+ status = "okay";
+};
+
&i2c2 {
status = "okay";

@@ -484,12 +490,16 @@ rk806_dvs3_null: dvs3-null-pins {

regulators {
vdd_gpu_s0: dcdc-reg1 {
+ /* regulator coupling requires always-on */
+ regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <550000>;
regulator-max-microvolt = <950000>;
regulator-ramp-delay = <12500>;
regulator-name = "vdd_gpu_s0";
regulator-enable-ramp-delay = <400>;
+ regulator-coupled-with = <&vdd_gpu_mem_s0>;
+ regulator-coupled-max-spread = <10000>;
regulator-state-mem {
regulator-off-in-suspend;
};
@@ -534,12 +544,16 @@ regulator-state-mem {
};

vdd_gpu_mem_s0: dcdc-reg5 {
+ /* regulator coupling requires always-on */
+ regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <675000>;
regulator-max-microvolt = <950000>;
regulator-ramp-delay = <12500>;
regulator-enable-ramp-delay = <400>;
regulator-name = "vdd_gpu_mem_s0";
+ regulator-coupled-with = <&vdd_gpu_s0>;
+ regulator-coupled-max-spread = <10000>;
regulator-state-mem {
regulator-off-in-suspend;
};
--
2.43.0


2024-03-27 10:28:53

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] RK3588 GPU support

On Tue, 26 Mar 2024 17:52:04 +0100, Sebastian Reichel wrote:
> Panthor has landed in linux-next including the DT bindings, so it is
> time to add the necessary DT changes to support the GPU on RK3588.
> This adds support at SoC level and support for the EVB1 as well as
> the Rock 5B, which covers both variants found in RK3588 boards:
>
> 1. Having dedicated regulators for GPU core and GPU memory. This
> is handled by coupling both regulators.
> 2. Having a shared regulator for GPU core and GPU memory.
>
> [...]

Applied, thanks!

[1/4] arm64: defconfig: support Mali CSF-based GPUs
commit: e6968faa33ce754bbe36dd6d9fe6951ec10616b1
[2/4] arm64: dts: rockchip: rk3588: Add GPU nodes
commit: 6fca4edb93d335f29f81e484936f38a5eed6a9b1
[3/4] arm64: dts: rockchip: rk3588-rock5b: Enable GPU
commit: 038347286941148b6fd0cc2c40afcd540315aa6f
[4/4] arm64: dts: rockchip: rk3588-evb1: Enable GPU
commit: 75a287219a782951e671026ed4fbe611e4629c83

Best regards,
--
Heiko Stuebner <[email protected]>