요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
4xx/Axon EMAC ethernet nodes
The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
the Axon bridge. To operate this needs to interact with a this
special McMAL DMA controller, and sometimes an RGMII or ZMII
interface. In addition to the nodes and properties described
below, the node for the OPB bus on which the EMAC sits must have a
correct clock-frequency property.
i) The EMAC node itself
Required properties:
- device_type : "network"
- compatible : compatible list, contains 2 entries, first is
"ibm,emac-CHIP" where CHIP is the host ASIC (440gx,
405gp, Axon) and second is either "ibm,emac" or
"ibm,emac4". For Axon, thus, we have: "ibm,emac-axon",
"ibm,emac4"
- interrupts : <interrupt mapping for EMAC IRQ and WOL IRQ>
- reg : <registers mapping>
- local-mac-address : 6 bytes, MAC address
- mal-device : phandle of the associated McMAL node
- mal-tx-channel : 1 cell, index of the tx channel on McMAL associated
with this EMAC
- mal-rx-channel : 1 cell, index of the rx channel on McMAL associated
with this EMAC
- cell-index : 1 cell, hardware index of the EMAC cell on a given
ASIC (typically 0x0 and 0x1 for EMAC0 and EMAC1 on
each Axon chip)
- max-frame-size : 1 cell, maximum frame size supported in bytes
- rx-fifo-size : 1 cell, Rx fifo size in bytes for 10 and 100 Mb/sec
operations.
For Axon, 2048
- tx-fifo-size : 1 cell, Tx fifo size in bytes for 10 and 100 Mb/sec
operations.
For Axon, 2048.
- fifo-entry-size : 1 cell, size of a fifo entry (used to calculate
thresholds).
For Axon, 0x00000010
- mal-burst-size : 1 cell, MAL burst size (used to calculate thresholds)
in bytes.
For Axon, 0x00000100 (I think ...)
- phy-mode : string, mode of operations of the PHY interface.
Supported values are: "mii", "rmii", "smii", "rgmii",
"tbi", "gmii", rtbi", "sgmii".
For Axon on CAB, it is "rgmii"
- mdio-device : 1 cell, required iff using shared MDIO registers
(440EP). phandle of the EMAC to use to drive the
MDIO lines for the PHY used by this EMAC.
- zmii-device : 1 cell, required iff connected to a ZMII. phandle of
the ZMII device node
- zmii-channel : 1 cell, required iff connected to a ZMII. Which ZMII
channel or 0xffffffff if ZMII is only used for MDIO.
- rgmii-device : 1 cell, required iff connected to an RGMII. phandle
of the RGMII device node.
For Axon: phandle of plb5/plb4/opb/rgmii
- rgmii-channel : 1 cell, required iff connected to an RGMII. Which
RGMII channel is used by this EMAC.
Fox Axon: present, whatever value is appropriate for each
EMAC, that is the content of the current (bogus) "phy-port"
property.
Optional properties:
- phy-address : 1 cell, optional, MDIO address of the PHY. If absent,
a search is performed.
- phy-map : 1 cell, optional, bitmap of addresses to probe the PHY
for, used if phy-address is absent. bit 0x00000001 is
MDIO address 0.
For Axon it can be absent, though my current driver
doesn't handle phy-address yet so for now, keep
0x00ffffff in it.
- phy-handle : Used to describe configurations where a external PHY
is used. Please refer to:
Documentation/devicetree/bindings/net/ethernet.txt
- rx-fifo-size-gige : 1 cell, Rx fifo size in bytes for 1000 Mb/sec
operations (if absent the value is the same as
rx-fifo-size). For Axon, either absent or 2048.
- tx-fifo-size-gige : 1 cell, Tx fifo size in bytes for 1000 Mb/sec
operations (if absent the value is the same as
tx-fifo-size). For Axon, either absent or 2048.
- tah-device : 1 cell, optional. If connected to a TAH engine for
offload, phandle of the TAH device node.
- tah-channel : 1 cell, optional. If appropriate, channel used on the
TAH engine.
- fixed-link : Fixed-link subnode describing a link to a non-MDIO
managed entity. See
Documentation/devicetree/bindings/net/fixed-link.txt
for details.
- mdio subnode : When the EMAC has a phy connected to its local
mdio, which us supported by the kernel's network
PHY library in drivers/net/phy, there must be device
tree subnode with the following required properties:
- #address-cells: Must be <1>.
- #size-cells: Must be <0>.
For PHY definitions: Please refer to
Documentation/devicetree/bindings/net/phy.txt and
Documentation/devicetree/bindings/net/ethernet.txt
Examples:
EMAC0: ethernet@40000800 {
device_type = "network";
compatible = "ibm,emac-440gp", "ibm,emac";
interrupt-parent = <&UIC1>;
interrupts = <1c 4 1d 4>;
reg = <40000800 70>;
local-mac-address = [00 04 AC E3 1B 1E];
mal-device = <&MAL0>;
mal-tx-channel = <0 1>;
mal-rx-channel = <0>;
cell-index = <0>;
max-frame-size = <5dc>;
rx-fifo-size = <1000>;
tx-fifo-size = <800>;
phy-mode = "rmii";
phy-map = <00000001>;
zmii-device = <&ZMII0>;
zmii-channel = <0>;
};
EMAC1: ethernet@ef600c00 {
device_type = "network";
compatible = "ibm,emac-apm821xx", "ibm,emac4sync";
interrupt-parent = <&EMAC1>;
interrupts = <0 1>;
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
interrupt-map = <0 &UIC2 0x10 IRQ_TYPE_LEVEL_HIGH /* Status */
1 &UIC2 0x14 IRQ_TYPE_LEVEL_HIGH /* Wake */>;
reg = <0xef600c00 0x000000c4>;
local-mac-address = [000000000000]; /* Filled in by U-Boot */
mal-device = <&MAL0>;
mal-tx-channel = <0>;
mal-rx-channel = <0>;
cell-index = <0>;
max-frame-size = <9000>;
rx-fifo-size = <16384>;
tx-fifo-size = <2048>;
fifo-entry-size = <10>;
phy-mode = "rgmii";
phy-handle = <&phy0>;
phy-map = <0x00000000>;
rgmii-device = <&RGMII0>;
rgmii-channel = <0>;
tah-device = <&TAH0>;
tah-channel = <0>;
has-inverted-stacr-oc;
has-new-stacr-staopc;
mdio {
#address-cells = <1>;
#size-cells = <0>;
phy0: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
};
};
};
ii) McMAL node
Required properties:
- device_type : "dma-controller"
- compatible : compatible list, containing 2 entries, first is
"ibm,mcmal-CHIP" where CHIP is the host ASIC (like
emac) and the second is either "ibm,mcmal" or
"ibm,mcmal2".
For Axon, "ibm,mcmal-axon","ibm,mcmal2"
- interrupts : <interrupt mapping for the MAL interrupts sources:
5 sources: tx_eob, rx_eob, serr, txde, rxde>.
For Axon: This is _different_ from the current
firmware. We use the "delayed" interrupts for txeob
and rxeob. Thus we end up with mapping those 5 MPIC
interrupts, all level positive sensitive: 10, 11, 32,
33, 34 (in decimal)
- dcr-reg : < DCR registers range >
- dcr-parent : if needed for dcr-reg
- num-tx-chans : 1 cell, number of Tx channels
- num-rx-chans : 1 cell, number of Rx channels
iii) ZMII node
Required properties:
- compatible : compatible list, containing 2 entries, first is
"ibm,zmii-CHIP" where CHIP is the host ASIC (like
EMAC) and the second is "ibm,zmii".
For Axon, there is no ZMII node.
- reg : <registers mapping>
iv) RGMII node
Required properties:
- compatible : compatible list, containing 2 entries, first is
"ibm,rgmii-CHIP" where CHIP is the host ASIC (like
EMAC) and the second is "ibm,rgmii".
For Axon, "ibm,rgmii-axon","ibm,rgmii"
- reg : <registers mapping>
- revision : as provided by the RGMII new version register if
available.
For Axon: 0x0000012a
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
IBM 4xx/Axon EMAC
1-9IBM·AMCC 4xx chip과 Axon bridge의 EMAC Ethernet controller는 특수 McMAL DMA controller와 상호작용해야 하며 경우에 따라 RGMII 또는 ZMII interface도 사용합니다.
아래 node와 속성 외에도 EMAC이 위치한 OPB bus node에 올바른 `clock-frequency`가 있어야 합니다.
EMAC은 MAL DMA가 필수이고 선택적으로 PHY interface block과 TAH offload를 사용합니다.
EMAC node 필수 속성
10-63`device_type`은 `network`입니다. `compatible`은 두 항목으로, 첫 번째는 host ASIC을 반영한 `ibm,emac-CHIP`, 두 번째는 `ibm,emac` 또는 `ibm,emac4`입니다. Axon은 `ibm,emac-axon`, `ibm,emac4`를 사용합니다.
`interrupts`는 EMAC IRQ와 WOL IRQ mapping, `reg`는 register mapping, `local-mac-address`는 6-byte MAC address입니다.
`mal-device`는 연결된 McMAL node phandle입니다. `mal-tx-channel`과 `mal-rx-channel`은 이 EMAC에 연결된 McMAL TX/RX channel index이고 `cell-index`는 ASIC 안 EMAC cell의 hardware index입니다. Axon chip의 EMAC0/1은 보통 `0x0`, `0x1`입니다.
`max-frame-size`는 최대 frame byte 수입니다. `rx-fifo-size`와 `tx-fifo-size`는 10/100Mbps 동작의 FIFO byte 크기이며 Axon 값은 각각 2048입니다.
`fifo-entry-size`는 threshold 계산에 쓰는 FIFO entry 크기이며 Axon은 `0x10`입니다. `mal-burst-size`는 threshold 계산에 쓰는 MAL burst byte 크기이며 Axon은 `0x100`으로 추정됩니다.
`phy-mode`는 PHY interface 동작 mode 문자열입니다. 지원 값은 `mii`, `rmii`, `smii`, `rgmii`, `tbi`, `gmii`, `rtbi`, `sgmii`이며 CAB의 Axon은 `rgmii`를 사용합니다.
`mdio-device`는 440EP처럼 MDIO register를 공유할 때만 필요하며 이 EMAC의 PHY MDIO line을 구동할 EMAC의 phandle입니다.
`zmii-device`와 `zmii-channel`은 ZMII 연결 시 필요합니다. Channel은 사용할 ZMII channel이며 ZMII를 MDIO에만 쓰면 `0xffffffff`입니다.
`rgmii-device`와 `rgmii-channel`은 RGMII 연결 시 필요합니다. Axon의 device는 `plb5/plb4/opb/rgmii` phandle이고 channel은 각 EMAC에 적절한 값으로 기존의 잘못된 `phy-port` 속성 내용을 사용합니다.
EMAC 선택 속성과 MDIO subnode
64-100선택 `phy-address`는 PHY MDIO 주소이며 없으면 검색합니다. `phy-map`은 `phy-address`가 없을 때 probe할 주소 bitmap이고 bit `0x00000001`은 MDIO 주소 0입니다. Axon에서는 생략할 수 있지만 현재 드라이버 제약 때문에 당분간 `0x00ffffff`를 유지합니다.
`phy-handle`은 외부 PHY 구성에 사용하며 `Documentation/devicetree/bindings/net/ethernet.txt`를 참조합니다.
`rx-fifo-size-gige`와 `tx-fifo-size-gige`는 1000Mbps 동작의 FIFO byte 크기입니다. 없으면 10/100Mbps 속성과 같은 값을 사용하며 Axon은 생략하거나 2048입니다.
`tah-device`는 offload용 TAH engine node phandle이고 `tah-channel`은 TAH channel입니다.
`fixed-link` subnode는 MDIO로 관리하지 않는 entity와의 link를 기술하며 `Documentation/devicetree/bindings/net/fixed-link.txt`를 참조합니다.
EMAC의 local MDIO에 PHY가 연결되고 kernel `drivers/net/phy` PHY library가 지원하면 `mdio` subnode가 필요합니다. `#address-cells`는 `<1>`, `#size-cells`는 `<0>`이며 PHY 정의는 `phy.txt`와 `ethernet.txt`를 참조합니다.
EMAC와 EMAC4sync 예제
101-164첫 예제는 IBM 440GP EMAC을 RMII와 ZMII channel 0에 연결하고 MAL TX channel 0/1, RX channel 0을 사용합니다.
두 번째 APM821xx `emac4sync` 예제는 status/wake interrupt map, jumbo frame 9000, RGMII와 external PHY 0, TAH channel 0을 사용합니다. `has-inverted-stacr-oc`와 `has-new-stacr-staopc` 기능도 선언합니다.
EMAC0: ethernet@40000800 {
device_type = "network";
compatible = "ibm,emac-440gp", "ibm,emac";
interrupt-parent = <&UIC1>;
interrupts = <1c 4 1d 4>;
reg = <40000800 70>;
local-mac-address = [00 04 AC E3 1B 1E];
mal-device = <&MAL0>;
mal-tx-channel = <0 1>;
mal-rx-channel = <0>;
cell-index = <0>;
max-frame-size = <5dc>;
rx-fifo-size = <1000>;
tx-fifo-size = <800>;
phy-mode = "rmii";
phy-map = <00000001>;
zmii-device = <&ZMII0>;
zmii-channel = <0>;
};
EMAC1: ethernet@ef600c00 {
device_type = "network";
compatible = "ibm,emac-apm821xx", "ibm,emac4sync";
interrupt-parent = <&EMAC1>;
interrupts = <0 1>;
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
interrupt-map = <0 &UIC2 0x10 IRQ_TYPE_LEVEL_HIGH /* Status */
1 &UIC2 0x14 IRQ_TYPE_LEVEL_HIGH /* Wake */>;
reg = <0xef600c00 0x000000c4>;
local-mac-address = [000000000000]; /* Filled in by U-Boot */
mal-device = <&MAL0>;
mal-tx-channel = <0>;
mal-rx-channel = <0>;
cell-index = <0>;
max-frame-size = <9000>;
rx-fifo-size = <16384>;
tx-fifo-size = <2048>;
fifo-entry-size = <10>;
phy-mode = "rgmii";
phy-handle = <&phy0>;
phy-map = <0x00000000>;
rgmii-device = <&RGMII0>;
rgmii-channel = <0>;
tah-device = <&TAH0>;
tah-channel = <0>;
has-inverted-stacr-oc;
has-new-stacr-staopc;
mdio {
#address-cells = <1>;
#size-cells = <0>;
phy0: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
};
};
};
McMAL DMA node
165-185`device_type`은 `dma-controller`입니다. `compatible`은 host ASIC의 `ibm,mcmal-CHIP`과 `ibm,mcmal` 또는 `ibm,mcmal2` 두 항목이며 Axon은 `ibm,mcmal-axon`, `ibm,mcmal2`입니다.
`interrupts`는 `tx_eob`, `rx_eob`, `serr`, `txde`, `rxde` 다섯 MAL interrupt source를 매핑합니다. Axon은 현재 firmware와 달리 TX/RX EOB에 delayed interrupt를 사용하므로 level-positive MPIC interrupt 10, 11, 32, 33, 34를 매핑합니다.
`dcr-reg`는 DCR register 범위, 필요하면 `dcr-parent`를 지정합니다. `num-tx-chans`와 `num-rx-chans`는 TX/RX channel 수입니다.
MAL은 다섯 interrupt source를 고정 순서로 기술합니다.
ZMII node
186-194`compatible`은 host ASIC의 `ibm,zmii-CHIP`과 `ibm,zmii` 두 항목입니다. Axon에는 ZMII node가 없습니다. `reg`는 register mapping입니다.
RGMII node
195-205`compatible`은 host ASIC의 `ibm,rgmii-CHIP`과 `ibm,rgmii` 두 항목입니다. Axon은 `ibm,rgmii-axon`, `ibm,rgmii`를 사용합니다.
`reg`는 register mapping이고 `revision`은 가능할 경우 RGMII new version register의 값입니다. Axon revision은 `0x0000012a`입니다.
요약과 해설
ibm,emac.txt:1-205EMAC과 MAL channel, PHY interface node와 440GP/APM821xx 예제를 연결해 설명합니다.