From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FBCEC433F5 for ; Thu, 27 Jan 2022 06:12:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 275DA83373; Thu, 27 Jan 2022 07:12:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="JC/iV1En"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6D71D83107; Thu, 27 Jan 2022 07:11:56 +0100 (CET) Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E882180F3F for ; Thu, 27 Jan 2022 07:11:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=apatel@ventanamicro.com Received: by mail-pf1-x429.google.com with SMTP id e28so1743452pfj.5 for ; Wed, 26 Jan 2022 22:11:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4oI4qd0aO8sMZ7nv5TayAxDJM15wOSN0X7TnQ1cf0Vg=; b=JC/iV1EnTkHfuCBNedA9lC9vo96qj3x6EUSUuCe5WxpzcQiMRlLBHHtSOl/aLpATvb r2IzsMFQioOgUtoF2s4Idi0ravaf2ZjetqlVfwcgjdZ1d6S8Hdlq+PHz33zcdVkzJcNz 9Tuwy1onZn7lXi6gYsPQYFY69pbk8uXBkGE8YFqlmZWb//KslBz/sa13jkFg4ylxCNoq pQiTdJb+e5GZDWHmUSe3XmOdHWabyt4ce7I9xl3OXzWfVjasRg4RlnU3LtN7QmGCFIh4 /8NnKgwW1iEsrPhHL0B41lyL38CWZD4ctMED95wF/+Ai9me/Lbam1fD1MfMfr59HiZmx gPvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4oI4qd0aO8sMZ7nv5TayAxDJM15wOSN0X7TnQ1cf0Vg=; b=QIiAR639CmcrSeTnHptsMSD8GiV6mFRuaFyfFMGf2v9cKUelNfapWEB8aIzhmPCkFD PXB0hsy8/YwbfLdsnOY6MtNTdAnfRsBbCFnchFVPXY34MBYGW1VH6zJ7Is/8JViZqjQP O0e/3QTwBAaEuSSryg+lPfuHoJELQZDhYETbRuJmadWgdnaxnHT7X2oUkJVVALOW29za Ol5jq7G+QsTLOYqvMVlNtT+NtTXqJE/xAAbQaNQwjOC2l1LA+5jGTrXM64FrZSLBM/tf dIKVaB2sdmMNRV/HbpAcR8UTI5+8XZ24phNgsrpLGXRqH4jqjstp3YXoiaNRkMX8fbxI mFWA== X-Gm-Message-State: AOAM532c2yHo/IprBQ0gJYgMAlCshpP0NRqqBiUOmvtlXH1sclrBqgKs EuKU+v11Dj+3Y1h3FMJv211xCQ== X-Google-Smtp-Source: ABdhPJxlbFRsJ7F7G/Rdrc0h++kDyUGQ9jlasUgOzR30S3+tfhUaUxMg1Qu70swI65pmluPp9Zn6+Q== X-Received: by 2002:a05:6a00:140d:: with SMTP id l13mr1694580pfu.22.1643263911339; Wed, 26 Jan 2022 22:11:51 -0800 (PST) Received: from localhost.localdomain ([171.61.74.240]) by smtp.gmail.com with ESMTPSA id j4sm4732441pjv.46.2022.01.26.22.11.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 22:11:50 -0800 (PST) From: Anup Patel To: Rick Chen , Bin Meng Cc: Atish Patra , Alistair Francis , Anup Patel , U-Boot Mailing List , Anup Patel Subject: [PATCH v2 4/4] doc: qemu-riscv: Update documentation for QEMU spike machine Date: Thu, 27 Jan 2022 11:41:10 +0530 Message-Id: <20220127061110.721103-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127061110.721103-1-apatel@ventanamicro.com> References: <20220127061110.721103-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean We can now use same U-Boot images on both QEMU virt machine and QEMU spike machine so let's update the QEMU RISC-V documentation. Signed-off-by: Anup Patel --- doc/board/emulation/qemu-riscv.rst | 48 ++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/doc/board/emulation/qemu-riscv.rst b/doc/board/emulation/qemu-riscv.rst index 4b8e104a21..0a4b121687 100644 --- a/doc/board/emulation/qemu-riscv.rst +++ b/doc/board/emulation/qemu-riscv.rst @@ -4,16 +4,21 @@ QEMU RISC-V =========== -QEMU for RISC-V supports a special 'virt' machine designed for emulation and -virtualization purposes. This document describes how to run U-Boot under it. -Both 32-bit and 64-bit targets are supported, running in either machine or -supervisor mode. +QEMU for RISC-V supports a special 'virt' machine and 'spike' machine designed +for emulation and virtualization purposes. This document describes how to run +U-Boot under it. Both 32-bit and 64-bit targets are supported, running in +either machine or supervisor mode. The QEMU virt machine models a generic RISC-V virtual machine with support for the VirtIO standard networking and block storage devices. It has CLINT, PLIC, 16550A UART devices in addition to VirtIO and it also uses device-tree to pass -configuration information to guest software. It implements RISC-V privileged -architecture spec v1.10. +configuration information to guest software. It implements the latest RISC-V +privileged architecture. + +The QEMU spike machine models a minimalistic RISC-V virtual machine with +only CLINT and HTIF devices. It also uses device-tree to pass configuration +information to guest software and implements the latest RISC-V privileged +architecture. Building U-Boot --------------- @@ -38,13 +43,17 @@ Running U-Boot -------------- The minimal QEMU command line to get U-Boot up and running is: -- For 32-bit RISC-V:: +- For 32-bit RISC-V virt machine:: - qemu-system-riscv32 -nographic -machine virt -bios u-boot + qemu-system-riscv32 -nographic -machine virt -bios u-boot.bin -- For 64-bit RISC-V:: +- For 64-bit RISC-V virt machine:: + + qemu-system-riscv64 -nographic -machine virt -bios u-boot.bin + +- For 64-bit RISC-V spike machine:: - qemu-system-riscv64 -nographic -machine virt -bios u-boot + qemu-system-riscv64 -nographic -machine spike -bios u-boot.bin The commands above create targets with 128MiB memory by default. A freely configurable amount of RAM can be created via the '-m' @@ -55,6 +64,7 @@ the new setting. For instructions on how to run U-Boot in supervisor mode on QEMU with OpenSBI, see the documentation available with OpenSBI: https://github.com/riscv/opensbi/blob/master/docs/platform/qemu_virt.md +https://github.com/riscv/opensbi/blob/master/docs/platform/spike.md These have been tested in QEMU 5.0.0. @@ -77,8 +87,9 @@ supported by U-Boot. Clone the OpenSBI repository and run the following command. See the OpenSBI documentation for full details: https://github.com/riscv/opensbi/blob/master/docs/platform/qemu_virt.md +https://github.com/riscv/opensbi/blob/master/docs/platform/spike.md -To make the FW_DYNAMIC binary (build/platform/qemu/virt/firmware/fw_dynamic.bin) +To make the FW_DYNAMIC binary (build/platform/generic/firmware/fw_dynamic.bin) available to U-Boot, either copy it into the U-Boot root directory or specify its location with the OPENSBI environment variable. Afterwards, compile U-Boot with the following commands. @@ -96,17 +107,22 @@ with the following commands. The minimal QEMU commands to run U-Boot SPL in both 32-bit and 64-bit configurations are: -- For 32-bit RISC-V:: +- For 32-bit RISC-V virt machine:: - qemu-system-riscv32 -nographic -machine virt -bios spl/u-boot-spl \ + qemu-system-riscv32 -nographic -machine virt -bios spl/u-boot-spl.bin \ -device loader,file=u-boot.itb,addr=0x80200000 -- For 64-bit RISC-V:: +- For 64-bit RISC-V virt machine:: + + qemu-system-riscv64 -nographic -machine virt -bios spl/u-boot-spl.bin \ + -device loader,file=u-boot.itb,addr=0x80200000 + +- For 64-bit RISC-V spike machine:: - qemu-system-riscv64 -nographic -machine virt -bios spl/u-boot-spl \ + qemu-system-riscv64 -nographic -machine spike -bios spl/u-boot-spl.bin \ -device loader,file=u-boot.itb,addr=0x80200000 -An attached disk can be emulated by adding:: +An attached disk can be emulated in RISC-V virt machine by adding:: -device ich9-ahci,id=ahci \ -drive if=none,file=riscv64.img,format=raw,id=mydisk \ -- 2.25.1