diff options
Diffstat (limited to 'drivers/net/tg3.c')
| -rw-r--r-- | drivers/net/tg3.c | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 15545620ab0e..caf4102b54ce 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
| @@ -9552,12 +9552,36 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
| 9552 | } | 9552 | } |
| 9553 | } | 9553 | } |
| 9554 | 9554 | ||
| 9555 | /* Find msi capability. */ | 9555 | /* The EPB bridge inside 5714, 5715, and 5780 cannot support |
| 9556 | * DMA addresses > 40-bit. This bridge may have other additional | ||
| 9557 | * 57xx devices behind it in some 4-port NIC designs for example. | ||
| 9558 | * Any tg3 device found behind the bridge will also need the 40-bit | ||
| 9559 | * DMA workaround. | ||
| 9560 | */ | ||
| 9556 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 || | 9561 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780 || |
| 9557 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714) { | 9562 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5714) { |
| 9558 | tp->tg3_flags2 |= TG3_FLG2_5780_CLASS; | 9563 | tp->tg3_flags2 |= TG3_FLG2_5780_CLASS; |
| 9564 | tp->tg3_flags |= TG3_FLAG_40BIT_DMA_BUG; | ||
| 9559 | tp->msi_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_MSI); | 9565 | tp->msi_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_MSI); |
| 9560 | } | 9566 | } |
| 9567 | else { | ||
| 9568 | struct pci_dev *bridge = NULL; | ||
| 9569 | |||
| 9570 | do { | ||
| 9571 | bridge = pci_get_device(PCI_VENDOR_ID_SERVERWORKS, | ||
| 9572 | PCI_DEVICE_ID_SERVERWORKS_EPB, | ||
| 9573 | bridge); | ||
| 9574 | if (bridge && bridge->subordinate && | ||
| 9575 | (bridge->subordinate->number <= | ||
| 9576 | tp->pdev->bus->number) && | ||
| 9577 | (bridge->subordinate->subordinate >= | ||
| 9578 | tp->pdev->bus->number)) { | ||
| 9579 | tp->tg3_flags |= TG3_FLAG_40BIT_DMA_BUG; | ||
| 9580 | pci_dev_put(bridge); | ||
| 9581 | break; | ||
| 9582 | } | ||
| 9583 | } while (bridge); | ||
| 9584 | } | ||
| 9561 | 9585 | ||
| 9562 | /* Initialize misc host control in PCI block. */ | 9586 | /* Initialize misc host control in PCI block. */ |
| 9563 | tp->misc_host_ctrl |= (misc_ctrl_reg & | 9587 | tp->misc_host_ctrl |= (misc_ctrl_reg & |
| @@ -10303,7 +10327,14 @@ static int __devinit tg3_test_dma(struct tg3 *tp) | |||
| 10303 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { | 10327 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) { |
| 10304 | u32 ccval = (tr32(TG3PCI_CLOCK_CTRL) & 0x1f); | 10328 | u32 ccval = (tr32(TG3PCI_CLOCK_CTRL) & 0x1f); |
| 10305 | 10329 | ||
| 10306 | if (ccval == 0x6 || ccval == 0x7) | 10330 | /* If the 5704 is behind the EPB bridge, we can |
| 10331 | * do the less restrictive ONE_DMA workaround for | ||
| 10332 | * better performance. | ||
| 10333 | */ | ||
| 10334 | if ((tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG) && | ||
| 10335 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704) | ||
| 10336 | tp->dma_rwctrl |= 0x8000; | ||
| 10337 | else if (ccval == 0x6 || ccval == 0x7) | ||
| 10307 | tp->dma_rwctrl |= DMA_RWCTRL_ONE_DMA; | 10338 | tp->dma_rwctrl |= DMA_RWCTRL_ONE_DMA; |
| 10308 | 10339 | ||
| 10309 | /* Set bit 23 to enable PCIX hw bug fix */ | 10340 | /* Set bit 23 to enable PCIX hw bug fix */ |
| @@ -10543,8 +10574,6 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str) | |||
| 10543 | strcat(str, "66MHz"); | 10574 | strcat(str, "66MHz"); |
| 10544 | else if (clock_ctrl == 6) | 10575 | else if (clock_ctrl == 6) |
| 10545 | strcat(str, "100MHz"); | 10576 | strcat(str, "100MHz"); |
| 10546 | else if (clock_ctrl == 7) | ||
| 10547 | strcat(str, "133MHz"); | ||
| 10548 | } else { | 10577 | } else { |
| 10549 | strcpy(str, "PCI:"); | 10578 | strcpy(str, "PCI:"); |
| 10550 | if (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED) | 10579 | if (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED) |
| @@ -10761,19 +10790,20 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
| 10761 | goto err_out_iounmap; | 10790 | goto err_out_iounmap; |
| 10762 | } | 10791 | } |
| 10763 | 10792 | ||
| 10764 | /* 5714, 5715 and 5780 cannot support DMA addresses > 40-bit. | 10793 | /* The EPB bridge inside 5714, 5715, and 5780 and any |
| 10794 | * device behind the EPB cannot support DMA addresses > 40-bit. | ||
| 10765 | * On 64-bit systems with IOMMU, use 40-bit dma_mask. | 10795 | * On 64-bit systems with IOMMU, use 40-bit dma_mask. |
| 10766 | * On 64-bit systems without IOMMU, use 64-bit dma_mask and | 10796 | * On 64-bit systems without IOMMU, use 64-bit dma_mask and |
| 10767 | * do DMA address check in tg3_start_xmit(). | 10797 | * do DMA address check in tg3_start_xmit(). |
| 10768 | */ | 10798 | */ |
| 10769 | if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) { | 10799 | if (tp->tg3_flags2 & TG3_FLG2_IS_5788) |
| 10800 | persist_dma_mask = dma_mask = DMA_32BIT_MASK; | ||
| 10801 | else if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG) { | ||
| 10770 | persist_dma_mask = dma_mask = DMA_40BIT_MASK; | 10802 | persist_dma_mask = dma_mask = DMA_40BIT_MASK; |
| 10771 | #ifdef CONFIG_HIGHMEM | 10803 | #ifdef CONFIG_HIGHMEM |
| 10772 | dma_mask = DMA_64BIT_MASK; | 10804 | dma_mask = DMA_64BIT_MASK; |
| 10773 | #endif | 10805 | #endif |
| 10774 | } else if (tp->tg3_flags2 & TG3_FLG2_IS_5788) | 10806 | } else |
| 10775 | persist_dma_mask = dma_mask = DMA_32BIT_MASK; | ||
| 10776 | else | ||
| 10777 | persist_dma_mask = dma_mask = DMA_64BIT_MASK; | 10807 | persist_dma_mask = dma_mask = DMA_64BIT_MASK; |
| 10778 | 10808 | ||
| 10779 | /* Configure DMA attributes. */ | 10809 | /* Configure DMA attributes. */ |
| @@ -10910,8 +10940,10 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
| 10910 | (tp->tg3_flags & TG3_FLAG_SPLIT_MODE) != 0, | 10940 | (tp->tg3_flags & TG3_FLAG_SPLIT_MODE) != 0, |
| 10911 | (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0, | 10941 | (tp->tg3_flags2 & TG3_FLG2_NO_ETH_WIRE_SPEED) == 0, |
| 10912 | (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0); | 10942 | (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) != 0); |
| 10913 | printk(KERN_INFO "%s: dma_rwctrl[%08x]\n", | 10943 | printk(KERN_INFO "%s: dma_rwctrl[%08x] dma_mask[%d-bit]\n", |
| 10914 | dev->name, tp->dma_rwctrl); | 10944 | dev->name, tp->dma_rwctrl, |
| 10945 | (pdev->dma_mask == DMA_32BIT_MASK) ? 32 : | ||
| 10946 | (((u64) pdev->dma_mask == DMA_40BIT_MASK) ? 40 : 64)); | ||
| 10915 | 10947 | ||
| 10916 | return 0; | 10948 | return 0; |
| 10917 | 10949 | ||
