aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorDaniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>2018-08-01 07:51:47 -0700
committerJohn Crispin <john@phrozen.org>2018-08-06 09:15:09 +0200
commitf63463591b9f664353b4375f5dfdba980c7bdc07 (patch)
tree8fd846c2a4926661dbeb9e29db38c3fa13c77475 /target
parent9ce7aa325ebdc86426390b0f8adc3ea43d3b8b7d (diff)
downloadupstream-f63463591b9f664353b4375f5dfdba980c7bdc07.tar.gz
upstream-f63463591b9f664353b4375f5dfdba980c7bdc07.tar.bz2
upstream-f63463591b9f664353b4375f5dfdba980c7bdc07.zip
ramips: fix gigabit switch PHY access on MDIO
When PHY's are defined on the MDIO bus in the DTS, gigabit support was being masked out for no apparent reason, pegging all such ports to 10/100. If gigabit support must be disabled for some reason, there should be a "max-speed" property in the DTS. Reported-by: James McKenzie <openwrt@madingley.org> Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us> (cherry picked from commit 379fe506729a20c5fdb072840cb662b032e90c36)
Diffstat (limited to 'target')
-rw-r--r--target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mdio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mdio.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mdio.c
index bdfdf7a432..a1c115687e 100644
--- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mdio.c
+++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mdio.c
@@ -110,7 +110,8 @@ static void phy_init(struct fe_priv *priv, struct phy_device *phy)
phy->autoneg = AUTONEG_ENABLE;
phy->speed = 0;
phy->duplex = 0;
- phy->supported &= PHY_BASIC_FEATURES;
+ phy->supported &= IS_ENABLED(CONFIG_NET_MEDIATEK_MDIO_MT7620) ?
+ PHY_GBIT_FEATURES : PHY_BASIC_FEATURES;
phy->advertising = phy->supported | ADVERTISED_Autoneg;
phy_start_aneg(phy);