1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2014-2018 Chelsio Communications.
6 #ifndef __T4_REGS_VALUES_H__
7 #define __T4_REGS_VALUES_H__
10 * This file contains definitions for various T4 register value hardware
11 * constants. The types of values encoded here are predominantly those for
12 * register fields which control "modal" behavior. For the most part, we do
13 * not include definitions for register fields which are simple numeric
23 * SGE register field values.
26 /* CONTROL register */
27 #define X_RXPKTCPLMODE_SPLIT 1
28 #define X_INGPCIEBOUNDARY_32B 0
29 #define X_INGPADBOUNDARY_SHIFT 5
30 #define X_INGPADBOUNDARY_32B 0
32 #define X_T6_INGPADBOUNDARY_SHIFT 3
33 #define X_T6_INGPADBOUNDARY_8B 0
35 /* CONTROL2 register */
36 #define X_INGPACKBOUNDARY_SHIFT 5
37 #define X_INGPACKBOUNDARY_16B 0
38 #define X_INGPACKBOUNDARY_64B 1
41 #define X_TIMERREG_RESTART_COUNTER 6
42 #define X_TIMERREG_UPDATE_CIDX 7
45 * Egress Context field values
47 #define X_FETCHBURSTMIN_64B 2
48 #define X_FETCHBURSTMIN_128B 3
49 #define X_FETCHBURSTMAX_256B 2
50 #define X_FETCHBURSTMAX_512B 3
52 #define X_HOSTFCMODE_NONE 0
55 * Ingress Context field values
57 #define X_UPDATEDELIVERY_STATUS_PAGE 2
59 #define X_RSPD_TYPE_FLBUF 0
60 #define X_RSPD_TYPE_CPL 1
63 * Context field definitions. This is by no means a complete list of SGE
64 * Context fields. In the vast majority of cases the firmware initializes
65 * things the way they need to be set up. But in a few small cases, we need
66 * to compute new values and ship them off to the firmware to be applied to
71 * Congestion Manager Definitions.
73 #define S_CONMCTXT_CNGTPMODE 19
74 #define M_CONMCTXT_CNGTPMODE 0x3
75 #define V_CONMCTXT_CNGTPMODE(x) ((x) << S_CONMCTXT_CNGTPMODE)
76 #define G_CONMCTXT_CNGTPMODE(x) \
77 (((x) >> S_CONMCTXT_CNGTPMODE) & M_CONMCTXT_CNGTPMODE)
78 #define S_CONMCTXT_CNGCHMAP 0
79 #define M_CONMCTXT_CNGCHMAP 0xffff
80 #define V_CONMCTXT_CNGCHMAP(x) ((x) << S_CONMCTXT_CNGCHMAP)
81 #define G_CONMCTXT_CNGCHMAP(x) \
82 (((x) >> S_CONMCTXT_CNGCHMAP) & M_CONMCTXT_CNGCHMAP)
84 #define X_CONMCTXT_CNGTPMODE_QUEUE 1
85 #define X_CONMCTXT_CNGTPMODE_CHANNEL 2
88 * T5 and later support a new BAR2-based doorbell mechanism for Egress Queues.
89 * The User Doorbells are each 128 bytes in length with a Simple Doorbell at
90 * offsets 8x and a Write Combining single 64-byte Egress Queue Unit
91 * (X_IDXSIZE_UNIT) Gather Buffer interface at offset 64. For Ingress Queues,
92 * we have a Going To Sleep register at offsets 8x+4.
94 * As noted above, we have many instances of the Simple Doorbell and Going To
95 * Sleep registers at offsets 8x and 8x+4, respectively. We want to use a
96 * non-64-byte aligned offset for the Simple Doorbell in order to attempt to
97 * avoid buffering of the writes to the Simple Doorbell and we want to use a
98 * non-contiguous offset for the Going To Sleep writes in order to avoid
99 * possible combining between them.
101 #define SGE_UDB_SIZE 128
102 #define SGE_UDB_KDOORBELL 8
103 #define SGE_UDB_GTS 20
111 * CIM register field values.
113 #define X_MBOWNER_NONE 0
114 #define X_MBOWNER_FW 1
115 #define X_MBOWNER_PL 2
121 #define X_WINDOW_SHIFT 10
122 #define X_PCIEOFST_SHIFT 10
130 * TP_VLAN_PRI_MAP controls which subset of fields will be present in the
131 * Compressed Filter Tuple for LE filters. Each bit set in TP_VLAN_PRI_MAP
132 * selects for a particular field being present. These fields, when present
133 * in the Compressed Filter Tuple, have the following widths in bits.
137 #define W_FT_VNIC_ID 17
140 #define W_FT_PROTOCOL 8
141 #define W_FT_ETHERTYPE 16
142 #define W_FT_MACMATCH 9
143 #define W_FT_MPSHITTYPE 3
144 #define W_FT_FRAGMENTATION 1
146 #endif /* __T4_REGS_VALUES_H__ */