tg3.h

Go to the documentation of this file.
00001 /* $Id$
00002  * tg3.h: Definitions for Broadcom Tigon3 ethernet driver.
00003  *
00004  * Copyright (C) 2001, 2002 David S. Miller (davem@redhat.com)
00005  * Copyright (C) 2001 Jeff Garzik (jgarzik@mandrakesoft.com)
00006  */
00007 
00008 FILE_LICENCE ( GPL2_ONLY );
00009 
00010 #ifndef _T3_H
00011 #define _T3_H
00012 
00013 #include "stdint.h"
00014 
00015 typedef unsigned long dma_addr_t;
00016 
00017 /* From mii.h */
00018 
00019 /* Indicates what features are advertised by the interface. */
00020 #define ADVERTISED_10baseT_Half         (1 << 0)
00021 #define ADVERTISED_10baseT_Full         (1 << 1)
00022 #define ADVERTISED_100baseT_Half        (1 << 2)
00023 #define ADVERTISED_100baseT_Full        (1 << 3)
00024 #define ADVERTISED_1000baseT_Half       (1 << 4)
00025 #define ADVERTISED_1000baseT_Full       (1 << 5)
00026 #define ADVERTISED_Autoneg              (1 << 6)
00027 #define ADVERTISED_TP                   (1 << 7)
00028 #define ADVERTISED_AUI                  (1 << 8)
00029 #define ADVERTISED_MII                  (1 << 9)
00030 #define ADVERTISED_FIBRE                (1 << 10)
00031 #define ADVERTISED_BNC                  (1 << 11)
00032 
00033 /* The following are all involved in forcing a particular link
00034  * mode for the device for setting things.  When getting the
00035  * devices settings, these indicate the current mode and whether
00036  * it was foced up into this mode or autonegotiated.
00037  */
00038 
00039 /* The forced speed, 10Mb, 100Mb, gigabit. */
00040 #define SPEED_10                0
00041 #define SPEED_100               1
00042 #define SPEED_1000              2
00043 #define SPEED_INVALID           3
00044 
00045 
00046 /* Duplex, half or full. */
00047 #define DUPLEX_HALF             0x00
00048 #define DUPLEX_FULL             0x01
00049 #define DUPLEX_INVALID          0x02
00050 
00051 /* Which connector port. */
00052 #define PORT_TP                 0x00
00053 #define PORT_AUI                0x01
00054 #define PORT_MII                0x02
00055 #define PORT_FIBRE              0x03
00056 #define PORT_BNC                0x04
00057 
00058 /* Which tranceiver to use. */
00059 #define XCVR_INTERNAL           0x00
00060 #define XCVR_EXTERNAL           0x01
00061 #define XCVR_DUMMY1             0x02
00062 #define XCVR_DUMMY2             0x03
00063 #define XCVR_DUMMY3             0x04
00064 
00065 /* Enable or disable autonegotiation.  If this is set to enable,
00066  * the forced link modes above are completely ignored.
00067  */
00068 #define AUTONEG_DISABLE         0x00
00069 #define AUTONEG_ENABLE          0x01
00070 
00071 /* Wake-On-Lan options. */
00072 #define WAKE_PHY                (1 << 0)
00073 #define WAKE_UCAST              (1 << 1)
00074 #define WAKE_MCAST              (1 << 2)
00075 #define WAKE_BCAST              (1 << 3)
00076 #define WAKE_ARP                (1 << 4)
00077 #define WAKE_MAGIC              (1 << 5)
00078 #define WAKE_MAGICSECURE        (1 << 6) /* only meaningful if WAKE_MAGIC */
00079 
00080 /* From tg3.h */
00081 
00082 #define TG3_64BIT_REG_HIGH              0x00UL
00083 #define TG3_64BIT_REG_LOW               0x04UL
00084 
00085 /* Descriptor block info. */
00086 #define TG3_BDINFO_HOST_ADDR            0x0UL /* 64-bit */
00087 #define TG3_BDINFO_MAXLEN_FLAGS         0x8UL /* 32-bit */
00088 #define  BDINFO_FLAGS_USE_EXT_RECV       0x00000001 /* ext rx_buffer_desc */
00089 #define  BDINFO_FLAGS_DISABLED           0x00000002
00090 #define  BDINFO_FLAGS_MAXLEN_MASK        0xffff0000
00091 #define  BDINFO_FLAGS_MAXLEN_SHIFT       16
00092 #define TG3_BDINFO_NIC_ADDR             0xcUL /* 32-bit */
00093 #define TG3_BDINFO_SIZE                 0x10UL
00094 
00095 #define RX_COPY_THRESHOLD               256
00096 
00097 #define RX_STD_MAX_SIZE                 1536
00098 #define RX_STD_MAX_SIZE_5705            512
00099 #define RX_JUMBO_MAX_SIZE               0xdeadbeef /* XXX */
00100 
00101 /* First 256 bytes are a mirror of PCI config space. */
00102 #define TG3PCI_VENDOR                   0x00000000
00103 #define  TG3PCI_VENDOR_BROADCOM          0x14e4
00104 #define TG3PCI_DEVICE                   0x00000002
00105 #define  TG3PCI_DEVICE_TIGON3_1          0x1644 /* BCM5700 */
00106 #define  TG3PCI_DEVICE_TIGON3_2          0x1645 /* BCM5701 */
00107 #define  TG3PCI_DEVICE_TIGON3_3          0x1646 /* BCM5702 */
00108 #define  TG3PCI_DEVICE_TIGON3_4          0x1647 /* BCM5703 */
00109 #define TG3PCI_COMMAND                  0x00000004
00110 #define TG3PCI_STATUS                   0x00000006
00111 #define TG3PCI_CCREVID                  0x00000008
00112 #define TG3PCI_CACHELINESZ              0x0000000c
00113 #define TG3PCI_LATTIMER                 0x0000000d
00114 #define TG3PCI_HEADERTYPE               0x0000000e
00115 #define TG3PCI_BIST                     0x0000000f
00116 #define TG3PCI_BASE0_LOW                0x00000010
00117 #define TG3PCI_BASE0_HIGH               0x00000014
00118 /* 0x18 --> 0x2c unused */
00119 #define TG3PCI_SUBSYSVENID              0x0000002c
00120 #define TG3PCI_SUBSYSID                 0x0000002e
00121 #define TG3PCI_ROMADDR                  0x00000030
00122 #define TG3PCI_CAPLIST                  0x00000034
00123 /* 0x35 --> 0x3c unused */
00124 #define TG3PCI_IRQ_LINE                 0x0000003c
00125 #define TG3PCI_IRQ_PIN                  0x0000003d
00126 #define TG3PCI_MIN_GNT                  0x0000003e
00127 #define TG3PCI_MAX_LAT                  0x0000003f
00128 #define TG3PCI_X_CAPS                   0x00000040
00129 #define  PCIX_CAPS_RELAXED_ORDERING      0x00020000
00130 #define  PCIX_CAPS_SPLIT_MASK            0x00700000
00131 #define  PCIX_CAPS_SPLIT_SHIFT           20
00132 #define  PCIX_CAPS_BURST_MASK            0x000c0000
00133 #define  PCIX_CAPS_BURST_SHIFT           18
00134 #define  PCIX_CAPS_MAX_BURST_CPIOB       2
00135 #define TG3PCI_PM_CAP_PTR               0x00000041
00136 #define TG3PCI_X_COMMAND                0x00000042
00137 #define TG3PCI_X_STATUS                 0x00000044
00138 #define TG3PCI_PM_CAP_ID                0x00000048
00139 #define TG3PCI_VPD_CAP_PTR              0x00000049
00140 #define TG3PCI_PM_CAPS                  0x0000004a
00141 #define TG3PCI_PM_CTRL_STAT             0x0000004c
00142 #define TG3PCI_BR_SUPP_EXT              0x0000004e
00143 #define TG3PCI_PM_DATA                  0x0000004f
00144 #define TG3PCI_VPD_CAP_ID               0x00000050
00145 #define TG3PCI_MSI_CAP_PTR              0x00000051
00146 #define TG3PCI_VPD_ADDR_FLAG            0x00000052
00147 #define  VPD_ADDR_FLAG_WRITE            0x00008000
00148 #define TG3PCI_VPD_DATA                 0x00000054
00149 #define TG3PCI_MSI_CAP_ID               0x00000058
00150 #define TG3PCI_NXT_CAP_PTR              0x00000059
00151 #define TG3PCI_MSI_CTRL                 0x0000005a
00152 #define TG3PCI_MSI_ADDR_LOW             0x0000005c
00153 #define TG3PCI_MSI_ADDR_HIGH            0x00000060
00154 #define TG3PCI_MSI_DATA                 0x00000064
00155 /* 0x66 --> 0x68 unused */
00156 #define TG3PCI_MISC_HOST_CTRL           0x00000068
00157 #define  MISC_HOST_CTRL_CLEAR_INT        0x00000001
00158 #define  MISC_HOST_CTRL_MASK_PCI_INT     0x00000002
00159 #define  MISC_HOST_CTRL_BYTE_SWAP        0x00000004
00160 #define  MISC_HOST_CTRL_WORD_SWAP        0x00000008
00161 #define  MISC_HOST_CTRL_PCISTATE_RW      0x00000010
00162 #define  MISC_HOST_CTRL_CLKREG_RW        0x00000020
00163 #define  MISC_HOST_CTRL_REGWORD_SWAP     0x00000040
00164 #define  MISC_HOST_CTRL_INDIR_ACCESS     0x00000080
00165 #define  MISC_HOST_CTRL_IRQ_MASK_MODE    0x00000100
00166 #define  MISC_HOST_CTRL_TAGGED_STATUS    0x00000200
00167 #define  MISC_HOST_CTRL_CHIPREV          0xffff0000
00168 #define  MISC_HOST_CTRL_CHIPREV_SHIFT    16
00169 #define  GET_CHIP_REV_ID(MISC_HOST_CTRL) \
00170          (((MISC_HOST_CTRL) & MISC_HOST_CTRL_CHIPREV) >> \
00171           MISC_HOST_CTRL_CHIPREV_SHIFT)
00172 #define  CHIPREV_ID_5700_A0              0x7000
00173 #define  CHIPREV_ID_5700_A1              0x7001
00174 #define  CHIPREV_ID_5700_B0              0x7100
00175 #define  CHIPREV_ID_5700_B1              0x7101
00176 #define  CHIPREV_ID_5700_B3              0x7102
00177 #define  CHIPREV_ID_5700_ALTIMA          0x7104
00178 #define  CHIPREV_ID_5700_C0              0x7200
00179 #define  CHIPREV_ID_5701_A0              0x0000
00180 #define  CHIPREV_ID_5701_B0              0x0100
00181 #define  CHIPREV_ID_5701_B2              0x0102
00182 #define  CHIPREV_ID_5701_B5              0x0105
00183 #define  CHIPREV_ID_5703_A0              0x1000
00184 #define  CHIPREV_ID_5703_A1              0x1001
00185 #define  CHIPREV_ID_5703_A2              0x1002
00186 #define  CHIPREV_ID_5703_A3              0x1003
00187 #define  CHIPREV_ID_5704_A0              0x2000
00188 #define  CHIPREV_ID_5704_A1              0x2001
00189 #define  CHIPREV_ID_5704_A2              0x2002
00190 #define  CHIPREV_ID_5705_A0              0x3000
00191 #define  CHIPREV_ID_5705_A1              0x3001
00192 #define  CHIPREV_ID_5705_A2              0x3002
00193 #define  CHIPREV_ID_5705_A3              0x3003
00194 #define  CHIPREV_ID_5721                 0x4101
00195 #define  CHIPREV_ID_5750_A0              0x4000
00196 #define  CHIPREV_ID_5750_A1              0x4001
00197 #define  CHIPREV_ID_5750_A3              0x4003
00198 #define  GET_ASIC_REV(CHIP_REV_ID)      ((CHIP_REV_ID) >> 12)
00199 #define   ASIC_REV_5700                  0x07
00200 #define   ASIC_REV_5701                  0x00
00201 #define   ASIC_REV_5703                  0x01
00202 #define   ASIC_REV_5704                  0x02
00203 #define   ASIC_REV_5705                  0x03
00204 #define   ASIC_REV_5750                  0x04
00205 #define   ASIC_REV_5787                  0x0b
00206 #define  GET_CHIP_REV(CHIP_REV_ID)      ((CHIP_REV_ID) >> 8)
00207 #define   CHIPREV_5700_AX                0x70
00208 #define   CHIPREV_5700_BX                0x71
00209 #define   CHIPREV_5700_CX                0x72
00210 #define   CHIPREV_5701_AX                0x00
00211 #define  GET_METAL_REV(CHIP_REV_ID)     ((CHIP_REV_ID) & 0xff)
00212 #define   METAL_REV_A0                   0x00
00213 #define   METAL_REV_A1                   0x01
00214 #define   METAL_REV_B0                   0x00
00215 #define   METAL_REV_B1                   0x01
00216 #define   METAL_REV_B2                   0x02
00217 #define TG3PCI_DMA_RW_CTRL              0x0000006c
00218 #define  DMA_RWCTRL_MIN_DMA              0x000000ff
00219 #define  DMA_RWCTRL_MIN_DMA_SHIFT        0
00220 #define  DMA_RWCTRL_READ_BNDRY_MASK      0x00000700
00221 #define  DMA_RWCTRL_READ_BNDRY_DISAB     0x00000000
00222 #define  DMA_RWCTRL_READ_BNDRY_16        0x00000100
00223 #define  DMA_RWCTRL_READ_BNDRY_32        0x00000200
00224 #define  DMA_RWCTRL_READ_BNDRY_64        0x00000300
00225 #define  DMA_RWCTRL_READ_BNDRY_128       0x00000400
00226 #define  DMA_RWCTRL_READ_BNDRY_256       0x00000500
00227 #define  DMA_RWCTRL_READ_BNDRY_512       0x00000600
00228 #define  DMA_RWCTRL_READ_BNDRY_1024      0x00000700
00229 #define  DMA_RWCTRL_WRITE_BNDRY_MASK     0x00003800
00230 #define  DMA_RWCTRL_WRITE_BNDRY_DISAB    0x00000000
00231 #define  DMA_RWCTRL_WRITE_BNDRY_16       0x00000800
00232 #define  DMA_RWCTRL_WRITE_BNDRY_32       0x00001000
00233 #define  DMA_RWCTRL_WRITE_BNDRY_64       0x00001800
00234 #define  DMA_RWCTRL_WRITE_BNDRY_128      0x00002000
00235 #define  DMA_RWCTRL_WRITE_BNDRY_256      0x00002800
00236 #define  DMA_RWCTRL_WRITE_BNDRY_512      0x00003000
00237 #define  DMA_RWCTRL_WRITE_BNDRY_1024     0x00003800
00238 #define  DMA_RWCTRL_ONE_DMA              0x00004000
00239 #define  DMA_RWCTRL_READ_WATER           0x00070000
00240 #define  DMA_RWCTRL_READ_WATER_SHIFT     16
00241 #define  DMA_RWCTRL_WRITE_WATER          0x00380000
00242 #define  DMA_RWCTRL_WRITE_WATER_SHIFT    19
00243 #define  DMA_RWCTRL_USE_MEM_READ_MULT    0x00400000
00244 #define  DMA_RWCTRL_ASSERT_ALL_BE        0x00800000
00245 #define  DMA_RWCTRL_PCI_READ_CMD         0x0f000000
00246 #define  DMA_RWCTRL_PCI_READ_CMD_SHIFT   24
00247 #define  DMA_RWCTRL_PCI_WRITE_CMD        0xf0000000
00248 #define  DMA_RWCTRL_PCI_WRITE_CMD_SHIFT  28
00249 #define TG3PCI_PCISTATE                 0x00000070
00250 #define  PCISTATE_FORCE_RESET            0x00000001
00251 #define  PCISTATE_INT_NOT_ACTIVE         0x00000002
00252 #define  PCISTATE_CONV_PCI_MODE          0x00000004
00253 #define  PCISTATE_BUS_SPEED_HIGH         0x00000008
00254 #define  PCISTATE_BUS_32BIT              0x00000010
00255 #define  PCISTATE_ROM_ENABLE             0x00000020
00256 #define  PCISTATE_ROM_RETRY_ENABLE       0x00000040
00257 #define  PCISTATE_FLAT_VIEW              0x00000100
00258 #define  PCISTATE_RETRY_SAME_DMA         0x00002000
00259 #define TG3PCI_CLOCK_CTRL               0x00000074
00260 #define  CLOCK_CTRL_CORECLK_DISABLE      0x00000200
00261 #define  CLOCK_CTRL_RXCLK_DISABLE        0x00000400
00262 #define  CLOCK_CTRL_TXCLK_DISABLE        0x00000800
00263 #define  CLOCK_CTRL_ALTCLK               0x00001000
00264 #define  CLOCK_CTRL_PWRDOWN_PLL133       0x00008000
00265 #define  CLOCK_CTRL_44MHZ_CORE           0x00040000
00266 #define  CLOCK_CTRL_625_CORE             0x00100000
00267 #define  CLOCK_CTRL_FORCE_CLKRUN         0x00200000
00268 #define  CLOCK_CTRL_CLKRUN_OENABLE       0x00400000
00269 #define  CLOCK_CTRL_DELAY_PCI_GRANT      0x80000000
00270 #define TG3PCI_REG_BASE_ADDR            0x00000078
00271 #define TG3PCI_MEM_WIN_BASE_ADDR        0x0000007c
00272 #define TG3PCI_REG_DATA                 0x00000080
00273 #define TG3PCI_MEM_WIN_DATA             0x00000084
00274 #define TG3PCI_MODE_CTRL                0x00000088
00275 #define TG3PCI_MISC_CFG                 0x0000008c
00276 #define TG3PCI_MISC_LOCAL_CTRL          0x00000090
00277 /* 0x94 --> 0x98 unused */
00278 #define TG3PCI_STD_RING_PROD_IDX        0x00000098 /* 64-bit */
00279 #define TG3PCI_RCV_RET_RING_CON_IDX     0x000000a0 /* 64-bit */
00280 #define TG3PCI_SND_PROD_IDX             0x000000a8 /* 64-bit */
00281 /* 0xb0 --> 0x100 unused */
00282 
00283 /* 0x100 --> 0x200 unused */
00284 
00285 /* Mailbox registers */
00286 #define MAILBOX_INTERRUPT_0             0x00000200 /* 64-bit */
00287 #define MAILBOX_INTERRUPT_1             0x00000208 /* 64-bit */
00288 #define MAILBOX_INTERRUPT_2             0x00000210 /* 64-bit */
00289 #define MAILBOX_INTERRUPT_3             0x00000218 /* 64-bit */
00290 #define MAILBOX_GENERAL_0               0x00000220 /* 64-bit */
00291 #define MAILBOX_GENERAL_1               0x00000228 /* 64-bit */
00292 #define MAILBOX_GENERAL_2               0x00000230 /* 64-bit */
00293 #define MAILBOX_GENERAL_3               0x00000238 /* 64-bit */
00294 #define MAILBOX_GENERAL_4               0x00000240 /* 64-bit */
00295 #define MAILBOX_GENERAL_5               0x00000248 /* 64-bit */
00296 #define MAILBOX_GENERAL_6               0x00000250 /* 64-bit */
00297 #define MAILBOX_GENERAL_7               0x00000258 /* 64-bit */
00298 #define MAILBOX_RELOAD_STAT             0x00000260 /* 64-bit */
00299 #define MAILBOX_RCV_STD_PROD_IDX        0x00000268 /* 64-bit */
00300 #define MAILBOX_RCV_JUMBO_PROD_IDX      0x00000270 /* 64-bit */
00301 #define MAILBOX_RCV_MINI_PROD_IDX       0x00000278 /* 64-bit */
00302 #define MAILBOX_RCVRET_CON_IDX_0        0x00000280 /* 64-bit */
00303 #define MAILBOX_RCVRET_CON_IDX_1        0x00000288 /* 64-bit */
00304 #define MAILBOX_RCVRET_CON_IDX_2        0x00000290 /* 64-bit */
00305 #define MAILBOX_RCVRET_CON_IDX_3        0x00000298 /* 64-bit */
00306 #define MAILBOX_RCVRET_CON_IDX_4        0x000002a0 /* 64-bit */
00307 #define MAILBOX_RCVRET_CON_IDX_5        0x000002a8 /* 64-bit */
00308 #define MAILBOX_RCVRET_CON_IDX_6        0x000002b0 /* 64-bit */
00309 #define MAILBOX_RCVRET_CON_IDX_7        0x000002b8 /* 64-bit */
00310 #define MAILBOX_RCVRET_CON_IDX_8        0x000002c0 /* 64-bit */
00311 #define MAILBOX_RCVRET_CON_IDX_9        0x000002c8 /* 64-bit */
00312 #define MAILBOX_RCVRET_CON_IDX_10       0x000002d0 /* 64-bit */
00313 #define MAILBOX_RCVRET_CON_IDX_11       0x000002d8 /* 64-bit */
00314 #define MAILBOX_RCVRET_CON_IDX_12       0x000002e0 /* 64-bit */
00315 #define MAILBOX_RCVRET_CON_IDX_13       0x000002e8 /* 64-bit */
00316 #define MAILBOX_RCVRET_CON_IDX_14       0x000002f0 /* 64-bit */
00317 #define MAILBOX_RCVRET_CON_IDX_15       0x000002f8 /* 64-bit */
00318 #define MAILBOX_SNDHOST_PROD_IDX_0      0x00000300 /* 64-bit */
00319 #define MAILBOX_SNDHOST_PROD_IDX_1      0x00000308 /* 64-bit */
00320 #define MAILBOX_SNDHOST_PROD_IDX_2      0x00000310 /* 64-bit */
00321 #define MAILBOX_SNDHOST_PROD_IDX_3      0x00000318 /* 64-bit */
00322 #define MAILBOX_SNDHOST_PROD_IDX_4      0x00000320 /* 64-bit */
00323 #define MAILBOX_SNDHOST_PROD_IDX_5      0x00000328 /* 64-bit */
00324 #define MAILBOX_SNDHOST_PROD_IDX_6      0x00000330 /* 64-bit */
00325 #define MAILBOX_SNDHOST_PROD_IDX_7      0x00000338 /* 64-bit */
00326 #define MAILBOX_SNDHOST_PROD_IDX_8      0x00000340 /* 64-bit */
00327 #define MAILBOX_SNDHOST_PROD_IDX_9      0x00000348 /* 64-bit */
00328 #define MAILBOX_SNDHOST_PROD_IDX_10     0x00000350 /* 64-bit */
00329 #define MAILBOX_SNDHOST_PROD_IDX_11     0x00000358 /* 64-bit */
00330 #define MAILBOX_SNDHOST_PROD_IDX_12     0x00000360 /* 64-bit */
00331 #define MAILBOX_SNDHOST_PROD_IDX_13     0x00000368 /* 64-bit */
00332 #define MAILBOX_SNDHOST_PROD_IDX_14     0x00000370 /* 64-bit */
00333 #define MAILBOX_SNDHOST_PROD_IDX_15     0x00000378 /* 64-bit */
00334 #define MAILBOX_SNDNIC_PROD_IDX_0       0x00000380 /* 64-bit */
00335 #define MAILBOX_SNDNIC_PROD_IDX_1       0x00000388 /* 64-bit */
00336 #define MAILBOX_SNDNIC_PROD_IDX_2       0x00000390 /* 64-bit */
00337 #define MAILBOX_SNDNIC_PROD_IDX_3       0x00000398 /* 64-bit */
00338 #define MAILBOX_SNDNIC_PROD_IDX_4       0x000003a0 /* 64-bit */
00339 #define MAILBOX_SNDNIC_PROD_IDX_5       0x000003a8 /* 64-bit */
00340 #define MAILBOX_SNDNIC_PROD_IDX_6       0x000003b0 /* 64-bit */
00341 #define MAILBOX_SNDNIC_PROD_IDX_7       0x000003b8 /* 64-bit */
00342 #define MAILBOX_SNDNIC_PROD_IDX_8       0x000003c0 /* 64-bit */
00343 #define MAILBOX_SNDNIC_PROD_IDX_9       0x000003c8 /* 64-bit */
00344 #define MAILBOX_SNDNIC_PROD_IDX_10      0x000003d0 /* 64-bit */
00345 #define MAILBOX_SNDNIC_PROD_IDX_11      0x000003d8 /* 64-bit */
00346 #define MAILBOX_SNDNIC_PROD_IDX_12      0x000003e0 /* 64-bit */
00347 #define MAILBOX_SNDNIC_PROD_IDX_13      0x000003e8 /* 64-bit */
00348 #define MAILBOX_SNDNIC_PROD_IDX_14      0x000003f0 /* 64-bit */
00349 #define MAILBOX_SNDNIC_PROD_IDX_15      0x000003f8 /* 64-bit */
00350 
00351 /* MAC control registers */
00352 #define MAC_MODE                        0x00000400
00353 #define  MAC_MODE_RESET                  0x00000001
00354 #define  MAC_MODE_HALF_DUPLEX            0x00000002
00355 #define  MAC_MODE_PORT_MODE_MASK         0x0000000c
00356 #define  MAC_MODE_PORT_MODE_TBI          0x0000000c
00357 #define  MAC_MODE_PORT_MODE_GMII         0x00000008
00358 #define  MAC_MODE_PORT_MODE_MII          0x00000004
00359 #define  MAC_MODE_PORT_MODE_NONE         0x00000000
00360 #define  MAC_MODE_PORT_INT_LPBACK        0x00000010
00361 #define  MAC_MODE_TAGGED_MAC_CTRL        0x00000080
00362 #define  MAC_MODE_TX_BURSTING            0x00000100
00363 #define  MAC_MODE_MAX_DEFER              0x00000200
00364 #define  MAC_MODE_LINK_POLARITY          0x00000400
00365 #define  MAC_MODE_RXSTAT_ENABLE          0x00000800
00366 #define  MAC_MODE_RXSTAT_CLEAR           0x00001000
00367 #define  MAC_MODE_RXSTAT_FLUSH           0x00002000
00368 #define  MAC_MODE_TXSTAT_ENABLE          0x00004000
00369 #define  MAC_MODE_TXSTAT_CLEAR           0x00008000
00370 #define  MAC_MODE_TXSTAT_FLUSH           0x00010000
00371 #define  MAC_MODE_SEND_CONFIGS           0x00020000
00372 #define  MAC_MODE_MAGIC_PKT_ENABLE       0x00040000
00373 #define  MAC_MODE_ACPI_ENABLE            0x00080000
00374 #define  MAC_MODE_MIP_ENABLE             0x00100000
00375 #define  MAC_MODE_TDE_ENABLE             0x00200000
00376 #define  MAC_MODE_RDE_ENABLE             0x00400000
00377 #define  MAC_MODE_FHDE_ENABLE            0x00800000
00378 #define MAC_STATUS                      0x00000404
00379 #define  MAC_STATUS_PCS_SYNCED           0x00000001
00380 #define  MAC_STATUS_SIGNAL_DET           0x00000002
00381 #define  MAC_STATUS_RCVD_CFG             0x00000004
00382 #define  MAC_STATUS_CFG_CHANGED          0x00000008
00383 #define  MAC_STATUS_SYNC_CHANGED         0x00000010
00384 #define  MAC_STATUS_PORT_DEC_ERR         0x00000400
00385 #define  MAC_STATUS_LNKSTATE_CHANGED     0x00001000
00386 #define  MAC_STATUS_MI_COMPLETION        0x00400000
00387 #define  MAC_STATUS_MI_INTERRUPT         0x00800000
00388 #define  MAC_STATUS_AP_ERROR             0x01000000
00389 #define  MAC_STATUS_ODI_ERROR            0x02000000
00390 #define  MAC_STATUS_RXSTAT_OVERRUN       0x04000000
00391 #define  MAC_STATUS_TXSTAT_OVERRUN       0x08000000
00392 #define MAC_EVENT                       0x00000408
00393 #define  MAC_EVENT_PORT_DECODE_ERR       0x00000400
00394 #define  MAC_EVENT_LNKSTATE_CHANGED      0x00001000
00395 #define  MAC_EVENT_MI_COMPLETION         0x00400000
00396 #define  MAC_EVENT_MI_INTERRUPT          0x00800000
00397 #define  MAC_EVENT_AP_ERROR              0x01000000
00398 #define  MAC_EVENT_ODI_ERROR             0x02000000
00399 #define  MAC_EVENT_RXSTAT_OVERRUN        0x04000000
00400 #define  MAC_EVENT_TXSTAT_OVERRUN        0x08000000
00401 #define MAC_LED_CTRL                    0x0000040c
00402 #define  LED_CTRL_LNKLED_OVERRIDE        0x00000001
00403 #define  LED_CTRL_1000MBPS_ON            0x00000002
00404 #define  LED_CTRL_100MBPS_ON             0x00000004
00405 #define  LED_CTRL_10MBPS_ON              0x00000008
00406 #define  LED_CTRL_TRAFFIC_OVERRIDE       0x00000010
00407 #define  LED_CTRL_TRAFFIC_BLINK          0x00000020
00408 #define  LED_CTRL_TRAFFIC_LED            0x00000040
00409 #define  LED_CTRL_1000MBPS_STATUS        0x00000080
00410 #define  LED_CTRL_100MBPS_STATUS         0x00000100
00411 #define  LED_CTRL_10MBPS_STATUS          0x00000200
00412 #define  LED_CTRL_TRAFFIC_STATUS         0x00000400
00413 #define  LED_CTRL_MAC_MODE               0x00000000
00414 #define  LED_CTRL_PHY_MODE_1             0x00000800
00415 #define  LED_CTRL_PHY_MODE_2             0x00001000
00416 #define  LED_CTRL_BLINK_RATE_MASK        0x7ff80000
00417 #define  LED_CTRL_BLINK_RATE_SHIFT       19
00418 #define  LED_CTRL_BLINK_PER_OVERRIDE     0x00080000
00419 #define  LED_CTRL_BLINK_RATE_OVERRIDE    0x80000000
00420 #define MAC_ADDR_0_HIGH                 0x00000410 /* upper 2 bytes */
00421 #define MAC_ADDR_0_LOW                  0x00000414 /* lower 4 bytes */
00422 #define MAC_ADDR_1_HIGH                 0x00000418 /* upper 2 bytes */
00423 #define MAC_ADDR_1_LOW                  0x0000041c /* lower 4 bytes */
00424 #define MAC_ADDR_2_HIGH                 0x00000420 /* upper 2 bytes */
00425 #define MAC_ADDR_2_LOW                  0x00000424 /* lower 4 bytes */
00426 #define MAC_ADDR_3_HIGH                 0x00000428 /* upper 2 bytes */
00427 #define MAC_ADDR_3_LOW                  0x0000042c /* lower 4 bytes */
00428 #define MAC_ACPI_MBUF_PTR               0x00000430
00429 #define MAC_ACPI_LEN_OFFSET             0x00000434
00430 #define  ACPI_LENOFF_LEN_MASK            0x0000ffff
00431 #define  ACPI_LENOFF_LEN_SHIFT           0
00432 #define  ACPI_LENOFF_OFF_MASK            0x0fff0000
00433 #define  ACPI_LENOFF_OFF_SHIFT           16
00434 #define MAC_TX_BACKOFF_SEED             0x00000438
00435 #define  TX_BACKOFF_SEED_MASK            0x000003ff
00436 #define MAC_RX_MTU_SIZE                 0x0000043c
00437 #define  RX_MTU_SIZE_MASK                0x0000ffff
00438 #define MAC_PCS_TEST                    0x00000440
00439 #define  PCS_TEST_PATTERN_MASK           0x000fffff
00440 #define  PCS_TEST_PATTERN_SHIFT          0
00441 #define  PCS_TEST_ENABLE                 0x00100000
00442 #define MAC_TX_AUTO_NEG                 0x00000444
00443 #define  TX_AUTO_NEG_MASK                0x0000ffff
00444 #define  TX_AUTO_NEG_SHIFT               0
00445 #define MAC_RX_AUTO_NEG                 0x00000448
00446 #define  RX_AUTO_NEG_MASK                0x0000ffff
00447 #define  RX_AUTO_NEG_SHIFT               0
00448 #define MAC_MI_COM                      0x0000044c
00449 #define  MI_COM_CMD_MASK                 0x0c000000
00450 #define  MI_COM_CMD_WRITE                0x04000000
00451 #define  MI_COM_CMD_READ                 0x08000000
00452 #define  MI_COM_READ_FAILED              0x10000000
00453 #define  MI_COM_START                    0x20000000
00454 #define  MI_COM_BUSY                     0x20000000
00455 #define  MI_COM_PHY_ADDR_MASK            0x03e00000
00456 #define  MI_COM_PHY_ADDR_SHIFT           21
00457 #define  MI_COM_REG_ADDR_MASK            0x001f0000
00458 #define  MI_COM_REG_ADDR_SHIFT           16
00459 #define  MI_COM_DATA_MASK                0x0000ffff
00460 #define MAC_MI_STAT                     0x00000450
00461 #define  MAC_MI_STAT_LNKSTAT_ATTN_ENAB   0x00000001
00462 #define MAC_MI_MODE                     0x00000454
00463 #define  MAC_MI_MODE_CLK_10MHZ           0x00000001
00464 #define  MAC_MI_MODE_SHORT_PREAMBLE      0x00000002
00465 #define  MAC_MI_MODE_AUTO_POLL           0x00000010
00466 #define  MAC_MI_MODE_CORE_CLK_62MHZ      0x00008000
00467 #define  MAC_MI_MODE_BASE                0x000c0000 /* XXX magic values XXX */
00468 #define MAC_AUTO_POLL_STATUS            0x00000458
00469 #define  MAC_AUTO_POLL_ERROR             0x00000001
00470 #define MAC_TX_MODE                     0x0000045c
00471 #define  TX_MODE_RESET                   0x00000001
00472 #define  TX_MODE_ENABLE                  0x00000002
00473 #define  TX_MODE_FLOW_CTRL_ENABLE        0x00000010
00474 #define  TX_MODE_BIG_BCKOFF_ENABLE       0x00000020
00475 #define  TX_MODE_LONG_PAUSE_ENABLE       0x00000040
00476 #define MAC_TX_STATUS                   0x00000460
00477 #define  TX_STATUS_XOFFED                0x00000001
00478 #define  TX_STATUS_SENT_XOFF             0x00000002
00479 #define  TX_STATUS_SENT_XON              0x00000004
00480 #define  TX_STATUS_LINK_UP               0x00000008
00481 #define  TX_STATUS_ODI_UNDERRUN          0x00000010
00482 #define  TX_STATUS_ODI_OVERRUN           0x00000020
00483 #define MAC_TX_LENGTHS                  0x00000464
00484 #define  TX_LENGTHS_SLOT_TIME_MASK       0x000000ff
00485 #define  TX_LENGTHS_SLOT_TIME_SHIFT      0
00486 #define  TX_LENGTHS_IPG_MASK             0x00000f00
00487 #define  TX_LENGTHS_IPG_SHIFT            8
00488 #define  TX_LENGTHS_IPG_CRS_MASK         0x00003000
00489 #define  TX_LENGTHS_IPG_CRS_SHIFT        12
00490 #define MAC_RX_MODE                     0x00000468
00491 #define  RX_MODE_RESET                   0x00000001
00492 #define  RX_MODE_ENABLE                  0x00000002
00493 #define  RX_MODE_FLOW_CTRL_ENABLE        0x00000004
00494 #define  RX_MODE_KEEP_MAC_CTRL           0x00000008
00495 #define  RX_MODE_KEEP_PAUSE              0x00000010
00496 #define  RX_MODE_ACCEPT_OVERSIZED        0x00000020
00497 #define  RX_MODE_ACCEPT_RUNTS            0x00000040
00498 #define  RX_MODE_LEN_CHECK               0x00000080
00499 #define  RX_MODE_PROMISC                 0x00000100
00500 #define  RX_MODE_NO_CRC_CHECK            0x00000200
00501 #define  RX_MODE_KEEP_VLAN_TAG           0x00000400
00502 #define MAC_RX_STATUS                   0x0000046c
00503 #define  RX_STATUS_REMOTE_TX_XOFFED      0x00000001
00504 #define  RX_STATUS_XOFF_RCVD             0x00000002
00505 #define  RX_STATUS_XON_RCVD              0x00000004
00506 #define MAC_HASH_REG_0                  0x00000470
00507 #define MAC_HASH_REG_1                  0x00000474
00508 #define MAC_HASH_REG_2                  0x00000478
00509 #define MAC_HASH_REG_3                  0x0000047c
00510 #define MAC_RCV_RULE_0                  0x00000480
00511 #define MAC_RCV_VALUE_0                 0x00000484
00512 #define MAC_RCV_RULE_1                  0x00000488
00513 #define MAC_RCV_VALUE_1                 0x0000048c
00514 #define MAC_RCV_RULE_2                  0x00000490
00515 #define MAC_RCV_VALUE_2                 0x00000494
00516 #define MAC_RCV_RULE_3                  0x00000498
00517 #define MAC_RCV_VALUE_3                 0x0000049c
00518 #define MAC_RCV_RULE_4                  0x000004a0
00519 #define MAC_RCV_VALUE_4                 0x000004a4
00520 #define MAC_RCV_RULE_5                  0x000004a8
00521 #define MAC_RCV_VALUE_5                 0x000004ac
00522 #define MAC_RCV_RULE_6                  0x000004b0
00523 #define MAC_RCV_VALUE_6                 0x000004b4
00524 #define MAC_RCV_RULE_7                  0x000004b8
00525 #define MAC_RCV_VALUE_7                 0x000004bc
00526 #define MAC_RCV_RULE_8                  0x000004c0
00527 #define MAC_RCV_VALUE_8                 0x000004c4
00528 #define MAC_RCV_RULE_9                  0x000004c8
00529 #define MAC_RCV_VALUE_9                 0x000004cc
00530 #define MAC_RCV_RULE_10                 0x000004d0
00531 #define MAC_RCV_VALUE_10                0x000004d4
00532 #define MAC_RCV_RULE_11                 0x000004d8
00533 #define MAC_RCV_VALUE_11                0x000004dc
00534 #define MAC_RCV_RULE_12                 0x000004e0
00535 #define MAC_RCV_VALUE_12                0x000004e4
00536 #define MAC_RCV_RULE_13                 0x000004e8
00537 #define MAC_RCV_VALUE_13                0x000004ec
00538 #define MAC_RCV_RULE_14                 0x000004f0
00539 #define MAC_RCV_VALUE_14                0x000004f4
00540 #define MAC_RCV_RULE_15                 0x000004f8
00541 #define MAC_RCV_VALUE_15                0x000004fc
00542 #define  RCV_RULE_DISABLE_MASK           0x7fffffff
00543 #define MAC_RCV_RULE_CFG                0x00000500
00544 #define  RCV_RULE_CFG_DEFAULT_CLASS     0x00000008
00545 #define MAC_LOW_WMARK_MAX_RX_FRAME      0x00000504
00546 /* 0x508 --> 0x520 unused */
00547 #define MAC_HASHREGU_0                  0x00000520
00548 #define MAC_HASHREGU_1                  0x00000524
00549 #define MAC_HASHREGU_2                  0x00000528
00550 #define MAC_HASHREGU_3                  0x0000052c
00551 #define MAC_EXTADDR_0_HIGH              0x00000530
00552 #define MAC_EXTADDR_0_LOW               0x00000534
00553 #define MAC_EXTADDR_1_HIGH              0x00000538
00554 #define MAC_EXTADDR_1_LOW               0x0000053c
00555 #define MAC_EXTADDR_2_HIGH              0x00000540
00556 #define MAC_EXTADDR_2_LOW               0x00000544
00557 #define MAC_EXTADDR_3_HIGH              0x00000548
00558 #define MAC_EXTADDR_3_LOW               0x0000054c
00559 #define MAC_EXTADDR_4_HIGH              0x00000550
00560 #define MAC_EXTADDR_4_LOW               0x00000554
00561 #define MAC_EXTADDR_5_HIGH              0x00000558
00562 #define MAC_EXTADDR_5_LOW               0x0000055c
00563 #define MAC_EXTADDR_6_HIGH              0x00000560
00564 #define MAC_EXTADDR_6_LOW               0x00000564
00565 #define MAC_EXTADDR_7_HIGH              0x00000568
00566 #define MAC_EXTADDR_7_LOW               0x0000056c
00567 #define MAC_EXTADDR_8_HIGH              0x00000570
00568 #define MAC_EXTADDR_8_LOW               0x00000574
00569 #define MAC_EXTADDR_9_HIGH              0x00000578
00570 #define MAC_EXTADDR_9_LOW               0x0000057c
00571 #define MAC_EXTADDR_10_HIGH             0x00000580
00572 #define MAC_EXTADDR_10_LOW              0x00000584
00573 #define MAC_EXTADDR_11_HIGH             0x00000588
00574 #define MAC_EXTADDR_11_LOW              0x0000058c
00575 #define MAC_SERDES_CFG                  0x00000590
00576 #define MAC_SERDES_STAT                 0x00000594
00577 /* 0x598 --> 0x600 unused */
00578 #define MAC_TX_MAC_STATE_BASE           0x00000600 /* 16 bytes */
00579 #define MAC_RX_MAC_STATE_BASE           0x00000610 /* 20 bytes */
00580 /* 0x624 --> 0x800 unused */
00581 #define MAC_TX_STATS_OCTETS             0x00000800
00582 #define MAC_TX_STATS_RESV1              0x00000804
00583 #define MAC_TX_STATS_COLLISIONS         0x00000808
00584 #define MAC_TX_STATS_XON_SENT           0x0000080c
00585 #define MAC_TX_STATS_XOFF_SENT          0x00000810
00586 #define MAC_TX_STATS_RESV2              0x00000814
00587 #define MAC_TX_STATS_MAC_ERRORS         0x00000818
00588 #define MAC_TX_STATS_SINGLE_COLLISIONS  0x0000081c
00589 #define MAC_TX_STATS_MULT_COLLISIONS    0x00000820
00590 #define MAC_TX_STATS_DEFERRED           0x00000824
00591 #define MAC_TX_STATS_RESV3              0x00000828
00592 #define MAC_TX_STATS_EXCESSIVE_COL      0x0000082c
00593 #define MAC_TX_STATS_LATE_COL           0x00000830
00594 #define MAC_TX_STATS_RESV4_1            0x00000834
00595 #define MAC_TX_STATS_RESV4_2            0x00000838
00596 #define MAC_TX_STATS_RESV4_3            0x0000083c
00597 #define MAC_TX_STATS_RESV4_4            0x00000840
00598 #define MAC_TX_STATS_RESV4_5            0x00000844
00599 #define MAC_TX_STATS_RESV4_6            0x00000848
00600 #define MAC_TX_STATS_RESV4_7            0x0000084c
00601 #define MAC_TX_STATS_RESV4_8            0x00000850
00602 #define MAC_TX_STATS_RESV4_9            0x00000854
00603 #define MAC_TX_STATS_RESV4_10           0x00000858
00604 #define MAC_TX_STATS_RESV4_11           0x0000085c
00605 #define MAC_TX_STATS_RESV4_12           0x00000860
00606 #define MAC_TX_STATS_RESV4_13           0x00000864
00607 #define MAC_TX_STATS_RESV4_14           0x00000868
00608 #define MAC_TX_STATS_UCAST              0x0000086c
00609 #define MAC_TX_STATS_MCAST              0x00000870
00610 #define MAC_TX_STATS_BCAST              0x00000874
00611 #define MAC_TX_STATS_RESV5_1            0x00000878
00612 #define MAC_TX_STATS_RESV5_2            0x0000087c
00613 #define MAC_RX_STATS_OCTETS             0x00000880
00614 #define MAC_RX_STATS_RESV1              0x00000884
00615 #define MAC_RX_STATS_FRAGMENTS          0x00000888
00616 #define MAC_RX_STATS_UCAST              0x0000088c
00617 #define MAC_RX_STATS_MCAST              0x00000890
00618 #define MAC_RX_STATS_BCAST              0x00000894
00619 #define MAC_RX_STATS_FCS_ERRORS         0x00000898
00620 #define MAC_RX_STATS_ALIGN_ERRORS       0x0000089c
00621 #define MAC_RX_STATS_XON_PAUSE_RECVD    0x000008a0
00622 #define MAC_RX_STATS_XOFF_PAUSE_RECVD   0x000008a4
00623 #define MAC_RX_STATS_MAC_CTRL_RECVD     0x000008a8
00624 #define MAC_RX_STATS_XOFF_ENTERED       0x000008ac
00625 #define MAC_RX_STATS_FRAME_TOO_LONG     0x000008b0
00626 #define MAC_RX_STATS_JABBERS            0x000008b4
00627 #define MAC_RX_STATS_UNDERSIZE          0x000008b8
00628 /* 0x8bc --> 0xc00 unused */
00629 
00630 /* Send data initiator control registers */
00631 #define SNDDATAI_MODE                   0x00000c00
00632 #define  SNDDATAI_MODE_RESET             0x00000001
00633 #define  SNDDATAI_MODE_ENABLE            0x00000002
00634 #define  SNDDATAI_MODE_STAT_OFLOW_ENAB   0x00000004
00635 #define SNDDATAI_STATUS                 0x00000c04
00636 #define  SNDDATAI_STATUS_STAT_OFLOW      0x00000004
00637 #define SNDDATAI_STATSCTRL              0x00000c08
00638 #define  SNDDATAI_SCTRL_ENABLE           0x00000001
00639 #define  SNDDATAI_SCTRL_FASTUPD          0x00000002
00640 #define  SNDDATAI_SCTRL_CLEAR            0x00000004
00641 #define  SNDDATAI_SCTRL_FLUSH            0x00000008
00642 #define  SNDDATAI_SCTRL_FORCE_ZERO       0x00000010
00643 #define SNDDATAI_STATSENAB              0x00000c0c
00644 #define SNDDATAI_STATSINCMASK           0x00000c10
00645 /* 0xc14 --> 0xc80 unused */
00646 #define SNDDATAI_COS_CNT_0              0x00000c80
00647 #define SNDDATAI_COS_CNT_1              0x00000c84
00648 #define SNDDATAI_COS_CNT_2              0x00000c88
00649 #define SNDDATAI_COS_CNT_3              0x00000c8c
00650 #define SNDDATAI_COS_CNT_4              0x00000c90
00651 #define SNDDATAI_COS_CNT_5              0x00000c94
00652 #define SNDDATAI_COS_CNT_6              0x00000c98
00653 #define SNDDATAI_COS_CNT_7              0x00000c9c
00654 #define SNDDATAI_COS_CNT_8              0x00000ca0
00655 #define SNDDATAI_COS_CNT_9              0x00000ca4
00656 #define SNDDATAI_COS_CNT_10             0x00000ca8
00657 #define SNDDATAI_COS_CNT_11             0x00000cac
00658 #define SNDDATAI_COS_CNT_12             0x00000cb0
00659 #define SNDDATAI_COS_CNT_13             0x00000cb4
00660 #define SNDDATAI_COS_CNT_14             0x00000cb8
00661 #define SNDDATAI_COS_CNT_15             0x00000cbc
00662 #define SNDDATAI_DMA_RDQ_FULL_CNT       0x00000cc0
00663 #define SNDDATAI_DMA_PRIO_RDQ_FULL_CNT  0x00000cc4
00664 #define SNDDATAI_SDCQ_FULL_CNT          0x00000cc8
00665 #define SNDDATAI_NICRNG_SSND_PIDX_CNT   0x00000ccc
00666 #define SNDDATAI_STATS_UPDATED_CNT      0x00000cd0
00667 #define SNDDATAI_INTERRUPTS_CNT         0x00000cd4
00668 #define SNDDATAI_AVOID_INTERRUPTS_CNT   0x00000cd8
00669 #define SNDDATAI_SND_THRESH_HIT_CNT     0x00000cdc
00670 /* 0xce0 --> 0x1000 unused */
00671 
00672 /* Send data completion control registers */
00673 #define SNDDATAC_MODE                   0x00001000
00674 #define  SNDDATAC_MODE_RESET             0x00000001
00675 #define  SNDDATAC_MODE_ENABLE            0x00000002
00676 /* 0x1004 --> 0x1400 unused */
00677 
00678 /* Send BD ring selector */
00679 #define SNDBDS_MODE                     0x00001400
00680 #define  SNDBDS_MODE_RESET               0x00000001
00681 #define  SNDBDS_MODE_ENABLE              0x00000002
00682 #define  SNDBDS_MODE_ATTN_ENABLE         0x00000004
00683 #define SNDBDS_STATUS                   0x00001404
00684 #define  SNDBDS_STATUS_ERROR_ATTN        0x00000004
00685 #define SNDBDS_HWDIAG                   0x00001408
00686 /* 0x140c --> 0x1440 */
00687 #define SNDBDS_SEL_CON_IDX_0            0x00001440
00688 #define SNDBDS_SEL_CON_IDX_1            0x00001444
00689 #define SNDBDS_SEL_CON_IDX_2            0x00001448
00690 #define SNDBDS_SEL_CON_IDX_3            0x0000144c
00691 #define SNDBDS_SEL_CON_IDX_4            0x00001450
00692 #define SNDBDS_SEL_CON_IDX_5            0x00001454
00693 #define SNDBDS_SEL_CON_IDX_6            0x00001458
00694 #define SNDBDS_SEL_CON_IDX_7            0x0000145c
00695 #define SNDBDS_SEL_CON_IDX_8            0x00001460
00696 #define SNDBDS_SEL_CON_IDX_9            0x00001464
00697 #define SNDBDS_SEL_CON_IDX_10           0x00001468
00698 #define SNDBDS_SEL_CON_IDX_11           0x0000146c
00699 #define SNDBDS_SEL_CON_IDX_12           0x00001470
00700 #define SNDBDS_SEL_CON_IDX_13           0x00001474
00701 #define SNDBDS_SEL_CON_IDX_14           0x00001478
00702 #define SNDBDS_SEL_CON_IDX_15           0x0000147c
00703 /* 0x1480 --> 0x1800 unused */
00704 
00705 /* Send BD initiator control registers */
00706 #define SNDBDI_MODE                     0x00001800
00707 #define  SNDBDI_MODE_RESET               0x00000001
00708 #define  SNDBDI_MODE_ENABLE              0x00000002
00709 #define  SNDBDI_MODE_ATTN_ENABLE         0x00000004
00710 #define SNDBDI_STATUS                   0x00001804
00711 #define  SNDBDI_STATUS_ERROR_ATTN        0x00000004
00712 #define SNDBDI_IN_PROD_IDX_0            0x00001808
00713 #define SNDBDI_IN_PROD_IDX_1            0x0000180c
00714 #define SNDBDI_IN_PROD_IDX_2            0x00001810
00715 #define SNDBDI_IN_PROD_IDX_3            0x00001814
00716 #define SNDBDI_IN_PROD_IDX_4            0x00001818
00717 #define SNDBDI_IN_PROD_IDX_5            0x0000181c
00718 #define SNDBDI_IN_PROD_IDX_6            0x00001820
00719 #define SNDBDI_IN_PROD_IDX_7            0x00001824
00720 #define SNDBDI_IN_PROD_IDX_8            0x00001828
00721 #define SNDBDI_IN_PROD_IDX_9            0x0000182c
00722 #define SNDBDI_IN_PROD_IDX_10           0x00001830
00723 #define SNDBDI_IN_PROD_IDX_11           0x00001834
00724 #define SNDBDI_IN_PROD_IDX_12           0x00001838
00725 #define SNDBDI_IN_PROD_IDX_13           0x0000183c
00726 #define SNDBDI_IN_PROD_IDX_14           0x00001840
00727 #define SNDBDI_IN_PROD_IDX_15           0x00001844
00728 /* 0x1848 --> 0x1c00 unused */
00729 
00730 /* Send BD completion control registers */
00731 #define SNDBDC_MODE                     0x00001c00
00732 #define SNDBDC_MODE_RESET                0x00000001
00733 #define SNDBDC_MODE_ENABLE               0x00000002
00734 #define SNDBDC_MODE_ATTN_ENABLE          0x00000004
00735 /* 0x1c04 --> 0x2000 unused */
00736 
00737 /* Receive list placement control registers */
00738 #define RCVLPC_MODE                     0x00002000
00739 #define  RCVLPC_MODE_RESET               0x00000001
00740 #define  RCVLPC_MODE_ENABLE              0x00000002
00741 #define  RCVLPC_MODE_CLASS0_ATTN_ENAB    0x00000004
00742 #define  RCVLPC_MODE_MAPOOR_AATTN_ENAB   0x00000008
00743 #define  RCVLPC_MODE_STAT_OFLOW_ENAB     0x00000010
00744 #define RCVLPC_STATUS                   0x00002004
00745 #define  RCVLPC_STATUS_CLASS0            0x00000004
00746 #define  RCVLPC_STATUS_MAPOOR            0x00000008
00747 #define  RCVLPC_STATUS_STAT_OFLOW        0x00000010
00748 #define RCVLPC_LOCK                     0x00002008
00749 #define  RCVLPC_LOCK_REQ_MASK            0x0000ffff
00750 #define  RCVLPC_LOCK_REQ_SHIFT           0
00751 #define  RCVLPC_LOCK_GRANT_MASK          0xffff0000
00752 #define  RCVLPC_LOCK_GRANT_SHIFT         16
00753 #define RCVLPC_NON_EMPTY_BITS           0x0000200c
00754 #define  RCVLPC_NON_EMPTY_BITS_MASK      0x0000ffff
00755 #define RCVLPC_CONFIG                   0x00002010
00756 #define RCVLPC_STATSCTRL                0x00002014
00757 #define  RCVLPC_STATSCTRL_ENABLE         0x00000001
00758 #define  RCVLPC_STATSCTRL_FASTUPD        0x00000002
00759 #define RCVLPC_STATS_ENABLE             0x00002018
00760 #define  RCVLPC_STATSENAB_LNGBRST_RFIX   0x00400000
00761 #define RCVLPC_STATS_INCMASK            0x0000201c
00762 /* 0x2020 --> 0x2100 unused */
00763 #define RCVLPC_SELLST_BASE              0x00002100 /* 16 16-byte entries */
00764 #define  SELLST_TAIL                    0x00000004
00765 #define  SELLST_CONT                    0x00000008
00766 #define  SELLST_UNUSED                  0x0000000c
00767 #define RCVLPC_COS_CNTL_BASE            0x00002200 /* 16 4-byte entries */
00768 #define RCVLPC_DROP_FILTER_CNT          0x00002240
00769 #define RCVLPC_DMA_WQ_FULL_CNT          0x00002244
00770 #define RCVLPC_DMA_HIPRIO_WQ_FULL_CNT   0x00002248
00771 #define RCVLPC_NO_RCV_BD_CNT            0x0000224c
00772 #define RCVLPC_IN_DISCARDS_CNT          0x00002250
00773 #define RCVLPC_IN_ERRORS_CNT            0x00002254
00774 #define RCVLPC_RCV_THRESH_HIT_CNT       0x00002258
00775 /* 0x225c --> 0x2400 unused */
00776 
00777 /* Receive Data and Receive BD Initiator Control */
00778 #define RCVDBDI_MODE                    0x00002400
00779 #define  RCVDBDI_MODE_RESET              0x00000001
00780 #define  RCVDBDI_MODE_ENABLE             0x00000002
00781 #define  RCVDBDI_MODE_JUMBOBD_NEEDED     0x00000004
00782 #define  RCVDBDI_MODE_FRM_TOO_BIG        0x00000008
00783 #define  RCVDBDI_MODE_INV_RING_SZ        0x00000010
00784 #define RCVDBDI_STATUS                  0x00002404
00785 #define  RCVDBDI_STATUS_JUMBOBD_NEEDED   0x00000004
00786 #define  RCVDBDI_STATUS_FRM_TOO_BIG      0x00000008
00787 #define  RCVDBDI_STATUS_INV_RING_SZ      0x00000010
00788 #define RCVDBDI_SPLIT_FRAME_MINSZ       0x00002408
00789 /* 0x240c --> 0x2440 unused */
00790 #define RCVDBDI_JUMBO_BD                0x00002440 /* TG3_BDINFO_... */
00791 #define RCVDBDI_STD_BD                  0x00002450 /* TG3_BDINFO_... */
00792 #define RCVDBDI_MINI_BD                 0x00002460 /* TG3_BDINFO_... */
00793 #define RCVDBDI_JUMBO_CON_IDX           0x00002470
00794 #define RCVDBDI_STD_CON_IDX             0x00002474
00795 #define RCVDBDI_MINI_CON_IDX            0x00002478
00796 /* 0x247c --> 0x2480 unused */
00797 #define RCVDBDI_BD_PROD_IDX_0           0x00002480
00798 #define RCVDBDI_BD_PROD_IDX_1           0x00002484
00799 #define RCVDBDI_BD_PROD_IDX_2           0x00002488
00800 #define RCVDBDI_BD_PROD_IDX_3           0x0000248c
00801 #define RCVDBDI_BD_PROD_IDX_4           0x00002490
00802 #define RCVDBDI_BD_PROD_IDX_5           0x00002494
00803 #define RCVDBDI_BD_PROD_IDX_6           0x00002498
00804 #define RCVDBDI_BD_PROD_IDX_7           0x0000249c
00805 #define RCVDBDI_BD_PROD_IDX_8           0x000024a0
00806 #define RCVDBDI_BD_PROD_IDX_9           0x000024a4
00807 #define RCVDBDI_BD_PROD_IDX_10          0x000024a8
00808 #define RCVDBDI_BD_PROD_IDX_11          0x000024ac
00809 #define RCVDBDI_BD_PROD_IDX_12          0x000024b0
00810 #define RCVDBDI_BD_PROD_IDX_13          0x000024b4
00811 #define RCVDBDI_BD_PROD_IDX_14          0x000024b8
00812 #define RCVDBDI_BD_PROD_IDX_15          0x000024bc
00813 #define RCVDBDI_HWDIAG                  0x000024c0
00814 /* 0x24c4 --> 0x2800 unused */
00815 
00816 /* Receive Data Completion Control */
00817 #define RCVDCC_MODE                     0x00002800
00818 #define  RCVDCC_MODE_RESET               0x00000001
00819 #define  RCVDCC_MODE_ENABLE              0x00000002
00820 #define  RCVDCC_MODE_ATTN_ENABLE         0x00000004
00821 /* 0x2804 --> 0x2c00 unused */
00822 
00823 /* Receive BD Initiator Control Registers */
00824 #define RCVBDI_MODE                     0x00002c00
00825 #define  RCVBDI_MODE_RESET               0x00000001
00826 #define  RCVBDI_MODE_ENABLE              0x00000002
00827 #define  RCVBDI_MODE_RCB_ATTN_ENAB       0x00000004
00828 #define RCVBDI_STATUS                   0x00002c04
00829 #define  RCVBDI_STATUS_RCB_ATTN          0x00000004
00830 #define RCVBDI_JUMBO_PROD_IDX           0x00002c08
00831 #define RCVBDI_STD_PROD_IDX             0x00002c0c
00832 #define RCVBDI_MINI_PROD_IDX            0x00002c10
00833 #define RCVBDI_MINI_THRESH              0x00002c14
00834 #define RCVBDI_STD_THRESH               0x00002c18
00835 #define RCVBDI_JUMBO_THRESH             0x00002c1c
00836 /* 0x2c20 --> 0x3000 unused */
00837 
00838 /* Receive BD Completion Control Registers */
00839 #define RCVCC_MODE                      0x00003000
00840 #define  RCVCC_MODE_RESET                0x00000001
00841 #define  RCVCC_MODE_ENABLE               0x00000002
00842 #define  RCVCC_MODE_ATTN_ENABLE          0x00000004
00843 #define RCVCC_STATUS                    0x00003004
00844 #define  RCVCC_STATUS_ERROR_ATTN         0x00000004
00845 #define RCVCC_JUMP_PROD_IDX             0x00003008
00846 #define RCVCC_STD_PROD_IDX              0x0000300c
00847 #define RCVCC_MINI_PROD_IDX             0x00003010
00848 /* 0x3014 --> 0x3400 unused */
00849 
00850 /* Receive list selector control registers */
00851 #define RCVLSC_MODE                     0x00003400
00852 #define  RCVLSC_MODE_RESET               0x00000001
00853 #define  RCVLSC_MODE_ENABLE              0x00000002
00854 #define  RCVLSC_MODE_ATTN_ENABLE         0x00000004
00855 #define RCVLSC_STATUS                   0x00003404
00856 #define  RCVLSC_STATUS_ERROR_ATTN        0x00000004
00857 /* 0x3408 --> 0x3800 unused */
00858 
00859 /* Mbuf cluster free registers */
00860 #define MBFREE_MODE                     0x00003800
00861 #define  MBFREE_MODE_RESET               0x00000001
00862 #define  MBFREE_MODE_ENABLE              0x00000002
00863 #define MBFREE_STATUS                   0x00003804
00864 /* 0x3808 --> 0x3c00 unused */
00865 
00866 /* Host coalescing control registers */
00867 #define HOSTCC_MODE                     0x00003c00
00868 #define  HOSTCC_MODE_RESET               0x00000001
00869 #define  HOSTCC_MODE_ENABLE              0x00000002
00870 #define  HOSTCC_MODE_ATTN                0x00000004
00871 #define  HOSTCC_MODE_NOW                 0x00000008
00872 #define  HOSTCC_MODE_FULL_STATUS         0x00000000
00873 #define  HOSTCC_MODE_64BYTE              0x00000080
00874 #define  HOSTCC_MODE_32BYTE              0x00000100
00875 #define  HOSTCC_MODE_CLRTICK_RXBD        0x00000200
00876 #define  HOSTCC_MODE_CLRTICK_TXBD        0x00000400
00877 #define  HOSTCC_MODE_NOINT_ON_NOW        0x00000800
00878 #define  HOSTCC_MODE_NOINT_ON_FORCE      0x00001000
00879 #define HOSTCC_STATUS                   0x00003c04
00880 #define  HOSTCC_STATUS_ERROR_ATTN        0x00000004
00881 #define HOSTCC_RXCOL_TICKS              0x00003c08
00882 #define  LOW_RXCOL_TICKS                 0x00000032
00883 #define  DEFAULT_RXCOL_TICKS             0x00000048
00884 #define  HIGH_RXCOL_TICKS                0x00000096
00885 #define HOSTCC_TXCOL_TICKS              0x00003c0c
00886 #define  LOW_TXCOL_TICKS                 0x00000096
00887 #define  DEFAULT_TXCOL_TICKS             0x0000012c
00888 #define  HIGH_TXCOL_TICKS                0x00000145
00889 #define HOSTCC_RXMAX_FRAMES             0x00003c10
00890 #define  LOW_RXMAX_FRAMES                0x00000005
00891 #define  DEFAULT_RXMAX_FRAMES            0x00000008
00892 #define  HIGH_RXMAX_FRAMES               0x00000012
00893 #define HOSTCC_TXMAX_FRAMES             0x00003c14
00894 #define  LOW_TXMAX_FRAMES                0x00000035
00895 #define  DEFAULT_TXMAX_FRAMES            0x0000004b
00896 #define  HIGH_TXMAX_FRAMES               0x00000052
00897 #define HOSTCC_RXCOAL_TICK_INT          0x00003c18
00898 #define  DEFAULT_RXCOAL_TICK_INT         0x00000019
00899 #define HOSTCC_TXCOAL_TICK_INT          0x00003c1c
00900 #define  DEFAULT_TXCOAL_TICK_INT         0x00000019
00901 #define HOSTCC_RXCOAL_MAXF_INT          0x00003c20
00902 #define  DEFAULT_RXCOAL_MAXF_INT         0x00000005
00903 #define HOSTCC_TXCOAL_MAXF_INT          0x00003c24
00904 #define  DEFAULT_TXCOAL_MAXF_INT         0x00000005
00905 #define HOSTCC_STAT_COAL_TICKS          0x00003c28
00906 #define  DEFAULT_STAT_COAL_TICKS         0x000f4240
00907 /* 0x3c2c --> 0x3c30 unused */
00908 #define HOSTCC_STATS_BLK_HOST_ADDR      0x00003c30 /* 64-bit */
00909 #define HOSTCC_STATUS_BLK_HOST_ADDR     0x00003c38 /* 64-bit */
00910 #define HOSTCC_STATS_BLK_NIC_ADDR       0x00003c40
00911 #define HOSTCC_STATUS_BLK_NIC_ADDR      0x00003c44
00912 #define HOSTCC_FLOW_ATTN                0x00003c48
00913 /* 0x3c4c --> 0x3c50 unused */
00914 #define HOSTCC_JUMBO_CON_IDX            0x00003c50
00915 #define HOSTCC_STD_CON_IDX              0x00003c54
00916 #define HOSTCC_MINI_CON_IDX             0x00003c58
00917 /* 0x3c5c --> 0x3c80 unused */
00918 #define HOSTCC_RET_PROD_IDX_0           0x00003c80
00919 #define HOSTCC_RET_PROD_IDX_1           0x00003c84
00920 #define HOSTCC_RET_PROD_IDX_2           0x00003c88
00921 #define HOSTCC_RET_PROD_IDX_3           0x00003c8c
00922 #define HOSTCC_RET_PROD_IDX_4           0x00003c90
00923 #define HOSTCC_RET_PROD_IDX_5           0x00003c94
00924 #define HOSTCC_RET_PROD_IDX_6           0x00003c98
00925 #define HOSTCC_RET_PROD_IDX_7           0x00003c9c
00926 #define HOSTCC_RET_PROD_IDX_8           0x00003ca0
00927 #define HOSTCC_RET_PROD_IDX_9           0x00003ca4
00928 #define HOSTCC_RET_PROD_IDX_10          0x00003ca8
00929 #define HOSTCC_RET_PROD_IDX_11          0x00003cac
00930 #define HOSTCC_RET_PROD_IDX_12          0x00003cb0
00931 #define HOSTCC_RET_PROD_IDX_13          0x00003cb4
00932 #define HOSTCC_RET_PROD_IDX_14          0x00003cb8
00933 #define HOSTCC_RET_PROD_IDX_15          0x00003cbc
00934 #define HOSTCC_SND_CON_IDX_0            0x00003cc0
00935 #define HOSTCC_SND_CON_IDX_1            0x00003cc4
00936 #define HOSTCC_SND_CON_IDX_2            0x00003cc8
00937 #define HOSTCC_SND_CON_IDX_3            0x00003ccc
00938 #define HOSTCC_SND_CON_IDX_4            0x00003cd0
00939 #define HOSTCC_SND_CON_IDX_5            0x00003cd4
00940 #define HOSTCC_SND_CON_IDX_6            0x00003cd8
00941 #define HOSTCC_SND_CON_IDX_7            0x00003cdc
00942 #define HOSTCC_SND_CON_IDX_8            0x00003ce0
00943 #define HOSTCC_SND_CON_IDX_9            0x00003ce4
00944 #define HOSTCC_SND_CON_IDX_10           0x00003ce8
00945 #define HOSTCC_SND_CON_IDX_11           0x00003cec
00946 #define HOSTCC_SND_CON_IDX_12           0x00003cf0
00947 #define HOSTCC_SND_CON_IDX_13           0x00003cf4
00948 #define HOSTCC_SND_CON_IDX_14           0x00003cf8
00949 #define HOSTCC_SND_CON_IDX_15           0x00003cfc
00950 /* 0x3d00 --> 0x4000 unused */
00951 
00952 /* Memory arbiter control registers */
00953 #define MEMARB_MODE                     0x00004000
00954 #define  MEMARB_MODE_RESET               0x00000001
00955 #define  MEMARB_MODE_ENABLE              0x00000002
00956 #define MEMARB_STATUS                   0x00004004
00957 #define MEMARB_TRAP_ADDR_LOW            0x00004008
00958 #define MEMARB_TRAP_ADDR_HIGH           0x0000400c
00959 /* 0x4010 --> 0x4400 unused */
00960 
00961 /* Buffer manager control registers */
00962 #define BUFMGR_MODE                     0x00004400
00963 #define  BUFMGR_MODE_RESET               0x00000001
00964 #define  BUFMGR_MODE_ENABLE              0x00000002
00965 #define  BUFMGR_MODE_ATTN_ENABLE         0x00000004
00966 #define  BUFMGR_MODE_BM_TEST             0x00000008
00967 #define  BUFMGR_MODE_MBLOW_ATTN_ENAB     0x00000010
00968 #define BUFMGR_STATUS                   0x00004404
00969 #define  BUFMGR_STATUS_ERROR             0x00000004
00970 #define  BUFMGR_STATUS_MBLOW             0x00000010
00971 #define BUFMGR_MB_POOL_ADDR             0x00004408
00972 #define BUFMGR_MB_POOL_SIZE             0x0000440c
00973 #define BUFMGR_MB_RDMA_LOW_WATER        0x00004410
00974 #define  DEFAULT_MB_RDMA_LOW_WATER       0x00000050
00975 #define  DEFAULT_MB_RDMA_LOW_WATER_5705  0x00000000
00976 #define  DEFAULT_MB_RDMA_LOW_WATER_JUMBO 0x00000130
00977 #define BUFMGR_MB_MACRX_LOW_WATER       0x00004414
00978 #define  DEFAULT_MB_MACRX_LOW_WATER       0x00000020
00979 #define  DEFAULT_MB_MACRX_LOW_WATER_5705  0x00000010
00980 #define  DEFAULT_MB_MACRX_LOW_WATER_JUMBO 0x00000098
00981 #define BUFMGR_MB_HIGH_WATER            0x00004418
00982 #define  DEFAULT_MB_HIGH_WATER           0x00000060
00983 #define  DEFAULT_MB_HIGH_WATER_5705      0x00000060
00984 #define  DEFAULT_MB_HIGH_WATER_JUMBO     0x0000017c
00985 #define BUFMGR_RX_MB_ALLOC_REQ          0x0000441c
00986 #define  BUFMGR_MB_ALLOC_BIT             0x10000000
00987 #define BUFMGR_RX_MB_ALLOC_RESP         0x00004420
00988 #define BUFMGR_TX_MB_ALLOC_REQ          0x00004424
00989 #define BUFMGR_TX_MB_ALLOC_RESP         0x00004428
00990 #define BUFMGR_DMA_DESC_POOL_ADDR       0x0000442c
00991 #define BUFMGR_DMA_DESC_POOL_SIZE       0x00004430
00992 #define BUFMGR_DMA_LOW_WATER            0x00004434
00993 #define  DEFAULT_DMA_LOW_WATER           0x00000005
00994 #define BUFMGR_DMA_HIGH_WATER           0x00004438
00995 #define  DEFAULT_DMA_HIGH_WATER          0x0000000a
00996 #define BUFMGR_RX_DMA_ALLOC_REQ         0x0000443c
00997 #define BUFMGR_RX_DMA_ALLOC_RESP        0x00004440
00998 #define BUFMGR_TX_DMA_ALLOC_REQ         0x00004444
00999 #define BUFMGR_TX_DMA_ALLOC_RESP        0x00004448
01000 #define BUFMGR_HWDIAG_0                 0x0000444c
01001 #define BUFMGR_HWDIAG_1                 0x00004450
01002 #define BUFMGR_HWDIAG_2                 0x00004454
01003 /* 0x4458 --> 0x4800 unused */
01004 
01005 /* Read DMA control registers */
01006 #define RDMAC_MODE                      0x00004800
01007 #define  RDMAC_MODE_RESET                0x00000001
01008 #define  RDMAC_MODE_ENABLE               0x00000002
01009 #define  RDMAC_MODE_TGTABORT_ENAB        0x00000004
01010 #define  RDMAC_MODE_MSTABORT_ENAB        0x00000008
01011 #define  RDMAC_MODE_PARITYERR_ENAB       0x00000010
01012 #define  RDMAC_MODE_ADDROFLOW_ENAB       0x00000020
01013 #define  RDMAC_MODE_FIFOOFLOW_ENAB       0x00000040
01014 #define  RDMAC_MODE_FIFOURUN_ENAB        0x00000080
01015 #define  RDMAC_MODE_FIFOOREAD_ENAB       0x00000100
01016 #define  RDMAC_MODE_LNGREAD_ENAB         0x00000200
01017 #define  RDMAC_MODE_SPLIT_ENABLE         0x00000800
01018 #define  RDMAC_MODE_SPLIT_RESET          0x00001000
01019 #define  RDMAC_MODE_FIFO_SIZE_128        0x00020000
01020 #define  RDMAC_MODE_FIFO_LONG_BURST      0x00030000
01021 #define RDMAC_STATUS                    0x00004804
01022 #define  RDMAC_STATUS_TGTABORT           0x00000004
01023 #define  RDMAC_STATUS_MSTABORT           0x00000008
01024 #define  RDMAC_STATUS_PARITYERR          0x00000010
01025 #define  RDMAC_STATUS_ADDROFLOW          0x00000020
01026 #define  RDMAC_STATUS_FIFOOFLOW          0x00000040
01027 #define  RDMAC_STATUS_FIFOURUN           0x00000080
01028 #define  RDMAC_STATUS_FIFOOREAD          0x00000100
01029 #define  RDMAC_STATUS_LNGREAD            0x00000200
01030 /* 0x4808 --> 0x4c00 unused */
01031 
01032 /* Write DMA control registers */
01033 #define WDMAC_MODE                      0x00004c00
01034 #define  WDMAC_MODE_RESET                0x00000001
01035 #define  WDMAC_MODE_ENABLE               0x00000002
01036 #define  WDMAC_MODE_TGTABORT_ENAB        0x00000004
01037 #define  WDMAC_MODE_MSTABORT_ENAB        0x00000008
01038 #define  WDMAC_MODE_PARITYERR_ENAB       0x00000010
01039 #define  WDMAC_MODE_ADDROFLOW_ENAB       0x00000020
01040 #define  WDMAC_MODE_FIFOOFLOW_ENAB       0x00000040
01041 #define  WDMAC_MODE_FIFOURUN_ENAB        0x00000080
01042 #define  WDMAC_MODE_FIFOOREAD_ENAB       0x00000100
01043 #define  WDMAC_MODE_LNGREAD_ENAB         0x00000200
01044 #define  WDMAC_MODE_RX_ACCEL             0x00000400
01045 #define WDMAC_STATUS                    0x00004c04
01046 #define  WDMAC_STATUS_TGTABORT           0x00000004
01047 #define  WDMAC_STATUS_MSTABORT           0x00000008
01048 #define  WDMAC_STATUS_PARITYERR          0x00000010
01049 #define  WDMAC_STATUS_ADDROFLOW          0x00000020
01050 #define  WDMAC_STATUS_FIFOOFLOW          0x00000040
01051 #define  WDMAC_STATUS_FIFOURUN           0x00000080
01052 #define  WDMAC_STATUS_FIFOOREAD          0x00000100
01053 #define  WDMAC_STATUS_LNGREAD            0x00000200
01054 /* 0x4c08 --> 0x5000 unused */
01055 
01056 /* Per-cpu register offsets (arm9) */
01057 #define CPU_MODE                        0x00000000
01058 #define  CPU_MODE_RESET                  0x00000001
01059 #define  CPU_MODE_HALT                   0x00000400
01060 #define CPU_STATE                       0x00000004
01061 #define CPU_EVTMASK                     0x00000008
01062 /* 0xc --> 0x1c reserved */
01063 #define CPU_PC                          0x0000001c
01064 #define CPU_INSN                        0x00000020
01065 #define CPU_SPAD_UFLOW                  0x00000024
01066 #define CPU_WDOG_CLEAR                  0x00000028
01067 #define CPU_WDOG_VECTOR                 0x0000002c
01068 #define CPU_WDOG_PC                     0x00000030
01069 #define CPU_HW_BP                       0x00000034
01070 /* 0x38 --> 0x44 unused */
01071 #define CPU_WDOG_SAVED_STATE            0x00000044
01072 #define CPU_LAST_BRANCH_ADDR            0x00000048
01073 #define CPU_SPAD_UFLOW_SET              0x0000004c
01074 /* 0x50 --> 0x200 unused */
01075 #define CPU_R0                          0x00000200
01076 #define CPU_R1                          0x00000204
01077 #define CPU_R2                          0x00000208
01078 #define CPU_R3                          0x0000020c
01079 #define CPU_R4                          0x00000210
01080 #define CPU_R5                          0x00000214
01081 #define CPU_R6                          0x00000218
01082 #define CPU_R7                          0x0000021c
01083 #define CPU_R8                          0x00000220
01084 #define CPU_R9                          0x00000224
01085 #define CPU_R10                         0x00000228
01086 #define CPU_R11                         0x0000022c
01087 #define CPU_R12                         0x00000230
01088 #define CPU_R13                         0x00000234
01089 #define CPU_R14                         0x00000238
01090 #define CPU_R15                         0x0000023c
01091 #define CPU_R16                         0x00000240
01092 #define CPU_R17                         0x00000244
01093 #define CPU_R18                         0x00000248
01094 #define CPU_R19                         0x0000024c
01095 #define CPU_R20                         0x00000250
01096 #define CPU_R21                         0x00000254
01097 #define CPU_R22                         0x00000258
01098 #define CPU_R23                         0x0000025c
01099 #define CPU_R24                         0x00000260
01100 #define CPU_R25                         0x00000264
01101 #define CPU_R26                         0x00000268
01102 #define CPU_R27                         0x0000026c
01103 #define CPU_R28                         0x00000270
01104 #define CPU_R29                         0x00000274
01105 #define CPU_R30                         0x00000278
01106 #define CPU_R31                         0x0000027c
01107 /* 0x280 --> 0x400 unused */
01108 
01109 #define RX_CPU_BASE                     0x00005000
01110 #define TX_CPU_BASE                     0x00005400
01111 
01112 /* Mailboxes */
01113 #define GRCMBOX_INTERRUPT_0             0x00005800 /* 64-bit */
01114 #define GRCMBOX_INTERRUPT_1             0x00005808 /* 64-bit */
01115 #define GRCMBOX_INTERRUPT_2             0x00005810 /* 64-bit */
01116 #define GRCMBOX_INTERRUPT_3             0x00005818 /* 64-bit */
01117 #define GRCMBOX_GENERAL_0               0x00005820 /* 64-bit */
01118 #define GRCMBOX_GENERAL_1               0x00005828 /* 64-bit */
01119 #define GRCMBOX_GENERAL_2               0x00005830 /* 64-bit */
01120 #define GRCMBOX_GENERAL_3               0x00005838 /* 64-bit */
01121 #define GRCMBOX_GENERAL_4               0x00005840 /* 64-bit */
01122 #define GRCMBOX_GENERAL_5               0x00005848 /* 64-bit */
01123 #define GRCMBOX_GENERAL_6               0x00005850 /* 64-bit */
01124 #define GRCMBOX_GENERAL_7               0x00005858 /* 64-bit */
01125 #define GRCMBOX_RELOAD_STAT             0x00005860 /* 64-bit */
01126 #define GRCMBOX_RCVSTD_PROD_IDX         0x00005868 /* 64-bit */
01127 #define GRCMBOX_RCVJUMBO_PROD_IDX       0x00005870 /* 64-bit */
01128 #define GRCMBOX_RCVMINI_PROD_IDX        0x00005878 /* 64-bit */
01129 #define GRCMBOX_RCVRET_CON_IDX_0        0x00005880 /* 64-bit */
01130 #define GRCMBOX_RCVRET_CON_IDX_1        0x00005888 /* 64-bit */
01131 #define GRCMBOX_RCVRET_CON_IDX_2        0x00005890 /* 64-bit */
01132 #define GRCMBOX_RCVRET_CON_IDX_3        0x00005898 /* 64-bit */
01133 #define GRCMBOX_RCVRET_CON_IDX_4        0x000058a0 /* 64-bit */
01134 #define GRCMBOX_RCVRET_CON_IDX_5        0x000058a8 /* 64-bit */
01135 #define GRCMBOX_RCVRET_CON_IDX_6        0x000058b0 /* 64-bit */
01136 #define GRCMBOX_RCVRET_CON_IDX_7        0x000058b8 /* 64-bit */
01137 #define GRCMBOX_RCVRET_CON_IDX_8        0x000058c0 /* 64-bit */
01138 #define GRCMBOX_RCVRET_CON_IDX_9        0x000058c8 /* 64-bit */
01139 #define GRCMBOX_RCVRET_CON_IDX_10       0x000058d0 /* 64-bit */
01140 #define GRCMBOX_RCVRET_CON_IDX_11       0x000058d8 /* 64-bit */
01141 #define GRCMBOX_RCVRET_CON_IDX_12       0x000058e0 /* 64-bit */
01142 #define GRCMBOX_RCVRET_CON_IDX_13       0x000058e8 /* 64-bit */
01143 #define GRCMBOX_RCVRET_CON_IDX_14       0x000058f0 /* 64-bit */
01144 #define GRCMBOX_RCVRET_CON_IDX_15       0x000058f8 /* 64-bit */
01145 #define GRCMBOX_SNDHOST_PROD_IDX_0      0x00005900 /* 64-bit */
01146 #define GRCMBOX_SNDHOST_PROD_IDX_1      0x00005908 /* 64-bit */
01147 #define GRCMBOX_SNDHOST_PROD_IDX_2      0x00005910 /* 64-bit */
01148 #define GRCMBOX_SNDHOST_PROD_IDX_3      0x00005918 /* 64-bit */
01149 #define GRCMBOX_SNDHOST_PROD_IDX_4      0x00005920 /* 64-bit */
01150 #define GRCMBOX_SNDHOST_PROD_IDX_5      0x00005928 /* 64-bit */
01151 #define GRCMBOX_SNDHOST_PROD_IDX_6      0x00005930 /* 64-bit */
01152 #define GRCMBOX_SNDHOST_PROD_IDX_7      0x00005938 /* 64-bit */
01153 #define GRCMBOX_SNDHOST_PROD_IDX_8      0x00005940 /* 64-bit */
01154 #define GRCMBOX_SNDHOST_PROD_IDX_9      0x00005948 /* 64-bit */
01155 #define GRCMBOX_SNDHOST_PROD_IDX_10     0x00005950 /* 64-bit */
01156 #define GRCMBOX_SNDHOST_PROD_IDX_11     0x00005958 /* 64-bit */
01157 #define GRCMBOX_SNDHOST_PROD_IDX_12     0x00005960 /* 64-bit */
01158 #define GRCMBOX_SNDHOST_PROD_IDX_13     0x00005968 /* 64-bit */
01159 #define GRCMBOX_SNDHOST_PROD_IDX_14     0x00005970 /* 64-bit */
01160 #define GRCMBOX_SNDHOST_PROD_IDX_15     0x00005978 /* 64-bit */
01161 #define GRCMBOX_SNDNIC_PROD_IDX_0       0x00005980 /* 64-bit */
01162 #define GRCMBOX_SNDNIC_PROD_IDX_1       0x00005988 /* 64-bit */
01163 #define GRCMBOX_SNDNIC_PROD_IDX_2       0x00005990 /* 64-bit */
01164 #define GRCMBOX_SNDNIC_PROD_IDX_3       0x00005998 /* 64-bit */
01165 #define GRCMBOX_SNDNIC_PROD_IDX_4       0x000059a0 /* 64-bit */
01166 #define GRCMBOX_SNDNIC_PROD_IDX_5       0x000059a8 /* 64-bit */
01167 #define GRCMBOX_SNDNIC_PROD_IDX_6       0x000059b0 /* 64-bit */
01168 #define GRCMBOX_SNDNIC_PROD_IDX_7       0x000059b8 /* 64-bit */
01169 #define GRCMBOX_SNDNIC_PROD_IDX_8       0x000059c0 /* 64-bit */
01170 #define GRCMBOX_SNDNIC_PROD_IDX_9       0x000059c8 /* 64-bit */
01171 #define GRCMBOX_SNDNIC_PROD_IDX_10      0x000059d0 /* 64-bit */
01172 #define GRCMBOX_SNDNIC_PROD_IDX_11      0x000059d8 /* 64-bit */
01173 #define GRCMBOX_SNDNIC_PROD_IDX_12      0x000059e0 /* 64-bit */
01174 #define GRCMBOX_SNDNIC_PROD_IDX_13      0x000059e8 /* 64-bit */
01175 #define GRCMBOX_SNDNIC_PROD_IDX_14      0x000059f0 /* 64-bit */
01176 #define GRCMBOX_SNDNIC_PROD_IDX_15      0x000059f8 /* 64-bit */
01177 #define GRCMBOX_HIGH_PRIO_EV_VECTOR     0x00005a00
01178 #define GRCMBOX_HIGH_PRIO_EV_MASK       0x00005a04
01179 #define GRCMBOX_LOW_PRIO_EV_VEC         0x00005a08
01180 #define GRCMBOX_LOW_PRIO_EV_MASK        0x00005a0c
01181 /* 0x5a10 --> 0x5c00 */
01182 
01183 /* Flow Through queues */
01184 #define FTQ_RESET                       0x00005c00
01185 #define FTQ_RESET_DMA_READ_QUEUE        (1 << 1)
01186 #define FTQ_RESET_DMA_HIGH_PRI_READ     (1 << 2)
01187 #define FTQ_RESET_SEND_BD_COMPLETION    (1 << 4)
01188 #define FTQ_RESET_DMA_WRITE             (1 << 6)
01189 #define FTQ_RESET_DMA_HIGH_PRI_WRITE    (1 << 7)
01190 #define FTQ_RESET_SEND_DATA_COMPLETION  (1 << 9)
01191 #define FTQ_RESET_HOST_COALESCING       (1 << 10)
01192 #define FTQ_RESET_MAC_TX                (1 << 11)
01193 #define FTQ_RESET_RX_BD_COMPLETE        (1 << 13)
01194 #define FTQ_RESET_RX_LIST_PLCMT         (1 << 14)
01195 #define FTQ_RESET_RX_DATA_COMPLETION    (1 << 16)
01196 /* 0x5c04 --> 0x5c10 unused */
01197 #define FTQ_DMA_NORM_READ_CTL           0x00005c10
01198 #define FTQ_DMA_NORM_READ_FULL_CNT      0x00005c14
01199 #define FTQ_DMA_NORM_READ_FIFO_ENQDEQ   0x00005c18
01200 #define FTQ_DMA_NORM_READ_WRITE_PEEK    0x00005c1c
01201 #define FTQ_DMA_HIGH_READ_CTL           0x00005c20
01202 #define FTQ_DMA_HIGH_READ_FULL_CNT      0x00005c24
01203 #define FTQ_DMA_HIGH_READ_FIFO_ENQDEQ   0x00005c28
01204 #define FTQ_DMA_HIGH_READ_WRITE_PEEK    0x00005c2c
01205 #define FTQ_DMA_COMP_DISC_CTL           0x00005c30
01206 #define FTQ_DMA_COMP_DISC_FULL_CNT      0x00005c34
01207 #define FTQ_DMA_COMP_DISC_FIFO_ENQDEQ   0x00005c38
01208 #define FTQ_DMA_COMP_DISC_WRITE_PEEK    0x00005c3c
01209 #define FTQ_SEND_BD_COMP_CTL            0x00005c40
01210 #define FTQ_SEND_BD_COMP_FULL_CNT       0x00005c44
01211 #define FTQ_SEND_BD_COMP_FIFO_ENQDEQ    0x00005c48
01212 #define FTQ_SEND_BD_COMP_WRITE_PEEK     0x00005c4c
01213 #define FTQ_SEND_DATA_INIT_CTL          0x00005c50
01214 #define FTQ_SEND_DATA_INIT_FULL_CNT     0x00005c54
01215 #define FTQ_SEND_DATA_INIT_FIFO_ENQDEQ  0x00005c58
01216 #define FTQ_SEND_DATA_INIT_WRITE_PEEK   0x00005c5c
01217 #define FTQ_DMA_NORM_WRITE_CTL          0x00005c60
01218 #define FTQ_DMA_NORM_WRITE_FULL_CNT     0x00005c64
01219 #define FTQ_DMA_NORM_WRITE_FIFO_ENQDEQ  0x00005c68
01220 #define FTQ_DMA_NORM_WRITE_WRITE_PEEK   0x00005c6c
01221 #define FTQ_DMA_HIGH_WRITE_CTL          0x00005c70
01222 #define FTQ_DMA_HIGH_WRITE_FULL_CNT     0x00005c74
01223 #define FTQ_DMA_HIGH_WRITE_FIFO_ENQDEQ  0x00005c78
01224 #define FTQ_DMA_HIGH_WRITE_WRITE_PEEK   0x00005c7c
01225 #define FTQ_SWTYPE1_CTL                 0x00005c80
01226 #define FTQ_SWTYPE1_FULL_CNT            0x00005c84
01227 #define FTQ_SWTYPE1_FIFO_ENQDEQ         0x00005c88
01228 #define FTQ_SWTYPE1_WRITE_PEEK          0x00005c8c
01229 #define FTQ_SEND_DATA_COMP_CTL          0x00005c90
01230 #define FTQ_SEND_DATA_COMP_FULL_CNT     0x00005c94
01231 #define FTQ_SEND_DATA_COMP_FIFO_ENQDEQ  0x00005c98
01232 #define FTQ_SEND_DATA_COMP_WRITE_PEEK   0x00005c9c
01233 #define FTQ_HOST_COAL_CTL               0x00005ca0
01234 #define FTQ_HOST_COAL_FULL_CNT          0x00005ca4
01235 #define FTQ_HOST_COAL_FIFO_ENQDEQ       0x00005ca8
01236 #define FTQ_HOST_COAL_WRITE_PEEK        0x00005cac
01237 #define FTQ_MAC_TX_CTL                  0x00005cb0
01238 #define FTQ_MAC_TX_FULL_CNT             0x00005cb4
01239 #define FTQ_MAC_TX_FIFO_ENQDEQ          0x00005cb8
01240 #define FTQ_MAC_TX_WRITE_PEEK           0x00005cbc
01241 #define FTQ_MB_FREE_CTL                 0x00005cc0
01242 #define FTQ_MB_FREE_FULL_CNT            0x00005cc4
01243 #define FTQ_MB_FREE_FIFO_ENQDEQ         0x00005cc8
01244 #define FTQ_MB_FREE_WRITE_PEEK          0x00005ccc
01245 #define FTQ_RCVBD_COMP_CTL              0x00005cd0
01246 #define FTQ_RCVBD_COMP_FULL_CNT         0x00005cd4
01247 #define FTQ_RCVBD_COMP_FIFO_ENQDEQ      0x00005cd8
01248 #define FTQ_RCVBD_COMP_WRITE_PEEK       0x00005cdc
01249 #define FTQ_RCVLST_PLMT_CTL             0x00005ce0
01250 #define FTQ_RCVLST_PLMT_FULL_CNT        0x00005ce4
01251 #define FTQ_RCVLST_PLMT_FIFO_ENQDEQ     0x00005ce8
01252 #define FTQ_RCVLST_PLMT_WRITE_PEEK      0x00005cec
01253 #define FTQ_RCVDATA_INI_CTL             0x00005cf0
01254 #define FTQ_RCVDATA_INI_FULL_CNT        0x00005cf4
01255 #define FTQ_RCVDATA_INI_FIFO_ENQDEQ     0x00005cf8
01256 #define FTQ_RCVDATA_INI_WRITE_PEEK      0x00005cfc
01257 #define FTQ_RCVDATA_COMP_CTL            0x00005d00
01258 #define FTQ_RCVDATA_COMP_FULL_CNT       0x00005d04
01259 #define FTQ_RCVDATA_COMP_FIFO_ENQDEQ    0x00005d08
01260 #define FTQ_RCVDATA_COMP_WRITE_PEEK     0x00005d0c
01261 #define FTQ_SWTYPE2_CTL                 0x00005d10
01262 #define FTQ_SWTYPE2_FULL_CNT            0x00005d14
01263 #define FTQ_SWTYPE2_FIFO_ENQDEQ         0x00005d18
01264 #define FTQ_SWTYPE2_WRITE_PEEK          0x00005d1c
01265 /* 0x5d20 --> 0x6000 unused */
01266 
01267 /* Message signaled interrupt registers */
01268 #define MSGINT_MODE                     0x00006000
01269 #define  MSGINT_MODE_RESET               0x00000001
01270 #define  MSGINT_MODE_ENABLE              0x00000002
01271 #define MSGINT_STATUS                   0x00006004
01272 #define MSGINT_FIFO                     0x00006008
01273 /* 0x600c --> 0x6400 unused */
01274 
01275 /* DMA completion registers */
01276 #define DMAC_MODE                       0x00006400
01277 #define  DMAC_MODE_RESET                 0x00000001
01278 #define  DMAC_MODE_ENABLE                0x00000002
01279 /* 0x6404 --> 0x6800 unused */
01280 
01281 /* GRC registers */
01282 #define GRC_MODE                        0x00006800
01283 #define  GRC_MODE_UPD_ON_COAL           0x00000001
01284 #define  GRC_MODE_BSWAP_NONFRM_DATA     0x00000002
01285 #define  GRC_MODE_WSWAP_NONFRM_DATA     0x00000004
01286 #define  GRC_MODE_BSWAP_DATA            0x00000010
01287 #define  GRC_MODE_WSWAP_DATA            0x00000020
01288 #define  GRC_MODE_SPLITHDR              0x00000100
01289 #define  GRC_MODE_NOFRM_CRACKING        0x00000200
01290 #define  GRC_MODE_INCL_CRC              0x00000400
01291 #define  GRC_MODE_ALLOW_BAD_FRMS        0x00000800
01292 #define  GRC_MODE_NOIRQ_ON_SENDS        0x00002000
01293 #define  GRC_MODE_NOIRQ_ON_RCV          0x00004000
01294 #define  GRC_MODE_FORCE_PCI32BIT        0x00008000
01295 #define  GRC_MODE_HOST_STACKUP          0x00010000
01296 #define  GRC_MODE_HOST_SENDBDS          0x00020000
01297 #define  GRC_MODE_NO_TX_PHDR_CSUM       0x00100000
01298 #define  GRC_MODE_NO_RX_PHDR_CSUM       0x00800000
01299 #define  GRC_MODE_IRQ_ON_TX_CPU_ATTN    0x01000000
01300 #define  GRC_MODE_IRQ_ON_RX_CPU_ATTN    0x02000000
01301 #define  GRC_MODE_IRQ_ON_MAC_ATTN       0x04000000
01302 #define  GRC_MODE_IRQ_ON_DMA_ATTN       0x08000000
01303 #define  GRC_MODE_IRQ_ON_FLOW_ATTN      0x10000000
01304 #define  GRC_MODE_4X_NIC_SEND_RINGS     0x20000000
01305 #define  GRC_MODE_MCAST_FRM_ENABLE      0x40000000
01306 #define GRC_MISC_CFG                    0x00006804
01307 #define  GRC_MISC_CFG_CORECLK_RESET     0x00000001
01308 #define  GRC_MISC_CFG_PRESCALAR_MASK    0x000000fe
01309 #define  GRC_MISC_CFG_PRESCALAR_SHIFT   1
01310 #define  GRC_MISC_CFG_BOARD_ID_MASK     0x0001e000
01311 #define  GRC_MISC_CFG_BOARD_ID_5700     0x0001e000
01312 #define  GRC_MISC_CFG_BOARD_ID_5701     0x00000000
01313 #define  GRC_MISC_CFG_BOARD_ID_5702FE   0x00004000
01314 #define  GRC_MISC_CFG_BOARD_ID_5703     0x00000000
01315 #define  GRC_MISC_CFG_BOARD_ID_5703S    0x00002000
01316 #define  GRC_MISC_CFG_BOARD_ID_5704     0x00000000
01317 #define  GRC_MISC_CFG_BOARD_ID_5704CIOBE 0x00004000
01318 #define  GRC_MISC_CFG_BOARD_ID_5704_A2  0x00008000
01319 #define  GRC_MISC_CFG_BOARD_ID_5788     0x00010000
01320 #define  GRC_MISC_CFG_BOARD_ID_5788M    0x00018000
01321 #define  GRC_MISC_CFG_BOARD_ID_AC91002A1 0x00018000
01322 #define  GRC_MISC_CFG_KEEP_GPHY_POWER   0x04000000
01323 #define GRC_LOCAL_CTRL                  0x00006808
01324 #define  GRC_LCLCTRL_INT_ACTIVE         0x00000001
01325 #define  GRC_LCLCTRL_CLEARINT           0x00000002
01326 #define  GRC_LCLCTRL_SETINT             0x00000004
01327 #define  GRC_LCLCTRL_INT_ON_ATTN        0x00000008
01328 #define  GRC_LCLCTRL_GPIO_INPUT0        0x00000100
01329 #define  GRC_LCLCTRL_GPIO_INPUT1        0x00000200
01330 #define  GRC_LCLCTRL_GPIO_INPUT2        0x00000400
01331 #define  GRC_LCLCTRL_GPIO_OE0           0x00000800
01332 #define  GRC_LCLCTRL_GPIO_OE1           0x00001000
01333 #define  GRC_LCLCTRL_GPIO_OE2           0x00002000
01334 #define  GRC_LCLCTRL_GPIO_OUTPUT0       0x00004000
01335 #define  GRC_LCLCTRL_GPIO_OUTPUT1       0x00008000
01336 #define  GRC_LCLCTRL_GPIO_OUTPUT2       0x00010000
01337 #define  GRC_LCLCTRL_EXTMEM_ENABLE      0x00020000
01338 #define  GRC_LCLCTRL_MEMSZ_MASK         0x001c0000
01339 #define  GRC_LCLCTRL_MEMSZ_256K         0x00000000
01340 #define  GRC_LCLCTRL_MEMSZ_512K         0x00040000
01341 #define  GRC_LCLCTRL_MEMSZ_1M           0x00080000
01342 #define  GRC_LCLCTRL_MEMSZ_2M           0x000c0000
01343 #define  GRC_LCLCTRL_MEMSZ_4M           0x00100000
01344 #define  GRC_LCLCTRL_MEMSZ_8M           0x00140000
01345 #define  GRC_LCLCTRL_MEMSZ_16M          0x00180000
01346 #define  GRC_LCLCTRL_BANK_SELECT        0x00200000
01347 #define  GRC_LCLCTRL_SSRAM_TYPE         0x00400000
01348 #define  GRC_LCLCTRL_AUTO_SEEPROM       0x01000000
01349 #define GRC_TIMER                       0x0000680c
01350 #define GRC_RX_CPU_EVENT                0x00006810
01351 #define GRC_RX_TIMER_REF                0x00006814
01352 #define GRC_RX_CPU_SEM                  0x00006818
01353 #define GRC_REMOTE_RX_CPU_ATTN          0x0000681c
01354 #define GRC_TX_CPU_EVENT                0x00006820
01355 #define GRC_TX_TIMER_REF                0x00006824
01356 #define GRC_TX_CPU_SEM                  0x00006828
01357 #define GRC_REMOTE_TX_CPU_ATTN          0x0000682c
01358 #define GRC_MEM_POWER_UP                0x00006830 /* 64-bit */
01359 #define GRC_EEPROM_ADDR                 0x00006838
01360 #define  EEPROM_ADDR_WRITE              0x00000000
01361 #define  EEPROM_ADDR_READ               0x80000000
01362 #define  EEPROM_ADDR_COMPLETE           0x40000000
01363 #define  EEPROM_ADDR_FSM_RESET          0x20000000
01364 #define  EEPROM_ADDR_DEVID_MASK         0x1c000000
01365 #define  EEPROM_ADDR_DEVID_SHIFT        26
01366 #define  EEPROM_ADDR_START              0x02000000
01367 #define  EEPROM_ADDR_CLKPERD_SHIFT      16
01368 #define  EEPROM_ADDR_ADDR_MASK          0x0000ffff
01369 #define  EEPROM_ADDR_ADDR_SHIFT         0
01370 #define  EEPROM_DEFAULT_CLOCK_PERIOD    0x60
01371 #define  EEPROM_CHIP_SIZE               (64 * 1024)
01372 #define GRC_EEPROM_DATA                 0x0000683c
01373 #define GRC_EEPROM_CTRL                 0x00006840
01374 #define GRC_MDI_CTRL                    0x00006844
01375 #define GRC_SEEPROM_DELAY               0x00006848
01376 /* 0x684c --> 0x6c00 unused */
01377 
01378 /* 0x6c00 --> 0x7000 unused */
01379 
01380 /* NVRAM Control registers */
01381 #define NVRAM_CMD                       0x00007000
01382 #define  NVRAM_CMD_RESET                 0x00000001
01383 #define  NVRAM_CMD_DONE                  0x00000008
01384 #define  NVRAM_CMD_GO                    0x00000010
01385 #define  NVRAM_CMD_WR                    0x00000020
01386 #define  NVRAM_CMD_RD                    0x00000000
01387 #define  NVRAM_CMD_ERASE                 0x00000040
01388 #define  NVRAM_CMD_FIRST                 0x00000080
01389 #define  NVRAM_CMD_LAST                  0x00000100
01390 #define NVRAM_STAT                      0x00007004
01391 #define NVRAM_WRDATA                    0x00007008
01392 #define NVRAM_ADDR                      0x0000700c
01393 #define  NVRAM_ADDR_MSK                 0x00ffffff
01394 #define NVRAM_RDDATA                    0x00007010
01395 #define NVRAM_CFG1                      0x00007014
01396 #define  NVRAM_CFG1_FLASHIF_ENAB         0x00000001
01397 #define  NVRAM_CFG1_BUFFERED_MODE        0x00000002
01398 #define  NVRAM_CFG1_PASS_THRU            0x00000004
01399 #define  NVRAM_CFG1_BIT_BANG             0x00000008
01400 #define  NVRAM_CFG1_COMPAT_BYPASS        0x80000000
01401 #define NVRAM_CFG2                      0x00007018
01402 #define NVRAM_CFG3                      0x0000701c
01403 #define NVRAM_SWARB                     0x00007020
01404 #define  SWARB_REQ_SET0                  0x00000001
01405 #define  SWARB_REQ_SET1                  0x00000002
01406 #define  SWARB_REQ_SET2                  0x00000004
01407 #define  SWARB_REQ_SET3                  0x00000008
01408 #define  SWARB_REQ_CLR0                  0x00000010
01409 #define  SWARB_REQ_CLR1                  0x00000020
01410 #define  SWARB_REQ_CLR2                  0x00000040
01411 #define  SWARB_REQ_CLR3                  0x00000080
01412 #define  SWARB_GNT0                      0x00000100
01413 #define  SWARB_GNT1                      0x00000200
01414 #define  SWARB_GNT2                      0x00000400
01415 #define  SWARB_GNT3                      0x00000800
01416 #define  SWARB_REQ0                      0x00001000
01417 #define  SWARB_REQ1                      0x00002000
01418 #define  SWARB_REQ2                      0x00004000
01419 #define  SWARB_REQ3                      0x00008000
01420 #define    NVRAM_BUFFERED_PAGE_SIZE        264
01421 #define    NVRAM_BUFFERED_PAGE_POS         9
01422 /* 0x7024 --> 0x7400 unused */
01423 
01424 /* 0x7400 --> 0x8000 unused */
01425 
01426 /* 32K Window into NIC internal memory */
01427 #define NIC_SRAM_WIN_BASE               0x00008000
01428 
01429 /* Offsets into first 32k of NIC internal memory. */
01430 #define NIC_SRAM_PAGE_ZERO              0x00000000
01431 #define NIC_SRAM_SEND_RCB               0x00000100 /* 16 * TG3_BDINFO_... */
01432 #define NIC_SRAM_RCV_RET_RCB            0x00000200 /* 16 * TG3_BDINFO_... */
01433 #define NIC_SRAM_STATS_BLK              0x00000300
01434 #define NIC_SRAM_STATUS_BLK             0x00000b00
01435 
01436 #define NIC_SRAM_FIRMWARE_MBOX          0x00000b50
01437 #define  NIC_SRAM_FIRMWARE_MBOX_MAGIC1   0x4B657654
01438 #define  NIC_SRAM_FIRMWARE_MBOX_MAGIC2   0x4861764b /* !dma on linkchg */
01439 
01440 #define NIC_SRAM_DATA_SIG               0x00000b54
01441 #define  NIC_SRAM_DATA_SIG_MAGIC         0x4b657654 /* ascii for 'KevT' */
01442 
01443 #define NIC_SRAM_DATA_CFG                       0x00000b58
01444 #define  NIC_SRAM_DATA_CFG_LED_MODE_MASK         0x0000000c
01445 #define  NIC_SRAM_DATA_CFG_LED_MODE_UNKNOWN      0x00000000
01446 #define  NIC_SRAM_DATA_CFG_LED_TRIPLE_SPD        0x00000004
01447 #define  NIC_SRAM_DATA_CFG_LED_OPEN_DRAIN        0x00000004
01448 #define  NIC_SRAM_DATA_CFG_LED_LINK_SPD          0x00000008
01449 #define  NIC_SRAM_DATA_CFG_LED_OUTPUT            0x00000008
01450 #define  NIC_SRAM_DATA_CFG_PHY_TYPE_MASK         0x00000030
01451 #define  NIC_SRAM_DATA_CFG_PHY_TYPE_UNKNOWN      0x00000000
01452 #define  NIC_SRAM_DATA_CFG_PHY_TYPE_COPPER       0x00000010
01453 #define  NIC_SRAM_DATA_CFG_PHY_TYPE_FIBER        0x00000020
01454 #define  NIC_SRAM_DATA_CFG_WOL_ENABLE            0x00000040
01455 #define  NIC_SRAM_DATA_CFG_ASF_ENABLE            0x00000080
01456 #define  NIC_SRAM_DATA_CFG_EEPROM_WP             0x00000100
01457 #define  NIC_SRAM_DATA_CFG_MINI_PCI              0x00001000
01458 #define  NIC_SRAM_DATA_CFG_FIBER_WOL             0x00004000
01459 
01460 #define NIC_SRAM_DATA_PHY_ID            0x00000b74
01461 #define  NIC_SRAM_DATA_PHY_ID1_MASK      0xffff0000
01462 #define  NIC_SRAM_DATA_PHY_ID2_MASK      0x0000ffff
01463 
01464 #define NIC_SRAM_FW_CMD_MBOX            0x00000b78
01465 #define  FWCMD_NICDRV_ALIVE              0x00000001
01466 #define  FWCMD_NICDRV_PAUSE_FW           0x00000002
01467 #define  FWCMD_NICDRV_IPV4ADDR_CHG       0x00000003
01468 #define  FWCMD_NICDRV_IPV6ADDR_CHG       0x00000004
01469 #define  FWCMD_NICDRV_FIX_DMAR           0x00000005
01470 #define  FWCMD_NICDRV_FIX_DMAW           0x00000006
01471 #define NIC_SRAM_FW_CMD_LEN_MBOX        0x00000b7c
01472 #define NIC_SRAM_FW_CMD_DATA_MBOX       0x00000b80
01473 #define NIC_SRAM_FW_ASF_STATUS_MBOX     0x00000c00
01474 #define NIC_SRAM_FW_DRV_STATE_MBOX      0x00000c04
01475 #define  DRV_STATE_START                 0x00000001
01476 #define  DRV_STATE_UNLOAD                0x00000002
01477 #define  DRV_STATE_WOL                   0x00000003
01478 #define  DRV_STATE_SUSPEND               0x00000004
01479 
01480 #define NIC_SRAM_FW_RESET_TYPE_MBOX     0x00000c08
01481 
01482 #define NIC_SRAM_MAC_ADDR_HIGH_MBOX     0x00000c14
01483 #define NIC_SRAM_MAC_ADDR_LOW_MBOX      0x00000c18
01484 
01485 #define NIC_SRAM_RX_MINI_BUFFER_DESC    0x00001000
01486 
01487 #define NIC_SRAM_DMA_DESC_POOL_BASE     0x00002000
01488 #define  NIC_SRAM_DMA_DESC_POOL_SIZE     0x00002000
01489 #define NIC_SRAM_TX_BUFFER_DESC         0x00004000 /* 512 entries */
01490 #define NIC_SRAM_RX_BUFFER_DESC         0x00006000 /* 256 entries */
01491 #define NIC_SRAM_RX_JUMBO_BUFFER_DESC   0x00007000 /* 256 entries */
01492 #define NIC_SRAM_MBUF_POOL_BASE         0x00008000
01493 #define  NIC_SRAM_MBUF_POOL_SIZE96       0x00018000
01494 #define  NIC_SRAM_MBUF_POOL_SIZE64       0x00010000
01495 #define  NIC_SRAM_MBUF_POOL_BASE5705    0x00010000
01496 #define  NIC_SRAM_MBUF_POOL_SIZE5705    0x0000e000
01497 
01498 /* Currently this is fixed. */
01499 #define PHY_ADDR                0x01
01500 
01501 /* Tigon3 specific PHY MII registers. */
01502 #define  TG3_BMCR_SPEED1000             0x0040
01503 
01504 #define MII_TG3_CTRL                    0x09 /* 1000-baseT control register */
01505 #define  MII_TG3_CTRL_ADV_1000_HALF     0x0100
01506 #define  MII_TG3_CTRL_ADV_1000_FULL     0x0200
01507 #define  MII_TG3_CTRL_AS_MASTER         0x0800
01508 #define  MII_TG3_CTRL_ENABLE_AS_MASTER  0x1000
01509 
01510 #define MII_TG3_EXT_CTRL                0x10 /* Extended control register */
01511 #define  MII_TG3_EXT_CTRL_LNK3_LED_MODE 0x0002
01512 #define  MII_TG3_EXT_CTRL_TBI           0x8000
01513 
01514 #define MII_TG3_EXT_STAT                0x11 /* Extended status register */
01515 #define  MII_TG3_EXT_STAT_LPASS         0x0100
01516 
01517 #define MII_TG3_DSP_RW_PORT             0x15 /* DSP coefficient read/write port */
01518 
01519 #define MII_TG3_DSP_ADDRESS             0x17 /* DSP address register */
01520 
01521 #define MII_TG3_AUX_CTRL                0x18 /* auxilliary control register */
01522 
01523 #define MII_TG3_AUX_STAT                0x19 /* auxilliary status register */
01524 #define MII_TG3_AUX_STAT_LPASS          0x0004
01525 #define MII_TG3_AUX_STAT_SPDMASK        0x0700
01526 #define MII_TG3_AUX_STAT_10HALF         0x0100
01527 #define MII_TG3_AUX_STAT_10FULL         0x0200
01528 #define MII_TG3_AUX_STAT_100HALF        0x0300
01529 #define MII_TG3_AUX_STAT_100_4          0x0400
01530 #define MII_TG3_AUX_STAT_100FULL        0x0500
01531 #define MII_TG3_AUX_STAT_1000HALF       0x0600
01532 #define MII_TG3_AUX_STAT_1000FULL       0x0700
01533 
01534 #define MII_TG3_ISTAT                   0x1a /* IRQ status register */
01535 #define MII_TG3_IMASK                   0x1b /* IRQ mask register */
01536 
01537 /* ISTAT/IMASK event bits */
01538 #define MII_TG3_INT_LINKCHG             0x0002
01539 #define MII_TG3_INT_SPEEDCHG            0x0004
01540 #define MII_TG3_INT_DUPLEXCHG           0x0008
01541 #define MII_TG3_INT_ANEG_PAGE_RX        0x0400
01542 
01543 
01544 /* There are two ways to manage the TX descriptors on the tigon3.
01545  * Either the descriptors are in host DMA'able memory, or they
01546  * exist only in the cards on-chip SRAM.  All 16 send bds are under
01547  * the same mode, they may not be configured individually.
01548  *
01549  * The mode we use is controlled by TG3_FLAG_HOST_TXDS in tp->tg3_flags.
01550  *
01551  * To use host memory TX descriptors:
01552  *      1) Set GRC_MODE_HOST_SENDBDS in GRC_MODE register.
01553  *         Make sure GRC_MODE_4X_NIC_SEND_RINGS is clear.
01554  *      2) Allocate DMA'able memory.
01555  *      3) In NIC_SRAM_SEND_RCB (of desired index) of on-chip SRAM:
01556  *         a) Set TG3_BDINFO_HOST_ADDR to DMA address of memory
01557  *            obtained in step 2
01558  *         b) Set TG3_BDINFO_NIC_ADDR to NIC_SRAM_TX_BUFFER_DESC.
01559  *         c) Set len field of TG3_BDINFO_MAXLEN_FLAGS to number
01560  *            of TX descriptors.  Leave flags field clear.
01561  *      4) Access TX descriptors via host memory.  The chip
01562  *         will refetch into local SRAM as needed when producer
01563  *         index mailboxes are updated.
01564  *
01565  * To use on-chip TX descriptors:
01566  *      1) Set GRC_MODE_4X_NIC_SEND_RINGS in GRC_MODE register.
01567  *         Make sure GRC_MODE_HOST_SENDBDS is clear.
01568  *      2) In NIC_SRAM_SEND_RCB (of desired index) of on-chip SRAM:
01569  *         a) Set TG3_BDINFO_HOST_ADDR to zero.
01570  *         b) Set TG3_BDINFO_NIC_ADDR to NIC_SRAM_TX_BUFFER_DESC
01571  *         c) TG3_BDINFO_MAXLEN_FLAGS is don't care.
01572  *      3) Access TX descriptors directly in on-chip SRAM
01573  *         using normal {read,write}l().  (and not using
01574  *         pointer dereferencing of ioremap()'d memory like
01575  *         the broken Broadcom driver does)
01576  *
01577  * Note that BDINFO_FLAGS_DISABLED should be set in the flags field of
01578  * TG3_BDINFO_MAXLEN_FLAGS of all unused SEND_RCB indices.
01579  */
01580 struct tg3_tx_buffer_desc {
01581         uint32_t                        addr_hi;
01582         uint32_t                        addr_lo;
01583 
01584         uint32_t                        len_flags;
01585 #define TXD_FLAG_TCPUDP_CSUM            0x0001
01586 #define TXD_FLAG_IP_CSUM                0x0002
01587 #define TXD_FLAG_END                    0x0004
01588 #define TXD_FLAG_IP_FRAG                0x0008
01589 #define TXD_FLAG_IP_FRAG_END            0x0010
01590 #define TXD_FLAG_VLAN                   0x0040
01591 #define TXD_FLAG_COAL_NOW               0x0080
01592 #define TXD_FLAG_CPU_PRE_DMA            0x0100
01593 #define TXD_FLAG_CPU_POST_DMA           0x0200
01594 #define TXD_FLAG_ADD_SRC_ADDR           0x1000
01595 #define TXD_FLAG_CHOOSE_SRC_ADDR        0x6000
01596 #define TXD_FLAG_NO_CRC                 0x8000
01597 #define TXD_LEN_SHIFT                   16
01598 
01599         uint32_t                        vlan_tag;
01600 #define TXD_VLAN_TAG_SHIFT              0
01601 #define TXD_MSS_SHIFT                   16
01602 };
01603 
01604 #define TXD_ADDR                        0x00UL /* 64-bit */
01605 #define TXD_LEN_FLAGS                   0x08UL /* 32-bit (upper 16-bits are len) */
01606 #define TXD_VLAN_TAG                    0x0cUL /* 32-bit (upper 16-bits are tag) */
01607 #define TXD_SIZE                        0x10UL
01608 
01609 struct tg3_rx_buffer_desc {
01610         uint32_t                        addr_hi;
01611         uint32_t                        addr_lo;
01612 
01613         uint32_t                        idx_len;
01614 #define RXD_IDX_MASK    0xffff0000
01615 #define RXD_IDX_SHIFT   16
01616 #define RXD_LEN_MASK    0x0000ffff
01617 #define RXD_LEN_SHIFT   0
01618 
01619         uint32_t                        type_flags;
01620 #define RXD_TYPE_SHIFT  16
01621 #define RXD_FLAGS_SHIFT 0
01622 
01623 #define RXD_FLAG_END                    0x0004
01624 #define RXD_FLAG_MINI                   0x0800
01625 #define RXD_FLAG_JUMBO                  0x0020
01626 #define RXD_FLAG_VLAN                   0x0040
01627 #define RXD_FLAG_ERROR                  0x0400
01628 #define RXD_FLAG_IP_CSUM                0x1000
01629 #define RXD_FLAG_TCPUDP_CSUM            0x2000
01630 #define RXD_FLAG_IS_TCP                 0x4000
01631 
01632         uint32_t                        ip_tcp_csum;
01633 #define RXD_IPCSUM_MASK         0xffff0000
01634 #define RXD_IPCSUM_SHIFT        16
01635 #define RXD_TCPCSUM_MASK        0x0000ffff
01636 #define RXD_TCPCSUM_SHIFT       0
01637 
01638         uint32_t                        err_vlan;
01639 
01640 #define RXD_VLAN_MASK                   0x0000ffff
01641 
01642 #define RXD_ERR_BAD_CRC                 0x00010000
01643 #define RXD_ERR_COLLISION               0x00020000
01644 #define RXD_ERR_LINK_LOST               0x00040000
01645 #define RXD_ERR_PHY_DECODE              0x00080000
01646 #define RXD_ERR_ODD_NIBBLE_RCVD_MII     0x00100000
01647 #define RXD_ERR_MAC_ABRT                0x00200000
01648 #define RXD_ERR_TOO_SMALL               0x00400000
01649 #define RXD_ERR_NO_RESOURCES            0x00800000
01650 #define RXD_ERR_HUGE_FRAME              0x01000000
01651 #define RXD_ERR_MASK                    0xffff0000
01652 
01653         uint32_t                        reserved;
01654         uint32_t                        opaque;
01655 #define RXD_OPAQUE_INDEX_MASK           0x0000ffff
01656 #define RXD_OPAQUE_INDEX_SHIFT          0
01657 #define RXD_OPAQUE_RING_STD             0x00010000
01658 #define RXD_OPAQUE_RING_JUMBO           0x00020000
01659 #define RXD_OPAQUE_RING_MINI            0x00040000
01660 #define RXD_OPAQUE_RING_MASK            0x00070000
01661 };
01662 
01663 struct tg3_ext_rx_buffer_desc {
01664         struct {
01665                 uint32_t                addr_hi;
01666                 uint32_t                addr_lo;
01667         }                               addrlist[3];
01668         uint32_t                        len2_len1;
01669         uint32_t                        resv_len3;
01670         struct tg3_rx_buffer_desc       std;
01671 };
01672 
01673 /* We only use this when testing out the DMA engine
01674  * at probe time.  This is the internal format of buffer
01675  * descriptors used by the chip at NIC_SRAM_DMA_DESCS.
01676  */
01677 struct tg3_internal_buffer_desc {
01678         uint32_t                        addr_hi;
01679         uint32_t                        addr_lo;
01680         uint32_t                        nic_mbuf;
01681         /* XXX FIX THIS */
01682 #if __BYTE_ORDER == __BIG_ENDIAN
01683         uint16_t                        cqid_sqid;
01684         uint16_t                        len;
01685 #else
01686         uint16_t                        len;
01687         uint16_t                        cqid_sqid;
01688 #endif
01689         uint32_t                        flags;
01690         uint32_t                        __cookie1;
01691         uint32_t                        __cookie2;
01692         uint32_t                        __cookie3;
01693 };
01694 
01695 #define TG3_HW_STATUS_SIZE              0x50
01696 struct tg3_hw_status {
01697         uint32_t                        status;
01698 #define SD_STATUS_UPDATED               0x00000001
01699 #define SD_STATUS_LINK_CHG              0x00000002
01700 #define SD_STATUS_ERROR                 0x00000004
01701 
01702         uint32_t                        status_tag;
01703 
01704 #if __BYTE_ORDER == __BIG_ENDIAN
01705         uint16_t                        rx_consumer;
01706         uint16_t                        rx_jumbo_consumer;
01707 #else
01708         uint16_t                        rx_jumbo_consumer;
01709         uint16_t                        rx_consumer;
01710 #endif
01711 
01712 #if __BYTE_ORDER ==  __BIG_ENDIAN
01713         uint16_t                        reserved;
01714         uint16_t                        rx_mini_consumer;
01715 #else
01716         uint16_t                        rx_mini_consumer;
01717         uint16_t                        reserved;
01718 #endif
01719         struct {
01720 #if __BYTE_ORDER ==  __BIG_ENDIAN
01721                 uint16_t                tx_consumer;
01722                 uint16_t                rx_producer;
01723 #else
01724                 uint16_t                rx_producer;
01725                 uint16_t                tx_consumer;
01726 #endif
01727         }                               idx[16];
01728 };
01729 
01730 typedef struct {
01731         uint32_t high, low;
01732 } tg3_stat64_t;
01733 
01734 struct tg3_hw_stats {
01735         uint8_t                         __reserved0[0x400-0x300];
01736 
01737         /* Statistics maintained by Receive MAC. */
01738         tg3_stat64_t                    rx_octets;
01739         uint64_t                        __reserved1;
01740         tg3_stat64_t                    rx_fragments;
01741         tg3_stat64_t                    rx_ucast_packets;
01742         tg3_stat64_t                    rx_mcast_packets;
01743         tg3_stat64_t                    rx_bcast_packets;
01744         tg3_stat64_t                    rx_fcs_errors;
01745         tg3_stat64_t                    rx_align_errors;
01746         tg3_stat64_t                    rx_xon_pause_rcvd;
01747         tg3_stat64_t                    rx_xoff_pause_rcvd;
01748         tg3_stat64_t                    rx_mac_ctrl_rcvd;
01749         tg3_stat64_t                    rx_xoff_entered;
01750         tg3_stat64_t                    rx_frame_too_long_errors;
01751         tg3_stat64_t                    rx_jabbers;
01752         tg3_stat64_t                    rx_undersize_packets;
01753         tg3_stat64_t                    rx_in_length_errors;
01754         tg3_stat64_t                    rx_out_length_errors;
01755         tg3_stat64_t                    rx_64_or_less_octet_packets;
01756         tg3_stat64_t                    rx_65_to_127_octet_packets;
01757         tg3_stat64_t                    rx_128_to_255_octet_packets;
01758         tg3_stat64_t                    rx_256_to_511_octet_packets;
01759         tg3_stat64_t                    rx_512_to_1023_octet_packets;
01760         tg3_stat64_t                    rx_1024_to_1522_octet_packets;
01761         tg3_stat64_t                    rx_1523_to_2047_octet_packets;
01762         tg3_stat64_t                    rx_2048_to_4095_octet_packets;
01763         tg3_stat64_t                    rx_4096_to_8191_octet_packets;
01764         tg3_stat64_t                    rx_8192_to_9022_octet_packets;
01765 
01766         uint64_t                        __unused0[37];
01767 
01768         /* Statistics maintained by Transmit MAC. */
01769         tg3_stat64_t                    tx_octets;
01770         uint64_t                        __reserved2;
01771         tg3_stat64_t                    tx_collisions;
01772         tg3_stat64_t                    tx_xon_sent;
01773         tg3_stat64_t                    tx_xoff_sent;
01774         tg3_stat64_t                    tx_flow_control;
01775         tg3_stat64_t                    tx_mac_errors;
01776         tg3_stat64_t                    tx_single_collisions;
01777         tg3_stat64_t                    tx_mult_collisions;
01778         tg3_stat64_t                    tx_deferred;
01779         uint64_t                        __reserved3;
01780         tg3_stat64_t                    tx_excessive_collisions;
01781         tg3_stat64_t                    tx_late_collisions;
01782         tg3_stat64_t                    tx_collide_2times;
01783         tg3_stat64_t                    tx_collide_3times;
01784         tg3_stat64_t                    tx_collide_4times;
01785         tg3_stat64_t                    tx_collide_5times;
01786         tg3_stat64_t                    tx_collide_6times;
01787         tg3_stat64_t                    tx_collide_7times;
01788         tg3_stat64_t                    tx_collide_8times;
01789         tg3_stat64_t                    tx_collide_9times;
01790         tg3_stat64_t                    tx_collide_10times;
01791         tg3_stat64_t                    tx_collide_11times;
01792         tg3_stat64_t                    tx_collide_12times;
01793         tg3_stat64_t                    tx_collide_13times;
01794         tg3_stat64_t                    tx_collide_14times;
01795         tg3_stat64_t                    tx_collide_15times;
01796         tg3_stat64_t                    tx_ucast_packets;
01797         tg3_stat64_t                    tx_mcast_packets;
01798         tg3_stat64_t                    tx_bcast_packets;
01799         tg3_stat64_t                    tx_carrier_sense_errors;
01800         tg3_stat64_t                    tx_discards;
01801         tg3_stat64_t                    tx_errors;
01802 
01803         uint64_t                        __unused1[31];
01804 
01805         /* Statistics maintained by Receive List Placement. */
01806         tg3_stat64_t                    COS_rx_packets[16];
01807         tg3_stat64_t                    COS_rx_filter_dropped;
01808         tg3_stat64_t                    dma_writeq_full;
01809         tg3_stat64_t                    dma_write_prioq_full;
01810         tg3_stat64_t                    rxbds_empty;
01811         tg3_stat64_t                    rx_discards;
01812         tg3_stat64_t                    rx_errors;
01813         tg3_stat64_t                    rx_threshold_hit;
01814 
01815         uint64_t                        __unused2[9];
01816 
01817         /* Statistics maintained by Send Data Initiator. */
01818         tg3_stat64_t                    COS_out_packets[16];
01819         tg3_stat64_t                    dma_readq_full;
01820         tg3_stat64_t                    dma_read_prioq_full;
01821         tg3_stat64_t                    tx_comp_queue_full;
01822 
01823         /* Statistics maintained by Host Coalescing. */
01824         tg3_stat64_t                    ring_set_send_prod_index;
01825         tg3_stat64_t                    ring_status_update;
01826         tg3_stat64_t                    nic_irqs;
01827         tg3_stat64_t                    nic_avoided_irqs;
01828         tg3_stat64_t                    nic_tx_threshold_hit;
01829 
01830         uint8_t                         __reserved4[0xb00-0x9c0];
01831 };
01832 
01833 enum phy_led_mode {
01834         led_mode_auto,
01835         led_mode_three_link,
01836         led_mode_link10
01837 };
01838 
01839 #if 0
01840 /* 'mapping' is superfluous as the chip does not write into
01841  * the tx/rx post rings so we could just fetch it from there.
01842  * But the cache behavior is better how we are doing it now.
01843  */
01844 struct ring_info {
01845         struct sk_buff                  *skb;
01846         DECLARE_PCI_UNMAP_ADDR(mapping)
01847 };
01848 
01849 struct tx_ring_info {
01850         struct sk_buff                  *skb;
01851         DECLARE_PCI_UNMAP_ADDR(mapping)
01852         uint32_t                        prev_vlan_tag;
01853 };
01854 #endif
01855 
01856 struct tg3_config_info {
01857         uint32_t                        flags;
01858 };
01859 
01860 struct tg3_link_config {
01861         /* Describes what we're trying to get. */
01862         uint32_t                        advertising;
01863 #if 0
01864         uint16_t                        speed;
01865         uint8_t                         duplex;
01866         uint8_t                         autoneg;
01867 #define SPEED_INVALID           0xffff
01868 #define DUPLEX_INVALID          0xff
01869 #define AUTONEG_INVALID         0xff
01870 #endif
01871 
01872         /* Describes what we actually have. */
01873         uint8_t                         active_speed;
01874         uint8_t                         active_duplex;
01875 
01876         /* When we go in and out of low power mode we need
01877          * to swap with this state.
01878          */
01879 #if 0
01880         int                             phy_is_low_power;
01881         uint16_t                        orig_speed;
01882         uint8_t                         orig_duplex;
01883         uint8_t                         orig_autoneg;
01884 #endif
01885 };
01886 
01887 struct tg3_bufmgr_config {
01888         uint32_t                mbuf_read_dma_low_water;
01889         uint32_t                mbuf_mac_rx_low_water;
01890         uint32_t                mbuf_high_water;
01891 
01892         uint32_t                mbuf_read_dma_low_water_jumbo;
01893         uint32_t                mbuf_mac_rx_low_water_jumbo;
01894         uint32_t                mbuf_high_water_jumbo;
01895 
01896         uint32_t                dma_low_water;
01897         uint32_t                dma_high_water;
01898 };
01899 
01900 struct tg3 {
01901 #if 0
01902         /* SMP locking strategy:
01903          *
01904          * lock: Held during all operations except TX packet
01905          *       processing.
01906          *
01907          * tx_lock: Held during tg3_start_xmit{,_4gbug} and tg3_tx
01908          *
01909          * If you want to shut up all asynchronous processing you must
01910          * acquire both locks, 'lock' taken before 'tx_lock'.  IRQs must
01911          * be disabled to take 'lock' but only softirq disabling is
01912          * necessary for acquisition of 'tx_lock'.
01913          */
01914         spinlock_t                      lock;
01915         spinlock_t                      tx_lock;
01916 #endif
01917 
01918         uint32_t                        tx_prod;
01919 #if 0
01920         uint32_t                        tx_cons;
01921 #endif
01922         uint32_t                        rx_rcb_ptr;
01923         uint32_t                        rx_std_ptr;
01924 #if 0
01925         uint32_t                        rx_jumbo_ptr;
01926         spinlock_t                      indirect_lock;
01927 
01928         struct net_device_stats         net_stats;
01929         struct net_device_stats         net_stats_prev;
01930 #endif
01931         unsigned long                   phy_crc_errors;
01932 
01933 #if 0
01934         uint32_t                        rx_offset;
01935 #endif
01936         uint32_t                        tg3_flags;
01937 #if 0
01938 #define TG3_FLAG_HOST_TXDS              0x00000001
01939 #endif
01940 #define TG3_FLAG_TXD_MBOX_HWBUG         0x00000002
01941 #define TG3_FLAG_RX_CHECKSUMS           0x00000004
01942 #define TG3_FLAG_USE_LINKCHG_REG        0x00000008
01943 #define TG3_FLAG_USE_MI_INTERRUPT       0x00000010
01944 #define TG3_FLAG_ENABLE_ASF             0x00000020
01945 #define TG3_FLAG_5701_REG_WRITE_BUG     0x00000040
01946 #define TG3_FLAG_POLL_SERDES            0x00000080
01947 #define TG3_FLAG_MBOX_WRITE_REORDER     0x00000100
01948 #define TG3_FLAG_PCIX_TARGET_HWBUG      0x00000200
01949 #define TG3_FLAG_WOL_SPEED_100MB        0x00000400
01950 #define TG3_FLAG_WOL_ENABLE             0x00000800
01951 #define TG3_FLAG_EEPROM_WRITE_PROT      0x00001000
01952 #define TG3_FLAG_NVRAM                  0x00002000
01953 #define TG3_FLAG_NVRAM_BUFFERED         0x00004000
01954 #define TG3_FLAG_RX_PAUSE               0x00008000
01955 #define TG3_FLAG_TX_PAUSE               0x00010000
01956 #define TG3_FLAG_PCIX_MODE              0x00020000
01957 #define TG3_FLAG_PCI_HIGH_SPEED         0x00040000
01958 #define TG3_FLAG_PCI_32BIT              0x00080000
01959 #define TG3_FLAG_NO_TX_PSEUDO_CSUM      0x00100000
01960 #define TG3_FLAG_NO_RX_PSEUDO_CSUM      0x00200000
01961 #define TG3_FLAG_SERDES_WOL_CAP         0x00400000
01962 #define TG3_FLAG_JUMBO_ENABLE           0x00800000
01963 #define TG3_FLAG_10_100_ONLY            0x01000000
01964 #define TG3_FLAG_PAUSE_AUTONEG          0x02000000
01965 #define TG3_FLAG_PAUSE_RX               0x04000000
01966 #define TG3_FLAG_PAUSE_TX               0x08000000
01967 #define TG3_FLAG_BROKEN_CHECKSUMS       0x10000000
01968 #define TG3_FLAG_GOT_SERDES_FLOWCTL     0x20000000
01969 #define TG3_FLAG_SPLIT_MODE             0x40000000
01970 #define TG3_FLAG_INIT_COMPLETE          0x80000000
01971 
01972         uint32_t                        tg3_flags2;
01973 #define TG3_FLG2_RESTART_TIMER          0x00000001
01974 #define TG3_FLG2_SUN_5704               0x00000002
01975 #define TG3_FLG2_NO_ETH_WIRE_SPEED      0x00000004
01976 #define TG3_FLG2_IS_5788                0x00000008
01977 #define TG3_FLG2_MAX_RXPEND_64          0x00000010
01978 #define TG3_FLG2_TSO_CAPABLE            0x00000020
01979   // Alf: Hope I'm not breaking anything here !
01980 #define TG3_FLG2_PCI_EXPRESS            0x00000040
01981 
01982 
01983 
01984         uint32_t                        split_mode_max_reqs;
01985 #define SPLIT_MODE_5704_MAX_REQ         3
01986 
01987 #if 0
01988         struct timer_list               timer;
01989         uint16_t                        timer_counter;
01990         uint16_t                        timer_multiplier;
01991         uint32_t                        timer_offset;
01992         uint16_t                        asf_counter;
01993         uint16_t                        asf_multiplier;
01994 #endif
01995 
01996         struct tg3_link_config          link_config;
01997         struct tg3_bufmgr_config        bufmgr_config;
01998 
01999 #if 0
02000         uint32_t                        rx_pending;
02001         uint32_t                        rx_jumbo_pending;
02002         uint32_t                        tx_pending;
02003 #endif
02004 
02005         /* cache h/w values, often passed straight to h/w */
02006         uint32_t                        rx_mode;
02007         uint32_t                        tx_mode;
02008         uint32_t                        mac_mode;
02009         uint32_t                        mi_mode;
02010         uint32_t                        misc_host_ctrl;
02011         uint32_t                        grc_mode;
02012         uint32_t                        grc_local_ctrl;
02013         uint32_t                        dma_rwctrl;
02014 #if 0
02015         uint32_t                        coalesce_mode;
02016 #endif
02017 
02018         /* PCI block */
02019         uint16_t                        pci_chip_rev_id;
02020 #if 0
02021         uint8_t                         pci_cacheline_sz;
02022         uint8_t                         pci_lat_timer;
02023         uint8_t                         pci_hdr_type;
02024         uint8_t                         pci_bist;
02025 #endif
02026         uint32_t                        pci_cfg_state[64 / sizeof(uint32_t)];
02027 
02028         int                             pm_cap;
02029 
02030         /* PHY info */
02031         uint32_t                        phy_id;
02032 #define PHY_ID_MASK                     0xfffffff0
02033 #define PHY_ID_BCM5400                  0x60008040
02034 #define PHY_ID_BCM5401                  0x60008050
02035 #define PHY_ID_BCM5411                  0x60008070
02036 #define PHY_ID_BCM5701                  0x60008110
02037 #define PHY_ID_BCM5703                  0x60008160
02038 #define PHY_ID_BCM5704                  0x60008190
02039 #define PHY_ID_BCM5705                  0x600081a0
02040 #define PHY_ID_BCM5750                  0x60008180
02041 #define PHY_ID_BCM5787                  0xbc050ce0
02042 #define PHY_ID_BCM8002                  0x60010140
02043 #define PHY_ID_BCM5751                  0x00206180
02044 #define PHY_ID_SERDES                   0xfeedbee0
02045 #define PHY_ID_INVALID                  0xffffffff
02046 #define PHY_ID_REV_MASK                 0x0000000f
02047 #define PHY_REV_BCM5401_B0              0x1
02048 #define PHY_REV_BCM5401_B2              0x3
02049 #define PHY_REV_BCM5401_C0              0x6
02050 #define PHY_REV_BCM5411_X0              0x1 /* Found on Netgear GA302T */
02051 
02052         enum phy_led_mode               led_mode;
02053 
02054         char                            board_part_number[24];
02055         uint32_t                        nic_sram_data_cfg;
02056         uint32_t                        pci_clock_ctrl;
02057 #if 0
02058         struct pci_device               *pdev_peer;
02059 #endif
02060 
02061         /* This macro assumes the passed PHY ID is already masked
02062          * with PHY_ID_MASK.
02063          */
02064 #define KNOWN_PHY_ID(X)         \
02065         ((X) == PHY_ID_BCM5400 || (X) == PHY_ID_BCM5401 || \
02066          (X) == PHY_ID_BCM5411 || (X) == PHY_ID_BCM5701 || \
02067          (X) == PHY_ID_BCM5703 || (X) == PHY_ID_BCM5704 || \
02068          (X) == PHY_ID_BCM5705 || (X) == PHY_ID_BCM5750 || \
02069          (X) == PHY_ID_BCM5751 || (X) == PHY_ID_BCM5787 || \
02070          (X) == PHY_ID_BCM8002 || (X) == PHY_ID_SERDES)
02071 
02072         unsigned long                   regs;
02073         struct pci_device               *pdev;
02074         struct nic                      *nic;
02075 #if 0
02076         struct net_device               *dev;
02077 #endif
02078 #if TG3_VLAN_TAG_USED
02079         struct vlan_group               *vlgrp;
02080 #endif
02081 
02082         struct tg3_rx_buffer_desc       *rx_std;
02083 #if 0
02084         struct ring_info                *rx_std_buffers;
02085         dma_addr_t                      rx_std_mapping;
02086         struct tg3_rx_buffer_desc       *rx_jumbo;
02087         struct ring_info                *rx_jumbo_buffers;
02088         dma_addr_t                      rx_jumbo_mapping;
02089 #endif
02090 
02091         struct tg3_rx_buffer_desc       *rx_rcb;
02092 #if 0
02093         dma_addr_t                      rx_rcb_mapping;
02094 #endif
02095 
02096         /* TX descs are only used if TG3_FLAG_HOST_TXDS is set. */
02097         struct tg3_tx_buffer_desc       *tx_ring;
02098 #if 0
02099         struct tx_ring_info             *tx_buffers;
02100         dma_addr_t                      tx_desc_mapping;
02101 #endif
02102 
02103         struct tg3_hw_status            *hw_status;
02104 #if 0
02105         dma_addr_t                      status_mapping;
02106 #endif
02107 #if 0
02108         uint32_t                        msg_enable;
02109 #endif
02110 
02111         struct tg3_hw_stats             *hw_stats;
02112 #if 0
02113         dma_addr_t                      stats_mapping;
02114 #endif
02115 
02116         int                             carrier_ok;
02117         uint16_t                        subsystem_vendor;
02118         uint16_t                        subsystem_device;
02119 };
02120 
02121 #endif /* !(_T3_H) */

Generated on Tue Apr 6 20:01:04 2010 for gPXE by  doxygen 1.5.7.1