1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Device driver for the SYMBIOS/LSILOGIC 53C8XX and 53C1010 family
4 * of PCI-SCSI IO processors.
6 * Copyright (C) 1999-2001 Gerard Roudier <groudier@free.fr>
8 * This driver is derived from the Linux sym53c8xx driver.
9 * Copyright (C) 1998-2000 Gerard Roudier
11 * The sym53c8xx driver is derived from the ncr53c8xx driver that had been
12 * a port of the FreeBSD ncr driver to Linux-1.2.13.
14 * The original ncr driver has been written for 386bsd and FreeBSD by
15 * Wolfgang Stanglmeier <wolf@cologne.de>
16 * Stefan Esser <se@mi.Uni-Koeln.de>
17 * Copyright (C) 1994 Wolfgang Stanglmeier
19 * Other major contributions:
21 * NVRAM detection and reading.
22 * Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
24 *-----------------------------------------------------------------------------
32 * DMA addressing mode.
34 * 0 : 32 bit addressing for all chips.
35 * 1 : 40 bit addressing when supported by chip.
36 * 2 : 64 bit addressing when supported by chip,
37 * limited to 16 segments of 4 GB -> 64 GB max.
39 #define SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
45 #define SYM_CONF_NVRAM_SUPPORT (1)
49 * These options are not tunable from 'make config'
52 #define SYM_LINUX_PROC_INFO_SUPPORT
53 #define SYM_LINUX_USER_COMMAND_SUPPORT
54 #define SYM_LINUX_USER_INFO_SUPPORT
55 #define SYM_LINUX_DEBUG_CONTROL_SUPPORT
59 * Also handle old NCR chips if not (0).
61 #define SYM_CONF_GENERIC_SUPPORT (1)
64 * Allow tags from 2 to 256, default 8
66 #ifndef CONFIG_SCSI_SYM53C8XX_MAX_TAGS
67 #define CONFIG_SCSI_SYM53C8XX_MAX_TAGS (8)
70 #if CONFIG_SCSI_SYM53C8XX_MAX_TAGS < 2
71 #define SYM_CONF_MAX_TAG (2)
72 #elif CONFIG_SCSI_SYM53C8XX_MAX_TAGS > 256
73 #define SYM_CONF_MAX_TAG (256)
75 #define SYM_CONF_MAX_TAG CONFIG_SCSI_SYM53C8XX_MAX_TAGS
78 #ifndef CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS
79 #define CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS SYM_CONF_MAX_TAG
83 * Anyway, we configure the driver for at least 64 tags per LUN. :)
85 #if SYM_CONF_MAX_TAG <= 64
86 #define SYM_CONF_MAX_TAG_ORDER (6)
87 #elif SYM_CONF_MAX_TAG <= 128
88 #define SYM_CONF_MAX_TAG_ORDER (7)
90 #define SYM_CONF_MAX_TAG_ORDER (8)
94 * Max number of SG entries.
96 #define SYM_CONF_MAX_SG (96)
99 * Driver setup structure.
101 * This structure is initialized from linux config options.
102 * It can be overridden at boot-up by the boot command line.
104 struct sym_driver_setup
{
110 u_char scsi_bus_check
;
119 #define SYM_SETUP_MAX_TAG sym_driver_setup.max_tag
120 #define SYM_SETUP_BURST_ORDER sym_driver_setup.burst_order
121 #define SYM_SETUP_SCSI_LED sym_driver_setup.scsi_led
122 #define SYM_SETUP_SCSI_DIFF sym_driver_setup.scsi_diff
123 #define SYM_SETUP_IRQ_MODE sym_driver_setup.irq_mode
124 #define SYM_SETUP_SCSI_BUS_CHECK sym_driver_setup.scsi_bus_check
125 #define SYM_SETUP_HOST_ID sym_driver_setup.host_id
126 #define boot_verbose sym_driver_setup.verbose
131 * Can be overriden at startup by a command line.
133 #define SYM_LINUX_DRIVER_SETUP { \
134 .max_tag = CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS, \
139 .scsi_bus_check = 1, \
146 extern struct sym_driver_setup sym_driver_setup
;
147 extern unsigned int sym_debug_flags
;
148 #define DEBUG_FLAGS sym_debug_flags
151 * Max number of targets.
152 * Maximum is 16 and you are advised not to change this value.
154 #ifndef SYM_CONF_MAX_TARGET
155 #define SYM_CONF_MAX_TARGET (16)
159 * Max number of logical units.
160 * SPI-2 allows up to 64 logical units, but in real life, target
161 * that implements more that 7 logical units are pretty rare.
162 * Anyway, the cost of accepting up to 64 logical unit is low in
163 * this driver, thus going with the maximum is acceptable.
165 #ifndef SYM_CONF_MAX_LUN
166 #define SYM_CONF_MAX_LUN (64)
170 * Max number of IO control blocks queued to the controller.
171 * Each entry needs 8 bytes and the queues are allocated contiguously.
172 * Since we donnot want to allocate more than a page, the theorical
173 * maximum is PAGE_SIZE/8. For safety, we announce a bit less to the
175 * When not supplied, as it is suggested, the driver compute some
176 * good value for this parameter.
178 /* #define SYM_CONF_MAX_START (PAGE_SIZE/8 - 16) */
181 * Support for Immediate Arbitration.
184 /* #define SYM_CONF_IARB_SUPPORT */
187 * Only relevant if IARB support configured.
188 * - Max number of successive settings of IARB hints.
189 * - Set IARB on arbitration lost.
191 #define SYM_CONF_IARB_MAX 3
192 #define SYM_CONF_SET_IARB_ON_ARB_LOST 1
195 * Returning wrong residuals may make problems.
196 * When zero, this define tells the driver to
197 * always return 0 as transfer residual.
198 * Btw, all my testings of residuals have succeeded.
200 #define SYM_SETUP_RESIDUAL_SUPPORT 1
202 #endif /* SYM53C8XX_H */