![]() |
|
|||
0001 /* SPDX-License-Identifier: GPL-2.0 */ 0002 /* 0003 * Octeon HCD hardware register definitions. 0004 * 0005 * This file is subject to the terms and conditions of the GNU General Public 0006 * License. See the file "COPYING" in the main directory of this archive 0007 * for more details. 0008 * 0009 * Some parts of the code were originally released under BSD license: 0010 * 0011 * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights 0012 * reserved. 0013 * 0014 * Redistribution and use in source and binary forms, with or without 0015 * modification, are permitted provided that the following conditions are 0016 * met: 0017 * 0018 * * Redistributions of source code must retain the above copyright 0019 * notice, this list of conditions and the following disclaimer. 0020 * 0021 * * Redistributions in binary form must reproduce the above 0022 * copyright notice, this list of conditions and the following 0023 * disclaimer in the documentation and/or other materials provided 0024 * with the distribution. 0025 * 0026 * * Neither the name of Cavium Networks nor the names of 0027 * its contributors may be used to endorse or promote products 0028 * derived from this software without specific prior written 0029 * permission. 0030 * 0031 * This Software, including technical data, may be subject to U.S. export 0032 * control laws, including the U.S. Export Administration Act and its associated 0033 * regulations, and may be subject to export or import regulations in other 0034 * countries. 0035 * 0036 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" 0037 * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR 0038 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO 0039 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION 0040 * OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM 0041 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, 0042 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF 0043 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR 0044 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR 0045 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. 0046 */ 0047 0048 #ifndef __OCTEON_HCD_H__ 0049 #define __OCTEON_HCD_H__ 0050 0051 #include <asm/bitfield.h> 0052 0053 #define CVMX_USBCXBASE 0x00016F0010000000ull 0054 #define CVMX_USBCXREG1(reg, bid) \ 0055 (CVMX_ADD_IO_SEG(CVMX_USBCXBASE | reg) + \ 0056 ((bid) & 1) * 0x100000000000ull) 0057 #define CVMX_USBCXREG2(reg, bid, off) \ 0058 (CVMX_ADD_IO_SEG(CVMX_USBCXBASE | reg) + \ 0059 (((off) & 7) + ((bid) & 1) * 0x8000000000ull) * 32) 0060 0061 #define CVMX_USBCX_GAHBCFG(bid) CVMX_USBCXREG1(0x008, bid) 0062 #define CVMX_USBCX_GHWCFG3(bid) CVMX_USBCXREG1(0x04c, bid) 0063 #define CVMX_USBCX_GINTMSK(bid) CVMX_USBCXREG1(0x018, bid) 0064 #define CVMX_USBCX_GINTSTS(bid) CVMX_USBCXREG1(0x014, bid) 0065 #define CVMX_USBCX_GNPTXFSIZ(bid) CVMX_USBCXREG1(0x028, bid) 0066 #define CVMX_USBCX_GNPTXSTS(bid) CVMX_USBCXREG1(0x02c, bid) 0067 #define CVMX_USBCX_GOTGCTL(bid) CVMX_USBCXREG1(0x000, bid) 0068 #define CVMX_USBCX_GRSTCTL(bid) CVMX_USBCXREG1(0x010, bid) 0069 #define CVMX_USBCX_GRXFSIZ(bid) CVMX_USBCXREG1(0x024, bid) 0070 #define CVMX_USBCX_GRXSTSPH(bid) CVMX_USBCXREG1(0x020, bid) 0071 #define CVMX_USBCX_GUSBCFG(bid) CVMX_USBCXREG1(0x00c, bid) 0072 #define CVMX_USBCX_HAINT(bid) CVMX_USBCXREG1(0x414, bid) 0073 #define CVMX_USBCX_HAINTMSK(bid) CVMX_USBCXREG1(0x418, bid) 0074 #define CVMX_USBCX_HCCHARX(off, bid) CVMX_USBCXREG2(0x500, bid, off) 0075 #define CVMX_USBCX_HCFG(bid) CVMX_USBCXREG1(0x400, bid) 0076 #define CVMX_USBCX_HCINTMSKX(off, bid) CVMX_USBCXREG2(0x50c, bid, off) 0077 #define CVMX_USBCX_HCINTX(off, bid) CVMX_USBCXREG2(0x508, bid, off) 0078 #define CVMX_USBCX_HCSPLTX(off, bid) CVMX_USBCXREG2(0x504, bid, off) 0079 #define CVMX_USBCX_HCTSIZX(off, bid) CVMX_USBCXREG2(0x510, bid, off) 0080 #define CVMX_USBCX_HFIR(bid) CVMX_USBCXREG1(0x404, bid) 0081 #define CVMX_USBCX_HFNUM(bid) CVMX_USBCXREG1(0x408, bid) 0082 #define CVMX_USBCX_HPRT(bid) CVMX_USBCXREG1(0x440, bid) 0083 #define CVMX_USBCX_HPTXFSIZ(bid) CVMX_USBCXREG1(0x100, bid) 0084 #define CVMX_USBCX_HPTXSTS(bid) CVMX_USBCXREG1(0x410, bid) 0085 0086 #define CVMX_USBNXBID1(bid) (((bid) & 1) * 0x10000000ull) 0087 #define CVMX_USBNXBID2(bid) (((bid) & 1) * 0x100000000000ull) 0088 0089 #define CVMX_USBNXREG1(reg, bid) \ 0090 (CVMX_ADD_IO_SEG(0x0001180068000000ull | reg) + CVMX_USBNXBID1(bid)) 0091 #define CVMX_USBNXREG2(reg, bid) \ 0092 (CVMX_ADD_IO_SEG(0x00016F0000000000ull | reg) + CVMX_USBNXBID2(bid)) 0093 0094 #define CVMX_USBNX_CLK_CTL(bid) CVMX_USBNXREG1(0x10, bid) 0095 #define CVMX_USBNX_DMA0_INB_CHN0(bid) CVMX_USBNXREG2(0x818, bid) 0096 #define CVMX_USBNX_DMA0_OUTB_CHN0(bid) CVMX_USBNXREG2(0x858, bid) 0097 #define CVMX_USBNX_USBP_CTL_STATUS(bid) CVMX_USBNXREG1(0x18, bid) 0098 0099 /** 0100 * cvmx_usbc#_gahbcfg 0101 * 0102 * Core AHB Configuration Register (GAHBCFG) 0103 * 0104 * This register can be used to configure the core after power-on or a change in 0105 * mode of operation. This register mainly contains AHB system-related 0106 * configuration parameters. The AHB is the processor interface to the O2P USB 0107 * core. In general, software need not know about this interface except to 0108 * program the values as specified. 0109 * 0110 * The application must program this register as part of the O2P USB core 0111 * initialization. Do not change this register after the initial programming. 0112 */ 0113 union cvmx_usbcx_gahbcfg { 0114 u32 u32; 0115 /** 0116 * struct cvmx_usbcx_gahbcfg_s 0117 * @ptxfemplvl: Periodic TxFIFO Empty Level (PTxFEmpLvl) 0118 * Software should set this bit to 0x1. 0119 * Indicates when the Periodic TxFIFO Empty Interrupt bit in the 0120 * Core Interrupt register (GINTSTS.PTxFEmp) is triggered. This 0121 * bit is used only in Slave mode. 0122 * * 1'b0: GINTSTS.PTxFEmp interrupt indicates that the Periodic 0123 * TxFIFO is half empty 0124 * * 1'b1: GINTSTS.PTxFEmp interrupt indicates that the Periodic 0125 * TxFIFO is completely empty 0126 * @nptxfemplvl: Non-Periodic TxFIFO Empty Level (NPTxFEmpLvl) 0127 * Software should set this bit to 0x1. 0128 * Indicates when the Non-Periodic TxFIFO Empty Interrupt bit in 0129 * the Core Interrupt register (GINTSTS.NPTxFEmp) is triggered. 0130 * This bit is used only in Slave mode. 0131 * * 1'b0: GINTSTS.NPTxFEmp interrupt indicates that the Non- 0132 * Periodic TxFIFO is half empty 0133 * * 1'b1: GINTSTS.NPTxFEmp interrupt indicates that the Non- 0134 * Periodic TxFIFO is completely empty 0135 * @dmaen: DMA Enable (DMAEn) 0136 * * 1'b0: Core operates in Slave mode 0137 * * 1'b1: Core operates in a DMA mode 0138 * @hbstlen: Burst Length/Type (HBstLen) 0139 * This field has not effect and should be left as 0x0. 0140 * @glblintrmsk: Global Interrupt Mask (GlblIntrMsk) 0141 * Software should set this field to 0x1. 0142 * The application uses this bit to mask or unmask the interrupt 0143 * line assertion to itself. Irrespective of this bit's setting, 0144 * the interrupt status registers are updated by the core. 0145 * * 1'b0: Mask the interrupt assertion to the application. 0146 * * 1'b1: Unmask the interrupt assertion to the application. 0147 */ 0148 struct cvmx_usbcx_gahbcfg_s { 0149 __BITFIELD_FIELD(u32 reserved_9_31 : 23, 0150 __BITFIELD_FIELD(u32 ptxfemplvl : 1, 0151 __BITFIELD_FIELD(u32 nptxfemplvl : 1, 0152 __BITFIELD_FIELD(u32 reserved_6_6 : 1, 0153 __BITFIELD_FIELD(u32 dmaen : 1, 0154 __BITFIELD_FIELD(u32 hbstlen : 4, 0155 __BITFIELD_FIELD(u32 glblintrmsk : 1, 0156 ;))))))) 0157 } s; 0158 }; 0159 0160 /** 0161 * cvmx_usbc#_ghwcfg3 0162 * 0163 * User HW Config3 Register (GHWCFG3) 0164 * 0165 * This register contains the configuration options of the O2P USB core. 0166 */ 0167 union cvmx_usbcx_ghwcfg3 { 0168 u32 u32; 0169 /** 0170 * struct cvmx_usbcx_ghwcfg3_s 0171 * @dfifodepth: DFIFO Depth (DfifoDepth) 0172 * This value is in terms of 32-bit words. 0173 * * Minimum value is 32 0174 * * Maximum value is 32768 0175 * @ahbphysync: AHB and PHY Synchronous (AhbPhySync) 0176 * Indicates whether AHB and PHY clocks are synchronous to 0177 * each other. 0178 * * 1'b0: No 0179 * * 1'b1: Yes 0180 * This bit is tied to 1. 0181 * @rsttype: Reset Style for Clocked always Blocks in RTL (RstType) 0182 * * 1'b0: Asynchronous reset is used in the core 0183 * * 1'b1: Synchronous reset is used in the core 0184 * @optfeature: Optional Features Removed (OptFeature) 0185 * Indicates whether the User ID register, GPIO interface ports, 0186 * and SOF toggle and counter ports were removed for gate count 0187 * optimization. 0188 * @vendor_control_interface_support: Vendor Control Interface Support 0189 * * 1'b0: Vendor Control Interface is not available on the core. 0190 * * 1'b1: Vendor Control Interface is available. 0191 * @i2c_selection: I2C Selection 0192 * * 1'b0: I2C Interface is not available on the core. 0193 * * 1'b1: I2C Interface is available on the core. 0194 * @otgen: OTG Function Enabled (OtgEn) 0195 * The application uses this bit to indicate the O2P USB core's 0196 * OTG capabilities. 0197 * * 1'b0: Not OTG capable 0198 * * 1'b1: OTG Capable 0199 * @pktsizewidth: Width of Packet Size Counters (PktSizeWidth) 0200 * * 3'b000: 4 bits 0201 * * 3'b001: 5 bits 0202 * * 3'b010: 6 bits 0203 * * 3'b011: 7 bits 0204 * * 3'b100: 8 bits 0205 * * 3'b101: 9 bits 0206 * * 3'b110: 10 bits 0207 * * Others: Reserved 0208 * @xfersizewidth: Width of Transfer Size Counters (XferSizeWidth) 0209 * * 4'b0000: 11 bits 0210 * * 4'b0001: 12 bits 0211 * - ... 0212 * * 4'b1000: 19 bits 0213 * * Others: Reserved 0214 */ 0215 struct cvmx_usbcx_ghwcfg3_s { 0216 __BITFIELD_FIELD(u32 dfifodepth : 16, 0217 __BITFIELD_FIELD(u32 reserved_13_15 : 3, 0218 __BITFIELD_FIELD(u32 ahbphysync : 1, 0219 __BITFIELD_FIELD(u32 rsttype : 1, 0220 __BITFIELD_FIELD(u32 optfeature : 1, 0221 __BITFIELD_FIELD(u32 vendor_control_interface_support : 1, 0222 __BITFIELD_FIELD(u32 i2c_selection : 1, 0223 __BITFIELD_FIELD(u32 otgen : 1, 0224 __BITFIELD_FIELD(u32 pktsizewidth : 3, 0225 __BITFIELD_FIELD(u32 xfersizewidth : 4, 0226 ;)))))))))) 0227 } s; 0228 }; 0229 0230 /** 0231 * cvmx_usbc#_gintmsk 0232 * 0233 * Core Interrupt Mask Register (GINTMSK) 0234 * 0235 * This register works with the Core Interrupt register to interrupt the 0236 * application. When an interrupt bit is masked, the interrupt associated with 0237 * that bit will not be generated. However, the Core Interrupt (GINTSTS) 0238 * register bit corresponding to that interrupt will still be set. 0239 * Mask interrupt: 1'b0, Unmask interrupt: 1'b1 0240 */ 0241 union cvmx_usbcx_gintmsk { 0242 u32 u32; 0243 /** 0244 * struct cvmx_usbcx_gintmsk_s 0245 * @wkupintmsk: Resume/Remote Wakeup Detected Interrupt Mask 0246 * (WkUpIntMsk) 0247 * @sessreqintmsk: Session Request/New Session Detected Interrupt Mask 0248 * (SessReqIntMsk) 0249 * @disconnintmsk: Disconnect Detected Interrupt Mask (DisconnIntMsk) 0250 * @conidstschngmsk: Connector ID Status Change Mask (ConIDStsChngMsk) 0251 * @ptxfempmsk: Periodic TxFIFO Empty Mask (PTxFEmpMsk) 0252 * @hchintmsk: Host Channels Interrupt Mask (HChIntMsk) 0253 * @prtintmsk: Host Port Interrupt Mask (PrtIntMsk) 0254 * @fetsuspmsk: Data Fetch Suspended Mask (FetSuspMsk) 0255 * @incomplpmsk: Incomplete Periodic Transfer Mask (incomplPMsk) 0256 * Incomplete Isochronous OUT Transfer Mask 0257 * (incompISOOUTMsk) 0258 * @incompisoinmsk: Incomplete Isochronous IN Transfer Mask 0259 * (incompISOINMsk) 0260 * @oepintmsk: OUT Endpoints Interrupt Mask (OEPIntMsk) 0261 * @inepintmsk: IN Endpoints Interrupt Mask (INEPIntMsk) 0262 * @epmismsk: Endpoint Mismatch Interrupt Mask (EPMisMsk) 0263 * @eopfmsk: End of Periodic Frame Interrupt Mask (EOPFMsk) 0264 * @isooutdropmsk: Isochronous OUT Packet Dropped Interrupt Mask 0265 * (ISOOutDropMsk) 0266 * @enumdonemsk: Enumeration Done Mask (EnumDoneMsk) 0267 * @usbrstmsk: USB Reset Mask (USBRstMsk) 0268 * @usbsuspmsk: USB Suspend Mask (USBSuspMsk) 0269 * @erlysuspmsk: Early Suspend Mask (ErlySuspMsk) 0270 * @i2cint: I2C Interrupt Mask (I2CINT) 0271 * @ulpickintmsk: ULPI Carkit Interrupt Mask (ULPICKINTMsk) 0272 * I2C Carkit Interrupt Mask (I2CCKINTMsk) 0273 * @goutnakeffmsk: Global OUT NAK Effective Mask (GOUTNakEffMsk) 0274 * @ginnakeffmsk: Global Non-Periodic IN NAK Effective Mask 0275 * (GINNakEffMsk) 0276 * @nptxfempmsk: Non-Periodic TxFIFO Empty Mask (NPTxFEmpMsk) 0277 * @rxflvlmsk: Receive FIFO Non-Empty Mask (RxFLvlMsk) 0278 * @sofmsk: Start of (micro)Frame Mask (SofMsk) 0279 * @otgintmsk: OTG Interrupt Mask (OTGIntMsk) 0280 * @modemismsk: Mode Mismatch Interrupt Mask (ModeMisMsk) 0281 */ 0282 struct cvmx_usbcx_gintmsk_s { 0283 __BITFIELD_FIELD(u32 wkupintmsk : 1, 0284 __BITFIELD_FIELD(u32 sessreqintmsk : 1, 0285 __BITFIELD_FIELD(u32 disconnintmsk : 1, 0286 __BITFIELD_FIELD(u32 conidstschngmsk : 1, 0287 __BITFIELD_FIELD(u32 reserved_27_27 : 1, 0288 __BITFIELD_FIELD(u32 ptxfempmsk : 1, 0289 __BITFIELD_FIELD(u32 hchintmsk : 1, 0290 __BITFIELD_FIELD(u32 prtintmsk : 1, 0291 __BITFIELD_FIELD(u32 reserved_23_23 : 1, 0292 __BITFIELD_FIELD(u32 fetsuspmsk : 1, 0293 __BITFIELD_FIELD(u32 incomplpmsk : 1, 0294 __BITFIELD_FIELD(u32 incompisoinmsk : 1, 0295 __BITFIELD_FIELD(u32 oepintmsk : 1, 0296 __BITFIELD_FIELD(u32 inepintmsk : 1, 0297 __BITFIELD_FIELD(u32 epmismsk : 1, 0298 __BITFIELD_FIELD(u32 reserved_16_16 : 1, 0299 __BITFIELD_FIELD(u32 eopfmsk : 1, 0300 __BITFIELD_FIELD(u32 isooutdropmsk : 1, 0301 __BITFIELD_FIELD(u32 enumdonemsk : 1, 0302 __BITFIELD_FIELD(u32 usbrstmsk : 1, 0303 __BITFIELD_FIELD(u32 usbsuspmsk : 1, 0304 __BITFIELD_FIELD(u32 erlysuspmsk : 1, 0305 __BITFIELD_FIELD(u32 i2cint : 1, 0306 __BITFIELD_FIELD(u32 ulpickintmsk : 1, 0307 __BITFIELD_FIELD(u32 goutnakeffmsk : 1, 0308 __BITFIELD_FIELD(u32 ginnakeffmsk : 1, 0309 __BITFIELD_FIELD(u32 nptxfempmsk : 1, 0310 __BITFIELD_FIELD(u32 rxflvlmsk : 1, 0311 __BITFIELD_FIELD(u32 sofmsk : 1, 0312 __BITFIELD_FIELD(u32 otgintmsk : 1, 0313 __BITFIELD_FIELD(u32 modemismsk : 1, 0314 __BITFIELD_FIELD(u32 reserved_0_0 : 1, 0315 ;)))))))))))))))))))))))))))))))) 0316 } s; 0317 }; 0318 0319 /** 0320 * cvmx_usbc#_gintsts 0321 * 0322 * Core Interrupt Register (GINTSTS) 0323 * 0324 * This register interrupts the application for system-level events in the 0325 * current mode of operation (Device mode or Host mode). It is shown in 0326 * Interrupt. Some of the bits in this register are valid only in Host mode, 0327 * while others are valid in Device mode only. This register also indicates the 0328 * current mode of operation. In order to clear the interrupt status bits of 0329 * type R_SS_WC, the application must write 1'b1 into the bit. The FIFO status 0330 * interrupts are read only; once software reads from or writes to the FIFO 0331 * while servicing these interrupts, FIFO interrupt conditions are cleared 0332 * automatically. 0333 */ 0334 union cvmx_usbcx_gintsts { 0335 u32 u32; 0336 /** 0337 * struct cvmx_usbcx_gintsts_s 0338 * @wkupint: Resume/Remote Wakeup Detected Interrupt (WkUpInt) 0339 * In Device mode, this interrupt is asserted when a resume is 0340 * detected on the USB. In Host mode, this interrupt is asserted 0341 * when a remote wakeup is detected on the USB. 0342 * For more information on how to use this interrupt, see "Partial 0343 * Power-Down and Clock Gating Programming Model" on 0344 * page 353. 0345 * @sessreqint: Session Request/New Session Detected Interrupt 0346 * (SessReqInt) 0347 * In Host mode, this interrupt is asserted when a session request 0348 * is detected from the device. In Device mode, this interrupt is 0349 * asserted when the utmiotg_bvalid signal goes high. 0350 * For more information on how to use this interrupt, see "Partial 0351 * Power-Down and Clock Gating Programming Model" on 0352 * page 353. 0353 * @disconnint: Disconnect Detected Interrupt (DisconnInt) 0354 * Asserted when a device disconnect is detected. 0355 * @conidstschng: Connector ID Status Change (ConIDStsChng) 0356 * The core sets this bit when there is a change in connector ID 0357 * status. 0358 * @ptxfemp: Periodic TxFIFO Empty (PTxFEmp) 0359 * Asserted when the Periodic Transmit FIFO is either half or 0360 * completely empty and there is space for at least one entry to be 0361 * written in the Periodic Request Queue. The half or completely 0362 * empty status is determined by the Periodic TxFIFO Empty Level 0363 * bit in the Core AHB Configuration register 0364 * (GAHBCFG.PTxFEmpLvl). 0365 * @hchint: Host Channels Interrupt (HChInt) 0366 * The core sets this bit to indicate that an interrupt is pending 0367 * on one of the channels of the core (in Host mode). The 0368 * application must read the Host All Channels Interrupt (HAINT) 0369 * register to determine the exact number of the channel on which 0370 * the interrupt occurred, and then read the corresponding Host 0371 * Channel-n Interrupt (HCINTn) register to determine the exact 0372 * cause of the interrupt. The application must clear the 0373 * appropriate status bit in the HCINTn register to clear this bit. 0374 * @prtint: Host Port Interrupt (PrtInt) 0375 * The core sets this bit to indicate a change in port status of 0376 * one of the O2P USB core ports in Host mode. The application must 0377 * read the Host Port Control and Status (HPRT) register to 0378 * determine the exact event that caused this interrupt. The 0379 * application must clear the appropriate status bit in the Host 0380 * Port Control and Status register to clear this bit. 0381 * @fetsusp: Data Fetch Suspended (FetSusp) 0382 * This interrupt is valid only in DMA mode. This interrupt 0383 * indicates that the core has stopped fetching data for IN 0384 * endpoints due to the unavailability of TxFIFO space or Request 0385 * Queue space. This interrupt is used by the application for an 0386 * endpoint mismatch algorithm. 0387 * @incomplp: Incomplete Periodic Transfer (incomplP) 0388 * In Host mode, the core sets this interrupt bit when there are 0389 * incomplete periodic transactions still pending which are 0390 * scheduled for the current microframe. 0391 * Incomplete Isochronous OUT Transfer (incompISOOUT) 0392 * The Device mode, the core sets this interrupt to indicate that 0393 * there is at least one isochronous OUT endpoint on which the 0394 * transfer is not completed in the current microframe. This 0395 * interrupt is asserted along with the End of Periodic Frame 0396 * Interrupt (EOPF) bit in this register. 0397 * @incompisoin: Incomplete Isochronous IN Transfer (incompISOIN) 0398 * The core sets this interrupt to indicate that there is at least 0399 * one isochronous IN endpoint on which the transfer is not 0400 * completed in the current microframe. This interrupt is asserted 0401 * along with the End of Periodic Frame Interrupt (EOPF) bit in 0402 * this register. 0403 * @oepint: OUT Endpoints Interrupt (OEPInt) 0404 * The core sets this bit to indicate that an interrupt is pending 0405 * on one of the OUT endpoints of the core (in Device mode). The 0406 * application must read the Device All Endpoints Interrupt 0407 * (DAINT) register to determine the exact number of the OUT 0408 * endpoint on which the interrupt occurred, and then read the 0409 * corresponding Device OUT Endpoint-n Interrupt (DOEPINTn) 0410 * register to determine the exact cause of the interrupt. The 0411 * application must clear the appropriate status bit in the 0412 * corresponding DOEPINTn register to clear this bit. 0413 * @iepint: IN Endpoints Interrupt (IEPInt) 0414 * The core sets this bit to indicate that an interrupt is pending 0415 * on one of the IN endpoints of the core (in Device mode). The 0416 * application must read the Device All Endpoints Interrupt 0417 * (DAINT) register to determine the exact number of the IN 0418 * endpoint on which the interrupt occurred, and then read the 0419 * corresponding Device IN Endpoint-n Interrupt (DIEPINTn) 0420 * register to determine the exact cause of the interrupt. The 0421 * application must clear the appropriate status bit in the 0422 * corresponding DIEPINTn register to clear this bit. 0423 * @epmis: Endpoint Mismatch Interrupt (EPMis) 0424 * Indicates that an IN token has been received for a non-periodic 0425 * endpoint, but the data for another endpoint is present in the 0426 * top of the Non-Periodic Transmit FIFO and the IN endpoint 0427 * mismatch count programmed by the application has expired. 0428 * @eopf: End of Periodic Frame Interrupt (EOPF) 0429 * Indicates that the period specified in the Periodic Frame 0430 * Interval field of the Device Configuration register 0431 * (DCFG.PerFrInt) has been reached in the current microframe. 0432 * @isooutdrop: Isochronous OUT Packet Dropped Interrupt (ISOOutDrop) 0433 * The core sets this bit when it fails to write an isochronous OUT 0434 * packet into the RxFIFO because the RxFIFO doesn't have 0435 * enough space to accommodate a maximum packet size packet 0436 * for the isochronous OUT endpoint. 0437 * @enumdone: Enumeration Done (EnumDone) 0438 * The core sets this bit to indicate that speed enumeration is 0439 * complete. The application must read the Device Status (DSTS) 0440 * register to obtain the enumerated speed. 0441 * @usbrst: USB Reset (USBRst) 0442 * The core sets this bit to indicate that a reset is detected on 0443 * the USB. 0444 * @usbsusp: USB Suspend (USBSusp) 0445 * The core sets this bit to indicate that a suspend was detected 0446 * on the USB. The core enters the Suspended state when there 0447 * is no activity on the phy_line_state_i signal for an extended 0448 * period of time. 0449 * @erlysusp: Early Suspend (ErlySusp) 0450 * The core sets this bit to indicate that an Idle state has been 0451 * detected on the USB for 3 ms. 0452 * @i2cint: I2C Interrupt (I2CINT) 0453 * This bit is always 0x0. 0454 * @ulpickint: ULPI Carkit Interrupt (ULPICKINT) 0455 * This bit is always 0x0. 0456 * @goutnakeff: Global OUT NAK Effective (GOUTNakEff) 0457 * Indicates that the Set Global OUT NAK bit in the Device Control 0458 * register (DCTL.SGOUTNak), set by the application, has taken 0459 * effect in the core. This bit can be cleared by writing the Clear 0460 * Global OUT NAK bit in the Device Control register 0461 * (DCTL.CGOUTNak). 0462 * @ginnakeff: Global IN Non-Periodic NAK Effective (GINNakEff) 0463 * Indicates that the Set Global Non-Periodic IN NAK bit in the 0464 * Device Control register (DCTL.SGNPInNak), set by the 0465 * application, has taken effect in the core. That is, the core has 0466 * sampled the Global IN NAK bit set by the application. This bit 0467 * can be cleared by clearing the Clear Global Non-Periodic IN 0468 * NAK bit in the Device Control register (DCTL.CGNPInNak). 0469 * This interrupt does not necessarily mean that a NAK handshake 0470 * is sent out on the USB. The STALL bit takes precedence over 0471 * the NAK bit. 0472 * @nptxfemp: Non-Periodic TxFIFO Empty (NPTxFEmp) 0473 * This interrupt is asserted when the Non-Periodic TxFIFO is 0474 * either half or completely empty, and there is space for at least 0475 * one entry to be written to the Non-Periodic Transmit Request 0476 * Queue. The half or completely empty status is determined by 0477 * the Non-Periodic TxFIFO Empty Level bit in the Core AHB 0478 * Configuration register (GAHBCFG.NPTxFEmpLvl). 0479 * @rxflvl: RxFIFO Non-Empty (RxFLvl) 0480 * Indicates that there is at least one packet pending to be read 0481 * from the RxFIFO. 0482 * @sof: Start of (micro)Frame (Sof) 0483 * In Host mode, the core sets this bit to indicate that an SOF 0484 * (FS), micro-SOF (HS), or Keep-Alive (LS) is transmitted on the 0485 * USB. The application must write a 1 to this bit to clear the 0486 * interrupt. 0487 * In Device mode, in the core sets this bit to indicate that an 0488 * SOF token has been received on the USB. The application can read 0489 * the Device Status register to get the current (micro)frame 0490 * number. This interrupt is seen only when the core is operating 0491 * at either HS or FS. 0492 * @otgint: OTG Interrupt (OTGInt) 0493 * The core sets this bit to indicate an OTG protocol event. The 0494 * application must read the OTG Interrupt Status (GOTGINT) 0495 * register to determine the exact event that caused this 0496 * interrupt. The application must clear the appropriate status bit 0497 * in the GOTGINT register to clear this bit. 0498 * @modemis: Mode Mismatch Interrupt (ModeMis) 0499 * The core sets this bit when the application is trying to access: 0500 * * A Host mode register, when the core is operating in Device 0501 * mode 0502 * * A Device mode register, when the core is operating in Host 0503 * mode 0504 * The register access is completed on the AHB with an OKAY 0505 * response, but is ignored by the core internally and doesn't 0506 * affect the operation of the core. 0507 * @curmod: Current Mode of Operation (CurMod) 0508 * Indicates the current mode of operation. 0509 * * 1'b0: Device mode 0510 * * 1'b1: Host mode 0511 */ 0512 struct cvmx_usbcx_gintsts_s { 0513 __BITFIELD_FIELD(u32 wkupint : 1, 0514 __BITFIELD_FIELD(u32 sessreqint : 1, 0515 __BITFIELD_FIELD(u32 disconnint : 1, 0516 __BITFIELD_FIELD(u32 conidstschng : 1, 0517 __BITFIELD_FIELD(u32 reserved_27_27 : 1, 0518 __BITFIELD_FIELD(u32 ptxfemp : 1, 0519 __BITFIELD_FIELD(u32 hchint : 1, 0520 __BITFIELD_FIELD(u32 prtint : 1, 0521 __BITFIELD_FIELD(u32 reserved_23_23 : 1, 0522 __BITFIELD_FIELD(u32 fetsusp : 1, 0523 __BITFIELD_FIELD(u32 incomplp : 1, 0524 __BITFIELD_FIELD(u32 incompisoin : 1, 0525 __BITFIELD_FIELD(u32 oepint : 1, 0526 __BITFIELD_FIELD(u32 iepint : 1, 0527 __BITFIELD_FIELD(u32 epmis : 1, 0528 __BITFIELD_FIELD(u32 reserved_16_16 : 1, 0529 __BITFIELD_FIELD(u32 eopf : 1, 0530 __BITFIELD_FIELD(u32 isooutdrop : 1, 0531 __BITFIELD_FIELD(u32 enumdone : 1, 0532 __BITFIELD_FIELD(u32 usbrst : 1, 0533 __BITFIELD_FIELD(u32 usbsusp : 1, 0534 __BITFIELD_FIELD(u32 erlysusp : 1, 0535 __BITFIELD_FIELD(u32 i2cint : 1, 0536 __BITFIELD_FIELD(u32 ulpickint : 1, 0537 __BITFIELD_FIELD(u32 goutnakeff : 1, 0538 __BITFIELD_FIELD(u32 ginnakeff : 1, 0539 __BITFIELD_FIELD(u32 nptxfemp : 1, 0540 __BITFIELD_FIELD(u32 rxflvl : 1, 0541 __BITFIELD_FIELD(u32 sof : 1, 0542 __BITFIELD_FIELD(u32 otgint : 1, 0543 __BITFIELD_FIELD(u32 modemis : 1, 0544 __BITFIELD_FIELD(u32 curmod : 1, 0545 ;)))))))))))))))))))))))))))))))) 0546 } s; 0547 }; 0548 0549 /** 0550 * cvmx_usbc#_gnptxfsiz 0551 * 0552 * Non-Periodic Transmit FIFO Size Register (GNPTXFSIZ) 0553 * 0554 * The application can program the RAM size and the memory start address for the 0555 * Non-Periodic TxFIFO. 0556 */ 0557 union cvmx_usbcx_gnptxfsiz { 0558 u32 u32; 0559 /** 0560 * struct cvmx_usbcx_gnptxfsiz_s 0561 * @nptxfdep: Non-Periodic TxFIFO Depth (NPTxFDep) 0562 * This value is in terms of 32-bit words. 0563 * Minimum value is 16 0564 * Maximum value is 32768 0565 * @nptxfstaddr: Non-Periodic Transmit RAM Start Address (NPTxFStAddr) 0566 * This field contains the memory start address for Non-Periodic 0567 * Transmit FIFO RAM. 0568 */ 0569 struct cvmx_usbcx_gnptxfsiz_s { 0570 __BITFIELD_FIELD(u32 nptxfdep : 16, 0571 __BITFIELD_FIELD(u32 nptxfstaddr : 16, 0572 ;)) 0573 } s; 0574 }; 0575 0576 /** 0577 * cvmx_usbc#_gnptxsts 0578 * 0579 * Non-Periodic Transmit FIFO/Queue Status Register (GNPTXSTS) 0580 * 0581 * This read-only register contains the free space information for the 0582 * Non-Periodic TxFIFO and the Non-Periodic Transmit Request Queue. 0583 */ 0584 union cvmx_usbcx_gnptxsts { 0585 u32 u32; 0586 /** 0587 * struct cvmx_usbcx_gnptxsts_s 0588 * @nptxqtop: Top of the Non-Periodic Transmit Request Queue (NPTxQTop) 0589 * Entry in the Non-Periodic Tx Request Queue that is currently 0590 * being processed by the MAC. 0591 * * Bits [30:27]: Channel/endpoint number 0592 * * Bits [26:25]: 0593 * - 2'b00: IN/OUT token 0594 * - 2'b01: Zero-length transmit packet (device IN/host OUT) 0595 * - 2'b10: PING/CSPLIT token 0596 * - 2'b11: Channel halt command 0597 * * Bit [24]: Terminate (last entry for selected channel/endpoint) 0598 * @nptxqspcavail: Non-Periodic Transmit Request Queue Space Available 0599 * (NPTxQSpcAvail) 0600 * Indicates the amount of free space available in the Non- 0601 * Periodic Transmit Request Queue. This queue holds both IN 0602 * and OUT requests in Host mode. Device mode has only IN 0603 * requests. 0604 * * 8'h0: Non-Periodic Transmit Request Queue is full 0605 * * 8'h1: 1 location available 0606 * * 8'h2: 2 locations available 0607 * * n: n locations available (0..8) 0608 * * Others: Reserved 0609 * @nptxfspcavail: Non-Periodic TxFIFO Space Avail (NPTxFSpcAvail) 0610 * Indicates the amount of free space available in the Non- 0611 * Periodic TxFIFO. 0612 * Values are in terms of 32-bit words. 0613 * * 16'h0: Non-Periodic TxFIFO is full 0614 * * 16'h1: 1 word available 0615 * * 16'h2: 2 words available 0616 * * 16'hn: n words available (where 0..32768) 0617 * * 16'h8000: 32768 words available 0618 * * Others: Reserved 0619 */ 0620 struct cvmx_usbcx_gnptxsts_s { 0621 __BITFIELD_FIELD(u32 reserved_31_31 : 1, 0622 __BITFIELD_FIELD(u32 nptxqtop : 7, 0623 __BITFIELD_FIELD(u32 nptxqspcavail : 8, 0624 __BITFIELD_FIELD(u32 nptxfspcavail : 16, 0625 ;)))) 0626 } s; 0627 }; 0628 0629 /** 0630 * cvmx_usbc#_grstctl 0631 * 0632 * Core Reset Register (GRSTCTL) 0633 * 0634 * The application uses this register to reset various hardware features inside 0635 * the core. 0636 */ 0637 union cvmx_usbcx_grstctl { 0638 u32 u32; 0639 /** 0640 * struct cvmx_usbcx_grstctl_s 0641 * @ahbidle: AHB Master Idle (AHBIdle) 0642 * Indicates that the AHB Master State Machine is in the IDLE 0643 * condition. 0644 * @dmareq: DMA Request Signal (DMAReq) 0645 * Indicates that the DMA request is in progress. Used for debug. 0646 * @txfnum: TxFIFO Number (TxFNum) 0647 * This is the FIFO number that must be flushed using the TxFIFO 0648 * Flush bit. This field must not be changed until the core clears 0649 * the TxFIFO Flush bit. 0650 * * 5'h0: Non-Periodic TxFIFO flush 0651 * * 5'h1: Periodic TxFIFO 1 flush in Device mode or Periodic 0652 * TxFIFO flush in Host mode 0653 * * 5'h2: Periodic TxFIFO 2 flush in Device mode 0654 * - ... 0655 * * 5'hF: Periodic TxFIFO 15 flush in Device mode 0656 * * 5'h10: Flush all the Periodic and Non-Periodic TxFIFOs in the 0657 * core 0658 * @txfflsh: TxFIFO Flush (TxFFlsh) 0659 * This bit selectively flushes a single or all transmit FIFOs, but 0660 * cannot do so if the core is in the midst of a transaction. 0661 * The application must only write this bit after checking that the 0662 * core is neither writing to the TxFIFO nor reading from the 0663 * TxFIFO. 0664 * The application must wait until the core clears this bit before 0665 * performing any operations. This bit takes 8 clocks (of phy_clk 0666 * or hclk, whichever is slower) to clear. 0667 * @rxfflsh: RxFIFO Flush (RxFFlsh) 0668 * The application can flush the entire RxFIFO using this bit, but 0669 * must first ensure that the core is not in the middle of a 0670 * transaction. 0671 * The application must only write to this bit after checking that 0672 * the core is neither reading from the RxFIFO nor writing to the 0673 * RxFIFO. 0674 * The application must wait until the bit is cleared before 0675 * performing any other operations. This bit will take 8 clocks 0676 * (slowest of PHY or AHB clock) to clear. 0677 * @intknqflsh: IN Token Sequence Learning Queue Flush (INTknQFlsh) 0678 * The application writes this bit to flush the IN Token Sequence 0679 * Learning Queue. 0680 * @frmcntrrst: Host Frame Counter Reset (FrmCntrRst) 0681 * The application writes this bit to reset the (micro)frame number 0682 * counter inside the core. When the (micro)frame counter is reset, 0683 * the subsequent SOF sent out by the core will have a 0684 * (micro)frame number of 0. 0685 * @hsftrst: HClk Soft Reset (HSftRst) 0686 * The application uses this bit to flush the control logic in the 0687 * AHB Clock domain. Only AHB Clock Domain pipelines are reset. 0688 * * FIFOs are not flushed with this bit. 0689 * * All state machines in the AHB clock domain are reset to the 0690 * Idle state after terminating the transactions on the AHB, 0691 * following the protocol. 0692 * * CSR control bits used by the AHB clock domain state 0693 * machines are cleared. 0694 * * To clear this interrupt, status mask bits that control the 0695 * interrupt status and are generated by the AHB clock domain 0696 * state machine are cleared. 0697 * * Because interrupt status bits are not cleared, the application 0698 * can get the status of any core events that occurred after it set 0699 * this bit. 0700 * This is a self-clearing bit that the core clears after all 0701 * necessary logic is reset in the core. This may take several 0702 * clocks, depending on the core's current state. 0703 * @csftrst: Core Soft Reset (CSftRst) 0704 * Resets the hclk and phy_clock domains as follows: 0705 * * Clears the interrupts and all the CSR registers except the 0706 * following register bits: 0707 * - PCGCCTL.RstPdwnModule 0708 * - PCGCCTL.GateHclk 0709 * - PCGCCTL.PwrClmp 0710 * - PCGCCTL.StopPPhyLPwrClkSelclk 0711 * - GUSBCFG.PhyLPwrClkSel 0712 * - GUSBCFG.DDRSel 0713 * - GUSBCFG.PHYSel 0714 * - GUSBCFG.FSIntf 0715 * - GUSBCFG.ULPI_UTMI_Sel 0716 * - GUSBCFG.PHYIf 0717 * - HCFG.FSLSPclkSel 0718 * - DCFG.DevSpd 0719 * * All module state machines (except the AHB Slave Unit) are 0720 * reset to the IDLE state, and all the transmit FIFOs and the 0721 * receive FIFO are flushed. 0722 * * Any transactions on the AHB Master are terminated as soon 0723 * as possible, after gracefully completing the last data phase of 0724 * an AHB transfer. Any transactions on the USB are terminated 0725 * immediately. 0726 * The application can write to this bit any time it wants to reset 0727 * the core. This is a self-clearing bit and the core clears this 0728 * bit after all the necessary logic is reset in the core, which 0729 * may take several clocks, depending on the current state of the 0730 * core. Once this bit is cleared software should wait at least 3 0731 * PHY clocks before doing any access to the PHY domain 0732 * (synchronization delay). Software should also should check that 0733 * bit 31 of this register is 1 (AHB Master is IDLE) before 0734 * starting any operation. 0735 * Typically software reset is used during software development 0736 * and also when you dynamically change the PHY selection bits 0737 * in the USB configuration registers listed above. When you 0738 * change the PHY, the corresponding clock for the PHY is 0739 * selected and used in the PHY domain. Once a new clock is 0740 * selected, the PHY domain has to be reset for proper operation. 0741 */ 0742 struct cvmx_usbcx_grstctl_s { 0743 __BITFIELD_FIELD(u32 ahbidle : 1, 0744 __BITFIELD_FIELD(u32 dmareq : 1, 0745 __BITFIELD_FIELD(u32 reserved_11_29 : 19, 0746 __BITFIELD_FIELD(u32 txfnum : 5, 0747 __BITFIELD_FIELD(u32 txfflsh : 1, 0748 __BITFIELD_FIELD(u32 rxfflsh : 1, 0749 __BITFIELD_FIELD(u32 intknqflsh : 1, 0750 __BITFIELD_FIELD(u32 frmcntrrst : 1, 0751 __BITFIELD_FIELD(u32 hsftrst : 1, 0752 __BITFIELD_FIELD(u32 csftrst : 1, 0753 ;)))))))))) 0754 } s; 0755 }; 0756 0757 /** 0758 * cvmx_usbc#_grxfsiz 0759 * 0760 * Receive FIFO Size Register (GRXFSIZ) 0761 * 0762 * The application can program the RAM size that must be allocated to the 0763 * RxFIFO. 0764 */ 0765 union cvmx_usbcx_grxfsiz { 0766 u32 u32; 0767 /** 0768 * struct cvmx_usbcx_grxfsiz_s 0769 * @rxfdep: RxFIFO Depth (RxFDep) 0770 * This value is in terms of 32-bit words. 0771 * * Minimum value is 16 0772 * * Maximum value is 32768 0773 */ 0774 struct cvmx_usbcx_grxfsiz_s { 0775 __BITFIELD_FIELD(u32 reserved_16_31 : 16, 0776 __BITFIELD_FIELD(u32 rxfdep : 16, 0777 ;)) 0778 } s; 0779 }; 0780 0781 /** 0782 * cvmx_usbc#_grxstsph 0783 * 0784 * Receive Status Read and Pop Register, Host Mode (GRXSTSPH) 0785 * 0786 * A read to the Receive Status Read and Pop register returns and additionally 0787 * pops the top data entry out of the RxFIFO. 0788 * This Description is only valid when the core is in Host Mode. For Device Mode 0789 * use USBC_GRXSTSPD instead. 0790 * NOTE: GRXSTSPH and GRXSTSPD are physically the same register and share the 0791 * same offset in the O2P USB core. The offset difference shown in this 0792 * document is for software clarity and is actually ignored by the 0793 * hardware. 0794 */ 0795 union cvmx_usbcx_grxstsph { 0796 u32 u32; 0797 /** 0798 * struct cvmx_usbcx_grxstsph_s 0799 * @pktsts: Packet Status (PktSts) 0800 * Indicates the status of the received packet 0801 * * 4'b0010: IN data packet received 0802 * * 4'b0011: IN transfer completed (triggers an interrupt) 0803 * * 4'b0101: Data toggle error (triggers an interrupt) 0804 * * 4'b0111: Channel halted (triggers an interrupt) 0805 * * Others: Reserved 0806 * @dpid: Data PID (DPID) 0807 * * 2'b00: DATA0 0808 * * 2'b10: DATA1 0809 * * 2'b01: DATA2 0810 * * 2'b11: MDATA 0811 * @bcnt: Byte Count (BCnt) 0812 * Indicates the byte count of the received IN data packet 0813 * @chnum: Channel Number (ChNum) 0814 * Indicates the channel number to which the current received 0815 * packet belongs. 0816 */ 0817 struct cvmx_usbcx_grxstsph_s { 0818 __BITFIELD_FIELD(u32 reserved_21_31 : 11, 0819 __BITFIELD_FIELD(u32 pktsts : 4, 0820 __BITFIELD_FIELD(u32 dpid : 2, 0821 __BITFIELD_FIELD(u32 bcnt : 11, 0822 __BITFIELD_FIELD(u32 chnum : 4, 0823 ;))))) 0824 } s; 0825 }; 0826 0827 /** 0828 * cvmx_usbc#_gusbcfg 0829 * 0830 * Core USB Configuration Register (GUSBCFG) 0831 * 0832 * This register can be used to configure the core after power-on or a changing 0833 * to Host mode or Device mode. It contains USB and USB-PHY related 0834 * configuration parameters. The application must program this register before 0835 * starting any transactions on either the AHB or the USB. Do not make changes 0836 * to this register after the initial programming. 0837 */ 0838 union cvmx_usbcx_gusbcfg { 0839 u32 u32; 0840 /** 0841 * struct cvmx_usbcx_gusbcfg_s 0842 * @otgi2csel: UTMIFS or I2C Interface Select (OtgI2CSel) 0843 * This bit is always 0x0. 0844 * @phylpwrclksel: PHY Low-Power Clock Select (PhyLPwrClkSel) 0845 * Software should set this bit to 0x0. 0846 * Selects either 480-MHz or 48-MHz (low-power) PHY mode. In 0847 * FS and LS modes, the PHY can usually operate on a 48-MHz 0848 * clock to save power. 0849 * * 1'b0: 480-MHz Internal PLL clock 0850 * * 1'b1: 48-MHz External Clock 0851 * In 480 MHz mode, the UTMI interface operates at either 60 or 0852 * 30-MHz, depending upon whether 8- or 16-bit data width is 0853 * selected. In 48-MHz mode, the UTMI interface operates at 48 0854 * MHz in FS mode and at either 48 or 6 MHz in LS mode 0855 * (depending on the PHY vendor). 0856 * This bit drives the utmi_fsls_low_power core output signal, and 0857 * is valid only for UTMI+ PHYs. 0858 * @usbtrdtim: USB Turnaround Time (USBTrdTim) 0859 * Sets the turnaround time in PHY clocks. 0860 * Specifies the response time for a MAC request to the Packet 0861 * FIFO Controller (PFC) to fetch data from the DFIFO (SPRAM). 0862 * This must be programmed to 0x5. 0863 * @hnpcap: HNP-Capable (HNPCap) 0864 * This bit is always 0x0. 0865 * @srpcap: SRP-Capable (SRPCap) 0866 * This bit is always 0x0. 0867 * @ddrsel: ULPI DDR Select (DDRSel) 0868 * Software should set this bit to 0x0. 0869 * @physel: USB 2.0 High-Speed PHY or USB 1.1 Full-Speed Serial 0870 * Software should set this bit to 0x0. 0871 * @fsintf: Full-Speed Serial Interface Select (FSIntf) 0872 * Software should set this bit to 0x0. 0873 * @ulpi_utmi_sel: ULPI or UTMI+ Select (ULPI_UTMI_Sel) 0874 * This bit is always 0x0. 0875 * @phyif: PHY Interface (PHYIf) 0876 * This bit is always 0x1. 0877 * @toutcal: HS/FS Timeout Calibration (TOutCal) 0878 * The number of PHY clocks that the application programs in this 0879 * field is added to the high-speed/full-speed interpacket timeout 0880 * duration in the core to account for any additional delays 0881 * introduced by the PHY. This may be required, since the delay 0882 * introduced by the PHY in generating the linestate condition may 0883 * vary from one PHY to another. 0884 * The USB standard timeout value for high-speed operation is 0885 * 736 to 816 (inclusive) bit times. The USB standard timeout 0886 * value for full-speed operation is 16 to 18 (inclusive) bit 0887 * times. The application must program this field based on the 0888 * speed of enumeration. The number of bit times added per PHY 0889 * clock are: 0890 * High-speed operation: 0891 * * One 30-MHz PHY clock = 16 bit times 0892 * * One 60-MHz PHY clock = 8 bit times 0893 * Full-speed operation: 0894 * * One 30-MHz PHY clock = 0.4 bit times 0895 * * One 60-MHz PHY clock = 0.2 bit times 0896 * * One 48-MHz PHY clock = 0.25 bit times 0897 */ 0898 struct cvmx_usbcx_gusbcfg_s { 0899 __BITFIELD_FIELD(u32 reserved_17_31 : 15, 0900 __BITFIELD_FIELD(u32 otgi2csel : 1, 0901 __BITFIELD_FIELD(u32 phylpwrclksel : 1, 0902 __BITFIELD_FIELD(u32 reserved_14_14 : 1, 0903 __BITFIELD_FIELD(u32 usbtrdtim : 4, 0904 __BITFIELD_FIELD(u32 hnpcap : 1, 0905 __BITFIELD_FIELD(u32 srpcap : 1, 0906 __BITFIELD_FIELD(u32 ddrsel : 1, 0907 __BITFIELD_FIELD(u32 physel : 1, 0908 __BITFIELD_FIELD(u32 fsintf : 1, 0909 __BITFIELD_FIELD(u32 ulpi_utmi_sel : 1, 0910 __BITFIELD_FIELD(u32 phyif : 1, 0911 __BITFIELD_FIELD(u32 toutcal : 3, 0912 ;))))))))))))) 0913 } s; 0914 }; 0915 0916 /** 0917 * cvmx_usbc#_haint 0918 * 0919 * Host All Channels Interrupt Register (HAINT) 0920 * 0921 * When a significant event occurs on a channel, the Host All Channels Interrupt 0922 * register interrupts the application using the Host Channels Interrupt bit of 0923 * the Core Interrupt register (GINTSTS.HChInt). This is shown in Interrupt. 0924 * There is one interrupt bit per channel, up to a maximum of 16 bits. Bits in 0925 * this register are set and cleared when the application sets and clears bits 0926 * in the corresponding Host Channel-n Interrupt register. 0927 */ 0928 union cvmx_usbcx_haint { 0929 u32 u32; 0930 /** 0931 * struct cvmx_usbcx_haint_s 0932 * @haint: Channel Interrupts (HAINT) 0933 * One bit per channel: Bit 0 for Channel 0, bit 15 for Channel 15 0934 */ 0935 struct cvmx_usbcx_haint_s { 0936 __BITFIELD_FIELD(u32 reserved_16_31 : 16, 0937 __BITFIELD_FIELD(u32 haint : 16, 0938 ;)) 0939 } s; 0940 }; 0941 0942 /** 0943 * cvmx_usbc#_haintmsk 0944 * 0945 * Host All Channels Interrupt Mask Register (HAINTMSK) 0946 * 0947 * The Host All Channel Interrupt Mask register works with the Host All Channel 0948 * Interrupt register to interrupt the application when an event occurs on a 0949 * channel. There is one interrupt mask bit per channel, up to a maximum of 16 0950 * bits. 0951 * Mask interrupt: 1'b0 Unmask interrupt: 1'b1 0952 */ 0953 union cvmx_usbcx_haintmsk { 0954 u32 u32; 0955 /** 0956 * struct cvmx_usbcx_haintmsk_s 0957 * @haintmsk: Channel Interrupt Mask (HAINTMsk) 0958 * One bit per channel: Bit 0 for channel 0, bit 15 for channel 15 0959 */ 0960 struct cvmx_usbcx_haintmsk_s { 0961 __BITFIELD_FIELD(u32 reserved_16_31 : 16, 0962 __BITFIELD_FIELD(u32 haintmsk : 16, 0963 ;)) 0964 } s; 0965 }; 0966 0967 /** 0968 * cvmx_usbc#_hcchar# 0969 * 0970 * Host Channel-n Characteristics Register (HCCHAR) 0971 * 0972 */ 0973 union cvmx_usbcx_hccharx { 0974 u32 u32; 0975 /** 0976 * struct cvmx_usbcx_hccharx_s 0977 * @chena: Channel Enable (ChEna) 0978 * This field is set by the application and cleared by the OTG 0979 * host. 0980 * * 1'b0: Channel disabled 0981 * * 1'b1: Channel enabled 0982 * @chdis: Channel Disable (ChDis) 0983 * The application sets this bit to stop transmitting/receiving 0984 * data on a channel, even before the transfer for that channel is 0985 * complete. The application must wait for the Channel Disabled 0986 * interrupt before treating the channel as disabled. 0987 * @oddfrm: Odd Frame (OddFrm) 0988 * This field is set (reset) by the application to indicate that 0989 * the OTG host must perform a transfer in an odd (micro)frame. 0990 * This field is applicable for only periodic (isochronous and 0991 * interrupt) transactions. 0992 * * 1'b0: Even (micro)frame 0993 * * 1'b1: Odd (micro)frame 0994 * @devaddr: Device Address (DevAddr) 0995 * This field selects the specific device serving as the data 0996 * source or sink. 0997 * @ec: Multi Count (MC) / Error Count (EC) 0998 * When the Split Enable bit of the Host Channel-n Split Control 0999 * register (HCSPLTn.SpltEna) is reset (1'b0), this field indicates 1000 * to the host the number of transactions that should be executed 1001 * per microframe for this endpoint. 1002 * * 2'b00: Reserved. This field yields undefined results. 1003 * * 2'b01: 1 transaction 1004 * * 2'b10: 2 transactions to be issued for this endpoint per 1005 * microframe 1006 * * 2'b11: 3 transactions to be issued for this endpoint per 1007 * microframe 1008 * When HCSPLTn.SpltEna is set (1'b1), this field indicates the 1009 * number of immediate retries to be performed for a periodic split 1010 * transactions on transaction errors. This field must be set to at 1011 * least 2'b01. 1012 * @eptype: Endpoint Type (EPType) 1013 * Indicates the transfer type selected. 1014 * * 2'b00: Control 1015 * * 2'b01: Isochronous 1016 * * 2'b10: Bulk 1017 * * 2'b11: Interrupt 1018 * @lspddev: Low-Speed Device (LSpdDev) 1019 * This field is set by the application to indicate that this 1020 * channel is communicating to a low-speed device. 1021 * @epdir: Endpoint Direction (EPDir) 1022 * Indicates whether the transaction is IN or OUT. 1023 * * 1'b0: OUT 1024 * * 1'b1: IN 1025 * @epnum: Endpoint Number (EPNum) 1026 * Indicates the endpoint number on the device serving as the 1027 * data source or sink. 1028 * @mps: Maximum Packet Size (MPS) 1029 * Indicates the maximum packet size of the associated endpoint. 1030 */ 1031 struct cvmx_usbcx_hccharx_s { 1032 __BITFIELD_FIELD(u32 chena : 1, 1033 __BITFIELD_FIELD(u32 chdis : 1, 1034 __BITFIELD_FIELD(u32 oddfrm : 1, 1035 __BITFIELD_FIELD(u32 devaddr : 7, 1036 __BITFIELD_FIELD(u32 ec : 2, 1037 __BITFIELD_FIELD(u32 eptype : 2, 1038 __BITFIELD_FIELD(u32 lspddev : 1, 1039 __BITFIELD_FIELD(u32 reserved_16_16 : 1, 1040 __BITFIELD_FIELD(u32 epdir : 1, 1041 __BITFIELD_FIELD(u32 epnum : 4, 1042 __BITFIELD_FIELD(u32 mps : 11, 1043 ;))))))))))) 1044 } s; 1045 }; 1046 1047 /** 1048 * cvmx_usbc#_hcfg 1049 * 1050 * Host Configuration Register (HCFG) 1051 * 1052 * This register configures the core after power-on. Do not make changes to this 1053 * register after initializing the host. 1054 */ 1055 union cvmx_usbcx_hcfg { 1056 u32 u32; 1057 /** 1058 * struct cvmx_usbcx_hcfg_s 1059 * @fslssupp: FS- and LS-Only Support (FSLSSupp) 1060 * The application uses this bit to control the core's enumeration 1061 * speed. Using this bit, the application can make the core 1062 * enumerate as a FS host, even if the connected device supports 1063 * HS traffic. Do not make changes to this field after initial 1064 * programming. 1065 * * 1'b0: HS/FS/LS, based on the maximum speed supported by 1066 * the connected device 1067 * * 1'b1: FS/LS-only, even if the connected device can support HS 1068 * @fslspclksel: FS/LS PHY Clock Select (FSLSPclkSel) 1069 * When the core is in FS Host mode 1070 * * 2'b00: PHY clock is running at 30/60 MHz 1071 * * 2'b01: PHY clock is running at 48 MHz 1072 * * Others: Reserved 1073 * When the core is in LS Host mode 1074 * * 2'b00: PHY clock is running at 30/60 MHz. When the 1075 * UTMI+/ULPI PHY Low Power mode is not selected, use 1076 * 30/60 MHz. 1077 * * 2'b01: PHY clock is running at 48 MHz. When the UTMI+ 1078 * PHY Low Power mode is selected, use 48MHz if the PHY 1079 * supplies a 48 MHz clock during LS mode. 1080 * * 2'b10: PHY clock is running at 6 MHz. In USB 1.1 FS mode, 1081 * use 6 MHz when the UTMI+ PHY Low Power mode is 1082 * selected and the PHY supplies a 6 MHz clock during LS 1083 * mode. If you select a 6 MHz clock during LS mode, you must 1084 * do a soft reset. 1085 * * 2'b11: Reserved 1086 */ 1087 struct cvmx_usbcx_hcfg_s { 1088 __BITFIELD_FIELD(u32 reserved_3_31 : 29, 1089 __BITFIELD_FIELD(u32 fslssupp : 1, 1090 __BITFIELD_FIELD(u32 fslspclksel : 2, 1091 ;))) 1092 } s; 1093 }; 1094 1095 /** 1096 * cvmx_usbc#_hcint# 1097 * 1098 * Host Channel-n Interrupt Register (HCINT) 1099 * 1100 * This register indicates the status of a channel with respect to USB- and 1101 * AHB-related events. The application must read this register when the Host 1102 * Channels Interrupt bit of the Core Interrupt register (GINTSTS.HChInt) is 1103 * set. Before the application can read this register, it must first read 1104 * the Host All Channels Interrupt (HAINT) register to get the exact channel 1105 * number for the Host Channel-n Interrupt register. The application must clear 1106 * the appropriate bit in this register to clear the corresponding bits in the 1107 * HAINT and GINTSTS registers. 1108 */ 1109 union cvmx_usbcx_hcintx { 1110 u32 u32; 1111 /** 1112 * struct cvmx_usbcx_hcintx_s 1113 * @datatglerr: Data Toggle Error (DataTglErr) 1114 * @frmovrun: Frame Overrun (FrmOvrun) 1115 * @bblerr: Babble Error (BblErr) 1116 * @xacterr: Transaction Error (XactErr) 1117 * @nyet: NYET Response Received Interrupt (NYET) 1118 * @ack: ACK Response Received Interrupt (ACK) 1119 * @nak: NAK Response Received Interrupt (NAK) 1120 * @stall: STALL Response Received Interrupt (STALL) 1121 * @ahberr: This bit is always 0x0. 1122 * @chhltd: Channel Halted (ChHltd) 1123 * Indicates the transfer completed abnormally either because of 1124 * any USB transaction error or in response to disable request by 1125 * the application. 1126 * @xfercompl: Transfer Completed (XferCompl) 1127 * Transfer completed normally without any errors. 1128 */ 1129 struct cvmx_usbcx_hcintx_s { 1130 __BITFIELD_FIELD(u32 reserved_11_31 : 21, 1131 __BITFIELD_FIELD(u32 datatglerr : 1, 1132 __BITFIELD_FIELD(u32 frmovrun : 1, 1133 __BITFIELD_FIELD(u32 bblerr : 1, 1134 __BITFIELD_FIELD(u32 xacterr : 1, 1135 __BITFIELD_FIELD(u32 nyet : 1, 1136 __BITFIELD_FIELD(u32 ack : 1, 1137 __BITFIELD_FIELD(u32 nak : 1, 1138 __BITFIELD_FIELD(u32 stall : 1, 1139 __BITFIELD_FIELD(u32 ahberr : 1, 1140 __BITFIELD_FIELD(u32 chhltd : 1, 1141 __BITFIELD_FIELD(u32 xfercompl : 1, 1142 ;)))))))))))) 1143 } s; 1144 }; 1145 1146 /** 1147 * cvmx_usbc#_hcintmsk# 1148 * 1149 * Host Channel-n Interrupt Mask Register (HCINTMSKn) 1150 * 1151 * This register reflects the mask for each channel status described in the 1152 * previous section. 1153 * Mask interrupt: 1'b0 Unmask interrupt: 1'b1 1154 */ 1155 union cvmx_usbcx_hcintmskx { 1156 u32 u32; 1157 /** 1158 * struct cvmx_usbcx_hcintmskx_s 1159 * @datatglerrmsk: Data Toggle Error Mask (DataTglErrMsk) 1160 * @frmovrunmsk: Frame Overrun Mask (FrmOvrunMsk) 1161 * @bblerrmsk: Babble Error Mask (BblErrMsk) 1162 * @xacterrmsk: Transaction Error Mask (XactErrMsk) 1163 * @nyetmsk: NYET Response Received Interrupt Mask (NyetMsk) 1164 * @ackmsk: ACK Response Received Interrupt Mask (AckMsk) 1165 * @nakmsk: NAK Response Received Interrupt Mask (NakMsk) 1166 * @stallmsk: STALL Response Received Interrupt Mask (StallMsk) 1167 * @ahberrmsk: AHB Error Mask (AHBErrMsk) 1168 * @chhltdmsk: Channel Halted Mask (ChHltdMsk) 1169 * @xfercomplmsk: Transfer Completed Mask (XferComplMsk) 1170 */ 1171 struct cvmx_usbcx_hcintmskx_s { 1172 __BITFIELD_FIELD(u32 reserved_11_31 : 21, 1173 __BITFIELD_FIELD(u32 datatglerrmsk : 1, 1174 __BITFIELD_FIELD(u32 frmovrunmsk : 1, 1175 __BITFIELD_FIELD(u32 bblerrmsk : 1, 1176 __BITFIELD_FIELD(u32 xacterrmsk : 1, 1177 __BITFIELD_FIELD(u32 nyetmsk : 1, 1178 __BITFIELD_FIELD(u32 ackmsk : 1, 1179 __BITFIELD_FIELD(u32 nakmsk : 1, 1180 __BITFIELD_FIELD(u32 stallmsk : 1, 1181 __BITFIELD_FIELD(u32 ahberrmsk : 1, 1182 __BITFIELD_FIELD(u32 chhltdmsk : 1, 1183 __BITFIELD_FIELD(u32 xfercomplmsk : 1, 1184 ;)))))))))))) 1185 } s; 1186 }; 1187 1188 /** 1189 * cvmx_usbc#_hcsplt# 1190 * 1191 * Host Channel-n Split Control Register (HCSPLT) 1192 * 1193 */ 1194 union cvmx_usbcx_hcspltx { 1195 u32 u32; 1196 /** 1197 * struct cvmx_usbcx_hcspltx_s 1198 * @spltena: Split Enable (SpltEna) 1199 * The application sets this field to indicate that this channel is 1200 * enabled to perform split transactions. 1201 * @compsplt: Do Complete Split (CompSplt) 1202 * The application sets this field to request the OTG host to 1203 * perform a complete split transaction. 1204 * @xactpos: Transaction Position (XactPos) 1205 * This field is used to determine whether to send all, first, 1206 * middle, or last payloads with each OUT transaction. 1207 * * 2'b11: All. This is the entire data payload is of this 1208 * transaction (which is less than or equal to 188 bytes). 1209 * * 2'b10: Begin. This is the first data payload of this 1210 * transaction (which is larger than 188 bytes). 1211 * * 2'b00: Mid. This is the middle payload of this transaction 1212 * (which is larger than 188 bytes). 1213 * * 2'b01: End. This is the last payload of this transaction 1214 * (which is larger than 188 bytes). 1215 * @hubaddr: Hub Address (HubAddr) 1216 * This field holds the device address of the transaction 1217 * translator's hub. 1218 * @prtaddr: Port Address (PrtAddr) 1219 * This field is the port number of the recipient transaction 1220 * translator. 1221 */ 1222 struct cvmx_usbcx_hcspltx_s { 1223 __BITFIELD_FIELD(u32 spltena : 1, 1224 __BITFIELD_FIELD(u32 reserved_17_30 : 14, 1225 __BITFIELD_FIELD(u32 compsplt : 1, 1226 __BITFIELD_FIELD(u32 xactpos : 2, 1227 __BITFIELD_FIELD(u32 hubaddr : 7, 1228 __BITFIELD_FIELD(u32 prtaddr : 7, 1229 ;)))))) 1230 } s; 1231 }; 1232 1233 /** 1234 * cvmx_usbc#_hctsiz# 1235 * 1236 * Host Channel-n Transfer Size Register (HCTSIZ) 1237 * 1238 */ 1239 union cvmx_usbcx_hctsizx { 1240 u32 u32; 1241 /** 1242 * struct cvmx_usbcx_hctsizx_s 1243 * @dopng: Do Ping (DoPng) 1244 * Setting this field to 1 directs the host to do PING protocol. 1245 * @pid: PID (Pid) 1246 * The application programs this field with the type of PID to use 1247 * for the initial transaction. The host will maintain this field 1248 * for the rest of the transfer. 1249 * * 2'b00: DATA0 1250 * * 2'b01: DATA2 1251 * * 2'b10: DATA1 1252 * * 2'b11: MDATA (non-control)/SETUP (control) 1253 * @pktcnt: Packet Count (PktCnt) 1254 * This field is programmed by the application with the expected 1255 * number of packets to be transmitted (OUT) or received (IN). 1256 * The host decrements this count on every successful 1257 * transmission or reception of an OUT/IN packet. Once this count 1258 * reaches zero, the application is interrupted to indicate normal 1259 * completion. 1260 * @xfersize: Transfer Size (XferSize) 1261 * For an OUT, this field is the number of data bytes the host will 1262 * send during the transfer. 1263 * For an IN, this field is the buffer size that the application 1264 * has reserved for the transfer. The application is expected to 1265 * program this field as an integer multiple of the maximum packet 1266 * size for IN transactions (periodic and non-periodic). 1267 */ 1268 struct cvmx_usbcx_hctsizx_s { 1269 __BITFIELD_FIELD(u32 dopng : 1, 1270 __BITFIELD_FIELD(u32 pid : 2, 1271 __BITFIELD_FIELD(u32 pktcnt : 10, 1272 __BITFIELD_FIELD(u32 xfersize : 19, 1273 ;)))) 1274 } s; 1275 }; 1276 1277 /** 1278 * cvmx_usbc#_hfir 1279 * 1280 * Host Frame Interval Register (HFIR) 1281 * 1282 * This register stores the frame interval information for the current speed to 1283 * which the O2P USB core has enumerated. 1284 */ 1285 union cvmx_usbcx_hfir { 1286 u32 u32; 1287 /** 1288 * struct cvmx_usbcx_hfir_s 1289 * @frint: Frame Interval (FrInt) 1290 * The value that the application programs to this field specifies 1291 * the interval between two consecutive SOFs (FS) or micro- 1292 * SOFs (HS) or Keep-Alive tokens (HS). This field contains the 1293 * number of PHY clocks that constitute the required frame 1294 * interval. The default value set in this field for a FS operation 1295 * when the PHY clock frequency is 60 MHz. The application can 1296 * write a value to this register only after the Port Enable bit of 1297 * the Host Port Control and Status register (HPRT.PrtEnaPort) 1298 * has been set. If no value is programmed, the core calculates 1299 * the value based on the PHY clock specified in the FS/LS PHY 1300 * Clock Select field of the Host Configuration register 1301 * (HCFG.FSLSPclkSel). Do not change the value of this field 1302 * after the initial configuration. 1303 * * 125 us (PHY clock frequency for HS) 1304 * * 1 ms (PHY clock frequency for FS/LS) 1305 */ 1306 struct cvmx_usbcx_hfir_s { 1307 __BITFIELD_FIELD(u32 reserved_16_31 : 16, 1308 __BITFIELD_FIELD(u32 frint : 16, 1309 ;)) 1310 } s; 1311 }; 1312 1313 /** 1314 * cvmx_usbc#_hfnum 1315 * 1316 * Host Frame Number/Frame Time Remaining Register (HFNUM) 1317 * 1318 * This register indicates the current frame number. 1319 * It also indicates the time remaining (in terms of the number of PHY clocks) 1320 * in the current (micro)frame. 1321 */ 1322 union cvmx_usbcx_hfnum { 1323 u32 u32; 1324 /** 1325 * struct cvmx_usbcx_hfnum_s 1326 * @frrem: Frame Time Remaining (FrRem) 1327 * Indicates the amount of time remaining in the current 1328 * microframe (HS) or frame (FS/LS), in terms of PHY clocks. 1329 * This field decrements on each PHY clock. When it reaches 1330 * zero, this field is reloaded with the value in the Frame 1331 * Interval register and a new SOF is transmitted on the USB. 1332 * @frnum: Frame Number (FrNum) 1333 * This field increments when a new SOF is transmitted on the 1334 * USB, and is reset to 0 when it reaches 16'h3FFF. 1335 */ 1336 struct cvmx_usbcx_hfnum_s { 1337 __BITFIELD_FIELD(u32 frrem : 16, 1338 __BITFIELD_FIELD(u32 frnum : 16, 1339 ;)) 1340 } s; 1341 }; 1342 1343 /** 1344 * cvmx_usbc#_hprt 1345 * 1346 * Host Port Control and Status Register (HPRT) 1347 * 1348 * This register is available in both Host and Device modes. 1349 * Currently, the OTG Host supports only one port. 1350 * A single register holds USB port-related information such as USB reset, 1351 * enable, suspend, resume, connect status, and test mode for each port. The 1352 * R_SS_WC bits in this register can trigger an interrupt to the application 1353 * through the Host Port Interrupt bit of the Core Interrupt register 1354 * (GINTSTS.PrtInt). On a Port Interrupt, the application must read this 1355 * register and clear the bit that caused the interrupt. For the R_SS_WC bits, 1356 * the application must write a 1 to the bit to clear the interrupt. 1357 */ 1358 union cvmx_usbcx_hprt { 1359 u32 u32; 1360 /** 1361 * struct cvmx_usbcx_hprt_s 1362 * @prtspd: Port Speed (PrtSpd) 1363 * Indicates the speed of the device attached to this port. 1364 * * 2'b00: High speed 1365 * * 2'b01: Full speed 1366 * * 2'b10: Low speed 1367 * * 2'b11: Reserved 1368 * @prttstctl: Port Test Control (PrtTstCtl) 1369 * The application writes a nonzero value to this field to put 1370 * the port into a Test mode, and the corresponding pattern is 1371 * signaled on the port. 1372 * * 4'b0000: Test mode disabled 1373 * * 4'b0001: Test_J mode 1374 * * 4'b0010: Test_K mode 1375 * * 4'b0011: Test_SE0_NAK mode 1376 * * 4'b0100: Test_Packet mode 1377 * * 4'b0101: Test_Force_Enable 1378 * * Others: Reserved 1379 * PrtSpd must be zero (i.e. the interface must be in high-speed 1380 * mode) to use the PrtTstCtl test modes. 1381 * @prtpwr: Port Power (PrtPwr) 1382 * The application uses this field to control power to this port, 1383 * and the core clears this bit on an overcurrent condition. 1384 * * 1'b0: Power off 1385 * * 1'b1: Power on 1386 * @prtlnsts: Port Line Status (PrtLnSts) 1387 * Indicates the current logic level USB data lines 1388 * * Bit [10]: Logic level of D- 1389 * * Bit [11]: Logic level of D+ 1390 * @prtrst: Port Reset (PrtRst) 1391 * When the application sets this bit, a reset sequence is 1392 * started on this port. The application must time the reset 1393 * period and clear this bit after the reset sequence is 1394 * complete. 1395 * * 1'b0: Port not in reset 1396 * * 1'b1: Port in reset 1397 * The application must leave this bit set for at least a 1398 * minimum duration mentioned below to start a reset on the 1399 * port. The application can leave it set for another 10 ms in 1400 * addition to the required minimum duration, before clearing 1401 * the bit, even though there is no maximum limit set by the 1402 * USB standard. 1403 * * High speed: 50 ms 1404 * * Full speed/Low speed: 10 ms 1405 * @prtsusp: Port Suspend (PrtSusp) 1406 * The application sets this bit to put this port in Suspend 1407 * mode. The core only stops sending SOFs when this is set. 1408 * To stop the PHY clock, the application must set the Port 1409 * Clock Stop bit, which will assert the suspend input pin of 1410 * the PHY. 1411 * The read value of this bit reflects the current suspend 1412 * status of the port. This bit is cleared by the core after a 1413 * remote wakeup signal is detected or the application sets 1414 * the Port Reset bit or Port Resume bit in this register or the 1415 * Resume/Remote Wakeup Detected Interrupt bit or 1416 * Disconnect Detected Interrupt bit in the Core Interrupt 1417 * register (GINTSTS.WkUpInt or GINTSTS.DisconnInt, 1418 * respectively). 1419 * * 1'b0: Port not in Suspend mode 1420 * * 1'b1: Port in Suspend mode 1421 * @prtres: Port Resume (PrtRes) 1422 * The application sets this bit to drive resume signaling on 1423 * the port. The core continues to drive the resume signal 1424 * until the application clears this bit. 1425 * If the core detects a USB remote wakeup sequence, as 1426 * indicated by the Port Resume/Remote Wakeup Detected 1427 * Interrupt bit of the Core Interrupt register 1428 * (GINTSTS.WkUpInt), the core starts driving resume 1429 * signaling without application intervention and clears this bit 1430 * when it detects a disconnect condition. The read value of 1431 * this bit indicates whether the core is currently driving 1432 * resume signaling. 1433 * * 1'b0: No resume driven 1434 * * 1'b1: Resume driven 1435 * @prtovrcurrchng: Port Overcurrent Change (PrtOvrCurrChng) 1436 * The core sets this bit when the status of the Port 1437 * Overcurrent Active bit (bit 4) in this register changes. 1438 * @prtovrcurract: Port Overcurrent Active (PrtOvrCurrAct) 1439 * Indicates the overcurrent condition of the port. 1440 * * 1'b0: No overcurrent condition 1441 * * 1'b1: Overcurrent condition 1442 * @prtenchng: Port Enable/Disable Change (PrtEnChng) 1443 * The core sets this bit when the status of the Port Enable bit 1444 * [2] of this register changes. 1445 * @prtena: Port Enable (PrtEna) 1446 * A port is enabled only by the core after a reset sequence, 1447 * and is disabled by an overcurrent condition, a disconnect 1448 * condition, or by the application clearing this bit. The 1449 * application cannot set this bit by a register write. It can only 1450 * clear it to disable the port. This bit does not trigger any 1451 * interrupt to the application. 1452 * * 1'b0: Port disabled 1453 * * 1'b1: Port enabled 1454 * @prtconndet: Port Connect Detected (PrtConnDet) 1455 * The core sets this bit when a device connection is detected 1456 * to trigger an interrupt to the application using the Host Port 1457 * Interrupt bit of the Core Interrupt register (GINTSTS.PrtInt). 1458 * The application must write a 1 to this bit to clear the 1459 * interrupt. 1460 * @prtconnsts: Port Connect Status (PrtConnSts) 1461 * * 0: No device is attached to the port. 1462 * * 1: A device is attached to the port. 1463 */ 1464 struct cvmx_usbcx_hprt_s { 1465 __BITFIELD_FIELD(u32 reserved_19_31 : 13, 1466 __BITFIELD_FIELD(u32 prtspd : 2, 1467 __BITFIELD_FIELD(u32 prttstctl : 4, 1468 __BITFIELD_FIELD(u32 prtpwr : 1, 1469 __BITFIELD_FIELD(u32 prtlnsts : 2, 1470 __BITFIELD_FIELD(u32 reserved_9_9 : 1, 1471 __BITFIELD_FIELD(u32 prtrst : 1, 1472 __BITFIELD_FIELD(u32 prtsusp : 1, 1473 __BITFIELD_FIELD(u32 prtres : 1, 1474 __BITFIELD_FIELD(u32 prtovrcurrchng : 1, 1475 __BITFIELD_FIELD(u32 prtovrcurract : 1, 1476 __BITFIELD_FIELD(u32 prtenchng : 1, 1477 __BITFIELD_FIELD(u32 prtena : 1, 1478 __BITFIELD_FIELD(u32 prtconndet : 1, 1479 __BITFIELD_FIELD(u32 prtconnsts : 1, 1480 ;))))))))))))))) 1481 } s; 1482 }; 1483 1484 /** 1485 * cvmx_usbc#_hptxfsiz 1486 * 1487 * Host Periodic Transmit FIFO Size Register (HPTXFSIZ) 1488 * 1489 * This register holds the size and the memory start address of the Periodic 1490 * TxFIFO, as shown in Figures 310 and 311. 1491 */ 1492 union cvmx_usbcx_hptxfsiz { 1493 u32 u32; 1494 /** 1495 * struct cvmx_usbcx_hptxfsiz_s 1496 * @ptxfsize: Host Periodic TxFIFO Depth (PTxFSize) 1497 * This value is in terms of 32-bit words. 1498 * * Minimum value is 16 1499 * * Maximum value is 32768 1500 * @ptxfstaddr: Host Periodic TxFIFO Start Address (PTxFStAddr) 1501 */ 1502 struct cvmx_usbcx_hptxfsiz_s { 1503 __BITFIELD_FIELD(u32 ptxfsize : 16, 1504 __BITFIELD_FIELD(u32 ptxfstaddr : 16, 1505 ;)) 1506 } s; 1507 }; 1508 1509 /** 1510 * cvmx_usbc#_hptxsts 1511 * 1512 * Host Periodic Transmit FIFO/Queue Status Register (HPTXSTS) 1513 * 1514 * This read-only register contains the free space information for the Periodic 1515 * TxFIFO and the Periodic Transmit Request Queue 1516 */ 1517 union cvmx_usbcx_hptxsts { 1518 u32 u32; 1519 /** 1520 * struct cvmx_usbcx_hptxsts_s 1521 * @ptxqtop: Top of the Periodic Transmit Request Queue (PTxQTop) 1522 * This indicates the entry in the Periodic Tx Request Queue that 1523 * is currently being processes by the MAC. 1524 * This register is used for debugging. 1525 * * Bit [31]: Odd/Even (micro)frame 1526 * - 1'b0: send in even (micro)frame 1527 * - 1'b1: send in odd (micro)frame 1528 * * Bits [30:27]: Channel/endpoint number 1529 * * Bits [26:25]: Type 1530 * - 2'b00: IN/OUT 1531 * - 2'b01: Zero-length packet 1532 * - 2'b10: CSPLIT 1533 * - 2'b11: Disable channel command 1534 * * Bit [24]: Terminate (last entry for the selected 1535 * channel/endpoint) 1536 * @ptxqspcavail: Periodic Transmit Request Queue Space Available 1537 * (PTxQSpcAvail) 1538 * Indicates the number of free locations available to be written 1539 * in the Periodic Transmit Request Queue. This queue holds both 1540 * IN and OUT requests. 1541 * * 8'h0: Periodic Transmit Request Queue is full 1542 * * 8'h1: 1 location available 1543 * * 8'h2: 2 locations available 1544 * * n: n locations available (0..8) 1545 * * Others: Reserved 1546 * @ptxfspcavail: Periodic Transmit Data FIFO Space Available 1547 * (PTxFSpcAvail) 1548 * Indicates the number of free locations available to be written 1549 * to in the Periodic TxFIFO. 1550 * Values are in terms of 32-bit words 1551 * * 16'h0: Periodic TxFIFO is full 1552 * * 16'h1: 1 word available 1553 * * 16'h2: 2 words available 1554 * * 16'hn: n words available (where 0..32768) 1555 * * 16'h8000: 32768 words available 1556 * * Others: Reserved 1557 */ 1558 struct cvmx_usbcx_hptxsts_s { 1559 __BITFIELD_FIELD(u32 ptxqtop : 8, 1560 __BITFIELD_FIELD(u32 ptxqspcavail : 8, 1561 __BITFIELD_FIELD(u32 ptxfspcavail : 16, 1562 ;))) 1563 } s; 1564 }; 1565 1566 /** 1567 * cvmx_usbn#_clk_ctl 1568 * 1569 * USBN_CLK_CTL = USBN's Clock Control 1570 * 1571 * This register is used to control the frequency of the hclk and the 1572 * hreset and phy_rst signals. 1573 */ 1574 union cvmx_usbnx_clk_ctl { 1575 u64 u64; 1576 /** 1577 * struct cvmx_usbnx_clk_ctl_s 1578 * @divide2: The 'hclk' used by the USB subsystem is derived 1579 * from the eclk. 1580 * Also see the field DIVIDE. DIVIDE2<1> must currently 1581 * be zero because it is not implemented, so the maximum 1582 * ratio of eclk/hclk is currently 16. 1583 * The actual divide number for hclk is: 1584 * (DIVIDE2 + 1) * (DIVIDE + 1) 1585 * @hclk_rst: When this field is '0' the HCLK-DIVIDER used to 1586 * generate the hclk in the USB Subsystem is held 1587 * in reset. This bit must be set to '0' before 1588 * changing the value os DIVIDE in this register. 1589 * The reset to the HCLK_DIVIDERis also asserted 1590 * when core reset is asserted. 1591 * @p_x_on: Force USB-PHY on during suspend. 1592 * '1' USB-PHY XO block is powered-down during 1593 * suspend. 1594 * '0' USB-PHY XO block is powered-up during 1595 * suspend. 1596 * The value of this field must be set while POR is 1597 * active. 1598 * @p_rtype: PHY reference clock type 1599 * On CN50XX/CN52XX/CN56XX the values are: 1600 * '0' The USB-PHY uses a 12MHz crystal as a clock source 1601 * at the USB_XO and USB_XI pins. 1602 * '1' Reserved. 1603 * '2' The USB_PHY uses 12/24/48MHz 2.5V board clock at the 1604 * USB_XO pin. USB_XI should be tied to ground in this 1605 * case. 1606 * '3' Reserved. 1607 * On CN3xxx bits 14 and 15 are p_xenbn and p_rclk and values are: 1608 * '0' Reserved. 1609 * '1' Reserved. 1610 * '2' The PHY PLL uses the XO block output as a reference. 1611 * The XO block uses an external clock supplied on the 1612 * XO pin. USB_XI should be tied to ground for this 1613 * usage. 1614 * '3' The XO block uses the clock from a crystal. 1615 * @p_com_on: '0' Force USB-PHY XO Bias, Bandgap and PLL to 1616 * remain powered in Suspend Mode. 1617 * '1' The USB-PHY XO Bias, Bandgap and PLL are 1618 * powered down in suspend mode. 1619 * The value of this field must be set while POR is 1620 * active. 1621 * @p_c_sel: Phy clock speed select. 1622 * Selects the reference clock / crystal frequency. 1623 * '11': Reserved 1624 * '10': 48 MHz (reserved when a crystal is used) 1625 * '01': 24 MHz (reserved when a crystal is used) 1626 * '00': 12 MHz 1627 * The value of this field must be set while POR is 1628 * active. 1629 * NOTE: if a crystal is used as a reference clock, 1630 * this field must be set to 12 MHz. 1631 * @cdiv_byp: Used to enable the bypass input to the USB_CLK_DIV. 1632 * @sd_mode: Scaledown mode for the USBC. Control timing events 1633 * in the USBC, for normal operation this must be '0'. 1634 * @s_bist: Starts bist on the hclk memories, during the '0' 1635 * to '1' transition. 1636 * @por: Power On Reset for the PHY. 1637 * Resets all the PHYS registers and state machines. 1638 * @enable: When '1' allows the generation of the hclk. When 1639 * '0' the hclk will not be generated. SEE DIVIDE 1640 * field of this register. 1641 * @prst: When this field is '0' the reset associated with 1642 * the phy_clk functionality in the USB Subsystem is 1643 * help in reset. This bit should not be set to '1' 1644 * until the time it takes 6 clocks (hclk or phy_clk, 1645 * whichever is slower) has passed. Under normal 1646 * operation once this bit is set to '1' it should not 1647 * be set to '0'. 1648 * @hrst: When this field is '0' the reset associated with 1649 * the hclk functioanlity in the USB Subsystem is 1650 * held in reset.This bit should not be set to '1' 1651 * until 12ms after phy_clk is stable. Under normal 1652 * operation, once this bit is set to '1' it should 1653 * not be set to '0'. 1654 * @divide: The frequency of 'hclk' used by the USB subsystem 1655 * is the eclk frequency divided by the value of 1656 * (DIVIDE2 + 1) * (DIVIDE + 1), also see the field 1657 * DIVIDE2 of this register. 1658 * The hclk frequency should be less than 125Mhz. 1659 * After writing a value to this field the SW should 1660 * read the field for the value written. 1661 * The ENABLE field of this register should not be set 1662 * until AFTER this field is set and then read. 1663 */ 1664 struct cvmx_usbnx_clk_ctl_s { 1665 __BITFIELD_FIELD(u64 reserved_20_63 : 44, 1666 __BITFIELD_FIELD(u64 divide2 : 2, 1667 __BITFIELD_FIELD(u64 hclk_rst : 1, 1668 __BITFIELD_FIELD(u64 p_x_on : 1, 1669 __BITFIELD_FIELD(u64 p_rtype : 2, 1670 __BITFIELD_FIELD(u64 p_com_on : 1, 1671 __BITFIELD_FIELD(u64 p_c_sel : 2, 1672 __BITFIELD_FIELD(u64 cdiv_byp : 1, 1673 __BITFIELD_FIELD(u64 sd_mode : 2, 1674 __BITFIELD_FIELD(u64 s_bist : 1, 1675 __BITFIELD_FIELD(u64 por : 1, 1676 __BITFIELD_FIELD(u64 enable : 1, 1677 __BITFIELD_FIELD(u64 prst : 1, 1678 __BITFIELD_FIELD(u64 hrst : 1, 1679 __BITFIELD_FIELD(u64 divide : 3, 1680 ;))))))))))))))) 1681 } s; 1682 }; 1683 1684 /** 1685 * cvmx_usbn#_usbp_ctl_status 1686 * 1687 * USBN_USBP_CTL_STATUS = USBP Control And Status Register 1688 * 1689 * Contains general control and status information for the USBN block. 1690 */ 1691 union cvmx_usbnx_usbp_ctl_status { 1692 u64 u64; 1693 /** 1694 * struct cvmx_usbnx_usbp_ctl_status_s 1695 * @txrisetune: HS Transmitter Rise/Fall Time Adjustment 1696 * @txvreftune: HS DC Voltage Level Adjustment 1697 * @txfslstune: FS/LS Source Impedance Adjustment 1698 * @txhsxvtune: Transmitter High-Speed Crossover Adjustment 1699 * @sqrxtune: Squelch Threshold Adjustment 1700 * @compdistune: Disconnect Threshold Adjustment 1701 * @otgtune: VBUS Valid Threshold Adjustment 1702 * @otgdisable: OTG Block Disable 1703 * @portreset: Per_Port Reset 1704 * @drvvbus: Drive VBUS 1705 * @lsbist: Low-Speed BIST Enable. 1706 * @fsbist: Full-Speed BIST Enable. 1707 * @hsbist: High-Speed BIST Enable. 1708 * @bist_done: PHY Bist Done. 1709 * Asserted at the end of the PHY BIST sequence. 1710 * @bist_err: PHY Bist Error. 1711 * Indicates an internal error was detected during 1712 * the BIST sequence. 1713 * @tdata_out: PHY Test Data Out. 1714 * Presents either internally generated signals or 1715 * test register contents, based upon the value of 1716 * test_data_out_sel. 1717 * @siddq: Drives the USBP (USB-PHY) SIDDQ input. 1718 * Normally should be set to zero. 1719 * When customers have no intent to use USB PHY 1720 * interface, they should: 1721 * - still provide 3.3V to USB_VDD33, and 1722 * - tie USB_REXT to 3.3V supply, and 1723 * - set USBN*_USBP_CTL_STATUS[SIDDQ]=1 1724 * @txpreemphasistune: HS Transmitter Pre-Emphasis Enable 1725 * @dma_bmode: When set to 1 the L2C DMA address will be updated 1726 * with byte-counts between packets. When set to 0 1727 * the L2C DMA address is incremented to the next 1728 * 4-byte aligned address after adding byte-count. 1729 * @usbc_end: Bigendian input to the USB Core. This should be 1730 * set to '0' for operation. 1731 * @usbp_bist: PHY, This is cleared '0' to run BIST on the USBP. 1732 * @tclk: PHY Test Clock, used to load TDATA_IN to the USBP. 1733 * @dp_pulld: PHY DP_PULLDOWN input to the USB-PHY. 1734 * This signal enables the pull-down resistance on 1735 * the D+ line. '1' pull down-resistance is connected 1736 * to D+/ '0' pull down resistance is not connected 1737 * to D+. When an A/B device is acting as a host 1738 * (downstream-facing port), dp_pulldown and 1739 * dm_pulldown are enabled. This must not toggle 1740 * during normal operation. 1741 * @dm_pulld: PHY DM_PULLDOWN input to the USB-PHY. 1742 * This signal enables the pull-down resistance on 1743 * the D- line. '1' pull down-resistance is connected 1744 * to D-. '0' pull down resistance is not connected 1745 * to D-. When an A/B device is acting as a host 1746 * (downstream-facing port), dp_pulldown and 1747 * dm_pulldown are enabled. This must not toggle 1748 * during normal operation. 1749 * @hst_mode: When '0' the USB is acting as HOST, when '1' 1750 * USB is acting as device. This field needs to be 1751 * set while the USB is in reset. 1752 * @tuning: Transmitter Tuning for High-Speed Operation. 1753 * Tunes the current supply and rise/fall output 1754 * times for high-speed operation. 1755 * [20:19] == 11: Current supply increased 1756 * approximately 9% 1757 * [20:19] == 10: Current supply increased 1758 * approximately 4.5% 1759 * [20:19] == 01: Design default. 1760 * [20:19] == 00: Current supply decreased 1761 * approximately 4.5% 1762 * [22:21] == 11: Rise and fall times are increased. 1763 * [22:21] == 10: Design default. 1764 * [22:21] == 01: Rise and fall times are decreased. 1765 * [22:21] == 00: Rise and fall times are decreased 1766 * further as compared to the 01 setting. 1767 * @tx_bs_enh: Transmit Bit Stuffing on [15:8]. 1768 * Enables or disables bit stuffing on data[15:8] 1769 * when bit-stuffing is enabled. 1770 * @tx_bs_en: Transmit Bit Stuffing on [7:0]. 1771 * Enables or disables bit stuffing on data[7:0] 1772 * when bit-stuffing is enabled. 1773 * @loop_enb: PHY Loopback Test Enable. 1774 * '1': During data transmission the receive is 1775 * enabled. 1776 * '0': During data transmission the receive is 1777 * disabled. 1778 * Must be '0' for normal operation. 1779 * @vtest_enb: Analog Test Pin Enable. 1780 * '1' The PHY's analog_test pin is enabled for the 1781 * input and output of applicable analog test signals. 1782 * '0' THe analog_test pin is disabled. 1783 * @bist_enb: Built-In Self Test Enable. 1784 * Used to activate BIST in the PHY. 1785 * @tdata_sel: Test Data Out Select. 1786 * '1' test_data_out[3:0] (PHY) register contents 1787 * are output. '0' internally generated signals are 1788 * output. 1789 * @taddr_in: Mode Address for Test Interface. 1790 * Specifies the register address for writing to or 1791 * reading from the PHY test interface register. 1792 * @tdata_in: Internal Testing Register Input Data and Select 1793 * This is a test bus. Data is present on [3:0], 1794 * and its corresponding select (enable) is present 1795 * on bits [7:4]. 1796 * @ate_reset: Reset input from automatic test equipment. 1797 * This is a test signal. When the USB Core is 1798 * powered up (not in Susned Mode), an automatic 1799 * tester can use this to disable phy_clock and 1800 * free_clk, then re-enable them with an aligned 1801 * phase. 1802 * '1': The phy_clk and free_clk outputs are 1803 * disabled. "0": The phy_clock and free_clk outputs 1804 * are available within a specific period after the 1805 * de-assertion. 1806 */ 1807 struct cvmx_usbnx_usbp_ctl_status_s { 1808 __BITFIELD_FIELD(u64 txrisetune : 1, 1809 __BITFIELD_FIELD(u64 txvreftune : 4, 1810 __BITFIELD_FIELD(u64 txfslstune : 4, 1811 __BITFIELD_FIELD(u64 txhsxvtune : 2, 1812 __BITFIELD_FIELD(u64 sqrxtune : 3, 1813 __BITFIELD_FIELD(u64 compdistune : 3, 1814 __BITFIELD_FIELD(u64 otgtune : 3, 1815 __BITFIELD_FIELD(u64 otgdisable : 1, 1816 __BITFIELD_FIELD(u64 portreset : 1, 1817 __BITFIELD_FIELD(u64 drvvbus : 1, 1818 __BITFIELD_FIELD(u64 lsbist : 1, 1819 __BITFIELD_FIELD(u64 fsbist : 1, 1820 __BITFIELD_FIELD(u64 hsbist : 1, 1821 __BITFIELD_FIELD(u64 bist_done : 1, 1822 __BITFIELD_FIELD(u64 bist_err : 1, 1823 __BITFIELD_FIELD(u64 tdata_out : 4, 1824 __BITFIELD_FIELD(u64 siddq : 1, 1825 __BITFIELD_FIELD(u64 txpreemphasistune : 1, 1826 __BITFIELD_FIELD(u64 dma_bmode : 1, 1827 __BITFIELD_FIELD(u64 usbc_end : 1, 1828 __BITFIELD_FIELD(u64 usbp_bist : 1, 1829 __BITFIELD_FIELD(u64 tclk : 1, 1830 __BITFIELD_FIELD(u64 dp_pulld : 1, 1831 __BITFIELD_FIELD(u64 dm_pulld : 1, 1832 __BITFIELD_FIELD(u64 hst_mode : 1, 1833 __BITFIELD_FIELD(u64 tuning : 4, 1834 __BITFIELD_FIELD(u64 tx_bs_enh : 1, 1835 __BITFIELD_FIELD(u64 tx_bs_en : 1, 1836 __BITFIELD_FIELD(u64 loop_enb : 1, 1837 __BITFIELD_FIELD(u64 vtest_enb : 1, 1838 __BITFIELD_FIELD(u64 bist_enb : 1, 1839 __BITFIELD_FIELD(u64 tdata_sel : 1, 1840 __BITFIELD_FIELD(u64 taddr_in : 4, 1841 __BITFIELD_FIELD(u64 tdata_in : 8, 1842 __BITFIELD_FIELD(u64 ate_reset : 1, 1843 ;))))))))))))))))))))))))))))))))))) 1844 } s; 1845 }; 1846 1847 #endif /* __OCTEON_HCD_H__ */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.1.0 LXR engine. The LXR team |
![]() ![]() |