资源简介
memory to memory sdma copy demo,飞思卡尔的imx6 sdma驱动mem to mem的例子
imx6 sdma内存复制驱动, linux内核3.0.35版本! SDMA例子,亲测可用
飞思卡尔的i.mx6驱动,飞思卡尔的i.mx6驱动内存到内存的sdma驱动例子,测试通过;
聚散内容到聚散内存的复制,编译方法是写一个makefile 然后设定内核编译环境的环境变量,然后 make, Makefile 内容:
obj-m += imx6_sdma_test_sg_to_sg_demo.o
all:
make -C /home/xxx/你的内核目录 SUBDIRS=$(PWD) modules
clean:
make -C /home/xxx/你的内核目录 SUBDIRS=$(PWD) clean

代码片段和文件信息
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
/*
* Copyright 2006-2012 Freescale Semiconductor Inc. All rights reserved.
*/
/*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#include
#define DEBUG
#define DEF_SG_QTY 3
#ifdef DEBUG
/* If you are writing a driver please use dev_dbg instead */
#define dev_printk(fmt args...) printk(KERN_DEBUG fmt ## args)
#else
static /*inline*/ int __attribute__ ((format (printf 1 2))) dev_printk(const char * fmt ...)
{
return 0;
}
#endif
static int gMajor; /* major number of device */
static struct class *dma_tm_class;
u32 *wbuf[DEF_SG_QTY];
u32 *rbuf[DEF_SG_QTY];
struct dma_chan *dma_m2m_chan;
struct completion dma_m2m_ok;
struct scatterlist sg[DEF_SG_QTY] sg2[DEF_SG_QTY];
#define SDMA_BUF_SIZE 40960
static bool dma_m2m_filter(struct dma_chan *chan void *param)
{
if (!imx_dma_is_general_purpose(chan))
return false;
chan->private = param;
return true;
}
int sdma_open(struct inode * inode struct file * filp)
{
int i;
dma_cap_mask_t dma_m2m_mask;
struct imx_dma_data m2m_dma_data = {0};
init_completion(&dma_m2m_ok);
dma_cap_zero(dma_m2m_mask);
dma_cap_set(DMA_SLAVE dma_m2m_mask);
m2m_dma_data.peripheral_type = IMX_DMATYPE_MEMORY;
m2m_dma_data.priority = DMA_PRIO_HIGH;
dma_m2m_chan = dma_request_channel(dma_m2m_mask dma_m2m_filter &m2m_dma_data);
if (!dma_m2m_chan) {
dev_printk(“Error opening the SDMA memory to memory channel\n“);
return -EINVAL;
}
for(i=0; i wbuf[i] = kzalloc(SDMA_BUF_SIZE GFP_DMA);
if(!wbuf[i]) {
dev_printk(“error wbuf[%d] !!!!!!!!!!!\n“ i);
return -1;
}
}
dev_printk(“kzalloc %d wbuf succeed\n“ DEF_SG_QTY);
for(i=0; i rbuf[i] = kzalloc(SDMA_BUF_SIZE GFP_DMA);
if(!rbuf[i]) {
dev_printk(“error rbuf[%d] !!!!!!!!!!!\n“ i);
return -1;
}
}
dev_printk(“kzalloc %d rbuf succeed\n“ DEF_SG_QTY);
return 0;
}
int sdma_release(struct inode * inode struct file * filp)
{
int i;
dma_release_channel(dma_m2m_cha
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8385 2017-01-19 14:37 mem_to_mem_cpy_imx6q_sdma.c
相关资源
-
imx6qSBP的jli
nk初始化脚本 - uboot到linux logo显示不间断 补丁
- imx6q ch452驱动矩阵键盘扫描
- IMX6SDLRM.pdf
- QNX SDP 6.6 BSP for the Freescale i.XM6 Solo X
- i.MX 6UltraLite数据手册-中文版
- IMX6UL的PCB文件,包含底板和核心板的
- NXP官网IMX6ULL EVK原理图和PCB源文件
- Security Reference Manual for i.MX
- 小米盒子imx6版本原理图和pcb
- IMX6ULL参考手册
- IMX6ULLRM.pdf
- IMX6ULRM.pdf
- fsl-gpu-sdk
- 飞思卡尔L3.0.35 Linux资料全套
- i.MX 6Dual6Quad Applications Processor Referen
- imx6x gpu sdk
- freescale IMX6用户手册
- IMX6Q开发手册
- i.MX 6Dual/6Quad BSP Porting Guide
- bluetooth_rtl8821cs_BT_hciattach_imx6.rar
- imx6系列处理器移植Qt5.6过程详细说明
- imx6_vpu_decode.rar
- imx6处理器EIM访问fpga
- imx6q直接从USB OTG运行uboot方法
- iMX6从uboot到linux启动完成一直保持LO
- iMX6 EIM总线驱动程序
- IMX6系列用户手册
- 荣品iMX6Q开发板i.MX6DL飞思卡尔四/双核
- IMX6_GPIOS
评论
共有 条评论