sym_conf.h revision 55258
153790Sobrien/*
253790Sobrien *  Device driver optimized for the Symbios/LSI 53C896/53C895A/53C1010
353790Sobrien *  PCI-SCSI controllers.
453790Sobrien *
553790Sobrien *  Copyright (C) 1999  Gerard Roudier <groudier@club-internet.fr>
653790Sobrien *
753790Sobrien *  This driver also supports the following Symbios/LSI PCI-SCSI chips:
853790Sobrien *	53C810A, 53C825A, 53C860, 53C875, 53C876, 53C885, 53C895.
953790Sobrien *
1053790Sobrien *  but does not support earlier chips as the following ones:
1153790Sobrien *	53C810, 53C815, 53C825.
1253790Sobrien *
1353790Sobrien *  This driver for FreeBSD-CAM is derived from the Linux sym53c8xx driver.
1453790Sobrien *  Copyright (C) 1998-1999  Gerard Roudier
1553790Sobrien *
1653790Sobrien *  The sym53c8xx driver is derived from the ncr53c8xx driver that had been
1753790Sobrien *  a port of the FreeBSD ncr driver to Linux-1.2.13.
1853790Sobrien *
1953790Sobrien *  The original ncr driver has been written for 386bsd and FreeBSD by
2053790Sobrien *          Wolfgang Stanglmeier        <wolf@cologne.de>
2153790Sobrien *          Stefan Esser                <se@mi.Uni-Koeln.de>
2253790Sobrien *  Copyright (C) 1994  Wolfgang Stanglmeier
2353790Sobrien *
2453790Sobrien *  The initialisation code, and part of the code that addresses
2553790Sobrien *  FreeBSD-CAM services is based on the aic7xxx driver for FreeBSD-CAM
2653790Sobrien *  written by Justin T. Gibbs.
2753790Sobrien *
2853790Sobrien *  Other major contributions:
2953790Sobrien *
3053790Sobrien *  NVRAM detection and reading.
3153790Sobrien *  Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
3253790Sobrien *
3353790Sobrien *-----------------------------------------------------------------------------
3453790Sobrien *
3553790Sobrien * Redistribution and use in source and binary forms, with or without
3653790Sobrien * modification, are permitted provided that the following conditions
3753790Sobrien * are met:
3853790Sobrien * 1. Redistributions of source code must retain the above copyright
3953790Sobrien *    notice, this list of conditions and the following disclaimer.
4053790Sobrien * 2. Redistributions in binary form must reproduce the above copyright
4153790Sobrien *    notice, this list of conditions and the following disclaimer in the
4253790Sobrien *    documentation and/or other materials provided with the distribution.
4353790Sobrien * 3. The name of the author may not be used to endorse or promote products
4453790Sobrien *    derived from this software without specific prior written permission.
4553790Sobrien *
4653790Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
4753790Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4853790Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4953790Sobrien * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
5053790Sobrien * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5153790Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5253790Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5353790Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5453790Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5553790Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5653790Sobrien * SUCH DAMAGE.
5753790Sobrien */
5855258Sobrien
5955258Sobrien/* $FreeBSD: head/sys/dev/sym/sym_conf.h 55258 1999-12-30 06:19:10Z obrien $ */
6055258Sobrien
6153790Sobrien#ifndef SYM_CONF_H
6253790Sobrien#define SYM_CONF_H
6353790Sobrien
6453790Sobrien/*-------------------------------------------------------------------
6553790Sobrien *  Static configuration.
6653790Sobrien *-------------------------------------------------------------------
6753790Sobrien */
6853790Sobrien
6953790Sobrien/*
7053790Sobrien *  Support for earliest LSI53C1010 boards.
7154690Sobrien *
7254690Sobrien *  This option enables work-arounds for the experimental
7354690Sobrien *  C1010 chips revision 0 to work in DT mode.
7454690Sobrien *  Since, officially supported chips (B0 stepping and later)
7554690Sobrien *  have been fixed, nobody, except driver maintainers,
7654690Sobrien *  should ever needed this option to have been defined.
7754690Sobrien *  This option and the code it addresses will be removed
7854690Sobrien *  from the source in some later version of the driver.
7954690Sobrien *  By the way, the 53C1010 B0 stepping (rev. 1) has been
8054690Sobrien *  tested ok with Ultra3 DT data transfers using this driver,
8154690Sobrien *  without these work-arounds being enabled.
8253790Sobrien */
8354690Sobrien/* #define	SYM_CONF_BROKEN_U3EN_SUPPORT */
8453790Sobrien
8553790Sobrien/*
8653790Sobrien *  Use Normal IO instead of MMIO.
8753790Sobrien */
8854690Sobrien/* #define SYM_CONF_IOMAPPED */
8953790Sobrien
9053790Sobrien/*
9153790Sobrien *  Max tags for a device (logical unit)
9253790Sobrien * 	We use a power of 2, (7) means 2<<7=128
9353790Sobrien *  Maximum is 8 -> 256 tags
9453790Sobrien */
9554690Sobrien#define SYM_CONF_MAX_TAG_ORDER	(6)
9653790Sobrien
9753790Sobrien/*
9853790Sobrien *  Max number of scatter/gather entries for en IO.
9953790Sobrien *  Each entry costs 8 bytes in the internal CCB data structure.
10053790Sobrien *  For now 65 should suffice given the BSD O/Ses capabilities.
10153790Sobrien */
10254690Sobrien#define SYM_CONF_MAX_SG		(33)
10353790Sobrien
10453790Sobrien/*
10553790Sobrien *  Max number of targets.
10653790Sobrien *  Maximum is 16 and you are advised not to change this value.
10753790Sobrien */
10854690Sobrien#define SYM_CONF_MAX_TARGET	(16)
10953790Sobrien
11053790Sobrien/*
11153790Sobrien *  Max number of logical units.
11253790Sobrien *  SPI-2 allows up to 64 logical units, but in real life, target
11353790Sobrien *  that implements more that 7 logical units are pretty rare.
11453790Sobrien *  Anyway, the cost of accepting up to 64 logical unit is low in
11553790Sobrien *  this driver, thus going with the maximum is acceptable.
11653790Sobrien */
11754690Sobrien#define SYM_CONF_MAX_LUN		(64)
11853790Sobrien
11953790Sobrien/*
12053790Sobrien *  Max number of IO control blocks queued to the controller.
12153790Sobrien *  Each entry needs 8 bytes and the queues are allocated contiguously.
12253790Sobrien *  Since we donnot want to allocate more than a page, the theorical
12353790Sobrien *  maximum is PAGE_SIZE/8. For safety, we announce a bit less to the
12453790Sobrien *  access method. :)
12553790Sobrien *  When not supplied, as it is suggested, the driver compute some
12653790Sobrien *  good value for this parameter.
12753790Sobrien */
12854690Sobrien/* #define SYM_CONF_MAX_START	(PAGE_SIZE/8 - 16) */
12953790Sobrien
13053790Sobrien/*
13153790Sobrien *  Support for NVRAM.
13253790Sobrien */
13354690Sobrien#define SYM_CONF_NVRAM_SUPPORT
13454690Sobrien/* #define SYM_CONF_DEBUG_SUPPORT */
13553790Sobrien
13653790Sobrien/*
13753790Sobrien *  Support for Immediate Arbitration.
13853790Sobrien *  Not advised.
13953790Sobrien */
14054690Sobrien/* #define SYM_CONF_IARB_SUPPORT */
14153790Sobrien
14253790Sobrien/*
14353790Sobrien *  Not needed on FreeBSD, since the system allocator
14453790Sobrien *  does provide naturally aligned addresses.
14553790Sobrien */
14654690Sobrien#define	SYM_CONF_USE_INTERNAL_ALLOCATOR
14753790Sobrien
14853790Sobrien/*-------------------------------------------------------------------
14953790Sobrien *  Configuration that could be dynamic if it was possible
15053790Sobrien *  to pass arguments to the driver.
15153790Sobrien *-------------------------------------------------------------------
15253790Sobrien */
15353790Sobrien
15453790Sobrien/*
15553790Sobrien *  HOST default scsi id.
15653790Sobrien */
15754690Sobrien#define SYM_SETUP_HOST_ID	7
15853790Sobrien
15953790Sobrien/*
16053790Sobrien *  Max synchronous transfers.
16153790Sobrien */
16254690Sobrien#define SYM_SETUP_MIN_SYNC	(9)
16353790Sobrien
16453790Sobrien/*
16553790Sobrien *  Max wide order.
16653790Sobrien */
16754690Sobrien#define SYM_SETUP_MAX_WIDE	(1)
16853790Sobrien
16953790Sobrien/*
17053790Sobrien *  Max SCSI offset.
17153790Sobrien */
17254690Sobrien#define SYM_SETUP_MAX_OFFS	(64)
17354690Sobrien
17453790Sobrien/*
17553790Sobrien *  Default number of tags.
17653790Sobrien */
17754690Sobrien#define SYM_SETUP_MAX_TAG	(1<<SYM_CONF_MAX_TAG_ORDER)
17853790Sobrien
17953790Sobrien/*
18053790Sobrien *  SYMBIOS NVRAM format support.
18153790Sobrien */
18254690Sobrien#define SYM_SETUP_SYMBIOS_NVRAM	(1)
18353790Sobrien
18453790Sobrien/*
18553790Sobrien *  TEKRAM NVRAM format support.
18653790Sobrien */
18754690Sobrien#define SYM_SETUP_TEKRAM_NVRAM	(1)
18853790Sobrien
18953790Sobrien/*
19053790Sobrien *  PCI parity checking.
19154690Sobrien *  It should not be an option, but some poor or broken
19254690Sobrien *  PCI-HOST bridges have been reported to make problems
19354690Sobrien *  when this feature is enabled.
19454690Sobrien *  Setting this option to 0 tells the driver not to
19554690Sobrien *  enable the checking against PCI parity.
19653790Sobrien */
19754690Sobrien#ifndef SYM_SETUP_PCI_PARITY
19854690Sobrien#define SYM_SETUP_PCI_PARITY	(1)
19954690Sobrien#endif
20053790Sobrien
20153790Sobrien/*
20253790Sobrien *  SCSI parity checking.
20353790Sobrien */
20454690Sobrien#define SYM_SETUP_SCSI_PARITY	(1)
20553790Sobrien
20653790Sobrien/*
20753790Sobrien *  SCSI activity LED.
20853790Sobrien */
20954690Sobrien#define SYM_SETUP_SCSI_LED	(0)
21053790Sobrien
21153790Sobrien/*
21254690Sobrien *  SCSI High Voltage Differential support.
21354690Sobrien *
21454690Sobrien *  HVD/LVD/SE capable controllers (895, 895A, 896, 1010)
21554690Sobrien *  report the actual SCSI BUS mode from the STEST4 IO
21654690Sobrien *  register.
21754690Sobrien *
21854690Sobrien *  But for HVD/SE only capable chips (825a, 875, 885),
21954690Sobrien *  the driver uses some heuristic to probe against HVD.
22054690Sobrien *  Normally, the chip senses the DIFFSENS signal and
22154690Sobrien *  should switch its BUS tranceivers to high impedance
22254690Sobrien *  in situation of the driver having been wrong about
22354690Sobrien *  the actual BUS mode. May-be, the BUS mode probing of
22454690Sobrien *  the driver is safe, but, given that it may be partially
22554690Sobrien *  based on some previous IO register settings, it
22654690Sobrien *  cannot be stated so. Thus, decision has been taken
22754690Sobrien *  to require a user option to be set for the DIFF probing
22854690Sobrien *  to be applied for the 825a, 875 and 885 chips.
22954690Sobrien *
23054690Sobrien *  This setup option works as follows:
23154690Sobrien *
23254690Sobrien *    0  ->  HVD only supported for 895, 895A, 896, 1010.
23354690Sobrien *    1  ->  HVD probed  for 825A, 875, 885.
23454690Sobrien *    2  ->  HVD assumed for 825A, 875, 885 (not advised).
23553790Sobrien */
23654690Sobrien#ifndef SYM_SETUP_SCSI_DIFF
23754690Sobrien#define SYM_SETUP_SCSI_DIFF	(0)
23854690Sobrien#endif
23953790Sobrien
24053790Sobrien/*
24153790Sobrien *  IRQ mode.
24253790Sobrien */
24354690Sobrien#define SYM_SETUP_IRQ_MODE	(0)
24453790Sobrien
24553790Sobrien/*
24653790Sobrien *  Check SCSI BUS signal on reset.
24753790Sobrien */
24854690Sobrien#define SYM_SETUP_SCSI_BUS_CHECK	(1)
24953790Sobrien
25053790Sobrien/*
25153790Sobrien *  Max burst for PCI (1<<value)
25253790Sobrien *  7 means: (1<<7) = 128 DWORDS.
25353790Sobrien */
25454690Sobrien#define SYM_SETUP_BURST_ORDER	(7)
25553790Sobrien
25653790Sobrien/*
25753790Sobrien *  Only relevant if IARB support configured.
25853790Sobrien *  - Max number of successive settings of IARB hints.
25953790Sobrien *  - Set IARB on arbitration lost.
26053790Sobrien */
26154690Sobrien#define SYM_CONF_IARB_MAX 3
26254690Sobrien#define SYM_CONF_SET_IARB_ON_ARB_LOST 1
26353790Sobrien
26453790Sobrien/*
26553790Sobrien *  Returning wrong residuals may make problems.
26653790Sobrien *  When zero, this define tells the driver to
26753790Sobrien *  always return 0 as transfer residual.
26853790Sobrien *  Btw, all my testings of residuals have succeeded.
26953790Sobrien */
27054690Sobrien#define SYM_CONF_RESIDUAL_SUPPORT 1
27153790Sobrien
27254690Sobrien/*
27354690Sobrien *  Supported maximum number of LUNs to announce to
27454690Sobrien *  the access method.
27554690Sobrien *  The driver supports up to 64 LUNs per target as
27654690Sobrien *  required by SPI-2/SPI-3. However some SCSI devices
27754690Sobrien *  designed prior to these specifications or not being
27854690Sobrien *  conformant may be highly confused when they are
27954690Sobrien *  asked about a LUN > 7.
28054690Sobrien */
28154690Sobrien#ifndef SYM_SETUP_MAX_LUN
28254690Sobrien#define SYM_SETUP_MAX_LUN	(8)
28354690Sobrien#endif
28454690Sobrien
28554690Sobrien/*
28654690Sobrien *  Low priority probe map.
28754690Sobrien *
28854690Sobrien *  This option is used as a bitmap to tell the driver
28954690Sobrien *  about chips that are to be claimed with a low priority
29054690Sobrien *  (-2000) by the probe method. This allows any other driver
29154690Sobrien *  that may return some higher priority value for the same
29254690Sobrien *  chips to take precedence over this driver (sym).
29354690Sobrien *  This option may be used when both the ncr driver and this
29454690Sobrien *  driver are configured.
29554690Sobrien *
29654690Sobrien *  Bits are to be coded as follows:
29754690Sobrien *    1  ->  810a, 860
29854690Sobrien *    2  ->  825a, 875, 885, 895
29954690Sobrien *    4  ->  895a, 896, 1510d
30054690Sobrien *    8  ->  1010
30154690Sobrien *
30254690Sobrien *  For example, value 5 tells the driver to claim support
30354690Sobrien *  for 810a, 860, 895a, 896 and 1510d with low priority,
30454690Sobrien *  allowing the ncr driver to take precedence if configured.
30554690Sobrien */
30654690Sobrien#ifndef SYM_SETUP_LP_PROBE_MAP
30754690Sobrien#define SYM_SETUP_LP_PROBE_MAP 0
30854690Sobrien#endif
30954690Sobrien
31053790Sobrien#endif /* SYM_CONF_H */
311