← Documents Documentation/devicetree/bindings/net/ibm,emac.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

IBM 4xx and Axon EMAC

IBM EMAC, McMAL DMA, ZMII/RGMII와 선택 TAH offload binding입니다.

Source pathDocumentation/devicetree/bindings/net/ibm,emac.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

ibm,emac.txt:1-205

EMAC과 MAL channel, PHY interface node와 440GP/APM821xx 예제를 연결해 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 4xx/Axon EMAC ethernet nodes
2
3 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
4 the Axon bridge. To operate this needs to interact with a this
5 special McMAL DMA controller, and sometimes an RGMII or ZMII
6 interface. In addition to the nodes and properties described
7 below, the node for the OPB bus on which the EMAC sits must have a
8 correct clock-frequency property.
9
10 i) The EMAC node itself
11
12 Required properties:
13 - device_type : "network"
14
15 - compatible : compatible list, contains 2 entries, first is
16 "ibm,emac-CHIP" where CHIP is the host ASIC (440gx,
17 405gp, Axon) and second is either "ibm,emac" or
18 "ibm,emac4". For Axon, thus, we have: "ibm,emac-axon",
19 "ibm,emac4"
20 - interrupts : <interrupt mapping for EMAC IRQ and WOL IRQ>
21 - reg : <registers mapping>
22 - local-mac-address : 6 bytes, MAC address
23 - mal-device : phandle of the associated McMAL node
24 - mal-tx-channel : 1 cell, index of the tx channel on McMAL associated
25 with this EMAC
26 - mal-rx-channel : 1 cell, index of the rx channel on McMAL associated
27 with this EMAC
28 - cell-index : 1 cell, hardware index of the EMAC cell on a given
29 ASIC (typically 0x0 and 0x1 for EMAC0 and EMAC1 on
30 each Axon chip)
31 - max-frame-size : 1 cell, maximum frame size supported in bytes
32 - rx-fifo-size : 1 cell, Rx fifo size in bytes for 10 and 100 Mb/sec
33 operations.
34 For Axon, 2048
35 - tx-fifo-size : 1 cell, Tx fifo size in bytes for 10 and 100 Mb/sec
36 operations.
37 For Axon, 2048.
38 - fifo-entry-size : 1 cell, size of a fifo entry (used to calculate
39 thresholds).
40 For Axon, 0x00000010
41 - mal-burst-size : 1 cell, MAL burst size (used to calculate thresholds)
42 in bytes.
43 For Axon, 0x00000100 (I think ...)
44 - phy-mode : string, mode of operations of the PHY interface.
45 Supported values are: "mii", "rmii", "smii", "rgmii",
46 "tbi", "gmii", rtbi", "sgmii".
47 For Axon on CAB, it is "rgmii"
48 - mdio-device : 1 cell, required iff using shared MDIO registers
49 (440EP). phandle of the EMAC to use to drive the
50 MDIO lines for the PHY used by this EMAC.
51 - zmii-device : 1 cell, required iff connected to a ZMII. phandle of
52 the ZMII device node
53 - zmii-channel : 1 cell, required iff connected to a ZMII. Which ZMII
54 channel or 0xffffffff if ZMII is only used for MDIO.
55 - rgmii-device : 1 cell, required iff connected to an RGMII. phandle
56 of the RGMII device node.
57 For Axon: phandle of plb5/plb4/opb/rgmii
58 - rgmii-channel : 1 cell, required iff connected to an RGMII. Which
59 RGMII channel is used by this EMAC.
60 Fox Axon: present, whatever value is appropriate for each
61 EMAC, that is the content of the current (bogus) "phy-port"
62 property.
63
64 Optional properties:
65 - phy-address : 1 cell, optional, MDIO address of the PHY. If absent,
66 a search is performed.
67 - phy-map : 1 cell, optional, bitmap of addresses to probe the PHY
68 for, used if phy-address is absent. bit 0x00000001 is
69 MDIO address 0.
70 For Axon it can be absent, though my current driver
71 doesn't handle phy-address yet so for now, keep
72 0x00ffffff in it.
73 - phy-handle : Used to describe configurations where a external PHY
74 is used. Please refer to:
75 Documentation/devicetree/bindings/net/ethernet.txt
76 - rx-fifo-size-gige : 1 cell, Rx fifo size in bytes for 1000 Mb/sec
77 operations (if absent the value is the same as
78 rx-fifo-size). For Axon, either absent or 2048.
79 - tx-fifo-size-gige : 1 cell, Tx fifo size in bytes for 1000 Mb/sec
80 operations (if absent the value is the same as
81 tx-fifo-size). For Axon, either absent or 2048.
82 - tah-device : 1 cell, optional. If connected to a TAH engine for
83 offload, phandle of the TAH device node.
84 - tah-channel : 1 cell, optional. If appropriate, channel used on the
85 TAH engine.
86 - fixed-link : Fixed-link subnode describing a link to a non-MDIO
87 managed entity. See
88 Documentation/devicetree/bindings/net/fixed-link.txt
89 for details.
90 - mdio subnode : When the EMAC has a phy connected to its local
91 mdio, which us supported by the kernel's network
92 PHY library in drivers/net/phy, there must be device
93 tree subnode with the following required properties:
94 - #address-cells: Must be <1>.
95 - #size-cells: Must be <0>.
96
97 For PHY definitions: Please refer to
98 Documentation/devicetree/bindings/net/phy.txt and
99 Documentation/devicetree/bindings/net/ethernet.txt
100
101 Examples:
102
103 EMAC0: ethernet@40000800 {
104 device_type = "network";
105 compatible = "ibm,emac-440gp", "ibm,emac";
106 interrupt-parent = <&UIC1>;
107 interrupts = <1c 4 1d 4>;
108 reg = <40000800 70>;
109 local-mac-address = [00 04 AC E3 1B 1E];
110 mal-device = <&MAL0>;
111 mal-tx-channel = <0 1>;
112 mal-rx-channel = <0>;
113 cell-index = <0>;
114 max-frame-size = <5dc>;
115 rx-fifo-size = <1000>;
116 tx-fifo-size = <800>;
117 phy-mode = "rmii";
118 phy-map = <00000001>;
119 zmii-device = <&ZMII0>;
120 zmii-channel = <0>;
121 };
122
123 EMAC1: ethernet@ef600c00 {
124 device_type = "network";
125 compatible = "ibm,emac-apm821xx", "ibm,emac4sync";
126 interrupt-parent = <&EMAC1>;
127 interrupts = <0 1>;
128 #interrupt-cells = <1>;
129 #address-cells = <0>;
130 #size-cells = <0>;
131 interrupt-map = <0 &UIC2 0x10 IRQ_TYPE_LEVEL_HIGH /* Status */
132 1 &UIC2 0x14 IRQ_TYPE_LEVEL_HIGH /* Wake */>;
133 reg = <0xef600c00 0x000000c4>;
134 local-mac-address = [000000000000]; /* Filled in by U-Boot */
135 mal-device = <&MAL0>;
136 mal-tx-channel = <0>;
137 mal-rx-channel = <0>;
138 cell-index = <0>;
139 max-frame-size = <9000>;
140 rx-fifo-size = <16384>;
141 tx-fifo-size = <2048>;
142 fifo-entry-size = <10>;
143 phy-mode = "rgmii";
144 phy-handle = <&phy0>;
145 phy-map = <0x00000000>;
146 rgmii-device = <&RGMII0>;
147 rgmii-channel = <0>;
148 tah-device = <&TAH0>;
149 tah-channel = <0>;
150 has-inverted-stacr-oc;
151 has-new-stacr-staopc;
152
153 mdio {
154 #address-cells = <1>;
155 #size-cells = <0>;
156
157 phy0: ethernet-phy@0 {
158 compatible = "ethernet-phy-ieee802.3-c22";
159 reg = <0>;
160 };
161 };
162 };
163
164
165 ii) McMAL node
166
167 Required properties:
168 - device_type : "dma-controller"
169 - compatible : compatible list, containing 2 entries, first is
170 "ibm,mcmal-CHIP" where CHIP is the host ASIC (like
171 emac) and the second is either "ibm,mcmal" or
172 "ibm,mcmal2".
173 For Axon, "ibm,mcmal-axon","ibm,mcmal2"
174 - interrupts : <interrupt mapping for the MAL interrupts sources:
175 5 sources: tx_eob, rx_eob, serr, txde, rxde>.
176 For Axon: This is _different_ from the current
177 firmware. We use the "delayed" interrupts for txeob
178 and rxeob. Thus we end up with mapping those 5 MPIC
179 interrupts, all level positive sensitive: 10, 11, 32,
180 33, 34 (in decimal)
181 - dcr-reg : < DCR registers range >
182 - dcr-parent : if needed for dcr-reg
183 - num-tx-chans : 1 cell, number of Tx channels
184 - num-rx-chans : 1 cell, number of Rx channels
185
186 iii) ZMII node
187
188 Required properties:
189 - compatible : compatible list, containing 2 entries, first is
190 "ibm,zmii-CHIP" where CHIP is the host ASIC (like
191 EMAC) and the second is "ibm,zmii".
192 For Axon, there is no ZMII node.
193 - reg : <registers mapping>
194
195 iv) RGMII node
196
197 Required properties:
198 - compatible : compatible list, containing 2 entries, first is
199 "ibm,rgmii-CHIP" where CHIP is the host ASIC (like
200 EMAC) and the second is "ibm,rgmii".
201 For Axon, "ibm,rgmii-axon","ibm,rgmii"
202 - reg : <registers mapping>
203 - revision : as provided by the RGMII new version register if
204 available.
205 For Axon: 0x0000012a
206

3. 한국어 전문 번역

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

IBM 4xx/Axon EMAC

1-9

IBM·AMCC 4xx chip과 Axon bridge의 EMAC Ethernet controller는 특수 McMAL DMA controller와 상호작용해야 하며 경우에 따라 RGMII 또는 ZMII interface도 사용합니다.

아래 node와 속성 외에도 EMAC이 위치한 OPB bus node에 올바른 `clock-frequency`가 있어야 합니다.

IBM EMAC 주변 구성
OPB clock-frequencyEMAC
McMAL DMAEMAC
EMACZMII or RGMII
EMACOptional TAH
ZMII or RGMIIPHY

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 수입니다.

McMAL interrupt source
순서SourceAxon MPIC
1tx_eob10
2rx_eob11
3serr32
4txde33
5rxde34

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`입니다.