2 * QLogic Fibre Channel HBA Driver
3 * Copyright (c) 2003-2005 QLogic Corporation
5 * See LICENSE.qla2xxx for copyright and licensing details.
10 #define MBS_CHECKSUM_ERROR 0x4010
15 #define FO1_ENABLE_PUREX BIT_10
16 #define FO1_DISABLE_LED_CTRL BIT_6
17 #define FO2_ENABLE_SEL_CLASS2 BIT_5
18 #define FO3_NO_ABTS_ON_LINKDOWN BIT_14
21 * Port Database structure definition for ISP 24xx.
23 #define PDO_FORCE_ADISC BIT_1
24 #define PDO_FORCE_PLOGI BIT_0
27 #define PORT_DATABASE_24XX_SIZE 64
28 struct port_database_24xx {
30 #define PDF_TASK_RETRY_ID BIT_14
31 #define PDF_FC_TAPE BIT_7
32 #define PDF_ACK0_CAPABLE BIT_6
33 #define PDF_FCP2_CONF BIT_5
34 #define PDF_CLASS_2 BIT_4
35 #define PDF_HARD_ADDR BIT_1
37 uint8_t current_login_state;
38 uint8_t last_login_state;
39 #define PDS_PLOGI_PENDING 0x03
40 #define PDS_PLOGI_COMPLETE 0x04
41 #define PDS_PRLI_PENDING 0x05
42 #define PDS_PRLI_COMPLETE 0x06
43 #define PDS_PORT_UNAVAILABLE 0x07
44 #define PDS_PRLO_PENDING 0x09
45 #define PDS_LOGO_PENDING 0x11
46 #define PDS_PRLI2_PENDING 0x12
48 uint8_t hard_address[3];
56 uint16_t nport_handle; /* N_PORT handle. */
58 uint16_t receive_data_size;
61 uint8_t prli_svc_param_word_0[2]; /* Big endian */
62 /* Bits 15-0 of word 0 */
63 uint8_t prli_svc_param_word_3[2]; /* Big endian */
64 /* Bits 15-0 of word 3 */
66 uint8_t port_name[WWN_SIZE];
67 uint8_t node_name[WWN_SIZE];
69 uint8_t reserved_3[24];
75 uint16_t nvram_version;
78 /* Firmware Initialization Control Block. */
81 uint16_t frame_payload_size;
82 uint16_t execution_throttle;
83 uint16_t exchange_count;
84 uint16_t hard_address;
86 uint8_t port_name[WWN_SIZE];
87 uint8_t node_name[WWN_SIZE];
89 uint16_t login_retry_count;
90 uint16_t link_down_on_nos;
91 uint16_t interrupt_delay_timer;
92 uint16_t login_timeout;
94 uint32_t firmware_options_1;
95 uint32_t firmware_options_2;
96 uint32_t firmware_options_3;
101 * BIT 0 = Control Enable
105 * BIT 8-10 = Output Swing 1G
106 * BIT 11-13 = Output Emphasis 1G
107 * BIT 14-15 = Reserved
110 * BIT 8-10 = Output Swing 2G
111 * BIT 11-13 = Output Emphasis 2G
112 * BIT 14-15 = Reserved
115 * BIT 8-10 = Output Swing 4G
116 * BIT 11-13 = Output Emphasis 4G
117 * BIT 14-15 = Reserved
119 uint16_t seriallink_options[4];
121 uint16_t reserved_2[16];
124 uint16_t reserved_3[16];
126 /* PCIe table entries. */
127 uint16_t reserved_4[16];
130 uint16_t reserved_5[16];
133 uint16_t reserved_6[16];
136 uint16_t reserved_7[16];
139 * BIT 0 = Enable spinup delay
140 * BIT 1 = Disable BIOS
141 * BIT 2 = Enable Memory Map BIOS
142 * BIT 3 = Enable Selectable Boot
143 * BIT 4 = Disable RISC code load
144 * BIT 5 = Disable Serdes
150 * BIT 10 = Enable lip full login
151 * BIT 11 = Enable target reset
155 * BIT 15 = Enable alternate WWN
161 uint8_t alternate_port_name[WWN_SIZE];
162 uint8_t alternate_node_name[WWN_SIZE];
164 uint8_t boot_port_name[WWN_SIZE];
165 uint16_t boot_lun_number;
168 uint8_t alt1_boot_port_name[WWN_SIZE];
169 uint16_t alt1_boot_lun_number;
172 uint8_t alt2_boot_port_name[WWN_SIZE];
173 uint16_t alt2_boot_lun_number;
174 uint16_t reserved_10;
176 uint8_t alt3_boot_port_name[WWN_SIZE];
177 uint16_t alt3_boot_lun_number;
178 uint16_t reserved_11;
181 * BIT 0 = Selective Login
182 * BIT 1 = Alt-Boot Enable
184 * BIT 3 = Boot Order List
186 * BIT 5 = Selective LUN
190 uint32_t efi_parameters;
194 uint16_t reserved_13;
196 uint16_t boot_id_number;
197 uint16_t reserved_14;
199 uint16_t max_luns_per_target;
200 uint16_t reserved_15;
202 uint16_t port_down_retry_count;
203 uint16_t link_down_timeout;
205 /* FCode parameters. */
206 uint16_t fcode_parameter;
208 uint16_t reserved_16[3];
211 uint8_t prev_drv_ver_major;
212 uint8_t prev_drv_ver_submajob;
213 uint8_t prev_drv_ver_minor;
214 uint8_t prev_drv_ver_subminor;
216 uint16_t prev_bios_ver_major;
217 uint16_t prev_bios_ver_minor;
219 uint16_t prev_efi_ver_major;
220 uint16_t prev_efi_ver_minor;
222 uint16_t prev_fw_ver_major;
223 uint8_t prev_fw_ver_minor;
224 uint8_t prev_fw_ver_subminor;
226 uint16_t reserved_17[8];
229 uint16_t reserved_18[16];
232 uint16_t reserved_19[16];
235 uint16_t reserved_20[16];
238 uint8_t model_name[16];
240 uint16_t reserved_21[2];
243 /* HW Parameter Block. */
244 uint16_t pcie_table_sig;
245 uint16_t pcie_table_offset;
247 uint16_t subsystem_vendor_id;
248 uint16_t subsystem_device_id;
254 * ISP Initialization Control Block.
255 * Little endian except where noted.
257 #define ICB_VERSION 1
258 struct init_cb_24xx {
262 uint16_t frame_payload_size;
263 uint16_t execution_throttle;
264 uint16_t exchange_count;
266 uint16_t hard_address;
268 uint8_t port_name[WWN_SIZE]; /* Big endian. */
269 uint8_t node_name[WWN_SIZE]; /* Big endian. */
271 uint16_t response_q_inpointer;
272 uint16_t request_q_outpointer;
274 uint16_t login_retry_count;
276 uint16_t prio_request_q_outpointer;
278 uint16_t response_q_length;
279 uint16_t request_q_length;
281 uint16_t link_down_on_nos; /* Milliseconds. */
283 uint16_t prio_request_q_length;
285 uint32_t request_q_address[2];
286 uint32_t response_q_address[2];
287 uint32_t prio_request_q_address[2];
289 uint8_t reserved_2[8];
291 uint16_t atio_q_inpointer;
292 uint16_t atio_q_length;
293 uint32_t atio_q_address[2];
295 uint16_t interrupt_delay_timer; /* 100us increments. */
296 uint16_t login_timeout;
299 * BIT 0 = Enable Hard Loop Id
300 * BIT 1 = Enable Fairness
301 * BIT 2 = Enable Full-Duplex
303 * BIT 4 = Enable Target Mode
304 * BIT 5 = Disable Initiator Mode
309 * BIT 9 = Non Participating LIP
310 * BIT 10 = Descending Loop ID Search
311 * BIT 11 = Acquire Loop ID in LIPA
313 * BIT 13 = Full Login after LIP
314 * BIT 14 = Node Name Option
315 * BIT 15-31 = Reserved
317 uint32_t firmware_options_1;
320 * BIT 0 = Operation Mode bit 0
321 * BIT 1 = Operation Mode bit 1
322 * BIT 2 = Operation Mode bit 2
323 * BIT 3 = Operation Mode bit 3
324 * BIT 4 = Connection Options bit 0
325 * BIT 5 = Connection Options bit 1
326 * BIT 6 = Connection Options bit 2
327 * BIT 7 = Enable Non part on LIHA failure
329 * BIT 8 = Enable Class 2
330 * BIT 9 = Enable ACK0
332 * BIT 11 = Enable FC-SP Security
333 * BIT 12 = FC Tape Enable
334 * BIT 13-31 = Reserved
336 uint32_t firmware_options_2;
340 * BIT 1 = Soft ID only
343 * BIT 4 = FCP RSP Payload bit 0
344 * BIT 5 = FCP RSP Payload bit 1
345 * BIT 6 = Enable Receive Out-of-Order data frame handling
346 * BIT 7 = Disable Automatic PLOGI on Local Loop
349 * BIT 9 = Enable Out-of-Order FCP_XFER_RDY relative offset handling
353 * BIT 13 = Data Rate bit 0
354 * BIT 14 = Data Rate bit 1
355 * BIT 15 = Data Rate bit 2
356 * BIT 16-31 = Reserved
358 uint32_t firmware_options_3;
360 uint8_t reserved_3[24];
364 * ISP queue - command entry structure definition.
366 #define COMMAND_TYPE_6 0x48 /* Command Type 6 entry */
368 uint8_t entry_type; /* Entry type. */
369 uint8_t entry_count; /* Entry count. */
370 uint8_t sys_define; /* System defined. */
371 uint8_t entry_status; /* Entry Status. */
373 uint32_t handle; /* System handle. */
375 uint16_t nport_handle; /* N_PORT handle. */
376 uint16_t timeout; /* Command timeout. */
378 uint16_t dseg_count; /* Data segment count. */
380 uint16_t fcp_rsp_dsd_len; /* FCP_RSP DSD length. */
382 struct scsi_lun lun; /* FCP LUN (BE). */
384 uint16_t control_flags; /* Control flags. */
385 #define CF_DATA_SEG_DESCR_ENABLE BIT_2
386 #define CF_READ_DATA BIT_1
387 #define CF_WRITE_DATA BIT_0
389 uint16_t fcp_cmnd_dseg_len; /* Data segment length. */
390 uint32_t fcp_cmnd_dseg_address[2]; /* Data segment address. */
392 uint32_t fcp_rsp_dseg_address[2]; /* Data segment address. */
394 uint32_t byte_count; /* Total byte count. */
396 uint8_t port_id[3]; /* PortID of destination port. */
399 uint32_t fcp_data_dseg_address[2]; /* Data segment address. */
400 uint16_t fcp_data_dseg_len; /* Data segment length. */
401 uint16_t reserved_1; /* MUST be set to 0. */
404 #define COMMAND_TYPE_7 0x18 /* Command Type 7 entry */
406 uint8_t entry_type; /* Entry type. */
407 uint8_t entry_count; /* Entry count. */
408 uint8_t sys_define; /* System defined. */
409 uint8_t entry_status; /* Entry Status. */
411 uint32_t handle; /* System handle. */
413 uint16_t nport_handle; /* N_PORT handle. */
414 uint16_t timeout; /* Command timeout. */
415 #define FW_MAX_TIMEOUT 0x1999
417 uint16_t dseg_count; /* Data segment count. */
420 struct scsi_lun lun; /* FCP LUN (BE). */
422 uint16_t task_mgmt_flags; /* Task management flags. */
423 #define TMF_CLEAR_ACA BIT_14
424 #define TMF_TARGET_RESET BIT_13
425 #define TMF_LUN_RESET BIT_12
426 #define TMF_CLEAR_TASK_SET BIT_10
427 #define TMF_ABORT_TASK_SET BIT_9
428 #define TMF_READ_DATA BIT_1
429 #define TMF_WRITE_DATA BIT_0
433 #define TSK_HEAD_OF_QUEUE 1
434 #define TSK_ORDERED 2
436 #define TSK_UNTAGGED 5
440 uint8_t fcp_cdb[MAX_CMDSZ]; /* SCSI command words. */
441 uint32_t byte_count; /* Total byte count. */
443 uint8_t port_id[3]; /* PortID of destination port. */
446 uint32_t dseg_0_address[2]; /* Data segment 0 address. */
447 uint32_t dseg_0_len; /* Data segment 0 length. */
451 * ISP queue - status entry structure definition.
453 #define STATUS_TYPE 0x03 /* Status entry. */
454 struct sts_entry_24xx {
455 uint8_t entry_type; /* Entry type. */
456 uint8_t entry_count; /* Entry count. */
457 uint8_t sys_define; /* System defined. */
458 uint8_t entry_status; /* Entry Status. */
460 uint32_t handle; /* System handle. */
462 uint16_t comp_status; /* Completion status. */
463 uint16_t ox_id; /* OX_ID used by the firmware. */
465 uint32_t residual_len; /* FW calc residual transfer length. */
468 uint16_t state_flags; /* State flags. */
469 #define SF_TRANSFERRED_DATA BIT_11
470 #define SF_FCP_RSP_DMA BIT_0
473 uint16_t scsi_status; /* SCSI status. */
474 #define SS_CONFIRMATION_REQ BIT_12
476 uint32_t rsp_residual_count; /* FCP RSP residual count. */
478 uint32_t sense_len; /* FCP SENSE length. */
479 uint32_t rsp_data_len; /* FCP response data length. */
481 uint8_t data[28]; /* FCP response/sense information. */
485 * Status entry completion status
487 #define CS_DATA_REASSEMBLY_ERROR 0x11 /* Data Reassembly Error.. */
488 #define CS_ABTS_BY_TARGET 0x13 /* Target send ABTS to abort IOCB. */
489 #define CS_FW_RESOURCE 0x2C /* Firmware Resource Unavailable. */
490 #define CS_TASK_MGMT_OVERRUN 0x30 /* Task management overrun (8+). */
491 #define CS_ABORT_BY_TARGET 0x47 /* Abort By Target. */
494 * ISP queue - marker entry structure definition.
496 #define MARKER_TYPE 0x04 /* Marker entry. */
497 struct mrk_entry_24xx {
498 uint8_t entry_type; /* Entry type. */
499 uint8_t entry_count; /* Entry count. */
500 uint8_t handle_count; /* Handle count. */
501 uint8_t entry_status; /* Entry Status. */
503 uint32_t handle; /* System handle. */
505 uint16_t nport_handle; /* N_PORT handle. */
507 uint8_t modifier; /* Modifier (7-0). */
508 #define MK_SYNC_ID_LUN 0 /* Synchronize ID/LUN */
509 #define MK_SYNC_ID 1 /* Synchronize ID */
510 #define MK_SYNC_ALL 2 /* Synchronize all ID/LUN */
518 uint8_t lun[8]; /* FCP LUN (BE). */
519 uint8_t reserved_4[40];
523 * ISP queue - CT Pass-Through entry structure definition.
525 #define CT_IOCB_TYPE 0x29 /* CT Pass-Through IOCB entry */
526 struct ct_entry_24xx {
527 uint8_t entry_type; /* Entry type. */
528 uint8_t entry_count; /* Entry count. */
529 uint8_t sys_define; /* System Defined. */
530 uint8_t entry_status; /* Entry Status. */
532 uint32_t handle; /* System handle. */
534 uint16_t comp_status; /* Completion status. */
536 uint16_t nport_handle; /* N_PORT handle. */
538 uint16_t cmd_dsd_count;
543 uint16_t timeout; /* Command timeout. */
546 uint16_t rsp_dsd_count;
548 uint8_t reserved_3[10];
550 uint32_t rsp_byte_count;
551 uint32_t cmd_byte_count;
553 uint32_t dseg_0_address[2]; /* Data segment 0 address. */
554 uint32_t dseg_0_len; /* Data segment 0 length. */
555 uint32_t dseg_1_address[2]; /* Data segment 1 address. */
556 uint32_t dseg_1_len; /* Data segment 1 length. */
560 * ISP queue - ELS Pass-Through entry structure definition.
562 #define ELS_IOCB_TYPE 0x53 /* ELS Pass-Through IOCB entry */
563 struct els_entry_24xx {
564 uint8_t entry_type; /* Entry type. */
565 uint8_t entry_count; /* Entry count. */
566 uint8_t sys_define; /* System Defined. */
567 uint8_t entry_status; /* Entry Status. */
569 uint32_t handle; /* System handle. */
573 uint16_t nport_handle; /* N_PORT handle. */
575 uint16_t tx_dsd_count;
579 #define EST_SOFI3 (1 << 4)
580 #define EST_SOFI2 (3 << 4)
582 uint32_t rx_xchg_address[2]; /* Receive exchange address. */
583 uint16_t rx_dsd_count;
593 uint16_t control_flags; /* Control flags. */
594 #define ECF_PAYLOAD_DESCR_MASK (BIT_15|BIT_14|BIT_13)
595 #define EPD_ELS_COMMAND (0 << 13)
596 #define EPD_ELS_ACC (1 << 13)
597 #define EPD_ELS_RJT (2 << 13)
598 #define EPD_RX_XCHG (3 << 13)
599 #define ECF_CLR_PASSTHRU_PEND BIT_12
600 #define ECF_INCL_FRAME_HDR BIT_11
602 uint32_t rx_byte_count;
603 uint32_t tx_byte_count;
605 uint32_t tx_address[2]; /* Data segment 0 address. */
606 uint32_t tx_len; /* Data segment 0 length. */
607 uint32_t rx_address[2]; /* Data segment 1 address. */
608 uint32_t rx_len; /* Data segment 1 length. */
612 * ISP queue - Mailbox Command entry structure definition.
614 #define MBX_IOCB_TYPE 0x39
615 struct mbx_entry_24xx {
616 uint8_t entry_type; /* Entry type. */
617 uint8_t entry_count; /* Entry count. */
618 uint8_t handle_count; /* Handle count. */
619 uint8_t entry_status; /* Entry Status. */
621 uint32_t handle; /* System handle. */
627 #define LOGINOUT_PORT_IOCB_TYPE 0x52 /* Login/Logout Port entry. */
628 struct logio_entry_24xx {
629 uint8_t entry_type; /* Entry type. */
630 uint8_t entry_count; /* Entry count. */
631 uint8_t sys_define; /* System defined. */
632 uint8_t entry_status; /* Entry Status. */
634 uint32_t handle; /* System handle. */
636 uint16_t comp_status; /* Completion status. */
637 #define CS_LOGIO_ERROR 0x31 /* Login/Logout IOCB error. */
639 uint16_t nport_handle; /* N_PORT handle. */
641 uint16_t control_flags; /* Control flags. */
643 #define LCF_FCP2_OVERRIDE BIT_9 /* Set/Reset word 3 of PRLI. */
644 #define LCF_CLASS_2 BIT_8 /* Enable class 2 during PLOGI. */
645 #define LCF_FREE_NPORT BIT_7 /* Release NPORT handle after LOGO. */
646 #define LCF_EXPL_LOGO BIT_6 /* Perform an explicit LOGO. */
647 #define LCF_SKIP_PRLI BIT_5 /* Skip PRLI after PLOGI. */
648 #define LCF_IMPL_LOGO_ALL BIT_5 /* Implicit LOGO to all ports. */
649 #define LCF_COND_PLOGI BIT_4 /* PLOGI only if not logged-in. */
650 #define LCF_IMPL_LOGO BIT_4 /* Perform an implicit LOGO. */
651 #define LCF_IMPL_PRLO BIT_4 /* Perform an implicit PRLO. */
653 #define LCF_COMMAND_PLOGI 0x00 /* PLOGI. */
654 #define LCF_COMMAND_PRLI 0x01 /* PRLI. */
655 #define LCF_COMMAND_PDISC 0x02 /* PDISC. */
656 #define LCF_COMMAND_ADISC 0x03 /* ADISC. */
657 #define LCF_COMMAND_LOGO 0x08 /* LOGO. */
658 #define LCF_COMMAND_PRLO 0x09 /* PRLO. */
659 #define LCF_COMMAND_TPRLO 0x0A /* TPRLO. */
664 uint8_t port_id[3]; /* PortID of destination port. */
666 uint8_t rsp_size; /* Response size in 32bit words. */
668 uint32_t io_parameter[11]; /* General I/O parameters. */
669 #define LSC_SCODE_NOLINK 0x01
670 #define LSC_SCODE_NOIOCB 0x02
671 #define LSC_SCODE_NOXCB 0x03
672 #define LSC_SCODE_CMD_FAILED 0x04
673 #define LSC_SCODE_NOFABRIC 0x05
674 #define LSC_SCODE_FW_NOT_READY 0x07
675 #define LSC_SCODE_NOT_LOGGED_IN 0x09
676 #define LSC_SCODE_NOPCB 0x0A
678 #define LSC_SCODE_ELS_REJECT 0x18
679 #define LSC_SCODE_CMD_PARAM_ERR 0x19
680 #define LSC_SCODE_PORTID_USED 0x1A
681 #define LSC_SCODE_NPORT_USED 0x1B
682 #define LSC_SCODE_NONPORT 0x1C
683 #define LSC_SCODE_LOGGED_IN 0x1D
684 #define LSC_SCODE_NOFLOGI_ACC 0x1F
687 #define TSK_MGMT_IOCB_TYPE 0x14
688 struct tsk_mgmt_entry {
689 uint8_t entry_type; /* Entry type. */
690 uint8_t entry_count; /* Entry count. */
691 uint8_t handle_count; /* Handle count. */
692 uint8_t entry_status; /* Entry Status. */
694 uint32_t handle; /* System handle. */
696 uint16_t nport_handle; /* N_PORT handle. */
700 uint16_t delay; /* Activity delay in seconds. */
702 uint16_t timeout; /* Command timeout. */
704 uint8_t lun[8]; /* FCP LUN (BE). */
706 uint32_t control_flags; /* Control Flags. */
707 #define TCF_NOTMCMD_TO_TARGET BIT_31
708 #define TCF_LUN_RESET BIT_4
709 #define TCF_ABORT_TASK_SET BIT_3
710 #define TCF_CLEAR_TASK_SET BIT_2
711 #define TCF_TARGET_RESET BIT_1
712 #define TCF_CLEAR_ACA BIT_0
714 uint8_t reserved_2[20];
716 uint8_t port_id[3]; /* PortID of destination port. */
719 uint8_t reserved_3[12];
722 #define ABORT_IOCB_TYPE 0x33
723 struct abort_entry_24xx {
724 uint8_t entry_type; /* Entry type. */
725 uint8_t entry_count; /* Entry count. */
726 uint8_t handle_count; /* Handle count. */
727 uint8_t entry_status; /* Entry Status. */
729 uint32_t handle; /* System handle. */
731 uint16_t nport_handle; /* N_PORT handle. */
732 /* or Completion status. */
734 uint16_t options; /* Options. */
735 #define AOF_NO_ABTS BIT_0 /* Do not send any ABTS. */
737 uint32_t handle_to_abort; /* System handle to abort. */
739 uint8_t reserved_1[32];
741 uint8_t port_id[3]; /* PortID of destination port. */
744 uint8_t reserved_2[12];
748 * ISP I/O Register Set structure definitions.
750 struct device_reg_24xx {
751 uint32_t flash_addr; /* Flash/NVRAM BIOS address. */
752 #define FARX_DATA_FLAG BIT_31
753 #define FARX_ACCESS_FLASH_CONF 0x7FFD0000
754 #define FARX_ACCESS_FLASH_DATA 0x7FF00000
755 #define FARX_ACCESS_NVRAM_CONF 0x7FFF0000
756 #define FARX_ACCESS_NVRAM_DATA 0x7FFE0000
758 #define FA_NVRAM_FUNC0_ADDR 0x80
759 #define FA_NVRAM_FUNC1_ADDR 0x180
761 #define FA_NVRAM_VPD_SIZE 0x200
762 #define FA_NVRAM_VPD0_ADDR 0x00
763 #define FA_NVRAM_VPD1_ADDR 0x100
765 * RISC code begins at offset 512KB
766 * within flash. Consisting of two
767 * contiguous RISC code segments.
769 #define FA_RISC_CODE_ADDR 0x20000
770 #define FA_RISC_CODE_SEGMENTS 2
772 uint32_t flash_data; /* Flash/NVRAM BIOS data. */
774 uint32_t ctrl_status; /* Control/Status. */
775 #define CSRX_FLASH_ACCESS_ERROR BIT_18 /* Flash/NVRAM Access Error. */
776 #define CSRX_DMA_ACTIVE BIT_17 /* DMA Active status. */
777 #define CSRX_DMA_SHUTDOWN BIT_16 /* DMA Shutdown control status. */
778 #define CSRX_FUNCTION BIT_15 /* Function number. */
779 /* PCI-X Bus Mode. */
780 #define CSRX_PCIX_BUS_MODE_MASK (BIT_11|BIT_10|BIT_9|BIT_8)
781 #define PBM_PCI_33MHZ (0 << 8)
782 #define PBM_PCIX_M1_66MHZ (1 << 8)
783 #define PBM_PCIX_M1_100MHZ (2 << 8)
784 #define PBM_PCIX_M1_133MHZ (3 << 8)
785 #define PBM_PCIX_M2_66MHZ (5 << 8)
786 #define PBM_PCIX_M2_100MHZ (6 << 8)
787 #define PBM_PCIX_M2_133MHZ (7 << 8)
788 #define PBM_PCI_66MHZ (8 << 8)
789 /* Max Write Burst byte count. */
790 #define CSRX_MAX_WRT_BURST_MASK (BIT_5|BIT_4)
791 #define MWB_512_BYTES (0 << 4)
792 #define MWB_1024_BYTES (1 << 4)
793 #define MWB_2048_BYTES (2 << 4)
794 #define MWB_4096_BYTES (3 << 4)
796 #define CSRX_64BIT_SLOT BIT_2 /* PCI 64-Bit Bus Slot. */
797 #define CSRX_FLASH_ENABLE BIT_1 /* Flash BIOS Read/Write enable. */
798 #define CSRX_ISP_SOFT_RESET BIT_0 /* ISP soft reset. */
800 uint32_t ictrl; /* Interrupt control. */
801 #define ICRX_EN_RISC_INT BIT_3 /* Enable RISC interrupts on PCI. */
803 uint32_t istatus; /* Interrupt status. */
804 #define ISRX_RISC_INT BIT_3 /* RISC interrupt. */
806 uint32_t unused_1[2]; /* Gap. */
809 uint32_t req_q_in; /* In-Pointer. */
810 uint32_t req_q_out; /* Out-Pointer. */
811 /* Response Queue. */
812 uint32_t rsp_q_in; /* In-Pointer. */
813 uint32_t rsp_q_out; /* Out-Pointer. */
814 /* Priority Request Queue. */
815 uint32_t preq_q_in; /* In-Pointer. */
816 uint32_t preq_q_out; /* Out-Pointer. */
818 uint32_t unused_2[2]; /* Gap. */
821 uint32_t atio_q_in; /* In-Pointer. */
822 uint32_t atio_q_out; /* Out-Pointer. */
824 uint32_t host_status;
825 #define HSRX_RISC_INT BIT_15 /* RISC to Host interrupt. */
826 #define HSRX_RISC_PAUSED BIT_8 /* RISC Paused. */
828 uint32_t hccr; /* Host command & control register. */
830 #define HCCRX_HOST_INT BIT_6 /* Host to RISC interrupt bit. */
831 #define HCCRX_RISC_RESET BIT_5 /* RISC Reset mode bit. */
832 #define HCCRX_RISC_PAUSE BIT_4 /* RISC Pause mode bit. */
835 #define HCCRX_NOOP 0x00000000
836 /* Set RISC Reset. */
837 #define HCCRX_SET_RISC_RESET 0x10000000
838 /* Clear RISC Reset. */
839 #define HCCRX_CLR_RISC_RESET 0x20000000
840 /* Set RISC Pause. */
841 #define HCCRX_SET_RISC_PAUSE 0x30000000
842 /* Releases RISC Pause. */
843 #define HCCRX_REL_RISC_PAUSE 0x40000000
844 /* Set HOST to RISC interrupt. */
845 #define HCCRX_SET_HOST_INT 0x50000000
846 /* Clear HOST to RISC interrupt. */
847 #define HCCRX_CLR_HOST_INT 0x60000000
848 /* Clear RISC to PCI interrupt. */
849 #define HCCRX_CLR_RISC_INT 0xA0000000
851 uint32_t gpiod; /* GPIO Data register. */
852 /* LED update mask. */
853 #define GPDX_LED_UPDATE_MASK (BIT_20|BIT_19|BIT_18)
854 /* Data update mask. */
855 #define GPDX_DATA_UPDATE_MASK (BIT_17|BIT_16)
856 /* LED control mask. */
857 #define GPDX_LED_COLOR_MASK (BIT_4|BIT_3|BIT_2)
858 /* LED bit values. Color names as
859 * referenced in fw spec.
861 #define GPDX_LED_YELLOW_ON BIT_2
862 #define GPDX_LED_GREEN_ON BIT_3
863 #define GPDX_LED_AMBER_ON BIT_4
865 #define GPDX_DATA_INOUT (BIT_1|BIT_0)
867 uint32_t gpioe; /* GPIO Enable register. */
868 /* Enable update mask. */
869 #define GPEX_ENABLE_UPDATE_MASK (BIT_17|BIT_16)
871 #define GPEX_ENABLE (BIT_1|BIT_0)
873 uint32_t iobase_addr; /* I/O Bus Base Address register. */
875 uint32_t unused_3[10]; /* Gap. */
911 /* MID Support ***************************************************************/
913 #define MAX_MID_VPS 125
915 struct mid_conf_entry_24xx {
919 * BIT 0 = Enable Hard Loop Id
920 * BIT 1 = Acquire Loop ID in LIPA
921 * BIT 2 = ID not Acquired
923 * BIT 4 = Enable Initiator Mode
924 * BIT 5 = Disable Target Mode
929 uint8_t hard_address;
931 uint8_t port_name[WWN_SIZE];
932 uint8_t node_name[WWN_SIZE];
935 struct mid_init_cb_24xx {
936 struct init_cb_24xx init_cb;
941 struct mid_conf_entry_24xx entries[MAX_MID_VPS];
945 struct mid_db_entry_24xx {
947 #define MDBS_NON_PARTIC BIT_3
948 #define MDBS_ID_ACQUIRED BIT_1
949 #define MDBS_ENABLED BIT_0
952 uint8_t hard_address;
954 uint8_t port_name[WWN_SIZE];
955 uint8_t node_name[WWN_SIZE];
962 struct mid_db_entry_24xx entries[MAX_MID_VPS];
965 #define VP_CTRL_IOCB_TYPE 0x30 /* Vitual Port Control entry. */
966 struct vp_ctrl_entry_24xx {
967 uint8_t entry_type; /* Entry type. */
968 uint8_t entry_count; /* Entry count. */
969 uint8_t sys_define; /* System defined. */
970 uint8_t entry_status; /* Entry Status. */
972 uint32_t handle; /* System handle. */
974 uint16_t vp_idx_failed;
976 uint16_t comp_status; /* Completion status. */
977 #define CS_VCE_ACQ_ID_ERROR 0x02 /* Error while acquireing ID. */
978 #define CS_VCE_BUSY 0x05 /* Firmware not ready to accept cmd. */
981 #define VCE_COMMAND_ENABLE_VPS 0x00 /* Enable VPs. */
982 #define VCE_COMMAND_DISABLE_VPS 0x08 /* Disable VPs. */
983 #define VCE_COMMAND_DISABLE_VPS_REINIT 0x09 /* Disable VPs and reinit link. */
984 #define VCE_COMMAND_DISABLE_VPS_LOGO 0x0a /* Disable VPs and LOGO ports. */
988 uint8_t vp_idx_map[16];
990 uint8_t reserved_4[32];
993 #define VP_CONFIG_IOCB_TYPE 0x31 /* Vitual Port Config entry. */
994 struct vp_config_entry_24xx {
995 uint8_t entry_type; /* Entry type. */
996 uint8_t entry_count; /* Entry count. */
997 uint8_t sys_define; /* System defined. */
998 uint8_t entry_status; /* Entry Status. */
1000 uint32_t handle; /* System handle. */
1002 uint16_t reserved_1;
1004 uint16_t comp_status; /* Completion status. */
1005 #define CS_VCT_STS_ERROR 0x01 /* Specified VPs were not disabled. */
1006 #define CS_VCT_CNT_ERROR 0x02 /* Invalid VP count. */
1007 #define CS_VCT_ERROR 0x03 /* Unknown error. */
1008 #define CS_VCT_IDX_ERROR 0x02 /* Invalid VP index. */
1009 #define CS_VCT_BUSY 0x05 /* Firmware not ready to accept cmd. */
1012 #define VCT_COMMAND_MOD_VPS 0x00 /* Enable VPs. */
1013 #define VCT_COMMAND_MOD_ENABLE_VPS 0x08 /* Disable VPs. */
1020 uint8_t options_idx1;
1021 uint8_t hard_address_idx1;
1022 uint16_t reserved_2;
1023 uint8_t port_name_idx1[WWN_SIZE];
1024 uint8_t node_name_idx1[WWN_SIZE];
1026 uint8_t options_idx2;
1027 uint8_t hard_address_idx2;
1028 uint16_t reserved_3;
1029 uint8_t port_name_idx2[WWN_SIZE];
1030 uint8_t node_name_idx2[WWN_SIZE];
1032 uint8_t reserved_4[8];
1035 #define VP_RPT_ID_IOCB_TYPE 0x32 /* Report ID Acquisition entry. */
1036 struct vp_rpt_id_entry_24xx {
1037 uint8_t entry_type; /* Entry type. */
1038 uint8_t entry_count; /* Entry count. */
1039 uint8_t sys_define; /* System defined. */
1040 uint8_t entry_status; /* Entry Status. */
1042 uint32_t handle; /* System handle. */
1044 uint16_t vp_count; /* Format 0 -- | VP setup | VP acq |. */
1045 /* Format 1 -- | VP count |. */
1046 uint16_t vp_idx; /* Format 0 -- Reserved. */
1047 /* Format 1 -- VP status and index. */
1052 uint8_t vp_idx_map[16];
1054 uint8_t reserved_4[32];
1057 /* END MID Support ***********************************************************/