Home | History | Annotate | Download | only in dev

Lines Matching defs:bsc

160 	struct bztzsc_softc *bsc = device_private(self);
161 struct ncr53c9x_softc *sc = &bsc->sc_ncr53c9x;
177 bsc->sc_reg = &((volatile uint8_t *)zap->va)[0x1ff00];
178 bsc->sc_dmabase = &bsc->sc_reg[0xf0];
182 aprint_normal(": address %p", bsc->sc_reg);
228 bsc->sc_reg[0xe0] = BZTZSC_PB_LED; /* Turn LED off */
233 bsc->sc_isr.isr_intr = ncr53c9x_intr;
234 bsc->sc_isr.isr_arg = sc;
235 bsc->sc_isr.isr_ipl = 2;
236 add_isr(&bsc->sc_isr);
253 struct bztzsc_softc *bsc = (struct bztzsc_softc *)sc;
255 return bsc->sc_reg[reg * 4];
261 struct bztzsc_softc *bsc = (struct bztzsc_softc *)sc;
264 bsc->sc_reg[reg * 4] = v;
267 reg == NCR_CMD/* && bsc->sc_active*/) {
277 struct bztzsc_softc *bsc = (struct bztzsc_softc *)sc;
279 if ((bsc->sc_reg[NCR_STAT * 4] & NCRSTAT_INT) == 0)
283 bsc->sc_reg[0xe0] = 0; /* Turn LED on */
285 bsc->sc_reg[0xe0] = BZTZSC_PB_LED; /* Turn LED off */
289 bztzsc_trace[bztzsc_trace_ptr].status = bsc->sc_reg[NCR_STAT * 4];
290 bztzsc_trace[bztzsc_trace_ptr].xx = bsc->sc_reg[NCR_CMD * 4];
291 bztzsc_trace[bztzsc_trace_ptr].yy = bsc->sc_active;
301 struct bztzsc_softc *bsc = (struct bztzsc_softc *)sc;
303 bsc->sc_active = 0;
309 register struct bztzsc_softc *bsc = (struct bztzsc_softc *)sc;
313 bsc->sc_dmasize, sc->sc_espintr, sc->sc_espstat,
314 bsc->sc_reg[NCR_FFLAG * 4] & NCRFIFO_FF));
315 if (bsc->sc_active == 0) {
321 cnt = bsc->sc_reg[NCR_TCL * 4];
322 cnt += bsc->sc_reg[NCR_TCM * 4] << 8;
323 cnt += bsc->sc_reg[NCR_TCH * 4] << 16;
324 if (!bsc->sc_datain) {
325 cnt += bsc->sc_reg[NCR_FFLAG * 4] & NCRFIFO_FF;
326 bsc->sc_reg[NCR_CMD * 4] = NCRCMD_FLUSH;
328 cnt = bsc->sc_dmasize - cnt; /* number of bytes transferred */
330 if (bsc->sc_xfr_align) {
331 memcpy(*bsc->sc_dmaaddr, bsc->sc_alignbuf, cnt);
332 bsc->sc_xfr_align = 0;
334 *bsc->sc_dmaaddr += cnt;
335 *bsc->sc_pdmalen -= cnt;
336 bsc->sc_active = 0;
344 struct bztzsc_softc *bsc = (struct bztzsc_softc *)sc;
349 bsc->sc_dmaaddr = addr;
350 bsc->sc_pdmalen = len;
351 bsc->sc_datain = datain;
352 bsc->sc_dmasize = *dmasize;
361 bsc->sc_dmasize > bztzsc_max_dma)
362 bsc->sc_dmasize = bztzsc_max_dma;
365 xfer = uimin(bsc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
366 bsc->sc_xfr_align = 0;
374 bsc->sc_reg[NCR_FIFO * 4] = *ptr++;
380 pa = kvtop((void *)&bsc->sc_alignbuf);
381 xfer = bsc->sc_dmasize = uimin(xfer, sizeof(bsc->sc_alignbuf));
383 bsc->sc_xfr_align = 1;
387 while (xfer < bsc->sc_dmasize) {
390 if ((bsc->sc_dmasize - xfer) < PAGE_SIZE)
391 xfer = bsc->sc_dmasize;
399 bsc->sc_dmasize = xfer;
400 *dmasize = bsc->sc_dmasize;
401 bsc->sc_pa = pa;
404 if (bsc->sc_xfr_align) {
405 dma_cachectl(bsc->sc_alignbuf,
406 sizeof(bsc->sc_alignbuf));
409 dma_cachectl(*bsc->sc_dmaaddr, bsc->sc_dmasize);
414 if (!bsc->sc_datain)
416 bsc->sc_dmabase[12] = (uint8_t)(pa);
417 bsc->sc_dmabase[8] = (uint8_t)(pa >> 8);
418 bsc->sc_dmabase[4] = (uint8_t)(pa >> 16);
419 bsc->sc_dmabase[0] = (uint8_t)(pa >> 24);
420 bsc->sc_active = 1;
437 struct bztzsc_softc *bsc = (struct bztzsc_softc *)sc;
439 return bsc->sc_active;