[PATCH 4/5] usb: ehci-msm: Fix register initialization

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

 



From: Jack Pham <jackp@xxxxxxxxxxxxxx>

The default value for the 'transceiver select' field of
the PORTSC register may not always be correct. Previously
the phy-msm-usb driver would do this for us, but since
ehci-msm can now be instantiated standalone without any PHY
driver, the register needs to be explicitly initialized to
ULPI mode to properly communicate with the PHY.

This is not readily apparent, as firmware or bootloader code
also happen to pre-initialize this for us. However, it can
manifest when performing a driver unbind/rebind as follows:

 cd /sys/bus/platform/drivers/msm_hsusb_host
 echo QCOM8040:00 > unbind
 echo QCOM8040:00 > bind

The EHCI core executes a controller reset as part of this,
and as a result the register in question would revert to
its default state and must be re-initialized properly.
Furthermore this may be useful in the future when adding
PM suspend/resume support.

Also, update to use the correct value of AHBMODE to allow
data transfers to be posted AHB transactions. This aligns
with the value used in the downstream MSM kernel.

Signed-off-by: Jack Pham <jackp@xxxxxxxxxxxxxx>
Signed-off-by: Timur Tabi <timur@xxxxxxxxxxxxxx>
---
 drivers/usb/host/ehci-msm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index fc666ef..b8c0df0 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -56,10 +56,12 @@ static int ehci_msm_reset(struct usb_hcd *hcd)
 	if (retval)
 		return retval;
 
+	/* select ULPI phy and clear other status/control bits in PORTSC */
+	writel(PORTSC_PTS_ULPI, USB_PORTSC);
 	/* bursts of unspecified length. */
 	writel(0, USB_AHBBURST);
 	/* Use the AHB transactor */
-	writel(0, USB_AHBMODE);
+	writel(0x8, USB_AHBMODE);
 	/* Disable streaming mode and select host mode */
 	writel(0x13, USB_USBMODE);
 	/* Disable ULPI_TX_PKT_EN_CLR_FIX which is valid only for HSIC */
-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

--
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