* [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042
@ 2025-05-06 9:32 Inochi Amaoto
2025-05-06 9:32 ` [PATCH net-next 1/4] dt-bindings: net: sophgo,sg2044-dwmac: Add support for Sophgo SG2042 dwmac Inochi Amaoto
` (4 more replies)
0 siblings, 5 replies; 13+ messages in thread
From: Inochi Amaoto @ 2025-05-06 9:32 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Inochi Amaoto, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu
Cc: netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li
The ethernet controller of SG2042 is Synopsys DesignWare IP with
tx clock. Add device id for it.
This patch can only be tested on a SG2042 x4 evb board, as pioneer
does not expose this device.
Inochi Amaoto (4):
dt-bindings: net: sophgo,sg2044-dwmac: Add support for Sophgo SG2042
dwmac
net: stmmac: dwmac-sophgo: Add support for Sophgo SG2042 SoC
net: stmmac: platform: Add snps,dwmac-5.00a IP compatible string
riscv: dts: sophgo: add ethernet GMAC device for sg2042
.../devicetree/bindings/net/snps,dwmac.yaml | 4 ++
.../bindings/net/sophgo,sg2044-dwmac.yaml | 11 +++-
arch/riscv/boot/dts/sophgo/sg2042.dtsi | 62 +++++++++++++++++++
.../ethernet/stmicro/stmmac/dwmac-sophgo.c | 1 +
.../ethernet/stmicro/stmmac/stmmac_platform.c | 1 +
5 files changed, 76 insertions(+), 3 deletions(-)
--
2.49.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH net-next 1/4] dt-bindings: net: sophgo,sg2044-dwmac: Add support for Sophgo SG2042 dwmac
2025-05-06 9:32 [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Inochi Amaoto
@ 2025-05-06 9:32 ` Inochi Amaoto
2025-05-06 16:09 ` Conor Dooley
2025-05-06 9:32 ` [PATCH net-next 2/4] net: stmmac: dwmac-sophgo: Add support for Sophgo SG2042 SoC Inochi Amaoto
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Inochi Amaoto @ 2025-05-06 9:32 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Inochi Amaoto, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu
Cc: netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li, Han Gao
The GMAC IP on SG2042 is a standard Synopsys DesignWare MAC
(version 5.00a) with tx clock.
Add necessary compatible string for this device.
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Tested-by: Han Gao <rabenda.cn@gmail.com>
---
Documentation/devicetree/bindings/net/snps,dwmac.yaml | 4 ++++
.../devicetree/bindings/net/sophgo,sg2044-dwmac.yaml | 11 ++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 78b3030dc56d..f16b49da6dbf 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -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
@@ -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
@@ -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
diff --git a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
index 4dd2dc9c678b..112b0b2a1524 100644
--- a/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/sophgo,sg2044-dwmac.yaml
@@ -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
--
2.49.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 2/4] net: stmmac: dwmac-sophgo: Add support for Sophgo SG2042 SoC
2025-05-06 9:32 [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Inochi Amaoto
2025-05-06 9:32 ` [PATCH net-next 1/4] dt-bindings: net: sophgo,sg2044-dwmac: Add support for Sophgo SG2042 dwmac Inochi Amaoto
@ 2025-05-06 9:32 ` Inochi Amaoto
2025-05-06 9:32 ` [PATCH net-next 3/4] net: stmmac: platform: Add snps,dwmac-5.00a IP compatible string Inochi Amaoto
` (2 subsequent siblings)
4 siblings, 0 replies; 13+ messages in thread
From: Inochi Amaoto @ 2025-05-06 9:32 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Inochi Amaoto, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu
Cc: netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li, Han Gao
Adds device id of the ethernet controller on the Sophgo SG2042 SoC.
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Tested-by: Han Gao <rabenda.cn@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
index 3303784cbbf8..3b7947a7a7ba 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
@@ -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 */ }
};
--
2.49.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 3/4] net: stmmac: platform: Add snps,dwmac-5.00a IP compatible string
2025-05-06 9:32 [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Inochi Amaoto
2025-05-06 9:32 ` [PATCH net-next 1/4] dt-bindings: net: sophgo,sg2044-dwmac: Add support for Sophgo SG2042 dwmac Inochi Amaoto
2025-05-06 9:32 ` [PATCH net-next 2/4] net: stmmac: dwmac-sophgo: Add support for Sophgo SG2042 SoC Inochi Amaoto
@ 2025-05-06 9:32 ` Inochi Amaoto
2025-05-06 9:32 ` [PATCH net-next 4/4] riscv: dts: sophgo: add ethernet GMAC device for sg2042 Inochi Amaoto
2025-05-06 12:03 ` [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Andrew Lunn
4 siblings, 0 replies; 13+ messages in thread
From: Inochi Amaoto @ 2025-05-06 9:32 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Inochi Amaoto, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu
Cc: netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li, Han Gao
Add "snps,dwmac-5.30a" compatible string for 5.00a version that
can avoid to define some platform data in the glue layer.
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Tested-by: Han Gao <rabenda.cn@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index c73eff6a56b8..de3098a773ba 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -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",
--
2.49.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH net-next 4/4] riscv: dts: sophgo: add ethernet GMAC device for sg2042
2025-05-06 9:32 [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Inochi Amaoto
` (2 preceding siblings ...)
2025-05-06 9:32 ` [PATCH net-next 3/4] net: stmmac: platform: Add snps,dwmac-5.00a IP compatible string Inochi Amaoto
@ 2025-05-06 9:32 ` Inochi Amaoto
2025-05-07 1:47 ` Chen Wang
2025-05-06 12:03 ` [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Andrew Lunn
4 siblings, 1 reply; 13+ messages in thread
From: Inochi Amaoto @ 2025-05-06 9:32 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Inochi Amaoto, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu
Cc: netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li, Han Gao
Add ethernet GMAC device node for the sg2042.
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
Tested-by: Han Gao <rabenda.cn@gmail.com>
---
arch/riscv/boot/dts/sophgo/sg2042.dtsi | 62 ++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/arch/riscv/boot/dts/sophgo/sg2042.dtsi b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
index f61de4788475..886c13cef6ba 100644
--- a/arch/riscv/boot/dts/sophgo/sg2042.dtsi
+++ b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
@@ -543,6 +543,68 @@ uart0: serial@7040000000 {
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>;
--
2.49.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042
2025-05-06 9:32 [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Inochi Amaoto
` (3 preceding siblings ...)
2025-05-06 9:32 ` [PATCH net-next 4/4] riscv: dts: sophgo: add ethernet GMAC device for sg2042 Inochi Amaoto
@ 2025-05-06 12:03 ` Andrew Lunn
2025-05-06 22:24 ` Inochi Amaoto
4 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2025-05-06 12:03 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu, netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li
On Tue, May 06, 2025 at 05:32:50PM +0800, Inochi Amaoto wrote:
> The ethernet controller of SG2042 is Synopsys DesignWare IP with
> tx clock. Add device id for it.
>
> This patch can only be tested on a SG2042 x4 evb board, as pioneer
> does not expose this device.
Do you have a patch for this EVB board? Ideally there should be a user
added at the same time as support for a device.
Andrew
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 1/4] dt-bindings: net: sophgo,sg2044-dwmac: Add support for Sophgo SG2042 dwmac
2025-05-06 9:32 ` [PATCH net-next 1/4] dt-bindings: net: sophgo,sg2044-dwmac: Add support for Sophgo SG2042 dwmac Inochi Amaoto
@ 2025-05-06 16:09 ` Conor Dooley
0 siblings, 0 replies; 13+ messages in thread
From: Conor Dooley @ 2025-05-06 16:09 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu, netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li, Han Gao
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
On Tue, May 06, 2025 at 05:32:51PM +0800, Inochi Amaoto wrote:
> The GMAC IP on SG2042 is a standard Synopsys DesignWare MAC
> (version 5.00a) with tx clock.
>
> Add necessary compatible string for this device.
>
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> Tested-by: Han Gao <rabenda.cn@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042
2025-05-06 12:03 ` [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Andrew Lunn
@ 2025-05-06 22:24 ` Inochi Amaoto
2025-05-07 0:10 ` Andrew Lunn
0 siblings, 1 reply; 13+ messages in thread
From: Inochi Amaoto @ 2025-05-06 22:24 UTC (permalink / raw)
To: Andrew Lunn, Inochi Amaoto
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu, netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li
On Tue, May 06, 2025 at 02:03:18PM +0200, Andrew Lunn wrote:
> On Tue, May 06, 2025 at 05:32:50PM +0800, Inochi Amaoto wrote:
> > The ethernet controller of SG2042 is Synopsys DesignWare IP with
> > tx clock. Add device id for it.
> >
> > This patch can only be tested on a SG2042 x4 evb board, as pioneer
> > does not expose this device.
>
> Do you have a patch for this EVB board? Ideally there should be a user
> added at the same time as support for a device.
>
> Andrew
Yes, I have one for this device. And Han Gao told me that he will send
the board patch for the evb board. So I only send the driver.
And the fragment for the evb board is likes below, I think it is kind
of trivial:
&gmac0 {
phy-handle = <&phy0>;
phy-mode = "rgmii-txid";
status = "okay";
mdio {
phy0: phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
reset-gpios = <&port0a 27 GPIO_ACTIVE_LOW>;
reset-assert-us = <100000>;
reset-deassert-us = <100000>;
};
};
};
Regards,
Inochi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042
2025-05-06 22:24 ` Inochi Amaoto
@ 2025-05-07 0:10 ` Andrew Lunn
2025-05-07 12:01 ` Inochi Amaoto
0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2025-05-07 0:10 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu, netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li
On Wed, May 07, 2025 at 06:24:29AM +0800, Inochi Amaoto wrote:
> On Tue, May 06, 2025 at 02:03:18PM +0200, Andrew Lunn wrote:
> > On Tue, May 06, 2025 at 05:32:50PM +0800, Inochi Amaoto wrote:
> > > The ethernet controller of SG2042 is Synopsys DesignWare IP with
> > > tx clock. Add device id for it.
> > >
> > > This patch can only be tested on a SG2042 x4 evb board, as pioneer
> > > does not expose this device.
> >
> > Do you have a patch for this EVB board? Ideally there should be a user
> > added at the same time as support for a device.
> >
> > Andrew
>
> Yes, I have one for this device. And Han Gao told me that he will send
> the board patch for the evb board. So I only send the driver.
> And the fragment for the evb board is likes below, I think it is kind
> of trivial:
>
> &gmac0 {
> phy-handle = <&phy0>;
> phy-mode = "rgmii-txid";
And this is why i ask, because this is broken. For more information,
please see:
https://patchwork.kernel.org/project/netdevbpf/patch/20250430-v6-15-rc3-net-rgmii-delays-v2-1-099ae651d5e5@lunn.ch/
Andrew
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 4/4] riscv: dts: sophgo: add ethernet GMAC device for sg2042
2025-05-06 9:32 ` [PATCH net-next 4/4] riscv: dts: sophgo: add ethernet GMAC device for sg2042 Inochi Amaoto
@ 2025-05-07 1:47 ` Chen Wang
0 siblings, 0 replies; 13+ messages in thread
From: Chen Wang @ 2025-05-07 1:47 UTC (permalink / raw)
To: Inochi Amaoto, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu
Cc: netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li, Han Gao
On 2025/5/6 17:32, Inochi Amaoto wrote:
> Add ethernet GMAC device node for the sg2042.
>
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> Tested-by: Han Gao <rabenda.cn@gmail.com>
> ---
> arch/riscv/boot/dts/sophgo/sg2042.dtsi | 62 ++++++++++++++++++++++++++
> 1 file changed, 62 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/sophgo/sg2042.dtsi b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> index f61de4788475..886c13cef6ba 100644
> --- a/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> +++ b/arch/riscv/boot/dts/sophgo/sg2042.dtsi
> @@ -543,6 +543,68 @@ uart0: serial@7040000000 {
> 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>;
> + };
> + };
> +
LGTM.
Reviewed-by: Chen Wang <unicorn_wang@outlook.com>
Thanks,
Chen
> emmc: mmc@704002a000 {
> compatible = "sophgo,sg2042-dwcmshc";
> reg = <0x70 0x4002a000 0x0 0x1000>;
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042
2025-05-07 0:10 ` Andrew Lunn
@ 2025-05-07 12:01 ` Inochi Amaoto
2025-05-07 12:37 ` Andrew Lunn
0 siblings, 1 reply; 13+ messages in thread
From: Inochi Amaoto @ 2025-05-07 12:01 UTC (permalink / raw)
To: Andrew Lunn, Inochi Amaoto
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu, netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li
On Wed, May 07, 2025 at 02:10:48AM +0200, Andrew Lunn wrote:
> On Wed, May 07, 2025 at 06:24:29AM +0800, Inochi Amaoto wrote:
> > On Tue, May 06, 2025 at 02:03:18PM +0200, Andrew Lunn wrote:
> > > On Tue, May 06, 2025 at 05:32:50PM +0800, Inochi Amaoto wrote:
> > > > The ethernet controller of SG2042 is Synopsys DesignWare IP with
> > > > tx clock. Add device id for it.
> > > >
> > > > This patch can only be tested on a SG2042 x4 evb board, as pioneer
> > > > does not expose this device.
> > >
> > > Do you have a patch for this EVB board? Ideally there should be a user
> > > added at the same time as support for a device.
> > >
> > > Andrew
> >
> > Yes, I have one for this device. And Han Gao told me that he will send
> > the board patch for the evb board. So I only send the driver.
> > And the fragment for the evb board is likes below, I think it is kind
> > of trivial:
> >
> > &gmac0 {
> > phy-handle = <&phy0>;
> > phy-mode = "rgmii-txid";
>
> And this is why i ask, because this is broken. For more information,
> please see:
>
> https://patchwork.kernel.org/project/netdevbpf/patch/20250430-v6-15-rc3-net-rgmii-delays-v2-1-099ae651d5e5@lunn.ch/
>
> Andrew
You are right, the right phy-mode is "rgmii-id", the delay is not
added by the PCB. It seems to be better to ask for the vendor about
the hardware design before copying params for vendor dts. Anyway,
thanks for reviewing this.
Regards,
Inochi
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042
2025-05-07 12:01 ` Inochi Amaoto
@ 2025-05-07 12:37 ` Andrew Lunn
2025-05-07 12:45 ` Inochi Amaoto
0 siblings, 1 reply; 13+ messages in thread
From: Andrew Lunn @ 2025-05-07 12:37 UTC (permalink / raw)
To: Inochi Amaoto
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu, netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li
On Wed, May 07, 2025 at 08:01:29PM +0800, Inochi Amaoto wrote:
> On Wed, May 07, 2025 at 02:10:48AM +0200, Andrew Lunn wrote:
> > On Wed, May 07, 2025 at 06:24:29AM +0800, Inochi Amaoto wrote:
> > > On Tue, May 06, 2025 at 02:03:18PM +0200, Andrew Lunn wrote:
> > > > On Tue, May 06, 2025 at 05:32:50PM +0800, Inochi Amaoto wrote:
> > > > > The ethernet controller of SG2042 is Synopsys DesignWare IP with
> > > > > tx clock. Add device id for it.
> > > > >
> > > > > This patch can only be tested on a SG2042 x4 evb board, as pioneer
> > > > > does not expose this device.
> > > >
> > > > Do you have a patch for this EVB board? Ideally there should be a user
> > > > added at the same time as support for a device.
> > > >
> > > > Andrew
> > >
> > > Yes, I have one for this device. And Han Gao told me that he will send
> > > the board patch for the evb board. So I only send the driver.
> > > And the fragment for the evb board is likes below, I think it is kind
> > > of trivial:
> > >
> > > &gmac0 {
> > > phy-handle = <&phy0>;
> > > phy-mode = "rgmii-txid";
> >
> > And this is why i ask, because this is broken. For more information,
> > please see:
> >
> > https://patchwork.kernel.org/project/netdevbpf/patch/20250430-v6-15-rc3-net-rgmii-delays-v2-1-099ae651d5e5@lunn.ch/
> >
> > Andrew
>
> You are right, the right phy-mode is "rgmii-id", the delay is not
> added by the PCB. It seems to be better to ask for the vendor about
> the hardware design before copying params for vendor dts. Anyway,
> thanks for reviewing this.
Please do figure this out. Since you are adding a new compatible, you
have a bit more flexibility. If the MAC driver is doing something
wrong, you can change its behaviour based on this new compatible
without breaking other users of the driver using other compatibles.
Andrew
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042
2025-05-07 12:37 ` Andrew Lunn
@ 2025-05-07 12:45 ` Inochi Amaoto
0 siblings, 0 replies; 13+ messages in thread
From: Inochi Amaoto @ 2025-05-07 12:45 UTC (permalink / raw)
To: Andrew Lunn, Inochi Amaoto
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chen Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Guo Ren, Thomas Gleixner, Uwe Kleine-König,
Russell King (Oracle), Romain Gantois, Joe Hattori,
Lothar Rubusch, Bartosz Golaszewski, Giuseppe Cavallaro,
Jose Abreu, netdev, devicetree, linux-kernel, sophgo, linux-riscv,
linux-stm32, linux-arm-kernel, Yixun Lan, Longbin Li
On Wed, May 07, 2025 at 02:37:15PM +0200, Andrew Lunn wrote:
> On Wed, May 07, 2025 at 08:01:29PM +0800, Inochi Amaoto wrote:
> > On Wed, May 07, 2025 at 02:10:48AM +0200, Andrew Lunn wrote:
> > > On Wed, May 07, 2025 at 06:24:29AM +0800, Inochi Amaoto wrote:
> > > > On Tue, May 06, 2025 at 02:03:18PM +0200, Andrew Lunn wrote:
> > > > > On Tue, May 06, 2025 at 05:32:50PM +0800, Inochi Amaoto wrote:
> > > > > > The ethernet controller of SG2042 is Synopsys DesignWare IP with
> > > > > > tx clock. Add device id for it.
> > > > > >
> > > > > > This patch can only be tested on a SG2042 x4 evb board, as pioneer
> > > > > > does not expose this device.
> > > > >
> > > > > Do you have a patch for this EVB board? Ideally there should be a user
> > > > > added at the same time as support for a device.
> > > > >
> > > > > Andrew
> > > >
> > > > Yes, I have one for this device. And Han Gao told me that he will send
> > > > the board patch for the evb board. So I only send the driver.
> > > > And the fragment for the evb board is likes below, I think it is kind
> > > > of trivial:
> > > >
> > > > &gmac0 {
> > > > phy-handle = <&phy0>;
> > > > phy-mode = "rgmii-txid";
> > >
> > > And this is why i ask, because this is broken. For more information,
> > > please see:
> > >
> > > https://patchwork.kernel.org/project/netdevbpf/patch/20250430-v6-15-rc3-net-rgmii-delays-v2-1-099ae651d5e5@lunn.ch/
> > >
> > > Andrew
> >
> > You are right, the right phy-mode is "rgmii-id", the delay is not
> > added by the PCB. It seems to be better to ask for the vendor about
> > the hardware design before copying params for vendor dts. Anyway,
> > thanks for reviewing this.
>
> Please do figure this out. Since you are adding a new compatible, you
> have a bit more flexibility. If the MAC driver is doing something
> wrong, you can change its behaviour based on this new compatible
> without breaking other users of the driver using other compatibles.
>
Thanks, I will check it out. And adapt the driver if needed.
Regards,
Inochi
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-05-07 12:50 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-06 9:32 [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Inochi Amaoto
2025-05-06 9:32 ` [PATCH net-next 1/4] dt-bindings: net: sophgo,sg2044-dwmac: Add support for Sophgo SG2042 dwmac Inochi Amaoto
2025-05-06 16:09 ` Conor Dooley
2025-05-06 9:32 ` [PATCH net-next 2/4] net: stmmac: dwmac-sophgo: Add support for Sophgo SG2042 SoC Inochi Amaoto
2025-05-06 9:32 ` [PATCH net-next 3/4] net: stmmac: platform: Add snps,dwmac-5.00a IP compatible string Inochi Amaoto
2025-05-06 9:32 ` [PATCH net-next 4/4] riscv: dts: sophgo: add ethernet GMAC device for sg2042 Inochi Amaoto
2025-05-07 1:47 ` Chen Wang
2025-05-06 12:03 ` [PATCH net-next 0/4] riscv: sophgo: Add ethernet support for SG2042 Andrew Lunn
2025-05-06 22:24 ` Inochi Amaoto
2025-05-07 0:10 ` Andrew Lunn
2025-05-07 12:01 ` Inochi Amaoto
2025-05-07 12:37 ` Andrew Lunn
2025-05-07 12:45 ` Inochi Amaoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox