[U-Boot] [PATCH] Revert "net: phy: delay only if reset handler is registered"

Stefan Roese stefan.roese at gmail.com
Wed Nov 18 06:54:21 CET 2015


Hi Fabio,

On 17.11.2015 17:25, Fabio Estevam wrote:
> This reverts commit 59370f3fcd135089c402c93720a87c688abe600c.
>
> This commit breaks ethernet on at least mx6 Riotboard and
> mx6sxsabresd boards.
>
> Reported-by: Catalin Crenguta <catalin.crenguta at gmail.com>
> Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
> ---
>   drivers/net/phy/phy.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index d7364ff..9e68f1d 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -771,13 +771,11 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask,
>   		phy_interface_t interface)
>   {
>   	/* Reset the bus */
> -	if (bus->reset) {
> +	if (bus->reset)
>   		bus->reset(bus);
>
> -		/* Wait 15ms to make sure the PHY has come out of hard reset */
> -		udelay(15000);
> -	}
> -
> +	/* Wait 15ms to make sure the PHY has come out of hard reset */
> +	udelay(15000);
>   	return get_phy_device_by_mask(bus, phy_mask, interface);
>   }

I'm not sure if this revert is the right way to solve this problem.
Please take a look at my answer a few weeks ago:

https://www.mail-archive.com/u-boot@lists.denx.de/msg191206.html

As mentioned in my mail above, the delay should be added after
the deassertion of the PHY reset signal. And not here in
phy_find_by_mask() for all boards.

I just checked the code in mx6sxsabresd.c. Here also the delay is
missing:

         /* Reset AR8031 PHY */
         gpio_direction_output(IMX_GPIO_NR(2, 7) , 0);
         udelay(500);
         gpio_set_value(IMX_GPIO_NR(2, 7), 1);

Could you please test with this change:

	/* Reset AR8031 PHY */
	gpio_direction_output(IMX_GPIO_NR(2, 7) , 0);
	udelay(500);
	gpio_set_value(IMX_GPIO_NR(2, 7), 1);
+	udelay(1500);

Or even better, check how long the reset needs to be inactive
before the PHY starts to work.

Thanks,
Stefan



More information about the U-Boot mailing list