From patchwork Wed Sep 12 10:22:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Corbin X-Patchwork-Id: 968944 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.136; helo=silver.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="ONRykRpM"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 429Hwq18gHz9sB5 for ; Wed, 12 Sep 2018 20:25:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0D3622F74F; Wed, 12 Sep 2018 10:25:29 +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 H4HIknnCTyz8; Wed, 12 Sep 2018 10:25:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1A8A52F667; Wed, 12 Sep 2018 10:25:28 +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 1090D1BFF9F for ; Wed, 12 Sep 2018 10:25:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 08E9A2F4C8 for ; Wed, 12 Sep 2018 10:25:26 +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 xlZwhwC2TluT for ; Wed, 12 Sep 2018 10:25:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by silver.osuosl.org (Postfix) with ESMTPS id DB5AD2F667 for ; Wed, 12 Sep 2018 10:25:21 +0000 (UTC) Received: by mail-wr1-f51.google.com with SMTP id j26-v6so1451585wre.2 for ; Wed, 12 Sep 2018 03:25:21 -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:in-reply-to:references; bh=3KDU7Ylvs1b2SQyL/y5b0OaC/lAtebfHGcM9Xmp/8yo=; b=ONRykRpMww6JFCXfNrL3Etn04SrrRLeacykSSkd5RE9Y0EAhABEml4FSBA5vgiJj4V kC7+KPkYnhw72F/+owxqyPGr6inJGLBxPbSthJNjJAnV6OHHljAV7UBFW7tGiERVeGop cwF5ESpZd9r5M7O1MjOD8SkWKbJ+QLPJpKU7Nf8oZsrVoe4MiatLrt7VVtzEa28jZqlq XnJdeXDHffv2ZzRuLaPRcAnBzBIiyhiPZG+opwtpSlsEKZe0RvYQrTtUiegWBGekhs8h Q+kgcgXKrDV0VAe7B4TmWIVNhiuZd5EEnWaaDdCehq7CR4N/kNLm08b35RJFVGikiKDE 58Cg== 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:in-reply-to :references; bh=3KDU7Ylvs1b2SQyL/y5b0OaC/lAtebfHGcM9Xmp/8yo=; b=o6GboE4kxaEc6Al+Vz8z5TZa+5b/qshiclnP35gBVXnrgHSj5afMYE9WedZ5fsb1my ldFgTv9kJE9WpiQtJupwcpNolXyC2rtUaIOXuVsKx1VySm5DZ42Eo7gs60pIr4EJSk6Z 37MCYjJ5ohi1uuH7F87eGWZKXQS8CUWwn8sAAJPVxfTh33lByhstphEWmxYe6BwSGjxn QYGBDpkwK/gWpCujjZ+Ab7P6G3nOL29YtCeOfxORw9Ti+9DmK8FpQl0RLo8dFRaG6S5N YvwbDKgx11mi3DTZJzYxjQhrcJk4kgGqvXccuJzsV0uKzQfZ4i5bONK5spACAdk95Ej3 zfKQ== X-Gm-Message-State: APzg51D0UXgyZy6GA1sXFPEU/var4wBkV1cwUBTERj8OoUjWYePkGXCU 2cVhjq47bvYcCV8WWWh6G7LpTI/R5Zo= X-Google-Smtp-Source: ANB0VdbvssGzadZMMgRIkxIuZa9f7QFbu8prCJSF3R8HR3KyGy0gra0eJ1khrU5xRCzO2jfaI/Wj1g== X-Received: by 2002:a5d:6908:: with SMTP id t8-v6mr1032842wru.170.1536747920239; Wed, 12 Sep 2018 03:25:20 -0700 (PDT) Received: from localhost.localdomain ([2a02:390:741d:1:f928:e134:2d4b:86f7]) by smtp.gmail.com with ESMTPSA id z184-v6sm14059387wmz.0.2018.09.12.03.25.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 03:25:19 -0700 (PDT) From: Mark Corbin To: buildroot@buildroot.org Date: Wed, 12 Sep 2018 11:22:56 +0100 Message-Id: <20180912102256.3164-7-mark.corbin@embecosm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180912102256.3164-1-mark.corbin@embecosm.com> References: <20180912102256.3164-1-mark.corbin@embecosm.com> Subject: [Buildroot] [PATCH v2 6/6] 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 --- Changes v1 -> v2: - updated DEVELOPERS file (Thomas P) - removed typo from readme.txt and updated text to remove BBL instructions now that it has been integrated as a package (Thomas P) - selected a specific kernel commit rather than a branch (Thomas P) - removed explicit selection of BR2_BINUTILS_VERSION_2_30_X (Thomas P) - added selection of riscv-pk package --- DEVELOPERS | 2 ++ board/qemu/riscv64-virt/linux.config | 23 +++++++++++++++++++++++ board/qemu/riscv64-virt/readme.txt | 7 +++++++ configs/qemu_riscv64_virt_defconfig | 24 ++++++++++++++++++++++++ 4 files changed, 56 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/DEVELOPERS b/DEVELOPERS index 4d6c599aea..afd24853c6 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1289,7 +1289,9 @@ F: package/ratpoison/ N: Mark Corbin 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 F: package/harfbuzz/ diff --git a/board/qemu/riscv64-virt/linux.config b/board/qemu/riscv64-virt/linux.config new file mode 100644 index 0000000000..d09e8b3bb1 --- /dev/null +++ b/board/qemu/riscv64-virt/linux.config @@ -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 index 0000000000..9f6e35c867 --- /dev/null +++ b/board/qemu/riscv64-virt/readme.txt @@ -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 index 0000000000..59343ee98f --- /dev/null +++ b/configs/qemu_riscv64_virt_defconfig @@ -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