1 /* ==========================================================================
2 * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_regs.h $
7 * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
8 * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
9 * otherwise expressly agreed to in writing between Synopsys and you.
11 * The Software IS NOT an item of Licensed Software or Licensed Product under
12 * any End User Software License Agreement or Agreement for Licensed Product
13 * with Synopsys or any supplement thereto. You are permitted to use and
14 * redistribute this Software in source and binary forms, with or without
15 * modification, provided that redistributions of source code must retain this
16 * notice. You may not view, use, disclose, copy or distribute this file or
17 * any information contained herein except pursuant to this license grant from
18 * Synopsys. If you do not agree with this notice, including the disclaimer
19 * below, then you are not authorized to use the Software.
21 * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
32 * ========================================================================== */
34 #ifndef __DWC_OTG_REGS_H__
35 #define __DWC_OTG_REGS_H__
37 #include "dwc_otg_core_if.h"
42 * This file contains the data structures for accessing the DWC_otg core registers.
44 * The application interfaces with the HS OTG core by reading from and
45 * writing to the Control and Status Register (CSR) space through the
46 * AHB Slave interface. These registers are 32 bits wide, and the
47 * addresses are 32-bit-block aligned.
48 * CSRs are classified as follows:
49 * - Core Global Registers
50 * - Device Mode Registers
51 * - Device Global Registers
52 * - Device Endpoint Specific Registers
53 * - Host Mode Registers
54 * - Host Global Registers
56 * - Host Channel Specific Registers
58 * Only the Core Global registers can be accessed in both Device and
59 * Host modes. When the HS OTG core is operating in one mode, either
60 * Device or Host, the application must not access registers from the
61 * other mode. When the core switches from one mode to another, the
62 * registers in the new mode of operation must be reprogrammed as they
63 * would be after a power-on reset.
66 /****************************************************************************/
67 /** DWC_otg Core registers .
68 * The dwc_otg_core_global_regs structure defines the size
69 * and relative field offsets for the Core Global registers.
71 typedef struct dwc_otg_core_global_regs {
72 /** OTG Control and Status Register. <i>Offset: 000h</i> */
73 volatile uint32_t gotgctl;
74 /** OTG Interrupt Register. <i>Offset: 004h</i> */
75 volatile uint32_t gotgint;
76 /**Core AHB Configuration Register. <i>Offset: 008h</i> */
77 volatile uint32_t gahbcfg;
79 #define DWC_GLBINTRMASK 0x0001
80 #define DWC_DMAENABLE 0x0020
81 #define DWC_NPTXEMPTYLVL_EMPTY 0x0080
82 #define DWC_NPTXEMPTYLVL_HALFEMPTY 0x0000
83 #define DWC_PTXEMPTYLVL_EMPTY 0x0100
84 #define DWC_PTXEMPTYLVL_HALFEMPTY 0x0000
86 /**Core USB Configuration Register. <i>Offset: 00Ch</i> */
87 volatile uint32_t gusbcfg;
88 /**Core Reset Register. <i>Offset: 010h</i> */
89 volatile uint32_t grstctl;
90 /**Core Interrupt Register. <i>Offset: 014h</i> */
91 volatile uint32_t gintsts;
92 /**Core Interrupt Mask Register. <i>Offset: 018h</i> */
93 volatile uint32_t gintmsk;
94 /**Receive Status Queue Read Register (Read Only). <i>Offset: 01Ch</i> */
95 volatile uint32_t grxstsr;
96 /**Receive Status Queue Read & POP Register (Read Only). <i>Offset: 020h</i>*/
97 volatile uint32_t grxstsp;
98 /**Receive FIFO Size Register. <i>Offset: 024h</i> */
99 volatile uint32_t grxfsiz;
100 /**Non Periodic Transmit FIFO Size Register. <i>Offset: 028h</i> */
101 volatile uint32_t gnptxfsiz;
102 /**Non Periodic Transmit FIFO/Queue Status Register (Read
103 * Only). <i>Offset: 02Ch</i> */
104 volatile uint32_t gnptxsts;
105 /**I2C Access Register. <i>Offset: 030h</i> */
106 volatile uint32_t gi2cctl;
107 /**PHY Vendor Control Register. <i>Offset: 034h</i> */
108 volatile uint32_t gpvndctl;
109 /**General Purpose Input/Output Register. <i>Offset: 038h</i> */
110 volatile uint32_t ggpio;
111 /**User ID Register. <i>Offset: 03Ch</i> */
112 volatile uint32_t guid;
113 /**Synopsys ID Register (Read Only). <i>Offset: 040h</i> */
114 volatile uint32_t gsnpsid;
115 /**User HW Config1 Register (Read Only). <i>Offset: 044h</i> */
116 volatile uint32_t ghwcfg1;
117 /**User HW Config2 Register (Read Only). <i>Offset: 048h</i> */
118 volatile uint32_t ghwcfg2;
119 #define DWC_SLAVE_ONLY_ARCH 0
120 #define DWC_EXT_DMA_ARCH 1
121 #define DWC_INT_DMA_ARCH 2
123 #define DWC_MODE_HNP_SRP_CAPABLE 0
124 #define DWC_MODE_SRP_ONLY_CAPABLE 1
125 #define DWC_MODE_NO_HNP_SRP_CAPABLE 2
126 #define DWC_MODE_SRP_CAPABLE_DEVICE 3
127 #define DWC_MODE_NO_SRP_CAPABLE_DEVICE 4
128 #define DWC_MODE_SRP_CAPABLE_HOST 5
129 #define DWC_MODE_NO_SRP_CAPABLE_HOST 6
131 /**User HW Config3 Register (Read Only). <i>Offset: 04Ch</i> */
132 volatile uint32_t ghwcfg3;
133 /**User HW Config4 Register (Read Only). <i>Offset: 050h</i>*/
134 volatile uint32_t ghwcfg4;
135 /** Core LPM Configuration register <i>Offset: 054h</i>*/
136 volatile uint32_t glpmcfg;
137 /** Global PowerDn Register <i>Offset: 058h</i> */
138 volatile uint32_t gpwrdn;
139 /** Global DFIFO SW Config Register <i>Offset: 05Ch</i> */
140 volatile uint32_t gdfifocfg;
141 /** ADP Control Register <i>Offset: 060h</i> */
142 volatile uint32_t adpctl;
143 /** Reserved <i>Offset: 064h-0FFh</i> */
144 volatile uint32_t reserved39[39];
145 /** Host Periodic Transmit FIFO Size Register. <i>Offset: 100h</i> */
146 volatile uint32_t hptxfsiz;
147 /** Device Periodic Transmit FIFO#n Register if dedicated fifos are disabled,
148 otherwise Device Transmit FIFO#n Register.
149 * <i>Offset: 104h + (FIFO_Number-1)*04h, 1 <= FIFO Number <= 15 (1<=n<=15).</i> */
150 volatile uint32_t dtxfsiz[15];
151 } dwc_otg_core_global_regs_t;
154 * This union represents the bit fields of the Core OTG Control
155 * and Status Register (GOTGCTL). Set the bits using the bit
156 * fields then write the <i>d32</i> value to the register.
158 typedef union gotgctl_data {
159 /** raw register data */
163 unsigned sesreqscs:1;
165 unsigned vbvalidoven:1;
166 unsigned vbvalidovval:1;
167 unsigned avalidoven:1;
168 unsigned avalidovval:1;
169 unsigned bvalidoven:1;
170 unsigned bvalidovval:1;
171 unsigned hstnegscs:1;
173 unsigned hstsethnpen:1;
175 unsigned reserved12_15:4;
181 unsigned reserved1:1;
182 unsigned multvalidbc:5;
184 unsigned reserved28_31:4;
189 * This union represents the bit fields of the Core OTG Interrupt Register
190 * (GOTGINT). Set/clear the bits using the bit fields then write the <i>d32</i>
191 * value to the register.
193 typedef union gotgint_data {
194 /** raw register data */
199 unsigned reserved0_1:2;
201 /** Session End Detected */
202 unsigned sesenddet:1;
204 unsigned reserved3_7:5;
206 /** Session Request Success Status Change */
207 unsigned sesreqsucstschng:1;
208 /** Host Negotiation Success Status Change */
209 unsigned hstnegsucstschng:1;
211 unsigned reserved10_16:7;
213 /** Host Negotiation Detected */
214 unsigned hstnegdet:1;
215 /** A-Device Timeout Change */
216 unsigned adevtoutchng:1;
219 /** Multi-Valued input changed */
222 unsigned reserved31_21:11;
228 * This union represents the bit fields of the Core AHB Configuration
229 * Register (GAHBCFG). Set/clear the bits using the bit fields then
230 * write the <i>d32</i> value to the register.
232 typedef union gahbcfg_data {
233 /** raw register data */
237 unsigned glblintrmsk:1;
238 #define DWC_GAHBCFG_GLBINT_ENABLE 1
240 unsigned hburstlen:4;
241 #define DWC_GAHBCFG_INT_DMA_BURST_SINGLE 0
242 #define DWC_GAHBCFG_INT_DMA_BURST_INCR 1
243 #define DWC_GAHBCFG_INT_DMA_BURST_INCR4 3
244 #define DWC_GAHBCFG_INT_DMA_BURST_INCR8 5
245 #define DWC_GAHBCFG_INT_DMA_BURST_INCR16 7
247 unsigned dmaenable:1;
248 #define DWC_GAHBCFG_DMAENABLE 1
250 unsigned nptxfemplvl_txfemplvl:1;
251 unsigned ptxfemplvl:1;
252 #define DWC_GAHBCFG_TXFEMPTYLVL_EMPTY 1
253 #define DWC_GAHBCFG_TXFEMPTYLVL_HALFEMPTY 0
254 unsigned reserved9_20:12;
255 unsigned remmemsupp:1;
256 unsigned notialldmawrit:1;
257 unsigned ahbsingle:1;
258 unsigned reserved24_31:8;
263 * This union represents the bit fields of the Core USB Configuration
264 * Register (GUSBCFG). Set the bits using the bit fields then write
265 * the <i>d32</i> value to the register.
267 typedef union gusbcfg_data {
268 /** raw register data */
274 unsigned ulpi_utmi_sel:1;
280 unsigned usbtrdtim:4;
281 unsigned reserved1:1;
282 unsigned phylpwrclksel:1;
283 unsigned otgutmifssel:1;
284 unsigned ulpi_fsls:1;
285 unsigned ulpi_auto_res:1;
286 unsigned ulpi_clk_sus_m:1;
287 unsigned ulpi_ext_vbus_drv:1;
288 unsigned ulpi_int_vbus_indicator:1;
289 unsigned term_sel_dl_pulse:1;
290 unsigned indicator_complement:1;
291 unsigned indicator_pass_through:1;
292 unsigned ulpi_int_prot_dis:1;
293 unsigned ic_usb_cap:1;
294 unsigned ic_traffic_pull_remove:1;
295 unsigned tx_end_delay:1;
296 unsigned force_host_mode:1;
297 unsigned force_dev_mode:1;
298 unsigned reserved31:1;
303 * This union represents the bit fields of the Core Reset Register
304 * (GRSTCTL). Set/clear the bits using the bit fields then write the
305 * <i>d32</i> value to the register.
307 typedef union grstctl_data {
308 /** raw register data */
312 /** Core Soft Reset (CSftRst) (Device and Host)
314 * The application can flush the control logic in the
315 * entire core using this bit. This bit resets the
316 * pipelines in the AHB Clock domain as well as the
319 * The state machines are reset to an IDLE state, the
320 * control bits in the CSRs are cleared, all the
321 * transmit FIFOs and the receive FIFO are flushed.
323 * The status mask bits that control the generation of
324 * the interrupt, are cleared, to clear the
325 * interrupt. The interrupt status bits are not
326 * cleared, so the application can get the status of
327 * any events that occurred in the core after it has
330 * Any transactions on the AHB are terminated as soon
331 * as possible following the protocol. Any
332 * transactions on the USB are terminated immediately.
334 * The configuration settings in the CSRs are
335 * unchanged, so the software doesn't have to
336 * reprogram these registers (Device
337 * Configuration/Host Configuration/Core System
338 * Configuration/Core PHY Configuration).
340 * The application can write to this bit, any time it
341 * wants to reset the core. This is a self clearing
342 * bit and the core clears this bit after all the
343 * necessary logic is reset in the core, which may
344 * take several clocks, depending on the current state
350 * The application uses this bit to reset the control logic in
351 * the AHB clock domain. Only AHB clock domain pipelines are
355 /** Host Frame Counter Reset (Host Only)<br>
357 * The application can reset the (micro)frame number
358 * counter inside the core, using this bit. When the
359 * (micro)frame counter is reset, the subsequent SOF
360 * sent out by the core, will have a (micro)frame
364 /** In Token Sequence Learning Queue Flush
365 * (INTknQFlsh) (Device Only)
367 unsigned intknqflsh:1;
368 /** RxFIFO Flush (RxFFlsh) (Device and Host)
370 * The application can flush the entire Receive FIFO
371 * using this bit. The application must first
372 * ensure that the core is not in the middle of a
373 * transaction. The application should write into
374 * this bit, only after making sure that neither the
375 * DMA engine is reading from the RxFIFO nor the MAC
376 * is writing the data in to the FIFO. The
377 * application should wait until the bit is cleared
378 * before performing any other operations. This bit
379 * will takes 8 clocks (slowest of PHY or AHB clock)
383 /** TxFIFO Flush (TxFFlsh) (Device and Host).
385 * This bit is used to selectively flush a single or
386 * all transmit FIFOs. The application must first
387 * ensure that the core is not in the middle of a
388 * transaction. The application should write into
389 * this bit, only after making sure that neither the
390 * DMA engine is writing into the TxFIFO nor the MAC
391 * is reading the data out of the FIFO. The
392 * application should wait until the core clears this
393 * bit, before performing any operations. This bit
394 * will takes 8 clocks (slowest of PHY or AHB clock)
399 /** TxFIFO Number (TxFNum) (Device and Host).
401 * This is the FIFO number which needs to be flushed,
402 * using the TxFIFO Flush bit. This field should not
403 * be changed until the TxFIFO Flush bit is cleared by
405 * - 0x0 : Non Periodic TxFIFO Flush
406 * - 0x1 : Periodic TxFIFO #1 Flush in device mode
407 * or Periodic TxFIFO in host mode
408 * - 0x2 : Periodic TxFIFO #2 Flush in device mode.
410 * - 0xF : Periodic TxFIFO #15 Flush in device mode
411 * - 0x10: Flush all the Transmit NonPeriodic and
412 * Transmit Periodic FIFOs in the core
416 unsigned reserved11_29:19;
417 /** DMA Request Signal. Indicated DMA request is in
418 * probress. Used for debug purpose. */
420 /** AHB Master Idle. Indicates the AHB Master State
421 * Machine is in IDLE condition. */
427 * This union represents the bit fields of the Core Interrupt Mask
428 * Register (GINTMSK). Set/clear the bits using the bit fields then
429 * write the <i>d32</i> value to the register.
431 typedef union gintmsk_data {
432 /** raw register data */
436 unsigned reserved0:1;
437 unsigned modemismatch:1;
440 unsigned rxstsqlvl:1;
441 unsigned nptxfempty:1;
442 unsigned ginnakeff:1;
443 unsigned goutnakeff:1;
444 unsigned ulpickint:1;
446 unsigned erlysuspend:1;
447 unsigned usbsuspend:1;
450 unsigned isooutdrop:1;
452 unsigned restoredone:1;
453 unsigned epmismatch:1;
455 unsigned outepintr:1;
456 unsigned incomplisoin:1;
457 unsigned incomplisoout:1;
462 unsigned ptxfempty:1;
463 unsigned lpmtranrcvd:1;
464 unsigned conidstschng:1;
465 unsigned disconnect:1;
466 unsigned sessreqintr:1;
471 * This union represents the bit fields of the Core Interrupt Register
472 * (GINTSTS). Set/clear the bits using the bit fields then write the
473 * <i>d32</i> value to the register.
475 typedef union gintsts_data {
476 /** raw register data */
478 #define DWC_SOF_INTR_MASK 0x0008
481 #define DWC_HOST_MODE 1
483 unsigned modemismatch:1;
486 unsigned rxstsqlvl:1;
487 unsigned nptxfempty:1;
488 unsigned ginnakeff:1;
489 unsigned goutnakeff:1;
490 unsigned ulpickint:1;
492 unsigned erlysuspend:1;
493 unsigned usbsuspend:1;
496 unsigned isooutdrop:1;
498 unsigned restoredone:1;
499 unsigned epmismatch:1;
501 unsigned outepintr:1;
502 unsigned incomplisoin:1;
503 unsigned incomplisoout:1;
508 unsigned ptxfempty:1;
509 unsigned lpmtranrcvd:1;
510 unsigned conidstschng:1;
511 unsigned disconnect:1;
512 unsigned sessreqintr:1;
518 * This union represents the bit fields in the Device Receive Status Read and
519 * Pop Registers (GRXSTSR, GRXSTSP) Read the register into the <i>d32</i>
520 * element then read out the bits using the <i>b</i>it elements.
522 typedef union device_grxsts_data {
523 /** raw register data */
531 #define DWC_STS_DATA_UPDT 0x2 /* OUT Data Packet */
532 #define DWC_STS_XFER_COMP 0x3 /* OUT Data Transfer Complete */
534 #define DWC_DSTS_GOUT_NAK 0x1 /* Global OUT NAK */
535 #define DWC_DSTS_SETUP_COMP 0x4 /* Setup Phase Complete */
536 #define DWC_DSTS_SETUP_UPDT 0x6 /* SETUP Packet */
539 unsigned reserved25_31:7;
541 } device_grxsts_data_t;
544 * This union represents the bit fields in the Host Receive Status Read and
545 * Pop Registers (GRXSTSR, GRXSTSP) Read the register into the <i>d32</i>
546 * element then read out the bits using the <i>b</i>it elements.
548 typedef union host_grxsts_data {
549 /** raw register data */
558 #define DWC_GRXSTS_PKTSTS_IN 0x2
559 #define DWC_GRXSTS_PKTSTS_IN_XFER_COMP 0x3
560 #define DWC_GRXSTS_PKTSTS_DATA_TOGGLE_ERR 0x5
561 #define DWC_GRXSTS_PKTSTS_CH_HALTED 0x7
563 unsigned reserved21_31:11;
565 } host_grxsts_data_t;
568 * This union represents the bit fields in the FIFO Size Registers (HPTXFSIZ,
569 * GNPTXFSIZ, DPTXFSIZn, DIEPTXFn). Read the register into the <i>d32</i> element
570 * then read out the bits using the <i>b</i>it elements.
572 typedef union fifosize_data {
573 /** raw register data */
577 unsigned startaddr:16;
583 * This union represents the bit fields in the Non-Periodic Transmit
584 * FIFO/Queue Status Register (GNPTXSTS). Read the register into the
585 * <i>d32</i> element then read out the bits using the <i>b</i>it
588 typedef union gnptxsts_data {
589 /** raw register data */
593 unsigned nptxfspcavail:16;
594 unsigned nptxqspcavail:8;
595 /** Top of the Non-Periodic Transmit Request Queue
596 * - bit 24 - Terminate (Last entry for the selected
598 * - bits 26:25 - Token Type
600 * - 2'b01 - Zero Length OUT
601 * - 2'b10 - PING/Complete Split
602 * - 2'b11 - Channel Halt
603 * - bits 30:27 - Channel/EP Number
605 unsigned nptxqtop_terminate:1;
606 unsigned nptxqtop_token:2;
607 unsigned nptxqtop_chnep:4;
613 * This union represents the bit fields in the Transmit
614 * FIFO Status Register (DTXFSTS). Read the register into the
615 * <i>d32</i> element then read out the bits using the <i>b</i>it
618 typedef union dtxfsts_data {
619 /** raw register data */
623 unsigned txfspcavail:16;
624 unsigned reserved:16;
629 * This union represents the bit fields in the I2C Control Register
630 * (I2CCTL). Read the register into the <i>d32</i> element then read out the
631 * bits using the <i>b</i>it elements.
633 typedef union gi2cctl_data {
634 /** raw register data */
643 unsigned i2csuspctl:1;
644 unsigned i2cdevaddr:2;
645 unsigned i2cdatse0:1;
653 * This union represents the bit fields in the PHY Vendor Control Register
654 * (GPVNDCTL). Read the register into the <i>d32</i> element then read out the
655 * bits using the <i>b</i>it elements.
657 typedef union gpvndctl_data {
658 /** raw register data */
664 unsigned regaddr16_21:6;
666 unsigned reserved23_24:2;
667 unsigned newregreq:1;
670 unsigned reserved28_30:3;
671 unsigned disulpidrvr:1;
676 * This union represents the bit fields in the General Purpose
677 * Input/Output Register (GGPIO).
678 * Read the register into the <i>d32</i> element then read out the
679 * bits using the <i>b</i>it elements.
681 typedef union ggpio_data {
682 /** raw register data */
692 * This union represents the bit fields in the User ID Register
693 * (GUID). Read the register into the <i>d32</i> element then read out the
694 * bits using the <i>b</i>it elements.
696 typedef union guid_data {
697 /** raw register data */
706 * This union represents the bit fields in the Synopsys ID Register
707 * (GSNPSID). Read the register into the <i>d32</i> element then read out the
708 * bits using the <i>b</i>it elements.
710 typedef union gsnpsid_data {
711 /** raw register data */
720 * This union represents the bit fields in the User HW Config1
721 * Register. Read the register into the <i>d32</i> element then read
722 * out the bits using the <i>b</i>it elements.
724 typedef union hwcfg1_data {
725 /** raw register data */
749 * This union represents the bit fields in the User HW Config2
750 * Register. Read the register into the <i>d32</i> element then read
751 * out the bits using the <i>b</i>it elements.
753 typedef union hwcfg2_data {
754 /** raw register data */
760 #define DWC_HWCFG2_OP_MODE_HNP_SRP_CAPABLE_OTG 0
761 #define DWC_HWCFG2_OP_MODE_SRP_ONLY_CAPABLE_OTG 1
762 #define DWC_HWCFG2_OP_MODE_NO_HNP_SRP_CAPABLE_OTG 2
763 #define DWC_HWCFG2_OP_MODE_SRP_CAPABLE_DEVICE 3
764 #define DWC_HWCFG2_OP_MODE_NO_SRP_CAPABLE_DEVICE 4
765 #define DWC_HWCFG2_OP_MODE_SRP_CAPABLE_HOST 5
766 #define DWC_HWCFG2_OP_MODE_NO_SRP_CAPABLE_HOST 6
768 unsigned architecture:2;
769 unsigned point2point:1;
770 unsigned hs_phy_type:2;
771 #define DWC_HWCFG2_HS_PHY_TYPE_NOT_SUPPORTED 0
772 #define DWC_HWCFG2_HS_PHY_TYPE_UTMI 1
773 #define DWC_HWCFG2_HS_PHY_TYPE_ULPI 2
774 #define DWC_HWCFG2_HS_PHY_TYPE_UTMI_ULPI 3
776 unsigned fs_phy_type:2;
777 unsigned num_dev_ep:4;
778 unsigned num_host_chan:4;
779 unsigned perio_ep_supported:1;
780 unsigned dynamic_fifo:1;
781 unsigned multi_proc_int:1;
782 unsigned reserved21:1;
783 unsigned nonperio_tx_q_depth:2;
784 unsigned host_perio_tx_q_depth:2;
785 unsigned dev_token_q_depth:5;
786 unsigned otg_enable_ic_usb:1;
791 * This union represents the bit fields in the User HW Config3
792 * Register. Read the register into the <i>d32</i> element then read
793 * out the bits using the <i>b</i>it elements.
795 typedef union hwcfg3_data {
796 /** raw register data */
801 unsigned xfer_size_cntr_width:4;
802 unsigned packet_size_cntr_width:3;
805 unsigned vendor_ctrl_if:1;
806 unsigned optional_features:1;
807 unsigned synch_reset_type:1;
809 unsigned otg_enable_hsic:1;
810 unsigned bc_support:1;
811 unsigned otg_lpm_en:1;
812 unsigned dfifo_depth:16;
817 * This union represents the bit fields in the User HW Config4
818 * Register. Read the register into the <i>d32</i> element then read
819 * out the bits using the <i>b</i>it elements.
821 typedef union hwcfg4_data {
822 /** raw register data */
826 unsigned num_dev_perio_in_ep:4;
827 unsigned power_optimiz:1;
828 unsigned min_ahb_freq:1;
832 unsigned utmi_phy_data_width:2;
833 unsigned num_dev_mode_ctrl_ep:4;
834 unsigned iddig_filt_en:1;
835 unsigned vbus_valid_filt_en:1;
836 unsigned a_valid_filt_en:1;
837 unsigned b_valid_filt_en:1;
838 unsigned session_end_filt_en:1;
839 unsigned ded_fifo_en:1;
840 unsigned num_in_eps:4;
842 unsigned desc_dma_dyn:1;
847 * This union represents the bit fields of the Core LPM Configuration
848 * Register (GLPMCFG). Set the bits using bit fields then write
849 * the <i>d32</i> value to the register.
851 typedef union glpmctl_data {
852 /** raw register data */
856 /** LPM-Capable (LPMCap) (Device and Host)
857 * The application uses this bit to control
858 * the DWC_otg core LPM capabilities.
860 unsigned lpm_cap_en:1;
861 /** LPM response programmed by application (AppL1Res) (Device)
862 * Handshake response to LPM token pre-programmed
863 * by device application software.
865 unsigned appl_resp:1;
866 /** Host Initiated Resume Duration (HIRD) (Device and Host)
867 * In Host mode this field indicates the value of HIRD
868 * to be sent in an LPM transaction.
869 * In Device mode this field is updated with the
870 * Received LPM Token HIRD bmAttribute
871 * when an ACK/NYET/STALL response is sent
872 * to an LPM transaction.
875 /** RemoteWakeEnable (bRemoteWake) (Device and Host)
876 * In Host mode this bit indicates the value of remote
877 * wake up to be sent in wIndex field of LPM transaction.
878 * In Device mode this field is updated with the
879 * Received LPM Token bRemoteWake bmAttribute
880 * when an ACK/NYET/STALL response is sent
881 * to an LPM transaction.
883 unsigned rem_wkup_en:1;
884 /** Enable utmi_sleep_n (EnblSlpM) (Device and Host)
885 * The application uses this bit to control
886 * the utmi_sleep_n assertion to the PHY when in L1 state.
888 unsigned en_utmi_sleep:1;
889 /** HIRD Threshold (HIRD_Thres) (Device and Host)
891 unsigned hird_thres:5;
892 /** LPM Response (CoreL1Res) (Device and Host)
893 * In Host mode this bit contains handsake response to
895 * In Device mode the response of the core to
896 * LPM transaction received is reflected in these two bits.
897 - 0x0 : ERROR (No handshake response)
903 /** Port Sleep Status (SlpSts) (Device and Host)
904 * This bit is set as long as a Sleep condition
905 * is present on the USB bus.
907 unsigned prt_sleep_sts:1;
908 /** Sleep State Resume OK (L1ResumeOK) (Device and Host)
909 * Indicates that the application or host
910 * can start resume from Sleep state.
912 unsigned sleep_state_resumeok:1;
913 /** LPM channel Index (LPM_Chnl_Indx) (Host)
914 * The channel number on which the LPM transaction
915 * has to be applied while sending
916 * an LPM transaction to the local device.
918 unsigned lpm_chan_index:4;
919 /** LPM Retry Count (LPM_Retry_Cnt) (Host)
920 * Number host retries that would be performed
921 * if the device response was not valid response.
923 unsigned retry_count:3;
924 /** Send LPM Transaction (SndLPM) (Host)
925 * When set by application software,
926 * an LPM transaction containing two tokens
930 /** LPM Retry status (LPM_RetryCnt_Sts) (Host)
931 * Number of LPM Host Retries still remaining
932 * to be transmitted for the current LPM sequence
934 unsigned retry_count_sts:3;
935 /** Enable Best Effort Service Latency (BESL) (Device and Host)
936 * This bit enables the BESL features as defined in the LPM errata
940 unsigned reserved29:1;
941 /** In host mode once this bit is set, the host
942 * configures to drive the HSIC Idle state on the bus.
943 * It then waits for the device to initiate the Connect sequence.
944 * In device mode once this bit is set, the device waits for
945 * the HSIC Idle line state on the bus. Upon receving the Idle
946 * line state, it initiates the HSIC Connect sequence.
948 unsigned hsic_connect:1;
949 /** This bit overrides and functionally inverts
950 * the if_select_hsic input port signal.
952 unsigned inv_sel_hsic:1;
957 * This union represents the bit fields of the Core ADP Timer, Control and
958 * Status Register (ADPTIMCTLSTS). Set the bits using bit fields then write
959 * the <i>d32</i> value to the register.
961 typedef union adpctl_data {
962 /** raw register data */
966 /** Probe Discharge (PRB_DSCHG)
967 * These bits set the times for TADP_DSCHG.
968 * These bits are defined as follows:
974 unsigned prb_dschg:2;
975 /** Probe Delta (PRB_DELTA)
976 * These bits set the resolution for RTIM value.
977 * The bits are defined in units of 32 kHz clock cycles as follows:
982 * For example if this value is chosen to 2'b01, it means that RTIM
983 * increments for every 3(three) 32Khz clock cycles.
985 unsigned prb_delta:2;
986 /** Probe Period (PRB_PER)
987 * These bits sets the TADP_PRD as shown in Figure 4 as follows:
988 * 2'b00 - 0.625 to 0.925 sec (typical 0.775 sec)
989 * 2'b01 - 1.25 to 1.85 sec (typical 1.55 sec)
990 * 2'b10 - 1.9 to 2.6 sec (typical 2.275 sec)
994 /** These bits capture the latest time it took for VBUS to ramp from
995 * VADP_SINK to VADP_PRB.
1000 * 0x7FF - 2048 cycles
1001 * A time of 1024 cycles at 32 kHz corresponds to a time of 32 msec.
1004 /** Enable Probe (EnaPrb)
1005 * When programmed to 1'b1, the core performs a probe operation.
1006 * This bit is valid only if OTG_Ver = 1'b1.
1009 /** Enable Sense (EnaSns)
1010 * When programmed to 1'b1, the core performs a Sense operation.
1011 * This bit is valid only if OTG_Ver = 1'b1.
1014 /** ADP Reset (ADPRes)
1015 * When set, ADP controller is reset.
1016 * This bit is valid only if OTG_Ver = 1'b1.
1019 /** ADP Enable (ADPEn)
1020 * When set, the core performs either ADP probing or sensing
1021 * based on EnaPrb or EnaSns.
1022 * This bit is valid only if OTG_Ver = 1'b1.
1025 /** ADP Probe Interrupt (ADP_PRB_INT)
1026 * When this bit is set, it means that the VBUS
1027 * voltage is greater than VADP_PRB or VADP_PRB is reached.
1028 * This bit is valid only if OTG_Ver = 1'b1.
1030 unsigned adp_prb_int:1;
1032 * ADP Sense Interrupt (ADP_SNS_INT)
1033 * When this bit is set, it means that the VBUS voltage is greater than
1034 * VADP_SNS value or VADP_SNS is reached.
1035 * This bit is valid only if OTG_Ver = 1'b1.
1037 unsigned adp_sns_int:1;
1038 /** ADP Tomeout Interrupt (ADP_TMOUT_INT)
1039 * This bit is relevant only for an ADP probe.
1040 * When this bit is set, it means that the ramp time has
1041 * completed ie ADPCTL.RTIM has reached its terminal value
1042 * of 0x7FF. This is a debug feature that allows software
1043 * to read the ramp time after each cycle.
1044 * This bit is valid only if OTG_Ver = 1'b1.
1046 unsigned adp_tmout_int:1;
1047 /** ADP Probe Interrupt Mask (ADP_PRB_INT_MSK)
1048 * When this bit is set, it unmasks the interrupt due to ADP_PRB_INT.
1049 * This bit is valid only if OTG_Ver = 1'b1.
1051 unsigned adp_prb_int_msk:1;
1052 /** ADP Sense Interrupt Mask (ADP_SNS_INT_MSK)
1053 * When this bit is set, it unmasks the interrupt due to ADP_SNS_INT.
1054 * This bit is valid only if OTG_Ver = 1'b1.
1056 unsigned adp_sns_int_msk:1;
1057 /** ADP Timoeout Interrupt Mask (ADP_TMOUT_MSK)
1058 * When this bit is set, it unmasks the interrupt due to ADP_TMOUT_INT.
1059 * This bit is valid only if OTG_Ver = 1'b1.
1061 unsigned adp_tmout_int_msk:1;
1063 * 2'b00 - Read/Write Valid (updated by the core)
1070 unsigned reserved29_31:3;
1076 * Device Global Registers. <i>Offsets 800h-BFFh</i>
1078 * The following structures define the size and relative field offsets
1079 * for the Device Mode Registers.
1081 * <i>These registers are visible only in Device mode and must not be
1082 * accessed in Host mode, as the results are unknown.</i>
1084 typedef struct dwc_otg_dev_global_regs {
1085 /** Device Configuration Register. <i>Offset 800h</i> */
1086 volatile uint32_t dcfg;
1087 /** Device Control Register. <i>Offset: 804h</i> */
1088 volatile uint32_t dctl;
1089 /** Device Status Register (Read Only). <i>Offset: 808h</i> */
1090 volatile uint32_t dsts;
1091 /** Reserved. <i>Offset: 80Ch</i> */
1093 /** Device IN Endpoint Common Interrupt Mask
1094 * Register. <i>Offset: 810h</i> */
1095 volatile uint32_t diepmsk;
1096 /** Device OUT Endpoint Common Interrupt Mask
1097 * Register. <i>Offset: 814h</i> */
1098 volatile uint32_t doepmsk;
1099 /** Device All Endpoints Interrupt Register. <i>Offset: 818h</i> */
1100 volatile uint32_t daint;
1101 /** Device All Endpoints Interrupt Mask Register. <i>Offset:
1103 volatile uint32_t daintmsk;
1104 /** Device IN Token Queue Read Register-1 (Read Only).
1105 * <i>Offset: 820h</i> */
1106 volatile uint32_t dtknqr1;
1107 /** Device IN Token Queue Read Register-2 (Read Only).
1108 * <i>Offset: 824h</i> */
1109 volatile uint32_t dtknqr2;
1110 /** Device VBUS discharge Register. <i>Offset: 828h</i> */
1111 volatile uint32_t dvbusdis;
1112 /** Device VBUS Pulse Register. <i>Offset: 82Ch</i> */
1113 volatile uint32_t dvbuspulse;
1114 /** Device IN Token Queue Read Register-3 (Read Only). /
1115 * Device Thresholding control register (Read/Write)
1116 * <i>Offset: 830h</i> */
1117 volatile uint32_t dtknqr3_dthrctl;
1118 /** Device IN Token Queue Read Register-4 (Read Only). /
1119 * Device IN EPs empty Inr. Mask Register (Read/Write)
1120 * <i>Offset: 834h</i> */
1121 volatile uint32_t dtknqr4_fifoemptymsk;
1122 /** Device Each Endpoint Interrupt Register (Read Only). /
1123 * <i>Offset: 838h</i> */
1124 volatile uint32_t deachint;
1125 /** Device Each Endpoint Interrupt mask Register (Read/Write). /
1126 * <i>Offset: 83Ch</i> */
1127 volatile uint32_t deachintmsk;
1128 /** Device Each In Endpoint Interrupt mask Register (Read/Write). /
1129 * <i>Offset: 840h</i> */
1130 volatile uint32_t diepeachintmsk[MAX_EPS_CHANNELS];
1131 /** Device Each Out Endpoint Interrupt mask Register (Read/Write). /
1132 * <i>Offset: 880h</i> */
1133 volatile uint32_t doepeachintmsk[MAX_EPS_CHANNELS];
1134 } dwc_otg_device_global_regs_t;
1137 * This union represents the bit fields in the Device Configuration
1138 * Register. Read the register into the <i>d32</i> member then
1139 * set/clear the bits using the <i>b</i>it elements. Write the
1140 * <i>d32</i> member to the dcfg register.
1142 typedef union dcfg_data {
1143 /** raw register data */
1145 /** register bits */
1149 /** Non Zero Length Status OUT Handshake */
1150 unsigned nzstsouthshk:1;
1151 #define DWC_DCFG_SEND_STALL 1
1153 unsigned ena32khzs:1;
1154 /** Device Addresses */
1156 /** Periodic Frame Interval */
1157 unsigned perfrint:2;
1158 #define DWC_DCFG_FRAME_INTERVAL_80 0
1159 #define DWC_DCFG_FRAME_INTERVAL_85 1
1160 #define DWC_DCFG_FRAME_INTERVAL_90 2
1161 #define DWC_DCFG_FRAME_INTERVAL_95 3
1163 /** Enable Device OUT NAK for bulk in DDMA mode */
1164 unsigned endevoutnak:1;
1166 unsigned reserved14_17:4;
1167 /** In Endpoint Mis-match count */
1169 /** Enable Descriptor DMA in Device mode */
1171 unsigned perschintvl:2;
1172 unsigned resvalid:6;
1177 * This union represents the bit fields in the Device Control
1178 * Register. Read the register into the <i>d32</i> member then
1179 * set/clear the bits using the <i>b</i>it elements.
1181 typedef union dctl_data {
1182 /** raw register data */
1184 /** register bits */
1186 /** Remote Wakeup */
1187 unsigned rmtwkupsig:1;
1188 /** Soft Disconnect */
1189 unsigned sftdiscon:1;
1190 /** Global Non-Periodic IN NAK Status */
1191 unsigned gnpinnaksts:1;
1192 /** Global OUT NAK Status */
1193 unsigned goutnaksts:1;
1196 /** Set Global Non-Periodic IN NAK */
1197 unsigned sgnpinnak:1;
1198 /** Clear Global Non-Periodic IN NAK */
1199 unsigned cgnpinnak:1;
1200 /** Set Global OUT NAK */
1201 unsigned sgoutnak:1;
1202 /** Clear Global OUT NAK */
1203 unsigned cgoutnak:1;
1204 /** Power-On Programming Done */
1205 unsigned pwronprgdone:1;
1207 unsigned reserved:1;
1208 /** Global Multi Count */
1210 /** Ignore Frame Number for ISOC EPs */
1212 /** NAK on Babble */
1213 unsigned nakonbble:1;
1214 /** Enable Continue on BNA */
1215 unsigned encontonbna:1;
1216 /** Enable deep sleep besl reject feature*/
1217 unsigned besl_reject:1;
1219 unsigned reserved17_31:13;
1224 * This union represents the bit fields in the Device Status
1225 * Register. Read the register into the <i>d32</i> member then
1226 * set/clear the bits using the <i>b</i>it elements.
1228 typedef union dsts_data {
1229 /** raw register data */
1231 /** register bits */
1233 /** Suspend Status */
1235 /** Enumerated Speed */
1237 #define DWC_DSTS_ENUMSPD_HS_PHY_30MHZ_OR_60MHZ 0
1238 #define DWC_DSTS_ENUMSPD_FS_PHY_30MHZ_OR_60MHZ 1
1239 #define DWC_DSTS_ENUMSPD_LS_PHY_6MHZ 2
1240 #define DWC_DSTS_ENUMSPD_FS_PHY_48MHZ 3
1241 /** Erratic Error */
1242 unsigned errticerr:1;
1243 unsigned reserved4_7:4;
1244 /** Frame or Microframe Number of the received SOF */
1246 unsigned reserved22_31:10;
1251 * This union represents the bit fields in the Device IN EP Interrupt
1252 * Register and the Device IN EP Common Mask Register.
1254 * - Read the register into the <i>d32</i> member then set/clear the
1255 * bits using the <i>b</i>it elements.
1257 typedef union diepint_data {
1258 /** raw register data */
1260 /** register bits */
1262 /** Transfer complete mask */
1263 unsigned xfercompl:1;
1264 /** Endpoint disable mask */
1265 unsigned epdisabled:1;
1266 /** AHB Error mask */
1268 /** TimeOUT Handshake mask (non-ISOC EPs) */
1270 /** IN Token received with TxF Empty mask */
1271 unsigned intktxfemp:1;
1272 /** IN Token Received with EP mismatch mask */
1273 unsigned intknepmis:1;
1274 /** IN Endpoint NAK Effective mask */
1275 unsigned inepnakeff:1;
1277 unsigned emptyintr:1;
1279 unsigned txfifoundrn:1;
1281 /** BNA Interrupt mask */
1284 unsigned reserved10_12:3;
1285 /** BNA Interrupt mask */
1288 unsigned reserved14_31:18;
1293 * This union represents the bit fields in the Device IN EP
1294 * Common/Dedicated Interrupt Mask Register.
1296 typedef union diepint_data diepmsk_data_t;
1299 * This union represents the bit fields in the Device OUT EP Interrupt
1300 * Registerand Device OUT EP Common Interrupt Mask Register.
1302 * - Read the register into the <i>d32</i> member then set/clear the
1303 * bits using the <i>b</i>it elements.
1305 typedef union doepint_data {
1306 /** raw register data */
1308 /** register bits */
1310 /** Transfer complete */
1311 unsigned xfercompl:1;
1312 /** Endpoint disable */
1313 unsigned epdisabled:1;
1316 /** Setup Phase Done (contorl EPs) */
1318 /** OUT Token Received when Endpoint Disabled */
1319 unsigned outtknepdis:1;
1321 unsigned stsphsercvd:1;
1322 /** Back-to-Back SETUP Packets Received */
1323 unsigned back2backsetup:1;
1325 unsigned reserved7:1;
1326 /** OUT packet Error */
1327 unsigned outpkterr:1;
1328 /** BNA Interrupt */
1331 unsigned reserved10:1;
1332 /** Packet Drop Status */
1333 unsigned pktdrpsts:1;
1334 /** Babble Interrupt */
1336 /** NAK Interrupt */
1338 /** NYET Interrupt */
1340 /** Bit indicating setup packet received */
1343 unsigned reserved16_31:16;
1348 * This union represents the bit fields in the Device OUT EP
1349 * Common/Dedicated Interrupt Mask Register.
1351 typedef union doepint_data doepmsk_data_t;
1354 * This union represents the bit fields in the Device All EP Interrupt
1355 * and Mask Registers.
1356 * - Read the register into the <i>d32</i> member then set/clear the
1357 * bits using the <i>b</i>it elements.
1359 typedef union daint_data {
1360 /** raw register data */
1362 /** register bits */
1364 /** IN Endpoint bits */
1366 /** OUT Endpoint bits */
1370 /** IN Endpoint bits */
1387 /** OUT Endpoint bits */
1408 * This union represents the bit fields in the Device IN Token Queue
1410 * - Read the register into the <i>d32</i> member.
1411 * - READ-ONLY Register
1413 typedef union dtknq1_data {
1414 /** raw register data */
1416 /** register bits */
1418 /** In Token Queue Write Pointer */
1419 unsigned intknwptr:5;
1421 unsigned reserved05_06:2;
1422 /** write pointer has wrapped. */
1423 unsigned wrap_bit:1;
1424 /** EP Numbers of IN Tokens 0 ... 4 */
1425 unsigned epnums0_5:24;
1430 * This union represents Threshold control Register
1431 * - Read and write the register into the <i>d32</i> member.
1432 * - READ-WRITABLE Register
1434 typedef union dthrctl_data {
1435 /** raw register data */
1437 /** register bits */
1439 /** non ISO Tx Thr. Enable */
1440 unsigned non_iso_thr_en:1;
1441 /** ISO Tx Thr. Enable */
1442 unsigned iso_thr_en:1;
1443 /** Tx Thr. Length */
1444 unsigned tx_thr_len:9;
1445 /** AHB Threshold ratio */
1446 unsigned ahb_thr_ratio:2;
1448 unsigned reserved13_15:3;
1449 /** Rx Thr. Enable */
1450 unsigned rx_thr_en:1;
1451 /** Rx Thr. Length */
1452 unsigned rx_thr_len:9;
1453 unsigned reserved26:1;
1454 /** Arbiter Parking Enable*/
1455 unsigned arbprken:1;
1457 unsigned reserved28_31:4;
1462 * Device Logical IN Endpoint-Specific Registers. <i>Offsets
1465 * There will be one set of endpoint registers per logical endpoint
1468 * <i>These registers are visible only in Device mode and must not be
1469 * accessed in Host mode, as the results are unknown.</i>
1471 typedef struct dwc_otg_dev_in_ep_regs {
1472 /** Device IN Endpoint Control Register. <i>Offset:900h +
1473 * (ep_num * 20h) + 00h</i> */
1474 volatile uint32_t diepctl;
1475 /** Reserved. <i>Offset:900h + (ep_num * 20h) + 04h</i> */
1476 uint32_t reserved04;
1477 /** Device IN Endpoint Interrupt Register. <i>Offset:900h +
1478 * (ep_num * 20h) + 08h</i> */
1479 volatile uint32_t diepint;
1480 /** Reserved. <i>Offset:900h + (ep_num * 20h) + 0Ch</i> */
1481 uint32_t reserved0C;
1482 /** Device IN Endpoint Transfer Size
1483 * Register. <i>Offset:900h + (ep_num * 20h) + 10h</i> */
1484 volatile uint32_t dieptsiz;
1485 /** Device IN Endpoint DMA Address Register. <i>Offset:900h +
1486 * (ep_num * 20h) + 14h</i> */
1487 volatile uint32_t diepdma;
1488 /** Device IN Endpoint Transmit FIFO Status Register. <i>Offset:900h +
1489 * (ep_num * 20h) + 18h</i> */
1490 volatile uint32_t dtxfsts;
1491 /** Device IN Endpoint DMA Buffer Register. <i>Offset:900h +
1492 * (ep_num * 20h) + 1Ch</i> */
1493 volatile uint32_t diepdmab;
1494 } dwc_otg_dev_in_ep_regs_t;
1497 * Device Logical OUT Endpoint-Specific Registers. <i>Offsets:
1500 * There will be one set of endpoint registers per logical endpoint
1503 * <i>These registers are visible only in Device mode and must not be
1504 * accessed in Host mode, as the results are unknown.</i>
1506 typedef struct dwc_otg_dev_out_ep_regs {
1507 /** Device OUT Endpoint Control Register. <i>Offset:B00h +
1508 * (ep_num * 20h) + 00h</i> */
1509 volatile uint32_t doepctl;
1510 /** Reserved. <i>Offset:B00h + (ep_num * 20h) + 04h</i> */
1511 uint32_t reserved04;
1512 /** Device OUT Endpoint Interrupt Register. <i>Offset:B00h +
1513 * (ep_num * 20h) + 08h</i> */
1514 volatile uint32_t doepint;
1515 /** Reserved. <i>Offset:B00h + (ep_num * 20h) + 0Ch</i> */
1516 uint32_t reserved0C;
1517 /** Device OUT Endpoint Transfer Size Register. <i>Offset:
1518 * B00h + (ep_num * 20h) + 10h</i> */
1519 volatile uint32_t doeptsiz;
1520 /** Device OUT Endpoint DMA Address Register. <i>Offset:B00h
1521 * + (ep_num * 20h) + 14h</i> */
1522 volatile uint32_t doepdma;
1523 /** Reserved. <i>Offset:B00h + * (ep_num * 20h) + 18h</i> */
1525 /** Device OUT Endpoint DMA Buffer Register. <i>Offset:B00h
1526 * + (ep_num * 20h) + 1Ch</i> */
1528 } dwc_otg_dev_out_ep_regs_t;
1531 * This union represents the bit fields in the Device EP Control
1532 * Register. Read the register into the <i>d32</i> member then
1533 * set/clear the bits using the <i>b</i>it elements.
1535 typedef union depctl_data {
1536 /** raw register data */
1538 /** register bits */
1540 /** Maximum Packet Size
1542 * IN/OUT EP0 - 2 bits
1548 #define DWC_DEP0CTL_MPS_64 0
1549 #define DWC_DEP0CTL_MPS_32 1
1550 #define DWC_DEP0CTL_MPS_16 2
1551 #define DWC_DEP0CTL_MPS_8 3
1555 * OUT EPn/OUT EP0 - reserved */
1558 /** USB Active Endpoint */
1559 unsigned usbactep:1;
1561 /** Endpoint DPID (INTR/Bulk IN and OUT endpoints)
1562 * This field contains the PID of the packet going to
1563 * be received or transmitted on this endpoint. The
1564 * application should program the PID of the first
1565 * packet going to be received or transmitted on this
1566 * endpoint , after the endpoint is
1567 * activated. Application use the SetD1PID and
1568 * SetD0PID fields of this register to program either
1571 * The encoding for this field is
1582 * 2'b01: Isochronous
1584 * 2'b11: Interrupt */
1589 * IN EPn/IN EP0 - reserved */
1592 /** Stall Handshake */
1597 * OUT EPn/OUT EP0 - reserved */
1604 /** Set DATA0 PID (INTR/Bulk IN and OUT endpoints)
1605 * Writing to this field sets the Endpoint DPID (DPID)
1606 * field in this register to DATA0. Set Even
1607 * (micro)frame (SetEvenFr) (ISO IN and OUT Endpoints)
1608 * Writing to this field sets the Even/Odd
1609 * (micro)frame (EO_FrNum) field to even (micro)
1612 unsigned setd0pid:1;
1613 /** Set DATA1 PID (INTR/Bulk IN and OUT endpoints)
1614 * Writing to this field sets the Endpoint DPID (DPID)
1615 * field in this register to DATA1 Set Odd
1616 * (micro)frame (SetOddFr) (ISO IN and OUT Endpoints)
1617 * Writing to this field sets the Even/Odd
1618 * (micro)frame (EO_FrNum) field to odd (micro) frame.
1620 unsigned setd1pid:1;
1622 /** Endpoint Disable */
1624 /** Endpoint Enable */
1630 * This union represents the bit fields in the Device EP Transfer
1631 * Size Register. Read the register into the <i>d32</i> member then
1632 * set/clear the bits using the <i>b</i>it elements.
1634 typedef union deptsiz_data {
1635 /** raw register data */
1637 /** register bits */
1639 /** Transfer size */
1640 unsigned xfersize:19;
1641 /** Max packet count for EP (pow(2,10)-1) */
1642 #define MAX_PKT_CNT 1023
1645 /** Multi Count - Periodic IN endpoints */
1647 unsigned reserved:1;
1652 * This union represents the bit fields in the Device EP 0 Transfer
1653 * Size Register. Read the register into the <i>d32</i> member then
1654 * set/clear the bits using the <i>b</i>it elements.
1656 typedef union deptsiz0_data {
1657 /** raw register data */
1659 /** register bits */
1661 /** Transfer size */
1662 unsigned xfersize:7;
1664 unsigned reserved7_18:12;
1668 unsigned reserved21_28:8;
1669 /**Setup Packet Count (DOEPTSIZ0 Only) */
1671 unsigned reserved31;
1675 /* DMA Descriptor Specific Structures */
1677 /** Buffer status definitions */
1679 #define BS_HOST_READY 0x0
1680 #define BS_DMA_BUSY 0x1
1681 #define BS_DMA_DONE 0x2
1682 #define BS_HOST_BUSY 0x3
1684 /** Receive/Transmit status definitions */
1686 #define RTS_SUCCESS 0x0
1687 #define RTS_BUFFLUSH 0x1
1688 #define RTS_RESERVED 0x2
1689 #define RTS_BUFERR 0x3
1692 * This union represents the bit fields in the DMA Descriptor
1693 * status quadlet. Read the quadlet into the <i>d32</i> member then
1694 * set/clear the bits using the <i>b</i>it, <i>b_iso_out</i> and
1695 * <i>b_iso_in</i> elements.
1697 typedef union dev_dma_desc_sts {
1698 /** raw register data */
1702 /** Received number of bytes */
1704 /** NAK bit - only for OUT EPs */
1706 unsigned reserved17_22:6;
1707 /** Multiple Transfer - only for OUT EPs */
1709 /** Setup Packet received - only for OUT EPs */
1711 /** Interrupt On Complete */
1717 /** Receive Status */
1719 /** Buffer Status */
1723 /* #ifdef DWC_EN_ISOC */
1724 /** iso out quadlet bits */
1726 /** Received number of bytes */
1727 unsigned rxbytes:11;
1729 unsigned reserved11:1;
1731 unsigned framenum:11;
1732 /** Received ISO Data PID */
1734 /** Interrupt On Complete */
1740 /** Receive Status */
1742 /** Buffer Status */
1746 /** iso in quadlet bits */
1748 /** Transmited number of bytes */
1749 unsigned txbytes:12;
1751 unsigned framenum:11;
1752 /** Transmited ISO Data PID */
1754 /** Interrupt On Complete */
1760 /** Transmit Status */
1762 /** Buffer Status */
1765 /* #endif */ /* DWC_EN_ISOC */
1766 } dev_dma_desc_sts_t;
1769 * DMA Descriptor structure
1771 * DMA Descriptor structure contains two quadlets:
1772 * Status quadlet and Data buffer pointer.
1774 typedef struct dwc_otg_dev_dma_desc {
1775 /** DMA Descriptor status quadlet */
1776 dev_dma_desc_sts_t status;
1777 /** DMA Descriptor data buffer pointer */
1779 } dwc_otg_dev_dma_desc_t;
1782 * The dwc_otg_dev_if structure contains information needed to manage
1783 * the DWC_otg controller acting in device mode. It represents the
1784 * programming view of the device-specific aspects of the controller.
1786 typedef struct dwc_otg_dev_if {
1787 /** Pointer to device Global registers.
1788 * Device Global Registers starting at offset 800h
1790 dwc_otg_device_global_regs_t *dev_global_regs;
1791 #define DWC_DEV_GLOBAL_REG_OFFSET 0x800
1794 * Device Logical IN Endpoint-Specific Registers 900h-AFCh
1796 dwc_otg_dev_in_ep_regs_t *in_ep_regs[MAX_EPS_CHANNELS];
1797 #define DWC_DEV_IN_EP_REG_OFFSET 0x900
1798 #define DWC_EP_REG_OFFSET 0x20
1800 /** Device Logical OUT Endpoint-Specific Registers B00h-CFCh */
1801 dwc_otg_dev_out_ep_regs_t *out_ep_regs[MAX_EPS_CHANNELS];
1802 #define DWC_DEV_OUT_EP_REG_OFFSET 0xB00
1804 /* Device configuration information */
1805 uint8_t speed; /**< Device Speed 0: Unknown, 1: LS, 2:FS, 3: HS */
1806 uint8_t num_in_eps; /**< Number # of Tx EP range: 0-15 exept ep0 */
1807 uint8_t num_out_eps; /**< Number # of Rx EP range: 0-15 exept ep 0*/
1809 /** Size of periodic FIFOs (Bytes) */
1810 uint16_t perio_tx_fifo_size[MAX_PERIO_FIFOS];
1812 /** Size of Tx FIFOs (Bytes) */
1813 uint16_t tx_fifo_size[MAX_TX_FIFOS];
1815 /** Thresholding enable flags and length varaiables **/
1817 uint16_t iso_tx_thr_en;
1818 uint16_t non_iso_tx_thr_en;
1820 uint16_t rx_thr_length;
1821 uint16_t tx_thr_length;
1824 * Pointers to the DMA Descriptors for EP0 Control
1825 * transfers (virtual and physical)
1828 /** 2 descriptors for SETUP packets */
1829 dwc_dma_t dma_setup_desc_addr[2];
1830 dwc_otg_dev_dma_desc_t *setup_desc_addr[2];
1832 /** Pointer to Descriptor with latest SETUP packet */
1833 dwc_otg_dev_dma_desc_t *psetup;
1835 /** Index of current SETUP handler descriptor */
1836 uint32_t setup_desc_index;
1838 /** Descriptor for Data In or Status In phases */
1839 dwc_dma_t dma_in_desc_addr;
1840 dwc_otg_dev_dma_desc_t *in_desc_addr;
1842 /** Descriptor for Data Out or Status Out phases */
1843 dwc_dma_t dma_out_desc_addr;
1844 dwc_otg_dev_dma_desc_t *out_desc_addr;
1846 /** Setup Packet Detected - if set clear NAK when queueing */
1848 /** Isoc ep pointer on which incomplete happens */
1854 * Host Mode Register Structures
1855 * The Host Global Registers structure defines the size and relative
1856 * field offsets for the Host Mode Global Registers. Host Global
1857 * Registers offsets 400h-7FFh.
1859 typedef struct dwc_otg_host_global_regs {
1860 /** Host Configuration Register. <i>Offset: 400h</i> */
1861 volatile uint32_t hcfg;
1862 /** Host Frame Interval Register. <i>Offset: 404h</i> */
1863 volatile uint32_t hfir;
1864 /** Host Frame Number / Frame Remaining Register. <i>Offset: 408h</i> */
1865 volatile uint32_t hfnum;
1866 /** Reserved. <i>Offset: 40Ch</i> */
1867 uint32_t reserved40C;
1868 /** Host Periodic Transmit FIFO/ Queue Status Register. <i>Offset: 410h</i> */
1869 volatile uint32_t hptxsts;
1870 /** Host All Channels Interrupt Register. <i>Offset: 414h</i> */
1871 volatile uint32_t haint;
1872 /** Host All Channels Interrupt Mask Register. <i>Offset: 418h</i> */
1873 volatile uint32_t haintmsk;
1874 /** Host Frame List Base Address Register . <i>Offset: 41Ch</i> */
1875 volatile uint32_t hflbaddr;
1876 } dwc_otg_host_global_regs_t;
1879 * This union represents the bit fields in the Host Configuration Register.
1880 * Read the register into the <i>d32</i> member then set/clear the bits using
1881 * the <i>b</i>it elements. Write the <i>d32</i> member to the hcfg register.
1883 typedef union hcfg_data {
1884 /** raw register data */
1887 /** register bits */
1889 /** FS/LS Phy Clock Select */
1890 unsigned fslspclksel:2;
1891 #define DWC_HCFG_30_60_MHZ 0
1892 #define DWC_HCFG_48_MHZ 1
1893 #define DWC_HCFG_6_MHZ 2
1895 /** FS/LS Only Support */
1896 unsigned fslssupp:1;
1897 unsigned reserved3_6:4;
1898 /** Enable 32-KHz Suspend Mode */
1899 unsigned ena32khzs:1;
1900 /** Resume Validation Periiod */
1901 unsigned resvalid:8;
1902 unsigned reserved16_22:7;
1903 /** Enable Scatter/gather DMA in Host mode */
1905 /** Frame List Entries */
1906 unsigned frlisten:2;
1907 /** Enable Periodic Scheduling */
1908 unsigned perschedena:1;
1909 unsigned reserved27_30:4;
1910 unsigned modechtimen:1;
1915 * This union represents the bit fields in the Host Frame Remaing/Number
1918 typedef union hfir_data {
1919 /** raw register data */
1922 /** register bits */
1925 unsigned hfirrldctrl:1;
1926 unsigned reserved:15;
1931 * This union represents the bit fields in the Host Frame Remaing/Number
1934 typedef union hfnum_data {
1935 /** raw register data */
1938 /** register bits */
1941 #define DWC_HFNUM_MAX_FRNUM 0x3FFF
1946 typedef union hptxsts_data {
1947 /** raw register data */
1950 /** register bits */
1952 unsigned ptxfspcavail:16;
1953 unsigned ptxqspcavail:8;
1954 /** Top of the Periodic Transmit Request Queue
1955 * - bit 24 - Terminate (last entry for the selected channel)
1956 * - bits 26:25 - Token Type
1957 * - 2'b00 - Zero length
1960 * - bits 30:27 - Channel Number
1961 * - bit 31 - Odd/even microframe
1963 unsigned ptxqtop_terminate:1;
1964 unsigned ptxqtop_token:2;
1965 unsigned ptxqtop_chnum:4;
1966 unsigned ptxqtop_odd:1;
1971 * This union represents the bit fields in the Host Port Control and Status
1972 * Register. Read the register into the <i>d32</i> member then set/clear the
1973 * bits using the <i>b</i>it elements. Write the <i>d32</i> member to the
1976 typedef union hprt0_data {
1977 /** raw register data */
1979 /** register bits */
1981 unsigned prtconnsts:1;
1982 unsigned prtconndet:1;
1984 unsigned prtenchng:1;
1985 unsigned prtovrcurract:1;
1986 unsigned prtovrcurrchng:1;
1990 unsigned reserved9:1;
1991 unsigned prtlnsts:2;
1993 unsigned prttstctl:4;
1995 #define DWC_HPRT0_PRTSPD_HIGH_SPEED 0
1996 #define DWC_HPRT0_PRTSPD_FULL_SPEED 1
1997 #define DWC_HPRT0_PRTSPD_LOW_SPEED 2
1998 unsigned reserved19_31:13;
2003 * This union represents the bit fields in the Host All Interrupt
2006 typedef union haint_data {
2007 /** raw register data */
2009 /** register bits */
2027 unsigned reserved:16;
2032 unsigned reserved:16;
2037 * This union represents the bit fields in the Host All Interrupt
2040 typedef union haintmsk_data {
2041 /** raw register data */
2043 /** register bits */
2061 unsigned reserved:16;
2066 unsigned reserved:16;
2071 * Host Channel Specific Registers. <i>500h-5FCh</i>
2073 typedef struct dwc_otg_hc_regs {
2074 /** Host Channel 0 Characteristic Register. <i>Offset: 500h + (chan_num * 20h) + 00h</i> */
2075 volatile uint32_t hcchar;
2076 /** Host Channel 0 Split Control Register. <i>Offset: 500h + (chan_num * 20h) + 04h</i> */
2077 volatile uint32_t hcsplt;
2078 /** Host Channel 0 Interrupt Register. <i>Offset: 500h + (chan_num * 20h) + 08h</i> */
2079 volatile uint32_t hcint;
2080 /** Host Channel 0 Interrupt Mask Register. <i>Offset: 500h + (chan_num * 20h) + 0Ch</i> */
2081 volatile uint32_t hcintmsk;
2082 /** Host Channel 0 Transfer Size Register. <i>Offset: 500h + (chan_num * 20h) + 10h</i> */
2083 volatile uint32_t hctsiz;
2084 /** Host Channel 0 DMA Address Register. <i>Offset: 500h + (chan_num * 20h) + 14h</i> */
2085 volatile uint32_t hcdma;
2086 volatile uint32_t reserved;
2087 /** Host Channel 0 DMA Buffer Address Register. <i>Offset: 500h + (chan_num * 20h) + 1Ch</i> */
2088 volatile uint32_t hcdmab;
2089 } dwc_otg_hc_regs_t;
2092 * This union represents the bit fields in the Host Channel Characteristics
2093 * Register. Read the register into the <i>d32</i> member then set/clear the
2094 * bits using the <i>b</i>it elements. Write the <i>d32</i> member to the
2097 typedef union hcchar_data {
2098 /** raw register data */
2101 /** register bits */
2103 /** Maximum packet size in bytes */
2106 /** Endpoint number */
2109 /** 0: OUT, 1: IN */
2112 unsigned reserved:1;
2114 /** 0: Full/high speed device, 1: Low speed device */
2117 /** 0: Control, 1: Isoc, 2: Bulk, 3: Intr */
2120 /** Packets per frame for periodic transfers. 0 is reserved. */
2121 unsigned multicnt:2;
2123 /** Device address */
2127 * Frame to transmit periodic transaction.
2132 /** Channel disable */
2135 /** Channel enable */
2140 typedef union hcsplt_data {
2141 /** raw register data */
2144 /** register bits */
2152 /** Transaction Position */
2154 #define DWC_HCSPLIT_XACTPOS_MID 0
2155 #define DWC_HCSPLIT_XACTPOS_END 1
2156 #define DWC_HCSPLIT_XACTPOS_BEGIN 2
2157 #define DWC_HCSPLIT_XACTPOS_ALL 3
2159 /** Do Complete Split */
2160 unsigned compsplt:1;
2163 unsigned reserved:14;
2171 * This union represents the bit fields in the Host All Interrupt
2174 typedef union hcint_data {
2175 /** raw register data */
2177 /** register bits */
2179 /** Transfer Complete */
2180 unsigned xfercomp:1;
2181 /** Channel Halted */
2185 /** STALL Response Received */
2187 /** NAK Response Received */
2189 /** ACK Response Received */
2191 /** NYET Response Received */
2193 /** Transaction Err */
2197 /** Frame Overrun */
2198 unsigned frmovrun:1;
2199 /** Data Toggle Error */
2200 unsigned datatglerr:1;
2201 /** Buffer Not Available (only for DDMA mode) */
2203 /** Exessive transaction error (only for DDMA mode) */
2204 unsigned xcs_xact:1;
2205 /** Frame List Rollover interrupt */
2206 unsigned frm_list_roll:1;
2208 unsigned reserved14_31:18;
2213 * This union represents the bit fields in the Host Channel Interrupt Mask
2214 * Register. Read the register into the <i>d32</i> member then set/clear the
2215 * bits using the <i>b</i>it elements. Write the <i>d32</i> member to the
2216 * hcintmsk register.
2218 typedef union hcintmsk_data {
2219 /** raw register data */
2222 /** register bits */
2224 unsigned xfercompl:1;
2233 unsigned frmovrun:1;
2234 unsigned datatglerr:1;
2236 unsigned xcs_xact:1;
2237 unsigned frm_list_roll:1;
2238 unsigned reserved14_31:18;
2243 * This union represents the bit fields in the Host Channel Transfer Size
2244 * Register. Read the register into the <i>d32</i> member then set/clear the
2245 * bits using the <i>b</i>it elements. Write the <i>d32</i> member to the
2249 typedef union hctsiz_data {
2250 /** raw register data */
2253 /** register bits */
2255 /** Total transfer size in bytes */
2256 unsigned xfersize:19;
2258 /** Data packets to transfer */
2262 * Packet ID for next data packet
2266 * 3: MDATA (non-Control), SETUP (Control)
2269 #define DWC_HCTSIZ_DATA0 0
2270 #define DWC_HCTSIZ_DATA1 2
2271 #define DWC_HCTSIZ_DATA2 1
2272 #define DWC_HCTSIZ_MDATA 3
2273 #define DWC_HCTSIZ_SETUP 3
2275 /** Do PING protocol when 1 */
2279 /** register bits */
2281 /** Scheduling information */
2284 /** Number of transfer descriptors.
2287 * 256 only for HS isochronous endpoint.
2291 /** Data packets to transfer */
2292 unsigned reserved16_28:13;
2295 * Packet ID for next data packet
2299 * 3: MDATA (non-Control)
2303 /** Do PING protocol when 1 */
2309 * This union represents the bit fields in the Host DMA Address
2310 * Register used in Descriptor DMA mode.
2312 typedef union hcdma_data {
2313 /** raw register data */
2315 /** register bits */
2317 unsigned reserved0_2:3;
2318 /** Current Transfer Descriptor. Not used for ISOC */
2320 /** Start Address of Descriptor List */
2321 unsigned dma_addr:21;
2326 * This union represents the bit fields in the DMA Descriptor
2327 * status quadlet for host mode. Read the quadlet into the <i>d32</i> member then
2328 * set/clear the bits using the <i>b</i>it elements.
2330 typedef union host_dma_desc_sts {
2331 /** raw register data */
2335 /* for non-isochronous */
2337 /** Number of bytes */
2338 unsigned n_bytes:17;
2339 /** QTD offset to jump when Short Packet received - only for IN EPs */
2340 unsigned qtd_offset:6;
2342 * Set to request the core to jump to alternate QTD if
2343 * Short Packet received - only for IN EPs
2347 * Setup Packet bit. When set indicates that buffer contains
2351 /** Interrupt On Complete */
2355 unsigned reserved27:1;
2358 #define DMA_DESC_STS_PKTERR 1
2359 unsigned reserved30:1;
2363 /* for isochronous */
2365 /** Number of bytes */
2366 unsigned n_bytes:12;
2367 unsigned reserved12_24:13;
2368 /** Interrupt On Complete */
2370 unsigned reserved26_27:2;
2373 unsigned reserved30:1;
2377 } host_dma_desc_sts_t;
2379 #define MAX_DMA_DESC_SIZE 131071
2380 #define MAX_DMA_DESC_NUM_GENERIC 64
2381 #define MAX_DMA_DESC_NUM_HS_ISOC 256
2382 #define MAX_FRLIST_EN_NUM 64
2384 * Host-mode DMA Descriptor structure
2386 * DMA Descriptor structure contains two quadlets:
2387 * Status quadlet and Data buffer pointer.
2389 typedef struct dwc_otg_host_dma_desc {
2390 /** DMA Descriptor status quadlet */
2391 host_dma_desc_sts_t status;
2392 /** DMA Descriptor data buffer pointer */
2394 } dwc_otg_host_dma_desc_t;
2396 /** OTG Host Interface Structure.
2398 * The OTG Host Interface Structure structure contains information
2399 * needed to manage the DWC_otg controller acting in host mode. It
2400 * represents the programming view of the host-specific aspects of the
2403 typedef struct dwc_otg_host_if {
2404 /** Host Global Registers starting at offset 400h.*/
2405 dwc_otg_host_global_regs_t *host_global_regs;
2406 #define DWC_OTG_HOST_GLOBAL_REG_OFFSET 0x400
2408 /** Host Port 0 Control and Status Register */
2409 volatile uint32_t *hprt0;
2410 #define DWC_OTG_HOST_PORT_REGS_OFFSET 0x440
2412 /** Host Channel Specific Registers at offsets 500h-5FCh. */
2413 dwc_otg_hc_regs_t *hc_regs[MAX_EPS_CHANNELS];
2414 #define DWC_OTG_HOST_CHAN_REGS_OFFSET 0x500
2415 #define DWC_OTG_CHAN_REGS_OFFSET 0x20
2417 /* Host configuration information */
2418 /** Number of Host Channels (range: 1-16) */
2419 uint8_t num_host_channels;
2420 /** Periodic EPs supported (0: no, 1: yes) */
2421 uint8_t perio_eps_supported;
2422 /** Periodic Tx FIFO Size (Only 1 host periodic Tx FIFO) */
2423 uint16_t perio_tx_fifo_size;
2425 } dwc_otg_host_if_t;
2428 * This union represents the bit fields in the Power and Clock Gating Control
2429 * Register. Read the register into the <i>d32</i> member then set/clear the
2430 * bits using the <i>b</i>it elements.
2432 typedef union pcgcctl_data {
2433 /** raw register data */
2436 /** register bits */
2439 unsigned stoppclk:1;
2441 unsigned gatehclk:1;
2444 /** Reset Power Down Modules */
2445 unsigned rstpdwnmodule:1;
2447 unsigned reserved:1;
2448 /** Enable Sleep Clock Gating (Enbl_L1Gating) */
2449 unsigned enbl_sleep_gating:1;
2450 /** PHY In Sleep (PhySleep) */
2451 unsigned phy_in_sleep:1;
2453 unsigned deep_sleep:1;
2454 unsigned resetaftsusp:1;
2455 unsigned restoremode:1;
2456 unsigned enbl_extnd_hiber:1;
2457 unsigned extnd_hiber_pwrclmp:1;
2458 unsigned extnd_hiber_switch:1;
2459 unsigned ess_reg_restored:1;
2460 unsigned prt_clk_sel:2;
2461 unsigned port_power:1;
2462 unsigned max_xcvrselect:2;
2463 unsigned max_termsel:1;
2464 unsigned mac_dev_addr:7;
2465 unsigned p2hd_dev_enum_spd:2;
2466 unsigned p2hd_prt_spd:2;
2467 unsigned if_dev_mode:1;
2472 * This union represents the bit fields in the Global Data FIFO Software
2473 * Configuration Register. Read the register into the <i>d32</i> member then
2474 * set/clear the bits using the <i>b</i>it elements.
2476 typedef union gdfifocfg_data {
2477 /* raw register data */
2479 /** register bits */
2481 /** OTG Data FIFO depth */
2482 unsigned gdfifocfg:16;
2483 /** Start address of EP info controller */
2484 unsigned epinfobase:16;
2489 * This union represents the bit fields in the Global Power Down Register
2490 * Register. Read the register into the <i>d32</i> member then set/clear the
2491 * bits using the <i>b</i>it elements.
2493 typedef union gpwrdn_data {
2494 /* raw register data */
2497 /** register bits */
2499 /** PMU Interrupt Select */
2500 unsigned pmuintsel:1;
2505 /** Power Down Clamp */
2506 unsigned pwrdnclmp:1;
2507 /** Power Down Reset */
2508 unsigned pwrdnrstn:1;
2509 /** Power Down Switch */
2510 unsigned pwrdnswtch:1;
2512 unsigned dis_vbus:1;
2513 /** Line State Change */
2514 unsigned lnstschng:1;
2515 /** Line state change mask */
2516 unsigned lnstchng_msk:1;
2517 /** Reset Detected */
2519 /** Reset Detect mask */
2520 unsigned rst_det_msk:1;
2521 /** Disconnect Detected */
2522 unsigned disconn_det:1;
2523 /** Disconnect Detect mask */
2524 unsigned disconn_det_msk:1;
2525 /** Connect Detected*/
2526 unsigned connect_det:1;
2527 /** Connect Detected Mask*/
2528 unsigned connect_det_msk:1;
2531 /** SRP Detect mask */
2532 unsigned srp_det_msk:1;
2533 /** Status Change Interrupt */
2534 unsigned sts_chngint:1;
2535 /** Status Change Interrupt Mask */
2536 unsigned sts_chngint_msk:1;
2538 unsigned linestate:2;
2539 /** Indicates current mode(status of IDDIG signal) */
2541 /** B Session Valid signal status*/
2542 unsigned bsessvld:1;
2543 /** ADP Event Detected */
2545 /** Multi Valued ID pin */
2546 unsigned mult_val_id_bc:5;
2547 /** Reserved 24_31 */
2548 unsigned reserved29_31:3;