Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Anatolij Gustschin and committed by
Greg Kroah-Hartman
761bbcb7 820c629a

+16
+14
drivers/usb/host/ehci-fsl.c
··· 316 316 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 317 317 int retval; 318 318 struct fsl_usb2_platform_data *pdata; 319 + struct device *dev; 319 320 321 + dev = hcd->self.controller; 320 322 pdata = hcd->self.controller->platform_data; 321 323 ehci->big_endian_desc = pdata->big_endian_desc; 322 324 ehci->big_endian_mmio = pdata->big_endian_mmio; ··· 347 345 ehci->sbrn = 0x20; 348 346 349 347 ehci_reset(ehci); 348 + 349 + if (of_device_is_compatible(dev->parent->of_node, 350 + "fsl,mpc5121-usb2-dr")) { 351 + /* 352 + * set SBUSCFG:AHBBRST so that control msgs don't 353 + * fail when doing heavy PATA writes. 354 + */ 355 + ehci_writel(ehci, SBUSCFG_INCR8, 356 + hcd->regs + FSL_SOC_USB_SBUSCFG); 357 + } 350 358 351 359 retval = ehci_fsl_reinit(ehci); 352 360 return retval; ··· 480 468 hcd->regs + FSL_SOC_USB_USBGENCTRL); 481 469 ehci_writel(ehci, ISIPHYCTRL_PXE | ISIPHYCTRL_PHYE, 482 470 hcd->regs + FSL_SOC_USB_ISIPHYCTRL); 471 + 472 + ehci_writel(ehci, SBUSCFG_INCR8, hcd->regs + FSL_SOC_USB_SBUSCFG); 483 473 484 474 /* restore EHCI registers */ 485 475 ehci_writel(ehci, pdata->pm_command, &ehci->regs->command);
+2
drivers/usb/host/ehci-fsl.h
··· 19 19 #define _EHCI_FSL_H 20 20 21 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 24 #define FSL_SOC_USB_ULPIVP 0x170 23 25 #define FSL_SOC_USB_PORTSC1 0x184 24 26 #define PORT_PTS_MSK (3<<30)