trio_pcie_intfc.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. /*
  2. * Copyright 2012 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. /* Machine-generated file; do not edit. */
  15. #ifndef __ARCH_TRIO_PCIE_INTFC_H__
  16. #define __ARCH_TRIO_PCIE_INTFC_H__
  17. #include <arch/abi.h>
  18. #include <arch/trio_pcie_intfc_def.h>
  19. #ifndef __ASSEMBLER__
  20. /*
  21. * Port Configuration.
  22. * Configuration of the PCIe Port
  23. */
  24. __extension__
  25. typedef union
  26. {
  27. struct
  28. {
  29. #ifndef __BIG_ENDIAN__
  30. /* Provides the state of the strapping pins for this port. */
  31. uint_reg_t strap_state : 3;
  32. /* Reserved. */
  33. uint_reg_t __reserved_0 : 1;
  34. /*
  35. * When 1, the device type will be overridden using OVD_DEV_TYPE_VAL.
  36. * When 0, the device type is determined based on the STRAP_STATE.
  37. */
  38. uint_reg_t ovd_dev_type : 1;
  39. /* Provides the device type when OVD_DEV_TYPE is 1. */
  40. uint_reg_t ovd_dev_type_val : 4;
  41. /* Determines how link is trained. */
  42. uint_reg_t train_mode : 2;
  43. /* Reserved. */
  44. uint_reg_t __reserved_1 : 1;
  45. /*
  46. * For PCIe, used to flip physical RX lanes that were not properly wired.
  47. * This is not the same as lane reversal which is handled automatically
  48. * during link training. When 0, RX Lane0 must be wired to the link
  49. * partner (either to its Lane0 or it's LaneN). When RX_LANE_FLIP is 1,
  50. * the highest numbered lane for this port becomes Lane0 and Lane0 does
  51. * NOT have to be wired to the link partner.
  52. */
  53. uint_reg_t rx_lane_flip : 1;
  54. /*
  55. * For PCIe, used to flip physical TX lanes that were not properly wired.
  56. * This is not the same as lane reversal which is handled automatically
  57. * during link training. When 0, TX Lane0 must be wired to the link
  58. * partner (either to its Lane0 or it's LaneN). When TX_LANE_FLIP is 1,
  59. * the highest numbered lane for this port becomes Lane0 and Lane0 does
  60. * NOT have to be wired to the link partner.
  61. */
  62. uint_reg_t tx_lane_flip : 1;
  63. /*
  64. * For StreamIO port, configures the width of the port when TRAIN_MODE is
  65. * not STRAP.
  66. */
  67. uint_reg_t stream_width : 2;
  68. /*
  69. * For StreamIO port, configures the rate of the port when TRAIN_MODE is
  70. * not STRAP.
  71. */
  72. uint_reg_t stream_rate : 2;
  73. /* Reserved. */
  74. uint_reg_t __reserved_2 : 46;
  75. #else /* __BIG_ENDIAN__ */
  76. uint_reg_t __reserved_2 : 46;
  77. uint_reg_t stream_rate : 2;
  78. uint_reg_t stream_width : 2;
  79. uint_reg_t tx_lane_flip : 1;
  80. uint_reg_t rx_lane_flip : 1;
  81. uint_reg_t __reserved_1 : 1;
  82. uint_reg_t train_mode : 2;
  83. uint_reg_t ovd_dev_type_val : 4;
  84. uint_reg_t ovd_dev_type : 1;
  85. uint_reg_t __reserved_0 : 1;
  86. uint_reg_t strap_state : 3;
  87. #endif
  88. };
  89. uint_reg_t word;
  90. } TRIO_PCIE_INTFC_PORT_CONFIG_t;
  91. /*
  92. * Port Status.
  93. * Status of the PCIe Port. This register applies to the StreamIO port when
  94. * StreamIO is enabled.
  95. */
  96. __extension__
  97. typedef union
  98. {
  99. struct
  100. {
  101. #ifndef __BIG_ENDIAN__
  102. /*
  103. * Indicates the DL state of the port. When 1, the port is up and ready
  104. * to receive traffic.
  105. */
  106. uint_reg_t dl_up : 1;
  107. /*
  108. * Indicates the number of times the link has gone down. Clears on read.
  109. */
  110. uint_reg_t dl_down_cnt : 7;
  111. /* Indicates the SERDES PLL has spun up and is providing a valid clock. */
  112. uint_reg_t clock_ready : 1;
  113. /* Reserved. */
  114. uint_reg_t __reserved_0 : 7;
  115. /* Device revision ID. */
  116. uint_reg_t device_rev : 8;
  117. /* Link state (PCIe). */
  118. uint_reg_t ltssm_state : 6;
  119. /* Link power management state (PCIe). */
  120. uint_reg_t pm_state : 3;
  121. /* Reserved. */
  122. uint_reg_t __reserved_1 : 31;
  123. #else /* __BIG_ENDIAN__ */
  124. uint_reg_t __reserved_1 : 31;
  125. uint_reg_t pm_state : 3;
  126. uint_reg_t ltssm_state : 6;
  127. uint_reg_t device_rev : 8;
  128. uint_reg_t __reserved_0 : 7;
  129. uint_reg_t clock_ready : 1;
  130. uint_reg_t dl_down_cnt : 7;
  131. uint_reg_t dl_up : 1;
  132. #endif
  133. };
  134. uint_reg_t word;
  135. } TRIO_PCIE_INTFC_PORT_STATUS_t;
  136. /*
  137. * Transmit FIFO Control.
  138. * Contains TX FIFO thresholds. These registers are for diagnostics purposes
  139. * only. Changing these values causes undefined behavior.
  140. */
  141. __extension__
  142. typedef union
  143. {
  144. struct
  145. {
  146. #ifndef __BIG_ENDIAN__
  147. /*
  148. * Almost-Empty level for TX0 data. Typically set to at least
  149. * roundup(38.0*M/N) where N=tclk frequency and M=MAC symbol rate in MHz
  150. * for a x4 port (250MHz).
  151. */
  152. uint_reg_t tx0_data_ae_lvl : 7;
  153. /* Reserved. */
  154. uint_reg_t __reserved_0 : 1;
  155. /* Almost-Empty level for TX1 data. */
  156. uint_reg_t tx1_data_ae_lvl : 7;
  157. /* Reserved. */
  158. uint_reg_t __reserved_1 : 1;
  159. /* Almost-Full level for TX0 data. */
  160. uint_reg_t tx0_data_af_lvl : 7;
  161. /* Reserved. */
  162. uint_reg_t __reserved_2 : 1;
  163. /* Almost-Full level for TX1 data. */
  164. uint_reg_t tx1_data_af_lvl : 7;
  165. /* Reserved. */
  166. uint_reg_t __reserved_3 : 1;
  167. /* Almost-Full level for TX0 info. */
  168. uint_reg_t tx0_info_af_lvl : 5;
  169. /* Reserved. */
  170. uint_reg_t __reserved_4 : 3;
  171. /* Almost-Full level for TX1 info. */
  172. uint_reg_t tx1_info_af_lvl : 5;
  173. /* Reserved. */
  174. uint_reg_t __reserved_5 : 3;
  175. /*
  176. * This register provides performance adjustment for high bandwidth
  177. * flows. The MAC will assert almost-full to TRIO if non-posted credits
  178. * fall below this level. Note that setting this larger than the initial
  179. * PORT_CREDIT.NPH value will cause READS to never be sent. If the
  180. * initial credit value from the link partner is smaller than this value
  181. * when the link comes up, the value will be reset to the initial credit
  182. * value to prevent lockup.
  183. */
  184. uint_reg_t min_np_credits : 8;
  185. /*
  186. * This register provides performance adjustment for high bandwidth
  187. * flows. The MAC will assert almost-full to TRIO if posted credits fall
  188. * below this level. Note that setting this larger than the initial
  189. * PORT_CREDIT.PH value will cause WRITES to never be sent. If the
  190. * initial credit value from the link partner is smaller than this value
  191. * when the link comes up, the value will be reset to the initial credit
  192. * value to prevent lockup.
  193. */
  194. uint_reg_t min_p_credits : 8;
  195. #else /* __BIG_ENDIAN__ */
  196. uint_reg_t min_p_credits : 8;
  197. uint_reg_t min_np_credits : 8;
  198. uint_reg_t __reserved_5 : 3;
  199. uint_reg_t tx1_info_af_lvl : 5;
  200. uint_reg_t __reserved_4 : 3;
  201. uint_reg_t tx0_info_af_lvl : 5;
  202. uint_reg_t __reserved_3 : 1;
  203. uint_reg_t tx1_data_af_lvl : 7;
  204. uint_reg_t __reserved_2 : 1;
  205. uint_reg_t tx0_data_af_lvl : 7;
  206. uint_reg_t __reserved_1 : 1;
  207. uint_reg_t tx1_data_ae_lvl : 7;
  208. uint_reg_t __reserved_0 : 1;
  209. uint_reg_t tx0_data_ae_lvl : 7;
  210. #endif
  211. };
  212. uint_reg_t word;
  213. } TRIO_PCIE_INTFC_TX_FIFO_CTL_t;
  214. #endif /* !defined(__ASSEMBLER__) */
  215. #endif /* !defined(__ARCH_TRIO_PCIE_INTFC_H__) */