[U-Boot] [PATCH 2/3] net: ravb: Detect PHY correctly
Nobuhiro Iwamatsu
iwamatsu at nigauri.org
Wed Aug 2 23:15:48 UTC 2017
Applied to rmobile branch, thanks!
2017-07-22 6:20 GMT+09:00 Marek Vasut <marek.vasut at gmail.com>:
> The order of parameters passed to the phy_connect() was wrong.
> Moreover, only PHY address 0 was used. Replace this with code
> capable of detecting the PHY address.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
> ---
> drivers/net/ravb.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
> index 7f0e2568b7..ce0eacceb6 100644
> --- a/drivers/net/ravb.c
> +++ b/drivers/net/ravb.c
> @@ -298,13 +298,14 @@ static int ravb_phy_config(struct udevice *dev)
> struct ravb_priv *eth = dev_get_priv(dev);
> struct eth_pdata *pdata = dev_get_platdata(dev);
> struct phy_device *phydev;
> - int reg;
> + int mask = 0xffffffff, reg;
>
> - phydev = phy_connect(eth->bus, pdata->phy_interface,
> - dev, PHY_INTERFACE_MODE_RGMII_ID);
> + phydev = phy_find_by_mask(eth->bus, mask, pdata->phy_interface);
> if (!phydev)
> return -ENODEV;
>
> + phy_connect_dev(phydev, dev);
> +
> eth->phydev = phydev;
>
> /* 10BASE is not supported for Ethernet AVB MAC */
> --
> 2.11.0
>
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
More information about the U-Boot
mailing list