diff mbox

[1/3] Documentation:spi:fsl-dspi:add DSPI dma transfer support

Message ID 1393311258-14380-1-git-send-email-b44548@freescale.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Chao Fu Feb. 25, 2014, 6:54 a.m. UTC
From: Chao Fu <B44548@freescale.com>

Add bool value use-dma.
The bool will determine whether DSPI use dma channel transfer data
in a platform.

Add dmas and dma-names for describing dma channels of DSPI.

Signed-off-by: Chao Fu      <b44548@freescale.com>
---
 Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Mark Rutland Feb. 25, 2014, 9:08 a.m. UTC | #1
On Tue, Feb 25, 2014 at 06:54:16AM +0000, Chao Fu wrote:
> From: Chao Fu <B44548@freescale.com>
> 
> Add bool value use-dma.
> The bool will determine whether DSPI use dma channel transfer data
> in a platform.
> 
> Add dmas and dma-names for describing dma channels of DSPI.
> 
> Signed-off-by: Chao Fu      <b44548@freescale.com>
> ---
>  Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
> index 5376de4..76a1039 100644
> --- a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
> +++ b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
> @@ -11,6 +11,11 @@ Required properties:
>  - spi-num-chipselects : the number of the chipselect signals.
>  - bus-num : the slave chip chipselect signal number.
>  - big-endian : if DSPI modudle is big endian, the bool will be set in node.
> +- use-dma: the bool decide if use dma method in DSPI transfering.

Why can the OS not decide this based on the presence of dmas which it
can use?

Is there ever a case that there would be dmas present but it would be in
the interests of the OS to not use them?

Mark.

> +- dmas: List of DMA specifiers with the controller specific format
> +	as described in the generic DMA client binding. A tx and rx
> +	specifier is required for each chip select.
> +- dma-names: Should be named "tx" and "rx".
>  Example:
>  
>  dspi0@4002c000 {
> @@ -26,6 +31,10 @@ dspi0@4002c000 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pinctrl_dspi0_1>;
>  	big-endian;
> +	use-dma;
> +	dmas = <&edma0 0 12>,
> +		<&edma0 0 13>;
> +	dma-names = "rx", "tx";
>  	status = "okay";
>  
>  	sflash: at26df081a@0 {
> -- 
> 1.8.4
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Shawn Guo Feb. 26, 2014, 2:19 p.m. UTC | #2
On Tue, Feb 25, 2014 at 09:08:30AM +0000, Mark Rutland wrote:
> On Tue, Feb 25, 2014 at 06:54:16AM +0000, Chao Fu wrote:
> > From: Chao Fu <B44548@freescale.com>
> > 
> > Add bool value use-dma.
> > The bool will determine whether DSPI use dma channel transfer data
> > in a platform.
> > 
> > Add dmas and dma-names for describing dma channels of DSPI.
> > 
> > Signed-off-by: Chao Fu      <b44548@freescale.com>
> > ---
> >  Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
> > index 5376de4..76a1039 100644
> > --- a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
> > +++ b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
> > @@ -11,6 +11,11 @@ Required properties:
> >  - spi-num-chipselects : the number of the chipselect signals.
> >  - bus-num : the slave chip chipselect signal number.
> >  - big-endian : if DSPI modudle is big endian, the bool will be set in node.
> > +- use-dma: the bool decide if use dma method in DSPI transfering.
> 
> Why can the OS not decide this based on the presence of dmas which it
> can use?

Yes, OS/driver should decide to use DMA or not, but it shouldn't be
based on the presence of 'dmas' property.  The DMA is a hardware
resource just like IRQ.  It should be just there in client device's node
as long as the SoC design assigns the channel to the device.  The device
driver should make the decision when DMA should be used, e.g. big amount
data transfer, and when PIO should be used, e.g. small data.

Shawn

> 
> Is there ever a case that there would be dmas present but it would be in
> the interests of the OS to not use them?

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Feb. 26, 2014, 3:38 p.m. UTC | #3
On Wed, Feb 26, 2014 at 10:19:49PM +0800, Shawn Guo wrote:
> On Tue, Feb 25, 2014 at 09:08:30AM +0000, Mark Rutland wrote:

> > > +- use-dma: the bool decide if use dma method in DSPI transfering.

> > Why can the OS not decide this based on the presence of dmas which it
> > can use?

> Yes, OS/driver should decide to use DMA or not, but it shouldn't be
> based on the presence of 'dmas' property.  The DMA is a hardware
> resource just like IRQ.  It should be just there in client device's node
> as long as the SoC design assigns the channel to the device.  The device
> driver should make the decision when DMA should be used, e.g. big amount
> data transfer, and when PIO should be used, e.g. small data.

Right, that's very common - but that decision is usually taken on a per
transfer basis so a DT property would seem odd, especially just a simple
boolean.
Shawn Guo Feb. 27, 2014, 7:42 a.m. UTC | #4
On Thu, Feb 27, 2014 at 12:38:22AM +0900, Mark Brown wrote:
> On Wed, Feb 26, 2014 at 10:19:49PM +0800, Shawn Guo wrote:
> > On Tue, Feb 25, 2014 at 09:08:30AM +0000, Mark Rutland wrote:
> 
> > > > +- use-dma: the bool decide if use dma method in DSPI transfering.
> 
> > > Why can the OS not decide this based on the presence of dmas which it
> > > can use?
> 
> > Yes, OS/driver should decide to use DMA or not, but it shouldn't be
> > based on the presence of 'dmas' property.  The DMA is a hardware
> > resource just like IRQ.  It should be just there in client device's node
> > as long as the SoC design assigns the channel to the device.  The device
> > driver should make the decision when DMA should be used, e.g. big amount
> > data transfer, and when PIO should be used, e.g. small data.
> 
> Right, that's very common - but that decision is usually taken on a per
> transfer basis so a DT property would seem odd, especially just a simple
> boolean.

Yea, I guess we're on the same page - the decision should be made by
the device driver on its own not the device tree.

Shawn

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
index 5376de4..76a1039 100644
--- a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
+++ b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
@@ -11,6 +11,11 @@  Required properties:
 - spi-num-chipselects : the number of the chipselect signals.
 - bus-num : the slave chip chipselect signal number.
 - big-endian : if DSPI modudle is big endian, the bool will be set in node.
+- use-dma: the bool decide if use dma method in DSPI transfering.
+- dmas: List of DMA specifiers with the controller specific format
+	as described in the generic DMA client binding. A tx and rx
+	specifier is required for each chip select.
+- dma-names: Should be named "tx" and "rx".
 Example:
 
 dspi0@4002c000 {
@@ -26,6 +31,10 @@  dspi0@4002c000 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_dspi0_1>;
 	big-endian;
+	use-dma;
+	dmas = <&edma0 0 12>,
+		<&edma0 0 13>;
+	dma-names = "rx", "tx";
 	status = "okay";
 
 	sflash: at26df081a@0 {