Skip to contentSkip to conversation

Let the EQoS in imx8mp handle fixed-phy too.

PATCH Superseded Elmar Psilog 2 participants 2 messages Feb 19, 2023 Network drivers

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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>

---
changes v2: fix format issues

 drivers/net/dwc_eth_qos.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/net/dwc_eth_qos.c +16 -3
index 112deb546d..ff638b0f1e 100644
@@ -788,9 +788,22 @@ 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));
+			}
+		}
+
+		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;

--
2.34.1

Reviewed-by on v2 1/1
#1 lore raw
Quoted 20 lines · Elmar Psilog

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>

---
changes v2: fix format issues

  drivers/net/dwc_eth_qos.c | 19 ++++++++++++++++---
  1 file changed, 16 insertions(+), 3 deletions(-)
drivers/net/dwc_eth_qos.c +0 -1
index 112deb546d..ff638b0f1e 100644
@@ -788,9 +788,22 @@ static int eqos_start(struct udevice *dev)
  	 */
  	if (!eqos->phy) {
  		int addr = -1;
-		addr = eqos_get_phy_addr(eqos, dev);

drivers/net/dwc_eth_qos.c static int eqos_start(struct udevice *dev) · line 798

Quoted 10 lines
drivers/net/dwc_eth_qos.c +8 -2
-		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));
+			}

One more nitpick. Drop the curly brackets {} around this statement, i.e. keep only:

	if (ofnode_valid(fixed_node))
		eqos->phy = fixed_phy_create(dev_ofnode(dev));

With that fixed in V3, add:

Thanks !