octeon-hcd.h 72 KB

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