Skip to contentSkip to conversation

Fix power domains handling on exynos542x

PATCH RESEND Applied Andrzej Hajda 2 participants 6 messages Mar 12, 2015 – Mar 17, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Fix power domains handling on exynos542x

Hi Kukjin,

This is resend of my patchset with added (Reviewed|Tested)-by tags and removed RFC prefix.

Exynos chipsets since 542x have asynchronous bridges connecting different IPs. These bridges should be operational during power domain switching, ie associated clocks cannot be gated.
This patchset adds binding to provide such clocks per power domain and adds code which enables them during domain on/off operation.

This patchset fixes power domain issues with disp1 domain and HDMI (some of them) on Odroid XU3:
- disp1 power domain can be turned off,
- no more "imprecise external abort" faults.

The patchset is based on samsung-fixes-dt tag from kgene/linux-samsung.

It was successfully tested on OdroidXU3.

Regards
Andrzej

Andrzej Hajda (4):
arm/exynos: add asynchronous bridge clock bindings arm/exynos/pm_domains: add support for async-bridge clocks
ARM: dts: exynos5420: add async-bridge clocks to disp1 power domain
ARM: dts: exynos5420: add async-bridge clocks to gsc power domain

 .../bindings/arm/exynos/power_domain.txt           |  3 +++
 arch/arm/boot/dts/exynos5420.dtsi                  |  8 +++++--
 arch/arm/mach-exynos/pm_domains.c                  | 27 ++++++++++++++++++----
 3 files changed, 32 insertions(+), 6 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH RESEND v2 1/4 arm/exynos: add asynchronous bridge clock bindings

The patch adds bindings for clocks required by async-bridges present in the particular power domain.

---
 Documentation/devicetree/bindings/arm/exynos/power_domain.txt | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/arm/exynos/power_domain.txt +3 -0
index 1e09703..5da38c5 100644
@@ -22,6 +22,9 @@ Optional Properties:
 	- pclkN, clkN: Pairs of parent of input clock and input clock to the
 		devices in this power domain. Maximum of 4 pairs (N = 0 to 3)
 		are supported currently.
+	- asbN: Clocks required by asynchronous bridges (ASB) present in
+		the power domain. These clock should be enabled during power
+		domain on/off operations.
 - power-domains: phandle pointing to the parent power domain, for more details
 		 see Documentation/devicetree/bindings/power/power_domain.txt
 
Signature · 1 line
1.9.1
#2 lore raw

PATCH RESEND v2 2/4 arm/exynos/pm_domains: add support for async-bridge clocks

In reply to Andrzej Hajda

Since Exynos5420 there are async-bridges (ASB) between different IPs. These bridges must be operational during power domain on/off, ie. clocks used by these bridges should be enabled.
This patch enabled these clocks during domain on/off.

---
 arch/arm/mach-exynos/pm_domains.c | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)
arch/arm/mach-exynos/pm_domains.c +23 -4
index 37266a8..507dad0 100644
@@ -37,6 +37,7 @@ struct exynos_pm_domain {
 	struct clk *oscclk;
 	struct clk *clk[MAX_CLK_PER_DOMAIN];
 	struct clk *pclk[MAX_CLK_PER_DOMAIN];
+	struct clk *asb_clk[MAX_CLK_PER_DOMAIN];
 };
 
 static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
@@ -45,14 +46,19 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
 	void __iomem *base;
 	u32 timeout, pwr;
 	char *op;
+	int i;
 
 	pd = container_of(domain, struct exynos_pm_domain, pd);
 	base = pd->base;
 
+	for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
+		if (IS_ERR(pd->asb_clk[i]))
+			break;
+		clk_prepare_enable(pd->asb_clk[i]);
+	}
+
 	/* Set oscclk before powering off a domain*/
 	if (!power_on) {
-		int i;
-
 		for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
 			if (IS_ERR(pd->clk[i]))
 				break;
@@ -81,8 +87,6 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
 
 	/* Restore clocks after powering on a domain*/
 	if (power_on) {
-		int i;
-
 		for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
 			if (IS_ERR(pd->clk[i]))
 				break;
@@ -92,6 +96,12 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
 		}
 	}
 
+	for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
+		if (IS_ERR(pd->asb_clk[i]))
+			break;
+		clk_disable_unprepare(pd->asb_clk[i]);
+	}
+
 	return 0;
 }
 
@@ -131,6 +141,15 @@ static __init int exynos4_pm_init_power_domain(void)
 		pd->pd.power_off = exynos_pd_power_off;
 		pd->pd.power_on = exynos_pd_power_on;
 
+		for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
+			char clk_name[8];
+
+			snprintf(clk_name, sizeof(clk_name), "asb%d", i);
+			pd->asb_clk[i] = clk_get(dev, clk_name);
+			if (IS_ERR(pd->asb_clk[i]))
+				break;
+		}
+
 		pd->oscclk = clk_get(dev, "oscclk");
 		if (IS_ERR(pd->oscclk))
 			goto no_clk;
Signature · 1 line
1.9.1
#3 lore raw

PATCH RESEND v2 3/4 ARM: dts: exynos5420: add async-bridge clocks to disp1 power domain

In reply to Andrzej Hajda

FIMD and MIXER IPs in disp1 power domain have async-bridges (to GSCALER), therefore their clocks should be enabled during power domain switch.

---
 arch/arm/boot/dts/exynos5420.dtsi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/boot/dts/exynos5420.dtsi +4 -2
index c0e98cf..55e3887 100644
@@ -283,9 +283,11 @@
 			 <&clock CLK_MOUT_SW_ACLK300>,
 			 <&clock CLK_MOUT_USER_ACLK300_DISP1>,
 			 <&clock CLK_MOUT_SW_ACLK400>,
-			 <&clock CLK_MOUT_USER_ACLK400_DISP1>;
+			 <&clock CLK_MOUT_USER_ACLK400_DISP1>,
+			 <&clock CLK_FIMD1>, <&clock CLK_MIXER>;
 		clock-names = "oscclk", "pclk0", "clk0",
-			      "pclk1", "clk1", "pclk2", "clk2";
+			      "pclk1", "clk1", "pclk2", "clk2",
+			      "asb0", "asb1";
 	};
 
 	pinctrl_0: pinctrl at 13400000 {
Signature · 1 line
1.9.1
#4 lore raw

PATCH RESEND v2 4/4 ARM: dts: exynos5420: add async-bridge clocks to gsc power domain

In reply to Andrzej Hajda

Both GSCALER IPs in gsc power domain have async-bridges (to FIMD and MIXER), therefore their clocks should be enabled during power domain switch.

---
 arch/arm/boot/dts/exynos5420.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/exynos5420.dtsi +2 -0
index 55e3887..4eaeabe 100644
@@ -251,6 +251,8 @@
 		compatible = "samsung,exynos4210-pd";
 		reg = <0x10044000 0x20>;
 		#power-domain-cells = <0>;
+		clocks = <&clock CLK_GSCL0>, <&clock CLK_GSCL1>;
+		clock-names = "asb0", "asb1";
 	};
 
 	isp_pd: power-domain at 10044020 {
Signature · 1 line
1.9.1
Applied
#5 lore raw
In reply to Andrzej Hajda
Quoted 2 lines · Andrzej Hajda

Hi Kukjin,

Hi,

Quoted 9 lines

This is resend of my patchset with added (Reviewed|Tested)-by tags and removed RFC prefix.

Exynos chipsets since 542x have asynchronous bridges connecting different IPs. These bridges should be operational during power domain switching, ie associated clocks cannot be gated.
This patchset adds binding to provide such clocks per power domain and adds code which enables them during domain on/off operation.

Quoted 9 lines

This patchset fixes power domain issues with disp1 domain and HDMI (some of them) on Odroid XU3:
- disp1 power domain can be turned off,
- no more "imprecise external abort" faults.

The patchset is based on samsung-fixes-dt tag from kgene/linux-samsung.

It was successfully tested on OdroidXU3.

Thanks, applied whole this series.

- Kukjin

Quoted 10 lines

Andrzej Hajda (4):
arm/exynos: add asynchronous bridge clock bindings arm/exynos/pm_domains: add support for async-bridge clocks
ARM: dts: exynos5420: add async-bridge clocks to disp1 power domain
ARM: dts: exynos5420: add async-bridge clocks to gsc power domain

 .../bindings/arm/exynos/power_domain.txt           |  3 +++
 arch/arm/boot/dts/exynos5420.dtsi                  |  8 +++++--
 arch/arm/mach-exynos/pm_domains.c                  | 27 ++++++++++++++++++----
 3 files changed, 32 insertions(+), 6 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html