Skip to contentSkip to conversation

arm64: dts: meson: fix PHY deassert timing requirements

PATCH New Stefan Agner 2 participants 5 messages Apr 6, 2021 – Apr 7, 2021

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

PATCH 1/1 arm64: dts: meson: fix PHY deassert timing requirements

The sync of the device tree and dt-bindings from Linux v5.6-rc2 11a48a5a18c6 ("Linux 5.6-rc2") causes Ethernet to break on some ODROID-C2.

Meanwhile a fix to increase the reset timing has been added to Linux. Instead of reverting the offending commit, use the new reset timing from upstream Linux commit c183c406c432 ("arm64: dts: meson: fix PHY deassert timing requirements").

Fixes dd5f2351e99a ("arm64: dts: meson: sync dt and bindings from v5.6-rc2")
---
 arch/arm/dts/meson-g12b-odroid-n2.dtsi | 2 +-
 arch/arm/dts/meson-gxbb-nanopi-k2.dts  | 2 +-
 arch/arm/dts/meson-gxbb-odroidc2.dts   | 2 +-
 arch/arm/dts/meson-gxm-khadas-vim2.dts | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/meson-g12b-odroid-n2.dtsi +1 -1
index 6982632ae6..39a09661c5 100644
@@ -413,7 +413,7 @@
 		max-speed = <1000>;
 
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;
 		reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
 
 		interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-nanopi-k2.dts +1 -1
index 7be3e35409..de27beafe9 100644
@@ -165,7 +165,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-odroidc2.dts +1 -1
index 70fcfb7b06..50de1d01e5 100644
@@ -200,7 +200,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxm-khadas-vim2.dts +1 -1
index bff8ec2c1c..e38d9e50ca 100644
@@ -194,7 +194,7 @@
 		reg = <0>;
 
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;
 		reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 		interrupt-parent = <&gpio_intc>;
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 arm64: dts: meson: fix PHY deassert timing requirements

Hi,

Quoted 23 lines · Stefan Agner

The sync of the device tree and dt-bindings from Linux v5.6-rc2 11a48a5a18c6 ("Linux 5.6-rc2") causes Ethernet to break on some ODROID-C2.

Meanwhile a fix to increase the reset timing has been added to Linux. Instead of reverting the offending commit, use the new reset timing from upstream Linux commit c183c406c432 ("arm64: dts: meson: fix PHY deassert timing requirements").

Fixes dd5f2351e99a ("arm64: dts: meson: sync dt and bindings from v5.6-rc2")
---
 arch/arm/dts/meson-g12b-odroid-n2.dtsi | 2 +-
 arch/arm/dts/meson-gxbb-nanopi-k2.dts  | 2 +-
 arch/arm/dts/meson-gxbb-odroidc2.dts   | 2 +-
 arch/arm/dts/meson-gxm-khadas-vim2.dts | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/meson-g12b-odroid-n2.dtsi +0 -0
index 6982632ae6..39a09661c5 100644

arch/arm/dts/meson-g12b-odroid-n2.dtsi line 416

Quoted 5 lines
arch/arm/dts/meson-g12b-odroid-n2.dtsi +1 -1
@@ -413,7 +413,7 @@
 		max-speed = <1000>;
 
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;

In fact, these are not used by current U-boot, support for reset/deassert in PHY node is not yet supported in U-Boot. This first step was to switch to DM_MDIO and use the proper Designware glue, the second step is to find how to make use of these properties.

Concerning the patch, I'll prefer you sync the DT with v5.11 instead.

Neil

Quoted 43 lines
arch/arm/dts/meson-g12b-odroid-n2.dtsi +0 -0
 		reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
 
 		interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-nanopi-k2.dts +1 -1
index 7be3e35409..de27beafe9 100644
@@ -165,7 +165,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-odroidc2.dts +1 -1
index 70fcfb7b06..50de1d01e5 100644
@@ -200,7 +200,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxm-khadas-vim2.dts +1 -1
index bff8ec2c1c..e38d9e50ca 100644
@@ -194,7 +194,7 @@
 		reg = <0>;
 
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;
 		reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 		interrupt-parent = <&gpio_intc>;
#2 lore raw

PATCH 1/1 arm64: dts: meson: fix PHY deassert timing requirements

Quoted 28 lines · Neil Armstrong

Hi,

Quoted 25 lines · Stefan Agner

The sync of the device tree and dt-bindings from Linux v5.6-rc2 11a48a5a18c6 ("Linux 5.6-rc2") causes Ethernet to break on some ODROID-C2.

Meanwhile a fix to increase the reset timing has been added to Linux. Instead of reverting the offending commit, use the new reset timing from upstream Linux commit c183c406c432 ("arm64: dts: meson: fix PHY deassert timing requirements").

Fixes dd5f2351e99a ("arm64: dts: meson: sync dt and bindings from v5.6-rc2")
---
 arch/arm/dts/meson-g12b-odroid-n2.dtsi | 2 +-
 arch/arm/dts/meson-gxbb-nanopi-k2.dts  | 2 +-
 arch/arm/dts/meson-gxbb-odroidc2.dts   | 2 +-
 arch/arm/dts/meson-gxm-khadas-vim2.dts | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/meson-g12b-odroid-n2.dtsi +0 -0
index 6982632ae6..39a09661c5 100644
@@ -413,7 +413,7 @@
 		max-speed = <1000>;
 
Quoted 10 lines

arch/arm/dts/meson-g12b-odroid-n2.dtsi line 416

Quoted 3 lines
arch/arm/dts/meson-g12b-odroid-n2.dtsi +1 -1
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;

In fact, these are not used by current U-boot, support for reset/deassert in PHY node
is not yet supported in U-Boot. This first step was to switch to DM_MDIO and use the
proper Designware glue, the second step is to find how to make use of these properties.

Hm, that is strange, I have users reporting that this patch fixes the issue on their devices. I guess it might be that the problem does not always appear and it was just (bad) luck.

Quoted 2 lines

Concerning the patch, I'll prefer you sync the DT with v5.11 instead.

We have multiple reports of non-working ODROID-C2 which worked in previous U-Boot releases:
https://github.com/home-assistant/operating-system/issues/1202

Similar reports exist in Armbian Forums as well.

Until we have proper PHY reset/deassert support, I'd suggest to revert dd5f2351e99a ("arm64: dts: meson: sync dt and bindings from v5.6-rc2") partially then...

--
Stefan

Quoted 46 lines

Neil

Quoted 43 lines
arch/arm/dts/meson-g12b-odroid-n2.dtsi +0 -0
 		reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
 
 		interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-nanopi-k2.dts +1 -1
index 7be3e35409..de27beafe9 100644
@@ -165,7 +165,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-odroidc2.dts +1 -1
index 70fcfb7b06..50de1d01e5 100644
@@ -200,7 +200,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxm-khadas-vim2.dts +1 -1
index bff8ec2c1c..e38d9e50ca 100644
@@ -194,7 +194,7 @@
 		reg = <0>;
 
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;
 		reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 		interrupt-parent = <&gpio_intc>;
#3 lore raw

PATCH 1/1 arm64: dts: meson: fix PHY deassert timing requirements

Quoted 51 lines · Stefan Agner
Quoted 28 lines · Neil Armstrong

Hi,

Quoted 25 lines · Stefan Agner

The sync of the device tree and dt-bindings from Linux v5.6-rc2 11a48a5a18c6 ("Linux 5.6-rc2") causes Ethernet to break on some ODROID-C2.

Meanwhile a fix to increase the reset timing has been added to Linux. Instead of reverting the offending commit, use the new reset timing from upstream Linux commit c183c406c432 ("arm64: dts: meson: fix PHY deassert timing requirements").

Fixes dd5f2351e99a ("arm64: dts: meson: sync dt and bindings from v5.6-rc2")
---
 arch/arm/dts/meson-g12b-odroid-n2.dtsi | 2 +-
 arch/arm/dts/meson-gxbb-nanopi-k2.dts  | 2 +-
 arch/arm/dts/meson-gxbb-odroidc2.dts   | 2 +-
 arch/arm/dts/meson-gxm-khadas-vim2.dts | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/meson-g12b-odroid-n2.dtsi +0 -0
index 6982632ae6..39a09661c5 100644
@@ -413,7 +413,7 @@
 		max-speed = <1000>;
 
Quoted 10 lines

arch/arm/dts/meson-g12b-odroid-n2.dtsi line 416

Quoted 3 lines
arch/arm/dts/meson-g12b-odroid-n2.dtsi +1 -1
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;

In fact, these are not used by current U-boot, support for reset/deassert in PHY node
is not yet supported in U-Boot. This first step was to switch to DM_MDIO and use the
proper Designware glue, the second step is to find how to make use of these properties.

Hm, that is strange, I have users reporting that this patch fixes the issue on their devices. I guess it might be that the problem does not always appear and it was just (bad) luck.

Quoted 2 lines

Concerning the patch, I'll prefer you sync the DT with v5.11 instead.

We have multiple reports of non-working ODROID-C2 which worked in previous U-Boot releases:
https://github.com/home-assistant/operating-system/issues/1202

Quoted 5 lines

Similar reports exist in Armbian Forums as well.

Until we have proper PHY reset/deassert support, I'd suggest to revert dd5f2351e99a ("arm64: dts: meson: sync dt and bindings from v5.6-rc2") partially then...

Reverting this is clearly not a solution, the intermediate solution is to put back the previous reset properties like it was done for multiple boards like in arch/arm/dts/meson-sm1-odroid-c4-u-boot.dtsi :

==========================================================================

arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi +6 -0
index 90087b00db..f1e6914351 100644
@@ -29,6 +29,12 @@
        };
 };
 
+&ethmac {
+        snps,reset-gpio = <&gpio GPIOZ_14 0>;
+        snps,reset-delays-us = <0 10000 1000000>;
+        snps,reset-active-low;
+};
+
 &usb0 {
        status = "disabled";
 };

==========================================================================

Neil

Quoted 51 lines

--
Stefan

Quoted 46 lines

Neil

Quoted 43 lines
arch/arm/dts/meson-g12b-odroid-n2.dtsi +0 -0
 		reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
 
 		interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-nanopi-k2.dts +1 -1
index 7be3e35409..de27beafe9 100644
@@ -165,7 +165,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-odroidc2.dts +1 -1
index 70fcfb7b06..50de1d01e5 100644
@@ -200,7 +200,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxm-khadas-vim2.dts +1 -1
index bff8ec2c1c..e38d9e50ca 100644
@@ -194,7 +194,7 @@
 		reg = <0>;
 
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;
 		reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 		interrupt-parent = <&gpio_intc>;
#4 lore raw

PATCH 1/1 arm64: dts: meson: fix PHY deassert timing requirements

Quoted 54 lines · Neil Armstrong
Quoted 53 lines · Stefan Agner
Quoted 28 lines · Neil Armstrong

Hi,

Quoted 25 lines · Stefan Agner

The sync of the device tree and dt-bindings from Linux v5.6-rc2 11a48a5a18c6 ("Linux 5.6-rc2") causes Ethernet to break on some ODROID-C2.

Meanwhile a fix to increase the reset timing has been added to Linux. Instead of reverting the offending commit, use the new reset timing from upstream Linux commit c183c406c432 ("arm64: dts: meson: fix PHY deassert timing requirements").

Fixes dd5f2351e99a ("arm64: dts: meson: sync dt and bindings from v5.6-rc2")
---
 arch/arm/dts/meson-g12b-odroid-n2.dtsi | 2 +-
 arch/arm/dts/meson-gxbb-nanopi-k2.dts  | 2 +-
 arch/arm/dts/meson-gxbb-odroidc2.dts   | 2 +-
 arch/arm/dts/meson-gxm-khadas-vim2.dts | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/dts/meson-g12b-odroid-n2.dtsi +0 -0
index 6982632ae6..39a09661c5 100644
@@ -413,7 +413,7 @@
 		max-speed = <1000>;
 
Quoted 10 lines

arch/arm/dts/meson-g12b-odroid-n2.dtsi line 416

Quoted 3 lines
arch/arm/dts/meson-g12b-odroid-n2.dtsi +1 -1
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;

In fact, these are not used by current U-boot, support for reset/deassert in PHY node
is not yet supported in U-Boot. This first step was to switch to DM_MDIO and use the
proper Designware glue, the second step is to find how to make use of these properties.

Hm, that is strange, I have users reporting that this patch fixes the issue on their devices. I guess it might be that the problem does not always appear and it was just (bad) luck.

Quoted 2 lines

Concerning the patch, I'll prefer you sync the DT with v5.11 instead.

We have multiple reports of non-working ODROID-C2 which worked in previous U-Boot releases:
https://github.com/home-assistant/operating-system/issues/1202

Similar reports exist in Armbian Forums as well.

Quoted 7 lines
Quoted 3 lines

Until we have proper PHY reset/deassert support, I'd suggest to revert dd5f2351e99a ("arm64: dts: meson: sync dt and bindings from v5.6-rc2") partially then...

Reverting this is clearly not a solution, the intermediate solution is to put back the previous reset properties like it was done for multiple boards like in arch/arm/dts/meson-sm1-odroid-c4-u-boot.dtsi :

Yes, that is what I meant with revert ... partially. :)

I'll send a patch.

--
Stefan

Quoted 74 lines

==========================================================================

arch/arm/dts/meson-gxbb-odroidc2-u-boot.dtsi +6 -0
index 90087b00db..f1e6914351 100644
@@ -29,6 +29,12 @@
        };
 };
 
+&ethmac {
+        snps,reset-gpio = <&gpio GPIOZ_14 0>;
+        snps,reset-delays-us = <0 10000 1000000>;
+        snps,reset-active-low;
+};
+
 &usb0 {
        status = "disabled";
 };

==========================================================================

Neil

Quoted 51 lines

--
Stefan

Quoted 46 lines

Neil

Quoted 43 lines
arch/arm/dts/meson-g12b-odroid-n2.dtsi +0 -0
 		reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
 
 		interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-nanopi-k2.dts +1 -1
index 7be3e35409..de27beafe9 100644
@@ -165,7 +165,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxbb-odroidc2.dts +1 -1
index 70fcfb7b06..50de1d01e5 100644
@@ -200,7 +200,7 @@
 			reg = <0>;
 
 			reset-assert-us = <10000>;
-			reset-deassert-us = <30000>;
+			reset-deassert-us = <80000>;
 			reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 			interrupt-parent = <&gpio_intc>;
arch/arm/dts/meson-gxm-khadas-vim2.dts +1 -1
index bff8ec2c1c..e38d9e50ca 100644
@@ -194,7 +194,7 @@
 		reg = <0>;
 
 		reset-assert-us = <10000>;
-		reset-deassert-us = <30000>;
+		reset-deassert-us = <80000>;
 		reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
 
 		interrupt-parent = <&gpio_intc>;