4800f772bf9c3bf02f860546cc359cb754a82e7e
[dpdk.git] / drivers / net / sfc / base / efx_check.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright (c) 2012-2018 Solarflare Communications Inc.
4  * All rights reserved.
5  */
6
7 #ifndef _SYS_EFX_CHECK_H
8 #define _SYS_EFX_CHECK_H
9
10 #include "efsys.h"
11
12 /*
13  * Check that the efsys.h header in client code has a valid combination of
14  * EFSYS_OPT_xxx options.
15  *
16  * NOTE: Keep checks for obsolete options here to ensure that they are removed
17  * from client code (and do not reappear in merges from other branches).
18  */
19
20 /* Check family options for EF10 architecture controllers. */
21 #define EFX_OPTS_EF10() \
22         (EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
23
24 #ifdef EFSYS_OPT_FALCON
25 # error "FALCON is obsolete and is not supported."
26 #endif
27
28 #if EFSYS_OPT_BOOTCFG
29 /* Support NVRAM based boot config */
30 # if !EFSYS_OPT_NVRAM
31 #  error "BOOTCFG requires NVRAM"
32 # endif
33 #endif /* EFSYS_OPT_BOOTCFG */
34
35 #if EFSYS_OPT_CHECK_REG
36 /* Verify chip implements accessed registers */
37 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
38 #  error "CHECK_REG requires EF10 arch or SIENA"
39 # endif
40 #endif /* EFSYS_OPT_CHECK_REG */
41
42 #if EFSYS_OPT_DECODE_INTR_FATAL
43 /* Decode fatal errors */
44 # if !EFSYS_OPT_SIENA
45 #  error "INTR_FATAL requires SIENA"
46 # endif
47 #endif /* EFSYS_OPT_DECODE_INTR_FATAL */
48
49 #if EFSYS_OPT_DIAG
50 /* Support diagnostic hardware tests */
51 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
52 #  error "DIAG requires EF10 arch or SIENA"
53 # endif
54 #endif /* EFSYS_OPT_DIAG */
55
56 #if EFSYS_OPT_EV_PREFETCH
57 /* Support optimized EVQ data access */
58 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
59 #  error "EV_PREFETCH requires EF10 arch or SIENA"
60 # endif
61 #endif /* EFSYS_OPT_EV_PREFETCH */
62
63 #ifdef EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE
64 # error "FALCON_NIC_CFG_OVERRIDE is obsolete and is not supported."
65 #endif
66
67 #if EFSYS_OPT_FILTER
68 /* Support hardware packet filters */
69 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
70 #  error "FILTER requires EF10 arch or SIENA"
71 # endif
72 #endif /* EFSYS_OPT_FILTER */
73
74 #if EFX_OPTS_EF10()
75 # if !EFSYS_OPT_FILTER
76 #  error "EF10 arch requires FILTER"
77 # endif
78 #endif /* EFX_OPTS_EF10() */
79
80 #if EFSYS_OPT_LOOPBACK
81 /* Support hardware loopback modes */
82 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
83 #  error "LOOPBACK requires EF10 arch or SIENA"
84 # endif
85 #endif /* EFSYS_OPT_LOOPBACK */
86
87 #ifdef EFSYS_OPT_MAC_FALCON_GMAC
88 # error "MAC_FALCON_GMAC is obsolete and is not supported."
89 #endif
90
91 #ifdef EFSYS_OPT_MAC_FALCON_XMAC
92 # error "MAC_FALCON_XMAC is obsolete and is not supported."
93 #endif
94
95 #if EFSYS_OPT_MAC_STATS
96 /* Support MAC statistics */
97 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
98 #  error "MAC_STATS requires EF10 arch or SIENA"
99 # endif
100 #endif /* EFSYS_OPT_MAC_STATS */
101
102 #if EFSYS_OPT_MCDI
103 /* Support management controller messages */
104 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
105 #  error "MCDI requires EF10 arch or SIENA"
106 # endif
107 #endif /* EFSYS_OPT_MCDI */
108
109 #if (EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
110 # if !EFSYS_OPT_MCDI
111 #  error "EF10 arch or SIENA requires MCDI"
112 # endif
113 #endif
114
115 #if EFSYS_OPT_MCDI_LOGGING
116 /* Support MCDI logging */
117 # if !EFSYS_OPT_MCDI
118 #  error "MCDI_LOGGING requires MCDI"
119 # endif
120 #endif /* EFSYS_OPT_MCDI_LOGGING */
121
122 #if EFSYS_OPT_MCDI_PROXY_AUTH
123 /* Support MCDI proxy authorization */
124 # if !EFSYS_OPT_MCDI
125 #  error "MCDI_PROXY_AUTH requires MCDI"
126 # endif
127 #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */
128
129 #ifdef EFSYS_OPT_MON_LM87
130 # error "MON_LM87 is obsolete and is not supported."
131 #endif
132
133 #ifdef EFSYS_OPT_MON_MAX6647
134 # error "MON_MAX6647 is obsolete and is not supported."
135 #endif
136
137 #ifdef EFSYS_OPT_MON_NULL
138 # error "MON_NULL is obsolete and is not supported."
139 #endif
140
141 #ifdef EFSYS_OPT_MON_SIENA
142 #  error "MON_SIENA is obsolete (replaced by MON_MCDI)."
143 #endif
144
145 #ifdef EFSYS_OPT_MON_HUNTINGTON
146 #  error "MON_HUNTINGTON is obsolete (replaced by MON_MCDI)."
147 #endif
148
149 #if EFSYS_OPT_MON_STATS
150 /* Support monitor statistics (voltage/temperature) */
151 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
152 #  error "MON_STATS requires EF10 arch or SIENA"
153 # endif
154 #endif /* EFSYS_OPT_MON_STATS */
155
156 #if EFSYS_OPT_MON_MCDI
157 /* Support Monitor via mcdi */
158 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
159 #  error "MON_MCDI requires EF10 arch or SIENA"
160 # endif
161 #endif /* EFSYS_OPT_MON_MCDI*/
162
163 #if EFSYS_OPT_NAMES
164 /* Support printable names for statistics */
165 # if !(EFSYS_OPT_LOOPBACK || EFSYS_OPT_MAC_STATS || EFSYS_OPT_MCDI || \
166         EFSYS_MON_STATS || EFSYS_OPT_PHY_STATS || EFSYS_OPT_QSTATS)
167 #  error "NAMES requires LOOPBACK or xxxSTATS or MCDI"
168 # endif
169 #endif /* EFSYS_OPT_NAMES */
170
171 #if EFSYS_OPT_NVRAM
172 /* Support non volatile configuration */
173 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
174 #  error "NVRAM requires EF10 arch or SIENA"
175 # endif
176 #endif /* EFSYS_OPT_NVRAM */
177
178 #if EFSYS_OPT_IMAGE_LAYOUT
179 /* Support signed image layout handling */
180 # if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
181 #  error "IMAGE_LAYOUT requires MEDFORD or MEDFORD2"
182 # endif
183 #endif /* EFSYS_OPT_IMAGE_LAYOUT */
184
185 #ifdef EFSYS_OPT_NVRAM_FALCON_BOOTROM
186 # error "NVRAM_FALCON_BOOTROM is obsolete and is not supported."
187 #endif
188
189 #ifdef EFSYS_OPT_NVRAM_SFT9001
190 # error "NVRAM_SFT9001 is obsolete and is not supported."
191 #endif
192
193 #ifdef EFSYS_OPT_NVRAM_SFX7101
194 # error "NVRAM_SFX7101 is obsolete and is not supported."
195 #endif
196
197 #ifdef EFSYS_OPT_PCIE_TUNE
198 # error "PCIE_TUNE is obsolete and is not supported."
199 #endif
200
201 #ifdef EFSYS_OPT_PHY_BIST
202 # error "PHY_BIST is obsolete (replaced by BIST)."
203 #endif
204
205 #if EFSYS_OPT_PHY_FLAGS
206 /* Support PHY flags */
207 # if !EFSYS_OPT_SIENA
208 #  error "PHY_FLAGS requires SIENA"
209 # endif
210 #endif /* EFSYS_OPT_PHY_FLAGS */
211
212 #if EFSYS_OPT_PHY_LED_CONTROL
213 /* Support for PHY LED control */
214 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
215 #  error "PHY_LED_CONTROL requires EF10 arch or SIENA"
216 # endif
217 #endif /* EFSYS_OPT_PHY_LED_CONTROL */
218
219 #ifdef EFSYS_OPT_PHY_NULL
220 # error "PHY_NULL is obsolete and is not supported."
221 #endif
222
223 #ifdef EFSYS_OPT_PHY_PM8358
224 # error "PHY_PM8358 is obsolete and is not supported."
225 #endif
226
227 #ifdef EFSYS_OPT_PHY_PROPS
228 # error "PHY_PROPS is obsolete and is not supported."
229 #endif
230
231 #ifdef EFSYS_OPT_PHY_QT2022C2
232 # error "PHY_QT2022C2 is obsolete and is not supported."
233 #endif
234
235 #ifdef EFSYS_OPT_PHY_QT2025C
236 # error "PHY_QT2025C is obsolete and is not supported."
237 #endif
238
239 #ifdef EFSYS_OPT_PHY_SFT9001
240 # error "PHY_SFT9001 is obsolete and is not supported."
241 #endif
242
243 #ifdef EFSYS_OPT_PHY_SFX7101
244 # error "PHY_SFX7101 is obsolete and is not supported."
245 #endif
246
247 #if EFSYS_OPT_PHY_STATS
248 /* Support PHY statistics */
249 # if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
250 #  error "PHY_STATS requires SIENA or HUNTINGTON or MEDFORD"
251 # endif
252 #endif /* EFSYS_OPT_PHY_STATS */
253
254 #ifdef EFSYS_OPT_PHY_TXC43128
255 # error "PHY_TXC43128 is obsolete and is not supported."
256 #endif
257
258 #if EFSYS_OPT_QSTATS
259 /* Support EVQ/RXQ/TXQ statistics */
260 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
261 #  error "QSTATS requires EF10 arch or SIENA"
262 # endif
263 #endif /* EFSYS_OPT_QSTATS */
264
265 #ifdef EFSYS_OPT_RX_HDR_SPLIT
266 # error "RX_HDR_SPLIT is obsolete and is not supported"
267 #endif
268
269 #if EFSYS_OPT_RX_SCALE
270 /* Support receive scaling (RSS) */
271 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
272 #  error "RX_SCALE requires EF10 arch or SIENA"
273 # endif
274 #endif /* EFSYS_OPT_RX_SCALE */
275
276 #if EFSYS_OPT_RX_SCATTER
277 /* Support receive scatter DMA */
278 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
279 #  error "RX_SCATTER requires EF10 arch or SIENA"
280 # endif
281 #endif /* EFSYS_OPT_RX_SCATTER */
282
283 #ifdef EFSYS_OPT_STAT_NAME
284 # error "STAT_NAME is obsolete (replaced by NAMES)."
285 #endif
286
287 #if EFSYS_OPT_VPD
288 /* Support PCI Vital Product Data (VPD) */
289 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
290 #  error "VPD requires EF10 arch or SIENA"
291 # endif
292 #endif /* EFSYS_OPT_VPD */
293
294 #ifdef EFSYS_OPT_WOL
295 # error "WOL is obsolete and is not supported"
296 #endif /* EFSYS_OPT_WOL */
297
298 #ifdef EFSYS_OPT_MCAST_FILTER_LIST
299 #  error "MCAST_FILTER_LIST is obsolete and is not supported"
300 #endif
301
302 #if EFSYS_OPT_BIST
303 /* Support BIST */
304 # if !(EFX_OPTS_EF10() || EFSYS_OPT_SIENA)
305 #  error "BIST requires EF10 arch or SIENA"
306 # endif
307 #endif /* EFSYS_OPT_BIST */
308
309 #if EFSYS_OPT_LICENSING
310 /* Support MCDI licensing API */
311 # if !EFSYS_OPT_MCDI
312 #  error "LICENSING requires MCDI"
313 # endif
314 # if !EFSYS_HAS_UINT64
315 #  error "LICENSING requires UINT64"
316 # endif
317 #endif /* EFSYS_OPT_LICENSING */
318
319 #if EFSYS_OPT_ALLOW_UNCONFIGURED_NIC
320 /* Support adapters with missing static config (for factory use only) */
321 # if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
322 #  error "ALLOW_UNCONFIGURED_NIC requires MEDFORD or MEDFORD2"
323 # endif
324 #endif /* EFSYS_OPT_ALLOW_UNCONFIGURED_NIC */
325
326 #if EFSYS_OPT_RX_PACKED_STREAM
327 /* Support packed stream mode */
328 # if !EFX_OPTS_EF10()
329 #  error "PACKED_STREAM requires EF10 arch"
330 # endif
331 #endif
332
333 #if EFSYS_OPT_RX_ES_SUPER_BUFFER
334 /* Support equal stride super-buffer mode */
335 # if !(EFSYS_OPT_MEDFORD2)
336 #  error "ES_SUPER_BUFFER requires MEDFORD2"
337 # endif
338 #endif
339
340 /* Support hardware assistance for tunnels */
341 #if EFSYS_OPT_TUNNEL
342 # if !(EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2)
343 #  error "TUNNEL requires MEDFORD or MEDFORD2"
344 # endif
345 #endif /* EFSYS_OPT_TUNNEL */
346
347 #if EFSYS_OPT_FW_SUBVARIANT_AWARE
348 /* Advertise that the driver is firmware subvariant aware */
349 # if !(EFSYS_OPT_MEDFORD2)
350 #  error "FW_SUBVARIANT_AWARE requires MEDFORD2"
351 # endif
352 #endif
353
354 #endif /* _SYS_EFX_CHECK_H */