This source file includes following definitions.
- __set_hae
- __local_inb
- __local_outb
- __bus_inb
- __bus_outb
- __inb
- __outb
- __inw
- __inl
- __outw
- __outl
- __readb
- __readw
- __readl
- __writeb
- __writew
- __writel
1 #ifndef __ALPHA_JENSEN_H
2 #define __ALPHA_JENSEN_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 #define EISA_INTA (IDENT_ADDR + 0x100000000UL)
32
33
34
35
36 #define EISA_FEPROM0 (IDENT_ADDR + 0x180000000UL)
37 #define EISA_FEPROM1 (IDENT_ADDR + 0x1A0000000UL)
38
39
40
41
42 #define EISA_VL82C106 (IDENT_ADDR + 0x1C0000000UL)
43
44
45
46
47 #define EISA_HAE (IDENT_ADDR + 0x1D0000000UL)
48
49
50
51
52 #define EISA_SYSCTL (IDENT_ADDR + 0x1E0000000UL)
53
54
55
56
57 #define EISA_SPARE (IDENT_ADDR + 0x1F0000000UL)
58
59
60
61
62 #define EISA_MEM (IDENT_ADDR + 0x200000000UL)
63
64
65
66
67 #define EISA_IO (IDENT_ADDR + 0x300000000UL)
68
69
70
71
72
73
74
75
76 #define virt_to_bus virt_to_phys
77 #define bus_to_virt phys_to_virt
78
79 #define HAE_ADDRESS EISA_HAE
80
81
82
83
84
85
86
87
88
89 #define __HAE_MASK 0x1ffffff
90 extern inline void __set_hae(unsigned long addr)
91 {
92
93 addr >>= 25;
94 if (addr != hae.cache)
95 set_hae(addr);
96 }
97
98
99
100
101
102
103
104
105
106
107
108
109 extern inline unsigned int __local_inb(unsigned long addr)
110 {
111 long result = *(volatile int *) ((addr << 9) + EISA_VL82C106);
112 return 0xffUL & result;
113 }
114
115 extern inline void __local_outb(unsigned char b, unsigned long addr)
116 {
117 *(volatile unsigned int *) ((addr << 9) + EISA_VL82C106) = b;
118 mb();
119 }
120
121 extern unsigned int _bus_inb(unsigned long addr);
122
123 extern inline unsigned int __bus_inb(unsigned long addr)
124 {
125 long result;
126
127 __set_hae(0);
128 result = *(volatile int *) ((addr << 7) + EISA_IO + 0x00);
129 result >>= (addr & 3) * 8;
130 return 0xffUL & result;
131 }
132
133 extern void _bus_outb(unsigned char b, unsigned long addr);
134
135 extern inline void __bus_outb(unsigned char b, unsigned long addr)
136 {
137 __set_hae(0);
138 *(volatile unsigned int *) ((addr << 7) + EISA_IO + 0x00) = b * 0x01010101;
139 mb();
140 }
141
142
143
144
145
146
147 #define __is_local(addr) ( \
148 (addr == 0x60 || addr == 0x64) || \
149 (addr == 0x170 || addr == 0x171) || \
150 (addr >= 0x2f8 && addr <= 0x2ff) || \
151 (addr >= 0x3bc && addr <= 0x3be) || \
152 (addr >= 0x3f8 && addr <= 0x3ff))
153
154 extern inline unsigned int __inb(unsigned long addr)
155 {
156 if (__is_local(addr))
157 return __local_inb(addr);
158 return _bus_inb(addr);
159 }
160
161 extern inline void __outb(unsigned char b, unsigned long addr)
162 {
163 if (__is_local(addr))
164 __local_outb(b, addr);
165 else
166 _bus_outb(b, addr);
167 }
168
169 extern inline unsigned int __inw(unsigned long addr)
170 {
171 long result;
172
173 __set_hae(0);
174 result = *(volatile int *) ((addr << 7) + EISA_IO + 0x20);
175 result >>= (addr & 3) * 8;
176 return 0xffffUL & result;
177 }
178
179 extern inline unsigned int __inl(unsigned long addr)
180 {
181 __set_hae(0);
182 return *(volatile unsigned int *) ((addr << 7) + EISA_IO + 0x60);
183 }
184
185 extern inline void __outw(unsigned short b, unsigned long addr)
186 {
187 __set_hae(0);
188 *(volatile unsigned int *) ((addr << 7) + EISA_IO + 0x20) = b * 0x00010001;
189 mb();
190 }
191
192 extern inline void __outl(unsigned int b, unsigned long addr)
193 {
194 __set_hae(0);
195 *(volatile unsigned int *) ((addr << 7) + EISA_IO + 0x60) = b;
196 mb();
197 }
198
199
200
201
202 extern inline unsigned long __readb(unsigned long addr)
203 {
204 long result;
205
206 __set_hae(addr);
207 addr &= __HAE_MASK;
208 result = *(volatile int *) ((addr << 7) + EISA_MEM + 0x00);
209 result >>= (addr & 3) * 8;
210 return 0xffUL & result;
211 }
212
213 extern inline unsigned long __readw(unsigned long addr)
214 {
215 long result;
216
217 __set_hae(addr);
218 addr &= __HAE_MASK;
219 result = *(volatile int *) ((addr << 7) + EISA_MEM + 0x20);
220 result >>= (addr & 3) * 8;
221 return 0xffffUL & result;
222 }
223
224 extern inline unsigned long __readl(unsigned long addr)
225 {
226 __set_hae(addr);
227 addr &= __HAE_MASK;
228 return *(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x60);
229 }
230
231 extern inline void __writeb(unsigned short b, unsigned long addr)
232 {
233 __set_hae(addr);
234 addr &= __HAE_MASK;
235 *(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x00) = b * 0x01010101;
236 }
237
238 extern inline void __writew(unsigned short b, unsigned long addr)
239 {
240 __set_hae(addr);
241 addr &= __HAE_MASK;
242 *(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x20) = b * 0x00010001;
243 }
244
245 extern inline void __writel(unsigned int b, unsigned long addr)
246 {
247 __set_hae(addr);
248 addr &= __HAE_MASK;
249 *(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x60) = b;
250 }
251
252
253
254
255
256 #define inb(port) \
257 (__builtin_constant_p((port))?__inb(port):_inb(port))
258
259 #define outb(x, port) \
260 (__builtin_constant_p((port))?__outb((x),(port)):_outb((x),(port)))
261
262
263
264
265
266
267
268
269 #define RTC_PORT(x) (0x170+(x))
270 #define RTC_ADDR(x) (x)
271 #define RTC_ALWAYS_BCD 0
272
273 #endif