qlogicpti.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:20k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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