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

Linux 6.18.37 · SCSI

HighPoint RocketRAID hptiop

RocketRAID IOP register map, queue/list request workflow와 sysfs interface를 설명합니다.

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

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

1. 요약·해설

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

요약·해설

hptiop.rst:1-215

RocketRAID IOP register map, queue/list request workflow와 sysfs interface를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2 .. include:: <isonum.txt>
3
4 ======================================================
5 Highpoint RocketRAID 3xxx/4xxx Adapter Driver (hptiop)
6 ======================================================
7
8 Controller Register Map
9 -----------------------
10
11 For RR44xx Intel IOP based adapters, the controller IOP is accessed via PCI BAR0 and BAR2
12
13 ============== ==================================
14 BAR0 offset Register
15 ============== ==================================
16 0x11C5C Link Interface IRQ Set
17 0x11C60 Link Interface IRQ Clear
18 ============== ==================================
19
20 ============== ==================================
21 BAR2 offset Register
22 ============== ==================================
23 0x10 Inbound Message Register 0
24 0x14 Inbound Message Register 1
25 0x18 Outbound Message Register 0
26 0x1C Outbound Message Register 1
27 0x20 Inbound Doorbell Register
28 0x24 Inbound Interrupt Status Register
29 0x28 Inbound Interrupt Mask Register
30 0x30 Outbound Interrupt Status Register
31 0x34 Outbound Interrupt Mask Register
32 0x40 Inbound Queue Port
33 0x44 Outbound Queue Port
34 ============== ==================================
35
36 For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0:
37
38 ============== ==================================
39 BAR0 offset Register
40 ============== ==================================
41 0x10 Inbound Message Register 0
42 0x14 Inbound Message Register 1
43 0x18 Outbound Message Register 0
44 0x1C Outbound Message Register 1
45 0x20 Inbound Doorbell Register
46 0x24 Inbound Interrupt Status Register
47 0x28 Inbound Interrupt Mask Register
48 0x30 Outbound Interrupt Status Register
49 0x34 Outbound Interrupt Mask Register
50 0x40 Inbound Queue Port
51 0x44 Outbound Queue Port
52 ============== ==================================
53
54 For Marvell not Frey IOP based adapters, the IOP is accessed via PCI BAR0 and BAR1:
55
56 ============== ==================================
57 BAR0 offset Register
58 ============== ==================================
59 0x20400 Inbound Doorbell Register
60 0x20404 Inbound Interrupt Mask Register
61 0x20408 Outbound Doorbell Register
62 0x2040C Outbound Interrupt Mask Register
63 ============== ==================================
64
65 ============== ==================================
66 BAR1 offset Register
67 ============== ==================================
68 0x0 Inbound Queue Head Pointer
69 0x4 Inbound Queue Tail Pointer
70 0x8 Outbound Queue Head Pointer
71 0xC Outbound Queue Tail Pointer
72 0x10 Inbound Message Register
73 0x14 Outbound Message Register
74 0x40-0x1040 Inbound Queue
75 0x1040-0x2040 Outbound Queue
76 ============== ==================================
77
78 For Marvell Frey IOP based adapters, the IOP is accessed via PCI BAR0 and BAR1:
79
80 ============== ==================================
81 BAR0 offset Register
82 ============== ==================================
83 0x0 IOP configuration information.
84 ============== ==================================
85
86 ============== ===================================================
87 BAR1 offset Register
88 ============== ===================================================
89 0x4000 Inbound List Base Address Low
90 0x4004 Inbound List Base Address High
91 0x4018 Inbound List Write Pointer
92 0x402C Inbound List Configuration and Control
93 0x4050 Outbound List Base Address Low
94 0x4054 Outbound List Base Address High
95 0x4058 Outbound List Copy Pointer Shadow Base Address Low
96 0x405C Outbound List Copy Pointer Shadow Base Address High
97 0x4088 Outbound List Interrupt Cause
98 0x408C Outbound List Interrupt Enable
99 0x1020C PCIe Function 0 Interrupt Enable
100 0x10400 PCIe Function 0 to CPU Message A
101 0x10420 CPU to PCIe Function 0 Message A
102 0x10480 CPU to PCIe Function 0 Doorbell
103 0x10484 CPU to PCIe Function 0 Doorbell Enable
104 ============== ===================================================
105
106
107 I/O Request Workflow of Not Marvell Frey
108 ----------------------------------------
109
110 All queued requests are handled via inbound/outbound queue port.
111 A request packet can be allocated in either IOP or host memory.
112
113 To send a request to the controller:
114
115 - Get a free request packet by reading the inbound queue port or
116 allocate a free request in host DMA coherent memory.
117
118 The value returned from the inbound queue port is an offset
119 relative to the IOP BAR0.
120
121 Requests allocated in host memory must be aligned on 32-bytes boundary.
122
123 - Fill the packet.
124
125 - Post the packet to IOP by writing it to inbound queue. For requests
126 allocated in IOP memory, write the offset to inbound queue port. For
127 requests allocated in host memory, write (0x80000000|(bus_addr>>5))
128 to the inbound queue port.
129
130 - The IOP process the request. When the request is completed, it
131 will be put into outbound queue. An outbound interrupt will be
132 generated.
133
134 For requests allocated in IOP memory, the request offset is posted to
135 outbound queue.
136
137 For requests allocated in host memory, (0x80000000|(bus_addr>>5))
138 is posted to the outbound queue. If IOP_REQUEST_FLAG_OUTPUT_CONTEXT
139 flag is set in the request, the low 32-bit context value will be
140 posted instead.
141
142 - The host read the outbound queue and complete the request.
143
144 For requests allocated in IOP memory, the host driver free the request
145 by writing it to the outbound queue.
146
147 Non-queued requests (reset/flush etc) can be sent via inbound message
148 register 0. An outbound message with the same value indicates the completion
149 of an inbound message.
150
151
152 I/O Request Workflow of Marvell Frey
153 ------------------------------------
154
155 All queued requests are handled via inbound/outbound list.
156
157 To send a request to the controller:
158
159 - Allocate a free request in host DMA coherent memory.
160
161 Requests allocated in host memory must be aligned on 32-bytes boundary.
162
163 - Fill the request with index of the request in the flag.
164
165 Fill a free inbound list unit with the physical address and the size of
166 the request.
167
168 Set up the inbound list write pointer with the index of previous unit,
169 round to 0 if the index reaches the supported count of requests.
170
171 - Post the inbound list writer pointer to IOP.
172
173 - The IOP process the request. When the request is completed, the flag of
174 the request with or-ed IOPMU_QUEUE_MASK_HOST_BITS will be put into a
175 free outbound list unit and the index of the outbound list unit will be
176 put into the copy pointer shadow register. An outbound interrupt will be
177 generated.
178
179 - The host read the outbound list copy pointer shadow register and compare
180 with previous saved read pointer N. If they are different, the host will
181 read the (N+1)th outbound list unit.
182
183 The host get the index of the request from the (N+1)th outbound list
184 unit and complete the request.
185
186 Non-queued requests (reset communication/reset/flush etc) can be sent via PCIe
187 Function 0 to CPU Message A register. The CPU to PCIe Function 0 Message register
188 with the same value indicates the completion of message.
189
190
191 User-level Interface
192 ---------------------
193
194 The driver exposes following sysfs attributes:
195
196 ================== === ========================
197 NAME R/W Description
198 ================== === ========================
199 driver-version R driver version string
200 firmware-version R firmware version string
201 ================== === ========================
202
203
204 -----------------------------------------------------------------------------
205
206 Copyright |copy| 2006-2012 HighPoint Technologies, Inc. All Rights Reserved.
207
208 This file is distributed in the hope that it will be useful,
209 but WITHOUT ANY WARRANTY; without even the implied warranty of
210 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
211 GNU General Public License for more details.
212
214
215 http://www.highpoint-tech.com
216

3. 한국어 전문 번역

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

Controller register map

1-106

`hptiop`는 HighPoint RocketRAID 3xxx/4xxx adapter의 IOP와 PCI BAR를 통해 통신한다. RR44xx Intel IOP adapter는 BAR0의 link interrupt register와 BAR2의 message, doorbell, interrupt, queue port를 사용한다.

RR44xx register map
BAROffsetRegister
BAR00x11C5CLink Interface IRQ Set
BAR00x11C60Link Interface IRQ Clear
BAR20x10 / 0x14Inbound Message Register 0 / 1
BAR20x18 / 0x1COutbound Message Register 0 / 1
BAR20x20Inbound Doorbell Register
BAR20x24 / 0x28Inbound Interrupt Status / Mask
BAR20x30 / 0x34Outbound Interrupt Status / Mask
BAR20x40 / 0x44Inbound / Outbound Queue Port

Intel IOP 기반 RR44xx의 BAR별 register입니다.

일반 Intel IOP adapter에서는 같은 message·doorbell·interrupt·queue register 집합이 모두 PCI BAR0의 `0x10`부터 `0x44` 사이에 배치된다.

Intel IOP BAR0
OffsetRegister
0x10 / 0x14Inbound Message Register 0 / 1
0x18 / 0x1COutbound Message Register 0 / 1
0x20Inbound Doorbell Register
0x24 / 0x28Inbound Interrupt Status / Mask
0x30 / 0x34Outbound Interrupt Status / Mask
0x40 / 0x44Inbound / Outbound Queue Port

일반 Intel IOP adapter의 단일 BAR 배치입니다.

Frey가 아닌 Marvell IOP adapter는 BAR0에 doorbell과 interrupt mask를, BAR1에 queue pointer·message register·inbound/outbound queue memory를 둔다.

Marvell non-Frey
BAROffsetRegister
BAR00x20400Inbound Doorbell Register
BAR00x20404Inbound Interrupt Mask Register
BAR00x20408Outbound Doorbell Register
BAR00x2040COutbound Interrupt Mask Register
BAR10x0 / 0x4Inbound Queue Head / Tail Pointer
BAR10x8 / 0xCOutbound Queue Head / Tail Pointer
BAR10x10 / 0x14Inbound / Outbound Message Register
BAR10x40-0x1040Inbound Queue
BAR10x1040-0x2040Outbound Queue

BAR0 control register와 BAR1 queue layout입니다.

Marvell Frey IOP adapter의 BAR0 offset `0x0`은 IOP configuration information이다. BAR1에는 inbound/outbound list의 base address와 pointer, interrupt register, PCIe Function 0 message와 doorbell register가 배치된다.

Marvell Frey
OffsetRegister
0x4000 / 0x4004Inbound List Base Address Low / High
0x4018Inbound List Write Pointer
0x402CInbound List Configuration and Control
0x4050 / 0x4054Outbound List Base Address Low / High
0x4058 / 0x405COutbound List Copy Pointer Shadow Base Address Low / High
0x4088 / 0x408COutbound List Interrupt Cause / Enable
0x1020CPCIe Function 0 Interrupt Enable
0x10400PCIe Function 0 to CPU Message A
0x10420CPU to PCIe Function 0 Message A
0x10480 / 0x10484CPU to PCIe Function 0 Doorbell / Enable

List 기반 I/O에 쓰이는 BAR1 register입니다.

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

======================================================
Highpoint RocketRAID 3xxx/4xxx Adapter Driver (hptiop)
======================================================

Controller Register Map
-----------------------

For RR44xx Intel IOP based adapters, the controller IOP is accessed via PCI BAR0 and BAR2

     ============== ==================================
     BAR0 offset    Register
     ============== ==================================
            0x11C5C Link Interface IRQ Set
            0x11C60 Link Interface IRQ Clear
     ============== ==================================

     ============== ==================================
     BAR2 offset    Register
     ============== ==================================
            0x10    Inbound Message Register 0
            0x14    Inbound Message Register 1
            0x18    Outbound Message Register 0
            0x1C    Outbound Message Register 1
            0x20    Inbound Doorbell Register
            0x24    Inbound Interrupt Status Register
            0x28    Inbound Interrupt Mask Register
            0x30    Outbound Interrupt Status Register
            0x34    Outbound Interrupt Mask Register
            0x40    Inbound Queue Port
            0x44    Outbound Queue Port
     ============== ==================================

For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0:

     ============== ==================================
     BAR0 offset    Register
     ============== ==================================
            0x10    Inbound Message Register 0
            0x14    Inbound Message Register 1
            0x18    Outbound Message Register 0
            0x1C    Outbound Message Register 1
            0x20    Inbound Doorbell Register
            0x24    Inbound Interrupt Status Register
            0x28    Inbound Interrupt Mask Register
            0x30    Outbound Interrupt Status Register
            0x34    Outbound Interrupt Mask Register
            0x40    Inbound Queue Port
            0x44    Outbound Queue Port
     ============== ==================================

For Marvell not Frey IOP based adapters, the IOP is accessed via PCI BAR0 and BAR1:

     ============== ==================================
     BAR0 offset    Register
     ============== ==================================
         0x20400    Inbound Doorbell Register
         0x20404    Inbound Interrupt Mask Register
         0x20408    Outbound Doorbell Register
         0x2040C    Outbound Interrupt Mask Register
     ============== ==================================

     ============== ==================================
     BAR1 offset    Register
     ============== ==================================
             0x0    Inbound Queue Head Pointer
             0x4    Inbound Queue Tail Pointer
             0x8    Outbound Queue Head Pointer
             0xC    Outbound Queue Tail Pointer
            0x10    Inbound Message Register
            0x14    Outbound Message Register
     0x40-0x1040    Inbound Queue
     0x1040-0x2040  Outbound Queue
     ============== ==================================

For Marvell Frey IOP based adapters, the IOP is accessed via PCI BAR0 and BAR1:

     ============== ==================================
     BAR0 offset    Register
     ============== ==================================
             0x0    IOP configuration information.
     ============== ==================================

     ============== ===================================================
     BAR1 offset    Register
     ============== ===================================================
          0x4000    Inbound List Base Address Low
          0x4004    Inbound List Base Address High
          0x4018    Inbound List Write Pointer
          0x402C    Inbound List Configuration and Control
          0x4050    Outbound List Base Address Low
          0x4054    Outbound List Base Address High
          0x4058    Outbound List Copy Pointer Shadow Base Address Low
          0x405C    Outbound List Copy Pointer Shadow Base Address High
          0x4088    Outbound List Interrupt Cause
          0x408C    Outbound List Interrupt Enable
         0x1020C    PCIe Function 0 Interrupt Enable
         0x10400    PCIe Function 0 to CPU Message A
         0x10420    CPU to PCIe Function 0 Message A
         0x10480    CPU to PCIe Function 0 Doorbell
         0x10484    CPU to PCIe Function 0 Doorbell Enable
     ============== ===================================================

Non-Frey request queue workflow

107-151

Marvell Frey가 아닌 controller의 queued request는 inbound/outbound queue port로 처리하며 request packet은 IOP memory 또는 host memory에 둘 수 있다. Inbound queue port를 읽어 IOP BAR0 기준 offset의 빈 packet을 얻거나, host DMA coherent memory에 32-byte 정렬된 request를 할당한다.

Packet을 채운 뒤 IOP memory request는 offset을 inbound queue port에 쓰고, host memory request는 `0x80000000|(bus_addr>>5)`를 쓴다. IOP가 작업을 끝내면 같은 표현을 outbound queue에 게시하고 outbound interrupt를 발생시킨다. `IOP_REQUEST_FLAG_OUTPUT_CONTEXT`가 설정된 host request는 대신 하위 32-bit context를 게시한다.

Host는 outbound queue를 읽어 request를 완료한다. IOP memory에서 할당된 request는 outbound queue에 다시 써서 해제한다. Reset이나 flush 같은 non-queued request는 Inbound Message Register 0으로 보내며, 같은 값을 가진 outbound message가 완료를 뜻한다.

Non-Frey I/O
빈 request 확보 및 32-byte 정렬Packet 작성Inbound queue에 offset 또는 encoded bus address 게시IOP 처리와 outbound interruptHost가 완료하고 IOP request 반환

Queue port를 통한 request 수명 주기입니다.

I/O Request Workflow of Not Marvell Frey
----------------------------------------

All queued requests are handled via inbound/outbound queue port.
A request packet can be allocated in either IOP or host memory.

To send a request to the controller:

    - Get a free request packet by reading the inbound queue port or
      allocate a free request in host DMA coherent memory.

      The value returned from the inbound queue port is an offset
      relative to the IOP BAR0.

      Requests allocated in host memory must be aligned on 32-bytes boundary.

    - Fill the packet.

    - Post the packet to IOP by writing it to inbound queue. For requests
      allocated in IOP memory, write the offset to inbound queue port. For
      requests allocated in host memory, write (0x80000000|(bus_addr>>5))
      to the inbound queue port.

    - The IOP process the request. When the request is completed, it
      will be put into outbound queue. An outbound interrupt will be
      generated.

      For requests allocated in IOP memory, the request offset is posted to
      outbound queue.

      For requests allocated in host memory, (0x80000000|(bus_addr>>5))
      is posted to the outbound queue. If IOP_REQUEST_FLAG_OUTPUT_CONTEXT
      flag is set in the request, the low 32-bit context value will be
      posted instead.

    - The host read the outbound queue and complete the request.

      For requests allocated in IOP memory, the host driver free the request
      by writing it to the outbound queue.

Non-queued requests (reset/flush etc) can be sent via inbound message
register 0. An outbound message with the same value indicates the completion
of an inbound message.

Marvell Frey list workflow

152-190

Marvell Frey controller의 queued request는 inbound/outbound list로 처리한다. Host DMA coherent memory에 32-byte 정렬 request를 할당하고 request flag에 request index를 기록한다. 빈 inbound list unit에는 physical address와 request size를 넣는다.

Inbound list write pointer는 직전 unit의 index로 설정하며 지원 request 수의 끝에 닿으면 0으로 되돌린다. Pointer를 IOP에 게시하면 IOP가 request를 처리한다. 완료 시 request flag와 `IOPMU_QUEUE_MASK_HOST_BITS`를 OR한 값을 빈 outbound unit에 쓰고, 그 unit index를 copy pointer shadow register에 기록한 뒤 interrupt를 발생시킨다.

Host는 outbound list copy pointer shadow와 저장한 read pointer `N`을 비교한다. 값이 다르면 `(N+1)`번째 outbound unit에서 request index를 얻어 완료한다. Reset communication, reset, flush 같은 non-queued request는 `PCIe Function 0 to CPU Message A`로 보내며 같은 값을 가진 `CPU to PCIe Function 0 Message`가 완료를 나타낸다.

Frey I/O
DMA request와 inbound unit 준비Write pointer 게시IOP 처리Outbound unit과 copy pointer 갱신Host가 N+1 unit을 읽어 완료

List와 shadow pointer를 통한 완료 경로입니다.

I/O Request Workflow of Marvell Frey
------------------------------------

All queued requests are handled via inbound/outbound list.

To send a request to the controller:

    - Allocate a free request in host DMA coherent memory.

      Requests allocated in host memory must be aligned on 32-bytes boundary.

    - Fill the request with index of the request in the flag.

      Fill a free inbound list unit with the physical address and the size of
      the request.

      Set up the inbound list write pointer with the index of previous unit,
      round to 0 if the index reaches the supported count of requests.

    - Post the inbound list writer pointer to IOP.

    - The IOP process the request. When the request is completed, the flag of
      the request with or-ed IOPMU_QUEUE_MASK_HOST_BITS will be put into a
      free outbound list unit and the index of the outbound list unit will be
      put into the copy pointer shadow register. An outbound interrupt will be
      generated.

    - The host read the outbound list copy pointer shadow register and compare
      with previous saved read pointer N. If they are different, the host will
      read the (N+1)th outbound list unit.

      The host get the index of the request from the (N+1)th outbound list
      unit and complete the request.

Non-queued requests (reset communication/reset/flush etc) can be sent via PCIe
Function 0 to CPU Message A register. The CPU to PCIe Function 0 Message register
with the same value indicates the completion of message.

User-level sysfs interface

191-203

Driver는 읽기 전용 sysfs attribute 두 개를 노출한다. `driver-version`은 driver version 문자열을, `firmware-version`은 firmware version 문자열을 반환한다.

hptiop sysfs
Name권한설명
driver-versionRDriver version string
firmware-versionRFirmware version string

두 attribute 모두 읽기 전용입니다.

User-level Interface
---------------------

The driver exposes following sysfs attributes:

     ==================   ===    ========================
     NAME                 R/W    Description
     ==================   ===    ========================
     driver-version        R     driver version string
     firmware-version      R     firmware version string
     ==================   ===    ========================

License, warranty와 연락처

204-215

Copyright는 2006-2012 HighPoint Technologies, Inc.에 있다. 이 파일은 유용하리라는 기대 아래 배포되지만 상품성이나 특정 목적 적합성을 포함한 어떠한 보증도 제공하지 않으며, 자세한 조건은 GNU General Public License를 따른다.

연락처는 `[email protected]`, 웹 사이트는 `http://www.highpoint-tech.com`이다.

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

Copyright |copy| 2006-2012 HighPoint Technologies, Inc. All Rights Reserved.

  This file is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  [email protected]

  http://www.highpoint-tech.com