1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2010 Emulex. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _EMLXS_HW_H 28 #define _EMLXS_HW_H 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 #define MAX_VPORTS 256 /* Max virtual ports per HBA */ 35 /* (includes physical port) */ 36 #define MAX_VPORTS_LIMITED 101 37 38 #define FC_MAX_TRANSFER 0x40000 /* Max transfer size per */ 39 /* operation */ 40 41 #define MAX_RINGS_AVAILABLE 4 /* # rings available */ 42 #define MAX_RINGS 4 /* Max # rings used */ 43 44 #define PCB_SIZE 128 45 46 #define SLIM_IOCB_CMD_R0_ENTRIES 128 /* SLI FCP cmd ring entries */ 47 #define SLIM_IOCB_RSP_R0_ENTRIES 128 /* SLI FCP rsp ring entries */ 48 #define SLIM_IOCB_CMD_R1_ENTRIES 128 /* SLI IP cmd ring entries */ 49 #define SLIM_IOCB_RSP_R1_ENTRIES 128 /* SLI IP rsp ring entries */ 50 #define SLIM_IOCB_CMD_R2_ENTRIES 128 /* SLI ELS cmd ring entries */ 51 #define SLIM_IOCB_RSP_R2_ENTRIES 128 /* SLI ELS rspe ring entries */ 52 #define SLIM_IOCB_CMD_R3_ENTRIES 128 /* SLI CT cmd ring entries */ 53 #define SLIM_IOCB_RSP_R3_ENTRIES 128 /* SLI CT rsp ring entries */ 54 55 /* 56 * Total: 184 Cmd's + 184 Rsp's = 368 57 * Command and response entry counts are not required to be equal 58 */ 59 60 #define SLIM_IOCB_CMD_ENTRIES (SLIM_IOCB_CMD_R0_ENTRIES + \ 61 SLIM_IOCB_CMD_R1_ENTRIES + \ 62 SLIM_IOCB_CMD_R2_ENTRIES + \ 63 SLIM_IOCB_CMD_R3_ENTRIES) 64 65 #define SLIM_IOCB_RSP_ENTRIES (SLIM_IOCB_RSP_R0_ENTRIES + \ 66 SLIM_IOCB_RSP_R1_ENTRIES + \ 67 SLIM_IOCB_RSP_R2_ENTRIES + \ 68 SLIM_IOCB_RSP_R3_ENTRIES) 69 70 #define SLIM_IOCB_ENTRIES (SLIM_IOCB_CMD_ENTRIES + \ 71 SLIM_IOCB_RSP_ENTRIES) 72 73 74 /* SLI1 Definitions */ 75 #define SLI_SLIM1_SIZE 4096 /* Fixed size memory */ 76 77 78 /* SLI2 Definitions */ 79 #define SLI2_IOCB_CMD_SIZE 32 80 #define SLI2_IOCB_RSP_SIZE 32 81 #define SLI2_IOCB_MAX_SIZE ((SLI2_IOCB_CMD_SIZE * \ 82 SLIM_IOCB_CMD_ENTRIES) + \ 83 (SLI2_IOCB_RSP_SIZE * \ 84 SLIM_IOCB_RSP_ENTRIES)) 85 #define SLI2_SLIM2_SIZE (MBOX_SIZE + MBOX_EXTENSION_SIZE + \ 86 PCB_SIZE + SLI2_IOCB_MAX_SIZE) 87 88 89 /* SLI3 Definitions */ 90 #define SLI3_MAX_BDE 7 91 #define SLI3_IOCB_CMD_SIZE 128 92 #define SLI3_IOCB_RSP_SIZE 64 93 #define SLI3_IOCB_MAX_SIZE ((SLI3_IOCB_CMD_SIZE * \ 94 SLIM_IOCB_CMD_ENTRIES) + \ 95 (SLI3_IOCB_RSP_SIZE * \ 96 SLIM_IOCB_RSP_ENTRIES)) 97 #define SLI3_SLIM2_SIZE (MBOX_SIZE + MBOX_EXTENSION_SIZE + \ 98 PCB_SIZE + SLI3_IOCB_MAX_SIZE) 99 100 #define SLI_SLIM2_SIZE SLI3_SLIM2_SIZE 101 #define SLI_IOCB_MAX_SIZE SLI3_IOCB_MAX_SIZE 102 103 104 /* These two are defined to indicate FCP cmd or non FCP cmd */ 105 #define FC_FCP_CMD 0 106 #define FC_FCT_CMD 0 107 #define FC_IP_CMD 1 108 #define FC_ELS_CMD 2 109 #define FC_CT_CMD 3 110 111 #define FC_NFCP_CMD 1 /* could be a bit mask */ 112 113 #define FC_MAXRETRY 3 /* max retries for ELS commands */ 114 #define FC_FCP_RING 0 /* use ring 0 for FCP initiator cmds */ 115 #define FC_FCT_RING 0 /* use ring 0 for FCP target cmds */ 116 117 #define FC_IP_RING 1 /* use ring 1 for IP commands */ 118 #define FC_ELS_RING 2 /* use ring 2 for ELS commands */ 119 #define FC_CT_RING 3 /* use ring 3 for CT commands */ 120 121 #define FF_DEF_EDTOV 2000 /* Default E_D_TOV (2000ms) */ 122 #define FF_DEF_ALTOV 15 /* Default AL_TIME (15ms) */ 123 #define FF_DEF_RATOV 2 /* Default RA_TOV (2s) */ 124 #define FF_DEF_ARBTOV 1900 /* Default ARB_TOV (1900ms) */ 125 #define MAX_MSG_DATA 28 /* max msg data in CMD_ADAPTER_MSG */ 126 /* iocb */ 127 #define FF_REG_AREA_SIZE 256 /* size, in bytes, of i/o register */ 128 /* area */ 129 130 /* 131 * Miscellaneous stuff.... 132 */ 133 /* HBA Mgmt */ 134 #define FDMI_DID ((uint32_t)0xfffffa) 135 #define NAMESERVER_DID ((uint32_t)0xfffffc) 136 #define SCR_DID ((uint32_t)0xfffffd) 137 #define FABRIC_DID ((uint32_t)0xfffffe) 138 #define BCAST_DID ((uint32_t)0xffffff) 139 #define MASK_DID ((uint32_t)0xffffff) 140 #define CT_DID_MASK ((uint32_t)0xffff00) 141 #define FABRIC_DID_MASK ((uint32_t)0xfff000) 142 #define WELL_KNOWN_DID_MASK ((uint32_t)0xfffff0) 143 144 #define EMLXS_MENLO_DID ((uint32_t)0x00fc0e) 145 146 #define OWN_CHIP 1 /* IOCB / Mailbox is owned by FireFly */ 147 #define OWN_HOST 0 /* IOCB / Mailbox is owned by Host */ 148 #define END_OF_CHAIN 0 149 150 151 /* defines for type field in fc header */ 152 #define FC_ELS_DATA 0x01 153 #define FC_LLC_SNAP 0x05 154 #define FC_FCP_DATA 0x08 155 #define FC_CT_TYPE 0x20 156 #define EMLXS_MENLO_TYPE 0xFE 157 158 /* defines for rctl field in fc header */ 159 #define FC_DEV_DATA 0x0 160 #define FC_UNSOL_CTL 0x2 161 #define FC_SOL_CTL 0x3 162 #define FC_UNSOL_DATA 0x4 163 #define FC_FCP_CMND 0x6 164 #define FC_ELS_REQ 0x22 165 #define FC_ELS_RSP 0x23 166 #define FC_NET_HDR 0x20 /* network headers for Dfctl field */ 167 168 /* 169 * Common Transport structures and definitions 170 * 171 */ 172 #define EMLXS_COMMAND 0 173 #define EMLXS_RESPONSE 1 174 175 typedef union CtRevisionId 176 { 177 /* Structure is in Big Endian format */ 178 struct 179 { 180 uint32_t Revision:8; 181 uint32_t InId:24; 182 } bits; 183 uint32_t word; 184 } CtRevisionId_t; 185 186 typedef union CtCommandResponse 187 { 188 /* Structure is in Big Endian format */ 189 struct 190 { 191 uint32_t CmdRsp:16; 192 uint32_t Size:16; 193 } bits; 194 uint32_t word; 195 } CtCommandResponse_t; 196 197 typedef struct SliCtRequest 198 { 199 /* Structure is in Big Endian format */ 200 CtRevisionId_t RevisionId; 201 uint8_t FsType; 202 uint8_t FsSubType; 203 uint8_t Options; 204 uint8_t Rsrvd1; 205 CtCommandResponse_t CommandResponse; 206 uint8_t Rsrvd2; 207 uint8_t ReasonCode; 208 uint8_t Explanation; 209 uint8_t VendorUnique; 210 211 union 212 { 213 uint32_t data; 214 uint32_t PortID; 215 216 struct gid 217 { 218 uint8_t PortType; /* for GID_PT requests */ 219 uint8_t DomainScope; 220 uint8_t AreaScope; 221 uint8_t Fc4Type; /* for GID_FT requests */ 222 } gid; 223 struct rft 224 { 225 uint32_t PortId; /* For RFT_ID requests */ 226 #ifdef EMLXS_BIG_ENDIAN 227 uint32_t rsvd0:16; 228 uint32_t rsvd1:7; 229 uint32_t fcpReg:1; /* Type 8 */ 230 uint32_t rsvd2:2; 231 uint32_t ipReg:1; /* Type 5 */ 232 uint32_t rsvd3:5; 233 #endif 234 #ifdef EMLXS_LITTLE_ENDIAN 235 uint32_t rsvd0:16; 236 uint32_t fcpReg:1; /* Type 8 */ 237 uint32_t rsvd1:7; 238 uint32_t rsvd3:5; 239 uint32_t ipReg:1; /* Type 5 */ 240 uint32_t rsvd2:2; 241 #endif 242 uint32_t rsvd[7]; 243 } rft; 244 245 struct rsnn 246 { 247 uint8_t wwnn[8]; 248 uint8_t snn_len; 249 char snn[256]; 250 } rsnn; 251 252 struct rspn 253 { 254 uint32_t PortId; 255 uint8_t spn_len; 256 char spn[256]; 257 } rspn; 258 } un; 259 } SliCtRequest_t; 260 typedef SliCtRequest_t SLI_CT_REQUEST; 261 262 #define SLI_CT_REVISION 1 263 264 265 /* 266 * FsType Definitions 267 */ 268 269 #define SLI_CT_MANAGEMENT_SERVICE 0xFA 270 #define SLI_CT_TIME_SERVICE 0xFB 271 #define SLI_CT_DIRECTORY_SERVICE 0xFC 272 #define SLI_CT_FABRIC_CONTROLLER_SERVICE 0xFD 273 274 /* 275 * Directory Service Subtypes 276 */ 277 278 #define SLI_CT_DIRECTORY_NAME_SERVER 0x02 279 280 /* 281 * Response Codes 282 */ 283 284 #define SLI_CT_RESPONSE_FS_RJT 0x8001 285 #define SLI_CT_RESPONSE_FS_ACC 0x8002 286 287 /* 288 * Reason Codes 289 */ 290 291 #define SLI_CT_NO_ADDITIONAL_EXPL 0x0 292 #define SLI_CT_INVALID_COMMAND 0x01 293 #define SLI_CT_INVALID_VERSION 0x02 294 #define SLI_CT_LOGICAL_ERROR 0x03 295 #define SLI_CT_INVALID_IU_SIZE 0x04 296 #define SLI_CT_LOGICAL_BUSY 0x05 297 #define SLI_CT_PROTOCOL_ERROR 0x07 298 #define SLI_CT_UNABLE_TO_PERFORM_REQ 0x09 299 #define SLI_CT_REQ_NOT_SUPPORTED 0x0b 300 #define SLI_CT_HBA_INFO_NOT_REGISTERED 0x10 301 #define SLI_CT_MULTIPLE_HBA_ATTR_OF_SAME_TYPE 0x11 302 #define SLI_CT_INVALID_HBA_ATTR_BLOCK_LEN 0x12 303 #define SLI_CT_HBA_ATTR_NOT_PRESENT 0x13 304 #define SLI_CT_PORT_INFO_NOT_REGISTERED 0x20 305 #define SLI_CT_MULTIPLE_PORT_ATTR_OF_SAME_TYPE 0x21 306 #define SLI_CT_INVALID_PORT_ATTR_BLOCK_LEN 0x22 307 #define SLI_CT_VENDOR_UNIQUE 0xff 308 309 /* 310 * Name Server SLI_CT_UNABLE_TO_PERFORM_REQ Explanations 311 */ 312 313 #define SLI_CT_NO_PORT_ID 0x01 314 #define SLI_CT_NO_PORT_NAME 0x02 315 #define SLI_CT_NO_NODE_NAME 0x03 316 #define SLI_CT_NO_CLASS_OF_SERVICE 0x04 317 #define SLI_CT_NO_IP_ADDRESS 0x05 318 #define SLI_CT_NO_IPA 0x06 319 #define SLI_CT_NO_FC4_TYPES 0x07 320 #define SLI_CT_NO_SYMBOLIC_PORT_NAME 0x08 321 #define SLI_CT_NO_SYMBOLIC_NODE_NAME 0x09 322 #define SLI_CT_NO_PORT_TYPE 0x0A 323 #define SLI_CT_ACCESS_DENIED 0x10 324 #define SLI_CT_INVALID_PORT_ID 0x11 325 #define SLI_CT_DATABASE_EMPTY 0x12 326 327 #ifdef EMLXS_BIG_ENDIAN 328 #define CT_CMD_MASK 0xffff0000 329 #endif 330 331 #ifdef EMLXS_LITTLE_ENDIAN 332 #define CT_CMD_MASK 0xffff 333 #endif 334 335 /* 336 * Management Server Interface Command Codes 337 */ 338 339 #define MS_GTIN 0x0100 340 #define MS_GIEL 0x0101 341 #define MS_GIET 0x0111 342 #define MS_GDID 0x0112 343 #define MS_GMID 0x0113 344 #define MS_GFN 0x0114 345 #define MS_GIELN 0x0115 346 #define MS_GMAL 0x0116 347 #define MS_GIEIL 0x0117 348 #define MS_GPL 0x0118 349 #define MS_GPT 0x0121 350 #define MS_GPPN 0x0122 351 #define MS_GAPNL 0x0124 352 #define MS_GPS 0x0126 353 #define MS_GPSC 0x0127 354 #define MS_GATIN 0x0128 355 #define MS_GSES 0x0130 356 #define MS_GPLNL 0x0191 357 #define MS_GPLT 0x0192 358 #define MS_GPLML 0x0193 359 #define MS_GPAB 0x0197 360 #define MS_GNPL 0x01A1 361 #define MS_GPNL 0x01A2 362 #define MS_GPFCP 0x01A4 363 #define MS_GPLI 0x01A5 364 #define MS_GNID 0x01B1 365 #define MS_RIELN 0x0215 366 #define MS_RPL 0x0280 367 #define MS_RPLN 0x0291 368 #define MS_RPLT 0x0292 369 #define MS_RPLM 0x0293 370 #define MS_RPAB 0x0298 371 #define MS_RPFCP 0x029A 372 #define MS_RPLI 0x029B 373 #define MS_DPL 0x0380 374 #define MS_DPLN 0x0391 375 #define MS_DPLM 0x0392 376 #define MS_DPLML 0x0393 377 #define MS_DPLI 0x0394 378 #define MS_DPAB 0x0395 379 #define MS_DPALL 0x039F 380 381 /* 382 * Name Server Command Codes 383 */ 384 #define SLI_CTNS_GA_NXT 0x0100 385 #define SLI_CTNS_GPN_ID 0x0112 386 #define SLI_CTNS_GNN_ID 0x0113 387 #define SLI_CTNS_GCS_ID 0x0114 388 #define SLI_CTNS_GFT_ID 0x0117 389 #define SLI_CTNS_GSPN_ID 0x0118 390 #define SLI_CTNS_GPT_ID 0x011A 391 #define SLI_CTNS_GID_PN 0x0121 392 #define SLI_CTNS_GID_NN 0x0131 393 #define SLI_CTNS_GIP_NN 0x0135 394 #define SLI_CTNS_GIPA_NN 0x0136 395 #define SLI_CTNS_GSNN_NN 0x0139 396 #define SLI_CTNS_GNN_IP 0x0153 397 #define SLI_CTNS_GIPA_IP 0x0156 398 #define SLI_CTNS_GID_FT 0x0171 399 #define SLI_CTNS_GID_PT 0x01A1 400 #define SLI_CTNS_RPN_ID 0x0212 401 #define SLI_CTNS_RNN_ID 0x0213 402 #define SLI_CTNS_RCS_ID 0x0214 403 #define SLI_CTNS_RFT_ID 0x0217 404 #define SLI_CTNS_RSPN_ID 0x0218 405 #define SLI_CTNS_RPT_ID 0x021A 406 #define SLI_CTNS_RIP_NN 0x0235 407 #define SLI_CTNS_RIPA_NN 0x0236 408 #define SLI_CTNS_RSNN_NN 0x0239 409 #define SLI_CTNS_DA_ID 0x0300 410 411 #define SLI_CT_LOOPBACK 0xFCFC 412 413 414 /* 415 * Port Types 416 */ 417 418 #define SLI_CTPT_N_PORT 0x01 419 #define SLI_CTPT_NL_PORT 0x02 420 #define SLI_CTPT_FNL_PORT 0x03 421 #define SLI_CTPT_IP 0x04 422 #define SLI_CTPT_FCP 0x08 423 #define SLI_CTPT_NX_PORT 0x7F 424 #define SLI_CTPT_F_PORT 0x81 425 #define SLI_CTPT_FL_PORT 0x82 426 #define SLI_CTPT_E_PORT 0x84 427 428 #define SLI_CT_LAST_ENTRY 0x80000000 429 430 /* ===================================================================== */ 431 432 /* 433 * Start FireFly Register definitions 434 */ 435 436 /* PCI register offsets */ 437 #define MEM_ADDR_OFFSET 0x10 /* SLIM base memory address */ 438 #define MEMH_OFFSET 0x14 /* SLIM base memory high address */ 439 #define REG_ADDR_OFFSET 0x18 /* REGISTER base memory address */ 440 #define REGH_OFFSET 0x1c /* REGISTER base memory high address */ 441 #define IO_ADDR_OFFSET 0x20 /* BIU I/O registers */ 442 #define REGIOH_OFFSET 0x24 /* REGISTER base io high address */ 443 444 #define CMD_REG_OFFSET 0x4 /* PCI command configuration */ 445 446 /* General PCI Register Definitions */ 447 /* Refer To The PCI Specification For Detailed Explanations */ 448 449 /* Register Offsets in little endian format */ 450 #define PCI_VENDOR_ID_REGISTER 0x00 /* PCI Vendor ID Reg */ 451 #define PCI_DEVICE_ID_REGISTER 0x02 /* PCI Device ID Reg */ 452 #define PCI_CONFIG_ID_REGISTER 0x00 /* PCI Configuration ID Reg */ 453 #define PCI_COMMAND_REGISTER 0x04 /* PCI Command Reg */ 454 #define PCI_STATUS_REGISTER 0x06 /* PCI Status Reg */ 455 #define PCI_REV_ID_REGISTER 0x08 /* PCI Revision ID Reg */ 456 #define PCI_CLASS_CODE_REGISTER 0x09 /* PCI Class Code Reg */ 457 #define PCI_CACHE_LINE_REGISTER 0x0C /* PCI Cache Line Reg */ 458 #define PCI_LATENCY_TMR_REGISTER 0x0D /* PCI Latency Timer Reg */ 459 #define PCI_HEADER_TYPE_REGISTER 0x0E /* PCI Header Type Reg */ 460 #define PCI_BIST_REGISTER 0x0F /* PCI Built-In SelfTest Reg */ 461 #define PCI_BAR_0_REGISTER 0x10 /* PCI Base Address Reg 0 */ 462 #define PCI_BAR_1_REGISTER 0x14 /* PCI Base Address Reg 1 */ 463 #define PCI_BAR_2_REGISTER 0x18 /* PCI Base Address Reg 2 */ 464 #define PCI_BAR_3_REGISTER 0x1C /* PCI Base Address Reg 3 */ 465 #define PCI_BAR_4_REGISTER 0x20 /* PCI Base Address Reg 4 */ 466 #define PCI_BAR_5_REGISTER 0x24 /* PCI Base Address Reg 5 */ 467 #define PCI_SSID_REGISTER 0x2C 468 #define PCI_SSVID_REGISTER 0x2C 469 #define PCI_SSDID_REGISTER 0x2E 470 #define PCI_EXPANSION_ROM 0x30 /* PCI Expansion ROM Base Reg */ 471 #define PCI_CAP_POINTER 0x34 472 /* PCI capatability registers are defined in pci.h */ 473 474 /* PCI Express cap register */ 475 #define PCIE_DEVCTL_OFFSET 8 476 477 /* PCI access methods */ 478 #define P_CONF_T1 1 479 #define P_CONF_T2 2 480 481 /* max number of pci buses */ 482 #define MAX_PCI_BUSES 0xFF 483 484 /* number of PCI config bytes to access */ 485 #define PCI_BYTE 1 486 #define PCI_WORD 2 487 #define PCI_DWORD 4 488 489 /* PCI related constants */ 490 #define CMD_IO_ENBL 0x0001 491 #define CMD_MEM_ENBL 0x0002 492 #define CMD_BUS_MASTER 0x0004 493 #define CMD_MWI 0x0010 494 #define CMD_PARITY_CHK 0x0040 495 #define CMD_SERR_ENBL 0x0100 496 497 #define CMD_CFG_VALUE 0x156 /* mem enable, master, MWI, SERR, PERR */ 498 499 /* PCI addresses */ 500 #define PCI_SPACE_ENABLE 0x0CF8 501 #define CF1_CONFIG_ADDR_REGISTER 0x0CF8 502 #define CF1_CONFIG_DATA_REGISTER 0x0CFC 503 #define CF2_FORWARD_REGISTER 0x0CFA 504 #define CF2_BASE_ADDRESS 0xC000 505 506 507 #define DEFAULT_PCI_LATENCY_CLOCKS 0xf8 /* 0xF8 is a special value */ 508 /* for FF11.1N6 firmware. */ 509 /* Use 0x80 for pre-FF11.1N6 */ 510 /* &N7, etc */ 511 #define PCI_LATENCY_VALUE 0xf8 512 513 514 515 /* ==== Register Bit Definitions ==== */ 516 517 /* Used by SBUS adapter */ 518 /* SBUS Control Register */ 519 #define SBUS_CTRL_REG_OFFSET 0 /* Word offset from reg base addr */ 520 521 #define SBUS_CTRL_SBRST 0x00000001 /* Bit 0 */ 522 #define SBUS_CTRL_BKOFF 0x00000002 /* Bit 1 */ 523 #define SBUS_CTRL_ENP 0x00000004 /* Bit 2 */ 524 #define SBUS_CTRL_EN64 0x00000008 /* Bit 3 */ 525 #define SBUS_CTRL_SIR_1 0x00000010 /* Bit [6:4] IRL 1, */ 526 /* lowset priority */ 527 #define SBUS_CTRL_SIR_2 0x00000020 528 #define SBUS_CTRL_SIR_3 0x00000030 529 #define SBUS_CTRL_SIR_4 0x00000040 530 #define SBUS_CTRL_SIR_5 0x00000050 531 #define SBUS_CTRL_SIR_6 0x00000060 532 #define SBUS_CTRL_SIR_7 0x00000070 /* IRL 7, highest priority */ 533 534 /* SBUS Status Register */ 535 #define SBUS_STAT_REG_OFFSET 1 /* Word offset from reg base addr */ 536 #define SBUS_STAT_IP 0x00000001 /* Bit 0 */ 537 #define SBUS_STAT_LERR 0x00000002 /* Bit 1 */ 538 #define SBUS_STAT_SBPE 0x00000004 /* Bit 2 */ 539 #define SBUS_STAT_TE 0x00000008 /* Bit 3 */ 540 #define SBUS_STAT_WPE 0x00000010 /* Bit 4 */ 541 #define SBUS_STAT_PERR 0x00000020 /* Bit 5 */ 542 #define SBUS_STAT_SERR 0x00000040 /* Bit 6 */ 543 #define SBUS_STAT_PTA 0x00000080 /* Bit 7 */ 544 545 /* SBUS Update Register */ 546 #define SBUS_UPDATE_REG_OFFSET 2 /* Word offfset from reg base addr */ 547 548 #define SBUS_UPDATE_DATA 0x00000001 /* Bit 0 */ 549 #define SBUS_UPDATE_SPCLK 0x00000002 /* Bit 1 */ 550 #define SBUS_UPDATE_SPCE 0x00000004 /* Bit 2 */ 551 #define SBUS_UPDATE_SPRST 0x00000008 /* Bit 3 */ 552 #define SBUS_UPDATE_SPWE 0x00000010 /* Bit 4 */ 553 #define SBUS_UPDATE_LDFPGA 0x00000080 /* Bit 7 */ 554 555 /* Host Attention Register */ 556 557 #define HA_REG_OFFSET 0 /* Word offset from register base address */ 558 559 #define HA_R0RE_REQ 0x00000001 /* Bit 0 */ 560 #define HA_R0CE_RSP 0x00000002 /* Bit 1 */ 561 #define HA_R0ATT 0x00000008 /* Bit 3 */ 562 #define HA_R1RE_REQ 0x00000010 /* Bit 4 */ 563 #define HA_R1CE_RSP 0x00000020 /* Bit 5 */ 564 #define HA_R1ATT 0x00000080 /* Bit 7 */ 565 #define HA_R2RE_REQ 0x00000100 /* Bit 8 */ 566 #define HA_R2CE_RSP 0x00000200 /* Bit 9 */ 567 #define HA_R2ATT 0x00000800 /* Bit 11 */ 568 #define HA_R3RE_REQ 0x00001000 /* Bit 12 */ 569 #define HA_R3CE_RSP 0x00002000 /* Bit 13 */ 570 #define HA_R3ATT 0x00008000 /* Bit 15 */ 571 #define HA_LATT 0x20000000 /* Bit 29 */ 572 #define HA_MBATT 0x40000000 /* Bit 30 */ 573 #define HA_ERATT 0x80000000 /* Bit 31 */ 574 575 576 #ifdef MSI_SUPPORT 577 578 579 /* Host attention interrupt map */ 580 #define EMLXS_MSI_MAP8 {0, HA_R0ATT, HA_R1ATT, HA_R2ATT, \ 581 HA_R3ATT, HA_LATT, HA_MBATT, HA_ERATT} 582 #define EMLXS_MSI_MAP4 {0, HA_R0ATT, HA_R1ATT, HA_R2ATT, 0, 0, 0, 0} 583 #define EMLXS_MSI_MAP2 {0, HA_R0ATT, 0, 0, 0, 0, 0, 0} 584 #define EMLXS_MSI_MAP1 {0, 0, 0, 0, 0, 0, 0, 0} 585 586 /* MSI 0 interrupt mask */ 587 #define EMLXS_MSI0_MASK8 0 588 #define EMLXS_MSI0_MASK4 (HC_R3INT_ENA|HC_MBINT_ENA|HC_LAINT_ENA| \ 589 HC_ERINT_ENA) 590 #define EMLXS_MSI0_MASK2 (HC_R1INT_ENA|HC_R2INT_ENA|HC_R3INT_ENA| \ 591 HC_MBINT_ENA|HC_LAINT_ENA|HC_ERINT_ENA) 592 #define EMLXS_MSI0_MASK1 (HC_R0INT_ENA|HC_R1INT_ENA|HC_R2INT_ENA| \ 593 HC_R3INT_ENA|HC_MBINT_ENA|HC_LAINT_ENA| \ 594 HC_ERINT_ENA) 595 596 597 #define EMLXS_MSI_MAX_INTRS 8 598 599 #define EMLXS_MSI_MODE1 0 600 #define EMLXS_MSI_MODE2 1 601 #define EMLXS_MSI_MODE4 2 602 #define EMLXS_MSI_MODE8 3 603 #define EMLXS_MSI_MODES 4 604 605 #endif /* MSI_SUPPORT */ 606 607 608 #define IO_THROTTLE_RESERVE 12 609 610 611 612 613 /* Chip Attention Register */ 614 615 #define CA_REG_OFFSET 1 /* Word offset from register base address */ 616 617 #define CA_R0CE_REQ 0x00000001 /* Bit 0 */ 618 #define CA_R0RE_RSP 0x00000002 /* Bit 1 */ 619 #define CA_R0ATT 0x00000008 /* Bit 3 */ 620 #define CA_R1CE_REQ 0x00000010 /* Bit 4 */ 621 #define CA_R1RE_RSP 0x00000020 /* Bit 5 */ 622 #define CA_R1ATT 0x00000080 /* Bit 7 */ 623 #define CA_R2CE_REQ 0x00000100 /* Bit 8 */ 624 #define CA_R2RE_RSP 0x00000200 /* Bit 9 */ 625 #define CA_R2ATT 0x00000800 /* Bit 11 */ 626 #define CA_R3CE_REQ 0x00001000 /* Bit 12 */ 627 #define CA_R3RE_RSP 0x00002000 /* Bit 13 */ 628 #define CA_R3ATT 0x00008000 /* Bit 15 */ 629 #define CA_MBATT 0x40000000 /* Bit 30 */ 630 631 /* Host Status Register */ 632 633 #define HS_REG_OFFSET 2 /* Word offset from register base address */ 634 635 #define HS_OVERTEMP 0x00000100 /* Bit 8 */ 636 #define HS_MBRDY 0x00400000 /* Bit 22 */ 637 #define HS_FFRDY 0x00800000 /* Bit 23 */ 638 #define HS_FFER8 0x01000000 /* Bit 24 */ 639 #define HS_FFER7 0x02000000 /* Bit 25 */ 640 #define HS_FFER6 0x04000000 /* Bit 26 */ 641 #define HS_FFER5 0x08000000 /* Bit 27 */ 642 #define HS_FFER4 0x10000000 /* Bit 28 */ 643 #define HS_FFER3 0x20000000 /* Bit 29 */ 644 #define HS_FFER2 0x40000000 /* Bit 30 */ 645 #define HS_FFER1 0x80000000 /* Bit 31 */ 646 #define HS_FFERM 0xFF000000 /* Mask for error bits 31:24 */ 647 648 /* Host Control Register */ 649 650 #define HC_REG_OFFSET 3 /* Word offset from register base address */ 651 652 #define HC_MBINT_ENA 0x00000001 /* Bit 0 */ 653 #define HC_R0INT_ENA 0x00000002 /* Bit 1 */ 654 #define HC_R1INT_ENA 0x00000004 /* Bit 2 */ 655 #define HC_R2INT_ENA 0x00000008 /* Bit 3 */ 656 #define HC_R3INT_ENA 0x00000010 /* Bit 4 */ 657 #define HC_INITHBI 0x02000000 /* Bit 25 */ 658 #define HC_INITMB 0x04000000 /* Bit 26 */ 659 #define HC_INITFF 0x08000000 /* Bit 27 */ 660 #define HC_LAINT_ENA 0x20000000 /* Bit 29 */ 661 #define HC_ERINT_ENA 0x80000000 /* Bit 31 */ 662 663 /* BIU Configuration Register */ 664 665 #define BC_REG_OFFSET 4 /* Word offset from register base address */ 666 667 #define BC_BSE 0x00000001 /* Bit 0 */ 668 #define BC_BSE_SWAP 0x01000000 /* Bit 0 - swapped */ 669 670 /* 671 * End FireFly Register definitions 672 */ 673 674 /* 675 * Start SLI 4 section. 676 */ 677 678 /* PCI Config Register offsets */ 679 #define PCICFG_UE_STATUS_LO_OFFSET 0xA0 /* Error Indication - low */ 680 #define PCICFG_UE_STATUS_HI_OFFSET 0xA4 /* Error Indication - high */ 681 #define PCICFG_UE_MASK_LO_OFFSET 0xA8 /* Error mask - low */ 682 #define PCICFG_UE_MASK_HI_OFFSET 0xAC /* Error mask - high */ 683 #define PCICFG_UE_STATUS_ONLINE1 0xB0 /* Error status1 */ 684 #define PCICFG_UE_STATUS_ONLINE2 0xB4 /* Error status2 */ 685 686 /* BAR1 and BAR2 register offsets */ 687 688 /* BAR1 offsets for principal registers */ 689 #define CSR_ISR0_OFFSET 0x0C18 /* CSR for EQ interrupt indications */ 690 #define CSR_IMR0_OFFSET 0x0C48 /* CSR for EQ interrupt masking */ 691 #define CSR_ISCR0_OFFSET 0x0C78 /* CSR for EQ interrupt clearing */ 692 693 #define ISR0_EQ0_INDC 0x00000001 /* Indication bit for EQ0 */ 694 #define ISR0_EQ1_INDC 0x00000002 /* Indication bit for EQ1 */ 695 #define ISR0_EQ2_INDC 0x00000004 /* Indication bit for EQ2 */ 696 #define ISR0_EQ3_INDC 0x00000008 /* Indication bit for EQ3 */ 697 #define ISR0_EQ4_INDC 0x00000010 /* Indication bit for EQ4 */ 698 #define ISR0_EQ5_INDC 0x00000020 /* Indication bit for EQ5 */ 699 #define ISR0_EQ6_INDC 0x00000040 /* Indication bit for EQ6 */ 700 #define ISR0_EQ7_INDC 0x00000080 /* Indication bit for EQ7 */ 701 702 /* MPU EP Semaphore register (ARM POST) */ 703 #define CSR_MPU_EP_SEMAPHORE_OFFSET 0x00AC 704 705 /* POST Stages of interest */ 706 #define ARM_POST_FATAL 0x80000000 707 #define ARM_POST_READY 0xc000 708 #define ARM_POST_MASK 0xffff 709 710 #define MPU_EP_DL 0x04000000 /* Driverloadedbitmask */ 711 #define MPU_EP_ORI 0x08000000 /* OptionROMinstalledbitmask */ 712 #define MPU_EP_IPC 0x10000000 /* IPaddressconflictmask */ 713 #define MPU_EP_NIP 0x20000000 /* NoIPaddressmask */ 714 #define MPU_EP_BFW 0x40000000 /* BackupFWinusemask */ 715 #define MPU_EP_ERR 0x80000000 /* POSTfatalerrormask */ 716 717 /* BAR2 offsets for principal doorbell registers */ 718 719 #define PD_RQ_DB_OFFSET 0x00A0 /* Doorbell notify of posted RQEs */ 720 721 #define PD_WQ_DB_OFFSET 0x0040 /* Doorbell notify of posted WQEs */ 722 723 #define PD_CQ_DB_OFFSET 0x0120 /* Doorbell notify of processed CQEs or EQEs */ 724 725 #define PD_MQ_DB_OFFSET 0x0140 /* Doorbell notify of posted MQEs */ 726 727 #define PD_MB_DB_OFFSET 0x0160 /* Doorbell Bootstrap Mailbox */ 728 729 /* Doorbell definitions */ 730 731 /* Defines for MQ doorbell */ 732 #define MQ_DB_POP_SHIFT 16 /* shift for entries popped */ 733 #define MQ_DB_POP_MASK 0x1FFF0000 /* Mask for number of entries popped */ 734 735 /* Defines for CQ doorbell */ 736 #define CQ_DB_POP_SHIFT 16 /* shift for entries popped */ 737 #define CQ_DB_POP_MASK 0x1FFF0000 /* Mask for number of entries popped */ 738 #define CQ_DB_REARM 0x20000000 /* Bit 29, rearm */ 739 740 /* Defines for EQ doorbell */ 741 #define EQ_DB_CLEAR 0x00000200 /* Bit 9, designates clear EQ ISR */ 742 #define EQ_DB_EVENT 0x00000400 /* Bit 10, designates EQ */ 743 #define EQ_DB_POP_SHIFT 16 /* shift for entries popped */ 744 #define EQ_DB_POP_MASK 0x1FFF0000 /* Mask for number of entries popped */ 745 #define EQ_DB_REARM 0x20000000 /* Bit 29, rearm */ 746 747 /* bootstrap mailbox doorbell defines */ 748 #define BMBX_READY 0x00000001 /* Mask for Port Ready bit */ 749 #define BMBX_ADDR_HI 0x00000002 /* Mask for Addr Hi bit */ 750 #define BMBX_ADDR 0xFFFFFFFA /* Mask for Addr bits */ 751 752 /* Sizeof bootstrap mailbox */ 753 #define EMLXS_BOOTSTRAP_MB_SIZE 256 754 755 #define MQE_SPECIAL_WORD0 0xFF1234FF /* Initialize bootstrap wd 0 */ 756 #define MQE_SPECIAL_WORD1 0xFF5678FF /* Initialize bootstrap wd 1 */ 757 758 759 /* ===================================================================== */ 760 761 /* 762 * Start of FCP specific structures 763 */ 764 765 typedef struct emlxs_fcp_rsp 766 { 767 uint32_t rspRsvd1; /* FC Word 0, byte 0:3 */ 768 uint32_t rspRsvd2; /* FC Word 1, byte 0:3 */ 769 770 uint8_t rspStatus0; /* FCP_STATUS byte 0 (reserved) */ 771 uint8_t rspStatus1; /* FCP_STATUS byte 1 (reserved) */ 772 uint8_t rspStatus2; /* FCP_STATUS byte 2 field validity */ 773 #define RSP_LEN_VALID 0x01 /* bit 0 */ 774 #define SNS_LEN_VALID 0x02 /* bit 1 */ 775 #define RESID_OVER 0x04 /* bit 2 */ 776 #define RESID_UNDER 0x08 /* bit 3 */ 777 778 uint8_t rspStatus3; /* FCP_STATUS byte 3 SCSI status byte */ 779 #define SCSI_STAT_GOOD 0x00 780 #define SCSI_STAT_CHECK_COND 0x02 781 #define SCSI_STAT_COND_MET 0x04 782 #define SCSI_STAT_BUSY 0x08 783 #define SCSI_STAT_INTERMED 0x10 784 #define SCSI_STAT_INTERMED_CM 0x14 785 #define SCSI_STAT_RES_CNFLCT 0x18 786 #define SCSI_STAT_CMD_TERM 0x22 787 #define SCSI_STAT_QUE_FULL 0x28 788 #define SCSI_STAT_ACA_ACTIVE 0x30 789 #define SCSI_STAT_TASK_ABORT 0x40 790 791 uint32_t rspResId; /* Residual xfer if RESID_xxxx set */ 792 /* in fcpStatus2. */ 793 /* Received in Big Endian format */ 794 uint32_t rspSnsLen; /* Length of sense data in fcpSnsInfo */ 795 /* Received in Big Endian format */ 796 uint32_t rspRspLen; /* Length of FCP response data */ 797 /* in fcpRspInfo */ 798 /* Received in Big Endian format */ 799 800 uint8_t rspInfo0; /* FCP_RSP_INFO byte 0 (reserved) */ 801 uint8_t rspInfo1; /* FCP_RSP_INFO byte 1 (reserved) */ 802 uint8_t rspInfo2; /* FCP_RSP_INFO byte 2 (reserved) */ 803 uint8_t rspInfo3; /* FCP_RSP_INFO RSP_CODE byte 3 */ 804 805 #define RSP_NO_FAILURE 0x00 806 #define RSP_DATA_BURST_ERR 0x01 807 #define RSP_CMD_FIELD_ERR 0x02 808 #define RSP_RO_MISMATCH_ERR 0x03 809 #define RSP_TM_NOT_SUPPORTED 0x04 /* Task mgmt function not supported */ 810 #define RSP_TM_NOT_COMPLETED 0x05 /* Task mgmt function not performed */ 811 812 uint32_t rspInfoRsvd; /* FCP_RSP_INFO bytes 4-7 (reserved) */ 813 814 /* 815 * Define maximum size of SCSI Sense buffer. 816 * Seagate never issues more than 18 bytes of Sense data 817 */ 818 #define MAX_FCP_SNS 128 819 uint8_t rspSnsInfo[MAX_FCP_SNS]; 820 } emlxs_fcp_rsp; 821 typedef emlxs_fcp_rsp FCP_RSP; 822 823 824 typedef struct emlxs_fcp_cmd 825 { 826 uint32_t fcpLunMsl; /* most significant lun word */ 827 uint32_t fcpLunLsl; /* least significant lun word */ 828 829 /* 830 * # of bits to shift lun id to end up in right payload word, 831 * little endian = 8, big = 16. 832 */ 833 #ifdef EMLXS_LITTLE_ENDIAN 834 #define FC_LUN_SHIFT 8 835 #define FC_ADDR_MODE_SHIFT 0 836 #endif 837 #ifdef EMLXS_BIG_ENDIAN 838 #define FC_LUN_SHIFT 16 839 #define FC_ADDR_MODE_SHIFT 24 840 #endif 841 842 uint8_t fcpCntl0; /* FCP_CNTL byte 0 (reserved) */ 843 uint8_t fcpCntl1; /* FCP_CNTL byte 1 task codes */ 844 #define SIMPLE_Q 0x00 845 #define HEAD_OF_Q 0x01 846 #define ORDERED_Q 0x02 847 #define ACA_Q 0x04 848 #define UNTAGGED 0x05 849 850 uint8_t fcpCntl2; /* FCP_CTL byte 2 task management */ 851 /* codes */ 852 #define ABORT_TASK_SET 0x02 /* Bit 1 */ 853 #define CLEAR_TASK_SET 0x04 /* bit 2 */ 854 #define LUN_RESET 0x10 /* bit 4 */ 855 #define TARGET_RESET 0x20 /* bit 5 */ 856 #define CLEAR_ACA 0x40 /* bit 6 */ 857 #define TERMINATE_TASK 0x80 /* bit 7 */ 858 859 uint8_t fcpCntl3; 860 #define WRITE_DATA 0x01 /* Bit 0 */ 861 #define READ_DATA 0x02 /* Bit 1 */ 862 863 uint8_t fcpCdb[16]; /* SRB cdb field is copied here */ 864 uint32_t fcpDl; /* Total transfer length */ 865 } emlxs_fcp_cmd_t; 866 typedef emlxs_fcp_cmd_t FCP_CMND; 867 868 869 870 871 /* SCSI INQUIRY Command Structure */ 872 873 typedef struct emlxs_inquiryDataType 874 { 875 uint8_t DeviceType:5; 876 uint8_t DeviceTypeQualifier:3; 877 878 uint8_t DeviceTypeModifier:7; 879 uint8_t RemovableMedia:1; 880 881 uint8_t Versions; 882 uint8_t ResponseDataFormat; 883 uint8_t AdditionalLength; 884 uint8_t Reserved[2]; 885 886 uint8_t SoftReset:1; 887 uint8_t CommandQueue:1; 888 uint8_t Reserved2:1; 889 uint8_t LinkedCommands:1; 890 uint8_t Synchronous:1; 891 uint8_t Wide16Bit:1; 892 uint8_t Wide32Bit:1; 893 uint8_t RelativeAddressing:1; 894 895 uint8_t VendorId[8]; 896 uint8_t ProductId[16]; 897 uint8_t ProductRevisionLevel[4]; 898 uint8_t VendorSpecific[20]; 899 uint8_t Reserved3[40]; 900 } emlxs_inquiry_data_type_t; 901 typedef emlxs_inquiry_data_type_t INQUIRY_DATA_DEF; 902 903 904 typedef struct emlxs_read_capacity_data 905 { 906 uint32_t LogicalBlockAddress; 907 uint32_t BytesPerBlock; 908 } emlxs_read_capacity_data_t; 909 typedef emlxs_read_capacity_data_t READ_CAPACITY_DATA_DEF; 910 911 912 /* SCSI CDB command codes */ 913 #define FCP_SCSI_FORMAT_UNIT 0x04 914 #define FCP_SCSI_INQUIRY 0x12 915 #define FCP_SCSI_MODE_SELECT 0x15 916 #define FCP_SCSI_MODE_SENSE 0x1A 917 #define FCP_SCSI_PAUSE_RESUME 0x4B 918 #define FCP_SCSI_PLAY_AUDIO 0x45 919 #define FCP_SCSI_PLAY_AUDIO_EXT 0xA5 920 #define FCP_SCSI_PLAY_AUDIO_MSF 0x47 921 #define FCP_SCSI_PLAY_AUDIO_TRK_INDX 0x48 922 #define FCP_SCSI_PREVENT_ALLOW_REMOVAL 0x1E 923 #define FCP_SCSI_READ_CMD 0x08 924 #define FCP_SCSI_READ_BUFFER 0x3C 925 #define FCP_SCSI_READ_CAPACITY 0x25 926 #define FCP_SCSI_READ_DEFECT_LIST 0x37 927 #define FCP_SCSI_READ_EXTENDED 0x28 928 #define FCP_SCSI_READ_HEADER 0x44 929 #define FCP_SCSI_READ_LONG 0xE8 930 #define FCP_SCSI_READ_SUB_CHANNEL 0x42 931 #define FCP_SCSI_READ_TOC 0x43 932 #define FCP_SCSI_REASSIGN_BLOCK 0x07 933 #define FCP_SCSI_RECEIVE_DIAGNOSTIC_RESULTS 0x1C 934 #define FCP_SCSI_RELEASE_UNIT 0x17 935 #define FCP_SCSI_REPORT_LUNS 0xa0 936 #define FCP_SCSI_REQUEST_SENSE 0x03 937 #define FCP_SCSI_RESERVE_UNIT 0x16 938 #define FCP_SCSI_REZERO_UNIT 0x01 939 #define FCP_SCSI_SEEK 0x0B 940 #define FCP_SCSI_SEEK_EXTENDED 0x2B 941 #define FCP_SCSI_SEND_DIAGNOSTIC 0x1D 942 #define FCP_SCSI_START_STOP_UNIT 0x1B 943 #define FCP_SCSI_TEST_UNIT_READY 0x00 944 #define FCP_SCSI_VERIFY 0x2F 945 #define FCP_SCSI_WRITE_CMD 0x0A 946 #define FCP_SCSI_WRITE_AND_VERIFY 0x2E 947 #define FCP_SCSI_WRITE_BUFFER 0x3B 948 #define FCP_SCSI_WRITE_EXTENDED 0x2A 949 #define FCP_SCSI_WRITE_LONG 0xEA 950 #define FCP_SCSI_RELEASE_LUNR 0xBB 951 #define FCP_SCSI_RELEASE_LUNV 0xBF 952 953 #define HPVA_SETPASSTHROUGHMODE 0x27 954 #define HPVA_EXECUTEPASSTHROUGH 0x29 955 #define HPVA_CREATELUN 0xE2 956 #define HPVA_SETLUNSECURITYLIST 0xED 957 #define HPVA_SETCLOCK 0xF9 958 #define HPVA_RECOVER 0xFA 959 #define HPVA_GENERICSERVICEOUT 0xFD 960 961 #define DMEP_EXPORT_IN 0x85 962 #define DMEP_EXPORT_OUT 0x89 963 964 #define MDACIOCTL_DIRECT_CMD 0x22 965 #define MDACIOCTL_STOREIMAGE 0x2C 966 #define MDACIOCTL_WRITESIGNATURE 0xA6 967 #define MDACIOCTL_SETREALTIMECLOCK 0xAC 968 #define MDACIOCTL_PASS_THRU_CDB 0xAD 969 #define MDACIOCTL_PASS_THRU_INITIATE 0xAE 970 #define MDACIOCTL_CREATENEWCONF 0xC0 971 #define MDACIOCTL_ADDNEWCONF 0xC4 972 #define MDACIOCTL_MORE 0xC6 973 #define MDACIOCTL_SETPHYSDEVPARAMETER 0xC8 974 #define MDACIOCTL_SETLOGDEVPARAMETER 0xCF 975 #define MDACIOCTL_SETCONTROLLERPARAMETER 0xD1 976 #define MDACIOCTL_WRITESANMAP 0xD4 977 #define MDACIOCTL_SETMACADDRESS 0xD5 978 979 /* 980 * End of FCP specific structures 981 */ 982 983 #define FL_ALPA 0x00 /* AL_PA of FL_Port */ 984 985 /* Fibre Channel Service Parameter definitions */ 986 987 #define FC_PH_4_0 6 /* FC-PH version 4.0 */ 988 #define FC_PH_4_1 7 /* FC-PH version 4.1 */ 989 #define FC_PH_4_2 8 /* FC-PH version 4.2 */ 990 #define FC_PH_4_3 9 /* FC-PH version 4.3 */ 991 992 #define FC_PH_LOW 8 /* Lowest supported FC-PH version */ 993 #define FC_PH_HIGH 9 /* Highest supported FC-PH version */ 994 #define FC_PH3 0x20 /* FC-PH-3 version */ 995 996 #define FF_FRAME_SIZE 2048 997 998 999 typedef struct emlxs_rings 1000 { 1001 #ifdef EMLXS_BIG_ENDIAN 1002 uint32_t crReserved:16; 1003 uint32_t crBegin:8; 1004 uint32_t crEnd:8; /* Low order bit first word */ 1005 uint32_t rrReserved:16; 1006 uint32_t rrBegin:8; 1007 uint32_t rrEnd:8; /* Low order bit second word */ 1008 #endif 1009 #ifdef EMLXS_LITTLE_ENDIAN 1010 uint32_t crEnd:8; /* Low order bit first word */ 1011 uint32_t crBegin:8; 1012 uint32_t crReserved:16; 1013 uint32_t rrEnd:8; /* Low order bit second word */ 1014 uint32_t rrBegin:8; 1015 uint32_t rrReserved:16; 1016 #endif 1017 } emlxs_rings_t; 1018 typedef emlxs_rings_t RINGS; 1019 1020 1021 typedef struct emlxs_ring_def 1022 { 1023 #ifdef EMLXS_BIG_ENDIAN 1024 uint16_t offCiocb; 1025 uint16_t numCiocb; 1026 uint16_t offRiocb; 1027 uint16_t numRiocb; 1028 #endif 1029 #ifdef EMLXS_LITTLE_ENDIAN 1030 uint16_t numCiocb; 1031 uint16_t offCiocb; 1032 uint16_t numRiocb; 1033 uint16_t offRiocb; 1034 #endif 1035 } emlxs_ring_def_t; 1036 typedef emlxs_ring_def_t RING_DEF; 1037 1038 /* 1039 * The following F.C. frame stuctures are defined in Big Endian format. 1040 */ 1041 1042 typedef struct emlxs_name_type 1043 { 1044 #ifdef EMLXS_BIG_ENDIAN 1045 uint8_t nameType:4; /* FC Word 0, bit 28:31 */ 1046 uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 */ 1047 /* of IEEE ext */ 1048 #endif 1049 #ifdef EMLXS_LITTLE_ENDIAN 1050 uint8_t IEEEextMsn:4; /* FC Word 0, bit 24:27, bit 8:11 */ 1051 /* of IEEE ext */ 1052 uint8_t nameType:4; /* FC Word 0, bit 28:31 */ 1053 #endif 1054 #define NAME_IEEE 0x1 /* IEEE name - nameType */ 1055 #define NAME_IEEE_EXT 0x2 /* IEEE extended name */ 1056 #define NAME_FC_TYPE 0x3 /* FC native name type */ 1057 #define NAME_IP_TYPE 0x4 /* IP address */ 1058 #define NAME_CCITT_TYPE 0xC 1059 #define NAME_CCITT_GR_TYPE 0xE 1060 uint8_t IEEEextLsb; /* FC Word 0, bit 16:23, */ 1061 /* IEEE extended Lsb */ 1062 uint8_t IEEE[6]; /* FC IEEE address */ 1063 } emlxs_name_type_t; 1064 typedef emlxs_name_type_t NAME_TYPE; 1065 1066 1067 typedef struct emlxs_csp 1068 { 1069 uint8_t fcphHigh; /* FC Word 0, byte 0 */ 1070 uint8_t fcphLow; 1071 uint8_t bbCreditMsb; 1072 uint8_t bbCreditlsb; /* FC Word 0, byte 3 */ 1073 #ifdef EMLXS_BIG_ENDIAN 1074 uint16_t reqMultipleNPort:1; /* FC Word 1, bit 31 */ 1075 uint16_t randomOffset:1; /* FC Word 1, bit 30 */ 1076 uint16_t rspMultipleNPort:1; /* FC Word 1, bit 29 */ 1077 uint16_t fPort:1; /* FC Word 1, bit 28 */ 1078 uint16_t altBbCredit:1; /* FC Word 1, bit 27 */ 1079 uint16_t edtovResolution:1; /* FC Word 1, bit 26 */ 1080 uint16_t multicast:1; /* FC Word 1, bit 25 */ 1081 uint16_t broadcast:1; /* FC Word 1, bit 24 */ 1082 1083 uint16_t huntgroup:1; /* FC Word 1, bit 23 */ 1084 uint16_t simplex:1; /* FC Word 1, bit 22 */ 1085 1086 uint16_t fcsp_support:1; /* FC Word 1, bit 21 */ 1087 uint16_t word1Reserved20:1; /* FC Word 1, bit 20 */ 1088 uint16_t word1Reserved19:1; /* FC Word 1, bit 19 */ 1089 1090 uint16_t dhd:1; /* FC Word 1, bit 18 */ 1091 uint16_t contIncSeqCnt:1; /* FC Word 1, bit 17 */ 1092 uint16_t payloadlength:1; /* FC Word 1, bit 16 */ 1093 #endif 1094 #ifdef EMLXS_LITTLE_ENDIAN 1095 uint16_t broadcast:1; /* FC Word 1, bit 24 */ 1096 uint16_t multicast:1; /* FC Word 1, bit 25 */ 1097 uint16_t edtovResolution:1; /* FC Word 1, bit 26 */ 1098 uint16_t altBbCredit:1; /* FC Word 1, bit 27 */ 1099 uint16_t fPort:1; /* FC Word 1, bit 28 */ 1100 uint16_t rspMultipleNPort:1; /* FC Word 1, bit 29 */ 1101 uint16_t randomOffset:1; /* FC Word 1, bit 30 */ 1102 uint16_t reqMultipleNPort:1; /* FC Word 1, bit 31 */ 1103 1104 uint16_t payloadlength:1; /* FC Word 1, bit 16 */ 1105 uint16_t contIncSeqCnt:1; /* FC Word 1, bit 17 */ 1106 uint16_t dhd:1; /* FC Word 1, bit 18 */ 1107 1108 uint16_t word1Reserved19:1; /* FC Word 1, bit 19 */ 1109 uint16_t word1Reserved20:1; /* FC Word 1, bit 20 */ 1110 uint16_t fcsp_support:1; /* FC Word 1, bit 21 */ 1111 1112 uint16_t simplex:1; /* FC Word 1, bit 22 */ 1113 uint16_t huntgroup:1; /* FC Word 1, bit 23 */ 1114 #endif 1115 uint8_t bbRcvSizeMsb; /* Upper nibble is reserved */ 1116 uint8_t bbRcvSizeLsb; /* FC Word 1, byte 3 */ 1117 union 1118 { 1119 struct 1120 { 1121 uint8_t word2Reserved1; /* FC Word 2 byte 0 */ 1122 1123 uint8_t totalConcurrSeq; /* FC Word 2 byte 1 */ 1124 uint8_t roByCategoryMsb; /* FC Word 2 byte 2 */ 1125 1126 uint8_t roByCategoryLsb; /* FC Word 2 byte 3 */ 1127 } nPort; 1128 uint32_t r_a_tov; /* R_A_TOV must be in Big */ 1129 /* Endian format */ 1130 } w2; 1131 1132 uint32_t e_d_tov; /* E_D_TOV must be in Big */ 1133 /* Endian format */ 1134 } emlxs_csp_t; 1135 typedef emlxs_csp_t CSP; 1136 1137 1138 typedef struct emlxs_class_parms 1139 { 1140 #ifdef EMLXS_BIG_ENDIAN 1141 uint8_t classValid:1; /* FC Word 0, bit 31 */ 1142 uint8_t intermix:1; /* FC Word 0, bit 30 */ 1143 uint8_t stackedXparent:1; /* FC Word 0, bit 29 */ 1144 uint8_t stackedLockDown:1; /* FC Word 0, bit 28 */ 1145 uint8_t seqDelivery:1; /* FC Word 0, bit 27 */ 1146 uint8_t word0Reserved1:3; /* FC Word 0, bit 24:26 */ 1147 #endif 1148 #ifdef EMLXS_LITTLE_ENDIAN 1149 uint8_t word0Reserved1:3; /* FC Word 0, bit 24:26 */ 1150 uint8_t seqDelivery:1; /* FC Word 0, bit 27 */ 1151 uint8_t stackedLockDown:1; /* FC Word 0, bit 28 */ 1152 uint8_t stackedXparent:1; /* FC Word 0, bit 29 */ 1153 uint8_t intermix:1; /* FC Word 0, bit 30 */ 1154 uint8_t classValid:1; /* FC Word 0, bit 31 */ 1155 1156 #endif 1157 uint8_t word0Reserved2; /* FC Word 0, bit 16:23 */ 1158 #ifdef EMLXS_BIG_ENDIAN 1159 uint8_t iCtlXidReAssgn:2; /* FC Word 0, Bit 14:15 */ 1160 uint8_t iCtlInitialPa:2; /* FC Word 0, bit 12:13 */ 1161 uint8_t iCtlAck0capable:1; /* FC Word 0, bit 11 */ 1162 uint8_t iCtlAckNcapable:1; /* FC Word 0, bit 10 */ 1163 uint8_t word0Reserved3:2; /* FC Word 0, bit 8: 9 */ 1164 #endif 1165 #ifdef EMLXS_LITTLE_ENDIAN 1166 uint8_t word0Reserved3:2; /* FC Word 0, bit 8: 9 */ 1167 uint8_t iCtlAckNcapable:1; /* FC Word 0, bit 10 */ 1168 uint8_t iCtlAck0capable:1; /* FC Word 0, bit 11 */ 1169 uint8_t iCtlInitialPa:2; /* FC Word 0, bit 12:13 */ 1170 uint8_t iCtlXidReAssgn:2; /* FC Word 0, Bit 14:15 */ 1171 #endif 1172 uint8_t word0Reserved4; /* FC Word 0, bit 0: 7 */ 1173 #ifdef EMLXS_BIG_ENDIAN 1174 uint8_t rCtlAck0capable:1; /* FC Word 1, bit 31 */ 1175 uint8_t rCtlAckNcapable:1; /* FC Word 1, bit 30 */ 1176 uint8_t rCtlXidInterlck:1; /* FC Word 1, bit 29 */ 1177 uint8_t rCtlErrorPolicy:2; /* FC Word 1, bit 27:28 */ 1178 uint8_t word1Reserved1:1; /* FC Word 1, bit 26 */ 1179 uint8_t rCtlCatPerSeq:2; /* FC Word 1, bit 24:25 */ 1180 #endif 1181 #ifdef EMLXS_LITTLE_ENDIAN 1182 uint8_t rCtlCatPerSeq:2; /* FC Word 1, bit 24:25 */ 1183 uint8_t word1Reserved1:1; /* FC Word 1, bit 26 */ 1184 uint8_t rCtlErrorPolicy:2; /* FC Word 1, bit 27:28 */ 1185 uint8_t rCtlXidInterlck:1; /* FC Word 1, bit 29 */ 1186 uint8_t rCtlAckNcapable:1; /* FC Word 1, bit 30 */ 1187 uint8_t rCtlAck0capable:1; /* FC Word 1, bit 31 */ 1188 #endif 1189 uint8_t word1Reserved2; /* FC Word 1, bit 16:23 */ 1190 uint8_t rcvDataSizeMsb; /* FC Word 1, bit 8:15 */ 1191 uint8_t rcvDataSizeLsb; /* FC Word 1, bit 0: 7 */ 1192 1193 uint8_t concurrentSeqMsb; /* FC Word 2, bit 24:31 */ 1194 uint8_t concurrentSeqLsb; /* FC Word 2, bit 16:23 */ 1195 uint8_t EeCreditSeqMsb; /* FC Word 2, bit 8:15 */ 1196 uint8_t EeCreditSeqLsb; /* FC Word 2, bit 0: 7 */ 1197 1198 uint8_t openSeqPerXchgMsb; /* FC Word 3, bit 24:31 */ 1199 uint8_t openSeqPerXchgLsb; /* FC Word 3, bit 16:23 */ 1200 uint8_t word3Reserved1; /* Fc Word 3, bit 8:15 */ 1201 uint8_t word3Reserved2; /* Fc Word 3, bit 0: 7 */ 1202 } emlxs_class_parms_t; 1203 typedef emlxs_class_parms_t CLASS_PARMS; 1204 1205 1206 typedef struct emlxs_serv_parms 1207 { /* Structure is in Big Endian format */ 1208 CSP cmn; 1209 NAME_TYPE portName; 1210 NAME_TYPE nodeName; 1211 CLASS_PARMS cls1; 1212 CLASS_PARMS cls2; 1213 CLASS_PARMS cls3; 1214 CLASS_PARMS cls4; 1215 uint8_t vendorVersion[16]; 1216 } emlxs_serv_parms_t; 1217 typedef emlxs_serv_parms_t SERV_PARM; 1218 1219 typedef struct 1220 { 1221 union 1222 { 1223 uint32_t word0; 1224 struct 1225 { 1226 #ifdef EMLXS_BIG_ENDIAN 1227 uint32_t rsvd0:8; /* Word 0, Byte 3 */ 1228 uint32_t oui:24; /* Elx Organization */ 1229 /* Unique ID (0000C9) */ 1230 #endif 1231 #ifdef EMLXS_LITTLE_ENDIAN 1232 uint32_t oui:24; /* Elx Organization */ 1233 /* Unique ID (0000C9) */ 1234 uint32_t rsvd0:8; /* Word 0, Byte 3 */ 1235 #endif 1236 } w0; 1237 } un0; 1238 union 1239 { 1240 uint32_t word1; 1241 struct 1242 { 1243 #ifdef EMLXS_BIG_ENDIAN 1244 uint32_t vport:1; /* Word 1, Bit 31 */ 1245 uint32_t rsvd1:31; /* Word 1, Bit 0-30 */ 1246 #endif 1247 #ifdef EMLXS_LITTLE_ENDIAN 1248 uint32_t rsvd1:31; /* Word 1, Bit 0-30 */ 1249 uint32_t vport:1; /* Word 1, Bit 31 */ 1250 #endif 1251 } w1; 1252 } un1; 1253 uint8_t rsvd2[8]; 1254 } emlxs_vvl_fmt_t; 1255 1256 #define VALID_VENDOR_VERSION cmn.rspMultipleNPort 1257 1258 1259 1260 /* 1261 * Extended Link Service LS_COMMAND codes (Payload BYTE 0) 1262 */ 1263 #ifdef EMLXS_BIG_ENDIAN 1264 #define ELS_CMD_SHIFT 24 1265 #define ELS_CMD_MASK 0xff000000 1266 #define ELS_RSP_MASK 0xff000000 1267 #define ELS_CMD_LS_RJT 0x01000000 1268 #define ELS_CMD_ACC 0x02000000 1269 #define ELS_CMD_PLOGI 0x03000000 1270 #define ELS_CMD_FLOGI 0x04000000 1271 #define ELS_CMD_LOGO 0x05000000 1272 #define ELS_CMD_ABTX 0x06000000 1273 #define ELS_CMD_RCS 0x07000000 1274 #define ELS_CMD_RES 0x08000000 1275 #define ELS_CMD_RSS 0x09000000 1276 #define ELS_CMD_RSI 0x0A000000 1277 #define ELS_CMD_ESTS 0x0B000000 1278 #define ELS_CMD_ESTC 0x0C000000 1279 #define ELS_CMD_ADVC 0x0D000000 1280 #define ELS_CMD_RTV 0x0E000000 1281 #define ELS_CMD_RLS 0x0F000000 1282 #define ELS_CMD_ECHO 0x10000000 1283 #define ELS_CMD_TEST 0x11000000 1284 #define ELS_CMD_RRQ 0x12000000 1285 #define ELS_CMD_REC 0x13000000 1286 #define ELS_CMD_PRLI 0x20000000 1287 #define ELS_CMD_PRLO 0x21000000 1288 #define ELS_CMD_SCN 0x22000000 1289 #define ELS_CMD_TPLS 0x23000000 1290 #define ELS_CMD_GPRLO 0x24000000 1291 #define ELS_CMD_GAID 0x30000000 1292 #define ELS_CMD_FACT 0x31000000 1293 #define ELS_CMD_FDACT 0x32000000 1294 #define ELS_CMD_NACT 0x33000000 1295 #define ELS_CMD_NDACT 0x34000000 1296 #define ELS_CMD_QoSR 0x40000000 1297 #define ELS_CMD_RVCS 0x41000000 1298 #define ELS_CMD_PDISC 0x50000000 1299 #define ELS_CMD_FDISC 0x51000000 1300 #define ELS_CMD_ADISC 0x52000000 1301 #define ELS_CMD_FARP 0x54000000 1302 #define ELS_CMD_FARPR 0x55000000 1303 #define ELS_CMD_FAN 0x60000000 1304 #define ELS_CMD_RSCN 0x61000000 1305 #define ELS_CMD_SCR 0x62000000 1306 #define ELS_CMD_LINIT 0x70000000 1307 #define ELS_CMD_RNID 0x78000000 1308 #define ELS_CMD_AUTH 0x90000000 1309 #endif 1310 1311 #ifdef EMLXS_LITTLE_ENDIAN 1312 #define ELS_CMD_SHIFT 0 1313 #define ELS_CMD_MASK 0xff 1314 #define ELS_RSP_MASK 0xff 1315 #define ELS_CMD_LS_RJT 0x01 1316 #define ELS_CMD_ACC 0x02 1317 #define ELS_CMD_PLOGI 0x03 1318 #define ELS_CMD_FLOGI 0x04 1319 #define ELS_CMD_LOGO 0x05 1320 #define ELS_CMD_ABTX 0x06 1321 #define ELS_CMD_RCS 0x07 1322 #define ELS_CMD_RES 0x08 1323 #define ELS_CMD_RSS 0x09 1324 #define ELS_CMD_RSI 0x0A 1325 #define ELS_CMD_ESTS 0x0B 1326 #define ELS_CMD_ESTC 0x0C 1327 #define ELS_CMD_ADVC 0x0D 1328 #define ELS_CMD_RTV 0x0E 1329 #define ELS_CMD_RLS 0x0F 1330 #define ELS_CMD_ECHO 0x10 1331 #define ELS_CMD_TEST 0x11 1332 #define ELS_CMD_RRQ 0x12 1333 #define ELS_CMD_REC 0x13 1334 #define ELS_CMD_PRLI 0x20 1335 #define ELS_CMD_PRLO 0x21 1336 #define ELS_CMD_SCN 0x22 1337 #define ELS_CMD_TPLS 0x23 1338 #define ELS_CMD_GPRLO 0x24 1339 #define ELS_CMD_GAID 0x30 1340 #define ELS_CMD_FACT 0x31 1341 #define ELS_CMD_FDACT 0x32 1342 #define ELS_CMD_NACT 0x33 1343 #define ELS_CMD_NDACT 0x34 1344 #define ELS_CMD_QoSR 0x40 1345 #define ELS_CMD_RVCS 0x41 1346 #define ELS_CMD_PDISC 0x50 1347 #define ELS_CMD_FDISC 0x51 1348 #define ELS_CMD_ADISC 0x52 1349 #define ELS_CMD_FARP 0x54 1350 #define ELS_CMD_FARPR 0x55 1351 #define ELS_CMD_FAN 0x60 1352 #define ELS_CMD_RSCN 0x61 1353 #define ELS_CMD_SCR 0x62 1354 #define ELS_CMD_LINIT 0x70 1355 #define ELS_CMD_RNID 0x78 1356 #define ELS_CMD_AUTH 0x90 1357 #endif 1358 1359 1360 /* 1361 * LS_RJT Payload Definition 1362 */ 1363 1364 typedef struct _LS_RJT 1365 { /* Structure is in Big Endian format */ 1366 union 1367 { 1368 uint32_t lsRjtError; 1369 struct 1370 { 1371 uint8_t lsRjtRsvd0; /* FC Word 0, */ 1372 /* bit 24:31 */ 1373 1374 uint8_t lsRjtRsnCode; /* FC Word 0, */ 1375 /* bit 16:23 */ 1376 /* LS_RJT reason codes */ 1377 #define LSRJT_INVALID_CMD 0x01 1378 #define LSRJT_LOGICAL_ERR 0x03 1379 #define LSRJT_LOGICAL_BSY 0x05 1380 #define LSRJT_PROTOCOL_ERR 0x07 1381 #define LSRJT_UNABLE_TPC 0x09 /* Unable to perform command */ 1382 #define LSRJT_CMD_UNSUPPORTED 0x0B 1383 #define LSRJT_VENDOR_UNIQUE 0xFF /* See Byte 3 */ 1384 1385 uint8_t lsRjtRsnCodeExp; /* FC Word 0, */ 1386 /* bit 8:15 */ 1387 /* LS_RJT reason explanation */ 1388 #define LSEXP_NOTHING_MORE 0x00 1389 #define LSEXP_SPARM_OPTIONS 0x01 1390 #define LSEXP_SPARM_ICTL 0x03 1391 #define LSEXP_SPARM_RCTL 0x05 1392 #define LSEXP_SPARM_RCV_SIZE 0x07 1393 #define LSEXP_SPARM_CONCUR_SEQ 0x09 1394 #define LSEXP_SPARM_CREDIT 0x0B 1395 #define LSEXP_INVALID_PNAME 0x0D 1396 #define LSEXP_INVALID_NNAME 0x0E 1397 #define LSEXP_INVALID_CSP 0x0F 1398 #define LSEXP_INVALID_ASSOC_HDR 0x11 1399 #define LSEXP_ASSOC_HDR_REQ 0x13 1400 #define LSEXP_INVALID_O_SID 0x15 1401 #define LSEXP_INVALID_OX_RX 0x17 1402 #define LSEXP_CMD_IN_PROGRESS 0x19 1403 #define LSEXP_INVALID_NPORT_ID 0x1F 1404 #define LSEXP_INVALID_SEQ_ID 0x21 1405 #define LSEXP_INVALID_XCHG 0x23 1406 #define LSEXP_INACTIVE_XCHG 0x25 1407 #define LSEXP_RQ_REQUIRED 0x27 1408 #define LSEXP_OUT_OF_RESOURCE 0x29 1409 #define LSEXP_CANT_GIVE_DATA 0x2A 1410 #define LSEXP_REQ_UNSUPPORTED 0x2C 1411 uint8_t vendorUnique; /* FC Word 0, bit 0: 7 */ 1412 } b; 1413 } un; 1414 } LS_RJT; 1415 1416 1417 /* 1418 * N_Port Login (FLOGO/PLOGO Request) Payload Definition 1419 */ 1420 1421 typedef struct _LOGO 1422 { /* Structure is in Big Endian format */ 1423 union 1424 { 1425 uint32_t nPortId32; /* Access nPortId as a word */ 1426 struct 1427 { 1428 uint8_t word1Reserved1; /* FC Word 1, bit 31:24 */ 1429 uint8_t nPortIdByte0; /* N_port ID bit 16:23 */ 1430 uint8_t nPortIdByte1; /* N_port ID bit 8:15 */ 1431 uint8_t nPortIdByte2; /* N_port ID bit 0: 7 */ 1432 } b; 1433 } un; 1434 NAME_TYPE portName; /* N_port name field */ 1435 } LOGO; 1436 1437 1438 /* 1439 * FCP Login (PRLI Request / ACC) Payload Definition 1440 */ 1441 1442 #define PRLX_PAGE_LEN 0x10 1443 #define TPRLO_PAGE_LEN 0x14 1444 1445 typedef struct _PRLI 1446 { /* Structure is in Big Endian format */ 1447 uint8_t prliType; /* FC Parm Word 0, bit 24:31 */ 1448 1449 #define PRLI_FCP_TYPE 0x08 1450 uint8_t word0Reserved1; /* FC Parm Word 0, bit 16:23 */ 1451 1452 #ifdef EMLXS_BIG_ENDIAN 1453 uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */ 1454 uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */ 1455 uint8_t estabImagePair:1; /* FC Parm Word 0, bit 13 */ 1456 1457 /* ACC = imagePairEstablished */ 1458 uint8_t word0Reserved2:1; /* FC Parm Word 0, bit 12 */ 1459 uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, */ 1460 /* ACC ONLY */ 1461 #endif 1462 #ifdef EMLXS_LITTLE_ENDIAN 1463 uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, */ 1464 /* ACC ONLY */ 1465 uint8_t word0Reserved2:1; /* FC Parm Word 0, bit 12 */ 1466 uint8_t estabImagePair:1; /* FC Parm Word 0, bit 13 */ 1467 uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */ 1468 uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */ 1469 /* ACC = imagePairEstablished */ 1470 #endif 1471 #define PRLI_REQ_EXECUTED 0x1 /* acceptRspCode */ 1472 #define PRLI_NO_RESOURCES 0x2 1473 #define PRLI_INIT_INCOMPLETE 0x3 1474 #define PRLI_NO_SUCH_PA 0x4 1475 #define PRLI_PREDEF_CONFIG 0x5 1476 #define PRLI_PARTIAL_SUCCESS 0x6 1477 #define PRLI_INVALID_PAGE_CNT 0x7 1478 uint8_t word0Reserved3; /* FC Parm Word 0, bit 0:7 */ 1479 1480 uint32_t origProcAssoc; /* FC Parm Word 1, bit 0:31 */ 1481 1482 uint32_t respProcAssoc; /* FC Parm Word 2, bit 0:31 */ 1483 1484 uint8_t word3Reserved1; /* FC Parm Word 3, bit 24:31 */ 1485 uint8_t word3Reserved2; /* FC Parm Word 3, bit 16:23 */ 1486 #ifdef EMLXS_BIG_ENDIAN 1487 uint16_t Word3bit15Resved:1; /* FC Parm Word 3, bit 15 */ 1488 uint16_t Word3bit14Resved:1; /* FC Parm Word 3, bit 14 */ 1489 uint16_t Word3bit13Resved:1; /* FC Parm Word 3, bit 13 */ 1490 uint16_t Word3bit12Resved:1; /* FC Parm Word 3, bit 12 */ 1491 uint16_t Word3bit11Resved:1; /* FC Parm Word 3, bit 11 */ 1492 uint16_t Word3bit10Resved:1; /* FC Parm Word 3, bit 10 */ 1493 uint16_t TaskRetryIdReq:1; /* FC Parm Word 3, bit 9 */ 1494 uint16_t Retry:1; /* FC Parm Word 3, bit 8 */ 1495 uint16_t ConfmComplAllowed:1; /* FC Parm Word 3, bit 7 */ 1496 uint16_t dataOverLay:1; /* FC Parm Word 3, bit 6 */ 1497 uint16_t initiatorFunc:1; /* FC Parm Word 3, bit 5 */ 1498 uint16_t targetFunc:1; /* FC Parm Word 3, bit 4 */ 1499 uint16_t cmdDataMixEna:1; /* FC Parm Word 3, bit 3 */ 1500 uint16_t dataRspMixEna:1; /* FC Parm Word 3, bit 2 */ 1501 uint16_t readXferRdyDis:1; /* FC Parm Word 3, bit 1 */ 1502 uint16_t writeXferRdyDis:1; /* FC Parm Word 3, bit 0 */ 1503 #endif 1504 #ifdef EMLXS_LITTLE_ENDIAN 1505 uint16_t Retry:1; /* FC Parm Word 3, bit 8 */ 1506 uint16_t TaskRetryIdReq:1; /* FC Parm Word 3, bit 9 */ 1507 uint16_t Word3bit10Resved:1; /* FC Parm Word 3, bit 10 */ 1508 uint16_t Word3bit11Resved:1; /* FC Parm Word 3, bit 11 */ 1509 uint16_t Word3bit12Resved:1; /* FC Parm Word 3, bit 12 */ 1510 uint16_t Word3bit13Resved:1; /* FC Parm Word 3, bit 13 */ 1511 uint16_t Word3bit14Resved:1; /* FC Parm Word 3, bit 14 */ 1512 uint16_t Word3bit15Resved:1; /* FC Parm Word 3, bit 15 */ 1513 uint16_t writeXferRdyDis:1; /* FC Parm Word 3, bit 0 */ 1514 uint16_t readXferRdyDis:1; /* FC Parm Word 3, bit 1 */ 1515 uint16_t dataRspMixEna:1; /* FC Parm Word 3, bit 2 */ 1516 uint16_t cmdDataMixEna:1; /* FC Parm Word 3, bit 3 */ 1517 uint16_t targetFunc:1; /* FC Parm Word 3, bit 4 */ 1518 uint16_t initiatorFunc:1; /* FC Parm Word 3, bit 5 */ 1519 uint16_t dataOverLay:1; /* FC Parm Word 3, bit 6 */ 1520 uint16_t ConfmComplAllowed:1; /* FC Parm Word 3, bit 7 */ 1521 #endif 1522 } PRLI; 1523 1524 /* 1525 * FCP Logout (PRLO Request / ACC) Payload Definition 1526 */ 1527 1528 typedef struct _PRLO 1529 { /* Structure is in Big Endian format */ 1530 uint8_t prloType; /* FC Parm Word 0, bit 24:31 */ 1531 1532 #define PRLO_FCP_TYPE 0x08 1533 uint8_t word0Reserved1; /* FC Parm Word 0, bit 16:23 */ 1534 1535 #ifdef EMLXS_BIG_ENDIAN 1536 uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */ 1537 uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */ 1538 uint8_t word0Reserved2:2; /* FC Parm Word 0, bit 12:13 */ 1539 uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, */ 1540 /* ACC ONLY */ 1541 #endif 1542 #ifdef EMLXS_LITTLE_ENDIAN 1543 uint8_t acceptRspCode:4; /* FC Parm Word 0, bit 8:11, */ 1544 /* ACC ONLY */ 1545 uint8_t word0Reserved2:2; /* FC Parm Word 0, bit 12:13 */ 1546 uint8_t respProcAssocV:1; /* FC Parm Word 0, bit 14 */ 1547 uint8_t origProcAssocV:1; /* FC Parm Word 0, bit 15 */ 1548 #endif 1549 #define PRLO_REQ_EXECUTED 0x1 /* acceptRspCode */ 1550 #define PRLO_NO_SUCH_IMAGE 0x4 1551 #define PRLO_INVALID_PAGE_CNT 0x7 1552 1553 uint8_t word0Reserved3; /* FC Parm Word 0, bit 0:7 */ 1554 uint32_t origProcAssoc; /* FC Parm Word 1, bit 0:31 */ 1555 uint32_t respProcAssoc; /* FC Parm Word 2, bit 0:31 */ 1556 uint32_t word3Reserved1; /* FC Parm Word 3, bit 0:31 */ 1557 } PRLO; 1558 1559 1560 typedef struct _ADISC 1561 { /* Structure is in Big Endian format */ 1562 uint32_t hardAL_PA; 1563 NAME_TYPE portName; 1564 NAME_TYPE nodeName; 1565 uint32_t DID; 1566 } ADISC; 1567 1568 1569 typedef struct _FARP 1570 { /* Structure is in Big Endian format */ 1571 uint32_t Mflags:8; 1572 uint32_t Odid:24; 1573 #define FARP_NO_ACTION 0 /* FARP information enclosed, no action */ 1574 #define FARP_MATCH_PORT 0x1 /* Match on Responder Port Name */ 1575 #define FARP_MATCH_NODE 0x2 /* Match on Responder Node Name */ 1576 #define FARP_MATCH_IP 0x4 /* Match on IP address, not supported */ 1577 #define FARP_MATCH_IPV4 0x5 /* Match on IPV4 address, not supported */ 1578 #define FARP_MATCH_IPV6 0x6 /* Match on IPV6 address, not supported */ 1579 uint32_t Rflags:8; 1580 uint32_t Rdid:24; 1581 #define FARP_REQUEST_PLOGI 0x1 /* Request for PLOGI */ 1582 #define FARP_REQUEST_FARPR 0x2 /* Request for FARP Response */ 1583 NAME_TYPE OportName; 1584 NAME_TYPE OnodeName; 1585 NAME_TYPE RportName; 1586 NAME_TYPE RnodeName; 1587 uint8_t Oipaddr[16]; 1588 uint8_t Ripaddr[16]; 1589 } FARP; 1590 1591 typedef struct _FAN 1592 { /* Structure is in Big Endian format */ 1593 uint32_t Fdid; 1594 NAME_TYPE FportName; 1595 NAME_TYPE FnodeName; 1596 } FAN; 1597 1598 typedef struct _SCR 1599 { /* Structure is in Big Endian format */ 1600 uint8_t resvd1; 1601 uint8_t resvd2; 1602 uint8_t resvd3; 1603 uint8_t Function; 1604 #define SCR_FUNC_FABRIC 0x01 1605 #define SCR_FUNC_NPORT 0x02 1606 #define SCR_FUNC_FULL 0x03 1607 #define SCR_CLEAR 0xff 1608 } SCR; 1609 1610 typedef struct _RNID_TOP_DISC 1611 { 1612 NAME_TYPE portName; 1613 uint8_t resvd[8]; 1614 uint32_t unitType; 1615 #define RNID_HBA 0x7 1616 #define RNID_HOST 0xa 1617 #define RNID_DRIVER 0xd 1618 uint32_t physPort; 1619 uint32_t attachedNodes; 1620 uint16_t ipVersion; 1621 #define RNID_IPV4 0x1 1622 #define RNID_IPV6 0x2 1623 uint16_t UDPport; 1624 uint8_t ipAddr[16]; 1625 uint16_t resvd1; 1626 uint16_t flags; 1627 #define RNID_TD_SUPPORT 0x1 1628 #define RNID_LP_VALID 0x2 1629 } RNID_TOP_DISC; 1630 1631 typedef struct _RNID 1632 { /* Structure is in Big Endian format */ 1633 uint8_t Format; 1634 #define RNID_TOPOLOGY_DISC 0xdf 1635 uint8_t CommonLen; 1636 uint8_t resvd1; 1637 uint8_t SpecificLen; 1638 NAME_TYPE portName; 1639 NAME_TYPE nodeName; 1640 union 1641 { 1642 RNID_TOP_DISC topologyDisc; /* topology disc (0xdf) */ 1643 } un; 1644 } RNID; 1645 1646 typedef struct _RRQ 1647 { /* Structure is in Big Endian format */ 1648 uint32_t SID; 1649 uint16_t Oxid; 1650 uint16_t Rxid; 1651 uint8_t resv[32]; /* optional association hdr */ 1652 } RRQ; 1653 1654 1655 /* This is used for RSCN command */ 1656 typedef struct _D_ID 1657 { /* Structure is in Big Endian format */ 1658 union 1659 { 1660 uint32_t word; 1661 struct 1662 { 1663 #ifdef EMLXS_BIG_ENDIAN 1664 uint8_t resv; 1665 uint8_t domain; 1666 uint8_t area; 1667 uint8_t id; 1668 #endif 1669 #ifdef EMLXS_LITTLE_ENDIAN 1670 uint8_t id; 1671 uint8_t area; 1672 uint8_t domain; 1673 uint8_t resv; 1674 #endif 1675 } b; 1676 } un; 1677 } D_ID; 1678 1679 /* 1680 * Structure to define all ELS Payload types 1681 */ 1682 1683 typedef struct _ELS_PKT 1684 { /* Structure is in Big Endian format */ 1685 uint8_t elsCode; /* FC Word 0, bit 24:31 */ 1686 uint8_t elsByte1; 1687 uint8_t elsByte2; 1688 uint8_t elsByte3; 1689 union 1690 { 1691 LS_RJT lsRjt; /* Payload for LS_RJT */ 1692 SERV_PARM logi; /* Payload for PLOGI, FLOGI */ 1693 /* PDISC, ACC */ 1694 LOGO logo; /* Payload for PLOGO, FLOGO */ 1695 /* ACC */ 1696 PRLI prli; /* Payload for PRLI/ACC */ 1697 PRLO prlo; /* Payload for PRLO/ACC */ 1698 ADISC adisc; /* Payload for ADISC/ACC */ 1699 FARP farp; /* Payload for FARP/ACC */ 1700 FAN fan; /* Payload for FAN */ 1701 SCR scr; /* Payload for SCR/ACC */ 1702 RRQ rrq; /* Payload for RRQ */ 1703 RNID rnid; /* Payload for RNID */ 1704 uint8_t pad[128 - 4]; /* Pad out to payload of */ 1705 /* 128 bytes */ 1706 } un; 1707 } ELS_PKT; 1708 1709 1710 typedef struct 1711 { 1712 uint32_t bdeAddress; 1713 #ifdef EMLXS_BIG_ENDIAN 1714 uint32_t bdeReserved:4; 1715 uint32_t bdeAddrHigh:4; 1716 uint32_t bdeSize:24; 1717 #endif 1718 #ifdef EMLXS_LITTLE_ENDIAN 1719 uint32_t bdeSize:24; 1720 uint32_t bdeAddrHigh:4; 1721 uint32_t bdeReserved:4; 1722 #endif 1723 } ULP_BDE; 1724 1725 typedef struct ULP_BDE_64 1726 { /* SLI-2 */ 1727 union ULP_BDE_TUS 1728 { 1729 uint32_t w; 1730 struct 1731 { 1732 #ifdef EMLXS_BIG_ENDIAN 1733 uint32_t bdeFlags:8; /* BDE Flags 0 IS A */ 1734 /* SUPPORTED VALUE !! */ 1735 uint32_t bdeSize:24; /* buff size in bytes */ 1736 #endif 1737 #ifdef EMLXS_LITTLE_ENDIAN 1738 uint32_t bdeSize:24; /* buff size in bytes */ 1739 uint32_t bdeFlags:8; /* BDE Flags 0 IS A */ 1740 /* SUPPORTED VALUE !! */ 1741 #endif 1742 #define BUFF_USE_RSVD 0x01 /* bdeFlags */ 1743 #define BUFF_USE_INTRPT 0x02 /* Not Implemented with LP6000 */ 1744 #define BUFF_USE_CMND 0x04 /* Optional, 1=cmd/rsp 0=data buffer */ 1745 #define BUFF_USE_RCV 0x08 /* "" "", 1=rcv buffer, */ 1746 /* 0=xmit buffer */ 1747 #define BUFF_TYPE_32BIT 0x10 /* "" "", 1=32 bit addr */ 1748 /* 0=64 bit addr */ 1749 #define BUFF_TYPE_SPECIAL 0x20 /* Not Implemented with LP6000 */ 1750 #define BUFF_TYPE_BDL 0x40 /* Optional, may be set in BDL */ 1751 #define BUFF_TYPE_INVALID 0x80 /* "" "" */ 1752 } f; 1753 } tus; 1754 uint32_t addrLow; 1755 uint32_t addrHigh; 1756 } ULP_BDE64; 1757 1758 #define BDE64_SIZE_WORD 0 1759 #define BPL64_SIZE_WORD 0x40 1760 1761 /* ULP */ 1762 typedef struct ULP_BPL_64 1763 { 1764 ULP_BDE64 fccmd_payload; 1765 ULP_BDE64 fcrsp_payload; 1766 ULP_BDE64 fcdat_payload; 1767 ULP_BDE64 pat0; 1768 } ULP_BPL64; 1769 1770 typedef struct ULP_BDL 1771 { /* SLI-2 */ 1772 #ifdef EMLXS_BIG_ENDIAN 1773 uint32_t bdeFlags:8; /* BDL Flags */ 1774 uint32_t bdeSize:24; /* Size of BDL array in host */ 1775 /* memory (bytes) */ 1776 #endif 1777 #ifdef EMLXS_LITTLE_ENDIAN 1778 uint32_t bdeSize:24; /* Size of BDL array in host */ 1779 /* memory (bytes) */ 1780 uint32_t bdeFlags:8; /* BDL Flags */ 1781 #endif 1782 uint32_t addrLow; /* Address 0:31 */ 1783 uint32_t addrHigh; /* Address 32:63 */ 1784 uint32_t ulpIoTag32; /* Can be used for 32 bit I/O Tag */ 1785 } ULP_BDL; 1786 1787 typedef struct ULP_SGE_64 1788 { /* SLI-4 */ 1789 uint32_t addrHigh; /* Address 32:63 */ 1790 uint32_t addrLow; /* Address 0:31 */ 1791 #ifdef EMLXS_BIG_ENDIAN 1792 uint32_t last:1; /* Last entry in SGL */ 1793 uint32_t reserved:11; 1794 uint32_t offset:20; 1795 #endif 1796 #ifdef EMLXS_LITTLE_ENDIAN 1797 uint32_t offset:20; 1798 uint32_t reserved:11; 1799 uint32_t last:1; /* Last entry in SGL */ 1800 #endif 1801 uint32_t length; 1802 #define EMLXS_MAX_SGE_SIZE 0x10000 /* 64K max length */ 1803 } ULP_SGE64; 1804 1805 1806 typedef struct _BE_PHYS_ADDR 1807 { 1808 uint32_t addrLow; 1809 uint32_t addrHigh; 1810 } BE_PHYS_ADDR; 1811 1812 1813 typedef struct 1814 { 1815 void *fc_mptr; 1816 struct emlxs_memseg *segment; /* Parent segment */ 1817 1818 void *virt; /* virtual address ptr */ 1819 uint64_t phys; /* mapped address */ 1820 uint32_t size; 1821 1822 void *data_handle; 1823 void *dma_handle; 1824 uint32_t tag; 1825 uint32_t flag; 1826 #define MAP_POOL_ALLOCATED 0x00000001 1827 #define MAP_BUF_ALLOCATED 0x00000002 1828 #define MAP_TABLE_ALLOCATED 0x00000004 1829 } MATCHMAP; 1830 1831 1832 /* 1833 * This file defines the Header File for the FDMI HBA Management Service 1834 */ 1835 1836 /* 1837 * FDMI HBA MAnagement Operations Command Codes 1838 */ 1839 #define SLI_MGMT_GRHL 0x100 /* Get registered HBA list */ 1840 #define SLI_MGMT_GHAT 0x101 /* Get HBA attributes */ 1841 #define SLI_MGMT_GRPL 0x102 /* Get registered Port list */ 1842 #define SLI_MGMT_GPAT 0x110 /* Get Port attributes */ 1843 #define SLI_MGMT_RHBA 0x200 /* Register HBA */ 1844 #define SLI_MGMT_RHAT 0x201 /* Register HBA atttributes */ 1845 #define SLI_MGMT_RPRT 0x210 /* Register Port */ 1846 #define SLI_MGMT_RPA 0x211 /* Register Port attributes */ 1847 #define SLI_MGMT_DHBA 0x300 /* De-register HBA */ 1848 #define SLI_MGMT_DPRT 0x310 /* De-register Port */ 1849 1850 /* 1851 * Management Service Subtypes 1852 */ 1853 #define SLI_CT_FDMI_SUBTYPES 0x10 1854 1855 1856 /* 1857 * HBA Management Service Reject Code 1858 */ 1859 #define REJECT_CODE 0x9 /* Unable to perform command request */ 1860 1861 /* 1862 * HBA Management Service Reject Reason Code 1863 * Please refer to the Reason Codes above 1864 */ 1865 1866 /* 1867 * HBA Attribute Types 1868 */ 1869 #define NODE_NAME 0x1 1870 #define MANUFACTURER 0x2 1871 #define SERIAL_NUMBER 0x3 1872 #define MODEL 0x4 1873 #define MODEL_DESCRIPTION 0x5 1874 #define HARDWARE_VERSION 0x6 1875 #define DRIVER_VERSION 0x7 1876 #define OPTION_ROM_VERSION 0x8 1877 #define FIRMWARE_VERSION 0x9 1878 #define VENDOR_SPECIFIC 0xa 1879 #define DRV_NAME 0xb 1880 #define OS_NAME_VERSION 0xc 1881 #define MAX_CT_PAYLOAD_LEN 0xd 1882 1883 /* 1884 * Port Attrubute Types 1885 */ 1886 #define SUPPORTED_FC4_TYPES 0x1 1887 #define SUPPORTED_SPEED 0x2 1888 #define PORT_SPEED 0x3 1889 #define MAX_FRAME_SIZE 0x4 1890 #define OS_DEVICE_NAME 0x5 1891 1892 union AttributesDef 1893 { 1894 /* Structure is in Big Endian format */ 1895 struct 1896 { 1897 uint32_t AttrType:16; 1898 uint32_t AttrLen:16; 1899 } bits; 1900 uint32_t word; 1901 }; 1902 1903 /* 1904 * HBA Attribute Entry (8 - 260 bytes) 1905 */ 1906 typedef struct 1907 { 1908 union AttributesDef ad; 1909 union 1910 { 1911 uint32_t VendorSpecific; 1912 uint32_t SupportSpeed; 1913 uint32_t PortSpeed; 1914 uint32_t MaxFrameSize; 1915 uint32_t MaxCTPayloadLen; 1916 uint8_t SupportFC4Types[32]; 1917 uint8_t OsDeviceName[256]; 1918 uint8_t Manufacturer[64]; 1919 uint8_t SerialNumber[64]; 1920 uint8_t Model[256]; 1921 uint8_t ModelDescription[256]; 1922 uint8_t HardwareVersion[256]; 1923 uint8_t DriverVersion[256]; 1924 uint8_t OptionROMVersion[256]; 1925 uint8_t FirmwareVersion[256]; 1926 uint8_t DriverName[256]; 1927 NAME_TYPE NodeName; 1928 } un; 1929 } ATTRIBUTE_ENTRY, *PATTRIBUTE_ENTRY; 1930 1931 1932 /* 1933 * HBA Attribute Block 1934 */ 1935 typedef struct 1936 { 1937 uint32_t EntryCnt; /* Number of HBA attribute entries */ 1938 ATTRIBUTE_ENTRY Entry; /* Variable-length array */ 1939 } ATTRIBUTE_BLOCK, *PATTRIBUTE_BLOCK; 1940 1941 1942 /* 1943 * Port Entry 1944 */ 1945 typedef struct 1946 { 1947 NAME_TYPE PortName; 1948 } PORT_ENTRY, *PPORT_ENTRY; 1949 1950 /* 1951 * HBA Identifier 1952 */ 1953 typedef struct 1954 { 1955 NAME_TYPE PortName; 1956 } HBA_IDENTIFIER, *PHBA_IDENTIFIER; 1957 1958 /* 1959 * Registered Port List Format 1960 */ 1961 typedef struct 1962 { 1963 uint32_t EntryCnt; 1964 PORT_ENTRY pe; /* Variable-length array */ 1965 } REG_PORT_LIST, *PREG_PORT_LIST; 1966 1967 /* 1968 * Register HBA(RHBA) 1969 */ 1970 typedef struct 1971 { 1972 HBA_IDENTIFIER hi; 1973 REG_PORT_LIST rpl; /* variable-length array */ 1974 } REG_HBA, *PREG_HBA; 1975 1976 /* 1977 * Register HBA Attributes (RHAT) 1978 */ 1979 typedef struct 1980 { 1981 NAME_TYPE HBA_PortName; 1982 ATTRIBUTE_BLOCK ab; 1983 } REG_HBA_ATTRIBUTE, *PREG_HBA_ATTRIBUTE; 1984 1985 /* 1986 * Register Port Attributes (RPA) 1987 */ 1988 typedef struct 1989 { 1990 NAME_TYPE HBA_PortName; 1991 NAME_TYPE PortName; 1992 ATTRIBUTE_BLOCK ab; 1993 } REG_PORT_ATTRIBUTE, *PREG_PORT_ATTRIBUTE; 1994 1995 /* 1996 * Get Registered HBA List (GRHL) Accept Payload Format 1997 */ 1998 typedef struct 1999 { 2000 uint32_t HBA__Entry_Cnt; /* Number of Registered HBA Ids */ 2001 NAME_TYPE HBA_PortName; /* Variable-length array */ 2002 } GRHL_ACC_PAYLOAD, *PGRHL_ACC_PAYLOAD; 2003 2004 /* 2005 * Get Registered Port List (GRPL) Accept Payload Format 2006 */ 2007 typedef struct 2008 { 2009 uint32_t RPL_Entry_Cnt; /* No of Reg Port Entries */ 2010 PORT_ENTRY eg_Port_Entry[1]; /* Variable-length array */ 2011 } GRPL_ACC_PAYLOAD, *PGRPL_ACC_PAYLOAD; 2012 2013 /* 2014 * Get Port Attributes (GPAT) Accept Payload Format 2015 */ 2016 2017 typedef struct 2018 { 2019 ATTRIBUTE_BLOCK pab; 2020 } GPAT_ACC_PAYLOAD, *PGPAT_ACC_PAYLOAD; 2021 2022 /* 2023 * Use for Firmware DownLoad 2024 */ 2025 2026 /* download.h */ 2027 2028 #define REDUCED_SRAM_CFG 0x7FFFC /* 9802DC */ 2029 #define FULL_SRAM_CFG 0x13FFFC /* 9802 */ 2030 2031 #define SLI_FW_TYPE_SHIFT(x) ((x << 20)) 2032 #define SLI_FW_ADAPTER_TYPE_MASK 0x00f00000 2033 #define SLI_FW_TYPE_6000 SLI_FW_TYPE_SHIFT(0) 2034 #define SLI_FW_TYPE_7000 SLI_FW_TYPE_SHIFT(1) 2035 #define SLI_FW_TYPE_8000 SLI_FW_TYPE_SHIFT(2) 2036 #define SLI_FW_TYPE_850 SLI_FW_TYPE_SHIFT(3) 2037 #define SLI_FW_TYPE_9000 SLI_FW_TYPE_SHIFT(4) 2038 #define SLI_FW_TYPE_950 SLI_FW_TYPE_SHIFT(5) 2039 #define SLI_FW_TYPE_9802 SLI_FW_TYPE_SHIFT(6) /* [022702] */ 2040 #define SLI_FW_TYPE_982 SLI_FW_TYPE_SHIFT(7) 2041 #define SLI_FW_TYPE_10000 SLI_FW_TYPE_SHIFT(8) 2042 #define SLI_FW_TYPE_1050 SLI_FW_TYPE_SHIFT(9) 2043 #define SLI_FW_TYPE_X1000 SLI_FW_TYPE_SHIFT(0xa) 2044 #define SLI_FW_TYPE_101 SLI_FW_TYPE_SHIFT(0xb) /* LP101 */ 2045 2046 2047 enum emlxs_prog_type 2048 { 2049 TEST_PROGRAM, /* 0 */ 2050 UTIL_PROGRAM, /* 1 */ 2051 FUNC_FIRMWARE, /* 2 */ 2052 BOOT_BIOS, /* 3 */ 2053 CONFIG_DATA, /* 4 */ 2054 SEQUENCER_CODE, /* 5 */ 2055 SLI1_OVERLAY, /* 6 */ 2056 SLI2_OVERLAY, /* 7 */ 2057 GASKET, /* 8 */ 2058 HARDWARE_IMAGE, /* 9 */ 2059 SBUS_FCODE, /* A */ 2060 SLI3_OVERLAY, /* B */ 2061 RESERVED_C, 2062 RESERVED_D, 2063 SLI4_OVERLAY, /* E */ 2064 KERNEL_CODE, /* F */ 2065 MAX_PROG_TYPES 2066 } emlxs_prog_type_t; 2067 2068 2069 typedef struct emlxs_fw_file 2070 { 2071 uint32_t version; 2072 uint32_t revcomp; 2073 char label[16]; 2074 uint32_t offset; 2075 } emlxs_fw_file_t; 2076 2077 typedef struct emlxs_fw_image 2078 { 2079 emlxs_fw_file_t awc; 2080 emlxs_fw_file_t bwc; 2081 emlxs_fw_file_t dwc; 2082 emlxs_fw_file_t prog[MAX_PROG_TYPES]; 2083 } emlxs_fw_image_t; 2084 2085 2086 2087 #define NOP_IMAGE_TYPE 0xe1a00000 2088 2089 #define FLASH_BASE_ADR 0x01400000 2090 #define DL_FROM_SLIM_OFFSET MBOX_EXTENSION_OFFSET 2091 2092 #ifdef MBOX_EXT_SUPPORT 2093 #define DL_SLIM_SEG_BYTE_COUNT MBOX_EXTENSION_SIZE 2094 #else 2095 #define DL_SLIM_SEG_BYTE_COUNT 128 2096 #endif /* MBOX_EXT_SUPPORT */ 2097 2098 #define SLI_CKSUM_LENGTH 4 2099 #define SLI_CKSUM_SEED 0x55555555 2100 #define SLI_CKSUM_ERR 0x1982abcd 2101 2102 #define AIF_NOOP 0xe1a00000 2103 #define AIF_BLAL 0xeb000000 2104 #define OS_EXIT 0xef000011 2105 #define OS_GETENV 0xef000010 2106 #define AIF_IMAGEBASE 0x00008000 2107 #define AIF_BLZINIT 0xeb00000c 2108 #define DEBUG_TASK 0xef041d41 2109 #define AIF_DBG_SRC 2 2110 #define AIF_DBG_LL 1 2111 #define AIF_DATABASAT 0x100 2112 2113 #define JEDEC_ID_ADDRESS 0x0080001c 2114 #define MAX_RBUS_SRAM_SIZE_ADR 0x788 2115 #define MAX_IBUS_SRAM_SIZE_ADR 0x78c 2116 #define FULL_RBUS_SRAM_CFG 0x7fffc 2117 #define FULL_IBUS_SRAM_CFG 0x187fffc 2118 #define REDUCED_RBUS_SRAM_CFG 0x5fffc 2119 #define REDUCED_IBUS_SRAM_CFG 0x183fffc 2120 2121 #define FULL_SRAM_CFG_PROG_ID 1 2122 #define REDUCED_SRAM_CFG_PROG_ID 2 2123 #define OTHER_SRAM_CFG_PROG_ID 3 2124 2125 #define NO_FLASH_MEM_AVAIL 0xf1 2126 2127 #define PROG_TYPE_MASK 0xff000000 2128 #define PROG_TYPE_SHIFT 24 2129 2130 #define FLASH_LOAD_LIST_ADR 0x79c 2131 #define RAM_LOAD_ENTRY_SIZE 9 2132 #define FLASH_LOAD_ENTRY_SIZE 6 2133 #define RAM_LOAD_ENTRY_TYPE 0 2134 #define FLASH_LOAD_ENTRY_TYPE 1 2135 2136 #define CFG_DATA_NO_REGION -3 2137 2138 #define SLI_IMAGE_START 0x20080 2139 #define SLI_VERSION_LOC 0x270 2140 2141 2142 #define SLI_HW_REVISION_CHECK(x, y) ((x & 0xf0) == y) 2143 #define SLI_FCODE_REVISION_CHECK(x, y) (x == y) 2144 2145 2146 /* ************ BladeEngine ************** */ 2147 #define BE_SIGNATURE "ServerEngines" 2148 #define BE_DIR_SIGNATURE "*** SE FLAS" 2149 #define BE_BUILD_SIZE 24 2150 #define BE_VERSION_SIZE 32 2151 #define BE_COOKIE_SIZE 32 2152 #define BE_CONTROLLER_SIZE 8 2153 #define BE_FLASH_ENTRIES 32 2154 #define BE_MAX_XFER_SIZE 32768 /* 4K aligned */ 2155 2156 /* ************** BE3 **************** */ 2157 #define BE3_SIGNATURE_SIZE 52 2158 #define BE3_MAX_IMAGE_HEADERS 32 2159 2160 typedef struct emlxs_be3_image_header 2161 { 2162 uint32_t id; 2163 #define UFI_BE3_FLASH_ID 0x01 2164 2165 uint32_t offset; 2166 uint32_t length; 2167 uint32_t checksum; 2168 uint8_t version[BE_VERSION_SIZE]; 2169 2170 } emlxs_be3_image_header_t; 2171 2172 typedef struct emlxs_be3_ufi_header 2173 { 2174 char signature[BE3_SIGNATURE_SIZE]; 2175 uint32_t ufi_version; 2176 uint32_t file_length; 2177 uint32_t checksum; 2178 uint32_t antidote; 2179 uint32_t image_cnt; 2180 char build[BE_BUILD_SIZE]; 2181 uint8_t resv1[32]; 2182 2183 } emlxs_be3_ufi_header_t; 2184 2185 typedef struct emlxs_be3_ufi_controller 2186 { 2187 uint32_t vendor_id; 2188 uint32_t device_id; 2189 uint32_t sub_vendor_id; 2190 uint32_t sub_device_id; 2191 2192 } emlxs_be3_ufi_controller_t; 2193 2194 typedef struct emlxs_be3_flash_header 2195 { 2196 uint32_t format_rev; 2197 uint32_t checksum; 2198 uint32_t antidote; 2199 uint32_t entry_count; 2200 emlxs_be3_ufi_controller_t controller[BE_CONTROLLER_SIZE]; 2201 uint32_t resv0; 2202 uint32_t resv1; 2203 uint32_t resv2; 2204 uint32_t resv3; 2205 } emlxs_be3_flash_header_t; 2206 2207 typedef struct emlxs_be3_flash_entry 2208 { 2209 uint32_t type; 2210 uint32_t offset; 2211 uint32_t block_size; 2212 uint32_t image_size; 2213 uint32_t checksum; 2214 uint32_t entry_point; 2215 uint32_t resv0; 2216 uint32_t resv1; 2217 char version[BE_VERSION_SIZE]; 2218 2219 } emlxs_be3_flash_entry_t; 2220 2221 typedef struct emlxs_be3_flash_dir 2222 { 2223 char cookie[BE_COOKIE_SIZE]; 2224 emlxs_be3_flash_header_t header; 2225 emlxs_be3_flash_entry_t entry[BE_FLASH_ENTRIES]; 2226 2227 } emlxs_be3_flash_dir_t; 2228 2229 typedef struct emlxs_be3_ncsi_header { 2230 uint32_t magic; 2231 uint8_t hdr_len; 2232 uint8_t type; 2233 uint16_t hdr_ver; 2234 uint16_t rsvd0; 2235 uint16_t load_offset; 2236 uint32_t len; 2237 uint32_t flash_offset; 2238 uint8_t ver[16]; 2239 uint8_t name[24]; 2240 uint32_t img_cksum; 2241 uint32_t rsvd1; 2242 uint32_t hdr_cksum; 2243 } emlxs_be3_ncsi_header_t; 2244 2245 2246 /* ************** BE2 **************** */ 2247 #define BE2_SIGNATURE_SIZE 32 2248 2249 2250 typedef struct emlxs_be2_ufi_controller 2251 { 2252 uint32_t vendor_id; 2253 uint32_t device_id; 2254 uint32_t sub_vendor_id; 2255 uint32_t sub_device_id; 2256 2257 } emlxs_be2_ufi_controller_t; 2258 2259 typedef struct emlxs_be2_ufi_header 2260 { 2261 char signature[BE2_SIGNATURE_SIZE]; 2262 uint32_t checksum; 2263 uint32_t antidote; 2264 emlxs_be2_ufi_controller_t controller; 2265 uint32_t file_length; 2266 uint32_t chunk_num; 2267 uint32_t chunk_cnt; 2268 uint32_t image_cnt; 2269 char build[BE_BUILD_SIZE]; 2270 2271 } emlxs_be2_ufi_header_t; 2272 2273 typedef struct emlxs_be2_flash_header /* 96 bytes */ 2274 { 2275 uint32_t format_rev; 2276 uint32_t checksum; 2277 uint32_t antidote; 2278 uint32_t build_num; 2279 emlxs_be2_ufi_controller_t controller[BE_CONTROLLER_SIZE]; 2280 uint32_t active_entry_mask; 2281 uint32_t valid_entry_mask; 2282 uint32_t orig_content_mask; 2283 uint32_t resv0; 2284 uint32_t resv1; 2285 uint32_t resv2; 2286 uint32_t resv3; 2287 uint32_t resv4; 2288 2289 } emlxs_be2_flash_header_t; 2290 2291 typedef struct emlxs_be2_flash_entry 2292 { 2293 uint32_t type; 2294 uint32_t offset; 2295 uint32_t pad_size; 2296 uint32_t image_size; 2297 uint32_t checksum; 2298 uint32_t entry_point; 2299 uint32_t resv0; 2300 uint32_t resv1; 2301 char version[BE_VERSION_SIZE]; 2302 2303 } emlxs_be2_flash_entry_t; 2304 2305 typedef struct emlxs_be2_flash_dir 2306 { 2307 char cookie[BE_COOKIE_SIZE]; 2308 emlxs_be2_flash_header_t header; 2309 emlxs_be2_flash_entry_t entry[BE_FLASH_ENTRIES]; 2310 2311 } emlxs_be2_flash_dir_t; 2312 2313 2314 /* FLASH ENTRY TYPES */ 2315 #define BE_FLASHTYPE_NCSI_FIRMWARE 0x10 /* BE3 */ 2316 #define BE_FLASHTYPE_PXE_BIOS 0x20 2317 #define BE_FLASHTYPE_FCOE_BIOS 0x21 2318 #define BE_FLASHTYPE_ISCSI_BIOS 0x22 2319 #define BE_FLASHTYPE_FLASH_ISM 0x30 /* BE3 */ 2320 #define BE_FLASHTYPE_ISCSI_FIRMWARE 0xA0 2321 #define BE_FLASHTYPE_ISCSI_BACKUP 0xB0 2322 #define BE_FLASHTYPE_FCOE_FIRMWARE 0xA2 2323 #define BE_FLASHTYPE_FCOE_BACKUP 0xB2 2324 #define BE_FLASHTYPE_REDBOOT 0xE0 2325 2326 /* Flash types in download order */ 2327 typedef enum emlxs_be_flashtypes 2328 { 2329 NCSI_FIRMWARE_FLASHTYPE, 2330 ISCSI_FIRMWARE_FLASHTYPE, 2331 ISCSI_BACKUP_FLASHTYPE, 2332 FCOE_FIRMWARE_FLASHTYPE, 2333 FCOE_BACKUP_FLASHTYPE, 2334 ISCSI_BIOS_FLASHTYPE, 2335 FCOE_BIOS_FLASHTYPE, 2336 PXE_BIOS_FLASHTYPE, 2337 REDBOOT_FLASHTYPE, 2338 BE_MAX_FLASHTYPES 2339 2340 } emlxs_be_flashtypes_t; 2341 2342 /* Driver level constructs */ 2343 typedef struct emlxs_be_fw_file 2344 { 2345 uint32_t be_version; 2346 uint32_t ufi_plus; 2347 2348 uint32_t type; 2349 uint32_t image_offset; 2350 uint32_t image_size; 2351 uint32_t block_size; 2352 uint32_t block_crc; 2353 uint32_t load_address; /* BE3 */ 2354 char label[BE_VERSION_SIZE]; 2355 } emlxs_be_fw_file_t; 2356 2357 typedef struct emlxs_be_fw_image 2358 { 2359 uint32_t be_version; 2360 uint32_t ufi_plus; 2361 2362 uint32_t fcoe_version; 2363 char fcoe_label[BE_VERSION_SIZE]; 2364 2365 uint32_t iscsi_version; 2366 char iscsi_label[BE_VERSION_SIZE]; 2367 2368 emlxs_be_fw_file_t file[BE_MAX_FLASHTYPES]; 2369 } emlxs_be_fw_image_t; 2370 2371 #ifdef __cplusplus 2372 } 2373 #endif 2374 2375 #endif /* _EMLXS_HW_H */ 2376