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: 13256992 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 9619DC77B7A for ; Fri, 26 May 2023 14:38:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237436AbjEZOi2 (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+066Aln5qZ2vNJV2kCbRkOcgRbC1p8H5qtuwk0cfT4fHCEmLDe0rhqiQn9ekFVG2pZXzrDiBIPGuKdu4GNYMbmUJL6oMXwetzVQm7/l7zueBzYgEXG6uZs7NQGxuyyf5j6hGt0yLU/0HKB6+/84GqhvxTqAgPzpWASGDAB4QKYsQxQ6LkM6fq79ubDCKVNwpyHRF+IjTSW8EUGA5TKhFGAlHphqytaygkSBKpPspzq3z2zmA3VMW8IKaP+XEx3f4RnD4ZP+Suycv7BtjFU3HXaJ/j1t742JKFsoipLj4+O0Q0IqszRiwAndGG7IE5aykaHNfBskO89qKgV0gsbvZ6hgnJXkPeQ7XqprJaMA2rf6/PtFCDWVwIEo/j53IyvCStBELL2oHnt/B8wcvIZ+9ljB1hwJQp/nueY+O5Xw/Jc2X+e+n15UG80/0NTWC1uSYvHqHfJwoV8t36wiZH9ygIxoNq1ALG7gbSNfTP1wmwY6ktN7H5rmohfhOJfZqmZhI+hZmNxrNsIc4aYw+SDym9FcALmPW//aHXSWA/0ne7gFSFoI+KXYb8XLVcN+He6VhZUJ4akHPkxV+qzlaD9yROa4mX8xPl762Pygw9BHZtjh4wMU3gWFGR1n9C5O5BMBn0ktMNShIYOySmROEXIgYhhAceInmavogO6yrhqK+fsZikBN38LMM9SolxZK+JkEzOcTcp1hwV/jubTPOhxEbBcDjembUfvVDJvqXePEEBMOicPBPgCKx5sKg2pPSWv2roryFYNS/IW45Yw173XGBn8UkmUNXuvF+fF1egDRiIlXxy8TGQPA6TB2LYDi85BmiMw53kv4O0u+c66HeJfARy2gscATr3jhBXMEsKerphbVgmkAXI9kfYxSlsC8QxCTe3IiBic/nFbEGZ8tY8EKjlx8JqTwuYuo0MJH/tK1wnD2c4tQ2IvDfsXnnYcD4//ZU35mXDIk8BWnEpVJPK0rqXUGfKM2DywjjwG3+etgTIqVzI0QPUhayv9XQjzpCy2peWXiQi09VLqgQ/+AWeVzZ6w/V49MzPuFCL+M6eg+XLYlvBa1TshgMt+lAkrPQVQix6sGCPAb+MkzKPVMKVovqMcZunNwab+BrGsydgQIUfbf8juvfbHBa/5atd6r4pA4o0+z9QssFdYYOmmH7uFqXGy0fWrnay9v/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: dmaengine@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: 13257015 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 76F3EC7EE32 for ; Fri, 26 May 2023 14:40:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243917AbjEZOkR (ORCPT ); Fri, 26 May 2023 10:40:17 -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: 1 X-MS-Exchange-AntiSpam-MessageData-0: iGoYCh3XJGNiguXeQAhuJVL3sUVW7cqGItoAK7DvvW3/WdcIZqnL1NSbmVuDoGQDvXVISi6QOwQesfI326+bOcJUjqw67rQwGzZpy/kvRf66exNlPyYEdW7+hmn3n3F4q2jn7KWpVZF6VUDvcjMbIi2wmen0nle9fgrUaOo377s7RGgxaa2hbMXNbAufduYYO40vahl+/O0Z/o1xLJLPb8LVSs9lbkGJSpz+mSAx8M2lPI5/O2nZ7S3sNOKc1p9mM9H2T0t2bvqqfllLpXaJUAPrJxZgI5leLyZiqGXZyA3SGuvaxdrWrwFBPHpEj6e91epqUznUFpuPF2RHjMBDDxmQKkuf1C2pQSf/N34S+nbH+qpWTxHulftq1MfraT41bzPkRHhDO48BFpTZLLLwDjePsbFcx8VNZbysjgzPNOFg+EmnrPytEQrfsNF1d1yJe/1dY8g5WpLDmAs9nd0ZSEYStsEGy+rQEgt8tJ7NDJ1WHuOJMkYfPsYkIemwpJ50ld55SBO+qIU6y+xwXWWzHrjobvRrzW/GShiL21/14eMxpdxDyjK0k8R+x6r2t27zFvhPvDDBOF8Potp+bIE0A+KgB3a89E5twvP5sGJ46N0RykepQ6Fhe1idXaXoxTjQHdg8dSCfVOU0c7WjHjUgDtNcmlLGC18Pc+H91POEjHWxaoGcH1ln3QpKKbG/yfM3q9zAfANGle+03w6azLvmpZGu8+y42i9HjjZ6+T1JwOc7Ln6UiDhpC6dMFg6AWKLMjsu+aHUxZg0/9Zq619hrZSRk96/nkK2eiagBfiMAfriZ+12Tl0LjeMsMNZRENEIbCrLXAFnvcGjlMGgFTA+3w+lAw3YpV+kvHtA3d0SuBHqRejeCg3ruM1mdlF8yeHjK0eUrtHGikixjKGiinbQgUxYBfQmREuPFK7gANKb84m3sB9kH3xG2s7IczC6CgpcSPGcOPyvd19BUnvYJiiqbkkh9+LnWrtFHiOxQ/2ncBMmxfKBFJUlTskRZI2DwlaeDcfUBIO3RvnG2VRqbyQwjYKFjpjEQYmZDlKUeTLXp4+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: dmaengine@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: 13256994 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 AAE66C7EE23 for ; Fri, 26 May 2023 14:38:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243917AbjEZOiu (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+b8cfcp2KunqwXCsyP0JJ3E5i9ffr0GUgS2rrKZIuDao4iFmbVKnF1Us5LF9a9yhreizAAyx7zieH7qAhxhjGL3fFK5zXZdHjiY7JbN6wajnn1ze85dl3n2tutxxgF4tUEV9m42hjvcB7ydIs9xuXkfciU0aTUXH5YrN0LxgwjuNgNOyqtcwCjhZ7X58cQOYAIIq8XyYVXGctsrg86u5dPOcP7UDFAJVk8FVV+BwfFVOFid2FewQxzFTI7CBeckM4MEOd8HaoCc0UXjKBM+iPIX2SgnQhPAK7DarHD86MDaA5BD7ivEOiN9hmRHFTU3Uw5E09TOxhO0RGbAiMletT2yjXL5r0eokFNPOmBNMCsDg+RSlRfi11UmrXOis4LB8Vj6QS15Ztm1vQGpTDZ+VZzsBGf8vPBP5UxwsZW5y1TbRvKxOcgiJjdx5KrBfvy1zDJgJBCZSZ9T6BeKyfGkZAV1r7C20rfKNMKZohbvStn5FllsBMP06XxNX3FNbu6TD+aIkQUPvAInrpCBTpLLLGd0J1QASVrcFcD9CgtCSkrtK3+cu8AejAWu99WfrH1ImRUfnOATSPkajzkEqRI21O6LFoHBY+KJ57EKaB74mXJTB9/kV7fLcG1HYTMFes+ASQWdg5pNb3G285hSvOoFqCqGDwp0bWtNttK6VxSHvtHCDjaVENWALcZA/SiWqjQ6IE6xfu9xa32NueZvUM8zAlw2pz7BEW+gjL5xtJFVpUeRYyBrlGqVIzdeJI0FLdNdhfy2osnujPXIMQAH+QRe5vPwtPFJBwS0y2CEr/O/z1fw7How2lUq3pB6GnnkZteHcBlUZrcevCdwzOFCpYhaqHKb8ULx8NfNHX9xgUwFVf/aup7EWXVQ+7hr+hlcjzWwzrStO1wgOzxKxfCj8gwVGplNXSxEblzC0AumYmF9WTtPjSw5TRd4V96ktCB0jf8hiHyPYVOM84C1lE5oUONY6HrqkwIon2mXhOvTruw2A+tmSYpmp1mi7K3/nKD+FoS/PzoxXNJMLgHRqfIt0X2gQhrJUvGn9ZHR+ySAJ3eN1kfgPuB7Z52bC/b1ln18Pow4I8XZ6dryTLHkY5WuqBscNf70L98mdamBYefQ8z6E8rh/v8dYdU4xZi+OOsybvUszKSnNragHQvhb+wHFUlzii8pmh/fEO9KqnKXWqMVvd+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0cf8376-3651-4951-6187-08db5df6ad8a 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: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: dmaengine@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:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13256993 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 91416C77B7A for ; Fri, 26 May 2023 14:38:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243886AbjEZOik (ORCPT ); Fri, 26 May 2023 10:38:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243899AbjEZOii (ORCPT ); Fri, 26 May 2023 10:38:38 -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 CA9EAE45; Fri, 26 May 2023 07:38:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZqVf7Sd68iCCHmqboY8WZdnMrQlh1bY+sMOCfEELBkrtwg7/cWBdFBNuPcByrE1+lX1ug+0pG//472j4ma00lpnSelI1YVYg039gybukT7PE20t9hSn1dK2N8veZRRYgPnopl3hAcWBIRGD1SykUNF2qD+Dm7fpvle4I19HQQPm0LBboa8pJ5NZ9gz/2oVbbUbsFeQTQro20maCCJOEswetZIEuevtJVsya6n5p0MVFEFRQDNpON1vhOitt16zg5UEBwQYwsj9cWhR07iPslERzKjtxG2g8gmZAXTImjdUi0uT8LuSNXQZS+5gLVYpO/UmKsFG1xpJicuPUvO/Dz7w== 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=ouCBlwm7fIzHEcTW7UBupyDePR7cnWUmtikSOmu98+k=; b=aQTsUuEcOLleapwWvPRIJ5ckojx5gIA2USInIkWh7Mp7X7EbSBbY+GXim3f3XpVcOwR8fngq+aMNDl6GMpDPDCcFkwrYok4wIsPku+62xxqq3gHXY3AYPjSq6qv6G6Fpf64CA9fq4AiRZO2PG+aqND8K81sXXPO+9SWwwVADO1rnnfvNq1kEZ0ksuriAwDGidaFZV5SpLvyzfCpNb24FTtAn85pfqi1Z/YTdIksR7iaGgF9m/RIfrw9DVD1u6AiEP2oWMXLhJ10fmRfQGo7/jPYOrD1PsDK4QP92vZCgP4rOas0D9O15VP9j8ZcAQ+7V2GMwmAA5DFYHuXMkplccVw== 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=ouCBlwm7fIzHEcTW7UBupyDePR7cnWUmtikSOmu98+k=; b=a73f633YstTWlBagm8R5FBytQRHzg9nhnKVhgCI+H4vzELSTY9+mpsDvPB71+/flvI160RgSSuzv8MVYwuXlpsVsQCuHRiYZMH0T3ajKNXggXkt4AOUyTgPC8cCubp7bfdh0UautyekGh1JfuOBS2Y/Dt/Dqvmv0jjFSUdD3424= 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:08 +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:08 +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 04/12] dmaengine: fsl-edma: remove v3 from enum edma_version Date: Fri, 26 May 2023 10:36:31 -0400 Message-Id: <20230526143639.1037099-5-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: 94a4c8ff-b9d8-484d-bc3f-08db5df6af32 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bJ30xwZiDAIRS+TMY6G2LjRE5q7sf25VjhZea4YZXkdXorgyNZVDBAjKWvbAKryBEi1yLvAy++lrLMhZRoGvsdfhltrGD5tYHENBdxk8B5lvPN/AunYYgR5UdXOIAvRjaUzyDJB1dxLN0xu5NIBg6KEtHcWs5Q1Z5+fkW8lAQW73HD2EV7d4cD42QABte/pcVfG2d3CKhPJb/hEdeyTCNOkYBJSzU2bYnnAxYoCq6/g0tnm9l9zKveMmB4MwwkLYozuhhH9+7m6euETa/+Z0EZzcHwXaj114/rDr5VZbWEWurroQG1YLALH9qY/ulcmns7QmIAif79VpHjykIk5r1aB5Yl1Y5/fEIe+G1svunZSyg/Z+64XLT2AHJGfHhWAtupGLtTfAjb1n91hT9JvWY21vDQCSbrqOLqBzw7ufESjz0GvlkubwkjU6UzLvZ5xj7/7rZH45UeA/jlpmiTfHd4TowJwV2ztbQNf17AmxLkDLjqbA6Q2L6Y7NryFRx608SzB/7O0DgkgH2+ctRddwghH89FJya9t3DZe3HiXeNCpCSLNzUPJYnZYONbbhrYvuA2clIZKig3wKr+iNFLgLdvvC2CmEPOncuv3ukQEGEoLnUgCCmnOcByAoT8Fwv/kDuSzNZ3T59pwe8XEMTHab1w== 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: xbQO1d/c8mTh9RIRwOyihtoH6vr71pbVbc3g5+gHgU2mYSigd1V1XbCj692qu9EGToZEd5tfKrowiWI16X2vFJYVfAUW1+EOZWQeLaWESKB9loeeBMXhiE0D4Gwz+O3H/CSul1gBhVRWpTl7ZuBQAgJVpktukQUluFw7ZbUfh4kqENbxdJyUCkkv9HuOhdJIRUNXBsTSJhwREzZm8ykyPZNS4DUjKGIOm1KVkBAK/fbUcdTECEp8m8gdkjLtAyjsyiUcy4bN06hSs/77f7d5mYlmDeiKHSNGFvOh9fRwkAPaAnyCZcRgqC2979KvnxRlhJ2Yeu/uk4Kh27edL45SMk9d60lzxYw4q5wsYmpedR6BZwM95t3vR02Ct72zxzQ5ic5ziQd1Kr8GvH9QHFoaXS3WB6wbEA0eaiDeY9pTsI1eFSws7cR6Rv65CD4Lnrx90R8XTEYUtkHnCqpYgv2BnZ/Oqv4JoH99AHdkHS/yopKRbtMYX9ct8TeTqFcdRCJRlEk92j4G6Q9vjXr4F1a3OjwzVtv0eaVmqrPV07zizeQwW+kqhC48k/lmvrRmTkX1UZOr2G7Y+q/garg+ASXNNYHW0lonv514oHkgy+WBeiz22HbDk9JEAbVnj0r0MQNcmUvL1C1T8c8nklIXGeaeYu3pAw5vHpctPszq1ZuRqQvMkfgYa/XbrC1+rI9Ije7A/qTQGqH+oUk7514gXDayyrlK6CKisc2ztYtTFV7mfPFWiwgPiYRrf2ccA0zdylq017m62CyRJdtbDsM9ADa0mHvBfVTfD76BiokndSAYxqVu3ockjEaVmlxgLtoBRUamy6im8SFzZhvi0ZNbJKWlM9bk0heI4fZvX1EFparQDX3vGyN0uGwfjr7P4NO2vcPPglmq7ZNAAZqO7TSiGooJIpLnasyj/pLhx56BbhroOy1d+yzBuGNiLvagp0+2h9t+peeNAeXCfXCWmxKPz+TjacXbG1FjdBqR4YltxZFlO5AMIdxrKLvzjWA5Z2aiM+njT9dfcmvPz5BMz9qNJQmtOBeUzDH2dKvj14nHknlhXyVWkU4MPHjCyJGodwabysNADKdL1LxijbPJFWE/qvQ9WWj5F79UwpTkB/IGA4hJGtTj85uILmIoGDYpp4DpmeXd6A5TjuO7rv96Xq1K0OmfKFjVyKZPYTNNLETnvVoNIy2XsVX4wY3GGT6KdvbfNKJyt/C5c4jYz03ascd8j/4AH1+scIznE3ftH2J+GzV87OLi5rs7EeVK+AITQ7h69q83PIRBNEAFx7Eng8tJ8U7QrNY6xs3cuBGyXDueFohjjJeiyXS7wg8hdWufGI57F17KKtFghXga6Qhq2FF3Ek6H4xV/vjV5ckNAUYOPJZnSQs1FRKtMzTnvci9xmx35Y/2FBJrVOHV+swp8NsCXU+0XDq3i5QQf3rAldS+tOrK6cGTRAHSExX9LVYwICV1L79X80AA08xA8iXuJ87POH3TSzkFVapMz4VKZG7Z/KWh6Iwpstol90RlIVpQdJ+afIFNvvpdyAcg4dQphCdnbxkRGmfDz6kbVVymE8KanhQA+xuy0pZVvEKicl+sHiJqBA4Mp X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94a4c8ff-b9d8-484d-bc3f-08db5df6af32 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:08.7518 (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: cQpuSE9Yu7+hjrb65H8sFepMxdDRdVu9nJ3OgrBK6SxhIe/e23ExBCde9yFpA0ZaPLtXmMt+fdL5/dMzLBR6qQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org The new IP of edma refers to version 3 in the hardware documentation. However, the presence of "v3" in the code is merely a software indication to differentiate between certain chips. To prevent confusion in the future, this commit removes "v3" from the enum edma_version. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 2 +- drivers/dma/fsl-edma-common.h | 2 +- drivers/dma/fsl-edma-main.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 10dcc1435d37..e5c7497c1ff3 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -120,7 +120,7 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux]; slot = EDMAMUX_CHCFG_SOURCE(slot); - if (fsl_chan->edma->drvdata->version == v3) + if (fsl_chan->edma->drvdata->flags & FSL_EDMA_DRV_CONFIG32) mux_configure32(fsl_chan, muxaddr, ch_off, slot, enable); else mux_configure8(fsl_chan, muxaddr, ch_off, slot, enable); diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index db137a8c558d..2f13e687a721 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -141,11 +141,11 @@ struct fsl_edma_desc { enum edma_version { v1, /* 32ch, Vybrid, mpc57x, etc */ v2, /* 64ch Coldfire */ - v3, /* 32ch, i.mx7ulp */ }; #define FSL_EDMA_DRV_HAS_DMACLK BIT(0) #define FSL_EDMA_DRV_MUX_SWAP BIT(1) +#define FSL_EDMA_DRV_CONFIG32 BIT(2) struct fsl_edma_drvdata { enum edma_version version; u32 dmamuxs; diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index f5cf95d185f8..31531b8bde78 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -238,9 +238,9 @@ static struct fsl_edma_drvdata ls1028a_data = { }; static struct fsl_edma_drvdata imx7ulp_data = { - .version = v3, + .version = v1, .dmamuxs = 1, - .flags = FSL_EDMA_DRV_HAS_DMACLK, + .flags = FSL_EDMA_DRV_HAS_DMACLK | FSL_EDMA_DRV_CONFIG32, .setup_irq = fsl_edma2_irq_init, }; From patchwork Fri May 26 14:36:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13256995 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 85F37C77B7A for ; Fri, 26 May 2023 14:39:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243935AbjEZOi7 (ORCPT ); Fri, 26 May 2023 10:38:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243923AbjEZOiy (ORCPT ); Fri, 26 May 2023 10:38:54 -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 62ED710C4; Fri, 26 May 2023 07:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GbWOkhxjYa05hLMBXB4Kbq6RzNZft/uCAquvn6idVvDu+PuFITHqcXnJ6IAJmFQmwV1kR2nnb3oPTN38vcZfe9V3fM3dUZH+4jhykHSnTmNKWSrAzt+vDq9PWLXDrXD2NbHNfNUxnQ1j/FZ/WNR9va9gF2fcibK0h4HukkpnOMO7kA1F+LVbdsojfCytcL2//PrHHWVYVIl7nd2VGpmmPXaCH3zYiga61dq8r9W2iSzZQz3hGc8WeRJ9MHb/qtQ2T+KlOJFqAzuCwkhf7KAM5/MRzKcDY5VY6YmKHBrz4QUA5RzThFWaz56uKZmSX004bX0VKVzM9bkGE+jhzHhuSQ== 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=msrt5RHHs6IHX/f7JbgffOTIryNu0J13mXMJS9oOE4A=; b=PTTtXrwBvpTiL19ZdOCuc4IYxMTwB9W0vsno6slW5Wzr9VxITBX7RqcymibmfYymBrnmfhb4UB8cO2BN5JwpI89lCRXi5hS002K/n7bcMaAfnAOAUlM5+KQx1Z92+qI82Q7qY8FaSCr/52QAt9HQLLH52602ANmxxSwa83NY2vHVgUznUIy8mGvJ5d75QEJToM2GRtfTbnhl5j2iADnCeHF9/mROxs3jv0LdBYCrJfvNa7d43pblP+IcGYaHZFrUsE2st20werzI3pNmduDRkomLOaXFI/yDRrJmI5gEJ1V1zCBv4yYgHNwLh4O5msvR0fDWcWwbyqqQrDSg2+Az8Q== 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=msrt5RHHs6IHX/f7JbgffOTIryNu0J13mXMJS9oOE4A=; b=lvBsHsATzLkT+TyaoNPqjmbdvlvDzAQBEp5bKCmeMKPCh55gtpMAe6PdZE5ESyGNlvKSDWh8UDQi9hk2MAKqbtSDVaAIVDvaV0ELgA6vvgfqDPE221C0QWwbjJKtsLZhSDMykW1Gxd1Tk4fxzS4kyt/c1rJ1PXlqud9P/I8K+6c= 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:11 +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:11 +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 05/12] dmaengine: fsl-edma: move common IRQ handler to common.c Date: Fri, 26 May 2023 10:36:32 -0400 Message-Id: <20230526143639.1037099-6-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: 8cbe387d-67fb-4c02-16f3-08db5df6b0db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y4qY9lHNgRfPCcD3PXcIKTg2zYCTySwqEjgYZbAp3OPUPTIE6UY+hZNcgnMHD+ZxsdjXYf5MfStkucxMNgeWqZCWaFc+yKV82DWJsMHBQuxPJrSJSRsEMeG7zCgGyFLaGMPKW1opn4Nb8foNNd1/CCMKB7RI6dyibLg7TxyalGUQg1naJA8P48vN6Nw9Y5EVko8nIhkf0Hrql4bvvdaRUbxt+6SCQczU0fJxk8S3dPfL9PCZBDpqWpi0sscJyuUIlNrYANmBDidBE/ONq6vtJ3+ei7sXwb+Iz05I5+IQV3yM6rvUDSFhk4EMBeLir2BXpXrR30w7g3n6orEpFza3EoLSP3e04pHuLbYgyVCI27goA+whx/H5wTKIwSBlU2gXfS8fJRzKE8tXfj/H5xaKo/tJYd1/qriYJKqIjXvDX1WVu+IHWLbAmjCBqylcv5oXnKQnmR3Cscs+0dUv0BDnrRPGp9yCB9eweQTMy085fc6qym/ye5QqRbLgKf6h157hOp0B7qq16zotYkHzlBzS+2CXmZNTfRBgPN3a4FrPCdhBi9BYO7OVhRlgxmpqHihrKsgKqKW6Ks/shGFdUpzSYiiFjACHulsh8ittT1x2e3bSgGIk9l9ZLcqcjZIkkCglRyKV25QzO3nG0J2XyUwpBw== 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: q+HkumrnFXlk/b8ciXvAACCli/90rfZCtSajkmw79ZzeW14uYPFTMY5121dMum7BpOhML1ybK+6uUpkvXrUZq2IQ2ARVCTf3IMJd+dVEZmFNXDI6D1RyxTKAlqNhoeHD+F2KYNTau6PHr/slN2KM73LbKzalrTmwoHbJ0sIhfuvq0bMY59gwokt9S+qXVH/mg9ViyB4riYbeWigSCVgx/ic6Azvw81RAE1m2eFXpfqoSSI10WI6n+O3uQ24iBcr7GktruuYG5rNorxm8jUI2BNZg8Y8P/tTmoiZb5b08pwlq7TM2fW3gzpb2aD4fZIoTPs6m6Q6jbuyE4uuHFAMSIF2KN3Y+U64El/pV7S6I0i45qsoAgp3FRZ4EZ9+Fu/RJxU2uuD/p2oEZZhen79X9atuINqgWoCQfDtO4isnTTU36suyylLis76oKl+gZDP8ArAyjrHouD/QZlT+ePE4ZaFMzkzQFhRs4wt2sqAszpp1dPeRRNqSA/WSKd+tG14AGukQVEXZ8XcEJ89l1jZui6qGz1puqSHI+BUGL15UFEo5SFd/Wykpn0Bs+8WiXDXiCKtcaz002P54e6do1qP9vJz2LMeTl62S+/oa/S78DVeE4nC9kOPWTwt9gI4RQE3lG2J5PiCTiQV2ZBj/6UgMeNzBGyxIB6nxUMaJrm7thlj5srXw4h7R8DS5xrCx11Nzhkisy9/GDAgPST2qPTddtrgWLH45wlgDn7bKcPvpBqE7ef3sCO0nbW40/I1ShQxj70Ifi7QaRUS6Mlz1Z8nLkaaHN/Ciiv/Nq7fucMylTqV7wm9on8uzZMHdWLuf25zNhmM6UCM3HXnzxmgfmTdUblM8lKfPhbRM33ZFIspSX7FmVqyb8BFLZRsaFkHTA6z6GsczX3Yp9UcEp78TsqgwRW7NLANzFrLvcEiHESqRDriwINYqpIimCYjJpWX/lT/Z96FjjVWni6RAq7q3sXgFsNR+4T6L6+SxPGRcP1x6qfdvIoz74v/G/44nZwMH2iPBHbkZSbHLHgzOpxrJsPIskGhQYeylZOl26ZG3BJzuOBMXv/aTrPT+7hdYgC2B4MsGFPfqnwFJGrkDNgorL/bNsfLihuBvkiolGbbeZuNrJCBhWnwsotujAzQN9XH9kOiHYYQwSTfesXqxxNSKjTdmOJM8Pz2egvdJmS/nW6g3ALKWcGCLHRfIkDIru3kKoggAO625g4xrN1jw9xFgA3MUt9GaV6tSH4ZEF4dyRKnXj3e2RlrnHWmtK3qhPGqdHcqVJtycNgdCCQqOYhnEp4XNGoRslSZsUzSy5+ZvJgafWMFTdbiAvyGjop/8WUaa1BBq+TMdrJNhtzKZWJ9oMiu10SPklME5sYf8RepFTEJz0qDtyWKxSDGrHj52F2D7Bnail3LaOOKg6s7AIKspaaifI5dfe8+CW3mzA7D7+XLungzDgi3ckjrc1kF5k6OSRkfgrl8S37CpNdvjWMBq1CKauaSVEdvVOCy2flOfvW6ytPS+NkFMXlT6ePlQlWX1TLjofrrEvdPdmPX6Lbg80JRtyFrETFHBuaO4c5bxwkKO375zQsINrHZIBYI0zj+4IH6PG X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cbe387d-67fb-4c02-16f3-08db5df6b0db 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:11.5288 (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: wsfZ+Ds89PTNx6v6eETJUFoEZFeHn0leJeflf0ni5WDou9K3386hqZeicUFMPB7Kn+oW6vK/j1G8JCRXiCdiFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Move the common part of IRQ handler from fsl-edma-main.c and mcf-edma-main.c to fsl-edma-common.c. This eliminates redundant code, as the both files contains mostly identical code. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 26 ++++++++++++++++++++++++++ drivers/dma/fsl-edma-common.h | 7 +++++++ drivers/dma/fsl-edma-main.c | 30 ++---------------------------- drivers/dma/mcf-edma-main.c | 30 ++---------------------------- 4 files changed, 37 insertions(+), 56 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index e5c7497c1ff3..839471c42758 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -42,6 +42,32 @@ #define EDMA_TCD 0x1000 +void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan) +{ + spin_lock(&fsl_chan->vchan.lock); + + if (!fsl_chan->edesc) { + /* terminate_all called before */ + spin_unlock(&fsl_chan->vchan.lock); + return; + } + + if (!fsl_chan->edesc->iscyclic) { + list_del(&fsl_chan->edesc->vdesc.node); + vchan_cookie_complete(&fsl_chan->edesc->vdesc); + fsl_chan->edesc = NULL; + fsl_chan->status = DMA_COMPLETE; + fsl_chan->idle = true; + } else { + vchan_cyclic_callback(&fsl_chan->edesc->vdesc); + } + + if (!fsl_chan->edesc) + fsl_edma_xfer_desc(fsl_chan); + + spin_unlock(&fsl_chan->vchan.lock); +} + static void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) { struct edma_regs *regs = &fsl_chan->edma->regs; diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 2f13e687a721..71e19e20f1cb 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -223,6 +223,13 @@ static inline struct fsl_edma_desc *to_fsl_edma_desc(struct virt_dma_desc *vd) return container_of(vd, struct fsl_edma_desc, vdesc); } +static inline void fsl_edma_err_chan_handler(struct fsl_edma_chan *fsl_chan) +{ + fsl_chan->status = DMA_ERROR; + fsl_chan->idle = true; +} + +void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan); void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan); void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, unsigned int slot, bool enable); diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 31531b8bde78..9c0b6fb4cb8f 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -33,7 +33,6 @@ static irqreturn_t fsl_edma_tx_handler(int irq, void *dev_id) struct fsl_edma_engine *fsl_edma = dev_id; unsigned int intr, ch; struct edma_regs *regs = &fsl_edma->regs; - struct fsl_edma_chan *fsl_chan; intr = edma_readl(fsl_edma, regs->intl); if (!intr) @@ -42,31 +41,7 @@ static irqreturn_t fsl_edma_tx_handler(int irq, void *dev_id) for (ch = 0; ch < fsl_edma->n_chans; ch++) { if (intr & (0x1 << ch)) { edma_writeb(fsl_edma, EDMA_CINT_CINT(ch), regs->cint); - - fsl_chan = &fsl_edma->chans[ch]; - - spin_lock(&fsl_chan->vchan.lock); - - if (!fsl_chan->edesc) { - /* terminate_all called before */ - spin_unlock(&fsl_chan->vchan.lock); - continue; - } - - if (!fsl_chan->edesc->iscyclic) { - list_del(&fsl_chan->edesc->vdesc.node); - vchan_cookie_complete(&fsl_chan->edesc->vdesc); - fsl_chan->edesc = NULL; - fsl_chan->status = DMA_COMPLETE; - fsl_chan->idle = true; - } else { - vchan_cyclic_callback(&fsl_chan->edesc->vdesc); - } - - if (!fsl_chan->edesc) - fsl_edma_xfer_desc(fsl_chan); - - spin_unlock(&fsl_chan->vchan.lock); + fsl_edma_tx_chan_handler(&fsl_edma->chans[ch]); } } return IRQ_HANDLED; @@ -86,8 +61,7 @@ static irqreturn_t fsl_edma_err_handler(int irq, void *dev_id) if (err & (0x1 << ch)) { fsl_edma_disable_request(&fsl_edma->chans[ch]); edma_writeb(fsl_edma, EDMA_CERR_CERR(ch), regs->cerr); - fsl_edma->chans[ch].status = DMA_ERROR; - fsl_edma->chans[ch].idle = true; + fsl_edma_err_chan_handler(&fsl_edma->chans[ch]); } } return IRQ_HANDLED; diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c index ebd8733f72ad..af1b0e8a3021 100644 --- a/drivers/dma/mcf-edma-main.c +++ b/drivers/dma/mcf-edma-main.c @@ -19,7 +19,6 @@ static irqreturn_t mcf_edma_tx_handler(int irq, void *dev_id) struct fsl_edma_engine *mcf_edma = dev_id; struct edma_regs *regs = &mcf_edma->regs; unsigned int ch; - struct fsl_edma_chan *mcf_chan; u64 intmap; intmap = ioread32(regs->inth); @@ -31,31 +30,7 @@ static irqreturn_t mcf_edma_tx_handler(int irq, void *dev_id) for (ch = 0; ch < mcf_edma->n_chans; ch++) { if (intmap & BIT(ch)) { iowrite8(EDMA_MASK_CH(ch), regs->cint); - - mcf_chan = &mcf_edma->chans[ch]; - - spin_lock(&mcf_chan->vchan.lock); - - if (!mcf_chan->edesc) { - /* terminate_all called before */ - spin_unlock(&mcf_chan->vchan.lock); - continue; - } - - if (!mcf_chan->edesc->iscyclic) { - list_del(&mcf_chan->edesc->vdesc.node); - vchan_cookie_complete(&mcf_chan->edesc->vdesc); - mcf_chan->edesc = NULL; - mcf_chan->status = DMA_COMPLETE; - mcf_chan->idle = true; - } else { - vchan_cyclic_callback(&mcf_chan->edesc->vdesc); - } - - if (!mcf_chan->edesc) - fsl_edma_xfer_desc(mcf_chan); - - spin_unlock(&mcf_chan->vchan.lock); + fsl_edma_tx_chan_handler(&mcf_edma->chans[ch]); } } @@ -76,8 +51,7 @@ static irqreturn_t mcf_edma_err_handler(int irq, void *dev_id) if (err & BIT(ch)) { fsl_edma_disable_request(&mcf_edma->chans[ch]); iowrite8(EDMA_CERR_CERR(ch), regs->cerr); - mcf_edma->chans[ch].status = DMA_ERROR; - mcf_edma->chans[ch].idle = true; + fsl_edma_err_chan_handler(&mcf_edma->chans[ch]); } } 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: 13256996 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 536BCC7EE33 for ; Fri, 26 May 2023 14:39:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243958AbjEZOjD (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+Fzn4WOmi96CDYkNLRINmg5qJEUSW7VFE2cMkjJ2lhz2mbTcZ/zNR0IfHsm0R0zvQsHlMQpbVw/Rt6PngZgmmlbUKmueiONDjhim8GGSzNlsyu+t35ZvKZjzbbPsP3CF3VMU/1nP5YpOHpDgjCqKOoYlCV/E4sm1OwBkYpka65YwylTKnpzzmUdGw3iAW4o7BqY4PRMZf24NKPl+ck0MjIbYPkiTyv5L5TSe8hihlIOvsn1+PKrYaw7TrndWl12TabljjZMFBd9DWH+x/MBlSzYbPcbLp0umiYYCQG6QclDmXc2ep0DWewQDx6mmEmV/pWcaGLxjaIGaCI1E1/LZ9gv2JUmV5vwbiYHgIUALQR0pFQUku6yUzIntITOb7E3F8DRp6i/lFmD4v7XI81Y5vXiGUC3FfFz8k2Cq/EuQoiWTbEhDF9/DIzcTuBmRsRZzcAcUhFWd82IfTLJVF8o2LrLdYMRrgQa+yvYXd/N/P+/D2S1rymmRAl4HLopYe2lhNY+O5H8q2EL9UB/RWqqoyrICfVSh0Tmu7FgK1hAjOW/ppnc73TAtiVbfgsFopy2rmRHFyWIOJLIluI0LixmXoY8C8WI+hlcUW4clFiLTav5E40ud9fKOfRP9WozU1ccDoNh4FIpa8SWyMTSIobYGkFK21juWrdDBi9NZFopKyWc93xzikoJCcrZDEzc9upBCgQRB9v3ImByggX5i7XcK/uw2s5kQjrqFZdCWj6tEYJZAkVC3/uEYoOUyskaRoDhnUYu1aPb1cZ9HA/t0GTUnUyesNBtDsCa+FooysmkXYLifN6xFZ9/Q2S5AShemrjoIExAkukU/K0+kMBNYbmDSqtEcLYZ2j+dAU9+ECUa7Ttq7l3cSepLEDY18Qu2mjkxzTWltJlsmUUkUiaGwYpzsMgREK4kmTrz/YyP+QSjQpVx+oyAAMQbNxoxR4hsi/dqfh2vffkuJEhvGEW/PO25StH3BePnUyPV0A9kX8avA+NYM+o3TsKT9dft/ROIfLaDcMzHxO9YdFzqZtT3IDVH/Rx5Q5p5WVuVCglObBgKQxpagN0l1vGaFCbCcU5i9TXyTaV0+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: dmaengine@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:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13256997 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 959E6C77B7A for ; Fri, 26 May 2023 14:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243949AbjEZOjT (ORCPT ); Fri, 26 May 2023 10:39:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237223AbjEZOjH (ORCPT ); Fri, 26 May 2023 10:39:07 -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 20835E71; Fri, 26 May 2023 07:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I9pUO3IzRlVqd/Y07PZkPnqoLH6hxmMH+SZEf0sdXp19b9dOnzQjHUD/WzsBLu3zSPQqfslW2iOSkvrzkz8x+36gjAvwuuo5fz/nxHAnDimV1j7zWAOzyJrXtr2poUugmLoEVhfYV5fx6RYrGAjNHD6+qYx61Nkd9v+cGgx2HhihlBx7Pdu36QAdRLdi/SVXmpYFzB7Z9GXKUunEUDdCOjXFMTdIq+PNRrpBQXyrv4CtPAHYVlQPR4EEyV5lGpD02Noo42TOxHoTOj7cUSoh/IRXTEXfyoym/Cn9TWDtExHly6Tq21hP1ymJKBirbZRR+i6Bt1fJSHQsoUpKAiA5/g== 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=v3P8AoOS+eHwcaqc5bUfUnf+Uxj1PFHD3YCKbldbyag=; b=nXtVWVFlHxROVB47FLRdImgsnI2E4LmP2W7wSv1K8izDeFZVKSNPCibjlluhxmt/X3VgOZB9DNTLNh8ge1CzdwzN8yxy3/bl1Jr0dhBlrMa2PsxU+VfVhZXLgDRvXAc5N0up5ZMSufBZT8oG+i2PVApHwb0HLAh8h32CwU5F/4uXBlSyeBUaBzc6U3VHVGZbU5R/rqujtClxl8VosP2PGbvR8tdGduxyWQlBF6f7Rbm0xFN6kB/u/49Akeg1mbJUf3MstDHbsDnembbJsN/amlfgXJ4d0u6ZzWf6qlL9FFg4CvpYmmtEkH7JDrSPulbv1fMpzWuFlqL8oIoqUPeskA== 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=v3P8AoOS+eHwcaqc5bUfUnf+Uxj1PFHD3YCKbldbyag=; b=KPqa0LN6cN59ZE7OSFnTjDHNU2yH9vxL88ovbS94LMSO1O+52iekMi2OvN7m//Ok3hYT0LNFABWJzN7d1YLIkN9u40aFuj1F8PvPMD3Q/pS565xVXhIouWGQE4nXqxa+f0T5jr0d25rKCwBPTcrRSRHvVhXg4a1ys9WDpy/qBX4= 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:17 +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:17 +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 07/12] dmaengine: fsl-edma: refactor using devm_clk_get_enabled Date: Fri, 26 May 2023 10:36:34 -0400 Message-Id: <20230526143639.1037099-8-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: 4a2ba342-7aaf-4b99-6a06-08db5df6b429 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FiADvj2oFRg7twHp1NKay5OKCXKteQOBlqAZtwMA2/XnI05raERxG1ci7VdL8xgfvt9yfDg9wDb+deYTCPsZWMzho/CmdgrUvvqiM/8mAeNKp8qxQG/ZhhcOP7bnjndhXUS+fkX9wuz88U0Vn6LS5luh8+HHbmT0OOgrZTvwgI1m+gc9gEL+JdtxogRjiv4Vw9LKNpqroJL01lujdn+k9+UlquCWVxgshf5JkJuVY8p1SunWyP0EIKxreFAFJJoFy3Qh+yBh5DGMGCdnWe1Pl4PX1ybK9VJ9/nEONpU0Kucy/jT5Ofo0rYFiLEE0NVXMf1KvfjycQATHIaP5B87MALvgj9GGfUjPNUNJcWbh3FMrThN8sYgHQkClgGzBbLDJfBA/DoE2DM5Q68ZCfP2lJ5SQocw75jocXAlSk0MsUwGZyAy2Bbw/r8FGZ0gp2quJxGzNiKSPk8C+JxNlBZmrL+OMkHLjuvyp+w0CjQg5hZOppE6C/nIJiwgbCCr1lYULo2Z+n1KQduzhtxBWd0m2pctU/8+lfilALMjcNash5Aki2IwtDec4DgxoEwR2W5tLU7yGzq5yIrvw9bQXTcnUYZVSVRB0uA71THrLY5AVgZoWM/J0ToGt1aQsvdSLKcENXU8t7BMwhp8n3GqlHNo7+Q== 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: ZMmRwxSjuX5IiTZiKgbWtLRXC8dy2Z2uvBjq2yrGjhT3zdrXyl51S4zT120t0gsdY6fxctclyxRsCfc91RX3ZIgjA2CQH31x+W2S8ekfHvuq5fnxSir4macVHCE1lnZeVUd5I0gwY53R9uR5aR6j6AvHExHoJlkcBBX4L/87xWYPXWvliMuf6N+if2gYfy3FNpaaO7adtiJOSe8I5sNuikHkzvYLg/sN7RPKfnEdjw3BG+lehYB5/pg+7U4iM5VRWqIEBrE5j3/W9H6DOyzqkAm6g/GCkEWeKL+8BWIGX/MhQvSqqewHmIaNeCBitOYL2sv7UcDjtAgo7nGun+jMnxWX6ToQNM6WWh3yP26NgRDmM0KvgkrzFrs6uo8orW/lIgnbB+ZVYAS31GewoxOdnlzcb0X0ScQ+AGM/Md++06Apxkke8Up0AG2snQrAGg5AhmZNNWjibKbPllVtKsU3bwMbPKirra//FmI+F55fQod7GTFs+hi+30idgqzEzlyzpHP/1GgfANNgdodO4CZjQzkJuSzZNN1NgYHeaaaDDb2SWBTAFUz2l7uqsZk6UyevmxsMYaIg/JkTDmdgFbSLK7T8vpw1epQ9PF4ODyBRLNBvYTOjcxCjnqBC1e7FPpptpmVR1PakftpPCEOfwYRs7xfCK7iiQaBvwKFC4hWyTcuiMH08fWFWmsGuXJFJNNF9oP9DRbMLjLJsPHXdtubiGpmDXML0PrHKQ6G2etj80+i6plVOiUQMK5keg/mpN8KIJ1euGn1Fdq9JxIjtS2ZGRilUmikHu1JlmWrlF+9GTY3HFytFmZEkvpZkHnanvjdDF3mE7fyelPPxjWQoCVmBpvBi8LxAGZ+Js0Je8Xrcp1uw/IuDFeQ/EPOyyon9do8CjUliaP2QqhwIpymquwFOd1ljfjWNtEIshJN+JHgqnbxYy0qtzDugEcIGtnxiBExlgZQdfmF1oaNne3AygLkbl0JzeFAjfZUKSXgtGKAOlHjC3eLaoYvpue3kGirhk4LjU9wRUq7sdAvaXaNVWFLkt1YUG8M4KMV7njPIbV3L05OS/nrNYvngA9AWf9BqLlU8McER9biAIwxTYIRuGtfb+eaPxShFQqXqUiv23vllgFF2YdVW9NFw0/EHN6lFfz6Yb/GJjW89Ga6dfWkrg4sWQlTY8+2WcOIo6T+Lz05IjAuHK1oLd4tNGfTrYdhE94C6hyeYD0je+q9qWZfIzeRYUvbgFUPb6iZhQNFfNYRMlx2+S+yU/TQQNdw8JxK62BqD4YPpsjCZawZ9l7u/23Tjfzbj9NywNQtTEQ8MvGF+DPGe8XRDPPKvq1olpbgnhAlw4sZwcjwD8cQLFchOlBtLwdpageo9UaVcdCPOO3oXDz7g+YgFuYtN3WShqmWTO6OWIPvwru8Dfg+hIqZSio6G+s5QKvLdriyYSXM2Piz8SYlMnx/6uU2QEN4MkjpbEDVsh7V/fqaLJbZ/cu4yXgC/YQG9gD7rEXJDeq6ZswHY1FpVnZAPUGAIOJmZNXUcsNOEKnVlU5NsRYJ6nBsknniAah81BK/v/MWflHpV5ZcTrt1yic8mofvoEgG7YEUemPE1 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a2ba342-7aaf-4b99-6a06-08db5df6b429 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:17.0848 (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: 32fUe0AS/YOdYs99JpZhU/Xn23SxiudxTSn+C3XZz19+D4f9igkK21wYe+UHZzJ9oAUjI6DZDOhcjP+CHnOY1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Use devm_clk_get_enabled in probe code to reduce error checks, thereby enhancing readability Signed-off-by: Frank Li --- drivers/dma/fsl-edma-main.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 9c0b6fb4cb8f..6126717fc87e 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -268,17 +268,11 @@ static int fsl_edma_probe(struct platform_device *pdev) regs = &fsl_edma->regs; if (drvdata->flags & FSL_EDMA_DRV_HAS_DMACLK) { - fsl_edma->dmaclk = devm_clk_get(&pdev->dev, "dma"); + fsl_edma->dmaclk = devm_clk_get_enabled(&pdev->dev, "dma"); if (IS_ERR(fsl_edma->dmaclk)) { dev_err(&pdev->dev, "Missing DMA block clock.\n"); return PTR_ERR(fsl_edma->dmaclk); } - - ret = clk_prepare_enable(fsl_edma->dmaclk); - if (ret) { - dev_err(&pdev->dev, "DMA clk block failed.\n"); - return ret; - } } for (i = 0; i < fsl_edma->drvdata->dmamuxs; i++) { @@ -293,19 +287,12 @@ static int fsl_edma_probe(struct platform_device *pdev) } sprintf(clkname, "dmamux%d", i); - fsl_edma->muxclk[i] = devm_clk_get(&pdev->dev, clkname); + fsl_edma->muxclk[i] = devm_clk_get_enabled(&pdev->dev, clkname); if (IS_ERR(fsl_edma->muxclk[i])) { dev_err(&pdev->dev, "Missing DMAMUX block clock.\n"); /* on error: disable all previously enabled clks */ - fsl_disable_clocks(fsl_edma, i); return PTR_ERR(fsl_edma->muxclk[i]); } - - ret = clk_prepare_enable(fsl_edma->muxclk[i]); - if (ret) - /* on error: disable all previously enabled clks */ - fsl_disable_clocks(fsl_edma, i); - } fsl_edma->big_endian = of_property_read_bool(np, "big-endian"); @@ -366,7 +353,6 @@ static int fsl_edma_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "Can't register Freescale eDMA engine. (%d)\n", ret); - fsl_disable_clocks(fsl_edma, fsl_edma->drvdata->dmamuxs); return ret; } @@ -375,7 +361,6 @@ static int fsl_edma_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Can't register Freescale eDMA of_dma. (%d)\n", ret); dma_async_device_unregister(&fsl_edma->dma_dev); - fsl_disable_clocks(fsl_edma, fsl_edma->drvdata->dmamuxs); return ret; } 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: 13256998 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 883B3C77B7A for ; Fri, 26 May 2023 14:39:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243922AbjEZOj1 (ORCPT ); Fri, 26 May 2023 10:39:27 -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: dmaengine@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:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13256999 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 8F695C7EE23 for ; Fri, 26 May 2023 14:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243983AbjEZOj3 (ORCPT ); Fri, 26 May 2023 10:39:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243984AbjEZOjW (ORCPT ); Fri, 26 May 2023 10:39:22 -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 EEDA8E78; Fri, 26 May 2023 07:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kxH5tvGvN9uF4P8LUKiGLBwhX+wnO6GZLPlHVGTuYUNQbP2A4kfP0s0sFHN3URIf8Jumh8sp4EbQN7Vi3B8qnJTOYyuQfN0qnHR11vTBo/V2yMVYx1HZDOPRVXY/pWQr+hpjnrDKKcEvkf9Rc7PdtL3sRov3ECZERroUQ7qViXxfpv3dMeyJIv/X3Qj9Y676F6zD+b66ISnF1RjgvUmWQ/8SMjmM4ma8Qapvv+uKB1SQv5OcG61OfycgI6XNbcJDgbZOU6EKRryt5DgO5usblF8l3n81oTpQHa61yR7xcVhxHati3fm2HF4JajvSx7hH8hAsY5j3IJumaKhqkEsdQQ== 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=ISKgrdPrxzKwoDu3CGTHqw8SLWtu6pWcUHBCYREGJL4=; b=NJrfVcPjJv+NOoVTc+jLLh+oE4DSND5VapAlYDzOW7JJ6y3P+zDEtUz7/nHuhUf8qAkIjUS+JkpopoYeNRRFE5Jl3Wb9SKxPaC2QEeyJFyVMZ+6V70vSgo/GebIzGUZ2KBh6c0IzmWwxHzj3vgeH7YLAkrarQcFZJLvy8ut6hzv2QqvPYuU12K3DooO756YCmyBy4pFUE4fTWtZsG4l8xmFEFO9z285YDrgUzMgYoqmtv2C6up5Iw1wEsyA9gbIGgIBT7jhd6XQFlI99iugiFJtThh9iyNoN8kCEvM34BB2RTtPkDQQNE9HgNKzYc9z4IhHMGoUid+iqeVP2/g7VkQ== 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=ISKgrdPrxzKwoDu3CGTHqw8SLWtu6pWcUHBCYREGJL4=; b=VT/lM2btaU9hnfHd3QKXp3rQ//smnrXhcs7I8WUNrO+UwNbSAvJkb76z7yRDtJbiXo+iC8gPslr+hFo9/wsX9MDY/tlatFKTcXgy/ZuYcJW2FR+Mb+vZKf1wu+iwlYJOjzIRpft6CH2P9kVwBquhhVMB5nODo1SL1bL7oKkp0gg= 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:23 +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:22 +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 09/12] dmaengine: fsl-edma: refactor chan_name setup and safety Date: Fri, 26 May 2023 10:36:36 -0400 Message-Id: <20230526143639.1037099-10-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: eab5f83a-ed9c-48d6-1d7c-08db5df6b799 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ALBcz71hxqvtpLqcPsdiqubOWVAD2kN1f2CDvM6tWVEzyjzvwHpPGaezLYTX1sXRd5MB56x311KoCJrwAJ15NFXlOxp3Ugcq7gesmPehqLh+tlHgGOf7p9Omii8DX1d036tk7gGqvBUqrdJS4HLToO1oGO8rYdcxBc+YZQmpc/RGesh6XQsX5+EW7B8atmluelLLYCXw2qRbbHr9hlAuOIyoj9aPl5OB7nHtMtKZGnlwGwGqFJ0HQESZ5VXH9xvd3AciTWDfvNHCpYGXRliKL+io5uZCHYO+gflET/tT0ktpw6HzHgNO3mhqCgYMlFD5xCw8PoV4Jz+HyNF8g5wLFwmW5hofYoPtqByHjNpjsMkfmU0TQ4NCo4lOgWdLJEGXebC11x3EgGtaEtNog6IRB97cCnl543c+Jfr7/G8A1rIBAs059vrJar980Ojskxb+0JOAU3KwQcxpmaiq9yGnYExNhBeO8pgUZViO34SxyjruxWFAUI7td23zeI+087pRHI/SQM89kQx36ZuY9uA3YhxNEJFzZeR/sHTYM+kU0r3LrKzuyz/p+qfpUKDn1C9U8Fb4RT2XMztz/5baw4HVsbYI47BQ7CT2djfsdW1+uwteLwHaXfbqalVyk17co6Fpz2r7galT7t/5bx1hAn5FGw== 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: 8LKlUxHf8vz+AHO9a6NDb/ERpCUOKrEXQqbkoMVrrhdNvmrs3vYbODqp0SbgQNf+5ouxFzaXIRlD9C6R0LDyWmO9+gj+/z+nAWTSCzgvupbz0rHFN9umy8mGTeKRDjdc1X56bwFO4Bk91F/sWPxLjnBUUVL5SuXPbXfQCfdRXi5DtQXq+l7WXIczKFdMi8VU16ouVCJHY5m3BzOIQ+fOAN8BHm4scefjfKYPnbUFTzgZlu5Q41bttWheb9GAbNKzkaRqIbjbbR5H4QSPOKDNnttftWgA0AXo9LtZ/ClsKqhfcX3SeQg5667YSb3d4is7wdnXeAnBs9GwojfBbZXKAxMRYFCZ8ylU5F1xlxz6aMztoFPOtbC8xG/LgFodBIdySza8DDzkoNLlfFcaDJfiAEluLy/kW58byztwWkXedVvTHNYd1wgcPEVhOgGNQVqLccUI3fBq76Hl7tLsEBEaG71HW4CZ9G9oe1S7R+D90ieIXKR3UkestkFO3Pmpw+M88irwhiYVVFhrFQqcSnpjrB6mKr2cLsP7DBM20fnXYIE0shfIOOxQU4/di2ar/Tj8NpCCKHnkcwMnCHZvxqHbU10X9tmPAa9MwEGE1LqdrDOAwMYbtfS8LEUYVzFUJt3NMbqJozqZvqIjTsoZc8UHraZHXX8kyBcrDzSZ3q9oRKu8MgvSKNYAJ5Rza0Ug3THjgKvkcfpDwrkTcYN6QDewB5gCS16t7zyus8/L0hOf5DvAhbaGmlapQXOPGFOGE40LZPAvFQZd5Is71zSYrAK+PMsWvX3HYH2+xkztc4eQC7VAJEXDdgSjaRvginJeXi2/UeulA7XspAo/79VFMW4kKMKGzpk7D/y0PaDxYe5Ag+1luAfxvwAPcO+hOCKjZ0qNS8imJthqZ+HuTG6cacltDISZMBGYlPYfgKGLES4TqNRmsVdhNBAlx8M63obqgmSg8WusttLYqmiKkKxBz+AP1ZVkFj6TiW1aMOkD7DYgcQuxOw3Wq/3YNZELA3nGG6GECGQVOc7q+Vr7VBUjLYKDevAjjh0pcM0i1gQrbaux2cBI5Uxpg8ktHzbtEIZj5H/IUMqFxqXX/16U1ItjG19I/zdPReHB4DOqXCiu5wjZ+0RuZh2OqaDiKZwWVq+thT22xHtswNLhzW4jIUAY+zpfcXl1pkZiojHSaJyNwG4GXwda4OkD6rh1+FdL0qRDiJnLwVTkkEG2uSrVYtxu9eb+phkkKbEgsL0z6HxKseVZy6iwPM8yWIOCHYKhP4BxddL8O8dJkvXg47sflA1C35J/1iJ3yj1uzHi+ph/MMLjEjxm1KoNu1vE+lxGs16exS1iGoxWaIQS6KKBHILVnsCqvNrCgbPUN0/Fwp2BFbmPJe3sF1cRwPICDKr6zj55H32DvcclUFyv3izeLVWTshc/4ss+FiyeD2SxRxkIlle92dAy11KB7ZOmpRXAC98XaPoMSktoG1pf12acb6ZBIny0ISL1meMJ5TxsmOFgvLKEDC5i4rKg0+m/Wiqw7eI2s+7LFvVHGJ+LQGVkxIX72AG6lGl9SUV68WWqyQH2otmn0eXC6uzaCfn6CBXKckfsiaQ/d X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eab5f83a-ed9c-48d6-1d7c-08db5df6b799 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:22.9076 (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: VSoGlHTaI8ptg1MRbzmfhdYgyEB0gLjGcW88zB8k9DKjNporKS2GLBX5T/BlTB32GY1Uw6zLs+aslMFU9iaGcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Relocated the setup of chan_name from setup_irq() to fsl_chan init. This change anticipates its future use in various locations. For increased safety, sprintf has been replaced with snprintf. In addition, The size of the fsl_chan->name[] array was expanded from 16 to 32. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.h | 2 +- drivers/dma/fsl-edma-main.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 3991956dbc11..39b5f903ba87 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -116,7 +116,7 @@ struct fsl_edma_chan { dma_addr_t dma_dev_addr; u32 dma_dev_size; enum dma_data_direction dma_dir; - char chan_name[16]; + char chan_name[32]; }; struct fsl_edma_desc { diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index cd734779f2eb..722ebecdc894 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -175,8 +175,6 @@ fsl_edma2_irq_init(struct platform_device *pdev, if (irq < 0) return -ENXIO; - sprintf(fsl_edma->chans[i].chan_name, "eDMA2-CH%02d", i); - /* The last IRQ is for eDMA err */ if (i == count - 1) ret = devm_request_irq(&pdev->dev, irq, @@ -305,6 +303,9 @@ static int fsl_edma_probe(struct platform_device *pdev) for (i = 0; i < fsl_edma->n_chans; i++) { struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i]; + snprintf(fsl_chan->chan_name, sizeof(fsl_chan->chan_name), "%s-CH%02d", + dev_name(&pdev->dev), i); + fsl_chan->edma = fsl_edma; fsl_chan->pm_state = RUNNING; fsl_chan->slave_id = 0; 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: 13257013 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 4DE48C7EE23 for ; Fri, 26 May 2023 14:39:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243957AbjEZOjn (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/GIKNQmeDkezKrk53sMRWxNiL9hYKgjnxGaBhkYPBhmK2e9PmpiDEELXwAhJggV9TNUAcpMQhTpzCbAAJRyw8oGPbKojfY9GqRcXOI87Dgxix4TU+C6sYNWIwXk0+cbcbw24TwyKLobDB9h02975RXmklhRxZpyqsYZor8d5Ld22aAOOWm6WAI8fgUfMvIq3Y+4UJcEr1MW/Xy2Gzd6OfOQ3Mmyz8ThiTRG5CDhMb9HxCMPMUGvkaG9mBiklJpxHF5nfUA72O2h76FogMWGqGxgaaynTdcjjaHwuQfbcbo6lWAPeu5NcVWB1sbGX/0GxWgZnPGASYXvUNrI9yW14AXLtPb+Yl03OP5Zpd0SyiY/l8NyeFBpz+lT+mm0ZAr6xDiyrI7e+nNcuB8yP9CZSWORT969ciGd2mvd5A7uhC93bK7xkxRvGQQx4Vt83l/864X/L/2jSuE43GOHyvlLoUCm6idTno7rD/W+rPw/iQKD25cuQrKTjQw1Q+3SSzabz771dum1NpYCTgKdvfaoSPWXs5UIjWz8Kxo097ZyfyuoooN0ubSfKMIBVO5No2v8WGMRHBpDnnJAek8HN0UqD609EKbJmhvEPEFdYftiJI70QQfYweUC6phCTbLXrmzWZ+e5X1FEYgH14e2mcFBWCkmDySy8xsJ0Or2HXo5dmCie57mdbVlEswTiVkx+d5hKdvLYnxCbc9e6aCOp+vDZLfbUQcHCAmsEe+oLpfXrtm2uYtj7293iI6/c3pA/Rfgnrzn+Pu2s/rWqyUjktwZEm4BxZu/B6wc1INO2UKSlJMLQ+RXoFkjkqdJ893wtbdjrzSjT2KabN2LxRPBymtvhicgNR5LxZLGDy9MuU2NredFTQoVG81yJ7vj5DECPE3HCAylrknwdl066vvadyijgQ5AWPGaZnON/vPrWK41HezYbrSuBSHTEqN0zJILH+IyIfDT+D6wJZZfEKpV2M++jU9mRakc7sLS/F92X3Mkq3iqgdpqJPjNotLGSKVEDqMBeylrHHbn8y/mIxuY+DpmZTwa9IqgoVq2fDI9YmVnBUS1PYIMUg9b4yHF4xVZC+nSKUe66NA5pIOG3aRGpF9UPl2zSKDM7+ceeGgg5VWbgB3AkvsvzL9Q8b0Odp/XhdiEecK4Fv4dhYm0tMb1NnIzv92p8JUNOJJwEkyQBXqIsNDvZcpLdsci1Fpv 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: dmaengine@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); From patchwork Fri May 26 14:36:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13257016 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 99B1BC77B7A for ; Fri, 26 May 2023 14:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244029AbjEZOkT (ORCPT ); Fri, 26 May 2023 10:40:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244028AbjEZOjy (ORCPT ); Fri, 26 May 2023 10:39:54 -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 B38C51BB; Fri, 26 May 2023 07:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hBsS3Uh0iAEKs191ktNi3dwkfkrpXmvWhvpD+HXaMYabYwwX4KgvWL1wueFXvyX5aUfqmcBWHDyFyDz6R4GlWTZkxroUqEse/apbrb8kllbPxRXu2xmrTRl+nGbPToae6OBsN5nvZ1u8Urue95mU4Z0prfDx/0J0ns1OTmlnZpGxU14BCPPjSh6c/uDH3yif0B9epA1rGQaPkryL8DQQuXCFW659zsfmmJOgC71JJGJXymd3HjXKk8GTcg+eXBmvP+DaKXnG4Zp2AxgWiix0UcspIuljgmAqNwrkmp1eH8i5AZICa+B33PRF6ZqsYz63MK/5SXr8Nht9o9KIAqns4Q== 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=WoyBP3o8tbGGMAFj8900HK96vampePzG8c9OuQqZf3A=; b=i+mULRnufFq+VEBgZOEO2q09nOUJ6FCq/y0d35IRCDGE80ziByXdkG2oNdXGlJxFhGex62o0EhHaWd5PbCxnwvEiyvq9cCksRknIYvOpcZSBJDCos4/We7TW6hzvLJAaTnlM01IKAI14V/bD7S5Pu18sKklDb5yYVrJPpczY7Dxqivz1GhYUXRaa4Neg41Qa+Tu8lTUQAppEr6uQwYelDhYKdj15qVtB34hpMrp6tnQOQAfPEGlntZ/djnsguKeZ9ytxMCInvUPqKYyH0BfK5m0GwI7J5aAiacDHUsu3oh5L0/557+HR5hoJC3Rz1gWeQX3HcJrqXT3QNHjJXpogyw== 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=WoyBP3o8tbGGMAFj8900HK96vampePzG8c9OuQqZf3A=; b=XqhD+h+rCRfUUHPqw/JMXIl41sWx5pPzqI8UG6a/p0aCtlrlt3SdJu7nniGHoCWGhfR3R4Tw1KfYsMOShMAjgXg3GiSuLgRf7DLiWnLUGo1C60uTfaDpVW2QDj8iAdVr3+OFSNygTXQoHwBqZjVBJ4Gprt8irj1+TIDD+xnGZVk= 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:29 +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:29 +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 11/12] dmaengine: fsl-edma: integrate v3 support Date: Fri, 26 May 2023 10:36:38 -0400 Message-Id: <20230526143639.1037099-12-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: 0fc936df-a9ba-4500-e345-08db5df6bb1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 45OstT9ODqSYB+LM35Xd1IHx3cj+D1IxiSZp15KsHZjDzH3YXDl2ia3bGAu4wslGEuyD9HDKhMS1Xs/ayWDRh71DHhiGf/8al96FDP4WsqUI3xY6ZiW0LsxKtKgpBidZu+bQr98bLnUX6GYGh4RgS6qjslcT7GEhG2zgD2IdKGPTtb6NYPOXfQUq/J7/u8VoYcCACBRCfaJr7LHHLJeAibLVXyF0sArSe7c7Vg+bD0ogbRhVpIUhGk9PuOP/oHMRgg7GGdoghl6F88ohYM0wYESqmJdPaMQtxCMwoACfSI+GnE13Tzf+HtmL7OCCpzTxgExiz5hGEk/eucuL8ZymMgsu7uhTfHMURJnqpYTvWYtq4KG7VJtGGUQTeB3vh3YqYsWD5pQjfj2Tg+jq03Qc0etjUlIcg6ZnQxPkou1ZiIUTx/pvJ3/Uw6EZOjvc9NPv2MrH8oHXhXQ8Q0WICNrztrhqjIJBsfFU/5aKTgZGQ08Va/Wluwf/ajCKRHY69Yq+kEHxGcGgJItjbqSwyyJZmx929TxSH051t6BGkkcJo0ePHqQbguGtAL4T/+V6tUT9rkoyRKbp1ClDgF4vMtJEu4S6Uyx0OCLjcu2PhtXHeP2voK7adHteKlsO7zzYm+9bw2o7tkdObLp6Cx4SQ4ebmw== 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)(30864003)(2906002)(83380400001)(6506007)(6512007)(1076003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aFLKY2j25mVgdplXsZEZzSB6oYiXiXsANvAfEWdjvSWcF/VlsxWF/4R+ng+A1iljt76wWjQCLJkdGPKLHp6T6HJ60wr5afOKvoaOWBT9I4ThFlW9f0yzjoNeXjvbfa9joh9p8boWLkjUp8cjbEP0170PRcTL8L9cPwYL2l3hwOc8MpbQFc+uU1wGy195nYdhbkvpYf7mOTyVMa5idTJ8Pnmg38HBl5sqxV9fIF7I69+ozs4YVkZnLRocrJvqM8X5ZBph+44BrQ+mQmJiaGg3fj/hurWi327iLbkikDVBrZ9C9MmFHfIiwtCGHpBc4PkvZGbrtijMr+y4Eg3+fgn2oS2FNPdgiNu+6+Rt05cP9mrEGsTzd1dANevqlvMwco0B3/gWziPUSuoMDex2pcuGUwTX9gnpx/Idu68qU4oovao6r4Vey4QT1/lqQgEvN+WBTai88fkdNqwRmINYmIqq14r3iQ5IY5zmaJS9q4hkJph9a/buT/0wbQsJBOP/04iQcm/DTtBNMFBSHZdQpUcwUWerrJZjc7HqcFJmGpifKDQIeL2qjewZPazwp31C/4gUK5KjPFqyY+NlXJG6f4f3yrH8NfVF0IHjiI5Mq1YbPtmNbBBhGR4S5hVImxvIHzIvMJT+a2MndbyB3fLqdNPwH8G1IDzU5moYDAaHup8vaGPoGyHUP6K96f4ZWXknsQ8WCHQd+u81MvIBRuR8c5bmJpfrUFEIx6h9N62hbtcwo3p8eZq1yJm0/6sy57XPfRlctMWOaozECWXWx3BkArgxb+brRk8hrB9CpBjfKOD89ZMKOk3iSaOFfpaBFLvsu4CAFXiLszYhCB2G00Qan2ppnb+qdTycCAMkj5meLoQlzepr9j3lLD+h05PriRjF0//q2Z0ceJKC7wTScVbFs97+g7+5bhsswDTTeNpquPaAjoE6OIXc/31Pluzc3+NkHDeGCHvm9SveZV8YM8UpJw+4VziQ4h5UaUILymXhwnzmZH9V/zuIX9NVqMrwftBfx4EJZ+qJSWRjHr0M4SmBRtSl+9QeZoiOqJx2ktns4JncYaoOSW0k0HzNw5fsuNAVVZHDLX2NAyRe6cv1uZEcORDhCv0o5YXDODWiIiC3eXOdM4W5/0+RerWpLg4JDsg/I9aEzxUJ86qNDLw0j0gA9Kfc+8gd2HXgw/B6JgZ4DxXQ0zfwaWYdiyPzY0GRuCESJBWrSvlkCifOA7bRiLBU0RCIlHycqdzDf9wRJOqiutyhfbB1VoEn5Xsrv6pjTCnfC2/hN9uISJ6VrrR0etGSJ3WPVfB1q4QeCmyAcoPl1hDlJ6ZuKplQG/Ww7CCVWsdi66dmQKMtvT9JSUYbtOq6J666pmgyFl/PJxzClT+X5Ap5fYdezBzKuG1gNPixycfZ9+k+NoJ6/DQ8BAu5LjpWv5iLfa+TspVyY0R7HuDZNh2N/VF3wqZiuMhPKCSGOJ/YDeRky+HDHHmI6EQm1w8IElQD1Y0U07Dw2arydpi1w4JDCWbZ8RCIeN53G1oUYxBcFL74A3ao7MsQp/MTp4p6Q6rIojjgkHasjRSpvXAeQclzEvcxzsqcDs8pOsfSWE9R0Xld X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fc936df-a9ba-4500-e345-08db5df6bb1b 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:28.9077 (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: fNrplkRr9ln7nLj6XM0LAedWAAlAT3nB4PQOtHi7icM5l4MZbNO8y9TJfznKuJXXNy3GWjmvAI2lCQSD8X5IbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Significant alterations have been made to the EDMA v3's register layout. Now, each channel possesses a separate address space, encapsulating all channel-related controls and statuses, including IRQs. There are changes in bit position definitions as well. However, the fundamental control flow remains analogous to the previous versions. EDMA v3 was utilized in imx8qm, imx93, and will be in forthcoming chips. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 162 +++++++++++++++++++--- drivers/dma/fsl-edma-common.h | 71 +++++++++- drivers/dma/fsl-edma-main.c | 252 ++++++++++++++++++++++++++++++++-- 3 files changed, 456 insertions(+), 29 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 186b5c41d07f..946db5733202 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include "fsl-edma-common.h" @@ -66,12 +68,48 @@ void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan) spin_unlock(&fsl_chan->vchan.lock); } +static void fsl_edma3_enable_request(struct fsl_edma_chan *fsl_chan) +{ + u32 val, flags; + + flags = fsl_edma_drvflags(fsl_chan); + val = edma_readl_chreg(fsl_chan, ch_sbr); + /* Remote/local swapped wrongly on iMX8 QM Audio edma */ + if (flags & FSL_EDMA_DRV_QUIRK_SWAPPED) { + if (!fsl_chan->is_rxchan) + val |= EDMA_V3_CH_SBR_RD; + else + val |= EDMA_V3_CH_SBR_WR; + } else { + if (fsl_chan->is_rxchan) + val |= EDMA_V3_CH_SBR_RD; + else + val |= EDMA_V3_CH_SBR_WR; + } + + if (fsl_chan->is_remote) + val &= ~(EDMA_V3_CH_SBR_RD | EDMA_V3_CH_SBR_WR); + + edma_writel_chreg(fsl_chan, val, ch_sbr); + + if ((flags & (FSL_EDMA_DRV_AXI | FSL_EDMA_DRV_HAS_CHMUX)) && + fsl_chan->srcid && !edma_readl_chreg(fsl_chan, ch_mux)) + edma_writel_chreg(fsl_chan, fsl_chan->srcid, ch_mux); + + val = edma_readl_chreg(fsl_chan, ch_csr); + val |= EDMA_V3_CH_CSR_ERQ; + edma_writel_chreg(fsl_chan, val, ch_csr); +} + static void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) { struct edma_regs *regs = &fsl_chan->edma->regs; u32 ch = fsl_chan->vchan.chan.chan_id; - if (fsl_chan->edma->drvdata->version == v1) { + if (fsl_edma_ver(fsl_chan) >= v3) + return fsl_edma3_enable_request(fsl_chan); + + if (fsl_edma_ver(fsl_chan) == v1) { edma_writeb(fsl_chan->edma, EDMA_SEEI_SEEI(ch), regs->seei); edma_writeb(fsl_chan->edma, ch, regs->serq); } else { @@ -83,12 +121,30 @@ static void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) } } +static void fsl_edma3_disable_request(struct fsl_edma_chan *fsl_chan) +{ + u32 val = edma_readl_chreg(fsl_chan, ch_csr); + u32 flags; + + flags = fsl_edma_drvflags(fsl_chan); + + if ((flags & (FSL_EDMA_DRV_AXI | FSL_EDMA_DRV_HAS_CHMUX)) && + fsl_chan->srcid) + edma_writel_chreg(fsl_chan, 0, ch_mux); + + val &= ~EDMA_V3_CH_CSR_ERQ; + edma_writel_chreg(fsl_chan, val, ch_csr); +} + void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan) { struct edma_regs *regs = &fsl_chan->edma->regs; u32 ch = fsl_chan->vchan.chan.chan_id; - if (fsl_chan->edma->drvdata->version == v1) { + if (fsl_edma_ver(fsl_chan) >= v3) + return fsl_edma3_disable_request(fsl_chan); + + if (fsl_edma_ver(fsl_chan) == v1) { edma_writeb(fsl_chan->edma, ch, regs->cerq); edma_writeb(fsl_chan->edma, EDMA_CEEI_CEEI(ch), regs->ceei); } else { @@ -186,6 +242,10 @@ int fsl_edma_terminate_all(struct dma_chan *chan) vchan_get_all_descriptors(&fsl_chan->vchan, &head); spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); vchan_dma_desc_free_list(&fsl_chan->vchan, &head); + + if (fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_HAS_PD) + pm_runtime_allow(fsl_chan->pd_dev); + return 0; } @@ -286,12 +346,16 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, enum dma_transfer_direction dir = edesc->dirn; dma_addr_t cur_addr, dma_addr; size_t len, size; + u32 nbytes = 0; int i; /* calculate the total size in this desc */ - for (len = i = 0; i < fsl_chan->edesc->n_tcds; i++) - len += le32_to_cpu(edesc->tcd[i].vtcd->nbytes) - * le16_to_cpu(edesc->tcd[i].vtcd->biter); + for (len = i = 0; i < fsl_chan->edesc->n_tcds; i++) { + nbytes = le32_to_cpu(edesc->tcd[i].vtcd->nbytes); + if (nbytes & (EDMA_V3_TCD_NBYTES_DMLOE | EDMA_V3_TCD_NBYTES_SMLOE)) + nbytes = EDMA_V3_TCD_NBYTES_MLOFF_NBYTES(nbytes); + len += nbytes * le16_to_cpu(edesc->tcd[i].vtcd->biter); + } if (!in_progress) return len; @@ -303,8 +367,12 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, /* figure out the finished and calculate the residue */ for (i = 0; i < fsl_chan->edesc->n_tcds; i++) { - size = le32_to_cpu(edesc->tcd[i].vtcd->nbytes) - * le16_to_cpu(edesc->tcd[i].vtcd->biter); + nbytes = le32_to_cpu(edesc->tcd[i].vtcd->nbytes); + if (nbytes & (EDMA_V3_TCD_NBYTES_DMLOE | EDMA_V3_TCD_NBYTES_SMLOE)) + nbytes = EDMA_V3_TCD_NBYTES_MLOFF_NBYTES(nbytes); + + size = nbytes * le16_to_cpu(edesc->tcd[i].vtcd->biter); + if (dir == DMA_MEM_TO_DEV) dma_addr = le32_to_cpu(edesc->tcd[i].vtcd->saddr); else @@ -389,13 +457,15 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, } static inline -void fsl_edma_fill_tcd(struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, +void fsl_edma_fill_tcd(struct fsl_edma_chan *fsl_chan, + struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, u16 attr, u16 soff, u32 nbytes, u32 slast, u16 citer, u16 biter, u16 doff, u32 dlast_sga, bool major_int, bool disable_req, bool enable_sg) { + struct dma_slave_config *cfg = &fsl_chan->cfg; u16 csr = 0; - + u32 burst; /* * eDMA hardware SGs require the TCDs to be stored in little * endian format irrespective of the register endian model. @@ -409,6 +479,21 @@ void fsl_edma_fill_tcd(struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, tcd->soff = cpu_to_le16(soff); + if (fsl_chan->is_multi_fifo) { + /* set mloff to support multiple fifo */ + burst = cfg->direction == DMA_DEV_TO_MEM ? + cfg->src_addr_width : cfg->dst_addr_width; + nbytes |= EDMA_V3_TCD_NBYTES_MLOFF(-(burst * 4)); + /* enable DMLOE/SMLOE */ + if (cfg->direction == DMA_MEM_TO_DEV) { + nbytes |= EDMA_V3_TCD_NBYTES_DMLOE; + nbytes &= ~EDMA_V3_TCD_NBYTES_SMLOE; + } else { + nbytes |= EDMA_V3_TCD_NBYTES_SMLOE; + nbytes &= ~EDMA_V3_TCD_NBYTES_DMLOE; + } + } + tcd->nbytes = cpu_to_le32(nbytes); tcd->slast = cpu_to_le32(slast); @@ -427,6 +512,12 @@ void fsl_edma_fill_tcd(struct fsl_edma_hw_tcd *tcd, u32 src, u32 dst, if (enable_sg) csr |= EDMA_TCD_CSR_E_SG; + if (fsl_chan->is_rxchan) + csr |= EDMA_TCD_CSR_ACTIVE; + + if (fsl_chan->is_sw) + csr |= EDMA_TCD_CSR_START; + tcd->csr = cpu_to_le16(csr); } @@ -466,6 +557,7 @@ struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan); struct fsl_edma_desc *fsl_desc; dma_addr_t dma_buf_next; + bool major_int = true; int sg_len, i; u32 src_addr, dst_addr, last_sg, nbytes; u16 soff, doff, iter; @@ -509,17 +601,23 @@ struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( src_addr = dma_buf_next; dst_addr = fsl_chan->dma_dev_addr; soff = fsl_chan->cfg.dst_addr_width; - doff = 0; - } else { + doff = fsl_chan->is_multi_fifo ? 4 : 0; + } else if (direction == DMA_DEV_TO_MEM) { src_addr = fsl_chan->dma_dev_addr; dst_addr = dma_buf_next; - soff = 0; + soff = fsl_chan->is_multi_fifo ? 4 : 0; doff = fsl_chan->cfg.src_addr_width; + } else { + /* DMA_DEV_TO_DEV */ + src_addr = fsl_chan->cfg.src_addr; + dst_addr = fsl_chan->cfg.dst_addr; + soff = doff = 0; + major_int = false; } - fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, dst_addr, + fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[i].vtcd, src_addr, dst_addr, fsl_chan->attr, soff, nbytes, 0, iter, - iter, doff, last_sg, true, false, true); + iter, doff, last_sg, major_int, false, true); dma_buf_next += period_len; } @@ -568,23 +666,51 @@ struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg( dst_addr = fsl_chan->dma_dev_addr; soff = fsl_chan->cfg.dst_addr_width; doff = 0; - } else { + } else if (direction == DMA_DEV_TO_MEM) { src_addr = fsl_chan->dma_dev_addr; dst_addr = sg_dma_address(sg); soff = 0; doff = fsl_chan->cfg.src_addr_width; + } else { + /* DMA_DEV_TO_DEV */ + src_addr = fsl_chan->cfg.src_addr; + dst_addr = fsl_chan->cfg.dst_addr; + soff = 0; + doff = 0; } + /* + * Choose the suitable burst length if sg_dma_len is not + * multiple of burst length so that the whole transfer length is + * multiple of minor loop(burst length). + */ + if (sg_dma_len(sg) % nbytes) { + u32 width = (direction == DMA_DEV_TO_MEM) ? doff : soff; + u32 burst = (direction == DMA_DEV_TO_MEM) ? + fsl_chan->cfg.src_maxburst : + fsl_chan->cfg.dst_maxburst; + int j; + + for (j = burst; j > 1; j--) { + if (!(sg_dma_len(sg) % (j * width))) { + nbytes = j * width; + break; + } + } + /* Set burst size as 1 if there's no suitable one */ + if (j == 1) + nbytes = width; + } iter = sg_dma_len(sg) / nbytes; if (i < sg_len - 1) { last_sg = fsl_desc->tcd[(i + 1)].ptcd; - fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, + fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[i].vtcd, src_addr, dst_addr, fsl_chan->attr, soff, nbytes, 0, iter, iter, doff, last_sg, false, false, true); } else { last_sg = 0; - fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, + fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[i].vtcd, src_addr, dst_addr, fsl_chan->attr, soff, nbytes, 0, iter, iter, doff, last_sg, true, true, false); @@ -609,7 +735,7 @@ struct dma_async_tx_descriptor *fsl_edma_prep_memcpy(struct dma_chan *chan, fsl_chan->is_sw = true; /* 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, + fsl_edma_fill_tcd(fsl_chan, fsl_desc->tcd[0].vtcd, dma_src, dma_dst, fsl_edma_get_tcd_attr(DMA_SLAVE_BUSWIDTH_32_BYTES), 32, len, 0, 1, 1, 32, 0, true, true, false); diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 0a95fd5d74f5..32d403a63686 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -42,6 +42,11 @@ #define EDMA_TCD_CSR_ACTIVE BIT(6) #define EDMA_TCD_CSR_DONE BIT(7) +#define EDMA_V3_TCD_NBYTES_MLOFF_NBYTES(x) ((x) & GENMASK(9, 0)) +#define EDMA_V3_TCD_NBYTES_MLOFF(x) (x << 10) +#define EDMA_V3_TCD_NBYTES_DMLOE (1 << 30) +#define EDMA_V3_TCD_NBYTES_SMLOE (1 << 31) + #define EDMAMUX_CHCFG_DIS 0x0 #define EDMAMUX_CHCFG_ENBL 0x80 #define EDMAMUX_CHCFG_SOURCE(n) ((n) & 0x3F) @@ -54,6 +59,15 @@ BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) | \ BIT(DMA_SLAVE_BUSWIDTH_8_BYTES)) + +#define EDMA_V3_CH_SBR_RD BIT(22) +#define EDMA_V3_CH_SBR_WR BIT(21) +#define EDMA_V3_CH_CSR_ERQ BIT(0) +#define EDMA_V3_CH_CSR_EARQ BIT(1) +#define EDMA_V3_CH_CSR_EEI BIT(2) +#define EDMA_V3_CH_CSR_DONE BIT(30) +#define EDMA_V3_CH_CSR_ACTIVE BIT(31) + enum fsl_edma_pm_state { RUNNING = 0, SUSPENDED, @@ -73,6 +87,18 @@ struct fsl_edma_hw_tcd { __le16 biter; }; +struct fsl_edma3_ch_reg { + __le32 ch_csr; + __le32 ch_es; + __le32 ch_int; + __le32 ch_sbr; + __le32 ch_pri; + __le32 ch_mux; + __le32 ch_mattr; /* edma4, reserved for edma3 */ + __le32 ch_reserved; + struct fsl_edma_hw_tcd tcd; +} __packed; + /* * These are iomem pointers, for both v32 and v64. */ @@ -119,6 +145,18 @@ struct fsl_edma_chan { enum dma_data_direction dma_dir; char chan_name[32]; struct fsl_edma_hw_tcd __iomem *tcd; + u32 real_count; + struct work_struct issue_worker; + struct platform_device *pdev; + struct device *pd_dev; + u32 srcid; + struct clk *clk; + int priority; + int hw_chanid; + int txirq; + bool is_rxchan; + bool is_remote; + bool is_multi_fifo; }; struct fsl_edma_desc { @@ -131,16 +169,27 @@ struct fsl_edma_desc { }; enum edma_version { - v1, /* 32ch, Vybrid, mpc57x, etc */ + v1, /* 32ch, Vybrid, mpc57x, imx7ulp etc */ v2, /* 64ch Coldfire */ + v3, /* imx8qm, imx8qxp, imx93 edma3 */ + v4, /* imx93 edma4 */ }; #define FSL_EDMA_DRV_HAS_DMACLK BIT(0) #define FSL_EDMA_DRV_MUX_SWAP BIT(1) #define FSL_EDMA_DRV_CONFIG32 BIT(2) +#define FSL_EDMA_DRV_HAS_PD BIT(3) +#define FSL_EDMA_DRV_HAS_CHCLK BIT(4) +#define FSL_EDMA_DRV_HAS_CHMUX BIT(5) +/* imx8 QM audio edma remote local swapped */ +#define FSL_EDMA_DRV_QUIRK_SWAPPED BIT(6) +#define FSL_EDMA_DRV_AXI BIT(7) + struct fsl_edma_drvdata { enum edma_version version; u32 dmamuxs; + u32 chreg_off; + u32 chreg_space_sz; u32 flags; int (*setup_irq)(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma); @@ -152,6 +201,7 @@ struct fsl_edma_engine { void __iomem *muxbase[DMAMUX_NR]; struct clk *muxclk[DMAMUX_NR]; struct clk *dmaclk; + struct clk *chclk; struct mutex fsl_edma_mutex; const struct fsl_edma_drvdata *drvdata; u32 n_chans; @@ -159,6 +209,7 @@ struct fsl_edma_engine { int errirq; bool big_endian; struct edma_regs regs; + u64 chan_masked; struct fsl_edma_chan chans[]; }; @@ -172,6 +223,14 @@ struct fsl_edma_engine { edma_writel(chan->edma, val, &chan->tcd->__name) : \ edma_writew(chan->edma, val, &chan->tcd->__name)) +#define edma_readl_chreg(chan, __name) \ + edma_readl(chan->edma, \ + &(container_of(chan->tcd, struct fsl_edma3_ch_reg, tcd)->__name)) + +#define edma_writel_chreg(chan, val, __name) \ + edma_writel(chan->edma, val, \ + &(container_of(chan->tcd, struct fsl_edma3_ch_reg, tcd)->__name)) + /* * R/W functions for big- or little-endian registers: * The eDMA controller's endian is independent of the CPU core's endian. @@ -228,6 +287,16 @@ static inline struct fsl_edma_chan *to_fsl_edma_chan(struct dma_chan *chan) return container_of(chan, struct fsl_edma_chan, vchan.chan); } +static inline int fsl_edma_ver(struct fsl_edma_chan *fsl_chan) +{ + return fsl_chan->edma->drvdata->version; +} + +static inline u32 fsl_edma_drvflags(struct fsl_edma_chan *fsl_chan) +{ + return fsl_chan->edma->drvdata->flags; +} + static inline struct fsl_edma_desc *to_fsl_edma_desc(struct virt_dma_desc *vd) { return container_of(vd, struct fsl_edma_desc, vdesc); diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 8d1d0100f6e6..b82a48226a11 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -18,9 +18,15 @@ #include #include #include +#include +#include #include "fsl-edma-common.h" +#define ARGS_RX BIT(0) +#define ARGS_REMOTE BIT(1) +#define ARGS_MULTI_FIFO BIT(2) + static void fsl_edma_synchronize(struct dma_chan *chan) { struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan); @@ -47,6 +53,22 @@ static irqreturn_t fsl_edma_tx_handler(int irq, void *dev_id) return IRQ_HANDLED; } +static irqreturn_t fsl_edma3_tx_handler(int irq, void *dev_id) +{ + struct fsl_edma_chan *fsl_chan = dev_id; + unsigned int intr; + + intr = edma_readl_chreg(fsl_chan, ch_int); + if (!intr) + return IRQ_HANDLED; + + edma_writel_chreg(fsl_chan, 1, ch_int); + + fsl_edma_tx_chan_handler(fsl_chan); + + return IRQ_HANDLED; +} + static irqreturn_t fsl_edma_err_handler(int irq, void *dev_id) { struct fsl_edma_engine *fsl_edma = dev_id; @@ -108,6 +130,52 @@ static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec, return NULL; } +static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec, + struct of_dma *ofdma) +{ + struct fsl_edma_engine *fsl_edma = ofdma->of_dma_data; + struct dma_chan *chan, *_chan; + struct fsl_edma_chan *fsl_chan; + int i; + + if (dma_spec->args_count != 3) + return NULL; + + mutex_lock(&fsl_edma->fsl_edma_mutex); + list_for_each_entry_safe(chan, _chan, &fsl_edma->dma_dev.channels, + device_node) { + + if (chan->client_count) + continue; + + fsl_chan = to_fsl_edma_chan(chan); + i = fsl_chan - fsl_edma->chans; + if (fsl_edma->drvdata->dmamuxs == 0 && i == dma_spec->args[0]) { + chan = dma_get_slave_channel(chan); + chan->device->privatecnt++; + fsl_chan->priority = dma_spec->args[1]; + fsl_chan->is_rxchan = dma_spec->args[2] & ARGS_RX; + fsl_chan->is_remote = dma_spec->args[2] & ARGS_REMOTE; + fsl_chan->is_multi_fifo = dma_spec->args[2] & ARGS_MULTI_FIFO; + mutex_unlock(&fsl_edma->fsl_edma_mutex); + return chan; + } else if ((fsl_edma->drvdata->dmamuxs || + (fsl_edma->drvdata->flags & FSL_EDMA_DRV_AXI)) && !fsl_chan->srcid) { + chan = dma_get_slave_channel(chan); + chan->device->privatecnt++; + fsl_chan->priority = dma_spec->args[1]; + fsl_chan->srcid = dma_spec->args[0]; + fsl_chan->is_rxchan = dma_spec->args[2] & ARGS_RX; + fsl_chan->is_remote = dma_spec->args[2] & ARGS_REMOTE; + fsl_chan->is_multi_fifo = dma_spec->args[2] & ARGS_MULTI_FIFO; + mutex_unlock(&fsl_edma->fsl_edma_mutex); + return chan; + } + } + mutex_unlock(&fsl_edma->fsl_edma_mutex); + return NULL; +} + static int fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) { @@ -149,6 +217,37 @@ fsl_edma_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma return 0; } +static int fsl_edma3_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) +{ + int ret; + int i; + + for (i = 0; i < fsl_edma->n_chans; i++) { + + struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i]; + + if (fsl_edma->chan_masked & BIT(i)) + continue; + + /* request channel irq */ + fsl_chan->txirq = platform_get_irq(pdev, i); + if (fsl_chan->txirq < 0) { + dev_err(&pdev->dev, "Can't get chan %d's irq.\n", i); + return -EINVAL; + } + + ret = devm_request_irq(&pdev->dev, fsl_chan->txirq, + fsl_edma3_tx_handler, IRQF_SHARED, + fsl_chan->chan_name, fsl_chan); + if (ret) { + dev_err(&pdev->dev, "Can't register chan%d's IRQ.\n", i); + return -EINVAL; + } + } + + return 0; +} + static int fsl_edma2_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) @@ -203,12 +302,16 @@ static void fsl_disable_clocks(struct fsl_edma_engine *fsl_edma, int nr_clocks) static struct fsl_edma_drvdata vf610_data = { .version = v1, .dmamuxs = DMAMUX_NR, + .chreg_off = EDMA_TCD, + .chreg_space_sz = sizeof(struct fsl_edma_hw_tcd), .setup_irq = fsl_edma_irq_init, }; static struct fsl_edma_drvdata ls1028a_data = { .version = v1, .dmamuxs = DMAMUX_NR, + .chreg_off = EDMA_TCD, + .chreg_space_sz = sizeof(struct fsl_edma_hw_tcd), .flags = FSL_EDMA_DRV_MUX_SWAP, .setup_irq = fsl_edma_irq_init, }; @@ -216,18 +319,100 @@ static struct fsl_edma_drvdata ls1028a_data = { static struct fsl_edma_drvdata imx7ulp_data = { .version = v1, .dmamuxs = 1, + .chreg_off = EDMA_TCD, + .chreg_space_sz = sizeof(struct fsl_edma_hw_tcd), .flags = FSL_EDMA_DRV_HAS_DMACLK | FSL_EDMA_DRV_CONFIG32, .setup_irq = fsl_edma2_irq_init, }; +static struct fsl_edma_drvdata imx8qm_data = { + .version = v3, + .flags = FSL_EDMA_DRV_HAS_CHMUX | FSL_EDMA_DRV_HAS_PD, + .chreg_space_sz = 0x10000, + .chreg_off = 0x10000, + .setup_irq = fsl_edma3_irq_init, +}; + +static struct fsl_edma_drvdata imx8qm_audio_data = { + .version = v3, + .flags = FSL_EDMA_DRV_HAS_CHMUX | FSL_EDMA_DRV_QUIRK_SWAPPED | + FSL_EDMA_DRV_HAS_PD, + .chreg_space_sz = 0x10000, + .chreg_off = 0x10000, + .setup_irq = fsl_edma3_irq_init, +}; + +static struct fsl_edma_drvdata imx93_data3 = { + .version = v3, + .flags = FSL_EDMA_DRV_HAS_CHMUX | FSL_EDMA_DRV_HAS_DMACLK, + .chreg_space_sz = 0x10000, + .chreg_off = 0x10000, + .setup_irq = fsl_edma3_irq_init, +}; + +static struct fsl_edma_drvdata imx93_data4 = { + .version = v4, + .flags = FSL_EDMA_DRV_HAS_CHMUX | FSL_EDMA_DRV_HAS_DMACLK, + .chreg_space_sz = 0x8000, + .chreg_off = 0x10000, + .setup_irq = fsl_edma3_irq_init, +}; + static const struct of_device_id fsl_edma_dt_ids[] = { { .compatible = "fsl,vf610-edma", .data = &vf610_data}, { .compatible = "fsl,ls1028a-edma", .data = &ls1028a_data}, { .compatible = "fsl,imx7ulp-edma", .data = &imx7ulp_data}, + { .compatible = "fsl,imx8qm-edma", .data = &imx8qm_data}, + { .compatible = "fsl,imx8qm-adma", .data = &imx8qm_audio_data}, + { .compatible = "fsl,imx93-edma3", .data = &imx93_data3}, + { .compatible = "fsl,imx93-edma4", .data = &imx93_data4}, { /* sentinel */ } }; + MODULE_DEVICE_TABLE(of, fsl_edma_dt_ids); +static int fsl_edma3_attach_pd(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) +{ + struct fsl_edma_chan *fsl_chan; + struct device_link *link; + struct device *pd_chan; + struct device *dev; + int i; + + dev = &pdev->dev; + + for (i = 0; i < fsl_edma->n_chans; i++) { + if (fsl_edma->chan_masked & BIT(i)) + continue; + + fsl_chan = &fsl_edma->chans[i]; + + pd_chan = dev_pm_domain_attach_by_id(dev, i); + if (IS_ERR_OR_NULL(pd_chan)) { + dev_err(dev, "Failed attach pd %d\n", i); + return -EINVAL; + } + + link = device_link_add(dev, pd_chan, DL_FLAG_STATELESS | + DL_FLAG_PM_RUNTIME | + DL_FLAG_RPM_ACTIVE); + if (IS_ERR(link)) { + dev_err(dev, "Failed to add device_link to %d: %ld\n", i, + PTR_ERR(link)); + return -EINVAL; + } + + fsl_chan->pd_dev = pd_chan; + + pm_runtime_use_autosuspend(fsl_chan->pd_dev); + pm_runtime_set_autosuspend_delay(fsl_chan->pd_dev, 200); + pm_runtime_set_active(fsl_chan->pd_dev); + //pm_runtime_put_sync_suspend(fsl_chan->pd_dev); + } + + return 0; +} + static int fsl_edma_probe(struct platform_device *pdev) { const struct of_device_id *of_id = @@ -266,8 +451,10 @@ static int fsl_edma_probe(struct platform_device *pdev) if (IS_ERR(fsl_edma->membase)) return PTR_ERR(fsl_edma->membase); - fsl_edma_setup_regs(fsl_edma); - regs = &fsl_edma->regs; + if (drvdata->version < v3) { + fsl_edma_setup_regs(fsl_edma); + regs = &fsl_edma->regs; + } if (drvdata->flags & FSL_EDMA_DRV_HAS_DMACLK) { fsl_edma->dmaclk = devm_clk_get_enabled(&pdev->dev, "dma"); @@ -277,6 +464,17 @@ static int fsl_edma_probe(struct platform_device *pdev) } } + if (drvdata->flags & FSL_EDMA_DRV_HAS_CHCLK) { + fsl_edma->chclk = devm_clk_get_enabled(&pdev->dev, "mp"); + if (IS_ERR(fsl_edma->chclk)) { + dev_err(&pdev->dev, "Missing MP block clock.\n"); + return PTR_ERR(fsl_edma->chclk); + } + } + + if (of_property_read_u64(np, "fsl,channel-mask", &fsl_edma->chan_masked)) + fsl_edma->chan_masked = 0; + for (i = 0; i < fsl_edma->drvdata->dmamuxs; i++) { char clkname[32]; @@ -299,9 +497,18 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_edma->big_endian = of_property_read_bool(np, "big-endian"); + if (drvdata->flags & FSL_EDMA_DRV_HAS_PD) { + ret = fsl_edma3_attach_pd(pdev, fsl_edma); + if (ret) + return ret; + } + INIT_LIST_HEAD(&fsl_edma->dma_dev.channels); for (i = 0; i < fsl_edma->n_chans; i++) { - struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i]; + fsl_chan = &fsl_edma->chans[i]; + + if (fsl_edma->chan_masked & BIT(i)) + continue; snprintf(fsl_chan->chan_name, sizeof(fsl_chan->chan_name), "%s-CH%02d", dev_name(&pdev->dev), i); @@ -312,12 +519,18 @@ 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); + + len = (fsl_edma_ver(fsl_chan) >= v3) ? offsetof(struct fsl_edma3_ch_reg, tcd) : 0; + fsl_chan->tcd = fsl_edma->membase + + i * drvdata->chreg_space_sz + drvdata->chreg_off + len; + + fsl_chan->pdev = pdev; vchan_init(&fsl_chan->vchan, &fsl_edma->dma_dev); edma_write_tcdreg(fsl_chan, 0, csr); - fsl_edma_chan_mux(fsl_chan, 0, false); + + if (drvdata->dmamuxs) + fsl_edma_chan_mux(fsl_chan, 0, false); } ret = fsl_edma->drvdata->setup_irq(pdev, fsl_edma); @@ -347,11 +560,27 @@ static int fsl_edma_probe(struct platform_device *pdev) fsl_edma->dma_dev.src_addr_widths = FSL_EDMA_BUSWIDTHS; fsl_edma->dma_dev.dst_addr_widths = FSL_EDMA_BUSWIDTHS; + + if (drvdata->version >= v3) { + fsl_edma->dma_dev.src_addr_widths |= BIT(DMA_SLAVE_BUSWIDTH_8_BYTES); + fsl_edma->dma_dev.dst_addr_widths |= BIT(DMA_SLAVE_BUSWIDTH_8_BYTES); + } + fsl_edma->dma_dev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); + if (drvdata->version >= v3) + fsl_edma->dma_dev.directions |= BIT(DMA_DEV_TO_DEV); + + fsl_edma->dma_dev.copy_align = drvdata->version >= v3 ? + DMAENGINE_ALIGN_64_BYTES : + DMAENGINE_ALIGN_32_BYTES; - fsl_edma->dma_dev.copy_align = DMAENGINE_ALIGN_32_BYTES; /* Per worst case 'nbytes = 1' take CITER as the max_seg_size */ - dma_set_max_seg_size(fsl_edma->dma_dev.dev, 0x3fff); + if (drvdata->version >= v3) + dma_set_max_seg_size(fsl_edma->dma_dev.dev, 0x7fff); + else + dma_set_max_seg_size(fsl_edma->dma_dev.dev, 0x3fff); + + fsl_edma->dma_dev.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; platform_set_drvdata(pdev, fsl_edma); @@ -362,7 +591,9 @@ static int fsl_edma_probe(struct platform_device *pdev) return ret; } - ret = of_dma_controller_register(np, fsl_edma_xlate, fsl_edma); + ret = of_dma_controller_register(np, + drvdata->version < v3 ? fsl_edma_xlate : fsl_edma3_xlate, + fsl_edma); if (ret) { dev_err(&pdev->dev, "Can't register Freescale eDMA of_dma. (%d)\n", ret); @@ -371,7 +602,8 @@ static int fsl_edma_probe(struct platform_device *pdev) } /* enable round robin arbitration */ - edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr); + if (drvdata->version < v3) + edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, regs->cr); return 0; } From patchwork Fri May 26 14:36:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13257014 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 74CE3C7EE2C for ; Fri, 26 May 2023 14:40:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244000AbjEZOkO (ORCPT ); Fri, 26 May 2023 10:40:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244044AbjEZOjz (ORCPT ); Fri, 26 May 2023 10:39:55 -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 8CEC9E52; Fri, 26 May 2023 07:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fKc+AgqRqW6jl9AY2zDLap57O4AeWQT0vNt1EQJp3b0npzMtOZjEZqvTttK7g8nBFPlEf99aCdYjALpaWVvv+TZbWGyBJ6EJp44bJy86zR9LkQ1dtl1UdOzH9prYrZxyhBwKtSf+cJLaIqxz/CmIHzeD71XNB5FPwbHCUsm3J1ejM6XrgOO4K0bh22Fy2+/b9l0908GaRcILKc6AjffirnrOMsspCRmliY4WSWdd1nUFAeIR7KZukE/8CB0NPD9N4lmySnTrKlbx24aQpprL97utguQ1OL4l7fEVG9G0/zVRcIhNISZ5HkgpKHAnMhask321HMGhN3yrscoVoXoznw== 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=AcE5vMi7/aWPMewDcfZDH3ANpd2MIJt4V0iR3aq2iJs=; b=fVLRK074RIpB1jvreF3hKRKmxBJilHIQm8ShAHqXWTRemTvFvbElGev2CUU6TSPA8/v90xy5Dar699dY/Re7VRsQKFIG6B0IkWBx2z5FvzY3IGTEDLTDc85ult9ymJOvjDqPurSJjSVuDLoq2leSQxGn5EEkoLHrUbGFKxJw7j5UBSo6ZzIhVg9T6In37sVlRXEo5SFKqgS5QuLXryoYcIXE8j21+4n2wk2LWiVaPyONJHIvnH0hNhglQXvXBr0iVtebvhyi90j3IriD/NmZF+FpKCFjF0ZTWOorDbeR49x+kIYBIz8BY6ETXCt+5gPtBvM40ULGaVMQND/8zCxo4Q== 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=AcE5vMi7/aWPMewDcfZDH3ANpd2MIJt4V0iR3aq2iJs=; b=UbbJEpw8jGupZLBjfV40V0c3cSTqQZsu3QDUuUEK5GQquBsc2I2GRr0vKn1AuVucNmQor765zwJfxw0pRFrLOgHW9+6d5gmRAK8NX+1g6/+NsjJJXdjHlAGck/4wps5kFj6RehoHTHsB/PZVN8facqzbcYk51j6eWfWT8EqwLcY= 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:32 +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:32 +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 12/12] dt-bindings: fsl-dma: fsl-edma: add edma3 compatible string Date: Fri, 26 May 2023 10:36:39 -0400 Message-Id: <20230526143639.1037099-13-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: ab18227a-3e6b-4720-aacb-08db5df6bd55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BK3m0O32PpuZxYCt/CdRhrfbvFFrwGidDqDFQwAWtPrfjDwPZgUKM//FrMoEZ9XByisX7N5iDA9OD6KblDloRnLbQ46/q9H7tTLg3ehUrd34Tqt55ENQyYK5mX+sUzbzHNk36bow3ni20t5vvrOaxGHefsQSj+/stw0RZekXHALXa/DKuXZIlLvPYltJ29T+6k1mwlR2aGdBBBSKzDSKtzw9GcdGztfm8oyYvbLmTowr8V2foiMdpcHwTUG3SmGaB9KamrIr4qIaN84iXCbZOhoPyrpmcGZ+JHp3pBi1j5+cdNZDTg+nK2yAtmUf28MuDR6stSIjhpRtBzt+4gRwKv/7Ry8U9U2s81lzF59vWx38XSBh80vqTw7iWyVdlwzKz85TqpPgAJKy4Q82D+4WRHTH8FJw8YZ4DkrytegeHne5UQzptIp2oYYxuaer6wjW+VAlnzGII8HiYE/rgDZC9WUihXXg1zTwvwEUbA+gPBddJ06RDKRZkYjqrvdJrWj8BZHrPNchd/YNIIMk3b8E24GN2MYfFHseaSSxTsL4Ud3uR3+as1U1JDC/fkytEkfoZz8TLUwZfrzZp4wAiQ9lCbzf7UOxKJ1VwqPLDBceV5hjsZtQXOQa7dvEbFv5EJaE 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)(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: W1DticNar7Vrxi4XtcNxp0PO4XrJLkJXmvnDVNA+7BZli15sc1JncllVUZcaOh+f+lkKv5MP7SNbmI3yte7GglqEwUlFzXSF4YyShpRFbcnt48RWwg7Ldy8Cb/If5BDdZahl8WCRgDuVI3HruQuPmMygUwFVxdICE3XHFcyTYOywhoVR8+YtgwmPkAtRZvMVmDj/AlwfcTFPuweVPihi3Dp0qygcFkR2FADZS4zOxnWMPPzTqBOwxNVRIe1V/+Sw+nfl7KlWFwB/7UNfZ8P6IuwmUf9XFyUliEJJkEddVqv6ObEemb6g8VJdc4lCUvuJk6oHhp5ovXLe0pjv76NCdK8UyDAOQyOa0LSYIafB54STBNo3OmSXTJTiiuBar7OunBUIg+shhBxP14FRBGBeyG6RLvtErTfczE+ehr2bWrc1Tpj+bWvvsnYwSOj64x0VrT1CyB56VSQ9OMcSULPUYcpzyM3CjnQaExSlwVBq15WmYQvJD5k/075Nir9nCQtAlPt5Vs1gOPPbeg15C2FIxdqpZYhQcoE3filuqDcatoZhGIBlBvgUxgbykPuuSN8PGVUnOgMDkmalxt0zswCaCvaSx8b4nosORtWwnEXt+8bo8iYDtlZZtrbvJMayGEmS5mClU1Z/qSK3lvpfrBur2dy2YdQM63LzFTS64rY0ymdlQeoZjfwBNwTUolDJ5Y4Bw+Q1MID71KPZ+5AJ1cgWMazV+YNEE8kfxuMESiHaMnRZ0IChBTd+99t7SwXg3hJY1lLzmu4fJtBfg8HByE+0KL1yNO+bmZDME+U5XjMO8RswSmd32x7IHMMqpXRpByOXUM3X+gzijrI98FcuY21dLNWybCsjwRakgf6VVBG5G1YSg1QbWVM2trSPaRA7G9Vp6914YeClmuoONUUuIVTOWY77PlNk6w+vYLihMQNERpgyW3pRe2ACHlkEo/tJExewuKVFRK7VmHF0Ee71hIglq75kmFH/aEcns8gZh6tI2t0Do4p0GHnQxszahxgWVsMsOvPmYwNbaJHePU0ue5CNcRwqj+2r4lC6yfpPb59dQKR7TVzOhuk/EBUITGhK3x45BKDPWEBaJXShwrDnv+PXwxuzdegqMGXChvLJ+Lz/19wjK/LfMQwmRhhZFMXC0GGB+rNgPIcJikBms5GMC8GiDER3UxnGx869CmXCaJPQq8hDTmoR3n3Ud5Mifw+nLTo43ARq6ciOdgBIAOAJyzLteg00v/DaA+AasnlXiYguXS68yq2RNgQCn2BU4tKX2LZ8jeKW4MrMM6Xxb6AJx8NT0w/4vFDzkn1LqHaI0QMcci9rclr9XxF8p1jI5IfQP1ac2anCfKzF1hefyH2+M+JJDc2vcyNeahDeRaDdlM9cQONxOmNI8zFldGjO38GhIPlj88S3fBuNpRRcdKJgrJYzsiunu6tqh2Phswen1c8HohhZj5d1ymvYQTxnb8gn8B0zvIQHzwJUpdlgb8c134IJjJ2ZckMt5JvRAXESgLkEhdf2jlIyWzXlANl07u6H6fxyH+QmXrXEoHbJDNWIHZOijGWRi6m+txX/dR16QJJ1new2hh7JxUTaDC9Mau8KutCU X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab18227a-3e6b-4720-aacb-08db5df6bd55 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:32.6423 (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: 7jKHy6NKZvBHniRcPqeiYoPgStkbyb3jEn96J2+YqpGYlJXc3KSRGmXCrk2SuvYvfL+qzjEvoLins+aOp12w/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8070 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Extend Freescale eDMA driver bindings to support eDMA3 IP blocks in i.MX8QM and i.MX8QXP SoCs. In i.MX93, both eDMA3 and eDMA4 are now. Signed-off-by: Frank Li --- .../devicetree/bindings/dma/fsl,edma.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/fsl,edma.yaml b/Documentation/devicetree/bindings/dma/fsl,edma.yaml index 5fd8fc604261..4315f854198e 100644 --- a/Documentation/devicetree/bindings/dma/fsl,edma.yaml +++ b/Documentation/devicetree/bindings/dma/fsl,edma.yaml @@ -21,6 +21,10 @@ properties: - enum: - fsl,vf610-edma - fsl,imx7ulp-edma + - fsl,imx8qm-edma + - fsl,imx8qm-adma + - fsl,imx93-edma3 + - fsl,imx93-edma4 - items: - const: fsl,ls1028a-edma - const: fsl,vf610-edma @@ -101,6 +105,21 @@ allOf: reg: maxItems: 2 + - if: + properties: + compatible: + contains: + const: fsl,imx8qm-edma + const: fsl,imx8qm-adma + const: fsl,imx93-edma3 + const: fsl,imx93-edma4 + then: + properties: + reg: + maxItems: 1 + interrupts: + maxItems: 64 + unevaluatedProperties: false examples: