diff options
Diffstat (limited to 'include/asm-arm/arch-l7200/io.h')
-rw-r--r-- | include/asm-arm/arch-l7200/io.h | 56 |
1 files changed, 4 insertions, 52 deletions
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h index d744d97c18a5..645dbdfb3908 100644 --- a/include/asm-arm/arch-l7200/io.h +++ b/include/asm-arm/arch-l7200/io.h | |||
@@ -17,59 +17,11 @@ | |||
17 | /* | 17 | /* |
18 | * There are not real ISA nor PCI buses, so we fake it. | 18 | * There are not real ISA nor PCI buses, so we fake it. |
19 | */ | 19 | */ |
20 | #define __io_pci(a) ((void __iomem *)(PCIO_BASE + (a))) | 20 | static inline void __iomem *__io(unsigned long addr) |
21 | #define __mem_pci(a) (a) | ||
22 | |||
23 | #define __ioaddr(p) __io_pci(p) | ||
24 | |||
25 | /* | ||
26 | * Generic virtual read/write | ||
27 | */ | ||
28 | #define __arch_getb(a) (*(volatile unsigned char *)(a)) | ||
29 | #define __arch_getl(a) (*(volatile unsigned int *)(a)) | ||
30 | |||
31 | static inline unsigned int __arch_getw(unsigned long a) | ||
32 | { | ||
33 | unsigned int value; | ||
34 | __asm__ __volatile__("ldrh %0, [%1, #0] @ getw" | ||
35 | : "=&r" (value) | ||
36 | : "r" (a) : "cc"); | ||
37 | return value; | ||
38 | } | ||
39 | |||
40 | #define __arch_putb(v,a) (*(volatile unsigned char *)(a) = (v)) | ||
41 | #define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v)) | ||
42 | |||
43 | static inline void __arch_putw(unsigned int value, unsigned long a) | ||
44 | { | 21 | { |
45 | __asm__ __volatile__("strh %0, [%1, #0] @ putw" | 22 | return (void __iomem *)addr; |
46 | : : "r" (value), "r" (a) : "cc"); | ||
47 | } | 23 | } |
48 | 24 | #define __io(a) __io(a) | |
49 | /* | 25 | #define __mem_pci(a) (a) |
50 | * Translated address IO functions | ||
51 | * | ||
52 | * IO address has already been translated to a virtual address | ||
53 | */ | ||
54 | #define outb_t(v,p) (*(volatile unsigned char *)(p) = (v)) | ||
55 | #define inb_t(p) (*(volatile unsigned char *)(p)) | ||
56 | #define outw_t(v,p) (*(volatile unsigned int *)(p) = (v)) | ||
57 | #define inw_t(p) (*(volatile unsigned int *)(p)) | ||
58 | #define outl_t(v,p) (*(volatile unsigned long *)(p) = (v)) | ||
59 | #define inl_t(p) (*(volatile unsigned long *)(p)) | ||
60 | |||
61 | /* | ||
62 | * FIXME - These are to allow for linking. On all the other | ||
63 | * ARM platforms, the entire IO space is contiguous. | ||
64 | * The 7200 has three separate IO spaces. The below | ||
65 | * macros will eventually become more involved. Use | ||
66 | * with caution and don't be surprised by kernel oopses!!! | ||
67 | */ | ||
68 | #define inb(p) inb_t(p) | ||
69 | #define inw(p) inw_t(p) | ||
70 | #define inl(p) inl_t(p) | ||
71 | #define outb(v,p) outb_t(v,p) | ||
72 | #define outw(v,p) outw_t(v,p) | ||
73 | #define outl(v,p) outl_t(v,p) | ||
74 | 26 | ||
75 | #endif | 27 | #endif |