summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMikhail Kshevetskiy <[email protected]>2026-03-15 10:47:55 +0300
committerJerome Forissier <[email protected]>2026-03-31 16:43:28 +0200
commita05c0d17321e09353bb4a5b993f8d4579f1696c8 (patch)
tree1810cf6d2f11fc8f584fa8d2dd420cd646ca2c9d /drivers/net
parent0da1866a8fdd4d4bc4837ef2af281dbe010ae16b (diff)
net: airoha: probe airoha switch mdio on airoha_eth probing
Airoha switch mdio maybe used not only by GDM1, but also by other GDM ports (ex: as21xxx phy connected to GDM2 port). So it's better probe airoha switch mdio a bit early in the airoha_eth_probe() code. Also remove useless eth_phy_set_mdio_bus() call and related code. Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/airoha_eth.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
index f60405392b6..84ee9b2ad76 100644
--- a/drivers/net/airoha_eth.c
+++ b/drivers/net/airoha_eth.c
@@ -12,7 +12,6 @@
#include <dm/device-internal.h>
#include <dm/devres.h>
#include <dm/lists.h>
-#include <eth_phy.h>
#include <mapmem.h>
#include <miiphy.h>
#include <net.h>
@@ -909,6 +908,11 @@ static int airoha_eth_probe(struct udevice *dev)
if (ret)
return ret;
+ if (eth->switch_mdio_dev) {
+ if (!device_probe(eth->switch_mdio_dev))
+ debug("Warning: failed to probe airoha switch mdio\n");
+ }
+
ofnode_for_each_subnode(node, dev_ofnode(dev)) {
if (!ofnode_device_is_compatible(node, "airoha,eth-mac"))
continue;
@@ -935,8 +939,6 @@ static int airoha_eth_port_probe(struct udevice *dev)
{
struct airoha_eth *eth = (void *)dev_get_driver_data(dev);
struct airoha_gdm_port *port = dev_get_priv(dev);
- struct mdio_perdev_priv *pdata;
- struct mii_dev *mdio_bus;
int ret;
port->qdma = &eth->qdma[0];
@@ -945,7 +947,6 @@ static int airoha_eth_port_probe(struct udevice *dev)
if (ret)
return ret;
- mdio_bus = NULL;
if (port->id > 1) {
#if defined(CONFIG_PCS_AIROHA)
ret = airoha_pcs_init(dev);
@@ -953,24 +954,11 @@ static int airoha_eth_port_probe(struct udevice *dev)
return ret;
port->phydev = dm_eth_phy_connect(dev);
- if (port->phydev)
- mdio_bus = port->phydev->bus;
#else
return -EINVAL;
#endif
- } else {
- if (eth->switch_mdio_dev &&
- !device_probe(eth->switch_mdio_dev)) {
- pdata = dev_get_uclass_priv(eth->switch_mdio_dev);
- mdio_bus = pdata->mii_bus;
- }
}
-#ifdef CONFIG_DM_ETH_PHY
- if (!IS_ERR_OR_NULL(mdio_bus))
- eth_phy_set_mdio_bus(dev, mdio_bus);
-#endif
-
return 0;
}