From patchwork Mon Dec 16 07:58:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larisa Ileana Grigore X-Patchwork-Id: 13909334 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2041.outbound.protection.outlook.com [40.107.20.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0ECB11FF7B7 for ; Mon, 16 Dec 2024 07:58:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734335924; cv=fail; b=MSFOZNJa4c1/gvPpjPy4n9YH3OWALJRWqdUBlUEaWN7q+gflISwxXJOiYAuVkHy/GwcRBN0jDe6MJuN3jV94kV66Rvglrwkkf4i6+atliqgEU9OFN3qQuygcNcc3ojIE8IkTtAeVN72dwzkLQ5zc3yzjgdCMEdn+rA5hefclIoI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734335924; c=relaxed/simple; bh=NBoQw/AdDf2L/90aAfoyiXpqnbBFwZm7q+nVg3ewCjo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=sQGsNX7pXIFTujke+AeMgApcxn7AyrtfXEvqR8REVpsDc8pcEiS95HkElFW46zGLc7h9s7SdMTpML3VRUb2LZOmastcWdzWee7ZFXtoJkbeY9AmKNtn+azTyu7h5lqFk9MgHecGyATrQ8jHTDWmF3zMnU6Rue9Fa7BP3Vz02KAI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=qVQmPqYO; arc=fail smtp.client-ip=40.107.20.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="qVQmPqYO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zQlcc7mHUo/kzF2ZQrCfkYQo6PQye1k+npgKVKA43ubGKfPW9xQlkgEAhZgyl/fC+wEvlx7nnM+Yx5mTLu1E1hH093PHrTAehyDnYMG/FFne59ybeYR4TBbztMfS4lofV0xngwwp8v+NHeV4czQ65s17PCuT6s8LGaycNOW7+4B5s7Cl1wR7g8U+9L0dSqYsHsu059GIAsIyl00dVOvUPADJH/1Tzw1R3pj/nPRDo37J8RbuNpEzw8tTi4gnYDuq9VZ77vx0aeVbiNjIREgnSm0tpfdjuhCuWaikbZAsciQv0QAMLT/2rTHIm09KKapFjcviPQIz6I9qFwONqrw4eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wHxEgU9gLnV0LuycV1V4GglatHZ7PT7InM7xeDPyKQc=; b=SYyY82VzoVYN2JQRtIg77eaLBK8AL4ZPGeYx7qzS72b/dKBqWu5kGQ0bguX5yisCesvoy0lAzy1yoVXF6K0+S86u4s233SL2/FhUbnuUnvM5ZQvjViBLtzskDGEg4ubXSkirLr4yEL4UyuAtuw6ZIP46Fu9UCkn72/J2RfEv/aPGwMJ5BXqIBvvI9R7QDC9xIwFBa9+uXlS9HWt2k2eggshoHC1pwAfjq4tkqmvaaKMuPAwqVgRKZCTYqDesvZRohiLTOh82JyQ/05MpJy7PFzBxS3mTYR0/0WkqAVZnyRJ9RPyHt3EPejz0jqyuFx1FyUH2axAer3MBnJPtgGwE0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wHxEgU9gLnV0LuycV1V4GglatHZ7PT7InM7xeDPyKQc=; b=qVQmPqYO+I/u8FZqOMz6t04QHhDyb3j+ckqtmZ0jfthZb071Z8aeMmbdEUvlj2ZcZT0Ge2MPiDUcuG4wxXGpNKLDQk6I0iBS4npqrYnCWIL3fsjPD2hauWCVhJQ/yTdwgUgNzmiQzkBQTx2qqVeGhZ1oVkv1KdAMqoMBZ75w1ajfWkESZx5IYu4nd+zEZ9bPDq8Hj6nJjWPX1rsoaTpyfsnEyHG7GPdo21MUA4yh9/6zVECUkBbs6vQ9JLYLneSU3t+NWbG95nyLUsGn3OGzUiIjnM0fLQN0aaDikKUqFIjOZ2AU9iYUk0pB2dmJCahCRovojpKC+4oXzP6/oMMXkw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AS4PR04MB9550.eurprd04.prod.outlook.com (2603:10a6:20b:4f9::17) by DU4PR04MB10361.eurprd04.prod.outlook.com (2603:10a6:10:55d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Mon, 16 Dec 2024 07:58:36 +0000 Received: from AS4PR04MB9550.eurprd04.prod.outlook.com ([fe80::e28d:10f8:289:baf7]) by AS4PR04MB9550.eurprd04.prod.outlook.com ([fe80::e28d:10f8:289:baf7%6]) with mapi id 15.20.8251.015; Mon, 16 Dec 2024 07:58:36 +0000 From: Larisa Grigore To: Frank.Li@nxp.com Cc: dmaengine@vger.kernel.org, imx@lists.linux.dev, linux-kernel@vger.kernel.org, s32@nxp.com, Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Larisa Grigore , Ciprian Marian Costea Subject: [PATCH 6/8] dmaengine: fsl-edma: add support for S32G based platforms Date: Mon, 16 Dec 2024 09:58:16 +0200 Message-ID: <20241216075819.2066772-7-larisa.grigore@oss.nxp.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241216075819.2066772-1-larisa.grigore@oss.nxp.com> References: <20241216075819.2066772-1-larisa.grigore@oss.nxp.com> X-ClientProxiedBy: AM0PR04CA0076.eurprd04.prod.outlook.com (2603:10a6:208:be::17) To AS4PR04MB9550.eurprd04.prod.outlook.com (2603:10a6:20b:4f9::17) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR04MB9550:EE_|DU4PR04MB10361:EE_ X-MS-Office365-Filtering-Correlation-Id: 394d6c98-f0cd-48be-5d20-08dd1da771bb X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?otio6rCCE72gzE6HapwcuyoYvsyyFDv?= =?utf-8?q?NZuCxfYKq53dzt7YBWLbkkgsuhSfeS8vHqQXHDXMDMAIwPJdY9SGoOZcYbzu4d/IB?= =?utf-8?q?KV2Jwt6DhIpU8jy1n/QwjHb0I4amBP3qtsB9uAvl+EVPgk10KlGqUjfnDfhbzdKfE?= =?utf-8?q?9SYc74t6FGzbP6bJ4jvRWcnMn5rF5ML5O3d77JwebKU9s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eDl3aqLpq2Tmpn4aJ0WTl8?= =?utf-8?q?H5RqwUUTPnm8GQGyubMKZFFTssvTagYOLXeY5+NrNoGuVpa9Ju16GIWxAb8gRC070?= =?utf-8?q?UXsD0bh//18ErMCwap4XIS4YlpzTx5PBDm8gVgz0J7MIuchvYvTcExhhBjPc/kn86?= =?utf-8?q?xv50mwDwScIvyRYw8hdK12lneX7RfZRPKRnelVXkmWN7Y06KNGt5YuJPDTuVaiY4E?= =?utf-8?q?x96Z/H/AxxiN59uidFCKJ/g5jCTogg+5SNAUuQcxu95Zq+OLLeUbz5C5eBq5mH3Dh?= =?utf-8?q?dfN95kKL7FG4?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR04MB9550.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?I5F6LErCBHLMJNlTb0oRdy4ydlBc?= =?utf-8?q?ltWri4o+WrURjQAWsIYjLpUiYwyMLvnpr9KQsjdRx4EM/svxrFWv1+miquo0WjBxh?= =?utf-8?q?9myso6P567bejX4GhbCVrKO6LiQVbc1IyT7osiaWbO5JSc23WqsrAEAH9soU48/H6?= =?utf-8?q?PrhHsTy3BUXmS4g72X97CGVts6qyyPTFMkBRx4Q9lWmrqaalcnq9nkNEXWvGX0q9k?= =?utf-8?q?Hrlrq5sVsBkv4j2AIKocM5uQARELBTlgmxoJ2S4jZYJQEPxdVqvFHDON/CdRERuZz?= =?utf-8?q?wMkgIvIY7sJabslirOmPRM/lOKkO+6PMmeOd53BnCBkg8x+l9SqjOM0vOxJm8fWpB?= =?utf-8?q?ef+b5qXCE073WPMvdZSf5+zs/N6SeLWAvhIcQ+FAAj2KxhxrZTStqv7TAigqzS/1J?= =?utf-8?q?tE6odocLpYk/P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t1UgR26LkaElKLo46WkMKf+2McekWW3P5OCR49fobrJM8k?= =?utf-8?q?mN7HYyScWgu+w1gmlpmKxwW8n2O6BQLK6bnTRGo2CnB/CCFKZcilqyxeBBMZzuSgk?= =?utf-8?q?E1x7oUHeNUp9aCLr5yIjegSr0a+pBHhTM7OuD2KXQCXo6OYM8Nuhqq8EDgD0mcyKx?= =?utf-8?q?KTrd2WJdD/tf/vFP1Wh3G0ePfLPrbV89lyXFxJgGdUWK+NomWbcDAGM+y15h6A1i3?= =?utf-8?q?QVwhebDZ11bN?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 394d6c98-f0cd-48be-5d20-08dd1da771bb X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9550.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 07:58:36.2765 (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: b2MnQBQUjOfbXzLZV5c3NTtocEv+PJcqUlW0q4vfiNA+V66TmGMhiGLvDtvfRgJbZlWRUO6L62ijdEdWJswP9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB10361 S32G2/S32G3 includes two system eDMA instances based on v3 version, each of them integrated with two DMAMUX blocks. Another particularity of these SoCs is that the interrupts are shared between channels as follows: - DMA Channels 0-15 share the 'tx-0-15' interrupt - DMA Channels 16-31 share the 'tx-16-31' interrupt - all channels share the 'err' interrupt Signed-off-by: Larisa Grigore Co-developed-by: Ciprian Marian Costea Signed-off-by: Ciprian Marian Costea Reviewed-by: Frank Li --- drivers/dma/fsl-edma-common.h | 3 + drivers/dma/fsl-edma-main.c | 109 +++++++++++++++++++++++++++++++++- 2 files changed, 111 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 52901623d6fc..63e908fc3575 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -68,6 +68,8 @@ #define EDMA_V3_CH_CSR_EEI BIT(2) #define EDMA_V3_CH_CSR_DONE BIT(30) #define EDMA_V3_CH_CSR_ACTIVE BIT(31) +#define EDMA_V3_CH_ES_ERR BIT(31) +#define EDMA_V3_MP_ES_VLD BIT(31) enum fsl_edma_pm_state { RUNNING = 0, @@ -252,6 +254,7 @@ struct fsl_edma_engine { const struct fsl_edma_drvdata *drvdata; u32 n_chans; int txirq; + int txirq_16_31; int errirq; bool big_endian; struct edma_regs regs; diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c index cc1787698b56..27bae3649026 100644 --- a/drivers/dma/fsl-edma-main.c +++ b/drivers/dma/fsl-edma-main.c @@ -3,10 +3,11 @@ * drivers/dma/fsl-edma.c * * Copyright 2013-2014 Freescale Semiconductor, Inc. + * Copyright 2024 NXP * * Driver for the Freescale eDMA engine with flexible channel multiplexing * capability for DMA request sources. The eDMA block can be found on some - * Vybrid and Layerscape SoCs. + * Vybrid, Layerscape and S32G SoCs. */ #include @@ -73,6 +74,60 @@ static irqreturn_t fsl_edma2_tx_handler(int irq, void *devi_id) return fsl_edma_tx_handler(irq, fsl_chan->edma); } +static irqreturn_t fsl_edma3_or_tx_handler(int irq, void *dev_id, + u8 start, u8 end) +{ + struct fsl_edma_engine *fsl_edma = dev_id; + struct fsl_edma_chan *chan; + int i; + + end = min(end, fsl_edma->n_chans); + + for (i = start; i < end; i++) { + chan = &fsl_edma->chans[i]; + + fsl_edma3_tx_handler(irq, chan); + } + + return IRQ_HANDLED; +} + +static irqreturn_t fsl_edma3_tx_0_15_handler(int irq, void *dev_id) +{ + return fsl_edma3_or_tx_handler(irq, dev_id, 0, 16); +} + +static irqreturn_t fsl_edma3_tx_16_31_handler(int irq, void *dev_id) +{ + return fsl_edma3_or_tx_handler(irq, dev_id, 16, 32); +} + +static irqreturn_t fsl_edma3_or_err_handler(int irq, void *dev_id) +{ + struct fsl_edma_engine *fsl_edma = dev_id; + struct edma_regs *regs = &fsl_edma->regs; + unsigned int err, ch, ch_es; + struct fsl_edma_chan *chan; + + err = edma_readl(fsl_edma, regs->es); + if (!(err & EDMA_V3_MP_ES_VLD)) + return IRQ_NONE; + + for (ch = 0; ch < fsl_edma->n_chans; ch++) { + chan = &fsl_edma->chans[ch]; + + ch_es = edma_readl_chreg(chan, ch_es); + if (!(ch_es & EDMA_V3_CH_ES_ERR)) + continue; + + edma_writel_chreg(chan, EDMA_V3_CH_ES_ERR, ch_es); + fsl_edma_disable_request(chan); + fsl_edma->chans[ch].status = DMA_ERROR; + } + + return IRQ_HANDLED; +} + static irqreturn_t fsl_edma_err_handler(int irq, void *dev_id) { struct fsl_edma_engine *fsl_edma = dev_id; @@ -276,6 +331,49 @@ static int fsl_edma3_irq_init(struct platform_device *pdev, struct fsl_edma_engi return 0; } +static int fsl_edma3_or_irq_init(struct platform_device *pdev, + struct fsl_edma_engine *fsl_edma) +{ + int ret; + + fsl_edma->txirq = platform_get_irq_byname(pdev, "tx-0-15"); + if (fsl_edma->txirq < 0) + return fsl_edma->txirq; + + fsl_edma->txirq_16_31 = platform_get_irq_byname(pdev, "tx-16-31"); + if (fsl_edma->txirq_16_31 < 0) + return fsl_edma->txirq_16_31; + + fsl_edma->errirq = platform_get_irq_byname(pdev, "err"); + if (fsl_edma->errirq < 0) + return fsl_edma->errirq; + + ret = devm_request_irq(&pdev->dev, fsl_edma->txirq, + fsl_edma3_tx_0_15_handler, 0, "eDMA tx0_15", + fsl_edma); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Can't register eDMA tx0_15 IRQ.\n"); + + if (fsl_edma->n_chans > 16) { + ret = devm_request_irq(&pdev->dev, fsl_edma->txirq_16_31, + fsl_edma3_tx_16_31_handler, 0, + "eDMA tx16_31", fsl_edma); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Can't register eDMA tx16_31 IRQ.\n"); + } + + ret = devm_request_irq(&pdev->dev, fsl_edma->errirq, + fsl_edma3_or_err_handler, 0, "eDMA err", + fsl_edma); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Can't register eDMA err IRQ.\n"); + + return 0; +} + static int fsl_edma2_irq_init(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma) @@ -406,6 +504,14 @@ static struct fsl_edma_drvdata imx95_data5 = { .setup_irq = fsl_edma3_irq_init, }; +static const struct fsl_edma_drvdata s32g2_data = { + .dmamuxs = DMAMUX_NR, + .chreg_space_sz = EDMA_TCD, + .chreg_off = 0x4000, + .flags = FSL_EDMA_DRV_EDMA3 | FSL_EDMA_DRV_MUX_SWAP, + .setup_irq = fsl_edma3_or_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}, @@ -415,6 +521,7 @@ static const struct of_device_id fsl_edma_dt_ids[] = { { .compatible = "fsl,imx93-edma3", .data = &imx93_data3}, { .compatible = "fsl,imx93-edma4", .data = &imx93_data4}, { .compatible = "fsl,imx95-edma5", .data = &imx95_data5}, + { .compatible = "nxp,s32g2-edma", .data = &s32g2_data}, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fsl_edma_dt_ids);