From patchwork Sat Jul 10 14:28:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1503477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=M+uRQlZU; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MgPUbRty; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GMXT33Skxz9sSs for ; Sun, 11 Jul 2021 00:28:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3P5O/iWxgYaNMgrhsBJ5fK76WWUhmc0Ki74HgiUc258=; b=M+uRQlZUFYaXSt JA1lbYeTK5wVGmKBmDov05z9qjbKrbwM+llg8R4Rnuo+Ai9R2DebbCJDdzDPDy489yG6hO9ZUHKHu bxFCNPH4HPChIqJ9mklUQm/v1rC+zfbZjImLgh1rP34I9NVTIdEOFNWlWO0VH8AUbPjQLl6XuEW0l fF/Fqef3jmYI6grdHF+beKpp/lv3sOaR0bEgzrtnek7FdpLZnMauAfjX8C5ftefJFuorSjhMx14TQ hW5oDML5icQzmhuL2+sBWuAcRP+J12p1fb6kN4KC3hR9zUTFf8OJ8RK8ewqnhn7hpZ0DdIFusLjgq ipqiJATFKrjot4KRq4rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2Dy6-003kFN-3N; Sat, 10 Jul 2021 14:28:34 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2Dy3-003kEg-Ii for opensbi@lists.infradead.org; Sat, 10 Jul 2021 14:28:32 +0000 Received: by mail-pj1-x102b.google.com with SMTP id i16-20020a17090acf90b02901736d9d2218so2732376pju.1 for ; Sat, 10 Jul 2021 07:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z5g81e0EIVqmR7XnZR3veBy/eNJhT8Jpo7GLNzVm7hw=; b=MgPUbRtyBIIZTMoLq3ymhCDKA+y3Y0vls0VMoX3I4sv+POgW5Yx+Z+jFgzaZzVxsHM QIfb9vczjVJuNn4CRhVXjx/l4MNVrB+6Yv2QPitvtPQqmn3+r4WocvxKuiUrNzd9HtEj /BrznhyiGBT1DsnH3Pl+RgE808nIe3PmY3s7HQ2mfqQlc+CE3gPhpq0r21RZ0LAigIgS KW9vZmiDV4pS0uma6CtfboPqqy4Vngufj1DMC43VWxxbJypQKbwikQlk37aHR5enfz/L 15T5YD9m6aVk7K7TKVz9QRhxJF+IfozWYTCZKpFKcKe0D+bNMveRUwRTmtvDVVVvnji2 ueLg== 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:mime-version:content-transfer-encoding; bh=Z5g81e0EIVqmR7XnZR3veBy/eNJhT8Jpo7GLNzVm7hw=; b=WcEVRAxOCOY8Z0fKqDbnOcj22TcCmuVa5esXEjBahX+3j21Zk0HUW8ViFAZnRQWQIL YRVQkYdgJbj2qBb80q+G4LqD1JmgOfsUURUC9N8GLqPKzlRAs9Ce6kKwaL0zLV9wvrD+ v4axzesNuka9huULgTDyw7HnXYcSMPRVTTU1FFr+SqIqbR8CtNE4jS01CQmCrpWoviM0 tG4PcQvEwK7EyYQ04KtIiqURfwesmJ2dIYBd4iLmIrBgzQOZdGdHUtJvOdM1Sf6w0+Sj VH+cKivzfN46SyOKb6OJ0ADZtSk7E3mu5vo0Q8yc+z2x/gF67ocicZypDTC0vWrb3RTd VuHw== X-Gm-Message-State: AOAM532yjpOqZx53SaCT7X74qOB+r/YwE6nYifgmtGi65uab/HefsGWE bEkEX94FSRD2q/B4z5Femsw= X-Google-Smtp-Source: ABdhPJwjKiSpA1CgRDOypOpXsc4mpvVB+E17o/ZCSv6EfLRycRxtBSjihqMNKh+dMHoVBnoV+07i/w== X-Received: by 2002:a17:90a:bd06:: with SMTP id y6mr44008653pjr.6.1625927310424; Sat, 10 Jul 2021 07:28:30 -0700 (PDT) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id 31sm11066734pgu.17.2021.07.10.07.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jul 2021 07:28:30 -0700 (PDT) From: Bin Meng To: Anup Patel , opensbi@lists.infradead.org Cc: Bin Meng Subject: [PATCH 2/2] docs: firmware: Document parameters passed to firmware and alignment requirement Date: Sat, 10 Jul 2021 22:28:21 +0800 Message-Id: <20210710142821.4168-2-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210710142821.4168-1-bmeng.cn@gmail.com> References: <20210710142821.4168-1-bmeng.cn@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210710_072831_659884_C8C664E2 X-CRM114-Status: GOOD ( 10.38 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This updates documentation to describe parameters passed to firmware from previous booting stage, and corresponding address alignment requirement. This also fixes a typo in fw_dynamic.md (it's => its). Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [bmeng.cn[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This updates documentation to describe parameters passed to firmware from previous booting stage, and corresponding address alignment requirement. This also fixes a typo in fw_dynamic.md (it's => its). Signed-off-by: Bin Meng Reviewed-by: Anup Patel --- docs/firmware/fw.md | 7 +++++++ docs/firmware/fw_dynamic.md | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/firmware/fw.md b/docs/firmware/fw.md index cc0cc9e..a3bb70c 100644 --- a/docs/firmware/fw.md +++ b/docs/firmware/fw.md @@ -9,6 +9,13 @@ OpenSBI generic library code. The supported firmwares type will differ in how the arguments passed by the platform early boot stage are handled, as well as how the boot stage following the firmware will be handled and executed. +The previous booting stage will pass information via the following registers +of RISC-V CPU: + +* hartid via *a0* register +* device tree blob address in memory via *a1* register. The address must be + aligned to 8 bytes. + OpenSBI currently supports three different types of firmwares. Firmware with Dynamic Information (*FW_DYNAMIC*) diff --git a/docs/firmware/fw_dynamic.md b/docs/firmware/fw_dynamic.md index 01f43f9..7b9b192 100644 --- a/docs/firmware/fw_dynamic.md +++ b/docs/firmware/fw_dynamic.md @@ -6,8 +6,9 @@ information about next booting stage (e.g. a bootloader or an OS) and runtime OpenSBI library options from previous booting stage. The previous booting stage will pass information to *FW_DYNAMIC* by creating -*struct fw_dynamic_info* in memory and passing it's address to *FW_DYNAMIC* -via *a2* register of RISC-V CPU. +*struct fw_dynamic_info* in memory and passing its address to *FW_DYNAMIC* +via *a2* register of RISC-V CPU. The address must be aligned to 8 bytes on +RV64 and 4 bytes on RV32. A *FW_DYNAMIC* firmware is particularly useful when the booting stage executed prior to OpenSBI firmware is capable of loading both the OpenSBI firmware and