Commit c71413f8 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

[TG3]: Fix jimbo frame PHY programming.

1. Added new workaround for 5705 to improve bit error rate.

2. Changed to use read-modify-write to set the extended packet bit in
tg3_phy_reset.

3. Removed some phy setup code in tg3_phy_probe. All of that is already
in the end of tg3_phy_reset. Writing to the phy during probe time may
contend with ASF because ASF is constantly reading phy registers to
determine the link.


4. Removed the write to phy register 0x18 in tg3_phy_copper_begin. Not
sure what it was for and it will overwrite that regsiter.
parent 7fb596b6
...@@ -700,14 +700,29 @@ static int tg3_phy_reset(struct tg3 *tp) ...@@ -700,14 +700,29 @@ static int tg3_phy_reset(struct tg3 *tp)
tg3_writephy(tp, 0x1c, 0x8d68); tg3_writephy(tp, 0x1c, 0x8d68);
tg3_writephy(tp, 0x1c, 0x8d68); tg3_writephy(tp, 0x1c, 0x8d68);
} }
if (tp->tg3_flags2 & TG3_FLG2_PHY_BER_BUG) {
tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x310b);
tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x201f);
tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x9506);
tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x401f);
tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x14e2);
tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
}
/* Set Extended packet length bit (bit 14) on all chips that */ /* Set Extended packet length bit (bit 14) on all chips that */
/* support jumbo frames */ /* support jumbo frames */
if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401 || if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
(tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5411) { /* Cannot do read-modify-write on 5401 */
tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4c20); tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4c20);
} }
else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) { else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4400); u32 phy_reg;
/* Set bit 14 with read-modify-write to preserve other bits */
tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0007);
tg3_readphy(tp, MII_TG3_AUX_CTRL, &phy_reg);
tg3_writephy(tp, MII_TG3_AUX_CTRL, phy_reg | 0x4000);
} }
tg3_phy_set_wirespeed(tp); tg3_phy_set_wirespeed(tp);
return 0; return 0;
...@@ -1060,8 +1075,6 @@ static int tg3_phy_copper_begin(struct tg3 *tp) ...@@ -1060,8 +1075,6 @@ static int tg3_phy_copper_begin(struct tg3 *tp)
u32 new_adv; u32 new_adv;
int i; int i;
tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0400);
if (tp->link_config.phy_is_low_power) { if (tp->link_config.phy_is_low_power) {
/* Entering low power mode. Disable gigabit and /* Entering low power mode. Disable gigabit and
* 100baseT advertisements. * 100baseT advertisements.
...@@ -6605,21 +6618,6 @@ static int __devinit tg3_phy_probe(struct tg3 *tp) ...@@ -6605,21 +6618,6 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
return err; return err;
} }
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703) {
tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4c00);
tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x201f);
tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x2aaa);
}
if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) &&
(tp->pci_chip_rev_id == CHIPREV_ID_5704_A0)) {
tg3_writephy(tp, 0x1c, 0x8d68);
tg3_writephy(tp, 0x1c, 0x8d68);
}
/* Enable Ethernet@WireSpeed */
tg3_phy_set_wirespeed(tp);
if (!err && ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401)) { if (!err && ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401)) {
err = tg3_init_5401phy_dsp(tp); err = tg3_init_5401phy_dsp(tp);
} }
...@@ -6934,6 +6932,10 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) ...@@ -6934,6 +6932,10 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if (tp->pci_chip_rev_id == CHIPREV_ID_5704_A0) if (tp->pci_chip_rev_id == CHIPREV_ID_5704_A0)
tp->tg3_flags2 |= TG3_FLG2_PHY_5704_A0_BUG; tp->tg3_flags2 |= TG3_FLG2_PHY_5704_A0_BUG;
/* Note: 5750 also needs this flag set to improve bit error rate. */
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG;
/* Only 5701 and later support tagged irq status mode. /* Only 5701 and later support tagged irq status mode.
* Also, 5788 chips cannot use tagged irq status. * Also, 5788 chips cannot use tagged irq status.
* *
......
...@@ -1929,6 +1929,7 @@ struct tg3 { ...@@ -1929,6 +1929,7 @@ struct tg3 {
#define TG3_FLG2_TSO_CAPABLE 0x00000020 #define TG3_FLG2_TSO_CAPABLE 0x00000020
#define TG3_FLG2_PHY_ADC_BUG 0x00000040 #define TG3_FLG2_PHY_ADC_BUG 0x00000040
#define TG3_FLG2_PHY_5704_A0_BUG 0x00000080 #define TG3_FLG2_PHY_5704_A0_BUG 0x00000080
#define TG3_FLG2_PHY_BER_BUG 0x00000100
u32 split_mode_max_reqs; u32 split_mode_max_reqs;
#define SPLIT_MODE_5704_MAX_REQ 3 #define SPLIT_MODE_5704_MAX_REQ 3
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment