1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
From a734ac5eef1dd8ee8cba4eea5d2db568247c484c Mon Sep 17 00:00:00 2001
From: Philip Balister <philip@opensdr.com>
Date: Thu, 22 Apr 2010 19:41:58 -0700
Subject: [PATCH 02/22] Add functions to dma.c to set address and length for src and dest.
---
arch/arm/plat-omap/dma.c | 30 ++++++++++++++++++++++++++++++
arch/arm/plat-omap/include/plat/dma.h | 4 ++++
2 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index c4b2b47..f28f756 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -471,6 +471,21 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
}
EXPORT_SYMBOL(omap_set_dma_src_burst_mode);
+void omap_set_dma_src_addr_size(int lch, unsigned int addr, int elem_count)
+{
+
+ if (cpu_class_is_omap1()) {
+ p->dma_write(addr >> 16, CSSA, lch);
+ //p->dma_write((u16)addr, CSSA_L, lch);
+ }
+
+ if (cpu_class_is_omap2())
+ p->dma_write(addr, CSSA, lch);
+
+ p->dma_write(elem_count, CEN, lch);
+}
+EXPORT_SYMBOL_GPL(omap_set_dma_src_addr_size);
+
/* Note that dest_port is only for OMAP1 */
void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
unsigned long dest_start,
@@ -561,6 +576,21 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
}
EXPORT_SYMBOL(omap_set_dma_dest_burst_mode);
+void omap_set_dma_dest_addr_size(int lch, unsigned int addr, int elem_count)
+{
+
+ if (cpu_class_is_omap1()) {
+ p->dma_write(addr >> 16, CDSA, lch);
+ //p->dma_write((u16)addr, CDSA_L, lch);
+ }
+
+ if (cpu_class_is_omap2())
+ p->dma_write(addr, CDSA, lch);
+
+ p->dma_write(elem_count, CEN, lch);
+}
+EXPORT_SYMBOL_GPL(omap_set_dma_dest_addr_size);
+
static inline void omap_enable_channel_irq(int lch)
{
u32 status;
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index d1c916f..1e7243e 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -462,6 +462,8 @@ extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
extern void omap_set_dma_src_data_pack(int lch, int enable);
extern void omap_set_dma_src_burst_mode(int lch,
enum omap_dma_burst_mode burst_mode);
+extern void omap_set_dma_src_addr_size(int lch, unsigned int addr,
+ int elem_count);
extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
unsigned long dest_start,
@@ -470,6 +472,8 @@ extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
extern void omap_set_dma_dest_data_pack(int lch, int enable);
extern void omap_set_dma_dest_burst_mode(int lch,
enum omap_dma_burst_mode burst_mode);
+extern void omap_set_dma_dest_addr_size(int lch, unsigned int addr,
+ int elem_count);
extern void omap_set_dma_params(int lch,
struct omap_dma_channel_params *params);
--
1.6.6.1
|