2 /******************************************************************************/
4 /* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */
6 /* All rights reserved. */
8 /* This program is free software; you can redistribute it and/or modify */
9 /* it under the terms of the GNU General Public License as published by */
10 /* the Free Software Foundation, located in the file LICENSE. */
14 /******************************************************************************/
19 #include "bcm570x_lm.h"
20 #if INCLUDE_TBI_SUPPORT
21 #include "bcm570x_autoneg.h"
25 #if !defined(BIG_ENDIAN_HOST)
27 (LONGSWAP((*(volatile unsigned int *)(addr))))
28 #define writel(b,addr) \
29 ((*(volatile unsigned int *)(addr)) = (LONGSWAP(b)))
31 #if 0 /* !defined(PPC603) */
32 #define readl(addr) (*(volatile unsigned int*)(0xa0000000 + (unsigned long)(addr)))
33 #define writel(b,addr) ((*(volatile unsigned int *) ((unsigned long)(addr) + 0xa0000000)) = (b))
36 #define readl(addr) (*(volatile unsigned int*)(addr))
37 #define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
39 extern int sprintf (char *buf, const char *f, ...);
40 static __inline unsigned int readl (void *addr)
43 unsigned int tmp = (*(volatile unsigned int *)(addr));
44 sprintf (buf, "%s:%s: read 0x%x from 0x%x\n", __FILE__, __LINE__, tmp,
46 sysSerialPrintString (buf);
49 static __inline void writel (unsigned int b, unsigned int addr)
52 ((*(volatile unsigned int *)(addr)) = (b));
53 sprintf (buf, "%s:%s: write 0x%x to 0x%x\n", __FILE__, __LINE__, b,
55 sysSerialPrintString (buf);
61 /******************************************************************************/
63 /******************************************************************************/
65 /* Maxim number of packet descriptors used for sending packets. */
66 #define MAX_TX_PACKET_DESC_COUNT 600
67 #define DEFAULT_TX_PACKET_DESC_COUNT 2
69 /* Maximum number of packet descriptors used for receiving packets. */
70 #if T3_JUMBO_RCB_ENTRY_COUNT
71 #define MAX_RX_PACKET_DESC_COUNT \
72 (T3_STD_RCV_RCB_ENTRY_COUNT + T3_JUMBO_RCV_RCB_ENTRY_COUNT)
74 #define MAX_RX_PACKET_DESC_COUNT 800
76 #define DEFAULT_RX_PACKET_DESC_COUNT 2
78 /* Threshhold for double copying small tx packets. 0 will disable double */
79 /* copying of small Tx packets. */
80 #define DEFAULT_TX_COPY_BUFFER_SIZE 0
81 #define MIN_TX_COPY_BUFFER_SIZE 64
82 #define MAX_TX_COPY_BUFFER_SIZE 512
85 #define COMMON_CACHE_LINE_SIZE 0x20
86 #define COMMON_CACHE_LINE_MASK (COMMON_CACHE_LINE_SIZE-1)
88 /* Maximum number of fragment we can handle. */
89 #ifndef MAX_FRAGMENT_COUNT
90 #define MAX_FRAGMENT_COUNT 32
94 #define BCM5700_BX_MIN_FRAG_SIZE 10
95 #define BCM5700_BX_MIN_FRAG_BUF_SIZE 16 /* nice aligned size. */
96 #define BCM5700_BX_MIN_FRAG_BUF_SIZE_MASK (BCM5700_BX_MIN_FRAG_BUF_SIZE-1)
97 #define BCM5700_BX_TX_COPY_BUF_SIZE (BCM5700_BX_MIN_FRAG_BUF_SIZE * \
101 /* #define T3_MAGIC_NUM 'KevT' */
102 #define T3_FIRMWARE_MAILBOX 0x0b50
103 #define T3_MAGIC_NUM 0x4B657654
104 #define T3_MAGIC_NUM_DISABLE_DMAW_ON_LINK_CHANGE 0x4861764b
106 #define T3_NIC_DATA_SIG_ADDR 0x0b54
107 #define T3_NIC_DATA_SIG 0x4b657654
109 #define T3_NIC_DATA_NIC_CFG_ADDR 0x0b58
110 #define T3_NIC_CFG_LED_MODE_UNKNOWN BIT_NONE
111 #define T3_NIC_CFG_LED_MODE_TRIPLE_SPEED BIT_2
112 #define T3_NIC_CFG_LED_MODE_LINK_SPEED BIT_3
113 #define T3_NIC_CFG_LED_MODE_OPEN_DRAIN BIT_2
114 #define T3_NIC_CFG_LED_MODE_OUTPUT BIT_3
115 #define T3_NIC_CFG_LED_MODE_MASK (BIT_2 | BIT_3)
116 #define T3_NIC_CFG_PHY_TYPE_UNKNOWN BIT_NONE
117 #define T3_NIC_CFG_PHY_TYPE_COPPER BIT_4
118 #define T3_NIC_CFG_PHY_TYPE_FIBER BIT_5
119 #define T3_NIC_CFG_PHY_TYPE_MASK (BIT_4 | BIT_5)
120 #define T3_NIC_CFG_ENABLE_WOL BIT_6
121 #define T3_NIC_CFG_ENABLE_ASF BIT_7
122 #define T3_NIC_EEPROM_WP BIT_8
124 #define T3_NIC_DATA_PHY_ID_ADDR 0x0b74
125 #define T3_NIC_PHY_ID1_MASK 0xffff0000
126 #define T3_NIC_PHY_ID2_MASK 0x0000ffff
128 #define T3_CMD_MAILBOX 0x0b78
129 #define T3_CMD_NICDRV_ALIVE 0x01
130 #define T3_CMD_NICDRV_PAUSE_FW 0x02
131 #define T3_CMD_NICDRV_IPV4ADDR_CHANGE 0x03
132 #define T3_CMD_NICDRV_IPV6ADDR_CHANGE 0x04
133 #define T3_CMD_5703A0_FIX_DMAFW_DMAR 0x05
134 #define T3_CMD_5703A0_FIX_DMAFW_DMAW 0x06
136 #define T3_CMD_LENGTH_MAILBOX 0x0b7c
137 #define T3_CMD_DATA_MAILBOX 0x0b80
139 #define T3_ASF_FW_STATUS_MAILBOX 0x0c00
141 #define T3_DRV_STATE_MAILBOX 0x0c04
142 #define T3_DRV_STATE_START 0x01
143 #define T3_DRV_STATE_UNLOAD 0x02
144 #define T3_DRV_STATE_WOL 0x03
145 #define T3_DRV_STATE_SUSPEND 0x04
147 #define T3_FW_RESET_TYPE_MAILBOX 0x0c08
149 #define T3_MAC_ADDR_HIGH_MAILBOX 0x0c14
150 #define T3_MAC_ADDR_LOW_MAILBOX 0x0c18
152 /******************************************************************************/
153 /* Hardware constants. */
154 /******************************************************************************/
156 /* Number of entries in the send ring: must be 512. */
157 #define T3_SEND_RCB_ENTRY_COUNT 512
158 #define T3_SEND_RCB_ENTRY_COUNT_MASK (T3_SEND_RCB_ENTRY_COUNT-1)
160 /* Number of send RCBs. May be 1-16 but for now, only support one. */
161 #define T3_MAX_SEND_RCB_COUNT 16
163 /* Number of entries in the Standard Receive RCB. Must be 512 entries. */
164 #define T3_STD_RCV_RCB_ENTRY_COUNT 512
165 #define T3_STD_RCV_RCB_ENTRY_COUNT_MASK (T3_STD_RCV_RCB_ENTRY_COUNT-1)
166 #define DEFAULT_STD_RCV_DESC_COUNT 200 /* Must be < 512. */
167 #define MAX_STD_RCV_BUFFER_SIZE 0x600
169 /* Number of entries in the Mini Receive RCB. This value can either be */
170 /* 0, 1024. Currently Mini Receive RCB is disabled. */
171 #ifndef T3_MINI_RCV_RCB_ENTRY_COUNT
172 #define T3_MINI_RCV_RCB_ENTRY_COUNT 0
173 #endif /* T3_MINI_RCV_RCB_ENTRY_COUNT */
174 #define T3_MINI_RCV_RCB_ENTRY_COUNT_MASK (T3_MINI_RCV_RCB_ENTRY_COUNT-1)
175 #define MAX_MINI_RCV_BUFFER_SIZE 512
176 #define DEFAULT_MINI_RCV_BUFFER_SIZE 64
177 #define DEFAULT_MINI_RCV_DESC_COUNT 100 /* Must be < 1024. */
179 /* Number of entries in the Jumbo Receive RCB. This value must 256 or 0. */
180 /* Currently, Jumbo Receive RCB is disabled. */
181 #ifndef T3_JUMBO_RCV_RCB_ENTRY_COUNT
182 #define T3_JUMBO_RCV_RCB_ENTRY_COUNT 0
183 #endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
184 #define T3_JUMBO_RCV_RCB_ENTRY_COUNT_MASK (T3_JUMBO_RCV_RCB_ENTRY_COUNT-1)
186 #define MAX_JUMBO_RCV_BUFFER_SIZE (10 * 1024) /* > 1514 */
187 #define DEFAULT_JUMBO_RCV_BUFFER_SIZE (4 * 1024) /* > 1514 */
188 #define DEFAULT_JUMBO_RCV_DESC_COUNT 128 /* Must be < 256. */
190 #define MAX_JUMBO_TX_BUFFER_SIZE (8 * 1024) /* > 1514 */
191 #define DEFAULT_JUMBO_TX_BUFFER_SIZE (4 * 1024) /* > 1514 */
193 /* Number of receive return RCBs. Maybe 1-16 but for now, only support one. */
194 #define T3_MAX_RCV_RETURN_RCB_COUNT 16
196 /* Number of entries in a Receive Return ring. This value is either 1024 */
198 #ifndef T3_RCV_RETURN_RCB_ENTRY_COUNT
199 #define T3_RCV_RETURN_RCB_ENTRY_COUNT 1024
200 #endif /* T3_RCV_RETURN_RCB_ENTRY_COUNT */
201 #define T3_RCV_RETURN_RCB_ENTRY_COUNT_MASK (T3_RCV_RETURN_RCB_ENTRY_COUNT-1)
203 /* Default coalescing parameters. */
204 #define DEFAULT_RX_COALESCING_TICKS 100
205 #define MAX_RX_COALESCING_TICKS 500
206 #define DEFAULT_TX_COALESCING_TICKS 400
207 #define MAX_TX_COALESCING_TICKS 500
208 #define DEFAULT_RX_MAX_COALESCED_FRAMES 10
209 #define MAX_RX_MAX_COALESCED_FRAMES 100
210 #define ADAPTIVE_LO_RX_MAX_COALESCED_FRAMES 5
211 #define ADAPTIVE_HI_RX_MAX_COALESCED_FRAMES 42
212 #define ADAPTIVE_LO_RX_COALESCING_TICKS 50
213 #define ADAPTIVE_HI_RX_COALESCING_TICKS 300
214 #define ADAPTIVE_LO_PKT_THRESH 30000
215 #define ADAPTIVE_HI_PKT_THRESH 74000
216 #define DEFAULT_TX_MAX_COALESCED_FRAMES 40
217 #define ADAPTIVE_LO_TX_MAX_COALESCED_FRAMES 25
218 #define ADAPTIVE_HI_TX_MAX_COALESCED_FRAMES 75
219 #define MAX_TX_MAX_COALESCED_FRAMES 100
221 #define DEFAULT_RX_COALESCING_TICKS_DURING_INT 25
222 #define DEFAULT_TX_COALESCING_TICKS_DURING_INT 25
223 #define DEFAULT_RX_MAX_COALESCED_FRAMES_DURING_INT 5
224 #define DEFAULT_TX_MAX_COALESCED_FRAMES_DURING_INT 5
226 #define BAD_DEFAULT_VALUE 0xffffffff
228 #define DEFAULT_STATS_COALESCING_TICKS 1000000
229 #define MAX_STATS_COALESCING_TICKS 3600000000U
231 /* Receive BD Replenish thresholds. */
232 #define DEFAULT_RCV_STD_BD_REPLENISH_THRESHOLD 4
233 #define DEFAULT_RCV_JUMBO_BD_REPLENISH_THRESHOLD 4
235 #define SPLIT_MODE_DISABLE 0
236 #define SPLIT_MODE_ENABLE 1
238 #define SPLIT_MODE_5704_MAX_REQ 3
240 /* Maximum physical fragment size. */
241 #define MAX_FRAGMENT_SIZE (64 * 1024)
244 #define T3_STD_VIEW_SIZE (64 * 1024)
245 #define T3_FLAT_VIEW_SIZE (32 * 1024 * 1024)
247 /* Buffer descriptor base address on the NIC's memory. */
249 #define T3_NIC_SND_BUFFER_DESC_ADDR 0x4000
250 #define T3_NIC_STD_RCV_BUFFER_DESC_ADDR 0x6000
251 #define T3_NIC_JUMBO_RCV_BUFFER_DESC_ADDR 0x7000
253 #define T3_NIC_STD_RCV_BUFFER_DESC_ADDR_EXT_MEM 0xc000
254 #define T3_NIC_JUMBO_RCV_BUFFER_DESC_ADDR_EXT_MEM 0xd000
255 #define T3_NIC_MINI_RCV_BUFFER_DESC_ADDR_EXT_MEM 0xe000
257 #define T3_NIC_SND_BUFFER_DESC_SIZE (T3_SEND_RCB_ENTRY_COUNT * \
258 sizeof(T3_SND_BD) / 4)
260 #define T3_NIC_STD_RCV_BUFFER_DESC_SIZE (T3_STD_RCV_RCB_ENTRY_COUNT * \
261 sizeof(T3_RCV_BD) / 4)
263 #define T3_NIC_JUMBO_RCV_BUFFER_DESC_SIZE (T3_JUMBO_RCV_RCB_ENTRY_COUNT * \
264 sizeof(T3_EXT_RCV_BD) / 4)
267 #define T3_NIC_MBUF_POOL_ADDR 0x8000
268 /* #define T3_NIC_MBUF_POOL_SIZE 0x18000 */
269 #define T3_NIC_MBUF_POOL_SIZE96 0x18000
270 #define T3_NIC_MBUF_POOL_SIZE64 0x10000
272 #define T3_NIC_MBUF_POOL_ADDR_EXT_MEM 0x20000
274 /* DMA descriptor pool */
275 #define T3_NIC_DMA_DESC_POOL_ADDR 0x2000
276 #define T3_NIC_DMA_DESC_POOL_SIZE 0x2000 /* 8KB. */
278 #define T3_DEF_DMA_MBUF_LOW_WMARK 0x40
279 #define T3_DEF_RX_MAC_MBUF_LOW_WMARK 0x20
280 #define T3_DEF_MBUF_HIGH_WMARK 0x60
282 #define T3_DEF_DMA_MBUF_LOW_WMARK_JUMBO 304
283 #define T3_DEF_RX_MAC_MBUF_LOW_WMARK_JUMBO 152
284 #define T3_DEF_MBUF_HIGH_WMARK_JUMBO 380
286 #define T3_DEF_DMA_DESC_LOW_WMARK 5
287 #define T3_DEF_DMA_DESC_HIGH_WMARK 10
289 /* Maximum size of giant TCP packet can be sent */
290 #define T3_TCP_SEG_MAX_OFFLOAD_SIZE 64*1000
291 #define T3_TCP_SEG_MIN_NUM_SEG 20
293 #define T3_RX_CPU_ID 0x1
294 #define T3_TX_CPU_ID 0x2
295 #define T3_RX_CPU_SPAD_ADDR 0x30000
296 #define T3_RX_CPU_SPAD_SIZE 0x4000
297 #define T3_TX_CPU_SPAD_ADDR 0x34000
298 #define T3_TX_CPU_SPAD_SIZE 0x4000
300 typedef struct T3_DIR_ENTRY {
304 } T3_DIR_ENTRY, *PT3_DIR_ENTRY;
306 typedef struct T3_FWIMG_INFO {
307 LM_UINT32 StartAddress;
309 T3_DIR_ENTRY ROnlyData;
313 } T3_FWIMG_INFO, *PT3_FWIMG_INFO;
315 /******************************************************************************/
316 /* Tigon3 PCI Registers. */
317 /******************************************************************************/
318 #define T3_PCI_ID_BCM5700 0x164414e4
319 #define T3_PCI_ID_BCM5701 0x164514e4
320 #define T3_PCI_ID_BCM5702 0x164614e4
321 #define T3_PCI_ID_BCM5702x 0x16A614e4
322 #define T3_PCI_ID_BCM5703 0x164714e4
323 #define T3_PCI_ID_BCM5703x 0x16A714e4
324 #define T3_PCI_ID_BCM5702FE 0x164D14e4
325 #define T3_PCI_ID_BCM5704 0x164814e4
327 #define T3_PCI_VENDOR_ID (T3_PCI_ID & 0xffff)
328 #define T3_PCI_DEVICE_ID (T3_PCI_ID >> 16)
330 #define T3_PCI_MISC_HOST_CTRL_REG 0x68
332 /* The most significant 16bit of register 0x68. */
333 /* ChipId:4, ChipRev:4, MetalRev:8 */
334 #define T3_CHIP_ID_5700_A0 0x7000
335 #define T3_CHIP_ID_5700_A1 0x7001
336 #define T3_CHIP_ID_5700_B0 0x7100
337 #define T3_CHIP_ID_5700_B1 0x7101
338 #define T3_CHIP_ID_5700_C0 0x7200
340 #define T3_CHIP_ID_5701_A0 0x0000
341 #define T3_CHIP_ID_5701_B0 0x0100
342 #define T3_CHIP_ID_5701_B2 0x0102
343 #define T3_CHIP_ID_5701_B5 0x0105
345 #define T3_CHIP_ID_5703_A0 0x1000
346 #define T3_CHIP_ID_5703_A1 0x1001
347 #define T3_CHIP_ID_5703_A2 0x1002
349 #define T3_CHIP_ID_5704_A0 0x2000
352 #define T3_ASIC_REV(_ChipRevId) ((_ChipRevId) >> 12)
353 #define T3_ASIC_REV_5700 0x07
354 #define T3_ASIC_REV_5701 0x00
355 #define T3_ASIC_REV_5703 0x01
356 #define T3_ASIC_REV_5704 0x02
358 /* Chip id and revision. */
359 #define T3_CHIP_REV(_ChipRevId) ((_ChipRevId) >> 8)
360 #define T3_CHIP_REV_5700_AX 0x70
361 #define T3_CHIP_REV_5700_BX 0x71
362 #define T3_CHIP_REV_5700_CX 0x72
363 #define T3_CHIP_REV_5701_AX 0x00
365 /* Metal revision. */
366 #define T3_METAL_REV(_ChipRevId) ((_ChipRevId) & 0xff)
367 #define T3_METAL_REV_A0 0x00
368 #define T3_METAL_REV_A1 0x01
369 #define T3_METAL_REV_B0 0x00
370 #define T3_METAL_REV_B1 0x01
371 #define T3_METAL_REV_B2 0x02
373 #define T3_PCI_REG_CLOCK_CTRL 0x74
375 #define T3_PCI_DISABLE_RX_CLOCK BIT_10
376 #define T3_PCI_DISABLE_TX_CLOCK BIT_11
377 #define T3_PCI_SELECT_ALTERNATE_CLOCK BIT_12
378 #define T3_PCI_POWER_DOWN_PCI_PLL133 BIT_15
379 #define T3_PCI_44MHZ_CORE_CLOCK BIT_18
381 #define T3_PCI_REG_ADDR_REG 0x78
382 #define T3_PCI_REG_DATA_REG 0x80
384 #define T3_PCI_MEM_WIN_ADDR_REG 0x7c
385 #define T3_PCI_MEM_WIN_DATA_REG 0x84
387 #define T3_PCI_PM_CAP_REG 0x48
389 #define T3_PCI_PM_CAP_PME_D3COLD BIT_31
390 #define T3_PCI_PM_CAP_PME_D3HOT BIT_30
392 #define T3_PCI_PM_STATUS_CTRL_REG 0x4c
394 #define T3_PM_POWER_STATE_MASK (BIT_0 | BIT_1)
395 #define T3_PM_POWER_STATE_D0 BIT_NONE
396 #define T3_PM_POWER_STATE_D1 BIT_0
397 #define T3_PM_POWER_STATE_D2 BIT_1
398 #define T3_PM_POWER_STATE_D3 (BIT_0 | BIT_1)
400 #define T3_PM_PME_ENABLE BIT_8
401 #define T3_PM_PME_ASSERTED BIT_15
403 /* PCI state register. */
404 #define T3_PCI_STATE_REG 0x70
406 #define T3_PCI_STATE_FORCE_RESET BIT_0
407 #define T3_PCI_STATE_INT_NOT_ACTIVE BIT_1
408 #define T3_PCI_STATE_CONVENTIONAL_PCI_MODE BIT_2
409 #define T3_PCI_STATE_BUS_SPEED_HIGH BIT_3
410 #define T3_PCI_STATE_32BIT_PCI_BUS BIT_4
412 /* Broadcom subsystem/subvendor IDs. */
413 #define T3_SVID_BROADCOM 0x14e4
415 #define T3_SSID_BROADCOM_BCM95700A6 0x1644
416 #define T3_SSID_BROADCOM_BCM95701A5 0x0001
417 #define T3_SSID_BROADCOM_BCM95700T6 0x0002 /* BCM8002 */
418 #define T3_SSID_BROADCOM_BCM95700A9 0x0003 /* Agilent */
419 #define T3_SSID_BROADCOM_BCM95701T1 0x0005
420 #define T3_SSID_BROADCOM_BCM95701T8 0x0006
421 #define T3_SSID_BROADCOM_BCM95701A7 0x0007 /* Agilent */
422 #define T3_SSID_BROADCOM_BCM95701A10 0x0008
423 #define T3_SSID_BROADCOM_BCM95701A12 0x8008
424 #define T3_SSID_BROADCOM_BCM95703Ax1 0x0009
425 #define T3_SSID_BROADCOM_BCM95703Ax2 0x8009
427 /* 3COM subsystem/subvendor IDs. */
428 #define T3_SVID_3COM 0x10b7
430 #define T3_SSID_3COM_3C996T 0x1000
431 #define T3_SSID_3COM_3C996BT 0x1006
432 #define T3_SSID_3COM_3C996CT 0x1002
433 #define T3_SSID_3COM_3C997T 0x1003
434 #define T3_SSID_3COM_3C1000T 0x1007
435 #define T3_SSID_3COM_3C940BR01 0x1008
438 #define T3_SSID_3COM_3C996SX 0x1004
439 #define T3_SSID_3COM_3C997SX 0x1005
441 /* Dell subsystem/subvendor IDs. */
443 #define T3_SVID_DELL 0x1028
445 #define T3_SSID_DELL_VIPER 0x00d1
446 #define T3_SSID_DELL_JAGUAR 0x0106
447 #define T3_SSID_DELL_MERLOT 0x0109
448 #define T3_SSID_DELL_SLIM_MERLOT 0x010a
450 /* Compaq subsystem/subvendor IDs */
452 #define T3_SVID_COMPAQ 0x0e11
454 #define T3_SSID_COMPAQ_BANSHEE 0x007c
455 #define T3_SSID_COMPAQ_BANSHEE_2 0x009a
456 #define T3_SSID_COMPAQ_CHANGELING 0x007d
457 #define T3_SSID_COMPAQ_NC7780 0x0085
458 #define T3_SSID_COMPAQ_NC7780_2 0x0099
460 /******************************************************************************/
462 /******************************************************************************/
464 /* Control register. */
465 #define PHY_CTRL_REG 0x00
467 #define PHY_CTRL_SPEED_MASK (BIT_6 | BIT_13)
468 #define PHY_CTRL_SPEED_SELECT_10MBPS BIT_NONE
469 #define PHY_CTRL_SPEED_SELECT_100MBPS BIT_13
470 #define PHY_CTRL_SPEED_SELECT_1000MBPS BIT_6
471 #define PHY_CTRL_COLLISION_TEST_ENABLE BIT_7
472 #define PHY_CTRL_FULL_DUPLEX_MODE BIT_8
473 #define PHY_CTRL_RESTART_AUTO_NEG BIT_9
474 #define PHY_CTRL_ISOLATE_PHY BIT_10
475 #define PHY_CTRL_LOWER_POWER_MODE BIT_11
476 #define PHY_CTRL_AUTO_NEG_ENABLE BIT_12
477 #define PHY_CTRL_LOOPBACK_MODE BIT_14
478 #define PHY_CTRL_PHY_RESET BIT_15
480 /* Status register. */
481 #define PHY_STATUS_REG 0x01
483 #define PHY_STATUS_LINK_PASS BIT_2
484 #define PHY_STATUS_AUTO_NEG_COMPLETE BIT_5
486 /* Phy Id registers. */
487 #define PHY_ID1_REG 0x02
488 #define PHY_ID1_OUI_MASK 0xffff
490 #define PHY_ID2_REG 0x03
491 #define PHY_ID2_REV_MASK 0x000f
492 #define PHY_ID2_MODEL_MASK 0x03f0
493 #define PHY_ID2_OUI_MASK 0xfc00
495 /* Auto-negotiation advertisement register. */
496 #define PHY_AN_AD_REG 0x04
498 #define PHY_AN_AD_ASYM_PAUSE BIT_11
499 #define PHY_AN_AD_PAUSE_CAPABLE BIT_10
500 #define PHY_AN_AD_10BASET_HALF BIT_5
501 #define PHY_AN_AD_10BASET_FULL BIT_6
502 #define PHY_AN_AD_100BASETX_HALF BIT_7
503 #define PHY_AN_AD_100BASETX_FULL BIT_8
504 #define PHY_AN_AD_PROTOCOL_802_3_CSMA_CD 0x01
506 /* Auto-negotiation Link Partner Ability register. */
507 #define PHY_LINK_PARTNER_ABILITY_REG 0x05
509 #define PHY_LINK_PARTNER_ASYM_PAUSE BIT_11
510 #define PHY_LINK_PARTNER_PAUSE_CAPABLE BIT_10
512 /* Auto-negotiation expansion register. */
513 #define PHY_AN_EXPANSION_REG 0x06
515 /******************************************************************************/
516 /* BCM5400 and BCM5401 phy info. */
517 /******************************************************************************/
519 #define PHY_DEVICE_ID 1
521 /* OUI: bit 31-10; Model#: bit 9-4; Rev# bit 3-0. */
522 #define PHY_UNKNOWN_PHY 0x00000000
523 #define PHY_BCM5400_PHY_ID 0x60008040
524 #define PHY_BCM5401_PHY_ID 0x60008050
525 #define PHY_BCM5411_PHY_ID 0x60008070
526 #define PHY_BCM5701_PHY_ID 0x60008110
527 #define PHY_BCM5703_PHY_ID 0x60008160
528 #define PHY_BCM5704_PHY_ID 0x60008190
529 #define PHY_BCM8002_PHY_ID 0x60010140
531 #define PHY_BCM5401_B0_REV 0x1
532 #define PHY_BCM5401_B2_REV 0x3
533 #define PHY_BCM5401_C0_REV 0x6
535 #define PHY_ID_OUI_MASK 0xfffffc00
536 #define PHY_ID_MODEL_MASK 0x000003f0
537 #define PHY_ID_REV_MASK 0x0000000f
538 #define PHY_ID_MASK (PHY_ID_OUI_MASK | \
541 #define UNKNOWN_PHY_ID(x) ((((x) & PHY_ID_MASK) != PHY_BCM5400_PHY_ID) && \
542 (((x) & PHY_ID_MASK) != PHY_BCM5401_PHY_ID) && \
543 (((x) & PHY_ID_MASK) != PHY_BCM5411_PHY_ID) && \
544 (((x) & PHY_ID_MASK) != PHY_BCM5701_PHY_ID) && \
545 (((x) & PHY_ID_MASK) != PHY_BCM5703_PHY_ID) && \
546 (((x) & PHY_ID_MASK) != PHY_BCM5704_PHY_ID) && \
547 (((x) & PHY_ID_MASK) != PHY_BCM8002_PHY_ID))
549 /* 1000Base-T control register. */
550 #define BCM540X_1000BASET_CTRL_REG 0x09
552 #define BCM540X_AN_AD_1000BASET_HALF BIT_8
553 #define BCM540X_AN_AD_1000BASET_FULL BIT_9
554 #define BCM540X_CONFIG_AS_MASTER BIT_11
555 #define BCM540X_ENABLE_CONFIG_AS_MASTER BIT_12
557 /* Extended control register. */
558 #define BCM540X_EXT_CTRL_REG 0x10
560 #define BCM540X_EXT_CTRL_LINK3_LED_MODE BIT_1
561 #define BCM540X_EXT_CTRL_TBI BIT_15
563 /* PHY extended status register. */
564 #define BCM540X_EXT_STATUS_REG 0x11
566 #define BCM540X_EXT_STATUS_LINK_PASS BIT_8
568 /* DSP Coefficient Read/Write Port. */
569 #define BCM540X_DSP_RW_PORT 0x15
571 /* DSP Coeficient Address Register. */
572 #define BCM540X_DSP_ADDRESS_REG 0x17
574 #define BCM540X_DSP_TAP_NUMBER_MASK 0x00
575 #define BCM540X_DSP_AGC_A 0x00
576 #define BCM540X_DSP_AGC_B 0x01
577 #define BCM540X_DSP_MSE_PAIR_STATUS 0x02
578 #define BCM540X_DSP_SOFT_DECISION 0x03
579 #define BCM540X_DSP_PHASE_REG 0x04
580 #define BCM540X_DSP_SKEW 0x05
581 #define BCM540X_DSP_POWER_SAVER_UPPER_BOUND 0x06
582 #define BCM540X_DSP_POWER_SAVER_LOWER_BOUND 0x07
583 #define BCM540X_DSP_LAST_ECHO 0x08
584 #define BCM540X_DSP_FREQUENCY 0x09
585 #define BCM540X_DSP_PLL_BANDWIDTH 0x0a
586 #define BCM540X_DSP_PLL_PHASE_OFFSET 0x0b
588 #define BCM540X_DSP_FILTER_DCOFFSET (BIT_10 | BIT_11)
589 #define BCM540X_DSP_FILTER_FEXT3 (BIT_8 | BIT_9 | BIT_11)
590 #define BCM540X_DSP_FILTER_FEXT2 (BIT_9 | BIT_11)
591 #define BCM540X_DSP_FILTER_FEXT1 (BIT_8 | BIT_11)
592 #define BCM540X_DSP_FILTER_FEXT0 BIT_11
593 #define BCM540X_DSP_FILTER_NEXT3 (BIT_8 | BIT_9 | BIT_10)
594 #define BCM540X_DSP_FILTER_NEXT2 (BIT_9 | BIT_10)
595 #define BCM540X_DSP_FILTER_NEXT1 (BIT_8 | BIT_10)
596 #define BCM540X_DSP_FILTER_NEXT0 BIT_10
597 #define BCM540X_DSP_FILTER_ECHO (BIT_8 | BIT_9)
598 #define BCM540X_DSP_FILTER_DFE BIT_9
599 #define BCM540X_DSP_FILTER_FFE BIT_8
601 #define BCM540X_DSP_CONTROL_ALL_FILTERS BIT_12
603 #define BCM540X_DSP_SEL_CH_0 BIT_NONE
604 #define BCM540X_DSP_SEL_CH_1 BIT_13
605 #define BCM540X_DSP_SEL_CH_2 BIT_14
606 #define BCM540X_DSP_SEL_CH_3 (BIT_13 | BIT_14)
608 #define BCM540X_CONTROL_ALL_CHANNELS BIT_15
610 /* Auxilliary Control Register (Shadow Register) */
611 #define BCM5401_AUX_CTRL 0x18
613 #define BCM5401_SHADOW_SEL_MASK 0x7
614 #define BCM5401_SHADOW_SEL_NORMAL 0x00
615 #define BCM5401_SHADOW_SEL_10BASET 0x01
616 #define BCM5401_SHADOW_SEL_POWER_CONTROL 0x02
617 #define BCM5401_SHADOW_SEL_IP_PHONE 0x03
618 #define BCM5401_SHADOW_SEL_MISC_TEST1 0x04
619 #define BCM5401_SHADOW_SEL_MISC_TEST2 0x05
620 #define BCM5401_SHADOW_SEL_IP_PHONE_SEED 0x06
622 /* Shadow register selector == '000' */
623 #define BCM5401_SHDW_NORMAL_DIAG_MODE BIT_3
624 #define BCM5401_SHDW_NORMAL_DISABLE_MBP BIT_4
625 #define BCM5401_SHDW_NORMAL_DISABLE_LOW_PWR BIT_5
626 #define BCM5401_SHDW_NORMAL_DISABLE_INV_PRF BIT_6
627 #define BCM5401_SHDW_NORMAL_DISABLE_PRF BIT_7
628 #define BCM5401_SHDW_NORMAL_RX_SLICING_NORMAL BIT_NONE
629 #define BCM5401_SHDW_NORMAL_RX_SLICING_4D BIT_8
630 #define BCM5401_SHDW_NORMAL_RX_SLICING_3LVL_1D BIT_9
631 #define BCM5401_SHDW_NORMAL_RX_SLICING_5LVL_1D (BIT_8 | BIT_9)
632 #define BCM5401_SHDW_NORMAL_TX_6DB_CODING BIT_10
633 #define BCM5401_SHDW_NORMAL_ENABLE_SM_DSP_CLOCK BIT_11
634 #define BCM5401_SHDW_NORMAL_EDGERATE_CTRL_4NS BIT_NONE
635 #define BCM5401_SHDW_NORMAL_EDGERATE_CTRL_5NS BIT_12
636 #define BCM5401_SHDW_NORMAL_EDGERATE_CTRL_3NS BIT_13
637 #define BCM5401_SHDW_NORMAL_EDGERATE_CTRL_0NS (BIT_12 | BIT_13)
638 #define BCM5401_SHDW_NORMAL_EXT_PACKET_LENGTH BIT_14
639 #define BCM5401_SHDW_NORMAL_EXTERNAL_LOOPBACK BIT_15
641 /* Auxilliary status summary. */
642 #define BCM540X_AUX_STATUS_REG 0x19
644 #define BCM540X_AUX_LINK_PASS BIT_2
645 #define BCM540X_AUX_SPEED_MASK (BIT_8 | BIT_9 | BIT_10)
646 #define BCM540X_AUX_10BASET_HD BIT_8
647 #define BCM540X_AUX_10BASET_FD BIT_9
648 #define BCM540X_AUX_100BASETX_HD (BIT_8 | BIT_9)
649 #define BCM540X_AUX_100BASET4 BIT_10
650 #define BCM540X_AUX_100BASETX_FD (BIT_8 | BIT_10)
651 #define BCM540X_AUX_100BASET_HD (BIT_9 | BIT_10)
652 #define BCM540X_AUX_100BASET_FD (BIT_8 | BIT_9 | BIT_10)
654 /* Interrupt status. */
655 #define BCM540X_INT_STATUS_REG 0x1a
657 #define BCM540X_INT_LINK_CHANGE BIT_1
658 #define BCM540X_INT_SPEED_CHANGE BIT_2
659 #define BCM540X_INT_DUPLEX_CHANGE BIT_3
660 #define BCM540X_INT_AUTO_NEG_PAGE_RX BIT_10
662 /* Interrupt mask register. */
663 #define BCM540X_INT_MASK_REG 0x1b
665 /******************************************************************************/
666 /* Register definitions. */
667 /******************************************************************************/
669 typedef volatile LM_UINT8 T3_8BIT_REGISTER, *PT3_8BIT_REGISTER;
670 typedef volatile LM_UINT16 T3_16BIT_REGISTER, *PT3_16BIT_REGISTER;
671 typedef volatile LM_UINT32 T3_32BIT_REGISTER, *PT3_32BIT_REGISTER;
674 /* Big endian format. */
675 T3_32BIT_REGISTER High;
676 T3_32BIT_REGISTER Low;
677 } T3_64BIT_REGISTER, *PT3_64BIT_REGISTER;
679 typedef T3_64BIT_REGISTER T3_64BIT_HOST_ADDR, *PT3_64BIT_HOST_ADDR;
681 #define T3_NUM_OF_DMA_DESC 256
682 #define T3_NUM_OF_MBUF 768
685 T3_64BIT_REGISTER host_addr;
686 T3_32BIT_REGISTER nic_mbuf;
687 T3_16BIT_REGISTER len;
688 T3_16BIT_REGISTER cqid_sqid;
689 T3_32BIT_REGISTER flags;
690 T3_32BIT_REGISTER opaque1;
691 T3_32BIT_REGISTER opaque2;
692 T3_32BIT_REGISTER opaque3;
693 } T3_DMA_DESC, *PT3_DMA_DESC;
695 /******************************************************************************/
696 /* Ring control block. */
697 /******************************************************************************/
700 T3_64BIT_REGISTER HostRingAddr;
704 #ifdef BIG_ENDIAN_HOST
705 T3_16BIT_REGISTER MaxLen;
706 T3_16BIT_REGISTER Flags;
707 #else /* BIG_ENDIAN_HOST */
708 T3_16BIT_REGISTER Flags;
709 T3_16BIT_REGISTER MaxLen;
713 T3_32BIT_REGISTER MaxLen_Flags;
716 T3_32BIT_REGISTER NicRingAddr;
719 #define T3_RCB_FLAG_USE_EXT_RECV_BD BIT_0
720 #define T3_RCB_FLAG_RING_DISABLED BIT_1
722 /******************************************************************************/
724 /******************************************************************************/
727 * Size of status block is actually 0x50 bytes. Use 0x80 bytes for
728 * cache line alignment.
730 #define T3_STATUS_BLOCK_SIZE 0x80
733 volatile LM_UINT32 Status;
734 #define STATUS_BLOCK_UPDATED BIT_0
735 #define STATUS_BLOCK_LINK_CHANGED_STATUS BIT_1
736 #define STATUS_BLOCK_ERROR BIT_2
738 volatile LM_UINT32 StatusTag;
740 #ifdef BIG_ENDIAN_HOST
741 volatile LM_UINT16 RcvStdConIdx;
742 volatile LM_UINT16 RcvJumboConIdx;
744 volatile LM_UINT16 Reserved2;
745 volatile LM_UINT16 RcvMiniConIdx;
748 volatile LM_UINT16 SendConIdx; /* Send consumer index. */
749 volatile LM_UINT16 RcvProdIdx; /* Receive producer index. */
751 #else /* BIG_ENDIAN_HOST */
752 volatile LM_UINT16 RcvJumboConIdx;
753 volatile LM_UINT16 RcvStdConIdx;
755 volatile LM_UINT16 RcvMiniConIdx;
756 volatile LM_UINT16 Reserved2;
759 volatile LM_UINT16 RcvProdIdx; /* Receive producer index. */
760 volatile LM_UINT16 SendConIdx; /* Send consumer index. */
763 } T3_STATUS_BLOCK, *PT3_STATUS_BLOCK;
765 /******************************************************************************/
766 /* Receive buffer descriptors. */
767 /******************************************************************************/
770 T3_64BIT_HOST_ADDR HostAddr;
772 #ifdef BIG_ENDIAN_HOST
773 volatile LM_UINT16 Index;
774 volatile LM_UINT16 Len;
776 volatile LM_UINT16 Type;
777 volatile LM_UINT16 Flags;
779 volatile LM_UINT16 IpCksum;
780 volatile LM_UINT16 TcpUdpCksum;
782 volatile LM_UINT16 ErrorFlag;
783 volatile LM_UINT16 VlanTag;
784 #else /* BIG_ENDIAN_HOST */
785 volatile LM_UINT16 Len;
786 volatile LM_UINT16 Index;
788 volatile LM_UINT16 Flags;
789 volatile LM_UINT16 Type;
791 volatile LM_UINT16 TcpUdpCksum;
792 volatile LM_UINT16 IpCksum;
794 volatile LM_UINT16 VlanTag;
795 volatile LM_UINT16 ErrorFlag;
798 volatile LM_UINT32 Reserved;
799 volatile LM_UINT32 Opaque;
800 } T3_RCV_BD, *PT3_RCV_BD;
803 T3_64BIT_HOST_ADDR HostAddr[3];
805 #ifdef BIG_ENDIAN_HOST
811 #else /* BIG_ENDIAN_HOST */
820 } T3_EXT_RCV_BD, *PT3_EXT_RCV_BD;
823 #define RCV_BD_ERR_BAD_CRC 0x0001
824 #define RCV_BD_ERR_COLL_DETECT 0x0002
825 #define RCV_BD_ERR_LINK_LOST_DURING_PKT 0x0004
826 #define RCV_BD_ERR_PHY_DECODE_ERR 0x0008
827 #define RCV_BD_ERR_ODD_NIBBLED_RCVD_MII 0x0010
828 #define RCV_BD_ERR_MAC_ABORT 0x0020
829 #define RCV_BD_ERR_LEN_LT_64 0x0040
830 #define RCV_BD_ERR_TRUNC_NO_RESOURCES 0x0080
831 #define RCV_BD_ERR_GIANT_FRAME_RCVD 0x0100
833 /* Buffer descriptor flags. */
834 #define RCV_BD_FLAG_END 0x0004
835 #define RCV_BD_FLAG_JUMBO_RING 0x0020
836 #define RCV_BD_FLAG_VLAN_TAG 0x0040
837 #define RCV_BD_FLAG_FRAME_HAS_ERROR 0x0400
838 #define RCV_BD_FLAG_MINI_RING 0x0800
839 #define RCV_BD_FLAG_IP_CHKSUM_FIELD 0x1000
840 #define RCV_BD_FLAG_TCP_UDP_CHKSUM_FIELD 0x2000
841 #define RCV_BD_FLAG_TCP_PACKET 0x4000
843 /******************************************************************************/
844 /* Send buffer descriptor. */
845 /******************************************************************************/
848 T3_64BIT_HOST_ADDR HostAddr;
852 #ifdef BIG_ENDIAN_HOST
855 #else /* BIG_ENDIAN_HOST */
866 #ifdef BIG_ENDIAN_HOST
869 #else /* BIG_ENDIAN_HOST */
877 } T3_SND_BD, *PT3_SND_BD;
879 /* Send buffer descriptor flags. */
880 #define SND_BD_FLAG_TCP_UDP_CKSUM 0x0001
881 #define SND_BD_FLAG_IP_CKSUM 0x0002
882 #define SND_BD_FLAG_END 0x0004
883 #define SND_BD_FLAG_IP_FRAG 0x0008
884 #define SND_BD_FLAG_IP_FRAG_END 0x0010
885 #define SND_BD_FLAG_VLAN_TAG 0x0040
886 #define SND_BD_FLAG_COAL_NOW 0x0080
887 #define SND_BD_FLAG_CPU_PRE_DMA 0x0100
888 #define SND_BD_FLAG_CPU_POST_DMA 0x0200
889 #define SND_BD_FLAG_INSERT_SRC_ADDR 0x1000
890 #define SND_BD_FLAG_CHOOSE_SRC_ADDR 0x6000
891 #define SND_BD_FLAG_DONT_GEN_CRC 0x8000
894 typedef struct T3_MBUF_FRAME_DESC {
895 #ifdef BIG_ENDIAN_HOST
896 LM_UINT32 status_control;
907 LM_UINT16 ip_hdr_start;
908 LM_UINT16 tcp_udp_hdr_start;
916 LM_UINT16 data_start;
925 LM_UINT16 ip_checksum;
926 LM_UINT16 tcp_udp_checksum;
934 LM_UINT16 pseudo_checksum;
935 LM_UINT16 checksum_status;
943 LM_UINT16 rule_match;
963 LM_UINT32 status_control;
974 LM_UINT16 tcp_udp_hdr_start;
975 LM_UINT16 ip_hdr_start;
984 LM_UINT16 data_start;
992 LM_UINT16 tcp_udp_checksum;
993 LM_UINT16 ip_checksum;
1001 LM_UINT16 checksum_status;
1002 LM_UINT16 pseudo_checksum;
1012 LM_UINT16 rule_match;
1021 LM_UINT16 reserved2;
1027 LM_UINT32 reserved3;
1028 LM_UINT32 reserved4;
1030 } T3_MBUF_FRAME_DESC, *PT3_MBUF_FRAME_DESC;
1032 typedef struct T3_MBUF_HDR {
1037 unsigned int reserved1:7;
1038 unsigned int next_mbuf:16;
1039 unsigned int length:7;
1045 LM_UINT32 next_frame_ptr;
1046 } T3_MBUF_HDR, *PT3_MBUF_HDR;
1048 typedef struct T3_MBUF {
1052 T3_MBUF_FRAME_DESC frame_hdr;
1060 } T3_MBUF, *PT3_MBUF;
1062 #define T3_MBUF_BASE (T3_NIC_MBUF_POOL_ADDR >> 7)
1063 #define T3_MBUF_END ((T3_NIC_MBUF_POOL_ADDR + T3_NIC_MBUF_POOL_SIZE) >> 7)
1065 /******************************************************************************/
1066 /* Statistics block. */
1067 /******************************************************************************/
1070 LM_UINT8 Reserved0[0x400 - 0x300];
1072 /* Statistics maintained by Receive MAC. */
1073 T3_64BIT_REGISTER ifHCInOctets;
1074 T3_64BIT_REGISTER Reserved1;
1075 T3_64BIT_REGISTER etherStatsFragments;
1076 T3_64BIT_REGISTER ifHCInUcastPkts;
1077 T3_64BIT_REGISTER ifHCInMulticastPkts;
1078 T3_64BIT_REGISTER ifHCInBroadcastPkts;
1079 T3_64BIT_REGISTER dot3StatsFCSErrors;
1080 T3_64BIT_REGISTER dot3StatsAlignmentErrors;
1081 T3_64BIT_REGISTER xonPauseFramesReceived;
1082 T3_64BIT_REGISTER xoffPauseFramesReceived;
1083 T3_64BIT_REGISTER macControlFramesReceived;
1084 T3_64BIT_REGISTER xoffStateEntered;
1085 T3_64BIT_REGISTER dot3StatsFramesTooLong;
1086 T3_64BIT_REGISTER etherStatsJabbers;
1087 T3_64BIT_REGISTER etherStatsUndersizePkts;
1088 T3_64BIT_REGISTER inRangeLengthError;
1089 T3_64BIT_REGISTER outRangeLengthError;
1090 T3_64BIT_REGISTER etherStatsPkts64Octets;
1091 T3_64BIT_REGISTER etherStatsPkts65Octetsto127Octets;
1092 T3_64BIT_REGISTER etherStatsPkts128Octetsto255Octets;
1093 T3_64BIT_REGISTER etherStatsPkts256Octetsto511Octets;
1094 T3_64BIT_REGISTER etherStatsPkts512Octetsto1023Octets;
1095 T3_64BIT_REGISTER etherStatsPkts1024Octetsto1522Octets;
1096 T3_64BIT_REGISTER etherStatsPkts1523Octetsto2047Octets;
1097 T3_64BIT_REGISTER etherStatsPkts2048Octetsto4095Octets;
1098 T3_64BIT_REGISTER etherStatsPkts4096Octetsto8191Octets;
1099 T3_64BIT_REGISTER etherStatsPkts8192Octetsto9022Octets;
1101 T3_64BIT_REGISTER Unused1[37];
1103 /* Statistics maintained by Transmit MAC. */
1104 T3_64BIT_REGISTER ifHCOutOctets;
1105 T3_64BIT_REGISTER Reserved2;
1106 T3_64BIT_REGISTER etherStatsCollisions;
1107 T3_64BIT_REGISTER outXonSent;
1108 T3_64BIT_REGISTER outXoffSent;
1109 T3_64BIT_REGISTER flowControlDone;
1110 T3_64BIT_REGISTER dot3StatsInternalMacTransmitErrors;
1111 T3_64BIT_REGISTER dot3StatsSingleCollisionFrames;
1112 T3_64BIT_REGISTER dot3StatsMultipleCollisionFrames;
1113 T3_64BIT_REGISTER dot3StatsDeferredTransmissions;
1114 T3_64BIT_REGISTER Reserved3;
1115 T3_64BIT_REGISTER dot3StatsExcessiveCollisions;
1116 T3_64BIT_REGISTER dot3StatsLateCollisions;
1117 T3_64BIT_REGISTER dot3Collided2Times;
1118 T3_64BIT_REGISTER dot3Collided3Times;
1119 T3_64BIT_REGISTER dot3Collided4Times;
1120 T3_64BIT_REGISTER dot3Collided5Times;
1121 T3_64BIT_REGISTER dot3Collided6Times;
1122 T3_64BIT_REGISTER dot3Collided7Times;
1123 T3_64BIT_REGISTER dot3Collided8Times;
1124 T3_64BIT_REGISTER dot3Collided9Times;
1125 T3_64BIT_REGISTER dot3Collided10Times;
1126 T3_64BIT_REGISTER dot3Collided11Times;
1127 T3_64BIT_REGISTER dot3Collided12Times;
1128 T3_64BIT_REGISTER dot3Collided13Times;
1129 T3_64BIT_REGISTER dot3Collided14Times;
1130 T3_64BIT_REGISTER dot3Collided15Times;
1131 T3_64BIT_REGISTER ifHCOutUcastPkts;
1132 T3_64BIT_REGISTER ifHCOutMulticastPkts;
1133 T3_64BIT_REGISTER ifHCOutBroadcastPkts;
1134 T3_64BIT_REGISTER dot3StatsCarrierSenseErrors;
1135 T3_64BIT_REGISTER ifOutDiscards;
1136 T3_64BIT_REGISTER ifOutErrors;
1138 T3_64BIT_REGISTER Unused2[31];
1140 /* Statistics maintained by Receive List Placement. */
1141 T3_64BIT_REGISTER COSIfHCInPkts[16];
1142 T3_64BIT_REGISTER COSFramesDroppedDueToFilters;
1143 T3_64BIT_REGISTER nicDmaWriteQueueFull;
1144 T3_64BIT_REGISTER nicDmaWriteHighPriQueueFull;
1145 T3_64BIT_REGISTER nicNoMoreRxBDs;
1146 T3_64BIT_REGISTER ifInDiscards;
1147 T3_64BIT_REGISTER ifInErrors;
1148 T3_64BIT_REGISTER nicRecvThresholdHit;
1150 T3_64BIT_REGISTER Unused3[9];
1152 /* Statistics maintained by Send Data Initiator. */
1153 T3_64BIT_REGISTER COSIfHCOutPkts[16];
1154 T3_64BIT_REGISTER nicDmaReadQueueFull;
1155 T3_64BIT_REGISTER nicDmaReadHighPriQueueFull;
1156 T3_64BIT_REGISTER nicSendDataCompQueueFull;
1158 /* Statistics maintained by Host Coalescing. */
1159 T3_64BIT_REGISTER nicRingSetSendProdIndex;
1160 T3_64BIT_REGISTER nicRingStatusUpdate;
1161 T3_64BIT_REGISTER nicInterrupts;
1162 T3_64BIT_REGISTER nicAvoidedInterrupts;
1163 T3_64BIT_REGISTER nicSendThresholdHit;
1165 LM_UINT8 Reserved4[0xb00 - 0x9c0];
1166 } T3_STATS_BLOCK, *PT3_STATS_BLOCK;
1168 /******************************************************************************/
1169 /* PCI configuration registers. */
1170 /******************************************************************************/
1173 T3_16BIT_REGISTER VendorId;
1174 T3_16BIT_REGISTER DeviceId;
1176 T3_16BIT_REGISTER Command;
1177 T3_16BIT_REGISTER Status;
1179 T3_32BIT_REGISTER ClassCodeRevId;
1181 T3_8BIT_REGISTER CacheLineSize;
1182 T3_8BIT_REGISTER LatencyTimer;
1183 T3_8BIT_REGISTER HeaderType;
1184 T3_8BIT_REGISTER Bist;
1186 T3_32BIT_REGISTER MemBaseAddrLow;
1187 T3_32BIT_REGISTER MemBaseAddrHigh;
1189 LM_UINT8 Unused1[20];
1191 T3_16BIT_REGISTER SubsystemVendorId;
1192 T3_16BIT_REGISTER SubsystemId;
1194 T3_32BIT_REGISTER RomBaseAddr;
1196 T3_8BIT_REGISTER PciXCapiblityPtr;
1197 LM_UINT8 Unused2[7];
1199 T3_8BIT_REGISTER IntLine;
1200 T3_8BIT_REGISTER IntPin;
1201 T3_8BIT_REGISTER MinGnt;
1202 T3_8BIT_REGISTER MaxLat;
1204 T3_8BIT_REGISTER PciXCapabilities;
1205 T3_8BIT_REGISTER PmCapabilityPtr;
1206 T3_16BIT_REGISTER PciXCommand;
1208 T3_32BIT_REGISTER PciXStatus;
1210 T3_8BIT_REGISTER PmCapabilityId;
1211 T3_8BIT_REGISTER VpdCapabilityPtr;
1212 T3_16BIT_REGISTER PmCapabilities;
1214 T3_16BIT_REGISTER PmCtrlStatus;
1215 #define PM_CTRL_PME_STATUS BIT_15
1216 #define PM_CTRL_PME_ENABLE BIT_8
1217 #define PM_CTRL_PME_POWER_STATE_D0 0
1218 #define PM_CTRL_PME_POWER_STATE_D1 1
1219 #define PM_CTRL_PME_POWER_STATE_D2 2
1220 #define PM_CTRL_PME_POWER_STATE_D3H 3
1222 T3_8BIT_REGISTER BridgeSupportExt;
1223 T3_8BIT_REGISTER PmData;
1225 T3_8BIT_REGISTER VpdCapabilityId;
1226 T3_8BIT_REGISTER MsiCapabilityPtr;
1227 T3_16BIT_REGISTER VpdAddrFlag;
1228 #define VPD_FLAG_WRITE (1 << 15)
1229 #define VPD_FLAG_RW_MASK (1 << 15)
1230 #define VPD_FLAG_READ 0
1232 T3_32BIT_REGISTER VpdData;
1234 T3_8BIT_REGISTER MsiCapabilityId;
1235 T3_8BIT_REGISTER NextCapabilityPtr;
1236 T3_16BIT_REGISTER MsiCtrl;
1237 #define MSI_CTRL_64BIT_CAP (1 << 7)
1238 #define MSI_CTRL_MSG_ENABLE(x) (x << 4)
1239 #define MSI_CTRL_MSG_CAP(x) (x << 1)
1240 #define MSI_CTRL_ENABLE (1 << 0)
1242 T3_32BIT_REGISTER MsiAddrLow;
1243 T3_32BIT_REGISTER MsiAddrHigh;
1245 T3_16BIT_REGISTER MsiData;
1246 T3_16BIT_REGISTER Unused3;
1248 T3_32BIT_REGISTER MiscHostCtrl;
1249 #define MISC_HOST_CTRL_CLEAR_INT BIT_0
1250 #define MISC_HOST_CTRL_MASK_PCI_INT BIT_1
1251 #define MISC_HOST_CTRL_ENABLE_ENDIAN_BYTE_SWAP BIT_2
1252 #define MISC_HOST_CTRL_ENABLE_ENDIAN_WORD_SWAP BIT_3
1253 #define MISC_HOST_CTRL_ENABLE_PCI_STATE_REG_RW BIT_4
1254 #define MISC_HOST_CTRL_ENABLE_CLK_REG_RW BIT_5
1255 #define MISC_HOST_CTRL_ENABLE_REG_WORD_SWAP BIT_6
1256 #define MISC_HOST_CTRL_ENABLE_INDIRECT_ACCESS BIT_7
1257 #define MISC_HOST_CTRL_ENABLE_INT_MASK_MODE BIT_8
1258 #define MISC_HOST_CTRL_ENABLE_TAGGED_STATUS_MODE BIT_9
1260 T3_32BIT_REGISTER DmaReadWriteCtrl;
1261 #define DMA_CTRL_WRITE_BOUNDARY_MASK (BIT_11 | BIT_12 | BIT_13)
1262 #define DMA_CTRL_WRITE_BOUNDARY_DISABLE 0
1263 #define DMA_CTRL_WRITE_BOUNDARY_16 BIT_11
1264 #define DMA_CTRL_WRITE_BOUNDARY_32 BIT_12
1265 #define DMA_CTRL_WRITE_BOUNDARY_64 (BIT_12 | BIT_11)
1266 #define DMA_CTRL_WRITE_BOUNDARY_128 BIT_13
1267 #define DMA_CTRL_WRITE_BOUNDARY_256 (BIT_13 | BIT_11)
1268 #define DMA_CTRL_WRITE_BOUNDARY_512 (BIT_13 | BIT_12)
1269 #define DMA_CTRL_WRITE_BOUNDARY_1024 (BIT_13 | BIT_12 | BIT_11)
1270 #define DMA_CTRL_WRITE_ONE_DMA_AT_ONCE BIT_14
1272 T3_32BIT_REGISTER PciState;
1273 #define T3_PCI_STATE_FORCE_PCI_RESET BIT_0
1274 #define T3_PCI_STATE_INTERRUPT_NOT_ACTIVE BIT_1
1275 #define T3_PCI_STATE_NOT_PCI_X_BUS BIT_2
1276 #define T3_PCI_STATE_HIGH_BUS_SPEED BIT_3
1277 #define T3_PCI_STATE_32BIT_PCI_BUS BIT_4
1278 #define T3_PCI_STATE_PCI_ROM_ENABLE BIT_5
1279 #define T3_PCI_STATE_PCI_ROM_RETRY_ENABLE BIT_6
1280 #define T3_PCI_STATE_FLAT_VIEW BIT_8
1281 #define T3_PCI_STATE_RETRY_SAME_DMA BIT_13
1283 T3_32BIT_REGISTER ClockCtrl;
1284 #define T3_PCI_CLKCTRL_TXCPU_CLK_DISABLE BIT_11
1285 #define T3_PCI_CLKCTRL_RXCPU_CLK_DISABLE BIT_10
1286 #define T3_PCI_CLKCTRL_CORE_CLK_DISABLE BIT_9
1288 T3_32BIT_REGISTER RegBaseAddr;
1290 T3_32BIT_REGISTER MemWindowBaseAddr;
1293 /* These registers are ONLY visible to NIC CPU */
1294 T3_32BIT_REGISTER PowerConsumed;
1295 T3_32BIT_REGISTER PowerDissipated;
1296 #else /* NIC_CPU_VIEW */
1297 T3_32BIT_REGISTER RegData;
1298 T3_32BIT_REGISTER MemWindowData;
1299 #endif /* !NIC_CPU_VIEW */
1301 T3_32BIT_REGISTER ModeCtrl;
1303 T3_32BIT_REGISTER MiscCfg;
1305 T3_32BIT_REGISTER MiscLocalCtrl;
1307 T3_32BIT_REGISTER Unused4;
1309 /* NOTE: Big/Little-endian clarification needed. Are these register */
1310 /* in big or little endian formate. */
1311 T3_64BIT_REGISTER StdRingProdIdx;
1312 T3_64BIT_REGISTER RcvRetRingConIdx;
1313 T3_64BIT_REGISTER SndProdIdx;
1315 LM_UINT8 Unused5[80];
1316 } T3_PCI_CONFIGURATION, *PT3_PCI_CONFIGURATION;
1318 #define PCIX_CMD_MAX_SPLIT_MASK 0x0070
1319 #define PCIX_CMD_MAX_SPLIT_SHL 4
1320 #define PCIX_CMD_MAX_BURST_MASK 0x000c
1321 #define PCIX_CMD_MAX_BURST_SHL 2
1322 #define PCIX_CMD_MAX_BURST_CPIOB 2
1324 /******************************************************************************/
1325 /* Mac control registers. */
1326 /******************************************************************************/
1329 /* MAC mode control. */
1330 T3_32BIT_REGISTER Mode;
1331 #define MAC_MODE_GLOBAL_RESET BIT_0
1332 #define MAC_MODE_HALF_DUPLEX BIT_1
1333 #define MAC_MODE_PORT_MODE_MASK (BIT_2 | BIT_3)
1334 #define MAC_MODE_PORT_MODE_TBI (BIT_2 | BIT_3)
1335 #define MAC_MODE_PORT_MODE_GMII BIT_3
1336 #define MAC_MODE_PORT_MODE_MII BIT_2
1337 #define MAC_MODE_PORT_MODE_NONE BIT_NONE
1338 #define MAC_MODE_PORT_INTERNAL_LOOPBACK BIT_4
1339 #define MAC_MODE_TAGGED_MAC_CONTROL BIT_7
1340 #define MAC_MODE_TX_BURSTING BIT_8
1341 #define MAC_MODE_MAX_DEFER BIT_9
1342 #define MAC_MODE_LINK_POLARITY BIT_10
1343 #define MAC_MODE_ENABLE_RX_STATISTICS BIT_11
1344 #define MAC_MODE_CLEAR_RX_STATISTICS BIT_12
1345 #define MAC_MODE_FLUSH_RX_STATISTICS BIT_13
1346 #define MAC_MODE_ENABLE_TX_STATISTICS BIT_14
1347 #define MAC_MODE_CLEAR_TX_STATISTICS BIT_15
1348 #define MAC_MODE_FLUSH_TX_STATISTICS BIT_16
1349 #define MAC_MODE_SEND_CONFIGS BIT_17
1350 #define MAC_MODE_DETECT_MAGIC_PACKET_ENABLE BIT_18
1351 #define MAC_MODE_ACPI_POWER_ON_ENABLE BIT_19
1352 #define MAC_MODE_ENABLE_MIP BIT_20
1353 #define MAC_MODE_ENABLE_TDE BIT_21
1354 #define MAC_MODE_ENABLE_RDE BIT_22
1355 #define MAC_MODE_ENABLE_FHDE BIT_23
1358 T3_32BIT_REGISTER Status;
1359 #define MAC_STATUS_PCS_SYNCED BIT_0
1360 #define MAC_STATUS_SIGNAL_DETECTED BIT_1
1361 #define MAC_STATUS_RECEIVING_CFG BIT_2
1362 #define MAC_STATUS_CFG_CHANGED BIT_3
1363 #define MAC_STATUS_SYNC_CHANGED BIT_4
1364 #define MAC_STATUS_PORT_DECODE_ERROR BIT_10
1365 #define MAC_STATUS_LINK_STATE_CHANGED BIT_12
1366 #define MAC_STATUS_MI_COMPLETION BIT_22
1367 #define MAC_STATUS_MI_INTERRUPT BIT_23
1368 #define MAC_STATUS_AP_ERROR BIT_24
1369 #define MAC_STATUS_ODI_ERROR BIT_25
1370 #define MAC_STATUS_RX_STATS_OVERRUN BIT_26
1371 #define MAC_STATUS_TX_STATS_OVERRUN BIT_27
1374 T3_32BIT_REGISTER MacEvent;
1375 #define MAC_EVENT_ENABLE_PORT_DECODE_ERR BIT_10
1376 #define MAC_EVENT_ENABLE_LINK_STATE_CHANGED_ATTN BIT_12
1377 #define MAC_EVENT_ENABLE_MI_COMPLETION BIT_22
1378 #define MAC_EVENT_ENABLE_MI_INTERRUPT BIT_23
1379 #define MAC_EVENT_ENABLE_AP_ERROR BIT_24
1380 #define MAC_EVENT_ENABLE_ODI_ERROR BIT_25
1381 #define MAC_EVENT_ENABLE_RX_STATS_OVERRUN BIT_26
1382 #define MAC_EVENT_ENABLE_TX_STATS_OVERRUN BIT_27
1385 T3_32BIT_REGISTER LedCtrl;
1386 #define LED_CTRL_OVERRIDE_LINK_LED BIT_0
1387 #define LED_CTRL_1000MBPS_LED_ON BIT_1
1388 #define LED_CTRL_100MBPS_LED_ON BIT_2
1389 #define LED_CTRL_10MBPS_LED_ON BIT_3
1390 #define LED_CTRL_OVERRIDE_TRAFFIC_LED BIT_4
1391 #define LED_CTRL_BLINK_TRAFFIC_LED BIT_5
1392 #define LED_CTRL_TRAFFIC_LED BIT_6
1393 #define LED_CTRL_1000MBPS_LED_STATUS BIT_7
1394 #define LED_CTRL_100MBPS_LED_STATUS BIT_8
1395 #define LED_CTRL_10MBPS_LED_STATUS BIT_9
1396 #define LED_CTRL_TRAFFIC_LED_STATUS BIT_10
1397 #define LED_CTRL_MAC_MODE BIT_NONE
1398 #define LED_CTRL_PHY_MODE_1 BIT_11
1399 #define LED_CTRL_PHY_MODE_2 BIT_12
1400 #define LED_CTRL_BLINK_RATE_MASK 0x7ff80000
1401 #define LED_CTRL_OVERRIDE_BLINK_PERIOD BIT_19
1402 #define LED_CTRL_OVERRIDE_BLINK_RATE BIT_31
1404 /* MAC addresses. */
1406 T3_32BIT_REGISTER High; /* Upper 2 bytes. */
1407 T3_32BIT_REGISTER Low; /* Lower 4 bytes. */
1410 /* ACPI Mbuf pointer. */
1411 T3_32BIT_REGISTER AcpiMbufPtr;
1413 /* ACPI Length and Offset. */
1414 T3_32BIT_REGISTER AcpiLengthOffset;
1415 #define ACPI_LENGTH_MASK 0xffff
1416 #define ACPI_OFFSET_MASK 0x0fff0000
1417 #define ACPI_LENGTH(x) x
1418 #define ACPI_OFFSET(x) ((x) << 16)
1420 /* Transmit random backoff. */
1421 T3_32BIT_REGISTER TxBackoffSeed;
1422 #define MAC_TX_BACKOFF_SEED_MASK 0x3ff
1425 T3_32BIT_REGISTER MtuSize;
1426 #define MAC_RX_MTU_MASK 0xffff
1428 /* Gigabit PCS Test. */
1429 T3_32BIT_REGISTER PcsTest;
1430 #define MAC_PCS_TEST_DATA_PATTERN_MASK 0x0fffff
1431 #define MAC_PCS_TEST_ENABLE BIT_20
1433 /* Transmit Gigabit Auto-Negotiation. */
1434 T3_32BIT_REGISTER TxAutoNeg;
1435 #define MAC_AN_TX_AN_DATA_MASK 0xffff
1437 /* Receive Gigabit Auto-Negotiation. */
1438 T3_32BIT_REGISTER RxAutoNeg;
1439 #define MAC_AN_RX_AN_DATA_MASK 0xffff
1441 /* MI Communication. */
1442 T3_32BIT_REGISTER MiCom;
1443 #define MI_COM_CMD_MASK (BIT_26 | BIT_27)
1444 #define MI_COM_CMD_WRITE BIT_26
1445 #define MI_COM_CMD_READ BIT_27
1446 #define MI_COM_READ_FAILED BIT_28
1447 #define MI_COM_START BIT_29
1448 #define MI_COM_BUSY BIT_29
1450 #define MI_COM_PHY_ADDR_MASK 0x1f
1451 #define MI_COM_FIRST_PHY_ADDR_BIT 21
1453 #define MI_COM_PHY_REG_ADDR_MASK 0x1f
1454 #define MI_COM_FIRST_PHY_REG_ADDR_BIT 16
1456 #define MI_COM_PHY_DATA_MASK 0xffff
1459 T3_32BIT_REGISTER MiStatus;
1460 #define MI_STATUS_ENABLE_LINK_STATUS_ATTN BIT_0
1463 T3_32BIT_REGISTER MiMode;
1464 #define MI_MODE_CLOCK_SPEED_10MHZ BIT_0
1465 #define MI_MODE_USE_SHORT_PREAMBLE BIT_1
1466 #define MI_MODE_AUTO_POLLING_ENABLE BIT_4
1467 #define MI_MODE_CORE_CLOCK_SPEED_62MHZ BIT_15
1469 /* Auto-polling status. */
1470 T3_32BIT_REGISTER AutoPollStatus;
1471 #define AUTO_POLL_ERROR BIT_0
1473 /* Transmit MAC mode. */
1474 T3_32BIT_REGISTER TxMode;
1475 #define TX_MODE_RESET BIT_0
1476 #define TX_MODE_ENABLE BIT_1
1477 #define TX_MODE_ENABLE_FLOW_CONTROL BIT_4
1478 #define TX_MODE_ENABLE_BIG_BACKOFF BIT_5
1479 #define TX_MODE_ENABLE_LONG_PAUSE BIT_6
1481 /* Transmit MAC status. */
1482 T3_32BIT_REGISTER TxStatus;
1483 #define TX_STATUS_RX_CURRENTLY_XOFFED BIT_0
1484 #define TX_STATUS_SENT_XOFF BIT_1
1485 #define TX_STATUS_SENT_XON BIT_2
1486 #define TX_STATUS_LINK_UP BIT_3
1487 #define TX_STATUS_ODI_UNDERRUN BIT_4
1488 #define TX_STATUS_ODI_OVERRUN BIT_5
1490 /* Transmit MAC length. */
1491 T3_32BIT_REGISTER TxLengths;
1492 #define TX_LEN_SLOT_TIME_MASK 0xff
1493 #define TX_LEN_IPG_MASK 0x0f00
1494 #define TX_LEN_IPG_CRS_MASK (BIT_12 | BIT_13)
1496 /* Receive MAC mode. */
1497 T3_32BIT_REGISTER RxMode;
1498 #define RX_MODE_RESET BIT_0
1499 #define RX_MODE_ENABLE BIT_1
1500 #define RX_MODE_ENABLE_FLOW_CONTROL BIT_2
1501 #define RX_MODE_KEEP_MAC_CONTROL BIT_3
1502 #define RX_MODE_KEEP_PAUSE BIT_4
1503 #define RX_MODE_ACCEPT_OVERSIZED BIT_5
1504 #define RX_MODE_ACCEPT_RUNTS BIT_6
1505 #define RX_MODE_LENGTH_CHECK BIT_7
1506 #define RX_MODE_PROMISCUOUS_MODE BIT_8
1507 #define RX_MODE_NO_CRC_CHECK BIT_9
1508 #define RX_MODE_KEEP_VLAN_TAG BIT_10
1510 /* Receive MAC status. */
1511 T3_32BIT_REGISTER RxStatus;
1512 #define RX_STATUS_REMOTE_TRANSMITTER_XOFFED BIT_0
1513 #define RX_STATUS_XOFF_RECEIVED BIT_1
1514 #define RX_STATUS_XON_RECEIVED BIT_2
1516 /* Hash registers. */
1517 T3_32BIT_REGISTER HashReg[4];
1519 /* Receive placement rules registers. */
1521 T3_32BIT_REGISTER Rule;
1522 T3_32BIT_REGISTER Value;
1525 #define RCV_DISABLE_RULE_MASK 0x7fffffff
1527 #define RCV_RULE1_REJECT_BROADCAST_IDX 0x00
1528 #define REJECT_BROADCAST_RULE1_RULE 0xc2000000
1529 #define REJECT_BROADCAST_RULE1_VALUE 0xffffffff
1531 #define RCV_RULE2_REJECT_BROADCAST_IDX 0x01
1532 #define REJECT_BROADCAST_RULE2_RULE 0x86000004
1533 #define REJECT_BROADCAST_RULE2_VALUE 0xffffffff
1535 #if INCLUDE_5701_AX_FIX
1536 #define RCV_LAST_RULE_IDX 0x04
1538 #define RCV_LAST_RULE_IDX 0x02
1541 T3_32BIT_REGISTER RcvRuleCfg;
1542 #define RX_RULE_DEFAULT_CLASS (1 << 3)
1544 LM_UINT8 Reserved1[140];
1546 T3_32BIT_REGISTER SerdesCfg;
1547 T3_32BIT_REGISTER SerdesStatus;
1549 LM_UINT8 Reserved2[104];
1551 volatile LM_UINT8 TxMacState[16];
1552 volatile LM_UINT8 RxMacState[20];
1554 LM_UINT8 Reserved3[476];
1556 T3_32BIT_REGISTER RxStats[26];
1558 LM_UINT8 Reserved4[24];
1560 T3_32BIT_REGISTER TxStats[28];
1562 LM_UINT8 Reserved5[784];
1563 } T3_MAC_CONTROL, *PT3_MAC_CONTROL;
1565 /******************************************************************************/
1566 /* Send data initiator control registers. */
1567 /******************************************************************************/
1570 T3_32BIT_REGISTER Mode;
1571 #define T3_SND_DATA_IN_MODE_RESET BIT_0
1572 #define T3_SND_DATA_IN_MODE_ENABLE BIT_1
1573 #define T3_SND_DATA_IN_MODE_STATS_OFLW_ATTN_ENABLE BIT_2
1575 T3_32BIT_REGISTER Status;
1576 #define T3_SND_DATA_IN_STATUS_STATS_OFLW_ATTN BIT_2
1578 T3_32BIT_REGISTER StatsCtrl;
1579 #define T3_SND_DATA_IN_STATS_CTRL_ENABLE BIT_0
1580 #define T3_SND_DATA_IN_STATS_CTRL_FASTER_UPDATE BIT_1
1581 #define T3_SND_DATA_IN_STATS_CTRL_CLEAR BIT_2
1582 #define T3_SND_DATA_IN_STATS_CTRL_FLUSH BIT_3
1583 #define T3_SND_DATA_IN_STATS_CTRL_FORCE_ZERO BIT_4
1585 T3_32BIT_REGISTER StatsEnableMask;
1586 T3_32BIT_REGISTER StatsIncMask;
1588 LM_UINT8 Reserved[108];
1590 T3_32BIT_REGISTER ClassOfServCnt[16];
1591 T3_32BIT_REGISTER DmaReadQFullCnt;
1592 T3_32BIT_REGISTER DmaPriorityReadQFullCnt;
1593 T3_32BIT_REGISTER SdcQFullCnt;
1595 T3_32BIT_REGISTER NicRingSetSendProdIdxCnt;
1596 T3_32BIT_REGISTER StatusUpdatedCnt;
1597 T3_32BIT_REGISTER InterruptsCnt;
1598 T3_32BIT_REGISTER AvoidInterruptsCnt;
1599 T3_32BIT_REGISTER SendThresholdHitCnt;
1602 LM_UINT8 Unused[800];
1603 } T3_SEND_DATA_INITIATOR, *PT3_SEND_DATA_INITIATOR;
1605 /******************************************************************************/
1606 /* Send data completion control registers. */
1607 /******************************************************************************/
1610 T3_32BIT_REGISTER Mode;
1611 #define SND_DATA_COMP_MODE_RESET BIT_0
1612 #define SND_DATA_COMP_MODE_ENABLE BIT_1
1615 LM_UINT8 Unused[1020];
1616 } T3_SEND_DATA_COMPLETION, *PT3_SEND_DATA_COMPLETION;
1618 /******************************************************************************/
1619 /* Send BD Ring Selector Control Registers. */
1620 /******************************************************************************/
1623 T3_32BIT_REGISTER Mode;
1624 #define SND_BD_SEL_MODE_RESET BIT_0
1625 #define SND_BD_SEL_MODE_ENABLE BIT_1
1626 #define SND_BD_SEL_MODE_ATTN_ENABLE BIT_2
1628 T3_32BIT_REGISTER Status;
1629 #define SND_BD_SEL_STATUS_ERROR_ATTN BIT_2
1631 T3_32BIT_REGISTER HwDiag;
1634 LM_UINT8 Unused1[52];
1636 /* Send BD Ring Selector Local NIC Send BD Consumer Index. */
1637 T3_32BIT_REGISTER NicSendBdSelConIdx[16];
1640 LM_UINT8 Unused2[896];
1641 } T3_SEND_BD_SELECTOR, *PT3_SEND_BD_SELECTOR;
1643 /******************************************************************************/
1644 /* Send BD initiator control registers. */
1645 /******************************************************************************/
1648 T3_32BIT_REGISTER Mode;
1649 #define SND_BD_IN_MODE_RESET BIT_0
1650 #define SND_BD_IN_MODE_ENABLE BIT_1
1651 #define SND_BD_IN_MODE_ATTN_ENABLE BIT_2
1653 T3_32BIT_REGISTER Status;
1654 #define SND_BD_IN_STATUS_ERROR_ATTN BIT_2
1656 /* Send BD initiator local NIC send BD producer index. */
1657 T3_32BIT_REGISTER NicSendBdInProdIdx[16];
1660 LM_UINT8 Unused2[952];
1661 } T3_SEND_BD_INITIATOR, *PT3_SEND_BD_INITIATOR;
1663 /******************************************************************************/
1664 /* Send BD Completion Control. */
1665 /******************************************************************************/
1668 T3_32BIT_REGISTER Mode;
1669 #define SND_BD_COMP_MODE_RESET BIT_0
1670 #define SND_BD_COMP_MODE_ENABLE BIT_1
1671 #define SND_BD_COMP_MODE_ATTN_ENABLE BIT_2
1674 LM_UINT8 Unused2[1020];
1675 } T3_SEND_BD_COMPLETION, *PT3_SEND_BD_COMPLETION;
1677 /******************************************************************************/
1678 /* Receive list placement control registers. */
1679 /******************************************************************************/
1683 T3_32BIT_REGISTER Mode;
1684 #define RCV_LIST_PLMT_MODE_RESET BIT_0
1685 #define RCV_LIST_PLMT_MODE_ENABLE BIT_1
1686 #define RCV_LIST_PLMT_MODE_CLASS0_ATTN_ENABLE BIT_2
1687 #define RCV_LIST_PLMT_MODE_MAPPING_OOR_ATTN_ENABLE BIT_3
1688 #define RCV_LIST_PLMT_MODE_STATS_OFLOW_ATTN_ENABLE BIT_4
1691 T3_32BIT_REGISTER Status;
1692 #define RCV_LIST_PLMT_STATUS_CLASS0_ATTN BIT_2
1693 #define RCV_LIST_PLMT_STATUS_MAPPING_ATTN BIT_3
1694 #define RCV_LIST_PLMT_STATUS_STATS_OFLOW_ATTN BIT_4
1696 /* Receive selector list lock register. */
1697 T3_32BIT_REGISTER Lock;
1698 #define RCV_LIST_SEL_LOCK_REQUEST_MASK 0xffff
1699 #define RCV_LIST_SEL_LOCK_GRANT_MASK 0xffff0000
1701 /* Selector non-empty bits. */
1702 T3_32BIT_REGISTER NonEmptyBits;
1703 #define RCV_LIST_SEL_NON_EMPTY_MASK 0xffff
1705 /* Receive list placement configuration register. */
1706 T3_32BIT_REGISTER Config;
1708 /* Receive List Placement statistics Control. */
1709 T3_32BIT_REGISTER StatsCtrl;
1710 #define RCV_LIST_STATS_ENABLE BIT_0
1711 #define RCV_LIST_STATS_FAST_UPDATE BIT_1
1713 /* Receive List Placement statistics Enable Mask. */
1714 T3_32BIT_REGISTER StatsEnableMask;
1716 /* Receive List Placement statistics Increment Mask. */
1717 T3_32BIT_REGISTER StatsIncMask;
1720 LM_UINT8 Unused1[224];
1723 T3_32BIT_REGISTER Head;
1724 T3_32BIT_REGISTER Tail;
1725 T3_32BIT_REGISTER Count;
1729 } RcvSelectorList[16];
1731 /* Local statistics counter. */
1732 T3_32BIT_REGISTER ClassOfServCnt[16];
1734 T3_32BIT_REGISTER DropDueToFilterCnt;
1735 T3_32BIT_REGISTER DmaWriteQFullCnt;
1736 T3_32BIT_REGISTER DmaHighPriorityWriteQFullCnt;
1737 T3_32BIT_REGISTER NoMoreReceiveBdCnt;
1738 T3_32BIT_REGISTER IfInDiscardsCnt;
1739 T3_32BIT_REGISTER IfInErrorsCnt;
1740 T3_32BIT_REGISTER RcvThresholdHitCnt;
1742 /* Another unused space. */
1743 LM_UINT8 Unused2[420];
1744 } T3_RCV_LIST_PLACEMENT, *PT3_RCV_LIST_PLACEMENT;
1746 /******************************************************************************/
1747 /* Receive Data and Receive BD Initiator Control. */
1748 /******************************************************************************/
1752 T3_32BIT_REGISTER Mode;
1753 #define RCV_DATA_BD_IN_MODE_RESET BIT_0
1754 #define RCV_DATA_BD_IN_MODE_ENABLE BIT_1
1755 #define RCV_DATA_BD_IN_MODE_JUMBO_BD_NEEDED BIT_2
1756 #define RCV_DATA_BD_IN_MODE_FRAME_TOO_BIG BIT_3
1757 #define RCV_DATA_BD_IN_MODE_INVALID_RING_SIZE BIT_4
1760 T3_32BIT_REGISTER Status;
1761 #define RCV_DATA_BD_IN_STATUS_JUMBO_BD_NEEDED BIT_2
1762 #define RCV_DATA_BD_IN_STATUS_FRAME_TOO_BIG BIT_3
1763 #define RCV_DATA_BD_IN_STATUS_INVALID_RING_SIZE BIT_4
1765 /* Split frame minium size. */
1766 T3_32BIT_REGISTER SplitFrameMinSize;
1769 LM_UINT8 Unused1[0x2440 - 0x240c];
1776 /* Receive Data and Receive BD Ring Initiator Local NIC Receive */
1777 /* BD Consumber Index. */
1778 T3_32BIT_REGISTER NicJumboConIdx;
1779 T3_32BIT_REGISTER NicStdConIdx;
1780 T3_32BIT_REGISTER NicMiniConIdx;
1783 LM_UINT8 Unused2[4];
1785 /* Receive Data and Receive BD Initiator Local Receive Return ProdIdx. */
1786 T3_32BIT_REGISTER RcvDataBdProdIdx[16];
1788 /* Receive Data and Receive BD Initiator Hardware Diagnostic. */
1789 T3_32BIT_REGISTER HwDiag;
1792 LM_UINT8 Unused3[828];
1793 } T3_RCV_DATA_BD_INITIATOR, *PT3_RCV_DATA_BD_INITIATOR;
1795 /******************************************************************************/
1796 /* Receive Data Completion Control Registes. */
1797 /******************************************************************************/
1800 T3_32BIT_REGISTER Mode;
1801 #define RCV_DATA_COMP_MODE_RESET BIT_0
1802 #define RCV_DATA_COMP_MODE_ENABLE BIT_1
1803 #define RCV_DATA_COMP_MODE_ATTN_ENABLE BIT_2
1805 /* Unused spaced. */
1806 LM_UINT8 Unused[1020];
1807 } T3_RCV_DATA_COMPLETION, *PT3_RCV_DATA_COMPLETION;
1809 /******************************************************************************/
1810 /* Receive BD Initiator Control. */
1811 /******************************************************************************/
1814 T3_32BIT_REGISTER Mode;
1815 #define RCV_BD_IN_MODE_RESET BIT_0
1816 #define RCV_BD_IN_MODE_ENABLE BIT_1
1817 #define RCV_BD_IN_MODE_BD_IN_DIABLED_RCB_ATTN_ENABLE BIT_2
1819 T3_32BIT_REGISTER Status;
1820 #define RCV_BD_IN_STATUS_BD_IN_DIABLED_RCB_ATTN BIT_2
1822 T3_32BIT_REGISTER NicJumboRcvProdIdx;
1823 T3_32BIT_REGISTER NicStdRcvProdIdx;
1824 T3_32BIT_REGISTER NicMiniRcvProdIdx;
1826 T3_32BIT_REGISTER MiniRcvThreshold;
1827 T3_32BIT_REGISTER StdRcvThreshold;
1828 T3_32BIT_REGISTER JumboRcvThreshold;
1831 LM_UINT8 Unused[992];
1832 } T3_RCV_BD_INITIATOR, *PT3_RCV_BD_INITIATOR;
1834 /******************************************************************************/
1835 /* Receive BD Completion Control Registers. */
1836 /******************************************************************************/
1839 T3_32BIT_REGISTER Mode;
1840 #define RCV_BD_COMP_MODE_RESET BIT_0
1841 #define RCV_BD_COMP_MODE_ENABLE BIT_1
1842 #define RCV_BD_COMP_MODE_ATTN_ENABLE BIT_2
1844 T3_32BIT_REGISTER Status;
1845 #define RCV_BD_COMP_STATUS_ERROR_ATTN BIT_2
1847 T3_32BIT_REGISTER NicJumboRcvBdProdIdx;
1848 T3_32BIT_REGISTER NicStdRcvBdProdIdx;
1849 T3_32BIT_REGISTER NicMiniRcvBdProdIdx;
1852 LM_UINT8 Unused[1004];
1853 } T3_RCV_BD_COMPLETION, *PT3_RCV_BD_COMPLETION;
1855 /******************************************************************************/
1856 /* Receive list selector control register. */
1857 /******************************************************************************/
1860 T3_32BIT_REGISTER Mode;
1861 #define RCV_LIST_SEL_MODE_RESET BIT_0
1862 #define RCV_LIST_SEL_MODE_ENABLE BIT_1
1863 #define RCV_LIST_SEL_MODE_ATTN_ENABLE BIT_2
1865 T3_32BIT_REGISTER Status;
1866 #define RCV_LIST_SEL_STATUS_ERROR_ATTN BIT_2
1869 LM_UINT8 Unused[1016];
1870 } T3_RCV_LIST_SELECTOR, *PT3_RCV_LIST_SELECTOR;
1872 /******************************************************************************/
1873 /* Mbuf cluster free registers. */
1874 /******************************************************************************/
1877 T3_32BIT_REGISTER Mode;
1878 #define MBUF_CLUSTER_FREE_MODE_RESET BIT_0
1879 #define MBUF_CLUSTER_FREE_MODE_ENABLE BIT_1
1881 T3_32BIT_REGISTER Status;
1884 LM_UINT8 Unused[1016];
1885 } T3_MBUF_CLUSTER_FREE, *PT3_MBUF_CLUSTER_FREE;
1887 /******************************************************************************/
1888 /* Host coalescing control registers. */
1889 /******************************************************************************/
1893 T3_32BIT_REGISTER Mode;
1894 #define HOST_COALESCE_RESET BIT_0
1895 #define HOST_COALESCE_ENABLE BIT_1
1896 #define HOST_COALESCE_ATTN BIT_2
1897 #define HOST_COALESCE_NOW BIT_3
1898 #define HOST_COALESCE_FULL_STATUS_MODE BIT_NONE
1899 #define HOST_COALESCE_64_BYTE_STATUS_MODE BIT_7
1900 #define HOST_COALESCE_32_BYTE_STATUS_MODE BIT_8
1901 #define HOST_COALESCE_CLEAR_TICKS_ON_RX_BD_EVENT BIT_9
1902 #define HOST_COALESCE_CLEAR_TICKS_ON_TX_BD_EVENT BIT_10
1903 #define HOST_COALESCE_NO_INT_ON_COALESCE_NOW_MODE BIT_11
1904 #define HOST_COALESCE_NO_INT_ON_FORCE_DMAD_MODE BIT_12
1907 T3_32BIT_REGISTER Status;
1908 #define HOST_COALESCE_ERROR_ATTN BIT_2
1910 /* Receive coalescing ticks. */
1911 T3_32BIT_REGISTER RxCoalescingTicks;
1913 /* Send coalescing ticks. */
1914 T3_32BIT_REGISTER TxCoalescingTicks;
1916 /* Receive max coalesced frames. */
1917 T3_32BIT_REGISTER RxMaxCoalescedFrames;
1919 /* Send max coalesced frames. */
1920 T3_32BIT_REGISTER TxMaxCoalescedFrames;
1922 /* Receive coalescing ticks during interrupt. */
1923 T3_32BIT_REGISTER RxCoalescedTickDuringInt;
1925 /* Send coalescing ticks during interrupt. */
1926 T3_32BIT_REGISTER TxCoalescedTickDuringInt;
1928 /* Receive max coalesced frames during interrupt. */
1929 T3_32BIT_REGISTER RxMaxCoalescedFramesDuringInt;
1931 /* Send max coalesced frames during interrupt. */
1932 T3_32BIT_REGISTER TxMaxCoalescedFramesDuringInt;
1934 /* Statistics tick. */
1935 T3_32BIT_REGISTER StatsCoalescingTicks;
1938 LM_UINT8 Unused2[4];
1940 /* Statistics host address. */
1941 T3_64BIT_REGISTER StatsBlkHostAddr;
1943 /* Status block host address. */
1944 T3_64BIT_REGISTER StatusBlkHostAddr;
1946 /* Statistics NIC address. */
1947 T3_32BIT_REGISTER StatsBlkNicAddr;
1949 /* Statust block NIC address. */
1950 T3_32BIT_REGISTER StatusBlkNicAddr;
1952 /* Flow attention registers. */
1953 T3_32BIT_REGISTER FlowAttn;
1956 LM_UINT8 Unused3[4];
1958 T3_32BIT_REGISTER NicJumboRcvBdConIdx;
1959 T3_32BIT_REGISTER NicStdRcvBdConIdx;
1960 T3_32BIT_REGISTER NicMiniRcvBdConIdx;
1963 LM_UINT8 Unused4[36];
1965 T3_32BIT_REGISTER NicRetProdIdx[16];
1966 T3_32BIT_REGISTER NicSndBdConIdx[16];
1969 LM_UINT8 Unused5[768];
1970 } T3_HOST_COALESCING, *PT3_HOST_COALESCING;
1972 /******************************************************************************/
1973 /* Memory arbiter registers. */
1974 /******************************************************************************/
1977 T3_32BIT_REGISTER Mode;
1978 #define T3_MEM_ARBITER_MODE_RESET BIT_0
1979 #define T3_MEM_ARBITER_MODE_ENABLE BIT_1
1981 T3_32BIT_REGISTER Status;
1983 T3_32BIT_REGISTER ArbTrapAddrLow;
1984 T3_32BIT_REGISTER ArbTrapAddrHigh;
1987 LM_UINT8 Unused[1008];
1988 } T3_MEM_ARBITER, *PT3_MEM_ARBITER;
1990 /******************************************************************************/
1991 /* Buffer manager control register. */
1992 /******************************************************************************/
1995 T3_32BIT_REGISTER Mode;
1996 #define BUFMGR_MODE_RESET BIT_0
1997 #define BUFMGR_MODE_ENABLE BIT_1
1998 #define BUFMGR_MODE_ATTN_ENABLE BIT_2
1999 #define BUFMGR_MODE_BM_TEST BIT_3
2000 #define BUFMGR_MODE_MBUF_LOW_ATTN_ENABLE BIT_4
2002 T3_32BIT_REGISTER Status;
2003 #define BUFMGR_STATUS_ERROR BIT_2
2004 #define BUFMGR_STATUS_MBUF_LOW BIT_4
2006 T3_32BIT_REGISTER MbufPoolAddr;
2007 T3_32BIT_REGISTER MbufPoolSize;
2008 T3_32BIT_REGISTER MbufReadDmaLowWaterMark;
2009 T3_32BIT_REGISTER MbufMacRxLowWaterMark;
2010 T3_32BIT_REGISTER MbufHighWaterMark;
2012 T3_32BIT_REGISTER RxCpuMbufAllocReq;
2013 #define BUFMGR_MBUF_ALLOC_BIT BIT_31
2014 T3_32BIT_REGISTER RxCpuMbufAllocResp;
2015 T3_32BIT_REGISTER TxCpuMbufAllocReq;
2016 T3_32BIT_REGISTER TxCpuMbufAllocResp;
2018 T3_32BIT_REGISTER DmaDescPoolAddr;
2019 T3_32BIT_REGISTER DmaDescPoolSize;
2020 T3_32BIT_REGISTER DmaLowWaterMark;
2021 T3_32BIT_REGISTER DmaHighWaterMark;
2023 T3_32BIT_REGISTER RxCpuDmaAllocReq;
2024 T3_32BIT_REGISTER RxCpuDmaAllocResp;
2025 T3_32BIT_REGISTER TxCpuDmaAllocReq;
2026 T3_32BIT_REGISTER TxCpuDmaAllocResp;
2028 T3_32BIT_REGISTER Hwdiag[3];
2031 LM_UINT8 Unused[936];
2032 } T3_BUFFER_MANAGER, *PT3_BUFFER_MANAGER;
2034 /******************************************************************************/
2035 /* Read DMA control registers. */
2036 /******************************************************************************/
2039 T3_32BIT_REGISTER Mode;
2040 #define DMA_READ_MODE_RESET BIT_0
2041 #define DMA_READ_MODE_ENABLE BIT_1
2042 #define DMA_READ_MODE_TARGET_ABORT_ATTN_ENABLE BIT_2
2043 #define DMA_READ_MODE_MASTER_ABORT_ATTN_ENABLE BIT_3
2044 #define DMA_READ_MODE_PARITY_ERROR_ATTN_ENABLE BIT_4
2045 #define DMA_READ_MODE_ADDR_OVERFLOW_ATTN_ENABLE BIT_5
2046 #define DMA_READ_MODE_FIFO_OVERRUN_ATTN_ENABLE BIT_6
2047 #define DMA_READ_MODE_FIFO_UNDERRUN_ATTN_ENABLE BIT_7
2048 #define DMA_READ_MODE_FIFO_OVERREAD_ATTN_ENABLE BIT_8
2049 #define DMA_READ_MODE_LONG_READ_ATTN_ENABLE BIT_9
2050 #define DMA_READ_MODE_SPLIT_ENABLE BIT_11
2051 #define DMA_READ_MODE_SPLIT_RESET BIT_12
2053 T3_32BIT_REGISTER Status;
2054 #define DMA_READ_STATUS_TARGET_ABORT_ATTN BIT_2
2055 #define DMA_READ_STATUS_MASTER_ABORT_ATTN BIT_3
2056 #define DMA_READ_STATUS_PARITY_ERROR_ATTN BIT_4
2057 #define DMA_READ_STATUS_ADDR_OVERFLOW_ATTN BIT_5
2058 #define DMA_READ_STATUS_FIFO_OVERRUN_ATTN BIT_6
2059 #define DMA_READ_STATUS_FIFO_UNDERRUN_ATTN BIT_7
2060 #define DMA_READ_STATUS_FIFO_OVERREAD_ATTN BIT_8
2061 #define DMA_READ_STATUS_LONG_READ_ATTN BIT_9
2064 LM_UINT8 Unused[1016];
2065 } T3_DMA_READ, *PT3_DMA_READ;
2067 typedef union T3_CPU {
2069 T3_32BIT_REGISTER mode;
2070 #define CPU_MODE_HALT BIT_10
2071 #define CPU_MODE_RESET BIT_0
2072 T3_32BIT_REGISTER state;
2073 T3_32BIT_REGISTER EventMask;
2074 T3_32BIT_REGISTER reserved1[4];
2075 T3_32BIT_REGISTER PC;
2076 T3_32BIT_REGISTER Instruction;
2077 T3_32BIT_REGISTER SpadUnderflow;
2078 T3_32BIT_REGISTER WatchdogClear;
2079 T3_32BIT_REGISTER WatchdogVector;
2080 T3_32BIT_REGISTER WatchdogSavedPC;
2081 T3_32BIT_REGISTER HardwareBp;
2082 T3_32BIT_REGISTER reserved2[3];
2083 T3_32BIT_REGISTER WatchdogSavedState;
2084 T3_32BIT_REGISTER LastBrchAddr;
2085 T3_32BIT_REGISTER SpadUnderflowSet;
2086 T3_32BIT_REGISTER reserved3[(0x200 - 0x50) / 4];
2087 T3_32BIT_REGISTER Regs[32];
2088 T3_32BIT_REGISTER reserved4[(0x400 - 0x280) / 4];
2092 /******************************************************************************/
2093 /* Write DMA control registers. */
2094 /******************************************************************************/
2097 T3_32BIT_REGISTER Mode;
2098 #define DMA_WRITE_MODE_RESET BIT_0
2099 #define DMA_WRITE_MODE_ENABLE BIT_1
2100 #define DMA_WRITE_MODE_TARGET_ABORT_ATTN_ENABLE BIT_2
2101 #define DMA_WRITE_MODE_MASTER_ABORT_ATTN_ENABLE BIT_3
2102 #define DMA_WRITE_MODE_PARITY_ERROR_ATTN_ENABLE BIT_4
2103 #define DMA_WRITE_MODE_ADDR_OVERFLOW_ATTN_ENABLE BIT_5
2104 #define DMA_WRITE_MODE_FIFO_OVERRUN_ATTN_ENABLE BIT_6
2105 #define DMA_WRITE_MODE_FIFO_UNDERRUN_ATTN_ENABLE BIT_7
2106 #define DMA_WRITE_MODE_FIFO_OVERREAD_ATTN_ENABLE BIT_8
2107 #define DMA_WRITE_MODE_LONG_READ_ATTN_ENABLE BIT_9
2109 T3_32BIT_REGISTER Status;
2110 #define DMA_WRITE_STATUS_TARGET_ABORT_ATTN BIT_2
2111 #define DMA_WRITE_STATUS_MASTER_ABORT_ATTN BIT_3
2112 #define DMA_WRITE_STATUS_PARITY_ERROR_ATTN BIT_4
2113 #define DMA_WRITE_STATUS_ADDR_OVERFLOW_ATTN BIT_5
2114 #define DMA_WRITE_STATUS_FIFO_OVERRUN_ATTN BIT_6
2115 #define DMA_WRITE_STATUS_FIFO_UNDERRUN_ATTN BIT_7
2116 #define DMA_WRITE_STATUS_FIFO_OVERREAD_ATTN BIT_8
2117 #define DMA_WRITE_STATUS_LONG_READ_ATTN BIT_9
2120 LM_UINT8 Unused[1016];
2121 } T3_DMA_WRITE, *PT3_DMA_WRITE;
2123 /******************************************************************************/
2124 /* Mailbox registers. */
2125 /******************************************************************************/
2128 /* Interrupt mailbox registers. */
2129 T3_64BIT_REGISTER Interrupt[4];
2131 /* General mailbox registers. */
2132 T3_64BIT_REGISTER General[8];
2134 /* Reload statistics mailbox. */
2135 T3_64BIT_REGISTER ReloadStat;
2137 /* Receive BD ring producer index registers. */
2138 T3_64BIT_REGISTER RcvStdProdIdx;
2139 T3_64BIT_REGISTER RcvJumboProdIdx;
2140 T3_64BIT_REGISTER RcvMiniProdIdx;
2142 /* Receive return ring consumer index registers. */
2143 T3_64BIT_REGISTER RcvRetConIdx[16];
2145 /* Send BD ring host producer index registers. */
2146 T3_64BIT_REGISTER SendHostProdIdx[16];
2148 /* Send BD ring nic producer index registers. */
2149 T3_64BIT_REGISTER SendNicProdIdx[16];
2150 } T3_MAILBOX, *PT3_MAILBOX;
2155 /* Priority mailbox registers. */
2156 T3_32BIT_REGISTER HighPriorityEventVector;
2157 T3_32BIT_REGISTER HighPriorityEventMask;
2158 T3_32BIT_REGISTER LowPriorityEventVector;
2159 T3_32BIT_REGISTER LowPriorityEventMask;
2162 LM_UINT8 Unused[496];
2163 } T3_GRC_MAILBOX, *PT3_GRC_MAILBOX;
2165 /******************************************************************************/
2166 /* Flow through queues. */
2167 /******************************************************************************/
2170 T3_32BIT_REGISTER Reset;
2172 LM_UINT8 Unused[12];
2174 T3_32BIT_REGISTER DmaNormalReadFtqCtrl;
2175 T3_32BIT_REGISTER DmaNormalReadFtqFullCnt;
2176 T3_32BIT_REGISTER DmaNormalReadFtqFifoEnqueueDequeue;
2177 T3_32BIT_REGISTER DmaNormalReadFtqFifoWritePeek;
2179 T3_32BIT_REGISTER DmaHighReadFtqCtrl;
2180 T3_32BIT_REGISTER DmaHighReadFtqFullCnt;
2181 T3_32BIT_REGISTER DmaHighReadFtqFifoEnqueueDequeue;
2182 T3_32BIT_REGISTER DmaHighReadFtqFifoWritePeek;
2184 T3_32BIT_REGISTER DmaCompDiscardFtqCtrl;
2185 T3_32BIT_REGISTER DmaCompDiscardFtqFullCnt;
2186 T3_32BIT_REGISTER DmaCompDiscardFtqFifoEnqueueDequeue;
2187 T3_32BIT_REGISTER DmaCompDiscardFtqFifoWritePeek;
2189 T3_32BIT_REGISTER SendBdCompFtqCtrl;
2190 T3_32BIT_REGISTER SendBdCompFtqFullCnt;
2191 T3_32BIT_REGISTER SendBdCompFtqFifoEnqueueDequeue;
2192 T3_32BIT_REGISTER SendBdCompFtqFifoWritePeek;
2194 T3_32BIT_REGISTER SendDataInitiatorFtqCtrl;
2195 T3_32BIT_REGISTER SendDataInitiatorFtqFullCnt;
2196 T3_32BIT_REGISTER SendDataInitiatorFtqFifoEnqueueDequeue;
2197 T3_32BIT_REGISTER SendDataInitiatorFtqFifoWritePeek;
2199 T3_32BIT_REGISTER DmaNormalWriteFtqCtrl;
2200 T3_32BIT_REGISTER DmaNormalWriteFtqFullCnt;
2201 T3_32BIT_REGISTER DmaNormalWriteFtqFifoEnqueueDequeue;
2202 T3_32BIT_REGISTER DmaNormalWriteFtqFifoWritePeek;
2204 T3_32BIT_REGISTER DmaHighWriteFtqCtrl;
2205 T3_32BIT_REGISTER DmaHighWriteFtqFullCnt;
2206 T3_32BIT_REGISTER DmaHighWriteFtqFifoEnqueueDequeue;
2207 T3_32BIT_REGISTER DmaHighWriteFtqFifoWritePeek;
2209 T3_32BIT_REGISTER SwType1FtqCtrl;
2210 T3_32BIT_REGISTER SwType1FtqFullCnt;
2211 T3_32BIT_REGISTER SwType1FtqFifoEnqueueDequeue;
2212 T3_32BIT_REGISTER SwType1FtqFifoWritePeek;
2214 T3_32BIT_REGISTER SendDataCompFtqCtrl;
2215 T3_32BIT_REGISTER SendDataCompFtqFullCnt;
2216 T3_32BIT_REGISTER SendDataCompFtqFifoEnqueueDequeue;
2217 T3_32BIT_REGISTER SendDataCompFtqFifoWritePeek;
2219 T3_32BIT_REGISTER HostCoalesceFtqCtrl;
2220 T3_32BIT_REGISTER HostCoalesceFtqFullCnt;
2221 T3_32BIT_REGISTER HostCoalesceFtqFifoEnqueueDequeue;
2222 T3_32BIT_REGISTER HostCoalesceFtqFifoWritePeek;
2224 T3_32BIT_REGISTER MacTxFtqCtrl;
2225 T3_32BIT_REGISTER MacTxFtqFullCnt;
2226 T3_32BIT_REGISTER MacTxFtqFifoEnqueueDequeue;
2227 T3_32BIT_REGISTER MacTxFtqFifoWritePeek;
2229 T3_32BIT_REGISTER MbufClustFreeFtqCtrl;
2230 T3_32BIT_REGISTER MbufClustFreeFtqFullCnt;
2231 T3_32BIT_REGISTER MbufClustFreeFtqFifoEnqueueDequeue;
2232 T3_32BIT_REGISTER MbufClustFreeFtqFifoWritePeek;
2234 T3_32BIT_REGISTER RcvBdCompFtqCtrl;
2235 T3_32BIT_REGISTER RcvBdCompFtqFullCnt;
2236 T3_32BIT_REGISTER RcvBdCompFtqFifoEnqueueDequeue;
2237 T3_32BIT_REGISTER RcvBdCompFtqFifoWritePeek;
2239 T3_32BIT_REGISTER RcvListPlmtFtqCtrl;
2240 T3_32BIT_REGISTER RcvListPlmtFtqFullCnt;
2241 T3_32BIT_REGISTER RcvListPlmtFtqFifoEnqueueDequeue;
2242 T3_32BIT_REGISTER RcvListPlmtFtqFifoWritePeek;
2244 T3_32BIT_REGISTER RcvDataBdInitiatorFtqCtrl;
2245 T3_32BIT_REGISTER RcvDataBdInitiatorFtqFullCnt;
2246 T3_32BIT_REGISTER RcvDataBdInitiatorFtqFifoEnqueueDequeue;
2247 T3_32BIT_REGISTER RcvDataBdInitiatorFtqFifoWritePeek;
2249 T3_32BIT_REGISTER RcvDataCompFtqCtrl;
2250 T3_32BIT_REGISTER RcvDataCompFtqFullCnt;
2251 T3_32BIT_REGISTER RcvDataCompFtqFifoEnqueueDequeue;
2252 T3_32BIT_REGISTER RcvDataCompFtqFifoWritePeek;
2254 T3_32BIT_REGISTER SwType2FtqCtrl;
2255 T3_32BIT_REGISTER SwType2FtqFullCnt;
2256 T3_32BIT_REGISTER SwType2FtqFifoEnqueueDequeue;
2257 T3_32BIT_REGISTER SwType2FtqFifoWritePeek;
2260 LM_UINT8 Unused2[736];
2263 /******************************************************************************/
2264 /* Message signaled interrupt registers. */
2265 /******************************************************************************/
2268 T3_32BIT_REGISTER Mode;
2269 #define MSI_MODE_RESET BIT_0
2270 #define MSI_MODE_ENABLE BIT_1
2271 T3_32BIT_REGISTER Status;
2273 T3_32BIT_REGISTER MsiFifoAccess;
2276 LM_UINT8 Unused[1012];
2277 } T3_MSG_SIGNALED_INT, *PT3_MSG_SIGNALED_INT;
2279 /******************************************************************************/
2280 /* DMA Completion registes. */
2281 /******************************************************************************/
2284 T3_32BIT_REGISTER Mode;
2285 #define DMA_COMP_MODE_RESET BIT_0
2286 #define DMA_COMP_MODE_ENABLE BIT_1
2289 LM_UINT8 Unused[1020];
2290 } T3_DMA_COMPLETION, *PT3_DMA_COMPLETION;
2292 /******************************************************************************/
2293 /* GRC registers. */
2294 /******************************************************************************/
2297 /* Mode control register. */
2298 T3_32BIT_REGISTER Mode;
2299 #define GRC_MODE_UPDATE_ON_COALESCING BIT_0
2300 #define GRC_MODE_BYTE_SWAP_NON_FRAME_DATA BIT_1
2301 #define GRC_MODE_WORD_SWAP_NON_FRAME_DATA BIT_2
2302 #define GRC_MODE_BYTE_SWAP_DATA BIT_4
2303 #define GRC_MODE_WORD_SWAP_DATA BIT_5
2304 #define GRC_MODE_SPLIT_HEADER_MODE BIT_8
2305 #define GRC_MODE_NO_FRAME_CRACKING BIT_9
2306 #define GRC_MODE_INCLUDE_CRC BIT_10
2307 #define GRC_MODE_ALLOW_BAD_FRAMES BIT_11
2308 #define GRC_MODE_NO_INTERRUPT_ON_SENDS BIT_13
2309 #define GRC_MODE_NO_INTERRUPT_ON_RECEIVE BIT_14
2310 #define GRC_MODE_FORCE_32BIT_PCI_BUS_MODE BIT_15
2311 #define GRC_MODE_HOST_STACK_UP BIT_16
2312 #define GRC_MODE_HOST_SEND_BDS BIT_17
2313 #define GRC_MODE_TX_NO_PSEUDO_HEADER_CHKSUM BIT_20
2314 #define GRC_MODE_RX_NO_PSEUDO_HEADER_CHKSUM BIT_23
2315 #define GRC_MODE_INT_ON_TX_CPU_ATTN BIT_24
2316 #define GRC_MODE_INT_ON_RX_CPU_ATTN BIT_25
2317 #define GRC_MODE_INT_ON_MAC_ATTN BIT_26
2318 #define GRC_MODE_INT_ON_DMA_ATTN BIT_27
2319 #define GRC_MODE_INT_ON_FLOW_ATTN BIT_28
2320 #define GRC_MODE_4X_NIC_BASED_SEND_RINGS BIT_29
2321 #define GRC_MODE_MULTICAST_FRAME_ENABLE BIT_30
2323 /* Misc configuration register. */
2324 T3_32BIT_REGISTER MiscCfg;
2325 #define GRC_MISC_CFG_CORE_CLOCK_RESET BIT_0
2326 #define GRC_MISC_PRESCALAR_TIMER_MASK 0xfe
2327 #define GRC_MISC_BD_ID_MASK 0x0001e000
2328 #define GRC_MISC_BD_ID_5700 0x0001e000
2329 #define GRC_MISC_BD_ID_5701 0x00000000
2330 #define GRC_MISC_BD_ID_5703 0x00000000
2331 #define GRC_MISC_BD_ID_5703S 0x00002000
2332 #define GRC_MISC_BD_ID_5702FE 0x00004000
2333 #define GRC_MISC_BD_ID_5704 0x00000000
2334 #define GRC_MISC_BD_ID_5704CIOBE 0x00004000
2336 /* Miscellaneous local control register. */
2337 T3_32BIT_REGISTER LocalCtrl;
2338 #define GRC_MISC_LOCAL_CTRL_INT_ACTIVE BIT_0
2339 #define GRC_MISC_LOCAL_CTRL_CLEAR_INT BIT_1
2340 #define GRC_MISC_LOCAL_CTRL_SET_INT BIT_2
2341 #define GRC_MISC_LOCAL_CTRL_INT_ON_ATTN BIT_3
2342 #define GRC_MISC_LOCAL_CTRL_GPIO_INPUT0 BIT_8
2343 #define GRC_MISC_LOCAL_CTRL_GPIO_INPUT1 BIT_9
2344 #define GRC_MISC_LOCAL_CTRL_GPIO_INPUT2 BIT_10
2345 #define GRC_MISC_LOCAL_CTRL_GPIO_OE0 BIT_11
2346 #define GRC_MISC_LOCAL_CTRL_GPIO_OE1 BIT_12
2347 #define GRC_MISC_LOCAL_CTRL_GPIO_OE2 BIT_13
2348 #define GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT0 BIT_14
2349 #define GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT1 BIT_15
2350 #define GRC_MISC_LOCAL_CTRL_GPIO_OUTPUT2 BIT_16
2351 #define GRC_MISC_LOCAL_CTRL_ENABLE_EXT_MEMORY BIT_17
2352 #define GRC_MISC_LOCAL_CTRL_BANK_SELECT BIT_21
2353 #define GRC_MISC_LOCAL_CTRL_SSRAM_TYPE BIT_22
2355 #define GRC_MISC_MEMSIZE_256K 0
2356 #define GRC_MISC_MEMSIZE_512K (1 << 18)
2357 #define GRC_MISC_MEMSIZE_1024K (2 << 18)
2358 #define GRC_MISC_MEMSIZE_2048K (3 << 18)
2359 #define GRC_MISC_MEMSIZE_4096K (4 << 18)
2360 #define GRC_MISC_MEMSIZE_8192K (5 << 18)
2361 #define GRC_MISC_MEMSIZE_16M (6 << 18)
2362 #define GRC_MISC_LOCAL_CTRL_AUTO_SEEPROM BIT_24
2364 T3_32BIT_REGISTER Timer;
2366 T3_32BIT_REGISTER RxCpuEvent;
2367 T3_32BIT_REGISTER RxTimerRef;
2368 T3_32BIT_REGISTER RxCpuSemaphore;
2369 T3_32BIT_REGISTER RemoteRxCpuAttn;
2371 T3_32BIT_REGISTER TxCpuEvent;
2372 T3_32BIT_REGISTER TxTimerRef;
2373 T3_32BIT_REGISTER TxCpuSemaphore;
2374 T3_32BIT_REGISTER RemoteTxCpuAttn;
2376 T3_64BIT_REGISTER MemoryPowerUp;
2378 T3_32BIT_REGISTER EepromAddr;
2379 #define SEEPROM_ADDR_WRITE 0
2380 #define SEEPROM_ADDR_READ (1 << 31)
2381 #define SEEPROM_ADDR_RW_MASK 0x80000000
2382 #define SEEPROM_ADDR_COMPLETE (1 << 30)
2383 #define SEEPROM_ADDR_FSM_RESET (1 << 29)
2384 #define SEEPROM_ADDR_DEV_ID(x) (x << 26)
2385 #define SEEPROM_ADDR_DEV_ID_MASK 0x1c000000
2386 #define SEEPROM_ADDR_START (1 << 25)
2387 #define SEEPROM_ADDR_CLK_PERD(x) (x << 16)
2388 #define SEEPROM_ADDR_ADDRESS(x) (x & 0xfffc)
2389 #define SEEPROM_ADDR_ADDRESS_MASK 0x0000ffff
2391 #define SEEPROM_CLOCK_PERIOD 60
2392 #define SEEPROM_CHIP_SIZE (64 * 1024)
2394 T3_32BIT_REGISTER EepromData;
2395 T3_32BIT_REGISTER EepromCtrl;
2397 T3_32BIT_REGISTER MdiCtrl;
2398 T3_32BIT_REGISTER SepromDelay;
2401 LM_UINT8 Unused[948];
2404 /******************************************************************************/
2405 /* NVRAM control registers. */
2406 /******************************************************************************/
2409 T3_32BIT_REGISTER Cmd;
2410 #define NVRAM_CMD_RESET BIT_0
2411 #define NVRAM_CMD_DONE BIT_3
2412 #define NVRAM_CMD_DO_IT BIT_4
2413 #define NVRAM_CMD_WR BIT_5
2414 #define NVRAM_CMD_RD BIT_NONE
2415 #define NVRAM_CMD_ERASE BIT_6
2416 #define NVRAM_CMD_FIRST BIT_7
2417 #define NVRAM_CMD_LAST BIT_8
2419 T3_32BIT_REGISTER Status;
2420 T3_32BIT_REGISTER WriteData;
2422 T3_32BIT_REGISTER Addr;
2423 #define NVRAM_ADDRESS_MASK 0xffffff
2425 T3_32BIT_REGISTER ReadData;
2427 /* Flash config 1 register. */
2428 T3_32BIT_REGISTER Config1;
2429 #define FLASH_INTERFACE_ENABLE BIT_0
2430 #define FLASH_SSRAM_BUFFERRED_MODE BIT_1
2431 #define FLASH_PASS_THRU_MODE BIT_2
2432 #define FLASH_BIT_BANG_MODE BIT_3
2433 #define FLASH_COMPAT_BYPASS BIT_31
2435 /* Buffered flash (Atmel: AT45DB011B) specific information */
2436 #define BUFFERED_FLASH_PAGE_POS 9
2437 #define BUFFERED_FLASH_BYTE_ADDR_MASK ((1<<BUFFERED_FLASH_PAGE_POS) - 1)
2438 #define BUFFERED_FLASH_PAGE_SIZE 264
2439 #define BUFFERED_FLASH_PHY_PAGE_SIZE 512
2441 T3_32BIT_REGISTER Config2;
2442 T3_32BIT_REGISTER Config3;
2443 T3_32BIT_REGISTER SwArb;
2444 #define SW_ARB_REQ_SET0 BIT_0
2445 #define SW_ARB_REQ_SET1 BIT_1
2446 #define SW_ARB_REQ_SET2 BIT_2
2447 #define SW_ARB_REQ_SET3 BIT_3
2448 #define SW_ARB_REQ_CLR0 BIT_4
2449 #define SW_ARB_REQ_CLR1 BIT_5
2450 #define SW_ARB_REQ_CLR2 BIT_6
2451 #define SW_ARB_REQ_CLR3 BIT_7
2452 #define SW_ARB_GNT0 BIT_8
2453 #define SW_ARB_GNT1 BIT_9
2454 #define SW_ARB_GNT2 BIT_10
2455 #define SW_ARB_GNT3 BIT_11
2456 #define SW_ARB_REQ0 BIT_12
2457 #define SW_ARB_REQ1 BIT_13
2458 #define SW_ARB_REQ2 BIT_14
2459 #define SW_ARB_REQ3 BIT_15
2462 LM_UINT8 Unused[988];
2463 } T3_NVRAM, *PT3_NVRAM;
2465 /******************************************************************************/
2466 /* NIC's internal memory. */
2467 /******************************************************************************/
2470 /* Page zero for the internal CPUs. */
2471 LM_UINT8 PageZero[0x100]; /* 0x0000 */
2474 T3_RCB SendRcb[16]; /* 0x0100 */
2476 /* Receive Return RCBs. */
2477 T3_RCB RcvRetRcb[16]; /* 0x0200 */
2479 /* Statistics block. */
2480 T3_STATS_BLOCK StatsBlk; /* 0x0300 */
2483 T3_STATUS_BLOCK StatusBlk; /* 0x0b00 */
2485 /* Reserved for software. */
2486 LM_UINT8 Reserved[1200]; /* 0x0b50 */
2488 /* Unmapped region. */
2489 LM_UINT8 Unmapped[4096]; /* 0x1000 */
2491 /* DMA descriptors. */
2492 LM_UINT8 DmaDesc[8192]; /* 0x2000 */
2494 /* Buffer descriptors. */
2495 LM_UINT8 BufferDesc[16384]; /* 0x4000 */
2496 } T3_FIRST_32K_SRAM, *PT3_FIRST_32K_SRAM;
2498 /******************************************************************************/
2499 /* Memory layout. */
2500 /******************************************************************************/
2503 /* PCI configuration registers. */
2504 T3_PCI_CONFIGURATION PciCfg;
2507 LM_UINT8 Unused1[0x100]; /* 0x0100 */
2510 T3_MAILBOX Mailbox; /* 0x0200 */
2512 /* MAC control registers. */
2513 T3_MAC_CONTROL MacCtrl; /* 0x0400 */
2515 /* Send data initiator control registers. */
2516 T3_SEND_DATA_INITIATOR SndDataIn; /* 0x0c00 */
2518 /* Send data completion Control registers. */
2519 T3_SEND_DATA_COMPLETION SndDataComp; /* 0x1000 */
2521 /* Send BD ring selector. */
2522 T3_SEND_BD_SELECTOR SndBdSel; /* 0x1400 */
2524 /* Send BD initiator control registers. */
2525 T3_SEND_BD_INITIATOR SndBdIn; /* 0x1800 */
2527 /* Send BD completion control registers. */
2528 T3_SEND_BD_COMPLETION SndBdComp; /* 0x1c00 */
2530 /* Receive list placement control registers. */
2531 T3_RCV_LIST_PLACEMENT RcvListPlmt; /* 0x2000 */
2533 /* Receive Data and Receive BD Initiator Control. */
2534 T3_RCV_DATA_BD_INITIATOR RcvDataBdIn; /* 0x2400 */
2536 /* Receive Data Completion Control */
2537 T3_RCV_DATA_COMPLETION RcvDataComp; /* 0x2800 */
2539 /* Receive BD Initiator Control Registers. */
2540 T3_RCV_BD_INITIATOR RcvBdIn; /* 0x2c00 */
2542 /* Receive BD Completion Control Registers. */
2543 T3_RCV_BD_COMPLETION RcvBdComp; /* 0x3000 */
2545 /* Receive list selector control registers. */
2546 T3_RCV_LIST_SELECTOR RcvListSel; /* 0x3400 */
2548 /* Mbuf cluster free registers. */
2549 T3_MBUF_CLUSTER_FREE MbufClusterFree; /* 0x3800 */
2551 /* Host coalescing control registers. */
2552 T3_HOST_COALESCING HostCoalesce; /* 0x3c00 */
2554 /* Memory arbiter control registers. */
2555 T3_MEM_ARBITER MemArbiter; /* 0x4000 */
2557 /* Buffer manger control registers. */
2558 T3_BUFFER_MANAGER BufMgr; /* 0x4400 */
2560 /* Read DMA control registers. */
2561 T3_DMA_READ DmaRead; /* 0x4800 */
2563 /* Write DMA control registers. */
2564 T3_DMA_WRITE DmaWrite; /* 0x4c00 */
2566 T3_CPU rxCpu; /* 0x5000 */
2567 T3_CPU txCpu; /* 0x5400 */
2570 T3_GRC_MAILBOX GrcMailbox; /* 0x5800 */
2572 /* Flow Through queues. */
2573 T3_FTQ Ftq; /* 0x5c00 */
2575 /* Message signaled interrupt registes. */
2576 T3_MSG_SIGNALED_INT Msi; /* 0x6000 */
2578 /* DMA completion registers. */
2579 T3_DMA_COMPLETION DmaComp; /* 0x6400 */
2581 /* GRC registers. */
2582 T3_GRC Grc; /* 0x6800 */
2585 LM_UINT8 Unused2[1024]; /* 0x6c00 */
2587 /* NVRAM registers. */
2588 T3_NVRAM Nvram; /* 0x7000 */
2591 LM_UINT8 Unused3[3072]; /* 0x7400 */
2593 /* The 32k memory window into the NIC's */
2594 /* internal memory. The memory window is */
2595 /* controlled by the Memory Window Base */
2596 /* Address register. This register is located */
2597 /* in the PCI configuration space. */
2598 union { /* 0x8000 */
2599 T3_FIRST_32K_SRAM First32k;
2601 /* Use the memory window base address register to determine the */
2603 LM_UINT32 Mbuf[32768 / 4];
2604 LM_UINT32 MemBlock32K[32768 / 4];
2606 } T3_STD_MEM_MAP, *PT3_STD_MEM_MAP;
2608 /******************************************************************************/
2610 /******************************************************************************/
2616 LM_UINT32 Serdes; /* 0 = copper PHY, 1 = Serdes */
2617 } LM_ADAPTER_INFO, *PLM_ADAPTER_INFO;
2619 /******************************************************************************/
2620 /* Packet queues. */
2621 /******************************************************************************/
2623 DECLARE_QUEUE_TYPE (LM_RX_PACKET_Q, MAX_RX_PACKET_DESC_COUNT);
2624 DECLARE_QUEUE_TYPE (LM_TX_PACKET_Q, MAX_TX_PACKET_DESC_COUNT);
2626 /******************************************************************************/
2628 /******************************************************************************/
2631 LM_COUNTER TxPacketGoodCnt;
2632 LM_COUNTER TxBytesGoodCnt;
2633 LM_COUNTER TxPacketAbortedCnt;
2634 LM_COUNTER NoSendBdLeftCnt;
2635 LM_COUNTER NoMapRegisterLeftCnt;
2636 LM_COUNTER TooManyFragmentsCnt;
2637 LM_COUNTER NoTxPacketDescCnt;
2638 } LM_TX_COUNTERS, *PLM_TX_COUNTERS;
2640 /******************************************************************************/
2642 /******************************************************************************/
2645 LM_COUNTER RxPacketGoodCnt;
2646 LM_COUNTER RxBytesGoodCnt;
2647 LM_COUNTER RxPacketErrCnt;
2648 LM_COUNTER RxErrCrcCnt;
2649 LM_COUNTER RxErrCollCnt;
2650 LM_COUNTER RxErrLinkLostCnt;
2651 LM_COUNTER RxErrPhyDecodeCnt;
2652 LM_COUNTER RxErrOddNibbleCnt;
2653 LM_COUNTER RxErrMacAbortCnt;
2654 LM_COUNTER RxErrShortPacketCnt;
2655 LM_COUNTER RxErrNoResourceCnt;
2656 LM_COUNTER RxErrLargePacketCnt;
2657 } LM_RX_COUNTERS, *PLM_RX_COUNTERS;
2659 /******************************************************************************/
2660 /* Receive producer rings. */
2661 /******************************************************************************/
2664 T3_UNKNOWN_RCV_PROD_RING = 0,
2665 T3_STD_RCV_PROD_RING = 1,
2666 T3_MINI_RCV_PROD_RING = 2,
2667 T3_JUMBO_RCV_PROD_RING = 3
2668 } T3_RCV_PROD_RING, *PT3_RCV_PROD_RING;
2670 /******************************************************************************/
2671 /* Packet descriptor. */
2672 /******************************************************************************/
2674 #define LM_PACKET_SIGNATURE_TX 0x6861766b
2675 #define LM_PACKET_SIGNATURE_RX 0x6b766168
2677 typedef struct _LM_PACKET {
2679 LM_STATUS PacketStatus;
2681 /* Set in LM for Rx, in UM for Tx. */
2682 LM_UINT32 PacketSize;
2692 LM_UINT32 FragCount;
2698 /* This descriptor belongs to either Std, Mini, or Jumbo ring. */
2699 T3_RCV_PROD_RING RcvProdRing;
2701 /* Receive buffer size */
2702 LM_UINT32 RxBufferSize;
2704 /* Checksum information. */
2705 LM_UINT16 IpChecksum;
2706 LM_UINT16 TcpUdpChecksum;
2712 /******************************************************************************/
2713 /* Tigon3 device block. */
2714 /******************************************************************************/
2716 typedef struct _LM_DEVICE_BLOCK {
2717 int index; /* Device ID */
2719 PT3_STD_MEM_MAP pMemView;
2721 /* Base address of the block of memory in which the LM_PACKET descriptors */
2722 /* are allocated from. */
2723 PLM_VOID pPacketDescBase;
2725 LM_UINT32 MiscHostCtrl;
2726 LM_UINT32 GrcLocalCtrl;
2727 LM_UINT32 DmaReadWriteCtrl;
2731 LM_UINT32 RxStdDescCnt;
2732 LM_UINT32 RxStdQueuedCnt;
2733 LM_UINT32 RxStdProdIdx;
2735 PT3_RCV_BD pRxStdBdVirt;
2736 LM_PHYSICAL_ADDRESS RxStdBdPhy;
2738 LM_UINT32 RxPacketDescCnt;
2739 LM_RX_PACKET_Q RxPacketFreeQ;
2740 LM_RX_PACKET_Q RxPacketReceivedQ;
2743 PT3_RCV_BD pRcvRetBdVirt;
2744 LM_PHYSICAL_ADDRESS RcvRetBdPhy;
2745 LM_UINT32 RcvRetConIdx;
2747 #if T3_JUMBO_RCV_RCB_ENTRY_COUNT
2748 LM_UINT32 RxJumboDescCnt;
2749 LM_UINT32 RxJumboBufferSize;
2750 LM_UINT32 RxJumboQueuedCnt;
2752 LM_UINT32 RxJumboProdIdx;
2754 PT3_RCV_BD pRxJumboBdVirt;
2755 LM_PHYSICAL_ADDRESS RxJumboBdPhy;
2756 #endif /* T3_JUMBO_RCV_RCB_ENTRY_COUNT */
2758 /* These values are used by the upper module to inform the protocol */
2759 /* of the maximum transmit/receive packet size. */
2760 LM_UINT32 TxMtu; /* Does not include CRC. */
2761 LM_UINT32 RxMtu; /* Does not include CRC. */
2763 /* We need to shadow the EMAC, Rx, Tx mode registers. With B0 silicon, */
2764 /* we may have problems reading any MAC registers in 10mb mode. */
2769 /* MiMode register. */
2772 /* Host coalesce mode register. */
2773 LM_UINT32 CoalesceMode;
2776 LM_UINT32 TxPacketDescCnt;
2779 LM_TX_PACKET_Q TxPacketFreeQ;
2780 LM_TX_PACKET_Q TxPacketActiveQ;
2781 LM_TX_PACKET_Q TxPacketXmittedQ;
2783 /* Pointers to SendBd. */
2784 PT3_SND_BD pSendBdVirt;
2785 LM_PHYSICAL_ADDRESS SendBdPhy; /* Only valid for Host based Send BD. */
2787 /* Send producer and consumer indices. */
2788 LM_UINT32 SendProdIdx;
2789 LM_UINT32 SendConIdx;
2791 /* Number of BD left. */
2792 atomic_t SendBdLeft;
2794 T3_SND_BD ShadowSendBd[T3_SEND_RCB_ENTRY_COUNT];
2797 LM_RX_COUNTERS RxCounters;
2798 LM_TX_COUNTERS TxCounters;
2800 /* Host coalescing parameters. */
2801 LM_UINT32 RxCoalescingTicks;
2802 LM_UINT32 TxCoalescingTicks;
2803 LM_UINT32 RxMaxCoalescedFrames;
2804 LM_UINT32 TxMaxCoalescedFrames;
2805 LM_UINT32 StatsCoalescingTicks;
2806 LM_UINT32 RxCoalescingTicksDuringInt;
2807 LM_UINT32 TxCoalescingTicksDuringInt;
2808 LM_UINT32 RxMaxCoalescedFramesDuringInt;
2809 LM_UINT32 TxMaxCoalescedFramesDuringInt;
2811 /* DMA water marks. */
2812 LM_UINT32 DmaMbufLowMark;
2813 LM_UINT32 RxMacMbufLowMark;
2814 LM_UINT32 MbufHighMark;
2817 PT3_STATUS_BLOCK pStatusBlkVirt;
2818 LM_PHYSICAL_ADDRESS StatusBlkPhy;
2820 /* Statistics block. */
2821 PT3_STATS_BLOCK pStatsBlkVirt;
2822 LM_PHYSICAL_ADDRESS StatsBlkPhy;
2824 /* Current receive mask. */
2825 LM_UINT32 ReceiveMask;
2827 /* Task offload capabilities. */
2828 LM_TASK_OFFLOAD TaskOffloadCap;
2830 /* Task offload selected. */
2831 LM_TASK_OFFLOAD TaskToOffload;
2833 /* Wake up capability. */
2834 LM_WAKE_UP_MODE WakeUpModeCap;
2836 /* Wake up capability. */
2837 LM_WAKE_UP_MODE WakeUpMode;
2840 LM_FLOW_CONTROL FlowControlCap;
2841 LM_FLOW_CONTROL FlowControl;
2843 /* Enable or disable PCI MWI. */
2844 LM_UINT32 EnableMWI;
2846 /* Enable 5701 tagged status mode. */
2847 LM_UINT32 UseTaggedStatus;
2849 /* NIC will not compute the pseudo header checksum. The driver or OS */
2850 /* must seed the checksum field with the pseudo checksum. */
2851 LM_UINT32 NoTxPseudoHdrChksum;
2853 /* The receive checksum in the BD does not include the pseudo checksum. */
2854 /* The OS or the driver must calculate the pseudo checksum and add it to */
2855 /* the checksum in the BD. */
2856 LM_UINT32 NoRxPseudoHdrChksum;
2858 /* Current node address. */
2859 LM_UINT8 NodeAddress[8];
2861 /* The adapter's node address. */
2862 LM_UINT8 PermanentNodeAddress[8];
2868 LM_UINT16 PciVendorId;
2869 LM_UINT16 PciDeviceId;
2873 LM_UINT8 CacheLineSize;
2875 #if PCIX_TARGET_WORKAROUND
2876 LM_UINT32 EnablePciXFix;
2878 LM_UINT32 UndiFix; /* new, jimmy */
2879 LM_UINT32 PciCommandStatusWords;
2880 LM_UINT32 ChipRevId;
2881 LM_UINT16 SubsystemVendorId;
2882 LM_UINT16 SubsystemId;
2883 #if 0 /* Jimmy, deleted in new driver */
2884 LM_UINT32 MemBaseLow;
2885 LM_UINT32 MemBaseHigh;
2886 LM_UINT32 MemBaseSize;
2888 PLM_UINT8 pMappedMemBase;
2890 /* Saved PCI configuration registers for restoring after a reset. */
2891 LM_UINT32 SavedCacheLineReg;
2897 /* Requested phy settings. */
2898 LM_REQUESTED_MEDIA_TYPE RequestedMediaType;
2900 /* Disable auto-negotiation. */
2901 LM_UINT32 DisableAutoNeg;
2903 /* Ways for the MAC to get link change interrupt. */
2904 LM_UINT32 PhyIntMode;
2905 #define T3_PHY_INT_MODE_AUTO 0
2906 #define T3_PHY_INT_MODE_MI_INTERRUPT 1
2907 #define T3_PHY_INT_MODE_LINK_READY 2
2908 #define T3_PHY_INT_MODE_AUTO_POLLING 3
2910 /* Ways to determine link change status. */
2911 LM_UINT32 LinkChngMode;
2912 #define T3_LINK_CHNG_MODE_AUTO 0
2913 #define T3_LINK_CHNG_MODE_USE_STATUS_REG 1
2914 #define T3_LINK_CHNG_MODE_USE_STATUS_BLOCK 2
2919 #define LED_MODE_AUTO 0
2921 /* 5700/01 LED mode. */
2922 #define LED_MODE_THREE_LINK 1
2923 #define LED_MODE_LINK10 2
2925 /* 5703/02/04 LED mode. */
2926 #define LED_MODE_OPEN_DRAIN 1
2927 #define LED_MODE_OUTPUT 2
2931 #define WOL_SPEED_10MB 1
2932 #define WOL_SPEED_100MB 2
2934 /* Reset the PHY on initialization. */
2935 LM_UINT32 ResetPhyOnInit;
2937 LM_UINT32 RestoreOnWakeUp;
2938 LM_REQUESTED_MEDIA_TYPE WakeUpRequestedMediaType;
2939 LM_UINT32 WakeUpDisableAutoNeg;
2941 /* Current phy settings. */
2942 LM_MEDIA_TYPE MediaType;
2943 LM_LINE_SPEED LineSpeed;
2944 LM_LINE_SPEED OldLineSpeed;
2945 LM_DUPLEX_MODE DuplexMode;
2946 LM_STATUS LinkStatus;
2947 LM_UINT32 advertising; /* Jimmy, new! */
2948 LM_UINT32 advertising1000; /* Jimmy, new! */
2950 /* Multicast address list. */
2951 LM_UINT32 McEntryCount;
2952 LM_UINT8 McTable[LM_MAX_MC_TABLE_SIZE][LM_MC_ENTRY_SIZE];
2954 /* Use NIC or Host based send BD. */
2955 LM_UINT32 NicSendBd;
2958 LM_UINT32 DelayPciGrant;
2960 /* Enable OneDmaAtOnce */
2961 LM_UINT32 OneDmaAtOnce;
2963 /* Split Mode flags, Jimmy new */
2964 LM_UINT32 SplitModeEnable;
2965 LM_UINT32 SplitModeMaxReq;
2970 /* Shutdown flag. Set by the upper module. */
2971 LM_BOOL ShuttingDown;
2973 /* Flag to determine whether to call LM_QueueRxPackets or not in */
2974 /* LM_ResetAdapter routine. */
2975 LM_BOOL QueueRxPackets;
2980 /* TRUE if we have a SERDES PHY. */
2981 LM_UINT32 EnableTbi;
2983 /* Ethernet@WireSpeed. */
2984 LM_UINT32 EnableWireSpeed;
2988 #if INCLUDE_TBI_SUPPORT
2989 /* Autoneg state info. */
2990 AN_STATE_INFO AnInfo;
2991 LM_UINT32 PollTbiLink;
2992 LM_UINT32 IgnoreTbiLinkChange;
2995 char BootCodeVer[16];
2996 char BusSpeedStr[24]; /* Jimmy, new! */
2997 LM_UINT32 PhyCrcCount;
3000 #define T3_REG_CPU_VIEW 0xc0000000
3002 #define T3_BLOCK_DMA_RD (1 << 0)
3003 #define T3_BLOCK_DMA_COMP (1 << 1)
3004 #define T3_BLOCK_RX_BD_INITIATOR (1 << 2)
3005 #define T3_BLOCK_RX_BD_COMP (1 << 3)
3006 #define T3_BLOCK_DMA_WR (1 << 4)
3007 #define T3_BLOCK_MSI_HANDLER (1 << 5)
3008 #define T3_BLOCK_RX_LIST_PLMT (1 << 6)
3009 #define T3_BLOCK_RX_LIST_SELECTOR (1 << 7)
3010 #define T3_BLOCK_RX_DATA_INITIATOR (1 << 8)
3011 #define T3_BLOCK_RX_DATA_COMP (1 << 9)
3012 #define T3_BLOCK_HOST_COALESING (1 << 10)
3013 #define T3_BLOCK_MAC_RX_ENGINE (1 << 11)
3014 #define T3_BLOCK_MBUF_CLUSTER_FREE (1 << 12)
3015 #define T3_BLOCK_SEND_BD_INITIATOR (1 << 13)
3016 #define T3_BLOCK_SEND_BD_COMP (1 << 14)
3017 #define T3_BLOCK_SEND_BD_SELECTOR (1 << 15)
3018 #define T3_BLOCK_SEND_DATA_INITIATOR (1 << 16)
3019 #define T3_BLOCK_SEND_DATA_COMP (1 << 17)
3020 #define T3_BLOCK_MAC_TX_ENGINE (1 << 18)
3021 #define T3_BLOCK_MEM_ARBITOR (1 << 19)
3022 #define T3_BLOCK_MBUF_MANAGER (1 << 20)
3023 #define T3_BLOCK_MAC_GLOBAL (1 << 21)
3026 #define LM_DISABLE 2
3028 #define RX_CPU_EVT_SW0 0
3029 #define RX_CPU_EVT_SW1 1
3030 #define RX_CPU_EVT_RLP 2
3031 #define RX_CPU_EVT_SW3 3
3032 #define RX_CPU_EVT_RLS 4
3033 #define RX_CPU_EVT_SW4 5
3034 #define RX_CPU_EVT_RX_BD_COMP 6
3035 #define RX_CPU_EVT_SW5 7
3036 #define RX_CPU_EVT_RDI 8
3037 #define RX_CPU_EVT_DMA_WR 9
3038 #define RX_CPU_EVT_DMA_RD 10
3039 #define RX_CPU_EVT_SWQ 11
3040 #define RX_CPU_EVT_SW6 12
3041 #define RX_CPU_EVT_RDC 13
3042 #define RX_CPU_EVT_SW7 14
3043 #define RX_CPU_EVT_HOST_COALES 15
3044 #define RX_CPU_EVT_SW8 16
3045 #define RX_CPU_EVT_HIGH_DMA_WR 17
3046 #define RX_CPU_EVT_HIGH_DMA_RD 18
3047 #define RX_CPU_EVT_SW9 19
3048 #define RX_CPU_EVT_DMA_ATTN 20
3049 #define RX_CPU_EVT_LOW_P_MBOX 21
3050 #define RX_CPU_EVT_HIGH_P_MBOX 22
3051 #define RX_CPU_EVT_SW10 23
3052 #define RX_CPU_EVT_TX_CPU_ATTN 24
3053 #define RX_CPU_EVT_MAC_ATTN 25
3054 #define RX_CPU_EVT_RX_CPU_ATTN 26
3055 #define RX_CPU_EVT_FLOW_ATTN 27
3056 #define RX_CPU_EVT_SW11 28
3057 #define RX_CPU_EVT_TIMER 29
3058 #define RX_CPU_EVT_SW12 30
3059 #define RX_CPU_EVT_SW13 31
3062 #define RX_CPU_EVENT_SW_EVENT0 (1 << RX_CPU_EVT_SW0)
3063 #define RX_CPU_EVENT_SW_EVENT1 (1 << RX_CPU_EVT_SW1)
3064 #define RX_CPU_EVENT_RLP (1 << RX_CPU_EVT_RLP)
3065 #define RX_CPU_EVENT_SW_EVENT3 (1 << RX_CPU_EVT_SW3)
3066 #define RX_CPU_EVENT_RLS (1 << RX_CPU_EVT_RLS)
3067 #define RX_CPU_EVENT_SW_EVENT4 (1 << RX_CPU_EVT_SW4)
3068 #define RX_CPU_EVENT_RX_BD_COMP (1 << RX_CPU_EVT_RX_BD_COMP)
3069 #define RX_CPU_EVENT_SW_EVENT5 (1 << RX_CPU_EVT_SW5)
3070 #define RX_CPU_EVENT_RDI (1 << RX_CPU_EVT_RDI)
3071 #define RX_CPU_EVENT_DMA_WR (1 << RX_CPU_EVT_DMA_WR)
3072 #define RX_CPU_EVENT_DMA_RD (1 << RX_CPU_EVT_DMA_RD)
3073 #define RX_CPU_EVENT_SWQ (1 << RX_CPU_EVT_SWQ)
3074 #define RX_CPU_EVENT_SW_EVENT6 (1 << RX_CPU_EVT_SW6)
3075 #define RX_CPU_EVENT_RDC (1 << RX_CPU_EVT_RDC)
3076 #define RX_CPU_EVENT_SW_EVENT7 (1 << RX_CPU_EVT_SW7)
3077 #define RX_CPU_EVENT_HOST_COALES (1 << RX_CPU_EVT_HOST_COALES)
3078 #define RX_CPU_EVENT_SW_EVENT8 (1 << RX_CPU_EVT_SW8)
3079 #define RX_CPU_EVENT_HIGH_DMA_WR (1 << RX_CPU_EVT_HIGH_DMA_WR)
3080 #define RX_CPU_EVENT_HIGH_DMA_RD (1 << RX_CPU_EVT_HIGH_DMA_RD)
3081 #define RX_CPU_EVENT_SW_EVENT9 (1 << RX_CPU_EVT_SW9)
3082 #define RX_CPU_EVENT_DMA_ATTN (1 << RX_CPU_EVT_DMA_ATTN)
3083 #define RX_CPU_EVENT_LOW_P_MBOX (1 << RX_CPU_EVT_LOW_P_MBOX)
3084 #define RX_CPU_EVENT_HIGH_P_MBOX (1 << RX_CPU_EVT_HIGH_P_MBOX)
3085 #define RX_CPU_EVENT_SW_EVENT10 (1 << RX_CPU_EVT_SW10)
3086 #define RX_CPU_EVENT_TX_CPU_ATTN (1 << RX_CPU_EVT_TX_CPU_ATTN)
3087 #define RX_CPU_EVENT_MAC_ATTN (1 << RX_CPU_EVT_MAC_ATTN)
3088 #define RX_CPU_EVENT_RX_CPU_ATTN (1 << RX_CPU_EVT_RX_CPU_ATTN)
3089 #define RX_CPU_EVENT_FLOW_ATTN (1 << RX_CPU_EVT_FLOW_ATTN)
3090 #define RX_CPU_EVENT_SW_EVENT11 (1 << RX_CPU_EVT_SW11)
3091 #define RX_CPU_EVENT_TIMER (1 << RX_CPU_EVT_TIMER)
3092 #define RX_CPU_EVENT_SW_EVENT12 (1 << RX_CPU_EVT_SW12)
3093 #define RX_CPU_EVENT_SW_EVENT13 (1 << RX_CPU_EVT_SW13)
3095 #define RX_CPU_MASK (RX_CPU_EVENT_SW_EVENT0 | \
3096 RX_CPU_EVENT_RLP | \
3097 RX_CPU_EVENT_RDI | \
3100 #define TX_CPU_EVT_SW0 0
3101 #define TX_CPU_EVT_SW1 1
3102 #define TX_CPU_EVT_SW2 2
3103 #define TX_CPU_EVT_SW3 3
3104 #define TX_CPU_EVT_TX_MAC 4
3105 #define TX_CPU_EVT_SW4 5
3106 #define TX_CPU_EVT_SBDC 6
3107 #define TX_CPU_EVT_SW5 7
3108 #define TX_CPU_EVT_SDI 8
3109 #define TX_CPU_EVT_DMA_WR 9
3110 #define TX_CPU_EVT_DMA_RD 10
3111 #define TX_CPU_EVT_SWQ 11
3112 #define TX_CPU_EVT_SW6 12
3113 #define TX_CPU_EVT_SDC 13
3114 #define TX_CPU_EVT_SW7 14
3115 #define TX_CPU_EVT_HOST_COALES 15
3116 #define TX_CPU_EVT_SW8 16
3117 #define TX_CPU_EVT_HIGH_DMA_WR 17
3118 #define TX_CPU_EVT_HIGH_DMA_RD 18
3119 #define TX_CPU_EVT_SW9 19
3120 #define TX_CPU_EVT_DMA_ATTN 20
3121 #define TX_CPU_EVT_LOW_P_MBOX 21
3122 #define TX_CPU_EVT_HIGH_P_MBOX 22
3123 #define TX_CPU_EVT_SW10 23
3124 #define TX_CPU_EVT_RX_CPU_ATTN 24
3125 #define TX_CPU_EVT_MAC_ATTN 25
3126 #define TX_CPU_EVT_TX_CPU_ATTN 26
3127 #define TX_CPU_EVT_FLOW_ATTN 27
3128 #define TX_CPU_EVT_SW11 28
3129 #define TX_CPU_EVT_TIMER 29
3130 #define TX_CPU_EVT_SW12 30
3131 #define TX_CPU_EVT_SW13 31
3134 #define TX_CPU_EVENT_SW_EVENT0 (1 << TX_CPU_EVT_SW0)
3135 #define TX_CPU_EVENT_SW_EVENT1 (1 << TX_CPU_EVT_SW1)
3136 #define TX_CPU_EVENT_SW_EVENT2 (1 << TX_CPU_EVT_SW2)
3137 #define TX_CPU_EVENT_SW_EVENT3 (1 << TX_CPU_EVT_SW3)
3138 #define TX_CPU_EVENT_TX_MAC (1 << TX_CPU_EVT_TX_MAC)
3139 #define TX_CPU_EVENT_SW_EVENT4 (1 << TX_CPU_EVT_SW4)
3140 #define TX_CPU_EVENT_SBDC (1 << TX_CPU_EVT_SBDC)
3141 #define TX_CPU_EVENT_SW_EVENT5 (1 << TX_CPU_EVT_SW5)
3142 #define TX_CPU_EVENT_SDI (1 << TX_CPU_EVT_SDI)
3143 #define TX_CPU_EVENT_DMA_WR (1 << TX_CPU_EVT_DMA_WR)
3144 #define TX_CPU_EVENT_DMA_RD (1 << TX_CPU_EVT_DMA_RD)
3145 #define TX_CPU_EVENT_SWQ (1 << TX_CPU_EVT_SWQ)
3146 #define TX_CPU_EVENT_SW_EVENT6 (1 << TX_CPU_EVT_SW6)
3147 #define TX_CPU_EVENT_SDC (1 << TX_CPU_EVT_SDC)
3148 #define TX_CPU_EVENT_SW_EVENT7 (1 << TX_CPU_EVT_SW7)
3149 #define TX_CPU_EVENT_HOST_COALES (1 << TX_CPU_EVT_HOST_COALES)
3150 #define TX_CPU_EVENT_SW_EVENT8 (1 << TX_CPU_EVT_SW8)
3151 #define TX_CPU_EVENT_HIGH_DMA_WR (1 << TX_CPU_EVT_HIGH_DMA_WR)
3152 #define TX_CPU_EVENT_HIGH_DMA_RD (1 << TX_CPU_EVT_HIGH_DMA_RD)
3153 #define TX_CPU_EVENT_SW_EVENT9 (1 << TX_CPU_EVT_SW9)
3154 #define TX_CPU_EVENT_DMA_ATTN (1 << TX_CPU_EVT_DMA_ATTN)
3155 #define TX_CPU_EVENT_LOW_P_MBOX (1 << TX_CPU_EVT_LOW_P_MBOX)
3156 #define TX_CPU_EVENT_HIGH_P_MBOX (1 << TX_CPU_EVT_HIGH_P_MBOX)
3157 #define TX_CPU_EVENT_SW_EVENT10 (1 << TX_CPU_EVT_SW10)
3158 #define TX_CPU_EVENT_RX_CPU_ATTN (1 << TX_CPU_EVT_RX_CPU_ATTN)
3159 #define TX_CPU_EVENT_MAC_ATTN (1 << TX_CPU_EVT_MAC_ATTN)
3160 #define TX_CPU_EVENT_TX_CPU_ATTN (1 << TX_CPU_EVT_TX_CPU_ATTN)
3161 #define TX_CPU_EVENT_FLOW_ATTN (1 << TX_CPU_EVT_FLOW_ATTN)
3162 #define TX_CPU_EVENT_SW_EVENT11 (1 << TX_CPU_EVT_SW11)
3163 #define TX_CPU_EVENT_TIMER (1 << TX_CPU_EVT_TIMER)
3164 #define TX_CPU_EVENT_SW_EVENT12 (1 << TX_CPU_EVT_SW12)
3165 #define TX_CPU_EVENT_SW_EVENT13 (1 << TX_CPU_EVT_SW13)
3167 #define TX_CPU_MASK (TX_CPU_EVENT_SW_EVENT0 | \
3168 TX_CPU_EVENT_SDI | \
3171 #define T3_FTQ_TYPE1_UNDERFLOW_BIT (1 << 29)
3172 #define T3_FTQ_TYPE1_PASS_BIT (1 << 30)
3173 #define T3_FTQ_TYPE1_SKIP_BIT (1 << 31)
3175 #define T3_FTQ_TYPE2_UNDERFLOW_BIT (1 << 13)
3176 #define T3_FTQ_TYPE2_PASS_BIT (1 << 14)
3177 #define T3_FTQ_TYPE2_SKIP_BIT (1 << 15)
3179 #define T3_QID_DMA_READ 1
3180 #define T3_QID_DMA_HIGH_PRI_READ 2
3181 #define T3_QID_DMA_COMP_DX 3
3182 #define T3_QID_SEND_BD_COMP 4
3183 #define T3_QID_SEND_DATA_INITIATOR 5
3184 #define T3_QID_DMA_WRITE 6
3185 #define T3_QID_DMA_HIGH_PRI_WRITE 7
3186 #define T3_QID_SW_TYPE_1 8
3187 #define T3_QID_SEND_DATA_COMP 9
3188 #define T3_QID_HOST_COALESCING 10
3189 #define T3_QID_MAC_TX 11
3190 #define T3_QID_MBUF_CLUSTER_FREE 12
3191 #define T3_QID_RX_BD_COMP 13
3192 #define T3_QID_RX_LIST_PLM 14
3193 #define T3_QID_RX_DATA_BD_INITIATOR 15
3194 #define T3_QID_RX_DATA_COMP 16
3195 #define T3_QID_SW_TYPE2 17
3197 LM_STATUS LM_LoadFirmware (PLM_DEVICE_BLOCK pDevice,
3198 PT3_FWIMG_INFO pFwImg,
3199 LM_UINT32 LoadCpu, LM_UINT32 StartCpu);
3201 /******************************************************************************/
3202 /* NIC register read/write macros. */
3203 /******************************************************************************/
3206 /* MAC register access. */
3207 LM_UINT32 LM_RegRdInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register);
3208 LM_VOID LM_RegWrInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register,
3211 /* MAC memory access. */
3212 LM_UINT32 LM_MemRdInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 MemAddr);
3213 LM_VOID LM_MemWrInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 MemAddr,
3216 #if PCIX_TARGET_WORKAROUND
3218 /* use memory-mapped accesses for mailboxes and reads, UNDI accesses
3219 for writes to all other registers */
3220 #define REG_RD(pDevice, OffsetName) \
3221 readl(&((pDevice)->pMemView->OffsetName))
3223 #define REG_WR(pDevice, OffsetName, Value32) \
3224 (((OFFSETOF(T3_STD_MEM_MAP, OffsetName) >=0x200 ) && \
3225 (OFFSETOF(T3_STD_MEM_MAP, OffsetName) <0x400)) || \
3226 ((pDevice)->EnablePciXFix == FALSE)) ? \
3227 (void) writel(Value32, &((pDevice)->pMemView->OffsetName)) : \
3228 LM_RegWrInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName), Value32)
3230 #define MB_REG_RD(pDevice, OffsetName) \
3231 readl(&((pDevice)->pMemView->OffsetName))
3233 #define MB_REG_WR(pDevice, OffsetName, Value32) \
3234 writel(Value32, &((pDevice)->pMemView->OffsetName))
3236 #define REG_RD_OFFSET(pDevice, Offset) \
3237 readl(&((LM_UINT8 *) (pDevice)->pMemView + Offset))
3239 #define REG_WR_OFFSET(pDevice, Offset, Value32) \
3240 (((Offset >=0x200 ) && (Offset < 0x400)) || \
3241 ((pDevice)->EnablePciXFix == FALSE)) ? \
3242 (void) writel(Value32, ((LM_UINT8 *) (pDevice)->pMemView + Offset)) : \
3243 LM_RegWrInd(pDevice, Offset, Value32)
3245 #define MEM_RD(pDevice, AddrName) \
3246 LM_MemRdInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName))
3247 #define MEM_WR(pDevice, AddrName, Value32) \
3248 LM_MemWrInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName), Value32)
3250 #define MEM_RD_OFFSET(pDevice, Offset) \
3251 LM_MemRdInd(pDevice, Offset)
3252 #define MEM_WR_OFFSET(pDevice, Offset, Value32) \
3253 LM_MemWrInd(pDevice, Offset, Value32)
3255 #else /* normal target access path below */
3257 /* Register access. */
3258 #define REG_RD(pDevice, OffsetName) \
3259 readl(&((pDevice)->pMemView->OffsetName))
3260 #define REG_WR(pDevice, OffsetName, Value32) \
3261 writel(Value32, &((pDevice)->pMemView->OffsetName))
3263 #define REG_RD_OFFSET(pDevice, Offset) \
3264 readl(((LM_UINT8 *) (pDevice)->pMemView + Offset))
3265 #define REG_WR_OFFSET(pDevice, Offset, Value32) \
3266 writel(Value32, ((LM_UINT8 *) (pDevice)->pMemView + Offset))
3268 /* There could be problem access the memory window directly. For now, */
3269 /* we have to go through the PCI configuration register. */
3270 #define MEM_RD(pDevice, AddrName) \
3271 LM_MemRdInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName))
3272 #define MEM_WR(pDevice, AddrName, Value32) \
3273 LM_MemWrInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName), Value32)
3275 #define MEM_RD_OFFSET(pDevice, Offset) \
3276 LM_MemRdInd(pDevice, Offset)
3277 #define MEM_WR_OFFSET(pDevice, Offset, Value32) \
3278 LM_MemWrInd(pDevice, Offset, Value32)
3280 #endif /* PCIX_TARGET_WORKAROUND */
3282 #endif /* Jimmy, merging */
3284 /* Jimmy...rest of file is new stuff! */
3285 /******************************************************************************/
3286 /* NIC register read/write macros. */
3287 /******************************************************************************/
3289 /* MAC register access. */
3290 LM_UINT32 LM_RegRdInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register);
3291 LM_VOID LM_RegWrInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 Register,
3294 /* MAC memory access. */
3295 LM_UINT32 LM_MemRdInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 MemAddr);
3296 LM_VOID LM_MemWrInd (PLM_DEVICE_BLOCK pDevice, LM_UINT32 MemAddr,
3299 #define MB_REG_WR(pDevice, OffsetName, Value32) \
3300 ((pDevice)->UndiFix) ? \
3301 LM_RegWrInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName)+0x5600, \
3303 (void) __raw_writel(Value32, &((pDevice)->pMemView->OffsetName))
3305 #define MB_REG_RD(pDevice, OffsetName) \
3306 (((pDevice)->UndiFix) ? \
3307 LM_RegRdInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName)+0x5600) : \
3308 __raw_readl(&((pDevice)->pMemView->OffsetName)))
3310 #define REG_RD(pDevice, OffsetName) \
3311 (((pDevice)->UndiFix) ? \
3312 LM_RegRdInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName)) : \
3313 __raw_readl(&((pDevice)->pMemView->OffsetName)))
3315 #if PCIX_TARGET_WORKAROUND
3317 #define REG_WR(pDevice, OffsetName, Value32) \
3318 ((pDevice)->EnablePciXFix == FALSE) ? \
3319 (void) __raw_writel(Value32, &((pDevice)->pMemView->OffsetName)) : \
3320 LM_RegWrInd(pDevice, OFFSETOF(T3_STD_MEM_MAP, OffsetName), Value32)
3324 #define REG_WR(pDevice, OffsetName, Value32) \
3325 __raw_writel(Value32, &((pDevice)->pMemView->OffsetName))
3329 #define MEM_RD(pDevice, AddrName) \
3330 LM_MemRdInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName))
3331 #define MEM_WR(pDevice, AddrName, Value32) \
3332 LM_MemWrInd(pDevice, OFFSETOF(T3_FIRST_32K_SRAM, AddrName), Value32)
3334 #define MEM_RD_OFFSET(pDevice, Offset) \
3335 LM_MemRdInd(pDevice, Offset)
3336 #define MEM_WR_OFFSET(pDevice, Offset, Value32) \
3337 LM_MemWrInd(pDevice, Offset, Value32)
3339 #endif /* TIGON3_H */