Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * linux/include/asm-arm/arch-shark/io.h | |
3 | * | |
4 | * by Alexander Schulz | |
5 | * | |
6 | * derived from: | |
7 | * linux/include/asm-arm/arch-ebsa110/io.h | |
8 | * Copyright (C) 1997,1998 Russell King | |
9 | */ | |
10 | ||
11 | #ifndef __ASM_ARM_ARCH_IO_H | |
12 | #define __ASM_ARM_ARCH_IO_H | |
13 | ||
14 | #define IO_SPACE_LIMIT 0xffffffff | |
15 | ||
16 | /* | |
17 | * We use two different types of addressing - PC style addresses, and ARM | |
18 | * addresses. PC style accesses the PC hardware with the normal PC IO | |
19 | * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+ | |
20 | * and are translated to the start of IO. | |
21 | */ | |
22 | #define __PORT_PCIO(x) (!((x) & 0x80000000)) | |
23 | ||
b7523418 | 24 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) |
1da177e4 | 25 | |
1da177e4 LT |
26 | |
27 | static inline unsigned int __ioaddr (unsigned int port) \ | |
28 | { \ | |
29 | if (__PORT_PCIO(port)) \ | |
30 | return (unsigned int)(PCIO_BASE + (port)); \ | |
31 | else \ | |
32 | return (unsigned int)(IO_BASE + (port)); \ | |
33 | } | |
34 | ||
1da177e4 LT |
35 | #define __mem_pci(addr) (addr) |
36 | ||
1da177e4 LT |
37 | /* |
38 | * Translated address IO functions | |
39 | * | |
40 | * IO address has already been translated to a virtual address | |
41 | */ | |
42 | #define outb_t(v,p) \ | |
43 | (*(volatile unsigned char *)(p) = (v)) | |
44 | ||
45 | #define inb_t(p) \ | |
46 | (*(volatile unsigned char *)(p)) | |
47 | ||
48 | #define outl_t(v,p) \ | |
49 | (*(volatile unsigned long *)(p) = (v)) | |
50 | ||
51 | #define inl_t(p) \ | |
52 | (*(volatile unsigned long *)(p)) | |
53 | ||
54 | #endif |