sd53c8xx.i 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. unsigned long na_script[] = {
  2. /* extern scsi_id_buf */
  3. /* extern msg_out_buf */
  4. /* extern cmd_buf */
  5. /* extern data_buf */
  6. /* extern status_buf */
  7. /* extern msgin_buf */
  8. /* extern dsa_0 */
  9. /* extern dsa_1 */
  10. /* extern dsa_head */
  11. /* SIR_MSG_IO_COMPLETE = 0 */
  12. /* error_not_cmd_complete = 1 */
  13. /* error_disconnected = 2 */
  14. /* error_reselected = 3 */
  15. /* error_unexpected_phase = 4 */
  16. /* error_weird_message = 5 */
  17. /* SIR_ERROR_NOT_MSG_IN_AFTER_RESELECT = 6 */
  18. /* error_not_identify_after_reselect = 7 */
  19. /* error_too_much_data = 8 */
  20. /* error_too_little_data = 9 */
  21. /* SIR_MSG_REJECT = 10 */
  22. /* SIR_MSG_SDTR = 11 */
  23. /* SIR_EV_RESPONSE_OK = 12 */
  24. /* error_sigp_set = 13 */
  25. /* SIR_EV_PHASE_SWITCH_AFTER_ID = 14 */
  26. /* SIR_MSG_WDTR = 15 */
  27. /* SIR_MSG_IGNORE_WIDE_RESIDUE = 16 */
  28. /* SIR_NOTIFY_DISC = 100 */
  29. /* SIR_NOTIFY_RESELECT = 101 */
  30. /* SIR_NOTIFY_MSG_IN = 102 */
  31. /* SIR_NOTIFY_STATUS = 103 */
  32. /* SIR_NOTIFY_DUMP = 104 */
  33. /* SIR_NOTIFY_DUMP2 = 105 */
  34. /* SIR_NOTIFY_SIGP = 106 */
  35. /* SIR_NOTIFY_ISSUE = 107 */
  36. /* SIR_NOTIFY_WAIT_RESELECT = 108 */
  37. /* SIR_NOTIFY_ISSUE_CHECK = 109 */
  38. /* SIR_NOTIFY_DUMP_NEXT_CODE = 110 */
  39. /* SIR_NOTIFY_COMMAND = 111 */
  40. /* SIR_NOTIFY_DATA_IN = 112 */
  41. /* SIR_NOTIFY_DATA_OUT = 113 */
  42. /* SIR_NOTIFY_BLOCK_DATA_IN = 114 */
  43. /* SIR_NOTIFY_WSR = 115 */
  44. /* SIR_NOTIFY_LOAD_SYNC = 116 */
  45. /* SIR_NOTIFY_RESELECTED_ON_SELECT = 117 */
  46. /* STATE_FREE = 0 */
  47. /* STATE_ALLOCATED = 1 */
  48. /* STATE_ISSUE = 2 */
  49. /* STATE_DISCONNECTED = 3 */
  50. /* STATE_DONE = 4 */
  51. /* RESULT_OK = 0 */
  52. /* MSG_IDENTIFY = 0x80 */
  53. /* MSG_DISCONNECT = 0x04 */
  54. /* MSG_SAVE_DATA_POINTER = 0x02 */
  55. /* MSG_RESTORE_POINTERS = 0x03 */
  56. /* MSG_IGNORE_WIDE_RESIDUE = 0x23 */
  57. /* X_MSG = 0x01 */
  58. /* X_MSG_SDTR = 0x01 */
  59. /* X_MSG_WDTR = 0x03 */
  60. /* MSG_REJECT = 0x07 */
  61. /* BSIZE = 512 */
  62. /* 0000 */ 0x80880000L, /* jump wait_for_reselection */
  63. /* 0004 */ 0x00000514L,
  64. /* 0008 */ 0x88880000L, /* call load_sync */
  65. /* 000c */ 0x0000074cL,
  66. /* 0010 */ 0x60000200L, /* clear target */
  67. /* 0014 */ 0x00000000L,
  68. /* 0018 */ 0x47000000L, /* select atn from scsi_id_buf, reselected_on_select */
  69. /* 001c */ 0x000004ecL,
  70. /* 0020 */ 0x878b0000L, /* jump start1, when msg_in */
  71. /* 0024 */ 0x00000000L,
  72. /* 0028 */ 0x1e000000L, /* move from msg_out_buf, when msg_out */
  73. /* 002c */ 0x00000001L,
  74. /* 0030 */ 0x868b0000L, /* jump start1, when msg_out */
  75. /* 0034 */ 0x00fffff0L,
  76. /* 0038 */ 0x82830000L, /* jump to_decisions, when not cmd */
  77. /* 003c */ 0x000005f0L,
  78. /* 0040 */ 0x60000008L, /* clear atn */
  79. /* 0044 */ 0x00000000L,
  80. /* 0048 */ 0x1a000000L, /* move from cmd_buf, when cmd */
  81. /* 004c */ 0x00000002L,
  82. /* 0050 */ 0x81830000L, /* jump to_decisions, when not data_in */
  83. /* 0054 */ 0x000005d8L,
  84. /* 0058 */ 0xc0000004L, /* move memory 4, state, scratcha */
  85. /* 005c */ 0x00000678L,
  86. /* 0060 */ 0x00000034L,
  87. /* 0064 */ 0xc0000004L, /* move memory 4, dmaaddr, scratchb */
  88. /* 0068 */ 0x0000067cL,
  89. /* 006c */ 0x0000005cL,
  90. /* 0070 */ 0x72360000L, /* move scratcha2 to sfbr */
  91. /* 0074 */ 0x00000000L,
  92. /* 0078 */ 0x808c0000L, /* jump data_in_normal, if 0 */
  93. /* 007c */ 0x00000078L,
  94. /* 0080 */ 0x29000200L, /* move BSIZE, ptr dmaaddr, when data_in */
  95. /* 0084 */ 0x0000067cL,
  96. /* 0088 */ 0x7e5d0200L, /* move scratchb1 + BSIZE / 256 to scratchb1 */
  97. /* 008c */ 0x00000000L,
  98. /* 0090 */ 0x7f5e0000L, /* move scratchb2 + 0 to scratchb2 with carry */
  99. /* 0094 */ 0x00000000L,
  100. /* 0098 */ 0x7f5f0000L, /* move scratchb3 + 0 to scratchb3 with carry */
  101. /* 009c */ 0x00000000L,
  102. /* 00a0 */ 0x7e36ff00L, /* move scratcha2 + 255 to scratcha2 */
  103. /* 00a4 */ 0x00000000L,
  104. /* 00a8 */ 0xc0000004L, /* move memory 4, scratchb, dmaaddr */
  105. /* 00ac */ 0x0000005cL,
  106. /* 00b0 */ 0x0000067cL,
  107. /* 00b4 */ 0x818b0000L, /* jump data_in_block_loop, when data_in */
  108. /* 00b8 */ 0x00ffffb4L,
  109. /* 00bc */ 0xc0000004L, /* move memory 4, scratcha, state */
  110. /* 00c0 */ 0x00000034L,
  111. /* 00c4 */ 0x00000678L,
  112. /* 00c8 */ 0x88880000L, /* call save_state */
  113. /* 00cc */ 0x000005e0L,
  114. /* 00d0 */ 0x80880000L, /* jump to_decisions */
  115. /* 00d4 */ 0x00000558L,
  116. /* 00d8 */ 0xc0000004L, /* move memory 4, scratchb, dmaaddr */
  117. /* 00dc */ 0x0000005cL,
  118. /* 00e0 */ 0x0000067cL,
  119. /* 00e4 */ 0xc0000004L, /* move memory 4, scratcha, state */
  120. /* 00e8 */ 0x00000034L,
  121. /* 00ec */ 0x00000678L,
  122. /* 00f0 */ 0x80880000L, /* jump to_decisions */
  123. /* 00f4 */ 0x00000538L,
  124. /* 00f8 */ 0x72370000L, /* move scratcha3 to sfbr */
  125. /* 00fc */ 0x00000000L,
  126. /* 0100 */ 0x98040000L, /* int error_too_much_data, if not 0 */
  127. /* 0104 */ 0x00000008L,
  128. /* 0108 */ 0x19000000L, /* move from data_buf, when data_in */
  129. /* 010c */ 0x00000003L,
  130. /* 0110 */ 0x78370100L, /* move 1 to scratcha3 */
  131. /* 0114 */ 0x00000000L,
  132. /* 0118 */ 0xc0000004L, /* move memory 4, scratcha, state */
  133. /* 011c */ 0x00000034L,
  134. /* 0120 */ 0x00000678L,
  135. /* 0124 */ 0x88880000L, /* call save_state */
  136. /* 0128 */ 0x00000584L,
  137. /* 012c */ 0x80880000L, /* jump post_data_to_decisions */
  138. /* 0130 */ 0x0000052cL,
  139. /* 0134 */ 0xc0000004L, /* move memory 4, state, scratcha */
  140. /* 0138 */ 0x00000678L,
  141. /* 013c */ 0x00000034L,
  142. /* 0140 */ 0xc0000004L, /* move memory 4, dmaaddr, scratchb */
  143. /* 0144 */ 0x0000067cL,
  144. /* 0148 */ 0x0000005cL,
  145. /* 014c */ 0x72360000L, /* move scratcha2 to sfbr */
  146. /* 0150 */ 0x00000000L,
  147. /* 0154 */ 0x808c0000L, /* jump data_out_normal, if 0 */
  148. /* 0158 */ 0x0000005cL,
  149. /* 015c */ 0xc0000004L, /* move memory 4, dmaaddr, scratchb */
  150. /* 0160 */ 0x0000067cL,
  151. /* 0164 */ 0x0000005cL,
  152. /* 0168 */ 0x28000200L, /* move BSIZE, ptr dmaaddr, when data_out */
  153. /* 016c */ 0x0000067cL,
  154. /* 0170 */ 0x7e5d0200L, /* move scratchb1 + BSIZE / 256 to scratchb1 */
  155. /* 0174 */ 0x00000000L,
  156. /* 0178 */ 0x7f5e0000L, /* move scratchb2 + 0 to scratchb2 with carry */
  157. /* 017c */ 0x00000000L,
  158. /* 0180 */ 0x7f5f0000L, /* move scratchb3 + 0 to scratchb3 with carry */
  159. /* 0184 */ 0x00000000L,
  160. /* 0188 */ 0x7e36ff00L, /* move scratcha2 + 255 to scratcha2 */
  161. /* 018c */ 0x00000000L,
  162. /* 0190 */ 0xc0000004L, /* move memory 4, scratchb, dmaaddr */
  163. /* 0194 */ 0x0000005cL,
  164. /* 0198 */ 0x0000067cL,
  165. /* 019c */ 0x808b0000L, /* jump data_out_block_loop, when data_out */
  166. /* 01a0 */ 0x00ffffa8L,
  167. /* 01a4 */ 0xc0000004L, /* move memory 4, scratcha, state */
  168. /* 01a8 */ 0x00000034L,
  169. /* 01ac */ 0x00000678L,
  170. /* 01b0 */ 0x80880000L, /* jump to_decisions */
  171. /* 01b4 */ 0x00000478L,
  172. /* 01b8 */ 0x72370000L, /* move scratcha3 to sfbr */
  173. /* 01bc */ 0x00000000L,
  174. /* 01c0 */ 0x98040000L, /* int error_too_little_data, if not 0 */
  175. /* 01c4 */ 0x00000009L,
  176. /* 01c8 */ 0x18000000L, /* move from data_buf, when data_out */
  177. /* 01cc */ 0x00000003L,
  178. /* 01d0 */ 0x78370100L, /* move 1 to scratcha3 */
  179. /* 01d4 */ 0x00000000L,
  180. /* 01d8 */ 0xc0000004L, /* move memory 4, scratcha, state */
  181. /* 01dc */ 0x00000034L,
  182. /* 01e0 */ 0x00000678L,
  183. /* 01e4 */ 0x88880000L, /* call save_state */
  184. /* 01e8 */ 0x000004c4L,
  185. /* 01ec */ 0x80880000L, /* jump post_data_to_decisions */
  186. /* 01f0 */ 0x0000046cL,
  187. /* 01f4 */ 0x1b000000L, /* move from status_buf, when status */
  188. /* 01f8 */ 0x00000004L,
  189. /* 01fc */ 0x9f030000L, /* int error_unexpected_phase, when not msg_in */
  190. /* 0200 */ 0x00000004L,
  191. /* 0204 */ 0x0f000001L, /* move 1, scratcha, when msg_in */
  192. /* 0208 */ 0x00000034L,
  193. /* 020c */ 0x808c0007L, /* jump rejected, if MSG_REJECT */
  194. /* 0210 */ 0x00000088L,
  195. /* 0214 */ 0x808c0004L, /* jump disconnected, if MSG_DISCONNECT */
  196. /* 0218 */ 0x00000298L,
  197. /* 021c */ 0x808c0002L, /* jump msg_in_skip, if MSG_SAVE_DATA_POINTER */
  198. /* 0220 */ 0x00000090L,
  199. /* 0224 */ 0x808c0003L, /* jump msg_in_skip, if MSG_RESTORE_POINTERS */
  200. /* 0228 */ 0x00000088L,
  201. /* 022c */ 0x808c0023L, /* jump ignore_wide, if MSG_IGNORE_WIDE_RESIDUE */
  202. /* 0230 */ 0x000001f0L,
  203. /* 0234 */ 0x808c0001L, /* jump extended, if X_MSG */
  204. /* 0238 */ 0x00000088L,
  205. /* 023c */ 0x98040000L, /* int error_not_cmd_complete, if not 0 */
  206. /* 0240 */ 0x00000001L,
  207. /* 0244 */ 0x7c027e00L, /* move scntl2&0x7e to scntl2 */
  208. /* 0248 */ 0x00000000L,
  209. /* 024c */ 0x60000040L, /* clear ack */
  210. /* 0250 */ 0x00000000L,
  211. /* 0254 */ 0x48000000L, /* wait disconnect */
  212. /* 0258 */ 0x00000000L,
  213. /* 025c */ 0xc0000004L, /* move memory 4, state, scratcha */
  214. /* 0260 */ 0x00000678L,
  215. /* 0264 */ 0x00000034L,
  216. /* 0268 */ 0x78340400L, /* move STATE_DONE to scratcha0 */
  217. /* 026c */ 0x00000000L,
  218. /* 0270 */ 0x78350000L, /* move RESULT_OK to scratcha1 */
  219. /* 0274 */ 0x00000000L,
  220. /* 0278 */ 0xc0000004L, /* move memory 4, scratcha, state */
  221. /* 027c */ 0x00000034L,
  222. /* 0280 */ 0x00000678L,
  223. /* 0284 */ 0x88880000L, /* call save_state */
  224. /* 0288 */ 0x00000424L,
  225. /* 028c */ 0x98180000L, /* intfly 0 */
  226. /* 0290 */ 0x00000000L,
  227. /* 0294 */ 0x80880000L, /* jump issue_check */
  228. /* 0298 */ 0x0000043cL,
  229. /* 029c */ 0x98080000L, /* int SIR_MSG_REJECT */
  230. /* 02a0 */ 0x0000000aL,
  231. /* 02a4 */ 0x60000040L, /* clear ack */
  232. /* 02a8 */ 0x00000000L,
  233. /* 02ac */ 0x80880000L, /* jump to_decisions */
  234. /* 02b0 */ 0x0000037cL,
  235. /* 02b4 */ 0x60000040L, /* clear ack */
  236. /* 02b8 */ 0x00000000L,
  237. /* 02bc */ 0x80880000L, /* jump to_decisions */
  238. /* 02c0 */ 0x0000036cL,
  239. /* 02c4 */ 0x60000040L, /* clear ack */
  240. /* 02c8 */ 0x00000000L,
  241. /* 02cc */ 0x9f030000L, /* int error_unexpected_phase, when not msg_in */
  242. /* 02d0 */ 0x00000004L,
  243. /* 02d4 */ 0x0f000001L, /* move 1, scratcha1, when msg_in */
  244. /* 02d8 */ 0x00000035L,
  245. /* 02dc */ 0x808c0003L, /* jump ext_3, if 3 */
  246. /* 02e0 */ 0x00000030L,
  247. /* 02e4 */ 0x808c0002L, /* jump ext_2, if 2 */
  248. /* 02e8 */ 0x00000098L,
  249. /* 02ec */ 0x98040001L, /* int error_weird_message, if not 1 */
  250. /* 02f0 */ 0x00000005L,
  251. /* 02f4 */ 0x60000040L, /* clear ack */
  252. /* 02f8 */ 0x00000000L,
  253. /* 02fc */ 0x9f030000L, /* int error_unexpected_phase, when not msg_in */
  254. /* 0300 */ 0x00000004L,
  255. /* 0304 */ 0x0f000001L, /* move 1, scratcha1, when msg_in */
  256. /* 0308 */ 0x00000035L,
  257. /* 030c */ 0x80880000L, /* jump ext_done */
  258. /* 0310 */ 0x000000c8L,
  259. /* 0314 */ 0x60000040L, /* ext_3: clear ack */
  260. /* 0318 */ 0x00000000L,
  261. /* 031c */ 0x9f030000L, /* int error_unexpected_phase, when not msg_in */
  262. /* 0320 */ 0x00000004L,
  263. /* 0324 */ 0x0f000001L, /* move 1, scratcha1, when msg_in */
  264. /* 0328 */ 0x00000035L,
  265. /* 032c */ 0x60000040L, /* clear ack */
  266. /* 0330 */ 0x00000000L,
  267. /* 0334 */ 0x9f030000L, /* int error_unexpected_phase, when not msg_in */
  268. /* 0338 */ 0x00000004L,
  269. /* 033c */ 0x0f000001L, /* move 1, scratcha2, when msg_in */
  270. /* 0340 */ 0x00000036L,
  271. /* 0344 */ 0x60000040L, /* clear ack */
  272. /* 0348 */ 0x00000000L,
  273. /* 034c */ 0x9f030000L, /* int error_unexpected_phase, when not msg_in */
  274. /* 0350 */ 0x00000004L,
  275. /* 0354 */ 0x0f000001L, /* move 1, scratcha3, when msg_in */
  276. /* 0358 */ 0x00000037L,
  277. /* 035c */ 0x72350000L, /* move scratcha1 to sfbr */
  278. /* 0360 */ 0x00000000L,
  279. /* 0364 */ 0x80840001L, /* jump ext_done, if not X_MSG_SDTR */
  280. /* 0368 */ 0x00000070L,
  281. /* 036c */ 0x98080000L, /* sdtr: int SIR_MSG_SDTR */
  282. /* 0370 */ 0x0000000bL,
  283. /* 0374 */ 0x60000040L, /* clear ack */
  284. /* 0378 */ 0x00000000L,
  285. /* 037c */ 0x80880000L, /* jump to_decisions */
  286. /* 0380 */ 0x000002acL,
  287. /* 0384 */ 0x60000040L, /* ext_2: clear ack */
  288. /* 0388 */ 0x00000000L,
  289. /* 038c */ 0x9f030000L, /* int error_unexpected_phase, when not msg_in */
  290. /* 0390 */ 0x00000004L,
  291. /* 0394 */ 0x0f000001L, /* move 1, scratcha1, when msg_in */
  292. /* 0398 */ 0x00000035L,
  293. /* 039c */ 0x60000040L, /* clear ack */
  294. /* 03a0 */ 0x00000000L,
  295. /* 03a4 */ 0x9f030000L, /* int error_unexpected_phase, when not msg_in */
  296. /* 03a8 */ 0x00000004L,
  297. /* 03ac */ 0x0f000001L, /* move 1, scratcha2, when msg_in */
  298. /* 03b0 */ 0x00000036L,
  299. /* 03b4 */ 0x72350000L, /* move scratcha1 to sfbr */
  300. /* 03b8 */ 0x00000000L,
  301. /* 03bc */ 0x80840003L, /* jump ext_done, if not X_MSG_WDTR */
  302. /* 03c0 */ 0x00000018L,
  303. /* 03c4 */ 0x98080000L, /* wdtr: int SIR_MSG_WDTR */
  304. /* 03c8 */ 0x0000000fL,
  305. /* 03cc */ 0x60000040L, /* clear ack */
  306. /* 03d0 */ 0x00000000L,
  307. /* 03d4 */ 0x80880000L, /* jump to_decisions */
  308. /* 03d8 */ 0x00000254L,
  309. /* 03dc */ 0x58000008L, /* set atn */
  310. /* 03e0 */ 0x00000000L,
  311. /* 03e4 */ 0x60000040L, /* clear ack */
  312. /* 03e8 */ 0x00000000L,
  313. /* 03ec */ 0x78340700L, /* move MSG_REJECT to scratcha */
  314. /* 03f0 */ 0x00000000L,
  315. /* 03f4 */ 0x9e030000L, /* int error_unexpected_phase, when not msg_out */
  316. /* 03f8 */ 0x00000004L,
  317. /* 03fc */ 0x60000008L, /* clear atn */
  318. /* 0400 */ 0x00000000L,
  319. /* 0404 */ 0x0e000001L, /* move 1, scratcha, when msg_out */
  320. /* 0408 */ 0x00000034L,
  321. /* 040c */ 0x60000040L, /* clear ack */
  322. /* 0410 */ 0x00000000L,
  323. /* 0414 */ 0x868b0000L, /* jump reject, when msg_out */
  324. /* 0418 */ 0x00ffffc0L,
  325. /* 041c */ 0x80880000L, /* jump to_decisions */
  326. /* 0420 */ 0x0000020cL,
  327. /* 0424 */ 0x60000040L, /* clear ack */
  328. /* 0428 */ 0x00000000L,
  329. /* 042c */ 0x9f030000L, /* int error_unexpected_phase, when not msg_in */
  330. /* 0430 */ 0x00000004L,
  331. /* 0434 */ 0x0f000001L, /* move 1, scratcha1, when msg_in */
  332. /* 0438 */ 0x00000035L,
  333. /* 043c */ 0x98080000L, /* int SIR_MSG_IGNORE_WIDE_RESIDUE */
  334. /* 0440 */ 0x00000010L,
  335. /* 0444 */ 0x60000040L, /* clear ack */
  336. /* 0448 */ 0x00000000L,
  337. /* 044c */ 0x80880000L, /* jump to_decisions */
  338. /* 0450 */ 0x000001dcL,
  339. /* 0454 */ 0x58000008L, /* set atn */
  340. /* 0458 */ 0x00000000L,
  341. /* 045c */ 0x60000040L, /* clear ack */
  342. /* 0460 */ 0x00000000L,
  343. /* 0464 */ 0x9e030000L, /* int error_unexpected_phase, when not msg_out */
  344. /* 0468 */ 0x00000004L,
  345. /* 046c */ 0x1e000000L, /* move from msg_out_buf, when msg_out */
  346. /* 0470 */ 0x00000001L,
  347. /* 0474 */ 0x868b0000L, /* jump response_repeat, when msg_out */
  348. /* 0478 */ 0x00fffff0L,
  349. /* 047c */ 0x878b0000L, /* jump response_msg_in, when msg_in */
  350. /* 0480 */ 0x00000010L,
  351. /* 0484 */ 0x98080000L, /* int SIR_EV_RESPONSE_OK */
  352. /* 0488 */ 0x0000000cL,
  353. /* 048c */ 0x80880000L, /* jump to_decisions */
  354. /* 0490 */ 0x0000019cL,
  355. /* 0494 */ 0x0f000001L, /* move 1, scratcha, when msg_in */
  356. /* 0498 */ 0x00000034L,
  357. /* 049c */ 0x808c0007L, /* jump rejected, if MSG_REJECT */
  358. /* 04a0 */ 0x00fffdf8L,
  359. /* 04a4 */ 0x98080000L, /* int SIR_EV_RESPONSE_OK */
  360. /* 04a8 */ 0x0000000cL,
  361. /* 04ac */ 0x80880000L, /* jump msg_in_not_reject */
  362. /* 04b0 */ 0x00fffd60L,
  363. /* 04b4 */ 0x7c027e00L, /* move scntl2&0x7e to scntl2 */
  364. /* 04b8 */ 0x00000000L,
  365. /* 04bc */ 0x60000040L, /* clear ack */
  366. /* 04c0 */ 0x00000000L,
  367. /* 04c4 */ 0x48000000L, /* wait disconnect */
  368. /* 04c8 */ 0x00000000L,
  369. /* 04cc */ 0xc0000004L, /* move memory 4, state, scratcha */
  370. /* 04d0 */ 0x00000678L,
  371. /* 04d4 */ 0x00000034L,
  372. /* 04d8 */ 0x78340300L, /* move STATE_DISCONNECTED to scratcha0 */
  373. /* 04dc */ 0x00000000L,
  374. /* 04e0 */ 0xc0000004L, /* move memory 4, scratcha, state */
  375. /* 04e4 */ 0x00000034L,
  376. /* 04e8 */ 0x00000678L,
  377. /* 04ec */ 0x88880000L, /* call save_state */
  378. /* 04f0 */ 0x000001bcL,
  379. /* 04f4 */ 0x74020100L, /* move scntl2&0x01 to sfbr */
  380. /* 04f8 */ 0x00000000L,
  381. /* 04fc */ 0x98040000L, /* int SIR_NOTIFY_WSR, if not 0 */
  382. /* 0500 */ 0x00000073L,
  383. /* 0504 */ 0x80880000L, /* jump issue_check */
  384. /* 0508 */ 0x000001ccL,
  385. /* 050c */ 0x98080000L, /* int SIR_NOTIFY_RESELECTED_ON_SELECT */
  386. /* 0510 */ 0x00000075L,
  387. /* 0514 */ 0x80880000L, /* jump reselected */
  388. /* 0518 */ 0x00000008L,
  389. /* 051c */ 0x54000000L, /* wait reselect sigp_set */
  390. /* 0520 */ 0x000001acL,
  391. /* 0524 */ 0x60000200L, /* clear target */
  392. /* 0528 */ 0x00000000L,
  393. /* 052c */ 0x9f030000L, /* int SIR_ERROR_NOT_MSG_IN_AFTER_RESELECT, when not msg_in */
  394. /* 0530 */ 0x00000006L,
  395. /* 0534 */ 0x0f000001L, /* move 1, scratchb, when msg_in */
  396. /* 0538 */ 0x0000005cL,
  397. /* 053c */ 0x98041f80L, /* int error_not_identify_after_reselect, if not MSG_IDENTIFY and mask 0x1f */
  398. /* 0540 */ 0x00000007L,
  399. /* 0544 */ 0xc0000004L, /* move memory 4, dsa_head, dsa */
  400. /* 0548 */ 0x00000008L,
  401. /* 054c */ 0x00000010L,
  402. /* 0550 */ 0x72100000L, /* move dsa0 to sfbr */
  403. /* 0554 */ 0x00000000L,
  404. /* 0558 */ 0x80840000L, /* jump find_dsa_1, if not 0 */
  405. /* 055c */ 0x00000030L,
  406. /* 0560 */ 0x72110000L, /* move dsa1 to sfbr */
  407. /* 0564 */ 0x00000000L,
  408. /* 0568 */ 0x80840000L, /* jump find_dsa_1, if not 0 */
  409. /* 056c */ 0x00000020L,
  410. /* 0570 */ 0x72120000L, /* move dsa2 to sfbr */
  411. /* 0574 */ 0x00000000L,
  412. /* 0578 */ 0x80840000L, /* jump find_dsa_1, if not 0 */
  413. /* 057c */ 0x00000010L,
  414. /* 0580 */ 0x72130000L, /* move dsa3 to sfbr */
  415. /* 0584 */ 0x00000000L,
  416. /* 0588 */ 0x980c0000L, /* int error_reselected, if 0 */
  417. /* 058c */ 0x00000003L,
  418. /* 0590 */ 0x88880000L, /* call load_state */
  419. /* 0594 */ 0x000000f8L,
  420. /* 0598 */ 0xc0000004L, /* move memory 4, state, scratcha */
  421. /* 059c */ 0x00000678L,
  422. /* 05a0 */ 0x00000034L,
  423. /* 05a4 */ 0x72340000L, /* move scratcha0 to sfbr */
  424. /* 05a8 */ 0x00000000L,
  425. /* 05ac */ 0x80840003L, /* jump find_dsa_next, if not STATE_DISCONNECTED */
  426. /* 05b0 */ 0x00000038L,
  427. /* 05b4 */ 0x740a0f00L, /* move ssid & 15 to sfbr */
  428. /* 05b8 */ 0x00000000L,
  429. /* 05bc */ 0xc0000001L, /* move memory 1, targ, find_dsa_smc1 */
  430. /* 05c0 */ 0x00000680L,
  431. /* 05c4 */ 0x000005c8L,
  432. /* 05c8 */ 0x808400ffL, /* jump find_dsa_next, if not 255 */
  433. /* 05cc */ 0x0000001cL,
  434. /* 05d0 */ 0xc0000001L, /* move memory 1, lun, find_dsa_smc2 */
  435. /* 05d4 */ 0x00000684L,
  436. /* 05d8 */ 0x000005e4L,
  437. /* 05dc */ 0x725c0000L, /* move scratchb0 to sfbr */
  438. /* 05e0 */ 0x00000000L,
  439. /* 05e4 */ 0x808cf8ffL, /* jump reload_sync, if 255 and mask ~7 */
  440. /* 05e8 */ 0x00000034L,
  441. /* 05ec */ 0xc0000004L, /* move memory 4, next, dsa */
  442. /* 05f0 */ 0x0000068cL,
  443. /* 05f4 */ 0x00000010L,
  444. /* 05f8 */ 0x80880000L, /* jump find_dsa_loop */
  445. /* 05fc */ 0x00ffff50L,
  446. /* 0600 */ 0x60000008L, /* clear atn */
  447. /* 0604 */ 0x00000000L,
  448. /* 0608 */ 0x878b0000L, /* jump msg_in_phase, when msg_in */
  449. /* 060c */ 0x00fffbf4L,
  450. /* 0610 */ 0x98080000L, /* int SIR_MSG_REJECT */
  451. /* 0614 */ 0x0000000aL,
  452. /* 0618 */ 0x80880000L, /* jump to_decisions */
  453. /* 061c */ 0x00000010L,
  454. /* 0620 */ 0x88880000L, /* call load_sync */
  455. /* 0624 */ 0x00000134L,
  456. /* 0628 */ 0x60000040L, /* clear ack */
  457. /* 062c */ 0x00000000L,
  458. /* 0630 */ 0x818b0000L, /* jump data_in_phase, when data_in */
  459. /* 0634 */ 0x00fffa20L,
  460. /* 0638 */ 0x828a0000L, /* jump cmd_phase, if cmd */
  461. /* 063c */ 0x00fffa00L,
  462. /* 0640 */ 0x808a0000L, /* jump data_out_phase, if data_out */
  463. /* 0644 */ 0x00fffaecL,
  464. /* 0648 */ 0x838a0000L, /* jump status_phase, if status */
  465. /* 064c */ 0x00fffba4L,
  466. /* 0650 */ 0x878a0000L, /* jump msg_in_phase, if msg_in */
  467. /* 0654 */ 0x00fffbacL,
  468. /* 0658 */ 0x98080000L, /* int error_unexpected_phase */
  469. /* 065c */ 0x00000004L,
  470. /* 0660 */ 0x838b0000L, /* jump status_phase, when status */
  471. /* 0664 */ 0x00fffb8cL,
  472. /* 0668 */ 0x878a0000L, /* jump msg_in_phase, if msg_in */
  473. /* 066c */ 0x00fffb94L,
  474. /* 0670 */ 0x98080000L, /* int error_unexpected_phase */
  475. /* 0674 */ 0x00000004L,
  476. /* 0678 */ 0x00000000L, /* state: defw 0 */
  477. /* 067c */ 0x00000000L, /* dmaaddr: defw 0 */
  478. /* 0680 */ 0x00000000L, /* targ: defw 0 */
  479. /* 0684 */ 0x00000000L, /* lun: defw 0 */
  480. /* 0688 */ 0x00000000L, /* sync: defw 0 */
  481. /* 068c */ 0x00000000L, /* next: defw 0 */
  482. /* dsa_load_len = dsa_load_end - dsa_copy */
  483. /* dsa_save_len = dsa_save_end - dsa_copy */
  484. /* 0690 */ 0xc0000004L, /* move memory 4, dsa, load_state_smc0 + 4 */
  485. /* 0694 */ 0x00000010L,
  486. /* 0698 */ 0x000006a0L,
  487. /* 069c */ 0xc0000018L, /* move memory dsa_load_len, 0, dsa_copy */
  488. /* 06a0 */ 0x00000000L,
  489. /* 06a4 */ 0x00000678L,
  490. /* 06a8 */ 0x90080000L, /* return */
  491. /* 06ac */ 0x00000000L,
  492. /* 06b0 */ 0xc0000004L, /* move memory 4, dsa, save_state_smc0 + 8 */
  493. /* 06b4 */ 0x00000010L,
  494. /* 06b8 */ 0x000006c4L,
  495. /* 06bc */ 0xc0000008L, /* move memory dsa_save_len, dsa_copy, 0 */
  496. /* 06c0 */ 0x00000678L,
  497. /* 06c4 */ 0x00000000L,
  498. /* 06c8 */ 0x90080000L, /* return */
  499. /* 06cc */ 0x00000000L,
  500. /* 06d0 */ 0x721a0000L, /* move ctest2 to sfbr */
  501. /* 06d4 */ 0x00000000L,
  502. /* 06d8 */ 0xc0000004L, /* move memory 4, dsa_head, dsa */
  503. /* 06dc */ 0x00000008L,
  504. /* 06e0 */ 0x00000010L,
  505. /* 06e4 */ 0x72100000L, /* move dsa0 to sfbr */
  506. /* 06e8 */ 0x00000000L,
  507. /* 06ec */ 0x80840000L, /* jump issue_check_1, if not 0 */
  508. /* 06f0 */ 0x00000030L,
  509. /* 06f4 */ 0x72110000L, /* move dsa1 to sfbr */
  510. /* 06f8 */ 0x00000000L,
  511. /* 06fc */ 0x80840000L, /* jump issue_check_1, if not 0 */
  512. /* 0700 */ 0x00000020L,
  513. /* 0704 */ 0x72120000L, /* move dsa2 to sfbr */
  514. /* 0708 */ 0x00000000L,
  515. /* 070c */ 0x80840000L, /* jump issue_check_1, if not 0 */
  516. /* 0710 */ 0x00000010L,
  517. /* 0714 */ 0x72130000L, /* move dsa3 to sfbr */
  518. /* 0718 */ 0x00000000L,
  519. /* 071c */ 0x808c0000L, /* jump wait_for_reselection, if 0 */
  520. /* 0720 */ 0x00fffdf8L,
  521. /* 0724 */ 0x88880000L, /* call load_state */
  522. /* 0728 */ 0x00ffff64L,
  523. /* 072c */ 0xc0000004L, /* move memory 4, state, scratcha */
  524. /* 0730 */ 0x00000678L,
  525. /* 0734 */ 0x00000034L,
  526. /* 0738 */ 0x72340000L, /* move scratcha0 to sfbr */
  527. /* 073c */ 0x00000000L,
  528. /* 0740 */ 0x808c0002L, /* jump start, if STATE_ISSUE */
  529. /* 0744 */ 0x00fff8c0L,
  530. /* 0748 */ 0xc0000004L, /* move memory 4, next, dsa */
  531. /* 074c */ 0x0000068cL,
  532. /* 0750 */ 0x00000010L,
  533. /* 0754 */ 0x80880000L, /* jump issue_check_loop */
  534. /* 0758 */ 0x00ffff88L,
  535. /* 075c */ 0xc0000004L, /* move memory 4, sync, scratcha */
  536. /* 0760 */ 0x00000688L,
  537. /* 0764 */ 0x00000034L,
  538. /* 0768 */ 0x72340000L, /* move scratcha0 to sfbr */
  539. /* 076c */ 0x00000000L,
  540. /* 0770 */ 0x6a030000L, /* move sfbr to scntl3 */
  541. /* 0774 */ 0x00000000L,
  542. /* 0778 */ 0x72350000L, /* move scratcha1 to sfbr */
  543. /* 077c */ 0x00000000L,
  544. /* 0780 */ 0x6a050000L, /* move sfbr to sxfer */
  545. /* 0784 */ 0x00000000L,
  546. /* 0788 */ 0x90080000L, /* return */
  547. /* 078c */ 0x00000000L,
  548. };
  549. #define NA_SCRIPT_SIZE 484
  550. struct na_patch na_patches[] = {
  551. { 0x0006, 5 }, /* 00000018 */
  552. { 0x000b, 4 }, /* 0000002c */
  553. { 0x0013, 4 }, /* 0000004c */
  554. { 0x0017, 1 }, /* 0000005c */
  555. { 0x0018, 2 }, /* 00000060 */
  556. { 0x001a, 1 }, /* 00000068 */
  557. { 0x001b, 2 }, /* 0000006c */
  558. { 0x0021, 1 }, /* 00000084 */
  559. { 0x002b, 2 }, /* 000000ac */
  560. { 0x002c, 1 }, /* 000000b0 */
  561. { 0x0030, 2 }, /* 000000c0 */
  562. { 0x0031, 1 }, /* 000000c4 */
  563. { 0x0037, 2 }, /* 000000dc */
  564. { 0x0038, 1 }, /* 000000e0 */
  565. { 0x003a, 2 }, /* 000000e8 */
  566. { 0x003b, 1 }, /* 000000ec */
  567. { 0x0043, 4 }, /* 0000010c */
  568. { 0x0047, 2 }, /* 0000011c */
  569. { 0x0048, 1 }, /* 00000120 */
  570. { 0x004e, 1 }, /* 00000138 */
  571. { 0x004f, 2 }, /* 0000013c */
  572. { 0x0051, 1 }, /* 00000144 */
  573. { 0x0052, 2 }, /* 00000148 */
  574. { 0x0058, 1 }, /* 00000160 */
  575. { 0x0059, 2 }, /* 00000164 */
  576. { 0x005b, 1 }, /* 0000016c */
  577. { 0x0065, 2 }, /* 00000194 */
  578. { 0x0066, 1 }, /* 00000198 */
  579. { 0x006a, 2 }, /* 000001a8 */
  580. { 0x006b, 1 }, /* 000001ac */
  581. { 0x0073, 4 }, /* 000001cc */
  582. { 0x0077, 2 }, /* 000001dc */
  583. { 0x0078, 1 }, /* 000001e0 */
  584. { 0x007e, 4 }, /* 000001f8 */
  585. { 0x0082, 2 }, /* 00000208 */
  586. { 0x0098, 1 }, /* 00000260 */
  587. { 0x0099, 2 }, /* 00000264 */
  588. { 0x009f, 2 }, /* 0000027c */
  589. { 0x00a0, 1 }, /* 00000280 */
  590. { 0x00b6, 2 }, /* 000002d8 */
  591. { 0x00c2, 2 }, /* 00000308 */
  592. { 0x00ca, 2 }, /* 00000328 */
  593. { 0x00d0, 2 }, /* 00000340 */
  594. { 0x00d6, 2 }, /* 00000358 */
  595. { 0x00e6, 2 }, /* 00000398 */
  596. { 0x00ec, 2 }, /* 000003b0 */
  597. { 0x0102, 2 }, /* 00000408 */
  598. { 0x010e, 2 }, /* 00000438 */
  599. { 0x011c, 4 }, /* 00000470 */
  600. { 0x0126, 2 }, /* 00000498 */
  601. { 0x0134, 1 }, /* 000004d0 */
  602. { 0x0135, 2 }, /* 000004d4 */
  603. { 0x0139, 2 }, /* 000004e4 */
  604. { 0x013a, 1 }, /* 000004e8 */
  605. { 0x014e, 2 }, /* 00000538 */
  606. { 0x0152, 4 }, /* 00000548 */
  607. { 0x0153, 2 }, /* 0000054c */
  608. { 0x0167, 1 }, /* 0000059c */
  609. { 0x0168, 2 }, /* 000005a0 */
  610. { 0x0170, 1 }, /* 000005c0 */
  611. { 0x0171, 1 }, /* 000005c4 */
  612. { 0x0175, 1 }, /* 000005d4 */
  613. { 0x0176, 1 }, /* 000005d8 */
  614. { 0x017c, 1 }, /* 000005f0 */
  615. { 0x017d, 2 }, /* 000005f4 */
  616. { 0x01a5, 2 }, /* 00000694 */
  617. { 0x01a6, 1 }, /* 00000698 */
  618. { 0x01a9, 1 }, /* 000006a4 */
  619. { 0x01ad, 2 }, /* 000006b4 */
  620. { 0x01ae, 1 }, /* 000006b8 */
  621. { 0x01b0, 1 }, /* 000006c0 */
  622. { 0x01b7, 4 }, /* 000006dc */
  623. { 0x01b8, 2 }, /* 000006e0 */
  624. { 0x01cc, 1 }, /* 00000730 */
  625. { 0x01cd, 2 }, /* 00000734 */
  626. { 0x01d3, 1 }, /* 0000074c */
  627. { 0x01d4, 2 }, /* 00000750 */
  628. { 0x01d8, 1 }, /* 00000760 */
  629. { 0x01d9, 2 }, /* 00000764 */
  630. };
  631. #define NA_PATCHES 79
  632. enum na_external {
  633. X_scsi_id_buf,
  634. X_msg_out_buf,
  635. X_cmd_buf,
  636. X_data_buf,
  637. X_status_buf,
  638. X_msgin_buf,
  639. X_dsa_0,
  640. X_dsa_1,
  641. X_dsa_head,
  642. };
  643. enum {
  644. E_issue_check_next = 1864,
  645. E_issue_check_1 = 1828,
  646. E_issue_check_loop = 1764,
  647. E_save_state_smc0 = 1724,
  648. E_load_state_smc0 = 1692,
  649. E_dsa_load_end = 1680,
  650. E_sync = 1672,
  651. E_dsa_save_end = 1664,
  652. E_dsa_copy = 1656,
  653. E_id_out_mismatch_recover = 1536,
  654. E_next = 1676,
  655. E_reload_sync = 1568,
  656. E_find_dsa_smc2 = 1508,
  657. E_lun = 1668,
  658. E_find_dsa_smc1 = 1480,
  659. E_targ = 1664,
  660. E_find_dsa_next = 1516,
  661. E_load_state = 1680,
  662. E_find_dsa_1 = 1424,
  663. E_find_dsa_loop = 1360,
  664. E_find_dsa = 1348,
  665. E_sigp_set = 1744,
  666. E_reselected = 1316,
  667. E_wsr_check = 1268,
  668. E_response_msg_in = 1172,
  669. E_response_repeat = 1132,
  670. E_response = 1108,
  671. E_reject = 988,
  672. E_wdtr = 964,
  673. E_sdtr = 876,
  674. E_ext_done = 988,
  675. E_ext_1 = 756,
  676. E_ext_2 = 900,
  677. E_ext_3 = 788,
  678. E_issue_check = 1752,
  679. E_extended = 708,
  680. E_ignore_wide = 1060,
  681. E_msg_in_skip = 692,
  682. E_disconnected = 1204,
  683. E_msg_in_not_reject = 532,
  684. E_rejected = 668,
  685. E_msg_in_phase = 516,
  686. E_status_phase = 500,
  687. E_data_out_mismatch = 464,
  688. E_data_out_block_mismatch = 368,
  689. E_data_out_normal = 440,
  690. E_data_out_block_loop = 332,
  691. E_data_out_phase = 308,
  692. E_post_data_to_decisions = 1632,
  693. E_data_in_mismatch = 272,
  694. E_data_block_mismatch_recover = 216,
  695. E_save_state = 1712,
  696. E_data_in_block_mismatch = 136,
  697. E_data_in_normal = 248,
  698. E_data_in_block_loop = 112,
  699. E_dmaaddr = 1660,
  700. E_state = 1656,
  701. E_data_in_phase = 88,
  702. E_cmd_out_mismatch = 80,
  703. E_cmd_phase = 64,
  704. E_to_decisions = 1584,
  705. E_id_out_mismatch = 48,
  706. E_start1 = 40,
  707. E_reselected_on_select = 1292,
  708. E_load_sync = 1884,
  709. E_start = 8,
  710. E_wait_for_reselection = 1308,
  711. E_idle = 0,
  712. };
  713. #define A_dsa_save_len 8
  714. #define A_dsa_load_len 24
  715. #define A_BSIZE 512
  716. #define A_MSG_REJECT 7
  717. #define A_X_MSG_WDTR 3
  718. #define A_X_MSG_SDTR 1
  719. #define A_X_MSG 1
  720. #define A_MSG_IGNORE_WIDE_RESIDUE 35
  721. #define A_MSG_RESTORE_POINTERS 3
  722. #define A_MSG_SAVE_DATA_POINTER 2
  723. #define A_MSG_DISCONNECT 4
  724. #define A_MSG_IDENTIFY 128
  725. #define A_RESULT_OK 0
  726. #define A_STATE_DONE 4
  727. #define A_STATE_DISCONNECTED 3
  728. #define A_STATE_ISSUE 2
  729. #define A_STATE_ALLOCATED 1
  730. #define A_STATE_FREE 0
  731. #define A_SIR_NOTIFY_RESELECTED_ON_SELECT 117
  732. #define A_SIR_NOTIFY_LOAD_SYNC 116
  733. #define A_SIR_NOTIFY_WSR 115
  734. #define A_SIR_NOTIFY_BLOCK_DATA_IN 114
  735. #define A_SIR_NOTIFY_DATA_OUT 113
  736. #define A_SIR_NOTIFY_DATA_IN 112
  737. #define A_SIR_NOTIFY_COMMAND 111
  738. #define A_SIR_NOTIFY_DUMP_NEXT_CODE 110
  739. #define A_SIR_NOTIFY_ISSUE_CHECK 109
  740. #define A_SIR_NOTIFY_WAIT_RESELECT 108
  741. #define A_SIR_NOTIFY_ISSUE 107
  742. #define A_SIR_NOTIFY_SIGP 106
  743. #define A_SIR_NOTIFY_DUMP2 105
  744. #define A_SIR_NOTIFY_DUMP 104
  745. #define A_SIR_NOTIFY_STATUS 103
  746. #define A_SIR_NOTIFY_MSG_IN 102
  747. #define A_SIR_NOTIFY_RESELECT 101
  748. #define A_SIR_NOTIFY_DISC 100
  749. #define A_SIR_MSG_IGNORE_WIDE_RESIDUE 16
  750. #define A_SIR_MSG_WDTR 15
  751. #define A_SIR_EV_PHASE_SWITCH_AFTER_ID 14
  752. #define A_error_sigp_set 13
  753. #define A_SIR_EV_RESPONSE_OK 12
  754. #define A_SIR_MSG_SDTR 11
  755. #define A_SIR_MSG_REJECT 10
  756. #define A_error_too_little_data 9
  757. #define A_error_too_much_data 8
  758. #define A_error_not_identify_after_reselect 7
  759. #define A_SIR_ERROR_NOT_MSG_IN_AFTER_RESELECT 6
  760. #define A_error_weird_message 5
  761. #define A_error_unexpected_phase 4
  762. #define A_error_reselected 3
  763. #define A_error_disconnected 2
  764. #define A_error_not_cmd_complete 1
  765. #define A_SIR_MSG_IO_COMPLETE 0