summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/gpc.c
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2015-09-03 01:05:48 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:24:12 +0800
commit090f8764b22f4fbff927e78f31ac2fc61563d591 (patch)
treebe7d97b3f064b9ee360a3b8fb5ab9360a5b11667 /arch/arm/mach-imx/gpc.c
parent000a14ae362e785d2f45015613eb62082f9c9891 (diff)
MLK-11492 ARM: imx: keep weak 2p5 on for USB vbus wakeup
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>
Diffstat (limited to 'arch/arm/mach-imx/gpc.c')
-rw-r--r--arch/arm/mach-imx/gpc.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index e75b691b4866..ba7063862bc1 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -1,5 +1,5 @@
/*
- * 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
@@ -43,6 +43,9 @@
#define IMR_NUM 4
#define GPC_MAX_IRQS (IMR_NUM * 32)
+/* for irq #74 and #75 */
+#define GPC_USB_VBUS_WAKEUP_IRQ_MASK 0xc00
+
static void __iomem *gpc_base;
static u32 gpc_wake_irqs[IMR_NUM];
static u32 gpc_saved_imrs[IMR_NUM];
@@ -114,6 +117,24 @@ unsigned int imx_gpc_is_m4_sleeping(void)
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);