Since i.MX6SX, if USB vbus wake up is enabled, weak 2P5
needs to be on even if the DRAM is LPDDR2, previously, we need
to set stop_mode_config to keep 2P5 on, so enter DSM,
if USB vbus wakeup is enabled, we need to keep weak 2P5 on.
Signed-off-by: Anson Huang <b20788@freescale.com>
(cherry picked from commit
1ca4dffee79055ea95c59e27bab50bc5080310f5)
Signed-off-by: Peter Chen <peter.chen@freescale.com>
/*
- * Copyright (C) 2013-2015 Freescale Semiconductor, Inc.
+ * Copyright (C) 2013-2016 Freescale Semiconductor, Inc.
*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
return;
}
- if (imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2)
+ if ((imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2) &&
+ !imx_gpc_usb_wakeup_enabled())
imx_anatop_enable_2p5_pulldown(true);
else
imx_anatop_enable_weak2p5(true);
return;
}
- if (imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2)
+ if ((imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2) &&
+ !imx_gpc_usb_wakeup_enabled())
imx_anatop_enable_2p5_pulldown(false);
else
imx_anatop_enable_weak2p5(false);
/*
- * Copyright 2004-2015 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2016 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
void imx6sx_low_power_idle(void);
void imx6ul_low_power_idle(void);
void imx6sl_low_power_idle(void);
+bool imx_gpc_usb_wakeup_enabled(void);
#ifdef CONFIG_SUSPEND
void v7_cpu_resume(void);
/*
- * Copyright 2011-2015 Freescale Semiconductor, Inc.
+ * Copyright 2011-2016 Freescale Semiconductor, Inc.
* Copyright 2011 Linaro Ltd.
*
* The code contained herein is licensed under the GNU General Public
#define DEFAULT_IPG_RATE 66000000
#define GPC_PU_UP_DELAY_MARGIN 2
+/* for irq #74 and #75 */
+#define GPC_USB_VBUS_WAKEUP_IRQ_MASK 0xc00
+
struct pu_domain {
struct generic_pm_domain base;
struct regulator *reg;
return 0;
}
+bool imx_gpc_usb_wakeup_enabled(void)
+{
+ if (!(cpu_is_imx6sx() || cpu_is_imx6ul()))
+ return false;
+
+ /*
+ * for SoC later than i.MX6SX, USB vbus wakeup
+ * only needs weak 2P5 on, stop_mode_config is
+ * NOT needed, so we check if is USB vbus wakeup
+ * is enabled(assume irq #74 and #75) to decide
+ * if to keep weak 2P5 on.
+ */
+ if (gpc_wake_irqs[1] & GPC_USB_VBUS_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);