我有以下设备树节点,它是由 Xilinx PetaLinux 在正确的 dtsi 文件中自动生成的(无法修改):
axi_dma_0: dma@a0000000 {
#dma-cells = <1>;
clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", "m_axi_s2mm_aclk";
clocks = <&misc_clk_0>, <&misc_clk_0>, <&misc_clk_0>;
compatible = "xlnx,axi-dma-7.1", "xlnx,axi-dma-1.00.a";
interrupt-names = "s2mm_introut";
interrupt-parent = <&gic>;
interrupts = <0 89 4>;
reg = <0x0 0xa0000000 0x0 0x10000>;
xlnx,addrwidth = <0x28>;
xlnx,include-sg ;
xlnx,sg-length-width = <0x1a>;
dma-channel@a0000030 {
compatible = "xlnx,axi-dma-s2mm-channel";
dma-channels = <0x1>;
interrupts = <0 89 4>;
xlnx,datawidth = <0x20>;
xlnx,device-id = <0x0>;
};
}
要从 UIO 访问整个 AXI DMA 硬件,可以使用 PetaLinux 所负责的另一个自定义文件中的以下代码:
&axi_dma_0 {
compatible = "generic-uio";
linux,uio-name = "axi_dma";
};
我想做的是只让 UIO 访问dma-channel
子节点而不是整个 AXI DMA。为此,我尝试了如下操作:
&axi_dma_0 {
dma-channel@a0000030 {
compatible = "generic-uio";
linux,uio-name = "axi_dma_s2mm";
};
};
或者reg
向子节点添加空格声明dma-channel
:
&axi_dma_0 {
dma-channel@a0000030 {
reg = <0x0 0xa0000030 0x0 0x28>;
compatible = "generic-uio";
linux,uio-name = "axi_dma_s2mm";
};
};
除此之外...我无法创建文件/dev/uioX
..出了什么问题或者我缺少什么才能使它工作,或者理解为什么它不可能(如果是这样)?