1 |
199 |
simons |
/****************************************************************************/
|
2 |
|
|
|
3 |
|
|
/*
|
4 |
|
|
* mcfdma.h -- Coldfire internal DMA support defines.
|
5 |
|
|
*
|
6 |
|
|
* (C) Copyright 1999, Rob Scott (rscott@mtrob.ml.org)
|
7 |
|
|
*/
|
8 |
|
|
|
9 |
|
|
/****************************************************************************/
|
10 |
|
|
#ifndef mcfdma_h
|
11 |
|
|
#define mcfdma_h
|
12 |
|
|
/****************************************************************************/
|
13 |
|
|
|
14 |
|
|
#include <linux/config.h>
|
15 |
|
|
|
16 |
|
|
/*
|
17 |
|
|
* Get address specific defines for this Coldfire member.
|
18 |
|
|
*/
|
19 |
|
|
#if defined(CONFIG_M5206) || defined(CONFIG_M5206e)
|
20 |
|
|
#define MCFDMA_BASE0 0x200 /* Base address of DMA 0 */
|
21 |
|
|
#define MCFDMA_BASE1 0x240 /* Base address of DMA 1 */
|
22 |
|
|
#elif defined(CONFIG_M5307)
|
23 |
|
|
#define MCFDMA_BASE0 0x300 /* Base address of DMA 0 */
|
24 |
|
|
#define MCFDMA_BASE1 0x340 /* Base address of DMA 1 */
|
25 |
|
|
#define MCFDMA_BASE2 0x380 /* Base address of DMA 2 */
|
26 |
|
|
#define MCFDMA_BASE3 0x3C0 /* Base address of DMA 3 */
|
27 |
|
|
#endif
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
/*
|
31 |
|
|
* Define the DMA register set addresses.
|
32 |
|
|
* Note: these are longword registers, use unsigned long as data type
|
33 |
|
|
*/
|
34 |
|
|
#define MCFDMA_SAR 0x00 /* DMA source address (r/w) */
|
35 |
|
|
#define MCFDMA_DAR 0x01 /* DMA destination adr (r/w) */
|
36 |
|
|
/* these are word registers, use unsigned short data type */
|
37 |
|
|
#define MCFDMA_DCR 0x04 /* DMA control reg (r/w) */
|
38 |
|
|
#define MCFDMA_BCR 0x06 /* DMA byte count reg (r/w) */
|
39 |
|
|
/* these are byte registers, use unsiged char data type */
|
40 |
|
|
#define MCFDMA_DSR 0x10 /* DMA status reg (r/w) */
|
41 |
|
|
#define MCFDMA_DIVR 0x14 /* DMA interrupt vec (r/w) */
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
/*
|
46 |
|
|
* Bit definitions for the DMA Control Register (DCR).
|
47 |
|
|
*/
|
48 |
|
|
#define MCFDMA_DCR_INT 0x8000 /* Enable completion irq */
|
49 |
|
|
#define MCFDMA_DCR_EEXT 0x4000 /* Enable external DMA req */
|
50 |
|
|
#define MCFDMA_DCR_CS 0x2000 /* Enable cycle steal */
|
51 |
|
|
#define MCFDMA_DCR_AA 0x1000 /* Enable auto alignment */
|
52 |
|
|
#define MCFDMA_DCR_BWC_MASK 0x0E00 /* Bandwidth ctl mask */
|
53 |
|
|
#define MCFDMA_DCR_BWC_512 0x0200 /* Bandwidth: 512 Bytes */
|
54 |
|
|
#define MCFDMA_DCR_BWC_1024 0x0400 /* Bandwidth: 1024 Bytes */
|
55 |
|
|
#define MCFDMA_DCR_BWC_2048 0x0600 /* Bandwidth: 2048 Bytes */
|
56 |
|
|
#define MCFDMA_DCR_BWC_4096 0x0800 /* Bandwidth: 4096 Bytes */
|
57 |
|
|
#define MCFDMA_DCR_BWC_8192 0x0a00 /* Bandwidth: 8192 Bytes */
|
58 |
|
|
#define MCFDMA_DCR_BWC_16384 0x0c00 /* Bandwidth: 16384 Bytes */
|
59 |
|
|
#define MCFDMA_DCR_BWC_32768 0x0e00 /* Bandwidth: 32768 Bytes */
|
60 |
|
|
#define MCFDMA_DCR_SAA 0x0100 /* Single Address Access */
|
61 |
|
|
#define MCFDMA_DCR_S_RW 0x0080 /* SAA read/write value */
|
62 |
|
|
#define MCFDMA_DCR_SINC 0x0040 /* Source addr inc enable */
|
63 |
|
|
#define MCFDMA_DCR_SSIZE_MASK 0x0030 /* Src xfer size */
|
64 |
|
|
#define MCFDMA_DCR_SSIZE_LONG 0x0000 /* Src xfer size, 00 = longw */
|
65 |
|
|
#define MCFDMA_DCR_SSIZE_BYTE 0x0010 /* Src xfer size, 01 = byte */
|
66 |
|
|
#define MCFDMA_DCR_SSIZE_WORD 0x0020 /* Src xfer size, 10 = word */
|
67 |
|
|
#define MCFDMA_DCR_SSIZE_LINE 0x0030 /* Src xfer size, 11 = line */
|
68 |
|
|
#define MCFDMA_DCR_DINC 0x0008 /* Dest addr inc enable */
|
69 |
|
|
#define MCFDMA_DCR_DSIZE_MASK 0x0006 /* Dest xfer size */
|
70 |
|
|
#define MCFDMA_DCR_DSIZE_LONG 0x0000 /* Dest xfer size, 00 = long */
|
71 |
|
|
#define MCFDMA_DCR_DSIZE_BYTE 0x0002 /* Dest xfer size, 01 = byte */
|
72 |
|
|
#define MCFDMA_DCR_DSIZE_WORD 0x0004 /* Dest xfer size, 10 = word */
|
73 |
|
|
#define MCFDMA_DCR_DSIZE_LINE 0x0006 /* Dest xfer size, 11 = line */
|
74 |
|
|
#define MCFDMA_DCR_START 0x0001 /* Start transfer */
|
75 |
|
|
|
76 |
|
|
/*
|
77 |
|
|
* Bit definitions for the DMA Status Register (DSR).
|
78 |
|
|
*/
|
79 |
|
|
#define MCFDMA_DSR_CE 0x40 /* Config error */
|
80 |
|
|
#define MCFDMA_DSR_BES 0x20 /* Bus Error on source */
|
81 |
|
|
#define MCFDMA_DSR_BED 0x10 /* Bus Error on dest */
|
82 |
|
|
#define MCFDMA_DSR_REQ 0x04 /* Requests remaining */
|
83 |
|
|
#define MCFDMA_DSR_BSY 0x02 /* Busy */
|
84 |
|
|
#define MCFDMA_DSR_DONE 0x01 /* DMA transfer complete */
|
85 |
|
|
|
86 |
|
|
/****************************************************************************/
|
87 |
|
|
#endif /* mcfdma_h */
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|