From patchwork Fri Jun 17 08:21:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 890652 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5H8KieD003104 for ; Fri, 17 Jun 2011 08:21:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757655Ab1FQIVI (ORCPT ); Fri, 17 Jun 2011 04:21:08 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:52101 "EHLO relmlor3.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755328Ab1FQIVH (ORCPT ); Fri, 17 Jun 2011 04:21:07 -0400 Received: from relmlir1.idc.renesas.com ([10.200.68.151]) by relmlor3.idc.renesas.com ( SJSMS) with ESMTP id <0LMX00BV2DV66Y00@relmlor3.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 17:21:06 +0900 (JST) Received: from relmlac1.idc.renesas.com ([10.200.69.21]) by relmlir1.idc.renesas.com (SJSMS) with ESMTP id <0LMX0013GDV6UC10@relmlir1.idc.renesas.com> for linux-sh@vger.kernel.org; Fri, 17 Jun 2011 17:21:06 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 39AD880088; Fri, 17 Jun 2011 17:21:06 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 31C75800A2; Fri, 17 Jun 2011 17:21:06 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id TAD32404; Fri, 17 Jun 2011 17:21:06 +0900 Date: Fri, 17 Jun 2011 17:21:05 +0900 X-IronPort-AV: E=Sophos; i="4.65,380,1304262000"; d="scan'208"; a="32536015" Received: from unknown (HELO PG10870.renesas.com) ([172.30.8.159]) by relmlii1.idc.renesas.com with ESMTP; Fri, 17 Jun 2011 17:21:05 +0900 Message-id: To: Paul Mundt Cc: Simon , Magnus , Linux-SH , Guennadi , Kuninori Morimoto In-reply-to: References: 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") From: Kuninori Morimoto Subject: [RFC][PATCH 4/6 v3] dmaengine: shdma: add .needs_tend_set / .no_dmars flags 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 (demeter2.kernel.org [140.211.167.43]); Fri, 17 Jun 2011 08:21:09 +0000 (UTC) Signed-off-by: Kuninori Morimoto --- v2 -> v3 - u32 -> unsigned int for tend_set / no_dmars 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 6a21cd8..0f3ec8d 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 f25afc6..cb2dd11 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; unsigned int dmaor_is_32bit:1; + unsigned int needs_tend_set:1; + unsigned int 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