48 #define CAS_ID_REV2 0x02
49 #define CAS_ID_REVPLUS 0x10
50 #define CAS_ID_REVPLUS02u 0x11
51 #define CAS_ID_REVSATURNB2 0x30
61 #define REG_CAWR 0x0004
62 #define CAWR_RX_DMA_WEIGHT_SHIFT 0
63 #define CAWR_RX_DMA_WEIGHT_MASK 0x03
64 #define CAWR_TX_DMA_WEIGHT_SHIFT 2
65 #define CAWR_TX_DMA_WEIGHT_MASK 0x0C
66 #define CAWR_RR_DIS 0x10
73 #define REG_INF_BURST 0x0008
74 #define INF_BURST_EN 0x1
81 #define REG_INTR_STATUS 0x000C
82 #define INTR_TX_INTME 0x00000001
85 #define INTR_TX_ALL 0x00000002
90 #define INTR_TX_DONE 0x00000004
92 #define INTR_TX_TAG_ERROR 0x00000008
94 #define INTR_RX_DONE 0x00000010
99 #define INTR_RX_BUF_UNAVAIL 0x00000020
101 #define INTR_RX_TAG_ERROR 0x00000040
103 #define INTR_RX_COMP_FULL 0x00000080
108 #define INTR_RX_BUF_AE 0x00000100
112 #define INTR_RX_COMP_AF 0x00000200
117 #define INTR_RX_LEN_MISMATCH 0x00000400
124 #define INTR_SUMMARY 0x00001000
129 #define INTR_PCS_STATUS 0x00002000
130 #define INTR_TX_MAC_STATUS 0x00004000
132 #define INTR_RX_MAC_STATUS 0x00008000
134 #define INTR_MAC_CTRL_STATUS 0x00010000
137 #define INTR_MIF_STATUS 0x00020000
139 #define INTR_PCI_ERROR_STATUS 0x00040000
142 #define INTR_TX_COMP_3_MASK 0xFFF80000
144 #define INTR_TX_COMP_3_SHIFT 19
145 #define INTR_ERROR_MASK (INTR_MIF_STATUS | INTR_PCI_ERROR_STATUS | \
146 INTR_PCS_STATUS | INTR_RX_LEN_MISMATCH | \
147 INTR_TX_MAC_STATUS | INTR_RX_MAC_STATUS | \
148 INTR_TX_TAG_ERROR | INTR_RX_TAG_ERROR | \
149 INTR_MAC_CTRL_STATUS)
155 #define REG_INTR_MASK 0x0010
161 #define REG_ALIAS_CLEAR 0x0014
167 #define REG_INTR_STATUS_ALIAS 0x001C
171 #define REG_PCI_ERR_STATUS 0x1000
172 #define PCI_ERR_BADACK 0x01
175 #define PCI_ERR_DTRTO 0x02
177 #define PCI_ERR_OTHER 0x04
178 #define PCI_ERR_BIM_DMA_WRITE 0x08
180 #define PCI_ERR_BIM_DMA_READ 0x10
182 #define PCI_ERR_BIM_DMA_TIMEOUT 0x20
189 #define REG_PCI_ERR_STATUS_MASK 0x1004
194 #define REG_BIM_CFG 0x1008
195 #define BIM_CFG_RESERVED0 0x001
196 #define BIM_CFG_RESERVED1 0x002
197 #define BIM_CFG_64BIT_DISABLE 0x004
198 #define BIM_CFG_66MHZ 0x008
199 #define BIM_CFG_32BIT 0x010
200 #define BIM_CFG_DPAR_INTR_ENABLE 0x020
201 #define BIM_CFG_RMA_INTR_ENABLE 0x040
202 #define BIM_CFG_RTA_INTR_ENABLE 0x080
203 #define BIM_CFG_RESERVED2 0x100
204 #define BIM_CFG_BIM_DISABLE 0x200
206 #define BIM_CFG_BIM_STATUS 0x400
208 #define BIM_CFG_PERROR_BLOCK 0x800
212 #define REG_BIM_DIAG 0x100C
213 #define BIM_DIAG_MSTR_SM_MASK 0x3FFFFF00
215 #define BIM_DIAG_BRST_SM_MASK 0x7F
221 #define REG_SW_RESET 0x1010
222 #define SW_RESET_TX 0x00000001
224 #define SW_RESET_RX 0x00000002
226 #define SW_RESET_RSTOUT 0x00000004
232 #define SW_RESET_BLOCK_PCS_SLINK 0x00000008
236 #define SW_RESET_BREQ_SM_MASK 0x00007F00
237 #define SW_RESET_PCIARB_SM_MASK 0x00070000
246 #define SW_RESET_RDPCI_SM_MASK 0x00300000
250 #define SW_RESET_RDARB_SM_MASK 0x00C00000
255 #define SW_RESET_WRPCI_SM_MASK 0x06000000
259 #define SW_RESET_WRARB_SM_MASK 0x38000000
271 #define REG_MINUS_BIM_DATAPATH_TEST 0x1018
279 #define REG_BIM_LOCAL_DEV_EN 0x1020
281 #define BIM_LOCAL_DEV_PAD 0x01
286 #define BIM_LOCAL_DEV_PROM 0x02
287 #define BIM_LOCAL_DEV_EXT 0x04
289 #define BIM_LOCAL_DEV_SOFT_0 0x08
290 #define BIM_LOCAL_DEV_SOFT_1 0x10
291 #define BIM_LOCAL_DEV_HW_RESET 0x20
298 #define REG_BIM_BUFFER_ADDR 0x1024
300 #define BIM_BUFFER_ADDR_MASK 0x3F
301 #define BIM_BUFFER_WR_SELECT 0x40
304 #define REG_BIM_BUFFER_DATA_LOW 0x1028
305 #define REG_BIM_BUFFER_DATA_HI 0x102C
310 #define REG_BIM_RAM_BIST 0x102C
312 #define BIM_RAM_BIST_RD_START 0x01
313 #define BIM_RAM_BIST_WR_START 0x02
316 #define BIM_RAM_BIST_RD_PASS 0x04
318 #define BIM_RAM_BIST_WR_PASS 0x08
321 #define BIM_RAM_BIST_RD_LOW_PASS 0x10
322 #define BIM_RAM_BIST_RD_HI_PASS 0x20
323 #define BIM_RAM_BIST_WR_LOW_PASS 0x40
326 #define BIM_RAM_BIST_WR_HI_PASS 0x80
333 #define REG_BIM_DIAG_MUX 0x1030
355 #define REG_PLUS_PROBE_MUX_SELECT 0x1034
356 #define PROBE_MUX_EN 0x80000000
359 #define PROBE_MUX_SUB_MUX_MASK 0x0000FF00
364 #define PROBE_MUX_SEL_HI_MASK 0x000000F0
367 #define PROBE_MUX_SEL_LOW_MASK 0x0000000F
373 #define REG_PLUS_INTR_MASK_1 0x1038
375 #define REG_PLUS_INTRN_MASK(x) (REG_PLUS_INTR_MASK_1 + ((x) - 1)*16)
381 #define INTR_RX_DONE_ALT 0x01
382 #define INTR_RX_COMP_FULL_ALT 0x02
383 #define INTR_RX_COMP_AF_ALT 0x04
384 #define INTR_RX_BUF_UNAVAIL_1 0x08
385 #define INTR_RX_BUF_AE_1 0x10
386 #define INTRN_MASK_RX_EN 0x80
387 #define INTRN_MASK_CLEAR_ALL (INTR_RX_DONE_ALT | \
388 INTR_RX_COMP_FULL_ALT | \
389 INTR_RX_COMP_AF_ALT | \
390 INTR_RX_BUF_UNAVAIL_1 | \
392 #define REG_PLUS_INTR_STATUS_1 0x103C
394 #define REG_PLUS_INTRN_STATUS(x) (REG_PLUS_INTR_STATUS_1 + ((x) - 1)*16)
395 #define INTR_STATUS_ALT_INTX_EN 0x80
398 #define REG_PLUS_ALIAS_CLEAR_1 0x1040
400 #define REG_PLUS_ALIASN_CLEAR(x) (REG_PLUS_ALIAS_CLEAR_1 + ((x) - 1)*16)
402 #define REG_PLUS_INTR_STATUS_ALIAS_1 0x1044
404 #define REG_PLUS_INTRN_STATUS_ALIAS(x) (REG_PLUS_INTR_STATUS_ALIAS_1 + ((x) - 1)*16)
406 #define REG_SATURN_PCFG 0x106c
409 #define SATURN_PCFG_TLA 0x00000001
410 #define SATURN_PCFG_FLA 0x00000002
411 #define SATURN_PCFG_CLA 0x00000004
412 #define SATURN_PCFG_LLA 0x00000008
413 #define SATURN_PCFG_RLA 0x00000010
414 #define SATURN_PCFG_PDS 0x00000020
416 #define SATURN_PCFG_MTP 0x00000080
417 #define SATURN_PCFG_GMO 0x00000100
420 #define SATURN_PCFG_FSI 0x00000200
424 #define SATURN_PCFG_LAD 0x00000800
432 #define MAX_TX_RINGS_SHIFT 2
433 #define MAX_TX_RINGS (1 << MAX_TX_RINGS_SHIFT)
434 #define MAX_TX_RINGS_MASK (MAX_TX_RINGS - 1)
440 #define REG_TX_CFG 0x2004
441 #define TX_CFG_DMA_EN 0x00000001
444 #define TX_CFG_FIFO_PIO_SEL 0x00000002
449 #define TX_CFG_DESC_RING0_MASK 0x0000003C
451 #define TX_CFG_DESC_RING0_SHIFT 2
452 #define TX_CFG_DESC_RINGN_MASK(a) (TX_CFG_DESC_RING0_MASK << (a)*4)
453 #define TX_CFG_DESC_RINGN_SHIFT(a) (TX_CFG_DESC_RING0_SHIFT + (a)*4)
454 #define TX_CFG_PACED_MODE 0x00100000
458 #define TX_CFG_DMA_RDPIPE_DIS 0x01000000
459 #define TX_CFG_COMPWB_Q1 0x02000000
462 #define TX_CFG_COMPWB_Q2 0x04000000
465 #define TX_CFG_COMPWB_Q3 0x08000000
468 #define TX_CFG_COMPWB_Q4 0x10000000
471 #define TX_CFG_INTR_COMPWB_DIS 0x20000000
473 #define TX_CFG_CTX_SEL_MASK 0xC0000000
486 #define TX_CFG_CTX_SEL_SHIFT 30
491 #define REG_TX_FIFO_WRITE_PTR 0x2014
492 #define REG_TX_FIFO_SHADOW_WRITE_PTR 0x2018
495 #define REG_TX_FIFO_READ_PTR 0x201C
496 #define REG_TX_FIFO_SHADOW_READ_PTR 0x2020
500 #define REG_TX_FIFO_PKT_CNT 0x2024
503 #define REG_TX_SM_1 0x2028
504 #define TX_SM_1_CHAIN_MASK 0x000003FF
505 #define TX_SM_1_CSUM_MASK 0x00000C00
506 #define TX_SM_1_FIFO_LOAD_MASK 0x0003F000
508 #define TX_SM_1_FIFO_UNLOAD_MASK 0x003C0000
509 #define TX_SM_1_CACHE_MASK 0x03C00000
511 #define TX_SM_1_CBQ_ARB_MASK 0xF8000000
513 #define REG_TX_SM_2 0x202C
514 #define TX_SM_2_COMP_WB_MASK 0x07
515 #define TX_SM_2_SUB_LOAD_MASK 0x38
516 #define TX_SM_2_KICK_MASK 0xC0
521 #define REG_TX_DATA_PTR_LOW 0x2030
522 #define REG_TX_DATA_PTR_HI 0x2034
530 #define REG_TX_KICK0 0x2038
531 #define REG_TX_KICKN(x) (REG_TX_KICK0 + (x)*4)
532 #define REG_TX_COMP0 0x2048
533 #define REG_TX_COMPN(x) (REG_TX_COMP0 + (x)*4)
551 #define TX_COMPWB_SIZE 8
552 #define REG_TX_COMPWB_DB_LOW 0x2058
554 #define REG_TX_COMPWB_DB_HI 0x205C
556 #define TX_COMPWB_MSB_MASK 0x00000000000000FFULL
557 #define TX_COMPWB_MSB_SHIFT 0
558 #define TX_COMPWB_LSB_MASK 0x000000000000FF00ULL
559 #define TX_COMPWB_LSB_SHIFT 8
560 #define TX_COMPWB_NEXT(x) ((x) >> 16)
564 #define REG_TX_DB0_LOW 0x2060
565 #define REG_TX_DB0_HI 0x2064
566 #define REG_TX_DBN_LOW(x) (REG_TX_DB0_LOW + (x)*8)
567 #define REG_TX_DBN_HI(x) (REG_TX_DB0_HI + (x)*8)
578 #define REG_TX_MAXBURST_0 0x2080
579 #define REG_TX_MAXBURST_1 0x2084
580 #define REG_TX_MAXBURST_2 0x2088
581 #define REG_TX_MAXBURST_3 0x208C
590 #define REG_TX_FIFO_ADDR 0x2104
591 #define REG_TX_FIFO_TAG 0x2108
592 #define REG_TX_FIFO_DATA_LOW 0x210C
593 #define REG_TX_FIFO_DATA_HI_T1 0x2110
594 #define REG_TX_FIFO_DATA_HI_T0 0x2114
595 #define REG_TX_FIFO_SIZE 0x2118
600 #define REG_TX_RAMBIST 0x211C
601 #define TX_RAMBIST_STATE 0x01C0
603 #define TX_RAMBIST_RAM33A_PASS 0x0020
604 #define TX_RAMBIST_RAM32A_PASS 0x0010
605 #define TX_RAMBIST_RAM33B_PASS 0x0008
606 #define TX_RAMBIST_RAM32B_PASS 0x0004
607 #define TX_RAMBIST_SUMMARY 0x0002
608 #define TX_RAMBIST_START 0x0001
612 #define MAX_RX_DESC_RINGS 2
613 #define MAX_RX_COMP_RINGS 4
620 #define REG_RX_CFG 0x4000
621 #define RX_CFG_DMA_EN 0x00000001
627 #define RX_CFG_DESC_RING_MASK 0x0000001E
630 #define RX_CFG_DESC_RING_SHIFT 1
631 #define RX_CFG_COMP_RING_MASK 0x000001E0
633 #define RX_CFG_COMP_RING_SHIFT 5
634 #define RX_CFG_BATCH_DIS 0x00000200
637 #define RX_CFG_SWIVEL_MASK 0x00001C00
646 #define RX_CFG_SWIVEL_SHIFT 10
649 #define RX_CFG_DESC_RING1_MASK 0x000F0000
652 #define RX_CFG_DESC_RING1_SHIFT 16
667 #define REG_RX_PAGE_SIZE 0x4004
668 #define RX_PAGE_SIZE_MASK 0x00000003
676 #define RX_PAGE_SIZE_SHIFT 0
677 #define RX_PAGE_SIZE_MTU_COUNT_MASK 0x00007800
680 #define RX_PAGE_SIZE_MTU_COUNT_SHIFT 11
681 #define RX_PAGE_SIZE_MTU_STRIDE_MASK 0x18000000
688 #define RX_PAGE_SIZE_MTU_STRIDE_SHIFT 27
689 #define RX_PAGE_SIZE_MTU_OFF_MASK 0xC0000000
696 #define RX_PAGE_SIZE_MTU_OFF_SHIFT 30
702 #define REG_RX_FIFO_WRITE_PTR 0x4008
703 #define REG_RX_FIFO_READ_PTR 0x400C
704 #define REG_RX_IPP_FIFO_SHADOW_WRITE_PTR 0x4010
706 #define REG_RX_IPP_FIFO_SHADOW_READ_PTR 0x4014
708 #define REG_RX_IPP_FIFO_READ_PTR 0x400C
714 #define REG_RX_DEBUG 0x401C
715 #define RX_DEBUG_LOAD_STATE_MASK 0x0000000F
725 #define RX_DEBUG_LM_STATE_MASK 0x00000070
734 #define RX_DEBUG_FC_STATE_MASK 0x000000180
740 #define RX_DEBUG_DATA_STATE_MASK 0x000001E00
758 #define RX_DEBUG_DESC_STATE_MASK 0x0001E000
770 #define RX_DEBUG_INTR_READ_PTR_MASK 0x30000000
772 #define RX_DEBUG_INTR_WRITE_PTR_MASK 0xC0000000
784 #define REG_RX_PAUSE_THRESH 0x4020
785 #define RX_PAUSE_THRESH_QUANTUM 64
786 #define RX_PAUSE_THRESH_OFF_MASK 0x000001FF
789 #define RX_PAUSE_THRESH_OFF_SHIFT 0
790 #define RX_PAUSE_THRESH_ON_MASK 0x001FF000
797 #define RX_PAUSE_THRESH_ON_SHIFT 12
805 #define REG_RX_KICK 0x4024
810 #define REG_RX_DB_LOW 0x4028
812 #define REG_RX_DB_HI 0x402C
814 #define REG_RX_CB_LOW 0x4030
816 #define REG_RX_CB_HI 0x4034
822 #define REG_RX_COMP 0x4038
834 #define REG_RX_COMP_HEAD 0x403C
835 #define REG_RX_COMP_TAIL 0x4040
840 #define REG_RX_BLANK 0x4044
842 #define RX_BLANK_INTR_PKT_MASK 0x000001FF
848 #define RX_BLANK_INTR_PKT_SHIFT 0
849 #define RX_BLANK_INTR_TIME_MASK 0x3FFFF000
856 #define RX_BLANK_INTR_TIME_SHIFT 12
862 #define REG_RX_AE_THRESH 0x4048
864 #define RX_AE_THRESH_FREE_MASK 0x00001FFF
868 #define RX_AE_THRESH_FREE_SHIFT 0
869 #define RX_AE_THRESH_COMP_MASK 0x0FFFE000
874 #define RX_AE_THRESH_COMP_SHIFT 13
882 #define REG_RX_RED 0x404C
883 #define RX_RED_4K_6K_FIFO_MASK 0x000000FF
884 #define RX_RED_6K_8K_FIFO_MASK 0x0000FF00
885 #define RX_RED_8K_10K_FIFO_MASK 0x00FF0000
886 #define RX_RED_10K_12K_FIFO_MASK 0xFF000000
892 #define REG_RX_FIFO_FULLNESS 0x4050
893 #define RX_FIFO_FULLNESS_RX_FIFO_MASK 0x3FF80000
894 #define RX_FIFO_FULLNESS_IPP_FIFO_MASK 0x0007FF00
895 #define RX_FIFO_FULLNESS_RX_PKT_MASK 0x000000FF
896 #define REG_RX_IPP_PACKET_COUNT 0x4054
897 #define REG_RX_WORK_DMA_PTR_LOW 0x4058
898 #define REG_RX_WORK_DMA_PTR_HI 0x405C
906 #define REG_RX_BIST 0x4060
907 #define RX_BIST_32A_PASS 0x80000000
908 #define RX_BIST_33A_PASS 0x40000000
909 #define RX_BIST_32B_PASS 0x20000000
910 #define RX_BIST_33B_PASS 0x10000000
911 #define RX_BIST_32C_PASS 0x08000000
912 #define RX_BIST_33C_PASS 0x04000000
913 #define RX_BIST_IPP_32A_PASS 0x02000000
914 #define RX_BIST_IPP_33A_PASS 0x01000000
915 #define RX_BIST_IPP_32B_PASS 0x00800000
916 #define RX_BIST_IPP_33B_PASS 0x00400000
917 #define RX_BIST_IPP_32C_PASS 0x00200000
918 #define RX_BIST_IPP_33C_PASS 0x00100000
919 #define RX_BIST_CTRL_32_PASS 0x00800000
920 #define RX_BIST_CTRL_33_PASS 0x00400000
921 #define RX_BIST_REAS_26A_PASS 0x00200000
922 #define RX_BIST_REAS_26B_PASS 0x00100000
923 #define RX_BIST_REAS_27_PASS 0x00080000
924 #define RX_BIST_STATE_MASK 0x00078000
925 #define RX_BIST_SUMMARY 0x00000002
930 #define RX_BIST_START 0x00000001
938 #define REG_RX_CTRL_FIFO_WRITE_PTR 0x4064
940 #define REG_RX_CTRL_FIFO_READ_PTR 0x4068
947 #define REG_RX_BLANK_ALIAS_READ 0x406C
949 #define RX_BAR_INTR_PACKET_MASK 0x000001FF
956 #define RX_BAR_INTR_TIME_MASK 0x3FFFF000
971 #define REG_RX_FIFO_ADDR 0x4080
972 #define REG_RX_FIFO_TAG 0x4084
973 #define REG_RX_FIFO_DATA_LOW 0x4088
974 #define REG_RX_FIFO_DATA_HI_T0 0x408C
975 #define REG_RX_FIFO_DATA_HI_T1 0x4090
984 #define REG_RX_CTRL_FIFO_ADDR 0x4094
986 #define REG_RX_CTRL_FIFO_DATA_LOW 0x4098
988 #define REG_RX_CTRL_FIFO_DATA_MID 0x409C
990 #define REG_RX_CTRL_FIFO_DATA_HI 0x4100
992 #define RX_CTRL_FIFO_DATA_HI_CTRL 0x0001
993 #define RX_CTRL_FIFO_DATA_HI_FLOW_MASK 0x007E
998 #define REG_RX_IPP_FIFO_ADDR 0x4104
999 #define REG_RX_IPP_FIFO_TAG 0x4108
1000 #define REG_RX_IPP_FIFO_DATA_LOW 0x410C
1001 #define REG_RX_IPP_FIFO_DATA_HI_T0 0x4110
1003 #define REG_RX_IPP_FIFO_DATA_HI_T1 0x4114
1012 #define REG_RX_HEADER_PAGE_PTR_LOW 0x4118
1014 #define REG_RX_HEADER_PAGE_PTR_HI 0x411C
1016 #define REG_RX_MTU_PAGE_PTR_LOW 0x4120
1018 #define REG_RX_MTU_PAGE_PTR_HI 0x4124
1030 #define REG_RX_TABLE_ADDR 0x4128
1032 #define RX_TABLE_ADDR_MASK 0x0000003F
1034 #define REG_RX_TABLE_DATA_LOW 0x412C
1036 #define REG_RX_TABLE_DATA_MID 0x4130
1038 #define REG_RX_TABLE_DATA_HI 0x4134
1045 #define REG_PLUS_RX_DB1_LOW 0x4200
1047 #define REG_PLUS_RX_DB1_HI 0x4204
1049 #define REG_PLUS_RX_CB1_LOW 0x4208
1051 #define REG_PLUS_RX_CB1_HI 0x420C
1053 #define REG_PLUS_RX_CBN_LOW(x) (REG_PLUS_RX_CB1_LOW + 8*((x) - 1))
1054 #define REG_PLUS_RX_CBN_HI(x) (REG_PLUS_RX_CB1_HI + 8*((x) - 1))
1055 #define REG_PLUS_RX_KICK1 0x4220
1056 #define REG_PLUS_RX_COMP1 0x4224
1058 #define REG_PLUS_RX_COMP1_HEAD 0x4228
1060 #define REG_PLUS_RX_COMP1_TAIL 0x422C
1062 #define REG_PLUS_RX_COMPN_HEAD(x) (REG_PLUS_RX_COMP1_HEAD + 8*((x) - 1))
1063 #define REG_PLUS_RX_COMPN_TAIL(x) (REG_PLUS_RX_COMP1_TAIL + 8*((x) - 1))
1064 #define REG_PLUS_RX_AE1_THRESH 0x4240
1066 #define RX_AE1_THRESH_FREE_MASK RX_AE_THRESH_FREE_MASK
1067 #define RX_AE1_THRESH_FREE_SHIFT RX_AE_THRESH_FREE_SHIFT
1074 #define REG_HP_CFG 0x4140
1076 #define HP_CFG_PARSE_EN 0x00000001
1077 #define HP_CFG_NUM_CPU_MASK 0x000000FC
1079 #define HP_CFG_NUM_CPU_SHIFT 2
1080 #define HP_CFG_SYN_INC_MASK 0x00000100
1083 #define HP_CFG_TCP_THRESH_MASK 0x000FFE00
1086 #define HP_CFG_TCP_THRESH_SHIFT 9
1094 #define REG_HP_INSTR_RAM_ADDR 0x4144
1096 #define HP_INSTR_RAM_ADDR_MASK 0x01F
1097 #define REG_HP_INSTR_RAM_DATA_LOW 0x4148
1099 #define HP_INSTR_RAM_LOW_OUTMASK_MASK 0x0000FFFF
1100 #define HP_INSTR_RAM_LOW_OUTMASK_SHIFT 0
1101 #define HP_INSTR_RAM_LOW_OUTSHIFT_MASK 0x000F0000
1102 #define HP_INSTR_RAM_LOW_OUTSHIFT_SHIFT 16
1103 #define HP_INSTR_RAM_LOW_OUTEN_MASK 0x00300000
1104 #define HP_INSTR_RAM_LOW_OUTEN_SHIFT 20
1105 #define HP_INSTR_RAM_LOW_OUTARG_MASK 0xFFC00000
1106 #define HP_INSTR_RAM_LOW_OUTARG_SHIFT 22
1107 #define REG_HP_INSTR_RAM_DATA_MID 0x414C
1109 #define HP_INSTR_RAM_MID_OUTARG_MASK 0x00000003
1110 #define HP_INSTR_RAM_MID_OUTARG_SHIFT 0
1111 #define HP_INSTR_RAM_MID_OUTOP_MASK 0x0000003C
1112 #define HP_INSTR_RAM_MID_OUTOP_SHIFT 2
1113 #define HP_INSTR_RAM_MID_FNEXT_MASK 0x000007C0
1114 #define HP_INSTR_RAM_MID_FNEXT_SHIFT 6
1115 #define HP_INSTR_RAM_MID_FOFF_MASK 0x0003F800
1116 #define HP_INSTR_RAM_MID_FOFF_SHIFT 11
1117 #define HP_INSTR_RAM_MID_SNEXT_MASK 0x007C0000
1118 #define HP_INSTR_RAM_MID_SNEXT_SHIFT 18
1119 #define HP_INSTR_RAM_MID_SOFF_MASK 0x3F800000
1120 #define HP_INSTR_RAM_MID_SOFF_SHIFT 23
1121 #define HP_INSTR_RAM_MID_OP_MASK 0xC0000000
1122 #define HP_INSTR_RAM_MID_OP_SHIFT 30
1123 #define REG_HP_INSTR_RAM_DATA_HI 0x4150
1125 #define HP_INSTR_RAM_HI_VAL_MASK 0x0000FFFF
1126 #define HP_INSTR_RAM_HI_VAL_SHIFT 0
1127 #define HP_INSTR_RAM_HI_MASK_MASK 0xFFFF0000
1128 #define HP_INSTR_RAM_HI_MASK_SHIFT 16
1140 #define REG_HP_DATA_RAM_FDB_ADDR 0x4154
1142 #define HP_DATA_RAM_FDB_DATA_MASK 0x001F
1146 #define HP_DATA_RAM_FDB_FDB_MASK 0x3F00
1148 #define REG_HP_DATA_RAM_DATA 0x4158
1159 #define REG_HP_FLOW_DB0 0x415C
1160 #define REG_HP_FLOW_DBN(x) (REG_HP_FLOW_DB0 + (x)*4)
1166 #define REG_HP_STATE_MACHINE 0x418C
1167 #define REG_HP_STATUS0 0x4190
1168 #define HP_STATUS0_SAP_MASK 0xFFFF0000
1169 #define HP_STATUS0_L3_OFF_MASK 0x0000FE00
1170 #define HP_STATUS0_LB_CPUNUM_MASK 0x000001F8
1172 #define HP_STATUS0_HRP_OPCODE_MASK 0x00000007
1174 #define REG_HP_STATUS1 0x4194
1175 #define HP_STATUS1_ACCUR2_MASK 0xE0000000
1176 #define HP_STATUS1_FLOWID_MASK 0x1F800000
1177 #define HP_STATUS1_TCP_OFF_MASK 0x007F0000
1178 #define HP_STATUS1_TCP_SIZE_MASK 0x0000FFFF
1180 #define REG_HP_STATUS2 0x4198
1181 #define HP_STATUS2_ACCUR2_MASK 0xF0000000
1182 #define HP_STATUS2_CSUM_OFF_MASK 0x07F00000
1184 #define HP_STATUS2_ACCUR1_MASK 0x000FE000
1185 #define HP_STATUS2_FORCE_DROP 0x00001000
1186 #define HP_STATUS2_BWO_REASSM 0x00000800
1188 #define HP_STATUS2_JH_SPLIT_EN 0x00000400
1190 #define HP_STATUS2_FORCE_TCP_NOCHECK 0x00000200
1192 #define HP_STATUS2_DATA_MASK_ZERO 0x00000100
1194 #define HP_STATUS2_FORCE_TCP_CHECK 0x00000080
1196 #define HP_STATUS2_MASK_TCP_THRESH 0x00000040
1198 #define HP_STATUS2_NO_ASSIST 0x00000020
1199 #define HP_STATUS2_CTRL_PACKET_FLAG 0x00000010
1200 #define HP_STATUS2_TCP_FLAG_CHECK 0x00000008
1201 #define HP_STATUS2_SYN_FLAG 0x00000004
1202 #define HP_STATUS2_TCP_CHECK 0x00000002
1203 #define HP_STATUS2_TCP_NOCHECK 0x00000001
1210 #define REG_HP_RAM_BIST 0x419C
1211 #define HP_RAM_BIST_HP_DATA_PASS 0x80000000
1212 #define HP_RAM_BIST_HP_INSTR0_PASS 0x40000000
1213 #define HP_RAM_BIST_HP_INSTR1_PASS 0x20000000
1214 #define HP_RAM_BIST_HP_INSTR2_PASS 0x10000000
1215 #define HP_RAM_BIST_FDBM_AGE0_PASS 0x08000000
1216 #define HP_RAM_BIST_FDBM_AGE1_PASS 0x04000000
1217 #define HP_RAM_BIST_FDBM_FLOWID00_PASS 0x02000000
1219 #define HP_RAM_BIST_FDBM_FLOWID10_PASS 0x01000000
1221 #define HP_RAM_BIST_FDBM_FLOWID20_PASS 0x00800000
1223 #define HP_RAM_BIST_FDBM_FLOWID30_PASS 0x00400000
1225 #define HP_RAM_BIST_FDBM_FLOWID01_PASS 0x00200000
1227 #define HP_RAM_BIST_FDBM_FLOWID11_PASS 0x00100000
1229 #define HP_RAM_BIST_FDBM_FLOWID21_PASS 0x00080000
1231 #define HP_RAM_BIST_FDBM_FLOWID31_PASS 0x00040000
1233 #define HP_RAM_BIST_FDBM_TCPSEQ_PASS 0x00020000
1235 #define HP_RAM_BIST_SUMMARY 0x00000002
1236 #define HP_RAM_BIST_START 0x00000001
1243 #define REG_MAC_TX_RESET 0x6000
1245 #define REG_MAC_RX_RESET 0x6004
1249 #define REG_MAC_SEND_PAUSE 0x6008
1250 #define MAC_SEND_PAUSE_TIME_MASK 0x0000FFFF
1254 #define MAC_SEND_PAUSE_SEND 0x00010000
1263 #define REG_MAC_TX_STATUS 0x6010
1264 #define MAC_TX_FRAME_XMIT 0x0001
1266 #define MAC_TX_UNDERRUN 0x0002
1270 #define MAC_TX_MAX_PACKET_ERR 0x0004
1273 #define MAC_TX_COLL_NORMAL 0x0008
1275 #define MAC_TX_COLL_EXCESS 0x0010
1277 #define MAC_TX_COLL_LATE 0x0020
1279 #define MAC_TX_COLL_FIRST 0x0040
1281 #define MAC_TX_DEFER_TIMER 0x0080
1283 #define MAC_TX_PEAK_ATTEMPTS 0x0100
1286 #define REG_MAC_RX_STATUS 0x6014
1287 #define MAC_RX_FRAME_RECV 0x0001
1289 #define MAC_RX_OVERFLOW 0x0002
1291 #define MAC_RX_FRAME_COUNT 0x0004
1293 #define MAC_RX_ALIGN_ERR 0x0008
1295 #define MAC_RX_CRC_ERR 0x0010
1297 #define MAC_RX_LEN_ERR 0x0020
1299 #define MAC_RX_VIOL_ERR 0x0040
1303 #define REG_MAC_CTRL_STATUS 0x6018
1304 #define MAC_CTRL_PAUSE_RECEIVED 0x00000001
1308 #define MAC_CTRL_PAUSE_STATE 0x00000002
1312 #define MAC_CTRL_NOPAUSE_STATE 0x00000004
1316 #define MAC_CTRL_PAUSE_TIME_MASK 0xFFFF0000
1323 #define REG_MAC_TX_MASK 0x6020
1325 #define REG_MAC_RX_MASK 0x6024
1327 #define REG_MAC_CTRL_MASK 0x6028
1339 #define REG_MAC_TX_CFG 0x6030
1340 #define MAC_TX_CFG_EN 0x0001
1347 #define MAC_TX_CFG_IGNORE_CARRIER 0x0002
1351 #define MAC_TX_CFG_IGNORE_COLL 0x0004
1355 #define MAC_TX_CFG_IPG_EN 0x0008
1371 #define MAC_TX_CFG_NEVER_GIVE_UP_EN 0x0010
1383 #define MAC_TX_CFG_NEVER_GIVE_UP_LIM 0x0020
1391 #define MAC_TX_CFG_NO_BACKOFF 0x0040
1397 #define MAC_TX_CFG_SLOW_DOWN 0x0080
1406 #define MAC_TX_CFG_NO_FCS 0x0100
1413 #define MAC_TX_CFG_CARRIER_EXTEND 0x0200
1434 #define REG_MAC_RX_CFG 0x6034
1435 #define MAC_RX_CFG_EN 0x0001
1436 #define MAC_RX_CFG_STRIP_PAD 0x0002
1438 #define MAC_RX_CFG_STRIP_FCS 0x0004
1441 #define MAC_RX_CFG_PROMISC_EN 0x0008
1442 #define MAC_RX_CFG_PROMISC_GROUP_EN 0x0010
1445 #define MAC_RX_CFG_HASH_FILTER_EN 0x0020
1447 #define MAC_RX_CFG_ADDR_FILTER_EN 0x0040
1452 #define MAC_RX_CFG_DISABLE_DISCARD 0x0080
1462 #define MAC_RX_CFG_CARRIER_EXTEND 0x0100
1470 #define REG_MAC_CTRL_CFG 0x6038
1471 #define MAC_CTRL_CFG_SEND_PAUSE_EN 0x0001
1474 #define MAC_CTRL_CFG_RECV_PAUSE_EN 0x0002
1476 #define MAC_CTRL_CFG_PASS_CTRL 0x0004
1485 #define REG_MAC_XIF_CFG 0x603C
1486 #define MAC_XIF_TX_MII_OUTPUT_EN 0x0001
1488 #define MAC_XIF_MII_INT_LOOPBACK 0x0002
1498 #define MAC_XIF_DISABLE_ECHO 0x0004
1507 #define MAC_XIF_GMII_MODE 0x0008
1509 #define MAC_XIF_MII_BUFFER_OUTPUT_EN 0x0010
1513 #define MAC_XIF_LINK_LED 0x0020
1514 #define MAC_XIF_FDPLX_LED 0x0040
1516 #define REG_MAC_IPG0 0x6040
1518 #define REG_MAC_IPG1 0x6044
1520 #define REG_MAC_IPG2 0x6048
1522 #define REG_MAC_SLOT_TIME 0x604C
1524 #define REG_MAC_FRAMESIZE_MIN 0x6050
1530 #define REG_MAC_FRAMESIZE_MAX 0x6054
1531 #define MAC_FRAMESIZE_MAX_BURST_MASK 0x3FFF0000
1532 #define MAC_FRAMESIZE_MAX_BURST_SHIFT 16
1533 #define MAC_FRAMESIZE_MAX_FRAME_MASK 0x00007FFF
1534 #define MAC_FRAMESIZE_MAX_FRAME_SHIFT 0
1535 #define REG_MAC_PA_SIZE 0x6058
1542 #define REG_MAC_JAM_SIZE 0x605C
1546 #define REG_MAC_ATTEMPT_LIMIT 0x6060
1558 #define REG_MAC_CTRL_TYPE 0x6064
1585 #define REG_MAC_ADDR0 0x6080
1586 #define REG_MAC_ADDRN(x) (REG_MAC_ADDR0 + (x)*4)
1587 #define REG_MAC_ADDR_FILTER0 0x614C
1589 #define REG_MAC_ADDR_FILTER1 0x6150
1591 #define REG_MAC_ADDR_FILTER2 0x6154
1593 #define REG_MAC_ADDR_FILTER2_1_MASK 0x6158
1597 #define REG_MAC_ADDR_FILTER0_MASK 0x615C
1605 #define REG_MAC_HASH_TABLE0 0x6160
1606 #define REG_MAC_HASH_TABLEN(x) (REG_MAC_HASH_TABLE0 + (x)*4)
1612 #define REG_MAC_COLL_NORMAL 0x61A0
1614 #define REG_MAC_COLL_FIRST 0x61A4
1617 #define REG_MAC_COLL_EXCESS 0x61A8
1619 #define REG_MAC_COLL_LATE 0x61AC
1620 #define REG_MAC_TIMER_DEFER 0x61B0
1623 #define REG_MAC_ATTEMPTS_PEAK 0x61B4
1624 #define REG_MAC_RECV_FRAME 0x61B8
1625 #define REG_MAC_LEN_ERR 0x61BC
1626 #define REG_MAC_ALIGN_ERR 0x61C0
1627 #define REG_MAC_FCS_ERR 0x61C4
1628 #define REG_MAC_RX_CODE_ERR 0x61C8
1632 #define REG_MAC_RANDOM_SEED 0x61CC
1651 #define REG_MAC_STATE_MACHINE 0x61D0
1652 #define MAC_SM_RLM_MASK 0x07800000
1653 #define MAC_SM_RLM_SHIFT 23
1654 #define MAC_SM_RX_FC_MASK 0x00700000
1655 #define MAC_SM_RX_FC_SHIFT 20
1656 #define MAC_SM_TLM_MASK 0x000F0000
1657 #define MAC_SM_TLM_SHIFT 16
1658 #define MAC_SM_ENCAP_SM_MASK 0x0000F000
1659 #define MAC_SM_ENCAP_SM_SHIFT 12
1660 #define MAC_SM_TX_REQ_MASK 0x00000C00
1661 #define MAC_SM_TX_REQ_SHIFT 10
1662 #define MAC_SM_TX_FC_MASK 0x000003C0
1663 #define MAC_SM_TX_FC_SHIFT 6
1664 #define MAC_SM_FIFO_WRITE_SEL_MASK 0x00000038
1665 #define MAC_SM_FIFO_WRITE_SEL_SHIFT 3
1666 #define MAC_SM_TX_FIFO_EMPTY_MASK 0x00000007
1667 #define MAC_SM_TX_FIFO_EMPTY_SHIFT 0
1672 #define REG_MIF_BIT_BANG_CLOCK 0x6200
1676 #define REG_MIF_BIT_BANG_DATA 0x6204
1678 #define REG_MIF_BIT_BANG_OUTPUT_EN 0x6208
1691 #define REG_MIF_FRAME 0x620C
1692 #define MIF_FRAME_START_MASK 0xC0000000
1695 #define MIF_FRAME_ST 0x40000000
1696 #define MIF_FRAME_OPCODE_MASK 0x30000000
1699 #define MIF_FRAME_OP_READ 0x20000000
1700 #define MIF_FRAME_OP_WRITE 0x10000000
1701 #define MIF_FRAME_PHY_ADDR_MASK 0x0F800000
1706 #define MIF_FRAME_PHY_ADDR_SHIFT 23
1707 #define MIF_FRAME_REG_ADDR_MASK 0x007C0000
1711 #define MIF_FRAME_REG_ADDR_SHIFT 18
1712 #define MIF_FRAME_TURN_AROUND_MSB 0x00020000
1715 #define MIF_FRAME_TURN_AROUND_LSB 0x00010000
1722 #define MIF_FRAME_DATA_MASK 0x0000FFFF
1736 #define REG_MIF_CFG 0x6210
1737 #define MIF_CFG_PHY_SELECT 0x0001
1739 #define MIF_CFG_POLL_EN 0x0002
1742 #define MIF_CFG_BB_MODE 0x0004
1744 #define MIF_CFG_POLL_REG_MASK 0x00F8
1748 #define MIF_CFG_POLL_REG_SHIFT 3
1749 #define MIF_CFG_MDIO_0 0x0100
1758 #define MIF_CFG_MDIO_1 0x0200
1767 #define MIF_CFG_POLL_PHY_MASK 0x7C00
1769 #define MIF_CFG_POLL_PHY_SHIFT 10
1776 #define REG_MIF_MASK 0x6214
1779 #define REG_MIF_STATUS 0x6218
1780 #define MIF_STATUS_POLL_DATA_MASK 0xFFFF0000
1784 #define MIF_STATUS_POLL_DATA_SHIFT 16
1785 #define MIF_STATUS_POLL_STATUS_MASK 0x0000FFFF
1791 #define MIF_STATUS_POLL_STATUS_SHIFT 0
1794 #define REG_MIF_STATE_MACHINE 0x621C
1795 #define MIF_SM_CONTROL_MASK 0x07
1797 #define MIF_SM_EXECUTION_MASK 0x60
1811 #define REG_PCS_MII_CTRL 0x9000
1812 #define PCS_MII_CTRL_1000_SEL 0x0040
1814 #define PCS_MII_CTRL_COLLISION_TEST 0x0080
1818 #define PCS_MII_CTRL_DUPLEX 0x0100
1821 #define PCS_MII_RESTART_AUTONEG 0x0200
1824 #define PCS_MII_ISOLATE 0x0400
1826 #define PCS_MII_POWER_DOWN 0x0800
1828 #define PCS_MII_AUTONEG_EN 0x1000
1835 #define PCS_MII_10_100_SEL 0x2000
1837 #define PCS_MII_RESET 0x8000
1841 #define REG_PCS_MII_STATUS 0x9004
1842 #define PCS_MII_STATUS_EXTEND_CAP 0x0001
1843 #define PCS_MII_STATUS_JABBER_DETECT 0x0002
1844 #define PCS_MII_STATUS_LINK_STATUS 0x0004
1850 #define PCS_MII_STATUS_AUTONEG_ABLE 0x0008
1852 #define PCS_MII_STATUS_REMOTE_FAULT 0x0010
1856 #define PCS_MII_STATUS_AUTONEG_COMP 0x0020
1860 #define PCS_MII_STATUS_EXTEND_STATUS 0x0100
1868 #define REG_PCS_MII_ADVERT 0x9008
1870 #define PCS_MII_ADVERT_FD 0x0020
1872 #define PCS_MII_ADVERT_HD 0x0040
1874 #define PCS_MII_ADVERT_SYM_PAUSE 0x0080
1876 #define PCS_MII_ADVERT_ASYM_PAUSE 0x0100
1878 #define PCS_MII_ADVERT_RF_MASK 0x3000
1886 #define PCS_MII_ADVERT_ACK 0x4000
1887 #define PCS_MII_ADVERT_NEXT_PAGE 0x8000
1892 #define REG_PCS_MII_LPA 0x900C
1894 #define PCS_MII_LPA_FD PCS_MII_ADVERT_FD
1895 #define PCS_MII_LPA_HD PCS_MII_ADVERT_HD
1896 #define PCS_MII_LPA_SYM_PAUSE PCS_MII_ADVERT_SYM_PAUSE
1897 #define PCS_MII_LPA_ASYM_PAUSE PCS_MII_ADVERT_ASYM_PAUSE
1898 #define PCS_MII_LPA_RF_MASK PCS_MII_ADVERT_RF_MASK
1899 #define PCS_MII_LPA_ACK PCS_MII_ADVERT_ACK
1900 #define PCS_MII_LPA_NEXT_PAGE PCS_MII_ADVERT_NEXT_PAGE
1903 #define REG_PCS_CFG 0x9010
1904 #define PCS_CFG_EN 0x01
1907 #define PCS_CFG_SD_OVERRIDE 0x02
1910 #define PCS_CFG_SD_ACTIVE_LOW 0x04
1914 #define PCS_CFG_JITTER_STUDY_MASK 0x18
1924 #define PCS_CFG_10MS_TIMER_OVERRIDE 0x20
1930 #define REG_PCS_STATE_MACHINE 0x9014
1932 #define PCS_SM_TX_STATE_MASK 0x0000000F
1936 #define PCS_SM_RX_STATE_MASK 0x000000F0
1939 #define PCS_SM_WORD_SYNC_STATE_MASK 0x00000700
1941 #define PCS_SM_SEQ_DETECT_STATE_MASK 0x00001800
1946 #define PCS_SM_LINK_STATE_MASK 0x0001E000
1947 #define SM_LINK_STATE_UP 0x00016000
1949 #define PCS_SM_LOSS_LINK_C 0x00100000
1952 #define PCS_SM_LOSS_LINK_SYNC 0x00200000
1954 #define PCS_SM_LOSS_SIGNAL_DETECT 0x00400000
1958 #define PCS_SM_NO_LINK_BREAKLINK 0x01000000
1967 #define PCS_SM_NO_LINK_SERDES 0x02000000
1970 #define PCS_SM_NO_LINK_C 0x04000000
1972 #define PCS_SM_NO_LINK_SYNC 0x08000000
1974 #define PCS_SM_NO_LINK_WAIT_C 0x10000000
1976 #define PCS_SM_NO_LINK_NO_IDLE 0x20000000
1985 #define REG_PCS_INTR_STATUS 0x9018
1986 #define PCS_INTR_STATUS_LINK_CHANGE 0x04
1993 #define REG_PCS_DATAPATH_MODE 0x9050
1994 #define PCS_DATAPATH_MODE_MII 0x00
1999 #define PCS_DATAPATH_MODE_SERDES 0x02
2003 #define REG_PCS_SERDES_CTRL 0x9054
2004 #define PCS_SERDES_CTRL_LOOPBACK 0x01
2006 #define PCS_SERDES_CTRL_SYNCD_EN 0x02
2010 #define PCS_SERDES_CTRL_LOCKREF 0x04
2026 #define REG_PCS_SHARED_OUTPUT_SEL 0x9058
2027 #define PCS_SOS_PROM_ADDR_MASK 0x0007
2037 #define REG_PCS_SERDES_STATE 0x905C
2038 #define PCS_SERDES_STATE_MASK 0x03
2044 #define REG_PCS_PACKET_COUNT 0x9060
2045 #define PCS_PACKET_COUNT_TX 0x000007FF
2046 #define PCS_PACKET_COUNT_RX 0x07FF0000
2054 #define REG_EXPANSION_ROM_RUN_START 0x100000
2056 #define REG_EXPANSION_ROM_RUN_END 0x17FFFF
2058 #define REG_SECOND_LOCALBUS_START 0x180000
2060 #define REG_SECOND_LOCALBUS_END 0x1FFFFF
2063 #define REG_ENTROPY_START REG_SECOND_LOCALBUS_START
2064 #define REG_ENTROPY_DATA (REG_ENTROPY_START + 0x00)
2065 #define REG_ENTROPY_STATUS (REG_ENTROPY_START + 0x04)
2066 #define ENTROPY_STATUS_DRDY 0x01
2067 #define ENTROPY_STATUS_BUSY 0x02
2068 #define ENTROPY_STATUS_CIPHER 0x04
2069 #define ENTROPY_STATUS_BYPASS_MASK 0x18
2070 #define REG_ENTROPY_MODE (REG_ENTROPY_START + 0x05)
2071 #define ENTROPY_MODE_KEY_MASK 0x07
2072 #define ENTROPY_MODE_ENCRYPT 0x40
2073 #define REG_ENTROPY_RAND_REG (REG_ENTROPY_START + 0x06)
2074 #define REG_ENTROPY_RESET (REG_ENTROPY_START + 0x07)
2075 #define ENTROPY_RESET_DES_IO 0x01
2076 #define ENTROPY_RESET_STC_MODE 0x02
2077 #define ENTROPY_RESET_KEY_CACHE 0x04
2078 #define ENTROPY_RESET_IV 0x08
2079 #define REG_ENTROPY_IV (REG_ENTROPY_START + 0x08)
2080 #define REG_ENTROPY_KEY0 (REG_ENTROPY_START + 0x10)
2081 #define REG_ENTROPY_KEYN(x) (REG_ENTROPY_KEY0 + 4*(x))
2084 #define PHY_LUCENT_B0 0x00437421
2085 #define LUCENT_MII_REG 0x1F
2087 #define PHY_NS_DP83065 0x20005c78
2088 #define DP83065_MII_MEM 0x16
2089 #define DP83065_MII_REGD 0x1D
2090 #define DP83065_MII_REGE 0x1E
2092 #define PHY_BROADCOM_5411 0x00206071
2093 #define PHY_BROADCOM_B0 0x00206050
2094 #define BROADCOM_MII_REG4 0x14
2095 #define BROADCOM_MII_REG5 0x15
2096 #define BROADCOM_MII_REG7 0x17
2097 #define BROADCOM_MII_REG8 0x18
2099 #define CAS_MII_ANNPTR 0x07
2100 #define CAS_MII_ANNPRR 0x08
2101 #define CAS_MII_1000_CTRL 0x09
2102 #define CAS_MII_1000_STATUS 0x0A
2103 #define CAS_MII_1000_EXTEND 0x0F
2105 #define CAS_BMSR_1000_EXTEND 0x0100
2112 #define CAS_BMCR_SPEED1000 0x0040
2114 #define CAS_ADVERTISE_1000HALF 0x0100
2115 #define CAS_ADVERTISE_1000FULL 0x0200
2116 #define CAS_ADVERTISE_PAUSE 0x0400
2117 #define CAS_ADVERTISE_ASYM_PAUSE 0x0800
2120 #define CAS_LPA_PAUSE CAS_ADVERTISE_PAUSE
2121 #define CAS_LPA_ASYM_PAUSE CAS_ADVERTISE_ASYM_PAUSE
2124 #define CAS_LPA_1000HALF 0x0400
2125 #define CAS_LPA_1000FULL 0x0800
2127 #define CAS_EXTEND_1000XFULL 0x8000
2128 #define CAS_EXTEND_1000XHALF 0x4000
2129 #define CAS_EXTEND_1000TFULL 0x2000
2130 #define CAS_EXTEND_1000THALF 0x1000
2203 #define CAS_PROG_IP46TCP4_PREAMBLE \
2204 { "packet arrival?", 0xffff, 0x0000, OP_NP, 6, S1_VLAN, 0, S1_PCKT, \
2205 CL_REG, 0x3ff, 1, 0x0, 0x0000}, \
2206 { "VLAN?", 0xffff, 0x8100, OP_EQ, 1, S1_CFI, 0, S1_8023, \
2207 IM_CTL, 0x00a, 3, 0x0, 0xffff}, \
2208 { "CFI?", 0x1000, 0x1000, OP_EQ, 0, S1_DROP, 1, S1_8023, \
2209 CL_REG, 0x000, 0, 0x0, 0x0000}, \
2210 { "8023?", 0xffff, 0x0600, OP_LT, 1, S1_LLC, 0, S1_IPV4, \
2211 CL_REG, 0x000, 0, 0x0, 0x0000}, \
2212 { "LLC?", 0xffff, 0xaaaa, OP_EQ, 1, S1_LLCc, 0, S1_CLNP, \
2213 CL_REG, 0x000, 0, 0x0, 0x0000}, \
2214 { "LLCc?", 0xff00, 0x0300, OP_EQ, 2, S1_IPV4, 0, S1_CLNP, \
2215 CL_REG, 0x000, 0, 0x0, 0x0000}, \
2216 { "IPV4?", 0xffff, 0x0800, OP_EQ, 1, S1_IPV4c, 0, S1_IPV6, \
2217 LD_SAP, 0x100, 3, 0x0, 0xffff}, \
2218 { "IPV4 cont?", 0xff00, 0x4500, OP_EQ, 3, S1_IPV4F, 0, S1_CLNP, \
2219 LD_SUM, 0x00a, 1, 0x0, 0x0000}, \
2220 { "IPV4 frag?", 0x3fff, 0x0000, OP_EQ, 1, S1_TCP44, 0, S1_CLNP, \
2221 LD_LEN, 0x03e, 1, 0x0, 0xffff}, \
2222 { "TCP44?", 0x00ff, 0x0006, OP_EQ, 7, S1_TCPSQ, 0, S1_CLNP, \
2223 LD_FID, 0x182, 1, 0x0, 0xffff}, \
2224 { "IPV6?", 0xffff, 0x86dd, OP_EQ, 1, S1_IPV6L, 0, S1_CLNP, \
2225 LD_SUM, 0x015, 1, 0x0, 0x0000}, \
2226 { "IPV6 len", 0xf000, 0x6000, OP_EQ, 0, S1_IPV6c, 0, S1_CLNP, \
2227 IM_R1, 0x128, 1, 0x0, 0xffff}, \
2228 { "IPV6 cont?", 0x0000, 0x0000, OP_EQ, 3, S1_TCP64, 0, S1_CLNP, \
2229 LD_FID, 0x484, 1, 0x0, 0xffff}, \
2230 { "TCP64?", 0xff00, 0x0600, OP_EQ, 18, S1_TCPSQ, 0, S1_CLNP, \
2231 LD_LEN, 0x03f, 1, 0x0, 0xffff}
2233 #ifdef USE_HP_IP46TCP4
2238 0x081, 3, 0x0, 0xffff},
2239 {
"TCP control flags", 0x0000, 0x0000,
OP_EQ, 0,
S1_TCPHL, 0,
2243 {
"TCP length cont", 0x0000, 0x0000,
OP_EQ, 0,
S1_PCKT, 0,
2246 IM_CTL, 0x001, 3, 0x0, 0x0001},
2248 IM_CTL, 0x000, 0, 0x0, 0x0000},
2250 IM_CTL, 0x080, 3, 0x0, 0xffff},
2253 #ifdef HP_IP46TCP4_DEFAULT
2254 #define CAS_HP_FIRMWARE cas_prog_ip46tcp4tab
2262 #ifdef USE_HP_IP46TCP4NOHTTP
2267 0x081, 3, 0x0, 0xffff} ,
2268 {
"TCP control flags", 0xFFFF, 0x8080,
OP_EQ, 0,
S2_HTTP, 0,
2271 LD_R1, 0x205, 3, 0xB, 0xf000},
2273 LD_HDR, 0x0ff, 3, 0x0, 0xffff},
2275 IM_CTL, 0x001, 3, 0x0, 0x0001},
2277 CL_REG, 0x002, 3, 0x0, 0x0000},
2279 IM_CTL, 0x080, 3, 0x0, 0xffff},
2281 IM_CTL, 0x044, 3, 0x0, 0xffff},
2284 #ifdef HP_IP46TCP4NOHTTP_DEFAULT
2285 #define CAS_HP_FIRMWARE cas_prog_ip46tcp4nohttptab
2300 #ifdef USE_HP_IP4FRAG
2303 CL_REG, 0x3ff, 1, 0x0, 0x0000},
2305 IM_CTL, 0x00a, 3, 0x0, 0xffff},
2307 CL_REG, 0x000, 0, 0x0, 0x0000},
2309 CL_REG, 0x000, 0, 0x0, 0x0000},
2311 CL_REG, 0x000, 0, 0x0, 0x0000},
2313 CL_REG, 0x000, 0, 0x0, 0x0000},
2315 LD_SAP, 0x100, 3, 0x0, 0xffff},
2317 LD_SUM, 0x00a, 1, 0x0, 0x0000},
2319 LD_LEN, 0x03e, 3, 0x0, 0xffff},
2321 LD_FID, 0x182, 3, 0x0, 0xffff},
2323 LD_SUM, 0x015, 1, 0x0, 0x0000},
2325 LD_FID, 0x484, 1, 0x0, 0xffff},
2327 LD_LEN, 0x03f, 1, 0x0, 0xffff},
2330 0x081, 3, 0x0, 0xffff},
2331 {
"TCP control flags", 0x0000, 0x0000,
OP_EQ, 0,
S3_TCPHL, 0,
2334 LD_R1, 0x205, 3, 0xB, 0xf000},
2336 LD_HDR, 0x0ff, 3, 0x0, 0xffff},
2338 LD_FID, 0x103, 3, 0x0, 0xffff},
2340 LD_SEQ, 0x040, 1, 0xD, 0xfff8},
2342 IM_CTL, 0x001, 3, 0x0, 0x0001},
2345 #ifdef HP_IP4FRAG_DEFAULT
2346 #define CAS_HP_FIRMWARE cas_prog_ip4fragtab
2353 #ifdef USE_HP_IP46TCP4BATCH
2358 0x081, 3, 0x0, 0xffff},
2359 {
"TCP control flags", 0x0000, 0x0000,
OP_EQ, 0,
S1_TCPHL, 0,
2363 {
"TCP length cont", 0x0000, 0x0000,
OP_EQ, 0,
S1_PCKT, 0,
2366 IM_CTL, 0x001, 3, 0x0, 0x0001},
2371 #ifdef HP_IP46TCP4BATCH_DEFAULT
2372 #define CAS_HP_FIRMWARE cas_prog_ip46tcp4batchtab
2380 #ifdef USE_HP_WORKAROUND
2382 {
"packet arrival?", 0xffff, 0x0000,
OP_NP, 6,
S1_VLAN, 0,
2385 IM_CTL, 0x04a, 3, 0x0, 0xffff},
2387 CL_REG, 0x000, 0, 0x0, 0x0000},
2389 CL_REG, 0x000, 0, 0x0, 0x0000},
2391 CL_REG, 0x000, 0, 0x0, 0x0000},
2393 CL_REG, 0x000, 0, 0x0, 0x0000},
2395 IM_SAP, 0x6AE, 3, 0x0, 0xffff},
2397 LD_SUM, 0x00a, 1, 0x0, 0x0000},
2399 LD_LEN, 0x03e, 1, 0x0, 0xffff},
2401 LD_FID, 0x182, 3, 0x0, 0xffff},
2403 LD_SUM, 0x015, 1, 0x0, 0x0000},
2405 IM_R1, 0x128, 1, 0x0, 0xffff},
2407 LD_FID, 0x484, 1, 0x0, 0xffff},
2409 LD_LEN, 0x03f, 1, 0x0, 0xffff},
2412 0x081, 3, 0x0, 0xffff},
2413 {
"TCP control flags", 0x0000, 0x0000,
OP_EQ, 0,
S1_TCPHL, 0,
2416 LD_R1, 0x205, 3, 0xB, 0xf000},
2417 {
"TCP length cont", 0x0000, 0x0000,
OP_EQ, 0,
S1_PCKT, 0,
2420 IM_SAP, 0x6AE, 3, 0x0, 0xffff} ,
2422 IM_CTL, 0x001, 3, 0x0, 0x0001},
2425 #ifdef HP_WORKAROUND_DEFAULT
2426 #define CAS_HP_FIRMWARE cas_prog_workaroundtab
2430 #ifdef USE_HP_ENCRYPT
2432 {
"packet arrival?", 0xffff, 0x0000,
OP_NP, 6,
S1_VLAN, 0,
2435 IM_CTL, 0x00a, 3, 0x0, 0xffff},
2443 CL_REG, 0x000, 0, 0x0, 0x0000},
2445 CL_REG, 0x000, 0, 0x0, 0x0000},
2447 CL_REG, 0x000, 0, 0x0, 0x0000},
2449 CL_REG, 0x000, 0, 0x0, 0x0000},
2451 LD_SAP, 0x100, 3, 0x0, 0xffff},
2453 LD_SUM, 0x00a, 1, 0x0, 0x0000},
2455 LD_LEN, 0x03e, 1, 0x0, 0xffff},
2457 LD_FID, 0x182, 1, 0x0, 0xffff},
2459 LD_SUM, 0x015, 1, 0x0, 0x0000},
2461 IM_R1, 0x128, 1, 0x0, 0xffff},
2463 LD_FID, 0x484, 1, 0x0, 0xffff},
2469 0x03f, 1, 0x0, 0xffff},
2472 0x081, 3, 0x0, 0xffff},
2473 {
"TCP control flags", 0xFFFF, 0x8080,
OP_EQ, 0,
S2_HTTP, 0,
2476 LD_R1, 0x205, 3, 0xB, 0xf000} ,
2477 {
"TCP length cont", 0x0000, 0x0000,
OP_EQ, 0,
S1_PCKT, 0,
2480 IM_CTL, 0x001, 3, 0x0, 0x0001},
2482 CL_REG, 0x002, 3, 0x0, 0x0000},
2484 IM_CTL, 0x080, 3, 0x0, 0xffff},
2486 IM_CTL, 0x044, 3, 0x0, 0xffff},
2487 {
"IPV4 ESP encrypted?",
2489 0x021, 1, 0x0, 0xffff},
2490 {
"IPV4 AH encrypted?",
2492 0x021, 1, 0x0, 0xffff},
2493 {
"IPV6 ESP encrypted?",
2498 0x021, 1, 0x0, 0xffff},
2499 {
"IPV6 AH encrypted?",
2504 0x021, 1, 0x0, 0xffff},
2507 #ifdef HP_ENCRYPT_DEFAULT
2508 #define CAS_HP_FIRMWARE cas_prog_encryptiontab
2513 #ifdef HP_NULL_DEFAULT
2514 #define CAS_HP_FIRMWARE cas_prog_null
2518 #define CAS_PHY_UNKNOWN 0x00
2519 #define CAS_PHY_SERDES 0x01
2520 #define CAS_PHY_MII_MDIO0 0x02
2521 #define CAS_PHY_MII_MDIO1 0x04
2522 #define CAS_PHY_MII(x) ((x) & (CAS_PHY_MII_MDIO0 | CAS_PHY_MII_MDIO1))
2535 #define DESC_RING_I_TO_S(x) (32*(1 << (x)))
2536 #define COMP_RING_I_TO_S(x) (128*(1 << (x)))
2537 #define TX_DESC_RING_INDEX 4
2538 #define RX_DESC_RING_INDEX 4
2539 #define RX_COMP_RING_INDEX 4
2541 #if (TX_DESC_RING_INDEX > 8) || (TX_DESC_RING_INDEX < 0)
2542 #error TX_DESC_RING_INDEX must be between 0 and 8
2545 #if (RX_DESC_RING_INDEX > 8) || (RX_DESC_RING_INDEX < 0)
2546 #error RX_DESC_RING_INDEX must be between 0 and 8
2549 #if (RX_COMP_RING_INDEX > 8) || (RX_COMP_RING_INDEX < 0)
2550 #error RX_COMP_RING_INDEX must be between 0 and 8
2553 #define N_TX_RINGS MAX_TX_RINGS
2554 #define N_TX_RINGS_MASK MAX_TX_RINGS_MASK
2555 #define N_RX_DESC_RINGS MAX_RX_DESC_RINGS
2556 #define N_RX_COMP_RINGS 0x1
2559 #define N_RX_FLOWS 64
2561 #define TX_DESC_RING_SIZE DESC_RING_I_TO_S(TX_DESC_RING_INDEX)
2562 #define RX_DESC_RING_SIZE DESC_RING_I_TO_S(RX_DESC_RING_INDEX)
2563 #define RX_COMP_RING_SIZE COMP_RING_I_TO_S(RX_COMP_RING_INDEX)
2564 #define TX_DESC_RINGN_INDEX(x) TX_DESC_RING_INDEX
2565 #define RX_DESC_RINGN_INDEX(x) RX_DESC_RING_INDEX
2566 #define RX_COMP_RINGN_INDEX(x) RX_COMP_RING_INDEX
2567 #define TX_DESC_RINGN_SIZE(x) TX_DESC_RING_SIZE
2568 #define RX_DESC_RINGN_SIZE(x) RX_DESC_RING_SIZE
2569 #define RX_COMP_RINGN_SIZE(x) RX_COMP_RING_SIZE
2572 #define CAS_BASE(x, y) (((y) << (x ## _SHIFT)) & (x ## _MASK))
2573 #define CAS_VAL(x, y) (((y) & (x ## _MASK)) >> (x ## _SHIFT))
2574 #define CAS_TX_RINGN_BASE(y) ((TX_DESC_RINGN_INDEX(y) << \
2575 TX_CFG_DESC_RINGN_SHIFT(y)) & \
2576 TX_CFG_DESC_RINGN_MASK(y))
2579 #define CAS_MIN_PAGE_SHIFT 11
2580 #define CAS_JUMBO_PAGE_SHIFT 13
2581 #define CAS_MAX_PAGE_SHIFT 14
2583 #define TX_DESC_BUFLEN_MASK 0x0000000000003FFFULL
2585 #define TX_DESC_BUFLEN_SHIFT 0
2586 #define TX_DESC_CSUM_START_MASK 0x00000000001F8000ULL
2592 #define TX_DESC_CSUM_START_SHIFT 15
2593 #define TX_DESC_CSUM_STUFF_MASK 0x000000001FE00000ULL
2598 #define TX_DESC_CSUM_STUFF_SHIFT 21
2599 #define TX_DESC_CSUM_EN 0x0000000020000000ULL
2600 #define TX_DESC_EOF 0x0000000040000000ULL
2601 #define TX_DESC_SOF 0x0000000080000000ULL
2602 #define TX_DESC_INTME 0x0000000100000000ULL
2603 #define TX_DESC_NO_CRC 0x0000000200000000ULL
2623 #define RX_COMP1_DATA_SIZE_MASK 0x0000000007FFE000ULL
2624 #define RX_COMP1_DATA_SIZE_SHIFT 13
2625 #define RX_COMP1_DATA_OFF_MASK 0x000001FFF8000000ULL
2626 #define RX_COMP1_DATA_OFF_SHIFT 27
2627 #define RX_COMP1_DATA_INDEX_MASK 0x007FFE0000000000ULL
2628 #define RX_COMP1_DATA_INDEX_SHIFT 41
2629 #define RX_COMP1_SKIP_MASK 0x0180000000000000ULL
2630 #define RX_COMP1_SKIP_SHIFT 55
2631 #define RX_COMP1_RELEASE_NEXT 0x0200000000000000ULL
2632 #define RX_COMP1_SPLIT_PKT 0x0400000000000000ULL
2633 #define RX_COMP1_RELEASE_FLOW 0x0800000000000000ULL
2634 #define RX_COMP1_RELEASE_DATA 0x1000000000000000ULL
2635 #define RX_COMP1_RELEASE_HDR 0x2000000000000000ULL
2636 #define RX_COMP1_TYPE_MASK 0xC000000000000000ULL
2637 #define RX_COMP1_TYPE_SHIFT 62
2640 #define RX_COMP2_NEXT_INDEX_MASK 0x00000007FFE00000ULL
2641 #define RX_COMP2_NEXT_INDEX_SHIFT 21
2642 #define RX_COMP2_HDR_SIZE_MASK 0x00000FF800000000ULL
2643 #define RX_COMP2_HDR_SIZE_SHIFT 35
2644 #define RX_COMP2_HDR_OFF_MASK 0x0003F00000000000ULL
2645 #define RX_COMP2_HDR_OFF_SHIFT 44
2646 #define RX_COMP2_HDR_INDEX_MASK 0xFFFC000000000000ULL
2647 #define RX_COMP2_HDR_INDEX_SHIFT 50
2650 #define RX_COMP3_SMALL_PKT 0x0000000000000001ULL
2651 #define RX_COMP3_JUMBO_PKT 0x0000000000000002ULL
2652 #define RX_COMP3_JUMBO_HDR_SPLIT_EN 0x0000000000000004ULL
2653 #define RX_COMP3_CSUM_START_MASK 0x000000000007F000ULL
2654 #define RX_COMP3_CSUM_START_SHIFT 12
2655 #define RX_COMP3_FLOWID_MASK 0x0000000001F80000ULL
2656 #define RX_COMP3_FLOWID_SHIFT 19
2657 #define RX_COMP3_OPCODE_MASK 0x000000000E000000ULL
2658 #define RX_COMP3_OPCODE_SHIFT 25
2659 #define RX_COMP3_FORCE_FLAG 0x0000000010000000ULL
2660 #define RX_COMP3_NO_ASSIST 0x0000000020000000ULL
2661 #define RX_COMP3_LOAD_BAL_MASK 0x000001F800000000ULL
2662 #define RX_COMP3_LOAD_BAL_SHIFT 35
2663 #define RX_PLUS_COMP3_ENC_PKT 0x0000020000000000ULL
2664 #define RX_COMP3_L3_HEAD_OFF_MASK 0x0000FE0000000000ULL
2665 #define RX_COMP3_L3_HEAD_OFF_SHIFT 41
2666 #define RX_PLUS_COMP_L3_HEAD_OFF_MASK 0x0000FC0000000000ULL
2667 #define RX_PLUS_COMP_L3_HEAD_OFF_SHIFT 42
2668 #define RX_COMP3_SAP_MASK 0xFFFF000000000000ULL
2669 #define RX_COMP3_SAP_SHIFT 48
2672 #define RX_COMP4_TCP_CSUM_MASK 0x000000000000FFFFULL
2673 #define RX_COMP4_TCP_CSUM_SHIFT 0
2674 #define RX_COMP4_PKT_LEN_MASK 0x000000003FFF0000ULL
2675 #define RX_COMP4_PKT_LEN_SHIFT 16
2676 #define RX_COMP4_PERFECT_MATCH_MASK 0x00000003C0000000ULL
2677 #define RX_COMP4_PERFECT_MATCH_SHIFT 30
2678 #define RX_COMP4_ZERO 0x0000080000000000ULL
2679 #define RX_COMP4_HASH_VAL_MASK 0x0FFFF00000000000ULL
2680 #define RX_COMP4_HASH_VAL_SHIFT 44
2681 #define RX_COMP4_HASH_PASS 0x1000000000000000ULL
2682 #define RX_COMP4_BAD 0x4000000000000000ULL
2683 #define RX_COMP4_LEN_MISMATCH 0x8000000000000000ULL
2689 #define RX_INDEX_NUM_MASK 0x0000000000000FFFULL
2690 #define RX_INDEX_NUM_SHIFT 0
2691 #define RX_INDEX_RING_MASK 0x0000000000001000ULL
2692 #define RX_INDEX_RING_SHIFT 12
2693 #define RX_INDEX_RELEASE 0x0000000000002000ULL
2730 #define INIT_BLOCK_TX (TX_DESC_RING_SIZE)
2731 #define INIT_BLOCK_RX_DESC (RX_DESC_RING_SIZE)
2732 #define INIT_BLOCK_RX_COMP (RX_COMP_RING_SIZE)
2745 #define TX_TINY_BUF_LEN 0x100
2746 #define TX_TINY_BUF_BLOCK ((INIT_BLOCK_TX + 1)*TX_TINY_BUF_LEN)
2803 #define CAS_FLAG_1000MB_CAP 0x00000001
2804 #define CAS_FLAG_REG_PLUS 0x00000002
2805 #define CAS_FLAG_TARGET_ABORT 0x00000004
2806 #define CAS_FLAG_SATURN 0x00000008
2807 #define CAS_FLAG_RXD_POST_MASK 0x000000F0
2808 #define CAS_FLAG_RXD_POST_SHIFT 4
2809 #define CAS_FLAG_RXD_POST(x) ((1 << (CAS_FLAG_RXD_POST_SHIFT + (x))) & \
2810 CAS_FLAG_RXD_POST_MASK)
2811 #define CAS_FLAG_ENTROPY_DEV 0x00000100
2812 #define CAS_FLAG_NO_HW_CSUM 0x00000200
2848 #define LINK_TRANSITION_UNKNOWN 0
2849 #define LINK_TRANSITION_ON_FAILURE 1
2850 #define LINK_TRANSITION_STILL_FAILED 2
2851 #define LINK_TRANSITION_LINK_UP 3
2852 #define LINK_TRANSITION_LINK_CONFIG 4
2853 #define LINK_TRANSITION_LINK_DOWN 5
2854 #define LINK_TRANSITION_REQUESTED_RESET 6
2861 #define CAS_PREF_CACHELINE_SIZE 0x20
2871 #if defined(CONFIG_OF)
2881 #define TX_DESC_NEXT(r, x) (((x) + 1) & (TX_DESC_RINGN_SIZE(r) - 1))
2882 #define RX_DESC_ENTRY(r, x) ((x) & (RX_DESC_RINGN_SIZE(r) - 1))
2883 #define RX_COMP_ENTRY(r, x) ((x) & (RX_COMP_RINGN_SIZE(r) - 1))
2885 #define TX_BUFF_COUNT(r, x, y) ((x) <= (y) ? ((y) - (x)) : \
2886 (TX_DESC_RINGN_SIZE(r) - (x) + (y)))
2888 #define TX_BUFFS_AVAIL(cp, i) ((cp)->tx_old[(i)] <= (cp)->tx_new[(i)] ? \
2889 (cp)->tx_old[(i)] + (TX_DESC_RINGN_SIZE(i) - 1) - (cp)->tx_new[(i)] : \
2890 (cp)->tx_old[(i)] - (cp)->tx_new[(i)] - 1)
2892 #define CAS_ALIGN(addr, align) \
2893 (((unsigned long) (addr) + ((align) - 1UL)) & ~((align) - 1))
2895 #define RX_FIFO_SIZE 16384
2896 #define EXPANSION_ROM_SIZE 65536
2898 #define CAS_MC_EXACT_MATCH_SIZE 15
2899 #define CAS_MC_HASH_SIZE 256
2900 #define CAS_MC_HASH_MAX (CAS_MC_EXACT_MATCH_SIZE + \
2903 #define TX_TARGET_ABORT_LEN 0x20
2904 #define RX_SWIVEL_OFF_VAL 0x2
2905 #define RX_AE_FREEN_VAL(x) (RX_DESC_RINGN_SIZE(x) >> 1)
2906 #define RX_AE_COMP_VAL (RX_COMP_RING_SIZE >> 1)
2907 #define RX_BLANK_INTR_PKT_VAL 0x05
2908 #define RX_BLANK_INTR_TIME_VAL 0x0F
2909 #define HP_TCP_THRESH_VAL 1530
2911 #define RX_SPARE_COUNT (RX_DESC_RING_SIZE >> 1)
2912 #define RX_SPARE_RECOVER_VAL (RX_SPARE_COUNT >> 2)