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

Linux 6.18.37 · SCSI

Adaptec AHA-1520/1522 SCSI 드라이버

AHA-152x 설정, built-in과 module parameter, C/H/S 기본·확장 geometry 변환을 설명합니다.

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

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

1. 요약·해설

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

요약·해설

aha152x.rst:1-204

AHA-152x 설정, built-in과 module parameter, C/H/S 기본·확장 geometry 변환을 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2 .. include:: <isonum.txt>
3
4 =====================================================
5 Adaptec AHA-1520/1522 SCSI driver for Linux (aha152x)
6 =====================================================
7
8 Copyright |copy| 1993-1999 Jürgen Fischer <fischer@norbit.de>
9
10 TC1550 patches by Luuk van Dijk (ldz@xs4all.nl)
11
12
13 In Revision 2 the driver was modified a lot (especially the
14 bottom-half handler complete()).
15
16 The driver is much cleaner now, has support for the new
17 error handling code in 2.3, produced less cpu load (much
18 less polling loops), has slightly higher throughput (at
19 least on my ancient test box; a i486/33Mhz/20MB).
20
21
22 Configuration Arguments
23 =======================
24
25 ============ ======================================== ======================
26 IOPORT base io address (0x340/0x140)
27 IRQ interrupt level (9-12; default 11)
28 SCSI_ID scsi id of controller (0-7; default 7)
29 RECONNECT allow targets to disconnect from the bus (0/1; default 1 [on])
30 PARITY enable parity checking (0/1; default 1 [on])
31 SYNCHRONOUS enable synchronous transfers (0/1; default 1 [on])
32 DELAY: bus reset delay (default 100)
33 EXT_TRANS: enable extended translation (0/1: default 0 [off])
34 (see NOTES)
35 ============ ======================================== ======================
36
37 Compile Time Configuration
38 ==========================
39
40 (go into AHA152X in drivers/scsi/Makefile):
41
42 - DAUTOCONF
43 use configuration the controller reports (AHA-152x only)
44
45 - DSKIP_BIOSTEST
46 Don't test for BIOS signature (AHA-1510 or disabled BIOS)
47
48 - DSETUP0="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
49 override for the first controller
50
51 - DSETUP1="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
52 override for the second controller
53
54 - DAHA152X_DEBUG
55 enable debugging output
56
57 - DAHA152X_STAT
58 enable some statistics
59
60
61 LILO Command Line Options
62 =========================
63
64 ::
65
66 aha152x=<IOPORT>[,<IRQ>[,<SCSI-ID>[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY> [,<EXT_TRANS]]]]]]]
67
68 The normal configuration can be overridden by specifying a command line.
69 When you do this, the BIOS test is skipped. Entered values have to be
70 valid (known). Don't use values that aren't supported under normal
71 operation. If you think that you need other values: contact me.
72 For two controllers use the aha152x statement twice.
73
74
75 Symbols for Module Configuration
76 ================================
77
78 Choose from 2 alternatives:
79
80 1. specify everything (old)::
81
82 aha152x=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
83
84 configuration override for first controller
85
86 ::
87
88 aha152x1=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS
89
90 configuration override for second controller
91
92 2. specify only what you need to (irq or io is required; new)
93
94 io=IOPORT0[,IOPORT1]
95 IOPORT for first and second controller
96
97 irq=IRQ0[,IRQ1]
98 IRQ for first and second controller
99
100 scsiid=SCSIID0[,SCSIID1]
101 SCSIID for first and second controller
102
103 reconnect=RECONNECT0[,RECONNECT1]
104 allow targets to disconnect for first and second controller
105
106 parity=PAR0[PAR1]
107 use parity for first and second controller
108
109 sync=SYNCHRONOUS0[,SYNCHRONOUS1]
110 enable synchronous transfers for first and second controller
111
112 delay=DELAY0[,DELAY1]
113 reset DELAY for first and second controller
114
115 exttrans=EXTTRANS0[,EXTTRANS1]
116 enable extended translation for first and second controller
117
118
119 If you use both alternatives the first will be taken.
120
121
122 Notes on EXT_TRANS
123 ==================
124
125 SCSI uses block numbers to address blocks/sectors on a device.
126 The BIOS uses a cylinder/head/sector addressing scheme (C/H/S)
127 scheme instead. DOS expects a BIOS or driver that understands this
128 C/H/S addressing.
129
130 The number of cylinders/heads/sectors is called geometry and is required
131 as base for requests in C/H/S addressing. SCSI only knows about the
132 total capacity of disks in blocks (sectors).
133
134 Therefore the SCSI BIOS/DOS driver has to calculate a logical/virtual
135 geometry just to be able to support that addressing scheme. The geometry
136 returned by the SCSI BIOS is a pure calculation and has nothing to
137 do with the real/physical geometry of the disk (which is usually
138 irrelevant anyway).
139
140 Basically this has no impact at all on Linux, because it also uses block
141 instead of C/H/S addressing. Unfortunately C/H/S addressing is also used
142 in the partition table and therefore every operating system has to know
143 the right geometry to be able to interpret it.
144
145 Moreover there are certain limitations to the C/H/S addressing scheme,
146 namely the address space is limited to up to 255 heads, up to 63 sectors
147 and a maximum of 1023 cylinders.
148
149 The AHA-1522 BIOS calculates the geometry by fixing the number of heads
150 to 64, the number of sectors to 32 and by calculating the number of
151 cylinders by dividing the capacity reported by the disk by 64*32 (1 MB).
152 This is considered to be the default translation.
153
154 With respect to the limit of 1023 cylinders using C/H/S you can only
155 address the first GB of your disk in the partition table. Therefore
156 BIOSes of some newer controllers based on the AIC-6260/6360 support
157 extended translation. This means that the BIOS uses 255 for heads,
158 63 for sectors and then divides the capacity of the disk by 255*63
159 (about 8 MB), as soon it sees a disk greater than 1 GB. That results
160 in a maximum of about 8 GB addressable diskspace in the partition table
161 (but there are already bigger disks out there today).
162
163 To make it even more complicated the translation mode might/might
164 not be configurable in certain BIOS setups.
165
166 This driver does some more or less failsafe guessing to get the
167 geometry right in most cases:
168
169 - for disks<1GB: use default translation (C/32/64)
170
171 - for disks>1GB:
172
173 - take current geometry from the partition table
174 (using scsicam_bios_param and accept only 'valid' geometries,
175 ie. either (C/32/64) or (C/63/255)). This can be extended translation
176 even if it's not enabled in the driver.
177
178 - if that fails, take extended translation if enabled by override,
179 kernel or module parameter, otherwise take default translation and
180 ask the user for verification. This might on not yet partitioned
181 disks.
182
183
184 References Used
185 ===============
186
187 "AIC-6260 SCSI Chip Specification", Adaptec Corporation.
188
189 "SCSI COMPUTER SYSTEM INTERFACE - 2 (SCSI-2)", X3T9.2/86-109 rev. 10h
190
191 "Writing a SCSI device driver for Linux", Rik Faith (faith@cs.unc.edu)
192
193 "Kernel Hacker's Guide", Michael K. Johnson (johnsonm@sunsite.unc.edu)
194
195 "Adaptec 1520/1522 User's Guide", Adaptec Corporation.
196
197 Michael K. Johnson (johnsonm@sunsite.unc.edu)
198
199 Drew Eckhardt (drew@cs.colorado.edu)
200
201 Eric Youngdale (eric@andante.org)
202
203 special thanks to Eric Youngdale for the free(!) supplying the
204 documentation on the chip.
205

3. 한국어 전문 번역

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

Revision 2와 기본 설정 인자

1-36

AHA-1520/1522 Linux SCSI driver `aha152x`는 Jürgen Fischer가 1993-1999년에 작성했고 Luuk van Dijk가 TC1550 patch를 제공했다. Revision 2에서는 특히 bottom-half handler `complete()`를 크게 바꿨다.

새 버전은 구조가 더 깨끗하고 Linux 2.3의 새 error handling을 지원한다. Polling loop를 크게 줄여 CPU load가 낮아졌고, 오래된 i486/33MHz/20MB 시험 장비에서도 throughput이 조금 높아졌다.

설정값은 base I/O address `IOPORT` 0x340 또는 0x140, IRQ 9-12 중 기본 11, controller `SCSI_ID` 0-7 중 기본 7이다. `RECONNECT`, `PARITY`, `SYNCHRONOUS`는 0/1이며 모두 기본 on, bus reset `DELAY`는 기본 100, `EXT_TRANS`는 기본 off다.

AHA-152x 기본 인자
인자범위기본값
IOPORT0x340 또는 0x140Hardware 설정
IRQ9-1211
SCSI_ID0-77
RECONNECT0/11
PARITY0/11
SYNCHRONOUS0/11
DELAYReset delay100
EXT_TRANS0/10

허용 범위와 기본값을 한눈에 확인합니다.

.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>

=====================================================
Adaptec AHA-1520/1522 SCSI driver for Linux (aha152x)
=====================================================

Copyright |copy| 1993-1999 Jürgen Fischer <fischer@norbit.de>

TC1550 patches by Luuk van Dijk (ldz@xs4all.nl)


In Revision 2 the driver was modified a lot (especially the
bottom-half handler complete()).

The driver is much cleaner now, has support for the new
error handling code in 2.3, produced less cpu load (much
less polling loops), has slightly higher throughput (at
least on my ancient test box; a i486/33Mhz/20MB).


Configuration Arguments
=======================

============  ========================================  ======================
IOPORT        base io address                           (0x340/0x140)
IRQ           interrupt level                           (9-12; default 11)
SCSI_ID       scsi id of controller                     (0-7; default 7)
RECONNECT     allow targets to disconnect from the bus  (0/1; default 1 [on])
PARITY        enable parity checking                    (0/1; default 1 [on])
SYNCHRONOUS   enable synchronous transfers              (0/1; default 1 [on])
DELAY:        bus reset delay                           (default 100)
EXT_TRANS:    enable extended translation               (0/1: default 0 [off])
              (see NOTES)
============  ========================================  ======================

Compile-time 설정과 LILO override

37-74

`drivers/scsi/Makefile`의 AHA152X 설정에서 `DAUTOCONF`는 AHA-152x controller가 보고한 구성을 사용한다. `DSKIP_BIOSTEST`는 AHA-1510 또는 BIOS가 꺼진 경우 BIOS signature test를 생략한다. `DSETUP0`과 `DSETUP1`은 첫째와 둘째 controller의 여덟 설정값을 덮어쓴다.

`DAHA152X_DEBUG`는 debug 출력을, `DAHA152X_STAT`은 통계를 활성화한다.

LILO command line은 `aha152x=<IOPORT>[,<IRQ>[,<SCSI-ID>[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>]]]]]]]` 형식이다. 이를 쓰면 정상 설정을 override하고 BIOS test를 건너뛴다. 알려진 유효값만 사용하며 controller가 둘이면 `aha152x` 문장을 두 번 쓴다.

Built-in 설정 우선 경로
Controller/BIOS 기본 정보DAUTOCONF 또는 DSETUP0/1LILO aha152x= 인자 존재 여부있으면 BIOS test 생략검증된 값으로 controller 설정

Compile-time 기본값을 boot command line이 대체합니다.

Compile Time Configuration
==========================

(go into AHA152X in drivers/scsi/Makefile):

- DAUTOCONF
    use configuration the controller reports (AHA-152x only)

- DSKIP_BIOSTEST
    Don't test for BIOS signature (AHA-1510 or disabled BIOS)

- DSETUP0="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
    override for the first controller

- DSETUP1="{ IOPORT, IRQ, SCSI_ID, RECONNECT, PARITY, SYNCHRONOUS, DELAY, EXT_TRANS }"
    override for the second controller

- DAHA152X_DEBUG
    enable debugging output

- DAHA152X_STAT
    enable some statistics


LILO Command Line Options
=========================

 ::

    aha152x=<IOPORT>[,<IRQ>[,<SCSI-ID>[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY> [,<EXT_TRANS]]]]]]]

 The normal configuration can be overridden by specifying a command line.
 When you do this, the BIOS test is skipped. Entered values have to be
 valid (known).  Don't use values that aren't supported under normal
 operation.  If you think that you need other values: contact me.
 For two controllers use the aha152x statement twice.

Module parameter 두 형식

75-121

Module 설정에는 두 방식이 있다. 옛 방식은 첫 controller에 `aha152x=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS`, 둘째에 `aha152x1=...`로 모든 값을 지정한다.

새 방식은 필요한 항목만 지정하되 `irq` 또는 `io` 중 하나는 필수다. `io`, `irq`, `scsiid`, `reconnect`, `parity`, `sync`, `delay`, `exttrans` 각각에 첫째와 둘째 controller 값을 comma로 나열한다.

두 방식을 동시에 사용하면 모든 값을 지정하는 첫 번째 방식이 우선한다. `parity=PAR0[PAR1]`은 원문 표기 그대로 보존되어 있지만 다른 두 controller parameter처럼 실제 사용 시 driver가 기대하는 구분 형식을 확인해야 한다.

Module 설정 선택
방식형식우선순위
전체 지정aha152x=... 및 aha152x1=...두 방식이 있으면 우선
항목별 지정io/irq/scsiid/reconnect/parity/sync/delay/exttransirq 또는 io 필수

전체 override와 항목별 설정의 우선순위를 구분합니다.

Symbols for Module Configuration
================================

Choose from 2 alternatives:

1. specify everything (old)::

    aha152x=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS

  configuration override for first controller

  ::

    aha152x1=IOPORT,IRQ,SCSI_ID,RECONNECT,PARITY,SYNCHRONOUS,DELAY,EXT_TRANS

  configuration override for second controller

2. specify only what you need to (irq or io is required; new)

io=IOPORT0[,IOPORT1]
  IOPORT for first and second controller

irq=IRQ0[,IRQ1]
  IRQ for first and second controller

scsiid=SCSIID0[,SCSIID1]
  SCSIID for first and second controller

reconnect=RECONNECT0[,RECONNECT1]
  allow targets to disconnect for first and second controller

parity=PAR0[PAR1]
  use parity for first and second controller

sync=SYNCHRONOUS0[,SYNCHRONOUS1]
  enable synchronous transfers for first and second controller

delay=DELAY0[,DELAY1]
  reset DELAY for first and second controller

exttrans=EXTTRANS0[,EXTTRANS1]
  enable extended translation for first and second controller


If you use both alternatives the first will be taken.

EXT_TRANS와 BIOS geometry 추정

122-183

SCSI는 block number로 sector를 주소 지정하지만 BIOS와 DOS는 cylinder/head/sector, 즉 C/H/S를 사용한다. SCSI disk는 전체 block capacity만 알기 때문에 BIOS 또는 DOS driver가 C/H/S 요청을 위해 논리적 geometry를 계산한다. 이 값은 disk의 실제 물리 geometry와 관계없는 가상값이다.

Linux 자체는 block addressing을 쓰므로 보통 영향이 없지만 partition table에도 C/H/S 값이 들어 있어 다른 운영체제와 함께 해석하려면 같은 geometry를 알아야 한다. C/H/S 주소는 최대 255 head, 63 sector, 1023 cylinder로 제한된다.

AHA-1522의 기본 변환은 head 64, sector 32로 고정하고 disk capacity를 64*32, 즉 약 1MB로 나눠 cylinder 수를 얻는다. 1023 cylinder 제한 때문에 partition table에서는 약 1GB까지만 나타낼 수 있다.

AIC-6260/6360 기반의 새 controller BIOS는 1GB보다 큰 disk에 확장 변환을 쓸 수 있다. Head 255, sector 63으로 두고 capacity를 255*63, 약 8MB로 나눠 최대 약 8GB를 표현한다. BIOS에 따라 이 mode를 설정할 수도 있고 없을 수도 있다.

Driver는 1GB 미만 disk에 기본 C/32/64 변환을 쓴다. 1GB보다 크면 먼저 `scsicam_bios_param`으로 partition table의 현재 geometry를 읽고 C/32/64 또는 C/63/255만 유효하다고 받아들인다. 이 경로에서는 driver option이 꺼져 있어도 table이 확장 geometry면 그대로 쓸 수 있다.

Partition table에서 유효 geometry를 얻지 못하면 override, kernel 또는 module parameter로 확장 변환이 켜졌는지 확인한다. 켜졌으면 확장, 아니면 기본 변환을 사용하고 사용자에게 검증을 요청한다. 아직 partition하지 않은 disk에서 이 fallback이 나타날 수 있다.

AHA-152x geometry 결정
Disk capacity 확인1GB 미만이면 C/32/641GB 이상이면 partition table 검사C/32/64 또는 C/63/255면 채택유효하지 않으면 EXT_TRANS 설정 확인On이면 C/63/255Off이면 C/32/64와 사용자 검증

원문의 조건 분기를 block capacity에서 C/H/S 선택까지 구조화했습니다.

Geometry 변환 한계
ModeHeadSectorCylinder divisor대략적 한계
기본643264*32, 약 1MB약 1GB
확장25563255*63, 약 8MB약 8GB

C/H/S 조합이 partition table에서 표현 가능한 크기를 결정합니다.

Notes on EXT_TRANS
==================

SCSI uses block numbers to address blocks/sectors on a device.
The BIOS uses a cylinder/head/sector addressing scheme (C/H/S)
scheme instead.  DOS expects a BIOS or driver that understands this
C/H/S addressing.

The number of cylinders/heads/sectors is called geometry and is required
as base for requests in C/H/S addressing.  SCSI only knows about the
total capacity of disks in blocks (sectors).

Therefore the SCSI BIOS/DOS driver has to calculate a logical/virtual
geometry just to be able to support that addressing scheme.  The geometry
returned by the SCSI BIOS is a pure calculation and has nothing to
do with the real/physical geometry of the disk (which is usually
irrelevant anyway).

Basically this has no impact at all on Linux, because it also uses block
instead of C/H/S addressing.  Unfortunately C/H/S addressing is also used
in the partition table and therefore every operating system has to know
the right geometry to be able to interpret it.

Moreover there are certain limitations to the C/H/S addressing scheme,
namely the address space is limited to up to 255 heads, up to 63 sectors
and a maximum of 1023 cylinders.

The AHA-1522 BIOS calculates the geometry by fixing the number of heads
to 64, the number of sectors to 32 and by calculating the number of
cylinders by dividing the capacity reported by the disk by 64*32 (1 MB).
This is considered to be the default translation.

With respect to the limit of 1023 cylinders using C/H/S you can only
address the first GB of your disk in the partition table.  Therefore
BIOSes of some newer controllers based on the AIC-6260/6360 support
extended translation.  This means that the BIOS uses 255 for heads,
63 for sectors and then divides the capacity of the disk by 255*63
(about 8 MB), as soon it sees a disk greater than 1 GB.  That results
in a maximum of about 8 GB addressable diskspace in the partition table
(but there are already bigger disks out there today).

To make it even more complicated the translation mode might/might
not be configurable in certain BIOS setups.

This driver does some more or less failsafe guessing to get the
geometry right in most cases:

- for disks<1GB: use default translation (C/32/64)

- for disks>1GB:

  - take current geometry from the partition table
    (using scsicam_bios_param and accept only 'valid' geometries,
    ie. either (C/32/64) or (C/63/255)).  This can be extended translation
    even if it's not enabled in the driver.

  - if that fails, take extended translation if enabled by override,
    kernel or module parameter, otherwise take default translation and
    ask the user for verification.  This might on not yet partitioned
    disks.

참고 사양과 기여

184-204

참고 자료는 Adaptec의 `AIC-6260 SCSI Chip Specification`, SCSI-2 표준 `X3T9.2/86-109 rev. 10h`, Rik Faith의 `Writing a SCSI device driver for Linux`, Michael K. Johnson의 `Kernel Hacker's Guide`, Adaptec `1520/1522 User's Guide`다.

Michael K. Johnson, Drew Eckhardt, Eric Youngdale이 관련 작업에 기여했고, 특히 Eric Youngdale이 chip 문서를 무료로 제공했다.

AHA-152x 참고 자료
종류자료
ChipAIC-6260 SCSI Chip Specification
ProtocolSCSI-2 rev. 10h
Driver 작성Writing a SCSI device driver for Linux
KernelKernel Hacker's Guide
제품Adaptec 1520/1522 User's Guide

Hardware 사양, protocol 표준과 Linux driver 지침을 함께 사용했습니다.

References Used
===============

 "AIC-6260 SCSI Chip Specification", Adaptec Corporation.

 "SCSI COMPUTER SYSTEM INTERFACE - 2 (SCSI-2)", X3T9.2/86-109 rev. 10h

 "Writing a SCSI device driver for Linux", Rik Faith (faith@cs.unc.edu)

 "Kernel Hacker's Guide", Michael K. Johnson (johnsonm@sunsite.unc.edu)

 "Adaptec 1520/1522 User's Guide", Adaptec Corporation.

 Michael K. Johnson (johnsonm@sunsite.unc.edu)

 Drew Eckhardt (drew@cs.colorado.edu)

 Eric Youngdale (eric@andante.org)

 special thanks to Eric Youngdale for the free(!) supplying the
 documentation on the chip.