Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney...
[cascardo/linux.git] / drivers / staging / octeon-usb / cvmx-usbcx-defs.h
1 /***********************license start***************
2  * Copyright (c) 2003-2010  Cavium Networks (support@cavium.com). All rights
3  * reserved.
4  *
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *   * Redistributions of source code must retain the above copyright
11  *     notice, this list of conditions and the following disclaimer.
12  *
13  *   * Redistributions in binary form must reproduce the above
14  *     copyright notice, this list of conditions and the following
15  *     disclaimer in the documentation and/or other materials provided
16  *     with the distribution.
17
18  *   * Neither the name of Cavium Networks nor the names of
19  *     its contributors may be used to endorse or promote products
20  *     derived from this software without specific prior written
21  *     permission.
22
23  * This Software, including technical data, may be subject to U.S. export
24  * control laws, including the U.S. Export Administration Act and its associated
25  * regulations, and may be subject to export or import  regulations in other
26  * countries.
27
28  * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29  * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR
30  * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31  * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION
32  * OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33  * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34  * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35  * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36  * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE  RISK ARISING OUT OF USE OR
37  * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38  ***********************license end**************************************/
39
40
41 /**
42  * cvmx-usbcx-defs.h
43  *
44  * Configuration and status register (CSR) type definitions for
45  * Octeon usbcx.
46  *
47  */
48 #ifndef __CVMX_USBCX_TYPEDEFS_H__
49 #define __CVMX_USBCX_TYPEDEFS_H__
50
51 #define CVMX_USBCXBASE 0x00016F0010000000ull
52 #define CVMX_USBCXREG1(reg, bid) \
53         (CVMX_ADD_IO_SEG(CVMX_USBCXBASE | reg) + \
54          ((bid) & 1) * 0x100000000000ull)
55 #define CVMX_USBCXREG2(reg, bid, off) \
56         (CVMX_ADD_IO_SEG(CVMX_USBCXBASE | reg) + \
57          (((off) & 7) + ((bid) & 1) * 0x8000000000ull) * 32)
58
59 #define CVMX_USBCX_GAHBCFG(bid)         CVMX_USBCXREG1(0x008, bid)
60 #define CVMX_USBCX_GHWCFG3(bid)         CVMX_USBCXREG1(0x04c, bid)
61 #define CVMX_USBCX_GINTMSK(bid)         CVMX_USBCXREG1(0x018, bid)
62 #define CVMX_USBCX_GINTSTS(bid)         CVMX_USBCXREG1(0x014, bid)
63 #define CVMX_USBCX_GNPTXFSIZ(bid)       CVMX_USBCXREG1(0x028, bid)
64 #define CVMX_USBCX_GNPTXSTS(bid)        CVMX_USBCXREG1(0x02c, bid)
65 #define CVMX_USBCX_GOTGCTL(bid)         CVMX_USBCXREG1(0x000, bid)
66 #define CVMX_USBCX_GRSTCTL(bid)         CVMX_USBCXREG1(0x010, bid)
67 #define CVMX_USBCX_GRXFSIZ(bid)         CVMX_USBCXREG1(0x024, bid)
68 #define CVMX_USBCX_GRXSTSPH(bid)        CVMX_USBCXREG1(0x020, bid)
69 #define CVMX_USBCX_GUSBCFG(bid)         CVMX_USBCXREG1(0x00c, bid)
70 #define CVMX_USBCX_HAINT(bid)           CVMX_USBCXREG1(0x414, bid)
71 #define CVMX_USBCX_HAINTMSK(bid)        CVMX_USBCXREG1(0x418, bid)
72 #define CVMX_USBCX_HCCHARX(off, bid)    CVMX_USBCXREG2(0x500, bid, off)
73 #define CVMX_USBCX_HCFG(bid)            CVMX_USBCXREG1(0x400, bid)
74 #define CVMX_USBCX_HCINTMSKX(off, bid)  CVMX_USBCXREG2(0x50c, bid, off)
75 #define CVMX_USBCX_HCINTX(off, bid)     CVMX_USBCXREG2(0x508, bid, off)
76 #define CVMX_USBCX_HCSPLTX(off, bid)    CVMX_USBCXREG2(0x504, bid, off)
77 #define CVMX_USBCX_HCTSIZX(off, bid)    CVMX_USBCXREG2(0x510, bid, off)
78 #define CVMX_USBCX_HFIR(bid)            CVMX_USBCXREG1(0x404, bid)
79 #define CVMX_USBCX_HFNUM(bid)           CVMX_USBCXREG1(0x408, bid)
80 #define CVMX_USBCX_HPRT(bid)            CVMX_USBCXREG1(0x440, bid)
81 #define CVMX_USBCX_HPTXFSIZ(bid)        CVMX_USBCXREG1(0x100, bid)
82 #define CVMX_USBCX_HPTXSTS(bid)         CVMX_USBCXREG1(0x410, bid)
83
84 /**
85  * cvmx_usbc#_gahbcfg
86  *
87  * Core AHB Configuration Register (GAHBCFG)
88  *
89  * This register can be used to configure the core after power-on or a change in
90  * mode of operation. This register mainly contains AHB system-related
91  * configuration parameters. The AHB is the processor interface to the O2P USB
92  * core. In general, software need not know about this interface except to
93  * program the values as specified.
94  *
95  * The application must program this register as part of the O2P USB core
96  * initialization. Do not change this register after the initial programming.
97  */
98 union cvmx_usbcx_gahbcfg {
99         uint32_t u32;
100         /**
101          * struct cvmx_usbcx_gahbcfg_s
102          * @ptxfemplvl: Periodic TxFIFO Empty Level (PTxFEmpLvl)
103          *      Software should set this bit to 0x1.
104          *      Indicates when the Periodic TxFIFO Empty Interrupt bit in the
105          *      Core Interrupt register (GINTSTS.PTxFEmp) is triggered. This
106          *      bit is used only in Slave mode.
107          *      * 1'b0: GINTSTS.PTxFEmp interrupt indicates that the Periodic
108          *      TxFIFO is half empty
109          *      * 1'b1: GINTSTS.PTxFEmp interrupt indicates that the Periodic
110          *      TxFIFO is completely empty
111          * @nptxfemplvl: Non-Periodic TxFIFO Empty Level (NPTxFEmpLvl)
112          *      Software should set this bit to 0x1.
113          *      Indicates when the Non-Periodic TxFIFO Empty Interrupt bit in
114          *      the Core Interrupt register (GINTSTS.NPTxFEmp) is triggered.
115          *      This bit is used only in Slave mode.
116          *      * 1'b0: GINTSTS.NPTxFEmp interrupt indicates that the Non-
117          *      Periodic TxFIFO is half empty
118          *      * 1'b1: GINTSTS.NPTxFEmp interrupt indicates that the Non-
119          *      Periodic TxFIFO is completely empty
120          * @dmaen: DMA Enable (DMAEn)
121          *      * 1'b0: Core operates in Slave mode
122          *      * 1'b1: Core operates in a DMA mode
123          * @hbstlen: Burst Length/Type (HBstLen)
124          *      This field has not effect and should be left as 0x0.
125          * @glblintrmsk: Global Interrupt Mask (GlblIntrMsk)
126          *      Software should set this field to 0x1.
127          *      The application uses this bit to mask or unmask the interrupt
128          *      line assertion to itself. Irrespective of this bit's setting,
129          *      the interrupt status registers are updated by the core.
130          *      * 1'b0: Mask the interrupt assertion to the application.
131          *      * 1'b1: Unmask the interrupt assertion to the application.
132          */
133         struct cvmx_usbcx_gahbcfg_s {
134                 uint32_t reserved_9_31  : 23;
135                 uint32_t ptxfemplvl     : 1;
136                 uint32_t nptxfemplvl    : 1;
137                 uint32_t reserved_6_6   : 1;
138                 uint32_t dmaen          : 1;
139                 uint32_t hbstlen        : 4;
140                 uint32_t glblintrmsk    : 1;
141         } s;
142 };
143
144 /**
145  * cvmx_usbc#_ghwcfg3
146  *
147  * User HW Config3 Register (GHWCFG3)
148  *
149  * This register contains the configuration options of the O2P USB core.
150  */
151 union cvmx_usbcx_ghwcfg3 {
152         uint32_t u32;
153         /**
154          * struct cvmx_usbcx_ghwcfg3_s
155          * @dfifodepth: DFIFO Depth (DfifoDepth)
156          *      This value is in terms of 32-bit words.
157          *      * Minimum value is 32
158          *      * Maximum value is 32768
159          * @ahbphysync: AHB and PHY Synchronous (AhbPhySync)
160          *      Indicates whether AHB and PHY clocks are synchronous to
161          *      each other.
162          *      * 1'b0: No
163          *      * 1'b1: Yes
164          *      This bit is tied to 1.
165          * @rsttype: Reset Style for Clocked always Blocks in RTL (RstType)
166          *      * 1'b0: Asynchronous reset is used in the core
167          *      * 1'b1: Synchronous reset is used in the core
168          * @optfeature: Optional Features Removed (OptFeature)
169          *      Indicates whether the User ID register, GPIO interface ports,
170          *      and SOF toggle and counter ports were removed for gate count
171          *      optimization.
172          * @vendor_control_interface_support: Vendor Control Interface Support
173          *      * 1'b0: Vendor Control Interface is not available on the core.
174          *      * 1'b1: Vendor Control Interface is available.
175          * @i2c_selection: I2C Selection
176          *      * 1'b0: I2C Interface is not available on the core.
177          *      * 1'b1: I2C Interface is available on the core.
178          * @otgen: OTG Function Enabled (OtgEn)
179          *      The application uses this bit to indicate the O2P USB core's
180          *      OTG capabilities.
181          *      * 1'b0: Not OTG capable
182          *      * 1'b1: OTG Capable
183          * @pktsizewidth: Width of Packet Size Counters (PktSizeWidth)
184          *      * 3'b000: 4 bits
185          *      * 3'b001: 5 bits
186          *      * 3'b010: 6 bits
187          *      * 3'b011: 7 bits
188          *      * 3'b100: 8 bits
189          *      * 3'b101: 9 bits
190          *      * 3'b110: 10 bits
191          *      * Others: Reserved
192          * @xfersizewidth: Width of Transfer Size Counters (XferSizeWidth)
193          *      * 4'b0000: 11 bits
194          *      * 4'b0001: 12 bits
195          *      - ...
196          *      * 4'b1000: 19 bits
197          *      * Others: Reserved
198          */
199         struct cvmx_usbcx_ghwcfg3_s {
200                 uint32_t dfifodepth                             : 16;
201                 uint32_t reserved_13_15                         : 3;
202                 uint32_t ahbphysync                             : 1;
203                 uint32_t rsttype                                : 1;
204                 uint32_t optfeature                             : 1;
205                 uint32_t vendor_control_interface_support       : 1;
206                 uint32_t i2c_selection                          : 1;
207                 uint32_t otgen                                  : 1;
208                 uint32_t pktsizewidth                           : 3;
209                 uint32_t xfersizewidth                          : 4;
210         } s;
211 };
212
213 /**
214  * cvmx_usbc#_gintmsk
215  *
216  * Core Interrupt Mask Register (GINTMSK)
217  *
218  * This register works with the Core Interrupt register to interrupt the
219  * application. When an interrupt bit is masked, the interrupt associated with
220  * that bit will not be generated. However, the Core Interrupt (GINTSTS)
221  * register bit corresponding to that interrupt will still be set.
222  * Mask interrupt: 1'b0, Unmask interrupt: 1'b1
223  */
224 union cvmx_usbcx_gintmsk {
225         uint32_t u32;
226         /**
227          * struct cvmx_usbcx_gintmsk_s
228          * @wkupintmsk: Resume/Remote Wakeup Detected Interrupt Mask
229          *      (WkUpIntMsk)
230          * @sessreqintmsk: Session Request/New Session Detected Interrupt Mask
231          *      (SessReqIntMsk)
232          * @disconnintmsk: Disconnect Detected Interrupt Mask (DisconnIntMsk)
233          * @conidstschngmsk: Connector ID Status Change Mask (ConIDStsChngMsk)
234          * @ptxfempmsk: Periodic TxFIFO Empty Mask (PTxFEmpMsk)
235          * @hchintmsk: Host Channels Interrupt Mask (HChIntMsk)
236          * @prtintmsk: Host Port Interrupt Mask (PrtIntMsk)
237          * @fetsuspmsk: Data Fetch Suspended Mask (FetSuspMsk)
238          * @incomplpmsk: Incomplete Periodic Transfer Mask (incomplPMsk)
239          *      Incomplete Isochronous OUT Transfer Mask
240          *      (incompISOOUTMsk)
241          * @incompisoinmsk: Incomplete Isochronous IN Transfer Mask
242          *                  (incompISOINMsk)
243          * @oepintmsk: OUT Endpoints Interrupt Mask (OEPIntMsk)
244          * @inepintmsk: IN Endpoints Interrupt Mask (INEPIntMsk)
245          * @epmismsk: Endpoint Mismatch Interrupt Mask (EPMisMsk)
246          * @eopfmsk: End of Periodic Frame Interrupt Mask (EOPFMsk)
247          * @isooutdropmsk: Isochronous OUT Packet Dropped Interrupt Mask
248          *      (ISOOutDropMsk)
249          * @enumdonemsk: Enumeration Done Mask (EnumDoneMsk)
250          * @usbrstmsk: USB Reset Mask (USBRstMsk)
251          * @usbsuspmsk: USB Suspend Mask (USBSuspMsk)
252          * @erlysuspmsk: Early Suspend Mask (ErlySuspMsk)
253          * @i2cint: I2C Interrupt Mask (I2CINT)
254          * @ulpickintmsk: ULPI Carkit Interrupt Mask (ULPICKINTMsk)
255          *      I2C Carkit Interrupt Mask (I2CCKINTMsk)
256          * @goutnakeffmsk: Global OUT NAK Effective Mask (GOUTNakEffMsk)
257          * @ginnakeffmsk: Global Non-Periodic IN NAK Effective Mask
258          *                (GINNakEffMsk)
259          * @nptxfempmsk: Non-Periodic TxFIFO Empty Mask (NPTxFEmpMsk)
260          * @rxflvlmsk: Receive FIFO Non-Empty Mask (RxFLvlMsk)
261          * @sofmsk: Start of (micro)Frame Mask (SofMsk)
262          * @otgintmsk: OTG Interrupt Mask (OTGIntMsk)
263          * @modemismsk: Mode Mismatch Interrupt Mask (ModeMisMsk)
264          */
265         struct cvmx_usbcx_gintmsk_s {
266                 uint32_t wkupintmsk             : 1;
267                 uint32_t sessreqintmsk          : 1;
268                 uint32_t disconnintmsk          : 1;
269                 uint32_t conidstschngmsk        : 1;
270                 uint32_t reserved_27_27         : 1;
271                 uint32_t ptxfempmsk             : 1;
272                 uint32_t hchintmsk              : 1;
273                 uint32_t prtintmsk              : 1;
274                 uint32_t reserved_23_23         : 1;
275                 uint32_t fetsuspmsk             : 1;
276                 uint32_t incomplpmsk            : 1;
277                 uint32_t incompisoinmsk         : 1;
278                 uint32_t oepintmsk              : 1;
279                 uint32_t inepintmsk             : 1;
280                 uint32_t epmismsk               : 1;
281                 uint32_t reserved_16_16         : 1;
282                 uint32_t eopfmsk                : 1;
283                 uint32_t isooutdropmsk          : 1;
284                 uint32_t enumdonemsk            : 1;
285                 uint32_t usbrstmsk              : 1;
286                 uint32_t usbsuspmsk             : 1;
287                 uint32_t erlysuspmsk            : 1;
288                 uint32_t i2cint                 : 1;
289                 uint32_t ulpickintmsk           : 1;
290                 uint32_t goutnakeffmsk          : 1;
291                 uint32_t ginnakeffmsk           : 1;
292                 uint32_t nptxfempmsk            : 1;
293                 uint32_t rxflvlmsk              : 1;
294                 uint32_t sofmsk                 : 1;
295                 uint32_t otgintmsk              : 1;
296                 uint32_t modemismsk             : 1;
297                 uint32_t reserved_0_0           : 1;
298         } s;
299 };
300
301 /**
302  * cvmx_usbc#_gintsts
303  *
304  * Core Interrupt Register (GINTSTS)
305  *
306  * This register interrupts the application for system-level events in the
307  * current mode of operation (Device mode or Host mode). It is shown in
308  * Interrupt. Some of the bits in this register are valid only in Host mode,
309  * while others are valid in Device mode only. This register also indicates the
310  * current mode of operation. In order to clear the interrupt status bits of
311  * type R_SS_WC, the application must write 1'b1 into the bit. The FIFO status
312  * interrupts are read only; once software reads from or writes to the FIFO
313  * while servicing these interrupts, FIFO interrupt conditions are cleared
314  * automatically.
315  */
316 union cvmx_usbcx_gintsts {
317         uint32_t u32;
318         /**
319          * struct cvmx_usbcx_gintsts_s
320          * @wkupint: Resume/Remote Wakeup Detected Interrupt (WkUpInt)
321          *      In Device mode, this interrupt is asserted when a resume is
322          *      detected on the USB. In Host mode, this interrupt is asserted
323          *      when a remote wakeup is detected on the USB.
324          *      For more information on how to use this interrupt, see "Partial
325          *      Power-Down and Clock Gating Programming Model" on
326          *      page 353.
327          * @sessreqint: Session Request/New Session Detected Interrupt
328          *              (SessReqInt)
329          *      In Host mode, this interrupt is asserted when a session request
330          *      is detected from the device. In Device mode, this interrupt is
331          *      asserted when the utmiotg_bvalid signal goes high.
332          *      For more information on how to use this interrupt, see "Partial
333          *      Power-Down and Clock Gating Programming Model" on
334          *      page 353.
335          * @disconnint: Disconnect Detected Interrupt (DisconnInt)
336          *      Asserted when a device disconnect is detected.
337          * @conidstschng: Connector ID Status Change (ConIDStsChng)
338          *      The core sets this bit when there is a change in connector ID
339          *      status.
340          * @ptxfemp: Periodic TxFIFO Empty (PTxFEmp)
341          *      Asserted when the Periodic Transmit FIFO is either half or
342          *      completely empty and there is space for at least one entry to be
343          *      written in the Periodic Request Queue. The half or completely
344          *      empty status is determined by the Periodic TxFIFO Empty Level
345          *      bit in the Core AHB Configuration register
346          *      (GAHBCFG.PTxFEmpLvl).
347          * @hchint: Host Channels Interrupt (HChInt)
348          *      The core sets this bit to indicate that an interrupt is pending
349          *      on one of the channels of the core (in Host mode). The
350          *      application must read the Host All Channels Interrupt (HAINT)
351          *      register to determine the exact number of the channel on which
352          *      the interrupt occurred, and then read the corresponding Host
353          *      Channel-n Interrupt (HCINTn) register to determine the exact
354          *      cause of the interrupt. The application must clear the
355          *      appropriate status bit in the HCINTn register to clear this bit.
356          * @prtint: Host Port Interrupt (PrtInt)
357          *      The core sets this bit to indicate a change in port status of
358          *      one of the O2P USB core ports in Host mode. The application must
359          *      read the Host Port Control and Status (HPRT) register to
360          *      determine the exact event that caused this interrupt. The
361          *      application must clear the appropriate status bit in the Host
362          *      Port Control and Status register to clear this bit.
363          * @fetsusp: Data Fetch Suspended (FetSusp)
364          *      This interrupt is valid only in DMA mode. This interrupt
365          *      indicates that the core has stopped fetching data for IN
366          *      endpoints due to the unavailability of TxFIFO space or Request
367          *      Queue space. This interrupt is used by the application for an
368          *      endpoint mismatch algorithm.
369          * @incomplp: Incomplete Periodic Transfer (incomplP)
370          *      In Host mode, the core sets this interrupt bit when there are
371          *      incomplete periodic transactions still pending which are
372          *      scheduled for the current microframe.
373          *      Incomplete Isochronous OUT Transfer (incompISOOUT)
374          *      The Device mode, the core sets this interrupt to indicate that
375          *      there is at least one isochronous OUT endpoint on which the
376          *      transfer is not completed in the current microframe. This
377          *      interrupt is asserted along with the End of Periodic Frame
378          *      Interrupt (EOPF) bit in this register.
379          * @incompisoin: Incomplete Isochronous IN Transfer (incompISOIN)
380          *      The core sets this interrupt to indicate that there is at least
381          *      one isochronous IN endpoint on which the transfer is not
382          *      completed in the current microframe. This interrupt is asserted
383          *      along with the End of Periodic Frame Interrupt (EOPF) bit in
384          *      this register.
385          * @oepint: OUT Endpoints Interrupt (OEPInt)
386          *      The core sets this bit to indicate that an interrupt is pending
387          *      on one of the OUT endpoints of the core (in Device mode). The
388          *      application must read the Device All Endpoints Interrupt
389          *      (DAINT) register to determine the exact number of the OUT
390          *      endpoint on which the interrupt occurred, and then read the
391          *      corresponding Device OUT Endpoint-n Interrupt (DOEPINTn)
392          *      register to determine the exact cause of the interrupt. The
393          *      application must clear the appropriate status bit in the
394          *      corresponding DOEPINTn register to clear this bit.
395          * @iepint: IN Endpoints Interrupt (IEPInt)
396          *      The core sets this bit to indicate that an interrupt is pending
397          *      on one of the IN endpoints of the core (in Device mode). The
398          *      application must read the Device All Endpoints Interrupt
399          *      (DAINT) register to determine the exact number of the IN
400          *      endpoint on which the interrupt occurred, and then read the
401          *      corresponding Device IN Endpoint-n Interrupt (DIEPINTn)
402          *      register to determine the exact cause of the interrupt. The
403          *      application must clear the appropriate status bit in the
404          *      corresponding DIEPINTn register to clear this bit.
405          * @epmis: Endpoint Mismatch Interrupt (EPMis)
406          *      Indicates that an IN token has been received for a non-periodic
407          *      endpoint, but the data for another endpoint is present in the
408          *      top of the Non-Periodic Transmit FIFO and the IN endpoint
409          *      mismatch count programmed by the application has expired.
410          * @eopf: End of Periodic Frame Interrupt (EOPF)
411          *      Indicates that the period specified in the Periodic Frame
412          *      Interval field of the Device Configuration register
413          *      (DCFG.PerFrInt) has been reached in the current microframe.
414          * @isooutdrop: Isochronous OUT Packet Dropped Interrupt (ISOOutDrop)
415          *      The core sets this bit when it fails to write an isochronous OUT
416          *      packet into the RxFIFO because the RxFIFO doesn't have
417          *      enough space to accommodate a maximum packet size packet
418          *      for the isochronous OUT endpoint.
419          * @enumdone: Enumeration Done (EnumDone)
420          *      The core sets this bit to indicate that speed enumeration is
421          *      complete. The application must read the Device Status (DSTS)
422          *      register to obtain the enumerated speed.
423          * @usbrst: USB Reset (USBRst)
424          *      The core sets this bit to indicate that a reset is detected on
425          *      the USB.
426          * @usbsusp: USB Suspend (USBSusp)
427          *      The core sets this bit to indicate that a suspend was detected
428          *      on the USB. The core enters the Suspended state when there
429          *      is no activity on the phy_line_state_i signal for an extended
430          *      period of time.
431          * @erlysusp: Early Suspend (ErlySusp)
432          *      The core sets this bit to indicate that an Idle state has been
433          *      detected on the USB for 3 ms.
434          * @i2cint: I2C Interrupt (I2CINT)
435          *      This bit is always 0x0.
436          * @ulpickint: ULPI Carkit Interrupt (ULPICKINT)
437          *      This bit is always 0x0.
438          * @goutnakeff: Global OUT NAK Effective (GOUTNakEff)
439          *      Indicates that the Set Global OUT NAK bit in the Device Control
440          *      register (DCTL.SGOUTNak), set by the application, has taken
441          *      effect in the core. This bit can be cleared by writing the Clear
442          *      Global OUT NAK bit in the Device Control register
443          *      (DCTL.CGOUTNak).
444          * @ginnakeff: Global IN Non-Periodic NAK Effective (GINNakEff)
445          *      Indicates that the Set Global Non-Periodic IN NAK bit in the
446          *      Device Control register (DCTL.SGNPInNak), set by the
447          *      application, has taken effect in the core. That is, the core has
448          *      sampled the Global IN NAK bit set by the application. This bit
449          *      can be cleared by clearing the Clear Global Non-Periodic IN
450          *      NAK bit in the Device Control register (DCTL.CGNPInNak).
451          *      This interrupt does not necessarily mean that a NAK handshake
452          *      is sent out on the USB. The STALL bit takes precedence over
453          *      the NAK bit.
454          * @nptxfemp: Non-Periodic TxFIFO Empty (NPTxFEmp)
455          *      This interrupt is asserted when the Non-Periodic TxFIFO is
456          *      either half or completely empty, and there is space for at least
457          *      one entry to be written to the Non-Periodic Transmit Request
458          *      Queue. The half or completely empty status is determined by
459          *      the Non-Periodic TxFIFO Empty Level bit in the Core AHB
460          *      Configuration register (GAHBCFG.NPTxFEmpLvl).
461          * @rxflvl: RxFIFO Non-Empty (RxFLvl)
462          *      Indicates that there is at least one packet pending to be read
463          *      from the RxFIFO.
464          * @sof: Start of (micro)Frame (Sof)
465          *      In Host mode, the core sets this bit to indicate that an SOF
466          *      (FS), micro-SOF (HS), or Keep-Alive (LS) is transmitted on the
467          *      USB. The application must write a 1 to this bit to clear the
468          *      interrupt.
469          *      In Device mode, in the core sets this bit to indicate that an
470          *      SOF token has been received on the USB. The application can read
471          *      the Device Status register to get the current (micro)frame
472          *      number. This interrupt is seen only when the core is operating
473          *      at either HS or FS.
474          * @otgint: OTG Interrupt (OTGInt)
475          *      The core sets this bit to indicate an OTG protocol event. The
476          *      application must read the OTG Interrupt Status (GOTGINT)
477          *      register to determine the exact event that caused this
478          *      interrupt. The application must clear the appropriate status bit
479          *      in the GOTGINT register to clear this bit.
480          * @modemis: Mode Mismatch Interrupt (ModeMis)
481          *      The core sets this bit when the application is trying to access:
482          *      * A Host mode register, when the core is operating in Device
483          *      mode
484          *      * A Device mode register, when the core is operating in Host
485          *      mode
486          *      The register access is completed on the AHB with an OKAY
487          *      response, but is ignored by the core internally and doesn't
488          *      affect the operation of the core.
489          * @curmod: Current Mode of Operation (CurMod)
490          *      Indicates the current mode of operation.
491          *      * 1'b0: Device mode
492          *      * 1'b1: Host mode
493          */
494         struct cvmx_usbcx_gintsts_s {
495                 uint32_t wkupint        : 1;
496                 uint32_t sessreqint     : 1;
497                 uint32_t disconnint     : 1;
498                 uint32_t conidstschng   : 1;
499                 uint32_t reserved_27_27 : 1;
500                 uint32_t ptxfemp        : 1;
501                 uint32_t hchint         : 1;
502                 uint32_t prtint         : 1;
503                 uint32_t reserved_23_23 : 1;
504                 uint32_t fetsusp        : 1;
505                 uint32_t incomplp       : 1;
506                 uint32_t incompisoin    : 1;
507                 uint32_t oepint         : 1;
508                 uint32_t iepint         : 1;
509                 uint32_t epmis          : 1;
510                 uint32_t reserved_16_16 : 1;
511                 uint32_t eopf           : 1;
512                 uint32_t isooutdrop     : 1;
513                 uint32_t enumdone       : 1;
514                 uint32_t usbrst         : 1;
515                 uint32_t usbsusp        : 1;
516                 uint32_t erlysusp       : 1;
517                 uint32_t i2cint         : 1;
518                 uint32_t ulpickint      : 1;
519                 uint32_t goutnakeff     : 1;
520                 uint32_t ginnakeff      : 1;
521                 uint32_t nptxfemp       : 1;
522                 uint32_t rxflvl         : 1;
523                 uint32_t sof            : 1;
524                 uint32_t otgint         : 1;
525                 uint32_t modemis        : 1;
526                 uint32_t curmod         : 1;
527         } s;
528 };
529
530 /**
531  * cvmx_usbc#_gnptxfsiz
532  *
533  * Non-Periodic Transmit FIFO Size Register (GNPTXFSIZ)
534  *
535  * The application can program the RAM size and the memory start address for the
536  * Non-Periodic TxFIFO.
537  */
538 union cvmx_usbcx_gnptxfsiz {
539         uint32_t u32;
540         /**
541          * struct cvmx_usbcx_gnptxfsiz_s
542          * @nptxfdep: Non-Periodic TxFIFO Depth (NPTxFDep)
543          *      This value is in terms of 32-bit words.
544          *      Minimum value is 16
545          *      Maximum value is 32768
546          * @nptxfstaddr: Non-Periodic Transmit RAM Start Address (NPTxFStAddr)
547          *      This field contains the memory start address for Non-Periodic
548          *      Transmit FIFO RAM.
549          */
550         struct cvmx_usbcx_gnptxfsiz_s {
551                 uint32_t nptxfdep       : 16;
552                 uint32_t nptxfstaddr    : 16;
553         } s;
554 };
555
556 /**
557  * cvmx_usbc#_gnptxsts
558  *
559  * Non-Periodic Transmit FIFO/Queue Status Register (GNPTXSTS)
560  *
561  * This read-only register contains the free space information for the
562  * Non-Periodic TxFIFO and the Non-Periodic Transmit Request Queue.
563  */
564 union cvmx_usbcx_gnptxsts {
565         uint32_t u32;
566         /**
567          * struct cvmx_usbcx_gnptxsts_s
568          * @nptxqtop: Top of the Non-Periodic Transmit Request Queue (NPTxQTop)
569          *      Entry in the Non-Periodic Tx Request Queue that is currently
570          *      being processed by the MAC.
571          *      * Bits [30:27]: Channel/endpoint number
572          *      * Bits [26:25]:
573          *      - 2'b00: IN/OUT token
574          *      - 2'b01: Zero-length transmit packet (device IN/host OUT)
575          *      - 2'b10: PING/CSPLIT token
576          *      - 2'b11: Channel halt command
577          *      * Bit [24]: Terminate (last entry for selected channel/endpoint)
578          * @nptxqspcavail: Non-Periodic Transmit Request Queue Space Available
579          *      (NPTxQSpcAvail)
580          *      Indicates the amount of free space available in the Non-
581          *      Periodic Transmit Request Queue. This queue holds both IN
582          *      and OUT requests in Host mode. Device mode has only IN
583          *      requests.
584          *      * 8'h0: Non-Periodic Transmit Request Queue is full
585          *      * 8'h1: 1 location available
586          *      * 8'h2: 2 locations available
587          *      * n: n locations available (0..8)
588          *      * Others: Reserved
589          * @nptxfspcavail: Non-Periodic TxFIFO Space Avail (NPTxFSpcAvail)
590          *      Indicates the amount of free space available in the Non-
591          *      Periodic TxFIFO.
592          *      Values are in terms of 32-bit words.
593          *      * 16'h0: Non-Periodic TxFIFO is full
594          *      * 16'h1: 1 word available
595          *      * 16'h2: 2 words available
596          *      * 16'hn: n words available (where 0..32768)
597          *      * 16'h8000: 32768 words available
598          *      * Others: Reserved
599          */
600         struct cvmx_usbcx_gnptxsts_s {
601                 uint32_t reserved_31_31 : 1;
602                 uint32_t nptxqtop       : 7;
603                 uint32_t nptxqspcavail  : 8;
604                 uint32_t nptxfspcavail  : 16;
605         } s;
606 };
607
608 /**
609  * cvmx_usbc#_grstctl
610  *
611  * Core Reset Register (GRSTCTL)
612  *
613  * The application uses this register to reset various hardware features inside
614  * the core.
615  */
616 union cvmx_usbcx_grstctl {
617         uint32_t u32;
618         /**
619          * struct cvmx_usbcx_grstctl_s
620          * @ahbidle: AHB Master Idle (AHBIdle)
621          *      Indicates that the AHB Master State Machine is in the IDLE
622          *      condition.
623          * @dmareq: DMA Request Signal (DMAReq)
624          *      Indicates that the DMA request is in progress. Used for debug.
625          * @txfnum: TxFIFO Number (TxFNum)
626          *      This is the FIFO number that must be flushed using the TxFIFO
627          *      Flush bit. This field must not be changed until the core clears
628          *      the TxFIFO Flush bit.
629          *      * 5'h0: Non-Periodic TxFIFO flush
630          *      * 5'h1: Periodic TxFIFO 1 flush in Device mode or Periodic
631          *      TxFIFO flush in Host mode
632          *      * 5'h2: Periodic TxFIFO 2 flush in Device mode
633          *      - ...
634          *      * 5'hF: Periodic TxFIFO 15 flush in Device mode
635          *      * 5'h10: Flush all the Periodic and Non-Periodic TxFIFOs in the
636          *      core
637          * @txfflsh: TxFIFO Flush (TxFFlsh)
638          *      This bit selectively flushes a single or all transmit FIFOs, but
639          *      cannot do so if the core is in the midst of a transaction.
640          *      The application must only write this bit after checking that the
641          *      core is neither writing to the TxFIFO nor reading from the
642          *      TxFIFO.
643          *      The application must wait until the core clears this bit before
644          *      performing any operations. This bit takes 8 clocks (of phy_clk
645          *      or hclk, whichever is slower) to clear.
646          * @rxfflsh: RxFIFO Flush (RxFFlsh)
647          *      The application can flush the entire RxFIFO using this bit, but
648          *      must first ensure that the core is not in the middle of a
649          *      transaction.
650          *      The application must only write to this bit after checking that
651          *      the core is neither reading from the RxFIFO nor writing to the
652          *      RxFIFO.
653          *      The application must wait until the bit is cleared before
654          *      performing any other operations. This bit will take 8 clocks
655          *      (slowest of PHY or AHB clock) to clear.
656          * @intknqflsh: IN Token Sequence Learning Queue Flush (INTknQFlsh)
657          *      The application writes this bit to flush the IN Token Sequence
658          *      Learning Queue.
659          * @frmcntrrst: Host Frame Counter Reset (FrmCntrRst)
660          *      The application writes this bit to reset the (micro)frame number
661          *      counter inside the core. When the (micro)frame counter is reset,
662          *      the subsequent SOF sent out by the core will have a
663          *      (micro)frame number of 0.
664          * @hsftrst: HClk Soft Reset (HSftRst)
665          *      The application uses this bit to flush the control logic in the
666          *      AHB Clock domain. Only AHB Clock Domain pipelines are reset.
667          *      * FIFOs are not flushed with this bit.
668          *      * All state machines in the AHB clock domain are reset to the
669          *      Idle state after terminating the transactions on the AHB,
670          *      following the protocol.
671          *      * CSR control bits used by the AHB clock domain state
672          *      machines are cleared.
673          *      * To clear this interrupt, status mask bits that control the
674          *      interrupt status and are generated by the AHB clock domain
675          *      state machine are cleared.
676          *      * Because interrupt status bits are not cleared, the application
677          *      can get the status of any core events that occurred after it set
678          *      this bit.
679          *      This is a self-clearing bit that the core clears after all
680          *      necessary logic is reset in the core. This may take several
681          *      clocks, depending on the core's current state.
682          * @csftrst: Core Soft Reset (CSftRst)
683          *      Resets the hclk and phy_clock domains as follows:
684          *      * Clears the interrupts and all the CSR registers except the
685          *      following register bits:
686          *      - PCGCCTL.RstPdwnModule
687          *      - PCGCCTL.GateHclk
688          *      - PCGCCTL.PwrClmp
689          *      - PCGCCTL.StopPPhyLPwrClkSelclk
690          *      - GUSBCFG.PhyLPwrClkSel
691          *      - GUSBCFG.DDRSel
692          *      - GUSBCFG.PHYSel
693          *      - GUSBCFG.FSIntf
694          *      - GUSBCFG.ULPI_UTMI_Sel
695          *      - GUSBCFG.PHYIf
696          *      - HCFG.FSLSPclkSel
697          *      - DCFG.DevSpd
698          *      * All module state machines (except the AHB Slave Unit) are
699          *      reset to the IDLE state, and all the transmit FIFOs and the
700          *      receive FIFO are flushed.
701          *      * Any transactions on the AHB Master are terminated as soon
702          *      as possible, after gracefully completing the last data phase of
703          *      an AHB transfer. Any transactions on the USB are terminated
704          *      immediately.
705          *      The application can write to this bit any time it wants to reset
706          *      the core. This is a self-clearing bit and the core clears this
707          *      bit after all the necessary logic is reset in the core, which
708          *      may take several clocks, depending on the current state of the
709          *      core. Once this bit is cleared software should wait at least 3
710          *      PHY clocks before doing any access to the PHY domain
711          *      (synchronization delay). Software should also should check that
712          *      bit 31 of this register is 1 (AHB Master is IDLE) before
713          *      starting any operation.
714          *      Typically software reset is used during software development
715          *      and also when you dynamically change the PHY selection bits
716          *      in the USB configuration registers listed above. When you
717          *      change the PHY, the corresponding clock for the PHY is
718          *      selected and used in the PHY domain. Once a new clock is
719          *      selected, the PHY domain has to be reset for proper operation.
720          */
721         struct cvmx_usbcx_grstctl_s {
722                 uint32_t ahbidle        : 1;
723                 uint32_t dmareq         : 1;
724                 uint32_t reserved_11_29 : 19;
725                 uint32_t txfnum         : 5;
726                 uint32_t txfflsh        : 1;
727                 uint32_t rxfflsh        : 1;
728                 uint32_t intknqflsh     : 1;
729                 uint32_t frmcntrrst     : 1;
730                 uint32_t hsftrst        : 1;
731                 uint32_t csftrst        : 1;
732         } s;
733 };
734
735 /**
736  * cvmx_usbc#_grxfsiz
737  *
738  * Receive FIFO Size Register (GRXFSIZ)
739  *
740  * The application can program the RAM size that must be allocated to the
741  * RxFIFO.
742  */
743 union cvmx_usbcx_grxfsiz {
744         uint32_t u32;
745         /**
746          * struct cvmx_usbcx_grxfsiz_s
747          * @rxfdep: RxFIFO Depth (RxFDep)
748          *      This value is in terms of 32-bit words.
749          *      * Minimum value is 16
750          *      * Maximum value is 32768
751          */
752         struct cvmx_usbcx_grxfsiz_s {
753                 uint32_t reserved_16_31 : 16;
754                 uint32_t rxfdep         : 16;
755         } s;
756 };
757
758 /**
759  * cvmx_usbc#_grxstsph
760  *
761  * Receive Status Read and Pop Register, Host Mode (GRXSTSPH)
762  *
763  * A read to the Receive Status Read and Pop register returns and additionally
764  * pops the top data entry out of the RxFIFO.
765  * This Description is only valid when the core is in Host Mode. For Device Mode
766  * use USBC_GRXSTSPD instead.
767  * NOTE: GRXSTSPH and GRXSTSPD are physically the same register and share the
768  *       same offset in the O2P USB core. The offset difference shown in this
769  *       document is for software clarity and is actually ignored by the
770  *       hardware.
771  */
772 union cvmx_usbcx_grxstsph {
773         uint32_t u32;
774         /**
775          * struct cvmx_usbcx_grxstsph_s
776          * @pktsts: Packet Status (PktSts)
777          *      Indicates the status of the received packet
778          *      * 4'b0010: IN data packet received
779          *      * 4'b0011: IN transfer completed (triggers an interrupt)
780          *      * 4'b0101: Data toggle error (triggers an interrupt)
781          *      * 4'b0111: Channel halted (triggers an interrupt)
782          *      * Others: Reserved
783          * @dpid: Data PID (DPID)
784          *      * 2'b00: DATA0
785          *      * 2'b10: DATA1
786          *      * 2'b01: DATA2
787          *      * 2'b11: MDATA
788          * @bcnt: Byte Count (BCnt)
789          *      Indicates the byte count of the received IN data packet
790          * @chnum: Channel Number (ChNum)
791          *      Indicates the channel number to which the current received
792          *      packet belongs.
793          */
794         struct cvmx_usbcx_grxstsph_s {
795                 uint32_t reserved_21_31 : 11;
796                 uint32_t pktsts         : 4;
797                 uint32_t dpid           : 2;
798                 uint32_t bcnt           : 11;
799                 uint32_t chnum          : 4;
800         } s;
801 };
802
803 /**
804  * cvmx_usbc#_gusbcfg
805  *
806  * Core USB Configuration Register (GUSBCFG)
807  *
808  * This register can be used to configure the core after power-on or a changing
809  * to Host mode or Device mode. It contains USB and USB-PHY related
810  * configuration parameters. The application must program this register before
811  * starting any transactions on either the AHB or the USB. Do not make changes
812  * to this register after the initial programming.
813  */
814 union cvmx_usbcx_gusbcfg {
815         uint32_t u32;
816         /**
817          * struct cvmx_usbcx_gusbcfg_s
818          * @otgi2csel: UTMIFS or I2C Interface Select (OtgI2CSel)
819          *      This bit is always 0x0.
820          * @phylpwrclksel: PHY Low-Power Clock Select (PhyLPwrClkSel)
821          *      Software should set this bit to 0x0.
822          *      Selects either 480-MHz or 48-MHz (low-power) PHY mode. In
823          *      FS and LS modes, the PHY can usually operate on a 48-MHz
824          *      clock to save power.
825          *      * 1'b0: 480-MHz Internal PLL clock
826          *      * 1'b1: 48-MHz External Clock
827          *      In 480 MHz mode, the UTMI interface operates at either 60 or
828          *      30-MHz, depending upon whether 8- or 16-bit data width is
829          *      selected. In 48-MHz mode, the UTMI interface operates at 48
830          *      MHz in FS mode and at either 48 or 6 MHz in LS mode
831          *      (depending on the PHY vendor).
832          *      This bit drives the utmi_fsls_low_power core output signal, and
833          *      is valid only for UTMI+ PHYs.
834          * @usbtrdtim: USB Turnaround Time (USBTrdTim)
835          *      Sets the turnaround time in PHY clocks.
836          *      Specifies the response time for a MAC request to the Packet
837          *      FIFO Controller (PFC) to fetch data from the DFIFO (SPRAM).
838          *      This must be programmed to 0x5.
839          * @hnpcap: HNP-Capable (HNPCap)
840          *      This bit is always 0x0.
841          * @srpcap: SRP-Capable (SRPCap)
842          *      This bit is always 0x0.
843          * @ddrsel: ULPI DDR Select (DDRSel)
844          *      Software should set this bit to 0x0.
845          * @physel: USB 2.0 High-Speed PHY or USB 1.1 Full-Speed Serial
846          *      Software should set this bit to 0x0.
847          * @fsintf: Full-Speed Serial Interface Select (FSIntf)
848          *      Software should set this bit to 0x0.
849          * @ulpi_utmi_sel: ULPI or UTMI+ Select (ULPI_UTMI_Sel)
850          *      This bit is always 0x0.
851          * @phyif: PHY Interface (PHYIf)
852          *      This bit is always 0x1.
853          * @toutcal: HS/FS Timeout Calibration (TOutCal)
854          *      The number of PHY clocks that the application programs in this
855          *      field is added to the high-speed/full-speed interpacket timeout
856          *      duration in the core to account for any additional delays
857          *      introduced by the PHY. This may be required, since the delay
858          *      introduced by the PHY in generating the linestate condition may
859          *      vary from one PHY to another.
860          *      The USB standard timeout value for high-speed operation is
861          *      736 to 816 (inclusive) bit times. The USB standard timeout
862          *      value for full-speed operation is 16 to 18 (inclusive) bit
863          *      times. The application must program this field based on the
864          *      speed of enumeration. The number of bit times added per PHY
865          *      clock are:
866          *      High-speed operation:
867          *      * One 30-MHz PHY clock = 16 bit times
868          *      * One 60-MHz PHY clock = 8 bit times
869          *      Full-speed operation:
870          *      * One 30-MHz PHY clock = 0.4 bit times
871          *      * One 60-MHz PHY clock = 0.2 bit times
872          *      * One 48-MHz PHY clock = 0.25 bit times
873          */
874         struct cvmx_usbcx_gusbcfg_s {
875                 uint32_t reserved_17_31 : 15;
876                 uint32_t otgi2csel      : 1;
877                 uint32_t phylpwrclksel  : 1;
878                 uint32_t reserved_14_14 : 1;
879                 uint32_t usbtrdtim      : 4;
880                 uint32_t hnpcap         : 1;
881                 uint32_t srpcap         : 1;
882                 uint32_t ddrsel         : 1;
883                 uint32_t physel         : 1;
884                 uint32_t fsintf         : 1;
885                 uint32_t ulpi_utmi_sel  : 1;
886                 uint32_t phyif          : 1;
887                 uint32_t toutcal        : 3;
888         } s;
889 };
890
891 /**
892  * cvmx_usbc#_haint
893  *
894  * Host All Channels Interrupt Register (HAINT)
895  *
896  * When a significant event occurs on a channel, the Host All Channels Interrupt
897  * register interrupts the application using the Host Channels Interrupt bit of
898  * the Core Interrupt register (GINTSTS.HChInt). This is shown in Interrupt.
899  * There is one interrupt bit per channel, up to a maximum of 16 bits. Bits in
900  * this register are set and cleared when the application sets and clears bits
901  * in the corresponding Host Channel-n Interrupt register.
902  */
903 union cvmx_usbcx_haint {
904         uint32_t u32;
905         /**
906          * struct cvmx_usbcx_haint_s
907          * @haint: Channel Interrupts (HAINT)
908          *      One bit per channel: Bit 0 for Channel 0, bit 15 for Channel 15
909          */
910         struct cvmx_usbcx_haint_s {
911                 uint32_t reserved_16_31 : 16;
912                 uint32_t haint          : 16;
913         } s;
914 };
915
916 /**
917  * cvmx_usbc#_haintmsk
918  *
919  * Host All Channels Interrupt Mask Register (HAINTMSK)
920  *
921  * The Host All Channel Interrupt Mask register works with the Host All Channel
922  * Interrupt register to interrupt the application when an event occurs on a
923  * channel. There is one interrupt mask bit per channel, up to a maximum of 16
924  * bits.
925  * Mask interrupt: 1'b0 Unmask interrupt: 1'b1
926  */
927 union cvmx_usbcx_haintmsk {
928         uint32_t u32;
929         /**
930          * struct cvmx_usbcx_haintmsk_s
931          * @haintmsk: Channel Interrupt Mask (HAINTMsk)
932          *      One bit per channel: Bit 0 for channel 0, bit 15 for channel 15
933          */
934         struct cvmx_usbcx_haintmsk_s {
935                 uint32_t reserved_16_31 : 16;
936                 uint32_t haintmsk       : 16;
937         } s;
938 };
939
940 /**
941  * cvmx_usbc#_hcchar#
942  *
943  * Host Channel-n Characteristics Register (HCCHAR)
944  *
945  */
946 union cvmx_usbcx_hccharx {
947         uint32_t u32;
948         /**
949          * struct cvmx_usbcx_hccharx_s
950          * @chena: Channel Enable (ChEna)
951          *      This field is set by the application and cleared by the OTG
952          *      host.
953          *      * 1'b0: Channel disabled
954          *      * 1'b1: Channel enabled
955          * @chdis: Channel Disable (ChDis)
956          *      The application sets this bit to stop transmitting/receiving
957          *      data on a channel, even before the transfer for that channel is
958          *      complete. The application must wait for the Channel Disabled
959          *      interrupt before treating the channel as disabled.
960          * @oddfrm: Odd Frame (OddFrm)
961          *      This field is set (reset) by the application to indicate that
962          *      the OTG host must perform a transfer in an odd (micro)frame.
963          *      This field is applicable for only periodic (isochronous and
964          *      interrupt) transactions.
965          *      * 1'b0: Even (micro)frame
966          *      * 1'b1: Odd (micro)frame
967          * @devaddr: Device Address (DevAddr)
968          *      This field selects the specific device serving as the data
969          *      source or sink.
970          * @ec: Multi Count (MC) / Error Count (EC)
971          *      When the Split Enable bit of the Host Channel-n Split Control
972          *      register (HCSPLTn.SpltEna) is reset (1'b0), this field indicates
973          *      to the host the number of transactions that should be executed
974          *      per microframe for this endpoint.
975          *      * 2'b00: Reserved. This field yields undefined results.
976          *      * 2'b01: 1 transaction
977          *      * 2'b10: 2 transactions to be issued for this endpoint per
978          *      microframe
979          *      * 2'b11: 3 transactions to be issued for this endpoint per
980          *      microframe
981          *      When HCSPLTn.SpltEna is set (1'b1), this field indicates the
982          *      number of immediate retries to be performed for a periodic split
983          *      transactions on transaction errors. This field must be set to at
984          *      least 2'b01.
985          * @eptype: Endpoint Type (EPType)
986          *      Indicates the transfer type selected.
987          *      * 2'b00: Control
988          *      * 2'b01: Isochronous
989          *      * 2'b10: Bulk
990          *      * 2'b11: Interrupt
991          * @lspddev: Low-Speed Device (LSpdDev)
992          *      This field is set by the application to indicate that this
993          *      channel is communicating to a low-speed device.
994          * @epdir: Endpoint Direction (EPDir)
995          *      Indicates whether the transaction is IN or OUT.
996          *      * 1'b0: OUT
997          *      * 1'b1: IN
998          * @epnum: Endpoint Number (EPNum)
999          *      Indicates the endpoint number on the device serving as the
1000          *      data source or sink.
1001          * @mps: Maximum Packet Size (MPS)
1002          *      Indicates the maximum packet size of the associated endpoint.
1003          */
1004         struct cvmx_usbcx_hccharx_s {
1005                 uint32_t chena          : 1;
1006                 uint32_t chdis          : 1;
1007                 uint32_t oddfrm         : 1;
1008                 uint32_t devaddr        : 7;
1009                 uint32_t ec             : 2;
1010                 uint32_t eptype         : 2;
1011                 uint32_t lspddev        : 1;
1012                 uint32_t reserved_16_16 : 1;
1013                 uint32_t epdir          : 1;
1014                 uint32_t epnum          : 4;
1015                 uint32_t mps            : 11;
1016         } s;
1017 };
1018
1019 /**
1020  * cvmx_usbc#_hcfg
1021  *
1022  * Host Configuration Register (HCFG)
1023  *
1024  * This register configures the core after power-on. Do not make changes to this
1025  * register after initializing the host.
1026  */
1027 union cvmx_usbcx_hcfg {
1028         uint32_t u32;
1029         /**
1030          * struct cvmx_usbcx_hcfg_s
1031          * @fslssupp: FS- and LS-Only Support (FSLSSupp)
1032          *      The application uses this bit to control the core's enumeration
1033          *      speed. Using this bit, the application can make the core
1034          *      enumerate as a FS host, even if the connected device supports
1035          *      HS traffic. Do not make changes to this field after initial
1036          *      programming.
1037          *      * 1'b0: HS/FS/LS, based on the maximum speed supported by
1038          *      the connected device
1039          *      * 1'b1: FS/LS-only, even if the connected device can support HS
1040          * @fslspclksel: FS/LS PHY Clock Select (FSLSPclkSel)
1041          *      When the core is in FS Host mode
1042          *      * 2'b00: PHY clock is running at 30/60 MHz
1043          *      * 2'b01: PHY clock is running at 48 MHz
1044          *      * Others: Reserved
1045          *      When the core is in LS Host mode
1046          *      * 2'b00: PHY clock is running at 30/60 MHz. When the
1047          *      UTMI+/ULPI PHY Low Power mode is not selected, use
1048          *      30/60 MHz.
1049          *      * 2'b01: PHY clock is running at 48 MHz. When the UTMI+
1050          *      PHY Low Power mode is selected, use 48MHz if the PHY
1051          *      supplies a 48 MHz clock during LS mode.
1052          *      * 2'b10: PHY clock is running at 6 MHz. In USB 1.1 FS mode,
1053          *      use 6 MHz when the UTMI+ PHY Low Power mode is
1054          *      selected and the PHY supplies a 6 MHz clock during LS
1055          *      mode. If you select a 6 MHz clock during LS mode, you must
1056          *      do a soft reset.
1057          *      * 2'b11: Reserved
1058          */
1059         struct cvmx_usbcx_hcfg_s {
1060                 uint32_t reserved_3_31  : 29;
1061                 uint32_t fslssupp       : 1;
1062                 uint32_t fslspclksel    : 2;
1063         } s;
1064 };
1065
1066 /**
1067  * cvmx_usbc#_hcint#
1068  *
1069  * Host Channel-n Interrupt Register (HCINT)
1070  *
1071  * This register indicates the status of a channel with respect to USB- and
1072  * AHB-related events. The application must read this register when the Host
1073  * Channels Interrupt bit of the Core Interrupt register (GINTSTS.HChInt) is
1074  * set. Before the application can read this register, it must first read
1075  * the Host All Channels Interrupt (HAINT) register to get the exact channel
1076  * number for the Host Channel-n Interrupt register. The application must clear
1077  * the appropriate bit in this register to clear the corresponding bits in the
1078  * HAINT and GINTSTS registers.
1079  */
1080 union cvmx_usbcx_hcintx {
1081         uint32_t u32;
1082         /**
1083          * struct cvmx_usbcx_hcintx_s
1084          * @datatglerr: Data Toggle Error (DataTglErr)
1085          * @frmovrun: Frame Overrun (FrmOvrun)
1086          * @bblerr: Babble Error (BblErr)
1087          * @xacterr: Transaction Error (XactErr)
1088          * @nyet: NYET Response Received Interrupt (NYET)
1089          * @ack: ACK Response Received Interrupt (ACK)
1090          * @nak: NAK Response Received Interrupt (NAK)
1091          * @stall: STALL Response Received Interrupt (STALL)
1092          * @ahberr: This bit is always 0x0.
1093          * @chhltd: Channel Halted (ChHltd)
1094          *      Indicates the transfer completed abnormally either because of
1095          *      any USB transaction error or in response to disable request by
1096          *      the application.
1097          * @xfercompl: Transfer Completed (XferCompl)
1098          *      Transfer completed normally without any errors.
1099          */
1100         struct cvmx_usbcx_hcintx_s {
1101                 uint32_t reserved_11_31 : 21;
1102                 uint32_t datatglerr     : 1;
1103                 uint32_t frmovrun       : 1;
1104                 uint32_t bblerr         : 1;
1105                 uint32_t xacterr        : 1;
1106                 uint32_t nyet           : 1;
1107                 uint32_t ack            : 1;
1108                 uint32_t nak            : 1;
1109                 uint32_t stall          : 1;
1110                 uint32_t ahberr         : 1;
1111                 uint32_t chhltd         : 1;
1112                 uint32_t xfercompl      : 1;
1113         } s;
1114 };
1115
1116 /**
1117  * cvmx_usbc#_hcintmsk#
1118  *
1119  * Host Channel-n Interrupt Mask Register (HCINTMSKn)
1120  *
1121  * This register reflects the mask for each channel status described in the
1122  * previous section.
1123  * Mask interrupt: 1'b0 Unmask interrupt: 1'b1
1124  */
1125 union cvmx_usbcx_hcintmskx {
1126         uint32_t u32;
1127         /**
1128          * struct cvmx_usbcx_hcintmskx_s
1129          * @datatglerrmsk: Data Toggle Error Mask (DataTglErrMsk)
1130          * @frmovrunmsk: Frame Overrun Mask (FrmOvrunMsk)
1131          * @bblerrmsk: Babble Error Mask (BblErrMsk)
1132          * @xacterrmsk: Transaction Error Mask (XactErrMsk)
1133          * @nyetmsk: NYET Response Received Interrupt Mask (NyetMsk)
1134          * @ackmsk: ACK Response Received Interrupt Mask (AckMsk)
1135          * @nakmsk: NAK Response Received Interrupt Mask (NakMsk)
1136          * @stallmsk: STALL Response Received Interrupt Mask (StallMsk)
1137          * @ahberrmsk: AHB Error Mask (AHBErrMsk)
1138          * @chhltdmsk: Channel Halted Mask (ChHltdMsk)
1139          * @xfercomplmsk: Transfer Completed Mask (XferComplMsk)
1140          */
1141         struct cvmx_usbcx_hcintmskx_s {
1142                 uint32_t reserved_11_31 : 21;
1143                 uint32_t datatglerrmsk  : 1;
1144                 uint32_t frmovrunmsk    : 1;
1145                 uint32_t bblerrmsk      : 1;
1146                 uint32_t xacterrmsk     : 1;
1147                 uint32_t nyetmsk        : 1;
1148                 uint32_t ackmsk         : 1;
1149                 uint32_t nakmsk         : 1;
1150                 uint32_t stallmsk       : 1;
1151                 uint32_t ahberrmsk      : 1;
1152                 uint32_t chhltdmsk      : 1;
1153                 uint32_t xfercomplmsk   : 1;
1154         } s;
1155 };
1156
1157 /**
1158  * cvmx_usbc#_hcsplt#
1159  *
1160  * Host Channel-n Split Control Register (HCSPLT)
1161  *
1162  */
1163 union cvmx_usbcx_hcspltx {
1164         uint32_t u32;
1165         /**
1166          * struct cvmx_usbcx_hcspltx_s
1167          * @spltena: Split Enable (SpltEna)
1168          *      The application sets this field to indicate that this channel is
1169          *      enabled to perform split transactions.
1170          * @compsplt: Do Complete Split (CompSplt)
1171          *      The application sets this field to request the OTG host to
1172          *      perform a complete split transaction.
1173          * @xactpos: Transaction Position (XactPos)
1174          *      This field is used to determine whether to send all, first,
1175          *      middle, or last payloads with each OUT transaction.
1176          *      * 2'b11: All. This is the entire data payload is of this
1177          *      transaction (which is less than or equal to 188 bytes).
1178          *      * 2'b10: Begin. This is the first data payload of this
1179          *      transaction (which is larger than 188 bytes).
1180          *      * 2'b00: Mid. This is the middle payload of this transaction
1181          *      (which is larger than 188 bytes).
1182          *      * 2'b01: End. This is the last payload of this transaction
1183          *      (which is larger than 188 bytes).
1184          * @hubaddr: Hub Address (HubAddr)
1185          *      This field holds the device address of the transaction
1186          *      translator's hub.
1187          * @prtaddr: Port Address (PrtAddr)
1188          *      This field is the port number of the recipient transaction
1189          *      translator.
1190          */
1191         struct cvmx_usbcx_hcspltx_s {
1192                 uint32_t spltena        : 1;
1193                 uint32_t reserved_17_30 : 14;
1194                 uint32_t compsplt       : 1;
1195                 uint32_t xactpos        : 2;
1196                 uint32_t hubaddr        : 7;
1197                 uint32_t prtaddr        : 7;
1198         } s;
1199 };
1200
1201 /**
1202  * cvmx_usbc#_hctsiz#
1203  *
1204  * Host Channel-n Transfer Size Register (HCTSIZ)
1205  *
1206  */
1207 union cvmx_usbcx_hctsizx {
1208         uint32_t u32;
1209         /**
1210          * struct cvmx_usbcx_hctsizx_s
1211          * @dopng: Do Ping (DoPng)
1212          *      Setting this field to 1 directs the host to do PING protocol.
1213          * @pid: PID (Pid)
1214          *      The application programs this field with the type of PID to use
1215          *      for the initial transaction. The host will maintain this field
1216          *      for the rest of the transfer.
1217          *      * 2'b00: DATA0
1218          *      * 2'b01: DATA2
1219          *      * 2'b10: DATA1
1220          *      * 2'b11: MDATA (non-control)/SETUP (control)
1221          * @pktcnt: Packet Count (PktCnt)
1222          *      This field is programmed by the application with the expected
1223          *      number of packets to be transmitted (OUT) or received (IN).
1224          *      The host decrements this count on every successful
1225          *      transmission or reception of an OUT/IN packet. Once this count
1226          *      reaches zero, the application is interrupted to indicate normal
1227          *      completion.
1228          * @xfersize: Transfer Size (XferSize)
1229          *      For an OUT, this field is the number of data bytes the host will
1230          *      send during the transfer.
1231          *      For an IN, this field is the buffer size that the application
1232          *      has reserved for the transfer. The application is expected to
1233          *      program this field as an integer multiple of the maximum packet
1234          *      size for IN transactions (periodic and non-periodic).
1235          */
1236         struct cvmx_usbcx_hctsizx_s {
1237                 uint32_t dopng          : 1;
1238                 uint32_t pid            : 2;
1239                 uint32_t pktcnt         : 10;
1240                 uint32_t xfersize       : 19;
1241         } s;
1242 };
1243
1244 /**
1245  * cvmx_usbc#_hfir
1246  *
1247  * Host Frame Interval Register (HFIR)
1248  *
1249  * This register stores the frame interval information for the current speed to
1250  * which the O2P USB core has enumerated.
1251  */
1252 union cvmx_usbcx_hfir {
1253         uint32_t u32;
1254         /**
1255          * struct cvmx_usbcx_hfir_s
1256          * @frint: Frame Interval (FrInt)
1257          *      The value that the application programs to this field specifies
1258          *      the interval between two consecutive SOFs (FS) or micro-
1259          *      SOFs (HS) or Keep-Alive tokens (HS). This field contains the
1260          *      number of PHY clocks that constitute the required frame
1261          *      interval. The default value set in this field for a FS operation
1262          *      when the PHY clock frequency is 60 MHz. The application can
1263          *      write a value to this register only after the Port Enable bit of
1264          *      the Host Port Control and Status register (HPRT.PrtEnaPort)
1265          *      has been set. If no value is programmed, the core calculates
1266          *      the value based on the PHY clock specified in the FS/LS PHY
1267          *      Clock Select field of the Host Configuration register
1268          *      (HCFG.FSLSPclkSel). Do not change the value of this field
1269          *      after the initial configuration.
1270          *      * 125 us (PHY clock frequency for HS)
1271          *      * 1 ms (PHY clock frequency for FS/LS)
1272          */
1273         struct cvmx_usbcx_hfir_s {
1274                 uint32_t reserved_16_31 : 16;
1275                 uint32_t frint          : 16;
1276         } s;
1277 };
1278
1279 /**
1280  * cvmx_usbc#_hfnum
1281  *
1282  * Host Frame Number/Frame Time Remaining Register (HFNUM)
1283  *
1284  * This register indicates the current frame number.
1285  * It also indicates the time remaining (in terms of the number of PHY clocks)
1286  * in the current (micro)frame.
1287  */
1288 union cvmx_usbcx_hfnum {
1289         uint32_t u32;
1290         /**
1291          * struct cvmx_usbcx_hfnum_s
1292          * @frrem: Frame Time Remaining (FrRem)
1293          *      Indicates the amount of time remaining in the current
1294          *      microframe (HS) or frame (FS/LS), in terms of PHY clocks.
1295          *      This field decrements on each PHY clock. When it reaches
1296          *      zero, this field is reloaded with the value in the Frame
1297          *      Interval register and a new SOF is transmitted on the USB.
1298          * @frnum: Frame Number (FrNum)
1299          *      This field increments when a new SOF is transmitted on the
1300          *      USB, and is reset to 0 when it reaches 16'h3FFF.
1301          */
1302         struct cvmx_usbcx_hfnum_s {
1303                 uint32_t frrem  : 16;
1304                 uint32_t frnum  : 16;
1305         } s;
1306 };
1307
1308 /**
1309  * cvmx_usbc#_hprt
1310  *
1311  * Host Port Control and Status Register (HPRT)
1312  *
1313  * This register is available in both Host and Device modes.
1314  * Currently, the OTG Host supports only one port.
1315  * A single register holds USB port-related information such as USB reset,
1316  * enable, suspend, resume, connect status, and test mode for each port. The
1317  * R_SS_WC bits in this register can trigger an interrupt to the application
1318  * through the Host Port Interrupt bit of the Core Interrupt register
1319  * (GINTSTS.PrtInt). On a Port Interrupt, the application must read this
1320  * register and clear the bit that caused the interrupt. For the R_SS_WC bits,
1321  * the application must write a 1 to the bit to clear the interrupt.
1322  */
1323 union cvmx_usbcx_hprt {
1324         uint32_t u32;
1325         /**
1326          * struct cvmx_usbcx_hprt_s
1327          * @prtspd: Port Speed (PrtSpd)
1328          *      Indicates the speed of the device attached to this port.
1329          *      * 2'b00: High speed
1330          *      * 2'b01: Full speed
1331          *      * 2'b10: Low speed
1332          *      * 2'b11: Reserved
1333          * @prttstctl: Port Test Control (PrtTstCtl)
1334          *      The application writes a nonzero value to this field to put
1335          *      the port into a Test mode, and the corresponding pattern is
1336          *      signaled on the port.
1337          *      * 4'b0000: Test mode disabled
1338          *      * 4'b0001: Test_J mode
1339          *      * 4'b0010: Test_K mode
1340          *      * 4'b0011: Test_SE0_NAK mode
1341          *      * 4'b0100: Test_Packet mode
1342          *      * 4'b0101: Test_Force_Enable
1343          *      * Others: Reserved
1344          *      PrtSpd must be zero (i.e. the interface must be in high-speed
1345          *      mode) to use the PrtTstCtl test modes.
1346          * @prtpwr: Port Power (PrtPwr)
1347          *      The application uses this field to control power to this port,
1348          *      and the core clears this bit on an overcurrent condition.
1349          *      * 1'b0: Power off
1350          *      * 1'b1: Power on
1351          * @prtlnsts: Port Line Status (PrtLnSts)
1352          *      Indicates the current logic level USB data lines
1353          *      * Bit [10]: Logic level of D-
1354          *      * Bit [11]: Logic level of D+
1355          * @prtrst: Port Reset (PrtRst)
1356          *      When the application sets this bit, a reset sequence is
1357          *      started on this port. The application must time the reset
1358          *      period and clear this bit after the reset sequence is
1359          *      complete.
1360          *      * 1'b0: Port not in reset
1361          *      * 1'b1: Port in reset
1362          *      The application must leave this bit set for at least a
1363          *      minimum duration mentioned below to start a reset on the
1364          *      port. The application can leave it set for another 10 ms in
1365          *      addition to the required minimum duration, before clearing
1366          *      the bit, even though there is no maximum limit set by the
1367          *      USB standard.
1368          *      * High speed: 50 ms
1369          *      * Full speed/Low speed: 10 ms
1370          * @prtsusp: Port Suspend (PrtSusp)
1371          *      The application sets this bit to put this port in Suspend
1372          *      mode. The core only stops sending SOFs when this is set.
1373          *      To stop the PHY clock, the application must set the Port
1374          *      Clock Stop bit, which will assert the suspend input pin of
1375          *      the PHY.
1376          *      The read value of this bit reflects the current suspend
1377          *      status of the port. This bit is cleared by the core after a
1378          *      remote wakeup signal is detected or the application sets
1379          *      the Port Reset bit or Port Resume bit in this register or the
1380          *      Resume/Remote Wakeup Detected Interrupt bit or
1381          *      Disconnect Detected Interrupt bit in the Core Interrupt
1382          *      register (GINTSTS.WkUpInt or GINTSTS.DisconnInt,
1383          *      respectively).
1384          *      * 1'b0: Port not in Suspend mode
1385          *      * 1'b1: Port in Suspend mode
1386          * @prtres: Port Resume (PrtRes)
1387          *      The application sets this bit to drive resume signaling on
1388          *      the port. The core continues to drive the resume signal
1389          *      until the application clears this bit.
1390          *      If the core detects a USB remote wakeup sequence, as
1391          *      indicated by the Port Resume/Remote Wakeup Detected
1392          *      Interrupt bit of the Core Interrupt register
1393          *      (GINTSTS.WkUpInt), the core starts driving resume
1394          *      signaling without application intervention and clears this bit
1395          *      when it detects a disconnect condition. The read value of
1396          *      this bit indicates whether the core is currently driving
1397          *      resume signaling.
1398          *      * 1'b0: No resume driven
1399          *      * 1'b1: Resume driven
1400          * @prtovrcurrchng: Port Overcurrent Change (PrtOvrCurrChng)
1401          *      The core sets this bit when the status of the Port
1402          *      Overcurrent Active bit (bit 4) in this register changes.
1403          * @prtovrcurract: Port Overcurrent Active (PrtOvrCurrAct)
1404          *      Indicates the overcurrent condition of the port.
1405          *      * 1'b0: No overcurrent condition
1406          *      * 1'b1: Overcurrent condition
1407          * @prtenchng: Port Enable/Disable Change (PrtEnChng)
1408          *      The core sets this bit when the status of the Port Enable bit
1409          *      [2] of this register changes.
1410          * @prtena: Port Enable (PrtEna)
1411          *      A port is enabled only by the core after a reset sequence,
1412          *      and is disabled by an overcurrent condition, a disconnect
1413          *      condition, or by the application clearing this bit. The
1414          *      application cannot set this bit by a register write. It can only
1415          *      clear it to disable the port. This bit does not trigger any
1416          *      interrupt to the application.
1417          *      * 1'b0: Port disabled
1418          *      * 1'b1: Port enabled
1419          * @prtconndet: Port Connect Detected (PrtConnDet)
1420          *      The core sets this bit when a device connection is detected
1421          *      to trigger an interrupt to the application using the Host Port
1422          *      Interrupt bit of the Core Interrupt register (GINTSTS.PrtInt).
1423          *      The application must write a 1 to this bit to clear the
1424          *      interrupt.
1425          * @prtconnsts: Port Connect Status (PrtConnSts)
1426          *      * 0: No device is attached to the port.
1427          *      * 1: A device is attached to the port.
1428          */
1429         struct cvmx_usbcx_hprt_s {
1430                 uint32_t reserved_19_31 : 13;
1431                 uint32_t prtspd         : 2;
1432                 uint32_t prttstctl      : 4;
1433                 uint32_t prtpwr         : 1;
1434                 uint32_t prtlnsts       : 2;
1435                 uint32_t reserved_9_9   : 1;
1436                 uint32_t prtrst         : 1;
1437                 uint32_t prtsusp        : 1;
1438                 uint32_t prtres         : 1;
1439                 uint32_t prtovrcurrchng : 1;
1440                 uint32_t prtovrcurract  : 1;
1441                 uint32_t prtenchng      : 1;
1442                 uint32_t prtena         : 1;
1443                 uint32_t prtconndet     : 1;
1444                 uint32_t prtconnsts     : 1;
1445         } s;
1446 };
1447
1448 /**
1449  * cvmx_usbc#_hptxfsiz
1450  *
1451  * Host Periodic Transmit FIFO Size Register (HPTXFSIZ)
1452  *
1453  * This register holds the size and the memory start address of the Periodic
1454  * TxFIFO, as shown in Figures 310 and 311.
1455  */
1456 union cvmx_usbcx_hptxfsiz {
1457         uint32_t u32;
1458         /**
1459          * struct cvmx_usbcx_hptxfsiz_s
1460          * @ptxfsize: Host Periodic TxFIFO Depth (PTxFSize)
1461          *      This value is in terms of 32-bit words.
1462          *      * Minimum value is 16
1463          *      * Maximum value is 32768
1464          * @ptxfstaddr: Host Periodic TxFIFO Start Address (PTxFStAddr)
1465          */
1466         struct cvmx_usbcx_hptxfsiz_s {
1467                 uint32_t ptxfsize       : 16;
1468                 uint32_t ptxfstaddr     : 16;
1469         } s;
1470 };
1471
1472 /**
1473  * cvmx_usbc#_hptxsts
1474  *
1475  * Host Periodic Transmit FIFO/Queue Status Register (HPTXSTS)
1476  *
1477  * This read-only register contains the free space information for the Periodic
1478  * TxFIFO and the Periodic Transmit Request Queue
1479  */
1480 union cvmx_usbcx_hptxsts {
1481         uint32_t u32;
1482         /**
1483          * struct cvmx_usbcx_hptxsts_s
1484          * @ptxqtop: Top of the Periodic Transmit Request Queue (PTxQTop)
1485          *      This indicates the entry in the Periodic Tx Request Queue that
1486          *      is currently being processes by the MAC.
1487          *      This register is used for debugging.
1488          *      * Bit [31]: Odd/Even (micro)frame
1489          *      - 1'b0: send in even (micro)frame
1490          *      - 1'b1: send in odd (micro)frame
1491          *      * Bits [30:27]: Channel/endpoint number
1492          *      * Bits [26:25]: Type
1493          *      - 2'b00: IN/OUT
1494          *      - 2'b01: Zero-length packet
1495          *      - 2'b10: CSPLIT
1496          *      - 2'b11: Disable channel command
1497          *      * Bit [24]: Terminate (last entry for the selected
1498          *      channel/endpoint)
1499          * @ptxqspcavail: Periodic Transmit Request Queue Space Available
1500          *      (PTxQSpcAvail)
1501          *      Indicates the number of free locations available to be written
1502          *      in the Periodic Transmit Request Queue. This queue holds both
1503          *      IN and OUT requests.
1504          *      * 8'h0: Periodic Transmit Request Queue is full
1505          *      * 8'h1: 1 location available
1506          *      * 8'h2: 2 locations available
1507          *      * n: n locations available (0..8)
1508          *      * Others: Reserved
1509          * @ptxfspcavail: Periodic Transmit Data FIFO Space Available
1510          *                (PTxFSpcAvail)
1511          *      Indicates the number of free locations available to be written
1512          *      to in the Periodic TxFIFO.
1513          *      Values are in terms of 32-bit words
1514          *      * 16'h0: Periodic TxFIFO is full
1515          *      * 16'h1: 1 word available
1516          *      * 16'h2: 2 words available
1517          *      * 16'hn: n words available (where 0..32768)
1518          *      * 16'h8000: 32768 words available
1519          *      * Others: Reserved
1520          */
1521         struct cvmx_usbcx_hptxsts_s {
1522                 uint32_t ptxqtop        : 8;
1523                 uint32_t ptxqspcavail   : 8;
1524                 uint32_t ptxfspcavail   : 16;
1525         } s;
1526 };
1527
1528 #endif