chip.h 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377
  1. #ifndef _CHIP_H
  2. #define _CHIP_H
  3. /*
  4. * Copyright(c) 2015, 2016 Intel Corporation.
  5. *
  6. * This file is provided under a dual BSD/GPLv2 license. When using or
  7. * redistributing this file, you may do so under either license.
  8. *
  9. * GPL LICENSE SUMMARY
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of version 2 of the GNU General Public License as
  13. * published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * BSD LICENSE
  21. *
  22. * Redistribution and use in source and binary forms, with or without
  23. * modification, are permitted provided that the following conditions
  24. * are met:
  25. *
  26. * - Redistributions of source code must retain the above copyright
  27. * notice, this list of conditions and the following disclaimer.
  28. * - Redistributions in binary form must reproduce the above copyright
  29. * notice, this list of conditions and the following disclaimer in
  30. * the documentation and/or other materials provided with the
  31. * distribution.
  32. * - Neither the name of Intel Corporation nor the names of its
  33. * contributors may be used to endorse or promote products derived
  34. * from this software without specific prior written permission.
  35. *
  36. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  37. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  38. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  39. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  40. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  41. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  42. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  43. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  44. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  45. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  46. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  47. *
  48. */
  49. /*
  50. * This file contains all of the defines that is specific to the HFI chip
  51. */
  52. /* sizes */
  53. #define CCE_NUM_MSIX_VECTORS 256
  54. #define CCE_NUM_INT_CSRS 12
  55. #define CCE_NUM_INT_MAP_CSRS 96
  56. #define NUM_INTERRUPT_SOURCES 768
  57. #define RXE_NUM_CONTEXTS 160
  58. #define RXE_PER_CONTEXT_SIZE 0x1000 /* 4k */
  59. #define RXE_NUM_TID_FLOWS 32
  60. #define RXE_NUM_DATA_VL 8
  61. #define TXE_NUM_CONTEXTS 160
  62. #define TXE_NUM_SDMA_ENGINES 16
  63. #define NUM_CONTEXTS_PER_SET 8
  64. #define VL_ARB_HIGH_PRIO_TABLE_SIZE 16
  65. #define VL_ARB_LOW_PRIO_TABLE_SIZE 16
  66. #define VL_ARB_TABLE_SIZE 16
  67. #define TXE_NUM_32_BIT_COUNTER 7
  68. #define TXE_NUM_64_BIT_COUNTER 30
  69. #define TXE_NUM_DATA_VL 8
  70. #define TXE_PIO_SIZE (32 * 0x100000) /* 32 MB */
  71. #define PIO_BLOCK_SIZE 64 /* bytes */
  72. #define SDMA_BLOCK_SIZE 64 /* bytes */
  73. #define RCV_BUF_BLOCK_SIZE 64 /* bytes */
  74. #define PIO_CMASK 0x7ff /* counter mask for free and fill counters */
  75. #define MAX_EAGER_ENTRIES 2048 /* max receive eager entries */
  76. #define MAX_TID_PAIR_ENTRIES 1024 /* max receive expected pairs */
  77. /*
  78. * Virtual? Allocation Unit, defined as AU = 8*2^vAU, 64 bytes, AU is fixed
  79. * at 64 bytes for all generation one devices
  80. */
  81. #define CM_VAU 3
  82. /* HFI link credit count, AKA receive buffer depth (RBUF_DEPTH) */
  83. #define CM_GLOBAL_CREDITS 0x880
  84. /* Number of PKey entries in the HW */
  85. #define MAX_PKEY_VALUES 16
  86. #include "chip_registers.h"
  87. #define RXE_PER_CONTEXT_USER (RXE + RXE_PER_CONTEXT_OFFSET)
  88. #define TXE_PIO_SEND (TXE + TXE_PIO_SEND_OFFSET)
  89. /* PBC flags */
  90. #define PBC_INTR BIT_ULL(31)
  91. #define PBC_DC_INFO_SHIFT (30)
  92. #define PBC_DC_INFO BIT_ULL(PBC_DC_INFO_SHIFT)
  93. #define PBC_TEST_EBP BIT_ULL(29)
  94. #define PBC_PACKET_BYPASS BIT_ULL(28)
  95. #define PBC_CREDIT_RETURN BIT_ULL(25)
  96. #define PBC_INSERT_BYPASS_ICRC BIT_ULL(24)
  97. #define PBC_TEST_BAD_ICRC BIT_ULL(23)
  98. #define PBC_FECN BIT_ULL(22)
  99. /* PbcInsertHcrc field settings */
  100. #define PBC_IHCRC_LKDETH 0x0 /* insert @ local KDETH offset */
  101. #define PBC_IHCRC_GKDETH 0x1 /* insert @ global KDETH offset */
  102. #define PBC_IHCRC_NONE 0x2 /* no HCRC inserted */
  103. /* PBC fields */
  104. #define PBC_STATIC_RATE_CONTROL_COUNT_SHIFT 32
  105. #define PBC_STATIC_RATE_CONTROL_COUNT_MASK 0xffffull
  106. #define PBC_STATIC_RATE_CONTROL_COUNT_SMASK \
  107. (PBC_STATIC_RATE_CONTROL_COUNT_MASK << \
  108. PBC_STATIC_RATE_CONTROL_COUNT_SHIFT)
  109. #define PBC_INSERT_HCRC_SHIFT 26
  110. #define PBC_INSERT_HCRC_MASK 0x3ull
  111. #define PBC_INSERT_HCRC_SMASK \
  112. (PBC_INSERT_HCRC_MASK << PBC_INSERT_HCRC_SHIFT)
  113. #define PBC_VL_SHIFT 12
  114. #define PBC_VL_MASK 0xfull
  115. #define PBC_VL_SMASK (PBC_VL_MASK << PBC_VL_SHIFT)
  116. #define PBC_LENGTH_DWS_SHIFT 0
  117. #define PBC_LENGTH_DWS_MASK 0xfffull
  118. #define PBC_LENGTH_DWS_SMASK \
  119. (PBC_LENGTH_DWS_MASK << PBC_LENGTH_DWS_SHIFT)
  120. /* Credit Return Fields */
  121. #define CR_COUNTER_SHIFT 0
  122. #define CR_COUNTER_MASK 0x7ffull
  123. #define CR_COUNTER_SMASK (CR_COUNTER_MASK << CR_COUNTER_SHIFT)
  124. #define CR_STATUS_SHIFT 11
  125. #define CR_STATUS_MASK 0x1ull
  126. #define CR_STATUS_SMASK (CR_STATUS_MASK << CR_STATUS_SHIFT)
  127. #define CR_CREDIT_RETURN_DUE_TO_PBC_SHIFT 12
  128. #define CR_CREDIT_RETURN_DUE_TO_PBC_MASK 0x1ull
  129. #define CR_CREDIT_RETURN_DUE_TO_PBC_SMASK \
  130. (CR_CREDIT_RETURN_DUE_TO_PBC_MASK << \
  131. CR_CREDIT_RETURN_DUE_TO_PBC_SHIFT)
  132. #define CR_CREDIT_RETURN_DUE_TO_THRESHOLD_SHIFT 13
  133. #define CR_CREDIT_RETURN_DUE_TO_THRESHOLD_MASK 0x1ull
  134. #define CR_CREDIT_RETURN_DUE_TO_THRESHOLD_SMASK \
  135. (CR_CREDIT_RETURN_DUE_TO_THRESHOLD_MASK << \
  136. CR_CREDIT_RETURN_DUE_TO_THRESHOLD_SHIFT)
  137. #define CR_CREDIT_RETURN_DUE_TO_ERR_SHIFT 14
  138. #define CR_CREDIT_RETURN_DUE_TO_ERR_MASK 0x1ull
  139. #define CR_CREDIT_RETURN_DUE_TO_ERR_SMASK \
  140. (CR_CREDIT_RETURN_DUE_TO_ERR_MASK << \
  141. CR_CREDIT_RETURN_DUE_TO_ERR_SHIFT)
  142. #define CR_CREDIT_RETURN_DUE_TO_FORCE_SHIFT 15
  143. #define CR_CREDIT_RETURN_DUE_TO_FORCE_MASK 0x1ull
  144. #define CR_CREDIT_RETURN_DUE_TO_FORCE_SMASK \
  145. (CR_CREDIT_RETURN_DUE_TO_FORCE_MASK << \
  146. CR_CREDIT_RETURN_DUE_TO_FORCE_SHIFT)
  147. /* interrupt source numbers */
  148. #define IS_GENERAL_ERR_START 0
  149. #define IS_SDMAENG_ERR_START 16
  150. #define IS_SENDCTXT_ERR_START 32
  151. #define IS_SDMA_START 192 /* includes SDmaProgress,SDmaIdle */
  152. #define IS_VARIOUS_START 240
  153. #define IS_DC_START 248
  154. #define IS_RCVAVAIL_START 256
  155. #define IS_RCVURGENT_START 416
  156. #define IS_SENDCREDIT_START 576
  157. #define IS_RESERVED_START 736
  158. #define IS_MAX_SOURCES 768
  159. /* derived interrupt source values */
  160. #define IS_GENERAL_ERR_END IS_SDMAENG_ERR_START
  161. #define IS_SDMAENG_ERR_END IS_SENDCTXT_ERR_START
  162. #define IS_SENDCTXT_ERR_END IS_SDMA_START
  163. #define IS_SDMA_END IS_VARIOUS_START
  164. #define IS_VARIOUS_END IS_DC_START
  165. #define IS_DC_END IS_RCVAVAIL_START
  166. #define IS_RCVAVAIL_END IS_RCVURGENT_START
  167. #define IS_RCVURGENT_END IS_SENDCREDIT_START
  168. #define IS_SENDCREDIT_END IS_RESERVED_START
  169. #define IS_RESERVED_END IS_MAX_SOURCES
  170. /* absolute interrupt numbers for QSFP1Int and QSFP2Int */
  171. #define QSFP1_INT 242
  172. #define QSFP2_INT 243
  173. /* DCC_CFG_PORT_CONFIG logical link states */
  174. #define LSTATE_DOWN 0x1
  175. #define LSTATE_INIT 0x2
  176. #define LSTATE_ARMED 0x3
  177. #define LSTATE_ACTIVE 0x4
  178. /* DC8051_STS_CUR_STATE port values (physical link states) */
  179. #define PLS_DISABLED 0x30
  180. #define PLS_OFFLINE 0x90
  181. #define PLS_OFFLINE_QUIET 0x90
  182. #define PLS_OFFLINE_PLANNED_DOWN_INFORM 0x91
  183. #define PLS_OFFLINE_READY_TO_QUIET_LT 0x92
  184. #define PLS_OFFLINE_REPORT_FAILURE 0x93
  185. #define PLS_OFFLINE_READY_TO_QUIET_BCC 0x94
  186. #define PLS_POLLING 0x20
  187. #define PLS_POLLING_QUIET 0x20
  188. #define PLS_POLLING_ACTIVE 0x21
  189. #define PLS_CONFIGPHY 0x40
  190. #define PLS_CONFIGPHY_DEBOUCE 0x40
  191. #define PLS_CONFIGPHY_ESTCOMM 0x41
  192. #define PLS_CONFIGPHY_ESTCOMM_TXRX_HUNT 0x42
  193. #define PLS_CONFIGPHY_ESTCOMM_LOCAL_COMPLETE 0x43
  194. #define PLS_CONFIGPHY_OPTEQ 0x44
  195. #define PLS_CONFIGPHY_OPTEQ_OPTIMIZING 0x44
  196. #define PLS_CONFIGPHY_OPTEQ_LOCAL_COMPLETE 0x45
  197. #define PLS_CONFIGPHY_VERIFYCAP 0x46
  198. #define PLS_CONFIGPHY_VERIFYCAP_EXCHANGE 0x46
  199. #define PLS_CONFIGPHY_VERIFYCAP_LOCAL_COMPLETE 0x47
  200. #define PLS_CONFIGLT 0x48
  201. #define PLS_CONFIGLT_CONFIGURE 0x48
  202. #define PLS_CONFIGLT_LINK_TRANSFER_ACTIVE 0x49
  203. #define PLS_LINKUP 0x50
  204. #define PLS_PHYTEST 0xB0
  205. #define PLS_INTERNAL_SERDES_LOOPBACK 0xe1
  206. #define PLS_QUICK_LINKUP 0xe2
  207. /* DC_DC8051_CFG_HOST_CMD_0.REQ_TYPE - 8051 host commands */
  208. #define HCMD_LOAD_CONFIG_DATA 0x01
  209. #define HCMD_READ_CONFIG_DATA 0x02
  210. #define HCMD_CHANGE_PHY_STATE 0x03
  211. #define HCMD_SEND_LCB_IDLE_MSG 0x04
  212. #define HCMD_MISC 0x05
  213. #define HCMD_READ_LCB_IDLE_MSG 0x06
  214. #define HCMD_READ_LCB_CSR 0x07
  215. #define HCMD_WRITE_LCB_CSR 0x08
  216. #define HCMD_INTERFACE_TEST 0xff
  217. /* DC_DC8051_CFG_HOST_CMD_1.RETURN_CODE - 8051 host command return */
  218. #define HCMD_SUCCESS 2
  219. /* DC_DC8051_DBG_ERR_INFO_SET_BY_8051.ERROR - error flags */
  220. #define SPICO_ROM_FAILED BIT(0)
  221. #define UNKNOWN_FRAME BIT(1)
  222. #define TARGET_BER_NOT_MET BIT(2)
  223. #define FAILED_SERDES_INTERNAL_LOOPBACK BIT(3)
  224. #define FAILED_SERDES_INIT BIT(4)
  225. #define FAILED_LNI_POLLING BIT(5)
  226. #define FAILED_LNI_DEBOUNCE BIT(6)
  227. #define FAILED_LNI_ESTBCOMM BIT(7)
  228. #define FAILED_LNI_OPTEQ BIT(8)
  229. #define FAILED_LNI_VERIFY_CAP1 BIT(9)
  230. #define FAILED_LNI_VERIFY_CAP2 BIT(10)
  231. #define FAILED_LNI_CONFIGLT BIT(11)
  232. #define HOST_HANDSHAKE_TIMEOUT BIT(12)
  233. #define EXTERNAL_DEVICE_REQ_TIMEOUT BIT(13)
  234. #define FAILED_LNI (FAILED_LNI_POLLING | FAILED_LNI_DEBOUNCE \
  235. | FAILED_LNI_ESTBCOMM | FAILED_LNI_OPTEQ \
  236. | FAILED_LNI_VERIFY_CAP1 \
  237. | FAILED_LNI_VERIFY_CAP2 \
  238. | FAILED_LNI_CONFIGLT | HOST_HANDSHAKE_TIMEOUT \
  239. | EXTERNAL_DEVICE_REQ_TIMEOUT)
  240. /* DC_DC8051_DBG_ERR_INFO_SET_BY_8051.HOST_MSG - host message flags */
  241. #define HOST_REQ_DONE BIT(0)
  242. #define BC_PWR_MGM_MSG BIT(1)
  243. #define BC_SMA_MSG BIT(2)
  244. #define BC_BCC_UNKNOWN_MSG BIT(3)
  245. #define BC_IDLE_UNKNOWN_MSG BIT(4)
  246. #define EXT_DEVICE_CFG_REQ BIT(5)
  247. #define VERIFY_CAP_FRAME BIT(6)
  248. #define LINKUP_ACHIEVED BIT(7)
  249. #define LINK_GOING_DOWN BIT(8)
  250. #define LINK_WIDTH_DOWNGRADED BIT(9)
  251. /* DC_DC8051_CFG_EXT_DEV_1.REQ_TYPE - 8051 host requests */
  252. #define HREQ_LOAD_CONFIG 0x01
  253. #define HREQ_SAVE_CONFIG 0x02
  254. #define HREQ_READ_CONFIG 0x03
  255. #define HREQ_SET_TX_EQ_ABS 0x04
  256. #define HREQ_SET_TX_EQ_REL 0x05
  257. #define HREQ_ENABLE 0x06
  258. #define HREQ_CONFIG_DONE 0xfe
  259. #define HREQ_INTERFACE_TEST 0xff
  260. /* DC_DC8051_CFG_EXT_DEV_0.RETURN_CODE - 8051 host request return codes */
  261. #define HREQ_INVALID 0x01
  262. #define HREQ_SUCCESS 0x02
  263. #define HREQ_NOT_SUPPORTED 0x03
  264. #define HREQ_FEATURE_NOT_SUPPORTED 0x04 /* request specific feature */
  265. #define HREQ_REQUEST_REJECTED 0xfe
  266. #define HREQ_EXECUTION_ONGOING 0xff
  267. /* MISC host command functions */
  268. #define HCMD_MISC_REQUEST_LCB_ACCESS 0x1
  269. #define HCMD_MISC_GRANT_LCB_ACCESS 0x2
  270. /* idle flit message types */
  271. #define IDLE_PHYSICAL_LINK_MGMT 0x1
  272. #define IDLE_CRU 0x2
  273. #define IDLE_SMA 0x3
  274. #define IDLE_POWER_MGMT 0x4
  275. /* idle flit message send fields (both send and read) */
  276. #define IDLE_PAYLOAD_MASK 0xffffffffffull /* 40 bits */
  277. #define IDLE_PAYLOAD_SHIFT 8
  278. #define IDLE_MSG_TYPE_MASK 0xf
  279. #define IDLE_MSG_TYPE_SHIFT 0
  280. /* idle flit message read fields */
  281. #define READ_IDLE_MSG_TYPE_MASK 0xf
  282. #define READ_IDLE_MSG_TYPE_SHIFT 0
  283. /* SMA idle flit payload commands */
  284. #define SMA_IDLE_ARM 1
  285. #define SMA_IDLE_ACTIVE 2
  286. /* DC_DC8051_CFG_MODE.GENERAL bits */
  287. #define DISABLE_SELF_GUID_CHECK 0x2
  288. /* Bad L2 frame error code */
  289. #define BAD_L2_ERR 0x6
  290. /*
  291. * Eager buffer minimum and maximum sizes supported by the hardware.
  292. * All power-of-two sizes in between are supported as well.
  293. * MAX_EAGER_BUFFER_TOTAL is the maximum size of memory
  294. * allocatable for Eager buffer to a single context. All others
  295. * are limits for the RcvArray entries.
  296. */
  297. #define MIN_EAGER_BUFFER (4 * 1024)
  298. #define MAX_EAGER_BUFFER (256 * 1024)
  299. #define MAX_EAGER_BUFFER_TOTAL (64 * (1 << 20)) /* max per ctxt 64MB */
  300. #define MAX_EXPECTED_BUFFER (2048 * 1024)
  301. /*
  302. * Receive expected base and count and eager base and count increment -
  303. * the CSR fields hold multiples of this value.
  304. */
  305. #define RCV_SHIFT 3
  306. #define RCV_INCREMENT BIT(RCV_SHIFT)
  307. /*
  308. * Receive header queue entry increment - the CSR holds multiples of
  309. * this value.
  310. */
  311. #define HDRQ_SIZE_SHIFT 5
  312. #define HDRQ_INCREMENT BIT(HDRQ_SIZE_SHIFT)
  313. /*
  314. * Freeze handling flags
  315. */
  316. #define FREEZE_ABORT 0x01 /* do not do recovery */
  317. #define FREEZE_SELF 0x02 /* initiate the freeze */
  318. #define FREEZE_LINK_DOWN 0x04 /* link is down */
  319. /*
  320. * Chip implementation codes.
  321. */
  322. #define ICODE_RTL_SILICON 0x00
  323. #define ICODE_RTL_VCS_SIMULATION 0x01
  324. #define ICODE_FPGA_EMULATION 0x02
  325. #define ICODE_FUNCTIONAL_SIMULATOR 0x03
  326. /*
  327. * 8051 data memory size.
  328. */
  329. #define DC8051_DATA_MEM_SIZE 0x1000
  330. /*
  331. * 8051 firmware registers
  332. */
  333. #define NUM_GENERAL_FIELDS 0x17
  334. #define NUM_LANE_FIELDS 0x8
  335. /* 8051 general register Field IDs */
  336. #define LINK_OPTIMIZATION_SETTINGS 0x00
  337. #define LINK_TUNING_PARAMETERS 0x02
  338. #define DC_HOST_COMM_SETTINGS 0x03
  339. #define TX_SETTINGS 0x06
  340. #define VERIFY_CAP_LOCAL_PHY 0x07
  341. #define VERIFY_CAP_LOCAL_FABRIC 0x08
  342. #define VERIFY_CAP_LOCAL_LINK_WIDTH 0x09
  343. #define LOCAL_DEVICE_ID 0x0a
  344. #define LOCAL_LNI_INFO 0x0c
  345. #define REMOTE_LNI_INFO 0x0d
  346. #define MISC_STATUS 0x0e
  347. #define VERIFY_CAP_REMOTE_PHY 0x0f
  348. #define VERIFY_CAP_REMOTE_FABRIC 0x10
  349. #define VERIFY_CAP_REMOTE_LINK_WIDTH 0x11
  350. #define LAST_LOCAL_STATE_COMPLETE 0x12
  351. #define LAST_REMOTE_STATE_COMPLETE 0x13
  352. #define LINK_QUALITY_INFO 0x14
  353. #define REMOTE_DEVICE_ID 0x15
  354. #define LINK_DOWN_REASON 0x16
  355. /* 8051 lane specific register field IDs */
  356. #define TX_EQ_SETTINGS 0x00
  357. #define CHANNEL_LOSS_SETTINGS 0x05
  358. /* Lane ID for general configuration registers */
  359. #define GENERAL_CONFIG 4
  360. /* LINK_TUNING_PARAMETERS fields */
  361. #define TUNING_METHOD_SHIFT 24
  362. /* LINK_OPTIMIZATION_SETTINGS fields */
  363. #define ENABLE_EXT_DEV_CONFIG_SHIFT 24
  364. /* LOAD_DATA 8051 command shifts and fields */
  365. #define LOAD_DATA_FIELD_ID_SHIFT 40
  366. #define LOAD_DATA_FIELD_ID_MASK 0xfull
  367. #define LOAD_DATA_LANE_ID_SHIFT 32
  368. #define LOAD_DATA_LANE_ID_MASK 0xfull
  369. #define LOAD_DATA_DATA_SHIFT 0x0
  370. #define LOAD_DATA_DATA_MASK 0xffffffffull
  371. /* READ_DATA 8051 command shifts and fields */
  372. #define READ_DATA_FIELD_ID_SHIFT 40
  373. #define READ_DATA_FIELD_ID_MASK 0xffull
  374. #define READ_DATA_LANE_ID_SHIFT 32
  375. #define READ_DATA_LANE_ID_MASK 0xffull
  376. #define READ_DATA_DATA_SHIFT 0x0
  377. #define READ_DATA_DATA_MASK 0xffffffffull
  378. /* TX settings fields */
  379. #define ENABLE_LANE_TX_SHIFT 0
  380. #define ENABLE_LANE_TX_MASK 0xff
  381. #define TX_POLARITY_INVERSION_SHIFT 8
  382. #define TX_POLARITY_INVERSION_MASK 0xff
  383. #define RX_POLARITY_INVERSION_SHIFT 16
  384. #define RX_POLARITY_INVERSION_MASK 0xff
  385. #define MAX_RATE_SHIFT 24
  386. #define MAX_RATE_MASK 0xff
  387. /* verify capability PHY fields */
  388. #define CONTINIOUS_REMOTE_UPDATE_SUPPORT_SHIFT 0x4
  389. #define CONTINIOUS_REMOTE_UPDATE_SUPPORT_MASK 0x1
  390. #define POWER_MANAGEMENT_SHIFT 0x0
  391. #define POWER_MANAGEMENT_MASK 0xf
  392. /* 8051 lane register Field IDs */
  393. #define SPICO_FW_VERSION 0x7 /* SPICO firmware version */
  394. /* SPICO firmware version fields */
  395. #define SPICO_ROM_VERSION_SHIFT 0
  396. #define SPICO_ROM_VERSION_MASK 0xffff
  397. #define SPICO_ROM_PROD_ID_SHIFT 16
  398. #define SPICO_ROM_PROD_ID_MASK 0xffff
  399. /* verify capability fabric fields */
  400. #define VAU_SHIFT 0
  401. #define VAU_MASK 0x0007
  402. #define Z_SHIFT 3
  403. #define Z_MASK 0x0001
  404. #define VCU_SHIFT 4
  405. #define VCU_MASK 0x0007
  406. #define VL15BUF_SHIFT 8
  407. #define VL15BUF_MASK 0x0fff
  408. #define CRC_SIZES_SHIFT 20
  409. #define CRC_SIZES_MASK 0x7
  410. /* verify capability local link width fields */
  411. #define LINK_WIDTH_SHIFT 0 /* also for remote link width */
  412. #define LINK_WIDTH_MASK 0xffff /* also for remote link width */
  413. #define LOCAL_FLAG_BITS_SHIFT 16
  414. #define LOCAL_FLAG_BITS_MASK 0xff
  415. #define MISC_CONFIG_BITS_SHIFT 24
  416. #define MISC_CONFIG_BITS_MASK 0xff
  417. /* verify capability remote link width fields */
  418. #define REMOTE_TX_RATE_SHIFT 16
  419. #define REMOTE_TX_RATE_MASK 0xff
  420. /* LOCAL_DEVICE_ID fields */
  421. #define LOCAL_DEVICE_REV_SHIFT 0
  422. #define LOCAL_DEVICE_REV_MASK 0xff
  423. #define LOCAL_DEVICE_ID_SHIFT 8
  424. #define LOCAL_DEVICE_ID_MASK 0xffff
  425. /* REMOTE_DEVICE_ID fields */
  426. #define REMOTE_DEVICE_REV_SHIFT 0
  427. #define REMOTE_DEVICE_REV_MASK 0xff
  428. #define REMOTE_DEVICE_ID_SHIFT 8
  429. #define REMOTE_DEVICE_ID_MASK 0xffff
  430. /* local LNI link width fields */
  431. #define ENABLE_LANE_RX_SHIFT 16
  432. #define ENABLE_LANE_RX_MASK 0xff
  433. /* mask, shift for reading 'mgmt_enabled' value from REMOTE_LNI_INFO field */
  434. #define MGMT_ALLOWED_SHIFT 23
  435. #define MGMT_ALLOWED_MASK 0x1
  436. /* mask, shift for 'link_quality' within LINK_QUALITY_INFO field */
  437. #define LINK_QUALITY_SHIFT 24
  438. #define LINK_QUALITY_MASK 0x7
  439. /*
  440. * mask, shift for reading 'planned_down_remote_reason_code'
  441. * from LINK_QUALITY_INFO field
  442. */
  443. #define DOWN_REMOTE_REASON_SHIFT 16
  444. #define DOWN_REMOTE_REASON_MASK 0xff
  445. /* verify capability PHY power management bits */
  446. #define PWRM_BER_CONTROL 0x1
  447. #define PWRM_BANDWIDTH_CONTROL 0x2
  448. /* 8051 link down reasons */
  449. #define LDR_LINK_TRANSFER_ACTIVE_LOW 0xa
  450. #define LDR_RECEIVED_LINKDOWN_IDLE_MSG 0xb
  451. #define LDR_RECEIVED_HOST_OFFLINE_REQ 0xc
  452. /* verify capability fabric CRC size bits */
  453. enum {
  454. CAP_CRC_14B = (1 << 0), /* 14b CRC */
  455. CAP_CRC_48B = (1 << 1), /* 48b CRC */
  456. CAP_CRC_12B_16B_PER_LANE = (1 << 2) /* 12b-16b per lane CRC */
  457. };
  458. #define SUPPORTED_CRCS (CAP_CRC_14B | CAP_CRC_48B)
  459. /* misc status version fields */
  460. #define STS_FM_VERSION_A_SHIFT 16
  461. #define STS_FM_VERSION_A_MASK 0xff
  462. #define STS_FM_VERSION_B_SHIFT 24
  463. #define STS_FM_VERSION_B_MASK 0xff
  464. /* LCB_CFG_CRC_MODE TX_VAL and RX_VAL CRC mode values */
  465. #define LCB_CRC_16B 0x0 /* 16b CRC */
  466. #define LCB_CRC_14B 0x1 /* 14b CRC */
  467. #define LCB_CRC_48B 0x2 /* 48b CRC */
  468. #define LCB_CRC_12B_16B_PER_LANE 0x3 /* 12b-16b per lane CRC */
  469. /*
  470. * the following enum is (almost) a copy/paste of the definition
  471. * in the OPA spec, section 20.2.2.6.8 (PortInfo)
  472. */
  473. enum {
  474. PORT_LTP_CRC_MODE_NONE = 0,
  475. PORT_LTP_CRC_MODE_14 = 1, /* 14-bit LTP CRC mode (optional) */
  476. PORT_LTP_CRC_MODE_16 = 2, /* 16-bit LTP CRC mode */
  477. PORT_LTP_CRC_MODE_48 = 4,
  478. /* 48-bit overlapping LTP CRC mode (optional) */
  479. PORT_LTP_CRC_MODE_PER_LANE = 8
  480. /* 12 to 16 bit per lane LTP CRC mode (optional) */
  481. };
  482. /* timeouts */
  483. #define LINK_RESTART_DELAY 1000 /* link restart delay, in ms */
  484. #define TIMEOUT_8051_START 5000 /* 8051 start timeout, in ms */
  485. #define DC8051_COMMAND_TIMEOUT 20000 /* DC8051 command timeout, in ms */
  486. #define FREEZE_STATUS_TIMEOUT 20 /* wait for freeze indicators, in ms */
  487. #define VL_STATUS_CLEAR_TIMEOUT 5000 /* per-VL status clear, in ms */
  488. #define CCE_STATUS_TIMEOUT 10 /* time to clear CCE Status, in ms */
  489. /* cclock tick time, in picoseconds per tick: 1/speed * 10^12 */
  490. #define ASIC_CCLOCK_PS 1242 /* 805 MHz */
  491. #define FPGA_CCLOCK_PS 30300 /* 33 MHz */
  492. /*
  493. * Mask of enabled MISC errors. Do not enable the two RSA engine errors -
  494. * see firmware.c:run_rsa() for details.
  495. */
  496. #define DRIVER_MISC_MASK \
  497. (~(MISC_ERR_STATUS_MISC_FW_AUTH_FAILED_ERR_SMASK \
  498. | MISC_ERR_STATUS_MISC_KEY_MISMATCH_ERR_SMASK))
  499. /* valid values for the loopback module parameter */
  500. #define LOOPBACK_NONE 0 /* no loopback - default */
  501. #define LOOPBACK_SERDES 1
  502. #define LOOPBACK_LCB 2
  503. #define LOOPBACK_CABLE 3 /* external cable */
  504. /* read and write hardware registers */
  505. u64 read_csr(const struct hfi1_devdata *dd, u32 offset);
  506. void write_csr(const struct hfi1_devdata *dd, u32 offset, u64 value);
  507. /*
  508. * The *_kctxt_* flavor of the CSR read/write functions are for
  509. * per-context or per-SDMA CSRs that are not mappable to user-space.
  510. * Their spacing is not a PAGE_SIZE multiple.
  511. */
  512. static inline u64 read_kctxt_csr(const struct hfi1_devdata *dd, int ctxt,
  513. u32 offset0)
  514. {
  515. /* kernel per-context CSRs are separated by 0x100 */
  516. return read_csr(dd, offset0 + (0x100 * ctxt));
  517. }
  518. static inline void write_kctxt_csr(struct hfi1_devdata *dd, int ctxt,
  519. u32 offset0, u64 value)
  520. {
  521. /* kernel per-context CSRs are separated by 0x100 */
  522. write_csr(dd, offset0 + (0x100 * ctxt), value);
  523. }
  524. int read_lcb_csr(struct hfi1_devdata *dd, u32 offset, u64 *data);
  525. int write_lcb_csr(struct hfi1_devdata *dd, u32 offset, u64 data);
  526. void __iomem *get_csr_addr(
  527. struct hfi1_devdata *dd,
  528. u32 offset);
  529. static inline void __iomem *get_kctxt_csr_addr(
  530. struct hfi1_devdata *dd,
  531. int ctxt,
  532. u32 offset0)
  533. {
  534. return get_csr_addr(dd, offset0 + (0x100 * ctxt));
  535. }
  536. /*
  537. * The *_uctxt_* flavor of the CSR read/write functions are for
  538. * per-context CSRs that are mappable to user space. All these CSRs
  539. * are spaced by a PAGE_SIZE multiple in order to be mappable to
  540. * different processes without exposing other contexts' CSRs
  541. */
  542. static inline u64 read_uctxt_csr(const struct hfi1_devdata *dd, int ctxt,
  543. u32 offset0)
  544. {
  545. /* user per-context CSRs are separated by 0x1000 */
  546. return read_csr(dd, offset0 + (0x1000 * ctxt));
  547. }
  548. static inline void write_uctxt_csr(struct hfi1_devdata *dd, int ctxt,
  549. u32 offset0, u64 value)
  550. {
  551. /* user per-context CSRs are separated by 0x1000 */
  552. write_csr(dd, offset0 + (0x1000 * ctxt), value);
  553. }
  554. u64 create_pbc(struct hfi1_pportdata *ppd, u64, int, u32, u32);
  555. /* firmware.c */
  556. #define SBUS_MASTER_BROADCAST 0xfd
  557. #define NUM_PCIE_SERDES 16 /* number of PCIe serdes on the SBus */
  558. extern const u8 pcie_serdes_broadcast[];
  559. extern const u8 pcie_pcs_addrs[2][NUM_PCIE_SERDES];
  560. extern uint platform_config_load;
  561. /* SBus commands */
  562. #define RESET_SBUS_RECEIVER 0x20
  563. #define WRITE_SBUS_RECEIVER 0x21
  564. #define READ_SBUS_RECEIVER 0x22
  565. void sbus_request(struct hfi1_devdata *dd,
  566. u8 receiver_addr, u8 data_addr, u8 command, u32 data_in);
  567. int sbus_request_slow(struct hfi1_devdata *dd,
  568. u8 receiver_addr, u8 data_addr, u8 command, u32 data_in);
  569. void set_sbus_fast_mode(struct hfi1_devdata *dd);
  570. void clear_sbus_fast_mode(struct hfi1_devdata *dd);
  571. int hfi1_firmware_init(struct hfi1_devdata *dd);
  572. int load_pcie_firmware(struct hfi1_devdata *dd);
  573. int load_firmware(struct hfi1_devdata *dd);
  574. void dispose_firmware(void);
  575. int acquire_hw_mutex(struct hfi1_devdata *dd);
  576. void release_hw_mutex(struct hfi1_devdata *dd);
  577. /*
  578. * Bitmask of dynamic access for ASIC block chip resources. Each HFI has its
  579. * own range of bits for the resource so it can clear its own bits on
  580. * starting and exiting. If either HFI has the resource bit set, the
  581. * resource is in use. The separate bit ranges are:
  582. * HFI0 bits 7:0
  583. * HFI1 bits 15:8
  584. */
  585. #define CR_SBUS 0x01 /* SBUS, THERM, and PCIE registers */
  586. #define CR_EPROM 0x02 /* EEP, GPIO registers */
  587. #define CR_I2C1 0x04 /* QSFP1_OE register */
  588. #define CR_I2C2 0x08 /* QSFP2_OE register */
  589. #define CR_DYN_SHIFT 8 /* dynamic flag shift */
  590. #define CR_DYN_MASK ((1ull << CR_DYN_SHIFT) - 1)
  591. /*
  592. * Bitmask of static ASIC states these are outside of the dynamic ASIC
  593. * block chip resources above. These are to be set once and never cleared.
  594. * Must be holding the SBus dynamic flag when setting.
  595. */
  596. #define CR_THERM_INIT 0x010000
  597. int acquire_chip_resource(struct hfi1_devdata *dd, u32 resource, u32 mswait);
  598. void release_chip_resource(struct hfi1_devdata *dd, u32 resource);
  599. bool check_chip_resource(struct hfi1_devdata *dd, u32 resource,
  600. const char *func);
  601. void init_chip_resources(struct hfi1_devdata *dd);
  602. void finish_chip_resources(struct hfi1_devdata *dd);
  603. /* ms wait time for access to an SBus resoure */
  604. #define SBUS_TIMEOUT 4000 /* long enough for a FW download and SBR */
  605. /* ms wait time for a qsfp (i2c) chain to become available */
  606. #define QSFP_WAIT 20000 /* long enough for FW update to the F4 uc */
  607. void fabric_serdes_reset(struct hfi1_devdata *dd);
  608. int read_8051_data(struct hfi1_devdata *dd, u32 addr, u32 len, u64 *result);
  609. /* chip.c */
  610. void read_misc_status(struct hfi1_devdata *dd, u8 *ver_a, u8 *ver_b);
  611. void read_guid(struct hfi1_devdata *dd);
  612. int wait_fm_ready(struct hfi1_devdata *dd, u32 mstimeout);
  613. void set_link_down_reason(struct hfi1_pportdata *ppd, u8 lcl_reason,
  614. u8 neigh_reason, u8 rem_reason);
  615. int set_link_state(struct hfi1_pportdata *, u32 state);
  616. int port_ltp_to_cap(int port_ltp);
  617. void handle_verify_cap(struct work_struct *work);
  618. void handle_freeze(struct work_struct *work);
  619. void handle_link_up(struct work_struct *work);
  620. void handle_link_down(struct work_struct *work);
  621. void handle_link_downgrade(struct work_struct *work);
  622. void handle_link_bounce(struct work_struct *work);
  623. void handle_start_link(struct work_struct *work);
  624. void handle_sma_message(struct work_struct *work);
  625. void reset_qsfp(struct hfi1_pportdata *ppd);
  626. void qsfp_event(struct work_struct *work);
  627. void start_freeze_handling(struct hfi1_pportdata *ppd, int flags);
  628. int send_idle_sma(struct hfi1_devdata *dd, u64 message);
  629. int load_8051_config(struct hfi1_devdata *, u8, u8, u32);
  630. int read_8051_config(struct hfi1_devdata *, u8, u8, u32 *);
  631. int start_link(struct hfi1_pportdata *ppd);
  632. int bringup_serdes(struct hfi1_pportdata *ppd);
  633. void set_intr_state(struct hfi1_devdata *dd, u32 enable);
  634. void apply_link_downgrade_policy(struct hfi1_pportdata *ppd,
  635. int refresh_widths);
  636. void update_usrhead(struct hfi1_ctxtdata *, u32, u32, u32, u32, u32);
  637. int stop_drain_data_vls(struct hfi1_devdata *dd);
  638. int open_fill_data_vls(struct hfi1_devdata *dd);
  639. u32 ns_to_cclock(struct hfi1_devdata *dd, u32 ns);
  640. u32 cclock_to_ns(struct hfi1_devdata *dd, u32 cclock);
  641. void get_linkup_link_widths(struct hfi1_pportdata *ppd);
  642. void read_ltp_rtt(struct hfi1_devdata *dd);
  643. void clear_linkup_counters(struct hfi1_devdata *dd);
  644. u32 hdrqempty(struct hfi1_ctxtdata *rcd);
  645. int is_ax(struct hfi1_devdata *dd);
  646. int is_bx(struct hfi1_devdata *dd);
  647. u32 read_physical_state(struct hfi1_devdata *dd);
  648. u32 chip_to_opa_pstate(struct hfi1_devdata *dd, u32 chip_pstate);
  649. u32 get_logical_state(struct hfi1_pportdata *ppd);
  650. const char *opa_lstate_name(u32 lstate);
  651. const char *opa_pstate_name(u32 pstate);
  652. u32 driver_physical_state(struct hfi1_pportdata *ppd);
  653. u32 driver_logical_state(struct hfi1_pportdata *ppd);
  654. int acquire_lcb_access(struct hfi1_devdata *dd, int sleep_ok);
  655. int release_lcb_access(struct hfi1_devdata *dd, int sleep_ok);
  656. #define LCB_START DC_LCB_CSRS
  657. #define LCB_END DC_8051_CSRS /* next block is 8051 */
  658. static inline int is_lcb_offset(u32 offset)
  659. {
  660. return (offset >= LCB_START && offset < LCB_END);
  661. }
  662. extern uint num_vls;
  663. extern uint disable_integrity;
  664. u64 read_dev_cntr(struct hfi1_devdata *dd, int index, int vl);
  665. u64 write_dev_cntr(struct hfi1_devdata *dd, int index, int vl, u64 data);
  666. u64 read_port_cntr(struct hfi1_pportdata *ppd, int index, int vl);
  667. u64 write_port_cntr(struct hfi1_pportdata *ppd, int index, int vl, u64 data);
  668. u32 read_logical_state(struct hfi1_devdata *dd);
  669. void force_recv_intr(struct hfi1_ctxtdata *rcd);
  670. /* Per VL indexes */
  671. enum {
  672. C_VL_0 = 0,
  673. C_VL_1,
  674. C_VL_2,
  675. C_VL_3,
  676. C_VL_4,
  677. C_VL_5,
  678. C_VL_6,
  679. C_VL_7,
  680. C_VL_15,
  681. C_VL_COUNT
  682. };
  683. static inline int vl_from_idx(int idx)
  684. {
  685. return (idx == C_VL_15 ? 15 : idx);
  686. }
  687. static inline int idx_from_vl(int vl)
  688. {
  689. return (vl == 15 ? C_VL_15 : vl);
  690. }
  691. /* Per device counter indexes */
  692. enum {
  693. C_RCV_OVF = 0,
  694. C_RX_TID_FULL,
  695. C_RX_TID_INVALID,
  696. C_RX_TID_FLGMS,
  697. C_RX_CTX_EGRS,
  698. C_RCV_TID_FLSMS,
  699. C_CCE_PCI_CR_ST,
  700. C_CCE_PCI_TR_ST,
  701. C_CCE_PIO_WR_ST,
  702. C_CCE_ERR_INT,
  703. C_CCE_SDMA_INT,
  704. C_CCE_MISC_INT,
  705. C_CCE_RCV_AV_INT,
  706. C_CCE_RCV_URG_INT,
  707. C_CCE_SEND_CR_INT,
  708. C_DC_UNC_ERR,
  709. C_DC_RCV_ERR,
  710. C_DC_FM_CFG_ERR,
  711. C_DC_RMT_PHY_ERR,
  712. C_DC_DROPPED_PKT,
  713. C_DC_MC_XMIT_PKTS,
  714. C_DC_MC_RCV_PKTS,
  715. C_DC_XMIT_CERR,
  716. C_DC_RCV_CERR,
  717. C_DC_RCV_FCC,
  718. C_DC_XMIT_FCC,
  719. C_DC_XMIT_FLITS,
  720. C_DC_RCV_FLITS,
  721. C_DC_XMIT_PKTS,
  722. C_DC_RCV_PKTS,
  723. C_DC_RX_FLIT_VL,
  724. C_DC_RX_PKT_VL,
  725. C_DC_RCV_FCN,
  726. C_DC_RCV_FCN_VL,
  727. C_DC_RCV_BCN,
  728. C_DC_RCV_BCN_VL,
  729. C_DC_RCV_BBL,
  730. C_DC_RCV_BBL_VL,
  731. C_DC_MARK_FECN,
  732. C_DC_MARK_FECN_VL,
  733. C_DC_TOTAL_CRC,
  734. C_DC_CRC_LN0,
  735. C_DC_CRC_LN1,
  736. C_DC_CRC_LN2,
  737. C_DC_CRC_LN3,
  738. C_DC_CRC_MULT_LN,
  739. C_DC_TX_REPLAY,
  740. C_DC_RX_REPLAY,
  741. C_DC_SEQ_CRC_CNT,
  742. C_DC_ESC0_ONLY_CNT,
  743. C_DC_ESC0_PLUS1_CNT,
  744. C_DC_ESC0_PLUS2_CNT,
  745. C_DC_REINIT_FROM_PEER_CNT,
  746. C_DC_SBE_CNT,
  747. C_DC_MISC_FLG_CNT,
  748. C_DC_PRF_GOOD_LTP_CNT,
  749. C_DC_PRF_ACCEPTED_LTP_CNT,
  750. C_DC_PRF_RX_FLIT_CNT,
  751. C_DC_PRF_TX_FLIT_CNT,
  752. C_DC_PRF_CLK_CNTR,
  753. C_DC_PG_DBG_FLIT_CRDTS_CNT,
  754. C_DC_PG_STS_PAUSE_COMPLETE_CNT,
  755. C_DC_PG_STS_TX_SBE_CNT,
  756. C_DC_PG_STS_TX_MBE_CNT,
  757. C_SW_CPU_INTR,
  758. C_SW_CPU_RCV_LIM,
  759. C_SW_VTX_WAIT,
  760. C_SW_PIO_WAIT,
  761. C_SW_PIO_DRAIN,
  762. C_SW_KMEM_WAIT,
  763. C_SW_SEND_SCHED,
  764. C_SDMA_DESC_FETCHED_CNT,
  765. C_SDMA_INT_CNT,
  766. C_SDMA_ERR_CNT,
  767. C_SDMA_IDLE_INT_CNT,
  768. C_SDMA_PROGRESS_INT_CNT,
  769. /* MISC_ERR_STATUS */
  770. C_MISC_PLL_LOCK_FAIL_ERR,
  771. C_MISC_MBIST_FAIL_ERR,
  772. C_MISC_INVALID_EEP_CMD_ERR,
  773. C_MISC_EFUSE_DONE_PARITY_ERR,
  774. C_MISC_EFUSE_WRITE_ERR,
  775. C_MISC_EFUSE_READ_BAD_ADDR_ERR,
  776. C_MISC_EFUSE_CSR_PARITY_ERR,
  777. C_MISC_FW_AUTH_FAILED_ERR,
  778. C_MISC_KEY_MISMATCH_ERR,
  779. C_MISC_SBUS_WRITE_FAILED_ERR,
  780. C_MISC_CSR_WRITE_BAD_ADDR_ERR,
  781. C_MISC_CSR_READ_BAD_ADDR_ERR,
  782. C_MISC_CSR_PARITY_ERR,
  783. /* CceErrStatus */
  784. /*
  785. * A special counter that is the aggregate count
  786. * of all the cce_err_status errors. The remainder
  787. * are actual bits in the CceErrStatus register.
  788. */
  789. C_CCE_ERR_STATUS_AGGREGATED_CNT,
  790. C_CCE_MSIX_CSR_PARITY_ERR,
  791. C_CCE_INT_MAP_UNC_ERR,
  792. C_CCE_INT_MAP_COR_ERR,
  793. C_CCE_MSIX_TABLE_UNC_ERR,
  794. C_CCE_MSIX_TABLE_COR_ERR,
  795. C_CCE_RXDMA_CONV_FIFO_PARITY_ERR,
  796. C_CCE_RCPL_ASYNC_FIFO_PARITY_ERR,
  797. C_CCE_SEG_WRITE_BAD_ADDR_ERR,
  798. C_CCE_SEG_READ_BAD_ADDR_ERR,
  799. C_LA_TRIGGERED,
  800. C_CCE_TRGT_CPL_TIMEOUT_ERR,
  801. C_PCIC_RECEIVE_PARITY_ERR,
  802. C_PCIC_TRANSMIT_BACK_PARITY_ERR,
  803. C_PCIC_TRANSMIT_FRONT_PARITY_ERR,
  804. C_PCIC_CPL_DAT_Q_UNC_ERR,
  805. C_PCIC_CPL_HD_Q_UNC_ERR,
  806. C_PCIC_POST_DAT_Q_UNC_ERR,
  807. C_PCIC_POST_HD_Q_UNC_ERR,
  808. C_PCIC_RETRY_SOT_MEM_UNC_ERR,
  809. C_PCIC_RETRY_MEM_UNC_ERR,
  810. C_PCIC_N_POST_DAT_Q_PARITY_ERR,
  811. C_PCIC_N_POST_H_Q_PARITY_ERR,
  812. C_PCIC_CPL_DAT_Q_COR_ERR,
  813. C_PCIC_CPL_HD_Q_COR_ERR,
  814. C_PCIC_POST_DAT_Q_COR_ERR,
  815. C_PCIC_POST_HD_Q_COR_ERR,
  816. C_PCIC_RETRY_SOT_MEM_COR_ERR,
  817. C_PCIC_RETRY_MEM_COR_ERR,
  818. C_CCE_CLI1_ASYNC_FIFO_DBG_PARITY_ERR,
  819. C_CCE_CLI1_ASYNC_FIFO_RXDMA_PARITY_ERR,
  820. C_CCE_CLI1_ASYNC_FIFO_SDMA_HD_PARITY_ERR,
  821. C_CCE_CLI1_ASYNC_FIFO_PIO_CRDT_PARITY_ERR,
  822. C_CCE_CLI2_ASYNC_FIFO_PARITY_ERR,
  823. C_CCE_CSR_CFG_BUS_PARITY_ERR,
  824. C_CCE_CLI0_ASYNC_FIFO_PARTIY_ERR,
  825. C_CCE_RSPD_DATA_PARITY_ERR,
  826. C_CCE_TRGT_ACCESS_ERR,
  827. C_CCE_TRGT_ASYNC_FIFO_PARITY_ERR,
  828. C_CCE_CSR_WRITE_BAD_ADDR_ERR,
  829. C_CCE_CSR_READ_BAD_ADDR_ERR,
  830. C_CCE_CSR_PARITY_ERR,
  831. /* RcvErrStatus */
  832. C_RX_CSR_PARITY_ERR,
  833. C_RX_CSR_WRITE_BAD_ADDR_ERR,
  834. C_RX_CSR_READ_BAD_ADDR_ERR,
  835. C_RX_DMA_CSR_UNC_ERR,
  836. C_RX_DMA_DQ_FSM_ENCODING_ERR,
  837. C_RX_DMA_EQ_FSM_ENCODING_ERR,
  838. C_RX_DMA_CSR_PARITY_ERR,
  839. C_RX_RBUF_DATA_COR_ERR,
  840. C_RX_RBUF_DATA_UNC_ERR,
  841. C_RX_DMA_DATA_FIFO_RD_COR_ERR,
  842. C_RX_DMA_DATA_FIFO_RD_UNC_ERR,
  843. C_RX_DMA_HDR_FIFO_RD_COR_ERR,
  844. C_RX_DMA_HDR_FIFO_RD_UNC_ERR,
  845. C_RX_RBUF_DESC_PART2_COR_ERR,
  846. C_RX_RBUF_DESC_PART2_UNC_ERR,
  847. C_RX_RBUF_DESC_PART1_COR_ERR,
  848. C_RX_RBUF_DESC_PART1_UNC_ERR,
  849. C_RX_HQ_INTR_FSM_ERR,
  850. C_RX_HQ_INTR_CSR_PARITY_ERR,
  851. C_RX_LOOKUP_CSR_PARITY_ERR,
  852. C_RX_LOOKUP_RCV_ARRAY_COR_ERR,
  853. C_RX_LOOKUP_RCV_ARRAY_UNC_ERR,
  854. C_RX_LOOKUP_DES_PART2_PARITY_ERR,
  855. C_RX_LOOKUP_DES_PART1_UNC_COR_ERR,
  856. C_RX_LOOKUP_DES_PART1_UNC_ERR,
  857. C_RX_RBUF_NEXT_FREE_BUF_COR_ERR,
  858. C_RX_RBUF_NEXT_FREE_BUF_UNC_ERR,
  859. C_RX_RBUF_FL_INIT_WR_ADDR_PARITY_ERR,
  860. C_RX_RBUF_FL_INITDONE_PARITY_ERR,
  861. C_RX_RBUF_FL_WRITE_ADDR_PARITY_ERR,
  862. C_RX_RBUF_FL_RD_ADDR_PARITY_ERR,
  863. C_RX_RBUF_EMPTY_ERR,
  864. C_RX_RBUF_FULL_ERR,
  865. C_RX_RBUF_BAD_LOOKUP_ERR,
  866. C_RX_RBUF_CTX_ID_PARITY_ERR,
  867. C_RX_RBUF_CSR_QEOPDW_PARITY_ERR,
  868. C_RX_RBUF_CSR_Q_NUM_OF_PKT_PARITY_ERR,
  869. C_RX_RBUF_CSR_Q_T1_PTR_PARITY_ERR,
  870. C_RX_RBUF_CSR_Q_HD_PTR_PARITY_ERR,
  871. C_RX_RBUF_CSR_Q_VLD_BIT_PARITY_ERR,
  872. C_RX_RBUF_CSR_Q_NEXT_BUF_PARITY_ERR,
  873. C_RX_RBUF_CSR_Q_ENT_CNT_PARITY_ERR,
  874. C_RX_RBUF_CSR_Q_HEAD_BUF_NUM_PARITY_ERR,
  875. C_RX_RBUF_BLOCK_LIST_READ_COR_ERR,
  876. C_RX_RBUF_BLOCK_LIST_READ_UNC_ERR,
  877. C_RX_RBUF_LOOKUP_DES_COR_ERR,
  878. C_RX_RBUF_LOOKUP_DES_UNC_ERR,
  879. C_RX_RBUF_LOOKUP_DES_REG_UNC_COR_ERR,
  880. C_RX_RBUF_LOOKUP_DES_REG_UNC_ERR,
  881. C_RX_RBUF_FREE_LIST_COR_ERR,
  882. C_RX_RBUF_FREE_LIST_UNC_ERR,
  883. C_RX_RCV_FSM_ENCODING_ERR,
  884. C_RX_DMA_FLAG_COR_ERR,
  885. C_RX_DMA_FLAG_UNC_ERR,
  886. C_RX_DC_SOP_EOP_PARITY_ERR,
  887. C_RX_RCV_CSR_PARITY_ERR,
  888. C_RX_RCV_QP_MAP_TABLE_COR_ERR,
  889. C_RX_RCV_QP_MAP_TABLE_UNC_ERR,
  890. C_RX_RCV_DATA_COR_ERR,
  891. C_RX_RCV_DATA_UNC_ERR,
  892. C_RX_RCV_HDR_COR_ERR,
  893. C_RX_RCV_HDR_UNC_ERR,
  894. C_RX_DC_INTF_PARITY_ERR,
  895. C_RX_DMA_CSR_COR_ERR,
  896. /* SendPioErrStatus */
  897. C_PIO_PEC_SOP_HEAD_PARITY_ERR,
  898. C_PIO_PCC_SOP_HEAD_PARITY_ERR,
  899. C_PIO_LAST_RETURNED_CNT_PARITY_ERR,
  900. C_PIO_CURRENT_FREE_CNT_PARITY_ERR,
  901. C_PIO_RSVD_31_ERR,
  902. C_PIO_RSVD_30_ERR,
  903. C_PIO_PPMC_SOP_LEN_ERR,
  904. C_PIO_PPMC_BQC_MEM_PARITY_ERR,
  905. C_PIO_VL_FIFO_PARITY_ERR,
  906. C_PIO_VLF_SOP_PARITY_ERR,
  907. C_PIO_VLF_V1_LEN_PARITY_ERR,
  908. C_PIO_BLOCK_QW_COUNT_PARITY_ERR,
  909. C_PIO_WRITE_QW_VALID_PARITY_ERR,
  910. C_PIO_STATE_MACHINE_ERR,
  911. C_PIO_WRITE_DATA_PARITY_ERR,
  912. C_PIO_HOST_ADDR_MEM_COR_ERR,
  913. C_PIO_HOST_ADDR_MEM_UNC_ERR,
  914. C_PIO_PKT_EVICT_SM_OR_ARM_SM_ERR,
  915. C_PIO_INIT_SM_IN_ERR,
  916. C_PIO_PPMC_PBL_FIFO_ERR,
  917. C_PIO_CREDIT_RET_FIFO_PARITY_ERR,
  918. C_PIO_V1_LEN_MEM_BANK1_COR_ERR,
  919. C_PIO_V1_LEN_MEM_BANK0_COR_ERR,
  920. C_PIO_V1_LEN_MEM_BANK1_UNC_ERR,
  921. C_PIO_V1_LEN_MEM_BANK0_UNC_ERR,
  922. C_PIO_SM_PKT_RESET_PARITY_ERR,
  923. C_PIO_PKT_EVICT_FIFO_PARITY_ERR,
  924. C_PIO_SBRDCTRL_CRREL_FIFO_PARITY_ERR,
  925. C_PIO_SBRDCTL_CRREL_PARITY_ERR,
  926. C_PIO_PEC_FIFO_PARITY_ERR,
  927. C_PIO_PCC_FIFO_PARITY_ERR,
  928. C_PIO_SB_MEM_FIFO1_ERR,
  929. C_PIO_SB_MEM_FIFO0_ERR,
  930. C_PIO_CSR_PARITY_ERR,
  931. C_PIO_WRITE_ADDR_PARITY_ERR,
  932. C_PIO_WRITE_BAD_CTXT_ERR,
  933. /* SendDmaErrStatus */
  934. C_SDMA_PCIE_REQ_TRACKING_COR_ERR,
  935. C_SDMA_PCIE_REQ_TRACKING_UNC_ERR,
  936. C_SDMA_CSR_PARITY_ERR,
  937. C_SDMA_RPY_TAG_ERR,
  938. /* SendEgressErrStatus */
  939. C_TX_READ_PIO_MEMORY_CSR_UNC_ERR,
  940. C_TX_READ_SDMA_MEMORY_CSR_UNC_ERR,
  941. C_TX_EGRESS_FIFO_COR_ERR,
  942. C_TX_READ_PIO_MEMORY_COR_ERR,
  943. C_TX_READ_SDMA_MEMORY_COR_ERR,
  944. C_TX_SB_HDR_COR_ERR,
  945. C_TX_CREDIT_OVERRUN_ERR,
  946. C_TX_LAUNCH_FIFO8_COR_ERR,
  947. C_TX_LAUNCH_FIFO7_COR_ERR,
  948. C_TX_LAUNCH_FIFO6_COR_ERR,
  949. C_TX_LAUNCH_FIFO5_COR_ERR,
  950. C_TX_LAUNCH_FIFO4_COR_ERR,
  951. C_TX_LAUNCH_FIFO3_COR_ERR,
  952. C_TX_LAUNCH_FIFO2_COR_ERR,
  953. C_TX_LAUNCH_FIFO1_COR_ERR,
  954. C_TX_LAUNCH_FIFO0_COR_ERR,
  955. C_TX_CREDIT_RETURN_VL_ERR,
  956. C_TX_HCRC_INSERTION_ERR,
  957. C_TX_EGRESS_FIFI_UNC_ERR,
  958. C_TX_READ_PIO_MEMORY_UNC_ERR,
  959. C_TX_READ_SDMA_MEMORY_UNC_ERR,
  960. C_TX_SB_HDR_UNC_ERR,
  961. C_TX_CREDIT_RETURN_PARITY_ERR,
  962. C_TX_LAUNCH_FIFO8_UNC_OR_PARITY_ERR,
  963. C_TX_LAUNCH_FIFO7_UNC_OR_PARITY_ERR,
  964. C_TX_LAUNCH_FIFO6_UNC_OR_PARITY_ERR,
  965. C_TX_LAUNCH_FIFO5_UNC_OR_PARITY_ERR,
  966. C_TX_LAUNCH_FIFO4_UNC_OR_PARITY_ERR,
  967. C_TX_LAUNCH_FIFO3_UNC_OR_PARITY_ERR,
  968. C_TX_LAUNCH_FIFO2_UNC_OR_PARITY_ERR,
  969. C_TX_LAUNCH_FIFO1_UNC_OR_PARITY_ERR,
  970. C_TX_LAUNCH_FIFO0_UNC_OR_PARITY_ERR,
  971. C_TX_SDMA15_DISALLOWED_PACKET_ERR,
  972. C_TX_SDMA14_DISALLOWED_PACKET_ERR,
  973. C_TX_SDMA13_DISALLOWED_PACKET_ERR,
  974. C_TX_SDMA12_DISALLOWED_PACKET_ERR,
  975. C_TX_SDMA11_DISALLOWED_PACKET_ERR,
  976. C_TX_SDMA10_DISALLOWED_PACKET_ERR,
  977. C_TX_SDMA9_DISALLOWED_PACKET_ERR,
  978. C_TX_SDMA8_DISALLOWED_PACKET_ERR,
  979. C_TX_SDMA7_DISALLOWED_PACKET_ERR,
  980. C_TX_SDMA6_DISALLOWED_PACKET_ERR,
  981. C_TX_SDMA5_DISALLOWED_PACKET_ERR,
  982. C_TX_SDMA4_DISALLOWED_PACKET_ERR,
  983. C_TX_SDMA3_DISALLOWED_PACKET_ERR,
  984. C_TX_SDMA2_DISALLOWED_PACKET_ERR,
  985. C_TX_SDMA1_DISALLOWED_PACKET_ERR,
  986. C_TX_SDMA0_DISALLOWED_PACKET_ERR,
  987. C_TX_CONFIG_PARITY_ERR,
  988. C_TX_SBRD_CTL_CSR_PARITY_ERR,
  989. C_TX_LAUNCH_CSR_PARITY_ERR,
  990. C_TX_ILLEGAL_CL_ERR,
  991. C_TX_SBRD_CTL_STATE_MACHINE_PARITY_ERR,
  992. C_TX_RESERVED_10,
  993. C_TX_RESERVED_9,
  994. C_TX_SDMA_LAUNCH_INTF_PARITY_ERR,
  995. C_TX_PIO_LAUNCH_INTF_PARITY_ERR,
  996. C_TX_RESERVED_6,
  997. C_TX_INCORRECT_LINK_STATE_ERR,
  998. C_TX_LINK_DOWN_ERR,
  999. C_TX_EGRESS_FIFO_UNDERRUN_OR_PARITY_ERR,
  1000. C_TX_RESERVED_2,
  1001. C_TX_PKT_INTEGRITY_MEM_UNC_ERR,
  1002. C_TX_PKT_INTEGRITY_MEM_COR_ERR,
  1003. /* SendErrStatus */
  1004. C_SEND_CSR_WRITE_BAD_ADDR_ERR,
  1005. C_SEND_CSR_READ_BAD_ADD_ERR,
  1006. C_SEND_CSR_PARITY_ERR,
  1007. /* SendCtxtErrStatus */
  1008. C_PIO_WRITE_OUT_OF_BOUNDS_ERR,
  1009. C_PIO_WRITE_OVERFLOW_ERR,
  1010. C_PIO_WRITE_CROSSES_BOUNDARY_ERR,
  1011. C_PIO_DISALLOWED_PACKET_ERR,
  1012. C_PIO_INCONSISTENT_SOP_ERR,
  1013. /*SendDmaEngErrStatus */
  1014. C_SDMA_HEADER_REQUEST_FIFO_COR_ERR,
  1015. C_SDMA_HEADER_STORAGE_COR_ERR,
  1016. C_SDMA_PACKET_TRACKING_COR_ERR,
  1017. C_SDMA_ASSEMBLY_COR_ERR,
  1018. C_SDMA_DESC_TABLE_COR_ERR,
  1019. C_SDMA_HEADER_REQUEST_FIFO_UNC_ERR,
  1020. C_SDMA_HEADER_STORAGE_UNC_ERR,
  1021. C_SDMA_PACKET_TRACKING_UNC_ERR,
  1022. C_SDMA_ASSEMBLY_UNC_ERR,
  1023. C_SDMA_DESC_TABLE_UNC_ERR,
  1024. C_SDMA_TIMEOUT_ERR,
  1025. C_SDMA_HEADER_LENGTH_ERR,
  1026. C_SDMA_HEADER_ADDRESS_ERR,
  1027. C_SDMA_HEADER_SELECT_ERR,
  1028. C_SMDA_RESERVED_9,
  1029. C_SDMA_PACKET_DESC_OVERFLOW_ERR,
  1030. C_SDMA_LENGTH_MISMATCH_ERR,
  1031. C_SDMA_HALT_ERR,
  1032. C_SDMA_MEM_READ_ERR,
  1033. C_SDMA_FIRST_DESC_ERR,
  1034. C_SDMA_TAIL_OUT_OF_BOUNDS_ERR,
  1035. C_SDMA_TOO_LONG_ERR,
  1036. C_SDMA_GEN_MISMATCH_ERR,
  1037. C_SDMA_WRONG_DW_ERR,
  1038. DEV_CNTR_LAST /* Must be kept last */
  1039. };
  1040. /* Per port counter indexes */
  1041. enum {
  1042. C_TX_UNSUP_VL = 0,
  1043. C_TX_INVAL_LEN,
  1044. C_TX_MM_LEN_ERR,
  1045. C_TX_UNDERRUN,
  1046. C_TX_FLOW_STALL,
  1047. C_TX_DROPPED,
  1048. C_TX_HDR_ERR,
  1049. C_TX_PKT,
  1050. C_TX_WORDS,
  1051. C_TX_WAIT,
  1052. C_TX_FLIT_VL,
  1053. C_TX_PKT_VL,
  1054. C_TX_WAIT_VL,
  1055. C_RX_PKT,
  1056. C_RX_WORDS,
  1057. C_SW_LINK_DOWN,
  1058. C_SW_LINK_UP,
  1059. C_SW_UNKNOWN_FRAME,
  1060. C_SW_XMIT_DSCD,
  1061. C_SW_XMIT_DSCD_VL,
  1062. C_SW_XMIT_CSTR_ERR,
  1063. C_SW_RCV_CSTR_ERR,
  1064. C_SW_IBP_LOOP_PKTS,
  1065. C_SW_IBP_RC_RESENDS,
  1066. C_SW_IBP_RNR_NAKS,
  1067. C_SW_IBP_OTHER_NAKS,
  1068. C_SW_IBP_RC_TIMEOUTS,
  1069. C_SW_IBP_PKT_DROPS,
  1070. C_SW_IBP_DMA_WAIT,
  1071. C_SW_IBP_RC_SEQNAK,
  1072. C_SW_IBP_RC_DUPREQ,
  1073. C_SW_IBP_RDMA_SEQ,
  1074. C_SW_IBP_UNALIGNED,
  1075. C_SW_IBP_SEQ_NAK,
  1076. C_SW_CPU_RC_ACKS,
  1077. C_SW_CPU_RC_QACKS,
  1078. C_SW_CPU_RC_DELAYED_COMP,
  1079. C_RCV_HDR_OVF_0,
  1080. C_RCV_HDR_OVF_1,
  1081. C_RCV_HDR_OVF_2,
  1082. C_RCV_HDR_OVF_3,
  1083. C_RCV_HDR_OVF_4,
  1084. C_RCV_HDR_OVF_5,
  1085. C_RCV_HDR_OVF_6,
  1086. C_RCV_HDR_OVF_7,
  1087. C_RCV_HDR_OVF_8,
  1088. C_RCV_HDR_OVF_9,
  1089. C_RCV_HDR_OVF_10,
  1090. C_RCV_HDR_OVF_11,
  1091. C_RCV_HDR_OVF_12,
  1092. C_RCV_HDR_OVF_13,
  1093. C_RCV_HDR_OVF_14,
  1094. C_RCV_HDR_OVF_15,
  1095. C_RCV_HDR_OVF_16,
  1096. C_RCV_HDR_OVF_17,
  1097. C_RCV_HDR_OVF_18,
  1098. C_RCV_HDR_OVF_19,
  1099. C_RCV_HDR_OVF_20,
  1100. C_RCV_HDR_OVF_21,
  1101. C_RCV_HDR_OVF_22,
  1102. C_RCV_HDR_OVF_23,
  1103. C_RCV_HDR_OVF_24,
  1104. C_RCV_HDR_OVF_25,
  1105. C_RCV_HDR_OVF_26,
  1106. C_RCV_HDR_OVF_27,
  1107. C_RCV_HDR_OVF_28,
  1108. C_RCV_HDR_OVF_29,
  1109. C_RCV_HDR_OVF_30,
  1110. C_RCV_HDR_OVF_31,
  1111. C_RCV_HDR_OVF_32,
  1112. C_RCV_HDR_OVF_33,
  1113. C_RCV_HDR_OVF_34,
  1114. C_RCV_HDR_OVF_35,
  1115. C_RCV_HDR_OVF_36,
  1116. C_RCV_HDR_OVF_37,
  1117. C_RCV_HDR_OVF_38,
  1118. C_RCV_HDR_OVF_39,
  1119. C_RCV_HDR_OVF_40,
  1120. C_RCV_HDR_OVF_41,
  1121. C_RCV_HDR_OVF_42,
  1122. C_RCV_HDR_OVF_43,
  1123. C_RCV_HDR_OVF_44,
  1124. C_RCV_HDR_OVF_45,
  1125. C_RCV_HDR_OVF_46,
  1126. C_RCV_HDR_OVF_47,
  1127. C_RCV_HDR_OVF_48,
  1128. C_RCV_HDR_OVF_49,
  1129. C_RCV_HDR_OVF_50,
  1130. C_RCV_HDR_OVF_51,
  1131. C_RCV_HDR_OVF_52,
  1132. C_RCV_HDR_OVF_53,
  1133. C_RCV_HDR_OVF_54,
  1134. C_RCV_HDR_OVF_55,
  1135. C_RCV_HDR_OVF_56,
  1136. C_RCV_HDR_OVF_57,
  1137. C_RCV_HDR_OVF_58,
  1138. C_RCV_HDR_OVF_59,
  1139. C_RCV_HDR_OVF_60,
  1140. C_RCV_HDR_OVF_61,
  1141. C_RCV_HDR_OVF_62,
  1142. C_RCV_HDR_OVF_63,
  1143. C_RCV_HDR_OVF_64,
  1144. C_RCV_HDR_OVF_65,
  1145. C_RCV_HDR_OVF_66,
  1146. C_RCV_HDR_OVF_67,
  1147. C_RCV_HDR_OVF_68,
  1148. C_RCV_HDR_OVF_69,
  1149. C_RCV_HDR_OVF_70,
  1150. C_RCV_HDR_OVF_71,
  1151. C_RCV_HDR_OVF_72,
  1152. C_RCV_HDR_OVF_73,
  1153. C_RCV_HDR_OVF_74,
  1154. C_RCV_HDR_OVF_75,
  1155. C_RCV_HDR_OVF_76,
  1156. C_RCV_HDR_OVF_77,
  1157. C_RCV_HDR_OVF_78,
  1158. C_RCV_HDR_OVF_79,
  1159. C_RCV_HDR_OVF_80,
  1160. C_RCV_HDR_OVF_81,
  1161. C_RCV_HDR_OVF_82,
  1162. C_RCV_HDR_OVF_83,
  1163. C_RCV_HDR_OVF_84,
  1164. C_RCV_HDR_OVF_85,
  1165. C_RCV_HDR_OVF_86,
  1166. C_RCV_HDR_OVF_87,
  1167. C_RCV_HDR_OVF_88,
  1168. C_RCV_HDR_OVF_89,
  1169. C_RCV_HDR_OVF_90,
  1170. C_RCV_HDR_OVF_91,
  1171. C_RCV_HDR_OVF_92,
  1172. C_RCV_HDR_OVF_93,
  1173. C_RCV_HDR_OVF_94,
  1174. C_RCV_HDR_OVF_95,
  1175. C_RCV_HDR_OVF_96,
  1176. C_RCV_HDR_OVF_97,
  1177. C_RCV_HDR_OVF_98,
  1178. C_RCV_HDR_OVF_99,
  1179. C_RCV_HDR_OVF_100,
  1180. C_RCV_HDR_OVF_101,
  1181. C_RCV_HDR_OVF_102,
  1182. C_RCV_HDR_OVF_103,
  1183. C_RCV_HDR_OVF_104,
  1184. C_RCV_HDR_OVF_105,
  1185. C_RCV_HDR_OVF_106,
  1186. C_RCV_HDR_OVF_107,
  1187. C_RCV_HDR_OVF_108,
  1188. C_RCV_HDR_OVF_109,
  1189. C_RCV_HDR_OVF_110,
  1190. C_RCV_HDR_OVF_111,
  1191. C_RCV_HDR_OVF_112,
  1192. C_RCV_HDR_OVF_113,
  1193. C_RCV_HDR_OVF_114,
  1194. C_RCV_HDR_OVF_115,
  1195. C_RCV_HDR_OVF_116,
  1196. C_RCV_HDR_OVF_117,
  1197. C_RCV_HDR_OVF_118,
  1198. C_RCV_HDR_OVF_119,
  1199. C_RCV_HDR_OVF_120,
  1200. C_RCV_HDR_OVF_121,
  1201. C_RCV_HDR_OVF_122,
  1202. C_RCV_HDR_OVF_123,
  1203. C_RCV_HDR_OVF_124,
  1204. C_RCV_HDR_OVF_125,
  1205. C_RCV_HDR_OVF_126,
  1206. C_RCV_HDR_OVF_127,
  1207. C_RCV_HDR_OVF_128,
  1208. C_RCV_HDR_OVF_129,
  1209. C_RCV_HDR_OVF_130,
  1210. C_RCV_HDR_OVF_131,
  1211. C_RCV_HDR_OVF_132,
  1212. C_RCV_HDR_OVF_133,
  1213. C_RCV_HDR_OVF_134,
  1214. C_RCV_HDR_OVF_135,
  1215. C_RCV_HDR_OVF_136,
  1216. C_RCV_HDR_OVF_137,
  1217. C_RCV_HDR_OVF_138,
  1218. C_RCV_HDR_OVF_139,
  1219. C_RCV_HDR_OVF_140,
  1220. C_RCV_HDR_OVF_141,
  1221. C_RCV_HDR_OVF_142,
  1222. C_RCV_HDR_OVF_143,
  1223. C_RCV_HDR_OVF_144,
  1224. C_RCV_HDR_OVF_145,
  1225. C_RCV_HDR_OVF_146,
  1226. C_RCV_HDR_OVF_147,
  1227. C_RCV_HDR_OVF_148,
  1228. C_RCV_HDR_OVF_149,
  1229. C_RCV_HDR_OVF_150,
  1230. C_RCV_HDR_OVF_151,
  1231. C_RCV_HDR_OVF_152,
  1232. C_RCV_HDR_OVF_153,
  1233. C_RCV_HDR_OVF_154,
  1234. C_RCV_HDR_OVF_155,
  1235. C_RCV_HDR_OVF_156,
  1236. C_RCV_HDR_OVF_157,
  1237. C_RCV_HDR_OVF_158,
  1238. C_RCV_HDR_OVF_159,
  1239. PORT_CNTR_LAST /* Must be kept last */
  1240. };
  1241. u64 get_all_cpu_total(u64 __percpu *cntr);
  1242. void hfi1_start_cleanup(struct hfi1_devdata *dd);
  1243. void hfi1_clear_tids(struct hfi1_ctxtdata *rcd);
  1244. struct ib_header *hfi1_get_msgheader(
  1245. struct hfi1_devdata *dd, __le32 *rhf_addr);
  1246. int hfi1_init_ctxt(struct send_context *sc);
  1247. void hfi1_put_tid(struct hfi1_devdata *dd, u32 index,
  1248. u32 type, unsigned long pa, u16 order);
  1249. void hfi1_quiet_serdes(struct hfi1_pportdata *ppd);
  1250. void hfi1_rcvctrl(struct hfi1_devdata *dd, unsigned int op, int ctxt);
  1251. u32 hfi1_read_cntrs(struct hfi1_devdata *dd, char **namep, u64 **cntrp);
  1252. u32 hfi1_read_portcntrs(struct hfi1_pportdata *ppd, char **namep, u64 **cntrp);
  1253. u8 hfi1_ibphys_portstate(struct hfi1_pportdata *ppd);
  1254. int hfi1_get_ib_cfg(struct hfi1_pportdata *ppd, int which);
  1255. int hfi1_set_ib_cfg(struct hfi1_pportdata *ppd, int which, u32 val);
  1256. int hfi1_set_ctxt_jkey(struct hfi1_devdata *dd, unsigned ctxt, u16 jkey);
  1257. int hfi1_clear_ctxt_jkey(struct hfi1_devdata *dd, unsigned ctxt);
  1258. int hfi1_set_ctxt_pkey(struct hfi1_devdata *dd, unsigned ctxt, u16 pkey);
  1259. int hfi1_clear_ctxt_pkey(struct hfi1_devdata *dd, unsigned ctxt);
  1260. void hfi1_read_link_quality(struct hfi1_devdata *dd, u8 *link_quality);
  1261. /*
  1262. * Interrupt source table.
  1263. *
  1264. * Each entry is an interrupt source "type". It is ordered by increasing
  1265. * number.
  1266. */
  1267. struct is_table {
  1268. int start; /* interrupt source type start */
  1269. int end; /* interrupt source type end */
  1270. /* routine that returns the name of the interrupt source */
  1271. char *(*is_name)(char *name, size_t size, unsigned int source);
  1272. /* routine to call when receiving an interrupt */
  1273. void (*is_int)(struct hfi1_devdata *dd, unsigned int source);
  1274. };
  1275. #endif /* _CHIP_H */