요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
Hisilicon DSA Fabric device controller
Required properties:
- compatible: should be "hisilicon,hns-dsaf-v1" or "hisilicon,hns-dsaf-v2".
"hisilicon,hns-dsaf-v1" is for hip05.
"hisilicon,hns-dsaf-v2" is for Hi1610 and Hi1612.
- mode: dsa fabric mode string. only support one of dsaf modes like these:
"2port-64vf",
"6port-16rss",
"6port-16vf",
"single-port".
- interrupts: should contain the DSA Fabric and rcb interrupt.
- reg: specifies base physical address(es) and size of the device registers.
The first region is external interface control register base and size(optional,
only used when subctrl-syscon does not exist). It is recommended using
subctrl-syscon rather than this address.
The second region is SerDes base register and size(optional, only used when
serdes-syscon in port node does not exist). It is recommended using
serdes-syscon rather than this address.
The third region is the PPE register base and size.
The fourth region is dsa fabric base register and size. It is not required for
single-port mode.
- reg-names: may be ppe-base and(or) dsaf-base. It is used to find the
corresponding reg's index.
- phy-handle: phy handle of physical port, 0 if not any phy device. It is optional
attribute. If port node exists, phy-handle in each port node will be used.
see ethernet.txt [1].
- subctrl-syscon: is syscon handle for external interface control register.
- reset-field-offset: is offset of reset field. Its value depends on the hardware
user manual.
- buf-size: rx buffer size, should be 16-1024.
- desc-num: number of description in TX and RX queue, should be 512, 1024, 2048 or 4096.
- port: subnodes of dsaf. A dsaf node may contain several port nodes(Depending
on mode of dsaf). Port node contain some attributes listed below:
- reg: is physical port index in one dsaf.
- phy-handle: phy handle of physical port. It is not required if there isn't
phy device. see ethernet.txt [1].
- serdes-syscon: is syscon handle for SerDes register.
- cpld-syscon: is syscon handle + register offset pair for cpld register. It is
not required if there isn't cpld device.
- port-rst-offset: is offset of reset field for each port in dsaf. Its value
depends on the hardware user manual.
- port-mode-offset: is offset of port mode field for each port in dsaf. Its
value depends on the hardware user manual.
- mc-mac-mask: mask of multicast address, determines bit in multicast address
to set:
1 stands for this bit will be precisely matched, TCAM will check this bit of
MAC address.
0 stands for this bit will be fuzzy matched, TCAM won't care about this bit
of MAC address.
[1] Documentation/devicetree/bindings/net/phy.txt
Example:
dsaf0: dsa@c7000000 {
compatible = "hisilicon,hns-dsaf-v1";
mode = "6port-16rss";
interrupt-parent = <&mbigen_dsa>;
reg = <0x0 0xc5000000 0x0 0x890000
0x0 0xc7000000 0x0 0x60000>;
reg-names = "ppe-base", "dsaf-base";
subctrl-syscon = <&subctrl>;
reset-field-offset = 0;
interrupts = <131 4>,<132 4>, <133 4>,<134 4>,
<135 4>,<136 4>, <137 4>,<138 4>,
<139 4>,<140 4>, <141 4>,<142 4>,
<143 4>,<144 4>, <145 4>,<146 4>,
<147 4>,<148 4>, <384 1>,<385 1>,
<386 1>,<387 1>, <388 1>,<389 1>,
<390 1>,<391 1>,
buf-size = <4096>;
desc-num = <1024>;
dma-coherent;
port@0 {
reg = 0;
phy-handle = <&phy0>;
serdes-syscon = <&serdes>;
mc-mac-mask = [ff f0 00 00 00 00];
};
port@1 {
reg = 1;
serdes-syscon = <&serdes>;
mc-mac-mask = [ff f0 00 00 00 00];
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Hisilicon DSA Fabric controller
1-34`compatible`은 HIP05용 `hisilicon,hns-dsaf-v1` 또는 Hi1610/Hi1612용 `hisilicon,hns-dsaf-v2`입니다.
`mode`는 DSA fabric mode 문자열이며 `2port-64vf`, `6port-16rss`, `6port-16vf`, `single-port` 중 하나만 지원합니다. `interrupts`에는 DSA Fabric과 RCB interrupt가 들어갑니다.
`reg`의 첫 영역은 external interface control register이며 `subctrl-syscon`이 없을 때만 사용합니다. 주소보다 `subctrl-syscon` 사용을 권장합니다. 두 번째는 SerDes register이며 port node에 `serdes-syscon`이 없을 때만 사용하고 역시 syscon을 권장합니다.
세 번째 `reg` 영역은 PPE register, 네 번째는 DSA fabric register입니다. 네 번째는 single-port mode에는 필요하지 않습니다. `reg-names`는 대응 index를 찾기 위한 `ppe-base`와 `dsaf-base` 중 하나 또는 둘입니다.
선택 `phy-handle`은 physical port의 PHY handle이며 PHY가 없으면 0입니다. Port node가 있으면 각 port의 `phy-handle`을 사용합니다. 참조 문서는 `ethernet.txt`입니다.
`subctrl-syscon`은 external interface control register의 syscon handle, `reset-field-offset`은 hardware manual에 따른 reset field offset입니다. `buf-size`는 16부터 1024 사이의 RX buffer 크기이고 `desc-num`은 TX/RX queue descriptor 수로 512, 1024, 2048, 4096 중 하나입니다.
직접 주소보다 syscon handle 사용을 권장하는 선택 영역이 앞에 옵니다.
DSAF port subnode
35-55DSAF node는 mode에 따라 여러 `port` subnode를 가질 수 있습니다. Port의 `reg`는 한 DSAF 안의 physical port index입니다. PHY가 있으면 `phy-handle`을 지정하고 `serdes-syscon`은 SerDes register의 syscon handle입니다.
`cpld-syscon`은 CPLD register의 syscon handle과 register offset 쌍이며 CPLD가 없으면 필요하지 않습니다. `port-rst-offset`과 `port-mode-offset`은 각 port의 reset field와 mode field offset이며 값은 hardware manual에 따릅니다.
`mc-mac-mask`는 multicast address mask입니다. Bit가 1이면 TCAM이 MAC address의 해당 bit를 정확히 비교하고, 0이면 fuzzy match로 처리해 해당 bit를 무시합니다.
PHY 참조 문서는 `[1] Documentation/devicetree/bindings/net/phy.txt`입니다.
각 mask bit가 TCAM 비교 방식에 직접 대응합니다.
HIP05 DSAF v1 예제
56-90예제는 `6port-16rss` mode에서 PPE와 DSAF register, `subctrl` syscon, 여러 DSAF/RCB interrupt를 지정합니다. RX buffer는 4096, queue descriptor는 1024이고 DMA coherent입니다.
Port 0은 `phy0`과 SerDes를 연결하고 port 1은 PHY 없이 SerDes만 연결합니다. 두 port의 multicast mask는 `ff:f0:00:00:00:00`입니다.
dsaf0: dsa@c7000000 {
compatible = "hisilicon,hns-dsaf-v1";
mode = "6port-16rss";
interrupt-parent = <&mbigen_dsa>;
reg = <0x0 0xc5000000 0x0 0x890000
0x0 0xc7000000 0x0 0x60000>;
reg-names = "ppe-base", "dsaf-base";
subctrl-syscon = <&subctrl>;
reset-field-offset = 0;
interrupts = <131 4>,<132 4>, <133 4>,<134 4>,
<135 4>,<136 4>, <137 4>,<138 4>,
<139 4>,<140 4>, <141 4>,<142 4>,
<143 4>,<144 4>, <145 4>,<146 4>,
<147 4>,<148 4>, <384 1>,<385 1>,
<386 1>,<387 1>, <388 1>,<389 1>,
<390 1>,<391 1>,
buf-size = <4096>;
desc-num = <1024>;
dma-coherent;
port@0 {
reg = 0;
phy-handle = <&phy0>;
serdes-syscon = <&serdes>;
mc-mac-mask = [ff f0 00 00 00 00];
};
port@1 {
reg = 1;
serdes-syscon = <&serdes>;
mc-mac-mask = [ff f0 00 00 00 00];
};
};
요약과 해설
hisilicon-hns-dsaf.txt:1-90네 register 영역과 syscon 대안, port별 SerDes·multicast mask를 설명합니다.