1*f52228b8SJoe Beteta /* 2*f52228b8SJoe Beteta * This file and its contents are supplied under the terms of the 3*f52228b8SJoe Beteta * Common Development and Distribution License ("CDDL"), version 1.0. 4*f52228b8SJoe Beteta * You may only use this file in accordance with the terms of version 5*f52228b8SJoe Beteta * 1.0 of the CDDL. 6*f52228b8SJoe Beteta * 7*f52228b8SJoe Beteta * A full copy of the text of the CDDL should have accompanied this 8*f52228b8SJoe Beteta * source. A copy of the CDDL is also available via the Internet at 9*f52228b8SJoe Beteta * http://www.illumos.org/license/CDDL. 10*f52228b8SJoe Beteta */ 11*f52228b8SJoe Beteta 12*f52228b8SJoe Beteta /* 13*f52228b8SJoe Beteta * Copyright 2013 STEC, Inc. All rights reserved. 14*f52228b8SJoe Beteta */ 15*f52228b8SJoe Beteta 16*f52228b8SJoe Beteta #ifndef _SKD_S1120_H 17*f52228b8SJoe Beteta #define _SKD_S1120_H 18*f52228b8SJoe Beteta 19*f52228b8SJoe Beteta /* 20*f52228b8SJoe Beteta * Q-channel, 64-bit r/w 21*f52228b8SJoe Beteta */ 22*f52228b8SJoe Beteta #define FIT_Q_COMMAND 0x400u 23*f52228b8SJoe Beteta #define FIT_QCMD_QID_MASK (0x3 << 1) 24*f52228b8SJoe Beteta #define FIT_QCMD_QID0 (0x0 << 1) 25*f52228b8SJoe Beteta #define FIT_QCMD_QID_NORMAL FIT_QCMD_QID0 26*f52228b8SJoe Beteta #ifndef SKD_OMIT_FROM_SRC_DIST 27*f52228b8SJoe Beteta #define FIT_QCMD_QID1 (0x1 << 1) 28*f52228b8SJoe Beteta #define FIT_QCMD_QID2 (0x2 << 1) 29*f52228b8SJoe Beteta #define FIT_QCMD_QID3 (0x3 << 1) 30*f52228b8SJoe Beteta #endif /* SKD_OMIT_FROM_SRC_DIST */ 31*f52228b8SJoe Beteta #define FIT_QCMD_FLUSH_QUEUE (0ull) /* add QID */ 32*f52228b8SJoe Beteta #define FIT_QCMD_MSGSIZE_MASK (0x3 << 4) 33*f52228b8SJoe Beteta #define FIT_QCMD_MSGSIZE_64 (0x0 << 4) 34*f52228b8SJoe Beteta #define FIT_QCMD_MSGSIZE_128 (0x1 << 4) 35*f52228b8SJoe Beteta #define FIT_QCMD_MSGSIZE_256 (0x2 << 4) 36*f52228b8SJoe Beteta #define FIT_QCMD_MSGSIZE_512 (0x3 << 4) 37*f52228b8SJoe Beteta #define FIT_QCMD_BASE_ADDRESS_MASK (0xFFFFFFFFFFFFFFC0ull) 38*f52228b8SJoe Beteta 39*f52228b8SJoe Beteta 40*f52228b8SJoe Beteta /* 41*f52228b8SJoe Beteta * Control, 32-bit r/w 42*f52228b8SJoe Beteta */ 43*f52228b8SJoe Beteta #define FIT_CONTROL 0x500u 44*f52228b8SJoe Beteta #ifndef SKD_OMIT_FROM_SRC_DIST 45*f52228b8SJoe Beteta #define FIT_CR_HARD_RESET (1u << 0u) 46*f52228b8SJoe Beteta #endif /* SKD_OMIT_FROM_SRC_DIST */ 47*f52228b8SJoe Beteta #define FIT_CR_SOFT_RESET (1u << 1u) 48*f52228b8SJoe Beteta #ifndef SKD_OMIT_FROM_SRC_DIST 49*f52228b8SJoe Beteta #define FIT_CR_DIS_TIMESTAMPS (1u << 6u) 50*f52228b8SJoe Beteta #endif /* SKD_OMIT_FROM_SRC_DIST */ 51*f52228b8SJoe Beteta #define FIT_CR_ENABLE_INTERRUPTS (1u << 7u) 52*f52228b8SJoe Beteta 53*f52228b8SJoe Beteta /* 54*f52228b8SJoe Beteta * Status, 32-bit, r/o 55*f52228b8SJoe Beteta */ 56*f52228b8SJoe Beteta #define FIT_STATUS 0x510u 57*f52228b8SJoe Beteta #define FIT_SR_DRIVE_STATE_MASK 0x000000FFu 58*f52228b8SJoe Beteta #ifndef SKD_OMIT_FROM_SRC_DIST 59*f52228b8SJoe Beteta #define FIT_SR_SIGNATURE (0xFF << 8) 60*f52228b8SJoe Beteta #define FIT_SR_PIO_DMA (1 << 16) 61*f52228b8SJoe Beteta #endif /* SKD_OMIT_FROM_SRC_DIST */ 62*f52228b8SJoe Beteta #define FIT_SR_DRIVE_OFFLINE 0x00 63*f52228b8SJoe Beteta #define FIT_SR_DRIVE_INIT 0x01 64*f52228b8SJoe Beteta /* #define FIT_SR_DRIVE_READY 0x02 */ 65*f52228b8SJoe Beteta #define FIT_SR_DRIVE_ONLINE 0x03 66*f52228b8SJoe Beteta #define FIT_SR_DRIVE_BUSY 0x04 67*f52228b8SJoe Beteta #define FIT_SR_DRIVE_FAULT 0x05 68*f52228b8SJoe Beteta #define FIT_SR_DRIVE_DEGRADED 0x06 69*f52228b8SJoe Beteta #define FIT_SR_PCIE_LINK_DOWN 0x07 70*f52228b8SJoe Beteta #define FIT_SR_DRIVE_SOFT_RESET 0x08 71*f52228b8SJoe Beteta #define FIT_SR_DRIVE_INIT_FAULT 0x09 72*f52228b8SJoe Beteta #define FIT_SR_DRIVE_BUSY_SANITIZE 0x0A 73*f52228b8SJoe Beteta #define FIT_SR_DRIVE_BUSY_ERASE 0x0B 74*f52228b8SJoe Beteta #define FIT_SR_DRIVE_FW_BOOTING 0x0C 75*f52228b8SJoe Beteta #define FIT_SR_DRIVE_NEED_FW_DOWNLOAD 0xFE 76*f52228b8SJoe Beteta #define FIT_SR_DEVICE_MISSING 0xFF 77*f52228b8SJoe Beteta #define FIT_SR__RESERVED 0xFFFFFF00u 78*f52228b8SJoe Beteta 79*f52228b8SJoe Beteta #ifndef SKD_OMIT_FROM_SRC_DIST 80*f52228b8SJoe Beteta /* 81*f52228b8SJoe Beteta * FIT_STATUS - Status register data definition 82*f52228b8SJoe Beteta */ 83*f52228b8SJoe Beteta #define FIT_SR_STATE_MASK (0xFF << 0) 84*f52228b8SJoe Beteta #define FIT_SR_SIGNATURE (0xFF << 8) 85*f52228b8SJoe Beteta #define FIT_SR_PIO_DMA (1 << 16) 86*f52228b8SJoe Beteta #endif /* SKD_OMIT_FROM_SRC_DIST */ 87*f52228b8SJoe Beteta 88*f52228b8SJoe Beteta 89*f52228b8SJoe Beteta /* 90*f52228b8SJoe Beteta * Interrupt status, 32-bit r/w1c (w1c ==> write 1 to clear) 91*f52228b8SJoe Beteta */ 92*f52228b8SJoe Beteta #define FIT_INT_STATUS_HOST 0x520u 93*f52228b8SJoe Beteta #define FIT_ISH_FW_STATE_CHANGE (1u << 0u) 94*f52228b8SJoe Beteta #define FIT_ISH_COMPLETION_POSTED (1u << 1u) 95*f52228b8SJoe Beteta #define FIT_ISH_MSG_FROM_DEV (1u << 2u) 96*f52228b8SJoe Beteta #define FIT_ISH_UNDEFINED_3 (1u << 3u) 97*f52228b8SJoe Beteta #define FIT_ISH_UNDEFINED_4 (1u << 4u) 98*f52228b8SJoe Beteta #define FIT_ISH_Q0_FULL (1u << 5u) 99*f52228b8SJoe Beteta #define FIT_ISH_Q1_FULL (1u << 6u) 100*f52228b8SJoe Beteta #define FIT_ISH_Q2_FULL (1u << 7u) 101*f52228b8SJoe Beteta #define FIT_ISH_Q3_FULL (1u << 8u) 102*f52228b8SJoe Beteta #define FIT_ISH_QCMD_FIFO_OVERRUN (1u << 9u) 103*f52228b8SJoe Beteta #define FIT_ISH_BAD_EXP_ROM_READ (1u << 10u) 104*f52228b8SJoe Beteta 105*f52228b8SJoe Beteta 106*f52228b8SJoe Beteta #define FIT_INT_DEF_MASK \ 107*f52228b8SJoe Beteta (FIT_ISH_FW_STATE_CHANGE | \ 108*f52228b8SJoe Beteta FIT_ISH_COMPLETION_POSTED | \ 109*f52228b8SJoe Beteta FIT_ISH_MSG_FROM_DEV | \ 110*f52228b8SJoe Beteta FIT_ISH_Q0_FULL | \ 111*f52228b8SJoe Beteta FIT_ISH_Q1_FULL | \ 112*f52228b8SJoe Beteta FIT_ISH_Q2_FULL | \ 113*f52228b8SJoe Beteta FIT_ISH_Q3_FULL | \ 114*f52228b8SJoe Beteta FIT_ISH_QCMD_FIFO_OVERRUN | \ 115*f52228b8SJoe Beteta FIT_ISH_BAD_EXP_ROM_READ) 116*f52228b8SJoe Beteta 117*f52228b8SJoe Beteta #define FIT_INT_QUEUE_FULL \ 118*f52228b8SJoe Beteta (FIT_ISH_Q0_FULL | \ 119*f52228b8SJoe Beteta FIT_ISH_Q1_FULL | \ 120*f52228b8SJoe Beteta FIT_ISH_Q2_FULL | \ 121*f52228b8SJoe Beteta FIT_ISH_Q3_FULL) 122*f52228b8SJoe Beteta 123*f52228b8SJoe Beteta 124*f52228b8SJoe Beteta #define MSI_MSG_NWL_ERROR_0 0x00000000 125*f52228b8SJoe Beteta #define MSI_MSG_NWL_ERROR_1 0x00000001 126*f52228b8SJoe Beteta #define MSI_MSG_NWL_ERROR_2 0x00000002 127*f52228b8SJoe Beteta #define MSI_MSG_NWL_ERROR_3 0x00000003 128*f52228b8SJoe Beteta #define MSI_MSG_STATE_CHANGE 0x00000004 129*f52228b8SJoe Beteta #define MSI_MSG_COMPLETION_POSTED 0x00000005 130*f52228b8SJoe Beteta #define MSI_MSG_MSG_FROM_DEV 0x00000006 131*f52228b8SJoe Beteta #define MSI_MSG_RESERVED_0 0x00000007 132*f52228b8SJoe Beteta #define MSI_MSG_RESERVED_1 0x00000008 133*f52228b8SJoe Beteta #define MSI_MSG_QUEUE_0_FULL 0x00000009 134*f52228b8SJoe Beteta #define MSI_MSG_QUEUE_1_FULL 0x0000000A 135*f52228b8SJoe Beteta #define MSI_MSG_QUEUE_2_FULL 0x0000000B 136*f52228b8SJoe Beteta #define MSI_MSG_QUEUE_3_FULL 0x0000000C 137*f52228b8SJoe Beteta 138*f52228b8SJoe Beteta 139*f52228b8SJoe Beteta 140*f52228b8SJoe Beteta #define FIT_INT_RESERVED_MASK \ 141*f52228b8SJoe Beteta (FIT_ISH_UNDEFINED_3 | \ 142*f52228b8SJoe Beteta FIT_ISH_UNDEFINED_4) 143*f52228b8SJoe Beteta /* 144*f52228b8SJoe Beteta * Interrupt mask, 32-bit r/w 145*f52228b8SJoe Beteta * Bit definitions are the same as FIT_INT_STATUS_HOST 146*f52228b8SJoe Beteta */ 147*f52228b8SJoe Beteta #define FIT_INT_MASK_HOST 0x528u 148*f52228b8SJoe Beteta 149*f52228b8SJoe Beteta 150*f52228b8SJoe Beteta /* 151*f52228b8SJoe Beteta * Message to device, 32-bit r/w 152*f52228b8SJoe Beteta */ 153*f52228b8SJoe Beteta #define FIT_MSG_TO_DEVICE 0x540u 154*f52228b8SJoe Beteta 155*f52228b8SJoe Beteta /* 156*f52228b8SJoe Beteta * Message from device, 32-bit, r/o 157*f52228b8SJoe Beteta */ 158*f52228b8SJoe Beteta #define FIT_MSG_FROM_DEVICE 0x548u 159*f52228b8SJoe Beteta 160*f52228b8SJoe Beteta 161*f52228b8SJoe Beteta /* 162*f52228b8SJoe Beteta * 32-bit messages to/from device, composition/extraction macros 163*f52228b8SJoe Beteta */ 164*f52228b8SJoe Beteta #define FIT_MXD_CONS(TYPE, PARAM, DATA) \ 165*f52228b8SJoe Beteta ((((TYPE) & 0xFFu) << 24u) | \ 166*f52228b8SJoe Beteta (((PARAM) & 0xFFu) << 16u) | \ 167*f52228b8SJoe Beteta (((DATA) & 0xFFFFu) << 0u)) 168*f52228b8SJoe Beteta #define FIT_MXD_TYPE(MXD) (((MXD) >> 24u) & 0xFFu) 169*f52228b8SJoe Beteta #define FIT_MXD_PARAM(MXD) (((MXD) >> 16u) & 0xFFu) 170*f52228b8SJoe Beteta #define FIT_MXD_DATA(MXD) (((MXD) >> 0u) & 0xFFFFu) 171*f52228b8SJoe Beteta 172*f52228b8SJoe Beteta 173*f52228b8SJoe Beteta /* 174*f52228b8SJoe Beteta * Types of messages to/from device 175*f52228b8SJoe Beteta */ 176*f52228b8SJoe Beteta #define FIT_MTD_FITFW_INIT 0x01u 177*f52228b8SJoe Beteta #define FIT_MTD_GET_CMDQ_DEPTH 0x02u 178*f52228b8SJoe Beteta #define FIT_MTD_SET_COMPQ_DEPTH 0x03u 179*f52228b8SJoe Beteta #define FIT_MTD_SET_COMPQ_ADDR 0x04u 180*f52228b8SJoe Beteta #define FIT_MTD_ARM_QUEUE 0x05u 181*f52228b8SJoe Beteta #define FIT_MTD_CMD_LOG_HOST_ID 0x07u 182*f52228b8SJoe Beteta #define FIT_MTD_CMD_LOG_TIME_STAMP_LO 0x08u 183*f52228b8SJoe Beteta #define FIT_MTD_CMD_LOG_TIME_STAMP_HI 0x09u 184*f52228b8SJoe Beteta #define FIT_MFD_SMART_EXCEEDED 0x10u 185*f52228b8SJoe Beteta #define FIT_MFD_POWER_DOWN 0x11u 186*f52228b8SJoe Beteta #define FIT_MFD_OFFLINE 0x12u 187*f52228b8SJoe Beteta #define FIT_MFD_ONLINE 0x13u 188*f52228b8SJoe Beteta #define FIT_MFD_FW_RESTARTING 0x14u 189*f52228b8SJoe Beteta #define FIT_MFD_PM_ACTIVE 0x15u 190*f52228b8SJoe Beteta #define FIT_MFD_PM_STANDBY 0x16u 191*f52228b8SJoe Beteta #define FIT_MFD_PM_SLEEP 0x17u 192*f52228b8SJoe Beteta #define FIT_MFD_CMD_PROGRESS 0x18u 193*f52228b8SJoe Beteta 194*f52228b8SJoe Beteta #ifndef SKD_OMIT_FROM_SRC_DIST 195*f52228b8SJoe Beteta #define FIT_MTD_DEBUG 0xFEu 196*f52228b8SJoe Beteta #define FIT_MFD_DEBUG 0xFFu 197*f52228b8SJoe Beteta #endif /* SKD_OMIT_FROM_SRC_DIST */ 198*f52228b8SJoe Beteta 199*f52228b8SJoe Beteta #define FIT_MFD_MASK (0xFFu) 200*f52228b8SJoe Beteta #define FIT_MFD_DATA_MASK (0xFFu) 201*f52228b8SJoe Beteta #define FIT_MFD_MSG(x) (((x) >> 24) & FIT_MFD_MASK) 202*f52228b8SJoe Beteta #define FIT_MFD_DATA(x) ((x) & FIT_MFD_MASK) 203*f52228b8SJoe Beteta 204*f52228b8SJoe Beteta 205*f52228b8SJoe Beteta /* 206*f52228b8SJoe Beteta * Extra arg to FIT_MSG_TO_DEVICE, 64-bit r/w 207*f52228b8SJoe Beteta * Used to set completion queue address (FIT_MTD_SET_COMPQ_ADDR) 208*f52228b8SJoe Beteta * (was Response buffer in docs) 209*f52228b8SJoe Beteta */ 210*f52228b8SJoe Beteta #define FIT_MSG_TO_DEVICE_ARG 0x580u 211*f52228b8SJoe Beteta 212*f52228b8SJoe Beteta /* 213*f52228b8SJoe Beteta * Hardware (ASIC) version, 32-bit r/o 214*f52228b8SJoe Beteta */ 215*f52228b8SJoe Beteta #define FIT_HW_VERSION 0x588u 216*f52228b8SJoe Beteta 217*f52228b8SJoe Beteta /* 218*f52228b8SJoe Beteta * Scatter/gather list descriptor. 219*f52228b8SJoe Beteta * 32-bytes and must be aligned on a 32-byte boundary. 220*f52228b8SJoe Beteta * All fields are in little endian order. 221*f52228b8SJoe Beteta */ 222*f52228b8SJoe Beteta struct fit_sg_descriptor { 223*f52228b8SJoe Beteta uint32_t control; 224*f52228b8SJoe Beteta uint32_t byte_count; 225*f52228b8SJoe Beteta uint64_t host_side_addr; 226*f52228b8SJoe Beteta uint64_t dev_side_addr; 227*f52228b8SJoe Beteta uint64_t next_desc_ptr; 228*f52228b8SJoe Beteta }; 229*f52228b8SJoe Beteta 230*f52228b8SJoe Beteta #define FIT_SGD_CONTROL_NOT_LAST 0x000u 231*f52228b8SJoe Beteta #define FIT_SGD_CONTROL_LAST 0x40Eu 232*f52228b8SJoe Beteta 233*f52228b8SJoe Beteta /* 234*f52228b8SJoe Beteta * Header at the beginning of a FIT message. The header 235*f52228b8SJoe Beteta * is followed by SSDI requests each 64 bytes. 236*f52228b8SJoe Beteta * A FIT message can be up to 512 bytes long and must start 237*f52228b8SJoe Beteta * on a 64-byte boundary. 238*f52228b8SJoe Beteta */ 239*f52228b8SJoe Beteta struct fit_msg_hdr { 240*f52228b8SJoe Beteta uint8_t protocol_id; 241*f52228b8SJoe Beteta uint8_t num_protocol_cmds_coalesced; 242*f52228b8SJoe Beteta uint8_t _reserved1[6]; 243*f52228b8SJoe Beteta uint64_t _reserved2[7]; /* Forces alignment. */ 244*f52228b8SJoe Beteta }; 245*f52228b8SJoe Beteta 246*f52228b8SJoe Beteta #define FIT_PROTOCOL_ID_FIT 1 247*f52228b8SJoe Beteta #define FIT_PROTOCOL_ID_SSDI 2 248*f52228b8SJoe Beteta #define FIT_PROTOCOL_ID_SOFIT 3 249*f52228b8SJoe Beteta 250*f52228b8SJoe Beteta 251*f52228b8SJoe Beteta #define FIT_PROTOCOL_MINOR_VER(mtd_val) ((mtd_val >> 16) & 0xF) 252*f52228b8SJoe Beteta #define FIT_PROTOCOL_MAJOR_VER(mtd_val) ((mtd_val >> 20) & 0xF) 253*f52228b8SJoe Beteta 254*f52228b8SJoe Beteta #ifndef SKD_OMIT_FROM_SRC_DIST 255*f52228b8SJoe Beteta /* 256*f52228b8SJoe Beteta * Format of a completion entry. The completion queue is circular 257*f52228b8SJoe Beteta * and must have at least as many entries as the maximum number 258*f52228b8SJoe Beteta * of commands that may be issued to the device. 259*f52228b8SJoe Beteta * 260*f52228b8SJoe Beteta * There are no head/tail pointers. The cycle value is used to 261*f52228b8SJoe Beteta * infer the presence of new completion records. 262*f52228b8SJoe Beteta * Initially the cycle in all entries is 0, the index is 0, and 263*f52228b8SJoe Beteta * the cycle value to expect is 1. When completions are added 264*f52228b8SJoe Beteta * their cycle values are set to 1. When the index wraps the 265*f52228b8SJoe Beteta * cycle value to expect is incremented. 266*f52228b8SJoe Beteta * 267*f52228b8SJoe Beteta * Command_context is opaque and taken verbatim from the SSDI command. 268*f52228b8SJoe Beteta * All other fields are big endian. 269*f52228b8SJoe Beteta */ 270*f52228b8SJoe Beteta #endif /* SKD_OMIT_FROM_SRC_DIST */ 271*f52228b8SJoe Beteta #define FIT_PROTOCOL_VERSION_0 0 272*f52228b8SJoe Beteta 273*f52228b8SJoe Beteta /* 274*f52228b8SJoe Beteta * Protocol major version 1 completion entry. 275*f52228b8SJoe Beteta * The major protocol version is found in bits 276*f52228b8SJoe Beteta * 20-23 of the FIT_MTD_FITFW_INIT response. 277*f52228b8SJoe Beteta */ 278*f52228b8SJoe Beteta struct fit_completion_entry_v1 279*f52228b8SJoe Beteta { 280*f52228b8SJoe Beteta uint32_t num_returned_bytes; 281*f52228b8SJoe Beteta uint16_t tag; 282*f52228b8SJoe Beteta uint8_t status; /* SCSI status */ 283*f52228b8SJoe Beteta uint8_t cycle; 284*f52228b8SJoe Beteta }; 285*f52228b8SJoe Beteta 286*f52228b8SJoe Beteta #define FIT_PROTOCOL_VERSION_1 1 287*f52228b8SJoe Beteta #define FIT_PROTOCOL_VERSION_CURRENT FIT_PROTOCOL_VERSION_1 288*f52228b8SJoe Beteta 289*f52228b8SJoe Beteta struct fit_comp_error_info { 290*f52228b8SJoe Beteta uint8_t type : 7; /* 00: Bits0-6 indicates the type of sense data. */ 291*f52228b8SJoe Beteta uint8_t valid : 1; /* 00: Bit 7 := 1 ==> info field is valid. */ 292*f52228b8SJoe Beteta uint8_t reserved0; /* 01: Obsolete field */ 293*f52228b8SJoe Beteta uint8_t key : 4; /* 02: Bits0-3 indicate the sense key. */ 294*f52228b8SJoe Beteta uint8_t reserved2 : 1; /* 02: Reserved bit. */ 295*f52228b8SJoe Beteta uint8_t bad_length : 1; /* 02: Incorrect Length Indicator */ 296*f52228b8SJoe Beteta uint8_t end_medium : 1; /* 02: End of Medium */ 297*f52228b8SJoe Beteta uint8_t file_mark : 1; /* 02: Filemark */ 298*f52228b8SJoe Beteta uint8_t info[4]; /* 03: */ 299*f52228b8SJoe Beteta uint8_t reserved1; /* 07: Additional Sense Length */ 300*f52228b8SJoe Beteta uint8_t cmd_spec[4]; /* 08: Command Specific Information */ 301*f52228b8SJoe Beteta uint8_t code; /* 0C: Additional Sense Code */ 302*f52228b8SJoe Beteta uint8_t qual; /* 0D: Additional Sense Code Qualifier */ 303*f52228b8SJoe Beteta uint8_t fruc; /* 0E: Field Replaceable Unit Code */ 304*f52228b8SJoe Beteta uint8_t sks_high : 7; /* 0F: Sense Key Specific (MSB) */ 305*f52228b8SJoe Beteta uint8_t sks_valid : 1; /* 0F: Sense Key Specific Valid */ 306*f52228b8SJoe Beteta uint16_t sks_low; /* 10: Sense Key Specific (LSW) */ 307*f52228b8SJoe Beteta uint16_t reserved3; /* 12: Part of additional sense bytes (unused) */ 308*f52228b8SJoe Beteta uint16_t uec; /* 14: Additional Sense Bytes */ 309*f52228b8SJoe Beteta uint64_t per; /* 16: Additional Sense Bytes */ 310*f52228b8SJoe Beteta uint8_t reserved4[2]; /* 1E: Additional Sense Bytes (unused) */ 311*f52228b8SJoe Beteta }; 312*f52228b8SJoe Beteta 313*f52228b8SJoe Beteta 314*f52228b8SJoe Beteta /* Task management constants */ 315*f52228b8SJoe Beteta #define SOFT_TASK_SIMPLE 0x00 316*f52228b8SJoe Beteta #define SOFT_TASK_HEAD_OF_QUEUE 0x01 317*f52228b8SJoe Beteta #define SOFT_TASK_ORDERED 0x02 318*f52228b8SJoe Beteta 319*f52228b8SJoe Beteta 320*f52228b8SJoe Beteta /* 321*f52228b8SJoe Beteta * Version zero has the last 32 bits reserved, 322*f52228b8SJoe Beteta * Version one has the last 32 bits sg_list_len_bytes; 323*f52228b8SJoe Beteta */ 324*f52228b8SJoe Beteta struct skd_command_header 325*f52228b8SJoe Beteta { 326*f52228b8SJoe Beteta uint64_t sg_list_dma_address; 327*f52228b8SJoe Beteta uint16_t tag; 328*f52228b8SJoe Beteta uint8_t attribute; 329*f52228b8SJoe Beteta uint8_t add_cdb_len; /* In 32 bit words */ 330*f52228b8SJoe Beteta uint32_t sg_list_len_bytes; 331*f52228b8SJoe Beteta }; 332*f52228b8SJoe Beteta 333*f52228b8SJoe Beteta struct skd_scsi_request 334*f52228b8SJoe Beteta { 335*f52228b8SJoe Beteta struct skd_command_header hdr; 336*f52228b8SJoe Beteta unsigned char cdb[16]; 337*f52228b8SJoe Beteta }; 338*f52228b8SJoe Beteta 339*f52228b8SJoe Beteta struct driver_inquiry_data { 340*f52228b8SJoe Beteta uint8_t peripheralDeviceType : 5; 341*f52228b8SJoe Beteta uint8_t qualifier : 3; 342*f52228b8SJoe Beteta uint8_t pageCode; 343*f52228b8SJoe Beteta uint16_t pageLength; 344*f52228b8SJoe Beteta uint16_t pcieBusNumber; 345*f52228b8SJoe Beteta uint8_t pcieDeviceNumber; 346*f52228b8SJoe Beteta uint8_t pcieFunctionNumber; 347*f52228b8SJoe Beteta uint8_t pcieLinkSpeed; 348*f52228b8SJoe Beteta uint8_t pcieLinkLanes; 349*f52228b8SJoe Beteta uint16_t pcieVendorId; 350*f52228b8SJoe Beteta uint16_t pcieDeviceId; 351*f52228b8SJoe Beteta uint16_t pcieSubsystemVendorId; 352*f52228b8SJoe Beteta uint16_t pcieSubsystemDeviceId; 353*f52228b8SJoe Beteta uint8_t reserved1[2]; 354*f52228b8SJoe Beteta uint8_t reserved2[3]; 355*f52228b8SJoe Beteta uint8_t driverVersionLength; 356*f52228b8SJoe Beteta uint8_t driverVersion[0x14]; 357*f52228b8SJoe Beteta }; 358*f52228b8SJoe Beteta 359*f52228b8SJoe Beteta #endif /* _SKD_S1120_H */ 360