From patchwork Fri Jun 16 15:34: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: 693346 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 2C71DEB64D7 for ; Fri, 16 Jun 2023 15:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346037AbjFPPfI (ORCPT ); Fri, 16 Jun 2023 11:35:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346027AbjFPPfE (ORCPT ); Fri, 16 Jun 2023 11:35:04 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2072.outbound.protection.outlook.com [40.107.104.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4D1E12B; Fri, 16 Jun 2023 08:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LDVkV1rlqi2KxqEQ8uQpTkhxmoKppcq+a9n24ixrXSXPYKeYI291J4XoD3XIRwazGmSVQgodE6rZfP0+u3FhxYHNbHzc+Eknz2Dp77XX0xGWecxG46sNUmkTJgrWEjgOk9APU1pDLl0TWKwnayhntjnE8VckJmcqpXbgOpsldszUHCB9nP7IzKbeyFbx13KLOLe6LNjgSvBV5zWBwBQXYnwS4qt0hxXJ/t5bVfyPG9owRGTLvhTYEU3e2jIOzR7j1JGmJyuauL/6d9OgRb1lerNCn21CQxBykaZYbOHWXJfh/NzunWLn4+v3MGy+5KHi1hG4ZBaot5e/KuUfQ6HCfw== 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=QI8n0XPwXsaaH6UZQG+Zvq7pxrcY++lIzGOz4LgaYtE=; b=m5lbo/sRwnjhmgnT1ue5Radt1LLXigCE7WWZVsTBBIfCtg0VnIYzQWoeEj/y1SEnr8fMtLA0svBU5ZHDGnQ2KgwbRvtle64Y5V8PfBL8nhFrMsU+yMxmG+gpGHIbuXZDe/4cLMC0iFoP7iGyXEZ8uoR0hdueSrBQicKOHVMCsDUBpfUjwxytFv6jWofAMNICKPdlSFbumfzLmWzC1bvNlRldf4QFIjgWBz5nR2jrTEGOqqZa9jyBWDD0kA0tfBL/+E6HNAzVoKCd3Rx2gRUyTJVlaQbqRwCrFvbyO852zK5AnU8Xb9rpQwAzDskpfDYhO2LmVBeDsqNNVEeeJA1j3Q== 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=QI8n0XPwXsaaH6UZQG+Zvq7pxrcY++lIzGOz4LgaYtE=; b=iQ2YMtrTbcNXjbavUw+fI8vFGFYEfTfXzMfWD1+aCRfhZqIYA+pmf846lsIdtF+i4bJEn0Ab9HorpK0pFxTQ4gWMs3K0H3MgIXkXXYqyzyoimwnIik9JltfPLmQY7GXECovP+ULXnIUqprJPIfHuNhQu+ZOxyPEHdgMuSZE43S0= 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 PAXPR04MB9644.eurprd04.prod.outlook.com (2603:10a6:102:242::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Fri, 16 Jun 2023 15:35:01 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6477.035; Fri, 16 Jun 2023 15:35:01 +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 v7 02/12] dmaengine: fsl-edma: clean up fsl_edma_irq_exit() Date: Fri, 16 Jun 2023 11:34:28 -0400 Message-Id: <20230616153438.2299922-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616153438.2299922-1-Frank.Li@nxp.com> References: <20230616153438.2299922-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0067.namprd03.prod.outlook.com (2603:10b6:a03:331::12) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB9644:EE_ X-MS-Office365-Filtering-Correlation-Id: ba7ab457-1e0f-42e4-a764-08db6e7f3fb9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Irl9V16K0otnvX+WDmL3EcBbPryBsi6zJpFAdJh9oP4xUADU6xy7mUjAldndo7ixUqWLGSiD2HvVvTaZnOFfadxfK5GC2tlKD6tx3JyxydCAnnl9wnOMcEfgwsvhYmPzYJb5OT+kTZEHkW39IDMhf0aiZJs+FImASZzIaToDyISHw0EYwStb6z8g7zHtMTvsHWEqtcOYANj4vaS8SzdTKLEcaGrJtVHdxkcox85ev3omoQQe+6N7U7KXN5Id4xZPIA0NaNhKwSYDzp0AJizt1nSJaUIBlctJi3IGV3bIneUUa9elqoyraojD7F/Dwtq/4Og0PlrpbcetnoUWZMrrXAF5T4d9+oRg60aPIlMfs1UcivSnaWInAwhEoYejy6J84tDfm+SFR8S2UkT2TWqBibpRUJwecDqBZWAmoRQug9ewhoVNeaOkMoZQRFTyfEwagxqMWLApFKfoZ4+kB0G9nTt60mgJe1dgXfaf26CZPgrzqZLA+PDS3fgqIEMPWikAS+78t7F7Jlob0BEoeg0O/VbaR3YifpsSmXMgoStbJmV4q1/DGxIMwYcMBzeYlYOomTsxnVRUipQpvCgdbNhIPVzHCiwCgCskA5+EKnbCPEo/eFCXU3Gw7bJQxRRo+/C7mFhuA/8ND86w+sMpu58Irg== 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)(346002)(396003)(366004)(376002)(39860400002)(136003)(451199021)(186003)(38350700002)(2906002)(38100700002)(86362001)(6512007)(1076003)(26005)(83380400001)(2616005)(6506007)(921005)(36756003)(316002)(6486002)(66476007)(66556008)(6666004)(66946007)(478600001)(52116002)(41300700001)(8676002)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8Lz8HLf7QURGzVt0qduMa9TNy+4n0hmwfLtD5wZwV3K3jDQ/qhO9PwOmjUDlXSX9hjUsVADxfhdr3BDUoXvfMi6+lx4Kqk2MuzvYeMmerJ9RzCd208zrNngkvlva+BdMFt07cBAfLamOpHiuOcarB4KtsM3WOOqNIxitm/hOlhN5KNFi6XCC3vAZlS0CjhRbEbDSw0kEN93FwQoJqSjgnmAgGInT/a7Y3qH8RVGaG6JXl+ep/PLs45HhtKto8KtgNcU104MZ/JuKS5xZOdd7EV1Ess3tv12E5hmtWJ25zBv2xGOWaACLojmKZH7roI74XvPKq4hWPQ/f99R0uvoQOhWxPaPqrCkoxUoTe9OoHedqfZdnIf0BWxlJNULXfoVd5Uhb14XoM0RQ8Orr+JFqPx30Dj3DdwSPbh1ZwUendi2VKc/Nhe86y97L3udQpSfPAuA0Q6l0ZTLJd5dRfe0EgkWrKvvUKxGKqoAuU8wtNpr6pwE9nKI4M/muCRquqj9GIAkJFWtk7Xu7q7Wo2WnhWTqgmg0u4kqCgizRfmSo/foiVC2YYwMvRaYmAoPrHed5fvMnSuvmfQeyfc6iR5W9kmOzw/7RLEiJ6fpvE1FSzljmOeEZ29BIm//4jDIqf5L9VfJdThuFj4MPlAaD8BdVSrSGZNyTaOyAxn4hthE2yDwiPWoF1xLwaQyPymP+qNxTiIZqN9BFXCVa3Uy6Co8AdK2IBql5DNakvrvgo4zhQzH8T8D5hBegv9kd5P6bV3W4Dk8kFShBJHayNQSQhaltvIV49aYR6RzHfftlqUSlqwLFg64YmdQKYHXAar5wmGb+2AsvvMJz/ofBObjUZIgpeXW8bqgFq+EiR2FTFdAOdSP4qCmjlGwKJhJEQmzy5+HFNTr2sV28/uL9oOEBpHJrBAxjmajLgGFmgX208X3PkNnihx/fO5x6LkCCm6tjkRWTXmQl1/J8SnbNWzBBA4/Rgll49EUSOflaj754k7/IekiCM5pAeADCStMIBPkeyAqTjuv898Ki4iZKhnjsQZxFjYHiZgNF3SJK0AAnjm4f4i92DfolcfatPeoTz553TIshfiLRhxe5gqJ738N19JXcZ/H5REAJ/+enJ0ZV2sVeWACi9/Rb4VBiqLSoO+WYm7aEqSU84UMkegcvdnGT2mO3IuuB2aZn/QABTv5Kz56yBam7eIAu7LCU5X4qgVJ7TLdAULXi6chFfVv2IXki8fAvrB/F8DfeXg+54BXzkTixo3kZk11bGv5QTPCuKXh8yaBHWLHZd26jqd+v2ujaq+Zsc31qYxAG3x4opJQRrdewvBfI6RFDRvScBodYGO0lKIZObJ7IfmYHzJEXIoGByvVnF4e9wkXEGd9zbWmXiQ4VSpOYl0l7TkiU1n7rlaYW8yljwKPRGpR0QNxFIScQHtyIoL9FYaKAj712G9MU1b54rEdWj/fzaj40h/QM6sCfpKCh3fVOcUBTNuWDW4dAjjLOCXqh1vvTdXflxoILgovOzAfbt3/rHoHEByOmrTtbvYVl78El+a8ZXdMjB4o7Kpppn2PQmH4xzG2vI0ll9Cb6Wlo= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba7ab457-1e0f-42e4-a764-08db6e7f3fb9 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 15:35:01.3870 (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: iTvq3xXvR4ZsmgsiQeyHsO93BHN2wy0veH8aVzRyTnPwopBXABzsNCCKg0HqLIJ612qxLicLUnJJ4r939lZ9kQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9644 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In the probe function, devm_request_irq is now being used to automatically manage IRQ. It eliminates the need for manual IRQ freeing during removal. Signed-off-by: Frank Li Reviewed-by: Peng Fan --- 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 Jun 16 15:34: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: 693345 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 C18A4EB64D7 for ; Fri, 16 Jun 2023 15:35:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346015AbjFPPfZ (ORCPT ); Fri, 16 Jun 2023 11:35:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345789AbjFPPfS (ORCPT ); Fri, 16 Jun 2023 11:35:18 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2041.outbound.protection.outlook.com [40.107.104.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A82030C3; Fri, 16 Jun 2023 08:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RO78FdRPW+2XNwRWeKDLRsHrpssHRXS4HiTp3xXLYV5/Pb3zBQZB+qEnCiV8LJoYbCma88SmElQAnJ1uS6iijWMEBXqi5juvH3Sp1qbCZyD/Y7Au3NNu9EXHskvoJA6aZ3m989EPbuchDsPcrZMcaTUbSFdWUwktXAja4RKxOHcATaU5VsC/ObhFv8y0zMCFjI94l8QIMeaApOYJgWE84KdGzx4HU+Ub3N4ipvpIsO8cT8iFwckmQK+97miwSYRwJZ349QHHbMBbLnleShgVsh4EYrJa+OgIg1WiaNgDEy/CGfPyefO+NV4eN4qKCXwOhYTnDUgmejFKGG+YBXWeQg== 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=qtVmb2w/gc4SRB2f37IwBcHKtbBBAdft6k4Ina+w9xI=; b=BmKecR/98jJGzCeD8JQloMFAHlwcvuvlzUR0VxzcW94pzqKXZtWIcFRE/1zodici/h2d3WOMEZiAmhgEwfNiUnGx9WjDWxa8ApKy83mrTB6XmaMqKCG8zPLQVUov2pjGRSTY21IEsAwxXbvvpU67h5Tw3/10+4T94F3EsfHMDKfpSMpJTfdzE3SrXzRS3sN0nWYUgdLlKhEwCW80mLBgBZnQpZuNcTHKMd/YfLUe9Nn6n2V87OMhzt8G1Gq5DOvgzW4RtqjRhXqudjuB4G7sMpM/qmN9pL7jbhgo3d1wxEUrlnfBu9feUKrdEGTcJB9e77/+GVW5EY1nje+RYoXSTQ== 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=qtVmb2w/gc4SRB2f37IwBcHKtbBBAdft6k4Ina+w9xI=; b=AKXPize+Xwt03GQR/DLfNvrI4uZ3lz14y1CzQRrfMA+MzRfgt7MJ6bS5mKBcs6W7jg1mDnkzizpZlHtpjmp8uj3S1VHRUHOCKvFJipgOVu4o41gEiVX8WuIfhb0u0EuU8gHujz/bxPoIEVWk795LngNXgF4GkLwnmGoCJP0/OLw= 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 PR3PR04MB7339.eurprd04.prod.outlook.com (2603:10a6:102:8b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Fri, 16 Jun 2023 15:35:07 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6477.035; Fri, 16 Jun 2023 15:35:07 +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 v7 04/12] dmaengine: fsl-edma: Remove enum edma_version Date: Fri, 16 Jun 2023 11:34:30 -0400 Message-Id: <20230616153438.2299922-5-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616153438.2299922-1-Frank.Li@nxp.com> References: <20230616153438.2299922-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0067.namprd03.prod.outlook.com (2603:10b6:a03:331::12) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PR3PR04MB7339:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ef31637-f875-45a5-3472-08db6e7f4322 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tzyS1fVSRX1zlYnNrT75PHD+RLcJSdoG4DkouJJxEGK6bB/vu71aRQEAJTZGvyo/OxmLIK6gsFOVew0VgLeD+2mGMpc3tRgtpjUY5CAzzmi5GoZRblCENle17lMAiEt4/DO+BjfJA/u34qK+/NaSvpDyddeX77qRw88e3vHBJtNeBp1UKdmsKoeja+pSBD9YK73rmJoPJsdn4bi8L7j37V2E9DwN6yZ3Ksu17OnxGOEbKwtgVjavrWQTQzVymF4tH/zihtEx4UjYxr3+qGKOC3H0zQHpTZCve9cdTNPfZJ/1DbEiQMv/CFlViUinH2+SAtdMK9G150QjicbuvIJUBP3cLVfehgtisZuoiS9X1fGPRo7JVEnIj5EKfB8KggaBbQpSVAWCK/zGbf33lfOlIVRyVPWREzHfnsc2uZ6olG7estSb6gV1d0ZlS6LqU+ZPDp+7Op28cBL3xK9TTaIvvUTynFdobGY+EZOgCl3CPOhZLvzEWSn4NPSsvVlXqjZv+noHEOFwPVlMGdHePeMp7rJolcc/5IBPxMs9DSgFvwsmytWu7hEhDX3GO2yJ9EtZl5q+PRY08LIaC4wpjuCR8+K3np1eROZNlHLOw3Kt4xErP5iOMIInQbgeICtbs49CVMD6OTX0yMoBr5fS6Hlel16rQTUbE2ElGPZ0YxZt1+o= 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)(376002)(366004)(136003)(346002)(396003)(451199021)(38100700002)(66476007)(66556008)(921005)(66946007)(316002)(2616005)(38350700002)(86362001)(186003)(52116002)(36756003)(6486002)(6666004)(26005)(6506007)(6512007)(1076003)(478600001)(2906002)(8936002)(8676002)(5660300002)(83380400001)(41300700001)(21314003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: epQLXtPNJEOGvQ3UNALRhi/pOt8sF0uRqOQaKTMPXOdhV+6WsfBSLGQj5m8TvgsNmz4OQn7bKHI2krw9y8YJaJBUJVuP5wzR7ZAISnP4O9ZxvVNxP5x+PFvSqtoBom50Ly0Pqt8xaQM9TEgYQWabKtLAdZlqqLZrSQaV9cA4mpQcVGFItXzEyp/BT6cqyI3Zs5WI5t9iXvRdD4NFKNlI07lvqi+3tHSPHE2yA32yac60sd70TpbA8hgcl5hmxVjAnSmx0zShOXbMxVdtULdvyq+1Ufmi99YaOBKUZHoERNJYg75Dls0yo23Nq9AQ5A4oA5O/yqxYWDQ2D2YmaM3mfP72uFTusJqePfFLbGgiJjbr5Xxc8S4VR8WJwEzeiymqCNZ2C+JB2Ys7QXTSXoZUXjMBKyQtICVWxN+7IUgbhItXSd+DQI1QoH6mdu5jQnCAnO6tawTUfUWhMWTh+DS2v4aX6f15Pu09ve4CY64ipaPMoa9BK6KqHu9LA03mg9cDMZqLDqJVhmMxcfNlsMYLbZCpLqSegZX9YdpA+riQWJYKpbMcnwoJwoFwc70xk8iZ4XBvAgHLo8ZZK/Mvo6U6DNujb0/GmMoKqZ5VtmsF/+x7f5I7NXozXIK+miREOiSE5clmL6wEgbod3GJsgdlgny689JZcM/6H5GQdbm4mCxttjmukMkCXM5aD44U68fgZ0wL5z4Un46ezajwmqaj1vGG4uOjxJ6o+YFLljObUklblYErSKjdmFk0Dg1MUNDOAA57AoyP+ouPOa6FpRUajDfANddkDcMUJK1MerGBonfMZ04S+o9PfU7OspoM6CTPMz/pPsBxXtW5s8L1SIA8irHn23CLbYnfn2ptrUsrM+ldswXtax3i4LTkmASJwXRRxNId+8llBsZDpD3CMJwo7vxZEaL+9pg3T3Di11MtYLQLAmW4W2BvwwzG/PMQX9Vg8bElK9Ripa7oPVPPIh07pYWmNd3PSIpQoP8hZ3Bycu1E6leRjxGm83NMOBjPqdbY1kCbmYNmkkBGXX/aHtV2bxlEO+cU6TTJQZNfF5CoTsZ1uoxkw66x/e7U0R1CJ1ZlEhZ9ANVhwSjOEkSsLBTS4DKzGdo4RRDmT3HdwuIt7zgGedy7w78WJBwsLlOLNU4PCYOiRcRoNtRPS8kStOs4vwFTPBT/2VjOTytulqWshFa8F5Rktb5ewg+u1pYj8r/13N06XsFOi9Bs3gPVDUtrpTH00Iu/vHhiL2F86Jaj5gDdMqs2aBgzE7yNz04Hu9+LP8Z1kjKf2it4KQP30uhp5uunwHF0HWq4FNBfXXFElNC+bHcknIPFqFnjMNA5VU5ySgpaOOVmAFdKAim5QkencL9J9N3evWPhaJGFN0jvysBIp9jhU8OSnVOaTH4PnbU0JRwwa5bKofaJKYSQgnALwWCAr0X1awmxRahGTT+733P8aGVJbEcPVucCxJ2p2xXJP/OhGnTV7S4gwtKHoMR7QVsgJfgcMBGOpvtcyeM6TbE2r4vo/XY2a6ohKln+L5/+FuE2u+CqP0Xpz415R2rVcfgyoYhx2bqnxGSogJdoBDa8= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ef31637-f875-45a5-3472-08db6e7f4322 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 15:35:07.0842 (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: cxmJOrK6HLFO1zpO4KVIAPoGLpeMYfZzKgfufYGz36RI6MQG3PWJkGwI8j64QR2T/VMFqEV+MNTOc+VaW6o1rA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7339 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The enum edma_version, which defines v1, v2, and v3, is a software concept used to distinguish IP differences. However, it is not aligned with the chip reference manual. According to the 7ulp reference manual, it should be edma2. In the future, there will be edma3, edma4, and edma5, which could cause confusion. To avoid this confusion, remove the edma_version and instead use drvdata->flags to distinguish the IP difference. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 47 ++++++++++++++--------------------- drivers/dma/fsl-edma-common.h | 10 +++----- drivers/dma/fsl-edma-main.c | 8 +++--- drivers/dma/mcf-edma-main.c | 2 +- 4 files changed, 26 insertions(+), 41 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 10dcc1435d37..9948babcadf6 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -47,7 +47,7 @@ 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_chan->edma->drvdata->flags & FSL_EDMA_DRV_WRAP_IO) { edma_writeb(fsl_chan->edma, EDMA_SEEI_SEEI(ch), regs->seei); edma_writeb(fsl_chan->edma, ch, regs->serq); } else { @@ -64,7 +64,7 @@ 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_chan->edma->drvdata->flags & FSL_EDMA_DRV_WRAP_IO) { edma_writeb(fsl_chan->edma, ch, regs->cerq); edma_writeb(fsl_chan->edma, EDMA_CEEI_CEEI(ch), regs->ceei); } else { @@ -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); @@ -682,9 +682,8 @@ void fsl_edma_cleanup_vchan(struct dma_device *dmadev) } /* - * On the 32 channels Vybrid/mpc577x edma version (here called "v1"), - * register offsets are different compared to ColdFire mcf5441x 64 channels - * edma (here called "v2"). + * On the 32 channels Vybrid/mpc577x edma version, register offsets are + * different compared to ColdFire mcf5441x 64 channels edma. * * This function sets up register offsets as per proper declared version * so must be called in xxx_edma_probe() just after setting the @@ -692,33 +691,25 @@ void fsl_edma_cleanup_vchan(struct dma_device *dmadev) */ void fsl_edma_setup_regs(struct fsl_edma_engine *edma) { + bool is64 = !!(edma->drvdata->flags & FSL_EDMA_DRV_EDMA64); + edma->regs.cr = edma->membase + EDMA_CR; edma->regs.es = edma->membase + EDMA_ES; edma->regs.erql = edma->membase + EDMA_ERQ; edma->regs.eeil = edma->membase + EDMA_EEI; - edma->regs.serq = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_SERQ : EDMA_SERQ); - edma->regs.cerq = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CERQ : EDMA_CERQ); - edma->regs.seei = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_SEEI : EDMA_SEEI); - edma->regs.ceei = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CEEI : EDMA_CEEI); - edma->regs.cint = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CINT : EDMA_CINT); - edma->regs.cerr = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CERR : EDMA_CERR); - edma->regs.ssrt = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_SSRT : EDMA_SSRT); - edma->regs.cdne = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_CDNE : EDMA_CDNE); - edma->regs.intl = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_INTL : EDMA_INTR); - edma->regs.errl = edma->membase + ((edma->drvdata->version == v2) ? - EDMA64_ERRL : EDMA_ERR); - - if (edma->drvdata->version == v2) { + edma->regs.serq = edma->membase + (is64 ? EDMA64_SERQ : EDMA_SERQ); + edma->regs.cerq = edma->membase + (is64 ? EDMA64_CERQ : EDMA_CERQ); + edma->regs.seei = edma->membase + (is64 ? EDMA64_SEEI : EDMA_SEEI); + edma->regs.ceei = edma->membase + (is64 ? EDMA64_CEEI : EDMA_CEEI); + edma->regs.cint = edma->membase + (is64 ? EDMA64_CINT : EDMA_CINT); + edma->regs.cerr = edma->membase + (is64 ? EDMA64_CERR : EDMA_CERR); + edma->regs.ssrt = edma->membase + (is64 ? EDMA64_SSRT : EDMA_SSRT); + edma->regs.cdne = edma->membase + (is64 ? EDMA64_CDNE : EDMA_CDNE); + edma->regs.intl = edma->membase + (is64 ? EDMA64_INTL : EDMA_INTR); + edma->regs.errl = edma->membase + (is64 ? EDMA64_ERRL : EDMA_ERR); + + if (is64) { edma->regs.erqh = edma->membase + EDMA64_ERQH; edma->regs.eeih = edma->membase + EDMA64_EEIH; edma->regs.errh = edma->membase + EDMA64_ERRH; diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index db137a8c558d..5f3fcb991b5e 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -138,16 +138,12 @@ struct fsl_edma_desc { struct fsl_edma_sw_tcd tcd[]; }; -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) +#define FSL_EDMA_DRV_WRAP_IO BIT(3) +#define FSL_EDMA_DRV_EDMA64 BIT(4) struct fsl_edma_drvdata { - enum edma_version version; u32 dmamuxs; u32 flags; int (*setup_irq)(struct platform_device *pdev, diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index f5cf95d185f8..47bfef1c562c 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -225,22 +225,20 @@ 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, + .flags = FSL_EDMA_DRV_WRAP_IO, .setup_irq = fsl_edma_irq_init, }; static struct fsl_edma_drvdata ls1028a_data = { - .version = v1, .dmamuxs = DMAMUX_NR, - .flags = FSL_EDMA_DRV_MUX_SWAP, + .flags = FSL_EDMA_DRV_MUX_SWAP | FSL_EDMA_DRV_WRAP_IO, .setup_irq = fsl_edma_irq_init, }; static struct fsl_edma_drvdata imx7ulp_data = { - .version = v3, .dmamuxs = 1, - .flags = FSL_EDMA_DRV_HAS_DMACLK, + .flags = FSL_EDMA_DRV_HAS_DMACLK | FSL_EDMA_DRV_CONFIG32, .setup_irq = fsl_edma2_irq_init, }; diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c index ebd8733f72ad..7b05e303ba51 100644 --- a/drivers/dma/mcf-edma-main.c +++ b/drivers/dma/mcf-edma-main.c @@ -172,7 +172,7 @@ static void mcf_edma_irq_free(struct platform_device *pdev, } static struct fsl_edma_drvdata mcf_data = { - .version = v2, + .flags = FSL_EDMA_DRV_EDMA64, .setup_irq = mcf_edma_irq_init, }; From patchwork Fri Jun 16 15:34: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: 693344 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 E2BD9EB64DA for ; Fri, 16 Jun 2023 15:36:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345354AbjFPPgK (ORCPT ); Fri, 16 Jun 2023 11:36:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346073AbjFPPgF (ORCPT ); Fri, 16 Jun 2023 11:36:05 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BDB935A4; Fri, 16 Jun 2023 08:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SbKUncTMSk7QyYlvG1Z352o33C5iyBSh1cf8pBeLvTzDfvEcT8G076hfG2HnIGmkrcwPIZEVRyyKtuTVTWiS5WeabYcILEbPY4jSSGdBPMgXDedJEEabdxijWd7InVKCV1rVfF2Q++3a+eLjq4P9qno1wVfrqlvcztzfg93iSxNGB05z+Mpe3+m+B4KTqktBkoJvtiieYYJv1k0lU6wo+FCckrGU9mBHbZQeCGlHNDuIjLRQGIgP7rGbidxWGJ3ZNWC3ZTU4paevtCjT+gXiZkeqcsdqYL22wQqVzs7sSrZAW3hLX8iPZaT6OiDbOFnc6MOmWElmhGh7eXJmlgNGTQ== 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=s1+6nOaISVZ89Qy4+Cr3cnXLzqMpnDganBMJUwxpjWY=; b=fgylVRpHDTE9jZitM6umYjtjscRIdveXgU0a+e7S5U1AonYGecign5IStdLTvDtqeZLYyenPYl/BhjVjl73RZnHoDVaravoUF90ghql1DN/nbSvTK3uIMfjXV/Rhtae+g+l1jiSNewJdxhNPIWaH16/taNAhM7BWltXsaCDOsZMMLJ4ZyinCKJjdtn1TV7hZUPOdKvIR54pvR+vj4C9dQNhaHGbGUTcy5SAoHZhYNLKz2M4HZ6E1N6J3Vvclz2E0z06MsIT9u0qC3fSXhcnrcr5WGiJnuwrcnVqPEURuDAYQD54JyVqvAI9n4QXX9huVALJEgPhhRvC47iLqjrUjog== 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=s1+6nOaISVZ89Qy4+Cr3cnXLzqMpnDganBMJUwxpjWY=; b=GmO1orl0d/lAAw8EgWd+psoj+wNR8YSNMn4D4nTjtTqI1ScNPRzZmJQASNXpPLivR0M1lw/JDBDpj+2DBp1Oy+ObqJ2bbKQ3rZVw6VIuVRnHFSJUrlXeqXdovbFHVzRwj4OtAyiy8fhn1pR6JrqBo+VmwsthkY1yiioE4Lp3ZDQ= 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 PR3PR04MB7339.eurprd04.prod.outlook.com (2603:10a6:102:8b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Fri, 16 Jun 2023 15:35:12 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6477.035; Fri, 16 Jun 2023 15:35:12 +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 v7 06/12] dmaengine: fsl-edma: simply ATTR_DSIZE and ATTR_SSIZE by using ffs() Date: Fri, 16 Jun 2023 11:34:32 -0400 Message-Id: <20230616153438.2299922-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616153438.2299922-1-Frank.Li@nxp.com> References: <20230616153438.2299922-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0067.namprd03.prod.outlook.com (2603:10b6:a03:331::12) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PR3PR04MB7339:EE_ X-MS-Office365-Filtering-Correlation-Id: 185a13e8-5dfb-451f-614c-08db6e7f4669 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: InVgSUxRDqiULwONQZDyutMOvepxCLUcOC3824BJJW1xsyq3UN8p9ZwE0A+RlpDfs+UAetmpeDn/uphMa036eaf80YDMbpIK9X8RzSO4GCLp8rV3lq7jVA3Jnef6NyQSqpJmaolGhpRp13FfArVucjaMfWj0eQtaP4JGhbPCz888nibHbYFjvJZLr+yfBepn5DPDPb/GHtudyfz7ngUU78u7A+WrHK9XDD4jUavaM0O1AC6fCYa/D3m/MiWtFZy4blu+JU9yvX2Qs55tWFSFog6D1PTzb6XFVtaAJbpYOxj/oyhdOn4fkzuYnrNC8lMYsKwM1/GBNwCOetQBIutnQo8rTT02YlPrmCqeCGUz0KAKTAXLlxoACJKMrD4kP0HtbKZa4sTZWdM0DtJiAPacsEpszH4vXG8bTTr/EZshjWoEfQHlT1Ut7I0nt9TVGAXln0AXZxO4i1QFw+HL96z81i1KnE6z2pRZ2okyjc0pCl7UOvnLylYrKz5IBILbb0UIfCmDMknYZNd22KmVJt25kHTSIZMkp0Zss2YZV/PUXra6ZMGWccym/urK4SwwJ1xuQoPoyJn0o/BEBp/cN9Qd8I2hfjIT62FqFnsnAz6UCFaSt2KKIX56SGhxYVCv3nFk 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)(376002)(366004)(136003)(346002)(396003)(451199021)(38100700002)(66476007)(66556008)(921005)(66946007)(316002)(2616005)(38350700002)(86362001)(186003)(52116002)(36756003)(6486002)(6666004)(26005)(6506007)(6512007)(1076003)(478600001)(2906002)(8936002)(8676002)(5660300002)(83380400001)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2oUEd+gxf3Gbq//lNqU0yWlpvVKl2Px/7r7FCpWO915qwbqpmwldP9YQ3+ah1iQTSFXaaUGI/d+WMNBR2Z+v0TmpxmFA99av2mMcY8+lw7Ec2eFJEiOGX07rXSlpLvO1K5YpyD/OngQTF00eiuMOWz5aZ+wJq+YP16/TZPNwbs59eTudGMXeJY0UT4FePXDxHTHiNbBUphYG7jAvwtYrQILLFPAlO8a7JK7scW+IdqkIBuVLFuKx1EKpbNVsuek/kFn/J5ewD9q8h3g943JL4JfcwAn/anl0mom4ybb9MavXJggb2AVG/oR40YkF4tAUZYLr5LszT/SAPFnldq/YcPeBuQoAf4iW9MJVdwSIziOgpFvjrORcrMDt5Ml5Lbu7kYs6CsoY0ruHlSBy2ywpTlv6KpDoBGX3brdMyjPkBhzG4fgcwkPG3oLEaB3qJHKf+BoUO8UfxYxT5nqp97GioEV7LAAgbKBG2iGhnMCwPtH9eUbC2xQf0XIbbqMrdh9u2Mf0wS+4lG7hOKmWnNBXtFhu1KKUuV/HqAcGpS2G2RrXPy7ATSWxwbTarp8AKpkzAInw2QV6bACtlJ0decdh6POlK8lASUZQHoKpBinrjSrFrMNia/O/18VyXgaG7CaWdE8JQDp/GDzl1TWSqvYhQuOOpSIWfLoQCdGD9CRFcszKxrJmN2mBnFbcuhzbPlkdkcAOQCi/IniktmHdVQL0/Fn0voVE/SHrCD/J/nUVpSFZV//dsBRmhelmbloI3RSi6ZDe4dKBXEJe2ket1GNkSZCk0xqoBqHNY8NBP0woQYTeovOv+VHGedzfE8ocWfPlLWqUS1pMA7jK2vrCz+hdO6tDpmPsq7ZB7GNR/rP2DZmMANEPRQ3Lw6XuShDZ3QbGqkjBl5gHZqIVWu1tUCLeqCuLiFmNVqAi6wK8kwH3YDt8TMcUlpuFdudFl+MQXOaGKvtzzH6gAMYnHh5dLe/Ox3ZYWecFed4ZNQLf716xJU3wSHu2UYO6/M+Z4Vo9EP95m3tIeHJ20AMLWF09ITTNmX+DU/QJdgZfYFJW1LMDroD4fSctYTM6at6jt3+HX2osCsv06seOVxIcn6ktr41Zcgg+cXImKFi/bxlA8DrG0/cgOk9aEAzNxemI7My4Ki1DH3qobJBhnAnonclzjs4ULfp3XTewBYW/Jk/c/i2kuDxASekhye0Ch5FWs3J15sbmBPDuw6bRSw2cohuXiFeDfSgakhARlRX4cKIga7mV7bPDu9ocIErqGY15074abBjYDDiP7RcFV5Y6IDWRNIFjI6sn2vQ0csLIyy0m0zVWmBwxCaurg8+/WLIEj0KLsXqqSZee2sVddiMEUh21e6XYze+IQbvlPiByXL1/UiuxieBqzO5uVOsqJiEHMtfPVGbebn/kcPDScKHTwxhTBp1mPheXxxKkvqheOA9OVbpTs70xJaO6YhNBhEEeI+5Y6LnGWhJwQApTneiySp1JthNE9Tmgt5v3Zdh+kOH4GiOMx3+7/sZzxxu9mLgNZGPwqid69F1VjZAKf431E8WqgofSVmIM0nvsUfscVNQk+TOH89RnVUrXY+l3HQTSLxM16CaD X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 185a13e8-5dfb-451f-614c-08db6e7f4669 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 15:35:12.6021 (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: oZJ3nyzFM0zNd/Tjwq5MdCI+MC98mlcKT47zwnlFkXAKsSTUqy6SUFJE4kG36juBhzKe3X2QNkOFRNzNgqvQIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7339 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Removes all ATTR_DSIZE_*BIT(BYTE) and ATTR_SSIZE_*BIT(BYTE) definitions in edma. Uses ffs() instead, as it gives identical results. This simplifies the code and avoids adding more similar definitions in future V3 version. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-common.c | 21 ++++++++------------- drivers/dma/fsl-edma-common.h | 10 ---------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index a9d17cf142fc..51fbd7531c74 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 242ab7df8993..521b79fc3828 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 Jun 16 15:34: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: 693343 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 C14F5EB64D7 for ; Fri, 16 Jun 2023 15:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346056AbjFPPgg (ORCPT ); Fri, 16 Jun 2023 11:36:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233765AbjFPPgf (ORCPT ); Fri, 16 Jun 2023 11:36:35 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9FBF3C31; Fri, 16 Jun 2023 08:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AuRU0EXATR/0Ck/N/Vcge8T/+qgFiYW8gcS1yD5INcCIXgDsdSYo4RUb/G4oNfR39INnFyvc+2qfNBvjcRi36hhHVJrd6VtvNFErDPv/55O7ygMSlACxPjEVEOp76gQH0EnLEu/WlldM3cpXE+ky4HALVwApJsPUyzqaxRBnW9A6kAcBtjtARd02QxGQnhIyv6vd3ETSJTvBLGkujS6/dlIHRMb9v0fwInBLLsIvX0BNV0UeiaQALflF6o1mf66lNQsagh1aBBoE+KTaHiz31tSHbYTdRwi99dlyK0j1Rhpf33aV1W3YEL7ogBAcQud+28QBx0iHlH49ikIQIfOuaQ== 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=Q3jlBv0SLDnSXx5LFjozJINPkoX9ob6AsqXt6WuD2a0=; b=WzQptPPgwJGfsoVBQsf+jSQSS8aVtQIoBARY8j6nN2DtFJJ0t9YpTYxjk31CAHJiAgLt8Ip9Z8MXkddbprWWwkPQX0ULneTydCv6npxigiyYnk2HW5dCo3eUDWDy6TdLmRcvUaI/VNHr4CfNyZAVF+p5ikj8ldDFIluQtb8JBi23PNepO2YDr1H5CN/kGNCiD6Vfdviq+rRlylluNXSKM2xup8gvkVbbIbjgK0CL5NJ9TV8xCPxSVLGkXNH6BUIxEq9NIxscwFPOguysDg2/oclyg4nQ2WaaqdHu2O95dF6LnRniZXEk5jGod/r6PwLX+X5ranEI9f13mRwQz8eSBg== 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=Q3jlBv0SLDnSXx5LFjozJINPkoX9ob6AsqXt6WuD2a0=; b=CJcQNTMTrUsFcimHHXU30G3SCngtCpng15E42SWQiwm3TyCKnkgV13qdDTaYMuRm+VSm95+vCz0wrWqFfRdmRat7m7tMFDNNtWEic+Zlb5g2YBlxyffp5QWIVTe2ujuh1+Ax0OcQ9ya+9sC7URX50ihO2wvq9eFhVklO1yKczss= 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 PR3PR04MB7339.eurprd04.prod.outlook.com (2603:10a6:102:8b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Fri, 16 Jun 2023 15:35:18 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6477.035; Fri, 16 Jun 2023 15:35:18 +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 v7 08/12] dmaengine: fsl-edma: move clearing of register interrupt into setup_irq function Date: Fri, 16 Jun 2023 11:34:34 -0400 Message-Id: <20230616153438.2299922-9-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616153438.2299922-1-Frank.Li@nxp.com> References: <20230616153438.2299922-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0067.namprd03.prod.outlook.com (2603:10b6:a03:331::12) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PR3PR04MB7339:EE_ X-MS-Office365-Filtering-Correlation-Id: b92f94bd-41dd-4e85-b4e7-08db6e7f49b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8LOqkvey9xQ8j3Qz7vYJ4w55qfS0aP6jzynCcbpOjqo2WI2A7OdC/brtjc7Ywxhk7vhAKeVmT4QbjYrNZydHDpg+lYhkmoCyVGqc3spLQ0xE+2h76MeuhxOjoebXehrtyAOqbCdYHKutLubU1BMv7ph9a/uFHRKmRJe/HiCcouGhFXtyimLnLRMIC0C1tJX1ijcqTT9KS7dl2khPUBT2SKH0IGBVeoeK3lh6V6VBrkavvaTv1M3b41lttPeggkPFAPbXTYDVFx5mWnUFOtxD7OQBLD2ziZJu81B83XINQvpqRYq9X4QgUjThP35yBJuY6moKzWAPCywiybay53uVhIG76CY2NXHOz94eLtHbTFO/pBujIu2qDOpnEJwF1C9pgCYlNuQbWrRtrshidj3uZh2y4XrWH81wOqgI+2zoQdKfiQpMGHEb9l58RQpBL/JaEk+OB14XyfcifvUn/ViUX1zHCYv3tKZrV4ISAcvaEE0oxrLbJvc58H1Rc302W2sLtHaFFLErtbTN4MIjUWPXFI5exCRfehpdSYPWzL1rhb3L3McyMd6F3BEuC2hAsW7EfJG7A6GiON0SwHpoCblW+ytl2ABd/xb1yHFggEhm0Yn7ALWQtTeMldvi5E2ZTA6uUvvItlbfiNS1KpOI/UAZxw== 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)(376002)(366004)(136003)(346002)(396003)(451199021)(38100700002)(66476007)(66556008)(921005)(66946007)(316002)(2616005)(38350700002)(86362001)(186003)(52116002)(36756003)(6486002)(6666004)(26005)(6506007)(6512007)(1076003)(478600001)(2906002)(8936002)(8676002)(5660300002)(83380400001)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lpywZzstlmufl4S3zV8hnMAKbwDSiDfUJvg1SlPoTFe1QTL+GlSfOdHhT0BMTiRXW/5PI1iVa4Yj2Tq9X6TXH4whyLvvYOnE/S4E8o037nGj7KxeZX7yr+aL2YrAx+vjFMI0JoZkvkefq6YAf8EUnpgz5QzWtm2F0CIaNCT72hAFSPIycUkOR0lIo4PxF0tsEeMQHd3vaa9J0D9GglIa3uuG9iDiL8bomLDJMKjDhmskLMufYvPqF0DeEzr7FZc/3Dj+lw+m2Na0scdnNNxSSJ8e40jqkEEjYG67YyFsBfpwIYJSHMJP8VXIIr3cgz1XnHcsrA31d+FXJF9a0RWT+XZknA52JxbbZreGnsyzJD24hMYRGlB05WqRBEQU7lyuw73wd8IuoAZUQeAwS8mX9NgNN8hV/O4tI12fK9mJ1D16YhYj1MBa26S/i2/ouJ4J1xBiYXCkxHSSFHMn8hXkFgd5r+earWt3YtJQeMTwTYqzxZuH4oUkNqmuIUEhGOwWVIaI2XvlAUEimbo0sLaDAm5fQxKL5d9aYJGihJSxy8+/piOR3W3rJcZaWJA14mMuDcCc3g2E1dK6Mx7cJDMp+nRy7cH043e8nQ95vrkzROMkITvJwGlXqffi3vQXKz6YX+QxNye1AKeZxh3SCzi7lotaQ0Kr3Jl7rJvwvmSWQ+OFVdHhb2JWRRqBYNPdC1bTDxcyXqbAtKaZRM5AumCEBM58HnCrQEFr5Lp11upJ4kl7yuDItyGqWoJZ//j81U3e38hdRiF+VojZApFr59cSPuOu0YOSeYZwFjTTz6KvnY1wkJYb6zlRoYrPUi60gmN4enqZMBy/ND6iEQywLQWZitE2ttaXqazJj/zlvge8TCz9XZsI6AfJsXge+pBk3gzi49ueQGlODCp4One2Dx4Ipr7EY6nnJ16hL8LVmggGC4S26WpSLa/GACoHOiyyB35sCxrfNvaXtR/6IaivqYIOP3GlNDaT226qx4PjA+8AySmwM8Pk32k5QqMrDHRlZqu5rwKqZZnVAVn5pGYvtzy3b2luGmhZpW7rvQjxyt9E6hgDCfW4aKCUpKk64z4GJ9jdGWFVM/QSkVw6uORUCgoPfgqXQ1BrvmvpqRxwkfHITGeKygjzdWt+LjsVd432Zt/Nq2F8ilgcvfI5s6ds0MGDOxvPyfaOzeH4Ca2QESQ7HSIBFHIgwtgyY0eLSXhCTYmu6FaL7WRNk68rkq9fXklI10p+YbiGPFcRpIk3r2nepQN07sOY5p8w8vv2eyr9vs6/FAm6JWEX2oHZsSk+JIBuo8H3TBBH6uAFIU09FVvdJfjHYKY8Hty6UCx1M6UXBBs9LNXqoNeuZC7OlNYtKJO2rePBDNCDUIj28UN1H4qzVrxE/vY9ANCSIAj3t13Pd9A48I/tV5D/SMk9q5iFPu4MNIlP7y6rZtlbaypwhzxuKRosZQDkj6y37MdmLwEaH2tRrSBsr1/Qx39PagMEbsv98afvYXSnrvr8UYMO19thcP+ZQl6N3Vc1Tk0GcoJ5efxhXUYOCDEvreN7L7FFchXcMpX4341LNaU2TElSR46xyDyfDxUDtzA/pTCnmTVHlnTW X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b92f94bd-41dd-4e85-b4e7-08db6e7f49b7 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 15:35:18.1018 (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: JSPdHUvvGHrEUxXVll62Tw75WpA0xyo6JeOnr3WyxgMrY9NICo0/Kc2e+fNT09AENReaAoZh4Iz50jOhtp1naQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7339 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This accommodates differences in the register layout of EDMA v3 by moving the clearing of register interrupts into the platform-specific set_irq function. This should ensure better compatibility with EDMA v3. Signed-off-by: Frank Li --- drivers/dma/fsl-edma-main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index 503e5ad5a8dd..e67aec3f76b5 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) { @@ -311,7 +315,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 Jun 16 15:34: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: 693342 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 4EFD5EB64D7 for ; Fri, 16 Jun 2023 15:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344514AbjFPPhI (ORCPT ); Fri, 16 Jun 2023 11:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346070AbjFPPhD (ORCPT ); Fri, 16 Jun 2023 11:37:03 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A47B3C0F; Fri, 16 Jun 2023 08:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ejaJlj3xR+dps6WmueMiXpwWEONrxR4a7tC/FU9l3b6kU7zEOIBYZC/xeG3JYgVlIe/4WSd89P2wQ14MqdNayuyusnR3uEkKbFjuCsr4i1sENL4Wyy38U4yz6Uv2MGCimUFO89GA9CZMMevW+EjDrkTOy7h9WvuTYti94XJH2hYF2NdnGbwEcjLfultj8f6W1BAKQzcheDG6nfe00NG+8bhnzZcfwAdeGf92IvEaWdRgXP1XDHctZXbktX0APjySS1qnzYd18EgZ9UCyEfkjPoXb19VuAjoj91JK1siR+Wa9ws9+VH/5XurXjOHZND/Gf+3pjcYKuEeiWRa5+IrDkg== 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=LwWZJ1o2vN7Jj1Wd6gxZKukLqr0NduZpRCO/jcgnVtQ=; b=GJ64CVVselD7dUxy8QCXfqFLI08bxpH8NHBOycTI9zxlBWYsDU0kSWvLeN3IC2xiMauvWfxYLY5ufgKD/3nNn1GVU9wmXK28XZ4OddyJV2A4v/VtSTSaL5BkqV7+PBiOqd+iMYCtXRQtFmIRNvi/Rd5+AUYYAlbK8RcWJfDK/WK5e9gz0G9DFZQ2dCOSUeE1mggoOAMyP5qZTcZ+aNfpgd20tyHIXqzzM6BpnXYsAS5rFcLAj8Vjg4XeoHy/KmYMSHS6/PwzoJG+gpffLwAxCce07CD7QdkC0DgpOlTqaNC3H406De79IfoTJTaYMCU0RuuBWHWbFrGWI87PWuBMBw== 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=LwWZJ1o2vN7Jj1Wd6gxZKukLqr0NduZpRCO/jcgnVtQ=; b=jP3ch+5h6mDGQNj8/n4nosztz+sczuwmjr1zKyoP56XgjRwSKsJ+1BD2kYhNm2gGK7pS3t0Wu0Y1KvxbeEpkCXhpLUtReETNiTRGiQfBdnPJ0GajpM/OLjPD2VrNGIqveBiVzv1gf3eIeiJ1fQGbML0KR91a4I1hEggOBg581CY= 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 PR3PR04MB7339.eurprd04.prod.outlook.com (2603:10a6:102:8b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Fri, 16 Jun 2023 15:35:23 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6477.035; Fri, 16 Jun 2023 15:35:23 +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 v7 10/12] dmaengine: fsl-edma: move tcd into struct fsl_dma_chan Date: Fri, 16 Jun 2023 11:34:36 -0400 Message-Id: <20230616153438.2299922-11-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616153438.2299922-1-Frank.Li@nxp.com> References: <20230616153438.2299922-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0067.namprd03.prod.outlook.com (2603:10b6:a03:331::12) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PR3PR04MB7339:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f7802b2-e41e-455b-4204-08db6e7f4d20 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BJeP33faT6vii8tWWnydh8f2BzQ0b7lyJCiTX7OTQVQI+Ndx8yNp8L5eF/gVBCAUeYUEmr1sXJgpIf+Rr5/nK4pk9Hod/Re18enpZ/dyGPhoNbS60nonqgqYnz+QKcrHTOvWGdLt7wmJ7L7ujTu3hWGuNuNg9K8yv80sChk4OAA+wg+NhXnvnhAzyPNgxIxkw9hghgzc9tT85vqD2YeTjx2rHbQt8sV3ApDvcPQRLP1ayhsgq+YVMjn+ZjfoseozwY1C+YPydRs2rd67OgmBx9kFtimANQkMZqOhJDefNzxUzLaGqG54BRoERx3az3MJTpY5Os6NBx/tjZndDlo1jsgWCgY+ZtP9dwERHSIn0Lb2Dj8T29y7wEdDZIKtLz8h7CjShlRnd+FT9+8fHiXi8pwDGSgWbpnaHEkGB+ZG3Kiep6VrzEYg+rb7ft0fCRW6Hi/TQRpagE7FmBeRS10gbYXbRtCmt9qEXlVxUgebME/VRryKnEtFOBXfsq4q5qj9pSyvZ8fHqP7l/JTC5X01TQ52RA9WrTBijtHm0mmfTQzbn4Flce56i+tVPU/tPmXyBpZ1+rmevoZeXdA7HoDLbOT27Wg+hrQnygZRCXHh0qpbe8r93wbwHVr9VPZSIxuJ 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)(376002)(366004)(136003)(346002)(396003)(451199021)(38100700002)(66476007)(66556008)(921005)(66946007)(316002)(2616005)(38350700002)(86362001)(966005)(186003)(52116002)(36756003)(6486002)(6666004)(26005)(6506007)(6512007)(1076003)(478600001)(2906002)(8936002)(8676002)(5660300002)(83380400001)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Me1gvLefRBRNp61LzEdO+9wRbB+PWsCLXi0gC2z539CKLPEQUGCPFc2J01DwZktxkWzQafH72rM3QGs+kyKtk0bBETSTht1LCJBK/2O00OYgwpMQ8Q+xfrvTxHWmNsrUsPVpeQzCvur+XHwFcnRDzJgMtBBctIlc83JSz5ehPdJ3oo98oH5DN6g6uKm8m8vwNltKu4lnCIRNZf9E5SCNsUkmWJQ+rQ/TuzQIfeRS7mR9uFAOPoyrB+DWg5zUWcdKgnSHkhYwPS+KkXTRTRbw/3zSPC03XxZQjRBc+tRTVxO5QwqtC+YdKTe1LayrVZEzPUuwqw5ZdgSo2AT5HPUQassi+DYYrUnHpqnYE+zARBoud58dT0zCBXyHXAbXH23N0pitRq73OCjg6H+pB2hk/bUfAN1HlPggi5UQ/x7LcEPIcztuhfEH2UDMwv272DnOKfK78IZEqSWrOA15iHYYJcUr/5rw9UBYbCxJ3zp+ggf2tVKnWE+VCpjXuQ4SWk8M1zldmeC4rVHse97OZR3xFNBdllmZzyEnTAUp42D7177+m4tVlplC24T4BiiuX7tuQOXlFa7xNplmjlLsCHtHaMxuV5BhRCLjIEo8LswBPFkVzcNwLdycxh5De/p5OwiIc3CyFvYStHGixeCbzg7RxRiMOSph1diRckmw0wlw27Htvp/tJ1xare2ckbIKnI14FjTJnIKVLscKnO0QN4xWkZ7mBYsBPDDPU3IwBzY9g+G0St7MQRws4597FxqdQpPMini8WpTeMEjkkvuliIoZhZjjEvt8y2U96Ldj1VA8GHqQBAAwxOHawzPuOGCqlbgziu1/HLsVmMDQxNgU7GTdYQIWS7YhgpioDYrlM+3tszhRBMwTLxxxHd6/TaoPOqODA+QCSzDxf7JidGhQ6Feu9vytgy4YUJU3mv61kJVaUHP+d8F16VtqLFkhH+YXVKLgxVMHr+0s7JaQU6AXIGJUgzWeFXWXRCPL37u0XkJzj8ayWuJQFmZ1+AtwDubBADu8sf8YCRyfmA4cB8DCikckcAdJmdGDt4NoKDO8rhwpgvtAIXVVTSFssaH54m7eDZouzGo9KQyxOKI5Z64HMZb+2GolRWkYYfxgZrRsPFZ5ceED0Ya8la+wDE4HkQlIUTfhvjFZB+1Mu8eixrbIiUd66GsvuV2GORJObPQPaNxvXuPAWzqS1u0ohHSQdUaT5TRNrtrF247Fft95UO3vsSAjkvDMGnXXPpY3N+ONqbnp06zCT8V2yuD95OCXWWval159Bdr5TRA0a9e4HgeYbP2sGLhIYA1BXyna97aTrUp5mD7jQYV5HYY9C+LKrhGPwQglAM4zfKsAfgroVVECfSBuwcekXxz9pXDzW5A3kVE3cyj/h1fcO5Mt9vubcxpBHPdZ84wYiwQv0jhR1oopd50+iF6pGx0y+v5UmUWP3f4cEM0N9sDKb/x+crxPvPxEKiYXLgXUcPxLYYChDvdbaceWVafELZatak41hEPU8DBHFx2lTtXC49HISrh97e+XLQ83tKAK2kz7UrYqVy+31wwIaP31ju/OVYwrzjtBwvmhcF4GrvaMroT8oN5pObue3ECc X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f7802b2-e41e-455b-4204-08db6e7f4d20 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 15:35:23.8721 (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: TxHYCUC5Fv7Wg2hNpXdrLGUNkhLThExbssZncjgHxlmT6teRhNBvv3yxg5AnPn8EGXqV16YqcCwZyflSNS1eIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7339 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Relocates the tcd into the fsl_dma_chan structure. This adjustment reduces the need to reference back to fsl_edma_engine, paving the way for EDMA V3 support. Unified the edma_writel and edma_writew functions for accessing TCD (Transfer Control Descriptor) registers. A new macro is added that can automatically detect whether a 32-bit or 16-bit access should be used based on the structure field definition. This provide better support 64-bit TCD with future v5 version. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305271951.gmRobs3a-lkp@intel.com/ 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 51fbd7531c74..eead6a4765f7 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, tcd->saddr, saddr); + edma_write_tcdreg(fsl_chan, 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, 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, tcd->nbytes, nbytes); + edma_write_tcdreg(fsl_chan, 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, tcd->citer, citer); + edma_write_tcdreg(fsl_chan, tcd->biter, biter); + edma_write_tcdreg(fsl_chan, tcd->doff, doff); - edma_writel(edma, (s32)tcd->dlast_sga, - ®s->tcd[ch].dlast_sga); + edma_write_tcdreg(fsl_chan, 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, tcd->csr, csr); } static inline @@ -736,7 +728,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 316df42ae5cb..cfc41915eaa1 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 { @@ -156,6 +158,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, (u32 __force)val, &chan->tcd->__name) : \ + edma_writew(chan->edma, (u16 __force)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. @@ -170,6 +182,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 e2fbfaf9155d..8ba705080f5d 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -310,9 +310,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); } @@ -419,7 +421,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 316e637b00c4..bccb5448e492 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 Jun 16 15:34: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: 693341 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 4998CEB64D8 for ; Fri, 16 Jun 2023 15:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346095AbjFPPhi (ORCPT ); Fri, 16 Jun 2023 11:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346098AbjFPPh3 (ORCPT ); Fri, 16 Jun 2023 11:37:29 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D7FF3AB4; Fri, 16 Jun 2023 08:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T/TIqBpURkn+vR3CSiot45a2yYU0Z1PFj/jAvWUBz5KGRPejUBsaclCwhzHlsSe3uapyJFBgqFnta9631eXIJcfazuC9cQJxnz5kGx8trQAuyDWTsXDW6VjCHy+kKt72uzIGonCOJKaWpXvRJuJG+fDFNq0IH1Xn04+NtAQaaoNPdKpmm2pppgDRUrlmV8vALtBkxCVULZJmu1CFsKTF+F/sTbUBrqxsXmHfMcCe4h2s1jfhcelYOvMm/xyhc/B5y8Qf2/ZBnTbE7UzwynzGBdqH/csSwwiKIp/B5xH78omx08FMvo5kTr/ni03eunOl4+EygOVUx++her3CnNS/HA== 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=k3KdPkFxbxRga7c91LrqNvK4Hz0q3Yle4Y9zd3COpac=; b=RG6eYBI2wyi3qyp2luxbEB+rXhM0W1lLrnej/2WBVlBomj9Dk4AuephPVjkK2j3Eqjd0LC1umvPsj2USkWMX+YNZX8YqjwTPhJ2YVY4VI5qcB1OKd3+jdKSBcTsmfSyykhrgTUxzTckeqWZ7x3vAlKyvqvYn3qI4MInu/EPOPJBqbPPsZz5vcWLtJ46AH53MHFYEjWxqfHgs/BRFuFdClS2FlXQGolRlnTT4oQa9URH8NxrvUm27haDyPrfMF5+2OtU7Kjy1pIzlO7mtovxFeqgtzRkQm2Zs8DRA2NVa+3f3VWNmf/68zan9AdDPUbOv1lFSrHuLmuSUH30Xq7N1ew== 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=k3KdPkFxbxRga7c91LrqNvK4Hz0q3Yle4Y9zd3COpac=; b=DFz7TO7c8/Ww5XISO2m+Il/D2RtGLgKWqqLhL6UPSf49tnNYiC+LET/SJRTMT4ysv0JbSLk0HwlZKdQsMrBR2UQG3UidlqCRdQmDpOL4rTLvh+1UyrqnLpLc+C18k1Ax4P7j46f8SZjaNgPX9jjkBAo6pLigc3vIqDVjmIyyPqM= 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 PR3PR04MB7339.eurprd04.prod.outlook.com (2603:10a6:102:8b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Fri, 16 Jun 2023 15:35:30 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::4a2a:262e:415f:e41c%7]) with mapi id 15.20.6477.035; Fri, 16 Jun 2023 15:35:30 +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 v7 12/12] dt-bindings: fsl-dma: fsl-edma: add edma3 compatible string Date: Fri, 16 Jun 2023 11:34:38 -0400 Message-Id: <20230616153438.2299922-13-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616153438.2299922-1-Frank.Li@nxp.com> References: <20230616153438.2299922-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0067.namprd03.prod.outlook.com (2603:10b6:a03:331::12) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PR3PR04MB7339:EE_ X-MS-Office365-Filtering-Correlation-Id: 592b3c3b-8171-44e1-7b4b-08db6e7f50d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O+Rcq8l23u6uQI7J/oRDNeCet6VzYesO/lFH9FiOIaQ4E1JXJG5t3VETniRGWljEDUB5rT/orAoWeUFxqrv96tE8zSle36kaifVF9/AMc8No4OA+CGHyTv2Rs6PdjGhS2SOJvBBIvfVDv8JmnZChVM8L20ycNwpcswf5cP0PwshNG3rFkVwFFyqmCcqy3GLp/mgDfvgh+MCiF3my/Icb+uST/ueuv5Vd5C9rwKzudd3eww1x15YHiutiAgE+uHyshtUqRVdgAFSLU+Y4cnxdyZaHe0yjn5SxqLO1nPk93UlTVMjoLlT8ho+qfv6CwLOLZON9os0hr+W8LAFFYGQiqjpU8mR5BRxHKTsNvpdzs2E25kK0+QpZkYHy5gIPr9Es7iQaDJOY/tm0DLxImVD0TxJXh9rpAPlzzzXWnCboBsbv9prJvsLbOLNhCe/XSjRRIvJ8a1Q6MeAelhUyYk871jUSHCbUmfCkyAgR4f/EABRvzEPtnQ+3DrGSoc1SBwILhnJYKxP77UWPDqtFOp9X8mfIV44Jvwcr3/cqlJq/EcXbIRYZUlkFToKMzRyHoKPFtpXo6utvQ8U1hQiXTlhZjzRGWKsh/GcMp2USnSUFAQNy6RF0ov9IYMS6vdoWUF9o 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)(376002)(366004)(136003)(346002)(396003)(451199021)(38100700002)(66476007)(66556008)(921005)(66946007)(316002)(2616005)(38350700002)(86362001)(186003)(52116002)(36756003)(6486002)(26005)(6506007)(6512007)(1076003)(478600001)(2906002)(8936002)(8676002)(5660300002)(83380400001)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +TfYzHgEIXwwfsCfS2yL3fG4xeQTBvfCdcLCIqz+s7LLD1CPVlz9ImQkdladQF0YnfxoW0GsCXqRFBUBa0Ztls2YgR7ibdYJTZ4acoMv8jnzu339J/vVWbfalCLN5Ocv/11IsLUMrMyFvVx82ncRcUujHfmw/7FPuc9MD9LCX0Chc62BHzSyqSw9meSEH4LM4Ys6KaaIgDxLQ1+71M2svwzg4136E0SKomK8VvEL31FHY5IjfqZsW740aw0MWof5fqPVYusWuoIpHphBYeHTnYwNQcmC+YnC5tobgC8S4/xiWzXm3P6rLLpgP5F1L8kIW/YElrvgxOPlRFWQ7/iPbC1qZZLst8yb3P77dZSbO1ENkQXLr6R/r/V7+29yichzjVy226qOFUmHanp3TN9nHITZExuBbthFs5w4h68NLpwgtCeo67zDVtPFFaJiNN0v3fOukdzyo9vZolrZRCJyW9RQ7qiHVbX3SPDWe/wH8JVUbCD5TkWKfgJoJigy83y5RnfThr2n5miebl3E7OOKrBvbxSxRV5+7PtDKH23xY2zlDLTU/Qb3jL3LPgh2tPNXV7JsF9pAcZgtzrPKK/xT7r8+cGITT9n546lKBWVVdrxyxEAUEJivzocHC2I7wWkZYsB800WqeRE5rVVRHuVkFR85L0QKq1spXQ3pt7cMNGRnYAkveEX2D1/a83o2bygIGE2CSxNfk7O6bxtNG/SfAwW20dIWJJ9GEgdFpQLYGlwy+BoV0fg0wYgA/iWVhpZG2LAtr4hE7IEWJwrxPu3RTwumWZBRZshqlvTBisN7V7FlGhNY7ZQt2c8vnFPuPbMFaygoqdPHe3M+Vrh2aj/cJtmp6/pwL+l32ioCA/1E3vQq0JjQxOeVCLqbhZZ6Q5Wk1hcOVorlbAlmkMZdWhFpvf3nHqPcMb2yhZ9htzINvMGZ84w9auePsEqdP8LKCZtvtsnzY2SRZXGbDUYKas+MXVSn5PawA3UYcBGzyxa7IGOH1fnxOC2dp5C8derIy/vj0dhIwpQvY9BEqKOLkMYNzZucj+Oz2aowDzrb+TT72S/STom7sxoJIR5K1oEodJUAm4dK8eSCNKTXwC5+tunsWaZ4wzDe/Cs2QE0hZqjCdQ2vQvyRfXzAsK8y92c2rteQD1+i56okqj1o7SF8+eWrwZ8GU+rQDIF6IKcj5tgozRqTI55Fs+D2NHz/0IDT3U/ae5aEFqq8JIwZpithX7zuVZ8Tk//99Ob7ECO353mY/6xvp0XVaYijP/y0hlgpCjVr+EoUOz98ylTQwgsfvHFNdaLbfssxwgedGNytRhQsepaf/yD4sFB3/cK7pIPhqrIVOC1D+G+FeEFB71OainBYg/g9clpDHpXmD5sZGq+LTwm+lZHtmeatjLc6gt4MVuj/SaUimOl0sV+2uoKkarV1nXra8BjewHC91xGAJohk1+1m7ZZRfal44SAZ1dSGOMMpPWPH9KeWTAoQar5n1qvJufBRHRzyH6ZLXYgPVBby7wF86QSHE4XBM+QA9lYOcijS7wX2lMq+nOeGC3DOumF9bA+9q+7d53Ri2mSL6nI+JYk= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 592b3c3b-8171-44e1-7b4b-08db6e7f50d7 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 15:35:30.0914 (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: BAa2gM614DNrolBiui7Cy6hyYqvbbdREBOiPXDOHLhqrdrBcZ6jwSGx5r9wluf2BxapU6+cCErxywfZSh5vhWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7339 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 | 103 ++++++++++++++++-- 1 file changed, 96 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/dma/fsl,edma.yaml b/Documentation/devicetree/bindings/dma/fsl,edma.yaml index 5fd8fc604261..2363c10e0d1c 100644 --- a/Documentation/devicetree/bindings/dma/fsl,edma.yaml +++ b/Documentation/devicetree/bindings/dma/fsl,edma.yaml @@ -21,32 +21,41 @@ properties: - enum: - fsl,vf610-edma - fsl,imx7ulp-edma + - fsl,imx8qm-adma + - fsl,imx8qm-edma + - fsl,imx93-edma3 + - fsl,imx93-edma4 - items: - const: fsl,ls1028a-edma - const: fsl,vf610-edma reg: - minItems: 2 + minItems: 1 maxItems: 3 interrupts: - minItems: 2 - maxItems: 17 + minItems: 1 + maxItems: 64 interrupt-names: - minItems: 2 - maxItems: 17 + minItems: 1 + maxItems: 64 "#dma-cells": - const: 2 + enum: + - 2 + - 3 dma-channels: - const: 32 + minItems: 1 + maxItems: 64 clocks: + minItems: 1 maxItems: 2 clock-names: + minItems: 1 maxItems: 2 big-endian: @@ -65,6 +74,26 @@ required: allOf: - $ref: dma-controller.yaml# + - if: + properties: + compatible: + contains: + enum: + - fsl,imx8qm-adma + - fsl,imx8qm-edma + - fsl,imx93-edma3 + - fsl,imx93-edma4 + then: + properties: + "#dma-cells": + const: 3 + # It is not necessary to write the interrupt name for each channel. + # instead, you can simply maintain the sequential IRQ numbers as + # defined for the DMA channels. + interrupt-names: false + clock-names: + const: dma + - if: properties: compatible: @@ -72,18 +101,26 @@ allOf: const: fsl,vf610-edma then: properties: + clocks: + minItems: 2 clock-names: items: - const: dmamux0 - const: dmamux1 interrupts: + minItems: 2 maxItems: 2 interrupt-names: items: - const: edma-tx - const: edma-err reg: + minItems: 2 maxItems: 3 + "#dma-cells": + const: 2 + dma-channels: + const: 32 - if: properties: @@ -92,14 +129,22 @@ allOf: const: fsl,imx7ulp-edma then: properties: + clock: + minItems: 2 clock-names: items: - const: dma - const: dmamux0 interrupts: + minItems: 2 maxItems: 17 reg: + minItems: 2 maxItems: 2 + "#dma-cells": + const: 2 + dma-channels: + const: 32 unevaluatedProperties: false @@ -153,3 +198,47 @@ examples: clock-names = "dma", "dmamux0"; clocks = <&pcc2 IMX7ULP_CLK_DMA1>, <&pcc2 IMX7ULP_CLK_DMA_MUX1>; }; + + - | + #include + #include + + dma-controller@44000000 { + compatible = "fsl,imx93-edma3"; + reg = <0x44000000 0x200000>; + #dma-cells = <3>; + dma-channels = <31>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + clocks = <&clk IMX93_CLK_EDMA1_GATE>; + clock-names = "dma"; + };