From patchwork Wed Apr 22 07:14:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 19326 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3M7GNsM012453 for ; Wed, 22 Apr 2009 07:16:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751126AbZDVHQW (ORCPT ); Wed, 22 Apr 2009 03:16:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751162AbZDVHQV (ORCPT ); Wed, 22 Apr 2009 03:16:21 -0400 Received: from smtp.nokia.com ([192.100.105.134]:54111 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126AbZDVHQV (ORCPT ); Wed, 22 Apr 2009 03:16:21 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n3M7FsKh023832 for ; Wed, 22 Apr 2009 02:16:20 -0500 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 22 Apr 2009 10:14:42 +0300 Received: from mgw-int01.ntc.nokia.com ([172.21.143.96]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 22 Apr 2009 10:14:41 +0300 Received: from localhost.localdomain (esdhcp042218.research.nokia.com [172.21.42.218]) by mgw-int01.ntc.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id n3M7EcAb017820; Wed, 22 Apr 2009 10:14:40 +0300 From: Tomi Valkeinen To: linux-omap@vger.kernel.org Cc: Tomi Valkeinen Subject: [PATCH] OMAP2/3: DMA: implement trans copy and const fill Date: Wed, 22 Apr 2009 10:14:38 +0300 Message-Id: <1240384478-9626-1-git-send-email-tomi.valkeinen@nokia.com> X-Mailer: git-send-email 1.6.1.2 X-OriginalArrivalTime: 22 Apr 2009 07:14:41.0839 (UTC) FILETIME=[017E4BF0:01C9C31A] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Implement transparent copy and constant fill features for OMAP2/3. Signed-off-by: Tomi Valkeinen --- arch/arm/plat-omap/dma.c | 81 +++++++++++++++++++++------------ arch/arm/plat-omap/include/mach/dma.h | 1 + 2 files changed, 52 insertions(+), 30 deletions(-) diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 3fd0e77..060ac71 100755 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -310,41 +310,62 @@ EXPORT_SYMBOL(omap_set_dma_transfer_params); void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color) { - u16 w; - BUG_ON(omap_dma_in_1510_mode()); - if (cpu_class_is_omap2()) { - REVISIT_24XX(); - return; - } + if (cpu_class_is_omap1()) { + u16 w; - w = dma_read(CCR2(lch)); - w &= ~0x03; + w = dma_read(CCR2(lch)); + w &= ~0x03; - switch (mode) { - case OMAP_DMA_CONSTANT_FILL: - w |= 0x01; - break; - case OMAP_DMA_TRANSPARENT_COPY: - w |= 0x02; - break; - case OMAP_DMA_COLOR_DIS: - break; - default: - BUG(); + switch (mode) { + case OMAP_DMA_CONSTANT_FILL: + w |= 0x01; + break; + case OMAP_DMA_TRANSPARENT_COPY: + w |= 0x02; + break; + case OMAP_DMA_COLOR_DIS: + break; + default: + BUG(); + } + dma_write(w, CCR2(lch)); + + w = dma_read(LCH_CTRL(lch)); + w &= ~0x0f; + /* Default is channel type 2D */ + if (mode) { + dma_write((u16)color, COLOR_L(lch)); + dma_write((u16)(color >> 16), COLOR_U(lch)); + w |= 1; /* Channel type G */ + } + dma_write(w, LCH_CTRL(lch)); } - dma_write(w, CCR2(lch)); - w = dma_read(LCH_CTRL(lch)); - w &= ~0x0f; - /* Default is channel type 2D */ - if (mode) { - dma_write((u16)color, COLOR_L(lch)); - dma_write((u16)(color >> 16), COLOR_U(lch)); - w |= 1; /* Channel type G */ + if (cpu_class_is_omap2()) { + u32 val; + + val = dma_read(CCR(lch)); + val &= ~((1 << 17) | (1 << 16)); + + switch (mode) { + case OMAP_DMA_CONSTANT_FILL: + val |= 1 << 16; + break; + case OMAP_DMA_TRANSPARENT_COPY: + val |= 1 << 17; + break; + case OMAP_DMA_COLOR_DIS: + break; + default: + BUG(); + } + dma_write(val, CCR(lch)); + + color &= 0xffffff; + dma_write(color, COLOR(lch)); } - dma_write(w, LCH_CTRL(lch)); } EXPORT_SYMBOL(omap_set_dma_color_mode); diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/mach/dma.h index 224b077..4e34f47 100644 --- a/arch/arm/plat-omap/include/mach/dma.h +++ b/arch/arm/plat-omap/include/mach/dma.h @@ -144,6 +144,7 @@ #define OMAP_DMA4_CSSA_U(n) 0 #define OMAP_DMA4_CDSA_L(n) 0 #define OMAP_DMA4_CDSA_U(n) 0 +#define OMAP1_DMA_COLOR(n) 0 /*----------------------------------------------------------------------------*/