diff options
Diffstat (limited to 'include/asm-m68k/io.h')
-rw-r--r-- | include/asm-m68k/io.h | 66 |
1 files changed, 7 insertions, 59 deletions
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h index 657187f0c7c2..9e673e3bd434 100644 --- a/include/asm-m68k/io.h +++ b/include/asm-m68k/io.h | |||
@@ -7,15 +7,12 @@ | |||
7 | * - added skeleton for GG-II and Amiga PCMCIA | 7 | * - added skeleton for GG-II and Amiga PCMCIA |
8 | * 2/3/01 RZ: - moved a few more defs into raw_io.h | 8 | * 2/3/01 RZ: - moved a few more defs into raw_io.h |
9 | * | 9 | * |
10 | * inX/outX/readX/writeX should not be used by any driver unless it does | 10 | * inX/outX should not be used by any driver unless it does |
11 | * ISA or PCI access. Other drivers should use function defined in raw_io.h | 11 | * ISA access. Other drivers should use function defined in raw_io.h |
12 | * or define its own macros on top of these. | 12 | * or define its own macros on top of these. |
13 | * | 13 | * |
14 | * inX(),outX() are for PCI and ISA I/O | 14 | * inX(),outX() are for ISA I/O |
15 | * readX(),writeX() are for PCI memory | ||
16 | * isa_readX(),isa_writeX() are for ISA memory | 15 | * isa_readX(),isa_writeX() are for ISA memory |
17 | * | ||
18 | * moved mem{cpy,set}_*io inside CONFIG_PCI | ||
19 | */ | 16 | */ |
20 | 17 | ||
21 | #ifndef _IO_H | 18 | #ifndef _IO_H |
@@ -256,10 +253,7 @@ static inline void isa_delay(void) | |||
256 | (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \ | 253 | (ISA_SEX ? raw_outsl(isa_itl(port), (u32 *)(buf), (nr)) : \ |
257 | raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) | 254 | raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) |
258 | 255 | ||
259 | #endif /* CONFIG_ISA */ | ||
260 | |||
261 | 256 | ||
262 | #if defined(CONFIG_ISA) && !defined(CONFIG_PCI) | ||
263 | #define inb isa_inb | 257 | #define inb isa_inb |
264 | #define inb_p isa_inb_p | 258 | #define inb_p isa_inb_p |
265 | #define outb isa_outb | 259 | #define outb isa_outb |
@@ -282,55 +276,9 @@ static inline void isa_delay(void) | |||
282 | #define readw isa_readw | 276 | #define readw isa_readw |
283 | #define writeb isa_writeb | 277 | #define writeb isa_writeb |
284 | #define writew isa_writew | 278 | #define writew isa_writew |
285 | #endif /* CONFIG_ISA */ | ||
286 | |||
287 | #if defined(CONFIG_PCI) | ||
288 | |||
289 | #define readl(addr) in_le32(addr) | ||
290 | #define writel(val,addr) out_le32((addr),(val)) | ||
291 | |||
292 | /* those can be defined for both ISA and PCI - it won't work though */ | ||
293 | #define readb(addr) in_8(addr) | ||
294 | #define readw(addr) in_le16(addr) | ||
295 | #define writeb(val,addr) out_8((addr),(val)) | ||
296 | #define writew(val,addr) out_le16((addr),(val)) | ||
297 | 279 | ||
298 | #define readb_relaxed(addr) readb(addr) | 280 | #else /* CONFIG_ISA */ |
299 | #define readw_relaxed(addr) readw(addr) | ||
300 | #define readl_relaxed(addr) readl(addr) | ||
301 | 281 | ||
302 | #ifndef CONFIG_ISA | ||
303 | #define inb(port) in_8(port) | ||
304 | #define outb(val,port) out_8((port),(val)) | ||
305 | #define inw(port) in_le16(port) | ||
306 | #define outw(val,port) out_le16((port),(val)) | ||
307 | #define inl(port) in_le32(port) | ||
308 | #define outl(val,port) out_le32((port),(val)) | ||
309 | |||
310 | #else | ||
311 | /* | ||
312 | * kernel with both ISA and PCI compiled in, those have | ||
313 | * conflicting defs for in/out. Simply consider port < 1024 | ||
314 | * ISA and everything else PCI. read,write not defined | ||
315 | * in this case | ||
316 | */ | ||
317 | #define inb(port) ((port)<1024 ? isa_inb(port) : in_8(port)) | ||
318 | #define inb_p(port) ((port)<1024 ? isa_inb_p(port) : in_8(port)) | ||
319 | #define inw(port) ((port)<1024 ? isa_inw(port) : in_le16(port)) | ||
320 | #define inw_p(port) ((port)<1024 ? isa_inw_p(port) : in_le16(port)) | ||
321 | #define inl(port) ((port)<1024 ? isa_inl(port) : in_le32(port)) | ||
322 | #define inl_p(port) ((port)<1024 ? isa_inl_p(port) : in_le32(port)) | ||
323 | |||
324 | #define outb(val,port) ((port)<1024 ? isa_outb((val),(port)) : out_8((port),(val))) | ||
325 | #define outb_p(val,port) ((port)<1024 ? isa_outb_p((val),(port)) : out_8((port),(val))) | ||
326 | #define outw(val,port) ((port)<1024 ? isa_outw((val),(port)) : out_le16((port),(val))) | ||
327 | #define outw_p(val,port) ((port)<1024 ? isa_outw_p((val),(port)) : out_le16((port),(val))) | ||
328 | #define outl(val,port) ((port)<1024 ? isa_outl((val),(port)) : out_le32((port),(val))) | ||
329 | #define outl_p(val,port) ((port)<1024 ? isa_outl_p((val),(port)) : out_le32((port),(val))) | ||
330 | #endif | ||
331 | #endif /* CONFIG_PCI */ | ||
332 | |||
333 | #if !defined(CONFIG_ISA) && !defined(CONFIG_PCI) | ||
334 | /* | 282 | /* |
335 | * We need to define dummy functions for GENERIC_IOMAP support. | 283 | * We need to define dummy functions for GENERIC_IOMAP support. |
336 | */ | 284 | */ |
@@ -357,11 +305,11 @@ static inline void isa_delay(void) | |||
357 | #define writeb(val,addr) out_8((addr),(val)) | 305 | #define writeb(val,addr) out_8((addr),(val)) |
358 | #define readw(addr) in_le16(addr) | 306 | #define readw(addr) in_le16(addr) |
359 | #define writew(val,addr) out_le16((addr),(val)) | 307 | #define writew(val,addr) out_le16((addr),(val)) |
360 | #endif | 308 | |
361 | #if !defined(CONFIG_PCI) | 309 | #endif /* CONFIG_ISA */ |
310 | |||
362 | #define readl(addr) in_le32(addr) | 311 | #define readl(addr) in_le32(addr) |
363 | #define writel(val,addr) out_le32((addr),(val)) | 312 | #define writel(val,addr) out_le32((addr),(val)) |
364 | #endif | ||
365 | 313 | ||
366 | #define mmiowb() | 314 | #define mmiowb() |
367 | 315 | ||