From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 1/4] phy: atheros: ar8035: Fix clock output calculation
Date: Thu, 18 Jun 2020 16:05:21 -0300 [thread overview]
Message-ID: <20200618190524.21272-1-festevam@gmail.com> (raw)
The clock ouput frequency is calculated incorrectly for AR8035 due to
wrong masking of priv->clk_25m_reg and priv->clk_25m_mask.
This same issue has been already fixed in the kernel by:
commit b1f4c209d84057b6d40b939b6e4404854271d797
Author: Oleksij Rempel <o.rempel@pengutronix.de>
Date: Wed Apr 1 11:57:32 2020 +0200
net: phy: at803x: fix clock sink configuration on ATH8030 and ATH8035
The masks in priv->clk_25m_reg and priv->clk_25m_mask are one-bits-set
for the values that comprise the fields, not zero-bits-set.
This patch fixes the clock frequency configuration for ATH8030 and
ATH8035 Atheros PHYs by removing the erroneous "~".
To reproduce this bug, configure the PHY with the device tree binding
"qca,clk-out-frequency" and remove the machine specific PHY fixups.
Fixes: 2f664823a47021 ("net: phy: at803x: add device tree binding")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Apply the same fix in the U-Boot driver.
Tested on a i.MX6 Hummingboard.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Michael Walle <michael@walle.cc>
---
drivers/net/phy/atheros.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
index 13f7275d17..f922fecd6b 100644
--- a/drivers/net/phy/atheros.c
+++ b/drivers/net/phy/atheros.c
@@ -275,11 +275,10 @@ static int ar803x_of_init(struct phy_device *phydev)
* Fixup for the AR8035 which only has two bits. The two
* remaining bits map to the same frequencies.
*/
- if (phydev->drv->uid == AR8035_PHY_ID) {
- u16 clear = AR803x_CLK_25M_MASK & AR8035_CLK_25M_MASK;
- priv->clk_25m_mask &= ~clear;
- priv->clk_25m_reg &= ~clear;
+ if (phydev->drv->uid == AR8035_PHY_ID) {
+ priv->clk_25m_reg &= AR8035_CLK_25M_MASK;
+ priv->clk_25m_mask &= AR8035_CLK_25M_MASK;
}
}
--
2.17.1
next reply other threads:[~2020-06-18 19:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 19:05 Fabio Estevam [this message]
2020-06-18 19:05 ` [PATCH 2/4] net: fec: Allow the PHY node to be retrieved Fabio Estevam
2020-06-18 19:26 ` Tom Rini
2020-06-18 19:05 ` [PATCH 3/4] ARM: dts: imx6qdl-sr-som: Sync with kernel 5.8-rc1 Fabio Estevam
2020-06-18 19:26 ` Tom Rini
2020-06-18 19:05 ` [PATCH 4/4] mx6cuboxi: Convert to DM_ETH Fabio Estevam
2020-06-18 19:25 ` Baruch Siach
2020-06-18 19:26 ` Tom Rini
2020-06-18 19:30 ` Vladimir Oltean
2020-06-18 19:26 ` [PATCH 1/4] phy: atheros: ar8035: Fix clock output calculation 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=20200618190524.21272-1-festevam@gmail.com \
--to=festevam@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.