brintos

brintos / linux-shallow public Read only

0
0
Text · 43.6 KiB · 4eb0479 Raw
1210 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3============4SYM-2 driver5============6 7Written by Gerard Roudier <groudier@free.fr>8 921 Rue Carnot10 1195170 DEUIL LA BARRE - FRANCE12 13Updated by Matthew Wilcox <matthew@wil.cx>14 152004-10-0916 17.. Contents18 19   1.  Introduction20   2.  Supported chips and SCSI features21   3.  Advantages of this driver for newer chips.22         3.1 Optimized SCSI SCRIPTS23         3.2 New features appeared with the SYM53C89624   4.  Memory mapped I/O versus normal I/O25   5.  Tagged command queueing26   6.  Parity checking27   7.  Profiling information28   8.  Control commands29         8.1  Set minimum synchronous period30         8.2  Set wide size31         8.3  Set maximum number of concurrent tagged commands32         8.4  Set debug mode33         8.5  Set flag (no_disc)34         8.6  Set verbose level35         8.7  Reset all logical units of a target36         8.8  Abort all tasks of all logical units of a target37   9.  Configuration parameters38   10. Boot setup commands39         10.1 Syntax40         10.2 Available arguments41                10.2.1  Default number of tagged commands42                10.2.2  Burst max43                10.2.3  LED support44                10.2.4  Differential mode45                10.2.5  IRQ mode46                10.2.6  Check SCSI BUS47                10.2.7  Suggest a default SCSI id for hosts48                10.2.8  Verbosity level49                10.2.9  Debug mode50                10.2.10 Settle delay51                10.2.11 Serial NVRAM52                10.2.12 Exclude a host from being attached53         10.3 Converting from old options54         10.4 SCSI BUS checking boot option55   11. SCSI problem troubleshooting56         15.1 Problem tracking57         15.2 Understanding hardware error reports58   12. Serial NVRAM support (by Richard Waltham)59         17.1 Features60         17.2 Symbios NVRAM layout61         17.3 Tekram  NVRAM layout62 63 641. Introduction65===============66 67This driver supports the whole SYM53C8XX family of PCI-SCSI controllers.68It also support the subset of LSI53C10XX PCI-SCSI controllers that are based69on the SYM53C8XX SCRIPTS language.70 71It replaces the sym53c8xx+ncr53c8xx driver bundle and shares its core code72with the FreeBSD SYM-2 driver. The 'glue' that allows this driver to work73under Linux is contained in 2 files named sym_glue.h and sym_glue.c.74Other drivers files are intended not to depend on the Operating System75on which the driver is used.76 77The history of this driver can be summarized as follows:78 791993: ncr driver written for 386bsd and FreeBSD by:80 81          - Wolfgang Stanglmeier        <wolf@cologne.de>82          - Stefan Esser                <se@mi.Uni-Koeln.de>83 841996: port of the ncr driver to Linux-1.2.13 and rename it ncr53c8xx.85 86          - Gerard Roudier87 881998: new sym53c8xx driver for Linux based on LOAD/STORE instruction and that89      adds full support for the 896 but drops support for early NCR devices.90 91          - Gerard Roudier92 931999: port of the sym53c8xx driver to FreeBSD and support for the LSI53C101094      33 MHz and 66MHz Ultra-3 controllers. The new driver is named 'sym'.95 96          - Gerard Roudier97 982000: Add support for early NCR devices to FreeBSD 'sym' driver.99      Break the driver into several sources and separate the OS glue100      code from the core code that can be shared among different O/Ses.101      Write a glue code for Linux.102 103          - Gerard Roudier104 1052004: Remove FreeBSD compatibility code.  Remove support for versions of106      Linux before 2.6.  Start using Linux facilities.107 108This README file addresses the Linux version of the driver. Under FreeBSD,109the driver documentation is the sym.8 man page.110 111Information about new chips is available at LSILOGIC web server:112 113          http://www.lsilogic.com/114 115SCSI standard documentations are available at T10 site:116 117          http://www.t10.org/118 119Useful SCSI tools written by Eric Youngdale are part of most Linux120distributions:121 122   ============ ==========================123   scsiinfo     command line tool124   scsi-config  TCL/Tk tool using scsiinfo125   ============ ==========================126 1272. Supported chips and SCSI features128====================================129 130The following features are supported for all chips:131 132	- Synchronous negotiation133	- Disconnection134	- Tagged command queuing135	- SCSI parity checking136	- PCI Master parity checking137 138Other features depends on chip capabilities.139 140The driver notably uses optimized SCRIPTS for devices that support141LOAD/STORE and handles PHASE MISMATCH from SCRIPTS for devices that142support the corresponding feature.143 144The following table shows some characteristics of the chip family.145 146+--------+-----------+-----+-----------+------------+------------+---------+147|        |           |     |           |            |Load/store  |Hardware |148|        |On board   |     |           |            |scripts     |phase    |149|Chip    |SDMS BIOS  |Wide |SCSI std.  | Max. sync  |            |mismatch |150+--------+-----------+-----+-----------+------------+------------+---------+151|810     |     N     |  N  | FAST10    | 10 MB/s    |      N     |    N    |152+--------+-----------+-----+-----------+------------+------------+---------+153|810A    |     N     |  N  | FAST10    | 10 MB/s    |      Y     |    N    |154+--------+-----------+-----+-----------+------------+------------+---------+155|815     |     Y     |  N  | FAST10    | 10 MB/s    |      N     |    N    |156+--------+-----------+-----+-----------+------------+------------+---------+157|825     |     Y     |  Y  | FAST10    | 20 MB/s    |      N     |    N    |158+--------+-----------+-----+-----------+------------+------------+---------+159|825A    |     Y     |  Y  | FAST10    | 20 MB/s    |      Y     |    N    |160+--------+-----------+-----+-----------+------------+------------+---------+161|860     |     N     |  N  | FAST20    | 20 MB/s    |      Y     |    N    |162+--------+-----------+-----+-----------+------------+------------+---------+163|875     |     Y     |  Y  | FAST20    | 40 MB/s    |      Y     |    N    |164+--------+-----------+-----+-----------+------------+------------+---------+165|875A    |     Y     |  Y  | FAST20    | 40 MB/s    |      Y     |    Y    |166+--------+-----------+-----+-----------+------------+------------+---------+167|876     |     Y     |  Y  | FAST20    | 40 MB/s    |      Y     |    N    |168+--------+-----------+-----+-----------+------------+------------+---------+169|895     |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    N    |170+--------+-----------+-----+-----------+------------+------------+---------+171|895A    |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    Y    |172+--------+-----------+-----+-----------+------------+------------+---------+173|896     |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    Y    |174+--------+-----------+-----+-----------+------------+------------+---------+175|897     |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    Y    |176+--------+-----------+-----+-----------+------------+------------+---------+177|1510D   |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    Y    |178+--------+-----------+-----+-----------+------------+------------+---------+179|1010    |     Y     |  Y  | FAST80    |160 MB/s    |      Y     |    Y    |180+--------+-----------+-----+-----------+------------+------------+---------+181|1010_66 |     Y     |  Y  | FAST80    |160 MB/s    |      Y     |    Y    |182|[1]_    |           |     |           |            |            |         |183+--------+-----------+-----+-----------+------------+------------+---------+184 185.. [1] Chip supports 33MHz and 66MHz PCI bus clock.186 187 188Summary of other supported features:189 190:Module:                allow to load the driver191:Memory mapped I/O:     increases performance192:Control commands:      write operations to the proc SCSI file system193:Debugging information: written to syslog (expert only)194:Serial NVRAM:          Symbios and Tekram formats195 196- Scatter / gather197- Shared interrupt198- Boot setup commands199 200 2013. Advantages of this driver for newer chips.202=============================================203 2043.1 Optimized SCSI SCRIPTS205--------------------------206 207All chips except the 810, 815 and 825, support new SCSI SCRIPTS instructions208named LOAD and STORE that allow to move up to 1 DWORD from/to an IO register209to/from memory much faster that the MOVE MEMORY instruction that is supported210by the 53c7xx and 53c8xx family.211 212The LOAD/STORE instructions support absolute and DSA relative addressing213modes. The SCSI SCRIPTS had been entirely rewritten using LOAD/STORE instead214of MOVE MEMORY instructions.215 216Due to the lack of LOAD/STORE SCRIPTS instructions by earlier chips, this217driver also incorporates a different SCRIPTS set based on MEMORY MOVE, in218order to provide support for the entire SYM53C8XX chips family.219 2203.2 New features appeared with the SYM53C896221--------------------------------------------222 223Newer chips (see above) allows handling of the phase mismatch context from224SCRIPTS (avoids the phase mismatch interrupt that stops the SCSI processor225until the C code has saved the context of the transfer).226 227The 896 and 1010 chips support 64 bit PCI transactions and addressing,228while the 895A supports 32 bit PCI transactions and 64 bit addressing.229The SCRIPTS processor of these chips is not true 64 bit, but uses segment230registers for bit 32-63. Another interesting feature is that LOAD/STORE231instructions that address the on-chip RAM (8k) remain internal to the chip.232 2334. Memory mapped I/O versus normal I/O234======================================235 236Memory mapped I/O has less latency than normal I/O and is the recommended237way for doing IO with PCI devices. Memory mapped I/O seems to work fine on238most hardware configurations, but some poorly designed chipsets may break239this feature. A configuration option is provided for normal I/O to be240used but the driver defaults to MMIO.241 2425. Tagged command queueing243==========================244 245Queuing more than 1 command at a time to a device allows it to perform246optimizations based on actual head positions and its mechanical247characteristics. This feature may also reduce average command latency.248In order to really gain advantage of this feature, devices must have249a reasonable cache size (No miracle is to be expected for a low-end250hard disk with 128 KB or less).251 252Some known old SCSI devices do not properly support tagged command queuing.253Generally, firmware revisions that fix this kind of problems are available254at respective vendor web/ftp sites.255 256All I can say is that I never have had problem with tagged queuing using257this driver and its predecessors. Hard disks that behaved correctly for258me using tagged commands are the following:259 260- IBM S12 0662261- Conner 1080S262- Quantum Atlas I263- Quantum Atlas II264- Seagate Cheetah I265- Quantum Viking II266- IBM DRVS267- Quantum Atlas IV268- Seagate Cheetah II269 270If your controller has NVRAM, you can configure this feature per target271from the user setup tool. The Tekram Setup program allows to tune the272maximum number of queued commands up to 32. The Symbios Setup only allows273to enable or disable this feature.274 275The maximum number of simultaneous tagged commands queued to a device276is currently set to 16 by default.  This value is suitable for most SCSI277disks.  With large SCSI disks (>= 2GB, cache >= 512KB, average seek time278<= 10 ms), using a larger value may give better performances.279 280This driver supports up to 255 commands per device, and but using more than28164 is generally not worth-while, unless you are using a very large disk or282disk arrays. It is noticeable that most of recent hard disks seem not to283accept more than 64 simultaneous commands. So, using more than 64 queued284commands is probably just resource wasting.285 286If your controller does not have NVRAM or if it is managed by the SDMS287BIOS/SETUP, you can configure tagged queueing feature and device queue288depths from the boot command-line. For example::289 290  sym53c8xx=tags:4/t2t3q15-t4q7/t1u0q32291 292will set tagged commands queue depths as follow:293 294- target 2  all luns  on controller 0 --> 15295- target 3  all luns  on controller 0 --> 15296- target 4  all luns  on controller 0 -->  7297- target 1  lun 0     on controller 1 --> 32298- all other target/lun                -->  4299 300In some special conditions, some SCSI disk firmwares may return a301QUEUE FULL status for a SCSI command. This behaviour is managed by the302driver using the following heuristic:303 304- Each time a QUEUE FULL status is returned, tagged queue depth is reduced305  to the actual number of disconnected commands.306 307- Every 200 successfully completed SCSI commands, if allowed by the308  current limit, the maximum number of queueable commands is incremented.309 310Since QUEUE FULL status reception and handling is resource wasting, the311driver notifies by default this problem to user by indicating the actual312number of commands used and their status, as well as its decision on the313device queue depth change.314The heuristic used by the driver in handling QUEUE FULL ensures that the315impact on performances is not too bad. You can get rid of the messages by316setting verbose level to zero, as follow:317 3181st method:319	    boot your system using 'sym53c8xx=verb:0' option.3202nd method:321	    apply "setverbose 0" control command to the proc fs entry322            corresponding to your controller after boot-up.323 3246. Parity checking325==================326 327The driver supports SCSI parity checking and PCI bus master parity328checking.  These features must be enabled in order to ensure safe329data transfers.  Some flawed devices or mother boards may have problems330with parity.  The options to defeat parity checking have been removed331from the driver.332 3337. Profiling information334========================335 336This driver does not provide profiling information as did its predecessors.337This feature was not this useful and added complexity to the code.338As the driver code got more complex, I have decided to remove everything339that didn't seem actually useful.340 3418. Control commands342===================343 344Control commands can be sent to the driver with write operations to345the proc SCSI file system. The generic command syntax is the346following::347 348      echo "<verb> <parameters>" >/proc/scsi/sym53c8xx/0349      (assumes controller number is 0)350 351Using "all" for "<target>" parameter with the commands below will352apply to all targets of the SCSI chain (except the controller).353 354Available commands:355 3568.1 Set minimum synchronous period factor357-----------------------------------------358 359    setsync <target> <period factor>360 361    :target:   target number362    :period:   minimum synchronous period.363               Maximum speed = 1000/(4*period factor) except for special364               cases below.365 366    Specify a period of 0, to force asynchronous transfer mode.367 368     -  9 means 12.5 nano-seconds synchronous period369     - 10 means 25 nano-seconds synchronous period370     - 11 means 30 nano-seconds synchronous period371     - 12 means 50 nano-seconds synchronous period372 3738.2 Set wide size374-----------------375 376    setwide <target> <size>377 378    :target:   target number379    :size:     0=8 bits, 1=16bits380 3818.3 Set maximum number of concurrent tagged commands382----------------------------------------------------383 384    settags <target> <tags>385 386    :target:   target number387    :tags:     number of concurrent tagged commands388               must not be greater than configured (default: 16)389 3908.4 Set debug mode391------------------392 393    setdebug <list of debug flags>394 395    Available debug flags:396 397	======== ========================================================398        alloc    print info about memory allocations (ccb, lcb)399        queue    print info about insertions into the command start queue400        result   print sense data on CHECK CONDITION status401        scatter  print info about the scatter process402        scripts  print info about the script binding process403	tiny     print minimal debugging information404	timing   print timing information of the NCR chip405	nego     print information about SCSI negotiations406	phase    print information on script interruptions407	======== ========================================================408 409    Use "setdebug" with no argument to reset debug flags.410 411 4128.5 Set flag (no_disc)413----------------------414 415    setflag <target> <flag>416 417    :target:    target number418 419    For the moment, only one flag is available:420 421        no_disc:   not allow target to disconnect.422 423    Do not specify any flag in order to reset the flag. For example:424 425    setflag 4426      will reset no_disc flag for target 4, so will allow it disconnections.427    setflag all428      will allow disconnection for all devices on the SCSI bus.429 430 4318.6 Set verbose level432---------------------433 434    setverbose #level435 436    The driver default verbose level is 1. This command allows to change437    th driver verbose level after boot-up.438 4398.7 Reset all logical units of a target440---------------------------------------441 442    resetdev <target>443 444    :target:    target number445 446    The driver will try to send a BUS DEVICE RESET message to the target.447 4488.8 Abort all tasks of all logical units of a target449----------------------------------------------------450 451    cleardev <target>452 453    :target:    target number454 455    The driver will try to send a ABORT message to all the logical units456    of the target.457 458 4599. Configuration parameters460===========================461 462Under kernel configuration tools (make menuconfig, for example), it is463possible to change some default driver configuration parameters.464If the firmware of all your devices is perfect enough, all the465features supported by the driver can be enabled at start-up. However,466if only one has a flaw for some SCSI feature, you can disable the467support by the driver of this feature at linux start-up and enable468this feature after boot-up only for devices that support it safely.469 470Configuration parameters:471 472Use normal IO                         (default answer: n)473    Answer "y" if you suspect your mother board to not allow memory mapped I/O.474    May slow down performance a little.475 476Default tagged command queue depth    (default answer: 16)477    Entering 0 defaults to tagged commands not being used.478    This parameter can be specified from the boot command line.479 480Maximum number of queued commands     (default answer: 32)481    This option allows you to specify the maximum number of tagged commands482    that can be queued to a device. The maximum supported value is 255.483 484Synchronous transfers frequency       (default answer: 80)485    This option allows you to specify the frequency in MHz the driver486    will use at boot time for synchronous data transfer negotiations.487    0 means "asynchronous data transfers".488 48910. Boot setup commands490=======================491 49210.1 Syntax493-----------494 495Setup commands can be passed to the driver either at boot time or as496parameters to modprobe, as described in Documentation/admin-guide/kernel-parameters.rst497 498Example of boot setup command under lilo prompt::499 500    lilo: linux root=/dev/sda2 sym53c8xx.cmd_per_lun=4 sym53c8xx.sync=10 sym53c8xx.debug=0x200501 502- enable tagged commands, up to 4 tagged commands queued.503- set synchronous negotiation speed to 10 Mega-transfers / second.504- set DEBUG_NEGO flag.505 506The following command will install the driver module with the same507options as above::508 509    modprobe sym53c8xx cmd_per_lun=4 sync=10 debug=0x200510 51110.2 Available arguments512------------------------513 51410.2.1  Default number of tagged commands515^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^516        - cmd_per_lun=0 (or cmd_per_lun=1) tagged command queuing disabled517        - cmd_per_lun=#tags (#tags > 1) tagged command queuing enabled518 519  #tags will be truncated to the max queued commands configuration parameter.520 52110.2.2 Burst max522^^^^^^^^^^^^^^^^523 524	========== ======================================================525        burst=0    burst disabled526        burst=255  get burst length from initial IO register settings.527        burst=#x   burst enabled (1<<#x burst transfers max)528 529		   #x is an integer value which is log base 2 of the burst530		   transfers max.531	========== ======================================================532 533  By default the driver uses the maximum value supported by the chip.534 53510.2.3 LED support536^^^^^^^^^^^^^^^^^^537 538	=====      ===================539        led=1      enable  LED support540        led=0      disable LED support541	=====      ===================542 543  Do not enable LED support if your scsi board does not use SDMS BIOS.544  (See 'Configuration parameters')545 54610.2.4 Differential mode547^^^^^^^^^^^^^^^^^^^^^^^^548 549	======	=================================550	diff=0	never set up diff mode551        diff=1	set up diff mode if BIOS set it552        diff=2	always set up diff mode553        diff=3	set diff mode if GPIO3 is not set554	======	=================================555 55610.2.5 IRQ mode557^^^^^^^^^^^^^^^558 559	======     ================================================560        irqm=0     always open drain561        irqm=1     same as initial settings (assumed BIOS settings)562        irqm=2     always totem pole563	======     ================================================564 56510.2.6 Check SCSI BUS566^^^^^^^^^^^^^^^^^^^^^567 568        buschk=<option bits>569 570    Available option bits:571 572	===    ================================================573        0x0    No check.574        0x1    Check and do not attach the controller on error.575        0x2    Check and just warn on error.576	===    ================================================577 57810.2.7 Suggest a default SCSI id for hosts579^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^580 581	==========	==========================================582        hostid=255	no id suggested.583        hostid=#x	(0 < x < 7) x suggested for hosts SCSI id.584	==========	==========================================585 586    If a host SCSI id is available from the NVRAM, the driver will ignore587    any value suggested as boot option. Otherwise, if a suggested value588    different from 255 has been supplied, it will use it. Otherwise, it will589    try to deduce the value previously set in the hardware and use value590    7 if the hardware value is zero.591 59210.2.8  Verbosity level593^^^^^^^^^^^^^^^^^^^^^^^594 595	======     ========596        verb=0     minimal597        verb=1     normal598        verb=2     too much599	======     ========600 60110.2.9 Debug mode602^^^^^^^^^^^^^^^^^603 604	=========   ====================================605        debug=0	    clear debug flags606        debug=#x    set debug flags607 608		    #x is an integer value combining the609		    following power-of-2 values:610 611		    =============  ======612		    DEBUG_ALLOC       0x1613		    DEBUG_PHASE       0x2614		    DEBUG_POLL        0x4615		    DEBUG_QUEUE       0x8616		    DEBUG_RESULT     0x10617		    DEBUG_SCATTER    0x20618		    DEBUG_SCRIPT     0x40619		    DEBUG_TINY       0x80620		    DEBUG_TIMING    0x100621		    DEBUG_NEGO      0x200622		    DEBUG_TAGS      0x400623		    DEBUG_FREEZE    0x800624		    DEBUG_RESTART  0x1000625		    =============  ======626	=========   ====================================627 628  You can play safely with DEBUG_NEGO. However, some of these flags may629  generate bunches of syslog messages.630 63110.2.10 Settle delay632^^^^^^^^^^^^^^^^^^^^633 634	========	===================635        settle=n	delay for n seconds636	========	===================637 638  After a bus reset, the driver will delay for n seconds before talking639  to any device on the bus.  The default is 3 seconds and safe mode will640  default it to 10.641 64210.2.11 Serial NVRAM643^^^^^^^^^^^^^^^^^^^^644 645	.. Note:: option not currently implemented.646 647	=======     =========================================648        nvram=n     do not look for serial NVRAM649        nvram=y     test controllers for onboard serial NVRAM650	=======     =========================================651 652        (alternate binary form)653 654        nvram=<bits options>655 656        ====   =================================================================657        0x01   look for NVRAM  (equivalent to nvram=y)658        0x02   ignore NVRAM "Synchronous negotiation" parameters for all devices659        0x04   ignore NVRAM "Wide negotiation"  parameter for all devices660        0x08   ignore NVRAM "Scan at boot time" parameter for all devices661        0x80   also attach controllers set to OFF in the NVRAM (sym53c8xx only)662        ====   =================================================================663 66410.2.12 Exclude a host from being attached665^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^666 667        excl=<io_address>,...668 669    Prevent host at a given io address from being attached.670    For example 'excl=0xb400,0xc000' indicate to the671    driver not to attach hosts at address 0xb400 and 0xc000.672 67310.3 Converting from old style options674--------------------------------------675 676Previously, the sym2 driver accepted arguments of the form::677 678	sym53c8xx=tags:4,sync:10,debug:0x200679 680As a result of the new module parameters, this is no longer available.681Most of the options have remained the same, but tags has become682cmd_per_lun to reflect its different purposes.  The sample above would683be specified as::684 685	modprobe sym53c8xx cmd_per_lun=4 sync=10 debug=0x200686 687or on the kernel boot line as::688 689	sym53c8xx.cmd_per_lun=4 sym53c8xx.sync=10 sym53c8xx.debug=0x200690 69110.4 SCSI BUS checking boot option692----------------------------------693 694When this option is set to a non-zero value, the driver checks SCSI lines695logic state, 100 micro-seconds after having asserted the SCSI RESET line.696The driver just reads SCSI lines and checks all lines read FALSE except RESET.697Since SCSI devices shall release the BUS at most 800 nano-seconds after SCSI698RESET has been asserted, any signal to TRUE may indicate a SCSI BUS problem.699Unfortunately, the following common SCSI BUS problems are not detected:700 701- Only 1 terminator installed.702- Misplaced terminators.703- Bad quality terminators.704 705On the other hand, either bad cabling, broken devices, not conformant706devices, ... may cause a SCSI signal to be wrong when the driver reads it.707 70815. SCSI problem troubleshooting709================================710 71115.1 Problem tracking712---------------------713 714Most SCSI problems are due to a non conformant SCSI bus or too buggy715devices.  If unfortunately you have SCSI problems, you can check the716following things:717 718- SCSI bus cables719- terminations at both end of the SCSI chain720- linux syslog messages (some of them may help you)721 722If you do not find the source of problems, you can configure the723driver or devices in the NVRAM with minimal features.724 725- only asynchronous data transfers726- tagged commands disabled727- disconnections not allowed728 729Now, if your SCSI bus is ok, your system has every chance to work730with this safe configuration but performances will not be optimal.731 732If it still fails, then you can send your problem description to733appropriate mailing lists or news-groups.  Send me a copy in order to734be sure I will receive it.  Obviously, a bug in the driver code is735possible.736 737  My current email address: Gerard Roudier <groudier@free.fr>738 739Allowing disconnections is important if you use several devices on740your SCSI bus but often causes problems with buggy devices.741Synchronous data transfers increases throughput of fast devices like742hard disks.  Good SCSI hard disks with a large cache gain advantage of743tagged commands queuing.744 74515.2 Understanding hardware error reports746-----------------------------------------747 748When the driver detects an unexpected error condition, it may display a749message of the following pattern::750 751    sym0:1: ERROR (0:48) (1-21-65) (f/95/0) @ (script 7c0:19000000).752    sym0: script cmd = 19000000753    sym0: regdump: da 10 80 95 47 0f 01 07 75 01 81 21 80 01 09 00.754 755Some fields in such a message may help you understand the cause of the756problem, as follows::757 758    sym0:1: ERROR (0:48) (1-21-65) (f/95/0) @ (script 7c0:19000000).759    .....A.........B.C....D.E..F....G.H..I.......J.....K...L.......760 761Field A : target number.762  SCSI ID of the device the controller was talking with at the moment the763  error occurs.764 765Field B : DSTAT io register (DMA STATUS)766  ========   =============================================================767  Bit 0x40   MDPE Master Data Parity Error768             Data parity error detected on the PCI BUS.769  Bit 0x20   BF   Bus Fault770             PCI bus fault condition detected771  Bit 0x01   IID  Illegal Instruction Detected772             Set by the chip when it detects an Illegal Instruction format773             on some condition that makes an instruction illegal.774  Bit 0x80   DFE Dma Fifo Empty775             Pure status bit that does not indicate an error.776  ========   =============================================================777 778  If the reported DSTAT value contains a combination of MDPE (0x40),779  BF (0x20), then the cause may be likely due to a PCI BUS problem.780 781Field C : SIST io register (SCSI Interrupt Status)782  ========   ==================================================================783  Bit 0x08   SGE  SCSI GROSS ERROR784             Indicates that the chip detected a severe error condition785             on the SCSI BUS that prevents the SCSI protocol from functioning786             properly.787  Bit 0x04   UDC  Unexpected Disconnection788             Indicates that the device released the SCSI BUS when the chip789             was not expecting this to happen. A device may behave so to790             indicate the SCSI initiator that an error condition not reportable              using the SCSI protocol has occurred.791  Bit 0x02   RST  SCSI BUS Reset792             Generally SCSI targets do not reset the SCSI BUS, although any793             device on the BUS can reset it at any time.794  Bit 0x01   PAR  Parity795             SCSI parity error detected.796  ========   ==================================================================797 798  On a faulty SCSI BUS, any error condition among SGE (0x08), UDC (0x04) and799  PAR (0x01) may be detected by the chip. If your SCSI system sometimes800  encounters such error conditions, especially SCSI GROSS ERROR, then a SCSI801  BUS problem is likely the cause of these errors.802 803For fields D,E,F,G and H, you may look into the sym53c8xx_defs.h file804that contains some minimal comments on IO register bits.805 806Field D : SOCL  Scsi Output Control Latch807          This register reflects the state of the SCSI control lines the808          chip want to drive or compare against.809Field E : SBCL  Scsi Bus Control Lines810          Actual value of control lines on the SCSI BUS.811Field F : SBDL  Scsi Bus Data Lines812          Actual value of data lines on the SCSI BUS.813Field G : SXFER  SCSI Transfer814          Contains the setting of the Synchronous Period for output and815          the current Synchronous offset (offset 0 means asynchronous).816Field H : SCNTL3 Scsi Control Register 3817          Contains the setting of timing values for both asynchronous and818          synchronous data transfers.819Field I : SCNTL4 Scsi Control Register 4820          Only meaningful for 53C1010 Ultra3 controllers.821 822Understanding Fields J, K, L and dumps requires to have good knowledge of823SCSI standards, chip cores functionnals and internal driver data structures.824You are not required to decode and understand them, unless you want to help825maintain the driver code.826 82717. Serial NVRAM (added by Richard Waltham: dormouse@farsrobt.demon.co.uk)828==========================================================================829 83017.1 Features831-------------832 833Enabling serial NVRAM support enables detection of the serial NVRAM included834on Symbios and some Symbios compatible host adaptors, and Tekram boards. The835serial NVRAM is used by Symbios and Tekram to hold set up parameters for the836host adaptor and its attached drives.837 838The Symbios NVRAM also holds data on the boot order of host adaptors in a839system with more than one host adaptor.  This information is no longer used840as it's fundamentally incompatible with the hotplug PCI model.841 842Tekram boards using Symbios chips, DC390W/F/U, which have NVRAM are detected843and this is used to distinguish between Symbios compatible and Tekram host844adaptors. This is used to disable the Symbios compatible "diff" setting845incorrectly set on Tekram boards if the CONFIG_SCSI_53C8XX_SYMBIOS_COMPAT846configuration parameter is set enabling both Symbios and Tekram boards to be847used together with the Symbios cards using all their features, including848"diff" support. ("led pin" support for Symbios compatible cards can remain849enabled when using Tekram cards. It does nothing useful for Tekram host850adaptors but does not cause problems either.)851 852The parameters the driver is able to get from the NVRAM depend on the853data format used, as follow:854 855+-------------------------------+------------------+--------------+856|                               |Tekram format     |Symbios format|857+-------------------------------+------------------+--------------+858|General and host parameters    |                  |              |859+-------------------------------+------------------+--------------+860|  * Boot order                 |        N         |       Y      |861+-------------------------------+------------------+--------------+862|  * Host SCSI ID               |        Y         |       Y      |863+-------------------------------+------------------+--------------+864|  * SCSI parity checking       |        Y         |       Y      |865+-------------------------------+------------------+--------------+866|  * Verbose boot messages      |        N         |       Y      |867+-------------------------------+------------------+--------------+868|SCSI devices parameters                                          |869+-------------------------------+------------------+--------------+870|  * Synchronous transfer speed |        Y         |       Y      |871+-------------------------------+------------------+--------------+872|  * Wide 16 / Narrow           |        Y         |       Y      |873+-------------------------------+------------------+--------------+874|  * Tagged Command Queuing     |        Y         |       Y      |875|    enabled                    |                  |              |876+-------------------------------+------------------+--------------+877|  * Disconnections enabled     |        Y         |       Y      |878+-------------------------------+------------------+--------------+879|  * Scan at boot time          |        N         |       Y      |880+-------------------------------+------------------+--------------+881 882 883In order to speed up the system boot, for each device configured without884the "scan at boot time" option, the driver forces an error on the885first TEST UNIT READY command received for this device.886 887 88817.2 Symbios NVRAM layout889-------------------------890 891typical data at NVRAM address 0x100 (53c810a NVRAM)::892 893    00 00894    64 01895    8e 0b896 897    00 30 00 00 00 00 07 00 00 00 00 00 00 00 07 04 10 04 00 00898 899    04 00 0f 00 00 10 00 50 00 00 01 00 00 62900    04 00 03 00 00 10 00 58 00 00 01 00 00 63901    04 00 01 00 00 10 00 48 00 00 01 00 00 61902    00 00 00 00 00 00 00 00 00 00 00 00 00 00903 904    0f 00 08 08 64 00 0a 00905    0f 00 08 08 64 00 0a 00906    0f 00 08 08 64 00 0a 00907    0f 00 08 08 64 00 0a 00908    0f 00 08 08 64 00 0a 00909    0f 00 08 08 64 00 0a 00910    0f 00 08 08 64 00 0a 00911    0f 00 08 08 64 00 0a 00912 913    0f 00 08 08 64 00 0a 00914    0f 00 08 08 64 00 0a 00915    0f 00 08 08 64 00 0a 00916    0f 00 08 08 64 00 0a 00917    0f 00 08 08 64 00 0a 00918    0f 00 08 08 64 00 0a 00919    0f 00 08 08 64 00 0a 00920    0f 00 08 08 64 00 0a 00921 922    00 00 00 00 00 00 00 00923    00 00 00 00 00 00 00 00924    00 00 00 00 00 00 00 00925    00 00 00 00 00 00 00 00926    00 00 00 00 00 00 00 00927    00 00 00 00 00 00 00 00928    00 00 00 00 00 00 00 00929    00 00 00 00 00 00 00 00930 931    00 00 00 00 00 00 00 00932    00 00 00 00 00 00 00 00933    00 00 00 00 00 00 00 00934    00 00 00 00 00 00 00 00935    00 00 00 00 00 00 00 00936    00 00 00 00 00 00 00 00937    00 00 00 00 00 00 00 00938    00 00 00 00 00 00 00 00939 940    00 00 00 00 00 00 00 00941    00 00 00 00 00 00 00 00942    00 00 00 00 00 00 00 00943 944    fe fe945    00 00946    00 00947 948NVRAM layout details949 950============= =================951NVRAM Address952============= =================9530x000-0x0ff   not used9540x100-0x26f   initialised data9550x270-0x7ff   not used956============= =================957 958general layout::959 960        header  -   6 bytes,961        data    - 356 bytes (checksum is byte sum of this data)962        trailer -   6 bytes963                  ---964        total     368 bytes965 966data area layout::967 968        controller set up  -  20 bytes969        boot configuration -  56 bytes (4x14 bytes)970        device set up      - 128 bytes (16x8 bytes)971        unused (spare?)    - 152 bytes (19x8 bytes)972                             ---973        total                356 bytes974 975header::976 977    00 00   - ?? start marker978    64 01   - byte count (lsb/msb excludes header/trailer)979    8e 0b   - checksum (lsb/msb excludes header/trailer)980 981controller set up::982 983    00 30 00 00 00 00 07 00 00 00 00 00 00 00 07 04 10 04 00 00984		    |     |           |     |985		    |     |           |      -- host ID986		    |     |           |987		    |     |            --Removable Media Support988		    |     |               0x00 = none989		    |     |               0x01 = Bootable Device990		    |     |               0x02 = All with Media991		    |     |992		    |      --flag bits 2993		    |        0x00000001= scan order hi->low994		    |            (default 0x00 - scan low->hi)995			--flag bits 1996			0x00000001 scam enable997			0x00000010 parity enable998			0x00000100 verbose boot msgs999 1000remaining bytes unknown - they do not appear to change in my1001current set up for any of the controllers.1002 1003default set up is identical for 53c810a and 53c875 NVRAM1004(Removable Media added Symbios BIOS version 4.09)1005 1006boot configuration1007 1008boot order set by order of the devices in this table::1009 1010    04 00 0f 00 00 10 00 50 00 00 01 00 00 62 -- 1st controller1011    04 00 03 00 00 10 00 58 00 00 01 00 00 63    2nd controller1012    04 00 01 00 00 10 00 48 00 00 01 00 00 61    3rd controller1013    00 00 00 00 00 00 00 00 00 00 00 00 00 00    4th controller1014	|  |  |  |     |        |     |  |1015	|  |  |  |     |        |      ---- PCI io port adr1016	|  |  |  |     |         --0x01 init/scan at boot time1017	|  |  |  |      --PCI device/function number (0xdddddfff)1018	|  |   ----- ?? PCI vendor ID (lsb/msb)1019	    ----PCI device ID (lsb/msb)1020 1021?? use of this data is a guess but seems reasonable1022 1023remaining bytes unknown - they do not appear to change in my1024current set up1025 1026default set up is identical for 53c810a and 53c875 NVRAM1027 1028device set up (up to 16 devices - includes controller)::1029 1030    0f 00 08 08 64 00 0a 00 - id 01031    0f 00 08 08 64 00 0a 001032    0f 00 08 08 64 00 0a 001033    0f 00 08 08 64 00 0a 001034    0f 00 08 08 64 00 0a 001035    0f 00 08 08 64 00 0a 001036    0f 00 08 08 64 00 0a 001037    0f 00 08 08 64 00 0a 001038 1039    0f 00 08 08 64 00 0a 001040    0f 00 08 08 64 00 0a 001041    0f 00 08 08 64 00 0a 001042    0f 00 08 08 64 00 0a 001043    0f 00 08 08 64 00 0a 001044    0f 00 08 08 64 00 0a 001045    0f 00 08 08 64 00 0a 001046    0f 00 08 08 64 00 0a 00 - id 151047    |     |  |  |     |  |1048    |     |  |  |      ----timeout (lsb/msb)1049    |     |  |   --synch period (0x?? 40 Mtrans/sec- fast 40) (probably 0x28)1050    |     |  |                  (0x30 20 Mtrans/sec- fast 20)1051    |     |  |                  (0x64 10 Mtrans/sec- fast )1052    |     |  |                  (0xc8  5 Mtrans/sec)1053    |     |  |                  (0x00  asynchronous)1054    |     |   -- ?? max sync offset (0x08 in NVRAM on 53c810a)1055    |     |                         (0x10 in NVRAM on 53c875)1056    |      --device bus width (0x08 narrow)1057    |                         (0x10 16 bit wide)1058    --flag bits1059	0x00000001 - disconnect enabled1060	0x00000010 - scan at boot time1061	0x00000100 - scan luns1062	0x00001000 - queue tags enabled1063 1064remaining bytes unknown - they do not appear to change in my1065current set up1066 1067?? use of this data is a guess but seems reasonable1068(but it could be max bus width)1069 1070default set up for 53c810a NVRAM1071default set up for 53c875 NVRAM1072 1073				- bus width     - 0x101074                                - sync offset ? - 0x101075                                - sync period   - 0x301076 1077?? spare device space (32 bit bus ??)::1078 1079    00 00 00 00 00 00 00 00  (19x8bytes)1080    .1081    .1082    00 00 00 00 00 00 00 001083 1084default set up is identical for 53c810a and 53c875 NVRAM1085 1086trailer::1087 1088    fe fe   - ? end marker ?1089    00 001090    00 001091 1092default set up is identical for 53c810a and 53c875 NVRAM1093 109417.3 Tekram NVRAM layout1095------------------------1096 1097nvram 64x16 (1024 bit)1098 1099Drive settings::1100 1101    Drive ID 0-15 (addr 0x0yyyy0 = device setup, yyyy = ID)1102		(addr 0x0yyyy1 = 0x0000)1103 1104	x x x x  x x x x  x x x x  x x x x1105		| | |      | |  | | | |1106		| | |      | |  | | |  ----- parity check   0 - off1107		| | |      | |  | | |                       1 - on1108		| | |      | |  | | |1109		| | |      | |  | |  ------- sync neg       0 - off1110		| | |      | |  | |                         1 - on1111		| | |      | |  | |1112		| | |      | |  |  --------- disconnect     0 - off1113		| | |      | |  |                           1 - on1114		| | |      | |  |1115		| | |      | |   ----------- start cmd      0 - off1116		| | |      | |                              1 - on1117		| | |      | |1118		| | |      |  -------------- tagged cmds    0 - off1119		| | |      |                                1 - on1120		| | |      |1121		| | |       ---------------- wide neg       0 - off1122		| | |                                       1 - on1123		| | |1124		    --------------------------- sync rate      0 - 10.0 Mtrans/sec1125							    1 -  8.01126							    2 -  6.61127							    3 -  5.71128							    4 -  5.01129							    5 -  4.01130							    6 -  3.01131							    7 -  2.01132							    7 -  2.01133							    8 - 20.01134							    9 - 16.71135							    a - 13.91136							    b - 11.91137 1138Global settings1139 1140Host flags 0 (addr 0x100000, 32)::1141 1142    x x x x  x x x x  x x x x  x x x x1143    | | | |  | | | |           | | | |1144    | | | |  | | | |            ----------- host ID    0x00 - 0x0f1145    | | | |  | | | |1146    | | | |  | | |  ----------------------- support for    0 - off1147    | | | |  | | |                          > 2 drives     1 - on1148    | | | |  | | |1149    | | | |  | |  ------------------------- support drives 0 - off1150    | | | |  | |                            > 1Gbytes      1 - on1151    | | | |  | |1152    | | | |  |  --------------------------- bus reset on   0 - off1153    | | | |  |                                power on     1 - on1154    | | | |  |1155    | | | |   ----------------------------- active neg     0 - off1156    | | | |                                                1 - on1157    | | | |1158    | | |  -------------------------------- imm seek       0 - off1159    | | |                                                  1 - on1160    | | |1161    | |  ---------------------------------- scan luns      0 - off1162    | |                                                    1 - on1163    | |1164     -------------------------------------- removable      0 - disable1165                                            as BIOS dev    1 - boot device1166                                                           2 - all1167 1168Host flags 1 (addr 0x100001, 33)::1169 1170    x x x x  x x x x  x x x x  x x x x1171               | | |             | | |1172               | | |              --------- boot delay     0 -   3 sec1173               | | |                                       1 -   51174               | | |                                       2 -  101175               | | |                                       3 -  201176               | | |                                       4 -  301177               | | |                                       5 -  601178               | | |                                       6 - 1201179               | | |1180                --------------------------- max tag cmds   0 -  21181                                                           1 -  41182                                                           2 -  81183                                                           3 - 161184                                                           4 - 321185 1186Host flags 2 (addr 0x100010, 34)::1187 1188    x x x x  x x x x  x x x x  x x x x1189                                     |1190                                      ----- F2/F6 enable   0 - off ???1191                                                           1 - on  ???1192 1193checksum (addr 0x111111)1194 1195checksum = 0x1234 - (sum addr 0-63)1196 1197----------------------------------------------------------------------------1198 1199default nvram data::1200 1201    0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x00001202    0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x00001203    0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x00001204    0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x00001205 1206    0x0f07 0x0400 0x0001 0x0000 0x0000 0x0000 0x0000 0x00001207    0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x00001208    0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x00001209    0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0xfbbc1210