diff mbox

[09/12,v3] ARM: shmobile: r8a7791 dtsi: Enable DMA for QSPI

Message ID 1407329949-5695-10-git-send-email-geert+renesas@glider.be (mailing list archive)
State Not Applicable
Headers show

Commit Message

Geert Uytterhoeven Aug. 6, 2014, 12:59 p.m. UTC
Add a DMA property to the QSPI node

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: devicetree@vger.kernel.org
---
This depends on "[PATCH v2 8/8] ARM: shmobile: r8a7791: Add DMAC devices
to DT" of series "[PATCH v2 0/8] R-Car Gen2 DMA Controller driver".

v2:
  - Update DMA specifiers to match the renesas,rcar-dmac bindings,
v2:
  - QSPI needs to use 8-bit accesses for DMA, not 32-bit,
  - Reorder: TX first, RX second.
---
 arch/arm/boot/dts/r8a7791.dtsi | 2 ++
 1 file changed, 2 insertions(+)

Comments

Simon Horman Aug. 7, 2014, 12:37 a.m. UTC | #1
On Wed, Aug 06, 2014 at 02:59:06PM +0200, Geert Uytterhoeven wrote:
> Add a DMA property to the QSPI node
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: devicetree@vger.kernel.org
> ---
> This depends on "[PATCH v2 8/8] ARM: shmobile: r8a7791: Add DMAC devices
> to DT" of series "[PATCH v2 0/8] R-Car Gen2 DMA Controller driver".

Hi Geert, Hi Laurent,

Am I correct in assuming that with this patch applied things
will continue to work the old way until the patch above applied
to the same tree and from there on the user will get the new behaviour?

If so I think that I can take this patch as although the driver hasn't been
merged the relevant bindings were added to the subsystem maintainers tree
by "dmaengine: rcar-dmac: Add device tree bindings documentation" and are
available in linux-next.

Likewise for "[v3] ARM: shmobile: r8a7791 dtsi: Enable DMA for MSIO".

> v2:
>   - Update DMA specifiers to match the renesas,rcar-dmac bindings,
> v2:
>   - QSPI needs to use 8-bit accesses for DMA, not 32-bit,
>   - Reorder: TX first, RX second.
> ---
>  arch/arm/boot/dts/r8a7791.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
> index d59af615e365..8186c9f4a18a 100644
> --- a/arch/arm/boot/dts/r8a7791.dtsi
> +++ b/arch/arm/boot/dts/r8a7791.dtsi
> @@ -1044,6 +1044,8 @@
>  		reg = <0 0xe6b10000 0 0x2c>;
>  		interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
>  		clocks = <&mstp9_clks R8A7791_CLK_QSPI_MOD>;
> +		dmas = <&dmac0 0x17>, <&dmac0 0x18>;
> +		dma-names = "tx", "rx";
>  		num-cs = <1>;
>  		#address-cells = <1>;
>  		#size-cells = <0>;
> -- 
> 1.9.1
> 
--
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
Simon Horman Aug. 7, 2014, 12:39 a.m. UTC | #2
On Thu, Aug 07, 2014 at 09:37:56AM +0900, Simon Horman wrote:
> On Wed, Aug 06, 2014 at 02:59:06PM +0200, Geert Uytterhoeven wrote:
> > Add a DMA property to the QSPI node
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > Cc: devicetree@vger.kernel.org
> > ---
> > This depends on "[PATCH v2 8/8] ARM: shmobile: r8a7791: Add DMAC devices
> > to DT" of series "[PATCH v2 0/8] R-Car Gen2 DMA Controller driver".
> 
> Hi Geert, Hi Laurent,
> 
> Am I correct in assuming that with this patch applied things
> will continue to work the old way until the patch above applied
> to the same tree and from there on the user will get the new behaviour?
> 
> If so I think that I can take this patch as although the driver hasn't been
> merged the relevant bindings were added to the subsystem maintainers tree
> by "dmaengine: rcar-dmac: Add device tree bindings documentation" and are
> available in linux-next.
> 
> Likewise for "[v3] ARM: shmobile: r8a7791 dtsi: Enable DMA for MSIO".

... and "ARM: shmobile: r8a7790 dtsi: Enable DMA for QSPI"

> > v2:
> >   - Update DMA specifiers to match the renesas,rcar-dmac bindings,
> > v2:
> >   - QSPI needs to use 8-bit accesses for DMA, not 32-bit,
> >   - Reorder: TX first, RX second.
> > ---
> >  arch/arm/boot/dts/r8a7791.dtsi | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
> > index d59af615e365..8186c9f4a18a 100644
> > --- a/arch/arm/boot/dts/r8a7791.dtsi
> > +++ b/arch/arm/boot/dts/r8a7791.dtsi
> > @@ -1044,6 +1044,8 @@
> >  		reg = <0 0xe6b10000 0 0x2c>;
> >  		interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
> >  		clocks = <&mstp9_clks R8A7791_CLK_QSPI_MOD>;
> > +		dmas = <&dmac0 0x17>, <&dmac0 0x18>;
> > +		dma-names = "tx", "rx";
> >  		num-cs = <1>;
> >  		#address-cells = <1>;
> >  		#size-cells = <0>;
> > -- 
> > 1.9.1
> > 
--
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
Simon Horman Aug. 7, 2014, 12:41 a.m. UTC | #3
On Thu, Aug 07, 2014 at 09:39:08AM +0900, Simon Horman wrote:
> On Thu, Aug 07, 2014 at 09:37:56AM +0900, Simon Horman wrote:
> > On Wed, Aug 06, 2014 at 02:59:06PM +0200, Geert Uytterhoeven wrote:
> > > Add a DMA property to the QSPI node
> > > 
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > Cc: devicetree@vger.kernel.org
> > > ---
> > > This depends on "[PATCH v2 8/8] ARM: shmobile: r8a7791: Add DMAC devices
> > > to DT" of series "[PATCH v2 0/8] R-Car Gen2 DMA Controller driver".
> > 
> > Hi Geert, Hi Laurent,
> > 
> > Am I correct in assuming that with this patch applied things
> > will continue to work the old way until the patch above applied
> > to the same tree and from there on the user will get the new behaviour?
> > 
> > If so I think that I can take this patch as although the driver hasn't been
> > merged the relevant bindings were added to the subsystem maintainers tree
> > by "dmaengine: rcar-dmac: Add device tree bindings documentation" and are
> > available in linux-next.
> > 
> > Likewise for "[v3] ARM: shmobile: r8a7791 dtsi: Enable DMA for MSIO".
> 
> ... and "ARM: shmobile: r8a7790 dtsi: Enable DMA for QSPI"

... and "ARM: shmobile: r8a7790 dtsi: Enable DMA for MSIO"

and any other similar patches I didn't list above :)

> 
> > > v2:
> > >   - Update DMA specifiers to match the renesas,rcar-dmac bindings,
> > > v2:
> > >   - QSPI needs to use 8-bit accesses for DMA, not 32-bit,
> > >   - Reorder: TX first, RX second.
> > > ---
> > >  arch/arm/boot/dts/r8a7791.dtsi | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
> > > index d59af615e365..8186c9f4a18a 100644
> > > --- a/arch/arm/boot/dts/r8a7791.dtsi
> > > +++ b/arch/arm/boot/dts/r8a7791.dtsi
> > > @@ -1044,6 +1044,8 @@
> > >  		reg = <0 0xe6b10000 0 0x2c>;
> > >  		interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
> > >  		clocks = <&mstp9_clks R8A7791_CLK_QSPI_MOD>;
> > > +		dmas = <&dmac0 0x17>, <&dmac0 0x18>;
> > > +		dma-names = "tx", "rx";
> > >  		num-cs = <1>;
> > >  		#address-cells = <1>;
> > >  		#size-cells = <0>;
> > > -- 
> > > 1.9.1
> > > 
--
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
Geert Uytterhoeven Aug. 7, 2014, 8:27 a.m. UTC | #4
Hi Simon,

On Thu, Aug 7, 2014 at 2:41 AM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Aug 07, 2014 at 09:39:08AM +0900, Simon Horman wrote:
>> On Thu, Aug 07, 2014 at 09:37:56AM +0900, Simon Horman wrote:
>> > On Wed, Aug 06, 2014 at 02:59:06PM +0200, Geert Uytterhoeven wrote:
>> > > Add a DMA property to the QSPI node
>> > >
>> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> > > Cc: devicetree@vger.kernel.org
>> > > ---
>> > > This depends on "[PATCH v2 8/8] ARM: shmobile: r8a7791: Add DMAC devices
>> > > to DT" of series "[PATCH v2 0/8] R-Car Gen2 DMA Controller driver".
>> >
>> > Hi Geert, Hi Laurent,
>> >
>> > Am I correct in assuming that with this patch applied things
>> > will continue to work the old way until the patch above applied
>> > to the same tree and from there on the user will get the new behaviour?
>> >
>> > If so I think that I can take this patch as although the driver hasn't been
>> > merged the relevant bindings were added to the subsystem maintainers tree
>> > by "dmaengine: rcar-dmac: Add device tree bindings documentation" and are
>> > available in linux-next.
>> >
>> > Likewise for "[v3] ARM: shmobile: r8a7791 dtsi: Enable DMA for MSIO".
>>
>> ... and "ARM: shmobile: r8a7790 dtsi: Enable DMA for QSPI"
>
> ... and "ARM: shmobile: r8a7790 dtsi: Enable DMA for MSIO"
>
> and any other similar patches I didn't list above :)

Yes[*].

If rcar-dma is not available, drivers fall back to PIO, cfr. for rspi:

-renesas_spi e6b10000.spi: DMA available
+renesas_spi e6b10000.spi: dma_request_slave_channel_compat failed
+renesas_spi e6b10000.spi: DMA not available, using PIO
 renesas_spi e6b10000.spi: registered master spi0
 spi spi0.0: setup mode 0, 8 bits/w, 30000000 Hz max --> 0
 m25p80 spi0.0: s25fl512s (65536 Kbytes)
 3 ofpart partitions found on MTD device spi0.0
 Creating 3 MTD partitions on "spi0.0":
 0x000000000000-0x000000080000 : "loader"
 0x000000080000-0x000000100000 : "bootenv"
 0x000000100000-0x000004000000 : "data"
 renesas_spi e6b10000.spi: registered child spi0.0

and sh-msiof:

-spi_sh_msiof e6e20000.spi: DMA available
+spi_sh_msiof e6e20000.spi: dma_request_slave_channel_compat failed
+spi_sh_msiof e6e20000.spi: DMA not available, using PIO
 spi_sh_msiof e6e20000.spi: registered master spi1
 spi spi1.0: setup mode 3, 8 bits/w, 6000000 Hz max --> 0
 spi_sh_msiof e6e20000.spi: registered child spi1.0

and everything still works, but slower.

[*] If the individual DMA slave drivers properly handle DMA request
    failures. If they don't, they will already fail now, as there is no DMA
    platform configuration without the dmas/dma-names properties
    (ignoring Magnus' DMA prototypes using auxdata, as DT is the way
     forward).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
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/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index d59af615e365..8186c9f4a18a 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -1044,6 +1044,8 @@ 
 		reg = <0 0xe6b10000 0 0x2c>;
 		interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp9_clks R8A7791_CLK_QSPI_MOD>;
+		dmas = <&dmac0 0x17>, <&dmac0 0x18>;
+		dma-names = "tx", "rx";
 		num-cs = <1>;
 		#address-cells = <1>;
 		#size-cells = <0>;