summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/designware.c10
-rw-r--r--drivers/net/phy/phy.c4
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 49ddaa2..58880b0 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -408,12 +408,22 @@ static void dwc_version(struct device_d *dev, u32 hwid)
static int dwc_probe_dt(struct device_d *dev, struct dw_eth_dev *priv)
{
+ struct device_node *child;
+
if (!IS_ENABLED(CONFIG_OFTREE))
return -ENODEV;
priv->phy_addr = -1;
priv->interface = of_get_phy_mode(dev->device_node);
+ /* Set MDIO bus device node, if present. */
+ for_each_child_of_node(dev->device_node, child) {
+ if (of_device_is_compatible(child, "snps,dwmac-mdio")) {
+ priv->miibus.dev.device_node = child;
+ break;
+ }
+ }
+
return 0;
}
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 42dcad9..63f249f 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -398,6 +398,10 @@ static int phy_device_attach(struct phy_device *phy, struct eth_device *edev,
phy->adjust_link = adjust_link;
+ /* If the phy is a fixed-link, then call adjust_link directly */
+ if (!phy->bus && adjust_link)
+ adjust_link(edev);
+
return 0;
}