[X]关闭

关于Miz702的AXI DMA在Linux下的问题请教

文档创建者:lanejim
浏览次数:15683
最后更新:2019-09-22
 
在Linux中使用AXI DMA发送数据,从PS发送数据到PL,PL中IP核的配置按照下面的步骤来配置
http://www.fpgadeveloper.com/2014/08/using-the-axi-dma-in-vivado.html
在裸跑中可以正常运行例子
在Linux中AXI DMA的驱动是xilinx_dma.c,驱动测试代码也是内核提供的axidmatest.c,这两个文件都是内核自带的,没有任何修改,在内核树种增加AXI DMA的设备树,使用的内核版本是xilinx官网下载的linux-xlnx-xilinx-v2016.2,运行内核的时候,提示
dmatest: Started 1 threads using dma0chan0 dma0chan1
dma0chan0-dma0c: #0: tx test timed out
dma0chan0-dma0c: #1: tx test timed out
dma0chan0-dma0c: #2: tx test timed out
dma0chan0-dma0c: #3: tx test timed out
dma0chan0-dma0c: #4: tx test timed out
dma0chan0-dma0c: terminating after 5 tests, 5 failures (status 0)

测试5次都是失败,有没有大神做过,指点一下,如何在linux中使用AXI DMA发送数据?


发表评论已发布 13

lanejim

发表于 2016-11-14 14:17:24 | 显示全部楼层

问题解决了,设备树没写对
回复

使用道具 举报

uisrc

发表于 2016-11-14 20:49:52 | 显示全部楼层

越努力越幸运!加油!
回复

使用道具 举报

jianwenchang

发表于 2016-11-18 13:17:16 | 显示全部楼层

lanejim 发表于 2016-11-14 14:17
问题解决了,设备树没写对

请问你的dts是怎么写的呢?
回复

使用道具 举报

newbee107

发表于 2017-3-21 19:36:53 | 显示全部楼层

楼主,你怎么修改的dts文件啊?我也遇到这个”tx test timed out“的问题了
回复

使用道具 举报

newbee107

发表于 2017-3-21 20:14:51 | 显示全部楼层

算了,我自己来回答吧,像楼主这样明明解决了不告诉具体方案的真是损人品....
dts应该这样写:

                axi_dma_0: dma@40400000 {
                        #dma-cells = <1>;
                        compatible = "xlnx,axi-dma-1.00.a";
                        interrupt-parent = <&intc>;
                        interrupts = <0 29 4 0 30 4>;
                        reg = <0x40400000 0x10000>;
                        xlnx,include-sg ;
                        dma-channel@40400000 {
                                compatible = "xlnx,axi-dma-mm2s-channel";
                                interrupts = <0 29 4>;
                                xlnx,datawidth = <0x20>;
                                xlnx,device-id = <0x0>;
                        };
                        dma-channel@40400030 {
                                compatible = "xlnx,axi-dma-s2mm-channel";
                                interrupts = <0 30 4>;
                                xlnx,datawidth = <0x20>;
                                xlnx,device-id = <0x0>;
                        };
                };
                axidmatest_0: axidmatest@0{
                        compatible = "xlnx,axi-dma-test-1.00.a";
                        dmas = <&axi_dma_0 0 &axi_dma_0 1>;
                        dma-names = "axidma0", "axidma1";
                };
回复

使用道具 举报

jxhekang

发表于 2017-3-31 17:28:00 | 显示全部楼层

楼上干的漂亮!
回复

使用道具 举报

开开心心做设计

发表于 2017-6-6 16:54:52 | 显示全部楼层

newbee107 发表于 2017-3-21 20:14
算了,我自己来回答吧,像楼主这样明明解决了不告诉具体方案的真是损人品....
dts应该这样写:

干的漂亮 666666666
回复

使用道具 举报

lanejim

发表于 2018-12-21 16:05:18 | 显示全部楼层

好久没来,我的解决方法,仅供参考
解决这种错误的方法是设备树没写对,正确的应该是在/zynq/xlinx-linux/linux-xlnx-xilinx-v2016.2/arch/arm/boot/dts/zynq-7000.dtsi添加,如下信息,而之前按照内核提示的添加位置有错误,之前添加的位置一直都是在amba: amba {}里面添加的,这样时钟是提示timed out,而是应该单独写一个amba_pl: amba_pl {},与amba: amba {}并列

amba_pl: amba_pl {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                ranges ;
                axi_dma_0: dma@40400000 {
                        compatible = "xlnx,axi-dma-1.00.a";
#dma-cells = <1>;
                        interrupt-parent = <&intc>;
                        interrupts = <0 29 4 0 30 4>;
                        reg = <0x40400000 0x10000>;
                        xlnx,include-sg = <1>;
                        dma-channel@40400000 {
                                dma-channels = <1>;
                                compatible = "xlnx,axi-dma-mm2s-channel";
                                interrupts = <0 29 4>;
                                xlnx,datawidth = <0x20>;
                                xlnx,device-id = <0x0>;
                        };
                        dma-channel@40400030 {
                                dma-channels = <1>;
                                compatible = "xlnx,axi-dma-s2mm-channel";
                                interrupts = <0 30 4>;
                                xlnx,datawidth = <0x20>;
                                xlnx,device-id = <0x0>;
                        };
                };
                dmatest_0: dmatest@0 {
                        compatible ="xlnx,axi-dma-test-1.00.a";
                        dmas = <&axi_dma_0 0
                                &axi_dma_0 1>;
                        dma-names = "axidma0", "axidma1";
                };
        };
回复

使用道具 举报

zynq_xiaobai

发表于 2019-9-16 15:19:43 | 显示全部楼层

newbee107 发表于 2017-3-21 20:14
算了,我自己来回答吧,像楼主这样明明解决了不告诉具体方案的真是损人品....
dts应该这样写:

你这后来实际使用过这个驱动么?还是自己编写的驱动
回复

使用道具 举报

12下一页
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则