hi,all.

I am using SPI2 to access a SPI Flash for my application, the source is
changed from kernel 2.6.32-17(DVSDK4.0).

But I found the EDMA only send ONE byte ,and never send again.

the charlen=8.

>From datasheet, DMA rx and tx channel for SPI2 is 11 and 10, but I donot
know how to set the EVENTQ. For SPI0 it is 3.

I use the code following to allocate DMA:

edma_alloc_channel(11,davinci_spi_dma_rx_callback, mydata,
davinci_spi_dma->eventq);

if (r < 0) {

DBG("Unable to request DMA channel for MibSPI RX\n");

return -EAGAIN;

}

davinci_spi_dma->dma_rx_channel = r;

r = edma_alloc_channel(10,davinci_spi_dma_tx_callback,mydata,
davinci_spi_dma->eventq);

if (r < 0) {

edma_free_channel(davinci_spi_dma->dma_rx_channel);

davinci_spi_dma->dma_rx_channel = -1;

DBG("Unable to request DMA channel for MibSPI TX\n");

return -EAGAIN;

}

davinci_spi_dma->dma_tx_channel = r;

and it seems OK.

So i start DMA by these:

count=8,data_type=1,

edma_set_transfer_params(davinci_spi_dma->dma_tx_channel, data_type,

count, 1, 0, ASYNC);

edma_set_dest(davinci_spi_dma->dma_tx_channel,

tx_reg, INCR, W8BIT); /*not fifo!*/

edma_set_src(davinci_spi_dma->dma_tx_channel,

spix->tx_dma_addr, INCR, W8BIT);

edma_set_src_index(davinci_spi_dma->dma_tx_channel, data_type, 0);

edma_set_dest_index(davinci_spi_dma->dma_tx_channel, 0, 0);

edma_start(davinci_spi_dma->dma_tx_channel);

davinci_spi_set_dma_req(spix, 1); //

But the DMA only send ONE byte ,and never send more data again.

Someone has tips?Thanks!
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to