2 * Device driver for the SYMBIOS/LSILOGIC 53C8XX and 53C1010 family
3 * of PCI-SCSI IO processors.
5 * Copyright (C) 1999-2001 Gerard Roudier <groudier@free.fr>
7 * This driver is derived from the Linux sym53c8xx driver.
8 * Copyright (C) 1998-2000 Gerard Roudier
10 * The sym53c8xx driver is derived from the ncr53c8xx driver that had been
11 * a port of the FreeBSD ncr driver to Linux-1.2.13.
13 * The original ncr driver has been written for 386bsd and FreeBSD by
14 * Wolfgang Stanglmeier <wolf@cologne.de>
15 * Stefan Esser <se@mi.Uni-Koeln.de>
16 * Copyright (C) 1994 Wolfgang Stanglmeier
18 * Other major contributions:
20 * NVRAM detection and reading.
21 * Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
23 *-----------------------------------------------------------------------------
25 * Redistribution and use in source and binary forms, with or without
26 * modification, are permitted provided that the following conditions
28 * 1. Redistributions of source code must retain the above copyright
29 * notice, this list of conditions and the following disclaimer.
30 * 2. The name of the author may not be used to endorse or promote products
31 * derived from this software without specific prior written permission.
33 * Where this Software is combined with software released under the terms of
34 * the GNU Public License ("GPL") and the terms of the GPL would require the
35 * combined work to also be released under the terms of the GPL, the terms
36 * and conditions of this License will apply in addition to those of the
37 * GPL with the exception of any terms or conditions of this License that
38 * conflict with, or are expressly prohibited by, the GPL.
40 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
41 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
44 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 #include <linux/config.h>
58 #ifdef CONFIG_SCSI_SYM53C8XX_IOMAPPED
59 #define SYM_CONF_IOMAPPED
63 * DMA addressing mode.
65 * 0 : 32 bit addressing for all chips.
66 * 1 : 40 bit addressing when supported by chip.
67 * 2 : 64 bit addressing when supported by chip,
68 * limited to 16 segments of 4 GB -> 64 GB max.
70 #define SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
76 #define SYM_CONF_NVRAM_SUPPORT (1)
80 * These options are not tunable from 'make config'
83 #define SYM_LINUX_PROC_INFO_SUPPORT
84 #define SYM_LINUX_BOOT_COMMAND_LINE_SUPPORT
85 #define SYM_LINUX_USER_COMMAND_SUPPORT
86 #define SYM_LINUX_USER_INFO_SUPPORT
87 #define SYM_LINUX_DEBUG_CONTROL_SUPPORT
91 * Also handle old NCR chips if not (0).
93 #define SYM_CONF_GENERIC_SUPPORT (1)
96 * Allow tags from 2 to 256, default 8
98 #ifndef CONFIG_SCSI_SYM53C8XX_MAX_TAGS
99 #define CONFIG_SCSI_SYM53C8XX_MAX_TAGS (8)
102 #if CONFIG_SCSI_SYM53C8XX_MAX_TAGS < 2
103 #define SYM_CONF_MAX_TAG (2)
104 #elif CONFIG_SCSI_SYM53C8XX_MAX_TAGS > 256
105 #define SYM_CONF_MAX_TAG (256)
107 #define SYM_CONF_MAX_TAG CONFIG_SCSI_SYM53C8XX_MAX_TAGS
110 #ifndef CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS
111 #define CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS SYM_CONF_MAX_TAG
115 * Anyway, we configure the driver for at least 64 tags per LUN. :)
117 #if SYM_CONF_MAX_TAG <= 64
118 #define SYM_CONF_MAX_TAG_ORDER (6)
119 #elif SYM_CONF_MAX_TAG <= 128
120 #define SYM_CONF_MAX_TAG_ORDER (7)
122 #define SYM_CONF_MAX_TAG_ORDER (8)
126 * Max number of SG entries.
128 #define SYM_CONF_MAX_SG (96)
131 * Driver setup structure.
133 * This structure is initialized from linux config options.
134 * It can be overridden at boot-up by the boot command line.
136 struct sym_driver_setup
{
142 u_char scsi_bus_check
;
145 u_char reverse_probe
;
154 #define SYM_SETUP_MAX_TAG sym_driver_setup.max_tag
155 #define SYM_SETUP_BURST_ORDER sym_driver_setup.burst_order
156 #define SYM_SETUP_SCSI_LED sym_driver_setup.scsi_led
157 #define SYM_SETUP_SCSI_DIFF sym_driver_setup.scsi_diff
158 #define SYM_SETUP_IRQ_MODE sym_driver_setup.irq_mode
159 #define SYM_SETUP_SCSI_BUS_CHECK sym_driver_setup.scsi_bus_check
160 #define SYM_SETUP_HOST_ID sym_driver_setup.host_id
162 /* Always enable parity. */
163 #define SYM_SETUP_PCI_PARITY 1
164 #define SYM_SETUP_SCSI_PARITY 1
169 * Can be overriden at startup by a command line.
171 #define SYM_LINUX_DRIVER_SETUP { \
172 .max_tag = CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS, \
177 .scsi_bus_check = 1, \
179 .reverse_probe = 0, \
187 * Boot fail safe setup.
189 * Override initial setup from boot command line:
192 #define SYM_LINUX_DRIVER_SAFE_SETUP { \
198 .scsi_bus_check = 2, \
200 .reverse_probe = 0, \
203 .settle_delay = 10, \
208 * This structure is initialized from linux config options.
209 * It can be overridden at boot-up by the boot command line.
212 struct sym_driver_setup
213 sym_driver_setup
= SYM_LINUX_DRIVER_SETUP
;
214 #ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT
215 u_int sym_debug_flags
= 0;
218 extern struct sym_driver_setup sym_driver_setup
;
219 #ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT
220 extern u_int sym_debug_flags
;
222 #endif /* SYM_GLUE_C */
224 #ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT
225 #define DEBUG_FLAGS sym_debug_flags
227 #define boot_verbose sym_driver_setup.verbose
229 #endif /* SYM53C8XX_H */