]> rtime.felk.cvut.cz Git - linux-imx.git/blob - drivers/staging/octeon-usb/cvmx-usbnx-defs.h
b3a6352d974f0cd73024925d4a60e6419d1b1ec1
[linux-imx.git] / drivers / staging / octeon-usb / cvmx-usbnx-defs.h
1 /***********************license start***************
2  * Copyright (c) 2003-2010  Cavium Networks (support@cavium.com). All rights
3  * reserved.
4  *
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *   * Redistributions of source code must retain the above copyright
11  *     notice, this list of conditions and the following disclaimer.
12  *
13  *   * Redistributions in binary form must reproduce the above
14  *     copyright notice, this list of conditions and the following
15  *     disclaimer in the documentation and/or other materials provided
16  *     with the distribution.
17
18  *   * Neither the name of Cavium Networks nor the names of
19  *     its contributors may be used to endorse or promote products
20  *     derived from this software without specific prior written
21  *     permission.
22
23  * This Software, including technical data, may be subject to U.S. export  control
24  * laws, including the U.S. Export Administration Act and its  associated
25  * regulations, and may be subject to export or import  regulations in other
26  * countries.
27
28  * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29  * AND WITH ALL FAULTS AND CAVIUM  NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR
30  * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31  * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32  * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33  * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34  * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35  * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36  * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE  RISK ARISING OUT OF USE OR
37  * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38  ***********************license end**************************************/
39
40
41 /**
42  * cvmx-usbnx-defs.h
43  *
44  * Configuration and status register (CSR) type definitions for
45  * Octeon usbnx.
46  *
47  */
48 #ifndef __CVMX_USBNX_TYPEDEFS_H__
49 #define __CVMX_USBNX_TYPEDEFS_H__
50
51 #define CVMX_USBNXBID1(bid) (((bid) & 1) * 0x10000000ull)
52 #define CVMX_USBNXBID2(bid) (((bid) & 1) * 0x100000000000ull)
53
54 #define CVMX_USBNXREG1(reg, bid) \
55         (CVMX_ADD_IO_SEG(0x0001180068000000ull | reg) + CVMX_USBNXBID1(bid))
56 #define CVMX_USBNXREG2(reg, bid) \
57         (CVMX_ADD_IO_SEG(0x00016F0000000000ull | reg) + CVMX_USBNXBID2(bid))
58
59 #define CVMX_USBNX_CLK_CTL(bid)         CVMX_USBNXREG1(0x10, bid)
60 #define CVMX_USBNX_DMA0_INB_CHN0(bid)   CVMX_USBNXREG2(0x818, bid)
61 #define CVMX_USBNX_DMA0_OUTB_CHN0(bid)  CVMX_USBNXREG2(0x858, bid)
62 #define CVMX_USBNX_USBP_CTL_STATUS(bid) CVMX_USBNXREG1(0x18, bid)
63
64 /**
65  * cvmx_usbn#_clk_ctl
66  *
67  * USBN_CLK_CTL = USBN's Clock Control
68  *
69  * This register is used to control the frequency of the hclk and the hreset and phy_rst signals.
70  */
71 union cvmx_usbnx_clk_ctl {
72         uint64_t u64;
73         /**
74          * struct cvmx_usbnx_clk_ctl_s
75          * @divide2: The 'hclk' used by the USB subsystem is derived
76          *      from the eclk.
77          *      Also see the field DIVIDE. DIVIDE2<1> must currently
78          *      be zero because it is not implemented, so the maximum
79          *      ratio of eclk/hclk is currently 16.
80          *      The actual divide number for hclk is:
81          *      (DIVIDE2 + 1) * (DIVIDE + 1)
82          * @hclk_rst: When this field is '0' the HCLK-DIVIDER used to
83          *      generate the hclk in the USB Subsystem is held
84          *      in reset. This bit must be set to '0' before
85          *      changing the value os DIVIDE in this register.
86          *      The reset to the HCLK_DIVIDERis also asserted
87          *      when core reset is asserted.
88          * @p_x_on: Force USB-PHY on during suspend.
89          *      '1' USB-PHY XO block is powered-down during
90          *      suspend.
91          *      '0' USB-PHY XO block is powered-up during
92          *      suspend.
93          *      The value of this field must be set while POR is
94          *      active.
95          * @p_com_on: '0' Force USB-PHY XO Bias, Bandgap and PLL to
96          *      remain powered in Suspend Mode.
97          *      '1' The USB-PHY XO Bias, Bandgap and PLL are
98          *      powered down in suspend mode.
99          *      The value of this field must be set while POR is
100          *      active.
101          * @p_c_sel: Phy clock speed select.
102          *      Selects the reference clock / crystal frequency.
103          *      '11': Reserved
104          *      '10': 48 MHz (reserved when a crystal is used)
105          *      '01': 24 MHz (reserved when a crystal is used)
106          *      '00': 12 MHz
107          *      The value of this field must be set while POR is
108          *      active.
109          *      NOTE: if a crystal is used as a reference clock,
110          *      this field must be set to 12 MHz.
111          * @cdiv_byp: Used to enable the bypass input to the USB_CLK_DIV.
112          * @sd_mode: Scaledown mode for the USBC. Control timing events
113          *      in the USBC, for normal operation this must be '0'.
114          * @s_bist: Starts bist on the hclk memories, during the '0'
115          *      to '1' transition.
116          * @por: Power On Reset for the PHY.
117          *      Resets all the PHYS registers and state machines.
118          * @enable: When '1' allows the generation of the hclk. When
119          *      '0' the hclk will not be generated. SEE DIVIDE
120          *      field of this register.
121          * @prst: When this field is '0' the reset associated with
122          *      the phy_clk functionality in the USB Subsystem is
123          *      help in reset. This bit should not be set to '1'
124          *      until the time it takes 6 clocks (hclk or phy_clk,
125          *      whichever is slower) has passed. Under normal
126          *      operation once this bit is set to '1' it should not
127          *      be set to '0'.
128          * @hrst: When this field is '0' the reset associated with
129          *      the hclk functioanlity in the USB Subsystem is
130          *      held in reset.This bit should not be set to '1'
131          *      until 12ms after phy_clk is stable. Under normal
132          *      operation, once this bit is set to '1' it should
133          *      not be set to '0'.
134          * @divide: The frequency of 'hclk' used by the USB subsystem
135          *      is the eclk frequency divided by the value of
136          *      (DIVIDE2 + 1) * (DIVIDE + 1), also see the field
137          *      DIVIDE2 of this register.
138          *      The hclk frequency should be less than 125Mhz.
139          *      After writing a value to this field the SW should
140          *      read the field for the value written.
141          *      The ENABLE field of this register should not be set
142          *      until AFTER this field is set and then read.
143          */
144         struct cvmx_usbnx_clk_ctl_s {
145                 uint64_t reserved_20_63 : 44;
146                 uint64_t divide2        : 2;
147                 uint64_t hclk_rst       : 1;
148                 uint64_t p_x_on         : 1;
149                 uint64_t reserved_14_15 : 2;
150                 uint64_t p_com_on       : 1;
151                 uint64_t p_c_sel        : 2;
152                 uint64_t cdiv_byp       : 1;
153                 uint64_t sd_mode        : 2;
154                 uint64_t s_bist         : 1;
155                 uint64_t por            : 1;
156                 uint64_t enable         : 1;
157                 uint64_t prst           : 1;
158                 uint64_t hrst           : 1;
159                 uint64_t divide         : 3;
160         } s;
161         /**
162          * struct cvmx_usbnx_clk_ctl_cn30xx
163          * @hclk_rst: When this field is '0' the HCLK-DIVIDER used to
164          *      generate the hclk in the USB Subsystem is held
165          *      in reset. This bit must be set to '0' before
166          *      changing the value os DIVIDE in this register.
167          *      The reset to the HCLK_DIVIDERis also asserted
168          *      when core reset is asserted.
169          * @p_x_on: Force USB-PHY on during suspend.
170          *      '1' USB-PHY XO block is powered-down during
171          *      suspend.
172          *      '0' USB-PHY XO block is powered-up during
173          *      suspend.
174          *      The value of this field must be set while POR is
175          *      active.
176          * @p_rclk: Phy refrence clock enable.
177          *      '1' The PHY PLL uses the XO block output as a
178          *      reference.
179          *      '0' Reserved.
180          * @p_xenbn: Phy external clock enable.
181          *      '1' The XO block uses the clock from a crystal.
182          *      '0' The XO block uses an external clock supplied
183          *      on the XO pin. USB_XI should be tied to
184          *      ground for this usage.
185          * @p_com_on: '0' Force USB-PHY XO Bias, Bandgap and PLL to
186          *      remain powered in Suspend Mode.
187          *      '1' The USB-PHY XO Bias, Bandgap and PLL are
188          *      powered down in suspend mode.
189          *      The value of this field must be set while POR is
190          *      active.
191          * @p_c_sel: Phy clock speed select.
192          *      Selects the reference clock / crystal frequency.
193          *      '11': Reserved
194          *      '10': 48 MHz
195          *      '01': 24 MHz
196          *      '00': 12 MHz
197          *      The value of this field must be set while POR is
198          *      active.
199          * @cdiv_byp: Used to enable the bypass input to the USB_CLK_DIV.
200          * @sd_mode: Scaledown mode for the USBC. Control timing events
201          *      in the USBC, for normal operation this must be '0'.
202          * @s_bist: Starts bist on the hclk memories, during the '0'
203          *      to '1' transition.
204          * @por: Power On Reset for the PHY.
205          *      Resets all the PHYS registers and state machines.
206          * @enable: When '1' allows the generation of the hclk. When
207          *      '0' the hclk will not be generated.
208          * @prst: When this field is '0' the reset associated with
209          *      the phy_clk functionality in the USB Subsystem is
210          *      help in reset. This bit should not be set to '1'
211          *      until the time it takes 6 clocks (hclk or phy_clk,
212          *      whichever is slower) has passed. Under normal
213          *      operation once this bit is set to '1' it should not
214          *      be set to '0'.
215          * @hrst: When this field is '0' the reset associated with
216          *      the hclk functioanlity in the USB Subsystem is
217          *      held in reset.This bit should not be set to '1'
218          *      until 12ms after phy_clk is stable. Under normal
219          *      operation, once this bit is set to '1' it should
220          *      not be set to '0'.
221          * @divide: The 'hclk' used by the USB subsystem is derived
222          *      from the eclk. The eclk will be divided by the
223          *      value of this field +1 to determine the hclk
224          *      frequency. (Also see HRST of this register).
225          *      The hclk frequency must be less than 125 MHz.
226          */
227         struct cvmx_usbnx_clk_ctl_cn30xx {
228                 uint64_t reserved_18_63 : 46;
229                 uint64_t hclk_rst       : 1;
230                 uint64_t p_x_on         : 1;
231                 uint64_t p_rclk         : 1;
232                 uint64_t p_xenbn        : 1;
233                 uint64_t p_com_on       : 1;
234                 uint64_t p_c_sel        : 2;
235                 uint64_t cdiv_byp       : 1;
236                 uint64_t sd_mode        : 2;
237                 uint64_t s_bist         : 1;
238                 uint64_t por            : 1;
239                 uint64_t enable         : 1;
240                 uint64_t prst           : 1;
241                 uint64_t hrst           : 1;
242                 uint64_t divide         : 3;
243         } cn30xx;
244         struct cvmx_usbnx_clk_ctl_cn30xx cn31xx;
245         /**
246          * struct cvmx_usbnx_clk_ctl_cn50xx
247          * @divide2: The 'hclk' used by the USB subsystem is derived
248          *      from the eclk.
249          *      Also see the field DIVIDE. DIVIDE2<1> must currently
250          *      be zero because it is not implemented, so the maximum
251          *      ratio of eclk/hclk is currently 16.
252          *      The actual divide number for hclk is:
253          *      (DIVIDE2 + 1) * (DIVIDE + 1)
254          * @hclk_rst: When this field is '0' the HCLK-DIVIDER used to
255          *      generate the hclk in the USB Subsystem is held
256          *      in reset. This bit must be set to '0' before
257          *      changing the value os DIVIDE in this register.
258          *      The reset to the HCLK_DIVIDERis also asserted
259          *      when core reset is asserted.
260          * @p_rtype: PHY reference clock type
261          *      '0' The USB-PHY uses a 12MHz crystal as a clock
262          *      source at the USB_XO and USB_XI pins
263          *      '1' Reserved
264          *      '2' The USB_PHY uses 12/24/48MHz 2.5V board clock
265          *      at the USB_XO pin. USB_XI should be tied to
266          *      ground in this case.
267          *      '3' Reserved
268          *      (bit 14 was P_XENBN on 3xxx)
269          *      (bit 15 was P_RCLK on 3xxx)
270          * @p_com_on: '0' Force USB-PHY XO Bias, Bandgap and PLL to
271          *      remain powered in Suspend Mode.
272          *      '1' The USB-PHY XO Bias, Bandgap and PLL are
273          *      powered down in suspend mode.
274          *      The value of this field must be set while POR is
275          *      active.
276          * @p_c_sel: Phy clock speed select.
277          *      Selects the reference clock / crystal frequency.
278          *      '11': Reserved
279          *      '10': 48 MHz (reserved when a crystal is used)
280          *      '01': 24 MHz (reserved when a crystal is used)
281          *      '00': 12 MHz
282          *      The value of this field must be set while POR is
283          *      active.
284          *      NOTE: if a crystal is used as a reference clock,
285          *      this field must be set to 12 MHz.
286          * @cdiv_byp: Used to enable the bypass input to the USB_CLK_DIV.
287          * @sd_mode: Scaledown mode for the USBC. Control timing events
288          *      in the USBC, for normal operation this must be '0'.
289          * @s_bist: Starts bist on the hclk memories, during the '0'
290          *      to '1' transition.
291          * @por: Power On Reset for the PHY.
292          *      Resets all the PHYS registers and state machines.
293          * @enable: When '1' allows the generation of the hclk. When
294          *      '0' the hclk will not be generated. SEE DIVIDE
295          *      field of this register.
296          * @prst: When this field is '0' the reset associated with
297          *      the phy_clk functionality in the USB Subsystem is
298          *      help in reset. This bit should not be set to '1'
299          *      until the time it takes 6 clocks (hclk or phy_clk,
300          *      whichever is slower) has passed. Under normal
301          *      operation once this bit is set to '1' it should not
302          *      be set to '0'.
303          * @hrst: When this field is '0' the reset associated with
304          *      the hclk functioanlity in the USB Subsystem is
305          *      held in reset.This bit should not be set to '1'
306          *      until 12ms after phy_clk is stable. Under normal
307          *      operation, once this bit is set to '1' it should
308          *      not be set to '0'.
309          * @divide: The frequency of 'hclk' used by the USB subsystem
310          *      is the eclk frequency divided by the value of
311          *      (DIVIDE2 + 1) * (DIVIDE + 1), also see the field
312          *      DIVIDE2 of this register.
313          *      The hclk frequency should be less than 125Mhz.
314          *      After writing a value to this field the SW should
315          *      read the field for the value written.
316          *      The ENABLE field of this register should not be set
317          *      until AFTER this field is set and then read.
318          */
319         struct cvmx_usbnx_clk_ctl_cn50xx {
320                 uint64_t reserved_20_63 : 44;
321                 uint64_t divide2        : 2;
322                 uint64_t hclk_rst       : 1;
323                 uint64_t reserved_16_16 : 1;
324                 uint64_t p_rtype        : 2;
325                 uint64_t p_com_on       : 1;
326                 uint64_t p_c_sel        : 2;
327                 uint64_t cdiv_byp       : 1;
328                 uint64_t sd_mode        : 2;
329                 uint64_t s_bist         : 1;
330                 uint64_t por            : 1;
331                 uint64_t enable         : 1;
332                 uint64_t prst           : 1;
333                 uint64_t hrst           : 1;
334                 uint64_t divide         : 3;
335         } cn50xx;
336         struct cvmx_usbnx_clk_ctl_cn50xx cn52xx;
337         struct cvmx_usbnx_clk_ctl_cn50xx cn56xx;
338 };
339 typedef union cvmx_usbnx_clk_ctl cvmx_usbnx_clk_ctl_t;
340
341 /**
342  * cvmx_usbn#_usbp_ctl_status
343  *
344  * USBN_USBP_CTL_STATUS = USBP Control And Status Register
345  *
346  * Contains general control and status information for the USBN block.
347  */
348 union cvmx_usbnx_usbp_ctl_status {
349         uint64_t u64;
350         /**
351          * struct cvmx_usbnx_usbp_ctl_status_s
352          * @txrisetune: HS Transmitter Rise/Fall Time Adjustment
353          * @txvreftune: HS DC Voltage Level Adjustment
354          * @txfslstune: FS/LS Source Impedence Adjustment
355          * @txhsxvtune: Transmitter High-Speed Crossover Adjustment
356          * @sqrxtune: Squelch Threshold Adjustment
357          * @compdistune: Disconnect Threshold Adjustment
358          * @otgtune: VBUS Valid Threshold Adjustment
359          * @otgdisable: OTG Block Disable
360          * @portreset: Per_Port Reset
361          * @drvvbus: Drive VBUS
362          * @lsbist: Low-Speed BIST Enable.
363          * @fsbist: Full-Speed BIST Enable.
364          * @hsbist: High-Speed BIST Enable.
365          * @bist_done: PHY Bist Done.
366          *      Asserted at the end of the PHY BIST sequence.
367          * @bist_err: PHY Bist Error.
368          *      Indicates an internal error was detected during
369          *      the BIST sequence.
370          * @tdata_out: PHY Test Data Out.
371          *      Presents either internaly generated signals or
372          *      test register contents, based upon the value of
373          *      test_data_out_sel.
374          * @siddq: Drives the USBP (USB-PHY) SIDDQ input.
375          *      Normally should be set to zero.
376          *      When customers have no intent to use USB PHY
377          *      interface, they should:
378          *      - still provide 3.3V to USB_VDD33, and
379          *      - tie USB_REXT to 3.3V supply, and
380          *      - set USBN*_USBP_CTL_STATUS[SIDDQ]=1
381          * @txpreemphasistune: HS Transmitter Pre-Emphasis Enable
382          * @dma_bmode: When set to 1 the L2C DMA address will be updated
383          *      with byte-counts between packets. When set to 0
384          *      the L2C DMA address is incremented to the next
385          *      4-byte aligned address after adding byte-count.
386          * @usbc_end: Bigendian input to the USB Core. This should be
387          *      set to '0' for operation.
388          * @usbp_bist: PHY, This is cleared '0' to run BIST on the USBP.
389          * @tclk: PHY Test Clock, used to load TDATA_IN to the USBP.
390          * @dp_pulld: PHY DP_PULLDOWN input to the USB-PHY.
391          *      This signal enables the pull-down resistance on
392          *      the D+ line. '1' pull down-resistance is connected
393          *      to D+/ '0' pull down resistance is not connected
394          *      to D+. When an A/B device is acting as a host
395          *      (downstream-facing port), dp_pulldown and
396          *      dm_pulldown are enabled. This must not toggle
397          *      during normal opeartion.
398          * @dm_pulld: PHY DM_PULLDOWN input to the USB-PHY.
399          *      This signal enables the pull-down resistance on
400          *      the D- line. '1' pull down-resistance is connected
401          *      to D-. '0' pull down resistance is not connected
402          *      to D-. When an A/B device is acting as a host
403          *      (downstream-facing port), dp_pulldown and
404          *      dm_pulldown are enabled. This must not toggle
405          *      during normal opeartion.
406          * @hst_mode: When '0' the USB is acting as HOST, when '1'
407          *      USB is acting as device. This field needs to be
408          *      set while the USB is in reset.
409          * @tuning: Transmitter Tuning for High-Speed Operation.
410          *      Tunes the current supply and rise/fall output
411          *      times for high-speed operation.
412          *      [20:19] == 11: Current supply increased
413          *      approximately 9%
414          *      [20:19] == 10: Current supply increased
415          *      approximately 4.5%
416          *      [20:19] == 01: Design default.
417          *      [20:19] == 00: Current supply decreased
418          *      approximately 4.5%
419          *      [22:21] == 11: Rise and fall times are increased.
420          *      [22:21] == 10: Design default.
421          *      [22:21] == 01: Rise and fall times are decreased.
422          *      [22:21] == 00: Rise and fall times are decreased
423          *      further as compared to the 01 setting.
424          * @tx_bs_enh: Transmit Bit Stuffing on [15:8].
425          *      Enables or disables bit stuffing on data[15:8]
426          *      when bit-stuffing is enabled.
427          * @tx_bs_en: Transmit Bit Stuffing on [7:0].
428          *      Enables or disables bit stuffing on data[7:0]
429          *      when bit-stuffing is enabled.
430          * @loop_enb: PHY Loopback Test Enable.
431          *      '1': During data transmission the receive is
432          *      enabled.
433          *      '0': During data transmission the receive is
434          *      disabled.
435          *      Must be '0' for normal operation.
436          * @vtest_enb: Analog Test Pin Enable.
437          *      '1' The PHY's analog_test pin is enabled for the
438          *      input and output of applicable analog test signals.
439          *      '0' THe analog_test pin is disabled.
440          * @bist_enb: Built-In Self Test Enable.
441          *      Used to activate BIST in the PHY.
442          * @tdata_sel: Test Data Out Select.
443          *      '1' test_data_out[3:0] (PHY) register contents
444          *      are output. '0' internaly generated signals are
445          *      output.
446          * @taddr_in: Mode Address for Test Interface.
447          *      Specifies the register address for writing to or
448          *      reading from the PHY test interface register.
449          * @tdata_in: Internal Testing Register Input Data and Select
450          *      This is a test bus. Data is present on [3:0],
451          *      and its corresponding select (enable) is present
452          *      on bits [7:4].
453          * @ate_reset: Reset input from automatic test equipment.
454          *      This is a test signal. When the USB Core is
455          *      powered up (not in Susned Mode), an automatic
456          *      tester can use this to disable phy_clock and
457          *      free_clk, then re-eanable them with an aligned
458          *      phase.
459          *      '1': The phy_clk and free_clk outputs are
460          *      disabled. "0": The phy_clock and free_clk outputs
461          *      are available within a specific period after the
462          *      de-assertion.
463          */
464         struct cvmx_usbnx_usbp_ctl_status_s {
465                 uint64_t txrisetune             : 1;
466                 uint64_t txvreftune             : 4;
467                 uint64_t txfslstune             : 4;
468                 uint64_t txhsxvtune             : 2;
469                 uint64_t sqrxtune               : 3;
470                 uint64_t compdistune            : 3;
471                 uint64_t otgtune                : 3;
472                 uint64_t otgdisable             : 1;
473                 uint64_t portreset              : 1;
474                 uint64_t drvvbus                : 1;
475                 uint64_t lsbist                 : 1;
476                 uint64_t fsbist                 : 1;
477                 uint64_t hsbist                 : 1;
478                 uint64_t bist_done              : 1;
479                 uint64_t bist_err               : 1;
480                 uint64_t tdata_out              : 4;
481                 uint64_t siddq                  : 1;
482                 uint64_t txpreemphasistune      : 1;
483                 uint64_t dma_bmode              : 1;
484                 uint64_t usbc_end               : 1;
485                 uint64_t usbp_bist              : 1;
486                 uint64_t tclk                   : 1;
487                 uint64_t dp_pulld               : 1;
488                 uint64_t dm_pulld               : 1;
489                 uint64_t hst_mode               : 1;
490                 uint64_t tuning                 : 4;
491                 uint64_t tx_bs_enh              : 1;
492                 uint64_t tx_bs_en               : 1;
493                 uint64_t loop_enb               : 1;
494                 uint64_t vtest_enb              : 1;
495                 uint64_t bist_enb               : 1;
496                 uint64_t tdata_sel              : 1;
497                 uint64_t taddr_in               : 4;
498                 uint64_t tdata_in               : 8;
499                 uint64_t ate_reset              : 1;
500         } s;
501         /**
502          * struct cvmx_usbnx_usbp_ctl_status_cn30xx
503          * @bist_done: PHY Bist Done.
504          *      Asserted at the end of the PHY BIST sequence.
505          * @bist_err: PHY Bist Error.
506          *      Indicates an internal error was detected during
507          *      the BIST sequence.
508          * @tdata_out: PHY Test Data Out.
509          *      Presents either internaly generated signals or
510          *      test register contents, based upon the value of
511          *      test_data_out_sel.
512          * @dma_bmode: When set to 1 the L2C DMA address will be updated
513          *      with byte-counts between packets. When set to 0
514          *      the L2C DMA address is incremented to the next
515          *      4-byte aligned address after adding byte-count.
516          * @usbc_end: Bigendian input to the USB Core. This should be
517          *      set to '0' for operation.
518          * @usbp_bist: PHY, This is cleared '0' to run BIST on the USBP.
519          * @tclk: PHY Test Clock, used to load TDATA_IN to the USBP.
520          * @dp_pulld: PHY DP_PULLDOWN input to the USB-PHY.
521          *      This signal enables the pull-down resistance on
522          *      the D+ line. '1' pull down-resistance is connected
523          *      to D+/ '0' pull down resistance is not connected
524          *      to D+. When an A/B device is acting as a host
525          *      (downstream-facing port), dp_pulldown and
526          *      dm_pulldown are enabled. This must not toggle
527          *      during normal opeartion.
528          * @dm_pulld: PHY DM_PULLDOWN input to the USB-PHY.
529          *      This signal enables the pull-down resistance on
530          *      the D- line. '1' pull down-resistance is connected
531          *      to D-. '0' pull down resistance is not connected
532          *      to D-. When an A/B device is acting as a host
533          *      (downstream-facing port), dp_pulldown and
534          *      dm_pulldown are enabled. This must not toggle
535          *      during normal opeartion.
536          * @hst_mode: When '0' the USB is acting as HOST, when '1'
537          *      USB is acting as device. This field needs to be
538          *      set while the USB is in reset.
539          * @tuning: Transmitter Tuning for High-Speed Operation.
540          *      Tunes the current supply and rise/fall output
541          *      times for high-speed operation.
542          *      [20:19] == 11: Current supply increased
543          *      approximately 9%
544          *      [20:19] == 10: Current supply increased
545          *      approximately 4.5%
546          *      [20:19] == 01: Design default.
547          *      [20:19] == 00: Current supply decreased
548          *      approximately 4.5%
549          *      [22:21] == 11: Rise and fall times are increased.
550          *      [22:21] == 10: Design default.
551          *      [22:21] == 01: Rise and fall times are decreased.
552          *      [22:21] == 00: Rise and fall times are decreased
553          *      further as compared to the 01 setting.
554          * @tx_bs_enh: Transmit Bit Stuffing on [15:8].
555          *      Enables or disables bit stuffing on data[15:8]
556          *      when bit-stuffing is enabled.
557          * @tx_bs_en: Transmit Bit Stuffing on [7:0].
558          *      Enables or disables bit stuffing on data[7:0]
559          *      when bit-stuffing is enabled.
560          * @loop_enb: PHY Loopback Test Enable.
561          *      '1': During data transmission the receive is
562          *      enabled.
563          *      '0': During data transmission the receive is
564          *      disabled.
565          *      Must be '0' for normal operation.
566          * @vtest_enb: Analog Test Pin Enable.
567          *      '1' The PHY's analog_test pin is enabled for the
568          *      input and output of applicable analog test signals.
569          *      '0' THe analog_test pin is disabled.
570          * @bist_enb: Built-In Self Test Enable.
571          *      Used to activate BIST in the PHY.
572          * @tdata_sel: Test Data Out Select.
573          *      '1' test_data_out[3:0] (PHY) register contents
574          *      are output. '0' internaly generated signals are
575          *      output.
576          * @taddr_in: Mode Address for Test Interface.
577          *      Specifies the register address for writing to or
578          *      reading from the PHY test interface register.
579          * @tdata_in: Internal Testing Register Input Data and Select
580          *      This is a test bus. Data is present on [3:0],
581          *      and its corresponding select (enable) is present
582          *      on bits [7:4].
583          * @ate_reset: Reset input from automatic test equipment.
584          *      This is a test signal. When the USB Core is
585          *      powered up (not in Susned Mode), an automatic
586          *      tester can use this to disable phy_clock and
587          *      free_clk, then re-eanable them with an aligned
588          *      phase.
589          *      '1': The phy_clk and free_clk outputs are
590          *      disabled. "0": The phy_clock and free_clk outputs
591          *      are available within a specific period after the
592          *      de-assertion.
593          */
594         struct cvmx_usbnx_usbp_ctl_status_cn30xx {
595                 uint64_t reserved_38_63 : 26;
596                 uint64_t bist_done      : 1;
597                 uint64_t bist_err       : 1;
598                 uint64_t tdata_out      : 4;
599                 uint64_t reserved_30_31 : 2;
600                 uint64_t dma_bmode      : 1;
601                 uint64_t usbc_end       : 1;
602                 uint64_t usbp_bist      : 1;
603                 uint64_t tclk           : 1;
604                 uint64_t dp_pulld       : 1;
605                 uint64_t dm_pulld       : 1;
606                 uint64_t hst_mode       : 1;
607                 uint64_t tuning         : 4;
608                 uint64_t tx_bs_enh      : 1;
609                 uint64_t tx_bs_en       : 1;
610                 uint64_t loop_enb       : 1;
611                 uint64_t vtest_enb      : 1;
612                 uint64_t bist_enb       : 1;
613                 uint64_t tdata_sel      : 1;
614                 uint64_t taddr_in       : 4;
615                 uint64_t tdata_in       : 8;
616                 uint64_t ate_reset      : 1;
617         } cn30xx;
618         /**
619          * struct cvmx_usbnx_usbp_ctl_status_cn50xx
620          * @txrisetune: HS Transmitter Rise/Fall Time Adjustment
621          * @txvreftune: HS DC Voltage Level Adjustment
622          * @txfslstune: FS/LS Source Impedence Adjustment
623          * @txhsxvtune: Transmitter High-Speed Crossover Adjustment
624          * @sqrxtune: Squelch Threshold Adjustment
625          * @compdistune: Disconnect Threshold Adjustment
626          * @otgtune: VBUS Valid Threshold Adjustment
627          * @otgdisable: OTG Block Disable
628          * @portreset: Per_Port Reset
629          * @drvvbus: Drive VBUS
630          * @lsbist: Low-Speed BIST Enable.
631          * @fsbist: Full-Speed BIST Enable.
632          * @hsbist: High-Speed BIST Enable.
633          * @bist_done: PHY Bist Done.
634          *      Asserted at the end of the PHY BIST sequence.
635          * @bist_err: PHY Bist Error.
636          *      Indicates an internal error was detected during
637          *      the BIST sequence.
638          * @tdata_out: PHY Test Data Out.
639          *      Presents either internaly generated signals or
640          *      test register contents, based upon the value of
641          *      test_data_out_sel.
642          * @txpreemphasistune: HS Transmitter Pre-Emphasis Enable
643          * @dma_bmode: When set to 1 the L2C DMA address will be updated
644          *      with byte-counts between packets. When set to 0
645          *      the L2C DMA address is incremented to the next
646          *      4-byte aligned address after adding byte-count.
647          * @usbc_end: Bigendian input to the USB Core. This should be
648          *      set to '0' for operation.
649          * @usbp_bist: PHY, This is cleared '0' to run BIST on the USBP.
650          * @tclk: PHY Test Clock, used to load TDATA_IN to the USBP.
651          * @dp_pulld: PHY DP_PULLDOWN input to the USB-PHY.
652          *      This signal enables the pull-down resistance on
653          *      the D+ line. '1' pull down-resistance is connected
654          *      to D+/ '0' pull down resistance is not connected
655          *      to D+. When an A/B device is acting as a host
656          *      (downstream-facing port), dp_pulldown and
657          *      dm_pulldown are enabled. This must not toggle
658          *      during normal opeartion.
659          * @dm_pulld: PHY DM_PULLDOWN input to the USB-PHY.
660          *      This signal enables the pull-down resistance on
661          *      the D- line. '1' pull down-resistance is connected
662          *      to D-. '0' pull down resistance is not connected
663          *      to D-. When an A/B device is acting as a host
664          *      (downstream-facing port), dp_pulldown and
665          *      dm_pulldown are enabled. This must not toggle
666          *      during normal opeartion.
667          * @hst_mode: When '0' the USB is acting as HOST, when '1'
668          *      USB is acting as device. This field needs to be
669          *      set while the USB is in reset.
670          * @tx_bs_enh: Transmit Bit Stuffing on [15:8].
671          *      Enables or disables bit stuffing on data[15:8]
672          *      when bit-stuffing is enabled.
673          * @tx_bs_en: Transmit Bit Stuffing on [7:0].
674          *      Enables or disables bit stuffing on data[7:0]
675          *      when bit-stuffing is enabled.
676          * @loop_enb: PHY Loopback Test Enable.
677          *      '1': During data transmission the receive is
678          *      enabled.
679          *      '0': During data transmission the receive is
680          *      disabled.
681          *      Must be '0' for normal operation.
682          * @vtest_enb: Analog Test Pin Enable.
683          *      '1' The PHY's analog_test pin is enabled for the
684          *      input and output of applicable analog test signals.
685          *      '0' THe analog_test pin is disabled.
686          * @bist_enb: Built-In Self Test Enable.
687          *      Used to activate BIST in the PHY.
688          * @tdata_sel: Test Data Out Select.
689          *      '1' test_data_out[3:0] (PHY) register contents
690          *      are output. '0' internaly generated signals are
691          *      output.
692          * @taddr_in: Mode Address for Test Interface.
693          *      Specifies the register address for writing to or
694          *      reading from the PHY test interface register.
695          * @tdata_in: Internal Testing Register Input Data and Select
696          *      This is a test bus. Data is present on [3:0],
697          *      and its corresponding select (enable) is present
698          *      on bits [7:4].
699          * @ate_reset: Reset input from automatic test equipment.
700          *      This is a test signal. When the USB Core is
701          *      powered up (not in Susned Mode), an automatic
702          *      tester can use this to disable phy_clock and
703          *      free_clk, then re-eanable them with an aligned
704          *      phase.
705          *      '1': The phy_clk and free_clk outputs are
706          *      disabled. "0": The phy_clock and free_clk outputs
707          *      are available within a specific period after the
708          *      de-assertion.
709          */
710         struct cvmx_usbnx_usbp_ctl_status_cn50xx {
711                 uint64_t txrisetune             : 1;
712                 uint64_t txvreftune             : 4;
713                 uint64_t txfslstune             : 4;
714                 uint64_t txhsxvtune             : 2;
715                 uint64_t sqrxtune               : 3;
716                 uint64_t compdistune            : 3;
717                 uint64_t otgtune                : 3;
718                 uint64_t otgdisable             : 1;
719                 uint64_t portreset              : 1;
720                 uint64_t drvvbus                : 1;
721                 uint64_t lsbist                 : 1;
722                 uint64_t fsbist                 : 1;
723                 uint64_t hsbist                 : 1;
724                 uint64_t bist_done              : 1;
725                 uint64_t bist_err               : 1;
726                 uint64_t tdata_out              : 4;
727                 uint64_t reserved_31_31         : 1;
728                 uint64_t txpreemphasistune      : 1;
729                 uint64_t dma_bmode              : 1;
730                 uint64_t usbc_end               : 1;
731                 uint64_t usbp_bist              : 1;
732                 uint64_t tclk                   : 1;
733                 uint64_t dp_pulld               : 1;
734                 uint64_t dm_pulld               : 1;
735                 uint64_t hst_mode               : 1;
736                 uint64_t reserved_19_22         : 4;
737                 uint64_t tx_bs_enh              : 1;
738                 uint64_t tx_bs_en               : 1;
739                 uint64_t loop_enb               : 1;
740                 uint64_t vtest_enb              : 1;
741                 uint64_t bist_enb               : 1;
742                 uint64_t tdata_sel              : 1;
743                 uint64_t taddr_in               : 4;
744                 uint64_t tdata_in               : 8;
745                 uint64_t ate_reset              : 1;
746         } cn50xx;
747         /**
748          * struct cvmx_usbnx_usbp_ctl_status_cn52xx
749          * @txrisetune: HS Transmitter Rise/Fall Time Adjustment
750          * @txvreftune: HS DC Voltage Level Adjustment
751          * @txfslstune: FS/LS Source Impedence Adjustment
752          * @txhsxvtune: Transmitter High-Speed Crossover Adjustment
753          * @sqrxtune: Squelch Threshold Adjustment
754          * @compdistune: Disconnect Threshold Adjustment
755          * @otgtune: VBUS Valid Threshold Adjustment
756          * @otgdisable: OTG Block Disable
757          * @portreset: Per_Port Reset
758          * @drvvbus: Drive VBUS
759          * @lsbist: Low-Speed BIST Enable.
760          * @fsbist: Full-Speed BIST Enable.
761          * @hsbist: High-Speed BIST Enable.
762          * @bist_done: PHY Bist Done.
763          *      Asserted at the end of the PHY BIST sequence.
764          * @bist_err: PHY Bist Error.
765          *      Indicates an internal error was detected during
766          *      the BIST sequence.
767          * @tdata_out: PHY Test Data Out.
768          *      Presents either internaly generated signals or
769          *      test register contents, based upon the value of
770          *      test_data_out_sel.
771          * @siddq: Drives the USBP (USB-PHY) SIDDQ input.
772          *      Normally should be set to zero.
773          *      When customers have no intent to use USB PHY
774          *      interface, they should:
775          *      - still provide 3.3V to USB_VDD33, and
776          *      - tie USB_REXT to 3.3V supply, and
777          *      - set USBN*_USBP_CTL_STATUS[SIDDQ]=1
778          * @txpreemphasistune: HS Transmitter Pre-Emphasis Enable
779          * @dma_bmode: When set to 1 the L2C DMA address will be updated
780          *      with byte-counts between packets. When set to 0
781          *      the L2C DMA address is incremented to the next
782          *      4-byte aligned address after adding byte-count.
783          * @usbc_end: Bigendian input to the USB Core. This should be
784          *      set to '0' for operation.
785          * @usbp_bist: PHY, This is cleared '0' to run BIST on the USBP.
786          * @tclk: PHY Test Clock, used to load TDATA_IN to the USBP.
787          * @dp_pulld: PHY DP_PULLDOWN input to the USB-PHY.
788          *      This signal enables the pull-down resistance on
789          *      the D+ line. '1' pull down-resistance is connected
790          *      to D+/ '0' pull down resistance is not connected
791          *      to D+. When an A/B device is acting as a host
792          *      (downstream-facing port), dp_pulldown and
793          *      dm_pulldown are enabled. This must not toggle
794          *      during normal opeartion.
795          * @dm_pulld: PHY DM_PULLDOWN input to the USB-PHY.
796          *      This signal enables the pull-down resistance on
797          *      the D- line. '1' pull down-resistance is connected
798          *      to D-. '0' pull down resistance is not connected
799          *      to D-. When an A/B device is acting as a host
800          *      (downstream-facing port), dp_pulldown and
801          *      dm_pulldown are enabled. This must not toggle
802          *      during normal opeartion.
803          * @hst_mode: When '0' the USB is acting as HOST, when '1'
804          *      USB is acting as device. This field needs to be
805          *      set while the USB is in reset.
806          * @tx_bs_enh: Transmit Bit Stuffing on [15:8].
807          *      Enables or disables bit stuffing on data[15:8]
808          *      when bit-stuffing is enabled.
809          * @tx_bs_en: Transmit Bit Stuffing on [7:0].
810          *      Enables or disables bit stuffing on data[7:0]
811          *      when bit-stuffing is enabled.
812          * @loop_enb: PHY Loopback Test Enable.
813          *      '1': During data transmission the receive is
814          *      enabled.
815          *      '0': During data transmission the receive is
816          *      disabled.
817          *      Must be '0' for normal operation.
818          * @vtest_enb: Analog Test Pin Enable.
819          *      '1' The PHY's analog_test pin is enabled for the
820          *      input and output of applicable analog test signals.
821          *      '0' THe analog_test pin is disabled.
822          * @bist_enb: Built-In Self Test Enable.
823          *      Used to activate BIST in the PHY.
824          * @tdata_sel: Test Data Out Select.
825          *      '1' test_data_out[3:0] (PHY) register contents
826          *      are output. '0' internaly generated signals are
827          *      output.
828          * @taddr_in: Mode Address for Test Interface.
829          *      Specifies the register address for writing to or
830          *      reading from the PHY test interface register.
831          * @tdata_in: Internal Testing Register Input Data and Select
832          *      This is a test bus. Data is present on [3:0],
833          *      and its corresponding select (enable) is present
834          *      on bits [7:4].
835          * @ate_reset: Reset input from automatic test equipment.
836          *      This is a test signal. When the USB Core is
837          *      powered up (not in Susned Mode), an automatic
838          *      tester can use this to disable phy_clock and
839          *      free_clk, then re-eanable them with an aligned
840          *      phase.
841          *      '1': The phy_clk and free_clk outputs are
842          *      disabled. "0": The phy_clock and free_clk outputs
843          *      are available within a specific period after the
844          *      de-assertion.
845          */
846         struct cvmx_usbnx_usbp_ctl_status_cn52xx {
847                 uint64_t txrisetune             : 1;
848                 uint64_t txvreftune             : 4;
849                 uint64_t txfslstune             : 4;
850                 uint64_t txhsxvtune             : 2;
851                 uint64_t sqrxtune               : 3;
852                 uint64_t compdistune            : 3;
853                 uint64_t otgtune                : 3;
854                 uint64_t otgdisable             : 1;
855                 uint64_t portreset              : 1;
856                 uint64_t drvvbus                : 1;
857                 uint64_t lsbist                 : 1;
858                 uint64_t fsbist                 : 1;
859                 uint64_t hsbist                 : 1;
860                 uint64_t bist_done              : 1;
861                 uint64_t bist_err               : 1;
862                 uint64_t tdata_out              : 4;
863                 uint64_t siddq                  : 1;
864                 uint64_t txpreemphasistune      : 1;
865                 uint64_t dma_bmode              : 1;
866                 uint64_t usbc_end               : 1;
867                 uint64_t usbp_bist              : 1;
868                 uint64_t tclk                   : 1;
869                 uint64_t dp_pulld               : 1;
870                 uint64_t dm_pulld               : 1;
871                 uint64_t hst_mode               : 1;
872                 uint64_t reserved_19_22         : 4;
873                 uint64_t tx_bs_enh              : 1;
874                 uint64_t tx_bs_en               : 1;
875                 uint64_t loop_enb               : 1;
876                 uint64_t vtest_enb              : 1;
877                 uint64_t bist_enb               : 1;
878                 uint64_t tdata_sel              : 1;
879                 uint64_t taddr_in               : 4;
880                 uint64_t tdata_in               : 8;
881                 uint64_t ate_reset              : 1;
882         } cn52xx;
883 };
884 typedef union cvmx_usbnx_usbp_ctl_status cvmx_usbnx_usbp_ctl_status_t;
885
886 #endif