cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
galactic
Observer
Observer
3,981 Views
Registered: ‎11-01-2019

Proper Linking of Linux Device Tree system-user.dtsi and pl.dtsi

Jump to solution

I'm having trouble liking the axidmatest device tree node to the dma device tree node in the generated pl.dtsi file. It returns an error:

 

Log data follows:
| DEBUG: Executing shell function do_compile
| pl.dtbo: Warning (reg_format): "reg" property in /fragment@2/__overlay__/dma@a0000000 has invalid length (16 bytes) (#address-cells == 2, #size-cells == 1)
| pl.dtbo: Warning (reg_format): "reg" property in /fragment@2/__overlay__/PERIPHERAL@ff380000 has invalid length (16 bytes) (#address-cells == 2, #size-cells == 1)
| pl.dtbo: Warning (reg_format): "reg" property in /fragment@2/__overlay__/PERIPHERAL@ff990000 has invalid length (16 bytes) (#address-cells == 2, #size-cells == 1)
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@1 has a unit name, but no reg property
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@2 has a unit name, but no reg property
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@2/__overlay__/dma@a0000000/dma-channel@a0000000 has a unit name, but no reg property
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@2/__overlay__/dma@a0000000/dma-channel@a0000030 has a unit name, but no reg property
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #address-cells value for /fragment@2/__overlay__/dma@a0000000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #size-cells value for /fragment@2/__overlay__/dma@a0000000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #address-cells value for /fragment@2/__overlay__/PERIPHERAL@ff380000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #size-cells value for /fragment@2/__overlay__/PERIPHERAL@ff380000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #address-cells value for /fragment@2/__overlay__/PERIPHERAL@ff990000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #size-cells value for /fragment@2/__overlay__/PERIPHERAL@ff990000
| system-top.dtb: ERROR (phandle_references): Reference to non-existent node or label "axi_dma_0"
|
| system-top.dtb: ERROR (phandle_references): Reference to non-existent node or label "axi_dma_0"

 

Adding /include/ "pl.dtsi" to the system-user.dtsi returns a syntax error at the "/dts-v1/;" line of the pl.dtsi file.

Log data follows:
| DEBUG: Executing shell function do_compile
| pl.dtbo: Warning (reg_format): "reg" property in /fragment@2/__overlay__/dma@a0000000 has invalid length (16 bytes) (#address-cells == 2, #size-cells == 1)
| pl.dtbo: Warning (reg_format): "reg" property in /fragment@2/__overlay__/PERIPHERAL@ff380000 has invalid length (16 bytes) (#address-cells == 2, #size-cells == 1)
| pl.dtbo: Warning (reg_format): "reg" property in /fragment@2/__overlay__/PERIPHERAL@ff990000 has invalid length (16 bytes) (#address-cells == 2, #size-cells == 1)
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@1 has a unit name, but no reg property
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@2 has a unit name, but no reg property
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@2/__overlay__/dma@a0000000/dma-channel@a0000000 has a unit name, but no reg property
| pl.dtbo: Warning (unit_address_vs_reg): Node /fragment@2/__overlay__/dma@a0000000/dma-channel@a0000030 has a unit name, but no reg property
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #address-cells value for /fragment@2/__overlay__/dma@a0000000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #size-cells value for /fragment@2/__overlay__/dma@a0000000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #address-cells value for /fragment@2/__overlay__/PERIPHERAL@ff380000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #size-cells value for /fragment@2/__overlay__/PERIPHERAL@ff380000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #address-cells value for /fragment@2/__overlay__/PERIPHERAL@ff990000
| pl.dtbo: Warning (avoid_default_addr_size): Relying on default #size-cells value for /fragment@2/__overlay__/PERIPHERAL@ff990000
| Error: /home/sandman/hdl/petalinux/build/../components/plnx_workspace/device-tree/device-tree/pl.dtsi:8.1-9 syntax error
| FATAL ERROR: Unable to parse input tree
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/sandman/hdl/petalinux/build/tmp/work/plnx_zynqmp-xilinx-linux/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/temp/log.do_compile.32222)

What is the proper way to link these two device tree nodes?

 

system-user.dtsi

 

/include/ "system-conf.dtsi"
/ {
		axidmatest_1: axidmatest@1 {
                     compatible ="xlnx,axi-dma-test-1.00.a";
                     dmas = <&axi_dma_0 0
                             &axi_dma_0 1>;
                     dma-names = "axidma0", "axidma1";
		};

};
/* notes:
serdes: // PHY TYP see: dt-bindings/phy/phy.h
*/

/* default */

/* SD */

&sdhci1 {
	// disable-wp;
	no-1-8-v;

};

/*PCIE*/
&pcie {
     phys = <&lane0 2 0 2 100000000>;  //not recognized at the moment on linux
};

/* DP */ 
&zynqmp_dpsub {
    phys = <&lane3 5 0 3 27000000>; //Xilinx default is 5 (UFS), 6 (DP) does not work
};

/* SATA */

&sata {
    phys = <&lane2 1 0 1 150000000>;  //TE0808,TE0807
    //phys = <&lane2 1 0 0 150000000>; //TE0803
};


/* USB  */


&dwc3_0 {
    status = "okay";
    dr_mode = "host";
    snps,usb3_lpm_capable;
    snps,dis_u3_susphy_quirk;
    snps,dis_u2_susphy_quirk;
    phy-names = "usb2-phy","usb3-phy";
    phys = <&lane1 4 0 2 100000000>;
    maximum-speed = "super-speed";
};

/* ETH PHY */

&gem3 {
	phy-handle = <&phy0>;
	phy0: phy0@1 {
		device_type = "ethernet-phy";
		reg = <1>;
	};
};

/* QSPI */

&qspi {
    #address-cells = <1>;
    #size-cells = <0>;
    status = "okay";
    flash0: flash@0 {
        compatible = "jedec,spi-nor";
        reg = <0x0>;
        #address-cells = <1>;
        #size-cells = <1>;
    };
};

/* I2C */

&i2c0 {
    i2cswitch@73 { // u
        compatible = "nxp,pca9548";
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0x73>;
        i2c-mux-idle-disconnect;

        i2c@2 { // PCIe
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <2>;
        };
        i2c@3 { // i2c SFP
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <3>;
        };
        i2c@4 { // i2c SFP
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <4>;
        };
        i2c@5 { // i2c EEPROM
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <5>;
        };
        i2c@6 { // i2c FMC
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <6>;

            si570_2: clock-generator3@5d {
                #clock-cells = <0>;
                compatible = "silabs,si570";
                reg = <0x5d>;
                temperature-stability = <50>;
                factory-fout = <156250000>;
                clock-frequency = <78800000>;
            };
        };
        i2c@7 { // i2c USB HUB
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <7>;
        };
    };
    i2cswitch@77 { // u
        compatible = "nxp,pca9548";
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0x77>;
        i2c-mux-idle-disconnect;
        i2c@0 { // i2c PMOD
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0>;
        };
        i2c@1 { // i2c Audio Codec
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <1>;
			/*
            adau1761: adau1761@38 {
                compatible = "adi,adau1761";
                reg = <0x38>;
            };
			*/
        };
        i2c@2 { // i2c FireFly A
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <2>;
        };
        i2c@3 { // i2c FireFly B
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <3>;
        };
        i2c@4 { // i2c PLL
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <4>;
        };
        i2c@5 { // i2c SC
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <5>;
        };
        i2c@6 { // i2c
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <6>;
        };
        i2c@7 { // i2c
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <7>;
        };
    };
};

pl.dtsi

 

 

/*
 * CAUTION: This file is automatically generated by Xilinx.
 * Version:  
 * Today is: Fri Nov  1 14:20:30 2019
 */


/dts-v1/;
/plugin/;
/ {
	fragment@0 {
		target = <&fpga_full>;
		overlay0: __overlay__ {
			#address-cells = <2>;
			#size-cells = <2>;
			firmware-name = "zusys_wrapper.bit.bin";
			resets = <&rst 116>;
		};
	};
	fragment@1 {
		target = <&amba>;
		overlay1: __overlay__ {
			afi0: afi0 {
				compatible = "xlnx,afi-fpga";
				config-afi = < 0 0>, <1 0>, <2 0>, <3 0>, <4 0>, <5 0>, <6 0>, <7 0>, <8 0>, <9 0>, <10 0>, <11 0>, <12 0>, <13 0>, <14 0>, <14 0>, <15 0x000>;
			};
			clocking0: clocking0 {
				#clock-cells = <0>;
				assigned-clock-rates = <99999985>;
				assigned-clocks = <&clk 71>;
				clock-output-names = "fabric_clk";
				clocks = <&clk 71>;
				compatible = "xlnx,fclk";
			};
			clocking1: clocking1 {
				#clock-cells = <0>;
				assigned-clock-rates = <24999996>;
				assigned-clocks = <&clk 72>;
				clock-output-names = "fabric_clk";
				clocks = <&clk 72>;
				compatible = "xlnx,fclk";
			};
		};
	};
	fragment@2 {
		target = <&amba>;
		overlay2: __overlay__ {
			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-7.1", "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>;
				};
				dma-channel@a0000030 {
					compatible = "xlnx,axi-dma-s2mm-channel";
					dma-channels = <0x1>;
					interrupts = <0 90 4>;
					xlnx,datawidth = <0x20>;
					xlnx,device-id = <0x0>;
				};
			};
			psu_ctrl_ipi: PERIPHERAL@ff380000 {
				compatible = "xlnx,PERIPHERAL-1.0";
				reg = <0x0 0xff380000 0x0 0x80000>;
			};
			psu_message_buffers: PERIPHERAL@ff990000 {
				compatible = "xlnx,PERIPHERAL-1.0";
				reg = <0x0 0xff990000 0x0 0x10000>;
			};
		};
	};
};

 

 

0 Kudos
1 Solution

Accepted Solutions
stephenm
Xilinx Employee
Xilinx Employee
3,917 Views
Registered: ‎09-12-2007

I have attached a DTG patch here that you can use. I have updated he axi_dma node TCL to add the dmatest:

set add_dmatest [get_property CONFIG.add_dmatest [get_os]]
if {$add_dmatest} {
#generate the dmatest node
add_dmatest $drv_handle
}
}

proc add_dmatest {drv_handle} {
set dts_file [current_dt_tree]
set bus_node [add_or_get_bus_node $drv_handle $dts_file]
set dmatest [add_or_get_dt_node -n "axidmatest_1" -l axidmatest_1 -u 0 -p $bus_node]
hsi::utils::add_new_dts_param $dmatest "compatible" "xlnx,axi-dma-test-1.00.a" string
hsi::utils::add_new_dts_param $dmatest "dmas" "axi_dma_0 0 &axi_dma_0 1" reference
hsi::utils::add_new_dts_param $dmatest "dma-names" "axidma0, axidma1" string
}

The steps to create DTG patch are shown here:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/136904764/Creating+Devicetree+from+Devicetree+Generator+for+Zynq+Ultrascale+and+Zynq+7000

 

Note: I added the param:

set add_dmatest [get_property CONFIG.add_dmatest [get_os]]

This would need to be passed via a YAML prameter in the bbappend.

 

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://system-user.dtsi"
SRC_URI_append += "file://0001_add_dmatest_node.patch"

#Add BSP flags for dtg
YAML_BSP_CONFIG += "add_dmatest"
YAML_BSP_CONFIG[add_dmatest] = "set,true"

 

So, copy the patch into the project-spec\meta-user\recipes-bsp\device-tree\files, and make the changes to the bbappend similar to above.

Then preform the steps below to verify:

  • petalinux-build -x mrproper
  • petalinux-build -c device-tree

This should result in the pl.dtsi as shown below:

dmatest.PNG

View solution in original post

20 Replies
stephenm
Xilinx Employee
Xilinx Employee
3,970 Views
Registered: ‎09-12-2007

The problem here is that when you have the DT overlay enabled you can no longer update the nodes (in the pl.dtsi anyway) in the system-user.dtsi, as the labels wont exist.

So, there is two ways to workaround this.

To manually compile (with the axi dmatest node added) the DT blob, and manually create the FIT image (image.ub)

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/136904764/Creating+Devicetree+from+Devicetree+Generator+for+Zynq+Ultrascale+and+Zynq+7000

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841722/ZCU102+Image+creation+in+OSL+flow

Or, patch the DTG to add the dmatest node.

 

Can you send your HDF?

0 Kudos
galactic
Observer
Observer
3,966 Views
Registered: ‎11-01-2019

HDF attached it was configured using a trenz startkit template and adding a dma thats looped back into itself. 

As shown here:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842418/Linux+DMA+From+User+Space

0 Kudos
galactic
Observer
Observer
3,962 Views
Registered: ‎11-01-2019

the hdf did not attach, attaching as a .zip

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
3,918 Views
Registered: ‎09-12-2007

I have attached a DTG patch here that you can use. I have updated he axi_dma node TCL to add the dmatest:

set add_dmatest [get_property CONFIG.add_dmatest [get_os]]
if {$add_dmatest} {
#generate the dmatest node
add_dmatest $drv_handle
}
}

proc add_dmatest {drv_handle} {
set dts_file [current_dt_tree]
set bus_node [add_or_get_bus_node $drv_handle $dts_file]
set dmatest [add_or_get_dt_node -n "axidmatest_1" -l axidmatest_1 -u 0 -p $bus_node]
hsi::utils::add_new_dts_param $dmatest "compatible" "xlnx,axi-dma-test-1.00.a" string
hsi::utils::add_new_dts_param $dmatest "dmas" "axi_dma_0 0 &axi_dma_0 1" reference
hsi::utils::add_new_dts_param $dmatest "dma-names" "axidma0, axidma1" string
}

The steps to create DTG patch are shown here:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/136904764/Creating+Devicetree+from+Devicetree+Generator+for+Zynq+Ultrascale+and+Zynq+7000

 

Note: I added the param:

set add_dmatest [get_property CONFIG.add_dmatest [get_os]]

This would need to be passed via a YAML prameter in the bbappend.

 

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://system-user.dtsi"
SRC_URI_append += "file://0001_add_dmatest_node.patch"

#Add BSP flags for dtg
YAML_BSP_CONFIG += "add_dmatest"
YAML_BSP_CONFIG[add_dmatest] = "set,true"

 

So, copy the patch into the project-spec\meta-user\recipes-bsp\device-tree\files, and make the changes to the bbappend similar to above.

Then preform the steps below to verify:

  • petalinux-build -x mrproper
  • petalinux-build -c device-tree

This should result in the pl.dtsi as shown below:

dmatest.PNG

View solution in original post

galactic
Observer
Observer
3,759 Views
Registered: ‎11-01-2019

I understand what needs to be done but it looks like the patch file did not work right. I'm not sure how you generated the patch file but here are my build errors.

petalinux-build log:

ERROR: device-tree-xilinx+gitAUTOINC+b7466bbeee-r0 do_patch: Command Error: 'quilt --quiltrc /home/sandman/hdl/petalinux/build/tmp/work/plnx_zynqmp-xilinx-linux/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch 0001_add_dmatest_node.patch
patching file axi_dma/data/axi_dma.tcl
Hunk #2 succeeded at 116 (offset -2 lines).
patching file device_tree/data/device_tree.mld
Hunk #1 FAILED at 33.
1 out of 1 hunk FAILED -- rejects in file device_tree/data/device_tree.mld
Patch 0001_add_dmatest_node.patch does not apply (enforce with -f)
ERROR: device-tree-xilinx+gitAUTOINC+b7466bbeee-r0 do_patch: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: /home/sandman/hdl/petalinux/build/tmp/work/plnx_zynqmp-xilinx-linux/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/temp/log.do_patch.3104
ERROR: Task (/home/sandman/opt/petalinux_2018.3/components/yocto/source/aarch64/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_patch) failed with exit code '1'

From log.do_patch.3101:

NOTE: Applying patch '0001_add_dmatest_node.patch' (../project-spec/meta-user/recipes-bsp/device-tree/files/0001_add_dmatest_node.patch)
ERROR: Command Error: 'quilt --quiltrc /home/sandman/hdl/petalinux/build/tmp/work/plnx_zynqmp-xilinx-linux/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch 0001_add_dmatest_node.patch
patching file axi_dma/data/axi_dma.tcl
Hunk #2 succeeded at 116 (offset -2 lines).
patching file device_tree/data/device_tree.mld
Hunk #1 FAILED at 33.
1 out of 1 hunk FAILED -- rejects in file device_tree/data/device_tree.mld
Patch 0001_add_dmatest_node.patch does not apply (enforce with -f)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished
ERROR: Function failed: patch_do_patch

Attached also is my axi_dma.tcl file. 

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
3,749 Views
Registered: ‎09-12-2007
0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
3,739 Views
Registered: ‎09-12-2007

I took your HDF file above, and tested with my patch in Petalinux 2019.1

  • petalinux-create -t project --template zynqMP -n test_linux
  • cd test_linux
  • petalinux-config --get-hw-description=<path to your hdf file>
  • copy the patch into test_linux/project-spec/meta-user/recipes-bsp/device-tree/files
  • Update the bbappend as shown below
  • petalinux-build

This works for me

 

bbappend:

 

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://system-user.dtsi"
SRC_URI_append += "file://0001_add_dmatest_node.patch"

#Add BSP flags for dtg
YAML_BSP_CONFIG += "add_dmatest"
YAML_BSP_CONFIG[add_dmatest] = "set,true"

0 Kudos
galactic
Observer
Observer
3,672 Views
Registered: ‎11-01-2019

Solved, I was using petalinux 2018.3, I pulled the dtg source from https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/136904764/Creating+Devicetree+from+Devicetree+Generator+for+Zynq+Ultrascale+and+Zynq+7000 and checked out the xilinx-v2018.3 tag, then made the changes to axi_dma.tcl noted in the accepted solution to generate my own patch file and add it to my petalinux build

0 Kudos
jrhtech
Voyager
Voyager
3,646 Views
Registered: ‎10-04-2017

I think it is better to solve it one of these two ways since they are not design specific

1) disable the fpga_manager if you are not using overlays

2) apply this patch to the devicetree so it works with overlays

diff --git a/device_tree/data/common_proc.tcl b/device_tree/data/common_proc.tcl
index f6d3f4c..2481073 100644
--- a/device_tree/data/common_proc.tcl
+++ b/device_tree/data/common_proc.tcl
@@ -393,6 +393,9 @@ proc check_node_in_dts {node_name dts_file_list} {
 }
 
 proc get_node_object {lu_node {dts_files ""} {error_out "yes"}} {
+	if {[get_property CONFIG.dt_overlay [get_os]] == "TRUE" && $lu_node == "amba_pl"} {
+		set lu_node "overlay2"
+	}
 	# get the node object based on the args
 	# returns the dt node object
 	proc_called_by

 

jeff

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
3,633 Views
Registered: ‎09-12-2007

I tried htis on my end, and it results in the same error:

dto.PNG

 

my test script is attached

0 Kudos
chengjiang
Visitor
Visitor
1,719 Views
Registered: ‎11-11-2020

dma-names = "axidma0", "axidma1";  is right  

dma-names = "axidma0 , axidma1"; is wrong

how to change frome dma-names = "axidma0 , axidma1";  to dma-names = "axidma0", "axidma1";

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
1,717 Views
Registered: ‎09-12-2007

Users can modify the nodes created in the dtg in Petalinux in the system-user.dtsi file.

0 Kudos
chengjiang
Visitor
Visitor
1,709 Views
Registered: ‎11-11-2020
Could you provide me a new 0001_add_dmatest_node.patch that changes from dma-names = "axidma0 , axidma1"; to dma-names = "axidma0", "axidma1";
Because i can no longer update the nodes (in the pl.dtsi anyway) in the system-user.dtsi
0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
1,701 Views
Registered: ‎09-12-2007

I no longer have this patch. However, the recommended flow is to do this in the system-user.dtsi. 

 

What do you mean you can no longer update the system-user.dtsi?

0 Kudos
chengjiang
Visitor
Visitor
1,692 Views
Registered: ‎11-11-2020
I try to change in system-user.dtsi

/include/ "system-conf.dtsi"
/ {
};


&gem3 {
status = "okay";
local-mac-address = [00 0a 35 00 02 90];
phy-mode = "rgmii-id";
phy-handle = <&phy0>;
phy0: phy@c {
reg = <0xc>;
ti,rx-internal-delay = <0x8>;
ti,tx-internal-delay = <0xa>;
ti,fifo-depth = <0x1>;
};
};
axidmatest_1: axidmatest_1@0 {
compatible = "xlnx,axi-dma-test-1.00.a";
dma-names = "axidma0", "axidma1";
dmas = <&axi_dma_0 0 &axi_dma_0 1>;
};



my pl.dtsi content:

*
* CAUTION: This file is automatically generated by Xilinx.
* Version:
* Today is: Fri Nov 27 10:27:27 2020
*/


/ {
amba_pl: amba_pl@0 {
#address-cells = <2>;
#size-cells = <2>;
compatible = "simple-bus";
ranges ;
axi_dma_0: dma@80000000 {
#dma-cells = <1>;
clock-names = "s_axi_lite_aclk", "m_axi_mm2s_aclk", "m_axi_s2mm_aclk";
clocks = <&zynqmp_clk 71>, <&zynqmp_clk 71>, <&zynqmp_clk 71>;
compatible = "xlnx,axi-dma-7.1", "xlnx,axi-dma-1.00.a";
interrupt-names = "mm2s_introut", "s2mm_introut";
interrupt-parent = <&gic>;
interrupts = <0 89 4 0 90 4>;
reg = <0x0 0x80000000 0x0 0x10000>;
xlnx,addrwidth = <0x20>;
xlnx,sg-length-width = <0xe>;
dma-channel@80000000 {
compatible = "xlnx,axi-dma-mm2s-channel";
dma-channels = <0x1>;
interrupts = <0 89 4>;
xlnx,datawidth = <0x20>;
xlnx,device-id = <0x0>;
};
dma-channel@80000030 {
compatible = "xlnx,axi-dma-s2mm-channel";
dma-channels = <0x1>;
interrupts = <0 90 4>;
xlnx,datawidth = <0x20>;
xlnx,device-id = <0x0>;
};
};
axidmatest_1: axidmatest_1@0 {
compatible = "xlnx,axi-dma-test-1.00.a";
dma-names = "axidma0, axidma1";
dmas = <&axi_dma_0 0 &axi_dma_0 1>;
};
};
};

log error:

river@ubuntu:~/peta_prj/testlinxPsBase/petalinux$ petalinux-build -c decvice-tree
INFO: sourcing build tools
[INFO] building decvice-tree
[INFO] sourcing build environment
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake decvice-tree
Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:02
Loaded 4228 entries from dependency cache.
Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:11
Parsing of 2962 .bb files complete (2959 cached, 3 parsed). 4231 targets, 168 skipped, 0 masked, 0 errors.
ERROR: Nothing PROVIDES 'decvice-tree'. Close matches:
device-tree
qemu-devicetrees

Summary: There was 1 ERROR message shown, returning a non-zero exit code.
0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
1,690 Views
Registered: ‎09-12-2007

Looks like a typo:

This should be

petalinux-build -c device-tree

0 Kudos
chengjiang
Visitor
Visitor
1,684 Views
Registered: ‎11-11-2020
river@ubuntu:~/peta_prj/testlinxPsBase/petalinux$ petalinux-build -c device-tree
INFO: sourcing build tools
[INFO] building device-tree
[INFO] sourcing build environment
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake virtual/dtb
Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:02
Loaded 4228 entries from dependency cache.
Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:12
Parsing of 2962 .bb files complete (2959 cached, 3 parsed). 4231 targets, 168 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
WARNING: /home/river/peta_prj/testlinxPsBase/petalinux/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2020.1.bb:do_compile is tainted from a forced run | ETA: 0:00:02
WARNING: /home/river/peta_prj/testlinxPsBase/petalinux/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx_2020.1.bb:do_compile is tainted from a forced run
Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:05
Checking sstate mirror object availability: 100% |###########################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 141 Found 12 Missed 129 Current 832 (8% match, 86% complete)
NOTE: Executing Tasks
NOTE: Setscene tasks completed
ERROR: device-tree-xilinx-v2020.1+gitAUTOINC+bc84458333-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/river/peta_prj/testlinxPsBase/petalinux/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/river/peta_prj/testlinxPsBase/petalinux/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: '/opt/pkg/petalinux/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/python3.7/subprocess.py', lineno: 512, function: run
0508: raise
0509: retcode = process.poll()
0510: if check and retcode:
0511: raise CalledProcessError(retcode, process.args,
*** 0512: output=stdout, stderr=stderr)
0513: return CompletedProcess(process.args, retcode, stdout, stderr)
0514:
0515:
0516:def list2cmdline(seq):
Exception: subprocess.CalledProcessError: Command '['dtc', '-@', '-p', '0x1000', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work/zynqmp_generic-xilinx-linux/device-tree/xilinx-v2020.1+gitAUTOINC+bc84458333-r0', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/al', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/xilinx', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/actions', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/intel', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/project-spec/configs/../../components/plnx_workspace/device-tree/device-tree', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/marvell', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/altera', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/realtek', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/sprd', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/include', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/hisilicon', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/nvidia', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/qcom', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/ti', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/synaptics', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/scripts/dtc/include-prefixes', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/exynos', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/zte', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/cavium', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/freescale', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/broadcom', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/mediatek', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/lg', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/socionext', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/amd', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/rockchip', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/bitmain', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/arm', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/amlogic', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/apm', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/renesas', '-i', '/home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work-shared/zynqmp-generic/kernel-source/arch/arm64/boot/dts/allwinner', '-o', 'system-top.dtb', '-I', 'dts', '-O', 'dtb', 'system-top.dts.pp']' returned non-zero exit status 1.

Subprocess output:
Error: /home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work/zynqmp_generic-xilinx-linux/device-tree/xilinx-v2020.1+gitAUTOINC+bc84458333-r0/system-user.dtsi:18.15-29 syntax error
FATAL ERROR: Unable to parse input tree

ERROR: Logfile of failure stored in: /home/river/peta_prj/testlinxPsBase/petalinux/build/tmp/work/zynqmp_generic-xilinx-linux/device-tree/xilinx-v2020.1+gitAUTOINC+bc84458333-r0/temp/log.do_compile.91962
ERROR: Task (/home/river/peta_prj/testlinxPsBase/petalinux/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2976 tasks of which 2968 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/river/peta_prj/testlinxPsBase/petalinux/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile
Summary: There were 2 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
ERROR: Failed to build device-tree
0 Kudos
chengjiang
Visitor
Visitor
1,667 Views
Registered: ‎11-11-2020
Could you tell me why i cann't derectly add node
axidmatest_1: axidmatest_1@0 {
compatible = "xlnx,axi-dma-test-1.00.a";
dma-names = "axidma0", "axidma1";
dmas = <&axi_dma_0 0 &axi_dma_0 1>;
};
in my system-user.dtsi.

I have to add that node with 0001_add_dmatest_node.patch
0 Kudos
chengjiang
Visitor
Visitor
1,650 Views
Registered: ‎11-11-2020
 
0 Kudos
chengjiang
Visitor
Visitor
1,645 Views
Registered: ‎11-11-2020

i use the patch below to generate 

 compatible = "xlnx,axi-dma-test-1.00.a";
dma-names = "axidma0, axidma1";
dmas = <&axi_dma_0 0 &axi_dma_0 1>;
};

in pl.dtsi

0 Kudos