dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v2,2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1
@ 2019-03-29 15:21   ` Angus Ainslie
  2019-04-18  8:54     ` Robin Gong
  2019-04-26 11:48     ` [v2,2/3] " Vinod Koul
  0 siblings, 2 replies; 5+ messages in thread
From: Angus Ainslie @ 2019-03-29 15:21 UTC (permalink / raw)
  To: angus.ainslie
  Cc: Rob Herring, Mark Rutland, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Dan Williams, Vinod Koul, Lucas Stach, Angus Ainslie (Purism),
	Carlo Caione, Daniel Baluta, Guido Günther, devicetree,
	linux-arm-kernel, linux-kernel, dmaengine

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 */

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [v2,2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1
@ 2019-04-18  8:54     ` Robin Gong
  2019-04-18  8:54       ` [PATCH v2 2/3] " Robin Gong
  0 siblings, 1 reply; 5+ messages in thread
From: Robin Gong @ 2019-04-18  8:54 UTC (permalink / raw)
  To: Angus Ainslie, angus
  Cc: dl-linux-imx, linux-kernel, robh+dt, ccaione, devicetree,
	festevam, agx, dan.j.williams, mark.rutland, dmaengine, shawnguo,
	linux-arm-kernel, vkoul, Daniel Baluta, l.stach, kernel, s.hauer

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 */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1
  2019-04-18  8:54     ` Robin Gong
@ 2019-04-18  8:54       ` Robin Gong
  0 siblings, 0 replies; 5+ messages in thread
From: Robin Gong @ 2019-04-18  8:54 UTC (permalink / raw)
  To: Angus Ainslie, angus
  Cc: dl-linux-imx, linux-kernel, robh+dt, ccaione, devicetree,
	festevam, agx, dan.j.williams, mark.rutland, dmaengine, shawnguo,
	linux-arm-kernel, vkoul, Daniel Baluta, l.stach, kernel, s.hauer

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 */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [v2,2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1
@ 2019-04-26 11:48     ` Vinod Koul
  2019-04-26 11:48       ` [PATCH v2 2/3] " Vinod Koul
  0 siblings, 1 reply; 5+ messages in thread
From: Vinod Koul @ 2019-04-26 11:48 UTC (permalink / raw)
  To: Angus Ainslie (Purism)
  Cc: angus.ainslie, Rob Herring, Mark Rutland, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Dan Williams, Lucas Stach, Carlo Caione,
	Daniel Baluta, Guido Günther, devicetree, linux-arm-kernel,
	linux-kernel, dmaengine

On 29-03-19, 08:21, 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.

Applied, thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1
  2019-04-26 11:48     ` [v2,2/3] " Vinod Koul
@ 2019-04-26 11:48       ` Vinod Koul
  0 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2019-04-26 11:48 UTC (permalink / raw)
  To: Angus Ainslie (Purism)
  Cc: angus.ainslie, Rob Herring, Mark Rutland, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Dan Williams, Lucas Stach, Carlo Caione,
	Daniel Baluta, Guido Günther, devicetree, linux-arm-kernel,
	linux-kernel, dmaengine

On 29-03-19, 08:21, 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.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-26 11:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190328133828.20999-1-angus@akkea.ca>
     [not found] ` <20190329152130.18411-1-angus@akkea.ca>
2019-03-29 15:21   ` [v2,2/3] dmaengine: imx-sdma: Only check ratio on parts that support 1:1 Angus Ainslie
2019-04-18  8:54     ` Robin Gong
2019-04-18  8:54       ` [PATCH v2 2/3] " Robin Gong
2019-04-26 11:48     ` [v2,2/3] " Vinod Koul
2019-04-26 11:48       ` [PATCH v2 2/3] " Vinod Koul

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).