qemu-riscv
[Top][All Lists]
Advanced

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

Re: Emulating sd card with hifive_u risc-v machine


From: Alistair Francis
Subject: Re: Emulating sd card with hifive_u risc-v machine
Date: Wed, 10 Feb 2021 14:27:32 -0800

On Wed, Feb 10, 2021 at 12:02 PM Pascal Scholz
<pascal.scholz@tu-dresden.de> wrote:
>
> Hi Alistair,
>
> thanks for your quick and helpful reply. :)
>
> I'll see, if I can try them out on the weekend and will report my results.

Great!

>
> Best regards and thanks again!

No worries!

Alistair

>
> Pascal
>
> On 08.02.21 23:49, Alistair Francis wrote:
> > On Mon, Feb 8, 2021 at 12:00 PM Pascal Scholz
> > <s6899329@msx.tu-dresden.de> wrote:
> >> Hi all,
> >>
> >> I'm hoping that I addressed the right mailing lists.
> > Hello Pascal,
> >
> > Yep, this is the right place :)
> >
> >> 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
> > Correct. There is no SD card support for the SiFive U in QEMU.
> >
> > You actually just reminded me though that someone has sent patches to
> > add support and I need to review them.
> >
> > You can find the patches here:
> > https://patchew.org/QEMU/20210126060007.12904-1-bmeng.cn@gmail.com/
> > which should work when applied to QEMU.
> >
> > If you do get a chance to test the patches it would be great if you
> > can let me know what works/doesn't work for you.
> >
> > Alistair
> >
> >> 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]