Programming工作模式: 1.首先验证CDMASR.IDLE=1(开始写) 2.如果传输完成,则产生CDMACR.IOC_IrqEn...
dma_cap_zero(my_dma_cap_mask); dma_cap_set(DMA_MEMCPY, my_dma_cap_mask);structdma_chan *my_dma_chan; dma_addr_t dma_src, dma_dst;structdma_slave_config my_dma_cfg = {0}; my_dma_chan= dma_request_channel(my_dma_cap_mask,0, NULL); my_dma_cfg.direction=DMA_MEM_TO_MEM; ...
dma_cap_zero(mask); dma_cap_set(DMA_MEMCPY, mask);//direction:memory to memorychan = dma_request_channel(mask,NULL,NULL);//request a dma channelprintk(KERN_INFO"dma channel id = %d\n",chan->chan_id); flags= DMA_CTRL_ACK |DMA_PREP_INTERRUPT; dev= chan->device;return0; }voiddma...
dma_cap_mask_tmask;dma_cap_zero(mask);dma_cap_set(DMA_MEMCPY,mask);dma_chan1=dma_request_channel(mask,NULL,NULL); DMA通道的配置 intdmaengine_slave_config(structdma_chan*chan,structdma_slave_config*config); 可以通过config结构体设置DMA通道宽度、数据传输宽带、源地址目的地址等信息。
dma_cap_set(DMA_MEMCPY, mask); channels[i].dma_chan = dma_request_channel(mask,NULL,NULL); if(!channels[i].dma_chan){ printk("dma request channel failed\n"); channels[i].used = DMA_CHN_UNUSED; gotoerror; } ret = copy_to_user((void__user *)arg, &chncfg,sizeof(struct axidma...
_cap_mask_t mask; struct dma_slave_config slave_config; struct scatterlist sg; enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT; int ret; dma_addr_t device_phys_addr; pr_info("DMA test started\n"); // Step 1: 设置DMA引擎能力掩码 dma_cap_zero(mask); dma_cap_set(...
dma_cap_set(DMA_SLAVE,mask); /*1. Init rx channel */ dws->rxchan= dma_request_channel(mask, dma_chan_filter, params); 主要就是申请DMA通道。 dma_chan_filter这个函数主要是查找你的dma传输的设备的请求信号线,其具体是在注册时填写的。
我们的dma_device结构有一个称为cap_mask的字段,其中保存了支持的各种事务类型,您需要使用dma_cap_set函数修改此掩码,其参数取决于您支持的事务类型的各种标志。 所有这些功能都在dma_transaction_type枚举中定义,位于include/linux/dmaengine.h中。 目前可用的类型有: ...
dma_cap_set(DMA_SLAVE, txclient->cap_mask); txclient->slave = txslave; dma_async_client_register(txclient); dma_async_client_chan_request(txclient); } static void as353x_nand_read_buf_hwbch4(struct mtd_info *mtd, u_char *buf, int len) ...
printk(KERN_INFO "dst = 0x%x, dma_dst = 0x%x\n",dst, dma_dst); dma_cap_zero(mask); dma_cap_set(DMA_MEMCPY, mask);//direction:memory to memory chan = dma_request_channel(mask,NULL,NULL); //request a dma channel printk(KERN_INFO "dma channel id = %d\n",chan->chan_id); fla...