From patchwork Fri Jun 17 05:28:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 890302 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5H5SwwB002971 for ; Fri, 17 Jun 2011 05:28:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751560Ab1FQF25 (ORCPT ); Fri, 17 Jun 2011 01:28:57 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:62285 "EHLO relmlor4.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754787Ab1FQF25 (ORCPT ); Fri, 17 Jun 2011 01:28:57 -0400 Received: from relmlir1.idc.renesas.com ([10.200.68.151]) by relmlor4.idc.renesas.com ( SJSMS) with ESMTP id <0LMX007VW5VOGG60@relmlor4.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 14:28:36 +0900 (JST) Received: from relmlac2.idc.renesas.com ([10.200.69.22]) by relmlir1.idc.renesas.com (SJSMS) with ESMTP id <0LMX00K9F5VOZHD0@relmlir1.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 14:28:36 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 47E7D28076; Fri, 17 Jun 2011 14:28:36 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 4248A28070; Fri, 17 Jun 2011 14:28:36 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id QAE26345; Fri, 17 Jun 2011 14:28:36 +0900 Date: Fri, 17 Jun 2011 14:28:35 +0900 X-IronPort-AV: E=Sophos; i="4.65,379,1304262000"; d="scan'208"; a="32488568" Received: from unknown (HELO PG10870.renesas.com) ([172.30.8.159]) by relmlii1.idc.renesas.com with ESMTP; Fri, 17 Jun 2011 14:28:35 +0900 Message-id: From: Kuninori Morimoto To: Paul Mundt , Simon Horman Cc: Magnus , Linux-SH , Guennadi , Kuninori Morimoto Subject: [RFC][PATCH 4/6 v2] dmaengine: shdma: add .needs_tend_set / .no_dmars flags In-reply-to: <20110617051540.GF22265@verge.net.au> References: <20110617043614.GB22265@verge.net.au> <20110617051540.GF22265@verge.net.au> User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-2022-JP-2?B?U2Fuag==?= =?ISO-2022-JP-2?B?GyQoRCtXGyhC?=) APEL/10.6 Emacs/23.2 (i386-mingw-nt5.1.2600) MULE/6.0 (HANACHIRUSATO) MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 17 Jun 2011 05:28:58 +0000 (UTC) Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman --- This is v2 of "dmaengine: shdma: add is_usbdmac flag" v1 -> v2 - use "needs_tend_set" / "no_dmars" instead of "is_usbdmac", drivers/dma/shdma.c | 6 ++++++ include/linux/sh_dma.h | 4 ++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index aa91309..d903bdc 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c @@ -194,6 +194,9 @@ static void dmae_start(struct sh_dmae_chan *sh_chan) struct sh_dmae_device *shdev = to_sh_dev(sh_chan); u32 chcr = chcr_read(sh_chan); + if (shdev->pdata->needs_tend_set) + sh_dmae_writel(sh_chan, 0xFFFFFFFF, TEND); + chcr |= CHCR_DE | shdev->chcr_ie_bit; chcr_write(sh_chan, chcr & ~CHCR_TE); } @@ -242,6 +245,9 @@ static int dmae_set_dmars(struct sh_dmae_chan *sh_chan, u16 val) if (dmae_is_busy(sh_chan)) return -EBUSY; + if (pdata->no_dmars) + return 0; + /* in the case of a missing DMARS resource use first memory window */ if (!addr) addr = (u16 __iomem *)shdev->chan_reg; diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h index 6a98daf..3b9ffb9 100644 --- a/include/linux/sh_dma.h +++ b/include/linux/sh_dma.h @@ -66,6 +66,8 @@ struct sh_dmae_pdata { u32 chcr_ie_bit; u32 dmaor_is_32bit:1; + u32 needs_tend_set:1; + u32 no_dmars:1; }; /* DMA register */ @@ -75,6 +77,8 @@ struct sh_dmae_pdata { #define CHCR 0x0C #define DMAOR 0x40 +#define TEND 0x18 /* USB-DMAC */ + /* DMAOR definitions */ #define DMAOR_AE 0x00000004 #define DMAOR_NMIF 0x00000002