[v3,3/7] arm64: dts: allwinner: h616: Add GPU OPP table

Message ID 20261112-h616-zero2-dt-v3-3-1cd2664230c8@gmail.com (mailing list archive)
State New
Headers
Series arm64: dts: allwinner: h616: Orange Pi Zero2 fixes, GPU DVFS and GPU cooling |

Commit Message

Arun Iyengar via B4 Relay Nov. 12, 2026, 9:22 a.m. UTC
From: Arun Iyengar <aiyengar1990@gmail.com>

Add the operating points of the H616/H618 Mali-G31, so that boards can
enable GPU DVFS through panfrost devfreq: 306 to 600 MHz at 810 to
950 mV. The table is the one of the vendor images (as recovered from a
KickPi K2B image, also carried by Armbian). Like the H6 GPU OPP table,
it uses <target target max> voltage triplets with a common 990 mV
maximum: a board whose GPU supply cannot reach an OPP's target voltage
loses that OPP, while a board whose supply minimum is above the target
of the lower OPPs keeps them, as their [target, max] range still
overlaps the supply's range.

Like sun50i-h616-cpu-opp.dtsi, the table is in a separate file that
boards include once their GPU supply is described.

Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
 .../boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi    | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)
  

Comments

Chen-Yu Tsai Nov. 15, 2026, 10:43 a.m. UTC | #1
On Thu, Nov 12, 2026 at 5:22 PM Arun Iyengar via B4 Relay
<devnull+aiyengar1990.gmail.com@kernel.org> wrote:
>
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> Add the operating points of the H616/H618 Mali-G31, so that boards can
> enable GPU DVFS through panfrost devfreq: 306 to 600 MHz at 810 to
> 950 mV. The table is the one of the vendor images (as recovered from a
> KickPi K2B image, also carried by Armbian). Like the H6 GPU OPP table,
> it uses <target target max> voltage triplets with a common 990 mV
> maximum: a board whose GPU supply cannot reach an OPP's target voltage
> loses that OPP, while a board whose supply minimum is above the target
> of the lower OPPs keeps them, as their [target, max] range still
> overlaps the supply's range.
>
> Like sun50i-h616-cpu-opp.dtsi, the table is in a separate file that
> boards include once their GPU supply is described.
>
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
> ---
>  .../boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi    | 62 ++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi
> new file mode 100644
> index 000000000000..18989d11c832
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi
> @@ -0,0 +1,62 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +// Copyright (C) 2026 Arun Iyengar <aiyengar1990@gmail.com>
> +
> +/ {
> +       gpu_opp_table: opp-table-gpu {
> +               compatible = "operating-points-v2";
> +
> +               opp-306000000 {
> +                       opp-hz = /bits/ 64 <306000000>;
> +                       opp-microvolt = <810000 810000 990000>;
> +               };
> +
> +               opp-336000000 {
> +                       opp-hz = /bits/ 64 <336000000>;
> +                       opp-microvolt = <810000 810000 990000>;
> +               };

Just a note, found by my review agent:

The temporary clock for the GPU module is currently pinned at 400 MHz.
So say you are just jumping between the lower OPPs, you go from
306 MHz -> 400 MHz -> 336 MHz, all the while the voltage could still be
0.81V. This is likely going to cause issues.

I suggest sending a separate patch to increase the pinned divider for
GPU_CLK1 from 3 to 4, which would give a *really* safe clock rate of
300 MHz.


ChenYu
  
Chen-Yu Tsai Nov. 15, 2026, 11:23 a.m. UTC | #2
On Thu, Nov 12, 2026 at 5:22 PM Arun Iyengar via B4 Relay
<devnull+aiyengar1990.gmail.com@kernel.org> wrote:
>
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> Add the operating points of the H616/H618 Mali-G31, so that boards can
> enable GPU DVFS through panfrost devfreq: 306 to 600 MHz at 810 to
> 950 mV. The table is the one of the vendor images (as recovered from a
> KickPi K2B image, also carried by Armbian). Like the H6 GPU OPP table,

FTR I found https://github.com/armbian/build/commit/3432b23f09c4a3fe74d6760b42ff01cfff8dfe1b
which probably came from https://github.com/armbian/build/pull/10902.

It says it was from an KickPi K2B v2.2 image. However the latest source
tree dump from KickPi doesn't seem to contain a GPU OPP. I can't tell if
the v2.2 refers to the board revision or the SDK version.


Note that OrangePi seems to use a different table:

https://github.com/orangepi-xunlong/linux-orangepi/blob/orange-pi-6.1-sun50iw9/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi#L1520

But anyway, if it works, that's fine.

> it uses <target target max> voltage triplets with a common 990 mV
> maximum: a board whose GPU supply cannot reach an OPP's target voltage
> loses that OPP, while a board whose supply minimum is above the target
> of the lower OPPs keeps them, as their [target, max] range still
> overlaps the supply's range.
>
> Like sun50i-h616-cpu-opp.dtsi, the table is in a separate file that
> boards include once their GPU supply is described.
>
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
> ---
>  .../boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi    | 62 ++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi
> new file mode 100644
> index 000000000000..18989d11c832
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi
> @@ -0,0 +1,62 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +// Copyright (C) 2026 Arun Iyengar <aiyengar1990@gmail.com>
> +
> +/ {
> +       gpu_opp_table: opp-table-gpu {
> +               compatible = "operating-points-v2";
> +
> +               opp-306000000 {
> +                       opp-hz = /bits/ 64 <306000000>;
> +                       opp-microvolt = <810000 810000 990000>;
> +               };
> +
> +               opp-336000000 {
> +                       opp-hz = /bits/ 64 <336000000>;
> +                       opp-microvolt = <810000 810000 990000>;
> +               };
> +
> +               opp-360000000 {
> +                       opp-hz = /bits/ 64 <360000000>;
> +                       opp-microvolt = <820000 820000 990000>;
> +               };
> +
> +               opp-384000000 {
> +                       opp-hz = /bits/ 64 <384000000>;
> +                       opp-microvolt = <830000 830000 990000>;
> +               };
> +
> +               opp-420000000 {
> +                       opp-hz = /bits/ 64 <420000000>;
> +                       opp-microvolt = <850000 850000 990000>;
> +               };
> +
> +               opp-456000000 {
> +                       opp-hz = /bits/ 64 <456000000>;
> +                       opp-microvolt = <870000 870000 990000>;
> +               };
> +
> +               opp-504000000 {
> +                       opp-hz = /bits/ 64 <504000000>;
> +                       opp-microvolt = <890000 890000 990000>;
> +               };
> +
> +               opp-540000000 {
> +                       opp-hz = /bits/ 64 <540000000>;
> +                       opp-microvolt = <910000 910000 990000>;
> +               };
> +
> +               opp-576000000 {
> +                       opp-hz = /bits/ 64 <576000000>;
> +                       opp-microvolt = <930000 930000 990000>;
> +               };
> +
> +               opp-600000000 {
> +                       opp-hz = /bits/ 64 <600000000>;
> +                       opp-microvolt = <950000 950000 990000>;
> +               };
> +       };
> +};
> +
> +&gpu {
> +       operating-points-v2 = <&gpu_opp_table>;
> +};
>
> --
> 2.55.0
>
>
  

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi
new file mode 100644
index 000000000000..18989d11c832
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-gpu-opp.dtsi
@@ -0,0 +1,62 @@ 
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2026 Arun Iyengar <aiyengar1990@gmail.com>
+
+/ {
+	gpu_opp_table: opp-table-gpu {
+		compatible = "operating-points-v2";
+
+		opp-306000000 {
+			opp-hz = /bits/ 64 <306000000>;
+			opp-microvolt = <810000 810000 990000>;
+		};
+
+		opp-336000000 {
+			opp-hz = /bits/ 64 <336000000>;
+			opp-microvolt = <810000 810000 990000>;
+		};
+
+		opp-360000000 {
+			opp-hz = /bits/ 64 <360000000>;
+			opp-microvolt = <820000 820000 990000>;
+		};
+
+		opp-384000000 {
+			opp-hz = /bits/ 64 <384000000>;
+			opp-microvolt = <830000 830000 990000>;
+		};
+
+		opp-420000000 {
+			opp-hz = /bits/ 64 <420000000>;
+			opp-microvolt = <850000 850000 990000>;
+		};
+
+		opp-456000000 {
+			opp-hz = /bits/ 64 <456000000>;
+			opp-microvolt = <870000 870000 990000>;
+		};
+
+		opp-504000000 {
+			opp-hz = /bits/ 64 <504000000>;
+			opp-microvolt = <890000 890000 990000>;
+		};
+
+		opp-540000000 {
+			opp-hz = /bits/ 64 <540000000>;
+			opp-microvolt = <910000 910000 990000>;
+		};
+
+		opp-576000000 {
+			opp-hz = /bits/ 64 <576000000>;
+			opp-microvolt = <930000 930000 990000>;
+		};
+
+		opp-600000000 {
+			opp-hz = /bits/ 64 <600000000>;
+			opp-microvolt = <950000 950000 990000>;
+		};
+	};
+};
+
+&gpu {
+	operating-points-v2 = <&gpu_opp_table>;
+};