diff options
Diffstat (limited to 'include/asm-powerpc/io.h')
-rw-r--r-- | include/asm-powerpc/io.h | 221 |
1 files changed, 111 insertions, 110 deletions
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index a9496f34b048..46bae1cf385b 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
@@ -19,20 +19,12 @@ extern int check_legacy_ioport(unsigned long base_port); | |||
19 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
21 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
22 | #ifdef CONFIG_PPC_ISERIES | 22 | #include <asm/paca.h> |
23 | #include <asm/iseries/iseries_io.h> | ||
24 | #endif | ||
25 | #include <asm/synch.h> | 23 | #include <asm/synch.h> |
26 | #include <asm/delay.h> | 24 | #include <asm/delay.h> |
27 | 25 | ||
28 | #include <asm-generic/iomap.h> | 26 | #include <asm-generic/iomap.h> |
29 | 27 | ||
30 | #define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c)) | ||
31 | #define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c)) | ||
32 | #define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c)) | ||
33 | #define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c)) | ||
34 | |||
35 | |||
36 | #define SIO_CONFIG_RA 0x398 | 28 | #define SIO_CONFIG_RA 0x398 |
37 | #define SIO_CONFIG_RD 0x399 | 29 | #define SIO_CONFIG_RD 0x399 |
38 | 30 | ||
@@ -42,39 +34,53 @@ extern unsigned long isa_io_base; | |||
42 | extern unsigned long pci_io_base; | 34 | extern unsigned long pci_io_base; |
43 | 35 | ||
44 | #ifdef CONFIG_PPC_ISERIES | 36 | #ifdef CONFIG_PPC_ISERIES |
45 | /* __raw_* accessors aren't supported on iSeries */ | 37 | |
46 | #define __raw_readb(addr) { BUG(); 0; } | 38 | extern int in_8(const volatile unsigned char __iomem *addr); |
47 | #define __raw_readw(addr) { BUG(); 0; } | 39 | extern void out_8(volatile unsigned char __iomem *addr, int val); |
48 | #define __raw_readl(addr) { BUG(); 0; } | 40 | extern int in_le16(const volatile unsigned short __iomem *addr); |
49 | #define __raw_readq(addr) { BUG(); 0; } | 41 | extern int in_be16(const volatile unsigned short __iomem *addr); |
50 | #define __raw_writeb(v, addr) { BUG(); 0; } | 42 | extern void out_le16(volatile unsigned short __iomem *addr, int val); |
51 | #define __raw_writew(v, addr) { BUG(); 0; } | 43 | extern void out_be16(volatile unsigned short __iomem *addr, int val); |
52 | #define __raw_writel(v, addr) { BUG(); 0; } | 44 | extern unsigned in_le32(const volatile unsigned __iomem *addr); |
53 | #define __raw_writeq(v, addr) { BUG(); 0; } | 45 | extern unsigned in_be32(const volatile unsigned __iomem *addr); |
54 | #define readb(addr) iSeries_Read_Byte(addr) | 46 | extern void out_le32(volatile unsigned __iomem *addr, int val); |
55 | #define readw(addr) iSeries_Read_Word(addr) | 47 | extern void out_be32(volatile unsigned __iomem *addr, int val); |
56 | #define readl(addr) iSeries_Read_Long(addr) | 48 | extern unsigned long in_le64(const volatile unsigned long __iomem *addr); |
57 | #define writeb(data, addr) iSeries_Write_Byte((data),(addr)) | 49 | extern unsigned long in_be64(const volatile unsigned long __iomem *addr); |
58 | #define writew(data, addr) iSeries_Write_Word((data),(addr)) | 50 | extern void out_le64(volatile unsigned long __iomem *addr, unsigned long val); |
59 | #define writel(data, addr) iSeries_Write_Long((data),(addr)) | 51 | extern void out_be64(volatile unsigned long __iomem *addr, unsigned long val); |
60 | #define memset_io(a,b,c) iSeries_memset_io((a),(b),(c)) | 52 | |
61 | #define memcpy_fromio(a,b,c) iSeries_memcpy_fromio((a), (b), (c)) | 53 | extern unsigned char __raw_readb(const volatile void __iomem *addr); |
62 | #define memcpy_toio(a,b,c) iSeries_memcpy_toio((a), (b), (c)) | 54 | extern unsigned short __raw_readw(const volatile void __iomem *addr); |
63 | 55 | extern unsigned int __raw_readl(const volatile void __iomem *addr); | |
64 | #define inb(addr) readb(((void __iomem *)(long)(addr))) | 56 | extern unsigned long __raw_readq(const volatile void __iomem *addr); |
65 | #define inw(addr) readw(((void __iomem *)(long)(addr))) | 57 | extern void __raw_writeb(unsigned char v, volatile void __iomem *addr); |
66 | #define inl(addr) readl(((void __iomem *)(long)(addr))) | 58 | extern void __raw_writew(unsigned short v, volatile void __iomem *addr); |
67 | #define outb(data,addr) writeb(data,((void __iomem *)(long)(addr))) | 59 | extern void __raw_writel(unsigned int v, volatile void __iomem *addr); |
68 | #define outw(data,addr) writew(data,((void __iomem *)(long)(addr))) | 60 | extern void __raw_writeq(unsigned long v, volatile void __iomem *addr); |
69 | #define outl(data,addr) writel(data,((void __iomem *)(long)(addr))) | 61 | |
70 | /* | 62 | extern void memset_io(volatile void __iomem *addr, int c, unsigned long n); |
71 | * The *_ns versions below don't do byte-swapping. | 63 | extern void memcpy_fromio(void *dest, const volatile void __iomem *src, |
72 | * Neither do the standard versions now, these are just here | 64 | unsigned long n); |
73 | * for older code. | 65 | extern void memcpy_toio(volatile void __iomem *dest, const void *src, |
74 | */ | 66 | unsigned long n); |
75 | #define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) | 67 | |
76 | #define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) | 68 | #else /* CONFIG_PPC_ISERIES */ |
77 | #else | 69 | |
70 | #define in_8(addr) __in_8((addr)) | ||
71 | #define out_8(addr, val) __out_8((addr), (val)) | ||
72 | #define in_le16(addr) __in_le16((addr)) | ||
73 | #define in_be16(addr) __in_be16((addr)) | ||
74 | #define out_le16(addr, val) __out_le16((addr), (val)) | ||
75 | #define out_be16(addr, val) __out_be16((addr), (val)) | ||
76 | #define in_le32(addr) __in_le32((addr)) | ||
77 | #define in_be32(addr) __in_be32((addr)) | ||
78 | #define out_le32(addr, val) __out_le32((addr), (val)) | ||
79 | #define out_be32(addr, val) __out_be32((addr), (val)) | ||
80 | #define in_le64(addr) __in_le64((addr)) | ||
81 | #define in_be64(addr) __in_be64((addr)) | ||
82 | #define out_le64(addr, val) __out_le64((addr), (val)) | ||
83 | #define out_be64(addr, val) __out_be64((addr), (val)) | ||
78 | 84 | ||
79 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) | 85 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) |
80 | { | 86 | { |
@@ -108,23 +114,11 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) | |||
108 | { | 114 | { |
109 | *(volatile unsigned long __force *)addr = v; | 115 | *(volatile unsigned long __force *)addr = v; |
110 | } | 116 | } |
111 | #define readb(addr) eeh_readb(addr) | ||
112 | #define readw(addr) eeh_readw(addr) | ||
113 | #define readl(addr) eeh_readl(addr) | ||
114 | #define readq(addr) eeh_readq(addr) | ||
115 | #define writeb(data, addr) eeh_writeb((data), (addr)) | ||
116 | #define writew(data, addr) eeh_writew((data), (addr)) | ||
117 | #define writel(data, addr) eeh_writel((data), (addr)) | ||
118 | #define writeq(data, addr) eeh_writeq((data), (addr)) | ||
119 | #define memset_io(a,b,c) eeh_memset_io((a),(b),(c)) | 117 | #define memset_io(a,b,c) eeh_memset_io((a),(b),(c)) |
120 | #define memcpy_fromio(a,b,c) eeh_memcpy_fromio((a),(b),(c)) | 118 | #define memcpy_fromio(a,b,c) eeh_memcpy_fromio((a),(b),(c)) |
121 | #define memcpy_toio(a,b,c) eeh_memcpy_toio((a),(b),(c)) | 119 | #define memcpy_toio(a,b,c) eeh_memcpy_toio((a),(b),(c)) |
122 | #define inb(port) eeh_inb((unsigned long)port) | 120 | |
123 | #define outb(val, port) eeh_outb(val, (unsigned long)port) | 121 | #endif /* CONFIG_PPC_ISERIES */ |
124 | #define inw(port) eeh_inw((unsigned long)port) | ||
125 | #define outw(val, port) eeh_outw(val, (unsigned long)port) | ||
126 | #define inl(port) eeh_inl((unsigned long)port) | ||
127 | #define outl(val, port) eeh_outl(val, (unsigned long)port) | ||
128 | 122 | ||
129 | /* | 123 | /* |
130 | * The insw/outsw/insl/outsl macros don't do byte-swapping. | 124 | * The insw/outsw/insl/outsl macros don't do byte-swapping. |
@@ -134,32 +128,43 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) | |||
134 | #define insb(port, buf, ns) eeh_insb((port), (buf), (ns)) | 128 | #define insb(port, buf, ns) eeh_insb((port), (buf), (ns)) |
135 | #define insw(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) | 129 | #define insw(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) |
136 | #define insl(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) | 130 | #define insl(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) |
137 | #define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) | ||
138 | #define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) | ||
139 | 131 | ||
140 | #define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) | 132 | #define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) |
141 | #define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) | 133 | #define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) |
142 | #define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) | 134 | #define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) |
143 | 135 | ||
144 | #endif | 136 | #define readb(addr) eeh_readb(addr) |
137 | #define readw(addr) eeh_readw(addr) | ||
138 | #define readl(addr) eeh_readl(addr) | ||
139 | #define readq(addr) eeh_readq(addr) | ||
140 | #define writeb(data, addr) eeh_writeb((data), (addr)) | ||
141 | #define writew(data, addr) eeh_writew((data), (addr)) | ||
142 | #define writel(data, addr) eeh_writel((data), (addr)) | ||
143 | #define writeq(data, addr) eeh_writeq((data), (addr)) | ||
144 | #define inb(port) eeh_inb((unsigned long)port) | ||
145 | #define outb(val, port) eeh_outb(val, (unsigned long)port) | ||
146 | #define inw(port) eeh_inw((unsigned long)port) | ||
147 | #define outw(val, port) eeh_outw(val, (unsigned long)port) | ||
148 | #define inl(port) eeh_inl((unsigned long)port) | ||
149 | #define outl(val, port) eeh_outl(val, (unsigned long)port) | ||
145 | 150 | ||
146 | #define readb_relaxed(addr) readb(addr) | 151 | #define readb_relaxed(addr) readb(addr) |
147 | #define readw_relaxed(addr) readw(addr) | 152 | #define readw_relaxed(addr) readw(addr) |
148 | #define readl_relaxed(addr) readl(addr) | 153 | #define readl_relaxed(addr) readl(addr) |
149 | #define readq_relaxed(addr) readq(addr) | 154 | #define readq_relaxed(addr) readq(addr) |
150 | 155 | ||
151 | extern void _insb(volatile u8 __iomem *port, void *buf, int ns); | 156 | extern void _insb(volatile u8 __iomem *port, void *buf, long count); |
152 | extern void _outsb(volatile u8 __iomem *port, const void *buf, int ns); | 157 | extern void _outsb(volatile u8 __iomem *port, const void *buf, long count); |
153 | extern void _insw(volatile u16 __iomem *port, void *buf, int ns); | 158 | extern void _insw_ns(volatile u16 __iomem *port, void *buf, long count); |
154 | extern void _outsw(volatile u16 __iomem *port, const void *buf, int ns); | 159 | extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, long count); |
155 | extern void _insl(volatile u32 __iomem *port, void *buf, int nl); | 160 | extern void _insl_ns(volatile u32 __iomem *port, void *buf, long count); |
156 | extern void _outsl(volatile u32 __iomem *port, const void *buf, int nl); | 161 | extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count); |
157 | extern void _insw_ns(volatile u16 __iomem *port, void *buf, int ns); | ||
158 | extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns); | ||
159 | extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl); | ||
160 | extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl); | ||
161 | 162 | ||
162 | #define mmiowb() | 163 | static inline void mmiowb(void) |
164 | { | ||
165 | __asm__ __volatile__ ("sync" : : : "memory"); | ||
166 | get_paca()->io_sync = 0; | ||
167 | } | ||
163 | 168 | ||
164 | /* | 169 | /* |
165 | * output pause versions need a delay at least for the | 170 | * output pause versions need a delay at least for the |
@@ -172,14 +177,6 @@ extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl); | |||
172 | #define inl_p(port) inl(port) | 177 | #define inl_p(port) inl(port) |
173 | #define outl_p(val, port) (udelay(1), outl((val), (port))) | 178 | #define outl_p(val, port) (udelay(1), outl((val), (port))) |
174 | 179 | ||
175 | /* | ||
176 | * The *_ns versions below don't do byte-swapping. | ||
177 | * Neither do the standard versions now, these are just here | ||
178 | * for older code. | ||
179 | */ | ||
180 | #define outsw_ns(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) | ||
181 | #define outsl_ns(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) | ||
182 | |||
183 | 180 | ||
184 | #define IO_SPACE_LIMIT ~(0UL) | 181 | #define IO_SPACE_LIMIT ~(0UL) |
185 | 182 | ||
@@ -271,86 +268,92 @@ static inline void iosync(void) | |||
271 | * and should not be used directly by device drivers. Use inb/readb | 268 | * and should not be used directly by device drivers. Use inb/readb |
272 | * instead. | 269 | * instead. |
273 | */ | 270 | */ |
274 | static inline int in_8(const volatile unsigned char __iomem *addr) | 271 | static inline int __in_8(const volatile unsigned char __iomem *addr) |
275 | { | 272 | { |
276 | int ret; | 273 | int ret; |
277 | 274 | ||
278 | __asm__ __volatile__("lbz%U1%X1 %0,%1; twi 0,%0,0; isync" | 275 | __asm__ __volatile__("sync; lbz%U1%X1 %0,%1; twi 0,%0,0; isync" |
279 | : "=r" (ret) : "m" (*addr)); | 276 | : "=r" (ret) : "m" (*addr)); |
280 | return ret; | 277 | return ret; |
281 | } | 278 | } |
282 | 279 | ||
283 | static inline void out_8(volatile unsigned char __iomem *addr, int val) | 280 | static inline void __out_8(volatile unsigned char __iomem *addr, int val) |
284 | { | 281 | { |
285 | __asm__ __volatile__("stb%U0%X0 %1,%0; sync" | 282 | __asm__ __volatile__("sync; stb%U0%X0 %1,%0" |
286 | : "=m" (*addr) : "r" (val)); | 283 | : "=m" (*addr) : "r" (val)); |
284 | get_paca()->io_sync = 1; | ||
287 | } | 285 | } |
288 | 286 | ||
289 | static inline int in_le16(const volatile unsigned short __iomem *addr) | 287 | static inline int __in_le16(const volatile unsigned short __iomem *addr) |
290 | { | 288 | { |
291 | int ret; | 289 | int ret; |
292 | 290 | ||
293 | __asm__ __volatile__("lhbrx %0,0,%1; twi 0,%0,0; isync" | 291 | __asm__ __volatile__("sync; lhbrx %0,0,%1; twi 0,%0,0; isync" |
294 | : "=r" (ret) : "r" (addr), "m" (*addr)); | 292 | : "=r" (ret) : "r" (addr), "m" (*addr)); |
295 | return ret; | 293 | return ret; |
296 | } | 294 | } |
297 | 295 | ||
298 | static inline int in_be16(const volatile unsigned short __iomem *addr) | 296 | static inline int __in_be16(const volatile unsigned short __iomem *addr) |
299 | { | 297 | { |
300 | int ret; | 298 | int ret; |
301 | 299 | ||
302 | __asm__ __volatile__("lhz%U1%X1 %0,%1; twi 0,%0,0; isync" | 300 | __asm__ __volatile__("sync; lhz%U1%X1 %0,%1; twi 0,%0,0; isync" |
303 | : "=r" (ret) : "m" (*addr)); | 301 | : "=r" (ret) : "m" (*addr)); |
304 | return ret; | 302 | return ret; |
305 | } | 303 | } |
306 | 304 | ||
307 | static inline void out_le16(volatile unsigned short __iomem *addr, int val) | 305 | static inline void __out_le16(volatile unsigned short __iomem *addr, int val) |
308 | { | 306 | { |
309 | __asm__ __volatile__("sthbrx %1,0,%2; sync" | 307 | __asm__ __volatile__("sync; sthbrx %1,0,%2" |
310 | : "=m" (*addr) : "r" (val), "r" (addr)); | 308 | : "=m" (*addr) : "r" (val), "r" (addr)); |
309 | get_paca()->io_sync = 1; | ||
311 | } | 310 | } |
312 | 311 | ||
313 | static inline void out_be16(volatile unsigned short __iomem *addr, int val) | 312 | static inline void __out_be16(volatile unsigned short __iomem *addr, int val) |
314 | { | 313 | { |
315 | __asm__ __volatile__("sth%U0%X0 %1,%0; sync" | 314 | __asm__ __volatile__("sync; sth%U0%X0 %1,%0" |
316 | : "=m" (*addr) : "r" (val)); | 315 | : "=m" (*addr) : "r" (val)); |
316 | get_paca()->io_sync = 1; | ||
317 | } | 317 | } |
318 | 318 | ||
319 | static inline unsigned in_le32(const volatile unsigned __iomem *addr) | 319 | static inline unsigned __in_le32(const volatile unsigned __iomem *addr) |
320 | { | 320 | { |
321 | unsigned ret; | 321 | unsigned ret; |
322 | 322 | ||
323 | __asm__ __volatile__("lwbrx %0,0,%1; twi 0,%0,0; isync" | 323 | __asm__ __volatile__("sync; lwbrx %0,0,%1; twi 0,%0,0; isync" |
324 | : "=r" (ret) : "r" (addr), "m" (*addr)); | 324 | : "=r" (ret) : "r" (addr), "m" (*addr)); |
325 | return ret; | 325 | return ret; |
326 | } | 326 | } |
327 | 327 | ||
328 | static inline unsigned in_be32(const volatile unsigned __iomem *addr) | 328 | static inline unsigned __in_be32(const volatile unsigned __iomem *addr) |
329 | { | 329 | { |
330 | unsigned ret; | 330 | unsigned ret; |
331 | 331 | ||
332 | __asm__ __volatile__("lwz%U1%X1 %0,%1; twi 0,%0,0; isync" | 332 | __asm__ __volatile__("sync; lwz%U1%X1 %0,%1; twi 0,%0,0; isync" |
333 | : "=r" (ret) : "m" (*addr)); | 333 | : "=r" (ret) : "m" (*addr)); |
334 | return ret; | 334 | return ret; |
335 | } | 335 | } |
336 | 336 | ||
337 | static inline void out_le32(volatile unsigned __iomem *addr, int val) | 337 | static inline void __out_le32(volatile unsigned __iomem *addr, int val) |
338 | { | 338 | { |
339 | __asm__ __volatile__("stwbrx %1,0,%2; sync" : "=m" (*addr) | 339 | __asm__ __volatile__("sync; stwbrx %1,0,%2" : "=m" (*addr) |
340 | : "r" (val), "r" (addr)); | 340 | : "r" (val), "r" (addr)); |
341 | get_paca()->io_sync = 1; | ||
341 | } | 342 | } |
342 | 343 | ||
343 | static inline void out_be32(volatile unsigned __iomem *addr, int val) | 344 | static inline void __out_be32(volatile unsigned __iomem *addr, int val) |
344 | { | 345 | { |
345 | __asm__ __volatile__("stw%U0%X0 %1,%0; sync" | 346 | __asm__ __volatile__("sync; stw%U0%X0 %1,%0" |
346 | : "=m" (*addr) : "r" (val)); | 347 | : "=m" (*addr) : "r" (val)); |
348 | get_paca()->io_sync = 1; | ||
347 | } | 349 | } |
348 | 350 | ||
349 | static inline unsigned long in_le64(const volatile unsigned long __iomem *addr) | 351 | static inline unsigned long __in_le64(const volatile unsigned long __iomem *addr) |
350 | { | 352 | { |
351 | unsigned long tmp, ret; | 353 | unsigned long tmp, ret; |
352 | 354 | ||
353 | __asm__ __volatile__( | 355 | __asm__ __volatile__( |
356 | "sync\n" | ||
354 | "ld %1,0(%2)\n" | 357 | "ld %1,0(%2)\n" |
355 | "twi 0,%1,0\n" | 358 | "twi 0,%1,0\n" |
356 | "isync\n" | 359 | "isync\n" |
@@ -365,16 +368,16 @@ static inline unsigned long in_le64(const volatile unsigned long __iomem *addr) | |||
365 | return ret; | 368 | return ret; |
366 | } | 369 | } |
367 | 370 | ||
368 | static inline unsigned long in_be64(const volatile unsigned long __iomem *addr) | 371 | static inline unsigned long __in_be64(const volatile unsigned long __iomem *addr) |
369 | { | 372 | { |
370 | unsigned long ret; | 373 | unsigned long ret; |
371 | 374 | ||
372 | __asm__ __volatile__("ld%U1%X1 %0,%1; twi 0,%0,0; isync" | 375 | __asm__ __volatile__("sync; ld%U1%X1 %0,%1; twi 0,%0,0; isync" |
373 | : "=r" (ret) : "m" (*addr)); | 376 | : "=r" (ret) : "m" (*addr)); |
374 | return ret; | 377 | return ret; |
375 | } | 378 | } |
376 | 379 | ||
377 | static inline void out_le64(volatile unsigned long __iomem *addr, unsigned long val) | 380 | static inline void __out_le64(volatile unsigned long __iomem *addr, unsigned long val) |
378 | { | 381 | { |
379 | unsigned long tmp; | 382 | unsigned long tmp; |
380 | 383 | ||
@@ -386,19 +389,19 @@ static inline void out_le64(volatile unsigned long __iomem *addr, unsigned long | |||
386 | "rldicl %1,%1,32,0\n" | 389 | "rldicl %1,%1,32,0\n" |
387 | "rlwimi %0,%1,8,8,31\n" | 390 | "rlwimi %0,%1,8,8,31\n" |
388 | "rlwimi %0,%1,24,16,23\n" | 391 | "rlwimi %0,%1,24,16,23\n" |
389 | "std %0,0(%3)\n" | 392 | "sync\n" |
390 | "sync" | 393 | "std %0,0(%3)" |
391 | : "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr)); | 394 | : "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr)); |
395 | get_paca()->io_sync = 1; | ||
392 | } | 396 | } |
393 | 397 | ||
394 | static inline void out_be64(volatile unsigned long __iomem *addr, unsigned long val) | 398 | static inline void __out_be64(volatile unsigned long __iomem *addr, unsigned long val) |
395 | { | 399 | { |
396 | __asm__ __volatile__("std%U0%X0 %1,%0; sync" : "=m" (*addr) : "r" (val)); | 400 | __asm__ __volatile__("sync; std%U0%X0 %1,%0" : "=m" (*addr) : "r" (val)); |
401 | get_paca()->io_sync = 1; | ||
397 | } | 402 | } |
398 | 403 | ||
399 | #ifndef CONFIG_PPC_ISERIES | ||
400 | #include <asm/eeh.h> | 404 | #include <asm/eeh.h> |
401 | #endif | ||
402 | 405 | ||
403 | /** | 406 | /** |
404 | * check_signature - find BIOS signatures | 407 | * check_signature - find BIOS signatures |
@@ -414,7 +417,6 @@ static inline int check_signature(const volatile void __iomem * io_addr, | |||
414 | const unsigned char *signature, int length) | 417 | const unsigned char *signature, int length) |
415 | { | 418 | { |
416 | int retval = 0; | 419 | int retval = 0; |
417 | #ifndef CONFIG_PPC_ISERIES | ||
418 | do { | 420 | do { |
419 | if (readb(io_addr) != *signature) | 421 | if (readb(io_addr) != *signature) |
420 | goto out; | 422 | goto out; |
@@ -424,7 +426,6 @@ static inline int check_signature(const volatile void __iomem * io_addr, | |||
424 | } while (length); | 426 | } while (length); |
425 | retval = 1; | 427 | retval = 1; |
426 | out: | 428 | out: |
427 | #endif | ||
428 | return retval; | 429 | return retval; |
429 | } | 430 | } |
430 | 431 | ||