[U-Boot] [PATCH 03/10] net: designware: support phy reset device-tree bindings

Sjoerd Simons sjoerd.simons at collabora.co.uk
Thu Oct 1 21:17:51 CEST 2015


On Thu, 2015-10-01 at 19:02 +0800, Bin Meng wrote:
> Hi Sjoerd,
> 
> On Thu, Oct 1, 2015 at 5:48 PM, Sjoerd Simons
> <sjoerd.simons at collabora.co.uk> wrote:

> > -static int dw_mdio_init(const char *name, struct eth_mac_regs
> > *mac_regs_p)
> > +#if CONFIG_DM_ETH
> > +static int dw_mdio_reset(struct mii_dev *bus)
> > +{
> > +       struct udevice *dev = bus->priv;
> > +       struct dw_eth_pdata *pdata = dev_get_platdata(dev);
> > +       int ret;
> > +
> > +       if (pdata->reset_gpio.dev == NULL)
> > +               return 0;
> > +
> > +       /* reset the phy */
> > +       ret = dm_gpio_set_value(&pdata->reset_gpio, 0);
> > +       if (ret)
> > +               return ret;
> > +
> 
> Is this PHY reset a must every time we start the MAC? If this is just
> one-time reset, can it be moved to board-specific codes?

The MDIO bus reset is only triggered from dw_phy_init, which is called
by the probe function in a DM build. So that should already only run
once, instead of at every MAC start.

In any case, the whole point of implementing it here is that it's a
common device-tree binding for all designware macs so it's much nice to
implement it in a central place rather then duplicating it for all
boards in board-specific code :)

-- 
Sjoerd Simons
Collabora Ltd.


More information about the U-Boot mailing list