Go to the documentation of this file.
48 #define ARCMSR_MAX_OUTSTANDING_CMD 256
50 #define ARCMSR_MAX_FREECCB_NUM 160
52 #define ARCMSR_MAX_FREECCB_NUM 320
54 #define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2010/08/05"
55 #define ARCMSR_SCSI_INITIATOR_ID 255
56 #define ARCMSR_MAX_XFER_SECTORS 512
57 #define ARCMSR_MAX_XFER_SECTORS_B 4096
58 #define ARCMSR_MAX_XFER_SECTORS_C 304
59 #define ARCMSR_MAX_TARGETID 17
60 #define ARCMSR_MAX_TARGETLUN 8
61 #define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD
62 #define ARCMSR_MAX_QBUFFER 4096
63 #define ARCMSR_DEFAULT_SG_ENTRIES 38
64 #define ARCMSR_MAX_HBB_POSTQUEUE 264
65 #define ARCMSR_MAX_XFER_LEN 0x26000
66 #define ARCMSR_CDB_SG_PAGE_LENGTH 256
67 #ifndef PCI_DEVICE_ID_ARECA_1880
68 #define PCI_DEVICE_ID_ARECA_1880 0x1880
82 #define dma_addr_hi32(addr) (uint32_t) ((addr>>16)>>16)
83 #define dma_addr_lo32(addr) (uint32_t) (addr & 0xffffffff)
109 #define ARCMSR_MESSAGE_FAIL 0x0001
111 #define ARECA_SATA_RAID 0x90000000
113 #define FUNCTION_READ_RQBUFFER 0x0801
114 #define FUNCTION_WRITE_WQBUFFER 0x0802
115 #define FUNCTION_CLEAR_RQBUFFER 0x0803
116 #define FUNCTION_CLEAR_WQBUFFER 0x0804
117 #define FUNCTION_CLEAR_ALLQBUFFER 0x0805
118 #define FUNCTION_RETURN_CODE_3F 0x0806
119 #define FUNCTION_SAY_HELLO 0x0807
120 #define FUNCTION_SAY_GOODBYE 0x0808
121 #define FUNCTION_FLUSH_ADAPTER_CACHE 0x0809
122 #define FUNCTION_GET_FIRMWARE_STATUS 0x080A
123 #define FUNCTION_HARDWARE_RESET 0x080B
125 #define ARCMSR_MESSAGE_READ_RQBUFFER \
126 ARECA_SATA_RAID | FUNCTION_READ_RQBUFFER
127 #define ARCMSR_MESSAGE_WRITE_WQBUFFER \
128 ARECA_SATA_RAID | FUNCTION_WRITE_WQBUFFER
129 #define ARCMSR_MESSAGE_CLEAR_RQBUFFER \
130 ARECA_SATA_RAID | FUNCTION_CLEAR_RQBUFFER
131 #define ARCMSR_MESSAGE_CLEAR_WQBUFFER \
132 ARECA_SATA_RAID | FUNCTION_CLEAR_WQBUFFER
133 #define ARCMSR_MESSAGE_CLEAR_ALLQBUFFER \
134 ARECA_SATA_RAID | FUNCTION_CLEAR_ALLQBUFFER
135 #define ARCMSR_MESSAGE_RETURN_CODE_3F \
136 ARECA_SATA_RAID | FUNCTION_RETURN_CODE_3F
137 #define ARCMSR_MESSAGE_SAY_HELLO \
138 ARECA_SATA_RAID | FUNCTION_SAY_HELLO
139 #define ARCMSR_MESSAGE_SAY_GOODBYE \
140 ARECA_SATA_RAID | FUNCTION_SAY_GOODBYE
141 #define ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE \
142 ARECA_SATA_RAID | FUNCTION_FLUSH_ADAPTER_CACHE
144 #define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001
145 #define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006
146 #define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F
147 #define ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON 0x00000088
153 #define IS_DMA64 (sizeof(dma_addr_t) == 8)
154 #define IS_SG64_ADDR 0x01000000
197 #define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060
198 #define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063
200 #define ARCMSR_INBOUND_MESG0_NOP 0x00000000
201 #define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001
202 #define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002
203 #define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003
204 #define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004
205 #define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005
206 #define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006
207 #define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007
208 #define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008
210 #define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001
211 #define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002
212 #define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001
213 #define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002
215 #define ARCMSR_CCBPOST_FLAG_SGL_BSIZE 0x80000000
216 #define ARCMSR_CCBPOST_FLAG_IAM_BIOS 0x40000000
217 #define ARCMSR_CCBREPLY_FLAG_IAM_BIOS 0x40000000
218 #define ARCMSR_CCBREPLY_FLAG_ERROR_MODE0 0x10000000
219 #define ARCMSR_CCBREPLY_FLAG_ERROR_MODE1 0x00000001
221 #define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000
223 #define ARCMSR_ARC1680_BUS_RESET 0x00000003
225 #define ARCMSR_ARC1880_RESET_ADAPTER 0x00000024
226 #define ARCMSR_ARC1880_DiagWrite_ENABLE 0x00000080
235 #define ARCMSR_DRV2IOP_DOORBELL 0x00020400
236 #define ARCMSR_DRV2IOP_DOORBELL_MASK 0x00020404
238 #define ARCMSR_IOP2DRV_DOORBELL 0x00020408
239 #define ARCMSR_IOP2DRV_DOORBELL_MASK 0x0002040C
242 #define ARCMSR_IOP2DRV_DATA_WRITE_OK 0x00000001
244 #define ARCMSR_IOP2DRV_DATA_READ_OK 0x00000002
245 #define ARCMSR_IOP2DRV_CDB_DONE 0x00000004
246 #define ARCMSR_IOP2DRV_MESSAGE_CMD_DONE 0x00000008
248 #define ARCMSR_DOORBELL_HANDLE_INT 0x0000000F
249 #define ARCMSR_DOORBELL_INT_CLEAR_PATTERN 0xFF00FFF0
250 #define ARCMSR_MESSAGE_INT_CLEAR_PATTERN 0xFF00FFF7
252 #define ARCMSR_MESSAGE_GET_CONFIG 0x00010008
254 #define ARCMSR_MESSAGE_SET_CONFIG 0x00020008
256 #define ARCMSR_MESSAGE_ABORT_CMD 0x00030008
258 #define ARCMSR_MESSAGE_STOP_BGRB 0x00040008
260 #define ARCMSR_MESSAGE_FLUSH_CACHE 0x00050008
262 #define ARCMSR_MESSAGE_START_BGRB 0x00060008
263 #define ARCMSR_MESSAGE_START_DRIVER_MODE 0x000E0008
264 #define ARCMSR_MESSAGE_SET_POST_WINDOW 0x000F0008
265 #define ARCMSR_MESSAGE_ACTIVE_EOI_MODE 0x00100008
267 #define ARCMSR_MESSAGE_FIRMWARE_OK 0x80000000
269 #define ARCMSR_DRV2IOP_DATA_WRITE_OK 0x00000001
271 #define ARCMSR_DRV2IOP_DATA_READ_OK 0x00000002
272 #define ARCMSR_DRV2IOP_CDB_POSTED 0x00000004
273 #define ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED 0x00000008
274 #define ARCMSR_DRV2IOP_END_OF_INTERRUPT 0x00000010
278 #define ARCMSR_MESSAGE_WBUFFER 0x0000fe00
280 #define ARCMSR_MESSAGE_RBUFFER 0x0000ff00
282 #define ARCMSR_MESSAGE_RWBUFFER 0x0000fa00
288 #define ARCMSR_HBC_ISR_THROTTLING_LEVEL 12
289 #define ARCMSR_HBC_ISR_MAX_DONE_QUEUE 20
291 #define ARCMSR_HBCMU_UTILITY_A_ISR_MASK 0x00000001
292 #define ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR_MASK 0x00000004
293 #define ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR_MASK 0x00000008
294 #define ARCMSR_HBCMU_ALL_INTMASKENABLE 0x0000000D
296 #define ARCMSR_HBCMU_UTILITY_A_ISR 0x00000001
301 #define ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR 0x00000004
308 #define ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR 0x00000008
314 #define ARCMSR_HBCMU_SAS_ALL_INT 0x00000010
320 #define ARCMSR_HBCMU_DRV2IOP_DATA_WRITE_OK 0x00000002
321 #define ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK 0x00000004
323 #define ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE 0x00000008
325 #define ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING 0x00000010
326 #define ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK 0x00000002
328 #define ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_DOORBELL_CLEAR 0x00000002
329 #define ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK 0x00000004
331 #define ARCMSR_HBCMU_IOP2DRV_DATA_READ_DOORBELL_CLEAR 0x00000004
333 #define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE 0x00000008
335 #define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR 0x00000008
337 #define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000
352 #define ARCMSR_CDB_FLAG_SGL_BSIZE 0x01
353 #define ARCMSR_CDB_FLAG_BIOS 0x02
354 #define ARCMSR_CDB_FLAG_WRITE 0x04
355 #define ARCMSR_CDB_FLAG_SIMPLEQ 0x00
356 #define ARCMSR_CDB_FLAG_HEADQ 0x08
357 #define ARCMSR_CDB_FLAG_ORDEREDQ 0x10
364 #define ARCMSR_DEV_CHECK_CONDITION 0x02
365 #define ARCMSR_DEV_SELECT_TIMEOUT 0xF0
366 #define ARCMSR_DEV_ABORTED 0xF1
367 #define ARCMSR_DEV_INIT_FAIL 0xF2
504 #define ACB_ADAPTER_TYPE_A 0x00000001
505 #define ACB_ADAPTER_TYPE_B 0x00000002
506 #define ACB_ADAPTER_TYPE_C 0x00000004
507 #define ACB_ADAPTER_TYPE_D 0x00000008
528 #define ACB_F_SCSISTOPADAPTER 0x0001
529 #define ACB_F_MSG_STOP_BGRB 0x0002
531 #define ACB_F_MSG_START_BGRB 0x0004
533 #define ACB_F_IOPDATA_OVERFLOW 0x0008
535 #define ACB_F_MESSAGE_WQBUFFER_CLEARED 0x0010
537 #define ACB_F_MESSAGE_RQBUFFER_CLEARED 0x0020
539 #define ACB_F_MESSAGE_WQBUFFER_READED 0x0040
540 #define ACB_F_BUS_RESET 0x0080
541 #define ACB_F_BUS_HANG_ON 0x0800
543 #define ACB_F_IOP_INITED 0x0100
545 #define ACB_F_ABORT 0x0200
546 #define ACB_F_FIRMWARE_TRAP 0x0400
576 #define ARECA_RAID_GONE 0x55
577 #define ARECA_RAID_GOOD 0xaa
592 #define FW_NORMAL 0x0000
593 #define FW_BOG 0x0001
594 #define FW_DEADLOCK 0x0010
612 #define CCB_FLAG_READ 0x0000
613 #define CCB_FLAG_WRITE 0x0001
614 #define CCB_FLAG_ERROR 0x0002
615 #define CCB_FLAG_FLUSHCACHE 0x0004
616 #define CCB_FLAG_MASTER_ABORTED 0x0008
618 #define ARCMSR_CCB_DONE 0x0000
619 #define ARCMSR_CCB_START 0x55AA
620 #define ARCMSR_CCB_ABORTED 0xAA55
621 #define ARCMSR_CCB_ILLEGAL 0xFFFF
622 #if BITS_PER_LONG == 64
640 #define SCSI_SENSE_CURRENT_ERRORS 0x70
641 #define SCSI_SENSE_DEFERRED_ERRORS 0x71
662 #define ARCMSR_MU_OUTBOUND_INTERRUPT_STATUS_REG 0x30
663 #define ARCMSR_MU_OUTBOUND_PCI_INT 0x10
664 #define ARCMSR_MU_OUTBOUND_POSTQUEUE_INT 0x08
665 #define ARCMSR_MU_OUTBOUND_DOORBELL_INT 0x04
666 #define ARCMSR_MU_OUTBOUND_MESSAGE1_INT 0x02
667 #define ARCMSR_MU_OUTBOUND_MESSAGE0_INT 0x01
668 #define ARCMSR_MU_OUTBOUND_HANDLE_INT \
669 (ARCMSR_MU_OUTBOUND_MESSAGE0_INT \
670 |ARCMSR_MU_OUTBOUND_MESSAGE1_INT \
671 |ARCMSR_MU_OUTBOUND_DOORBELL_INT \
672 |ARCMSR_MU_OUTBOUND_POSTQUEUE_INT \
673 |ARCMSR_MU_OUTBOUND_PCI_INT)
679 #define ARCMSR_MU_OUTBOUND_INTERRUPT_MASK_REG 0x34
680 #define ARCMSR_MU_OUTBOUND_PCI_INTMASKENABLE 0x10
681 #define ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE 0x08
682 #define ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE 0x04
683 #define ARCMSR_MU_OUTBOUND_MESSAGE1_INTMASKENABLE 0x02
684 #define ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE 0x01
685 #define ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE 0x1F