All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
@ 2023-01-18  6:16 ` Yanhong Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
For more information and support, you can visit RVspace wiki[1].
	
This patchset should be applied after the patchset [2], [3], [4].
[1] https://wiki.rvspace.org/
[2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
[3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
[4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/

Changes in v4:
- Reworded the maxitems number of resets property in 'snps,dwmac.yaml'
- Removed the unused code in 'dwmac-starfive-plat.c'.
- Reworded the return statement in 'starfive_eth_plat_fix_mac_speed' function.

Previous versions:
v1 - https://patchwork.kernel.org/project/linux-riscv/cover/20221201090242.2381-1-yanhong.wang@starfivetech.com/
v2 - https://patchwork.kernel.org/project/linux-riscv/cover/20221216070632.11444-1-yanhong.wang@starfivetech.com/
v3 - https://patchwork.kernel.org/project/linux-riscv/cover/20230106030001.1952-1-yanhong.wang@starfivetech.com/

Emil Renner Berthing (2):
  dt-bindings: net: snps,dwmac: Add dwmac-5.20 version
  net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string

Yanhong Wang (5):
  dt-bindings: net: snps,dwmac: Update the maxitems number of resets and
    reset-names
  dt-bindings: net: Add support StarFive dwmac
  net: stmmac: Add glue layer for StarFive JH7110 SoCs
  riscv: dts: starfive: jh7110: Add ethernet device node
  riscv: dts: starfive: visionfive-v2: Enable gmac device tree node

 .../devicetree/bindings/net/snps,dwmac.yaml   |  14 ++-
 .../bindings/net/starfive,jh7110-dwmac.yaml   | 113 +++++++++++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-v2.dts         |  10 ++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  93 ++++++++++++++
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
 .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
 .../ethernet/stmicro/stmmac/stmmac_platform.c |   3 +-
 9 files changed, 363 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c


base-commit: 094226ad94f471a9f19e8f8e7140a09c2625abaa
prerequisite-patch-id: 8ebfffa09b478904bf7c516f76e2d824ddb60140
prerequisite-patch-id: e8dd8258a4c4062eee2cf07c4607d52baea71f3a
prerequisite-patch-id: d050d884d7b091ff30508a70f5ce5164bb3b72e5
prerequisite-patch-id: 0e41f8cfd4861fcbf6f2e6a2559ce28f0450299e
prerequisite-patch-id: 6e1652501859b85f101ff3b15ced585d43c71c1b
prerequisite-patch-id: 587628a67adad5c655e5f998bf6c4a368ec07d3c
prerequisite-patch-id: 596490c0e397df6c0249c1306fbb1d5bf00b5b83
prerequisite-patch-id: dc873317826b50364344b25ac5cd74e811403f3d
prerequisite-patch-id: a50150f41d8e874553023187e22eb24dffae8d16
prerequisite-patch-id: 735e62255c75801bdc4c0b4107850bce821ff7f5
prerequisite-patch-id: 9d2e83a2dd43e193f534283fab73e90b4f435043
prerequisite-patch-id: 7a43e0849a9afa3c6f83547fd16d9271b07619e5
prerequisite-patch-id: e7aa6fb05314bad6d94c465f3f59969871bf3d2e
prerequisite-patch-id: 6276b2a23818c65ff2ad3d65b562615690cffee9
prerequisite-patch-id: d834ece14ffb525b8c3e661e78736692f33fca9b
prerequisite-patch-id: 4c17a3ce4dae9b788795d915bf775630f5c43c53
prerequisite-patch-id: dabb913fd478e97593e45c23fee4be9fd807f851
prerequisite-patch-id: ba61df106fbe2ada21e8f22c3d2cfaf7809c84b6
prerequisite-patch-id: 287572fb64f83f5d931034f7c75674907584a087
prerequisite-patch-id: 536114f0732646095ef5302a165672b3290d4c75
prerequisite-patch-id: 258ea5f9b8bf41b6981345dcc81795f25865d38f
prerequisite-patch-id: 8b6f2c9660c0ac0ee4e73e4c21aca8e6b75e81b9
prerequisite-patch-id: e09e995700a814a763aa304ad3881a7222acf556
prerequisite-patch-id: 841cd71b556b480d6a5a5e332eeca70d6a76ec3f
prerequisite-patch-id: d074c7ffa2917a9f754d5801e3f67bc980f9de4c
prerequisite-patch-id: 5f59bc7cbbf1230e5ff4761fa7c1116d4e6e5d71
prerequisite-patch-id: d5da3475c6a3588e11a1678feb565bdd459b548e
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
@ 2023-01-18  6:16 ` Yanhong Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
For more information and support, you can visit RVspace wiki[1].
	
This patchset should be applied after the patchset [2], [3], [4].
[1] https://wiki.rvspace.org/
[2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
[3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
[4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/

Changes in v4:
- Reworded the maxitems number of resets property in 'snps,dwmac.yaml'
- Removed the unused code in 'dwmac-starfive-plat.c'.
- Reworded the return statement in 'starfive_eth_plat_fix_mac_speed' function.

Previous versions:
v1 - https://patchwork.kernel.org/project/linux-riscv/cover/20221201090242.2381-1-yanhong.wang@starfivetech.com/
v2 - https://patchwork.kernel.org/project/linux-riscv/cover/20221216070632.11444-1-yanhong.wang@starfivetech.com/
v3 - https://patchwork.kernel.org/project/linux-riscv/cover/20230106030001.1952-1-yanhong.wang@starfivetech.com/

Emil Renner Berthing (2):
  dt-bindings: net: snps,dwmac: Add dwmac-5.20 version
  net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string

Yanhong Wang (5):
  dt-bindings: net: snps,dwmac: Update the maxitems number of resets and
    reset-names
  dt-bindings: net: Add support StarFive dwmac
  net: stmmac: Add glue layer for StarFive JH7110 SoCs
  riscv: dts: starfive: jh7110: Add ethernet device node
  riscv: dts: starfive: visionfive-v2: Enable gmac device tree node

 .../devicetree/bindings/net/snps,dwmac.yaml   |  14 ++-
 .../bindings/net/starfive,jh7110-dwmac.yaml   | 113 +++++++++++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-v2.dts         |  10 ++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  93 ++++++++++++++
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
 .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
 .../ethernet/stmicro/stmmac/stmmac_platform.c |   3 +-
 9 files changed, 363 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c


base-commit: 094226ad94f471a9f19e8f8e7140a09c2625abaa
prerequisite-patch-id: 8ebfffa09b478904bf7c516f76e2d824ddb60140
prerequisite-patch-id: e8dd8258a4c4062eee2cf07c4607d52baea71f3a
prerequisite-patch-id: d050d884d7b091ff30508a70f5ce5164bb3b72e5
prerequisite-patch-id: 0e41f8cfd4861fcbf6f2e6a2559ce28f0450299e
prerequisite-patch-id: 6e1652501859b85f101ff3b15ced585d43c71c1b
prerequisite-patch-id: 587628a67adad5c655e5f998bf6c4a368ec07d3c
prerequisite-patch-id: 596490c0e397df6c0249c1306fbb1d5bf00b5b83
prerequisite-patch-id: dc873317826b50364344b25ac5cd74e811403f3d
prerequisite-patch-id: a50150f41d8e874553023187e22eb24dffae8d16
prerequisite-patch-id: 735e62255c75801bdc4c0b4107850bce821ff7f5
prerequisite-patch-id: 9d2e83a2dd43e193f534283fab73e90b4f435043
prerequisite-patch-id: 7a43e0849a9afa3c6f83547fd16d9271b07619e5
prerequisite-patch-id: e7aa6fb05314bad6d94c465f3f59969871bf3d2e
prerequisite-patch-id: 6276b2a23818c65ff2ad3d65b562615690cffee9
prerequisite-patch-id: d834ece14ffb525b8c3e661e78736692f33fca9b
prerequisite-patch-id: 4c17a3ce4dae9b788795d915bf775630f5c43c53
prerequisite-patch-id: dabb913fd478e97593e45c23fee4be9fd807f851
prerequisite-patch-id: ba61df106fbe2ada21e8f22c3d2cfaf7809c84b6
prerequisite-patch-id: 287572fb64f83f5d931034f7c75674907584a087
prerequisite-patch-id: 536114f0732646095ef5302a165672b3290d4c75
prerequisite-patch-id: 258ea5f9b8bf41b6981345dcc81795f25865d38f
prerequisite-patch-id: 8b6f2c9660c0ac0ee4e73e4c21aca8e6b75e81b9
prerequisite-patch-id: e09e995700a814a763aa304ad3881a7222acf556
prerequisite-patch-id: 841cd71b556b480d6a5a5e332eeca70d6a76ec3f
prerequisite-patch-id: d074c7ffa2917a9f754d5801e3f67bc980f9de4c
prerequisite-patch-id: 5f59bc7cbbf1230e5ff4761fa7c1116d4e6e5d71
prerequisite-patch-id: d5da3475c6a3588e11a1678feb565bdd459b548e
-- 
2.17.1


^ permalink raw reply	[flat|nested] 72+ messages in thread

* [PATCH v4 1/7] dt-bindings: net: snps,dwmac: Add dwmac-5.20 version
  2023-01-18  6:16 ` Yanhong Wang
@ 2023-01-18  6:16   ` Yanhong Wang
  -1 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

From: Emil Renner Berthing <kernel@esmil.dk>

Add dwmac-5.20 IP version to snps.dwmac.yaml

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 13b984076af5..e26c3e76ebb7 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.10a
           - snps,dwmac-4.20a
           - snps,dwmac-5.10a
+          - snps,dwmac-5.20
           - snps,dwxgmac
           - snps,dwxgmac-2.10
 
@@ -87,6 +88,7 @@ properties:
         - snps,dwmac-4.10a
         - snps,dwmac-4.20a
         - snps,dwmac-5.10a
+        - snps,dwmac-5.20
         - snps,dwxgmac
         - snps,dwxgmac-2.10
 
@@ -393,6 +395,7 @@ allOf:
               - snps,dwmac-3.50a
               - snps,dwmac-4.10a
               - snps,dwmac-4.20a
+              - snps,dwmac-5.20
               - snps,dwxgmac
               - snps,dwxgmac-2.10
               - st,spear600-gmac
@@ -447,6 +450,7 @@ allOf:
               - snps,dwmac-4.10a
               - snps,dwmac-4.20a
               - snps,dwmac-5.10a
+              - snps,dwmac-5.20
               - snps,dwxgmac
               - snps,dwxgmac-2.10
               - st,spear600-gmac
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 1/7] dt-bindings: net: snps,dwmac: Add dwmac-5.20 version
@ 2023-01-18  6:16   ` Yanhong Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

From: Emil Renner Berthing <kernel@esmil.dk>

Add dwmac-5.20 IP version to snps.dwmac.yaml

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 13b984076af5..e26c3e76ebb7 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.10a
           - snps,dwmac-4.20a
           - snps,dwmac-5.10a
+          - snps,dwmac-5.20
           - snps,dwxgmac
           - snps,dwxgmac-2.10
 
@@ -87,6 +88,7 @@ properties:
         - snps,dwmac-4.10a
         - snps,dwmac-4.20a
         - snps,dwmac-5.10a
+        - snps,dwmac-5.20
         - snps,dwxgmac
         - snps,dwxgmac-2.10
 
@@ -393,6 +395,7 @@ allOf:
               - snps,dwmac-3.50a
               - snps,dwmac-4.10a
               - snps,dwmac-4.20a
+              - snps,dwmac-5.20
               - snps,dwxgmac
               - snps,dwxgmac-2.10
               - st,spear600-gmac
@@ -447,6 +450,7 @@ allOf:
               - snps,dwmac-4.10a
               - snps,dwmac-4.20a
               - snps,dwmac-5.10a
+              - snps,dwmac-5.20
               - snps,dwxgmac
               - snps,dwxgmac-2.10
               - st,spear600-gmac
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
  2023-01-18  6:16 ` Yanhong Wang
@ 2023-01-18  6:16   ` Yanhong Wang
  -1 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

Some boards(such as StarFive VisionFive v2) require more than one value
which defined by resets property, so the original definition can not
meet the requirements. In order to adapt to different requirements,
adjust the maxitems number definition.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index e26c3e76ebb7..baf2c5b9e92d 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -133,12 +133,9 @@ properties:
         - ptp_ref
 
   resets:
-    maxItems: 1
-    description:
-      MAC Reset signal.
-
-  reset-names:
-    const: stmmaceth
+    minItems: 1
+    maxItems: 3
+    additionalItems: true
 
   power-domains:
     maxItems: 1
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
@ 2023-01-18  6:16   ` Yanhong Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

Some boards(such as StarFive VisionFive v2) require more than one value
which defined by resets property, so the original definition can not
meet the requirements. In order to adapt to different requirements,
adjust the maxitems number definition.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index e26c3e76ebb7..baf2c5b9e92d 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -133,12 +133,9 @@ properties:
         - ptp_ref
 
   resets:
-    maxItems: 1
-    description:
-      MAC Reset signal.
-
-  reset-names:
-    const: stmmaceth
+    minItems: 1
+    maxItems: 3
+    additionalItems: true
 
   power-domains:
     maxItems: 1
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 3/7] net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string
  2023-01-18  6:16 ` Yanhong Wang
@ 2023-01-18  6:16   ` Yanhong Wang
  -1 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

From: Emil Renner Berthing <kernel@esmil.dk>

Add "snps,dwmac-5.20" compatible string for 5.20 version that can avoid
to define some platform data in the glue layer.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 50f6b4a14be4..cc3b701af802 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -519,7 +519,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 	if (of_device_is_compatible(np, "snps,dwmac-4.00") ||
 	    of_device_is_compatible(np, "snps,dwmac-4.10a") ||
 	    of_device_is_compatible(np, "snps,dwmac-4.20a") ||
-	    of_device_is_compatible(np, "snps,dwmac-5.10a")) {
+	    of_device_is_compatible(np, "snps,dwmac-5.10a") ||
+	    of_device_is_compatible(np, "snps,dwmac-5.20")) {
 		plat->has_gmac4 = 1;
 		plat->has_gmac = 0;
 		plat->pmt = 1;
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 3/7] net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string
@ 2023-01-18  6:16   ` Yanhong Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

From: Emil Renner Berthing <kernel@esmil.dk>

Add "snps,dwmac-5.20" compatible string for 5.20 version that can avoid
to define some platform data in the glue layer.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 50f6b4a14be4..cc3b701af802 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -519,7 +519,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 	if (of_device_is_compatible(np, "snps,dwmac-4.00") ||
 	    of_device_is_compatible(np, "snps,dwmac-4.10a") ||
 	    of_device_is_compatible(np, "snps,dwmac-4.20a") ||
-	    of_device_is_compatible(np, "snps,dwmac-5.10a")) {
+	    of_device_is_compatible(np, "snps,dwmac-5.10a") ||
+	    of_device_is_compatible(np, "snps,dwmac-5.20")) {
 		plat->has_gmac4 = 1;
 		plat->has_gmac = 0;
 		plat->pmt = 1;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 4/7] dt-bindings: net: Add support StarFive dwmac
  2023-01-18  6:16 ` Yanhong Wang
@ 2023-01-18  6:16   ` Yanhong Wang
  -1 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

Add documentation to describe StarFive dwmac driver(GMAC).

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
 .../bindings/net/starfive,jh7110-dwmac.yaml   | 113 ++++++++++++++++++
 MAINTAINERS                                   |   5 +
 3 files changed, 119 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index baf2c5b9e92d..8b07bc9c8b00 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -91,6 +91,7 @@ properties:
         - snps,dwmac-5.20
         - snps,dwxgmac
         - snps,dwxgmac-2.10
+        - starfive,jh7110-dwmac
 
   reg:
     minItems: 1
diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
new file mode 100644
index 000000000000..eb0767da834a
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
@@ -0,0 +1,113 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2022 StarFive Technology Co., Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/starfive,jh7110-dwmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive JH7110 DWMAC glue layer
+
+maintainers:
+  - Yanhong Wang <yanhong.wang@starfivetech.com>
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - starfive,jh7110-dwmac
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - starfive,jh7110-dwmac
+      - const: snps,dwmac-5.20
+
+  clocks:
+    items:
+      - description: GMAC main clock
+      - description: GMAC AHB clock
+      - description: PTP clock
+      - description: TX clock
+      - description: GTXC clock
+      - description: GTX clock
+
+  clock-names:
+    items:
+      - const: stmmaceth
+      - const: pclk
+      - const: ptp_ref
+      - const: tx
+      - const: gtxc
+      - const: gtx
+
+  resets:
+    items:
+      - description: MAC Reset signal.
+      - description: AHB Reset signal.
+
+  reset-names:
+    items:
+      - const: stmmaceth
+      - const: ahb
+
+allOf:
+  - $ref: snps,dwmac.yaml#
+
+unevaluatedProperties: true
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+
+examples:
+  - |
+    ethernet@16030000 {
+        compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
+        reg = <0x16030000 0x10000>;
+        clocks = <&clk 3>, <&clk 2>, <&clk 109>,
+                 <&clk 5>, <&clk 111>, <&clk 108>;
+        clock-names = "stmmaceth", "pclk", "ptp_ref",
+                      "tx", "gtxc", "gtx";
+        resets = <&rst 1>, <&rst 2>;
+        reset-names = "stmmaceth", "ahb";
+        interrupts = <7>, <6>, <5>;
+        interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+        phy-mode = "rgmii-id";
+        snps,multicast-filter-bins = <64>;
+        snps,perfect-filter-entries = <8>;
+        rx-fifo-depth = <2048>;
+        tx-fifo-depth = <2048>;
+        snps,fixed-burst;
+        snps,no-pbl-x8;
+        snps,tso;
+        snps,force_thresh_dma_mode;
+        snps,axi-config = <&stmmac_axi_setup>;
+        snps,en-tx-lpi-clockgating;
+        snps,txpbl = <16>;
+        snps,rxpbl = <16>;
+        phy-handle = <&phy0>;
+
+        mdio {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "snps,dwmac-mdio";
+
+            phy0: ethernet-phy@0 {
+                reg = <0>;
+            };
+        };
+
+        stmmac_axi_setup: stmmac-axi-config {
+            snps,lpi_en;
+            snps,wr_osr_lmt = <4>;
+            snps,rd_osr_lmt = <4>;
+            snps,blen = <256 128 64 32 0 0 0>;
+        };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index a70c1d0f303e..56be59bb09f7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -19606,6 +19606,11 @@ F:	Documentation/devicetree/bindings/clock/starfive*
 F:	drivers/clk/starfive/
 F:	include/dt-bindings/clock/starfive*
 
+STARFIVE DWMAC GLUE LAYER
+M:	Yanhong Wang <yanhong.wang@starfivetech.com>
+S:	Maintained
+F:	Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
+
 STARFIVE PINCTRL DRIVER
 M:	Emil Renner Berthing <kernel@esmil.dk>
 M:	Jianlong Huang <jianlong.huang@starfivetech.com>
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 4/7] dt-bindings: net: Add support StarFive dwmac
@ 2023-01-18  6:16   ` Yanhong Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

Add documentation to describe StarFive dwmac driver(GMAC).

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
 .../bindings/net/starfive,jh7110-dwmac.yaml   | 113 ++++++++++++++++++
 MAINTAINERS                                   |   5 +
 3 files changed, 119 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index baf2c5b9e92d..8b07bc9c8b00 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -91,6 +91,7 @@ properties:
         - snps,dwmac-5.20
         - snps,dwxgmac
         - snps,dwxgmac-2.10
+        - starfive,jh7110-dwmac
 
   reg:
     minItems: 1
diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
new file mode 100644
index 000000000000..eb0767da834a
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
@@ -0,0 +1,113 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2022 StarFive Technology Co., Ltd.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/starfive,jh7110-dwmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive JH7110 DWMAC glue layer
+
+maintainers:
+  - Yanhong Wang <yanhong.wang@starfivetech.com>
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - starfive,jh7110-dwmac
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - starfive,jh7110-dwmac
+      - const: snps,dwmac-5.20
+
+  clocks:
+    items:
+      - description: GMAC main clock
+      - description: GMAC AHB clock
+      - description: PTP clock
+      - description: TX clock
+      - description: GTXC clock
+      - description: GTX clock
+
+  clock-names:
+    items:
+      - const: stmmaceth
+      - const: pclk
+      - const: ptp_ref
+      - const: tx
+      - const: gtxc
+      - const: gtx
+
+  resets:
+    items:
+      - description: MAC Reset signal.
+      - description: AHB Reset signal.
+
+  reset-names:
+    items:
+      - const: stmmaceth
+      - const: ahb
+
+allOf:
+  - $ref: snps,dwmac.yaml#
+
+unevaluatedProperties: true
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+
+examples:
+  - |
+    ethernet@16030000 {
+        compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
+        reg = <0x16030000 0x10000>;
+        clocks = <&clk 3>, <&clk 2>, <&clk 109>,
+                 <&clk 5>, <&clk 111>, <&clk 108>;
+        clock-names = "stmmaceth", "pclk", "ptp_ref",
+                      "tx", "gtxc", "gtx";
+        resets = <&rst 1>, <&rst 2>;
+        reset-names = "stmmaceth", "ahb";
+        interrupts = <7>, <6>, <5>;
+        interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+        phy-mode = "rgmii-id";
+        snps,multicast-filter-bins = <64>;
+        snps,perfect-filter-entries = <8>;
+        rx-fifo-depth = <2048>;
+        tx-fifo-depth = <2048>;
+        snps,fixed-burst;
+        snps,no-pbl-x8;
+        snps,tso;
+        snps,force_thresh_dma_mode;
+        snps,axi-config = <&stmmac_axi_setup>;
+        snps,en-tx-lpi-clockgating;
+        snps,txpbl = <16>;
+        snps,rxpbl = <16>;
+        phy-handle = <&phy0>;
+
+        mdio {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "snps,dwmac-mdio";
+
+            phy0: ethernet-phy@0 {
+                reg = <0>;
+            };
+        };
+
+        stmmac_axi_setup: stmmac-axi-config {
+            snps,lpi_en;
+            snps,wr_osr_lmt = <4>;
+            snps,rd_osr_lmt = <4>;
+            snps,blen = <256 128 64 32 0 0 0>;
+        };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index a70c1d0f303e..56be59bb09f7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -19606,6 +19606,11 @@ F:	Documentation/devicetree/bindings/clock/starfive*
 F:	drivers/clk/starfive/
 F:	include/dt-bindings/clock/starfive*
 
+STARFIVE DWMAC GLUE LAYER
+M:	Yanhong Wang <yanhong.wang@starfivetech.com>
+S:	Maintained
+F:	Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
+
 STARFIVE PINCTRL DRIVER
 M:	Emil Renner Berthing <kernel@esmil.dk>
 M:	Jianlong Huang <jianlong.huang@starfivetech.com>
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs
  2023-01-18  6:16 ` Yanhong Wang
@ 2023-01-18  6:16   ` Yanhong Wang
  -1 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

This adds StarFive dwmac driver support on the StarFive JH7110 SoCs.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
 MAINTAINERS                                   |   1 +
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
 .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
 4 files changed, 132 insertions(+)
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 56be59bb09f7..5b50b52d3dbb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -19609,6 +19609,7 @@ F:	include/dt-bindings/clock/starfive*
 STARFIVE DWMAC GLUE LAYER
 M:	Yanhong Wang <yanhong.wang@starfivetech.com>
 S:	Maintained
+F:	Documentation/devicetree/bindings/net/dwmac-starfive-plat.c
 F:	Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
 
 STARFIVE PINCTRL DRIVER
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index 31ff35174034..f9a4ad4abd54 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -235,6 +235,18 @@ config DWMAC_INTEL_PLAT
 	  the stmmac device driver. This driver is used for the Intel Keem Bay
 	  SoC.
 
+config DWMAC_STARFIVE_PLAT
+	tristate "StarFive dwmac support"
+	depends on OF && COMMON_CLK
+	depends on STMMAC_ETH
+	default SOC_STARFIVE
+	help
+	  Support for ethernet controllers on StarFive RISC-V SoCs
+
+	  This selects the StarFive platform specific glue layer support for
+	  the stmmac device driver. This driver is used for StarFive JH7110
+	  ethernet controller.
+
 config DWMAC_VISCONTI
 	tristate "Toshiba Visconti DWMAC support"
 	default ARCH_VISCONTI
diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
index d4e12e9ace4f..a63ab0ab5071 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Makefile
+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_DWMAC_DWC_QOS_ETH)	+= dwmac-dwc-qos-eth.o
 obj-$(CONFIG_DWMAC_INTEL_PLAT)	+= dwmac-intel-plat.o
 obj-$(CONFIG_DWMAC_GENERIC)	+= dwmac-generic.o
 obj-$(CONFIG_DWMAC_IMX8)	+= dwmac-imx.o
+obj-$(CONFIG_DWMAC_STARFIVE_PLAT)	+= dwmac-starfive-plat.o
 obj-$(CONFIG_DWMAC_VISCONTI)	+= dwmac-visconti.o
 stmmac-platform-objs:= stmmac_platform.o
 dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
new file mode 100644
index 000000000000..e441d920933a
--- /dev/null
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
@@ -0,0 +1,118 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * StarFive DWMAC platform driver
+ *
+ * Copyright(C) 2022 StarFive Technology Co., Ltd.
+ *
+ */
+
+#include <linux/of_device.h>
+
+#include "stmmac_platform.h"
+
+struct starfive_dwmac {
+	struct device *dev;
+	struct clk *clk_tx;
+	struct clk *clk_gtx;
+	struct clk *clk_gtxc;
+};
+
+static void starfive_eth_plat_fix_mac_speed(void *priv, unsigned int speed)
+{
+	struct starfive_dwmac *dwmac = priv;
+	unsigned long rate;
+	int err;
+
+	rate = clk_get_rate(dwmac->clk_gtx);
+
+	switch (speed) {
+	case SPEED_1000:
+		rate = 125000000;
+		break;
+	case SPEED_100:
+		rate = 25000000;
+		break;
+	case SPEED_10:
+		rate = 2500000;
+		break;
+	default:
+		dev_err(dwmac->dev, "invalid speed %u\n", speed);
+		break;
+	}
+
+	err = clk_set_rate(dwmac->clk_gtx, rate);
+	if (err)
+		dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
+}
+
+static int starfive_eth_plat_probe(struct platform_device *pdev)
+{
+	struct plat_stmmacenet_data *plat_dat;
+	struct stmmac_resources stmmac_res;
+	struct starfive_dwmac *dwmac;
+	int err;
+
+	err = stmmac_get_platform_resources(pdev, &stmmac_res);
+	if (err)
+		return err;
+
+	plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
+	if (IS_ERR(plat_dat)) {
+		dev_err(&pdev->dev, "dt configuration failed\n");
+		return PTR_ERR(plat_dat);
+	}
+
+	dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
+	if (!dwmac)
+		return -ENOMEM;
+
+	dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
+	if (IS_ERR(dwmac->clk_tx))
+		return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
+						"error getting tx clock\n");
+
+	dwmac->clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
+	if (IS_ERR(dwmac->clk_gtx))
+		return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtx),
+						"error getting gtx clock\n");
+
+	dwmac->clk_gtxc = devm_clk_get_enabled(&pdev->dev, "gtxc");
+	if (IS_ERR(dwmac->clk_gtxc))
+		return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtxc),
+						"error getting gtxc clock\n");
+
+	dwmac->dev = &pdev->dev;
+	plat_dat->fix_mac_speed = starfive_eth_plat_fix_mac_speed;
+	plat_dat->init = NULL;
+	plat_dat->bsp_priv = dwmac;
+	plat_dat->dma_cfg->dche = true;
+
+	err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
+	if (err) {
+		stmmac_remove_config_dt(pdev, plat_dat);
+		return err;
+	}
+
+	return 0;
+}
+
+static const struct of_device_id starfive_eth_plat_match[] = {
+	{ .compatible = "starfive,jh7110-dwmac"	},
+	{ }
+};
+
+static struct platform_driver starfive_eth_plat_driver = {
+	.probe  = starfive_eth_plat_probe,
+	.remove = stmmac_pltfr_remove,
+	.driver = {
+		.name = "starfive-eth-plat",
+		.pm = &stmmac_pltfr_pm_ops,
+		.of_match_table = starfive_eth_plat_match,
+	},
+};
+
+module_platform_driver(starfive_eth_plat_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("StarFive DWMAC platform driver");
+MODULE_AUTHOR("Yanhong Wang <yanhong.wang@starfivetech.com>");
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs
@ 2023-01-18  6:16   ` Yanhong Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:16 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

This adds StarFive dwmac driver support on the StarFive JH7110 SoCs.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
 MAINTAINERS                                   |   1 +
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
 drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
 .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
 4 files changed, 132 insertions(+)
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 56be59bb09f7..5b50b52d3dbb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -19609,6 +19609,7 @@ F:	include/dt-bindings/clock/starfive*
 STARFIVE DWMAC GLUE LAYER
 M:	Yanhong Wang <yanhong.wang@starfivetech.com>
 S:	Maintained
+F:	Documentation/devicetree/bindings/net/dwmac-starfive-plat.c
 F:	Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
 
 STARFIVE PINCTRL DRIVER
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index 31ff35174034..f9a4ad4abd54 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -235,6 +235,18 @@ config DWMAC_INTEL_PLAT
 	  the stmmac device driver. This driver is used for the Intel Keem Bay
 	  SoC.
 
+config DWMAC_STARFIVE_PLAT
+	tristate "StarFive dwmac support"
+	depends on OF && COMMON_CLK
+	depends on STMMAC_ETH
+	default SOC_STARFIVE
+	help
+	  Support for ethernet controllers on StarFive RISC-V SoCs
+
+	  This selects the StarFive platform specific glue layer support for
+	  the stmmac device driver. This driver is used for StarFive JH7110
+	  ethernet controller.
+
 config DWMAC_VISCONTI
 	tristate "Toshiba Visconti DWMAC support"
 	default ARCH_VISCONTI
diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
index d4e12e9ace4f..a63ab0ab5071 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Makefile
+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_DWMAC_DWC_QOS_ETH)	+= dwmac-dwc-qos-eth.o
 obj-$(CONFIG_DWMAC_INTEL_PLAT)	+= dwmac-intel-plat.o
 obj-$(CONFIG_DWMAC_GENERIC)	+= dwmac-generic.o
 obj-$(CONFIG_DWMAC_IMX8)	+= dwmac-imx.o
+obj-$(CONFIG_DWMAC_STARFIVE_PLAT)	+= dwmac-starfive-plat.o
 obj-$(CONFIG_DWMAC_VISCONTI)	+= dwmac-visconti.o
 stmmac-platform-objs:= stmmac_platform.o
 dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
new file mode 100644
index 000000000000..e441d920933a
--- /dev/null
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
@@ -0,0 +1,118 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * StarFive DWMAC platform driver
+ *
+ * Copyright(C) 2022 StarFive Technology Co., Ltd.
+ *
+ */
+
+#include <linux/of_device.h>
+
+#include "stmmac_platform.h"
+
+struct starfive_dwmac {
+	struct device *dev;
+	struct clk *clk_tx;
+	struct clk *clk_gtx;
+	struct clk *clk_gtxc;
+};
+
+static void starfive_eth_plat_fix_mac_speed(void *priv, unsigned int speed)
+{
+	struct starfive_dwmac *dwmac = priv;
+	unsigned long rate;
+	int err;
+
+	rate = clk_get_rate(dwmac->clk_gtx);
+
+	switch (speed) {
+	case SPEED_1000:
+		rate = 125000000;
+		break;
+	case SPEED_100:
+		rate = 25000000;
+		break;
+	case SPEED_10:
+		rate = 2500000;
+		break;
+	default:
+		dev_err(dwmac->dev, "invalid speed %u\n", speed);
+		break;
+	}
+
+	err = clk_set_rate(dwmac->clk_gtx, rate);
+	if (err)
+		dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
+}
+
+static int starfive_eth_plat_probe(struct platform_device *pdev)
+{
+	struct plat_stmmacenet_data *plat_dat;
+	struct stmmac_resources stmmac_res;
+	struct starfive_dwmac *dwmac;
+	int err;
+
+	err = stmmac_get_platform_resources(pdev, &stmmac_res);
+	if (err)
+		return err;
+
+	plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
+	if (IS_ERR(plat_dat)) {
+		dev_err(&pdev->dev, "dt configuration failed\n");
+		return PTR_ERR(plat_dat);
+	}
+
+	dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
+	if (!dwmac)
+		return -ENOMEM;
+
+	dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
+	if (IS_ERR(dwmac->clk_tx))
+		return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
+						"error getting tx clock\n");
+
+	dwmac->clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
+	if (IS_ERR(dwmac->clk_gtx))
+		return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtx),
+						"error getting gtx clock\n");
+
+	dwmac->clk_gtxc = devm_clk_get_enabled(&pdev->dev, "gtxc");
+	if (IS_ERR(dwmac->clk_gtxc))
+		return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtxc),
+						"error getting gtxc clock\n");
+
+	dwmac->dev = &pdev->dev;
+	plat_dat->fix_mac_speed = starfive_eth_plat_fix_mac_speed;
+	plat_dat->init = NULL;
+	plat_dat->bsp_priv = dwmac;
+	plat_dat->dma_cfg->dche = true;
+
+	err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
+	if (err) {
+		stmmac_remove_config_dt(pdev, plat_dat);
+		return err;
+	}
+
+	return 0;
+}
+
+static const struct of_device_id starfive_eth_plat_match[] = {
+	{ .compatible = "starfive,jh7110-dwmac"	},
+	{ }
+};
+
+static struct platform_driver starfive_eth_plat_driver = {
+	.probe  = starfive_eth_plat_probe,
+	.remove = stmmac_pltfr_remove,
+	.driver = {
+		.name = "starfive-eth-plat",
+		.pm = &stmmac_pltfr_pm_ops,
+		.of_match_table = starfive_eth_plat_match,
+	},
+};
+
+module_platform_driver(starfive_eth_plat_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("StarFive DWMAC platform driver");
+MODULE_AUTHOR("Yanhong Wang <yanhong.wang@starfivetech.com>");
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
  2023-01-18  6:16 ` Yanhong Wang
@ 2023-01-18  6:17   ` Yanhong Wang
  -1 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:17 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

Add JH7110 ethernet device node to support gmac driver for the JH7110
RISC-V SoC.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
index c22e8f1d2640..c6de6e3b1a25 100644
--- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
@@ -433,5 +433,98 @@
 			reg-shift = <2>;
 			status = "disabled";
 		};
+
+		stmmac_axi_setup: stmmac-axi-config {
+			snps,lpi_en;
+			snps,wr_osr_lmt = <4>;
+			snps,rd_osr_lmt = <4>;
+			snps,blen = <256 128 64 32 0 0 0>;
+		};
+
+		gmac0: ethernet@16030000 {
+			compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
+			reg = <0x0 0x16030000 0x0 0x10000>;
+			clocks = <&aoncrg JH7110_AONCLK_GMAC0_AXI>,
+				 <&aoncrg JH7110_AONCLK_GMAC0_AHB>,
+				 <&syscrg JH7110_SYSCLK_GMAC0_PTP>,
+				 <&aoncrg JH7110_AONCLK_GMAC0_TX>,
+				 <&syscrg JH7110_SYSCLK_GMAC0_GTXC>,
+				 <&syscrg JH7110_SYSCLK_GMAC0_GTXCLK>;
+			clock-names = "stmmaceth", "pclk", "ptp_ref",
+						"tx", "gtxc", "gtx";
+			resets = <&aoncrg JH7110_AONRST_GMAC0_AXI>,
+				 <&aoncrg JH7110_AONRST_GMAC0_AHB>;
+			reset-names = "stmmaceth", "ahb";
+			interrupts = <7>, <6>, <5>;
+			interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+			phy-mode = "rgmii-id";
+			snps,multicast-filter-bins = <64>;
+			snps,perfect-filter-entries = <8>;
+			rx-fifo-depth = <2048>;
+			tx-fifo-depth = <2048>;
+			snps,fixed-burst;
+			snps,no-pbl-x8;
+			snps,force_thresh_dma_mode;
+			snps,axi-config = <&stmmac_axi_setup>;
+			snps,tso;
+			snps,en-tx-lpi-clockgating;
+			snps,txpbl = <16>;
+			snps,rxpbl = <16>;
+			status = "disabled";
+			phy-handle = <&phy0>;
+
+			mdio0: mdio {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "snps,dwmac-mdio";
+
+				phy0: ethernet-phy@0 {
+					reg = <0>;
+				};
+			};
+		};
+
+		gmac1: ethernet@16040000 {
+			compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
+			reg = <0x0 0x16040000 0x0 0x10000>;
+			clocks = <&syscrg JH7110_SYSCLK_GMAC1_AXI>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_AHB>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_PTP>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_TX>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_GTXC>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_GTXCLK>;
+			clock-names = "stmmaceth", "pclk", "ptp_ref",
+					"tx", "gtxc", "gtx";
+			resets = <&syscrg JH7110_SYSRST_GMAC1_AXI>,
+				 <&syscrg JH7110_SYSRST_GMAC1_AHB>;
+			reset-names = "stmmaceth", "ahb";
+			interrupts = <78>, <77>, <76>;
+			interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+			phy-mode = "rgmii-id";
+			snps,multicast-filter-bins = <64>;
+			snps,perfect-filter-entries = <8>;
+			rx-fifo-depth = <2048>;
+			tx-fifo-depth = <2048>;
+			snps,fixed-burst;
+			snps,no-pbl-x8;
+			snps,force_thresh_dma_mode;
+			snps,axi-config = <&stmmac_axi_setup>;
+			snps,tso;
+			snps,en-tx-lpi-clockgating;
+			snps,txpbl = <16>;
+			snps,rxpbl = <16>;
+			status = "disabled";
+			phy-handle = <&phy1>;
+
+			mdio1: mdio {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "snps,dwmac-mdio";
+
+				phy1: ethernet-phy@1 {
+					reg = <1>;
+				};
+			};
+		};
 	};
 };
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
@ 2023-01-18  6:17   ` Yanhong Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:17 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

Add JH7110 ethernet device node to support gmac driver for the JH7110
RISC-V SoC.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
index c22e8f1d2640..c6de6e3b1a25 100644
--- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
@@ -433,5 +433,98 @@
 			reg-shift = <2>;
 			status = "disabled";
 		};
+
+		stmmac_axi_setup: stmmac-axi-config {
+			snps,lpi_en;
+			snps,wr_osr_lmt = <4>;
+			snps,rd_osr_lmt = <4>;
+			snps,blen = <256 128 64 32 0 0 0>;
+		};
+
+		gmac0: ethernet@16030000 {
+			compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
+			reg = <0x0 0x16030000 0x0 0x10000>;
+			clocks = <&aoncrg JH7110_AONCLK_GMAC0_AXI>,
+				 <&aoncrg JH7110_AONCLK_GMAC0_AHB>,
+				 <&syscrg JH7110_SYSCLK_GMAC0_PTP>,
+				 <&aoncrg JH7110_AONCLK_GMAC0_TX>,
+				 <&syscrg JH7110_SYSCLK_GMAC0_GTXC>,
+				 <&syscrg JH7110_SYSCLK_GMAC0_GTXCLK>;
+			clock-names = "stmmaceth", "pclk", "ptp_ref",
+						"tx", "gtxc", "gtx";
+			resets = <&aoncrg JH7110_AONRST_GMAC0_AXI>,
+				 <&aoncrg JH7110_AONRST_GMAC0_AHB>;
+			reset-names = "stmmaceth", "ahb";
+			interrupts = <7>, <6>, <5>;
+			interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+			phy-mode = "rgmii-id";
+			snps,multicast-filter-bins = <64>;
+			snps,perfect-filter-entries = <8>;
+			rx-fifo-depth = <2048>;
+			tx-fifo-depth = <2048>;
+			snps,fixed-burst;
+			snps,no-pbl-x8;
+			snps,force_thresh_dma_mode;
+			snps,axi-config = <&stmmac_axi_setup>;
+			snps,tso;
+			snps,en-tx-lpi-clockgating;
+			snps,txpbl = <16>;
+			snps,rxpbl = <16>;
+			status = "disabled";
+			phy-handle = <&phy0>;
+
+			mdio0: mdio {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "snps,dwmac-mdio";
+
+				phy0: ethernet-phy@0 {
+					reg = <0>;
+				};
+			};
+		};
+
+		gmac1: ethernet@16040000 {
+			compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
+			reg = <0x0 0x16040000 0x0 0x10000>;
+			clocks = <&syscrg JH7110_SYSCLK_GMAC1_AXI>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_AHB>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_PTP>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_TX>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_GTXC>,
+				 <&syscrg JH7110_SYSCLK_GMAC1_GTXCLK>;
+			clock-names = "stmmaceth", "pclk", "ptp_ref",
+					"tx", "gtxc", "gtx";
+			resets = <&syscrg JH7110_SYSRST_GMAC1_AXI>,
+				 <&syscrg JH7110_SYSRST_GMAC1_AHB>;
+			reset-names = "stmmaceth", "ahb";
+			interrupts = <78>, <77>, <76>;
+			interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+			phy-mode = "rgmii-id";
+			snps,multicast-filter-bins = <64>;
+			snps,perfect-filter-entries = <8>;
+			rx-fifo-depth = <2048>;
+			tx-fifo-depth = <2048>;
+			snps,fixed-burst;
+			snps,no-pbl-x8;
+			snps,force_thresh_dma_mode;
+			snps,axi-config = <&stmmac_axi_setup>;
+			snps,tso;
+			snps,en-tx-lpi-clockgating;
+			snps,txpbl = <16>;
+			snps,rxpbl = <16>;
+			status = "disabled";
+			phy-handle = <&phy1>;
+
+			mdio1: mdio {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "snps,dwmac-mdio";
+
+				phy1: ethernet-phy@1 {
+					reg = <1>;
+				};
+			};
+		};
 	};
 };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 7/7] riscv: dts: starfive: visionfive-v2: Enable gmac device tree node
  2023-01-18  6:16 ` Yanhong Wang
@ 2023-01-18  6:17   ` Yanhong Wang
  -1 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:17 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

Update gmac device tree node status to okay.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 .../dts/starfive/jh7110-starfive-visionfive-v2.dts     | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
index c8946cf3a268..b22363d5f9dc 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
+++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
@@ -15,6 +15,8 @@
 
 	aliases {
 		serial0 = &uart0;
+		ethernet0 = &gmac0;
+		ethernet1 = &gmac1;
 	};
 
 	chosen {
@@ -114,3 +116,11 @@
 	pinctrl-0 = <&uart0_pins>;
 	status = "okay";
 };
+
+&gmac0 {
+	status = "okay";
+};
+
+&gmac1 {
+	status = "okay";
+};
-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH v4 7/7] riscv: dts: starfive: visionfive-v2: Enable gmac device tree node
@ 2023-01-18  6:17   ` Yanhong Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Yanhong Wang @ 2023-01-18  6:17 UTC (permalink / raw)
  To: linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis,
	Yanhong Wang

Update gmac device tree node status to okay.

Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
---
 .../dts/starfive/jh7110-starfive-visionfive-v2.dts     | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
index c8946cf3a268..b22363d5f9dc 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
+++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
@@ -15,6 +15,8 @@
 
 	aliases {
 		serial0 = &uart0;
+		ethernet0 = &gmac0;
+		ethernet1 = &gmac1;
 	};
 
 	chosen {
@@ -114,3 +116,11 @@
 	pinctrl-0 = <&uart0_pins>;
 	status = "okay";
 };
+
+&gmac0 {
+	status = "okay";
+};
+
+&gmac1 {
+	status = "okay";
+};
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
  2023-01-18  6:16   ` Yanhong Wang
@ 2023-01-18 13:10     ` Rob Herring
  -1 siblings, 0 replies; 72+ messages in thread
From: Rob Herring @ 2023-01-18 13:10 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: Krzysztof Kozlowski, linux-riscv, netdev, Peter Geis,
	Jakub Kicinski, Richard Cochran, Heiner Kallweit,
	David S . Miller, linux-kernel, Paolo Abeni, Andrew Lunn,
	devicetree, Eric Dumazet, Emil Renner Berthing, Rob Herring


On Wed, 18 Jan 2023 14:16:56 +0800, Yanhong Wang wrote:
> Some boards(such as StarFive VisionFive v2) require more than one value
> which defined by resets property, so the original definition can not
> meet the requirements. In order to adapt to different requirements,
> adjust the maxitems number definition.
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.example.dtb: ethernet@1c0b000: Unevaluated properties are not allowed ('reset-names' was unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.example.dtb: ethernet@1c0b000: Unevaluated properties are not allowed ('reset-names' was unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.example.dtb: ethernet@1c0b000: Unevaluated properties are not allowed ('reset-names' was unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230118061701.30047-3-yanhong.wang@starfivetech.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
@ 2023-01-18 13:10     ` Rob Herring
  0 siblings, 0 replies; 72+ messages in thread
From: Rob Herring @ 2023-01-18 13:10 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: Krzysztof Kozlowski, linux-riscv, netdev, Peter Geis,
	Jakub Kicinski, Richard Cochran, Heiner Kallweit,
	David S . Miller, linux-kernel, Paolo Abeni, Andrew Lunn,
	devicetree, Eric Dumazet, Emil Renner Berthing, Rob Herring


On Wed, 18 Jan 2023 14:16:56 +0800, Yanhong Wang wrote:
> Some boards(such as StarFive VisionFive v2) require more than one value
> which defined by resets property, so the original definition can not
> meet the requirements. In order to adapt to different requirements,
> adjust the maxitems number definition.
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.example.dtb: ethernet@1c0b000: Unevaluated properties are not allowed ('reset-names' was unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.example.dtb: ethernet@1c0b000: Unevaluated properties are not allowed ('reset-names' was unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.example.dtb: ethernet@1c0b000: Unevaluated properties are not allowed ('reset-names' was unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230118061701.30047-3-yanhong.wang@starfivetech.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
  2023-01-18  6:16   ` Yanhong Wang
@ 2023-01-18 15:46     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 15:46 UTC (permalink / raw)
  To: Yanhong Wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 18/01/2023 07:16, Yanhong Wang wrote:
> Some boards(such as StarFive VisionFive v2) require more than one value
> which defined by resets property, so the original definition can not
> meet the requirements. In order to adapt to different requirements,
> adjust the maxitems number definition.
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index e26c3e76ebb7..baf2c5b9e92d 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -133,12 +133,9 @@ properties:
>          - ptp_ref
>  
>    resets:
> -    maxItems: 1
> -    description:
> -      MAC Reset signal.
> -
> -  reset-names:
> -    const: stmmaceth
> +    minItems: 1
> +    maxItems: 3
> +    additionalItems: true

NAK, because I told you twice to drop this one. So this is third time -
drop this line...

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
@ 2023-01-18 15:46     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 15:46 UTC (permalink / raw)
  To: Yanhong Wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 18/01/2023 07:16, Yanhong Wang wrote:
> Some boards(such as StarFive VisionFive v2) require more than one value
> which defined by resets property, so the original definition can not
> meet the requirements. In order to adapt to different requirements,
> adjust the maxitems number definition.
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index e26c3e76ebb7..baf2c5b9e92d 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -133,12 +133,9 @@ properties:
>          - ptp_ref
>  
>    resets:
> -    maxItems: 1
> -    description:
> -      MAC Reset signal.
> -
> -  reset-names:
> -    const: stmmaceth
> +    minItems: 1
> +    maxItems: 3
> +    additionalItems: true

NAK, because I told you twice to drop this one. So this is third time -
drop this line...

Best regards,
Krzysztof


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
  2023-01-18  6:16   ` Yanhong Wang
@ 2023-01-18 15:47     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 15:47 UTC (permalink / raw)
  To: Yanhong Wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 18/01/2023 07:16, Yanhong Wang wrote:
> Some boards(such as StarFive VisionFive v2) require more than one value
> which defined by resets property, so the original definition can not
> meet the requirements. In order to adapt to different requirements,
> adjust the maxitems number definition.
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index e26c3e76ebb7..baf2c5b9e92d 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -133,12 +133,9 @@ properties:
>          - ptp_ref
>  
>    resets:
> -    maxItems: 1

Also, this does not make sense on its own and messes constraints for all
other users. So another no for entire patch.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
@ 2023-01-18 15:47     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 15:47 UTC (permalink / raw)
  To: Yanhong Wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 18/01/2023 07:16, Yanhong Wang wrote:
> Some boards(such as StarFive VisionFive v2) require more than one value
> which defined by resets property, so the original definition can not
> meet the requirements. In order to adapt to different requirements,
> adjust the maxitems number definition.
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index e26c3e76ebb7..baf2c5b9e92d 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -133,12 +133,9 @@ properties:
>          - ptp_ref
>  
>    resets:
> -    maxItems: 1

Also, this does not make sense on its own and messes constraints for all
other users. So another no for entire patch.

Best regards,
Krzysztof


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 4/7] dt-bindings: net: Add support StarFive dwmac
  2023-01-18  6:16   ` Yanhong Wang
@ 2023-01-18 15:49     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 15:49 UTC (permalink / raw)
  To: Yanhong Wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 18/01/2023 07:16, Yanhong Wang wrote:
> Add documentation to describe StarFive dwmac driver(GMAC).
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>


Subject is poor. You miss device prefix and it's not correct sentence.

"Add support for XYZ"
or better:
"Add XYZ"


> ---
>  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
>  .../bindings/net/starfive,jh7110-dwmac.yaml   | 113 ++++++++++++++++++
>  MAINTAINERS                                   |   5 +
>  3 files changed, 119 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index baf2c5b9e92d..8b07bc9c8b00 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -91,6 +91,7 @@ properties:
>          - snps,dwmac-5.20
>          - snps,dwxgmac
>          - snps,dwxgmac-2.10
> +        - starfive,jh7110-dwmac
>  
>    reg:
>      minItems: 1
> diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> new file mode 100644
> index 000000000000..eb0767da834a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> @@ -0,0 +1,113 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright (C) 2022 StarFive Technology Co., Ltd.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/starfive,jh7110-dwmac.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: StarFive JH7110 DWMAC glue layer
> +
> +maintainers:
> +  - Yanhong Wang <yanhong.wang@starfivetech.com>
> +
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - starfive,jh7110-dwmac
> +  required:
> +    - compatible
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - starfive,jh7110-dwmac
> +      - const: snps,dwmac-5.20
> +
> +  clocks:
> +    items:
> +      - description: GMAC main clock
> +      - description: GMAC AHB clock
> +      - description: PTP clock
> +      - description: TX clock
> +      - description: GTXC clock
> +      - description: GTX clock
> +
> +  clock-names:
> +    items:
> +      - const: stmmaceth
> +      - const: pclk
> +      - const: ptp_ref
> +      - const: tx
> +      - const: gtxc
> +      - const: gtx
> +
> +  resets:
> +    items:
> +      - description: MAC Reset signal.

Drop trailing dot

> +      - description: AHB Reset signal.

Ditto

> +
> +  reset-names:
> +    items:
> +      - const: stmmaceth
> +      - const: ahb

You have two resets. Why do you change them to three for all variants?
It's not explained in commit 2/7, so this is confusing.

> +
> +allOf:
> +  - $ref: snps,dwmac.yaml#
> +
> +unevaluatedProperties: true
> +
> +required:
> +  - compatible
> +  - clocks
> +  - clock-names
> +  - resets
> +  - reset-names
> +


Best regards,
Krzysztof


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 4/7] dt-bindings: net: Add support StarFive dwmac
@ 2023-01-18 15:49     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 15:49 UTC (permalink / raw)
  To: Yanhong Wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 18/01/2023 07:16, Yanhong Wang wrote:
> Add documentation to describe StarFive dwmac driver(GMAC).
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>


Subject is poor. You miss device prefix and it's not correct sentence.

"Add support for XYZ"
or better:
"Add XYZ"


> ---
>  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
>  .../bindings/net/starfive,jh7110-dwmac.yaml   | 113 ++++++++++++++++++
>  MAINTAINERS                                   |   5 +
>  3 files changed, 119 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index baf2c5b9e92d..8b07bc9c8b00 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -91,6 +91,7 @@ properties:
>          - snps,dwmac-5.20
>          - snps,dwxgmac
>          - snps,dwxgmac-2.10
> +        - starfive,jh7110-dwmac
>  
>    reg:
>      minItems: 1
> diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> new file mode 100644
> index 000000000000..eb0767da834a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> @@ -0,0 +1,113 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright (C) 2022 StarFive Technology Co., Ltd.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/starfive,jh7110-dwmac.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: StarFive JH7110 DWMAC glue layer
> +
> +maintainers:
> +  - Yanhong Wang <yanhong.wang@starfivetech.com>
> +
> +select:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - starfive,jh7110-dwmac
> +  required:
> +    - compatible
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - starfive,jh7110-dwmac
> +      - const: snps,dwmac-5.20
> +
> +  clocks:
> +    items:
> +      - description: GMAC main clock
> +      - description: GMAC AHB clock
> +      - description: PTP clock
> +      - description: TX clock
> +      - description: GTXC clock
> +      - description: GTX clock
> +
> +  clock-names:
> +    items:
> +      - const: stmmaceth
> +      - const: pclk
> +      - const: ptp_ref
> +      - const: tx
> +      - const: gtxc
> +      - const: gtx
> +
> +  resets:
> +    items:
> +      - description: MAC Reset signal.

Drop trailing dot

> +      - description: AHB Reset signal.

Ditto

> +
> +  reset-names:
> +    items:
> +      - const: stmmaceth
> +      - const: ahb

You have two resets. Why do you change them to three for all variants?
It's not explained in commit 2/7, so this is confusing.

> +
> +allOf:
> +  - $ref: snps,dwmac.yaml#
> +
> +unevaluatedProperties: true
> +
> +required:
> +  - compatible
> +  - clocks
> +  - clock-names
> +  - resets
> +  - reset-names
> +


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
  2023-01-18  6:17   ` Yanhong Wang
@ 2023-01-18 15:51     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 15:51 UTC (permalink / raw)
  To: Yanhong Wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 18/01/2023 07:17, Yanhong Wang wrote:
> Add JH7110 ethernet device node to support gmac driver for the JH7110
> RISC-V SoC.
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>  1 file changed, 93 insertions(+)
> 
> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> index c22e8f1d2640..c6de6e3b1a25 100644
> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> @@ -433,5 +433,98 @@
>  			reg-shift = <2>;
>  			status = "disabled";
>  		};
> +
> +		stmmac_axi_setup: stmmac-axi-config {

Why your bindings example is different?

Were the bindings tested? Ahh, no they were not... Can you send only
tested patches?

Was this tested?

> +			snps,lpi_en;
> +			snps,wr_osr_lmt = <4>;
> +			snps,rd_osr_lmt = <4>;
> +			snps,blen = <256 128 64 32 0 0 0>;
> +		};
> +

Best regards,
Krzysztof


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
@ 2023-01-18 15:51     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-01-18 15:51 UTC (permalink / raw)
  To: Yanhong Wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 18/01/2023 07:17, Yanhong Wang wrote:
> Add JH7110 ethernet device node to support gmac driver for the JH7110
> RISC-V SoC.
> 
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>  1 file changed, 93 insertions(+)
> 
> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> index c22e8f1d2640..c6de6e3b1a25 100644
> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> @@ -433,5 +433,98 @@
>  			reg-shift = <2>;
>  			status = "disabled";
>  		};
> +
> +		stmmac_axi_setup: stmmac-axi-config {

Why your bindings example is different?

Were the bindings tested? Ahh, no they were not... Can you send only
tested patches?

Was this tested?

> +			snps,lpi_en;
> +			snps,wr_osr_lmt = <4>;
> +			snps,rd_osr_lmt = <4>;
> +			snps,blen = <256 128 64 32 0 0 0>;
> +		};
> +

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
  2023-01-18  6:16 ` Yanhong Wang
@ 2023-01-18 23:21   ` Conor Dooley
  -1 siblings, 0 replies; 72+ messages in thread
From: Conor Dooley @ 2023-01-18 23:21 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

Hey Yanhong!

On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
> For more information and support, you can visit RVspace wiki[1].
> 	
> This patchset should be applied after the patchset [2], [3], [4].
> [1] https://wiki.rvspace.org/
> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/

I've got those series applied, albeit locally, since they're not ready,
but I cannot get the Ethernet to work properly on my board.
I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
The fact that I am getting to the kernel in the first place means the
ethernet is working in the factory supplied U-Boot [1].

However, in Linux this ethernet port does not appear to work at all.
The other ethernet port is functional in Linux, but not in the factory
supplied U-Boot.

Is this a known issue? If it's not, I'll post the logs somewhere for
you. In case it is relevant, my board is a v1.2a.

Thanks,
Conor.

1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
@ 2023-01-18 23:21   ` Conor Dooley
  0 siblings, 0 replies; 72+ messages in thread
From: Conor Dooley @ 2023-01-18 23:21 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis


[-- Attachment #1.1: Type: text/plain, Size: 1417 bytes --]

Hey Yanhong!

On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
> For more information and support, you can visit RVspace wiki[1].
> 	
> This patchset should be applied after the patchset [2], [3], [4].
> [1] https://wiki.rvspace.org/
> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/

I've got those series applied, albeit locally, since they're not ready,
but I cannot get the Ethernet to work properly on my board.
I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
The fact that I am getting to the kernel in the first place means the
ethernet is working in the factory supplied U-Boot [1].

However, in Linux this ethernet port does not appear to work at all.
The other ethernet port is functional in Linux, but not in the factory
supplied U-Boot.

Is this a known issue? If it's not, I'll post the logs somewhere for
you. In case it is relevant, my board is a v1.2a.

Thanks,
Conor.

1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
  2023-01-18 23:21   ` Conor Dooley
@ 2023-02-03  3:02     ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  3:02 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/1/19 7:21, Conor Dooley wrote:
> Hey Yanhong!
> 
> On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
>> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
>> For more information and support, you can visit RVspace wiki[1].
>> 	
>> This patchset should be applied after the patchset [2], [3], [4].
>> [1] https://wiki.rvspace.org/
>> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
>> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
>> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/
> 
> I've got those series applied, albeit locally, since they're not ready,
> but I cannot get the Ethernet to work properly on my board.
> I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
> The fact that I am getting to the kernel in the first place means the
> ethernet is working in the factory supplied U-Boot [1].
> 
> However, in Linux this ethernet port does not appear to work at all.
> The other ethernet port is functional in Linux, but not in the factory
> supplied U-Boot.
> 
> Is this a known issue? If it's not, I'll post the logs somewhere for
> you. In case it is relevant, my board is a v1.2a.
> 
> Thanks,
> Conor.
> 
> 1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10


No, this is not a issue. 
These patches need to rely on the yt8531 phy driver of motorcomm company
and the corresponding clock delay configuration to work normally, 
and the yt8531 phy driver is being submitted. I have applied the
motorcomm patchs during my test on board v1.2b, so the ethernet cannot work without
the application of the motorcomm patchs. 

For the patchs of yt8531, see [1]

1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/

Thanks,
Yanhong.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
@ 2023-02-03  3:02     ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  3:02 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/1/19 7:21, Conor Dooley wrote:
> Hey Yanhong!
> 
> On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
>> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
>> For more information and support, you can visit RVspace wiki[1].
>> 	
>> This patchset should be applied after the patchset [2], [3], [4].
>> [1] https://wiki.rvspace.org/
>> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
>> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
>> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/
> 
> I've got those series applied, albeit locally, since they're not ready,
> but I cannot get the Ethernet to work properly on my board.
> I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
> The fact that I am getting to the kernel in the first place means the
> ethernet is working in the factory supplied U-Boot [1].
> 
> However, in Linux this ethernet port does not appear to work at all.
> The other ethernet port is functional in Linux, but not in the factory
> supplied U-Boot.
> 
> Is this a known issue? If it's not, I'll post the logs somewhere for
> you. In case it is relevant, my board is a v1.2a.
> 
> Thanks,
> Conor.
> 
> 1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10


No, this is not a issue. 
These patches need to rely on the yt8531 phy driver of motorcomm company
and the corresponding clock delay configuration to work normally, 
and the yt8531 phy driver is being submitted. I have applied the
motorcomm patchs during my test on board v1.2b, so the ethernet cannot work without
the application of the motorcomm patchs. 

For the patchs of yt8531, see [1]

1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/

Thanks,
Yanhong.

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
  2023-01-18 15:51     ` Krzysztof Kozlowski
@ 2023-02-03  3:14       ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  3:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/1/18 23:51, Krzysztof Kozlowski wrote:
> On 18/01/2023 07:17, Yanhong Wang wrote:
>> Add JH7110 ethernet device node to support gmac driver for the JH7110
>> RISC-V SoC.
>> 
>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>> ---
>>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>>  1 file changed, 93 insertions(+)
>> 
>> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>> index c22e8f1d2640..c6de6e3b1a25 100644
>> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
>> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>> @@ -433,5 +433,98 @@
>>  			reg-shift = <2>;
>>  			status = "disabled";
>>  		};
>> +
>> +		stmmac_axi_setup: stmmac-axi-config {
> 
> Why your bindings example is different?
> 

There are two gmacs on the StarFive VF2 board, and the two
gmacs use the same configuration on axi, so the 
stmmac_axi_setup is independent, which is different
from the bindings example.


> Were the bindings tested? Ahh, no they were not... Can you send only
> tested patches?
> 
> Was this tested?
> 
Yes, the bindings have been tested on the StarFive VF2 board and work normally.

>> +			snps,lpi_en;
>> +			snps,wr_osr_lmt = <4>;
>> +			snps,rd_osr_lmt = <4>;
>> +			snps,blen = <256 128 64 32 0 0 0>;
>> +		};
>> +
> 
> Best regards,
> Krzysztof
> 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
@ 2023-02-03  3:14       ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  3:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/1/18 23:51, Krzysztof Kozlowski wrote:
> On 18/01/2023 07:17, Yanhong Wang wrote:
>> Add JH7110 ethernet device node to support gmac driver for the JH7110
>> RISC-V SoC.
>> 
>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>> ---
>>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>>  1 file changed, 93 insertions(+)
>> 
>> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>> index c22e8f1d2640..c6de6e3b1a25 100644
>> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
>> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>> @@ -433,5 +433,98 @@
>>  			reg-shift = <2>;
>>  			status = "disabled";
>>  		};
>> +
>> +		stmmac_axi_setup: stmmac-axi-config {
> 
> Why your bindings example is different?
> 

There are two gmacs on the StarFive VF2 board, and the two
gmacs use the same configuration on axi, so the 
stmmac_axi_setup is independent, which is different
from the bindings example.


> Were the bindings tested? Ahh, no they were not... Can you send only
> tested patches?
> 
> Was this tested?
> 
Yes, the bindings have been tested on the StarFive VF2 board and work normally.

>> +			snps,lpi_en;
>> +			snps,wr_osr_lmt = <4>;
>> +			snps,rd_osr_lmt = <4>;
>> +			snps,blen = <256 128 64 32 0 0 0>;
>> +		};
>> +
> 
> Best regards,
> Krzysztof
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 4/7] dt-bindings: net: Add support StarFive dwmac
  2023-01-18 15:49     ` Krzysztof Kozlowski
@ 2023-02-03  5:58       ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  5:58 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/1/18 23:49, Krzysztof Kozlowski wrote:
> On 18/01/2023 07:16, Yanhong Wang wrote:
>> Add documentation to describe StarFive dwmac driver(GMAC).
>> 
>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> 
> 
> Subject is poor. You miss device prefix and it's not correct sentence.
> 
> "Add support for XYZ"
> or better:
> "Add XYZ"
> 

Thanks. I will change to "Add support for JH7110" in the next version.

> 
>> ---
>>  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
>>  .../bindings/net/starfive,jh7110-dwmac.yaml   | 113 ++++++++++++++++++
>>  MAINTAINERS                                   |   5 +
>>  3 files changed, 119 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>> 
>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> index baf2c5b9e92d..8b07bc9c8b00 100644
>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> @@ -91,6 +91,7 @@ properties:
>>          - snps,dwmac-5.20
>>          - snps,dwxgmac
>>          - snps,dwxgmac-2.10
>> +        - starfive,jh7110-dwmac
>>  
>>    reg:
>>      minItems: 1
>> diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>> new file mode 100644
>> index 000000000000..eb0767da834a
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>> @@ -0,0 +1,113 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +# Copyright (C) 2022 StarFive Technology Co., Ltd.
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/net/starfive,jh7110-dwmac.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: StarFive JH7110 DWMAC glue layer
>> +
>> +maintainers:
>> +  - Yanhong Wang <yanhong.wang@starfivetech.com>
>> +
>> +select:
>> +  properties:
>> +    compatible:
>> +      contains:
>> +        enum:
>> +          - starfive,jh7110-dwmac
>> +  required:
>> +    - compatible
>> +
>> +properties:
>> +  compatible:
>> +    items:
>> +      - enum:
>> +          - starfive,jh7110-dwmac
>> +      - const: snps,dwmac-5.20
>> +
>> +  clocks:
>> +    items:
>> +      - description: GMAC main clock
>> +      - description: GMAC AHB clock
>> +      - description: PTP clock
>> +      - description: TX clock
>> +      - description: GTXC clock
>> +      - description: GTX clock
>> +
>> +  clock-names:
>> +    items:
>> +      - const: stmmaceth
>> +      - const: pclk
>> +      - const: ptp_ref
>> +      - const: tx
>> +      - const: gtxc
>> +      - const: gtx
>> +
>> +  resets:
>> +    items:
>> +      - description: MAC Reset signal.
> 
> Drop trailing dot
> 

I will fix.

>> +      - description: AHB Reset signal.
> 
> Ditto
> 

I will fix.

>> +
>> +  reset-names:
>> +    items:
>> +      - const: stmmaceth
>> +      - const: ahb
> 
> You have two resets. Why do you change them to three for all variants?
> It's not explained in commit 2/7, so this is confusing.
> 

Refer to the definition of clocks, define the value of maxItems slightly larger (3),
and reserve a little expandable space without affecting other definitions.
If you need to configure 3 resets in the future, you only need to define it
in individual schemas, and you don't need to adjust this item anymore.  
I will adjust maxItems to 2 in the next version.

>> +
>> +allOf:
>> +  - $ref: snps,dwmac.yaml#
>> +
>> +unevaluatedProperties: true
>> +
>> +required:
>> +  - compatible
>> +  - clocks
>> +  - clock-names
>> +  - resets
>> +  - reset-names
>> +
> 
> 
> Best regards,
> Krzysztof
> 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 4/7] dt-bindings: net: Add support StarFive dwmac
@ 2023-02-03  5:58       ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  5:58 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/1/18 23:49, Krzysztof Kozlowski wrote:
> On 18/01/2023 07:16, Yanhong Wang wrote:
>> Add documentation to describe StarFive dwmac driver(GMAC).
>> 
>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> 
> 
> Subject is poor. You miss device prefix and it's not correct sentence.
> 
> "Add support for XYZ"
> or better:
> "Add XYZ"
> 

Thanks. I will change to "Add support for JH7110" in the next version.

> 
>> ---
>>  .../devicetree/bindings/net/snps,dwmac.yaml   |   1 +
>>  .../bindings/net/starfive,jh7110-dwmac.yaml   | 113 ++++++++++++++++++
>>  MAINTAINERS                                   |   5 +
>>  3 files changed, 119 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>> 
>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> index baf2c5b9e92d..8b07bc9c8b00 100644
>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> @@ -91,6 +91,7 @@ properties:
>>          - snps,dwmac-5.20
>>          - snps,dwxgmac
>>          - snps,dwxgmac-2.10
>> +        - starfive,jh7110-dwmac
>>  
>>    reg:
>>      minItems: 1
>> diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>> new file mode 100644
>> index 000000000000..eb0767da834a
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>> @@ -0,0 +1,113 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +# Copyright (C) 2022 StarFive Technology Co., Ltd.
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/net/starfive,jh7110-dwmac.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: StarFive JH7110 DWMAC glue layer
>> +
>> +maintainers:
>> +  - Yanhong Wang <yanhong.wang@starfivetech.com>
>> +
>> +select:
>> +  properties:
>> +    compatible:
>> +      contains:
>> +        enum:
>> +          - starfive,jh7110-dwmac
>> +  required:
>> +    - compatible
>> +
>> +properties:
>> +  compatible:
>> +    items:
>> +      - enum:
>> +          - starfive,jh7110-dwmac
>> +      - const: snps,dwmac-5.20
>> +
>> +  clocks:
>> +    items:
>> +      - description: GMAC main clock
>> +      - description: GMAC AHB clock
>> +      - description: PTP clock
>> +      - description: TX clock
>> +      - description: GTXC clock
>> +      - description: GTX clock
>> +
>> +  clock-names:
>> +    items:
>> +      - const: stmmaceth
>> +      - const: pclk
>> +      - const: ptp_ref
>> +      - const: tx
>> +      - const: gtxc
>> +      - const: gtx
>> +
>> +  resets:
>> +    items:
>> +      - description: MAC Reset signal.
> 
> Drop trailing dot
> 

I will fix.

>> +      - description: AHB Reset signal.
> 
> Ditto
> 

I will fix.

>> +
>> +  reset-names:
>> +    items:
>> +      - const: stmmaceth
>> +      - const: ahb
> 
> You have two resets. Why do you change them to three for all variants?
> It's not explained in commit 2/7, so this is confusing.
> 

Refer to the definition of clocks, define the value of maxItems slightly larger (3),
and reserve a little expandable space without affecting other definitions.
If you need to configure 3 resets in the future, you only need to define it
in individual schemas, and you don't need to adjust this item anymore.  
I will adjust maxItems to 2 in the next version.

>> +
>> +allOf:
>> +  - $ref: snps,dwmac.yaml#
>> +
>> +unevaluatedProperties: true
>> +
>> +required:
>> +  - compatible
>> +  - clocks
>> +  - clock-names
>> +  - resets
>> +  - reset-names
>> +
> 
> 
> Best regards,
> Krzysztof
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
  2023-02-03  3:14       ` yanhong wang
@ 2023-02-03  7:09         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-03  7:09 UTC (permalink / raw)
  To: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 03/02/2023 04:14, yanhong wang wrote:
> 
> 
> On 2023/1/18 23:51, Krzysztof Kozlowski wrote:
>> On 18/01/2023 07:17, Yanhong Wang wrote:
>>> Add JH7110 ethernet device node to support gmac driver for the JH7110
>>> RISC-V SoC.
>>>
>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>> ---
>>>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>>>  1 file changed, 93 insertions(+)
>>>
>>> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>> index c22e8f1d2640..c6de6e3b1a25 100644
>>> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>> @@ -433,5 +433,98 @@
>>>  			reg-shift = <2>;
>>>  			status = "disabled";
>>>  		};
>>> +
>>> +		stmmac_axi_setup: stmmac-axi-config {
>>
>> Why your bindings example is different?
>>
> 
> There are two gmacs on the StarFive VF2 board, and the two
> gmacs use the same configuration on axi, so the 
> stmmac_axi_setup is independent, which is different
> from the bindings example.
> 
> 
>> Were the bindings tested? Ahh, no they were not... Can you send only
>> tested patches?
>>
>> Was this tested?
>>
> Yes, the bindings have been tested on the StarFive VF2 board and work normally.

Then please tell me how did you test the bindings on the board? How is
it even possible and how the board is related to bindings? As you could
easily see from Rob's reply they fail, so I have doubts that they were
tested. If you still claim they were - please paste the output from
testing command.


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
@ 2023-02-03  7:09         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-03  7:09 UTC (permalink / raw)
  To: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 03/02/2023 04:14, yanhong wang wrote:
> 
> 
> On 2023/1/18 23:51, Krzysztof Kozlowski wrote:
>> On 18/01/2023 07:17, Yanhong Wang wrote:
>>> Add JH7110 ethernet device node to support gmac driver for the JH7110
>>> RISC-V SoC.
>>>
>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>> ---
>>>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>>>  1 file changed, 93 insertions(+)
>>>
>>> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>> index c22e8f1d2640..c6de6e3b1a25 100644
>>> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>> @@ -433,5 +433,98 @@
>>>  			reg-shift = <2>;
>>>  			status = "disabled";
>>>  		};
>>> +
>>> +		stmmac_axi_setup: stmmac-axi-config {
>>
>> Why your bindings example is different?
>>
> 
> There are two gmacs on the StarFive VF2 board, and the two
> gmacs use the same configuration on axi, so the 
> stmmac_axi_setup is independent, which is different
> from the bindings example.
> 
> 
>> Were the bindings tested? Ahh, no they were not... Can you send only
>> tested patches?
>>
>> Was this tested?
>>
> Yes, the bindings have been tested on the StarFive VF2 board and work normally.

Then please tell me how did you test the bindings on the board? How is
it even possible and how the board is related to bindings? As you could
easily see from Rob's reply they fail, so I have doubts that they were
tested. If you still claim they were - please paste the output from
testing command.


Best regards,
Krzysztof


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
  2023-02-03  7:09         ` Krzysztof Kozlowski
@ 2023-02-03  7:40           ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  7:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/2/3 15:09, Krzysztof Kozlowski wrote:
> On 03/02/2023 04:14, yanhong wang wrote:
>> 
>> 
>> On 2023/1/18 23:51, Krzysztof Kozlowski wrote:
>>> On 18/01/2023 07:17, Yanhong Wang wrote:
>>>> Add JH7110 ethernet device node to support gmac driver for the JH7110
>>>> RISC-V SoC.
>>>>
>>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>>> ---
>>>>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>>>>  1 file changed, 93 insertions(+)
>>>>
>>>> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>>> index c22e8f1d2640..c6de6e3b1a25 100644
>>>> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>>> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>>> @@ -433,5 +433,98 @@
>>>>  			reg-shift = <2>;
>>>>  			status = "disabled";
>>>>  		};
>>>> +
>>>> +		stmmac_axi_setup: stmmac-axi-config {
>>>
>>> Why your bindings example is different?
>>>
>> 
>> There are two gmacs on the StarFive VF2 board, and the two
>> gmacs use the same configuration on axi, so the 
>> stmmac_axi_setup is independent, which is different
>> from the bindings example.
>> 
>> 
>>> Were the bindings tested? Ahh, no they were not... Can you send only
>>> tested patches?
>>>
>>> Was this tested?
>>>
>> Yes, the bindings have been tested on the StarFive VF2 board and work normally.
> 
> Then please tell me how did you test the bindings on the board? How is
> it even possible and how the board is related to bindings? As you could
> easily see from Rob's reply they fail, so I have doubts that they were
> tested. If you still claim they were - please paste the output from
> testing command.
> 

Sorry, I didn't check all the bindings, only the modified ones, the command 
used is as follows: 
"make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/snps,dwmac.yaml"
"make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml"

> 
> Best regards,
> Krzysztof
> 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
@ 2023-02-03  7:40           ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  7:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/2/3 15:09, Krzysztof Kozlowski wrote:
> On 03/02/2023 04:14, yanhong wang wrote:
>> 
>> 
>> On 2023/1/18 23:51, Krzysztof Kozlowski wrote:
>>> On 18/01/2023 07:17, Yanhong Wang wrote:
>>>> Add JH7110 ethernet device node to support gmac driver for the JH7110
>>>> RISC-V SoC.
>>>>
>>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>>> ---
>>>>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>>>>  1 file changed, 93 insertions(+)
>>>>
>>>> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>>> index c22e8f1d2640..c6de6e3b1a25 100644
>>>> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>>> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
>>>> @@ -433,5 +433,98 @@
>>>>  			reg-shift = <2>;
>>>>  			status = "disabled";
>>>>  		};
>>>> +
>>>> +		stmmac_axi_setup: stmmac-axi-config {
>>>
>>> Why your bindings example is different?
>>>
>> 
>> There are two gmacs on the StarFive VF2 board, and the two
>> gmacs use the same configuration on axi, so the 
>> stmmac_axi_setup is independent, which is different
>> from the bindings example.
>> 
>> 
>>> Were the bindings tested? Ahh, no they were not... Can you send only
>>> tested patches?
>>>
>>> Was this tested?
>>>
>> Yes, the bindings have been tested on the StarFive VF2 board and work normally.
> 
> Then please tell me how did you test the bindings on the board? How is
> it even possible and how the board is related to bindings? As you could
> easily see from Rob's reply they fail, so I have doubts that they were
> tested. If you still claim they were - please paste the output from
> testing command.
> 

Sorry, I didn't check all the bindings, only the modified ones, the command 
used is as follows: 
"make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/snps,dwmac.yaml"
"make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml"

> 
> Best regards,
> Krzysztof
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
  2023-02-03  7:40           ` yanhong wang
@ 2023-02-03  7:56             ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-03  7:56 UTC (permalink / raw)
  To: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 03/02/2023 08:40, yanhong wang wrote:
>>
> 
> Sorry, I didn't check all the bindings, only the modified ones, the command 
> used is as follows: 
> "make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/snps,dwmac.yaml"
> "make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml"

That's good actually, except that you change binding used by others, so
you affect other files.

However in this DTS you will have now warnings (dtbs_check with
simple-bus or dtbs W=1) because of using non-MMIO node in your soc-bus.
The stmmac-axi-config probably should be moved outside of soc node. Or
you keep two of them - one in each ethernet node.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
@ 2023-02-03  7:56             ` Krzysztof Kozlowski
  0 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-03  7:56 UTC (permalink / raw)
  To: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 03/02/2023 08:40, yanhong wang wrote:
>>
> 
> Sorry, I didn't check all the bindings, only the modified ones, the command 
> used is as follows: 
> "make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/snps,dwmac.yaml"
> "make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml"

That's good actually, except that you change binding used by others, so
you affect other files.

However in this DTS you will have now warnings (dtbs_check with
simple-bus or dtbs W=1) because of using non-MMIO node in your soc-bus.
The stmmac-axi-config probably should be moved outside of soc node. Or
you keep two of them - one in each ethernet node.

Best regards,
Krzysztof


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
  2023-02-03  7:56             ` Krzysztof Kozlowski
@ 2023-02-03  9:01               ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  9:01 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/2/3 15:56, Krzysztof Kozlowski wrote:
> On 03/02/2023 08:40, yanhong wang wrote:
>>>
>> 
>> Sorry, I didn't check all the bindings, only the modified ones, the command 
>> used is as follows: 
>> "make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/snps,dwmac.yaml"
>> "make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml"
> 
> That's good actually, except that you change binding used by others, so
> you affect other files.
> 
> However in this DTS you will have now warnings (dtbs_check with
> simple-bus or dtbs W=1) because of using non-MMIO node in your soc-bus.
> The stmmac-axi-config probably should be moved outside of soc node. Or
> you keep two of them - one in each ethernet node.
> 

Thanks. The stmmac-axi-config probably will be moved outside of soc node in the next version.

> Best regards,
> Krzysztof
> 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
@ 2023-02-03  9:01               ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-03  9:01 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/2/3 15:56, Krzysztof Kozlowski wrote:
> On 03/02/2023 08:40, yanhong wang wrote:
>>>
>> 
>> Sorry, I didn't check all the bindings, only the modified ones, the command 
>> used is as follows: 
>> "make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/snps,dwmac.yaml"
>> "make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml"
> 
> That's good actually, except that you change binding used by others, so
> you affect other files.
> 
> However in this DTS you will have now warnings (dtbs_check with
> simple-bus or dtbs W=1) because of using non-MMIO node in your soc-bus.
> The stmmac-axi-config probably should be moved outside of soc node. Or
> you keep two of them - one in each ethernet node.
> 

Thanks. The stmmac-axi-config probably will be moved outside of soc node in the next version.

> Best regards,
> Krzysztof
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
  2023-02-03  3:02     ` yanhong wang
@ 2023-02-04 14:22       ` Conor Dooley
  -1 siblings, 0 replies; 72+ messages in thread
From: Conor Dooley @ 2023-02-04 14:22 UTC (permalink / raw)
  To: yanhong wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis



On 3 February 2023 04:02:54 GMT+01:00, yanhong wang <yanhong.wang@starfivetech.com> wrote:
>
>
>On 2023/1/19 7:21, Conor Dooley wrote:
>> Hey Yanhong!
>> 
>> On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
>>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
>>> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
>>> For more information and support, you can visit RVspace wiki[1].
>>> 	
>>> This patchset should be applied after the patchset [2], [3], [4].
>>> [1] https://wiki.rvspace.org/
>>> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
>>> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
>>> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/
>> 
>> I've got those series applied, albeit locally, since they're not ready,
>> but I cannot get the Ethernet to work properly on my board.
>> I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
>> The fact that I am getting to the kernel in the first place means the
>> ethernet is working in the factory supplied U-Boot [1].
>> 
>> However, in Linux this ethernet port does not appear to work at all.
>> The other ethernet port is functional in Linux, but not in the factory
>> supplied U-Boot.
>> 
>> Is this a known issue? If it's not, I'll post the logs somewhere for
>> you. In case it is relevant, my board is a v1.2a.
>> 
>> Thanks,
>> Conor.
>> 
>> 1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10
>
>
>No, this is not a issue. 
>These patches need to rely on the yt8531 phy driver of motorcomm company
>and the corresponding clock delay configuration to work normally, 
>and the yt8531 phy driver is being submitted. I have applied the
>motorcomm patchs during my test on board v1.2b, so the ethernet cannot work without
>the application of the motorcomm patchs. 
>
>For the patchs of yt8531, see [1]
>
>1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/

Please put that info into the cover of the next round of your submission then.

Thanks,
Conor.


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
@ 2023-02-04 14:22       ` Conor Dooley
  0 siblings, 0 replies; 72+ messages in thread
From: Conor Dooley @ 2023-02-04 14:22 UTC (permalink / raw)
  To: yanhong wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis



On 3 February 2023 04:02:54 GMT+01:00, yanhong wang <yanhong.wang@starfivetech.com> wrote:
>
>
>On 2023/1/19 7:21, Conor Dooley wrote:
>> Hey Yanhong!
>> 
>> On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
>>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
>>> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
>>> For more information and support, you can visit RVspace wiki[1].
>>> 	
>>> This patchset should be applied after the patchset [2], [3], [4].
>>> [1] https://wiki.rvspace.org/
>>> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
>>> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
>>> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/
>> 
>> I've got those series applied, albeit locally, since they're not ready,
>> but I cannot get the Ethernet to work properly on my board.
>> I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
>> The fact that I am getting to the kernel in the first place means the
>> ethernet is working in the factory supplied U-Boot [1].
>> 
>> However, in Linux this ethernet port does not appear to work at all.
>> The other ethernet port is functional in Linux, but not in the factory
>> supplied U-Boot.
>> 
>> Is this a known issue? If it's not, I'll post the logs somewhere for
>> you. In case it is relevant, my board is a v1.2a.
>> 
>> Thanks,
>> Conor.
>> 
>> 1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10
>
>
>No, this is not a issue. 
>These patches need to rely on the yt8531 phy driver of motorcomm company
>and the corresponding clock delay configuration to work normally, 
>and the yt8531 phy driver is being submitted. I have applied the
>motorcomm patchs during my test on board v1.2b, so the ethernet cannot work without
>the application of the motorcomm patchs. 
>
>For the patchs of yt8531, see [1]
>
>1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/

Please put that info into the cover of the next round of your submission then.

Thanks,
Conor.


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
  2023-02-04 14:22       ` Conor Dooley
@ 2023-02-04 17:16         ` Andrew Lunn
  -1 siblings, 0 replies; 72+ messages in thread
From: Andrew Lunn @ 2023-02-04 17:16 UTC (permalink / raw)
  To: Conor Dooley
  Cc: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Heiner Kallweit, Peter Geis

> >For the patchs of yt8531, see [1]
> >
> >1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
> 
> Please put that info into the cover of the next round of your submission then.

These patches just got merged, so it is less of an issue now. Just
make sure you are testing with net-next.

You might need an updated DT blob, the binding for the PHY had a few
changes between the initial version to what actually got merged.

     Andrew

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
@ 2023-02-04 17:16         ` Andrew Lunn
  0 siblings, 0 replies; 72+ messages in thread
From: Andrew Lunn @ 2023-02-04 17:16 UTC (permalink / raw)
  To: Conor Dooley
  Cc: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Heiner Kallweit, Peter Geis

> >For the patchs of yt8531, see [1]
> >
> >1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
> 
> Please put that info into the cover of the next round of your submission then.

These patches just got merged, so it is less of an issue now. Just
make sure you are testing with net-next.

You might need an updated DT blob, the binding for the PHY had a few
changes between the initial version to what actually got merged.

     Andrew

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
  2023-02-04 17:16         ` Andrew Lunn
@ 2023-02-05 10:11           ` Conor Dooley
  -1 siblings, 0 replies; 72+ messages in thread
From: Conor Dooley @ 2023-02-05 10:11 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Heiner Kallweit, Peter Geis



On 4 February 2023 18:16:44 GMT+01:00, Andrew Lunn <andrew@lunn.ch> wrote:
>> >For the patchs of yt8531, see [1]
>> >
>> >1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
>> 
>> Please put that info into the cover of the next round of your submission then.
>
>These patches just got merged, so it is less of an issue now. Just
>make sure you are testing with net-next.

Oh, cool. Water under the bridge so.
Sorry for the noise!

>You might need an updated DT blob, the binding for the PHY had a few
>changes between the initial version to what actually got merged.

Cool, thanks,
Conor.

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
@ 2023-02-05 10:11           ` Conor Dooley
  0 siblings, 0 replies; 72+ messages in thread
From: Conor Dooley @ 2023-02-05 10:11 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Heiner Kallweit, Peter Geis



On 4 February 2023 18:16:44 GMT+01:00, Andrew Lunn <andrew@lunn.ch> wrote:
>> >For the patchs of yt8531, see [1]
>> >
>> >1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
>> 
>> Please put that info into the cover of the next round of your submission then.
>
>These patches just got merged, so it is less of an issue now. Just
>make sure you are testing with net-next.

Oh, cool. Water under the bridge so.
Sorry for the noise!

>You might need an updated DT blob, the binding for the PHY had a few
>changes between the initial version to what actually got merged.

Cool, thanks,
Conor.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
  2023-02-04 14:22       ` Conor Dooley
@ 2023-02-06  1:05         ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-06  1:05 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/2/4 22:22, Conor Dooley wrote:
> 
> 
> On 3 February 2023 04:02:54 GMT+01:00, yanhong wang <yanhong.wang@starfivetech.com> wrote:
>>
>>
>>On 2023/1/19 7:21, Conor Dooley wrote:
>>> Hey Yanhong!
>>> 
>>> On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
>>>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
>>>> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
>>>> For more information and support, you can visit RVspace wiki[1].
>>>> 	
>>>> This patchset should be applied after the patchset [2], [3], [4].
>>>> [1] https://wiki.rvspace.org/
>>>> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
>>>> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
>>>> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/
>>> 
>>> I've got those series applied, albeit locally, since they're not ready,
>>> but I cannot get the Ethernet to work properly on my board.
>>> I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
>>> The fact that I am getting to the kernel in the first place means the
>>> ethernet is working in the factory supplied U-Boot [1].
>>> 
>>> However, in Linux this ethernet port does not appear to work at all.
>>> The other ethernet port is functional in Linux, but not in the factory
>>> supplied U-Boot.
>>> 
>>> Is this a known issue? If it's not, I'll post the logs somewhere for
>>> you. In case it is relevant, my board is a v1.2a.
>>> 
>>> Thanks,
>>> Conor.
>>> 
>>> 1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10
>>
>>
>>No, this is not a issue. 
>>These patches need to rely on the yt8531 phy driver of motorcomm company
>>and the corresponding clock delay configuration to work normally, 
>>and the yt8531 phy driver is being submitted. I have applied the
>>motorcomm patchs during my test on board v1.2b, so the ethernet cannot work without
>>the application of the motorcomm patchs. 
>>
>>For the patchs of yt8531, see [1]
>>
>>1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
> 
> Please put that info into the cover of the next round of your submission then.
> 

I will put the info into the cover letter in the next version.

> Thanks,
> Conor.
> 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
@ 2023-02-06  1:05         ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-06  1:05 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/2/4 22:22, Conor Dooley wrote:
> 
> 
> On 3 February 2023 04:02:54 GMT+01:00, yanhong wang <yanhong.wang@starfivetech.com> wrote:
>>
>>
>>On 2023/1/19 7:21, Conor Dooley wrote:
>>> Hey Yanhong!
>>> 
>>> On Wed, Jan 18, 2023 at 02:16:54PM +0800, Yanhong Wang wrote:
>>>> This series adds ethernet support for the StarFive JH7110 RISC-V SoC. The series
>>>> includes MAC driver. The MAC version is dwmac-5.20 (from Synopsys DesignWare).
>>>> For more information and support, you can visit RVspace wiki[1].
>>>> 	
>>>> This patchset should be applied after the patchset [2], [3], [4].
>>>> [1] https://wiki.rvspace.org/
>>>> [2] https://lore.kernel.org/all/20221118010627.70576-1-hal.feng@starfivetech.com/
>>>> [3] https://lore.kernel.org/all/20221118011108.70715-1-hal.feng@starfivetech.com/
>>>> [4] https://lore.kernel.org/all/20221118011714.70877-1-hal.feng@starfivetech.com/
>>> 
>>> I've got those series applied, albeit locally, since they're not ready,
>>> but I cannot get the Ethernet to work properly on my board.
>>> I boot all of my dev boards w/ tftp, and the visionfive2 is no exception.
>>> The fact that I am getting to the kernel in the first place means the
>>> ethernet is working in the factory supplied U-Boot [1].
>>> 
>>> However, in Linux this ethernet port does not appear to work at all.
>>> The other ethernet port is functional in Linux, but not in the factory
>>> supplied U-Boot.
>>> 
>>> Is this a known issue? If it's not, I'll post the logs somewhere for
>>> you. In case it is relevant, my board is a v1.2a.
>>> 
>>> Thanks,
>>> Conor.
>>> 
>>> 1 - U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10
>>
>>
>>No, this is not a issue. 
>>These patches need to rely on the yt8531 phy driver of motorcomm company
>>and the corresponding clock delay configuration to work normally, 
>>and the yt8531 phy driver is being submitted. I have applied the
>>motorcomm patchs during my test on board v1.2b, so the ethernet cannot work without
>>the application of the motorcomm patchs. 
>>
>>For the patchs of yt8531, see [1]
>>
>>1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
> 
> Please put that info into the cover of the next round of your submission then.
> 

I will put the info into the cover letter in the next version.

> Thanks,
> Conor.
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
  2023-02-04 17:16         ` Andrew Lunn
@ 2023-02-06  1:15           ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-06  1:15 UTC (permalink / raw)
  To: Andrew Lunn, Conor Dooley
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Heiner Kallweit, Peter Geis



On 2023/2/5 1:16, Andrew Lunn wrote:
>> >For the patchs of yt8531, see [1]
>> >
>> >1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
>> 
>> Please put that info into the cover of the next round of your submission then.
> 
> These patches just got merged, so it is less of an issue now. Just
> make sure you are testing with net-next.
> 
> You might need an updated DT blob, the binding for the PHY had a few
> changes between the initial version to what actually got merged.
> 

I will update the DT blob about the binding for the PHY in the next version.

>      Andrew

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC
@ 2023-02-06  1:15           ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-06  1:15 UTC (permalink / raw)
  To: Andrew Lunn, Conor Dooley
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Heiner Kallweit, Peter Geis



On 2023/2/5 1:16, Andrew Lunn wrote:
>> >For the patchs of yt8531, see [1]
>> >
>> >1 - https://patchwork.kernel.org/project/netdevbpf/cover/20230202030037.9075-1-Frank.Sae@motor-comm.com/
>> 
>> Please put that info into the cover of the next round of your submission then.
> 
> These patches just got merged, so it is less of an issue now. Just
> make sure you are testing with net-next.
> 
> You might need an updated DT blob, the binding for the PHY had a few
> changes between the initial version to what actually got merged.
> 

I will update the DT blob about the binding for the PHY in the next version.

>      Andrew

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
  2023-01-18 15:47     ` Krzysztof Kozlowski
@ 2023-02-07  2:43       ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-07  2:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/1/18 23:47, Krzysztof Kozlowski wrote:
> On 18/01/2023 07:16, Yanhong Wang wrote:
>> Some boards(such as StarFive VisionFive v2) require more than one value
>> which defined by resets property, so the original definition can not
>> meet the requirements. In order to adapt to different requirements,
>> adjust the maxitems number definition.
>> 
>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>> ---
>>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>>  1 file changed, 3 insertions(+), 6 deletions(-)
>> 
>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> index e26c3e76ebb7..baf2c5b9e92d 100644
>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> @@ -133,12 +133,9 @@ properties:
>>          - ptp_ref
>>  
>>    resets:
>> -    maxItems: 1
> 
> Also, this does not make sense on its own and messes constraints for all
> other users. So another no for entire patch.
> 

Thanks. Change the properties of 'resets' and reset-names like this:

  resets:
    minItems: 1
    maxItems: 2

  reset-names:
    minItems: 1
    maxItems: 2

Is it right?  Do you have any other better suggestions?

> Best regards,
> Krzysztof
> 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
@ 2023-02-07  2:43       ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-07  2:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/1/18 23:47, Krzysztof Kozlowski wrote:
> On 18/01/2023 07:16, Yanhong Wang wrote:
>> Some boards(such as StarFive VisionFive v2) require more than one value
>> which defined by resets property, so the original definition can not
>> meet the requirements. In order to adapt to different requirements,
>> adjust the maxitems number definition.
>> 
>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>> ---
>>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>>  1 file changed, 3 insertions(+), 6 deletions(-)
>> 
>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> index e26c3e76ebb7..baf2c5b9e92d 100644
>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> @@ -133,12 +133,9 @@ properties:
>>          - ptp_ref
>>  
>>    resets:
>> -    maxItems: 1
> 
> Also, this does not make sense on its own and messes constraints for all
> other users. So another no for entire patch.
> 

Thanks. Change the properties of 'resets' and reset-names like this:

  resets:
    minItems: 1
    maxItems: 2

  reset-names:
    minItems: 1
    maxItems: 2

Is it right?  Do you have any other better suggestions?

> Best regards,
> Krzysztof
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
  2023-02-07  2:43       ` yanhong wang
@ 2023-02-07  7:59         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-07  7:59 UTC (permalink / raw)
  To: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 07/02/2023 03:43, yanhong wang wrote:
> 
> 
> On 2023/1/18 23:47, Krzysztof Kozlowski wrote:
>> On 18/01/2023 07:16, Yanhong Wang wrote:
>>> Some boards(such as StarFive VisionFive v2) require more than one value
>>> which defined by resets property, so the original definition can not
>>> meet the requirements. In order to adapt to different requirements,
>>> adjust the maxitems number definition.
>>>
>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>> ---
>>>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>>>  1 file changed, 3 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>> index e26c3e76ebb7..baf2c5b9e92d 100644
>>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>> @@ -133,12 +133,9 @@ properties:
>>>          - ptp_ref
>>>  
>>>    resets:
>>> -    maxItems: 1
>>
>> Also, this does not make sense on its own and messes constraints for all
>> other users. So another no for entire patch.
>>
> 
> Thanks. Change the properties of 'resets' and reset-names like this:
> 
>   resets:
>     minItems: 1
>     maxItems: 2
> 
>   reset-names:
>     minItems: 1
>     maxItems: 2
> 
> Is it right?  Do you have any other better suggestions?

Isn't this allowing two reset items for every variant of snps,dwmac?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
@ 2023-02-07  7:59         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-07  7:59 UTC (permalink / raw)
  To: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 07/02/2023 03:43, yanhong wang wrote:
> 
> 
> On 2023/1/18 23:47, Krzysztof Kozlowski wrote:
>> On 18/01/2023 07:16, Yanhong Wang wrote:
>>> Some boards(such as StarFive VisionFive v2) require more than one value
>>> which defined by resets property, so the original definition can not
>>> meet the requirements. In order to adapt to different requirements,
>>> adjust the maxitems number definition.
>>>
>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>> ---
>>>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>>>  1 file changed, 3 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>> index e26c3e76ebb7..baf2c5b9e92d 100644
>>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>> @@ -133,12 +133,9 @@ properties:
>>>          - ptp_ref
>>>  
>>>    resets:
>>> -    maxItems: 1
>>
>> Also, this does not make sense on its own and messes constraints for all
>> other users. So another no for entire patch.
>>
> 
> Thanks. Change the properties of 'resets' and reset-names like this:
> 
>   resets:
>     minItems: 1
>     maxItems: 2
> 
>   reset-names:
>     minItems: 1
>     maxItems: 2
> 
> Is it right?  Do you have any other better suggestions?

Isn't this allowing two reset items for every variant of snps,dwmac?

Best regards,
Krzysztof


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
  2023-02-07  7:59         ` Krzysztof Kozlowski
@ 2023-02-15  7:46           ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-15  7:46 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/2/7 15:59, Krzysztof Kozlowski wrote:
> On 07/02/2023 03:43, yanhong wang wrote:
>> 
>> 
>> On 2023/1/18 23:47, Krzysztof Kozlowski wrote:
>>> On 18/01/2023 07:16, Yanhong Wang wrote:
>>>> Some boards(such as StarFive VisionFive v2) require more than one value
>>>> which defined by resets property, so the original definition can not
>>>> meet the requirements. In order to adapt to different requirements,
>>>> adjust the maxitems number definition.
>>>>
>>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>>> ---
>>>>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>>>>  1 file changed, 3 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>> index e26c3e76ebb7..baf2c5b9e92d 100644
>>>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>> @@ -133,12 +133,9 @@ properties:
>>>>          - ptp_ref
>>>>  
>>>>    resets:
>>>> -    maxItems: 1
>>>
>>> Also, this does not make sense on its own and messes constraints for all
>>> other users. So another no for entire patch.
>>>
>> 
>> Thanks. Change the properties of 'resets' and reset-names like this:
>> 
>>   resets:
>>     minItems: 1
>>     maxItems: 2
>> 
>>   reset-names:
>>     minItems: 1
>>     maxItems: 2
>> 
>> Is it right?  Do you have any other better suggestions?
> 
> Isn't this allowing two reset items for every variant of snps,dwmac?
> 

Sorry for not getting back to you faster.
After referring to the above modification, i used the command 'make DT_CHECKER_FLAGS=-m dt_binding_check'
to check all the bindings(including 'starfive,jh7110-dwmac.yaml'), no errors are reported,
and the errors reported by Rob Herring are gone.

> Best regards,
> Krzysztof
> 

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
@ 2023-02-15  7:46           ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-15  7:46 UTC (permalink / raw)
  To: Krzysztof Kozlowski, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis



On 2023/2/7 15:59, Krzysztof Kozlowski wrote:
> On 07/02/2023 03:43, yanhong wang wrote:
>> 
>> 
>> On 2023/1/18 23:47, Krzysztof Kozlowski wrote:
>>> On 18/01/2023 07:16, Yanhong Wang wrote:
>>>> Some boards(such as StarFive VisionFive v2) require more than one value
>>>> which defined by resets property, so the original definition can not
>>>> meet the requirements. In order to adapt to different requirements,
>>>> adjust the maxitems number definition.
>>>>
>>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>>> ---
>>>>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>>>>  1 file changed, 3 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>> index e26c3e76ebb7..baf2c5b9e92d 100644
>>>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>> @@ -133,12 +133,9 @@ properties:
>>>>          - ptp_ref
>>>>  
>>>>    resets:
>>>> -    maxItems: 1
>>>
>>> Also, this does not make sense on its own and messes constraints for all
>>> other users. So another no for entire patch.
>>>
>> 
>> Thanks. Change the properties of 'resets' and reset-names like this:
>> 
>>   resets:
>>     minItems: 1
>>     maxItems: 2
>> 
>>   reset-names:
>>     minItems: 1
>>     maxItems: 2
>> 
>> Is it right?  Do you have any other better suggestions?
> 
> Isn't this allowing two reset items for every variant of snps,dwmac?
> 

Sorry for not getting back to you faster.
After referring to the above modification, i used the command 'make DT_CHECKER_FLAGS=-m dt_binding_check'
to check all the bindings(including 'starfive,jh7110-dwmac.yaml'), no errors are reported,
and the errors reported by Rob Herring are gone.

> Best regards,
> Krzysztof
> 

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
  2023-02-15  7:46           ` yanhong wang
@ 2023-02-16  8:13             ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-16  8:13 UTC (permalink / raw)
  To: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 15/02/2023 08:46, yanhong wang wrote:
> 
> 
> On 2023/2/7 15:59, Krzysztof Kozlowski wrote:
>> On 07/02/2023 03:43, yanhong wang wrote:
>>>
>>>
>>> On 2023/1/18 23:47, Krzysztof Kozlowski wrote:
>>>> On 18/01/2023 07:16, Yanhong Wang wrote:
>>>>> Some boards(such as StarFive VisionFive v2) require more than one value
>>>>> which defined by resets property, so the original definition can not
>>>>> meet the requirements. In order to adapt to different requirements,
>>>>> adjust the maxitems number definition.
>>>>>
>>>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>>>> ---
>>>>>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>>>>>  1 file changed, 3 insertions(+), 6 deletions(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>>> index e26c3e76ebb7..baf2c5b9e92d 100644
>>>>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>>> @@ -133,12 +133,9 @@ properties:
>>>>>          - ptp_ref
>>>>>  
>>>>>    resets:
>>>>> -    maxItems: 1
>>>>
>>>> Also, this does not make sense on its own and messes constraints for all
>>>> other users. So another no for entire patch.
>>>>
>>>
>>> Thanks. Change the properties of 'resets' and reset-names like this:
>>>
>>>   resets:
>>>     minItems: 1
>>>     maxItems: 2
>>>
>>>   reset-names:
>>>     minItems: 1
>>>     maxItems: 2
>>>
>>> Is it right?  Do you have any other better suggestions?
>>
>> Isn't this allowing two reset items for every variant of snps,dwmac?
>>
> 
> Sorry for not getting back to you faster.
> After referring to the above modification, i used the command 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> to check all the bindings(including 'starfive,jh7110-dwmac.yaml'), no errors are reported,
> and the errors reported by Rob Herring are gone.

I don't see how does it answer my question. I claim you loosen the
constraints and allow now two resets for everyone. You say you don't see
errors. I never claimed there will be errors. I claimed what I said -
you allow now to reset everywhere, which might not be correct
description of every hardware.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names
@ 2023-02-16  8:13             ` Krzysztof Kozlowski
  0 siblings, 0 replies; 72+ messages in thread
From: Krzysztof Kozlowski @ 2023-02-16  8:13 UTC (permalink / raw)
  To: yanhong wang, linux-riscv, netdev, devicetree, linux-kernel
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Krzysztof Kozlowski, Emil Renner Berthing,
	Richard Cochran, Andrew Lunn, Heiner Kallweit, Peter Geis

On 15/02/2023 08:46, yanhong wang wrote:
> 
> 
> On 2023/2/7 15:59, Krzysztof Kozlowski wrote:
>> On 07/02/2023 03:43, yanhong wang wrote:
>>>
>>>
>>> On 2023/1/18 23:47, Krzysztof Kozlowski wrote:
>>>> On 18/01/2023 07:16, Yanhong Wang wrote:
>>>>> Some boards(such as StarFive VisionFive v2) require more than one value
>>>>> which defined by resets property, so the original definition can not
>>>>> meet the requirements. In order to adapt to different requirements,
>>>>> adjust the maxitems number definition.
>>>>>
>>>>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>>>>> ---
>>>>>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 9 +++------
>>>>>  1 file changed, 3 insertions(+), 6 deletions(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>>> index e26c3e76ebb7..baf2c5b9e92d 100644
>>>>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>>>>> @@ -133,12 +133,9 @@ properties:
>>>>>          - ptp_ref
>>>>>  
>>>>>    resets:
>>>>> -    maxItems: 1
>>>>
>>>> Also, this does not make sense on its own and messes constraints for all
>>>> other users. So another no for entire patch.
>>>>
>>>
>>> Thanks. Change the properties of 'resets' and reset-names like this:
>>>
>>>   resets:
>>>     minItems: 1
>>>     maxItems: 2
>>>
>>>   reset-names:
>>>     minItems: 1
>>>     maxItems: 2
>>>
>>> Is it right?  Do you have any other better suggestions?
>>
>> Isn't this allowing two reset items for every variant of snps,dwmac?
>>
> 
> Sorry for not getting back to you faster.
> After referring to the above modification, i used the command 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> to check all the bindings(including 'starfive,jh7110-dwmac.yaml'), no errors are reported,
> and the errors reported by Rob Herring are gone.

I don't see how does it answer my question. I claim you loosen the
constraints and allow now two resets for everyone. You say you don't see
errors. I never claimed there will be errors. I claimed what I said -
you allow now to reset everywhere, which might not be correct
description of every hardware.

Best regards,
Krzysztof


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs
  2023-01-18  6:16   ` Yanhong Wang
@ 2023-02-16 10:53     ` Emil Renner Berthing
  -1 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-16 10:53 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis

On Wed, 18 Jan 2023 at 07:20, Yanhong Wang
<yanhong.wang@starfivetech.com> wrote:
>
> This adds StarFive dwmac driver support on the StarFive JH7110 SoCs.
>
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
> ---
>  MAINTAINERS                                   |   1 +
>  drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
>  drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
>  .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
>  4 files changed, 132 insertions(+)
>  create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 56be59bb09f7..5b50b52d3dbb 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -19609,6 +19609,7 @@ F:      include/dt-bindings/clock/starfive*
>  STARFIVE DWMAC GLUE LAYER
>  M:     Yanhong Wang <yanhong.wang@starfivetech.com>
>  S:     Maintained
> +F:     Documentation/devicetree/bindings/net/dwmac-starfive-plat.c
>  F:     Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>
>  STARFIVE PINCTRL DRIVER
> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> index 31ff35174034..f9a4ad4abd54 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> @@ -235,6 +235,18 @@ config DWMAC_INTEL_PLAT
>           the stmmac device driver. This driver is used for the Intel Keem Bay
>           SoC.
>
> +config DWMAC_STARFIVE_PLAT
> +       tristate "StarFive dwmac support"
> +       depends on OF && COMMON_CLK
> +       depends on STMMAC_ETH
> +       default SOC_STARFIVE
> +       help
> +         Support for ethernet controllers on StarFive RISC-V SoCs
> +
> +         This selects the StarFive platform specific glue layer support for
> +         the stmmac device driver. This driver is used for StarFive JH7110
> +         ethernet controller.
> +
>  config DWMAC_VISCONTI
>         tristate "Toshiba Visconti DWMAC support"
>         default ARCH_VISCONTI
> diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
> index d4e12e9ace4f..a63ab0ab5071 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/Makefile
> +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
> @@ -31,6 +31,7 @@ obj-$(CONFIG_DWMAC_DWC_QOS_ETH)       += dwmac-dwc-qos-eth.o
>  obj-$(CONFIG_DWMAC_INTEL_PLAT) += dwmac-intel-plat.o
>  obj-$(CONFIG_DWMAC_GENERIC)    += dwmac-generic.o
>  obj-$(CONFIG_DWMAC_IMX8)       += dwmac-imx.o
> +obj-$(CONFIG_DWMAC_STARFIVE_PLAT)      += dwmac-starfive-plat.o

Hi Yanhong,

For the next version could you please drop the _PLAT from the config
symbol and -plat from filename. I know the intel wrapper does the
same, but it's the only one, so lets do like the majority of other
wrappers and not add more different ways of doing things.

>  obj-$(CONFIG_DWMAC_VISCONTI)   += dwmac-visconti.o
>  stmmac-platform-objs:= stmmac_platform.o
>  dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> new file mode 100644
> index 000000000000..e441d920933a
> --- /dev/null
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> @@ -0,0 +1,118 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * StarFive DWMAC platform driver
> + *
> + * Copyright(C) 2022 StarFive Technology Co., Ltd.
> + *
> + */
> +
> +#include <linux/of_device.h>
> +
> +#include "stmmac_platform.h"
> +
> +struct starfive_dwmac {
> +       struct device *dev;
> +       struct clk *clk_tx;
> +       struct clk *clk_gtx;
> +       struct clk *clk_gtxc;
> +};

I like this name. For the next version could you also
s/starfive_eth_plat_/starfive_dwmac_/ on the function/struct names
below for consistency.

> +
> +static void starfive_eth_plat_fix_mac_speed(void *priv, unsigned int speed)
> +{
> +       struct starfive_dwmac *dwmac = priv;
> +       unsigned long rate;
> +       int err;
> +
> +       rate = clk_get_rate(dwmac->clk_gtx);
> +
> +       switch (speed) {
> +       case SPEED_1000:
> +               rate = 125000000;
> +               break;
> +       case SPEED_100:
> +               rate = 25000000;
> +               break;
> +       case SPEED_10:
> +               rate = 2500000;
> +               break;
> +       default:
> +               dev_err(dwmac->dev, "invalid speed %u\n", speed);
> +               break;
> +       }
> +
> +       err = clk_set_rate(dwmac->clk_gtx, rate);
> +       if (err)
> +               dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
> +}
> +
> +static int starfive_eth_plat_probe(struct platform_device *pdev)
> +{
> +       struct plat_stmmacenet_data *plat_dat;
> +       struct stmmac_resources stmmac_res;
> +       struct starfive_dwmac *dwmac;
> +       int err;
> +
> +       err = stmmac_get_platform_resources(pdev, &stmmac_res);
> +       if (err)
> +               return err;
> +
> +       plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
> +       if (IS_ERR(plat_dat)) {
> +               dev_err(&pdev->dev, "dt configuration failed\n");
> +               return PTR_ERR(plat_dat);
> +       }
> +
> +       dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
> +       if (!dwmac)
> +               return -ENOMEM;
> +
> +       dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
> +       if (IS_ERR(dwmac->clk_tx))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
> +                                               "error getting tx clock\n");
> +
> +       dwmac->clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
> +       if (IS_ERR(dwmac->clk_gtx))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtx),
> +                                               "error getting gtx clock\n");
> +
> +       dwmac->clk_gtxc = devm_clk_get_enabled(&pdev->dev, "gtxc");
> +       if (IS_ERR(dwmac->clk_gtxc))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtxc),
> +                                               "error getting gtxc clock\n");
> +
> +       dwmac->dev = &pdev->dev;
> +       plat_dat->fix_mac_speed = starfive_eth_plat_fix_mac_speed;
> +       plat_dat->init = NULL;
> +       plat_dat->bsp_priv = dwmac;
> +       plat_dat->dma_cfg->dche = true;
> +
> +       err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
> +       if (err) {
> +               stmmac_remove_config_dt(pdev, plat_dat);
> +               return err;
> +       }
> +
> +       return 0;
> +}
> +
> +static const struct of_device_id starfive_eth_plat_match[] = {
> +       { .compatible = "starfive,jh7110-dwmac" },
> +       { }
> +};
> +
> +static struct platform_driver starfive_eth_plat_driver = {
> +       .probe  = starfive_eth_plat_probe,
> +       .remove = stmmac_pltfr_remove,
> +       .driver = {
> +               .name = "starfive-eth-plat",
> +               .pm = &stmmac_pltfr_pm_ops,
> +               .of_match_table = starfive_eth_plat_match,
> +       },
> +};
> +
> +module_platform_driver(starfive_eth_plat_driver);
> +
> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("StarFive DWMAC platform driver");
> +MODULE_AUTHOR("Yanhong Wang <yanhong.wang@starfivetech.com>");
> --
> 2.17.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs
@ 2023-02-16 10:53     ` Emil Renner Berthing
  0 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-16 10:53 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis

On Wed, 18 Jan 2023 at 07:20, Yanhong Wang
<yanhong.wang@starfivetech.com> wrote:
>
> This adds StarFive dwmac driver support on the StarFive JH7110 SoCs.
>
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
> ---
>  MAINTAINERS                                   |   1 +
>  drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
>  drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
>  .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
>  4 files changed, 132 insertions(+)
>  create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 56be59bb09f7..5b50b52d3dbb 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -19609,6 +19609,7 @@ F:      include/dt-bindings/clock/starfive*
>  STARFIVE DWMAC GLUE LAYER
>  M:     Yanhong Wang <yanhong.wang@starfivetech.com>
>  S:     Maintained
> +F:     Documentation/devicetree/bindings/net/dwmac-starfive-plat.c
>  F:     Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>
>  STARFIVE PINCTRL DRIVER
> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> index 31ff35174034..f9a4ad4abd54 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> @@ -235,6 +235,18 @@ config DWMAC_INTEL_PLAT
>           the stmmac device driver. This driver is used for the Intel Keem Bay
>           SoC.
>
> +config DWMAC_STARFIVE_PLAT
> +       tristate "StarFive dwmac support"
> +       depends on OF && COMMON_CLK
> +       depends on STMMAC_ETH
> +       default SOC_STARFIVE
> +       help
> +         Support for ethernet controllers on StarFive RISC-V SoCs
> +
> +         This selects the StarFive platform specific glue layer support for
> +         the stmmac device driver. This driver is used for StarFive JH7110
> +         ethernet controller.
> +
>  config DWMAC_VISCONTI
>         tristate "Toshiba Visconti DWMAC support"
>         default ARCH_VISCONTI
> diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
> index d4e12e9ace4f..a63ab0ab5071 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/Makefile
> +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
> @@ -31,6 +31,7 @@ obj-$(CONFIG_DWMAC_DWC_QOS_ETH)       += dwmac-dwc-qos-eth.o
>  obj-$(CONFIG_DWMAC_INTEL_PLAT) += dwmac-intel-plat.o
>  obj-$(CONFIG_DWMAC_GENERIC)    += dwmac-generic.o
>  obj-$(CONFIG_DWMAC_IMX8)       += dwmac-imx.o
> +obj-$(CONFIG_DWMAC_STARFIVE_PLAT)      += dwmac-starfive-plat.o

Hi Yanhong,

For the next version could you please drop the _PLAT from the config
symbol and -plat from filename. I know the intel wrapper does the
same, but it's the only one, so lets do like the majority of other
wrappers and not add more different ways of doing things.

>  obj-$(CONFIG_DWMAC_VISCONTI)   += dwmac-visconti.o
>  stmmac-platform-objs:= stmmac_platform.o
>  dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> new file mode 100644
> index 000000000000..e441d920933a
> --- /dev/null
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> @@ -0,0 +1,118 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * StarFive DWMAC platform driver
> + *
> + * Copyright(C) 2022 StarFive Technology Co., Ltd.
> + *
> + */
> +
> +#include <linux/of_device.h>
> +
> +#include "stmmac_platform.h"
> +
> +struct starfive_dwmac {
> +       struct device *dev;
> +       struct clk *clk_tx;
> +       struct clk *clk_gtx;
> +       struct clk *clk_gtxc;
> +};

I like this name. For the next version could you also
s/starfive_eth_plat_/starfive_dwmac_/ on the function/struct names
below for consistency.

> +
> +static void starfive_eth_plat_fix_mac_speed(void *priv, unsigned int speed)
> +{
> +       struct starfive_dwmac *dwmac = priv;
> +       unsigned long rate;
> +       int err;
> +
> +       rate = clk_get_rate(dwmac->clk_gtx);
> +
> +       switch (speed) {
> +       case SPEED_1000:
> +               rate = 125000000;
> +               break;
> +       case SPEED_100:
> +               rate = 25000000;
> +               break;
> +       case SPEED_10:
> +               rate = 2500000;
> +               break;
> +       default:
> +               dev_err(dwmac->dev, "invalid speed %u\n", speed);
> +               break;
> +       }
> +
> +       err = clk_set_rate(dwmac->clk_gtx, rate);
> +       if (err)
> +               dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
> +}
> +
> +static int starfive_eth_plat_probe(struct platform_device *pdev)
> +{
> +       struct plat_stmmacenet_data *plat_dat;
> +       struct stmmac_resources stmmac_res;
> +       struct starfive_dwmac *dwmac;
> +       int err;
> +
> +       err = stmmac_get_platform_resources(pdev, &stmmac_res);
> +       if (err)
> +               return err;
> +
> +       plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
> +       if (IS_ERR(plat_dat)) {
> +               dev_err(&pdev->dev, "dt configuration failed\n");
> +               return PTR_ERR(plat_dat);
> +       }
> +
> +       dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
> +       if (!dwmac)
> +               return -ENOMEM;
> +
> +       dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
> +       if (IS_ERR(dwmac->clk_tx))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
> +                                               "error getting tx clock\n");
> +
> +       dwmac->clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
> +       if (IS_ERR(dwmac->clk_gtx))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtx),
> +                                               "error getting gtx clock\n");
> +
> +       dwmac->clk_gtxc = devm_clk_get_enabled(&pdev->dev, "gtxc");
> +       if (IS_ERR(dwmac->clk_gtxc))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtxc),
> +                                               "error getting gtxc clock\n");
> +
> +       dwmac->dev = &pdev->dev;
> +       plat_dat->fix_mac_speed = starfive_eth_plat_fix_mac_speed;
> +       plat_dat->init = NULL;
> +       plat_dat->bsp_priv = dwmac;
> +       plat_dat->dma_cfg->dche = true;
> +
> +       err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
> +       if (err) {
> +               stmmac_remove_config_dt(pdev, plat_dat);
> +               return err;
> +       }
> +
> +       return 0;
> +}
> +
> +static const struct of_device_id starfive_eth_plat_match[] = {
> +       { .compatible = "starfive,jh7110-dwmac" },
> +       { }
> +};
> +
> +static struct platform_driver starfive_eth_plat_driver = {
> +       .probe  = starfive_eth_plat_probe,
> +       .remove = stmmac_pltfr_remove,
> +       .driver = {
> +               .name = "starfive-eth-plat",
> +               .pm = &stmmac_pltfr_pm_ops,
> +               .of_match_table = starfive_eth_plat_match,
> +       },
> +};
> +
> +module_platform_driver(starfive_eth_plat_driver);
> +
> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("StarFive DWMAC platform driver");
> +MODULE_AUTHOR("Yanhong Wang <yanhong.wang@starfivetech.com>");
> --
> 2.17.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 7/7] riscv: dts: starfive: visionfive-v2: Enable gmac device tree node
  2023-01-18  6:17   ` Yanhong Wang
@ 2023-02-20 14:05     ` Emil Renner Berthing
  -1 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-20 14:05 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis

On Wed, 18 Jan 2023 at 07:19, Yanhong Wang
<yanhong.wang@starfivetech.com> wrote:
>
> Update gmac device tree node status to okay.
>
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  .../dts/starfive/jh7110-starfive-visionfive-v2.dts     | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
> index c8946cf3a268..b22363d5f9dc 100644
> --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
> +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
> @@ -15,6 +15,8 @@
>
>         aliases {
>                 serial0 = &uart0;
> +               ethernet0 = &gmac0;
> +               ethernet1 = &gmac1;

Hi Yanhong,

Please keep these sorted alphabetically so it's obvious where the next
additions go.

/Emil
>         };
>
>         chosen {
> @@ -114,3 +116,11 @@
>         pinctrl-0 = <&uart0_pins>;
>         status = "okay";
>  };
> +
> +&gmac0 {
> +       status = "okay";
> +};
> +
> +&gmac1 {
> +       status = "okay";
> +};
> --
> 2.17.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 7/7] riscv: dts: starfive: visionfive-v2: Enable gmac device tree node
@ 2023-02-20 14:05     ` Emil Renner Berthing
  0 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-20 14:05 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis

On Wed, 18 Jan 2023 at 07:19, Yanhong Wang
<yanhong.wang@starfivetech.com> wrote:
>
> Update gmac device tree node status to okay.
>
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  .../dts/starfive/jh7110-starfive-visionfive-v2.dts     | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
> index c8946cf3a268..b22363d5f9dc 100644
> --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
> +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts
> @@ -15,6 +15,8 @@
>
>         aliases {
>                 serial0 = &uart0;
> +               ethernet0 = &gmac0;
> +               ethernet1 = &gmac1;

Hi Yanhong,

Please keep these sorted alphabetically so it's obvious where the next
additions go.

/Emil
>         };
>
>         chosen {
> @@ -114,3 +116,11 @@
>         pinctrl-0 = <&uart0_pins>;
>         status = "okay";
>  };
> +
> +&gmac0 {
> +       status = "okay";
> +};
> +
> +&gmac1 {
> +       status = "okay";
> +};
> --
> 2.17.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
  2023-01-18  6:17   ` Yanhong Wang
@ 2023-02-20 14:22     ` Emil Renner Berthing
  -1 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-20 14:22 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis

On Wed, 18 Jan 2023 at 07:19, Yanhong Wang
<yanhong.wang@starfivetech.com> wrote:
> Add JH7110 ethernet device node to support gmac driver for the JH7110
> RISC-V SoC.
>
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>  1 file changed, 93 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> index c22e8f1d2640..c6de6e3b1a25 100644
> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> @@ -433,5 +433,98 @@
>                         reg-shift = <2>;
>                         status = "disabled";
>                 };
> +
> +               stmmac_axi_setup: stmmac-axi-config {
> +                       snps,lpi_en;
> +                       snps,wr_osr_lmt = <4>;
> +                       snps,rd_osr_lmt = <4>;
> +                       snps,blen = <256 128 64 32 0 0 0>;
> +               };
> +
> +               gmac0: ethernet@16030000 {
> +                       compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
> +                       reg = <0x0 0x16030000 0x0 0x10000>;
> +                       clocks = <&aoncrg JH7110_AONCLK_GMAC0_AXI>,
> +                                <&aoncrg JH7110_AONCLK_GMAC0_AHB>,
> +                                <&syscrg JH7110_SYSCLK_GMAC0_PTP>,
> +                                <&aoncrg JH7110_AONCLK_GMAC0_TX>,

The gmac0_tx clock is a mux that takes either the gmac0_gtxclk or
rmii_rtx as parent. However it is then followed by an inverter that
optionally inverts the clock, gmac0_tx_inv. I'm guessing this
optionally inverted signal is what is actually used (otherwise why
would the inverter exist), so I think this clock is what should be
claimed here. Eg.
    <&aoncrg JH7110_AONCLK_GMAC0_TX_INV>,

Right now it works only because the inverted signal can't be gated
(turned off) even when it's not claimed by any driver.

> +                                <&syscrg JH7110_SYSCLK_GMAC0_GTXC>,
> +                                <&syscrg JH7110_SYSCLK_GMAC0_GTXCLK>;

Here the gmac0_gtxclk clock is the parent of the gmac0_gtxc, so
claiming the gmac0_gtxc should be enough. Since the gmac0_gtxc is just
a gate it should have the CLK_SET_RATE_PARENT flag set, so the driver
can just change the rate of the child and it should propagate to the
parent. In short I think claiming only the gmac0_gtxc clock should be
enough here.

> +                       clock-names = "stmmaceth", "pclk", "ptp_ref",
> +                                               "tx", "gtxc", "gtx";
> +                       resets = <&aoncrg JH7110_AONRST_GMAC0_AXI>,
> +                                <&aoncrg JH7110_AONRST_GMAC0_AHB>;
> +                       reset-names = "stmmaceth", "ahb";
> +                       interrupts = <7>, <6>, <5>;
> +                       interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
> +                       phy-mode = "rgmii-id";
> +                       snps,multicast-filter-bins = <64>;
> +                       snps,perfect-filter-entries = <8>;
> +                       rx-fifo-depth = <2048>;
> +                       tx-fifo-depth = <2048>;
> +                       snps,fixed-burst;
> +                       snps,no-pbl-x8;
> +                       snps,force_thresh_dma_mode;
> +                       snps,axi-config = <&stmmac_axi_setup>;
> +                       snps,tso;
> +                       snps,en-tx-lpi-clockgating;
> +                       snps,txpbl = <16>;
> +                       snps,rxpbl = <16>;
> +                       status = "disabled";
> +                       phy-handle = <&phy0>;
> +
> +                       mdio0: mdio {
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                               compatible = "snps,dwmac-mdio";
> +
> +                               phy0: ethernet-phy@0 {
> +                                       reg = <0>;
> +                               };
> +                       };
> +               };
> +
> +               gmac1: ethernet@16040000 {
> +                       compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
> +                       reg = <0x0 0x16040000 0x0 0x10000>;
> +                       clocks = <&syscrg JH7110_SYSCLK_GMAC1_AXI>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_AHB>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_PTP>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_TX>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_GTXC>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_GTXCLK>;
> +                       clock-names = "stmmaceth", "pclk", "ptp_ref",
> +                                       "tx", "gtxc", "gtx";
> +                       resets = <&syscrg JH7110_SYSRST_GMAC1_AXI>,
> +                                <&syscrg JH7110_SYSRST_GMAC1_AHB>;
> +                       reset-names = "stmmaceth", "ahb";
> +                       interrupts = <78>, <77>, <76>;
> +                       interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
> +                       phy-mode = "rgmii-id";
> +                       snps,multicast-filter-bins = <64>;
> +                       snps,perfect-filter-entries = <8>;
> +                       rx-fifo-depth = <2048>;
> +                       tx-fifo-depth = <2048>;
> +                       snps,fixed-burst;
> +                       snps,no-pbl-x8;
> +                       snps,force_thresh_dma_mode;
> +                       snps,axi-config = <&stmmac_axi_setup>;
> +                       snps,tso;
> +                       snps,en-tx-lpi-clockgating;
> +                       snps,txpbl = <16>;
> +                       snps,rxpbl = <16>;
> +                       status = "disabled";
> +                       phy-handle = <&phy1>;
> +
> +                       mdio1: mdio {
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                               compatible = "snps,dwmac-mdio";
> +
> +                               phy1: ethernet-phy@1 {
> +                                       reg = <1>;
> +                               };
> +                       };
> +               };
>         };
>  };
> --
> 2.17.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
@ 2023-02-20 14:22     ` Emil Renner Berthing
  0 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-20 14:22 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis

On Wed, 18 Jan 2023 at 07:19, Yanhong Wang
<yanhong.wang@starfivetech.com> wrote:
> Add JH7110 ethernet device node to support gmac driver for the JH7110
> RISC-V SoC.
>
> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> ---
>  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
>  1 file changed, 93 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> index c22e8f1d2640..c6de6e3b1a25 100644
> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> @@ -433,5 +433,98 @@
>                         reg-shift = <2>;
>                         status = "disabled";
>                 };
> +
> +               stmmac_axi_setup: stmmac-axi-config {
> +                       snps,lpi_en;
> +                       snps,wr_osr_lmt = <4>;
> +                       snps,rd_osr_lmt = <4>;
> +                       snps,blen = <256 128 64 32 0 0 0>;
> +               };
> +
> +               gmac0: ethernet@16030000 {
> +                       compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
> +                       reg = <0x0 0x16030000 0x0 0x10000>;
> +                       clocks = <&aoncrg JH7110_AONCLK_GMAC0_AXI>,
> +                                <&aoncrg JH7110_AONCLK_GMAC0_AHB>,
> +                                <&syscrg JH7110_SYSCLK_GMAC0_PTP>,
> +                                <&aoncrg JH7110_AONCLK_GMAC0_TX>,

The gmac0_tx clock is a mux that takes either the gmac0_gtxclk or
rmii_rtx as parent. However it is then followed by an inverter that
optionally inverts the clock, gmac0_tx_inv. I'm guessing this
optionally inverted signal is what is actually used (otherwise why
would the inverter exist), so I think this clock is what should be
claimed here. Eg.
    <&aoncrg JH7110_AONCLK_GMAC0_TX_INV>,

Right now it works only because the inverted signal can't be gated
(turned off) even when it's not claimed by any driver.

> +                                <&syscrg JH7110_SYSCLK_GMAC0_GTXC>,
> +                                <&syscrg JH7110_SYSCLK_GMAC0_GTXCLK>;

Here the gmac0_gtxclk clock is the parent of the gmac0_gtxc, so
claiming the gmac0_gtxc should be enough. Since the gmac0_gtxc is just
a gate it should have the CLK_SET_RATE_PARENT flag set, so the driver
can just change the rate of the child and it should propagate to the
parent. In short I think claiming only the gmac0_gtxc clock should be
enough here.

> +                       clock-names = "stmmaceth", "pclk", "ptp_ref",
> +                                               "tx", "gtxc", "gtx";
> +                       resets = <&aoncrg JH7110_AONRST_GMAC0_AXI>,
> +                                <&aoncrg JH7110_AONRST_GMAC0_AHB>;
> +                       reset-names = "stmmaceth", "ahb";
> +                       interrupts = <7>, <6>, <5>;
> +                       interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
> +                       phy-mode = "rgmii-id";
> +                       snps,multicast-filter-bins = <64>;
> +                       snps,perfect-filter-entries = <8>;
> +                       rx-fifo-depth = <2048>;
> +                       tx-fifo-depth = <2048>;
> +                       snps,fixed-burst;
> +                       snps,no-pbl-x8;
> +                       snps,force_thresh_dma_mode;
> +                       snps,axi-config = <&stmmac_axi_setup>;
> +                       snps,tso;
> +                       snps,en-tx-lpi-clockgating;
> +                       snps,txpbl = <16>;
> +                       snps,rxpbl = <16>;
> +                       status = "disabled";
> +                       phy-handle = <&phy0>;
> +
> +                       mdio0: mdio {
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                               compatible = "snps,dwmac-mdio";
> +
> +                               phy0: ethernet-phy@0 {
> +                                       reg = <0>;
> +                               };
> +                       };
> +               };
> +
> +               gmac1: ethernet@16040000 {
> +                       compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
> +                       reg = <0x0 0x16040000 0x0 0x10000>;
> +                       clocks = <&syscrg JH7110_SYSCLK_GMAC1_AXI>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_AHB>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_PTP>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_TX>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_GTXC>,
> +                                <&syscrg JH7110_SYSCLK_GMAC1_GTXCLK>;
> +                       clock-names = "stmmaceth", "pclk", "ptp_ref",
> +                                       "tx", "gtxc", "gtx";
> +                       resets = <&syscrg JH7110_SYSRST_GMAC1_AXI>,
> +                                <&syscrg JH7110_SYSRST_GMAC1_AHB>;
> +                       reset-names = "stmmaceth", "ahb";
> +                       interrupts = <78>, <77>, <76>;
> +                       interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
> +                       phy-mode = "rgmii-id";
> +                       snps,multicast-filter-bins = <64>;
> +                       snps,perfect-filter-entries = <8>;
> +                       rx-fifo-depth = <2048>;
> +                       tx-fifo-depth = <2048>;
> +                       snps,fixed-burst;
> +                       snps,no-pbl-x8;
> +                       snps,force_thresh_dma_mode;
> +                       snps,axi-config = <&stmmac_axi_setup>;
> +                       snps,tso;
> +                       snps,en-tx-lpi-clockgating;
> +                       snps,txpbl = <16>;
> +                       snps,rxpbl = <16>;
> +                       status = "disabled";
> +                       phy-handle = <&phy1>;
> +
> +                       mdio1: mdio {
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +                               compatible = "snps,dwmac-mdio";
> +
> +                               phy1: ethernet-phy@1 {
> +                                       reg = <1>;
> +                               };
> +                       };
> +               };
>         };
>  };
> --
> 2.17.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
  2023-02-20 14:22     ` Emil Renner Berthing
@ 2023-02-20 15:00       ` Emil Renner Berthing
  -1 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-20 15:00 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis

On Mon, 20 Feb 2023 at 15:22, Emil Renner Berthing
<emil.renner.berthing@canonical.com> wrote:
> On Wed, 18 Jan 2023 at 07:19, Yanhong Wang
> <yanhong.wang@starfivetech.com> wrote:
> > Add JH7110 ethernet device node to support gmac driver for the JH7110
> > RISC-V SoC.
> >
> > Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> > ---
> >  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
> >  1 file changed, 93 insertions(+)
> >
> > diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> > index c22e8f1d2640..c6de6e3b1a25 100644
> > --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
> > +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> > @@ -433,5 +433,98 @@
> >                         reg-shift = <2>;
> >                         status = "disabled";
> >                 };
> > +
> > +               stmmac_axi_setup: stmmac-axi-config {
> > +                       snps,lpi_en;
> > +                       snps,wr_osr_lmt = <4>;
> > +                       snps,rd_osr_lmt = <4>;
> > +                       snps,blen = <256 128 64 32 0 0 0>;
> > +               };
> > +
> > +               gmac0: ethernet@16030000 {
> > +                       compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
> > +                       reg = <0x0 0x16030000 0x0 0x10000>;
> > +                       clocks = <&aoncrg JH7110_AONCLK_GMAC0_AXI>,
> > +                                <&aoncrg JH7110_AONCLK_GMAC0_AHB>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC0_PTP>,
> > +                                <&aoncrg JH7110_AONCLK_GMAC0_TX>,
>
> The gmac0_tx clock is a mux that takes either the gmac0_gtxclk or
> rmii_rtx as parent. However it is then followed by an inverter that
> optionally inverts the clock, gmac0_tx_inv. I'm guessing this
> optionally inverted signal is what is actually used (otherwise why
> would the inverter exist), so I think this clock is what should be
> claimed here. Eg.
>     <&aoncrg JH7110_AONCLK_GMAC0_TX_INV>,
>
> Right now it works only because the inverted signal can't be gated
> (turned off) even when it's not claimed by any driver.
>
> > +                                <&syscrg JH7110_SYSCLK_GMAC0_GTXC>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC0_GTXCLK>;
>
> Here the gmac0_gtxclk clock is the parent of the gmac0_gtxc, so
> claiming the gmac0_gtxc should be enough. Since the gmac0_gtxc is just
> a gate it should have the CLK_SET_RATE_PARENT flag set, so the driver
> can just change the rate of the child and it should propagate to the
> parent. In short I think claiming only the gmac0_gtxc clock should be
> enough here.

Oh and just for completeness. This also goes for gmac1 below, and
don't forget to update the yaml binding doc accordingly.

> > +                       clock-names = "stmmaceth", "pclk", "ptp_ref",
> > +                                               "tx", "gtxc", "gtx";
> > +                       resets = <&aoncrg JH7110_AONRST_GMAC0_AXI>,
> > +                                <&aoncrg JH7110_AONRST_GMAC0_AHB>;
> > +                       reset-names = "stmmaceth", "ahb";
> > +                       interrupts = <7>, <6>, <5>;
> > +                       interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
> > +                       phy-mode = "rgmii-id";
> > +                       snps,multicast-filter-bins = <64>;
> > +                       snps,perfect-filter-entries = <8>;
> > +                       rx-fifo-depth = <2048>;
> > +                       tx-fifo-depth = <2048>;
> > +                       snps,fixed-burst;
> > +                       snps,no-pbl-x8;
> > +                       snps,force_thresh_dma_mode;
> > +                       snps,axi-config = <&stmmac_axi_setup>;
> > +                       snps,tso;
> > +                       snps,en-tx-lpi-clockgating;
> > +                       snps,txpbl = <16>;
> > +                       snps,rxpbl = <16>;
> > +                       status = "disabled";
> > +                       phy-handle = <&phy0>;
> > +
> > +                       mdio0: mdio {
> > +                               #address-cells = <1>;
> > +                               #size-cells = <0>;
> > +                               compatible = "snps,dwmac-mdio";
> > +
> > +                               phy0: ethernet-phy@0 {
> > +                                       reg = <0>;
> > +                               };
> > +                       };
> > +               };
> > +
> > +               gmac1: ethernet@16040000 {
> > +                       compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
> > +                       reg = <0x0 0x16040000 0x0 0x10000>;
> > +                       clocks = <&syscrg JH7110_SYSCLK_GMAC1_AXI>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_AHB>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_PTP>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_TX>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_GTXC>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_GTXCLK>;
> > +                       clock-names = "stmmaceth", "pclk", "ptp_ref",
> > +                                       "tx", "gtxc", "gtx";
> > +                       resets = <&syscrg JH7110_SYSRST_GMAC1_AXI>,
> > +                                <&syscrg JH7110_SYSRST_GMAC1_AHB>;
> > +                       reset-names = "stmmaceth", "ahb";
> > +                       interrupts = <78>, <77>, <76>;
> > +                       interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
> > +                       phy-mode = "rgmii-id";
> > +                       snps,multicast-filter-bins = <64>;
> > +                       snps,perfect-filter-entries = <8>;
> > +                       rx-fifo-depth = <2048>;
> > +                       tx-fifo-depth = <2048>;
> > +                       snps,fixed-burst;
> > +                       snps,no-pbl-x8;
> > +                       snps,force_thresh_dma_mode;
> > +                       snps,axi-config = <&stmmac_axi_setup>;
> > +                       snps,tso;
> > +                       snps,en-tx-lpi-clockgating;
> > +                       snps,txpbl = <16>;
> > +                       snps,rxpbl = <16>;
> > +                       status = "disabled";
> > +                       phy-handle = <&phy1>;
> > +
> > +                       mdio1: mdio {
> > +                               #address-cells = <1>;
> > +                               #size-cells = <0>;
> > +                               compatible = "snps,dwmac-mdio";
> > +
> > +                               phy1: ethernet-phy@1 {
> > +                                       reg = <1>;
> > +                               };
> > +                       };
> > +               };
> >         };
> >  };
> > --
> > 2.17.1
> >
> >
> > _______________________________________________
> > linux-riscv mailing list
> > linux-riscv@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node
@ 2023-02-20 15:00       ` Emil Renner Berthing
  0 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-20 15:00 UTC (permalink / raw)
  To: Yanhong Wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis

On Mon, 20 Feb 2023 at 15:22, Emil Renner Berthing
<emil.renner.berthing@canonical.com> wrote:
> On Wed, 18 Jan 2023 at 07:19, Yanhong Wang
> <yanhong.wang@starfivetech.com> wrote:
> > Add JH7110 ethernet device node to support gmac driver for the JH7110
> > RISC-V SoC.
> >
> > Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> > ---
> >  arch/riscv/boot/dts/starfive/jh7110.dtsi | 93 ++++++++++++++++++++++++
> >  1 file changed, 93 insertions(+)
> >
> > diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> > index c22e8f1d2640..c6de6e3b1a25 100644
> > --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
> > +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
> > @@ -433,5 +433,98 @@
> >                         reg-shift = <2>;
> >                         status = "disabled";
> >                 };
> > +
> > +               stmmac_axi_setup: stmmac-axi-config {
> > +                       snps,lpi_en;
> > +                       snps,wr_osr_lmt = <4>;
> > +                       snps,rd_osr_lmt = <4>;
> > +                       snps,blen = <256 128 64 32 0 0 0>;
> > +               };
> > +
> > +               gmac0: ethernet@16030000 {
> > +                       compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
> > +                       reg = <0x0 0x16030000 0x0 0x10000>;
> > +                       clocks = <&aoncrg JH7110_AONCLK_GMAC0_AXI>,
> > +                                <&aoncrg JH7110_AONCLK_GMAC0_AHB>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC0_PTP>,
> > +                                <&aoncrg JH7110_AONCLK_GMAC0_TX>,
>
> The gmac0_tx clock is a mux that takes either the gmac0_gtxclk or
> rmii_rtx as parent. However it is then followed by an inverter that
> optionally inverts the clock, gmac0_tx_inv. I'm guessing this
> optionally inverted signal is what is actually used (otherwise why
> would the inverter exist), so I think this clock is what should be
> claimed here. Eg.
>     <&aoncrg JH7110_AONCLK_GMAC0_TX_INV>,
>
> Right now it works only because the inverted signal can't be gated
> (turned off) even when it's not claimed by any driver.
>
> > +                                <&syscrg JH7110_SYSCLK_GMAC0_GTXC>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC0_GTXCLK>;
>
> Here the gmac0_gtxclk clock is the parent of the gmac0_gtxc, so
> claiming the gmac0_gtxc should be enough. Since the gmac0_gtxc is just
> a gate it should have the CLK_SET_RATE_PARENT flag set, so the driver
> can just change the rate of the child and it should propagate to the
> parent. In short I think claiming only the gmac0_gtxc clock should be
> enough here.

Oh and just for completeness. This also goes for gmac1 below, and
don't forget to update the yaml binding doc accordingly.

> > +                       clock-names = "stmmaceth", "pclk", "ptp_ref",
> > +                                               "tx", "gtxc", "gtx";
> > +                       resets = <&aoncrg JH7110_AONRST_GMAC0_AXI>,
> > +                                <&aoncrg JH7110_AONRST_GMAC0_AHB>;
> > +                       reset-names = "stmmaceth", "ahb";
> > +                       interrupts = <7>, <6>, <5>;
> > +                       interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
> > +                       phy-mode = "rgmii-id";
> > +                       snps,multicast-filter-bins = <64>;
> > +                       snps,perfect-filter-entries = <8>;
> > +                       rx-fifo-depth = <2048>;
> > +                       tx-fifo-depth = <2048>;
> > +                       snps,fixed-burst;
> > +                       snps,no-pbl-x8;
> > +                       snps,force_thresh_dma_mode;
> > +                       snps,axi-config = <&stmmac_axi_setup>;
> > +                       snps,tso;
> > +                       snps,en-tx-lpi-clockgating;
> > +                       snps,txpbl = <16>;
> > +                       snps,rxpbl = <16>;
> > +                       status = "disabled";
> > +                       phy-handle = <&phy0>;
> > +
> > +                       mdio0: mdio {
> > +                               #address-cells = <1>;
> > +                               #size-cells = <0>;
> > +                               compatible = "snps,dwmac-mdio";
> > +
> > +                               phy0: ethernet-phy@0 {
> > +                                       reg = <0>;
> > +                               };
> > +                       };
> > +               };
> > +
> > +               gmac1: ethernet@16040000 {
> > +                       compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
> > +                       reg = <0x0 0x16040000 0x0 0x10000>;
> > +                       clocks = <&syscrg JH7110_SYSCLK_GMAC1_AXI>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_AHB>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_PTP>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_TX>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_GTXC>,
> > +                                <&syscrg JH7110_SYSCLK_GMAC1_GTXCLK>;
> > +                       clock-names = "stmmaceth", "pclk", "ptp_ref",
> > +                                       "tx", "gtxc", "gtx";
> > +                       resets = <&syscrg JH7110_SYSRST_GMAC1_AXI>,
> > +                                <&syscrg JH7110_SYSRST_GMAC1_AHB>;
> > +                       reset-names = "stmmaceth", "ahb";
> > +                       interrupts = <78>, <77>, <76>;
> > +                       interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
> > +                       phy-mode = "rgmii-id";
> > +                       snps,multicast-filter-bins = <64>;
> > +                       snps,perfect-filter-entries = <8>;
> > +                       rx-fifo-depth = <2048>;
> > +                       tx-fifo-depth = <2048>;
> > +                       snps,fixed-burst;
> > +                       snps,no-pbl-x8;
> > +                       snps,force_thresh_dma_mode;
> > +                       snps,axi-config = <&stmmac_axi_setup>;
> > +                       snps,tso;
> > +                       snps,en-tx-lpi-clockgating;
> > +                       snps,txpbl = <16>;
> > +                       snps,rxpbl = <16>;
> > +                       status = "disabled";
> > +                       phy-handle = <&phy1>;
> > +
> > +                       mdio1: mdio {
> > +                               #address-cells = <1>;
> > +                               #size-cells = <0>;
> > +                               compatible = "snps,dwmac-mdio";
> > +
> > +                               phy1: ethernet-phy@1 {
> > +                                       reg = <1>;
> > +                               };
> > +                       };
> > +               };
> >         };
> >  };
> > --
> > 2.17.1
> >
> >
> > _______________________________________________
> > linux-riscv mailing list
> > linux-riscv@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs
  2023-02-16 10:53     ` Emil Renner Berthing
@ 2023-02-21  2:27       ` yanhong wang
  -1 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-21  2:27 UTC (permalink / raw)
  To: Emil Renner Berthing
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis, samin.guo

add  samin.guo@starfivetech.com  to loop.

On 2023/2/16 18:53, Emil Renner Berthing wrote:
> On Wed, 18 Jan 2023 at 07:20, Yanhong Wang
> <yanhong.wang@starfivetech.com> wrote:
>>
>> This adds StarFive dwmac driver support on the StarFive JH7110 SoCs.
>>
>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>> Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
>> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
>> ---
>>  MAINTAINERS                                   |   1 +
>>  drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
>>  drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
>>  .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
>>  4 files changed, 132 insertions(+)
>>  create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 56be59bb09f7..5b50b52d3dbb 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -19609,6 +19609,7 @@ F:      include/dt-bindings/clock/starfive*
>>  STARFIVE DWMAC GLUE LAYER
>>  M:     Yanhong Wang <yanhong.wang@starfivetech.com>
>>  S:     Maintained
>> +F:     Documentation/devicetree/bindings/net/dwmac-starfive-plat.c
>>  F:     Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>>
>>  STARFIVE PINCTRL DRIVER
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
>> index 31ff35174034..f9a4ad4abd54 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
>> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
>> @@ -235,6 +235,18 @@ config DWMAC_INTEL_PLAT
>>           the stmmac device driver. This driver is used for the Intel Keem Bay
>>           SoC.
>>
>> +config DWMAC_STARFIVE_PLAT
>> +       tristate "StarFive dwmac support"
>> +       depends on OF && COMMON_CLK
>> +       depends on STMMAC_ETH
>> +       default SOC_STARFIVE
>> +       help
>> +         Support for ethernet controllers on StarFive RISC-V SoCs
>> +
>> +         This selects the StarFive platform specific glue layer support for
>> +         the stmmac device driver. This driver is used for StarFive JH7110
>> +         ethernet controller.
>> +
>>  config DWMAC_VISCONTI
>>         tristate "Toshiba Visconti DWMAC support"
>>         default ARCH_VISCONTI
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
>> index d4e12e9ace4f..a63ab0ab5071 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/Makefile
>> +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
>> @@ -31,6 +31,7 @@ obj-$(CONFIG_DWMAC_DWC_QOS_ETH)       += dwmac-dwc-qos-eth.o
>>  obj-$(CONFIG_DWMAC_INTEL_PLAT) += dwmac-intel-plat.o
>>  obj-$(CONFIG_DWMAC_GENERIC)    += dwmac-generic.o
>>  obj-$(CONFIG_DWMAC_IMX8)       += dwmac-imx.o
>> +obj-$(CONFIG_DWMAC_STARFIVE_PLAT)      += dwmac-starfive-plat.o
> 
> Hi Yanhong,
> 
> For the next version could you please drop the _PLAT from the config
> symbol and -plat from filename. I know the intel wrapper does the
> same, but it's the only one, so lets do like the majority of other
> wrappers and not add more different ways of doing things.
> 

Thanks. I will fix.

>>  obj-$(CONFIG_DWMAC_VISCONTI)   += dwmac-visconti.o
>>  stmmac-platform-objs:= stmmac_platform.o
>>  dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
>> new file mode 100644
>> index 000000000000..e441d920933a
>> --- /dev/null
>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
>> @@ -0,0 +1,118 @@
>> +// SPDX-License-Identifier: GPL-2.0+
>> +/*
>> + * StarFive DWMAC platform driver
>> + *
>> + * Copyright(C) 2022 StarFive Technology Co., Ltd.
>> + *
>> + */
>> +
>> +#include <linux/of_device.h>
>> +
>> +#include "stmmac_platform.h"
>> +
>> +struct starfive_dwmac {
>> +       struct device *dev;
>> +       struct clk *clk_tx;
>> +       struct clk *clk_gtx;
>> +       struct clk *clk_gtxc;
>> +};
> 
> I like this name. For the next version could you also
> s/starfive_eth_plat_/starfive_dwmac_/ on the function/struct names
> below for consistency.
> 

I will fix.

>> +
>> +static void starfive_eth_plat_fix_mac_speed(void *priv, unsigned int speed)
>> +{
>> +       struct starfive_dwmac *dwmac = priv;
>> +       unsigned long rate;
>> +       int err;
>> +
>> +       rate = clk_get_rate(dwmac->clk_gtx);
>> +
>> +       switch (speed) {
>> +       case SPEED_1000:
>> +               rate = 125000000;
>> +               break;
>> +       case SPEED_100:
>> +               rate = 25000000;
>> +               break;
>> +       case SPEED_10:
>> +               rate = 2500000;
>> +               break;
>> +       default:
>> +               dev_err(dwmac->dev, "invalid speed %u\n", speed);
>> +               break;
>> +       }
>> +
>> +       err = clk_set_rate(dwmac->clk_gtx, rate);
>> +       if (err)
>> +               dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
>> +}
>> +
>> +static int starfive_eth_plat_probe(struct platform_device *pdev)
>> +{
>> +       struct plat_stmmacenet_data *plat_dat;
>> +       struct stmmac_resources stmmac_res;
>> +       struct starfive_dwmac *dwmac;
>> +       int err;
>> +
>> +       err = stmmac_get_platform_resources(pdev, &stmmac_res);
>> +       if (err)
>> +               return err;
>> +
>> +       plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
>> +       if (IS_ERR(plat_dat)) {
>> +               dev_err(&pdev->dev, "dt configuration failed\n");
>> +               return PTR_ERR(plat_dat);
>> +       }
>> +
>> +       dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
>> +       if (!dwmac)
>> +               return -ENOMEM;
>> +
>> +       dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
>> +       if (IS_ERR(dwmac->clk_tx))
>> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
>> +                                               "error getting tx clock\n");
>> +
>> +       dwmac->clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
>> +       if (IS_ERR(dwmac->clk_gtx))
>> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtx),
>> +                                               "error getting gtx clock\n");
>> +
>> +       dwmac->clk_gtxc = devm_clk_get_enabled(&pdev->dev, "gtxc");
>> +       if (IS_ERR(dwmac->clk_gtxc))
>> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtxc),
>> +                                               "error getting gtxc clock\n");
>> +
>> +       dwmac->dev = &pdev->dev;
>> +       plat_dat->fix_mac_speed = starfive_eth_plat_fix_mac_speed;
>> +       plat_dat->init = NULL;
>> +       plat_dat->bsp_priv = dwmac;
>> +       plat_dat->dma_cfg->dche = true;
>> +
>> +       err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
>> +       if (err) {
>> +               stmmac_remove_config_dt(pdev, plat_dat);
>> +               return err;
>> +       }
>> +
>> +       return 0;
>> +}
>> +
>> +static const struct of_device_id starfive_eth_plat_match[] = {
>> +       { .compatible = "starfive,jh7110-dwmac" },
>> +       { }
>> +};
>> +
>> +static struct platform_driver starfive_eth_plat_driver = {
>> +       .probe  = starfive_eth_plat_probe,
>> +       .remove = stmmac_pltfr_remove,
>> +       .driver = {
>> +               .name = "starfive-eth-plat",
>> +               .pm = &stmmac_pltfr_pm_ops,
>> +               .of_match_table = starfive_eth_plat_match,
>> +       },
>> +};
>> +
>> +module_platform_driver(starfive_eth_plat_driver);
>> +
>> +MODULE_LICENSE("GPL");
>> +MODULE_DESCRIPTION("StarFive DWMAC platform driver");
>> +MODULE_AUTHOR("Yanhong Wang <yanhong.wang@starfivetech.com>");
>> --
>> 2.17.1
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs
@ 2023-02-21  2:27       ` yanhong wang
  0 siblings, 0 replies; 72+ messages in thread
From: yanhong wang @ 2023-02-21  2:27 UTC (permalink / raw)
  To: Emil Renner Berthing
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis, samin.guo

add  samin.guo@starfivetech.com  to loop.

On 2023/2/16 18:53, Emil Renner Berthing wrote:
> On Wed, 18 Jan 2023 at 07:20, Yanhong Wang
> <yanhong.wang@starfivetech.com> wrote:
>>
>> This adds StarFive dwmac driver support on the StarFive JH7110 SoCs.
>>
>> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
>> Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
>> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
>> ---
>>  MAINTAINERS                                   |   1 +
>>  drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
>>  drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
>>  .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
>>  4 files changed, 132 insertions(+)
>>  create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 56be59bb09f7..5b50b52d3dbb 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -19609,6 +19609,7 @@ F:      include/dt-bindings/clock/starfive*
>>  STARFIVE DWMAC GLUE LAYER
>>  M:     Yanhong Wang <yanhong.wang@starfivetech.com>
>>  S:     Maintained
>> +F:     Documentation/devicetree/bindings/net/dwmac-starfive-plat.c
>>  F:     Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
>>
>>  STARFIVE PINCTRL DRIVER
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
>> index 31ff35174034..f9a4ad4abd54 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
>> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
>> @@ -235,6 +235,18 @@ config DWMAC_INTEL_PLAT
>>           the stmmac device driver. This driver is used for the Intel Keem Bay
>>           SoC.
>>
>> +config DWMAC_STARFIVE_PLAT
>> +       tristate "StarFive dwmac support"
>> +       depends on OF && COMMON_CLK
>> +       depends on STMMAC_ETH
>> +       default SOC_STARFIVE
>> +       help
>> +         Support for ethernet controllers on StarFive RISC-V SoCs
>> +
>> +         This selects the StarFive platform specific glue layer support for
>> +         the stmmac device driver. This driver is used for StarFive JH7110
>> +         ethernet controller.
>> +
>>  config DWMAC_VISCONTI
>>         tristate "Toshiba Visconti DWMAC support"
>>         default ARCH_VISCONTI
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
>> index d4e12e9ace4f..a63ab0ab5071 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/Makefile
>> +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
>> @@ -31,6 +31,7 @@ obj-$(CONFIG_DWMAC_DWC_QOS_ETH)       += dwmac-dwc-qos-eth.o
>>  obj-$(CONFIG_DWMAC_INTEL_PLAT) += dwmac-intel-plat.o
>>  obj-$(CONFIG_DWMAC_GENERIC)    += dwmac-generic.o
>>  obj-$(CONFIG_DWMAC_IMX8)       += dwmac-imx.o
>> +obj-$(CONFIG_DWMAC_STARFIVE_PLAT)      += dwmac-starfive-plat.o
> 
> Hi Yanhong,
> 
> For the next version could you please drop the _PLAT from the config
> symbol and -plat from filename. I know the intel wrapper does the
> same, but it's the only one, so lets do like the majority of other
> wrappers and not add more different ways of doing things.
> 

Thanks. I will fix.

>>  obj-$(CONFIG_DWMAC_VISCONTI)   += dwmac-visconti.o
>>  stmmac-platform-objs:= stmmac_platform.o
>>  dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
>> new file mode 100644
>> index 000000000000..e441d920933a
>> --- /dev/null
>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
>> @@ -0,0 +1,118 @@
>> +// SPDX-License-Identifier: GPL-2.0+
>> +/*
>> + * StarFive DWMAC platform driver
>> + *
>> + * Copyright(C) 2022 StarFive Technology Co., Ltd.
>> + *
>> + */
>> +
>> +#include <linux/of_device.h>
>> +
>> +#include "stmmac_platform.h"
>> +
>> +struct starfive_dwmac {
>> +       struct device *dev;
>> +       struct clk *clk_tx;
>> +       struct clk *clk_gtx;
>> +       struct clk *clk_gtxc;
>> +};
> 
> I like this name. For the next version could you also
> s/starfive_eth_plat_/starfive_dwmac_/ on the function/struct names
> below for consistency.
> 

I will fix.

>> +
>> +static void starfive_eth_plat_fix_mac_speed(void *priv, unsigned int speed)
>> +{
>> +       struct starfive_dwmac *dwmac = priv;
>> +       unsigned long rate;
>> +       int err;
>> +
>> +       rate = clk_get_rate(dwmac->clk_gtx);
>> +
>> +       switch (speed) {
>> +       case SPEED_1000:
>> +               rate = 125000000;
>> +               break;
>> +       case SPEED_100:
>> +               rate = 25000000;
>> +               break;
>> +       case SPEED_10:
>> +               rate = 2500000;
>> +               break;
>> +       default:
>> +               dev_err(dwmac->dev, "invalid speed %u\n", speed);
>> +               break;
>> +       }
>> +
>> +       err = clk_set_rate(dwmac->clk_gtx, rate);
>> +       if (err)
>> +               dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
>> +}
>> +
>> +static int starfive_eth_plat_probe(struct platform_device *pdev)
>> +{
>> +       struct plat_stmmacenet_data *plat_dat;
>> +       struct stmmac_resources stmmac_res;
>> +       struct starfive_dwmac *dwmac;
>> +       int err;
>> +
>> +       err = stmmac_get_platform_resources(pdev, &stmmac_res);
>> +       if (err)
>> +               return err;
>> +
>> +       plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
>> +       if (IS_ERR(plat_dat)) {
>> +               dev_err(&pdev->dev, "dt configuration failed\n");
>> +               return PTR_ERR(plat_dat);
>> +       }
>> +
>> +       dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
>> +       if (!dwmac)
>> +               return -ENOMEM;
>> +
>> +       dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
>> +       if (IS_ERR(dwmac->clk_tx))
>> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
>> +                                               "error getting tx clock\n");
>> +
>> +       dwmac->clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
>> +       if (IS_ERR(dwmac->clk_gtx))
>> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtx),
>> +                                               "error getting gtx clock\n");
>> +
>> +       dwmac->clk_gtxc = devm_clk_get_enabled(&pdev->dev, "gtxc");
>> +       if (IS_ERR(dwmac->clk_gtxc))
>> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtxc),
>> +                                               "error getting gtxc clock\n");
>> +
>> +       dwmac->dev = &pdev->dev;
>> +       plat_dat->fix_mac_speed = starfive_eth_plat_fix_mac_speed;
>> +       plat_dat->init = NULL;
>> +       plat_dat->bsp_priv = dwmac;
>> +       plat_dat->dma_cfg->dche = true;
>> +
>> +       err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
>> +       if (err) {
>> +               stmmac_remove_config_dt(pdev, plat_dat);
>> +               return err;
>> +       }
>> +
>> +       return 0;
>> +}
>> +
>> +static const struct of_device_id starfive_eth_plat_match[] = {
>> +       { .compatible = "starfive,jh7110-dwmac" },
>> +       { }
>> +};
>> +
>> +static struct platform_driver starfive_eth_plat_driver = {
>> +       .probe  = starfive_eth_plat_probe,
>> +       .remove = stmmac_pltfr_remove,
>> +       .driver = {
>> +               .name = "starfive-eth-plat",
>> +               .pm = &stmmac_pltfr_pm_ops,
>> +               .of_match_table = starfive_eth_plat_match,
>> +       },
>> +};
>> +
>> +module_platform_driver(starfive_eth_plat_driver);
>> +
>> +MODULE_LICENSE("GPL");
>> +MODULE_DESCRIPTION("StarFive DWMAC platform driver");
>> +MODULE_AUTHOR("Yanhong Wang <yanhong.wang@starfivetech.com>");
>> --
>> 2.17.1
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs
  2023-02-21  2:27       ` yanhong wang
@ 2023-02-26 15:15         ` Emil Renner Berthing
  -1 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-26 15:15 UTC (permalink / raw)
  To: yanhong wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis, samin.guo

On Tue, 21 Feb 2023 at 03:27, yanhong wang
<yanhong.wang@starfivetech.com> wrote:
>
> add  samin.guo@starfivetech.com  to loop.
>
> On 2023/2/16 18:53, Emil Renner Berthing wrote:
> > On Wed, 18 Jan 2023 at 07:20, Yanhong Wang
> > <yanhong.wang@starfivetech.com> wrote:
> >>
> >> This adds StarFive dwmac driver support on the StarFive JH7110 SoCs.
> >>
> >> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> >> Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
> >> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
> >> ---
> >>  MAINTAINERS                                   |   1 +
> >>  drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
> >>  drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
> >>  .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
> >>  4 files changed, 132 insertions(+)
> >>  create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> >>
> >> diff --git a/MAINTAINERS b/MAINTAINERS
> >> index 56be59bb09f7..5b50b52d3dbb 100644
> >> --- a/MAINTAINERS
> >> +++ b/MAINTAINERS
> >> @@ -19609,6 +19609,7 @@ F:      include/dt-bindings/clock/starfive*
> >>  STARFIVE DWMAC GLUE LAYER
> >>  M:     Yanhong Wang <yanhong.wang@starfivetech.com>
> >>  S:     Maintained
> >> +F:     Documentation/devicetree/bindings/net/dwmac-starfive-plat.c
> >>  F:     Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> >>
> >>  STARFIVE PINCTRL DRIVER
> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> >> index 31ff35174034..f9a4ad4abd54 100644
> >> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
> >> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> >> @@ -235,6 +235,18 @@ config DWMAC_INTEL_PLAT
> >>           the stmmac device driver. This driver is used for the Intel Keem Bay
> >>           SoC.
> >>
> >> +config DWMAC_STARFIVE_PLAT
> >> +       tristate "StarFive dwmac support"
> >> +       depends on OF && COMMON_CLK
> >> +       depends on STMMAC_ETH
> >> +       default SOC_STARFIVE
> >> +       help
> >> +         Support for ethernet controllers on StarFive RISC-V SoCs
> >> +
> >> +         This selects the StarFive platform specific glue layer support for
> >> +         the stmmac device driver. This driver is used for StarFive JH7110
> >> +         ethernet controller.
> >> +
> >>  config DWMAC_VISCONTI
> >>         tristate "Toshiba Visconti DWMAC support"
> >>         default ARCH_VISCONTI
> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
> >> index d4e12e9ace4f..a63ab0ab5071 100644
> >> --- a/drivers/net/ethernet/stmicro/stmmac/Makefile
> >> +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
> >> @@ -31,6 +31,7 @@ obj-$(CONFIG_DWMAC_DWC_QOS_ETH)       += dwmac-dwc-qos-eth.o
> >>  obj-$(CONFIG_DWMAC_INTEL_PLAT) += dwmac-intel-plat.o
> >>  obj-$(CONFIG_DWMAC_GENERIC)    += dwmac-generic.o
> >>  obj-$(CONFIG_DWMAC_IMX8)       += dwmac-imx.o
> >> +obj-$(CONFIG_DWMAC_STARFIVE_PLAT)      += dwmac-starfive-plat.o
> >
> > Hi Yanhong,
> >
> > For the next version could you please drop the _PLAT from the config
> > symbol and -plat from filename. I know the intel wrapper does the
> > same, but it's the only one, so lets do like the majority of other
> > wrappers and not add more different ways of doing things.
> >
>
> Thanks. I will fix.
>
> >>  obj-$(CONFIG_DWMAC_VISCONTI)   += dwmac-visconti.o
> >>  stmmac-platform-objs:= stmmac_platform.o
> >>  dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o
> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> >> new file mode 100644
> >> index 000000000000..e441d920933a
> >> --- /dev/null
> >> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> >> @@ -0,0 +1,118 @@
> >> +// SPDX-License-Identifier: GPL-2.0+
> >> +/*
> >> + * StarFive DWMAC platform driver
> >> + *
> >> + * Copyright(C) 2022 StarFive Technology Co., Ltd.
> >> + *
> >> + */
> >> +
> >> +#include <linux/of_device.h>
> >> +
> >> +#include "stmmac_platform.h"
> >> +
> >> +struct starfive_dwmac {
> >> +       struct device *dev;
> >> +       struct clk *clk_tx;
> >> +       struct clk *clk_gtx;
> >> +       struct clk *clk_gtxc;
> >> +};
> >
> > I like this name. For the next version could you also
> > s/starfive_eth_plat_/starfive_dwmac_/ on the function/struct names
> > below for consistency.
> >
>
> I will fix.
>
> >> +
> >> +static void starfive_eth_plat_fix_mac_speed(void *priv, unsigned int speed)
> >> +{
> >> +       struct starfive_dwmac *dwmac = priv;
> >> +       unsigned long rate;
> >> +       int err;
> >> +
> >> +       rate = clk_get_rate(dwmac->clk_gtx);
> >> +
> >> +       switch (speed) {
> >> +       case SPEED_1000:
> >> +               rate = 125000000;
> >> +               break;
> >> +       case SPEED_100:
> >> +               rate = 25000000;
> >> +               break;
> >> +       case SPEED_10:
> >> +               rate = 2500000;
> >> +               break;
> >> +       default:
> >> +               dev_err(dwmac->dev, "invalid speed %u\n", speed);
> >> +               break;
> >> +       }
> >> +
> >> +       err = clk_set_rate(dwmac->clk_gtx, rate);
> >> +       if (err)
> >> +               dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
> >> +}
> >> +
> >> +static int starfive_eth_plat_probe(struct platform_device *pdev)
> >> +{
> >> +       struct plat_stmmacenet_data *plat_dat;
> >> +       struct stmmac_resources stmmac_res;
> >> +       struct starfive_dwmac *dwmac;
> >> +       int err;
> >> +
> >> +       err = stmmac_get_platform_resources(pdev, &stmmac_res);
> >> +       if (err)
> >> +               return err;
> >> +
> >> +       plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
> >> +       if (IS_ERR(plat_dat)) {
> >> +               dev_err(&pdev->dev, "dt configuration failed\n");
> >> +               return PTR_ERR(plat_dat);
> >> +       }
> >> +
> >> +       dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
> >> +       if (!dwmac)
> >> +               return -ENOMEM;
> >> +
> >> +       dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
> >> +       if (IS_ERR(dwmac->clk_tx))
> >> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
> >> +                                               "error getting tx clock\n");
> >> +
> >> +       dwmac->clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
> >> +       if (IS_ERR(dwmac->clk_gtx))
> >> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtx),
> >> +                                               "error getting gtx clock\n");
> >> +
> >> +       dwmac->clk_gtxc = devm_clk_get_enabled(&pdev->dev, "gtxc");
> >> +       if (IS_ERR(dwmac->clk_gtxc))
> >> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtxc),
> >> +                                               "error getting gtxc clock\n");
> >> +
> >> +       dwmac->dev = &pdev->dev;
> >> +       plat_dat->fix_mac_speed = starfive_eth_plat_fix_mac_speed;
> >> +       plat_dat->init = NULL;
> >> +       plat_dat->bsp_priv = dwmac;
> >> +       plat_dat->dma_cfg->dche = true;
> >> +
> >> +       err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
> >> +       if (err) {
> >> +               stmmac_remove_config_dt(pdev, plat_dat);
> >> +               return err;
> >> +       }
> >> +
> >> +       return 0;
> >> +}
> >> +
> >> +static const struct of_device_id starfive_eth_plat_match[] = {
> >> +       { .compatible = "starfive,jh7110-dwmac" },
> >> +       { }
> >> +};

I noticed you're missing a
MODULE_DEVICE_TABLE(of, starfive_dwmac_match);
here, so udev will load the module automatically.

While you're at it I also like the idiom of using { /* sentinel */ }
for the last entry here.

> >> +static struct platform_driver starfive_eth_plat_driver = {
> >> +       .probe  = starfive_eth_plat_probe,
> >> +       .remove = stmmac_pltfr_remove,
> >> +       .driver = {
> >> +               .name = "starfive-eth-plat",
> >> +               .pm = &stmmac_pltfr_pm_ops,
> >> +               .of_match_table = starfive_eth_plat_match,
> >> +       },
> >> +};
> >> +
> >> +module_platform_driver(starfive_eth_plat_driver);
> >> +
> >> +MODULE_LICENSE("GPL");
> >> +MODULE_DESCRIPTION("StarFive DWMAC platform driver");
> >> +MODULE_AUTHOR("Yanhong Wang <yanhong.wang@starfivetech.com>");
> >> --
> >> 2.17.1
> >>
> >>
> >> _______________________________________________
> >> linux-riscv mailing list
> >> linux-riscv@lists.infradead.org
> >> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH v4 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs
@ 2023-02-26 15:15         ` Emil Renner Berthing
  0 siblings, 0 replies; 72+ messages in thread
From: Emil Renner Berthing @ 2023-02-26 15:15 UTC (permalink / raw)
  To: yanhong wang
  Cc: linux-riscv, netdev, devicetree, linux-kernel, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Emil Renner Berthing, Richard Cochran,
	Andrew Lunn, Heiner Kallweit, Peter Geis, samin.guo

On Tue, 21 Feb 2023 at 03:27, yanhong wang
<yanhong.wang@starfivetech.com> wrote:
>
> add  samin.guo@starfivetech.com  to loop.
>
> On 2023/2/16 18:53, Emil Renner Berthing wrote:
> > On Wed, 18 Jan 2023 at 07:20, Yanhong Wang
> > <yanhong.wang@starfivetech.com> wrote:
> >>
> >> This adds StarFive dwmac driver support on the StarFive JH7110 SoCs.
> >>
> >> Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
> >> Co-developed-by: Emil Renner Berthing <kernel@esmil.dk>
> >> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
> >> ---
> >>  MAINTAINERS                                   |   1 +
> >>  drivers/net/ethernet/stmicro/stmmac/Kconfig   |  12 ++
> >>  drivers/net/ethernet/stmicro/stmmac/Makefile  |   1 +
> >>  .../stmicro/stmmac/dwmac-starfive-plat.c      | 118 ++++++++++++++++++
> >>  4 files changed, 132 insertions(+)
> >>  create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> >>
> >> diff --git a/MAINTAINERS b/MAINTAINERS
> >> index 56be59bb09f7..5b50b52d3dbb 100644
> >> --- a/MAINTAINERS
> >> +++ b/MAINTAINERS
> >> @@ -19609,6 +19609,7 @@ F:      include/dt-bindings/clock/starfive*
> >>  STARFIVE DWMAC GLUE LAYER
> >>  M:     Yanhong Wang <yanhong.wang@starfivetech.com>
> >>  S:     Maintained
> >> +F:     Documentation/devicetree/bindings/net/dwmac-starfive-plat.c
> >>  F:     Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> >>
> >>  STARFIVE PINCTRL DRIVER
> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> >> index 31ff35174034..f9a4ad4abd54 100644
> >> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
> >> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> >> @@ -235,6 +235,18 @@ config DWMAC_INTEL_PLAT
> >>           the stmmac device driver. This driver is used for the Intel Keem Bay
> >>           SoC.
> >>
> >> +config DWMAC_STARFIVE_PLAT
> >> +       tristate "StarFive dwmac support"
> >> +       depends on OF && COMMON_CLK
> >> +       depends on STMMAC_ETH
> >> +       default SOC_STARFIVE
> >> +       help
> >> +         Support for ethernet controllers on StarFive RISC-V SoCs
> >> +
> >> +         This selects the StarFive platform specific glue layer support for
> >> +         the stmmac device driver. This driver is used for StarFive JH7110
> >> +         ethernet controller.
> >> +
> >>  config DWMAC_VISCONTI
> >>         tristate "Toshiba Visconti DWMAC support"
> >>         default ARCH_VISCONTI
> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
> >> index d4e12e9ace4f..a63ab0ab5071 100644
> >> --- a/drivers/net/ethernet/stmicro/stmmac/Makefile
> >> +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
> >> @@ -31,6 +31,7 @@ obj-$(CONFIG_DWMAC_DWC_QOS_ETH)       += dwmac-dwc-qos-eth.o
> >>  obj-$(CONFIG_DWMAC_INTEL_PLAT) += dwmac-intel-plat.o
> >>  obj-$(CONFIG_DWMAC_GENERIC)    += dwmac-generic.o
> >>  obj-$(CONFIG_DWMAC_IMX8)       += dwmac-imx.o
> >> +obj-$(CONFIG_DWMAC_STARFIVE_PLAT)      += dwmac-starfive-plat.o
> >
> > Hi Yanhong,
> >
> > For the next version could you please drop the _PLAT from the config
> > symbol and -plat from filename. I know the intel wrapper does the
> > same, but it's the only one, so lets do like the majority of other
> > wrappers and not add more different ways of doing things.
> >
>
> Thanks. I will fix.
>
> >>  obj-$(CONFIG_DWMAC_VISCONTI)   += dwmac-visconti.o
> >>  stmmac-platform-objs:= stmmac_platform.o
> >>  dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o
> >> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> >> new file mode 100644
> >> index 000000000000..e441d920933a
> >> --- /dev/null
> >> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive-plat.c
> >> @@ -0,0 +1,118 @@
> >> +// SPDX-License-Identifier: GPL-2.0+
> >> +/*
> >> + * StarFive DWMAC platform driver
> >> + *
> >> + * Copyright(C) 2022 StarFive Technology Co., Ltd.
> >> + *
> >> + */
> >> +
> >> +#include <linux/of_device.h>
> >> +
> >> +#include "stmmac_platform.h"
> >> +
> >> +struct starfive_dwmac {
> >> +       struct device *dev;
> >> +       struct clk *clk_tx;
> >> +       struct clk *clk_gtx;
> >> +       struct clk *clk_gtxc;
> >> +};
> >
> > I like this name. For the next version could you also
> > s/starfive_eth_plat_/starfive_dwmac_/ on the function/struct names
> > below for consistency.
> >
>
> I will fix.
>
> >> +
> >> +static void starfive_eth_plat_fix_mac_speed(void *priv, unsigned int speed)
> >> +{
> >> +       struct starfive_dwmac *dwmac = priv;
> >> +       unsigned long rate;
> >> +       int err;
> >> +
> >> +       rate = clk_get_rate(dwmac->clk_gtx);
> >> +
> >> +       switch (speed) {
> >> +       case SPEED_1000:
> >> +               rate = 125000000;
> >> +               break;
> >> +       case SPEED_100:
> >> +               rate = 25000000;
> >> +               break;
> >> +       case SPEED_10:
> >> +               rate = 2500000;
> >> +               break;
> >> +       default:
> >> +               dev_err(dwmac->dev, "invalid speed %u\n", speed);
> >> +               break;
> >> +       }
> >> +
> >> +       err = clk_set_rate(dwmac->clk_gtx, rate);
> >> +       if (err)
> >> +               dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate);
> >> +}
> >> +
> >> +static int starfive_eth_plat_probe(struct platform_device *pdev)
> >> +{
> >> +       struct plat_stmmacenet_data *plat_dat;
> >> +       struct stmmac_resources stmmac_res;
> >> +       struct starfive_dwmac *dwmac;
> >> +       int err;
> >> +
> >> +       err = stmmac_get_platform_resources(pdev, &stmmac_res);
> >> +       if (err)
> >> +               return err;
> >> +
> >> +       plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
> >> +       if (IS_ERR(plat_dat)) {
> >> +               dev_err(&pdev->dev, "dt configuration failed\n");
> >> +               return PTR_ERR(plat_dat);
> >> +       }
> >> +
> >> +       dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
> >> +       if (!dwmac)
> >> +               return -ENOMEM;
> >> +
> >> +       dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
> >> +       if (IS_ERR(dwmac->clk_tx))
> >> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
> >> +                                               "error getting tx clock\n");
> >> +
> >> +       dwmac->clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
> >> +       if (IS_ERR(dwmac->clk_gtx))
> >> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtx),
> >> +                                               "error getting gtx clock\n");
> >> +
> >> +       dwmac->clk_gtxc = devm_clk_get_enabled(&pdev->dev, "gtxc");
> >> +       if (IS_ERR(dwmac->clk_gtxc))
> >> +               return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_gtxc),
> >> +                                               "error getting gtxc clock\n");
> >> +
> >> +       dwmac->dev = &pdev->dev;
> >> +       plat_dat->fix_mac_speed = starfive_eth_plat_fix_mac_speed;
> >> +       plat_dat->init = NULL;
> >> +       plat_dat->bsp_priv = dwmac;
> >> +       plat_dat->dma_cfg->dche = true;
> >> +
> >> +       err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
> >> +       if (err) {
> >> +               stmmac_remove_config_dt(pdev, plat_dat);
> >> +               return err;
> >> +       }
> >> +
> >> +       return 0;
> >> +}
> >> +
> >> +static const struct of_device_id starfive_eth_plat_match[] = {
> >> +       { .compatible = "starfive,jh7110-dwmac" },
> >> +       { }
> >> +};

I noticed you're missing a
MODULE_DEVICE_TABLE(of, starfive_dwmac_match);
here, so udev will load the module automatically.

While you're at it I also like the idiom of using { /* sentinel */ }
for the last entry here.

> >> +static struct platform_driver starfive_eth_plat_driver = {
> >> +       .probe  = starfive_eth_plat_probe,
> >> +       .remove = stmmac_pltfr_remove,
> >> +       .driver = {
> >> +               .name = "starfive-eth-plat",
> >> +               .pm = &stmmac_pltfr_pm_ops,
> >> +               .of_match_table = starfive_eth_plat_match,
> >> +       },
> >> +};
> >> +
> >> +module_platform_driver(starfive_eth_plat_driver);
> >> +
> >> +MODULE_LICENSE("GPL");
> >> +MODULE_DESCRIPTION("StarFive DWMAC platform driver");
> >> +MODULE_AUTHOR("Yanhong Wang <yanhong.wang@starfivetech.com>");
> >> --
> >> 2.17.1
> >>
> >>
> >> _______________________________________________
> >> linux-riscv mailing list
> >> linux-riscv@lists.infradead.org
> >> http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 72+ messages in thread

end of thread, other threads:[~2023-02-26 15:29 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18  6:16 [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC Yanhong Wang
2023-01-18  6:16 ` Yanhong Wang
2023-01-18  6:16 ` [PATCH v4 1/7] dt-bindings: net: snps,dwmac: Add dwmac-5.20 version Yanhong Wang
2023-01-18  6:16   ` Yanhong Wang
2023-01-18  6:16 ` [PATCH v4 2/7] dt-bindings: net: snps,dwmac: Update the maxitems number of resets and reset-names Yanhong Wang
2023-01-18  6:16   ` Yanhong Wang
2023-01-18 13:10   ` Rob Herring
2023-01-18 13:10     ` Rob Herring
2023-01-18 15:46   ` Krzysztof Kozlowski
2023-01-18 15:46     ` Krzysztof Kozlowski
2023-01-18 15:47   ` Krzysztof Kozlowski
2023-01-18 15:47     ` Krzysztof Kozlowski
2023-02-07  2:43     ` yanhong wang
2023-02-07  2:43       ` yanhong wang
2023-02-07  7:59       ` Krzysztof Kozlowski
2023-02-07  7:59         ` Krzysztof Kozlowski
2023-02-15  7:46         ` yanhong wang
2023-02-15  7:46           ` yanhong wang
2023-02-16  8:13           ` Krzysztof Kozlowski
2023-02-16  8:13             ` Krzysztof Kozlowski
2023-01-18  6:16 ` [PATCH v4 3/7] net: stmmac: platform: Add snps,dwmac-5.20 IP compatible string Yanhong Wang
2023-01-18  6:16   ` Yanhong Wang
2023-01-18  6:16 ` [PATCH v4 4/7] dt-bindings: net: Add support StarFive dwmac Yanhong Wang
2023-01-18  6:16   ` Yanhong Wang
2023-01-18 15:49   ` Krzysztof Kozlowski
2023-01-18 15:49     ` Krzysztof Kozlowski
2023-02-03  5:58     ` yanhong wang
2023-02-03  5:58       ` yanhong wang
2023-01-18  6:16 ` [PATCH v4 5/7] net: stmmac: Add glue layer for StarFive JH7110 SoCs Yanhong Wang
2023-01-18  6:16   ` Yanhong Wang
2023-02-16 10:53   ` Emil Renner Berthing
2023-02-16 10:53     ` Emil Renner Berthing
2023-02-21  2:27     ` yanhong wang
2023-02-21  2:27       ` yanhong wang
2023-02-26 15:15       ` Emil Renner Berthing
2023-02-26 15:15         ` Emil Renner Berthing
2023-01-18  6:17 ` [PATCH v4 6/7] riscv: dts: starfive: jh7110: Add ethernet device node Yanhong Wang
2023-01-18  6:17   ` Yanhong Wang
2023-01-18 15:51   ` Krzysztof Kozlowski
2023-01-18 15:51     ` Krzysztof Kozlowski
2023-02-03  3:14     ` yanhong wang
2023-02-03  3:14       ` yanhong wang
2023-02-03  7:09       ` Krzysztof Kozlowski
2023-02-03  7:09         ` Krzysztof Kozlowski
2023-02-03  7:40         ` yanhong wang
2023-02-03  7:40           ` yanhong wang
2023-02-03  7:56           ` Krzysztof Kozlowski
2023-02-03  7:56             ` Krzysztof Kozlowski
2023-02-03  9:01             ` yanhong wang
2023-02-03  9:01               ` yanhong wang
2023-02-20 14:22   ` Emil Renner Berthing
2023-02-20 14:22     ` Emil Renner Berthing
2023-02-20 15:00     ` Emil Renner Berthing
2023-02-20 15:00       ` Emil Renner Berthing
2023-01-18  6:17 ` [PATCH v4 7/7] riscv: dts: starfive: visionfive-v2: Enable gmac device tree node Yanhong Wang
2023-01-18  6:17   ` Yanhong Wang
2023-02-20 14:05   ` Emil Renner Berthing
2023-02-20 14:05     ` Emil Renner Berthing
2023-01-18 23:21 ` [PATCH v4 0/7] Add Ethernet driver for StarFive JH7110 SoC Conor Dooley
2023-01-18 23:21   ` Conor Dooley
2023-02-03  3:02   ` yanhong wang
2023-02-03  3:02     ` yanhong wang
2023-02-04 14:22     ` Conor Dooley
2023-02-04 14:22       ` Conor Dooley
2023-02-04 17:16       ` Andrew Lunn
2023-02-04 17:16         ` Andrew Lunn
2023-02-05 10:11         ` Conor Dooley
2023-02-05 10:11           ` Conor Dooley
2023-02-06  1:15         ` yanhong wang
2023-02-06  1:15           ` yanhong wang
2023-02-06  1:05       ` yanhong wang
2023-02-06  1:05         ` yanhong wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.