mbox series

[v2,00/10] Panfrost: Improve and add MediaTek SoCs support

Message ID 20230221153740.1620529-1-angelogioacchino.delregno@collabora.com
Headers show
Series Panfrost: Improve and add MediaTek SoCs support | expand

Message

AngeloGioacchino Del Regno Feb. 21, 2023, 3:37 p.m. UTC
Changes in v2:
 - Add power-domain-names commit from Chen-Yu to the series
 - Kept sram-supply in base schema, overridden for non-MediaTek
 - Added Reviewed-by tags from Steven Price to the driver commits
   (as released in reply to v1's cover letter - thanks!)

This series adds support for new MediaTek SoCs (MT8186/MT8192/MT8195)
and improves MT8183 support: since the mtk-regulator-coupler driver
was picked, it is now useless for Panfrost to look for, and manage,
two regulators (GPU Vcore and GPU SRAM) on MediaTek;

The aforementioned driver will take care of keeping the voltage
relation (/constraints) of the two regulators on its own when a
voltage change request is sent to the Vcore, solving the old time
issue with not working DVFS on Panfrost+MediaTek (due to devfreq
supporting only single regulator).

In the specific case of MT8183, in order to not break the ABI, it
was necessary to add a new compatible for enabling DVFS.

Alyssa Rosenzweig (3):
  drm/panfrost: Increase MAX_PM_DOMAINS to 5
  drm/panfrost: Add the MT8192 GPU ID
  drm/panfrost: Add mediatek,mt8192-mali compatible

AngeloGioacchino Del Regno (6):
  dt-bindings: gpu: mali-bifrost: Split out MediaTek power-domains
    variation
  dt-bindings: gpu: mali-bifrost: Allow up to 5 power domains for MT8192
  dt-bindings: gpu: mali-bifrost: Add compatible for MT8195 SoC
  dt-bindings: gpu: mali-bifrost: Add new MT8183 compatible
  dt-bindings: gpu: mali-bifrost: Add a compatible for MediaTek MT8186
  drm/panfrost: Add new compatible for Mali on the MT8183 SoC

Chen-Yu Tsai (1):
  dt-bindings: gpu: mali-bifrost: Add power-domain-names to base schema

 .../bindings/gpu/arm,mali-bifrost.yaml        | 67 ++++++++++++++++++-
 drivers/gpu/drm/panfrost/panfrost_device.h    |  2 +-
 drivers/gpu/drm/panfrost/panfrost_drv.c       | 28 ++++++++
 drivers/gpu/drm/panfrost/panfrost_gpu.c       |  8 +++
 4 files changed, 101 insertions(+), 4 deletions(-)

Comments

Chen-Yu Tsai Feb. 23, 2023, 2:43 a.m. UTC | #1
On Wed, Feb 22, 2023 at 5:13 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 22/02/23 09:37, Chen-Yu Tsai ha scritto:
> > On Tue, Feb 21, 2023 at 11:37 PM AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com> wrote:
> >>
> >> Get GPU support on MT8186 by adding its compatible.
> >>
> >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> >> ---
> >>   Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml | 5 +++++
> >>   1 file changed, 5 insertions(+)
> >>
> >> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> >> index be18b161959b..43a841d4e94d 100644
> >> --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> >> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> >> @@ -15,6 +15,11 @@ properties:
> >>
> >>     compatible:
> >>       oneOf:
> >> +      - items:
> >> +          - enum:
> >> +              - mediatek,mt8186-mali
> >> +          - const: mediatek,mt8183b-mali
> >> +          - const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully discoverable
> >
> > The MT8186 has Mali-G52 MC2 2EE, while the MT8183 has Mali-G72 MP3.
>
> Keeping in mind the obvious - which is that G52 and G72 are both Bifrost....
>
> > So we actually need a new entry with two power domains.
> >
>
> ...This is my node for MT8186:
>
>                 gpu: gpu@13040000 {
>                         compatible = "mediatek,mt8186-mali",
>                                      "mediatek,mt8183b-mali",
>                                      "arm,mali-bifrost";
>                         reg = <0 0x13040000 0 0x4000>;
>
>                         clocks = <&mfgsys CLK_MFG_BG3D>;
>                         interrupts = <GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH 0>,
>                                      <GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH 0>,
>                                      <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH 0>;
>                         interrupt-names = "job", "mmu", "gpu";
>                         power-domains = <&spm MT8186_POWER_DOMAIN_MFG1>,
>                                         <&spm MT8186_POWER_DOMAIN_MFG2>,
>                                         <&spm MT8186_POWER_DOMAIN_MFG3>;
>                         power-domain-names = "core0", "core1", "core2";
>
>                         /* Please ignore speedbin, that's for another time :-) */
>                         nvmem-cells = <&gpu_volt_bin>;
>                         nvmem-cell-names = "speed-bin";
>                         #cooling-cells = <2>;
>                 };
>
> There are three MFG power domains... MFG2 and MFG3 are parents of MFG1, on that
> I agree, but we can avoid adding a new entry just for MT8186 and use the MT8183-b
> one while still being technically correct.
>
> Besides, Mali G52 and Mali G72 are both Bifrost... so I don't think that this
> commit is incorrect. For the sake of simplicity, I would push on getting this
> one picked.

I'm aware. In case it wasn't obvious, Mali-G52 MC2 2EE has 2 cores, while
Mali-G72 MP3 has 3 cores. I think that is reason enough to do a new entry.
Otherwise you are describing power domains for 3 cores for a GPU that only
has two.

> Unless there are any real-strong opinions against...

Yes.

ChenYu
AngeloGioacchino Del Regno Feb. 23, 2023, 1:15 p.m. UTC | #2
Il 23/02/23 03:43, Chen-Yu Tsai ha scritto:
> On Wed, Feb 22, 2023 at 5:13 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> Il 22/02/23 09:37, Chen-Yu Tsai ha scritto:
>>> On Tue, Feb 21, 2023 at 11:37 PM AngeloGioacchino Del Regno
>>> <angelogioacchino.delregno@collabora.com> wrote:
>>>>
>>>> Get GPU support on MT8186 by adding its compatible.
>>>>
>>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>>> ---
>>>>    Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml | 5 +++++
>>>>    1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
>>>> index be18b161959b..43a841d4e94d 100644
>>>> --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
>>>> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
>>>> @@ -15,6 +15,11 @@ properties:
>>>>
>>>>      compatible:
>>>>        oneOf:
>>>> +      - items:
>>>> +          - enum:
>>>> +              - mediatek,mt8186-mali
>>>> +          - const: mediatek,mt8183b-mali
>>>> +          - const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully discoverable
>>>
>>> The MT8186 has Mali-G52 MC2 2EE, while the MT8183 has Mali-G72 MP3.
>>
>> Keeping in mind the obvious - which is that G52 and G72 are both Bifrost....
>>
>>> So we actually need a new entry with two power domains.
>>>
>>
>> ...This is my node for MT8186:
>>
>>                  gpu: gpu@13040000 {
>>                          compatible = "mediatek,mt8186-mali",
>>                                       "mediatek,mt8183b-mali",
>>                                       "arm,mali-bifrost";
>>                          reg = <0 0x13040000 0 0x4000>;
>>
>>                          clocks = <&mfgsys CLK_MFG_BG3D>;
>>                          interrupts = <GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH 0>,
>>                                       <GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH 0>,
>>                                       <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH 0>;
>>                          interrupt-names = "job", "mmu", "gpu";
>>                          power-domains = <&spm MT8186_POWER_DOMAIN_MFG1>,
>>                                          <&spm MT8186_POWER_DOMAIN_MFG2>,
>>                                          <&spm MT8186_POWER_DOMAIN_MFG3>;
>>                          power-domain-names = "core0", "core1", "core2";
>>
>>                          /* Please ignore speedbin, that's for another time :-) */
>>                          nvmem-cells = <&gpu_volt_bin>;
>>                          nvmem-cell-names = "speed-bin";
>>                          #cooling-cells = <2>;
>>                  };
>>
>> There are three MFG power domains... MFG2 and MFG3 are parents of MFG1, on that
>> I agree, but we can avoid adding a new entry just for MT8186 and use the MT8183-b
>> one while still being technically correct.
>>
>> Besides, Mali G52 and Mali G72 are both Bifrost... so I don't think that this
>> commit is incorrect. For the sake of simplicity, I would push on getting this
>> one picked.
> 
> I'm aware. In case it wasn't obvious, Mali-G52 MC2 2EE has 2 cores, while
> Mali-G72 MP3 has 3 cores. I think that is reason enough to do a new entry.
> Otherwise you are describing power domains for 3 cores for a GPU that only
> has two.
> 
>> Unless there are any real-strong opinions against...
> 
> Yes.
> 

Ok, I will do that for v3!

Cheers,
Angelo

> ChenYu