cvmx-pcsx-defs.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. /***********************license start***************
  2. * Author: Cavium Networks
  3. *
  4. * Contact: support@caviumnetworks.com
  5. * This file is part of the OCTEON SDK
  6. *
  7. * Copyright (c) 2003-2008 Cavium Networks
  8. *
  9. * This file is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License, Version 2, as
  11. * published by the Free Software Foundation.
  12. *
  13. * This file is distributed in the hope that it will be useful, but
  14. * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
  15. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
  16. * NONINFRINGEMENT. See the GNU General Public License for more
  17. * details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this file; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  22. * or visit http://www.gnu.org/licenses/.
  23. *
  24. * This file may also be available under a different license from Cavium.
  25. * Contact Cavium Networks for more information
  26. ***********************license end**************************************/
  27. #ifndef __CVMX_PCSX_DEFS_H__
  28. #define __CVMX_PCSX_DEFS_H__
  29. #define CVMX_PCSX_ANX_ADV_REG(offset, block_id) \
  30. CVMX_ADD_IO_SEG(0x00011800B0001010ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  31. #define CVMX_PCSX_ANX_EXT_ST_REG(offset, block_id) \
  32. CVMX_ADD_IO_SEG(0x00011800B0001028ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  33. #define CVMX_PCSX_ANX_LP_ABIL_REG(offset, block_id) \
  34. CVMX_ADD_IO_SEG(0x00011800B0001018ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  35. #define CVMX_PCSX_ANX_RESULTS_REG(offset, block_id) \
  36. CVMX_ADD_IO_SEG(0x00011800B0001020ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  37. #define CVMX_PCSX_INTX_EN_REG(offset, block_id) \
  38. CVMX_ADD_IO_SEG(0x00011800B0001088ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  39. #define CVMX_PCSX_INTX_REG(offset, block_id) \
  40. CVMX_ADD_IO_SEG(0x00011800B0001080ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  41. #define CVMX_PCSX_LINKX_TIMER_COUNT_REG(offset, block_id) \
  42. CVMX_ADD_IO_SEG(0x00011800B0001040ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  43. #define CVMX_PCSX_LOG_ANLX_REG(offset, block_id) \
  44. CVMX_ADD_IO_SEG(0x00011800B0001090ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  45. #define CVMX_PCSX_MISCX_CTL_REG(offset, block_id) \
  46. CVMX_ADD_IO_SEG(0x00011800B0001078ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  47. #define CVMX_PCSX_MRX_CONTROL_REG(offset, block_id) \
  48. CVMX_ADD_IO_SEG(0x00011800B0001000ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  49. #define CVMX_PCSX_MRX_STATUS_REG(offset, block_id) \
  50. CVMX_ADD_IO_SEG(0x00011800B0001008ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  51. #define CVMX_PCSX_RXX_STATES_REG(offset, block_id) \
  52. CVMX_ADD_IO_SEG(0x00011800B0001058ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  53. #define CVMX_PCSX_RXX_SYNC_REG(offset, block_id) \
  54. CVMX_ADD_IO_SEG(0x00011800B0001050ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  55. #define CVMX_PCSX_SGMX_AN_ADV_REG(offset, block_id) \
  56. CVMX_ADD_IO_SEG(0x00011800B0001068ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  57. #define CVMX_PCSX_SGMX_LP_ADV_REG(offset, block_id) \
  58. CVMX_ADD_IO_SEG(0x00011800B0001070ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  59. #define CVMX_PCSX_TXX_STATES_REG(offset, block_id) \
  60. CVMX_ADD_IO_SEG(0x00011800B0001060ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  61. #define CVMX_PCSX_TX_RXX_POLARITY_REG(offset, block_id) \
  62. CVMX_ADD_IO_SEG(0x00011800B0001048ull + (((offset) & 3) * 1024) + (((block_id) & 1) * 0x8000000ull))
  63. union cvmx_pcsx_anx_adv_reg {
  64. uint64_t u64;
  65. struct cvmx_pcsx_anx_adv_reg_s {
  66. uint64_t reserved_16_63:48;
  67. uint64_t np:1;
  68. uint64_t reserved_14_14:1;
  69. uint64_t rem_flt:2;
  70. uint64_t reserved_9_11:3;
  71. uint64_t pause:2;
  72. uint64_t hfd:1;
  73. uint64_t fd:1;
  74. uint64_t reserved_0_4:5;
  75. } s;
  76. struct cvmx_pcsx_anx_adv_reg_s cn52xx;
  77. struct cvmx_pcsx_anx_adv_reg_s cn52xxp1;
  78. struct cvmx_pcsx_anx_adv_reg_s cn56xx;
  79. struct cvmx_pcsx_anx_adv_reg_s cn56xxp1;
  80. };
  81. union cvmx_pcsx_anx_ext_st_reg {
  82. uint64_t u64;
  83. struct cvmx_pcsx_anx_ext_st_reg_s {
  84. uint64_t reserved_16_63:48;
  85. uint64_t thou_xfd:1;
  86. uint64_t thou_xhd:1;
  87. uint64_t thou_tfd:1;
  88. uint64_t thou_thd:1;
  89. uint64_t reserved_0_11:12;
  90. } s;
  91. struct cvmx_pcsx_anx_ext_st_reg_s cn52xx;
  92. struct cvmx_pcsx_anx_ext_st_reg_s cn52xxp1;
  93. struct cvmx_pcsx_anx_ext_st_reg_s cn56xx;
  94. struct cvmx_pcsx_anx_ext_st_reg_s cn56xxp1;
  95. };
  96. union cvmx_pcsx_anx_lp_abil_reg {
  97. uint64_t u64;
  98. struct cvmx_pcsx_anx_lp_abil_reg_s {
  99. uint64_t reserved_16_63:48;
  100. uint64_t np:1;
  101. uint64_t ack:1;
  102. uint64_t rem_flt:2;
  103. uint64_t reserved_9_11:3;
  104. uint64_t pause:2;
  105. uint64_t hfd:1;
  106. uint64_t fd:1;
  107. uint64_t reserved_0_4:5;
  108. } s;
  109. struct cvmx_pcsx_anx_lp_abil_reg_s cn52xx;
  110. struct cvmx_pcsx_anx_lp_abil_reg_s cn52xxp1;
  111. struct cvmx_pcsx_anx_lp_abil_reg_s cn56xx;
  112. struct cvmx_pcsx_anx_lp_abil_reg_s cn56xxp1;
  113. };
  114. union cvmx_pcsx_anx_results_reg {
  115. uint64_t u64;
  116. struct cvmx_pcsx_anx_results_reg_s {
  117. uint64_t reserved_7_63:57;
  118. uint64_t pause:2;
  119. uint64_t spd:2;
  120. uint64_t an_cpt:1;
  121. uint64_t dup:1;
  122. uint64_t link_ok:1;
  123. } s;
  124. struct cvmx_pcsx_anx_results_reg_s cn52xx;
  125. struct cvmx_pcsx_anx_results_reg_s cn52xxp1;
  126. struct cvmx_pcsx_anx_results_reg_s cn56xx;
  127. struct cvmx_pcsx_anx_results_reg_s cn56xxp1;
  128. };
  129. union cvmx_pcsx_intx_en_reg {
  130. uint64_t u64;
  131. struct cvmx_pcsx_intx_en_reg_s {
  132. uint64_t reserved_12_63:52;
  133. uint64_t dup:1;
  134. uint64_t sync_bad_en:1;
  135. uint64_t an_bad_en:1;
  136. uint64_t rxlock_en:1;
  137. uint64_t rxbad_en:1;
  138. uint64_t rxerr_en:1;
  139. uint64_t txbad_en:1;
  140. uint64_t txfifo_en:1;
  141. uint64_t txfifu_en:1;
  142. uint64_t an_err_en:1;
  143. uint64_t xmit_en:1;
  144. uint64_t lnkspd_en:1;
  145. } s;
  146. struct cvmx_pcsx_intx_en_reg_s cn52xx;
  147. struct cvmx_pcsx_intx_en_reg_s cn52xxp1;
  148. struct cvmx_pcsx_intx_en_reg_s cn56xx;
  149. struct cvmx_pcsx_intx_en_reg_s cn56xxp1;
  150. };
  151. union cvmx_pcsx_intx_reg {
  152. uint64_t u64;
  153. struct cvmx_pcsx_intx_reg_s {
  154. uint64_t reserved_12_63:52;
  155. uint64_t dup:1;
  156. uint64_t sync_bad:1;
  157. uint64_t an_bad:1;
  158. uint64_t rxlock:1;
  159. uint64_t rxbad:1;
  160. uint64_t rxerr:1;
  161. uint64_t txbad:1;
  162. uint64_t txfifo:1;
  163. uint64_t txfifu:1;
  164. uint64_t an_err:1;
  165. uint64_t xmit:1;
  166. uint64_t lnkspd:1;
  167. } s;
  168. struct cvmx_pcsx_intx_reg_s cn52xx;
  169. struct cvmx_pcsx_intx_reg_s cn52xxp1;
  170. struct cvmx_pcsx_intx_reg_s cn56xx;
  171. struct cvmx_pcsx_intx_reg_s cn56xxp1;
  172. };
  173. union cvmx_pcsx_linkx_timer_count_reg {
  174. uint64_t u64;
  175. struct cvmx_pcsx_linkx_timer_count_reg_s {
  176. uint64_t reserved_16_63:48;
  177. uint64_t count:16;
  178. } s;
  179. struct cvmx_pcsx_linkx_timer_count_reg_s cn52xx;
  180. struct cvmx_pcsx_linkx_timer_count_reg_s cn52xxp1;
  181. struct cvmx_pcsx_linkx_timer_count_reg_s cn56xx;
  182. struct cvmx_pcsx_linkx_timer_count_reg_s cn56xxp1;
  183. };
  184. union cvmx_pcsx_log_anlx_reg {
  185. uint64_t u64;
  186. struct cvmx_pcsx_log_anlx_reg_s {
  187. uint64_t reserved_4_63:60;
  188. uint64_t lafifovfl:1;
  189. uint64_t la_en:1;
  190. uint64_t pkt_sz:2;
  191. } s;
  192. struct cvmx_pcsx_log_anlx_reg_s cn52xx;
  193. struct cvmx_pcsx_log_anlx_reg_s cn52xxp1;
  194. struct cvmx_pcsx_log_anlx_reg_s cn56xx;
  195. struct cvmx_pcsx_log_anlx_reg_s cn56xxp1;
  196. };
  197. union cvmx_pcsx_miscx_ctl_reg {
  198. uint64_t u64;
  199. struct cvmx_pcsx_miscx_ctl_reg_s {
  200. uint64_t reserved_13_63:51;
  201. uint64_t sgmii:1;
  202. uint64_t gmxeno:1;
  203. uint64_t loopbck2:1;
  204. uint64_t mac_phy:1;
  205. uint64_t mode:1;
  206. uint64_t an_ovrd:1;
  207. uint64_t samp_pt:7;
  208. } s;
  209. struct cvmx_pcsx_miscx_ctl_reg_s cn52xx;
  210. struct cvmx_pcsx_miscx_ctl_reg_s cn52xxp1;
  211. struct cvmx_pcsx_miscx_ctl_reg_s cn56xx;
  212. struct cvmx_pcsx_miscx_ctl_reg_s cn56xxp1;
  213. };
  214. union cvmx_pcsx_mrx_control_reg {
  215. uint64_t u64;
  216. struct cvmx_pcsx_mrx_control_reg_s {
  217. uint64_t reserved_16_63:48;
  218. uint64_t reset:1;
  219. uint64_t loopbck1:1;
  220. uint64_t spdlsb:1;
  221. uint64_t an_en:1;
  222. uint64_t pwr_dn:1;
  223. uint64_t reserved_10_10:1;
  224. uint64_t rst_an:1;
  225. uint64_t dup:1;
  226. uint64_t coltst:1;
  227. uint64_t spdmsb:1;
  228. uint64_t uni:1;
  229. uint64_t reserved_0_4:5;
  230. } s;
  231. struct cvmx_pcsx_mrx_control_reg_s cn52xx;
  232. struct cvmx_pcsx_mrx_control_reg_s cn52xxp1;
  233. struct cvmx_pcsx_mrx_control_reg_s cn56xx;
  234. struct cvmx_pcsx_mrx_control_reg_s cn56xxp1;
  235. };
  236. union cvmx_pcsx_mrx_status_reg {
  237. uint64_t u64;
  238. struct cvmx_pcsx_mrx_status_reg_s {
  239. uint64_t reserved_16_63:48;
  240. uint64_t hun_t4:1;
  241. uint64_t hun_xfd:1;
  242. uint64_t hun_xhd:1;
  243. uint64_t ten_fd:1;
  244. uint64_t ten_hd:1;
  245. uint64_t hun_t2fd:1;
  246. uint64_t hun_t2hd:1;
  247. uint64_t ext_st:1;
  248. uint64_t reserved_7_7:1;
  249. uint64_t prb_sup:1;
  250. uint64_t an_cpt:1;
  251. uint64_t rm_flt:1;
  252. uint64_t an_abil:1;
  253. uint64_t lnk_st:1;
  254. uint64_t reserved_1_1:1;
  255. uint64_t extnd:1;
  256. } s;
  257. struct cvmx_pcsx_mrx_status_reg_s cn52xx;
  258. struct cvmx_pcsx_mrx_status_reg_s cn52xxp1;
  259. struct cvmx_pcsx_mrx_status_reg_s cn56xx;
  260. struct cvmx_pcsx_mrx_status_reg_s cn56xxp1;
  261. };
  262. union cvmx_pcsx_rxx_states_reg {
  263. uint64_t u64;
  264. struct cvmx_pcsx_rxx_states_reg_s {
  265. uint64_t reserved_16_63:48;
  266. uint64_t rx_bad:1;
  267. uint64_t rx_st:5;
  268. uint64_t sync_bad:1;
  269. uint64_t sync:4;
  270. uint64_t an_bad:1;
  271. uint64_t an_st:4;
  272. } s;
  273. struct cvmx_pcsx_rxx_states_reg_s cn52xx;
  274. struct cvmx_pcsx_rxx_states_reg_s cn52xxp1;
  275. struct cvmx_pcsx_rxx_states_reg_s cn56xx;
  276. struct cvmx_pcsx_rxx_states_reg_s cn56xxp1;
  277. };
  278. union cvmx_pcsx_rxx_sync_reg {
  279. uint64_t u64;
  280. struct cvmx_pcsx_rxx_sync_reg_s {
  281. uint64_t reserved_2_63:62;
  282. uint64_t sync:1;
  283. uint64_t bit_lock:1;
  284. } s;
  285. struct cvmx_pcsx_rxx_sync_reg_s cn52xx;
  286. struct cvmx_pcsx_rxx_sync_reg_s cn52xxp1;
  287. struct cvmx_pcsx_rxx_sync_reg_s cn56xx;
  288. struct cvmx_pcsx_rxx_sync_reg_s cn56xxp1;
  289. };
  290. union cvmx_pcsx_sgmx_an_adv_reg {
  291. uint64_t u64;
  292. struct cvmx_pcsx_sgmx_an_adv_reg_s {
  293. uint64_t reserved_16_63:48;
  294. uint64_t link:1;
  295. uint64_t ack:1;
  296. uint64_t reserved_13_13:1;
  297. uint64_t dup:1;
  298. uint64_t speed:2;
  299. uint64_t reserved_1_9:9;
  300. uint64_t one:1;
  301. } s;
  302. struct cvmx_pcsx_sgmx_an_adv_reg_s cn52xx;
  303. struct cvmx_pcsx_sgmx_an_adv_reg_s cn52xxp1;
  304. struct cvmx_pcsx_sgmx_an_adv_reg_s cn56xx;
  305. struct cvmx_pcsx_sgmx_an_adv_reg_s cn56xxp1;
  306. };
  307. union cvmx_pcsx_sgmx_lp_adv_reg {
  308. uint64_t u64;
  309. struct cvmx_pcsx_sgmx_lp_adv_reg_s {
  310. uint64_t reserved_16_63:48;
  311. uint64_t link:1;
  312. uint64_t reserved_13_14:2;
  313. uint64_t dup:1;
  314. uint64_t speed:2;
  315. uint64_t reserved_1_9:9;
  316. uint64_t one:1;
  317. } s;
  318. struct cvmx_pcsx_sgmx_lp_adv_reg_s cn52xx;
  319. struct cvmx_pcsx_sgmx_lp_adv_reg_s cn52xxp1;
  320. struct cvmx_pcsx_sgmx_lp_adv_reg_s cn56xx;
  321. struct cvmx_pcsx_sgmx_lp_adv_reg_s cn56xxp1;
  322. };
  323. union cvmx_pcsx_txx_states_reg {
  324. uint64_t u64;
  325. struct cvmx_pcsx_txx_states_reg_s {
  326. uint64_t reserved_7_63:57;
  327. uint64_t xmit:2;
  328. uint64_t tx_bad:1;
  329. uint64_t ord_st:4;
  330. } s;
  331. struct cvmx_pcsx_txx_states_reg_s cn52xx;
  332. struct cvmx_pcsx_txx_states_reg_s cn52xxp1;
  333. struct cvmx_pcsx_txx_states_reg_s cn56xx;
  334. struct cvmx_pcsx_txx_states_reg_s cn56xxp1;
  335. };
  336. union cvmx_pcsx_tx_rxx_polarity_reg {
  337. uint64_t u64;
  338. struct cvmx_pcsx_tx_rxx_polarity_reg_s {
  339. uint64_t reserved_4_63:60;
  340. uint64_t rxovrd:1;
  341. uint64_t autorxpl:1;
  342. uint64_t rxplrt:1;
  343. uint64_t txplrt:1;
  344. } s;
  345. struct cvmx_pcsx_tx_rxx_polarity_reg_s cn52xx;
  346. struct cvmx_pcsx_tx_rxx_polarity_reg_s cn52xxp1;
  347. struct cvmx_pcsx_tx_rxx_polarity_reg_s cn56xx;
  348. struct cvmx_pcsx_tx_rxx_polarity_reg_s cn56xxp1;
  349. };
  350. #endif