embedded-linux - 设备树 : How can I change a property of a child's device node

标签 embedded-linux xilinx device-tree

我需要将驱动程序绑定(bind)到我的设备树条目。为此,我需要将设备 ID 属性从 dma-channel@00000030 设置为“1”

看来我无法覆盖这些子节点的属性。我怎样才能做到这一点?

此代码段来自的 pl.dtsi 文件无法更改,因为它是自动生成的。瞬间就会被覆盖。

我在这个问题之前做了什么

我试图覆盖所有内容,而不是仅仅更改我需要的值。但是这种方法需要一个新的节点名称,它一直有效,直到 dma 驱动程序想要将自己绑定(bind)到该节点。然后它失败了,因为虚拟文件系统条目已经存在。因此第一个问题。我怎样才能否决 child 节点的属性(property)?

[    0.207961] sysfs: cannot create duplicate filename '/bus/platform/devices/a0000000.dma'

目标是加载基于社区的 axidma 内核驱动程序。

axidma_dma.c: axidma_request_channels: 651: Unable to get slave channel 0: tx_channel.

根据 github repository 中的问题页面它意味着以下两种情况之一:未找到驱动程序或正在使用驱动程序。就我而言,它必须是第一个。 我现在的假设是节点名称应该在设备树中保持完整,以便 axidma 驱动程序能够找到它。 .

自动生成的 dtsi 文件

...我想在主文件系统-top.dts 中修改

amba_pl: amba_pl@0 {
    #address-cells = <2>;
    #size-cells = <2>;
    compatible = "simple-bus";
    ranges ;
    axi_dma_0: dma@a0000000 {
        #dma-cells = <1>;
        clock-names = "s_axi_lite_aclk", "m_axi_sg_aclk", "m_axi_mm2s_aclk", "m_axi_s2mm_aclk";
        clocks = <&clk 71>, <&clk 71>, <&clk 71>, <&clk 71>;
        compatible = "xlnx,axi-dma-1.00.a";
        interrupt-names = "mm2s_introut", "s2mm_introut";
        interrupt-parent = <&gic>;
        interrupts = <0 89 4 0 90 4>;
        reg = <0x0 0xa0000000 0x0 0x1000>;
        xlnx,addrwidth = <0x40>;
        xlnx,include-sg ;
        xlnx,sg-length-width = <0x1a>;
        dma-channel@a0000000 {
            compatible = "xlnx,axi-dma-mm2s-channel";
            dma-channels = <0x1>;
            interrupts = <0 89 4>;
            xlnx,datawidth = <0x20>;
            xlnx,device-id = <0x0>;
            xlnx,include-dre ;
        };
        dma-channel@a0000030 {
            compatible = "xlnx,axi-dma-s2mm-channel";
            dma-channels = <0x1>;
            interrupts = <0 90 4>;
            xlnx,datawidth = <0x20>;
            xlnx,device-id = <0x0>;
            xlnx,include-dre ;
        };
    };
};

最佳答案

感谢@Ian Abbot 的回答。

当下一行添加到主 dts 文件中的主 block 之后时。 (在这种情况下:system-top.dts)您甚至可以覆盖子节点属性,即使子节点具有相同的标签。

您需要包含出现该条目的源文件。 (在这种情况下:pl.dtsi)

/dts-v1/;
/include/ "pl.dtsi"

\{
    main block where other magic stuff happens;
};

&axi_dma_0 {

    dma-channel@a0000030 {

         xlnx,device-id = <0x1>; 

     }; 
};

关于embedded-linux - 设备树 : How can I change a property of a child's device node,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55692139/

相关文章:

vhdl - 如何在Xilinx中定义时钟输入

fpga - Zynq7/Zedboard : Xil_in32 alters data when reading from DRAM

fpga - UIO 设备上的 mmap EINVAL 错误

Linux 内核 : CMA & Device Tree

linux - 从 i.MX51 中的内核升级 u-boot

ruby - 嵌入式设备的动态语言?

memory-management - RAM 在 lowmem 和 highmem 之间分配

linux - 从zynqmp上传fpga代码到外设

c - 使用设备树引导主线 Linux 内核

embedded-linux - 从命令行通过/dev/mem 读取特定的内存地址