[U-Boot] [PATCH v2 1/3] net: phy: ar803x: Use phy_read_mmd and phy_write_mmd functions

Vladimir Oltean vladimir.oltean at nxp.com
Wed Jan 23 17:00:56 UTC 2019


Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
---
Changes in v2:
 * Patch added in this version.

 drivers/net/phy/atheros.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
index 3783d15..b4066e3 100644
--- a/drivers/net/phy/atheros.c
+++ b/drivers/net/phy/atheros.c
@@ -57,11 +57,9 @@ static int ar8035_config(struct phy_device *phydev)
 {
 	int regval;
 
-	phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x0007);
-	phy_write(phydev, MDIO_DEVAD_NONE, 0xe, 0x8016);
-	phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007);
-	regval = phy_read(phydev, MDIO_DEVAD_NONE, 0xe);
-	phy_write(phydev, MDIO_DEVAD_NONE, 0xe, (regval|0x0018));
+	/* CLK_25M output clock select: 125 MHz */
+	regval = phy_read_mmd(phydev, MDIO_MMD_AN, 0x8016);
+	phy_write_mmd(phydev, MDIO_MMD_AN, 0x8016, regval | 0x0018);
 
 	phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05);
 	regval = phy_read(phydev, MDIO_DEVAD_NONE, 0x1e);
-- 
2.7.4



More information about the U-Boot mailing list