From patchwork Fri Jan 25 02:55:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10780445 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 18E901390 for ; Fri, 25 Jan 2019 02:56:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0461E2EBB6 for ; Fri, 25 Jan 2019 02:56:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA1842EC1C; Fri, 25 Jan 2019 02:56:41 +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=unavailable 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 970572EBB6 for ; Fri, 25 Jan 2019 02:56:41 +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=Ti9NZVFU5dhhu3q9a32vQb+o3Cx8/aAD1lS8m4FnDro=; b=dGyDWD4ZHItTGbArDwklt9ecmW J16cDi4xu3CBIH5CPQNTGOYk5hf1QXbAuTbrPr5m6VfFvUS8gGzMYP7uHtOcCUa4Phr6/2EDNLnj3 V5NjznuCyhGedOxzMWSQrezXyhiDn5yc+hNKgn0tFvquL/Rzor7XVKwWk4CDVZQegsa5P5mVZpqL2 JC65anvAfI/lKls9CUIis3UjloXyAptK8t8WkgUTXBuQ3jEh2ghrmGoWG3dbAmMBBMWQICTjz9UUF PtQkSsVwA6p8DhXy1y2K0ilD7FG57vf9EOotri2rUn4WVbiaQsG4LjPB8zdL4eLxP6NLpFQllK8Vy 4VyzTzTA==; 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 1gmrfb-0006Mg-On; Fri, 25 Jan 2019 02:56:39 +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 1gmrec-0005a2-Gr for linux-arm-kernel@lists.infradead.org; Fri, 25 Jan 2019 02:55:41 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 941FC4E2051; Fri, 25 Jan 2019 02:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384937; bh=+JXGIVucnYCY0cluddvyVeHVzItz/VTc2jupzPlE5mk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=S/T368i0EE27Nh6XHcxhO1cbGHBeLDfxuHZ5N8hx6l+DAEHXkNUG6vShI91PFEH7c fY2Q6hN0bu9dtF7QyKs+brb281XIiCsHYKwnp6xT7gLLuVOupR6Bb0GjzZnF1WjIQ/ CLbrNz2JEkVOPgIILCjns859Z4HZn2A+GGi1/Tcw= 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 yz-2hxMqnySQ; Fri, 25 Jan 2019 02:55:37 +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 8ADFE4E204D; Fri, 25 Jan 2019 02:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384937; bh=+JXGIVucnYCY0cluddvyVeHVzItz/VTc2jupzPlE5mk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=S/T368i0EE27Nh6XHcxhO1cbGHBeLDfxuHZ5N8hx6l+DAEHXkNUG6vShI91PFEH7c fY2Q6hN0bu9dtF7QyKs+brb281XIiCsHYKwnp6xT7gLLuVOupR6Bb0GjzZnF1WjIQ/ CLbrNz2JEkVOPgIILCjns859Z4HZn2A+GGi1/Tcw= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v4 1/5] dmaengine: imx-sdma: add clock ratio 1:1 check Date: Thu, 24 Jan 2019 19:55:24 -0700 Message-Id: <20190125025528.15645-2-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190125025528.15645-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190125025528.15645-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_185538_563642_78F0BA4D X-CRM114-Status: GOOD ( 10.48 ) 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) --- drivers/dma/imx-sdma.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 0b3a67ff8e82..5e5ef0b5a973 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,14 @@ 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); + if ((readl(sdma->regs + SDMA_H_CONFIG) & ~SDMA_H_CONFIG_ACR) == 0) { + reg = SDMA_H_CONFIG_CSM; + + if (sdma->clk_ratio) + reg |= SDMA_H_CONFIG_ACR; + + writel_relaxed(reg, sdma->regs + SDMA_H_CONFIG); + } return ret; } @@ -1840,6 +1848,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 +1891,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 Fri Jan 25 02:55:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10780433 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 EA4B01390 for ; Fri, 25 Jan 2019 02:55:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6A8C2EC1C for ; Fri, 25 Jan 2019 02:55:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA0942EC30; Fri, 25 Jan 2019 02:55:58 +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 61FE72EBB6 for ; Fri, 25 Jan 2019 02:55:58 +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=g07bZbPo0inIPB1PH0horFWdYM6GXzigBt2NxwE49zc=; b=mO4WyLF40BYZL/XbXkDB6/UM2q 11KHVEGMJ/rNxnLnS2lvYojNnkl9maS+05ap36lzKqLa0NUxYA6HwWKeXG6OYEPFg5EjLrdIvuDlt xV9viJtvDKh+K9nxd6xd6F/Fycp6STFOGqHgGb5ZQk/NqYn0RgpRMKAAHLUMFAhV9ojEpWWm0lqZM vxg0Ms4exWMWGwQgruLDnqsSUXL9ereeG/TqTZ/whpiyyM0r5kTQIreooGUd47aFBnf1pU9nucHJW 7OtnWF6YxMyIr8hGGsqd31E7PjULojNqs2s8NOcFzepDVt50Q4XS2ovw8KSTdK+DEb4wCM89eNibQ vsSxQ2tw==; 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 1gmret-0005pW-SN; Fri, 25 Jan 2019 02:55:55 +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 1gmrec-0005a3-GQ for linux-arm-kernel@lists.infradead.org; Fri, 25 Jan 2019 02:55:39 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 370A74E2056; Fri, 25 Jan 2019 02:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384938; bh=EtaCZgEa0SNQFQDgpxE1KPj6YO295TP++Zo3L+XFaTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qdFIlRMW1W+KCgkaHSCBQ6PE6fBD4Z06/f/u/aq4SJGGkr2cP3lOynXV21trgiqBd cPiZC07yGvKf0ORIZWyy9ctA9qTTzwM5Ew0fklzLzzZolX4TlT2DUJDG8ONfEHtqTT H87BcPUsZwevAok3X5W+5Tzwbn2WdvLxgxWf0D78= 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 yvU4zLEy14rj; Fri, 25 Jan 2019 02:55:37 +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 4E4FD4E204B; Fri, 25 Jan 2019 02:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384937; bh=EtaCZgEa0SNQFQDgpxE1KPj6YO295TP++Zo3L+XFaTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aM4wCKqkCR6LGo/bXqkAy3mMCmyFbiBGGQ2Y5HnFd4ZWetQdBM4sHcHRSo+0qhNmQ I55ROY1ZVhOFEUda/aW0fqME2WbZwSS6A6EJ7e6yVrI+PAcuaiHjO8U/5a1/LdoBE7 bLd2ZWJKW4c5ZD1tdY+E5V+UDf5jivXxKTJ7CXUc= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v4 2/5] dmaengine: imx-sdma: add imx8mq sdma compatible parts Date: Thu, 24 Jan 2019 19:55:25 -0700 Message-Id: <20190125025528.15645-3-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190125025528.15645-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190125025528.15645-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_185538_558679_692244D4 X-CRM114-Status: GOOD ( 10.22 ) 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 data structures but we need to be able to differentiate that the imx8mq has 2 sdma controllers. Signed-off-by: Angus Ainslie (Purism) --- drivers/dma/imx-sdma.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 5e5ef0b5a973..ec6fb48f387a 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -556,6 +556,12 @@ static struct sdma_driver_data sdma_imx7d = { .script_addrs = &sdma_script_imx7d, }; +static struct sdma_driver_data sdma_imx8mq = { + .chnenbl0 = SDMA_CHNENBL0_IMX35, + .num_events = 48, + .script_addrs = &sdma_script_imx7d, +}; + static const struct platform_device_id sdma_devtypes[] = { { .name = "imx25-sdma", @@ -578,6 +584,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_imx8mq, }, { /* sentinel */ } @@ -592,6 +601,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_imx8mq, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sdma_dt_ids); From patchwork Fri Jan 25 02:55:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10780443 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 8DB841399 for ; Fri, 25 Jan 2019 02:56:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B1FE2EBB6 for ; Fri, 25 Jan 2019 02:56:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F2842EC1C; Fri, 25 Jan 2019 02:56: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 249D72EBB6 for ; Fri, 25 Jan 2019 02:56: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=/7fVTDECBzJNoj1u4XeuJhbztp+mIbp5W2Ql2WhI9gc=; b=OAhB6mKBCl1u6eKSmfMRwRKi8e CqieMUxE//hKL/ZOa2aDgULnO+y8x0k0K2TJs1xUQKxVhw7cYvSS3OoC/0a6TyZr7ghMWBySid5n+ PLRQy39m35S2+h0Gl1dvF+n+zBdROaiQgMUaGToIm8g/2MOGdjBcZhAZ7SyH2PwJ4zosJ00jUsXmH Ak36ElcnFAY94xrakQps/uCi4D2yYhx8PYUM7RdfsXrwEBV252gAYeODavxWjp9OZ7HQaM2jaqO75 AX2m2O+SUtO22YoWVy5cEpAe7mJvOXtWj5vmelDPTDp/76YSj1NcF8xt2Ab5uq6ocf8cKW9R+ZxaR jX8iMnxg==; 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 1gmrfJ-00068e-Iy; Fri, 25 Jan 2019 02:56: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 1gmree-0005b2-6Z for linux-arm-kernel@lists.infradead.org; Fri, 25 Jan 2019 02:55:41 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id EAE3C4E2058; Fri, 25 Jan 2019 02:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384938; bh=2BskzDdkFSPQ7IWwVr4w3oGtVDWNwTeYX0iWNkTP6cU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DpyD3Z5+oNfU6uJs6Jgqhv8BIVvERCiRKkKcirj20uqqOybvivU8wUtay6LGulBmg tU2KybODiExQFDy3DbRjVf3BBeQYbzt8kRpAUvtnlk0NUrwUPu9bsWauZLAqAz2oen R6BR6Bi6WpX2bk2hcleGSRe7LbB/oIdErzdbi10Y= 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 33bNu387GHL5; Fri, 25 Jan 2019 02:55:38 +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 0EE274E204D; Fri, 25 Jan 2019 02:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384938; bh=2BskzDdkFSPQ7IWwVr4w3oGtVDWNwTeYX0iWNkTP6cU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DpyD3Z5+oNfU6uJs6Jgqhv8BIVvERCiRKkKcirj20uqqOybvivU8wUtay6LGulBmg tU2KybODiExQFDy3DbRjVf3BBeQYbzt8kRpAUvtnlk0NUrwUPu9bsWauZLAqAz2oen R6BR6Bi6WpX2bk2hcleGSRe7LbB/oIdErzdbi10Y= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v4 3/5] dt-bindings: dma: fsl-imx-sdma: add fsl, imx8mq to the accepted compatible node Date: Thu, 24 Jan 2019 19:55:26 -0700 Message-Id: <20190125025528.15645-4-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190125025528.15645-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190125025528.15645-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_185540_311800_DBF0BBFA 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 The imx8mq is a slightly different variant on the imx7d 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 Fri Jan 25 02:55:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10780447 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 02A971399 for ; Fri, 25 Jan 2019 02:57:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E09002EBB6 for ; Fri, 25 Jan 2019 02:57:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D255D2EC1C; Fri, 25 Jan 2019 02:57:01 +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=unavailable 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 7873E2EBB6 for ; Fri, 25 Jan 2019 02:57:01 +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=tXD+9oS9NPddGsR0mYZezl+OD6YB0CcLqSK0TVT9oQM=; b=esDigElwfdbWjGIwVsGl0CpNyp S9cw7ff+LaGKwDVEkKlAhLDOTd7qCf03wTIVjvTZMotm48a3wGuFhY6N2oNzbVlEgYAW5B/hLDb2Y eeP3Jho4n4jYMAAHME39mIiDzBj7Om45Rumnd38xlO5+hHFTHMpUg1kjbtP1kQoWo+u3HXxWiC/lo AArQHCYcXmbzCFGLOebRZA7dDosIzS2JiCKIoSANYRIKmDj1uySnBhhIw6rAS5iKFQpHXZfQ85Xjc Y2apdjhuu+8GwVH1XOe7aq/ugCSbCtnlAjFiK8ZHxurltpoO+UPPfQNpRWgMlKKcxSeT27xwboFBl ZE9ImNMQ==; 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 1gmrfu-0006bA-9a; Fri, 25 Jan 2019 02:56:58 +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 1gmred-0005aj-TS for linux-arm-kernel@lists.infradead.org; Fri, 25 Jan 2019 02:55:41 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id C03E64E205C; Fri, 25 Jan 2019 02:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384939; bh=NtFtvKu7hgih6/01kJslPvJy0MSpNrvkPmrJHu9XxMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=coyFDyZ/SG5g1Ba9ugw1yk/Cnn0Wi0rML5tbTK26IGvGgF0vJ5l8oMylby4QANIZZ eX5yEZHB/OzAJ8wmeY9G4f9zJ/DiOg3jMZXahzqkobbieT0Kx+0AU1gY4vkUts17YG xD89XTwdFNasizYL+iyDgM2dGEeYDs6O7GygUUiU= 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 5E9mFXaPlrsN; Fri, 25 Jan 2019 02:55:39 +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 C3A8C4E204E; Fri, 25 Jan 2019 02:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384939; bh=NtFtvKu7hgih6/01kJslPvJy0MSpNrvkPmrJHu9XxMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=coyFDyZ/SG5g1Ba9ugw1yk/Cnn0Wi0rML5tbTK26IGvGgF0vJ5l8oMylby4QANIZZ eX5yEZHB/OzAJ8wmeY9G4f9zJ/DiOg3jMZXahzqkobbieT0Kx+0AU1gY4vkUts17YG xD89XTwdFNasizYL+iyDgM2dGEeYDs6O7GygUUiU= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v4 4/5] dma: imx-sdma: add a test for imx8mq multi sdma devices Date: Thu, 24 Jan 2019 19:55:27 -0700 Message-Id: <20190125025528.15645-5-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190125025528.15645-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190125025528.15645-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_185539_967288_B607C329 X-CRM114-Status: GOOD ( 12.22 ) 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 phandle to match. Signed-off-by: Angus Ainslie (Purism) --- drivers/dma/imx-sdma.c | 8 ++++++++ include/linux/platform_data/dma-imx.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index ec6fb48f387a..88e112a4aabf 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1927,11 +1927,17 @@ 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 ((sdmac->sdma->drvdata == &sdma_imx8mq) + && (sdma->dev->of_node->phandle != data->phandle)) + return false; + sdmac->data = *data; chan->private = &sdmac->data; @@ -1942,6 +1948,7 @@ static struct dma_chan *sdma_xlate(struct of_phandle_args *dma_spec, struct of_dma *ofdma) { struct sdma_engine *sdma = ofdma->of_dma_data; + struct device_node *np = ofdma->of_node; dma_cap_mask_t mask = sdma->dma_device.cap_mask; struct imx_dma_data data; @@ -1959,6 +1966,7 @@ static struct dma_chan *sdma_xlate(struct of_phandle_args *dma_spec, * be set to sdmac->event_id1. */ data.dma_request2 = 0; + data.phandle = np->phandle; 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..eeb5b73ae542 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; + int phandle; }; static inline int imx_dma_is_ipu(struct dma_chan *chan) From patchwork Fri Jan 25 02:55:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10780449 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 BA2321399 for ; Fri, 25 Jan 2019 02:57:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A649B2EBB6 for ; Fri, 25 Jan 2019 02:57:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 998C62EC30; Fri, 25 Jan 2019 02:57:21 +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=unavailable 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 365C42EBB6 for ; Fri, 25 Jan 2019 02:57:21 +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=UILPJ6Gy21QMiF/jrH0141guCxMn+V7whVvS5OK7d3M=; b=EQhICHWXZv6sRHNCZn+PYJQHh4 HWYeS5loq5dknhDG+jsfv4asfm94tcX7alOM5XdY/X1Uvt2j3mf/LzUz8OcEayzF78+wwEDweDpw4 Nx4SWWSzLUcrCn+Hs0KlQCCggxK5m9gvRdwbybyRHRA81KQ8QteQHDIlgsYjFSsuhvq9/5jn8B6zc lkOP0RngXrb0hImEBLdfUnnfa8V5uAXdtp5GZ2CzumR3nwGsjahmRAPddevWVhzo37yqr4kP+ny4V ieNW9H+bwxlFoj/THclt4cB1vM8quan9JJtlehqC3jKMmPk9au13YSYpIBWCXM6d+i+uevvAHSO/N WzCWtPHg==; 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 1gmrgF-0006rQ-Nv; Fri, 25 Jan 2019 02:57:19 +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 1gmree-0005bG-IX for linux-arm-kernel@lists.infradead.org; Fri, 25 Jan 2019 02:55:43 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 73B934E204E; Fri, 25 Jan 2019 02:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384940; bh=ixvNVeF1Cz3AKqfX15lAQdMhkXdlfdPWW1FxryLNR5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=b8TV1liqTwL8ktdK6mmTzXnWJdLb2cWPWGTwkNEkuNTpxGwj2qXv9qw2Q4XN/DpJw eqEd6mzk0Y9Y+ZGG76Rld3ebdL0Fg4zbEnWb0X3Hm0E+ZseEDNkB4H65k34JBqI0ot nJgU701tthu6yRbmKKxlNSgQzfGJBtHo1HlTyK4I= 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 KqoVl4IQzJnH; Fri, 25 Jan 2019 02:55:40 +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 83D214E204B; Fri, 25 Jan 2019 02:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1548384940; bh=ixvNVeF1Cz3AKqfX15lAQdMhkXdlfdPWW1FxryLNR5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=b8TV1liqTwL8ktdK6mmTzXnWJdLb2cWPWGTwkNEkuNTpxGwj2qXv9qw2Q4XN/DpJw eqEd6mzk0Y9Y+ZGG76Rld3ebdL0Fg4zbEnWb0X3Hm0E+ZseEDNkB4H65k34JBqI0ot nJgU701tthu6yRbmKKxlNSgQzfGJBtHo1HlTyK4I= From: "Angus Ainslie (Purism)" To: angus@akkea.ca Subject: [PATCH v4 5/5] imx8mq.dtsi: add the sdma nodes Date: Thu, 24 Jan 2019 19:55:28 -0700 Message-Id: <20190125025528.15645-6-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190125025528.15645-1-angus@akkea.ca> References: <20190120023150.17138-1-angus@akkea.ca> <20190125025528.15645-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190124_185540_620876_5098CA74 X-CRM114-Status: UNSURE ( 8.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 Add the sdma nodes to the base devicetree for the imx8mq Signed-off-by: Angus Ainslie (Purism) Reviewed-by: Lucas Stach --- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index c0402375e7c1..f0cd3675ead0 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -336,6 +336,17 @@ clocks = <&clk IMX8MQ_CLK_WDOG3_ROOT>; status = "disabled"; }; + + sdma2: sdma@302c0000 { + compatible = "fsl,imx8mq-sdma", "fsl,imx7d-sdma"; + reg = <0x302c0000 0x10000>; + interrupts = ; + clocks = <&clk IMX8MQ_CLK_SDMA2_ROOT>, + <&clk IMX8MQ_CLK_SDMA2_ROOT>; + clock-names = "ipg", "ahb"; + #dma-cells = <3>; + fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin"; + }; }; bus@30400000 { /* AIPS2 */ @@ -370,6 +381,8 @@ clocks = <&clk IMX8MQ_CLK_UART3_ROOT>, <&clk IMX8MQ_CLK_UART3_ROOT>; clock-names = "ipg", "per"; + dmas = <&sdma1 26 4 0>, <&sdma1 27 4 0>; + dma-names = "rx", "tx"; status = "disabled"; }; @@ -381,6 +394,8 @@ clocks = <&clk IMX8MQ_CLK_UART2_ROOT>, <&clk IMX8MQ_CLK_UART2_ROOT>; clock-names = "ipg", "per"; + dmas = <&sdma1 24 4 0>, <&sdma1 25 4 0>; + dma-names = "rx", "tx"; status = "disabled"; }; @@ -432,6 +447,8 @@ clocks = <&clk IMX8MQ_CLK_UART4_ROOT>, <&clk IMX8MQ_CLK_UART4_ROOT>; clock-names = "ipg", "per"; + dmas = <&sdma1 28 4 0>, <&sdma1 29 4 0>; + dma-names = "rx", "tx"; status = "disabled"; }; @@ -465,6 +482,17 @@ status = "disabled"; }; + sdma1: sdma@30bd0000 { + compatible = "fsl,imx8mq-sdma", "fsl,imx7d-sdma"; + reg = <0x30bd0000 0x10000>; + interrupts = ; + clocks = <&clk IMX8MQ_CLK_SDMA1_ROOT>, + <&clk IMX8MQ_CLK_AHB>; + clock-names = "ipg", "ahb"; + #dma-cells = <3>; + fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin"; + }; + fec1: ethernet@30be0000 { compatible = "fsl,imx8mq-fec", "fsl,imx6sx-fec"; reg = <0x30be0000 0x10000>;