octeon-hcd.h 72 KB

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