1 /* Coldfire C Header File
\r
2 * Copyright Freescale Semiconductor Inc
\r
3 * All rights reserved.
\r
5 * 2008/05/23 Revision: 0.95
\r
7 * (c) Copyright UNIS, a.s. 1997-2008
\r
12 * http : www.processorexpert.com
\r
13 * mail : info@processorexpert.com
\r
16 #ifndef __MCF52221_USB_OTG_H__
\r
17 #define __MCF52221_USB_OTG_H__
\r
20 /*********************************************************************
\r
22 * Universal Serial Bus - OTG Controller (USB_OTG)
\r
24 *********************************************************************/
\r
26 /* Register read/write macros */
\r
27 #define MCF_USB_OTG_PER_ID (*(vuint8 *)(0x401C0000))
\r
28 #define MCF_USB_OTG_ID_COMP (*(vuint8 *)(0x401C0004))
\r
29 #define MCF_USB_OTG_REV (*(vuint8 *)(0x401C0008))
\r
30 #define MCF_USB_OTG_ADD_INFO (*(vuint8 *)(0x401C000C))
\r
31 #define MCF_USB_OTG_OTG_INT_STAT (*(vuint8 *)(0x401C0010))
\r
32 #define MCF_USB_OTG_OTG_INT_EN (*(vuint8 *)(0x401C0014))
\r
33 #define MCF_USB_OTG_OTG_STAT (*(vuint8 *)(0x401C0018))
\r
34 #define MCF_USB_OTG_OTG_CTRL (*(vuint8 *)(0x401C001C))
\r
35 #define MCF_USB_OTG_INT_STAT (*(vuint8 *)(0x401C0080))
\r
36 #define MCF_USB_OTG_INT_ENB (*(vuint8 *)(0x401C0084))
\r
37 #define MCF_USB_OTG_ERR_STAT (*(vuint8 *)(0x401C0088))
\r
38 #define MCF_USB_OTG_ERR_ENB (*(vuint8 *)(0x401C008C))
\r
39 #define MCF_USB_OTG_STAT (*(vuint8 *)(0x401C0090))
\r
40 #define MCF_USB_OTG_CTL (*(vuint8 *)(0x401C0094))
\r
41 #define MCF_USB_OTG_ADDR (*(vuint8 *)(0x401C0098))
\r
42 #define MCF_USB_OTG_BDT_PAGE_01 (*(vuint8 *)(0x401C009C))
\r
43 #define MCF_USB_OTG_FRM_NUML (*(vuint8 *)(0x401C00A0))
\r
44 #define MCF_USB_OTG_FRM_NUMH (*(vuint8 *)(0x401C00A4))
\r
45 #define MCF_USB_OTG_TOKEN (*(vuint8 *)(0x401C00A8))
\r
46 #define MCF_USB_OTG_SOF_THLD (*(vuint8 *)(0x401C00AC))
\r
47 #define MCF_USB_OTG_BDT_PAGE_02 (*(vuint8 *)(0x401C00B0))
\r
48 #define MCF_USB_OTG_BDT_PAGE_03 (*(vuint8 *)(0x401C00B4))
\r
49 #define MCF_USB_OTG_ENDPT0 (*(vuint8 *)(0x401C00C0))
\r
50 #define MCF_USB_OTG_ENDPT1 (*(vuint8 *)(0x401C00C4))
\r
51 #define MCF_USB_OTG_ENDPT2 (*(vuint8 *)(0x401C00C8))
\r
52 #define MCF_USB_OTG_ENDPT3 (*(vuint8 *)(0x401C00CC))
\r
53 #define MCF_USB_OTG_ENDPT4 (*(vuint8 *)(0x401C00D0))
\r
54 #define MCF_USB_OTG_ENDPT5 (*(vuint8 *)(0x401C00D4))
\r
55 #define MCF_USB_OTG_ENDPT6 (*(vuint8 *)(0x401C00D8))
\r
56 #define MCF_USB_OTG_ENDPT7 (*(vuint8 *)(0x401C00DC))
\r
57 #define MCF_USB_OTG_ENDPT8 (*(vuint8 *)(0x401C00E0))
\r
58 #define MCF_USB_OTG_ENDPT9 (*(vuint8 *)(0x401C00E4))
\r
59 #define MCF_USB_OTG_ENDPT10 (*(vuint8 *)(0x401C00E8))
\r
60 #define MCF_USB_OTG_ENDPT11 (*(vuint8 *)(0x401C00EC))
\r
61 #define MCF_USB_OTG_ENDPT12 (*(vuint8 *)(0x401C00F0))
\r
62 #define MCF_USB_OTG_ENDPT13 (*(vuint8 *)(0x401C00F4))
\r
63 #define MCF_USB_OTG_ENDPT14 (*(vuint8 *)(0x401C00F8))
\r
64 #define MCF_USB_OTG_ENDPT15 (*(vuint8 *)(0x401C00FC))
\r
65 #define MCF_USB_OTG_USB_CTRL (*(vuint8 *)(0x401C0100))
\r
66 #define MCF_USB_OTG_USB_OTG_OBSERVE (*(vuint8 *)(0x401C0104))
\r
67 #define MCF_USB_OTG_USB_OTG_CONTROL (*(vuint8 *)(0x401C0108))
\r
68 #define MCF_USB_OTG_ENDPT(x) (*(vuint8 *)(0x401C00C0 + ((x)*0x4)))
\r
71 #define MCF_USB_OTG_FRM_NUM (MCF_USB_OTG_INT_STAT=MCF_USB_OTG_INT_STAT_SOF_TOK ,MCF_USB_OTG_FRM_NUML | (((vuint16)MCF_USB_OTG_FRM_NUMH)<<8))
\r
74 /* Bit definitions and macros for MCF_USB_OTG_PER_ID */
\r
75 #define MCF_USB_OTG_PER_ID_ID(x) (((x)&0x3F)<<0)
\r
77 /* Bit definitions and macros for MCF_USB_OTG_ID_COMP */
\r
78 #define MCF_USB_OTG_ID_COMP_NID(x) (((x)&0x3F)<<0)
\r
80 /* Bit definitions and macros for MCF_USB_OTG_REV */
\r
81 #define MCF_USB_OTG_REV_REV(x) (((x)&0xFF)<<0)
\r
83 /* Bit definitions and macros for MCF_USB_OTG_ADD_INFO */
\r
84 #define MCF_USB_OTG_ADD_INFO_IEHOST (0x1)
\r
85 #define MCF_USB_OTG_ADD_INFO_IRQ_NUM(x) (((x)&0x1F)<<0x3)
\r
87 /* Bit definitions and macros for MCF_USB_OTG_OTG_INT_STAT */
\r
88 #define MCF_USB_OTG_OTG_INT_STAT_A_VBUS_CHG (0x1)
\r
89 #define MCF_USB_OTG_OTG_INT_STAT_B_SESS_CHG (0x4)
\r
90 #define MCF_USB_OTG_OTG_INT_STAT_SESS_VLD_CHG (0x8)
\r
91 #define MCF_USB_OTG_OTG_INT_STAT_LINE_STATE_CHG (0x20)
\r
92 #define MCF_USB_OTG_OTG_INT_STAT_1_MSEC (0x40)
\r
93 #define MCF_USB_OTG_OTG_INT_STAT_ID_CHG (0x80)
\r
95 /* Bit definitions and macros for MCF_USB_OTG_OTG_INT_EN */
\r
96 #define MCF_USB_OTG_OTG_INT_EN_A_VBUS_EN (0x1)
\r
97 #define MCF_USB_OTG_OTG_INT_EN_B_SESS_EN (0x4)
\r
98 #define MCF_USB_OTG_OTG_INT_EN_SESS_VLD_EN (0x8)
\r
99 #define MCF_USB_OTG_OTG_INT_EN_LINE_STATE_EN (0x20)
\r
100 #define MCF_USB_OTG_OTG_INT_EN_1_MSEC_EN (0x40)
\r
101 #define MCF_USB_OTG_OTG_INT_EN_ID_EN (0x80)
\r
103 /* Bit definitions and macros for MCF_USB_OTG_OTG_STAT */
\r
104 #define MCF_USB_OTG_OTG_STAT_A_VBUS_VLD (0x1)
\r
105 #define MCF_USB_OTG_OTG_STAT_B_SESS_END (0x4)
\r
106 #define MCF_USB_OTG_OTG_STAT_SESS_VLD (0x8)
\r
107 #define MCF_USB_OTG_OTG_STAT_LINE_STATE_STABLE (0x20)
\r
108 #define MCF_USB_OTG_OTG_STAT_1_MSEC_EN (0x40)
\r
109 #define MCF_USB_OTG_OTG_STAT_ID (0x80)
\r
111 /* Bit definitions and macros for MCF_USB_OTG_OTG_CTRL */
\r
112 #define MCF_USB_OTG_OTG_CTRL_VBUS_DSCHG (0x1)
\r
113 #define MCF_USB_OTG_OTG_CTRL_VBUS_CHG (0x2)
\r
114 #define MCF_USB_OTG_OTG_CTRL_OTG_EN (0x4)
\r
115 #define MCF_USB_OTG_OTG_CTRL_VBUS_ON (0x8)
\r
116 #define MCF_USB_OTG_OTG_CTRL_DM_LOW (0x10)
\r
117 #define MCF_USB_OTG_OTG_CTRL_DP_LOW (0x20)
\r
118 #define MCF_USB_OTG_OTG_CTRL_DP_HIGH (0x80)
\r
120 /* Bit definitions and macros for MCF_USB_OTG_INT_STAT */
\r
121 #define MCF_USB_OTG_INT_STAT_USB_RST (0x1)
\r
122 #define MCF_USB_OTG_INT_STAT_ERROR (0x2)
\r
123 #define MCF_USB_OTG_INT_STAT_SOF_TOK (0x4)
\r
124 #define MCF_USB_OTG_INT_STAT_TOK_DNE (0x8)
\r
125 #define MCF_USB_OTG_INT_STAT_SLEEP (0x10)
\r
126 #define MCF_USB_OTG_INT_STAT_RESUME (0x20)
\r
127 #define MCF_USB_OTG_INT_STAT_ATTACH (0x40)
\r
128 #define MCF_USB_OTG_INT_STAT_STALL (0x80)
\r
130 /* Bit definitions and macros for MCF_USB_OTG_INT_ENB */
\r
131 #define MCF_USB_OTG_INT_ENB_USB_RST_EN (0x1)
\r
132 #define MCF_USB_OTG_INT_ENB_ERROR_EN (0x2)
\r
133 #define MCF_USB_OTG_INT_ENB_SOF_TOK_EN (0x4)
\r
134 #define MCF_USB_OTG_INT_ENB_TOK_DNE_EN (0x8)
\r
135 #define MCF_USB_OTG_INT_ENB_SLEEP_EN (0x10)
\r
136 #define MCF_USB_OTG_INT_ENB_RESUME_EN (0x20)
\r
137 #define MCF_USB_OTG_INT_ENB_ATTACH_EN (0x40)
\r
138 #define MCF_USB_OTG_INT_ENB_STALL_EN (0x80)
\r
140 /* Bit definitions and macros for MCF_USB_OTG_ERR_STAT */
\r
141 #define MCF_USB_OTG_ERR_STAT_PID_ERR (0x1)
\r
142 #define MCF_USB_OTG_ERR_STAT_CRC5_EOF (0x2)
\r
143 #define MCF_USB_OTG_ERR_STAT_CRC16 (0x4)
\r
144 #define MCF_USB_OTG_ERR_STAT_DFN8 (0x8)
\r
145 #define MCF_USB_OTG_ERR_STAT_BTO_ERR (0x10)
\r
146 #define MCF_USB_OTG_ERR_STAT_DMA_ERR (0x20)
\r
147 #define MCF_USB_OTG_ERR_STAT_BTS_ERR (0x80)
\r
149 /* Bit definitions and macros for MCF_USB_OTG_ERR_ENB */
\r
150 #define MCF_USB_OTG_ERR_ENB_PID_ERR_EN (0x1)
\r
151 #define MCF_USB_OTG_ERR_ENB_CRC5_EOF_EN (0x2)
\r
152 #define MCF_USB_OTG_ERR_ENB_CRC16_EN (0x4)
\r
153 #define MCF_USB_OTG_ERR_ENB_DFN8_EN (0x8)
\r
154 #define MCF_USB_OTG_ERR_ENB_BTO_ERR_EN (0x10)
\r
155 #define MCF_USB_OTG_ERR_ENB_DMA_ERR_EN (0x20)
\r
156 #define MCF_USB_OTG_ERR_ENB_BTS_ERR_EN (0x80)
\r
158 /* Bit definitions and macros for MCF_USB_OTG_STAT */
\r
159 #define MCF_USB_OTG_STAT_ODD (0x4)
\r
160 #define MCF_USB_OTG_STAT_TX (0x8)
\r
161 #define MCF_USB_OTG_STAT_ENDP(x) (((x)&0xF)<<0x4)
\r
163 /* Bit definitions and macros for MCF_USB_OTG_CTL */
\r
164 #define MCF_USB_OTG_CTL_USB_EN_SOF_EN (0x1)
\r
165 #define MCF_USB_OTG_CTL_ODD_RST (0x2)
\r
166 #define MCF_USB_OTG_CTL_RESUME (0x4)
\r
167 #define MCF_USB_OTG_CTL_HOST_MODE_EN (0x8)
\r
168 #define MCF_USB_OTG_CTL_RESET (0x10)
\r
169 #define MCF_USB_OTG_CTL_TXSUSPEND_TOKENBUSY (0x20)
\r
170 #define MCF_USB_OTG_CTL_SE0 (0x40)
\r
171 #define MCF_USB_OTG_CTL_JSTATE (0x80)
\r
173 /* Bit definitions and macros for MCF_USB_OTG_ADDR */
\r
174 #define MCF_USB_OTG_ADDR_ADDR(x) (((x)&0x7F)<<0)
\r
175 #define MCF_USB_OTG_ADDR_LS_EN (0x80)
\r
177 /* Bit definitions and macros for MCF_USB_OTG_BDT_PAGE_01 */
\r
178 #define MCF_USB_OTG_BDT_PAGE_01_BDT_BA9 (0x2)
\r
179 #define MCF_USB_OTG_BDT_PAGE_01_BDT_BA10 (0x4)
\r
180 #define MCF_USB_OTG_BDT_PAGE_01_BDT_BA11 (0x8)
\r
181 #define MCF_USB_OTG_BDT_PAGE_01_BDT_BA12 (0x10)
\r
182 #define MCF_USB_OTG_BDT_PAGE_01_BDT_BA13 (0x20)
\r
183 #define MCF_USB_OTG_BDT_PAGE_01_BDT_BA14 (0x40)
\r
184 #define MCF_USB_OTG_BDT_PAGE_01_BDT_BA15 (0x80)
\r
186 /* Bit definitions and macros for MCF_USB_OTG_FRM_NUML */
\r
187 #define MCF_USB_OTG_FRM_NUML_FRM0 (0x1)
\r
188 #define MCF_USB_OTG_FRM_NUML_FRM1 (0x2)
\r
189 #define MCF_USB_OTG_FRM_NUML_FRM2 (0x4)
\r
190 #define MCF_USB_OTG_FRM_NUML_FRM3 (0x8)
\r
191 #define MCF_USB_OTG_FRM_NUML_FRM4 (0x10)
\r
192 #define MCF_USB_OTG_FRM_NUML_FRM5 (0x20)
\r
193 #define MCF_USB_OTG_FRM_NUML_FRM6 (0x40)
\r
194 #define MCF_USB_OTG_FRM_NUML_FRM7 (0x80)
\r
196 /* Bit definitions and macros for MCF_USB_OTG_FRM_NUMH */
\r
197 #define MCF_USB_OTG_FRM_NUMH_FRM8 (0x1)
\r
198 #define MCF_USB_OTG_FRM_NUMH_FRM9 (0x2)
\r
199 #define MCF_USB_OTG_FRM_NUMH_FRM10 (0x4)
\r
201 /* Bit definitions and macros for MCF_USB_OTG_TOKEN */
\r
202 #define MCF_USB_OTG_TOKEN_TOKEN_ENDPT(x) (((x)&0xF)<<0)
\r
203 #define MCF_USB_OTG_TOKEN_TOKEN_PID(x) (((x)&0xF)<<0x4)
\r
204 #define MCF_USB_OTG_TOKEN_TOKEN_PID_OUT (0x10)
\r
205 #define MCF_USB_OTG_TOKEN_TOKEN_PID_IN (0x90)
\r
206 #define MCF_USB_OTG_TOKEN_TOKEN_PID_SETUP (0xD0)
\r
208 /* Bit definitions and macros for MCF_USB_OTG_SOF_THLD */
\r
209 #define MCF_USB_OTG_SOF_THLD_CNT0 (0x1)
\r
210 #define MCF_USB_OTG_SOF_THLD_CNT1 (0x2)
\r
211 #define MCF_USB_OTG_SOF_THLD_CNT2 (0x4)
\r
212 #define MCF_USB_OTG_SOF_THLD_CNT3 (0x8)
\r
213 #define MCF_USB_OTG_SOF_THLD_CNT4 (0x10)
\r
214 #define MCF_USB_OTG_SOF_THLD_CNT5 (0x20)
\r
215 #define MCF_USB_OTG_SOF_THLD_CNT6 (0x40)
\r
216 #define MCF_USB_OTG_SOF_THLD_CNT7 (0x80)
\r
218 /* Bit definitions and macros for MCF_USB_OTG_BDT_PAGE_02 */
\r
219 #define MCF_USB_OTG_BDT_PAGE_02_BDT_BA16 (0x1)
\r
220 #define MCF_USB_OTG_BDT_PAGE_02_BDT_BA17 (0x2)
\r
221 #define MCF_USB_OTG_BDT_PAGE_02_BDT_BA18 (0x4)
\r
222 #define MCF_USB_OTG_BDT_PAGE_02_BDT_BA19 (0x8)
\r
223 #define MCF_USB_OTG_BDT_PAGE_02_BDT_BA20 (0x10)
\r
224 #define MCF_USB_OTG_BDT_PAGE_02_BDT_BA21 (0x20)
\r
225 #define MCF_USB_OTG_BDT_PAGE_02_BDT_BA22 (0x40)
\r
226 #define MCF_USB_OTG_BDT_PAGE_02_BDT_BA23 (0x80)
\r
228 /* Bit definitions and macros for MCF_USB_OTG_BDT_PAGE_03 */
\r
229 #define MCF_USB_OTG_BDT_PAGE_03_BDT_BA24 (0x1)
\r
230 #define MCF_USB_OTG_BDT_PAGE_03_BDT_BA25 (0x2)
\r
231 #define MCF_USB_OTG_BDT_PAGE_03_BDT_BA26 (0x4)
\r
232 #define MCF_USB_OTG_BDT_PAGE_03_BDT_BA27 (0x8)
\r
233 #define MCF_USB_OTG_BDT_PAGE_03_BDT_BA28 (0x10)
\r
234 #define MCF_USB_OTG_BDT_PAGE_03_BDT_BA29 (0x20)
\r
235 #define MCF_USB_OTG_BDT_PAGE_03_BDT_BA30 (0x40)
\r
236 #define MCF_USB_OTG_BDT_PAGE_03_BDT_BA31 (0x80)
\r
238 /* Bit definitions and macros for MCF_USB_OTG_ENDPT */
\r
239 #define MCF_USB_OTG_ENDPT_EP_HSHK (0x1)
\r
240 #define MCF_USB_OTG_ENDPT_EP_STALL (0x2)
\r
241 #define MCF_USB_OTG_ENDPT_EP_TX_EN (0x4)
\r
242 #define MCF_USB_OTG_ENDPT_EP_RX_EN (0x8)
\r
243 #define MCF_USB_OTG_ENDPT_EP_CTL_DIS (0x10)
\r
244 #define MCF_USB_OTG_ENDPT_RETRY_DIS (0x40)
\r
245 #define MCF_USB_OTG_ENDPT_HOST_WO_HUB (0x80)
\r
247 /* Bit definitions and macros for MCF_USB_OTG_USB_CTRL */
\r
248 #define MCF_USB_OTG_USB_CTRL_CLK_SRC(x) (((x)&0x3)<<0)
\r
249 #define MCF_USB_OTG_USB_CTRL_CLK_SRC_ALTCLK (0)
\r
250 #define MCF_USB_OTG_USB_CTRL_CLK_SRC_OSCCLK (0x1)
\r
251 #define MCF_USB_OTG_USB_CTRL_CLK_SRC_SYSCLK (0x3)
\r
252 #define MCF_USB_OTG_USB_CTRL_PDE (0x40)
\r
253 #define MCF_USB_OTG_USB_CTRL_SUSP (0x80)
\r
255 /* Bit definitions and macros for MCF_USB_OTG_USB_OTG_OBSERVE */
\r
256 #define MCF_USB_OTG_USB_OTG_OBSERVE_VBUSDIS (0x2)
\r
257 #define MCF_USB_OTG_USB_OTG_OBSERVE_VBUSCHG (0x4)
\r
258 #define MCF_USB_OTG_USB_OTG_OBSERVE_VBUSE (0x8)
\r
259 #define MCF_USB_OTG_USB_OTG_OBSERVE_DM_PD (0x10)
\r
260 #define MCF_USB_OTG_USB_OTG_OBSERVE_DP_PD (0x40)
\r
261 #define MCF_USB_OTG_USB_OTG_OBSERVE_DP_PU (0x80)
\r
263 /* Bit definitions and macros for MCF_USB_OTG_USB_OTG_CONTROL */
\r
264 #define MCF_USB_OTG_USB_OTG_CONTROL_SESSEND (0x1)
\r
265 #define MCF_USB_OTG_USB_OTG_CONTROL_SESSVLD (0x2)
\r
266 #define MCF_USB_OTG_USB_OTG_CONTROL_VBUSVLD (0x4)
\r
267 #define MCF_USB_OTG_USB_OTG_CONTROL_ID (0x8)
\r
268 #define MCF_USB_OTG_USB_OTG_CONTROL_VBUSD (0x10)
\r
271 #endif /* __MCF52221_USB_OTG_H__ */
\r