firmware_exports.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. * Copyright (c) 2004-2008 Chelsio, Inc. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. #ifndef _FIRMWARE_EXPORTS_H_
  33. #define _FIRMWARE_EXPORTS_H_
  34. /* WR OPCODES supported by the firmware.
  35. */
  36. #define FW_WROPCODE_FORWARD 0x01
  37. #define FW_WROPCODE_BYPASS 0x05
  38. #define FW_WROPCODE_TUNNEL_TX_PKT 0x03
  39. #define FW_WROPOCDE_ULPTX_DATA_SGL 0x00
  40. #define FW_WROPCODE_ULPTX_MEM_READ 0x02
  41. #define FW_WROPCODE_ULPTX_PKT 0x04
  42. #define FW_WROPCODE_ULPTX_INVALIDATE 0x06
  43. #define FW_WROPCODE_TUNNEL_RX_PKT 0x07
  44. #define FW_WROPCODE_OFLD_GETTCB_RPL 0x08
  45. #define FW_WROPCODE_OFLD_CLOSE_CON 0x09
  46. #define FW_WROPCODE_OFLD_TP_ABORT_CON_REQ 0x0A
  47. #define FW_WROPCODE_OFLD_HOST_ABORT_CON_RPL 0x0F
  48. #define FW_WROPCODE_OFLD_HOST_ABORT_CON_REQ 0x0B
  49. #define FW_WROPCODE_OFLD_TP_ABORT_CON_RPL 0x0C
  50. #define FW_WROPCODE_OFLD_TX_DATA 0x0D
  51. #define FW_WROPCODE_OFLD_TX_DATA_ACK 0x0E
  52. #define FW_WROPCODE_RI_RDMA_INIT 0x10
  53. #define FW_WROPCODE_RI_RDMA_WRITE 0x11
  54. #define FW_WROPCODE_RI_RDMA_READ_REQ 0x12
  55. #define FW_WROPCODE_RI_RDMA_READ_RESP 0x13
  56. #define FW_WROPCODE_RI_SEND 0x14
  57. #define FW_WROPCODE_RI_TERMINATE 0x15
  58. #define FW_WROPCODE_RI_RDMA_READ 0x16
  59. #define FW_WROPCODE_RI_RECEIVE 0x17
  60. #define FW_WROPCODE_RI_BIND_MW 0x18
  61. #define FW_WROPCODE_RI_FASTREGISTER_MR 0x19
  62. #define FW_WROPCODE_RI_LOCAL_INV 0x1A
  63. #define FW_WROPCODE_RI_MODIFY_QP 0x1B
  64. #define FW_WROPCODE_RI_BYPASS 0x1C
  65. #define FW_WROPOCDE_RSVD 0x1E
  66. #define FW_WROPCODE_SGE_EGRESSCONTEXT_RR 0x1F
  67. #define FW_WROPCODE_MNGT 0x1D
  68. #define FW_MNGTOPCODE_PKTSCHED_SET 0x00
  69. /* Maximum size of a WR sent from the host, limited by the SGE.
  70. *
  71. * Note: WR coming from ULP or TP are only limited by CIM.
  72. */
  73. #define FW_WR_SIZE 128
  74. /* Maximum number of outstanding WRs sent from the host. Value must be
  75. * programmed in the CTRL/TUNNEL/QP SGE Egress Context and used by
  76. * offload modules to limit the number of WRs per connection.
  77. */
  78. #define FW_T3_WR_NUM 16
  79. #define FW_N3_WR_NUM 7
  80. #ifndef N3
  81. # define FW_WR_NUM FW_T3_WR_NUM
  82. #else
  83. # define FW_WR_NUM FW_N3_WR_NUM
  84. #endif
  85. /* FW_TUNNEL_NUM corresponds to the number of supported TUNNEL Queues. These
  86. * queues must start at SGE Egress Context FW_TUNNEL_SGEEC_START and must
  87. * start at 'TID' (or 'uP Token') FW_TUNNEL_TID_START.
  88. *
  89. * Ingress Traffic (e.g. DMA completion credit) for TUNNEL Queue[i] is sent
  90. * to RESP Queue[i].
  91. */
  92. #define FW_TUNNEL_NUM 8
  93. #define FW_TUNNEL_SGEEC_START 8
  94. #define FW_TUNNEL_TID_START 65544
  95. /* FW_CTRL_NUM corresponds to the number of supported CTRL Queues. These queues
  96. * must start at SGE Egress Context FW_CTRL_SGEEC_START and must start at 'TID'
  97. * (or 'uP Token') FW_CTRL_TID_START.
  98. *
  99. * Ingress Traffic for CTRL Queue[i] is sent to RESP Queue[i].
  100. */
  101. #define FW_CTRL_NUM 8
  102. #define FW_CTRL_SGEEC_START 65528
  103. #define FW_CTRL_TID_START 65536
  104. /* FW_OFLD_NUM corresponds to the number of supported OFFLOAD Queues. These
  105. * queues must start at SGE Egress Context FW_OFLD_SGEEC_START.
  106. *
  107. * Note: the 'uP Token' in the SGE Egress Context fields is irrelevant for
  108. * OFFLOAD Queues, as the host is responsible for providing the correct TID in
  109. * every WR.
  110. *
  111. * Ingress Trafffic for OFFLOAD Queue[i] is sent to RESP Queue[i].
  112. */
  113. #define FW_OFLD_NUM 8
  114. #define FW_OFLD_SGEEC_START 0
  115. /*
  116. *
  117. */
  118. #define FW_RI_NUM 1
  119. #define FW_RI_SGEEC_START 65527
  120. #define FW_RI_TID_START 65552
  121. /*
  122. * The RX_PKT_TID
  123. */
  124. #define FW_RX_PKT_NUM 1
  125. #define FW_RX_PKT_TID_START 65553
  126. /* FW_WRC_NUM corresponds to the number of Work Request Context that supported
  127. * by the firmware.
  128. */
  129. #define FW_WRC_NUM \
  130. (65536 + FW_TUNNEL_NUM + FW_CTRL_NUM + FW_RI_NUM + FW_RX_PKT_NUM)
  131. /*
  132. * FW type and version.
  133. */
  134. #define S_FW_VERSION_TYPE 28
  135. #define M_FW_VERSION_TYPE 0xF
  136. #define V_FW_VERSION_TYPE(x) ((x) << S_FW_VERSION_TYPE)
  137. #define G_FW_VERSION_TYPE(x) \
  138. (((x) >> S_FW_VERSION_TYPE) & M_FW_VERSION_TYPE)
  139. #define S_FW_VERSION_MAJOR 16
  140. #define M_FW_VERSION_MAJOR 0xFFF
  141. #define V_FW_VERSION_MAJOR(x) ((x) << S_FW_VERSION_MAJOR)
  142. #define G_FW_VERSION_MAJOR(x) \
  143. (((x) >> S_FW_VERSION_MAJOR) & M_FW_VERSION_MAJOR)
  144. #define S_FW_VERSION_MINOR 8
  145. #define M_FW_VERSION_MINOR 0xFF
  146. #define V_FW_VERSION_MINOR(x) ((x) << S_FW_VERSION_MINOR)
  147. #define G_FW_VERSION_MINOR(x) \
  148. (((x) >> S_FW_VERSION_MINOR) & M_FW_VERSION_MINOR)
  149. #define S_FW_VERSION_MICRO 0
  150. #define M_FW_VERSION_MICRO 0xFF
  151. #define V_FW_VERSION_MICRO(x) ((x) << S_FW_VERSION_MICRO)
  152. #define G_FW_VERSION_MICRO(x) \
  153. (((x) >> S_FW_VERSION_MICRO) & M_FW_VERSION_MICRO)
  154. #endif /* _FIRMWARE_EXPORTS_H_ */