驱动拟定完成了以下几个功能:
1、DMA一致性内存的申请,返回给用户使用;
2、DMA一致性内存的释放;
3、DMA一致性内存的映射(mmap);
4、给定源实地址和目的实地址,完成A-sync或AB-sync两种模式的DMA内存搬运,TC0~TC3可选,模式可选;
源码下载地址
http://download.csdn.net/detail/mantis_1984/7364043
1、写了个小测试程序,完成edma3驱动的验证
2、验证过程:调用edma3驱动,申请两段DMA内存,返回给用户空间,用户调用mmap,然后
将src空间置为0x5a,dst空间置为0,然后调用EDMA3实现src到dst的搬移,应用查看dst空间的结果,
确实都置为0x5a,证明edma3的搬运成功了。
3、附:部分调试信息
/opt/autorun # ./edma_test_drv &
/opt/autorun # edma3_drv WRN: edma3_drv_open
edma3_drv DEBUG: Allocated DMA phy memory: Phy Address: 0x85332000 Virtual Address :0xffc11000 Size :0x400 successfull!!
edma3_drv DEBUG: Allocated DMA phy memory: Phy Address: 0x89316000 Virtual Address :0xffc12000 Size :0x400 successfull!!
"src/edma_test_dedma3_drv DEBUG: result: 4
rv.c" line 137 [edma3_drv DEBUG:
From Callback 1: Channel 4 status is: 1
dbg]: src phyaddr:0x85332000, virtaddr: 0xffc11000
"src/edma_test_drv.c" line 140 [dbg]: dst phyaddr:0x89316000, virtaddr: 0xffc12000
"src/edma_test_drv.c" line 171 [dbg]: 0x5a
"src/edma_test_drv.c" line 171 [dbg]: 0x5a
"src/edma_test_drv.c" line 171 [dbg]: 0x5a
"src/edma_test_drv.c" line 171 [dbg]: 0x5a
"src/edma_test_drv.c" line 171 [dbg]: 0x5a
"src/edma_test_drv.c" line 171 [dbg]: 0x5a
......