Пример #1
0
void dma_start(int ch, unsigned int srcAddr, unsigned int dstAddr,
               unsigned int count)
{
    //set_dma_addr
    REG_DMAC_DSAR(ch) = PHYSADDR(srcAddr);
    REG_DMAC_DDAR(ch) = PHYSADDR(dstAddr);
    //set_dma_count
    REG_DMAC_DTCR(ch) = count / dma_unit_size[ch];
    //enable_dma
    REG_DMAC_DCCSR(ch) |= DMAC_DCCSR_NDES; /* No-descriptor transfer */
    __dmac_enable_channel(ch);
    if (dma_irq[ch])
        __dmac_channel_enable_irq(ch);
}
Пример #2
0
void dma_start(int ch, unsigned int srcAddr, unsigned int dstAddr,
	       unsigned int count)
{
//	printf("dma gao start1\n");
	dma_stop(ch);
	//set_dma_addr
	REG_DMAC_DSAR(ch) = srcAddr;
	REG_DMAC_DDAR(ch) = dstAddr;
	//set_dma_count
	REG_DMAC_DTCR(ch) = count / dma_unit_size[ch];
	//enable_dma
	REG_DMAC_DCMD(ch) = dma_mode[ch];
	REG_DMAC_DCCSR(ch) &= ~(DMAC_DCCSR_HLT|DMAC_DCCSR_TC|DMAC_DCCSR_AR);
	REG_DMAC_DCCSR(ch) |= DMAC_DCCSR_NDES; /* No-descriptor transfer */
	__dmac_enable_channel(ch);
	if (dma_irq[ch])
		__dmac_channel_enable_irq(ch);
}