From patchwork Fri Feb 23 08:18:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 1903125 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=T0ZSRUco; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=outlook.com header.i=@outlook.com header.a=rsa-sha256 header.s=selector1 header.b=az6HF/Ig; 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 4Th2wg3qD7z23l1 for ; Fri, 23 Feb 2024 19:19:15 +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=z2EXYte/ZMRKRQB/VkRobUPB0I7/0hH8t6Z28uuu/nw=; b=T0ZSRUcorvujLS c7QkRwesStPgrZ0eh7AVO5M7NNL0EWjh3v+2cZlt9FfaElB9u3slgV9Tui+ypM7taIxwNU71RLIFu JXFcZHPrNFKFhdJuvhzXwXAG7WdW8mvPgC7+j6An2Gki83FJ4Gf/2nez+jbxiMV1mhwDLFrXaldx8 g2BeFr04g41lE8+HRqm96oboA5Kvt/lkz/tfCjovuCo01+k7DtOhZZ0pzAK7q5JAMHNO2YJHkd+1F r9zUmb3cJJVW54je0d2dJJu4lz24Tt/De2GlF6v5eCA7XVLuEaOy+zoMshlt4G6TM59uUj9kuXK3D CdWD+2I8nFYfuT36QI8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdQlv-00000008R8B-1WlE; Fri, 23 Feb 2024 08:19:07 +0000 Received: from mail-bn7nam10olkn20801.outbound.protection.outlook.com ([2a01:111:f403:2804::801] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdQls-00000008R5Y-0CaG for opensbi@lists.infradead.org; Fri, 23 Feb 2024 08:19:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TaCdFiIxiINI82a5nHUilP6tkHhNwi27jBf5OQjgeng0vvfyo++VuozWLcKdwjcJKauwxei33OYcL8dad0TfaZhmJ07NCIHS05z/bU8vCGm5L2YwH02Z1hh674XZSp1HRG1X/CxfUk+lthvAVFVXnWFOg6iVj1A1jVCfk3zEh7Iku0xvOUfE3a1n7LSCAw2dlhHSW34i/bUtbpI3H1VQU/UPS8X4B89Tf8EMyaeQOAAt6+ObC+9tEPabf2TC1wlZfP8cQ+mIfu939c23h+dEDDywBD22mKrWNNqPb6PVHBXmkrESI5zbxaA/PWcDNFdnNfzFtD5YCH0W9vicOhCMUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8MIFFTCrkibFo4LgMJMiV3NlMi7HPd7ubIAeeK8V3nQ=; b=a0QR8M8oi3W9bEBhybuveCmTzdrmz7uQ3yxQxwB/zFTBm2hW3jiIGd8bTArzcHqrKApy9QrMCvjTv7hxrhLT7ZOJU15WSb/nSpz6PF0u3Y+Wqk61IWYnqC5Lf6bLyFVG4qJV9FuoPYyGOpjg3MbJsRwZqXvRbUOTFdfea7fQezg7IqyAkXCmE7r+JbOXS/nZ8GEe5+YoTaiYTRLFmE/csRrVaY9nwd6rQ+LW2/Q/v1VE/Dq4d4+/IIbOMoe0kjLFnIu2Zid4VCW6uya88Cc2nOqD71PhJqeitBGAbNRGN0Infam1v+ncueco6Sb60ovc453c+H6VISQ2ORXNrqQi6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8MIFFTCrkibFo4LgMJMiV3NlMi7HPd7ubIAeeK8V3nQ=; b=az6HF/IgfSewjer+cHznxkMsm8aRw+CNEOC4acV/G1riV35uLYBju1vG78Tg5dUA75j4JwhU4l7LxrmvHAWtL6qXx0HdmlV0Pw+ftGQqdEAqPo2g3pZTXj/SZ5thlh85wB4Yfrj9b2IdA4SbC9QWuWGCphuAs+WnX+j5ycAspTTVtWeOhuHh7XZM9nY0oPvudS54AR1mY54cjnaK1EVkTk2/QTNZEOdY8aCjBw797C2Z839uVAZEfa9a6AM62DkbaFQyf2IyCYkvyghPnUwMN1EwqlPICewVtGMx+gxQijiz+WGmSdcyOpATksCjqDQUsbwODNteiTNQC+31reX/Dw== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by SA1PR20MB7111.namprd20.prod.outlook.com (2603:10b6:806:3b1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.27; Fri, 23 Feb 2024 08:18:55 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::8615:efe2:7c8e:2041%3]) with mapi id 15.20.7316.018; Fri, 23 Feb 2024 08:18:55 +0000 From: Inochi Amaoto To: Xiang W , Anup Patel Cc: cyy@cyyself.name, opensbi@lists.infradead.org, Inochi Amaoto Subject: [PATCH v2 3/4] platform: Apply relocatable address Date: Fri, 23 Feb 2024 16:18:14 +0800 Message-ID: X-Mailer: git-send-email 2.43.2 In-Reply-To: References: X-TMN: [2oyGxcVUwBfJ54tUf/whLgv0nTh9LnkhfVehtG6Syh0=] X-ClientProxiedBy: TYWPR01CA0038.jpnprd01.prod.outlook.com (2603:1096:400:17f::8) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240223081815.295212-3-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|SA1PR20MB7111:EE_ X-MS-Office365-Filtering-Correlation-Id: 3049b3b3-7b4c-4f12-63e2-08dc344813f8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QKXDKsvXYoESsM9h0SbRTOPXxElJ6I7a2OMYK49WjC2EuhuvAQ7vZWDEmfoNH1+5iN3Jpps8627r20XWwEQ7Cf8L56bh+93ldRyJbNc8H7jV4mRgXlP7nAEIG/TDbX87EqQoagUJzKZENC6HpUdHcIzDCalap7pK++bP7dzjKj2YfKi2i8gX70Bxsie48XG/ADYtv5CNTXJwfU7fzA0uaRgSKF/t1PXQEUQV902qy0D3B9ffBcqe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v7Ho3GVY2I59CvMff/8m1GPcCgJmpDe4v6zwTa/TXu16uL0yYg7+xwI3xUWtkZ2KZnb9fSXO7geI2y0ugS/Fv0OrxyFTz/Lzs3tWfJqp3V7YT2hF2WYronBYKgB+LGuSuXKm6GT4fMRE/cUqlFaCzZlsy+rAHI91NzYkrql6gmQjj5pBKI490bVrcp8hI3b5vGpezhFZPO8dyQ6dM0yv0nQxydwxQCC1ryRd5Kg7tQFwet8ZXLq+u7nEc9QTC+kxscJDBIAW7DzSg3d+DUOQFMC9Zlqxv2Z32tPRXDnz5Sgw52W+Qln25SKNKhxv7KGjzwcCSAR8nnflVWsOz9FijtjYxW9edWPvw7A5ZQaCTGqhTXB4YMs5dIGlccQ+RW8zM2Sy1bho+iId4uSCe2YUGQXuyPxDuT4PfwDdo0K6rWvuTRqvwBL1wJ9qpbq+Re+utI0WoPTAsCWlOyrnv0KBCL6TEwO646ml3H+OFn33dejWqiBWbQ1kNRAxTSKst7hJub6x31frIiqWnFLPBlpYVNsmr+I1FVwPcZjcMNxtEhmwfyaJ71R2//qcpdj0N0dZp8r3+rEwaurYlTXKRY0Xd910ZFAy3NH+lsWJ/zerOLzvq7NyF+2o8Fb0oTRx/5gzrJmQtpO+ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3049b3b3-7b4c-4f12-63e2-08dc344813f8 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 08:18:55.8392 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR20MB7111 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240223_001904_176188_8F40C1F8 X-CRM114-Status: UNSURE ( 6.50 ) 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: Since jump and payload firmware support relocatable address, make general platform use runtime relocatable address. Signed-off-by: Inochi Amaoto --- platform/generic/objects.mk | 8 ++++---- platform/template/objects.mk | 17 +++++++++++++++++ 2 files changed, 21 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_PASS SPF: HELO matches SPF record 0.0 ARC_SIGNED Message has a ARC signature -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.0 ARC_VALID Message has a valid ARC 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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [inochiama(at)outlook.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. 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 Since jump and payload firmware support relocatable address, make general platform use runtime relocatable address. Signed-off-by: Inochi Amaoto Reviewed-by: Anup Patel --- platform/generic/objects.mk | 8 ++++---- platform/template/objects.mk | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/platform/generic/objects.mk b/platform/generic/objects.mk index 136853e..85aa723 100644 --- a/platform/generic/objects.mk +++ b/platform/generic/objects.mk @@ -27,12 +27,12 @@ FW_DYNAMIC=y FW_JUMP=y ifeq ($(PLATFORM_RISCV_XLEN), 32) # This needs to be 4MB aligned for 32-bit system - FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x400000))) + FW_JUMP_OFFSET=0x400000 else # This needs to be 2MB aligned for 64-bit system - FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x200000))) + FW_JUMP_OFFSET=0x200000 endif -FW_JUMP_FDT_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x2200000))) +FW_JUMP_FDT_OFFSET=0x2200000 FW_PAYLOAD=y ifeq ($(PLATFORM_RISCV_XLEN), 32) # This needs to be 4MB aligned for 32-bit system @@ -41,4 +41,4 @@ else # This needs to be 2MB aligned for 64-bit system FW_PAYLOAD_OFFSET=0x200000 endif -FW_PAYLOAD_FDT_ADDR=$(FW_JUMP_FDT_ADDR) +FW_PAYLOAD_FDT_OFFSET=$(FW_JUMP_FDT_OFFSET) diff --git a/platform/template/objects.mk b/platform/template/objects.mk index 0025928..b143cbc 100644 --- a/platform/template/objects.mk +++ b/platform/template/objects.mk @@ -63,6 +63,17 @@ FW_JUMP= # This needs to be 4MB aligned for 32-bit support # This needs to be 2MB aligned for 64-bit support # ifeq ($(PLATFORM_RISCV_XLEN), 32) +# FW_JUMP_OFFSET=0x400000 +# else +# FW_JUMP_OFFSET=0x200000 +# endif +# FW_JUMP_FDT_OFFSET=0x2200000 +# +# You can use fixed address for jump firmware as an alternative option, +# but this may fail when setting wrong FW_TEXT_START. Use with caution. +# SBI will prefer "_ADDR" if both "_ADDR" and "_OFFSET" are +# defined +# ifeq ($(PLATFORM_RISCV_XLEN), 32) # FW_JUMP_ADDR=0x80400000 # else # FW_JUMP_ADDR=0x80200000 @@ -84,4 +95,10 @@ FW_PAYLOAD_OFFSET=0x200000 endif # FW_PAYLOAD_ALIGN=0x1000 # FW_PAYLOAD_PATH="path to next boot stage binary image file" +# FW_PAYLOAD_FDT_OFFSET=0x2200000 +# +# You can use fixed address for payload firmware as an alternative option, +# but this may fail when setting wrong FW_TEXT_START. Use with caution. +# SBI will prefer "FW_PAYLOAD_FDT_ADDR" if both "FW_PAYLOAD_FDT_OFFSET" +# and "FW_PAYLOAD_FDT_ADDR" are defined. # FW_PAYLOAD_FDT_ADDR=0x82200000