Go to the documentation of this file.
18 #define DC395x_MAX_CMD_QUEUE 32
20 #define DC395x_MAX_QTAGS 16
21 #define DC395x_MAX_SCSI_ID 16
22 #define DC395x_MAX_CMD_PER_LUN DC395x_MAX_QTAGS
23 #define DC395x_MAX_SG_TABLESIZE 64
24 #define DC395x_MAX_SG_LISTENTRY 64
26 #define DC395x_MAX_SRB_CNT 63
28 #define DC395x_MAX_CAN_QUEUE DC395x_MAX_SRB_CNT
29 #define DC395x_END_SCAN 2
30 #define DC395x_SEL_TIMEOUT 153
31 #define DC395x_MAX_RETRIES 3
37 #define NORM_REC_LVL 0
44 #define BIT31 0x80000000
45 #define BIT30 0x40000000
46 #define BIT29 0x20000000
47 #define BIT28 0x10000000
48 #define BIT27 0x08000000
49 #define BIT26 0x04000000
50 #define BIT25 0x02000000
51 #define BIT24 0x01000000
52 #define BIT23 0x00800000
53 #define BIT22 0x00400000
54 #define BIT21 0x00200000
55 #define BIT20 0x00100000
56 #define BIT19 0x00080000
57 #define BIT18 0x00040000
58 #define BIT17 0x00020000
59 #define BIT16 0x00010000
60 #define BIT15 0x00008000
61 #define BIT14 0x00004000
62 #define BIT13 0x00002000
63 #define BIT12 0x00001000
64 #define BIT11 0x00000800
65 #define BIT10 0x00000400
66 #define BIT9 0x00000200
67 #define BIT8 0x00000100
68 #define BIT7 0x00000080
69 #define BIT6 0x00000040
70 #define BIT5 0x00000020
71 #define BIT4 0x00000010
72 #define BIT3 0x00000008
73 #define BIT2 0x00000004
74 #define BIT1 0x00000002
75 #define BIT0 0x00000001
78 #define UNIT_ALLOCATED BIT0
79 #define UNIT_INFO_CHANGED BIT1
80 #define FORMATING_MEDIA BIT2
81 #define UNIT_RETRY BIT3
84 #define DASD_SUPPORT BIT0
85 #define SCSI_SUPPORT BIT1
86 #define ASPI_SUPPORT BIT2
89 #define SRB_FREE 0x0000
90 #define SRB_WAIT 0x0001
91 #define SRB_READY 0x0002
92 #define SRB_MSGOUT 0x0004
93 #define SRB_MSGIN 0x0008
94 #define SRB_EXTEND_MSGIN 0x0010
95 #define SRB_COMMAND 0x0020
96 #define SRB_START_ 0x0040
97 #define SRB_DISCONNECT 0x0080
98 #define SRB_DATA_XFER 0x0100
99 #define SRB_XFERPAD 0x0200
100 #define SRB_STATUS 0x0400
101 #define SRB_COMPLETED 0x0800
102 #define SRB_ABORT_SENT 0x1000
103 #define SRB_DO_SYNC_NEGO 0x2000
104 #define SRB_DO_WIDE_NEGO 0x4000
105 #define SRB_UNEXPECT_RESEL 0x8000
112 #define HCC_WIDE_CARD 0x20
113 #define HCC_SCSI_RESET 0x10
114 #define HCC_PARITY 0x08
115 #define HCC_AUTOTERM 0x04
116 #define HCC_LOW8TERM 0x02
117 #define HCC_UP8TERM 0x01
120 #define RESET_DEV BIT0
121 #define RESET_DETECT BIT1
122 #define RESET_DONE BIT2
125 #define ABORT_DEV_ BIT0
129 #define ABORTION BIT1
130 #define OVER_RUN BIT2
131 #define UNDER_RUN BIT3
132 #define PARITY_ERROR BIT4
133 #define SRB_ERROR BIT5
138 #define RESIDUAL_VALID BIT5
139 #define ENABLE_TIMER BIT4
140 #define RESET_DEV0 BIT2
141 #define ABORT_DEV BIT1
142 #define AUTO_REQSENSE BIT0
145 #define H_STATUS_GOOD 0
146 #define H_SEL_TIMEOUT 0x11
147 #define H_OVER_UNDER_RUN 0x12
148 #define H_UNEXP_BUS_FREE 0x13
149 #define H_TARGET_PHASE_F 0x14
150 #define H_INVALID_CCB_OP 0x16
151 #define H_LINK_CCB_BAD 0x17
152 #define H_BAD_TARGET_DIR 0x18
153 #define H_DUPLICATE_CCB 0x19
154 #define H_BAD_CCB_OR_SG 0x1A
155 #define H_ABORT 0x0FF
158 #define SCSI_STAT_GOOD 0x0
159 #define SCSI_STAT_CHECKCOND 0x02
160 #define SCSI_STAT_CONDMET 0x04
161 #define SCSI_STAT_BUSY 0x08
162 #define SCSI_STAT_INTER 0x10
163 #define SCSI_STAT_INTERCONDMET 0x14
164 #define SCSI_STAT_RESCONFLICT 0x18
165 #define SCSI_STAT_CMDTERM 0x22
166 #define SCSI_STAT_QUEUEFULL 0x28
167 #define SCSI_STAT_UNEXP_BUS_F 0xFD
168 #define SCSI_STAT_BUS_RST_DETECT 0xFE
169 #define SCSI_STAT_SEL_TIMEOUT 0xFF
172 #define SYNC_WIDE_TAG_ATNT_DISABLE 0
173 #define SYNC_NEGO_ENABLE BIT0
174 #define SYNC_NEGO_DONE BIT1
175 #define WIDE_NEGO_ENABLE BIT2
176 #define WIDE_NEGO_DONE BIT3
177 #define WIDE_NEGO_STATE BIT4
178 #define EN_TAG_QUEUEING BIT5
179 #define EN_ATN_STOP BIT6
181 #define SYNC_NEGO_OFFSET 15
184 #define MSG_COMPLETE 0x00
185 #define MSG_EXTENDED 0x01
186 #define MSG_SAVE_PTR 0x02
187 #define MSG_RESTORE_PTR 0x03
188 #define MSG_DISCONNECT 0x04
189 #define MSG_INITIATOR_ERROR 0x05
190 #define MSG_ABORT 0x06
191 #define MSG_REJECT_ 0x07
193 #define MSG_PARITY_ERROR 0x09
194 #define MSG_LINK_CMD_COMPL 0x0A
195 #define MSG_LINK_CMD_COMPL_FLG 0x0B
196 #define MSG_BUS_RESET 0x0C
197 #define MSG_ABORT_TAG 0x0D
198 #define MSG_SIMPLE_QTAG 0x20
199 #define MSG_HEAD_QTAG 0x21
200 #define MSG_ORDER_QTAG 0x22
201 #define MSG_IGNOREWIDE 0x23
202 #define MSG_IDENTIFY 0x80
203 #define MSG_HOST_ID 0xC0
206 #define STATUS_GOOD 0x00
207 #define CHECK_CONDITION_ 0x02
208 #define STATUS_BUSY 0x08
209 #define STATUS_INTERMEDIATE 0x10
210 #define RESERVE_CONFLICT 0x18
213 #define STATUS_MASK_ 0xFF
214 #define MSG_MASK 0xFF00
215 #define RETURN_MASK 0xFF0000
238 #define SCSI_DEVTYPE 0x1F
239 #define SCSI_PERIPHQUAL 0xE0
241 #define SCSI_REMOVABLE_MEDIA 0x80
244 #define TYPE_NODEV SCSI_DEVTYPE
246 # define TYPE_PRINTER 0x02
249 # define TYPE_COMM 0x09
257 #define SCSI_INQ_RELADR 0x80
258 #define SCSI_INQ_WBUS32 0x40
259 #define SCSI_INQ_WBUS16 0x20
260 #define SCSI_INQ_SYNC 0x10
261 #define SCSI_INQ_LINKED 0x08
262 #define SCSI_INQ_CMDQUEUE 0x02
263 #define SCSI_INQ_SFTRE 0x01
267 #define EEPROM_READ 0x80
274 #define TRM_S1040_ID 0x00
275 #define TRM_S1040_COMMAND 0x04
276 #define TRM_S1040_IOBASE 0x10
277 #define TRM_S1040_ROMBASE 0x30
278 #define TRM_S1040_INTLINE 0x3C
285 #define TRM_S1040_SCSI_STATUS 0x80
286 #define COMMANDPHASEDONE 0x2000
287 #define SCSIXFERDONE 0x0800
288 #define SCSIXFERCNT_2_ZERO 0x0100
289 #define SCSIINTERRUPT 0x0080
290 #define COMMANDABORT 0x0040
291 #define SEQUENCERACTIVE 0x0020
292 #define PHASEMISMATCH 0x0010
293 #define PARITYERROR 0x0008
295 #define PHASEMASK 0x0007
296 #define PH_DATA_OUT 0x00
297 #define PH_DATA_IN 0x01
298 #define PH_COMMAND 0x02
299 #define PH_STATUS 0x03
300 #define PH_BUS_FREE 0x05
301 #define PH_MSG_OUT 0x06
302 #define PH_MSG_IN 0x07
304 #define TRM_S1040_SCSI_CONTROL 0x80
305 #define DO_CLRATN 0x0400
306 #define DO_SETATN 0x0200
307 #define DO_CMDABORT 0x0100
308 #define DO_RSTMODULE 0x0010
309 #define DO_RSTSCSI 0x0008
310 #define DO_CLRFIFO 0x0004
311 #define DO_DATALATCH 0x0002
313 #define DO_HWRESELECT 0x0001
315 #define TRM_S1040_SCSI_FIFOCNT 0x82
316 #define TRM_S1040_SCSI_SIGNAL 0x83
318 #define TRM_S1040_SCSI_INTSTATUS 0x84
319 #define INT_SCAM 0x80
320 #define INT_SELECT 0x40
321 #define INT_SELTIMEOUT 0x20
322 #define INT_DISCONNECT 0x10
323 #define INT_RESELECTED 0x08
324 #define INT_SCSIRESET 0x04
325 #define INT_BUSSERVICE 0x02
326 #define INT_CMDDONE 0x01
328 #define TRM_S1040_SCSI_OFFSET 0x84
340 #define TRM_S1040_SCSI_SYNC 0x85
341 #define LVDS_SYNC 0x20
342 #define WIDE_SYNC 0x10
343 #define ALT_SYNC 0x08
415 #define TRM_S1040_SCSI_TARGETID 0x86
416 #define TRM_S1040_SCSI_IDMSG 0x87
417 #define TRM_S1040_SCSI_HOSTID 0x87
418 #define TRM_S1040_SCSI_COUNTER 0x88
420 #define TRM_S1040_SCSI_INTEN 0x8C
422 #define EN_SELECT 0x40
423 #define EN_SELTIMEOUT 0x20
424 #define EN_DISCONNECT 0x10
425 #define EN_RESELECTED 0x08
426 #define EN_SCSIRESET 0x04
427 #define EN_BUSSERVICE 0x02
428 #define EN_CMDDONE 0x01
430 #define TRM_S1040_SCSI_CONFIG0 0x8D
431 #define PHASELATCH 0x40
432 #define INITIATOR 0x20
433 #define PARITYCHECK 0x10
434 #define BLOCKRST 0x01
436 #define TRM_S1040_SCSI_CONFIG1 0x8E
437 #define ACTIVE_NEGPLUS 0x10
438 #define FILTER_DISABLE 0x08
439 #define FAST_FILTER 0x04
440 #define ACTIVE_NEG 0x02
442 #define TRM_S1040_SCSI_CONFIG2 0x8F
443 #define CFG2_WIDEFIFO 0x02
445 #define TRM_S1040_SCSI_COMMAND 0x90
446 #define SCMD_COMP 0x12
447 #define SCMD_SEL_ATN 0x60
448 #define SCMD_SEL_ATN3 0x64
449 #define SCMD_SEL_ATNSTOP 0xB8
450 #define SCMD_FIFO_OUT 0xC0
451 #define SCMD_DMA_OUT 0xC1
452 #define SCMD_FIFO_IN 0xC2
453 #define SCMD_DMA_IN 0xC3
454 #define SCMD_MSGACCEPT 0xD8
500 #define TRM_S1040_SCSI_TIMEOUT 0x91
501 #define TRM_S1040_SCSI_FIFO 0x98
503 #define TRM_S1040_SCSI_TCR0 0x9C
504 #define TCR0_WIDE_NEGO_DONE 0x8000
505 #define TCR0_SYNC_NEGO_DONE 0x4000
506 #define TCR0_ENABLE_LVDS 0x2000
507 #define TCR0_ENABLE_WIDE 0x1000
508 #define TCR0_ENABLE_ALT 0x0800
509 #define TCR0_PERIOD_MASK 0x0700
511 #define TCR0_DO_WIDE_NEGO 0x0080
512 #define TCR0_DO_SYNC_NEGO 0x0040
513 #define TCR0_DISCONNECT_EN 0x0020
514 #define TCR0_OFFSET_MASK 0x001F
516 #define TRM_S1040_SCSI_TCR1 0x9E
517 #define MAXTAG_MASK 0x7F00
518 #define NON_TAG_BUSY 0x0080
519 #define ACTTAG_MASK 0x007F
526 #define TRM_S1040_DMA_COMMAND 0xA0
527 #define DMACMD_SG 0x02
528 #define DMACMD_DIR 0x01
529 #define XFERDATAIN_SG 0x0103
530 #define XFERDATAOUT_SG 0x0102
531 #define XFERDATAIN 0x0101
532 #define XFERDATAOUT 0x0100
534 #define TRM_S1040_DMA_FIFOCNT 0xA1
536 #define TRM_S1040_DMA_CONTROL 0xA1
537 #define DMARESETMODULE 0x10
538 #define STOPDMAXFER 0x08
539 #define ABORTXFER 0x04
540 #define CLRXFIFO 0x02
541 #define STARTDMAXFER 0x01
543 #define TRM_S1040_DMA_FIFOSTAT 0xA2
545 #define TRM_S1040_DMA_STATUS 0xA3
546 #define XFERPENDING 0x80
547 #define SCSIBUSY 0x40
548 #define GLOBALINT 0x20
549 #define FORCEDMACOMP 0x10
550 #define DMAXFERERROR 0x08
551 #define DMAXFERABORT 0x04
552 #define DMAXFERCOMP 0x02
553 #define SCSICOMP 0x01
555 #define TRM_S1040_DMA_INTEN 0xA4
556 #define EN_FORCEDMACOMP 0x10
557 #define EN_DMAXFERERROR 0x08
558 #define EN_DMAXFERABORT 0x04
559 #define EN_DMAXFERCOMP 0x02
560 #define EN_SCSIINTR 0x01
562 #define TRM_S1040_DMA_CONFIG 0xA6
563 #define DMA_ENHANCE 0x8000
564 #define DMA_PCI_DUAL_ADDR 0x4000
565 #define DMA_CFG_RES 0x2000
566 #define DMA_AUTO_CLR_FIFO 0x1000
567 #define DMA_MEM_MULTI_READ 0x0800
568 #define DMA_MEM_WRITE_INVAL 0x0400
569 #define DMA_FIFO_CTRL 0x0300
570 #define DMA_FIFO_HALF_HALF 0x0200
572 #define TRM_S1040_DMA_XCNT 0xA8
573 #define TRM_S1040_DMA_CXCNT 0xAC
574 #define TRM_S1040_DMA_XLOWADDR 0xB0
575 #define TRM_S1040_DMA_XHIGHADDR 0xB4
582 #define TRM_S1040_GEN_CONTROL 0xD4
583 #define CTRL_LED 0x80
584 #define EN_EEPROM 0x10
585 #define DIS_TERM 0x08
586 #define AUTOTERM 0x04
587 #define LOW8TERM 0x02
590 #define TRM_S1040_GEN_STATUS 0xD5
591 #define GTIMEOUT 0x80
592 #define EXT68HIGH 0x40
593 #define INT68HIGH 0x20
597 #define WIDESCSI 0x02
598 #define STATUS_LOAD_DEFAULT 0x01
600 #define TRM_S1040_GEN_NVRAM 0xD6
601 #define NVR_BITOUT 0x08
602 #define NVR_BITIN 0x04
603 #define NVR_CLOCK 0x02
604 #define NVR_SELECT 0x01
606 #define TRM_S1040_GEN_EDATA 0xD7
607 #define TRM_S1040_GEN_EADDRESS 0xD8
608 #define TRM_S1040_GEN_TIMER 0xDB
615 #define NTC_DO_WIDE_NEGO 0x20
616 #define NTC_DO_TAG_QUEUEING 0x10
617 #define NTC_DO_SEND_START 0x08
618 #define NTC_DO_DISCONNECT 0x04
619 #define NTC_DO_SYNC_NEGO 0x02
620 #define NTC_DO_PARITY_CHK 0x01
629 #define MORE2_DRV BIT0
630 #define GREATER_1G BIT1
631 #define RST_SCSI_BUS BIT2
632 #define ACTIVE_NEGATION BIT3
634 #define LUN_CHECK BIT5
642 #define NAC_SCANLUN 0x20
643 #define NAC_POWERON_SCSI_RESET 0x04
644 #define NAC_GREATER_1G 0x02
645 #define NAC_GT2DRIVES 0x01