linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: imx6ul-14x14-evk: Do not reset the Ethernet PHYs independently
@ 2021-03-12 11:37 Fabio Estevam
  2021-03-12 14:08 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2021-03-12 11:37 UTC (permalink / raw)
  To: shawnguo
  Cc: kernel, linux-imx, linux-arm-kernel, andrew, qiangqing.zhang,
	Fabio Estevam

The imx6ul-evk board designer took the bad decision to tie the
two Ethernet PHY reset lines together. This prevents one Ethernet
interface to work while the other one is brought down. For example:

 # ifconfig eth0 down
 # [  279.386551] fec 2188000.ethernet eth1: Link is Down

Bringing eth0 interface down also causes eth1 to be down.

The Ethernet reset lines comes from the IO expander and both come in
logic level 0 by default.

To fix this issue, remove the Ethernet PHY reset descriptions from
its respective PHY nodes and force both Ethernet PHY lines to be at
logic level 1 via gpio-hog.

Fixes: 2db7e78bf02b ("ARM: dts: imx6ul-14x14-evk: Describe the KSZ8081 reset")
Reported-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/boot/dts/imx6ul-14x14-evk.dtsi | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
index c593597b2119..5a1e10def6ef 100644
--- a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
+++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
@@ -210,9 +210,6 @@ ethphy0: ethernet-phy@2 {
 			micrel,led-mode = <1>;
 			clocks = <&clks IMX6UL_CLK_ENET_REF>;
 			clock-names = "rmii-ref";
-			reset-gpios = <&gpio_spi 1 GPIO_ACTIVE_LOW>;
-			reset-assert-us = <10000>;
-			reset-deassert-us = <100>;
 
 		};
 
@@ -222,9 +219,6 @@ ethphy1: ethernet-phy@1 {
 			micrel,led-mode = <1>;
 			clocks = <&clks IMX6UL_CLK_ENET2_REF>;
 			clock-names = "rmii-ref";
-			reset-gpios = <&gpio_spi 2 GPIO_ACTIVE_LOW>;
-			reset-assert-us = <10000>;
-			reset-deassert-us = <100>;
 		};
 	};
 };
@@ -243,6 +237,22 @@ &can2 {
 	status = "okay";
 };
 
+&gpio_spi {
+	eth0-phy-hog {
+		gpio-hog;
+		gpios = <1 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "eth0-phy";
+	};
+
+	eth1-phy-hog {
+		gpio-hog;
+		gpios = <2 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "eth1-phy";
+	};
+};
+
 &i2c1 {
 	clock-frequency = <100000>;
 	pinctrl-names = "default";
-- 
2.25.1


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

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

* Re: [PATCH] ARM: imx6ul-14x14-evk: Do not reset the Ethernet PHYs independently
  2021-03-12 11:37 [PATCH] ARM: imx6ul-14x14-evk: Do not reset the Ethernet PHYs independently Fabio Estevam
@ 2021-03-12 14:08 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2021-03-12 14:08 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: shawnguo, kernel, linux-imx, linux-arm-kernel, qiangqing.zhang

On Fri, Mar 12, 2021 at 08:37:46AM -0300, Fabio Estevam wrote:
> The imx6ul-evk board designer took the bad decision to tie the
> two Ethernet PHY reset lines together. This prevents one Ethernet
> interface to work while the other one is brought down. For example:
> 
>  # ifconfig eth0 down
>  # [  279.386551] fec 2188000.ethernet eth1: Link is Down
> 
> Bringing eth0 interface down also causes eth1 to be down.
> 
> The Ethernet reset lines comes from the IO expander and both come in
> logic level 0 by default.
> 
> To fix this issue, remove the Ethernet PHY reset descriptions from
> its respective PHY nodes and force both Ethernet PHY lines to be at
> logic level 1 via gpio-hog.
> 
> Fixes: 2db7e78bf02b ("ARM: dts: imx6ul-14x14-evk: Describe the KSZ8081 reset")
> Reported-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

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

end of thread, other threads:[~2021-03-12 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 11:37 [PATCH] ARM: imx6ul-14x14-evk: Do not reset the Ethernet PHYs independently Fabio Estevam
2021-03-12 14:08 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).