Skip to content

Commit 3744e0e

Browse files
committed
LoongArch: Update dts for Loongson-2K2000 to support GMAC/GNET
Current dts file for Loongson-2K2000's GMAC/GNET is incomplete, both irq and phy descriptions are missing. Add them to make GMAC/GNET work. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 84892ce commit 3744e0e

2 files changed

Lines changed: 42 additions & 3 deletions

File tree

arch/loongarch/boot/dts/loongson-2k2000-ref.dts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,45 @@
6161

6262
&gmac0 {
6363
status = "okay";
64+
65+
phy-mode = "gmii";
66+
phy-handle = <&phy0>;
67+
mdio {
68+
compatible = "snps,dwmac-mdio";
69+
#address-cells = <1>;
70+
#size-cells = <0>;
71+
phy0: ethernet-phy@0 {
72+
reg = <2>;
73+
};
74+
};
6475
};
6576

6677
&gmac1 {
6778
status = "okay";
79+
80+
phy-mode = "gmii";
81+
phy-handle = <&phy1>;
82+
mdio {
83+
compatible = "snps,dwmac-mdio";
84+
#address-cells = <1>;
85+
#size-cells = <0>;
86+
phy1: ethernet-phy@1 {
87+
reg = <2>;
88+
};
89+
};
6890
};
6991

7092
&gmac2 {
7193
status = "okay";
94+
95+
phy-mode = "rgmii";
96+
phy-handle = <&phy2>;
97+
mdio {
98+
compatible = "snps,dwmac-mdio";
99+
#address-cells = <1>;
100+
#size-cells = <0>;
101+
phy2: ethernet-phy@2 {
102+
reg = <0>;
103+
};
104+
};
72105
};

arch/loongarch/boot/dts/loongson-2k2000.dtsi

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,21 +156,27 @@
156156

157157
gmac0: ethernet@3,0 {
158158
reg = <0x1800 0x0 0x0 0x0 0x0>;
159-
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>;
159+
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
160+
<13 IRQ_TYPE_LEVEL_HIGH>;
161+
interrupt-names = "macirq", "eth_lpi";
160162
interrupt-parent = <&pic>;
161163
status = "disabled";
162164
};
163165

164166
gmac1: ethernet@3,1 {
165167
reg = <0x1900 0x0 0x0 0x0 0x0>;
166-
interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
168+
interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
169+
<15 IRQ_TYPE_LEVEL_HIGH>;
170+
interrupt-names = "macirq", "eth_lpi";
167171
interrupt-parent = <&pic>;
168172
status = "disabled";
169173
};
170174

171175
gmac2: ethernet@3,2 {
172176
reg = <0x1a00 0x0 0x0 0x0 0x0>;
173-
interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
177+
interrupts = <17 IRQ_TYPE_LEVEL_HIGH>,
178+
<18 IRQ_TYPE_LEVEL_HIGH>;
179+
interrupt-names = "macirq", "eth_lpi";
174180
interrupt-parent = <&pic>;
175181
status = "disabled";
176182
};

0 commit comments

Comments
 (0)