From patchwork Fri May 26 14:36:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 686188 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B23C4C7EE2C for ; Fri, 26 May 2023 14:38:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243748AbjEZOi2 (ORCPT ); Fri, 26 May 2023 10:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237223AbjEZOi1 (ORCPT ); Fri, 26 May 2023 10:38:27 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2044.outbound.protection.outlook.com [40.107.104.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551E6E69; Fri, 26 May 2023 07:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kFVQFY52AsDME6NCyyOcidYKBWmymWPhSEp7AIh0804UKYQ1u30LgfKu71nszTX0CMLEOxaXFZYa33xEaXeRz2S+pSBLapqCR/S64asdlQXc3SFUTcbAErq+5PiKU+RqwnW+kE3is2ESjPWwbAYHhsni1Gkwf7gkeyo8cpufwjA2U9b9JXJP0WRycpTGP7RWMcinan3nqlImzW37S5tJxDfu96dFFINEtsayy1pgdoMpzruoxcrWdsZD8PspOXxRxVLvuOqz9wwKhDQ2BhjC7pJ0cfq8ALWi3DyNKxdWg6WhK5eRw3hdzbsDjv7/Zp1tqUBqQkPhGq6gBK/+iMXmag== 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=jOuNKw+yGPPLP4V7NnJ/FXD55i84pACgcY7tObwFyzQ=; b=N5E/Iah0hFeyaP7ysgQXGcuDhXsmbBtN8FVQMOBu2SfsIgYrd2eHScnVDMaQNIRpyqKOtcABPzSd4ljZfgtFYQI26sFMXewVPTM1bpOwbQZyVBmcv0MUWyBsMjSctY/Z7zFgfWMZaG/m9uIv+Rrgk6w8THnTbFuWLwZrK/u1VA9tLqYy7D1Yp/0LEbk0ThaSZ8ADfgn1L+9GEtaRuwVru7w/ZM3BEOI5XbmELF+079FyPvb71EkW+sAFsI8FLdcCOHrtE4Q5FBPqQpB+7qNUZDxCxqO1Rq6WHARtPqV0gO3hEb+5eoXCQm6V1GAlM9El6IIwZh8r+7IuKt/6m4ylgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jOuNKw+yGPPLP4V7NnJ/FXD55i84pACgcY7tObwFyzQ=; b=S+KoaUHOGLLBGHLumwJUiH0xe7Jn7oEWFT3G9wo/c5r1LnKv6HSudvttSn0lxr8CHEfpDQpUEgzWURHjn2lsaK5SEke5q3iQn4sABpuvEE3Ry/J/cryE0yfwKhk7jhrRFvRxskkVFnKZh4J4Q/H3HqzN35IOY8/BArMVJYNXfMA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by AS8PR04MB8070.eurprd04.prod.outlook.com (2603:10a6:20b:3f2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.18; Fri, 26 May 2023 14:37:00 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6411.028; Fri, 26 May 2023 14:37:00 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v1 01/12] dmaengine: fsl-edma: clean up EXPORT_SYMBOL_GPL in fsl-edma-common.c Date: Fri, 26 May 2023 10:36:28 -0400 Message-Id: <20230526143639.1037099-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230526143639.1037099-1-Frank.Li@nxp.com> References: <20230526143639.1037099-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0212.namprd13.prod.outlook.com (2603:10b6:a03:2c1::7) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB8070:EE_ X-MS-Office365-Filtering-Correlation-Id: cc00ccda-ae2b-4e1e-4bc7-08db5df6aa18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WchDNgUON5/x8WfW4n50BB05FdjuAdKR1J7nJO3JOmjDFEZbEmWDmlqCb7bj41DWU2azS0rzdvIQXYqftKd4s11p1JyXw5MTKnwjQ0StwCrjlSnubijM3KMtfWx9fxBJgXq/DYZEAGCTdbo6srCLcTgfYstpUicFGZgjGq9Mh6+fH1VBTk7xNSQg3taRQa522YoDG12ATaexBwH7HlMBDFh/GwQANDO48FdWHNBA8v2JAvuGflLk+QP3DWYFTgX7k1ZaTK7waJAaqVMkhOvlqD64VwiYL6GiQbrkGkFbkIttfHcGCsgZsSgUVeRNFlnMPGnysdSiMsj1ePYJoaX5HXLM5QymgGytLop7NUv9zr7XLcgAe6nNh0uJ+/3KYxMLKR/jRCvepiL9UW+Ywo2fgbt5Z9/N9kANocucbyzBPh3/gSGeMrSvDndKhUxkuuQsP0g9j9DJq6ByLrkOYTzR7osGDWGCsKsSodbjn3vrhB4EXhM0OFlrQXZDx+BSpqVMpnbk8xMVPwqvjCFcfYyqTCvDRtEwL7231Fi8+1D6VwZ06w+DZ/hU8TGM0iWuUn1dHuCN0zOfW9+utejD7QDWKU9F+FwL+6I61DxGxEindF0FW2qjVVbRVOLBkjlcoklTfOJEdlE/D5GZz0cAU+JEqw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(366004)(136003)(451199021)(38350700002)(38100700002)(8936002)(8676002)(5660300002)(478600001)(6486002)(316002)(6666004)(52116002)(41300700001)(921005)(66946007)(66556008)(66476007)(36756003)(2616005)(86362001)(186003)(2906002)(83380400001)(6506007)(6512007)(1076003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CbndXj7UytsyBHPZZ7T3Eh+sAtvEpARP/Tpkr2XKJwWJSSy3jdRuypu1tkavKIJp8wK+6ihudWVF939TSZFEMTa7Yn+jNBT1WQ4pM6E4TWcPr+Ba4+066Aln5qZ2vNJV2kCbRkOcgRbC1p8H5qtuwk0cfT4fHCEmLDe0rhqiQn9ekFVG2pZXzrDiBIPGuKdu4GNYMbmU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rnay9v/fr0701Vg3c/9TCtZisTic5rwsKL/uKsylILKEr1qmyWO6+gpPmfaXOkHWo1+WItJqB1PocqGX5Mt0vh7fjMubbtKJyXkwU3DrDytxF7e8T7OxNjfbNAKGXD0+wDFjrjxrp+mbFZ+LXblTb6EOm828s2eyYLmcwbrwGQnqgVFi4IaA8vpy8TiRjwXlUShsrFSe7CuCfB1Xc4kWO6gtcQBWJ+0BSXiPGzKRMtnpQg4kvB0WTYGHDAVmDxHYwaOtMKjzBPKI5lEKQWcmiB/TuspsMzJ6D+8di4ms0IFld1d42/rHQn X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc00ccda-ae2b-4e1e-4bc7-08db5df6aa18 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 14:37:00.2675 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qXfKeKMqveZt6baaLJElEPJoBZ8ECA/gW83Tf5Faw8TnfExKeQvN0fiDhoxvw0CHP95VoZA3Tz65Y+vz0C4qIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Exported functions in fsl-edma-common.c are only used within fsl-edma.c and mcf-edma.c. Global export is unnecessary. This commit removes all EXPORT_SYMBOL_GPL in fsl-edma-common.c, and renames fsl-edma.c and mcf-edma.c to maintain the same final module names as before, thereby simplifying the codebase. Signed-off-by: Frank Li --- drivers/dma/Makefile | 6 ++++-- drivers/dma/fsl-edma-common.c | 18 ------------------ drivers/dma/{fsl-edma.c => fsl-edma-main.c} | 0 drivers/dma/{mcf-edma.c => mcf-edma-main.c} | 0 4 files changed, 4 insertions(+), 20 deletions(-) rename drivers/dma/{fsl-edma.c => fsl-edma-main.c} (100%) rename drivers/dma/{mcf-edma.c => mcf-edma-main.c} (100%) diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile index a4fd1ce29510..7f3d62c9dee2 100644 --- a/drivers/dma/Makefile +++ b/drivers/dma/Makefile @@ -32,8 +32,10 @@ obj-$(CONFIG_DW_DMAC_CORE) += dw/ obj-$(CONFIG_DW_EDMA) += dw-edma/ obj-$(CONFIG_EP93XX_DMA) += ep93xx_dma.o obj-$(CONFIG_FSL_DMA) += fsldma.o -obj-$(CONFIG_FSL_EDMA) += fsl-edma.o fsl-edma-common.o -obj-$(CONFIG_MCF_EDMA) += mcf-edma.o fsl-edma-common.o +fsl-edma-objs := fsl-edma-main.o fsl-edma-common.o +obj-$(CONFIG_FSL_EDMA) += fsl-edma.o +mcf-edma-objs := mcf-edma-main.o fsl-edma-common.o +obj-$(CONFIG_MCF_EDMA) += mcf-edma.o obj-$(CONFIG_FSL_QDMA) += fsl-qdma.o obj-$(CONFIG_FSL_RAID) += fsl_raid.o obj-$(CONFIG_HISI_DMA) += hisi_dma.o diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index a06a1575a2a5..ce8d7c9eaf77 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -75,7 +75,6 @@ void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan) iowrite8(EDMA_CEEI_CEEI(ch), regs->ceei); } } -EXPORT_SYMBOL_GPL(fsl_edma_disable_request); static void mux_configure8(struct fsl_edma_chan *fsl_chan, void __iomem *addr, u32 off, u32 slot, bool enable) @@ -126,7 +125,6 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, else mux_configure8(fsl_chan, muxaddr, ch_off, slot, enable); } -EXPORT_SYMBOL_GPL(fsl_edma_chan_mux); static unsigned int fsl_edma_get_tcd_attr(enum dma_slave_buswidth addr_width) { @@ -155,7 +153,6 @@ void fsl_edma_free_desc(struct virt_dma_desc *vdesc) fsl_desc->tcd[i].ptcd); kfree(fsl_desc); } -EXPORT_SYMBOL_GPL(fsl_edma_free_desc); int fsl_edma_terminate_all(struct dma_chan *chan) { @@ -172,7 +169,6 @@ int fsl_edma_terminate_all(struct dma_chan *chan) vchan_dma_desc_free_list(&fsl_chan->vchan, &head); return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_terminate_all); int fsl_edma_pause(struct dma_chan *chan) { @@ -188,7 +184,6 @@ int fsl_edma_pause(struct dma_chan *chan) spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_pause); int fsl_edma_resume(struct dma_chan *chan) { @@ -204,7 +199,6 @@ int fsl_edma_resume(struct dma_chan *chan) spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_resume); static void fsl_edma_unprep_slave_dma(struct fsl_edma_chan *fsl_chan) { @@ -265,7 +259,6 @@ int fsl_edma_slave_config(struct dma_chan *chan, return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_slave_config); static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, struct virt_dma_desc *vdesc, bool in_progress) @@ -340,7 +333,6 @@ enum dma_status fsl_edma_tx_status(struct dma_chan *chan, return fsl_chan->status; } -EXPORT_SYMBOL_GPL(fsl_edma_tx_status); static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, struct fsl_edma_hw_tcd *tcd) @@ -520,7 +512,6 @@ struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags); } -EXPORT_SYMBOL_GPL(fsl_edma_prep_dma_cyclic); struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg( struct dma_chan *chan, struct scatterlist *sgl, @@ -589,7 +580,6 @@ struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg( return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags); } -EXPORT_SYMBOL_GPL(fsl_edma_prep_slave_sg); struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan, dma_addr_t dma_dst, dma_addr_t dma_src, @@ -612,7 +602,6 @@ struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan, return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags); } -EXPORT_SYMBOL_GPL(fsl_edma_prep_memcpy); void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) { @@ -629,7 +618,6 @@ void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) fsl_chan->status = DMA_IN_PROGRESS; fsl_chan->idle = false; } -EXPORT_SYMBOL_GPL(fsl_edma_xfer_desc); void fsl_edma_issue_pending(struct dma_chan *chan) { @@ -649,7 +637,6 @@ void fsl_edma_issue_pending(struct dma_chan *chan) spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); } -EXPORT_SYMBOL_GPL(fsl_edma_issue_pending); int fsl_edma_alloc_chan_resources(struct dma_chan *chan) { @@ -660,7 +647,6 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan) 32, 0); return 0; } -EXPORT_SYMBOL_GPL(fsl_edma_alloc_chan_resources); void fsl_edma_free_chan_resources(struct dma_chan *chan) { @@ -683,7 +669,6 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan) fsl_chan->tcd_pool = NULL; fsl_chan->is_sw = false; } -EXPORT_SYMBOL_GPL(fsl_edma_free_chan_resources); void fsl_edma_cleanup_vchan(struct dma_device *dmadev) { @@ -695,7 +680,6 @@ void fsl_edma_cleanup_vchan(struct dma_device *dmadev) tasklet_kill(&chan->vchan.task); } } -EXPORT_SYMBOL_GPL(fsl_edma_cleanup_vchan); /* * On the 32 channels Vybrid/mpc577x edma version (here called "v1"), @@ -743,6 +727,4 @@ void fsl_edma_setup_regs(struct fsl_edma_engine *edma) edma->regs.tcd = edma->membase + EDMA_TCD; } -EXPORT_SYMBOL_GPL(fsl_edma_setup_regs); -MODULE_LICENSE("GPL v2"); diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma-main.c similarity index 100% rename from drivers/dma/fsl-edma.c rename to drivers/dma/fsl-edma-main.c diff --git a/drivers/dma/mcf-edma.c b/drivers/dma/mcf-edma-main.c similarity index 100% rename from drivers/dma/mcf-edma.c rename to drivers/dma/mcf-edma-main.c From patchwork Fri May 26 14:36:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 686182 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0E8DC7EE2E for ; Fri, 26 May 2023 14:40:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244004AbjEZOkP (ORCPT ); Fri, 26 May 2023 10:40:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244136AbjEZOkK (ORCPT ); Fri, 26 May 2023 10:40:10 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2053.outbound.protection.outlook.com [40.107.104.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEBDF187; Fri, 26 May 2023 07:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N10jIwtL1Qswq/mwLDmJFVPwayWvOzWWP3v6M4WpWNSEtL3qpBTZAVX8cfoCsqf0gXDNGBzVZEXtC5F8jnCSBOZdkI732iXOUW4uZWWRAQF6B002z1DU45vm7mYvmpiAhwSa+ZMdnAdQ/WWRa3YMGVUuujlQAc29F/YurFMJEpy8DqMh0kD4csJ0O8Jql+rSjRy9Iq9P8EE23zY+qGuzy1HXlQl+Vyvrm41uQKSTjOwYSAlazO7St9lharCJ8x4llRBd1iquurEm3S9ysJwxDI0ZNn2j0jX5rTKEKsZhvbJCYj5gYiEO2E6zzu7/ibSLue9oCWuXRPqAnFc9EW7ZAQ== 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=toliOa1Ni5BE7L0tZ2qu+bbIW1QVGvNuK84B+H1Qylc=; b=bH34B/WwgI9HEOVCHxMVhMXDuEJuqOprsOgAwOx8adStob8gm73bfDU0vVgNoiXulU07l3lckq9VZrxo/bjIDEcWdl60vKRwLe6W0Zc/gVDv3kDRw8h2rfjzXemqvdIfU8a6JwcLO0YU95W3s8edGVJvzdRxNcKTMqLezVcEPKfUkVLDlKqk+ZtjaRQxOOrSAirhfTZTfqxJ7D+1DU7NQNT8juht12K3CX5eMsMBjOThuDWSSDDtYgo1ODFe1y/qBOFf3dMihhKk+4FEXDksFfV0wR+SaMOvBGB+9/cCzMBLu4DZ70JPAFDuvlvche7mIdSt2AYwD7EV0E+8RXHNVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=toliOa1Ni5BE7L0tZ2qu+bbIW1QVGvNuK84B+H1Qylc=; b=UaV46w0IjRhPXoZjys3yce2KkdEzMhq/mTGl+tgaw+T/I3sE4St8xMRn9wWOVL+J7ISsruYgtWEUbC/wDAbZmX+aFc0NneMPeW96riomYsbuAftbFLhXKUMh6l8+6nRf8FK/PCEpbgFLtqiqb6t1Jjjmci2KKOhSEvFpWm8wB9c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by AS8PR04MB8070.eurprd04.prod.outlook.com (2603:10a6:20b:3f2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.18; Fri, 26 May 2023 14:37:03 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6411.028; Fri, 26 May 2023 14:37:03 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v1 02/12] dmaengine: fsl-edma: clean up fsl_edma_irq_exit() Date: Fri, 26 May 2023 10:36:29 -0400 Message-Id: <20230526143639.1037099-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230526143639.1037099-1-Frank.Li@nxp.com> References: <20230526143639.1037099-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0212.namprd13.prod.outlook.com (2603:10b6:a03:2c1::7) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB8070:EE_ X-MS-Office365-Filtering-Correlation-Id: c535e1fc-0aa5-4262-569d-08db5df6abd1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HLRedlWNoTwGyvOHauE3CmYTNc7O532HO9BtM+c6XMJ8jHkHTs63j6VQ+oFidGD2mGvOkBAYKSDY9AER0LQBmp5yIp0WTBn8UykFVAhs9Q9js/huoP7YBl63hZoM5th5yuTdf5Rv/fBerysqi8zRyBmGfYv0vymLvjYu410/TnFpbCkOCu29HG9xWldpVy17U59b5JFwQwbqHgJ4Li9dytgmk1ECbGss1huZCV1WsJiXW6c/fKKmh5foPVc39gih1XY1srX2EgxNqKllpzagx9MZCe9PATArHht8PFmVPFG3yOSNqXYXMcX6SsJ0qjty/yAgd8raxoWCG5Kaegbq7jm/qW6FnD9TGZ71Ns9mJEuvK9HQ28VSkNdslysY1dnTo+CdTHGnGI6tY+PgZ5gBffUHy/q5eQqPp+epbKH8KVOp1o70m+TxHPMnw3kazyVTzCw86tjHubF4uj5y1+hQPVlB/RHF06sTdV9EUVlQo6945FdBUhIo/0/UiqKuhmi83K2LkvtJDF2DUefT0c4nmItZZDEWK01rJJTrtWEj6mWUnjzoNYjtpQz1YVBkhQz5UHxm5c5sl/rfbSsTQRPK2kuo4tRD2hLuBb9lvZE715euG2yVyaRLkmMIEVGCL8kTg5KXQun5MvVe9tbBks/0pA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(366004)(136003)(451199021)(38350700002)(38100700002)(8936002)(8676002)(5660300002)(478600001)(6486002)(316002)(6666004)(52116002)(41300700001)(921005)(66946007)(66556008)(66476007)(36756003)(2616005)(86362001)(186003)(2906002)(83380400001)(6506007)(6512007)(1076003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: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mZDlKUeTLXp4+rX7Czvu5OJwLBvIyzAFkC2KxczNqCl1XQtA5EvLwI1a1LOEuRhzEqaoCdPlvuHDGTcw5l1mAP0JFFvBRfjdyWYw11wxemLNq738BzHDyCtUu4PWV0YeOLFyW8pSY9qrPVDkw9AnFIz1BXoPPP00EnWTq3n7TQy3Ac+RPjEg02OqqqLOgpHDdXh8cSwu8UGTSS9dFtFcoZz3Oie3mu7eHzfLNn+/uKF6u/OFP30wqnhyw4SJY0u0IAcn6h8K+NPZOeDtUvyBaO7qvAIbqE4/tC+fkUYFxdmuwhiJtR+GUoFsMkMLj821Kr8TLdq2bTs1+ozBoSozlbd7YEkwx5iQSnJjyOs0XWA0anjlduKiaAtOpm9hIjfIT8jPSRchYrU9DUU8MTn0CcyKvVHlzrHHIXEUe1zEGb2qTy1rAHNHWcx9pcrB8noMb30R2zraZp20dQ3zt3G2Fvd/liSYwhAZg5eMVU50m3N4Ib8eT8OUB4z13A1fv6Nxn8MJfxJsU+Gr4VhCpZEEoADdesiTp6L2kBW X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c535e1fc-0aa5-4262-569d-08db5df6abd1 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 14:37:03.1957 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jHVUONVx9mmKam9XDkleUdLYsBSJx7GFjrA75xyeqBDVIAm0mME1IplwK0usvQL58aSbFcg4lufgG6ohFlsj3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In the probe function, devm_request_irq is now being used to automatically manage IRQ. It eliminates the need for manual IRQ freeing during removal. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-main.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index e40769666e39..16305bb9a2ef 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -216,17 +216,6 @@ fsl_edma2_irq_init(struct platform_device *pdev, return 0; } -static void fsl_edma_irq_exit( - struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) -{ - if (fsl_edma->txirq == fsl_edma->errirq) { - devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma); - } else { - devm_free_irq(&pdev->dev, fsl_edma->txirq, fsl_edma); - devm_free_irq(&pdev->dev, fsl_edma->errirq, fsl_edma); - } -} - static void fsl_disable_clocks(struct fsl_edma_engine *fsl_edma, int nr_clocks) { int i; @@ -427,7 +416,6 @@ static int fsl_edma_remove(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct fsl_edma_engine *fsl_edma = platform_get_drvdata(pdev); - fsl_edma_irq_exit(pdev, fsl_edma); fsl_edma_cleanup_vchan(&fsl_edma->dma_dev); of_dma_controller_free(np); dma_async_device_unregister(&fsl_edma->dma_dev); From patchwork Fri May 26 14:36:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 686187 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5CEDC7EE2C for ; Fri, 26 May 2023 14:38:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243906AbjEZOiu (ORCPT ); Fri, 26 May 2023 10:38:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243899AbjEZOis (ORCPT ); Fri, 26 May 2023 10:38:48 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2053.outbound.protection.outlook.com [40.107.104.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A7A3E57; Fri, 26 May 2023 07:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nb98wC1cpiaPbA3q6A+fXbFiZVoe9hu95Z/hdTgzQHlwfb1xVpYYwUYWAh66FWCxiB62AMvTMQ3NOeAtnNprR+3gaNHYBi2v6JlaaZKYuEZIOoVlon5pCq+xD7/M5YnniWAq7kgf731JmmES/Q3KMRbFYiWux0gusZXZtbdmq0xjFbaLK5/USADofnp4f7wY8xWCgKadX/3gR0J7vb+YyrZmGu9nEMCsYRBxAlGUtpP4eS4V4rvyBJN4jVRk2rKRM2d75nJ5Ol2jkxOIuZxT0w2OrADm33LW/DLzcxEyTKWkEbsu/FUjEV7TPplmCmMzUUKNBQ392p6+P/MrhMw1pQ== 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=Z5IwFxfjsLIuwWG9lLuAPQ9Ft0G9NDt16kTGP8ogl6Y=; b=b2y9kgz/dtHx6Ed/xiG46zAN/qy0dVxKh22hjzm6E2L9HY4vBn/F1FRiXGWNkS1dq4KjycFUvCk42eFAQL3dfa1v/cjxOVX4DSHdcBM3qU8kj9q92lGTaiMgT8ijJ/jA0xxvvw7qoEtYH0ZAAux60KToTxFE2wUv66BTl5+aRxM/5QCZBk192YVm+PJAvvueaN8CiEj0s7uuZrqT7lAmcDokkv9kMqcf4BdqtghOaheqp14lWRdu847GEX5imbEqAQUQ/DrW6GdXbrLy4zWYlu3L9CJWWGDnT7C2s7IlzwLT8LSCoGb3bx1GX1rUuUcamCgQYMDtRhjZC42tmsB9ww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z5IwFxfjsLIuwWG9lLuAPQ9Ft0G9NDt16kTGP8ogl6Y=; b=R89xnde8W3jRRXlySpSZGM+Iuc2PXilQm3g+dfZPc/Lj0AUkc/OfpoxECcTEF4cTTA3NK3mVgLUskMJZFdsWzV5ekLfbEZRXHEzSJFiQgZD/UyKldeASARimvmYZmp1PJEcSmmaTleC8C38YV6pPafLG+TbrZmTTcwWhtkyNiRI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by AS8PR04MB8070.eurprd04.prod.outlook.com (2603:10a6:20b:3f2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.18; Fri, 26 May 2023 14:37:06 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6411.028; Fri, 26 May 2023 14:37:06 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v1 03/12] dmaengine: fsl-edma: transition from bool fields to bitmask flags in drvdata Date: Fri, 26 May 2023 10:36:30 -0400 Message-Id: <20230526143639.1037099-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230526143639.1037099-1-Frank.Li@nxp.com> References: <20230526143639.1037099-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0212.namprd13.prod.outlook.com (2603:10b6:a03:2c1::7) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB8070:EE_ X-MS-Office365-Filtering-Correlation-Id: c0cf8376-3651-4951-6187-08db5df6ad8a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h4djMMuSHXhjuB9qAWADuofkHpFZkZICBk9JeSD0NraRqk2a0xaJJXqlIsOsVR+FDIeQ8DNLSKzXtXx0q82d2edif0bmRrGaLENnkl9j41Qji/hf7QtiFIu2CO6YMVUFIHQKOt75mM+8u6wOIocz/GodMPojEcilsrs858ORFxbxDPK32V/V42tEwb+r6bBveq+hPsrlZcItDTg23wYASYP9UWqirrp4fTcK7xZpytChR+N3OBwa+k25bGmv4lIPakrOQ3xq54sYV8SR2LehRWx3AguhSAyRog64Fl1UVGTjvSxQSBIJHlhyRT6LsdQWjLrFmEOxvl5W0PZDfmk+J6hdgHMlDYknNZ5NoceB/4GwJRGJP1lBpzwHmN4TmDs5hTfoJnpAhwiIBTxG8nKsc9o8zIWKv92Z3Ts70AhAelH6EvsxxyrUfIxA49uoQkpmNh4eQqoTSS+0sGaP2hckOsJ6hoEDFQvIrlNOjXL7F/nWpcrFiKiwxqYZvG+ceke2IWzhHQjIMKBYKlEVBlxlvfzM8pOrnIN1eNbxmr+OjO2LoSHWh0dQ5lWXxBgBbXZ8tW8nT/NG8E3LFvhPlzFc1n+tusKsnIpy9NR/HlrCfVfcsaTtvEmvHZpnERsXRAcIe5c3uyhJ+IYs6RSIJQXF1g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(366004)(136003)(451199021)(38350700002)(38100700002)(8936002)(8676002)(5660300002)(478600001)(6486002)(316002)(6666004)(52116002)(41300700001)(921005)(66946007)(66556008)(66476007)(36756003)(2616005)(86362001)(186003)(2906002)(83380400001)(6506007)(6512007)(1076003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3fDbgYPooDfSVvV/HHQbi8610qK1rotvFmfeJxRg3xxfK9+MPhLjXmB0/1GWTk3k0KMTW2Wfs4UtODCUHIDMNsJlAdHCUVQ5N7EcL/gSQG3OUfxe8lYkT2+PYMamQfFYCYZ+ffhViycmLEqhueltMNMtWa1Pm9IM4UzVt4L+Q3m4yTyaG6c8A70llvOFuWCD3EzANyCQcNE3VgbM8Q3EoEMi4QTliH2/6HJlwPaj+gWjVI2ONpvsBksZPh7ZXkSJW48hdB527SykXqNa7o3F0EvRh9Yehv+ChsTM86Q89lyuaV5vaYGEZPlp3aHHjGNbKh7A4CVt9vL6pPjZj0ibkeyO1DwlASqE3vBpTedFH0l7jriwMzXPxxzi7wbmb1cwDa8gmqkPODek9A4tID2zMoT+b8cfcp2KunqwXCsyP0JJ3E5i9ffr0GUgS2rrKZIuDao4iFmbVKnF1Us5LF9a9yhreizAAyx7zieH7qAhxhjGL3fFK5zXZdHjiY7JbN6wajnn1ze85dl3n2tutxxgF4tUEV9m42hjvcB7ydIs9xuXkfciU0aTUXH5YrN0LxgwjuNgNOyqtcwCjhZ7X58cQOYA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ange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 14:37:05.9833 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MHNmZB721+DYHJPp+bMK0vMJYv+mi0JEfctImcFwogiHvWLFS+POgAY7jFUfp6Jcl0Pxr28tTUeHvkf5Tw2vzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Replace individual bool fields with bitmask flags within drvdata. This will facilitate future extensions, making it easier to add more flags to accommodate new versions of the edma IP. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 2 +- drivers/dma/fsl-edma-common.h | 5 +++-- drivers/dma/fsl-edma-main.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index ce8d7c9eaf77..10dcc1435d37 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -114,7 +114,7 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, chans_per_mux = fsl_chan->edma->n_chans / dmamux_nr; ch_off = fsl_chan->vchan.chan.chan_id % chans_per_mux; - if (fsl_chan->edma->drvdata->mux_swap) + if (fsl_chan->edma->drvdata->flags & FSL_EDMA_DRV_MUX_SWAP) ch_off += endian_diff[ch_off % 4]; muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux]; diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 004ec4a6bc86..db137a8c558d 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -144,11 +144,12 @@ enum edma_version { v3, /* 32ch, i.mx7ulp */ }; +#define FSL_EDMA_DRV_HAS_DMACLK BIT(0) +#define FSL_EDMA_DRV_MUX_SWAP BIT(1) struct fsl_edma_drvdata { enum edma_version version; u32 dmamuxs; - bool has_dmaclk; - bool mux_swap; + u32 flags; int (*setup_irq)(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma); }; diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 16305bb9a2ef..f5cf95d185f8 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -233,14 +233,14 @@ static struct fsl_edma_drvdata vf610_data = { static struct fsl_edma_drvdata ls1028a_data = { .version = v1, .dmamuxs = DMAMUX_NR, - .mux_swap = true, + .flags = FSL_EDMA_DRV_MUX_SWAP, .setup_irq = fsl_edma_irq_init, }; static struct fsl_edma_drvdata imx7ulp_data = { .version = v3, .dmamuxs = 1, - .has_dmaclk = true, + .flags = FSL_EDMA_DRV_HAS_DMACLK, .setup_irq = fsl_edma2_irq_init, }; @@ -293,7 +293,7 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_edma_setup_regs(fsl_edma); regs = &fsl_edma->regs; - if (drvdata->has_dmaclk) { + if (drvdata->flags & FSL_EDMA_DRV_HAS_DMACLK) { fsl_edma->dmaclk = devm_clk_get(&pdev->dev, "dma"); if (IS_ERR(fsl_edma->dmaclk)) { dev_err(&pdev->dev, "Missing DMA block clock.\n"); From patchwork Fri May 26 14:36:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 686185 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8820C7EE2E for ; Fri, 26 May 2023 14:39:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243959AbjEZOjD (ORCPT ); Fri, 26 May 2023 10:39:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243944AbjEZOi7 (ORCPT ); Fri, 26 May 2023 10:38:59 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on20627.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1a::627]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE455199; Fri, 26 May 2023 07:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DDMa5TFKHgKUjj1IuRkkyi3CMR2J1j0XBa3WmcOYmmaMdBX7xk4kqipSqO6paQ8ARrl/08Se4LNHXajV9i9swhscsUXjIGdA78ULH+akZuyGeAD+62x5y82+1ZjukiJG6AxpFjYBd1e6xxuHB/2iIlvzoG+jJG7A7onSlejXLGwHW9TvcflTS1ThdaAD/z1KSFdXQ9G2npKJzfHJMUCrc1yTbJMYNnH02AU9AlVMnjvfQ+fWOKeMlxhggV7a7ZuipWkHAwtLA73LwHJCyXIiyeNfOvBrqL2//zbjw3KUIdJkHhEHIhbVD1oGGYWlQ2dCGf2LgPZfiF8H1GmXZLHEXQ== 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=RYC6iFkeYIBf1sHD4vzUmRzUWEV8BcYvdT86nMRXy30=; b=NIEhDEbIrzIYLNP0z5KiZkOsjni8gynTzKy3BmQd5CW+g8wWIkx7v70N7T2wkthF4abWGFzqLOsli8p3dSZ6hbrGePk4CT1XyG6lUI4wscpDYU3H4Nr1ec6Y6UVNfjzwa75vyUnCNI67WgUXOCLT4UqEt5f7M/eonDdLKJgZvy+EJqgfg0Bba83gZ86I/oZhXrjdond784M6QEEOAerbF/y2KlFEiUL42Jkz5jCXsPOWK3FQ+VaEGIAzw7WAhB/LG8VSQK/S25c6gxmHyE+Wi4J6mv//XFuAyjn74xc9kqvuvxTf6ZUezIWl7Im/ICkPCVZWXuemGtn1I0RduMUUkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RYC6iFkeYIBf1sHD4vzUmRzUWEV8BcYvdT86nMRXy30=; b=rXJZPEM/lC4cjtKcxRoHlkPkV/8KfoEk0K8+O6xzO79LoLMM8nS63Qc5uyOX1K1xQvidUGZRl0szC9LxfxTa9uhSkFaWXcLehe0JsM3GWYqY4gpfpmq2EJ1Me86TSlbx0LB+JdnJxR6i2rH1ZrmdRw+IqaN7VQNE2aj8JJKg+0E= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by AS8PR04MB8070.eurprd04.prod.outlook.com (2603:10a6:20b:3f2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.18; Fri, 26 May 2023 14:37:14 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6411.028; Fri, 26 May 2023 14:37:14 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v1 06/12] dmaengine: fsl-edma: simply ATTR_DSIZE and ATTR_SSIZE by using ffs() Date: Fri, 26 May 2023 10:36:33 -0400 Message-Id: <20230526143639.1037099-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230526143639.1037099-1-Frank.Li@nxp.com> References: <20230526143639.1037099-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0212.namprd13.prod.outlook.com (2603:10b6:a03:2c1::7) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB8070:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a3ef78e-1f01-4dce-d3f4-08db5df6b285 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FH0E8l6jJuw7fVZes4ft+bRHwrXao5OF2pY80N1x9WwnB3n1xOtSAO+jb4n9ztcs4BrSMpTLWA3Q7ovVKsrPnVR8EyzsVjF0cN7AbOWyIc840A6ex5XiXbAYWKkhQjvYckf2M/9Kc0Q5f0WsfcvnyBuWDmc80R6mXu52sStXtIPU0re7O8d6GR3nag6keMOqigd/DKPA2HTbUTN6GS/N+0J2ZstFhYn/r0XpQnYCx7e849jlAkGfMbEtQcIcIri+m9lA2tRYHiuYHlE5XFoOosfweggk9LgbADAFwMpYsHxVmjp0mgTV+CzuAwToiP8IprVCfbSX4k3GCoCve2wC0BLwNp5IIOrPMwzM46sxEGQ4FIUrmVEsL9NPPHihDD6V9kzyecx277BSKZjRPRWKwSaCYCXSujwEmtDExKa4XSTydFjJLG2Zm222uBxkSf7A3MgFINOdd/KLqoXLMen3WYfmqj2etvY+YkxHDglcvaAORAsCrD+tYgAq+aC60s+nGhEuUUZu4DMVsrCsvft76BF72D/TyYI2Y7LDqm9UNjWv0Ncw3qmW89qrXJRPoAtrrLjxkvrgqr3MxWmb32j3BKuiuBuhcVaUqIzzZYdEje7dSnw3x9kZ4MJLUF3KrPm1 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(366004)(136003)(451199021)(38350700002)(38100700002)(8936002)(8676002)(5660300002)(478600001)(6486002)(316002)(6666004)(52116002)(41300700001)(921005)(66946007)(66556008)(66476007)(36756003)(2616005)(86362001)(186003)(2906002)(83380400001)(6506007)(6512007)(1076003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RFfbAdAKudUID3VEaEvVujY22b/OeVZMwoEtkXDO7+Uk1EiljNjZyo07yTjMJCK6GaCHq8f0knCZW5k5RFyFVnwsdIqitrz3jt6Oe8zOaaR3wTyN94FyRBzBCn/PuAbMLNVz5Gm8QjNg0JGIS1E75QNOKiHs9OqD5LR456kIjELAVlWogO6xPNAwM9RMx9FsXSq/8TzzPnMqCnwKCxC7Raf+m1ZQ/tLuqqth04qDiUP0COiskqQKCz81BGK1jTGhzP6LKLQncNXf/HDYx34UAxnzzKKdEV/yoEAOW/j0RKITZ1l4ICLWXDBPvgn5VqI3WnLs0dDitsAPfoeMA+aKKZnOSZjKhDAepTk0l5p9taKgmxwSftYJ6RZXL77gs/r2cWDVxUjK9GAFfeKgqNmliyy3Yced94udCp3poIkzcH5bu8SNpTOQPSj7QyljWjyFbntE9KYWQ8L+vAOjwuA+TilWxApc5+Fzn4WOm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9TXyTaV0+39nM43/6AC7xBByXKsSs3Ip1W0pH+n0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a3ef78e-1f01-4dce-d3f4-08db5df6b285 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 14:37:14.3177 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w5zSCaahuJEfy/HMYjKXdujHbBGYybS1aPncwVaddWyTSroN8sdiz2xh9io503eWtCb8cvFHtCw6nmEW00u7qQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Removes all ATTR_DSIZE_*BIT(BYTE) and ATTR_SSIZE_*BIT(BYTE) definitions in edma. Uses ffs() instead, as it gives identical results. This simplifies the code and avoids adding more similar definitions in future V3 version. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 21 ++++++++------------- drivers/dma/fsl-edma-common.h | 10 ---------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 839471c42758..659bef4a3b23 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -154,18 +154,13 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, static unsigned int fsl_edma_get_tcd_attr(enum dma_slave_buswidth addr_width) { - switch (addr_width) { - case 1: - return EDMA_TCD_ATTR_SSIZE_8BIT | EDMA_TCD_ATTR_DSIZE_8BIT; - case 2: - return EDMA_TCD_ATTR_SSIZE_16BIT | EDMA_TCD_ATTR_DSIZE_16BIT; - case 4: - return EDMA_TCD_ATTR_SSIZE_32BIT | EDMA_TCD_ATTR_DSIZE_32BIT; - case 8: - return EDMA_TCD_ATTR_SSIZE_64BIT | EDMA_TCD_ATTR_DSIZE_64BIT; - default: - return EDMA_TCD_ATTR_SSIZE_32BIT | EDMA_TCD_ATTR_DSIZE_32BIT; - } + u32 val; + + if (addr_width == DMA_SLAVE_BUSWIDTH_UNDEFINED) + addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + + val = ffs(addr_width) - 1; + return val | (val << 8); } void fsl_edma_free_desc(struct virt_dma_desc *vdesc) @@ -623,7 +618,7 @@ struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan, /* To match with copy_align and max_seg_size so 1 tcd is enough */ fsl_edma_fill_tcd(fsl_desc->tcd[0].vtcd, dma_src, dma_dst, - EDMA_TCD_ATTR_SSIZE_32BYTE | EDMA_TCD_ATTR_DSIZE_32BYTE, + fsl_edma_get_tcd_attr(DMA_SLAVE_BUSWIDTH_32_BYTES), 32, len, 0, 1, 1, 32, 0, true, true, false); return vchan_tx_prep(&fsl_chan->vchan, &fsl_desc->vdesc, flags); diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 71e19e20f1cb..3991956dbc11 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -29,16 +29,6 @@ #define EDMA_TCD_ATTR_DMOD(x) (((x) & GENMASK(4, 0)) << 3) #define EDMA_TCD_ATTR_SSIZE(x) (((x) & GENMASK(2, 0)) << 8) #define EDMA_TCD_ATTR_SMOD(x) (((x) & GENMASK(4, 0)) << 11) -#define EDMA_TCD_ATTR_DSIZE_8BIT 0 -#define EDMA_TCD_ATTR_DSIZE_16BIT BIT(0) -#define EDMA_TCD_ATTR_DSIZE_32BIT BIT(1) -#define EDMA_TCD_ATTR_DSIZE_64BIT (BIT(0) | BIT(1)) -#define EDMA_TCD_ATTR_DSIZE_32BYTE (BIT(2) | BIT(0)) -#define EDMA_TCD_ATTR_SSIZE_8BIT 0 -#define EDMA_TCD_ATTR_SSIZE_16BIT (EDMA_TCD_ATTR_DSIZE_16BIT << 8) -#define EDMA_TCD_ATTR_SSIZE_32BIT (EDMA_TCD_ATTR_DSIZE_32BIT << 8) -#define EDMA_TCD_ATTR_SSIZE_64BIT (EDMA_TCD_ATTR_DSIZE_64BIT << 8) -#define EDMA_TCD_ATTR_SSIZE_32BYTE (EDMA_TCD_ATTR_DSIZE_32BYTE << 8) #define EDMA_TCD_CITER_CITER(x) ((x) & GENMASK(14, 0)) #define EDMA_TCD_BITER_BITER(x) ((x) & GENMASK(14, 0)) From patchwork Fri May 26 14:36:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 686184 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD53AC7EE2C for ; Fri, 26 May 2023 14:39:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243947AbjEZOj2 (ORCPT ); Fri, 26 May 2023 10:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243917AbjEZOjS (ORCPT ); Fri, 26 May 2023 10:39:18 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2044.outbound.protection.outlook.com [40.107.104.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 720EFE4B; Fri, 26 May 2023 07:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k1DHbHB5zsYccOPpHXoQ+q4KCF/C8ox8Eptj/x017ZLsDHXHKikXzfYNFO3FhKQvorPUjjdbyYoSo+kncSuAFH6fOeehSpkPDm7g1TmERYlHbgSRp55DqpUppR3TdkmEGdzlchaYB57LUSl6dFOpeXP8+3VmEzpSjT/qjhL4rwaM7+iuXfPByHqaZuPGmqaMrYdpGePsejHPOtrJo8VDwz9bWrm6CBmPMKOHNwObSVPBu4xlBWKkFYS0WHMc82oAy+ZeTajY7vVrfgxt/q7nj6aA9TlHblhuczbKVig2aU85P8Zw68phHNM/vpBY3I8VUBcZV1RiDCPlgVm5uY4f5g== 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=ZX5uQiZbWlSQBsI7bxXuEwcbNQRhGGX00lAlSQPYFEQ=; b=Jp8lr92T+O8DpV82C9w76IaadhqVDfFkOSEeT5Xopf1fwckJs/hUXGOuUNtMAYRvz2HhQ1vaL9QN/WDTXI1lkDCd4uMtpuh2RS9/2UABgHlVHvGH+62wXTz1ZYVLaVQnjlgEEgGkMDt8MFjVbxbV3gqaj33Ya/iPppgc65FVWGcBt8kJN15lGATvCoPG65m270nWKOiIBeIiQ4ZWS1A4BdwyEfvoyIqdJODHoSfDxuVsHDBFRmFUYf4WfeP8gF0oaS/IPK2uOTH8fOba/Rd2RLFnyBxEIwoXVtsXIy5fMAB/lWBhYHbD/YXSG9vVuv/ShXowv1ZscrCwStyTU8qlow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZX5uQiZbWlSQBsI7bxXuEwcbNQRhGGX00lAlSQPYFEQ=; b=HbpQArk16VdAqMgLf0cZgA1pVPwIDHegxWsdJJk0AotikbU8ymFeW1t1tTSxxjWv8OtMydYWTfv7/VEFHrk9VL1T+zVihgnQFLAk8CIViqqyHsSmQ3FCVHN8rc8cnKFg8/ea/l5D0qEfjku+1VlM50OWyiebMAx9cbVfnW/AhF0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by AS8PR04MB8070.eurprd04.prod.outlook.com (2603:10a6:20b:3f2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.18; Fri, 26 May 2023 14:37:20 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6411.028; Fri, 26 May 2023 14:37:20 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v1 08/12] dmaengine: fsl-edma: move clearing of register interrupt into setup_irq function Date: Fri, 26 May 2023 10:36:35 -0400 Message-Id: <20230526143639.1037099-9-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230526143639.1037099-1-Frank.Li@nxp.com> References: <20230526143639.1037099-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0212.namprd13.prod.outlook.com (2603:10b6:a03:2c1::7) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB8070:EE_ X-MS-Office365-Filtering-Correlation-Id: a830ae95-ff0d-4e70-12a5-08db5df6b5e0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FtS85zSHXiBzBV9DnP8cYCZ3hhhifvwtHcbZWCIvrRBNXVZcwNdJtBu/lXStUQLOJLbMPT4W4BRA/yEqZJiByHSkFvyy1Gu+wUjdP7dy/RHe1cL4tP4ejBGMDscsMZWjgYIRLfpcZ9cPvxPehxyocj94k1OWE+b3qZz+IB0u+w/tD2z2IWMNsOAQQUP6cLr2FV4iNVfCTYeLn5Er6GaUZQF2a56ouRru6yx6zZ7ReLmmenkBcvxQfmw57Ck9VJxGS3YhH0LGLDAE6NC6wv5tOi35CxAKrgK0bIaJKtLtVxVif9aWhu9xW86rhoGO6MeoTSh9Ox+7PPYmkPaWha1FUHUGZRyku9s3qyf4v4sV+HZhPl1sSK557158qHQsKk22/AKFGxALDLUoToKYiVcd/mknv9Oe+58f8p9oa4zVyAzcsbByw2KKCx8uEjLdv6S15E32EyjyXu19rNt1gqFPoPtLC8k/5yxHMHUWgX63O/yYxo6mZUwyUMXhv8zIHlmCKqQbzfsKBtdSjUsqYBGoX6oNTENueXaY3KVAdMMpWtEQN5Cr9BMKobyOMAYNSpvdb1Lkq7XpWJ/Y2DhXm5Hl8VytuunsGU/HORBK6ZwsyQHYQYKGTVi4M5Se9nrgMd8wkCORWNMgvdXc2qyzCdFbMg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(366004)(136003)(451199021)(38350700002)(38100700002)(8936002)(8676002)(5660300002)(478600001)(6486002)(316002)(6666004)(52116002)(41300700001)(921005)(66946007)(66556008)(66476007)(36756003)(2616005)(86362001)(186003)(2906002)(83380400001)(6506007)(6512007)(1076003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qWMzA+i/BW0ClNMAJ2DtyzPPuw4L2ddbu5sw3zXnI2aEzYOejIvYuGK6hPEgs9N2aZHkqFn/OEHUuQowXDa/fHgL2aj+9B9PKE22buiMZplV9+h9Am9pjcioyNuJ2g0WCZz24H2mt+6wHYxgj9FmWQsJrLEZWkXZTiii6Z/PxYuwPQVM0bGaoksAhZHgVhCJq1mug7t31AuanfhM5Wiy01ZKR4c8rVhv70LBt0t+HgcAQk8RXYLfjF2ar91R742vW2icJ/oE9d+Y3iu907VZqoeyyTBgoc5B8lYn3ZlRO4NzeooIDET+3Tv3C3P6G/Dkba36w2IwCwULSG5cO2aXNPWvfLqu0v5aNUH/WdtDivLnUUQGBbtk8ZwTnoYITYviMrUcff+n56qTGCjTRwl1DfbEZTO5cmMy1MVzJZ7ctbvU6pNXAlvOPX8s06HhA60cXdAzl3MClIanK13bVqceOgdDKghkeeLQm9F8qSLhMu5m3Y7uQ8wwsoDSYNvjcyDDe/bxjjVSS3jTnFCmdiEwimYvXhnnZobl7X0Jgr3ySeN7fkqKhKRm5CiBOh+gGJKGiQcxq6AkZKtcI70ypKrWRRhVbxAiKH6wM7zJ9s/kGTYolTCr5azl0OOaTMpDJdC7kLmLU1NfayCFGN3L2dV8pZZ1irJui2ENxa4ma6lw2welUSgnzmnpa4eFuMxD6C/ruxMdQL3K8mSMeJmw1oir2HgQ2p8qamLar4hczbixISxZQ6YdLAOjiorAnCP9WmCCunL1XQ6THAAKxQQbnIiTmYm6T/czCSoLZM3K+IVLTFbXmv26HC3vgcuVyuIUmXu+vZyNsrlBlEQbGKk3WVfpGim2Aix0tYgyUIuM7QS1cAXRUploA4V9oR7BzqJkzLaMZAmUvnXmymtpHOwJrZxsyIvF4JCzreO8u+qCiHP1w2yMMdIU8afH2Ixe/BLcns9nGv1bcOOQAUEPpmA70yvg1wz2evaXahkTbmj68i9D7ZFI0lSfiWoYa6rD42CSLqCWzJdG0s+wMSJiBW4kzpQK9Km51d50Ye45Eg3sdSNhqJHp53/NO6LyqpV6B1cBRTktPaMZIyjRVd8BX7gSEqFTQ7bzRZN+WAnuoiQYZXLBMRyo9QWxNnQh/APOiTLJTEP9MIvWhwzpmRq948iobwZWH8Q+zkrabuTm4fHcAW1U6MIJdIi2iMNVY3QmxfeeN0OtZcz2IxGUokoLBIFgGrDcCWY4TU7zRcQymv2yXMHsNXk5abDr9TMQ705Ai9msFqQlNx7U4K+ZLxQKlCHzPucOyqjoUZNHaHIZozQEFIpx527reE4HEhG9dDEcyFlOdRQRdXdZsZJPVXnaz6+nAV91O7/8cy8kQrm+P4134xighwZebhzzYNjsdhATZi4fCsFrkX9aji8cqhKDgK/P1QzoWgUSIFzK4Xlh8ckkMk9sstUfu6Nmx8gL1RksYJycIy3ZIcaZFrasuFQD02qiFwm9eDc0/j3tpGZCwKOsRZoJ9yv7yQNUD36QzkcYytFgXH3La/KZk94UYTc7yLRv7oiSGj+57ck3LkeCw2fHYjKdue94CZby69Qm2IbzeIdcm81A X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a830ae95-ff0d-4e70-12a5-08db5df6b5e0 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 14:37:20.0924 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 39EBQJgNIiBcZjf4BZE7ohpWPwCQ44VmIRV8O3FKInPa1afTdflDoz6/C5zW8HrH8+g4DtShtQlNIxRnF9d3yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This accommodates differences in the register layout of EDMA v3 by moving the clearing of register interrupts into the platform-specific set_irq function. This should ensure better compatibility with EDMA v3. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 6126717fc87e..cd734779f2eb 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -113,6 +113,8 @@ fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma { int ret; + edma_writel(fsl_edma, ~0, fsl_edma->regs.intl); + fsl_edma->txirq = platform_get_irq_byname(pdev, "edma-tx"); if (fsl_edma->txirq < 0) return fsl_edma->txirq; @@ -154,6 +156,8 @@ fsl_edma2_irq_init(struct platform_device *pdev, int i, ret, irq; int count; + edma_writel(fsl_edma, ~0, fsl_edma->regs.intl); + count = platform_irq_count(pdev); dev_dbg(&pdev->dev, "%s Found %d interrupts\r\n", __func__, count); if (count <= 2) { @@ -313,7 +317,6 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_edma_chan_mux(fsl_chan, 0, false); } - edma_writel(fsl_edma, ~0, regs->intl); ret = fsl_edma->drvdata->setup_irq(pdev, fsl_edma); if (ret) return ret; From patchwork Fri May 26 14:36:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 686183 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F7F7C77B7A for ; Fri, 26 May 2023 14:39:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243995AbjEZOjn (ORCPT ); Fri, 26 May 2023 10:39:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243945AbjEZOjj (ORCPT ); Fri, 26 May 2023 10:39:39 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2053.outbound.protection.outlook.com [40.107.104.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D24DF10DB; Fri, 26 May 2023 07:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CsNWz2okCFOTYg7StKqAPityO2OR6NayOu8cJ+EqFK9asYkvS2WA+uPCeTfizeahXDUha0kMMq/sPGR6BKisUhQ8x4CJl5a1boKCFaPcnG/w+oC1dkc4hbdirC7MSI5fawfJTc2vJMNSmlA62VTv0uf5qMvRMXRSlVvWZoBx6H64hUdRrlywvQhS2sbkVRx3tHZWuidIGMeZ4gbkRGwhZU3tAglvN/ztRT3AD2lftIwQpE+OXBY1Yy6xpWxiCmczqyhNRO2FLmRrgn4ep4KMet2THcUdXeW36SOKmqbYGeFSv51i+J/UNSknR8+LDIV1fGvaZg7d35o2/a9Ee/dInw== 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=BNjfU1dbjGe6WQ8dMx8AJBvEVMIU7B1H7pGqCNARUFM=; b=cSakRJwWIdW1aplhbe/HhnHhaBGXt5uAA+LXbf8cwj8ig7jA5nYOlm9dYaHanV1gbiTT7KltkiVI1pnJ/PgN/YUzgMojU9YrCUJSYc9SAoaP9NsEYFA5OX/UNa66zwN/cOK/r2nBI5faHXFGHaggZmPGZOdjel8ap+XvVayOY4IenUo5D1LwkAa8tBSCLRTCE8eJXV1E1RXcw5c6HeaGVpF8xbokLay4G1n7HXJ7SKIarhZUmrDfJNoIgBFDj9TjV4hNO1rt0PBU5TDWLTWg+wGuVcyt17liLdofYkrPsmAkvnYxJ71lHEgT4AwJuqhf+gq/MUCQANqiGI99acHdZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BNjfU1dbjGe6WQ8dMx8AJBvEVMIU7B1H7pGqCNARUFM=; b=Upf+C6QSHHHSk/ud5g18UlaQQEs7uF1HkgXmg5A5EiZqdW4sBUJm5SQCjGJxbS3AAD1u//y6kmZGKUEf+P3gApfBgj3zBMuvTSDeuYME8r9AWHcFao6xbhB2ocS/9GSnxAAcqQubVIKhKhK9DPLbceXmWwfmRtDBXp3BMqFsTU4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by AS8PR04MB8070.eurprd04.prod.outlook.com (2603:10a6:20b:3f2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.18; Fri, 26 May 2023 14:37:26 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6411.028; Fri, 26 May 2023 14:37:25 +0000 From: Frank Li To: vkoul@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, peng.fan@nxp.com, joy.zou@nxp.com, shenwei.wang@nxp.com, imx@lists.linux.dev Subject: [PATCH v1 10/12] dmaengine: fsl-edma: move tcd into struct fsl_dma_chan Date: Fri, 26 May 2023 10:36:37 -0400 Message-Id: <20230526143639.1037099-11-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230526143639.1037099-1-Frank.Li@nxp.com> References: <20230526143639.1037099-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR13CA0212.namprd13.prod.outlook.com (2603:10b6:a03:2c1::7) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB8070:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d24b9ce-930f-4ccb-63b0-08db5df6b94d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s2HcGqkzhsQK4qShn5IfrOU3dVoJX7n3ZJNmCiy1EpNQzwIHaL5FF5cGqCf8QMFG+mhQBbD7i1KxDVv9FhbSywvOk7NjKo3e1HGSxIghPQX0Bj0OBg06NXNTSbcRIAmfvyjhkEgUOPcyBlONjGz1edy7DqMLto57FxwBM1tYLqzWnrvxLg6sGN4FhGvWsDfSJcbdI22RjBw40rUzy8fq8B5Bmt1HaAaXl6SXmYowjPWfeXvY1Kd/IcwZOL6Z3cdlk154Lsp4kSfA+nigTlL23i339dJ3yiA5UdsIPRcKjxNH+ROC4EbjsPaRZAMPDwwDF9yly7Ysi5jhwZ8PmsV1r1Il7y93YoQ49DdI+puxKB2ZiM18+Xr3DdaGUN9QO0ugJGBfW0kda67yGeaw7TZLNN4RLGjX8pq1AHK+9GoPfjStRbZWxUuQaHj3wUBhR6Guo5zTW6GBNQnpfevcXtabTSWv7gilw6wsB2kCUVW7ZyI7S0WDQeMYTVuTnov1ObYQ4sVGZFAUnVs371d/tntxEdDHX6PJ/Pj4/Cr+yaahChrpLOyJgsQGoluFUj4tCzMnmDbTGbOA92fshda+iy6Ku40CDZnRcT6dAeHVC6oV1CEff73ZVc6SvOiOO+EMns6taHgP9sheOumwBSQUob/c4Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(396003)(346002)(376002)(366004)(136003)(451199021)(38350700002)(38100700002)(8936002)(8676002)(5660300002)(478600001)(6486002)(316002)(6666004)(52116002)(41300700001)(921005)(66946007)(66556008)(66476007)(36756003)(2616005)(86362001)(186003)(2906002)(83380400001)(6506007)(6512007)(1076003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ar153bedu21/LUybv21z1jXtdHyxZKa+BH9eglNuhvfOEI51wvqo4zTdlwyZ71tQGDazJCStBL3u4fjp9MWpTB6lwG3u8N1IfYeXWKnfjhyxj9IKu9nUxoch3GhpunTtAlPZlDIpXnJxC2NWFi5O1QQdwzfXA5al3mSj2+vweoOvDlYviMJpzSyjUeIl5YOW3daMVouNGOeLplhePNjRk27R9ZIqKG5LhZnLDR1zTxrmLUeV5Bl6vXwcgjM0euuU3W4b+jH5U/uXFuVmaSHljr3Mf0Ml/8M9tW/2aLTouiTjbR6ShHgh0gECLQzSIkuYYdMp/gFi+k56QxHbVki4RmlA96mYkX1iOGKcPQiIjsWZ7qpMWc9XUv+7FynwPSHC8itLzfdcux/GIKNQmeDkezKrk53sMRWxNiL9hYKgjnxGaBhkYPBhmK2e9PmpiDEELXwAhJggV9TNUAcpMQhTpzCbAAJRyw8oGPbKojfY9GqRcXOI87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EkyQBXqIsNDvZcpLdsci1Fpv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d24b9ce-930f-4ccb-63b0-08db5df6b94d X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 14:37:25.7870 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hDXE5E4DrjsDDgx5rxjHFRn8uk/nRLP8np05QBvqXtty8qImokAud9kG/bA72SUrRixagJICjpNkAnVLxXSzoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Relocates the tcd into the fsl_dma_chan structure. This adjustment reduces the need to reference back to fsl_edma_engine, paving the way for EDMA V3 support. Unified the edma_writel and edma_writew functions for accessing TCD (Transfer Control Descriptor) registers. A new macro is added that can automatically detect whether a 32-bit or 16-bit access should be used based on the structure field definition. This provide better support 64-bit TCD with future v5 version. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 38 +++++++++++++---------------------- drivers/dma/fsl-edma-common.h | 22 +++++++++++++++++++- drivers/dma/fsl-edma-main.c | 6 ++++-- drivers/dma/mcf-edma-main.c | 4 +++- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 659bef4a3b23..186b5c41d07f 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -40,8 +40,6 @@ #define EDMA64_ERRH 0x28 #define EDMA64_ERRL 0x2c -#define EDMA_TCD 0x1000 - void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan) { spin_lock(&fsl_chan->vchan.lock); @@ -285,8 +283,6 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, struct virt_dma_desc *vdesc, bool in_progress) { struct fsl_edma_desc *edesc = fsl_chan->edesc; - struct edma_regs *regs = &fsl_chan->edma->regs; - u32 ch = fsl_chan->vchan.chan.chan_id; enum dma_transfer_direction dir = edesc->dirn; dma_addr_t cur_addr, dma_addr; size_t len, size; @@ -301,9 +297,9 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, return len; if (dir == DMA_MEM_TO_DEV) - cur_addr = edma_readl(fsl_chan->edma, ®s->tcd[ch].saddr); + cur_addr = edma_read_tcdreg(fsl_chan, saddr); else - cur_addr = edma_readl(fsl_chan->edma, ®s->tcd[ch].daddr); + cur_addr = edma_read_tcdreg(fsl_chan, daddr); /* figure out the finished and calculate the residue */ for (i = 0; i < fsl_chan->edesc->n_tcds; i++) { @@ -358,9 +354,6 @@ enum dma_status fsl_edma_tx_status(struct dma_chan *chan, static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, struct fsl_edma_hw_tcd *tcd) { - struct fsl_edma_engine *edma = fsl_chan->edma; - struct edma_regs *regs = &fsl_chan->edma->regs; - u32 ch = fsl_chan->vchan.chan.chan_id; u16 csr = 0; /* @@ -369,23 +362,22 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, * big- or little-endian obeying the eDMA engine model endian, * and this is performed from specific edma_write functions */ - edma_writew(edma, 0, ®s->tcd[ch].csr); + edma_write_tcdreg(fsl_chan, 0, csr); - edma_writel(edma, (s32)tcd->saddr, ®s->tcd[ch].saddr); - edma_writel(edma, (s32)tcd->daddr, ®s->tcd[ch].daddr); + edma_write_tcdreg(fsl_chan, (s32)tcd->saddr, saddr); + edma_write_tcdreg(fsl_chan, (s32)tcd->daddr, daddr); - edma_writew(edma, (s16)tcd->attr, ®s->tcd[ch].attr); - edma_writew(edma, tcd->soff, ®s->tcd[ch].soff); + edma_write_tcdreg(fsl_chan, (s16)tcd->attr, attr); + edma_write_tcdreg(fsl_chan, tcd->soff, soff); - edma_writel(edma, (s32)tcd->nbytes, ®s->tcd[ch].nbytes); - edma_writel(edma, (s32)tcd->slast, ®s->tcd[ch].slast); + edma_write_tcdreg(fsl_chan, (s32)tcd->nbytes, nbytes); + edma_write_tcdreg(fsl_chan, (s32)tcd->slast, slast); - edma_writew(edma, (s16)tcd->citer, ®s->tcd[ch].citer); - edma_writew(edma, (s16)tcd->biter, ®s->tcd[ch].biter); - edma_writew(edma, (s16)tcd->doff, ®s->tcd[ch].doff); + edma_write_tcdreg(fsl_chan, (s16)tcd->citer, citer); + edma_write_tcdreg(fsl_chan, (s16)tcd->biter, biter); + edma_write_tcdreg(fsl_chan, (s16)tcd->doff, doff); - edma_writel(edma, (s32)tcd->dlast_sga, - ®s->tcd[ch].dlast_sga); + edma_write_tcdreg(fsl_chan, (s32)tcd->dlast_sga, dlast_sga); if (fsl_chan->is_sw) { csr = le16_to_cpu(tcd->csr); @@ -393,7 +385,7 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, tcd->csr = cpu_to_le16(csr); } - edma_writew(edma, (s16)tcd->csr, ®s->tcd[ch].csr); + edma_write_tcdreg(fsl_chan, (s16)tcd->csr, csr); } static inline @@ -745,7 +737,5 @@ void fsl_edma_setup_regs(struct fsl_edma_engine *edma) edma->regs.errh = edma->membase + EDMA64_ERRH; edma->regs.inth = edma->membase + EDMA64_INTH; } - - edma->regs.tcd = edma->membase + EDMA_TCD; } diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 39b5f903ba87..0a95fd5d74f5 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -48,6 +48,8 @@ #define DMAMUX_NR 2 +#define EDMA_TCD 0x1000 + #define FSL_EDMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) | \ @@ -93,7 +95,6 @@ struct edma_regs { void __iomem *intl; void __iomem *errh; void __iomem *errl; - struct fsl_edma_hw_tcd __iomem *tcd; }; struct fsl_edma_sw_tcd { @@ -117,6 +118,7 @@ struct fsl_edma_chan { u32 dma_dev_size; enum dma_data_direction dma_dir; char chan_name[32]; + struct fsl_edma_hw_tcd __iomem *tcd; }; struct fsl_edma_desc { @@ -160,6 +162,16 @@ struct fsl_edma_engine { struct fsl_edma_chan chans[]; }; +#define edma_read_tcdreg(chan, __name) \ +(sizeof(chan->tcd->__name) == sizeof(u32) ? \ + edma_readl(chan->edma, &chan->tcd->__name) : \ + edma_readw(chan->edma, &chan->tcd->__name)) + +#define edma_write_tcdreg(chan, val, __name) \ +(sizeof(chan->tcd->__name) == sizeof(u32) ? \ + edma_writel(chan->edma, val, &chan->tcd->__name) : \ + edma_writew(chan->edma, val, &chan->tcd->__name)) + /* * R/W functions for big- or little-endian registers: * The eDMA controller's endian is independent of the CPU core's endian. @@ -174,6 +186,14 @@ static inline u32 edma_readl(struct fsl_edma_engine *edma, void __iomem *addr) return ioread32(addr); } +static inline u16 edma_readw(struct fsl_edma_engine *edma, void __iomem *addr) +{ + if (edma->big_endian) + return ioread16be(addr); + else + return ioread16(addr); +} + static inline void edma_writeb(struct fsl_edma_engine *edma, u8 val, void __iomem *addr) { diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 722ebecdc894..8d1d0100f6e6 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -312,9 +312,11 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_chan->idle = true; fsl_chan->dma_dir = DMA_NONE; fsl_chan->vchan.desc_free = fsl_edma_free_desc; + fsl_chan->tcd = fsl_edma->membase + EDMA_TCD + + i * sizeof(struct fsl_edma_hw_tcd); vchan_init(&fsl_chan->vchan, &fsl_edma->dma_dev); - edma_writew(fsl_edma, 0x0, ®s->tcd[i].csr); + edma_write_tcdreg(fsl_chan, 0, csr); fsl_edma_chan_mux(fsl_chan, 0, false); } @@ -421,7 +423,7 @@ static int fsl_edma_resume_early(struct device *dev) for (i = 0; i < fsl_edma->n_chans; i++) { fsl_chan = &fsl_edma->chans[i]; fsl_chan->pm_state = RUNNING; - edma_writew(fsl_edma, 0x0, ®s->tcd[i].csr); + edma_write_tcdreg(fsl_chan, 0, csr); if (fsl_chan->slave_id != 0) fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true); } diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c index af1b0e8a3021..d79a04a03fda 100644 --- a/drivers/dma/mcf-edma-main.c +++ b/drivers/dma/mcf-edma-main.c @@ -200,7 +200,9 @@ static int mcf_edma_probe(struct platform_device *pdev) mcf_chan->dma_dir = DMA_NONE; mcf_chan->vchan.desc_free = fsl_edma_free_desc; vchan_init(&mcf_chan->vchan, &mcf_edma->dma_dev); - iowrite32(0x0, ®s->tcd[i].csr); + mcf_chan->tcd = mcf_edma->membase + EDMA_TCD + + i * sizeof(struct fsl_edma_hw_tcd); + iowrite32(0x0, &mcf_chan->tcd->csr); } iowrite32(~0, regs->inth);