[PATCH] ehci-omap: Fix resume failures after bus suspend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



An undocumented "feature" in the OMAP3 EHCI controller causes
suspended ports to be taken out of suspend when the USBCMD.Run/Stop
bit is cleared (this bit is normally cleared when ehci_bus_suspend
is called).

This "feature" breaks suspend-resume if the root-hub is allowed
to suspend. (The controller thinks it is in resume, and the PHY
thinks it is still in suspend).

There is an undocumented register bit that can be used to disable
this feature and restore normal behavior. Set this bit so
suspend-resume can work normally.

Tested on OMAP3 SDPs with the NXP ISP1504 and NXP ISP1703 PHYs.

Signed-off-by: Anand Gadiyar <gadiyar@xxxxxx>
---
Other boards typically use the SMSC332x PHYs on which
suspend-resume fails for other reasons. So this will not
fix the suspend-resume issues that beagleboard users
are facing.

I couldn't think of a better name for this register bit.
The TRM marks it as reserved.

 drivers/usb/host/ehci-omap.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

Index: linux-omap-2.6/drivers/usb/host/ehci-omap.c
===================================================================
--- linux-omap-2.6.orig/drivers/usb/host/ehci-omap.c
+++ linux-omap-2.6/drivers/usb/host/ehci-omap.c
@@ -116,6 +116,8 @@
 #define	OMAP_UHH_DEBUG_CSR				(0x44)
 
 /* EHCI Register Set */
+#define EHCI_INSNREG04					(0xA0)
+#define EHCI_INSNREG04_DISABLE_UNSUSPEND		(1 << 5)
 #define	EHCI_INSNREG05_ULPI				(0xA4)
 #define	EHCI_INSNREG05_ULPI_CONTROL_SHIFT		31
 #define	EHCI_INSNREG05_ULPI_PORTSEL_SHIFT		24
@@ -382,6 +384,18 @@ static int omap_start_ehc(struct ehci_hc
 	dev_dbg(omap->dev, "UHH setup done, uhh_hostconfig=%x\n", reg);
 
 
+	/*
+	 * An undocumented "feature" in the OMAP3 EHCI controller,
+	 * causes suspended ports to be taken out of suspend when
+	 * the USBCMD.Run/Stop bit is cleared (for example when
+	 * we do ehci_bus_suspend).
+	 * This breaks suspend-resume if the root-hub is allowed
+	 * to suspend. Writing 1 to this undocumented register bit
+	 * disables this feature and restores normal behavior.
+	 */
+	ehci_omap_writel(omap->ehci_base, EHCI_INSNREG04,
+				EHCI_INSNREG04_DISABLE_UNSUSPEND);
+
 	if ((omap->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL) ||
 		(omap->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL) ||
 			(omap->port_mode[2] == EHCI_HCD_OMAP_MODE_TLL)) {
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux