Lines Matching refs:asc

1 /*	$NetBSD: asc.c,v 1.23 2008/05/14 13:29:27 tsutsui Exp $	*/
28 __KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.23 2008/05/14 13:29:27 tsutsui Exp $");
78 CFATTACH_DECL_NEW(asc, sizeof(struct asc_softc),
125 struct asc_softc *asc = device_private(self);
126 struct ncr53c9x_softc *sc = &asc->sc_ncr53c9x;
140 asc->sc_iot = iot = ja->ja_bust;
141 asc->sc_dmat = ja->ja_dmat;
143 if (bus_space_map(iot, ja->ja_addr, ASC_NPORTS, 0, &asc->sc_ioh)) {
149 0, &asc->sc_dmaioh)) {
154 if (bus_dmamap_create(asc->sc_dmat, MAXPHYS, 1, MAXPHYS, 0,
155 BUS_DMA_ALLOCNOW | BUS_DMA_NOWAIT, &asc->sc_dmamap)) {
215 jazzio_intr_establish(ja->ja_intr, ncr53c9x_intr, asc);
229 bus_space_unmap(iot, asc->sc_dmaioh, R4030_DMA_RANGE);
231 bus_space_unmap(iot, asc->sc_ioh, ASC_NPORTS);
253 struct asc_softc *asc = (struct asc_softc *)sc;
255 return bus_space_read_1(asc->sc_iot, asc->sc_ioh, reg);
261 struct asc_softc *asc = (struct asc_softc *)sc;
263 bus_space_write_1(asc->sc_iot, asc->sc_ioh, reg, val);
276 struct asc_softc *asc = (struct asc_softc *)sc;
279 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh, R4030_DMA_ENAB, 0);
280 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh, R4030_DMA_MODE, 0);
286 struct asc_softc *asc = (struct asc_softc *)sc;
289 datain = asc->sc_datain;
293 if (asc->sc_active == 0)
299 asc->sc_active = 0;
301 if (asc->sc_dmasize == 0) {
322 NCR_DMA(("asc_dma_intr: empty asc FIFO of %d ", resid));
335 if (resid == 0 && asc->sc_dmasize == 65536 &&
342 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh, R4030_DMA_COUNT, 0);
343 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh, R4030_DMA_ENAB, 0);
344 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh, R4030_DMA_MODE, 0);
346 bus_dmamap_sync(asc->sc_dmat, asc->sc_dmamap,
347 0, asc->sc_dmamap->dm_mapsize,
349 bus_dmamap_unload(asc->sc_dmat, asc->sc_dmamap);
351 trans = asc->sc_dmasize - resid;
361 sc->sc_dev.dv_xname, trans, asc->sc_dmasize);
363 trans = asc->sc_dmasize;
371 *asc->sc_dmalen -= trans;
372 *asc->sc_dmaaddr += trans;
381 struct asc_softc *asc = (struct asc_softc *)sc;
384 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh, R4030_DMA_ENAB, 0);
385 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh, R4030_DMA_MODE, 0);
387 asc->sc_dmaaddr = addr;
388 asc->sc_dmalen = len;
389 asc->sc_dmasize = *dmasize;
390 asc->sc_datain = datain;
398 bus_dmamap_load(asc->sc_dmat, asc->sc_dmamap, *addr, *len, NULL,
402 bus_dmamap_sync(asc->sc_dmat, asc->sc_dmamap,
403 0, asc->sc_dmamap->dm_mapsize,
407 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh,
408 R4030_DMA_ADDR, asc->sc_dmamap->dm_segs[0].ds_addr);
409 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh,
410 R4030_DMA_COUNT, asc->sc_dmamap->dm_segs[0].ds_len);
411 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh,
415 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh,
417 (asc->sc_datain ? R4030_DMA_ENAB_READ : R4030_DMA_ENAB_WRITE));
425 struct asc_softc *asc = (struct asc_softc *)sc;
428 if (asc->sc_dmasize == 0)
431 asc->sc_active = 1;
437 struct asc_softc *asc = (struct asc_softc *)sc;
440 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh, R4030_DMA_ENAB, 0);
441 bus_space_write_4(asc->sc_iot, asc->sc_dmaioh, R4030_DMA_MODE, 0);
443 bus_dmamap_unload(asc->sc_dmat, asc->sc_dmamap);
445 asc->sc_active = 0;
451 struct asc_softc *asc = (struct asc_softc *)sc;
453 return asc->sc_active;