cvmx-stxx-defs.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. /***********************license start***************
  2. * Author: Cavium Networks
  3. *
  4. * Contact: [email protected]
  5. * This file is part of the OCTEON SDK
  6. *
  7. * Copyright (C) 2003-2018 Cavium, Inc.
  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_STXX_DEFS_H__
  28. #define __CVMX_STXX_DEFS_H__
  29. #define CVMX_STXX_ARB_CTL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000608ull) + ((block_id) & 1) * 0x8000000ull)
  30. #define CVMX_STXX_BCKPRS_CNT(block_id) (CVMX_ADD_IO_SEG(0x0001180090000688ull) + ((block_id) & 1) * 0x8000000ull)
  31. #define CVMX_STXX_COM_CTL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000600ull) + ((block_id) & 1) * 0x8000000ull)
  32. #define CVMX_STXX_DIP_CNT(block_id) (CVMX_ADD_IO_SEG(0x0001180090000690ull) + ((block_id) & 1) * 0x8000000ull)
  33. #define CVMX_STXX_IGN_CAL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000610ull) + ((block_id) & 1) * 0x8000000ull)
  34. #define CVMX_STXX_INT_MSK(block_id) (CVMX_ADD_IO_SEG(0x00011800900006A0ull) + ((block_id) & 1) * 0x8000000ull)
  35. #define CVMX_STXX_INT_REG(block_id) (CVMX_ADD_IO_SEG(0x0001180090000698ull) + ((block_id) & 1) * 0x8000000ull)
  36. #define CVMX_STXX_INT_SYNC(block_id) (CVMX_ADD_IO_SEG(0x00011800900006A8ull) + ((block_id) & 1) * 0x8000000ull)
  37. #define CVMX_STXX_MIN_BST(block_id) (CVMX_ADD_IO_SEG(0x0001180090000618ull) + ((block_id) & 1) * 0x8000000ull)
  38. #define CVMX_STXX_SPI4_CALX(offset, block_id) (CVMX_ADD_IO_SEG(0x0001180090000400ull) + (((offset) & 31) + ((block_id) & 1) * 0x1000000ull) * 8)
  39. #define CVMX_STXX_SPI4_DAT(block_id) (CVMX_ADD_IO_SEG(0x0001180090000628ull) + ((block_id) & 1) * 0x8000000ull)
  40. #define CVMX_STXX_SPI4_STAT(block_id) (CVMX_ADD_IO_SEG(0x0001180090000630ull) + ((block_id) & 1) * 0x8000000ull)
  41. #define CVMX_STXX_STAT_BYTES_HI(block_id) (CVMX_ADD_IO_SEG(0x0001180090000648ull) + ((block_id) & 1) * 0x8000000ull)
  42. #define CVMX_STXX_STAT_BYTES_LO(block_id) (CVMX_ADD_IO_SEG(0x0001180090000680ull) + ((block_id) & 1) * 0x8000000ull)
  43. #define CVMX_STXX_STAT_CTL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000638ull) + ((block_id) & 1) * 0x8000000ull)
  44. #define CVMX_STXX_STAT_PKT_XMT(block_id) (CVMX_ADD_IO_SEG(0x0001180090000640ull) + ((block_id) & 1) * 0x8000000ull)
  45. void __cvmx_interrupt_stxx_int_msk_enable(int index);
  46. union cvmx_stxx_arb_ctl {
  47. uint64_t u64;
  48. struct cvmx_stxx_arb_ctl_s {
  49. #ifdef __BIG_ENDIAN_BITFIELD
  50. uint64_t reserved_6_63:58;
  51. uint64_t mintrn:1;
  52. uint64_t reserved_4_4:1;
  53. uint64_t igntpa:1;
  54. uint64_t reserved_0_2:3;
  55. #else
  56. uint64_t reserved_0_2:3;
  57. uint64_t igntpa:1;
  58. uint64_t reserved_4_4:1;
  59. uint64_t mintrn:1;
  60. uint64_t reserved_6_63:58;
  61. #endif
  62. } s;
  63. };
  64. union cvmx_stxx_bckprs_cnt {
  65. uint64_t u64;
  66. struct cvmx_stxx_bckprs_cnt_s {
  67. #ifdef __BIG_ENDIAN_BITFIELD
  68. uint64_t reserved_32_63:32;
  69. uint64_t cnt:32;
  70. #else
  71. uint64_t cnt:32;
  72. uint64_t reserved_32_63:32;
  73. #endif
  74. } s;
  75. };
  76. union cvmx_stxx_com_ctl {
  77. uint64_t u64;
  78. struct cvmx_stxx_com_ctl_s {
  79. #ifdef __BIG_ENDIAN_BITFIELD
  80. uint64_t reserved_4_63:60;
  81. uint64_t st_en:1;
  82. uint64_t reserved_1_2:2;
  83. uint64_t inf_en:1;
  84. #else
  85. uint64_t inf_en:1;
  86. uint64_t reserved_1_2:2;
  87. uint64_t st_en:1;
  88. uint64_t reserved_4_63:60;
  89. #endif
  90. } s;
  91. };
  92. union cvmx_stxx_dip_cnt {
  93. uint64_t u64;
  94. struct cvmx_stxx_dip_cnt_s {
  95. #ifdef __BIG_ENDIAN_BITFIELD
  96. uint64_t reserved_8_63:56;
  97. uint64_t frmmax:4;
  98. uint64_t dipmax:4;
  99. #else
  100. uint64_t dipmax:4;
  101. uint64_t frmmax:4;
  102. uint64_t reserved_8_63:56;
  103. #endif
  104. } s;
  105. };
  106. union cvmx_stxx_ign_cal {
  107. uint64_t u64;
  108. struct cvmx_stxx_ign_cal_s {
  109. #ifdef __BIG_ENDIAN_BITFIELD
  110. uint64_t reserved_16_63:48;
  111. uint64_t igntpa:16;
  112. #else
  113. uint64_t igntpa:16;
  114. uint64_t reserved_16_63:48;
  115. #endif
  116. } s;
  117. };
  118. union cvmx_stxx_int_msk {
  119. uint64_t u64;
  120. struct cvmx_stxx_int_msk_s {
  121. #ifdef __BIG_ENDIAN_BITFIELD
  122. uint64_t reserved_8_63:56;
  123. uint64_t frmerr:1;
  124. uint64_t unxfrm:1;
  125. uint64_t nosync:1;
  126. uint64_t diperr:1;
  127. uint64_t datovr:1;
  128. uint64_t ovrbst:1;
  129. uint64_t calpar1:1;
  130. uint64_t calpar0:1;
  131. #else
  132. uint64_t calpar0:1;
  133. uint64_t calpar1:1;
  134. uint64_t ovrbst:1;
  135. uint64_t datovr:1;
  136. uint64_t diperr:1;
  137. uint64_t nosync:1;
  138. uint64_t unxfrm:1;
  139. uint64_t frmerr:1;
  140. uint64_t reserved_8_63:56;
  141. #endif
  142. } s;
  143. };
  144. union cvmx_stxx_int_reg {
  145. uint64_t u64;
  146. struct cvmx_stxx_int_reg_s {
  147. #ifdef __BIG_ENDIAN_BITFIELD
  148. uint64_t reserved_9_63:55;
  149. uint64_t syncerr:1;
  150. uint64_t frmerr:1;
  151. uint64_t unxfrm:1;
  152. uint64_t nosync:1;
  153. uint64_t diperr:1;
  154. uint64_t datovr:1;
  155. uint64_t ovrbst:1;
  156. uint64_t calpar1:1;
  157. uint64_t calpar0:1;
  158. #else
  159. uint64_t calpar0:1;
  160. uint64_t calpar1:1;
  161. uint64_t ovrbst:1;
  162. uint64_t datovr:1;
  163. uint64_t diperr:1;
  164. uint64_t nosync:1;
  165. uint64_t unxfrm:1;
  166. uint64_t frmerr:1;
  167. uint64_t syncerr:1;
  168. uint64_t reserved_9_63:55;
  169. #endif
  170. } s;
  171. };
  172. union cvmx_stxx_int_sync {
  173. uint64_t u64;
  174. struct cvmx_stxx_int_sync_s {
  175. #ifdef __BIG_ENDIAN_BITFIELD
  176. uint64_t reserved_8_63:56;
  177. uint64_t frmerr:1;
  178. uint64_t unxfrm:1;
  179. uint64_t nosync:1;
  180. uint64_t diperr:1;
  181. uint64_t datovr:1;
  182. uint64_t ovrbst:1;
  183. uint64_t calpar1:1;
  184. uint64_t calpar0:1;
  185. #else
  186. uint64_t calpar0:1;
  187. uint64_t calpar1:1;
  188. uint64_t ovrbst:1;
  189. uint64_t datovr:1;
  190. uint64_t diperr:1;
  191. uint64_t nosync:1;
  192. uint64_t unxfrm:1;
  193. uint64_t frmerr:1;
  194. uint64_t reserved_8_63:56;
  195. #endif
  196. } s;
  197. };
  198. union cvmx_stxx_min_bst {
  199. uint64_t u64;
  200. struct cvmx_stxx_min_bst_s {
  201. #ifdef __BIG_ENDIAN_BITFIELD
  202. uint64_t reserved_9_63:55;
  203. uint64_t minb:9;
  204. #else
  205. uint64_t minb:9;
  206. uint64_t reserved_9_63:55;
  207. #endif
  208. } s;
  209. };
  210. union cvmx_stxx_spi4_calx {
  211. uint64_t u64;
  212. struct cvmx_stxx_spi4_calx_s {
  213. #ifdef __BIG_ENDIAN_BITFIELD
  214. uint64_t reserved_17_63:47;
  215. uint64_t oddpar:1;
  216. uint64_t prt3:4;
  217. uint64_t prt2:4;
  218. uint64_t prt1:4;
  219. uint64_t prt0:4;
  220. #else
  221. uint64_t prt0:4;
  222. uint64_t prt1:4;
  223. uint64_t prt2:4;
  224. uint64_t prt3:4;
  225. uint64_t oddpar:1;
  226. uint64_t reserved_17_63:47;
  227. #endif
  228. } s;
  229. };
  230. union cvmx_stxx_spi4_dat {
  231. uint64_t u64;
  232. struct cvmx_stxx_spi4_dat_s {
  233. #ifdef __BIG_ENDIAN_BITFIELD
  234. uint64_t reserved_32_63:32;
  235. uint64_t alpha:16;
  236. uint64_t max_t:16;
  237. #else
  238. uint64_t max_t:16;
  239. uint64_t alpha:16;
  240. uint64_t reserved_32_63:32;
  241. #endif
  242. } s;
  243. };
  244. union cvmx_stxx_spi4_stat {
  245. uint64_t u64;
  246. struct cvmx_stxx_spi4_stat_s {
  247. #ifdef __BIG_ENDIAN_BITFIELD
  248. uint64_t reserved_16_63:48;
  249. uint64_t m:8;
  250. uint64_t reserved_7_7:1;
  251. uint64_t len:7;
  252. #else
  253. uint64_t len:7;
  254. uint64_t reserved_7_7:1;
  255. uint64_t m:8;
  256. uint64_t reserved_16_63:48;
  257. #endif
  258. } s;
  259. };
  260. union cvmx_stxx_stat_bytes_hi {
  261. uint64_t u64;
  262. struct cvmx_stxx_stat_bytes_hi_s {
  263. #ifdef __BIG_ENDIAN_BITFIELD
  264. uint64_t reserved_32_63:32;
  265. uint64_t cnt:32;
  266. #else
  267. uint64_t cnt:32;
  268. uint64_t reserved_32_63:32;
  269. #endif
  270. } s;
  271. };
  272. union cvmx_stxx_stat_bytes_lo {
  273. uint64_t u64;
  274. struct cvmx_stxx_stat_bytes_lo_s {
  275. #ifdef __BIG_ENDIAN_BITFIELD
  276. uint64_t reserved_32_63:32;
  277. uint64_t cnt:32;
  278. #else
  279. uint64_t cnt:32;
  280. uint64_t reserved_32_63:32;
  281. #endif
  282. } s;
  283. };
  284. union cvmx_stxx_stat_ctl {
  285. uint64_t u64;
  286. struct cvmx_stxx_stat_ctl_s {
  287. #ifdef __BIG_ENDIAN_BITFIELD
  288. uint64_t reserved_5_63:59;
  289. uint64_t clr:1;
  290. uint64_t bckprs:4;
  291. #else
  292. uint64_t bckprs:4;
  293. uint64_t clr:1;
  294. uint64_t reserved_5_63:59;
  295. #endif
  296. } s;
  297. };
  298. union cvmx_stxx_stat_pkt_xmt {
  299. uint64_t u64;
  300. struct cvmx_stxx_stat_pkt_xmt_s {
  301. #ifdef __BIG_ENDIAN_BITFIELD
  302. uint64_t reserved_32_63:32;
  303. uint64_t cnt:32;
  304. #else
  305. uint64_t cnt:32;
  306. uint64_t reserved_32_63:32;
  307. #endif
  308. } s;
  309. };
  310. #endif