← Documents Documentation/scsi/53c700.rst GitHub 원문 ↗

Linux 6.18.37 · SCSI

53c700 드라이버 참고 사항

53c700 계열 core를 board별 glue driver에 연결하고 clock, register, IRQ와 host parameter를 설정하는 방법입니다.

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

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

1. 요약·해설

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

요약·해설

53c700.rst:1-134

53c700 계열 core를 board별 glue driver에 연결하고 clock, register, IRQ와 host parameter를 설정하는 방법입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =======================
4 The 53c700 Driver Notes
5 =======================
6
7 General Description
8 ===================
9
10 This driver supports the 53c700 and 53c700-66 chips. It also supports
11 the 53c710 but only in 53c700 emulation mode. It is full featured and
12 does sync (-66 and 710 only), disconnects and tag command queueing.
13
14 Since the 53c700 must be interfaced to a bus, you need to wrapper the
15 card detector around this driver. For an example, see the
16 NCR_D700.[ch] or lasi700.[ch] files.
17
18 The comments in the 53c700.[ch] files tell you which parts you need to
19 fill in to get the driver working.
20
21
22 Compile Time Flags
23 ==================
24
25 A compile time flag is::
26
27 CONFIG_53C700_LE_ON_BE
28
29 define if the chipset must be supported in little endian mode on a big
30 endian architecture (used for the 700 on parisc).
31
32
33 Using the Chip Core Driver
34 ==========================
35
36 In order to plumb the 53c700 chip core driver into a working SCSI
37 driver, you need to know three things about the way the chip is wired
38 into your system (or expansion card).
39
40 1. The clock speed of the SCSI core
41 2. The interrupt line used
42 3. The memory (or io space) location of the 53c700 registers.
43
44 Optionally, you may also need to know other things, like how to read
45 the SCSI Id from the card bios or whether the chip is wired for
46 differential operation.
47
48 Usually you can find items 2. and 3. from general spec. documents or
49 even by examining the configuration of a working driver under another
50 operating system.
51
52 The clock speed is usually buried deep in the technical literature.
53 It is required because it is used to set up both the synchronous and
54 asynchronous dividers for the chip. As a general rule of thumb,
55 manufacturers set the clock speed at the lowest possible setting
56 consistent with the best operation of the chip (although some choose
57 to drive it off the CPU or bus clock rather than going to the expense
58 of an extra clock chip). The best operation clock speeds are:
59
60 ========= =====
61 53c700 25MHz
62 53c700-66 50MHz
63 53c710 40Mhz
64 ========= =====
65
66 Writing Your Glue Driver
67 ========================
68
69 This will be a standard SCSI driver (I don't know of a good document
70 describing this, just copy from some other driver) with at least a
71 detect and release entry.
72
73 In the detect routine, you need to allocate a struct
74 NCR_700_Host_Parameters sized memory area and clear it (so that the
75 default values for everything are 0). Then you must fill in the
76 parameters that matter to you (see below), plumb the NCR_700_intr
77 routine into the interrupt line and call NCR_700_detect with the host
78 template and the new parameters as arguments. You should also call
79 the relevant request_*_region function and place the register base
80 address into the 'base' pointer of the host parameters.
81
82 In the release routine, you must free the NCR_700_Host_Parameters that
83 you allocated, call the corresponding release_*_region and free the
84 interrupt.
85
86 Handling Interrupts
87 -------------------
88
89 In general, you should just plumb the card's interrupt line in with
90
91 request_irq(irq, NCR_700_intr, <irq flags>, <driver name>, host);
92
93 where host is the return from the relevant NCR_700_detect() routine.
94
95 You may also write your own interrupt handling routine which calls
96 NCR_700_intr() directly. However, you should only really do this if
97 you have a card with more than one chip on it and you can read a
98 register to tell which set of chips wants the interrupt.
99
100 Settable NCR_700_Host_Parameters
101 --------------------------------
102
103 The following are a list of the user settable parameters:
104
105 clock: (MANDATORY)
106 Set to the clock speed of the chip in MHz.
107
108 base: (MANDATORY)
109 Set to the base of the io or mem region for the register set. On 64
110 bit architectures this is only 32 bits wide, so the registers must be
111 mapped into the low 32 bits of memory.
112
113 pci_dev: (OPTIONAL)
114 Set to the PCI board device. Leave NULL for a non-pci board. This is
115 used for the pci_alloc_consistent() and pci_map_*() functions.
116
117 dmode_extra: (OPTIONAL, 53c710 only)
118 Extra flags for the DMODE register. These are used to control bus
119 output pins on the 710. The settings should be a combination of
120 DMODE_FC1 and DMODE_FC2. What these pins actually do is entirely up
121 to the board designer. Usually it is safe to ignore this setting.
122
123 differential: (OPTIONAL)
124 Set to 1 if the chip drives a differential bus.
125
126 force_le_on_be: (OPTIONAL, only if CONFIG_53C700_LE_ON_BE is set)
127 Set to 1 if the chip is operating in little endian mode on a big
128 endian architecture.
129
130 chip710: (OPTIONAL)
131 Set to 1 if the chip is a 53c710.
132
133 burst_disable: (OPTIONAL, 53c710 only)
134 Disable 8 byte bursting for DMA transfers.
135

3. 한국어 전문 번역

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

지원 chip과 endian 설정

1-32

이 드라이버는 53c700과 53c700-66 chip을 지원하며, 53c710은 53c700 emulation mode에서만 지원한다. 동기 전송은 -66과 710에서만 제공하고, disconnect와 tagged command queueing도 구현한 완전한 기능의 core driver다.

53c700은 시스템 bus에 직접 연결해야 하므로 card detector를 이 core driver 바깥의 wrapper로 작성한다. 구현 예는 `NCR_D700.[ch]`와 `lasi700.[ch]`이며, `53c700.[ch]`의 주석은 실제 board driver가 채워야 할 부분을 표시한다.

Big-endian 아키텍처에서 chip을 little-endian mode로 써야 한다면 compile-time symbol `CONFIG_53C700_LE_ON_BE`를 정의한다. 대표적으로 parisc의 700이 이 구성을 사용한다.

53c700 계열 지원
Chip동작 방식동기 전송
53c700기본 지원지원하지 않음
53c700-66기본 지원지원
53c71053c700 emulation mode지원

Core driver가 제공하는 기능과 제약을 구분합니다.

.. SPDX-License-Identifier: GPL-2.0

=======================
The 53c700 Driver Notes
=======================

General Description
===================

This driver supports the 53c700 and 53c700-66 chips.  It also supports
the 53c710 but only in 53c700 emulation mode.  It is full featured and
does sync (-66 and 710 only), disconnects and tag command queueing.

Since the 53c700 must be interfaced to a bus, you need to wrapper the
card detector around this driver.  For an example, see the
NCR_D700.[ch] or lasi700.[ch] files.

The comments in the 53c700.[ch] files tell you which parts you need to
fill in to get the driver working.


Compile Time Flags
==================

A compile time flag is::

        CONFIG_53C700_LE_ON_BE

define if the chipset must be supported in little endian mode on a big
endian architecture (used for the 700 on parisc).

Chip core 연결 정보와 clock

33-65

53c700 chip core를 실제 SCSI driver에 연결하려면 board 배선에 관한 세 정보가 필수다. SCSI core clock 속도, interrupt line, 53c700 register가 놓인 memory 또는 I/O space 주소다. Card BIOS에서 SCSI ID를 읽는 방법과 differential 배선 여부도 필요할 수 있다.

Interrupt와 register 위치는 일반 사양서나 다른 운영체제의 동작하는 driver 설정에서 찾을 수 있다. Clock은 기술 문서 깊숙이 숨어 있는 경우가 많지만 synchronous와 asynchronous divider를 설정하는 데 꼭 필요하다.

제조사는 보통 chip이 최적으로 동작하는 범위에서 가장 낮은 clock을 선택한다. 별도 clock chip 비용을 피하려고 CPU 또는 bus clock으로 구동하는 board도 있다. 권장 동작 clock은 53c700 25MHz, 53c700-66 50MHz, 53c710 40MHz다.

필수 board 정보
항목필수 여부용도
SCSI core clock필수sync/async divider 설정
Interrupt line필수NCR_700_intr 연결
Register base필수memory 또는 I/O 접근
SCSI ID선택Card BIOS 설정 반영
Differential mode선택Bus 구동 방식 설정

Glue driver가 core에 전달해야 하는 하드웨어 사실입니다.

Using the Chip Core Driver
==========================

In order to plumb the 53c700 chip core driver into a working SCSI
driver, you need to know three things about the way the chip is wired
into your system (or expansion card).

1. The clock speed of the SCSI core
2. The interrupt line used
3. The memory (or io space) location of the 53c700 registers.

Optionally, you may also need to know other things, like how to read
the SCSI Id from the card bios or whether the chip is wired for
differential operation.

Usually you can find items 2. and 3. from general spec. documents or
even by examining the configuration of a working driver under another
operating system.

The clock speed is usually buried deep in the technical literature.
It is required because it is used to set up both the synchronous and
asynchronous dividers for the chip.  As a general rule of thumb,
manufacturers set the clock speed at the lowest possible setting
consistent with the best operation of the chip (although some choose
to drive it off the CPU or bus clock rather than going to the expense
of an extra clock chip).  The best operation clock speeds are:

=========  =====
53c700     25MHz
53c700-66  50MHz
53c710     40Mhz
=========  =====

Glue driver 생명주기와 interrupt

66-99

Glue layer는 최소한 detect와 release entry를 갖는 표준 SCSI driver로 작성한다. Detect에서는 `NCR_700_Host_Parameters` 크기의 영역을 할당하고 0으로 지워 모든 기본값을 만든 뒤 필요한 parameter를 채운다.

그 다음 `NCR_700_intr`을 interrupt line에 연결하고 host template과 parameter를 `NCR_700_detect()`에 넘긴다. 해당 `request_*_region()`도 호출하고 register base address를 host parameter의 `base` pointer에 저장한다.

Release에서는 할당한 `NCR_700_Host_Parameters`를 해제하고 짝이 되는 `release_*_region()`과 interrupt 해제를 수행한다.

일반적인 interrupt 등록은 `request_irq(irq, NCR_700_intr, <irq flags>, <driver name>, host)`이며 `host`는 `NCR_700_detect()`의 반환값이다. 여러 chip이 한 card에 있고 어느 chip 집합이 interrupt를 요구했는지 register로 구분할 수 있을 때만 custom handler에서 `NCR_700_intr()`을 직접 호출한다.

53c700 glue driver
Host parameter 할당과 zero 초기화clock/base 등 board 값 설정request regionrequest_irq와 NCR_700_intrNCR_700_detectRelease 시 IRQ·region·parameter 해제

탐지부터 자원 해제까지 대칭적인 생명주기를 유지합니다.

Writing Your Glue Driver
========================

This will be a standard SCSI driver (I don't know of a good document
describing this, just copy from some other driver) with at least a
detect and release entry.

In the detect routine, you need to allocate a struct
NCR_700_Host_Parameters sized memory area and clear it (so that the
default values for everything are 0).  Then you must fill in the
parameters that matter to you (see below), plumb the NCR_700_intr
routine into the interrupt line and call NCR_700_detect with the host
template and the new parameters as arguments.  You should also call
the relevant request_*_region function and place the register base
address into the 'base' pointer of the host parameters.

In the release routine, you must free the NCR_700_Host_Parameters that
you allocated, call the corresponding release_*_region and free the
interrupt.

Handling Interrupts
-------------------

In general, you should just plumb the card's interrupt line in with

request_irq(irq, NCR_700_intr, <irq flags>, <driver name>, host);

where host is the return from the relevant NCR_700_detect() routine.

You may also write your own interrupt handling routine which calls
NCR_700_intr() directly.  However, you should only really do this if
you have a card with more than one chip on it and you can read a
register to tell which set of chips wants the interrupt.

NCR_700_Host_Parameters 설정

100-134

`clock`은 chip MHz 값으로 반드시 설정한다. `base`도 필수이며 register set의 I/O 또는 memory 영역 base를 가리킨다. 64-bit architecture에서도 이 값은 32-bit 폭이므로 register를 memory의 낮은 32-bit 범위에 mapping해야 한다.

`pci_dev`는 PCI board device이며 non-PCI board에서는 `NULL`로 둔다. `pci_alloc_consistent()`와 `pci_map_*()`에 사용된다. 53c710 전용 `dmode_extra`는 DMODE register의 bus output pin을 제어하며 `DMODE_FC1`, `DMODE_FC2` 조합이다. Pin 의미는 board 설계자가 정하므로 대개 무시해도 된다.

Differential bus이면 `differential=1`, 53c710이면 `chip710=1`로 둔다. `CONFIG_53C700_LE_ON_BE`가 켜진 big-endian system에서 chip이 little-endian으로 동작하면 `force_le_on_be=1`을 쓴다. 53c710의 DMA 8-byte burst를 끄려면 `burst_disable`을 설정한다.

Host parameter
Parameter상태의미
clock필수Chip MHz
base필수32-bit 범위의 register base
pci_dev선택PCI DMA mapping device
dmode_extra53c710 선택DMODE_FC1/FC2 output pin
differential선택Differential bus
force_le_on_be조건부BE 시스템의 LE chip mode
chip710선택53c710 식별
burst_disable53c710 선택8-byte DMA burst 금지

필수값과 board별 선택값을 구분합니다.

Settable NCR_700_Host_Parameters
--------------------------------

The following are a list of the user settable parameters:

clock: (MANDATORY)
  Set to the clock speed of the chip in MHz.

base: (MANDATORY)
  Set to the base of the io or mem region for the register set. On 64
  bit architectures this is only 32 bits wide, so the registers must be
  mapped into the low 32 bits of memory.

pci_dev: (OPTIONAL)
  Set to the PCI board device.  Leave NULL for a non-pci board.  This is
  used for the pci_alloc_consistent() and pci_map_*() functions.

dmode_extra: (OPTIONAL, 53c710 only)
  Extra flags for the DMODE register.  These are used to control bus
  output pins on the 710.  The settings should be a combination of
  DMODE_FC1 and DMODE_FC2.  What these pins actually do is entirely up
  to the board designer.  Usually it is safe to ignore this setting.

differential: (OPTIONAL)
  Set to 1 if the chip drives a differential bus.

force_le_on_be: (OPTIONAL, only if CONFIG_53C700_LE_ON_BE is set)
  Set to 1 if the chip is operating in little endian mode on a big
  endian architecture.

chip710: (OPTIONAL)
  Set to 1 if the chip is a 53c710.

burst_disable: (OPTIONAL, 53c710 only)
  Disable 8 byte bursting for DMA transfers.