aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/gpc.c
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2015-06-30 08:48:24 -0400
committerShawn Guo <shawn.guo@linaro.org>2015-07-08 10:52:08 -0400
commitd438462c20a300139c2e5e65b96cadaa21b58d9a (patch)
tree5303243fdbffa1c22f703dc1cf4a572d7b8564fc /arch/arm/mach-imx/gpc.c
parentde24264026463dd3f32f2c2e01c390f9d0651e37 (diff)
ARM: imx6: gpc: always enable PU domain if CONFIG_PM is not set
If CONFIG_PM is not set the PU power domain needs to be enabled always, otherwise there are two failure scenarios which will hang the system if one of the devices in the PU domain is accessed. 1. New DTs (4.1+) drop the "always-on" property from the PU regulator, so if it isn't properly enabled by the GPC code it will be disabled at the end of boot. 2. If the bootloader already disabled the PU domain the GPC explicitly needs to enable it again, even if the kernel doesn't do any power management. This is a bit hypothetical, as it requires to boot a mainline kernel on a downstream bootloader, as no mainline bootloader disables the PM domains. Cc: <stable@vger.kernel.org> # 4.1 Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/gpc.c')
-rw-r--r--arch/arm/mach-imx/gpc.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index 80bad29d609a..8c4467fad837 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -291,8 +291,6 @@ void __init imx_gpc_check_dt(void)
291 } 291 }
292} 292}
293 293
294#ifdef CONFIG_PM_GENERIC_DOMAINS
295
296static void _imx6q_pm_pu_power_off(struct generic_pm_domain *genpd) 294static void _imx6q_pm_pu_power_off(struct generic_pm_domain *genpd)
297{ 295{
298 int iso, iso2sw; 296 int iso, iso2sw;
@@ -399,7 +397,6 @@ static struct genpd_onecell_data imx_gpc_onecell_data = {
399static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg) 397static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg)
400{ 398{
401 struct clk *clk; 399 struct clk *clk;
402 bool is_off;
403 int i; 400 int i;
404 401
405 imx6q_pu_domain.reg = pu_reg; 402 imx6q_pu_domain.reg = pu_reg;
@@ -416,18 +413,13 @@ static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg)
416 } 413 }
417 imx6q_pu_domain.num_clks = i; 414 imx6q_pu_domain.num_clks = i;
418 415
419 is_off = IS_ENABLED(CONFIG_PM); 416 /* Enable power always in case bootloader disabled it. */
420 if (is_off) { 417 imx6q_pm_pu_power_on(&imx6q_pu_domain.base);
421 _imx6q_pm_pu_power_off(&imx6q_pu_domain.base); 418
422 } else { 419 if (!IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS))
423 /* 420 return 0;
424 * Enable power if compiled without CONFIG_PM in case the
425 * bootloader disabled it.
426 */
427 imx6q_pm_pu_power_on(&imx6q_pu_domain.base);
428 }
429 421
430 pm_genpd_init(&imx6q_pu_domain.base, NULL, is_off); 422 pm_genpd_init(&imx6q_pu_domain.base, NULL, false);
431 return of_genpd_add_provider_onecell(dev->of_node, 423 return of_genpd_add_provider_onecell(dev->of_node,
432 &imx_gpc_onecell_data); 424 &imx_gpc_onecell_data);
433 425
@@ -437,13 +429,6 @@ clk_err:
437 return -EINVAL; 429 return -EINVAL;
438} 430}
439 431
440#else
441static inline int imx_gpc_genpd_init(struct device *dev, struct regulator *reg)
442{
443 return 0;
444}
445#endif /* CONFIG_PM_GENERIC_DOMAINS */
446
447static int imx_gpc_probe(struct platform_device *pdev) 432static int imx_gpc_probe(struct platform_device *pdev)
448{ 433{
449 struct regulator *pu_reg; 434 struct regulator *pu_reg;