2007-07-12 07:41:45 -07:00
|
|
|
/*
|
2009-09-24 07:11:24 -07:00
|
|
|
* simple DMA Implementation for Blackfin
|
2007-07-12 07:41:45 -07:00
|
|
|
*
|
2009-09-24 07:11:24 -07:00
|
|
|
* Copyright 2007-2009 Analog Devices Inc.
|
2007-07-12 07:41:45 -07:00
|
|
|
*
|
2009-09-24 07:11:24 -07:00
|
|
|
* Licensed under the GPL-2 or later.
|
2007-07-12 07:41:45 -07:00
|
|
|
*/
|
2009-09-24 07:11:24 -07:00
|
|
|
|
2008-04-23 14:23:31 -07:00
|
|
|
#include <linux/module.h>
|
|
|
|
|
2007-07-12 07:41:45 -07:00
|
|
|
#include <asm/blackfin.h>
|
|
|
|
#include <asm/dma.h>
|
|
|
|
|
2010-10-25 11:11:09 -07:00
|
|
|
struct dma_register * const dma_io_base_addr[MAX_DMA_CHANNELS] = {
|
2007-07-12 07:41:45 -07:00
|
|
|
(struct dma_register *) DMA0_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) DMA1_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) DMA2_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) DMA3_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) DMA4_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) DMA5_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) DMA6_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) DMA7_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) MDMA_D0_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) MDMA_S0_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) MDMA_D1_NEXT_DESC_PTR,
|
|
|
|
(struct dma_register *) MDMA_S1_NEXT_DESC_PTR,
|
|
|
|
};
|
2008-04-23 14:31:18 -07:00
|
|
|
EXPORT_SYMBOL(dma_io_base_addr);
|
2007-07-12 07:41:45 -07:00
|
|
|
|
2007-06-20 20:34:16 -07:00
|
|
|
int channel2irq(unsigned int channel)
|
2007-07-12 07:41:45 -07:00
|
|
|
{
|
|
|
|
int ret_irq = -1;
|
|
|
|
|
|
|
|
switch (channel) {
|
|
|
|
case CH_PPI:
|
|
|
|
ret_irq = IRQ_PPI;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CH_SPORT0_RX:
|
|
|
|
ret_irq = IRQ_SPORT0_RX;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CH_SPORT0_TX:
|
|
|
|
ret_irq = IRQ_SPORT0_TX;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CH_SPORT1_RX:
|
|
|
|
ret_irq = IRQ_SPORT1_RX;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CH_SPORT1_TX:
|
|
|
|
ret_irq = IRQ_SPORT1_TX;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CH_SPI:
|
|
|
|
ret_irq = IRQ_SPI;
|
|
|
|
break;
|
|
|
|
|
2009-07-26 17:44:25 -07:00
|
|
|
case CH_UART0_RX:
|
|
|
|
ret_irq = IRQ_UART0_RX;
|
2007-07-12 07:41:45 -07:00
|
|
|
break;
|
|
|
|
|
2009-07-26 17:44:25 -07:00
|
|
|
case CH_UART0_TX:
|
|
|
|
ret_irq = IRQ_UART0_TX;
|
2007-07-12 07:41:45 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CH_MEM_STREAM0_SRC:
|
|
|
|
case CH_MEM_STREAM0_DEST:
|
|
|
|
ret_irq = IRQ_MEM_DMA0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CH_MEM_STREAM1_SRC:
|
|
|
|
case CH_MEM_STREAM1_DEST:
|
|
|
|
ret_irq = IRQ_MEM_DMA1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret_irq;
|
|
|
|
}
|