diff mbox series

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

Message ID 698957d5f6c859a353620325fc53a8415370105f.1664902098.git.jan.kiszka@siemens.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Add qemu-riscv64 target, refactorings, kernel updates, CI fix | expand

Commit Message

Jan Kiszka Oct. 4, 2022, 4:48 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

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@siemens.com>
---
 start-qemu.sh | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
diff mbox series

Patch

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