aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-12-09 01:14:38 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-12-09 01:14:38 -0500
commitbcd6acd51f3d4d1ada201e9bc5c40a31d6d80c71 (patch)
tree2f6dffd2d3e4dd67355a224de7e7a960335a92fd /drivers/net/tg3.h
parent11c34c7deaeeebcee342cbc35e1bb2a6711b2431 (diff)
parent3ff6a468b45b5dfeb0e903e56f4eb27d34b2437c (diff)
Merge commit 'origin/master' into next
Conflicts: include/linux/kvm.h
Diffstat (limited to 'drivers/net/tg3.h')
-rw-r--r--drivers/net/tg3.h99
1 files changed, 76 insertions, 23 deletions
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index bab7940158e..cd30889650f 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -46,10 +46,15 @@
46#define TG3PCI_DEVICE_TIGON3_57788 0x1691 46#define TG3PCI_DEVICE_TIGON3_57788 0x1691
47#define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */ 47#define TG3PCI_DEVICE_TIGON3_5785_G 0x1699 /* GPHY */
48#define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */ 48#define TG3PCI_DEVICE_TIGON3_5785_F 0x16a0 /* 10/100 only */
49#define TG3PCI_DEVICE_TIGON3_5717C 0x1655 49#define TG3PCI_DEVICE_TIGON3_5717 0x1655
50#define TG3PCI_DEVICE_TIGON3_5717S 0x1656 50#define TG3PCI_DEVICE_TIGON3_5718 0x1656
51#define TG3PCI_DEVICE_TIGON3_5718C 0x1665 51#define TG3PCI_DEVICE_TIGON3_5724 0x165c
52#define TG3PCI_DEVICE_TIGON3_5718S 0x1666 52#define TG3PCI_DEVICE_TIGON3_57781 0x16b1
53#define TG3PCI_DEVICE_TIGON3_57785 0x16b5
54#define TG3PCI_DEVICE_TIGON3_57761 0x16b0
55#define TG3PCI_DEVICE_TIGON3_57765 0x16b4
56#define TG3PCI_DEVICE_TIGON3_57791 0x16b2
57#define TG3PCI_DEVICE_TIGON3_57795 0x16b6
53/* 0x04 --> 0x64 unused */ 58/* 0x04 --> 0x64 unused */
54#define TG3PCI_MSI_DATA 0x00000064 59#define TG3PCI_MSI_DATA 0x00000064
55/* 0x66 --> 0x68 unused */ 60/* 0x66 --> 0x68 unused */
@@ -103,6 +108,7 @@
103#define CHIPREV_ID_5906_A1 0xc001 108#define CHIPREV_ID_5906_A1 0xc001
104#define CHIPREV_ID_57780_A0 0x57780000 109#define CHIPREV_ID_57780_A0 0x57780000
105#define CHIPREV_ID_57780_A1 0x57780001 110#define CHIPREV_ID_57780_A1 0x57780001
111#define CHIPREV_ID_5717_A0 0x05717000
106#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12) 112#define GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 12)
107#define ASIC_REV_5700 0x07 113#define ASIC_REV_5700 0x07
108#define ASIC_REV_5701 0x00 114#define ASIC_REV_5701 0x00
@@ -122,6 +128,7 @@
122#define ASIC_REV_5785 0x5785 128#define ASIC_REV_5785 0x5785
123#define ASIC_REV_57780 0x57780 129#define ASIC_REV_57780 0x57780
124#define ASIC_REV_5717 0x5717 130#define ASIC_REV_5717 0x5717
131#define ASIC_REV_57765 0x57785
125#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8) 132#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
126#define CHIPREV_5700_AX 0x70 133#define CHIPREV_5700_AX 0x70
127#define CHIPREV_5700_BX 0x71 134#define CHIPREV_5700_BX 0x71
@@ -141,8 +148,7 @@
141#define METAL_REV_B1 0x01 148#define METAL_REV_B1 0x01
142#define METAL_REV_B2 0x02 149#define METAL_REV_B2 0x02
143#define TG3PCI_DMA_RW_CTRL 0x0000006c 150#define TG3PCI_DMA_RW_CTRL 0x0000006c
144#define DMA_RWCTRL_MIN_DMA 0x000000ff 151#define DMA_RWCTRL_DIS_CACHE_ALIGNMENT 0x00000001
145#define DMA_RWCTRL_MIN_DMA_SHIFT 0
146#define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700 152#define DMA_RWCTRL_READ_BNDRY_MASK 0x00000700
147#define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000 153#define DMA_RWCTRL_READ_BNDRY_DISAB 0x00000000
148#define DMA_RWCTRL_READ_BNDRY_16 0x00000100 154#define DMA_RWCTRL_READ_BNDRY_16 0x00000100
@@ -221,6 +227,7 @@
221/* 0xc0 --> 0xf4 unused */ 227/* 0xc0 --> 0xf4 unused */
222 228
223#define TG3PCI_GEN2_PRODID_ASICREV 0x000000f4 229#define TG3PCI_GEN2_PRODID_ASICREV 0x000000f4
230#define TG3PCI_GEN15_PRODID_ASICREV 0x000000fc
224/* 0xf8 --> 0x200 unused */ 231/* 0xf8 --> 0x200 unused */
225 232
226#define TG3_CORR_ERR_STAT 0x00000110 233#define TG3_CORR_ERR_STAT 0x00000110
@@ -242,7 +249,11 @@
242#define MAILBOX_GENERAL_7 0x00000258 /* 64-bit */ 249#define MAILBOX_GENERAL_7 0x00000258 /* 64-bit */
243#define MAILBOX_RELOAD_STAT 0x00000260 /* 64-bit */ 250#define MAILBOX_RELOAD_STAT 0x00000260 /* 64-bit */
244#define MAILBOX_RCV_STD_PROD_IDX 0x00000268 /* 64-bit */ 251#define MAILBOX_RCV_STD_PROD_IDX 0x00000268 /* 64-bit */
252#define TG3_RX_STD_PROD_IDX_REG (MAILBOX_RCV_STD_PROD_IDX + \
253 TG3_64BIT_REG_LOW)
245#define MAILBOX_RCV_JUMBO_PROD_IDX 0x00000270 /* 64-bit */ 254#define MAILBOX_RCV_JUMBO_PROD_IDX 0x00000270 /* 64-bit */
255#define TG3_RX_JMB_PROD_IDX_REG (MAILBOX_RCV_JUMBO_PROD_IDX + \
256 TG3_64BIT_REG_LOW)
246#define MAILBOX_RCV_MINI_PROD_IDX 0x00000278 /* 64-bit */ 257#define MAILBOX_RCV_MINI_PROD_IDX 0x00000278 /* 64-bit */
247#define MAILBOX_RCVRET_CON_IDX_0 0x00000280 /* 64-bit */ 258#define MAILBOX_RCVRET_CON_IDX_0 0x00000280 /* 64-bit */
248#define MAILBOX_RCVRET_CON_IDX_1 0x00000288 /* 64-bit */ 259#define MAILBOX_RCVRET_CON_IDX_1 0x00000288 /* 64-bit */
@@ -1264,8 +1275,9 @@
1264#define WDMAC_MODE_FIFOURUN_ENAB 0x00000080 1275#define WDMAC_MODE_FIFOURUN_ENAB 0x00000080
1265#define WDMAC_MODE_FIFOOREAD_ENAB 0x00000100 1276#define WDMAC_MODE_FIFOOREAD_ENAB 0x00000100
1266#define WDMAC_MODE_LNGREAD_ENAB 0x00000200 1277#define WDMAC_MODE_LNGREAD_ENAB 0x00000200
1267#define WDMAC_MODE_RX_ACCEL 0x00000400 1278#define WDMAC_MODE_RX_ACCEL 0x00000400
1268#define WDMAC_MODE_STATUS_TAG_FIX 0x20000000 1279#define WDMAC_MODE_STATUS_TAG_FIX 0x20000000
1280#define WDMAC_MODE_BURST_ALL_DATA 0xc0000000
1269#define WDMAC_STATUS 0x00004c04 1281#define WDMAC_STATUS 0x00004c04
1270#define WDMAC_STATUS_TGTABORT 0x00000004 1282#define WDMAC_STATUS_TGTABORT 0x00000004
1271#define WDMAC_STATUS_MSTABORT 0x00000008 1283#define WDMAC_STATUS_MSTABORT 0x00000008
@@ -1809,6 +1821,11 @@
1809 1821
1810#define TG3_OTP_DEFAULT 0x286c1640 1822#define TG3_OTP_DEFAULT 0x286c1640
1811 1823
1824
1825/* Hardware Legacy NVRAM layout */
1826#define TG3_NVM_VPD_OFF 0x100
1827#define TG3_NVM_VPD_LEN 256
1828
1812/* Hardware Selfboot NVRAM layout */ 1829/* Hardware Selfboot NVRAM layout */
1813#define TG3_NVM_HWSB_CFG1 0x00000004 1830#define TG3_NVM_HWSB_CFG1 0x00000004
1814#define TG3_NVM_HWSB_CFG1_MAJMSK 0xf8000000 1831#define TG3_NVM_HWSB_CFG1_MAJMSK 0xf8000000
@@ -1953,10 +1970,34 @@
1953#define NIC_SRAM_MBUF_POOL_BASE5705 0x00010000 1970#define NIC_SRAM_MBUF_POOL_BASE5705 0x00010000
1954#define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000 1971#define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000
1955 1972
1973
1956/* Currently this is fixed. */ 1974/* Currently this is fixed. */
1957#define PHY_ADDR 0x01 1975#define TG3_PHY_PCIE_ADDR 0x00
1976#define TG3_PHY_MII_ADDR 0x01
1977
1978
1979/*** Tigon3 specific PHY PCIE registers. ***/
1980
1981#define TG3_PCIEPHY_BLOCK_ADDR 0x1f
1982#define TG3_PCIEPHY_XGXS_BLK1 0x0801
1983#define TG3_PCIEPHY_TXB_BLK 0x0861
1984#define TG3_PCIEPHY_BLOCK_SHIFT 4
1985
1986/* TG3_PCIEPHY_TXB_BLK */
1987#define TG3_PCIEPHY_TX0CTRL1 0x15
1988#define TG3_PCIEPHY_TX0CTRL1_TXOCM 0x0003
1989#define TG3_PCIEPHY_TX0CTRL1_RDCTL 0x0008
1990#define TG3_PCIEPHY_TX0CTRL1_TXCMV 0x0030
1991#define TG3_PCIEPHY_TX0CTRL1_TKSEL 0x0040
1992#define TG3_PCIEPHY_TX0CTRL1_NB_EN 0x0400
1958 1993
1959/* Tigon3 specific PHY MII registers. */ 1994/* TG3_PCIEPHY_XGXS_BLK1 */
1995#define TG3_PCIEPHY_PWRMGMT4 0x1a
1996#define TG3_PCIEPHY_PWRMGMT4_L1PLLPD_EN 0x0038
1997#define TG3_PCIEPHY_PWRMGMT4_LOWPWR_EN 0x4000
1998
1999
2000/*** Tigon3 specific PHY MII registers. ***/
1960#define TG3_BMCR_SPEED1000 0x0040 2001#define TG3_BMCR_SPEED1000 0x0040
1961 2002
1962#define MII_TG3_CTRL 0x09 /* 1000-baseT control register */ 2003#define MII_TG3_CTRL 0x09 /* 1000-baseT control register */
@@ -2055,6 +2096,9 @@
2055#define MII_TG3_FET_SHDW_MISCCTRL 0x10 2096#define MII_TG3_FET_SHDW_MISCCTRL 0x10
2056#define MII_TG3_FET_SHDW_MISCCTRL_MDIX 0x4000 2097#define MII_TG3_FET_SHDW_MISCCTRL_MDIX 0x4000
2057 2098
2099#define MII_TG3_FET_SHDW_AUXMODE4 0x1a
2100#define MII_TG3_FET_SHDW_AUXMODE4_SBPD 0x0008
2101
2058#define MII_TG3_FET_SHDW_AUXSTAT2 0x1b 2102#define MII_TG3_FET_SHDW_AUXSTAT2 0x1b
2059#define MII_TG3_FET_SHDW_AUXSTAT2_APD 0x0020 2103#define MII_TG3_FET_SHDW_AUXSTAT2_APD 0x0020
2060 2104
@@ -2410,10 +2454,6 @@ struct ring_info {
2410 DECLARE_PCI_UNMAP_ADDR(mapping) 2454 DECLARE_PCI_UNMAP_ADDR(mapping)
2411}; 2455};
2412 2456
2413struct tx_ring_info {
2414 struct sk_buff *skb;
2415};
2416
2417struct tg3_config_info { 2457struct tg3_config_info {
2418 u32 flags; 2458 u32 flags;
2419}; 2459};
@@ -2542,8 +2582,10 @@ struct tg3_ethtool_stats {
2542}; 2582};
2543 2583
2544struct tg3_rx_prodring_set { 2584struct tg3_rx_prodring_set {
2545 u32 rx_std_ptr; 2585 u32 rx_std_prod_idx;
2546 u32 rx_jmb_ptr; 2586 u32 rx_std_cons_idx;
2587 u32 rx_jmb_prod_idx;
2588 u32 rx_jmb_cons_idx;
2547 struct tg3_rx_buffer_desc *rx_std; 2589 struct tg3_rx_buffer_desc *rx_std;
2548 struct tg3_ext_rx_buffer_desc *rx_jmb; 2590 struct tg3_ext_rx_buffer_desc *rx_jmb;
2549 struct ring_info *rx_std_buffers; 2591 struct ring_info *rx_std_buffers;
@@ -2571,10 +2613,11 @@ struct tg3_napi {
2571 u32 consmbox; 2613 u32 consmbox;
2572 u32 rx_rcb_ptr; 2614 u32 rx_rcb_ptr;
2573 u16 *rx_rcb_prod_idx; 2615 u16 *rx_rcb_prod_idx;
2616 struct tg3_rx_prodring_set *prodring;
2574 2617
2575 struct tg3_rx_buffer_desc *rx_rcb; 2618 struct tg3_rx_buffer_desc *rx_rcb;
2576 struct tg3_tx_buffer_desc *tx_ring; 2619 struct tg3_tx_buffer_desc *tx_ring;
2577 struct tx_ring_info *tx_buffers; 2620 struct ring_info *tx_buffers;
2578 2621
2579 dma_addr_t status_mapping; 2622 dma_addr_t status_mapping;
2580 dma_addr_t rx_rcb_mapping; 2623 dma_addr_t rx_rcb_mapping;
@@ -2654,7 +2697,7 @@ struct tg3 {
2654 struct vlan_group *vlgrp; 2697 struct vlan_group *vlgrp;
2655#endif 2698#endif
2656 2699
2657 struct tg3_rx_prodring_set prodring[1]; 2700 struct tg3_rx_prodring_set prodring[TG3_IRQ_MAX_VECS - 1];
2658 2701
2659 2702
2660 /* begin "everything else" cacheline(s) section */ 2703 /* begin "everything else" cacheline(s) section */
@@ -2725,7 +2768,7 @@ struct tg3 {
2725#define TG3_FLG2_SERDES_PREEMPHASIS 0x00020000 2768#define TG3_FLG2_SERDES_PREEMPHASIS 0x00020000
2726#define TG3_FLG2_5705_PLUS 0x00040000 2769#define TG3_FLG2_5705_PLUS 0x00040000
2727#define TG3_FLG2_5750_PLUS 0x00080000 2770#define TG3_FLG2_5750_PLUS 0x00080000
2728#define TG3_FLG2_PROTECTED_NVRAM 0x00100000 2771#define TG3_FLG2_HW_TSO_3 0x00100000
2729#define TG3_FLG2_USING_MSI 0x00200000 2772#define TG3_FLG2_USING_MSI 0x00200000
2730#define TG3_FLG2_USING_MSIX 0x00400000 2773#define TG3_FLG2_USING_MSIX 0x00400000
2731#define TG3_FLG2_USING_MSI_OR_MSIX (TG3_FLG2_USING_MSI | \ 2774#define TG3_FLG2_USING_MSI_OR_MSIX (TG3_FLG2_USING_MSI | \
@@ -2737,7 +2780,9 @@ struct tg3 {
2737#define TG3_FLG2_ICH_WORKAROUND 0x02000000 2780#define TG3_FLG2_ICH_WORKAROUND 0x02000000
2738#define TG3_FLG2_5780_CLASS 0x04000000 2781#define TG3_FLG2_5780_CLASS 0x04000000
2739#define TG3_FLG2_HW_TSO_2 0x08000000 2782#define TG3_FLG2_HW_TSO_2 0x08000000
2740#define TG3_FLG2_HW_TSO (TG3_FLG2_HW_TSO_1 | TG3_FLG2_HW_TSO_2) 2783#define TG3_FLG2_HW_TSO (TG3_FLG2_HW_TSO_1 | \
2784 TG3_FLG2_HW_TSO_2 | \
2785 TG3_FLG2_HW_TSO_3)
2741#define TG3_FLG2_1SHOT_MSI 0x10000000 2786#define TG3_FLG2_1SHOT_MSI 0x10000000
2742#define TG3_FLG2_PHY_JITTER_BUG 0x20000000 2787#define TG3_FLG2_PHY_JITTER_BUG 0x20000000
2743#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000 2788#define TG3_FLG2_NO_FWARE_REPORTED 0x40000000
@@ -2745,6 +2790,7 @@ struct tg3 {
2745 u32 tg3_flags3; 2790 u32 tg3_flags3;
2746#define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001 2791#define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001
2747#define TG3_FLG3_ENABLE_APE 0x00000002 2792#define TG3_FLG3_ENABLE_APE 0x00000002
2793#define TG3_FLG3_PROTECTED_NVRAM 0x00000004
2748#define TG3_FLG3_5701_DMA_BUG 0x00000008 2794#define TG3_FLG3_5701_DMA_BUG 0x00000008
2749#define TG3_FLG3_USE_PHYLIB 0x00000010 2795#define TG3_FLG3_USE_PHYLIB 0x00000010
2750#define TG3_FLG3_MDIOBUS_INITED 0x00000020 2796#define TG3_FLG3_MDIOBUS_INITED 0x00000020
@@ -2756,9 +2802,13 @@ struct tg3 {
2756#define TG3_FLG3_PHY_ENABLE_APD 0x00001000 2802#define TG3_FLG3_PHY_ENABLE_APD 0x00001000
2757#define TG3_FLG3_5755_PLUS 0x00002000 2803#define TG3_FLG3_5755_PLUS 0x00002000
2758#define TG3_FLG3_NO_NVRAM 0x00004000 2804#define TG3_FLG3_NO_NVRAM 0x00004000
2759#define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000
2760#define TG3_FLG3_PHY_IS_FET 0x00010000 2805#define TG3_FLG3_PHY_IS_FET 0x00010000
2761#define TG3_FLG3_ENABLE_RSS 0x00020000 2806#define TG3_FLG3_ENABLE_RSS 0x00020000
2807#define TG3_FLG3_ENABLE_TSS 0x00040000
2808#define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
2809#define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
2810#define TG3_FLG3_SHORT_DMA_BUG 0x00200000
2811#define TG3_FLG3_USE_JUMBO_BDFLAG 0x00400000
2762 2812
2763 struct timer_list timer; 2813 struct timer_list timer;
2764 u16 timer_counter; 2814 u16 timer_counter;
@@ -2825,6 +2875,7 @@ struct tg3 {
2825#define PHY_ID_BCM5756 0xbc050ed0 2875#define PHY_ID_BCM5756 0xbc050ed0
2826#define PHY_ID_BCM5784 0xbc050fa0 2876#define PHY_ID_BCM5784 0xbc050fa0
2827#define PHY_ID_BCM5761 0xbc050fd0 2877#define PHY_ID_BCM5761 0xbc050fd0
2878#define PHY_ID_BCM5717 0x5c0d8a00
2828#define PHY_ID_BCM5906 0xdc00ac40 2879#define PHY_ID_BCM5906 0xdc00ac40
2829#define PHY_ID_BCM8002 0x60010140 2880#define PHY_ID_BCM8002 0x60010140
2830#define PHY_ID_INVALID 0xffffffff 2881#define PHY_ID_INVALID 0xffffffff
@@ -2834,6 +2885,7 @@ struct tg3 {
2834#define PHY_REV_BCM5401_C0 0x6 2885#define PHY_REV_BCM5401_C0 0x6
2835#define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */ 2886#define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */
2836#define TG3_PHY_ID_BCM50610 0x143bd60 2887#define TG3_PHY_ID_BCM50610 0x143bd60
2888#define TG3_PHY_ID_BCM50610M 0x143bd70
2837#define TG3_PHY_ID_BCMAC131 0x143bc70 2889#define TG3_PHY_ID_BCMAC131 0x143bc70
2838#define TG3_PHY_ID_RTL8211C 0x001cc910 2890#define TG3_PHY_ID_RTL8211C 0x001cc910
2839#define TG3_PHY_ID_RTL8201E 0x00008200 2891#define TG3_PHY_ID_RTL8201E 0x00008200
@@ -2846,8 +2898,9 @@ struct tg3 {
2846 u32 led_ctrl; 2898 u32 led_ctrl;
2847 u32 phy_otp; 2899 u32 phy_otp;
2848 2900
2849 char board_part_number[24]; 2901#define TG3_BPN_SIZE 24
2850#define TG3_VER_SIZE 32 2902 char board_part_number[TG3_BPN_SIZE];
2903#define TG3_VER_SIZE ETHTOOL_FWVERS_LEN
2851 char fw_ver[TG3_VER_SIZE]; 2904 char fw_ver[TG3_VER_SIZE];
2852 u32 nic_sram_data_cfg; 2905 u32 nic_sram_data_cfg;
2853 u32 pci_clock_ctrl; 2906 u32 pci_clock_ctrl;
@@ -2865,7 +2918,7 @@ struct tg3 {
2865 (X) == PHY_ID_BCM5780 || (X) == PHY_ID_BCM5787 || \ 2918 (X) == PHY_ID_BCM5780 || (X) == PHY_ID_BCM5787 || \
2866 (X) == PHY_ID_BCM5755 || (X) == PHY_ID_BCM5756 || \ 2919 (X) == PHY_ID_BCM5755 || (X) == PHY_ID_BCM5756 || \
2867 (X) == PHY_ID_BCM5906 || (X) == PHY_ID_BCM5761 || \ 2920 (X) == PHY_ID_BCM5906 || (X) == PHY_ID_BCM5761 || \
2868 (X) == PHY_ID_BCM8002) 2921 (X) == PHY_ID_BCM5717 || (X) == PHY_ID_BCM8002)
2869 2922
2870 struct tg3_hw_stats *hw_stats; 2923 struct tg3_hw_stats *hw_stats;
2871 dma_addr_t stats_mapping; 2924 dma_addr_t stats_mapping;