diff mbox series

[04/11] configs/qemu_riscv64_nommu_virt_defconfig: new defconfig

Message ID 20220525132729.2349105-5-damien.lemoal@wdc.com
State Superseded
Headers show
Series Fix RV64 NOMMU and add Canaan K210 SoC support | expand

Commit Message

Damien Le Moal May 25, 2022, 1:27 p.m. UTC
From: Niklas Cassel <niklas.cassel@wdc.com>

Add RISC-V 64-bit nommu defconfig for QEMU virt machine with MMU
disabled.

Unlike qemu_riscv64_virt, qemu_riscv64_nommu_virt does not use OpenSBI,
since the kernel is running in machine mode (M-mode).

After the build is complete, you can start QEMU using the launcher
script:
$ output/images/start-qemu.sh

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
---
 board/qemu/riscv64-virt/readme.txt        |  2 ++
 configs/qemu_riscv64_nommu_virt_defconfig | 38 +++++++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 configs/qemu_riscv64_nommu_virt_defconfig
diff mbox series

Patch

diff --git a/board/qemu/riscv64-virt/readme.txt b/board/qemu/riscv64-virt/readme.txt
index 747a9ea674..9e4cfc8c55 100644
--- a/board/qemu/riscv64-virt/readme.txt
+++ b/board/qemu/riscv64-virt/readme.txt
@@ -2,4 +2,6 @@  Run Linux in emulation with:
 
   qemu-system-riscv64 -M virt -bios output/images/fw_jump.elf -kernel output/images/Image -append "rootwait root=/dev/vda ro" -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 # qemu_riscv64_virt_defconfig
 
+  qemu-system-riscv64 -M virt -bios none -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -nographic -cpu rv64,mmu=off # qemu_riscv64_nommu_virt_defconfig
+
 The login prompt will appear in the terminal that started Qemu.
diff --git a/configs/qemu_riscv64_nommu_virt_defconfig b/configs/qemu_riscv64_nommu_virt_defconfig
new file mode 100644
index 0000000000..46bd21f1da
--- /dev/null
+++ b/configs/qemu_riscv64_nommu_virt_defconfig
@@ -0,0 +1,38 @@ 
+# Architecture
+BR2_riscv=y
+BR2_RISCV_64=y
+
+# Toolchain
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+
+# Busybox with hush
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+
+# System
+BR2_TARGET_GENERIC_GETTY=y
+
+# Filesystem
+BR2_TARGET_ROOTFS_EXT2=y
+
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
+# Use Linux 5.16 headers until 5.17 headers are available
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_16=y
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_PATCH="board/riscv/nommu/kernel_patches"
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.17"
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_virt"
+BR2_LINUX_KERNEL_IMAGE=y
+
+# Disable network scripts
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+
+# host-qemu for gitlab testing
+BR2_PACKAGE_HOST_QEMU=y
+BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y