1

我正在为 Zynq AXI DMA 编写设备特定的 DMA 驱动程序。该驱动程序实际上是一个包装器驱动程序,并在 DMA 引擎驱动程序框架下使用 Xilinx DMA 驱动程序,如下所示:

  +------------------+
  | 包装器驱动程序 |
  +------------------+
  | DMA 框架 |
  +------------------+
  | Xilinx DMA 驱动程序|
  +------------------+
  + 内核 +
  +------------------+

我使用中断 61 完成传输,使用中断 62 完成接收。Xilinx DMA 驱动程序的中断处理程序已正确安装(我检查了 /proc/interrupts)。但是,我的驱动程序似乎没有通过向我展示这个来正确处理中断:

在此处输入图像描述

我检查了/proc/interrupts。IRQ62 未处理。这是注册中断的代码:

0986     /* find the IRQ line, if it exists in the device tree */
0987     chan->irq = irq_of_parse_and_map(node, 0);
0988     err = devm_request_irq(xdev->dev, chan->irq, dma_intr_handler,
0989                    IRQF_SHARED,
0990                    "xilinx-dma-controller", chan);

这是 cat /proc/interrupt 的输出:

在此处输入图像描述

我有两个问题:

1) 如果我只为 Xilinx DMA 驱动程序安装中断处理程序而不是包装器驱动程序,而我将包装器驱动程序用作 char 设备,Xilinx DMA 驱动程序不会处理中断?

2)如果是这样,我该如何让Xilinx DMA驱动程序来处理这种情况下的中断?'irqpoll' 是唯一的解决方案吗?与直接中断处理而不是轮询相比,是否存在任何性能问题?

4

1 回答 1

0

您的设备树不好,更准确地说,您的pl.dtsi文件不好。我的 pl 文件如下所示:

amba_pl: amba_pl {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "simple-bus";
    ranges ;
    axi_dma_0: dma@40400000 {
        compatible = "xlnx,axi-dma";
        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>;
        };
    };

};
于 2015-06-08T13:50:39.630 回答