From patchwork Thu Jul 2 15:08:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11637873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 741B6739 for ; Thu, 2 Jul 2020 06:53:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5366F208B8 for ; Thu, 2 Jul 2020 06:53:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="BScQ4A5m" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbgGBGxs (ORCPT ); Thu, 2 Jul 2020 02:53:48 -0400 Received: from mail-eopbgr60058.outbound.protection.outlook.com ([40.107.6.58]:45039 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726068AbgGBGxr (ORCPT ); Thu, 2 Jul 2020 02:53:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lafYxPFGzWp/BLhHbF5idm7mkyPk2dp3+z5gPQYkpNj5XaBr5GVOKMW0kadrlEPxae6wG2DWEjrN02GYAi11meuGCP0f/ASrwM0pvWTYMQf0gXwu7BLSFc3wIFqg8ag11w9YFhuIzsbLxdvuHyg9BBvryxPBEhKjsUvAQdQ2EfDVkDsP8OvW6sbAva1wlmlhBG4R6jUqdSnhwT08R11N66ZPAzvxjFD2ojz1XiQ5RCRIZ0SygQOFLtnHNQWq7agEd+D3H/RRzEc0YNexmbG5gyeovo7DN9T1NsYqE8arG0ih4VTSAMDODJe7vaWoOfMN4KQ44ELTB7+qCO7FOXI30A== 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-SenderADCheck; bh=eBl/Yslh0zQAo/MMEG40uxi0GNH6EHf2t3FgUYJlXJ0=; b=ET9mwpUK3s7GPCv3V2msDE2A7Eks3SatiPfEdPpTBVm0pGTF/E0ivRH1LmQURfi0B8bANJaLSqEAS26eqKMa410JWOC2Qc8N5vhSJ3H1tCh2+TuEpE7QgH9ELi7acyKY+sfAf9sUtjEmNQp1bSZqu6tHoVriISTPBagIVMd23oBmRjr5L9yjiiTy+WLPO0wuuG5hpYTuA6lqhI4hjCpUcETF5fZjncJKk1TM9nptaMlh3nVvXRER0dGwWU2fuDPu2NYDEiLuHM2c8Ym6kjNkHm0qMSOYDoAgpnynYsLuCURYOZbhKD7zKc7GFwue9W7uaQwfEUK4b0bsxtXXPEi9Xg== 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=eBl/Yslh0zQAo/MMEG40uxi0GNH6EHf2t3FgUYJlXJ0=; b=BScQ4A5mJ600N4HzzzL2K34ZXZ+CxRt5kdpxA5HQJedH88edyJjyckGPOZDN9tRoNn1cRsaGVHMZc4pXHXf3jojtUzxQoj8Kh9GMS+sCHuNB8LY7PrtAHaIXzET3eEPLt/Fqqzybb9d0Dl5e6q3MTffs1i9nvvjwA94LPaqAa0Y= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 2 Jul 2020 06:53:41 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3153.024; Thu, 2 Jul 2020 06:53:41 +0000 From: Robin Gong To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 1/9] dmaengine: fsl-edma: move edma_request functions into drvdata Date: Thu, 2 Jul 2020 23:08:01 +0800 Message-Id: <1593702489-21648-2-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> References: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.67) by SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.24 via Frontend Transport; Thu, 2 Jul 2020 06:53:37 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ff0f42e3-32a4-4786-0cfb-08d81e54a7b9 X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-Forefront-PRVS: 0452022BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: apStRKV9GjQ5ApKuEOs7JzL1pLkf3S+9Ce9F0lJ5wHjGP0IWKHG9mb+SZ5CN5oXxsEb1O3B1TrS9Nm+pl4A6LNyFCrOLwqRPiKTNjr59E1MtWu13KEy+wqPBU0elqxLibuwAOLT/S9qSolsPbgtVfeXWTR9ATrtcS0q3hC8UgWxy8pLRBnMsiApkxBD36wMTzsyNMSbtJ0r7ujqJBK4DXwTZFiG/NHsVPb9RO4T8UlAOhBIrAmCwc4QdaNH/wAYuVcprVTuoKO9doNaRszPgcHzFEXLWIpc3PkTlMtaV6cvQmkgZ/unsuo7RtQAMMRZu0qk2hCpQEwBNnXboJ1avxQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6638.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(376002)(39860400002)(346002)(83380400001)(66476007)(6666004)(66946007)(66556008)(52116002)(36756003)(8936002)(2616005)(6486002)(956004)(6512007)(186003)(7416002)(4326008)(26005)(2906002)(8676002)(86362001)(16526019)(478600001)(6506007)(5660300002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pGK57xjgY/HAYl4KdlIueA3zH4/bLySmyibgz8jOCqMDsbyi6VV/zqU47adXqXHM2Y0192QvijzCa2rX2rvwl3R0C3lA6ze0YTfGSH0OshfXXuWtlBZUifGAnpYKl+bAUlQYtz2qn5zWRY8ollJTn0YbbtBW3UpQbZXQ85TCoTAcxAthkjBNAuLvSkcc9N6JAn6/tPclV6tAiHLOyzj61y0QJH2B+/EP2QYf3rHHEHutJyQgWivg635YwvB/LfwHDgr6Qu5Yn+rZi8azZ71FdqINRXRedwJcE9PGulN8npxlTbbyAuwIL6s56IIFM85xFrjJhb+D8wP0LeznekdpEDjkkAZUYQ684x3Z438btsFk+t5qgaN6oZIjo1oGNpo0qSgOIcWd2VF78po+6dAK9JFFougIOogC+DMCrqSi8ifVAu9AlkeEdq1B1kR2SOD+Vz4O638o+m3+O5tDB+rgETOraPP4kOMXzmf1Yhlk3tc= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff0f42e3-32a4-4786-0cfb-08d81e54a7b9 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2020 06:53:41.7611 (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: UHd8AxJmEsWfcVFKyDgTDIuIc4qCzHtIpazmpDQAtaGbGMlRKpJ09CNEJtRtxBxpjuRS+0FNlsOthcpUydh2fw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Move fsl_edma_enable_request/fsl_edma_disable_request into drvdata so that later edma3 could easily be added. Signed-off-by: Robin Gong --- drivers/dma/fsl-edma-common.c | 13 +++++++------ drivers/dma/fsl-edma-common.h | 3 +++ drivers/dma/fsl-edma.c | 10 ++++++++-- drivers/dma/mcf-edma.c | 2 ++ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 4550818..ef5294f0 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -42,7 +42,7 @@ #define EDMA_TCD 0x1000 -static void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) +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; @@ -58,6 +58,7 @@ static void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) iowrite8(ch, regs->serq); } } +EXPORT_SYMBOL_GPL(fsl_edma_enable_request); void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan) { @@ -164,7 +165,7 @@ int fsl_edma_terminate_all(struct dma_chan *chan) LIST_HEAD(head); spin_lock_irqsave(&fsl_chan->vchan.lock, flags); - fsl_edma_disable_request(fsl_chan); + fsl_chan->edma->drvdata->dis_req(fsl_chan); fsl_chan->edesc = NULL; fsl_chan->idle = true; vchan_get_all_descriptors(&fsl_chan->vchan, &head); @@ -181,7 +182,7 @@ int fsl_edma_pause(struct dma_chan *chan) spin_lock_irqsave(&fsl_chan->vchan.lock, flags); if (fsl_chan->edesc) { - fsl_edma_disable_request(fsl_chan); + fsl_chan->edma->drvdata->dis_req(fsl_chan); fsl_chan->status = DMA_PAUSED; fsl_chan->idle = true; } @@ -197,7 +198,7 @@ int fsl_edma_resume(struct dma_chan *chan) spin_lock_irqsave(&fsl_chan->vchan.lock, flags); if (fsl_chan->edesc) { - fsl_edma_enable_request(fsl_chan); + fsl_chan->edma->drvdata->en_req(fsl_chan); fsl_chan->status = DMA_IN_PROGRESS; fsl_chan->idle = false; } @@ -596,7 +597,7 @@ void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) return; fsl_chan->edesc = to_fsl_edma_desc(vdesc); fsl_edma_set_tcd_regs(fsl_chan, fsl_chan->edesc->tcd[0].vtcd); - fsl_edma_enable_request(fsl_chan); + fsl_chan->edma->drvdata->en_req(fsl_chan); fsl_chan->status = DMA_IN_PROGRESS; fsl_chan->idle = false; } @@ -640,7 +641,7 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan) LIST_HEAD(head); spin_lock_irqsave(&fsl_chan->vchan.lock, flags); - fsl_edma_disable_request(fsl_chan); + fsl_chan->edma->drvdata->dis_req(fsl_chan); fsl_edma_chan_mux(fsl_chan, 0, false); fsl_chan->edesc = NULL; vchan_get_all_descriptors(&fsl_chan->vchan, &head); diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index ec11697..87c8d7a 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -150,6 +150,8 @@ struct fsl_edma_drvdata { bool mux_swap; int (*setup_irq)(struct platform_device *pdev, struct fsl_edma_engine *fsl_edma); + void (*en_req)(struct fsl_edma_chan *fsl_chan); + void (*dis_req)(struct fsl_edma_chan *fsl_chan); }; struct fsl_edma_engine { @@ -222,6 +224,7 @@ static inline struct fsl_edma_desc *to_fsl_edma_desc(struct virt_dma_desc *vd) } void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan); +void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan); void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, unsigned int slot, bool enable); void fsl_edma_free_desc(struct virt_dma_desc *vdesc); diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c index 90bb72a..95745636 100644 --- a/drivers/dma/fsl-edma.c +++ b/drivers/dma/fsl-edma.c @@ -83,7 +83,7 @@ static irqreturn_t fsl_edma_err_handler(int irq, void *dev_id) for (ch = 0; ch < fsl_edma->n_chans; ch++) { if (err & (0x1 << ch)) { - fsl_edma_disable_request(&fsl_edma->chans[ch]); + fsl_edma->drvdata->dis_req(&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; @@ -238,6 +238,8 @@ static struct fsl_edma_drvdata vf610_data = { .version = v1, .dmamuxs = DMAMUX_NR, .setup_irq = fsl_edma_irq_init, + .en_req = fsl_edma_enable_request, + .dis_req = fsl_edma_disable_request, }; static struct fsl_edma_drvdata ls1028a_data = { @@ -245,6 +247,8 @@ static struct fsl_edma_drvdata ls1028a_data = { .dmamuxs = DMAMUX_NR, .mux_swap = true, .setup_irq = fsl_edma_irq_init, + .en_req = fsl_edma_enable_request, + .dis_req = fsl_edma_disable_request, }; static struct fsl_edma_drvdata imx7ulp_data = { @@ -252,6 +256,8 @@ static struct fsl_edma_drvdata imx7ulp_data = { .dmamuxs = 1, .has_dmaclk = true, .setup_irq = fsl_edma2_irq_init, + .en_req = fsl_edma_enable_request, + .dis_req = fsl_edma_disable_request, }; static const struct of_device_id fsl_edma_dt_ids[] = { @@ -444,7 +450,7 @@ static int fsl_edma_suspend_late(struct device *dev) /* Make sure chan is idle or will force disable. */ if (unlikely(!fsl_chan->idle)) { dev_warn(dev, "WARN: There is non-idle channel."); - fsl_edma_disable_request(fsl_chan); + fsl_edma->drvdata->dis_req(fsl_chan); fsl_edma_chan_mux(fsl_chan, 0, false); } diff --git a/drivers/dma/mcf-edma.c b/drivers/dma/mcf-edma.c index e12b754..50e6b9b 100644 --- a/drivers/dma/mcf-edma.c +++ b/drivers/dma/mcf-edma.c @@ -174,6 +174,8 @@ static void mcf_edma_irq_free(struct platform_device *pdev, static struct fsl_edma_drvdata mcf_data = { .version = v2, .setup_irq = mcf_edma_irq_init, + .en_req = fsl_edma_enable_request, + .dis_req = fsl_edma_disable_request, }; static int mcf_edma_probe(struct platform_device *pdev) From patchwork Thu Jul 2 15:08:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11637875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AF7C13BD for ; Thu, 2 Jul 2020 06:53:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DE0F2089D for ; Thu, 2 Jul 2020 06:53:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="HWWTK9XC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726068AbgGBGxv (ORCPT ); Thu, 2 Jul 2020 02:53:51 -0400 Received: from mail-eopbgr60058.outbound.protection.outlook.com ([40.107.6.58]:45039 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726805AbgGBGxu (ORCPT ); Thu, 2 Jul 2020 02:53:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TptrUa5QYaF/l8p/05piu8ETPcA/t6X6BrI5FYINVau0gOhddD0PO2ChQzCLLBeqaO1kE0BxSaOidbFCQFdJc4hQbOw9huCQjuSvjo1waGaiJPadGw4zOW2OY1G9YUV7d28a+APDRkGyv8HdZmGhbRKIHLqL0G7bs8HbUaG3nwH7Wpq7aNFai1650wcUDrrm/RlXyPXyhnETi/erFb5/Me0pYhtlX/eRoLvvoyc5M09gK6vJ3PB3rSI/+cf9742b7LmqJwuRdmRUx/Nf6i7Tikjx9kexwrajaXMvi6NbltVPyzt5nOZ5EM2g8dpOcA+afeOQC8RVJMm1NQzu4FLzKw== 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-SenderADCheck; bh=wnGtdIP/hbdfvrIHlyCNUJzLtnZLrNC7lK23LHA+0xg=; b=QVK8BwB24HBJf5m3lhPz9lFGzIPUjuaFNa/ucWs/By7O8Lf+mOk4qm5vO8wK4lFkOyJmzzk+eONLE191GGneiMrt5C0EMZfTbclFRBmuOA32+S/7By/Tl4IDv0Qek6ol3lFKghZmzw5jrRhGY1k5AGZIj3ATl5vFs4vAXyw0k4anv3iJyh1EeCMGeKGcoZyGExY2fTGL45v3UKGRN30xMZ0uF4Qi09ps0uauZwZDEqy+EB0sRT4GbDYrqc5JQrPONpfgmeI2Rs0OiMlMJv6UX2YLv+kTpOirdaJaK50UYAuc9cxrQ/zTab7Fs730UjoO7sKqcNLbP/A1q6E6GBPJ7g== 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=wnGtdIP/hbdfvrIHlyCNUJzLtnZLrNC7lK23LHA+0xg=; b=HWWTK9XC2jkJG7AaB7Ddlf9e7q1KFASzC7I0nkGQJPJoY15fCCqjhWWdAs+kJvfYTBu0YSfLhbi4RFfRF/6F6vPasLi5YREik+Z/P7nPAtdZ5I5dshryEjeeIIk4zd+UVXa9ov0kNnwaaYsEDluOrfgUHknCb7ArJ8hy3vFY+VQ= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 2 Jul 2020 06:53:46 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3153.024; Thu, 2 Jul 2020 06:53:46 +0000 From: Robin Gong To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 2/9] dmaengine: fsl-edma-common: add condition check for fsl_edma_chan_mux Date: Thu, 2 Jul 2020 23:08:02 +0800 Message-Id: <1593702489-21648-3-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> References: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.67) by SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.24 via Frontend Transport; Thu, 2 Jul 2020 06:53:42 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 48ce6396-f159-4a1f-f977-08d81e54aa93 X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1247; X-Forefront-PRVS: 0452022BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lk0G3pU/hVc210r+HI6BiyeGbAb8YtYQ3vH2p8Zl5+Yn6cNYxsGXigy0OtLKYvhiwpC0CJ6BQCDzxTZzdT7YDjihzlPusI09t8CKg61H/oVd9y/iEN0GCVavmQ2NGsGFBy6ot4vJhPbofuOHKfB6ZCNYXzBLnEM1+5dmRiM9X3lFxq4xKyxauk96bJzKi5q9Xr0fKYQytEVhWjp/gDehT83WgMg+ruSlTwgzgz1kocl8U61NKlswhT/LKyMFbSloMHRcHI6qCrCJ1/8jcwcqmhpVHyUAJ9CMiRmpHelD7wiMFC1Y3DLnxtETWXVJnuvBvBcfFJLyle5Gglewnf/UNg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6638.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(376002)(39860400002)(346002)(83380400001)(66476007)(6666004)(66946007)(66556008)(52116002)(36756003)(8936002)(2616005)(6486002)(956004)(6512007)(186003)(7416002)(4326008)(26005)(2906002)(8676002)(86362001)(16526019)(4744005)(478600001)(6506007)(5660300002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: xWOxiCM6cwZJonh1nzh+bHhrNUv9CES5uzKKbylO/2hpaclcReb59+DVwUAmvwKlXLOGzmKkzXERLSnpDEuo104g+AoNvcmm6AWT2TcYyqsLTEqa69Ustk+58dTy9R2Ufkj894NY6uJSlDYTO0DdMwrfMpO3j4v5qTRjVtbUQX9D97+V5fw+OtQonkzCZeroJpWmOtFa4SsFUVMiHy33TBXlM2hnYy+CMBbV7NcnnqP5UrXczqtG4WHZY0h2t8LI79SVXdKvQQ9gl8TxpIkwjooE8hSPkqCjEX+LEnPGrZur0F4gbD+eMieFk7Sk1aVLhHZDqeYeV2x8cD+d7X3MyGYhI624AE2VmJXMAWyGwWjwoIRG++FOw+/i93cfNMO1VdMypOs2kFkPc0gg4eA9XML01h2D5NQhDiUjut/UYnWApKtKJjjYBdF1qf3uF5XhQraPdnKvvnX4KMPCztRF8KGg2KRdnlI5fb9melLzqu4= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48ce6396-f159-4a1f-f977-08d81e54aa93 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2020 06:53:46.4333 (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: np4HXcxLulTG5mgEzvPpOpkxHERyozaJEC6tTQ2FAsCaja5fX3aPLrPad/2eZkRwicSmaFLGDVdKhDGEEhIKvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Since next edma3 don't have dmamux, add condition check in the common fsl_edma_free_chan_resources(). Signed-off-by: Robin Gong --- drivers/dma/fsl-edma-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index ef5294f0..d19e8a8 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -642,7 +642,10 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan) spin_lock_irqsave(&fsl_chan->vchan.lock, flags); fsl_chan->edma->drvdata->dis_req(fsl_chan); - fsl_edma_chan_mux(fsl_chan, 0, false); + + if (fsl_chan->edma->drvdata->dmamuxs) + fsl_edma_chan_mux(fsl_chan, 0, false); + fsl_chan->edesc = NULL; vchan_get_all_descriptors(&fsl_chan->vchan, &head); fsl_edma_unprep_slave_dma(fsl_chan); From patchwork Thu Jul 2 15:08:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11637877 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88073739 for ; Thu, 2 Jul 2020 06:53:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 64E9B2085B for ; Thu, 2 Jul 2020 06:53:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Hpdx64Uj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726805AbgGBGx4 (ORCPT ); Thu, 2 Jul 2020 02:53:56 -0400 Received: from mail-eopbgr60047.outbound.protection.outlook.com ([40.107.6.47]:43264 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726953AbgGBGxy (ORCPT ); Thu, 2 Jul 2020 02:53:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J9dYi52Y3n3eVQ8Rg2KeSHKI5LfknvAVfgf8dupb/YqggYHT18ih+O4hsUW45LWHAN2lJiAi1cH7UiqQJAK4FHek2ijdnJVy6m5H9FzvtpSKLOgFUPdalfgVn63ggtblNlP5x6yYvkq0apH0D73R6EerytaQtZUAhSYia2DpuWiKH/9dfZ9BbA9RPbK+fIOU4UF0ObCKcU1sWPtdwcC0X6XNF/k5bfuXs5K3u5A5YwHBD0EWaKIKlQu5puUhs8g9eK5J3co88qpP2O5+Wtj8+hqZcY6YaF4DLtZzkCNuVRQk/xTo3FLzxO6zp7MT+KvX5FfbpUK3GCBFzv0I9VLpQQ== 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-SenderADCheck; bh=jlMSjTLc9bPxAbh3RbYyMXN3owo0JtZ3jcwGfsNozXA=; b=aED7sQEYmTy9A0BXRUP7fPV5n6ZssF/ypnpvsM7idmJGFBFq1Sv2WeiZTWmiev7PslIA+Xxp5Mo2Zobrf/Gfsjz/eZ92IbmdXrZB3YPPbjR2vgDrPpg71Ns6JS6JYHgoIuOz0i0EIMhr5oQOV9d3W+1zitJ73ESpAjA935fzWxD344mevg0z9fNdBTKT/bYFhmK5PKIL2fi3TOvHpj9JNSWxbTQopd4GPLo2VWBs05ff3qFwPoUgRkequnYhpT84F8jrIZBK6ur5FiBhjuDvErvK0Wtks8meP/j74tPDw7H2KadCeopH3y+WMEFPJt51mlcI5gQdfLoADwsztgs1ug== 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=jlMSjTLc9bPxAbh3RbYyMXN3owo0JtZ3jcwGfsNozXA=; b=Hpdx64UjPban/UyuUlQrFJQq7FSC9vBMb1QexqJiWxbLTlvoIggcGkMRv/k0TFUxhcRvKiV9P6lmuoQee8+K9FU0eh5IHBlowKFqIammI5fXiWxgeqtSBexQSrPPb8zxQoL8ZWauyu7Msy9YrsHJE79jy74onudO/zw1BMsRYT8= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 2 Jul 2020 06:53:51 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3153.024; Thu, 2 Jul 2020 06:53:51 +0000 From: Robin Gong To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 3/9] dmaengine: fsl-edma-common: add fsl_chan into fsl_edma_fill_tcd Date: Thu, 2 Jul 2020 23:08:03 +0800 Message-Id: <1593702489-21648-4-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> References: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.67) by SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.24 via Frontend Transport; Thu, 2 Jul 2020 06:53:46 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cf1067fd-40be-4ac3-d72e-08d81e54ad86 X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-Forefront-PRVS: 0452022BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 195VErfdgA9OiYJ5+G7YE/o8sahrp6Jww8+rYyDJQC1TzxBXvkNld2Qs3hNKnmhcMrHIX38GK/lDmqAKZGrMKCAfzxs9tUzqNx34dW3M/HAkvjOun6CRoCUhp7IVrY3MOim/mvkYvSYd/Y5XCqctOg4SDuY51EojDwUo1CGGxnxQ26VxDVtBeNfNaBnPJoFLpBGL3X+5vnq3JZY1HS67TEtMLAxAeXXloIRtLkDm+9Ysy807HOAiDkJR/84pxAC2yuFlcRgivFpOnYsY7TbtsDaaTPtxIQLVMOcp2XBxQ6ePJkHgpHdD6KF2KBaYFQzprlChSErgg01qyd/ojKTm8g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6638.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(376002)(39860400002)(346002)(83380400001)(66476007)(6666004)(66946007)(66556008)(52116002)(36756003)(8936002)(2616005)(6486002)(956004)(6512007)(186003)(7416002)(4326008)(26005)(2906002)(8676002)(86362001)(16526019)(478600001)(6506007)(5660300002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: UnOjNhF6gqP27lbfNKEQ4kz7meF54Ojzq9sS/Vpny4f1n9QyOOWsNLy7RJc+fu+8qzju0RIHGUzHpt5XwAVTdrpdYYH7d8XunD1i16ZLKnZCdBcPbWbI4pDlElW6zo/3dugIiqbXOJ1+sN826NoblNJA/840J5cBO5bTlK0PX0SMTMS1M4idnA/a/qyAR6FUpJdKkbOrhVZnIDG+lB53bwSF3B1jxUZiwXaSs1u60b42ywjRwReBrGWYbQ/YWwyUwLfc+OIwNgjyEjn3/NpIqwB4I+/RnDEMHKKOI95h1cCEtGuWCPFHx40iuFd4C472aDP3USn3iY8UD+TgbTspgcIqjpQYAfcdGxLwkdDssOyMIzSyrV1QWcjT9TW+7Yi03oRGst7kTnW76BVGugEV50T4vR89EbewknBOIfZwBq0pJxNaFtG1nVt0lq5ghKCOIvfuyXTFcj8JavCbbkV5ej3q2jdDl7/CWOrx3p9jXXo= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf1067fd-40be-4ac3-d72e-08d81e54ad86 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2020 06:53:51.2935 (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: guxq8xHxOE4pKWhzlG3R07Pzd23A90D0tgRmS1ERZoWMZBqkxhyZialomvychMv6133AWIOftpxJ2CEF+T7O4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org For preparing for next edma3 merged so that any member of 'struct fsl_chan' could be used in fsl_edma_fill_tcd. Signed-off-by: Robin Gong --- drivers/dma/fsl-edma-common.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index d19e8a8..6ef083c 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -376,7 +376,8 @@ 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) @@ -504,9 +505,9 @@ struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( doff = fsl_chan->cfg.src_addr_width; } - fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, dst_addr, - fsl_chan->attr, soff, nbytes, 0, iter, - iter, doff, last_sg, true, false, true); + 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); dma_buf_next += period_len; } @@ -569,16 +570,16 @@ struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg( 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, - dst_addr, fsl_chan->attr, soff, - nbytes, 0, iter, iter, doff, last_sg, - false, false, true); + 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, - dst_addr, fsl_chan->attr, soff, - nbytes, 0, iter, iter, doff, last_sg, - true, true, false); + 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); } } From patchwork Thu Jul 2 15:08:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11637879 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 036B813BD for ; Thu, 2 Jul 2020 06:54:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9443208D5 for ; Thu, 2 Jul 2020 06:54:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="HIXN+b7j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727043AbgGBGyF (ORCPT ); Thu, 2 Jul 2020 02:54:05 -0400 Received: from mail-eopbgr60071.outbound.protection.outlook.com ([40.107.6.71]:12347 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726987AbgGBGyA (ORCPT ); Thu, 2 Jul 2020 02:54:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a2bkAHlDIfqSQQG6j6ytEadp4vPmewBy1i69jkHWLF81jqEpZYX0+1fAPEMcH+uey+dSiboVqjrJruTXVbDCY6OVyKKZHbj0X4/SefRAx/ht5MFLvQTnp5+RtZMnjDYWGHIMg3/icOEkefEEv9Fclb4Ncm1uYqU+ZvOiXyiwfGciVreZuH1mVMGZCxW+wZd7uhjxo56nOpAtIneQsYgcXDhqFZvEWoZ1oE82ZBkVS9RtmsD3xeAGDWLRYUffwb3mqKAZ2y47gm5Jyo2Tq1YzugTBhe8JBksYd8CBvWsetdMVwcZYzxPWtaXGusULcbZKc6vue1hx+6jV8DebWAyZ7w== 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-SenderADCheck; bh=6Y+xW4eUZ3BMp8dGzZfaOkqYoOJccc4HMqibnP9MgK0=; b=J5KcsYx0eMir29ZXASdLlRWAhG30omFpsJQ76mU9uyWkVFrw8Ar3UcydbKSidM/guI2qT/wA0A6c0knT4beqRdr77Yi7r7EsgLkVVwoQx/dW282xc1zzTjD6IJTkX5zfpGKysp5smpJdl5NKM4P7/CuxAf9tlKW3IYkmkPNurPZZF5TJ8+5gWSh3pwon7NmoMCSz3I5BPMOgCLYlUZnehx3yHP3DOCGhQinRquXWmYWhVclkvZ6MWuy39hCVSSlbi0q6wIe5vS7lg4qaE4p5rca9vjfW2/pLqMmosU7Y/l9yup8Vfd8HtIlgyj3VwxPZdOR7MxGEdaueASwWc4ks+g== 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=6Y+xW4eUZ3BMp8dGzZfaOkqYoOJccc4HMqibnP9MgK0=; b=HIXN+b7jbGhZwSUq7pqeDrEACqkgVrGca4JwpZb65EgYZu2rYARQ6qweKdYYPM5BIOXsFr2cgpwCWlCHshU+VEFbFHpQh1Zd1L1Ee2i+TzYLf7ahJ0sdoxng2hldi1kNZMWVuxAA/3Hf5ZGxBCfuce9VW+VYsMWzlZt/IrPsbok= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 2 Jul 2020 06:53:56 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3153.024; Thu, 2 Jul 2020 06:53:56 +0000 From: Robin Gong To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 4/9] dmaengine: fsl-edma-common: export fsl_edma_set_tcd_regs Date: Thu, 2 Jul 2020 23:08:04 +0800 Message-Id: <1593702489-21648-5-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> References: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.67) by SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.24 via Frontend Transport; Thu, 2 Jul 2020 06:53:51 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f46b3e57-c827-4189-7d47-08d81e54b06f X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-Forefront-PRVS: 0452022BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iJfELT0t+8eJqu3F2fnwYfJd2WxICOxjpC3ttMopHviWsuy7Bx/j6al8G1if6UTvAb0chNA8l/d7KhG6mmkH72C4Cmh3wLuwpfjDZJ9qftbi1oj92OQf0MP7lbEsZQ/PPKY+V6D9/5ROn6ei1ucDuH82OU7uOzxTbtW0abbFGOXjf0YUBZRMMPSZceYCrhQLe+1nhR94tpG16R7cjU2TMQAU0BF4m67ePhNBqAnU/Z6sGplyPDlzFe/RfkhKTt+OewJXnk+BFc6R4mnAZ0YFL8roYzz+1/eZ9qVlc1twqh8keQpJ2VaeBX2G9Qd50vB7LUW8WI8WN3hLs+aCoMfyLA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6638.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(376002)(39860400002)(346002)(83380400001)(66476007)(6666004)(66946007)(66556008)(52116002)(36756003)(8936002)(2616005)(6486002)(956004)(6512007)(186003)(7416002)(4326008)(26005)(2906002)(8676002)(86362001)(16526019)(478600001)(6506007)(5660300002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bKfffA41kh3PNkoJ6Slz2peXIpd7A/1Epq2PnqAs2VYdQw+PE95Ghsfh7QK5uESA1AVmeVc7UU5j1T8EYupbPaTjhSSMOkKYGqbuuu+Ksa6XcpKJzZ3idQ5tQVfyrdx6cOhkPGHPpWoI2g7UkugrSNLr1UiZ3pxXjMklQlw3Z/i41ZnZ4u2hRvGSmjyMbBdjfy4A13zZmATLtDJVSVgc/61RwDsgMy51ICOYLVIBZimQsTkHBf15VwXVm5sxToYcobpVfzMUh6Cg6RzSkMa9N8XVEqqDHxWlZysaYpc0q5mjQ7L0d/Ld8VONMHNIpkEiW3XqyqYaMkeeVgPF6cqPgSj02E1BVfgQt0Im1hCKiXntJT/Sx8vPnaVqAbwcCpdSNrDzJ37FnbVBPdTEXgg5Yc+5V/f4OXPhykftEVJMq2R4085RcHBcAnKiPpr2PKTMOCcy9eIjnk50X2CzYeaO84nHzGrTqFPs92svqsIolDM= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f46b3e57-c827-4189-7d47-08d81e54b06f X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2020 06:53:56.1236 (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: i7eCt57tVxjMV9BQvfPsirRdPcNmvhQz6Wo0QBgM4n56wQZt5jcuBWS5t/tndY+oDzW5LS8a3nIYcWt/anu8EA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Preparing for edma3 since it need to be called in fsl-edma3.c Signed-off-by: Robin Gong --- drivers/dma/fsl-edma-common.c | 3 ++- drivers/dma/fsl-edma-common.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 6ef083c..05d56d8 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -343,7 +343,7 @@ enum dma_status fsl_edma_tx_status(struct dma_chan *chan, } EXPORT_SYMBOL_GPL(fsl_edma_tx_status); -static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, +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; @@ -374,6 +374,7 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, edma_writew(edma, le16_to_cpu(tcd->csr), ®s->tcd[ch].csr); } +EXPORT_SYMBOL_GPL(fsl_edma_set_tcd_regs); static inline void fsl_edma_fill_tcd(struct fsl_edma_chan *fsl_chan, diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 87c8d7a..56f29f3 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -249,5 +249,7 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan); void fsl_edma_free_chan_resources(struct dma_chan *chan); void fsl_edma_cleanup_vchan(struct dma_device *dmadev); void fsl_edma_setup_regs(struct fsl_edma_engine *edma); +void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, + struct fsl_edma_hw_tcd *tcd); #endif /* _FSL_EDMA_COMMON_H_ */ From patchwork Thu Jul 2 15:08:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11637881 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC157739 for ; Thu, 2 Jul 2020 06:54:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF0AA20884 for ; Thu, 2 Jul 2020 06:54:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="qiXatHgl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727053AbgGBGyM (ORCPT ); Thu, 2 Jul 2020 02:54:12 -0400 Received: from mail-eopbgr60071.outbound.protection.outlook.com ([40.107.6.71]:12347 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726953AbgGBGyL (ORCPT ); Thu, 2 Jul 2020 02:54:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TGrumqfDFtu3PNqLrnij6luDekgYdoS4wZB9iRD1ZaNbaw7wEM9OD2LE6hNbqK5wrDhHwnetDbwLPvPlMiMjqEX2tm+WdCLqCaOFiO31jwbKfSudIWETuphhDz6WPMOq0tyrM0iutXR5GDO762FMFylMuD7qg7Znlxg0uJKwPjOmXQKr8gBwTe4IsFyO+ozt5INqNb3CtzPuV2L9kKQhRlU+HmXXr2M5Gjo9yR2wS3P7ZhA7HnstGfKKe5JLxEkD6gnUG7d0Y2SXlfh6zApSW6S29ezwmbH5EGQFeX1nBmr1PPMd14atZPlm47cbo+cTDOH5rGhX5KEkx1XA1Iqixg== 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-SenderADCheck; bh=9zslP4HxkVzYfUuPlpN/W5Vo9U1G2YbWRickvtI8V7A=; b=fWZx8VZEaI9N87mon+VF57Zv25DUNvXjoDb//i34aD4h3eTkD/SJuGIgIN/JhPcnjcJBo1E1O0JIflxULGnOScDSG5lCIF8HND43BojGGEgU7+HC8pqmdmJ1up1WtpALLuDeHne7MbTr0clWu5LUDQvKshXyzT1xjHVfxQcTuQQjuhkEQUrJMoerRmSR7fj3FaK9tBvzHanuti6PZGDEvgboeP9Rs4TPG1vCBi8AurOKihfI5xdv27LvlWpt1o4R8HTidxcFWyefXL/lo42xwALuevOptmZlkwbk1X3H7ajOpmL92AF0vTG54QE0HmA3F0Clz0Vn7huiHhrvihE+Aw== 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=9zslP4HxkVzYfUuPlpN/W5Vo9U1G2YbWRickvtI8V7A=; b=qiXatHglFYyKJJBcxcxcEJEF1zbj6uy84pkTk61zpi6rsmDu9QwIyIy7o96Bzar7KmeQ4vPNGvHrhfSxzf2HnZoeVjQAQdj4qSn+h3zyK8N3fiVMPdd/4QjNT2tXyKKIJKAgruBjyq/PiG9WTsexX/6AUTT22xv/hsFTMAi7k4Y= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 2 Jul 2020 06:54:01 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3153.024; Thu, 2 Jul 2020 06:54:01 +0000 From: Robin Gong To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 5/9] dmaengine: fsl-edma3: add fsl-edma3 driver Date: Thu, 2 Jul 2020 23:08:05 +0800 Message-Id: <1593702489-21648-6-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> References: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.67) by SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.24 via Frontend Transport; Thu, 2 Jul 2020 06:53:56 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: be768faa-dd27-486a-993e-08d81e54b34f X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:142; X-Forefront-PRVS: 0452022BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xUVrI55rIE/uPpv/gVkf96l5iUrTVqg5Yqw7IVHLDNWBE9eEu7IO6J5/fTKmFpo/NSc/dIc+PD6L90GKA3UinJyRdLQy1iuzA0c3q4XnZLkm+CJOeHkYHHj1X733p7GPkBfD7wXMZBRqfYpFPRxboO42wG7sJvUJIBycIJ19oqPl4KFNNlBopaHyTYNMUFq/C6+/HFl97pz1eh+z4PqDPygBvxu7Wp4TlkWbi76bWetp2WB2oyjqrdXZnKc90qf+AlzzP+LsVmaoF2wk6pRaZkHPTbyYHm7Xyc1gfWocfqrlTgH2j50jSmbnJn5r7rBv X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6638.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(376002)(39860400002)(346002)(83380400001)(66476007)(6666004)(66946007)(66556008)(52116002)(36756003)(8936002)(2616005)(6486002)(956004)(6512007)(186003)(7416002)(4326008)(26005)(2906002)(8676002)(86362001)(30864003)(16526019)(478600001)(6506007)(5660300002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: zxrtPN16hxJBK0yDnJRrcjPtldQrFdox3ORqPgrXX/+pvU8AbkUPluSn+wphl+a1oARM0+2ZCs7l2eOFRijUYHDBgBsmjYXS0UoxbJbB9ZdDbqt2gS8UGY76yk/2OM+fUZoNb4xzGF/RVOk7IPvG3EkhRTnSeFteZK4BfYx8uuSONIxe9ph0VoJ9w9XLz5D2CC/lKg5m/1Z5yndPXzQnz4NVgBBFSMoNpKTE20g7BCHMzJaKz2CvzMZ4HWGqb46pJ6eiqm0pS/41OLlfNhhVM3PXh83U7wVBn68GImSOCTe53CEwvA4uQFr1PmrIIoU11e0PbAQgGQRYd9bpTbzcUZ8L3VGLk05vvi4OpCtHk670JfychnMgeVVIhn67nz2sL1AfuBF2pLffUyXtQTMaGFfS8tCiMTJxuE1pYqET9rQ2bw+zEd2i//eCFvQdj/xCoL+BWWsvn4Jz+kb0hUTDbm7X5fChxiSSMANXmXGD3MU= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: be768faa-dd27-486a-993e-08d81e54b34f X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2020 06:54:01.7873 (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: VAwJiy7O49FqNX+JnUJf5cPOKEj8c4gu7hMK3zVbqcEuFJ5nG/LO3vPqBG8STCl2+KvkTUfsN39WKcMtInWjlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org add fsl-edma3 driver since there are big differences with legacy fsl-edma including below major items: 1. split memory address for per channel, while all channels share the same memory address and the same control registers CR/INT..etc. 2. all TCD registers of channels are continuous on legacy edma but split on edma3. 3. per interrupt per channel on edma3. 4. totally different register layer and add some register such as SBR 5. power domain support, per domain per channel. Signed-off-by: Robin Gong --- drivers/dma/Kconfig | 12 + drivers/dma/Makefile | 1 + drivers/dma/fsl-edma-common.c | 105 ++++++++- drivers/dma/fsl-edma-common.h | 25 +++ drivers/dma/fsl-edma3.c | 493 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 631 insertions(+), 5 deletions(-) create mode 100644 drivers/dma/fsl-edma3.c diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index b70e907..bd39e6b 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -214,6 +214,18 @@ config FSL_EDMA multiplexing capability for DMA request sources(slot). This module can be found on Freescale Vybrid and LS-1 SoCs. +config FSL_EDMA3 + tristate "Freescale eDMA3 engine support" + depends on OF + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + help + Support the Freescale/NXP eDMA v3 engine with programmable channel. + This driver is based on FSL_EDMA but big changes come such as + different interrupt for different channel, different register + scope for different channel. + This module can be found on Freescale i.MX8QM/QXP/ULP + config FSL_QDMA tristate "NXP Layerscape qDMA engine support" depends on ARM || ARM64 diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile index e60f813..f3a21a0 100644 --- a/drivers/dma/Makefile +++ b/drivers/dma/Makefile @@ -32,6 +32,7 @@ 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_FSL_EDMA3) += fsl-edma3.o fsl-edma-common.o obj-$(CONFIG_MCF_EDMA) += mcf-edma.o fsl-edma-common.o obj-$(CONFIG_FSL_QDMA) += fsl-qdma.o obj-$(CONFIG_FSL_RAID) += fsl_raid.o diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 05d56d8..e07880c 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -40,6 +40,13 @@ #define EDMA64_ERRH 0x28 #define EDMA64_ERRL 0x2c +#define EDMA3_CSR 0x00 +#define EDMA3_ES 0x04 +#define EDMA3_INT 0x08 +#define EDMA3_SBR 0x0C +#define EDMA3_PRI 0x10 +#define EDMA3_TCD 0x20 + #define EDMA_TCD 0x1000 void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan) @@ -78,6 +85,38 @@ void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan) } EXPORT_SYMBOL_GPL(fsl_edma_disable_request); +void fsl_edma3_enable_request(struct fsl_edma_chan *fsl_chan) +{ + struct edma_regs *regs = &fsl_chan->regs; + u32 val; + + val = edma_readl(fsl_chan->edma, regs->sbr); + if (fsl_chan->is_rx) + val |= EDMA3_SBR_RD; + else + val |= EDMA3_SBR_WR; + + if (fsl_chan->is_remote) + val &= ~(EDMA3_SBR_RD | EDMA3_SBR_RD); + + edma_writel(fsl_chan->edma, val, regs->sbr); + + val = edma_readl(fsl_chan->edma, regs->cr); + val |= EDMA3_CSR_ERQ; + edma_writel(fsl_chan->edma, val, regs->cr); +} +EXPORT_SYMBOL_GPL(fsl_edma3_enable_request); + +void fsl_edma3_disable_request(struct fsl_edma_chan *fsl_chan) +{ + struct edma_regs *regs = &fsl_chan->regs; + u32 val = edma_readl(fsl_chan->edma, regs->cr); + + val &= ~EDMA3_CSR_ERQ; + edma_writel(fsl_chan->edma, val, regs->cr); +} +EXPORT_SYMBOL_GPL(fsl_edma3_disable_request); + static void mux_configure8(struct fsl_edma_chan *fsl_chan, void __iomem *addr, u32 off, u32 slot, bool enable) { @@ -272,13 +311,21 @@ 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; + struct edma_regs *regs; + u32 ch; enum dma_transfer_direction dir = edesc->dirn; dma_addr_t cur_addr, dma_addr; size_t len, size; int i; + if (fsl_chan->edma->drvdata->is_split) { + regs = &fsl_chan->regs; + ch = 0; + } else { + regs = &fsl_chan->edma->regs; + ch = fsl_chan->vchan.chan.chan_id; + } + /* 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) @@ -304,6 +351,7 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, len -= size; if (cur_addr >= dma_addr && cur_addr < dma_addr + size) { len += dma_addr + size - cur_addr; + fsl_chan->processed = i; break; } } @@ -311,6 +359,15 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, return len; } +/* + * For saving real count for edma3 eeop since thereal count may not be the + * transfer size when the edma channel done interrupt triggered. + */ +void fsl_edma_get_realcnt(struct fsl_edma_chan *fsl_chan) +{ + fsl_chan->chn_real_count = fsl_edma_desc_residue(fsl_chan, NULL, true); +} + enum dma_status fsl_edma_tx_status(struct dma_chan *chan, dma_cookie_t cookie, struct dma_tx_state *txstate) { @@ -320,8 +377,12 @@ enum dma_status fsl_edma_tx_status(struct dma_chan *chan, unsigned long flags; status = dma_cookie_status(chan, cookie, txstate); - if (status == DMA_COMPLETE) + if (status == DMA_COMPLETE) { + spin_lock_irqsave(&fsl_chan->vchan.lock, flags); + txstate->residue = fsl_chan->chn_real_count; + spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); return status; + } if (!txstate) return fsl_chan->status; @@ -347,8 +408,16 @@ 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; + struct edma_regs *regs; + u32 ch; + + if (edma->drvdata->is_split) { + regs = &fsl_chan->regs; + ch = 0; + } else { + regs = &fsl_chan->edma->regs; + ch = fsl_chan->vchan.chan.chan_id; + } /* * TCD parameters are stored in struct fsl_edma_hw_tcd in little @@ -372,6 +441,10 @@ void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, edma_writel(edma, le32_to_cpu(tcd->dlast_sga), ®s->tcd[ch].dlast_sga); + /* Clear CHa_CSR[DONE] bit before enable TCDa_CSR[ESG] for edma3 */ + if (edma->drvdata->is_split) + edma_writel(edma, edma_readl(edma, regs->cr), regs->cr); + edma_writew(edma, le16_to_cpu(tcd->csr), ®s->tcd[ch].csr); } EXPORT_SYMBOL_GPL(fsl_edma_set_tcd_regs); @@ -416,6 +489,10 @@ void fsl_edma_fill_tcd(struct fsl_edma_chan *fsl_chan, if (enable_sg) csr |= EDMA_TCD_CSR_E_SG; + /* EEOP for bit6 on edma3 */ + if (fsl_chan->is_rx && fsl_chan->edma->drvdata->is_split) + csr |= EDMA_TCD_CSR_ACTIVE; + tcd->csr = cpu_to_le16(csr); } @@ -602,6 +679,7 @@ void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan) fsl_chan->edma->drvdata->en_req(fsl_chan); fsl_chan->status = DMA_IN_PROGRESS; fsl_chan->idle = false; + fsl_chan->chn_real_count = 0; } EXPORT_SYMBOL_GPL(fsl_edma_xfer_desc); @@ -632,6 +710,10 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan) fsl_chan->tcd_pool = dma_pool_create("tcd_pool", chan->device->dev, sizeof(struct fsl_edma_hw_tcd), 32, 0); + + if (fsl_chan->edma->drvdata->is_split) + fsl_chan->edma->drvdata->request_irq(fsl_chan); + return 0; } EXPORT_SYMBOL_GPL(fsl_edma_alloc_chan_resources); @@ -655,6 +737,10 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan) vchan_dma_desc_free_list(&fsl_chan->vchan, &head); dma_pool_destroy(fsl_chan->tcd_pool); + + if (fsl_chan->edma->drvdata->is_split) + fsl_chan->edma->drvdata->free_irq(fsl_chan); + fsl_chan->tcd_pool = NULL; } EXPORT_SYMBOL_GPL(fsl_edma_free_chan_resources); @@ -719,4 +805,13 @@ void fsl_edma_setup_regs(struct fsl_edma_engine *edma) } EXPORT_SYMBOL_GPL(fsl_edma_setup_regs); +void fsl_edma3_setup_regs(struct fsl_edma_chan *fsl_chan) +{ + fsl_chan->regs.cr = fsl_chan->chan_base + EDMA3_CSR; + fsl_chan->regs.intl = fsl_chan->chan_base + EDMA3_INT; + fsl_chan->regs.sbr = fsl_chan->chan_base + EDMA3_SBR; + fsl_chan->regs.tcd = fsl_chan->chan_base + EDMA3_TCD; +} +EXPORT_SYMBOL_GPL(fsl_edma3_setup_regs); + MODULE_LICENSE("GPL v2"); diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h index 56f29f3..624f1db 100644 --- a/drivers/dma/fsl-edma-common.h +++ b/drivers/dma/fsl-edma-common.h @@ -25,6 +25,10 @@ #define EDMA_CINT_CINT(x) ((x) & GENMASK(4, 0)) #define EDMA_CERR_CERR(x) ((x) & GENMASK(4, 0)) +#define EDMA3_SBR_RD BIT(22) +#define EDMA3_SBR_WR BIT(21) +#define EDMA3_CSR_ERQ BIT(0) + #define EDMA_TCD_ATTR_DSIZE(x) (((x) & GENMASK(2, 0))) #define EDMA_TCD_ATTR_DMOD(x) (((x) & GENMASK(4, 0)) << 3) #define EDMA_TCD_ATTR_SSIZE(x) (((x) & GENMASK(2, 0)) << 8) @@ -103,6 +107,7 @@ struct edma_regs { void __iomem *intl; void __iomem *errh; void __iomem *errl; + void __iomem *sbr; struct fsl_edma_hw_tcd __iomem *tcd; }; @@ -126,6 +131,18 @@ struct fsl_edma_chan { u32 dma_dev_size; enum dma_data_direction dma_dir; char chan_name[16]; + /* real transfered count saved for eeop */ + u32 chn_real_count; + /* No. of processed tcd in cyclic */ + u32 processed; + void __iomem *chan_base; + int hw_chanid; + int priority; + int txirq; + struct device *dev; + bool is_rx; + bool is_remote; + struct edma_regs regs; }; struct fsl_edma_desc { @@ -141,10 +158,12 @@ enum edma_version { v1, /* 32ch, Vybrid, mpc57x, etc */ v2, /* 64ch Coldfire */ v3, /* 32ch, i.mx7ulp */ + v4, /* 32ch, i.mx8qm/qxp */ }; struct fsl_edma_drvdata { enum edma_version version; + bool is_split; u32 dmamuxs; bool has_dmaclk; bool mux_swap; @@ -152,6 +171,8 @@ struct fsl_edma_drvdata { struct fsl_edma_engine *fsl_edma); void (*en_req)(struct fsl_edma_chan *fsl_chan); void (*dis_req)(struct fsl_edma_chan *fsl_chan); + int (*request_irq)(struct fsl_edma_chan *fsl_chan); + int (*free_irq)(struct fsl_edma_chan *fsl_chan); }; struct fsl_edma_engine { @@ -225,6 +246,8 @@ static inline struct fsl_edma_desc *to_fsl_edma_desc(struct virt_dma_desc *vd) void fsl_edma_disable_request(struct fsl_edma_chan *fsl_chan); void fsl_edma_enable_request(struct fsl_edma_chan *fsl_chan); +void fsl_edma3_disable_request(struct fsl_edma_chan *fsl_chan); +void fsl_edma3_enable_request(struct fsl_edma_chan *fsl_chan); void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, unsigned int slot, bool enable); void fsl_edma_free_desc(struct virt_dma_desc *vdesc); @@ -233,6 +256,7 @@ int fsl_edma_pause(struct dma_chan *chan); int fsl_edma_resume(struct dma_chan *chan); int fsl_edma_slave_config(struct dma_chan *chan, struct dma_slave_config *cfg); +void fsl_edma_get_realcnt(struct fsl_edma_chan *fsl_chan); enum dma_status fsl_edma_tx_status(struct dma_chan *chan, dma_cookie_t cookie, struct dma_tx_state *txstate); struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( @@ -249,6 +273,7 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan); void fsl_edma_free_chan_resources(struct dma_chan *chan); void fsl_edma_cleanup_vchan(struct dma_device *dmadev); void fsl_edma_setup_regs(struct fsl_edma_engine *edma); +void fsl_edma3_setup_regs(struct fsl_edma_chan *fsl_chan); void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, struct fsl_edma_hw_tcd *tcd); diff --git a/drivers/dma/fsl-edma3.c b/drivers/dma/fsl-edma3.c new file mode 100644 index 00000000..1415682 --- /dev/null +++ b/drivers/dma/fsl-edma3.c @@ -0,0 +1,493 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * drivers/dma/fsl-edma3.c + * + * Copyright 2020 NXP + * + * Driver for NXP eDMA3 engine which is based on fsl-edma.c. eDMA3 could + * be found on i.mx8qm/qxp/8ulp etc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "fsl-edma-common.h" + +#define ARGS_RX BIT(0) +#define ARGS_REMOTE BIT(1) + +/* channel name template define in dts */ +#define CHAN_PREFIX "edma0-chan" +#define CHAN_POSFIX "-tx" + +struct fsl_edma3_engine { + unsigned long irqflag; + struct fsl_edma_engine fsl_edma; +}; + +static struct fsl_edma3_engine *to_fsl_edma3(struct fsl_edma_engine *t) +{ + return container_of(t, struct fsl_edma3_engine, fsl_edma); +} + +static irqreturn_t fsl_edma3_irq_handler(int irq, void *dev_id) +{ + struct fsl_edma_chan *fsl_chan = dev_id; + struct fsl_edma_engine *fsl_edma = fsl_chan->edma; + struct edma_regs *regs = &fsl_chan->regs; + unsigned int intr; + irqreturn_t ret = IRQ_HANDLED; + + spin_lock(&fsl_chan->vchan.lock); + + /* Ignore this interrupt if this channels has been free-ed */ + if (!fsl_chan->tcd_pool) + goto irq_handled; + + intr = edma_readl(fsl_edma, regs->intl); + if (!intr) { + ret = IRQ_NONE; + goto irq_handled; + } + + edma_writel(fsl_edma, 1, regs->intl); + + /* Ignore this interrupt since channel has been disabled already */ + if (!fsl_chan->edesc) + goto irq_handled; + + if (!fsl_chan->edesc->iscyclic) { + fsl_edma_get_realcnt(fsl_chan); + 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); + +irq_handled: + spin_unlock(&fsl_chan->vchan.lock); + + return ret; +} + + +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; + + 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); + if (fsl_chan->hw_chanid == dma_spec->args[0]) { + chan = dma_get_slave_channel(chan); + chan->device->privatecnt++; + fsl_chan->priority = dma_spec->args[1]; + fsl_chan->is_rx = dma_spec->args[2] & ARGS_RX; + fsl_chan->is_remote = dma_spec->args[2] & ARGS_REMOTE; + mutex_unlock(&fsl_edma->fsl_edma_mutex); + return chan; + } + } + mutex_unlock(&fsl_edma->fsl_edma_mutex); + + return NULL; +} + +static int +fsl_edma3_parse_chanirq(struct platform_device *pdev, + struct fsl_edma_chan *fsl_chan, int i) +{ + struct device_node *np = pdev->dev.of_node; + const char *txirq_name; + char chanid[3], id_len = 0; + struct resource *res; + unsigned long hwid; + int ret; + /* Get per channel membase */ + res = platform_get_resource(pdev, IORESOURCE_MEM, i); + fsl_chan->chan_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(fsl_chan->chan_base)) + return PTR_ERR(fsl_chan->chan_base); + + /* Get the hardware chanel id by the channel membase + * channel0:0x10000, channel1:0x20000... total 32 channels + */ + fsl_chan->hw_chanid = (res->start >> 16) & 0x1f; + + ret = of_property_read_string_index(np, "interrupt-names", i, + &txirq_name); + if (ret) { + dev_err(&pdev->dev, "read interrupt-names fail.\n"); + return ret; + } + /* Get channel id length from dts, one-digit or double-digit */ + id_len = strlen(txirq_name) - strlen(CHAN_PREFIX) - + strlen(CHAN_POSFIX); + if (id_len != 2 && id_len != 1) { + dev_err(&pdev->dev, "%s is edmaX-chanX-tx in dts?\n", + res->name); + return -EINVAL; + } + /* Grab channel id from txirq_name */ + strlcpy(chanid, txirq_name + strlen(CHAN_PREFIX), id_len + 1); + + /* check if the channel id match well with hw_chanid */ + ret = kstrtoul(chanid, 0, &hwid); + if (ret || hwid != fsl_chan->hw_chanid) { + dev_err(&pdev->dev, "%s,mismatch id/address!\n", txirq_name); + return -EINVAL; + } + + fsl_chan->txirq = platform_get_irq_byname(pdev, txirq_name); + if (fsl_chan->txirq < 0) { + dev_err(&pdev->dev, "Can't get %s irq.\n", txirq_name); + return -EINVAL; + } + + memcpy(fsl_chan->chan_name, txirq_name, strlen(txirq_name)); + + fsl_edma3_setup_regs(fsl_chan); + + return 0; +} + +static int fsl_edma3_request_chanirq(struct fsl_edma_chan *fsl_chan) +{ + struct fsl_edma3_engine *fsl_edma3 = to_fsl_edma3(fsl_chan->edma); + struct device *fsl_edma3_dev = fsl_edma3->fsl_edma.dma_dev.dev; + const char *txirq_name = fsl_chan->chan_name; + int ret; + + pm_runtime_get_sync(fsl_chan->dev); + + /* clear meaningless pending irq anyway */ + if (edma_readl(&fsl_edma3->fsl_edma, fsl_chan->regs.intl)) + edma_writel(&fsl_edma3->fsl_edma, 1, fsl_chan->regs.intl); + + ret = devm_request_irq(fsl_edma3_dev, fsl_chan->txirq, + fsl_edma3_irq_handler, fsl_edma3->irqflag, txirq_name, + fsl_chan); + if (ret) { + dev_err(fsl_edma3_dev, "Can't register %s IRQ.\n", + txirq_name); + return ret; + } + + return 0; +} + +static int fsl_edma3_free_chanirq(struct fsl_edma_chan *fsl_chan) +{ + struct fsl_edma3_engine *fsl_edma3 = to_fsl_edma3(fsl_chan->edma); + struct device *fsl_edma3_dev = fsl_edma3->fsl_edma.dma_dev.dev; + unsigned long flags; + + devm_free_irq(fsl_edma3_dev, fsl_chan->txirq, fsl_chan); + + spin_lock_irqsave(&fsl_chan->vchan.lock, flags); + + fsl_chan->tcd_pool = NULL; + + if (edma_readl(&fsl_edma3->fsl_edma, fsl_chan->regs.intl)) + edma_writel(&fsl_edma3->fsl_edma, 1, fsl_chan->regs.intl); + + spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); + + pm_runtime_put_sync(fsl_chan->dev); + + return 0; +} + +static struct fsl_edma_drvdata imx8q_data = { + .version = v4, + .is_split = true, + .en_req = fsl_edma3_enable_request, + .dis_req = fsl_edma3_disable_request, + .request_irq = fsl_edma3_request_chanirq, + .free_irq = fsl_edma3_free_chanirq, +}; + +static const struct of_device_id fsl_edma3_dt_ids[] = { + { .compatible = "fsl,imx8qm-edma", .data = &imx8q_data}, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, fsl_edma3_dt_ids); + +static int fsl_edma3_probe(struct platform_device *pdev) +{ + const struct of_device_id *of_id = + of_match_device(fsl_edma3_dt_ids, &pdev->dev); + struct device_node *np = pdev->dev.of_node; + struct fsl_edma3_engine *fsl_edma3; + struct fsl_edma_engine *fsl_edma; + const struct fsl_edma_drvdata *drvdata = NULL; + struct fsl_edma_chan *fsl_chan; + int len, chans; + int ret, i; + + if (of_id) + drvdata = of_id->data; + if (!drvdata) { + dev_err(&pdev->dev, "unable to find driver data\n"); + return -EINVAL; + } + + ret = of_property_read_u32(np, "dma-channels", &chans); + if (ret) { + dev_err(&pdev->dev, "Can't get dma-channels.\n"); + return ret; + } + + len = sizeof(*fsl_edma3) + sizeof(*fsl_chan) * chans; + fsl_edma3 = devm_kzalloc(&pdev->dev, len, GFP_KERNEL); + if (!fsl_edma3) + return -ENOMEM; + + /* Audio edma rx/tx channel shared interrupt */ + if (of_property_read_bool(np, "shared-interrupt")) + fsl_edma3->irqflag = IRQF_SHARED; + + fsl_edma = &fsl_edma3->fsl_edma; + fsl_edma->drvdata = drvdata; + fsl_edma->n_chans = chans; + mutex_init(&fsl_edma->fsl_edma_mutex); + + 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->edma = fsl_edma; + fsl_chan->pm_state = RUNNING; + fsl_chan->idle = true; + fsl_chan->dma_dir = DMA_NONE; + fsl_chan->vchan.desc_free = fsl_edma_free_desc; + + ret = fsl_edma3_parse_chanirq(pdev, fsl_chan, i); + if (ret) + return ret; + + vchan_init(&fsl_chan->vchan, &fsl_edma->dma_dev); + } + + dma_cap_set(DMA_PRIVATE, fsl_edma->dma_dev.cap_mask); + dma_cap_set(DMA_SLAVE, fsl_edma->dma_dev.cap_mask); + dma_cap_set(DMA_CYCLIC, fsl_edma->dma_dev.cap_mask); + + fsl_edma->dma_dev.dev = &pdev->dev; + fsl_edma->dma_dev.device_alloc_chan_resources + = fsl_edma_alloc_chan_resources; + fsl_edma->dma_dev.device_free_chan_resources + = fsl_edma_free_chan_resources; + fsl_edma->dma_dev.device_tx_status = fsl_edma_tx_status; + fsl_edma->dma_dev.device_prep_slave_sg = fsl_edma_prep_slave_sg; + fsl_edma->dma_dev.device_prep_dma_cyclic = fsl_edma_prep_dma_cyclic; + fsl_edma->dma_dev.device_config = fsl_edma_slave_config; + fsl_edma->dma_dev.device_pause = fsl_edma_pause; + fsl_edma->dma_dev.device_resume = fsl_edma_resume; + fsl_edma->dma_dev.device_terminate_all = fsl_edma_terminate_all; + fsl_edma->dma_dev.device_issue_pending = fsl_edma_issue_pending; + + fsl_edma->dma_dev.src_addr_widths = FSL_EDMA_BUSWIDTHS; + fsl_edma->dma_dev.dst_addr_widths = FSL_EDMA_BUSWIDTHS; + fsl_edma->dma_dev.directions = BIT(DMA_DEV_TO_MEM) | + BIT(DMA_MEM_TO_DEV); + + platform_set_drvdata(pdev, fsl_edma3); + + ret = dma_async_device_register(&fsl_edma->dma_dev); + if (ret) { + dev_err(&pdev->dev, + "Can't register Freescale eDMA engine. (%d)\n", ret); + return ret; + } + + /* Attach power domains from dts for each dma chanel device */ + for (i = 0; i < fsl_edma->n_chans; i++) { + struct fsl_edma_chan *fsl_chan = &fsl_edma->chans[i]; + const char *domn = "edma0-chan01"; + struct device_link *link; + struct device *dev; + + ret = of_property_read_string_index(np, "power-domain-names", + i, &domn); + if (ret) { + dev_err(dev, "parse domain names error.(%d)\n", ret); + ret = -EINVAL; + goto failed_after_register; + } + + dev = dev_pm_domain_attach_by_name(&pdev->dev, domn); + if (IS_ERR_OR_NULL(dev)) { + if (PTR_ERR(dev) == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + goto failed_after_register; + } + + dev_err(&pdev->dev, "edma channel attach failed.\n"); + ret = -EINVAL; + goto failed_after_register; + } + link = device_link_add(&pdev->dev, dev, DL_FLAG_STATELESS | + DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE); + if (IS_ERR(link)) { + dev_err(&pdev->dev, "Failed to add link to %s: %ld\n", + domn, PTR_ERR(link)); + ret = -EINVAL; + goto failed_after_register; + } + + fsl_chan->dev = dev; + /* clear meaningless pending irq anyway */ + edma_writel(fsl_edma, 1, fsl_chan->regs.intl); + pm_runtime_put_sync(dev); + } + + ret = of_dma_controller_register(np, fsl_edma3_xlate, fsl_edma); + if (ret) { + dev_err(&pdev->dev, + "Can't register Freescale eDMA of_dma. (%d)\n", ret); + goto failed_after_register; + } + + pm_runtime_dont_use_autosuspend(&pdev->dev); + pm_runtime_enable(&pdev->dev); + + return 0; + +failed_after_register: + dma_async_device_unregister(&fsl_edma->dma_dev); + return ret; +} + +static int fsl_edma3_remove(struct platform_device *pdev) +{ + struct fsl_edma3_engine *fsl_edma3 = platform_get_drvdata(pdev); + struct fsl_edma_engine *fsl_edma = &fsl_edma3->fsl_edma; + struct device_node *np = pdev->dev.of_node; + + fsl_edma_cleanup_vchan(&fsl_edma->dma_dev); + of_dma_controller_free(np); + dma_async_device_unregister(&fsl_edma->dma_dev); + + return 0; +} + +static int fsl_edma3_suspend_late(struct device *dev) +{ + struct fsl_edma3_engine *fsl_edma3 = dev_get_drvdata(dev); + struct fsl_edma_engine *fsl_edma = &fsl_edma3->fsl_edma; + struct fsl_edma_chan *fsl_chan; + unsigned long flags; + int i; + + for (i = 0; i < fsl_edma->n_chans; i++) { + fsl_chan = &fsl_edma->chans[i]; + + if (pm_runtime_status_suspended(fsl_chan->dev)) + continue; + + spin_lock_irqsave(&fsl_chan->vchan.lock, flags); + /* Make sure chan is idle or will force disable. */ + if (unlikely(!fsl_chan->idle)) { + dev_warn(dev, "WARN: There is non-idle channel."); + fsl_edma3_disable_request(fsl_chan); + } + /* Get the processed tcd number for resume back */ + if (fsl_chan->edesc) + fsl_edma_get_realcnt(fsl_chan); + + fsl_chan->pm_state = SUSPENDED; + spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); + } + + return 0; +} + +static int fsl_edma3_resume_early(struct device *dev) +{ + struct fsl_edma3_engine *fsl_edma3 = dev_get_drvdata(dev); + struct fsl_edma_engine *fsl_edma = &fsl_edma3->fsl_edma; + struct fsl_edma_chan *fsl_chan; + unsigned long flags; + int i; + + for (i = 0; i < fsl_edma->n_chans; i++) { + fsl_chan = &fsl_edma->chans[i]; + + if (pm_runtime_status_suspended(fsl_chan->dev)) + continue; + + /* setup tcd before channel resume in case it's paused */ + if (fsl_chan->edesc) { + u32 next = (fsl_chan->processed + 1) % + fsl_chan->edesc->n_tcds; + + fsl_edma_set_tcd_regs(fsl_chan, + fsl_chan->edesc->tcd[next].vtcd); + } + + spin_lock_irqsave(&fsl_chan->vchan.lock, flags); + fsl_chan->pm_state = RUNNING; + spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags); + } + + return 0; +} + +/* + * eDMA provides the service to others, so it should be suspend late + * and resume early. When eDMA suspend, all of the clients should stop + * the DMA data transmission and let the channel idle. + */ +static const struct dev_pm_ops fsl_edma3_pm_ops = { + .suspend_late = fsl_edma3_suspend_late, + .resume_early = fsl_edma3_resume_early, +}; + +static struct platform_driver fsl_edma3_driver = { + .driver = { + .name = "imx8qm-edma", + .of_match_table = fsl_edma3_dt_ids, + .pm = &fsl_edma3_pm_ops, + }, + .probe = fsl_edma3_probe, + .remove = fsl_edma3_remove, +}; + +static int __init fsl_edma3_init(void) +{ + return platform_driver_register(&fsl_edma3_driver); +} +subsys_initcall(fsl_edma3_init); + +static void __exit fsl_edma3_exit(void) +{ + platform_driver_unregister(&fsl_edma3_driver); +} +module_exit(fsl_edma3_exit); + +MODULE_ALIAS("platform:imx8qm-edma"); +MODULE_DESCRIPTION("NXP i.mx8qm/qxp eDMA engine driver"); +MODULE_LICENSE("GPL v2"); From patchwork Thu Jul 2 15:08:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11637883 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3AAD739 for ; Thu, 2 Jul 2020 06:54:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4684214F1 for ; Thu, 2 Jul 2020 06:54:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="IkAkIq7u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbgGBGyR (ORCPT ); Thu, 2 Jul 2020 02:54:17 -0400 Received: from mail-eopbgr60071.outbound.protection.outlook.com ([40.107.6.71]:12347 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727051AbgGBGyQ (ORCPT ); Thu, 2 Jul 2020 02:54:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IRqmT/8wfU3jLR7WAXP3j4oyPkZ4EqOG24/zIrmCywl4u6SiYY68e1FT7H1z05wXUZncAQb1hdHsAhH+7pTqqtcU5lfxUkOuBxXZ8woBCE4aBr7c+KYzZwvfUKLL9QapI1AtF23r7UmuxCEbv88tZcaj3dJj8JNTGvlX7Bpzk9nTvATWzso2z9DRUQ8PTAdHZD19Yq0lcc6jLThojvdqVcvKaPaKj0Bs/VqLjyHjyEnP2JYqpf3R8otfRfUOTRkTZmrTl+x0INZysitnCrnr4vP/jFWgSaLfYcSkIV9g9EswBc4hbhfW0L+reeG1oNpV/8RDGtdw8t5GPwyhPwbDqQ== 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-SenderADCheck; bh=y2e5NcwrTTSg6jKCPg6PnlO3CjYS3J277pi6JJiawao=; b=c5dURlY6z6NS8R5I5F6iv5AVGLKbewyjez5BKekt3lvPweVF8Gne5l5yNY6MplKkuz1hGYUgIT/pz6+zKvgmzep7zB7Qdfc/y60jKsHB+bnNoWtSDt83ae7FeVAQ6lYHKKiY52MMjfX0rd+26rWrrb9/4da7bgngIqIShsu9xlU8HwJd2A5HUKV7+DoyhQPuE91qGFc/kEKleXU++Xg0LotLFfBwmC1eT/qy17djWln9xCzsAZQnxbFV46R99v6urDLaWM/YM3ylJ4LKbas8Fbr7vxWEct0t6PV7Ft8609ky4CLdyMDtWjSeRnEx4Rf0nKz9R760sOz+bC4eLexpOg== 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=y2e5NcwrTTSg6jKCPg6PnlO3CjYS3J277pi6JJiawao=; b=IkAkIq7unDzdPH8p9X+PEHC+TXSMYbDNXHhFsLGxXwj3YkXAoRZNch0WBQAFkYKvSn0gyubNjVffenflBo0FgBzmac8cCr4GcEucbwuW7UM6G5sNLnMNBP0eh20LRb7yQzYhso6U8VALbFpZ1kLoHtYk+VPgpjfFKxA/+lrob4o= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 2 Jul 2020 06:54:06 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3153.024; Thu, 2 Jul 2020 06:54:06 +0000 From: Robin Gong To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 6/9] dt-bindings: dma: add fsl-edma3 yaml Date: Thu, 2 Jul 2020 23:08:06 +0800 Message-Id: <1593702489-21648-7-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> References: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.67) by SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.24 via Frontend Transport; Thu, 2 Jul 2020 06:54:02 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 02c86b8a-d3f8-401b-3973-08d81e54b689 X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-Forefront-PRVS: 0452022BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rgLN9uKChleqMJAuCdhFN23NANqt38zb4IoZGF3XW6SFuiriQO7WgTXBbsM0ZQpqNZuB6jZLD1c4JtUyZC1FxViPjbmd4CRN6SDRg7zxPHF8+lPL1hN4c2PsZlVeXvY5R4TKL1J+RvnY1UJ3xMEEIF5TGb9TpY7ID6xw9qEfYg4tiA9CVrJNBUsd4bg/GMnutg9TIEvDGQwhhjtWsO3Y14pozDhRO60WdThkZkuZ9d6ZeZGe+UsFEv5gzw0S1yxQxfplNva9ob4SF9OR2447gxv0qx0zbV57mPTD9uUEfXhMRmbDG0oy+WTlS+PCimR1i5FZTiAQmhMtdLblPkbiSrabDr1tu9OT13qLJExTLY2Zha8mzbPwfNFihPHYlOQnlPsPjukyYHdtth7x04RDQQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6638.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(376002)(39860400002)(346002)(83380400001)(66476007)(66946007)(66556008)(52116002)(36756003)(8936002)(2616005)(6486002)(956004)(6512007)(186003)(7416002)(4326008)(26005)(2906002)(8676002)(86362001)(966005)(16526019)(478600001)(6506007)(5660300002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wQ/RkjRdivjz0aWYpp7q9+YPH1tVbILeCGpalOyQMb0FwJ6d4Jac7RO9+/kQDvY+v5P0Mfc/nBghQbPf0DPb77vAP8B7eAxuuJawQ7luaMP0f2j4urRPuIm3GPHbkQWlW+v7bItnOVNYb7ajx1UZt67Lbh3Mf59SbhL9BxrucVYqOh0hVIEO5kNT9rYjyBs4GLkZkTticCHmM67IpctkwWqTWoQtZyTXByyLxqDTPskOtCMfmRckHTFVBOXtx3hbd6KhK25EEfVbDcglswIAtK9paOsO+OmNj5BILFKH7JUR5o+8gEeovTmNjqM3hpM8ef9WoxyONZ7Zn6XF2nOaH5trxOIo+ubpCto8l2Is/ifESQLj8i1aK4ZwWhmJrHPpGO8lzo0Rj/que52RVWLuawekwkJbzUVv7IOwA3P4JvmL80I9gJ2Pz95rTFjYfAQyO7+DgNPNkqk42KgAhbUb4c7SOZTP5JLFVOc8KRjgWrI= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02c86b8a-d3f8-401b-3973-08d81e54b689 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2020 06:54:06.3856 (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: TIqqedBCuwRF2Z18DBF1+6ADqIDeQwodzEnhnZyZV1thi1fb2S7pHgIGFME/8L413K+4RV0bAXPh8HInyO4jVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Add device binding doc for fsl-edma3 driver. Signed-off-by: Robin Gong --- .../devicetree/bindings/dma/nxp,fsl-edma3.yaml | 129 +++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/nxp,fsl-edma3.yaml diff --git a/Documentation/devicetree/bindings/dma/nxp,fsl-edma3.yaml b/Documentation/devicetree/bindings/dma/nxp,fsl-edma3.yaml new file mode 100644 index 00000000..d1b47a6 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/nxp,fsl-edma3.yaml @@ -0,0 +1,129 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma/nxp,fsl-edma3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP eDMA3 Controller + +maintainers: + - Robin Gong + +allOf: + - $ref: "dma-controller.yaml#" + +properties: + compatible: + items: + - enum: + - fsl,imx8qm-edma # i.mx8qm/qxp + + reg: + maxItems: 1 + + interrupts: + minItems: 2 + maxItems: 32 + + interrupt-names: + minItems: 2 + maxItems: 32 + items: + - pattern: "^edma[0-2]-chan[0-31]-tx|rx+$" + - pattern: "^edma[0-2]-chan[0-31]-tx|rx+$" + - pattern: "^edma[0-2]-chan[0-31]-tx|rx+$" + - pattern: "^edma[0-2]-chan[0-31]-tx|rx+$" + - pattern: "^edma[0-2]-chan[0-31]-tx|rx+$" + - pattern: "^edma[0-2]-chan[0-31]-tx|rx+$" + - pattern: "^edma[0-2]-chan[0-31]-tx|rx+$" + - pattern: "^edma[0-2]-chan[0-31]-tx|rx+$" + + '#dma-cells': + const: 3 + description: | + The 1st cell specifies the channel ID. + + The 2nd cell specifies the channel priority. + + The 3rd cell specifies the channel attributes: + bit0 transmit or receive. + 0 = transmit + 1 = receive + bit1 local or remote access. + 0 = local + 1 = remote + bit2 dualfifo case or not(only in Audio cyclic now). + 0 = not dual fifo case + 1 = dualfifo case. + + dma-channels: + minimum: 2 + maximum: 32 + + power-domains: + minItems: 2 + maxItems: 32 + items: + - pattern: "^edma[0-2]-chan[0-31]$" + - pattern: "^edma[0-2]-chan[0-31]$" + - pattern: "^edma[0-2]-chan[0-31]$" + - pattern: "^edma[0-2]-chan[0-31]$" + - pattern: "^edma[0-2]-chan[0-31]$" + - pattern: "^edma[0-2]-chan[0-31]$" + - pattern: "^edma[0-2]-chan[0-31]$" + - pattern: "^edma[0-2]-chan[0-31]$" + +required: + - compatible + - reg + - interrupts + - interrupt-names + - '#dma-cells' + - dma-channels + - power-domains + - power-domain-names + +additionalProperties: false + +examples: + - | + #include + #include + + edma2: dma-controller@5a1f0000 { + compatible = "fsl,imx8qm-edma"; + reg = <0x5a280000 0x10000>, /* channel8 UART0 rx */ + <0x5a290000 0x10000>, /* channel9 UART0 tx */ + <0x5a2a0000 0x10000>, /* channel10 UART1 rx */ + <0x5a2b0000 0x10000>, /* channel11 UART1 tx */ + <0x5a2c0000 0x10000>, /* channel12 UART2 rx */ + <0x5a2d0000 0x10000>, /* channel13 UART2 tx */ + <0x5a2e0000 0x10000>, /* channel14 UART3 rx */ + <0x5a2f0000 0x10000>; /* channel15 UART3 tx */ + #dma-cells = <3>; + dma-channels = <8>; + interrupts = , + , + , + , + , + , + , + ; + interrupt-names = "edma2-chan8-rx", "edma2-chan9-tx", + "edma2-chan10-rx", "edma2-chan11-tx", + "edma2-chan12-rx", "edma2-chan13-tx", + "edma2-chan14-rx", "edma2-chan15-tx"; + power-domains = <&pd IMX_SC_R_DMA_2_CH8>, + <&pd IMX_SC_R_DMA_2_CH9>, + <&pd IMX_SC_R_DMA_2_CH10>, + <&pd IMX_SC_R_DMA_2_CH11>, + <&pd IMX_SC_R_DMA_2_CH12>, + <&pd IMX_SC_R_DMA_2_CH13>, + <&pd IMX_SC_R_DMA_2_CH14>, + <&pd IMX_SC_R_DMA_2_CH15>; + power-domain-names = "edma2-chan8", "edma2-chan9", + "edma2-chan10", "edma2-chan11", + "edma2-chan12", "edma2-chan13", + "edma2-chan14", "edma2-chan15"; + }; From patchwork Thu Jul 2 15:08:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11637885 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66A98739 for ; Thu, 2 Jul 2020 06:54:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46DE1208B8 for ; Thu, 2 Jul 2020 06:54:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="oK/0I2Cg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727784AbgGBGyV (ORCPT ); Thu, 2 Jul 2020 02:54:21 -0400 Received: from mail-eopbgr60071.outbound.protection.outlook.com ([40.107.6.71]:12347 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726858AbgGBGyU (ORCPT ); Thu, 2 Jul 2020 02:54:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E5AH6uEfaqlU5xcZZdCqe9ZQISikhhaUtnzyBoo/Xa8hN6vKNHwhQrroZQOBM0dn9l6JWE18WdXEROUZcvlu7QMz9O5sEAnvkcSRISpIGsuqmExCKfHxoP4yHD1Mph4uQOmD6bDzfY4v0n0Fg8wady2vgD+rGTR54NQovhHXp/liWTxllOflOEhul4MjRa9sX8+qAQyfA1ltluO5YlAYk7AKRuMaf24KycWn7je2Io4GPf4u7zB6dntzmJpPhvk++vHiX20/IcvnJAV288uyfhljbkkW3wLvnYhwl0ofCtRiHbduhKppc1gOKLf7q3UTluCUex1LDeRav78Fjb2YyA== 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-SenderADCheck; bh=2oPNSBxTNY2/skpU+HftgqZlcyRxLbDifUvEbmUW7J8=; b=HE0JMUl+Y6z/Kphi/bqKqmFEOtYOBE04LkpNDJQdhoF0XwUcku2A2bRUC8FyxMZJip2iOPE5wS7pTy+nNxPMZcLaLrKZESr8ixOQHwjVidDgtL6KeUSh59aIFPLmlcOpmCqcmoPp8hDX6rsS90QAIYdoZbdpJPACN9Guf31P2dMkeZj9lG5++lomsaSDSpWH/usDQPzLPacuumHBQ0J/QcQ0Ogv22avT9cwoEaqPVKajy0B6J8ldYXq0sTauXqlXs7U04Va3Qs7QLfMMilWDRaARd13zSSF/QQ9ZD0DQCctw8ePzLMj8EnKQONgjLh8Bzh4VHM0ru1cflCqmZ9cKbA== 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=2oPNSBxTNY2/skpU+HftgqZlcyRxLbDifUvEbmUW7J8=; b=oK/0I2CgxTAGEaBzsziNmTH9kbDOLd7XMiNoBohav7pwpxDHy9d67LIra1DsG7W6yS4xtpXLviFAavuLGp/RLbUJFAe4n8S4eUNqfqTBniQLWQtKUQAESKfMhAoDiNC8FF1+FzvfdcOlHBn65tor0TI0Vq8LID/FnRyRY0KsCfs= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 2 Jul 2020 06:54:11 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3153.024; Thu, 2 Jul 2020 06:54:11 +0000 From: Robin Gong To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 7/9] firmware: imx: scu-pd: correct dma resource Date: Thu, 2 Jul 2020 23:08:07 +0800 Message-Id: <1593702489-21648-8-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> References: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.67) by SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.24 via Frontend Transport; Thu, 2 Jul 2020 06:54:06 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c46b4698-64b2-45a1-2dbc-08d81e54b972 X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:538; X-Forefront-PRVS: 0452022BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DlRrE58K5/b7DhlJsb0THjFrYVS+S4DJ3V4T1Kn9RjmYhQeXodA9H7TdJbE4yvAEmbUOx78GP8+gHfGL56KQUiBWiNvE+pxeNsqaSeXxcexpRQXbLqe950YJrtwor+UXp4vta3XKMnx8jTUCJI6jiuGdWhgYASi/wNScJcCIOf7QqFCqRc+/JHh0oGI4OOp22w7wEzAaoA+bQ5gH/d8j38mD3tADDCI/f9memK7vR3hf2Ycx3pY7MH4OwQNVvwRMbil57M11GZC0GGgX8XW3sh28/U4PezF21Xsxfx5em7eHYlD75ZQmJ0NvLjsMn7DKnSBNfj3k/sNNXGZ4qx1+0w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6638.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(376002)(39860400002)(346002)(83380400001)(66476007)(66946007)(66556008)(52116002)(36756003)(8936002)(2616005)(6486002)(956004)(6512007)(186003)(7416002)(4326008)(26005)(2906002)(8676002)(86362001)(16526019)(478600001)(6506007)(5660300002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: uIMk7m+qw9+tff0rNCnz3swPgxtC3u2rpv/esLM2f24DRrKkSEzVyuJLrIMqvqrjeE91af3LlsWaikT4mE8Pr05larN17kiY7YOG7dWm4tbkGpxgL+DV5stemrj2pYh/XtMngOjXPYcCPaCBECDrTs7xzvEC3xT9FyNoGx7DSBZWRb6tFyu0St5d9CPWbjLoaczKY8NzQcHthD5wiUVUwdGhBG1XWF8lW7DGTuESK67ICKltlwFl5OPnyfNwZXuokbOwCpAfHJ0P7FptRI19ZgG6OXbpuT8ykV2weTFUkiz4yDX/yWlFuCqg/8ZOAF69omSs96+uEiLxqJUmjY14VdHs7q3Q7ViBHxCAyI9JuX2DgpdgOpF2k4rLLhffjKCwx//VYAhoKr6vz7lmCpAtXdjrfUPagPs3INrfpUfpG0eHoXBCS5rOmCI5tv2rUluARF8jAT0/1ZIFQsXAbwDbfMyTZIODfxC3ZSnx5pSiVsw= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c46b4698-64b2-45a1-2dbc-08d81e54b972 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2020 06:54:11.3757 (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: sEOtPndWdTG+9DZo5rpzjoCB5FBdLDWACKmRcSQ1KQyv4DCxd5P/3nGB36elyX/xZoPCD0zpWRDtqAoRCCZSVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org enlarge dma0/dma1 channel resource to 32 and split two parts of dma2 since their resource id are not continouse. Signed-off-by: Robin Gong --- drivers/firmware/imx/scu-pd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/imx/scu-pd.c b/drivers/firmware/imx/scu-pd.c index af3d6d9..9818890 100644 --- a/drivers/firmware/imx/scu-pd.c +++ b/drivers/firmware/imx/scu-pd.c @@ -110,9 +110,10 @@ static const struct imx_sc_pd_range imx8qxp_scu_pd_ranges[] = { { "audio-pll1", IMX_SC_R_AUDIO_PLL_1, 1, false, 0 }, { "audio-clk-0", IMX_SC_R_AUDIO_CLK_0, 1, false, 0 }, { "audio-clk-1", IMX_SC_R_AUDIO_CLK_1, 1, false, 0 }, - { "dma0-ch", IMX_SC_R_DMA_0_CH0, 16, true, 0 }, - { "dma1-ch", IMX_SC_R_DMA_1_CH0, 16, true, 0 }, - { "dma2-ch", IMX_SC_R_DMA_2_CH0, 5, true, 0 }, + { "dma0-ch", IMX_SC_R_DMA_0_CH0, 32, true, 0 }, + { "dma1-ch", IMX_SC_R_DMA_1_CH0, 32, true, 0 }, + { "dma2-ch0", IMX_SC_R_DMA_2_CH0, 5, true, 0 }, + { "dma2-ch1", IMX_SC_R_DMA_2_CH5, 27, true, 0 }, { "asrc0", IMX_SC_R_ASRC_0, 1, false, 0 }, { "asrc1", IMX_SC_R_ASRC_1, 1, false, 0 }, { "esai0", IMX_SC_R_ESAI_0, 1, false, 0 }, From patchwork Thu Jul 2 15:08:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11637887 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1530C739 for ; Thu, 2 Jul 2020 06:54:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC47520BED for ; Thu, 2 Jul 2020 06:54:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="c2RO14Eq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726442AbgGBGy3 (ORCPT ); Thu, 2 Jul 2020 02:54:29 -0400 Received: from mail-eopbgr60071.outbound.protection.outlook.com ([40.107.6.71]:12347 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727051AbgGBGyY (ORCPT ); Thu, 2 Jul 2020 02:54:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VEuXRCCB8RWSRNn0kW9ZIkw8eUW+bmxXEbSNjwouIc6As/QtWQCw/NzaAZDGY3D3qZwMcSNQFGrwz+f8aO8YgZdamg2A49vMSVG6L1q2hRx5lDXEjM8VFkftrqcJIWrtgHoMHBnAsoya+CblkM53O3GX4NI4+CNyjWuJDjGJGAw9ypP7J1HhwtxMDDLCeRkmZDigsjh/Q/TxSyA7pIYUKLQxSsyG5YV31BfXo/X9uW9LSzP0BYeFZISAhd8bCN5bge+CGakMtwNpDf9OoIRhOu9suQ6opA39k8NniPAqN1NHyv9iXe6qKdL9uCLscWeTSYiM2aIfYst678VODeymQA== 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-SenderADCheck; bh=WyhlYTu0tRkFp9zbFDzlDAa/ti9lPivQitLRWGWiSXc=; b=SaGmiv9jV/1eNQWU2I/1riBrA2vJXNONtCF3k8AwSBgZwCYOhd2WfowpBosNZZcsiFaBerBVkWr77XSuG+CKymEYwnko89dNwN/QfgPwvPkNdo92fVZZmpqjd7fS0hlunLh6aZ6+2Gg5s2joccCScoQZ7yupOWYMSUCAmm07JeNhP1nmDqG4EY5aGibvUdD9SjIOMa6uaZAsB3Xt5IaSS7JJs/v7JwCE3QmVaxhWFBS4cSXLBVdc6mASFfK3UEmyfRF2vWZp4y6y38Uzh/TOAZ3VKcj0x3Dt/dOUZoxEauqXzBjP3QGGcrTZl5QCGNIaECkYb8tknBfIMVbxJPBCZQ== 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=WyhlYTu0tRkFp9zbFDzlDAa/ti9lPivQitLRWGWiSXc=; b=c2RO14Eqjk9mJyhYg+SjStE38da4Ysrh9hzP65Jx/P2Y/RKDvs1dTj2Zw3tF9e55WysqfCQ2cM9I7/yXbV+SaP1qNjM779N3h3jAO13WeU/ZxdPWUo1GVlhYLgDr61nLGAc0vDNzME6Xydls5y64GERoYcpMew9TrISSH1CDPEE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 2 Jul 2020 06:54:16 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3153.024; Thu, 2 Jul 2020 06:54:16 +0000 From: Robin Gong To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 8/9] arm64: dts: imx8qxp: add edma2 Date: Thu, 2 Jul 2020 23:08:08 +0800 Message-Id: <1593702489-21648-9-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> References: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.67) by SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.24 via Frontend Transport; Thu, 2 Jul 2020 06:54:11 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3a2f73a6-895a-42b6-60e3-08d81e54bc3f X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:267; X-Forefront-PRVS: 0452022BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q+juFg+izG+CX7ilyzkPt8gVpGSu7TENJEd8Bd1IQNUViFc0GNEkTKpUezjdmJiPb7L/BBUhf6azt65NK3Df0f7+wv+QYzmMokkHY+QY7dHhnyui0i2+K8vBMFu95LqJ/M8YSIKppkFz+/n7xScAHPe2DgEiMzt0scfZiH52z1fzcIpM0cqRTnlh7M9FsMJlOnWphF+oAI8WUGuQpzG/QUgPt41N2ExKwAt8I73khYK2iw6QjrX+NYeJNyoJW4e7Jc6RCPzrSxxJ9ogwqX07hss3vhx3Xxo42D/EYuTJByCXtfWGf04Nib2XO+EtE8NKhjRYZf7Xkv5atBO2m2C8tPexOnDeVoaDAsA+BFmOPOn8xKMBXnKq3ohSKMYqeo7O X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6638.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(376002)(39860400002)(346002)(83380400001)(66476007)(6666004)(66946007)(66556008)(52116002)(36756003)(8936002)(2616005)(6486002)(956004)(6512007)(186003)(7416002)(4326008)(26005)(2906002)(8676002)(86362001)(16526019)(478600001)(6506007)(5660300002)(316002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: G7GYLlKgQcy3Z7MDWvnZRXSfbhL9yvpIXc6zkoLGZJQyZ2CS33bL5Tg6iF75kZedpqa7VWaT54DDh5Sz6Flw3fTLLFPL+fMME8mogweC7MZj/QHYGeigQ2I20RhsGzvpljkfjILB+SnFDNdL6lMWIJ3fvUasrmcn5WkpuDpkZJT/A00S3uLKJP7i7lmn2Sr7VTgOoqDI/ja8wCiyS3RdqAXbmC05GwIF6/OXN6XK+vGCZBhF+SL+W3pnbu+wK+MXIbloC1VK1CsHHQBOqX8QorbRJDV8rbiaUU1DIdlhWwG4lnrjgKz2zZoLDmY9/sHgo+wJfhz+b+WMWraXmf/ebyrXWGMBSDB7QLdSanoG8TY1cxXjkkhWY2DesBBzZQOzXjDzcRxQ3QVlMUKUZBasJR6SybAew4GDq0teVxxcWX1BGc/ReBLi3twE50GFu7+bTAtyhx6TNqg6gmpkdd4cNJbYCnjbdKvOib8G8S4R6eg= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a2f73a6-895a-42b6-60e3-08d81e54bc3f X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2020 06:54:15.9620 (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: FmfEPpIsEx1wFV04Rs6K8qhiWYT+NZjayF8+TrcD+O4xImACX70kY6bbKrplBoTU6/kmbRwst+UqiXxapWgFuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org add edma2 on i.mx8qxp. Signed-off-by: Robin Gong --- arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi index e46faac..3f4fa59d 100644 --- a/arch/arm64/boot/dts/freescale/imx8qxp.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8qxp.dtsi @@ -300,6 +300,44 @@ status = "disabled"; }; + edma2: dma-controller@5a1f0000 { + compatible = "fsl,imx8qm-edma"; + reg = <0x5a280000 0x10000>, /* channel8 UART0 rx */ + <0x5a290000 0x10000>, /* channel9 UART0 tx */ + <0x5a2a0000 0x10000>, /* channel10 UART1 rx */ + <0x5a2b0000 0x10000>, /* channel11 UART1 tx */ + <0x5a2c0000 0x10000>, /* channel12 UART2 rx */ + <0x5a2d0000 0x10000>, /* channel13 UART2 tx */ + <0x5a2e0000 0x10000>, /* channel14 UART3 rx */ + <0x5a2f0000 0x10000>; /* channel15 UART3 tx */ + #dma-cells = <3>; + dma-channels = <8>; + interrupts = , + , + , + , + , + , + , + ; + interrupt-names = "edma2-chan8-rx", "edma2-chan9-tx", + "edma2-chan10-rx", "edma2-chan11-tx", + "edma2-chan12-rx", "edma2-chan13-tx", + "edma2-chan14-rx", "edma2-chan15-tx"; + power-domains = <&pd IMX_SC_R_DMA_2_CH8>, + <&pd IMX_SC_R_DMA_2_CH9>, + <&pd IMX_SC_R_DMA_2_CH10>, + <&pd IMX_SC_R_DMA_2_CH11>, + <&pd IMX_SC_R_DMA_2_CH12>, + <&pd IMX_SC_R_DMA_2_CH13>, + <&pd IMX_SC_R_DMA_2_CH14>, + <&pd IMX_SC_R_DMA_2_CH15>; + power-domain-names = "edma2-chan8", "edma2-chan9", + "edma2-chan10", "edma2-chan11", + "edma2-chan12", "edma2-chan13", + "edma2-chan14", "edma2-chan15"; + }; + adma_i2c0: i2c@5a800000 { compatible = "fsl,imx8qxp-lpi2c", "fsl,imx7ulp-lpi2c"; reg = <0x5a800000 0x4000>; From patchwork Thu Jul 2 15:08:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11637889 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5101213BD for ; Thu, 2 Jul 2020 06:54:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3218E20BED for ; Thu, 2 Jul 2020 06:54:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="UlPPQ4kN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727097AbgGBGye (ORCPT ); Thu, 2 Jul 2020 02:54:34 -0400 Received: from mail-eopbgr60071.outbound.protection.outlook.com ([40.107.6.71]:12347 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727860AbgGBGy2 (ORCPT ); Thu, 2 Jul 2020 02:54:28 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UZhf5iVOhsOEbDZUzZc6+6T7DqcleXc1wwhHKXBrmRj5mYV0pwURtbDlHKQ3BmECoU6mADo+IixXFrFBnsUdfrW4YVKMjckToHLYSroFN109HN3sq+Myqp9GxasUMRko2V6aN36O0YOiYkNJytWZKhr7OQb7Z1O8Iq5EIZ5YJJ0P2EjZ0QzvihqHhf73HiisBxgiHAvVo6IUrozFywaSSsemTLVb5vEA+tm27AErBUd3QphjJ4jf2fbRWi3bgjsDE2IkM0zLVSNjfS9SRmU8BwcaokeJ+0FIAn5ErDfWzrFBjv4CTRvBCCbejj6ozYcmgXr8WA1Ior88PSNDquXy3Q== 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-SenderADCheck; bh=A2NdxpnZ7ORXZIN0STWcEdx/uXHR9LGHSHi6z30B7x0=; b=T7aEvnweowQFqwHU5iHsBjrMVsnBdIz9EKzQYKDoXjmWrPbJeS0kBZmlovmMnMwoYx5DQZZXzy6oINiDGZjyUECTG9tazN8Gv5Z5xf8Xk+3iDKOoMw18t+7q2zXkujWutBHRPFNhRJiC41xzFcpuEq6FvPFuxJvSpXt3YNcPOYMKXRboGHkx2grEQY4JOdbiowtBddRisl4QShh9I6U4+RBCcpNp1Kd9ZjQTfN1V5ZIrmOzft9ct6PmCEsNzyj8og7q3Yix+yWJWAKesvCGYxqZhW7Rom/rknn/DlvxTD8W2eYexshDietybcsZJyxV/KhO12FKmzjc/A9D71pTdCA== 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=A2NdxpnZ7ORXZIN0STWcEdx/uXHR9LGHSHi6z30B7x0=; b=UlPPQ4kNWquRaX55jWmgKMW3WGh7x897fsPFs2kJyjOx4sc0dr7yCk5/j5EPzj+rNCSuzetHpR6GuLgXXp1rTIeZP9TWA57sXwICox1hgKkfuuFhXkZ0CRKtktQ2zQWefBu1MHjWR584nAnDRkf6q+gcm6Vz6b0uURqk9e517ss= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 2 Jul 2020 06:54:21 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::5cc4:23a5:ca17:da7d%6]) with mapi id 15.20.3153.024; Thu, 2 Jul 2020 06:54:21 +0000 From: Robin Gong To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, catalin.marinas@arm.com, will@kernel.org, dan.j.williams@intel.com, angelo@sysam.it Cc: kernel@pengutronix.de, linux-imx@nxp.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 9/9] arm64: configs: defconfig: add CONFIG_FSL_EDMA3 Date: Thu, 2 Jul 2020 23:08:09 +0800 Message-Id: <1593702489-21648-10-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> References: <1593702489-21648-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.67) by SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3153.24 via Frontend Transport; Thu, 2 Jul 2020 06:54:16 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 10863af6-0982-45af-b54e-08d81e54bf20 X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:843; X-Forefront-PRVS: 0452022BE1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jGFG4eB+Bu/LQgwWFM0sXqnoknm2ibsM7R8CMSWh5An1fTN+g2T+SvWzs0W1We9j4HECer0d10TmDysRaBgflD/2yKk9X49BGhtkcv6Qaq4gH1hylp3O5D3WoLFhwzyYW2cVmtpN+t9yFQSTEorTLNICBh823cvcuj7JTLRHKNyqZegzqwD4kAqB3Adp4r0+g9LY0ogzbdLSBMuqwvMVxNYnjyqrne8gX/bePyvhMoILjdFDliQB2XIRLqggZrAq7HFWhhIMIXp81MvuzHJRLOo0f9k7v4YiPX8EvRPDrxfPBdCTjQMuexSqximMyBEFbGzAoMU/iMAhEEfbcnocmw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6638.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(366004)(376002)(39860400002)(346002)(66476007)(6666004)(66946007)(66556008)(52116002)(36756003)(8936002)(2616005)(6486002)(956004)(6512007)(186003)(7416002)(4326008)(26005)(2906002)(8676002)(86362001)(16526019)(4744005)(478600001)(6506007)(5660300002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: T128/5vYyRZ6l25+y79xZWixw+CxxkwFUiVoiHB5/rXyAiOEPWIDNxQ2WQbH8P5AjvB53YxbDCq6PKLIL5gz5x9lEO4RNHvfcgrH0epn3fj6mUbgiuS75ka/OROVQSohcACSOO3AKFjwD/xaZ3f+kAA1GMRbHVRjVBVuKLbmbQnEHWrpmVhJcX0nbllQSM/eUsJ+2Oj0gRJfq5+cblv6+Q3vRQL2/sd1pQG0p9/A7NUd1Age1GrlymMULkVBi7PcX41aFdGfcIBh48rB2DVEOtYE1sh7VrW/Bg1W/tERx011+KSqgbzSR0q7ylC3415TNy2qt08IShlRw+fCHlsnoNDdVChYq+Lqe/7gFra2GTmTCpv40DB71GuVuifcoeujHpFDxksumK4/rQeFwmiHEo4BY7OUKCi1F8dAz5waGHUj7RQPBda5D+WExmeXnvZpru/tCUxVJ5ItqZmNlZfi4Jjl1nhNCh0dKjzPjjsDRzI= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10863af6-0982-45af-b54e-08d81e54bf20 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2020 06:54:20.8981 (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: 9r0myXAh4MsxYhv3yceY8e7MyiEjOLQXdZpTUCX0KVedkNLnbWvzBeH7zs78dDZkSCve1kGeQH1iHCa4NcX4BA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Add CONFIG_FSL_EDMA3 for i.mx8qxp/i.mx8qm. Signed-off-by: Robin Gong --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index ae76fae..d786bd9 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -770,6 +770,7 @@ CONFIG_DMADEVICES=y CONFIG_DMA_BCM2835=y CONFIG_DMA_SUN6I=m CONFIG_FSL_EDMA=y +CONFIG_FSL_EDMA3=y CONFIG_IMX_SDMA=y CONFIG_K3_DMA=y CONFIG_MV_XOR=y