요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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
============== ===================================================
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.
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 Interface
---------------------
The driver exposes following sysfs attributes:
================== === ========================
NAME R/W Description
================== === ========================
driver-version R driver version string
firmware-version R firmware version string
================== === ========================
-----------------------------------------------------------------------------
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.
http://www.highpoint-tech.com
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를 사용한다.
Intel IOP 기반 RR44xx의 BAR별 register입니다.
일반 Intel IOP adapter에서는 같은 message·doorbell·interrupt·queue register 집합이 모두 PCI BAR0의 `0x10`부터 `0x44` 사이에 배치된다.
일반 Intel IOP adapter의 단일 BAR 배치입니다.
Frey가 아닌 Marvell IOP adapter는 BAR0에 doorbell과 interrupt mask를, BAR1에 queue pointer·message register·inbound/outbound queue memory를 둔다.
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가 배치된다.
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-151Marvell 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가 완료를 뜻한다.
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-190Marvell 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`가 완료를 나타낸다.
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-203Driver는 읽기 전용 sysfs attribute 두 개를 노출한다. `driver-version`은 driver version 문자열을, `firmware-version`은 firmware version 문자열을 반환한다.
두 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-215Copyright는 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
요약·해설
hptiop.rst:1-215RocketRAID IOP register map, queue/list request workflow와 sysfs interface를 설명합니다.