aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tg3.h')
-rw-r--r--drivers/net/tg3.h281
1 files changed, 183 insertions, 98 deletions
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 5e96706ad108..5b3d2f34da7a 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -23,11 +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_STD_MAX_SIZE_5717 2048 29#define TG3_RX_JMB_MAX_SIZE_5717 1024
30#define RX_JUMBO_MAX_SIZE 0xdeadbeef /* XXX */ 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
31 33
32/* First 256 bytes are a mirror of PCI config space. */ 34/* First 256 bytes are a mirror of PCI config space. */
33#define TG3PCI_VENDOR 0x00000000 35#define TG3PCI_VENDOR 0x00000000
@@ -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
@@ -142,6 +145,7 @@
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
144#define CHIPREV_ID_5719_A0 0x05719000 147#define CHIPREV_ID_5719_A0 0x05719000
148#define CHIPREV_ID_5720_A0 0x05720000
145#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12) 149#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
146#define ASIC_REV_5700 0x07 150#define ASIC_REV_5700 0x07
147#define ASIC_REV_5701 0x00 151#define ASIC_REV_5701 0x00
@@ -163,6 +167,7 @@
163#define ASIC_REV_5717 0x5717 167#define ASIC_REV_5717 0x5717
164#define ASIC_REV_57765 0x57785 168#define ASIC_REV_57765 0x57785
165#define ASIC_REV_5719 0x5719 169#define ASIC_REV_5719 0x5719
170#define ASIC_REV_5720 0x5720
166#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) 171#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
167#define CHIPREV_5700_AX 0x70 172#define CHIPREV_5700_AX 0x70
168#define CHIPREV_5700_BX 0x71 173#define CHIPREV_5700_BX 0x71
@@ -175,6 +180,7 @@
175#define CHIPREV_5750_BX 0x41 180#define CHIPREV_5750_BX 0x41
176#define CHIPREV_5784_AX 0x57840 181#define CHIPREV_5784_AX 0x57840
177#define CHIPREV_5761_AX 0x57610 182#define CHIPREV_5761_AX 0x57610
183#define CHIPREV_57765_AX 0x577650
178#define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff) 184#define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff)
179#define METAL_REV_A0 0x00 185#define METAL_REV_A0 0x00
180#define METAL_REV_A1 0x01 186#define METAL_REV_A1 0x01
@@ -183,6 +189,7 @@
183#define METAL_REV_B2 0x02 189#define METAL_REV_B2 0x02
184#define TG3PCI_DMA_RW_CTRL 0x0000006c 190#define TG3PCI_DMA_RW_CTRL 0x0000006c
185#define DMA_RWCTRL_DIS_CACHE_ALIGNMENT 0x00000001 191#define DMA_RWCTRL_DIS_CACHE_ALIGNMENT 0x00000001
192#define DMA_RWCTRL_TAGGED_STAT_WA 0x00000080
186#define DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK 0x00000380 193#define DMA_RWCTRL_CRDRDR_RDMA_MRRS_MSK 0x00000380
187#define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700 194#define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700
188#define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000 195#define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000
@@ -473,6 +480,8 @@
473#define TX_MODE_BIG_BCKOFF_ENABLE 0x00000020 480#define TX_MODE_BIG_BCKOFF_ENABLE 0x00000020
474#define TX_MODE_LONG_PAUSE_ENABLE 0x00000040 481#define TX_MODE_LONG_PAUSE_ENABLE 0x00000040
475#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
476#define MAC_TX_STATUS 0x00000460 485#define MAC_TX_STATUS 0x00000460
477#define TX_STATUS_XOFFED 0x00000001 486#define TX_STATUS_XOFFED 0x00000001
478#define TX_STATUS_SENT_XOFF 0x00000002 487#define TX_STATUS_SENT_XOFF 0x00000002
@@ -487,6 +496,8 @@
487#define TX_LENGTHS_IPG_SHIFT 8 496#define TX_LENGTHS_IPG_SHIFT 8
488#define TX_LENGTHS_IPG_CRS_MASK 0x00003000 497#define TX_LENGTHS_IPG_CRS_MASK 0x00003000
489#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
490#define MAC_RX_MODE 0x00000468 501#define MAC_RX_MODE 0x00000468
491#define RX_MODE_RESET 0x00000001 502#define RX_MODE_RESET 0x00000001
492#define RX_MODE_ENABLE 0x00000002 503#define RX_MODE_ENABLE 0x00000002
@@ -1079,6 +1090,9 @@
1079#define CPMU_HST_ACC_MACCLK_6_25 0x00130000 1090#define CPMU_HST_ACC_MACCLK_6_25 0x00130000
1080/* 0x3620 --> 0x3630 unused */ 1091/* 0x3620 --> 0x3630 unused */
1081 1092
1093#define TG3_CPMU_CLCK_ORIDE 0x00003624
1094#define CPMU_CLCK_ORIDE_MAC_ORIDE_EN 0x80000000
1095
1082#define TG3_CPMU_CLCK_STAT 0x00003630 1096#define TG3_CPMU_CLCK_STAT 0x00003630
1083#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000 1097#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000
1084#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000 1098#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000
@@ -1188,6 +1202,7 @@
1188#define HOSTCC_STATS_BLK_NIC_ADDR 0x00003c40 1202#define HOSTCC_STATS_BLK_NIC_ADDR 0x00003c40
1189#define HOSTCC_STATUS_BLK_NIC_ADDR 0x00003c44 1203#define HOSTCC_STATUS_BLK_NIC_ADDR 0x00003c44
1190#define HOSTCC_FLOW_ATTN 0x00003c48 1204#define HOSTCC_FLOW_ATTN 0x00003c48
1205#define HOSTCC_FLOW_ATTN_MBUF_LWM 0x00000040
1191/* 0x3c4c --> 0x3c50 unused */ 1206/* 0x3c4c --> 0x3c50 unused */
1192#define HOSTCC_JUMBO_CON_IDX 0x00003c50 1207#define HOSTCC_JUMBO_CON_IDX 0x00003c50
1193#define HOSTCC_STD_CON_IDX 0x00003c54 1208#define HOSTCC_STD_CON_IDX 0x00003c54
@@ -1321,6 +1336,7 @@
1321#define RDMAC_MODE_MULT_DMA_RD_DIS 0x01000000 1336#define RDMAC_MODE_MULT_DMA_RD_DIS 0x01000000
1322#define RDMAC_MODE_IPV4_LSO_EN 0x08000000 1337#define RDMAC_MODE_IPV4_LSO_EN 0x08000000
1323#define RDMAC_MODE_IPV6_LSO_EN 0x10000000 1338#define RDMAC_MODE_IPV6_LSO_EN 0x10000000
1339#define RDMAC_MODE_H2BNC_VLAN_DET 0x20000000
1324#define RDMAC_STATUS 0x00004804 1340#define RDMAC_STATUS 0x00004804
1325#define RDMAC_STATUS_TGTABORT 0x00000004 1341#define RDMAC_STATUS_TGTABORT 0x00000004
1326#define RDMAC_STATUS_MSTABORT 0x00000008 1342#define RDMAC_STATUS_MSTABORT 0x00000008
@@ -1597,6 +1613,7 @@
1597#define MSGINT_MODE_ONE_SHOT_DISABLE 0x00000020 1613#define MSGINT_MODE_ONE_SHOT_DISABLE 0x00000020
1598#define MSGINT_MODE_MULTIVEC_EN 0x00000080 1614#define MSGINT_MODE_MULTIVEC_EN 0x00000080
1599#define MSGINT_STATUS 0x00006004 1615#define MSGINT_STATUS 0x00006004
1616#define MSGINT_STATUS_MSI_REQ 0x00000001
1600#define MSGINT_FIFO 0x00006008 1617#define MSGINT_FIFO 0x00006008
1601/* 0x600c --> 0x6400 unused */ 1618/* 0x600c --> 0x6400 unused */
1602 1619
@@ -1613,6 +1630,8 @@
1613#define GRC_MODE_WSWAP_NONFRM_DATA 0x00000004 1630#define GRC_MODE_WSWAP_NONFRM_DATA 0x00000004
1614#define GRC_MODE_BSWAP_DATA 0x00000010 1631#define GRC_MODE_BSWAP_DATA 0x00000010
1615#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
1616#define GRC_MODE_SPLITHDR 0x00000100 1635#define GRC_MODE_SPLITHDR 0x00000100
1617#define GRC_MODE_NOFRM_CRACKING 0x00000200 1636#define GRC_MODE_NOFRM_CRACKING 0x00000200
1618#define GRC_MODE_INCL_CRC 0x00000400 1637#define GRC_MODE_INCL_CRC 0x00000400
@@ -1620,8 +1639,10 @@
1620#define GRC_MODE_NOIRQ_ON_SENDS 0x00002000 1639#define GRC_MODE_NOIRQ_ON_SENDS 0x00002000
1621#define GRC_MODE_NOIRQ_ON_RCV 0x00004000 1640#define GRC_MODE_NOIRQ_ON_RCV 0x00004000
1622#define GRC_MODE_FORCE_PCI32BIT 0x00008000 1641#define GRC_MODE_FORCE_PCI32BIT 0x00008000
1642#define GRC_MODE_B2HRX_ENABLE 0x00008000
1623#define GRC_MODE_HOST_STACKUP 0x00010000 1643#define GRC_MODE_HOST_STACKUP 0x00010000
1624#define GRC_MODE_HOST_SENDBDS 0x00020000 1644#define GRC_MODE_HOST_SENDBDS 0x00020000
1645#define GRC_MODE_HTX2B_ENABLE 0x00040000
1625#define GRC_MODE_NO_TX_PHDR_CSUM 0x00100000 1646#define GRC_MODE_NO_TX_PHDR_CSUM 0x00100000
1626#define GRC_MODE_NVRAM_WR_ENABLE 0x00200000 1647#define GRC_MODE_NVRAM_WR_ENABLE 0x00200000
1627#define GRC_MODE_PCIE_TL_SEL 0x00000000 1648#define GRC_MODE_PCIE_TL_SEL 0x00000000
@@ -1818,6 +1839,38 @@
1818#define FLASH_5717VENDOR_ATMEL_45USPT 0x03400000 1839#define FLASH_5717VENDOR_ATMEL_45USPT 0x03400000
1819#define FLASH_5717VENDOR_ST_25USPT 0x03400002 1840#define FLASH_5717VENDOR_ST_25USPT 0x03400002
1820#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
1821#define NVRAM_CFG1_5752PAGE_SIZE_MASK 0x70000000 1874#define NVRAM_CFG1_5752PAGE_SIZE_MASK 0x70000000
1822#define FLASH_5752PAGE_SIZE_256 0x00000000 1875#define FLASH_5752PAGE_SIZE_256 0x00000000
1823#define FLASH_5752PAGE_SIZE_512 0x10000000 1876#define FLASH_5752PAGE_SIZE_512 0x10000000
@@ -1899,11 +1952,16 @@
1899 1952
1900/* Alternate PCIE definitions */ 1953/* Alternate PCIE definitions */
1901#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
1902#define TG3_PCIE_PL_LO_PHYCTL1 0x00000004 1958#define TG3_PCIE_PL_LO_PHYCTL1 0x00000004
1903#define TG3_PCIE_PL_LO_PHYCTL1_L1PLLPD_EN 0x00001000 1959#define TG3_PCIE_PL_LO_PHYCTL1_L1PLLPD_EN 0x00001000
1904#define TG3_PCIE_PL_LO_PHYCTL5 0x00000014 1960#define TG3_PCIE_PL_LO_PHYCTL5 0x00000014
1905#define TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ 0x80000000 1961#define TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ 0x80000000
1906 1962
1963#define TG3_REG_BLK_SIZE 0x00008000
1964
1907/* OTP bit definitions */ 1965/* OTP bit definitions */
1908#define TG3_OTP_AGCTGT_MASK 0x000000e0 1966#define TG3_OTP_AGCTGT_MASK 0x000000e0
1909#define TG3_OTP_AGCTGT_SHIFT 1 1967#define TG3_OTP_AGCTGT_SHIFT 1
@@ -1955,7 +2013,9 @@
1955#define TG3_NVM_DIR_END 0x78 2013#define TG3_NVM_DIR_END 0x78
1956#define TG3_NVM_DIRENT_SIZE 0xc 2014#define TG3_NVM_DIRENT_SIZE 0xc
1957#define TG3_NVM_DIRTYPE_SHIFT 24 2015#define TG3_NVM_DIRTYPE_SHIFT 24
2016#define TG3_NVM_DIRTYPE_LENMSK 0x003fffff
1958#define TG3_NVM_DIRTYPE_ASFINI 1 2017#define TG3_NVM_DIRTYPE_ASFINI 1
2018#define TG3_NVM_DIRTYPE_EXTVPD 20
1959#define TG3_NVM_PTREV_BCVER 0x94 2019#define TG3_NVM_PTREV_BCVER 0x94
1960#define TG3_NVM_BCVER_MAJMSK 0x0000ff00 2020#define TG3_NVM_BCVER_MAJMSK 0x0000ff00
1961#define TG3_NVM_BCVER_MAJSFT 8 2021#define TG3_NVM_BCVER_MAJSFT 8
@@ -2079,6 +2139,13 @@
2079#define NIC_SRAM_MBUF_POOL_BASE5705 0x00010000 2139#define NIC_SRAM_MBUF_POOL_BASE5705 0x00010000
2080#define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000 2140#define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000
2081 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
2082 2149
2083/* Currently this is fixed. */ 2150/* Currently this is fixed. */
2084#define TG3_PHY_MII_ADDR 0x01 2151#define TG3_PHY_MII_ADDR 0x01
@@ -2119,7 +2186,7 @@
2119#define MII_TG3_DSP_TAP26_OPCSINPT 0x0004 2186#define MII_TG3_DSP_TAP26_OPCSINPT 0x0004
2120#define MII_TG3_DSP_AADJ1CH0 0x001f 2187#define MII_TG3_DSP_AADJ1CH0 0x001f
2121#define MII_TG3_DSP_CH34TP2 0x4022 2188#define MII_TG3_DSP_CH34TP2 0x4022
2122#define MII_TG3_DSP_CH34TP2_HIBW01 0x0010 2189#define MII_TG3_DSP_CH34TP2_HIBW01 0x017b
2123#define MII_TG3_DSP_AADJ1CH3 0x601f 2190#define MII_TG3_DSP_AADJ1CH3 0x601f
2124#define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002 2191#define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002
2125#define MII_TG3_DSP_EXP1_INT_STAT 0x0f01 2192#define MII_TG3_DSP_EXP1_INT_STAT 0x0f01
@@ -2132,19 +2199,26 @@
2132 2199
2133#define MII_TG3_AUX_CTRL 0x18 /* auxiliary control register */ 2200#define MII_TG3_AUX_CTRL 0x18 /* auxiliary control register */
2134 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
2135#define MII_TG3_AUXCTL_PCTL_100TX_LPWR 0x0010 2209#define MII_TG3_AUXCTL_PCTL_100TX_LPWR 0x0010
2136#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
2137#define MII_TG3_AUXCTL_PCTL_VREG_11V 0x0180 2212#define MII_TG3_AUXCTL_PCTL_VREG_11V 0x0180
2138#define MII_TG3_AUXCTL_SHDWSEL_PWRCTL 0x0002
2139 2213
2140#define MII_TG3_AUXCTL_MISC_WREN 0x8000 2214#define MII_TG3_AUXCTL_SHDWSEL_MISCTEST 0x0004
2141#define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200 2215
2142#define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000
2143#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
2144 2221
2145#define MII_TG3_AUXCTL_ACTL_SMDSP_ENA 0x0800
2146#define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400
2147#define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000
2148 2222
2149#define MII_TG3_AUX_STAT 0x19 /* auxiliary status register */ 2223#define MII_TG3_AUX_STAT 0x19 /* auxiliary status register */
2150#define MII_TG3_AUX_STAT_LPASS 0x0004 2224#define MII_TG3_AUX_STAT_LPASS 0x0004
@@ -2564,7 +2638,12 @@ struct tg3_hw_stats {
2564 tg3_stat64_t nic_avoided_irqs; 2638 tg3_stat64_t nic_avoided_irqs;
2565 tg3_stat64_t nic_tx_threshold_hit; 2639 tg3_stat64_t nic_tx_threshold_hit;
2566 2640
2567 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];
2568}; 2647};
2569 2648
2570/* 'mapping' is superfluous as the chip does not write into 2649/* 'mapping' is superfluous as the chip does not write into
@@ -2696,6 +2775,8 @@ struct tg3_ethtool_stats {
2696 u64 nic_irqs; 2775 u64 nic_irqs;
2697 u64 nic_avoided_irqs; 2776 u64 nic_avoided_irqs;
2698 u64 nic_tx_threshold_hit; 2777 u64 nic_tx_threshold_hit;
2778
2779 u64 mbuf_lwm_thresh_hit;
2699}; 2780};
2700 2781
2701struct tg3_rx_prodring_set { 2782struct tg3_rx_prodring_set {
@@ -2745,6 +2826,86 @@ struct tg3_napi {
2745 unsigned int irq_vec; 2826 unsigned int irq_vec;
2746}; 2827};
2747 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
2748struct tg3 { 2909struct tg3 {
2749 /* begin "general, frequently-used members" cacheline section */ 2910 /* begin "general, frequently-used members" cacheline section */
2750 2911
@@ -2768,7 +2929,7 @@ struct tg3 {
2768 /* SMP locking strategy: 2929 /* SMP locking strategy:
2769 * 2930 *
2770 * lock: Held during reset, PHY access, timer, and when 2931 * lock: Held during reset, PHY access, timer, and when
2771 * updating tg3_flags and tg3_flags2. 2932 * updating tg3_flags.
2772 * 2933 *
2773 * netif_tx_lock: Held during tg3_start_xmit. tg3_tx holds 2934 * netif_tx_lock: Held during tg3_start_xmit. tg3_tx holds
2774 * netif_tx_lock when it needs to call 2935 * netif_tx_lock when it needs to call
@@ -2825,94 +2986,13 @@ struct tg3 {
2825 struct tg3_ethtool_stats estats; 2986 struct tg3_ethtool_stats estats;
2826 struct tg3_ethtool_stats estats_prev; 2987 struct tg3_ethtool_stats estats_prev;
2827 2988
2989 DECLARE_BITMAP(tg3_flags, TG3_FLAG_NUMBER_OF_FLAGS);
2990
2828 union { 2991 union {
2829 unsigned long phy_crc_errors; 2992 unsigned long phy_crc_errors;
2830 unsigned long last_event_jiffies; 2993 unsigned long last_event_jiffies;
2831 }; 2994 };
2832 2995
2833 u32 tg3_flags;
2834#define TG3_FLAG_TAGGED_STATUS 0x00000001
2835#define TG3_FLAG_TXD_MBOX_HWBUG 0x00000002
2836#define TG3_FLAG_RX_CHECKSUMS 0x00000004
2837#define TG3_FLAG_USE_LINKCHG_REG 0x00000008
2838#define TG3_FLAG_ENABLE_ASF 0x00000020
2839#define TG3_FLAG_ASPM_WORKAROUND 0x00000040
2840#define TG3_FLAG_POLL_SERDES 0x00000080
2841#define TG3_FLAG_MBOX_WRITE_REORDER 0x00000100
2842#define TG3_FLAG_PCIX_TARGET_HWBUG 0x00000200
2843#define TG3_FLAG_WOL_SPEED_100MB 0x00000400
2844#define TG3_FLAG_WOL_ENABLE 0x00000800
2845#define TG3_FLAG_EEPROM_WRITE_PROT 0x00001000
2846#define TG3_FLAG_NVRAM 0x00002000
2847#define TG3_FLAG_NVRAM_BUFFERED 0x00004000
2848#define TG3_FLAG_SUPPORT_MSI 0x00008000
2849#define TG3_FLAG_SUPPORT_MSIX 0x00010000
2850#define TG3_FLAG_SUPPORT_MSI_OR_MSIX (TG3_FLAG_SUPPORT_MSI | \
2851 TG3_FLAG_SUPPORT_MSIX)
2852#define TG3_FLAG_PCIX_MODE 0x00020000
2853#define TG3_FLAG_PCI_HIGH_SPEED 0x00040000
2854#define TG3_FLAG_PCI_32BIT 0x00080000
2855#define TG3_FLAG_SRAM_USE_CONFIG 0x00100000
2856#define TG3_FLAG_TX_RECOVERY_PENDING 0x00200000
2857#define TG3_FLAG_WOL_CAP 0x00400000
2858#define TG3_FLAG_JUMBO_RING_ENABLE 0x00800000
2859#define TG3_FLAG_PAUSE_AUTONEG 0x02000000
2860#define TG3_FLAG_CPMU_PRESENT 0x04000000
2861#define TG3_FLAG_40BIT_DMA_BUG 0x08000000
2862#define TG3_FLAG_BROKEN_CHECKSUMS 0x10000000
2863#define TG3_FLAG_JUMBO_CAPABLE 0x20000000
2864#define TG3_FLAG_CHIP_RESETTING 0x40000000
2865#define TG3_FLAG_INIT_COMPLETE 0x80000000
2866 u32 tg3_flags2;
2867#define TG3_FLG2_RESTART_TIMER 0x00000001
2868#define TG3_FLG2_TSO_BUG 0x00000002
2869#define TG3_FLG2_IS_5788 0x00000008
2870#define TG3_FLG2_MAX_RXPEND_64 0x00000010
2871#define TG3_FLG2_TSO_CAPABLE 0x00000020
2872#define TG3_FLG2_PCI_EXPRESS 0x00000200
2873#define TG3_FLG2_ASF_NEW_HANDSHAKE 0x00000400
2874#define TG3_FLG2_HW_AUTONEG 0x00000800
2875#define TG3_FLG2_IS_NIC 0x00001000
2876#define TG3_FLG2_FLASH 0x00008000
2877#define TG3_FLG2_HW_TSO_1 0x00010000
2878#define TG3_FLG2_5705_PLUS 0x00040000
2879#define TG3_FLG2_5750_PLUS 0x00080000
2880#define TG3_FLG2_HW_TSO_3 0x00100000
2881#define TG3_FLG2_USING_MSI 0x00200000
2882#define TG3_FLG2_USING_MSIX 0x00400000
2883#define TG3_FLG2_USING_MSI_OR_MSIX (TG3_FLG2_USING_MSI | \
2884 TG3_FLG2_USING_MSIX)
2885#define TG3_FLG2_ICH_WORKAROUND 0x02000000
2886#define TG3_FLG2_5780_CLASS 0x04000000
2887#define TG3_FLG2_HW_TSO_2 0x08000000
2888#define TG3_FLG2_HW_TSO (TG3_FLG2_HW_TSO_1 | \
2889 TG3_FLG2_HW_TSO_2 | \
2890 TG3_FLG2_HW_TSO_3)
2891#define TG3_FLG2_1SHOT_MSI 0x10000000
2892#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000
2893 u32 tg3_flags3;
2894#define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001
2895#define TG3_FLG3_ENABLE_APE 0x00000002
2896#define TG3_FLG3_PROTECTED_NVRAM 0x00000004
2897#define TG3_FLG3_5701_DMA_BUG 0x00000008
2898#define TG3_FLG3_USE_PHYLIB 0x00000010
2899#define TG3_FLG3_MDIOBUS_INITED 0x00000020
2900#define TG3_FLG3_RGMII_INBAND_DISABLE 0x00000100
2901#define TG3_FLG3_RGMII_EXT_IBND_RX_EN 0x00000200
2902#define TG3_FLG3_RGMII_EXT_IBND_TX_EN 0x00000400
2903#define TG3_FLG3_CLKREQ_BUG 0x00000800
2904#define TG3_FLG3_5755_PLUS 0x00002000
2905#define TG3_FLG3_NO_NVRAM 0x00004000
2906#define TG3_FLG3_ENABLE_RSS 0x00020000
2907#define TG3_FLG3_ENABLE_TSS 0x00040000
2908#define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
2909#define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
2910#define TG3_FLG3_SHORT_DMA_BUG 0x00200000
2911#define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000
2912#define TG3_FLG3_L1PLLPD_EN 0x00800000
2913#define TG3_FLG3_5717_PLUS 0x01000000
2914#define TG3_FLG3_APE_HAS_NCSI 0x02000000
2915
2916 struct timer_list timer; 2996 struct timer_list timer;
2917 u16 timer_counter; 2997 u16 timer_counter;
2918 u16 timer_multiplier; 2998 u16 timer_multiplier;
@@ -2983,6 +3063,7 @@ struct tg3 {
2983#define TG3_PHY_ID_BCM5718S 0xbc050ff0 3063#define TG3_PHY_ID_BCM5718S 0xbc050ff0
2984#define TG3_PHY_ID_BCM57765 0x5c0d8a40 3064#define TG3_PHY_ID_BCM57765 0x5c0d8a40
2985#define TG3_PHY_ID_BCM5719C 0x5c0d8a20 3065#define TG3_PHY_ID_BCM5719C 0x5c0d8a20
3066#define TG3_PHY_ID_BCM5720C 0x5c0d8b60
2986#define TG3_PHY_ID_BCM5906 0xdc00ac40 3067#define TG3_PHY_ID_BCM5906 0xdc00ac40
2987#define TG3_PHY_ID_BCM8002 0x60010140 3068#define TG3_PHY_ID_BCM8002 0x60010140
2988#define TG3_PHY_ID_INVALID 0xffffffff 3069#define TG3_PHY_ID_INVALID 0xffffffff
@@ -3049,6 +3130,7 @@ struct tg3 {
3049 3130
3050 int nvram_lock_cnt; 3131 int nvram_lock_cnt;
3051 u32 nvram_size; 3132 u32 nvram_size;
3133#define TG3_NVRAM_SIZE_2KB 0x00000800
3052#define TG3_NVRAM_SIZE_64KB 0x00010000 3134#define TG3_NVRAM_SIZE_64KB 0x00010000
3053#define TG3_NVRAM_SIZE_128KB 0x00020000 3135#define TG3_NVRAM_SIZE_128KB 0x00020000
3054#define TG3_NVRAM_SIZE_256KB 0x00040000 3136#define TG3_NVRAM_SIZE_256KB 0x00040000
@@ -3064,6 +3146,9 @@ struct tg3 {
3064#define JEDEC_SAIFUN 0x4f 3146#define JEDEC_SAIFUN 0x4f
3065#define JEDEC_SST 0xbf 3147#define JEDEC_SST 0xbf
3066 3148
3149#define ATMEL_AT24C02_CHIP_SIZE TG3_NVRAM_SIZE_2KB
3150#define ATMEL_AT24C02_PAGE_SIZE (8)
3151
3067#define ATMEL_AT24C64_CHIP_SIZE TG3_NVRAM_SIZE_64KB 3152#define ATMEL_AT24C64_CHIP_SIZE TG3_NVRAM_SIZE_64KB
3068#define ATMEL_AT24C64_PAGE_SIZE (32) 3153#define ATMEL_AT24C64_PAGE_SIZE (32)
3069 3154