diff options
author | Daniel Golle <daniel@makrotopia.org> | 2023-04-22 01:52:04 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2023-04-22 04:08:41 +0100 |
commit | 998b9731577dedc7747dcfa412e4543dabaaa131 (patch) | |
tree | cdfb9272d251a4b8095e39b63a0de18592d21f77 /target/linux/generic/pending-5.15/725-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch | |
parent | b64c471b8ee3dd7ddfa3b11bf3f1414258c41c94 (diff) | |
download | upstream-998b9731577dedc7747dcfa412e4543dabaaa131.tar.gz upstream-998b9731577dedc7747dcfa412e4543dabaaa131.tar.bz2 upstream-998b9731577dedc7747dcfa412e4543dabaaa131.zip |
kernel: net: phy: realtek: improve RealTek 2.5G PHY driver
* use interface mode switching only when operating in C45 mode
Linux prevents switching the interface mode when using C22 MDIO,
hence use rate-adapter mode in case the PHY controlled via C22.
* use phy_read_paged where appropriate
* use existing generic inline functions to handle 10GbE advertisements
instead of redundantly defining register macros in realtek.c which
are not actually vendor-specific.
* make sure 10GbE advertisement is valid, preventing false-positive
warning "Downshift occurred from negotiated speed 2.5Gbps to actual
speed 1Gbps, check cabling!" with some link-partners using 1G mode.
* Support Link Down Power Saving Mode (ALDPS)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/generic/pending-5.15/725-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch')
-rw-r--r-- | target/linux/generic/pending-5.15/725-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/target/linux/generic/pending-5.15/725-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch b/target/linux/generic/pending-5.15/725-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch index 7f2174e4d2..1370c6324b 100644 --- a/target/linux/generic/pending-5.15/725-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch +++ b/target/linux/generic/pending-5.15/725-net-phy-realtek-disable-SGMII-in-band-AN-for-2-5G-PHYs.patch @@ -26,17 +26,17 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org> + int val; switch (phydev->interface) { - case PHY_INTERFACE_MODE_SGMII: -@@ -906,6 +907,13 @@ static int rtl8221b_config_init(struct p - break; + case PHY_INTERFACE_MODE_2500BASEX: +@@ -911,6 +912,13 @@ static int rtl8221b_config_init(struct p + break; } + /* Disable SGMII AN */ + phy_write_mmd(phydev, RTL8221B_MMD_SERDES_CTRL, 0x7588, 0x2); + phy_write_mmd(phydev, RTL8221B_MMD_SERDES_CTRL, 0x7589, 0x71d0); + phy_write_mmd(phydev, RTL8221B_MMD_SERDES_CTRL, 0x7587, 0x3); -+ phy_read_mmd_poll_timeout(phydev, RTL8221B_MMD_SERDES_CTRL, 0x7587, val, -+ !(val & BIT(0)), 500, 100000, false); ++ phy_read_mmd_poll_timeout(phydev, RTL8221B_MMD_SERDES_CTRL, 0x7587, ++ val, !(val & BIT(0)), 500, 100000, false); + return 0; } |