]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: dts: sophgo: add ethernet GMAC device for sg2042
authorInochi Amaoto <inochiama@gmail.com>
Tue, 8 Jul 2025 06:46:25 +0000 (14:46 +0800)
committerInochi Amaoto <inochiama@gmail.com>
Wed, 23 Jul 2025 01:55:15 +0000 (09:55 +0800)
Add ethernet GMAC device node for the sg2042.

Tested-by: Han Gao <rabenda.cn@gmail.com>
Link: https://lore.kernel.org/r/20250708064627.509363-1-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>
arch/riscv/boot/dts/sophgo/sg2042.dtsi

index 85636d1798f11804546ed8606595ace1b4cb2a2f..b3e4d3c18fdcf94c2294a56ed6ad866fc59a6adb 100644 (file)
                        status = "disabled";
                };
 
+               gmac0: ethernet@7040026000 {
+                       compatible = "sophgo,sg2042-dwmac", "snps,dwmac-5.00a";
+                       reg = <0x70 0x40026000 0x0 0x4000>;
+                       clocks = <&clkgen GATE_CLK_AXI_ETH0>,
+                                <&clkgen GATE_CLK_PTP_REF_I_ETH0>,
+                                <&clkgen GATE_CLK_TX_ETH0>;
+                       clock-names = "stmmaceth", "ptp_ref", "tx";
+                       dma-noncoherent;
+                       interrupt-parent = <&intc>;
+                       interrupts = <132 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "macirq";
+                       resets = <&rstgen RST_ETH0>;
+                       reset-names = "stmmaceth";
+                       snps,multicast-filter-bins = <0>;
+                       snps,perfect-filter-entries = <1>;
+                       snps,aal;
+                       snps,tso;
+                       snps,txpbl = <32>;
+                       snps,rxpbl = <32>;
+                       snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
+                       snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
+                       snps,axi-config = <&gmac0_stmmac_axi_setup>;
+                       status = "disabled";
+
+                       mdio {
+                               compatible = "snps,dwmac-mdio";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       gmac0_mtl_rx_setup: rx-queues-config {
+                               snps,rx-queues-to-use = <8>;
+                               queue0 {};
+                               queue1 {};
+                               queue2 {};
+                               queue3 {};
+                               queue4 {};
+                               queue5 {};
+                               queue6 {};
+                               queue7 {};
+                       };
+
+                       gmac0_mtl_tx_setup: tx-queues-config {
+                               snps,tx-queues-to-use = <8>;
+                               queue0 {};
+                               queue1 {};
+                               queue2 {};
+                               queue3 {};
+                               queue4 {};
+                               queue5 {};
+                               queue6 {};
+                               queue7 {};
+                       };
+
+                       gmac0_stmmac_axi_setup: stmmac-axi-config {
+                               snps,blen = <16 8 4 0 0 0 0>;
+                               snps,wr_osr_lmt = <1>;
+                               snps,rd_osr_lmt = <2>;
+                       };
+               };
+
                emmc: mmc@704002a000 {
                        compatible = "sophgo,sg2042-dwcmshc";
                        reg = <0x70 0x4002a000 0x0 0x1000>;