Commit 9f27984b authored by Tim Bird's avatar Tim Bird Committed by Felipe Balbi

usb: phy: msm: Fix PTS definitions for MSM USB controller

Fix the value used for Parallel Transceiver Select (PTS) for the MSM USB
controller.  This is a standard chipidea PORTSC definition, where
a PHY_TYPE of 10b (<<30) is ULPI and 11b (<<30) is SERIAL.
Fix the definitions and use them correctly in the driver code.
Signed-off-by: default avatarTim Bird <tim.bird@sonymobile.com>
Signed-off-by: default avatarIvan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d69c6f5d
...@@ -287,8 +287,9 @@ static int msm_link_reset(struct msm_otg *motg) ...@@ -287,8 +287,9 @@ static int msm_link_reset(struct msm_otg *motg)
if (motg->phy_number) if (motg->phy_number)
writel(readl(USB_PHY_CTRL2) | BIT(16), USB_PHY_CTRL2); writel(readl(USB_PHY_CTRL2) | BIT(16), USB_PHY_CTRL2);
/* put transceiver in serial mode as part of reset */
val = readl(USB_PORTSC) & ~PORTSC_PTS_MASK; val = readl(USB_PORTSC) & ~PORTSC_PTS_MASK;
writel(val | PORTSC_PTS_ULPI, USB_PORTSC); writel(val | PORTSC_PTS_SERIAL, USB_PORTSC);
return 0; return 0;
} }
...@@ -308,8 +309,9 @@ static int msm_otg_reset(struct usb_phy *phy) ...@@ -308,8 +309,9 @@ static int msm_otg_reset(struct usb_phy *phy)
if (cnt >= LINK_RESET_TIMEOUT_USEC) if (cnt >= LINK_RESET_TIMEOUT_USEC)
return -ETIMEDOUT; return -ETIMEDOUT;
/* select ULPI phy */ /* select ULPI phy and clear other status/control bits in PORTSC */
writel(0x80000000, USB_PORTSC); writel(PORTSC_PTS_ULPI, USB_PORTSC);
writel(0x0, USB_AHBBURST); writel(0x0, USB_AHBBURST);
writel(0x08, USB_AHBMODE); writel(0x08, USB_AHBMODE);
......
...@@ -31,8 +31,9 @@ ...@@ -31,8 +31,9 @@
#define USB_USBINTR (MSM_USB_BASE + 0x0148) #define USB_USBINTR (MSM_USB_BASE + 0x0148)
#define PORTSC_PHCD (1 << 23) /* phy suspend mode */ #define PORTSC_PHCD (1 << 23) /* phy suspend mode */
#define PORTSC_PTS_MASK (3 << 30) #define PORTSC_PTS_MASK (3 << 30)
#define PORTSC_PTS_ULPI (3 << 30) #define PORTSC_PTS_ULPI (2 << 30)
#define PORTSC_PTS_SERIAL (3 << 30)
#define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170) #define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170)
#define ULPI_RUN (1 << 30) #define ULPI_RUN (1 << 30)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment