This source file includes following definitions.
- __local_inb
- __local_outb
- __inb
- __outb
- __is_local
- inb
- outb
- inw
- 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
32
33
34
35
36
37
38
39 #define IDENT_ADDR (0xfffffc0000000000UL)
40
41
42
43
44 #define EISA_INTA (IDENT_ADDR + 0x100000000UL)
45
46
47
48
49 #define EISA_FEPROM0 (IDENT_ADDR + 0x180000000UL)
50 #define EISA_FEPROM1 (IDENT_ADDR + 0x1A0000000UL)
51
52
53
54
55 #define EISA_VL82C106 (IDENT_ADDR + 0x1C0000000UL)
56
57
58
59
60 #define EISA_HAE (IDENT_ADDR + 0x1D0000000UL)
61
62
63
64
65 #define EISA_SYSCTL (IDENT_ADDR + 0x1E0000000UL)
66
67
68
69
70 #define EISA_SPARE (IDENT_ADDR + 0x1F0000000UL)
71
72
73
74
75 #define EISA_MEM (IDENT_ADDR + 0x200000000UL)
76
77
78
79
80 #define EISA_IO (IDENT_ADDR + 0x300000000UL)
81
82
83
84
85
86
87
88
89
90
91
92
93 extern inline unsigned int __local_inb(unsigned long addr)
94 {
95 long result = *(volatile int *) ((addr << 9) + EISA_VL82C106);
96 return 0xffUL & result;
97 }
98
99 extern inline void __local_outb(unsigned char b, unsigned long addr)
100 {
101 *(volatile unsigned int *) ((addr << 9) + EISA_VL82C106) = b;
102 mb();
103 }
104
105 extern inline unsigned int __inb(unsigned long addr)
106 {
107 long result = *(volatile int *) ((addr << 7) + EISA_IO + 0x00);
108 result >>= (addr & 3) * 8;
109 return 0xffUL & result;
110 }
111
112 extern inline void __outb(unsigned char b, unsigned long addr)
113 {
114 *(volatile unsigned int *) ((addr << 7) + EISA_IO + 0x00) = b * 0x01010101;
115 mb();
116 }
117
118
119
120
121
122
123
124 extern inline int __is_local(unsigned long addr)
125 {
126
127 if (addr == 0x60 || addr == 0x64)
128 return 1;
129
130
131 if (addr == 0x170 || addr == 0x171)
132 return 1;
133
134
135 if (addr >= 0x2f8 && addr <= 0x2ff)
136 return 1;
137
138
139 if (addr >= 0x3bc && addr <= 0x3be)
140 return 1;
141
142
143 if (addr >= 0x3f8 && addr <= 0x3ff)
144 return 1;
145
146 return 0;
147 }
148
149 extern inline unsigned int inb(unsigned long addr)
150 {
151 if (__is_local(addr))
152 return __local_inb(addr);
153 return __inb(addr);
154 }
155
156 extern inline void outb(unsigned char b, unsigned long addr)
157 {
158 if (__is_local(addr))
159 __local_outb(b, addr);
160 else
161 __outb(b, addr);
162 }
163
164 extern inline unsigned int inw(unsigned long addr)
165 {
166 long result = *(volatile int *) ((addr << 7) + EISA_IO + 0x20);
167 result >>= (addr & 3) * 8;
168 return 0xffffUL & result;
169 }
170
171 extern inline unsigned int inl(unsigned long addr)
172 {
173 return *(volatile unsigned int *) ((addr << 7) + EISA_IO + 0x60);
174 }
175
176 extern inline void outw(unsigned short b, unsigned long addr)
177 {
178 *(volatile unsigned int *) ((addr << 7) + EISA_IO + 0x20) = b * 0x00010001;
179 mb();
180 }
181
182 extern inline void outl(unsigned int b, unsigned long addr)
183 {
184 *(volatile unsigned int *) ((addr << 7) + EISA_IO + 0x60) = b;
185 mb();
186 }
187
188
189
190
191 extern inline unsigned long readb(unsigned long addr)
192 {
193 long result = *(volatile int *) ((addr << 7) + EISA_MEM + 0x00);
194 result >>= (addr & 3) * 8;
195 return 0xffUL & result;
196 }
197
198 extern inline unsigned long readw(unsigned long addr)
199 {
200 long result = *(volatile int *) ((addr << 7) + EISA_MEM + 0x20);
201 result >>= (addr & 3) * 8;
202 return 0xffffUL & result;
203 }
204
205 extern inline unsigned long readl(unsigned long addr)
206 {
207 return *(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x60);
208 }
209
210 extern inline void writeb(unsigned short b, unsigned long addr)
211 {
212 *(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x00) = b * 0x01010101;
213 }
214
215 extern inline void writew(unsigned short b, unsigned long addr)
216 {
217 *(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x20) = b * 0x00010001;
218 }
219
220 extern inline void writel(unsigned int b, unsigned long addr)
221 {
222 *(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x60) = b;
223 }
224
225 #define inb_p inb
226 #define outb_p outb
227
228
229
230
231
232
233
234
235 #define RTC_PORT(x) (0x170+(x))
236 #define RTC_ADDR(x) (x)
237 #define RTC_ALWAYS_BCD 0
238
239 #endif