diff options
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 163 |
1 files changed, 110 insertions, 53 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 573054ae7b58..289cdc5fde92 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -67,8 +67,8 @@ | |||
67 | #include "tg3.h" | 67 | #include "tg3.h" |
68 | 68 | ||
69 | #define DRV_MODULE_NAME "tg3" | 69 | #define DRV_MODULE_NAME "tg3" |
70 | #define DRV_MODULE_VERSION "3.110" | 70 | #define DRV_MODULE_VERSION "3.111" |
71 | #define DRV_MODULE_RELDATE "April 9, 2010" | 71 | #define DRV_MODULE_RELDATE "June 5, 2010" |
72 | 72 | ||
73 | #define TG3_DEF_MAC_MODE 0 | 73 | #define TG3_DEF_MAC_MODE 0 |
74 | #define TG3_DEF_RX_MODE 0 | 74 | #define TG3_DEF_RX_MODE 0 |
@@ -145,8 +145,6 @@ | |||
145 | #define TG3_RX_JMB_BUFF_RING_SIZE \ | 145 | #define TG3_RX_JMB_BUFF_RING_SIZE \ |
146 | (sizeof(struct ring_info) * TG3_RX_JUMBO_RING_SIZE) | 146 | (sizeof(struct ring_info) * TG3_RX_JUMBO_RING_SIZE) |
147 | 147 | ||
148 | #define TG3_RSS_MIN_NUM_MSIX_VECS 2 | ||
149 | |||
150 | /* Due to a hardware bug, the 5701 can only DMA to memory addresses | 148 | /* Due to a hardware bug, the 5701 can only DMA to memory addresses |
151 | * that are at least dword aligned when used in PCIX mode. The driver | 149 | * that are at least dword aligned when used in PCIX mode. The driver |
152 | * works around this bug by double copying the packet. This workaround | 150 | * works around this bug by double copying the packet. This workaround |
@@ -272,6 +270,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = { | |||
272 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57765)}, | 270 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57765)}, |
273 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57791)}, | 271 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57791)}, |
274 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57795)}, | 272 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57795)}, |
273 | {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)}, | ||
275 | {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)}, | 274 | {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)}, |
276 | {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)}, | 275 | {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)}, |
277 | {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)}, | 276 | {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)}, |
@@ -585,18 +584,23 @@ static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val) | |||
585 | static void tg3_ape_lock_init(struct tg3 *tp) | 584 | static void tg3_ape_lock_init(struct tg3 *tp) |
586 | { | 585 | { |
587 | int i; | 586 | int i; |
587 | u32 regbase; | ||
588 | |||
589 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) | ||
590 | regbase = TG3_APE_LOCK_GRANT; | ||
591 | else | ||
592 | regbase = TG3_APE_PER_LOCK_GRANT; | ||
588 | 593 | ||
589 | /* Make sure the driver hasn't any stale locks. */ | 594 | /* Make sure the driver hasn't any stale locks. */ |
590 | for (i = 0; i < 8; i++) | 595 | for (i = 0; i < 8; i++) |
591 | tg3_ape_write32(tp, TG3_APE_LOCK_GRANT + 4 * i, | 596 | tg3_ape_write32(tp, regbase + 4 * i, APE_LOCK_GRANT_DRIVER); |
592 | APE_LOCK_GRANT_DRIVER); | ||
593 | } | 597 | } |
594 | 598 | ||
595 | static int tg3_ape_lock(struct tg3 *tp, int locknum) | 599 | static int tg3_ape_lock(struct tg3 *tp, int locknum) |
596 | { | 600 | { |
597 | int i, off; | 601 | int i, off; |
598 | int ret = 0; | 602 | int ret = 0; |
599 | u32 status; | 603 | u32 status, req, gnt; |
600 | 604 | ||
601 | if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)) | 605 | if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)) |
602 | return 0; | 606 | return 0; |
@@ -609,13 +613,21 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum) | |||
609 | return -EINVAL; | 613 | return -EINVAL; |
610 | } | 614 | } |
611 | 615 | ||
616 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) { | ||
617 | req = TG3_APE_LOCK_REQ; | ||
618 | gnt = TG3_APE_LOCK_GRANT; | ||
619 | } else { | ||
620 | req = TG3_APE_PER_LOCK_REQ; | ||
621 | gnt = TG3_APE_PER_LOCK_GRANT; | ||
622 | } | ||
623 | |||
612 | off = 4 * locknum; | 624 | off = 4 * locknum; |
613 | 625 | ||
614 | tg3_ape_write32(tp, TG3_APE_LOCK_REQ + off, APE_LOCK_REQ_DRIVER); | 626 | tg3_ape_write32(tp, req + off, APE_LOCK_REQ_DRIVER); |
615 | 627 | ||
616 | /* Wait for up to 1 millisecond to acquire lock. */ | 628 | /* Wait for up to 1 millisecond to acquire lock. */ |
617 | for (i = 0; i < 100; i++) { | 629 | for (i = 0; i < 100; i++) { |
618 | status = tg3_ape_read32(tp, TG3_APE_LOCK_GRANT + off); | 630 | status = tg3_ape_read32(tp, gnt + off); |
619 | if (status == APE_LOCK_GRANT_DRIVER) | 631 | if (status == APE_LOCK_GRANT_DRIVER) |
620 | break; | 632 | break; |
621 | udelay(10); | 633 | udelay(10); |
@@ -623,7 +635,7 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum) | |||
623 | 635 | ||
624 | if (status != APE_LOCK_GRANT_DRIVER) { | 636 | if (status != APE_LOCK_GRANT_DRIVER) { |
625 | /* Revoke the lock request. */ | 637 | /* Revoke the lock request. */ |
626 | tg3_ape_write32(tp, TG3_APE_LOCK_GRANT + off, | 638 | tg3_ape_write32(tp, gnt + off, |
627 | APE_LOCK_GRANT_DRIVER); | 639 | APE_LOCK_GRANT_DRIVER); |
628 | 640 | ||
629 | ret = -EBUSY; | 641 | ret = -EBUSY; |
@@ -634,7 +646,7 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum) | |||
634 | 646 | ||
635 | static void tg3_ape_unlock(struct tg3 *tp, int locknum) | 647 | static void tg3_ape_unlock(struct tg3 *tp, int locknum) |
636 | { | 648 | { |
637 | int off; | 649 | u32 gnt; |
638 | 650 | ||
639 | if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)) | 651 | if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)) |
640 | return; | 652 | return; |
@@ -647,8 +659,12 @@ static void tg3_ape_unlock(struct tg3 *tp, int locknum) | |||
647 | return; | 659 | return; |
648 | } | 660 | } |
649 | 661 | ||
650 | off = 4 * locknum; | 662 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) |
651 | tg3_ape_write32(tp, TG3_APE_LOCK_GRANT + off, APE_LOCK_GRANT_DRIVER); | 663 | gnt = TG3_APE_LOCK_GRANT; |
664 | else | ||
665 | gnt = TG3_APE_PER_LOCK_GRANT; | ||
666 | |||
667 | tg3_ape_write32(tp, gnt + 4 * locknum, APE_LOCK_GRANT_DRIVER); | ||
652 | } | 668 | } |
653 | 669 | ||
654 | static void tg3_disable_ints(struct tg3 *tp) | 670 | static void tg3_disable_ints(struct tg3 *tp) |
@@ -1069,14 +1085,11 @@ static int tg3_mdio_init(struct tg3 *tp) | |||
1069 | u32 reg; | 1085 | u32 reg; |
1070 | struct phy_device *phydev; | 1086 | struct phy_device *phydev; |
1071 | 1087 | ||
1072 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { | 1088 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
1073 | u32 funcnum, is_serdes; | 1089 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) { |
1090 | u32 is_serdes; | ||
1074 | 1091 | ||
1075 | funcnum = tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC; | 1092 | tp->phy_addr = PCI_FUNC(tp->pdev->devfn) + 1; |
1076 | if (funcnum) | ||
1077 | tp->phy_addr = 2; | ||
1078 | else | ||
1079 | tp->phy_addr = 1; | ||
1080 | 1093 | ||
1081 | if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) | 1094 | if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) |
1082 | is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; | 1095 | is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES; |
@@ -1589,7 +1602,8 @@ static void tg3_phy_toggle_apd(struct tg3 *tp, bool enable) | |||
1589 | u32 reg; | 1602 | u32 reg; |
1590 | 1603 | ||
1591 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) || | 1604 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) || |
1592 | (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && | 1605 | ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
1606 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) && | ||
1593 | (tp->tg3_flags2 & TG3_FLG2_MII_SERDES))) | 1607 | (tp->tg3_flags2 & TG3_FLG2_MII_SERDES))) |
1594 | return; | 1608 | return; |
1595 | 1609 | ||
@@ -1964,7 +1978,8 @@ static int tg3_phy_reset(struct tg3 *tp) | |||
1964 | } | 1978 | } |
1965 | } | 1979 | } |
1966 | 1980 | ||
1967 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 && | 1981 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
1982 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) && | ||
1968 | (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)) | 1983 | (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)) |
1969 | return 0; | 1984 | return 0; |
1970 | 1985 | ||
@@ -2049,6 +2064,7 @@ static void tg3_frob_aux_power(struct tg3 *tp) | |||
2049 | 2064 | ||
2050 | /* The GPIOs do something completely different on 57765. */ | 2065 | /* The GPIOs do something completely different on 57765. */ |
2051 | if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0 || | 2066 | if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0 || |
2067 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
2052 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | 2068 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) |
2053 | return; | 2069 | return; |
2054 | 2070 | ||
@@ -4191,6 +4207,8 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset) | |||
4191 | current_duplex = DUPLEX_FULL; | 4207 | current_duplex = DUPLEX_FULL; |
4192 | else | 4208 | else |
4193 | current_duplex = DUPLEX_HALF; | 4209 | current_duplex = DUPLEX_HALF; |
4210 | } else if (!(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) { | ||
4211 | /* Link is up via parallel detect */ | ||
4194 | } else { | 4212 | } else { |
4195 | current_link_up = 0; | 4213 | current_link_up = 0; |
4196 | } | 4214 | } |
@@ -6212,6 +6230,8 @@ static void tg3_free_rings(struct tg3 *tp) | |||
6212 | for (j = 0; j < tp->irq_cnt; j++) { | 6230 | for (j = 0; j < tp->irq_cnt; j++) { |
6213 | struct tg3_napi *tnapi = &tp->napi[j]; | 6231 | struct tg3_napi *tnapi = &tp->napi[j]; |
6214 | 6232 | ||
6233 | tg3_rx_prodring_free(tp, &tp->prodring[j]); | ||
6234 | |||
6215 | if (!tnapi->tx_buffers) | 6235 | if (!tnapi->tx_buffers) |
6216 | continue; | 6236 | continue; |
6217 | 6237 | ||
@@ -6247,8 +6267,6 @@ static void tg3_free_rings(struct tg3 *tp) | |||
6247 | 6267 | ||
6248 | dev_kfree_skb_any(skb); | 6268 | dev_kfree_skb_any(skb); |
6249 | } | 6269 | } |
6250 | |||
6251 | tg3_rx_prodring_free(tp, &tp->prodring[j]); | ||
6252 | } | 6270 | } |
6253 | } | 6271 | } |
6254 | 6272 | ||
@@ -6782,7 +6800,8 @@ static void tg3_restore_pci_state(struct tg3 *tp) | |||
6782 | /* Allow reads and writes to the APE register and memory space. */ | 6800 | /* Allow reads and writes to the APE register and memory space. */ |
6783 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) | 6801 | if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) |
6784 | val |= PCISTATE_ALLOW_APE_CTLSPC_WR | | 6802 | val |= PCISTATE_ALLOW_APE_CTLSPC_WR | |
6785 | PCISTATE_ALLOW_APE_SHMEM_WR; | 6803 | PCISTATE_ALLOW_APE_SHMEM_WR | |
6804 | PCISTATE_ALLOW_APE_PSPACE_WR; | ||
6786 | pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, val); | 6805 | pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, val); |
6787 | 6806 | ||
6788 | pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd); | 6807 | pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd); |
@@ -7069,6 +7088,7 @@ static int tg3_chip_reset(struct tg3 *tp) | |||
7069 | tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 && | 7088 | tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 && |
7070 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 && | 7089 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 && |
7071 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 && | 7090 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 && |
7091 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 && | ||
7072 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) { | 7092 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) { |
7073 | val = tr32(0x7c00); | 7093 | val = tr32(0x7c00); |
7074 | 7094 | ||
@@ -7504,7 +7524,8 @@ static void tg3_rings_reset(struct tg3 *tp) | |||
7504 | 7524 | ||
7505 | 7525 | ||
7506 | /* Disable all receive return rings but the first. */ | 7526 | /* Disable all receive return rings but the first. */ |
7507 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | 7527 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
7528 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | ||
7508 | limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 17; | 7529 | limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 17; |
7509 | else if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) | 7530 | else if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) |
7510 | limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16; | 7531 | limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16; |
@@ -7720,7 +7741,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7720 | */ | 7741 | */ |
7721 | val = tr32(TG3PCI_PCISTATE); | 7742 | val = tr32(TG3PCI_PCISTATE); |
7722 | val |= PCISTATE_ALLOW_APE_CTLSPC_WR | | 7743 | val |= PCISTATE_ALLOW_APE_CTLSPC_WR | |
7723 | PCISTATE_ALLOW_APE_SHMEM_WR; | 7744 | PCISTATE_ALLOW_APE_SHMEM_WR | |
7745 | PCISTATE_ALLOW_APE_PSPACE_WR; | ||
7724 | tw32(TG3PCI_PCISTATE, val); | 7746 | tw32(TG3PCI_PCISTATE, val); |
7725 | } | 7747 | } |
7726 | 7748 | ||
@@ -7741,6 +7763,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7741 | return err; | 7763 | return err; |
7742 | 7764 | ||
7743 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 7765 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
7766 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
7744 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { | 7767 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { |
7745 | val = tr32(TG3PCI_DMA_RW_CTRL) & | 7768 | val = tr32(TG3PCI_DMA_RW_CTRL) & |
7746 | ~DMA_RWCTRL_DIS_CACHE_ALIGNMENT; | 7769 | ~DMA_RWCTRL_DIS_CACHE_ALIGNMENT; |
@@ -7869,7 +7892,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7869 | ((u64) tpr->rx_std_mapping >> 32)); | 7892 | ((u64) tpr->rx_std_mapping >> 32)); |
7870 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, | 7893 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW, |
7871 | ((u64) tpr->rx_std_mapping & 0xffffffff)); | 7894 | ((u64) tpr->rx_std_mapping & 0xffffffff)); |
7872 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) | 7895 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 && |
7896 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719) | ||
7873 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, | 7897 | tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR, |
7874 | NIC_SRAM_RX_BUFFER_DESC); | 7898 | NIC_SRAM_RX_BUFFER_DESC); |
7875 | 7899 | ||
@@ -7894,7 +7918,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7894 | tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS, | 7918 | tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS, |
7895 | (RX_JUMBO_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT) | | 7919 | (RX_JUMBO_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT) | |
7896 | BDINFO_FLAGS_USE_EXT_RECV); | 7920 | BDINFO_FLAGS_USE_EXT_RECV); |
7897 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) | 7921 | if (!(tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) || |
7922 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | ||
7898 | tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR, | 7923 | tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR, |
7899 | NIC_SRAM_RX_JUMBO_BUFFER_DESC); | 7924 | NIC_SRAM_RX_JUMBO_BUFFER_DESC); |
7900 | } else { | 7925 | } else { |
@@ -7903,6 +7928,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7903 | } | 7928 | } |
7904 | 7929 | ||
7905 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 7930 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
7931 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
7906 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | 7932 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) |
7907 | val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) | | 7933 | val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) | |
7908 | (TG3_RX_STD_DMA_SZ << 2); | 7934 | (TG3_RX_STD_DMA_SZ << 2); |
@@ -7921,6 +7947,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7921 | tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG, tpr->rx_jmb_prod_idx); | 7947 | tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG, tpr->rx_jmb_prod_idx); |
7922 | 7948 | ||
7923 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 7949 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
7950 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
7924 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { | 7951 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { |
7925 | tw32(STD_REPLENISH_LWM, 32); | 7952 | tw32(STD_REPLENISH_LWM, 32); |
7926 | tw32(JMB_REPLENISH_LWM, 16); | 7953 | tw32(JMB_REPLENISH_LWM, 16); |
@@ -7956,7 +7983,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
7956 | RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB | | 7983 | RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB | |
7957 | RDMAC_MODE_LNGREAD_ENAB); | 7984 | RDMAC_MODE_LNGREAD_ENAB); |
7958 | 7985 | ||
7959 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | 7986 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
7987 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | ||
7960 | rdmac_mode |= RDMAC_MODE_MULT_DMA_RD_DIS; | 7988 | rdmac_mode |= RDMAC_MODE_MULT_DMA_RD_DIS; |
7961 | 7989 | ||
7962 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || | 7990 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || |
@@ -8195,6 +8223,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
8195 | } | 8223 | } |
8196 | 8224 | ||
8197 | tp->tx_mode = TX_MODE_ENABLE; | 8225 | tp->tx_mode = TX_MODE_ENABLE; |
8226 | if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) || | ||
8227 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | ||
8228 | tp->tx_mode |= TX_MODE_MBUF_LOCKUP_FIX; | ||
8198 | tw32_f(MAC_TX_MODE, tp->tx_mode); | 8229 | tw32_f(MAC_TX_MODE, tp->tx_mode); |
8199 | udelay(100); | 8230 | udelay(100); |
8200 | 8231 | ||
@@ -8206,7 +8237,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
8206 | for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i++) { | 8237 | for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i++) { |
8207 | int idx = i % sizeof(val); | 8238 | int idx = i % sizeof(val); |
8208 | 8239 | ||
8209 | ent[idx] = i % (tp->irq_cnt - 1); | 8240 | ent[idx] = (i % (tp->irq_cnt - 1)) + 1; |
8210 | if (idx == sizeof(val) - 1) { | 8241 | if (idx == sizeof(val) - 1) { |
8211 | tw32(reg, val); | 8242 | tw32(reg, val); |
8212 | reg += 4; | 8243 | reg += 4; |
@@ -8511,8 +8542,10 @@ static void tg3_timer(unsigned long __opaque) | |||
8511 | } | 8542 | } |
8512 | tg3_setup_phy(tp, 0); | 8543 | tg3_setup_phy(tp, 0); |
8513 | } | 8544 | } |
8514 | } else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) | 8545 | } else if ((tp->tg3_flags2 & TG3_FLG2_MII_SERDES) && |
8546 | !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) { | ||
8515 | tg3_serdes_parallel_detect(tp); | 8547 | tg3_serdes_parallel_detect(tp); |
8548 | } | ||
8516 | 8549 | ||
8517 | tp->timer_counter = tp->timer_multiplier; | 8550 | tp->timer_counter = tp->timer_multiplier; |
8518 | } | 8551 | } |
@@ -8606,6 +8639,7 @@ static int tg3_test_interrupt(struct tg3 *tp) | |||
8606 | * observable way to know whether the interrupt was delivered. | 8639 | * observable way to know whether the interrupt was delivered. |
8607 | */ | 8640 | */ |
8608 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 8641 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
8642 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
8609 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) && | 8643 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) && |
8610 | (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) { | 8644 | (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) { |
8611 | val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE; | 8645 | val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE; |
@@ -8650,6 +8684,7 @@ static int tg3_test_interrupt(struct tg3 *tp) | |||
8650 | if (intr_ok) { | 8684 | if (intr_ok) { |
8651 | /* Reenable MSI one shot mode. */ | 8685 | /* Reenable MSI one shot mode. */ |
8652 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 8686 | if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
8687 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
8653 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) && | 8688 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) && |
8654 | (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) { | 8689 | (tp->tg3_flags2 & TG3_FLG2_USING_MSI)) { |
8655 | val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE; | 8690 | val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE; |
@@ -8775,9 +8810,9 @@ static bool tg3_enable_msix(struct tg3 *tp) | |||
8775 | } | 8810 | } |
8776 | 8811 | ||
8777 | rc = pci_enable_msix(tp->pdev, msix_ent, tp->irq_cnt); | 8812 | rc = pci_enable_msix(tp->pdev, msix_ent, tp->irq_cnt); |
8778 | if (rc != 0) { | 8813 | if (rc < 0) { |
8779 | if (rc < TG3_RSS_MIN_NUM_MSIX_VECS) | 8814 | return false; |
8780 | return false; | 8815 | } else if (rc != 0) { |
8781 | if (pci_enable_msix(tp->pdev, msix_ent, rc)) | 8816 | if (pci_enable_msix(tp->pdev, msix_ent, rc)) |
8782 | return false; | 8817 | return false; |
8783 | netdev_notice(tp->dev, "Requested %d MSI-X vectors, received %d\n", | 8818 | netdev_notice(tp->dev, "Requested %d MSI-X vectors, received %d\n", |
@@ -8785,16 +8820,19 @@ static bool tg3_enable_msix(struct tg3 *tp) | |||
8785 | tp->irq_cnt = rc; | 8820 | tp->irq_cnt = rc; |
8786 | } | 8821 | } |
8787 | 8822 | ||
8788 | tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS; | ||
8789 | |||
8790 | for (i = 0; i < tp->irq_max; i++) | 8823 | for (i = 0; i < tp->irq_max; i++) |
8791 | tp->napi[i].irq_vec = msix_ent[i].vector; | 8824 | tp->napi[i].irq_vec = msix_ent[i].vector; |
8792 | 8825 | ||
8793 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { | 8826 | tp->dev->real_num_tx_queues = 1; |
8794 | tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS; | 8827 | if (tp->irq_cnt > 1) { |
8795 | tp->dev->real_num_tx_queues = tp->irq_cnt - 1; | 8828 | tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS; |
8796 | } else | 8829 | |
8797 | tp->dev->real_num_tx_queues = 1; | 8830 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
8831 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) { | ||
8832 | tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS; | ||
8833 | tp->dev->real_num_tx_queues = tp->irq_cnt - 1; | ||
8834 | } | ||
8835 | } | ||
8798 | 8836 | ||
8799 | return true; | 8837 | return true; |
8800 | } | 8838 | } |
@@ -8943,6 +8981,7 @@ static int tg3_open(struct net_device *dev) | |||
8943 | } | 8981 | } |
8944 | 8982 | ||
8945 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 && | 8983 | if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 && |
8984 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 && | ||
8946 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765 && | 8985 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765 && |
8947 | (tp->tg3_flags2 & TG3_FLG2_USING_MSI) && | 8986 | (tp->tg3_flags2 & TG3_FLG2_USING_MSI) && |
8948 | (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)) { | 8987 | (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)) { |
@@ -10554,7 +10593,8 @@ static int tg3_test_memory(struct tg3 *tp) | |||
10554 | int err = 0; | 10593 | int err = 0; |
10555 | int i; | 10594 | int i; |
10556 | 10595 | ||
10557 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | 10596 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
10597 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | ||
10558 | mem_tbl = mem_tbl_5717; | 10598 | mem_tbl = mem_tbl_5717; |
10559 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | 10599 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) |
10560 | mem_tbl = mem_tbl_57765; | 10600 | mem_tbl = mem_tbl_57765; |
@@ -11634,7 +11674,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp) | |||
11634 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | 11674 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || |
11635 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | 11675 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) |
11636 | tg3_get_57780_nvram_info(tp); | 11676 | tg3_get_57780_nvram_info(tp); |
11637 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | 11677 | else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
11678 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) | ||
11638 | tg3_get_5717_nvram_info(tp); | 11679 | tg3_get_5717_nvram_info(tp); |
11639 | else | 11680 | else |
11640 | tg3_get_nvram_info(tp); | 11681 | tg3_get_nvram_info(tp); |
@@ -12070,11 +12111,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) | |||
12070 | 12111 | ||
12071 | tp->phy_id = eeprom_phy_id; | 12112 | tp->phy_id = eeprom_phy_id; |
12072 | if (eeprom_phy_serdes) { | 12113 | if (eeprom_phy_serdes) { |
12073 | if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) || | 12114 | if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) |
12074 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) | ||
12075 | tp->tg3_flags2 |= TG3_FLG2_MII_SERDES; | ||
12076 | else | ||
12077 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; | 12115 | tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES; |
12116 | else | ||
12117 | tp->tg3_flags2 |= TG3_FLG2_MII_SERDES; | ||
12078 | } | 12118 | } |
12079 | 12119 | ||
12080 | if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) | 12120 | if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) |
@@ -12804,7 +12844,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12804 | 12844 | ||
12805 | if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 || | 12845 | if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 || |
12806 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 || | 12846 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 || |
12807 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5724) | 12847 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5724 || |
12848 | tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719) | ||
12808 | pci_read_config_dword(tp->pdev, | 12849 | pci_read_config_dword(tp->pdev, |
12809 | TG3PCI_GEN2_PRODID_ASICREV, | 12850 | TG3PCI_GEN2_PRODID_ASICREV, |
12810 | &prod_id_asic_rev); | 12851 | &prod_id_asic_rev); |
@@ -12970,6 +13011,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12970 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | 13011 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || |
12971 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | 13012 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || |
12972 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 13013 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13014 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
12973 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | 13015 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) |
12974 | tp->tg3_flags3 |= TG3_FLG3_5755_PLUS; | 13016 | tp->tg3_flags3 |= TG3_FLG3_5755_PLUS; |
12975 | 13017 | ||
@@ -12999,6 +13041,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
12999 | 13041 | ||
13000 | /* Determine TSO capabilities */ | 13042 | /* Determine TSO capabilities */ |
13001 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 13043 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13044 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
13002 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | 13045 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) |
13003 | tp->tg3_flags2 |= TG3_FLG2_HW_TSO_3; | 13046 | tp->tg3_flags2 |= TG3_FLG2_HW_TSO_3; |
13004 | else if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) || | 13047 | else if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) || |
@@ -13036,6 +13079,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13036 | } | 13079 | } |
13037 | 13080 | ||
13038 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 13081 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13082 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
13039 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { | 13083 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { |
13040 | tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX; | 13084 | tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX; |
13041 | tp->irq_max = TG3_IRQ_MAX_VECS; | 13085 | tp->irq_max = TG3_IRQ_MAX_VECS; |
@@ -13043,6 +13087,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13043 | } | 13087 | } |
13044 | 13088 | ||
13045 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 13089 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13090 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
13046 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | 13091 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) |
13047 | tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG; | 13092 | tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG; |
13048 | else if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) { | 13093 | else if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) { |
@@ -13051,6 +13096,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13051 | } | 13096 | } |
13052 | 13097 | ||
13053 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 13098 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13099 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
13054 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | 13100 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) |
13055 | tp->tg3_flags3 |= TG3_FLG3_USE_JUMBO_BDFLAG; | 13101 | tp->tg3_flags3 |= TG3_FLG3_USE_JUMBO_BDFLAG; |
13056 | 13102 | ||
@@ -13242,7 +13288,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13242 | * APE register and memory space. | 13288 | * APE register and memory space. |
13243 | */ | 13289 | */ |
13244 | pci_state_reg |= PCISTATE_ALLOW_APE_CTLSPC_WR | | 13290 | pci_state_reg |= PCISTATE_ALLOW_APE_CTLSPC_WR | |
13245 | PCISTATE_ALLOW_APE_SHMEM_WR; | 13291 | PCISTATE_ALLOW_APE_SHMEM_WR | |
13292 | PCISTATE_ALLOW_APE_PSPACE_WR; | ||
13246 | pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, | 13293 | pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, |
13247 | pci_state_reg); | 13294 | pci_state_reg); |
13248 | } | 13295 | } |
@@ -13252,6 +13299,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13252 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || | 13299 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || |
13253 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || | 13300 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || |
13254 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 13301 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13302 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
13255 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | 13303 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) |
13256 | tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT; | 13304 | tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT; |
13257 | 13305 | ||
@@ -13332,6 +13380,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
13332 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 && | 13380 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 && |
13333 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 && | 13381 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 && |
13334 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 && | 13382 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 && |
13383 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 && | ||
13335 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) { | 13384 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) { |
13336 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || | 13385 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || |
13337 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || | 13386 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || |
@@ -13580,9 +13629,12 @@ static int __devinit tg3_get_device_address(struct tg3 *tp) | |||
13580 | tw32_f(NVRAM_CMD, NVRAM_CMD_RESET); | 13629 | tw32_f(NVRAM_CMD, NVRAM_CMD_RESET); |
13581 | else | 13630 | else |
13582 | tg3_nvram_unlock(tp); | 13631 | tg3_nvram_unlock(tp); |
13583 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) { | 13632 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13584 | if (tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC) | 13633 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) { |
13634 | if (PCI_FUNC(tp->pdev->devfn) & 1) | ||
13585 | mac_offset = 0xcc; | 13635 | mac_offset = 0xcc; |
13636 | if (PCI_FUNC(tp->pdev->devfn) > 1) | ||
13637 | mac_offset += 0x18c; | ||
13586 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) | 13638 | } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) |
13587 | mac_offset = 0x10; | 13639 | mac_offset = 0x10; |
13588 | 13640 | ||
@@ -13668,6 +13720,7 @@ static u32 __devinit tg3_calc_dma_bndry(struct tg3 *tp, u32 val) | |||
13668 | #endif | 13720 | #endif |
13669 | 13721 | ||
13670 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 13722 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13723 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
13671 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { | 13724 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { |
13672 | val = goal ? 0 : DMA_RWCTRL_DIS_CACHE_ALIGNMENT; | 13725 | val = goal ? 0 : DMA_RWCTRL_DIS_CACHE_ALIGNMENT; |
13673 | goto out; | 13726 | goto out; |
@@ -13880,6 +13933,7 @@ static int __devinit tg3_test_dma(struct tg3 *tp) | |||
13880 | tp->dma_rwctrl = tg3_calc_dma_bndry(tp, tp->dma_rwctrl); | 13933 | tp->dma_rwctrl = tg3_calc_dma_bndry(tp, tp->dma_rwctrl); |
13881 | 13934 | ||
13882 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 13935 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
13936 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
13883 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) | 13937 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) |
13884 | goto out; | 13938 | goto out; |
13885 | 13939 | ||
@@ -14079,6 +14133,7 @@ static void __devinit tg3_init_link_config(struct tg3 *tp) | |||
14079 | static void __devinit tg3_init_bufmgr_config(struct tg3 *tp) | 14133 | static void __devinit tg3_init_bufmgr_config(struct tg3 *tp) |
14080 | { | 14134 | { |
14081 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || | 14135 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || |
14136 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || | ||
14082 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { | 14137 | GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) { |
14083 | tp->bufmgr_config.mbuf_read_dma_low_water = | 14138 | tp->bufmgr_config.mbuf_read_dma_low_water = |
14084 | DEFAULT_MB_RDMA_LOW_WATER_5705; | 14139 | DEFAULT_MB_RDMA_LOW_WATER_5705; |
@@ -14156,6 +14211,7 @@ static char * __devinit tg3_phy_string(struct tg3 *tp) | |||
14156 | case TG3_PHY_ID_BCM5718C: return "5718C"; | 14211 | case TG3_PHY_ID_BCM5718C: return "5718C"; |
14157 | case TG3_PHY_ID_BCM5718S: return "5718S"; | 14212 | case TG3_PHY_ID_BCM5718S: return "5718S"; |
14158 | case TG3_PHY_ID_BCM57765: return "57765"; | 14213 | case TG3_PHY_ID_BCM57765: return "57765"; |
14214 | case TG3_PHY_ID_BCM5719C: return "5719C"; | ||
14159 | case TG3_PHY_ID_BCM8002: return "8002/serdes"; | 14215 | case TG3_PHY_ID_BCM8002: return "8002/serdes"; |
14160 | case 0: return "serdes"; | 14216 | case 0: return "serdes"; |
14161 | default: return "unknown"; | 14217 | default: return "unknown"; |
@@ -14404,7 +14460,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
14404 | } | 14460 | } |
14405 | 14461 | ||
14406 | if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) && | 14462 | if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) && |
14407 | tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) | 14463 | tp->pci_chip_rev_id != CHIPREV_ID_5717_A0 && |
14464 | GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719) | ||
14408 | dev->netdev_ops = &tg3_netdev_ops; | 14465 | dev->netdev_ops = &tg3_netdev_ops; |
14409 | else | 14466 | else |
14410 | dev->netdev_ops = &tg3_netdev_ops_dma_bug; | 14467 | dev->netdev_ops = &tg3_netdev_ops_dma_bug; |