]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: dts: sophgo: sg2044: Add ethernet control device
authorInochi Amaoto <inochiama@gmail.com>
Sun, 8 Jun 2025 23:28:32 +0000 (07:28 +0800)
committerInochi Amaoto <inochiama@gmail.com>
Wed, 23 Jul 2025 01:55:14 +0000 (09:55 +0800)
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>
arch/riscv/boot/dts/sophgo/sg2044-sophgo-srd3-10.dts
arch/riscv/boot/dts/sophgo/sg2044.dtsi

index 75564b2719cd8fbb67810e1b34b57c645b92cd5b..01340f21848f497ae70277d0f1b4c33f95352a6e 100644 (file)
        status = "okay";
 };
 
+&gmac0 {
+       phy-handle = <&phy0>;
+       phy-mode = "rgmii-id";
+       status = "okay";
+
+       mdio {
+               phy0: phy@0 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       reg = <0>;
+                       reset-gpios = <&porta 28 GPIO_ACTIVE_LOW>;
+                       reset-assert-us = <10000>;
+                       reset-deassert-us = <10000>;
+                       rx-internal-delay-ps = <2050>;
+               };
+       };
+};
+
 &i2c1 {
        status = "okay";
 
index 6067901cde1e0992ba9a3987bde643b62a8bbe22..bbf4191fb87dcfbb9cbeb7a9c75e0f8d447ba0fe 100644 (file)
                        status = "disabled";
                };
 
+               gmac0: ethernet@7030006000 {
+                       compatible = "sophgo,sg2044-dwmac", "snps,dwmac-5.30a";
+                       reg = <0x70 0x30006000 0x0 0x4000>;
+                       clocks = <&clk CLK_GATE_AXI_ETH0>,
+                                <&clk CLK_GATE_PTP_REF_I_ETH0>,
+                                <&clk CLK_GATE_TX_ETH0>;
+                       clock-names = "stmmaceth", "ptp_ref", "tx";
+                       dma-noncoherent;
+                       interrupt-parent = <&intc>;
+                       interrupts = <296 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "macirq";
+                       resets = <&rst 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>;
+                               snps,rx-sched-wsp;
+                               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@703000a000 {
                        compatible = "sophgo,sg2044-dwcmshc", "sophgo,sg2042-dwcmshc";
                        reg = <0x70 0x3000a000 0x0 0x1000>;