[U-Boot] [PATCH v7 14/17] net: fec_mxc: Add 'phy-reset-gpios' support

Fabio Estevam
2017-05-23T10:53:16Z

Hi Jagan,

On Tue, May 23, 2017 at 4:58 AM, Jagan Teki <jagannadh.teki@gmail.com> wrote:

> +#if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_GPIO)
> +static int fec_phy_reset(struct mii_dev *bus)
> +{
> + struct fec_priv *priv = dev_get_priv((struct udevice *)bus->priv);
> +
> + if (!dm_gpio_is_valid(&priv->reset_gpio))
> + return 0;
> +
> + /* phy reset */
> + dm_gpio_set_value(&priv->reset_gpio, 0);
> + udelay(100);
> + dm_gpio_set_value(&priv->reset_gpio, 1);
> + udelay(100);

Please don't add a fixed delay here. It would be better to do like in
the kernel where we also have the 'phy-reset-duration' property that
specifies the reset duration.