Linux DeviceTree:为什么对标签的引用没有展开?

问题描述 投票:0回答:0

我有一个 Xilinx 块设计,其中包含“AXI BRAM 控制器”(将 AXI 总线连接到块内存生成器的 Xilinx IP 核 - 此细节可能并不重要)。

我认为关键是 Xilinx 工具会自动生成一个名为

components/plnx_workspace/device-tree/device-tree/pl.dtsi
的文件,其中包含该 Core 的设备树定义:

/* components/plnx_workspace/device-tree/device-tree/pl.dtsi */
&amba {
    #address-cells = <2>;
    #size-cells = <2>;

[snip]

    axi_bram_ctrl_1: axi_bram_ctrl@a0040000 {
        clock-names = "s_axi_aclk";
        clocks = <&zynqmp_clk 71>;
        compatible = "xlnx,axi-bram-ctrl-4.1";
        reg = <0x0 0xa0040000 0x0 0x2000>;
        xlnx,bram-addr-width = <0xb>;

[snip]
};

我还有一个文件,名为

project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
,分配给用户修改,并且是编译器处理的最后一个
.dtsi

我希望使用此文件修改

axi_bram_ctrl_1
节点以启用UIO:

/* project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi */

/include/ "system-conf.dtsi"

/ {
};

&axi_bram_ctrl_1 {
    compatible = "generic-uio";
};

我的理解,基于设备树之谜#Labels,是:

对节点路径使用标签通常用于引用先前存在的节点,以便修改该节点中的一个或多个属性的值。在此示例中,修改了 reg 属性。请注意,引用放置在 .dts 文件的顶层,而不是放在节点内,因为引用已扩展为完整路径。

这是我相信我已经完成的,但是设备树编译器抛出以下错误:

Exception: subprocess.CalledProcessError: Command '['dtc', '-@', '-@', '-p', '0x1000', '-@', '-i',
    [snip lots of paths]
' returned non-zero exit status 1.

Subprocess output:
Error: build/tmp/work/xilinx_zcu208-xilinx-linux/device-tree/xilinx-v2023.1+gitAUTOINC+0bd6e466ba-r0/system-user.dtsi:173.1-17

    Label or path axi_bram_ctrl_1 not found

FATAL ERROR: Syntax error parsing input tree

这让我感到困惑,因为在活树中,我可以看到:

$ dtc -f /proc/device-tree
/ {
        [snip]

        __symbols__ {
                [snip]
                axi_bram_ctrl_1 = "/axi/axi_bram_ctrl@a0040000";

        [snip]

        axi {
                [snip]

                axi_bram_ctrl@a0040000 {
                        xlnx,single-port-bram = <0x01>;
                        xlnx,memory-depth = <0x800>;
                        clock-names = "s_axi_aclk";
                        xlnx,bram-inst-mode = "EXTERNAL";

                        [snip]

我已经看过很多这种语法的示例,它们看起来都与我在这里所做的相似。什么可能导致此失败?

reference embedded-linux xilinx device-tree petalinux
© www.soinside.com 2019 - 2024. All rights reserved.