brcm63xx: do a full reset phy cycle
authorJonas Gorski <jonas.gorski@gmail.com>
Wed, 1 Feb 2017 11:11:07 +0000 (12:11 +0100)
committerJonas Gorski <jonas.gorski@gmail.com>
Fri, 10 Feb 2017 09:51:09 +0000 (10:51 +0100)
Make sure we do a proper reset of the phy, if the phy reset is defined.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch [new file with mode: 0644]

diff --git a/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch b/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch
new file mode 100644 (file)
index 0000000..dc9e3c1
--- /dev/null
@@ -0,0 +1,28 @@
+From: Jonas Gorski <jonas.gorski@gmail.com>
+Subject: [PATCH] net: bcm63xx_enet: fully reset ephy
+
+Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
+---
+ drivers/net/ethernet/broadcom/bcm63xx_enet.c |    4 ++--
+ 1 file changed, 2 insertions(+), , 1 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+@@ -2857,7 +2857,7 @@ static int bcm_enet_shared_probe(struct
+       memset(bcm_enet_shared_base, 0, sizeof(bcm_enet_shared_base));
+-      ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_ASIS);
++      ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_OUT_HIGH);
+       if (IS_ERR(ephy_reset))
+               return PTR_ERR(ephy_reset);
+@@ -2871,7 +2871,7 @@ static int bcm_enet_shared_probe(struct
+       memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base));
+       if (ephy_reset)
+-              gpiod_direction_output(ephy_reset, 0);
++              gpiod_set_value(ephy_reset, 0);
+       return 0;
+ }