Post Go back to editing

Petalinux device-tree build error on adding a custom IP for AD9361

Category: Software
Product Number: meta-adi
Software Version: 2021_R1

I have an HDL project based on the adrv9361z7035/ccbob_cmos project with a custom IP named top_ip. The HDL version is 2021_R1, and I am using Vivado 2021.1 to generate the XSA file.

I followed the guide in README.md of meta-adi-xilinx 2021_R1, added the meta-adi-core and meta-adi-xilinx layers, selected zynq-adrv9361-z7035-bob-cmos for KERNEL_DTB, and ran petalinux-build. The Petalinux version is 2021.1. Then, I encountered the following error:

ERROR: device-tree-xilinx-v2021.1+gitAUTOINC+252758eb1f-r0 do_compile: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:devicetree_do_compile(d)
0003:
File: '/home/lunacube/work/marimo/software/components/yocto/layers/core/meta/classes/devicetree.bbclass', lineno: 131, function: devicetree_do_compile
0127: if not(os.path.isfile(dtspath)) or not(dts.endswith(".dts") or devicetree_source_is_overlay(dtspath)):
0128: continue # skip non-.dts files and non-overlay files
0129: except:
0130: continue # skip if can't determine if overlay
*** 0131: devicetree_compile(dtspath, includes, d)
0132:}
0133:
0134:devicetree_do_install() {
0135: for DTB_FILE in `ls *.dtb *.dtbo`; do
File: '/home/lunacube/work/marimo/software/components/yocto/layers/core/meta/classes/devicetree.bbclass', lineno: 119, function: devicetree_compile
0115: dtcargs += ["-i", i]
0116: dtcargs += ["-o", "{0}.{1}".format(dtname, "dtbo" if isoverlay else "dtb")]
0117: dtcargs += ["-I", "dts", "-O", "dtb", "{0}.pp".format(dts)]
0118: bb.note("Running {0}".format(" ".join(dtcargs)))
*** 0119: subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
0120:
0121:python devicetree_do_compile() {
0122: includes = expand_includes("DT_INCLUDE", d)
0123: listpath = d.getVar("DT_FILES_PATH")
File: '/home/lunacube/petalinux/2021.1/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/python3.8/subprocess.py', lineno: 512, function: run
0508: # We don't call process.wait() as .__exit__ does that for us.
0509: raise
0510: retcode = process.poll()
0511: if check and retcode:
*** 0512: raise CalledProcessError(retcode, process.args,
0513: output=stdout, stderr=stderr)
0514: return CompletedProcess(process.args, retcode, stdout, stderr)
0515:
0516:
Exception: subprocess.CalledProcessError: Command '['dtc', '-@', '-p', '0x1000', '-@', '-i', '/home/lunacube/work/marimo/software/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2021.1+gitAUTOINC+252758eb1f-r0', '-i', '/home/lunacube/work/marimo/software/build/tmp/work-shared/zynq-generic/kernel-source/scripts/dtc/include-prefixes', '-i', '/home/lunacube/work/marimo/software/project-spec/configs/../../components/plnx_workspace/device-tree/device-tree', '-o', 'system-top.dtb', '-I', 'dts', '-O', 'dtb', 'system-top.dts.pp']' returned non-zero exit status 2.

Subprocess output:
/home/lunacube/work/marimo/software/project-spec/configs/../../components/plnx_workspace/device-tree/device-tree/pl.dtsi:75.29-80.5: ERROR (phandle_references): /amba_pl/top_ip@43c00000: Reference to non-existent node or label "misc_clk_0"

/home/lunacube/work/marimo/software/project-spec/configs/../../components/plnx_workspace/device-tree/device-tree/pl.dtsi:75.29-80.5: ERROR (phandle_references): /amba_pl/top_ip@43c00000: Reference to non-existent node or label "misc_clk_0"

ERROR: Input tree has errors, aborting (use -f to force output)

The error message states there is a reference to a non-existent node or label 'misc_clk_0', although it has been properly defined in pl.dtsi.

/ {
amba_pl: amba_pl {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges ;
axi_ad9361: axi_ad9361@79020000 {
clock-names = "delay_clk", "clk", "s_axi_aclk";
clocks = <&clkc 16>, <&misc_clk_0>, <&clkc 15>;
compatible = "xlnx,axi-ad9361-1.0";
interrupt-names = "gps_pps_irq";
interrupt-parent = <&intc>;
interrupts = <0 33 4>;
reg = <0x79020000 0x10000>;
};
misc_clk_0: misc_clk_0 {
#clock-cells = <0>;
clock-frequency = <100000000>;
compatible = "fixed-clock";
};
axi_ad9361_adc_dma: axi_dmac@7c400000 {
clock-names = "s_axi_aclk", "m_dest_axi_aclk", "fifo_wr_clk";
clocks = <&clkc 15>, <&clkc 15>, <&misc_clk_0>;
compatible = "xlnx,axi-dmac-1.0";
interrupt-names = "irq";
interrupt-parent = <&intc>;
interrupts = <0 31 4>;
reg = <0x7c400000 0x1000>;
};
axi_ad9361_dac_dma: axi_dmac@7c420000 {
clock-names = "s_axi_aclk", "m_src_axi_aclk", "m_axis_aclk";
clocks = <&clkc 15>, <&clkc 15>, <&misc_clk_0>;
compatible = "xlnx,axi-dmac-1.0";
interrupt-names = "irq";
interrupt-parent = <&intc>;
interrupts = <0 32 4>;
reg = <0x7c420000 0x1000>;
};
axi_gpreg: axi_gpreg@41200000 {
clock-names = "s_axi_aclk";
clocks = <&clkc 15>;
compatible = "xlnx,axi-gpreg-1.0";
reg = <0x41200000 0x10000>;
};
axi_iic_main: i2c@41600000 {
#address-cells = <1>;
#size-cells = <0>;
clock-names = "s_axi_aclk";
clocks = <&clkc 15>;
compatible = "xlnx,axi-iic-2.1", "xlnx,xps-iic-2.00.a";
interrupt-names = "iic2intc_irpt";
interrupt-parent = <&intc>;
interrupts = <0 30 4>;
reg = <0x41600000 0x1000>;
};
axi_pz_xcvrlb: axi_xcvrlb@44a60000 {
clock-names = "s_axi_aclk";
clocks = <&clkc 15>;
compatible = "xlnx,axi-xcvrlb-1.0";
reg = <0x44a60000 0x1000>;
};
axi_sysid_0: axi_sysid@45000000 {
clock-names = "s_axi_aclk";
clocks = <&clkc 15>;
compatible = "xlnx,axi-sysid-1.0";
reg = <0x45000000 0x10000>;
};
top_ip_0: top_ip@43c00000 {
clock-names = "IPCORE_CLK", "AXI4_Lite_ACLK";
clocks = <&misc_clk_0>, <&misc_clk_0>;
compatible = "xlnx,top-ip-1.0";
reg = <0x43c00000 0x10000>;
};
};
};
/include/ "pl-delete-nodes-zynq-adrv9361-z7035-bob-cmos.dtsi"

I saw a few similar questions in the ADI EngineerZone Q&A, but none could solve the issue.

I am wondering if someone could give some advice on resolving this error.

Thank you.

Parents
  • Hi,

    The problem is that your custom IP (top_ip_0) is referencing misc_clk but we are deleting it in pl-delete-nodes-zynq-adrv9361-z7035-bob-cmos.dts. So if you remove this line, it should compile (or just redefine the node in system-user.dtsi. Maybe I should think about keeping the fixed clock nodes (we don't really need them in our internal projects but they don't arm and I see they can generate this kind of issues with custom stuff). 

    Having said the above, I would also encourage you to update to newer version as that release is no longer supported. 

    - Nuno Sá

  • Thanks for the tips. I redefined the node in system-user.dtsi, and it resolved the issue.

    /include/ "system-conf.dtsi"
    / {
    /* Add new nodes here */
    misc_clk_0: misc_clk_0 {
    #clock-cells = <0>;
    clock-frequency = <100000000>;
    compatible = "fixed-clock";
    };
    };

    /* Modify existing nodes here */
    &uart0 {
    status = "okay";
    };

Reply
  • Thanks for the tips. I redefined the node in system-user.dtsi, and it resolved the issue.

    /include/ "system-conf.dtsi"
    / {
    /* Add new nodes here */
    misc_clk_0: misc_clk_0 {
    #clock-cells = <0>;
    clock-frequency = <100000000>;
    compatible = "fixed-clock";
    };
    };

    /* Modify existing nodes here */
    &uart0 {
    status = "okay";
    };

Children
No Data