Re: [PATCH 1/3] ata: sata_dwc_460ex: use "dmas" DT property to find dma channel

From: Andy Shevchenko
Date: Thu Dec 17 2015 - 10:01:53 EST


On Tue, 2015-12-15 at 23:34 +0000, MÃns RullgÃrd wrote:
> Mans Rullgard <mans@xxxxxxxxx> writes:
>
> > Currently this driver only works with a DesignWare DMA engine which
> > it
> > registers manually using the second "reg" address range and
> > interrupt
> > number from the DT node.
> >
> > This patch makes the driver instead use the "dmas" property if
> > present,
> > otherwise optionally falling back on the old way so existing device
> > trees can continue to work.
> >
> > With this change, there is no longer any reason to depend on the
> > 460EX
> > machine type so drop that from Kconfig.
> >
> > Signed-off-by: Mans Rullgard <mans@xxxxxxxxx>
> > ---
> > Âdrivers/ata/KconfigÂÂÂÂÂÂÂÂÂÂ|ÂÂ10 ++-
> > Âdrivers/ata/sata_dwc_460ex.c | 192 +++++++++++++++++++++++++++--
> > --------------
> > Â2 files changed, 131 insertions(+), 71 deletions(-)
>
> The corresponding patch for the canyonlands devicetree looks
> something
> like this.ÂÂI don't have any such hardware or even a manual, so I
> don't
> know what values to use for the various required DT properties of the
> DMA controller node, nor can I test it.ÂÂThe SATA driver works with a
> different DMA controller on a Sigma Designs chip.
>
> diff --git a/arch/powerpc/boot/dts/canyonlands.dts
> b/arch/powerpc/boot/dts/canyonlands.dts
> index 3dc75de..959f36e 100644
> --- a/arch/powerpc/boot/dts/canyonlands.dts
> +++ b/arch/powerpc/boot/dts/canyonlands.dts
> @@ -190,12 +190,22 @@
> Â Â/* DMA */ 0x2 &UIC0 0xc
> 0x4>;
> Â };
> Â
> + DMA0: dma@bffd0800 {
> + compatible = "snps,dma-spear1340";
> + reg = <4 0xbffd0800 0x400>;
> + interrupt-parent = <&UIC3>;
> + interrupts = <0x5 0x4>;
> + #dma-cells = <3>;
> + /* required properties here */

You have to move the master assignments and other custom dw_dmac
properties. Maybe at some point I will fix that in dw/platform.c.

> + };
> +
> Â SATA0: sata@bffd1000 {
> Â compatible = "amcc,sata-460ex";
> - reg = <4 0xbffd1000 0x800 4 0xbffd0800
> 0x400>;
> + reg = <4 0xbffd1000 0x800>;
> Â interrupt-parent = <&UIC3>;
> - interrupts = <0x0 0x4ÂÂÂÂÂÂÂ/* SATA */
> - ÂÂÂÂÂÂ0x5 0x4>;ÂÂÂÂÂ/* AHBDMA */
> + interrupts = <0x0 0x4>;
> + dmas = <&DMA0 0 0 1>;
> + dma-names = "sata-dma";
> Â };
> Â
> Â POB0: opb {
>
>

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/