sym_conf.h revision 53790
1/*
2 *  Device driver optimized for the Symbios/LSI 53C896/53C895A/53C1010
3 *  PCI-SCSI controllers.
4 *
5 *  Copyright (C) 1999  Gerard Roudier <groudier@club-internet.fr>
6 *
7 *  This driver also supports the following Symbios/LSI PCI-SCSI chips:
8 *	53C810A, 53C825A, 53C860, 53C875, 53C876, 53C885, 53C895.
9 *
10 *  but does not support earlier chips as the following ones:
11 *	53C810, 53C815, 53C825.
12 *
13 *  This driver for FreeBSD-CAM is derived from the Linux sym53c8xx driver.
14 *  Copyright (C) 1998-1999  Gerard Roudier
15 *
16 *  The sym53c8xx driver is derived from the ncr53c8xx driver that had been
17 *  a port of the FreeBSD ncr driver to Linux-1.2.13.
18 *
19 *  The original ncr driver has been written for 386bsd and FreeBSD by
20 *          Wolfgang Stanglmeier        <wolf@cologne.de>
21 *          Stefan Esser                <se@mi.Uni-Koeln.de>
22 *  Copyright (C) 1994  Wolfgang Stanglmeier
23 *
24 *  The initialisation code, and part of the code that addresses
25 *  FreeBSD-CAM services is based on the aic7xxx driver for FreeBSD-CAM
26 *  written by Justin T. Gibbs.
27 *
28 *  Other major contributions:
29 *
30 *  NVRAM detection and reading.
31 *  Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
32 *
33 *-----------------------------------------------------------------------------
34 *
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
37 * are met:
38 * 1. Redistributions of source code must retain the above copyright
39 *    notice, this list of conditions and the following disclaimer.
40 * 2. Redistributions in binary form must reproduce the above copyright
41 *    notice, this list of conditions and the following disclaimer in the
42 *    documentation and/or other materials provided with the distribution.
43 * 3. The name of the author may not be used to endorse or promote products
44 *    derived from this software without specific prior written permission.
45 *
46 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
47 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
49 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
50 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
51 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
52 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
53 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
54 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
55 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 * SUCH DAMAGE.
57 */
58#ifndef SYM_CONF_H
59#define SYM_CONF_H
60
61/*-------------------------------------------------------------------
62 *  Static configuration.
63 *-------------------------------------------------------------------
64 */
65
66/*
67 *  Support for earliest LSI53C1010 boards.
68 *  Commercial chips will be fixed, and then the
69 *  corresponding code will get useless.
70 */
71/* #define	SYMCONF_BROKEN_U3EN_SUPPORT */
72
73/*
74 *  Use Normal IO instead of MMIO.
75 */
76/* #define SYMCONF_IOMAPPED */
77
78/*
79 *  Max tags for a device (logical unit)
80 * 	We use a power of 2, (7) means 2<<7=128
81 *  Maximum is 8 -> 256 tags
82 */
83#define SYMCONF_MAX_TAG_ORDER	(6)
84
85/*
86 *  Max number of scatter/gather entries for en IO.
87 *  Each entry costs 8 bytes in the internal CCB data structure.
88 *  For now 65 should suffice given the BSD O/Ses capabilities.
89 */
90#define SYMCONF_MAX_SG		(33)
91
92/*
93 *  Max number of targets.
94 *  Maximum is 16 and you are advised not to change this value.
95 */
96#define SYMCONF_MAX_TARGET	(16)
97
98/*
99 *  Max number of logical units.
100 *  SPI-2 allows up to 64 logical units, but in real life, target
101 *  that implements more that 7 logical units are pretty rare.
102 *  Anyway, the cost of accepting up to 64 logical unit is low in
103 *  this driver, thus going with the maximum is acceptable.
104 */
105#define SYMCONF_MAX_LUN		(8)
106
107/*
108 *  Max number of IO control blocks queued to the controller.
109 *  Each entry needs 8 bytes and the queues are allocated contiguously.
110 *  Since we donnot want to allocate more than a page, the theorical
111 *  maximum is PAGE_SIZE/8. For safety, we announce a bit less to the
112 *  access method. :)
113 *  When not supplied, as it is suggested, the driver compute some
114 *  good value for this parameter.
115 */
116/* #define SYMCONF_MAX_START	(PAGE_SIZE/8 - 16) */
117
118/*
119 *  Support for NVRAM.
120 */
121#define SYMCONF_NVRAM_SUPPORT
122/* #define SYMCONF_DEBUG_SUPPORT */
123
124/*
125 *  Support for Immediate Arbitration.
126 *  Not advised.
127 */
128/* #define SYMCONF_IARB_SUPPORT */
129
130/*
131 *  Not needed on FreeBSD, since the system allocator
132 *  does provide naturally aligned addresses.
133 */
134#define	SYMCONF_USE_INTERNAL_ALLOCATOR
135
136/*-------------------------------------------------------------------
137 *  Configuration that could be dynamic if it was possible
138 *  to pass arguments to the driver.
139 *-------------------------------------------------------------------
140 */
141
142/*
143 *  HOST default scsi id.
144 */
145#define SYMSETUP_HOST_ID	7
146
147/*
148 *  Max synchronous transfers.
149 */
150#define SYMSETUP_MIN_SYNC	(9)
151
152/*
153 *  Max wide order.
154 */
155#define SYMSETUP_MAX_WIDE	(1)
156
157/*
158 *  Max SCSI offset.
159 */
160#define SYMSETUP_MAX_OFFS	(64)
161/*
162 *  Default number of tags.
163 */
164#define SYMSETUP_MAX_TAG	(64)
165
166/*
167 *  SYMBIOS NVRAM format support.
168 */
169#define SYMSETUP_SYMBIOS_NVRAM	(1)
170
171/*
172 *  TEKRAM NVRAM format support.
173 */
174#define SYMSETUP_TEKRAM_NVRAM	(1)
175
176/*
177 *  PCI parity checking.
178 */
179#define SYMSETUP_PCI_PARITY	(1)
180
181/*
182 *  SCSI parity checking.
183 */
184#define SYMSETUP_SCSI_PARITY	(1)
185
186/*
187 *  SCSI activity LED.
188 */
189#define SYMSETUP_SCSI_LED	(0)
190
191/*
192 *  SCSI differential.
193 */
194#define SYMSETUP_SCSI_DIFF	(0)
195
196/*
197 *  IRQ mode.
198 */
199#define SYMSETUP_IRQ_MODE	(0)
200
201/*
202 *  Check SCSI BUS signal on reset.
203 */
204#define SYMSETUP_SCSI_BUS_CHECK	(1)
205
206/*
207 *  Max burst for PCI (1<<value)
208 *  7 means: (1<<7) = 128 DWORDS.
209 */
210#define SYMSETUP_BURST_ORDER	(7)
211
212/*
213 *  Only relevant if IARB support configured.
214 *  - Max number of successive settings of IARB hints.
215 *  - Set IARB on arbitration lost.
216 */
217#define SYMCONF_IARB_MAX 3
218#define SYMCONF_SET_IARB_ON_ARB_LOST 1
219
220/*
221 *  Returning wrong residuals may make problems.
222 *  When zero, this define tells the driver to
223 *  always return 0 as transfer residual.
224 *  Btw, all my testings of residuals have succeeded.
225 */
226#define SYMCONF_RESIDUAL_SUPPORT 1
227
228#endif /* SYM_CONF_H */
229