From patchwork Fri Mar 29 15:21:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 10877359 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 665E6922 for ; Fri, 29 Mar 2019 15:23:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B0A0294F6 for ; Fri, 29 Mar 2019 15:23:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E55C2951A; Fri, 29 Mar 2019 15:23:19 +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 DCDFB295F6 for ; Fri, 29 Mar 2019 15:22: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=3rF7obCNC/LOrRg2Pdu6rAbmo+0AEPtmwo3KrJCURz0=; b=KYDpzq+9NFmi1Ssoilfu+MyAY+ TbS2MM/4+pZ3XXmLbibFIJwY950kelCM3Ow9JgVpVtPRRabhc1x8cps6uk2HklpFS+ecpDicaruEZ B3jypqa8IhkeozlSB5QLVT28RjUsev+CT5BhrXoKGhux2t3ctt3VzBMsL0FbFDdAFvAiySb3b+sGx Ez6oY2NasGW6rgaQ07fBLtcdRoUPWsdv4u+Cl2QJeLZ3UUQtyFF2XX/5+tuTcO02P9iB9e9w+2QlH yA3IcexnchmoDQe5OtCyB/nffLVBsfFiJ6gdKFwngDVJS/elrSLr2uwF+kTqYX1LBnbgN7KpM9t4i +vG4FDow==; 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 1h9tLL-0000Lt-BK; Fri, 29 Mar 2019 15:22: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 1h9tKA-0007Jz-FZ for linux-arm-kernel@lists.infradead.org; Fri, 29 Mar 2019 15:21:49 +0000 Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id D6EF74E2056; Fri, 29 Mar 2019 15:21:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1553872901; bh=c+Umh29DYkRqBlFcskVZzYgx4V4hBQqUQ5qRjU2h++k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dGL/WWnbjzX1Dql4+JMFqe+uF7xECjWpnznXbFQU3PSfbr97l976V+kNVWuiXxVOw g2q4aWD5jlTDsr8HaYTfjCOeKdAP2tRp8fGnCYmT/6AT5Jl//oicLwbJ+epjTqgXZ7 6kTIjw+jPTlG6+gYOBFzs6AQ7ORkq6cG3O+VlQzk= 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 Aix0FLtboPkI; Fri, 29 Mar 2019 15:21:41 +0000 (UTC) Received: from midas.localdomain (S0106788a2041785e.gv.shawcable.net [70.66.86.75]) by node.akkea.ca (Postfix) with ESMTPSA id C00074E204B; Fri, 29 Mar 2019 15:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1553872901; bh=c+Umh29DYkRqBlFcskVZzYgx4V4hBQqUQ5qRjU2h++k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dGL/WWnbjzX1Dql4+JMFqe+uF7xECjWpnznXbFQU3PSfbr97l976V+kNVWuiXxVOw g2q4aWD5jlTDsr8HaYTfjCOeKdAP2tRp8fGnCYmT/6AT5Jl//oicLwbJ+epjTqgXZ7 6kTIjw+jPTlG6+gYOBFzs6AQ7ORkq6cG3O+VlQzk= From: "Angus Ainslie (Purism)" To: angus.ainslie@puri.sm Subject: [PATCH v2 2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1 Date: Fri, 29 Mar 2019 08:21:29 -0700 Message-Id: <20190329152130.18411-3-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190329152130.18411-1-angus@akkea.ca> References: <20190328133828.20999-1-angus@akkea.ca> <20190329152130.18411-1-angus@akkea.ca> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190329_082142_826535_19E94621 X-CRM114-Status: GOOD ( 13.60 ) 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: Mark Rutland , devicetree@vger.kernel.org, Carlo Caione , Shawn Guo , Sascha Hauer , "Angus Ainslie \(Purism\)" , linux-kernel@vger.kernel.org, Daniel Baluta , Vinod Koul , Rob Herring , NXP Linux Team , Pengutronix Kernel Team , dmaengine@vger.kernel.org, Dan Williams , Fabio Estevam , =?utf-8?q?Guido_G=C3=BCnther?= , 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 imx8mq B0 chip, AHB/SDMA clock ratio 2:1 can't be supported, since SDMA clock ratio has to be increased to 250Mhz, AHB can't reach to 500Mhz, so use 1:1 instead. To limit this change to the imx8mq for now this patch also adds an im8mq-sdma compatible string. Signed-off-by: Angus Ainslie (Purism) Acked-by: Robin Gong --- drivers/dma/imx-sdma.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 5f3c1378b90e..99d9f431ae2c 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -419,6 +419,7 @@ struct sdma_driver_data { int chnenbl0; int num_events; struct sdma_script_start_addrs *script_addrs; + bool check_ratio; }; struct sdma_engine { @@ -557,6 +558,13 @@ 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, + .check_ratio = 1, +}; + static const struct platform_device_id sdma_devtypes[] = { { .name = "imx25-sdma", @@ -579,6 +587,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 */ } @@ -593,6 +604,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); @@ -1852,7 +1864,8 @@ 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)) + if (sdma->drvdata->check_ratio && + (clk_get_rate(sdma->clk_ahb) == clk_get_rate(sdma->clk_ipg))) sdma->clk_ratio = 1; /* Be sure SDMA has not started yet */