diff options
author | Juan Gutierrez <juan.gutierrez@nxp.com> | 2016-11-03 18:06:21 -0500 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 9a51aa6d331f6ee7d25f1028f136187a1e0f7582 (patch) | |
tree | d80749e28a1a0308002c50a3de5a065bef18dfeb | |
parent | 3ed013ce8a43e530ebeb54741b5799603bc6f9a7 (diff) |
MXSCM-217 imx: keep weak 2p5 power up when ENET WOL wakeup is enabled
When ENET wake up is enabled by wake-on-lan (WOL), the weak 2P5
ldo needs to keep power up even for LPDDR2 due to the ENET_PLL is
feed by the weak 2p5 ldo during DSM. If the weak 2P5 ldo is power
down the ENET module is power off hence it is not able to sense the
WOL interrupt and trigger the system resume.
Signed-off-by: Juan Gutierrez <juan.gutierrez@nxp.com>
-rw-r--r-- | arch/arm/mach-imx/anatop.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/gpc.c | 14 |
3 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c index fe4fda991045..e6e55723d9cf 100644 --- a/arch/arm/mach-imx/anatop.c +++ b/arch/arm/mach-imx/anatop.c @@ -150,7 +150,7 @@ void imx_anatop_pre_suspend(void) if ((imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2 || imx_mmdc_get_ddr_type() == IMX_MMDC_DDR_TYPE_LPDDR3) && - !imx_gpc_usb_wakeup_enabled()) + !imx_gpc_usb_wakeup_enabled() && !imx_gpc_enet_wakeup_enabled()) imx_anatop_enable_2p5_pulldown(true); else imx_anatop_enable_weak2p5(true); @@ -180,7 +180,7 @@ void imx_anatop_post_resume(void) if ((imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2 || imx_mmdc_get_ddr_type() == IMX_MMDC_DDR_TYPE_LPDDR3) && - !imx_gpc_usb_wakeup_enabled()) + !imx_gpc_usb_wakeup_enabled() && !imx_gpc_enet_wakeup_enabled()) imx_anatop_enable_2p5_pulldown(false); else imx_anatop_enable_weak2p5(false); diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 2f392df07d1f..e1881bf19996 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -189,6 +189,7 @@ void imx6ull_low_power_idle(void); void imx6sl_low_power_idle(void); void imx6sll_low_power_idle(void); bool imx_gpc_usb_wakeup_enabled(void); +bool imx_gpc_enet_wakeup_enabled(void); #ifdef CONFIG_SUSPEND void v7_cpu_resume(void); diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c index d9c2aec8fcee..ee3b1bfd77f7 100644 --- a/arch/arm/mach-imx/gpc.c +++ b/arch/arm/mach-imx/gpc.c @@ -71,6 +71,9 @@ /* for irq #74 and #75 */ #define GPC_USB_VBUS_WAKEUP_IRQ_MASK 0xc00 +/* for irq #150 and #151 */ +#define GPC_ENET_WAKEUP_IRQ_MASK 0xC00000 + struct pu_domain { struct generic_pm_domain base; struct regulator *reg; @@ -176,6 +179,17 @@ bool imx_gpc_usb_wakeup_enabled(void) return false; } +bool imx_gpc_enet_wakeup_enabled(void) +{ + if (!cpu_is_imx6q()) + return false; + + if (gpc_wake_irqs[3] & GPC_ENET_WAKEUP_IRQ_MASK) + return true; + + return false; +} + unsigned int imx_gpc_is_mf_mix_off(void) { return readl_relaxed(gpc_base + GPC_PGC_MF_PDN); |