From patchwork Tue Jul 25 14:06:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tanmay Shah X-Patchwork-Id: 1812710 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=GiLMhXWA; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R9LqQ0Jwjz1yYc for ; Wed, 26 Jul 2023 01:41:38 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E55386797; Tue, 25 Jul 2023 17:40:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="GiLMhXWA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 939F6862E8; Tue, 25 Jul 2023 16:08:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on20624.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8d::624]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 344D186377 for ; Tue, 25 Jul 2023 16:08:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=tanmay.shah@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FzPRlILROGHoH71V6UJvoKvdu8DuL+2BS8AG9LRueev0+5chCAydzsT4Kdm4XxJSxIufgN29S/oos1fwcSTgKH6Lm5CKlB0ZJ71wf0I6p0m0yBsbYS+1NghWd7ufTNL2JOG/7dpHxFyQsZ02v+8Y9eAagA17zwYmA+FETegTMl8CRa2t+z/aBlVZ263Va0GuK2PmnuBj8QhrQ58JLruS63ViHZM3J6g/8uq7nSqVERSPrKIeoueNpD3S7+wTe+OM3e5YRK+iCYTGiO0ez2i212eyBApS8weYFCq7b1DONixJ8gQPOFHYLKXlNzCB5wjKKC8Ag04lHjbkRRNq85137g== 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=hg7QPUYUSLSAoJWjkLROMp0EpmIUU8JoZn5Yig+5auE=; b=QaIk30KL3APoyM5czUMhDBncHgfFW5dWW4OnwAa6U0ZfCvDNMn38+D+PiFLnu2Q5LI/dxCUXaw8LYb3vTicZlScrg9nJVSd+JCYoUQ0H+hn4rfA6xv3mRZyXClHyPwLsIYaObSF0CFu0jY8Z8MY2bK6obUxz++Y4CndkCGaZqJR1fYQnD4iHiL5gDoFZrgyIv63mJTB9UFK6zrC2mhLeBp2rnnJsd07M7hNI4pW2tr7fYYHroJNjxSuEmBcaQbEJfecIZfaCDBPk/ghXv32c0Vtf1y9mdzoLBb/0xEe4RqbY+FjQIXy1lh952TJy1VWkwCIl4xjCQfyCM1pz/lTlZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=chromium.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hg7QPUYUSLSAoJWjkLROMp0EpmIUU8JoZn5Yig+5auE=; b=GiLMhXWAf8MaMktngQJxmXTBLtBJfFNVNZD9y8+HbJWcymcQunX+M6EYUbzKmB3oECInvj8CKPVKELNL/3ZUp8BtN1jlOdanwfcTaUHRA/PVZ4DWCeaVve7DP0eYKeOF4iwFKNLaY656/O6u1clZjXOO5IrfrusesfphANu89UY= Received: from DS7PR05CA0082.namprd05.prod.outlook.com (2603:10b6:8:57::23) by MN0PR12MB5713.namprd12.prod.outlook.com (2603:10b6:208:370::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul 2023 14:08:03 +0000 Received: from DM6NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:8:57:cafe::62) by DS7PR05CA0082.outlook.office365.com (2603:10b6:8:57::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.25 via Frontend Transport; Tue, 25 Jul 2023 14:08:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT082.mail.protection.outlook.com (10.13.173.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.29 via Frontend Transport; Tue, 25 Jul 2023 14:08:03 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 25 Jul 2023 09:08:01 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 25 Jul 2023 09:07:49 -0500 Received: from xsjtanmays50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Tue, 25 Jul 2023 09:07:48 -0500 From: Tanmay Shah To: Simon Glass , Tom Rini CC: , , , Michal Simek , Venkatesh Abbarapu , Mathieu Poirier , Nishanth Menon , Tanmay Shah Subject: [RFC PATCH 01/10] remoteproc: move resource table definition Date: Tue, 25 Jul 2023 07:06:41 -0700 Message-ID: <20230725140650.951581-2-tanmay.shah@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230725140650.951581-1-tanmay.shah@amd.com> References: <20230725140650.951581-1-tanmay.shah@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT082:EE_|MN0PR12MB5713:EE_ X-MS-Office365-Filtering-Correlation-Id: 53a616b0-3961-456d-fe69-08db8d188fe4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N8SclfYnpPiYUjjTJIWtR0Fc1tpZzwpM+QlUVrZyglLLopCbzSAywJ+UDJHRS1dYbGxgEh9f7zvJ3gCOkVsFGoKy6wNk2kOp6/sdofwaSz3L20C93VD/fyF4H0hc+9XlJ3yXtww2oPbjXttGQNHp3hK//RiKp6NqdX/dQrKotkKEwbiuprK55bGn4tKg2pWDHqwXhIzmcHJhSVE9+yD9jMLhugH0Kfkl4W+PfyOZYmelBFMQ2VrCEYUb9Rz0XxPugKZSMCUDzkPebeow4LRnTbN6kVni98cZiYf1sMc/mSRfyzcVbNtjhq7dM8V/A/eChxNsBU6l4HcQfZtAi+cGoIsXJMwtR/gZlN23EZ0C2PgTEIdVcn0owuQCb3SYiNq3Ow6GQsBSCuF0vsZdt2apkioSmhctkll+b5pBuv2wxAlw9Wis/1jsU0uIHtGU8kbd6XbDU3CilsEwre+pkuAtOA83a2O9ZH1hHGxqwAcGl5Wulrg4+q/uh0Ya1FGz+Zik8hwA+EExZumzFPakpwc0aic/J6+OETE54OPAhNvzITZtmJ8QYhe/01B471q5S8hFFogKTpvWcKHty7+cbMyvOcVBul021Fx3/mKytlnBlGxo4o9WVohuWnQ/BMn4UPBINrb3sjPAwW2qjxKNTsYdUxM4EwLLuKlhUfe9HLLxc3JbfxAdiE8HwOU6LpUehPWEFhGPSYu5HFQZ5TOxMA5Dew7RnrJJSCVsLRDQmouA1UvgCLuHZAkok7dDfxQTkCbH6djROvctJbYewyHmIaGocA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(136003)(376002)(396003)(39860400002)(346002)(82310400008)(451199021)(46966006)(36840700001)(40470700004)(36756003)(86362001)(356005)(81166007)(40460700003)(54906003)(2906002)(110136005)(478600001)(82740400003)(40480700001)(36860700001)(186003)(336012)(1076003)(26005)(2616005)(426003)(47076005)(5660300002)(8676002)(41300700001)(6666004)(44832011)(70206006)(4326008)(83380400001)(316002)(8936002)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 14:08:03.5156 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53a616b0-3961-456d-fe69-08db8d188fe4 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5713 X-Mailman-Approved-At: Tue, 25 Jul 2023 17:40:30 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Resource table is defined in multiple files. Instead move definition to remoteproc header file and include header file in multiple c files where resource table definition is needed. Signed-off-by: Tanmay Shah Reviewed-by: Simon Glass --- drivers/remoteproc/rproc-elf-loader.c | 33 --------------------------- drivers/remoteproc/rproc-uclass.c | 7 ------ include/remoteproc.h | 33 +++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 40 deletions(-) diff --git a/drivers/remoteproc/rproc-elf-loader.c b/drivers/remoteproc/rproc-elf-loader.c index b185a6cafb..8a13872f85 100644 --- a/drivers/remoteproc/rproc-elf-loader.c +++ b/drivers/remoteproc/rproc-elf-loader.c @@ -12,39 +12,6 @@ #include #include -/** - * struct resource_table - firmware resource table header - * @ver: version number - * @num: number of resource entries - * @reserved: reserved (must be zero) - * @offset: array of offsets pointing at the various resource entries - * - * A resource table is essentially a list of system resources required - * by the remote processor. It may also include configuration entries. - * If needed, the remote processor firmware should contain this table - * as a dedicated ".resource_table" ELF section. - * - * Some resources entries are mere announcements, where the host is informed - * of specific remoteproc configuration. Other entries require the host to - * do something (e.g. allocate a system resource). Sometimes a negotiation - * is expected, where the firmware requests a resource, and once allocated, - * the host should provide back its details (e.g. address of an allocated - * memory region). - * - * The header of the resource table, as expressed by this structure, - * contains a version number (should we need to change this format in the - * future), the number of available resource entries, and their offsets - * in the table. - * - * Immediately following this header are the resource entries themselves. - */ -struct resource_table { - u32 ver; - u32 num; - u32 reserved[2]; - u32 offset[0]; -} __packed; - /* Basic function to verify ELF32 image format */ int rproc_elf32_sanity_check(ulong addr, ulong size) { diff --git a/drivers/remoteproc/rproc-uclass.c b/drivers/remoteproc/rproc-uclass.c index 50bcc9030e..d697639cdd 100644 --- a/drivers/remoteproc/rproc-uclass.c +++ b/drivers/remoteproc/rproc-uclass.c @@ -23,13 +23,6 @@ DECLARE_GLOBAL_DATA_PTR; -struct resource_table { - u32 ver; - u32 num; - u32 reserved[2]; - u32 offset[0]; -} __packed; - typedef int (*handle_resource_t) (struct udevice *, void *, int offset, int avail); static struct resource_table *rsc_table; diff --git a/include/remoteproc.h b/include/remoteproc.h index f48054de6b..af5c584e6e 100644 --- a/include/remoteproc.h +++ b/include/remoteproc.h @@ -15,6 +15,39 @@ */ #include /* For platform data support - non dt world */ +/** + * struct resource_table - firmware resource table header + * @ver: version number + * @num: number of resource entries + * @reserved: reserved (must be zero) + * @offset: array of offsets pointing at the various resource entries + * + * A resource table is essentially a list of system resources required + * by the remote processor. It may also include configuration entries. + * If needed, the remote processor firmware should contain this table + * as a dedicated ".resource_table" ELF section. + * + * Some resources entries are mere announcements, where the host is informed + * of specific remoteproc configuration. Other entries require the host to + * do something (e.g. allocate a system resource). Sometimes a negotiation + * is expected, where the firmware requests a resource, and once allocated, + * the host should provide back its details (e.g. address of an allocated + * memory region). + * + * The header of the resource table, as expressed by this structure, + * contains a version number (should we need to change this format in the + * future), the number of available resource entries, and their offsets + * in the table. + * + * Immediately following this header are the resource entries themselves. + */ +struct resource_table { + u32 ver; + u32 num; + u32 reserved[2]; + u32 offset[0]; +} __packed; + /** * struct fw_rsc_hdr - firmware resource entry header * @type: resource type