aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/phy/ethernet_id.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-06-10 14:08:00 -0400
committerTom Rini <trini@konsulko.com>2023-06-10 14:08:00 -0400
commit5b589e139620214f26eb83c9fb7bbd62b5f8fc1d (patch)
tree148aefb39e8e2dac86b475ef4b9e77c26760ef9f /drivers/net/phy/ethernet_id.c
parentcc5a94092317dfd275d18fdcf5884d5d4e4f2c09 (diff)
parent32d2461e0467b50abeb5662fce41fdd686e88b61 (diff)
Merge branch 'next_net/phy_connect_dev' of https://source.denx.de/u-boot/custodians/u-boot-sh into next
Diffstat (limited to 'drivers/net/phy/ethernet_id.c')
-rw-r--r--drivers/net/phy/ethernet_id.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/phy/ethernet_id.c b/drivers/net/phy/ethernet_id.c
index a715e83db9..877a51c3d0 100644
--- a/drivers/net/phy/ethernet_id.c
+++ b/drivers/net/phy/ethernet_id.c
@@ -7,6 +7,8 @@
#include <common.h>
#include <dm/device_compat.h>
+#include <dm/device-internal.h>
+#include <dm/lists.h>
#include <phy.h>
#include <linux/delay.h>
#include <asm/gpio.h>
@@ -17,6 +19,8 @@ struct phy_device *phy_connect_phy_id(struct mii_dev *bus, struct udevice *dev,
struct phy_device *phydev;
struct ofnode_phandle_args phandle_args;
struct gpio_desc gpio;
+ const char *node_name;
+ struct udevice *pdev;
ofnode node;
u32 id, assert, deassert;
u16 vendor, device;
@@ -72,5 +76,18 @@ struct phy_device *phy_connect_phy_id(struct mii_dev *bus, struct udevice *dev,
if (phydev)
phydev->node = node;
+ if (IS_ENABLED(CONFIG_DM_ETH_PHY) && ofnode_valid(node)) {
+ node_name = ofnode_get_name(node);
+ ret = device_bind_driver_to_node(dev, "eth_phy_generic_drv",
+ node_name, node,
+ &pdev);
+ if (ret)
+ return NULL;
+
+ ret = device_probe(pdev);
+ if (ret)
+ return NULL;
+ }
+
return phydev;
}