2 * Copyright (c) 2012-2015 Solarflare Communications Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
33 #ifndef _SYS_EFX_CHECK_H
34 #define _SYS_EFX_CHECK_H
39 * Check that the efsys.h header in client code has a valid combination of
40 * EFSYS_OPT_xxx options.
42 * NOTE: Keep checks for obsolete options here to ensure that they are removed
43 * from client code (and do not reappear in merges from other branches).
46 /* Support NVRAM based boot config */
49 # error "BOOTCFG requires NVRAM"
51 #endif /* EFSYS_OPT_BOOTCFG */
53 /* Verify chip implements accessed registers */
54 #if EFSYS_OPT_CHECK_REG
55 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
56 # error "CHECK_REG requires FALCON or SIENA or HUNTINGTON"
58 #endif /* EFSYS_OPT_CHECK_REG */
60 /* Decode fatal errors */
61 #if EFSYS_OPT_DECODE_INTR_FATAL
62 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
63 # if EFSYS_OPT_HUNTINGTON
64 # error "INTR_FATAL not supported on HUNTINGTON"
66 # error "INTR_FATAL requires FALCON or SIENA"
68 #endif /* EFSYS_OPT_DECODE_INTR_FATAL */
70 /* Support diagnostic hardware tests */
72 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
73 # error "DIAG requires FALCON or SIENA or HUNTINGTON"
75 #endif /* EFSYS_OPT_DIAG */
77 /* Support optimized EVQ data access */
78 #if EFSYS_OPT_EV_PREFETCH
79 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
80 # error "EV_PREFETCH requires FALCON or SIENA or HUNTINGTON"
82 #endif /* EFSYS_OPT_EV_PREFETCH */
84 /* Support overriding the NVRAM and VPD configuration */
85 #if EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
86 # if !EFSYS_OPT_FALCON
87 # error "FALCON_NIC_CFG_OVERRIDE requires FALCON"
89 #endif /* EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE */
91 /* Support hardware packet filters */
93 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
94 # error "FILTER requires FALCON or SIENA or HUNTINGTON"
96 #endif /* EFSYS_OPT_FILTER */
98 #if EFSYS_OPT_HUNTINGTON
99 # if !EFSYS_OPT_FILTER
100 # error "HUNTINGTON requires FILTER"
102 #endif /* EFSYS_OPT_HUNTINGTON */
104 /* Support hardware loopback modes */
105 #if EFSYS_OPT_LOOPBACK
106 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
107 # error "LOOPBACK requires FALCON or SIENA or HUNTINGTON"
109 #endif /* EFSYS_OPT_LOOPBACK */
111 /* Support Falcon GMAC */
112 #if EFSYS_OPT_MAC_FALCON_GMAC
113 # if !EFSYS_OPT_FALCON
114 # error "MAC_FALCON_GMAC requires FALCON"
116 #endif /* EFSYS_OPT_MAC_FALCON_GMAC */
118 /* Support Falcon XMAC */
119 #if EFSYS_OPT_MAC_FALCON_XMAC
120 # if !EFSYS_OPT_FALCON
121 # error "MAC_FALCON_XMAC requires FALCON"
123 #endif /* EFSYS_OPT_MAC_FALCON_XMAC */
125 /* Support MAC statistics */
126 #if EFSYS_OPT_MAC_STATS
127 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
128 # error "MAC_STATS requires FALCON or SIENA or HUNTINGTON"
130 #endif /* EFSYS_OPT_MAC_STATS */
132 /* Support management controller messages */
134 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
135 # if EFSYS_OPT_FALCON
136 # error "MCDI not supported on FALCON"
138 # error "MCDI requires SIENA or HUNTINGTON"
140 #endif /* EFSYS_OPT_MCDI */
142 #if EFSYS_OPT_SIENA && !EFSYS_OPT_MCDI
143 # error "SIENA requires MCDI"
145 #if EFSYS_OPT_HUNTINGTON && !EFSYS_OPT_MCDI
146 # error "HUNTINGTON requires MCDI"
149 /* Support LM87 monitor */
150 #if EFSYS_OPT_MON_LM87
151 # if !EFSYS_OPT_FALCON
152 # error "MON_LM87 requires FALCON"
154 #endif /* EFSYS_OPT_MON_LM87 */
156 /* Support MAX6647 monitor */
157 #if EFSYS_OPT_MON_MAX6647
158 # if !EFSYS_OPT_FALCON
159 # error "MON_MAX6647 requires FALCON"
161 #endif /* EFSYS_OPT_MON_MAX6647 */
163 /* Support null monitor */
164 #if EFSYS_OPT_MON_NULL
165 # if !EFSYS_OPT_FALCON
166 # error "MON_NULL requires FALCON"
168 #endif /* EFSYS_OPT_MON_NULL */
170 /* Support Siena monitor */
171 #ifdef EFSYS_OPT_MON_SIENA
172 # error "MON_SIENA is obsolete use MON_MCDI"
173 #endif /* EFSYS_OPT_MON_SIENA*/
175 /* Support Huntington monitor */
176 #ifdef EFSYS_OPT_MON_HUNTINGTON
177 # error "MON_HUNTINGTON is obsolete use MON_MCDI"
178 #endif /* EFSYS_OPT_MON_HUNTINGTON*/
180 /* Support monitor statistics (voltage/temperature) */
181 #if EFSYS_OPT_MON_STATS
182 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
183 # error "MON_STATS requires FALCON or SIENA or HUNTINGTON"
185 #endif /* EFSYS_OPT_MON_STATS */
187 /* Support Monitor via mcdi */
188 #if EFSYS_OPT_MON_MCDI
189 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
190 # error "MON_MCDI requires SIENA or HUNTINGTON"
192 #endif /* EFSYS_OPT_MON_MCDI*/
194 /* Support printable names for statistics */
196 # if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
197 EFSYS_MON_STATS || EFSYS_OPT_PHY_PROPS || EFSYS_OPT_PHY_STATS || \
199 # error "NAMES requires LOOPBACK or xxxSTATS or MCDI or PHY_PROPS"
201 #endif /* EFSYS_OPT_NAMES */
203 /* Support non volatile configuration */
205 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
206 # error "NVRAM requires FALCON or SIENA or HUNTINGTON"
208 #endif /* EFSYS_OPT_NVRAM */
210 /* Support Falcon bootrom */
211 #if EFSYS_OPT_NVRAM_FALCON_BOOTROM
212 # if !EFSYS_OPT_NVRAM
213 # error "NVRAM_FALCON_BOOTROM requires NVRAM"
215 # if !EFSYS_OPT_FALCON
216 # error "NVRAM_FALCON_BOOTROM requires FALCON"
218 #endif /* EFSYS_OPT_NVRAM_FALCON_BOOTROM */
220 /* Support NVRAM config for SFT9001 */
221 #if EFSYS_OPT_NVRAM_SFT9001
222 # if !EFSYS_OPT_NVRAM
223 # error "NVRAM_SFT9001 requires NVRAM"
225 # if !EFSYS_OPT_FALCON
226 # error "NVRAM_SFT9001 requires FALCON"
228 #endif /* EFSYS_OPT_NVRAM_SFT9001 */
230 /* Support NVRAM config for SFX7101 */
231 #if EFSYS_OPT_NVRAM_SFX7101
232 # if !EFSYS_OPT_NVRAM
233 # error "NVRAM_SFX7101 requires NVRAM"
235 # if !EFSYS_OPT_FALCON
236 # error "NVRAM_SFX7101 requires FALCON"
238 #endif /* EFSYS_OPT_NVRAM_SFX7101 */
240 /* Support PCIe interface tuning */
241 #if EFSYS_OPT_PCIE_TUNE
242 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
243 # error "PCIE_TUNE requires FALCON or SIENA"
245 #endif /* EFSYS_OPT_PCIE_TUNE */
247 /* Support PHY BIST diagnostics */
248 #if EFSYS_OPT_PHY_BIST
249 # error "PHY_BIST is obsolete. It has been replaced by the BIST option."
250 #endif /* EFSYS_OPT_PHY_BIST */
252 /* Support PHY flags */
253 #if EFSYS_OPT_PHY_FLAGS
254 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
255 # error "PHY_FLAGS requires FALCON or SIENA"
257 #endif /* EFSYS_OPT_PHY_FLAGS */
259 /* Support for PHY LED control */
260 #if EFSYS_OPT_PHY_LED_CONTROL
261 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
262 # error "PHY_LED_CONTROL requires FALCON or SIENA"
264 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
266 /* Support NULL PHY */
267 #if EFSYS_OPT_PHY_NULL
268 # if !EFSYS_OPT_FALCON
269 # error "PHY_NULL requires FALCON"
271 #endif /* EFSYS_OPT_PHY_NULL */
273 /* Obsolete option */
274 #ifdef EFSYS_OPT_PHY_PM8358
275 # error "EFSYS_OPT_PHY_PM8358 is obsolete and is not supported."
278 /* Support PHY properties */
279 #if EFSYS_OPT_PHY_PROPS
280 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
281 # error "PHY_PROPS requires FALCON or SIENA"
283 #endif /* EFSYS_OPT_PHY_PROPS */
285 /* Support QT2022C2 PHY */
286 #if EFSYS_OPT_PHY_QT2022C2
287 # if !EFSYS_OPT_FALCON
288 # error "PHY_QT2022C2 requires FALCON"
290 #endif /* EFSYS_OPT_PHY_QT2022C2 */
292 /* Support QT2025C PHY (Wakefield NIC) */
293 #if EFSYS_OPT_PHY_QT2025C
294 # if !EFSYS_OPT_FALCON
295 # error "PHY_QT2025C requires FALCON"
297 #endif /* EFSYS_OPT_PHY_QT2025C */
299 /* Support SFT9001 PHY (Starbolt NIC) */
300 #if EFSYS_OPT_PHY_SFT9001
301 # if !EFSYS_OPT_FALCON
302 # error "PHY_SFT9001 requires FALCON"
304 #endif /* EFSYS_OPT_PHY_SFT9001 */
306 /* Support SFX7101 PHY (SFE4001 NIC) */
307 #if EFSYS_OPT_PHY_SFX7101
308 # if !EFSYS_OPT_FALCON
309 # error "PHY_SFX7101 requires FALCON"
311 #endif /* EFSYS_OPT_PHY_SFX7101 */
313 /* Support PHY statistics */
314 #if EFSYS_OPT_PHY_STATS
315 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA)
316 # error "PHY_STATS requires FALCON or SIENA"
318 #endif /* EFSYS_OPT_PHY_STATS */
320 /* Support TXC43128 PHY (SFE4003 NIC) */
321 #if EFSYS_OPT_PHY_TXC43128
322 # if !EFSYS_OPT_FALCON
323 # error "PHY_TXC43128 requires FALCON"
325 #endif /* EFSYS_OPT_PHY_TXC43128 */
327 /* Support EVQ/RXQ/TXQ statistics */
329 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
330 # error "QSTATS requires FALCON or SIENA or HUNTINGTON"
332 #endif /* EFSYS_OPT_QSTATS */
334 /* Support receive header split */
335 #if EFSYS_OPT_RX_HDR_SPLIT
336 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
337 # error "RX_HDR_SPLIT requires FALCON or SIENA or HUNTINGTON"
339 #endif /* EFSYS_OPT_RX_HDR_SPLIT */
341 /* Support receive scaling (RSS) */
342 #if EFSYS_OPT_RX_SCALE
343 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
344 # error "RX_SCALE requires FALCON or SIENA or HUNTINGTON"
346 #endif /* EFSYS_OPT_RX_SCALE */
348 /* Support receive scatter DMA */
349 #if EFSYS_OPT_RX_SCATTER
350 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
351 # error "RX_SCATTER requires FALCON or SIENA or HUNTINGTON"
353 #endif /* EFSYS_OPT_RX_SCATTER */
355 /* Obsolete option */
356 #ifdef EFSYS_OPT_STAT_NAME
357 # error "EFSYS_OPT_STAT_NAME is obsolete (replaced by EFSYS_OPT_NAMES)."
360 /* Support PCI Vital Product Data (VPD) */
362 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
363 # error "VPD requires FALCON or SIENA or HUNTINGTON"
365 #endif /* EFSYS_OPT_VPD */
367 /* Support Wake on LAN */
369 # if !EFSYS_OPT_SIENA
370 # error "WOL requires SIENA"
372 #endif /* EFSYS_OPT_WOL */
374 /* Support calculating multicast pktfilter in common code */
375 #if EFSYS_OPT_MCAST_FILTER_LIST
376 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
377 # error "MCAST_FILTER_LIST requires FALCON or SIENA or HUNTINGTON"
379 #endif /* EFSYS_OPT_MCAST_FILTER_LIST */
383 # if !(EFSYS_OPT_FALCON || EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON)
384 # error "BIST requires FALCON or SIENA or HUNTINGTON"
386 #endif /* EFSYS_OPT_BIST */
388 #endif /* _SYS_EFX_CHECK_H */