4 * Copyright(c) 2014-2015 Chelsio Communications.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Chelsio Communications nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 NCHAN = 4, /* # of HW channels */
39 NMTUS = 16, /* size of MTU table */
40 NCCTRL_WIN = 32, /* # of congestion control windows */
41 MBOX_LEN = 64, /* mailbox size in bytes */
42 UDBS_SEG_SIZE = 128, /* segment size for BAR2 user doorbells */
46 CIMLA_SIZE = 2048, /* # of 32-bit words in CIM LA */
50 SF_SEC_SIZE = 64 * 1024, /* serial flash sector size */
54 SGE_NTIMERS = 6, /* # of interrupt holdoff timer values */
55 SGE_NCOUNTERS = 4, /* # of interrupt packet counter values */
58 /* PCI-e memory window access */
64 SGE_MAX_WR_LEN = 512, /* max WR size in bytes */
65 SGE_EQ_IDXSIZE = 64, /* egress queue pidx/cidx unit size */
66 /* max no. of desc allowed in WR */
67 SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / SGE_EQ_IDXSIZE,
70 struct sge_qstat { /* data written to SGE queue status entries */
77 * Structure for last 128 bits of response descriptors
80 __be32 hdrbuflen_pidx;
88 #define S_RSPD_NEWBUF 31
89 #define V_RSPD_NEWBUF(x) ((x) << S_RSPD_NEWBUF)
90 #define F_RSPD_NEWBUF V_RSPD_NEWBUF(1U)
93 #define M_RSPD_LEN 0x7fffffff
94 #define V_RSPD_LEN(x) ((x) << S_RSPD_LEN)
95 #define G_RSPD_LEN(x) (((x) >> S_RSPD_LEN) & M_RSPD_LEN)
98 #define V_RSPD_GEN(x) ((x) << S_RSPD_GEN)
99 #define F_RSPD_GEN V_RSPD_GEN(1U)
101 #define S_RSPD_TYPE 4
102 #define M_RSPD_TYPE 0x3
103 #define V_RSPD_TYPE(x) ((x) << S_RSPD_TYPE)
104 #define G_RSPD_TYPE(x) (((x) >> S_RSPD_TYPE) & M_RSPD_TYPE)
106 /* Rx queue interrupt deferral field: timer index */
107 #define S_QINTR_CNT_EN 0
108 #define V_QINTR_CNT_EN(x) ((x) << S_QINTR_CNT_EN)
109 #define F_QINTR_CNT_EN V_QINTR_CNT_EN(1U)
111 #define S_QINTR_TIMER_IDX 1
112 #define M_QINTR_TIMER_IDX 0x7
113 #define V_QINTR_TIMER_IDX(x) ((x) << S_QINTR_TIMER_IDX)
114 #define G_QINTR_TIMER_IDX(x) (((x) >> S_QINTR_TIMER_IDX) & M_QINTR_TIMER_IDX)
119 #define FLASH_START(start) ((start) * SF_SEC_SIZE)
120 #define FLASH_MAX_SIZE(nsecs) ((nsecs) * SF_SEC_SIZE)
124 * Location of firmware image in FLASH.
126 FLASH_FW_START_SEC = 8,
128 FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC),
129 FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS),
132 * Location of Firmware Configuration File in FLASH.
134 FLASH_CFG_START_SEC = 31,
136 FLASH_CFG_START = FLASH_START(FLASH_CFG_START_SEC),
137 FLASH_CFG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CFG_NSECS),
140 * We don't support FLASH devices which can't support the full
141 * standard set of sections which we need for normal operations.
143 FLASH_MIN_SIZE = FLASH_CFG_START + FLASH_CFG_MAX_SIZE,
147 #undef FLASH_MAX_SIZE
149 #endif /* __T4_HW_H */