Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40acc095 authored by Li Yang's avatar Li Yang Committed by Linus Torvalds
Browse files

ehci-fsl: fix cache coherency problem on system with large memory

The patch fixes bug http://bugzilla.kernel.org/show_bug.cgi?id=7482

.

It sets USB snooping on 4G space for PowerPC platforms without
CONFIG_NOT_COHERENT_CACHE defined.

Reported-by: default avatarStefan Meyer <reyems@telkomsa.net>
Signed-off-by: default avatarLi Yang <leoli@freescale.com>
Cc: Greg KH <greg@kroah.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3d6ac984
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -193,6 +193,19 @@ static void mpc83xx_usb_setup(struct usb_hcd *hcd)
	out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x00000004);
	out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x00000004);
	out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0000001b);
	out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0000001b);


#if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
	/*
	 * Turn on cache snooping hardware, since some PowerPC platforms
	 * wholly rely on hardware to deal with cache coherent
	 */

	/* Setup Snooping for all the 4GB space */
	/* SNOOP1 starts from 0x0, size 2G */
	out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0 | SNOOP_SIZE_2GB);
	/* SNOOP2 starts from 0x80000000, size 2G */
	out_be32(non_ehci + FSL_SOC_USB_SNOOP2, 0x80000000 | SNOOP_SIZE_2GB);
#endif

	if (pdata->operating_mode == FSL_USB2_DR_HOST)
	if (pdata->operating_mode == FSL_USB2_DR_HOST)
		mpc83xx_setup_phy(ehci, pdata->phy_mode, 0);
		mpc83xx_setup_phy(ehci, pdata->phy_mode, 0);


+1 −0
Original line number Original line Diff line number Diff line
@@ -34,4 +34,5 @@
#define FSL_SOC_USB_PRICTRL	0x40c	/* NOTE: big-endian */
#define FSL_SOC_USB_PRICTRL	0x40c	/* NOTE: big-endian */
#define FSL_SOC_USB_SICTRL	0x410	/* NOTE: big-endian */
#define FSL_SOC_USB_SICTRL	0x410	/* NOTE: big-endian */
#define FSL_SOC_USB_CTRL	0x500	/* NOTE: big-endian */
#define FSL_SOC_USB_CTRL	0x500	/* NOTE: big-endian */
#define SNOOP_SIZE_2GB		0x1e
#endif				/* _EHCI_FSL_H */
#endif				/* _EHCI_FSL_H */