-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mediatek: replace hack for MaxLinear 2.5G PHY
Replace hack with proper patch also for Linux 5.15. Signed-off-by: Daniel Golle <[email protected]>
- Loading branch information
Showing
3 changed files
with
63 additions
and
166 deletions.
There are no files selected for viewing
166 changes: 0 additions & 166 deletions
166
target/linux/mediatek/patches-5.15/731-net-phy-hack-mxl-gpy-disable-sgmii-an.patch
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
...linux/mediatek/patches-5.15/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.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,63 @@ | ||
From a969b663c866129ed9eb217785a6574fbe826f1d Mon Sep 17 00:00:00 2001 | ||
From: Daniel Golle <[email protected]> | ||
Date: Thu, 6 Apr 2023 23:36:50 +0100 | ||
Subject: [PATCH] net: phy: mxl-gpy: don't use SGMII AN if using phylink | ||
|
||
MAC drivers using phylink expect SGMII in-band-status to be switched off | ||
when attached to a PHY. Make sure this is the case also for mxl-gpy which | ||
keeps SGMII in-band-status in case of SGMII interface mode is used. | ||
|
||
Signed-off-by: Daniel Golle <[email protected]> | ||
--- | ||
drivers/net/phy/mxl-gpy.c | 19 ++++++++++++++++--- | ||
1 file changed, 16 insertions(+), 3 deletions(-) | ||
|
||
--- a/drivers/net/phy/mxl-gpy.c | ||
+++ b/drivers/net/phy/mxl-gpy.c | ||
@@ -191,8 +191,11 @@ static bool gpy_2500basex_chk(struct phy | ||
|
||
phydev->speed = SPEED_2500; | ||
phydev->interface = PHY_INTERFACE_MODE_2500BASEX; | ||
- phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_SGMII_CTRL, | ||
- VSPEC1_SGMII_CTRL_ANEN, 0); | ||
+ | ||
+ if (!phydev->phylink) | ||
+ phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_SGMII_CTRL, | ||
+ VSPEC1_SGMII_CTRL_ANEN, 0); | ||
+ | ||
return true; | ||
} | ||
|
||
@@ -216,6 +219,14 @@ static int gpy_config_aneg(struct phy_de | ||
u32 adv; | ||
int ret; | ||
|
||
+ /* Disable SGMII auto-negotiation if using phylink */ | ||
+ if (phydev->phylink) { | ||
+ ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_SGMII_CTRL, | ||
+ VSPEC1_SGMII_CTRL_ANEN, 0); | ||
+ if (ret < 0) | ||
+ return ret; | ||
+ } | ||
+ | ||
if (phydev->autoneg == AUTONEG_DISABLE) { | ||
/* Configure half duplex with genphy_setup_forced, | ||
* because genphy_c45_pma_setup_forced does not support. | ||
@@ -306,6 +317,8 @@ static void gpy_update_interface(struct | ||
switch (phydev->speed) { | ||
case SPEED_2500: | ||
phydev->interface = PHY_INTERFACE_MODE_2500BASEX; | ||
+ if (phydev->phylink) | ||
+ break; | ||
ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_SGMII_CTRL, | ||
VSPEC1_SGMII_CTRL_ANEN, 0); | ||
if (ret < 0) | ||
@@ -317,7 +330,7 @@ static void gpy_update_interface(struct | ||
case SPEED_100: | ||
case SPEED_10: | ||
phydev->interface = PHY_INTERFACE_MODE_SGMII; | ||
- if (gpy_sgmii_aneg_en(phydev)) | ||
+ if (phydev->phylink || gpy_sgmii_aneg_en(phydev)) | ||
break; | ||
/* Enable and restart SGMII ANEG for 10/100/1000Mbps link speed | ||
* if ANEG is disabled (in 2500-BaseX mode). |
File renamed without changes.