diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-arm/arch-l7200/io.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-arm/arch-l7200/io.h')
-rw-r--r-- | include/asm-arm/arch-l7200/io.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h new file mode 100644 index 000000000000..fc012a39e2cb --- /dev/null +++ b/include/asm-arm/arch-l7200/io.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-l7200/io.h | ||
3 | * | ||
4 | * Copyright (C) 2000 Steve Hill (sjhill@cotw.com) | ||
5 | * | ||
6 | * Changelog: | ||
7 | * 03-21-2000 SJH Created from linux/include/asm-arm/arch-nexuspci/io.h | ||
8 | * 08-31-2000 SJH Added in IO functions necessary for new drivers | ||
9 | */ | ||
10 | #ifndef __ASM_ARM_ARCH_IO_H | ||
11 | #define __ASM_ARM_ARCH_IO_H | ||
12 | |||
13 | #include <asm/arch/hardware.h> | ||
14 | |||
15 | #define IO_SPACE_LIMIT 0xffffffff | ||
16 | |||
17 | /* | ||
18 | * There are not real ISA nor PCI buses, so we fake it. | ||
19 | */ | ||
20 | #define __io_pci(a) ((void __iomem *)(PCIO_BASE + (a))) | ||
21 | #define __mem_pci(a) (a) | ||
22 | #define __mem_isa(a) (a) | ||
23 | |||
24 | #define __ioaddr(p) __io_pci(p) | ||
25 | |||
26 | /* | ||
27 | * Generic virtual read/write | ||
28 | */ | ||
29 | #define __arch_getb(a) (*(volatile unsigned char *)(a)) | ||
30 | #define __arch_getl(a) (*(volatile unsigned int *)(a)) | ||
31 | |||
32 | static inline unsigned int __arch_getw(unsigned long a) | ||
33 | { | ||
34 | unsigned int value; | ||
35 | __asm__ __volatile__("ldr%?h %0, [%1, #0] @ getw" | ||
36 | : "=&r" (value) | ||
37 | : "r" (a)); | ||
38 | return value; | ||
39 | } | ||
40 | |||
41 | #define __arch_putb(v,a) (*(volatile unsigned char *)(a) = (v)) | ||
42 | #define __arch_putl(v,a) (*(volatile unsigned int *)(a) = (v)) | ||
43 | |||
44 | static inline void __arch_putw(unsigned int value, unsigned long a) | ||
45 | { | ||
46 | __asm__ __volatile__("str%?h %0, [%1, #0] @ putw" | ||
47 | : : "r" (value), "r" (a)); | ||
48 | } | ||
49 | |||
50 | /* | ||
51 | * Translated address IO functions | ||
52 | * | ||
53 | * IO address has already been translated to a virtual address | ||
54 | */ | ||
55 | #define outb_t(v,p) (*(volatile unsigned char *)(p) = (v)) | ||
56 | #define inb_t(p) (*(volatile unsigned char *)(p)) | ||
57 | #define outw_t(v,p) (*(volatile unsigned int *)(p) = (v)) | ||
58 | #define inw_t(p) (*(volatile unsigned int *)(p)) | ||
59 | #define outl_t(v,p) (*(volatile unsigned long *)(p) = (v)) | ||
60 | #define inl_t(p) (*(volatile unsigned long *)(p)) | ||
61 | |||
62 | /* | ||
63 | * FIXME - These are to allow for linking. On all the other | ||
64 | * ARM platforms, the entire IO space is contiguous. | ||
65 | * The 7200 has three separate IO spaces. The below | ||
66 | * macros will eventually become more involved. Use | ||
67 | * with caution and don't be surprised by kernel oopses!!! | ||
68 | */ | ||
69 | #define inb(p) inb_t(p) | ||
70 | #define inw(p) inw_t(p) | ||
71 | #define inl(p) inl_t(p) | ||
72 | #define outb(v,p) outb_t(v,p) | ||
73 | #define outw(v,p) outw_t(v,p) | ||
74 | #define outl(v,p) outl_t(v,p) | ||
75 | |||
76 | #endif | ||