/* * PMC-Sierra SPCv/ve 8088/8089 SAS/SATA based host adapters driver * * Copyright (c) 2008-2009 USI Co., Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * * NO WARRANTY * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. *
*/
/* Making ORR bigger than IT NEXUS LOSS which is 2000000us = 2 second. Assuming a bigger value 3 second, 3000000/128 = 23437.5 where 128 is DOPNRJT_RTRY_TMO
*/ #define SAS_DOPNRJT_RTRY_THR 23438 #define SAS_COPNRJT_RTRY_THR 23438 #define SAS_MAX_AIP 0x200000 #define IT_NEXUS_TIMEOUT 0x7D0 #define PORT_RECOVERY_TIMEOUT ((IT_NEXUS_TIMEOUT/100) + 30) /* Port recovery timeout, 10000 ms for PM8006 controller */ #define CHIP_8006_PORT_RECOVERY_TIMEOUT 0x640000
u8 _un21_27[7];
} __packed; #else #error"Bitfield order not defined!" #endif
struct mpi_msg_hdr {
__le32 header; /* Bits [11:0] - Message operation code */ /* Bits [15:12] - Message Category */ /* Bits [21:16] - Outboundqueue ID for the
operation completion message */ /* Bits [23:22] - Reserved */ /* Bits [28:24] - Buffer Count, indicates how
many buffer are allocated for the massage */ /* Bits [30:29] - Reserved */ /* Bits [31] - Message Valid bit */
} __attribute__((packed, aligned(4)));
/* * brief the data structure of PHY Start Command * use to describe enable the phy (128 bytes)
*/ struct phy_start_req {
__le32 tag;
__le32 ase_sh_lm_slr_phyid; struct sas_identify_frame_local sas_identify; /* 28 Bytes */
__le32 spasti;
u32 reserved[21];
} __attribute__((packed, aligned(4)));
/* * brief the data structure of PHY Start Command * use to disable the phy (128 bytes)
*/ struct phy_stop_req {
__le32 tag;
__le32 phy_id;
u32 reserved[29];
} __attribute__((packed, aligned(4)));
/* set device bits fis - device to host */ struct set_dev_bits_fis {
u8 fis_type; /* 0xA1*/
u8 n_i_pmport; /* b7 : n Bit. Notification bit. If set device needs attention. */ /* b6 : i Bit. Interrupt Bit */ /* b5-b4: reserved2 */ /* b3-b0: PM Port */
u8 status;
u8 error;
u32 _r_a;
} __attribute__ ((packed)); /* PIO setup FIS - device to host */ struct pio_setup_fis {
u8 fis_type; /* 0x5f */
u8 i_d_pmPort; /* b7 : reserved */ /* b6 : i bit. Interrupt bit */ /* b5 : d bit. data transfer direction. set to 1 for device to host
xfer */ /* b4 : reserved */ /* b3-b0: PM Port */
u8 status;
u8 error;
u8 lbal;
u8 lbam;
u8 lbah;
u8 device;
u8 lbal_exp;
u8 lbam_exp;
u8 lbah_exp;
u8 _r_a;
u8 sector_count;
u8 sector_count_exp;
u8 _r_b;
u8 e_status;
u8 _r_c[2];
u8 transfer_count;
} __attribute__ ((packed));
/* * brief the data structure of SATA Completion Response * use to describe the sata task response (64 bytes)
*/ struct sata_completion_resp {
__le32 tag;
__le32 status;
__le32 param;
u32 sata_resp[12];
} __attribute__((packed, aligned(4)));
/* * brief the data structure of SAS HW Event Notification * use to alert the host about the hardware event(64 bytes)
*/ /* updated outbound struct for spcv */
/* * brief the data structure of DEREGISTER DEVICE Command * use to request spc to remove all internal resources associated * with the device id (64 bytes)
*/
/* * brief the data structure of DEVICE_REGISTRATION Response * use to notify the completion of the device registration (64 bytes)
*/ struct dev_reg_resp {
__le32 tag;
__le32 status;
__le32 device_id;
u32 reserved[12];
} __attribute__((packed, aligned(4)));
/* * brief the data structure of Local PHY Control Command * use to issue PHY CONTROL to local phy (64 bytes)
*/ struct local_phy_ctl_req {
__le32 tag;
__le32 phyop_phyid;
u32 reserved1[29];
} __attribute__((packed, aligned(4)));
/** * brief the data structure of Local Phy Control Response * use to describe MPI Local Phy Control Response (64 bytes)
*/ struct local_phy_ctl_resp {
__le32 tag;
__le32 phyop_phyid;
__le32 status;
u32 reserved[12];
} __attribute__((packed, aligned(4)));
/* * brief the data structure of HW Event Ack Command * use to acknowledge receive HW event (64 bytes)
*/ struct hw_event_ack_req {
__le32 tag;
__le32 phyid_sea_portid;
__le32 param0;
__le32 param1;
u32 reserved1[27];
} __attribute__((packed, aligned(4)));
/* * brief the data structure of PHY_START Response Command * indicates the completion of PHY_START command (64 bytes)
*/ struct phy_start_resp {
__le32 tag;
__le32 status;
__le32 phyid;
u32 reserved[12];
} __attribute__((packed, aligned(4)));
/* * brief the data structure of PHY_STOP Response Command * indicates the completion of PHY_STOP command (64 bytes)
*/ struct phy_stop_resp {
__le32 tag;
__le32 status;
__le32 phyid;
u32 reserved[12];
} __attribute__((packed, aligned(4)));
/* * brief the data structure of SSP Completion Response * use to indicate a SSP Completion (n bytes)
*/ struct ssp_completion_resp {
__le32 tag;
__le32 status;
__le32 param;
__le32 ssptag_rescv_rescpad; struct ssp_response_iu ssp_resp_iu;
__le32 residual_count;
} __attribute__((packed, aligned(4)));
#define SSP_RESCV_BIT 0x00010000
/* * brief the data structure of SATA EVNET response * use to indicate a SATA Completion (64 bytes)
*/ struct sata_event_resp {
__le32 tag;
__le32 event;
__le32 port_id;
__le32 device_id;
u32 reserved;
__le32 event_param0;
__le32 event_param1;
__le32 sata_addr_h32;
__le32 sata_addr_l32;
__le32 e_udt1_udt0_crc;
__le32 e_udt5_udt4_udt3_udt2;
__le32 a_udt1_udt0_crc;
__le32 a_udt5_udt4_udt3_udt2;
__le32 hwdevid_diferr;
__le32 err_framelen_byteoffset;
__le32 err_dataframe;
} __attribute__((packed, aligned(4)));
/* * brief the data structure of SSP EVNET esponse * use to indicate a SSP Completion (64 bytes)
*/ struct ssp_event_resp {
__le32 tag;
__le32 event;
__le32 port_id;
__le32 device_id;
__le32 ssp_tag;
__le32 event_param0;
__le32 event_param1;
__le32 sas_addr_h32;
__le32 sas_addr_l32;
__le32 e_udt1_udt0_crc;
__le32 e_udt5_udt4_udt3_udt2;
__le32 a_udt1_udt0_crc;
__le32 a_udt5_udt4_udt3_udt2;
__le32 hwdevid_diferr;
__le32 err_framelen_byteoffset;
__le32 err_dataframe;
} __attribute__((packed, aligned(4)));
/** * brief the data structure of General Event Notification Response * use to describe MPI General Event Notification Response (64 bytes)
*/ struct general_event_resp {
__le32 status;
__le32 inb_IOMB_payload[14];
} __attribute__((packed, aligned(4)));
/* * brief the data structure of SMP Request Command * use to describe MPI SMP REQUEST Command (64 bytes)
*/ struct smp_req {
__le32 tag;
__le32 device_id;
__le32 len_ip_ir; /* Bits [0] - Indirect response */ /* Bits [1] - Indirect Payload */ /* Bits [15:2] - Reserved */ /* Bits [23:16] - direct payload Len */ /* Bits [31:24] - Reserved */
u8 smp_req16[16]; union {
u8 smp_req[32]; struct {
__le64 long_req_addr;/* sg dma address, LE */
__le32 long_req_size;/* LE */
u32 _r_a;
__le64 long_resp_addr;/* sg dma address, LE */
__le32 long_resp_size;/* LE */
u32 _r_b;
} long_smp_req;/* sequencer extension */
};
__le32 rsvd[16];
} __attribute__((packed, aligned(4))); /* * brief the data structure of SMP Completion Response * use to describe MPI SMP Completion Response (64 bytes)
*/ struct smp_completion_resp {
__le32 tag;
__le32 status;
__le32 param;
u8 _r_a[252];
} __attribute__((packed, aligned(4)));
/* *brief the data structure of SSP SMP SATA Abort Command * use to describe MPI SSP SMP & SATA Abort Command (64 bytes)
*/ struct task_abort_req {
__le32 tag;
__le32 device_id;
__le32 tag_to_abort;
__le32 abort_all;
u32 reserved[27];
} __attribute__((packed, aligned(4)));
/** * brief the data structure of SSP SATA SMP Abort Response * use to describe SSP SMP & SATA Abort Response ( 64 bytes)
*/ struct task_abort_resp {
__le32 tag;
__le32 status;
__le32 scp;
u32 reserved[12];
} __attribute__((packed, aligned(4)));
/** * brief the data structure of SAS Diagnostic Start/End Command * use to describe MPI SAS Diagnostic Start/End Command (64 bytes)
*/ struct sas_diag_start_end_req {
__le32 tag;
__le32 operation_phyid;
u32 reserved[29];
} __attribute__((packed, aligned(4)));
/** * brief the data structure of SAS Diagnostic Execute Command * use to describe MPI SAS Diagnostic Execute Command (64 bytes)
*/ struct sas_diag_execute_req {
__le32 tag;
__le32 cmdtype_cmddesc_phyid;
__le32 pat1_pat2;
__le32 threshold;
__le32 codepat_errmsk;
__le32 pmon;
__le32 pERF1CTL;
u32 reserved[24];
} __attribute__((packed, aligned(4)));
#define SAS_DIAG_PARAM_BYTES 24
/* * brief the data structure of Set Device State Command * use to describe MPI Set Device State Command (64 bytes)
*/ struct set_dev_state_req {
__le32 tag;
__le32 device_id;
__le32 nds;
u32 reserved[28];
} __attribute__((packed, aligned(4)));
/* * brief the data structure of SATA Start Command * use to describe MPI SATA IO Start Command (64 bytes) * Note: This structure is common for normal / encryption I/O
*/
/** * brief the data structure of Firmware download * use to describe MPI FW DOWNLOAD Command (64 bytes)
*/ struct fw_flash_Update_req {
__le32 tag;
__le32 cur_image_offset;
__le32 cur_image_len;
__le32 total_image_len;
u32 reserved0[7];
__le32 sgl_addr_lo;
__le32 sgl_addr_hi;
__le32 len;
__le32 ext_reserved;
u32 reserved1[16];
} __attribute__((packed, aligned(4)));
#define FWFLASH_IOMB_RESERVED_LEN 0x07 /** * brief the data structure of FW_FLASH_UPDATE Response * use to describe MPI FW_FLASH_UPDATE Response (64 bytes) *
*/ struct fw_flash_Update_resp {
__le32 tag;
__le32 status;
u32 reserved[13];
} __attribute__((packed, aligned(4)));
/** * brief the data structure of Get NVM Data Command * use to get data from NVM in HBA(64 bytes)
*/ struct get_nvm_data_req {
__le32 tag;
__le32 len_ir_vpdd;
__le32 vpd_offset;
u32 reserved[8];
__le32 resp_addr_lo;
__le32 resp_addr_hi;
__le32 resp_len;
u32 reserved1[17];
} __attribute__((packed, aligned(4)));
/** * brief the data structure for SET CONTROLLER CONFIG COMMAND * use to modify controller configuration
*/ struct set_ctrl_cfg_req {
__le32 tag;
__le32 cfg_pg[14];
u32 reserved[16];
} __attribute__((packed, aligned(4)));
/** * brief the data structure for GET CONTROLLER CONFIG COMMAND * use to get controller configuration page
*/ struct get_ctrl_cfg_req {
__le32 tag;
__le32 pgcd;
__le32 int_vec;
u32 reserved[28];
} __attribute__((packed, aligned(4)));
/** * brief the data structure for KEK_MANAGEMENT COMMAND * use for KEK management
*/ struct kek_mgmt_req {
__le32 tag;
__le32 new_curidx_ksop;
u32 reserved;
__le32 kblob[12];
u32 reserved1[16];
} __attribute__((packed, aligned(4)));
/** * brief the data structure for DEK_MANAGEMENT COMMAND * use for DEK management
*/ struct dek_mgmt_req {
__le32 tag;
__le32 kidx_dsop;
__le32 dekidx;
__le32 addr_l;
__le32 addr_h;
__le32 nent;
__le32 dbf_tblsize;
u32 reserved[24];
} __attribute__((packed, aligned(4)));
/** * brief the data structure for SET PHY PROFILE COMMAND * use to retrive phy specific information
*/ struct set_phy_profile_req {
__le32 tag;
__le32 ppc_phyid;
__le32 reserved[29];
} __attribute__((packed, aligned(4)));
/** * brief the data structure for GET PHY PROFILE COMMAND * use to retrive phy specific information
*/ struct get_phy_profile_req {
__le32 tag;
__le32 ppc_phyid;
__le32 profile[29];
} __attribute__((packed, aligned(4)));
/** * brief the data structure for EXT FLASH PARTITION * use to manage ext flash partition
*/ struct ext_flash_partition_req {
__le32 tag;
__le32 cmd;
__le32 offset;
__le32 len;
u32 reserved[7];
__le32 addr_low;
__le32 addr_high;
__le32 len1;
__le32 ext;
u32 reserved1[16];
} __attribute__((packed, aligned(4)));
#define IPMode 0x80000000 #define NVMD_TYPE 0x0000000F #define NVMD_STAT 0x0000FFFF #define NVMD_LEN 0xFF000000 /** * brief the data structure of Get NVMD Data Response * use to describe MPI Get NVMD Data Response (64 bytes)
*/ struct get_nvm_data_resp {
__le32 tag;
__le32 ir_tda_bn_dps_das_nvm;
__le32 dlen_status;
__le32 nvm_data[12];
} __attribute__((packed, aligned(4)));
/** * brief the data structure of SAS Diagnostic Start/End Response * use to describe MPI SAS Diagnostic Start/End Response (64 bytes) *
*/ struct sas_diag_start_end_resp {
__le32 tag;
__le32 status;
u32 reserved[13];
} __attribute__((packed, aligned(4)));
/** * brief the data structure of SAS Diagnostic Execute Response * use to describe MPI SAS Diagnostic Execute Response (64 bytes) *
*/ struct sas_diag_execute_resp {
__le32 tag;
__le32 cmdtype_cmddesc_phyid;
__le32 Status;
__le32 ReportData;
u32 reserved[11];
} __attribute__((packed, aligned(4)));
/** * brief the data structure of Set Device State Response * use to describe MPI Set Device State Response (64 bytes) *
*/ struct set_dev_state_resp {
__le32 tag;
__le32 status;
__le32 device_id;
__le32 pds_nds;
u32 reserved[11];
} __attribute__((packed, aligned(4)));
/* new outbound structure for spcv - begins */ /** * brief the data structure for SET CONTROLLER CONFIG COMMAND * use to modify controller configuration
*/ struct set_ctrl_cfg_resp {
__le32 tag;
__le32 status;
__le32 err_qlfr_pgcd;
u32 reserved[12];
} __attribute__((packed, aligned(4)));
/* This error code 0x22 is not used on SPCv */ #define IO_XFER_ERROR_ABORTED_DUE_TO_SRST 0x22 #define IO_XFER_ERROR_REJECTED_NCQ_MODE 0x21 #define IO_XFER_ERROR_ABORTED_NCQ_MODE 0x23 #define IO_XFER_OPEN_RETRY_TIMEOUT 0x24 /* This error code 0x25 is not used on SPCv */ #define IO_XFER_SMP_RESP_CONNECTION_ERROR 0x25 #define IO_XFER_ERROR_UNEXPECTED_PHASE 0x26 #define IO_XFER_ERROR_XFER_RDY_OVERRUN 0x27 #define IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED 0x28 #define IO_XFER_ERROR_CMD_ISSUE_ACK_NAK_TIMEOUT 0x30
/* The following error code 0x31 and 0x32 are not using (obsolete) */ #define IO_XFER_ERROR_CMD_ISSUE_BREAK_BEFORE_ACK_NAK 0x31 #define IO_XFER_ERROR_CMD_ISSUE_PHY_DOWN_BEFORE_ACK_NAK 0x32
#define IO_XFR_ERROR_DEK_KEY_CACHE_MISS 0x2040 /* * An encryption IO request failed due to DEK Key Tag mismatch. * The key tag supplied in the encryption IOMB does not match with * the Key Tag in the referenced DEK Entry.
*/ #define IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH 0x2041 #define IO_XFR_ERROR_CIPHER_MODE_INVALID 0x2042 /* * An encryption I/O request failed because the initial value (IV) * in the unwrapped DEK blob didn't match the IV used to unwrap it.
*/ #define IO_XFR_ERROR_DEK_IV_MISMATCH 0x2043 /* An encryption I/O request failed due to an internal RAM ECC or
* interface error while unwrapping the DEK. */ #define IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR 0x2044 /* An encryption I/O request failed due to an internal RAM ECC or
* interface error while unwrapping the DEK. */ #define IO_XFR_ERROR_INTERNAL_RAM 0x2045 /* * An encryption I/O request failed * because the DEK index specified in the I/O was outside the bounds of * the total number of entries in the host DEK table.
*/ #define IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS0x2046
/* WARNING: This error code must always be the last number. * If you add error code, modify this code also * It is used as an index
*/ #define IO_ERROR_UNKNOWN_GENERIC 0x2023
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.