[PATCH 2/2] net: phy: Release PHY from GPIO reset if applicable

Ramon Fried rfried.dev at gmail.com
Sat Jul 22 10:22:29 CEST 2023


On Tue, Jun 20, 2023 at 1:46 AM Marek Vasut
<marek.vasut+renesas at mailbox.org> wrote:
>
> In case the PHY DT node describes GPIO reset and no other method
> of detecting the PHY succeeded, release the PHY from reset using
> its reset GPIO before reading out the PHY IDs as a last resort.
> This way there is slightly better chance of successful PHY ID
> readout.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
> ---
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> Cc: Marek Vasut <marek.vasut+renesas at mailbox.org>
> Cc: Michal Simek <michal.simek at amd.com>
> Cc: Nishanth Menon <nm at ti.com>
> Cc: Ramon Fried <rfried.dev at gmail.com>
> ---
>  drivers/net/phy/phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 3d69c2c4d28..373006f8206 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -969,7 +969,7 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,
>                 phydev = phy_connect_gmii2rgmii(bus, dev);
>  #endif
>
> -       if (!phydev)
> +       if (!phydev && !phy_gpio_reset(dev))
>                 phydev = phy_find_by_mask(bus, mask);
>
>         if (phydev)
> --
> 2.39.2
>
Reviewed-by: Ramon Fried <rfried.dev at gmail.com>


More information about the U-Boot mailing list