From: Chukun Pan Date: Fri, 5 Dec 2025 12:16:02 +0000 (+0800) Subject: mediatek: fix 2.5G PHY LED polarity for MT7987 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5195cd473a9eb622073709e3a32ea51770095eb;p=thirdparty%2Fopenwrt.git mediatek: fix 2.5G PHY LED polarity for MT7987 The patch that adds MT7987 support to the mtk-2p5ge driver does the following: case MTK_2P5GPHY_ID_MT7987: phy_clear_bits_mmd MTK_PHY_LED_ON_POLARITY case MTK_2P5GPHY_ID_MT7988: phy_set_bits_mmd.. MTK_PHY_LED_ON_POLARITY phy_set_bits_mmd... MTK_PHY_LED_ON_POLARITY | xxx This clearly resulted in the LED polarity of the 2.5G PHY on the MT7987 being reversed. Remove redundant MMD operations to fix the 2.5G PHY LED error on Bananapi BPi-R4 Lite. Fixes: d62fc50f ("mediatek: import patches from SDK to support MT7987 Ethernet") Signed-off-by: Chukun Pan --- diff --git a/target/linux/mediatek/patches-6.12/752-net-phy-mediatek-i2p5g-add-support-for-mt7987.patch b/target/linux/mediatek/patches-6.12/752-net-phy-mediatek-i2p5g-add-support-for-mt7987.patch index de720a35712..eea7f6e79ac 100644 --- a/target/linux/mediatek/patches-6.12/752-net-phy-mediatek-i2p5g-add-support-for-mt7987.patch +++ b/target/linux/mediatek/patches-6.12/752-net-phy-mediatek-i2p5g-add-support-for-mt7987.patch @@ -344,7 +344,7 @@ { struct mtk_i2p5ge_phy_priv *priv = phydev->priv; void __iomem *mcu_csr_base, *pmb_addr; -@@ -135,7 +449,20 @@ static int mt798x_2p5ge_phy_config_init( +@@ -135,15 +449,27 @@ static int mt798x_2p5ge_phy_config_init( if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL) return -ENODEV; @@ -366,7 +366,17 @@ if (ret < 0) return ret; -@@ -293,6 +620,7 @@ static int mt798x_2p5ge_phy_probe(struct + /* Setup LED */ + phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MTK_PHY_LED0_ON_CTRL, +- MTK_PHY_LED_ON_POLARITY | MTK_PHY_LED_ON_LINK10 | +- MTK_PHY_LED_ON_LINK100 | MTK_PHY_LED_ON_LINK1000 | +- MTK_PHY_LED_ON_LINK2500); ++ MTK_PHY_LED_ON_LINK10 | MTK_PHY_LED_ON_LINK100 | ++ MTK_PHY_LED_ON_LINK1000 | MTK_PHY_LED_ON_LINK2500); + phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MTK_PHY_LED1_ON_CTRL, + MTK_PHY_LED_ON_FDX | MTK_PHY_LED_ON_HDX); + +@@ -293,6 +619,7 @@ static int mt798x_2p5ge_phy_probe(struct return -ENOMEM; switch (phydev->drv->phy_id) { @@ -374,7 +384,7 @@ case MTK_2P5GPHY_ID_MT7988: /* The original hardware only sets MDIO_DEVS_PMAPMD */ phydev->c45_ids.mmds_present |= MDIO_DEVS_PCS | -@@ -312,6 +640,20 @@ static int mt798x_2p5ge_phy_probe(struct +@@ -312,6 +639,20 @@ static int mt798x_2p5ge_phy_probe(struct static struct phy_driver mtk_2p5gephy_driver[] = { {