aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2013-02-14 09:27:51 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-15 14:02:58 -0500
commitd3f677afb8076d09d090ff0a5d1229c9dd9f136e (patch)
tree14369a258dcdfb65fa65e4f862968fc548e8a7fe
parent9754e293491e3a4e6c1ac020d25140b1ed3d9cd2 (diff)
tg3: Add 57766 device support.
The patch also adds a couple of fixes - For the 57766 and non Ax versions of 57765, bootcode needs to setup the PCIE Fast Training Sequence (FTS) value to prevent transmit hangs. Unfortunately, it does not have enough room in the selfboot case (i.e. devices with no NVRAM). The driver needs to implement this. - For performance reasons, the 2k DMA engine mode on the 57766 should be enabled and dma size limited to 2k for standard sized packets. Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> 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.c18
-rw-r--r--drivers/net/ethernet/broadcom/tg3.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index b1b3bc01cbc2..6e676a7279f8 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -332,6 +332,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
332 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)}, 332 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)},
333 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5720)}, 333 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5720)},
334 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57762)}, 334 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57762)},
335 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57766)},
335 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5762)}, 336 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5762)},
336 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5725)}, 337 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5725)},
337 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5727)}, 338 {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5727)},
@@ -9179,7 +9180,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9179 } 9180 }
9180 9181
9181 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_57765_AX) { 9182 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_57765_AX) {
9182 u32 grc_mode = tr32(GRC_MODE); 9183 u32 grc_mode;
9184
9185 /* Fix transmit hangs */
9186 val = tr32(TG3_CPMU_PADRNG_CTL);
9187 val |= TG3_CPMU_PADRNG_CTL_RDIV2;
9188 tw32(TG3_CPMU_PADRNG_CTL, val);
9189
9190 grc_mode = tr32(GRC_MODE);
9183 9191
9184 /* Access the lower 1K of DL PCIE block registers. */ 9192 /* Access the lower 1K of DL PCIE block registers. */
9185 val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK; 9193 val = grc_mode & ~GRC_MODE_PCIE_PORT_MASK;
@@ -9492,6 +9500,14 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9492 if (tg3_flag(tp, PCI_EXPRESS)) 9500 if (tg3_flag(tp, PCI_EXPRESS))
9493 rdmac_mode |= RDMAC_MODE_FIFO_LONG_BURST; 9501 rdmac_mode |= RDMAC_MODE_FIFO_LONG_BURST;
9494 9502
9503 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57766) {
9504 tp->dma_limit = 0;
9505 if (tp->dev->mtu <= ETH_DATA_LEN) {
9506 rdmac_mode |= RDMAC_MODE_JMB_2K_MMRR;
9507 tp->dma_limit = TG3_TX_BD_DMA_MAX_2K;
9508 }
9509 }
9510
9495 if (tg3_flag(tp, HW_TSO_1) || 9511 if (tg3_flag(tp, HW_TSO_1) ||
9496 tg3_flag(tp, HW_TSO_2) || 9512 tg3_flag(tp, HW_TSO_2) ||
9497 tg3_flag(tp, HW_TSO_3)) 9513 tg3_flag(tp, HW_TSO_3))
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index ef6ced2bf9c3..b6767286d23c 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -1164,6 +1164,8 @@
1164#define CPMU_MUTEX_GNT_DRIVER 0x00001000 1164#define CPMU_MUTEX_GNT_DRIVER 0x00001000
1165#define TG3_CPMU_PHY_STRAP 0x00003664 1165#define TG3_CPMU_PHY_STRAP 0x00003664
1166#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020 1166#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020
1167#define TG3_CPMU_PADRNG_CTL 0x00003668
1168#define TG3_CPMU_PADRNG_CTL_RDIV2 0x00040000
1167/* 0x3664 --> 0x36b0 unused */ 1169/* 0x3664 --> 0x36b0 unused */
1168 1170
1169#define TG3_CPMU_EEE_MODE 0x000036b0 1171#define TG3_CPMU_EEE_MODE 0x000036b0