diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-03-24 06:18:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 10:33:29 -0500 |
commit | 00d83a54aa824b11ebc8c66c4a879cfeb5029a22 (patch) | |
tree | c4d13bb89b7ee082439ae75a5c1ee2d9da52c3c4 /drivers/char/rio/rioinit.c | |
parent | e2b3afd676ad3e15ca2efca3b3605c7d817ec6e3 (diff) |
[PATCH] rio driver rework continued #3
Second large chunk of code cleanup. The split between this and #3 and #4 is
fairly arbitary and due to the message length limit on the list. These
patches continue the process of ripping out macros and typedefs while cleaning
up lots of 32bit assumptions. Several inlines for compatibility also get
removed and that causes a lot of noise.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/rio/rioinit.c')
-rw-r--r-- | drivers/char/rio/rioinit.c | 186 |
1 files changed, 76 insertions, 110 deletions
diff --git a/drivers/char/rio/rioinit.c b/drivers/char/rio/rioinit.c index 0d44ef464e6b..1d73c4646bbd 100644 --- a/drivers/char/rio/rioinit.c +++ b/drivers/char/rio/rioinit.c | |||
@@ -82,9 +82,6 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3"; | |||
82 | #include "rioioctl.h" | 82 | #include "rioioctl.h" |
83 | #include "rio_linux.h" | 83 | #include "rio_linux.h" |
84 | 84 | ||
85 | #undef bcopy | ||
86 | #define bcopy rio_pcicopy | ||
87 | |||
88 | int RIOPCIinit(struct rio_info *p, int Mode); | 85 | int RIOPCIinit(struct rio_info *p, int Mode); |
89 | 86 | ||
90 | static int RIOScrub(int, BYTE *, int); | 87 | static int RIOScrub(int, BYTE *, int); |
@@ -99,12 +96,8 @@ static int RIOScrub(int, BYTE *, int); | |||
99 | ** bits < 0 indicates 8 bit operation requested, | 96 | ** bits < 0 indicates 8 bit operation requested, |
100 | ** bits > 0 indicates 16 bit operation. | 97 | ** bits > 0 indicates 16 bit operation. |
101 | */ | 98 | */ |
102 | int | 99 | |
103 | RIOAssignAT(p, Base, virtAddr, mode) | 100 | int RIOAssignAT(struct rio_info *p, int Base, caddr_t virtAddr, int mode) |
104 | struct rio_info * p; | ||
105 | int Base; | ||
106 | caddr_t virtAddr; | ||
107 | int mode; | ||
108 | { | 101 | { |
109 | int bits; | 102 | int bits; |
110 | struct DpRam *cardp = (struct DpRam *)virtAddr; | 103 | struct DpRam *cardp = (struct DpRam *)virtAddr; |
@@ -124,29 +117,25 @@ int mode; | |||
124 | /* | 117 | /* |
125 | ** Revision 01 AT host cards don't support WORD operations, | 118 | ** Revision 01 AT host cards don't support WORD operations, |
126 | */ | 119 | */ |
127 | if ( RBYTE(cardp->DpRevision) == 01 ) | 120 | if (readb(&cardp->DpRevision) == 01) |
128 | bits = BYTE_OPERATION; | 121 | bits = BYTE_OPERATION; |
129 | 122 | ||
130 | p->RIOHosts[p->RIONumHosts].Type = RIO_AT; | 123 | p->RIOHosts[p->RIONumHosts].Type = RIO_AT; |
131 | p->RIOHosts[p->RIONumHosts].Copy = bcopy; | 124 | p->RIOHosts[p->RIONumHosts].Copy = rio_copy_to_card; |
132 | /* set this later */ | 125 | /* set this later */ |
133 | p->RIOHosts[p->RIONumHosts].Slot = -1; | 126 | p->RIOHosts[p->RIONumHosts].Slot = -1; |
134 | p->RIOHosts[p->RIONumHosts].Mode = SLOW_LINKS | SLOW_AT_BUS | bits; | 127 | p->RIOHosts[p->RIONumHosts].Mode = SLOW_LINKS | SLOW_AT_BUS | bits; |
135 | WBYTE(p->RIOHosts[p->RIONumHosts].Control, | 128 | writeb(BOOT_FROM_RAM | EXTERNAL_BUS_OFF | p->RIOHosts[p->RIONumHosts].Mode | INTERRUPT_DISABLE , |
136 | BOOT_FROM_RAM | EXTERNAL_BUS_OFF | | 129 | &p->RIOHosts[p->RIONumHosts].Control); |
137 | p->RIOHosts[p->RIONumHosts].Mode | | 130 | writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); |
138 | INTERRUPT_DISABLE ); | 131 | writeb(BOOT_FROM_RAM | EXTERNAL_BUS_OFF | p->RIOHosts[p->RIONumHosts].Mode | INTERRUPT_DISABLE, |
139 | WBYTE(p->RIOHosts[p->RIONumHosts].ResetInt,0xff); | 132 | &p->RIOHosts[p->RIONumHosts].Control); |
140 | WBYTE(p->RIOHosts[p->RIONumHosts].Control, | 133 | writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); |
141 | BOOT_FROM_RAM | EXTERNAL_BUS_OFF | | ||
142 | p->RIOHosts[p->RIONumHosts].Mode | | ||
143 | INTERRUPT_DISABLE ); | ||
144 | WBYTE(p->RIOHosts[p->RIONumHosts].ResetInt,0xff); | ||
145 | p->RIOHosts[p->RIONumHosts].UniqueNum = | 134 | p->RIOHosts[p->RIONumHosts].UniqueNum = |
146 | ((RBYTE(p->RIOHosts[p->RIONumHosts].Unique[0])&0xFF)<<0)| | 135 | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[0])&0xFF)<<0)| |
147 | ((RBYTE(p->RIOHosts[p->RIONumHosts].Unique[1])&0xFF)<<8)| | 136 | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[1])&0xFF)<<8)| |
148 | ((RBYTE(p->RIOHosts[p->RIONumHosts].Unique[2])&0xFF)<<16)| | 137 | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2])&0xFF)<<16)| |
149 | ((RBYTE(p->RIOHosts[p->RIONumHosts].Unique[3])&0xFF)<<24); | 138 | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3])&0xFF)<<24); |
150 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Uniquenum 0x%x\n",p->RIOHosts[p->RIONumHosts].UniqueNum); | 139 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Uniquenum 0x%x\n",p->RIOHosts[p->RIONumHosts].UniqueNum); |
151 | 140 | ||
152 | p->RIONumHosts++; | 141 | p->RIONumHosts++; |
@@ -154,7 +143,7 @@ int mode; | |||
154 | return(1); | 143 | return(1); |
155 | } | 144 | } |
156 | 145 | ||
157 | static uchar val[] = { | 146 | static u8 val[] = { |
158 | #ifdef VERY_LONG_TEST | 147 | #ifdef VERY_LONG_TEST |
159 | 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, | 148 | 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, |
160 | 0xa5, 0xff, 0x5a, 0x00, 0xff, 0xc9, 0x36, | 149 | 0xa5, 0xff, 0x5a, 0x00, 0xff, 0xc9, 0x36, |
@@ -167,12 +156,7 @@ static uchar val[] = { | |||
167 | ** RAM test a board. | 156 | ** RAM test a board. |
168 | ** Nothing too complicated, just enough to check it out. | 157 | ** Nothing too complicated, just enough to check it out. |
169 | */ | 158 | */ |
170 | int | 159 | int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot) |
171 | RIOBoardTest(paddr, caddr, type, slot) | ||
172 | paddr_t paddr; | ||
173 | caddr_t caddr; | ||
174 | uchar type; | ||
175 | int slot; | ||
176 | { | 160 | { |
177 | struct DpRam *DpRam = (struct DpRam *)caddr; | 161 | struct DpRam *DpRam = (struct DpRam *)caddr; |
178 | char *ram[4]; | 162 | char *ram[4]; |
@@ -180,8 +164,8 @@ int slot; | |||
180 | int op, bank; | 164 | int op, bank; |
181 | int nbanks; | 165 | int nbanks; |
182 | 166 | ||
183 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Reset host type=%d, DpRam=0x%x, slot=%d\n", | 167 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Reset host type=%d, DpRam=0x%p, slot=%d\n", |
184 | type,(int)DpRam, slot); | 168 | type, DpRam, slot); |
185 | 169 | ||
186 | RIOHostReset(type, DpRam, slot); | 170 | RIOHostReset(type, DpRam, slot); |
187 | 171 | ||
@@ -209,12 +193,11 @@ int slot; | |||
209 | 193 | ||
210 | 194 | ||
211 | if (nbanks == 3) { | 195 | if (nbanks == 3) { |
212 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Memory: 0x%x(0x%x), 0x%x(0x%x), 0x%x(0x%x)\n", | 196 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Memory: 0x%p(0x%x), 0x%p(0x%x), 0x%p(0x%x)\n", |
213 | (int)ram[0], size[0], (int)ram[1], size[1], (int)ram[2], size[2]); | 197 | ram[0], size[0], ram[1], size[1], ram[2], size[2]); |
214 | } else { | 198 | } else { |
215 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: 0x%x(0x%x), 0x%x(0x%x), 0x%x(0x%x), 0x%x(0x%x)\n", | 199 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: 0x%p(0x%x), 0x%p(0x%x), 0x%p(0x%x), 0x%p(0x%x)\n", |
216 | (int)ram[0], size[0], (int)ram[1], size[1], (int)ram[2], size[2], (int)ram[3], | 200 | ram[0], size[0], ram[1], size[1], ram[2], size[2], ram[3], size[3]); |
217 | size[3]); | ||
218 | } | 201 | } |
219 | 202 | ||
220 | /* | 203 | /* |
@@ -248,13 +231,10 @@ int slot; | |||
248 | ** Call with op not zero, and the RAM will be read and compated with val[op-1] | 231 | ** Call with op not zero, and the RAM will be read and compated with val[op-1] |
249 | ** to check that the data from the previous phase was retained. | 232 | ** to check that the data from the previous phase was retained. |
250 | */ | 233 | */ |
251 | static int | 234 | |
252 | RIOScrub(op, ram, size) | 235 | static int RIOScrub(int op, BYTE *ram, int size) |
253 | int op; | ||
254 | BYTE * ram; | ||
255 | int size; | ||
256 | { | 236 | { |
257 | int off; | 237 | int off; |
258 | unsigned char oldbyte; | 238 | unsigned char oldbyte; |
259 | unsigned char newbyte; | 239 | unsigned char newbyte; |
260 | unsigned char invbyte; | 240 | unsigned char invbyte; |
@@ -279,15 +259,15 @@ int size; | |||
279 | */ | 259 | */ |
280 | if (op) { | 260 | if (op) { |
281 | for (off=0; off<size; off++) { | 261 | for (off=0; off<size; off++) { |
282 | if (RBYTE(ram[off]) != oldbyte) { | 262 | if (readb(ram + off) != oldbyte) { |
283 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Byte Pre Check 1: BYTE at offset 0x%x should have been=%x, was=%x\n", off, oldbyte, RBYTE(ram[off])); | 263 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Byte Pre Check 1: BYTE at offset 0x%x should have been=%x, was=%x\n", off, oldbyte, readb(ram + off)); |
284 | return RIO_FAIL; | 264 | return RIO_FAIL; |
285 | } | 265 | } |
286 | } | 266 | } |
287 | for (off=0; off<size; off+=2) { | 267 | for (off=0; off<size; off+=2) { |
288 | if (*(ushort *)&ram[off] != oldword) { | 268 | if (readw(ram + off) != oldword) { |
289 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Word Pre Check: WORD at offset 0x%x should have been=%x, was=%x\n",off,oldword,*(ushort *)&ram[off]); | 269 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Word Pre Check: WORD at offset 0x%x should have been=%x, was=%x\n",off,oldword, readw(ram + off)); |
290 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Word Pre Check: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, RBYTE(ram[off]), off+1, RBYTE(ram[off+1])); | 270 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Word Pre Check: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, readb(ram + off), off+1, readb(ram+off+1)); |
291 | return RIO_FAIL; | 271 | return RIO_FAIL; |
292 | } | 272 | } |
293 | } | 273 | } |
@@ -301,13 +281,13 @@ int size; | |||
301 | ** the BYTE read/write test. | 281 | ** the BYTE read/write test. |
302 | */ | 282 | */ |
303 | for (off=0; off<size; off++) { | 283 | for (off=0; off<size; off++) { |
304 | if (op && (RBYTE(ram[off]) != oldbyte)) { | 284 | if (op && (readb(ram + off) != oldbyte)) { |
305 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Byte Pre Check 2: BYTE at offset 0x%x should have been=%x, was=%x\n", off, oldbyte, RBYTE(ram[off])); | 285 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Byte Pre Check 2: BYTE at offset 0x%x should have been=%x, was=%x\n", off, oldbyte, readb(ram + off)); |
306 | return RIO_FAIL; | 286 | return RIO_FAIL; |
307 | } | 287 | } |
308 | WBYTE(ram[off],invbyte); | 288 | writeb(invbyte, ram + off); |
309 | if (RBYTE(ram[off]) != invbyte) { | 289 | if (readb(ram + off) != invbyte) { |
310 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Byte Inv Check: BYTE at offset 0x%x should have been=%x, was=%x\n", off, invbyte, RBYTE(ram[off])); | 290 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Byte Inv Check: BYTE at offset 0x%x should have been=%x, was=%x\n", off, invbyte, readb(ram + off)); |
311 | return RIO_FAIL; | 291 | return RIO_FAIL; |
312 | } | 292 | } |
313 | } | 293 | } |
@@ -320,16 +300,16 @@ int size; | |||
320 | ** This is the WORD operation test. | 300 | ** This is the WORD operation test. |
321 | */ | 301 | */ |
322 | for (off=0; off<size; off+=2) { | 302 | for (off=0; off<size; off+=2) { |
323 | if (*(ushort *)&ram[off] != invword) { | 303 | if (readw(ram + off) != invword) { |
324 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Word Inv Check: WORD at offset 0x%x should have been=%x, was=%x\n", off, invword, *(ushort *)&ram[off]); | 304 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Word Inv Check: WORD at offset 0x%x should have been=%x, was=%x\n", off, invword, readw(ram + off)); |
325 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Word Inv Check: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, RBYTE(ram[off]), off+1, RBYTE(ram[off+1])); | 305 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Word Inv Check: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, readb(ram + off), off+1, readb(ram+off+1)); |
326 | return RIO_FAIL; | 306 | return RIO_FAIL; |
327 | } | 307 | } |
328 | 308 | ||
329 | *(ushort *)&ram[off] = newword; | 309 | writew(newword, ram + off); |
330 | if ( *(ushort *)&ram[off] != newword ) { | 310 | if ( readw(ram + off) != newword ) { |
331 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Word Check 1: WORD at offset 0x%x should have been=%x, was=%x\n", off, newword, *(ushort *)&ram[off]); | 311 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Word Check 1: WORD at offset 0x%x should have been=%x, was=%x\n", off, newword, readw(ram + off)); |
332 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Word Check 1: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, RBYTE(ram[off]), off+1, RBYTE(ram[off+1])); | 312 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Word Check 1: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, readb(ram + off), off+1, readb(ram + off + 1)); |
333 | return RIO_FAIL; | 313 | return RIO_FAIL; |
334 | } | 314 | } |
335 | } | 315 | } |
@@ -340,16 +320,16 @@ int size; | |||
340 | ** required test data. | 320 | ** required test data. |
341 | */ | 321 | */ |
342 | for (off=0; off<size; off++) { | 322 | for (off=0; off<size; off++) { |
343 | if (RBYTE(ram[off]) != newbyte) { | 323 | if (readb(ram + off) != newbyte) { |
344 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Byte Check: BYTE at offset 0x%x should have been=%x, was=%x\n", off, newbyte, RBYTE(ram[off])); | 324 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Byte Check: BYTE at offset 0x%x should have been=%x, was=%x\n", off, newbyte, readb(ram + off)); |
345 | return RIO_FAIL; | 325 | return RIO_FAIL; |
346 | } | 326 | } |
347 | } | 327 | } |
348 | 328 | ||
349 | for (off=0; off<size; off+=2) { | 329 | for (off=0; off<size; off+=2) { |
350 | if ( *(ushort *)&ram[off] != newword ) { | 330 | if (readw(ram + off) != newword ) { |
351 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Word Check 2: WORD at offset 0x%x should have been=%x, was=%x\n", off, newword, *(ushort *)&ram[off]); | 331 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Word Check 2: WORD at offset 0x%x should have been=%x, was=%x\n", off, newword, readw(ram + off)); |
352 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Word Check 2: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, RBYTE(ram[off]), off+1, RBYTE(ram[off+1])); | 332 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Post Word Check 2: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, readb(ram + off), off+1, readb(ram + off + 1)); |
353 | return RIO_FAIL; | 333 | return RIO_FAIL; |
354 | } | 334 | } |
355 | } | 335 | } |
@@ -360,41 +340,37 @@ int size; | |||
360 | swapword = invbyte | (newbyte << 8); | 340 | swapword = invbyte | (newbyte << 8); |
361 | 341 | ||
362 | for (off=0; off<size; off+=2) { | 342 | for (off=0; off<size; off+=2) { |
363 | WBYTE(ram[off],invbyte); | 343 | writeb(invbyte, &ram[off]); |
364 | WBYTE(ram[off+1],newbyte); | 344 | writeb(newbyte, &ram[off+1]); |
365 | } | 345 | } |
366 | 346 | ||
367 | for ( off=0; off<size; off+=2 ) { | 347 | for ( off=0; off<size; off+=2 ) { |
368 | if (*(ushort *)&ram[off] != swapword) { | 348 | if (readw(ram + off) != swapword) { |
369 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: SwapWord Check 1: WORD at offset 0x%x should have been=%x, was=%x\n", off, swapword, *((ushort *)&ram[off])); | 349 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: SwapWord Check 1: WORD at offset 0x%x should have been=%x, was=%x\n", off, swapword, readw(ram + off)); |
370 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: SwapWord Check 1: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, RBYTE(ram[off]), off+1, RBYTE(ram[off+1])); | 350 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: SwapWord Check 1: BYTE at offset 0x%x is %x BYTE at offset 0x%x is %x\n", off, readb(ram + off), off+1, readb(ram + off + 1)); |
371 | return RIO_FAIL; | 351 | return RIO_FAIL; |
372 | } | 352 | } |
373 | *((ushort *)&ram[off]) = ~swapword; | 353 | writew(~swapword, ram + off); |
374 | } | 354 | } |
375 | 355 | ||
376 | for (off=0; off<size; off+=2) { | 356 | for (off=0; off<size; off+=2) { |
377 | if (RBYTE(ram[off]) != newbyte) { | 357 | if (readb(ram + off) != newbyte) { |
378 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: SwapWord Check 2: BYTE at offset 0x%x should have been=%x, was=%x\n", off, newbyte, RBYTE(ram[off])); | 358 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: SwapWord Check 2: BYTE at offset 0x%x should have been=%x, was=%x\n", off, newbyte, readb(ram + off)); |
379 | return RIO_FAIL; | 359 | return RIO_FAIL; |
380 | } | 360 | } |
381 | if (RBYTE(ram[off+1]) != invbyte) { | 361 | if (readb(ram + off + 1) != invbyte) { |
382 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: SwapWord Check 2: BYTE at offset 0x%x should have been=%x, was=%x\n", off+1, invbyte, RBYTE(ram[off+1])); | 362 | rio_dprintk (RIO_DEBUG_INIT, "RIO-init: SwapWord Check 2: BYTE at offset 0x%x should have been=%x, was=%x\n", off+1, invbyte, readb(ram + off + 1)); |
383 | return RIO_FAIL; | 363 | return RIO_FAIL; |
384 | } | 364 | } |
385 | *((ushort *)&ram[off]) = newword; | 365 | writew(newword, ram + off); |
386 | } | 366 | } |
387 | return RIO_SUCCESS; | 367 | return RIO_SUCCESS; |
388 | } | 368 | } |
389 | 369 | ||
390 | 370 | ||
391 | int | 371 | int RIODefaultName(struct rio_info *p, struct Host *HostP, unsigned int UnitId) |
392 | RIODefaultName(p, HostP, UnitId) | ||
393 | struct rio_info * p; | ||
394 | struct Host * HostP; | ||
395 | uint UnitId; | ||
396 | { | 372 | { |
397 | bcopy("UNKNOWN RTA X-XX",HostP->Mapping[UnitId].Name,17); | 373 | memcpy(HostP->Mapping[UnitId].Name, "UNKNOWN RTA X-XX", 17); |
398 | HostP->Mapping[UnitId].Name[12]='1'+(HostP-p->RIOHosts); | 374 | HostP->Mapping[UnitId].Name[12]='1'+(HostP-p->RIOHosts); |
399 | if ((UnitId+1) > 9) { | 375 | if ((UnitId+1) > 9) { |
400 | HostP->Mapping[UnitId].Name[14]='0'+((UnitId+1)/10); | 376 | HostP->Mapping[UnitId].Name[14]='0'+((UnitId+1)/10); |
@@ -412,8 +388,7 @@ uint UnitId; | |||
412 | 388 | ||
413 | static struct rioVersion stVersion; | 389 | static struct rioVersion stVersion; |
414 | 390 | ||
415 | struct rioVersion * | 391 | struct rioVersion *RIOVersid(void) |
416 | RIOVersid(void) | ||
417 | { | 392 | { |
418 | strlcpy(stVersion.version, "RIO driver for linux V1.0", | 393 | strlcpy(stVersion.version, "RIO driver for linux V1.0", |
419 | sizeof(stVersion.version)); | 394 | sizeof(stVersion.version)); |
@@ -423,40 +398,31 @@ RIOVersid(void) | |||
423 | return &stVersion; | 398 | return &stVersion; |
424 | } | 399 | } |
425 | 400 | ||
426 | void | 401 | void RIOHostReset(unsigned int Type, struct DpRam *DpRamP, unsigned int Slot) |
427 | RIOHostReset(Type, DpRamP, Slot) | ||
428 | uint Type; | ||
429 | volatile struct DpRam *DpRamP; | ||
430 | uint Slot; | ||
431 | { | 402 | { |
432 | /* | 403 | /* |
433 | ** Reset the Tpu | 404 | ** Reset the Tpu |
434 | */ | 405 | */ |
435 | rio_dprintk (RIO_DEBUG_INIT, "RIOHostReset: type 0x%x", Type); | 406 | rio_dprintk (RIO_DEBUG_INIT, "RIOHostReset: type 0x%x", Type); |
436 | switch ( Type ) { | 407 | switch ( Type ) { |
437 | case RIO_AT: | 408 | case RIO_AT: |
438 | rio_dprintk (RIO_DEBUG_INIT, " (RIO_AT)\n"); | 409 | rio_dprintk (RIO_DEBUG_INIT, " (RIO_AT)\n"); |
439 | WBYTE(DpRamP->DpControl, BOOT_FROM_RAM | EXTERNAL_BUS_OFF | | 410 | writeb(BOOT_FROM_RAM | EXTERNAL_BUS_OFF | INTERRUPT_DISABLE | BYTE_OPERATION | |
440 | INTERRUPT_DISABLE | BYTE_OPERATION | | 411 | SLOW_LINKS | SLOW_AT_BUS, &DpRamP->DpControl); |
441 | SLOW_LINKS | SLOW_AT_BUS); | 412 | writeb(0xFF, &DpRamP->DpResetTpu); |
442 | WBYTE(DpRamP->DpResetTpu, 0xFF); | 413 | udelay(3); |
443 | udelay(3); | ||
444 | |||
445 | rio_dprintk (RIO_DEBUG_INIT, "RIOHostReset: Don't know if it worked. Try reset again\n"); | 414 | rio_dprintk (RIO_DEBUG_INIT, "RIOHostReset: Don't know if it worked. Try reset again\n"); |
446 | WBYTE(DpRamP->DpControl, BOOT_FROM_RAM | EXTERNAL_BUS_OFF | | 415 | writeb(BOOT_FROM_RAM | EXTERNAL_BUS_OFF | INTERRUPT_DISABLE | |
447 | INTERRUPT_DISABLE | BYTE_OPERATION | | 416 | BYTE_OPERATION | SLOW_LINKS | SLOW_AT_BUS, &DpRamP->DpControl); |
448 | SLOW_LINKS | SLOW_AT_BUS); | 417 | writeb(0xFF, &DpRamP->DpResetTpu); |
449 | WBYTE(DpRamP->DpResetTpu, 0xFF); | 418 | udelay(3); |
450 | udelay(3); | 419 | break; |
451 | break; | ||
452 | case RIO_PCI: | 420 | case RIO_PCI: |
453 | rio_dprintk (RIO_DEBUG_INIT, " (RIO_PCI)\n"); | 421 | rio_dprintk (RIO_DEBUG_INIT, " (RIO_PCI)\n"); |
454 | DpRamP->DpControl = RIO_PCI_BOOT_FROM_RAM; | 422 | writeb(RIO_PCI_BOOT_FROM_RAM, &DpRamP->DpControl); |
455 | DpRamP->DpResetInt = 0xFF; | 423 | writeb(0xFF, &DpRamP->DpResetInt); |
456 | DpRamP->DpResetTpu = 0xFF; | 424 | writeb(0xFF, &DpRamP->DpResetTpu); |
457 | udelay(100); | 425 | udelay(100); |
458 | /* for (i=0; i<6000; i++); */ | ||
459 | /* suspend( 3 ); */ | ||
460 | break; | 426 | break; |
461 | default: | 427 | default: |
462 | rio_dprintk (RIO_DEBUG_INIT, " (UNKNOWN)\n"); | 428 | rio_dprintk (RIO_DEBUG_INIT, " (UNKNOWN)\n"); |