UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor sdhunna
Visitor
7,465 Views
Registered: ‎06-12-2015

Qemu Axi DMA Driver Fails to Load

I have a microzed project that works on the microzed with respect to running the Xilinx AXI DMA test.

According to the petlinux guide, Qemu supports the AXI DMA IP.

 

I tried starting a qemu session but the linux driver failed to load:

petalinux-boot --qemu --kernel

 

root@MZ7020_2015_2_1:~# dmesg | grep axidma
root@MZ7020_2015_2_1:~# dmesg | grep dma
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac: DBUFF-256x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
xilinx-dma 44000000.dma: Invalid channel compatible node
xilinx-dma 44000000.dma: Probing channels failed
xilinx-dma: probe of 44000000.dma failed with error -22

 

I suspect this is because the kernel option doesn't include the bitstream so the driver fails to load.  Is there a way to do that?

0 Kudos
11 Replies
Participant pete_128
Participant
7,460 Views
Registered: ‎04-02-2016

Re: Qemu Axi DMA Driver Fails to Load

So QEMU doesn't handle bitstreams, and instead just models what it can based on your DTB. Does your DTB contain your DMA peripheral?

Visitor sdhunna
Visitor
7,456 Views
Registered: ‎06-12-2015

Re: Qemu Axi DMA Driver Fails to Load

The pl.dtsi file contains it.  It got generated when I did the --get-hw-description.  I'm not sure if qemu see's the dtb file, unless there's a way to pass it during the command?

 

/ {
amba_pl: amba_pl {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges ;
axi_dma_0: dma@44000000 {
compatible = "xlnx,axi-dma";
interrupt-parent = <&intc>;
interrupts = <0 29 4 0 30 4>;
reg = <0x44000000 0x1000>;
xlnx,include-sg ;
dma-channel@44000000 {
compatible = "xlnx,axi-dma-mm2s-channel";
interrupts = <0 29 4>;
xlnx,datawidth = <0x20>;
xlnx,device-id = <0x0>;
};
dma-channel@44000030 {
compatible = "xlnx,axi-dma-s2mm-channel";
interrupts = <0 30 4>;
xlnx,datawidth = <0x20>;
xlnx,device-id = <0x0>;
};
};
};
};

0 Kudos
Participant pete_128
Participant
7,453 Views
Registered: ‎04-02-2016

Re: Qemu Axi DMA Driver Fails to Load

QEMU must be passes a dtb, otherwise it doesnt know what system to create. It may just be getting a stock PS DTS though. Does petalinux-boot --help provide an option for dtb override? You may need to roll pl.dtsi in with the PS dts and pass it all to QEMU.

0 Kudos
Visitor sdhunna
Visitor
7,444 Views
Registered: ‎06-12-2015

Re: Qemu Axi DMA Driver Fails to Load

It seems to be in there:

 

root@MZ7020_2015_2_1:/proc/device-tree/amba_pl# ls
#address-cells compatible name
#size-cells dma@44000000 ranges

0 Kudos
Participant pete_128
Participant
7,440 Views
Registered: ‎04-02-2016

Re: Qemu Axi DMA Driver Fails to Load

QEMU has the capability to use separate DTBs for hw instantiation and the kernel. Can we see the full QEMU command line?

0 Kudos
Visitor sdhunna
Visitor
7,437 Views
Registered: ‎06-12-2015

Re: Qemu Axi DMA Driver Fails to Load

That's how I started it:

petalinux-boot --qemu --kernel

0 Kudos
Participant pete_128
Participant
7,390 Views
Registered: ‎04-02-2016

Re: Qemu Axi DMA Driver Fails to Load

Yeh that will in turn call the QEMU executable which has a command line format of its own. The qemu executable is qemu-system-*.

0 Kudos
Visitor sdhunna
Visitor
7,375 Views
Registered: ‎06-12-2015

Re: Qemu Axi DMA Driver Fails to Load

Ok, I see.  Here it is:

INFO: Starting arm QEMU

INFO: qemu-system-aarch64 -L /opt/petalinux/petalinux-v2015.2.1-final/etc/qemu -M arm-generic-fdt-plnx -machine linux=on -serial /dev/null -serial mon:stdio -display none -kernel /home/user1/MicroZedBsp/MZ7020_2015_2_1/build/qemu_image.elf -gdb tcp::9000 -dtb /home/user1/MicroZedBsp/MZ7020_2015_2_1/images/linux/system.dtb -tftp /tftpboot

0 Kudos
Participant pete_128
Participant
7,367 Views
Registered: ‎04-02-2016

Re: Qemu Axi DMA Driver Fails to Load

Ok, so it is using only one dtb which means same for software and hardware. In QEMU hit ctrl-a then C and type info qtree to see if your DMA hardware is there. If not QEMU is ignoring your dtb nodes for some reason.

0 Kudos
Visitor sdhunna
Visitor
5,301 Views
Registered: ‎06-12-2015

Re: Qemu Axi DMA Driver Fails to Load

(qemu) info qtree
bus: main-system-bus
type System
dev: a9-scu, id ""
num-cpu = 2 (0x2)
dev: arm.pl35x, id ""
x = 3 (0x3)
(qemu)

0 Kudos
Observer edu30692
Observer
2,731 Views
Registered: ‎11-25-2016

Re: Qemu Axi DMA Driver Fails to Load

Hi, I have the same problem. Did you managed to solve it?

0 Kudos