aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/tg3.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/tg3.h')
-rw-r--r--drivers/net/tg3.h388
1 files changed, 269 insertions, 119 deletions
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index be7ff138a7f9..5b3d2f34da7a 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -4,7 +4,7 @@
4 * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com) 4 * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com)
5 * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com) 5 * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com)
6 * Copyright (C) 2004 Sun Microsystems Inc. 6 * Copyright (C) 2004 Sun Microsystems Inc.
7 * Copyright (C) 2007-2010 Broadcom Corporation. 7 * Copyright (C) 2007-2011 Broadcom Corporation.
8 */ 8 */
9 9
10#ifndef _T3_H 10#ifndef _T3_H
@@ -23,10 +23,13 @@
23#define TG3_BDINFO_NIC_ADDR 0xcUL /* 32-bit */ 23#define TG3_BDINFO_NIC_ADDR 0xcUL /* 32-bit */
24#define TG3_BDINFO_SIZE 0x10UL 24#define TG3_BDINFO_SIZE 0x10UL
25 25
26#define TG3_RX_INTERNAL_RING_SZ_5906 32 26#define TG3_RX_STD_MAX_SIZE_5700 512
27 27#define TG3_RX_STD_MAX_SIZE_5717 2048
28#define RX_STD_MAX_SIZE_5705 512 28#define TG3_RX_JMB_MAX_SIZE_5700 256
29#define RX_JUMBO_MAX_SIZE 0xdeadbeef /* XXX */ 29#define TG3_RX_JMB_MAX_SIZE_5717 1024
30#define TG3_RX_RET_MAX_SIZE_5700 1024
31#define TG3_RX_RET_MAX_SIZE_5705 512
32#define TG3_RX_RET_MAX_SIZE_5717 4096
30 33
31/* First 256 bytes are a mirror of PCI config space. */ 34/* First 256 bytes are a mirror of PCI config space. */
32#define TG3PCI_VENDOR 0x00000000 35#define TG3PCI_VENDOR 0x00000000
@@ -46,7 +49,6 @@
46#define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */ 49#define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */
47#define TG3PCI_DEVICE_TIGON3_5717 0x1655 50#define TG3PCI_DEVICE_TIGON3_5717 0x1655
48#define TG3PCI_DEVICE_TIGON3_5718 0x1656 51#define TG3PCI_DEVICE_TIGON3_5718 0x1656
49#define TG3PCI_DEVICE_TIGON3_5724 0x165c
50#define TG3PCI_DEVICE_TIGON3_57781 0x16b1 52#define TG3PCI_DEVICE_TIGON3_57781 0x16b1
51#define TG3PCI_DEVICE_TIGON3_57785 0x16b5 53#define TG3PCI_DEVICE_TIGON3_57785 0x16b5
52#define TG3PCI_DEVICE_TIGON3_57761 0x16b0 54#define TG3PCI_DEVICE_TIGON3_57761 0x16b0
@@ -54,6 +56,7 @@
54#define TG3PCI_DEVICE_TIGON3_57791 0x16b2 56#define TG3PCI_DEVICE_TIGON3_57791 0x16b2
55#define TG3PCI_DEVICE_TIGON3_57795 0x16b6 57#define TG3PCI_DEVICE_TIGON3_57795 0x16b6
56#define TG3PCI_DEVICE_TIGON3_5719 0x1657 58#define TG3PCI_DEVICE_TIGON3_5719 0x1657
59#define TG3PCI_DEVICE_TIGON3_5720 0x165f
57/* 0x04 --> 0x2c unused */ 60/* 0x04 --> 0x2c unused */
58#define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM 61#define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM
59#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644 62#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644
@@ -141,6 +144,8 @@
141#define CHIPREV_ID_57780_A1 0x57780001 144#define CHIPREV_ID_57780_A1 0x57780001
142#define CHIPREV_ID_5717_A0 0x05717000 145#define CHIPREV_ID_5717_A0 0x05717000
143#define CHIPREV_ID_57765_A0 0x57785000 146#define CHIPREV_ID_57765_A0 0x57785000
147#define CHIPREV_ID_5719_A0 0x05719000
148#define CHIPREV_ID_5720_A0 0x05720000
144#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12) 149#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
145#define ASIC_REV_5700 0x07 150#define ASIC_REV_5700 0x07
146#define ASIC_REV_5701 0x00 151#define ASIC_REV_5701 0x00
@@ -162,6 +167,7 @@
162#define ASIC_REV_5717 0x5717 167#define ASIC_REV_5717 0x5717
163#define ASIC_REV_57765 0x57785 168#define ASIC_REV_57765 0x57785
164#define ASIC_REV_5719 0x5719 169#define ASIC_REV_5719 0x5719
170#define ASIC_REV_5720 0x5720
165#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) 171#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
166#define CHIPREV_5700_AX 0x70 172#define CHIPREV_5700_AX 0x70
167#define CHIPREV_5700_BX 0x71 173#define CHIPREV_5700_BX 0x71
@@ -174,6 +180,7 @@
174#define CHIPREV_5750_BX 0x41 180#define CHIPREV_5750_BX 0x41
175#define CHIPREV_5784_AX 0x57840 181#define CHIPREV_5784_AX 0x57840
176#define CHIPREV_5761_AX 0x57610 182#define CHIPREV_5761_AX 0x57610
183#define CHIPREV_57765_AX 0x577650
177#define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff) 184#define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff)
178#define METAL_REV_A0 0x00 185#define METAL_REV_A0 0x00
179#define METAL_REV_A1 0x01 186#define METAL_REV_A1 0x01
@@ -182,6 +189,7 @@
182#define METAL_REV_B2 0x02 189#define METAL_REV_B2 0x02
183#define TG3PCI_DMA_RW_CTRL 0x0000006c 190#define TG3PCI_DMA_RW_CTRL 0x0000006c
184#define DMA_RWCTRL_DIS_CACHE_ALIGNMENT 0x00000001 191#define DMA_RWCTRL_DIS_CACHE_ALIGNMENT 0x00000001
192#define DMA_RWCTRL_TAGGED_STAT_WA 0x00000080
185#define DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK 0x00000380 193#define DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK 0x00000380
186#define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700 194#define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700
187#define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000 195#define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000
@@ -472,6 +480,8 @@
472#define TX_MODE_BIG_BCKOFF_ENABLE 0x00000020 480#define TX_MODE_BIG_BCKOFF_ENABLE 0x00000020
473#define TX_MODE_LONG_PAUSE_ENABLE 0x00000040 481#define TX_MODE_LONG_PAUSE_ENABLE 0x00000040
474#define TX_MODE_MBUF_LOCKUP_FIX 0x00000100 482#define TX_MODE_MBUF_LOCKUP_FIX 0x00000100
483#define TX_MODE_JMB_FRM_LEN 0x00400000
484#define TX_MODE_CNT_DN_MODE 0x00800000
475#define MAC_TX_STATUS 0x00000460 485#define MAC_TX_STATUS 0x00000460
476#define TX_STATUS_XOFFED 0x00000001 486#define TX_STATUS_XOFFED 0x00000001
477#define TX_STATUS_SENT_XOFF 0x00000002 487#define TX_STATUS_SENT_XOFF 0x00000002
@@ -486,6 +496,8 @@
486#define TX_LENGTHS_IPG_SHIFT 8 496#define TX_LENGTHS_IPG_SHIFT 8
487#define TX_LENGTHS_IPG_CRS_MASK 0x00003000 497#define TX_LENGTHS_IPG_CRS_MASK 0x00003000
488#define TX_LENGTHS_IPG_CRS_SHIFT 12 498#define TX_LENGTHS_IPG_CRS_SHIFT 12
499#define TX_LENGTHS_JMB_FRM_LEN_MSK 0x00ff0000
500#define TX_LENGTHS_CNT_DWN_VAL_MSK 0xff000000
489#define MAC_RX_MODE 0x00000468 501#define MAC_RX_MODE 0x00000468
490#define RX_MODE_RESET 0x00000001 502#define RX_MODE_RESET 0x00000001
491#define RX_MODE_ENABLE 0x00000002 503#define RX_MODE_ENABLE 0x00000002
@@ -973,6 +985,7 @@
973#define RCVDBDI_MODE_JUMBOBD_NEEDED 0x00000004 985#define RCVDBDI_MODE_JUMBOBD_NEEDED 0x00000004
974#define RCVDBDI_MODE_FRM_TOO_BIG 0x00000008 986#define RCVDBDI_MODE_FRM_TOO_BIG 0x00000008
975#define RCVDBDI_MODE_INV_RING_SZ 0x00000010 987#define RCVDBDI_MODE_INV_RING_SZ 0x00000010
988#define RCVDBDI_MODE_LRG_RING_SZ 0x00010000
976#define RCVDBDI_STATUS 0x00002404 989#define RCVDBDI_STATUS 0x00002404
977#define RCVDBDI_STATUS_JUMBOBD_NEEDED 0x00000004 990#define RCVDBDI_STATUS_JUMBOBD_NEEDED 0x00000004
978#define RCVDBDI_STATUS_FRM_TOO_BIG 0x00000008 991#define RCVDBDI_STATUS_FRM_TOO_BIG 0x00000008
@@ -1077,6 +1090,9 @@
1077#define CPMU_HST_ACC_MACCLK_6_25 0x00130000 1090#define CPMU_HST_ACC_MACCLK_6_25 0x00130000
1078/* 0x3620 --> 0x3630 unused */ 1091/* 0x3620 --> 0x3630 unused */
1079 1092
1093#define TG3_CPMU_CLCK_ORIDE 0x00003624
1094#define CPMU_CLCK_ORIDE_MAC_ORIDE_EN 0x80000000
1095
1080#define TG3_CPMU_CLCK_STAT 0x00003630 1096#define TG3_CPMU_CLCK_STAT 0x00003630
1081#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000 1097#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000
1082#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000 1098#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000
@@ -1090,7 +1106,32 @@
1090#define CPMU_MUTEX_GNT_DRIVER 0x00001000 1106#define CPMU_MUTEX_GNT_DRIVER 0x00001000
1091#define TG3_CPMU_PHY_STRAP 0x00003664 1107#define TG3_CPMU_PHY_STRAP 0x00003664
1092#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020 1108#define TG3_CPMU_PHY_STRAP_IS_SERDES 0x00000020
1093/* 0x3664 --> 0x3800 unused */ 1109/* 0x3664 --> 0x36b0 unused */
1110
1111#define TG3_CPMU_EEE_MODE 0x000036b0
1112#define TG3_CPMU_EEEMD_APE_TX_DET_EN 0x00000004
1113#define TG3_CPMU_EEEMD_ERLY_L1_XIT_DET 0x00000008
1114#define TG3_CPMU_EEEMD_SND_IDX_DET_EN 0x00000040
1115#define TG3_CPMU_EEEMD_LPI_ENABLE 0x00000080
1116#define TG3_CPMU_EEEMD_LPI_IN_TX 0x00000100
1117#define TG3_CPMU_EEEMD_LPI_IN_RX 0x00000200
1118#define TG3_CPMU_EEEMD_EEE_ENABLE 0x00100000
1119#define TG3_CPMU_EEE_DBTMR1 0x000036b4
1120#define TG3_CPMU_DBTMR1_PCIEXIT_2047US 0x07ff0000
1121#define TG3_CPMU_DBTMR1_LNKIDLE_2047US 0x000070ff
1122#define TG3_CPMU_EEE_DBTMR2 0x000036b8
1123#define TG3_CPMU_DBTMR2_APE_TX_2047US 0x07ff0000
1124#define TG3_CPMU_DBTMR2_TXIDXEQ_2047US 0x000070ff
1125#define TG3_CPMU_EEE_LNKIDL_CTRL 0x000036bc
1126#define TG3_CPMU_EEE_LNKIDL_PCIE_NL0 0x01000000
1127#define TG3_CPMU_EEE_LNKIDL_UART_IDL 0x00000004
1128/* 0x36c0 --> 0x36d0 unused */
1129
1130#define TG3_CPMU_EEE_CTRL 0x000036d0
1131#define TG3_CPMU_EEE_CTRL_EXIT_16_5_US 0x0000019d
1132#define TG3_CPMU_EEE_CTRL_EXIT_36_US 0x00000384
1133#define TG3_CPMU_EEE_CTRL_EXIT_20_1_US 0x000001f8
1134/* 0x36d4 --> 0x3800 unused */
1094 1135
1095/* Mbuf cluster free registers */ 1136/* Mbuf cluster free registers */
1096#define MBFREE_MODE 0x00003800 1137#define MBFREE_MODE 0x00003800
@@ -1161,6 +1202,7 @@
1161#define HOSTCC_STATS_BLK_NIC_ADDR 0x00003c40 1202#define HOSTCC_STATS_BLK_NIC_ADDR 0x00003c40
1162#define HOSTCC_STATUS_BLK_NIC_ADDR 0x00003c44 1203#define HOSTCC_STATUS_BLK_NIC_ADDR 0x00003c44
1163#define HOSTCC_FLOW_ATTN 0x00003c48 1204#define HOSTCC_FLOW_ATTN 0x00003c48
1205#define HOSTCC_FLOW_ATTN_MBUF_LWM 0x00000040
1164/* 0x3c4c --> 0x3c50 unused */ 1206/* 0x3c4c --> 0x3c50 unused */
1165#define HOSTCC_JUMBO_CON_IDX 0x00003c50 1207#define HOSTCC_JUMBO_CON_IDX 0x00003c50
1166#define HOSTCC_STD_CON_IDX 0x00003c54 1208#define HOSTCC_STD_CON_IDX 0x00003c54
@@ -1225,6 +1267,7 @@
1225#define BUFMGR_MODE_ATTN_ENABLE 0x00000004 1267#define BUFMGR_MODE_ATTN_ENABLE 0x00000004
1226#define BUFMGR_MODE_BM_TEST 0x00000008 1268#define BUFMGR_MODE_BM_TEST 0x00000008
1227#define BUFMGR_MODE_MBLOW_ATTN_ENAB 0x00000010 1269#define BUFMGR_MODE_MBLOW_ATTN_ENAB 0x00000010
1270#define BUFMGR_MODE_NO_TX_UNDERRUN 0x80000000
1228#define BUFMGR_STATUS 0x00004404 1271#define BUFMGR_STATUS 0x00004404
1229#define BUFMGR_STATUS_ERROR 0x00000004 1272#define BUFMGR_STATUS_ERROR 0x00000004
1230#define BUFMGR_STATUS_MBLOW 0x00000010 1273#define BUFMGR_STATUS_MBLOW 0x00000010
@@ -1293,6 +1336,7 @@
1293#define RDMAC_MODE_MULT_DMA_RD_DIS 0x01000000 1336#define RDMAC_MODE_MULT_DMA_RD_DIS 0x01000000
1294#define RDMAC_MODE_IPV4_LSO_EN 0x08000000 1337#define RDMAC_MODE_IPV4_LSO_EN 0x08000000
1295#define RDMAC_MODE_IPV6_LSO_EN 0x10000000 1338#define RDMAC_MODE_IPV6_LSO_EN 0x10000000
1339#define RDMAC_MODE_H2BNC_VLAN_DET 0x20000000
1296#define RDMAC_STATUS 0x00004804 1340#define RDMAC_STATUS 0x00004804
1297#define RDMAC_STATUS_TGTABORT 0x00000004 1341#define RDMAC_STATUS_TGTABORT 0x00000004
1298#define RDMAC_STATUS_MSTABORT 0x00000008 1342#define RDMAC_STATUS_MSTABORT 0x00000008
@@ -1302,7 +1346,22 @@
1302#define RDMAC_STATUS_FIFOURUN 0x00000080 1346#define RDMAC_STATUS_FIFOURUN 0x00000080
1303#define RDMAC_STATUS_FIFOOREAD 0x00000100 1347#define RDMAC_STATUS_FIFOOREAD 0x00000100
1304#define RDMAC_STATUS_LNGREAD 0x00000200 1348#define RDMAC_STATUS_LNGREAD 0x00000200
1305/* 0x4808 --> 0x4c00 unused */ 1349/* 0x4808 --> 0x4900 unused */
1350
1351#define TG3_RDMA_RSRVCTRL_REG 0x00004900
1352#define TG3_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004
1353#define TG3_RDMA_RSRVCTRL_FIFO_LWM_1_5K 0x00000c00
1354#define TG3_RDMA_RSRVCTRL_FIFO_LWM_MASK 0x00000ff0
1355#define TG3_RDMA_RSRVCTRL_FIFO_HWM_1_5K 0x000c0000
1356#define TG3_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000ff000
1357#define TG3_RDMA_RSRVCTRL_TXMRGN_320B 0x28000000
1358#define TG3_RDMA_RSRVCTRL_TXMRGN_MASK 0xffe00000
1359/* 0x4904 --> 0x4910 unused */
1360
1361#define TG3_LSO_RD_DMA_CRPTEN_CTRL 0x00004910
1362#define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K 0x00030000
1363#define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_LSO_4K 0x000c0000
1364/* 0x4914 --> 0x4c00 unused */
1306 1365
1307/* Write DMA control registers */ 1366/* Write DMA control registers */
1308#define WDMAC_MODE 0x00004c00 1367#define WDMAC_MODE 0x00004c00
@@ -1554,6 +1613,7 @@
1554#define MSGINT_MODE_ONE_SHOT_DISABLE 0x00000020 1613#define MSGINT_MODE_ONE_SHOT_DISABLE 0x00000020
1555#define MSGINT_MODE_MULTIVEC_EN 0x00000080 1614#define MSGINT_MODE_MULTIVEC_EN 0x00000080
1556#define MSGINT_STATUS 0x00006004 1615#define MSGINT_STATUS 0x00006004
1616#define MSGINT_STATUS_MSI_REQ 0x00000001
1557#define MSGINT_FIFO 0x00006008 1617#define MSGINT_FIFO 0x00006008
1558/* 0x600c --> 0x6400 unused */ 1618/* 0x600c --> 0x6400 unused */
1559 1619
@@ -1570,6 +1630,8 @@
1570#define GRC_MODE_WSWAP_NONFRM_DATA 0x00000004 1630#define GRC_MODE_WSWAP_NONFRM_DATA 0x00000004
1571#define GRC_MODE_BSWAP_DATA 0x00000010 1631#define GRC_MODE_BSWAP_DATA 0x00000010
1572#define GRC_MODE_WSWAP_DATA 0x00000020 1632#define GRC_MODE_WSWAP_DATA 0x00000020
1633#define GRC_MODE_BYTE_SWAP_B2HRX_DATA 0x00000040
1634#define GRC_MODE_WORD_SWAP_B2HRX_DATA 0x00000080
1573#define GRC_MODE_SPLITHDR 0x00000100 1635#define GRC_MODE_SPLITHDR 0x00000100
1574#define GRC_MODE_NOFRM_CRACKING 0x00000200 1636#define GRC_MODE_NOFRM_CRACKING 0x00000200
1575#define GRC_MODE_INCL_CRC 0x00000400 1637#define GRC_MODE_INCL_CRC 0x00000400
@@ -1577,8 +1639,10 @@
1577#define GRC_MODE_NOIRQ_ON_SENDS 0x00002000 1639#define GRC_MODE_NOIRQ_ON_SENDS 0x00002000
1578#define GRC_MODE_NOIRQ_ON_RCV 0x00004000 1640#define GRC_MODE_NOIRQ_ON_RCV 0x00004000
1579#define GRC_MODE_FORCE_PCI32BIT 0x00008000 1641#define GRC_MODE_FORCE_PCI32BIT 0x00008000
1642#define GRC_MODE_B2HRX_ENABLE 0x00008000
1580#define GRC_MODE_HOST_STACKUP 0x00010000 1643#define GRC_MODE_HOST_STACKUP 0x00010000
1581#define GRC_MODE_HOST_SENDBDS 0x00020000 1644#define GRC_MODE_HOST_SENDBDS 0x00020000
1645#define GRC_MODE_HTX2B_ENABLE 0x00040000
1582#define GRC_MODE_NO_TX_PHDR_CSUM 0x00100000 1646#define GRC_MODE_NO_TX_PHDR_CSUM 0x00100000
1583#define GRC_MODE_NVRAM_WR_ENABLE 0x00200000 1647#define GRC_MODE_NVRAM_WR_ENABLE 0x00200000
1584#define GRC_MODE_PCIE_TL_SEL 0x00000000 1648#define GRC_MODE_PCIE_TL_SEL 0x00000000
@@ -1775,6 +1839,38 @@
1775#define FLASH_5717VENDOR_ATMEL_45USPT 0x03400000 1839#define FLASH_5717VENDOR_ATMEL_45USPT 0x03400000
1776#define FLASH_5717VENDOR_ST_25USPT 0x03400002 1840#define FLASH_5717VENDOR_ST_25USPT 0x03400002
1777#define FLASH_5717VENDOR_ST_45USPT 0x03400001 1841#define FLASH_5717VENDOR_ST_45USPT 0x03400001
1842#define FLASH_5720_EEPROM_HD 0x00000001
1843#define FLASH_5720_EEPROM_LD 0x00000003
1844#define FLASH_5720VENDOR_M_ATMEL_DB011D 0x01000000
1845#define FLASH_5720VENDOR_M_ATMEL_DB021D 0x01000002
1846#define FLASH_5720VENDOR_M_ATMEL_DB041D 0x01000001
1847#define FLASH_5720VENDOR_M_ATMEL_DB081D 0x01000003
1848#define FLASH_5720VENDOR_M_ST_M25PE10 0x02000000
1849#define FLASH_5720VENDOR_M_ST_M25PE20 0x02000002
1850#define FLASH_5720VENDOR_M_ST_M25PE40 0x02000001
1851#define FLASH_5720VENDOR_M_ST_M25PE80 0x02000003
1852#define FLASH_5720VENDOR_M_ST_M45PE10 0x03000000
1853#define FLASH_5720VENDOR_M_ST_M45PE20 0x03000002
1854#define FLASH_5720VENDOR_M_ST_M45PE40 0x03000001
1855#define FLASH_5720VENDOR_M_ST_M45PE80 0x03000003
1856#define FLASH_5720VENDOR_A_ATMEL_DB011B 0x01800000
1857#define FLASH_5720VENDOR_A_ATMEL_DB021B 0x01800002
1858#define FLASH_5720VENDOR_A_ATMEL_DB041B 0x01800001
1859#define FLASH_5720VENDOR_A_ATMEL_DB011D 0x01c00000
1860#define FLASH_5720VENDOR_A_ATMEL_DB021D 0x01c00002
1861#define FLASH_5720VENDOR_A_ATMEL_DB041D 0x01c00001
1862#define FLASH_5720VENDOR_A_ATMEL_DB081D 0x01c00003
1863#define FLASH_5720VENDOR_A_ST_M25PE10 0x02800000
1864#define FLASH_5720VENDOR_A_ST_M25PE20 0x02800002
1865#define FLASH_5720VENDOR_A_ST_M25PE40 0x02800001
1866#define FLASH_5720VENDOR_A_ST_M25PE80 0x02800003
1867#define FLASH_5720VENDOR_A_ST_M45PE10 0x02c00000
1868#define FLASH_5720VENDOR_A_ST_M45PE20 0x02c00002
1869#define FLASH_5720VENDOR_A_ST_M45PE40 0x02c00001
1870#define FLASH_5720VENDOR_A_ST_M45PE80 0x02c00003
1871#define FLASH_5720VENDOR_ATMEL_45USPT 0x03c00000
1872#define FLASH_5720VENDOR_ST_25USPT 0x03c00002
1873#define FLASH_5720VENDOR_ST_45USPT 0x03c00001
1778#define NVRAM_CFG1_5752PAGE_SIZE_MASK 0x70000000 1874#define NVRAM_CFG1_5752PAGE_SIZE_MASK 0x70000000
1779#define FLASH_5752PAGE_SIZE_256 0x00000000 1875#define FLASH_5752PAGE_SIZE_256 0x00000000
1780#define FLASH_5752PAGE_SIZE_512 0x10000000 1876#define FLASH_5752PAGE_SIZE_512 0x10000000
@@ -1856,11 +1952,16 @@
1856 1952
1857/* Alternate PCIE definitions */ 1953/* Alternate PCIE definitions */
1858#define TG3_PCIE_TLDLPL_PORT 0x00007c00 1954#define TG3_PCIE_TLDLPL_PORT 0x00007c00
1955#define TG3_PCIE_DL_LO_FTSMAX 0x0000000c
1956#define TG3_PCIE_DL_LO_FTSMAX_MSK 0x000000ff
1957#define TG3_PCIE_DL_LO_FTSMAX_VAL 0x0000002c
1859#define TG3_PCIE_PL_LO_PHYCTL1 0x00000004 1958#define TG3_PCIE_PL_LO_PHYCTL1 0x00000004
1860#define TG3_PCIE_PL_LO_PHYCTL1_L1PLLPD_EN 0x00001000 1959#define TG3_PCIE_PL_LO_PHYCTL1_L1PLLPD_EN 0x00001000
1861#define TG3_PCIE_PL_LO_PHYCTL5 0x00000014 1960#define TG3_PCIE_PL_LO_PHYCTL5 0x00000014
1862#define TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ 0x80000000 1961#define TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ 0x80000000
1863 1962
1963#define TG3_REG_BLK_SIZE 0x00008000
1964
1864/* OTP bit definitions */ 1965/* OTP bit definitions */
1865#define TG3_OTP_AGCTGT_MASK 0x000000e0 1966#define TG3_OTP_AGCTGT_MASK 0x000000e0
1866#define TG3_OTP_AGCTGT_SHIFT 1 1967#define TG3_OTP_AGCTGT_SHIFT 1
@@ -1904,6 +2005,7 @@
1904#define TG3_EEPROM_SB_REVISION_3 0x00030000 2005#define TG3_EEPROM_SB_REVISION_3 0x00030000
1905#define TG3_EEPROM_SB_REVISION_4 0x00040000 2006#define TG3_EEPROM_SB_REVISION_4 0x00040000
1906#define TG3_EEPROM_SB_REVISION_5 0x00050000 2007#define TG3_EEPROM_SB_REVISION_5 0x00050000
2008#define TG3_EEPROM_SB_REVISION_6 0x00060000
1907#define TG3_EEPROM_MAGIC_HW 0xabcd 2009#define TG3_EEPROM_MAGIC_HW 0xabcd
1908#define TG3_EEPROM_MAGIC_HW_MSK 0xffff 2010#define TG3_EEPROM_MAGIC_HW_MSK 0xffff
1909 2011
@@ -1911,7 +2013,9 @@
1911#define TG3_NVM_DIR_END 0x78 2013#define TG3_NVM_DIR_END 0x78
1912#define TG3_NVM_DIRENT_SIZE 0xc 2014#define TG3_NVM_DIRENT_SIZE 0xc
1913#define TG3_NVM_DIRTYPE_SHIFT 24 2015#define TG3_NVM_DIRTYPE_SHIFT 24
2016#define TG3_NVM_DIRTYPE_LENMSK 0x003fffff
1914#define TG3_NVM_DIRTYPE_ASFINI 1 2017#define TG3_NVM_DIRTYPE_ASFINI 1
2018#define TG3_NVM_DIRTYPE_EXTVPD 20
1915#define TG3_NVM_PTREV_BCVER 0x94 2019#define TG3_NVM_PTREV_BCVER 0x94
1916#define TG3_NVM_BCVER_MAJMSK 0x0000ff00 2020#define TG3_NVM_BCVER_MAJMSK 0x0000ff00
1917#define TG3_NVM_BCVER_MAJSFT 8 2021#define TG3_NVM_BCVER_MAJSFT 8
@@ -1923,6 +2027,7 @@
1923#define TG3_EEPROM_SB_F1R3_EDH_OFF 0x18 2027#define TG3_EEPROM_SB_F1R3_EDH_OFF 0x18
1924#define TG3_EEPROM_SB_F1R4_EDH_OFF 0x1c 2028#define TG3_EEPROM_SB_F1R4_EDH_OFF 0x1c
1925#define TG3_EEPROM_SB_F1R5_EDH_OFF 0x20 2029#define TG3_EEPROM_SB_F1R5_EDH_OFF 0x20
2030#define TG3_EEPROM_SB_F1R6_EDH_OFF 0x4c
1926#define TG3_EEPROM_SB_EDH_MAJ_MASK 0x00000700 2031#define TG3_EEPROM_SB_EDH_MAJ_MASK 0x00000700
1927#define TG3_EEPROM_SB_EDH_MAJ_SHFT 8 2032#define TG3_EEPROM_SB_EDH_MAJ_SHFT 8
1928#define TG3_EEPROM_SB_EDH_MIN_MASK 0x000000ff 2033#define TG3_EEPROM_SB_EDH_MIN_MASK 0x000000ff
@@ -2034,6 +2139,13 @@
2034#define NIC_SRAM_MBUF_POOL_BASE5705 0x00010000 2139#define NIC_SRAM_MBUF_POOL_BASE5705 0x00010000
2035#define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000 2140#define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000
2036 2141
2142#define TG3_SRAM_RX_STD_BDCACHE_SIZE_5700 128
2143#define TG3_SRAM_RX_STD_BDCACHE_SIZE_5755 64
2144#define TG3_SRAM_RX_STD_BDCACHE_SIZE_5906 32
2145
2146#define TG3_SRAM_RX_JMB_BDCACHE_SIZE_5700 64
2147#define TG3_SRAM_RX_JMB_BDCACHE_SIZE_5717 16
2148
2037 2149
2038/* Currently this is fixed. */ 2150/* Currently this is fixed. */
2039#define TG3_PHY_MII_ADDR 0x01 2151#define TG3_PHY_MII_ADDR 0x01
@@ -2048,6 +2160,10 @@
2048#define MII_TG3_CTRL_AS_MASTER 0x0800 2160#define MII_TG3_CTRL_AS_MASTER 0x0800
2049#define MII_TG3_CTRL_ENABLE_AS_MASTER 0x1000 2161#define MII_TG3_CTRL_ENABLE_AS_MASTER 0x1000
2050 2162
2163#define MII_TG3_MMD_CTRL 0x0d /* MMD Access Control register */
2164#define MII_TG3_MMD_CTRL_DATA_NOINC 0x4000
2165#define MII_TG3_MMD_ADDRESS 0x0e /* MMD Address Data register */
2166
2051#define MII_TG3_EXT_CTRL 0x10 /* Extended control register */ 2167#define MII_TG3_EXT_CTRL 0x10 /* Extended control register */
2052#define MII_TG3_EXT_CTRL_FIFO_ELASTIC 0x0001 2168#define MII_TG3_EXT_CTRL_FIFO_ELASTIC 0x0001
2053#define MII_TG3_EXT_CTRL_LNK3_LED_MODE 0x0002 2169#define MII_TG3_EXT_CTRL_LNK3_LED_MODE 0x0002
@@ -2064,7 +2180,13 @@
2064 2180
2065#define MII_TG3_DSP_TAP1 0x0001 2181#define MII_TG3_DSP_TAP1 0x0001
2066#define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007 2182#define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007
2183#define MII_TG3_DSP_TAP26 0x001a
2184#define MII_TG3_DSP_TAP26_ALNOKO 0x0001
2185#define MII_TG3_DSP_TAP26_RMRXSTO 0x0002
2186#define MII_TG3_DSP_TAP26_OPCSINPT 0x0004
2067#define MII_TG3_DSP_AADJ1CH0 0x001f 2187#define MII_TG3_DSP_AADJ1CH0 0x001f
2188#define MII_TG3_DSP_CH34TP2 0x4022
2189#define MII_TG3_DSP_CH34TP2_HIBW01 0x017b
2068#define MII_TG3_DSP_AADJ1CH3 0x601f 2190#define MII_TG3_DSP_AADJ1CH3 0x601f
2069#define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002 2191#define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002
2070#define MII_TG3_DSP_EXP1_INT_STAT 0x0f01 2192#define MII_TG3_DSP_EXP1_INT_STAT 0x0f01
@@ -2075,23 +2197,30 @@
2075#define MII_TG3_DSP_EXP96 0x0f96 2197#define MII_TG3_DSP_EXP96 0x0f96
2076#define MII_TG3_DSP_EXP97 0x0f97 2198#define MII_TG3_DSP_EXP97 0x0f97
2077 2199
2078#define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */ 2200#define MII_TG3_AUX_CTRL 0x18 /* auxiliary control register */
2079 2201
2202#define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000
2203#define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400
2204#define MII_TG3_AUXCTL_ACTL_SMDSP_ENA 0x0800
2205#define MII_TG3_AUXCTL_ACTL_EXTPKTLEN 0x4000
2206
2207#define MII_TG3_AUXCTL_SHDWSEL_PWRCTL 0x0002
2208#define MII_TG3_AUXCTL_PCTL_WOL_EN 0x0008
2080#define MII_TG3_AUXCTL_PCTL_100TX_LPWR 0x0010 2209#define MII_TG3_AUXCTL_PCTL_100TX_LPWR 0x0010
2081#define MII_TG3_AUXCTL_PCTL_SPR_ISOLATE 0x0020 2210#define MII_TG3_AUXCTL_PCTL_SPR_ISOLATE 0x0020
2211#define MII_TG3_AUXCTL_PCTL_CL_AB_TXDAC 0x0040
2082#define MII_TG3_AUXCTL_PCTL_VREG_11V 0x0180 2212#define MII_TG3_AUXCTL_PCTL_VREG_11V 0x0180
2083#define MII_TG3_AUXCTL_SHDWSEL_PWRCTL 0x0002
2084 2213
2085#define MII_TG3_AUXCTL_MISC_WREN 0x8000 2214#define MII_TG3_AUXCTL_SHDWSEL_MISCTEST 0x0004
2086#define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200 2215
2087#define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000
2088#define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007 2216#define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007
2217#define MII_TG3_AUXCTL_MISC_WIRESPD_EN 0x0010
2218#define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200
2219#define MII_TG3_AUXCTL_MISC_RDSEL_SHIFT 12
2220#define MII_TG3_AUXCTL_MISC_WREN 0x8000
2089 2221
2090#define MII_TG3_AUXCTL_ACTL_SMDSP_ENA 0x0800
2091#define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400
2092#define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000
2093 2222
2094#define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */ 2223#define MII_TG3_AUX_STAT 0x19 /* auxiliary status register */
2095#define MII_TG3_AUX_STAT_LPASS 0x0004 2224#define MII_TG3_AUX_STAT_LPASS 0x0004
2096#define MII_TG3_AUX_STAT_SPDMASK 0x0700 2225#define MII_TG3_AUX_STAT_SPDMASK 0x0700
2097#define MII_TG3_AUX_STAT_10HALF 0x0100 2226#define MII_TG3_AUX_STAT_10HALF 0x0100
@@ -2131,6 +2260,11 @@
2131#define MII_TG3_TEST1_TRIM_EN 0x0010 2260#define MII_TG3_TEST1_TRIM_EN 0x0010
2132#define MII_TG3_TEST1_CRC_EN 0x8000 2261#define MII_TG3_TEST1_CRC_EN 0x8000
2133 2262
2263/* Clause 45 expansion registers */
2264#define TG3_CL45_D7_EEERES_STAT 0x803e
2265#define TG3_CL45_D7_EEERES_STAT_LP_100TX 0x0002
2266#define TG3_CL45_D7_EEERES_STAT_LP_1000T 0x0004
2267
2134 2268
2135/* Fast Ethernet Tranceiver definitions */ 2269/* Fast Ethernet Tranceiver definitions */
2136#define MII_TG3_FET_PTEST 0x17 2270#define MII_TG3_FET_PTEST 0x17
@@ -2176,7 +2310,7 @@
2176#define TG3_APE_HOST_SEG_SIG 0x4200 2310#define TG3_APE_HOST_SEG_SIG 0x4200
2177#define APE_HOST_SEG_SIG_MAGIC 0x484f5354 2311#define APE_HOST_SEG_SIG_MAGIC 0x484f5354
2178#define TG3_APE_HOST_SEG_LEN 0x4204 2312#define TG3_APE_HOST_SEG_LEN 0x4204
2179#define APE_HOST_SEG_LEN_MAGIC 0x0000001c 2313#define APE_HOST_SEG_LEN_MAGIC 0x00000020
2180#define TG3_APE_HOST_INIT_COUNT 0x4208 2314#define TG3_APE_HOST_INIT_COUNT 0x4208
2181#define TG3_APE_HOST_DRIVER_ID 0x420c 2315#define TG3_APE_HOST_DRIVER_ID 0x420c
2182#define APE_HOST_DRIVER_ID_LINUX 0xf0000000 2316#define APE_HOST_DRIVER_ID_LINUX 0xf0000000
@@ -2188,6 +2322,12 @@
2188#define APE_HOST_HEARTBEAT_INT_DISABLE 0 2322#define APE_HOST_HEARTBEAT_INT_DISABLE 0
2189#define APE_HOST_HEARTBEAT_INT_5SEC 5000 2323#define APE_HOST_HEARTBEAT_INT_5SEC 5000
2190#define TG3_APE_HOST_HEARTBEAT_COUNT 0x4218 2324#define TG3_APE_HOST_HEARTBEAT_COUNT 0x4218
2325#define TG3_APE_HOST_DRVR_STATE 0x421c
2326#define TG3_APE_HOST_DRVR_STATE_START 0x00000001
2327#define TG3_APE_HOST_DRVR_STATE_UNLOAD 0x00000002
2328#define TG3_APE_HOST_DRVR_STATE_WOL 0x00000003
2329#define TG3_APE_HOST_WOL_SPEED 0x4224
2330#define TG3_APE_HOST_WOL_SPEED_AUTO 0x00008000
2191 2331
2192#define TG3_APE_EVENT_STATUS 0x4300 2332#define TG3_APE_EVENT_STATUS 0x4300
2193 2333
@@ -2498,7 +2638,12 @@ struct tg3_hw_stats {
2498 tg3_stat64_t nic_avoided_irqs; 2638 tg3_stat64_t nic_avoided_irqs;
2499 tg3_stat64_t nic_tx_threshold_hit; 2639 tg3_stat64_t nic_tx_threshold_hit;
2500 2640
2501 u8 __reserved4[0xb00-0x9c0]; 2641 /* NOT a part of the hardware statistics block format.
2642 * These stats are here as storage for tg3_periodic_fetch_stats().
2643 */
2644 tg3_stat64_t mbuf_lwm_thresh_hit;
2645
2646 u8 __reserved4[0xb00-0x9c8];
2502}; 2647};
2503 2648
2504/* 'mapping' is superfluous as the chip does not write into 2649/* 'mapping' is superfluous as the chip does not write into
@@ -2510,10 +2655,6 @@ struct ring_info {
2510 DEFINE_DMA_UNMAP_ADDR(mapping); 2655 DEFINE_DMA_UNMAP_ADDR(mapping);
2511}; 2656};
2512 2657
2513struct tg3_config_info {
2514 u32 flags;
2515};
2516
2517struct tg3_link_config { 2658struct tg3_link_config {
2518 /* Describes what we're trying to get. */ 2659 /* Describes what we're trying to get. */
2519 u32 advertising; 2660 u32 advertising;
@@ -2634,6 +2775,8 @@ struct tg3_ethtool_stats {
2634 u64 nic_irqs; 2775 u64 nic_irqs;
2635 u64 nic_avoided_irqs; 2776 u64 nic_avoided_irqs;
2636 u64 nic_tx_threshold_hit; 2777 u64 nic_tx_threshold_hit;
2778
2779 u64 mbuf_lwm_thresh_hit;
2637}; 2780};
2638 2781
2639struct tg3_rx_prodring_set { 2782struct tg3_rx_prodring_set {
@@ -2649,7 +2792,8 @@ struct tg3_rx_prodring_set {
2649 dma_addr_t rx_jmb_mapping; 2792 dma_addr_t rx_jmb_mapping;
2650}; 2793};
2651 2794
2652#define TG3_IRQ_MAX_VECS 5 2795#define TG3_IRQ_MAX_VECS_RSS 5
2796#define TG3_IRQ_MAX_VECS TG3_IRQ_MAX_VECS_RSS
2653 2797
2654struct tg3_napi { 2798struct tg3_napi {
2655 struct napi_struct napi ____cacheline_aligned; 2799 struct napi_struct napi ____cacheline_aligned;
@@ -2660,17 +2804,17 @@ struct tg3_napi {
2660 u32 last_irq_tag; 2804 u32 last_irq_tag;
2661 u32 int_mbox; 2805 u32 int_mbox;
2662 u32 coal_now; 2806 u32 coal_now;
2663 u32 tx_prod;
2664 u32 tx_cons;
2665 u32 tx_pending;
2666 u32 prodmbox;
2667 2807
2668 u32 consmbox; 2808 u32 consmbox ____cacheline_aligned;
2669 u32 rx_rcb_ptr; 2809 u32 rx_rcb_ptr;
2670 u16 *rx_rcb_prod_idx; 2810 u16 *rx_rcb_prod_idx;
2671 struct tg3_rx_prodring_set *prodring; 2811 struct tg3_rx_prodring_set prodring;
2672
2673 struct tg3_rx_buffer_desc *rx_rcb; 2812 struct tg3_rx_buffer_desc *rx_rcb;
2813
2814 u32 tx_prod ____cacheline_aligned;
2815 u32 tx_cons;
2816 u32 tx_pending;
2817 u32 prodmbox;
2674 struct tg3_tx_buffer_desc *tx_ring; 2818 struct tg3_tx_buffer_desc *tx_ring;
2675 struct ring_info *tx_buffers; 2819 struct ring_info *tx_buffers;
2676 2820
@@ -2682,6 +2826,86 @@ struct tg3_napi {
2682 unsigned int irq_vec; 2826 unsigned int irq_vec;
2683}; 2827};
2684 2828
2829enum TG3_FLAGS {
2830 TG3_FLAG_TAGGED_STATUS = 0,
2831 TG3_FLAG_TXD_MBOX_HWBUG,
2832 TG3_FLAG_USE_LINKCHG_REG,
2833 TG3_FLAG_ERROR_PROCESSED,
2834 TG3_FLAG_ENABLE_ASF,
2835 TG3_FLAG_ASPM_WORKAROUND,
2836 TG3_FLAG_POLL_SERDES,
2837 TG3_FLAG_MBOX_WRITE_REORDER,
2838 TG3_FLAG_PCIX_TARGET_HWBUG,
2839 TG3_FLAG_WOL_SPEED_100MB,
2840 TG3_FLAG_WOL_ENABLE,
2841 TG3_FLAG_EEPROM_WRITE_PROT,
2842 TG3_FLAG_NVRAM,
2843 TG3_FLAG_NVRAM_BUFFERED,
2844 TG3_FLAG_SUPPORT_MSI,
2845 TG3_FLAG_SUPPORT_MSIX,
2846 TG3_FLAG_PCIX_MODE,
2847 TG3_FLAG_PCI_HIGH_SPEED,
2848 TG3_FLAG_PCI_32BIT,
2849 TG3_FLAG_SRAM_USE_CONFIG,
2850 TG3_FLAG_TX_RECOVERY_PENDING,
2851 TG3_FLAG_WOL_CAP,
2852 TG3_FLAG_JUMBO_RING_ENABLE,
2853 TG3_FLAG_PAUSE_AUTONEG,
2854 TG3_FLAG_CPMU_PRESENT,
2855 TG3_FLAG_40BIT_DMA_BUG,
2856 TG3_FLAG_BROKEN_CHECKSUMS,
2857 TG3_FLAG_JUMBO_CAPABLE,
2858 TG3_FLAG_CHIP_RESETTING,
2859 TG3_FLAG_INIT_COMPLETE,
2860 TG3_FLAG_RESTART_TIMER,
2861 TG3_FLAG_TSO_BUG,
2862 TG3_FLAG_IS_5788,
2863 TG3_FLAG_MAX_RXPEND_64,
2864 TG3_FLAG_TSO_CAPABLE,
2865 TG3_FLAG_PCI_EXPRESS,
2866 TG3_FLAG_ASF_NEW_HANDSHAKE,
2867 TG3_FLAG_HW_AUTONEG,
2868 TG3_FLAG_IS_NIC,
2869 TG3_FLAG_FLASH,
2870 TG3_FLAG_HW_TSO_1,
2871 TG3_FLAG_5705_PLUS,
2872 TG3_FLAG_5750_PLUS,
2873 TG3_FLAG_HW_TSO_3,
2874 TG3_FLAG_USING_MSI,
2875 TG3_FLAG_USING_MSIX,
2876 TG3_FLAG_ICH_WORKAROUND,
2877 TG3_FLAG_5780_CLASS,
2878 TG3_FLAG_HW_TSO_2,
2879 TG3_FLAG_1SHOT_MSI,
2880 TG3_FLAG_NO_FWARE_REPORTED,
2881 TG3_FLAG_NO_NVRAM_ADDR_TRANS,
2882 TG3_FLAG_ENABLE_APE,
2883 TG3_FLAG_PROTECTED_NVRAM,
2884 TG3_FLAG_5701_DMA_BUG,
2885 TG3_FLAG_USE_PHYLIB,
2886 TG3_FLAG_MDIOBUS_INITED,
2887 TG3_FLAG_LRG_PROD_RING_CAP,
2888 TG3_FLAG_RGMII_INBAND_DISABLE,
2889 TG3_FLAG_RGMII_EXT_IBND_RX_EN,
2890 TG3_FLAG_RGMII_EXT_IBND_TX_EN,
2891 TG3_FLAG_CLKREQ_BUG,
2892 TG3_FLAG_5755_PLUS,
2893 TG3_FLAG_NO_NVRAM,
2894 TG3_FLAG_ENABLE_RSS,
2895 TG3_FLAG_ENABLE_TSS,
2896 TG3_FLAG_4G_DMA_BNDRY_BUG,
2897 TG3_FLAG_40BIT_DMA_LIMIT_BUG,
2898 TG3_FLAG_SHORT_DMA_BUG,
2899 TG3_FLAG_USE_JUMBO_BDFLAG,
2900 TG3_FLAG_L1PLLPD_EN,
2901 TG3_FLAG_57765_PLUS,
2902 TG3_FLAG_APE_HAS_NCSI,
2903 TG3_FLAG_5717_PLUS,
2904
2905 /* Add new flags before this comment and TG3_FLAG_NUMBER_OF_FLAGS */
2906 TG3_FLAG_NUMBER_OF_FLAGS, /* Last entry in enum TG3_FLAGS */
2907};
2908
2685struct tg3 { 2909struct tg3 {
2686 /* begin "general, frequently-used members" cacheline section */ 2910 /* begin "general, frequently-used members" cacheline section */
2687 2911
@@ -2705,7 +2929,7 @@ struct tg3 {
2705 /* SMP locking strategy: 2929 /* SMP locking strategy:
2706 * 2930 *
2707 * lock: Held during reset, PHY access, timer, and when 2931 * lock: Held during reset, PHY access, timer, and when
2708 * updating tg3_flags and tg3_flags2. 2932 * updating tg3_flags.
2709 * 2933 *
2710 * netif_tx_lock: Held during tg3_start_xmit. tg3_tx holds 2934 * netif_tx_lock: Held during tg3_start_xmit. tg3_tx holds
2711 * netif_tx_lock when it needs to call 2935 * netif_tx_lock when it needs to call
@@ -2746,16 +2970,14 @@ struct tg3 {
2746 void (*write32_rx_mbox) (struct tg3 *, u32, 2970 void (*write32_rx_mbox) (struct tg3 *, u32,
2747 u32); 2971 u32);
2748 u32 rx_copy_thresh; 2972 u32 rx_copy_thresh;
2973 u32 rx_std_ring_mask;
2974 u32 rx_jmb_ring_mask;
2975 u32 rx_ret_ring_mask;
2749 u32 rx_pending; 2976 u32 rx_pending;
2750 u32 rx_jumbo_pending; 2977 u32 rx_jumbo_pending;
2751 u32 rx_std_max_post; 2978 u32 rx_std_max_post;
2752 u32 rx_offset; 2979 u32 rx_offset;
2753 u32 rx_pkt_map_sz; 2980 u32 rx_pkt_map_sz;
2754#if TG3_VLAN_TAG_USED
2755 struct vlan_group *vlgrp;
2756#endif
2757
2758 struct tg3_rx_prodring_set prodring[TG3_IRQ_MAX_VECS];
2759 2981
2760 2982
2761 /* begin "everything else" cacheline(s) section */ 2983 /* begin "everything else" cacheline(s) section */
@@ -2764,93 +2986,13 @@ struct tg3 {
2764 struct tg3_ethtool_stats estats; 2986 struct tg3_ethtool_stats estats;
2765 struct tg3_ethtool_stats estats_prev; 2987 struct tg3_ethtool_stats estats_prev;
2766 2988
2989 DECLARE_BITMAP(tg3_flags, TG3_FLAG_NUMBER_OF_FLAGS);
2990
2767 union { 2991 union {
2768 unsigned long phy_crc_errors; 2992 unsigned long phy_crc_errors;
2769 unsigned long last_event_jiffies; 2993 unsigned long last_event_jiffies;
2770 }; 2994 };
2771 2995
2772 u32 tg3_flags;
2773#define TG3_FLAG_TAGGED_STATUS 0x00000001
2774#define TG3_FLAG_TXD_MBOX_HWBUG 0x00000002
2775#define TG3_FLAG_RX_CHECKSUMS 0x00000004
2776#define TG3_FLAG_USE_LINKCHG_REG 0x00000008
2777#define TG3_FLAG_ENABLE_ASF 0x00000020
2778#define TG3_FLAG_ASPM_WORKAROUND 0x00000040
2779#define TG3_FLAG_POLL_SERDES 0x00000080
2780#define TG3_FLAG_MBOX_WRITE_REORDER 0x00000100
2781#define TG3_FLAG_PCIX_TARGET_HWBUG 0x00000200
2782#define TG3_FLAG_WOL_SPEED_100MB 0x00000400
2783#define TG3_FLAG_WOL_ENABLE 0x00000800
2784#define TG3_FLAG_EEPROM_WRITE_PROT 0x00001000
2785#define TG3_FLAG_NVRAM 0x00002000
2786#define TG3_FLAG_NVRAM_BUFFERED 0x00004000
2787#define TG3_FLAG_SUPPORT_MSI 0x00008000
2788#define TG3_FLAG_SUPPORT_MSIX 0x00010000
2789#define TG3_FLAG_SUPPORT_MSI_OR_MSIX (TG3_FLAG_SUPPORT_MSI | \
2790 TG3_FLAG_SUPPORT_MSIX)
2791#define TG3_FLAG_PCIX_MODE 0x00020000
2792#define TG3_FLAG_PCI_HIGH_SPEED 0x00040000
2793#define TG3_FLAG_PCI_32BIT 0x00080000
2794#define TG3_FLAG_SRAM_USE_CONFIG 0x00100000
2795#define TG3_FLAG_TX_RECOVERY_PENDING 0x00200000
2796#define TG3_FLAG_WOL_CAP 0x00400000
2797#define TG3_FLAG_JUMBO_RING_ENABLE 0x00800000
2798#define TG3_FLAG_PAUSE_AUTONEG 0x02000000
2799#define TG3_FLAG_CPMU_PRESENT 0x04000000
2800#define TG3_FLAG_40BIT_DMA_BUG 0x08000000
2801#define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000
2802#define TG3_FLAG_JUMBO_CAPABLE 0x20000000
2803#define TG3_FLAG_CHIP_RESETTING 0x40000000
2804#define TG3_FLAG_INIT_COMPLETE 0x80000000
2805 u32 tg3_flags2;
2806#define TG3_FLG2_RESTART_TIMER 0x00000001
2807#define TG3_FLG2_TSO_BUG 0x00000002
2808#define TG3_FLG2_IS_5788 0x00000008
2809#define TG3_FLG2_MAX_RXPEND_64 0x00000010
2810#define TG3_FLG2_TSO_CAPABLE 0x00000020
2811#define TG3_FLG2_PCI_EXPRESS 0x00000200
2812#define TG3_FLG2_ASF_NEW_HANDSHAKE 0x00000400
2813#define TG3_FLG2_HW_AUTONEG 0x00000800
2814#define TG3_FLG2_IS_NIC 0x00001000
2815#define TG3_FLG2_FLASH 0x00008000
2816#define TG3_FLG2_HW_TSO_1 0x00010000
2817#define TG3_FLG2_5705_PLUS 0x00040000
2818#define TG3_FLG2_5750_PLUS 0x00080000
2819#define TG3_FLG2_HW_TSO_3 0x00100000
2820#define TG3_FLG2_USING_MSI 0x00200000
2821#define TG3_FLG2_USING_MSIX 0x00400000
2822#define TG3_FLG2_USING_MSI_OR_MSIX (TG3_FLG2_USING_MSI | \
2823 TG3_FLG2_USING_MSIX)
2824#define TG3_FLG2_ICH_WORKAROUND 0x02000000
2825#define TG3_FLG2_5780_CLASS 0x04000000
2826#define TG3_FLG2_HW_TSO_2 0x08000000
2827#define TG3_FLG2_HW_TSO (TG3_FLG2_HW_TSO_1 | \
2828 TG3_FLG2_HW_TSO_2 | \
2829 TG3_FLG2_HW_TSO_3)
2830#define TG3_FLG2_1SHOT_MSI 0x10000000
2831#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000
2832 u32 tg3_flags3;
2833#define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001
2834#define TG3_FLG3_ENABLE_APE 0x00000002
2835#define TG3_FLG3_PROTECTED_NVRAM 0x00000004
2836#define TG3_FLG3_5701_DMA_BUG 0x00000008
2837#define TG3_FLG3_USE_PHYLIB 0x00000010
2838#define TG3_FLG3_MDIOBUS_INITED 0x00000020
2839#define TG3_FLG3_RGMII_INBAND_DISABLE 0x00000100
2840#define TG3_FLG3_RGMII_EXT_IBND_RX_EN 0x00000200
2841#define TG3_FLG3_RGMII_EXT_IBND_TX_EN 0x00000400
2842#define TG3_FLG3_CLKREQ_BUG 0x00000800
2843#define TG3_FLG3_5755_PLUS 0x00002000
2844#define TG3_FLG3_NO_NVRAM 0x00004000
2845#define TG3_FLG3_ENABLE_RSS 0x00020000
2846#define TG3_FLG3_ENABLE_TSS 0x00040000
2847#define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
2848#define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
2849#define TG3_FLG3_SHORT_DMA_BUG 0x00200000
2850#define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000
2851#define TG3_FLG3_L1PLLPD_EN 0x00800000
2852#define TG3_FLG3_5717_PLUS 0x01000000
2853
2854 struct timer_list timer; 2996 struct timer_list timer;
2855 u16 timer_counter; 2997 u16 timer_counter;
2856 u16 timer_multiplier; 2998 u16 timer_multiplier;
@@ -2891,6 +3033,7 @@ struct tg3 {
2891 int pcix_cap; 3033 int pcix_cap;
2892 int pcie_cap; 3034 int pcie_cap;
2893 }; 3035 };
3036 int pcie_readrq;
2894 3037
2895 struct mii_bus *mdio_bus; 3038 struct mii_bus *mdio_bus;
2896 int mdio_irq[PHY_MAX_ADDR]; 3039 int mdio_irq[PHY_MAX_ADDR];
@@ -2920,6 +3063,7 @@ struct tg3 {
2920#define TG3_PHY_ID_BCM5718S 0xbc050ff0 3063#define TG3_PHY_ID_BCM5718S 0xbc050ff0
2921#define TG3_PHY_ID_BCM57765 0x5c0d8a40 3064#define TG3_PHY_ID_BCM57765 0x5c0d8a40
2922#define TG3_PHY_ID_BCM5719C 0x5c0d8a20 3065#define TG3_PHY_ID_BCM5719C 0x5c0d8a20
3066#define TG3_PHY_ID_BCM5720C 0x5c0d8b60
2923#define TG3_PHY_ID_BCM5906 0xdc00ac40 3067#define TG3_PHY_ID_BCM5906 0xdc00ac40
2924#define TG3_PHY_ID_BCM8002 0x60010140 3068#define TG3_PHY_ID_BCM8002 0x60010140
2925#define TG3_PHY_ID_INVALID 0xffffffff 3069#define TG3_PHY_ID_INVALID 0xffffffff
@@ -2966,9 +3110,11 @@ struct tg3 {
2966#define TG3_PHYFLG_BER_BUG 0x00008000 3110#define TG3_PHYFLG_BER_BUG 0x00008000
2967#define TG3_PHYFLG_SERDES_PREEMPHASIS 0x00010000 3111#define TG3_PHYFLG_SERDES_PREEMPHASIS 0x00010000
2968#define TG3_PHYFLG_PARALLEL_DETECT 0x00020000 3112#define TG3_PHYFLG_PARALLEL_DETECT 0x00020000
3113#define TG3_PHYFLG_EEE_CAP 0x00040000
2969 3114
2970 u32 led_ctrl; 3115 u32 led_ctrl;
2971 u32 phy_otp; 3116 u32 phy_otp;
3117 u32 setlpicnt;
2972 3118
2973#define TG3_BPN_SIZE 24 3119#define TG3_BPN_SIZE 24
2974 char board_part_number[TG3_BPN_SIZE]; 3120 char board_part_number[TG3_BPN_SIZE];
@@ -2984,6 +3130,7 @@ struct tg3 {
2984 3130
2985 int nvram_lock_cnt; 3131 int nvram_lock_cnt;
2986 u32 nvram_size; 3132 u32 nvram_size;
3133#define TG3_NVRAM_SIZE_2KB 0x00000800
2987#define TG3_NVRAM_SIZE_64KB 0x00010000 3134#define TG3_NVRAM_SIZE_64KB 0x00010000
2988#define TG3_NVRAM_SIZE_128KB 0x00020000 3135#define TG3_NVRAM_SIZE_128KB 0x00020000
2989#define TG3_NVRAM_SIZE_256KB 0x00040000 3136#define TG3_NVRAM_SIZE_256KB 0x00040000
@@ -2999,6 +3146,9 @@ struct tg3 {
2999#define JEDEC_SAIFUN 0x4f 3146#define JEDEC_SAIFUN 0x4f
3000#define JEDEC_SST 0xbf 3147#define JEDEC_SST 0xbf
3001 3148
3149#define ATMEL_AT24C02_CHIP_SIZE TG3_NVRAM_SIZE_2KB
3150#define ATMEL_AT24C02_PAGE_SIZE (8)
3151
3002#define ATMEL_AT24C64_CHIP_SIZE TG3_NVRAM_SIZE_64KB 3152#define ATMEL_AT24C64_CHIP_SIZE TG3_NVRAM_SIZE_64KB
3003#define ATMEL_AT24C64_PAGE_SIZE (32) 3153#define ATMEL_AT24C64_PAGE_SIZE (32)
3004 3154