aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2012-01-24 16:17:38 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-24 18:04:01 -0500
commit761bbcb74e4611414937ea480ba60bb970648755 (patch)
tree36d2c1ef203e68ef6b9b344cabca6b0595388286
parent820c629a595ad8d8f2694641e494738b18d29e7b (diff)
usb: ehci-fsl: set INCR8 mode for system bus interface on MPC512x
Use INCR8 mode for system bus interface of the USB controller on MPC512x. This is a work-around for the AHB bus lock up problem observed on MPC512x when there is heavy simultaneous PATA write or network (FEC) activity. See also "12.4 The USB controller can issue transactions that lock up the AHB bus under certain conditions" in MPC5121e (M36P) Errata. Signed-off-by: Anatolij Gustschin <agust@denx.de> Tested-by: Matthias Fuchs <matthias.fuchs@esd.ue> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/host/ehci-fsl.c14
-rw-r--r--drivers/usb/host/ehci-fsl.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index e90344a17631..42414cd73571 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -316,7 +316,9 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
316 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 316 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
317 int retval; 317 int retval;
318 struct fsl_usb2_platform_data *pdata; 318 struct fsl_usb2_platform_data *pdata;
319 struct device *dev;
319 320
321 dev = hcd->self.controller;
320 pdata = hcd->self.controller->platform_data; 322 pdata = hcd->self.controller->platform_data;
321 ehci->big_endian_desc = pdata->big_endian_desc; 323 ehci->big_endian_desc = pdata->big_endian_desc;
322 ehci->big_endian_mmio = pdata->big_endian_mmio; 324 ehci->big_endian_mmio = pdata->big_endian_mmio;
@@ -346,6 +348,16 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
346 348
347 ehci_reset(ehci); 349 ehci_reset(ehci);
348 350
351 if (of_device_is_compatible(dev->parent->of_node,
352 "fsl,mpc5121-usb2-dr")) {
353 /*
354 * set SBUSCFG:AHBBRST so that control msgs don't
355 * fail when doing heavy PATA writes.
356 */
357 ehci_writel(ehci, SBUSCFG_INCR8,
358 hcd->regs + FSL_SOC_USB_SBUSCFG);
359 }
360
349 retval = ehci_fsl_reinit(ehci); 361 retval = ehci_fsl_reinit(ehci);
350 return retval; 362 return retval;
351} 363}
@@ -469,6 +481,8 @@ static int ehci_fsl_mpc512x_drv_resume(struct device *dev)
469 ehci_writel(ehci, ISIPHYCTRL_PXE | ISIPHYCTRL_PHYE, 481 ehci_writel(ehci, ISIPHYCTRL_PXE | ISIPHYCTRL_PHYE,
470 hcd->regs + FSL_SOC_USB_ISIPHYCTRL); 482 hcd->regs + FSL_SOC_USB_ISIPHYCTRL);
471 483
484 ehci_writel(ehci, SBUSCFG_INCR8, hcd->regs + FSL_SOC_USB_SBUSCFG);
485
472 /* restore EHCI registers */ 486 /* restore EHCI registers */
473 ehci_writel(ehci, pdata->pm_command, &ehci->regs->command); 487 ehci_writel(ehci, pdata->pm_command, &ehci->regs->command);
474 ehci_writel(ehci, pdata->pm_intr_enable, &ehci->regs->intr_enable); 488 ehci_writel(ehci, pdata->pm_intr_enable, &ehci->regs->intr_enable);
diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h
index 491806221165..0855be8b5b47 100644
--- a/drivers/usb/host/ehci-fsl.h
+++ b/drivers/usb/host/ehci-fsl.h
@@ -19,6 +19,8 @@
19#define _EHCI_FSL_H 19#define _EHCI_FSL_H
20 20
21/* offsets for the non-ehci registers in the FSL SOC USB controller */ 21/* offsets for the non-ehci registers in the FSL SOC USB controller */
22#define FSL_SOC_USB_SBUSCFG 0x90
23#define SBUSCFG_INCR8 0x02 /* INCR8, specified */
22#define FSL_SOC_USB_ULPIVP 0x170 24#define FSL_SOC_USB_ULPIVP 0x170
23#define FSL_SOC_USB_PORTSC1 0x184 25#define FSL_SOC_USB_PORTSC1 0x184
24#define PORT_PTS_MSK (3<<30) 26#define PORT_PTS_MSK (3<<30)