mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2 09/11] net: phy: at803x: disable SmartEEE
Date: Fri, 11 Aug 2023 12:26:55 +0200	[thread overview]
Message-ID: <20230811102657.271931-9-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20230811102657.271931-1-m.felsch@pengutronix.de>

The SmartEEE functionality can cause strange connection issues. Disable
it unconditional and leave it to the OS to enable it again.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
v2:
- always disable smarteee (afa)
- adapt commit message

 drivers/net/phy/at803x.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index f0a14799234b..2e3e57b27ee6 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -59,6 +59,9 @@
  */
 #define AT8035_CLK_OUT_MASK			GENMASK(4, 3)
 
+#define AT803X_MMD3_SMARTEEE_CTL3		0x805d
+#define AT803X_MMD3_SMARTEEE_CTL3_LPI_EN	BIT(8)
+
 #define AT803X_CLK_OUT_STRENGTH_MASK		GENMASK(8, 7)
 #define AT803X_CLK_OUT_STRENGTH_FULL		0
 #define AT803X_CLK_OUT_STRENGTH_HALF		1
@@ -221,6 +224,12 @@ static int at803x_probe(struct phy_device *phydev)
 	return at803x_parse_dt(phydev);
 }
 
+static int at803x_smarteee_config(struct phy_device *phydev)
+{
+	return phy_modify_mmd(phydev, MDIO_MMD_PCS, AT803X_MMD3_SMARTEEE_CTL3,
+			      AT803X_MMD3_SMARTEEE_CTL3_LPI_EN, 0);
+}
+
 static int at803x_clk_out_config(struct phy_device *phydev)
 {
 	struct at803x_priv *priv = phydev->priv;
@@ -270,7 +279,15 @@ static int at803x_config_init(struct phy_device *phydev)
 	if (ret < 0)
 		return ret;
 
-	return at803x_clk_out_config(phydev);
+	ret = at803x_smarteee_config(phydev);
+	if (ret < 0)
+		return ret;
+
+	ret = at803x_clk_out_config(phydev);
+	if (ret < 0)
+		return ret;
+
+	return 0;
 }
 
 static struct phy_driver at803x_driver[] = {
-- 
2.39.2




  parent reply	other threads:[~2023-08-11 10:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11 10:26 [PATCH v2 01/11] ARM: boards: make use of MDIO_MMD register defines Marco Felsch
2023-08-11 10:26 ` [PATCH v2 02/11] net: phy: micrel: " Marco Felsch
2023-08-11 10:26 ` [PATCH v2 03/11] net: phy: fix struct member comments Marco Felsch
2023-08-11 10:26 ` [PATCH v2 04/11] net: phy: mmd_phy_indirect: align parameters with Linux Marco Felsch
2023-08-11 10:26 ` [PATCH v2 05/11] net: phy: add phydev_{err,err_probe,info,warn,dbg} macros Marco Felsch
2023-08-11 10:26 ` [PATCH v2 06/11] net: phy: import phy_{read,write,modify}_mmd helpers from Linux Marco Felsch
2023-08-11 10:26 ` [PATCH v2 07/11] net: phy: replace phy_{write,read,modify}_mmd_indirect with phy_{write,read,modify}_mmd Marco Felsch
2023-08-11 10:26 ` [PATCH v2 08/11] net: phy: add deprecation warning to phy_{read,write,modify}_mmd_indirect Marco Felsch
2023-08-11 10:26 ` Marco Felsch [this message]
2023-08-11 10:26 ` [PATCH v2 10/11] net: phy: at803x: add disable hibernation mode support Marco Felsch
2023-08-11 10:26 ` [PATCH v2 11/11] net: phy: at803x: disable extended next page bit Marco Felsch
2023-08-14  6:19 ` [PATCH v2 01/11] ARM: boards: make use of MDIO_MMD register defines Sascha Hauer

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=20230811102657.271931-9-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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