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);
}
/*
* 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html