Exemple #1
0
/* Busy-waiting for a DMA transfer
 * This has to be called before another transfer is started
 * PARAMETER
 * chan: Channel to wait for
 *
 * RETURN of non-zero means error*/
int omap3_dma_wait_for_transfer(uint32_t chan)
{
	uint32_t val;

	if (!(dma_active & (1 << chan))) {
		val = readl(&dma4_cfg->irqstatus_l[0]);
		if (!(val & chan)) {
			debug("dma: The channel you are trying to wait for "
				"was never activated - ERROR\n");
			return -1; /* channel was never active */
		}
	}

	/* all irqs on line 0 */
	while (!(readl(&dma4_cfg->irqstatus_l[0]) & (1 << chan)))
		asm("nop");

	val = readl(&dma4_cfg->chan[chan].csr);
	if ((val & CSR_TRANS_ERR) | (val & CSR_SUPERVISOR_ERR) |
			(val & CSR_MISALIGNED_ADRS_ERR)) {
		debug("err code: %X\n", val);
		debug("dma: transfer error detected\n");
		reset_irq(chan);
		return -1;
	}
	reset_irq(chan);
	return 0;
}
Exemple #2
0
void ym3802_device::device_reset()
{
	m_reg.clear();
	reset_irq(0xff);
	transmit_register_reset();
	receive_register_reset();
	reset_midi_timer();
	set_comms_mode();
}