diff options
| -rw-r--r-- | drivers/net/dsa/bcm_sf2.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 4f4c2a7888e5..feb29c4526f7 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c | |||
| @@ -684,10 +684,9 @@ static void bcm_sf2_sw_fixed_link_update(struct dsa_switch *ds, int port, | |||
| 684 | struct fixed_phy_status *status) | 684 | struct fixed_phy_status *status) |
| 685 | { | 685 | { |
| 686 | struct bcm_sf2_priv *priv = ds_to_priv(ds); | 686 | struct bcm_sf2_priv *priv = ds_to_priv(ds); |
| 687 | u32 link, duplex, pause, speed; | 687 | u32 duplex, pause, speed; |
| 688 | u32 reg; | 688 | u32 reg; |
| 689 | 689 | ||
| 690 | link = core_readl(priv, CORE_LNKSTS); | ||
| 691 | duplex = core_readl(priv, CORE_DUPSTS); | 690 | duplex = core_readl(priv, CORE_DUPSTS); |
| 692 | pause = core_readl(priv, CORE_PAUSESTS); | 691 | pause = core_readl(priv, CORE_PAUSESTS); |
| 693 | speed = core_readl(priv, CORE_SPDSTS); | 692 | speed = core_readl(priv, CORE_SPDSTS); |
| @@ -701,22 +700,26 @@ static void bcm_sf2_sw_fixed_link_update(struct dsa_switch *ds, int port, | |||
| 701 | * which means that we need to force the link at the port override | 700 | * which means that we need to force the link at the port override |
| 702 | * level to get the data to flow. We do use what the interrupt handler | 701 | * level to get the data to flow. We do use what the interrupt handler |
| 703 | * did determine before. | 702 | * did determine before. |
| 703 | * | ||
| 704 | * For the other ports, we just force the link status, since this is | ||
| 705 | * a fixed PHY device. | ||
| 704 | */ | 706 | */ |
| 705 | if (port == 7) { | 707 | if (port == 7) { |
| 706 | status->link = priv->port_sts[port].link; | 708 | status->link = priv->port_sts[port].link; |
| 707 | reg = core_readl(priv, CORE_STS_OVERRIDE_GMIIP_PORT(7)); | ||
| 708 | reg |= SW_OVERRIDE; | ||
| 709 | if (status->link) | ||
| 710 | reg |= LINK_STS; | ||
| 711 | else | ||
| 712 | reg &= ~LINK_STS; | ||
| 713 | core_writel(priv, reg, CORE_STS_OVERRIDE_GMIIP_PORT(7)); | ||
| 714 | status->duplex = 1; | 709 | status->duplex = 1; |
| 715 | } else { | 710 | } else { |
| 716 | status->link = !!(link & (1 << port)); | 711 | status->link = 1; |
| 717 | status->duplex = !!(duplex & (1 << port)); | 712 | status->duplex = !!(duplex & (1 << port)); |
| 718 | } | 713 | } |
| 719 | 714 | ||
| 715 | reg = core_readl(priv, CORE_STS_OVERRIDE_GMIIP_PORT(port)); | ||
| 716 | reg |= SW_OVERRIDE; | ||
| 717 | if (status->link) | ||
| 718 | reg |= LINK_STS; | ||
| 719 | else | ||
| 720 | reg &= ~LINK_STS; | ||
| 721 | core_writel(priv, reg, CORE_STS_OVERRIDE_GMIIP_PORT(port)); | ||
| 722 | |||
| 720 | switch (speed) { | 723 | switch (speed) { |
| 721 | case SPDSTS_10: | 724 | case SPDSTS_10: |
| 722 | status->speed = SPEED_10; | 725 | status->speed = SPEED_10; |
