From patchwork Tue Jul 14 17:41:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11662111 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 44004913 for ; Tue, 14 Jul 2020 09:27:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26F0621582 for ; Tue, 14 Jul 2020 09:27:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Je1xg7zD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbgGNJ10 (ORCPT ); Tue, 14 Jul 2020 05:27:26 -0400 Received: from mail-eopbgr50075.outbound.protection.outlook.com ([40.107.5.75]:5605 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725884AbgGNJ1Z (ORCPT ); Tue, 14 Jul 2020 05:27:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZECcogu7cEgfVOYDa2IUZkotS81U6rdtvKaXhvCLR0Zr+PHy9xu35s6zBLZe+BHPjAiFkzTwYUslIOY6K9NudINAB8VHBZepmVdoFNoM3TEbp+BNS1cMOJHThaWX9ETnGY30K28ON1Ffjj5im5cE2eRtl/fpLCMDaljLD8SqG3tLzxIKF3bvKtPXX59TmuyNnJCR+pShtJolu1KDEI8SK00YmfNIaaiOul4fiVTm2aVOfweEr2setlQ5NmqH5rGQAlh7APyFwGupWbnT7wgdWIsOnyLpK95/7zuOOcXdBo4/zdoORgvyld+ZtJ+nFhThQnLtDYTtmH047Ee78LJvtg== 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=L+qCeu+vNR7iU7rnlboJc7MQGVfqTeVZ72KlC+ifj4ygqWBmiM90rwXdlGqc264m8qtKjWqcggwEnc6FOmkNj814Xbe8+JTCanB2VyGR2EK7ktaM1Kx5zbeDbeHYh0trN4CJrTWWqdB5uN3b3ypHO1efSDXY1F2DcO+gLEY/UM7Ww89DE3agRjypmdOALbW8byPXC+ZwM6eZRddjjBd9FN8ocFPdH6B+CsGYXr/5Oa941tEe2orU3T3zV8Kp6ZMYJsdqrCWDl4MfWx0IIi8WqgMH/vDCioogfESFO+Jg6uuKMrz011DUVQtDHQu6Ym5BrkeQrHJol7Ag0kFE+BppRQ== 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=Je1xg7zDjdUZch+QSRgMSAAAG2m9btcl8gLnpZ4SRxVIbjo0COIZqAKRGwITgloEC7ikPfWWzkvuBUYyD8sCVQGXl0nZHsVq/KByZHmERIxPxnwETncHYjXTNIeH8N9Mfv0ayoBT3Yr9PCIiieL8Al+AdI4Xn+26IFX/nn5BpZg= 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 VI1PR04MB6270.eurprd04.prod.outlook.com (2603:10a6:803:fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Tue, 14 Jul 2020 09:27: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.3174.025; Tue, 14 Jul 2020 09:27: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 v2 1/9] dmaengine: fsl-edma: move edma_request functions into drvdata Date: Wed, 15 Jul 2020 01:41:40 +0800 Message-Id: <1594748508-22179-2-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> References: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) 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 SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3195.17 via Frontend Transport; Tue, 14 Jul 2020 09:27: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: 246fa111-a231-45c7-f81d-08d827d81be6 X-MS-TrafficTypeDiagnostic: VI1PR04MB6270: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s4PZsMIQ6AMaWqvwAGTQD45QOBYofMBP1WthVrpNWHcoEf+QmWrP89cXGM+i9eJOyV4N7sMMc094ht/AsSkTCDZZv6l6d6eKRpJ0zsL0hDK3sRcfu3sVeOGcIZxEvB7qKnxm3rOwn0U6YNWNYmRwaf0AT0L1odHO8+gLGs+ytcU7VtTzyvaMI6r00b/jj1K2o2XNNoJVxddqIFuNPeA5BBAY8iniHO5rBTBDx7GSO+JmAVZqFIPErtGCz1W3weHPgFdpCi7KMo0LBza2/YlQVgE/nW1+ojZ24qzTrFuvo+K8WDAotfe6fV+1+jFIE/PlJkdgRJ8YT9wP8nh983Ivpw== 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)(39860400002)(366004)(396003)(136003)(346002)(376002)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(4326008)(86362001)(2906002)(6506007)(83380400001)(478600001)(36756003)(16526019)(956004)(2616005)(186003)(6666004)(26005)(5660300002)(8676002)(52116002)(7416002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 8G38GCIfqkCXWXoIiUg8I4TBenCrBxmhpNMe+6q0rMzVNuxwRvdCtcB3DrL8yAoMJBRO/aHbyS/egSk06nc3ws9120CJtEuknyQHuAp9dUzF3O01aFw+b1McghzepIWjtEN8crcwH3hXMz3UEKdY5rUmc5eUddX7U7xwMpgM6VdJmNaVrOj3WXqVlHqEr8fwdWocYMPgXuiqT/T795UZHvw45GeljGgyhyT84X/IjN4cNjjrBy+/4iU2d1jOSzRre8yybddfc9PPimMJnDpBwiCdzFoeveMnBFjdcdPtxySNMByRkBwQNcuRP0nyiFzT35WFXM/6HcZM+9q9hHiZYeq0DuO9B/kW4X188GKytpDESI20eRa9tWAR9MioM9KNYcUx1tJy3Z0yQk0+Qv60646lQgB0yM+fCkJmReMwCMvckS46XemxK2k+1zsf4bvnAOrRyFSAAX9E7+BKaEvEEjGoBKAAo3XuP+mHhTNVryA= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 246fa111-a231-45c7-f81d-08d827d81be6 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 09:27:21.2093 (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: oDa4mOgqIRS5em7oe6ASDQQtxbapOhQH2tIcD42udDXoLt4tG1MqQCUWQBGReDziDPtFxuvuQxvT532Eubwo3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6270 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 Tue Jul 14 17:41:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11662113 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 219DF913 for ; Tue, 14 Jul 2020 09:27:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F10F521582 for ; Tue, 14 Jul 2020 09:27:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="JiK/CXhO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbgGNJ1a (ORCPT ); Tue, 14 Jul 2020 05:27:30 -0400 Received: from mail-eopbgr50047.outbound.protection.outlook.com ([40.107.5.47]:59355 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726803AbgGNJ13 (ORCPT ); Tue, 14 Jul 2020 05:27:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dTx/eoPZCh2578MJsi5A3/nuG4Kyq6XY9sTF4tH24ldBml/9CY6RpanynQyCwSO+Rm9H0R0225WhoYdhekW2TT8qsQOx9aw52nYxSe4xxNJ2GF44JnzxeXxPF12UsPTyvzrc4LbmPkeFVCYS7EdeWn4U6LAdqC4C9ECSH/pyIS6aMSaTavT+fE772OLAYDmiFnhl4Bnrhsg1YEoYmC0rW3AlZXNr2AJuE550RqfPxGUAiicBVeoQ2jMgBlFNX02waiW65yZ+BABRl2GRumy/SgGYBXnM+8D2ImrpDoifqbfRTRl2cMTTXTL7NUabeIie5X494uRdpzhHpvqMs4P14g== 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=htrvTrztdXOvCY93YBf7Rci9+6XTiDhVkhrHuRl6gqUnixiZ8nBC77qH9ce/YZSObBeVubeHJaov1IEZ78169M1jlYw1npVb+cHZ0czYXUPN5NKxtiYyEFZfKsPCWXe2G/reqTR90hPkHlvn2mvE4SFdBY4LAOhfNkrLdRYLXJjOKPwHj+8Nr9bufHfFUqonOvFdG3SCiRn3ecqlCOum8eGAu4466flxRisxfo/6Olx1vXLGV/QCORrQ2yXO89YXNwEV/lULVDJ6/apaqKEOYZ5TFCvCXBY+bh4ZfE/I5Wxr4eAzT85jPoNvhYFs346okCGMHvyuJU9HjwIMwyoWrQ== 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=JiK/CXhOTvgX9Uea14OMuHKqbxwszv0SccJBtg/RNfbYxoYFxnIRu/wVFzEVyGdf/eSVmXU5b6z6DeeGkqNhVqQkdPHCvLzU+oeoZ+Lq4iLs77oPwBdmqe6osWqP7iDBGWZaviVgt7mF0ikk0OdSXT6UypOdk3fQLpd9Hy6xQDs= 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 VI1PR04MB6270.eurprd04.prod.outlook.com (2603:10a6:803:fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Tue, 14 Jul 2020 09:27:26 +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.3174.025; Tue, 14 Jul 2020 09:27:26 +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 v2 2/9] dmaengine: fsl-edma-common: add condition check for fsl_edma_chan_mux Date: Wed, 15 Jul 2020 01:41:41 +0800 Message-Id: <1594748508-22179-3-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> References: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) 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 SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3195.17 via Frontend Transport; Tue, 14 Jul 2020 09:27:21 +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: fb5e9702-7499-4f20-d669-08d827d81ec9 X-MS-TrafficTypeDiagnostic: VI1PR04MB6270: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1247; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L533UtPFavhICK6QmU/qzjQ1iG8tSfx4y8g9XNGmBtNnXiUzK87GcZFfyoHWbqxM2zz1G0tY3dm8MXFpmYYTBhdXeVyEUcGnDHp/tTs0Ya2mI0s6+dFtvURLyhw9e3eOHJe2v/rEdfSufLa7QRqMlzVnADFTN/6F9UdxsTL73Et+LssYYOkJejV8UuszRPNSSVmjks7nwmZC7q1LJbeWnDy2hyl8tX3Fj9g1G+Te2EUK+k/xOIAyjTD9rY44gvvQImL39bUeBSZFfvXWCrpmrYpBv4i6ntVdUnfQZFCSoTXlfA9OqZ9cRFyUf60d+inYjfJ3uFzc4F6i8EiVrrc6MQ== 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)(39860400002)(366004)(396003)(136003)(346002)(376002)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(4326008)(86362001)(2906002)(6506007)(83380400001)(478600001)(36756003)(16526019)(956004)(2616005)(186003)(6666004)(26005)(5660300002)(8676002)(52116002)(7416002)(4744005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: EJcZ/kVzw9XOTuPR0JgQp8oa2OqWsHucD5ursn9j9PDkg4qY5dtJ7swtuXSu8khih8/zJzi/t2PVIRwPCBhpnTMClRRjVTR+r0ZdDVUaRY3HIj/3uOSKTlItwu2kfLtrBkSLYzYHPairTjtswN94i/brdHpilzd0IFqfMCLTMIGOfcBBtYP2lvkqSDzmloK76vdzfCcaZdgm0BhwjGq9E7SZHnSWLdpPqtNQcRfZOC7FPX7vDMymYmsepJYv5brFeHxgxdYJIQ5PF3AfTRXg7Zqjb5VuiuxzhsM0O3LlvUFeTJdWMckLgsSlZNxFxZErLDT6n5p+mgvXP7r6mNFhOLni+cUeW0zL0mbx8O/wNFpG/TDJu8eh6fu2rPsTNV3ZMsePjpDAdMss4MDj5bOdwKIhcE6lJeY6e0YJ005acXEetIqHrgrFPoKZTAt7f92aRfvQAkbsUK54fAA7rA44//Wy68VRG4SwTeSx1Fn1e2A= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb5e9702-7499-4f20-d669-08d827d81ec9 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 09:27:25.9416 (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: M79X/HIBQBV/gYIGKIHEpXsFbm+oPKKnyStug9p4z417miw4H4uJOLD/3N2cBeykudUA9wDNyvgZPjVr+UiSyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6270 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 Tue Jul 14 17:41:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11662115 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 9C1A913B4 for ; Tue, 14 Jul 2020 09:27:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C4B1212CC for ; Tue, 14 Jul 2020 09:27:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="hETJGMTP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726855AbgGNJ1f (ORCPT ); Tue, 14 Jul 2020 05:27:35 -0400 Received: from mail-eopbgr50069.outbound.protection.outlook.com ([40.107.5.69]:40878 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725955AbgGNJ1d (ORCPT ); Tue, 14 Jul 2020 05:27:33 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IIdVnGZyUxjb9JIbM9K+RAGayJaKxnHoq4/1vAic08St/3SvG/v9u1jDmy3sVuDCv+h0kD+GvpcyGBFIvS1vWx9JM/fJM+a+IK4zYunVvnaohHPnWapOa/nC1H9ewqvEYSt57oBGBuzfHyFmawK7C575sAKDjGFFpNcqir2t8okV9hziEwYMtM1i5RCQz//S/2+iU1vxsb7lcLNR5VkgobWdHtOllFIfnPQYcqQX51wuOuJqJXk6GjDg9N/1Z77+Kg++iECIjyghF24bzaeZHFwKRjhPlVf9+eiiDDnt5kyGM8Fp8MhWjS2+FDaN3JDzFfAOukfW/wbIgZVJVdwF3w== 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=NOqVFa1jLtIM5lr6MJXuS28HV0BWs/xERzJ+Jibp0NXYL7owfnwqQtwWPbWxvwabwmgGAM1DfoDHjuyF5LOgC//aIYyQZSkYCG6DOtamd/irKaWzfuYDYoNhE8H+7KdBVZkA/uKpDy5wk64zp+kCFxnfg6jIk3+ouAxa9b5KdeYqpt4zE+CQGIoFSBa3qhKIfIJfMEC5+g5clw0cuqrwMt4agX8PTwndOslJQiZ5sqFXkU3IHHukdWvXYgs0/mbb+9VvFZA8UJ1wxcqJpB6HZulYVCN5D3WJc5fq6YRX3ZdYAkPgjnT865FEm7T9GWXzrfzYuSrfInNmFKRdBP+XUA== 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=hETJGMTPJZNg/c7VdkopKrzU7KW8vYBv3R8R26XaYp51DFOYtIfhnt6rC6FYkxECFHEb28Ec0G0qQOMenuCQZwZRKUO10xdUs9ekmHI7OrGKMI5IzH5VIWeAeMjOqH6XH9IwroBY3iFIRr1tFVxgOmZOcI3nlgQK+QL+YTjjjEc= 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 VI1PR04MB6270.eurprd04.prod.outlook.com (2603:10a6:803:fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Tue, 14 Jul 2020 09:27:30 +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.3174.025; Tue, 14 Jul 2020 09:27:30 +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 v2 3/9] dmaengine: fsl-edma-common: add fsl_chan into fsl_edma_fill_tcd Date: Wed, 15 Jul 2020 01:41:42 +0800 Message-Id: <1594748508-22179-4-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> References: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) 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 SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3195.17 via Frontend Transport; Tue, 14 Jul 2020 09:27:26 +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: fbb510bc-7135-4206-a49e-08d827d82199 X-MS-TrafficTypeDiagnostic: VI1PR04MB6270: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jVTtIiUX3NUYaMbNmv55bRMhz7Xr1MJFckRHdyjitnr4p7mV8n/68KcV8l5bdTq/YRqEi+Jdz7Jy+nZKhJDkcM6PJUTx1QtOXf+m0dZh+wjiYYN7zkCIZL9CrYCukutA9dVdTEEHk63yQXYgK/5Ez1ztHTDWZoaWw2KS8un3ORGH0V84Ag95tCOxXfhsT8JViaQAbYeaLe5Lnhpmbmvcui2MnQ5QO1OJasvlhuNLMBcLnLU38bk9Z9NIkTEGt3aIbP0wulrryf3wirGHb9zEh1b4FyTRCpzF1n2PpMYEQqwfsQkX9WO0Z8g2jkCNm+cAnV+KLYJnHv8HNVUDxW/USg== 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)(366004)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(4326008)(86362001)(2906002)(6506007)(83380400001)(498600001)(36756003)(16526019)(956004)(2616005)(186003)(6666004)(26005)(5660300002)(8676002)(52116002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /KJv6eYtuapuibIKZsoADYCvrgGKCBCcHDQkYH1v61VD1Ru3J81CC5jM7WvtTnAJDVw9YjCSVhDNmBpLQecyQC1nWFKTIqJC2pgZOQ4CqbRrlVyfZH62Vy4rp+9uXIELUNdwMHsSByPrhCmzZIzMB3aTWjbe2+QcC/MgsVHhkWoMRnjRmhFEs7Br/1R8T8pNvpG8sM0yaUQZLYy2CVEUr5mrXQlSKuLrmQi2hnkrmiQ6zRP8S+8Bq7xlRLa5d3SrAKhof6FNHQlCFZEfPnbzS9b3PzaRMJxt+r4xsaDpTqqIxZDIUCdM5e3z0KEUPVBPJE6uUFMH9lfmhdl7YXlngldotBnwQXNKyhqDfSSikkJDNWW6ey/vuN4/dMqQLYTaH6zfbyqi324QnAo02JtFpxKWbxplovBCje8o5EgOhenzlA/fC2ES+tr6DHu0TkXN+jqxbMmlGLT+ffyeKNQktrljpUWdIjY8ou5ZCzGcjxU= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbb510bc-7135-4206-a49e-08d827d82199 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 09:27:30.6929 (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: wefrXcgCPNtuf9NZmb/XMMQPIR23mw5AJMO2XT2FiD6VxRq5fZl+ONB/KjwI7Bl3Xng8LjaFt/AJTswtXyxeoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6270 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 Tue Jul 14 17:41:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11662117 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 7092413B4 for ; Tue, 14 Jul 2020 09:27:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5130E217D8 for ; Tue, 14 Jul 2020 09:27:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="JfXEF3E3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726935AbgGNJ1k (ORCPT ); Tue, 14 Jul 2020 05:27:40 -0400 Received: from mail-eopbgr50084.outbound.protection.outlook.com ([40.107.5.84]:27207 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725955AbgGNJ1i (ORCPT ); Tue, 14 Jul 2020 05:27:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UW9RcZN8oxJa0n3VUW73X3DrJU9hkRs2utKujtRuwYUxqH8KI89J5Fqp1x04Oocd8Li6SRS8D4LJZAsRKPMA9i4rrR9vJj6tD5KImwvnXGfcMOcBvng0rWzk9VlYSNMBb8/IIqmDO/jz1YZAsJbBFJk/C6WajXGw030bTtClJcAZgR4o04IapPHpiCKxhnC4hm0EzXZrWN/2mCiq9nUnCmX7CCRLwT8Ot0mwcFB+41oo/s2n/Odp9BOWM7qn7xwgxPSFqaDvs85z5XTtA8+U+oNu5+AmmhlUDuofyPglZtrGmdFrGf+HPNwjtkEirFIXgF1gxfK7S4PZEqpqQ9ukQQ== 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=ezBC1lAx/KradxnqDyFBY/Pv87T3vu2RXN7H9GeN51yfSDR9pCYFati+L6hg8mOqPA5WczoBEp57ONFoS5bxjEXUG2DWqbnJvGuF4PyNHDredhK6W1ueu/KNT2R9+rmSFj8y7WB2X+xW3fiYecgddeDa33OlXDDFVcPLI/DJj0CGOTEe6xbnFL3oidAoTUTzMhxiIC/GC3hCjPq43k7bFfm2yXg+20Gaic8Pmnho6K7y34JUu1hmswOn+nxlGu5XuOO2WCF77rNniQp3Pct9QjjKDDrHxIb4+0tamBa11wvtX8Am6ZR3i7WQscSZN1jlKjgZwrMnemf3xTFJKSqeqQ== 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=JfXEF3E3jCaf9jG9kzbOaouf3B9Srjxt5R20dtDhwvBIzUVIe+VJB2K4RkcV1NFoXMZwGsInJ3w8uEa/v4u+K0MPb693XoRiTP7gD2nULvykYm7Xjwlmikyb4BvzxgU5AqKWtD9KvMvNHgHP1gtcTel/JrsiEKwv3G+GJ6JjOcY= 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 VI1PR04MB6270.eurprd04.prod.outlook.com (2603:10a6:803:fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Tue, 14 Jul 2020 09:27:35 +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.3174.025; Tue, 14 Jul 2020 09:27:35 +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 v2 4/9] dmaengine: fsl-edma-common: export fsl_edma_set_tcd_regs Date: Wed, 15 Jul 2020 01:41:43 +0800 Message-Id: <1594748508-22179-5-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> References: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) 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 SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3195.17 via Frontend Transport; Tue, 14 Jul 2020 09:27:31 +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: 25f59668-d2b6-43e0-82d1-08d827d8247c X-MS-TrafficTypeDiagnostic: VI1PR04MB6270: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WRAQY49qC85Asng1RiNNrEt4RDdskgi9HS99+OF570efjDF6fDjS8ydUVqm96yLsD7P/rdVPHFV3Tp9rNu+wWt+q4RxySkNA2AUdAJNhU0YvRJwxTx4qi7tZcMDW5FzLkF0GsgtIj6GW7028BBe/LvHdwlX1t52OciIy9WnCFZaJSq8TZxDImKibUKXmWLCwaA57SP+uPqspn1IhEOFap4MN3oROeVXRiCd7rEl3FMe0uzOt5j4lE4GMGZaWSh3i1zECtUctwvY7NQn2WTdek8F5600b3/AMdHfAu93MIQ56wY70+EdmcnTVNa+RgsjWRChlzIWOFt25KJDhqIC6jQ== 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)(366004)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(4326008)(86362001)(2906002)(6506007)(83380400001)(498600001)(36756003)(16526019)(956004)(2616005)(186003)(6666004)(26005)(5660300002)(8676002)(52116002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wrj+G8KyKWQsr4Q0Q12PgW58ucuv1TMaQl9Sm/aveveoJBT1VsckXEI0XRvJFrCSBrrHCZ/XEI7t92af11t8EIkiJM++dPeSCo5J2X59AbyFoPyLzzofIhyGUtjUkiyDQ+v2nGdxsu6IIgPk17S8aDnaWSHI4GekHCZiwv6LQYMB72QWawSrsnWFjTiNd8f5w/jEH+ysBjRgTq96PA+cOOgdahUrLx75nfmHQhI2yTV4ptbH0V86UySwDsVhz4t+zj5xFI/CoAuSz1QcE1mdH/EZSs8VQ4Vk7OGG44jFxrw9HPtUBwgkDvGprchElpLY7DwEKmak8XkTq03I96ctgB52B7KlZhVz1Sk8Fsd65I9OGya7onjUvtdE8lq8KnkYEHqgxfXj4CbAnKYQiDxIZHpCPHMg7xxupzJPYGgJY7JMVEpJBrtMYPjF1jp8hFqAUhojuURSHjvSOEoz0iTY0iWac89go/ByNujkuXPVN6Q= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25f59668-d2b6-43e0-82d1-08d827d8247c X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 09:27:35.3942 (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: 8VmoAEwxoLclS73kEK9NVXMsFL7OpszC8CNJ8L1kephXylv9EeEoM/W3mvitjwBNY/EGpBjcrLNVGYFlnlffFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6270 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 Tue Jul 14 17:41:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11662119 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 A430A913 for ; Tue, 14 Jul 2020 09:27:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7678D21D90 for ; Tue, 14 Jul 2020 09:27:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="kmUWpNAw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbgGNJ1y (ORCPT ); Tue, 14 Jul 2020 05:27:54 -0400 Received: from mail-eopbgr50075.outbound.protection.outlook.com ([40.107.5.75]:34030 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725955AbgGNJ1v (ORCPT ); Tue, 14 Jul 2020 05:27:51 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jLBJwG7Qa9VZk++jrXNuhN4pS4VkG46K0Hoqoq6pHHu00dSZohX5zLhi+mpfFMYCuc2pYkHiy+1757r2ffSgWIIjwkUEGd7Px7OUdp5Rb7ZLD26wQpGB7/TcmDunNzDL8zrnStDQzoa1MoZgnrN3OR1h03nsP6OtwTC7ZnoAD4IPfRlq2cw2iuCYc2vRKHudP9NuuOBh5uUfWB8ixvB+I43ZFrPY83/fs1Lbc+SZhduOfeaRiIxarGdmATfmCxzxxyzPRmUIlnMDxpizC2C43W913Orh6Jl9BbnnaPI5iCzIDoboqbvdD9TIF/VBbJXdI7/CdqRL+BW/lZM8obv3iw== 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=PlRADwWj7UlMY+By8n0ncI/NXa7YDAvQaBzX4u6EOsuIpUGOxgIvuA5Z5LjNmjfcydfO6YArw2MPEG1WmgV1Mx6+28Ac/TYgaRle12u4iYyY3LJQBkxslNUL7o9OG9lXd/OFyjA14akNGy0B5CCSypt6wVEc7iLupB640qyHECLQgVrzlJSY4VYgqGa6IR/xcw0XZrdeFcO3u4TSof6Hp9UOSE6o4eHqdD4YL+QKnUv9f7UADvNGFscHTPnsdnkORalMzITwpyhZL+fP62cYG7SPQ3JD4oP47Z27/vg1LWyIl59BawnqSt+K4oNDt8lPpRrvKJeyLZv83pvjA8owBA== 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=kmUWpNAwXjigsnqd4+ONBceVecS67CraTbfct9m2a+6I3+G24gYbqWNSTY9JPlMd/z0wPd/hnOFFiCtYMN8w/WRLbViewb8dJA59RlSSoGFsGa8mqkJIEvfsVOlVhYGKrJWLTvpuLs+LUgyyJsLuTOnx1PUnkHq+bWrmDKdZHgo= 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 VI1PR04MB6270.eurprd04.prod.outlook.com (2603:10a6:803:fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Tue, 14 Jul 2020 09:27:40 +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.3174.025; Tue, 14 Jul 2020 09:27:40 +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 v2 5/9] dmaengine: fsl-edma3: add fsl-edma3 driver Date: Wed, 15 Jul 2020 01:41:44 +0800 Message-Id: <1594748508-22179-6-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> References: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) 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 SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3195.17 via Frontend Transport; Tue, 14 Jul 2020 09:27:35 +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: eb0ed366-4cc1-4afe-860c-08d827d8273d X-MS-TrafficTypeDiagnostic: VI1PR04MB6270: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:142; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +4cVbSRH/Y8c8GTj3Sk3ThJcKSuJCYnF+dYVuIDJl+Vy03w058S1MyTBNrurdKL1P/y0jD5wMJWmd/5WUzq+BNJfPE2WlGCOP/9coUojezgXlmeq026JzmbU+fk3ZGVDeqkHch1+mcTt+a6H9g1pWYdFd2N8tlhHl2H4g6aWBhgl0BNItYS4VRPTjxkZ11W0KvXuUdhGms5wD2ewxPJdikGPPuaWlxn8m066EBdx320bLXVHf3fKWJfXcn9/3AnDbhijEJ3Y+ltpqROHt/Yo260LnFCWdnN3wa425QfB0DoJ1V4JXOqV1fdSdMCegu/z 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)(366004)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(4326008)(86362001)(2906002)(6506007)(83380400001)(498600001)(36756003)(16526019)(956004)(2616005)(186003)(6666004)(26005)(5660300002)(8676002)(30864003)(52116002)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Cq0eQVm5Qx0z+ANu4j6L4OMef7Xe/w0qKrFJe/3REUcFOOJdDxE/iI/MKO0/Q1J+E8ENOi9SkYYQyhx+Ns7tQakJ5nAFjDKIS1NkpCJ1sGPYc1KvitqFZXeSaadu5wbJJc8Y9m2OXPXt8D4MxkpxXuL69njODKzmpQkKBd3RIzkVRrrzaIvSOLAq0CEcZfQ3nWIWQJCVPEvQljJQq89x4lX4uafU4eMbktIXS7A+KF5e5lUi1vbEP5wuUAzxDeAhTwBHBS7IETJvQgoK+f8MxQufq4O6biLeZ1iZ25XWvABCqctdxtVzkR4SGX3U4mZUDp1rdej9YaqqxTf1kPqh6nTe9eS2vtw8ftfG59vclRgFVCII3Y+43j3bHn43dl5IW7WL2o07f8uVUrp0x08fqINFpGelazzyuSJdzywj1hKOYls8n6/uiV2aNy1Iwwy2HEEbknUk86UOA2NGdeSo0oBJNaCbMs9VhyHxmzy7DbA= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb0ed366-4cc1-4afe-860c-08d827d8273d X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 09:27:40.2475 (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: RH/RWzFi69NS7PenZpgObJhViLww0kPeLWwOM86DPrHWAnkBS2xgLOeKCDIzerCIO1I4zTkMXBAvbD7PmNaoyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6270 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 Tue Jul 14 17:41:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11662127 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 15260913 for ; Tue, 14 Jul 2020 09:28:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC8A220EDD for ; Tue, 14 Jul 2020 09:28:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="cw8BMMlL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727081AbgGNJ17 (ORCPT ); Tue, 14 Jul 2020 05:27:59 -0400 Received: from mail-eopbgr50075.outbound.protection.outlook.com ([40.107.5.75]:34030 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727034AbgGNJ16 (ORCPT ); Tue, 14 Jul 2020 05:27:58 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rf9q0FSJLgvEybv09Tl0MptE7KFMXeGhzHATb9ZfQo4AHD9ipgSpNkta3894R2wYRmyAKvdFFSTLqN+X94axDegzJvJu/BJBf6s+rW5dAQlwZm670+R7KrDcNAb21oE7CjhC2LY+YTbLxzuIIhxZo1qd+I+A2akeDFqXKQ77gAXM+24zVEmBfzfP6EweHd9myNeIWq2PynAJUja9B31iBE7MEId7mRSnpVzdZ7BKmcHOnBKGeVgOB3DW5KVyIC6WMgVDaxUdqdhkUqoztzQwvyR2vO93BRVQ0KTJpOYUDLPtpsIRVnyHRTmVjZimErCKWzC7cdIDePqfe0V/3e1THw== 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=ofN97a3mDisiE0ZvD0xBvk5pLhZNGrCxQ+kYMd6BnfU=; b=BwslpmCKVnLQByfY34lElkPcz6SOnkHcRB11XyQubD/Ndv0ThrMw3eZcvECyGQB8NoMvFgGKgbmys12oGgMPHwDB3oIrp7qqTDrj9xXdgbw2GNM4nqzuJJH2gCrNsPt5a88Af2/+zXXjgFyP3W2rU4+/RV5qHuYKKHCRhNN3QDX6EMRZLe8g6JNLdptSGv0HArfSOjFstCQK6paKEsLXg0e2/RSohgW3aLYTfetC97NFTz6kmPV2/qFloW6OkCaQ4vKXwAhxse1Inl6/UyBhz8LSe+m+BDNMMyq80Ik9ufcHb55aW7qAwdfgYC79HGAdURSJbveho4/JY+9PGm2M8w== 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=ofN97a3mDisiE0ZvD0xBvk5pLhZNGrCxQ+kYMd6BnfU=; b=cw8BMMlLMYCJtaFQlihgy94ib7DHaDhvziZvdQdXREzdis3N4kh0EtVEHaazHjQe59gE/pVRfKzv23PLmT6EngDXAxUPlXxIpoSkbM76WVso8+C8YhT1FzWMSubq+UpfGReDlRw+lhI5nxGKznetkQOVnq6TmQzSdqzvpHv+RDk= 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 VI1PR04MB6270.eurprd04.prod.outlook.com (2603:10a6:803:fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Tue, 14 Jul 2020 09:27:45 +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.3174.025; Tue, 14 Jul 2020 09:27:45 +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 v2 6/9] dt-bindings: dma: add fsl-edma3 yaml Date: Wed, 15 Jul 2020 01:41:45 +0800 Message-Id: <1594748508-22179-7-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> References: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) 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 SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3195.17 via Frontend Transport; Tue, 14 Jul 2020 09:27:40 +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: 9fc8d088-fbf8-4793-5a8f-08d827d82a2d X-MS-TrafficTypeDiagnostic: VI1PR04MB6270: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o1qlbYCNWTv1/itaP9TuLEWG8Hlgvfm/zQ7AX1lFgaBm9tf6hy2crvr3lgIrYY0G3gVkYc7DA91NSgTEpNcKZqskyMpGhAYIeXczPZa0TQipx/qZiRaGwGRJmMkyTzNo2BnDihfxrFJFFgFDLB4WsGJVH8kW3JKP3iN+pDShf9qhANR0o+m9I7ld2vufUYEUvDGHN1TkMRvXzo55q0eOTSs3p1ui8zzhy8iL3lS04QfhDk+dxyWLA0YmwPju1DAwrkPTrsKBMyih4D+wctffJiEDM+8iAM5fQirZKhGtC43IJGhtDKXIwO9ukUPIuRkb+fqsJHyZ4HH9WV7yElIgKZsvtwKxzWdNf5GJ+UVsdGjqUAd1aKcFeW4rqOhsUVAqswJMGVbvwSZ1Il9IEpyAWw== 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)(39860400002)(366004)(396003)(136003)(346002)(376002)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(4326008)(86362001)(966005)(2906002)(6506007)(83380400001)(478600001)(36756003)(16526019)(956004)(2616005)(186003)(26005)(5660300002)(8676002)(52116002)(7416002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: doSfS9r6F2djQCPSNeeffu/GFIB838wq8Ij4iOk1VisMg7WyAhbPwbzIB4WSnJ6741dONIC0UCd7VOoxKd0N6LXL69GHCY+l1Xi5yZoElh6oA9xHfoSWZfuD5C+fPADZ6mvU16fbl3lMLZhfEKO2fBB3FFbeY1dXvIWxUSPIjuPr0cxYsjMG5/L6bWuU1UAXF1ARkJfvHrPKwXgL3SrgPftO+f481qJDaU8BuwfOJXtabVeb8pBi+sG2D9x4vxucVFERiPHS5xyi2xTgNT5gs2bi9zWDPsCs6oFEx02wFt3vhP9VUvJ3diPI9YA43jdqwTpztVYokPZXLy17huFW0Um2MbUv7OIw7d6PlY/MuqnShQ3Sm1X2KxG7+KQrNRAAewSyNCzyBhzlaTjGDhOqxYFxFY6rIdCmW+xj+Mdo+RCX7IfgrD2n2WPSwmRVZTVJzKgJjhnNiKg29YQymJbGJtp6zLeSJPE0OxJgJP5a974= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fc8d088-fbf8-4793-5a8f-08d827d82a2d X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 09:27:45.0387 (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: opAgyVhKZBK2Rj4gnuFnF6XVCNezKBd73g58xlWFBTP4P7Zilb7ohk2ixSxFfpO0Z7T2gAEK7rZEuszWuUkPjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6270 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 | 134 +++++++++++++++++++++ 1 file changed, 134 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..ebdad90 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/nxp,fsl-edma3.yaml @@ -0,0 +1,134 @@ +# 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: + minItems: 2 + maxItems: 32 + + interrupts: + minItems: 2 + maxItems: 32 + + interrupt-names: + minItems: 2 + maxItems: 32 + items: + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])-tx|rx+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])-tx|rx+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])-tx|rx+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])-tx|rx+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])-tx|rx+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])-tx|rx+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])-tx|rx+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])-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 + + power-domain-names: + minItems: 2 + maxItems: 32 + items: + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])+$" + - pattern: "^edma[0-2]-chan([0-9]|[1-2][0-9]|3[0-1])+$" + +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 Tue Jul 14 17:41:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11662121 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 9067B13B4 for ; Tue, 14 Jul 2020 09:28:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 684A320EDD for ; Tue, 14 Jul 2020 09:28:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="P/HcrS6j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727114AbgGNJ2C (ORCPT ); Tue, 14 Jul 2020 05:28:02 -0400 Received: from mail-eopbgr50075.outbound.protection.outlook.com ([40.107.5.75]:34030 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725955AbgGNJ2B (ORCPT ); Tue, 14 Jul 2020 05:28:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qo+iaEMkZF3jTXVNCQtWQLSMYrqgjIAUGcSUhjCBhVYS22eRahciGW9whBLhD4jMQL2GIIe7pIwaa9gNZLnolvnnFpc9DApqudwZ6hVHb86bw1k03AjjgqfizYuUce1pnH2iEGr7UcZviNPkXW5j/FbOyoa5FJwkVJgCjQT++RzGtQBwWRSKtiUXKvw0E6M0R73m8Vbu0+0xbiS1jIQ3mN3ZvpYc7abrdRViej9mToRv5N5eT7EYPx+EF9otvZ/E2drWHunW2WpVinMgm1iZYSJVtgpj+0zG3aw0IklGEPUwK09P3NIo+Fz8xHEcD9sd1mwkt8eD3oj8BRhRZ6XEqA== 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=cqorzGTIeZ0UC2AoC5yisviMZJ+SCpxLji4c+pdqQjo/C0ov4DDYC6dYsUv+v+67MB0I5o9MpwJo41wIqWa0rUBHfuTlOWn4AakDZq2Kq8P7lvfmnUKdU7ZFvWQpFStLImhHgGJc6SwYbBUpEwXGvotCF3O89wfLk/j2EANxViFAvyhwsq/p9cidTF2Ovk4WZavR9X4TU793MooLnH/X77isi7IobRD9+tiuYd7Ik7IbMCDfF4O2BDkcgxjY5NlEmVYf7vohQX7NsoQbkNyjmHOwJPU2XvDSJMy+U2ddscGCbDqR12d1nC1cAGhSfSC+XfkcgNoYEX5Rfn7QHDR7EQ== 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=P/HcrS6jRpXhbESdhYldQbFGyHxBYQ6gIBlcydpa4VJbS3hBhxQpzR9VCdtXROQQ2P1QUduRZwWAP2qp2+XAA5RTfVUaNos/MmPtJ1kYEigL89PPGFixJtj0t2V+t2FfIa2513VzHPHukXN3ZVJAtTaYXQuzM8EAB4pFczZrLTc= 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 VI1PR04MB6270.eurprd04.prod.outlook.com (2603:10a6:803:fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Tue, 14 Jul 2020 09:27:50 +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.3174.025; Tue, 14 Jul 2020 09:27:50 +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 v2 7/9] firmware: imx: scu-pd: correct dma resource Date: Wed, 15 Jul 2020 01:41:46 +0800 Message-Id: <1594748508-22179-8-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> References: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) 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 SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3195.17 via Frontend Transport; Tue, 14 Jul 2020 09:27:45 +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: 9c2b7b0e-a675-4c40-9a97-08d827d82d2a X-MS-TrafficTypeDiagnostic: VI1PR04MB6270: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:538; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mnREYlnwy856cwh4u4RHfg+9/OuzVPBnb6ddspjQVbZfxxJEMgpqKlXVCVqrRmP73vvSnVeQ6SDiR9n1BpI3pRgQd1XPrF8jXpUBaZ5Kq4xrDN53o278NfZffw191JvlTxNuiW9ZQBP4LLBnTY+kv0fZKagxdRDXHxkmP13iLCfvA7BepqJiC7gYLMSwbq2yWCRyZlu92SFol7m65+NIHeXwjH7sLbLce4LuWg0H4QqKVlh19ykehj2P8wKYRP6QlGWpPNAS3KTo+24ndb9YscgtA1ID0cfbD5BQ3SHHSaVOfgIY6ZoUrbUyw4faeRIPMQz0oI4l4IXg477U6/6ksw== 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)(39860400002)(366004)(396003)(136003)(346002)(376002)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(4326008)(86362001)(2906002)(6506007)(83380400001)(478600001)(36756003)(16526019)(956004)(2616005)(186003)(26005)(5660300002)(8676002)(52116002)(7416002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: uNfSVcq+oWkfE1jFmvf56OmD7n+Vk15X/Eq1bv83Mb3rj/INBnOFGx+Gf90sL0T/r/dnURukggIhXzHW8Wxd6rWmpS0woAFaB4k64dSiHJrZnJB3jpjcrTTRAcLOBuJ168jE7J94F+Zs+uvwpYEKfInoUUGKrJ9wQtph1acn5uSkQn8XTzrkXxlYOpG9wJ0FsQ5kQuQ0ENiRD4fm4kZyho+5uQ/GCTOiptFrxP83etT5IvSENnZxqODkj8daW0QxTE8LNdK7VWKnRYBXZ8wkhLIx3X2e0365otD23aff6nSylFtlVLho/FNYIh+Xot8K2GAW3gpsNgYPuiGly1TKOWhYF0pbsHYoC5BidmdeNntapli8z5TnxyLeFkykTP1IZDLw8jXLNBxlxfuWGVHgek4Ogg4XUU/esqrCeB2YYuDWCcLeox+/aNWDBwJhcXKAxmp0tws2oEByQEDe5Wnemjg50kjrrjuYAwxaq7yYIPY= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c2b7b0e-a675-4c40-9a97-08d827d82d2a X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 09:27:50.0809 (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: +xpsjZKPH7UhF96i7GuW/mt4O1E4xemBzMldJayGZDIlkI2q5d3AwDMZF5dk3VWc9z3qixT2erdFakJbttZ4Gg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6270 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 Tue Jul 14 17:41:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11662125 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 32641913 for ; Tue, 14 Jul 2020 09:28:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 155BE20EDD for ; Tue, 14 Jul 2020 09:28:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="AvVcnKkU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726062AbgGNJ2H (ORCPT ); Tue, 14 Jul 2020 05:28:07 -0400 Received: from mail-eopbgr50075.outbound.protection.outlook.com ([40.107.5.75]:34030 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727104AbgGNJ2E (ORCPT ); Tue, 14 Jul 2020 05:28:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W8fw2rPJ9yD7nbpuXFWGkGWYfGtf70QKNcUFpkvxTYljaDWXSMtqMvr8wojdH2Bm6gwpkZ2Vtl07cwdwUdwP9PHc96Q6LyWPOhyYFa9X/Wi5V8lo02ZjXX3NpLShvo38xlEfZAA8gcZD51wVaoeprpYOPFGuMgf6pzlvnBF6ZnBnP5AR4alZdf62fGvG/GNLVzUeMG8fG/LlO1AqQzJVRpB2+c+lq+HFy0H4jM4Ibk8V0GXRG4j1UrxnrGysROglll4mohA09ZrvJKV1OGGEDY2gKN28j5uBvDj3p38jvD0cCXBfIrPVgpzxuesdTkS2NpT2sW1mQxM3kz7C1cGbuA== 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=VEMsyF+UruQnejNvrGiZzSO4puqxTz3tLHdbJXok//cJrQ0ZpAZKA+gitOkK9S4F78lQVyuCM/Z/LiETFYW8Ctc0JHBAN0QzkGcJI0znD6JXjLpYQDmx1e4KlINpNgoYoDB2+2aD2Dzv+tjU88Vbk+8xnPH2rqFuvWXKk/pAzpE5LWk60PLyjdjpUaV4ciYkA28vBtUp2Eh2ee3nl5CSLxv6LiBVbnc7PEXgLHWf88nIkceO6q5kvDu+GQUxwAMCem8/9BtqRBE6/vMH9vVzYekJH20dCxkRI3E7yyFmroWvW86fOFHzahFfGsJBoFg1BtFEZHpZ4KSGATXj9gidCw== 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=AvVcnKkUTGM+DjF7gLhpGC/CdxEbsSJrSA1CR9JD8IpYzOYW/k2xmadNoU74wSyBqXnDJiCWNM2SkWN9ZiWzLNPYK/1glhkoT2B2nBuj7DeWaMx6j/Y+uxKuchzUa2QMbEGlrUmrLhKcwScrSVJi3E6l1MWGf/eXQTKD4fndDmY= 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 VI1PR04MB6270.eurprd04.prod.outlook.com (2603:10a6:803:fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Tue, 14 Jul 2020 09:27:54 +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.3174.025; Tue, 14 Jul 2020 09:27:54 +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 v2 8/9] arm64: dts: imx8qxp: add edma2 Date: Wed, 15 Jul 2020 01:41:47 +0800 Message-Id: <1594748508-22179-9-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> References: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) 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 SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3195.17 via Frontend Transport; Tue, 14 Jul 2020 09:27:50 +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: 109dc475-301d-4f2d-937e-08d827d83001 X-MS-TrafficTypeDiagnostic: VI1PR04MB6270: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:267; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9TIsMcHhjbhBkvTO8j3TCWDCKAJgvhSiwz5wl2fVHLCEhM2NuBbKSUHcv1+Tp2hrW69KI5jehLwBKkmOa22byDy7D2sSWtiOBdMzBcgLi02J4+V5WVqHixVAx1G6McNLf4bGL8cW0j0mIyyrmzlpfBZFUXdo0C4WKyEA8m3DVk5yC1oGlIM4bJ1asYV8mkDJucJu838MnW+Q9bMoPpdMECLn7lOrANx+1iG5oLe1atObXNuDLgNrWeFxtM+Qp5Y4iW/+KDLNuxHphKLIrJdAgCqcWh6w8fHaMXXhmg2scZ7GddmN+KIhU3Mma+myIDO5qvBJ9Nq0N1AkWpyPqcMiiL0kAw72IlfTdyeRCohvrWJkMak9kcwu8DmJQnZTeSxF 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)(39860400002)(366004)(396003)(136003)(346002)(376002)(66946007)(6486002)(6512007)(66476007)(66556008)(8936002)(4326008)(86362001)(2906002)(6506007)(83380400001)(478600001)(36756003)(16526019)(956004)(2616005)(186003)(6666004)(26005)(5660300002)(8676002)(52116002)(7416002)(316002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3DEcN+UJ2xnsgdgxIN6dkx3UBPsjSRgON9TsWBEj2/V6K00WCy8SQ2poHJb+qMmANPpXMk4Gw0tLUIccEBxizQr1cX6baV7Wr2KHC8jnepfawPMbR01GD0UsfNqoIxpw+x7EfL9+9ERxSS4Q3X7OPQvZ91sZynRqb2blFDlezOEIOE9lH3IgAvKUvGkIuXcAST9SehDLjqEAWOU0NpiRmNK1o9PU2JYOVPYxLkfVKqHpFA6fgRSjIAcZIpWql7+mvaq+U36eqtpFgqG7VLl5huidPsRkmAw52KEZpRi8SyJWpK4Ecd8z8ugot+753RFa4aT2jSDtdNUaulZyhdcuReC18OQMeicuE3+mC8hINOKFvon1rPO215v4QN+Gmy7+S/MqD8M5YJ7euBiOOk/QW4epvX3H3vmnEb3mKGzWVn8zI+052cOdOoK5I4KZfnxISvJxeKBBum2Kx1HsKw/DJt06yyKOmVYeit1W9UanDeg= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 109dc475-301d-4f2d-937e-08d827d83001 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 09:27:54.7102 (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: AuVyysExswLTOp2XxeHgYonEsFvXo1LkVRyx3o8Ejm7G617XP7RK61lv2x8ArZEpaCXn2WEb5JjbZ1qx7SsmEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6270 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 Tue Jul 14 17:41:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11662123 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 23F15913 for ; Tue, 14 Jul 2020 09:28:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07BFC21D7D for ; Tue, 14 Jul 2020 09:28:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="H91ilHOe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727790AbgGNJ2H (ORCPT ); Tue, 14 Jul 2020 05:28:07 -0400 Received: from mail-vi1eur05on2067.outbound.protection.outlook.com ([40.107.21.67]:28736 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727108AbgGNJ2D (ORCPT ); Tue, 14 Jul 2020 05:28:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nHNseIFayM8nJbHGX+fB3d/AzMmU7MKVf8RoDJ9SwBcdwn7EjTKNfHQ4lEtpbvhQiCZ1BS0iVbCWcf7wO2Ry9VxvBtxym8yhqoSohgNXah5Dx7w7TnDB2atmk/XIj7CeLEc7poWoRD7+M48OHhWiyHwJrqTXMXgN+ciHstEbw+BXimur/KMUo09OLyrz8jZyzYxGNXS3cq+m2bXV93/FuWZe7Ea3uMuFAaXRb8a8LJPVYYvJNzPNm7SpRo27OFwEq/ne8HFuh8P6qe7Pjl8R/l8BzNRU365X+k7KH8Wb70dGPW4H91PnJ2wtkkBcdVeB9sREHfyeQR54xP3PHjVbRw== 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=G4fGXGLwYDyaD4JjLI4tKii9Ae0EQUzDAtu2rdkTbRkcNIvB+VwQSwCo7bZsLOFquLI/P17qxIrZBGah7IMRiCLksvjyKSz07U0RlzyRz2bpAZ18DUztjKBKCe8Mb1F5aL0eUjiV5VSPAFxQdos/MBcQyK1ZPmTBzq+hRKGJoGtq7Pyheg8xy4qnCwheQPi4ZREL/KelpeNPusNl5a/6ZDbf6vDSfxcU12qTyO9fIv4sRjerWO0vM5+Zpuq2uwhVoIbupK4QyKneK74+SxDBqacKW3xMUiGswNdAJQshDhsHPxGFMSEFOEnb6aLbwj3/frL30ff+8no+gAXaItiZzA== 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=H91ilHOeG46NgwDCD/tqljUYKzNgsqUPWt6I0nTt66mIFhyxvlXhgbYgel0+d8Xg5un1PvChe8ofQwj5Ir4kdIKppANNGPmoabexagS2/HVCdbciKr01TsNfR2ASLigGgfL0XxxSd/x4XJKL0n8lHhecVGakvUN24YVEJ4wTz8c= 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 VI1PR04MB5294.eurprd04.prod.outlook.com (2603:10a6:803:5a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Tue, 14 Jul 2020 09:27:59 +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.3174.025; Tue, 14 Jul 2020 09:27:59 +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 v2 9/9] arm64: defconfig: add CONFIG_FSL_EDMA3 Date: Wed, 15 Jul 2020 01:41:48 +0800 Message-Id: <1594748508-22179-10-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> References: <1594748508-22179-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) 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 SG2PR01CA0092.apcprd01.prod.exchangelabs.com (2603:1096:3:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3195.17 via Frontend Transport; Tue, 14 Jul 2020 09:27:55 +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: 9462c6d3-4389-4caa-25de-08d827d832c0 X-MS-TrafficTypeDiagnostic: VI1PR04MB5294: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:843; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3Y4THoceFZQYY2vKBYqq/DK3G6HRQZK+C2UQC+kbSRTjshnKy9NBHlepouzX2s4OeJuMlf8UClEJQhlwaxPCyjslwhjOhpwIezaARdvi627dgD+4WCPj2to7rXCNg/NvmwvHJsfOUE5vU7p2TiU2jNfvna+bEwXHTH92Okznc7BxEVPcB+6wECp45g0iLdRqofSqWnjKn3eEm10IOuQ8lTuwh/5/hOtYQiF96P9XP53akmGbEaHKYCa/DEPv5sQHLuZ9/VKcOX0lNwuJp2vVVupFjR3tNdgcJ/Rnah8FdEZBt9mC5pKHHctgSQecO0QgsjIu5/r3z7EFSsheaYhJ7g== 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)(136003)(39860400002)(396003)(346002)(376002)(366004)(478600001)(16526019)(2906002)(186003)(6506007)(26005)(2616005)(4326008)(5660300002)(316002)(956004)(8936002)(6486002)(36756003)(7416002)(52116002)(6666004)(66476007)(86362001)(4744005)(6512007)(8676002)(66946007)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: masRN3oFD8XbIzh21iniBc/ZT+GmA819FN+o4JnuzpSoXx8osm3t7CM7nP8GonlDmomJmIj3JhF8pRCXkmUoQXT1u2EA5DEz4GmV6HexNnQrHL61Z08ThalgmOj8FNdspGCcGX+9Iu/mc9FllPoZlwvhckfVEQ4Vl5nMvlgUUtvPa+xdzpASXVt0RWa78T+hv5UtH/ZwKlhN3Cm5de2H/lAtmOJTE44fiPT+preY112LGfon1n2wOamlc6k8YoPqQ/uD1Ur3XYDLgiT1vnxXVo6F8b8UgPD4QL/C777YZ6zpnCQSQTWR7JSgp3s7EDHyMHYmSzP/FCqQ5H1CfEhA+wbASsRi3PzttVa28vt0TilswXtGk3/RiWRWKW0nb+ZgcrTNM0fNc9ddE3c3mZQkaeJFTPAcHtg9cj+aXge4zTN4vLsgZAA2kFyIVST973hkDKIYpdn3BR/fXUDN80wlZBMrh00Kz4PmWvsjzzvQ0Ik= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9462c6d3-4389-4caa-25de-08d827d832c0 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2020 09:27:59.4575 (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: vESfhv3JQu+liPZYcgxaGW44iYCzlfP8m5wq9AuFq33D+U0g0+7Y2fGvU8tIHd5bgWvLsI7vjAgjKZeC8/flww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5294 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