* Emulating sd card with hifive_u risc-v machine
@ 2021-02-08 13:47 Pascal Scholz
2021-02-08 22:49 ` Alistair Francis
0 siblings, 1 reply; 5+ messages in thread
From: Pascal Scholz @ 2021-02-08 13:47 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-riscv
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Emulating sd card with hifive_u risc-v machine
2021-02-08 13:47 Emulating sd card with hifive_u risc-v machine Pascal Scholz
@ 2021-02-08 22:49 ` Alistair Francis
2021-02-10 20:02 ` Pascal Scholz
0 siblings, 1 reply; 5+ messages in thread
From: Alistair Francis @ 2021-02-08 22:49 UTC (permalink / raw)
To: Pascal Scholz; +Cc: open list:RISC-V, qemu-devel@nongnu.org Developers
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
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Emulating sd card with hifive_u risc-v machine
2021-02-08 22:49 ` Alistair Francis
@ 2021-02-10 20:02 ` Pascal Scholz
2021-02-10 22:27 ` Alistair Francis
2021-02-14 5:05 ` Bin Meng
0 siblings, 2 replies; 5+ messages in thread
From: Pascal Scholz @ 2021-02-10 20:02 UTC (permalink / raw)
To: Alistair Francis, Pascal Scholz
Cc: open list:RISC-V, qemu-devel@nongnu.org Developers
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.
>>
>> 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
>>
>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Emulating sd card with hifive_u risc-v machine
2021-02-10 20:02 ` Pascal Scholz
@ 2021-02-10 22:27 ` Alistair Francis
2021-02-14 5:05 ` Bin Meng
1 sibling, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2021-02-10 22:27 UTC (permalink / raw)
To: Pascal Scholz
Cc: open list:RISC-V, Pascal Scholz, qemu-devel@nongnu.org Developers
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
> >>
> >>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Emulating sd card with hifive_u risc-v machine
2021-02-10 20:02 ` Pascal Scholz
2021-02-10 22:27 ` Alistair Francis
@ 2021-02-14 5:05 ` Bin Meng
1 sibling, 0 replies; 5+ messages in thread
From: Bin Meng @ 2021-02-14 5:05 UTC (permalink / raw)
To: Pascal Scholz
Cc: Alistair Francis, open list:RISC-V, Pascal Scholz,
qemu-devel@nongnu.org Developers
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-02-14 5:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-08 13:47 Emulating sd card with hifive_u risc-v machine Pascal Scholz
2021-02-08 22:49 ` Alistair Francis
2021-02-10 20:02 ` Pascal Scholz
2021-02-10 22:27 ` Alistair Francis
2021-02-14 5:05 ` Bin Meng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).