Add support for USB ULPI (external) PHY for P101x platforms for both USB Host and Peripheral modes Signed-off-by: Ramneek Mehresh <ramneek.mehresh@xxxxxxxxxxxxx> --- Changes for v2: - corrected bit mask settings for ULPI phy in host driver, removed FSL_SOC_USB_CTRL from bit settings field drivers/usb/gadget/fsl_udc_core.c | 4 ++++ drivers/usb/gadget/fsl_usb2_udc.h | 1 + drivers/usb/host/ehci-fsl.c | 4 ++++ drivers/usb/host/ehci-fsl.h | 1 + 4 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 8038d88..a552ab4 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -244,6 +244,10 @@ static int dr_controller_setup(struct fsl_udc *udc) portctrl &= ~(PORTSCX_PHY_TYPE_SEL | PORTSCX_PORT_WIDTH); switch (udc->phy_mode) { case FSL_USB2_PHY_ULPI: +#if defined(CONFIG_FSL_SOC_BOOKE) + clrsetbits_be32(&usb_sys_regs->control, USB_CTRL_UTMI_PHY_EN, + USB_CTRL_ULPI_PHY_CLK_SEL); +#endif portctrl |= PORTSCX_PTS_ULPI; break; case FSL_USB2_PHY_UTMI_WIDE: diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h index b955eec..b52b6af 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.h +++ b/drivers/usb/gadget/fsl_usb2_udc.h @@ -352,6 +352,7 @@ struct usb_sys_interface { #define USB_CTRL_UTMI_PHY_EN 0x00000200 #define USB_CTRL_USB_EN 0x00000004 #define USB_CTRL_PHY_CLK_VLD 0x00020000 +#define USB_CTRL_ULPI_PHY_CLK_SEL 0x00000400 /* Endpoint Queue Head data struct * Rem: all the variables of qh are LittleEndian Mode diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 649c023..3ce8587 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -226,6 +226,10 @@ static void ehci_fsl_setup_phy(struct ehci_hcd *ehci, switch (phy_mode) { case FSL_USB2_PHY_ULPI: +#if defined(CONFIG_FSL_SOC_BOOKE) + setbits32(non_ehci + FSL_SOC_USB_CTRL, USB_CTRL_USB_EN | + ULPI_PHY_CLK_SEL); +#endif portsc |= PORT_PTS_ULPI; break; case FSL_USB2_PHY_SERIAL: diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h index cdf1b47..d8db143 100644 --- a/drivers/usb/host/ehci-fsl.h +++ b/drivers/usb/host/ehci-fsl.h @@ -56,5 +56,6 @@ #define OTG_PORT (1<<5) #define PLL_RESET (1<<8) #define UTMI_PHY_EN (1<<9) +#define ULPI_PHY_CLK_SEL (1<<10) #define PHY_CLK_VLD (1<<17) #endif /* _EHCI_FSL_H */ -- 1.6.1 -- 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