[PATCH]PCI9 errata workaround broken

Rune Torgersen runet at innovsys.com
Thu Jan 27 11:03:59 EST 2005


Changeset 1.1938.196.11 broke MPC8260 PCI9 Errata workaround.
This pach makes it work again.

Signed-off-by: Rune Torgersen <runet at innovsys.com>

===== include/asm-ppc/io.h 1.29 vs edited =====
--- 1.29/include/asm-ppc/io.h   2005-01-26 17:15:02 -06:00
+++ edited/include/asm-ppc/io.h 2005-01-26 17:54:11 -06:00
@@ -133,7 +133,10 @@
 {
        __asm__ __volatile__("stw%U0%X0 %1,%0; eieio" : "=m" (*addr) :
"r" (val));
 }
-
+#if defined (CONFIG_8260_PCI9)
+#define readb(addr) in_8((volatile u8 *)(addr))
+#define writeb(b,addr) out_8((volatile u8 *)(addr), (b))
+#else
 static inline __u8 readb(volatile void __iomem *addr)
 {
        return in_8(addr);
@@ -142,6 +145,8 @@
 {
        out_8(addr, b);
 }
+#endif
+
 #if defined(CONFIG_APUS)
 static inline __u16 readw(volatile void __iomem *addr)
 {
@@ -159,6 +164,12 @@
 {
        *(__force volatile __u32 *)(addr) = b;
 }
+#elif defined (CONFIG_8260_PCI9)
+/* Use macros if PCI9 workaround enabled */
+#define readw(addr) in_le16((volatile u16 *)(addr))
+#define readl(addr) in_le32((volatile u32 *)(addr))
+#define writew(b,addr) out_le16((volatile u16 *)(addr),(b))
+#define writel(b,addr) out_le32((volatile u32 *)(addr),(b))
 #else
 static inline __u16 readw(volatile void __iomem *addr)
 {
@@ -332,6 +343,11 @@

 #define IO_SPACE_LIMIT ~0

+#if defined (CONFIG_8260_PCI9)
+#define memset_io(a,b,c)       memset((void *)(a),(b),(c))
+#define memcpy_fromio(a,b,c)   memcpy((a),(void *)(b),(c))
+#define memcpy_toio(a,b,c)     memcpy((void *)(a),(b),(c))
+#else
 static inline void memset_io(volatile void __iomem *addr, unsigned char
val, int count)
 {
        memset((void __force *)addr, val, count);
@@ -344,7 +360,7 @@
 {
        memcpy((void __force *) dst, src, count);
 }
-
+#endif
 /*
  * Map in an area of physical address space, for accessing
  * I/O devices etc.

Rune Torgersen
System Developer
Innovative Systems LLC
1000 Innovative Drive
Mitchell, SD 57301
Ph: 605-995-6120
www.innovsys.com



More information about the Linuxppc-embedded mailing list