aboutsummaryrefslogtreecommitdiff
path: root/docs/platform/qemu_virt.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/platform/qemu_virt.md')
-rw-r--r--docs/platform/qemu_virt.md46
1 files changed, 22 insertions, 24 deletions
diff --git a/docs/platform/qemu_virt.md b/docs/platform/qemu_virt.md
index 6d8a3d0..2196e5a 100644
--- a/docs/platform/qemu_virt.md
+++ b/docs/platform/qemu_virt.md
@@ -7,7 +7,7 @@ software development and testing. It is also referred to as
storage, and other types of IO.
To build the platform-specific library and firmware images, provide the
-*PLATFORM=qemu/virt* parameter to the top level `make` command.
+*PLATFORM=generic* parameter to the top level `make` command.
Platform Options
----------------
@@ -22,13 +22,13 @@ Execution on QEMU RISC-V 64-bit
Build:
```
-make PLATFORM=qemu/virt
+make PLATFORM=generic
```
Run:
```
qemu-system-riscv64 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_payload.elf
+ -kernel build/platform/generic/firmware/fw_payload.bin
```
**U-Boot Payload**
@@ -38,19 +38,19 @@ the `qemu-riscv64_smode_defconfig` configuration.
Build:
```
-make PLATFORM=qemu/virt FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin
+make PLATFORM=generic FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin
```
Run:
```
qemu-system-riscv64 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_payload.elf
+ -kernel build/platform/generic/firmware/fw_payload.elf
```
or
```
qemu-system-riscv64 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_jump.elf \
- -device loader,file=<uboot_build_directory>/u-boot.bin,addr=0x80200000
+ -bios build/platform/generic/firmware/fw_jump.bin \
+ -kernel <uboot_build_directory>/u-boot.bin
```
**Linux Kernel Payload**
@@ -60,13 +60,13 @@ Note: We assume that the Linux kernel is compiled using
Build:
```
-make PLATFORM=qemu/virt FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image
+make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image
```
Run:
```
qemu-system-riscv64 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_payload.elf \
+ -kernel build/platform/generic/firmware/fw_payload.elf \
-drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0"
@@ -74,8 +74,8 @@ qemu-system-riscv64 -M virt -m 256M -nographic \
or
```
qemu-system-riscv64 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_jump.elf \
- -device loader,file=<linux_build_directory>/arch/riscv/boot/Image,addr=0x80200000 \
+ -bios build/platform/generic/firmware/fw_jump.bin \
+ -kernel <linux_build_directory>/arch/riscv/boot/Image \
-drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0"
@@ -89,13 +89,13 @@ Execution on QEMU RISC-V 32-bit
Build:
```
-make PLATFORM=qemu/virt
+make PLATFORM=generic PLATFORM_RISCV_XLEN=32
```
Run:
```
qemu-system-riscv32 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_payload.elf
+ -kernel build/platform/generic/firmware/fw_payload.bin
```
**U-Boot Payload**
@@ -105,37 +105,35 @@ the `qemu-riscv32_smode_defconfig` configuration.
Build:
```
-make PLATFORM=qemu/virt FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin
+make PLATFORM=generic PLATFORM_RISCV_XLEN=32 FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin
```
Run:
```
qemu-system-riscv32 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_payload.elf
+ -kernel build/platform/generic/firmware/fw_payload.elf
```
or
```
qemu-system-riscv32 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_jump.elf \
- -device loader,file=<uboot_build_directory>/u-boot.bin,addr=0x80400000
+ -bios build/platform/generic/firmware/fw_jump.bin \
+ -kernel <uboot_build_directory>/u-boot.bin
```
**Linux Kernel Payload**
Note: We assume that the Linux kernel is compiled using
-*arch/riscv/configs/rv32_defconfig* (kernel 5.1 and newer)
-respectively using *arch/riscv/configs/defconfig* plus setting
-CONFIG_ARCH_RV32I=y (kernel 5.0 and older).
+*arch/riscv/configs/rv32_defconfig*.
Build:
```
-make PLATFORM=qemu/virt FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image
+make PLATFORM=generic PLATFORM_RISCV_XLEN=32 FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image
```
Run:
```
qemu-system-riscv32 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_payload.elf \
+ -kernel build/platform/generic/firmware/fw_payload.elf \
-drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0"
@@ -143,8 +141,8 @@ qemu-system-riscv32 -M virt -m 256M -nographic \
or
```
qemu-system-riscv32 -M virt -m 256M -nographic \
- -kernel build/platform/qemu/virt/firmware/fw_jump.elf \
- -device loader,file=<linux_build_directory>/arch/riscv/boot/Image,addr=0x80400000 \
+ -bios build/platform/generic/firmware/fw_jump.bin \
+ -kernel <linux_build_directory>/arch/riscv/boot/Image \
-drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0"