public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Elmar Psilog <epsi@gmx.de>
To: u-boot@lists.denx.de
Cc: marex@denx.de, rfried.dev@gmail.com, Elmar Psilog <epsi@gmx.de>
Subject: [PATCH v3] Let the EQoS in imx8mp handle fixed-phy too.
Date: Mon, 20 Feb 2023 16:03:15 +0100	[thread overview]
Message-ID: <20230220150348.26864-1-epsi@gmx.de> (raw)

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>
Reviewed-by: Marek Vasut <marex at denx.de>
---
  changes v2: fix format issues
  changes v3: remove {} around single if, add reviewd..

 drivers/net/dwc_eth_qos.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index 112deb546d..b9de205b8a 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -788,9 +788,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));
+		}
+
+		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


             reply	other threads:[~2023-02-20 15:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 15:03 Elmar Psilog [this message]
2023-03-19 10:43 ` [PATCH v3] Let the EQoS in imx8mp handle fixed-phy too Elmar Psilog
2023-03-19 17:21   ` Marek Vasut
2023-03-19 20:02     ` Elmar Psilog
2023-03-19 22:58       ` Marek Vasut
2023-05-06 14:54 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230220150348.26864-1-epsi@gmx.de \
    --to=epsi@gmx.de \
    --cc=marex@denx.de \
    --cc=rfried.dev@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox