configs/qemu_riscv64_virt: new defconfig
authorMark Corbin <mark.corbin@embecosm.com>
Wed, 12 Sep 2018 10:22:56 +0000 (11:22 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 25 Sep 2018 19:40:10 +0000 (21:40 +0200)
Add RISC-V 64-bit defconfig for QEMU virt machine.

Tested with QEMU 2.12.1

Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
.gitlab-ci.yml
DEVELOPERS
board/qemu/riscv64-virt/linux.config [new file with mode: 0644]
board/qemu/riscv64-virt/readme.txt [new file with mode: 0644]
configs/qemu_riscv64_virt_defconfig [new file with mode: 0644]

index 05e54ab6b69e59a7ccd207f3f0a3983a68dc11ae..b220d544f8b45d313f32c22ca7e4e8f9c0c6f8ab 100644 (file)
@@ -215,6 +215,7 @@ qemu_ppc64le_pseries_defconfig: *defconfig
 qemu_ppc_g3beige_defconfig: *defconfig
 qemu_ppc_mpc8544ds_defconfig: *defconfig
 qemu_ppc_virtex_ml507_defconfig: *defconfig
+qemu_riscv64_virt_defconfig: *defconfig
 qemu_sh4_r2d_defconfig: *defconfig
 qemu_sh4eb_r2d_defconfig: *defconfig
 qemu_sparc64_sun4u_defconfig: *defconfig
index 056c3a143e14c997295af3d04a54e0454cf0dd30..e5cd83af0d54de33efb7c27edbe7510a7df13cac 100644 (file)
@@ -1301,7 +1301,9 @@ F:        package/ratpoison/
 N:     Mark Corbin <mark.corbin@embecosm.com>
 F:     arch/arch.mk.riscv
 F:     arch/Config.in.riscv
+F:     board/qemu/riscv64-virt/
 F:     boot/riscv-pk/
+F:     configs/qemu_riscv64_virt_defconfig
 
 N:     Markos Chandras <markos.chandras@imgtec.com>
 F:     package/harfbuzz/
diff --git a/board/qemu/riscv64-virt/linux.config b/board/qemu/riscv64-virt/linux.config
new file mode 100644 (file)
index 0000000..d09e8b3
--- /dev/null
@@ -0,0 +1,23 @@
+CONFIG_ARCH_RV64I=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=8
+CONFIG_PCI=y
+CONFIG_SYSVIPC=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_WIRELESS is not set
+CONFIG_VIRTIO_BLK=y
+CONFIG_NETDEVICES=y
+CONFIG_VIRTIO_NET=y
+# CONFIG_ETHERNET is not set
+# CONFIG_WLAN is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_VIRT_DRIVERS=y
+CONFIG_VIRTIO_MMIO=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT4_FS=y
+CONFIG_TMPFS=y
diff --git a/board/qemu/riscv64-virt/readme.txt b/board/qemu/riscv64-virt/readme.txt
new file mode 100644 (file)
index 0000000..9f6e35c
--- /dev/null
@@ -0,0 +1,7 @@
+Run the emulation with:
+
+  qemu-system-riscv64 -M virt -kernel output/images/bbl -append "root=/dev/vda ro console=ttyS0" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
+
+The login prompt will appear in the terminal that started Qemu.
+
+Tested with QEMU 2.12.1
diff --git a/configs/qemu_riscv64_virt_defconfig b/configs/qemu_riscv64_virt_defconfig
new file mode 100644 (file)
index 0000000..59343ee
--- /dev/null
@@ -0,0 +1,24 @@
+# Architecture
+BR2_riscv=y
+
+# System
+BR2_SYSTEM_DHCP="eth0"
+
+# Filesystem
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_GENERIC_GETTY=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+
+# Linux headers same as kernel, a 4.15 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_15=y
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/riscv/riscv-linux.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="fe92d7905c6ea0ebeabeb725b8040754ede7c220"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/riscv64-virt/linux.config"
+
+# Bootloader
+BR2_TARGET_RISCV_PK=y