| 1 | // ========== Copyright Header Begin ========================================== |
| 2 | // |
| 3 | // OpenSPARC T2 Processor File: pcg_defines.vri |
| 4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved |
| 5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
| 6 | // |
| 7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 8 | // |
| 9 | // This program is free software; you can redistribute it and/or modify |
| 10 | // it under the terms of the GNU General Public License as published by |
| 11 | // the Free Software Foundation; version 2 of the License. |
| 12 | // |
| 13 | // This program is distributed in the hope that it will be useful, |
| 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | // GNU General Public License for more details. |
| 17 | // |
| 18 | // You should have received a copy of the GNU General Public License |
| 19 | // along with this program; if not, write to the Free Software |
| 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | // |
| 22 | // For the avoidance of doubt, and except that if any non-GPL license |
| 23 | // choice is available it will apply instead, Sun elects to use only |
| 24 | // the General Public License version 2 (GPLv2) at this time for any |
| 25 | // software where a choice of GPL license versions is made |
| 26 | // available with the language indicating that GPLv2 or any later version |
| 27 | // may be used, or where a choice of which version of the GPL is applied is |
| 28 | // otherwise unspecified. |
| 29 | // |
| 30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 31 | // CA 95054 USA or visit www.sun.com if you need additional information or |
| 32 | // have any questions. |
| 33 | // |
| 34 | // ========== Copyright Header End ============================================ |
| 35 | #define INTER_FEDX (my_port==17 | my_port==18) |
| 36 | #define NONE 0 |
| 37 | |
| 38 | // Debugging flags |
| 39 | //#define debug_gmii 0 |
| 40 | //#define debug_mii 0 |
| 41 | //#define debug_fa 1 |
| 42 | //#define debug_mii_rx 0 |
| 43 | //#define debug_gmii_rx 0 |
| 44 | //#define debug_rx 0 |
| 45 | //#define debug_dg 0 |
| 46 | //#define debug_db_in 0 |
| 47 | //#define debug_db_out 0 |
| 48 | //#define debug_checker 0 |
| 49 | |
| 50 | |
| 51 | // Header Predefined values |
| 52 | #define H_UNDEF 8'h00 // Undefined header bytes are set to this value |
| 53 | |
| 54 | #define XGMII_SOP 8'hFB |
| 55 | #define XGMII_PREAMBLE 8'h55 |
| 56 | #define XGMII_SOF 8'hD5 |
| 57 | #define XGMII_EOP 8'hFD |
| 58 | #define XGMII_EXTEND 8'h0E |
| 59 | #define XGMII_IDLE 8'h07 |
| 60 | #define GMII_PREAMBLE 8'h55 |
| 61 | #define GMII_SOF 8'hD5 |
| 62 | #define GMII_EXTEND 8'h0E |
| 63 | #define MII_PREAMBLE 8'h55 |
| 64 | #define MII_SOF 8'hD5 |
| 65 | #define MII_EXTEND 8'h0E |
| 66 | #define MII_IP_GAP 8'd12 |
| 67 | #define GMII_IP_GAP 8'd12 |
| 68 | #define XGMII_IP_GAP 8'd12 |
| 69 | |
| 70 | |
| 71 | // L2 Specific defines |
| 72 | #define CNTL_FRAME 16'h88_08 |
| 73 | #define FC_PAUSE_OPCODE 16'h00_01 |
| 74 | #define ARP_FRAME 16'h08_06 |
| 75 | #define RARP_FRAME 16'h80_35 |
| 76 | |
| 77 | #define TPID_8021Q 16'h8100 |
| 78 | #define LLC_SNAP 24'haaaa03 |
| 79 | #define LLC_SNAP_TYPE 16'h0000 |
| 80 | |
| 81 | // L3: |
| 82 | #define AH_PROTO 8'h33 |
| 83 | #define ESP_PROTO 8'h32 |
| 84 | #define IP_V4_PROTO 8'h04 |
| 85 | #define IP_V6_PROTO 8'h29 |
| 86 | |
| 87 | |
| 88 | // L4 Specific Defines |
| 89 | #define UDP_PROTO 8'h11 |
| 90 | #define TCP_PROTO 8'h06 |
| 91 | |
| 92 | |
| 93 | |
| 94 | // Port Type |
| 95 | #define PTYPE_ET 0 |
| 96 | #define PTYPE_FE 1 |
| 97 | #define PTYPE_GE 2 |
| 98 | #define PTYPE_IGE 3 |
| 99 | |
| 100 | |
| 101 | // New Packet gen ERROR DEFINES |
| 102 | |
| 103 | #define PG_CHKSUM_ERR 1 |
| 104 | #define PG_CHKSUM_USER_DEF 2 |
| 105 | #define PG_CRC_ERR 4 |
| 106 | #define PG_TYPE_LEN_ERR 8 |
| 107 | #define PG_L4_PROTO_USER_MODE 16 |
| 108 | #define PG_TYPE_LEN_USER_MODE 32 |
| 109 | |
| 110 | |
| 111 | |
| 112 | // Data Types |
| 113 | #define DAT_RAND 0 |
| 114 | #define DAT_SEQ 1 |
| 115 | #define DAT_W1 2 |
| 116 | #define DAT_W0 3 |
| 117 | #define DAT_FC_PAUSE 4 |
| 118 | #define DAT_FC_PAUSE_ERR 5 |
| 119 | #define DAT_ALL0 6 |
| 120 | #define DAT_ALL1 7 |
| 121 | #define DAT_LEN_EXACT 32'h0001_0000 |
| 122 | #define DAT_TYPE_MASK 32'h0000_ffff |
| 123 | |
| 124 | // Class Functions |
| 125 | #define CLF_SRC 0 |
| 126 | #define CLF_DST 1 |
| 127 | #define CLF_OR 2 |
| 128 | #define CLF_AND 3 |
| 129 | |
| 130 | |
| 131 | // Class Type Definitions |
| 132 | |
| 133 | // IPv4 defines |
| 134 | #define CL_ARP 0 |
| 135 | #define CL_RARP 1 |
| 136 | #define CL_RSVP 2 |
| 137 | #define CL_IGMP 3 |
| 138 | #define CL_ICMP 4 |
| 139 | #define CL_PIM 5 |
| 140 | #define CL_GRE 6 |
| 141 | #define CL_IP 7 |
| 142 | #define CL_IP_OPT 8 |
| 143 | #define CL_IP_FRAG 9 |
| 144 | #define CL_IP_ROUTE 10 |
| 145 | #define CL_IP_SEC_AH 11 |
| 146 | #define CL_IP_SEC_ESP 12 |
| 147 | #define CL_UDP 13 |
| 148 | #define CL_UDP_FRAG 14 |
| 149 | #define CL_UDP_OPT 15 |
| 150 | #define CL_TCP 16 |
| 151 | #define CL_TCP_FRAG 17 |
| 152 | #define CL_TCP_OPT 18 |
| 153 | #define CL_SCTP 19 |
| 154 | #define CL_SCTP_OPT 20 |
| 155 | #define CL_SCTP_FRAG 21 |
| 156 | |
| 157 | #define DELTA CL_SCTP_FRAG+1 |
| 158 | |
| 159 | // IPv6 defines |
| 160 | #define CL_ARP_IP_V6 DELTA + 0 |
| 161 | #define CL_RARP_IP_V6 DELTA + 1 |
| 162 | #define CL_RSVP_IP_V6 DELTA + 2 |
| 163 | #define CL_IGMP_IP_V6 DELTA + 3 |
| 164 | #define CL_ICMP_IP_V6 DELTA + 4 |
| 165 | #define CL_PIM_IP_V6 DELTA + 5 |
| 166 | #define CL_GRE_IP_V6 DELTA + 6 |
| 167 | #define CL_IP_V6 DELTA + 7 |
| 168 | #define CL_IP_V6_OPT DELTA + 8 |
| 169 | #define CL_IP_V6_FRAG DELTA + 9 |
| 170 | #define CL_IP_V6_ROUTE DELTA + 10 |
| 171 | #define CL_IP_V6_SEC_AH DELTA + 11 |
| 172 | #define CL_IP_V6_SEC_ESP DELTA + 12 |
| 173 | #define CL_UDP_IP_V6 DELTA + 13 |
| 174 | #define CL_UDP_FRAG_IP_V6 DELTA + 14 |
| 175 | #define CL_UDP_OPT_IP_V6 DELTA + 15 |
| 176 | #define CL_TCP_IP_V6 DELTA + 16 |
| 177 | #define CL_TCP_FRAG_IP_V6 DELTA + 17 |
| 178 | #define CL_TCP_OPT_IP_V6 DELTA + 18 |
| 179 | |
| 180 | #define CL_IP_TUN_V4_V4 DELTA + 19 |
| 181 | #define CL_IP_TUN_V4_V6 DELTA + 20 |
| 182 | #define CL_IP_TUN_V6_V4 DELTA + 21 |
| 183 | #define CL_IP_TUN_V6_V6 DELTA + 22 |
| 184 | |
| 185 | #define CL_SCTP_IP_V6 DELTA + 23 |
| 186 | |
| 187 | #define CL_IP_V6_LAST_VALUE CL_SCTP_IP_V6 |
| 188 | |
| 189 | // User defined classes |
| 190 | #define CL_USER1 CL_IP_V6_LAST_VALUE + 1 |
| 191 | #define CL_USER2 CL_IP_V6_LAST_VALUE + 2 |
| 192 | #define CL_USER3 CL_IP_V6_LAST_VALUE + 3 |
| 193 | #define CL_USER4 CL_IP_V6_LAST_VALUE + 4 |
| 194 | #define CL_USER5 CL_IP_V6_LAST_VALUE + 5 |
| 195 | #define CL_USER6 CL_IP_V6_LAST_VALUE + 6 |
| 196 | #define CL_USER7 CL_IP_V6_LAST_VALUE + 7 |
| 197 | #define CL_USER8 CL_IP_V6_LAST_VALUE + 8 |
| 198 | #define CL_USER9 CL_IP_V6_LAST_VALUE + 9 |
| 199 | #define CL_USER10 CL_IP_V6_LAST_VALUE + 10 |
| 200 | #define CL_USER11 CL_IP_V6_LAST_VALUE + 11 |
| 201 | #define CL_USER12 CL_IP_V6_LAST_VALUE + 12 |
| 202 | #define CL_USER13 CL_IP_V6_LAST_VALUE + 13 |
| 203 | #define CL_USER14 CL_IP_V6_LAST_VALUE + 14 |
| 204 | #define CL_USER15 CL_IP_V6_LAST_VALUE + 15 |
| 205 | #define CL_USER16 CL_IP_V6_LAST_VALUE + 16 |
| 206 | #define CL_USER17 CL_IP_V6_LAST_VALUE + 17 |
| 207 | #define CL_USER18 CL_IP_V6_LAST_VALUE + 18 |
| 208 | #define CL_USER19 CL_IP_V6_LAST_VALUE + 19 |
| 209 | #define CL_USER20 CL_IP_V6_LAST_VALUE + 20 |
| 210 | |
| 211 | |
| 212 | #define CL_L2_RUNT 200 |
| 213 | #define CL_L2 201 |
| 214 | |
| 215 | // Node DB parameters |
| 216 | #define L2 0 |
| 217 | #define L2T 1 |
| 218 | #define L3 2 |
| 219 | #define L3T 3 |
| 220 | #define L3L 4 |
| 221 | #define L3LT 5 |
| 222 | #define L3TL 5 |
| 223 | |
| 224 | // |
| 225 | // Options |
| 226 | // |
| 227 | #define O_CD_ERR 64'h0000_0000_0000_0001 |
| 228 | #define O_PREAMB_ERR 64'h0000_0000_0000_0002 |
| 229 | #define O_SFD_ERR 64'h0000_0000_0000_0004 |
| 230 | |
| 231 | #define O_CRC_ERR 64'h0000_0000_0000_0010 |
| 232 | #define O_FRM_LEN_ERR1 64'h0000_0000_0000_0020 |
| 233 | #define O_FRM_LEN_ERR2 64'h0000_0000_0000_0040 |
| 234 | |
| 235 | #define O_NIBBLE_ERR 64'h0000_0000_0001_0000 |
| 236 | #define O_ORDER_START 64'h0000_0000_0002_0000 |
| 237 | #define O_ORDER_CONT 64'h0000_0000_0004_0000 |
| 238 | #define O_ORDER_END 64'h0000_0000_0008_0000 |
| 239 | |
| 240 | #define O_FAKE_OUT 64'h0000_0000_0010_0000 |
| 241 | #define O_WAIT_SEND 64'h0000_0000_0020_0000 |
| 242 | #define O_USE_MAC_DA 64'h0000_0000_0040_0000 |
| 243 | #define O_USE_FMAC_DA 64'h0000_0000_0080_0000 |
| 244 | |
| 245 | #define O_NO_IP_GAP_FIX 64'h0000_0000_0100_0000 |
| 246 | #define O_CUSTOM_IP_GAP 64'h0000_0000_0200_0000 |
| 247 | #define O_IF_CRC_ERR 64'h0000_0000_0400_0000 |
| 248 | #define O_NO_IF_PKT 64'h0000_0000_0800_0000 |
| 249 | #define O_IF_PKT 64'h0000_0000_1000_0000 |
| 250 | |
| 251 | #define O_NO_OUT_TOKEN 64'h0000_0000_2000_0000 |
| 252 | #define O_IM_DO_NOT_CHECK \ |
| 253 | 64'h0000_0000_4000_0000 |
| 254 | #define O_PC_EXP_TXERR 64'h0000_0000_8000_0000 |
| 255 | #define O_PC_DO_NOT_CHECK \ |
| 256 | 64'h0000_0001_0000_0000 |
| 257 | #define O_RX_ERR 64'h0000_0002_0000_0000 |
| 258 | #define O_FC_TYPE_ERR 64'h0000_0004_0000_0000 |
| 259 | #define O_WAIT_SEND_FAKE \ |
| 260 | 64'h0000_0008_0000_0000 |
| 261 | #define O_CUSTOM_LS 64'h0000_0010_0000_0000 |
| 262 | #define O_TX_COL 64'h0000_0020_0000_0000 |
| 263 | #define O_RX_COL 64'h0000_0040_0000_0000 |
| 264 | |
| 265 | #define O_TCPCKSUM_ERR 64'h0000_0080_0000_0000 |
| 266 | |
| 267 | // |
| 268 | // Configuration Registers |
| 269 | // |
| 270 | #define CFG_PRAMB_CNT 0 |
| 271 | #define CFG_SFD_TOKEN 1 |
| 272 | #define CFG_CRC_MASK 2 |
| 273 | #define CFG_FRM_LEN 3 |
| 274 | #define CFG_IP_GAP 4 |
| 275 | #define CFG_CUST_LS 5 |
| 276 | #define CFG_UDP_LEN 6 |
| 277 | #define CFG_UDP_CSM 7 |
| 278 | #define CFG_TCP_SEQ 8 |
| 279 | #define CFG_TCP_ACK 9 |
| 280 | #define CFG_TCP_LEN 10 |
| 281 | #define CFG_TCP_FLAG 11 |
| 282 | #define CFG_TCP_WIN 12 |
| 283 | #define CFG_TCP_CSM 13 |
| 284 | #define CFG_TCP_URG 14 |
| 285 | #define CFG_COL_DEL 15 |
| 286 | #define CFG_COL_LEN 16 |
| 287 | #define CFG_TCPCKSUM_MASK 17 |
| 288 | #define CFG_LAST_ENTRY 18 |
| 289 | // |
| 290 | // To be used by output of pktgen |
| 291 | #define SIZE_OF_PKT_FIELDS 8 |
| 292 | #define L2_PAYLOAD_LENGTH 0 |
| 293 | #define L3_PAYLOAD_LENGTH 1 |
| 294 | #define L4_PAYLOAD_LENGTH 2 |
| 295 | #define L2_HDR_LENGTH 3 |
| 296 | #define L3_HDR_LENGTH 4 |
| 297 | #define L4_HDR_LENGTH 5 |
| 298 | |