From patchwork Tue Jan 2 15:14:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang W X-Patchwork-Id: 1881649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=LfO22sP7; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=126.com header.i=@126.com header.a=rsa-sha256 header.s=s110527 header.b=jcJ9Vf8D; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T4Gc05tzGz23dJ for ; Wed, 3 Jan 2024 02:14:40 +1100 (AEDT) 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: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:In-Reply-To:References: List-Owner; bh=WDPYtWRC4W5XHULjD1DYijC2DkKN0C1koQv9s4TOWT8=; b=LfO22sP79Y+kbz eZZYyygipeo99dSDyUNu47Lmo+TaFPaVb1wBaiAKgki+bAelwVriB6unv4HW9c+dnx3oh31/3bbTl PmqxIjBZwpDIW750lBH2mP9MRFQSrGNVg5yURpN6QJpeg4WINmz7tUc00Nx/0JUj6B815jl8II991 zQxksJ3f9N8NejuT5xmYW/LFph01Dmhaqu6CmpOyzncYLm+eP8sUx5n5+Lmc49CabglhldKUnPIpd MYPw8xISLiKF2eOVZEmJQjYfpxQnjsKPH3tRE8diQUQ9s+CQOFT1/9coIhqd04Jjd3cxbI8zka395 G6zPRIsTeQ3LIl/CbCrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rKgTK-008Llu-0T; Tue, 02 Jan 2024 15:14:26 +0000 Received: from m126.mail.126.com ([220.181.12.26]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rKgTH-008Lkb-0h for opensbi@lists.infradead.org; Tue, 02 Jan 2024 15:14:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=qVqHe oLcOsEV4Wfig+xzFZ7sqNjN/4xHD9x6HaUCkRQ=; b=jcJ9Vf8DYH/4z4rr44q8+ 74616sbt/x6SQ+RvzT7kVC9a3y9aP/4bm/dhGS4lyyAJKbgIrFktTZ35d+sXUOky cWb/3ZODgyxzYP0/BmimS97QZtRkU4fyHl/jjIVRIO0MyW99vZ6pih2DDAa2IFEH zLVHVY/qsbAVDy4ULhf+Vw= Received: from T490.lan (unknown [112.83.182.61]) by zwqz-smtp-mta-g5-0 (Coremail) with SMTP id _____wC3f7ZJKJRlbxUjAA--.13856S2; Tue, 02 Jan 2024 23:14:18 +0800 (CST) From: Xiang W To: opensbi@lists.infradead.org Cc: Xiang W Subject: [PATCH] firmware: fw_base.S: Improve loading u32 Date: Tue, 2 Jan 2024 23:14:11 +0800 Message-ID: <20240102151414.416711-1-wxjstz@126.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CM-TRANSID: _____wC3f7ZJKJRlbxUjAA--.13856S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7tFyUCw4fCFWrtw1UAFyxKrg_yoW8JFyfpr 43CayfCF4jg34SgryfXw48Zr45K3s8Gws8KayUuF1fAr1avr47ur9xtay3ZF1xtrWIy39Y vF1Ivr18Ca47CaUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0z_a9adUUUUU= X-Originating-IP: [112.83.182.61] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBcwxZOmSQAfxv8QAAsL X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240102_071423_593765_49409D14 X-CRM114-Status: UNSURE ( 6.45 ) X-CRM114-Notice: Please train this message. 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: lwu exists under the current rv64 and should also exist under the rv128 in the future, so I modified the conditions of conditional compilation so that it can adapt to the future situation Signed-off-by: Xiang W --- firmware/fw_base.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -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 [wxjstz[at]126.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 0.0 RCVD_IN_MSPIKE_L3 RBL: Low reputation (-3) [220.181.12.26 listed in bl.mailspike.net] 0.0 RCVD_IN_MSPIKE_BL Mailspike blacklisted 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 lwu exists under the current rv64 and should also exist under the rv128 in the future, so I modified the conditions of conditional compilation so that it can adapt to the future situation Signed-off-by: Xiang W --- firmware/fw_base.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index f7763f4..2f30d00 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -358,7 +358,7 @@ _scratch_init: /* t0 = source FDT start address */ add t0, a1, zero /* t2 = source FDT size in big-endian */ -#if __riscv_xlen == 64 +#if __riscv_xlen > 32 lwu t2, 4(t0) #else lw t2, 4(t0) @@ -424,7 +424,7 @@ _start_warm: /* Find HART count and HART stack size */ lla a4, platform -#if __riscv_xlen == 64 +#if __riscv_xlen > 32 lwu s7, SBI_PLATFORM_HART_COUNT_OFFSET(a4) lwu s8, SBI_PLATFORM_HART_STACK_SIZE_OFFSET(a4) #else @@ -440,7 +440,7 @@ _start_warm: beqz s9, 3f li a4, 0 1: -#if __riscv_xlen == 64 +#if __riscv_xlen > 32 lwu a5, (s9) #else lw a5, (s9) @@ -527,7 +527,7 @@ _hartid_to_scratch: * t2 -> Temporary */ lla t2, platform -#if __riscv_xlen == 64 +#if __riscv_xlen > 32 lwu t0, SBI_PLATFORM_HART_STACK_SIZE_OFFSET(t2) lwu t2, SBI_PLATFORM_HART_COUNT_OFFSET(t2) #else