diff options
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index d4ac6e9ef6db..4f9fbe268ec9 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -4865,9 +4865,15 @@ static void tg3_restore_pci_state(struct tg3 *tp) | |||
4865 | pci_write_config_dword(tp->pdev, TG3PCI_COMMAND, tp->pci_cmd); | 4865 | pci_write_config_dword(tp->pdev, TG3PCI_COMMAND, tp->pci_cmd); |
4866 | 4866 | ||
4867 | /* Make sure PCI-X relaxed ordering bit is clear. */ | 4867 | /* Make sure PCI-X relaxed ordering bit is clear. */ |
4868 | pci_read_config_dword(tp->pdev, TG3PCI_X_CAPS, &val); | 4868 | if (tp->pcix_cap) { |
4869 | val &= ~PCIX_CAPS_RELAXED_ORDERING; | 4869 | u16 pcix_cmd; |
4870 | pci_write_config_dword(tp->pdev, TG3PCI_X_CAPS, val); | 4870 | |
4871 | pci_read_config_word(tp->pdev, tp->pcix_cap + PCI_X_CMD, | ||
4872 | &pcix_cmd); | ||
4873 | pcix_cmd &= ~PCI_X_CMD_ERO; | ||
4874 | pci_write_config_word(tp->pdev, tp->pcix_cap + PCI_X_CMD, | ||
4875 | pcix_cmd); | ||
4876 | } | ||
4871 | 4877 | ||
4872 | if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) { | 4878 | if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) { |
4873 | 4879 | ||
@@ -6574,16 +6580,20 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
6574 | tw32_f(WDMAC_MODE, val); | 6580 | tw32_f(WDMAC_MODE, val); |
6575 | udelay(40); | 6581 | udelay(40); |
6576 | 6582 | ||
6577 | if ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) { | 6583 | if (tp->tg3_flags & TG3_FLAG_PCIX_MODE) { |
6578 | val = tr32(TG3PCI_X_CAPS); | 6584 | u16 pcix_cmd; |
6585 | |||
6586 | pci_read_config_word(tp->pdev, tp->pcix_cap + PCI_X_CMD, | ||
6587 | &pcix_cmd); | ||
6579 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703) { | 6588 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5703) { |
6580 | val &= ~PCIX_CAPS_BURST_MASK; | 6589 | pcix_cmd &= ~PCI_X_CMD_MAX_READ; |
6581 | val |= (PCIX_CAPS_MAX_BURST_CPIOB << PCIX_CAPS_BURST_SHIFT); | 6590 | pcix_cmd |= PCI_X_CMD_READ_2K; |
6582 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { | 6591 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { |
6583 | val &= ~(PCIX_CAPS_SPLIT_MASK | PCIX_CAPS_BURST_MASK); | 6592 | pcix_cmd &= ~(PCI_X_CMD_MAX_SPLIT | PCI_X_CMD_MAX_READ); |
6584 | val |= (PCIX_CAPS_MAX_BURST_CPIOB << PCIX_CAPS_BURST_SHIFT); | 6593 | pcix_cmd |= PCI_X_CMD_READ_2K; |
6585 | } | 6594 | } |
6586 | tw32(TG3PCI_X_CAPS, val); | 6595 | pci_write_config_word(tp->pdev, tp->pcix_cap + PCI_X_CMD, |
6596 | pcix_cmd); | ||
6587 | } | 6597 | } |
6588 | 6598 | ||
6589 | tw32_f(RDMAC_MODE, rdmac_mode); | 6599 | tw32_f(RDMAC_MODE, rdmac_mode); |
@@ -10712,10 +10722,20 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
10712 | cacheline_sz_reg); | 10722 | cacheline_sz_reg); |
10713 | } | 10723 | } |
10714 | 10724 | ||
10725 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) || | ||
10726 | (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) { | ||
10727 | tp->pcix_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_PCIX); | ||
10728 | if (!tp->pcix_cap) { | ||
10729 | printk(KERN_ERR PFX "Cannot find PCI-X " | ||
10730 | "capability, aborting.\n"); | ||
10731 | return -EIO; | ||
10732 | } | ||
10733 | } | ||
10734 | |||
10715 | pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE, | 10735 | pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE, |
10716 | &pci_state_reg); | 10736 | &pci_state_reg); |
10717 | 10737 | ||
10718 | if ((pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0) { | 10738 | if (tp->pcix_cap && (pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0) { |
10719 | tp->tg3_flags |= TG3_FLAG_PCIX_MODE; | 10739 | tp->tg3_flags |= TG3_FLAG_PCIX_MODE; |
10720 | 10740 | ||
10721 | /* If this is a 5700 BX chipset, and we are in PCI-X | 10741 | /* If this is a 5700 BX chipset, and we are in PCI-X |
@@ -10733,11 +10753,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
10733 | * space registers clobbered due to this bug. | 10753 | * space registers clobbered due to this bug. |
10734 | * So explicitly force the chip into D0 here. | 10754 | * So explicitly force the chip into D0 here. |
10735 | */ | 10755 | */ |
10736 | pci_read_config_dword(tp->pdev, TG3PCI_PM_CTRL_STAT, | 10756 | pci_read_config_dword(tp->pdev, |
10757 | tp->pm_cap + PCI_PM_CTRL, | ||
10737 | &pm_reg); | 10758 | &pm_reg); |
10738 | pm_reg &= ~PCI_PM_CTRL_STATE_MASK; | 10759 | pm_reg &= ~PCI_PM_CTRL_STATE_MASK; |
10739 | pm_reg |= PCI_PM_CTRL_PME_ENABLE | 0 /* D0 */; | 10760 | pm_reg |= PCI_PM_CTRL_PME_ENABLE | 0 /* D0 */; |
10740 | pci_write_config_dword(tp->pdev, TG3PCI_PM_CTRL_STAT, | 10761 | pci_write_config_dword(tp->pdev, |
10762 | tp->pm_cap + PCI_PM_CTRL, | ||
10741 | pm_reg); | 10763 | pm_reg); |
10742 | 10764 | ||
10743 | /* Also, force SERR#/PERR# in PCI command. */ | 10765 | /* Also, force SERR#/PERR# in PCI command. */ |