qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emulating sd card with hifive_u risc-v machine


From: Pascal Scholz
Subject: Emulating sd card with hifive_u risc-v machine
Date: Mon, 8 Feb 2021 14:47:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

Hi all,

I'm hoping that I addressed the right mailing lists.

I'm working a bit with qemu's risc-v emulation. My current goal is to simulate a complete boot process for the SiFive Unleashed Board (SU 540 SoC)[1]. I've created the correspondig OpenSBI and U-Boot images, being the -bios and the -kernel images. It's possible for me to boot up to the U-Boot prompt. From this prompt I now want to boot an system image located on an emulated sd card.

However I now fail to get a working sd card within qemu for the device sifive_u. For example i tried the following command:

qemu-system-riscv64 -M sifive_u -m 8G -serial stdio -bios build/platform/sifive/fu540/firmware/fw_jump.bin -kernel ../../u-boot/u-boot.bin -device sdhci-pci -device sd-card,drive=sdX -drive id=sdX,if=none,format=raw,file=path/to/image.elf

This results in Qemu telling me: -device sdhci-pci: No 'PCI' bus found for device 'sdhci-pci'.

Using the machine "virt" the command above works.

The thing i tried was:

qemu-system-riscv64 -M sifive_u -m 8G -serial stdio -bios opensbi/build/platform/sifive/fu540/firmware/fw_jump.bin -kernel ../u-boot/u-boot.bin -sd path/to/image.elf

Resulting in: machine type does not support if=sd,bus=0,unit=0


Even if the machine gets stuck at some point when booting, Qemu has no problem starting the VM if I use "-M virt" instead of "-M sifive_u". At this point i think, that the machine "sifive_u" doesn't support sd cards? Is this guess right or is there anything left I can try? After all I'm a bit confused, because there seems to be a block device "sd0" when I try to start the machine "sifive_u" without any additional device/drive arguments. I would really appreciate if someone would tell me, what I'm doing wrong.

Thanks in advance and stay healthy!

Best regards

Pascal


[1] https://www.sifive.com/boards/hifive-unleashed




reply via email to

[Prev in Thread] Current Thread [Next in Thread]