]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: eth-phy: prevent undesired de-assertion of phy-reset on request
authorTim Harvey <tharvey@gateworks.com>
Tue, 1 Mar 2022 20:15:02 +0000 (12:15 -0800)
committerRamon Fried <ramon@neureality.ai>
Sun, 10 Apr 2022 05:44:13 +0000 (08:44 +0300)
When gpio_request_by_name allocates a gpio output it by default will
de-assert the gpio which for phy-reset will take the PHY out of reset.
As this occurs before eth_phy_reset is called to assert the reset
line it can cause undesired affects if reset timings are not properly
met.

Configure the gpio with GPIOD_IS_OUT_ACTIVE so that reset is kept active
(reset asserted) to avoid this.

Cc: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
drivers/net/eth-phy-uclass.c

index 1f285f7afd20ac749d993678052dd03b659c9d38..27b77444a0c58fd2ece8c68f81820ebe8630f1c2 100644 (file)
@@ -137,7 +137,7 @@ static int eth_phy_of_to_plat(struct udevice *dev)
        /* search "reset-gpios" in phy node */
        ret = gpio_request_by_name(dev, "reset-gpios", 0,
                                   &uc_priv->reset_gpio,
-                                  GPIOD_IS_OUT);
+                                  GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
        if (ret && ret != -ENOENT)
                return ret;