From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966363AbbLQPBt (ORCPT ); Thu, 17 Dec 2015 10:01:49 -0500 Received: from mga04.intel.com ([192.55.52.120]:27952 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756607AbbLQPBr (ORCPT ); Thu, 17 Dec 2015 10:01:47 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,441,1444719600"; d="scan'208";a="619609256" Message-ID: <1450364395.30729.136.camel@linux.intel.com> Subject: Re: [PATCH 1/3] ata: sata_dwc_460ex: use "dmas" DT property to find dma channel From: Andy Shevchenko To: =?ISO-8859-1?Q?M=E5ns_Rullg=E5rd?= , Tejun Heo Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 17 Dec 2015 16:59:55 +0200 In-Reply-To: References: <1450221935-6034-1-git-send-email-mans@mansr.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-12-15 at 23:34 +0000, Måns Rullgård wrote: > Mans Rullgard 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 > > --- > >  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 Intel Finland Oy