|
@@ -1431,7 +1431,8 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, uint32_t enable_bit
|
1431
|
1431
|
unsigned int i;
|
1432
|
1432
|
uint32_t val;
|
1433
|
1433
|
|
1434
|
|
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
|
|
1434
|
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
|
|
1435
|
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) {
|
1435
|
1436
|
switch(ofs) {
|
1436
|
1437
|
case RCVLSC_MODE:
|
1437
|
1438
|
case DMAC_MODE:
|
|
@@ -1439,7 +1440,7 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, uint32_t enable_bit
|
1439
|
1440
|
case BUFMGR_MODE:
|
1440
|
1441
|
case MEMARB_MODE:
|
1441
|
1442
|
/* We can't enable/disable these bits of the
|
1442
|
|
- * 5705, just say success.
|
|
1443
|
+ * 5705 or 5787, just say success.
|
1443
|
1444
|
*/
|
1444
|
1445
|
return 0;
|
1445
|
1446
|
default:
|
|
@@ -1470,6 +1471,7 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, uint32_t enable_bit
|
1470
|
1471
|
static int tg3_abort_hw(struct tg3 *tp)
|
1471
|
1472
|
{
|
1472
|
1473
|
int i, err;
|
|
1474
|
+ uint32_t val;
|
1473
|
1475
|
|
1474
|
1476
|
tg3_disable_ints(tp);
|
1475
|
1477
|
|
|
@@ -1513,8 +1515,14 @@ static int tg3_abort_hw(struct tg3 *tp)
|
1513
|
1515
|
err |= tg3_stop_block(tp, WDMAC_MODE, WDMAC_MODE_ENABLE);
|
1514
|
1516
|
err |= tg3_stop_block(tp, MBFREE_MODE, MBFREE_MODE_ENABLE);
|
1515
|
1517
|
|
1516
|
|
- tw32(FTQ_RESET, 0xffffffff);
|
1517
|
|
- tw32(FTQ_RESET, 0x00000000);
|
|
1518
|
+ val = tr32(FTQ_RESET);
|
|
1519
|
+ val |= FTQ_RESET_DMA_READ_QUEUE | FTQ_RESET_DMA_HIGH_PRI_READ |
|
|
1520
|
+ FTQ_RESET_SEND_BD_COMPLETION | FTQ_RESET_DMA_WRITE |
|
|
1521
|
+ FTQ_RESET_DMA_HIGH_PRI_WRITE | FTQ_RESET_SEND_DATA_COMPLETION |
|
|
1522
|
+ FTQ_RESET_HOST_COALESCING | FTQ_RESET_MAC_TX |
|
|
1523
|
+ FTQ_RESET_RX_BD_COMPLETE | FTQ_RESET_RX_LIST_PLCMT |
|
|
1524
|
+ FTQ_RESET_RX_DATA_COMPLETION;
|
|
1525
|
+ tw32(FTQ_RESET, val);
|
1518
|
1526
|
|
1519
|
1527
|
err |= tg3_stop_block(tp, BUFMGR_MODE, BUFMGR_MODE_ENABLE);
|
1520
|
1528
|
err |= tg3_stop_block(tp, MEMARB_MODE, MEMARB_MODE_ENABLE);
|
|
@@ -1554,8 +1562,19 @@ static void tg3_chip_reset(struct tg3 *tp)
|
1554
|
1562
|
// Alf: here patched
|
1555
|
1563
|
/* do the reset */
|
1556
|
1564
|
val = GRC_MISC_CFG_CORECLK_RESET;
|
|
1565
|
+ if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
|
|
1566
|
+ if (tr32(0x7e2c) == 0x60) {
|
|
1567
|
+ tw32(0x7e2c, 0x20);
|
|
1568
|
+ }
|
|
1569
|
+ if (tp->pci_chip_rev_id != CHIPREV_ID_5750_A0) {
|
|
1570
|
+ tw32(GRC_MISC_CFG, (1 << 29));
|
|
1571
|
+ val |= (1 << 29);
|
|
1572
|
+ }
|
|
1573
|
+ }
|
|
1574
|
+
|
1557
|
1575
|
if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)
|
1558
|
|
- || (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)) {
|
|
1576
|
+ || (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
|
|
1577
|
+ || (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)) {
|
1559
|
1578
|
val |= GRC_MISC_CFG_KEEP_GPHY_POWER;
|
1560
|
1579
|
}
|
1561
|
1580
|
|
|
@@ -1644,7 +1663,8 @@ static int tg3_restart_fw(struct tg3 *tp, uint32_t state)
|
1644
|
1663
|
udelay(10);
|
1645
|
1664
|
}
|
1646
|
1665
|
if (i >= 100000 &&
|
1647
|
|
- !(tp->tg3_flags2 & TG3_FLG2_SUN_5704)) {
|
|
1666
|
+ !(tp->tg3_flags2 & TG3_FLG2_SUN_5704) &&
|
|
1667
|
+ !(GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)) {
|
1648
|
1668
|
printf ( "Firmware will not restart magic=%#lx\n",
|
1649
|
1669
|
val );
|
1650
|
1670
|
return -ENODEV;
|
|
@@ -1879,7 +1899,9 @@ static int tg3_setup_hw(struct tg3 *tp)
|
1879
|
1899
|
(65 << GRC_MISC_CFG_PRESCALAR_SHIFT));
|
1880
|
1900
|
|
1881
|
1901
|
/* Initialize MBUF/DESC pool. */
|
1882
|
|
- if ((GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) &&
|
|
1902
|
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) {
|
|
1903
|
+ /* Do nothing. */
|
|
1904
|
+ } else if ((GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) &&
|
1883
|
1905
|
(tp->pci_chip_rev_id != CHIPREV_ID_5721)) {
|
1884
|
1906
|
tw32(BUFMGR_MB_POOL_ADDR, NIC_SRAM_MBUF_POOL_BASE);
|
1885
|
1907
|
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704)
|
|
@@ -1976,7 +1998,8 @@ static int tg3_setup_hw(struct tg3 *tp)
|
1976
|
1998
|
TG3_WRITE_SETTINGS(table_all);
|
1977
|
1999
|
tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW,
|
1978
|
2000
|
virt_to_bus(tp->rx_std));
|
1979
|
|
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
|
|
2001
|
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
|
|
2002
|
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) {
|
1980
|
2003
|
tw32(RCVDBDI_STD_BD + TG3_BDINFO_MAXLEN_FLAGS,
|
1981
|
2004
|
RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT);
|
1982
|
2005
|
} else {
|
|
@@ -1985,10 +2008,11 @@ static int tg3_setup_hw(struct tg3 *tp)
|
1985
|
2008
|
}
|
1986
|
2009
|
|
1987
|
2010
|
|
1988
|
|
- /* There is only one send ring on 5705, no need to explicitly
|
|
2011
|
+ /* There is only one send ring on 5705 and 5787, no need to explicitly
|
1989
|
2012
|
* disable the others.
|
1990
|
2013
|
*/
|
1991
|
|
- if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
|
|
2014
|
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
|
|
2015
|
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787) {
|
1992
|
2016
|
/* Clear out send RCB ring in SRAM. */
|
1993
|
2017
|
for (i = NIC_SRAM_SEND_RCB; i < NIC_SRAM_RCV_RET_RCB; i += TG3_BDINFO_SIZE)
|
1994
|
2018
|
tg3_write_mem(i + TG3_BDINFO_MAXLEN_FLAGS, BDINFO_FLAGS_DISABLED);
|
|
@@ -2004,10 +2028,11 @@ static int tg3_setup_hw(struct tg3 *tp)
|
2004
|
2028
|
(TG3_TX_RING_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT),
|
2005
|
2029
|
NIC_SRAM_TX_BUFFER_DESC);
|
2006
|
2030
|
|
2007
|
|
- /* There is only one receive return ring on 5705, no need to explicitly
|
2008
|
|
- * disable the others.
|
|
2031
|
+ /* There is only one receive return ring on 5705 and 5787, no need to
|
|
2032
|
+ * explicitly disable the others.
|
2009
|
2033
|
*/
|
2010
|
|
- if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
|
|
2034
|
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
|
|
2035
|
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787) {
|
2011
|
2036
|
for (i = NIC_SRAM_RCV_RET_RCB; i < NIC_SRAM_STATS_BLK; i += TG3_BDINFO_SIZE) {
|
2012
|
2037
|
tg3_write_mem(i + TG3_BDINFO_MAXLEN_FLAGS,
|
2013
|
2038
|
BDINFO_FLAGS_DISABLED);
|
|
@@ -2086,6 +2111,11 @@ static int tg3_setup_hw(struct tg3 *tp)
|
2086
|
2111
|
!(tp->tg3_flags2 & TG3_FLG2_IS_5788)) {
|
2087
|
2112
|
val |= WDMAC_MODE_RX_ACCEL;
|
2088
|
2113
|
}
|
|
2114
|
+
|
|
2115
|
+ /* Host coalescing bug fix */
|
|
2116
|
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
|
|
2117
|
+ val |= (1 << 29);
|
|
2118
|
+
|
2089
|
2119
|
tw32_carefully(WDMAC_MODE, val);
|
2090
|
2120
|
|
2091
|
2121
|
if ((tp->tg3_flags & TG3_FLAG_PCIX_MODE) != 0) {
|
|
@@ -2182,7 +2212,8 @@ static int tg3_setup_hw(struct tg3 *tp)
|
2182
|
2212
|
virt_to_bus(tp->hw_stats));
|
2183
|
2213
|
tw32(HOSTCC_STATUS_BLK_HOST_ADDR + TG3_64BIT_REG_LOW,
|
2184
|
2214
|
virt_to_bus(tp->hw_status));
|
2185
|
|
- if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
|
|
2215
|
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
|
|
2216
|
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5787) {
|
2186
|
2217
|
TG3_WRITE_SETTINGS(table_not_5705);
|
2187
|
2218
|
}
|
2188
|
2219
|
}
|
|
@@ -2762,15 +2793,9 @@ static int tg3_get_invariants(struct tg3 *tp)
|
2762
|
2793
|
/* determine if it is PCIE system */
|
2763
|
2794
|
// Alf : I have no idea what this is about...
|
2764
|
2795
|
// But it's definitely usefull
|
2765
|
|
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
|
2766
|
|
- val = tr32(TG3PCI_MSI_CAP_ID) ;
|
2767
|
|
- if (((val >> 8) & 0xff) == T3_PCIE_CAPABILITY_ID_REG) {
|
2768
|
|
- val = tr32(T3_PCIE_CAPABILITY_ID_REG) ;
|
2769
|
|
- if ((val & 0xff) == T3_PCIE_CAPABILITY_ID) {
|
2770
|
|
- tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS ;
|
2771
|
|
- }
|
2772
|
|
- }
|
2773
|
|
- }
|
|
2796
|
+ val = pci_find_capability(tp->pdev, PCI_CAP_ID_EXP);
|
|
2797
|
+ if (val)
|
|
2798
|
+ tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
|
2774
|
2799
|
|
2775
|
2800
|
/* Force the chip into D0. */
|
2776
|
2801
|
tg3_set_power_state_0(tp);
|
|
@@ -3010,6 +3035,7 @@ static const char * tg3_phy_string(struct tg3 *tp)
|
3010
|
3035
|
case PHY_ID_BCM5705: return "5705";
|
3011
|
3036
|
case PHY_ID_BCM5750: return "5750";
|
3012
|
3037
|
case PHY_ID_BCM5751: return "5751";
|
|
3038
|
+ case PHY_ID_BCM5787: return "5787";
|
3013
|
3039
|
case PHY_ID_BCM8002: return "8002/serdes";
|
3014
|
3040
|
case PHY_ID_SERDES: return "serdes";
|
3015
|
3041
|
default: return "unknown";
|
|
@@ -3370,6 +3396,7 @@ PCI_ROM(0x14e4, 0x1659, "tg3-5721", "Broadcom Tigon 3 5721"),
|
3370
|
3396
|
PCI_ROM(0x14e4, 0x165d, "tg3-5705M", "Broadcom Tigon 3 5705M"),
|
3371
|
3397
|
PCI_ROM(0x14e4, 0x165e, "tg3-5705M_2", "Broadcom Tigon 3 5705M_2"),
|
3372
|
3398
|
PCI_ROM(0x14e4, 0x1677, "tg3-5751", "Broadcom Tigon 3 5751"),
|
|
3399
|
+PCI_ROM(0x14e4, 0x167a, "tg3-5754", "Broadcom Tigon 3 5754"),
|
3373
|
3400
|
PCI_ROM(0x14e4, 0x1696, "tg3-5782", "Broadcom Tigon 3 5782"),
|
3374
|
3401
|
PCI_ROM(0x14e4, 0x169c, "tg3-5788", "Broadcom Tigon 3 5788"),
|
3375
|
3402
|
PCI_ROM(0x14e4, 0x169d, "tg3-5789", "Broadcom Tigon 3 5789"),
|