btvmei.c revision 1.18 1 /* $NetBSD: btvmei.c,v 1.18 2008/04/10 19:13:36 cegger Exp $ */
2
3 /*
4 * Copyright (c) 1999
5 * Matthias Drochner. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 */
30
31 #include <sys/cdefs.h>
32 __KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.18 2008/04/10 19:13:36 cegger Exp $");
33
34 #include <sys/param.h>
35 #include <sys/systm.h>
36 #include <sys/kernel.h>
37 #include <sys/device.h>
38 #include <sys/proc.h>
39 #include <sys/malloc.h>
40
41 #include <sys/bus.h>
42 #include <sys/extent.h>
43
44 #include <dev/pci/pcireg.h>
45 #include <dev/pci/pcivar.h>
46 #include <dev/pci/pcidevs.h>
47
48 #include <dev/vme/vmereg.h>
49 #include <dev/vme/vmevar.h>
50
51 #include <dev/pci/btvmeireg.h>
52 #include <dev/pci/btvmeivar.h>
53
54 static int b3_617_match(struct device *, struct cfdata *, void *);
55 static void b3_617_attach(struct device *, struct device *, void *);
56 #ifdef notyet
57 static int b3_617_detach(struct device *);
58 #endif
59 void b3_617_slaveconfig(struct device *, struct vme_attach_args *);
60
61 static void b3_617_vmeintr(struct b3_617_softc *, unsigned char);
62
63 /*
64 * mapping ressources, needed for deallocation
65 */
66 struct b3_617_vmeresc {
67 bus_space_handle_t handle;
68 bus_size_t len;
69 int firstpage, maplen;
70 };
71
72 CFATTACH_DECL(btvmei, sizeof(struct b3_617_softc),
73 b3_617_match, b3_617_attach, NULL, NULL);
74
75 static int
76 b3_617_match(parent, match, aux)
77 struct device *parent;
78 struct cfdata *match;
79 void *aux;
80 {
81 struct pci_attach_args *pa = aux;
82
83 if ((PCI_VENDOR(pa->pa_id) != PCI_VENDOR_BIT3)
84 || (PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_BIT3_PCIVME617))
85 return (0);
86 return (1);
87 }
88
89 static void
90 b3_617_attach(parent, self, aux)
91 struct device *parent, *self;
92 void *aux;
93 {
94 struct b3_617_softc *sc = (struct b3_617_softc*)self;
95 struct pci_attach_args *pa = aux;
96 pci_chipset_tag_t pc = pa->pa_pc;
97
98 int rev;
99
100 pci_intr_handle_t ih;
101 const char *intrstr;
102 struct vmebus_attach_args vaa;
103
104 aprint_naive(": VME bus adapter\n");
105
106 sc->sc_pc = pc;
107 sc->sc_dmat = pa->pa_dmat;
108
109 rev = PCI_REVISION(pci_conf_read(pc, pa->pa_tag, PCI_CLASS_REG));
110 aprint_normal(": BIT3 PCI-VME 617 rev %d\n", rev);
111
112 /*
113 * Map CSR and mapping table spaces.
114 * Don't map VME window; parts are mapped as needed to
115 * save kernel virtual memory space
116 */
117 if (pci_mapreg_map(pa, 0x14,
118 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
119 0, &sc->csrt, &sc->csrh, NULL, NULL) &&
120 pci_mapreg_map(pa, 0x10,
121 PCI_MAPREG_TYPE_IO,
122 0, &sc->csrt, &sc->csrh, NULL, NULL)) {
123 aprint_error_dev(self, "can't map CSR space\n");
124 return;
125 }
126
127 if (pci_mapreg_map(pa, 0x18,
128 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
129 0, &sc->mapt, &sc->maph, NULL, NULL)) {
130 aprint_error_dev(self, "can't map map space\n");
131 return;
132 }
133
134 if (pci_mapreg_info(pc, pa->pa_tag, 0x1c,
135 PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT,
136 &sc->vmepbase, 0, 0)) {
137 aprint_error_dev(self, "can't get VME range\n");
138 return;
139 }
140 sc->sc_vmet = pa->pa_memt; /* XXX needed for VME mappings */
141
142 /* Map and establish the interrupt. */
143 if (pci_intr_map(pa, &ih)) {
144 aprint_error_dev(&sc->sc_dev, "couldn't map interrupt\n");
145 return;
146 }
147 intrstr = pci_intr_string(pc, ih);
148 /*
149 * Use a low interrupt level (the lowest?).
150 * We will raise before calling a subdevice's handler.
151 */
152 sc->sc_ih = pci_intr_establish(pc, ih, IPL_BIO, b3_617_intr, sc);
153 if (sc->sc_ih == NULL) {
154 aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt");
155 if (intrstr != NULL)
156 aprint_normal(" at %s", intrstr);
157 aprint_normal("\n");
158 return;
159 }
160 aprint_normal_dev(&sc->sc_dev, "interrupting at %s\n", intrstr);
161
162 if (b3_617_init(sc))
163 return;
164
165 /*
166 * set up all the tags for use by VME devices
167 */
168 sc->sc_vct.cookie = self;
169 sc->sc_vct.vct_probe = b3_617_vme_probe;
170 sc->sc_vct.vct_map = b3_617_map_vme;
171 sc->sc_vct.vct_unmap = b3_617_unmap_vme;
172 sc->sc_vct.vct_int_map = b3_617_map_vmeint;
173 sc->sc_vct.vct_int_establish = b3_617_establish_vmeint;
174 sc->sc_vct.vct_int_disestablish = b3_617_disestablish_vmeint;
175 sc->sc_vct.vct_dmamap_create = b3_617_dmamap_create;
176 sc->sc_vct.vct_dmamap_destroy = b3_617_dmamap_destroy;
177 sc->sc_vct.vct_dmamem_alloc = b3_617_dmamem_alloc;
178 sc->sc_vct.vct_dmamem_free = b3_617_dmamem_free;
179
180 vaa.va_vct = &(sc->sc_vct);
181 vaa.va_bdt = pa->pa_dmat;
182 vaa.va_slaveconfig = b3_617_slaveconfig;
183
184 sc->csrwindow.offset = -1;
185 sc->dmawindow24.offset = -1;
186 sc->dmawindow32.offset = -1;
187 config_found(self, &vaa, 0);
188 }
189
190 #ifdef notyet
191 static int
192 b3_617_detach(dev)
193 struct device *dev;
194 {
195 struct b3_617_softc *sc = (struct b3_617_softc *)dev;
196
197 b3_617_halt(sc);
198
199 if (sc->sc_ih)
200 pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
201
202 bus_space_unmap(sc->sc_bc, sc->csrbase, 32);
203 bus_space_unmap(sc->sc_bc, sc->mapbase, 64*1024);
204
205 return(0);
206 }
207 #endif
208
209 void
210 b3_617_slaveconfig(dev, va)
211 struct device *dev;
212 struct vme_attach_args *va;
213 {
214 struct b3_617_softc *sc = (struct b3_617_softc *)dev;
215 vme_chipset_tag_t vmect;
216 int i, res;
217 const char *name = 0; /* XXX gcc! */
218
219 vmect = &sc->sc_vct;
220 if (!va)
221 goto freeit;
222
223 #ifdef DIAGNOSTIC
224 if (vmect != va->va_vct)
225 panic("pcivme_slaveconfig: chipset tag?");
226 #endif
227
228 for (i = 0; i < va->numcfranges; i++) {
229 res = vme_space_alloc(vmect, va->r[i].offset,
230 va->r[i].size, va->r[i].am);
231 if (res)
232 panic("%s: can't alloc slave window %x/%x/%x",
233 device_xname(dev), va->r[i].offset,
234 va->r[i].size, va->r[i].am);
235
236 switch (va->r[i].am & VME_AM_ADRSIZEMASK) {
237 /* structure assignments! */
238 case VME_AM_A16:
239 sc->csrwindow = va->r[i];
240 name = "VME CSR";
241 break;
242 case VME_AM_A24:
243 sc->dmawindow24 = va->r[i];
244 name = "A24 DMA";
245 break;
246 case VME_AM_A32:
247 sc->dmawindow32 = va->r[i];
248 name = "A32 DMA";
249 break;
250 }
251 printf("%s: %s window: %x-%x\n", device_xname(dev),
252 name, va->r[i].offset,
253 va->r[i].offset + va->r[i].size - 1);
254 }
255 return;
256
257 freeit:
258 if (sc->csrwindow.offset != -1)
259 vme_space_free(vmect, sc->csrwindow.offset,
260 sc->csrwindow.size, sc->csrwindow.am);
261 if (sc->dmawindow32.offset != -1)
262 vme_space_free(vmect, sc->dmawindow32.offset,
263 sc->dmawindow32.size, sc->dmawindow32.am);
264 if (sc->dmawindow24.offset != -1)
265 vme_space_free(vmect, sc->dmawindow24.offset,
266 sc->dmawindow24.size, sc->dmawindow24.am);
267 }
268
269 int
270 b3_617_reset(sc)
271 struct b3_617_softc *sc;
272 {
273 unsigned char status;
274
275 /* reset sequence, ch 5.2 */
276 status = read_csr_byte(sc, LOC_STATUS);
277 if (status & LSR_NO_CONNECT) {
278 printf("%s: not connected\n", device_xname(&sc->sc_dev));
279 return (-1);
280 }
281 status = read_csr_byte(sc, REM_STATUS); /* discard */
282 write_csr_byte(sc, LOC_CMD1, LC1_CLR_ERROR);
283 status = read_csr_byte(sc, LOC_STATUS);
284 if (status & LSR_CERROR_MASK) {
285 char sbuf[sizeof(BIT3_LSR_BITS) + 64];
286
287 bitmask_snprintf(status, BIT3_LSR_BITS, sbuf, sizeof(sbuf));
288 printf("%s: interface error, lsr=%s\n", device_xname(&sc->sc_dev),
289 sbuf);
290 return (-1);
291 }
292 return (0);
293 }
294
295 int
296 b3_617_init(sc)
297 struct b3_617_softc *sc;
298 {
299 unsigned int i;
300
301 if (b3_617_reset(sc))
302 return (-1);
303
304 /* all maps invalid */
305 for (i = MR_PCI_VME; i < MR_PCI_VME + MR_PCI_VME_SIZE; i += 4)
306 write_mapmem(sc, i, MR_RAM_INVALID);
307 for (i = MR_VME_PCI; i < MR_VME_PCI + MR_VME_PCI_SIZE; i += 4)
308 write_mapmem(sc, i, MR_RAM_INVALID);
309 for (i = MR_DMA_PCI; i < MR_DMA_PCI + MR_DMA_PCI_SIZE; i += 4)
310 write_mapmem(sc, i, MR_RAM_INVALID);
311
312 /*
313 * set up scatter page allocation control
314 */
315 sc->vmeext = extent_create("pcivme", MR_PCI_VME,
316 MR_PCI_VME + MR_PCI_VME_SIZE - 1, M_DEVBUF,
317 sc->vmemap, sizeof(sc->vmemap),
318 EX_NOCOALESCE);
319 #if 0
320 sc->pciext = extent_create("vmepci", MR_VME_PCI,
321 MR_VME_PCI + MR_VME_PCI_SIZE - 1, M_DEVBUF,
322 sc->pcimap, sizeof(sc->pcimap),
323 EX_NOCOALESCE);
324 sc->dmaext = extent_create("dmapci", MR_DMA_PCI,
325 MR_DMA_PCI + MR_DMA_PCI_SIZE - 1, M_DEVBUF,
326 sc->dmamap, sizeof(sc->dmamap),
327 EX_NOCOALESCE);
328 #endif
329
330 /*
331 * init int handler queue,
332 * enable interrupts if PCI interrupt available
333 */
334 TAILQ_INIT(&(sc->intrhdls));
335 sc->strayintrs = 0;
336
337 if (sc->sc_ih)
338 write_csr_byte(sc, LOC_INT_CTRL, LIC_INT_ENABLE);
339 /* no error ints */
340 write_csr_byte(sc, REM_CMD2, 0); /* enables VME IRQ */
341
342 return (0);
343 }
344
345 #ifdef notyet /* for detach */
346 void
347 b3_617_halt(sc)
348 struct b3_617_softc *sc;
349 {
350 /*
351 * because detach code checks for existence of children,
352 * all ressources (mappings, VME IRQs, DMA requests)
353 * should be deallocated at this point
354 */
355
356 /* disable IRQ */
357 write_csr_byte(sc, LOC_INT_CTRL, 0);
358 }
359 #endif
360
361 static void
362 b3_617_vmeintr(sc, lstat)
363 struct b3_617_softc *sc;
364 unsigned char lstat;
365 {
366 int level;
367
368 for (level = 7; level >= 1; level--) {
369 unsigned char vector;
370 struct b3_617_vmeintrhand *ih;
371 int found;
372
373 if (!(lstat & (1 << level)))
374 continue;
375
376 write_csr_byte(sc, REM_CMD1, level);
377 vector = read_csr_byte(sc, REM_IACK);
378
379 found = 0;
380
381 for (ih = sc->intrhdls.tqh_first; ih;
382 ih = ih->ih_next.tqe_next) {
383 if ((ih->ih_level == level) &&
384 ((ih->ih_vector == -1) ||
385 (ih->ih_vector == vector))) {
386 int s, res;
387 /*
388 * We should raise the interrupt level
389 * to ih->ih_prior here. How to do this
390 * machine-independently?
391 * To be safe, raise to the maximum.
392 */
393 s = splhigh();
394 found |= (res = (*(ih->ih_fun))(ih->ih_arg));
395 splx(s);
396 if (res)
397 ih->ih_count++;
398 if (res == 1)
399 break;
400 }
401 }
402 if (!found)
403 sc->strayintrs++;
404 }
405 }
406
407 #define sc ((struct b3_617_softc*)vsc)
408
409 int
410 b3_617_map_vme(vsc, vmeaddr, len, am, datasizes, swap, tag, handle, resc)
411 void *vsc;
412 vme_addr_t vmeaddr;
413 vme_size_t len;
414 vme_am_t am;
415 vme_datasize_t datasizes;
416 vme_swap_t swap;
417 bus_space_tag_t *tag;
418 bus_space_handle_t *handle;
419 vme_mapresc_t *resc;
420 {
421 vme_addr_t vmebase, vmeend, va;
422 unsigned long maplen, first, i;
423 u_int32_t mapreg;
424 bus_addr_t pcibase;
425 int res;
426 struct b3_617_vmeresc *r;
427
428 /* first mapped address */
429 vmebase = vmeaddr & ~(VME_PAGESIZE - 1);
430 /* base of last mapped page */
431 vmeend = (vmeaddr + len - 1) & ~(VME_PAGESIZE - 1);
432 /* bytes in scatter table required */
433 maplen = ((vmeend - vmebase) / VME_PAGESIZE + 1) * 4;
434
435 if (extent_alloc(sc->vmeext, maplen, 4, 0, EX_FAST, &first))
436 return (ENOMEM);
437
438 /*
439 * set up adapter mapping registers
440 */
441 mapreg = (am << MR_AMOD_SHIFT) | MR_FC_RRAM | swap;
442
443 for (i = first, va = vmebase;
444 i < first + maplen;
445 i += 4, va += VME_PAGESIZE) {
446 write_mapmem(sc, i, mapreg | va);
447 #ifdef BIT3DEBUG
448 printf("mapreg@%lx=%x\n", i, read_mapmem(sc, i));
449 #endif
450 }
451
452 #ifdef DIAGNOSTIC
453 if (va != vmeend + VME_PAGESIZE)
454 panic("b3_617_map_pci_vme: botch");
455 #endif
456 /*
457 * map needed range in PCI space
458 */
459 pcibase = sc->vmepbase + (first - MR_PCI_VME) / 4 * VME_PAGESIZE
460 + (vmeaddr & (VME_PAGESIZE - 1));
461
462 if ((res = bus_space_map(sc->sc_vmet, pcibase, len, 0, handle))) {
463 for (i = first; i < first + maplen; i += 4)
464 write_mapmem(sc, i, MR_RAM_INVALID);
465 extent_free(sc->vmeext, first, maplen, 0);
466 return (res);
467 }
468
469 *tag = sc->sc_vmet;
470
471 /*
472 * save all data needed for later unmapping
473 */
474 r = malloc(sizeof(*r), M_DEVBUF, M_NOWAIT); /* XXX check! */
475 r->handle = *handle;
476 r->len = len;
477 r->firstpage = first;
478 r->maplen = maplen;
479 *resc = r;
480 return (0);
481 }
482
483 void
484 b3_617_unmap_vme(vsc, resc)
485 void *vsc;
486 vme_mapresc_t resc;
487 {
488 unsigned long i;
489 struct b3_617_vmeresc *r = resc;
490
491 /* unmap PCI window */
492 bus_space_unmap(sc->sc_vmet, r->handle, r->len);
493
494 for (i = r->firstpage; i < r->firstpage + r->maplen; i += 4)
495 write_mapmem(sc, i, MR_RAM_INVALID);
496
497 extent_free(sc->vmeext, r->firstpage, r->maplen, 0);
498
499 free(r, M_DEVBUF);
500 }
501
502 int
503 b3_617_vme_probe(vsc, addr, len, am, datasize, callback, cbarg)
504 void *vsc;
505 vme_addr_t addr;
506 vme_size_t len;
507 vme_am_t am;
508 vme_datasize_t datasize;
509 int (*callback)(void *, bus_space_tag_t, bus_space_handle_t);
510 void *cbarg;
511 {
512 bus_space_tag_t tag;
513 bus_space_handle_t handle;
514 vme_mapresc_t resc;
515 int res, i;
516 volatile u_int32_t dummy;
517 int status;
518
519 res = b3_617_map_vme(vsc, addr, len, am, 0, 0,
520 &tag, &handle, &resc);
521 if (res)
522 return (res);
523
524 if (read_csr_byte(sc, LOC_STATUS) & LSR_ERROR_MASK) {
525 printf("b3_617_vme_badaddr: error bit not clean - resetting\n");
526 write_csr_byte(sc, LOC_CMD1, LC1_CLR_ERROR);
527 }
528
529 if (callback)
530 res = (*callback)(cbarg, tag, handle);
531 else {
532 for (i = 0; i < len;) {
533 switch (datasize) {
534 case VME_D8:
535 dummy = bus_space_read_1(tag, handle, i);
536 i++;
537 break;
538 case VME_D16:
539 dummy = bus_space_read_2(tag, handle, i);
540 i += 2;
541 break;
542 case VME_D32:
543 dummy = bus_space_read_4(tag, handle, i);
544 i += 4;
545 break;
546 default:
547 panic("b3_617_vme_probe: invalid datasize %x",
548 datasize);
549 }
550 }
551 }
552
553 if ((status = read_csr_byte(sc, LOC_STATUS)) & LSR_ERROR_MASK) {
554 #ifdef BIT3DEBUG
555 printf("b3_617_vme_badaddr: caught error %x\n", status);
556 #endif
557 write_csr_byte(sc, LOC_CMD1, LC1_CLR_ERROR);
558 res = EIO;
559 }
560
561 b3_617_unmap_vme(vsc, resc);
562 return (res);
563 }
564
565 int
566 b3_617_map_vmeint(vsc, level, vector, handlep)
567 void *vsc;
568 int level, vector;
569 vme_intr_handle_t *handlep;
570 {
571 if (!sc->sc_ih) {
572 printf("%s: b3_617_map_vmeint: no IRQ\n",
573 device_xname(&sc->sc_dev));
574 return (ENXIO);
575 }
576 /*
577 * We should check whether the interface can pass this interrupt
578 * level at all, but we don't know much about the jumper setting.
579 */
580 *handlep = (void *)(long)((level << 8) | vector); /* XXX */
581 return (0);
582 }
583
584 void *
585 b3_617_establish_vmeint(vsc, handle, prior, func, arg)
586 void *vsc;
587 vme_intr_handle_t handle;
588 int prior;
589 int (*func)(void *);
590 void *arg;
591 {
592 struct b3_617_vmeintrhand *ih;
593 long lv;
594 int s;
595
596 /* no point in sleeping unless someone can free memory. */
597 ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);
598 if (ih == NULL)
599 panic("b3_617_map_vmeint: can't malloc handler info");
600
601 lv = (long)handle; /* XXX */
602
603 ih->ih_fun = func;
604 ih->ih_arg = arg;
605 ih->ih_level = lv >> 8;
606 ih->ih_vector = lv & 0xff;
607 ih->ih_prior = prior;
608 ih->ih_count = 0;
609
610 s = splhigh();
611 TAILQ_INSERT_TAIL(&(sc->intrhdls), ih, ih_next);
612 splx(s);
613
614 return (ih);
615 }
616
617 void
618 b3_617_disestablish_vmeint(vsc, cookie)
619 void *vsc;
620 void *cookie;
621 {
622 struct b3_617_vmeintrhand *ih = cookie;
623 int s;
624
625 if (!ih) {
626 printf("b3_617_unmap_vmeint: NULL arg\n");
627 return;
628 }
629
630 s = splhigh();
631 TAILQ_REMOVE(&(sc->intrhdls), ih, ih_next);
632 splx(s);
633
634 free(ih, M_DEVBUF);
635 }
636
637 int
638 b3_617_intr(vsc)
639 void *vsc;
640 {
641 int handled = 0;
642
643 /* follows ch. 5.5.5 (reordered for speed) */
644 while (read_csr_byte(sc, LOC_INT_CTRL) & LIC_INT_PENDING) {
645 unsigned char lstat;
646
647 handled = 1;
648
649 /* no error interrupts! */
650
651 lstat = read_csr_byte(sc, LDMA_CMD);
652 if ((lstat & LDC_DMA_DONE) && (lstat & LDC_DMA_INT_ENABLE)) {
653 /* DMA done indicator flag */
654 write_csr_byte(sc, LDMA_CMD, lstat & (~LDC_DMA_DONE));
655 #if 0
656 b3_617_cntlrdma_done(sc);
657 #endif
658 continue;
659 }
660
661 lstat = read_csr_byte(sc, LOC_INT_STATUS);
662 if (lstat & LIS_CINT_MASK) {
663 /* VME backplane interrupt, ch. 5.5.3 */
664 b3_617_vmeintr(sc, lstat);
665 }
666
667 /* for now, ignore "mailbox interrupts" */
668
669 lstat = read_csr_byte(sc, LOC_STATUS);
670 if (lstat & LSR_PR_STATUS) {
671 /* PR interrupt received from REMOTE */
672 write_csr_byte(sc, LOC_CMD1, LC1_CLR_PR_INT);
673 continue;
674 }
675
676 lstat = read_csr_byte(sc, REM_STATUS);
677 if (lstat & RSR_PT_STATUS) {
678 /* PT interrupt is set */
679 write_csr_byte(sc, REM_CMD1, RC1_CLR_PT_INT);
680 continue;
681 }
682 }
683 return (handled);
684 }
685
686 int
687 b3_617_dmamap_create(vsc, len, am, datasize, swap,
688 nsegs, segsz, bound,
689 flags, mapp)
690 void *vsc;
691 vme_size_t len;
692 vme_am_t am;
693 vme_datasize_t datasize;
694 vme_swap_t swap;
695 int nsegs;
696 vme_size_t segsz;
697 vme_addr_t bound;
698 int flags;
699 bus_dmamap_t *mapp;
700 {
701 return (EINVAL);
702 }
703
704 void
705 b3_617_dmamap_destroy(vsc, map)
706 void *vsc;
707 bus_dmamap_t map;
708 {
709 }
710
711 int
712 b3_617_dmamem_alloc(vsc, len, am, datasizes, swap,
713 segs, nsegs, rsegs, flags)
714 void *vsc;
715 vme_size_t len;
716 vme_am_t am;
717 vme_datasize_t datasizes;
718 vme_swap_t swap;
719 bus_dma_segment_t *segs;
720 int nsegs;
721 int *rsegs;
722 int flags;
723 {
724 return (EINVAL);
725 }
726
727 void
728 b3_617_dmamem_free(vsc, segs, nsegs)
729 void *vsc;
730 bus_dma_segment_t *segs;
731 int nsegs;
732 {
733 }
734
735 #undef sc
736