efx_check.h revision 299320
1/*-
2 * Copyright (c) 2012-2015 Solarflare Communications Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
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.
13 *
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.
25 *
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.
29 *
30 * $FreeBSD: head/sys/dev/sfxge/common/efx_check.h 299320 2016-05-10 07:01:06Z arybchik $
31 */
32
33#ifndef _SYS_EFX_CHECK_H
34#define	_SYS_EFX_CHECK_H
35
36#include "efsys.h"
37
38/*
39 * Check that the efsys.h header in client code has a valid combination of
40 * EFSYS_OPT_xxx options.
41 *
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).
44 */
45
46#ifdef EFSYS_OPT_FALCON
47# error "FALCON is obsolete and is not supported."
48#else
49/* FIXME: remove this after Falcon support has been removed */
50#define	EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE	(0)
51
52#define	EFSYS_OPT_MAC_FALCON_GMAC		(0)
53#define	EFSYS_OPT_MAC_FALCON_XMAC		(0)
54
55#define	EFSYS_OPT_MON_LM87			(0)
56#define	EFSYS_OPT_MON_MAX6647			(0)
57#define	EFSYS_OPT_MON_NULL			(0)
58
59#define	EFSYS_OPT_NVRAM_FALCON_BOOTROM		(0)
60#define	EFSYS_OPT_NVRAM_SFT9001			(0)
61#define	EFSYS_OPT_NVRAM_SFX7101			(0)
62
63#define	EFSYS_OPT_PHY_NULL			(0)
64#define	EFSYS_OPT_PHY_QT2022C2			(0)
65#define	EFSYS_OPT_PHY_QT2025C			(0)
66#define	EFSYS_OPT_PHY_SFT9001			(0)
67#define	EFSYS_OPT_PHY_SFX7101			(0)
68#define	EFSYS_OPT_PHY_TXC43128			(0)
69#endif
70
71/* Support NVRAM based boot config */
72#if EFSYS_OPT_BOOTCFG
73# if !EFSYS_OPT_NVRAM
74#  error "BOOTCFG requires NVRAM"
75# endif
76#endif /* EFSYS_OPT_BOOTCFG */
77
78/* Verify chip implements accessed registers */
79#if EFSYS_OPT_CHECK_REG
80# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
81#  error "CHECK_REG requires SIENA or HUNTINGTON or MEDFORD"
82# endif
83#endif /* EFSYS_OPT_CHECK_REG */
84
85/* Decode fatal errors */
86#if EFSYS_OPT_DECODE_INTR_FATAL
87# if !EFSYS_OPT_SIENA
88#  error "INTR_FATAL requires SIENA"
89# endif
90#endif /* EFSYS_OPT_DECODE_INTR_FATAL */
91
92/* Support diagnostic hardware tests */
93#if EFSYS_OPT_DIAG
94# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
95#  error "DIAG requires SIENA or HUNTINGTON or MEDFORD"
96# endif
97#endif /* EFSYS_OPT_DIAG */
98
99/* Support optimized EVQ data access */
100#if EFSYS_OPT_EV_PREFETCH
101# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
102#  error "EV_PREFETCH requires SIENA or HUNTINGTON or MEDFORD"
103# endif
104#endif /* EFSYS_OPT_EV_PREFETCH */
105
106/* Support overriding the NVRAM and VPD configuration */
107#if EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
108# if !EFSYS_OPT_FALCON
109#  error "FALCON_NIC_CFG_OVERRIDE requires FALCON"
110# endif
111#endif /* EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE */
112
113/* Support hardware packet filters */
114#if EFSYS_OPT_FILTER
115# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
116#  error "FILTER requires SIENA or HUNTINGTON or MEDFORD"
117# endif
118#endif /* EFSYS_OPT_FILTER */
119
120#if (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
121# if !EFSYS_OPT_FILTER
122#  error "HUNTINGTON or MEDFORD requires FILTER"
123# endif
124#endif /* EFSYS_OPT_HUNTINGTON */
125
126/* Support hardware loopback modes */
127#if EFSYS_OPT_LOOPBACK
128# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
129#  error "LOOPBACK requires SIENA or HUNTINGTON or MEDFORD"
130# endif
131#endif /* EFSYS_OPT_LOOPBACK */
132
133/* Support Falcon GMAC */
134#if EFSYS_OPT_MAC_FALCON_GMAC
135# if !EFSYS_OPT_FALCON
136#  error "MAC_FALCON_GMAC requires FALCON"
137# endif
138#endif /* EFSYS_OPT_MAC_FALCON_GMAC */
139
140/* Support Falcon XMAC */
141#if EFSYS_OPT_MAC_FALCON_XMAC
142# if !EFSYS_OPT_FALCON
143#  error "MAC_FALCON_XMAC requires FALCON"
144# endif
145#endif /* EFSYS_OPT_MAC_FALCON_XMAC */
146
147/* Support MAC statistics */
148#if EFSYS_OPT_MAC_STATS
149# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
150#  error "MAC_STATS requires SIENA or HUNTINGTON or MEDFORD"
151# endif
152#endif /* EFSYS_OPT_MAC_STATS */
153
154/* Support management controller messages */
155#if EFSYS_OPT_MCDI
156# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
157#  error "MCDI requires SIENA or HUNTINGTON or MEDFORD"
158# endif
159#endif /* EFSYS_OPT_MCDI */
160
161#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
162# if !EFSYS_OPT_MCDI
163#  error "SIENA or HUNTINGTON or MEDFORD requires MCDI"
164# endif
165#endif
166
167/* Support MCDI logging */
168#if EFSYS_OPT_MCDI_LOGGING
169# if !EFSYS_OPT_MCDI
170#  error "MCDI_LOGGING requires MCDI"
171# endif
172#endif /* EFSYS_OPT_MCDI_LOGGING */
173
174/* Support MCDI proxy authorization */
175#if EFSYS_OPT_MCDI_PROXY_AUTH
176# if !EFSYS_OPT_MCDI
177#  error "MCDI_PROXY_AUTH requires MCDI"
178# endif
179#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */
180
181/* Support LM87 monitor */
182#if EFSYS_OPT_MON_LM87
183# if !EFSYS_OPT_FALCON
184#  error "MON_LM87 requires FALCON"
185# endif
186#endif /* EFSYS_OPT_MON_LM87 */
187
188/* Support MAX6647 monitor */
189#if EFSYS_OPT_MON_MAX6647
190# if !EFSYS_OPT_FALCON
191#  error "MON_MAX6647 requires FALCON"
192# endif
193#endif /* EFSYS_OPT_MON_MAX6647 */
194
195/* Support null monitor */
196#if EFSYS_OPT_MON_NULL
197# if !EFSYS_OPT_FALCON
198#  error "MON_NULL requires FALCON"
199# endif
200#endif /* EFSYS_OPT_MON_NULL */
201
202/* Obsolete option */
203#ifdef EFSYS_OPT_MON_SIENA
204#  error "MON_SIENA is obsolete (replaced by MON_MCDI)."
205#endif /* EFSYS_OPT_MON_SIENA*/
206
207/* Obsolete option */
208#ifdef EFSYS_OPT_MON_HUNTINGTON
209#  error "MON_HUNTINGTON is obsolete (replaced by MON_MCDI)."
210#endif /* EFSYS_OPT_MON_HUNTINGTON*/
211
212/* Support monitor statistics (voltage/temperature) */
213#if EFSYS_OPT_MON_STATS
214# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
215#  error "MON_STATS requires SIENA or HUNTINGTON or MEDFORD"
216# endif
217#endif /* EFSYS_OPT_MON_STATS */
218
219/* Support Monitor via mcdi */
220#if EFSYS_OPT_MON_MCDI
221# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
222#  error "MON_MCDI requires SIENA or HUNTINGTON or MEDFORD"
223# endif
224#endif /* EFSYS_OPT_MON_MCDI*/
225
226/* Support printable names for statistics */
227#if EFSYS_OPT_NAMES
228# if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
229	EFSYS_MON_STATS || EFSYS_OPT_PHY_PROPS || EFSYS_OPT_PHY_STATS || \
230	EFSYS_OPT_QSTATS)
231#  error "NAMES requires LOOPBACK or xxxSTATS or MCDI or PHY_PROPS"
232# endif
233#endif /* EFSYS_OPT_NAMES */
234
235/* Support non volatile configuration */
236#if EFSYS_OPT_NVRAM
237# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
238#  error "NVRAM requires SIENA or HUNTINGTON or MEDFORD"
239# endif
240#endif /* EFSYS_OPT_NVRAM */
241
242/* Support Falcon bootrom */
243#if EFSYS_OPT_NVRAM_FALCON_BOOTROM
244# if !EFSYS_OPT_NVRAM
245#  error "NVRAM_FALCON_BOOTROM requires NVRAM"
246# endif
247# if !EFSYS_OPT_FALCON
248#  error "NVRAM_FALCON_BOOTROM requires FALCON"
249# endif
250#endif /* EFSYS_OPT_NVRAM_FALCON_BOOTROM */
251
252/* Support NVRAM config for SFT9001 */
253#if EFSYS_OPT_NVRAM_SFT9001
254# if !EFSYS_OPT_NVRAM
255#  error "NVRAM_SFT9001 requires NVRAM"
256# endif
257# if !EFSYS_OPT_FALCON
258#  error "NVRAM_SFT9001 requires FALCON"
259# endif
260#endif /* EFSYS_OPT_NVRAM_SFT9001 */
261
262/* Support NVRAM config for SFX7101 */
263#if EFSYS_OPT_NVRAM_SFX7101
264# if !EFSYS_OPT_NVRAM
265#  error "NVRAM_SFX7101 requires NVRAM"
266# endif
267# if !EFSYS_OPT_FALCON
268#  error "NVRAM_SFX7101 requires FALCON"
269# endif
270#endif /* EFSYS_OPT_NVRAM_SFX7101 */
271
272#ifdef EFSYS_OPT_PCIE_TUNE
273# error "PCIE_TUNE is obsolete and is not supported."
274#endif
275
276/* Obsolete option */
277#ifdef EFSYS_OPT_PHY_BIST
278# error "PHY_BIST is obsolete (replaced by BIST)."
279#endif
280
281/* Support PHY flags */
282#if EFSYS_OPT_PHY_FLAGS
283# if !EFSYS_OPT_SIENA
284#  error "PHY_FLAGS requires SIENA"
285# endif
286#endif /* EFSYS_OPT_PHY_FLAGS */
287
288/* Support for PHY LED control */
289#if EFSYS_OPT_PHY_LED_CONTROL
290# if !EFSYS_OPT_SIENA
291#  error "PHY_LED_CONTROL requires SIENA"
292# endif
293#endif /* EFSYS_OPT_PHY_LED_CONTROL */
294
295/* Support NULL PHY */
296#if EFSYS_OPT_PHY_NULL
297# if !EFSYS_OPT_FALCON
298#  error "PHY_NULL requires FALCON"
299# endif
300#endif /* EFSYS_OPT_PHY_NULL */
301
302/* Obsolete option */
303#ifdef EFSYS_OPT_PHY_PM8358
304# error "EFSYS_OPT_PHY_PM8358 is obsolete and is not supported."
305#endif
306
307/* Support PHY properties */
308#if EFSYS_OPT_PHY_PROPS
309# if !EFSYS_OPT_SIENA
310#  error "PHY_PROPS requires SIENA"
311# endif
312#endif /* EFSYS_OPT_PHY_PROPS */
313
314/* Support QT2022C2 PHY */
315#if EFSYS_OPT_PHY_QT2022C2
316# if !EFSYS_OPT_FALCON
317#  error "PHY_QT2022C2 requires FALCON"
318# endif
319#endif /* EFSYS_OPT_PHY_QT2022C2 */
320
321/* Support QT2025C PHY (Wakefield NIC) */
322#if EFSYS_OPT_PHY_QT2025C
323# if !EFSYS_OPT_FALCON
324#  error "PHY_QT2025C requires FALCON"
325# endif
326#endif /* EFSYS_OPT_PHY_QT2025C */
327
328/* Support SFT9001 PHY (Starbolt NIC) */
329#if EFSYS_OPT_PHY_SFT9001
330# if !EFSYS_OPT_FALCON
331#  error "PHY_SFT9001 requires FALCON"
332# endif
333#endif /* EFSYS_OPT_PHY_SFT9001 */
334
335/* Support SFX7101 PHY (SFE4001 NIC) */
336#if EFSYS_OPT_PHY_SFX7101
337# if !EFSYS_OPT_FALCON
338#  error "PHY_SFX7101 requires FALCON"
339# endif
340#endif /* EFSYS_OPT_PHY_SFX7101 */
341
342/* Support PHY statistics */
343#if EFSYS_OPT_PHY_STATS
344# if !EFSYS_OPT_SIENA
345#  error "PHY_STATS requires SIENA"
346# endif
347#endif /* EFSYS_OPT_PHY_STATS */
348
349/* Support TXC43128 PHY (SFE4003 NIC) */
350#if EFSYS_OPT_PHY_TXC43128
351# if !EFSYS_OPT_FALCON
352#  error "PHY_TXC43128 requires FALCON"
353# endif
354#endif /* EFSYS_OPT_PHY_TXC43128 */
355
356/* Support EVQ/RXQ/TXQ statistics */
357#if EFSYS_OPT_QSTATS
358# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
359#  error "QSTATS requires SIENA or HUNTINGTON or MEDFORD"
360# endif
361#endif /* EFSYS_OPT_QSTATS */
362
363/* Obsolete option */
364#ifdef EFSYS_OPT_RX_HDR_SPLIT
365# error "RX_HDR_SPLIT is obsolete and is not supported"
366#endif /* EFSYS_OPT_RX_HDR_SPLIT */
367
368/* Support receive scaling (RSS) */
369#if EFSYS_OPT_RX_SCALE
370# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
371#  error "RX_SCALE requires SIENA or HUNTINGTON or MEDFORD"
372# endif
373#endif /* EFSYS_OPT_RX_SCALE */
374
375/* Support receive scatter DMA */
376#if EFSYS_OPT_RX_SCATTER
377# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
378#  error "RX_SCATTER requires SIENA or HUNTINGTON or MEDFORD"
379# endif
380#endif /* EFSYS_OPT_RX_SCATTER */
381
382/* Obsolete option */
383#ifdef EFSYS_OPT_STAT_NAME
384# error "STAT_NAME is obsolete (replaced by NAMES)."
385#endif
386
387/* Support PCI Vital Product Data (VPD) */
388#if EFSYS_OPT_VPD
389# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
390#  error "VPD requires SIENA or HUNTINGTON or MEDFORD"
391# endif
392#endif /* EFSYS_OPT_VPD */
393
394/* Support Wake on LAN */
395#if EFSYS_OPT_WOL
396# if !EFSYS_OPT_SIENA
397#  error "WOL requires SIENA"
398# endif
399#endif /* EFSYS_OPT_WOL */
400
401/* Obsolete option */
402#ifdef EFSYS_OPT_MCAST_FILTER_LIST
403#  error "MCAST_FILTER_LIST is obsolete and is not supported"
404#endif /* EFSYS_OPT_MCAST_FILTER_LIST */
405
406/* Support BIST */
407#if EFSYS_OPT_BIST
408# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
409#  error "BIST requires SIENA or HUNTINGTON or MEDFORD"
410# endif
411#endif /* EFSYS_OPT_BIST */
412
413/* Support MCDI licensing API */
414#if EFSYS_OPT_LICENSING
415# if !EFSYS_OPT_MCDI
416#  error "LICENSING requires MCDI"
417# endif
418# if !EFSYS_HAS_UINT64
419#  error "LICENSING requires UINT64"
420# endif
421#endif /* EFSYS_OPT_LICENSING */
422
423
424#endif /* _SYS_EFX_CHECK_H */
425