From patchwork Mon Mar 4 12:15:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang W X-Patchwork-Id: 1907533 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=guZQ5r7J; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=hlx3CLo6; 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=b7bzY1th; 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 4TpHl00PC8z23fC for ; Mon, 4 Mar 2024 23:17:32 +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: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=x7K5ienNK6crpGr6tsGRDSD9e9o8VaHohIyFPcInO6c=; b=guZQ5r7JRYlU+S tSGB4hh7PUZ7D8j5pm2n3EMRaQhX8XxEO00rX21zjlYF4KW9KGE9IP21igtdpvRaoAxIB3XKbw9cM fhXmNhabe0b1b07Ost3+LTqkKLbWZuvGQUs36Lt7j0pQNMUfue2EwZoAIdChcgUWsBOpD4WNxcFU8 8FtD4x5hK/4SklidwK2JBcqoUpRD0fSiXgOxJPy/vFuzg7LHlEuEUY8JXVfKzrv6G6tpJbbVR61R7 Nl6Lye+METWu92JzGXFe0FKFJAZ90nKv0QmrBT5je2Kyxb7wNe7bcZfzWt+5OlBUYmyl3yLxASRD9 ri29UFCGm6eiNPN9R42A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Ft-00000008ws5-0NiX; Mon, 04 Mar 2024 12:17:17 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fq-00000008wqv-3qgx for opensbi@bombadil.infradead.org; Mon, 04 Mar 2024 12:17:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=ofhczYxSmW7ffYGcGsi95hrSaEZMimYZ6V+uCGbfmmc=; b=hlx3CLo60/xZojJEGnHFsj59TE kA3BN1m4/BmSr3ZWT7RRsEzP+E+PXs+fDIeBEKKc7QpVyXLMZV/a7vvFbH3WiaeH8Pt09FEPe9v0+ q2GqXPNOe/HA5Z2uHuF5wbgeluGED7/ngqk0CHrCg9vxxx8NFVthz9VhQwgmUdtzZpXxpyk0V0Iqt Gnhde7lNjqxKon1bmzh5Gnrq+u4u7UIQZkWGedgipByUPV0AEuIPQ5hOXz4ruOCwUiDnFP5DNd13P PWDc+MaMKYqadHnwmBvoKPlqFAbh+m3bkTpis0c2jL/zil7X5I5wa+g8+UYKiU+tBFTjd5eDmqfKb B17iV16g==; Received: from m16.mail.126.com ([220.197.31.6]) by desiato.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fm-00000004rHN-3lrv for opensbi@lists.infradead.org; Mon, 04 Mar 2024 12:17:13 +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=ofhcz YxSmW7ffYGcGsi95hrSaEZMimYZ6V+uCGbfmmc=; b=b7bzY1th/4MY0Oi1aK0eW SUoKbR6fyMjNrSAD7i8g4Jn5Hv37u2/4LEjIQq3n2ntfSlCTkroGs4QPG5+Eie97 U+qV7E2lqo3En6exyj1lsrX8MqzlPdshQMu5TUeWmrXqyZZ64vhb2KvH8+KTwnq3 lYyGhZASwv94+pAw2MVy6M= Received: from T490.lan (unknown [112.83.183.140]) by gzga-smtp-mta-g0-0 (Coremail) with SMTP id _____wD33wl_u+VlK7dEAA--.3521S6; Mon, 04 Mar 2024 20:16:03 +0800 (CST) From: Xiang W To: opensbi@lists.infradead.org Cc: Xiang W , anup@brainfault.org Subject: [PATCH v6 4/5] firmware: fw_base.S: Remove _relocate_lottery Date: Mon, 4 Mar 2024 20:15:51 +0800 Message-ID: <20240304121557.502655-5-wxjstz@126.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304121557.502655-1-wxjstz@126.com> References: <20240304121557.502655-1-wxjstz@126.com> MIME-Version: 1.0 X-CM-TRANSID: _____wD33wl_u+VlK7dEAA--.3521S6 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zr4UKry3CFyfJr1ftr4rGrg_yoW8ArWfpr nrJay7Kr4rK343X3W0ga15Wr15Xw4UXay7uayxKFn3ZryfZF4fZFy8Jr95XrWvq34rt3y2 qa42k34UZ3s0yF7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pEwZ2xUUUUU= X-Originating-IP: [112.83.183.140] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBdQeXOmSdLzkOYQABse X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_121711_496563_DD1E253F X-CRM114-Status: UNSURE ( 6.28 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: Remove _relocate_lottery and use _boot_status instead Signed-off-by: Xiang W --- firmware/fw_base.S | 17 ++++++ 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index d87c0a5..d83397e 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -14,8 +14,9 @@ #include #include List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Remove _relocate_lottery and use _boot_status instead Signed-off-by: Xiang W Reviewed-by: Anup Patel --- firmware/fw_base.S | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index d87c0a5..d83397e 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -14,8 +14,9 @@ #include #include -#define BOOT_STATUS_RELOCATE_DONE 1 -#define BOOT_STATUS_BOOT_HART_DONE 2 +#define BOOT_STATUS_LOTTERY_DONE 1 +#define BOOT_STATUS_RELOCATE_DONE 2 +#define BOOT_STATUS_BOOT_HART_DONE 3 .macro MOV_3R __d0, __s0, __d1, __s1, __d2, __s2 add \__d0, \__s0, zero @@ -58,9 +59,9 @@ _start: bne a0, a6, _wait_relocate_copy_done _try_lottery: /* Jump to relocation wait loop if we don't get relocation lottery */ - lla a6, _relocate_lottery - li a7, 1 - amoadd.w a6, a7, (a6) + lla a6, _boot_status + li a7, BOOT_STATUS_LOTTERY_DONE + amoswap.w a6, a7, (a6) bnez a6, _wait_relocate_copy_done #ifdef FW_PIC @@ -101,8 +102,6 @@ _relocate: blt t2, t0, _relocate_copy_to_upper _relocate_copy_to_lower: ble t1, t2, _relocate_copy_to_lower_loop - lla t3, _relocate_lottery - BRANGE t2, t1, t3, _start_hang lla t3, _boot_status BRANGE t2, t1, t3, _start_hang lla t3, _relocate @@ -119,8 +118,6 @@ _relocate_copy_to_lower_loop: jr t4 _relocate_copy_to_upper: ble t3, t0, _relocate_copy_to_upper_loop - lla t2, _relocate_lottery - BRANGE t0, t3, t2, _start_hang lla t2, _boot_status BRANGE t0, t3, t2, _start_hang lla t2, _relocate @@ -474,8 +471,6 @@ _skip_trap_handler_rv32_hyp: .data .align 3 -_relocate_lottery: - RISCV_PTR 0 _boot_status: RISCV_PTR 0