From patchwork Wed Jun 14 01:20:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 13279396 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3CDC9EB64D8 for ; Wed, 14 Jun 2023 01:27:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q9FFE-0005Ck-0B; Tue, 13 Jun 2023 21:24:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9FF7-00055b-NR for qemu-devel@nongnu.org; Tue, 13 Jun 2023 21:24:14 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q9FF5-0004zm-Vh for qemu-devel@nongnu.org; Tue, 13 Jun 2023 21:24:13 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-652699e72f7so4752998b3a.3 for ; Tue, 13 Jun 2023 18:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686705850; x=1689297850; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MO+1sqpCGLByRwsn5yLCX1XOZSFYO3fVw3PW0wG3ZcA=; b=paqUAtuvj79R8EAMWVnioJKboot+xh7soXPVOguCuyKlFE3eR4QBDZ6XOJTY32AyWM LCE4ktiBs/VoD+CJOPJkSu6EFnvN2U9ya2N3rH5zgUAQi+FnmM7WmzbxCzsMI/8t34vu TfmJ/ZpwG9YhzrVadpV8sww1EgJt7JE2ID5DjVYMQy69Tw+xQBkB99Y2Z6t1wKjDxVLZ gak2fG/WytoOvUpAH4dG/ULPr60VkbMghvzYGvpy7UE4/nNXPsMLCay28dsDvqs+SZn2 JpwvXjnRg5FucTkH8at59lGdqKOtohU6ILH1onN/HGPB817fFZYOGe8xDVSQs+umakmN 2Fpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686705850; x=1689297850; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MO+1sqpCGLByRwsn5yLCX1XOZSFYO3fVw3PW0wG3ZcA=; b=ZrHcYUv/EhuthjSoE5/F1trCJPJFreSBePiO/hB6UmWmT8YCBfwdkvyk02mrM80SSe 9qYTVYmo60r0VI2dH2RL0DrHgZfGfRYOaP1tqiCoOCaaQ1HCWpFkcUtlJltmwDKC3uGP 8Hz9ioy5EtjXQVnaJ4ilt1hTOQnsAnjgfiRvz4K82aPjVDWsGyrs8C5IJyQayEDfCiIB 7IiWBEm7q5FPnl1XBffbgq4yy2mb5f+A/EqFrqLmsGUWlg13oUTVowRIfqoT+sEZsfFp HWO6Z0wMrux6LePBN1UzajrVqRX4c7QRuC9kury63ugYi7dAVmC+u0ZcCGWU9YCLADSu G+Bg== X-Gm-Message-State: AC+VfDzXR0FZoFGzvoxjWJ1afTORS3Rczkidib2gQ4ZIA1hXqXHYx5xk EwBskCwSDslfGARZJSVsi4siXAhMPfieoQ== X-Google-Smtp-Source: ACHHUZ7mV7BRPDeRI4sAJvcrvpeQ/slidkMdlRtw9wS6JNEOIR4wmR738phXlGDqWorbENXQJ+lPuQ== X-Received: by 2002:a05:6a00:9a4:b0:664:2f24:5578 with SMTP id u36-20020a056a0009a400b006642f245578mr497229pfg.13.1686705850373; Tue, 13 Jun 2023 18:24:10 -0700 (PDT) Received: from toolbox.wdc.com (2403-580b-97e8-0-321-6fb2-58f1-a1b1.ip6.aussiebb.net. [2403:580b:97e8:0:321:6fb2:58f1:a1b1]) by smtp.gmail.com with ESMTPSA id u1-20020aa78381000000b0064f7c56d8b7sm9112238pfm.219.2023.06.13.18.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 18:24:09 -0700 (PDT) From: Alistair Francis X-Google-Original-From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Sunil V L , =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= , Alistair Francis Subject: [PULL 54/60] docs/system: riscv: Add pflash usage details Date: Wed, 14 Jun 2023 11:20:11 +1000 Message-Id: <20230614012017.3100663-55-alistair.francis@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230614012017.3100663-1-alistair.francis@wdc.com> References: <20230614012017.3100663-1-alistair.francis@wdc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=alistair23@gmail.com; helo=mail-pf1-x433.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Sunil V L pflash devices can be used in virt machine for different purposes like for ROM code or S-mode FW payload. Add a section in the documentation on how to use pflash devices for different purposes. Signed-off-by: Sunil V L Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20230601045910.18646-4-sunilvl@ventanamicro.com> Signed-off-by: Alistair Francis --- docs/system/riscv/virt.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/system/riscv/virt.rst b/docs/system/riscv/virt.rst index 4b16e41d7f..b33f45e5b3 100644 --- a/docs/system/riscv/virt.rst +++ b/docs/system/riscv/virt.rst @@ -53,6 +53,37 @@ with the default OpenSBI firmware image as the -bios. It also supports the recommended RISC-V bootflow: U-Boot SPL (M-mode) loads OpenSBI fw_dynamic firmware and U-Boot proper (S-mode), using the standard -bios functionality. +Using flash devices +------------------- + +By default, the first flash device (pflash0) is expected to contain +S-mode firmware code. It can be configured as read-only, with the +second flash device (pflash1) available to store configuration data. + +For example, booting edk2 looks like + +.. code-block:: bash + + $ qemu-system-riscv64 \ + -blockdev node-name=pflash0,driver=file,read-only=on,filename= \ + -blockdev node-name=pflash1,driver=file,filename= \ + -M virt,pflash0=pflash0,pflash1=pflash1 \ + ... other args .... + +For TCG guests only, it is also possible to boot M-mode firmware from +the first flash device (pflash0) by additionally passing ``-bios +none``, as in + +.. code-block:: bash + + $ qemu-system-riscv64 \ + -bios none \ + -blockdev node-name=pflash0,driver=file,read-only=on,filename= \ + -M virt,pflash0=pflash0 \ + ... other args .... + +Firmware images used for pflash must be exactly 32 MiB in size. + Machine-specific options ------------------------