← Documents Documentation/scsi/sym53c8xx_2.rst GitHub 원문 ↗

Linux 6.18.37 · SCSI

SYM-2 SYM53C8XX·LSI53C10XX SCSI driver

SYM-2 driver의 지원 chip, SCRIPTS 최적화, queueing·control·boot option, 오류 진단과 Symbios·Tekram NVRAM layout을 설명합니다.

Source pathDocumentation/scsi/sym53c8xx_2.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

sym53c8xx_2.rst:1-1209

SYM53C8XX·LSI53C10XX 세대의 capability와 SCSI SCRIPTS 실행 구조를 기반으로, tagged queue depth 적응, procfs command, boot parameter, bus·register 오류 진단, 두 vendor의 NVRAM byte·bit layout까지 다루는 종합 운영 문서입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ============
4 SYM-2 driver
5 ============
6
7 Written by Gerard Roudier <[email protected]>
8
9 21 Rue Carnot
10
11 95170 DEUIL LA BARRE - FRANCE
12
13 Updated by Matthew Wilcox <[email protected]>
14
15 2004-10-09
16
17 .. Contents
18
19 1. Introduction
20 2. Supported chips and SCSI features
21 3. Advantages of this driver for newer chips.
22 3.1 Optimized SCSI SCRIPTS
23 3.2 New features appeared with the SYM53C896
24 4. Memory mapped I/O versus normal I/O
25 5. Tagged command queueing
26 6. Parity checking
27 7. Profiling information
28 8. Control commands
29 8.1 Set minimum synchronous period
30 8.2 Set wide size
31 8.3 Set maximum number of concurrent tagged commands
32 8.4 Set debug mode
33 8.5 Set flag (no_disc)
34 8.6 Set verbose level
35 8.7 Reset all logical units of a target
36 8.8 Abort all tasks of all logical units of a target
37 9. Configuration parameters
38 10. Boot setup commands
39 10.1 Syntax
40 10.2 Available arguments
41 10.2.1 Default number of tagged commands
42 10.2.2 Burst max
43 10.2.3 LED support
44 10.2.4 Differential mode
45 10.2.5 IRQ mode
46 10.2.6 Check SCSI BUS
47 10.2.7 Suggest a default SCSI id for hosts
48 10.2.8 Verbosity level
49 10.2.9 Debug mode
50 10.2.10 Settle delay
51 10.2.11 Serial NVRAM
52 10.2.12 Exclude a host from being attached
53 10.3 Converting from old options
54 10.4 SCSI BUS checking boot option
55 11. SCSI problem troubleshooting
56 15.1 Problem tracking
57 15.2 Understanding hardware error reports
58 12. Serial NVRAM support (by Richard Waltham)
59 17.1 Features
60 17.2 Symbios NVRAM layout
61 17.3 Tekram NVRAM layout
62
63
64 1. Introduction
65 ===============
66
67 This driver supports the whole SYM53C8XX family of PCI-SCSI controllers.
68 It also support the subset of LSI53C10XX PCI-SCSI controllers that are based
69 on the SYM53C8XX SCRIPTS language.
70
71 It replaces the sym53c8xx+ncr53c8xx driver bundle and shares its core code
72 with the FreeBSD SYM-2 driver. The 'glue' that allows this driver to work
73 under Linux is contained in 2 files named sym_glue.h and sym_glue.c.
74 Other drivers files are intended not to depend on the Operating System
75 on which the driver is used.
76
77 The history of this driver can be summarized as follows:
78
79 1993: ncr driver written for 386bsd and FreeBSD by:
80
81 - Wolfgang Stanglmeier <[email protected]>
82 - Stefan Esser <[email protected]>
83
84 1996: port of the ncr driver to Linux-1.2.13 and rename it ncr53c8xx.
85
86 - Gerard Roudier
87
88 1998: new sym53c8xx driver for Linux based on LOAD/STORE instruction and that
89 adds full support for the 896 but drops support for early NCR devices.
90
91 - Gerard Roudier
92
93 1999: port of the sym53c8xx driver to FreeBSD and support for the LSI53C1010
94 33 MHz and 66MHz Ultra-3 controllers. The new driver is named 'sym'.
95
96 - Gerard Roudier
97
98 2000: Add support for early NCR devices to FreeBSD 'sym' driver.
99 Break the driver into several sources and separate the OS glue
100 code from the core code that can be shared among different O/Ses.
101 Write a glue code for Linux.
102
103 - Gerard Roudier
104
105 2004: Remove FreeBSD compatibility code. Remove support for versions of
106 Linux before 2.6. Start using Linux facilities.
107
108 This README file addresses the Linux version of the driver. Under FreeBSD,
109 the driver documentation is the sym.8 man page.
110
111 Information about new chips is available at LSILOGIC web server:
112
113 http://www.lsilogic.com/
114
115 SCSI standard documentations are available at T10 site:
116
117 http://www.t10.org/
118
119 Useful SCSI tools written by Eric Youngdale are part of most Linux
120 distributions:
121
122 ============ ==========================
123 scsiinfo command line tool
124 scsi-config TCL/Tk tool using scsiinfo
125 ============ ==========================
126
127 2. Supported chips and SCSI features
128 ====================================
129
130 The following features are supported for all chips:
131
132 - Synchronous negotiation
133 - Disconnection
134 - Tagged command queuing
135 - SCSI parity checking
136 - PCI Master parity checking
137
138 Other features depends on chip capabilities.
139
140 The driver notably uses optimized SCRIPTS for devices that support
141 LOAD/STORE and handles PHASE MISMATCH from SCRIPTS for devices that
142 support the corresponding feature.
143
144 The 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
188 Summary of other supported features:
189
190 :Module: allow to load the driver
191 :Memory mapped I/O: increases performance
192 :Control commands: write operations to the proc SCSI file system
193 :Debugging information: written to syslog (expert only)
194 :Serial NVRAM: Symbios and Tekram formats
195
196 - Scatter / gather
197 - Shared interrupt
198 - Boot setup commands
199
200
201 3. Advantages of this driver for newer chips.
202 =============================================
203
204 3.1 Optimized SCSI SCRIPTS
205 --------------------------
206
207 All chips except the 810, 815 and 825, support new SCSI SCRIPTS instructions
208 named LOAD and STORE that allow to move up to 1 DWORD from/to an IO register
209 to/from memory much faster that the MOVE MEMORY instruction that is supported
210 by the 53c7xx and 53c8xx family.
211
212 The LOAD/STORE instructions support absolute and DSA relative addressing
213 modes. The SCSI SCRIPTS had been entirely rewritten using LOAD/STORE instead
214 of MOVE MEMORY instructions.
215
216 Due to the lack of LOAD/STORE SCRIPTS instructions by earlier chips, this
217 driver also incorporates a different SCRIPTS set based on MEMORY MOVE, in
218 order to provide support for the entire SYM53C8XX chips family.
219
220 3.2 New features appeared with the SYM53C896
221 --------------------------------------------
222
223 Newer chips (see above) allows handling of the phase mismatch context from
224 SCRIPTS (avoids the phase mismatch interrupt that stops the SCSI processor
225 until the C code has saved the context of the transfer).
226
227 The 896 and 1010 chips support 64 bit PCI transactions and addressing,
228 while the 895A supports 32 bit PCI transactions and 64 bit addressing.
229 The SCRIPTS processor of these chips is not true 64 bit, but uses segment
230 registers for bit 32-63. Another interesting feature is that LOAD/STORE
231 instructions that address the on-chip RAM (8k) remain internal to the chip.
232
233 4. Memory mapped I/O versus normal I/O
234 ======================================
235
236 Memory mapped I/O has less latency than normal I/O and is the recommended
237 way for doing IO with PCI devices. Memory mapped I/O seems to work fine on
238 most hardware configurations, but some poorly designed chipsets may break
239 this feature. A configuration option is provided for normal I/O to be
240 used but the driver defaults to MMIO.
241
242 5. Tagged command queueing
243 ==========================
244
245 Queuing more than 1 command at a time to a device allows it to perform
246 optimizations based on actual head positions and its mechanical
247 characteristics. This feature may also reduce average command latency.
248 In order to really gain advantage of this feature, devices must have
249 a reasonable cache size (No miracle is to be expected for a low-end
250 hard disk with 128 KB or less).
251
252 Some known old SCSI devices do not properly support tagged command queuing.
253 Generally, firmware revisions that fix this kind of problems are available
254 at respective vendor web/ftp sites.
255
256 All I can say is that I never have had problem with tagged queuing using
257 this driver and its predecessors. Hard disks that behaved correctly for
258 me using tagged commands are the following:
259
260 - IBM S12 0662
261 - Conner 1080S
262 - Quantum Atlas I
263 - Quantum Atlas II
264 - Seagate Cheetah I
265 - Quantum Viking II
266 - IBM DRVS
267 - Quantum Atlas IV
268 - Seagate Cheetah II
269
270 If your controller has NVRAM, you can configure this feature per target
271 from the user setup tool. The Tekram Setup program allows to tune the
272 maximum number of queued commands up to 32. The Symbios Setup only allows
273 to enable or disable this feature.
274
275 The maximum number of simultaneous tagged commands queued to a device
276 is currently set to 16 by default. This value is suitable for most SCSI
277 disks. With large SCSI disks (>= 2GB, cache >= 512KB, average seek time
278 <= 10 ms), using a larger value may give better performances.
279
280 This driver supports up to 255 commands per device, and but using more than
281 64 is generally not worth-while, unless you are using a very large disk or
282 disk arrays. It is noticeable that most of recent hard disks seem not to
283 accept more than 64 simultaneous commands. So, using more than 64 queued
284 commands is probably just resource wasting.
285
286 If your controller does not have NVRAM or if it is managed by the SDMS
287 BIOS/SETUP, you can configure tagged queueing feature and device queue
288 depths from the boot command-line. For example::
289
290 sym53c8xx=tags:4/t2t3q15-t4q7/t1u0q32
291
292 will set tagged commands queue depths as follow:
293
294 - target 2 all luns on controller 0 --> 15
295 - target 3 all luns on controller 0 --> 15
296 - target 4 all luns on controller 0 --> 7
297 - target 1 lun 0 on controller 1 --> 32
298 - all other target/lun --> 4
299
300 In some special conditions, some SCSI disk firmwares may return a
301 QUEUE FULL status for a SCSI command. This behaviour is managed by the
302 driver using the following heuristic:
303
304 - Each time a QUEUE FULL status is returned, tagged queue depth is reduced
305 to the actual number of disconnected commands.
306
307 - Every 200 successfully completed SCSI commands, if allowed by the
308 current limit, the maximum number of queueable commands is incremented.
309
310 Since QUEUE FULL status reception and handling is resource wasting, the
311 driver notifies by default this problem to user by indicating the actual
312 number of commands used and their status, as well as its decision on the
313 device queue depth change.
314 The heuristic used by the driver in handling QUEUE FULL ensures that the
315 impact on performances is not too bad. You can get rid of the messages by
316 setting verbose level to zero, as follow:
317
318 1st method:
319 boot your system using 'sym53c8xx=verb:0' option.
320 2nd method:
321 apply "setverbose 0" control command to the proc fs entry
322 corresponding to your controller after boot-up.
323
324 6. Parity checking
325 ==================
326
327 The driver supports SCSI parity checking and PCI bus master parity
328 checking. These features must be enabled in order to ensure safe
329 data transfers. Some flawed devices or mother boards may have problems
330 with parity. The options to defeat parity checking have been removed
331 from the driver.
332
333 7. Profiling information
334 ========================
335
336 This driver does not provide profiling information as did its predecessors.
337 This feature was not this useful and added complexity to the code.
338 As the driver code got more complex, I have decided to remove everything
339 that didn't seem actually useful.
340
341 8. Control commands
342 ===================
343
344 Control commands can be sent to the driver with write operations to
345 the proc SCSI file system. The generic command syntax is the
346 following::
347
348 echo "<verb> <parameters>" >/proc/scsi/sym53c8xx/0
349 (assumes controller number is 0)
350
351 Using "all" for "<target>" parameter with the commands below will
352 apply to all targets of the SCSI chain (except the controller).
353
354 Available commands:
355
356 8.1 Set minimum synchronous period factor
357 -----------------------------------------
358
359 setsync <target> <period factor>
360
361 :target: target number
362 :period: minimum synchronous period.
363 Maximum speed = 1000/(4*period factor) except for special
364 cases below.
365
366 Specify a period of 0, to force asynchronous transfer mode.
367
368 - 9 means 12.5 nano-seconds synchronous period
369 - 10 means 25 nano-seconds synchronous period
370 - 11 means 30 nano-seconds synchronous period
371 - 12 means 50 nano-seconds synchronous period
372
373 8.2 Set wide size
374 -----------------
375
376 setwide <target> <size>
377
378 :target: target number
379 :size: 0=8 bits, 1=16bits
380
381 8.3 Set maximum number of concurrent tagged commands
382 ----------------------------------------------------
383
384 settags <target> <tags>
385
386 :target: target number
387 :tags: number of concurrent tagged commands
388 must not be greater than configured (default: 16)
389
390 8.4 Set debug mode
391 ------------------
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 queue
400 result print sense data on CHECK CONDITION status
401 scatter print info about the scatter process
402 scripts print info about the script binding process
403 tiny print minimal debugging information
404 timing print timing information of the NCR chip
405 nego print information about SCSI negotiations
406 phase print information on script interruptions
407 ======== ========================================================
408
409 Use "setdebug" with no argument to reset debug flags.
410
411
412 8.5 Set flag (no_disc)
413 ----------------------
414
415 setflag <target> <flag>
416
417 :target: target number
418
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 4
426 will reset no_disc flag for target 4, so will allow it disconnections.
427 setflag all
428 will allow disconnection for all devices on the SCSI bus.
429
430
431 8.6 Set verbose level
432 ---------------------
433
434 setverbose #level
435
436 The driver default verbose level is 1. This command allows to change
437 th driver verbose level after boot-up.
438
439 8.7 Reset all logical units of a target
440 ---------------------------------------
441
442 resetdev <target>
443
444 :target: target number
445
446 The driver will try to send a BUS DEVICE RESET message to the target.
447
448 8.8 Abort all tasks of all logical units of a target
449 ----------------------------------------------------
450
451 cleardev <target>
452
453 :target: target number
454
455 The driver will try to send a ABORT message to all the logical units
456 of the target.
457
458
459 9. Configuration parameters
460 ===========================
461
462 Under kernel configuration tools (make menuconfig, for example), it is
463 possible to change some default driver configuration parameters.
464 If the firmware of all your devices is perfect enough, all the
465 features supported by the driver can be enabled at start-up. However,
466 if only one has a flaw for some SCSI feature, you can disable the
467 support by the driver of this feature at linux start-up and enable
468 this feature after boot-up only for devices that support it safely.
469
470 Configuration parameters:
471
472 Use 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
476 Default 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
480 Maximum number of queued commands (default answer: 32)
481 This option allows you to specify the maximum number of tagged commands
482 that can be queued to a device. The maximum supported value is 255.
483
484 Synchronous transfers frequency (default answer: 80)
485 This option allows you to specify the frequency in MHz the driver
486 will use at boot time for synchronous data transfer negotiations.
487 0 means "asynchronous data transfers".
488
489 10. Boot setup commands
490 =======================
491
492 10.1 Syntax
493 -----------
494
495 Setup commands can be passed to the driver either at boot time or as
496 parameters to modprobe, as described in Documentation/admin-guide/kernel-parameters.rst
497
498 Example of boot setup command under lilo prompt::
499
500 lilo: linux root=/dev/sda2 sym53c8xx.cmd_per_lun=4 sym53c8xx.sync=10 sym53c8xx.debug=0x200
501
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
506 The following command will install the driver module with the same
507 options as above::
508
509 modprobe sym53c8xx cmd_per_lun=4 sync=10 debug=0x200
510
511 10.2 Available arguments
512 ------------------------
513
514 10.2.1 Default number of tagged commands
515 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
516 - cmd_per_lun=0 (or cmd_per_lun=1) tagged command queuing disabled
517 - cmd_per_lun=#tags (#tags > 1) tagged command queuing enabled
518
519 #tags will be truncated to the max queued commands configuration parameter.
520
521 10.2.2 Burst max
522 ^^^^^^^^^^^^^^^^
523
524 ========== ======================================================
525 burst=0 burst disabled
526 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 burst
530 transfers max.
531 ========== ======================================================
532
533 By default the driver uses the maximum value supported by the chip.
534
535 10.2.3 LED support
536 ^^^^^^^^^^^^^^^^^^
537
538 ===== ===================
539 led=1 enable LED support
540 led=0 disable LED support
541 ===== ===================
542
543 Do not enable LED support if your scsi board does not use SDMS BIOS.
544 (See 'Configuration parameters')
545
546 10.2.4 Differential mode
547 ^^^^^^^^^^^^^^^^^^^^^^^^
548
549 ====== =================================
550 diff=0 never set up diff mode
551 diff=1 set up diff mode if BIOS set it
552 diff=2 always set up diff mode
553 diff=3 set diff mode if GPIO3 is not set
554 ====== =================================
555
556 10.2.5 IRQ mode
557 ^^^^^^^^^^^^^^^
558
559 ====== ================================================
560 irqm=0 always open drain
561 irqm=1 same as initial settings (assumed BIOS settings)
562 irqm=2 always totem pole
563 ====== ================================================
564
565 10.2.6 Check SCSI BUS
566 ^^^^^^^^^^^^^^^^^^^^^
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
578 10.2.7 Suggest a default SCSI id for hosts
579 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 ignore
587 any value suggested as boot option. Otherwise, if a suggested value
588 different from 255 has been supplied, it will use it. Otherwise, it will
589 try to deduce the value previously set in the hardware and use value
590 7 if the hardware value is zero.
591
592 10.2.8 Verbosity level
593 ^^^^^^^^^^^^^^^^^^^^^^^
594
595 ====== ========
596 verb=0 minimal
597 verb=1 normal
598 verb=2 too much
599 ====== ========
600
601 10.2.9 Debug mode
602 ^^^^^^^^^^^^^^^^^
603
604 ========= ====================================
605 debug=0 clear debug flags
606 debug=#x set debug flags
607
608 #x is an integer value combining the
609 following power-of-2 values:
610
611 ============= ======
612 DEBUG_ALLOC 0x1
613 DEBUG_PHASE 0x2
614 DEBUG_POLL 0x4
615 DEBUG_QUEUE 0x8
616 DEBUG_RESULT 0x10
617 DEBUG_SCATTER 0x20
618 DEBUG_SCRIPT 0x40
619 DEBUG_TINY 0x80
620 DEBUG_TIMING 0x100
621 DEBUG_NEGO 0x200
622 DEBUG_TAGS 0x400
623 DEBUG_FREEZE 0x800
624 DEBUG_RESTART 0x1000
625 ============= ======
626 ========= ====================================
627
628 You can play safely with DEBUG_NEGO. However, some of these flags may
629 generate bunches of syslog messages.
630
631 10.2.10 Settle delay
632 ^^^^^^^^^^^^^^^^^^^^
633
634 ======== ===================
635 settle=n delay for n seconds
636 ======== ===================
637
638 After a bus reset, the driver will delay for n seconds before talking
639 to any device on the bus. The default is 3 seconds and safe mode will
640 default it to 10.
641
642 10.2.11 Serial NVRAM
643 ^^^^^^^^^^^^^^^^^^^^
644
645 .. Note:: option not currently implemented.
646
647 ======= =========================================
648 nvram=n do not look for serial NVRAM
649 nvram=y test controllers for onboard serial NVRAM
650 ======= =========================================
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 devices
659 0x04 ignore NVRAM "Wide negotiation" parameter for all devices
660 0x08 ignore NVRAM "Scan at boot time" parameter for all devices
661 0x80 also attach controllers set to OFF in the NVRAM (sym53c8xx only)
662 ==== =================================================================
663
664 10.2.12 Exclude a host from being attached
665 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 the
671 driver not to attach hosts at address 0xb400 and 0xc000.
672
673 10.3 Converting from old style options
674 --------------------------------------
675
676 Previously, the sym2 driver accepted arguments of the form::
677
678 sym53c8xx=tags:4,sync:10,debug:0x200
679
680 As a result of the new module parameters, this is no longer available.
681 Most of the options have remained the same, but tags has become
682 cmd_per_lun to reflect its different purposes. The sample above would
683 be specified as::
684
685 modprobe sym53c8xx cmd_per_lun=4 sync=10 debug=0x200
686
687 or on the kernel boot line as::
688
689 sym53c8xx.cmd_per_lun=4 sym53c8xx.sync=10 sym53c8xx.debug=0x200
690
691 10.4 SCSI BUS checking boot option
692 ----------------------------------
693
694 When this option is set to a non-zero value, the driver checks SCSI lines
695 logic state, 100 micro-seconds after having asserted the SCSI RESET line.
696 The driver just reads SCSI lines and checks all lines read FALSE except RESET.
697 Since SCSI devices shall release the BUS at most 800 nano-seconds after SCSI
698 RESET has been asserted, any signal to TRUE may indicate a SCSI BUS problem.
699 Unfortunately, the following common SCSI BUS problems are not detected:
700
701 - Only 1 terminator installed.
702 - Misplaced terminators.
703 - Bad quality terminators.
704
705 On the other hand, either bad cabling, broken devices, not conformant
706 devices, ... may cause a SCSI signal to be wrong when the driver reads it.
707
708 15. SCSI problem troubleshooting
709 ================================
710
711 15.1 Problem tracking
712 ---------------------
713
714 Most SCSI problems are due to a non conformant SCSI bus or too buggy
715 devices. If unfortunately you have SCSI problems, you can check the
716 following things:
717
718 - SCSI bus cables
719 - terminations at both end of the SCSI chain
720 - linux syslog messages (some of them may help you)
721
722 If you do not find the source of problems, you can configure the
723 driver or devices in the NVRAM with minimal features.
724
725 - only asynchronous data transfers
726 - tagged commands disabled
727 - disconnections not allowed
728
729 Now, if your SCSI bus is ok, your system has every chance to work
730 with this safe configuration but performances will not be optimal.
731
732 If it still fails, then you can send your problem description to
733 appropriate mailing lists or news-groups. Send me a copy in order to
734 be sure I will receive it. Obviously, a bug in the driver code is
735 possible.
736
737 My current email address: Gerard Roudier <[email protected]>
738
739 Allowing disconnections is important if you use several devices on
740 your SCSI bus but often causes problems with buggy devices.
741 Synchronous data transfers increases throughput of fast devices like
742 hard disks. Good SCSI hard disks with a large cache gain advantage of
743 tagged commands queuing.
744
745 15.2 Understanding hardware error reports
746 -----------------------------------------
747
748 When the driver detects an unexpected error condition, it may display a
749 message of the following pattern::
750
751 sym0:1: ERROR (0:48) (1-21-65) (f/95/0) @ (script 7c0:19000000).
752 sym0: script cmd = 19000000
753 sym0: regdump: da 10 80 95 47 0f 01 07 75 01 81 21 80 01 09 00.
754
755 Some fields in such a message may help you understand the cause of the
756 problem, 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
761 Field A : target number.
762 SCSI ID of the device the controller was talking with at the moment the
763 error occurs.
764
765 Field B : DSTAT io register (DMA STATUS)
766 ======== =============================================================
767 Bit 0x40 MDPE Master Data Parity Error
768 Data parity error detected on the PCI BUS.
769 Bit 0x20 BF Bus Fault
770 PCI bus fault condition detected
771 Bit 0x01 IID Illegal Instruction Detected
772 Set by the chip when it detects an Illegal Instruction format
773 on some condition that makes an instruction illegal.
774 Bit 0x80 DFE Dma Fifo Empty
775 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
781 Field C : SIST io register (SCSI Interrupt Status)
782 ======== ==================================================================
783 Bit 0x08 SGE SCSI GROSS ERROR
784 Indicates that the chip detected a severe error condition
785 on the SCSI BUS that prevents the SCSI protocol from functioning
786 properly.
787 Bit 0x04 UDC Unexpected Disconnection
788 Indicates that the device released the SCSI BUS when the chip
789 was not expecting this to happen. A device may behave so to
790 indicate the SCSI initiator that an error condition not reportable using the SCSI protocol has occurred.
791 Bit 0x02 RST SCSI BUS Reset
792 Generally SCSI targets do not reset the SCSI BUS, although any
793 device on the BUS can reset it at any time.
794 Bit 0x01 PAR Parity
795 SCSI parity error detected.
796 ======== ==================================================================
797
798 On a faulty SCSI BUS, any error condition among SGE (0x08), UDC (0x04) and
799 PAR (0x01) may be detected by the chip. If your SCSI system sometimes
800 encounters such error conditions, especially SCSI GROSS ERROR, then a SCSI
801 BUS problem is likely the cause of these errors.
802
803 For fields D,E,F,G and H, you may look into the sym53c8xx_defs.h file
804 that contains some minimal comments on IO register bits.
805
806 Field D : SOCL Scsi Output Control Latch
807 This register reflects the state of the SCSI control lines the
808 chip want to drive or compare against.
809 Field E : SBCL Scsi Bus Control Lines
810 Actual value of control lines on the SCSI BUS.
811 Field F : SBDL Scsi Bus Data Lines
812 Actual value of data lines on the SCSI BUS.
813 Field G : SXFER SCSI Transfer
814 Contains the setting of the Synchronous Period for output and
815 the current Synchronous offset (offset 0 means asynchronous).
816 Field H : SCNTL3 Scsi Control Register 3
817 Contains the setting of timing values for both asynchronous and
818 synchronous data transfers.
819 Field I : SCNTL4 Scsi Control Register 4
820 Only meaningful for 53C1010 Ultra3 controllers.
821
822 Understanding Fields J, K, L and dumps requires to have good knowledge of
823 SCSI standards, chip cores functionnals and internal driver data structures.
824 You are not required to decode and understand them, unless you want to help
825 maintain the driver code.
826
827 17. Serial NVRAM (added by Richard Waltham: [email protected])
828 ==========================================================================
829
830 17.1 Features
831 -------------
832
833 Enabling serial NVRAM support enables detection of the serial NVRAM included
834 on Symbios and some Symbios compatible host adaptors, and Tekram boards. The
835 serial NVRAM is used by Symbios and Tekram to hold set up parameters for the
836 host adaptor and its attached drives.
837
838 The Symbios NVRAM also holds data on the boot order of host adaptors in a
839 system with more than one host adaptor. This information is no longer used
840 as it's fundamentally incompatible with the hotplug PCI model.
841
842 Tekram boards using Symbios chips, DC390W/F/U, which have NVRAM are detected
843 and this is used to distinguish between Symbios compatible and Tekram host
844 adaptors. This is used to disable the Symbios compatible "diff" setting
845 incorrectly set on Tekram boards if the CONFIG_SCSI_53C8XX_SYMBIOS_COMPAT
846 configuration parameter is set enabling both Symbios and Tekram boards to be
847 used together with the Symbios cards using all their features, including
848 "diff" support. ("led pin" support for Symbios compatible cards can remain
849 enabled when using Tekram cards. It does nothing useful for Tekram host
850 adaptors but does not cause problems either.)
851
852 The parameters the driver is able to get from the NVRAM depend on the
853 data 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
883 In order to speed up the system boot, for each device configured without
884 the "scan at boot time" option, the driver forces an error on the
885 first TEST UNIT READY command received for this device.
886
887
888 17.2 Symbios NVRAM layout
889 -------------------------
890
891 typical data at NVRAM address 0x100 (53c810a NVRAM)::
892
893 00 00
894 64 01
895 8e 0b
896
897 00 30 00 00 00 00 07 00 00 00 00 00 00 00 07 04 10 04 00 00
898
899 04 00 0f 00 00 10 00 50 00 00 01 00 00 62
900 04 00 03 00 00 10 00 58 00 00 01 00 00 63
901 04 00 01 00 00 10 00 48 00 00 01 00 00 61
902 00 00 00 00 00 00 00 00 00 00 00 00 00 00
903
904 0f 00 08 08 64 00 0a 00
905 0f 00 08 08 64 00 0a 00
906 0f 00 08 08 64 00 0a 00
907 0f 00 08 08 64 00 0a 00
908 0f 00 08 08 64 00 0a 00
909 0f 00 08 08 64 00 0a 00
910 0f 00 08 08 64 00 0a 00
911 0f 00 08 08 64 00 0a 00
912
913 0f 00 08 08 64 00 0a 00
914 0f 00 08 08 64 00 0a 00
915 0f 00 08 08 64 00 0a 00
916 0f 00 08 08 64 00 0a 00
917 0f 00 08 08 64 00 0a 00
918 0f 00 08 08 64 00 0a 00
919 0f 00 08 08 64 00 0a 00
920 0f 00 08 08 64 00 0a 00
921
922 00 00 00 00 00 00 00 00
923 00 00 00 00 00 00 00 00
924 00 00 00 00 00 00 00 00
925 00 00 00 00 00 00 00 00
926 00 00 00 00 00 00 00 00
927 00 00 00 00 00 00 00 00
928 00 00 00 00 00 00 00 00
929 00 00 00 00 00 00 00 00
930
931 00 00 00 00 00 00 00 00
932 00 00 00 00 00 00 00 00
933 00 00 00 00 00 00 00 00
934 00 00 00 00 00 00 00 00
935 00 00 00 00 00 00 00 00
936 00 00 00 00 00 00 00 00
937 00 00 00 00 00 00 00 00
938 00 00 00 00 00 00 00 00
939
940 00 00 00 00 00 00 00 00
941 00 00 00 00 00 00 00 00
942 00 00 00 00 00 00 00 00
943
944 fe fe
945 00 00
946 00 00
947
948 NVRAM layout details
949
950 ============= =================
951 NVRAM Address
952 ============= =================
953 0x000-0x0ff not used
954 0x100-0x26f initialised data
955 0x270-0x7ff not used
956 ============= =================
957
958 general layout::
959
960 header - 6 bytes,
961 data - 356 bytes (checksum is byte sum of this data)
962 trailer - 6 bytes
963 ---
964 total 368 bytes
965
966 data area layout::
967
968 controller set up - 20 bytes
969 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 bytes
974
975 header::
976
977 00 00 - ?? start marker
978 64 01 - byte count (lsb/msb excludes header/trailer)
979 8e 0b - checksum (lsb/msb excludes header/trailer)
980
981 controller set up::
982
983 00 30 00 00 00 00 07 00 00 00 00 00 00 00 07 04 10 04 00 00
984 | | | |
985 | | | -- host ID
986 | | |
987 | | --Removable Media Support
988 | | 0x00 = none
989 | | 0x01 = Bootable Device
990 | | 0x02 = All with Media
991 | |
992 | --flag bits 2
993 | 0x00000001= scan order hi->low
994 | (default 0x00 - scan low->hi)
995 --flag bits 1
996 0x00000001 scam enable
997 0x00000010 parity enable
998 0x00000100 verbose boot msgs
999
1000 remaining bytes unknown - they do not appear to change in my
1001 current set up for any of the controllers.
1003 default set up is identical for 53c810a and 53c875 NVRAM
1004 (Removable Media added Symbios BIOS version 4.09)
1006 boot configuration
1008 boot order set by order of the devices in this table::
1010 04 00 0f 00 00 10 00 50 00 00 01 00 00 62 -- 1st controller
1011 04 00 03 00 00 10 00 58 00 00 01 00 00 63 2nd controller
1012 04 00 01 00 00 10 00 48 00 00 01 00 00 61 3rd controller
1013 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4th controller
1014 | | | | | | | |
1015 | | | | | | ---- PCI io port adr
1016 | | | | | --0x01 init/scan at boot time
1017 | | | | --PCI device/function number (0xdddddfff)
1018 | | ----- ?? PCI vendor ID (lsb/msb)
1019 ----PCI device ID (lsb/msb)
1021 ?? use of this data is a guess but seems reasonable
1023 remaining bytes unknown - they do not appear to change in my
1024 current set up
1026 default set up is identical for 53c810a and 53c875 NVRAM
1028 device set up (up to 16 devices - includes controller)::
1030 0f 00 08 08 64 00 0a 00 - id 0
1031 0f 00 08 08 64 00 0a 00
1032 0f 00 08 08 64 00 0a 00
1033 0f 00 08 08 64 00 0a 00
1034 0f 00 08 08 64 00 0a 00
1035 0f 00 08 08 64 00 0a 00
1036 0f 00 08 08 64 00 0a 00
1037 0f 00 08 08 64 00 0a 00
1039 0f 00 08 08 64 00 0a 00
1040 0f 00 08 08 64 00 0a 00
1041 0f 00 08 08 64 00 0a 00
1042 0f 00 08 08 64 00 0a 00
1043 0f 00 08 08 64 00 0a 00
1044 0f 00 08 08 64 00 0a 00
1045 0f 00 08 08 64 00 0a 00
1046 0f 00 08 08 64 00 0a 00 - id 15
1047 | | | | | |
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 bits
1059 0x00000001 - disconnect enabled
1060 0x00000010 - scan at boot time
1061 0x00000100 - scan luns
1062 0x00001000 - queue tags enabled
1064 remaining bytes unknown - they do not appear to change in my
1065 current set up
1067 ?? use of this data is a guess but seems reasonable
1068 (but it could be max bus width)
1070 default set up for 53c810a NVRAM
1071 default set up for 53c875 NVRAM
1073 - bus width - 0x10
1074 - sync offset ? - 0x10
1075 - sync period - 0x30
1077 ?? spare device space (32 bit bus ??)::
1079 00 00 00 00 00 00 00 00 (19x8bytes)
1080 .
1081 .
1082 00 00 00 00 00 00 00 00
1084 default set up is identical for 53c810a and 53c875 NVRAM
1086 trailer::
1088 fe fe - ? end marker ?
1089 00 00
1090 00 00
1092 default set up is identical for 53c810a and 53c875 NVRAM
1094 17.3 Tekram NVRAM layout
1095 ------------------------
1097 nvram 64x16 (1024 bit)
1099 Drive settings::
1101 Drive ID 0-15 (addr 0x0yyyy0 = device setup, yyyy = ID)
1102 (addr 0x0yyyy1 = 0x0000)
1104 x x x x x x x x x x x x x x x x
1105 | | | | | | | | |
1106 | | | | | | | | ----- parity check 0 - off
1107 | | | | | | | | 1 - on
1108 | | | | | | | |
1109 | | | | | | | ------- sync neg 0 - off
1110 | | | | | | | 1 - on
1111 | | | | | | |
1112 | | | | | | --------- disconnect 0 - off
1113 | | | | | | 1 - on
1114 | | | | | |
1115 | | | | | ----------- start cmd 0 - off
1116 | | | | | 1 - on
1117 | | | | |
1118 | | | | -------------- tagged cmds 0 - off
1119 | | | | 1 - on
1120 | | | |
1121 | | | ---------------- wide neg 0 - off
1122 | | | 1 - on
1123 | | |
1124 --------------------------- sync rate 0 - 10.0 Mtrans/sec
1125 1 - 8.0
1126 2 - 6.6
1127 3 - 5.7
1128 4 - 5.0
1129 5 - 4.0
1130 6 - 3.0
1131 7 - 2.0
1132 7 - 2.0
1133 8 - 20.0
1134 9 - 16.7
1135 a - 13.9
1136 b - 11.9
1138 Global settings
1140 Host flags 0 (addr 0x100000, 32)::
1142 x x x x x x x x x x x x x x x x
1143 | | | | | | | | | | | |
1144 | | | | | | | | ----------- host ID 0x00 - 0x0f
1145 | | | | | | | |
1146 | | | | | | | ----------------------- support for 0 - off
1147 | | | | | | | > 2 drives 1 - on
1148 | | | | | | |
1149 | | | | | | ------------------------- support drives 0 - off
1150 | | | | | | > 1Gbytes 1 - on
1151 | | | | | |
1152 | | | | | --------------------------- bus reset on 0 - off
1153 | | | | | power on 1 - on
1154 | | | | |
1155 | | | | ----------------------------- active neg 0 - off
1156 | | | | 1 - on
1157 | | | |
1158 | | | -------------------------------- imm seek 0 - off
1159 | | | 1 - on
1160 | | |
1161 | | ---------------------------------- scan luns 0 - off
1162 | | 1 - on
1163 | |
1164 -------------------------------------- removable 0 - disable
1165 as BIOS dev 1 - boot device
1166 2 - all
1168 Host flags 1 (addr 0x100001, 33)::
1170 x x x x x x x x x x x x x x x x
1171 | | | | | |
1172 | | | --------- boot delay 0 - 3 sec
1173 | | | 1 - 5
1174 | | | 2 - 10
1175 | | | 3 - 20
1176 | | | 4 - 30
1177 | | | 5 - 60
1178 | | | 6 - 120
1179 | | |
1180 --------------------------- max tag cmds 0 - 2
1181 1 - 4
1182 2 - 8
1183 3 - 16
1184 4 - 32
1186 Host flags 2 (addr 0x100010, 34)::
1188 x x x x x x x x x x x x x x x x
1189 |
1190 ----- F2/F6 enable 0 - off ???
1191 1 - on ???
1193 checksum (addr 0x111111)
1195 checksum = 0x1234 - (sum addr 0-63)
1197 ----------------------------------------------------------------------------
1199 default nvram data::
1201 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000
1202 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000
1203 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000
1204 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000
1206 0x0f07 0x0400 0x0001 0x0000 0x0000 0x0000 0x0000 0x0000
1207 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
1208 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
1209 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0xfbbc

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

문서 정보와 목차

1-63

GPL-2.0 문서인 `SYM-2 driver` 안내서는 Gerard Roudier(`[email protected]`, 프랑스 DEUIL LA BARRE)가 작성했고 Matthew Wilcox(`[email protected]`)가 갱신했다. 문서 날짜는 2004-10-09다.

목차는 driver 소개, 지원 chip·SCSI 기능, 신형 chip 최적화, MMIO, tagged queueing, parity, profiling, procfs control command, configuration과 boot option, 문제 해결, serial NVRAM을 다룬다. 목차에서는 문제 해결과 NVRAM을 11·12절로 적었지만 본문 heading은 역사적으로 남은 15·17절 번호를 사용하며, 이 번역은 원문 번호를 그대로 보존한다.

.. SPDX-License-Identifier: GPL-2.0

============
SYM-2 driver
============

Written by Gerard Roudier <[email protected]>

21 Rue Carnot

95170 DEUIL LA BARRE - FRANCE

Updated by Matthew Wilcox <[email protected]>

2004-10-09

.. Contents

   1.  Introduction
   2.  Supported chips and SCSI features
   3.  Advantages of this driver for newer chips.
         3.1 Optimized SCSI SCRIPTS
         3.2 New features appeared with the SYM53C896
   4.  Memory mapped I/O versus normal I/O
   5.  Tagged command queueing
   6.  Parity checking
   7.  Profiling information
   8.  Control commands
         8.1  Set minimum synchronous period
         8.2  Set wide size
         8.3  Set maximum number of concurrent tagged commands
         8.4  Set debug mode
         8.5  Set flag (no_disc)
         8.6  Set verbose level
         8.7  Reset all logical units of a target
         8.8  Abort all tasks of all logical units of a target
   9.  Configuration parameters
   10. Boot setup commands
         10.1 Syntax
         10.2 Available arguments
                10.2.1  Default number of tagged commands
                10.2.2  Burst max
                10.2.3  LED support
                10.2.4  Differential mode
                10.2.5  IRQ mode
                10.2.6  Check SCSI BUS
                10.2.7  Suggest a default SCSI id for hosts
                10.2.8  Verbosity level
                10.2.9  Debug mode
                10.2.10 Settle delay
                10.2.11 Serial NVRAM
                10.2.12 Exclude a host from being attached
         10.3 Converting from old options
         10.4 SCSI BUS checking boot option
   11. SCSI problem troubleshooting
         15.1 Problem tracking
         15.2 Understanding hardware error reports
   12. Serial NVRAM support (by Richard Waltham)
         17.1 Features
         17.2 Symbios NVRAM layout
         17.3 Tekram  NVRAM layout

Driver 계보와 OS glue 분리

64-126

이 driver는 SYM53C8XX PCI-SCSI controller 전체와 SYM53C8XX SCRIPTS 언어에 기반한 LSI53C10XX controller 일부를 지원한다. 기존 `sym53c8xx+ncr53c8xx` bundle을 대체하고 FreeBSD SYM-2 driver와 core code를 공유한다. Linux에서 동작하게 하는 glue는 `sym_glue.h`와 `sym_glue.c`에 있으며, 나머지 source는 가능한 한 운영체제에 의존하지 않도록 설계됐다.

역사는 1993년 Wolfgang Stanglmeier와 Stefan Esser가 386BSD·FreeBSD용 `ncr` driver를 작성한 데서 시작한다. Gerard Roudier가 1996년 Linux 1.2.13으로 port해 `ncr53c8xx`로 이름을 바꿨다. 1998년에는 LOAD/STORE instruction을 기반으로 하고 896을 완전히 지원하는 Linux `sym53c8xx`를 새로 만들었지만 초기 NCR device 지원은 빠졌다. 1999년 FreeBSD로 port하고 LSI53C1010 33·66 MHz Ultra-3 controller를 지원하면서 새 driver를 `sym`이라 불렀다. 2000년 초기 NCR 지원을 FreeBSD `sym`에 더하고 source를 나눠 OS glue와 공유 core를 분리했으며 Linux glue를 작성했다. 2004년에는 FreeBSD compatibility code와 Linux 2.6 이전 지원을 제거하고 Linux facility를 직접 사용하기 시작했다.

이 README는 Linux version을 설명하며 FreeBSD 문서는 `sym.8` man page다. 새 chip 정보는 `http://www.lsilogic.com/`, SCSI standard는 `http://www.t10.org/`에서 구한다. Eric Youngdale의 SCSI tool은 대부분의 Linux 배포판에 포함되며 `scsiinfo`는 command-line tool, `scsi-config`는 `scsiinfo`를 사용하는 TCL/Tk tool이다.

SYM-2 driver 연혁
연도변경
1993386BSD·FreeBSD ncr driver
1996Linux 1.2.13 port, ncr53c8xx
1998LOAD/STORE 기반 sym53c8xx, 896 지원
1999FreeBSD sym, LSI53C1010 Ultra-3
2000초기 NCR 지원 복구, OS glue 분리
2004Linux 2.6 기준으로 정리

공유 core와 Linux glue가 형성된 과정을 연도순으로 정리한다.

1. Introduction
===============

This driver supports the whole SYM53C8XX family of PCI-SCSI controllers.
It also support the subset of LSI53C10XX PCI-SCSI controllers that are based
on the SYM53C8XX SCRIPTS language.

It replaces the sym53c8xx+ncr53c8xx driver bundle and shares its core code
with the FreeBSD SYM-2 driver. The 'glue' that allows this driver to work
under Linux is contained in 2 files named sym_glue.h and sym_glue.c.
Other drivers files are intended not to depend on the Operating System
on which the driver is used.

The history of this driver can be summarized as follows:

1993: ncr driver written for 386bsd and FreeBSD by:

          - Wolfgang Stanglmeier        <[email protected]>
          - Stefan Esser                <[email protected]>

1996: port of the ncr driver to Linux-1.2.13 and rename it ncr53c8xx.

          - Gerard Roudier

1998: new sym53c8xx driver for Linux based on LOAD/STORE instruction and that
      adds full support for the 896 but drops support for early NCR devices.

          - Gerard Roudier

1999: port of the sym53c8xx driver to FreeBSD and support for the LSI53C1010
      33 MHz and 66MHz Ultra-3 controllers. The new driver is named 'sym'.

          - Gerard Roudier

2000: Add support for early NCR devices to FreeBSD 'sym' driver.
      Break the driver into several sources and separate the OS glue
      code from the core code that can be shared among different O/Ses.
      Write a glue code for Linux.

          - Gerard Roudier

2004: Remove FreeBSD compatibility code.  Remove support for versions of
      Linux before 2.6.  Start using Linux facilities.

This README file addresses the Linux version of the driver. Under FreeBSD,
the driver documentation is the sym.8 man page.

Information about new chips is available at LSILOGIC web server:

          http://www.lsilogic.com/

SCSI standard documentations are available at T10 site:

          http://www.t10.org/

Useful SCSI tools written by Eric Youngdale are part of most Linux
distributions:

   ============ ==========================
   scsiinfo     command line tool
   scsi-config  TCL/Tk tool using scsiinfo
   ============ ==========================

지원 chip과 공통 SCSI 기능

127-200

모든 chip에서 synchronous negotiation, disconnection, tagged command queueing, SCSI parity checking과 PCI master parity checking을 지원한다. 나머지 기능은 chip capability에 따라 다르다. LOAD/STORE를 지원하는 device에는 최적화된 SCRIPTS를 사용하고, 해당 기능을 가진 device에서는 PHASE MISMATCH를 SCRIPTS 안에서 처리한다.

SYM53C8XX·LSI53C10XX capability
ChipSDMS BIOSWideSCSI 표준최대 syncLOAD/STOREHW phase mismatch
810NNFAST1010 MB/sNN
810ANNFAST1010 MB/sYN
815YNFAST1010 MB/sNN
825YYFAST1020 MB/sNN
825AYYFAST1020 MB/sYN
860NNFAST2020 MB/sYN
875YYFAST2040 MB/sYN
875AYYFAST2040 MB/sYY
876YYFAST2040 MB/sYN
895YYFAST4080 MB/sYN
895AYYFAST4080 MB/sYY
896YYFAST4080 MB/sYY
897YYFAST4080 MB/sYY
1510DYYFAST4080 MB/sYY
1010YYFAST80160 MB/sYY
1010_66YYFAST80160 MB/sYY

원문의 전체 chip 표를 같은 열과 값으로 구조화했다. `1010_66`은 33 MHz와 66 MHz PCI bus clock을 지원한다.

그 밖에 module load, 성능을 높이는 memory-mapped I/O, proc SCSI filesystem write를 통한 control command, expert용 syslog debugging, Symbios·Tekram serial NVRAM, scatter/gather, shared interrupt와 boot setup command를 지원한다.

2. Supported chips and SCSI features
====================================

The following features are supported for all chips:

        - Synchronous negotiation
        - Disconnection
        - Tagged command queuing
        - SCSI parity checking
        - PCI Master parity checking

Other features depends on chip capabilities.

The driver notably uses optimized SCRIPTS for devices that support
LOAD/STORE and handles PHASE MISMATCH from SCRIPTS for devices that
support the corresponding feature.

The following table shows some characteristics of the chip family.

+--------+-----------+-----+-----------+------------+------------+---------+
|        |           |     |           |            |Load/store  |Hardware |
|        |On board   |     |           |            |scripts     |phase    |
|Chip    |SDMS BIOS  |Wide |SCSI std.  | Max. sync  |            |mismatch |
+--------+-----------+-----+-----------+------------+------------+---------+
|810     |     N     |  N  | FAST10    | 10 MB/s    |      N     |    N    |
+--------+-----------+-----+-----------+------------+------------+---------+
|810A    |     N     |  N  | FAST10    | 10 MB/s    |      Y     |    N    |
+--------+-----------+-----+-----------+------------+------------+---------+
|815     |     Y     |  N  | FAST10    | 10 MB/s    |      N     |    N    |
+--------+-----------+-----+-----------+------------+------------+---------+
|825     |     Y     |  Y  | FAST10    | 20 MB/s    |      N     |    N    |
+--------+-----------+-----+-----------+------------+------------+---------+
|825A    |     Y     |  Y  | FAST10    | 20 MB/s    |      Y     |    N    |
+--------+-----------+-----+-----------+------------+------------+---------+
|860     |     N     |  N  | FAST20    | 20 MB/s    |      Y     |    N    |
+--------+-----------+-----+-----------+------------+------------+---------+
|875     |     Y     |  Y  | FAST20    | 40 MB/s    |      Y     |    N    |
+--------+-----------+-----+-----------+------------+------------+---------+
|875A    |     Y     |  Y  | FAST20    | 40 MB/s    |      Y     |    Y    |
+--------+-----------+-----+-----------+------------+------------+---------+
|876     |     Y     |  Y  | FAST20    | 40 MB/s    |      Y     |    N    |
+--------+-----------+-----+-----------+------------+------------+---------+
|895     |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    N    |
+--------+-----------+-----+-----------+------------+------------+---------+
|895A    |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    Y    |
+--------+-----------+-----+-----------+------------+------------+---------+
|896     |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    Y    |
+--------+-----------+-----+-----------+------------+------------+---------+
|897     |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    Y    |
+--------+-----------+-----+-----------+------------+------------+---------+
|1510D   |     Y     |  Y  | FAST40    | 80 MB/s    |      Y     |    Y    |
+--------+-----------+-----+-----------+------------+------------+---------+
|1010    |     Y     |  Y  | FAST80    |160 MB/s    |      Y     |    Y    |
+--------+-----------+-----+-----------+------------+------------+---------+
|1010_66 |     Y     |  Y  | FAST80    |160 MB/s    |      Y     |    Y    |
|[1]_    |           |     |           |            |            |         |
+--------+-----------+-----+-----------+------------+------------+---------+

.. [1] Chip supports 33MHz and 66MHz PCI bus clock.


Summary of other supported features:

:Module:                allow to load the driver
:Memory mapped I/O:     increases performance
:Control commands:      write operations to the proc SCSI file system
:Debugging information: written to syslog (expert only)
:Serial NVRAM:          Symbios and Tekram formats

- Scatter / gather
- Shared interrupt
- Boot setup commands

LOAD/STORE SCRIPTS와 896 이후 기능

201-232

810, 815, 825를 제외한 모든 chip은 `LOAD`와 `STORE` SCSI SCRIPTS instruction을 지원한다. 이 instruction은 I/O register와 memory 사이에서 최대 1 DWORD를 옮기며 53c7xx·53c8xx의 `MOVE MEMORY`보다 훨씬 빠르다. Absolute addressing과 DSA-relative addressing을 모두 지원하므로 SCSI SCRIPTS 전체를 `MOVE MEMORY` 대신 LOAD/STORE로 다시 작성했다. 초기 chip도 지원하기 위해 driver에는 MEMORY MOVE 기반의 별도 SCRIPTS set도 함께 들어 있다.

SYM53C896 이후 신형 chip은 phase mismatch context를 SCRIPTS에서 직접 처리해, C code가 transfer context를 저장하는 동안 SCSI processor를 멈추게 하던 phase mismatch interrupt를 피한다. 896과 1010은 64-bit PCI transaction과 addressing을 지원하고, 895A는 32-bit PCI transaction과 64-bit addressing을 지원한다. SCRIPTS processor 자체는 진정한 64 bit가 아니라 bit 32-63용 segment register를 사용한다. On-chip RAM 8 KB를 주소로 하는 LOAD/STORE는 chip 내부에서만 수행된다.

신형 chip의 64-bit 특성
ChipPCI transactionAddressing
895A32 bit64 bit
89664 bit64 bit
101064 bit64 bit

Transaction width와 addressing capability를 구분한다.

3. Advantages of this driver for newer chips.
=============================================

3.1 Optimized SCSI SCRIPTS
--------------------------

All chips except the 810, 815 and 825, support new SCSI SCRIPTS instructions
named LOAD and STORE that allow to move up to 1 DWORD from/to an IO register
to/from memory much faster that the MOVE MEMORY instruction that is supported
by the 53c7xx and 53c8xx family.

The LOAD/STORE instructions support absolute and DSA relative addressing
modes. The SCSI SCRIPTS had been entirely rewritten using LOAD/STORE instead
of MOVE MEMORY instructions.

Due to the lack of LOAD/STORE SCRIPTS instructions by earlier chips, this
driver also incorporates a different SCRIPTS set based on MEMORY MOVE, in
order to provide support for the entire SYM53C8XX chips family.

3.2 New features appeared with the SYM53C896
--------------------------------------------

Newer chips (see above) allows handling of the phase mismatch context from
SCRIPTS (avoids the phase mismatch interrupt that stops the SCSI processor
until the C code has saved the context of the transfer).

The 896 and 1010 chips support 64 bit PCI transactions and addressing,
while the 895A supports 32 bit PCI transactions and 64 bit addressing.
The SCRIPTS processor of these chips is not true 64 bit, but uses segment
registers for bit 32-63. Another interesting feature is that LOAD/STORE
instructions that address the on-chip RAM (8k) remain internal to the chip.

Memory-mapped I/O와 normal I/O

233-241

Memory-mapped I/O는 normal I/O보다 latency가 낮아 PCI device의 권장 I/O 방식이다. 대부분의 hardware에서 잘 동작하지만 설계가 나쁜 일부 chipset은 이 기능을 망가뜨릴 수 있다. 그런 motherboard를 위해 normal I/O configuration option을 제공하지만 driver 기본값은 MMIO다.

4. Memory mapped I/O versus normal I/O
======================================

Memory mapped I/O has less latency than normal I/O and is the recommended
way for doing IO with PCI devices. Memory mapped I/O seems to work fine on
most hardware configurations, but some poorly designed chipsets may break
this feature. A configuration option is provided for normal I/O to be
used but the driver defaults to MMIO.

Tagged command queue depth와 QUEUE FULL 적응

242-323

한 device에 동시에 둘 이상의 command를 queue하면 실제 head 위치와 기계 특성에 따라 drive가 순서를 최적화할 수 있고 평균 command latency도 줄일 수 있다. 효과를 내려면 합리적인 cache 크기가 필요하며 128 KB 이하 저가 disk에는 큰 개선을 기대하기 어렵다. 일부 오래된 SCSI device는 tagged queueing을 올바르게 지원하지 않으므로 vendor web·FTP에서 수정 firmware를 찾아야 한다.

저자가 tagged command로 정상 동작을 확인한 disk는 IBM S12 0662, Conner 1080S, Quantum Atlas I·II·IV, Seagate Cheetah I·II, Quantum Viking II, IBM DRVS다. Controller에 NVRAM이 있으면 user setup tool로 target별 설정이 가능하다. Tekram Setup은 queued command 최대값을 32까지 조정하고 Symbios Setup은 기능을 켜고 끄기만 한다.

동시 tagged command 기본값은 device당 16으로 대부분의 SCSI disk에 적합하다. 2 GB 이상, cache 512 KB 이상, 평균 seek 10 ms 이하의 큰 disk는 더 큰 값이 성능을 높일 수 있다. Driver는 device당 최대 255 command를 지원하지만 매우 큰 disk나 disk array가 아니면 64를 넘길 가치가 거의 없다. 최신 disk 대부분도 동시 command 64개를 넘게 받지 않으므로 더 큰 값은 자원 낭비일 가능성이 높다.

NVRAM이 없거나 SDMS BIOS/SETUP이 관리하지 않는 controller에서는 boot command line으로 설정한다. `sym53c8xx=tags:4/t2t3q15-t4q7/t1u0q32`는 controller 0의 target 2·3 모든 LUN을 15, target 4 모든 LUN을 7, controller 1의 target 1 LUN 0을 32, 나머지를 4로 설정한다.

일부 firmware가 `QUEUE FULL`을 반환하면 driver는 실제 disconnected command 수로 tagged queue depth를 줄인다. 그 뒤 성공한 SCSI command 200개마다 현재 limit이 허용하면 queueable command 최대값을 1씩 늘린다. QUEUE FULL 처리는 자원을 쓰므로 driver는 기본적으로 사용 command 수·status와 depth 변경 결정을 알린다. 메시지를 없애려면 boot option `sym53c8xx=verb:0`을 쓰거나 boot 뒤 controller procfs entry에 `setverbose 0` control command를 적용한다.

QUEUE FULL 적응
QUEUE FULL 수신실제 disconnected command 수로 depth 축소성공 command 200개현재 limit 안에서 depth 1 증가

과도한 queue depth를 줄였다가 안정적으로 회복하는 heuristic이다.

5. Tagged command queueing
==========================

Queuing more than 1 command at a time to a device allows it to perform
optimizations based on actual head positions and its mechanical
characteristics. This feature may also reduce average command latency.
In order to really gain advantage of this feature, devices must have
a reasonable cache size (No miracle is to be expected for a low-end
hard disk with 128 KB or less).

Some known old SCSI devices do not properly support tagged command queuing.
Generally, firmware revisions that fix this kind of problems are available
at respective vendor web/ftp sites.

All I can say is that I never have had problem with tagged queuing using
this driver and its predecessors. Hard disks that behaved correctly for
me using tagged commands are the following:

- IBM S12 0662
- Conner 1080S
- Quantum Atlas I
- Quantum Atlas II
- Seagate Cheetah I
- Quantum Viking II
- IBM DRVS
- Quantum Atlas IV
- Seagate Cheetah II

If your controller has NVRAM, you can configure this feature per target
from the user setup tool. The Tekram Setup program allows to tune the
maximum number of queued commands up to 32. The Symbios Setup only allows
to enable or disable this feature.

The maximum number of simultaneous tagged commands queued to a device
is currently set to 16 by default.  This value is suitable for most SCSI
disks.  With large SCSI disks (>= 2GB, cache >= 512KB, average seek time
<= 10 ms), using a larger value may give better performances.

This driver supports up to 255 commands per device, and but using more than
64 is generally not worth-while, unless you are using a very large disk or
disk arrays. It is noticeable that most of recent hard disks seem not to
accept more than 64 simultaneous commands. So, using more than 64 queued
commands is probably just resource wasting.

If your controller does not have NVRAM or if it is managed by the SDMS
BIOS/SETUP, you can configure tagged queueing feature and device queue
depths from the boot command-line. For example::

  sym53c8xx=tags:4/t2t3q15-t4q7/t1u0q32

will set tagged commands queue depths as follow:

- target 2  all luns  on controller 0 --> 15
- target 3  all luns  on controller 0 --> 15
- target 4  all luns  on controller 0 -->  7
- target 1  lun 0     on controller 1 --> 32
- all other target/lun                -->  4

In some special conditions, some SCSI disk firmwares may return a
QUEUE FULL status for a SCSI command. This behaviour is managed by the
driver using the following heuristic:

- Each time a QUEUE FULL status is returned, tagged queue depth is reduced
  to the actual number of disconnected commands.

- Every 200 successfully completed SCSI commands, if allowed by the
  current limit, the maximum number of queueable commands is incremented.

Since QUEUE FULL status reception and handling is resource wasting, the
driver notifies by default this problem to user by indicating the actual
number of commands used and their status, as well as its decision on the
device queue depth change.
The heuristic used by the driver in handling QUEUE FULL ensures that the
impact on performances is not too bad. You can get rid of the messages by
setting verbose level to zero, as follow:

1st method:
            boot your system using 'sym53c8xx=verb:0' option.
2nd method:
            apply "setverbose 0" control command to the proc fs entry
            corresponding to your controller after boot-up.

Parity 강제와 profiling 제거

324-340

Driver는 안전한 data transfer를 위해 SCSI parity checking과 PCI bus master parity checking을 지원하며 반드시 활성화해야 한다. 결함 있는 device나 motherboard가 parity 문제를 일으킬 수 있지만 parity checking을 끄는 option은 driver에서 제거됐다.

이 driver는 이전 driver가 제공하던 profiling 정보를 제공하지 않는다. 유용성이 낮고 code를 복잡하게 만들었기 때문에 driver가 복잡해지면서 실제로 유용하지 않은 기능을 제거한 결과다.

6. Parity checking
==================

The driver supports SCSI parity checking and PCI bus master parity
checking.  These features must be enabled in order to ensure safe
data transfers.  Some flawed devices or mother boards may have problems
with parity.  The options to defeat parity checking have been removed
from the driver.

7. Profiling information
========================

This driver does not provide profiling information as did its predecessors.
This feature was not this useful and added complexity to the code.
As the driver code got more complex, I have decided to remove everything
that didn't seem actually useful.

Procfs control command와 setsync·setwide·settags·setdebug

341-411

Control command는 proc SCSI filesystem에 write해 보낸다. Controller 0의 일반 문법은 `echo "<verb> <parameters>" >/proc/scsi/sym53c8xx/0`이다. 아래 command에서 target parameter로 `all`을 사용하면 controller 자체를 제외한 SCSI chain 모든 target에 적용한다.

`setsync <target> <period factor>`는 최소 synchronous period를 정한다. 일반 최대 speed는 `1000/(4*period factor)`이고 0은 asynchronous mode를 강제한다. 특수 값 9는 12.5 ns, 10은 25 ns, 11은 30 ns, 12는 50 ns period다. `setwide <target> <size>`에서 size 0은 8 bit, 1은 16 bit다. `settags <target> <tags>`는 동시 tagged command 수를 정하며 configured maximum, 기본 16을 넘을 수 없다.

`setdebug <flags>`는 debug flag를 설정하고 argument 없이 호출하면 모두 reset한다. `alloc`은 ccb·lcb memory allocation, `queue`는 command start queue 삽입, `result`는 CHECK CONDITION sense data, `scatter`는 scatter process, `scripts`는 script binding, `tiny`는 최소 debug, `timing`은 NCR chip timing, `nego`는 SCSI negotiation, `phase`는 script interruption 정보를 출력한다.

기본 control command
Command효과
setsync target period최소 synchronous period; 0은 async
setwide target size0=8 bit, 1=16 bit
settags target tags동시 tagged command 수
setdebug flagsDebug flag 설정; 인자 없으면 reset

Target·값의 의미와 제한을 보존했다.

8. Control commands
===================

Control commands can be sent to the driver with write operations to
the proc SCSI file system. The generic command syntax is the
following::

      echo "<verb> <parameters>" >/proc/scsi/sym53c8xx/0
      (assumes controller number is 0)

Using "all" for "<target>" parameter with the commands below will
apply to all targets of the SCSI chain (except the controller).

Available commands:

8.1 Set minimum synchronous period factor
-----------------------------------------

    setsync <target> <period factor>

    :target:   target number
    :period:   minimum synchronous period.
               Maximum speed = 1000/(4*period factor) except for special
               cases below.

    Specify a period of 0, to force asynchronous transfer mode.

     -  9 means 12.5 nano-seconds synchronous period
     - 10 means 25 nano-seconds synchronous period
     - 11 means 30 nano-seconds synchronous period
     - 12 means 50 nano-seconds synchronous period

8.2 Set wide size
-----------------

    setwide <target> <size>

    :target:   target number
    :size:     0=8 bits, 1=16bits

8.3 Set maximum number of concurrent tagged commands
----------------------------------------------------

    settags <target> <tags>

    :target:   target number
    :tags:     number of concurrent tagged commands
               must not be greater than configured (default: 16)

8.4 Set debug mode
------------------

    setdebug <list of debug flags>

    Available debug flags:

        ======== ========================================================
        alloc    print info about memory allocations (ccb, lcb)
        queue    print info about insertions into the command start queue
        result   print sense data on CHECK CONDITION status
        scatter  print info about the scatter process
        scripts  print info about the script binding process
        tiny     print minimal debugging information
        timing   print timing information of the NCR chip
        nego     print information about SCSI negotiations
        phase    print information on script interruptions
        ======== ========================================================

    Use "setdebug" with no argument to reset debug flags.

Target flag·verbosity·reset·abort

412-458

`setflag <target> <flag>`는 현재 `no_disc` 하나만 지원하며 target의 disconnect를 금지한다. Flag를 생략하면 reset한다. `setflag 4`는 target 4의 `no_disc`를 지워 disconnect를 허용하고, `setflag all`은 bus의 모든 device에 disconnect를 허용한다.

`setverbose #level`은 boot 후 driver verbosity를 바꾸며 기본 level은 1이다. `resetdev <target>`은 target에 BUS DEVICE RESET message를 보내 모든 logical unit을 reset하려 한다. `cleardev <target>`은 target의 모든 logical unit에 ABORT message를 보내 모든 task를 중단하려 한다.

Target control
Command동작
setflagno_disc 설정·해제
setverboseDriver verbosity 변경
resetdevBUS DEVICE RESET 시도
cleardev모든 LUN에 ABORT 시도

Boot 후 procfs로 조정하는 target 단위 작업이다.

8.5 Set flag (no_disc)
----------------------

    setflag <target> <flag>

    :target:    target number

    For the moment, only one flag is available:

        no_disc:   not allow target to disconnect.

    Do not specify any flag in order to reset the flag. For example:

    setflag 4
      will reset no_disc flag for target 4, so will allow it disconnections.
    setflag all
      will allow disconnection for all devices on the SCSI bus.


8.6 Set verbose level
---------------------

    setverbose #level

    The driver default verbose level is 1. This command allows to change
    th driver verbose level after boot-up.

8.7 Reset all logical units of a target
---------------------------------------

    resetdev <target>

    :target:    target number

    The driver will try to send a BUS DEVICE RESET message to the target.

8.8 Abort all tasks of all logical units of a target
----------------------------------------------------

    cleardev <target>

    :target:    target number

    The driver will try to send a ABORT message to all the logical units
    of the target.

Kernel configuration parameter

459-488

`make menuconfig` 같은 kernel configuration tool에서 기본 parameter를 바꿀 수 있다. 모든 device firmware가 충분히 완전하면 driver 기능을 시작부터 모두 켤 수 있다. 하나라도 특정 SCSI 기능에 결함이 있다면 Linux 시작 때 그 기능의 driver 지원을 끄고, boot 후 안전한 device에만 활성화할 수 있다.

`Use normal IO`의 기본 답은 n이며 motherboard가 MMIO를 허용하지 않는다고 의심할 때 y로 바꾼다. 성능이 조금 느려질 수 있다. `Default tagged command queue depth` 기본값은 16이고 0은 tagged command를 사용하지 않으며 boot command line에서도 지정할 수 있다. `Maximum number of queued commands` 기본값은 32, 지원 최대는 255다. `Synchronous transfers frequency` 기본값은 80 MHz이며 boot 시 negotiation할 frequency를 정하고 0은 asynchronous transfer다.

Kernel configuration 기본값
Parameter기본값의미
Use normal IOnMMIO 대신 normal I/O
Default tagged queue depth160이면 tagged command 비활성
Maximum queued commands32최대 255
Synchronous frequency80 MHz0이면 asynchronous

Driver build 때 정하는 네 parameter다.

9. Configuration parameters
===========================

Under kernel configuration tools (make menuconfig, for example), it is
possible to change some default driver configuration parameters.
If the firmware of all your devices is perfect enough, all the
features supported by the driver can be enabled at start-up. However,
if only one has a flaw for some SCSI feature, you can disable the
support by the driver of this feature at linux start-up and enable
this feature after boot-up only for devices that support it safely.

Configuration parameters:

Use normal IO                         (default answer: n)
    Answer "y" if you suspect your mother board to not allow memory mapped I/O.
    May slow down performance a little.

Default tagged command queue depth    (default answer: 16)
    Entering 0 defaults to tagged commands not being used.
    This parameter can be specified from the boot command line.

Maximum number of queued commands     (default answer: 32)
    This option allows you to specify the maximum number of tagged commands
    that can be queued to a device. The maximum supported value is 255.

Synchronous transfers frequency       (default answer: 80)
    This option allows you to specify the frequency in MHz the driver
    will use at boot time for synchronous data transfer negotiations.
    0 means "asynchronous data transfers".

Boot·modprobe 설정 문법

489-510

Setup command는 boot time 또는 `modprobe` parameter로 driver에 전달하며 일반 규칙은 `Documentation/admin-guide/kernel-parameters.rst`를 따른다. LILO 예시 `linux root=/dev/sda2 sym53c8xx.cmd_per_lun=4 sym53c8xx.sync=10 sym53c8xx.debug=0x200`은 tagged command를 켜고 LUN당 최대 4개를 queue하며 synchronous negotiation을 10 Mtrans/s로 설정하고 `DEBUG_NEGO`를 켠다. 같은 module load는 `modprobe sym53c8xx cmd_per_lun=4 sync=10 debug=0x200`이다.

10. Boot setup commands
=======================

10.1 Syntax
-----------

Setup commands can be passed to the driver either at boot time or as
parameters to modprobe, as described in Documentation/admin-guide/kernel-parameters.rst

Example of boot setup command under lilo prompt::

    lilo: linux root=/dev/sda2 sym53c8xx.cmd_per_lun=4 sym53c8xx.sync=10 sym53c8xx.debug=0x200

- enable tagged commands, up to 4 tagged commands queued.
- set synchronous negotiation speed to 10 Mega-transfers / second.
- set DEBUG_NEGO flag.

The following command will install the driver module with the same
options as above::

    modprobe sym53c8xx cmd_per_lun=4 sync=10 debug=0x200

Queue·burst·LED·differential·IRQ option

511-564

`cmd_per_lun=0` 또는 1은 tagged command queueing을 끄고, 1보다 큰 `#tags`는 기능을 켠다. 값은 configured maximum queued command 수로 잘린다. `burst=0`은 burst 비활성, `burst=255`는 초기 I/O register에서 길이를 읽고, `burst=#x`는 최대 `1 << #x` transfer를 허용한다. `#x`는 최대 burst transfer의 밑 2 logarithm인 정수다. 기본적으로 chip이 지원하는 최대값을 쓴다.

`led=1`은 LED 지원을 켜고 0은 끈다. Board가 SDMS BIOS를 사용하지 않으면 켜지 않는다. `diff=0`은 differential mode를 절대 설정하지 않고, 1은 BIOS가 설정했을 때, 2는 항상, 3은 GPIO3가 설정되지 않았을 때 설정한다. `irqm=0`은 항상 open drain, 1은 BIOS 설정으로 가정한 초기값 유지, 2는 항상 totem pole이다.

기본 boot argument
Argument효과
cmd_per_lun0·1 / >1Tagged 비활성 / 활성
burst0 / 255 / #x비활성 / 초기값 / 2^x transfer
led0 / 1LED 비활성 / 활성
diff0·1·2·3never / BIOS / always / GPIO3 조건
irqm0·1·2open drain / 초기값 / totem pole

값별 hardware 동작을 한 표로 묶었다.

10.2 Available arguments
------------------------

10.2.1  Default number of tagged commands
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        - cmd_per_lun=0 (or cmd_per_lun=1) tagged command queuing disabled
        - cmd_per_lun=#tags (#tags > 1) tagged command queuing enabled

  #tags will be truncated to the max queued commands configuration parameter.

10.2.2 Burst max
^^^^^^^^^^^^^^^^

        ========== ======================================================
        burst=0    burst disabled
        burst=255  get burst length from initial IO register settings.
        burst=#x   burst enabled (1<<#x burst transfers max)

                   #x is an integer value which is log base 2 of the burst
                   transfers max.
        ========== ======================================================

  By default the driver uses the maximum value supported by the chip.

10.2.3 LED support
^^^^^^^^^^^^^^^^^^

        =====      ===================
        led=1      enable  LED support
        led=0      disable LED support
        =====      ===================

  Do not enable LED support if your scsi board does not use SDMS BIOS.
  (See 'Configuration parameters')

10.2.4 Differential mode
^^^^^^^^^^^^^^^^^^^^^^^^

        ======        =================================
        diff=0        never set up diff mode
        diff=1        set up diff mode if BIOS set it
        diff=2        always set up diff mode
        diff=3        set diff mode if GPIO3 is not set
        ======        =================================

10.2.5 IRQ mode
^^^^^^^^^^^^^^^

        ======     ================================================
        irqm=0     always open drain
        irqm=1     same as initial settings (assumed BIOS settings)
        irqm=2     always totem pole
        ======     ================================================

Bus check·host ID·verbosity·debug mask

565-630

`buschk` option bit는 0x0이면 검사하지 않고, 0x1이면 검사 오류 때 controller를 attach하지 않으며, 0x2이면 검사하고 warning만 낸다. `hostid=255`는 ID를 제안하지 않는다. `hostid=#x`는 0보다 크고 7보다 작은 x를 host SCSI ID로 제안한다. NVRAM에 ID가 있으면 boot option을 무시한다. 없고 255가 아닌 제안값이 있으면 그 값을 쓰며, 둘 다 아니면 hardware 값에서 추론하고 hardware 값이 0이면 7을 사용한다.

`verb=0`, 1, 2는 각각 minimal, normal, too much verbosity다. `debug=0`은 flag를 지우고 `debug=#x`는 power-of-two flag 조합을 설정한다. 값은 `DEBUG_ALLOC=0x1`, `DEBUG_PHASE=0x2`, `DEBUG_POLL=0x4`, `DEBUG_QUEUE=0x8`, `DEBUG_RESULT=0x10`, `DEBUG_SCATTER=0x20`, `DEBUG_SCRIPT=0x40`, `DEBUG_TINY=0x80`, `DEBUG_TIMING=0x100`, `DEBUG_NEGO=0x200`, `DEBUG_TAGS=0x400`, `DEBUG_FREEZE=0x800`, `DEBUG_RESTART=0x1000`이다. `DEBUG_NEGO`는 비교적 안전하게 사용할 수 있지만 일부 flag는 syslog를 대량으로 만든다.

Debug bit mask
Flag
DEBUG_ALLOC0x1
DEBUG_PHASE0x2
DEBUG_POLL0x4
DEBUG_QUEUE0x8
DEBUG_RESULT0x10
DEBUG_SCATTER0x20
DEBUG_SCRIPT0x40
DEBUG_TINY0x80
DEBUG_TIMING0x100
DEBUG_NEGO0x200
DEBUG_TAGS0x400
DEBUG_FREEZE0x800
DEBUG_RESTART0x1000

`debug=#x`에 OR로 조합하는 전체 값을 보존했다.

10.2.6 Check SCSI BUS
^^^^^^^^^^^^^^^^^^^^^

        buschk=<option bits>

    Available option bits:

        ===    ================================================
        0x0    No check.
        0x1    Check and do not attach the controller on error.
        0x2    Check and just warn on error.
        ===    ================================================

10.2.7 Suggest a default SCSI id for hosts
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

        ==========        ==========================================
        hostid=255        no id suggested.
        hostid=#x        (0 < x < 7) x suggested for hosts SCSI id.
        ==========        ==========================================

    If a host SCSI id is available from the NVRAM, the driver will ignore
    any value suggested as boot option. Otherwise, if a suggested value
    different from 255 has been supplied, it will use it. Otherwise, it will
    try to deduce the value previously set in the hardware and use value
    7 if the hardware value is zero.

10.2.8  Verbosity level
^^^^^^^^^^^^^^^^^^^^^^^

        ======     ========
        verb=0     minimal
        verb=1     normal
        verb=2     too much
        ======     ========

10.2.9 Debug mode
^^^^^^^^^^^^^^^^^

        =========   ====================================
        debug=0            clear debug flags
        debug=#x    set debug flags

                    #x is an integer value combining the
                    following power-of-2 values:

                    =============  ======
                    DEBUG_ALLOC       0x1
                    DEBUG_PHASE       0x2
                    DEBUG_POLL        0x4
                    DEBUG_QUEUE       0x8
                    DEBUG_RESULT     0x10
                    DEBUG_SCATTER    0x20
                    DEBUG_SCRIPT     0x40
                    DEBUG_TINY       0x80
                    DEBUG_TIMING    0x100
                    DEBUG_NEGO      0x200
                    DEBUG_TAGS      0x400
                    DEBUG_FREEZE    0x800
                    DEBUG_RESTART  0x1000
                    =============  ======
        =========   ====================================

  You can play safely with DEBUG_NEGO. However, some of these flags may
  generate bunches of syslog messages.

Settle delay·NVRAM·host 제외

631-672

`settle=n`은 bus reset 뒤 bus device와 통신하기 전 n초를 기다린다. 기본값은 3초이고 safe mode에서는 10초다.

Serial NVRAM option은 현재 구현되지 않았다고 표시돼 있다. `nvram=n`은 찾지 않고 y는 controller의 onboard serial NVRAM을 검사한다. Binary form에서 0x01은 NVRAM 검색, 0x02는 모든 device의 synchronous negotiation parameter 무시, 0x04는 wide negotiation 무시, 0x08은 scan-at-boot parameter 무시, 0x80은 NVRAM에서 OFF인 controller도 attach하는 sym53c8xx 전용 option이다.

`excl=<io_address>,...`는 지정 I/O address의 host를 attach하지 않는다. `excl=0xb400,0xc000`은 두 주소의 host를 모두 제외한다.

NVRAM bit option
Bit효과
0x01NVRAM 검색
0x02Synchronous negotiation 설정 무시
0x04Wide negotiation 설정 무시
0x08Scan-at-boot 설정 무시
0x80NVRAM에서 OFF인 controller도 attach

대체 binary 문법의 bit 의미다.

10.2.10 Settle delay
^^^^^^^^^^^^^^^^^^^^

        ========        ===================
        settle=n        delay for n seconds
        ========        ===================

  After a bus reset, the driver will delay for n seconds before talking
  to any device on the bus.  The default is 3 seconds and safe mode will
  default it to 10.

10.2.11 Serial NVRAM
^^^^^^^^^^^^^^^^^^^^

        .. Note:: option not currently implemented.

        =======     =========================================
        nvram=n     do not look for serial NVRAM
        nvram=y     test controllers for onboard serial NVRAM
        =======     =========================================

        (alternate binary form)

        nvram=<bits options>

        ====   =================================================================
        0x01   look for NVRAM  (equivalent to nvram=y)
        0x02   ignore NVRAM "Synchronous negotiation" parameters for all devices
        0x04   ignore NVRAM "Wide negotiation"  parameter for all devices
        0x08   ignore NVRAM "Scan at boot time" parameter for all devices
        0x80   also attach controllers set to OFF in the NVRAM (sym53c8xx only)
        ====   =================================================================

10.2.12 Exclude a host from being attached
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

        excl=<io_address>,...

    Prevent host at a given io address from being attached.
    For example 'excl=0xb400,0xc000' indicate to the
    driver not to attach hosts at address 0xb400 and 0xc000.

구형 option 변환과 SCSI bus 검사 한계

673-707

예전 sym2 문법 `sym53c8xx=tags:4,sync:10,debug:0x200`은 새 module parameter 도입 뒤 사용할 수 없다. 대부분 이름은 같지만 `tags`는 역할을 더 정확히 나타내는 `cmd_per_lun`으로 바뀌었다. Module에서는 `modprobe sym53c8xx cmd_per_lun=4 sync=10 debug=0x200`, kernel boot line에서는 `sym53c8xx.cmd_per_lun=4 sym53c8xx.sync=10 sym53c8xx.debug=0x200`으로 쓴다.

Bus checking option이 0이 아니면 driver는 SCSI RESET을 assert한 100 microsecond 뒤 SCSI line logic state를 읽는다. RESET을 제외한 모든 line이 FALSE인지 확인한다. SCSI device는 RESET assert 후 최대 800 nanosecond 안에 bus를 release해야 하므로 TRUE signal은 bus 문제를 나타낼 수 있다. 다만 terminator가 하나뿐인 경우, terminator 위치 오류, 품질 불량 terminator는 감지하지 못한다. 나쁜 cable, 고장 난 device, standard 비준수 device 등은 읽는 순간 잘못된 SCSI signal을 만들 수 있다.

SCSI bus check의 범위
구분
검출 가능Reset 뒤에도 TRUE인 line: cabling·broken·non-conformant device
검출 불가Terminator 1개, 잘못된 위치, 낮은 품질

검출 가능한 signal 이상과 구조적으로 놓치는 termination 문제를 구분한다.

10.3 Converting from old style options
--------------------------------------

Previously, the sym2 driver accepted arguments of the form::

        sym53c8xx=tags:4,sync:10,debug:0x200

As a result of the new module parameters, this is no longer available.
Most of the options have remained the same, but tags has become
cmd_per_lun to reflect its different purposes.  The sample above would
be specified as::

        modprobe sym53c8xx cmd_per_lun=4 sync=10 debug=0x200

or on the kernel boot line as::

        sym53c8xx.cmd_per_lun=4 sym53c8xx.sync=10 sym53c8xx.debug=0x200

10.4 SCSI BUS checking boot option
----------------------------------

When this option is set to a non-zero value, the driver checks SCSI lines
logic state, 100 micro-seconds after having asserted the SCSI RESET line.
The driver just reads SCSI lines and checks all lines read FALSE except RESET.
Since SCSI devices shall release the BUS at most 800 nano-seconds after SCSI
RESET has been asserted, any signal to TRUE may indicate a SCSI BUS problem.
Unfortunately, the following common SCSI BUS problems are not detected:

- Only 1 terminator installed.
- Misplaced terminators.
- Bad quality terminators.

On the other hand, either bad cabling, broken devices, not conformant
devices, ... may cause a SCSI signal to be wrong when the driver reads it.

SCSI 문제 추적과 안전 구성

708-744

대부분의 SCSI 문제는 규격에 맞지 않는 bus나 bug가 많은 device 때문에 생긴다. 먼저 SCSI bus cable, chain 양 끝 termination, Linux syslog message를 확인한다. 원인을 찾지 못하면 driver 또는 NVRAM의 device 설정을 최소 기능으로 낮춘다. 즉 asynchronous transfer만 사용하고 tagged command를 끄며 disconnection을 허용하지 않는다. Bus가 정상이라면 이 안전 구성은 동작할 가능성이 높지만 성능은 최적이 아니다.

그래도 실패하면 적절한 mailing list나 newsgroup에 문제 설명을 보내고 Gerard Roudier(`[email protected]`)에게도 copy를 보내 수신을 보장한다. Driver bug 가능성도 있다. 여러 device를 쓸 때 disconnection은 중요하지만 bug 있는 device에서 문제를 자주 일으킨다. Synchronous transfer는 hard disk 같은 빠른 device의 throughput을 높이고, cache가 큰 좋은 SCSI disk는 tagged queueing의 이점을 얻는다.

SCSI 문제 축소
Cable·양 끝 termination·syslog 확인Asynchronous onlyTagged command disableDisconnection disable계속 실패하면 상세 보고

성능 기능을 단계적으로 끄며 bus와 device 결함을 가려낸다.

15. SCSI problem troubleshooting
================================

15.1 Problem tracking
---------------------

Most SCSI problems are due to a non conformant SCSI bus or too buggy
devices.  If unfortunately you have SCSI problems, you can check the
following things:

- SCSI bus cables
- terminations at both end of the SCSI chain
- linux syslog messages (some of them may help you)

If you do not find the source of problems, you can configure the
driver or devices in the NVRAM with minimal features.

- only asynchronous data transfers
- tagged commands disabled
- disconnections not allowed

Now, if your SCSI bus is ok, your system has every chance to work
with this safe configuration but performances will not be optimal.

If it still fails, then you can send your problem description to
appropriate mailing lists or news-groups.  Send me a copy in order to
be sure I will receive it.  Obviously, a bug in the driver code is
possible.

  My current email address: Gerard Roudier <[email protected]>

Allowing disconnections is important if you use several devices on
your SCSI bus but often causes problems with buggy devices.
Synchronous data transfers increases throughput of fast devices like
hard disks.  Good SCSI hard disks with a large cache gain advantage of
tagged commands queuing.

Hardware error report field 해석

745-826

예기치 않은 오류에서 `sym0:1: ERROR (0:48) (1-21-65) (f/95/0) @ (script 7c0:19000000)` 같은 message와 script command·register dump가 나온다. Field A는 오류 순간 controller가 통신하던 device의 target SCSI ID다.

Field B는 DMA STATUS인 DSTAT register다. `MDPE 0x40`은 PCI bus master data parity error, `BF 0x20`은 PCI bus fault, `IID 0x01`은 illegal instruction format 또는 instruction을 illegal로 만드는 condition, `DFE 0x80`은 오류가 아닌 DMA FIFO empty 상태다. DSTAT에 MDPE와 BF 조합이 있으면 PCI bus 문제가 원인일 가능성이 높다.

Field C는 SCSI Interrupt Status인 SIST다. `SGE 0x08`은 protocol 정상 동작을 막는 severe SCSI GROSS ERROR, `UDC 0x04`는 예상하지 않은 device bus release이며 SCSI protocol로 보고할 수 없는 오류를 initiator에 알리는 동작일 수 있다. `RST 0x02`는 SCSI bus reset이고 target은 보통 reset하지 않지만 bus의 어떤 device든 언제든 할 수 있다. `PAR 0x01`은 SCSI parity error다. 결함 있는 bus에서는 SGE, UDC, PAR 중 어느 것이든 나타날 수 있고 특히 SGE가 반복되면 bus 문제일 가능성이 높다.

Field D는 chip이 drive하거나 비교하려는 SCSI control line 상태인 SOCL, E는 실제 bus control line인 SBCL, F는 실제 data line인 SBDL이다. G의 SXFER는 output synchronous period와 현재 synchronous offset을 담고 offset 0은 asynchronous다. H의 SCNTL3는 async·sync transfer timing 값이고 I의 SCNTL4는 53C1010 Ultra3에서만 의미가 있다. D-H register bit의 최소 설명은 `sym53c8xx_defs.h`에 있다. J·K·L과 dump를 이해하려면 SCSI standard, chip core와 driver 내부 구조에 대한 깊은 지식이 필요하며 driver 유지보수에 참여하지 않는 사용자는 해독할 필요가 없다.

Error report 핵심 field
FieldRegister·값의미
ATarget오류 당시 SCSI ID
BDSTATPCI DMA status
CSISTSCSI interrupt status
DSOCL출력 control latch
ESBCL실제 bus control line
FSBDL실제 bus data line
GSXFERSync period·offset
HSCNTL3Transfer timing
ISCNTL453C1010 Ultra3 control

Message의 문자 좌표 A-L 가운데 운영 진단에 직접 쓰는 field다.

15.2 Understanding hardware error reports
-----------------------------------------

When the driver detects an unexpected error condition, it may display a
message of the following pattern::

    sym0:1: ERROR (0:48) (1-21-65) (f/95/0) @ (script 7c0:19000000).
    sym0: script cmd = 19000000
    sym0: regdump: da 10 80 95 47 0f 01 07 75 01 81 21 80 01 09 00.

Some fields in such a message may help you understand the cause of the
problem, as follows::

    sym0:1: ERROR (0:48) (1-21-65) (f/95/0) @ (script 7c0:19000000).
    .....A.........B.C....D.E..F....G.H..I.......J.....K...L.......

Field A : target number.
  SCSI ID of the device the controller was talking with at the moment the
  error occurs.

Field B : DSTAT io register (DMA STATUS)
  ========   =============================================================
  Bit 0x40   MDPE Master Data Parity Error
             Data parity error detected on the PCI BUS.
  Bit 0x20   BF   Bus Fault
             PCI bus fault condition detected
  Bit 0x01   IID  Illegal Instruction Detected
             Set by the chip when it detects an Illegal Instruction format
             on some condition that makes an instruction illegal.
  Bit 0x80   DFE Dma Fifo Empty
             Pure status bit that does not indicate an error.
  ========   =============================================================

  If the reported DSTAT value contains a combination of MDPE (0x40),
  BF (0x20), then the cause may be likely due to a PCI BUS problem.

Field C : SIST io register (SCSI Interrupt Status)
  ========   ==================================================================
  Bit 0x08   SGE  SCSI GROSS ERROR
             Indicates that the chip detected a severe error condition
             on the SCSI BUS that prevents the SCSI protocol from functioning
             properly.
  Bit 0x04   UDC  Unexpected Disconnection
             Indicates that the device released the SCSI BUS when the chip
             was not expecting this to happen. A device may behave so to
             indicate the SCSI initiator that an error condition not reportable              using the SCSI protocol has occurred.
  Bit 0x02   RST  SCSI BUS Reset
             Generally SCSI targets do not reset the SCSI BUS, although any
             device on the BUS can reset it at any time.
  Bit 0x01   PAR  Parity
             SCSI parity error detected.
  ========   ==================================================================

  On a faulty SCSI BUS, any error condition among SGE (0x08), UDC (0x04) and
  PAR (0x01) may be detected by the chip. If your SCSI system sometimes
  encounters such error conditions, especially SCSI GROSS ERROR, then a SCSI
  BUS problem is likely the cause of these errors.

For fields D,E,F,G and H, you may look into the sym53c8xx_defs.h file
that contains some minimal comments on IO register bits.

Field D : SOCL  Scsi Output Control Latch
          This register reflects the state of the SCSI control lines the
          chip want to drive or compare against.
Field E : SBCL  Scsi Bus Control Lines
          Actual value of control lines on the SCSI BUS.
Field F : SBDL  Scsi Bus Data Lines
          Actual value of data lines on the SCSI BUS.
Field G : SXFER  SCSI Transfer
          Contains the setting of the Synchronous Period for output and
          the current Synchronous offset (offset 0 means asynchronous).
Field H : SCNTL3 Scsi Control Register 3
          Contains the setting of timing values for both asynchronous and
          synchronous data transfers.
Field I : SCNTL4 Scsi Control Register 4
          Only meaningful for 53C1010 Ultra3 controllers.

Understanding Fields J, K, L and dumps requires to have good knowledge of
SCSI standards, chip cores functionnals and internal driver data structures.
You are not required to decode and understand them, unless you want to help
maintain the driver code.

Serial NVRAM 기능과 format별 parameter

827-887

Serial NVRAM 지원을 켜면 Symbios·일부 compatible host adapter와 Tekram board의 serial NVRAM을 감지한다. NVRAM에는 host adapter와 연결 drive의 setup parameter가 들어 있다. Symbios NVRAM에는 여러 host adapter의 boot order도 있지만 hotplug PCI model과 근본적으로 맞지 않아 더 이상 사용하지 않는다.

Symbios chip을 쓰는 Tekram DC390W/F/U board의 NVRAM을 감지해 Symbios-compatible adapter와 Tekram adapter를 구분한다. `CONFIG_SCSI_53C8XX_SYMBIOS_COMPAT`이 설정된 경우 Tekram board에 잘못 설정된 compatible `diff` 값을 끄므로 두 종류를 함께 사용하면서 Symbios card의 `diff`를 포함한 모든 기능을 유지할 수 있다. Symbios-compatible card의 LED pin 지원은 Tekram과 함께 쓸 때도 켜 둘 수 있으며 Tekram에는 쓸모없지만 문제도 일으키지 않는다.

Tekram과 Symbios format은 host SCSI ID와 parity, device별 synchronous speed, wide/narrow, tagged queueing, disconnection을 모두 제공한다. Symbios만 boot order, verbose boot message, scan-at-boot parameter를 제공한다. Boot scan을 빠르게 하려고 `scan at boot time`이 꺼진 device에서 첫 `TEST UNIT READY` command에는 driver가 강제로 error를 반환한다.

NVRAM format별 제공값
ParameterTekramSymbios
Boot orderNY
Host SCSI IDYY
SCSI parityYY
Verbose bootNY
Sync speedYY
Wide 16 / NarrowYY
Tagged queueingYY
DisconnectionYY
Scan at bootNY

원문의 Y/N 표 전체를 구조화했다.

17. Serial NVRAM (added by Richard Waltham: [email protected])
==========================================================================

17.1 Features
-------------

Enabling serial NVRAM support enables detection of the serial NVRAM included
on Symbios and some Symbios compatible host adaptors, and Tekram boards. The
serial NVRAM is used by Symbios and Tekram to hold set up parameters for the
host adaptor and its attached drives.

The Symbios NVRAM also holds data on the boot order of host adaptors in a
system with more than one host adaptor.  This information is no longer used
as it's fundamentally incompatible with the hotplug PCI model.

Tekram boards using Symbios chips, DC390W/F/U, which have NVRAM are detected
and this is used to distinguish between Symbios compatible and Tekram host
adaptors. This is used to disable the Symbios compatible "diff" setting
incorrectly set on Tekram boards if the CONFIG_SCSI_53C8XX_SYMBIOS_COMPAT
configuration parameter is set enabling both Symbios and Tekram boards to be
used together with the Symbios cards using all their features, including
"diff" support. ("led pin" support for Symbios compatible cards can remain
enabled when using Tekram cards. It does nothing useful for Tekram host
adaptors but does not cause problems either.)

The parameters the driver is able to get from the NVRAM depend on the
data format used, as follow:

+-------------------------------+------------------+--------------+
|                               |Tekram format     |Symbios format|
+-------------------------------+------------------+--------------+
|General and host parameters    |                  |              |
+-------------------------------+------------------+--------------+
|  * Boot order                 |        N         |       Y      |
+-------------------------------+------------------+--------------+
|  * Host SCSI ID               |        Y         |       Y      |
+-------------------------------+------------------+--------------+
|  * SCSI parity checking       |        Y         |       Y      |
+-------------------------------+------------------+--------------+
|  * Verbose boot messages      |        N         |       Y      |
+-------------------------------+------------------+--------------+
|SCSI devices parameters                                          |
+-------------------------------+------------------+--------------+
|  * Synchronous transfer speed |        Y         |       Y      |
+-------------------------------+------------------+--------------+
|  * Wide 16 / Narrow           |        Y         |       Y      |
+-------------------------------+------------------+--------------+
|  * Tagged Command Queuing     |        Y         |       Y      |
|    enabled                    |                  |              |
+-------------------------------+------------------+--------------+
|  * Disconnections enabled     |        Y         |       Y      |
+-------------------------------+------------------+--------------+
|  * Scan at boot time          |        N         |       Y      |
+-------------------------------+------------------+--------------+


In order to speed up the system boot, for each device configured without
the "scan at boot time" option, the driver forces an error on the
first TEST UNIT READY command received for this device.

Symbios NVRAM 영역·header·controller setup

888-1005

53c810a의 address `0x100`에 있는 전형적인 Symbios NVRAM dump를 제시한다. `0x000-0x0ff`와 `0x270-0x7ff`는 미사용이고 `0x100-0x26f`가 초기화 data다. 전체 368 byte는 header 6 byte, checksum 대상 data 356 byte, trailer 6 byte다. Data area는 controller setup 20 byte, boot configuration 56 byte(4×14), device setup 128 byte(16×8), spare로 추정되는 152 byte(19×8)다.

Header는 `00 00`의 추정 start marker, header·trailer를 제외한 byte count `64 01`(LSB/MSB), 같은 범위를 byte sum한 checksum `8e 0b`(LSB/MSB)다. Controller setup 예시에서 host ID, removable media support, 두 flag field를 해석한다. Removable media 값 0x00은 none, 0x01은 bootable device, 0x02는 media가 있는 모든 device다. Flag bits 2의 0x00000001은 scan order high-to-low이며 기본 0은 low-to-high다. Flag bits 1은 0x1 SCAM enable, 0x2 parity enable, 0x4 verbose boot message다. 나머지 byte는 현재 setup에서 controller를 바꿔도 변하지 않아 의미가 알려지지 않았다.

53c810a와 53c875의 기본 setup은 같고 removable media field는 Symbios BIOS 4.09에서 추가됐다.

Symbios NVRAM address map
영역크기·용도
0x000-0x0ff미사용
0x100-0x26f초기화 data 368 byte
0x270-0x7ff미사용
Header6 byte
Data356 byte
Trailer6 byte

원문의 layout 표와 byte 합계를 보존했다.

Controller setup field
Field
Host ID예시 0x04
Removable media0x00 none / 0x01 bootable / 0x02 all with media
Flag bits 20x1 high→low scan
Flag bits 10x1 SCAM / 0x2 parity / 0x4 verbose

ASCII 화살표 도식을 같은 값의 표로 다시 그렸다.

17.2 Symbios NVRAM layout
-------------------------

typical data at NVRAM address 0x100 (53c810a NVRAM)::

    00 00
    64 01
    8e 0b

    00 30 00 00 00 00 07 00 00 00 00 00 00 00 07 04 10 04 00 00

    04 00 0f 00 00 10 00 50 00 00 01 00 00 62
    04 00 03 00 00 10 00 58 00 00 01 00 00 63
    04 00 01 00 00 10 00 48 00 00 01 00 00 61
    00 00 00 00 00 00 00 00 00 00 00 00 00 00

    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00

    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00

    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00

    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00

    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00

    fe fe
    00 00
    00 00

NVRAM layout details

============= =================
NVRAM Address
============= =================
0x000-0x0ff   not used
0x100-0x26f   initialised data
0x270-0x7ff   not used
============= =================

general layout::

        header  -   6 bytes,
        data    - 356 bytes (checksum is byte sum of this data)
        trailer -   6 bytes
                  ---
        total     368 bytes

data area layout::

        controller set up  -  20 bytes
        boot configuration -  56 bytes (4x14 bytes)
        device set up      - 128 bytes (16x8 bytes)
        unused (spare?)    - 152 bytes (19x8 bytes)
                             ---
        total                356 bytes

header::

    00 00   - ?? start marker
    64 01   - byte count (lsb/msb excludes header/trailer)
    8e 0b   - checksum (lsb/msb excludes header/trailer)

controller set up::

    00 30 00 00 00 00 07 00 00 00 00 00 00 00 07 04 10 04 00 00
                    |     |           |     |
                    |     |           |      -- host ID
                    |     |           |
                    |     |            --Removable Media Support
                    |     |               0x00 = none
                    |     |               0x01 = Bootable Device
                    |     |               0x02 = All with Media
                    |     |
                    |      --flag bits 2
                    |        0x00000001= scan order hi->low
                    |            (default 0x00 - scan low->hi)
                        --flag bits 1
                        0x00000001 scam enable
                        0x00000010 parity enable
                        0x00000100 verbose boot msgs

remaining bytes unknown - they do not appear to change in my
current set up for any of the controllers.

default set up is identical for 53c810a and 53c875 NVRAM
(Removable Media added Symbios BIOS version 4.09)

Symbios boot·device setup과 trailer

1006-1093

Boot order는 14 byte entry 네 개의 순서로 정한다. 각 entry에는 PCI device ID(LSB/MSB), 의미를 추정한 PCI vendor ID(LSB/MSB), PCI device/function number `0xdddddfff`, boot 때 init·scan하는 0x01 flag와 PCI I/O port address가 있다. 이 data 해석은 추정이지만 합리적으로 보이며 나머지 byte는 setup을 바꿔도 변하지 않아 의미가 알려지지 않았다. 53c810a와 53c875 기본값은 같다.

Device setup은 controller를 포함해 ID 0-15 각각 8 byte다. Flag bit는 0x00000001 disconnect, 0x00000010 scan at boot, 0x00000100 scan LUN, 0x00001000 tagged queue enable이다. Bus width는 0x08 narrow, 0x10 16-bit wide다. 최대 sync offset으로 추정되는 값은 53c810a NVRAM에서 0x08, 53c875에서 0x10이다. Sync period는 0x28로 추정되는 40 Mtrans/s, 0x30 20 Mtrans/s, 0x64 10 Mtrans/s, 0xc8 5 Mtrans/s, 0x00 asynchronous다. Timeout은 LSB/MSB로 저장한다. 나머지 byte 의미는 알려지지 않았고 max bus width일 가능성도 있다.

53c875 기본 setup은 bus width 0x10, sync offset 0x10, sync period 0x30이다. 뒤의 19×8 byte는 32-bit bus용 spare device space로 추정되며 두 chip의 기본값이 같다. Trailer는 추정 end marker `fe fe`와 `00 00 00 00`이며 53c810a·53c875에서 같다.

Symbios device setup
FieldEncoding
Flags0x1 disconnect / 0x2 boot scan / 0x4 scan LUN / 0x8 tagged
Bus width0x08 narrow / 0x10 wide
Sync offset0x08(810a) / 0x10(875)
Sync period0x28≈40 / 0x30=20 / 0x64=10 / 0xc8=5 / 0x00=async Mtrans/s
TimeoutLSB/MSB

원문의 byte 화살표 도식을 field·값으로 재구성했다.

boot configuration

boot order set by order of the devices in this table::

    04 00 0f 00 00 10 00 50 00 00 01 00 00 62 -- 1st controller
    04 00 03 00 00 10 00 58 00 00 01 00 00 63    2nd controller
    04 00 01 00 00 10 00 48 00 00 01 00 00 61    3rd controller
    00 00 00 00 00 00 00 00 00 00 00 00 00 00    4th controller
        |  |  |  |     |        |     |  |
        |  |  |  |     |        |      ---- PCI io port adr
        |  |  |  |     |         --0x01 init/scan at boot time
        |  |  |  |      --PCI device/function number (0xdddddfff)
        |  |   ----- ?? PCI vendor ID (lsb/msb)
            ----PCI device ID (lsb/msb)

?? use of this data is a guess but seems reasonable

remaining bytes unknown - they do not appear to change in my
current set up

default set up is identical for 53c810a and 53c875 NVRAM

device set up (up to 16 devices - includes controller)::

    0f 00 08 08 64 00 0a 00 - id 0
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00

    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00
    0f 00 08 08 64 00 0a 00 - id 15
    |     |  |  |     |  |
    |     |  |  |      ----timeout (lsb/msb)
    |     |  |   --synch period (0x?? 40 Mtrans/sec- fast 40) (probably 0x28)
    |     |  |                  (0x30 20 Mtrans/sec- fast 20)
    |     |  |                  (0x64 10 Mtrans/sec- fast )
    |     |  |                  (0xc8  5 Mtrans/sec)
    |     |  |                  (0x00  asynchronous)
    |     |   -- ?? max sync offset (0x08 in NVRAM on 53c810a)
    |     |                         (0x10 in NVRAM on 53c875)
    |      --device bus width (0x08 narrow)
    |                         (0x10 16 bit wide)
    --flag bits
        0x00000001 - disconnect enabled
        0x00000010 - scan at boot time
        0x00000100 - scan luns
        0x00001000 - queue tags enabled

remaining bytes unknown - they do not appear to change in my
current set up

?? use of this data is a guess but seems reasonable
(but it could be max bus width)

default set up for 53c810a NVRAM
default set up for 53c875 NVRAM

                                - bus width     - 0x10
                                - sync offset ? - 0x10
                                - sync period   - 0x30

?? spare device space (32 bit bus ??)::

    00 00 00 00 00 00 00 00  (19x8bytes)
    .
    .
    00 00 00 00 00 00 00 00

default set up is identical for 53c810a and 53c875 NVRAM

trailer::

    fe fe   - ? end marker ?
    00 00
    00 00

default set up is identical for 53c810a and 53c875 NVRAM

Tekram 64×16 NVRAM bit layout

1094-1209

Tekram NVRAM은 64×16, 즉 1024 bit다. Drive ID 0-15의 device setup은 address `0x0yyyy0`에 있고 `yyyy`가 ID이며 `0x0yyyy1`은 `0x0000`이다. Drive setting bit는 parity check, synchronous negotiation, disconnect, start command, tagged command, wide negotiation을 각각 on/off한다. Sync rate code는 0=10.0, 1=8.0, 2=6.6, 3=5.7, 4=5.0, 5=4.0, 6=3.0, 7=2.0, 8=20.0, 9=16.7, a=13.9, b=11.9 Mtrans/s다. 원문은 code 7을 두 번 표시하며 그대로 보존한다.

Global `Host flags 0`은 address `0x100000`(32)에 있고 host ID 0x00-0x0f, 2개 초과 drive 지원, 1 GB 초과 drive 지원, power-on bus reset, active negation, immediate seek, scan LUN, removable-as-BIOS-device mode를 담는다. Removable mode 0은 disable, 1은 boot device, 2는 모두다.

`Host flags 1`은 address `0x100001`(33)이다. Boot delay code 0-6은 각각 3, 5, 10, 20, 30, 60, 120초다. 최대 tagged command code 0-4는 각각 2, 4, 8, 16, 32개다. `Host flags 2`는 address `0x100010`(34)이며 F2/F6 enable로 추정되는 bit 하나가 0 off, 1 on이다. Checksum은 address `0x111111`에 있고 `0x1234 - sum(address 0-63)`으로 계산한다. 문서 끝의 default NVRAM 64 word dump도 원문 그대로 보존한다.

Tekram drive setting bit
Field01·code
Parity checkoffon
Sync negotiationoffon
Disconnectoffon
Start commandoffon
Tagged commandoffon
Wide negotiationoffon
Sync ratecode 0=10.01-9,a,b가 8.0~20.0 Mtrans/s

ASCII bit map을 기능 단위 표로 다시 그렸다.

Tekram host flag
Word주소내용
Host flags 00x100000 / 32Host ID, large drive, reset, scan, removable
Host flags 10x100001 / 33Boot delay, max tag commands
Host flags 20x100010 / 34F2/F6 enable 추정
Checksum0x1111110x1234 - sum addr 0-63

Global flag 세 word의 주소와 핵심 field다.

17.3 Tekram NVRAM layout
------------------------

nvram 64x16 (1024 bit)

Drive settings::

    Drive ID 0-15 (addr 0x0yyyy0 = device setup, yyyy = ID)
                (addr 0x0yyyy1 = 0x0000)

        x x x x  x x x x  x x x x  x x x x
                | | |      | |  | | | |
                | | |      | |  | | |  ----- parity check   0 - off
                | | |      | |  | | |                       1 - on
                | | |      | |  | | |
                | | |      | |  | |  ------- sync neg       0 - off
                | | |      | |  | |                         1 - on
                | | |      | |  | |
                | | |      | |  |  --------- disconnect     0 - off
                | | |      | |  |                           1 - on
                | | |      | |  |
                | | |      | |   ----------- start cmd      0 - off
                | | |      | |                              1 - on
                | | |      | |
                | | |      |  -------------- tagged cmds    0 - off
                | | |      |                                1 - on
                | | |      |
                | | |       ---------------- wide neg       0 - off
                | | |                                       1 - on
                | | |
                    --------------------------- sync rate      0 - 10.0 Mtrans/sec
                                                            1 -  8.0
                                                            2 -  6.6
                                                            3 -  5.7
                                                            4 -  5.0
                                                            5 -  4.0
                                                            6 -  3.0
                                                            7 -  2.0
                                                            7 -  2.0
                                                            8 - 20.0
                                                            9 - 16.7
                                                            a - 13.9
                                                            b - 11.9

Global settings

Host flags 0 (addr 0x100000, 32)::

    x x x x  x x x x  x x x x  x x x x
    | | | |  | | | |           | | | |
    | | | |  | | | |            ----------- host ID    0x00 - 0x0f
    | | | |  | | | |
    | | | |  | | |  ----------------------- support for    0 - off
    | | | |  | | |                          > 2 drives     1 - on
    | | | |  | | |
    | | | |  | |  ------------------------- support drives 0 - off
    | | | |  | |                            > 1Gbytes      1 - on
    | | | |  | |
    | | | |  |  --------------------------- bus reset on   0 - off
    | | | |  |                                power on     1 - on
    | | | |  |
    | | | |   ----------------------------- active neg     0 - off
    | | | |                                                1 - on
    | | | |
    | | |  -------------------------------- imm seek       0 - off
    | | |                                                  1 - on
    | | |
    | |  ---------------------------------- scan luns      0 - off
    | |                                                    1 - on
    | |
     -------------------------------------- removable      0 - disable
                                            as BIOS dev    1 - boot device
                                                           2 - all

Host flags 1 (addr 0x100001, 33)::

    x x x x  x x x x  x x x x  x x x x
               | | |             | | |
               | | |              --------- boot delay     0 -   3 sec
               | | |                                       1 -   5
               | | |                                       2 -  10
               | | |                                       3 -  20
               | | |                                       4 -  30
               | | |                                       5 -  60
               | | |                                       6 - 120
               | | |
                --------------------------- max tag cmds   0 -  2
                                                           1 -  4
                                                           2 -  8
                                                           3 - 16
                                                           4 - 32

Host flags 2 (addr 0x100010, 34)::

    x x x x  x x x x  x x x x  x x x x
                                     |
                                      ----- F2/F6 enable   0 - off ???
                                                           1 - on  ???

checksum (addr 0x111111)

checksum = 0x1234 - (sum addr 0-63)

----------------------------------------------------------------------------

default nvram data::

    0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000
    0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000
    0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000
    0x0037 0x0000 0x0037 0x0000 0x0037 0x0000 0x0037 0x0000

    0x0f07 0x0400 0x0001 0x0000 0x0000 0x0000 0x0000 0x0000
    0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
    0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
    0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0xfbbc