From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: Tomi Valkeinen <tomi.valkeinen@nokia.com>, linux-omap@vger.kernel.org
Subject: [PATCH 06/10] ARM: OMAP2/3: DMA: implement trans copy and const fill
Date: Tue, 19 May 2009 16:38:50 -0700 [thread overview]
Message-ID: <20090519233850.12760.62413.stgit@localhost> (raw)
In-Reply-To: <20090519232905.12760.15490.stgit@localhost>
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Implement transparent copy and constant fill features for OMAP2/3.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/plat-omap/dma.c | 77 +++++++++++++++++++++------------
arch/arm/plat-omap/include/mach/dma.h | 1
2 files changed, 50 insertions(+), 28 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 7fc8c04..58d98ad 100644
--- 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 54fe966..35fefdb 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
/*----------------------------------------------------------------------------*/
next prev parent reply other threads:[~2009-05-19 23:38 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-19 23:30 [PATCH 00/10] Omap updates for merge window after 2.6.30 Tony Lindgren
2009-05-19 23:32 ` [PATCH 01/10] ARM: OMAP: Increase VMALLOC_END to allow 256MB RAM Tony Lindgren
2009-05-19 23:33 ` [PATCH 02/10] ARM: OMAP: McBSP: Fix legacy interrupts to clear their status Tony Lindgren
2009-05-19 23:34 ` [PATCH 03/10] ARM: OMAP: Update contact address of I2C registration helper Tony Lindgren
2009-05-25 9:23 ` Russell King - ARM Linux
2009-05-25 11:32 ` Jarkko Nikula
2009-05-25 16:23 ` Tony Lindgren
2009-05-19 23:36 ` [PATCH 04/10] ARM: OMAP1: Misc clean-up Tony Lindgren
2009-05-19 23:37 ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work Tony Lindgren
2009-05-25 9:29 ` Russell King - ARM Linux
2009-05-25 13:21 ` Andrew de Quincey
2009-05-25 16:40 ` Andrew de Quincey
2009-05-28 18:20 ` Tony Lindgren
2009-05-28 18:44 ` Andrew de Quincey
2009-05-28 19:11 ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work, v2 Tony Lindgren
2009-05-28 21:03 ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work, v3 Tony Lindgren
2009-05-28 19:50 ` [PATCH 05/10] ARM: OMAP1: Make 770 LCD work Russell King - ARM Linux
2009-05-29 0:29 ` Andrew de Quincey
2009-06-01 13:57 ` Kalle Valo
2009-05-28 19:53 ` Russell King - ARM Linux
2009-05-28 21:02 ` [PATCH] ARM: Move clk_add_alias() to arch/arm/common/clkdev.c (Re: [PATCH 05/10] ARM: OMAP1: Make 770 LCD work) Tony Lindgren
2009-06-03 16:44 ` Tony Lindgren
2009-05-19 23:38 ` Tony Lindgren [this message]
2009-05-19 23:40 ` [PATCH 07/10] ARM: OMAP2/3: sDMA: Correct omap_request_dma_chain() Tony Lindgren
2009-05-25 9:34 ` Russell King - ARM Linux
2009-05-25 9:40 ` Shilimkar, Santosh
2009-05-25 16:28 ` [PATCH 07/10] ARM: OMAP2/3: sDMA: Correct omap_request_dma_chain(), v2 Tony Lindgren
2009-05-26 4:55 ` Shilimkar, Santosh
2009-05-19 23:41 ` [PATCH 08/10] ARM: OMAP2/3: Add generic onenand support when connected to GPMC Tony Lindgren
2009-05-25 9:43 ` Russell King - ARM Linux
2009-05-25 16:50 ` [PATCH 08/10] ARM: OMAP2/3: Add generic onenand support when connected to GPMC, v2 Tony Lindgren
2009-05-19 23:42 ` [PATCH 09/10] ARM: OMAP2/3: Add generic smc91x support when connected to GPMC Tony Lindgren
2009-05-25 9:46 ` Russell King - ARM Linux
2009-05-25 16:59 ` [PATCH 09/10] ARM: OMAP2/3: Add generic smc91x support when connected to GPMC, v2 Tony Lindgren
2009-05-19 23:44 ` [PATCH 10/10] ARM: OMAP2: 2430SDP: Add FB support to board file Tony Lindgren
2009-05-25 17:42 ` [PATCH 11/10] ARM: OMAP: Add some entries to MAINTAINERS Tony Lindgren
2009-05-26 23:18 ` [PATCH 00/10] Omap updates for merge window after 2.6.30 Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090519233850.12760.62413.stgit@localhost \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-omap@vger.kernel.org \
--cc=tomi.valkeinen@nokia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox