From: Michael Chan Date: Fri, 19 Aug 2005 19:54:29 +0000 (-0700) Subject: [TG3]: Fix SerDes detection X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=da6b2d01d6bd2e79fd4f7a08acd37dc4e8fcdce8;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [TG3]: Fix SerDes detection A problem was reported by Grant Grundler on an HP rx8620 using IOX Core LAN partno(A7109-6) 5701 copper NIC. The tg3 driver mistakenly detects this NIC as having a SerDes PHY and link does not come up as a result. The problem was caused by an incorrectly programmed eeprom that set the NIC_SRAM_DATA_CFG_PHY_TYPE_FIBER bit in the NIC_SRAM_DATA_CFG location. This patch will override the NIC_SRAM_DATA_CFG_PHY_TYPE_FIBER bit if a valid PHY ID is read from the MII registers on older 570x chips where the MII interface is not used on SerDes chips. On newer chips such as the 5780 that use MII for both copper and SerDes, SerDes detection must rely on the eeprom. This patch will make the SerDes detection identical to versions 3.25 and older. Signed-off-by: Michael Chan Acked-by: Grant Grundler Signed-off-by: David S. Miller --- diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 368b8fb1402..d75c96de96e 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -8970,6 +8970,8 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) tp->phy_id = hw_phy_id; if (hw_phy_id_masked == PHY_ID_BCM8002) tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; + else + tp->tg3_flags2 &= ~TG3_FLG2_PHY_SERDES; } else { if (tp->phy_id != PHY_ID_INVALID) { /* Do nothing, phy ID already set up in