qlogicpti.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. /* qlogicpti.h: Performance Technologies QlogicISP sbus card defines.
  2. *
  3. * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu)
  4. */
  5. #ifndef _QLOGICPTI_H
  6. #define _QLOGICPTI_H
  7. /* Qlogic/SBUS controller registers. */
  8. #define SBUS_CFG1 0x006UL
  9. #define SBUS_CTRL 0x008UL
  10. #define SBUS_STAT 0x00aUL
  11. #define SBUS_SEMAPHORE 0x00cUL
  12. #define CMD_DMA_CTRL 0x022UL
  13. #define DATA_DMA_CTRL 0x042UL
  14. #define MBOX0 0x080UL
  15. #define MBOX1 0x082UL
  16. #define MBOX2 0x084UL
  17. #define MBOX3 0x086UL
  18. #define MBOX4 0x088UL
  19. #define MBOX5 0x08aUL
  20. #define CPU_CMD 0x214UL
  21. #define CPU_ORIDE 0x224UL
  22. #define CPU_PCTRL 0x272UL
  23. #define CPU_PDIFF 0x276UL
  24. #define RISC_PSR 0x420UL
  25. #define RISC_MTREG 0x42EUL
  26. #define HCCTRL 0x440UL
  27. /* SCSI parameters for this driver. */
  28. #define MAX_TARGETS 16
  29. #define MAX_LUNS 8
  30. /* With the qlogic interface, every queue slot can hold a SCSI
  31. * command with up to 4 scatter/gather entries. If we need more
  32. * than 4 entries, continuation entries can be used that hold
  33. * another 7 entries each. Unlike for other drivers, this means
  34. * that the maximum number of scatter/gather entries we can
  35. * support at any given time is a function of the number of queue
  36. * slots available. That is, host->can_queue and host->sg_tablesize
  37. * are dynamic and _not_ independent. This all works fine because
  38. * requests are queued serially and the scatter/gather limit is
  39. * determined for each queue request anew.
  40. */
  41. #define QLOGICPTI_REQ_QUEUE_LEN 255 /* must be power of two - 1 */
  42. #define QLOGICPTI_MAX_SG(ql) (4 + (((ql) > 0) ? 7*((ql) - 1) : 0))
  43. /* mailbox command complete status codes */
  44. #define MBOX_COMMAND_COMPLETE 0x4000
  45. #define INVALID_COMMAND 0x4001
  46. #define HOST_INTERFACE_ERROR 0x4002
  47. #define TEST_FAILED 0x4003
  48. #define COMMAND_ERROR 0x4005
  49. #define COMMAND_PARAM_ERROR 0x4006
  50. /* async event status codes */
  51. #define ASYNC_SCSI_BUS_RESET 0x8001
  52. #define SYSTEM_ERROR 0x8002
  53. #define REQUEST_TRANSFER_ERROR 0x8003
  54. #define RESPONSE_TRANSFER_ERROR 0x8004
  55. #define REQUEST_QUEUE_WAKEUP 0x8005
  56. #define EXECUTION_TIMEOUT_RESET 0x8006
  57. /* Am I fucking pedantic or what? */
  58. struct Entry_header {
  59. #ifdef __BIG_ENDIAN
  60. u8 entry_cnt;
  61. u8 entry_type;
  62. u8 flags;
  63. u8 sys_def_1;
  64. #else /* __LITTLE_ENDIAN */
  65. u8 entry_type;
  66. u8 entry_cnt;
  67. u8 sys_def_1;
  68. u8 flags;
  69. #endif
  70. };
  71. /* entry header type commands */
  72. #define ENTRY_COMMAND 1
  73. #define ENTRY_CONTINUATION 2
  74. #define ENTRY_STATUS 3
  75. #define ENTRY_MARKER 4
  76. #define ENTRY_EXTENDED_COMMAND 5
  77. /* entry header flag definitions */
  78. #define EFLAG_CONTINUATION 1
  79. #define EFLAG_BUSY 2
  80. #define EFLAG_BAD_HEADER 4
  81. #define EFLAG_BAD_PAYLOAD 8
  82. struct dataseg {
  83. u32 d_base;
  84. u32 d_count;
  85. };
  86. struct Command_Entry {
  87. struct Entry_header hdr;
  88. u32 handle;
  89. #ifdef __BIG_ENDIAN
  90. u8 target_id;
  91. u8 target_lun;
  92. #else /* __LITTLE_ENDIAN */
  93. u8 target_lun;
  94. u8 target_id;
  95. #endif
  96. u16 cdb_length;
  97. u16 control_flags;
  98. u16 rsvd;
  99. u16 time_out;
  100. u16 segment_cnt;
  101. u8 cdb[12];
  102. struct dataseg dataseg[4];
  103. };
  104. /* command entry control flag definitions */
  105. #define CFLAG_NODISC 0x01
  106. #define CFLAG_HEAD_TAG 0x02
  107. #define CFLAG_ORDERED_TAG 0x04
  108. #define CFLAG_SIMPLE_TAG 0x08
  109. #define CFLAG_TAR_RTN 0x10
  110. #define CFLAG_READ 0x20
  111. #define CFLAG_WRITE 0x40
  112. struct Ext_Command_Entry {
  113. struct Entry_header hdr;
  114. u32 handle;
  115. #ifdef __BIG_ENDIAN
  116. u8 target_id;
  117. u8 target_lun;
  118. #else /* __LITTLE_ENDIAN */
  119. u8 target_lun;
  120. u8 target_id;
  121. #endif
  122. u16 cdb_length;
  123. u16 control_flags;
  124. u16 rsvd;
  125. u16 time_out;
  126. u16 segment_cnt;
  127. u8 cdb[44];
  128. };
  129. struct Continuation_Entry {
  130. struct Entry_header hdr;
  131. u32 reserved;
  132. struct dataseg dataseg[7];
  133. };
  134. struct Marker_Entry {
  135. struct Entry_header hdr;
  136. u32 reserved;
  137. #ifdef __BIG_ENDIAN
  138. u8 target_id;
  139. u8 target_lun;
  140. #else /* __LITTLE_ENDIAN */
  141. u8 target_lun;
  142. u8 target_id;
  143. #endif
  144. #ifdef __BIG_ENDIAN
  145. u8 rsvd;
  146. u8 modifier;
  147. #else /* __LITTLE_ENDIAN */
  148. u8 modifier;
  149. u8 rsvd;
  150. #endif
  151. u8 rsvds[52];
  152. };
  153. /* marker entry modifier definitions */
  154. #define SYNC_DEVICE 0
  155. #define SYNC_TARGET 1
  156. #define SYNC_ALL 2
  157. struct Status_Entry {
  158. struct Entry_header hdr;
  159. u32 handle;
  160. u16 scsi_status;
  161. u16 completion_status;
  162. u16 state_flags;
  163. u16 status_flags;
  164. u16 time;
  165. u16 req_sense_len;
  166. u32 residual;
  167. u8 rsvd[8];
  168. u8 req_sense_data[32];
  169. };
  170. /* status entry completion status definitions */
  171. #define CS_COMPLETE 0x0000
  172. #define CS_INCOMPLETE 0x0001
  173. #define CS_DMA_ERROR 0x0002
  174. #define CS_TRANSPORT_ERROR 0x0003
  175. #define CS_RESET_OCCURRED 0x0004
  176. #define CS_ABORTED 0x0005
  177. #define CS_TIMEOUT 0x0006
  178. #define CS_DATA_OVERRUN 0x0007
  179. #define CS_COMMAND_OVERRUN 0x0008
  180. #define CS_STATUS_OVERRUN 0x0009
  181. #define CS_BAD_MESSAGE 0x000a
  182. #define CS_NO_MESSAGE_OUT 0x000b
  183. #define CS_EXT_ID_FAILED 0x000c
  184. #define CS_IDE_MSG_FAILED 0x000d
  185. #define CS_ABORT_MSG_FAILED 0x000e
  186. #define CS_REJECT_MSG_FAILED 0x000f
  187. #define CS_NOP_MSG_FAILED 0x0010
  188. #define CS_PARITY_ERROR_MSG_FAILED 0x0011
  189. #define CS_DEVICE_RESET_MSG_FAILED 0x0012
  190. #define CS_ID_MSG_FAILED 0x0013
  191. #define CS_UNEXP_BUS_FREE 0x0014
  192. #define CS_DATA_UNDERRUN 0x0015
  193. #define CS_BUS_RESET 0x001c
  194. /* status entry state flag definitions */
  195. #define SF_GOT_BUS 0x0100
  196. #define SF_GOT_TARGET 0x0200
  197. #define SF_SENT_CDB 0x0400
  198. #define SF_TRANSFERRED_DATA 0x0800
  199. #define SF_GOT_STATUS 0x1000
  200. #define SF_GOT_SENSE 0x2000
  201. /* status entry status flag definitions */
  202. #define STF_DISCONNECT 0x0001
  203. #define STF_SYNCHRONOUS 0x0002
  204. #define STF_PARITY_ERROR 0x0004
  205. #define STF_BUS_RESET 0x0008
  206. #define STF_DEVICE_RESET 0x0010
  207. #define STF_ABORTED 0x0020
  208. #define STF_TIMEOUT 0x0040
  209. #define STF_NEGOTIATION 0x0080
  210. /* mailbox commands */
  211. #define MBOX_NO_OP 0x0000
  212. #define MBOX_LOAD_RAM 0x0001
  213. #define MBOX_EXEC_FIRMWARE 0x0002
  214. #define MBOX_DUMP_RAM 0x0003
  215. #define MBOX_WRITE_RAM_WORD 0x0004
  216. #define MBOX_READ_RAM_WORD 0x0005
  217. #define MBOX_MAILBOX_REG_TEST 0x0006
  218. #define MBOX_VERIFY_CHECKSUM 0x0007
  219. #define MBOX_ABOUT_FIRMWARE 0x0008
  220. #define MBOX_CHECK_FIRMWARE 0x000e
  221. #define MBOX_INIT_REQ_QUEUE 0x0010
  222. #define MBOX_INIT_RES_QUEUE 0x0011
  223. #define MBOX_EXECUTE_IOCB 0x0012
  224. #define MBOX_WAKE_UP 0x0013
  225. #define MBOX_STOP_FIRMWARE 0x0014
  226. #define MBOX_ABORT 0x0015
  227. #define MBOX_ABORT_DEVICE 0x0016
  228. #define MBOX_ABORT_TARGET 0x0017
  229. #define MBOX_BUS_RESET 0x0018
  230. #define MBOX_STOP_QUEUE 0x0019
  231. #define MBOX_START_QUEUE 0x001a
  232. #define MBOX_SINGLE_STEP_QUEUE 0x001b
  233. #define MBOX_ABORT_QUEUE 0x001c
  234. #define MBOX_GET_DEV_QUEUE_STATUS 0x001d
  235. #define MBOX_GET_FIRMWARE_STATUS 0x001f
  236. #define MBOX_GET_INIT_SCSI_ID 0x0020
  237. #define MBOX_GET_SELECT_TIMEOUT 0x0021
  238. #define MBOX_GET_RETRY_COUNT 0x0022
  239. #define MBOX_GET_TAG_AGE_LIMIT 0x0023
  240. #define MBOX_GET_CLOCK_RATE 0x0024
  241. #define MBOX_GET_ACT_NEG_STATE 0x0025
  242. #define MBOX_GET_ASYNC_DATA_SETUP_TIME 0x0026
  243. #define MBOX_GET_SBUS_PARAMS 0x0027
  244. #define MBOX_GET_TARGET_PARAMS 0x0028
  245. #define MBOX_GET_DEV_QUEUE_PARAMS 0x0029
  246. #define MBOX_SET_INIT_SCSI_ID 0x0030
  247. #define MBOX_SET_SELECT_TIMEOUT 0x0031
  248. #define MBOX_SET_RETRY_COUNT 0x0032
  249. #define MBOX_SET_TAG_AGE_LIMIT 0x0033
  250. #define MBOX_SET_CLOCK_RATE 0x0034
  251. #define MBOX_SET_ACTIVE_NEG_STATE 0x0035
  252. #define MBOX_SET_ASYNC_DATA_SETUP_TIME 0x0036
  253. #define MBOX_SET_SBUS_CONTROL_PARAMS 0x0037
  254. #define MBOX_SET_TARGET_PARAMS 0x0038
  255. #define MBOX_SET_DEV_QUEUE_PARAMS 0x0039
  256. struct host_param {
  257. u_short initiator_scsi_id;
  258. u_short bus_reset_delay;
  259. u_short retry_count;
  260. u_short retry_delay;
  261. u_short async_data_setup_time;
  262. u_short req_ack_active_negation;
  263. u_short data_line_active_negation;
  264. u_short data_dma_burst_enable;
  265. u_short command_dma_burst_enable;
  266. u_short tag_aging;
  267. u_short selection_timeout;
  268. u_short max_queue_depth;
  269. };
  270. /*
  271. * Device Flags:
  272. *
  273. * Bit Name
  274. * ---------
  275. * 7 Disconnect Privilege
  276. * 6 Parity Checking
  277. * 5 Wide Data Transfers
  278. * 4 Synchronous Data Transfers
  279. * 3 Tagged Queuing
  280. * 2 Automatic Request Sense
  281. * 1 Stop Queue on Check Condition
  282. * 0 Renegotiate on Error
  283. */
  284. struct dev_param {
  285. u_short device_flags;
  286. u_short execution_throttle;
  287. u_short synchronous_period;
  288. u_short synchronous_offset;
  289. u_short device_enable;
  290. u_short reserved; /* pad */
  291. };
  292. /*
  293. * The result queue can be quite a bit smaller since continuation entries
  294. * do not show up there:
  295. */
  296. #define RES_QUEUE_LEN 255 /* Must be power of two - 1 */
  297. #define QUEUE_ENTRY_LEN 64
  298. #define NEXT_REQ_PTR(wheee) (((wheee) + 1) & QLOGICPTI_REQ_QUEUE_LEN)
  299. #define NEXT_RES_PTR(wheee) (((wheee) + 1) & RES_QUEUE_LEN)
  300. #define PREV_REQ_PTR(wheee) (((wheee) - 1) & QLOGICPTI_REQ_QUEUE_LEN)
  301. #define PREV_RES_PTR(wheee) (((wheee) - 1) & RES_QUEUE_LEN)
  302. struct pti_queue_entry {
  303. char __opaque[QUEUE_ENTRY_LEN];
  304. };
  305. struct scsi_cmnd;
  306. /* Software state for the driver. */
  307. struct qlogicpti {
  308. /* These are the hot elements in the cache, so they come first. */
  309. void __iomem *qregs; /* Adapter registers */
  310. struct pti_queue_entry *res_cpu; /* Ptr to RESPONSE bufs (CPU) */
  311. struct pti_queue_entry *req_cpu; /* Ptr to REQUEST bufs (CPU) */
  312. u_int req_in_ptr; /* index of next request slot */
  313. u_int res_out_ptr; /* index of next result slot */
  314. long send_marker; /* must we send a marker? */
  315. struct platform_device *op;
  316. unsigned long __pad;
  317. int cmd_count[MAX_TARGETS];
  318. unsigned long tag_ages[MAX_TARGETS];
  319. /* The cmd->handler is only 32-bits, so that things work even on monster
  320. * Ex000 sparc64 machines with >4GB of ram we just keep track of the
  321. * scsi command pointers here. This is essentially what Matt Jacob does. -DaveM
  322. */
  323. struct scsi_cmnd *cmd_slots[QLOGICPTI_REQ_QUEUE_LEN + 1];
  324. /* The rest of the elements are unimportant for performance. */
  325. struct qlogicpti *next;
  326. dma_addr_t res_dvma; /* Ptr to RESPONSE bufs (DVMA)*/
  327. dma_addr_t req_dvma; /* Ptr to REQUEST bufs (DVMA) */
  328. u_char fware_majrev, fware_minrev, fware_micrev;
  329. struct Scsi_Host *qhost;
  330. int qpti_id;
  331. int scsi_id;
  332. int prom_node;
  333. char prom_name[64];
  334. int irq;
  335. char differential, ultra, clock;
  336. unsigned char bursts;
  337. struct host_param host_param;
  338. struct dev_param dev_param[MAX_TARGETS];
  339. void __iomem *sreg;
  340. #define SREG_TPOWER 0x80 /* State of termpwr */
  341. #define SREG_FUSE 0x40 /* State of on board fuse */
  342. #define SREG_PDISAB 0x20 /* Disable state for power on */
  343. #define SREG_DSENSE 0x10 /* Sense for differential */
  344. #define SREG_IMASK 0x0c /* Interrupt level */
  345. #define SREG_SPMASK 0x03 /* Mask for switch pack */
  346. unsigned char swsreg;
  347. unsigned int
  348. gotirq : 1, /* this instance got an irq */
  349. is_pti : 1; /* Non-zero if this is a PTI board. */
  350. };
  351. /* How to twiddle them bits... */
  352. /* SBUS config register one. */
  353. #define SBUS_CFG1_EPAR 0x0100 /* Enable parity checking */
  354. #define SBUS_CFG1_FMASK 0x00f0 /* Forth code cycle mask */
  355. #define SBUS_CFG1_BENAB 0x0004 /* Burst dvma enable */
  356. #define SBUS_CFG1_B64 0x0003 /* Enable 64byte bursts */
  357. #define SBUS_CFG1_B32 0x0002 /* Enable 32byte bursts */
  358. #define SBUS_CFG1_B16 0x0001 /* Enable 16byte bursts */
  359. #define SBUS_CFG1_B8 0x0008 /* Enable 8byte bursts */
  360. /* SBUS control register */
  361. #define SBUS_CTRL_EDIRQ 0x0020 /* Enable Data DVMA Interrupts */
  362. #define SBUS_CTRL_ECIRQ 0x0010 /* Enable Command DVMA Interrupts */
  363. #define SBUS_CTRL_ESIRQ 0x0008 /* Enable SCSI Processor Interrupts */
  364. #define SBUS_CTRL_ERIRQ 0x0004 /* Enable RISC Processor Interrupts */
  365. #define SBUS_CTRL_GENAB 0x0002 /* Global Interrupt Enable */
  366. #define SBUS_CTRL_RESET 0x0001 /* Soft Reset */
  367. /* SBUS status register */
  368. #define SBUS_STAT_DINT 0x0020 /* Data DVMA IRQ pending */
  369. #define SBUS_STAT_CINT 0x0010 /* Command DVMA IRQ pending */
  370. #define SBUS_STAT_SINT 0x0008 /* SCSI Processor IRQ pending */
  371. #define SBUS_STAT_RINT 0x0004 /* RISC Processor IRQ pending */
  372. #define SBUS_STAT_GINT 0x0002 /* Global IRQ pending */
  373. /* SBUS semaphore register */
  374. #define SBUS_SEMAPHORE_STAT 0x0002 /* Semaphore status bit */
  375. #define SBUS_SEMAPHORE_LCK 0x0001 /* Semaphore lock bit */
  376. /* DVMA control register */
  377. #define DMA_CTRL_CSUSPEND 0x0010 /* DMA channel suspend */
  378. #define DMA_CTRL_CCLEAR 0x0008 /* DMA channel clear and reset */
  379. #define DMA_CTRL_FCLEAR 0x0004 /* DMA fifo clear */
  380. #define DMA_CTRL_CIRQ 0x0002 /* DMA irq clear */
  381. #define DMA_CTRL_DMASTART 0x0001 /* DMA transfer start */
  382. /* SCSI processor override register */
  383. #define CPU_ORIDE_ETRIG 0x8000 /* External trigger enable */
  384. #define CPU_ORIDE_STEP 0x4000 /* Single step mode enable */
  385. #define CPU_ORIDE_BKPT 0x2000 /* Breakpoint reg enable */
  386. #define CPU_ORIDE_PWRITE 0x1000 /* SCSI pin write enable */
  387. #define CPU_ORIDE_OFORCE 0x0800 /* Force outputs on */
  388. #define CPU_ORIDE_LBACK 0x0400 /* SCSI loopback enable */
  389. #define CPU_ORIDE_PTEST 0x0200 /* Parity test enable */
  390. #define CPU_ORIDE_TENAB 0x0100 /* SCSI pins tristate enable */
  391. #define CPU_ORIDE_TPINS 0x0080 /* SCSI pins enable */
  392. #define CPU_ORIDE_FRESET 0x0008 /* FIFO reset */
  393. #define CPU_ORIDE_CTERM 0x0004 /* Command terminate */
  394. #define CPU_ORIDE_RREG 0x0002 /* Reset SCSI processor regs */
  395. #define CPU_ORIDE_RMOD 0x0001 /* Reset SCSI processor module */
  396. /* SCSI processor commands */
  397. #define CPU_CMD_BRESET 0x300b /* Reset SCSI bus */
  398. /* SCSI processor pin control register */
  399. #define CPU_PCTRL_PVALID 0x8000 /* Phase bits are valid */
  400. #define CPU_PCTRL_PHI 0x0400 /* Parity bit high */
  401. #define CPU_PCTRL_PLO 0x0200 /* Parity bit low */
  402. #define CPU_PCTRL_REQ 0x0100 /* REQ bus signal */
  403. #define CPU_PCTRL_ACK 0x0080 /* ACK bus signal */
  404. #define CPU_PCTRL_RST 0x0040 /* RST bus signal */
  405. #define CPU_PCTRL_BSY 0x0020 /* BSY bus signal */
  406. #define CPU_PCTRL_SEL 0x0010 /* SEL bus signal */
  407. #define CPU_PCTRL_ATN 0x0008 /* ATN bus signal */
  408. #define CPU_PCTRL_MSG 0x0004 /* MSG bus signal */
  409. #define CPU_PCTRL_CD 0x0002 /* CD bus signal */
  410. #define CPU_PCTRL_IO 0x0001 /* IO bus signal */
  411. /* SCSI processor differential pins register */
  412. #define CPU_PDIFF_SENSE 0x0200 /* Differential sense */
  413. #define CPU_PDIFF_MODE 0x0100 /* Differential mode */
  414. #define CPU_PDIFF_OENAB 0x0080 /* Outputs enable */
  415. #define CPU_PDIFF_PMASK 0x007c /* Differential control pins */
  416. #define CPU_PDIFF_TGT 0x0002 /* Target mode enable */
  417. #define CPU_PDIFF_INIT 0x0001 /* Initiator mode enable */
  418. /* RISC processor status register */
  419. #define RISC_PSR_FTRUE 0x8000 /* Force true */
  420. #define RISC_PSR_LCD 0x4000 /* Loop counter shows done status */
  421. #define RISC_PSR_RIRQ 0x2000 /* RISC irq status */
  422. #define RISC_PSR_TOFLOW 0x1000 /* Timer overflow (rollover) */
  423. #define RISC_PSR_AOFLOW 0x0800 /* Arithmetic overflow */
  424. #define RISC_PSR_AMSB 0x0400 /* Arithmetic big endian */
  425. #define RISC_PSR_ACARRY 0x0200 /* Arithmetic carry */
  426. #define RISC_PSR_AZERO 0x0100 /* Arithmetic zero */
  427. #define RISC_PSR_ULTRA 0x0020 /* Ultra mode */
  428. #define RISC_PSR_DIRQ 0x0010 /* DVMA interrupt */
  429. #define RISC_PSR_SIRQ 0x0008 /* SCSI processor interrupt */
  430. #define RISC_PSR_HIRQ 0x0004 /* Host interrupt */
  431. #define RISC_PSR_IPEND 0x0002 /* Interrupt pending */
  432. #define RISC_PSR_FFALSE 0x0001 /* Force false */
  433. /* RISC processor memory timing register */
  434. #define RISC_MTREG_P1DFLT 0x1200 /* Default read/write timing, pg1 */
  435. #define RISC_MTREG_P0DFLT 0x0012 /* Default read/write timing, pg0 */
  436. #define RISC_MTREG_P1ULTRA 0x2300 /* Ultra-mode rw timing, pg1 */
  437. #define RISC_MTREG_P0ULTRA 0x0023 /* Ultra-mode rw timing, pg0 */
  438. /* Host command/ctrl register */
  439. #define HCCTRL_NOP 0x0000 /* CMD: No operation */
  440. #define HCCTRL_RESET 0x1000 /* CMD: Reset RISC cpu */
  441. #define HCCTRL_PAUSE 0x2000 /* CMD: Pause RISC cpu */
  442. #define HCCTRL_REL 0x3000 /* CMD: Release paused RISC cpu */
  443. #define HCCTRL_STEP 0x4000 /* CMD: Single step RISC cpu */
  444. #define HCCTRL_SHIRQ 0x5000 /* CMD: Set host irq */
  445. #define HCCTRL_CHIRQ 0x6000 /* CMD: Clear host irq */
  446. #define HCCTRL_CRIRQ 0x7000 /* CMD: Clear RISC cpu irq */
  447. #define HCCTRL_BKPT 0x8000 /* CMD: Breakpoint enables change */
  448. #define HCCTRL_TMODE 0xf000 /* CMD: Enable test mode */
  449. #define HCCTRL_HIRQ 0x0080 /* Host IRQ pending */
  450. #define HCCTRL_RRIP 0x0040 /* RISC cpu reset in happening now */
  451. #define HCCTRL_RPAUSED 0x0020 /* RISC cpu is paused now */
  452. #define HCCTRL_EBENAB 0x0010 /* External breakpoint enable */
  453. #define HCCTRL_B1ENAB 0x0008 /* Breakpoint 1 enable */
  454. #define HCCTRL_B0ENAB 0x0004 /* Breakpoint 0 enable */
  455. /* For our interrupt engine. */
  456. #define for_each_qlogicpti(qp) \
  457. for((qp) = qptichain; (qp); (qp) = (qp)->next)
  458. #endif /* !(_QLOGICPTI_H) */