요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* Mediatek/Ralink RT3883 PCI controller
1) Main node
Required properties:
- compatible: must be "ralink,rt3883-pci"
- reg: specifies the physical base address of the controller and
the length of the memory mapped region.
- #address-cells: specifies the number of cells needed to encode an
address. The value must be 1.
- #size-cells: specifies the number of cells used to represent the size
of an address. The value must be 1.
- ranges: specifies the translation between child address space and parent
address space
Optional properties:
- status: indicates the operational status of the device.
Value must be either "disabled" or "okay".
2) Child nodes
The main node must have two child nodes which describes the built-in
interrupt controller and the PCI host bridge.
a) Interrupt controller:
Required properties:
- interrupt-controller: identifies the node as an interrupt controller
- #address-cells: specifies the number of cells needed to encode an
address. The value must be 0. As such, 'interrupt-map' nodes do not
have to specify a parent unit address.
- #interrupt-cells: specifies the number of cells needed to encode an
interrupt source. The value must be 1.
- interrupts: specifies the interrupt source of the parent interrupt
controller. The format of the interrupt specifier depends on the
parent interrupt controller.
b) PCI host bridge:
Required properties:
- #address-cells: specifies the number of cells needed to encode an
address. The value must be 0.
- #size-cells: specifies the number of cells used to represent the size
of an address. The value must be 2.
- #interrupt-cells: specifies the number of cells needed to encode an
interrupt source. The value must be 1.
- device_type: must be "pci"
- bus-range: PCI bus numbers covered
- ranges: specifies the ranges for the PCI memory and I/O regions
- interrupt-map-mask,
- interrupt-map: standard PCI properties to define the mapping of the
PCI interface to interrupt numbers.
The PCI host bridge node might have additional sub-nodes representing
the onboard PCI devices/PCI slots. Each such sub-node must have the
following mandatory properties:
- reg: used only for interrupt mapping, so only the first four bytes
are used to refer to the correct bus number and device number.
- device_type: must be "pci"
If a given sub-node represents a PCI bridge it must have following
mandatory properties as well:
- #address-cells: must be set to <3>
- #size-cells: must set to <2>
- #interrupt-cells: must be set to <1>
- interrupt-map-mask,
- interrupt-map: standard PCI properties to define the mapping of the
PCI interface to interrupt numbers.
Besides the required properties the sub-nodes may have these optional
properties:
- status: indicates the operational status of the sub-node.
Value must be either "disabled" or "okay".
3) Example:
a) SoC specific dtsi file:
pci@10140000 {
compatible = "ralink,rt3883-pci";
reg = <0x10140000 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
ranges; /* direct mapping */
status = "disabled";
pciintc: interrupt-controller {
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-parent = <&cpuintc>;
interrupts = <4>;
};
host-bridge {
#address-cells = <3>;
#size-cells = <2>;
#interrupt-cells = <1>;
device_type = "pci";
bus-range = <0 255>;
ranges = <
0x02000000 0 0x00000000 0x20000000 0 0x10000000 /* pci memory */
0x01000000 0 0x00000000 0x10160000 0 0x00010000 /* io space */
>;
interrupt-map-mask = <0xf800 0 0 7>;
interrupt-map = <
/* IDSEL 17 */
0x8800 0 0 1 &pciintc 18
0x8800 0 0 2 &pciintc 18
0x8800 0 0 3 &pciintc 18
0x8800 0 0 4 &pciintc 18
/* IDSEL 18 */
0x9000 0 0 1 &pciintc 19
0x9000 0 0 2 &pciintc 19
0x9000 0 0 3 &pciintc 19
0x9000 0 0 4 &pciintc 19
>;
pci-bridge@1 {
reg = <0x0800 0 0 0 0>;
device_type = "pci";
#interrupt-cells = <1>;
#address-cells = <3>;
#size-cells = <2>;
interrupt-map-mask = <0x0 0 0 0>;
interrupt-map = <0x0 0 0 0 &pciintc 20>;
status = "disabled";
};
pci-slot@17 {
reg = <0x8800 0 0 0 0>;
device_type = "pci";
status = "disabled";
};
pci-slot@18 {
reg = <0x9000 0 0 0 0>;
device_type = "pci";
status = "disabled";
};
};
};
b) Board specific dts file:
pci@10140000 {
status = "okay";
host-bridge {
pci-bridge@1 {
status = "okay";
};
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
MediaTek/Ralink RT3883 PCI 메인 노드
1-25RT3883 PCI 컨트롤러의 메인 노드는 `compatible = "ralink,rt3883-pci"`를 사용해야 합니다.
`reg`는 컨트롤러의 물리 기본 주소와 memory-mapped 영역 길이를 지정합니다. 주소 인코딩 cell 수인 `#address-cells`와 주소 크기 표현 cell 수인 `#size-cells`는 모두 1이어야 합니다.
`ranges`는 하위 주소 공간과 상위 주소 공간 사이의 변환을 지정합니다.
선택 속성 `status`는 장치의 동작 상태를 나타내며 값은 `disabled` 또는 `okay`여야 합니다.
내장 인터럽트 컨트롤러 하위 노드
26-47메인 노드에는 내장 인터럽트 컨트롤러와 PCI 호스트 브리지를 설명하는 두 하위 노드가 있어야 합니다.
인터럽트 컨트롤러 노드는 `interrupt-controller` 속성으로 자신을 인터럽트 컨트롤러로 식별합니다.
`#address-cells`는 0이어야 하므로 `interrupt-map` 노드에서 상위 unit address를 지정할 필요가 없습니다. 인터럽트 소스 인코딩 cell 수인 `#interrupt-cells`는 1이어야 합니다.
`interrupts`는 상위 인터럽트 컨트롤러의 인터럽트 소스를 지정하며 지정자 형식은 해당 상위 컨트롤러에 따라 달라집니다.
PCI 호스트 브리지와 하위 장치
48-98PCI 호스트 브리지의 `#address-cells`는 0, `#size-cells`는 2, `#interrupt-cells`는 1이어야 하며 `device_type`은 `pci`여야 합니다.
`bus-range`는 브리지가 담당하는 PCI 버스 번호를, `ranges`는 PCI memory 및 I/O 영역 범위를 지정합니다. `interrupt-map-mask`와 `interrupt-map`은 PCI 인터페이스를 인터럽트 번호에 연결하는 표준 PCI 속성입니다.
호스트 브리지에는 온보드 PCI 장치나 PCI 슬롯을 나타내는 하위 노드를 추가할 수 있습니다. 각 노드의 `reg`는 인터럽트 매핑에만 쓰이므로 올바른 버스와 장치 번호를 가리키는 처음 네 바이트만 사용하며, `device_type`은 `pci`여야 합니다.
하위 노드가 PCI 브리지를 나타내면 `#address-cells = <3>`, `#size-cells = <2>`, `#interrupt-cells = <1>`과 표준 `interrupt-map-mask`, `interrupt-map`도 필요합니다.
이 하위 노드들은 선택적으로 `status`를 가질 수 있으며 값은 `disabled` 또는 `okay`여야 합니다.
RT3883 SoC DTSI 예제
99-176SoC DTSI 예제는 `0x10140000`의 컨트롤러, CPU 인터럽트 4에 연결된 `pciintc`, 버스 0-255의 호스트 브리지와 PCI memory·I/O 범위를 정의합니다.
IDSEL 17과 18의 INT A-D는 각각 로컬 인터럽트 18과 19로 매핑됩니다. 별도 PCI 브리지는 인터럽트 20으로 연결되고 브리지와 두 슬롯은 보드에서 활성화하기 전까지 `disabled` 상태입니다.
pci@10140000 {
compatible = "ralink,rt3883-pci";
reg = <0x10140000 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
ranges; /* direct mapping */
status = "disabled";
pciintc: interrupt-controller {
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-parent = <&cpuintc>;
interrupts = <4>;
};
host-bridge {
#address-cells = <3>;
#size-cells = <2>;
#interrupt-cells = <1>;
device_type = "pci";
bus-range = <0 255>;
ranges = <
0x02000000 0 0x00000000 0x20000000 0 0x10000000 /* pci memory */
0x01000000 0 0x00000000 0x10160000 0 0x00010000 /* io space */
>;
interrupt-map-mask = <0xf800 0 0 7>;
interrupt-map = <
/* IDSEL 17 */
0x8800 0 0 1 &pciintc 18
0x8800 0 0 2 &pciintc 18
0x8800 0 0 3 &pciintc 18
0x8800 0 0 4 &pciintc 18
/* IDSEL 18 */
0x9000 0 0 1 &pciintc 19
0x9000 0 0 2 &pciintc 19
0x9000 0 0 3 &pciintc 19
0x9000 0 0 4 &pciintc 19
>;
pci-bridge@1 {
reg = <0x0800 0 0 0 0>;
device_type = "pci";
#interrupt-cells = <1>;
#address-cells = <3>;
#size-cells = <2>;
interrupt-map-mask = <0x0 0 0 0>;
interrupt-map = <0x0 0 0 0 &pciintc 20>;
status = "disabled";
};
pci-slot@17 {
reg = <0x8800 0 0 0 0>;
device_type = "pci";
status = "disabled";
};
pci-slot@18 {
reg = <0x9000 0 0 0 0>;
device_type = "pci";
status = "disabled";
};
};
};
RT3883 보드 DTS 예제
177-187보드 DTS는 메인 PCI 컨트롤러와 `pci-bridge@1`을 `okay`로 바꾸어 활성화합니다.
pci@10140000 {
status = "okay";
host-bridge {
pci-bridge@1 {
status = "okay";
};
};
};
요약과 해설
ralink,rt3883-pci.txt:1-187메인 노드, 내장 인터럽트 컨트롤러, 호스트 브리지와 슬롯의 필수 속성을 계층별로 정리합니다.