diff options
author | Marek Vasut | 2024-01-28 02:19:40 +0100 |
---|---|---|
committer | Tom Rini | 2024-03-09 10:58:48 -0500 |
commit | 91e70367a5dcfe04227d6b85a4a88c7a5b43f472 (patch) | |
tree | 9da79a34379dd28b477c7394e6d29058e516d771 /drivers | |
parent | 485bfe1adbb3f6eb112424fc9e7cc399c16daef5 (diff) |
net: phy: Use PHY MDIO address from DT if available
In case the PHY is fully described in DT, use PHY MDIO address
from DT directly instead of always using auto-detection. This
also fixes the behavior of 'mdio list' in such DT setup, which
now prints the PHY connected to the MAC correctly.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/ethernet_id.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/phy/ethernet_id.c b/drivers/net/phy/ethernet_id.c index 877a51c3d00..6cb1fd4453e 100644 --- a/drivers/net/phy/ethernet_id.c +++ b/drivers/net/phy/ethernet_id.c @@ -71,6 +71,9 @@ struct phy_device *phy_connect_phy_id(struct mii_dev *bus, struct udevice *dev, } } + if (phyaddr == -1) + phyaddr = ofnode_read_u32_default(phandle_args.node, "reg", -1); + id = vendor << 16 | device; phydev = phy_device_create(bus, phyaddr, id, false); if (phydev) |