On Thu, Oct 29, 2009 at 9:44 PM, Sergey Lapin <slapinid@xxxxxxxxx> wrote: > Hi, all! > > I need to transfer block of data using sDMA from memory address > to RFBI_PARAM FIFO, so to put that into display module. > > I do this like this: > > /* DMA */ > #define RFBI_BASE 0x48050800 > #define RFBI_PARAM 0x0050 > static void configure_dma(int dma_ch, u32 data, int size) > { > int nblk; > omap_set_dma_dest_params(dma_ch, 0, OMAP_DMA_AMODE_CONSTANT, > (RFBI_BASE + RFBI_PARAM), 0, 0); > omap_set_dma_src_params(dma_ch, 0, OMAP_DMA_AMODE_POST_INC, > data, 0, 0); > nblk = (size + PAGE_SIZE - 1) / PAGE_SIZE; > omap_set_dma_transfer_params(dma_ch, OMAP_DMA_DATA_TYPE_S8, > PAGE_SIZE, nblk, OMAP_DMA_SYNC_FRAME, 0, 0); > omap_start_dma(dma_ch); > } Just making sure, do you want to use DMA to configure just a single register ? According to your code, you want to transfer "data" to the configuration register called RFBI_PARAM, and not the FIFO. Assuming you want just that, I think you need to use 32 bit element size. The registers can be read or written in 32 bit mode only. So use OMAP_DMA_DATA_TYPE_S32, instead of OMAP_DMA_DATA_TYPE_S8. Again, if you use CONSTANT addressing mode for destination, the destination address will not be auto-incremented. Hence the only outcome of this transfer would be that the last 4 bytes of "data" would reside in RFBI_PARAM register, if you get to that. > > /* > * DMA call back function > */ > static void hx8340_dma_cb(int lch, u16 ch_status, void *data) > { > if (ch_status & OMAP2_DMA_MISALIGNED_ERR_IRQ) > dev_dbg(hx8340.fbdev->dev, "Misaligned access\n"); > if (hx8340.dma_ch < 0) > return; > omap_free_dma(hx8340.dma_ch); > hx8340.dma_ch = -1; > } > > /* data is physical address of buffer */ > static int transfer_dma(u32 data, int size) > { > int ret = 0; > int i; > if (hx8340.dma_ch != -1) { > set_current_state(TASK_UNINTERRUPTIBLE); > schedule_timeout(100); > omap_free_dma(hx8340.dma_ch); > return ret; > } > ret = omap_request_dma(OMAP34XX_DSS_DMA3, "HX8340", > hx8340_dma_cb, NULL, &hx8340.dma_ch); > if (ret != 0) { > printk("HX8340: dma request failure\n"); > return ret; > } > configure_dma(hx8340.dma_ch, data, size); > return 0; > } > But all I get is > DMA transaction error with device 75 > > Is what I try to achieve at all possible? At RFBI part of CPU > datasheet it is mentioned it is possible using sDMA > to write these registers. So, is there some examples? I tried to use > drivers/mmc/host/omap_hsmmc.c as example, > but that seems to be not enough. Any ideas? > > S. Do you want examples for configuring DMA in general, or configuring RFBI ? There are many modules in drivers which use DMA ( USB, McBSP, etc). Venkat -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html