@@ -667,7 +667,7 @@ static int bcm5481x_read_abilities(struct phy_device *phydev)
667
667
{
668
668
struct device_node * np = phydev -> mdio .dev .of_node ;
669
669
struct bcm54xx_phy_priv * priv = phydev -> priv ;
670
- int i , val , err ;
670
+ int i , val , err , aneg ;
671
671
672
672
for (i = 0 ; i < ARRAY_SIZE (bcm54811_linkmodes ); i ++ )
673
673
linkmode_clear_bit (bcm54811_linkmodes [i ], phydev -> supported );
@@ -688,9 +688,19 @@ static int bcm5481x_read_abilities(struct phy_device *phydev)
688
688
if (val < 0 )
689
689
return val ;
690
690
691
+ /* BCM54811 is not capable of LDS but the corresponding bit
692
+ * in LRESR is set to 1 and marked "Ignore" in the datasheet.
693
+ * So we must read the bcm54811 as unable to auto-negotiate
694
+ * in BroadR-Reach mode.
695
+ */
696
+ if (BRCM_PHY_MODEL (phydev ) == PHY_ID_BCM54811 )
697
+ aneg = 0 ;
698
+ else
699
+ aneg = val & LRESR_LDSABILITY ;
700
+
691
701
linkmode_mod_bit (ETHTOOL_LINK_MODE_Autoneg_BIT ,
692
702
phydev -> supported ,
693
- val & LRESR_LDSABILITY );
703
+ aneg );
694
704
linkmode_mod_bit (ETHTOOL_LINK_MODE_100baseT1_Full_BIT ,
695
705
phydev -> supported ,
696
706
val & LRESR_100_1PAIR );
@@ -747,8 +757,15 @@ static int bcm54811_config_aneg(struct phy_device *phydev)
747
757
748
758
/* Aneg firstly. */
749
759
if (priv -> brr_mode ) {
750
- /* BCM54811 is only capable of autonegotiation in IEEE mode */
751
- phydev -> autoneg = 0 ;
760
+ /* BCM54811 is only capable of autonegotiation in IEEE mode.
761
+ * In BroadR-Reach mode, disable the Long Distance Signaling,
762
+ * the BRR mode autoneg as supported in other Broadcom PHYs.
763
+ * This bit is marked as "Reserved" and "Default 1, must be
764
+ * written to 0 after every device reset" in the datasheet.
765
+ */
766
+ ret = phy_modify (phydev , MII_BCM54XX_LRECR , LRECR_LDSEN , 0 );
767
+ if (ret < 0 )
768
+ return ret ;
752
769
ret = bcm_config_lre_aneg (phydev , false);
753
770
} else {
754
771
ret = genphy_config_aneg (phydev );
0 commit comments