요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
This document describes the device tree bindings associated with the
keystone network coprocessor(NetCP) driver support.
The network coprocessor (NetCP) is a hardware accelerator that processes
Ethernet packets. NetCP has a gigabit Ethernet (GbE) subsystem with a ethernet
switch sub-module to send and receive packets. NetCP also includes a packet
accelerator (PA) module to perform packet classification operations such as
header matching, and packet modification operations such as checksum
generation. NetCP can also optionally include a Security Accelerator (SA)
capable of performing IPSec operations on ingress/egress packets.
Keystone II SoC's also have a 10 Gigabit Ethernet Subsystem (XGbE) which
includes a 3-port Ethernet switch sub-module capable of 10Gb/s and 1Gb/s rates
per Ethernet port.
Keystone NetCP driver has a plug-in module architecture where each of the NetCP
sub-modules exist as a loadable kernel module which plug in to the netcp core.
These sub-modules are represented as "netcp-devices" in the dts bindings. It is
mandatory to have the ethernet switch sub-module for the ethernet interface to
be operational. Any other sub-module like the PA is optional.
NetCP Ethernet SubSystem Layout:
-----------------------------
NetCP subsystem(10G or 1G)
-----------------------------
|
|-> NetCP Devices -> |
| |-> GBE/XGBE Switch
| |
| |-> Packet Accelerator
| |
| |-> Security Accelerator
|
|
|
|-> NetCP Interfaces -> |
|-> Ethernet Port 0
|
|-> Ethernet Port 1
|
|-> Ethernet Port 2
|
|-> Ethernet Port 3
NetCP subsystem properties:
Required properties:
- compatible: Should be "ti,netcp-1.0"
- clocks: phandle to the reference clocks for the subsystem.
- dma-id: Navigator packet dma instance id.
- ranges: address range of NetCP (includes, Ethernet SS, PA and SA)
Optional properties:
- reg: register location and the size for the following register
regions in the specified order.
- Efuse MAC address register
- dma-coherent: Present if dma operations are coherent
- big-endian: Keystone devices can be operated in a mode where the DSP is in
the big endian mode. In such cases enable this option. This
option should also be enabled if the ARM is operated in
big endian mode with the DSP in little endian.
NetCP device properties: Device specification for NetCP sub-modules.
1Gb/10Gb (gbe/xgbe) ethernet switch sub-module specifications.
Required properties:
- label: Must be "netcp-gbe" for 1Gb & "netcp-xgbe" for 10Gb.
- compatible: Must be one of below:-
"ti,netcp-gbe" for 1GbE on NetCP 1.4
"ti,netcp-gbe-5" for 1GbE N NetCP 1.5 (N=5)
"ti,netcp-gbe-9" for 1GbE N NetCP 1.5 (N=9)
"ti,netcp-gbe-2" for 1GbE N NetCP 1.5 (N=2)
"ti,netcp-xgbe" for 10 GbE
- reg: register location and the size for the following register
regions in the specified order.
- switch subsystem registers
- sgmii port3/4 module registers (only for NetCP 1.4)
- switch module registers
- serdes registers (only for 10G)
NetCP 1.4 ethss, here is the order
index #0 - switch subsystem registers
index #1 - sgmii port3/4 module registers
index #2 - switch module registers
NetCP 1.5 ethss 9 port, 5 port and 2 port
index #0 - switch subsystem registers
index #1 - switch module registers
index #2 - serdes registers
- tx-channel: the navigator packet dma channel name for tx.
- tx-queue: the navigator queue number associated with the tx dma channel.
- interfaces: specification for each of the switch port to be registered as a
network interface in the stack.
-- slave-port: Switch port number, 0 based numbering.
-- link-interface: type of link interface, supported options are
- mac<->mac auto negotiate mode: 0
- mac<->phy mode: 1
- mac<->mac forced mode: 2
- mac<->fiber mode: 3
- mac<->phy mode with no mdio: 4
- 10Gb mac<->phy mode : 10
- 10Gb mac<->mac forced mode : 11
----phy-handle: phandle to PHY device
- cpts: sub-node time synchronization (CPTS) submodule configuration
-- clocks: CPTS reference clock. Should point on cpts-refclk-mux clock.
-- clock-names: should be "cpts"
-- cpts-refclk-mux: multiplexer clock definition sub-node for CPTS reference (RFTCLK) clock
--- #clock-cells: should be 0
--- clocks: list of CPTS reference (RFTCLK) clock's parents as defined in Data manual
--- ti,mux-tbl: array of multiplexer indexes as defined in Data manual
--- assigned-clocks: should point on cpts-refclk-mux clock
--- assigned-clock-parents: should point on required RFTCLK clock parent to be selected
-- cpts_clock_mult: (optional) Numerator to convert input clock ticks
into nanoseconds
-- cpts_clock_shift: (optional) Denominator to convert input clock ticks into
nanoseconds.
Mult and shift will be calculated basing on CPTS
rftclk frequency if both cpts_clock_shift and
cpts_clock_mult properties are not provided.
Optional properties:
- enable-ale: NetCP driver keeps the address learning feature in the ethernet
switch module disabled. This attribute is to enable the address
learning.
- secondary-slave-ports: specification for each of the switch port not be
registered as a network interface. NetCP driver
will only initialize these ports and attach PHY
driver to them if needed.
NetCP interface properties: Interface specification for NetCP sub-modules.
Required properties:
- rx-channel: the navigator packet dma channel name for rx.
- rx-queue: the navigator queue number associated with rx dma channel.
- rx-pool: specifies the number of descriptors to be used & the region-id
for creating the rx descriptor pool.
- tx-pool: specifies the number of descriptors to be used & the region-id
for creating the tx descriptor pool.
- rx-queue-depth: number of descriptors in each of the free descriptor
queue (FDQ) for the pktdma Rx flow. There can be at
present a maximum of 4 queues per Rx flow.
- rx-buffer-size: the buffer size for each of the Rx flow FDQ.
- tx-completion-queue: the navigator queue number where the descriptors are
recycled after Tx DMA completion.
Optional properties:
- efuse-mac: If this is 1, then the MAC address for the interface is
obtained from the device efuse mac address register.
If this is 2, the two DWORDs occupied by the MAC address
are swapped. The netcp driver will swap the two DWORDs
back to the proper order when this property is set to 2
when it obtains the mac address from efuse.
- "netcp-device label": phandle to the device specification for each of NetCP
sub-module attached to this interface.
The MAC address will be determined using the optional properties defined in
ethernet.txt and only if efuse-mac is set to 0. If all of the optional MAC
address properties are not present, then the driver will use a random MAC
address.
Example binding:
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 board configuration - select external CPTS RFTCLK:
&tsrefclk{
clock-frequency = <500000000>;
};
&cpts_refclk_mux {
assigned-clock-parents = <&tsrefclk>;
};
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 두 그룹을 소유하는 형태입니다.
원문의 계층형 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 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입니다.
숫자 값과 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>;
};
요약과 해설
keystone-netcp.txt:1-265원문 ASCII subsystem 구조와 register·link mode 표를 구조화하고 두 interface 예제를 해설합니다.