On Thu, 6 Jun 2019 at 04:50, Samuel Mendoza-Jonas <s...@mendozajonas.com> wrote: > > Update the ftgmac100 driver to support NC-SI instead of an mdio phy > where available. This is a common setup for Aspeed AST2x00 platforms. > > NC-SI mode is determined from the device-tree if either phy-mode sets it > or the use-ncsi property exists. If set then normal mdio setup is > skipped in favour of the NC-SI phy. > > Signed-off-by: Samuel Mendoza-Jonas <s...@mendozajonas.com> > --- > drivers/net/ftgmac100.c | 39 +++++++++++++++++++++++++++++----------
> @@ -181,7 +183,7 @@ static int ftgmac100_phy_adjust_link(struct > ftgmac100_data *priv) > struct phy_device *phydev = priv->phydev; > u32 maccr; > > - if (!phydev->link) { > + if (!phydev->link && !priv->ncsi_mode) { > dev_err(phydev->dev, "No link\n"); > return -EREMOTEIO; > } > @@ -217,7 +219,8 @@ static int ftgmac100_phy_init(struct udevice *dev) > if (!phydev) > return -ENODEV; > > - phydev->supported &= PHY_GBIT_FEATURES; > + if (!priv->ncsi_mode) > + phydev->supported &= PHY_GBIT_FEATURES; Instead of hiding this behind ncsi_mode I was assuming the ncsi "phy" driver would answer these questions through the phy_read callbacks. If you don't think that is going to work then this solution isn't too invasive, and we've been using this in Linux for a while, so we know it works. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot