From patchwork Mon Jan 28 06:08:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10783253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AF3B91E for ; Mon, 28 Jan 2019 06:09:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6789C2A222 for ; Mon, 28 Jan 2019 06:09:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BCEF2A22A; Mon, 28 Jan 2019 06:09:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F30ED2A222 for ; Mon, 28 Jan 2019 06:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=NY2ZD4kbgNiRb+0cu33AkMOoEdTorUy37SiBYoRvzgc=; b=RzQwy/R/juMWJOIm1pkrSZP4Af LU+CuXG+/ZcwNEIcshKUdFvGit0fmw4jnaDNLAMvyQSQ1wvQ44nRCGD8EQCnUteQ7jpxbjYL+DDdH GRX+UGebMvI/ZLpsm3z1KO77lgTy5U7eoXC30oBji/GMchiePuB6kYO6xW7dIiqzzZcVUZgVRvlYS GWlSAtz968WT4EwbFdYAKS12yJ6PMGPDKA3X0nXEp7P9twItQVDUaJdqr0dgPg7pfcL/vqe2X96NU 368SONRtyEsTwf/Zv+qf68vbFals12Htq2LTo6hf+p8Mm3n9DVlV6pU41iT+sZ/azQMmdyNZV6LSn 2q387Abg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1go06S-0002Ln-08; Mon, 28 Jan 2019 06:09:04 +0000 Received: from node.akkea.ca ([192.155.83.177]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go06E-00029t-9i for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 06:08:51 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 70E8C4E2051; Mon, 28 Jan 2019 06:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655729; bh=YV7evlfUpCm1dkvzmR2FsHaiKUjwEqKtN/TqcgcdxSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AYl266RKyavEpchUQ7VdxF8gWoIOz62hfuG0qlo8VEbXqHNPlXjvRXgGMgYMWnmfQ 8+2CLC9mo6dXmPcmnSVwyuCIEQRCCZ9fBMZBHYLNM2U2u5VFQbvxS0yxBjmRVnO9sK XNbdsvampUauH5ZFMc2nx6aG8Z35AI+42MjWqpVE= X-Virus-Scanned: Debian amavisd-new at mail.akkea.ca Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SjdRXfibeeab; Mon, 28 Jan 2019 06:08:49 +0000 (UTC) Received: from localhost.localdomain (198-48-167-13.cpe.pppoe.ca [198.48.167.13]) by node.akkea.ca (Postfix) with ESMTPSA id 70BF24E204D; Mon, 28 Jan 2019 06:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655729; bh=YV7evlfUpCm1dkvzmR2FsHaiKUjwEqKtN/TqcgcdxSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AYl266RKyavEpchUQ7VdxF8gWoIOz62hfuG0qlo8VEbXqHNPlXjvRXgGMgYMWnmfQ 8+2CLC9mo6dXmPcmnSVwyuCIEQRCCZ9fBMZBHYLNM2U2u5VFQbvxS0yxBjmRVnO9sK XNbdsvampUauH5ZFMc2nx6aG8Z35AI+42MjWqpVE= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v5 1/5] dmaengine: imx-sdma: add clock ratio 1:1 check Date: Sun, 27 Jan 2019 23:08:36 -0700 Message-Id: <20190128060840.31695-2-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190128060840.31695-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190128060840.31695-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190127_220850_341549_EA1871D4 X-CRM114-Status: GOOD ( 10.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Baluta , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Vinod Koul , NXP Linux Team , Pengutronix Kernel Team , angus.ainslie@puri.sm, linux-arm-kernel@lists.infradead.org, Lucas Stach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On i.mx8 mscale B0 chip, AHB/SDMA clock ratio 2:1 can't be supportted, since SDMA clock ratio has to be increased to 250Mhz, AHB can't reach to 500Mhz, so use 1:1 instead. Based on NXP commit MLK-16841-1 by Robin Gong Signed-off-by: Angus Ainslie (Purism) Reviewed-by: Lucas Stach --- drivers/dma/imx-sdma.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 0b3a67ff8e82..757fad2fbfae 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -440,6 +440,8 @@ struct sdma_engine { unsigned int irq; dma_addr_t bd0_phys; struct sdma_buffer_descriptor *bd0; + /* clock ratio for AHB:SDMA core. 1:1 is 1, 2:1 is 0*/ + bool clk_ratio; }; static int sdma_config_write(struct dma_chan *chan, @@ -662,8 +664,11 @@ static int sdma_run_channel0(struct sdma_engine *sdma) dev_err(sdma->dev, "Timeout waiting for CH0 ready\n"); /* Set bits of CONFIG register with dynamic context switching */ - if (readl(sdma->regs + SDMA_H_CONFIG) == 0) - writel_relaxed(SDMA_H_CONFIG_CSM, sdma->regs + SDMA_H_CONFIG); + reg = readl(sdma->regs + SDMA_H_CONFIG); + if ((reg & SDMA_H_CONFIG_CSM) == 0) { + reg |= SDMA_H_CONFIG_CSM; + writel_relaxed(reg, sdma->regs + SDMA_H_CONFIG); + } return ret; } @@ -1840,6 +1845,9 @@ static int sdma_init(struct sdma_engine *sdma) if (ret) goto disable_clk_ipg; + if (clk_get_rate(sdma->clk_ahb) == clk_get_rate(sdma->clk_ipg)) + sdma->clk_ratio = 1; + /* Be sure SDMA has not started yet */ writel_relaxed(0, sdma->regs + SDMA_H_C0PTR); @@ -1880,8 +1888,10 @@ static int sdma_init(struct sdma_engine *sdma) writel_relaxed(0x4050, sdma->regs + SDMA_CHN0ADDR); /* Set bits of CONFIG register but with static context switching */ - /* FIXME: Check whether to set ACR bit depending on clock ratios */ - writel_relaxed(0, sdma->regs + SDMA_H_CONFIG); + if (sdma->clk_ratio) + writel_relaxed(SDMA_H_CONFIG_ACR, sdma->regs + SDMA_H_CONFIG); + else + writel_relaxed(0, sdma->regs + SDMA_H_CONFIG); writel_relaxed(ccb_phys, sdma->regs + SDMA_H_C0PTR); From patchwork Mon Jan 28 06:08:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10783261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5754F91E for ; Mon, 28 Jan 2019 06:09:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4369E2A300 for ; Mon, 28 Jan 2019 06:09:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 360C82A305; Mon, 28 Jan 2019 06:09:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D61FD2A300 for ; Mon, 28 Jan 2019 06:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=h1ghwZNgH2ib20G4qiN0nvmia2JTLNQgIR0cCL4Fegk=; b=qgf7fujENyUQI4MBivCM2cu0Ow 6UOqGwBQijezrW517UNdxeISE6EF3dNi/xxx4mYI2PhhstmOcsdbRGxynp04cNtmuHtIKoNoZhHlb HirJboUPTRpN9SrXEc72kLsBJuth4ITY6HHcoLUGdoxYvOKu9Giz7wTomdlTQ5S8LyHFeZJarq13H MijOgDbyCjsoAYgoCO7YAyiw5kLlMtjlGtpU5qF+Sbuw+iVAtuPEBdNbBSvP1li+Jol8Rwr1L6dmy 3atJR7UGI8apnikyUp3IkVb1Zt3ZmwJ06+PtQ/CJQ+I4fO0gNYw5P+7WXSiQ41TFmmP+HFyO6obxy 8JwUi2Ug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1go06w-0002i5-Aq; Mon, 28 Jan 2019 06:09:34 +0000 Received: from node.akkea.ca ([192.155.83.177]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go06E-0002AF-Cx for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 06:08:52 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 477074E2056; Mon, 28 Jan 2019 06:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655730; bh=QmIBLVdbJ3X4Zs3xnT5fPDB4oumJvEdRGSTkpTuJ1IY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=b8CU70ktiDkZpcm+wWRJIw9jpU6z7PbEOGA0NIg0BCGT6Ww1gQD5/ILOB8xbkj8qj LLix5RnXTd2KCOuQq/l2Z6wLh26Hks5Rd8r+NeoifT3ktqrIGerQcc/BF1MJFeeO/S MSPzVEvPWVe83MXYBbL9Nw5sggzWnXPa+1cQAKTQ= X-Virus-Scanned: Debian amavisd-new at mail.akkea.ca Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B6J09s486Qe7; Mon, 28 Jan 2019 06:08:49 +0000 (UTC) Received: from localhost.localdomain (198-48-167-13.cpe.pppoe.ca [198.48.167.13]) by node.akkea.ca (Postfix) with ESMTPSA id 36A2C4E204B; Mon, 28 Jan 2019 06:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655729; bh=QmIBLVdbJ3X4Zs3xnT5fPDB4oumJvEdRGSTkpTuJ1IY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AWjjoniXOD+Z+ZSRmsENhUdOWO3cDG9GAwi9la/RH6b42yLiSxm2qL07VJz4ZQiwZ W1AqqpjfBE8fbKUA0ezQwoWJm2B4wC+7mBFSTFARXChp+cnlPKejmHvFm7wE9t2a7p GCwUZcsbc8M6tKyYhiqSPkJNcl0ir4m8+x39fKuc= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v5 2/5] dmaengine: imx-sdma: add imx8mq sdma compatible parts Date: Sun, 27 Jan 2019 23:08:37 -0700 Message-Id: <20190128060840.31695-3-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190128060840.31695-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190128060840.31695-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190127_220850_454808_6BD80D30 X-CRM114-Status: UNSURE ( 7.86 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Baluta , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Vinod Koul , NXP Linux Team , Pengutronix Kernel Team , angus.ainslie@puri.sm, linux-arm-kernel@lists.infradead.org, Lucas Stach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This is identical to the imx7d. Signed-off-by: Angus Ainslie (Purism) --- drivers/dma/imx-sdma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 757fad2fbfae..c4db4fe6bcc9 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -578,6 +578,9 @@ static const struct platform_device_id sdma_devtypes[] = { }, { .name = "imx7d-sdma", .driver_data = (unsigned long)&sdma_imx7d, + }, { + .name = "imx8mq-sdma", + .driver_data = (unsigned long)&sdma_imx7d, }, { /* sentinel */ } @@ -592,6 +595,7 @@ static const struct of_device_id sdma_dt_ids[] = { { .compatible = "fsl,imx31-sdma", .data = &sdma_imx31, }, { .compatible = "fsl,imx25-sdma", .data = &sdma_imx25, }, { .compatible = "fsl,imx7d-sdma", .data = &sdma_imx7d, }, + { .compatible = "fsl,imx8mq-sdma", .data = &sdma_imx7d, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sdma_dt_ids); From patchwork Mon Jan 28 06:08:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10783263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 552C891E for ; Mon, 28 Jan 2019 06:09:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4102E2A300 for ; Mon, 28 Jan 2019 06:09:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 348272A305; Mon, 28 Jan 2019 06:09:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C8A262A300 for ; Mon, 28 Jan 2019 06:09:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=PcrwUMzPher66NEX2cfDY98+g/nKbNFijIArVc7HRGU=; b=M3YjThrDkhe8IrOZTqTBmuROuV 4pvRvIIQk/hvX/PmKpauZLepnD8exdJQj4cswvprvf0SwFlIeHHf9hoM66rsPm1Eb8o40C+PMP/px 6mmd9+qvJRCZIJoE4xGHJhlUs9JrLE4K+LaGeK7eQIKe8OACkmbHK97mmbk8KHrLFWShZDBT8xtQN 4Jxmzi/TWpbCmuz4g8fZ2kf+w9vFKkqaFddyskl7D5OCrOACdM5ME3JhtiNFUZ5k9KFTnfFtGw+CG p3HjZDgdCKzmFvC78ow7aAufczLcHMR9PbI2Sz3INfCo2YT0i2IcEFO3iAWm+415DABu5rM0RWyF3 8xs1hPIg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1go077-0002sz-NJ; Mon, 28 Jan 2019 06:09:45 +0000 Received: from node.akkea.ca ([192.155.83.177]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go06F-0002AX-3v for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 06:08:52 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 053574E2058; Mon, 28 Jan 2019 06:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655731; bh=okZKtmM0iwQ8WWQf1CT/2bd9GBMAsXjPAUMBFfJblu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y5cF4xMqb7J1HzrKzEUwgBWCbc5RRycT1HS2pHfEYkFxDfVsew4WaCWKRxCh57Out aFGTjfFm9G0Rd6I1+DqrCZmXELQJ0lJf1p6kS9wlZAr80M8ZHKUzLP3RmsPqWhyBTG AQLqQ+y5oCslqxpkLSt7L888zz2hJ3VR6Vl1H/x8= X-Virus-Scanned: Debian amavisd-new at mail.akkea.ca Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HrXjpxVBtMrp; Mon, 28 Jan 2019 06:08:50 +0000 (UTC) Received: from localhost.localdomain (198-48-167-13.cpe.pppoe.ca [198.48.167.13]) by node.akkea.ca (Postfix) with ESMTPSA id 0FECB4E204D; Mon, 28 Jan 2019 06:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655730; bh=okZKtmM0iwQ8WWQf1CT/2bd9GBMAsXjPAUMBFfJblu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jkTgbNeoegCbsf/hISPeMkt4dpusg1xExfvtXKuleXn72uvRh6TbwdNu4Hu3TgidE sXrri3JzTYK1WkGE8WDCYp1JgNpCeUX900b16m6cN0QCgi7SaxfP/ucYaUEch574Ez sKJzrqmuuwfSND6t4qs6lo5t5zAZW2GXwZnto9M8= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v5 3/5] dt-bindings: dma: fsl-imx-sdma: add fsl, imx8mq to the accepted compatible node Date: Sun, 27 Jan 2019 23:08:38 -0700 Message-Id: <20190128060840.31695-4-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190128060840.31695-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190128060840.31695-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190127_220851_154156_962DB03C X-CRM114-Status: UNSURE ( 7.74 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Baluta , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Vinod Koul , NXP Linux Team , Pengutronix Kernel Team , angus.ainslie@puri.sm, linux-arm-kernel@lists.infradead.org, Lucas Stach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add an fsl,imx8mq compatible string Signed-off-by: Angus Ainslie (Purism) Reviewed-by: Lucas Stach --- Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt index 3c9a57a8443b..9d8bbac27d8b 100644 --- a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt +++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt @@ -9,6 +9,7 @@ Required properties: "fsl,imx53-sdma" "fsl,imx6q-sdma" "fsl,imx7d-sdma" + "fsl,imx8mq-sdma" The -to variants should be preferred since they allow to determine the correct ROM script addresses needed for the driver to work without additional firmware. From patchwork Mon Jan 28 06:08:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10783265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27E4714E1 for ; Mon, 28 Jan 2019 06:10:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11AE02A300 for ; Mon, 28 Jan 2019 06:10:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2D0F2A305; Mon, 28 Jan 2019 06:10:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B0362A300 for ; Mon, 28 Jan 2019 06:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=mJF9FI4F89egYpaeQHjl+p75KvztIdMSSymxun6btpw=; b=YXxlo7rEbK/xeOs2Qu1xXtWSfY BfDWeir+d28YRPZzWeVg24BEBJLeyWKSrPUrtD6CMMKzJZA0qpxdaLL/Cn8z9fDibeTfF1SG70zsw ShaMmfbB6yKAli8oBsqKNFmR1qrB6+3BCJUEAXqXskanS3UxymJ7x0++h0VArtUlxWAxCZw0wGIe+ iSGtsYe+fjxq3d8fCAgJXJ3VH+KUSjHwWa4U0+9V9s3eNY15ml+mE9xVIHMIJSQsVmL+cPFfP8hLy FlwPrjjtWCKNaUTzcDXXKgdzLtLljkPxtRol9Es+H40Adu/NM19/82XYJRRYlimoVWYwDDnJA2+a6 slH5h0lA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1go07M-00038Z-6S; Mon, 28 Jan 2019 06:10:00 +0000 Received: from node.akkea.ca ([192.155.83.177]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go06F-0002Aw-Rk for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 06:08:53 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id B66AB4E205C; Mon, 28 Jan 2019 06:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655731; bh=GuTD8SqdJjaQ7GeF6fQeKCli/Z+1RZuP7gejQxTXV+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pV91jwgtHsqCRiTdNPlGoy99iDL3FDdT9cmZwEDwneJpDg8AM7Tcm/+1wOwgIpBZO lCWj8dgoJtwf/noANTOw3fz+U8qlaC/mjdIR3+Sr9lu0QmwVmFYhFYNikBMDEmSvoq pwTAevKE0NF1k0KRljTEcW8Kw+3IwIdglyM6JVCM= X-Virus-Scanned: Debian amavisd-new at mail.akkea.ca Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gw33rgbD49UY; Mon, 28 Jan 2019 06:08:51 +0000 (UTC) Received: from localhost.localdomain (198-48-167-13.cpe.pppoe.ca [198.48.167.13]) by node.akkea.ca (Postfix) with ESMTPSA id C663B4E204E; Mon, 28 Jan 2019 06:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655731; bh=GuTD8SqdJjaQ7GeF6fQeKCli/Z+1RZuP7gejQxTXV+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pV91jwgtHsqCRiTdNPlGoy99iDL3FDdT9cmZwEDwneJpDg8AM7Tcm/+1wOwgIpBZO lCWj8dgoJtwf/noANTOw3fz+U8qlaC/mjdIR3+Sr9lu0QmwVmFYhFYNikBMDEmSvoq pwTAevKE0NF1k0KRljTEcW8Kw+3IwIdglyM6JVCM= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v5 4/5] dmaengine: imx-sdma: add a test for imx8mq multi sdma devices Date: Sun, 27 Jan 2019 23:08:39 -0700 Message-Id: <20190128060840.31695-5-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190128060840.31695-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190128060840.31695-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190127_220851_923671_3173B5F1 X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Baluta , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Vinod Koul , NXP Linux Team , Pengutronix Kernel Team , angus.ainslie@puri.sm, linux-arm-kernel@lists.infradead.org, Lucas Stach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On i.mx8mq, there are two sdma instances, and the common dma framework will get a channel dynamically from any available sdma instance whether it's the first sdma device or the second sdma device. Some IPs like SAI only work with sdma2 not sdma1. To make sure the sdma channel is from the correct sdma device, use the node pointer to match. Signed-off-by: Angus Ainslie (Purism) Reviewed-by: Lucas Stach --- drivers/dma/imx-sdma.c | 6 ++++++ include/linux/platform_data/dma-imx.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index c4db4fe6bcc9..d5f86becf59e 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1918,11 +1918,16 @@ static int sdma_init(struct sdma_engine *sdma) static bool sdma_filter_fn(struct dma_chan *chan, void *fn_param) { struct sdma_channel *sdmac = to_sdma_chan(chan); + struct sdma_engine *sdma = sdmac->sdma; struct imx_dma_data *data = fn_param; if (!imx_dma_is_general_purpose(chan)) return false; + /* return false if it's not the right device */ + if (sdma->dev->of_node != data->of_node) + return false; + sdmac->data = *data; chan->private = &sdmac->data; @@ -1950,6 +1955,7 @@ static struct dma_chan *sdma_xlate(struct of_phandle_args *dma_spec, * be set to sdmac->event_id1. */ data.dma_request2 = 0; + data.of_node = ofdma->of_node; return dma_request_channel(mask, sdma_filter_fn, &data); } diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h index 7d964e787299..9daea8d42a10 100644 --- a/include/linux/platform_data/dma-imx.h +++ b/include/linux/platform_data/dma-imx.h @@ -55,6 +55,7 @@ struct imx_dma_data { int dma_request2; /* secondary DMA request line */ enum sdma_peripheral_type peripheral_type; int priority; + struct device_node *of_node; }; static inline int imx_dma_is_ipu(struct dma_chan *chan) From patchwork Mon Jan 28 06:08:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10783267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF02C91E for ; Mon, 28 Jan 2019 06:10:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCFA52A300 for ; Mon, 28 Jan 2019 06:10:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B14262A305; Mon, 28 Jan 2019 06:10:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5E4C32A300 for ; Mon, 28 Jan 2019 06:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RyOHGef/nAPpyoow7leDFsjqYpr2AtpodfP3/ltESZ0=; b=pEVRzfrK/JtiXHOj5GQCsWmKn+ NeGyPtSO4/GXykHFWeDe8V2IuNGSsh5Q0OuY4jEH8aAWtWJcxVrRrUcc2Gd0Dx7I0+CGuE2S8dhB6 QAKba9CrqkQaVjQmuFF6/qoyjI5bkzRZcScBqTm6M3yPPPPwvgC9IYXb8JjVPIPJ8I76K4amOdDce TsoQr62UeUVNgMyOqQjJmDhWDWlENPMVzW5UfYuxtzgSP3CTfR7xeHTOSUVgeuC2VBdBeaEBNXaY6 70TW7qFl2jAtUbM2KNoHE3RGHTdHGjxc3sHOZsJKSiRX0zm9R77MtUUbJTtbPSQ6cvhobBS90+jRQ 3YmlIz6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1go07h-00041K-EX; Mon, 28 Jan 2019 06:10:21 +0000 Received: from node.akkea.ca ([192.155.83.177]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1go06G-0002BD-IK for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2019 06:08:53 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 72BFE4E204D; Mon, 28 Jan 2019 06:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655732; bh=aJyv2Anmq+fMmh2Gi9/xrGD4eRTLdWMOQTdSRYOpd8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=wb+JVtYh3oZyNQa4t16L6fvOlK1dtxqZTyQKc8MZnCu4Kg4LWaWRuBYdasChj/oAa j9AG1IgC9MMv016EOWBL6LMJDp97cw4ukLlRNQRnmlQSa8U/BFbEHhaRz+qhORVl9l Pn3UNS6oRzKXArGRJaHsIB+Z9IzCbwNSU2WIkQMs= X-Virus-Scanned: Debian amavisd-new at mail.akkea.ca Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h5e4iN8c030o; Mon, 28 Jan 2019 06:08:52 +0000 (UTC) Received: from localhost.localdomain (198-48-167-13.cpe.pppoe.ca [198.48.167.13]) by node.akkea.ca (Postfix) with ESMTPSA id 868DD4E204B; Mon, 28 Jan 2019 06:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548655732; bh=aJyv2Anmq+fMmh2Gi9/xrGD4eRTLdWMOQTdSRYOpd8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=wb+JVtYh3oZyNQa4t16L6fvOlK1dtxqZTyQKc8MZnCu4Kg4LWaWRuBYdasChj/oAa j9AG1IgC9MMv016EOWBL6LMJDp97cw4ukLlRNQRnmlQSa8U/BFbEHhaRz+qhORVl9l Pn3UNS6oRzKXArGRJaHsIB+Z9IzCbwNSU2WIkQMs= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v5 5/5] dmaengine: imx-sdma: fix consistent dma test failures Date: Sun, 27 Jan 2019 23:08:40 -0700 Message-Id: <20190128060840.31695-6-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190128060840.31695-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190128060840.31695-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190127_220852_601783_5ABF514D X-CRM114-Status: UNSURE ( 8.13 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Baluta , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Vinod Koul , NXP Linux Team , Pengutronix Kernel Team , angus.ainslie@puri.sm, linux-arm-kernel@lists.infradead.org, Lucas Stach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Without the copy being aligned sdma1 fails ~10% of the time Signed-off-by: Angus Ainslie (Purism) --- drivers/dma/imx-sdma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index d5f86becf59e..88910ec09568 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -2118,6 +2118,7 @@ static int sdma_probe(struct platform_device *pdev) sdma->dma_device.device_prep_dma_memcpy = sdma_prep_memcpy; sdma->dma_device.device_issue_pending = sdma_issue_pending; sdma->dma_device.dev->dma_parms = &sdma->dma_parms; + sdma->dma_device.copy_align = 2; dma_set_max_seg_size(sdma->dma_device.dev, SDMA_BD_MAX_CNT); platform_set_drvdata(pdev, sdma);