aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNate Drude2023-07-11 16:59:15 -0500
committerTom Rini2023-07-27 14:32:12 -0400
commite8b4a8d7f0583268a9ecfb4910558e10aa7a473b (patch)
treec6e3a7ca859163001529829eab3697518ebe3678 /drivers
parent3ca495576070f85143372e3070fa405b513c72a2 (diff)
phy: adin: add readext and writeext support for mdio cmd
The adin phy has extended registers that can be accessed using adin_ext_read and adin_ext_write. These registers can be read directly using the mdio command using readext and writext. For example: => mdio rx ethernet@428a0000 0xff23 Reading from bus ethernet@428a0000 PHY at address 0: 65315 - 0xe01 Signed-off-by: Nate Drude <nate.d@variscite.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/adin.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/phy/adin.c b/drivers/net/phy/adin.c
index fb9f1e4c70d..0970449d0f9 100644
--- a/drivers/net/phy/adin.c
+++ b/drivers/net/phy/adin.c
@@ -155,6 +155,18 @@ static int adin_ext_write(struct phy_device *phydev, const u32 regnum, const u16
return phy_write(phydev, MDIO_DEVAD_NONE, ADIN1300_EXT_REG_DATA, val);
}
+static int adin_extread(struct phy_device *phydev, int addr, int devaddr,
+ int regnum)
+{
+ return adin_ext_read(phydev, regnum);
+}
+
+static int adin_extwrite(struct phy_device *phydev, int addr,
+ int devaddr, int regnum, u16 val)
+{
+ return adin_ext_write(phydev, regnum, val);
+}
+
static int adin_config_clk_out(struct phy_device *phydev)
{
ofnode node = phy_get_ofnode(phydev);
@@ -260,4 +272,6 @@ U_BOOT_PHY_DRIVER(ADIN1300) = {
.config = adin1300_config,
.startup = genphy_startup,
.shutdown = genphy_shutdown,
+ .readext = adin_extread,
+ .writeext = adin_extwrite,
};