0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 #ifndef _SCU_COMPLETION_CODES_HEADER_
0057 #define _SCU_COMPLETION_CODES_HEADER_
0058
0059
0060
0061
0062
0063
0064
0065
0066 #define SCU_COMPLETION_TYPE_SHIFT 28
0067 #define SCU_COMPLETION_TYPE_MASK 0x70000000
0068
0069
0070
0071
0072
0073
0074 #define SCU_COMPLETION_TYPE(type) \
0075 ((u32)(type) << SCU_COMPLETION_TYPE_SHIFT)
0076
0077
0078
0079
0080
0081
0082 #define SCU_COMPLETION_TYPE_TASK SCU_COMPLETION_TYPE(0)
0083 #define SCU_COMPLETION_TYPE_SDMA SCU_COMPLETION_TYPE(1)
0084 #define SCU_COMPLETION_TYPE_UFI SCU_COMPLETION_TYPE(2)
0085 #define SCU_COMPLETION_TYPE_EVENT SCU_COMPLETION_TYPE(3)
0086 #define SCU_COMPLETION_TYPE_NOTIFY SCU_COMPLETION_TYPE(4)
0087
0088
0089
0090
0091
0092
0093
0094 #define SCU_COMPLETION_STATUS_MASK 0x0FFC0000
0095 #define SCU_COMPLETION_TL_STATUS_MASK 0x0FC00000
0096 #define SCU_COMPLETION_TL_STATUS_SHIFT 22
0097 #define SCU_COMPLETION_SDMA_STATUS_MASK 0x003C0000
0098 #define SCU_COMPLETION_PEG_MASK 0x00010000
0099 #define SCU_COMPLETION_PORT_MASK 0x00007000
0100 #define SCU_COMPLETION_PE_MASK SCU_COMPLETION_PORT_MASK
0101 #define SCU_COMPLETION_PE_SHIFT 12
0102 #define SCU_COMPLETION_INDEX_MASK 0x00000FFF
0103
0104
0105
0106
0107
0108
0109 #define SCU_GET_COMPLETION_TYPE(completion_code) \
0110 ((completion_code) & SCU_COMPLETION_TYPE_MASK)
0111
0112
0113
0114
0115
0116
0117 #define SCU_GET_COMPLETION_STATUS(completion_code) \
0118 ((completion_code) & SCU_COMPLETION_STATUS_MASK)
0119
0120
0121
0122
0123
0124
0125 #define SCU_GET_COMPLETION_TL_STATUS(completion_code) \
0126 ((completion_code) & SCU_COMPLETION_TL_STATUS_MASK)
0127
0128
0129
0130
0131
0132
0133
0134
0135 #define SCU_MAKE_COMPLETION_STATUS(completion_code) \
0136 ((u32)(completion_code) << SCU_COMPLETION_TL_STATUS_SHIFT)
0137
0138
0139
0140
0141
0142
0143
0144 #define SCU_NORMALIZE_COMPLETION_STATUS(completion_code) \
0145 (\
0146 ((completion_code) & SCU_COMPLETION_TL_STATUS_MASK) \
0147 >> SCU_COMPLETION_TL_STATUS_SHIFT \
0148 )
0149
0150
0151
0152
0153
0154
0155 #define SCU_GET_COMPLETION_SDMA_STATUS(completion_code) \
0156 ((completion_code) & SCU_COMPLETION_SDMA_STATUS_MASK)
0157
0158
0159
0160
0161
0162
0163 #define SCU_GET_COMPLETION_PEG(completion_code) \
0164 ((completion_code) & SCU_COMPLETION_PEG_MASK)
0165
0166
0167
0168
0169
0170
0171 #define SCU_GET_COMPLETION_PORT(completion_code) \
0172 ((completion_code) & SCU_COMPLETION_PORT_MASK)
0173
0174
0175
0176
0177
0178
0179 #define SCU_GET_PROTOCOL_ENGINE_INDEX(completion_code) \
0180 (((completion_code) & SCU_COMPLETION_PE_MASK) >> SCU_COMPLETION_PE_SHIFT)
0181
0182
0183
0184
0185
0186
0187
0188 #define SCU_GET_COMPLETION_INDEX(completion_code) \
0189 ((completion_code) & SCU_COMPLETION_INDEX_MASK)
0190
0191 #define SCU_UNSOLICITED_FRAME_MASK 0x0FFF0000
0192 #define SCU_UNSOLICITED_FRAME_SHIFT 16
0193
0194
0195
0196
0197
0198
0199
0200 #define SCU_GET_FRAME_INDEX(completion_code) \
0201 (\
0202 ((completion_code) & SCU_UNSOLICITED_FRAME_MASK) \
0203 >> SCU_UNSOLICITED_FRAME_SHIFT \
0204 )
0205
0206 #define SCU_UNSOLICITED_FRAME_ERROR_MASK 0x00008000
0207
0208
0209
0210
0211
0212
0213
0214 #define SCU_GET_FRAME_ERROR(completion_code) \
0215 ((completion_code) & SCU_UNSOLICITED_FRAME_ERROR_MASK)
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226 #define SCU_TASK_DONE_GOOD ((u32)0x00)
0227 #define SCU_TASK_DONE_TX_RAW_CMD_ERR ((u32)0x08)
0228 #define SCU_TASK_DONE_CRC_ERR ((u32)0x14)
0229 #define SCU_TASK_DONE_CHECK_RESPONSE ((u32)0x14)
0230 #define SCU_TASK_DONE_GEN_RESPONSE ((u32)0x15)
0231 #define SCU_TASK_DONE_NAK_CMD_ERR ((u32)0x16)
0232 #define SCU_TASK_DONE_CMD_LL_R_ERR ((u32)0x16)
0233 #define SCU_TASK_DONE_LL_R_ERR ((u32)0x17)
0234 #define SCU_TASK_DONE_ACK_NAK_TO ((u32)0x17)
0235 #define SCU_TASK_DONE_LL_PERR ((u32)0x18)
0236 #define SCU_TASK_DONE_LL_SY_TERM ((u32)0x19)
0237 #define SCU_TASK_DONE_NAK_ERR ((u32)0x19)
0238 #define SCU_TASK_DONE_LL_LF_TERM ((u32)0x1A)
0239 #define SCU_TASK_DONE_DATA_LEN_ERR ((u32)0x1A)
0240 #define SCU_TASK_DONE_LL_CL_TERM ((u32)0x1B)
0241 #define SCU_TASK_DONE_BREAK_RCVD ((u32)0x1B)
0242 #define SCU_TASK_DONE_LL_ABORT_ERR ((u32)0x1B)
0243 #define SCU_TASK_DONE_SEQ_INV_TYPE ((u32)0x1C)
0244 #define SCU_TASK_DONE_UNEXP_XR ((u32)0x1C)
0245 #define SCU_TASK_DONE_INV_FIS_TYPE ((u32)0x1D)
0246 #define SCU_TASK_DONE_XR_IU_LEN_ERR ((u32)0x1D)
0247 #define SCU_TASK_DONE_INV_FIS_LEN ((u32)0x1E)
0248 #define SCU_TASK_DONE_XR_WD_LEN ((u32)0x1E)
0249 #define SCU_TASK_DONE_SDMA_ERR ((u32)0x1F)
0250 #define SCU_TASK_DONE_OFFSET_ERR ((u32)0x20)
0251 #define SCU_TASK_DONE_MAX_PLD_ERR ((u32)0x21)
0252 #define SCU_TASK_DONE_EXCESS_DATA ((u32)0x22)
0253 #define SCU_TASK_DONE_LF_ERR ((u32)0x23)
0254 #define SCU_TASK_DONE_UNEXP_FIS ((u32)0x24)
0255 #define SCU_TASK_DONE_UNEXP_RESP ((u32)0x24)
0256 #define SCU_TASK_DONE_EARLY_RESP ((u32)0x25)
0257 #define SCU_TASK_DONE_SMP_RESP_TO_ERR ((u32)0x26)
0258 #define SCU_TASK_DONE_DMASETUP_DIRERR ((u32)0x27)
0259 #define SCU_TASK_DONE_SMP_UFI_ERR ((u32)0x27)
0260 #define SCU_TASK_DONE_XFERCNT_ERR ((u32)0x28)
0261 #define SCU_TASK_DONE_SMP_FRM_TYPE_ERR ((u32)0x28)
0262 #define SCU_TASK_DONE_SMP_LL_RX_ERR ((u32)0x29)
0263 #define SCU_TASK_DONE_RESP_LEN_ERR ((u32)0x2A)
0264 #define SCU_TASK_DONE_UNEXP_DATA ((u32)0x2B)
0265 #define SCU_TASK_DONE_OPEN_FAIL ((u32)0x2C)
0266 #define SCU_TASK_DONE_UNEXP_SDBFIS ((u32)0x2D)
0267 #define SCU_TASK_DONE_REG_ERR ((u32)0x2E)
0268 #define SCU_TASK_DONE_SDB_ERR ((u32)0x2F)
0269 #define SCU_TASK_DONE_TASK_ABORT ((u32)0x30)
0270 #define SCU_TASK_DONE_CMD_SDMA_ERR ((U32)0x32)
0271 #define SCU_TASK_DONE_CMD_LL_ABORT_ERR ((U32)0x33)
0272 #define SCU_TASK_OPEN_REJECT_WRONG_DESTINATION ((u32)0x34)
0273 #define SCU_TASK_OPEN_REJECT_RESERVED_ABANDON_1 ((u32)0x35)
0274 #define SCU_TASK_OPEN_REJECT_RESERVED_ABANDON_2 ((u32)0x36)
0275 #define SCU_TASK_OPEN_REJECT_RESERVED_ABANDON_3 ((u32)0x37)
0276 #define SCU_TASK_OPEN_REJECT_BAD_DESTINATION ((u32)0x38)
0277 #define SCU_TASK_OPEN_REJECT_ZONE_VIOLATION ((u32)0x39)
0278 #define SCU_TASK_DONE_VIIT_ENTRY_NV ((u32)0x3A)
0279 #define SCU_TASK_DONE_IIT_ENTRY_NV ((u32)0x3B)
0280 #define SCU_TASK_DONE_RNCNV_OUTBOUND ((u32)0x3C)
0281 #define SCU_TASK_OPEN_REJECT_STP_RESOURCES_BUSY ((u32)0x3D)
0282 #define SCU_TASK_OPEN_REJECT_PROTOCOL_NOT_SUPPORTED ((u32)0x3E)
0283 #define SCU_TASK_OPEN_REJECT_CONNECTION_RATE_NOT_SUPPORTED ((u32)0x3F)
0284
0285 #endif