요약·해설, 영어 원문, 전체 번역을 구분해 실었습니다. API 이름, 코드 심벌, 소스 경로는 원문 표기를 유지합니다.
1. 요약·해설
원문의 핵심 내용을 정리하고 커널 프로그래밍에 필요한 설명을 덧붙였습니다. 아래의 전체 번역과는 별도로 작성한 해설입니다.
2. 영어 원문 전체
번역에 사용한 Linux v6.18.37 원문입니다. 줄 번호는 해당 버전의 소스 파일을 기준으로 합니다.
원문 전체 펼치기
SMSC/MicroChip LAN9303 three port ethernet switch
-------------------------------------------------
Required properties:
- compatible: should be
- "smsc,lan9303-i2c" for I2C managed mode
or
- "smsc,lan9303-mdio" for mdio managed mode
Optional properties:
- reset-gpios: GPIO to be used to reset the whole device
- reset-duration: reset duration in milliseconds, defaults to 200 ms
Subnodes:
The integrated switch subnode should be specified according to the binding
described in dsa/dsa.txt. The CPU port of this switch is always port 0.
Note: always use 'reg = <0/1/2>;' for the three DSA ports, even if the device is
configured to use 1/2/3 instead. This hardware configuration will be
auto-detected and mapped accordingly.
Example:
I2C managed mode:
master: masterdevice@X {
fixed-link { /* RMII fixed link to LAN9303 */
speed = <100>;
full-duplex;
};
};
switch: switch@a {
compatible = "smsc,lan9303-i2c";
reg = <0xa>;
reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
reset-duration = <200>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 { /* RMII fixed link to master */
reg = <0>;
ethernet = <&master>;
};
port@1 { /* external port 1 */
reg = <1>;
label = "lan1";
};
port@2 { /* external port 2 */
reg = <2>;
label = "lan2";
};
};
};
MDIO managed mode:
master: masterdevice@X {
phy-handle = <&switch>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
switch: switch-phy@0 {
compatible = "smsc,lan9303-mdio";
reg = <0>;
reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
reset-duration = <100>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ethernet = <&master>;
};
port@1 { /* external port 1 */
reg = <1>;
label = "lan1";
};
port@2 { /* external port 2 */
reg = <2>;
label = "lan2";
};
};
};
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미에 맞춰 전체 내용을 번역했습니다. 코드, 함수명, 코드 심벌, URL은 원문 표기를 유지합니다.
SMSC/Microchip LAN9303
1-15LAN9303은 3-port Ethernet switch입니다. `compatible`은 I2C managed mode의 `smsc,lan9303-i2c` 또는 MDIO managed mode의 `smsc,lan9303-mdio`입니다.
선택 `reset-gpios`는 장치 전체를 reset하는 GPIO이고 `reset-duration`은 millisecond 단위 reset 지속 시간이며 기본값은 200ms입니다.
DSA port 번호 규칙
16-24내장 switch subnode는 `dsa/dsa.txt`의 binding에 따라 기술하며 이 switch의 CPU port는 항상 port 0입니다.
Hardware가 1/2/3 구성을 사용하더라도 세 DSA port에는 항상 `reg = <0/1/2>;`를 사용해야 합니다. 드라이버가 hardware 구성을 자동 감지해 알맞게 매핑합니다.
Device Tree는 항상 논리 번호 0·1·2를 쓰고 실제 hardware 번호는 자동 매핑됩니다.
I2C managed mode 예제
25-63Master와 LAN9303은 100Mbps full-duplex RMII fixed link로 연결됩니다. I2C 주소 `0xa`의 switch는 active-low reset GPIO와 200ms reset을 사용하며 port 0은 master, port 1과 2는 `lan1`, `lan2`입니다.
master: masterdevice@X {
fixed-link { /* RMII fixed link to LAN9303 */
speed = <100>;
full-duplex;
};
};
switch: switch@a {
compatible = "smsc,lan9303-i2c";
reg = <0xa>;
reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
reset-duration = <200>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 { /* RMII fixed link to master */
reg = <0>;
ethernet = <&master>;
};
port@1 { /* external port 1 */
reg = <1>;
label = "lan1";
};
port@2 { /* external port 2 */
reg = <2>;
label = "lan2";
};
};
};
MDIO managed mode 예제
64-100MDIO mode에서는 master의 `phy-handle`이 MDIO 주소 0의 switch를 가리킵니다. Switch는 100ms reset을 사용하고 동일하게 port 0을 master, port 1과 2를 외부 LAN으로 배치합니다.
master: masterdevice@X {
phy-handle = <&switch>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
switch: switch-phy@0 {
compatible = "smsc,lan9303-mdio";
reg = <0>;
reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
reset-duration = <100>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
ethernet = <&master>;
};
port@1 { /* external port 1 */
reg = <1>;
label = "lan1";
};
port@2 { /* external port 2 */
reg = <2>;
label = "lan2";
};
};
};
};
};
요약과 해설
lan9303.txt:1-100CPU port 0과 두 외부 port를 I2C 또는 MDIO로 구성하는 두 예제를 비교합니다.