qla_dbg.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /******************************************************************************
  2. * QLOGIC LINUX SOFTWARE
  3. *
  4. * QLogic ISP2x00 device driver for Linux 2.6.x
  5. * Copyright (C) 2003-2005 QLogic Corporation
  6. * (www.qlogic.com)
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2, or (at your option) any
  11. * later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. ******************************************************************************/
  19. /*
  20. * Driver debug definitions.
  21. */
  22. /* #define QL_DEBUG_LEVEL_1 */ /* Output register accesses to COM1 */
  23. /* #define QL_DEBUG_LEVEL_2 */ /* Output error msgs to COM1 */
  24. /* #define QL_DEBUG_LEVEL_3 */ /* Output function trace msgs to COM1 */
  25. /* #define QL_DEBUG_LEVEL_4 */ /* Output NVRAM trace msgs to COM1 */
  26. /* #define QL_DEBUG_LEVEL_5 */ /* Output ring trace msgs to COM1 */
  27. /* #define QL_DEBUG_LEVEL_6 */ /* Output WATCHDOG timer trace to COM1 */
  28. /* #define QL_DEBUG_LEVEL_7 */ /* Output RISC load trace msgs to COM1 */
  29. /* #define QL_DEBUG_LEVEL_8 */ /* Output ring saturation msgs to COM1 */
  30. /* #define QL_DEBUG_LEVEL_9 */ /* Output IOCTL trace msgs */
  31. /* #define QL_DEBUG_LEVEL_10 */ /* Output IOCTL error msgs */
  32. /* #define QL_DEBUG_LEVEL_11 */ /* Output Mbx Cmd trace msgs */
  33. /* #define QL_DEBUG_LEVEL_12 */ /* Output IP trace msgs */
  34. /* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */
  35. /* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */
  36. /*
  37. * Local Macro Definitions.
  38. */
  39. #if defined(QL_DEBUG_LEVEL_1) || defined(QL_DEBUG_LEVEL_2) || \
  40. defined(QL_DEBUG_LEVEL_3) || defined(QL_DEBUG_LEVEL_4) || \
  41. defined(QL_DEBUG_LEVEL_5) || defined(QL_DEBUG_LEVEL_6) || \
  42. defined(QL_DEBUG_LEVEL_7) || defined(QL_DEBUG_LEVEL_8) || \
  43. defined(QL_DEBUG_LEVEL_9) || defined(QL_DEBUG_LEVEL_10) || \
  44. defined(QL_DEBUG_LEVEL_11) || defined(QL_DEBUG_LEVEL_12) || \
  45. defined(QL_DEBUG_LEVEL_13) || defined(QL_DEBUG_LEVEL_14)
  46. #define QL_DEBUG_ROUTINES
  47. #endif
  48. /*
  49. * Macros use for debugging the driver.
  50. */
  51. #undef ENTER_TRACE
  52. #if defined(ENTER_TRACE)
  53. #define ENTER(x) do { printk("qla2100 : Entering %s()\n", x); } while (0)
  54. #define LEAVE(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0)
  55. #define ENTER_INTR(x) do { printk("qla2100 : Entering %s()\n", x); } while (0)
  56. #define LEAVE_INTR(x) do { printk("qla2100 : Leaving %s()\n", x); } while (0)
  57. #else
  58. #define ENTER(x) do {} while (0)
  59. #define LEAVE(x) do {} while (0)
  60. #define ENTER_INTR(x) do {} while (0)
  61. #define LEAVE_INTR(x) do {} while (0)
  62. #endif
  63. #if DEBUG_QLA2100
  64. #define DEBUG(x) do {x;} while (0);
  65. #else
  66. #define DEBUG(x) do {} while (0);
  67. #endif
  68. #if defined(QL_DEBUG_LEVEL_1)
  69. #define DEBUG1(x) do {x;} while (0);
  70. #else
  71. #define DEBUG1(x) do {} while (0);
  72. #endif
  73. #if defined(QL_DEBUG_LEVEL_2)
  74. #define DEBUG2(x) do {x;} while (0);
  75. #define DEBUG2_3(x) do {x;} while (0);
  76. #define DEBUG2_3_11(x) do {x;} while (0);
  77. #define DEBUG2_9_10(x) do {x;} while (0);
  78. #define DEBUG2_11(x) do {x;} while (0);
  79. #define DEBUG2_13(x) do {x;} while (0);
  80. #else
  81. #define DEBUG2(x) do {} while (0);
  82. #endif
  83. #if defined(QL_DEBUG_LEVEL_3)
  84. #define DEBUG3(x) do {x;} while (0);
  85. #define DEBUG2_3(x) do {x;} while (0);
  86. #define DEBUG2_3_11(x) do {x;} while (0);
  87. #define DEBUG3_11(x) do {x;} while (0);
  88. #else
  89. #define DEBUG3(x) do {} while (0);
  90. #if !defined(QL_DEBUG_LEVEL_2)
  91. #define DEBUG2_3(x) do {} while (0);
  92. #endif
  93. #endif
  94. #if defined(QL_DEBUG_LEVEL_4)
  95. #define DEBUG4(x) do {x;} while (0);
  96. #else
  97. #define DEBUG4(x) do {} while (0);
  98. #endif
  99. #if defined(QL_DEBUG_LEVEL_5)
  100. #define DEBUG5(x) do {x;} while (0);
  101. #else
  102. #define DEBUG5(x) do {} while (0);
  103. #endif
  104. #if defined(QL_DEBUG_LEVEL_7)
  105. #define DEBUG7(x) do {x;} while (0);
  106. #else
  107. #define DEBUG7(x) do {} while (0);
  108. #endif
  109. #if defined(QL_DEBUG_LEVEL_9)
  110. #define DEBUG9(x) do {x;} while (0);
  111. #define DEBUG9_10(x) do {x;} while (0);
  112. #define DEBUG2_9_10(x) do {x;} while (0);
  113. #else
  114. #define DEBUG9(x) do {} while (0);
  115. #endif
  116. #if defined(QL_DEBUG_LEVEL_10)
  117. #define DEBUG10(x) do {x;} while (0);
  118. #define DEBUG2_9_10(x) do {x;} while (0);
  119. #define DEBUG9_10(x) do {x;} while (0);
  120. #else
  121. #define DEBUG10(x) do {} while (0);
  122. #if !defined(DEBUG2_9_10)
  123. #define DEBUG2_9_10(x) do {} while (0);
  124. #endif
  125. #if !defined(DEBUG9_10)
  126. #define DEBUG9_10(x) do {} while (0);
  127. #endif
  128. #endif
  129. #if defined(QL_DEBUG_LEVEL_11)
  130. #define DEBUG11(x) do{x;} while(0);
  131. #if !defined(DEBUG2_11)
  132. #define DEBUG2_11(x) do{x;} while(0);
  133. #endif
  134. #if !defined(DEBUG2_3_11)
  135. #define DEBUG2_3_11(x) do{x;} while(0);
  136. #endif
  137. #if !defined(DEBUG3_11)
  138. #define DEBUG3_11(x) do{x;} while(0);
  139. #endif
  140. #else
  141. #define DEBUG11(x) do{} while(0);
  142. #if !defined(QL_DEBUG_LEVEL_2)
  143. #define DEBUG2_11(x) do{} while(0);
  144. #if !defined(QL_DEBUG_LEVEL_3)
  145. #define DEBUG2_3_11(x) do{} while(0);
  146. #endif
  147. #endif
  148. #if !defined(QL_DEBUG_LEVEL_3)
  149. #define DEBUG3_11(x) do{} while(0);
  150. #endif
  151. #endif
  152. #if defined(QL_DEBUG_LEVEL_12)
  153. #define DEBUG12(x) do {x;} while (0);
  154. #else
  155. #define DEBUG12(x) do {} while (0);
  156. #endif
  157. #if defined(QL_DEBUG_LEVEL_13)
  158. #define DEBUG13(x) do {x;} while (0)
  159. #if !defined(DEBUG2_13)
  160. #define DEBUG2_13(x) do {x;} while(0)
  161. #endif
  162. #else
  163. #define DEBUG13(x) do {} while (0)
  164. #if !defined(QL_DEBUG_LEVEL_2)
  165. #define DEBUG2_13(x) do {} while(0)
  166. #endif
  167. #endif
  168. #if defined(QL_DEBUG_LEVEL_14)
  169. #define DEBUG14(x) do {x;} while (0)
  170. #else
  171. #define DEBUG14(x) do {} while (0)
  172. #endif
  173. /*
  174. * Firmware Dump structure definition
  175. */
  176. #define FW_DUMP_SIZE_128K 0xBC000
  177. #define FW_DUMP_SIZE_512K 0x2FC000
  178. #define FW_DUMP_SIZE_1M 0x5FC000
  179. struct qla2300_fw_dump {
  180. uint16_t hccr;
  181. uint16_t pbiu_reg[8];
  182. uint16_t risc_host_reg[8];
  183. uint16_t mailbox_reg[32];
  184. uint16_t resp_dma_reg[32];
  185. uint16_t dma_reg[48];
  186. uint16_t risc_hdw_reg[16];
  187. uint16_t risc_gp0_reg[16];
  188. uint16_t risc_gp1_reg[16];
  189. uint16_t risc_gp2_reg[16];
  190. uint16_t risc_gp3_reg[16];
  191. uint16_t risc_gp4_reg[16];
  192. uint16_t risc_gp5_reg[16];
  193. uint16_t risc_gp6_reg[16];
  194. uint16_t risc_gp7_reg[16];
  195. uint16_t frame_buf_hdw_reg[64];
  196. uint16_t fpm_b0_reg[64];
  197. uint16_t fpm_b1_reg[64];
  198. uint16_t risc_ram[0xf800];
  199. uint16_t stack_ram[0x1000];
  200. uint16_t data_ram[1];
  201. };
  202. struct qla2100_fw_dump {
  203. uint16_t hccr;
  204. uint16_t pbiu_reg[8];
  205. uint16_t mailbox_reg[32];
  206. uint16_t dma_reg[48];
  207. uint16_t risc_hdw_reg[16];
  208. uint16_t risc_gp0_reg[16];
  209. uint16_t risc_gp1_reg[16];
  210. uint16_t risc_gp2_reg[16];
  211. uint16_t risc_gp3_reg[16];
  212. uint16_t risc_gp4_reg[16];
  213. uint16_t risc_gp5_reg[16];
  214. uint16_t risc_gp6_reg[16];
  215. uint16_t risc_gp7_reg[16];
  216. uint16_t frame_buf_hdw_reg[16];
  217. uint16_t fpm_b0_reg[64];
  218. uint16_t fpm_b1_reg[64];
  219. uint16_t risc_ram[0xf000];
  220. };
  221. #define FW_DUMP_SIZE_24XX 0x2B0000
  222. struct qla24xx_fw_dump {
  223. uint32_t hccr;
  224. uint32_t host_reg[32];
  225. uint16_t mailbox_reg[32];
  226. uint32_t xseq_gp_reg[128];
  227. uint32_t xseq_0_reg[16];
  228. uint32_t xseq_1_reg[16];
  229. uint32_t rseq_gp_reg[128];
  230. uint32_t rseq_0_reg[16];
  231. uint32_t rseq_1_reg[16];
  232. uint32_t rseq_2_reg[16];
  233. uint32_t cmd_dma_reg[16];
  234. uint32_t req0_dma_reg[15];
  235. uint32_t resp0_dma_reg[15];
  236. uint32_t req1_dma_reg[15];
  237. uint32_t xmt0_dma_reg[32];
  238. uint32_t xmt1_dma_reg[32];
  239. uint32_t xmt2_dma_reg[32];
  240. uint32_t xmt3_dma_reg[32];
  241. uint32_t xmt4_dma_reg[32];
  242. uint32_t xmt_data_dma_reg[16];
  243. uint32_t rcvt0_data_dma_reg[32];
  244. uint32_t rcvt1_data_dma_reg[32];
  245. uint32_t risc_gp_reg[128];
  246. uint32_t shadow_reg[7];
  247. uint32_t lmc_reg[112];
  248. uint32_t fpm_hdw_reg[192];
  249. uint32_t fb_hdw_reg[176];
  250. uint32_t code_ram[0x2000];
  251. uint32_t ext_mem[1];
  252. };