← Documents Documentation/devicetree/bindings/net/keystone-netcp.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

TI Keystone NetCP

Keystone NetCP의 GbE/XGbE switch, PA/SA, CPTS와 DMA interface binding입니다.

Source pathDocumentation/devicetree/bindings/net/keystone-netcp.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

keystone-netcp.txt:1-265

원문 ASCII subsystem 구조와 register·link mode 표를 구조화하고 두 interface 예제를 해설합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 This document describes the device tree bindings associated with the
2 keystone network coprocessor(NetCP) driver support.
3
4 The network coprocessor (NetCP) is a hardware accelerator that processes
5 Ethernet packets. NetCP has a gigabit Ethernet (GbE) subsystem with a ethernet
6 switch sub-module to send and receive packets. NetCP also includes a packet
7 accelerator (PA) module to perform packet classification operations such as
8 header matching, and packet modification operations such as checksum
9 generation. NetCP can also optionally include a Security Accelerator (SA)
10 capable of performing IPSec operations on ingress/egress packets.
11
12 Keystone II SoC's also have a 10 Gigabit Ethernet Subsystem (XGbE) which
13 includes a 3-port Ethernet switch sub-module capable of 10Gb/s and 1Gb/s rates
14 per Ethernet port.
15
16 Keystone NetCP driver has a plug-in module architecture where each of the NetCP
17 sub-modules exist as a loadable kernel module which plug in to the netcp core.
18 These sub-modules are represented as "netcp-devices" in the dts bindings. It is
19 mandatory to have the ethernet switch sub-module for the ethernet interface to
20 be operational. Any other sub-module like the PA is optional.
21
22 NetCP Ethernet SubSystem Layout:
23
24 -----------------------------
25 NetCP subsystem(10G or 1G)
26 -----------------------------
27 |
28 |-> NetCP Devices -> |
29 | |-> GBE/XGBE Switch
30 | |
31 | |-> Packet Accelerator
32 | |
33 | |-> Security Accelerator
34 |
35 |
36 |
37 |-> NetCP Interfaces -> |
38 |-> Ethernet Port 0
39 |
40 |-> Ethernet Port 1
41 |
42 |-> Ethernet Port 2
43 |
44 |-> Ethernet Port 3
45
46
47 NetCP subsystem properties:
48 Required properties:
49 - compatible: Should be "ti,netcp-1.0"
50 - clocks: phandle to the reference clocks for the subsystem.
51 - dma-id: Navigator packet dma instance id.
52 - ranges: address range of NetCP (includes, Ethernet SS, PA and SA)
53
54 Optional properties:
55 - reg: register location and the size for the following register
56 regions in the specified order.
57 - Efuse MAC address register
58 - dma-coherent: Present if dma operations are coherent
59 - big-endian: Keystone devices can be operated in a mode where the DSP is in
60 the big endian mode. In such cases enable this option. This
61 option should also be enabled if the ARM is operated in
62 big endian mode with the DSP in little endian.
63
64 NetCP device properties: Device specification for NetCP sub-modules.
65 1Gb/10Gb (gbe/xgbe) ethernet switch sub-module specifications.
66 Required properties:
67 - label: Must be "netcp-gbe" for 1Gb & "netcp-xgbe" for 10Gb.
68 - compatible: Must be one of below:-
69 "ti,netcp-gbe" for 1GbE on NetCP 1.4
70 "ti,netcp-gbe-5" for 1GbE N NetCP 1.5 (N=5)
71 "ti,netcp-gbe-9" for 1GbE N NetCP 1.5 (N=9)
72 "ti,netcp-gbe-2" for 1GbE N NetCP 1.5 (N=2)
73 "ti,netcp-xgbe" for 10 GbE
74
75 - reg: register location and the size for the following register
76 regions in the specified order.
77 - switch subsystem registers
78 - sgmii port3/4 module registers (only for NetCP 1.4)
79 - switch module registers
80 - serdes registers (only for 10G)
81
82 NetCP 1.4 ethss, here is the order
83 index #0 - switch subsystem registers
84 index #1 - sgmii port3/4 module registers
85 index #2 - switch module registers
86
87 NetCP 1.5 ethss 9 port, 5 port and 2 port
88 index #0 - switch subsystem registers
89 index #1 - switch module registers
90 index #2 - serdes registers
91
92 - tx-channel: the navigator packet dma channel name for tx.
93 - tx-queue: the navigator queue number associated with the tx dma channel.
94 - interfaces: specification for each of the switch port to be registered as a
95 network interface in the stack.
96 -- slave-port: Switch port number, 0 based numbering.
97 -- link-interface: type of link interface, supported options are
98 - mac<->mac auto negotiate mode: 0
99 - mac<->phy mode: 1
100 - mac<->mac forced mode: 2
101 - mac<->fiber mode: 3
102 - mac<->phy mode with no mdio: 4
103 - 10Gb mac<->phy mode : 10
104 - 10Gb mac<->mac forced mode : 11
105 ----phy-handle: phandle to PHY device
106
107 - cpts: sub-node time synchronization (CPTS) submodule configuration
108 -- clocks: CPTS reference clock. Should point on cpts-refclk-mux clock.
109 -- clock-names: should be "cpts"
110 -- cpts-refclk-mux: multiplexer clock definition sub-node for CPTS reference (RFTCLK) clock
111 --- #clock-cells: should be 0
112 --- clocks: list of CPTS reference (RFTCLK) clock's parents as defined in Data manual
113 --- ti,mux-tbl: array of multiplexer indexes as defined in Data manual
114 --- assigned-clocks: should point on cpts-refclk-mux clock
115 --- assigned-clock-parents: should point on required RFTCLK clock parent to be selected
116 -- cpts_clock_mult: (optional) Numerator to convert input clock ticks
117 into nanoseconds
118 -- cpts_clock_shift: (optional) Denominator to convert input clock ticks into
119 nanoseconds.
120 Mult and shift will be calculated basing on CPTS
121 rftclk frequency if both cpts_clock_shift and
122 cpts_clock_mult properties are not provided.
123
124 Optional properties:
125 - enable-ale: NetCP driver keeps the address learning feature in the ethernet
126 switch module disabled. This attribute is to enable the address
127 learning.
128 - secondary-slave-ports: specification for each of the switch port not be
129 registered as a network interface. NetCP driver
130 will only initialize these ports and attach PHY
131 driver to them if needed.
132
133 NetCP interface properties: Interface specification for NetCP sub-modules.
134 Required properties:
135 - rx-channel: the navigator packet dma channel name for rx.
136 - rx-queue: the navigator queue number associated with rx dma channel.
137 - rx-pool: specifies the number of descriptors to be used & the region-id
138 for creating the rx descriptor pool.
139 - tx-pool: specifies the number of descriptors to be used & the region-id
140 for creating the tx descriptor pool.
141 - rx-queue-depth: number of descriptors in each of the free descriptor
142 queue (FDQ) for the pktdma Rx flow. There can be at
143 present a maximum of 4 queues per Rx flow.
144 - rx-buffer-size: the buffer size for each of the Rx flow FDQ.
145 - tx-completion-queue: the navigator queue number where the descriptors are
146 recycled after Tx DMA completion.
147
148 Optional properties:
149 - efuse-mac: If this is 1, then the MAC address for the interface is
150 obtained from the device efuse mac address register.
151 If this is 2, the two DWORDs occupied by the MAC address
152 are swapped. The netcp driver will swap the two DWORDs
153 back to the proper order when this property is set to 2
154 when it obtains the mac address from efuse.
155 - "netcp-device label": phandle to the device specification for each of NetCP
156 sub-module attached to this interface.
157
158 The MAC address will be determined using the optional properties defined in
159 ethernet.txt and only if efuse-mac is set to 0. If all of the optional MAC
160 address properties are not present, then the driver will use a random MAC
161 address.
162
163 Example binding:
164
165 netcp: netcp@2000000 {
166 reg = <0x2620110 0x8>;
167 reg-names = "efuse";
168 compatible = "ti,netcp-1.0";
169 #address-cells = <1>;
170 #size-cells = <1>;
171 ranges = <0 0x2000000 0xfffff>;
172 clocks = <&papllclk>, <&clkcpgmac>, <&chipclk12>;
173 dma-coherent;
174 /* big-endian; */
175 dma-id = <0>;
176
177 netcp-devices {
178 #address-cells = <1>;
179 #size-cells = <1>;
180 ranges;
181 gbe@90000 {
182 label = "netcp-gbe";
183 reg = <0x90000 0x300>, <0x90400 0x400>, <0x90800 0x700>;
184 /* enable-ale; */
185 tx-queue = <648>;
186 tx-channel = <8>;
187
188 cpts {
189 clocks = <&cpts_refclk_mux>;
190 clock-names = "cpts";
191
192 cpts_refclk_mux: cpts-refclk-mux {
193 #clock-cells = <0>;
194 clocks = <&chipclk12>, <&chipclk13>,
195 <&timi0>, <&timi1>,
196 <&tsipclka>, <&tsrefclk>,
197 <&tsipclkb>;
198 ti,mux-tbl = <0x0>, <0x1>, <0x2>,
199 <0x3>, <0x4>, <0x8>, <0xC>;
200 assigned-clocks = <&cpts_refclk_mux>;
201 assigned-clock-parents = <&chipclk12>;
202 };
203 };
204
205 interfaces {
206 gbe0: interface-0 {
207 slave-port = <0>;
208 link-interface = <4>;
209 };
210 gbe1: interface-1 {
211 slave-port = <1>;
212 link-interface = <4>;
213 };
214 };
215
216 secondary-slave-ports {
217 port-2 {
218 slave-port = <2>;
219 link-interface = <2>;
220 };
221 port-3 {
222 slave-port = <3>;
223 link-interface = <2>;
224 };
225 };
226 };
227 };
228
229 netcp-interfaces {
230 interface-0 {
231 rx-channel = <22>;
232 rx-pool = <1024 12>;
233 tx-pool = <1024 12>;
234 rx-queue-depth = <128 128 0 0>;
235 rx-buffer-size = <1518 4096 0 0>;
236 rx-queue = <8704>;
237 tx-completion-queue = <8706>;
238 efuse-mac = <1>;
239 netcp-gbe = <&gbe0>;
240
241 };
242 interface-1 {
243 rx-channel = <23>;
244 rx-pool = <1024 12>;
245 tx-pool = <1024 12>;
246 rx-queue-depth = <128 128 0 0>;
247 rx-buffer-size = <1518 4096 0 0>;
248 rx-queue = <8705>;
249 tx-completion-queue = <8707>;
250 efuse-mac = <0>;
251 local-mac-address = [02 18 31 7e 3e 6f];
252 netcp-gbe = <&gbe1>;
253 };
254 };
255 };
256
257 CPTS board configuration - select external CPTS RFTCLK:
258
259 &tsrefclk{
260 clock-frequency = <500000000>;
261 };
262
263 &cpts_refclk_mux {
264 assigned-clock-parents = <&tsrefclk>;
265 };
266

3. 한국어 전문 번역

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

Keystone Network Coprocessor

1-21

이 문서는 Keystone Network Coprocessor(NetCP) driver의 Device Tree binding을 설명합니다. NetCP는 Ethernet packet을 처리하는 hardware accelerator입니다.

NetCP의 GbE subsystem에는 packet 송수신용 Ethernet switch가 있습니다. Packet Accelerator(PA)는 header matching 같은 packet classification과 checksum generation 같은 packet modification을 수행합니다. 선택적인 Security Accelerator(SA)는 ingress/egress packet의 IPSec을 처리합니다.

Keystone II SoC에는 port마다 10Gbps와 1Gbps를 지원하는 3-port switch를 포함한 10 Gigabit Ethernet Subsystem(XGbE)도 있습니다.

NetCP driver는 plug-in module architecture입니다. 각 submodule은 `netcp` core에 결합하는 loadable kernel module이며 DTS에서는 `netcp-devices`로 표현합니다. Ethernet interface를 동작시키려면 Ethernet switch submodule이 필수이고 PA 같은 다른 submodule은 선택입니다.

NetCP subsystem 구조

22-46

원문의 ASCII 구조는 10G 또는 1G NetCP subsystem이 device submodule과 network interface 두 그룹을 소유하는 형태입니다.

NetCP Ethernet subsystem layout
NetCP subsystem 10G or 1GNetCP Devices
NetCP DevicesGBE/XGBE Switch
NetCP DevicesPacket Accelerator
NetCP DevicesSecurity Accelerator
NetCP subsystem 10G or 1GNetCP Interfaces
NetCP InterfacesEthernet Ports 0 to 3

원문의 계층형 ASCII 그림을 동일한 연결 관계로 구조화했습니다.

NetCP subsystem 속성

47-63

필수 `compatible`은 `ti,netcp-1.0`, `clocks`는 subsystem reference clock phandle, `dma-id`는 Navigator packet DMA instance ID, `ranges`는 Ethernet SS·PA·SA를 포함한 NetCP address range입니다.

선택 `reg`는 Efuse MAC address register 위치와 크기를 담습니다. `dma-coherent`는 coherent DMA를 뜻합니다.

`big-endian`은 DSP가 big-endian mode일 때 enable합니다. ARM은 big-endian이고 DSP는 little-endian인 경우에도 enable해야 합니다.

GbE/XGbE switch submodule

64-106

`label`은 1Gb에 `netcp-gbe`, 10Gb에 `netcp-xgbe`입니다. `compatible`은 NetCP 1.4 1GbE의 `ti,netcp-gbe`, NetCP 1.5의 port 수 5/9/2에 따른 `ti,netcp-gbe-5`, `ti,netcp-gbe-9`, `ti,netcp-gbe-2`, 또는 10GbE의 `ti,netcp-xgbe`입니다.

`reg`는 순서대로 switch subsystem, NetCP 1.4 전용 SGMII port3/4 module, switch module, 10G 전용 SerDes register 위치와 크기입니다.

NetCP Ethernet register order
구성index 0index 1index 2
NetCP 1.4Switch subsystemSGMII port3/4Switch module
NetCP 1.5 9/5/2 portSwitch subsystemSwitch moduleSerDes

NetCP generation과 port 구성에 따라 index 1·2의 의미가 달라집니다.

`tx-channel`은 Navigator packet DMA TX channel 이름, `tx-queue`는 그 TX DMA channel에 연결된 Navigator queue number입니다. `interfaces`는 network stack에 interface로 등록할 각 switch port를 기술합니다.

`slave-port`는 0부터 시작하는 switch port number입니다. `link-interface`는 mac-to-mac auto negotiate 0, mac-to-PHY 1, mac-to-mac forced 2, mac-to-fiber 3, MDIO 없는 mac-to-PHY 4, 10Gb mac-to-PHY 10, 10Gb mac-to-mac forced 11 중 하나입니다. `phy-handle`은 PHY device phandle입니다.

NetCP link-interface values
Mode
0MAC to MAC auto negotiate
1MAC to PHY
2MAC to MAC forced
3MAC to fiber
4MAC to PHY without MDIO
1010Gb MAC to PHY
1110Gb MAC to MAC forced

숫자 값과 link mode의 정확한 대응입니다.

CPTS와 switch 선택 속성

107-132

`cpts` subnode는 time synchronization CPTS submodule을 구성합니다. `clocks`는 `cpts-refclk-mux`를 가리키는 CPTS reference clock이고 `clock-names`는 `cpts`입니다.

`cpts-refclk-mux`는 CPTS RFTCLK multiplexer clock subnode입니다. `#clock-cells`는 0, `clocks`는 data manual에 정의된 RFTCLK parent 목록, `ti,mux-tbl`은 multiplexer index 배열입니다. `assigned-clocks`는 mux를, `assigned-clock-parents`는 선택할 RFTCLK parent를 가리킵니다.

선택 `cpts_clock_mult`와 `cpts_clock_shift`는 input clock tick을 nanosecond로 바꾸는 numerator와 denominator입니다. 둘 다 없으면 CPTS `rftclk` frequency를 바탕으로 계산합니다.

선택 `enable-ale`은 기본적으로 disable된 switch address learning을 enable합니다. `secondary-slave-ports`는 network interface로 등록하지 않을 switch port를 기술하며 드라이버는 이 port를 초기화하고 필요하면 PHY driver만 연결합니다.

NetCP interface 속성

133-162

`rx-channel`과 `rx-queue`는 Navigator RX DMA channel 이름과 queue number입니다. `rx-pool`, `tx-pool`은 descriptor 수와 descriptor pool 생성에 쓸 region ID를 지정합니다.

`rx-queue-depth`는 packet DMA RX flow의 각 free descriptor queue(FDQ) descriptor 수이며 flow마다 현재 최대 4 queue를 지원합니다. `rx-buffer-size`는 각 RX flow FDQ의 buffer 크기이고 `tx-completion-queue`는 TX DMA 완료 뒤 descriptor를 recycle할 Navigator queue number입니다.

선택 `efuse-mac`이 1이면 device efuse MAC register에서 주소를 얻습니다. 2이면 MAC address가 차지하는 두 DWORD의 순서가 바뀌어 있으므로 드라이버가 다시 올바른 순서로 swap합니다.

`netcp-device label` 속성은 interface에 연결된 각 NetCP submodule device specification의 phandle입니다.

`efuse-mac`이 0일 때만 `ethernet.txt`의 선택 MAC 속성을 사용합니다. 모든 선택 MAC 속성이 없으면 random MAC address를 사용합니다.

NetCP 1.0 binding 예제

163-255

예제는 efuse register, 세 reference clock, DMA instance 0을 갖는 coherent NetCP를 구성합니다. `netcp-gbe` device는 세 register 영역, TX queue 648과 channel 8을 사용합니다.

CPTS mux는 일곱 parent clock과 대응 mux table을 제공하고 기본 parent로 `chipclk12`를 선택합니다. Interface 0·1은 slave port 0·1에서 MDIO 없는 MAC-to-PHY mode 4를 사용하고 secondary port 2·3은 forced MAC-to-MAC mode 2를 사용합니다.

두 NetCP interface는 별도 RX channel·queue와 TX completion queue를 사용합니다. Interface 0은 efuse MAC을, interface 1은 명시한 local MAC address를 사용합니다.

netcp: netcp@2000000 {
        reg = <0x2620110 0x8>;
        reg-names = "efuse";
        compatible = "ti,netcp-1.0";
        #address-cells = <1>;
        #size-cells = <1>;
        ranges  = <0 0x2000000 0xfffff>;
        clocks = <&papllclk>, <&clkcpgmac>, <&chipclk12>;
        dma-coherent;
        /* big-endian; */
        dma-id = <0>;

        netcp-devices {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;
                gbe@90000 {
                        label = "netcp-gbe";
                        reg = <0x90000 0x300>, <0x90400 0x400>, <0x90800 0x700>;
                        /* enable-ale; */
                        tx-queue = <648>;
                        tx-channel = <8>;

                        cpts {
                                clocks = <&cpts_refclk_mux>;
                                clock-names = "cpts";

                                cpts_refclk_mux: cpts-refclk-mux {
                                        #clock-cells = <0>;
                                        clocks = <&chipclk12>, <&chipclk13>,
                                                 <&timi0>, <&timi1>,
                                                 <&tsipclka>, <&tsrefclk>,
                                                 <&tsipclkb>;
                                        ti,mux-tbl = <0x0>, <0x1>, <0x2>,
                                                <0x3>, <0x4>, <0x8>, <0xC>;
                                        assigned-clocks = <&cpts_refclk_mux>;
                                        assigned-clock-parents = <&chipclk12>;
                                };
                        };

                        interfaces {
                                gbe0: interface-0 {
                                        slave-port = <0>;
                                        link-interface        = <4>;
                                };
                                gbe1: interface-1 {
                                        slave-port = <1>;
                                        link-interface        = <4>;
                                };
                        };

                        secondary-slave-ports {
                                port-2 {
                                        slave-port = <2>;
                                        link-interface        = <2>;
                                };
                                port-3 {
                                        slave-port = <3>;
                                        link-interface        = <2>;
                                };
                        };
                };
        };

        netcp-interfaces {
                interface-0 {
                        rx-channel = <22>;
                        rx-pool = <1024 12>;
                        tx-pool = <1024 12>;
                        rx-queue-depth = <128 128 0 0>;
                        rx-buffer-size = <1518 4096 0 0>;
                        rx-queue = <8704>;
                        tx-completion-queue = <8706>;
                        efuse-mac = <1>;
                        netcp-gbe = <&gbe0>;

                };
                interface-1 {
                        rx-channel = <23>;
                        rx-pool = <1024 12>;
                        tx-pool = <1024 12>;
                        rx-queue-depth = <128 128 0 0>;
                        rx-buffer-size = <1518 4096 0 0>;
                        rx-queue = <8705>;
                        tx-completion-queue = <8707>;
                        efuse-mac = <0>;
                        local-mac-address = [02 18 31 7e 3e 6f];
                        netcp-gbe = <&gbe1>;
                };
        };
};

외부 CPTS RFTCLK 선택

256-265

보드 구성 예제는 `tsrefclk`를 500MHz로 설정하고 `cpts_refclk_mux`의 parent를 이 external reference clock으로 바꿉니다.

&tsrefclk{
        clock-frequency = <500000000>;
};

&cpts_refclk_mux {
        assigned-clock-parents = <&tsrefclk>;
};