1 /******************************************************************************
2 ** File Name: usb20_v3_reg.h *
3 ** Author: Daniel.Ding *
5 ** Copyright: 2005 Spreatrum, Incoporated. All Rights Reserved. *
7 ******************************************************************************/
8 /******************************************************************************
10 **---------------------------------------------------------------------------*
11 ** DATE NAME DESCRIPTION *
12 ** 11/13/2005 Daniel.Ding Create. *
13 ******************************************************************************/
14 #ifndef _USB20_V3_REG_H_
15 #define _USB20_V3_REG_H_
16 /*----------------------------------------------------------------------------*
18 **------------------------------------------------------------------------- */
20 /**---------------------------------------------------------------------------*
22 **--------------------------------------------------------------------------*/
27 /**---------------------------------------------------------------------------*
29 **---------------------------------------------------------------------------*/
31 #define USB_REG_BASE 0x20200000 //(0x20300000)
33 #define _LITTLE_ENDIAN
38 //**************** Core Global CSR ***************************
39 #define USB_GOTGCTL (USB_REG_BASE + 0x0000)
40 #define USB_GOTGINT (USB_REG_BASE + 0x0004)
41 #define USB_GAHBCFG (USB_REG_BASE + 0x0008)
42 #define USB_GUSBCFG (USB_REG_BASE + 0x000c)
43 #define USB_GRSTCTL (USB_REG_BASE + 0x0010)
44 #define USB_GINTSTS (USB_REG_BASE + 0x0014)
45 #define USB_GINTMSK (USB_REG_BASE + 0x0018)
46 #define USB_GRXSTSR (USB_REG_BASE + 0x001c)
47 #define USB_GRXSTSP (USB_REG_BASE + 0x0020)
48 #define USB_GRXFSIZ (USB_REG_BASE + 0x0024)
49 #define USB_GNPTXFSIZ (USB_REG_BASE + 0x0028)
50 #define USB_GNPTXSTS (USB_REG_BASE + 0x002c)
51 #define USB_GI2CCTL (USB_REG_BASE + 0x0030)
52 #define USB_GPVNDCTL (USB_REG_BASE + 0x0034)
53 #define USB_GGPIO (USB_REG_BASE + 0x0038)
54 #define USB_GUID (USB_REG_BASE + 0x003c)
55 #define USB_GSNPSID (USB_REG_BASE + 0x0040)
56 #define USB_GHWCFG1 (USB_REG_BASE + 0x0044)
57 #define USB_GHWCFG2 (USB_REG_BASE + 0x0048)
58 #define USB_GHWCFG3 (USB_REG_BASE + 0x004c)
59 #define USB_GHWCFG4 (USB_REG_BASE + 0x0050)
60 #define USB_GLPMCFG (USB_REG_BASE + 0x0054)
61 #define USB_HPTXFSIZ (USB_REG_BASE + 0x0100)
62 #define USB_DPTXFSIZ(n) (USB_REG_BASE + 0x0104+(n-1)*0x04) // n(1-15)
63 #define USB_DIEPTXF(n) (USB_REG_BASE + 0x0104+(n-1)*0x04) // n(1-15)
65 //**************** Power and Clock geting CSR ****************
66 #define USB_PCGCR (USB_REG_BASE + 0x0E00)
68 //**************** Device CSR *********************************
69 #define USB_DCFG (USB_REG_BASE + 0x0800)
70 #define USB_DCTL (USB_REG_BASE + 0x0804)
71 #define USB_DSTS (USB_REG_BASE + 0x0808)
72 #define USB_DIEPMSK (USB_REG_BASE + 0x0810)
73 #define USB_DOEPMSK (USB_REG_BASE + 0x0814)
74 #define USB_DAINT (USB_REG_BASE + 0x0818)
75 #define USB_DAINTMSK (USB_REG_BASE + 0x081c)
76 #define USB_DTKNQR1 (USB_REG_BASE + 0x0820)
77 #define USB_DTKNQR2 (USB_REG_BASE + 0x0824)
78 #define USB_DTKNQR3 (USB_REG_BASE + 0x0830)
79 #define USB_DTKNQR4 (USB_REG_BASE + 0x0834)
80 #define USB_DVBUSDIS (USB_REG_BASE + 0x0828)
81 #define USB_DVBUSPULSE (USB_REG_BASE + 0x082c)
82 #define USB_DTHRCTL (USB_REG_BASE + 0x0830)
83 #define USB_DIEPEMPMSK (USB_REG_BASE + 0x0834)
84 #define USB_DEACHINT (USB_REG_BASE + 0x0838)
85 #define USB_DEACHINTMSK (USB_REG_BASE + 0x083c)
86 #define USB_DIACHINTMSK(n) (USB_REG_BASE + 0x0840+n*0x04) // n(0-15)
87 #define USB_DOACHINTMSK(n) (USB_REG_BASE + 0x0880+n*0x04) // n(0-15)
88 #define USB_DIEP0CTL (USB_REG_BASE + 0x0900)
89 #define USB_DIEPCTL(n) (USB_REG_BASE + 0x0900+n*0x20) // n(1-15)
90 #define USB_DIEPINT(n) (USB_REG_BASE + 0x0908+n*0x20) // n(0-15)
91 #define USB_DIEP0TSIZ (USB_REG_BASE + 0x0910)
92 #define USB_DIEPTSIZ(n) (USB_REG_BASE + 0x0910+n*0x20) // n(1-15)
93 #define USB_DIEPDMA(n) (USB_REG_BASE + 0x0914+n*0x20) // n(0-15)
94 #define USB_DTXFSTS(n) (USB_REG_BASE + 0x0918+n*0x20) // n(0-15)
95 #define USB_DIEPDMAB(n) (USB_REG_BASE + 0x091c+n*0x20) // n(0-15)
96 #define USB_DOEP0CTL (USB_REG_BASE + 0x0b00)
97 #define USB_DOEPCTL(n) (USB_REG_BASE + 0x0b00+n*0x20) // n(1-15)
98 #define USB_DOEPINT(n) (USB_REG_BASE + 0x0b08+n*0x20) // n(0-15)
99 #define USB_DOEP0TSIZ (USB_REG_BASE + 0x0b10)
100 #define USB_DOEPTSIZ(n) (USB_REG_BASE + 0x0b10+n*0x20) // n(1-15)
101 #define USB_DOEPDMA(n) (USB_REG_BASE + 0x0b14+n*0x20) // n(0-15)
102 #define USB_DOEPDMAB(n) (USB_REG_BASE + 0x0b1c+n*0x20) // n(0-15)
103 #ifdef MODEM_CONTROL_SUPPORT_USB
104 #define USB_PCGCCTL (USB_REG_BASE + 0xE00)
108 //**************** Device EP FIFO base address *********************************
110 #define USB_DEPFIFOBA(n) (USB_REG_BASE + (n+1)*0x1000) // n(0-15)
111 #define USB_CTRL_END 0x203FFFFF
112 #define USB_CLK_12M 12000000
113 #define USB_CLK_48M 48000000
118 #define USB_INTERFACE 1
119 #define USB_ENDPOINT 2
120 #define USB_RECIPIENT_OTHER 3
122 #define ENPOINT_HALT 0
124 #define USB_CONNECTTED 0
125 #define USB_POWERED 1
126 #define USB_DEFAULT 2
127 #define USB_ADDRESSED 3
128 #define USB_CONFIGED 4
131 #define USB_EP_DIR_OUT 1
132 #define USB_EP_DIR_IN 0
135 #define USB_PACKET_16 0x10
136 #define USB_PACKET_32 0x20
137 #define USB_PACKET_64 0x40
138 #define USB_PACKET_128 0x80
139 #define USB_PACKET_256 0x100
140 #define USB_PACKET_512 0x200
141 #define USB_PACKET_1024 0x400
148 USB_EP_TYPE_CONTROL = 0,
151 USB_EP_TYPE_INTERRUPT ,
179 #define USB_INT_SOF (BIT_0)
180 #define USB_INT_SPEND (BIT_1)
181 #define USB_INT_RESUM (BIT_2)
182 #define USB_INT_RST (BIT_3)
183 #define USB_INT_UNPID (BIT_4)
184 #define USB_INT_EPID (BIT_5)
185 #define USB_INT_CHANGE (BIT_6)
186 #define USB_INT_DEVICE (BIT_7)
187 #define USB_INT_EP0 (BIT_8)
188 #define USB_INT_EP1 (BIT_9)
189 #define USB_INT_EP2 (BIT_10)
190 #define USB_INT_EP3 (BIT_11)
191 #define USB_INT_EP4 (BIT_12)
194 /**----------------------------------------------------------------------------*
196 **----------------------------------------------------------------------------*/
198 //************************** Core Global Register Prototype *******************/
200 typedef union usb_gahbcfg_tag
202 struct usb_gahbcfg_map
204 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
206 volatile unsigned int reserved_2 :23;
207 volatile unsigned int ptxfemplvl :1; //periodic_txfifo_empty_level
208 volatile unsigned int nptxfemplvl :1; //non_periodic_txfifo_empty_level
209 volatile unsigned int reserved_1 :1;
210 volatile unsigned int dma_enable :1; //dma_enable
211 volatile unsigned int burst_length :4; //burst_length
212 volatile unsigned int global_int_mask :1; //global_interrupt_mask
214 volatile unsigned int global_int_mask :1; //global_interrupt_mask
215 volatile unsigned int burst_length :4; //burst_length
216 volatile unsigned int dma_enable :1; //dma_enable
217 volatile unsigned int reserved_1 :1;
218 volatile unsigned int nptxfemplvl :1; //non_periodic_txfifo_empty_level
219 volatile unsigned int ptxfemplvl :1; //periodic_txfifo_empty_level
220 volatile unsigned int reserved_2 :23;
223 volatile unsigned int dwValue ;
226 typedef union usb_gusbcfg_tag
228 struct usb_gusbcfg_map
230 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
231 volatile unsigned int corrupt_tx_packet :1; //Corrupt TX packet
232 volatile unsigned int force_dev_mod :1; //Force device mode
233 volatile unsigned int force_hst_mod :1; //Force host mode
234 volatile unsigned int tx_end_delay :1; //TX end delay
235 volatile unsigned int ic_usb_tri :1; //IC USB Tranfic Pull Remove Control
236 volatile unsigned int ic_usb_cap :1; //IC USB capable
237 volatile unsigned int reserved_3 :3;
238 volatile unsigned int temseldlpulse :1; //Termsel Dline PUlsing Sleection
239 volatile unsigned int reserved_2 :2;
240 volatile unsigned int ulpiclksusm :1; //ULPI clock suspendM
241 volatile unsigned int ulpiautores :1; //ULPI auto resume
242 volatile unsigned int ulpifsls :1; //ULPI FS/LS select
243 volatile unsigned int otgi2csel :1; //UTMIFS or I2C interface select
244 volatile unsigned int phylpwrclksel :1; //PHY low power clock select
245 volatile unsigned int reserved_1 :1;
246 volatile unsigned int usbtrdtim :4; //USB turnaroud time
247 volatile unsigned int hnpcap :1; //HNP capable
248 volatile unsigned int srpcap :1; //SRP capable
249 volatile unsigned int ddrsel :1; //ULPI DDR select
250 volatile unsigned int physel :1; //USB 2.0 high speed PHY or USB 1.1 FULL speed serial transceiver select
251 volatile unsigned int fsintf :1; //FULL speed serial interface select
252 volatile unsigned int ulpiutmisel :1; //ULPI or UTMI+ select
253 volatile unsigned int phyintf :1; //PHY interface
254 volatile unsigned int toutcal :3; //HS/FS time out calibration
256 volatile unsigned int toutcal :3; //HS/FS time out calibration
257 volatile unsigned int phyintf :1; //PHY interface
258 volatile unsigned int ulpiutmisel :1; //ULPI or UTMI+ select
259 volatile unsigned int fsintf :1; //FULL speed serial interface select
260 volatile unsigned int physel :1; //USB 2.0 high speed PHY or USB 1.1 FULL speed serial transceiver select
261 volatile unsigned int ddrsel :1; //ULPI DDR select
262 volatile unsigned int srpcap :1; //SRP capable
263 volatile unsigned int hnpcap :1; //HNP capable
264 volatile unsigned int usbtrdtim :4; //USB turnaroud time
265 volatile unsigned int reserved_1 :1;
266 volatile unsigned int phylpwrclksel :1; //PHY low power clock select
267 volatile unsigned int otgi2csel :1; //UTMIFS or I2C interface select
268 volatile unsigned int ulpifsls :1; //ULPI FS/LS select
269 volatile unsigned int ulpiautores :1; //ULPI auto resume
270 volatile unsigned int ulpiclksusm :1; //ULPI clock suspendM
271 volatile unsigned int reserved_2 :2;
272 volatile unsigned int temseldlpulse :1; //Termsel Dline PUlsing Sleection
273 volatile unsigned int reserved_3 :3;
274 volatile unsigned int ic_usb_cap :1; //IC USB capable
275 volatile unsigned int ic_usb_tri :1; //IC USB Tranfic Pull Remove Control
276 volatile unsigned int tx_end_delay :1; //TX end delay
277 volatile unsigned int force_hst_mod :1; //Force host mode
278 volatile unsigned int force_dev_mod :1; //Force device mode
279 volatile unsigned int corrupt_tx_packet :1; //Corrupt TX packet
282 volatile unsigned int dwValue ;
285 typedef union usb_grstctl_tag
287 struct usb_grstctl_map
289 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
290 volatile unsigned int ahbidle :1; //AHB Master idle
291 volatile unsigned int dmareq :1; //DMA request signal
292 volatile unsigned int reserved :19;
293 volatile unsigned int txfnum :5; //TX fifo number
294 volatile unsigned int txfflush :1; //TX fifo flush
295 volatile unsigned int rxfflush :1; //RX fifo flush
296 volatile unsigned int intknqflsh :1; //in token sequence learning queue flush
297 volatile unsigned int frmcntrrst :1; //host frame counter reset
298 volatile unsigned int fsftrst :1; //Hclock soft reset
299 volatile unsigned int csftrst :1; //Core soft reset
301 volatile unsigned int csftrst :1; //Core soft reset
302 volatile unsigned int fsftrst :1; //Hclock soft reset
303 volatile unsigned int frmcntrrst :1; //host frame counter reset
304 volatile unsigned int intknqflsh :1; //in token sequence learning queue flush
305 volatile unsigned int rxfflush :1; //RX fifo flush
306 volatile unsigned int txfflush :1; //TX fifo flush
307 volatile unsigned int txfnum :5; //TX fifo number
308 volatile unsigned int reserved :19;
309 volatile unsigned int dmareq :1; //DMA request signal
310 volatile unsigned int ahbidle :1; //AHB Master idle
313 volatile unsigned int dwValue ;
316 typedef union usb_gintsts_tag
318 struct usb_gintsts_map
320 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
321 volatile unsigned int wkupint :1; //resume/remote wakeup dedected interrupt
322 volatile unsigned int sessreqint :1; //session request
323 volatile unsigned int reserved_3 :1;
324 volatile unsigned int conidstschng :1; //connecter id status change interupt
325 volatile unsigned int lpmint :1; //LPM tranction received interrupt
326 volatile unsigned int reserved_2 :3;
327 volatile unsigned int resetdet :1; //reset detected interrupt
328 volatile unsigned int fetsusp :1; //data fetch suspend
329 volatile unsigned int incomip :1; //incompleteperiodic transfer
330 volatile unsigned int incomplsoin :1; //incomplete iso in transfer
331 volatile unsigned int oepint :1; //out endpoint interrupt
332 volatile unsigned int iepint :1; //in endpoint interrupt
333 volatile unsigned int epmis :1; //endpoint mismatch interrupt
334 volatile unsigned int reserved_1 :1;
335 volatile unsigned int eopf :1; //end of periodic frame interrupt
336 volatile unsigned int isooutdrop :1; //iso out packet dropped interrupt
337 volatile unsigned int enumdone :1; //enumeration done
338 volatile unsigned int usbrst :1; //usb reset
339 volatile unsigned int usbsusp :1; //usb suspend
340 volatile unsigned int erlususp :1; //early suspend
341 volatile unsigned int i2cint :1; //I2C interrupt
342 volatile unsigned int ulpickint :1; //ULPI carkit interrupt
343 volatile unsigned int goutnakeff :1; //global out nak effective
344 volatile unsigned int ginnakeff :1; //global in nak effective
345 volatile unsigned int nptxfemp :1; //non periodic nak effective
346 volatile unsigned int rxflvl :1; //RX fifo non empty
347 volatile unsigned int sof :1; //start of frame
348 volatile unsigned int otgint :1; //otg interrupt
349 volatile unsigned int modemis :1; //mode mismatch interrupt
350 volatile unsigned int curmod :1; //current mode of opration
352 volatile unsigned int curmod :1; //current mode of opration
353 volatile unsigned int modemis :1; //mode mismatch interrupt
354 volatile unsigned int otgint :1; //otg interrupt
355 volatile unsigned int sof :1; //start of frame
356 volatile unsigned int rxflvl :1; //RX fifo non empty
357 volatile unsigned int nptxfemp :1; //non periodic nak effective
358 volatile unsigned int ginnakeff :1; //global in nak effective
359 volatile unsigned int goutnakeff :1; //global out nak effective
360 volatile unsigned int ulpickint :1; //ULPI carkit interrupt
361 volatile unsigned int i2cint :1; //I2C interrupt
362 volatile unsigned int erlususp :1; //early suspend
363 volatile unsigned int usbsusp :1; //usb suspend
364 volatile unsigned int usbrst :1; //usb reset
365 volatile unsigned int enumdone :1; //enumeration done
366 volatile unsigned int isooutdrop :1; //iso out packet dropped interrupt
367 volatile unsigned int eopf :1; //end of periodic frame interrupt
368 volatile unsigned int reserved_1 :1;
369 volatile unsigned int epmis :1; //endpoint mismatch interrupt
370 volatile unsigned int iepint :1; //in endpoint interrupt
371 volatile unsigned int oepint :1; //out endpoint interrupt
372 volatile unsigned int incomplsoin :1; //incomplete iso in transfer
373 volatile unsigned int incomip :1; //incompleteperiodic transfer
374 volatile unsigned int fetsusp :1; //data fetch suspend
375 volatile unsigned int resetdet :1; //reset detected interrupt
376 volatile unsigned int reserved_2 :3;
377 volatile unsigned int lpmint :1; //LPM tranction received interrupt
378 volatile unsigned int conidstschng :1; //connecter id status change interupt
379 volatile unsigned int reserved_3 :1;
380 volatile unsigned int sessreqint :1; //session request
381 volatile unsigned int wkupint :1; //resume/remote wakeup dedected interrupt
385 volatile unsigned int dwValue ;
388 typedef union usb_gintmsk_tag
390 struct usb_gintmsk_map
392 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
393 volatile unsigned int wkupintmsk :1; //resume/remote wakeup dedected interrupt
394 volatile unsigned int sessreqintmsk :1; //session request
395 volatile unsigned int disconintmsk :1; // disconnect detected interrupt mask
396 volatile unsigned int conidstschngmsk :1; //connecter id status change interupt
397 volatile unsigned int lpmintmsk :1; //LPM tranction received interrupt
398 volatile unsigned int reserved_3 :3;
399 volatile unsigned int resetdetmsk :1; //reset detected interrupt
400 volatile unsigned int fetsuspmsk :1; //data fetch suspend
401 volatile unsigned int incomipmsk :1; //data fetch suspend
402 volatile unsigned int incomplsoinmsk :1; //incomplete iso in transfer,incompleteperiodic transfer
403 volatile unsigned int oepintmsk :1; //out endpoint interrupt
404 volatile unsigned int iepintmsk :1; //in endpoint interrupt
405 volatile unsigned int epmismsk :1; //endpoint mismatch interrupt
406 volatile unsigned int reserved_2 :1;
407 volatile unsigned int eopfmsk :1; //end of periodic frame interrupt
408 volatile unsigned int isooutdropmsk :1; //iso out packet dropped interrupt
409 volatile unsigned int enumdonemsk :1; //enumeration done
410 volatile unsigned int usbrstmsk :1; //usb reset
411 volatile unsigned int usbsuspmsk :1; //usb suspend
412 volatile unsigned int erlususpmsk :1; //early suspend
413 volatile unsigned int i2cintmsk :1; //I2C interrupt
414 volatile unsigned int ulpickintmsk :1; //ULPI carkit interrupt
415 volatile unsigned int goutnakeffmsk :1; //global out nak effective
416 volatile unsigned int ginnakeffmsk :1; //global in nak effective
417 volatile unsigned int nptxfempmsk :1; //non periodic nak effective
418 volatile unsigned int rxflvlmsk :1; //RX fifo non empty
419 volatile unsigned int sofmsk :1; //start of frame
420 volatile unsigned int otgintmsk :1; //otg interrupt
421 volatile unsigned int modemismsk :1; //mode mismatch interrupt
422 volatile unsigned int reserved_1 :1;
424 volatile unsigned int reserved_1 :1;
425 volatile unsigned int modemismsk :1; //mode mismatch interrupt
426 volatile unsigned int otgintmsk :1; //otg interrupt
427 volatile unsigned int sofmsk :1; //start of frame
428 volatile unsigned int rxflvlmsk :1; //RX fifo non empty
429 volatile unsigned int nptxfempmsk :1; //non periodic nak effective
430 volatile unsigned int ginnakeffmsk :1; //global in nak effective
431 volatile unsigned int goutnakeffmsk :1; //global out nak effective
432 volatile unsigned int ulpickintmsk :1; //ULPI carkit interrupt
433 volatile unsigned int i2cintmsk :1; //I2C interrupt
434 volatile unsigned int erlususpmsk :1; //early suspend
435 volatile unsigned int usbsuspmsk :1; //usb suspend
436 volatile unsigned int usbrstmsk :1; //usb reset
437 volatile unsigned int enumdonemsk :1; //enumeration done
438 volatile unsigned int isooutdropmsk :1; //iso out packet dropped interrupt
439 volatile unsigned int eopfmsk :1; //end of periodic frame interrupt
440 volatile unsigned int reserved_2 :1;
441 volatile unsigned int epmismsk :1; //endpoint mismatch interrupt
442 volatile unsigned int iepintmsk :1; //in endpoint interrupt
443 volatile unsigned int oepintmsk :1; //out endpoint interrupt
444 volatile unsigned int incomplsoinmsk :1; //incomplete iso in transfer,incompleteperiodic transfer
445 volatile unsigned int incomipmsk :1; //data fetch suspend
446 volatile unsigned int fetsuspmsk :1; //data fetch suspend
447 volatile unsigned int resetdetmsk :1; //reset detected interrupt
448 volatile unsigned int reserved_3 :3;
449 volatile unsigned int lpmintmsk :1; //LPM tranction received interrupt
450 volatile unsigned int conidstschngmsk :1; //connecter id status change interupt
451 volatile unsigned int disconintmsk :1; // disconnect detected interrupt mask
452 volatile unsigned int sessreqintmsk :1; //session request
453 volatile unsigned int wkupintmsk :1; //resume/remote wakeup dedected interrupt
457 volatile unsigned int dwValue ;
460 typedef union usb_grxstsp_tag
462 struct usb_grxstsp_map
464 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
465 volatile unsigned int reserved :7;
466 volatile unsigned int frame_number :4; //frame nummber
467 volatile unsigned int packet_status :4; //packet status
468 volatile unsigned int data_pid :2; //data PID
469 volatile unsigned int byte_count :11; //byte count
470 volatile unsigned int endpoint_number :4; //endpoint nummber
472 volatile unsigned int endpoint_number :4; //endpoint nummber
473 volatile unsigned int byte_count :11; //byte count
474 volatile unsigned int data_pid :2; //data PID
475 volatile unsigned int packet_status :4; //packet status
476 volatile unsigned int frame_number :4; //frame nummber
477 volatile unsigned int reserved :7;
481 volatile unsigned int dwValue ;
484 typedef union usb_grxstsr_tag
486 struct usb_grxstsr_map
488 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
489 volatile unsigned int reserved :7;
490 volatile unsigned int frame_number :4; //frame nummber
491 volatile unsigned int packet_status :4; //packet status
492 volatile unsigned int data_pid :2; //data PID
493 volatile unsigned int byte_count :11; //byte count
494 volatile unsigned int endpoint_number :4; //endpoint nummber
496 volatile unsigned int endpoint_number :4; //endpoint nummber
497 volatile unsigned int byte_count :11; //byte count
498 volatile unsigned int data_pid :2; //data PID
499 volatile unsigned int packet_status :4; //packet status
500 volatile unsigned int frame_number :4; //frame nummber
501 volatile unsigned int reserved :7;
505 volatile unsigned int dwValue ;
508 typedef union usb_grxfsiz_tag
510 struct usbgrxfsiz__map
512 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
513 volatile unsigned int reserved :16;
514 volatile unsigned int rxfdep :16; //RX fifo deepth
516 volatile unsigned int rxfdep :16; //RX fifo deepth
517 volatile unsigned int reserved :16;
520 volatile unsigned int dwValue ;
523 typedef union usb_gnptxfsiz_tag
525 struct usb_gnptxfsiz_map
527 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
528 volatile unsigned int nptxfdep :16; //non periodic TX fifo deepth
529 volatile unsigned int nptxfstaddr :16; //non periodic transmit ram start address
531 volatile unsigned int nptxfstaddr :16; //non periodic transmit ram start address
532 volatile unsigned int nptxfdep :16; //non periodic TX fifo deepth
537 volatile unsigned int dwValue ;
540 typedef union usb_gnptxsts_tag
542 struct usb_gnptxsts_map
544 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
545 volatile unsigned int reserved :1;
546 volatile unsigned int nptxqtop :7; //top of non periodic transmit request queue
547 volatile unsigned int nptxqspcavail :8; //non periodic transmit request queue space available
548 volatile unsigned int nptxfsavail :16; //non periodic tx fifo space available
550 volatile unsigned int nptxfsavail :16; //non periodic tx fifo space available
551 volatile unsigned int nptxqspcavail :8; //non periodic transmit request queue space available
552 volatile unsigned int nptxqtop :7; //top of non periodic transmit request queue
553 volatile unsigned int reserved :1;
557 volatile unsigned int dwValue ;
560 typedef union usb_ggpio_tag
564 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
565 volatile unsigned int gpo :16; //general purpose output
566 volatile unsigned int gpi :16; //general purpose input
568 volatile unsigned int gpi :16; //general purpose input
569 volatile unsigned int gpo :16; //general purpose output
572 volatile unsigned int dwValue ;
575 typedef union usb_ghwcfg1_tag
577 struct usb_ghwcfg1_map
579 volatile unsigned int epfir :32; //endpoint dirction
581 volatile unsigned int dwValue ;
584 typedef union usb_ghwcfg2_tag
586 struct usb_ghwcfg2_map
588 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
589 volatile unsigned int reserved_2 :1;
590 volatile unsigned int tknqdepth :5; //device mode in taken sequence learning queue depth
591 volatile unsigned int ptxqdepth :2; //host mode periodic request queue deepth
592 volatile unsigned int nptxqdepth :2; //non periodic request queue deepth
593 volatile unsigned int reserved_1 :1;
594 volatile unsigned int multiprocintprt :1; //multi processor interrupt enable
595 volatile unsigned int dynfifosizing :1; //dynamic fifo size enable
596 volatile unsigned int periodicsupport :1; //periodic out channels support in host mode
597 volatile unsigned int numhstchnl :4; //nummber of host channel
598 volatile unsigned int numdeveps :4; //nummber of device endpoint
599 volatile unsigned int fsphytype :2; //FS PHY interface type
600 volatile unsigned int hsphytype :2; //HS PHY interface type
601 volatile unsigned int singpnt :1; //point to point
602 volatile unsigned int architechure :2; //architechure
603 volatile unsigned int otgmode :3; //mode of opration
605 volatile unsigned int otgmode :3; //mode of opration
606 volatile unsigned int architechure :2; //architechure
607 volatile unsigned int singpnt :1; //point to point
608 volatile unsigned int hsphytype :2; //HS PHY interface type
609 volatile unsigned int fsphytype :2; //FS PHY interface type
610 volatile unsigned int numdeveps :4; //nummber of device endpoint
611 volatile unsigned int numhstchnl :4; //nummber of host channel
612 volatile unsigned int periodicsupport :1; //periodic out channels support in host mode
613 volatile unsigned int dynfifosizing :1; //dynamic fifo size enable
614 volatile unsigned int multiprocintprt :1; //multi processor interrupt enable
615 volatile unsigned int reserved_1 :1;
616 volatile unsigned int nptxqdepth :2; //non periodic request queue deepth
617 volatile unsigned int ptxqdepth :2; //host mode periodic request queue deepth
618 volatile unsigned int tknqdepth :5; //device mode in taken sequence learning queue depth
619 volatile unsigned int reserved_2 :1;
623 volatile unsigned int dwValue ;
626 typedef union usb_ghwcfg3_tag
628 struct usb_ghwcfg3_map
630 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
631 volatile unsigned int dfifodepth :16; // D FIFO depth
632 volatile unsigned int otgenablelpm :1; //
633 volatile unsigned int reserved :1; //
634 volatile unsigned int othenablehsic :1; //
635 volatile unsigned int otgenableicusb :1; //
636 volatile unsigned int rsttype :1; //
637 volatile unsigned int optfeature :1; //
638 volatile unsigned int vndctlsupt :1; //
639 volatile unsigned int i2cselect :1; //
640 volatile unsigned int otgen :1; //
641 volatile unsigned int pktsizewidth :3; //width of packet size counter
642 volatile unsigned int xfersizewidth :4; //width of transfer size counter
644 volatile unsigned int xfersizewidth :4; //width of transfer size counter
645 volatile unsigned int pktsizewidth :3; //width of packet size counter
646 volatile unsigned int otgen :1; //
647 volatile unsigned int i2cselect :1; //
648 volatile unsigned int vndctlsupt :1; //
649 volatile unsigned int optfeature :1; //
650 volatile unsigned int rsttype :1; //
651 volatile unsigned int otgenableicusb :1; //
652 volatile unsigned int othenablehsic :1; //
653 volatile unsigned int reserved :1; //
654 volatile unsigned int otgenablelpm :1; //
655 volatile unsigned int dfifodepth :16; // D FIFO depth
659 volatile unsigned int dwValue ;
662 typedef union usb_ghwcfg4_tag
664 struct usb_ghwcfg4_map
666 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
667 volatile unsigned int sgdma :1;
668 volatile unsigned int sgdmac :1;
669 volatile unsigned int ineps :4; //nummber of decice mode in endpoint include control endpoint
670 volatile unsigned int dedfifomod :1;
671 volatile unsigned int sessendfltr :1;
672 volatile unsigned int bvalidfltr :1;
673 volatile unsigned int avalidfltr :1;
674 volatile unsigned int vbusvalidfltr :1;
675 volatile unsigned int iddgfltr :1;
676 volatile unsigned int numctleps :4; //nummber of device mode control endpoint in addition to endpoint 0
677 volatile unsigned int phydatawidth :2; //UTMI+ PHY/ULPI to internal UTMI+ Wrapper data width
678 volatile unsigned int reserved :8;
679 volatile unsigned int ahbfreq :1; //minimum ahb frequency less then 60MHz
680 volatile unsigned int enablepwropt :1; //enable power optimization
681 volatile unsigned int numdevperioeps :4; //nummber of device mode periodic in endpoint
683 volatile unsigned int numdevperioeps :4; //nummber of device mode periodic in endpoint
684 volatile unsigned int enablepwropt :1; //enable power optimization
685 volatile unsigned int ahbfreq :1; //minimum ahb frequency less then 60MHz
686 volatile unsigned int reserved :8;
687 volatile unsigned int phydatawidth :2; //UTMI+ PHY/ULPI to internal UTMI+ Wrapper data width
688 volatile unsigned int numctleps :4; //nummber of device mode control endpoint in addition to endpoint 0
689 volatile unsigned int iddgfltr :1;
690 volatile unsigned int vbusvalidfltr :1;
691 volatile unsigned int avalidfltr :1;
692 volatile unsigned int bvalidfltr :1;
693 volatile unsigned int sessendfltr :1;
694 volatile unsigned int dedfifomod :1;
695 volatile unsigned int ineps :4; //nummber of decice mode in endpoint include control endpoint
696 volatile unsigned int sgdmac :1;
697 volatile unsigned int sgdma :1;
701 volatile unsigned int dwValue ;
704 typedef union usb_dptxfsiz_tag
706 struct usb_dptxfsiz_map
708 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
709 volatile unsigned int dptxfsize :16; //device periodic TX fifo size
710 volatile unsigned int dptxfstraddr :16; //device periodic TX fifo ram start address
712 volatile unsigned int dptxfstraddr :16; //device periodic TX fifo ram start address
713 volatile unsigned int dptxfsize :16; //device periodic TX fifo size
717 volatile unsigned int dwValue ;
720 typedef union usb_dieptxf_tag
722 struct usb_dieptxf_map
724 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
725 volatile unsigned int ineptxfsize :16; //in endpoint TX fifo depth
726 volatile unsigned int ineptxfstraddr :16; //in endpoint fifo transmit ram start address
728 volatile unsigned int ineptxfstraddr :16; //in endpoint fifo transmit ram start address
729 volatile unsigned int ineptxfsize :16; //in endpoint TX fifo depth
732 volatile unsigned int dwValue ;
736 /*********************Device Register Prototype****************/
738 typedef union usb_dcfg_tag
742 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
744 volatile unsigned int reserved_2 :6;
745 volatile unsigned int perschintvl :2;
746 volatile unsigned int descdma :1;
747 volatile unsigned int inepmiscnt :5; //in endpoint mismatch count
748 volatile unsigned int reserved :5;
749 volatile unsigned int perfrint :2; //periodic frame interval
750 volatile unsigned int devaddr :7; //device address
751 volatile unsigned int reserved_1 :1;
752 volatile unsigned int nzstsouthshk :1; //non zero length status out handshake
753 volatile unsigned int devspeed :2; //device speed
755 volatile unsigned int devspeed :2; //device speed
756 volatile unsigned int nzstsouthshk :1; //non zero length status out handshake
757 volatile unsigned int reserved_1 :1;
758 volatile unsigned int devaddr :7; //device address
759 volatile unsigned int perfrint :2; //periodic frame interval
760 volatile unsigned int reserved :5;
761 volatile unsigned int inepmiscnt :5; //in endpoint mismatch count
762 volatile unsigned int descdma :1;
763 volatile unsigned int perschintvl :2;
764 volatile unsigned int reserved_2 :6;
768 volatile unsigned int dwValue ;
771 typedef union usb_dctl_tag
775 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
776 volatile unsigned int reserved_2 :15;
777 volatile unsigned int setnak :1; //
778 volatile unsigned int ignrfrmnum :1; //
779 volatile unsigned int gmc :2; //global muti count
780 volatile unsigned int reserved_1 :1;
781 volatile unsigned int pwronprgdone :1; //power on programing done
782 volatile unsigned int cgoutnak :1; //clear out nak
783 volatile unsigned int sgoutnak :1; //set out nak
784 volatile unsigned int cgnpinnak :1; //clear global non periodic in nak
785 volatile unsigned int sgnpinnak :1; //set global non periodic in nak
786 volatile unsigned int tstctl :3; //test control
787 volatile unsigned int goutnaksts :1; //global out nak status
788 volatile unsigned int gnpinnaksts :1; //global non periodic in nak status
789 volatile unsigned int sftdiscon :1; //soft disconect
790 volatile unsigned int rmtwkupsig :1; //remote wakeup signaling
792 volatile unsigned int rmtwkupsig :1; //remote wakeup signaling
793 volatile unsigned int sftdiscon :1; //soft disconect
794 volatile unsigned int gnpinnaksts :1; //global non periodic in nak status
795 volatile unsigned int goutnaksts :1; //global out nak status
796 volatile unsigned int tstctl :3; //test control
797 volatile unsigned int sgnpinnak :1; //set global non periodic in nak
798 volatile unsigned int cgnpinnak :1; //clear global non periodic in nak
799 volatile unsigned int sgoutnak :1; //set out nak
800 volatile unsigned int cgoutnak :1; //clear out nak
801 volatile unsigned int pwronprgdone :1; //power on programing done
802 volatile unsigned int reserved_1 :1; //power on programing done
803 volatile unsigned int gmc :2; //global muti count
804 volatile unsigned int ignrfrmnum :1; //
805 volatile unsigned int setnak :1; //
806 volatile unsigned int reserved_2 :15;
810 volatile unsigned int dwValue ;
814 typedef union usb_dsts_tag
818 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
819 volatile unsigned int reserved_2 :10;
820 volatile unsigned int soffn :14; //frame or microframe nummber of the recieved SOF
821 volatile unsigned int reserved_1 :4;
822 volatile unsigned int errticerr :1; //erratic error
823 volatile unsigned int enumspd :2; //enumeration speed
824 volatile unsigned int suspsts :1; // suspend status
826 volatile unsigned int suspsts :1; // suspend status
827 volatile unsigned int enumspd :2; //enumeration speed
828 volatile unsigned int errticerr :1; //erratic error
829 volatile unsigned int reserved_1 :4;
830 volatile unsigned int soffn :14; //frame or microframe nummber of the recieved SOF
831 volatile unsigned int reserved_2 :10;
835 volatile unsigned int dwValue ;
838 typedef union usb_diepmsk_tag
840 struct usb_diepmsk_map
842 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
843 volatile unsigned int reserved_3 :18;
844 volatile unsigned int nakmsk :1; //NAK interrupt mask
845 volatile unsigned int reserved_2 :3;
846 volatile unsigned int bnakintmsk :1; //BNK interrupt mask
847 volatile unsigned int fifounmsk :1; //fifo underrun mask
848 volatile unsigned int reserve_1 :1;
849 volatile unsigned int inepnakeffmsk :1; //in endpoint nak effective mask
850 volatile unsigned int intknepmismsk :1; //in token recieved with ep mismatch mask
851 volatile unsigned int intkntxfempmsk :1; //in token recieved when tx fifo empty mask
852 volatile unsigned int timeoutmsk :1; //time out mask
853 volatile unsigned int ahberrmsk :1; //ahb error mask
854 volatile unsigned int epdisbidmsk :1; //endpoint disabled interrupt mask
855 volatile unsigned int xfercompimsk :1; //transfer completed interrupt mask
857 volatile unsigned int xfercompimsk :1; //transfer completed interrupt mask
858 volatile unsigned int epdisbidmsk :1; //endpoint disabled interrupt mask
859 volatile unsigned int ahberrmsk :1; //ahb error mask
860 volatile unsigned int timeoutmsk :1; //time out mask
861 volatile unsigned int intkntxfempmsk :1; //in token recieved when tx fifo empty mask
862 volatile unsigned int intknepmismsk :1; //in token recieved with ep mismatch mask
863 volatile unsigned int inepnakeffmsk :1; //in endpoint nak effective mask
864 volatile unsigned int reserve_1 :1;
865 volatile unsigned int fifounmsk :1; //fifo underrun mask
866 volatile unsigned int bnakintmsk :1; //BNK interrupt mask
867 volatile unsigned int reserved_2 :3;
868 volatile unsigned int nakmsk :1; //NAK interrupt mask
869 volatile unsigned int reserved_3 :18;
873 volatile unsigned int dwValue ;
876 typedef union usb_doepmsk_tag
878 struct usb_doepmsk_map
880 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
881 volatile unsigned int reserved_4 :17;
882 volatile unsigned int nyetmsk :1; //NYET mask
883 volatile unsigned int nakmsk :1; //NAK mask
884 volatile unsigned int bbleerrmsk :1; //Babble error mask
885 volatile unsigned int reserved_3 :2;
886 volatile unsigned int bnkmsk :1; //BNK mask
887 volatile unsigned int outperrmsk :1; //out packet error mask
888 volatile unsigned int reserved_2 :1;
889 volatile unsigned int b2bsetup :1; //back to back setup packet recieved mask
890 volatile unsigned int reserved_1 :1;
891 volatile unsigned int outtknepdismsk :1; //out token recieved when endpoint disabled mask
892 volatile unsigned int setupmsk :1; //setup phase done interrupt
893 volatile unsigned int ahberr :1; //ahb error
894 volatile unsigned int epdismsk :1; //endpopint disabled interrupt mask
895 volatile unsigned int xfercompmsk :1; //transfer completed interrupt mask
897 volatile unsigned int xfercompmsk :1; //transfer completed interrupt mask
898 volatile unsigned int epdismsk :1; //endpopint disabled interrupt mask
899 volatile unsigned int ahberr :1; //ahb error
900 volatile unsigned int setupmsk :1; //setup phase done interrupt
901 volatile unsigned int outtknepdismsk :1; //out token recieved when endpoint disabled mask
902 volatile unsigned int reserved_1 :1;
903 volatile unsigned int b2bsetup :1; //back to back setup packet recieved mask
904 volatile unsigned int reserved_2 :1;
905 volatile unsigned int outperrmsk :1; //out packet error mask
906 volatile unsigned int bnkmsk :1; //BNK mask
907 volatile unsigned int reserved_3 :2;
908 volatile unsigned int bbleerrmsk :1; //Babble error mask
909 volatile unsigned int nakmsk :1; //NAK mask
910 volatile unsigned int nyetmsk :1; //NYET mask
911 volatile unsigned int reserved_4 :17;
915 volatile unsigned int dwValue ;
918 typedef union usb_daint_tag
922 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
923 volatile unsigned int reserved_2 :9; // out endppint interrupt
924 volatile unsigned int outepint_6 :1; // in endpoint interrupt
925 volatile unsigned int outepint_5 :1; // in endpoint interrupt
926 volatile unsigned int outepint_4 :1; // in endpoint interrupt
927 volatile unsigned int outepint_3 :1; // in endpoint interrupt
928 volatile unsigned int outepint_2 :1; // in endpoint interrupt
929 volatile unsigned int outepint_1 :1; // in endpoint interrupt
930 volatile unsigned int outepint_0 :1; // in endpoint interrupt
931 volatile unsigned int reserved_1 :9; // in endpoint interrupt
932 volatile unsigned int inepint_6 :1; // in endpoint interrupt
933 volatile unsigned int inepint_5 :1; // in endpoint interrupt
934 volatile unsigned int inepint_4 :1; // in endpoint interrupt
935 volatile unsigned int inepint_3 :1; // in endpoint interrupt
936 volatile unsigned int inepint_2 :1; // in endpoint interrupt
937 volatile unsigned int inepint_1 :1; // in endpoint interrupt
938 volatile unsigned int inepint_0 :1; // in endpoint interrupt
940 volatile unsigned int inepint_0 :1; // in endpoint interrupt
941 volatile unsigned int inepint_1 :1; // in endpoint interrupt
942 volatile unsigned int inepint_2 :1; // in endpoint interrupt
943 volatile unsigned int inepint_3 :1; // in endpoint interrupt
944 volatile unsigned int inepint_4 :1; // in endpoint interrupt
945 volatile unsigned int inepint_5 :1; // in endpoint interrupt
946 volatile unsigned int inepint_6 :1; // in endpoint interrupt
947 volatile unsigned int reserved_1 :9; // in endpoint interrupt
948 volatile unsigned int outepint_0 :1; // in endpoint interrupt
949 volatile unsigned int outepint_1 :1; // in endpoint interrupt
950 volatile unsigned int outepint_2 :1; // in endpoint interrupt
951 volatile unsigned int outepint_3 :1; // in endpoint interrupt
952 volatile unsigned int outepint_4 :1; // in endpoint interrupt
953 volatile unsigned int outepint_5 :1; // in endpoint interrupt
954 volatile unsigned int outepint_6 :1; // in endpoint interrupt
955 volatile unsigned int reserved_2 :9; // out endppint interrupt
959 volatile unsigned int dwValue ;
962 typedef union usb_daintmsk_tag
964 struct usb_daintmsk_map
966 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
967 volatile unsigned int outepintmsk :16; //out endpoint interrupt mak
968 volatile unsigned int inepintmsk :16; //in endpoint interrupt mask
970 volatile unsigned int inepintmsk :16; //in endpoint interrupt mask
971 volatile unsigned int outepintmsk :16; //out endpoint interrupt mak
974 volatile unsigned int dwValue ;
977 typedef union usb_dtknqr1_tag
979 struct usb_dtknqr1_map
981 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
982 volatile unsigned int eptkn :24; //endpoint token
983 volatile unsigned int wrapbit :1; //wrap bit
984 volatile unsigned int reserved :2; //
985 volatile unsigned int intknwptr :5; //in token queue write pointer
987 volatile unsigned int intknwptr :5; //in token queue write pointer
988 volatile unsigned int reserved :2; //
989 volatile unsigned int wrapbit :1; //wrap bit
990 volatile unsigned int eptkn :24; //endpoint token
993 volatile unsigned int dwValue ;
996 typedef union usb_dtknqr2_tag
998 struct usb_dtknqr2_map
1000 volatile unsigned int eptoken :32; // endpoint token
1002 volatile unsigned int dwValue ;
1005 typedef union usb_dtknqr3_tag
1007 struct usb_dtknqr3_map
1009 volatile unsigned int eptoken :32; // endpoint token
1011 volatile unsigned int dwValue ;
1014 typedef union usb_dtknqr4_tag
1016 struct usb_dtknqr4_map
1018 volatile unsigned int eptoken :32; // endpoint token
1020 volatile unsigned int dwValue ;
1023 typedef union usb_dvbusdis_tag
1025 struct usb_dvbusdis_map
1027 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1028 volatile unsigned int reserved :16;
1029 volatile unsigned int dvbusdis :16; //device vbus discharge time
1031 volatile unsigned int dvbusdis :16; //device vbus discharge time
1032 volatile unsigned int reserved :16;
1035 volatile unsigned int dwValue ;
1038 typedef union usb_dvbuspulse_tag
1040 struct usb_dvbuspulse_map
1042 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1043 volatile unsigned int reserved :20;
1044 volatile unsigned int dvbuspt :12; //device vbus pulse time
1046 volatile unsigned int dvbuspt :12; //device vbus pulse time
1047 volatile unsigned int reserved :20;
1050 volatile unsigned int dwValue ;
1053 typedef union usb_dthrctl_tag
1055 struct usb_dthrctl_map
1057 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1058 volatile unsigned int reserved_3 :4;
1059 volatile unsigned int arbprken :1; //
1060 volatile unsigned int reserved_2 :1;
1061 volatile unsigned int rxthrlen :9; //receive threshold length
1062 volatile unsigned int rxthren :1; //receive threshold enable
1063 volatile unsigned int reserved_1 :5; //
1064 volatile unsigned int txthrlen :9; //transmit threshold length
1065 volatile unsigned int isothren :1; //iso in endpoint threshold enable
1066 volatile unsigned int nonisothren :1; //non iso in endpoint threshold enable
1068 volatile unsigned int nonisothren :1; //non iso in endpoint threshold enable
1069 volatile unsigned int isothren :1; //iso in endpoint threshold enable
1070 volatile unsigned int txthrlen :9; //transmit threshold length
1071 volatile unsigned int reserved_1 :5; //
1072 volatile unsigned int rxthren :1; //receive threshold enable
1073 volatile unsigned int rxthrlen :9; //receive threshold length
1074 volatile unsigned int reserved_2 :1;
1075 volatile unsigned int arbprken :1; //
1076 volatile unsigned int reserved_3 :4;
1080 volatile unsigned int dwValue ;
1084 typedef union usb_diepint_tag
1086 struct usb_diepint_map
1088 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1089 volatile unsigned int reserved_2 :17;
1090 volatile unsigned int nyet :1;
1091 volatile unsigned int nak :1;
1092 volatile unsigned int bbleerr :1;
1093 volatile unsigned int pktdrpsts :1;
1094 volatile unsigned int reserved_1 :1;
1095 volatile unsigned int bna :1;
1096 volatile unsigned int fifo_underrun :1;
1097 volatile unsigned int tfifoemp :1;
1098 volatile unsigned int inepnakef :1;
1099 volatile unsigned int intokenepmis :1;
1100 volatile unsigned int intokenfifoemp :1;
1101 volatile unsigned int timeout_condi :1;
1102 volatile unsigned int ahb_error :1;
1103 volatile unsigned int epdis :1;
1104 volatile unsigned int transfer_com :1;
1106 volatile unsigned int transfer_com :1;
1107 volatile unsigned int epdis :1;
1108 volatile unsigned int ahb_error :1;
1109 volatile unsigned int timeout_condi :1;
1110 volatile unsigned int intokenfifoemp :1;
1111 volatile unsigned int intokenepmis :1;
1112 volatile unsigned int inepnakef :1;
1113 volatile unsigned int tfifoemp :1;
1114 volatile unsigned int fifo_underrun :1;
1115 volatile unsigned int bna :1;
1116 volatile unsigned int reserved_1 :1;
1117 volatile unsigned int pktdrpsts :1;
1118 volatile unsigned int bbleerr :1;
1119 volatile unsigned int nak :1;
1120 volatile unsigned int nyet :1;
1121 volatile unsigned int reserved_2 :17;
1125 volatile unsigned int dwValue ;
1128 typedef union usb_doepint_tag
1130 struct usb_doepint_map
1132 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1133 volatile unsigned int reserved_2 :17;
1134 volatile unsigned int nyet :1;
1135 volatile unsigned int nak :1;
1136 volatile unsigned int bbleerr :1;
1137 volatile unsigned int pktdrpsts :1;
1138 volatile unsigned int reserved_1 :1;
1139 volatile unsigned int bna :1;
1140 volatile unsigned int fifo_underrun :1;
1141 volatile unsigned int tfifoemp :1;
1142 volatile unsigned int inepnakef :1;
1143 volatile unsigned int intokenepmis :1;
1144 volatile unsigned int outtokenfifoemp :1;
1145 volatile unsigned int timeout_condi :1;
1146 volatile unsigned int ahb_error :1;
1147 volatile unsigned int epdis :1;
1148 volatile unsigned int transfer_com :1;
1150 volatile unsigned int transfer_com :1;
1151 volatile unsigned int epdis :1;
1152 volatile unsigned int ahb_error :1;
1153 volatile unsigned int timeout_condi :1;
1154 volatile unsigned int outtokenfifoemp :1;
1155 volatile unsigned int intokenepmis :1;
1156 volatile unsigned int inepnakef :1;
1157 volatile unsigned int tfifoemp :1;
1158 volatile unsigned int fifo_underrun :1;
1159 volatile unsigned int bna :1;
1160 volatile unsigned int reserved_1 :1;
1161 volatile unsigned int pktdrpsts :1;
1162 volatile unsigned int bbleerr :1;
1163 volatile unsigned int nak :1;
1164 volatile unsigned int nyet :1;
1165 volatile unsigned int reserved_2 :17;
1169 volatile unsigned int dwValue ;
1173 typedef union usb_dieptsiz_tag
1175 struct usb_dieptsiz_map
1177 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1178 volatile unsigned int reserved :1;
1179 volatile unsigned int mult_count :2;
1180 volatile unsigned int packet_count :10;
1181 volatile unsigned int transfer_size :19;
1183 volatile unsigned int transfer_size :19;
1184 volatile unsigned int packet_count :10;
1185 volatile unsigned int mult_count :2;
1186 volatile unsigned int reserved :1;
1189 volatile unsigned int dwValue ;
1192 typedef union usb_doeptsiz_tag
1194 struct usb_doeptsiz_map
1196 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1197 volatile unsigned int reserved :1;
1198 volatile unsigned int mult_count :2;
1199 volatile unsigned int packet_count :10;
1200 volatile unsigned int transfer_size :19;
1202 volatile unsigned int transfer_size :19;
1203 volatile unsigned int packet_count :10;
1204 volatile unsigned int mult_count :2;
1205 volatile unsigned int reserved :1;
1208 volatile unsigned int dwValue ;
1212 typedef union usb_diepctl_tag
1214 struct usb_diepctl_map
1216 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1218 volatile unsigned int ep_enable :1;
1219 volatile unsigned int ep_disable :1;
1220 volatile unsigned int set_data1_pid :1;
1221 volatile unsigned int set_data0_pid :1;
1222 volatile unsigned int set_nak :1;
1223 volatile unsigned int clear_nak :1;
1224 volatile unsigned int tx_fifo_number :4;
1225 volatile unsigned int stall_handshak :1;
1226 volatile unsigned int snoop_mode :1;
1227 volatile unsigned int ep_type :2;
1228 volatile unsigned int nak_status :1;
1229 volatile unsigned int ep_data_pid :1;
1230 volatile unsigned int active_ep :1;
1231 volatile unsigned int next_ep :4;
1232 volatile unsigned int mps :11;
1234 volatile unsigned int mps :11;
1235 volatile unsigned int next_ep :4;
1236 volatile unsigned int active_ep :1;
1237 volatile unsigned int ep_data_pid :1;
1238 volatile unsigned int nak_status :1;
1239 volatile unsigned int ep_type :2;
1240 volatile unsigned int snoop_mode :1;
1241 volatile unsigned int stall_handshak :1;
1242 volatile unsigned int tx_fifo_number :4;
1243 volatile unsigned int clear_nak :1;
1244 volatile unsigned int set_nak :1;
1245 volatile unsigned int set_data0_pid :1;
1246 volatile unsigned int set_data1_pid :1;
1247 volatile unsigned int ep_disable :1;
1248 volatile unsigned int ep_enable :1;
1252 volatile unsigned int dwValue ;
1255 typedef union usb_doepctl_tag
1257 struct usb_doepctl_map
1259 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1260 volatile unsigned int ep_enable :1;
1261 volatile unsigned int ep_disable :1;
1262 volatile unsigned int set_data1_pid :1;
1263 volatile unsigned int set_data0_pid :1;
1264 volatile unsigned int set_nak :1;
1265 volatile unsigned int clear_nak :1;
1266 volatile unsigned int tx_fifo_number :4;
1267 volatile unsigned int stall_handshak :1;
1268 volatile unsigned int snoop_mode :1;
1269 volatile unsigned int ep_type :2;
1270 volatile unsigned int nak_status :1;
1271 volatile unsigned int ep_data_pid :1;
1272 volatile unsigned int active_ep :1;
1273 volatile unsigned int next_ep :4;
1274 volatile unsigned int mps :11;
1276 volatile unsigned int mps :11;
1277 volatile unsigned int next_ep :4;
1278 volatile unsigned int active_ep :1;
1279 volatile unsigned int ep_data_pid :1;
1280 volatile unsigned int nak_status :1;
1281 volatile unsigned int ep_type :2;
1282 volatile unsigned int snoop_mode :1;
1283 volatile unsigned int stall_handshak :1;
1284 volatile unsigned int tx_fifo_number :4;
1285 volatile unsigned int clear_nak :1;
1286 volatile unsigned int set_nak :1;
1287 volatile unsigned int set_data0_pid :1;
1288 volatile unsigned int set_data1_pid :1;
1289 volatile unsigned int ep_disable :1;
1290 volatile unsigned int ep_enable :1;
1294 volatile unsigned int dwValue ;
1297 typedef union usb_diep0tsiz_tag
1299 struct usb_diep0tsiz_map
1301 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1302 volatile unsigned int reserved_2 :11;
1303 volatile unsigned int packet_count :2;
1304 volatile unsigned int reserved_1 :12;
1305 volatile unsigned int transfer_size :7;
1307 volatile unsigned int transfer_size :7;
1308 volatile unsigned int reserved_1 :12;
1309 volatile unsigned int packet_count :2;
1310 volatile unsigned int reserved_2 :11;
1313 volatile unsigned int dwValue ;
1316 typedef union usb_doep0tsiz_tag
1318 struct usb_doep0tsiz_map
1320 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1321 volatile unsigned int reserved_3 :1;
1322 volatile unsigned int setup_packet_count :2;
1323 volatile unsigned int reserved_2 :9;
1324 volatile unsigned int packet_count :1;
1325 volatile unsigned int reserved_1 :12;
1326 volatile unsigned int transfer_size :7;
1328 volatile unsigned int transfer_size :7;
1329 volatile unsigned int reserved_1 :12;
1330 volatile unsigned int packet_count :1;
1331 volatile unsigned int reserved_2 :9;
1332 volatile unsigned int setup_packet_count :2;
1333 volatile unsigned int reserved_3 :1;
1337 volatile unsigned int dwValue ;
1342 typedef union usb_intsts_tag
1344 struct usb_intsts_map
1346 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1347 volatile unsigned int wkupint :1; //Reserved ;
1348 volatile unsigned int sessreqint :1; //Slef powered ;
1349 volatile unsigned int discoonint :1; //Device enable ;
1350 volatile unsigned int conidstschng :1;
1351 volatile unsigned int lpmint :1;
1352 volatile unsigned int ptxfemp :1;
1353 volatile unsigned int hchint :1;
1354 volatile unsigned int prtint :1;
1355 volatile unsigned int resetdet :1;
1356 volatile unsigned int fetsusp :1;
1357 volatile unsigned int incompip :1;
1358 volatile unsigned int incompisoin :1;
1360 volatile unsigned int oepint :1;
1361 volatile unsigned int iepint :1;
1362 volatile unsigned int epmis :1;
1363 volatile unsigned int reserved :1;
1364 volatile unsigned int eopf :1;
1365 volatile unsigned int isooutdrop :1;
1366 volatile unsigned int enumdone :1;
1367 volatile unsigned int usbrst :1;
1368 volatile unsigned int usbsusp :1;
1369 volatile unsigned int erlysusp :1;
1370 volatile unsigned int i2cint :1;
1371 volatile unsigned int ulpickint :1;
1372 volatile unsigned int goutnakeff :1;
1373 volatile unsigned int ginnakeff :1;
1374 volatile unsigned int nptxfemp :1;
1375 volatile unsigned int rxflvl :1;
1376 volatile unsigned int sof :1; //12321
1377 volatile unsigned int otgint :1;
1378 volatile unsigned int modemis :1;
1379 volatile unsigned int curmod :1;
1381 volatile unsigned int curmod :1;
1382 volatile unsigned int modemis :1;
1383 volatile unsigned int otgint :1;
1384 volatile unsigned int sof :1;
1385 volatile unsigned int rxflvl :1;
1386 volatile unsigned int nptxfemp :1;
1387 volatile unsigned int ginnakeff :1;
1388 volatile unsigned int goutnakeff :1;
1389 volatile unsigned int ulpickint :1; //13123
1390 volatile unsigned int i2cint :1;
1391 volatile unsigned int erlysusp :1;
1392 volatile unsigned int usbsusp :1;
1393 volatile unsigned int usbrst :1;
1394 volatile unsigned int enumdone :1;
1396 volatile unsigned int isooutdrop :1;
1397 volatile unsigned int eopf :1;
1398 volatile unsigned int reserved :1;
1399 volatile unsigned int epmis :1;
1400 volatile unsigned int iepint :1;
1401 volatile unsigned int oepint :1;
1402 volatile unsigned int incompisoin :1;
1403 volatile unsigned int incompip :1;
1404 volatile unsigned int fetsusp :1;
1405 volatile unsigned int resetdet :1;
1406 volatile unsigned int prtint :1;
1407 volatile unsigned int hchint :1;
1408 volatile unsigned int ptxfemp :1;
1409 volatile unsigned int lpmint :1;
1410 volatile unsigned int conidstschng :1;
1411 volatile unsigned int discoonint :1; //Device enable ;
1412 volatile unsigned int sessreqint :1; //Slef powered ;
1413 volatile unsigned int wkupint :1; //Reserved ;
1416 volatile unsigned int dwValue ;
1419 #ifdef MODEM_CONTROL_SUPPORT_USB
1420 typedef union usb_pcgcctl_tag
1422 struct usb_pcgcctl_map
1424 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1426 volatile unsigned int Reserved :23; //global_interrupt_mask
1427 volatile unsigned int ResetAfterSusp :1;
1428 volatile unsigned int L1_Suspended :1; //periodic_txfifo_empty_level
1429 volatile unsigned int PhySleep :1; //non_periodic_txfifo_empty_level
1430 volatile unsigned int Enbl_L1Gating :1;
1431 volatile unsigned int PhySuspended :1; //dma_enable
1432 volatile unsigned int RstPdwnModule :1; //burst_length
1433 volatile unsigned int PwrClmp :1; //global_interrupt_mask
1434 volatile unsigned int GateHclk :1; //global_interrupt_mask
1435 volatile unsigned int StopPclk :1; //global_interrupt_mask
1438 volatile unsigned int StopPclk :1; //global_interrupt_mask
1439 volatile unsigned int GateHclk :1; //global_interrupt_mask
1440 volatile unsigned int PwrClmp :1; //global_interrupt_mask
1441 volatile unsigned int RstPdwnModule :1; //burst_length
1442 volatile unsigned int PhySuspended :1; //dma_enable
1443 volatile unsigned int Enbl_L1Gating :1;
1444 volatile unsigned int PhySleep :1; //non_periodic_txfifo_empty_level
1445 volatile unsigned int L1_Suspended :1; //periodic_txfifo_empty_level
1446 volatile unsigned int ResetAfterSusp :1;
1447 volatile unsigned int Reserved :23; //global_interrupt_mask
1451 volatile unsigned int dwValue ;
1455 /******************** USB2.0 Protocol Prototype ****************/
1457 typedef union usb_request_1_tag
1459 struct usb_request_1_map
1461 #if (!defined(_LITTLE_ENDIAN) && !defined(CHIP_ENDIAN_LITTLE))
1462 volatile unsigned int direction :1;
1463 volatile unsigned int type :2;
1464 volatile unsigned int recipient :5;
1465 volatile unsigned int brequest :8;
1466 volatile unsigned int value_l :8;
1467 volatile unsigned int value_m :8;
1469 volatile unsigned int recipient :5;
1470 volatile unsigned int type :2;
1471 volatile unsigned int direction :1;
1472 volatile unsigned int brequest :8;
1473 volatile unsigned int value_l :8;
1474 volatile unsigned int value_m :8;
1477 volatile unsigned int dwValue ;
1480 typedef union usb_request_2_tag
1482 struct usb_request_2_map
1485 volatile unsigned int index_l :8;
1486 volatile unsigned int index_m :8;
1487 volatile unsigned int length_l :8;
1488 volatile unsigned int length_m :8;
1490 volatile unsigned int dwValue ;
1493 #define USB_EPx_NUMBER 6
1494 /**----------------------------------------------------------------------------*
1495 ** Local Function Prototype **
1496 **----------------------------------------------------------------------------*/
1498 /**----------------------------------------------------------------------------*
1499 ** Function Prototype **
1500 **----------------------------------------------------------------------------*/
1503 /**----------------------------------------------------------------------------*
1505 **----------------------------------------------------------------------------*/
1509 /**---------------------------------------------------------------------------*/