Skip to content

Commit

Permalink
bnx2: Enable auto-mdix when autoneg is disabled.
Browse files Browse the repository at this point in the history
Auto-mdix currently only works if autoneg is enabled.  This patch enables
auto-mdix all the time by setting a bit in a PHY register.  Define
meaningful constants for this PHY registers.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Chan authored and David S. Miller committed Jan 2, 2014
1 parent d17e53b commit 41033b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/net/ethernet/broadcom/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2343,9 +2343,15 @@ bnx2_init_copper_phy(struct bnx2 *bp, int reset_phy)
}

/* ethernet@wirespeed */
bnx2_write_phy(bp, 0x18, 0x7007);
bnx2_read_phy(bp, 0x18, &val);
bnx2_write_phy(bp, 0x18, val | (1 << 15) | (1 << 4));
bnx2_write_phy(bp, MII_BNX2_AUX_CTL, AUX_CTL_MISC_CTL);
bnx2_read_phy(bp, MII_BNX2_AUX_CTL, &val);
val |= AUX_CTL_MISC_CTL_WR | AUX_CTL_MISC_CTL_WIRESPEED;

/* auto-mdix */
if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
val |= AUX_CTL_MISC_CTL_AUTOMDIX;

bnx2_write_phy(bp, MII_BNX2_AUX_CTL, val);
return 0;
}

Expand Down
6 changes: 6 additions & 0 deletions drivers/net/ethernet/broadcom/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -6471,6 +6471,12 @@ struct l2_fhdr {

#define BCM5708S_TX_ACTL3 0x17

#define MII_BNX2_AUX_CTL 0x18
#define AUX_CTL_MISC_CTL 0x7007
#define AUX_CTL_MISC_CTL_WIRESPEED (1 << 4)
#define AUX_CTL_MISC_CTL_AUTOMDIX (1 << 9)
#define AUX_CTL_MISC_CTL_WR (1 << 15)

#define MII_BNX2_DSP_RW_PORT 0x15
#define MII_BNX2_DSP_ADDRESS 0x17
#define MII_BNX2_DSP_EXPAND_REG 0x0f00
Expand Down

0 comments on commit 41033b6

Please sign in to comment.