cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hpoetzl
Voyager
Voyager
3,040 Views
Registered: ‎06-24-2013

Recent Xilinx Kernel (xilinx-v2017.1) fails to detect SD card in Xilinx QEMU

 

For some reason the xilinx-v2017.1 branch of the kernel fails to detect the SD card in QEMU and thus is unable to mount the root filesystem. Here is a small script which builds the kernel and QEMU from the Xilinx sources and creates an SD card image from Arch Linux for the Zedboard.

 

qemu-xlnx.git/aarch64-softmmu/qemu-system-aarch64 -M arm-generic-fdt-7series -machine linux=on -serial /dev/null -serial mon:stdio -nographic -dtb BOOT.fs/devicetree.dtb -kernel BOOT.fs/zImage -drive if=sd,format=raw,index=0,file=IMAGE.dd -boot mode=5 -append "root=/dev/mmcblk0p2 ro rootwait rootfstype=ext4"

 

The xilinx-v2016.4 branch boots up just fine with the same script.

 

Any idea what changed between those branches or what I'm missing here?

 

Thanks in advance,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
2 Replies
nanortemis
Visitor
Visitor
3,005 Views
Registered: ‎06-21-2017

Yes,

 

Same here, xilinx-v2016.04 works fine

mmc0: new SDHC card at address 4567
mmcblk0: mmc0:4567 QEMU! 7.40 GiB

 

but xilinx-v2017.1 does not

Waiting for root device /dev/mmcblk0p2...
mmc0: Skipping voltage switch

Regards,

 

0 Kudos
safweneful
Visitor
Visitor
1,905 Views
Registered: ‎03-31-2018

After 10 hours of debugging, I found the problem to be in linux-xlnx/drivers/mmc/core/sd.c : the mmc_sd_get_cid() function calls mmc_set_signal_voltage() which always return an error, the modification I did was to set the return code of the function to zero, so that  mmc_sd_get_cid() thinks it succeeded and bam, QEMU now is able to mount the rootfs successfully =).

Please let me reiterate my gratitude for your post, I was desperate and you motivated me to dig deeper.

Safwene Software engineer
0 Kudos