Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/net/snps,dwmac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ select:
- snps,dwmac-4.00
- snps,dwmac-4.10a
- snps,dwmac-4.20a
- snps,dwmac-5.00a
- snps,dwmac-5.10a
- snps,dwmac-5.20
- snps,dwmac-5.30a
Expand Down Expand Up @@ -97,11 +98,13 @@ properties:
- snps,dwmac-4.00
- snps,dwmac-4.10a
- snps,dwmac-4.20a
- snps,dwmac-5.00a
- snps,dwmac-5.10a
- snps,dwmac-5.20
- snps,dwmac-5.30a
- snps,dwxgmac
- snps,dwxgmac-2.10
- sophgo,sg2042-dwmac
- sophgo,sg2044-dwmac
- starfive,jh7100-dwmac
- starfive,jh7110-dwmac
Expand Down Expand Up @@ -634,6 +637,7 @@ allOf:
- snps,dwmac-4.00
- snps,dwmac-4.10a
- snps,dwmac-4.20a
- snps,dwmac-5.00a
- snps,dwmac-5.10a
- snps,dwmac-5.20
- snps,dwmac-5.30a
Expand Down
11 changes: 8 additions & 3 deletions Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ select:
contains:
enum:
- sophgo,sg2044-dwmac
- sophgo,sg2042-dwmac
required:
- compatible

properties:
compatible:
items:
- const: sophgo,sg2044-dwmac
- const: snps,dwmac-5.30a
oneOf:
- items:
- const: sophgo,sg2042-dwmac
- const: snps,dwmac-5.00a
- items:
- const: sophgo,sg2044-dwmac
- const: snps,dwmac-5.30a

reg:
maxItems: 1
Expand Down
62 changes: 62 additions & 0 deletions arch/riscv/boot/dts/sophgo/sg2042.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,68 @@
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>;
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@704002a000 {
compatible = "sophgo,sg2042-dwcmshc";
reg = <0x70 0x4002a000 0x0 0x1000>;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ static int sophgo_dwmac_probe(struct platform_device *pdev)
}

static const struct of_device_id sophgo_dwmac_match[] = {
{ .compatible = "sophgo,sg2042-dwmac" },
{ .compatible = "sophgo,sg2044-dwmac" },
{ /* sentinel */ }
};
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ static const char * const stmmac_gmac4_compats[] = {
"snps,dwmac-4.00",
"snps,dwmac-4.10a",
"snps,dwmac-4.20a",
"snps,dwmac-5.00a",
"snps,dwmac-5.10a",
"snps,dwmac-5.20",
"snps,dwmac-5.30a",
Expand Down