All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] configs/qemu: add qemu_riscv64_virt_defconfig
@ 2018-08-31 14:38 Mark Corbin
  2018-08-31 19:01 ` Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Mark Corbin @ 2018-08-31 14:38 UTC (permalink / raw)
  To: buildroot

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>
---
 board/qemu/riscv64-virt/linux.config | 24 ++++++++++++++++++++++++
 board/qemu/riscv64-virt/readme.txt   | 22 ++++++++++++++++++++++
 configs/qemu_riscv64_virt_defconfig  | 24 ++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 board/qemu/riscv64-virt/linux.config
 create mode 100644 board/qemu/riscv64-virt/readme.txt
 create mode 100644 configs/qemu_riscv64_virt_defconfig

diff --git a/board/qemu/riscv64-virt/linux.config b/board/qemu/riscv64-virt/linux.config
new file mode 100644
index 0000000000..bf9f4f5ab7
--- /dev/null
+++ b/board/qemu/riscv64-virt/linux.config
@@ -0,0 +1,24 @@
+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
index 0000000000..be563c969e
--- /dev/null
+++ b/board/qemu/riscv64-virt/readme.txt
@@ -0,0 +1,22 @@
+Run the emulation with:
+
+  qemu-system-riscv64 -M virt -kernel <path-to-bl>/bbl -append "root=/dev/vda ro console=ttyS0" -drive file=<path-to-buildroot>/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 Buildroot generated vmlinux image will need to be combined with the Berkeley Boot Loader (BBL) as follows:
+
+  export RISCV=<path-to-buildroot>/output/host
+  export PATH=$PATH:$RISCV/bin
+  git clone https://github.com/riscv/riscv-pk
+  cd riscv-pk
+  mkdir build
+  cd build
+  ../configure \
+    --host=riscv64-buildroot-linux-gnu \
+    --with-payload=<path-to-buildroot>/output/images/vmlinux
+  make
+
+The resulting 'bbl' file can then be used with the qemu command above.
+  
+The login prompt will appear in the terminal that started Qemu.
+
+Tested with QEMU 2.12.92
diff --git a/configs/qemu_riscv64_virt_defconfig b/configs/qemu_riscv64_virt_defconfig
new file mode 100644
index 0000000000..387bf3b4c4
--- /dev/null
+++ b/configs/qemu_riscv64_virt_defconfig
@@ -0,0 +1,24 @@
+# Architecture
+BR2_riscv64=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="riscv-linux-4.15"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/riscv64-virt/linux.config"
+
+# Binutils configuration
+BR2_BINUTILS_VERSION_2_30_X=y
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-09-05  6:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 14:38 [Buildroot] [PATCH 1/1] configs/qemu: add qemu_riscv64_virt_defconfig Mark Corbin
2018-08-31 19:01 ` Thomas Petazzoni
2018-09-02 15:09 ` Christopher McCrory
2018-09-04 11:06   ` Mark Corbin
2018-09-02 19:47 ` Thomas Petazzoni
2018-09-04 15:14   ` Mark Corbin
2018-09-04 19:57     ` Arnout Vandecappelle
2018-09-05  6:45       ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.