1 /* Coldfire C Header File
2 * Copyright Freescale Semiconductor Inc
5 * 2008/05/23 Revision: 0.95
7 * (c) Copyright UNIS, a.s. 1997-2008
12 * http : www.processorexpert.com
13 * mail : info@processorexpert.com
16 #ifndef __MCF52221_DMA_H__
17 #define __MCF52221_DMA_H__
20 /*********************************************************************
22 * DMA Controller (DMA)
24 *********************************************************************/
26 /* Register read/write macros */
27 #define MCF_DMA0_SAR (*(vuint32*)(0x40000100))
28 #define MCF_DMA0_DAR (*(vuint32*)(0x40000104))
29 #define MCF_DMA0_DSR (*(vuint8 *)(0x40000108))
30 #define MCF_DMA0_BCR (*(vuint32*)(0x40000108))
31 #define MCF_DMA0_DCR (*(vuint32*)(0x4000010C))
33 #define MCF_DMA1_SAR (*(vuint32*)(0x40000110))
34 #define MCF_DMA1_DAR (*(vuint32*)(0x40000114))
35 #define MCF_DMA1_DSR (*(vuint8 *)(0x40000118))
36 #define MCF_DMA1_BCR (*(vuint32*)(0x40000118))
37 #define MCF_DMA1_DCR (*(vuint32*)(0x4000011C))
39 #define MCF_DMA2_SAR (*(vuint32*)(0x40000120))
40 #define MCF_DMA2_DAR (*(vuint32*)(0x40000124))
41 #define MCF_DMA2_DSR (*(vuint8 *)(0x40000128))
42 #define MCF_DMA2_BCR (*(vuint32*)(0x40000128))
43 #define MCF_DMA2_DCR (*(vuint32*)(0x4000012C))
45 #define MCF_DMA3_SAR (*(vuint32*)(0x40000130))
46 #define MCF_DMA3_DAR (*(vuint32*)(0x40000134))
47 #define MCF_DMA3_DSR (*(vuint8 *)(0x40000138))
48 #define MCF_DMA3_BCR (*(vuint32*)(0x40000138))
49 #define MCF_DMA3_DCR (*(vuint32*)(0x4000013C))
51 #define MCF_DMA_SAR(x) (*(vuint32*)(0x40000100 + ((x)*0x10)))
52 #define MCF_DMA_DAR(x) (*(vuint32*)(0x40000104 + ((x)*0x10)))
53 #define MCF_DMA_DSR(x) (*(vuint8 *)(0x40000108 + ((x)*0x10)))
54 #define MCF_DMA_BCR(x) (*(vuint32*)(0x40000108 + ((x)*0x10)))
55 #define MCF_DMA_DCR(x) (*(vuint32*)(0x4000010C + ((x)*0x10)))
58 /* Bit definitions and macros for MCF_DMA_SAR */
59 #define MCF_DMA_SAR_SAR(x) (((x)&0xFFFFFFFF)<<0)
61 /* Bit definitions and macros for MCF_DMA_DAR */
62 #define MCF_DMA_DAR_DAR(x) (((x)&0xFFFFFFFF)<<0)
64 /* Bit definitions and macros for MCF_DMA_DSR */
65 #define MCF_DMA_DSR_DONE (0x1)
66 #define MCF_DMA_DSR_BSY (0x2)
67 #define MCF_DMA_DSR_REQ (0x4)
68 #define MCF_DMA_DSR_BED (0x10)
69 #define MCF_DMA_DSR_BES (0x20)
70 #define MCF_DMA_DSR_CE (0x40)
72 /* Bit definitions and macros for MCF_DMA_BCR */
73 #define MCF_DMA_BCR_BCR(x) (((x)&0xFFFFFF)<<0)
74 #define MCF_DMA_BCR_DSR(x) (((x)&0xFF)<<0x18)
76 /* Bit definitions and macros for MCF_DMA_DCR */
77 #define MCF_DMA_DCR_LCH2(x) (((x)&0x3)<<0)
78 #define MCF_DMA_DCR_LCH2_CH0 (0)
79 #define MCF_DMA_DCR_LCH2_CH1 (0x1)
80 #define MCF_DMA_DCR_LCH2_CH2 (0x2)
81 #define MCF_DMA_DCR_LCH2_CH3 (0x3)
82 #define MCF_DMA_DCR_LCH1(x) (((x)&0x3)<<0x2)
83 #define MCF_DMA_DCR_LCH1_CH0 (0)
84 #define MCF_DMA_DCR_LCH1_CH1 (0x1)
85 #define MCF_DMA_DCR_LCH1_CH2 (0x2)
86 #define MCF_DMA_DCR_LCH1_CH3 (0x3)
87 #define MCF_DMA_DCR_LINKCC(x) (((x)&0x3)<<0x4)
88 #define MCF_DMA_DCR_D_REQ (0x80)
89 #define MCF_DMA_DCR_DMOD(x) (((x)&0xF)<<0x8)
90 #define MCF_DMA_DCR_DMOD_DIS (0)
91 #define MCF_DMA_DCR_DMOD_16 (0x1)
92 #define MCF_DMA_DCR_DMOD_32 (0x2)
93 #define MCF_DMA_DCR_DMOD_64 (0x3)
94 #define MCF_DMA_DCR_DMOD_128 (0x4)
95 #define MCF_DMA_DCR_DMOD_256 (0x5)
96 #define MCF_DMA_DCR_DMOD_512 (0x6)
97 #define MCF_DMA_DCR_DMOD_1K (0x7)
98 #define MCF_DMA_DCR_DMOD_2K (0x8)
99 #define MCF_DMA_DCR_DMOD_4K (0x9)
100 #define MCF_DMA_DCR_DMOD_8K (0xA)
101 #define MCF_DMA_DCR_DMOD_16K (0xB)
102 #define MCF_DMA_DCR_DMOD_32K (0xC)
103 #define MCF_DMA_DCR_DMOD_64K (0xD)
104 #define MCF_DMA_DCR_DMOD_128K (0xE)
105 #define MCF_DMA_DCR_DMOD_256K (0xF)
106 #define MCF_DMA_DCR_SMOD(x) (((x)&0xF)<<0xC)
107 #define MCF_DMA_DCR_SMOD_DIS (0)
108 #define MCF_DMA_DCR_SMOD_16 (0x1)
109 #define MCF_DMA_DCR_SMOD_32 (0x2)
110 #define MCF_DMA_DCR_SMOD_64 (0x3)
111 #define MCF_DMA_DCR_SMOD_128 (0x4)
112 #define MCF_DMA_DCR_SMOD_256 (0x5)
113 #define MCF_DMA_DCR_SMOD_512 (0x6)
114 #define MCF_DMA_DCR_SMOD_1K (0x7)
115 #define MCF_DMA_DCR_SMOD_2K (0x8)
116 #define MCF_DMA_DCR_SMOD_4K (0x9)
117 #define MCF_DMA_DCR_SMOD_8K (0xA)
118 #define MCF_DMA_DCR_SMOD_16K (0xB)
119 #define MCF_DMA_DCR_SMOD_32K (0xC)
120 #define MCF_DMA_DCR_SMOD_64K (0xD)
121 #define MCF_DMA_DCR_SMOD_128K (0xE)
122 #define MCF_DMA_DCR_SMOD_256K (0xF)
123 #define MCF_DMA_DCR_START (0x10000)
124 #define MCF_DMA_DCR_DSIZE(x) (((x)&0x3)<<0x11)
125 #define MCF_DMA_DCR_DSIZE_LONG (0)
126 #define MCF_DMA_DCR_DSIZE_BYTE (0x1)
127 #define MCF_DMA_DCR_DSIZE_WORD (0x2)
128 #define MCF_DMA_DCR_DSIZE_LINE (0x3)
129 #define MCF_DMA_DCR_DINC (0x80000)
130 #define MCF_DMA_DCR_SSIZE(x) (((x)&0x3)<<0x14)
131 #define MCF_DMA_DCR_SSIZE_LONG (0)
132 #define MCF_DMA_DCR_SSIZE_BYTE (0x1)
133 #define MCF_DMA_DCR_SSIZE_WORD (0x2)
134 #define MCF_DMA_DCR_SSIZE_LINE (0x3)
135 #define MCF_DMA_DCR_SINC (0x400000)
136 #define MCF_DMA_DCR_BWC(x) (((x)&0x7)<<0x19)
137 #define MCF_DMA_DCR_BWC_16K (0x1)
138 #define MCF_DMA_DCR_BWC_32K (0x2)
139 #define MCF_DMA_DCR_BWC_64K (0x3)
140 #define MCF_DMA_DCR_BWC_128K (0x4)
141 #define MCF_DMA_DCR_BWC_256K (0x5)
142 #define MCF_DMA_DCR_BWC_512K (0x6)
143 #define MCF_DMA_DCR_BWC_1024K (0x7)
144 #define MCF_DMA_DCR_AA (0x10000000)
145 #define MCF_DMA_DCR_CS (0x20000000)
146 #define MCF_DMA_DCR_EEXT (0x40000000)
147 #define MCF_DMA_DCR_INT (0x80000000)
150 #endif /* __MCF52221_DMA_H__ */