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

Unable to Run axidmatest Petalinux

Jump to solution

I can see the axidmatest module is loaded in my kernel using lsmod, I tried unloading it and loading it using modprobe -r and modprobe, nothing appears in the console or dmesg as aresponse. I am trying to follow everything here:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842337/DMA+Drivers+-+Soft+IPs

I'm thinking it might be a device tree issue but I'm not sure

My dma is configured with loop back:

Created from Trenz Starter KitCreated from Trenz Starter KitCapture.PNG

Device Tree pl.dtsi:

 

/*
 * CAUTION: This file is automatically generated by Xilinx.
 * Version:  
 * Today is: Tue Nov  5 17:23:29 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>;
			};
			axidmatest_1: axidmatest_1@1 {
				compatible = "xlnx,axi-dma-test-1.00.a";
				dma-names = "axidma0","axidma0";
				dmas = <&axi_dma_0 0 &axi_dma_0 1>;
			};
		};
	};
};

 

Kernel Config:

 

CONFIG_DMADEVICES=y
CONFIG_DMADEVICES_DEBUG=y
CONFIG_DMADEVICES_VDEBUG=y

#
# DMA Devices
#
CONFIG_DMA_ENGINE=y
CONFIG_DMA_OF=y
# CONFIG_AMBA_PL08X is not set
# CONFIG_FSL_EDMA is not set
# CONFIG_INTEL_IDMA64 is not set
# CONFIG_MV_XOR_V2 is not set
# CONFIG_PL330_DMA is not set
CONFIG_XILINX_DMA_ENGINES=y
CONFIG_XILINX_DMATEST=m
# CONFIG_XILINX_VDMATEST is not set
# CONFIG_XILINX_CDMATEST is not set
CONFIG_XILINX_DPDMA=y
CONFIG_XILINX_DMA=y
CONFIG_XILINX_ZYNQMP_DMA=y
# CONFIG_XILINX_PS_PCIE_DMA is not set
# CONFIG_QCOM_HIDMA_MGMT is not set
# CONFIG_QCOM_HIDMA is not set
# CONFIG_DW_DMAC is not set
# CONFIG_DW_DMAC_PCI is not set

 

 

Console

root@petalinux:~# lsmod
    Not tainted
axidmatest 20480 0 - Live 0xffffff8000a86000
uio_pdrv_genirq 16384 0 - Live 0xffffff8000a60000
root@petalinux:~# modprobe axidmatest
root@petalinux:~# modprobe -r axidmatest
root@petalinux:~# modprobe axidmatest
root@petalinux:~# 

Note: Using Vivado/Petalinux 2018.3

0 Kudos
1 Solution

Accepted Solutions
galactic
Observer
Observer
1,018 Views
Registered: ‎11-01-2019

I don't recall ever getting this to work, I'm following up with where I ended up. In the end I upgraded to petalinux 2019.1 and used device tree overlays with modification as noted here: https://forums.xilinx.com/t5/Embedded-Linux/Accepted-process-for-modifying-pl-dtsi-with-device-tree-overlays/m-p/1045661#M38177. I stopped trying to get the axidmatest driver to work and instead focused on a driver created by @bperez77https://github.com/bperez77/xilinx_axidma, it ended up working.

View solution in original post

0 Kudos
7 Replies
sandeepg
Moderator
Moderator
1,405 Views
Registered: ‎04-24-2017

Hi @galactic ,

You have compiled the device-tree as overlays in this case you need to program the bitstream first and then overlays.

Follow https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841847/Solution+ZynqMP+PL+Programming

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
galactic
Observer
Observer
1,316 Views
Registered: ‎11-01-2019

Thanks, this helped but it seems I've encountered a new error. When running modprobe axidmatest I get a segmentation fault, see dmesg log:

 

[ 3466.789733] fpga_manager fpga0: writing zusys_wrapper.bit.bin to Xilinx ZynqMP FPGA Manager
[ 3466.962199] zynqmp_clk_divider_set_rate() set divider failed for pl0_ref_div1, ret = -13
[ 3466.971382] xilinx-vdma a0000000.dma: Please ensure that IP supports buffer length > 23 bits
[ 3466.980027] xilinx-vdma a0000000.dma: Xilinx AXI DMA Engine Driver Probed!!
[ 3478.546245] Unable to handle kernel NULL pointer dereference at virtual address 00000018
[ 3478.554334] Mem abort info:
[ 3478.557129]   Exception class = DABT (current EL), IL = 32 bits
[ 3478.563041]   SET = 0, FnV = 0
[ 3478.566089]   EA = 0, S1PTW = 0
[ 3478.569220] Data abort info:
[ 3478.572088]   ISV = 0, ISS = 0x00000006
[ 3478.575914]   CM = 0, WnR = 0
[ 3478.578875] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc8775e5000
[ 3478.585400] [0000000000000018] *pgd=0000000877580003, *pud=0000000877580003, *pmd=0000000000000000
[ 3478.594352] Internal error: Oops: 96000006 [#1] SMP
[ 3478.599214] Modules linked in: axidmatest(+) uio_pdrv_genirq
[ 3478.604868] CPU: 1 PID: 2295 Comm: modprobe Not tainted 4.14.0-xilinx-v2018.3 #1
[ 3478.612251] Hardware name: xlnx,zynqmp (DT)
[ 3478.616418] task: ffffffc87b16e100 task.stack: ffffff800c728000
[ 3478.622329] PC is at xilinx_axidmatest_probe+0xe0/0x498 [axidmatest]
[ 3478.628671] LR is at xilinx_axidmatest_probe+0xbc/0x498 [axidmatest]
[ 3478.635011] pc : [<ffffff8000a68f20>] lr : [<ffffff8000a68efc>] pstate: 40000145
[ 3478.642387] sp : ffffff800c72ba80
[ 3478.645686] x29: ffffff800c72ba80 x28: ffffff800eef9000 
[ 3478.650990] x27: ffffff8000a6b150 x26: 0000000000000000 
[ 3478.656293] x25: 0000000000000124 x24: ffffffc877400670 
[ 3478.661596] x23: ffffffc877479c80 x22: ffffffc877479f00 
[ 3478.666900] x21: ffffffc877479c98 x20: ffffffc877479f18 
[ 3478.672203] x19: ffffffc877479c00 x18: ffffffc87b16e200 
[ 3478.677507] x17: 00000000004a59b0 x16: 0000000000000001 
[ 3478.682810] x15: ffffff8008d1f000 x14: ffffffffffffffff 
[ 3478.688114] x13: 0000000000000038 x12: 0101010101010101 
[ 3478.693417] x11: 0000000000000037 x10: 0101010101010101 
[ 3478.698721] x9 : 0000000000000000 x8 : ffffffc877479c80 
[ 3478.704024] x7 : 0000000000000000 x6 : 000000000000003f 
[ 3478.709328] x5 : 0000000000000040 x4 : ffffffc875941180 
[ 3478.714623] x3 : ffffffc877479c00 x2 : 0000000000000000 
[ 3478.719926] x1 : 0000000000000000 x0 : ffffffc877cedc00 
[ 3478.725222] Process modprobe (pid: 2295, stack limit = 0xffffff800c728000)
[ 3478.732078] Call trace:
[ 3478.734510] Exception stack(0xffffff800c72b940 to 0xffffff800c72ba80)
[ 3478.740935] b940: ffffffc877cedc00 0000000000000000 0000000000000000 ffffffc877479c00
[ 3478.748755] b960: ffffffc875941180 0000000000000040 000000000000003f 0000000000000000
[ 3478.756567] b980: ffffffc877479c80 0000000000000000 0101010101010101 0000000000000037
[ 3478.764379] b9a0: 0101010101010101 0000000000000038 ffffffffffffffff ffffff8008d1f000
[ 3478.772191] b9c0: 0000000000000001 00000000004a59b0 ffffffc87b16e200 ffffffc877479c00
[ 3478.780003] b9e0: ffffffc877479f18 ffffffc877479c98 ffffffc877479f00 ffffffc877479c80
[ 3478.787824] ba00: ffffffc877400670 0000000000000124 0000000000000000 ffffff8000a6b150
[ 3478.795636] ba20: ffffff800eef9000 ffffff800c72ba80 ffffff8000a68efc ffffff800c72ba80
[ 3478.803448] ba40: ffffff8000a68f20 0000000040000145 ffffff800c72ba80 ffffff8000a68efc
[ 3478.811260] ba60: 0000008000000000 ffffffc877479f18 ffffff800c72ba80 ffffff8000a68f20
[ 3478.819077] [<ffffff8000a68f20>] xilinx_axidmatest_probe+0xe0/0x498 [axidmatest]
[ 3478.826462] [<ffffff8008588530>] platform_drv_probe+0x58/0xb8
[ 3478.832198] [<ffffff8008586914>] driver_probe_device+0x22c/0x2d8
[ 3478.838195] [<ffffff8008586a7c>] __driver_attach+0xbc/0xc0
[ 3478.843673] [<ffffff8008584a54>] bus_for_each_dev+0x4c/0x98
[ 3478.849235] [<ffffff8008586210>] driver_attach+0x20/0x28
[ 3478.854538] [<ffffff8008585d60>] bus_add_driver+0x1b8/0x228
[ 3478.860103] [<ffffff8008587428>] driver_register+0x60/0xf8
[ 3478.865579] [<ffffff8008588480>] __platform_driver_register+0x40/0x48
[ 3478.872007] [<ffffff8000a6e018>] axidma_init+0x18/0x1000 [axidmatest]
[ 3478.878436] [<ffffff8008083980>] do_one_initcall+0x38/0x128
[ 3478.884000] [<ffffff800810b6d0>] do_init_module+0x58/0x1b0
[ 3478.889476] [<ffffff800810a644>] load_module+0x19fc/0x2150
[ 3478.894953] [<ffffff800810ae90>] SyS_init_module+0xf8/0x178
[ 3478.900514] Exception stack(0xffffff800c72bec0 to 0xffffff800c72c000)
[ 3478.906939] bec0: 000000000f97d4b0 0000000000004790 000000000f97d490 0000000000000001
[ 3478.914751] bee0: 0000000000000000 0000000000000070 0000000000000001 0000000000000001
[ 3478.922563] bf00: 0000000000000069 0000007f7ffd0840 0101010101010101 0000000000000000
[ 3478.930375] bf20: 0000000000000001 000000000000270f 0000007f7fdb5d98 0000007f7fda8d00
[ 3478.938187] bf40: 0000007f7fe6da60 00000000004a59b0 000000000000073f 0000007f7ffd0860
[ 3478.945999] bf60: 000000000f97d4b0 000000000f97d490 000000000f97d460 000000000f97bf31
[ 3478.953811] bf80: 0000000000000001 00000000004a8000 000000000f97bf00 000000000f97c390
[ 3478.961623] bfa0: 0000000000000000 0000007fc836bb30 000000000040f368 0000007fc836b850
[ 3478.969435] bfc0: 0000007f7fe6da84 0000000080000000 000000000f97d4b0 0000000000000069
[ 3478.977247] bfe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 3478.985059] [<ffffff80080837b0>] el0_svc_naked+0x24/0x28
[ 3478.990355] Code: d5033abf f9400f00 f9402c04 b4000aa4 (f9400f40) 
[ 3478.996438] ---[ end trace 42a76ef55a8006ea ]---

 

 

 

0 Kudos
sandeepg
Moderator
Moderator
1,284 Views
Registered: ‎04-24-2017

Hi @galactic ,

Kernel tainted at modprobe, from your logs you are using vdma?

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
1,264 Views
Registered: ‎09-12-2007

AXI DMA is not getting probed correctly. Looking at the driver, the VDMA is the default:

dma.png

The interrupts dont seem to be registering.

Can you try this without overlay? Does this work?

0 Kudos
galactic
Observer
Observer
1,230 Views
Registered: ‎11-01-2019

I created a new project without overlay and sucessfully ran axidmatest, I added back overlay and it looks like I have the same problem, I modified the overlay with a patch file following instructions from this post I made: https://forums.xilinx.com/t5/Embedded-Linux/Proper-Linking-of-Linux-Device-Tree-system-user-dtsi-and-pl-dtsi/m-p/1039865#M37786.

So still it seems its a fpga manager/device tree issue. I attached a zip with a dmesg log and the patchile I used to create my device tree in my inital post.

0 Kudos
galactic
Observer
Observer
1,206 Views
Registered: ‎11-01-2019

So I saw at least one typo in the pl.dtsi that I changed, I had dma-names as axidma0 and axidma0, when they should be axidma0 and axidma1, that changes the issues I am having but it still does not work.

New pl.dtsi

/*
 * CAUTION: This file is automatically generated by Xilinx.
 * Version:  
 * Today is: Wed Nov 13 14:38:22 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";
			};
		};
	};
	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>;
					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 ;
				};
			};
			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>;
			};
			axidmatest_1: axidmatest_1@1 {
				compatible = "xlnx,axi-dma-test-1.00.a";
				dma-names = "axidma0","axidma1";
				dmas = <&axi_dma_0 0 &axi_dma_0 1>;
			};
		};
	};
};

New Errors:

root@axidmatest:/lib/firmware/base# fpgautil -b zusys_wrapper.bit.bin -o base.dtbo
[  131.859274] fpga_manager fpga0: writing zusys_wrapper.bit.bin to Xilinx ZynqMP FPGA Manager
[  132.030278] zynqmp_clk_divider_set_rate() set divider failed for pl0_ref_div1, ret = -13
[  132.038989] xilinx-vdma a0000000.dma: Please ensure that IP supports buffer length > 23 bits
[  132.047665] xilinx-vdma a0000000.dma: Xilinx AXI DMA Engine Driver Probed!!
Time taken to load DTBO is 199.000000 Milli Seconds
DTBO loaded through zynqMP FPGA manager successfully

After modprobe axidmatest:

** 1543 printk messages dropped ** [  173.824822] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500
** 1543 printk messages dropped ** [  173.836638] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500
** 1543 printk messages dropped ** [  173.848454] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500
** 1542 printk messages dropped ** [  173.860261] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500
** 1542 printk messages dropped ** [  173.872073] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500
** 1543 printk messages dropped ** [  173.883891] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500
** 1543 printk messages dropped ** [  173.895708] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500
** 1543 printk messages dropped ** [  173.907516] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500
** 1543 printk messages dropped ** [  173.919333] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500
** 1543 printk messages dropped ** [  173.931147] xilinx-vdma a0000000.dma: Channel ffffffc879513218 has errors 10, cdr 0 tdr 6fc50500

The above terminal snippet repeats forever. I am not using vdma, I have a dma configured as shown in my original post. 

0 Kudos
galactic
Observer
Observer
1,019 Views
Registered: ‎11-01-2019

I don't recall ever getting this to work, I'm following up with where I ended up. In the end I upgraded to petalinux 2019.1 and used device tree overlays with modification as noted here: https://forums.xilinx.com/t5/Embedded-Linux/Accepted-process-for-modifying-pl-dtsi-with-device-tree-overlays/m-p/1045661#M38177. I stopped trying to get the axidmatest driver to work and instead focused on a driver created by @bperez77https://github.com/bperez77/xilinx_axidma, it ended up working.

View solution in original post

0 Kudos