Re: Re: Re: [PATCH v4 3/5] arm64: dts: allwinner: h6: Add GPU OPP table

From: Jernej Škrabec
Date: Thu Sep 08 2022 - 12:54:16 EST


Dne četrtek, 08. september 2022 ob 18:26:31 CEST je Jernej Škrabec napisal(a):
> Dne torek, 06. september 2022 ob 21:26:34 CEST je Clément Péron napisal(a):
> > Hi Jernej,
> >
> > On Tue, 6 Sept 2022 at 21:10, Jernej Škrabec <jernej.skrabec@xxxxxxxxx>
>
> wrote:
> > > Dne torek, 06. september 2022 ob 17:30:32 CEST je Clément Péron
>
> napisal(a):
> > > > Add an Operating Performance Points table for the GPU to
> > > > enable Dynamic Voltage & Frequency Scaling on the H6.
> > > >
> > > > The voltage range is set with minimal voltage set to the target
> > > > and the maximal voltage set to 1.2V. This allow DVFS framework to
> > > > work properly on board with fixed regulator.
> > > >
> > > > Signed-off-by: Clément Péron <peron.clem@xxxxxxxxx>
> > > > ---
> > > >
> > > > .../boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi | 87
> > > > +++++++++++++++++++
> > > > 1 file changed, 87 insertions(+)
> > > > create mode 100644
> > > > arch/arm64/boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi
> > > >
> > > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi
> > > > b/arch/arm64/boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi new file mode
> > > > 100644
> > > > index 000000000000..b48049c4fc85
> > > > --- /dev/null
> > > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi
> > > > @@ -0,0 +1,87 @@
> > > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > > > +// Copyright (C) 2022 Clément Péron <peron.clem@xxxxxxxxx>
> > > > +
> > > > +/ {
> > > > + gpu_opp_table: opp-table-gpu {
> > > > + compatible = "operating-points-v2";
> > > > +
> > > > + opp-216000000 {
> > > > + opp-hz = /bits/ 64 <216000000>;
> > > > + opp-microvolt = <810000 810000 1200000>;
> > > > + };
> > > > +
> > > > + opp-264000000 {
> > > > + opp-hz = /bits/ 64 <264000000>;
> > > > + opp-microvolt = <810000 810000 1200000>;
> > > > + };
> > >
> > > As mentioned in clock patch review, rates below 288 MHz are deemed
> > > unstable on GPU PLL by vendor GPU kernel driver. At least in the BSP
> > > version that I have. Did you test these points? If not, better to drop
> > > them.
> >
> > I changed the governor to userspace and set the freq to 216MHz / 264MHz
> > Run glmark2 and didn't observe any glitch nor issue.
> >
> > I'm not sure if it's enough to say it's stable but I didn't observe
> > any strange behavior.
>
> Ok then.
>
> Forgot to ask, where did you get 1.2 V as an upper limit? H6 datasheet lists
> max. GPU voltage as 1.08 V.

To answer my own question, absolute max. voltage is 1.3 V, so 1.2 V is still
somewhat acceptable and in practice, fixed regulator on Tanix TX6 board is
around 1.12 V. Boards with PMIC can set lower voltage anyway.

All good.
Acked-by: Jernej Skrabec <jernej.skrabec@xxxxxxxxx>

Best regards,
Jernej

> > Regards,
> > Clement
> >
> > > Best regards,
> > > Jernej
> > >
> > > > +
> > > > + opp-312000000 {
> > > > + opp-hz = /bits/ 64 <312000000>;
> > > > + opp-microvolt = <810000 810000 1200000>;
> > > > + };
> > > > +
> > > > + opp-336000000 {
> > > > + opp-hz = /bits/ 64 <336000000>;
> > > > + opp-microvolt = <810000 810000 1200000>;
> > > > + };
> > > > +
> > > > + opp-360000000 {
> > > > + opp-hz = /bits/ 64 <360000000>;
> > > > + opp-microvolt = <820000 820000 1200000>;
> > > > + };
> > > > +
> > > > + opp-384000000 {
> > > > + opp-hz = /bits/ 64 <384000000>;
> > > > + opp-microvolt = <830000 830000 1200000>;
> > > > + };
> > > > +
> > > > + opp-408000000 {
> > > > + opp-hz = /bits/ 64 <408000000>;
> > > > + opp-microvolt = <840000 840000 1200000>;
> > > > + };
> > > > +
> > > > + opp-420000000 {
> > > > + opp-hz = /bits/ 64 <420000000>;
> > > > + opp-microvolt = <850000 850000 1200000>;
> > > > + };
> > > > +
> > > > + opp-432000000 {
> > > > + opp-hz = /bits/ 64 <432000000>;
> > > > + opp-microvolt = <860000 860000 1200000>;
> > > > + };
> > > > +
> > > > + opp-456000000 {
> > > > + opp-hz = /bits/ 64 <456000000>;
> > > > + opp-microvolt = <870000 870000 1200000>;
> > > > + };
> > > > +
> > > > + opp-504000000 {
> > > > + opp-hz = /bits/ 64 <504000000>;
> > > > + opp-microvolt = <890000 890000 1200000>;
> > > > + };
> > > > +
> > > > + opp-540000000 {
> > > > + opp-hz = /bits/ 64 <540000000>;
> > > > + opp-microvolt = <910000 910000 1200000>;
> > > > + };
> > > > +
> > > > + opp-576000000 {
> > > > + opp-hz = /bits/ 64 <576000000>;
> > > > + opp-microvolt = <930000 930000 1200000>;
> > > > + };
> > > > +
> > > > + opp-624000000 {
> > > > + opp-hz = /bits/ 64 <624000000>;
> > > > + opp-microvolt = <950000 950000 1200000>;
> > > > + };
> > > > +
> > > > + opp-756000000 {
> > > > + opp-hz = /bits/ 64 <756000000>;
> > > > + opp-microvolt = <1040000 1040000 1200000>;
> > > > + };
> > > > + };
> > > > +};
> > > > +
> > > > +&gpu {
> > > > + operating-points-v2 = <&gpu_opp_table>;
> > > > +};
> > > > --
> > > > 2.34.1