From patchwork Tue Jun 23 09:56:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1316750 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=Jq5iGKCu; 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=mtBxYYYD; 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 49srFm6rCXz9sRf for ; Thu, 25 Jun 2020 16:48:44 +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=4eNbcsvABt14YkljpA+fRvLP9MkE7mgoJnbftTKBfB4=; b=Jq5iGKCuWe5t1wfdJD5FS4Xg/l I9y3m+1JhQCfKGfN4FJv1q2PVmVT+uy3VNvmWwMgWXDYBBM8JYXR1Zc1i89KCHWf2UsaiJAOr0mv+ wpm7f0Dxodqpfbd6sEgmNFVcxE96gfUZtIcK4GCTj30ftJLFLXaxPwx5MYa2sJu9Bw3imm6C45HWj VvoVo2mXoKNFCMxKp6IrkYQHn2hdxjuDquiVGVdE1hu8Ygl7gEEmF6/Pe9eXyAh1ipLlR39s+mQkM lfljgLpAsVbd7q9itcG6ZvKIXvic+5NY3ig5rHzLhC1C2VqXqYb1+Z+6VmEmvkRMGA2K498Z6fbix gycMmvaw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joLgd-0001Y5-27; Thu, 25 Jun 2020 06:48:39 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnffp-0008GG-2E for opensbi@lists.infradead.org; Tue, 23 Jun 2020 09:57:02 +0000 Received: by mail-pg1-x52d.google.com with SMTP id p3so6950038pgh.3 for ; Tue, 23 Jun 2020 02:57:00 -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=sK0gvzoBDYpAbueQ2bGRHTUfT9hkJ4pEVMAkURsHX+Q=; b=mtBxYYYDgSiOgDWNm69wJKRsDgD4PIzhKLrOnvhO6HzT/VH0CdLL/3A7jxQC/M81nC RW+y6d1C/BzgTVGcN6ocyZSNFQLjCIXJ+0uv2lTbbyPLIEFj0WrnU35m6vjr1Khnww6a MAvn6+v05ys3tR/oHXxo8rFJO3cF7Q1iG5Gc6gW9Y6zECV9/zgepv7cVMtX152ZJkJYZ 7b58tc77qI8AxkoUlakGWQ9W2mfX17eYKprZLvmS7oc33qHgM3tl4EeCs/Kht7sYxypJ f7Pnj7+SVEsVPV3zjceJzzQSFS59/Hxryr7oqV3DcMXRfvsMsjNQjFMf40wIBwKPzPRJ gduw== 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=sK0gvzoBDYpAbueQ2bGRHTUfT9hkJ4pEVMAkURsHX+Q=; b=YcmN/MINiz4f3V/GbplLDqHvxSAJCfUFIZrmFkKKSG3m5K8/gXRuXlbLG51WIOkXuw Z8nDbFr9Hebv0ZPw5MyRNvFQC9bKRleeAIdyH0dJhPXjRK5mmDQOHYPO76qG44RYhDcc o41Ds2Oj2uGpa02Gzkena1uwdsC8OVMNJEHgx6oD678Qr1xjIHLg4C95F/XUN3IWNuQE Xrl9EN11W0eFnXdK1vwfaD1Q6IuWDIojzomFtosWWcQX1DgXbuora6fShmMNc0/kgsP1 +G2xZUZDbZhxsLnnhTpDvUzYSBZs6Rs3SOmkvz6etUXQT8OOfGA+Bq2UML7EymVAWwPX AKLw== X-Gm-Message-State: AOAM533lMlCqyvcrgDbLrA+WaPE4nluYwSueItJbXED3URsuPtrvO9S7 dI24FKIsItfuIXs0lakccVA= X-Google-Smtp-Source: ABdhPJzqqYnDhjAMjtVR/m32DFhw51xEY/CzTao0fxkqnamhmLUL/XwJzTqFm2CsvQwRew6MC9BoMQ== X-Received: by 2002:aa7:9738:: with SMTP id k24mr22877101pfg.44.1592906219008; Tue, 23 Jun 2020 02:56:59 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id mw5sm2014248pjb.27.2020.06.23.02.56.58 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 23 Jun 2020 02:56:58 -0700 (PDT) From: Bin Meng To: Anup Patel , opensbi@lists.infradead.org Subject: [PATCH 3/3] docs/platform: sifive_fu540: Update U-Boot instructions Date: Tue, 23 Jun 2020 02:56:52 -0700 Message-Id: <1592906212-13711-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1592906212-13711-1-git-send-email-bmeng.cn@gmail.com> References: <1592906212-13711-1-git-send-email-bmeng.cn@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) 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:52d 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 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-Mailman-Approved-At: Thu, 25 Jun 2020 02:48:36 -0400 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 --- 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..31bdf09 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 avaialble 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.