Skip to content

Commit 761bbcb

Browse files
vdsaogregkh
authored andcommitted
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 <[email protected]> Tested-by: Matthias Fuchs <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 820c629 commit 761bbcb

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/usb/host/ehci-fsl.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
316316
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
317317
int retval;
318318
struct fsl_usb2_platform_data *pdata;
319+
struct device *dev;
319320

321+
dev = hcd->self.controller;
320322
pdata = hcd->self.controller->platform_data;
321323
ehci->big_endian_desc = pdata->big_endian_desc;
322324
ehci->big_endian_mmio = pdata->big_endian_mmio;
@@ -346,6 +348,16 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
346348

347349
ehci_reset(ehci);
348350

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+
349361
retval = ehci_fsl_reinit(ehci);
350362
return retval;
351363
}
@@ -469,6 +481,8 @@ static int ehci_fsl_mpc512x_drv_resume(struct device *dev)
469481
ehci_writel(ehci, ISIPHYCTRL_PXE | ISIPHYCTRL_PHYE,
470482
hcd->regs + FSL_SOC_USB_ISIPHYCTRL);
471483

484+
ehci_writel(ehci, SBUSCFG_INCR8, hcd->regs + FSL_SOC_USB_SBUSCFG);
485+
472486
/* restore EHCI registers */
473487
ehci_writel(ehci, pdata->pm_command, &ehci->regs->command);
474488
ehci_writel(ehci, pdata->pm_intr_enable, &ehci->regs->intr_enable);

drivers/usb/host/ehci-fsl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#define _EHCI_FSL_H
2020

2121
/* 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 */
2224
#define FSL_SOC_USB_ULPIVP 0x170
2325
#define FSL_SOC_USB_PORTSC1 0x184
2426
#define PORT_PTS_MSK (3<<30)

0 commit comments

Comments
 (0)