← Documents Documentation/devicetree/bindings/pci/ralink,rt3883-pci.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

MediaTek/Ralink RT3883 PCI Controller

RT3883 PCI 컨트롤러의 인터럽트 컨트롤러와 호스트 브리지 계층 바인딩입니다.

Source pathDocumentation/devicetree/bindings/pci/ralink,rt3883-pci.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

ralink,rt3883-pci.txt:1-187

메인 노드, 내장 인터럽트 컨트롤러, 호스트 브리지와 슬롯의 필수 속성을 계층별로 정리합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 * Mediatek/Ralink RT3883 PCI controller
2
3 1) Main node
4
5 Required properties:
6
7 - compatible: must be "ralink,rt3883-pci"
8
9 - reg: specifies the physical base address of the controller and
10 the length of the memory mapped region.
11
12 - #address-cells: specifies the number of cells needed to encode an
13 address. The value must be 1.
14
15 - #size-cells: specifies the number of cells used to represent the size
16 of an address. The value must be 1.
17
18 - ranges: specifies the translation between child address space and parent
19 address space
20
21 Optional properties:
22
23 - status: indicates the operational status of the device.
24 Value must be either "disabled" or "okay".
25
26 2) Child nodes
27
28 The main node must have two child nodes which describes the built-in
29 interrupt controller and the PCI host bridge.
30
31 a) Interrupt controller:
32
33 Required properties:
34
35 - interrupt-controller: identifies the node as an interrupt controller
36
37 - #address-cells: specifies the number of cells needed to encode an
38 address. The value must be 0. As such, 'interrupt-map' nodes do not
39 have to specify a parent unit address.
40
41 - #interrupt-cells: specifies the number of cells needed to encode an
42 interrupt source. The value must be 1.
43
44 - interrupts: specifies the interrupt source of the parent interrupt
45 controller. The format of the interrupt specifier depends on the
46 parent interrupt controller.
47
48 b) PCI host bridge:
49
50 Required properties:
51
52 - #address-cells: specifies the number of cells needed to encode an
53 address. The value must be 0.
54
55 - #size-cells: specifies the number of cells used to represent the size
56 of an address. The value must be 2.
57
58 - #interrupt-cells: specifies the number of cells needed to encode an
59 interrupt source. The value must be 1.
60
61 - device_type: must be "pci"
62
63 - bus-range: PCI bus numbers covered
64
65 - ranges: specifies the ranges for the PCI memory and I/O regions
66
67 - interrupt-map-mask,
68 - interrupt-map: standard PCI properties to define the mapping of the
69 PCI interface to interrupt numbers.
70
71 The PCI host bridge node might have additional sub-nodes representing
72 the onboard PCI devices/PCI slots. Each such sub-node must have the
73 following mandatory properties:
74
75 - reg: used only for interrupt mapping, so only the first four bytes
76 are used to refer to the correct bus number and device number.
77
78 - device_type: must be "pci"
79
80 If a given sub-node represents a PCI bridge it must have following
81 mandatory properties as well:
82
83 - #address-cells: must be set to <3>
84
85 - #size-cells: must set to <2>
86
87 - #interrupt-cells: must be set to <1>
88
89 - interrupt-map-mask,
90 - interrupt-map: standard PCI properties to define the mapping of the
91 PCI interface to interrupt numbers.
92
93 Besides the required properties the sub-nodes may have these optional
94 properties:
95
96 - status: indicates the operational status of the sub-node.
97 Value must be either "disabled" or "okay".
98
99 3) Example:
100
101 a) SoC specific dtsi file:
102
103 pci@10140000 {
104 compatible = "ralink,rt3883-pci";
105 reg = <0x10140000 0x20000>;
106 #address-cells = <1>;
107 #size-cells = <1>;
108 ranges; /* direct mapping */
109
110 status = "disabled";
111
112 pciintc: interrupt-controller {
113 interrupt-controller;
114 #address-cells = <0>;
115 #interrupt-cells = <1>;
116
117 interrupt-parent = <&cpuintc>;
118 interrupts = <4>;
119 };
120
121 host-bridge {
122 #address-cells = <3>;
123 #size-cells = <2>;
124 #interrupt-cells = <1>;
125
126 device_type = "pci";
127
128 bus-range = <0 255>;
129 ranges = <
130 0x02000000 0 0x00000000 0x20000000 0 0x10000000 /* pci memory */
131 0x01000000 0 0x00000000 0x10160000 0 0x00010000 /* io space */
132 >;
133
134 interrupt-map-mask = <0xf800 0 0 7>;
135 interrupt-map = <
136 /* IDSEL 17 */
137 0x8800 0 0 1 &pciintc 18
138 0x8800 0 0 2 &pciintc 18
139 0x8800 0 0 3 &pciintc 18
140 0x8800 0 0 4 &pciintc 18
141 /* IDSEL 18 */
142 0x9000 0 0 1 &pciintc 19
143 0x9000 0 0 2 &pciintc 19
144 0x9000 0 0 3 &pciintc 19
145 0x9000 0 0 4 &pciintc 19
146 >;
147
148 pci-bridge@1 {
149 reg = <0x0800 0 0 0 0>;
150 device_type = "pci";
151 #interrupt-cells = <1>;
152 #address-cells = <3>;
153 #size-cells = <2>;
154
155 interrupt-map-mask = <0x0 0 0 0>;
156 interrupt-map = <0x0 0 0 0 &pciintc 20>;
157
158 status = "disabled";
159 };
160
161 pci-slot@17 {
162 reg = <0x8800 0 0 0 0>;
163 device_type = "pci";
164
165 status = "disabled";
166 };
167
168 pci-slot@18 {
169 reg = <0x9000 0 0 0 0>;
170 device_type = "pci";
171
172 status = "disabled";
173 };
174 };
175 };
176
177 b) Board specific dts file:
178
179 pci@10140000 {
180 status = "okay";
181
182 host-bridge {
183 pci-bridge@1 {
184 status = "okay";
185 };
186 };
187 };
188

3. 한국어 전문 번역

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

MediaTek/Ralink RT3883 PCI 메인 노드

1-25

RT3883 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-98

PCI 호스트 브리지의 `#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-176

SoC 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";
                };
        };
};