Commit f91642f9 authored by David S. Miller's avatar David S. Miller

[TG3]: Correct RDMAC/WDMAC mode settings on 5705/5750.

parent 99a4c118
...@@ -4899,16 +4899,18 @@ static int tg3_reset_hw(struct tg3 *tp) ...@@ -4899,16 +4899,18 @@ static int tg3_reset_hw(struct tg3 *tp)
RDMAC_MODE_LNGREAD_ENAB); RDMAC_MODE_LNGREAD_ENAB);
if (tp->tg3_flags & TG3_FLAG_SPLIT_MODE) if (tp->tg3_flags & TG3_FLAG_SPLIT_MODE)
rdmac_mode |= RDMAC_MODE_SPLIT_ENABLE; rdmac_mode |= RDMAC_MODE_SPLIT_ENABLE;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) { if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
if (tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) { tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)) {
if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE &&
(tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
rdmac_mode |= RDMAC_MODE_FIFO_SIZE_128; rdmac_mode |= RDMAC_MODE_FIFO_SIZE_128;
} else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) && } else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
!(tp->tg3_flags2 & TG3_FLG2_IS_5788)) { !(tp->tg3_flags2 & TG3_FLG2_IS_5788)) {
rdmac_mode |= RDMAC_MODE_FIFO_LONG_BURST; rdmac_mode |= RDMAC_MODE_FIFO_LONG_BURST;
} }
} }
}
/* Receive/send statistics. */ /* Receive/send statistics. */
if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) && if ((rdmac_mode & RDMAC_MODE_FIFO_SIZE_128) &&
...@@ -5010,11 +5012,21 @@ static int tg3_reset_hw(struct tg3 *tp) ...@@ -5010,11 +5012,21 @@ static int tg3_reset_hw(struct tg3 *tp)
WDMAC_MODE_ADDROFLOW_ENAB | WDMAC_MODE_FIFOOFLOW_ENAB | WDMAC_MODE_ADDROFLOW_ENAB | WDMAC_MODE_FIFOOFLOW_ENAB |
WDMAC_MODE_FIFOURUN_ENAB | WDMAC_MODE_FIFOOREAD_ENAB | WDMAC_MODE_FIFOURUN_ENAB | WDMAC_MODE_FIFOOREAD_ENAB |
WDMAC_MODE_LNGREAD_ENAB); WDMAC_MODE_LNGREAD_ENAB);
/* XXX Need to handle 5750 and PCI Express cases here... -DaveM */
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 && if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) != 0 && tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
!(tp->tg3_flags2 & TG3_FLG2_IS_5788)) GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
if ((tp->tg3_flags & TG3_FLG2_TSO_CAPABLE) &&
(tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
/* nothing */
} else if (!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH) &&
!(tp->tg3_flags2 & TG3_FLG2_IS_5788) &&
!(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
val |= WDMAC_MODE_RX_ACCEL; val |= WDMAC_MODE_RX_ACCEL;
}
}
tw32_f(WDMAC_MODE, val); tw32_f(WDMAC_MODE, val);
udelay(40); udelay(40);
......
...@@ -118,6 +118,8 @@ ...@@ -118,6 +118,8 @@
#define CHIPREV_ID_5704_A2 0x2002 #define CHIPREV_ID_5704_A2 0x2002
#define CHIPREV_ID_5705_A0 0x3000 #define CHIPREV_ID_5705_A0 0x3000
#define CHIPREV_ID_5705_A1 0x3001 #define CHIPREV_ID_5705_A1 0x3001
#define CHIPREV_ID_5705_A2 0x3002
#define CHIPREV_ID_5705_A3 0x3003
#define CHIPREV_ID_5750_A0 0x4000 #define CHIPREV_ID_5750_A0 0x4000
#define CHIPREV_ID_5750_A1 0x4001 #define CHIPREV_ID_5750_A1 0x4001
#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12) #define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
......
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