t4_values.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. * This file is part of the Chelsio T4 Ethernet driver for Linux.
  3. *
  4. * Copyright (c) 2003-2014 Chelsio Communications, Inc. All rights reserved.
  5. *
  6. * This software is available to you under a choice of one of two
  7. * licenses. You may choose to be licensed under the terms of the GNU
  8. * General Public License (GPL) Version 2, available from the file
  9. * COPYING in the main directory of this source tree, or the
  10. * OpenIB.org BSD license below:
  11. *
  12. * Redistribution and use in source and binary forms, with or
  13. * without modification, are permitted provided that the following
  14. * conditions are met:
  15. *
  16. * - Redistributions of source code must retain the above
  17. * copyright notice, this list of conditions and the following
  18. * disclaimer.
  19. *
  20. * - Redistributions in binary form must reproduce the above
  21. * copyright notice, this list of conditions and the following
  22. * disclaimer in the documentation and/or other materials
  23. * provided with the distribution.
  24. *
  25. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  29. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  30. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  31. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  32. * SOFTWARE.
  33. */
  34. #ifndef __T4_VALUES_H__
  35. #define __T4_VALUES_H__
  36. /* This file contains definitions for various T4 register value hardware
  37. * constants. The types of values encoded here are predominantly those for
  38. * register fields which control "modal" behavior. For the most part, we do
  39. * not include definitions for register fields which are simple numeric
  40. * metrics, etc.
  41. */
  42. /* SGE register field values.
  43. */
  44. /* CONTROL1 register */
  45. #define RXPKTCPLMODE_SPLIT_X 1
  46. #define INGPCIEBOUNDARY_SHIFT_X 5
  47. #define INGPCIEBOUNDARY_32B_X 0
  48. #define INGPADBOUNDARY_SHIFT_X 5
  49. /* CONTROL2 register */
  50. #define INGPACKBOUNDARY_SHIFT_X 5
  51. #define INGPACKBOUNDARY_16B_X 0
  52. /* GTS register */
  53. #define SGE_TIMERREGS 6
  54. #define TIMERREG_COUNTER0_X 0
  55. #define FETCHBURSTMIN_64B_X 2
  56. #define FETCHBURSTMAX_256B_X 2
  57. #define FETCHBURSTMAX_512B_X 3
  58. #define HOSTFCMODE_STATUS_PAGE_X 2
  59. #define CIDXFLUSHTHRESH_32_X 5
  60. #define UPDATEDELIVERY_INTERRUPT_X 1
  61. #define RSPD_TYPE_FLBUF_X 0
  62. #define RSPD_TYPE_CPL_X 1
  63. #define RSPD_TYPE_INTR_X 2
  64. /* Congestion Manager Definitions.
  65. */
  66. #define CONMCTXT_CNGTPMODE_S 19
  67. #define CONMCTXT_CNGTPMODE_V(x) ((x) << CONMCTXT_CNGTPMODE_S)
  68. #define CONMCTXT_CNGCHMAP_S 0
  69. #define CONMCTXT_CNGCHMAP_V(x) ((x) << CONMCTXT_CNGCHMAP_S)
  70. #define CONMCTXT_CNGTPMODE_CHANNEL_X 2
  71. #define CONMCTXT_CNGTPMODE_QUEUE_X 1
  72. /* T5 and later support a new BAR2-based doorbell mechanism for Egress Queues.
  73. * The User Doorbells are each 128 bytes in length with a Simple Doorbell at
  74. * offsets 8x and a Write Combining single 64-byte Egress Queue Unit
  75. * (IDXSIZE_UNIT_X) Gather Buffer interface at offset 64. For Ingress Queues,
  76. * we have a Going To Sleep register at offsets 8x+4.
  77. *
  78. * As noted above, we have many instances of the Simple Doorbell and Going To
  79. * Sleep registers at offsets 8x and 8x+4, respectively. We want to use a
  80. * non-64-byte aligned offset for the Simple Doorbell in order to attempt to
  81. * avoid buffering of the writes to the Simple Doorbell and we want to use a
  82. * non-contiguous offset for the Going To Sleep writes in order to avoid
  83. * possible combining between them.
  84. */
  85. #define SGE_UDB_SIZE 128
  86. #define SGE_UDB_KDOORBELL 8
  87. #define SGE_UDB_GTS 20
  88. #define SGE_UDB_WCDOORBELL 64
  89. /* CIM register field values.
  90. */
  91. #define X_MBOWNER_FW 1
  92. #define X_MBOWNER_PL 2
  93. /* PCI-E definitions */
  94. #define WINDOW_SHIFT_X 10
  95. #define PCIEOFST_SHIFT_X 10
  96. /* TP_VLAN_PRI_MAP controls which subset of fields will be present in the
  97. * Compressed Filter Tuple for LE filters. Each bit set in TP_VLAN_PRI_MAP
  98. * selects for a particular field being present. These fields, when present
  99. * in the Compressed Filter Tuple, have the following widths in bits.
  100. */
  101. #define FT_FCOE_W 1
  102. #define FT_PORT_W 3
  103. #define FT_VNIC_ID_W 17
  104. #define FT_VLAN_W 17
  105. #define FT_TOS_W 8
  106. #define FT_PROTOCOL_W 8
  107. #define FT_ETHERTYPE_W 16
  108. #define FT_MACMATCH_W 9
  109. #define FT_MPSHITTYPE_W 3
  110. #define FT_FRAGMENTATION_W 1
  111. /* Some of the Compressed Filter Tuple fields have internal structure. These
  112. * bit shifts/masks describe those structures. All shifts are relative to the
  113. * base position of the fields within the Compressed Filter Tuple
  114. */
  115. #define FT_VLAN_VLD_S 16
  116. #define FT_VLAN_VLD_V(x) ((x) << FT_VLAN_VLD_S)
  117. #define FT_VLAN_VLD_F FT_VLAN_VLD_V(1U)
  118. #define FT_VNID_ID_VF_S 0
  119. #define FT_VNID_ID_VF_V(x) ((x) << FT_VNID_ID_VF_S)
  120. #define FT_VNID_ID_PF_S 7
  121. #define FT_VNID_ID_PF_V(x) ((x) << FT_VNID_ID_PF_S)
  122. #define FT_VNID_ID_VLD_S 16
  123. #define FT_VNID_ID_VLD_V(x) ((x) << FT_VNID_ID_VLD_S)
  124. #endif /* __T4_VALUES_H__ */