1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifndef __LINUX_USB_R8A66597_H
24#define __LINUX_USB_R8A66597_H
25
26#define R8A66597_PLATDATA_XTAL_12MHZ 0x01
27#define R8A66597_PLATDATA_XTAL_24MHZ 0x02
28#define R8A66597_PLATDATA_XTAL_48MHZ 0x03
29
30struct r8a66597_platdata {
31
32 void (*port_power)(int port, int power);
33
34
35 u16 buswait;
36
37
38 unsigned on_chip:1;
39
40
41 unsigned xtal:2;
42
43
44 unsigned vif:1;
45
46
47 unsigned endian:1;
48
49
50 unsigned wr0_shorted_to_wr1:1;
51
52
53 unsigned sudmac:1;
54};
55
56
57#define SYSCFG0 0x00
58#define SYSCFG1 0x02
59#define SYSSTS0 0x04
60#define SYSSTS1 0x06
61#define DVSTCTR0 0x08
62#define DVSTCTR1 0x0A
63#define TESTMODE 0x0C
64#define PINCFG 0x0E
65#define DMA0CFG 0x10
66#define DMA1CFG 0x12
67#define CFIFO 0x14
68#define D0FIFO 0x18
69#define D1FIFO 0x1C
70#define CFIFOSEL 0x20
71#define CFIFOCTR 0x22
72#define CFIFOSIE 0x24
73#define D0FIFOSEL 0x28
74#define D0FIFOCTR 0x2A
75#define D1FIFOSEL 0x2C
76#define D1FIFOCTR 0x2E
77#define INTENB0 0x30
78#define INTENB1 0x32
79#define INTENB2 0x34
80#define BRDYENB 0x36
81#define NRDYENB 0x38
82#define BEMPENB 0x3A
83#define SOFCFG 0x3C
84#define INTSTS0 0x40
85#define INTSTS1 0x42
86#define INTSTS2 0x44
87#define BRDYSTS 0x46
88#define NRDYSTS 0x48
89#define BEMPSTS 0x4A
90#define FRMNUM 0x4C
91#define UFRMNUM 0x4E
92#define USBADDR 0x50
93#define USBREQ 0x54
94#define USBVAL 0x56
95#define USBINDX 0x58
96#define USBLENG 0x5A
97#define DCPCFG 0x5C
98#define DCPMAXP 0x5E
99#define DCPCTR 0x60
100#define PIPESEL 0x64
101#define PIPECFG 0x68
102#define PIPEBUF 0x6A
103#define PIPEMAXP 0x6C
104#define PIPEPERI 0x6E
105#define PIPE1CTR 0x70
106#define PIPE2CTR 0x72
107#define PIPE3CTR 0x74
108#define PIPE4CTR 0x76
109#define PIPE5CTR 0x78
110#define PIPE6CTR 0x7A
111#define PIPE7CTR 0x7C
112#define PIPE8CTR 0x7E
113#define PIPE9CTR 0x80
114#define PIPE1TRE 0x90
115#define PIPE1TRN 0x92
116#define PIPE2TRE 0x94
117#define PIPE2TRN 0x96
118#define PIPE3TRE 0x98
119#define PIPE3TRN 0x9A
120#define PIPE4TRE 0x9C
121#define PIPE4TRN 0x9E
122#define PIPE5TRE 0xA0
123#define PIPE5TRN 0xA2
124#define DEVADD0 0xD0
125#define DEVADD1 0xD2
126#define DEVADD2 0xD4
127#define DEVADD3 0xD6
128#define DEVADD4 0xD8
129#define DEVADD5 0xDA
130#define DEVADD6 0xDC
131#define DEVADD7 0xDE
132#define DEVADD8 0xE0
133#define DEVADD9 0xE2
134#define DEVADDA 0xE4
135
136
137#define XTAL 0xC000
138#define XTAL48 0x8000
139#define XTAL24 0x4000
140#define XTAL12 0x0000
141#define XCKE 0x2000
142#define PLLC 0x0800
143#define SCKE 0x0400
144#define PCSDIS 0x0200
145#define LPSME 0x0100
146#define HSE 0x0080
147#define DCFM 0x0040
148#define DRPD 0x0020
149#define DPRPU 0x0010
150#define USBE 0x0001
151
152
153#define OVCBIT 0x8000
154#define OVCMON 0xC000
155#define SOFEA 0x0020
156#define IDMON 0x0004
157#define LNST 0x0003
158#define SE1 0x0003
159#define FS_KSTS 0x0002
160#define FS_JSTS 0x0001
161#define LS_JSTS 0x0002
162#define LS_KSTS 0x0001
163#define SE0 0x0000
164
165
166#define EXTLP0 0x0400
167#define VBOUT 0x0200
168#define WKUP 0x0100
169#define RWUPE 0x0080
170#define USBRST 0x0040
171#define RESUME 0x0020
172#define UACT 0x0010
173#define RHST 0x0007
174#define HSPROC 0x0004
175#define HSMODE 0x0003
176#define FSMODE 0x0002
177#define LSMODE 0x0001
178#define UNDECID 0x0000
179
180
181#define UTST 0x000F
182#define H_TST_PACKET 0x000C
183#define H_TST_SE0_NAK 0x000B
184#define H_TST_K 0x000A
185#define H_TST_J 0x0009
186#define H_TST_NORMAL 0x0000
187#define P_TST_PACKET 0x0004
188#define P_TST_SE0_NAK 0x0003
189#define P_TST_K 0x0002
190#define P_TST_J 0x0001
191#define P_TST_NORMAL 0x0000
192
193
194#define LDRV 0x8000
195#define VIF1 0x0000
196#define VIF3 0x8000
197#define INTA 0x0001
198
199
200#define DREQA 0x4000
201#define BURST 0x2000
202#define DACKA 0x0400
203#define DFORM 0x0380
204#define CPU_ADR_RD_WR 0x0000
205#define CPU_DACK_RD_WR 0x0100
206#define CPU_DACK_ONLY 0x0180
207#define SPLIT_DACK_ONLY 0x0200
208#define DENDA 0x0040
209#define PKTM 0x0020
210#define DENDE 0x0010
211#define OBUS 0x0004
212
213
214#define RCNT 0x8000
215#define REW 0x4000
216#define DCLRM 0x2000
217#define DREQE 0x1000
218#define MBW_8 0x0000
219#define MBW_16 0x0400
220#define MBW_32 0x0800
221#define BIGEND 0x0100
222#define BYTE_LITTLE 0x0000
223#define BYTE_BIG 0x0100
224#define ISEL 0x0020
225#define CURPIPE 0x000F
226
227
228#define BVAL 0x8000
229#define BCLR 0x4000
230#define FRDY 0x2000
231#define DTLN 0x0FFF
232
233
234#define VBSE 0x8000
235#define RSME 0x4000
236#define SOFE 0x2000
237#define DVSE 0x1000
238#define CTRE 0x0800
239#define BEMPE 0x0400
240#define NRDYE 0x0200
241#define BRDYE 0x0100
242
243
244#define OVRCRE 0x8000
245#define BCHGE 0x4000
246#define DTCHE 0x1000
247#define ATTCHE 0x0800
248#define EOFERRE 0x0040
249#define SIGNE 0x0020
250#define SACKE 0x0010
251
252
253#define BRDY9 0x0200
254#define BRDY8 0x0100
255#define BRDY7 0x0080
256#define BRDY6 0x0040
257#define BRDY5 0x0020
258#define BRDY4 0x0010
259#define BRDY3 0x0008
260#define BRDY2 0x0004
261#define BRDY1 0x0002
262#define BRDY0 0x0001
263
264
265#define NRDY9 0x0200
266#define NRDY8 0x0100
267#define NRDY7 0x0080
268#define NRDY6 0x0040
269#define NRDY5 0x0020
270#define NRDY4 0x0010
271#define NRDY3 0x0008
272#define NRDY2 0x0004
273#define NRDY1 0x0002
274#define NRDY0 0x0001
275
276
277#define BEMP9 0x0200
278#define BEMP8 0x0100
279#define BEMP7 0x0080
280#define BEMP6 0x0040
281#define BEMP5 0x0020
282#define BEMP4 0x0010
283#define BEMP3 0x0008
284#define BEMP2 0x0004
285#define BEMP1 0x0002
286#define BEMP0 0x0001
287
288
289#define TRNENSEL 0x0100
290#define BRDYM 0x0040
291#define INTL 0x0020
292#define EDGESTS 0x0010
293#define SOFMODE 0x000C
294#define SOF_125US 0x0008
295#define SOF_1MS 0x0004
296#define SOF_DISABLE 0x0000
297
298
299#define VBINT 0x8000
300#define RESM 0x4000
301#define SOFR 0x2000
302#define DVST 0x1000
303#define CTRT 0x0800
304#define BEMP 0x0400
305#define NRDY 0x0200
306#define BRDY 0x0100
307#define VBSTS 0x0080
308#define DVSQ 0x0070
309#define DS_SPD_CNFG 0x0070
310#define DS_SPD_ADDR 0x0060
311#define DS_SPD_DFLT 0x0050
312#define DS_SPD_POWR 0x0040
313#define DS_SUSP 0x0040
314#define DS_CNFG 0x0030
315#define DS_ADDS 0x0020
316#define DS_DFLT 0x0010
317#define DS_POWR 0x0000
318#define DVSQS 0x0030
319#define VALID 0x0008
320#define CTSQ 0x0007
321#define CS_SQER 0x0006
322#define CS_WRND 0x0005
323#define CS_WRSS 0x0004
324#define CS_WRDS 0x0003
325#define CS_RDSS 0x0002
326#define CS_RDDS 0x0001
327#define CS_IDST 0x0000
328
329
330#define OVRCR 0x8000
331#define BCHG 0x4000
332#define DTCH 0x1000
333#define ATTCH 0x0800
334#define EOFERR 0x0040
335#define SIGN 0x0020
336#define SACK 0x0010
337
338
339#define OVRN 0x8000
340#define CRCE 0x4000
341#define FRNM 0x07FF
342
343
344#define UFRNM 0x0007
345
346
347
348#define DEVSEL 0xF000
349#define MAXP 0x007F
350
351
352#define BSTS 0x8000
353#define SUREQ 0x4000
354#define CSCLR 0x2000
355#define CSSTS 0x1000
356#define SUREQCLR 0x0800
357#define SQCLR 0x0100
358#define SQSET 0x0080
359#define SQMON 0x0040
360#define PBUSY 0x0020
361#define PINGE 0x0010
362#define CCPL 0x0004
363#define PID 0x0003
364#define PID_STALL11 0x0003
365#define PID_STALL 0x0002
366#define PID_BUF 0x0001
367#define PID_NAK 0x0000
368
369
370#define PIPENM 0x0007
371
372
373#define R8A66597_TYP 0xC000
374#define R8A66597_ISO 0xC000
375#define R8A66597_INT 0x8000
376#define R8A66597_BULK 0x4000
377#define R8A66597_BFRE 0x0400
378#define R8A66597_DBLB 0x0200
379#define R8A66597_CNTMD 0x0100
380#define R8A66597_SHTNAK 0x0080
381#define R8A66597_DIR 0x0010
382#define R8A66597_EPNUM 0x000F
383
384
385#define BUFSIZE 0x7C00
386#define BUFNMB 0x007F
387#define PIPE0BUF 256
388#define PIPExBUF 64
389
390
391#define MXPS 0x07FF
392
393
394#define IFIS 0x1000
395#define IITV 0x0007
396
397
398#define BSTS 0x8000
399#define INBUFM 0x4000
400#define CSCLR 0x2000
401#define CSSTS 0x1000
402#define ATREPM 0x0400
403#define ACLRM 0x0200
404#define SQCLR 0x0100
405#define SQSET 0x0080
406#define SQMON 0x0040
407#define PBUSY 0x0020
408#define PID 0x0003
409
410
411#define TRENB 0x0200
412#define TRCLR 0x0100
413
414
415#define TRNCNT 0xFFFF
416
417
418#define UPPHUB 0x7800
419#define HUBPORT 0x0700
420#define USBSPD 0x00C0
421#define RTPORT 0x0001
422
423
424#define CH0CFG 0x00
425#define CH1CFG 0x04
426#define CH0BA 0x10
427#define CH1BA 0x14
428#define CH0BBC 0x18
429#define CH1BBC 0x1C
430#define CH0CA 0x20
431#define CH1CA 0x24
432#define CH0CBC 0x28
433#define CH1CBC 0x2C
434#define CH0DEN 0x30
435#define CH1DEN 0x34
436#define DSTSCLR 0x38
437#define DBUFCTRL 0x3C
438#define DINTCTRL 0x40
439#define DINTSTS 0x44
440#define DINTSTSCLR 0x48
441#define CH0SHCTRL 0x50
442#define CH1SHCTRL 0x54
443
444
445#define SENDBUFM 0x1000
446#define RCVENDM 0x0100
447#define LBA_WAIT 0x0030
448
449
450#define DEN 0x0001
451
452
453#define CH1STCLR 0x0002
454#define CH0STCLR 0x0001
455
456
457#define CH1BUFW 0x0200
458#define CH0BUFW 0x0100
459#define CH1BUFS 0x0002
460#define CH0BUFS 0x0001
461
462
463#define CH1ERRE 0x0200
464#define CH0ERRE 0x0100
465#define CH1ENDE 0x0002
466#define CH0ENDE 0x0001
467
468
469#define CH1ERRS 0x0200
470#define CH0ERRS 0x0100
471#define CH1ENDS 0x0002
472#define CH0ENDS 0x0001
473
474
475#define CH1ERRC 0x0200
476#define CH0ERRC 0x0100
477#define CH1ENDC 0x0002
478#define CH0ENDC 0x0001
479
480#endif
481
482