Subject: busdma question
To: None <current-users@netbsd.org>
From: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
List: current-users
Date: 02/18/2003 16:55:19
I have problems getting my SonicVibes (sys/dev/pci/sv.c) to run. While it is a
PCI card it is not capable of DMA from/to memory above 16M (24bit).
Is there a legal way to use a function like `_bus_dmamem_alloc_range' in a
PCI driver or is it possible to use another dma_tag with this capabilities?
The code in question is (sys/dev/pci/sv.c):
380 #ifdef alpha
381 /* XXX Force allocation through the SGMAP. */
382 sc->sc_dmatag = alphabus_dma_get_tag(pa->pa_dmat, ALPHA_BUS_ISA);
383 #else
384 sc->sc_dmatag = pa->pa_dmat;
385 #endif
524 error = bus_dmamem_alloc(sc->sc_dmatag, p->size, align, 0,
525 p->segs, ARRAY_SIZE(p->segs),
526 &p->nsegs, BUS_DMA_NOWAIT);
527 if (error)
528 return (error);
529
530 error = bus_dmamem_map(sc->sc_dmatag, p->segs, p->nsegs, p->size,
531 &p->addr, BUS_DMA_NOWAIT|BUS_DMA_COHERENT);
532 if (error)
533 goto free;
534
535 error = bus_dmamap_create(sc->sc_dmatag, p->size, 1, p->size,
536 0, BUS_DMA_NOWAIT, &p->map);
537 if (error)
538 goto unmap;
539
540 error = bus_dmamap_load(sc->sc_dmatag, p->map, p->addr, p->size, NULL,
541 BUS_DMA_NOWAIT |
542 (direction == AUMODE_RECORD) ? BUS_DMA_READ : BUS_DMA_WRITE)
;
--
Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)