summaryrefslogtreecommitdiff
path: root/target/linux/coldfire/patches/032-m5445x_edma_update.patch
blob: 17f2becbd0fba8a6a0df89c1378c6db4d9e45539 (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
From 7b5b08d99d5362e9c36fd7d42d6c06c2a848266c Mon Sep 17 00:00:00 2001
From: Kurt Mahan <kmahan@freescale.com>
Date: Sun, 9 Dec 2007 02:21:19 -0700
Subject: [PATCH] Update EDMA.

LTIBName: m5445x-edma-update
Signed-off-by: Kurt Mahan <kmahan@freescale.com>
---
 drivers/spi/coldfire_edma.c      |  261 +++++++++++++++++++++++---------------
 include/asm-m68k/coldfire_edma.h |    9 +-
 include/asm-m68k/mcf5445x_edma.h |   28 +++-
 3 files changed, 188 insertions(+), 110 deletions(-)

--- a/drivers/spi/coldfire_edma.c
+++ b/drivers/spi/coldfire_edma.c
@@ -20,76 +20,91 @@
 #include <linux/cdev.h>
 #include <linux/seq_file.h>
 #include <linux/proc_fs.h>
+#ifdef CONFIG_M54455
 #include <asm/mcf5445x_edma.h>
 #include <asm/mcf5445x_intc.h>
+#endif /* CONFIG_M54455 */
 #include <asm/coldfire_edma.h>
 
-
-/* callback handler data for each TCD */
+/*
+ * Callback handler data for each TCD
+ */
 struct edma_isr_record {
-	edma_irq_handler irq_handler;       /* interrupt handler */
-	edma_error_handler error_handler;	/* error interrupt handler */
-	void* dev;							/* device used for the channel */
-	int  allocated;						/* busy flag */
-	spinlock_t *lock;					/* spin lock (if needs to be locked in interrupt) */
-	const char* device_id;				/* device id string, used in proc file system */
+	edma_irq_handler irq_handler;	  /* interrupt handler */
+	edma_error_handler error_handler; /* error interrupt handler */
+	void *arg;			  /* argument to pass back */
+	int allocated;			  /* busy flag */
+	spinlock_t *lock;		  /* spin lock (optional) */
+	const char *device_id;		  /* dev id string, used in procfs */
 };
 
-/* device structure */
+/*
+ * Device structure
+ */
 struct coldfire_edma_dev {
-	struct cdev cdev; 			/* character device */
-	struct edma_isr_record dma_interrupt_handlers[EDMA_CHANNELS]; /* channel handlers */
+	struct cdev cdev;		  /* character device */
+	struct edma_isr_record dma_interrupt_handlers[EDMA_CHANNELS];
 };
 
 /* allocated major device number */
 static int coldfire_dma_major;
+
 /* device driver structure */
-static struct coldfire_edma_dev* devp = NULL;
+static struct coldfire_edma_dev *devp = NULL;
 
 /* device driver file operations */
 struct file_operations coldfire_edma_fops = {
 	.owner = THIS_MODULE,
 };
 
-/* eDMA channel interrupt handler */
+/**
+ * dmaisr - eDMA channel interrupt handler
+ * @irq: interrupt number
+ * @dev_id: argument
+ */
 static int dmaisr(int irq, void *dev_id)
 {
 	int channel = irq - EDMA_INT_CONTROLLER_BASE - EDMA_INT_CHANNEL_BASE;
 	int result = IRQ_HANDLED;
 
-	if (devp!=NULL && devp->dma_interrupt_handlers[channel].lock) {
-		spin_lock(devp->dma_interrupt_handlers[channel].lock);
-	}
+	if ((devp != NULL) &&
+	    (devp->dma_interrupt_handlers[channel].irq_handler)) {
+		/* call user irq handler */
+		if (devp->dma_interrupt_handlers[channel].lock)
+			spin_lock(devp->dma_interrupt_handlers[channel].lock);
+
+		result = devp->dma_interrupt_handlers[channel].irq_handler(
+			channel, devp->dma_interrupt_handlers[channel].arg);
 
-	if (devp!=NULL && devp->dma_interrupt_handlers[channel].irq_handler) {
-		result = devp->dma_interrupt_handlers[channel].irq_handler(channel,
-							devp->dma_interrupt_handlers[channel].dev);
+   		if (devp->dma_interrupt_handlers[channel].lock)
+			spin_unlock(devp->dma_interrupt_handlers[channel].lock);
 	} else {
+		/* no irq handler so just ack it */
 		confirm_edma_interrupt_handled(channel);
-		printk(EDMA_DRIVER_NAME ": No handler for DMA channel %d\n", channel);
-	}
-
-   	if (devp!=NULL && devp->dma_interrupt_handlers[channel].lock) {
-		spin_unlock(devp->dma_interrupt_handlers[channel].lock);
+		printk(EDMA_DRIVER_NAME ": No handler for DMA channel %d\n",
+		       channel);
 	}
 
 	return result;
 }
 
-/* eDMA error interrupt handler */
+/**
+ * dma_error_isr - eDMA error interrupt handler
+ * @irq: interrupt number
+ * @dev_id: argument
+ */
 static int dma_error_isr(int irq, void* dev_id)
 {
 	u16 err;
 	int i;
 
 	err = MCF_EDMA_ERR;
-	for (i=0;i<EDMA_CHANNELS;i++) {
+	for (i=0; i<EDMA_CHANNELS; i++) {
 		if (err & (1<<i)) {
-			if (devp!=NULL && devp->dma_interrupt_handlers[i].error_handler) {
-				devp->dma_interrupt_handlers[i].error_handler(i, devp->dma_interrupt_handlers[i].dev);
-			} else {
+			if (devp!=NULL && devp->dma_interrupt_handlers[i].error_handler)
+				devp->dma_interrupt_handlers[i].error_handler(i, devp->dma_interrupt_handlers[i].arg);
+			else
 				printk(KERN_WARNING EDMA_DRIVER_NAME ": DMA error on channel %d\n", i);
-			}
 		}
 	}
 
@@ -97,11 +112,26 @@ static int dma_error_isr(int irq, void* 
 	return IRQ_HANDLED;
 }
 
-/* sets channel parameters */
+/**
+ * set_edma_params - Set transfer control descriptor (TCD)
+ * @channel: channel number
+ * @source: source address
+ * @dest: destination address
+ * @attr: attributes
+ * @soff: source offset
+ * @nbytes: number of bytes to be transfered in minor loop
+ * @slast: last source address adjustment
+ * @citer: major loop count
+ * @biter: beginning minor loop count
+ * @doff: destination offset
+ * @dlast_sga: last destination address adjustment
+ * @major_int: generate interrupt after each major loop
+ * @disable_req: disable DMA request after major loop
+ */
 void set_edma_params(int channel, u32 source, u32 dest,
-					 u32 attr, u32 soff, u32 nbytes, u32 slast,
-					 u32 citer, u32 biter, u32 doff, u32 dlast_sga,
-					 int major_int, int disable_req)
+	u32 attr, u32 soff, u32 nbytes, u32 slast,
+	u32 citer, u32 biter, u32 doff, u32 dlast_sga,
+	int major_int, int disable_req)
 {
 
 	if (channel<0 || channel>EDMA_CHANNELS)
@@ -117,45 +147,56 @@ void set_edma_params(int channel, u32 so
 	MCF_EDMA_TCD_BITER(channel)=MCF_EDMA_TCD_BITER_BITER(biter);
 	MCF_EDMA_TCD_DOFF(channel) = MCF_EDMA_TCD_DOFF_DOFF(doff);
 	MCF_EDMA_TCD_DLAST_SGA(channel) = MCF_EDMA_TCD_DLAST_SGA_DLAST_SGA(dlast_sga);
+
 	/* interrupt at the end of major loop */
-	if (major_int) {
+	if (major_int)
 		MCF_EDMA_TCD_CSR(channel) |= MCF_EDMA_TCD_CSR_INT_MAJOR;
-	} else {
+	else
 		MCF_EDMA_TCD_CSR(channel) &= ~MCF_EDMA_TCD_CSR_INT_MAJOR;
-	}
+
 	/* disable request at the end of major loop of transfer or not*/
-	if (disable_req) {
+	if (disable_req)
 		MCF_EDMA_TCD_CSR(channel) |= MCF_EDMA_TCD_CSR_D_REQ;
-	} else {
+	else
 		MCF_EDMA_TCD_CSR(channel) &= ~MCF_EDMA_TCD_CSR_D_REQ;
-	}
-
 }
 EXPORT_SYMBOL(set_edma_params);
 
-/* init eDMA controller */
+/**
+ * init_edma - Initialize the eDMA controller
+ */
 void init_edma(void)
 {
 	MCF_EDMA_CR = 0;
 }
 EXPORT_SYMBOL(init_edma);
 
-/* request eDMA channel */
+/**
+ * request_edma_channel - Request an eDMA channel
+ * @channel: channel number
+ * @handler: dma handler
+ * @error_handler: dma error handler
+ * @arg: argument to pass back
+ * @lock: optional spinlock to hold over interrupt
+ * @device_id: device id
+ *
+ * Returns 0 if success or a negative value if failure
+ */
 int request_edma_channel(int channel,
-						edma_irq_handler handler,
-						edma_error_handler error_handler,
-						void* dev,
-						spinlock_t *lock,
-						const char* device_id )
+	edma_irq_handler handler,
+	edma_error_handler error_handler,
+	void *arg,
+	spinlock_t *lock,
+	const char *device_id )
 {
 	if (devp!=NULL && channel>=0 && channel<=EDMA_CHANNELS) {
-		if (devp->dma_interrupt_handlers[channel].allocated) {
+		if (devp->dma_interrupt_handlers[channel].allocated)
 			return -EBUSY;
-		}
+
 		devp->dma_interrupt_handlers[channel].allocated = 1;
 		devp->dma_interrupt_handlers[channel].irq_handler = handler;
 		devp->dma_interrupt_handlers[channel].error_handler = error_handler;
-		devp->dma_interrupt_handlers[channel].dev = dev;
+		devp->dma_interrupt_handlers[channel].arg = arg;
 		devp->dma_interrupt_handlers[channel].lock = lock;
 		devp->dma_interrupt_handlers[channel].device_id = device_id;
 		return 0;
@@ -164,16 +205,22 @@ int request_edma_channel(int channel,
 }
 EXPORT_SYMBOL(request_edma_channel);
 
-/* free eDMA channel */
-int free_edma_channel(int channel, void* dev)
+/**
+ * free_edma_channel - Free the edma channel
+ * @channel: channel number
+ * @arg: argument created with
+ *
+ * Returns 0 if success or a negative value if failure
+ */
+int free_edma_channel(int channel, void *arg)
 {
 	if (devp!=NULL && channel>=0 && channel<=EDMA_CHANNELS) {
 		if (devp->dma_interrupt_handlers[channel].allocated) {
-			if (devp->dma_interrupt_handlers[channel].dev != dev) {
+			if (devp->dma_interrupt_handlers[channel].arg != arg)
 				return -EBUSY;
-			}
+
 			devp->dma_interrupt_handlers[channel].allocated = 0;
-			devp->dma_interrupt_handlers[channel].dev = NULL;
+			devp->dma_interrupt_handlers[channel].arg = NULL;
 			devp->dma_interrupt_handlers[channel].irq_handler = NULL;
 			devp->dma_interrupt_handlers[channel].error_handler = NULL;
 			devp->dma_interrupt_handlers[channel].lock = NULL;
@@ -184,7 +231,9 @@ int free_edma_channel(int channel, void*
 }
 EXPORT_SYMBOL(free_edma_channel);
 
-/* clean-up device driver allocated resources */
+/**
+ * coldfire_edma_cleanup - cleanup driver allocated resources
+ */
 static void coldfire_edma_cleanup(void)
 {
 	dev_t devno;
@@ -192,13 +241,10 @@ static void coldfire_edma_cleanup(void)
 
 	/* free interrupts/memory */
 	if (devp) {
-		for (i=0;i<EDMA_CHANNELS;i++)
-		{
-			MCF_INTC0_SIMR = EDMA_INT_CHANNEL_BASE+i;
-			free_irq(EDMA_INT_CHANNEL_BASE+EDMA_INT_CONTROLLER_BASE+i,	devp);
-		}
-		MCF_INTC0_SIMR = EDMA_INT_CHANNEL_BASE+EDMA_CHANNELS;
-		free_irq(EDMA_INT_CHANNEL_BASE+EDMA_INT_CONTROLLER_BASE+EDMA_CHANNELS, devp);
+		for (i=0; i<EDMA_CHANNELS; i++)
+			free_irq(EDMA_INT_BASE+i, devp);
+
+		free_irq(EDMA_INT_BASE+EDMA_INT_ERR, devp);
 		cdev_del(&devp->cdev);
 		kfree(devp);
 	}
@@ -209,30 +255,42 @@ static void coldfire_edma_cleanup(void)
 }
 
 #ifdef CONFIG_PROC_FS
-/* proc file system support */
+/*
+ * proc file system support
+ */
 
 #define FREE_CHANNEL "free"
 #define DEVICE_UNKNOWN "device unknown"
 
+/**
+ * proc_edma_show - print out proc info
+ * @m: seq_file
+ * @v:
+ */
 static int proc_edma_show(struct seq_file *m, void *v)
 {
 	int i;
 
-	if (devp==NULL) return 0;
+	if (devp == NULL)
+		return 0;
 
 	for (i = 0 ; i < EDMA_CHANNELS ; i++) {
 		if (devp->dma_interrupt_handlers[i].allocated) {
 			if (devp->dma_interrupt_handlers[i].device_id)
-		    	seq_printf(m, "%2d: %s\n", i, devp->dma_interrupt_handlers[i].device_id);
+		    		seq_printf(m, "%2d: %s\n", i, devp->dma_interrupt_handlers[i].device_id);
 			else
 				seq_printf(m, "%2d: %s\n", i, DEVICE_UNKNOWN);
-		} else {
+		} else
 			seq_printf(m, "%2d: %s\n", i, FREE_CHANNEL);
-		}
 	}
 	return 0;
 }
 
+/**
+ * proc_edma_open - open the proc file
+ * @inode: inode ptr
+ * @file: file ptr
+ */
 static int proc_edma_open(struct inode *inode, struct file *file)
 {
 	return single_open(file, proc_edma_show, NULL);
@@ -245,6 +303,9 @@ static const struct file_operations proc
 	.release	= single_release,
 };
 
+/**
+ * proc_edma_init - initialize proc filesystem
+ */
 static int __init proc_edma_init(void)
 {
 	struct proc_dir_entry *e;
@@ -258,7 +319,9 @@ static int __init proc_edma_init(void)
 
 #endif
 
-/* initializes device driver */
+/**
+ * coldfire_edma_init - eDMA module init
+ */
 static int __init coldfire_edma_init(void)
 {
 	dev_t dev;
@@ -267,8 +330,9 @@ static int __init coldfire_edma_init(voi
 
 	/* allocate free major number */
 	result = alloc_chrdev_region(&dev, DMA_DEV_MINOR, 1, EDMA_DRIVER_NAME);
-	if (result<0) {
-		printk(KERN_WARNING EDMA_DRIVER_NAME": can't get major %d\n", result);
+	if (result < 0) {
+		printk(KERN_WARNING EDMA_DRIVER_NAME": can't get major %d\n",
+		       result);
 		return result;
 	}
 	coldfire_dma_major = MAJOR(dev);
@@ -280,71 +344,68 @@ static int __init coldfire_edma_init(voi
 		goto fail;
 	}
 
-	/* init handlers (no handlers for beggining) */
-   	for (i=0;i<EDMA_CHANNELS;i++) {
+	/* init handlers (no handlers for beginning) */
+   	for (i = 0; i < EDMA_CHANNELS; i++) {
 		devp->dma_interrupt_handlers[i].irq_handler = NULL;
 		devp->dma_interrupt_handlers[i].error_handler = NULL;
-		devp->dma_interrupt_handlers[i].dev = NULL;
+		devp->dma_interrupt_handlers[i].arg = NULL;
 		devp->dma_interrupt_handlers[i].allocated = 0;
 		devp->dma_interrupt_handlers[i].lock = NULL;
 		devp->dma_interrupt_handlers[i].device_id = NULL;
 	}
 
-    /* register char device */
+	/* register char device */
 	cdev_init(&devp->cdev, &coldfire_edma_fops);
 	devp->cdev.owner = THIS_MODULE;
 	devp->cdev.ops = &coldfire_edma_fops;
 	result = cdev_add(&devp->cdev, dev, 1);
 	if (result) {
-		printk(KERN_NOTICE EDMA_DRIVER_NAME": Error %d adding coldfire-dma device\n", result);
+		printk(KERN_NOTICE EDMA_DRIVER_NAME
+		       ": Error %d adding coldfire-dma device\n", result);
 		result = -ENODEV;
 		goto fail;
 	}
 
 	/* request/enable irq for each eDMA channel */
-	for (i=0;i<EDMA_CHANNELS;i++)
-	{
-		result = request_irq(EDMA_INT_CHANNEL_BASE+EDMA_INT_CONTROLLER_BASE+i,
-			dmaisr, SA_INTERRUPT, EDMA_DRIVER_NAME, devp);
+	for (i = 0; i < EDMA_CHANNELS;i++) {
+		result = request_irq(EDMA_INT_BASE + i,
+				     dmaisr, IRQF_DISABLED,
+				     EDMA_DRIVER_NAME, devp);
 		if (result) {
-			printk(KERN_WARNING EDMA_DRIVER_NAME": Cannot request irq %d\n",
-				EDMA_INT_CHANNEL_BASE+EDMA_INT_CONTROLLER_BASE+i);
+			printk(KERN_WARNING EDMA_DRIVER_NAME
+			       ": Cannot request irq %d\n",
+			       (EDMA_INT_BASE + EDMA_INT_ERR+i));
 			result = -EBUSY;
 			goto fail;
 		}
-
-		MCF_INTC0_ICR(EDMA_INT_CHANNEL_BASE+i) = EDMA_IRQ_LEVEL;
-		MCF_INTC0_CIMR = EDMA_INT_CHANNEL_BASE+i;
-
 	}
 
-    /* request error interrupt */
-	result = request_irq(EDMA_INT_CHANNEL_BASE + EDMA_INT_CONTROLLER_BASE + EDMA_CHANNELS,
-				dma_error_isr, SA_INTERRUPT, EDMA_DRIVER_NAME, devp);
+	/* request error interrupt */
+	result = request_irq(EDMA_INT_BASE + EDMA_INT_ERR,
+			     dma_error_isr, IRQF_DISABLED,
+			     EDMA_DRIVER_NAME, devp);
 	if (result) {
-		printk(KERN_WARNING EDMA_DRIVER_NAME": Cannot request irq %d\n",
-				EDMA_INT_CHANNEL_BASE+EDMA_INT_CONTROLLER_BASE+EDMA_CHANNELS);
+		printk(KERN_WARNING EDMA_DRIVER_NAME
+		       ": Cannot request irq %d\n",
+		       (EDMA_INT_BASE + EDMA_INT_ERR));
 		result = -EBUSY;
 		goto fail;
 	}
 
-	/* enable error interrupt in interrupt controller */
-	MCF_INTC0_ICR(EDMA_INT_CHANNEL_BASE+EDMA_CHANNELS) = EDMA_IRQ_LEVEL;
-	MCF_INTC0_CIMR = EDMA_INT_CHANNEL_BASE+EDMA_CHANNELS;
-
 #ifdef CONFIG_PROC_FS
 	proc_edma_init();
 #endif
 
 	printk(EDMA_DRIVER_NAME ": initialized successfully\n");
-
 	return 0;
 fail:
 	coldfire_edma_cleanup();
 	return result;
-
 }
 
+/**
+ * coldfire_edma_exit - eDMA module exit
+ */
 static void __exit coldfire_edma_exit(void)
 {
 	coldfire_edma_cleanup();
@@ -354,5 +415,5 @@ module_init(coldfire_edma_init);
 module_exit(coldfire_edma_exit);
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Yaroslav Vinogradov, Freescale Inc.");
-MODULE_DESCRIPTION("eDMA library for Coldfire 5445x");
+MODULE_AUTHOR("Freescale Semiconductor, Inc.");
+MODULE_DESCRIPTION("eDMA library for Coldfire M5445x");
--- a/include/asm-m68k/coldfire_edma.h
+++ b/include/asm-m68k/coldfire_edma.h
@@ -20,11 +20,14 @@
 #define EDMA_DRIVER_NAME "ColdFire-eDMA"
 #define DMA_DEV_MINOR 1
 
+#ifdef CONFIG_M54455
 #define EDMA_INT_CHANNEL_BASE 		8
 #define EDMA_INT_CONTROLLER_BASE 	64
+#define EDMA_INT_BASE			(EDMA_INT_CHANNEL_BASE + \
+					 EDMA_INT_CONTROLLER_BASE)
 #define EDMA_CHANNELS			16
- 
-#define EDMA_IRQ_LEVEL			5
+#define EDMA_INT_ERR			16	/* edma error interrupt */
+#endif /* CONFIG_M54455 */
  
 typedef irqreturn_t (*edma_irq_handler)(int, void *);
 typedef void (*edma_error_handler)(int, void *);
@@ -38,7 +41,7 @@ typedef void (*edma_error_handler)(int, 
  *   nbytes  - number of bytes to be transfered in minor loop
  *   slast   - last source address adjustment
  *   citer   - major loop count
- *   biter   - beggining minor loop count
+ *   biter   - begining minor loop count
  *   doff    - destination offset
  *   dlast_sga - last destination address adjustment
  *   major_int - generate interrupt after each major loop
--- a/include/asm-m68k/mcf5445x_edma.h
+++ b/include/asm-m68k/mcf5445x_edma.h
@@ -11,11 +11,27 @@
 #ifndef __MCF5445X_EDMA_H__
 #define __MCF5445X_EDMA_H__
 
-/*********************************************************************
-*
-* Enhanced DMA (EDMA)
-*
-*********************************************************************/
+/*
+ * Enhanced DMA (EDMA)
+ */
+
+/* Channels */
+#define MCF_EDMA_CHAN_DREQ0	0	/* External DMA request 0 */
+#define MCF_EDMA_CHAN_DREQ1	1	/* External DMA request 1 */
+#define MCF_EDMA_CHAN_UART0_RX	2	/* UART0 Receive */
+#define MCF_EDMA_CHAN_UART0_TX	3	/* UART0 Transmit */
+#define MCF_EDMA_CHAN_UART1_RX	4	/* UART1 Receive */
+#define MCF_EDMA_CHAN_UART1_TX	5	/* UART1 Transmit */
+#define MCF_EDMA_CHAN_UART2_RX	6	/* UART2 Receive */
+#define MCF_EDMA_CHAN_UART2_TX	7	/* UART2 Transmit */
+#define MCF_EDMA_CHAN_TIMER0	8	/* Timer 0 / SSI0 Rx */
+#define MCF_EDMA_CHAN_TIMER1	9	/* Timer 1 / SSI1 Rx */
+#define MCF_EDMA_CHAN_TIMER2	10	/* Timer 2 / SSI0 Tx */
+#define MCF_EDMA_CHAN_TIMER3	11	/* Timer 3 / SSI1 Tx */
+#define MCF_EDMA_CHAN_DSPI_RX	12	/* DSPI Receive */
+#define MCF_EDMA_CHAN_DSPI_TX	13	/* DSPI Transmit */
+#define MCF_EDMA_CHAN_ATA_RX	14	/* ATA Receive */
+#define MCF_EDMA_CHAN_ATA_TX	15	/* ATA Transmit */
 
 /* Register read/write macros */
 #define MCF_EDMA_CR                     MCF_REG32(0xFC044000)
@@ -1453,6 +1469,4 @@
 #define MCF_EDMA_TCD15_CSR_LINKCH(x)    (((x)&0x003F)<<8)
 #define MCF_EDMA_TCD15_CSR_BWC(x)       (((x)&0x0003)<<14)
 
-/********************************************************************/
-
 #endif /* __MCF5445X_EDMA_H__ */