]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Change DMA interface to allow adding 24xx DMA support
authorTony Lindgren <tony@atomide.com>
Fri, 28 Oct 2005 01:21:38 +0000 (04:21 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 28 Oct 2005 01:21:38 +0000 (04:21 +0300)
Change DMA interface to allow adding 24xx DMA support. Note that this
interface will change again after the 24xx DMA support has been merged.

arch/arm/plat-omap/dma.c
arch/arm/plat-omap/mcbsp.c
drivers/media/video/omap/omap16xxcam.c
drivers/mmc/omap.c
drivers/mtd/nand/omap-hw.c
drivers/net/irda/omap1610-ir.c
drivers/usb/gadget/omap_udc.c
include/asm-arm/arch-omap/dma.h
sound/arm/omap-alsa-dma.c
sound/oss/omap-audio-dma-intfc.c

index d86719d9fb60b97f06eada03e5415ecbee8048ef..26b14fb32d1caee2d40097773be27b37ba7ca83a 100644 (file)
@@ -121,7 +121,8 @@ void omap_set_dma_priority(int dst_port, int priority)
 }
 
 void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
-                                 int frame_count, int sync_mode)
+                                 int frame_count, int sync_mode,
+                                 int dma_trigger, int src_or_dst_synch)
 {
        u16 w;
 
@@ -177,9 +178,9 @@ void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
        omap_writew(w, OMAP_DMA_LCH_CTRL(lch));
 }
 
-
 void omap_set_dma_src_params(int lch, int src_port, int src_amode,
-                            unsigned long src_start)
+                            unsigned long src_start,
+                            int src_ei, int src_fi)
 {
        u16 w;
 
@@ -235,7 +236,8 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
 }
 
 void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
-                             unsigned long dest_start)
+                             unsigned long dest_start,
+                             int dst_ei, int dst_fi)
 {
        u16 w;
 
index f0172f9e4d9c4d3cae685b4a320528cc630052da..b0a393da5fc54171d94f69c3cd23affc3bb2beb6 100644 (file)
@@ -493,17 +493,20 @@ int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int leng
        omap_set_dma_transfer_params(mcbsp[id].dma_tx_lch,
                                     OMAP_DMA_DATA_TYPE_S16,
                                     length >> 1, 1,
-                                    OMAP_DMA_SYNC_ELEMENT);
+                                    OMAP_DMA_SYNC_ELEMENT,
+                                    0, 0);
 
        omap_set_dma_dest_params(mcbsp[id].dma_tx_lch,
                                 OMAP_DMA_PORT_TIPB,
                                 OMAP_DMA_AMODE_CONSTANT,
-                                mcbsp[id].io_base + OMAP_MCBSP_REG_DXR1);
+                                mcbsp[id].io_base + OMAP_MCBSP_REG_DXR1,
+                                0, 0);
 
        omap_set_dma_src_params(mcbsp[id].dma_tx_lch,
                                OMAP_DMA_PORT_EMIFF,
                                OMAP_DMA_AMODE_POST_INC,
-                               buffer);
+                               buffer,
+                               0, 0);
 
        omap_start_dma(mcbsp[id].dma_tx_lch);
        wait_for_completion(&(mcbsp[id].tx_dma_completion));
@@ -533,17 +536,20 @@ int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int leng
        omap_set_dma_transfer_params(mcbsp[id].dma_rx_lch,
                                     OMAP_DMA_DATA_TYPE_S16,
                                     length >> 1, 1,
-                                    OMAP_DMA_SYNC_ELEMENT);
+                                    OMAP_DMA_SYNC_ELEMENT,
+                                    0, 0);
 
        omap_set_dma_src_params(mcbsp[id].dma_rx_lch,
                                OMAP_DMA_PORT_TIPB,
                                OMAP_DMA_AMODE_CONSTANT,
-                               mcbsp[id].io_base + OMAP_MCBSP_REG_DRR1);
+                               mcbsp[id].io_base + OMAP_MCBSP_REG_DRR1,
+                               0, 0);
 
        omap_set_dma_dest_params(mcbsp[id].dma_rx_lch,
                                 OMAP_DMA_PORT_EMIFF,
                                 OMAP_DMA_AMODE_POST_INC,
-                                buffer);
+                                buffer,
+                                0, 0);
 
        omap_start_dma(mcbsp[id].dma_rx_lch);
        wait_for_completion(&(mcbsp[id].rx_dma_completion));
index 806c4a886e5e92b878a932bb9fa4135a69634e5b..c85851f298d965012ee96df3a281f7d995be5f0d 100644 (file)
@@ -325,18 +325,22 @@ omap16xxcam_start_dma(struct sgdma_state *sgdma,
        
        if (machine_is_omap_h3())
                omap_set_dma_src_params(dmach, OMAP_DMA_PORT_OCP_T1,
-                           OMAP_DMA_AMODE_CONSTANT, CAM_CAMDATA_REG);
+                           OMAP_DMA_AMODE_CONSTANT, CAM_CAMDATA_REG,
+                           0, 0);
        else
                omap_set_dma_src_params(dmach, OMAP_DMA_PORT_TIPB,
-                           OMAP_DMA_AMODE_CONSTANT, CAM_CAMDATA_REG);
+                           OMAP_DMA_AMODE_CONSTANT, CAM_CAMDATA_REG,
+                           0, 0);
 
        omap_set_dma_dest_params(dmach, OMAP_DMA_PORT_EMIFF,
-                            OMAP_DMA_AMODE_POST_INC, sg_dma_address(sglist));
+                            OMAP_DMA_AMODE_POST_INC, sg_dma_address(sglist),
+                            0, 0);
 
        omap_set_dma_transfer_params(dmach, OMAP_DMA_DATA_TYPE_S32,
                        FIFO_TRIGGER_LVL, 
                        sg_dma_len(sglist)/(4 * FIFO_TRIGGER_LVL), 
-                       OMAP_DMA_SYNC_FRAME);
+                       OMAP_DMA_SYNC_FRAME,
+                       0, 0);
        
 
        omap_writew(omap_readw(OMAP_DMA_CLNK_CTRL(dmach)) & ~(1<<15), 
index 7b39a4574ad00bbfe012426453e99ec0c0b23dde..ac33592bb97a3f0b52a2f433d19259898402395f 100644 (file)
@@ -704,20 +704,24 @@ mmc_omap_prepare_dma(struct mmc_omap_host *host, struct mmc_data *data)
                buf = 0x800f | ((frame - 1) << 8);
                omap_set_dma_src_params(dma_ch, OMAP_DMA_PORT_TIPB,
                                        OMAP_DMA_AMODE_CONSTANT,
-                                       data_addr);
+                                       data_addr,
+                                       0, 0);
                omap_set_dma_dest_params(dma_ch, OMAP_DMA_PORT_EMIFF,
                                        OMAP_DMA_AMODE_POST_INC,
-                                       sg_dma_address(sg));
+                                       sg_dma_address(sg),
+                                       0, 0);
                omap_set_dma_dest_data_pack(dma_ch, 1);
                omap_set_dma_dest_burst_mode(dma_ch, OMAP_DMA_DATA_BURST_4);
        } else {
                buf = 0x0f80 | ((frame - 1) << 0);
                omap_set_dma_dest_params(dma_ch, OMAP_DMA_PORT_TIPB,
                                        OMAP_DMA_AMODE_CONSTANT,
-                                       data_addr);
+                                       data_addr,
+                                       0, 0);
                omap_set_dma_src_params(dma_ch, OMAP_DMA_PORT_EMIFF,
                                        OMAP_DMA_AMODE_POST_INC,
-                                       sg_dma_address(sg));
+                                       sg_dma_address(sg),
+                                       0, 0);
                omap_set_dma_src_data_pack(dma_ch, 1);
                omap_set_dma_src_burst_mode(dma_ch, OMAP_DMA_DATA_BURST_4);
        }
@@ -728,7 +732,8 @@ mmc_omap_prepare_dma(struct mmc_omap_host *host, struct mmc_data *data)
 
        OMAP_MMC_WRITE(host->base, BUF, buf);
        omap_set_dma_transfer_params(dma_ch, OMAP_DMA_DATA_TYPE_S16,
-                       frame, count, OMAP_DMA_SYNC_FRAME);
+                       frame, count, OMAP_DMA_SYNC_FRAME,
+                       0, 0);
 }
 
 /* a scatterlist segment completed */
index abc380948c8f6b44798cf34f77a64988274962cf..6afab167e8e124abe32255dc43d883d01c38d4ae 100644 (file)
@@ -232,25 +232,30 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
        fifo_reg = NAND_BASE + NND_FIFO;
        if (is_write) {
                omap_set_dma_dest_params(dma_ch, OMAP_DMA_PORT_TIPB,
-                                        OMAP_DMA_AMODE_CONSTANT, fifo_reg);
+                                        OMAP_DMA_AMODE_CONSTANT, fifo_reg,
+                                        0, 0);
                omap_set_dma_src_params(dma_ch, OMAP_DMA_PORT_EMIFF,
                                        OMAP_DMA_AMODE_POST_INC,
-                                       virt_to_phys(addr));
+                                       virt_to_phys(addr),
+                                       0, 0);
 //             omap_set_dma_src_burst_mode(dma_ch, OMAP_DMA_DATA_BURST_4);
                /* Set POSTWRITE bit */
                nand_write_reg(NND_CTRL, nand_read_reg(NND_CTRL) | (1 << 16));
        } else {
                omap_set_dma_src_params(dma_ch, OMAP_DMA_PORT_TIPB,
-                                       OMAP_DMA_AMODE_CONSTANT, fifo_reg);
+                                       OMAP_DMA_AMODE_CONSTANT, fifo_reg,
+                                       0, 0);
                omap_set_dma_dest_params(dma_ch, OMAP_DMA_PORT_EMIFF,
                                         OMAP_DMA_AMODE_POST_INC,
-                                        virt_to_phys(addr));
+                                        virt_to_phys(addr),
+                                        0, 0);
 //             omap_set_dma_dest_burst_mode(dma_ch, OMAP_DMA_DATA_BURST_8);
                /* Set PREFETCH bit */
                nand_write_reg(NND_CTRL, nand_read_reg(NND_CTRL) | (1 << 17));
        }
        omap_set_dma_transfer_params(dma_ch, OMAP_DMA_DATA_TYPE_S32, block_size / 4,
-                                    block_count, OMAP_DMA_SYNC_FRAME);
+                                    block_count, OMAP_DMA_SYNC_FRAME,
+                                    0, 0);
        init_completion(&comp);
 
        len = u32_count << 2;
index 1ee7229c88b3fff5c681b807a61f6c5a009aed9a..1bfbb4ed47694d7da8a6ef568404a36ab94f72ac 100644 (file)
@@ -166,14 +166,16 @@ static int omap1610_irda_set_speed(struct net_device *dev, int speed);
 static void omap1610_irda_start_rx_dma(struct omap1610_irda *si)
 {
        /* Configure DMA */
-       omap_set_dma_src_params(si->rx_dma_channel, 0x3, 0x0, (unsigned long)UART3_RHR);
+       omap_set_dma_src_params(si->rx_dma_channel, 0x3, 0x0, (unsigned long)UART3_RHR,
+                               0, 0);
 
        omap_enable_dma_irq(si->rx_dma_channel, 0x01);
 
        omap_set_dma_dest_params(si->rx_dma_channel, 0x0, 0x1,
-                                si->rx_buf_dma_phys);
+                                si->rx_buf_dma_phys,
+                                0, 0);
 
-       omap_set_dma_transfer_params(si->rx_dma_channel, 0x0, 4096, 0x1, 0x0);
+       omap_set_dma_transfer_params(si->rx_dma_channel, 0x0, 4096, 0x1, 0x0, 0, 0);
 
        omap_start_dma(si->rx_dma_channel);
 }
@@ -183,14 +185,15 @@ static void omap1610_start_tx_dma(struct omap1610_irda *si, int size)
        __ECHO_IN;
 
        /* Configure DMA */
-       omap_set_dma_dest_params(si->tx_dma_channel, 0x03, 0x0, (unsigned long)UART3_THR);
-
+       omap_set_dma_dest_params(si->tx_dma_channel, 0x03, 0x0, (unsigned long)UART3_THR,
+                                       0, 0);
        omap_enable_dma_irq(si->tx_dma_channel, 0x01);
 
        omap_set_dma_src_params(si->tx_dma_channel, 0x0, 0x1,
-                               si->tx_buf_dma_phys);
+                               si->tx_buf_dma_phys,
+                               0, 0);
 
-       omap_set_dma_transfer_params(si->tx_dma_channel, 0x0, size, 0x1, 0x0);
+       omap_set_dma_transfer_params(si->tx_dma_channel, 0x0, size, 0x1, 0x0, 0, 0);
 
        HDBG1(1);
 
index d1b797bff9c1cf955cb2948ed24e5dc16551615d..e2144979fa0f58997bc1282c48e77b5094adf417 100644 (file)
@@ -622,17 +622,19 @@ static void next_in_dma(struct omap_ep *ep, struct omap_req *req)
                        || (cpu_is_omap15xx() && length < ep->maxpacket)) {
                txdma_ctrl = UDC_TXN_EOT | length;
                omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S8,
-                               length, 1, sync_mode);
+                               length, 1, sync_mode, 0, 0);
        } else {
                length = min(length / ep->maxpacket,
                                (unsigned) UDC_TXN_TSC + 1);
                txdma_ctrl = length;
                omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16,
-                               ep->ep.maxpacket >> 1, length, sync_mode);
+                               ep->ep.maxpacket >> 1, length, sync_mode,
+                               0, 0);
                length *= ep->maxpacket;
        }
        omap_set_dma_src_params(ep->lch, OMAP_DMA_PORT_EMIFF,
-               OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual);
+               OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual,
+               0, 0);
 
        omap_start_dma(ep->lch);
        ep->dma_counter = dma_csac(ep->lch);
@@ -677,9 +679,11 @@ static void next_out_dma(struct omap_ep *ep, struct omap_req *req)
        req->dma_bytes = packets * ep->ep.maxpacket;
        omap_set_dma_transfer_params(ep->lch, OMAP_DMA_DATA_TYPE_S16,
                        ep->ep.maxpacket >> 1, packets,
-                       OMAP_DMA_SYNC_ELEMENT);
+                       OMAP_DMA_SYNC_ELEMENT,
+                       0, 0);
        omap_set_dma_dest_params(ep->lch, OMAP_DMA_PORT_EMIFF,
-               OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual);
+               OMAP_DMA_AMODE_POST_INC, req->req.dma + req->req.actual,
+               0, 0);
        ep->dma_counter = DMA_DEST_LAST(ep->lch);
 
        UDC_RXDMA_REG(ep->dma_channel) = UDC_RXN_STOP | (packets - 1);
@@ -822,7 +826,8 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
                        omap_set_dma_dest_params(ep->lch,
                                OMAP_DMA_PORT_TIPB,
                                OMAP_DMA_AMODE_CONSTANT,
-                               (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG));
+                               (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG),
+                               0, 0);
                }
        } else {
                status = omap_request_dma(OMAP_DMA_USB_W2FC_RX0 - 1 + channel,
@@ -833,7 +838,8 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
                        omap_set_dma_src_params(ep->lch,
                                OMAP_DMA_PORT_TIPB,
                                OMAP_DMA_AMODE_CONSTANT,
-                               (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG));
+                               (unsigned long) io_v2p((u32)&UDC_DATA_DMA_REG),
+                               0, 0);
                        /* EMIFF */
                        omap_set_dma_dest_burst_mode(ep->lch,
                                                OMAP_DMA_DATA_BURST_4);
index 04ebef5c6e95d180142d3e25e938630705b4341c..32bc554b50544cb6e8ce9f6f85614fbbda745edf 100644 (file)
@@ -217,19 +217,22 @@ extern void omap_start_dma(int lch);
 extern void omap_stop_dma(int lch);
 extern void omap_set_dma_transfer_params(int lch, int data_type,
                                         int elem_count, int frame_count,
-                                        int sync_mode);
+                                        int sync_mode,
+                                        int dma_trigger, int src_or_dst_synch);
 extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
                                    u32 color);
 
 extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
-                                   unsigned long src_start);
+                                   unsigned long src_start,
+                                   int src_ei, int src_fi);
 extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
 extern void omap_set_dma_src_data_pack(int lch, int enable);
 extern void omap_set_dma_src_burst_mode(int lch,
                                        enum omap_dma_burst_mode burst_mode);
 
 extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
-                                    unsigned long dest_start);
+                                    unsigned long dest_start,
+                                    int dst_ei, int dst_fi);
 extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
 extern void omap_set_dma_dest_data_pack(int lch, int enable);
 extern void omap_set_dma_dest_burst_mode(int lch,
index abb1bc4e86536a4baddec3e8e026ad83b86a0196..7028577889d127c7216de305cd576eb48c8b7532 100644 (file)
@@ -325,9 +325,11 @@ static int audio_set_dma_params_play(int channel, dma_addr_t dma_ptr,
        int cfn = dma_size / (2 * cen);
        FN_IN;
        omap_set_dma_dest_params(channel, 0x05, 0x00,
-                                (OMAP1610_MCBSP1_BASE + 0x806));
-       omap_set_dma_src_params(channel, 0x00, 0x01, dma_ptr);
-       omap_set_dma_transfer_params(channel, dt, cen, cfn, 0x00);
+                                (OMAP1610_MCBSP1_BASE + 0x806),
+                                0, 0);
+       omap_set_dma_src_params(channel, 0x00, 0x01, dma_ptr,
+                               0, 0);
+       omap_set_dma_transfer_params(channel, dt, cen, cfn, 0x00, 0, 0);
        FN_OUT(0);
        return 0;
 }
@@ -341,9 +343,10 @@ static int audio_set_dma_params_capture(int channel, dma_addr_t dma_ptr,
        int cfn = dma_size / (2 * cen);
        FN_IN;
        omap_set_dma_src_params(channel, 0x05, 0x00,
-                               (OMAP1610_MCBSP1_BASE + 0x802));
-       omap_set_dma_dest_params(channel, 0x00, 0x01, dma_ptr);
-       omap_set_dma_transfer_params(channel, dt, cen, cfn, 0x00);
+                               (OMAP1610_MCBSP1_BASE + 0x802),
+                               0, 0);
+       omap_set_dma_dest_params(channel, 0x00, 0x01, dma_ptr, 0, 0);
+       omap_set_dma_transfer_params(channel, dt, cen, cfn, 0x00, 0, 0);
        FN_OUT(0);
        return 0;
 }
index bc0df23410c240c8b233a0ea16f8118732199725..2bd61073d7acd18f5b845ba5d7e86511441a81dc 100644 (file)
@@ -701,9 +701,10 @@ static int audio_set_dma_params_play(int channel, dma_addr_t dma_ptr,
        int cfn = dma_size / (2 * cen);
        FN_IN;
        omap_set_dma_dest_params(channel, 0x05, 0x00,
-                                (OMAP1610_MCBSP1_BASE + 0x806));
-       omap_set_dma_src_params(channel, 0x00, 0x01, dma_ptr);
-       omap_set_dma_transfer_params(channel, dt, cen, cfn, 0x00);
+                                (OMAP1610_MCBSP1_BASE + 0x806),
+                                0, 0);
+       omap_set_dma_src_params(channel, 0x00, 0x01, dma_ptr, 0, 0);
+       omap_set_dma_transfer_params(channel, dt, cen, cfn, 0x00, 0, 0);
        FN_OUT(0);
        return 0;
 }
@@ -716,9 +717,10 @@ static int audio_set_dma_params_capture(int channel, dma_addr_t dma_ptr,
        int cfn = dma_size / (2 * cen);
        FN_IN;
        omap_set_dma_src_params(channel, 0x05, 0x00,
-                               (OMAP1610_MCBSP1_BASE + 0x802));
-       omap_set_dma_dest_params(channel, 0x00, 0x01, dma_ptr);
-       omap_set_dma_transfer_params(channel, dt, cen, cfn, 0x00);
+                               (OMAP1610_MCBSP1_BASE + 0x802),
+                               0, 0);
+       omap_set_dma_dest_params(channel, 0x00, 0x01, dma_ptr, 0, 0);
+       omap_set_dma_transfer_params(channel, dt, cen, cfn, 0x00, 0, 0);
        FN_OUT(0);
        return 0;
 }