diff mbox series

[5/5] arm64: dts: mediatek: mt8390-genio-700-evk: Enable Mali GPU

Message ID 20240920134111.19744-6-pablo.sun@mediatek.com (mailing list archive)
State New
Headers show
Series Enable Mali GPU on MediaTek Genio 700 EVK | expand

Commit Message

Pablo Sun Sept. 20, 2024, 1:41 p.m. UTC
Configure GPU regulator supplies and enable GPU for GENIO 700 EVK.

The GPU in MT8390 & MT8188 has two power inputs: "DVDD_GPU" and
"DVDD_SRAM_GPU". In Genio 700 EVK, DVDD_GPU is supplied by
mt6359_vproc2_buck_reg, and DVDD_SRAM_GPU is supplied by
mt6359_vsram_others_ldo_reg.

According to section 5.2 "Recommended Operating Conditions" in
MT8390 IoT Application Processor Datasheet v1.9, The recommended
operating voltage ranges are:

- DVDD_GPU: min 0.55V, max 0.86V, typical 0.75V
- DVDD_SRAM_GPU: min 0.71V, max 0.92V, typical 0.85V

In this commit, we set DVDD_SRAM_GPU to typical 0.85V. It is possbile
to couple it to the DVDD_GPU in future patches.

Signed-off-by: Pablo Sun <pablo.sun@mediatek.com>
---
 .../dts/mediatek/mt8390-genio-700-evk.dts     | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

AngeloGioacchino Del Regno Sept. 23, 2024, 8:45 a.m. UTC | #1
Il 20/09/24 15:41, Pablo Sun ha scritto:
> Configure GPU regulator supplies and enable GPU for GENIO 700 EVK.
> 
> The GPU in MT8390 & MT8188 has two power inputs: "DVDD_GPU" and
> "DVDD_SRAM_GPU". In Genio 700 EVK, DVDD_GPU is supplied by
> mt6359_vproc2_buck_reg, and DVDD_SRAM_GPU is supplied by
> mt6359_vsram_others_ldo_reg.
> 
> According to section 5.2 "Recommended Operating Conditions" in
> MT8390 IoT Application Processor Datasheet v1.9, The recommended
> operating voltage ranges are:
> 
> - DVDD_GPU: min 0.55V, max 0.86V, typical 0.75V
> - DVDD_SRAM_GPU: min 0.71V, max 0.92V, typical 0.85V
> 
> In this commit, we set DVDD_SRAM_GPU to typical 0.85V. It is possbile
> to couple it to the DVDD_GPU in future patches.
> 
> Signed-off-by: Pablo Sun <pablo.sun@mediatek.com>

Is there any real difference between MT8390 and MT8188 in terms of the GPU OPPs?

I see that on MT8188, frequencies up to 880MHz want a DVDD_SRAM_GPU of 0.750V,
then 0.775/0.762/0.750 (bin1-4/5/6) on 915MHz, and 0.800/0.775/0.750 (bin1-4/5/6)
on 950MHz.

Those never call for 0.850V...! So is MT8188 (Chromebooks) wrong, or is MT8390
different in that?

Cheers,
Angelo

> ---
>   .../dts/mediatek/mt8390-genio-700-evk.dts     | 24 +++++++++++++++++++
>   1 file changed, 24 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8390-genio-700-evk.dts b/arch/arm64/boot/dts/mediatek/mt8390-genio-700-evk.dts
> index 1474bef7e754..a1d6f4cd4e5f 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8390-genio-700-evk.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8390-genio-700-evk.dts
> @@ -190,6 +190,11 @@ usb_p2_vbus: regulator-10 {
>   	};
>   };
>   
> +&gpu {
> +	mali-supply = <&mt6359_vproc2_buck_reg>;
> +	status = "okay";
> +};
> +
>   &i2c0 {
>   	pinctrl-names = "default";
>   	pinctrl-0 = <&i2c0_pins>;
> @@ -253,6 +258,14 @@ &i2c6 {
>   	status = "okay";
>   };
>   
> +&mfg0 {
> +	domain-supply = <&mt6359_vproc2_buck_reg>;
> +};
> +
> +&mfg1 {
> +	domain-supply = <&mt6359_vsram_others_ldo_reg>;
> +};
> +
>   &mmc0 {
>   	status = "okay";
>   	pinctrl-names = "default", "state_uhs";
> @@ -314,6 +327,11 @@ &mt6359_vpa_buck_reg {
>   	regulator-max-microvolt = <3100000>;
>   };
>   
> +&mt6359_vproc2_buck_reg {
> +	regulator-min-microvolt = <550000>;
> +	regulator-max-microvolt = <860000>;
> +};
> +
>   &mt6359_vpu_buck_reg {
>   	regulator-always-on;
>   };
> @@ -326,6 +344,12 @@ &mt6359_vsim1_ldo_reg {
>   	regulator-enable-ramp-delay = <480>;
>   };
>   
> +/* for GPU SRAM */
> +&mt6359_vsram_others_ldo_reg {
> +	regulator-min-microvolt = <850000>;
> +	regulator-max-microvolt = <850000>;
> +};
> +
>   &mt6359_vufs_ldo_reg {
>   	regulator-always-on;
>   };
Pablo Sun Sept. 23, 2024, 10:14 a.m. UTC | #2
Hi Angelo,

On 9/23/24 16:45, AngeloGioacchino Del Regno wrote:
[snipped]
> 
> Is there any real difference between MT8390 and MT8188 in terms of the 
> GPU OPPs?
> 
> I see that on MT8188, frequencies up to 880MHz want a DVDD_SRAM_GPU of 
> 0.750V,
> then 0.775/0.762/0.750 (bin1-4/5/6) on 915MHz, and 0.800/0.775/0.750 
> (bin1-4/5/6)
> on 950MHz.
> 
> Those never call for 0.850V...! So is MT8188 (Chromebooks) wrong, or is 
> MT8390
> different in that?

To the best of my knowledge, MT8390 and MT8188 has identical GPU
subsystem. Thus, the OPP table should have no difference.

To be specific, I list the link to the OPP table of Genio 700 EVK
(MT8390) in reference in [1]. It should match the setting in Chromebook
kernel branches.

The "typical" voltage in the datasheet is the voltage that would work
for all frequency settings. As long as it is smaller than the maximum
operating voltage, setting voltages higher than the ones specified in
the OPP table does not damage the hardware.

But this 0.85V setting is indeed not optimal. We should follow the
voltages described in the OPP table, if we want power savings.

I also considered model the regulator setting with 
'regulator-coupled-with' and 'regulator-coupled-max-spread', but I am 
not entirely sure how to describe the relation that "DVDD_GPU_SRAM 
should follow DVDD_GPU
if and only if DVDD_GPU is higher than 0.75V" - should I simply
set min-voltage to 0.75V and set 'regulator-coupled-with' ?

[1]: 
https://gitlab.com/mediatek/aiot/rity/meta-mediatek-bsp/-/blob/kirkstone/recipes-kernel/dtbo/mt8390/gpu-mali.dts

Many thanks,
Pablo
AngeloGioacchino Del Regno Sept. 23, 2024, 12:25 p.m. UTC | #3
Il 23/09/24 12:14, Pablo Sun ha scritto:
> Hi Angelo,
> 
> On 9/23/24 16:45, AngeloGioacchino Del Regno wrote:
> [snipped]
>>
>> Is there any real difference between MT8390 and MT8188 in terms of the GPU OPPs?
>>
>> I see that on MT8188, frequencies up to 880MHz want a DVDD_SRAM_GPU of 0.750V,
>> then 0.775/0.762/0.750 (bin1-4/5/6) on 915MHz, and 0.800/0.775/0.750 (bin1-4/5/6)
>> on 950MHz.
>>
>> Those never call for 0.850V...! So is MT8188 (Chromebooks) wrong, or is MT8390
>> different in that?
> 
> To the best of my knowledge, MT8390 and MT8188 has identical GPU
> subsystem. Thus, the OPP table should have no difference.
> 
> To be specific, I list the link to the OPP table of Genio 700 EVK
> (MT8390) in reference in [1]. It should match the setting in Chromebook
> kernel branches.
> 
> The "typical" voltage in the datasheet is the voltage that would work
> for all frequency settings. As long as it is smaller than the maximum
> operating voltage, setting voltages higher than the ones specified in
> the OPP table does not damage the hardware.
> 
> But this 0.85V setting is indeed not optimal. We should follow the
> voltages described in the OPP table, if we want power savings.
> 
> I also considered model the regulator setting with 'regulator-coupled-with' and 
> 'regulator-coupled-max-spread', but I am not entirely sure how to describe the 
> relation that "DVDD_GPU_SRAM should follow DVDD_GPU
> if and only if DVDD_GPU is higher than 0.75V" - should I simply
> set min-voltage to 0.75V and set 'regulator-coupled-with' ?
> 

VSRAM_GPU regulator:

	regulator-min-microvolt = <750000>;
	regulator-max-microvolt = <800000>;
	regulator-coupled-with = <&(vgpu regulator)>;
	regulator-coupled-max-spread = <1000>;

VGPU regulator:
	regulator-min-microvolt = <400000>;
	regulator-max-microvolt = <800000>;
	regulator-coupled-with = <&(vsram_gpu regulator)>;
	regulator-coupled-max-spread = <1000>;

Cheers,
Angelo

> [1]: 
> https://gitlab.com/mediatek/aiot/rity/meta-mediatek-bsp/-/blob/kirkstone/recipes-kernel/dtbo/mt8390/gpu-mali.dts
> 
> Many thanks,
> Pablo
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/mediatek/mt8390-genio-700-evk.dts b/arch/arm64/boot/dts/mediatek/mt8390-genio-700-evk.dts
index 1474bef7e754..a1d6f4cd4e5f 100644
--- a/arch/arm64/boot/dts/mediatek/mt8390-genio-700-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8390-genio-700-evk.dts
@@ -190,6 +190,11 @@  usb_p2_vbus: regulator-10 {
 	};
 };
 
+&gpu {
+	mali-supply = <&mt6359_vproc2_buck_reg>;
+	status = "okay";
+};
+
 &i2c0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c0_pins>;
@@ -253,6 +258,14 @@  &i2c6 {
 	status = "okay";
 };
 
+&mfg0 {
+	domain-supply = <&mt6359_vproc2_buck_reg>;
+};
+
+&mfg1 {
+	domain-supply = <&mt6359_vsram_others_ldo_reg>;
+};
+
 &mmc0 {
 	status = "okay";
 	pinctrl-names = "default", "state_uhs";
@@ -314,6 +327,11 @@  &mt6359_vpa_buck_reg {
 	regulator-max-microvolt = <3100000>;
 };
 
+&mt6359_vproc2_buck_reg {
+	regulator-min-microvolt = <550000>;
+	regulator-max-microvolt = <860000>;
+};
+
 &mt6359_vpu_buck_reg {
 	regulator-always-on;
 };
@@ -326,6 +344,12 @@  &mt6359_vsim1_ldo_reg {
 	regulator-enable-ramp-delay = <480>;
 };
 
+/* for GPU SRAM */
+&mt6359_vsram_others_ldo_reg {
+	regulator-min-microvolt = <850000>;
+	regulator-max-microvolt = <850000>;
+};
+
 &mt6359_vufs_ldo_reg {
 	regulator-always-on;
 };