mbox series

[0/5] Allow getting regulator on MFG for multiple SoCs

Message ID 20220623100951.21153-1-angelogioacchino.delregno@collabora.com (mailing list archive)
Headers show
Series Allow getting regulator on MFG for multiple SoCs | expand

Message

AngeloGioacchino Del Regno June 23, 2022, 10:09 a.m. UTC
This is one of the steps to enable DVFS with the Panfrost driver:
since Panfrost is already enabling the (required) MFG power domains
and since the mtk-pm-domains driver is already responsible for
actually enabling the SRAM PDN, it makes sense to make sure that
the VSRAM supply is ON when trying to reset/enable the SRAM.

For this reason, the MTK_SCPD_DOMAIN_SUPPLY flag was added to one
more MFG domain, ensuring that the SRAM is actually powered and
also not relying on the bootloader leaving this supply on; on the
other hand, this is also making possible to avoid setting a
sram-supply on the GPU node, making devfreq happy about having
only one supply and finally allowing DVFS to happen.

If no domain-supply is declared in devicetree, mtk-pm-domains driver
probe will anyway keep going, so this is not breaking old devicetrees.

No side effects either when this supply is declared for both a MFG
domain and Panfrost together.

This series has no dependencies.

AngeloGioacchino Del Regno (5):
  soc: mediatek: mt8192-pm-domains: Allow probing vreg supply on MFG0/1
  soc: mediatek: mt8183-pm-domains: Allow probing vreg supply on
    MFG_ASYNC
  soc: mediatek: mt8195-pm-domains: Allow probing vreg supply on MFG1
  soc: mediatek: mt8186-pm-domains: Allow probing vreg supply on MFG1
  arm64: dts: mediatek: mt8183-kukui: Assign sram supply to mfg_async pd

 arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++
 arch/arm64/boot/dts/mediatek/mt8183.dtsi       | 2 +-
 drivers/soc/mediatek/mt8183-pm-domains.h       | 1 +
 drivers/soc/mediatek/mt8186-pm-domains.h       | 2 +-
 drivers/soc/mediatek/mt8192-pm-domains.h       | 2 ++
 drivers/soc/mediatek/mt8195-pm-domains.h       | 2 +-
 6 files changed, 10 insertions(+), 3 deletions(-)

Comments

Matthias Brugger June 23, 2022, 11:40 a.m. UTC | #1
On 23/06/2022 12:09, AngeloGioacchino Del Regno wrote:
> This is one of the steps to enable DVFS with the Panfrost driver:
> since Panfrost is already enabling the (required) MFG power domains
> and since the mtk-pm-domains driver is already responsible for
> actually enabling the SRAM PDN, it makes sense to make sure that
> the VSRAM supply is ON when trying to reset/enable the SRAM.
> 
> For this reason, the MTK_SCPD_DOMAIN_SUPPLY flag was added to one
> more MFG domain, ensuring that the SRAM is actually powered and
> also not relying on the bootloader leaving this supply on; on the
> other hand, this is also making possible to avoid setting a
> sram-supply on the GPU node, making devfreq happy about having
> only one supply and finally allowing DVFS to happen.
> 
> If no domain-supply is declared in devicetree, mtk-pm-domains driver
> probe will anyway keep going, so this is not breaking old devicetrees.
> 
> No side effects either when this supply is declared for both a MFG
> domain and Panfrost together.
> 
> This series has no dependencies.
> 
> AngeloGioacchino Del Regno (5):
>    soc: mediatek: mt8192-pm-domains: Allow probing vreg supply on MFG0/1
>    soc: mediatek: mt8183-pm-domains: Allow probing vreg supply on
>      MFG_ASYNC
>    soc: mediatek: mt8195-pm-domains: Allow probing vreg supply on MFG1
>    soc: mediatek: mt8186-pm-domains: Allow probing vreg supply on MFG1

I think we can squash the 4 patches into one. Other then that series looks good.

Matthias

>    arm64: dts: mediatek: mt8183-kukui: Assign sram supply to mfg_async pd
> 
>   arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++
>   arch/arm64/boot/dts/mediatek/mt8183.dtsi       | 2 +-
>   drivers/soc/mediatek/mt8183-pm-domains.h       | 1 +
>   drivers/soc/mediatek/mt8186-pm-domains.h       | 2 +-
>   drivers/soc/mediatek/mt8192-pm-domains.h       | 2 ++
>   drivers/soc/mediatek/mt8195-pm-domains.h       | 2 +-
>   6 files changed, 10 insertions(+), 3 deletions(-)
>
AngeloGioacchino Del Regno June 23, 2022, 12:27 p.m. UTC | #2
Il 23/06/22 13:40, Matthias Brugger ha scritto:
> 
> 
> On 23/06/2022 12:09, AngeloGioacchino Del Regno wrote:
>> This is one of the steps to enable DVFS with the Panfrost driver:
>> since Panfrost is already enabling the (required) MFG power domains
>> and since the mtk-pm-domains driver is already responsible for
>> actually enabling the SRAM PDN, it makes sense to make sure that
>> the VSRAM supply is ON when trying to reset/enable the SRAM.
>>
>> For this reason, the MTK_SCPD_DOMAIN_SUPPLY flag was added to one
>> more MFG domain, ensuring that the SRAM is actually powered and
>> also not relying on the bootloader leaving this supply on; on the
>> other hand, this is also making possible to avoid setting a
>> sram-supply on the GPU node, making devfreq happy about having
>> only one supply and finally allowing DVFS to happen.
>>
>> If no domain-supply is declared in devicetree, mtk-pm-domains driver
>> probe will anyway keep going, so this is not breaking old devicetrees.
>>
>> No side effects either when this supply is declared for both a MFG
>> domain and Panfrost together.
>>
>> This series has no dependencies.
>>
>> AngeloGioacchino Del Regno (5):
>>    soc: mediatek: mt8192-pm-domains: Allow probing vreg supply on MFG0/1
>>    soc: mediatek: mt8183-pm-domains: Allow probing vreg supply on
>>      MFG_ASYNC
>>    soc: mediatek: mt8195-pm-domains: Allow probing vreg supply on MFG1
>>    soc: mediatek: mt8186-pm-domains: Allow probing vreg supply on MFG1
> 
> I think we can squash the 4 patches into one. Other then that series looks good.
> 

I was wondering the same... the reason why I haven't squashed the patches is
that I'm not sure if MT8173 also needs that or not - and this makes really
clear to whoever reads the git log that MT8173 was omitted.
Looking back at that though, be it one and squashed, or be it four, shouldn't
change much for that kind of intention, what do you say?

Eh, for clarity - I didn't even check/touch MT8173 because that's PowerVR... and
currently there's no driver that's currently upstream.

Anyway, if you think that squashing is the right way to go, I can do that in
practically no time and send a v2.

Cheers,
Angelo

> Matthias
> 
>>    arm64: dts: mediatek: mt8183-kukui: Assign sram supply to mfg_async pd
>>
>>   arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++
>>   arch/arm64/boot/dts/mediatek/mt8183.dtsi       | 2 +-
>>   drivers/soc/mediatek/mt8183-pm-domains.h       | 1 +
>>   drivers/soc/mediatek/mt8186-pm-domains.h       | 2 +-
>>   drivers/soc/mediatek/mt8192-pm-domains.h       | 2 ++
>>   drivers/soc/mediatek/mt8195-pm-domains.h       | 2 +-
>>   6 files changed, 10 insertions(+), 3 deletions(-)
>>