2 * SPDX-License-Identifier: BSD-3-Clause
4 * Device driver optimized for the Symbios/LSI 53C896/53C895A/53C1010
5 * PCI-SCSI controllers.
7 * Copyright (C) 1999-2001 Gerard Roudier <groudier@free.fr>
9 * This driver also supports the following Symbios/LSI PCI-SCSI chips:
10 * 53C810A, 53C825A, 53C860, 53C875, 53C876, 53C885, 53C895,
11 * 53C810, 53C815, 53C825 and the 53C1510D is 53C8XX mode.
14 * This driver for FreeBSD-CAM is derived from the Linux sym53c8xx driver.
15 * Copyright (C) 1998-1999 Gerard Roudier
17 * The sym53c8xx driver is derived from the ncr53c8xx driver that had been
18 * a port of the FreeBSD ncr driver to Linux-1.2.13.
20 * The original ncr driver has been written for 386bsd and FreeBSD by
21 * Wolfgang Stanglmeier <wolf@cologne.de>
22 * Stefan Esser <se@mi.Uni-Koeln.de>
23 * Copyright (C) 1994 Wolfgang Stanglmeier
25 * The initialisation code, and part of the code that addresses
26 * FreeBSD-CAM services is based on the aic7xxx driver for FreeBSD-CAM
27 * written by Justin T. Gibbs.
29 * Other major contributions:
31 * NVRAM detection and reading.
32 * Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
34 *-----------------------------------------------------------------------------
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. The name of the author may not be used to endorse or promote products
45 * derived from this software without specific prior written permission.
47 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
48 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
51 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
65 /*-------------------------------------------------------------------
66 * Static configuration.
67 *-------------------------------------------------------------------
71 * Also support early NCR 810, 815 and 825 chips.
73 #define SYM_CONF_GENERIC_SUPPORT
76 * Use Normal IO instead of MMIO.
78 /* #define SYM_CONF_IOMAPPED */
81 * Max tags for a device (logical unit)
82 * We use a power of 2, (7) means 2<<7=128
83 * Maximum is 8 -> 256 tags
85 #define SYM_CONF_MAX_TAG_ORDER (6)
89 * We need to ensure 16 MB boundaries not to be crossed during DMA of
90 * each segment, due to some chips being flawed.
92 #define SYM_CONF_DMA_BOUNDARY (1UL << 24)
95 * Max number of scatter/gather entries for an I/O.
96 * Each entry costs 8 bytes in the internal CCB data structure.
97 * We use at most 33 segments but also no more than required for handling
100 #define SYM_CONF_MAX_SG (MIN(33, (MAXPHYS / PAGE_SIZE) + 1))
103 * Max number of targets.
104 * Maximum is 16 and you are advised not to change this value.
106 #define SYM_CONF_MAX_TARGET (16)
109 * Max number of logical units.
110 * SPI-2 allows up to 64 logical units, but in real life, target
111 * that implements more that 7 logical units are pretty rare.
112 * Anyway, the cost of accepting up to 64 logical unit is low in
113 * this driver, thus going with the maximum is acceptable.
115 #define SYM_CONF_MAX_LUN (64)
118 * Max number of IO control blocks queued to the controller.
119 * Each entry needs 8 bytes and the queues are allocated contiguously.
120 * Since we donnot want to allocate more than a page, the theorical
121 * maximum is PAGE_SIZE/8. For safety, we announce a bit less to the
123 * When not supplied, as it is suggested, the driver compute some
124 * good value for this parameter.
126 /* #define SYM_CONF_MAX_START (PAGE_SIZE/8 - 16) */
131 #define SYM_CONF_NVRAM_SUPPORT
132 /* #define SYM_CONF_NVRAM_SUPPORT */
135 * Support for Immediate Arbitration.
138 /* #define SYM_CONF_IARB_SUPPORT */
140 /*-------------------------------------------------------------------
141 * Configuration that could be dynamic if it was possible
142 * to pass arguments to the driver.
143 *-------------------------------------------------------------------
147 * HOST default scsi id.
149 #define SYM_SETUP_HOST_ID 7
152 * Max synchronous transfers.
154 #define SYM_SETUP_MIN_SYNC (9)
159 #define SYM_SETUP_MAX_WIDE (1)
164 #define SYM_SETUP_MAX_OFFS (63)
167 * Default number of tags.
169 #define SYM_SETUP_MAX_TAG (1<<SYM_CONF_MAX_TAG_ORDER)
172 * SYMBIOS NVRAM format support.
174 #define SYM_SETUP_SYMBIOS_NVRAM (1)
177 * TEKRAM NVRAM format support.
179 #define SYM_SETUP_TEKRAM_NVRAM (1)
182 * PCI parity checking.
183 * It should not be an option, but some poor or broken
184 * PCI-HOST bridges have been reported to make problems
185 * when this feature is enabled.
186 * Setting this option to 0 tells the driver not to
187 * enable the checking against PCI parity.
189 #ifndef SYM_SETUP_PCI_PARITY
190 #define SYM_SETUP_PCI_PARITY (1)
194 * SCSI parity checking.
196 #define SYM_SETUP_SCSI_PARITY (1)
201 #define SYM_SETUP_SCSI_LED (0)
204 * SCSI High Voltage Differential support.
206 * HVD/LVD/SE capable controllers (895, 895A, 896, 1010)
207 * report the actual SCSI BUS mode from the STEST4 IO
210 * But for HVD/SE only capable chips (825a, 875, 885),
211 * the driver uses some heuristic to probe against HVD.
212 * Normally, the chip senses the DIFFSENS signal and
213 * should switch its BUS tranceivers to high impedance
214 * in situation of the driver having been wrong about
215 * the actual BUS mode. May-be, the BUS mode probing of
216 * the driver is safe, but, given that it may be partially
217 * based on some previous IO register settings, it
218 * cannot be stated so. Thus, decision has been taken
219 * to require a user option to be set for the DIFF probing
220 * to be applied for the 825a, 875 and 885 chips.
222 * This setup option works as follows:
224 * 0 -> HVD only supported for 895, 895A, 896, 1010.
225 * 1 -> HVD probed for 825A, 875, 885.
226 * 2 -> HVD assumed for 825A, 875, 885 (not advised).
228 #ifndef SYM_SETUP_SCSI_DIFF
229 #define SYM_SETUP_SCSI_DIFF (0)
235 #define SYM_SETUP_IRQ_MODE (0)
238 * Check SCSI BUS signal on reset.
240 #define SYM_SETUP_SCSI_BUS_CHECK (1)
243 * Max burst for PCI (1<<value)
244 * 7 means: (1<<7) = 128 DWORDS.
246 #define SYM_SETUP_BURST_ORDER (7)
249 * Only relevant if IARB support configured.
250 * - Max number of successive settings of IARB hints.
251 * - Set IARB on arbitration lost.
253 #define SYM_CONF_IARB_MAX 3
254 #define SYM_CONF_SET_IARB_ON_ARB_LOST 1
257 * Returning wrong residuals may make problems.
258 * When zero, this define tells the driver to
259 * always return 0 as transfer residual.
260 * Btw, all my testings of residuals have succeeded.
262 #define SYM_CONF_RESIDUAL_SUPPORT 1
265 * Supported maximum number of LUNs to announce to
267 * The driver supports up to 64 LUNs per target as
268 * required by SPI-2/SPI-3. However some SCSI devices
269 * designed prior to these specifications or not being
270 * conformant may be highly confused when they are
271 * asked about a LUN > 7.
273 #ifndef SYM_SETUP_MAX_LUN
274 #define SYM_SETUP_MAX_LUN (8)
278 * Low priority probe map.
280 * This option is used as a bitmap to tell the driver
281 * about chips that are to be claimed with a low priority
282 * (-2000) by the probe method. This allows any other driver
283 * that may return some higher priority value for the same
284 * chips to take precedence over this driver (sym).
285 * This option may be used when both the ncr driver and this
286 * driver are configured.
288 * Bits are to be coded as follows:
290 * 0x02 -> 825a, 875, 885, 895
291 * 0x04 -> 895a, 896, 1510d
293 * 0x40 -> 810, 815, 825
295 * For example, value 5 tells the driver to claim support
296 * for 810a, 860, 895a, 896 and 1510d with low priority,
297 * allowing the ncr driver to take precedence if configured.
299 #ifndef SYM_SETUP_LP_PROBE_MAP
300 #define SYM_SETUP_LP_PROBE_MAP 0
303 #endif /* SYM_CONF_H */