forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generic: backport Realtek PHY patches from upstream
Adds patches for the temperature sensor on RTL822x. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
- Loading branch information
Showing
13 changed files
with
3,543 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...eric/backport-6.6/781-20-v6.14-net-phy-realtek-add-support-for-reading-MDIO_MMD_VEN.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
From 3d483a10327f38595f714f9f9e9dde43a622cb0f Mon Sep 17 00:00:00 2001 | ||
From: Heiner Kallweit <hkallweit1@gmail.com> | ||
Date: Sat, 11 Jan 2025 21:49:31 +0100 | ||
Subject: [PATCH] net: phy: realtek: add support for reading MDIO_MMD_VEND2 | ||
regs on RTL8125/RTL8126 | ||
|
||
RTL8125/RTL8126 don't support MMD access to the internal PHY, but | ||
provide a mechanism to access at least all MDIO_MMD_VEND2 registers. | ||
By exposing this mechanism standard MMD access functions can be used | ||
to access the MDIO_MMD_VEND2 registers. | ||
|
||
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> | ||
Reviewed-by: Andrew Lunn <andrew@lunn.ch> | ||
Link: https://patch.msgid.link/e821b302-5fe6-49ab-aabd-05da500581c0@gmail.com | ||
Signed-off-by: Jakub Kicinski <kuba@kernel.org> | ||
--- | ||
drivers/net/phy/realtek.c | 12 ++++++++++-- | ||
1 file changed, 10 insertions(+), 2 deletions(-) | ||
|
||
--- a/drivers/net/phy/realtek.c | ||
+++ b/drivers/net/phy/realtek.c | ||
@@ -736,7 +736,11 @@ static int rtlgen_read_mmd(struct phy_de | ||
{ | ||
int ret; | ||
|
||
- if (devnum == MDIO_MMD_PCS && regnum == MDIO_PCS_EEE_ABLE) { | ||
+ if (devnum == MDIO_MMD_VEND2) { | ||
+ rtl821x_write_page(phydev, regnum >> 4); | ||
+ ret = __phy_read(phydev, 0x10 + ((regnum & 0xf) >> 1)); | ||
+ rtl821x_write_page(phydev, 0); | ||
+ } else if (devnum == MDIO_MMD_PCS && regnum == MDIO_PCS_EEE_ABLE) { | ||
rtl821x_write_page(phydev, 0xa5c); | ||
ret = __phy_read(phydev, 0x12); | ||
rtl821x_write_page(phydev, 0); | ||
@@ -760,7 +764,11 @@ static int rtlgen_write_mmd(struct phy_d | ||
{ | ||
int ret; | ||
|
||
- if (devnum == MDIO_MMD_AN && regnum == MDIO_AN_EEE_ADV) { | ||
+ if (devnum == MDIO_MMD_VEND2) { | ||
+ rtl821x_write_page(phydev, regnum >> 4); | ||
+ ret = __phy_write(phydev, 0x10 + ((regnum & 0xf) >> 1), val); | ||
+ rtl821x_write_page(phydev, 0); | ||
+ } else if (devnum == MDIO_MMD_AN && regnum == MDIO_AN_EEE_ADV) { | ||
rtl821x_write_page(phydev, 0xa5d); | ||
ret = __phy_write(phydev, 0x10, val); | ||
rtl821x_write_page(phydev, 0); |
Oops, something went wrong.