Commit 523f1dec authored by Nikhil Badola's avatar Nikhil Badola Committed by Greg Kroah-Hartman

drivers: usb :fsl: Implement 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: default avatarNikhil Badola <nikhil.badola@freescale.com>
Signed-off-by: default avatarSuresh Gupta <suresh.gupta@freescale.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 38aa4200
...@@ -129,6 +129,15 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev) ...@@ -129,6 +129,15 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
if (pdata->have_sysif_regs && pdata->controller_ver < FSL_USB_VER_1_6) if (pdata->have_sysif_regs && pdata->controller_ver < FSL_USB_VER_1_6)
setbits32(hcd->regs + FSL_SOC_USB_CTRL, 0x4); 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() */ /* Don't need to set host mode here. It will be done by tdi_reset() */
retval = usb_add_hcd(hcd, irq, IRQF_SHARED); retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
......
...@@ -214,6 +214,12 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev) ...@@ -214,6 +214,12 @@ static int fsl_usb2_mph_dr_of_probe(struct platform_device *ofdev)
pdata->phy_mode = determine_usb_phy(prop); pdata->phy_mode = determine_usb_phy(prop);
pdata->controller_ver = usb_get_ver_info(np); pdata->controller_ver = usb_get_ver_info(np);
/* Activate Erratum by reading property in device tree */
if (of_get_property(np, "fsl,usb-erratum-a007792", NULL))
pdata->has_fsl_erratum_a007792 = 1;
else
pdata->has_fsl_erratum_a007792 = 0;
if (pdata->have_sysif_regs) { if (pdata->have_sysif_regs) {
if (pdata->controller_ver == FSL_USB_VER_NONE) { if (pdata->controller_ver == FSL_USB_VER_NONE) {
dev_warn(&ofdev->dev, "Could not get controller version\n"); dev_warn(&ofdev->dev, "Could not get controller version\n");
......
...@@ -97,6 +97,7 @@ struct fsl_usb2_platform_data { ...@@ -97,6 +97,7 @@ struct fsl_usb2_platform_data {
unsigned suspended:1; unsigned suspended:1;
unsigned already_suspended:1; unsigned already_suspended:1;
unsigned has_fsl_erratum_a007792:1;
/* register save area for suspend/resume */ /* register save area for suspend/resume */
u32 pm_command; u32 pm_command;
......
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