diff options
author | Michael Chan <mchan@broadcom.com> | 2007-05-03 16:19:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-05-03 16:19:18 -0400 |
commit | 40453c839fdbf86738256cae1c9c1ebe55645d4a (patch) | |
tree | 8bd941c3ff4b4ef6df0c43cf1060ddbb5abfa7aa /drivers | |
parent | 5bae30c96a3bd09563e484b4ac7211b4b4664679 (diff) |
[BNX2]: Add 40-bit DMA workaround for 5708.
The internal PCIE-to-PCIX bridge of the 5708 has the same 40-bit DMA
limitation as some of the tg3 chips. Set dma_mask and persistent DMA
mask to 40-bit to workaround.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bnx2.c | 38 | ||||
-rw-r--r-- | drivers/net/bnx2.h | 1 |
2 files changed, 21 insertions, 18 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 6d05397420f3..679ee669e1e0 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -5711,6 +5711,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5711 | unsigned long mem_len; | 5711 | unsigned long mem_len; |
5712 | int rc; | 5712 | int rc; |
5713 | u32 reg; | 5713 | u32 reg; |
5714 | u64 dma_mask, persist_dma_mask; | ||
5714 | 5715 | ||
5715 | SET_MODULE_OWNER(dev); | 5716 | SET_MODULE_OWNER(dev); |
5716 | SET_NETDEV_DEV(dev, &pdev->dev); | 5717 | SET_NETDEV_DEV(dev, &pdev->dev); |
@@ -5749,21 +5750,6 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5749 | goto err_out_release; | 5750 | goto err_out_release; |
5750 | } | 5751 | } |
5751 | 5752 | ||
5752 | if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) { | ||
5753 | bp->flags |= USING_DAC_FLAG; | ||
5754 | if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) { | ||
5755 | dev_err(&pdev->dev, | ||
5756 | "pci_set_consistent_dma_mask failed, aborting.\n"); | ||
5757 | rc = -EIO; | ||
5758 | goto err_out_release; | ||
5759 | } | ||
5760 | } | ||
5761 | else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) { | ||
5762 | dev_err(&pdev->dev, "System does not support DMA, aborting.\n"); | ||
5763 | rc = -EIO; | ||
5764 | goto err_out_release; | ||
5765 | } | ||
5766 | |||
5767 | bp->dev = dev; | 5753 | bp->dev = dev; |
5768 | bp->pdev = pdev; | 5754 | bp->pdev = pdev; |
5769 | 5755 | ||
@@ -5805,6 +5791,26 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5805 | } | 5791 | } |
5806 | } | 5792 | } |
5807 | 5793 | ||
5794 | /* 5708 cannot support DMA addresses > 40-bit. */ | ||
5795 | if (CHIP_NUM(bp) == CHIP_NUM_5708) | ||
5796 | persist_dma_mask = dma_mask = DMA_40BIT_MASK; | ||
5797 | else | ||
5798 | persist_dma_mask = dma_mask = DMA_64BIT_MASK; | ||
5799 | |||
5800 | /* Configure DMA attributes. */ | ||
5801 | if (pci_set_dma_mask(pdev, dma_mask) == 0) { | ||
5802 | dev->features |= NETIF_F_HIGHDMA; | ||
5803 | rc = pci_set_consistent_dma_mask(pdev, persist_dma_mask); | ||
5804 | if (rc) { | ||
5805 | dev_err(&pdev->dev, | ||
5806 | "pci_set_consistent_dma_mask failed, aborting.\n"); | ||
5807 | goto err_out_unmap; | ||
5808 | } | ||
5809 | } else if ((rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) != 0) { | ||
5810 | dev_err(&pdev->dev, "System does not support DMA, aborting.\n"); | ||
5811 | goto err_out_unmap; | ||
5812 | } | ||
5813 | |||
5808 | /* Get bus information. */ | 5814 | /* Get bus information. */ |
5809 | reg = REG_RD(bp, BNX2_PCICFG_MISC_STATUS); | 5815 | reg = REG_RD(bp, BNX2_PCICFG_MISC_STATUS); |
5810 | if (reg & BNX2_PCICFG_MISC_STATUS_PCIX_DET) { | 5816 | if (reg & BNX2_PCICFG_MISC_STATUS_PCIX_DET) { |
@@ -6114,8 +6120,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
6114 | printk("\n"); | 6120 | printk("\n"); |
6115 | 6121 | ||
6116 | dev->features |= NETIF_F_SG; | 6122 | dev->features |= NETIF_F_SG; |
6117 | if (bp->flags & USING_DAC_FLAG) | ||
6118 | dev->features |= NETIF_F_HIGHDMA; | ||
6119 | dev->features |= NETIF_F_IP_CSUM; | 6123 | dev->features |= NETIF_F_IP_CSUM; |
6120 | #ifdef BCM_VLAN | 6124 | #ifdef BCM_VLAN |
6121 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; | 6125 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 878eee58f12a..8e7b29a3f930 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -6433,7 +6433,6 @@ struct bnx2 { | |||
6433 | #define PCI_32BIT_FLAG 2 | 6433 | #define PCI_32BIT_FLAG 2 |
6434 | #define ONE_TDMA_FLAG 4 /* no longer used */ | 6434 | #define ONE_TDMA_FLAG 4 /* no longer used */ |
6435 | #define NO_WOL_FLAG 8 | 6435 | #define NO_WOL_FLAG 8 |
6436 | #define USING_DAC_FLAG 0x10 | ||
6437 | #define USING_MSI_FLAG 0x20 | 6436 | #define USING_MSI_FLAG 0x20 |
6438 | #define ASF_ENABLE_FLAG 0x40 | 6437 | #define ASF_ENABLE_FLAG 0x40 |
6439 | 6438 | ||