devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Gong <yibin.gong@nxp.com>
To: Angus Ainslie <angus.ainslie@puri.sm>, "angus@akkea.ca" <angus@akkea.ca>
Cc: dl-linux-imx <linux-imx@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"ccaione@baylibre.com" <ccaione@baylibre.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"agx@sigxcpu.org" <agx@sigxcpu.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	"l.stach@pengutronix.de"
	<l.stach@pengutronix.de>"kernel@pengutronix.de" <kern>
Subject: Re: [PATCH v2 2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1
Date: Thu, 18 Apr 2019 08:54:07 +0000	[thread overview]
Message-ID: <1555577278.24617.6.camel@nxp.com> (raw)
In-Reply-To: <20190329152130.18411-3-angus@akkea.ca>

Acked-by: Robin Gong <yibin.gong@nxp.com>
On 2019-03-29 at 15:21 +0000, Angus Ainslie (Purism) wrote:
> 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 */

  reply	other threads:[~2019-04-18  8:54 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   ` [PATCH v2 2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1 Angus Ainslie (Purism)
2019-04-18  8:54     ` Robin Gong [this message]
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=1555577278.24617.6.camel@nxp.com \
    --to=yibin.gong@nxp.com \
    --cc=agx@sigxcpu.org \
    --cc=angus.ainslie@puri.sm \
    --cc=angus@akkea.ca \
    --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=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=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).