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: Bin Meng
Subject: Re: Emulating sd card with hifive_u risc-v machine
Date: Sun, 14 Feb 2021 13:05:07 +0800

Hi Pascal,

On Thu, Feb 11, 2021 at 5:47 AM 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.
>
> Best regards and thanks again!
>
> 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.

Yep, your goal is now satisfied with the patch series Alistair pointed
out, along with one more dependent series (see below)

> >>
> >> 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.

Note you will also need to apply the following SD card patches to make it work:
http://patchwork.ozlabs.org/project/qemu-devel/list/?series=226785

> >
> > 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.

Please test and report.

Regards,
Bin



reply via email to

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