aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2013-01-06 07:51:07 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-07 00:02:07 -0500
commitc65a17f4f51231f175336048b49b85da7c24fb6c (patch)
tree85294ed771456c7dc33175741bae1ef6bb52cea3
parentb7dc8c3959fd43bfa0dbcf65375628c86665cb94 (diff)
tg3: Add support for new 5762 ASIC
Add basic support for 5762 which is a 57765_PLUS class device. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c91
-rw-r--r--drivers/net/ethernet/broadcom/tg3.h15
2 files changed, 81 insertions, 25 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 78ea90c40e19..01e3201427ee 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -2632,6 +2632,9 @@ out:
2632 tg3_writephy(tp, MII_TG3_FET_PTEST, 0x12); 2632 tg3_writephy(tp, MII_TG3_FET_PTEST, 0x12);
2633 } 2633 }
2634 2634
2635 if (tp->pci_chip_rev_id == CHIPREV_ID_5762_A0)
2636 tg3_phydsp_write(tp, 0xffb, 0x4000);
2637
2635 tg3_phy_toggle_automdix(tp, 1); 2638 tg3_phy_toggle_automdix(tp, 1);
2636 tg3_phy_set_wirespeed(tp); 2639 tg3_phy_set_wirespeed(tp);
2637 return 0; 2640 return 0;
@@ -4037,6 +4040,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
4037 tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val); 4040 tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
4038 /* Fall through */ 4041 /* Fall through */
4039 case ASIC_REV_5720: 4042 case ASIC_REV_5720:
4043 case ASIC_REV_5762:
4040 if (!tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val)) 4044 if (!tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val))
4041 tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2, val | 4045 tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2, val |
4042 MII_TG3_DSP_CH34TP2_HIBW01); 4046 MII_TG3_DSP_CH34TP2_HIBW01);
@@ -5484,7 +5488,8 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
5484 5488
5485 val = (2 << TX_LENGTHS_IPG_CRS_SHIFT) | 5489 val = (2 << TX_LENGTHS_IPG_CRS_SHIFT) |
5486 (6 << TX_LENGTHS_IPG_SHIFT); 5490 (6 << TX_LENGTHS_IPG_SHIFT);
5487 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) 5491 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
5492 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
5488 val |= tr32(MAC_TX_LENGTHS) & 5493 val |= tr32(MAC_TX_LENGTHS) &
5489 (TX_LENGTHS_JMB_FRM_LEN_MSK | 5494 (TX_LENGTHS_JMB_FRM_LEN_MSK |
5490 TX_LENGTHS_CNT_DWN_VAL_MSK); 5495 TX_LENGTHS_CNT_DWN_VAL_MSK);
@@ -8672,7 +8677,8 @@ static void tg3_rings_reset(struct tg3 *tp)
8672 limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 16; 8677 limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 16;
8673 else if (tg3_flag(tp, 5717_PLUS)) 8678 else if (tg3_flag(tp, 5717_PLUS))
8674 limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 4; 8679 limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 4;
8675 else if (tg3_flag(tp, 57765_CLASS)) 8680 else if (tg3_flag(tp, 57765_CLASS) ||
8681 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
8676 limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 2; 8682 limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE * 2;
8677 else 8683 else
8678 limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE; 8684 limit = NIC_SRAM_SEND_RCB + TG3_BDINFO_SIZE;
@@ -8689,6 +8695,7 @@ static void tg3_rings_reset(struct tg3 *tp)
8689 else if (!tg3_flag(tp, 5705_PLUS)) 8695 else if (!tg3_flag(tp, 5705_PLUS))
8690 limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16; 8696 limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16;
8691 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 8697 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
8698 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762 ||
8692 tg3_flag(tp, 57765_CLASS)) 8699 tg3_flag(tp, 57765_CLASS))
8693 limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 4; 8700 limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 4;
8694 else 8701 else
@@ -8979,9 +8986,12 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
8979 8986
8980 /* Enable MAC control of LPI */ 8987 /* Enable MAC control of LPI */
8981 if (tp->phy_flags & TG3_PHYFLG_EEE_CAP) { 8988 if (tp->phy_flags & TG3_PHYFLG_EEE_CAP) {
8982 tw32_f(TG3_CPMU_EEE_LNKIDL_CTRL, 8989 val = TG3_CPMU_EEE_LNKIDL_PCIE_NL0 |
8983 TG3_CPMU_EEE_LNKIDL_PCIE_NL0 | 8990 TG3_CPMU_EEE_LNKIDL_UART_IDL;
8984 TG3_CPMU_EEE_LNKIDL_UART_IDL); 8991 if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0)
8992 val |= TG3_CPMU_EEE_LNKIDL_APE_TX_MT;
8993
8994 tw32_f(TG3_CPMU_EEE_LNKIDL_CTRL, val);
8985 8995
8986 tw32_f(TG3_CPMU_EEE_CTRL, 8996 tw32_f(TG3_CPMU_EEE_CTRL,
8987 TG3_CPMU_EEE_CTRL_EXIT_20_1_US); 8997 TG3_CPMU_EEE_CTRL_EXIT_20_1_US);
@@ -9156,7 +9166,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9156 if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0) 9166 if (tp->pci_chip_rev_id == CHIPREV_ID_57765_A0)
9157 val &= ~DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK; 9167 val &= ~DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK;
9158 if (!tg3_flag(tp, 57765_CLASS) && 9168 if (!tg3_flag(tp, 57765_CLASS) &&
9159 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717) 9169 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
9170 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5762)
9160 val |= DMA_RWCTRL_TAGGED_STAT_WA; 9171 val |= DMA_RWCTRL_TAGGED_STAT_WA;
9161 tw32(TG3PCI_DMA_RW_CTRL, val | tp->dma_rwctrl); 9172 tw32(TG3PCI_DMA_RW_CTRL, val | tp->dma_rwctrl);
9162 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 && 9173 } else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5784 &&
@@ -9308,7 +9319,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9308 tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS, 9319 tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS,
9309 val | BDINFO_FLAGS_USE_EXT_RECV); 9320 val | BDINFO_FLAGS_USE_EXT_RECV);
9310 if (!tg3_flag(tp, USE_JUMBO_BDFLAG) || 9321 if (!tg3_flag(tp, USE_JUMBO_BDFLAG) ||
9311 tg3_flag(tp, 57765_CLASS)) 9322 tg3_flag(tp, 57765_CLASS) ||
9323 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
9312 tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR, 9324 tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR,
9313 NIC_SRAM_RX_JUMBO_BUFFER_DESC); 9325 NIC_SRAM_RX_JUMBO_BUFFER_DESC);
9314 } else { 9326 } else {
@@ -9350,7 +9362,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9350 (6 << TX_LENGTHS_IPG_SHIFT) | 9362 (6 << TX_LENGTHS_IPG_SHIFT) |
9351 (32 << TX_LENGTHS_SLOT_TIME_SHIFT); 9363 (32 << TX_LENGTHS_SLOT_TIME_SHIFT);
9352 9364
9353 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) 9365 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
9366 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
9354 val |= tr32(MAC_TX_LENGTHS) & 9367 val |= tr32(MAC_TX_LENGTHS) &
9355 (TX_LENGTHS_JMB_FRM_LEN_MSK | 9368 (TX_LENGTHS_JMB_FRM_LEN_MSK |
9356 TX_LENGTHS_CNT_DWN_VAL_MSK); 9369 TX_LENGTHS_CNT_DWN_VAL_MSK);
@@ -9404,7 +9417,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9404 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) 9417 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
9405 rdmac_mode |= RDMAC_MODE_IPV6_LSO_EN; 9418 rdmac_mode |= RDMAC_MODE_IPV6_LSO_EN;
9406 9419
9407 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) 9420 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
9421 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
9408 rdmac_mode |= tr32(RDMAC_MODE) & RDMAC_MODE_H2BNC_VLAN_DET; 9422 rdmac_mode |= tr32(RDMAC_MODE) & RDMAC_MODE_H2BNC_VLAN_DET;
9409 9423
9410 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 || 9424 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761 ||
@@ -9412,8 +9426,16 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9412 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 || 9426 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
9413 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 || 9427 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
9414 tg3_flag(tp, 57765_PLUS)) { 9428 tg3_flag(tp, 57765_PLUS)) {
9415 val = tr32(TG3_RDMA_RSRVCTRL_REG); 9429 u32 tgtreg;
9416 if (tp->pci_chip_rev_id == CHIPREV_ID_5719_A0) { 9430
9431 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
9432 tgtreg = TG3_RDMA_RSRVCTRL_REG2;
9433 else
9434 tgtreg = TG3_RDMA_RSRVCTRL_REG;
9435
9436 val = tr32(tgtreg);
9437 if (tp->pci_chip_rev_id == CHIPREV_ID_5719_A0 ||
9438 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762) {
9417 val &= ~(TG3_RDMA_RSRVCTRL_TXMRGN_MASK | 9439 val &= ~(TG3_RDMA_RSRVCTRL_TXMRGN_MASK |
9418 TG3_RDMA_RSRVCTRL_FIFO_LWM_MASK | 9440 TG3_RDMA_RSRVCTRL_FIFO_LWM_MASK |
9419 TG3_RDMA_RSRVCTRL_FIFO_HWM_MASK); 9441 TG3_RDMA_RSRVCTRL_FIFO_HWM_MASK);
@@ -9421,14 +9443,21 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9421 TG3_RDMA_RSRVCTRL_FIFO_LWM_1_5K | 9443 TG3_RDMA_RSRVCTRL_FIFO_LWM_1_5K |
9422 TG3_RDMA_RSRVCTRL_FIFO_HWM_1_5K; 9444 TG3_RDMA_RSRVCTRL_FIFO_HWM_1_5K;
9423 } 9445 }
9424 tw32(TG3_RDMA_RSRVCTRL_REG, 9446 tw32(tgtreg, val | TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX);
9425 val | TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX);
9426 } 9447 }
9427 9448
9428 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || 9449 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
9429 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) { 9450 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
9430 val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL); 9451 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762) {
9431 tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val | 9452 u32 tgtreg;
9453
9454 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
9455 tgtreg = TG3_LSO_RD_DMA_CRPTEN_CTRL2;
9456 else
9457 tgtreg = TG3_LSO_RD_DMA_CRPTEN_CTRL;
9458
9459 val = tr32(tgtreg);
9460 tw32(tgtreg, val |
9432 TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K | 9461 TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K |
9433 TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_LSO_4K); 9462 TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_LSO_4K);
9434 } 9463 }
@@ -9661,7 +9690,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9661 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) 9690 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
9662 tp->tx_mode |= TX_MODE_MBUF_LOCKUP_FIX; 9691 tp->tx_mode |= TX_MODE_MBUF_LOCKUP_FIX;
9663 9692
9664 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) { 9693 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
9694 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762) {
9665 val = TX_MODE_JMB_FRM_LEN | TX_MODE_CNT_DN_MODE; 9695 val = TX_MODE_JMB_FRM_LEN | TX_MODE_CNT_DN_MODE;
9666 tp->tx_mode &= ~val; 9696 tp->tx_mode &= ~val;
9667 tp->tx_mode |= tr32(MAC_TX_MODE) & val; 9697 tp->tx_mode |= tr32(MAC_TX_MODE) & val;
@@ -12342,7 +12372,8 @@ static int tg3_test_memory(struct tg3 *tp)
12342 12372
12343 if (tg3_flag(tp, 5717_PLUS)) 12373 if (tg3_flag(tp, 5717_PLUS))
12344 mem_tbl = mem_tbl_5717; 12374 mem_tbl = mem_tbl_5717;
12345 else if (tg3_flag(tp, 57765_CLASS)) 12375 else if (tg3_flag(tp, 57765_CLASS) ||
12376 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
12346 mem_tbl = mem_tbl_57765; 12377 mem_tbl = mem_tbl_57765;
12347 else if (tg3_flag(tp, 5755_PLUS)) 12378 else if (tg3_flag(tp, 5755_PLUS))
12348 mem_tbl = mem_tbl_5755; 12379 mem_tbl = mem_tbl_5755;
@@ -14296,6 +14327,7 @@ static int tg3_phy_probe(struct tg3 *tp)
14296 if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) && 14327 if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
14297 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || 14328 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
14298 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 || 14329 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
14330 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762 ||
14299 (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 && 14331 (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 &&
14300 tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) || 14332 tp->pci_chip_rev_id != CHIPREV_ID_5717_A0) ||
14301 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 && 14333 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765 &&
@@ -14785,7 +14817,10 @@ static void tg3_detect_asic_rev(struct tg3 *tp, u32 misc_ctrl_reg)
14785 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717_C || 14817 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717_C ||
14786 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 || 14818 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
14787 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719 || 14819 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719 ||
14788 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5720) 14820 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5720 ||
14821 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5762 ||
14822 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5725 ||
14823 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5727)
14789 reg = TG3PCI_GEN2_PRODID_ASICREV; 14824 reg = TG3PCI_GEN2_PRODID_ASICREV;
14790 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57781 || 14825 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57781 ||
14791 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57785 || 14826 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57785 ||
@@ -14822,7 +14857,8 @@ static void tg3_detect_asic_rev(struct tg3 *tp, u32 misc_ctrl_reg)
14822 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57766) 14857 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57766)
14823 tg3_flag_set(tp, 57765_CLASS); 14858 tg3_flag_set(tp, 57765_CLASS);
14824 14859
14825 if (tg3_flag(tp, 57765_CLASS) || tg3_flag(tp, 5717_PLUS)) 14860 if (tg3_flag(tp, 57765_CLASS) || tg3_flag(tp, 5717_PLUS) ||
14861 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
14826 tg3_flag_set(tp, 57765_PLUS); 14862 tg3_flag_set(tp, 57765_PLUS);
14827 14863
14828 /* Intentionally exclude ASIC_REV_5906 */ 14864 /* Intentionally exclude ASIC_REV_5906 */
@@ -15113,7 +15149,8 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
15113 15149
15114 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || 15150 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
15115 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || 15151 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
15116 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) 15152 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
15153 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
15117 tg3_flag_set(tp, LRG_PROD_RING_CAP); 15154 tg3_flag_set(tp, LRG_PROD_RING_CAP);
15118 15155
15119 if (tg3_flag(tp, 57765_PLUS) && 15156 if (tg3_flag(tp, 57765_PLUS) &&
@@ -15481,7 +15518,8 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
15481 15518
15482 /* Initialize data/descriptor byte/word swapping. */ 15519 /* Initialize data/descriptor byte/word swapping. */
15483 val = tr32(GRC_MODE); 15520 val = tr32(GRC_MODE);
15484 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) 15521 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
15522 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
15485 val &= (GRC_MODE_BYTE_SWAP_B2HRX_DATA | 15523 val &= (GRC_MODE_BYTE_SWAP_B2HRX_DATA |
15486 GRC_MODE_WORD_SWAP_B2HRX_DATA | 15524 GRC_MODE_WORD_SWAP_B2HRX_DATA |
15487 GRC_MODE_B2HRX_ENABLE | 15525 GRC_MODE_B2HRX_ENABLE |
@@ -16238,6 +16276,7 @@ static char *tg3_phy_string(struct tg3 *tp)
16238 case TG3_PHY_ID_BCM57765: return "57765"; 16276 case TG3_PHY_ID_BCM57765: return "57765";
16239 case TG3_PHY_ID_BCM5719C: return "5719C"; 16277 case TG3_PHY_ID_BCM5719C: return "5719C";
16240 case TG3_PHY_ID_BCM5720C: return "5720C"; 16278 case TG3_PHY_ID_BCM5720C: return "5720C";
16279 case TG3_PHY_ID_BCM5762: return "5762C";
16241 case TG3_PHY_ID_BCM8002: return "8002/serdes"; 16280 case TG3_PHY_ID_BCM8002: return "8002/serdes";
16242 case 0: return "serdes"; 16281 case 0: return "serdes";
16243 default: return "unknown"; 16282 default: return "unknown";
@@ -16413,7 +16452,10 @@ static int tg3_init_one(struct pci_dev *pdev,
16413 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717_C || 16452 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717_C ||
16414 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 || 16453 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
16415 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719 || 16454 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719 ||
16416 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5720) { 16455 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5720 ||
16456 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5762 ||
16457 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5725 ||
16458 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5727) {
16417 tg3_flag_set(tp, ENABLE_APE); 16459 tg3_flag_set(tp, ENABLE_APE);
16418 tp->aperegs = pci_ioremap_bar(pdev, BAR_2); 16460 tp->aperegs = pci_ioremap_bar(pdev, BAR_2);
16419 if (!tp->aperegs) { 16461 if (!tp->aperegs) {
@@ -16608,7 +16650,8 @@ static int tg3_init_one(struct pci_dev *pdev,
16608 pci_set_drvdata(pdev, dev); 16650 pci_set_drvdata(pdev, dev);
16609 16651
16610 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 || 16652 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
16611 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720) 16653 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5720 ||
16654 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5762)
16612 tg3_flag_set(tp, PTP_CAPABLE); 16655 tg3_flag_set(tp, PTP_CAPABLE);
16613 16656
16614 if (tg3_flag(tp, 5717_PLUS)) { 16657 if (tg3_flag(tp, 5717_PLUS)) {
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 247d954f3308..46d43f72f8ed 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -65,6 +65,9 @@
65#define TG3PCI_DEVICE_TIGON3_57766 0x1686 65#define TG3PCI_DEVICE_TIGON3_57766 0x1686
66#define TG3PCI_DEVICE_TIGON3_57786 0x16b3 66#define TG3PCI_DEVICE_TIGON3_57786 0x16b3
67#define TG3PCI_DEVICE_TIGON3_57782 0x16b7 67#define TG3PCI_DEVICE_TIGON3_57782 0x16b7
68#define TG3PCI_DEVICE_TIGON3_5762 0x1687
69#define TG3PCI_DEVICE_TIGON3_5725 0x1643
70#define TG3PCI_DEVICE_TIGON3_5727 0x16f3
68/* 0x04 --> 0x2c unused */ 71/* 0x04 --> 0x2c unused */
69#define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM 72#define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM
70#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644 73#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644
@@ -159,6 +162,7 @@
159#define CHIPREV_ID_57765_A0 0x57785000 162#define CHIPREV_ID_57765_A0 0x57785000
160#define CHIPREV_ID_5719_A0 0x05719000 163#define CHIPREV_ID_5719_A0 0x05719000
161#define CHIPREV_ID_5720_A0 0x05720000 164#define CHIPREV_ID_5720_A0 0x05720000
165#define CHIPREV_ID_5762_A0 0x05762000
162#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12) 166#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
163#define ASIC_REV_5700 0x07 167#define ASIC_REV_5700 0x07
164#define ASIC_REV_5701 0x00 168#define ASIC_REV_5701 0x00
@@ -182,6 +186,7 @@
182#define ASIC_REV_5719 0x5719 186#define ASIC_REV_5719 0x5719
183#define ASIC_REV_5720 0x5720 187#define ASIC_REV_5720 0x5720
184#define ASIC_REV_57766 0x57766 188#define ASIC_REV_57766 0x57766
189#define ASIC_REV_5762 0x5762
185#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) 190#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
186#define CHIPREV_5700_AX 0x70 191#define CHIPREV_5700_AX 0x70
187#define CHIPREV_5700_BX 0x71 192#define CHIPREV_5700_BX 0x71
@@ -1178,6 +1183,7 @@
1178#define TG3_CPMU_EEE_LNKIDL_CTRL 0x000036bc 1183#define TG3_CPMU_EEE_LNKIDL_CTRL 0x000036bc
1179#define TG3_CPMU_EEE_LNKIDL_PCIE_NL0 0x01000000 1184#define TG3_CPMU_EEE_LNKIDL_PCIE_NL0 0x01000000
1180#define TG3_CPMU_EEE_LNKIDL_UART_IDL 0x00000004 1185#define TG3_CPMU_EEE_LNKIDL_UART_IDL 0x00000004
1186#define TG3_CPMU_EEE_LNKIDL_APE_TX_MT 0x00000002
1181/* 0x36c0 --> 0x36d0 unused */ 1187/* 0x36c0 --> 0x36d0 unused */
1182 1188
1183#define TG3_CPMU_EEE_CTRL 0x000036d0 1189#define TG3_CPMU_EEE_CTRL 0x000036d0
@@ -1400,7 +1406,10 @@
1400#define RDMAC_STATUS_FIFOURUN 0x00000080 1406#define RDMAC_STATUS_FIFOURUN 0x00000080
1401#define RDMAC_STATUS_FIFOOREAD 0x00000100 1407#define RDMAC_STATUS_FIFOOREAD 0x00000100
1402#define RDMAC_STATUS_LNGREAD 0x00000200 1408#define RDMAC_STATUS_LNGREAD 0x00000200
1403/* 0x4808 --> 0x4900 unused */ 1409/* 0x4808 --> 0x4890 unused */
1410
1411#define TG3_RDMA_RSRVCTRL_REG2 0x00004890
1412#define TG3_LSO_RD_DMA_CRPTEN_CTRL2 0x000048a0
1404 1413
1405#define TG3_RDMA_RSRVCTRL_REG 0x00004900 1414#define TG3_RDMA_RSRVCTRL_REG 0x00004900
1406#define TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004 1415#define TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004
@@ -1910,6 +1919,8 @@
1910#define FLASH_5717VENDOR_ST_45USPT 0x03400001 1919#define FLASH_5717VENDOR_ST_45USPT 0x03400001
1911#define FLASH_5720_EEPROM_HD 0x00000001 1920#define FLASH_5720_EEPROM_HD 0x00000001
1912#define FLASH_5720_EEPROM_LD 0x00000003 1921#define FLASH_5720_EEPROM_LD 0x00000003
1922#define FLASH_5762_EEPROM_HD 0x02000001
1923#define FLASH_5762_EEPROM_LD 0x02000003
1913#define FLASH_5720VENDOR_M_ATMEL_DB011D 0x01000000 1924#define FLASH_5720VENDOR_M_ATMEL_DB011D 0x01000000
1914#define FLASH_5720VENDOR_M_ATMEL_DB021D 0x01000002 1925#define FLASH_5720VENDOR_M_ATMEL_DB021D 0x01000002
1915#define FLASH_5720VENDOR_M_ATMEL_DB041D 0x01000001 1926#define FLASH_5720VENDOR_M_ATMEL_DB041D 0x01000001
@@ -3206,6 +3217,7 @@ struct tg3 {
3206#define TG3_PHY_ID_BCM57765 0x5c0d8a40 3217#define TG3_PHY_ID_BCM57765 0x5c0d8a40
3207#define TG3_PHY_ID_BCM5719C 0x5c0d8a20 3218#define TG3_PHY_ID_BCM5719C 0x5c0d8a20
3208#define TG3_PHY_ID_BCM5720C 0x5c0d8b60 3219#define TG3_PHY_ID_BCM5720C 0x5c0d8b60
3220#define TG3_PHY_ID_BCM5762 0x85803780
3209#define TG3_PHY_ID_BCM5906 0xdc00ac40 3221#define TG3_PHY_ID_BCM5906 0xdc00ac40
3210#define TG3_PHY_ID_BCM8002 0x60010140 3222#define TG3_PHY_ID_BCM8002 0x60010140
3211#define TG3_PHY_ID_INVALID 0xffffffff 3223#define TG3_PHY_ID_INVALID 0xffffffff
@@ -3230,6 +3242,7 @@ struct tg3 {
3230 (X) == TG3_PHY_ID_BCM5906 || (X) == TG3_PHY_ID_BCM5761 || \ 3242 (X) == TG3_PHY_ID_BCM5906 || (X) == TG3_PHY_ID_BCM5761 || \
3231 (X) == TG3_PHY_ID_BCM5718C || (X) == TG3_PHY_ID_BCM5718S || \ 3243 (X) == TG3_PHY_ID_BCM5718C || (X) == TG3_PHY_ID_BCM5718S || \
3232 (X) == TG3_PHY_ID_BCM57765 || (X) == TG3_PHY_ID_BCM5719C || \ 3244 (X) == TG3_PHY_ID_BCM57765 || (X) == TG3_PHY_ID_BCM5719C || \
3245 (X) == TG3_PHY_ID_BCM5720C || (X) == TG3_PHY_ID_BCM5762 || \
3233 (X) == TG3_PHY_ID_BCM8002) 3246 (X) == TG3_PHY_ID_BCM8002)
3234 3247
3235 u32 phy_flags; 3248 u32 phy_flags;