From: "Mark A. Greer" <mgreer@mvista.com>

824x and 107 bridges from Freescale/Tundra have an erratum where
speculative PCI reads may return stale data.  One of the two documented
workarounds is to turn of speculative PCI reads.  This patch does that.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/ppc/syslib/mpc10x_common.c |   17 +++++++++++++++++
 25-akpm/include/asm-ppc/mpc10x.h        |    1 +
 2 files changed, 18 insertions(+)

diff -puN arch/ppc/syslib/mpc10x_common.c~ppc32-workaround-for-mpc10x-speculative-pci-read-erratum arch/ppc/syslib/mpc10x_common.c
--- 25/arch/ppc/syslib/mpc10x_common.c~ppc32-workaround-for-mpc10x-speculative-pci-read-erratum	2005-01-27 17:43:55.082204440 -0800
+++ 25-akpm/arch/ppc/syslib/mpc10x_common.c	2005-01-27 17:43:55.088203528 -0800
@@ -306,6 +306,23 @@ mpc10x_bridge_init(struct pci_controller
 	mpc10x_disable_store_gathering(hose);
 #endif
 
+	/*
+	 * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative
+	 * PCI reads may return stale data so turn off.
+	 */
+	if ((host_bridge == MPC10X_BRIDGE_8240)
+		|| (host_bridge == MPC10X_BRIDGE_8245)
+		|| (host_bridge == MPC10X_BRIDGE_107)) {
+
+		early_read_config_dword(hose, 0, PCI_DEVFN(0,0),
+			MPC10X_CFG_PICR1_REG, &picr1);
+
+		picr1 &= ~MPC10X_CFG_PICR1_SPEC_PCI_RD;
+
+		early_write_config_dword(hose, 0, PCI_DEVFN(0,0),
+			MPC10X_CFG_PICR1_REG, picr1);
+	}
+
 	if (ppc_md.progress) ppc_md.progress("mpc10x:exit", 0x100);
 	return 0;
 }
diff -puN include/asm-ppc/mpc10x.h~ppc32-workaround-for-mpc10x-speculative-pci-read-erratum include/asm-ppc/mpc10x.h
--- 25/include/asm-ppc/mpc10x.h~ppc32-workaround-for-mpc10x-speculative-pci-read-erratum	2005-01-27 17:43:55.084204136 -0800
+++ 25-akpm/include/asm-ppc/mpc10x.h	2005-01-27 17:43:55.089203376 -0800
@@ -105,6 +105,7 @@
 #define	MPC10X_CFG_PICR1_ADDR_MAP_MASK	0x00010000
 #define	MPC10X_CFG_PICR1_ADDR_MAP_A	0x00010000
 #define	MPC10X_CFG_PICR1_ADDR_MAP_B	0x00000000
+#define	MPC10X_CFG_PICR1_SPEC_PCI_RD	0x00000004
 #define	MPC10X_CFG_PICR1_ST_GATH_EN	0x00000040
 
 #define	MPC10X_CFG_MAPB_OPTIONS_REG	0xe0
_