aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2006-09-27 19:06:21 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 21:01:40 -0400
commitb5d3772ccbe0bc5ac8ffbb5356b74ca698aee28c (patch)
treeef5f1e64d6e656a4931e22efed5809eb42d0e39f /drivers/net
parent7a6f4369449a471a6e5718a87c53ac75a46960ba (diff)
[TG3]: Add basic 5906 support.
Add support for the new 5709 device. This is a new 10/100 Mbps chip. The mailbox access and firmware interface are quite different from all other tg3 chips. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tg3.c126
-rw-r--r--drivers/net/tg3.h28
2 files changed, 139 insertions, 15 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index eafca2a0dd00..2b062d776511 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -199,6 +199,8 @@ static struct pci_device_id tg3_pci_tbl[] = {
199 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780)}, 199 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780)},
200 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780S)}, 200 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780S)},
201 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5781)}, 201 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5781)},
202 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5906)},
203 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5906M)},
202 {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)}, 204 {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)},
203 {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)}, 205 {PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)},
204 {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)}, 206 {PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)},
@@ -426,6 +428,16 @@ static void tg3_write32_tx_mbox(struct tg3 *tp, u32 off, u32 val)
426 readl(mbox); 428 readl(mbox);
427} 429}
428 430
431static u32 tg3_read32_mbox_5906(struct tg3 *tp, u32 off)
432{
433 return (readl(tp->regs + off + GRCMBOX_BASE));
434}
435
436static void tg3_write32_mbox_5906(struct tg3 *tp, u32 off, u32 val)
437{
438 writel(val, tp->regs + off + GRCMBOX_BASE);
439}
440
429#define tw32_mailbox(reg, val) tp->write32_mbox(tp, reg, val) 441#define tw32_mailbox(reg, val) tp->write32_mbox(tp, reg, val)
430#define tw32_mailbox_f(reg, val) tw32_mailbox_flush(tp, (reg), (val)) 442#define tw32_mailbox_f(reg, val) tw32_mailbox_flush(tp, (reg), (val))
431#define tw32_rx_mbox(reg, val) tp->write32_rx_mbox(tp, reg, val) 443#define tw32_rx_mbox(reg, val) tp->write32_rx_mbox(tp, reg, val)
@@ -441,6 +453,10 @@ static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val)
441{ 453{
442 unsigned long flags; 454 unsigned long flags;
443 455
456 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) &&
457 (off >= NIC_SRAM_STATS_BLK) && (off < NIC_SRAM_TX_BUFFER_DESC))
458 return;
459
444 spin_lock_irqsave(&tp->indirect_lock, flags); 460 spin_lock_irqsave(&tp->indirect_lock, flags);
445 if (tp->tg3_flags & TG3_FLAG_SRAM_USE_CONFIG) { 461 if (tp->tg3_flags & TG3_FLAG_SRAM_USE_CONFIG) {
446 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off); 462 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
@@ -462,6 +478,12 @@ static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val)
462{ 478{
463 unsigned long flags; 479 unsigned long flags;
464 480
481 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) &&
482 (off >= NIC_SRAM_STATS_BLK) && (off < NIC_SRAM_TX_BUFFER_DESC)) {
483 *val = 0;
484 return;
485 }
486
465 spin_lock_irqsave(&tp->indirect_lock, flags); 487 spin_lock_irqsave(&tp->indirect_lock, flags);
466 if (tp->tg3_flags & TG3_FLAG_SRAM_USE_CONFIG) { 488 if (tp->tg3_flags & TG3_FLAG_SRAM_USE_CONFIG) {
467 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off); 489 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
@@ -491,6 +513,9 @@ static inline void tg3_cond_int(struct tg3 *tp)
491 if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) && 513 if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS) &&
492 (tp->hw_status->status & SD_STATUS_UPDATED)) 514 (tp->hw_status->status & SD_STATUS_UPDATED))
493 tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl | GRC_LCLCTRL_SETINT); 515 tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl | GRC_LCLCTRL_SETINT);
516 else
517 tw32(HOSTCC_MODE, tp->coalesce_mode |
518 (HOSTCC_MODE_ENABLE | HOSTCC_MODE_NOW));
494} 519}
495 520
496static void tg3_enable_ints(struct tg3 *tp) 521static void tg3_enable_ints(struct tg3 *tp)
@@ -656,6 +681,10 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
656 unsigned int loops; 681 unsigned int loops;
657 int ret; 682 int ret;
658 683
684 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906 &&
685 (reg == MII_TG3_CTRL || reg == MII_TG3_AUX_CTRL))
686 return 0;
687
659 if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { 688 if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) {
660 tw32_f(MAC_MI_MODE, 689 tw32_f(MAC_MI_MODE,
661 (tp->mi_mode & ~MAC_MI_MODE_AUTO_POLL)); 690 (tp->mi_mode & ~MAC_MI_MODE_AUTO_POLL));
@@ -1207,7 +1236,12 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
1207 tg3_setup_phy(tp, 0); 1236 tg3_setup_phy(tp, 0);
1208 } 1237 }
1209 1238
1210 if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) { 1239 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
1240 u32 val;
1241
1242 val = tr32(GRC_VCPU_EXT_CTRL);
1243 tw32(GRC_VCPU_EXT_CTRL, val | GRC_VCPU_EXT_CTRL_DISABLE_WOL);
1244 } else if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {
1211 int i; 1245 int i;
1212 u32 val; 1246 u32 val;
1213 1247
@@ -4667,6 +4701,15 @@ static int tg3_poll_fw(struct tg3 *tp)
4667 int i; 4701 int i;
4668 u32 val; 4702 u32 val;
4669 4703
4704 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
4705 for (i = 0; i < 400; i++) {
4706 if (tr32(VCPU_STATUS) & VCPU_STATUS_INIT_DONE)
4707 return 0;
4708 udelay(10);
4709 }
4710 return -ENODEV;
4711 }
4712
4670 /* Wait for firmware initialization to complete. */ 4713 /* Wait for firmware initialization to complete. */
4671 for (i = 0; i < 100000; i++) { 4714 for (i = 0; i < 100000; i++) {
4672 tg3_read_mem(tp, NIC_SRAM_FIRMWARE_MBOX, &val); 4715 tg3_read_mem(tp, NIC_SRAM_FIRMWARE_MBOX, &val);
@@ -4735,6 +4778,12 @@ static int tg3_chip_reset(struct tg3 *tp)
4735 } 4778 }
4736 } 4779 }
4737 4780
4781 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
4782 tw32(VCPU_STATUS, tr32(VCPU_STATUS) | VCPU_STATUS_DRV_RESET);
4783 tw32(GRC_VCPU_EXT_CTRL,
4784 tr32(GRC_VCPU_EXT_CTRL) & ~GRC_VCPU_EXT_CTRL_HALT_CPU);
4785 }
4786
4738 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) 4787 if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
4739 val |= GRC_MISC_CFG_KEEP_GPHY_POWER; 4788 val |= GRC_MISC_CFG_KEEP_GPHY_POWER;
4740 tw32(GRC_MISC_CFG, val); 4789 tw32(GRC_MISC_CFG, val);
@@ -5066,6 +5115,12 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset)
5066 BUG_ON(offset == TX_CPU_BASE && 5115 BUG_ON(offset == TX_CPU_BASE &&
5067 (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)); 5116 (tp->tg3_flags2 & TG3_FLG2_5705_PLUS));
5068 5117
5118 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
5119 u32 val = tr32(GRC_VCPU_EXT_CTRL);
5120
5121 tw32(GRC_VCPU_EXT_CTRL, val | GRC_VCPU_EXT_CTRL_HALT_CPU);
5122 return 0;
5123 }
5069 if (offset == RX_CPU_BASE) { 5124 if (offset == RX_CPU_BASE) {
5070 for (i = 0; i < 10000; i++) { 5125 for (i = 0; i < 10000; i++) {
5071 tw32(offset + CPU_STATE, 0xffffffff); 5126 tw32(offset + CPU_STATE, 0xffffffff);
@@ -6070,6 +6125,13 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
6070 val = 1; 6125 val = 1;
6071 else if (val > tp->rx_std_max_post) 6126 else if (val > tp->rx_std_max_post)
6072 val = tp->rx_std_max_post; 6127 val = tp->rx_std_max_post;
6128 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
6129 if (tp->pci_chip_rev_id == CHIPREV_ID_5906_A1)
6130 tw32(ISO_PKT_TX, (tr32(ISO_PKT_TX) & ~0x3) | 0x2);
6131
6132 if (val > (TG3_RX_INTERNAL_RING_SZ_5906 / 2))
6133 val = TG3_RX_INTERNAL_RING_SZ_5906 / 2;
6134 }
6073 6135
6074 tw32(RCVBDI_STD_THRESH, val); 6136 tw32(RCVBDI_STD_THRESH, val);
6075 6137
@@ -6984,9 +7046,10 @@ static int tg3_open(struct net_device *dev)
6984 7046
6985 if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) { 7047 if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) {
6986 if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) { 7048 if (tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI) {
6987 u32 val = tr32(0x7c04); 7049 u32 val = tr32(PCIE_TRANSACTION_CFG);
6988 7050
6989 tw32(0x7c04, val | (1 << 29)); 7051 tw32(PCIE_TRANSACTION_CFG,
7052 val | PCIE_TRANS_CFG_1SHOT_MSI);
6990 } 7053 }
6991 } 7054 }
6992 } 7055 }
@@ -7941,7 +8004,8 @@ static int tg3_set_tso(struct net_device *dev, u32 value)
7941 return -EINVAL; 8004 return -EINVAL;
7942 return 0; 8005 return 0;
7943 } 8006 }
7944 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) { 8007 if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) &&
8008 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906)) {
7945 if (value) 8009 if (value)
7946 dev->features |= NETIF_F_TSO6; 8010 dev->features |= NETIF_F_TSO6;
7947 else 8011 else
@@ -9257,6 +9321,13 @@ static void __devinit tg3_get_5787_nvram_info(struct tg3 *tp)
9257 } 9321 }
9258} 9322}
9259 9323
9324static void __devinit tg3_get_5906_nvram_info(struct tg3 *tp)
9325{
9326 tp->nvram_jedecnum = JEDEC_ATMEL;
9327 tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
9328 tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE;
9329}
9330
9260/* Chips other than 5700/5701 use the NVRAM for fetching info. */ 9331/* Chips other than 5700/5701 use the NVRAM for fetching info. */
9261static void __devinit tg3_nvram_init(struct tg3 *tp) 9332static void __devinit tg3_nvram_init(struct tg3 *tp)
9262{ 9333{
@@ -9293,6 +9364,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
9293 tg3_get_5755_nvram_info(tp); 9364 tg3_get_5755_nvram_info(tp);
9294 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 9365 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
9295 tg3_get_5787_nvram_info(tp); 9366 tg3_get_5787_nvram_info(tp);
9367 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
9368 tg3_get_5906_nvram_info(tp);
9296 else 9369 else
9297 tg3_get_nvram_info(tp); 9370 tg3_get_nvram_info(tp);
9298 9371
@@ -9766,6 +9839,12 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
9766 /* Assume an onboard device by default. */ 9839 /* Assume an onboard device by default. */
9767 tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT; 9840 tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT;
9768 9841
9842 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
9843 if (!(tr32(PCIE_TRANSACTION_CFG) & PCIE_TRANS_CFG_LOM))
9844 tp->tg3_flags &= ~TG3_FLAG_EEPROM_WRITE_PROT;
9845 return;
9846 }
9847
9769 tg3_read_mem(tp, NIC_SRAM_DATA_SIG, &val); 9848 tg3_read_mem(tp, NIC_SRAM_DATA_SIG, &val);
9770 if (val == NIC_SRAM_DATA_SIG_MAGIC) { 9849 if (val == NIC_SRAM_DATA_SIG_MAGIC) {
9771 u32 nic_cfg, led_cfg; 9850 u32 nic_cfg, led_cfg;
@@ -10097,7 +10176,10 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
10097 } 10176 }
10098 10177
10099out_not_found: 10178out_not_found:
10100 strcpy(tp->board_part_number, "none"); 10179 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
10180 strcpy(tp->board_part_number, "BCM95906");
10181 else
10182 strcpy(tp->board_part_number, "none");
10101} 10183}
10102 10184
10103static void __devinit tg3_read_fw_ver(struct tg3 *tp) 10185static void __devinit tg3_read_fw_ver(struct tg3 *tp)
@@ -10299,6 +10381,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10299 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 || 10381 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 ||
10300 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 10382 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
10301 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 || 10383 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
10384 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906 ||
10302 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) 10385 (tp->tg3_flags2 & TG3_FLG2_5780_CLASS))
10303 tp->tg3_flags2 |= TG3_FLG2_5750_PLUS; 10386 tp->tg3_flags2 |= TG3_FLG2_5750_PLUS;
10304 10387
@@ -10308,7 +10391,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10308 10391
10309 if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) { 10392 if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
10310 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 10393 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
10311 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) { 10394 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
10395 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
10312 tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2; 10396 tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2;
10313 tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI; 10397 tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI;
10314 } else { 10398 } else {
@@ -10325,7 +10409,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10325 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750 && 10409 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750 &&
10326 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5752 && 10410 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5752 &&
10327 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5755 && 10411 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5755 &&
10328 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787) 10412 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787 &&
10413 GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906)
10329 tp->tg3_flags2 |= TG3_FLG2_JUMBO_CAPABLE; 10414 tp->tg3_flags2 |= TG3_FLG2_JUMBO_CAPABLE;
10330 10415
10331 if (pci_find_capability(tp->pdev, PCI_CAP_ID_EXP) != 0) 10416 if (pci_find_capability(tp->pdev, PCI_CAP_ID_EXP) != 0)
@@ -10455,6 +10540,12 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10455 pci_cmd &= ~PCI_COMMAND_MEMORY; 10540 pci_cmd &= ~PCI_COMMAND_MEMORY;
10456 pci_write_config_word(tp->pdev, PCI_COMMAND, pci_cmd); 10541 pci_write_config_word(tp->pdev, PCI_COMMAND, pci_cmd);
10457 } 10542 }
10543 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
10544 tp->read32_mbox = tg3_read32_mbox_5906;
10545 tp->write32_mbox = tg3_write32_mbox_5906;
10546 tp->write32_tx_mbox = tg3_write32_mbox_5906;
10547 tp->write32_rx_mbox = tg3_write32_mbox_5906;
10548 }
10458 10549
10459 if (tp->write32 == tg3_write_indirect_reg32 || 10550 if (tp->write32 == tg3_write_indirect_reg32 ||
10460 ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) && 10551 ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) &&
@@ -10526,6 +10617,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10526 ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) && 10617 ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) &&
10527 (tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) && 10618 (tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) &&
10528 (tp->pci_chip_rev_id != CHIPREV_ID_5705_A1)) || 10619 (tp->pci_chip_rev_id != CHIPREV_ID_5705_A1)) ||
10620 (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) ||
10529 (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)) 10621 (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES))
10530 tp->tg3_flags2 |= TG3_FLG2_NO_ETH_WIRE_SPEED; 10622 tp->tg3_flags2 |= TG3_FLG2_NO_ETH_WIRE_SPEED;
10531 10623
@@ -10539,7 +10631,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10539 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 10631 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
10540 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 10632 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
10541 tp->tg3_flags2 |= TG3_FLG2_PHY_JITTER_BUG; 10633 tp->tg3_flags2 |= TG3_FLG2_PHY_JITTER_BUG;
10542 else 10634 else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906)
10543 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG; 10635 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG;
10544 } 10636 }
10545 10637
@@ -10629,7 +10721,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10629 tp->pdev->device == PCI_DEVICE_ID_TIGON3_5705F)) || 10721 tp->pdev->device == PCI_DEVICE_ID_TIGON3_5705F)) ||
10630 (tp->pdev->vendor == PCI_VENDOR_ID_BROADCOM && 10722 (tp->pdev->vendor == PCI_VENDOR_ID_BROADCOM &&
10631 (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5751F || 10723 (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5751F ||
10632 tp->pdev->device == PCI_DEVICE_ID_TIGON3_5753F))) 10724 tp->pdev->device == PCI_DEVICE_ID_TIGON3_5753F)) ||
10725 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
10633 tp->tg3_flags |= TG3_FLAG_10_100_ONLY; 10726 tp->tg3_flags |= TG3_FLAG_10_100_ONLY;
10634 10727
10635 err = tg3_phy_probe(tp); 10728 err = tg3_phy_probe(tp);
@@ -10680,7 +10773,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10680 * straddle the 4GB address boundary in some cases. 10773 * straddle the 4GB address boundary in some cases.
10681 */ 10774 */
10682 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 || 10775 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
10683 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 10776 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
10777 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
10684 tp->dev->hard_start_xmit = tg3_start_xmit; 10778 tp->dev->hard_start_xmit = tg3_start_xmit;
10685 else 10779 else
10686 tp->dev->hard_start_xmit = tg3_start_xmit_dma_bug; 10780 tp->dev->hard_start_xmit = tg3_start_xmit_dma_bug;
@@ -10761,6 +10855,8 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
10761 else 10855 else
10762 tg3_nvram_unlock(tp); 10856 tg3_nvram_unlock(tp);
10763 } 10857 }
10858 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
10859 mac_offset = 0x10;
10764 10860
10765 /* First try to get it from MAC address mailbox. */ 10861 /* First try to get it from MAC address mailbox. */
10766 tg3_read_mem(tp, NIC_SRAM_MAC_ADDR_HIGH_MBOX, &hi); 10862 tg3_read_mem(tp, NIC_SRAM_MAC_ADDR_HIGH_MBOX, &hi);
@@ -11244,6 +11340,12 @@ static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
11244 DEFAULT_MB_MACRX_LOW_WATER_5705; 11340 DEFAULT_MB_MACRX_LOW_WATER_5705;
11245 tp->bufmgr_config.mbuf_high_water = 11341 tp->bufmgr_config.mbuf_high_water =
11246 DEFAULT_MB_HIGH_WATER_5705; 11342 DEFAULT_MB_HIGH_WATER_5705;
11343 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
11344 tp->bufmgr_config.mbuf_mac_rx_low_water =
11345 DEFAULT_MB_MACRX_LOW_WATER_5906;
11346 tp->bufmgr_config.mbuf_high_water =
11347 DEFAULT_MB_HIGH_WATER_5906;
11348 }
11247 11349
11248 tp->bufmgr_config.mbuf_read_dma_low_water_jumbo = 11350 tp->bufmgr_config.mbuf_read_dma_low_water_jumbo =
11249 DEFAULT_MB_RDMA_LOW_WATER_JUMBO_5780; 11351 DEFAULT_MB_RDMA_LOW_WATER_JUMBO_5780;
@@ -11288,6 +11390,7 @@ static char * __devinit tg3_phy_string(struct tg3 *tp)
11288 case PHY_ID_BCM5755: return "5755"; 11390 case PHY_ID_BCM5755: return "5755";
11289 case PHY_ID_BCM5787: return "5787"; 11391 case PHY_ID_BCM5787: return "5787";
11290 case PHY_ID_BCM5756: return "5722/5756"; 11392 case PHY_ID_BCM5756: return "5722/5756";
11393 case PHY_ID_BCM5906: return "5906";
11291 case PHY_ID_BCM8002: return "8002/serdes"; 11394 case PHY_ID_BCM8002: return "8002/serdes";
11292 case 0: return "serdes"; 11395 case 0: return "serdes";
11293 default: return "unknown"; 11396 default: return "unknown";
@@ -11590,7 +11693,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
11590 */ 11693 */
11591 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { 11694 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
11592 dev->features |= NETIF_F_TSO; 11695 dev->features |= NETIF_F_TSO;
11593 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) 11696 if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) &&
11697 (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5906))
11594 dev->features |= NETIF_F_TSO6; 11698 dev->features |= NETIF_F_TSO6;
11595 } 11699 }
11596 11700
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index feed13dc8719..2f5e00c96016 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -24,6 +24,8 @@
24 24
25#define RX_COPY_THRESHOLD 256 25#define RX_COPY_THRESHOLD 256
26 26
27#define TG3_RX_INTERNAL_RING_SZ_5906 32
28
27#define RX_STD_MAX_SIZE 1536 29#define RX_STD_MAX_SIZE 1536
28#define RX_STD_MAX_SIZE_5705 512 30#define RX_STD_MAX_SIZE_5705 512
29#define RX_JUMBO_MAX_SIZE 0xdeadbeef /* XXX */ 31#define RX_JUMBO_MAX_SIZE 0xdeadbeef /* XXX */
@@ -129,6 +131,7 @@
129#define CHIPREV_ID_5752_A0_HW 0x5000 131#define CHIPREV_ID_5752_A0_HW 0x5000
130#define CHIPREV_ID_5752_A0 0x6000 132#define CHIPREV_ID_5752_A0 0x6000
131#define CHIPREV_ID_5752_A1 0x6001 133#define CHIPREV_ID_5752_A1 0x6001
134#define CHIPREV_ID_5906_A1 0xc001
132#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12) 135#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
133#define ASIC_REV_5700 0x07 136#define ASIC_REV_5700 0x07
134#define ASIC_REV_5701 0x00 137#define ASIC_REV_5701 0x00
@@ -141,6 +144,7 @@
141#define ASIC_REV_5714 0x09 144#define ASIC_REV_5714 0x09
142#define ASIC_REV_5755 0x0a 145#define ASIC_REV_5755 0x0a
143#define ASIC_REV_5787 0x0b 146#define ASIC_REV_5787 0x0b
147#define ASIC_REV_5906 0x0c
144#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) 148#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
145#define CHIPREV_5700_AX 0x70 149#define CHIPREV_5700_AX 0x70
146#define CHIPREV_5700_BX 0x71 150#define CHIPREV_5700_BX 0x71
@@ -646,7 +650,8 @@
646#define SNDDATAI_SCTRL_FORCE_ZERO 0x00000010 650#define SNDDATAI_SCTRL_FORCE_ZERO 0x00000010
647#define SNDDATAI_STATSENAB 0x00000c0c 651#define SNDDATAI_STATSENAB 0x00000c0c
648#define SNDDATAI_STATSINCMASK 0x00000c10 652#define SNDDATAI_STATSINCMASK 0x00000c10
649/* 0xc14 --> 0xc80 unused */ 653#define ISO_PKT_TX 0x00000c20
654/* 0xc24 --> 0xc80 unused */
650#define SNDDATAI_COS_CNT_0 0x00000c80 655#define SNDDATAI_COS_CNT_0 0x00000c80
651#define SNDDATAI_COS_CNT_1 0x00000c84 656#define SNDDATAI_COS_CNT_1 0x00000c84
652#define SNDDATAI_COS_CNT_2 0x00000c88 657#define SNDDATAI_COS_CNT_2 0x00000c88
@@ -997,11 +1002,13 @@
997#define BUFMGR_MB_MACRX_LOW_WATER 0x00004414 1002#define BUFMGR_MB_MACRX_LOW_WATER 0x00004414
998#define DEFAULT_MB_MACRX_LOW_WATER 0x00000020 1003#define DEFAULT_MB_MACRX_LOW_WATER 0x00000020
999#define DEFAULT_MB_MACRX_LOW_WATER_5705 0x00000010 1004#define DEFAULT_MB_MACRX_LOW_WATER_5705 0x00000010
1005#define DEFAULT_MB_MACRX_LOW_WATER_5906 0x00000004
1000#define DEFAULT_MB_MACRX_LOW_WATER_JUMBO 0x00000098 1006#define DEFAULT_MB_MACRX_LOW_WATER_JUMBO 0x00000098
1001#define DEFAULT_MB_MACRX_LOW_WATER_JUMBO_5780 0x0000004b 1007#define DEFAULT_MB_MACRX_LOW_WATER_JUMBO_5780 0x0000004b
1002#define BUFMGR_MB_HIGH_WATER 0x00004418 1008#define BUFMGR_MB_HIGH_WATER 0x00004418
1003#define DEFAULT_MB_HIGH_WATER 0x00000060 1009#define DEFAULT_MB_HIGH_WATER 0x00000060
1004#define DEFAULT_MB_HIGH_WATER_5705 0x00000060 1010#define DEFAULT_MB_HIGH_WATER_5705 0x00000060
1011#define DEFAULT_MB_HIGH_WATER_5906 0x00000010
1005#define DEFAULT_MB_HIGH_WATER_JUMBO 0x0000017c 1012#define DEFAULT_MB_HIGH_WATER_JUMBO 0x0000017c
1006#define DEFAULT_MB_HIGH_WATER_JUMBO_5780 0x00000096 1013#define DEFAULT_MB_HIGH_WATER_JUMBO_5780 0x00000096
1007#define BUFMGR_RX_MB_ALLOC_REQ 0x0000441c 1014#define BUFMGR_RX_MB_ALLOC_REQ 0x0000441c
@@ -1138,7 +1145,12 @@
1138#define TX_CPU_STATE 0x00005404 1145#define TX_CPU_STATE 0x00005404
1139#define TX_CPU_PGMCTR 0x0000541c 1146#define TX_CPU_PGMCTR 0x0000541c
1140 1147
1148#define VCPU_STATUS 0x00005100
1149#define VCPU_STATUS_INIT_DONE 0x04000000
1150#define VCPU_STATUS_DRV_RESET 0x08000000
1151
1141/* Mailboxes */ 1152/* Mailboxes */
1153#define GRCMBOX_BASE 0x00005600
1142#define GRCMBOX_INTERRUPT_0 0x00005800 /* 64-bit */ 1154#define GRCMBOX_INTERRUPT_0 0x00005800 /* 64-bit */
1143#define GRCMBOX_INTERRUPT_1 0x00005808 /* 64-bit */ 1155#define GRCMBOX_INTERRUPT_1 0x00005808 /* 64-bit */
1144#define GRCMBOX_INTERRUPT_2 0x00005810 /* 64-bit */ 1156#define GRCMBOX_INTERRUPT_2 0x00005810 /* 64-bit */
@@ -1398,7 +1410,10 @@
1398#define GRC_EEPROM_CTRL 0x00006840 1410#define GRC_EEPROM_CTRL 0x00006840
1399#define GRC_MDI_CTRL 0x00006844 1411#define GRC_MDI_CTRL 0x00006844
1400#define GRC_SEEPROM_DELAY 0x00006848 1412#define GRC_SEEPROM_DELAY 0x00006848
1401/* 0x684c --> 0x6c00 unused */ 1413/* 0x684c --> 0x6890 unused */
1414#define GRC_VCPU_EXT_CTRL 0x00006890
1415#define GRC_VCPU_EXT_CTRL_HALT_CPU 0x00400000
1416#define GRC_VCPU_EXT_CTRL_DISABLE_WOL 0x20000000
1402#define GRC_FASTBOOT_PC 0x00006894 /* 5752, 5755, 5787 */ 1417#define GRC_FASTBOOT_PC 0x00006894 /* 5752, 5755, 5787 */
1403 1418
1404/* 0x6c00 --> 0x7000 unused */ 1419/* 0x6c00 --> 0x7000 unused */
@@ -1485,7 +1500,11 @@
1485#define NVRAM_WRITE1 0x00007028 1500#define NVRAM_WRITE1 0x00007028
1486/* 0x702c --> 0x7400 unused */ 1501/* 0x702c --> 0x7400 unused */
1487 1502
1488/* 0x7400 --> 0x8000 unused */ 1503/* 0x7400 --> 0x7c00 unused */
1504#define PCIE_TRANSACTION_CFG 0x00007c04
1505#define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000
1506#define PCIE_TRANS_CFG_LOM 0x00000020
1507
1489 1508
1490#define TG3_EEPROM_MAGIC 0x669955aa 1509#define TG3_EEPROM_MAGIC 0x669955aa
1491 1510
@@ -2283,6 +2302,7 @@ struct tg3 {
2283#define PHY_ID_BCM5755 0xbc050cc0 2302#define PHY_ID_BCM5755 0xbc050cc0
2284#define PHY_ID_BCM5787 0xbc050ce0 2303#define PHY_ID_BCM5787 0xbc050ce0
2285#define PHY_ID_BCM5756 0xbc050ed0 2304#define PHY_ID_BCM5756 0xbc050ed0
2305#define PHY_ID_BCM5906 0xdc00ac40
2286#define PHY_ID_BCM8002 0x60010140 2306#define PHY_ID_BCM8002 0x60010140
2287#define PHY_ID_INVALID 0xffffffff 2307#define PHY_ID_INVALID 0xffffffff
2288#define PHY_ID_REV_MASK 0x0000000f 2308#define PHY_ID_REV_MASK 0x0000000f
@@ -2310,7 +2330,7 @@ struct tg3 {
2310 (X) == PHY_ID_BCM5752 || (X) == PHY_ID_BCM5714 || \ 2330 (X) == PHY_ID_BCM5752 || (X) == PHY_ID_BCM5714 || \
2311 (X) == PHY_ID_BCM5780 || (X) == PHY_ID_BCM5787 || \ 2331 (X) == PHY_ID_BCM5780 || (X) == PHY_ID_BCM5787 || \
2312 (X) == PHY_ID_BCM5755 || (X) == PHY_ID_BCM5756 || \ 2332 (X) == PHY_ID_BCM5755 || (X) == PHY_ID_BCM5756 || \
2313 (X) == PHY_ID_BCM8002) 2333 (X) == PHY_ID_BCM5906 || (X) == PHY_ID_BCM8002)
2314 2334
2315 struct tg3_hw_stats *hw_stats; 2335 struct tg3_hw_stats *hw_stats;
2316 dma_addr_t stats_mapping; 2336 dma_addr_t stats_mapping;