From patchwork Fri Aug 31 14:38:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Corbin X-Patchwork-Id: 964499 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.b="Pyqq27jC"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42228B3SR9z9rvt for ; Sat, 1 Sep 2018 00:40:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E23DB87D96; Fri, 31 Aug 2018 14:40:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zc8DOWHdQMSt; Fri, 31 Aug 2018 14:40:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 1A41E87D98; Fri, 31 Aug 2018 14:40:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id B9D4F1C408B for ; Fri, 31 Aug 2018 14:40:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B6FC6240C5 for ; Fri, 31 Aug 2018 14:40:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6ES1HbOEgsvM for ; Fri, 31 Aug 2018 14:40:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by silver.osuosl.org (Postfix) with ESMTPS id D7C83221E2 for ; Fri, 31 Aug 2018 14:40:00 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id v16-v6so11447817wro.11 for ; Fri, 31 Aug 2018 07:40:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id; bh=aQRNSlMhIakruWu5rBRXOlvTQeJdCY9hE6seoR6lGLE=; b=Pyqq27jCCSJK0BBRuQJyc68IU+u50UzuPFmKmi4I+epGF6kv70IFOegNGM9aAzzlpU qHB/Qoq9ZfDQUej+1AJyHcYODungp5p2D/+Dz++/oaO8ouXvjsRfTaxELo70AlWok5/H AD9rJ2JmPYrGpvafn6tgZLWqY0Ld8UJyLu6K5fK9mgeuYlULeuE+u0fKZWERehGa5NrL kkL6FE8Vst/EG8R9AA11+4hnfcYvbrBUbLhY/4xodJypLb4oZqUF8cCLqChYrlUsoJnp UT1uso2f/6OWhZFwzR/erhiQ273wDpgfNnpTyKiK7ek2Lm8LZC0vw5evMnFPQkP985uY W5Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aQRNSlMhIakruWu5rBRXOlvTQeJdCY9hE6seoR6lGLE=; b=CoqeIv+UKjo9/9itpFmtNc1m8zSP2Ckq0d7/Mk75G5Z0ggyOIsBY5gLp2FPHbeglo1 kaJ6Qsfz2DPd6FwNMw/1k8NZdR6fqA+MuYX3/KvPjUF3UHvMTjq6HrYOfOLh1QmC+GE6 rSl/ccJXU6mmImJUfuSFFtAWQsWB6r6Xw6hUIug4/Ua5SxSVKniAx2mYKiZvK15KMwbz 1DqCd6wRbMTDuVBTGOeiR2DO5sUq0UojNLgPYfhZhW5R7zrKv571/q0dDWFUB2Mu341K eRLeW+mJZCAv48Vi9I32R3EFd2zCe9p+ub3utjIimEFyhSSq2fFos4XHa3Lji/vw4fB6 lWnw== X-Gm-Message-State: APzg51DKx9XSK6/Xjt8SJ6UzIK3X7p+uYg9abXPWtcj9gsqfVwzQTBg3 ca29dYzUPigmY07VxshUZRTsE41FbtE= X-Google-Smtp-Source: ANB0VdZWWnVg+3Nz8oXz5EwGHjd1jd48bftXLIFTLvHecFZcd4haaw0SCh0fWEkRP8BDyXhotvo/iQ== X-Received: by 2002:a5d:4605:: with SMTP id t5-v6mr10471318wrq.200.1535726399207; Fri, 31 Aug 2018 07:39:59 -0700 (PDT) Received: from tait.lym.embecosm.com ([2a02:390:741d:1:4443:5f95:38b2:e1b9]) by smtp.gmail.com with ESMTPSA id a6-v6sm4478027wmf.22.2018.08.31.07.39.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 07:39:58 -0700 (PDT) From: Mark Corbin To: buildroot@buildroot.org Date: Fri, 31 Aug 2018 15:38:53 +0100 Message-Id: <20180831143853.24340-1-mark.corbin@embecosm.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH 1/1] configs/qemu: add qemu_riscv64_virt_defconfig X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Corbin MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add RISC-V 64-bit defconfig for QEMU virt machine. Tested with QEMU 2.12.1 Signed-off-by: Mark Corbin Tested-by: Christopher McCrory --- 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 /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 Buildroot generated vmlinux image will need to be combined with the Berkeley Boot Loader (BBL) as follows: + + export RISCV=/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=/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