sym53c8xx.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Device driver for the SYMBIOS/LSILOGIC 53C8XX and 53C1010 family
  4. * of PCI-SCSI IO processors.
  5. *
  6. * Copyright (C) 1999-2001 Gerard Roudier <[email protected]>
  7. *
  8. * This driver is derived from the Linux sym53c8xx driver.
  9. * Copyright (C) 1998-2000 Gerard Roudier
  10. *
  11. * The sym53c8xx driver is derived from the ncr53c8xx driver that had been
  12. * a port of the FreeBSD ncr driver to Linux-1.2.13.
  13. *
  14. * The original ncr driver has been written for 386bsd and FreeBSD by
  15. * Wolfgang Stanglmeier <[email protected]>
  16. * Stefan Esser <[email protected]>
  17. * Copyright (C) 1994 Wolfgang Stanglmeier
  18. *
  19. * Other major contributions:
  20. *
  21. * NVRAM detection and reading.
  22. * Copyright (C) 1997 Richard Waltham <[email protected]>
  23. *
  24. *-----------------------------------------------------------------------------
  25. */
  26. #ifndef SYM53C8XX_H
  27. #define SYM53C8XX_H
  28. /*
  29. * DMA addressing mode.
  30. *
  31. * 0 : 32 bit addressing for all chips.
  32. * 1 : 40 bit addressing when supported by chip.
  33. * 2 : 64 bit addressing when supported by chip,
  34. * limited to 16 segments of 4 GB -> 64 GB max.
  35. */
  36. #define SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
  37. /*
  38. * NVRAM support.
  39. */
  40. #if 1
  41. #define SYM_CONF_NVRAM_SUPPORT (1)
  42. #endif
  43. /*
  44. * These options are not tunable from 'make config'
  45. */
  46. #if 1
  47. #define SYM_LINUX_PROC_INFO_SUPPORT
  48. #define SYM_LINUX_USER_COMMAND_SUPPORT
  49. #define SYM_LINUX_USER_INFO_SUPPORT
  50. #define SYM_LINUX_DEBUG_CONTROL_SUPPORT
  51. #endif
  52. /*
  53. * Also handle old NCR chips if not (0).
  54. */
  55. #define SYM_CONF_GENERIC_SUPPORT (1)
  56. /*
  57. * Allow tags from 2 to 256, default 8
  58. */
  59. #ifndef CONFIG_SCSI_SYM53C8XX_MAX_TAGS
  60. #define CONFIG_SCSI_SYM53C8XX_MAX_TAGS (8)
  61. #endif
  62. #if CONFIG_SCSI_SYM53C8XX_MAX_TAGS < 2
  63. #define SYM_CONF_MAX_TAG (2)
  64. #elif CONFIG_SCSI_SYM53C8XX_MAX_TAGS > 256
  65. #define SYM_CONF_MAX_TAG (256)
  66. #else
  67. #define SYM_CONF_MAX_TAG CONFIG_SCSI_SYM53C8XX_MAX_TAGS
  68. #endif
  69. #ifndef CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS
  70. #define CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS SYM_CONF_MAX_TAG
  71. #endif
  72. /*
  73. * Anyway, we configure the driver for at least 64 tags per LUN. :)
  74. */
  75. #if SYM_CONF_MAX_TAG <= 64
  76. #define SYM_CONF_MAX_TAG_ORDER (6)
  77. #elif SYM_CONF_MAX_TAG <= 128
  78. #define SYM_CONF_MAX_TAG_ORDER (7)
  79. #else
  80. #define SYM_CONF_MAX_TAG_ORDER (8)
  81. #endif
  82. /*
  83. * Max number of SG entries.
  84. */
  85. #define SYM_CONF_MAX_SG (96)
  86. /*
  87. * Driver setup structure.
  88. *
  89. * This structure is initialized from linux config options.
  90. * It can be overridden at boot-up by the boot command line.
  91. */
  92. struct sym_driver_setup {
  93. u_short max_tag;
  94. u_char burst_order;
  95. u_char scsi_led;
  96. u_char scsi_diff;
  97. u_char irq_mode;
  98. u_char scsi_bus_check;
  99. u_char host_id;
  100. u_char verbose;
  101. u_char settle_delay;
  102. u_char use_nvram;
  103. u_long excludes[8];
  104. };
  105. #define SYM_SETUP_MAX_TAG sym_driver_setup.max_tag
  106. #define SYM_SETUP_BURST_ORDER sym_driver_setup.burst_order
  107. #define SYM_SETUP_SCSI_LED sym_driver_setup.scsi_led
  108. #define SYM_SETUP_SCSI_DIFF sym_driver_setup.scsi_diff
  109. #define SYM_SETUP_IRQ_MODE sym_driver_setup.irq_mode
  110. #define SYM_SETUP_SCSI_BUS_CHECK sym_driver_setup.scsi_bus_check
  111. #define SYM_SETUP_HOST_ID sym_driver_setup.host_id
  112. #define boot_verbose sym_driver_setup.verbose
  113. /*
  114. * Initial setup.
  115. *
  116. * Can be overriden at startup by a command line.
  117. */
  118. #define SYM_LINUX_DRIVER_SETUP { \
  119. .max_tag = CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS, \
  120. .burst_order = 7, \
  121. .scsi_led = 1, \
  122. .scsi_diff = 1, \
  123. .irq_mode = 0, \
  124. .scsi_bus_check = 1, \
  125. .host_id = 7, \
  126. .verbose = 0, \
  127. .settle_delay = 3, \
  128. .use_nvram = 1, \
  129. }
  130. extern struct sym_driver_setup sym_driver_setup;
  131. extern unsigned int sym_debug_flags;
  132. #define DEBUG_FLAGS sym_debug_flags
  133. /*
  134. * Max number of targets.
  135. * Maximum is 16 and you are advised not to change this value.
  136. */
  137. #ifndef SYM_CONF_MAX_TARGET
  138. #define SYM_CONF_MAX_TARGET (16)
  139. #endif
  140. /*
  141. * Max number of logical units.
  142. * SPI-2 allows up to 64 logical units, but in real life, target
  143. * that implements more that 7 logical units are pretty rare.
  144. * Anyway, the cost of accepting up to 64 logical unit is low in
  145. * this driver, thus going with the maximum is acceptable.
  146. */
  147. #ifndef SYM_CONF_MAX_LUN
  148. #define SYM_CONF_MAX_LUN (64)
  149. #endif
  150. /*
  151. * Max number of IO control blocks queued to the controller.
  152. * Each entry needs 8 bytes and the queues are allocated contiguously.
  153. * Since we donnot want to allocate more than a page, the theorical
  154. * maximum is PAGE_SIZE/8. For safety, we announce a bit less to the
  155. * access method. :)
  156. * When not supplied, as it is suggested, the driver compute some
  157. * good value for this parameter.
  158. */
  159. /* #define SYM_CONF_MAX_START (PAGE_SIZE/8 - 16) */
  160. /*
  161. * Support for Immediate Arbitration.
  162. * Not advised.
  163. */
  164. /* #define SYM_CONF_IARB_SUPPORT */
  165. /*
  166. * Only relevant if IARB support configured.
  167. * - Max number of successive settings of IARB hints.
  168. * - Set IARB on arbitration lost.
  169. */
  170. #define SYM_CONF_IARB_MAX 3
  171. #define SYM_CONF_SET_IARB_ON_ARB_LOST 1
  172. /*
  173. * Returning wrong residuals may make problems.
  174. * When zero, this define tells the driver to
  175. * always return 0 as transfer residual.
  176. * Btw, all my testings of residuals have succeeded.
  177. */
  178. #define SYM_SETUP_RESIDUAL_SUPPORT 1
  179. #endif /* SYM53C8XX_H */