2021-07-01 09:41:25

by Enric Balletbo i Serra

[permalink] [raw]
Subject: [RESEND PATCH 0/3] Misc bug fixes in mtk power domain driver


This series, originally sent by Bilal Wasim [1], initially broke my
display in mainline (no gpu driver). The problem was not in the series
itself, and, after [2], this series works as expected. I was able to go
to the UI with and without the imgtec gpu driver on my Acer Chromebook
R13 (elm). Hence I rebased on top of mainline and resend it to take into
account for next merge window.

Best regards,
Enric

[1] https://yhbt.net/lore/all/20210216165926.46bbafc7@a-VirtualBox/T/
[2] https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/


Bilal Wasim (3):
soc: mediatek: pm-domains: Use correct mask for bus_prot_clr
soc: mediatek: pm-domains: Add domain_supply cap for mfg_async PD
arm64: dts: mediatek: mt8173: Add domain supply for mfg_async

arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 4 ++++
arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 4 ++++
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 2 +-
drivers/soc/mediatek/mt8173-pm-domains.h | 1 +
drivers/soc/mediatek/mtk-pm-domains.h | 2 +-
5 files changed, 11 insertions(+), 2 deletions(-)

--
2.30.2


2021-07-01 09:41:36

by Enric Balletbo i Serra

[permalink] [raw]
Subject: [RESEND PATCH 1/3] soc: mediatek: pm-domains: Use correct mask for bus_prot_clr

From: Bilal Wasim <[email protected]>

When "bus_prot_reg_update" is true, the driver should use
INFRA_TOPAXI_PROTECTEN for both setting and clearing the bus
protection. However, the driver does not use this mask for
clearing bus protection which causes failure when booting
the imgtec gpu.

Corrected and tested with mt8173 chromebook.

Signed-off-by: Bilal Wasim <[email protected]>
Reviewed-by: Hsin-Yi Wang <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
---

drivers/soc/mediatek/mtk-pm-domains.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/mtk-pm-domains.h b/drivers/soc/mediatek/mtk-pm-domains.h
index 21a4e113bbec..c5ac649ae51b 100644
--- a/drivers/soc/mediatek/mtk-pm-domains.h
+++ b/drivers/soc/mediatek/mtk-pm-domains.h
@@ -60,7 +60,7 @@
#define BUS_PROT_UPDATE_TOPAXI(_mask) \
BUS_PROT_UPDATE(_mask, \
INFRA_TOPAXI_PROTECTEN, \
- INFRA_TOPAXI_PROTECTEN_CLR, \
+ INFRA_TOPAXI_PROTECTEN, \
INFRA_TOPAXI_PROTECTSTA1)

struct scpsys_bus_prot_data {
--
2.30.2

2021-07-01 09:42:43

by Enric Balletbo i Serra

[permalink] [raw]
Subject: [RESEND PATCH 3/3] arm64: dts: mediatek: mt8173: Add domain supply for mfg_async

From: Bilal Wasim <[email protected]>

da9211 regulator needs to be enabled before enabling the mfg_async power
domain. Otherwise the subdomain is not enabled and causes failure in
imgtec gpu driver boot.

Add the "domain-supply" property to the "mfg_async" node in DT.

Signed-off-by: Bilal Wasim <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
---

arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 4 ++++
arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 4 ++++
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 2 +-
3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
index 21452c51a20a..a8efff2071bf 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
@@ -157,6 +157,10 @@ hdmi_connector_in: endpoint {
};
};

+&mfg_async {
+ domain-supply = <&da9211_vgpu_reg>;
+};
+
&cec {
status = "okay";
};
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
index f6a1738dfbaa..4fa1e93302c7 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts
@@ -62,6 +62,10 @@ usb_p0_vbus: regulator@1 {
};
};

+&mfg_async {
+ domain-supply = <&da9211_vgpu_reg>;
+};
+
&cec {
status = "okay";
};
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 003a5653c505..dbda5d656b29 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -504,7 +504,7 @@ power-domain@MT8173_POWER_DOMAIN_USB {
reg = <MT8173_POWER_DOMAIN_USB>;
#power-domain-cells = <0>;
};
- power-domain@MT8173_POWER_DOMAIN_MFG_ASYNC {
+ mfg_async: power-domain@MT8173_POWER_DOMAIN_MFG_ASYNC {
reg = <MT8173_POWER_DOMAIN_MFG_ASYNC>;
clocks = <&clk26m>;
clock-names = "mfg";
--
2.30.2

2021-07-01 09:43:00

by Enric Balletbo i Serra

[permalink] [raw]
Subject: [RESEND PATCH 2/3] soc: mediatek: pm-domains: Add domain_supply cap for mfg_async PD

From: Bilal Wasim <[email protected]>

The mfg_async power domain in mt8173 is used to power up imgtec
gpu. This domain requires the da9211 regulator to be enabled before
the power domain can be enabled successfully.

Signed-off-by: Bilal Wasim <[email protected]>
Reviewed-by: Hsin-Yi Wang <[email protected]>
Signed-off-by: Enric Balletbo i Serra <[email protected]>
---

drivers/soc/mediatek/mt8173-pm-domains.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/soc/mediatek/mt8173-pm-domains.h b/drivers/soc/mediatek/mt8173-pm-domains.h
index 654c717e5467..714fa92575df 100644
--- a/drivers/soc/mediatek/mt8173-pm-domains.h
+++ b/drivers/soc/mediatek/mt8173-pm-domains.h
@@ -71,6 +71,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8173[] = {
.ctl_offs = SPM_MFG_ASYNC_PWR_CON,
.sram_pdn_bits = GENMASK(11, 8),
.sram_pdn_ack_bits = 0,
+ .caps = MTK_SCPD_DOMAIN_SUPPLY,
},
[MT8173_POWER_DOMAIN_MFG_2D] = {
.name = "mfg_2d",
--
2.30.2

2021-07-01 17:28:55

by Matthias Brugger

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/3] Misc bug fixes in mtk power domain driver



On 01/07/2021 11:40, Enric Balletbo i Serra wrote:
>
> This series, originally sent by Bilal Wasim [1], initially broke my
> display in mainline (no gpu driver). The problem was not in the series
> itself, and, after [2], this series works as expected. I was able to go
> to the UI with and without the imgtec gpu driver on my Acer Chromebook
> R13 (elm). Hence I rebased on top of mainline and resend it to take into
> account for next merge window.
>

Whole series pushed to v5.14-tmp/soc

Thanks!

> Best regards,
> Enric
>
> [1] https://yhbt.net/lore/all/20210216165926.46bbafc7@a-VirtualBox/T/
> [2] https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
>
>
> Bilal Wasim (3):
> soc: mediatek: pm-domains: Use correct mask for bus_prot_clr
> soc: mediatek: pm-domains: Add domain_supply cap for mfg_async PD
> arm64: dts: mediatek: mt8173: Add domain supply for mfg_async
>
> arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 4 ++++
> arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 4 ++++
> arch/arm64/boot/dts/mediatek/mt8173.dtsi | 2 +-
> drivers/soc/mediatek/mt8173-pm-domains.h | 1 +
> drivers/soc/mediatek/mtk-pm-domains.h | 2 +-
> 5 files changed, 11 insertions(+), 2 deletions(-)
>