This source file includes following definitions.
- __cf_internalio
- cf_internalio
- readw
- readl
- writew
- writel
1
2 #ifndef _M68KNOMMU_IO_H
3 #define _M68KNOMMU_IO_H
4
5
6
7
8
9 #define iomem(a) ((void __iomem *) (a))
10
11
12
13
14
15
16 #define __raw_readb(addr) \
17 ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
18 #define __raw_readw(addr) \
19 ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
20 #define __raw_readl(addr) \
21 ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
22
23 #define __raw_writeb(b, addr) (void)((*(volatile unsigned char *) (addr)) = (b))
24 #define __raw_writew(b, addr) (void)((*(volatile unsigned short *) (addr)) = (b))
25 #define __raw_writel(b, addr) (void)((*(volatile unsigned int *) (addr)) = (b))
26
27 #if defined(CONFIG_COLDFIRE)
28
29
30
31
32
33 #include <asm/byteorder.h>
34 #include <asm/coldfire.h>
35 #include <asm/mcfsim.h>
36 #endif
37
38 #if defined(IOMEMBASE)
39
40
41
42
43
44
45
46
47
48 static int __cf_internalio(unsigned long addr)
49 {
50 return (addr >= IOMEMBASE) && (addr <= IOMEMBASE + IOMEMSIZE - 1);
51 }
52
53 static int cf_internalio(const volatile void __iomem *addr)
54 {
55 return __cf_internalio((unsigned long) addr);
56 }
57
58
59
60
61
62
63
64
65 #define readw readw
66 static inline u16 readw(const volatile void __iomem *addr)
67 {
68 if (cf_internalio(addr))
69 return __raw_readw(addr);
70 return __le16_to_cpu(__raw_readw(addr));
71 }
72
73 #define readl readl
74 static inline u32 readl(const volatile void __iomem *addr)
75 {
76 if (cf_internalio(addr))
77 return __raw_readl(addr);
78 return __le32_to_cpu(__raw_readl(addr));
79 }
80
81 #define writew writew
82 static inline void writew(u16 value, volatile void __iomem *addr)
83 {
84 if (cf_internalio(addr))
85 __raw_writew(value, addr);
86 else
87 __raw_writew(__cpu_to_le16(value), addr);
88 }
89
90 #define writel writel
91 static inline void writel(u32 value, volatile void __iomem *addr)
92 {
93 if (cf_internalio(addr))
94 __raw_writel(value, addr);
95 else
96 __raw_writel(__cpu_to_le32(value), addr);
97 }
98
99 #else
100
101 #define readb __raw_readb
102 #define readw __raw_readw
103 #define readl __raw_readl
104 #define writeb __raw_writeb
105 #define writew __raw_writew
106 #define writel __raw_writel
107
108 #endif
109
110 #if defined(CONFIG_PCI)
111
112
113
114
115
116 #define PCI_MEM_PA 0xf0000000
117 #define PCI_MEM_BA 0xf0000000
118 #define PCI_MEM_SIZE 0x08000000
119 #define PCI_MEM_MASK (PCI_MEM_SIZE - 1)
120
121 #define PCI_IO_PA 0xf8000000
122 #define PCI_IO_BA 0x00000000
123 #define PCI_IO_SIZE 0x00010000
124 #define PCI_IO_MASK (PCI_IO_SIZE - 1)
125
126 #define HAVE_ARCH_PIO_SIZE
127 #define PIO_OFFSET 0
128 #define PIO_MASK 0xffff
129 #define PIO_RESERVED 0x10000
130 #define PCI_IOBASE ((void __iomem *) PCI_IO_PA)
131 #define PCI_SPACE_LIMIT PCI_IO_MASK
132 #endif
133
134 #include <asm/kmap.h>
135 #include <asm/virtconvert.h>
136
137 #endif