Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QEMU can't realize the axi dma node #28

Closed
bsafwen opened this issue Apr 3, 2018 · 4 comments
Closed

QEMU can't realize the axi dma node #28

bsafwen opened this issue Apr 3, 2018 · 4 comments

Comments

@bsafwen
Copy link

bsafwen commented Apr 3, 2018

I am having an issue emulating my board, which is base on the zynq-700 board series. When I run qemu, it segfaults and dumps a core file, here is the backtrace.

I am using the 2017.3 tag for both the kernel and qemu. and here is my device tree.

The command I use to launch qemu:
/root/qemu/aarch64-softmmu/qemu-system-aarch64 -M arm-generic-fdt-7series -machine linux=on -serial /dev/null -serial mon:stdio -nographic -dtb dtree.dtb -kernel /root/linux-xlnx/arch/arm/boot/zImage -drive if=sd,format=raw,index=0,file=/root/rootfs/sd.img -append "root=/dev/mmcblk0 rw rootwait rootfstype=ext2"

@alistair23
Copy link
Contributor

Hey Safwen,

You are seeing the seg fault because your DMA node (dma@40400000) doesn't have the sg property set. You need to ensure that the sg property in the device tree points to a valid QEMU MemoryRegion (https://github.com/Xilinx/qemu/blob/master/hw/dma/xilinx_axidma.c#L609).

Have a look at a Xilinx provided DTS and you can just copy it from there.

@bsafwen
Copy link
Author

bsafwen commented Apr 5, 2018

Hi @alistair23, thank you for your answer, it no longer segfaults, but now I am stuck at
Waiting for root device /dev/mmcblk0... and then I there is this debug message "Skipping voltage switch". After some debugging, I found that this functions does not succeed:
linux-xlnx/drivers/mmc/core/sd.c: int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr)
and this function calls

> err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
>                                         pocr);
>                 if (err == -EAGAIN) {
>                         retries--;
>                         goto try_again;
>                 } else if (err) {
>                         retries = 0;
>                         goto try_again;
>                 }

here err is 25, and so this function never returns because it could not set the voltage signal.
A stupid workaround that I did, was to set err to 0 just before the check and now the kernel can load the rootfs. But it took me 5 minutes to get to the prompt login, issuing a command like ls takes at least 10 seconds.
The machine that I am testing on has 70 GB of RAM, 8 cpus, 2 cores each.

Can you reproduce this problem??:
linux-xlnx: xilinx-v2017.3

>  make xilinx_zynq_defconfig 
>  make ARCH=arm CROSS_COMPILE=arm-none-eabi- zImage dtbs

qemu-xlnx: xilinx-v2017.3

> ./configure --target-list="aarch64-softmmu,microblazeel-softmmu" --enable-fdt --disable-kvm --disable-xen
> make

qemu-system-aarch64 -M arm-generic-fdt-7series -machine linux=on -serial /dev/null -serial mon:stdio -nographic -dtb zynq-zed.dtb -kernel zImage -drive if=sd,format=raw,index=0,file=sd.img -append "root=/dev/mmcblk0 rw rootwait rootfstype=ext2"

So far, I reproduced the same behavior on all zynq boards.
Thanks @alistair23

@alistair23
Copy link
Contributor

Hey Safwen,

I don't see anything obviously wrong with what you are doing, it all looks standard in which case QEMU should not take that long to boot or to run commands. Maybe try not an SD boot (JTAG boot) to just narrow down the issue?

Unfortunately I can't help reproduce and fix the problem, you will need someone from Xilinx to help you there.

@bsafwen
Copy link
Author

bsafwen commented Apr 6, 2018

@alistair23 ok thank you, I will reach out to someone from Xilinx. thanks.

@bsafwen bsafwen closed this as completed Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants