diff options
author | Tom Rini <trini@konsulko.com> | 2022-01-18 16:07:33 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-01-18 16:07:33 -0500 |
commit | 6a685753ce8b6b02b67d64b239143bf19eda63c9 (patch) | |
tree | 872c41b62af1a07287b695808c6207f36f29ec53 /drivers/net/ftgmac100.c | |
parent | 115090ef59ba6a371bed40181af8ceecc5635777 (diff) | |
parent | 60435ca4da823e40c4a9c7b4eda3c0b68966f9ee (diff) |
Merge branch '2022-01-18-platform-updates'
- cubieboard7 MMC support, AST2600 MAC support
Diffstat (limited to 'drivers/net/ftgmac100.c')
-rw-r--r-- | drivers/net/ftgmac100.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c index 0687230b4b..aa719d295f 100644 --- a/drivers/net/ftgmac100.c +++ b/drivers/net/ftgmac100.c @@ -220,7 +220,11 @@ static int ftgmac100_phy_init(struct udevice *dev) struct phy_device *phydev; int ret; - phydev = phy_connect(priv->bus, priv->phy_addr, dev, priv->phy_mode); + if (IS_ENABLED(CONFIG_DM_MDIO)) + phydev = dm_eth_phy_connect(dev); + else + phydev = phy_connect(priv->bus, priv->phy_addr, dev, priv->phy_mode); + if (!phydev) return -ENODEV; @@ -589,10 +593,16 @@ static int ftgmac100_probe(struct udevice *dev) if (ret) goto out; - ret = ftgmac100_mdio_init(dev); - if (ret) { - dev_err(dev, "Failed to initialize mdiobus: %d\n", ret); - goto out; + /* + * If DM MDIO is enabled, the MDIO bus will be initialized later in + * dm_eth_phy_connect + */ + if (!IS_ENABLED(CONFIG_DM_MDIO)) { + ret = ftgmac100_mdio_init(dev); + if (ret) { + dev_err(dev, "Failed to initialize mdiobus: %d\n", ret); + goto out; + } } ret = ftgmac100_phy_init(dev); @@ -634,6 +644,7 @@ static const struct eth_ops ftgmac100_ops = { static const struct udevice_id ftgmac100_ids[] = { { .compatible = "faraday,ftgmac100", .data = FTGMAC100_MODEL_FARADAY }, { .compatible = "aspeed,ast2500-mac", .data = FTGMAC100_MODEL_ASPEED }, + { .compatible = "aspeed,ast2600-mac", .data = FTGMAC100_MODEL_ASPEED }, { } }; |