]> Git Repo - J-u-boot.git/commitdiff
phy: atheros: ar8035: Fix clock output calculation
authorFabio Estevam <[email protected]>
Thu, 18 Jun 2020 23:21:17 +0000 (20:21 -0300)
committerStefano Babic <[email protected]>
Mon, 22 Jun 2020 15:40:41 +0000 (17:40 +0200)
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 <[email protected]>
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 <[email protected]>
Reported-by: Russell King <[email protected]>
Reviewed-by: Russell King <[email protected]>
Tested-by: Russell King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Apply the same fix in the U-Boot driver.

Tested on a i.MX6 Hummingboard.

Signed-off-by: Fabio Estevam <[email protected]>
Reviewed-by: Michael Walle <[email protected]>
Tested-by: Tom Rini <[email protected]>
drivers/net/phy/atheros.c

index 13f7275d17064bd03043d34845afc3ac9e5a66b0..f922fecd6b5d9a61098833fc2ef6dfbcf12bb8e0 100644 (file)
@@ -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;
                }
        }
 
This page took 0.034691 seconds and 4 git commands to generate.