From b6214e2843b10140cebfcd1887d746dbf4c616e2 Mon Sep 17 00:00:00 2001 From: Nikhil Badola Date: Wed, 26 Mar 2014 08:47:42 +0530 Subject: fsl/usb : Workaround for USB Erratum A007792 USB controller version-2.5 requires to enable internal UTMI phy and program PTS field in PORTSC register before asserting controller reset. This is must for successful resetting of the controller and subsequent enumeration of usb devices Signed-off-by: Suresh Gupta Signed-off-by: Nikhil Badola Change-Id: Ibebdc44bf75f5da69f2e9b6346bfecb442a784b0 Reviewed-on: http://git.am.freescale.net:8181/10301 Reviewed-by: Ramneek Mehresh Tested-by: Review Code-CDREVIEW Reviewed-by: Jose Rivera diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 4affcd0..e3a386a 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -193,6 +193,15 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, if (pdata->have_sysif_regs && pdata->controller_ver < FSL_USB_VER_1_6) setbits32(hcd->regs + FSL_SOC_USB_CTRL, 0x4); + /* + * Enable UTMI phy and program PTS field in UTMI mode before asserting + * controller reset for USB Controller version 2.5 + */ + if (pdata->has_fsl_erratum_a007792) { + writel_be(CTRL_UTMI_PHY_EN, hcd->regs + FSL_SOC_USB_CTRL); + writel(PORT_PTS_UTMI, hcd->regs + FSL_SOC_USB_PORTSC1); + } + /* Don't need to set host mode here. It will be done by tdi_reset() */ retval = usb_add_hcd(hcd, irq, IRQF_SHARED | IRQF_NO_SUSPEND); diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 67fe2b6..c2c58cf 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -190,6 +190,14 @@ static bool has_erratum_a005697(void) return flag; } +static bool has_erratum_a007792(int controller_ver) +{ + if (controller_ver == FSL_USB_VER_2_5) + return true; + else + return false; +} + static int usb_get_ver_info(struct device_node *np) { int ver = -1; @@ -298,6 +306,11 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev) else pdata->has_fsl_erratum_a005697 = 0; + if (has_erratum_a007792(pdata->controller_ver)) + pdata->has_fsl_erratum_a007792 = 1; + else + pdata->has_fsl_erratum_a007792 = 0; + if (of_get_property(np, "fsl,erratum_a006918", NULL)) pdata->has_fsl_erratum_a006918 = 1; else diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 20a53e1..2c4b7d3 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h @@ -96,6 +96,7 @@ struct fsl_usb2_platform_data { unsigned has_fsl_erratum_a005275:1; unsigned has_fsl_erratum_a006918:1; unsigned has_fsl_erratum_a005697:1; + unsigned has_fsl_erratum_a007792:1; /* register save area for suspend/resume */ u32 pm_command; -- cgit v0.10.2