[Patch] net: dwc_eth_qos - works with fixed-phy

Elmar Psilog epsi at gmx.de
Wed Feb 15 17:16:37 CET 2023


Let the EQoS in imx8mp handle fixed-phy too.
Without that patch it lost track to the node to scan
speed and duplex.
Patch was created by Marek Vasut, just tested by me.

Signed-off-by: Elmar Psilog <epsi at gmx.de>
---
drivers/net/dwc_eth_qos.c
1 file changed

diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index afc47b56ff..10915d8e47 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -785,9 +785,21 @@ static int eqos_start(struct udevice *dev)
          */
         if (!eqos->phy) {
                 int addr = -1;
-               addr = eqos_get_phy_addr(eqos, dev);
-               eqos->phy = phy_connect(eqos->mii, addr, dev,
- eqos->config->interface(dev));
+               ofnode fixed_node;
+
+               if (IS_ENABLED(CONFIG_PHY_FIXED)) {
+                       fixed_node = ofnode_find_subnode(dev_ofnode(dev),
+                               "fixed-link");
+                       if (ofnode_valid(fixed_node)) {
+                               eqos->phy =
fixed_phy_create(dev_ofnode(dev));
+                               eqos->phy_of_node = fixed_node;
+                       }
+               }
+               if (!eqos->phy) {
+                       addr = eqos_get_phy_addr(eqos, dev);
+                       eqos->phy = phy_connect(eqos->mii, addr, dev,
eqos->config->interface(dev));
+               }
+
                 if (!eqos->phy) {
                         pr_err("phy_connect() failed");
                         goto err_stop_resets;


More information about the U-Boot mailing list