Subject: [PATCH v4 01/12] dt-bindings: gpu: mali-bifrost: Split out MediaTek power-domains variation

In preparation for adding new bindings for new MediaTek SoCs, split out
the power-domains variation from the `else` in the current
mediatek,mt8183-mali conditional.

The sram-supply part is left in place to be disallowed for anything
that is not compatible with "mediatek,mt8183-mali" as this regulator
is MediaTek-specific and it is, and will ever be, used only for this
specific string due to the addition of the mediatek-regulator-coupler
driver.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
---
.../devicetree/bindings/gpu/arm,mali-bifrost.yaml | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
index 78964c140b46..7e110751353e 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -109,6 +109,9 @@ allOf:
contains:
const: amlogic,meson-g12a-mali
then:
+ properties:
+ power-domains:
+ maxItems: 1
required:
- resets
- if:
@@ -131,6 +134,8 @@ allOf:
- const: gpu
- const: bus
- const: bus_ace
+ power-domains:
+ maxItems: 1
resets:
minItems: 3
reset-names:
@@ -164,8 +169,6 @@ allOf:
- power-domain-names
else:
properties:
- power-domains:
- maxItems: 1
sram-supply: false
- if:
properties:
@@ -180,6 +183,8 @@ allOf:
items:
- const: gpu
- const: bus
+ power-domains:
+ maxItems: 1
required:
- clock-names

--
2.39.2



Subject: [PATCH v4 02/12] dt-bindings: gpu: mali-bifrost: Set power-domains maxItems to 5

In preparation for adding (and fixing) power-domain-names and MediaTek
MT8192 bindings, allow up to five items for power-domains.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
---
Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
index 7e110751353e..5b7f1c9d2b30 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -63,7 +63,7 @@ properties:

power-domains:
minItems: 1
- maxItems: 3
+ maxItems: 5

resets:
minItems: 1
@@ -157,6 +157,7 @@ allOf:
properties:
power-domains:
minItems: 3
+ maxItems: 3
power-domain-names:
items:
- const: core0
--
2.39.2


Subject: [PATCH v4 03/12] dt-bindings: gpu: mali-bifrost: Fix power-domain-names validation

Commit ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
incorrectly introduced power domain names for MT8183, causing
validation issues.

Add power-domain-names to the base schema, allowing a maximum of
five elements; since platforms having a single power domain don't
need any actual domain name, disallow that for each sub-schema.

Fixes: a7a596cd3115 ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
---
.../devicetree/bindings/gpu/arm,mali-bifrost.yaml | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
index 5b7f1c9d2b30..bf0f7f1f71e0 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -65,6 +65,10 @@ properties:
minItems: 1
maxItems: 5

+ power-domain-names:
+ minItems: 1
+ maxItems: 5
+
resets:
minItems: 1
maxItems: 3
@@ -112,6 +116,7 @@ allOf:
properties:
power-domains:
maxItems: 1
+ power-domain-names: false
required:
- resets
- if:
@@ -136,6 +141,7 @@ allOf:
- const: bus_ace
power-domains:
maxItems: 1
+ power-domain-names: false
resets:
minItems: 3
reset-names:
@@ -186,6 +192,7 @@ allOf:
- const: bus
power-domains:
maxItems: 1
+ power-domain-names: false
required:
- clock-names

--
2.39.2


Subject: [PATCH v4 04/12] dt-bindings: gpu: mali-bifrost: Add sub-schema for MT8192's power domains

MediaTek MT8192 (and similar) needs five power domains for the
Mali GPU and no sram-supply: change the binding to allow so by
also introducing power-domain-names in the generic binding;
while at it, also disallow the newly introduced power-domain-names
for all non-MediaTek bindings.

Fixes: 5d82e74a97c2 ("dt-bindings: Add compatible for Mali Valhall (JM)")
Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Reviewed-by: Chen-Yu Tsai <[email protected]>
---

Since the changes are small, I kept the Reviewed-by tags that were
released on the previous version of this patch.
If that was wrong, please advertise so.

.../bindings/gpu/arm,mali-bifrost.yaml | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
index bf0f7f1f71e0..c5bef872114d 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -177,6 +177,25 @@ allOf:
else:
properties:
sram-supply: false
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt8192-mali
+ then:
+ properties:
+ power-domains:
+ minItems: 5
+ power-domain-names:
+ items:
+ - const: core0
+ - const: core1
+ - const: core2
+ - const: core3
+ - const: core4
+ required:
+ - power-domains
+ - power-domain-names
- if:
properties:
compatible:
--
2.39.2


Subject: [PATCH v4 05/12] dt-bindings: gpu: mali-bifrost: Add new MT8183 compatible

Since new platform data was required in Panfrost for getting GPU DVFS
finally working on MediaTek SoCs, add a new "mediatek,mt8183b-mali"
compatible.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Reviewed-by: Chen-Yu Tsai <[email protected]>
---

Since the changes are small, I kept the Reviewed-by tags that were
released on the previous version of this patch.
If that was wrong, please advertise so.

.../bindings/gpu/arm,mali-bifrost.yaml | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
index c5bef872114d..cf24aaba70f2 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -19,6 +19,7 @@ properties:
- enum:
- amlogic,meson-g12a-mali
- mediatek,mt8183-mali
+ - mediatek,mt8183b-mali
- realtek,rtd1619-mali
- renesas,r9a07g044-mali
- renesas,r9a07g054-mali
@@ -177,6 +178,24 @@ allOf:
else:
properties:
sram-supply: false
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt8183b-mali
+ then:
+ properties:
+ power-domains:
+ minItems: 3
+ maxItems: 3
+ power-domain-names:
+ items:
+ - const: core0
+ - const: core1
+ - const: core2
+ required:
+ - power-domains
+ - power-domain-names
- if:
properties:
compatible:
--
2.39.2


Subject: [PATCH v4 06/12] dt-bindings: gpu: mali-bifrost: Add support for MediaTek MT8186

MT8186 has a Mali-G52 MC2 2EE GPU (two cores): add a binding with
two power domains (one per core) for it.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Chen-Yu Tsai <[email protected]>
---
.../bindings/gpu/arm,mali-bifrost.yaml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
index cf24aaba70f2..9f3991b6deae 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -20,6 +20,7 @@ properties:
- amlogic,meson-g12a-mali
- mediatek,mt8183-mali
- mediatek,mt8183b-mali
+ - mediatek,mt8186-mali
- realtek,rtd1619-mali
- renesas,r9a07g044-mali
- renesas,r9a07g054-mali
@@ -196,6 +197,23 @@ allOf:
required:
- power-domains
- power-domain-names
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: mediatek,mt8186-mali
+ then:
+ properties:
+ power-domains:
+ minItems: 2
+ maxItems: 2
+ power-domain-names:
+ items:
+ - const: core0
+ - const: core1
+ required:
+ - power-domains
+ - power-domain-names
- if:
properties:
compatible:
--
2.39.2


Subject: [PATCH v4 07/12] dt-bindings: gpu: mali-bifrost: Add compatible for MT8195 SoC

The MediaTek MT8195 SoC has a Mali G57 MC5 (Valhall-JM) and has the
same number of power domains and requirements as MT8192 in terms of
bindings.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
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 9f3991b6deae..8a0083800810 100644
--- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
+++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
@@ -27,6 +27,11 @@ properties:
- rockchip,px30-mali
- rockchip,rk3568-mali
- const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully discoverable
+ - items:
+ - enum:
+ - mediatek,mt8195-mali
+ - const: mediatek,mt8192-mali
+ - const: arm,mali-valhall-jm # Mali Valhall GPU model/revision is fully discoverable
- items:
- enum:
- mediatek,mt8192-mali
--
2.39.2


Subject: [PATCH v4 08/12] drm/panfrost: Increase MAX_PM_DOMAINS to 5

From: Alyssa Rosenzweig <[email protected]>

Increase the MAX_PM_DOMAINS constant from 3 to 5, to support the
extra power domains required by the Mali-G57 on the MT8192.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Steven Price <[email protected]>
---
drivers/gpu/drm/panfrost/panfrost_device.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h
index d9ba68cffb77..b0126b9fbadc 100644
--- a/drivers/gpu/drm/panfrost/panfrost_device.h
+++ b/drivers/gpu/drm/panfrost/panfrost_device.h
@@ -23,7 +23,7 @@ struct panfrost_job;
struct panfrost_perfcnt;

#define NUM_JOB_SLOTS 3
-#define MAX_PM_DOMAINS 3
+#define MAX_PM_DOMAINS 5

struct panfrost_features {
u16 id;
--
2.39.2


Subject: [PATCH v4 09/12] drm/panfrost: Add the MT8192 GPU ID

From: Alyssa Rosenzweig <[email protected]>

MediaTek MT8192 has a Mali-G57 with a special GPU ID. Add its GPU ID,
but treat it as otherwise identical to a standard Mali-G57.

We do _not_ fix up the GPU ID here -- userspace needs to be aware of the
special GPU ID, in case we find functional differences between
MediaTek's implementation and the standard Mali-G57 down the line.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Steven Price <[email protected]>
---
drivers/gpu/drm/panfrost/panfrost_gpu.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index 6452e4e900dd..d28b99732dde 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -204,6 +204,14 @@ static const struct panfrost_model gpu_models[] = {

GPU_MODEL(g57, 0x9001,
GPU_REV(g57, 0, 0)),
+
+ /* MediaTek MT8192 has a Mali-G57 with a different GPU ID from the
+ * standard. Arm's driver does not appear to handle this model.
+ * ChromeOS has a hack downstream for it. Treat it as equivalent to
+ * standard Mali-G57 for now.
+ */
+ GPU_MODEL(g57, 0x9003,
+ GPU_REV(g57, 0, 0)),
};

static void panfrost_gpu_init_features(struct panfrost_device *pfdev)
--
2.39.2


Subject: [PATCH v4 10/12] drm/panfrost: Add mediatek,mt8192-mali compatible

From: Alyssa Rosenzweig <[email protected]>

Required for Mali-G57 on the Mediatek MT8192 and MT8195, which
uses even more power domains than the MT8183 before it.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
[Angelo: Removed unneeded "sram" supply, added mt8195 to commit description]
Co-developed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Steven Price <[email protected]>
---
drivers/gpu/drm/panfrost/panfrost_drv.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index abb0dadd8f63..5d25e77e1037 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -663,6 +663,16 @@ static const struct panfrost_compatible mediatek_mt8183_data = {
.pm_domain_names = mediatek_mt8183_pm_domains,
};

+static const char * const mediatek_mt8192_supplies[] = { "mali", NULL };
+static const char * const mediatek_mt8192_pm_domains[] = { "core0", "core1", "core2",
+ "core3", "core4" };
+static const struct panfrost_compatible mediatek_mt8192_data = {
+ .num_supplies = ARRAY_SIZE(mediatek_mt8192_supplies) - 1,
+ .supply_names = mediatek_mt8192_supplies,
+ .num_pm_domains = ARRAY_SIZE(mediatek_mt8192_pm_domains),
+ .pm_domain_names = mediatek_mt8192_pm_domains,
+};
+
static const struct of_device_id dt_match[] = {
/* Set first to probe before the generic compatibles */
{ .compatible = "amlogic,meson-gxm-mali",
@@ -681,6 +691,7 @@ static const struct of_device_id dt_match[] = {
{ .compatible = "arm,mali-bifrost", .data = &default_data, },
{ .compatible = "arm,mali-valhall-jm", .data = &default_data, },
{ .compatible = "mediatek,mt8183-mali", .data = &mediatek_mt8183_data },
+ { .compatible = "mediatek,mt8192-mali", .data = &mediatek_mt8192_data },
{}
};
MODULE_DEVICE_TABLE(of, dt_match);
--
2.39.2


Subject: [PATCH v4 11/12] drm/panfrost: Add new compatible for Mali on the MT8183 SoC

The "mediatek,mt8183-mali" compatible uses platform data that calls for
getting (and managing) two regulators ("mali" and "sram") but devfreq
does not support this usecase, resulting in DVFS not working.

Since a lot of MediaTek SoCs need to set the voltages for the GPU SRAM
regulator in a specific relation to the GPU VCORE regulator, a MediaTek
SoC specific driver was introduced to automatically satisfy, through
coupling, these constraints: this means that there is at all no need to
manage both regulators in panfrost but to otherwise just manage the main
"mali" (-> gpu vcore) regulator instead.

Keeping in mind that we cannot break the ABI, the most sensible route
(avoiding hacks and uselessly overcomplicated code) to get a MT8183
node with one power supply was to add a new "mediatek,mt8183b-mali"
compatible, which effectively deprecates the former.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Steven Price <[email protected]>
---
drivers/gpu/drm/panfrost/panfrost_drv.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index 5d25e77e1037..14cdeaeeb5c4 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -654,6 +654,14 @@ static const struct panfrost_compatible amlogic_data = {
.vendor_quirk = panfrost_gpu_amlogic_quirk,
};

+/*
+ * The old data with two power supplies for MT8183 is here only to
+ * keep retro-compatibility with older devicetrees, as DVFS will
+ * not work with this one.
+ *
+ * On new devicetrees please use the _b variant with a single and
+ * coupled regulators instead.
+ */
static const char * const mediatek_mt8183_supplies[] = { "mali", "sram", NULL };
static const char * const mediatek_mt8183_pm_domains[] = { "core0", "core1", "core2" };
static const struct panfrost_compatible mediatek_mt8183_data = {
@@ -663,6 +671,14 @@ static const struct panfrost_compatible mediatek_mt8183_data = {
.pm_domain_names = mediatek_mt8183_pm_domains,
};

+static const char * const mediatek_mt8183_b_supplies[] = { "mali", NULL };
+static const struct panfrost_compatible mediatek_mt8183_b_data = {
+ .num_supplies = ARRAY_SIZE(mediatek_mt8183_b_supplies) - 1,
+ .supply_names = mediatek_mt8183_b_supplies,
+ .num_pm_domains = ARRAY_SIZE(mediatek_mt8183_pm_domains),
+ .pm_domain_names = mediatek_mt8183_pm_domains,
+};
+
static const char * const mediatek_mt8192_supplies[] = { "mali", NULL };
static const char * const mediatek_mt8192_pm_domains[] = { "core0", "core1", "core2",
"core3", "core4" };
@@ -691,6 +707,7 @@ static const struct of_device_id dt_match[] = {
{ .compatible = "arm,mali-bifrost", .data = &default_data, },
{ .compatible = "arm,mali-valhall-jm", .data = &default_data, },
{ .compatible = "mediatek,mt8183-mali", .data = &mediatek_mt8183_data },
+ { .compatible = "mediatek,mt8183b-mali", .data = &mediatek_mt8183_b_data },
{ .compatible = "mediatek,mt8192-mali", .data = &mediatek_mt8192_data },
{}
};
--
2.39.2


Subject: [PATCH v4 12/12] drm/panfrost: Add support for Mali on the MT8186 SoC

MediaTek MT8186 has a Mali-G52 MC2 2EE (Bifrost): add a new compatible
and platform data using the same supplies list as "mt8183_b" (only one
regulator), and a new pm_domains list with only two power domains.

Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Steven Price <[email protected]>
---
drivers/gpu/drm/panfrost/panfrost_drv.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index 14cdeaeeb5c4..e4053bf84c62 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -679,6 +679,14 @@ static const struct panfrost_compatible mediatek_mt8183_b_data = {
.pm_domain_names = mediatek_mt8183_pm_domains,
};

+static const char * const mediatek_mt8186_pm_domains[] = { "core0", "core1" };
+static const struct panfrost_compatible mediatek_mt8186_data = {
+ .num_supplies = ARRAY_SIZE(mediatek_mt8183_b_supplies) - 1,
+ .supply_names = mediatek_mt8183_b_supplies,
+ .num_pm_domains = ARRAY_SIZE(mediatek_mt8186_pm_domains),
+ .pm_domain_names = mediatek_mt8186_pm_domains,
+};
+
static const char * const mediatek_mt8192_supplies[] = { "mali", NULL };
static const char * const mediatek_mt8192_pm_domains[] = { "core0", "core1", "core2",
"core3", "core4" };
@@ -708,6 +716,7 @@ static const struct of_device_id dt_match[] = {
{ .compatible = "arm,mali-valhall-jm", .data = &default_data, },
{ .compatible = "mediatek,mt8183-mali", .data = &mediatek_mt8183_data },
{ .compatible = "mediatek,mt8183b-mali", .data = &mediatek_mt8183_b_data },
+ { .compatible = "mediatek,mt8186-mali", .data = &mediatek_mt8186_data },
{ .compatible = "mediatek,mt8192-mali", .data = &mediatek_mt8192_data },
{}
};
--
2.39.2


2023-03-07 09:52:51

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 12/12] drm/panfrost: Add support for Mali on the MT8186 SoC

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> MediaTek MT8186 has a Mali-G52 MC2 2EE (Bifrost): add a new compatible
> and platform data using the same supplies list as "mt8183_b" (only one
> regulator), and a new pm_domains list with only two power domains.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Steven Price <[email protected]>

Reviewed-by: Chen-Yu Tsai <[email protected]>
Tested-by: Chen-Yu Tsai <[email protected]>

2023-03-07 09:53:26

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 11/12] drm/panfrost: Add new compatible for Mali on the MT8183 SoC

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> The "mediatek,mt8183-mali" compatible uses platform data that calls for
> getting (and managing) two regulators ("mali" and "sram") but devfreq
> does not support this usecase, resulting in DVFS not working.
>
> Since a lot of MediaTek SoCs need to set the voltages for the GPU SRAM
> regulator in a specific relation to the GPU VCORE regulator, a MediaTek
> SoC specific driver was introduced to automatically satisfy, through
> coupling, these constraints: this means that there is at all no need to
> manage both regulators in panfrost but to otherwise just manage the main
> "mali" (-> gpu vcore) regulator instead.
>
> Keeping in mind that we cannot break the ABI, the most sensible route
> (avoiding hacks and uselessly overcomplicated code) to get a MT8183
> node with one power supply was to add a new "mediatek,mt8183b-mali"
> compatible, which effectively deprecates the former.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Steven Price <[email protected]>

Reviewed-by: Chen-Yu Tsai <[email protected]>
Tested-by: Chen-Yu Tsai <[email protected]>

2023-03-07 09:53:56

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 10/12] drm/panfrost: Add mediatek,mt8192-mali compatible

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> From: Alyssa Rosenzweig <[email protected]>
>
> Required for Mali-G57 on the Mediatek MT8192 and MT8195, which
> uses even more power domains than the MT8183 before it.
>
> Signed-off-by: Alyssa Rosenzweig <[email protected]>
> [Angelo: Removed unneeded "sram" supply, added mt8195 to commit description]
> Co-developed-by: AngeloGioacchino Del Regno <[email protected]>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Steven Price <[email protected]>

Reviewed-by: Chen-Yu Tsai <[email protected]>
Tested-by: Chen-Yu Tsai <[email protected]>

2023-03-07 09:54:27

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 09/12] drm/panfrost: Add the MT8192 GPU ID

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> From: Alyssa Rosenzweig <[email protected]>
>
> MediaTek MT8192 has a Mali-G57 with a special GPU ID. Add its GPU ID,
> but treat it as otherwise identical to a standard Mali-G57.
>
> We do _not_ fix up the GPU ID here -- userspace needs to be aware of the
> special GPU ID, in case we find functional differences between
> MediaTek's implementation and the standard Mali-G57 down the line.
>
> Signed-off-by: Alyssa Rosenzweig <[email protected]>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Steven Price <[email protected]>

Reviewed-by: Chen-Yu Tsai <[email protected]>
Tested-by: Chen-Yu Tsai <[email protected]>

2023-03-07 09:55:16

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 08/12] drm/panfrost: Increase MAX_PM_DOMAINS to 5

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> From: Alyssa Rosenzweig <[email protected]>
>
> Increase the MAX_PM_DOMAINS constant from 3 to 5, to support the
> extra power domains required by the Mali-G57 on the MT8192.
>
> Signed-off-by: Alyssa Rosenzweig <[email protected]>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Steven Price <[email protected]>

Reviewed-by: Chen-Yu Tsai <[email protected]>
Tested-by: Chen-Yu Tsai <[email protected]>

2023-03-07 09:56:27

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 07/12] dt-bindings: gpu: mali-bifrost: Add compatible for MT8195 SoC

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> The MediaTek MT8195 SoC has a Mali G57 MC5 (Valhall-JM) and has the
> same number of power domains and requirements as MT8192 in terms of
> bindings.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>

Reviewed-by: Chen-Yu Tsai <[email protected]>
Tested-by: Chen-Yu Tsai <[email protected]>
with `make dt_binding_check` and `make dtbs_check`

2023-03-07 10:22:29

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 06/12] dt-bindings: gpu: mali-bifrost: Add support for MediaTek MT8186

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> MT8186 has a Mali-G52 MC2 2EE GPU (two cores): add a binding with
> two power domains (one per core) for it.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Chen-Yu Tsai <[email protected]>

Tested-by: Chen-Yu Tsai <[email protected]>
with `make dt_binding_check` and `make dtbs_check`

2023-03-07 10:27:47

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 05/12] dt-bindings: gpu: mali-bifrost: Add new MT8183 compatible

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> Since new platform data was required in Panfrost for getting GPU DVFS
> finally working on MediaTek SoCs, add a new "mediatek,mt8183b-mali"
> compatible.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>
> Reviewed-by: Chen-Yu Tsai <[email protected]>

Tested-by: Chen-Yu Tsai <[email protected]>
with `make dt_binding_check` and `make dtbs_check`

2023-03-07 10:28:04

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 04/12] dt-bindings: gpu: mali-bifrost: Add sub-schema for MT8192's power domains

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> MediaTek MT8192 (and similar) needs five power domains for the
> Mali GPU and no sram-supply: change the binding to allow so by
> also introducing power-domain-names in the generic binding;
> while at it, also disallow the newly introduced power-domain-names
> for all non-MediaTek bindings.
>
> Fixes: 5d82e74a97c2 ("dt-bindings: Add compatible for Mali Valhall (JM)")
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>
> Reviewed-by: Chen-Yu Tsai <[email protected]>

Tested-by: Chen-Yu Tsai <[email protected]>
with `make dt_binding_check` and `make dtbs_check`

2023-03-07 10:28:43

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 03/12] dt-bindings: gpu: mali-bifrost: Fix power-domain-names validation

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> Commit ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
> incorrectly introduced power domain names for MT8183, causing
> validation issues.
>
> Add power-domain-names to the base schema, allowing a maximum of
> five elements; since platforms having a single power domain don't
> need any actual domain name, disallow that for each sub-schema.
>
> Fixes: a7a596cd3115 ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>

Tested-by: Chen-Yu Tsai <[email protected]>
with `make dt_binding_check` and `make dtbs_check`

2023-03-07 10:29:15

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 02/12] dt-bindings: gpu: mali-bifrost: Set power-domains maxItems to 5

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> In preparation for adding (and fixing) power-domain-names and MediaTek
> MT8192 bindings, allow up to five items for power-domains.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>

Reviewed-by: Chen-Yu Tsai <[email protected]>
Tested-by: Chen-Yu Tsai <[email protected]>
with `make dt_binding_check` and `make dtbs_check`

2023-03-07 10:29:42

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v4 01/12] dt-bindings: gpu: mali-bifrost: Split out MediaTek power-domains variation

On Tue, Feb 28, 2023 at 6:27 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> In preparation for adding new bindings for new MediaTek SoCs, split out
> the power-domains variation from the `else` in the current
> mediatek,mt8183-mali conditional.
>
> The sram-supply part is left in place to be disallowed for anything
> that is not compatible with "mediatek,mt8183-mali" as this regulator
> is MediaTek-specific and it is, and will ever be, used only for this
> specific string due to the addition of the mediatek-regulator-coupler
> driver.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>

Reviewed-by: Chen-Yu Tsai <[email protected]>
Tested-by: Chen-Yu Tsai <[email protected]>
with `make dt_binding_check` and `make dtbs_check`

2023-03-08 19:00:24

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v4 01/12] dt-bindings: gpu: mali-bifrost: Split out MediaTek power-domains variation


On Tue, 28 Feb 2023 11:26:53 +0100, AngeloGioacchino Del Regno wrote:
> In preparation for adding new bindings for new MediaTek SoCs, split out
> the power-domains variation from the `else` in the current
> mediatek,mt8183-mali conditional.
>
> The sram-supply part is left in place to be disallowed for anything
> that is not compatible with "mediatek,mt8183-mali" as this regulator
> is MediaTek-specific and it is, and will ever be, used only for this
> specific string due to the addition of the mediatek-regulator-coupler
> driver.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> ---
> .../devicetree/bindings/gpu/arm,mali-bifrost.yaml | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>

Reviewed-by: Rob Herring <[email protected]>


2023-03-08 19:00:49

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v4 02/12] dt-bindings: gpu: mali-bifrost: Set power-domains maxItems to 5


On Tue, 28 Feb 2023 11:26:54 +0100, AngeloGioacchino Del Regno wrote:
> In preparation for adding (and fixing) power-domain-names and MediaTek
> MT8192 bindings, allow up to five items for power-domains.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> ---
> Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Rob Herring <[email protected]>


2023-03-08 19:03:31

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v4 03/12] dt-bindings: gpu: mali-bifrost: Fix power-domain-names validation

On Tue, Feb 28, 2023 at 11:26:55AM +0100, AngeloGioacchino Del Regno wrote:
> Commit ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
> incorrectly introduced power domain names for MT8183, causing
> validation issues.
>
> Add power-domain-names to the base schema, allowing a maximum of
> five elements; since platforms having a single power domain don't
> need any actual domain name, disallow that for each sub-schema.
>
> Fixes: a7a596cd3115 ("dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183")
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> ---
> .../devicetree/bindings/gpu/arm,mali-bifrost.yaml | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> index 5b7f1c9d2b30..bf0f7f1f71e0 100644
> --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml
> @@ -65,6 +65,10 @@ properties:
> minItems: 1
> maxItems: 5
>
> + power-domain-names:
> + minItems: 1

If you are disallowing for a single domain, then this could be 2...

Reviewed-by: Rob Herring <[email protected]>

> + maxItems: 5
> +
> resets:
> minItems: 1
> maxItems: 3
> @@ -112,6 +116,7 @@ allOf:
> properties:
> power-domains:
> maxItems: 1
> + power-domain-names: false
> required:
> - resets
> - if:
> @@ -136,6 +141,7 @@ allOf:
> - const: bus_ace
> power-domains:
> maxItems: 1
> + power-domain-names: false
> resets:
> minItems: 3
> reset-names:
> @@ -186,6 +192,7 @@ allOf:
> - const: bus
> power-domains:
> maxItems: 1
> + power-domain-names: false
> required:
> - clock-names
>
> --
> 2.39.2
>

2023-03-08 19:04:04

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v4 06/12] dt-bindings: gpu: mali-bifrost: Add support for MediaTek MT8186


On Tue, 28 Feb 2023 11:26:58 +0100, AngeloGioacchino Del Regno wrote:
> MT8186 has a Mali-G52 MC2 2EE GPU (two cores): add a binding with
> two power domains (one per core) for it.
>
> Signed-off-by: AngeloGioacchino Del Regno <[email protected]>
> Reviewed-by: Chen-Yu Tsai <[email protected]>
> ---
> .../bindings/gpu/arm,mali-bifrost.yaml | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>

Reviewed-by: Rob Herring <[email protected]>