From: "Angus Ainslie (Purism)" <angus@akkea.ca>
To: angus.ainslie@puri.sm
Cc: "Rob Herring" <robh+dt@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"NXP Linux Team" <linux-imx@nxp.com>,
"Dan Williams" <dan.j.williams@intel.com>,
"Vinod Koul" <vkoul@kernel.org>,
"Lucas Stach" <l.stach@pengutronix.de>,
"Angus Ainslie (Purism)" <angus@akkea.ca>,
"Carlo Caione" <ccaione@baylibre.com>,
"Daniel Baluta" <daniel.baluta@nxp.com>,
"Guido Günther" <agx@sigxcpu.org>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org
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 [thread overview]
Message-ID: <20190329152130.18411-3-angus@akkea.ca> (raw)
In-Reply-To: <20190329152130.18411-1-angus@akkea.ca>
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) <angus@akkea.ca>
---
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 */
--
2.17.1
next prev parent reply other threads:[~2019-03-29 15:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 13:38 [PATCH 0/4] Fix imx8mq ratio 1:1 check Angus Ainslie (Purism)
2019-03-28 13:38 ` [PATCH 1/4] arm64: dts: imx8mq: Fix the fsl,imx8mq-sdma compatible string Angus Ainslie (Purism)
2019-03-28 14:56 ` Daniel Baluta
2019-03-29 9:10 ` Aisheng Dong
2019-03-29 11:20 ` Daniel Baluta
2019-03-29 14:09 ` Angus Ainslie
2019-03-28 13:38 ` [PATCH 2/4] dmaengine: imx-sdma: Add clock ratio 1:1 check Angus Ainslie (Purism)
2019-03-28 22:52 ` Fabio Estevam
2019-03-28 13:38 ` [PATCH 3/4] dt-bindings: Document the new imx8mq-sdma compatible string Angus Ainslie (Purism)
2019-03-28 15:18 ` Daniel Baluta
2019-03-28 13:38 ` [PATCH 4/4] arm64: dts: imx8mq: Change ahb clock for imx8mq Angus Ainslie (Purism)
2019-03-29 15:21 ` [PATCH v2 0/3] Fix imx8mq ratio 1:1 check Angus Ainslie (Purism)
2019-03-29 15:21 ` [PATCH v2 1/3] arm64: dts: imx8mq: Fix the fsl,imx8mq-sdma compatible string Angus Ainslie (Purism)
2019-03-30 16:55 ` Daniel Baluta
2019-04-03 10:59 ` Shawn Guo
2019-03-29 15:21 ` Angus Ainslie (Purism) [this message]
2019-04-18 8:54 ` [PATCH v2 2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1 Robin Gong
2019-04-26 11:48 ` Vinod Koul
2019-03-29 15:21 ` [PATCH v2 3/3] arm64: dts: imx8mq: Change ahb clock for imx8mq Angus Ainslie (Purism)
2019-04-03 11:00 ` Shawn Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190329152130.18411-3-angus@akkea.ca \
--to=angus@akkea.ca \
--cc=agx@sigxcpu.org \
--cc=angus.ainslie@puri.sm \
--cc=ccaione@baylibre.com \
--cc=dan.j.williams@intel.com \
--cc=daniel.baluta@nxp.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).