1
2 #ifndef _ASM_ARCH_PXA27X_UDC_H
3 #define _ASM_ARCH_PXA27X_UDC_H
4
5 #ifdef _ASM_ARCH_PXA25X_UDC_H
6 #error You cannot include both PXA25x and PXA27x UDC support
7 #endif
8
9 #define UDCCR __REG(0x40600000)
10 #define UDCCR_OEN (1 << 31)
11 #define UDCCR_AALTHNP (1 << 30)
12
13 #define UDCCR_AHNP (1 << 29)
14
15 #define UDCCR_BHNP (1 << 28)
16
17 #define UDCCR_DWRE (1 << 16)
18 #define UDCCR_ACN (0x03 << 11)
19 #define UDCCR_ACN_S 11
20 #define UDCCR_AIN (0x07 << 8)
21 #define UDCCR_AIN_S 8
22 #define UDCCR_AAISN (0x07 << 5)
23
24 #define UDCCR_AAISN_S 5
25 #define UDCCR_SMAC (1 << 4)
26
27 #define UDCCR_EMCE (1 << 3)
28
29 #define UDCCR_UDR (1 << 2)
30 #define UDCCR_UDA (1 << 1)
31 #define UDCCR_UDE (1 << 0)
32
33 #define UDCICR0 __REG(0x40600004)
34 #define UDCICR1 __REG(0x40600008)
35 #define UDCICR_FIFOERR (1 << 1)
36 #define UDCICR_PKTCOMPL (1 << 0)
37
38 #define UDC_INT_FIFOERROR (0x2)
39 #define UDC_INT_PACKETCMP (0x1)
40
41 #define UDCICR_INT(n,intr) (((intr) & 0x03) << (((n) & 0x0F) * 2))
42 #define UDCICR1_IECC (1 << 31)
43 #define UDCICR1_IESOF (1 << 30)
44 #define UDCICR1_IERU (1 << 29)
45 #define UDCICR1_IESU (1 << 28)
46 #define UDCICR1_IERS (1 << 27)
47
48 #define UDCISR0 __REG(0x4060000C)
49 #define UDCISR1 __REG(0x40600010)
50 #define UDCISR_INT(n,intr) (((intr) & 0x03) << (((n) & 0x0F) * 2))
51 #define UDCISR1_IRCC (1 << 31)
52 #define UDCISR1_IRSOF (1 << 30)
53 #define UDCISR1_IRRU (1 << 29)
54 #define UDCISR1_IRSU (1 << 28)
55 #define UDCISR1_IRRS (1 << 27)
56
57 #define UDCFNR __REG(0x40600014)
58 #define UDCOTGICR __REG(0x40600018)
59 #define UDCOTGICR_IESF (1 << 24)
60 #define UDCOTGICR_IEXR (1 << 17)
61
62 #define UDCOTGICR_IEXF (1 << 16)
63
64 #define UDCOTGICR_IEVV40R (1 << 9)
65
66 #define UDCOTGICR_IEVV40F (1 << 8)
67
68 #define UDCOTGICR_IEVV44R (1 << 7)
69
70 #define UDCOTGICR_IEVV44F (1 << 6)
71
72 #define UDCOTGICR_IESVR (1 << 5)
73
74 #define UDCOTGICR_IESVF (1 << 4)
75
76 #define UDCOTGICR_IESDR (1 << 3)
77
78 #define UDCOTGICR_IESDF (1 << 2)
79
80 #define UDCOTGICR_IEIDR (1 << 1)
81
82 #define UDCOTGICR_IEIDF (1 << 0)
83
84
85 #define UP2OCR __REG(0x40600020)
86 #define UP3OCR __REG(0x40600024)
87
88 #define UP2OCR_CPVEN (1 << 0)
89 #define UP2OCR_CPVPE (1 << 1)
90 #define UP2OCR_DPPDE (1 << 2)
91 #define UP2OCR_DMPDE (1 << 3)
92 #define UP2OCR_DPPUE (1 << 4)
93 #define UP2OCR_DMPUE (1 << 5)
94 #define UP2OCR_DPPUBE (1 << 6)
95 #define UP2OCR_DMPUBE (1 << 7)
96 #define UP2OCR_EXSP (1 << 8)
97 #define UP2OCR_EXSUS (1 << 9)
98 #define UP2OCR_IDON (1 << 10)
99 #define UP2OCR_HXS (1 << 16)
100 #define UP2OCR_HXOE (1 << 17)
101 #define UP2OCR_SEOS(x) ((x & 7) << 24)
102
103 #define UDCCSN(x) __REG2(0x40600100, (x) << 2)
104 #define UDCCSR0 __REG(0x40600100)
105 #define UDCCSR0_SA (1 << 7)
106 #define UDCCSR0_RNE (1 << 6)
107 #define UDCCSR0_FST (1 << 5)
108 #define UDCCSR0_SST (1 << 4)
109 #define UDCCSR0_DME (1 << 3)
110 #define UDCCSR0_FTF (1 << 2)
111 #define UDCCSR0_IPR (1 << 1)
112 #define UDCCSR0_OPC (1 << 0)
113
114 #define UDCCSRA __REG(0x40600104)
115 #define UDCCSRB __REG(0x40600108)
116 #define UDCCSRC __REG(0x4060010C)
117 #define UDCCSRD __REG(0x40600110)
118 #define UDCCSRE __REG(0x40600114)
119 #define UDCCSRF __REG(0x40600118)
120 #define UDCCSRG __REG(0x4060011C)
121 #define UDCCSRH __REG(0x40600120)
122 #define UDCCSRI __REG(0x40600124)
123 #define UDCCSRJ __REG(0x40600128)
124 #define UDCCSRK __REG(0x4060012C)
125 #define UDCCSRL __REG(0x40600130)
126 #define UDCCSRM __REG(0x40600134)
127 #define UDCCSRN __REG(0x40600138)
128 #define UDCCSRP __REG(0x4060013C)
129 #define UDCCSRQ __REG(0x40600140)
130 #define UDCCSRR __REG(0x40600144)
131 #define UDCCSRS __REG(0x40600148)
132 #define UDCCSRT __REG(0x4060014C)
133 #define UDCCSRU __REG(0x40600150)
134 #define UDCCSRV __REG(0x40600154)
135 #define UDCCSRW __REG(0x40600158)
136 #define UDCCSRX __REG(0x4060015C)
137
138 #define UDCCSR_DPE (1 << 9)
139 #define UDCCSR_FEF (1 << 8)
140 #define UDCCSR_SP (1 << 7)
141 #define UDCCSR_BNE (1 << 6)
142 #define UDCCSR_BNF (1 << 6)
143 #define UDCCSR_FST (1 << 5)
144 #define UDCCSR_SST (1 << 4)
145 #define UDCCSR_DME (1 << 3)
146 #define UDCCSR_TRN (1 << 2)
147 #define UDCCSR_PC (1 << 1)
148 #define UDCCSR_FS (1 << 0)
149
150 #define UDCBCN(x) __REG2(0x40600200, (x)<<2)
151 #define UDCBCR0 __REG(0x40600200)
152 #define UDCBCRA __REG(0x40600204)
153 #define UDCBCRB __REG(0x40600208)
154 #define UDCBCRC __REG(0x4060020C)
155 #define UDCBCRD __REG(0x40600210)
156 #define UDCBCRE __REG(0x40600214)
157 #define UDCBCRF __REG(0x40600218)
158 #define UDCBCRG __REG(0x4060021C)
159 #define UDCBCRH __REG(0x40600220)
160 #define UDCBCRI __REG(0x40600224)
161 #define UDCBCRJ __REG(0x40600228)
162 #define UDCBCRK __REG(0x4060022C)
163 #define UDCBCRL __REG(0x40600230)
164 #define UDCBCRM __REG(0x40600234)
165 #define UDCBCRN __REG(0x40600238)
166 #define UDCBCRP __REG(0x4060023C)
167 #define UDCBCRQ __REG(0x40600240)
168 #define UDCBCRR __REG(0x40600244)
169 #define UDCBCRS __REG(0x40600248)
170 #define UDCBCRT __REG(0x4060024C)
171 #define UDCBCRU __REG(0x40600250)
172 #define UDCBCRV __REG(0x40600254)
173 #define UDCBCRW __REG(0x40600258)
174 #define UDCBCRX __REG(0x4060025C)
175
176 #define UDCDN(x) __REG2(0x40600300, (x)<<2)
177 #define PHYS_UDCDN(x) (0x40600300 + ((x)<<2))
178 #define PUDCDN(x) (volatile u32 *)(io_p2v(PHYS_UDCDN((x))))
179 #define UDCDR0 __REG(0x40600300)
180 #define UDCDRA __REG(0x40600304)
181 #define UDCDRB __REG(0x40600308)
182 #define UDCDRC __REG(0x4060030C)
183 #define UDCDRD __REG(0x40600310)
184 #define UDCDRE __REG(0x40600314)
185 #define UDCDRF __REG(0x40600318)
186 #define UDCDRG __REG(0x4060031C)
187 #define UDCDRH __REG(0x40600320)
188 #define UDCDRI __REG(0x40600324)
189 #define UDCDRJ __REG(0x40600328)
190 #define UDCDRK __REG(0x4060032C)
191 #define UDCDRL __REG(0x40600330)
192 #define UDCDRM __REG(0x40600334)
193 #define UDCDRN __REG(0x40600338)
194 #define UDCDRP __REG(0x4060033C)
195 #define UDCDRQ __REG(0x40600340)
196 #define UDCDRR __REG(0x40600344)
197 #define UDCDRS __REG(0x40600348)
198 #define UDCDRT __REG(0x4060034C)
199 #define UDCDRU __REG(0x40600350)
200 #define UDCDRV __REG(0x40600354)
201 #define UDCDRW __REG(0x40600358)
202 #define UDCDRX __REG(0x4060035C)
203
204 #define UDCCN(x) __REG2(0x40600400, (x)<<2)
205 #define UDCCRA __REG(0x40600404)
206 #define UDCCRB __REG(0x40600408)
207 #define UDCCRC __REG(0x4060040C)
208 #define UDCCRD __REG(0x40600410)
209 #define UDCCRE __REG(0x40600414)
210 #define UDCCRF __REG(0x40600418)
211 #define UDCCRG __REG(0x4060041C)
212 #define UDCCRH __REG(0x40600420)
213 #define UDCCRI __REG(0x40600424)
214 #define UDCCRJ __REG(0x40600428)
215 #define UDCCRK __REG(0x4060042C)
216 #define UDCCRL __REG(0x40600430)
217 #define UDCCRM __REG(0x40600434)
218 #define UDCCRN __REG(0x40600438)
219 #define UDCCRP __REG(0x4060043C)
220 #define UDCCRQ __REG(0x40600440)
221 #define UDCCRR __REG(0x40600444)
222 #define UDCCRS __REG(0x40600448)
223 #define UDCCRT __REG(0x4060044C)
224 #define UDCCRU __REG(0x40600450)
225 #define UDCCRV __REG(0x40600454)
226 #define UDCCRW __REG(0x40600458)
227 #define UDCCRX __REG(0x4060045C)
228
229 #define UDCCONR_CN (0x03 << 25)
230 #define UDCCONR_CN_S (25)
231 #define UDCCONR_IN (0x07 << 22)
232 #define UDCCONR_IN_S (22)
233 #define UDCCONR_AISN (0x07 << 19)
234 #define UDCCONR_AISN_S (19)
235 #define UDCCONR_EN (0x0f << 15)
236 #define UDCCONR_EN_S (15)
237 #define UDCCONR_ET (0x03 << 13)
238 #define UDCCONR_ET_S (13)
239 #define UDCCONR_ET_INT (0x03 << 13)
240 #define UDCCONR_ET_BULK (0x02 << 13)
241 #define UDCCONR_ET_ISO (0x01 << 13)
242 #define UDCCONR_ET_NU (0x00 << 13)
243 #define UDCCONR_ED (1 << 12)
244 #define UDCCONR_MPS (0x3ff << 2)
245 #define UDCCONR_MPS_S (2)
246 #define UDCCONR_DE (1 << 1)
247 #define UDCCONR_EE (1 << 0)
248
249
250 #define UDC_INT_FIFOERROR (0x2)
251 #define UDC_INT_PACKETCMP (0x1)
252
253 #define UDC_FNR_MASK (0x7ff)
254
255 #define UDCCSR_WR_MASK (UDCCSR_DME|UDCCSR_FST)
256 #define UDC_BCR_MASK (0x3ff)
257
258 #endif