From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 937F1CD4851 for ; Thu, 14 May 2026 16:21:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=cAlaUC+C7TO70Q5/EhBX948/0Dkd+NkfiadMk2VWktA=; b=0LeVaAR4ipLosDhZ6r4aoMr52/ U1Ai5QFSgpKESQ1LEj9lSj3IWQH9D60LDtf8U/nVCpPvldESc7aebWVOUGZS/e6VT7XoTatoCQgt2 NowecZbN1RCrM77Zgkhm8GNJ8KosPOAXac7Pc+Q6RwzlmO7QsIkGxLzfJZJjzMBsLGHuRsewzrdhy ymaaC5bcye2FN2Ua4MbXNLoOkWdLAafjyQ65bXndK677h4GSMrcZbnGnJlbIUp5Kd0r/9VpwWuFNh U0yMdTqYAgH+5qBtPT9wl4E0aWmAFgJeM79Y3bfwelGdfiGdpKavvmkMbKRXbkcC+CCQRmO9cKzwh KPbzRRwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wNYon-000000062Rv-1bHA; Thu, 14 May 2026 16:21:49 +0000 Received: from mail-westus2azlp170100005.outbound.protection.outlook.com ([2a01:111:f403:c005::5] helo=CO1PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wNYok-000000062Ph-2ivB for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2026 16:21:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZABSdCNAdbpkzkQ13lXqCUtfmef+a45x0g0qrGs1ZYftIEKaawwHgwZzmc7tjCZMeeE8j/wpWIBGRCkcO+a6+5cIk4MpCc8QVRFr/F5RI++9gbDLSOydClnMA6HklqnTq0iUxWFmr7UX6xbfOZ1Wyr9T7cMnVAtBiXFGEUImnGXC5DRyKip1Qjirr+acWWGGXLCDAtiSA5Udri9pJLwYED9wH13Kd7PS/CzVlmi7dMRE/MgaWqzOZSd0EFgXXnedy1HPj76qwOJWZXvFhvwpvOkYNqUu60doN6jfoMuOHfDVvOOT2GMAG+7ELV9sJM6yZ3m4s3aEM9KA2DVviO1VXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=cAlaUC+C7TO70Q5/EhBX948/0Dkd+NkfiadMk2VWktA=; b=GpiaAqYjMXi7xZ0sMevirc6+NQksDRAY1WEM1GirpTpPbAmdEOfOqgURE+wuPiv1JycW5SyFQNP5qlQ8OJzKo5ho1+ut/J8GE8AM2ozgSmpK300YYX3NQTux8OpGAGTBu+MXFnzKK4uK41+ZHeD4flehC1CzegtWnhbmyQXZW7CQJRQh5U9ynoZHHNH2EfphYQ2AsEu0Oswa1JRNqIzOLHFve9wX7reQ/zzJrA3nd3D7XQ8ZeeZfAMLmH0YIr7QCxlgV9TiGLDHWGYqyYwoVZybMgfJE0Bfat9WO+4dzhoy5C35ktYwl6qWg1ES4w+D+f2/Q3xK34OClJnbKKWmQkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.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 (0) 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=cAlaUC+C7TO70Q5/EhBX948/0Dkd+NkfiadMk2VWktA=; b=qWbfUAR1sRRd/Y2x4ntmCLOrSbgmDINzpj87+eie8Zehi6JCylZgAaPoIDAdPudh7SscNIoyVgn46XgToAoOPQv4edRqmGTiB9jcNMAr0Qy3c5mzoPR/T3uEndMtP3wWxlj6I0/BcOPlZnVz9Sm2AbVrj90SZHsHxpx7wbqfGvI= Received: from CH5PR03CA0021.namprd03.prod.outlook.com (2603:10b6:610:1f1::15) by MN0PR12MB6269.namprd12.prod.outlook.com (2603:10b6:208:3c3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.25.19; Thu, 14 May 2026 16:21:34 +0000 Received: from CH2PEPF0000013D.namprd02.prod.outlook.com (2603:10b6:610:1f1:cafe::1a) by CH5PR03CA0021.outlook.office365.com (2603:10b6:610:1f1::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9913.13 via Frontend Transport; Thu, 14 May 2026 16:21:33 +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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CH2PEPF0000013D.mail.protection.outlook.com (10.167.244.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.25.13 via Frontend Transport; Thu, 14 May 2026 16:21:33 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.41; Thu, 14 May 2026 11:21:33 -0500 Received: from satlexmb07.amd.com (10.181.42.216) 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.39; Thu, 14 May 2026 11:21:33 -0500 Received: from xsjblevinsk51.xilinx.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Thu, 14 May 2026 11:21:32 -0500 From: Ben Levinsky To: , , CC: , , , , , , , , , , , , , , , , Subject: [PATCH v2 2/5] remoteproc: switch exact-match drivers to wc-ioremap callbacks Date: Thu, 14 May 2026 09:21:26 -0700 Message-ID: <20260514162129.1504162-3-ben.levinsky@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260514162129.1504162-1-ben.levinsky@amd.com> References: <20260514162129.1504162-1-ben.levinsky@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Received-SPF: None (SATLEXMB04.amd.com: ben.levinsky@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013D:EE_|MN0PR12MB6269:EE_ X-MS-Office365-Filtering-Correlation-Id: 235cb102-1fdb-4574-8c74-08deb1d4dd66 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|82310400026|7416014|376014|1800799024|18002099003|22082099003|56012099003|11063799003; X-Microsoft-Antispam-Message-Info: 2fTWhFuJHZMR8Eyzjed/0dAniZaYDIrLYELLg0AMjsGwpUyWvjMbi0vtbn92YkerVpcxteNM+5WRG2nMaKiLHf4qPKQuYUzXvCHrT5cNyBQteWCzS+gHKxihP+JmwPSXP3mdOE94YfEhM0L1pPdWgAlI5j/bev7UPKT4MW9WygLMktQmU20yrgU4U/D78QiSw1erRNu960ORJmGCUwOq6AQ9D0XCh9qfc6GFwat4XUlFcnBMDScCJyBzOAQUr6poaj+nNgl14D67+deeyxpTgQ4Wx65HNR4AMkx02Cd6PV02HGZDu9YhbgReMR8Loe/NLDUfctDrLn7Wk7Xlu6IyqybDK1l6GfM6bE4zwpec3NTtD8fsV7bb3V9+KmiFClz5X9QqVMiYsO+V7nfaKWXz6yffNdksVeMpEcfaMg0ShHCUHT7K/EW3GACm0ARDhs4EWgs1tb762HYlXPoUcywfc30SaoLkbh4e2P3ak+AghjK3EkPD8v84yDqY9YZgN/w1USSuAJv8GRkfvDyw1wSonQ/M8zj3rwgRHCeZKvyp/pGd7B2xH3+qi5MpB7rqgNhAYtW7J8twhmzFVyOQLpJJ6nxXtu4aTCIWSlmCJu/DrNLDApblnCs6LgO8/EZRA9X1L4gutg3YU6KBaUaYuBxrg5ReLG6t3w8syTruvv/ZLOB+cGRvNK/JcddrjSzZIATYd9y7+kSWjpGcyAnPTHCTGJUUQIuYGTio3cypVP8xJZ4= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(82310400026)(7416014)(376014)(1800799024)(18002099003)(22082099003)(56012099003)(11063799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tARKXJ3ElxrQXgfEPDtpaw0TubPCtrppVtLnpevGm4I5ZsA2gUf0sS9Oz8SXi0JJM+TLgBlWb4GKqMzFzZrEGjkpEaEbXRUYdcrohKSVkLK4+WJYuO5A/Wm8jHHSgTjEY0WnU1vtthz7cXndSjDlIf9woGqjp5npr7UM5elhm5Q7Hdh3BL6yC9DRTOwmmck9qkna5FPksXwYedxwQJKJ0hsefufTZGlT6JqQN1IpA+JIhxCGZUiCzOsUs66pthekWcTkz1xbQktjReZ5eyVLol0/orknwB0d9aIuITNWqVYlDnZYdLm2csLaoulPW1SRgHMP3Q10uU68HqHITxltUsggHqUn1rXofITUytFA2hjZZYLiyw9NOygPR7Jp26KC0sPp290zb70tEfMe0GkFBgJFiN1c3gQX2pJ0Oa2ZcnfnO9Av6U01VBvU25lAHnfL X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2026 16:21:33.8323 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 235cb102-1fdb-4574-8c74-08deb1d4dd66 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000013D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6269 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260514_092146_720710_002829F4 X-CRM114-Status: GOOD ( 14.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace the exact-match carveout map and unmap callbacks in the existing remoteproc drivers with the common wc-ioremap helpers. This covers xlnx_r5_remoteproc, rcar_rproc, st_remoteproc, stm32_rproc, imx_rproc, and imx_dsp_rproc. Leave the zynqmp R5 TCM callbacks alone because they also clear the mapped memory and are therefore not exact matches for the shared helpers. Signed-off-by: Ben Levinsky Reviewed-by: Geert Uytterhoeven # renesas --- drivers/remoteproc/imx_dsp_rproc.c | 36 ++++--------------- drivers/remoteproc/imx_rproc.c | 32 ++--------------- drivers/remoteproc/rcar_rproc.c | 33 ++--------------- drivers/remoteproc/st_remoteproc.c | 31 ++-------------- drivers/remoteproc/stm32_rproc.c | 34 ++---------------- drivers/remoteproc/xlnx_r5_remoteproc.c | 47 +++---------------------- 6 files changed, 18 insertions(+), 195 deletions(-) diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c index 008741af9f11..2d9f14fbef1d 100644 --- a/drivers/remoteproc/imx_dsp_rproc.c +++ b/drivers/remoteproc/imx_dsp_rproc.c @@ -644,32 +644,6 @@ static void imx_dsp_rproc_free_mbox(struct imx_dsp_rproc *priv) mbox_free_channel(priv->rxdb_ch); } -static int imx_dsp_rproc_mem_alloc(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - struct device *dev = rproc->dev.parent; - void *va; - - va = ioremap_wc(mem->dma, mem->len); - if (!va) { - dev_err(dev, "Unable to map memory region: %pa+%zx\n", - &mem->dma, mem->len); - return -ENOMEM; - } - - mem->va = va; - - return 0; -} - -static int imx_dsp_rproc_mem_release(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - iounmap(mem->va); - - return 0; -} - /** * imx_dsp_rproc_add_carveout() - request mailbox channels * @priv: private data pointer @@ -700,8 +674,10 @@ static int imx_dsp_rproc_add_carveout(struct imx_dsp_rproc *priv) /* Register memory region */ mem = rproc_mem_entry_init(dev, NULL, (dma_addr_t)att->sa, - att->size, da, imx_dsp_rproc_mem_alloc, - imx_dsp_rproc_mem_release, "dsp_mem"); + att->size, da, + rproc_mem_entry_ioremap_wc, + rproc_mem_entry_iounmap, + "dsp_mem"); if (mem) rproc_coredump_add_segment(rproc, da, att->size); @@ -732,8 +708,8 @@ static int imx_dsp_rproc_add_carveout(struct imx_dsp_rproc *priv) /* Register memory region */ mem = rproc_mem_entry_init(dev, NULL, (dma_addr_t)res.start, resource_size(&res), da, - imx_dsp_rproc_mem_alloc, - imx_dsp_rproc_mem_release, + rproc_mem_entry_ioremap_wc, + rproc_mem_entry_iounmap, "%.*s", strchrnul(res.name, '@') - res.name, res.name); if (!mem) return -ENOMEM; diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 7f54322244ac..6249815b54d8 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -600,35 +600,6 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *i return va; } -static int imx_rproc_mem_alloc(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - struct device *dev = rproc->dev.parent; - void *va; - - dev_dbg(dev, "map memory: %p+%zx\n", &mem->dma, mem->len); - va = ioremap_wc(mem->dma, mem->len); - if (IS_ERR_OR_NULL(va)) { - dev_err(dev, "Unable to map memory region: %p+%zx\n", - &mem->dma, mem->len); - return -ENOMEM; - } - - /* Update memory entry va */ - mem->va = va; - - return 0; -} - -static int imx_rproc_mem_release(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - dev_dbg(rproc->dev.parent, "unmap memory: %pa\n", &mem->dma); - iounmap(mem->va); - - return 0; -} - static int imx_rproc_sm_lmm_prepare(struct rproc *rproc) { struct imx_rproc *priv = rproc->priv; @@ -692,7 +663,8 @@ static int imx_rproc_prepare(struct rproc *rproc) /* Register memory region */ mem = rproc_mem_entry_init(priv->dev, NULL, (dma_addr_t)res.start, resource_size(&res), da, - imx_rproc_mem_alloc, imx_rproc_mem_release, + rproc_mem_entry_ioremap_wc, + rproc_mem_entry_iounmap, "%.*s", strchrnul(res.name, '@') - res.name, res.name); if (!mem) diff --git a/drivers/remoteproc/rcar_rproc.c b/drivers/remoteproc/rcar_rproc.c index 3c25625f966d..e3121fadd292 100644 --- a/drivers/remoteproc/rcar_rproc.c +++ b/drivers/remoteproc/rcar_rproc.c @@ -19,35 +19,6 @@ struct rcar_rproc { struct reset_control *rst; }; -static int rcar_rproc_mem_alloc(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - struct device *dev = &rproc->dev; - void *va; - - dev_dbg(dev, "map memory: %pa+%zx\n", &mem->dma, mem->len); - va = ioremap_wc(mem->dma, mem->len); - if (!va) { - dev_err(dev, "Unable to map memory region: %pa+%zx\n", - &mem->dma, mem->len); - return -ENOMEM; - } - - /* Update memory entry va */ - mem->va = va; - - return 0; -} - -static int rcar_rproc_mem_release(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - dev_dbg(&rproc->dev, "unmap memory: %pa\n", &mem->dma); - iounmap(mem->va); - - return 0; -} - static int rcar_rproc_prepare(struct rproc *rproc) { struct device *dev = rproc->dev.parent; @@ -73,8 +44,8 @@ static int rcar_rproc_prepare(struct rproc *rproc) mem = rproc_mem_entry_init(dev, NULL, res.start, resource_size(&res), da, - rcar_rproc_mem_alloc, - rcar_rproc_mem_release, + rproc_mem_entry_ioremap_wc, + rproc_mem_entry_iounmap, res.name); if (!mem) diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c index a07edf7217d2..486180cdccb4 100644 --- a/drivers/remoteproc/st_remoteproc.c +++ b/drivers/remoteproc/st_remoteproc.c @@ -88,33 +88,6 @@ static void st_rproc_kick(struct rproc *rproc, int vqid) dev_err(dev, "failed to send message via mbox: %d\n", ret); } -static int st_rproc_mem_alloc(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - struct device *dev = rproc->dev.parent; - void *va; - - va = ioremap_wc(mem->dma, mem->len); - if (!va) { - dev_err(dev, "Unable to map memory region: %pa+%zx\n", - &mem->dma, mem->len); - return -ENOMEM; - } - - /* Update memory entry va */ - mem->va = va; - - return 0; -} - -static int st_rproc_mem_release(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - iounmap(mem->va); - - return 0; -} - static int st_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) { struct device *dev = rproc->dev.parent; @@ -138,8 +111,8 @@ static int st_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw) mem = rproc_mem_entry_init(dev, NULL, (dma_addr_t)res.start, resource_size(&res), res.start, - st_rproc_mem_alloc, - st_rproc_mem_release, + rproc_mem_entry_ioremap_wc, + rproc_mem_entry_iounmap, "%.*s", strchrnul(res.name, '@') - res.name, res.name); diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index 632614013dc6..7ac8265b60ac 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -113,35 +113,6 @@ static int stm32_rproc_pa_to_da(struct rproc *rproc, phys_addr_t pa, u64 *da) return -EINVAL; } -static int stm32_rproc_mem_alloc(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - struct device *dev = rproc->dev.parent; - void *va; - - dev_dbg(dev, "map memory: %pad+%zx\n", &mem->dma, mem->len); - va = (__force void *)ioremap_wc(mem->dma, mem->len); - if (IS_ERR_OR_NULL(va)) { - dev_err(dev, "Unable to map memory region: %pad+0x%zx\n", - &mem->dma, mem->len); - return -ENOMEM; - } - - /* Update memory entry va */ - mem->va = va; - - return 0; -} - -static int stm32_rproc_mem_release(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - dev_dbg(rproc->dev.parent, "unmap memory: %pa\n", &mem->dma); - iounmap((__force __iomem void *)mem->va); - - return 0; -} - static int stm32_rproc_of_memory_translations(struct platform_device *pdev, struct stm32_rproc *ddata) { @@ -237,8 +208,8 @@ static int stm32_rproc_prepare(struct rproc *rproc) mem = rproc_mem_entry_init(dev, NULL, (dma_addr_t)res.start, resource_size(&res), da, - stm32_rproc_mem_alloc, - stm32_rproc_mem_release, + rproc_mem_entry_ioremap_wc, + rproc_mem_entry_iounmap, "%.*s", strchrnul(res.name, '@') - res.name, res.name); if (mem) @@ -957,4 +928,3 @@ MODULE_DESCRIPTION("STM32 Remote Processor Control Driver"); MODULE_AUTHOR("Ludovic Barre "); MODULE_AUTHOR("Fabien Dessenne "); MODULE_LICENSE("GPL v2"); - diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index 45a62cb98072..e5d1903c9636 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -447,45 +447,6 @@ static int zynqmp_r5_rproc_stop(struct rproc *rproc) return ret; } -/* - * zynqmp_r5_mem_region_map() - * @rproc: single R5 core's corresponding rproc instance - * @mem: mem descriptor to map reserved memory-regions - * - * Callback to map va for memory-region's carveout. - * - * return 0 on success, otherwise non-zero value on failure - */ -static int zynqmp_r5_mem_region_map(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - void __iomem *va; - - va = ioremap_wc(mem->dma, mem->len); - if (IS_ERR_OR_NULL(va)) - return -ENOMEM; - - mem->va = (void *)va; - - return 0; -} - -/* - * zynqmp_r5_rproc_mem_unmap - * @rproc: single R5 core's corresponding rproc instance - * @mem: mem entry to unmap - * - * Unmap memory-region carveout - * - * return: always returns 0 - */ -static int zynqmp_r5_mem_region_unmap(struct rproc *rproc, - struct rproc_mem_entry *mem) -{ - iounmap((void __iomem *)mem->va); - return 0; -} - /* * add_mem_regions_carveout() * @rproc: single R5 core's corresponding rproc instance @@ -522,8 +483,8 @@ static int add_mem_regions_carveout(struct rproc *rproc) rproc_mem = rproc_mem_entry_init(&rproc->dev, NULL, (dma_addr_t)res.start, resource_size(&res), res.start, - zynqmp_r5_mem_region_map, - zynqmp_r5_mem_region_unmap, + rproc_mem_entry_ioremap_wc, + rproc_mem_entry_iounmap, "%.*s", strchrnul(res.name, '@') - res.name, res.name); @@ -560,8 +521,8 @@ static int add_sram_carveouts(struct rproc *rproc) rproc_mem = rproc_mem_entry_init(&rproc->dev, NULL, dma_addr, len, da, - zynqmp_r5_mem_region_map, - zynqmp_r5_mem_region_unmap, + rproc_mem_entry_ioremap_wc, + rproc_mem_entry_iounmap, sram->sram_res.name); if (!rproc_mem) { dev_err(&rproc->dev, "failed to add sram %s da=0x%x, size=0x%lx", -- 2.34.1