All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Allow getting regulator on MFG for multiple SoCs
@ 2022-06-23 10:09 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

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(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 0/5] Allow getting regulator on MFG for multiple SoCs
@ 2022-06-23 10:09 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

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(-)

-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/5] soc: mediatek: mt8192-pm-domains: Allow probing vreg supply on MFG0/1
  2022-06-23 10:09 ` AngeloGioacchino Del Regno
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

The MT8192 SoC has multiple MFG power-domains, exclusively used for
the GPU which, in turn, requires external power supplies: add the
MTK_SCPD_DOMAIN_SUPPLY cap to MFG0 and MFG1 to allow voting for
regulators on/off upon usage of these power domains.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/soc/mediatek/mt8192-pm-domains.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/mediatek/mt8192-pm-domains.h b/drivers/soc/mediatek/mt8192-pm-domains.h
index 558c4ee4784a..b97b2051920f 100644
--- a/drivers/soc/mediatek/mt8192-pm-domains.h
+++ b/drivers/soc/mediatek/mt8192-pm-domains.h
@@ -58,6 +58,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8192[] = {
 		.pwr_sta2nd_offs = 0x0170,
 		.sram_pdn_bits = GENMASK(8, 8),
 		.sram_pdn_ack_bits = GENMASK(12, 12),
+		.caps = MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8192_POWER_DOMAIN_MFG1] = {
 		.name = "mfg1",
@@ -85,6 +86,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8192[] = {
 				    MT8192_TOP_AXI_PROT_EN_2_CLR,
 				    MT8192_TOP_AXI_PROT_EN_2_STA1),
 		},
+		.caps = MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8192_POWER_DOMAIN_MFG2] = {
 		.name = "mfg2",
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 1/5] soc: mediatek: mt8192-pm-domains: Allow probing vreg supply on MFG0/1
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

The MT8192 SoC has multiple MFG power-domains, exclusively used for
the GPU which, in turn, requires external power supplies: add the
MTK_SCPD_DOMAIN_SUPPLY cap to MFG0 and MFG1 to allow voting for
regulators on/off upon usage of these power domains.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/soc/mediatek/mt8192-pm-domains.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/mediatek/mt8192-pm-domains.h b/drivers/soc/mediatek/mt8192-pm-domains.h
index 558c4ee4784a..b97b2051920f 100644
--- a/drivers/soc/mediatek/mt8192-pm-domains.h
+++ b/drivers/soc/mediatek/mt8192-pm-domains.h
@@ -58,6 +58,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8192[] = {
 		.pwr_sta2nd_offs = 0x0170,
 		.sram_pdn_bits = GENMASK(8, 8),
 		.sram_pdn_ack_bits = GENMASK(12, 12),
+		.caps = MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8192_POWER_DOMAIN_MFG1] = {
 		.name = "mfg1",
@@ -85,6 +86,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8192[] = {
 				    MT8192_TOP_AXI_PROT_EN_2_CLR,
 				    MT8192_TOP_AXI_PROT_EN_2_STA1),
 		},
+		.caps = MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8192_POWER_DOMAIN_MFG2] = {
 		.name = "mfg2",
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/5] soc: mediatek: mt8183-pm-domains: Allow probing vreg supply on MFG_ASYNC
  2022-06-23 10:09 ` AngeloGioacchino Del Regno
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

Add the MTK_SCPD_DOMAIN_SUPPLY cap to the MFG_ASYNC power domain in
order to be able to vote for GPU-related regulators on/off.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/soc/mediatek/mt8183-pm-domains.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/mediatek/mt8183-pm-domains.h b/drivers/soc/mediatek/mt8183-pm-domains.h
index 71b8757e552d..99de67fe5de8 100644
--- a/drivers/soc/mediatek/mt8183-pm-domains.h
+++ b/drivers/soc/mediatek/mt8183-pm-domains.h
@@ -41,6 +41,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8183[] = {
 		.pwr_sta2nd_offs = 0x0184,
 		.sram_pdn_bits = 0,
 		.sram_pdn_ack_bits = 0,
+		.caps = MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8183_POWER_DOMAIN_MFG] = {
 		.name = "mfg",
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/5] soc: mediatek: mt8183-pm-domains: Allow probing vreg supply on MFG_ASYNC
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

Add the MTK_SCPD_DOMAIN_SUPPLY cap to the MFG_ASYNC power domain in
order to be able to vote for GPU-related regulators on/off.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/soc/mediatek/mt8183-pm-domains.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/mediatek/mt8183-pm-domains.h b/drivers/soc/mediatek/mt8183-pm-domains.h
index 71b8757e552d..99de67fe5de8 100644
--- a/drivers/soc/mediatek/mt8183-pm-domains.h
+++ b/drivers/soc/mediatek/mt8183-pm-domains.h
@@ -41,6 +41,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8183[] = {
 		.pwr_sta2nd_offs = 0x0184,
 		.sram_pdn_bits = 0,
 		.sram_pdn_ack_bits = 0,
+		.caps = MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8183_POWER_DOMAIN_MFG] = {
 		.name = "mfg",
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/5] soc: mediatek: mt8195-pm-domains: Allow probing vreg supply on MFG1
  2022-06-23 10:09 ` AngeloGioacchino Del Regno
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

As done in MT8192, also add the MTK_SCPD_DOMAIN_SUPPLY cap to the MFG1
power domain in MT8195 to allow voting for regulators on/off.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/soc/mediatek/mt8195-pm-domains.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/mt8195-pm-domains.h b/drivers/soc/mediatek/mt8195-pm-domains.h
index 0529d130b675..d7387ea1b9c9 100644
--- a/drivers/soc/mediatek/mt8195-pm-domains.h
+++ b/drivers/soc/mediatek/mt8195-pm-domains.h
@@ -162,7 +162,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8195[] = {
 				    MT8195_TOP_AXI_PROT_EN_SUB_INFRA_VDNR_CLR,
 				    MT8195_TOP_AXI_PROT_EN_SUB_INFRA_VDNR_STA1),
 		},
-		.caps = MTK_SCPD_KEEP_DEFAULT_OFF,
+		.caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8195_POWER_DOMAIN_MFG2] = {
 		.name = "mfg2",
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/5] soc: mediatek: mt8195-pm-domains: Allow probing vreg supply on MFG1
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

As done in MT8192, also add the MTK_SCPD_DOMAIN_SUPPLY cap to the MFG1
power domain in MT8195 to allow voting for regulators on/off.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/soc/mediatek/mt8195-pm-domains.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/mt8195-pm-domains.h b/drivers/soc/mediatek/mt8195-pm-domains.h
index 0529d130b675..d7387ea1b9c9 100644
--- a/drivers/soc/mediatek/mt8195-pm-domains.h
+++ b/drivers/soc/mediatek/mt8195-pm-domains.h
@@ -162,7 +162,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8195[] = {
 				    MT8195_TOP_AXI_PROT_EN_SUB_INFRA_VDNR_CLR,
 				    MT8195_TOP_AXI_PROT_EN_SUB_INFRA_VDNR_STA1),
 		},
-		.caps = MTK_SCPD_KEEP_DEFAULT_OFF,
+		.caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8195_POWER_DOMAIN_MFG2] = {
 		.name = "mfg2",
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/5] soc: mediatek: mt8186-pm-domains: Allow probing vreg supply on MFG1
  2022-06-23 10:09 ` AngeloGioacchino Del Regno
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

Add the MTK_SCPD_DOMAIN_SUPPLY cap to the MFG1 power domain in MT8186
to allow voting for sram regulators on/off.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/soc/mediatek/mt8186-pm-domains.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/mt8186-pm-domains.h b/drivers/soc/mediatek/mt8186-pm-domains.h
index bf2dd0cdc3a8..108af61854a3 100644
--- a/drivers/soc/mediatek/mt8186-pm-domains.h
+++ b/drivers/soc/mediatek/mt8186-pm-domains.h
@@ -51,7 +51,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8186[] = {
 				MT8186_TOP_AXI_PROT_EN_1_CLR,
 				MT8186_TOP_AXI_PROT_EN_1_STA),
 		},
-		.caps = MTK_SCPD_KEEP_DEFAULT_OFF,
+		.caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8186_POWER_DOMAIN_MFG2] = {
 		.name = "mfg2",
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/5] soc: mediatek: mt8186-pm-domains: Allow probing vreg supply on MFG1
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

Add the MTK_SCPD_DOMAIN_SUPPLY cap to the MFG1 power domain in MT8186
to allow voting for sram regulators on/off.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 drivers/soc/mediatek/mt8186-pm-domains.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/mt8186-pm-domains.h b/drivers/soc/mediatek/mt8186-pm-domains.h
index bf2dd0cdc3a8..108af61854a3 100644
--- a/drivers/soc/mediatek/mt8186-pm-domains.h
+++ b/drivers/soc/mediatek/mt8186-pm-domains.h
@@ -51,7 +51,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8186[] = {
 				MT8186_TOP_AXI_PROT_EN_1_CLR,
 				MT8186_TOP_AXI_PROT_EN_1_STA),
 		},
-		.caps = MTK_SCPD_KEEP_DEFAULT_OFF,
+		.caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY,
 	},
 	[MT8186_POWER_DOMAIN_MFG2] = {
 		.name = "mfg2",
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/5] arm64: dts: mediatek: mt8183-kukui: Assign sram supply to mfg_async pd
  2022-06-23 10:09 ` AngeloGioacchino Del Regno
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

Add a phandle to the MT8183_POWER_DOMAIN_MFG_ASYNC power domain and
assign the GPU VSRAM supply to this in mt8183-kukui: this allows to
keep the sram powered up while the GPU is used.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++
 arch/arm64/boot/dts/mediatek/mt8183.dtsi       | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index 89e4358f140a..33f3bf277ce9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -821,6 +821,10 @@ cros_ec {
 	};
 };
 
+&mfg_async {
+	domain-supply = <&mt6358_vsram_gpu_reg>;
+};
+
 &mfg {
 	domain-supply = <&mt6358_vgpu_reg>;
 };
diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
index 9485c1efc87c..9d32871973a2 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -788,7 +788,7 @@ power-domain@MT8183_POWER_DOMAIN_CONN {
 					#power-domain-cells = <0>;
 				};
 
-				power-domain@MT8183_POWER_DOMAIN_MFG_ASYNC {
+				mfg_async: power-domain@MT8183_POWER_DOMAIN_MFG_ASYNC {
 					reg = <MT8183_POWER_DOMAIN_MFG_ASYNC>;
 					clocks = <&topckgen CLK_TOP_MUX_MFG>;
 					clock-names = "mfg";
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/5] arm64: dts: mediatek: mt8183-kukui: Assign sram supply to mfg_async pd
@ 2022-06-23 10:09   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 10:09 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, wenst,
	AngeloGioacchino Del Regno

Add a phandle to the MT8183_POWER_DOMAIN_MFG_ASYNC power domain and
assign the GPU VSRAM supply to this in mt8183-kukui: this allows to
keep the sram powered up while the GPU is used.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++
 arch/arm64/boot/dts/mediatek/mt8183.dtsi       | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index 89e4358f140a..33f3bf277ce9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -821,6 +821,10 @@ cros_ec {
 	};
 };
 
+&mfg_async {
+	domain-supply = <&mt6358_vsram_gpu_reg>;
+};
+
 &mfg {
 	domain-supply = <&mt6358_vgpu_reg>;
 };
diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
index 9485c1efc87c..9d32871973a2 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -788,7 +788,7 @@ power-domain@MT8183_POWER_DOMAIN_CONN {
 					#power-domain-cells = <0>;
 				};
 
-				power-domain@MT8183_POWER_DOMAIN_MFG_ASYNC {
+				mfg_async: power-domain@MT8183_POWER_DOMAIN_MFG_ASYNC {
 					reg = <MT8183_POWER_DOMAIN_MFG_ASYNC>;
 					clocks = <&topckgen CLK_TOP_MUX_MFG>;
 					clock-names = "mfg";
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/5] Allow getting regulator on MFG for multiple SoCs
  2022-06-23 10:09 ` AngeloGioacchino Del Regno
@ 2022-06-23 11:40   ` Matthias Brugger
  -1 siblings, 0 replies; 16+ messages in thread
From: Matthias Brugger @ 2022-06-23 11:40 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, robh+dt
  Cc: krzysztof.kozlowski+dt, devicetree, linux-arm-kernel,
	linux-mediatek, linux-kernel, wenst



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(-)
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/5] Allow getting regulator on MFG for multiple SoCs
@ 2022-06-23 11:40   ` Matthias Brugger
  0 siblings, 0 replies; 16+ messages in thread
From: Matthias Brugger @ 2022-06-23 11:40 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, robh+dt
  Cc: krzysztof.kozlowski+dt, devicetree, linux-arm-kernel,
	linux-mediatek, linux-kernel, wenst



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(-)
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/5] Allow getting regulator on MFG for multiple SoCs
  2022-06-23 11:40   ` Matthias Brugger
@ 2022-06-23 12:27     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 12:27 UTC (permalink / raw)
  To: Matthias Brugger, robh+dt
  Cc: krzysztof.kozlowski+dt, devicetree, linux-arm-kernel,
	linux-mediatek, linux-kernel, wenst

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(-)
>>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/5] Allow getting regulator on MFG for multiple SoCs
@ 2022-06-23 12:27     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 16+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23 12:27 UTC (permalink / raw)
  To: Matthias Brugger, robh+dt
  Cc: krzysztof.kozlowski+dt, devicetree, linux-arm-kernel,
	linux-mediatek, linux-kernel, wenst

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(-)
>>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-06-23 12:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 10:09 [PATCH 0/5] Allow getting regulator on MFG for multiple SoCs AngeloGioacchino Del Regno
2022-06-23 10:09 ` AngeloGioacchino Del Regno
2022-06-23 10:09 ` [PATCH 1/5] soc: mediatek: mt8192-pm-domains: Allow probing vreg supply on MFG0/1 AngeloGioacchino Del Regno
2022-06-23 10:09   ` AngeloGioacchino Del Regno
2022-06-23 10:09 ` [PATCH 2/5] soc: mediatek: mt8183-pm-domains: Allow probing vreg supply on MFG_ASYNC AngeloGioacchino Del Regno
2022-06-23 10:09   ` AngeloGioacchino Del Regno
2022-06-23 10:09 ` [PATCH 3/5] soc: mediatek: mt8195-pm-domains: Allow probing vreg supply on MFG1 AngeloGioacchino Del Regno
2022-06-23 10:09   ` AngeloGioacchino Del Regno
2022-06-23 10:09 ` [PATCH 4/5] soc: mediatek: mt8186-pm-domains: " AngeloGioacchino Del Regno
2022-06-23 10:09   ` AngeloGioacchino Del Regno
2022-06-23 10:09 ` [PATCH 5/5] arm64: dts: mediatek: mt8183-kukui: Assign sram supply to mfg_async pd AngeloGioacchino Del Regno
2022-06-23 10:09   ` AngeloGioacchino Del Regno
2022-06-23 11:40 ` [PATCH 0/5] Allow getting regulator on MFG for multiple SoCs Matthias Brugger
2022-06-23 11:40   ` Matthias Brugger
2022-06-23 12:27   ` AngeloGioacchino Del Regno
2022-06-23 12:27     ` AngeloGioacchino Del Regno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.