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