53c700.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* -*- mode: c; c-basic-offset: 8 -*- */
  3. /* Driver for 53c700 and 53c700-66 chips from NCR and Symbios
  4. *
  5. * Copyright (C) 2001 by James.Bottomley@HansenPartnership.com
  6. */
  7. #ifndef _53C700_H
  8. #define _53C700_H
  9. #include <linux/interrupt.h>
  10. #include <asm/io.h>
  11. #include <scsi/scsi_device.h>
  12. #include <scsi/scsi_cmnd.h>
  13. /* Turn on for general debugging---too verbose for normal use */
  14. #undef NCR_700_DEBUG
  15. /* Debug the tag queues, checking hash queue allocation and deallocation
  16. * and search for duplicate tags */
  17. #undef NCR_700_TAG_DEBUG
  18. #ifdef NCR_700_DEBUG
  19. #define DEBUG(x) printk x
  20. #define DDEBUG(prefix, sdev, fmt, a...) \
  21. sdev_printk(prefix, sdev, fmt, ##a)
  22. #define CDEBUG(prefix, scmd, fmt, a...) \
  23. scmd_printk(prefix, scmd, fmt, ##a)
  24. #else
  25. #define DEBUG(x) do {} while (0)
  26. #define DDEBUG(prefix, scmd, fmt, a...) do {} while (0)
  27. #define CDEBUG(prefix, scmd, fmt, a...) do {} while (0)
  28. #endif
  29. /* The number of available command slots */
  30. #define NCR_700_COMMAND_SLOTS_PER_HOST 64
  31. /* The maximum number of Scatter Gathers we allow */
  32. #define NCR_700_SG_SEGMENTS 32
  33. /* The maximum number of luns (make this of the form 2^n) */
  34. #define NCR_700_MAX_LUNS 32
  35. #define NCR_700_LUN_MASK (NCR_700_MAX_LUNS - 1)
  36. /* Maximum number of tags the driver ever allows per device */
  37. #define NCR_700_MAX_TAGS 16
  38. /* Tag depth the driver starts out with (can be altered in sysfs) */
  39. #define NCR_700_DEFAULT_TAGS 4
  40. /* This is the default number of commands per LUN in the untagged case.
  41. * two is a good value because it means we can have one command active and
  42. * one command fully prepared and waiting
  43. */
  44. #define NCR_700_CMD_PER_LUN 2
  45. /* magic byte identifying an internally generated REQUEST_SENSE command */
  46. #define NCR_700_INTERNAL_SENSE_MAGIC 0x42
  47. struct NCR_700_Host_Parameters;
  48. /* These are the externally used routines */
  49. struct Scsi_Host *NCR_700_detect(struct scsi_host_template *,
  50. struct NCR_700_Host_Parameters *, struct device *);
  51. int NCR_700_release(struct Scsi_Host *host);
  52. irqreturn_t NCR_700_intr(int, void *);
  53. enum NCR_700_Host_State {
  54. NCR_700_HOST_BUSY,
  55. NCR_700_HOST_FREE,
  56. };
  57. struct NCR_700_SG_List {
  58. /* The following is a script fragment to move the buffer onto the
  59. * bus and then link the next fragment or return */
  60. #define SCRIPT_MOVE_DATA_IN 0x09000000
  61. #define SCRIPT_MOVE_DATA_OUT 0x08000000
  62. __u32 ins;
  63. __u32 pAddr;
  64. #define SCRIPT_NOP 0x80000000
  65. #define SCRIPT_RETURN 0x90080000
  66. };
  67. struct NCR_700_Device_Parameters {
  68. /* space for creating a request sense command. Really, except
  69. * for the annoying SCSI-2 requirement for LUN information in
  70. * cmnd[1], this could be in static storage */
  71. unsigned char cmnd[MAX_COMMAND_SIZE];
  72. __u8 depth;
  73. struct scsi_cmnd *current_cmnd; /* currently active command */
  74. };
  75. /* The SYNC negotiation sequence looks like:
  76. *
  77. * If DEV_NEGOTIATED_SYNC not set, tack and SDTR message on to the
  78. * initial identify for the device and set DEV_BEGIN_SYNC_NEGOTATION
  79. * If we get an SDTR reply, work out the SXFER parameters, squirrel
  80. * them away here, clear DEV_BEGIN_SYNC_NEGOTIATION and set
  81. * DEV_NEGOTIATED_SYNC. If we get a REJECT msg, squirrel
  82. *
  83. *
  84. * 0:7 SXFER_REG negotiated value for this device
  85. * 8:15 Current queue depth
  86. * 16 negotiated SYNC flag
  87. * 17 begin SYNC negotiation flag
  88. * 18 device supports tag queueing */
  89. #define NCR_700_DEV_NEGOTIATED_SYNC (1<<16)
  90. #define NCR_700_DEV_BEGIN_SYNC_NEGOTIATION (1<<17)
  91. #define NCR_700_DEV_PRINT_SYNC_NEGOTIATION (1<<19)
  92. static inline char *NCR_700_get_sense_cmnd(struct scsi_device *SDp)
  93. {
  94. struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
  95. return hostdata->cmnd;
  96. }
  97. static inline void
  98. NCR_700_set_depth(struct scsi_device *SDp, __u8 depth)
  99. {
  100. struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
  101. hostdata->depth = depth;
  102. }
  103. static inline __u8
  104. NCR_700_get_depth(struct scsi_device *SDp)
  105. {
  106. struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
  107. return hostdata->depth;
  108. }
  109. static inline int
  110. NCR_700_is_flag_set(struct scsi_device *SDp, __u32 flag)
  111. {
  112. return (spi_flags(SDp->sdev_target) & flag) == flag;
  113. }
  114. static inline int
  115. NCR_700_is_flag_clear(struct scsi_device *SDp, __u32 flag)
  116. {
  117. return (spi_flags(SDp->sdev_target) & flag) == 0;
  118. }
  119. static inline void
  120. NCR_700_set_flag(struct scsi_device *SDp, __u32 flag)
  121. {
  122. spi_flags(SDp->sdev_target) |= flag;
  123. }
  124. static inline void
  125. NCR_700_clear_flag(struct scsi_device *SDp, __u32 flag)
  126. {
  127. spi_flags(SDp->sdev_target) &= ~flag;
  128. }
  129. enum NCR_700_tag_neg_state {
  130. NCR_700_START_TAG_NEGOTIATION = 0,
  131. NCR_700_DURING_TAG_NEGOTIATION = 1,
  132. NCR_700_FINISHED_TAG_NEGOTIATION = 2,
  133. };
  134. static inline enum NCR_700_tag_neg_state
  135. NCR_700_get_tag_neg_state(struct scsi_device *SDp)
  136. {
  137. return (enum NCR_700_tag_neg_state)((spi_flags(SDp->sdev_target)>>20) & 0x3);
  138. }
  139. static inline void
  140. NCR_700_set_tag_neg_state(struct scsi_device *SDp,
  141. enum NCR_700_tag_neg_state state)
  142. {
  143. /* clear the slot */
  144. spi_flags(SDp->sdev_target) &= ~(0x3 << 20);
  145. spi_flags(SDp->sdev_target) |= ((__u32)state) << 20;
  146. }
  147. struct NCR_700_command_slot {
  148. struct NCR_700_SG_List SG[NCR_700_SG_SEGMENTS+1];
  149. struct NCR_700_SG_List *pSG;
  150. #define NCR_700_SLOT_MASK 0xFC
  151. #define NCR_700_SLOT_MAGIC 0xb8
  152. #define NCR_700_SLOT_FREE (0|NCR_700_SLOT_MAGIC) /* slot may be used */
  153. #define NCR_700_SLOT_BUSY (1|NCR_700_SLOT_MAGIC) /* slot has command active on HA */
  154. #define NCR_700_SLOT_QUEUED (2|NCR_700_SLOT_MAGIC) /* slot has command to be made active on HA */
  155. __u8 state;
  156. #define NCR_700_FLAG_AUTOSENSE 0x01
  157. __u8 flags;
  158. __u8 pad1[2]; /* Needed for m68k where min alignment is 2 bytes */
  159. int tag;
  160. __u32 resume_offset;
  161. struct scsi_cmnd *cmnd;
  162. /* The pci_mapped address of the actual command in cmnd */
  163. dma_addr_t pCmd;
  164. __u32 temp;
  165. /* if this command is a pci_single mapping, holds the dma address
  166. * for later unmapping in the done routine */
  167. dma_addr_t dma_handle;
  168. /* historical remnant, now used to link free commands */
  169. struct NCR_700_command_slot *ITL_forw;
  170. };
  171. struct NCR_700_Host_Parameters {
  172. /* These must be filled in by the calling driver */
  173. int clock; /* board clock speed in MHz */
  174. void __iomem *base; /* the base for the port (copied to host) */
  175. struct device *dev;
  176. __u32 dmode_extra; /* adjustable bus settings */
  177. __u32 dcntl_extra; /* adjustable bus settings */
  178. __u32 ctest7_extra; /* adjustable bus settings */
  179. __u32 differential:1; /* if we are differential */
  180. #ifdef CONFIG_53C700_LE_ON_BE
  181. /* This option is for HP only. Set it if your chip is wired for
  182. * little endian on this platform (which is big endian) */
  183. __u32 force_le_on_be:1;
  184. #endif
  185. __u32 chip710:1; /* set if really a 710 not 700 */
  186. __u32 burst_length:4; /* set to 0 to disable 710 bursting */
  187. /* NOTHING BELOW HERE NEEDS ALTERING */
  188. __u32 fast:1; /* if we can alter the SCSI bus clock
  189. speed (so can negiotiate sync) */
  190. int sync_clock; /* The speed of the SYNC core */
  191. __u32 *script; /* pointer to script location */
  192. __u32 pScript; /* physical mem addr of script */
  193. enum NCR_700_Host_State state; /* protected by state lock */
  194. struct scsi_cmnd *cmd;
  195. /* Note: pScript contains the single consistent block of
  196. * memory. All the msgin, msgout and status are allocated in
  197. * this memory too (at separate cache lines). TOTAL_MEM_SIZE
  198. * represents the total size of this area */
  199. #define MSG_ARRAY_SIZE 8
  200. #define MSGOUT_OFFSET (L1_CACHE_ALIGN(sizeof(SCRIPT)))
  201. __u8 *msgout;
  202. #define MSGIN_OFFSET (MSGOUT_OFFSET + L1_CACHE_ALIGN(MSG_ARRAY_SIZE))
  203. __u8 *msgin;
  204. #define STATUS_OFFSET (MSGIN_OFFSET + L1_CACHE_ALIGN(MSG_ARRAY_SIZE))
  205. __u8 *status;
  206. #define SLOTS_OFFSET (STATUS_OFFSET + L1_CACHE_ALIGN(MSG_ARRAY_SIZE))
  207. struct NCR_700_command_slot *slots;
  208. #define TOTAL_MEM_SIZE (SLOTS_OFFSET + L1_CACHE_ALIGN(sizeof(struct NCR_700_command_slot) * NCR_700_COMMAND_SLOTS_PER_HOST))
  209. int saved_slot_position;
  210. int command_slot_count; /* protected by state lock */
  211. __u8 tag_negotiated;
  212. __u8 rev;
  213. __u8 reselection_id;
  214. __u8 min_period;
  215. /* Free list, singly linked by ITL_forw elements */
  216. struct NCR_700_command_slot *free_list;
  217. /* Completion for waited for ops, like reset, abort or
  218. * device reset.
  219. *
  220. * NOTE: relies on single threading in the error handler to
  221. * have only one outstanding at once */
  222. struct completion *eh_complete;
  223. };
  224. /*
  225. * 53C700 Register Interface - the offset from the Selected base
  226. * I/O address */
  227. #ifdef CONFIG_53C700_LE_ON_BE
  228. #define bE (hostdata->force_le_on_be ? 0 : 3)
  229. #define bSWAP (hostdata->force_le_on_be)
  230. #define bEBus (!hostdata->force_le_on_be)
  231. #elif defined(__BIG_ENDIAN)
  232. #define bE 3
  233. #define bSWAP 0
  234. #elif defined(__LITTLE_ENDIAN)
  235. #define bE 0
  236. #define bSWAP 0
  237. #else
  238. #error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined, did you include byteorder.h?"
  239. #endif
  240. #ifndef bEBus
  241. #ifdef CONFIG_53C700_BE_BUS
  242. #define bEBus 1
  243. #else
  244. #define bEBus 0
  245. #endif
  246. #endif
  247. #define bS_to_cpu(x) (bSWAP ? le32_to_cpu(x) : (x))
  248. #define bS_to_host(x) (bSWAP ? cpu_to_le32(x) : (x))
  249. /* NOTE: These registers are in the LE register space only, the required byte
  250. * swapping is done by the NCR_700_{read|write}[b] functions */
  251. #define SCNTL0_REG 0x00
  252. #define FULL_ARBITRATION 0xc0
  253. #define PARITY 0x08
  254. #define ENABLE_PARITY 0x04
  255. #define AUTO_ATN 0x02
  256. #define SCNTL1_REG 0x01
  257. #define SLOW_BUS 0x80
  258. #define ENABLE_SELECT 0x20
  259. #define ASSERT_RST 0x08
  260. #define ASSERT_EVEN_PARITY 0x04
  261. #define SDID_REG 0x02
  262. #define SIEN_REG 0x03
  263. #define PHASE_MM_INT 0x80
  264. #define FUNC_COMP_INT 0x40
  265. #define SEL_TIMEOUT_INT 0x20
  266. #define SELECT_INT 0x10
  267. #define GROSS_ERR_INT 0x08
  268. #define UX_DISC_INT 0x04
  269. #define RST_INT 0x02
  270. #define PAR_ERR_INT 0x01
  271. #define SCID_REG 0x04
  272. #define SXFER_REG 0x05
  273. #define ASYNC_OPERATION 0x00
  274. #define SODL_REG 0x06
  275. #define SOCL_REG 0x07
  276. #define SFBR_REG 0x08
  277. #define SIDL_REG 0x09
  278. #define SBDL_REG 0x0A
  279. #define SBCL_REG 0x0B
  280. /* read bits */
  281. #define SBCL_IO 0x01
  282. /*write bits */
  283. #define SYNC_DIV_AS_ASYNC 0x00
  284. #define SYNC_DIV_1_0 0x01
  285. #define SYNC_DIV_1_5 0x02
  286. #define SYNC_DIV_2_0 0x03
  287. #define DSTAT_REG 0x0C
  288. #define ILGL_INST_DETECTED 0x01
  289. #define WATCH_DOG_INTERRUPT 0x02
  290. #define SCRIPT_INT_RECEIVED 0x04
  291. #define ABORTED 0x10
  292. #define SSTAT0_REG 0x0D
  293. #define PARITY_ERROR 0x01
  294. #define SCSI_RESET_DETECTED 0x02
  295. #define UNEXPECTED_DISCONNECT 0x04
  296. #define SCSI_GROSS_ERROR 0x08
  297. #define SELECTED 0x10
  298. #define SELECTION_TIMEOUT 0x20
  299. #define FUNCTION_COMPLETE 0x40
  300. #define PHASE_MISMATCH 0x80
  301. #define SSTAT1_REG 0x0E
  302. #define SIDL_REG_FULL 0x80
  303. #define SODR_REG_FULL 0x40
  304. #define SODL_REG_FULL 0x20
  305. #define SSTAT2_REG 0x0F
  306. #define CTEST0_REG 0x14
  307. #define BTB_TIMER_DISABLE 0x40
  308. #define CTEST1_REG 0x15
  309. #define CTEST2_REG 0x16
  310. #define CTEST3_REG 0x17
  311. #define CTEST4_REG 0x18
  312. #define DISABLE_FIFO 0x00
  313. #define SLBE 0x10
  314. #define SFWR 0x08
  315. #define BYTE_LANE0 0x04
  316. #define BYTE_LANE1 0x05
  317. #define BYTE_LANE2 0x06
  318. #define BYTE_LANE3 0x07
  319. #define SCSI_ZMODE 0x20
  320. #define ZMODE 0x40
  321. #define CTEST5_REG 0x19
  322. #define MASTER_CONTROL 0x10
  323. #define DMA_DIRECTION 0x08
  324. #define CTEST7_REG 0x1B
  325. #define BURST_DISABLE 0x80 /* 710 only */
  326. #define SEL_TIMEOUT_DISABLE 0x10 /* 710 only */
  327. #define DFP 0x08
  328. #define EVP 0x04
  329. #define CTEST7_TT1 0x02
  330. #define DIFF 0x01
  331. #define CTEST6_REG 0x1A
  332. #define TEMP_REG 0x1C
  333. #define DFIFO_REG 0x20
  334. #define FLUSH_DMA_FIFO 0x80
  335. #define CLR_FIFO 0x40
  336. #define ISTAT_REG 0x21
  337. #define ABORT_OPERATION 0x80
  338. #define SOFTWARE_RESET_710 0x40
  339. #define DMA_INT_PENDING 0x01
  340. #define SCSI_INT_PENDING 0x02
  341. #define CONNECTED 0x08
  342. #define CTEST8_REG 0x22
  343. #define LAST_DIS_ENBL 0x01
  344. #define SHORTEN_FILTERING 0x04
  345. #define ENABLE_ACTIVE_NEGATION 0x10
  346. #define GENERATE_RECEIVE_PARITY 0x20
  347. #define CLR_FIFO_710 0x04
  348. #define FLUSH_DMA_FIFO_710 0x08
  349. #define CTEST9_REG 0x23
  350. #define DBC_REG 0x24
  351. #define DCMD_REG 0x27
  352. #define DNAD_REG 0x28
  353. #define DIEN_REG 0x39
  354. #define BUS_FAULT 0x20
  355. #define ABORT_INT 0x10
  356. #define INT_INST_INT 0x04
  357. #define WD_INT 0x02
  358. #define ILGL_INST_INT 0x01
  359. #define DCNTL_REG 0x3B
  360. #define SOFTWARE_RESET 0x01
  361. #define COMPAT_700_MODE 0x01
  362. #define SCRPTS_16BITS 0x20
  363. #define EA_710 0x20
  364. #define ASYNC_DIV_2_0 0x00
  365. #define ASYNC_DIV_1_5 0x40
  366. #define ASYNC_DIV_1_0 0x80
  367. #define ASYNC_DIV_3_0 0xc0
  368. #define DMODE_710_REG 0x38
  369. #define DMODE_700_REG 0x34
  370. #define BURST_LENGTH_1 0x00
  371. #define BURST_LENGTH_2 0x40
  372. #define BURST_LENGTH_4 0x80
  373. #define BURST_LENGTH_8 0xC0
  374. #define DMODE_FC1 0x10
  375. #define DMODE_FC2 0x20
  376. #define BW16 32
  377. #define MODE_286 16
  378. #define IO_XFER 8
  379. #define FIXED_ADDR 4
  380. #define DSP_REG 0x2C
  381. #define DSPS_REG 0x30
  382. /* Parameters to begin SDTR negotiations. Empirically, I find that
  383. * the 53c700-66 cannot handle an offset >8, so don't change this */
  384. #define NCR_700_MAX_OFFSET 8
  385. /* Was hoping the max offset would be greater for the 710, but
  386. * empirically it seems to be 8 also */
  387. #define NCR_710_MAX_OFFSET 8
  388. #define NCR_700_MIN_XFERP 1
  389. #define NCR_710_MIN_XFERP 0
  390. #define NCR_700_MIN_PERIOD 25 /* for SDTR message, 100ns */
  391. #define script_patch_32(dev, script, symbol, value) \
  392. { \
  393. int i; \
  394. dma_addr_t da = value; \
  395. for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \
  396. __u32 val = bS_to_cpu((script)[A_##symbol##_used[i]]) + da; \
  397. (script)[A_##symbol##_used[i]] = bS_to_host(val); \
  398. dma_cache_sync((dev), &(script)[A_##symbol##_used[i]], 4, DMA_TO_DEVICE); \
  399. DEBUG((" script, patching %s at %d to %pad\n", \
  400. #symbol, A_##symbol##_used[i], &da)); \
  401. } \
  402. }
  403. #define script_patch_32_abs(dev, script, symbol, value) \
  404. { \
  405. int i; \
  406. dma_addr_t da = value; \
  407. for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \
  408. (script)[A_##symbol##_used[i]] = bS_to_host(da); \
  409. dma_cache_sync((dev), &(script)[A_##symbol##_used[i]], 4, DMA_TO_DEVICE); \
  410. DEBUG((" script, patching %s at %d to %pad\n", \
  411. #symbol, A_##symbol##_used[i], &da)); \
  412. } \
  413. }
  414. /* Used for patching the SCSI ID in the SELECT instruction */
  415. #define script_patch_ID(dev, script, symbol, value) \
  416. { \
  417. int i; \
  418. for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \
  419. __u32 val = bS_to_cpu((script)[A_##symbol##_used[i]]); \
  420. val &= 0xff00ffff; \
  421. val |= ((value) & 0xff) << 16; \
  422. (script)[A_##symbol##_used[i]] = bS_to_host(val); \
  423. dma_cache_sync((dev), &(script)[A_##symbol##_used[i]], 4, DMA_TO_DEVICE); \
  424. DEBUG((" script, patching ID field %s at %d to 0x%x\n", \
  425. #symbol, A_##symbol##_used[i], val)); \
  426. } \
  427. }
  428. #define script_patch_16(dev, script, symbol, value) \
  429. { \
  430. int i; \
  431. for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \
  432. __u32 val = bS_to_cpu((script)[A_##symbol##_used[i]]); \
  433. val &= 0xffff0000; \
  434. val |= ((value) & 0xffff); \
  435. (script)[A_##symbol##_used[i]] = bS_to_host(val); \
  436. dma_cache_sync((dev), &(script)[A_##symbol##_used[i]], 4, DMA_TO_DEVICE); \
  437. DEBUG((" script, patching short field %s at %d to 0x%x\n", \
  438. #symbol, A_##symbol##_used[i], val)); \
  439. } \
  440. }
  441. static inline __u8
  442. NCR_700_readb(struct Scsi_Host *host, __u32 reg)
  443. {
  444. const struct NCR_700_Host_Parameters *hostdata
  445. = (struct NCR_700_Host_Parameters *)host->hostdata[0];
  446. return ioread8(hostdata->base + (reg^bE));
  447. }
  448. static inline __u32
  449. NCR_700_readl(struct Scsi_Host *host, __u32 reg)
  450. {
  451. const struct NCR_700_Host_Parameters *hostdata
  452. = (struct NCR_700_Host_Parameters *)host->hostdata[0];
  453. __u32 value = bEBus ? ioread32be(hostdata->base + reg) :
  454. ioread32(hostdata->base + reg);
  455. #if 1
  456. /* sanity check the register */
  457. BUG_ON((reg & 0x3) != 0);
  458. #endif
  459. return value;
  460. }
  461. static inline void
  462. NCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg)
  463. {
  464. const struct NCR_700_Host_Parameters *hostdata
  465. = (struct NCR_700_Host_Parameters *)host->hostdata[0];
  466. iowrite8(value, hostdata->base + (reg^bE));
  467. }
  468. static inline void
  469. NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg)
  470. {
  471. const struct NCR_700_Host_Parameters *hostdata
  472. = (struct NCR_700_Host_Parameters *)host->hostdata[0];
  473. #if 1
  474. /* sanity check the register */
  475. BUG_ON((reg & 0x3) != 0);
  476. #endif
  477. bEBus ? iowrite32be(value, hostdata->base + reg):
  478. iowrite32(value, hostdata->base + reg);
  479. }
  480. #endif