[PATCH v2] dmaengine: add CSR SiRFprimaII DMAC driver

Barry Song 21cnbao at gmail.com
Mon Sep 19 07:25:27 EDT 2011


2011/9/19 Vinod Koul <vinod.koul at intel.com>:
> On Mon, 2011-09-19 at 09:56 +0000, Barry Song wrote:
>> > > > Not sure why you support this, there seem to be no DMA_SLAVE
>> support in
>> > > > this version ate least
>> > >
>> > > Not. I support dma_slave. But I have no prep_slave_sg function
>> since I can
>> > use the gen xfer to replace it.
>> > Yes thats okay...
>> >
>> > Then I have questions on genxfer function...
>> > where are you copying either src or dstn_start address, you seem to
>> > completely ignore them?
>>
>> Since I only support memory->device or device ->memory, and channel
>> number is fixed to every device. Then I actually don't care device
>> address at all. Either src or dst is fixed to the device's address.
> peripheral address can be fixed, not the memory, where do you copy the
> memory address?

+static int sirfsoc_dma_slave_config(struct sirfsoc_dma_chan *schan,
+       struct dma_slave_config *config)
+{
+       u32 addr, direction;
+       unsigned long flags;
+
+       switch (config->direction) {
+       case DMA_FROM_DEVICE:
+               direction = 0;
+               addr = config->dst_addr;
+               break;
+
+       case DMA_TO_DEVICE:
+               direction = 1;
+               addr = config->src_addr;
+               break;
+
+       default:
+               return -EINVAL;
+       }
+  ...


+static void sirfsoc_dma_execute(struct sirfsoc_dma_chan *schan)
+{
+       ...
+       writel_relaxed(schan->addr >> 2, sdma->base + cid * 0x10 +
SIRFSOC_DMA_CH_ADDR);
+}
+

>>
>> >
>> > Do you support only slave transfers or M2M as well for this driver?
>> > If only slave you might want to check if dma_config_slave is set for
>> > this channel or not.
>>
>> I support only slave transfer. Actually I have dma_config_slave. do
>> you mean I need to check whether slave config cmd is really called
>> before executing dma?
> Yes
>
>
> --
> ~Vinod
>
>
-Barry



More information about the linux-arm-kernel mailing list