Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tg3: Add 5785 ASIC revision

This patch added the 5785 device ID and ASIC revision to the code.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Matt Carlson and committed by
David S. Miller
57e6983c b02fd9e3

+45 -15
+43 -15
drivers/net/tg3.c
··· 204 204 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5723)}, 205 205 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5761)}, 206 206 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5761E)}, 207 + {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5785)}, 207 208 {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)}, 208 209 {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)}, 209 210 {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)}, ··· 5711 5710 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 5712 5711 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 5713 5712 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 5714 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) 5713 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 5714 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 5715 5715 tw32(GRC_FASTBOOT_PC, 0); 5716 5716 5717 5717 /* ··· 7006 7004 return err; 7007 7005 7008 7006 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 && 7009 - GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761) { 7007 + GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761 && 7008 + GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785) { 7010 7009 /* This value is determined during the probe time DMA 7011 7010 * engine test, tg3_test_dma. 7012 7011 */ ··· 7246 7243 RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB | 7247 7244 RDMAC_MODE_LNGREAD_ENAB); 7248 7245 7249 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784) 7246 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 7247 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 7250 7248 rdmac_mode |= RDMAC_MODE_BD_SBD_CRPT_ENAB | 7251 7249 RDMAC_MODE_MBUF_RBD_CRPT_ENAB | 7252 7250 RDMAC_MODE_MBUF_SBD_CRPT_ENAB; ··· 7415 7411 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) || 7416 7412 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) || 7417 7413 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784) || 7418 - (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761)) 7414 + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) || 7415 + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)) 7419 7416 val |= WDMAC_MODE_STATUS_TAG_FIX; 7420 7417 7421 7418 tw32_f(WDMAC_MODE, val); ··· 7478 7473 7479 7474 tp->rx_mode = RX_MODE_ENABLE; 7480 7475 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 7481 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) 7476 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 7477 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 7478 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 7482 7479 tp->rx_mode |= RX_MODE_IPV6_CSUM_ENABLE; 7483 7480 7484 7481 tw32_f(MAC_RX_MODE, tp->rx_mode); ··· 9035 9028 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906)) { 9036 9029 if (value) { 9037 9030 dev->features |= NETIF_F_TSO6; 9038 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) 9031 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 9032 + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && 9033 + GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || 9034 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 9039 9035 dev->features |= NETIF_F_TSO_ECN; 9040 9036 } else 9041 9037 dev->features &= ~(NETIF_F_TSO6 | NETIF_F_TSO_ECN); ··· 9296 9286 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 9297 9287 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 9298 9288 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 9299 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) 9289 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 9290 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 9300 9291 ethtool_op_set_tx_ipv6_csum(dev, data); 9301 9292 else 9302 9293 ethtool_op_set_tx_csum(dev, data); ··· 9818 9807 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 9819 9808 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 9820 9809 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 9821 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) 9810 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 9811 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 9822 9812 mem_tbl = mem_tbl_5755; 9823 9813 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) 9824 9814 mem_tbl = mem_tbl_5906; ··· 10026 10014 return TG3_LOOPBACK_FAILED; 10027 10015 10028 10016 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 10029 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) { 10017 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 10018 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) { 10030 10019 int i; 10031 10020 u32 status; 10032 10021 ··· 10055 10042 err |= TG3_MAC_LOOPBACK_FAILED; 10056 10043 10057 10044 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 10058 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) { 10045 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 10046 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) { 10059 10047 tw32(TG3_CPMU_CTRL, cpmuctrl); 10060 10048 10061 10049 /* Release the mutex */ ··· 10704 10690 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755) 10705 10691 tg3_get_5755_nvram_info(tp); 10706 10692 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 10707 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784) 10693 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 10694 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 10708 10695 tg3_get_5787_nvram_info(tp); 10709 10696 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) 10710 10697 tg3_get_5761_nvram_info(tp); ··· 11036 11021 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787) && 11037 11022 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784) && 11038 11023 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5761) && 11024 + (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785) && 11039 11025 (tp->nvram_jedecnum == JEDEC_ST) && 11040 11026 (nvram_cmd & NVRAM_CMD_FIRST)) { 11041 11027 ··· 11940 11924 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 11941 11925 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 11942 11926 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 11927 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || 11943 11928 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906 || 11944 11929 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) 11945 11930 tp->tg3_flags2 |= TG3_FLG2_5750_PLUS; ··· 11962 11945 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 11963 11946 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 11964 11947 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 11948 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || 11965 11949 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) { 11966 11950 tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2; 11967 11951 tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI; ··· 12165 12147 } 12166 12148 12167 12149 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 12168 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) { 12150 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 12151 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) { 12169 12152 tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT; 12170 12153 12171 12154 if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 || ··· 12250 12231 tp->tg3_flags2 |= TG3_FLG2_PHY_JITTER_BUG; 12251 12232 if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5755M) 12252 12233 tp->tg3_flags2 |= TG3_FLG2_PHY_ADJUST_TRIM; 12253 - } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906) 12234 + } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906 && 12235 + GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785) 12254 12236 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG; 12255 12237 } 12256 12238 ··· 12271 12251 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX && 12272 12252 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX) 12273 12253 tp->coalesce_mode |= HOSTCC_MODE_32BYTE; 12254 + 12255 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 12256 + tp->tg3_flags3 |= TG3_FLG3_USE_PHYLIB; 12274 12257 12275 12258 err = tg3_mdio_init(tp); 12276 12259 if (err) ··· 12406 12383 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 12407 12384 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 12408 12385 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 12386 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || 12409 12387 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) 12410 12388 tp->dev->hard_start_xmit = tg3_start_xmit; 12411 12389 else ··· 13331 13307 if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) && 13332 13308 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906)) 13333 13309 dev->features |= NETIF_F_TSO6; 13334 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) 13310 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 13311 + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 && 13312 + GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) || 13313 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 13335 13314 dev->features |= NETIF_F_TSO_ECN; 13336 13315 } 13337 13316 ··· 13400 13373 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 13401 13374 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 13402 13375 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 13403 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) 13376 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 13377 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785) 13404 13378 dev->features |= NETIF_F_IPV6_CSUM; 13405 13379 13406 13380 tp->tg3_flags |= TG3_FLAG_RX_CHECKSUMS;
+1
drivers/net/tg3.h
··· 128 128 #define ASIC_REV_USE_PROD_ID_REG 0x0f 129 129 #define ASIC_REV_5784 0x5784 130 130 #define ASIC_REV_5761 0x5761 131 + #define ASIC_REV_5785 0x5785 131 132 #define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) 132 133 #define CHIPREV_5700_AX 0x70 133 134 #define CHIPREV_5700_BX 0x71
+1
include/linux/pci_ids.h
··· 1979 1979 #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 1980 1980 #define PCI_DEVICE_ID_TIGON3_5782 0x1696 1981 1981 #define PCI_DEVICE_ID_TIGON3_5784 0x1698 1982 + #define PCI_DEVICE_ID_TIGON3_5785 0x1699 1982 1983 #define PCI_DEVICE_ID_TIGON3_5786 0x169a 1983 1984 #define PCI_DEVICE_ID_TIGON3_5787 0x169b 1984 1985 #define PCI_DEVICE_ID_TIGON3_5788 0x169c