Skip to content

Commit aebd994

Browse files
nomisdavem330
authored andcommitted
bcm63xx_enet: check 1000BASE-T advertisement configuration
If a gigabit ethernet PHY is connected to a fast ethernet MAC, then it can detect 1000 support from the partner but not use it. This results in a forced speed of 1000 and RX/TX failure. Check for 1000BASE-T support and then check the advertisement configuration before setting the MAC speed to 1000mbit. Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1099f86 commit aebd994

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

drivers/net/ethernet/broadcom/bcm63xx_enet.c

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ static void swphy_poll_timer(unsigned long data)
20492049

20502050
for (i = 0; i < priv->num_ports; i++) {
20512051
struct bcm63xx_enetsw_port *port;
2052-
int val, j, up, advertise, lpa, lpa2, speed, duplex, media;
2052+
int val, j, up, advertise, lpa, speed, duplex, media;
20532053
int external_phy = bcm_enet_port_is_rgmii(i);
20542054
u8 override;
20552055

@@ -2092,22 +2092,27 @@ static void swphy_poll_timer(unsigned long data)
20922092
lpa = bcmenet_sw_mdio_read(priv, external_phy, port->phy_id,
20932093
MII_LPA);
20942094

2095-
lpa2 = bcmenet_sw_mdio_read(priv, external_phy, port->phy_id,
2096-
MII_STAT1000);
2097-
20982095
/* figure out media and duplex from advertise and LPA values */
20992096
media = mii_nway_result(lpa & advertise);
21002097
duplex = (media & ADVERTISE_FULL) ? 1 : 0;
2101-
if (lpa2 & LPA_1000FULL)
2102-
duplex = 1;
2103-
2104-
if (lpa2 & (LPA_1000FULL | LPA_1000HALF))
2105-
speed = 1000;
2106-
else {
2107-
if (media & (ADVERTISE_100FULL | ADVERTISE_100HALF))
2108-
speed = 100;
2109-
else
2110-
speed = 10;
2098+
2099+
if (media & (ADVERTISE_100FULL | ADVERTISE_100HALF))
2100+
speed = 100;
2101+
else
2102+
speed = 10;
2103+
2104+
if (val & BMSR_ESTATEN) {
2105+
advertise = bcmenet_sw_mdio_read(priv, external_phy,
2106+
port->phy_id, MII_CTRL1000);
2107+
2108+
lpa = bcmenet_sw_mdio_read(priv, external_phy,
2109+
port->phy_id, MII_STAT1000);
2110+
2111+
if (advertise & (ADVERTISE_1000FULL | ADVERTISE_1000HALF)
2112+
&& lpa & (LPA_1000FULL | LPA_1000HALF)) {
2113+
speed = 1000;
2114+
duplex = (lpa & LPA_1000FULL);
2115+
}
21112116
}
21122117

21132118
dev_info(&priv->pdev->dev,

0 commit comments

Comments
 (0)