[isar-cip-core][PATCH 12/12] start-qemu: Add support for RISC-V


Jan Kiszka
 

From: Jan Kiszka <jan.kiszka@...>

Basically like ARM/ARM64. We just need to list the second console via
virtio explicitly as the system will not pick it up automatically.

Signed-off-by: Jan Kiszka <jan.kiszka@...>
---
start-qemu.sh | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/start-qemu.sh b/start-qemu.sh
index c8d4f47c..68c0414a 100755
--- a/start-qemu.sh
+++ b/start-qemu.sh
@@ -34,7 +34,9 @@ if [ -n "${QEMU_PATH}" ]; then
fi

if [ -z "${DISTRO_RELEASE}" ]; then
- if grep -s -q "DEBIAN_BULLSEYE: true" .config.yaml; then
+ if grep -s -q "DEBIAN_SID_PORTS: true" .config.yaml; then
+ DISTRO_RELEASE="sid-ports"
+ elif grep -s -q "DEBIAN_BULLSEYE: true" .config.yaml; then
DISTRO_RELEASE="bullseye"
else
DISTRO_RELEASE="buster"
@@ -100,6 +102,20 @@ case "${arch}" in
KERNEL_CMDLINE=" \
root=/dev/vda rw"
;;
+ rv64|riscv64)
+ QEMU_ARCH=riscv64
+ QEMU=qemu-system-riscv64
+ QEMU_EXTRA_ARGS=" \
+ -cpu rv64 \
+ -smp 4 \
+ -machine virt \
+ -device virtio-serial-device \
+ -device virtconsole,chardev=con -chardev vc,id=con \
+ -device virtio-blk-device,drive=disk \
+ -device virtio-net-device,netdev=net"
+ KERNEL_CMDLINE=" \
+ console=hvc1 console=ttyS0 root=/dev/vda rw"
+ ;;
""|--help)
usage
;;
--
2.35.3