Skip to contentSkip to conversation

arm64: dts: rockchip: change eth phy mode to rgmii-id for orangepi r1 plus lts

PATCH Applied Tianling Shen 4 participants 11 messages Jan 19, 2025 – Feb 3, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: rockchip: change eth phy mode to rgmii-id for orangepi r1 plus lts

In general the delay should be added by the PHY instead of the MAC, and this improves network stability on some boards which seem to need different delay.

Fixes 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi R1 Plus LTS")
---
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 3 +--
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts     | 1 +
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi    | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
index 67c246ad8b8c..ec2ce894da1f 100644
@@ -17,8 +17,7 @@ / {
 
 &gmac2io {
 	phy-handle = <&yt8531c>;
-	tx_delay = <0x19>;
-	rx_delay = <0x05>;
+	phy-mode = "rgmii-id";
 	status = "okay";
 
 	mdio {
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts +1 -0
index 324a8e951f7e..846b931e16d2 100644
@@ -15,6 +15,7 @@ / {
 
 &gmac2io {
 	phy-handle = <&rtl8211e>;
+	phy-mode = "rgmii";
 	tx_delay = <0x24>;
 	rx_delay = <0x18>;
 	status = "okay";
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi +0 -1
index 4f193704e5dc..09508e324a28 100644
@@ -109,7 +109,6 @@ &gmac2io {
 	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
 	assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
 	clock_in_out = "input";
-	phy-mode = "rgmii";
 	phy-supply = <&vcc_io>;
 	pinctrl-0 = <&rgmiim1_pins>;
 	pinctrl-names = "default";
Signature · 1 line
2.48.1
#1 lore raw

Hello Tianling,

Thanks for the patch. Please, see a comment below.

Quoted 20 lines · Tianling Shen

In general the delay should be added by the PHY instead of the MAC, and this improves network stability on some boards which seem to need different delay.

Fixes 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi R1 Plus LTS")
---
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 3 +--
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts     | 1 +
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi    | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts index 67c246ad8b8c..ec2ce894da1f 100644

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts / { · line 20

Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
@@ -17,8 +17,7 @@ / {
 
 &gmac2io {
 	phy-handle = <&yt8531c>;
-	tx_delay = <0x19>;
-	rx_delay = <0x05>;
+	phy-mode = "rgmii-id";

Shouldn't the "tx_delay" and "rx_delay" DT parameters be converted into the "tx-internal-delay-ps" and "rx-internal-delay-ps" parameters, respectively, so the Motorcomm PHY driver can pick them up and actually configure the internal PHY delays?

Quoted 29 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
 	status = "okay";
 
 	mdio {
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts +1 -0
index 324a8e951f7e..846b931e16d2 100644
@@ -15,6 +15,7 @@ / {
 
 &gmac2io {
 	phy-handle = <&rtl8211e>;
+	phy-mode = "rgmii";
 	tx_delay = <0x24>;
 	rx_delay = <0x18>;
 	status = "okay";
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi +0 -1
index 4f193704e5dc..09508e324a28 100644
@@ -109,7 +109,6 @@ &gmac2io {
 	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
 	assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
 	clock_in_out = "input";
-	phy-mode = "rgmii";
 	phy-supply = <&vcc_io>;
 	pinctrl-0 = <&rgmiim1_pins>;
 	pinctrl-names = "default";
#2 lore raw

Hi Dragan,

Quoted 26 lines · Dragan Simic

Hello Tianling,

Thanks for the patch.  Please, see a comment below.

Quoted 21 lines · Tianling Shen

In general the delay should be added by the PHY instead of the MAC, and this improves network stability on some boards which seem to need different delay.

Fixes 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi R1 Plus LTS")

---
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 3 +-- arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts     | 1 + arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi    | 1 -

 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts index 67c246ad8b8c..ec2ce894da1f 100644

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
@@ -17,8 +17,7 @@ / {
 
Quoted 10 lines

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts / { · line 20

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
  &gmac2io {
      phy-handle = <&yt8531c>;
-    tx_delay = <0x19>;
-    rx_delay = <0x05>;
+    phy-mode = "rgmii-id";

Shouldn't the "tx_delay" and "rx_delay" DT parameters be converted into the "tx-internal-delay-ps" and "rx-internal-delay-ps" parameters, respectively, so the Motorcomm PHY driver can pick them up and actually configure the internal PHY delays?

The documentation[1] says "{t,r}x-internal-delay-ps" default to 1950 and that value already works fine on my board.

1. https://www.kernel.org/doc/Documentation/devicetree/bindings/net/motorcomm%2Cyt8xxx.yaml

Thanks,
Tianling.

Quoted 30 lines
Quoted 30 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
      status = "okay";
 
      mdio {
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts +1 -0
index 324a8e951f7e..846b931e16d2 100644
@@ -15,6 +15,7 @@ / {
 
  &gmac2io {
      phy-handle = <&rtl8211e>;
+    phy-mode = "rgmii";
      tx_delay = <0x24>;
      rx_delay = <0x18>;
      status = "okay";
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi +0 -1
index 4f193704e5dc..09508e324a28 100644
@@ -109,7 +109,6 @@ &gmac2io {
      assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
      assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
      clock_in_out = "input";
-    phy-mode = "rgmii";
      phy-supply = <&vcc_io>;
      pinctrl-0 = <&rgmiim1_pins>;
      pinctrl-names = "default";
#3 lore raw
Quoted 36 lines · Tianling Shen
Quoted 24 lines · Dragan Simic

Thanks for the patch.  Please, see a comment below.

Quoted 21 lines · Tianling Shen

In general the delay should be added by the PHY instead of the MAC, and this improves network stability on some boards which seem to need different delay.

Fixes 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi R1 Plus LTS")

---
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 3 +-- arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts     | 1 + arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi    | 1 -

 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts index 67c246ad8b8c..ec2ce894da1f 100644

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
@@ -17,8 +17,7 @@ / {
 
Quoted 10 lines

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts / { · line 20

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
  &gmac2io {
      phy-handle = <&yt8531c>;
-    tx_delay = <0x19>;
-    rx_delay = <0x05>;
+    phy-mode = "rgmii-id";

Shouldn't the "tx_delay" and "rx_delay" DT parameters be converted into the "tx-internal-delay-ps" and "rx-internal-delay-ps" parameters, respectively, so the Motorcomm PHY driver can pick them up and actually configure the internal PHY delays?

Quoted 4 lines

The documentation[1] says "{t,r}x-internal-delay-ps" default to 1950 and that value already works fine on my board.

1. https://www.kernel.org/doc/Documentation/devicetree/bindings/net/motorcomm%2Cyt8xxx.yaml

I see, but those values differ from the values found in the "tx_delay" and "rx_delay" DT parameters, so I think this patch should be tested with at least one more Orange Pi R1 Plus LTS board, to make sure it's all still fine.

Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
      status = "okay";
 
      mdio {
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts +1 -0
index 324a8e951f7e..846b931e16d2 100644
@@ -15,6 +15,7 @@ / {
 
  &gmac2io {
      phy-handle = <&rtl8211e>;
+    phy-mode = "rgmii";
      tx_delay = <0x24>;
      rx_delay = <0x18>;
      status = "okay";
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi +0 -1
index 4f193704e5dc..09508e324a28 100644
@@ -109,7 +109,6 @@ &gmac2io {
      assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
      assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
      clock_in_out = "input";
-    phy-mode = "rgmii";
      phy-supply = <&vcc_io>;
      pinctrl-0 = <&rgmiim1_pins>;
      pinctrl-names = "default";
#4 lore raw
Quoted 40 lines · Dragan Simic
Quoted 39 lines · Tianling Shen
Quoted 24 lines · Dragan Simic

Thanks for the patch.  Please, see a comment below.

Quoted 21 lines · Tianling Shen

In general the delay should be added by the PHY instead of the MAC, and this improves network stability on some boards which seem to need different delay.

Fixes 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi R1 Plus LTS")

---
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 3 +-- arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts     | 1 + arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi    | 1 -

 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts index 67c246ad8b8c..ec2ce894da1f 100644

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
@@ -17,8 +17,7 @@ / {
 
Quoted 10 lines

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts / { · line 20

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
  &gmac2io {
      phy-handle = <&yt8531c>;
-    tx_delay = <0x19>;
-    rx_delay = <0x05>;
+    phy-mode = "rgmii-id";

Shouldn't the "tx_delay" and "rx_delay" DT parameters be converted into the "tx-internal-delay-ps" and "rx-internal-delay-ps" parameters, respectively, so the Motorcomm PHY driver can pick them up and actually configure the internal PHY delays?

The documentation[1] says "{t,r}x-internal-delay-ps" default to 1950 and that value already works fine on my board.

Quoted 6 lines
Quoted 1 line

1. https://www.kernel.org/doc/Documentation/devicetree/bindings/net/ motorcomm%2Cyt8xxx.yaml

I see, but those values differ from the values found in the "tx_delay" and "rx_delay" DT parameters, so I think this patch should be tested with at least one more Orange Pi R1 Plus LTS board, to make sure it's all still fine.

This patch has been tested on 2 boards, and we will do more tests in next week.

Thanks,
Tianling.

Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
      status = "okay";
 
      mdio {
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts +1 -0
index 324a8e951f7e..846b931e16d2 100644
@@ -15,6 +15,7 @@ / {
 
  &gmac2io {
      phy-handle = <&rtl8211e>;
+    phy-mode = "rgmii";
      tx_delay = <0x24>;
      rx_delay = <0x18>;
      status = "okay";
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi +0 -1
index 4f193704e5dc..09508e324a28 100644
@@ -109,7 +109,6 @@ &gmac2io {
      assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
      assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
      clock_in_out = "input";
-    phy-mode = "rgmii";
      phy-supply = <&vcc_io>;
      pinctrl-0 = <&rgmiim1_pins>;
      pinctrl-names = "default";
#5 lore raw
Quoted 41 lines · Tianling Shen
Quoted 40 lines · Dragan Simic
Quoted 39 lines · Tianling Shen
Quoted 24 lines · Dragan Simic

Thanks for the patch.  Please, see a comment below.

Quoted 21 lines · Tianling Shen

In general the delay should be added by the PHY instead of the MAC, and this improves network stability on some boards which seem to need different delay.

Fixes 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi R1 Plus LTS")

---
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 3 +-- arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts     | 1 + arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi    | 1 -

 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts index 67c246ad8b8c..ec2ce894da1f 100644

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
@@ -17,8 +17,7 @@ / {
 
Quoted 10 lines

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts / { · line 20

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
  &gmac2io {
      phy-handle = <&yt8531c>;
-    tx_delay = <0x19>;
-    rx_delay = <0x05>;
+    phy-mode = "rgmii-id";

Shouldn't the "tx_delay" and "rx_delay" DT parameters be converted into the "tx-internal-delay-ps" and "rx-internal-delay-ps" parameters, respectively, so the Motorcomm PHY driver can pick them up and actually configure the internal PHY delays?

The documentation[1] says "{t,r}x-internal-delay-ps" default to 1950 and that value already works fine on my board.

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

1. https://www.kernel.org/doc/Documentation/devicetree/bindings/net/ motorcomm%2Cyt8xxx.yaml

I see, but those values differ from the values found in the "tx_delay" and "rx_delay" DT parameters, so I think this patch should be tested with at least one more Orange Pi R1 Plus LTS board, to make sure it's all still fine.

This patch has been tested on 2 boards, and we will do more tests in next week.

Managed to test on another board and looks so far so good. (Working network connection, no packet drop)

Thanks,
Tianling.

Quoted 35 lines

Thanks,
Tianling.

Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
      status = "okay";
 
      mdio {
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts +1 -0
index 324a8e951f7e..846b931e16d2 100644
@@ -15,6 +15,7 @@ / {
 
  &gmac2io {
      phy-handle = <&rtl8211e>;
+    phy-mode = "rgmii";
      tx_delay = <0x24>;
      rx_delay = <0x18>;
      status = "okay";
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi +0 -1
index 4f193704e5dc..09508e324a28 100644
@@ -109,7 +109,6 @@ &gmac2io {
      assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
      assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
      clock_in_out = "input";
-    phy-mode = "rgmii";
      phy-supply = <&vcc_io>;
      pinctrl-0 = <&rgmiim1_pins>;
      pinctrl-names = "default";
#6 lore raw

Hello Tianling,

Quoted 52 lines · Tianling Shen
Quoted 51 lines · Tianling Shen
Quoted 49 lines · Dragan Simic
Quoted 39 lines · Tianling Shen
Quoted 27 lines · Dragan Simic

Thanks for the patch.  Please, see a comment below.

Quoted 24 lines · Tianling Shen

In general the delay should be added by the PHY instead of the MAC, and this improves network stability on some boards which seem to need different delay.

Fixes 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi R1 Plus LTS")

---
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 3

+--
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts     | 1 
+
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi    | 1 
-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts index 67c246ad8b8c..ec2ce894da1f 100644

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
@@ -17,8 +17,7 @@ / {
 
Quoted 10 lines

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts / { · line 20

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
  &gmac2io {
      phy-handle = <&yt8531c>;
-    tx_delay = <0x19>;
-    rx_delay = <0x05>;
+    phy-mode = "rgmii-id";

Shouldn't the "tx_delay" and "rx_delay" DT parameters be converted into the "tx-internal-delay-ps" and "rx-internal-delay-ps" parameters, respectively, so the Motorcomm PHY driver can pick them up and actually configure the internal PHY delays?

Quoted 4 lines

The documentation[1] says "{t,r}x-internal-delay-ps" default to 1950 and that value already works fine on my board.

1. https://www.kernel.org/doc/Documentation/devicetree/bindings/net/ motorcomm%2Cyt8xxx.yaml

I see, but those values differ from the values found in the "tx_delay" and "rx_delay" DT parameters, so I think this patch should be tested with at least one more Orange Pi R1 Plus LTS board, to make sure it's all still fine.

Quoted 5 lines
Quoted 2 lines

This patch has been tested on 2 boards, and we will do more tests in next week.

Managed to test on another board and looks so far so good. (Working network connection, no packet drop)

Sounds good to me, thanks for the additional testing.

Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
Quoted 29 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
      status = "okay";
 
      mdio {
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts +1 -0
index 324a8e951f7e..846b931e16d2 100644
@@ -15,6 +15,7 @@ / {
 
  &gmac2io {
      phy-handle = <&rtl8211e>;
+    phy-mode = "rgmii";
      tx_delay = <0x24>;
      rx_delay = <0x18>;
      status = "okay";
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi +0 -1
index 4f193704e5dc..09508e324a28 100644
@@ -109,7 +109,6 @@ &gmac2io {
      assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
      assigned-clock-parents = <&gmac_clk>, <&gmac_clk>;
      clock_in_out = "input";
-    phy-mode = "rgmii";
      phy-supply = <&vcc_io>;
      pinctrl-0 = <&rgmiim1_pins>;
      pinctrl-names = "default";
maintainer
#7 lore raw

Hey,

Am Freitag, 24. Januar 2025, 07:35:50 MEZ schrieb Dragan Simic:

Quoted 59 lines

Hello Tianling,

Quoted 56 lines · Tianling Shen
Quoted 55 lines · Tianling Shen
Quoted 53 lines · Dragan Simic
Quoted 42 lines · Tianling Shen
Quoted 29 lines · Dragan Simic

Thanks for the patch. Please, see a comment below.

Quoted 26 lines · Tianling Shen

In general the delay should be added by the PHY instead of the MAC,
and this improves network stability on some boards which seem to need different delay.

Fixes 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi

R1 Plus LTS")

---
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 3 
+--
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts     | 1 
(quoted diff) +1 -1
+
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi    | 1 
-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts index 67c246ad8b8c..ec2ce894da1f 100644

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
@@ -17,8 +17,7 @@ / {
 
Quoted 11 lines

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts / { · line 20

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
 &gmac2io {
     phy-handle = <&yt8531c>;
-    tx_delay = <0x19>;
-    rx_delay = <0x05>;
+    phy-mode = "rgmii-id";

Shouldn't the "tx_delay" and "rx_delay" DT parameters be converted into the "tx-internal-delay-ps" and "rx-internal-delay-ps" parameters,
respectively, so the Motorcomm PHY driver can pick them up and actually configure the internal PHY delays?

Quoted 5 lines

The documentation[1] says "{t,r}x-internal-delay-ps" default to 1950 and that value already works fine on my board.

1. https://www.kernel.org/doc/Documentation/devicetree/bindings/net/
motorcomm%2Cyt8xxx.yaml

I see, but those values differ from the values found in the "tx_delay" and "rx_delay" DT parameters, so I think this patch should be tested with at least one more Orange Pi R1 Plus LTS board, to make sure it's all still fine.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

This patch has been tested on 2 boards, and we will do more tests in next week.

Managed to test on another board and looks so far so good. (Working network connection, no packet drop)

Sounds good to me, thanks for the additional testing.

I assume that means there are no more open issues, right? At least I got that impression from glancing at the thread :-)

Heiko

#8 lore raw

Hello Heiko,

Quoted 61 lines · Heiko Stuebner

Am Freitag, 24. Januar 2025, 07:35:50 MEZ schrieb Dragan Simic:

Quoted 60 lines · Tianling Shen
Quoted 59 lines · Tianling Shen
Quoted 57 lines · Dragan Simic
Quoted 46 lines · Tianling Shen
Quoted 45 lines · Dragan Simic
Quoted 29 lines

Thanks for the patch. Please, see a comment below.

Quoted 26 lines · Tianling Shen

In general the delay should be added by the PHY instead of the MAC,
and this improves network stability on some boards which seem to need different delay.

Fixes 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi

R1 Plus LTS")

---
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 3
+--
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts     | 1
(quoted diff) +1 -1
+
 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dtsi    | 1
-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts index 67c246ad8b8c..ec2ce894da1f 100644

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +0 -0
@@ -17,8 +17,7 @@ / {
 
Quoted 11 lines

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts / { · line 20

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
 &gmac2io {
     phy-handle = <&yt8531c>;
-    tx_delay = <0x19>;
-    rx_delay = <0x05>;
+    phy-mode = "rgmii-id";

Shouldn't the "tx_delay" and "rx_delay" DT parameters be converted into the "tx-internal-delay-ps" and "rx-internal-delay-ps" parameters,
respectively, so the Motorcomm PHY driver can pick them up and actually configure the internal PHY delays?

The documentation[1] says "{t,r}x-internal-delay-ps" default to 1950 and that value already works fine on my board.

Quoted 7 lines
Quoted 2 lines

1. https://www.kernel.org/doc/Documentation/devicetree/bindings/net/
motorcomm%2Cyt8xxx.yaml

I see, but those values differ from the values found in the "tx_delay" and "rx_delay" DT parameters, so I think this patch should be tested with at least one more Orange Pi R1 Plus LTS board, to make sure it's all still fine.

This patch has been tested on 2 boards, and we will do more tests in next week.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Managed to test on another board and looks so far so good. (Working network connection, no packet drop)

Sounds good to me, thanks for the additional testing.

I assume that means there are no more open issues, right? At least I got that impression from glancing at the thread :-)

Yes, Tianling performed the additional testing, and the introduced changes worked fine on three boards in total. To me, that sounds good. :)

#9 lore raw
In reply to Dragan Simic
Quoted 10 lines

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts / { · line 20

Quoted 5 lines

&gmac2io {

arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +1 -2
 	phy-handle = <&yt8531c>;
-	tx_delay = <0x19>;
-	rx_delay = <0x05>;
+	phy-mode = "rgmii-id";

Shouldn't the "tx_delay" and "rx_delay" DT parameters be converted into the "tx-internal-delay-ps" and "rx-internal-delay-ps" parameters, respectively, so the Motorcomm PHY driver can pick them up and actually configure the internal PHY delays?

Maybe.

One problem is that tx_delay and rx_delay are really bad DT bindings. They are basically values to be poked into a registers, with no explanation of what they mean. Maybe 0x19 means 2ns? If so, that is exactly what the PHY will do with rgmii-id, and you don't need any additional properties.

The fact testing suggests this works does suggest these delay values are around 2ns, so there is probably no need for {rt}x-internal-delay-ps.

In general, i always suggest the PHY does the delay, just so that we try to make all boards act in the same way. The fact this also removes the use of these terrible tx_delay and rx_delay makes this patch even better, if it can be shown to be reliable.

Andrew

maintainer Applied
#10 lore raw
In reply to Tianling Shen
Quoted 5 lines · Tianling Shen

In general the delay should be added by the PHY instead of the MAC, and this improves network stability on some boards which seem to need different delay.

Applied, thanks!

[1/1] arm64: dts: rockchip: change eth phy mode to rgmii-id for orangepi r1 plus lts

      commit: a6a7cba17c544fb95d5a29ab9d9ed4503029cb29

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>