Skip to content

Commit 2c7ef3d

Browse files
committed
riscv: dts: sophgo: sg2044: Add ethernet control device
Add ethernet control node for sg2044. Link: https://lore.kernel.org/r/20250608232836.784737-9-inochiama@gmail.com Signed-off-by: Inochi Amaoto <inochiama@gmail.com> Signed-off-by: Chen Wang <unicorn_wang@outlook.com> Signed-off-by: Chen Wang <wangchen20@iscas.ac.cn>
1 parent 2b09dad commit 2c7ef3d

2 files changed

Lines changed: 79 additions & 0 deletions

File tree

arch/riscv/boot/dts/sophgo/sg2044-sophgo-srd3-10.dts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@
3636
status = "okay";
3737
};
3838

39+
&gmac0 {
40+
phy-handle = <&phy0>;
41+
phy-mode = "rgmii-id";
42+
status = "okay";
43+
44+
mdio {
45+
phy0: phy@0 {
46+
compatible = "ethernet-phy-ieee802.3-c22";
47+
reg = <0>;
48+
reset-gpios = <&porta 28 GPIO_ACTIVE_LOW>;
49+
reset-assert-us = <10000>;
50+
reset-deassert-us = <10000>;
51+
rx-internal-delay-ps = <2050>;
52+
};
53+
};
54+
};
55+
3956
&i2c1 {
4057
status = "okay";
4158

arch/riscv/boot/dts/sophgo/sg2044.dtsi

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,68 @@
111111
status = "disabled";
112112
};
113113

114+
gmac0: ethernet@7030006000 {
115+
compatible = "sophgo,sg2044-dwmac", "snps,dwmac-5.30a";
116+
reg = <0x70 0x30006000 0x0 0x4000>;
117+
clocks = <&clk CLK_GATE_AXI_ETH0>,
118+
<&clk CLK_GATE_PTP_REF_I_ETH0>,
119+
<&clk CLK_GATE_TX_ETH0>;
120+
clock-names = "stmmaceth", "ptp_ref", "tx";
121+
dma-noncoherent;
122+
interrupt-parent = <&intc>;
123+
interrupts = <296 IRQ_TYPE_LEVEL_HIGH>;
124+
interrupt-names = "macirq";
125+
resets = <&rst RST_ETH0>;
126+
reset-names = "stmmaceth";
127+
snps,multicast-filter-bins = <0>;
128+
snps,perfect-filter-entries = <1>;
129+
snps,aal;
130+
snps,tso;
131+
snps,txpbl = <32>;
132+
snps,rxpbl = <32>;
133+
snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
134+
snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
135+
snps,axi-config = <&gmac0_stmmac_axi_setup>;
136+
status = "disabled";
137+
138+
mdio {
139+
compatible = "snps,dwmac-mdio";
140+
#address-cells = <1>;
141+
#size-cells = <0>;
142+
};
143+
144+
gmac0_mtl_rx_setup: rx-queues-config {
145+
snps,rx-queues-to-use = <8>;
146+
snps,rx-sched-wsp;
147+
queue0 {};
148+
queue1 {};
149+
queue2 {};
150+
queue3 {};
151+
queue4 {};
152+
queue5 {};
153+
queue6 {};
154+
queue7 {};
155+
};
156+
157+
gmac0_mtl_tx_setup: tx-queues-config {
158+
snps,tx-queues-to-use = <8>;
159+
queue0 {};
160+
queue1 {};
161+
queue2 {};
162+
queue3 {};
163+
queue4 {};
164+
queue5 {};
165+
queue6 {};
166+
queue7 {};
167+
};
168+
169+
gmac0_stmmac_axi_setup: stmmac-axi-config {
170+
snps,blen = <16 8 4 0 0 0 0>;
171+
snps,wr_osr_lmt = <1>;
172+
snps,rd_osr_lmt = <2>;
173+
};
174+
};
175+
114176
emmc: mmc@703000a000 {
115177
compatible = "sophgo,sg2044-dwcmshc", "sophgo,sg2042-dwcmshc";
116178
reg = <0x70 0x3000a000 0x0 0x1000>;

0 commit comments

Comments
 (0)