cvmx-pcsx-defs.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826
  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_PCSX_DEFS_H__
  28. #define __CVMX_PCSX_DEFS_H__
  29. static inline uint64_t CVMX_PCSX_ANX_ADV_REG(unsigned long offset, unsigned long block_id)
  30. {
  31. switch (cvmx_get_octeon_family()) {
  32. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  33. return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  34. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  35. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  36. return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  37. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  38. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  39. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  40. return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  41. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  42. return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  43. }
  44. return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  45. }
  46. static inline uint64_t CVMX_PCSX_ANX_EXT_ST_REG(unsigned long offset, unsigned long block_id)
  47. {
  48. switch (cvmx_get_octeon_family()) {
  49. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  50. return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  51. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  52. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  53. return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  54. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  55. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  56. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  57. return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  58. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  59. return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  60. }
  61. return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  62. }
  63. static inline uint64_t CVMX_PCSX_ANX_LP_ABIL_REG(unsigned long offset, unsigned long block_id)
  64. {
  65. switch (cvmx_get_octeon_family()) {
  66. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  67. return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  68. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  69. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  70. return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  71. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  72. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  73. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  74. return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  75. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  76. return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  77. }
  78. return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  79. }
  80. static inline uint64_t CVMX_PCSX_ANX_RESULTS_REG(unsigned long offset, unsigned long block_id)
  81. {
  82. switch (cvmx_get_octeon_family()) {
  83. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  84. return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  85. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  86. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  87. return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  88. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  89. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  90. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  91. return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  92. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  93. return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  94. }
  95. return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  96. }
  97. static inline uint64_t CVMX_PCSX_INTX_EN_REG(unsigned long offset, unsigned long block_id)
  98. {
  99. switch (cvmx_get_octeon_family()) {
  100. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  101. return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  102. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  103. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  104. return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  105. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  106. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  107. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  108. return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  109. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  110. return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  111. }
  112. return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  113. }
  114. static inline uint64_t CVMX_PCSX_INTX_REG(unsigned long offset, unsigned long block_id)
  115. {
  116. switch (cvmx_get_octeon_family()) {
  117. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  118. return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  119. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  120. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  121. return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  122. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  123. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  124. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  125. return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  126. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  127. return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  128. }
  129. return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  130. }
  131. static inline uint64_t CVMX_PCSX_LINKX_TIMER_COUNT_REG(unsigned long offset, unsigned long block_id)
  132. {
  133. switch (cvmx_get_octeon_family()) {
  134. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  135. return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  136. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  137. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  138. return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  139. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  140. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  141. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  142. return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  143. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  144. return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  145. }
  146. return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  147. }
  148. static inline uint64_t CVMX_PCSX_LOG_ANLX_REG(unsigned long offset, unsigned long block_id)
  149. {
  150. switch (cvmx_get_octeon_family()) {
  151. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  152. return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  153. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  154. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  155. return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  156. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  157. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  158. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  159. return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  160. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  161. return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  162. }
  163. return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  164. }
  165. static inline uint64_t CVMX_PCSX_MISCX_CTL_REG(unsigned long offset, unsigned long block_id)
  166. {
  167. switch (cvmx_get_octeon_family()) {
  168. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  169. return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  170. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  171. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  172. return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  173. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  174. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  175. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  176. return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  177. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  178. return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  179. }
  180. return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  181. }
  182. static inline uint64_t CVMX_PCSX_MRX_CONTROL_REG(unsigned long offset, unsigned long block_id)
  183. {
  184. switch (cvmx_get_octeon_family()) {
  185. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  186. return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  187. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  188. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  189. return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  190. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  191. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  192. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  193. return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  194. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  195. return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  196. }
  197. return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  198. }
  199. static inline uint64_t CVMX_PCSX_MRX_STATUS_REG(unsigned long offset, unsigned long block_id)
  200. {
  201. switch (cvmx_get_octeon_family()) {
  202. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  203. return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  204. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  205. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  206. return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  207. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  208. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  209. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  210. return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  211. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  212. return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  213. }
  214. return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  215. }
  216. static inline uint64_t CVMX_PCSX_RXX_STATES_REG(unsigned long offset, unsigned long block_id)
  217. {
  218. switch (cvmx_get_octeon_family()) {
  219. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  220. return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  221. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  222. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  223. return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  224. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  225. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  226. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  227. return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  228. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  229. return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  230. }
  231. return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  232. }
  233. static inline uint64_t CVMX_PCSX_RXX_SYNC_REG(unsigned long offset, unsigned long block_id)
  234. {
  235. switch (cvmx_get_octeon_family()) {
  236. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  237. return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  238. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  239. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  240. return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  241. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  242. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  243. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  244. return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  245. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  246. return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  247. }
  248. return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  249. }
  250. static inline uint64_t CVMX_PCSX_SGMX_AN_ADV_REG(unsigned long offset, unsigned long block_id)
  251. {
  252. switch (cvmx_get_octeon_family()) {
  253. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  254. return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  255. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  256. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  257. return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  258. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  259. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  260. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  261. return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  262. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  263. return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  264. }
  265. return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  266. }
  267. static inline uint64_t CVMX_PCSX_SGMX_LP_ADV_REG(unsigned long offset, unsigned long block_id)
  268. {
  269. switch (cvmx_get_octeon_family()) {
  270. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  271. return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  272. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  273. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  274. return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  275. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  276. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  277. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  278. return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  279. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  280. return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  281. }
  282. return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  283. }
  284. static inline uint64_t CVMX_PCSX_TXX_STATES_REG(unsigned long offset, unsigned long block_id)
  285. {
  286. switch (cvmx_get_octeon_family()) {
  287. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  288. return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  289. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  290. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  291. return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  292. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  293. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  294. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  295. return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  296. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  297. return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  298. }
  299. return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  300. }
  301. static inline uint64_t CVMX_PCSX_TX_RXX_POLARITY_REG(unsigned long offset, unsigned long block_id)
  302. {
  303. switch (cvmx_get_octeon_family()) {
  304. case OCTEON_CNF71XX & OCTEON_FAMILY_MASK:
  305. return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  306. case OCTEON_CN63XX & OCTEON_FAMILY_MASK:
  307. case OCTEON_CN52XX & OCTEON_FAMILY_MASK:
  308. return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  309. case OCTEON_CN56XX & OCTEON_FAMILY_MASK:
  310. case OCTEON_CN66XX & OCTEON_FAMILY_MASK:
  311. case OCTEON_CN61XX & OCTEON_FAMILY_MASK:
  312. return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  313. case OCTEON_CN68XX & OCTEON_FAMILY_MASK:
  314. return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
  315. }
  316. return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
  317. }
  318. void __cvmx_interrupt_pcsx_intx_en_reg_enable(int index, int block);
  319. union cvmx_pcsx_anx_adv_reg {
  320. uint64_t u64;
  321. struct cvmx_pcsx_anx_adv_reg_s {
  322. #ifdef __BIG_ENDIAN_BITFIELD
  323. uint64_t reserved_16_63:48;
  324. uint64_t np:1;
  325. uint64_t reserved_14_14:1;
  326. uint64_t rem_flt:2;
  327. uint64_t reserved_9_11:3;
  328. uint64_t pause:2;
  329. uint64_t hfd:1;
  330. uint64_t fd:1;
  331. uint64_t reserved_0_4:5;
  332. #else
  333. uint64_t reserved_0_4:5;
  334. uint64_t fd:1;
  335. uint64_t hfd:1;
  336. uint64_t pause:2;
  337. uint64_t reserved_9_11:3;
  338. uint64_t rem_flt:2;
  339. uint64_t reserved_14_14:1;
  340. uint64_t np:1;
  341. uint64_t reserved_16_63:48;
  342. #endif
  343. } s;
  344. };
  345. union cvmx_pcsx_anx_ext_st_reg {
  346. uint64_t u64;
  347. struct cvmx_pcsx_anx_ext_st_reg_s {
  348. #ifdef __BIG_ENDIAN_BITFIELD
  349. uint64_t reserved_16_63:48;
  350. uint64_t thou_xfd:1;
  351. uint64_t thou_xhd:1;
  352. uint64_t thou_tfd:1;
  353. uint64_t thou_thd:1;
  354. uint64_t reserved_0_11:12;
  355. #else
  356. uint64_t reserved_0_11:12;
  357. uint64_t thou_thd:1;
  358. uint64_t thou_tfd:1;
  359. uint64_t thou_xhd:1;
  360. uint64_t thou_xfd:1;
  361. uint64_t reserved_16_63:48;
  362. #endif
  363. } s;
  364. };
  365. union cvmx_pcsx_anx_lp_abil_reg {
  366. uint64_t u64;
  367. struct cvmx_pcsx_anx_lp_abil_reg_s {
  368. #ifdef __BIG_ENDIAN_BITFIELD
  369. uint64_t reserved_16_63:48;
  370. uint64_t np:1;
  371. uint64_t ack:1;
  372. uint64_t rem_flt:2;
  373. uint64_t reserved_9_11:3;
  374. uint64_t pause:2;
  375. uint64_t hfd:1;
  376. uint64_t fd:1;
  377. uint64_t reserved_0_4:5;
  378. #else
  379. uint64_t reserved_0_4:5;
  380. uint64_t fd:1;
  381. uint64_t hfd:1;
  382. uint64_t pause:2;
  383. uint64_t reserved_9_11:3;
  384. uint64_t rem_flt:2;
  385. uint64_t ack:1;
  386. uint64_t np:1;
  387. uint64_t reserved_16_63:48;
  388. #endif
  389. } s;
  390. };
  391. union cvmx_pcsx_anx_results_reg {
  392. uint64_t u64;
  393. struct cvmx_pcsx_anx_results_reg_s {
  394. #ifdef __BIG_ENDIAN_BITFIELD
  395. uint64_t reserved_7_63:57;
  396. uint64_t pause:2;
  397. uint64_t spd:2;
  398. uint64_t an_cpt:1;
  399. uint64_t dup:1;
  400. uint64_t link_ok:1;
  401. #else
  402. uint64_t link_ok:1;
  403. uint64_t dup:1;
  404. uint64_t an_cpt:1;
  405. uint64_t spd:2;
  406. uint64_t pause:2;
  407. uint64_t reserved_7_63:57;
  408. #endif
  409. } s;
  410. };
  411. union cvmx_pcsx_intx_en_reg {
  412. uint64_t u64;
  413. struct cvmx_pcsx_intx_en_reg_s {
  414. #ifdef __BIG_ENDIAN_BITFIELD
  415. uint64_t reserved_13_63:51;
  416. uint64_t dbg_sync_en:1;
  417. uint64_t dup:1;
  418. uint64_t sync_bad_en:1;
  419. uint64_t an_bad_en:1;
  420. uint64_t rxlock_en:1;
  421. uint64_t rxbad_en:1;
  422. uint64_t rxerr_en:1;
  423. uint64_t txbad_en:1;
  424. uint64_t txfifo_en:1;
  425. uint64_t txfifu_en:1;
  426. uint64_t an_err_en:1;
  427. uint64_t xmit_en:1;
  428. uint64_t lnkspd_en:1;
  429. #else
  430. uint64_t lnkspd_en:1;
  431. uint64_t xmit_en:1;
  432. uint64_t an_err_en:1;
  433. uint64_t txfifu_en:1;
  434. uint64_t txfifo_en:1;
  435. uint64_t txbad_en:1;
  436. uint64_t rxerr_en:1;
  437. uint64_t rxbad_en:1;
  438. uint64_t rxlock_en:1;
  439. uint64_t an_bad_en:1;
  440. uint64_t sync_bad_en:1;
  441. uint64_t dup:1;
  442. uint64_t dbg_sync_en:1;
  443. uint64_t reserved_13_63:51;
  444. #endif
  445. } s;
  446. struct cvmx_pcsx_intx_en_reg_cn52xx {
  447. #ifdef __BIG_ENDIAN_BITFIELD
  448. uint64_t reserved_12_63:52;
  449. uint64_t dup:1;
  450. uint64_t sync_bad_en:1;
  451. uint64_t an_bad_en:1;
  452. uint64_t rxlock_en:1;
  453. uint64_t rxbad_en:1;
  454. uint64_t rxerr_en:1;
  455. uint64_t txbad_en:1;
  456. uint64_t txfifo_en:1;
  457. uint64_t txfifu_en:1;
  458. uint64_t an_err_en:1;
  459. uint64_t xmit_en:1;
  460. uint64_t lnkspd_en:1;
  461. #else
  462. uint64_t lnkspd_en:1;
  463. uint64_t xmit_en:1;
  464. uint64_t an_err_en:1;
  465. uint64_t txfifu_en:1;
  466. uint64_t txfifo_en:1;
  467. uint64_t txbad_en:1;
  468. uint64_t rxerr_en:1;
  469. uint64_t rxbad_en:1;
  470. uint64_t rxlock_en:1;
  471. uint64_t an_bad_en:1;
  472. uint64_t sync_bad_en:1;
  473. uint64_t dup:1;
  474. uint64_t reserved_12_63:52;
  475. #endif
  476. } cn52xx;
  477. };
  478. union cvmx_pcsx_intx_reg {
  479. uint64_t u64;
  480. struct cvmx_pcsx_intx_reg_s {
  481. #ifdef __BIG_ENDIAN_BITFIELD
  482. uint64_t reserved_13_63:51;
  483. uint64_t dbg_sync:1;
  484. uint64_t dup:1;
  485. uint64_t sync_bad:1;
  486. uint64_t an_bad:1;
  487. uint64_t rxlock:1;
  488. uint64_t rxbad:1;
  489. uint64_t rxerr:1;
  490. uint64_t txbad:1;
  491. uint64_t txfifo:1;
  492. uint64_t txfifu:1;
  493. uint64_t an_err:1;
  494. uint64_t xmit:1;
  495. uint64_t lnkspd:1;
  496. #else
  497. uint64_t lnkspd:1;
  498. uint64_t xmit:1;
  499. uint64_t an_err:1;
  500. uint64_t txfifu:1;
  501. uint64_t txfifo:1;
  502. uint64_t txbad:1;
  503. uint64_t rxerr:1;
  504. uint64_t rxbad:1;
  505. uint64_t rxlock:1;
  506. uint64_t an_bad:1;
  507. uint64_t sync_bad:1;
  508. uint64_t dup:1;
  509. uint64_t dbg_sync:1;
  510. uint64_t reserved_13_63:51;
  511. #endif
  512. } s;
  513. struct cvmx_pcsx_intx_reg_cn52xx {
  514. #ifdef __BIG_ENDIAN_BITFIELD
  515. uint64_t reserved_12_63:52;
  516. uint64_t dup:1;
  517. uint64_t sync_bad:1;
  518. uint64_t an_bad:1;
  519. uint64_t rxlock:1;
  520. uint64_t rxbad:1;
  521. uint64_t rxerr:1;
  522. uint64_t txbad:1;
  523. uint64_t txfifo:1;
  524. uint64_t txfifu:1;
  525. uint64_t an_err:1;
  526. uint64_t xmit:1;
  527. uint64_t lnkspd:1;
  528. #else
  529. uint64_t lnkspd:1;
  530. uint64_t xmit:1;
  531. uint64_t an_err:1;
  532. uint64_t txfifu:1;
  533. uint64_t txfifo:1;
  534. uint64_t txbad:1;
  535. uint64_t rxerr:1;
  536. uint64_t rxbad:1;
  537. uint64_t rxlock:1;
  538. uint64_t an_bad:1;
  539. uint64_t sync_bad:1;
  540. uint64_t dup:1;
  541. uint64_t reserved_12_63:52;
  542. #endif
  543. } cn52xx;
  544. };
  545. union cvmx_pcsx_linkx_timer_count_reg {
  546. uint64_t u64;
  547. struct cvmx_pcsx_linkx_timer_count_reg_s {
  548. #ifdef __BIG_ENDIAN_BITFIELD
  549. uint64_t reserved_16_63:48;
  550. uint64_t count:16;
  551. #else
  552. uint64_t count:16;
  553. uint64_t reserved_16_63:48;
  554. #endif
  555. } s;
  556. };
  557. union cvmx_pcsx_log_anlx_reg {
  558. uint64_t u64;
  559. struct cvmx_pcsx_log_anlx_reg_s {
  560. #ifdef __BIG_ENDIAN_BITFIELD
  561. uint64_t reserved_4_63:60;
  562. uint64_t lafifovfl:1;
  563. uint64_t la_en:1;
  564. uint64_t pkt_sz:2;
  565. #else
  566. uint64_t pkt_sz:2;
  567. uint64_t la_en:1;
  568. uint64_t lafifovfl:1;
  569. uint64_t reserved_4_63:60;
  570. #endif
  571. } s;
  572. };
  573. union cvmx_pcsx_miscx_ctl_reg {
  574. uint64_t u64;
  575. struct cvmx_pcsx_miscx_ctl_reg_s {
  576. #ifdef __BIG_ENDIAN_BITFIELD
  577. uint64_t reserved_13_63:51;
  578. uint64_t sgmii:1;
  579. uint64_t gmxeno:1;
  580. uint64_t loopbck2:1;
  581. uint64_t mac_phy:1;
  582. uint64_t mode:1;
  583. uint64_t an_ovrd:1;
  584. uint64_t samp_pt:7;
  585. #else
  586. uint64_t samp_pt:7;
  587. uint64_t an_ovrd:1;
  588. uint64_t mode:1;
  589. uint64_t mac_phy:1;
  590. uint64_t loopbck2:1;
  591. uint64_t gmxeno:1;
  592. uint64_t sgmii:1;
  593. uint64_t reserved_13_63:51;
  594. #endif
  595. } s;
  596. };
  597. union cvmx_pcsx_mrx_control_reg {
  598. uint64_t u64;
  599. struct cvmx_pcsx_mrx_control_reg_s {
  600. #ifdef __BIG_ENDIAN_BITFIELD
  601. uint64_t reserved_16_63:48;
  602. uint64_t reset:1;
  603. uint64_t loopbck1:1;
  604. uint64_t spdlsb:1;
  605. uint64_t an_en:1;
  606. uint64_t pwr_dn:1;
  607. uint64_t reserved_10_10:1;
  608. uint64_t rst_an:1;
  609. uint64_t dup:1;
  610. uint64_t coltst:1;
  611. uint64_t spdmsb:1;
  612. uint64_t uni:1;
  613. uint64_t reserved_0_4:5;
  614. #else
  615. uint64_t reserved_0_4:5;
  616. uint64_t uni:1;
  617. uint64_t spdmsb:1;
  618. uint64_t coltst:1;
  619. uint64_t dup:1;
  620. uint64_t rst_an:1;
  621. uint64_t reserved_10_10:1;
  622. uint64_t pwr_dn:1;
  623. uint64_t an_en:1;
  624. uint64_t spdlsb:1;
  625. uint64_t loopbck1:1;
  626. uint64_t reset:1;
  627. uint64_t reserved_16_63:48;
  628. #endif
  629. } s;
  630. };
  631. union cvmx_pcsx_mrx_status_reg {
  632. uint64_t u64;
  633. struct cvmx_pcsx_mrx_status_reg_s {
  634. #ifdef __BIG_ENDIAN_BITFIELD
  635. uint64_t reserved_16_63:48;
  636. uint64_t hun_t4:1;
  637. uint64_t hun_xfd:1;
  638. uint64_t hun_xhd:1;
  639. uint64_t ten_fd:1;
  640. uint64_t ten_hd:1;
  641. uint64_t hun_t2fd:1;
  642. uint64_t hun_t2hd:1;
  643. uint64_t ext_st:1;
  644. uint64_t reserved_7_7:1;
  645. uint64_t prb_sup:1;
  646. uint64_t an_cpt:1;
  647. uint64_t rm_flt:1;
  648. uint64_t an_abil:1;
  649. uint64_t lnk_st:1;
  650. uint64_t reserved_1_1:1;
  651. uint64_t extnd:1;
  652. #else
  653. uint64_t extnd:1;
  654. uint64_t reserved_1_1:1;
  655. uint64_t lnk_st:1;
  656. uint64_t an_abil:1;
  657. uint64_t rm_flt:1;
  658. uint64_t an_cpt:1;
  659. uint64_t prb_sup:1;
  660. uint64_t reserved_7_7:1;
  661. uint64_t ext_st:1;
  662. uint64_t hun_t2hd:1;
  663. uint64_t hun_t2fd:1;
  664. uint64_t ten_hd:1;
  665. uint64_t ten_fd:1;
  666. uint64_t hun_xhd:1;
  667. uint64_t hun_xfd:1;
  668. uint64_t hun_t4:1;
  669. uint64_t reserved_16_63:48;
  670. #endif
  671. } s;
  672. };
  673. union cvmx_pcsx_rxx_states_reg {
  674. uint64_t u64;
  675. struct cvmx_pcsx_rxx_states_reg_s {
  676. #ifdef __BIG_ENDIAN_BITFIELD
  677. uint64_t reserved_16_63:48;
  678. uint64_t rx_bad:1;
  679. uint64_t rx_st:5;
  680. uint64_t sync_bad:1;
  681. uint64_t sync:4;
  682. uint64_t an_bad:1;
  683. uint64_t an_st:4;
  684. #else
  685. uint64_t an_st:4;
  686. uint64_t an_bad:1;
  687. uint64_t sync:4;
  688. uint64_t sync_bad:1;
  689. uint64_t rx_st:5;
  690. uint64_t rx_bad:1;
  691. uint64_t reserved_16_63:48;
  692. #endif
  693. } s;
  694. };
  695. union cvmx_pcsx_rxx_sync_reg {
  696. uint64_t u64;
  697. struct cvmx_pcsx_rxx_sync_reg_s {
  698. #ifdef __BIG_ENDIAN_BITFIELD
  699. uint64_t reserved_2_63:62;
  700. uint64_t sync:1;
  701. uint64_t bit_lock:1;
  702. #else
  703. uint64_t bit_lock:1;
  704. uint64_t sync:1;
  705. uint64_t reserved_2_63:62;
  706. #endif
  707. } s;
  708. };
  709. union cvmx_pcsx_sgmx_an_adv_reg {
  710. uint64_t u64;
  711. struct cvmx_pcsx_sgmx_an_adv_reg_s {
  712. #ifdef __BIG_ENDIAN_BITFIELD
  713. uint64_t reserved_16_63:48;
  714. uint64_t link:1;
  715. uint64_t ack:1;
  716. uint64_t reserved_13_13:1;
  717. uint64_t dup:1;
  718. uint64_t speed:2;
  719. uint64_t reserved_1_9:9;
  720. uint64_t one:1;
  721. #else
  722. uint64_t one:1;
  723. uint64_t reserved_1_9:9;
  724. uint64_t speed:2;
  725. uint64_t dup:1;
  726. uint64_t reserved_13_13:1;
  727. uint64_t ack:1;
  728. uint64_t link:1;
  729. uint64_t reserved_16_63:48;
  730. #endif
  731. } s;
  732. };
  733. union cvmx_pcsx_sgmx_lp_adv_reg {
  734. uint64_t u64;
  735. struct cvmx_pcsx_sgmx_lp_adv_reg_s {
  736. #ifdef __BIG_ENDIAN_BITFIELD
  737. uint64_t reserved_16_63:48;
  738. uint64_t link:1;
  739. uint64_t reserved_13_14:2;
  740. uint64_t dup:1;
  741. uint64_t speed:2;
  742. uint64_t reserved_1_9:9;
  743. uint64_t one:1;
  744. #else
  745. uint64_t one:1;
  746. uint64_t reserved_1_9:9;
  747. uint64_t speed:2;
  748. uint64_t dup:1;
  749. uint64_t reserved_13_14:2;
  750. uint64_t link:1;
  751. uint64_t reserved_16_63:48;
  752. #endif
  753. } s;
  754. };
  755. union cvmx_pcsx_txx_states_reg {
  756. uint64_t u64;
  757. struct cvmx_pcsx_txx_states_reg_s {
  758. #ifdef __BIG_ENDIAN_BITFIELD
  759. uint64_t reserved_7_63:57;
  760. uint64_t xmit:2;
  761. uint64_t tx_bad:1;
  762. uint64_t ord_st:4;
  763. #else
  764. uint64_t ord_st:4;
  765. uint64_t tx_bad:1;
  766. uint64_t xmit:2;
  767. uint64_t reserved_7_63:57;
  768. #endif
  769. } s;
  770. };
  771. union cvmx_pcsx_tx_rxx_polarity_reg {
  772. uint64_t u64;
  773. struct cvmx_pcsx_tx_rxx_polarity_reg_s {
  774. #ifdef __BIG_ENDIAN_BITFIELD
  775. uint64_t reserved_4_63:60;
  776. uint64_t rxovrd:1;
  777. uint64_t autorxpl:1;
  778. uint64_t rxplrt:1;
  779. uint64_t txplrt:1;
  780. #else
  781. uint64_t txplrt:1;
  782. uint64_t rxplrt:1;
  783. uint64_t autorxpl:1;
  784. uint64_t rxovrd:1;
  785. uint64_t reserved_4_63:60;
  786. #endif
  787. } s;
  788. };
  789. #endif