From patchwork Fri Jun 26 01:26:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1317622 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=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=uwYv5kg3; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=LhphQiNR; 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=mF2dcmmK; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 49tbzS2rvfz9sPF for ; Fri, 26 Jun 2020 22:39:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XxGPR8A4tXOJk1p34hrKgriVvMSAekH4yaNZiO/BZV4=; b=uwYv5kg3ddrHKfqHhxCLk2v+h4 3syfcaDxsPWLQfrUfMhrUSD4UNC+n6dSInrc3DyABScl7yfI02wgX5BYLCcjU7ZQ/3lSrmyMYiWwo BmHjq7BDmZZh2v3jP4UnoGia5g68l4iCYGKJsRoNSDPGDnACMbX3JbTpulZ7M4FJL5L91pDLyddxp 0r5jwDjG3cdG5DON6ytMVADFg2ibdN1ZLPFB/tzsZZ4/RXhhaIp+NHU4cUkP9b6B+94hiWYydMuhQ vvNUdpzP9yyIrlRlkr5cn1NU7/RArgPl8txJFC4M1Mvlz5Yx4MgkBxutM6+lVltCNHINHOK2FDrCL qDm4cCAg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jond7-0002bg-BX; Fri, 26 Jun 2020 12:38:53 +0000 Received: from casper.infradead.org ([90.155.50.34]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jolGs-00014E-Ve for opensbi@merlin.infradead.org; Fri, 26 Jun 2020 10:07:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BRtZcu+jTfzMqwSnmvF+qwd44/1XvJuWGWXA4JGAAmI=; b=LhphQiNRQNrKTdDZlItSgaQrE1 NxwBhKbFQBVXDwmSfjvG4fiK5PCOAnmCs0PfkLskKb6U2owXXh6nzLZBLuXoc2Qu2k7gpyNR9MRTf s8PX+UAyEO5EH2uM8ZEg68a1tsYwufcytkWaOi5cptZLuvxktDYCEA1YsuRcoAsVDtsQtpCj8SBqY HWJPSyltOhvWmTewtf1HkIyUXKaEMyF52RwPSKbR8wl/SRxJ5pGDc/LbjMdAEceSJlQSJPY/SY8G4 loUIKmXjXOepn/6Y01ceOHjsAEClj6CXRiDE+OTFAOwlBh4B6iqVraZ1tzDaHZ6WAublbKdJriD3R U9Qn9ijQ==; Received: from mail-vk1-xa31.google.com ([2607:f8b0:4864:20::a31]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jokPw-00054n-Pq for opensbi@lists.infradead.org; Fri, 26 Jun 2020 09:13:26 +0000 Received: by mail-vk1-xa31.google.com with SMTP id h190so2057615vkh.6 for ; Fri, 26 Jun 2020 02:13:03 -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; bh=BRtZcu+jTfzMqwSnmvF+qwd44/1XvJuWGWXA4JGAAmI=; b=mF2dcmmKxsM8C/fxkp/F0Hj3mkPbHD1fZSkEZsUyTYQECbEbF5sGfB0wC6gPabuTpA jtxs6kl39n2tA+DuGkJZqW+pxCg7L/ylD9jqAP8aMtaRT/sAubbS90EzwTld8Qya9k5N Tuq8sLOV4M9kJJ042/lsvd7VIKYyU1CAkmPuy6J+I9uFY/gIVIPdDCMoylS/B2KFYhns CZxnk1+j0E+HSQgw2PVCk/rvv1VNCJMPT+y95q7RKmO7uSkNYe7T5S+mdXdmAVPResaP xF6ZVLpYNM2fDhnTOBUIx3pSBOgcO6fkwOXYnK++QZOnpn6B0dz2U6kE5GJ2VIlg9Bdt oZJw== 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=BRtZcu+jTfzMqwSnmvF+qwd44/1XvJuWGWXA4JGAAmI=; b=Hmld1c8cPuonUJ+i8DHVu612IwSOeO2lhFGPYfzUI5JvRSYCW977uI3jVUKcqlSfjl WJ8wMwVko9MyNoEl7S1A0SitA47TEHEo5xNnbEQ1erJ/utydwLHHGjZc+k8bfTyv+sz0 2ES/2itoEb5LmW3IH0CchDRxGtlTBFur6FB3h2RUEkhvoFP5OMea32fqAmstS1UKJVYG 37gv2K5ogSJQ+dM0yt7X2W3arUawoxg37jfdDYrD6qHaF9/k93sVLO5SqKegMLA30g7U gXASNkftbBtZ6g/m1zasybKWsFCibK8OizeuV13CAiTAZkXgysMTtdgZbCz17Ib/oGy/ HkZQ== X-Gm-Message-State: AOAM533Ccmx85yomJ89ujhujpjoQgtGG1cO8B9Ev1p7CnNXpYhAzBVNv eCptEiMDJuAb7frQPnxhDU/8fFvc X-Google-Smtp-Source: ABdhPJyX3Ic3WvD+J+eZn7id1BIZm9oumHzW0EinMRk329jQQyGrL/yDB/1umm8XjESHdeU0s37n6Q== X-Received: by 2002:aa7:85c6:: with SMTP id z6mr516690pfn.8.1593134778914; Thu, 25 Jun 2020 18:26:18 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id a12sm24490964pfr.44.2020.06.25.18.26.17 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Jun 2020 18:26:18 -0700 (PDT) From: Bin Meng To: Atish Patra , opensbi@lists.infradead.org Subject: [PATCH v2 3/3] docs/platform: sifive_fu540: Update U-Boot instructions Date: Thu, 25 Jun 2020 18:26:04 -0700 Message-Id: <1593134764-16743-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1593134764-16743-1-git-send-email-bmeng.cn@gmail.com> References: <1593134764-16743-1-git-send-email-bmeng.cn@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200626_101306_185978_2A8BAD98 X-CRM114-Status: GOOD ( 18.90 ) X-Spam-Score: -2.1 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.1 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:a31 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [bmeng.cn[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bin Meng MIME-Version: 1.0 Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Bin Meng U-Boot v2020.07 release adds SPL support to SiFive HiFive Unleashed. Update the doc to mention that detailed build instructions are in the U-Boot doc. This also adds detailed command line description to show how to boot U-Boot v2020.07 S-mode payload in the QEMU chapter. Signed-off-by: Bin Meng Reviewed-by: Atish Patra --- Changes in v2: - fix the typo in the doc docs/platform/sifive_fu540.md | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/docs/platform/sifive_fu540.md b/docs/platform/sifive_fu540.md index 9342846..1008432 100644 --- a/docs/platform/sifive_fu540.md +++ b/docs/platform/sifive_fu540.md @@ -41,13 +41,14 @@ make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=/arch/riscv/bo **U-Boot Payload** The command-line example here assumes that U-Boot was compiled using the -sifive_fu540_defconfig configuration and with U-Boot v2020.01 (or higher). - -The detailed U-Boot booting guide is avaialble at [U-Boot]. +sifive_fu540_defconfig configuration and with U-Boot v2020.01, and up to +v2020.07-rc3. ``` make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=/u-boot-dtb.bin ``` +For U-Boot v2020.07-rc4 or later releases, SPL support was added in U-Boot. +Please refer to the detailed U-Boot booting guide available at [U-Boot]. Flashing the OpenSBI firmware binary to storage media: ------------------------------------------------------ @@ -155,13 +156,37 @@ Linux kernel. When U-Boot v2020.01 (or higher) is used as the payload, as the SiFive FU540 DTB for the real hardware is embedded in U-Boot binary itself, due to the same reason above, we need to switch the U-Boot sifive_fu540_defconfig configuration -from CONFIG_OF_SEPARATE to CONFIG_OF_PRIOR_STAGE so that U-Boot uses the DTB -generated by QEMU, and u-boot.bin should be used as the payload image, like: +from **CONFIG_OF_SEPARATE** to **CONFIG_OF_PRIOR_STAGE** so that U-Boot uses the +DTB generated by QEMU, and u-boot.bin should be used as the payload image, like: ``` make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=/u-boot.bin ``` +U-Boot v2020.07 release added SPL support to SiFive HiFive Unleashed board, +hence a build error will be seen after you switch to **CONFIG_OF_PRIOR_STAGE**. + +``` +./tools/mkimage: Can't open arch/riscv/dts/hifive-unleashed-a00.dtb: No such file or directory +./tools/mkimage: failed to build FIT +Makefile:1402: recipe for target 'u-boot.img' failed +make: *** [u-boot.img] Error 1 +``` + +The above errors can be safely ignored as we don't run U-Boot SPL under QEMU. + +Run: +``` +qemu-system-riscv64 -M sifive_u -m 256M -nographic \ + -bios build/platform/sifive/fu540/firmware/fw_payload.bin +``` +or +``` +qemu-system-riscv64 -M sifive_u -m 256M -nographic \ + -bios build/platform/sifive/fu540/firmware/fw_jump.bin \ + -kernel /u-boot.bin +``` + While the real hardware operates at the 64-bit mode, it's possible for QEMU to test the 32-bit OpenSBI firmware. This can be helpful for testing 32-bit SiFive specific drivers.