53c7xx_d.h_shipped 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874
  1. /* DO NOT EDIT - Generated automatically by script_asm.pl */
  2. static u32 SCRIPT[] = {
  3. /*
  4. ; 53c710 driver. Modified from Drew Eckhardts driver
  5. ; for 53c810 by Richard Hirst [richard@sleepie.demon.co.uk]
  6. ;
  7. ; I have left the script for the 53c8xx family in here, as it is likely
  8. ; to be useful to see what I changed when bug hunting.
  9. ; NCR 53c810 driver, main script
  10. ; Sponsored by
  11. ; iX Multiuser Multitasking Magazine
  12. ; hm@ix.de
  13. ;
  14. ; Copyright 1993, 1994, 1995 Drew Eckhardt
  15. ; Visionary Computing
  16. ; (Unix and Linux consulting and custom programming)
  17. ; drew@PoohSticks.ORG
  18. ; +1 (303) 786-7975
  19. ;
  20. ; TolerANT and SCSI SCRIPTS are registered trademarks of NCR Corporation.
  21. ;
  22. ; PRE-ALPHA
  23. ;
  24. ; For more information, please consult
  25. ;
  26. ; NCR 53C810
  27. ; PCI-SCSI I/O Processor
  28. ; Data Manual
  29. ;
  30. ; NCR 53C710
  31. ; SCSI I/O Processor
  32. ; Programmers Guide
  33. ;
  34. ; NCR Microelectronics
  35. ; 1635 Aeroplaza Drive
  36. ; Colorado Springs, CO 80916
  37. ; 1+ (719) 578-3400
  38. ;
  39. ; Toll free literature number
  40. ; +1 (800) 334-5454
  41. ;
  42. ; IMPORTANT : This code is self modifying due to the limitations of
  43. ; the NCR53c7,8xx series chips. Persons debugging this code with
  44. ; the remote debugger should take this into account, and NOT set
  45. ; breakpoints in modified instructions.
  46. ;
  47. ; Design:
  48. ; The NCR53c7,8xx family of SCSI chips are busmasters with an onboard
  49. ; microcontroller using a simple instruction set.
  50. ;
  51. ; So, to minimize the effects of interrupt latency, and to maximize
  52. ; throughput, this driver offloads the practical maximum amount
  53. ; of processing to the SCSI chip while still maintaining a common
  54. ; structure.
  55. ;
  56. ; Where tradeoffs were needed between efficiency on the older
  57. ; chips and the newer NCR53c800 series, the NCR53c800 series
  58. ; was chosen.
  59. ;
  60. ; While the NCR53c700 and NCR53c700-66 lacked the facilities to fully
  61. ; automate SCSI transfers without host processor intervention, this
  62. ; isn't the case with the NCR53c710 and newer chips which allow
  63. ;
  64. ; - reads and writes to the internal registers from within the SCSI
  65. ; scripts, allowing the SCSI SCRIPTS(tm) code to save processor
  66. ; state so that multiple threads of execution are possible, and also
  67. ; provide an ALU for loop control, etc.
  68. ;
  69. ; - table indirect addressing for some instructions. This allows
  70. ; pointers to be located relative to the DSA ((Data Structure
  71. ; Address) register.
  72. ;
  73. ; These features make it possible to implement a mailbox style interface,
  74. ; where the same piece of code is run to handle I/O for multiple threads
  75. ; at once minimizing our need to relocate code. Since the NCR53c700/
  76. ; NCR53c800 series have a unique combination of features, making a
  77. ; a standard ingoing/outgoing mailbox system, costly, I've modified it.
  78. ;
  79. ; - Mailboxes are a mixture of code and data. This lets us greatly
  80. ; simplify the NCR53c810 code and do things that would otherwise
  81. ; not be possible.
  82. ;
  83. ; The saved data pointer is now implemented as follows :
  84. ;
  85. ; Control flow has been architected such that if control reaches
  86. ; munge_save_data_pointer, on a restore pointers message or
  87. ; reconnection, a jump to the address formerly in the TEMP register
  88. ; will allow the SCSI command to resume execution.
  89. ;
  90. ;
  91. ; Note : the DSA structures must be aligned on 32 bit boundaries,
  92. ; since the source and destination of MOVE MEMORY instructions
  93. ; must share the same alignment and this is the alignment of the
  94. ; NCR registers.
  95. ;
  96. ; For some systems (MVME166, for example) dmode is always the same, so don't
  97. ; waste time writing it
  98. ABSOLUTE dsa_temp_lun = 0 ; Patch to lun for current dsa
  99. ABSOLUTE dsa_temp_next = 0 ; Patch to dsa next for current dsa
  100. ABSOLUTE dsa_temp_addr_next = 0 ; Patch to address of dsa next address
  101. ; for current dsa
  102. ABSOLUTE dsa_temp_sync = 0 ; Patch to address of per-target
  103. ; sync routine
  104. ABSOLUTE dsa_sscf_710 = 0 ; Patch to address of per-target
  105. ; sscf value (53c710)
  106. ABSOLUTE dsa_temp_target = 0 ; Patch to id for current dsa
  107. ABSOLUTE dsa_temp_addr_saved_pointer = 0; Patch to address of per-command
  108. ; saved data pointer
  109. ABSOLUTE dsa_temp_addr_residual = 0 ; Patch to address of per-command
  110. ; current residual code
  111. ABSOLUTE dsa_temp_addr_saved_residual = 0; Patch to address of per-command
  112. ; saved residual code
  113. ABSOLUTE dsa_temp_addr_new_value = 0 ; Address of value for JUMP operand
  114. ABSOLUTE dsa_temp_addr_array_value = 0 ; Address to copy to
  115. ABSOLUTE dsa_temp_addr_dsa_value = 0 ; Address of this DSA value
  116. ;
  117. ; Once a device has initiated reselection, we need to compare it
  118. ; against the singly linked list of commands which have disconnected
  119. ; and are pending reselection. These commands are maintained in
  120. ; an unordered singly linked list of DSA structures, through the
  121. ; DSA pointers at their 'centers' headed by the reconnect_dsa_head
  122. ; pointer.
  123. ;
  124. ; To avoid complications in removing commands from the list,
  125. ; I minimize the amount of expensive (at eight operations per
  126. ; addition @ 500-600ns each) pointer operations which must
  127. ; be done in the NCR driver by precomputing them on the
  128. ; host processor during dsa structure generation.
  129. ;
  130. ; The fixed-up per DSA code knows how to recognize the nexus
  131. ; associated with the corresponding SCSI command, and modifies
  132. ; the source and destination pointers for the MOVE MEMORY
  133. ; instruction which is executed when reselected_ok is called
  134. ; to remove the command from the list. Similarly, DSA is
  135. ; loaded with the address of the next DSA structure and
  136. ; reselected_check_next is called if a failure occurs.
  137. ;
  138. ; Perhaps more concisely, the net effect of the mess is
  139. ;
  140. ; for (dsa = reconnect_dsa_head, dest = &reconnect_dsa_head,
  141. ; src = NULL; dsa; dest = &dsa->next, dsa = dsa->next) {
  142. ; src = &dsa->next;
  143. ; if (target_id == dsa->id && target_lun == dsa->lun) {
  144. ; *dest = *src;
  145. ; break;
  146. ; }
  147. ; }
  148. ;
  149. ; if (!dsa)
  150. ; error (int_err_unexpected_reselect);
  151. ; else
  152. ; longjmp (dsa->jump_resume, 0);
  153. ;
  154. ;
  155. ; Define DSA structure used for mailboxes
  156. ENTRY dsa_code_template
  157. dsa_code_template:
  158. ENTRY dsa_code_begin
  159. dsa_code_begin:
  160. ; RGH: Don't care about TEMP and DSA here
  161. MOVE MEMORY 4, dsa_temp_addr_dsa_value, addr_scratch
  162. at 0x00000000 : */ 0xc0000004,0x00000000,0x00000000,
  163. /*
  164. MOVE MEMORY 4, addr_scratch, saved_dsa
  165. at 0x00000003 : */ 0xc0000004,0x00000000,0x00000000,
  166. /*
  167. ; We are about to go and select the device, so must set SSCF bits
  168. MOVE MEMORY 4, dsa_sscf_710, addr_scratch
  169. at 0x00000006 : */ 0xc0000004,0x00000000,0x00000000,
  170. /*
  171. MOVE SCRATCH3 TO SFBR
  172. at 0x00000009 : */ 0x72370000,0x00000000,
  173. /*
  174. MOVE SFBR TO SBCL
  175. at 0x0000000b : */ 0x6a0b0000,0x00000000,
  176. /*
  177. MOVE MEMORY 4, saved_dsa, addr_dsa
  178. at 0x0000000d : */ 0xc0000004,0x00000000,0x00000000,
  179. /*
  180. CALL select
  181. at 0x00000010 : */ 0x88080000,0x000001f8,
  182. /*
  183. ; Handle the phase mismatch which may have resulted from the
  184. ; MOVE FROM dsa_msgout if we returned here. The CLEAR ATN
  185. ; may or may not be necessary, and we should update script_asm.pl
  186. ; to handle multiple pieces.
  187. CLEAR ATN
  188. at 0x00000012 : */ 0x60000008,0x00000000,
  189. /*
  190. CLEAR ACK
  191. at 0x00000014 : */ 0x60000040,0x00000000,
  192. /*
  193. ; Replace second operand with address of JUMP instruction dest operand
  194. ; in schedule table for this DSA. Becomes dsa_jump_dest in 53c7,8xx.c.
  195. ENTRY dsa_code_fix_jump
  196. dsa_code_fix_jump:
  197. MOVE MEMORY 4, NOP_insn, 0
  198. at 0x00000016 : */ 0xc0000004,0x00000000,0x00000000,
  199. /*
  200. JUMP select_done
  201. at 0x00000019 : */ 0x80080000,0x00000230,
  202. /*
  203. ; wrong_dsa loads the DSA register with the value of the dsa_next
  204. ; field.
  205. ;
  206. wrong_dsa:
  207. ; NOTE DSA is corrupt when we arrive here!
  208. ; Patch the MOVE MEMORY INSTRUCTION such that
  209. ; the destination address is the address of the OLD
  210. ; next pointer.
  211. ;
  212. MOVE MEMORY 4, dsa_temp_addr_next, reselected_ok_patch + 8
  213. at 0x0000001b : */ 0xc0000004,0x00000000,0x000007ec,
  214. /*
  215. ;
  216. ; Move the _contents_ of the next pointer into the DSA register as
  217. ; the next I_T_L or I_T_L_Q tupple to check against the established
  218. ; nexus.
  219. ;
  220. MOVE MEMORY 4, dsa_temp_next, addr_scratch
  221. at 0x0000001e : */ 0xc0000004,0x00000000,0x00000000,
  222. /*
  223. MOVE MEMORY 4, addr_scratch, saved_dsa
  224. at 0x00000021 : */ 0xc0000004,0x00000000,0x00000000,
  225. /*
  226. MOVE MEMORY 4, saved_dsa, addr_dsa
  227. at 0x00000024 : */ 0xc0000004,0x00000000,0x00000000,
  228. /*
  229. JUMP reselected_check_next
  230. at 0x00000027 : */ 0x80080000,0x000006f0,
  231. /*
  232. ABSOLUTE dsa_save_data_pointer = 0
  233. ENTRY dsa_code_save_data_pointer
  234. dsa_code_save_data_pointer:
  235. ; When we get here, TEMP has been saved in jump_temp+4, DSA is corrupt
  236. ; We MUST return with DSA correct
  237. MOVE MEMORY 4, jump_temp+4, dsa_temp_addr_saved_pointer
  238. at 0x00000029 : */ 0xc0000004,0x000009c8,0x00000000,
  239. /*
  240. ; HARD CODED : 24 bytes needs to agree with 53c7,8xx.h
  241. MOVE MEMORY 24, dsa_temp_addr_residual, dsa_temp_addr_saved_residual
  242. at 0x0000002c : */ 0xc0000018,0x00000000,0x00000000,
  243. /*
  244. CLEAR ACK
  245. at 0x0000002f : */ 0x60000040,0x00000000,
  246. /*
  247. MOVE MEMORY 4, saved_dsa, addr_dsa
  248. at 0x00000031 : */ 0xc0000004,0x00000000,0x00000000,
  249. /*
  250. JUMP jump_temp
  251. at 0x00000034 : */ 0x80080000,0x000009c4,
  252. /*
  253. ABSOLUTE dsa_restore_pointers = 0
  254. ENTRY dsa_code_restore_pointers
  255. dsa_code_restore_pointers:
  256. ; TEMP and DSA are corrupt when we get here, but who cares!
  257. MOVE MEMORY 4, dsa_temp_addr_saved_pointer, jump_temp + 4
  258. at 0x00000036 : */ 0xc0000004,0x00000000,0x000009c8,
  259. /*
  260. ; HARD CODED : 24 bytes needs to agree with 53c7,8xx.h
  261. MOVE MEMORY 24, dsa_temp_addr_saved_residual, dsa_temp_addr_residual
  262. at 0x00000039 : */ 0xc0000018,0x00000000,0x00000000,
  263. /*
  264. CLEAR ACK
  265. at 0x0000003c : */ 0x60000040,0x00000000,
  266. /*
  267. ; Restore DSA, note we don't care about TEMP
  268. MOVE MEMORY 4, saved_dsa, addr_dsa
  269. at 0x0000003e : */ 0xc0000004,0x00000000,0x00000000,
  270. /*
  271. JUMP jump_temp
  272. at 0x00000041 : */ 0x80080000,0x000009c4,
  273. /*
  274. ABSOLUTE dsa_check_reselect = 0
  275. ; dsa_check_reselect determines whether or not the current target and
  276. ; lun match the current DSA
  277. ENTRY dsa_code_check_reselect
  278. dsa_code_check_reselect:
  279. MOVE LCRC TO SFBR ; LCRC has our ID and his ID bits set
  280. at 0x00000043 : */ 0x72230000,0x00000000,
  281. /*
  282. JUMP REL (wrong_dsa), IF NOT dsa_temp_target, AND MASK 0x80
  283. at 0x00000045 : */ 0x80848000,0x00ffff50,
  284. /*
  285. ;
  286. ; Hack - move to scratch first, since SFBR is not writeable
  287. ; via the CPU and hence a MOVE MEMORY instruction.
  288. ;
  289. MOVE MEMORY 1, reselected_identify, addr_scratch
  290. at 0x00000047 : */ 0xc0000001,0x00000000,0x00000000,
  291. /*
  292. ; BIG ENDIAN ON MVME16x
  293. MOVE SCRATCH3 TO SFBR
  294. at 0x0000004a : */ 0x72370000,0x00000000,
  295. /*
  296. ; FIXME : we need to accommodate bit fielded and binary here for '7xx/'8xx chips
  297. ; Are you sure about that? richard@sleepie.demon.co.uk
  298. JUMP REL (wrong_dsa), IF NOT dsa_temp_lun, AND MASK 0xf8
  299. at 0x0000004c : */ 0x8084f800,0x00ffff34,
  300. /*
  301. ; Patch the MOVE MEMORY INSTRUCTION such that
  302. ; the source address is the address of this dsa's
  303. ; next pointer.
  304. MOVE MEMORY 4, dsa_temp_addr_next, reselected_ok_patch + 4
  305. at 0x0000004e : */ 0xc0000004,0x00000000,0x000007e8,
  306. /*
  307. CALL reselected_ok
  308. at 0x00000051 : */ 0x88080000,0x00000798,
  309. /*
  310. ; Restore DSA following memory moves in reselected_ok
  311. ; dsa_temp_sync doesn't really care about DSA, but it has an
  312. ; optional debug INT so a valid DSA is a good idea.
  313. MOVE MEMORY 4, saved_dsa, addr_dsa
  314. at 0x00000053 : */ 0xc0000004,0x00000000,0x00000000,
  315. /*
  316. CALL dsa_temp_sync
  317. at 0x00000056 : */ 0x88080000,0x00000000,
  318. /*
  319. ; Release ACK on the IDENTIFY message _after_ we've set the synchronous
  320. ; transfer parameters!
  321. CLEAR ACK
  322. at 0x00000058 : */ 0x60000040,0x00000000,
  323. /*
  324. ; Implicitly restore pointers on reselection, so a RETURN
  325. ; will transfer control back to the right spot.
  326. CALL REL (dsa_code_restore_pointers)
  327. at 0x0000005a : */ 0x88880000,0x00ffff68,
  328. /*
  329. RETURN
  330. at 0x0000005c : */ 0x90080000,0x00000000,
  331. /*
  332. ENTRY dsa_zero
  333. dsa_zero:
  334. ENTRY dsa_code_template_end
  335. dsa_code_template_end:
  336. ; Perform sanity check for dsa_fields_start == dsa_code_template_end -
  337. ; dsa_zero, puke.
  338. ABSOLUTE dsa_fields_start = 0 ; Sanity marker
  339. ; pad 48 bytes (fix this RSN)
  340. ABSOLUTE dsa_next = 48 ; len 4 Next DSA
  341. ; del 4 Previous DSA address
  342. ABSOLUTE dsa_cmnd = 56 ; len 4 Scsi_Cmnd * for this thread.
  343. ABSOLUTE dsa_select = 60 ; len 4 Device ID, Period, Offset for
  344. ; table indirect select
  345. ABSOLUTE dsa_msgout = 64 ; len 8 table indirect move parameter for
  346. ; select message
  347. ABSOLUTE dsa_cmdout = 72 ; len 8 table indirect move parameter for
  348. ; command
  349. ABSOLUTE dsa_dataout = 80 ; len 4 code pointer for dataout
  350. ABSOLUTE dsa_datain = 84 ; len 4 code pointer for datain
  351. ABSOLUTE dsa_msgin = 88 ; len 8 table indirect move for msgin
  352. ABSOLUTE dsa_status = 96 ; len 8 table indirect move for status byte
  353. ABSOLUTE dsa_msgout_other = 104 ; len 8 table indirect for normal message out
  354. ; (Synchronous transfer negotiation, etc).
  355. ABSOLUTE dsa_end = 112
  356. ABSOLUTE schedule = 0 ; Array of JUMP dsa_begin or JUMP (next),
  357. ; terminated by a call to JUMP wait_reselect
  358. ; Linked lists of DSA structures
  359. ABSOLUTE reconnect_dsa_head = 0 ; Link list of DSAs which can reconnect
  360. ABSOLUTE addr_reconnect_dsa_head = 0 ; Address of variable containing
  361. ; address of reconnect_dsa_head
  362. ; These select the source and destination of a MOVE MEMORY instruction
  363. ABSOLUTE dmode_memory_to_memory = 0x0
  364. ABSOLUTE dmode_memory_to_ncr = 0x0
  365. ABSOLUTE dmode_ncr_to_memory = 0x0
  366. ABSOLUTE addr_scratch = 0x0
  367. ABSOLUTE addr_temp = 0x0
  368. ABSOLUTE saved_dsa = 0x0
  369. ABSOLUTE emulfly = 0x0
  370. ABSOLUTE addr_dsa = 0x0
  371. ; Interrupts -
  372. ; MSB indicates type
  373. ; 0 handle error condition
  374. ; 1 handle message
  375. ; 2 handle normal condition
  376. ; 3 debugging interrupt
  377. ; 4 testing interrupt
  378. ; Next byte indicates specific error
  379. ; XXX not yet implemented, I'm not sure if I want to -
  380. ; Next byte indicates the routine the error occurred in
  381. ; The LSB indicates the specific place the error occurred
  382. ABSOLUTE int_err_unexpected_phase = 0x00000000 ; Unexpected phase encountered
  383. ABSOLUTE int_err_selected = 0x00010000 ; SELECTED (nee RESELECTED)
  384. ABSOLUTE int_err_unexpected_reselect = 0x00020000
  385. ABSOLUTE int_err_check_condition = 0x00030000
  386. ABSOLUTE int_err_no_phase = 0x00040000
  387. ABSOLUTE int_msg_wdtr = 0x01000000 ; WDTR message received
  388. ABSOLUTE int_msg_sdtr = 0x01010000 ; SDTR received
  389. ABSOLUTE int_msg_1 = 0x01020000 ; single byte special message
  390. ; received
  391. ABSOLUTE int_norm_select_complete = 0x02000000 ; Select complete, reprogram
  392. ; registers.
  393. ABSOLUTE int_norm_reselect_complete = 0x02010000 ; Nexus established
  394. ABSOLUTE int_norm_command_complete = 0x02020000 ; Command complete
  395. ABSOLUTE int_norm_disconnected = 0x02030000 ; Disconnected
  396. ABSOLUTE int_norm_aborted =0x02040000 ; Aborted *dsa
  397. ABSOLUTE int_norm_reset = 0x02050000 ; Generated BUS reset.
  398. ABSOLUTE int_norm_emulateintfly = 0x02060000 ; 53C710 Emulated intfly
  399. ABSOLUTE int_debug_break = 0x03000000 ; Break point
  400. ABSOLUTE int_debug_panic = 0x030b0000 ; Panic driver
  401. ABSOLUTE int_test_1 = 0x04000000 ; Test 1 complete
  402. ABSOLUTE int_test_2 = 0x04010000 ; Test 2 complete
  403. ABSOLUTE int_test_3 = 0x04020000 ; Test 3 complete
  404. ; These should start with 0x05000000, with low bits incrementing for
  405. ; each one.
  406. ABSOLUTE NCR53c7xx_msg_abort = 0 ; Pointer to abort message
  407. ABSOLUTE NCR53c7xx_msg_reject = 0 ; Pointer to reject message
  408. ABSOLUTE NCR53c7xx_zero = 0 ; long with zero in it, use for source
  409. ABSOLUTE NCR53c7xx_sink = 0 ; long to dump worthless data in
  410. ABSOLUTE NOP_insn = 0 ; NOP instruction
  411. ; Pointer to message, potentially multi-byte
  412. ABSOLUTE msg_buf = 0
  413. ; Pointer to holding area for reselection information
  414. ABSOLUTE reselected_identify = 0
  415. ABSOLUTE reselected_tag = 0
  416. ; Request sense command pointer, it's a 6 byte command, should
  417. ; be constant for all commands since we always want 16 bytes of
  418. ; sense and we don't need to change any fields as we did under
  419. ; SCSI-I when we actually cared about the LUN field.
  420. ;EXTERNAL NCR53c7xx_sense ; Request sense command
  421. ; dsa_schedule
  422. ; PURPOSE : after a DISCONNECT message has been received, and pointers
  423. ; saved, insert the current DSA structure at the head of the
  424. ; disconnected queue and fall through to the scheduler.
  425. ;
  426. ; CALLS : OK
  427. ;
  428. ; INPUTS : dsa - current DSA structure, reconnect_dsa_head - list
  429. ; of disconnected commands
  430. ;
  431. ; MODIFIES : SCRATCH, reconnect_dsa_head
  432. ;
  433. ; EXITS : always passes control to schedule
  434. ENTRY dsa_schedule
  435. dsa_schedule:
  436. ;
  437. ; Calculate the address of the next pointer within the DSA
  438. ; structure of the command that is currently disconnecting
  439. ;
  440. ; Read what should be the current DSA from memory - actual DSA
  441. ; register is probably corrupt
  442. MOVE MEMORY 4, saved_dsa, addr_scratch
  443. at 0x0000005e : */ 0xc0000004,0x00000000,0x00000000,
  444. /*
  445. MOVE SCRATCH0 + dsa_next TO SCRATCH0
  446. at 0x00000061 : */ 0x7e343000,0x00000000,
  447. /*
  448. MOVE SCRATCH1 + 0 TO SCRATCH1 WITH CARRY
  449. at 0x00000063 : */ 0x7f350000,0x00000000,
  450. /*
  451. MOVE SCRATCH2 + 0 TO SCRATCH2 WITH CARRY
  452. at 0x00000065 : */ 0x7f360000,0x00000000,
  453. /*
  454. MOVE SCRATCH3 + 0 TO SCRATCH3 WITH CARRY
  455. at 0x00000067 : */ 0x7f370000,0x00000000,
  456. /*
  457. ; Point the next field of this DSA structure at the current disconnected
  458. ; list
  459. MOVE MEMORY 4, addr_scratch, dsa_schedule_insert + 8
  460. at 0x00000069 : */ 0xc0000004,0x00000000,0x000001b8,
  461. /*
  462. dsa_schedule_insert:
  463. MOVE MEMORY 4, reconnect_dsa_head, 0
  464. at 0x0000006c : */ 0xc0000004,0x00000000,0x00000000,
  465. /*
  466. ; And update the head pointer.
  467. ; Read what should be the current DSA from memory - actual DSA
  468. ; register is probably corrupt
  469. MOVE MEMORY 4, saved_dsa, addr_scratch
  470. at 0x0000006f : */ 0xc0000004,0x00000000,0x00000000,
  471. /*
  472. MOVE MEMORY 4, addr_scratch, reconnect_dsa_head
  473. at 0x00000072 : */ 0xc0000004,0x00000000,0x00000000,
  474. /*
  475. CLEAR ACK
  476. at 0x00000075 : */ 0x60000040,0x00000000,
  477. /*
  478. ; Time to correct DSA following memory move
  479. MOVE MEMORY 4, saved_dsa, addr_dsa
  480. at 0x00000077 : */ 0xc0000004,0x00000000,0x00000000,
  481. /*
  482. WAIT DISCONNECT
  483. at 0x0000007a : */ 0x48000000,0x00000000,
  484. /*
  485. JUMP schedule
  486. at 0x0000007c : */ 0x80080000,0x00000000,
  487. /*
  488. ;
  489. ; select
  490. ;
  491. ; PURPOSE : establish a nexus for the SCSI command referenced by DSA.
  492. ; On success, the current DSA structure is removed from the issue
  493. ; queue. Usually, this is entered as a fall-through from schedule,
  494. ; although the contingent allegiance handling code will write
  495. ; the select entry address to the DSP to restart a command as a
  496. ; REQUEST SENSE. A message is sent (usually IDENTIFY, although
  497. ; additional SDTR or WDTR messages may be sent). COMMAND OUT
  498. ; is handled.
  499. ;
  500. ; INPUTS : DSA - SCSI command, issue_dsa_head
  501. ;
  502. ; CALLS : NOT OK
  503. ;
  504. ; MODIFIES : SCRATCH, issue_dsa_head
  505. ;
  506. ; EXITS : on reselection or selection, go to select_failed
  507. ; otherwise, RETURN so control is passed back to
  508. ; dsa_begin.
  509. ;
  510. ENTRY select
  511. select:
  512. CLEAR TARGET
  513. at 0x0000007e : */ 0x60000200,0x00000000,
  514. /*
  515. ; XXX
  516. ;
  517. ; In effect, SELECTION operations are backgrounded, with execution
  518. ; continuing until code which waits for REQ or a fatal interrupt is
  519. ; encountered.
  520. ;
  521. ; So, for more performance, we could overlap the code which removes
  522. ; the command from the NCRs issue queue with the selection, but
  523. ; at this point I don't want to deal with the error recovery.
  524. ;
  525. ; Enable selection timer
  526. MOVE CTEST7 & 0xef TO CTEST7
  527. at 0x00000080 : */ 0x7c1bef00,0x00000000,
  528. /*
  529. SELECT ATN FROM dsa_select, select_failed
  530. at 0x00000082 : */ 0x4300003c,0x00000828,
  531. /*
  532. JUMP select_msgout, WHEN MSG_OUT
  533. at 0x00000084 : */ 0x860b0000,0x00000218,
  534. /*
  535. ENTRY select_msgout
  536. select_msgout:
  537. ; Disable selection timer
  538. MOVE CTEST7 | 0x10 TO CTEST7
  539. at 0x00000086 : */ 0x7a1b1000,0x00000000,
  540. /*
  541. MOVE FROM dsa_msgout, WHEN MSG_OUT
  542. at 0x00000088 : */ 0x1e000000,0x00000040,
  543. /*
  544. RETURN
  545. at 0x0000008a : */ 0x90080000,0x00000000,
  546. /*
  547. ;
  548. ; select_done
  549. ;
  550. ; PURPOSE: continue on to normal data transfer; called as the exit
  551. ; point from dsa_begin.
  552. ;
  553. ; INPUTS: dsa
  554. ;
  555. ; CALLS: OK
  556. ;
  557. ;
  558. select_done:
  559. ; NOTE DSA is corrupt when we arrive here!
  560. MOVE MEMORY 4, saved_dsa, addr_dsa
  561. at 0x0000008c : */ 0xc0000004,0x00000000,0x00000000,
  562. /*
  563. ; After a successful selection, we should get either a CMD phase or
  564. ; some transfer request negotiation message.
  565. JUMP cmdout, WHEN CMD
  566. at 0x0000008f : */ 0x820b0000,0x0000025c,
  567. /*
  568. INT int_err_unexpected_phase, WHEN NOT MSG_IN
  569. at 0x00000091 : */ 0x9f030000,0x00000000,
  570. /*
  571. select_msg_in:
  572. CALL msg_in, WHEN MSG_IN
  573. at 0x00000093 : */ 0x8f0b0000,0x0000041c,
  574. /*
  575. JUMP select_msg_in, WHEN MSG_IN
  576. at 0x00000095 : */ 0x870b0000,0x0000024c,
  577. /*
  578. cmdout:
  579. INT int_err_unexpected_phase, WHEN NOT CMD
  580. at 0x00000097 : */ 0x9a030000,0x00000000,
  581. /*
  582. ENTRY cmdout_cmdout
  583. cmdout_cmdout:
  584. MOVE FROM dsa_cmdout, WHEN CMD
  585. at 0x00000099 : */ 0x1a000000,0x00000048,
  586. /*
  587. ;
  588. ; data_transfer
  589. ; other_out
  590. ; other_in
  591. ; other_transfer
  592. ;
  593. ; PURPOSE : handle the main data transfer for a SCSI command in
  594. ; several parts. In the first part, data_transfer, DATA_IN
  595. ; and DATA_OUT phases are allowed, with the user provided
  596. ; code (usually dynamically generated based on the scatter/gather
  597. ; list associated with a SCSI command) called to handle these
  598. ; phases.
  599. ;
  600. ; After control has passed to one of the user provided
  601. ; DATA_IN or DATA_OUT routines, back calls are made to
  602. ; other_transfer_in or other_transfer_out to handle non-DATA IN
  603. ; and DATA OUT phases respectively, with the state of the active
  604. ; data pointer being preserved in TEMP.
  605. ;
  606. ; On completion, the user code passes control to other_transfer
  607. ; which causes DATA_IN and DATA_OUT to result in unexpected_phase
  608. ; interrupts so that data overruns may be trapped.
  609. ;
  610. ; INPUTS : DSA - SCSI command
  611. ;
  612. ; CALLS : OK in data_transfer_start, not ok in other_out and other_in, ok in
  613. ; other_transfer
  614. ;
  615. ; MODIFIES : SCRATCH
  616. ;
  617. ; EXITS : if STATUS IN is detected, signifying command completion,
  618. ; the NCR jumps to command_complete. If MSG IN occurs, a
  619. ; CALL is made to msg_in. Otherwise, other_transfer runs in
  620. ; an infinite loop.
  621. ;
  622. ENTRY data_transfer
  623. data_transfer:
  624. JUMP cmdout_cmdout, WHEN CMD
  625. at 0x0000009b : */ 0x820b0000,0x00000264,
  626. /*
  627. CALL msg_in, WHEN MSG_IN
  628. at 0x0000009d : */ 0x8f0b0000,0x0000041c,
  629. /*
  630. INT int_err_unexpected_phase, WHEN MSG_OUT
  631. at 0x0000009f : */ 0x9e0b0000,0x00000000,
  632. /*
  633. JUMP do_dataout, WHEN DATA_OUT
  634. at 0x000000a1 : */ 0x800b0000,0x000002a4,
  635. /*
  636. JUMP do_datain, WHEN DATA_IN
  637. at 0x000000a3 : */ 0x810b0000,0x000002fc,
  638. /*
  639. JUMP command_complete, WHEN STATUS
  640. at 0x000000a5 : */ 0x830b0000,0x0000065c,
  641. /*
  642. JUMP data_transfer
  643. at 0x000000a7 : */ 0x80080000,0x0000026c,
  644. /*
  645. ENTRY end_data_transfer
  646. end_data_transfer:
  647. ;
  648. ; FIXME: On NCR53c700 and NCR53c700-66 chips, do_dataout/do_datain
  649. ; should be fixed up whenever the nexus changes so it can point to the
  650. ; correct routine for that command.
  651. ;
  652. ; Nasty jump to dsa->dataout
  653. do_dataout:
  654. MOVE MEMORY 4, saved_dsa, addr_scratch
  655. at 0x000000a9 : */ 0xc0000004,0x00000000,0x00000000,
  656. /*
  657. MOVE SCRATCH0 + dsa_dataout TO SCRATCH0
  658. at 0x000000ac : */ 0x7e345000,0x00000000,
  659. /*
  660. MOVE SCRATCH1 + 0 TO SCRATCH1 WITH CARRY
  661. at 0x000000ae : */ 0x7f350000,0x00000000,
  662. /*
  663. MOVE SCRATCH2 + 0 TO SCRATCH2 WITH CARRY
  664. at 0x000000b0 : */ 0x7f360000,0x00000000,
  665. /*
  666. MOVE SCRATCH3 + 0 TO SCRATCH3 WITH CARRY
  667. at 0x000000b2 : */ 0x7f370000,0x00000000,
  668. /*
  669. MOVE MEMORY 4, addr_scratch, dataout_to_jump + 4
  670. at 0x000000b4 : */ 0xc0000004,0x00000000,0x000002e0,
  671. /*
  672. dataout_to_jump:
  673. MOVE MEMORY 4, 0, dataout_jump + 4
  674. at 0x000000b7 : */ 0xc0000004,0x00000000,0x000002f8,
  675. /*
  676. ; Time to correct DSA following memory move
  677. MOVE MEMORY 4, saved_dsa, addr_dsa
  678. at 0x000000ba : */ 0xc0000004,0x00000000,0x00000000,
  679. /*
  680. dataout_jump:
  681. JUMP 0
  682. at 0x000000bd : */ 0x80080000,0x00000000,
  683. /*
  684. ; Nasty jump to dsa->dsain
  685. do_datain:
  686. MOVE MEMORY 4, saved_dsa, addr_scratch
  687. at 0x000000bf : */ 0xc0000004,0x00000000,0x00000000,
  688. /*
  689. MOVE SCRATCH0 + dsa_datain TO SCRATCH0
  690. at 0x000000c2 : */ 0x7e345400,0x00000000,
  691. /*
  692. MOVE SCRATCH1 + 0 TO SCRATCH1 WITH CARRY
  693. at 0x000000c4 : */ 0x7f350000,0x00000000,
  694. /*
  695. MOVE SCRATCH2 + 0 TO SCRATCH2 WITH CARRY
  696. at 0x000000c6 : */ 0x7f360000,0x00000000,
  697. /*
  698. MOVE SCRATCH3 + 0 TO SCRATCH3 WITH CARRY
  699. at 0x000000c8 : */ 0x7f370000,0x00000000,
  700. /*
  701. MOVE MEMORY 4, addr_scratch, datain_to_jump + 4
  702. at 0x000000ca : */ 0xc0000004,0x00000000,0x00000338,
  703. /*
  704. ENTRY datain_to_jump
  705. datain_to_jump:
  706. MOVE MEMORY 4, 0, datain_jump + 4
  707. at 0x000000cd : */ 0xc0000004,0x00000000,0x00000350,
  708. /*
  709. ; Time to correct DSA following memory move
  710. MOVE MEMORY 4, saved_dsa, addr_dsa
  711. at 0x000000d0 : */ 0xc0000004,0x00000000,0x00000000,
  712. /*
  713. datain_jump:
  714. JUMP 0
  715. at 0x000000d3 : */ 0x80080000,0x00000000,
  716. /*
  717. ; Note that other_out and other_in loop until a non-data phase
  718. ; is discovered, so we only execute return statements when we
  719. ; can go on to the next data phase block move statement.
  720. ENTRY other_out
  721. other_out:
  722. INT int_err_unexpected_phase, WHEN CMD
  723. at 0x000000d5 : */ 0x9a0b0000,0x00000000,
  724. /*
  725. JUMP msg_in_restart, WHEN MSG_IN
  726. at 0x000000d7 : */ 0x870b0000,0x000003fc,
  727. /*
  728. INT int_err_unexpected_phase, WHEN MSG_OUT
  729. at 0x000000d9 : */ 0x9e0b0000,0x00000000,
  730. /*
  731. INT int_err_unexpected_phase, WHEN DATA_IN
  732. at 0x000000db : */ 0x990b0000,0x00000000,
  733. /*
  734. JUMP command_complete, WHEN STATUS
  735. at 0x000000dd : */ 0x830b0000,0x0000065c,
  736. /*
  737. JUMP other_out, WHEN NOT DATA_OUT
  738. at 0x000000df : */ 0x80030000,0x00000354,
  739. /*
  740. ; TEMP should be OK, as we got here from a call in the user dataout code.
  741. RETURN
  742. at 0x000000e1 : */ 0x90080000,0x00000000,
  743. /*
  744. ENTRY other_in
  745. other_in:
  746. INT int_err_unexpected_phase, WHEN CMD
  747. at 0x000000e3 : */ 0x9a0b0000,0x00000000,
  748. /*
  749. JUMP msg_in_restart, WHEN MSG_IN
  750. at 0x000000e5 : */ 0x870b0000,0x000003fc,
  751. /*
  752. INT int_err_unexpected_phase, WHEN MSG_OUT
  753. at 0x000000e7 : */ 0x9e0b0000,0x00000000,
  754. /*
  755. INT int_err_unexpected_phase, WHEN DATA_OUT
  756. at 0x000000e9 : */ 0x980b0000,0x00000000,
  757. /*
  758. JUMP command_complete, WHEN STATUS
  759. at 0x000000eb : */ 0x830b0000,0x0000065c,
  760. /*
  761. JUMP other_in, WHEN NOT DATA_IN
  762. at 0x000000ed : */ 0x81030000,0x0000038c,
  763. /*
  764. ; TEMP should be OK, as we got here from a call in the user datain code.
  765. RETURN
  766. at 0x000000ef : */ 0x90080000,0x00000000,
  767. /*
  768. ENTRY other_transfer
  769. other_transfer:
  770. INT int_err_unexpected_phase, WHEN CMD
  771. at 0x000000f1 : */ 0x9a0b0000,0x00000000,
  772. /*
  773. CALL msg_in, WHEN MSG_IN
  774. at 0x000000f3 : */ 0x8f0b0000,0x0000041c,
  775. /*
  776. INT int_err_unexpected_phase, WHEN MSG_OUT
  777. at 0x000000f5 : */ 0x9e0b0000,0x00000000,
  778. /*
  779. INT int_err_unexpected_phase, WHEN DATA_OUT
  780. at 0x000000f7 : */ 0x980b0000,0x00000000,
  781. /*
  782. INT int_err_unexpected_phase, WHEN DATA_IN
  783. at 0x000000f9 : */ 0x990b0000,0x00000000,
  784. /*
  785. JUMP command_complete, WHEN STATUS
  786. at 0x000000fb : */ 0x830b0000,0x0000065c,
  787. /*
  788. JUMP other_transfer
  789. at 0x000000fd : */ 0x80080000,0x000003c4,
  790. /*
  791. ;
  792. ; msg_in_restart
  793. ; msg_in
  794. ; munge_msg
  795. ;
  796. ; PURPOSE : process messages from a target. msg_in is called when the
  797. ; caller hasn't read the first byte of the message. munge_message
  798. ; is called when the caller has read the first byte of the message,
  799. ; and left it in SFBR. msg_in_restart is called when the caller
  800. ; hasn't read the first byte of the message, and wishes RETURN
  801. ; to transfer control back to the address of the conditional
  802. ; CALL instruction rather than to the instruction after it.
  803. ;
  804. ; Various int_* interrupts are generated when the host system
  805. ; needs to intervene, as is the case with SDTR, WDTR, and
  806. ; INITIATE RECOVERY messages.
  807. ;
  808. ; When the host system handles one of these interrupts,
  809. ; it can respond by reentering at reject_message,
  810. ; which rejects the message and returns control to
  811. ; the caller of msg_in or munge_msg, accept_message
  812. ; which clears ACK and returns control, or reply_message
  813. ; which sends the message pointed to by the DSA
  814. ; msgout_other table indirect field.
  815. ;
  816. ; DISCONNECT messages are handled by moving the command
  817. ; to the reconnect_dsa_queue.
  818. ; NOTE: DSA should be valid when we get here - we cannot save both it
  819. ; and TEMP in this routine.
  820. ;
  821. ; INPUTS : DSA - SCSI COMMAND, SFBR - first byte of message (munge_msg
  822. ; only)
  823. ;
  824. ; CALLS : NO. The TEMP register isn't backed up to allow nested calls.
  825. ;
  826. ; MODIFIES : SCRATCH, DSA on DISCONNECT
  827. ;
  828. ; EXITS : On receipt of SAVE DATA POINTER, RESTORE POINTERS,
  829. ; and normal return from message handlers running under
  830. ; Linux, control is returned to the caller. Receipt
  831. ; of DISCONNECT messages pass control to dsa_schedule.
  832. ;
  833. ENTRY msg_in_restart
  834. msg_in_restart:
  835. ; XXX - hackish
  836. ;
  837. ; Since it's easier to debug changes to the statically
  838. ; compiled code, rather than the dynamically generated
  839. ; stuff, such as
  840. ;
  841. ; MOVE x, y, WHEN data_phase
  842. ; CALL other_z, WHEN NOT data_phase
  843. ; MOVE x, y, WHEN data_phase
  844. ;
  845. ; I'd like to have certain routines (notably the message handler)
  846. ; restart on the conditional call rather than the next instruction.
  847. ;
  848. ; So, subtract 8 from the return address
  849. MOVE TEMP0 + 0xf8 TO TEMP0
  850. at 0x000000ff : */ 0x7e1cf800,0x00000000,
  851. /*
  852. MOVE TEMP1 + 0xff TO TEMP1 WITH CARRY
  853. at 0x00000101 : */ 0x7f1dff00,0x00000000,
  854. /*
  855. MOVE TEMP2 + 0xff TO TEMP2 WITH CARRY
  856. at 0x00000103 : */ 0x7f1eff00,0x00000000,
  857. /*
  858. MOVE TEMP3 + 0xff TO TEMP3 WITH CARRY
  859. at 0x00000105 : */ 0x7f1fff00,0x00000000,
  860. /*
  861. ENTRY msg_in
  862. msg_in:
  863. MOVE 1, msg_buf, WHEN MSG_IN
  864. at 0x00000107 : */ 0x0f000001,0x00000000,
  865. /*
  866. munge_msg:
  867. JUMP munge_extended, IF 0x01 ; EXTENDED MESSAGE
  868. at 0x00000109 : */ 0x800c0001,0x00000574,
  869. /*
  870. JUMP munge_2, IF 0x20, AND MASK 0xdf ; two byte message
  871. at 0x0000010b : */ 0x800cdf20,0x00000464,
  872. /*
  873. ;
  874. ; XXX - I've seen a handful of broken SCSI devices which fail to issue
  875. ; a SAVE POINTERS message before disconnecting in the middle of
  876. ; a transfer, assuming that the DATA POINTER will be implicitly
  877. ; restored.
  878. ;
  879. ; Historically, I've often done an implicit save when the DISCONNECT
  880. ; message is processed. We may want to consider having the option of
  881. ; doing that here.
  882. ;
  883. JUMP munge_save_data_pointer, IF 0x02 ; SAVE DATA POINTER
  884. at 0x0000010d : */ 0x800c0002,0x0000046c,
  885. /*
  886. JUMP munge_restore_pointers, IF 0x03 ; RESTORE POINTERS
  887. at 0x0000010f : */ 0x800c0003,0x00000518,
  888. /*
  889. JUMP munge_disconnect, IF 0x04 ; DISCONNECT
  890. at 0x00000111 : */ 0x800c0004,0x0000056c,
  891. /*
  892. INT int_msg_1, IF 0x07 ; MESSAGE REJECT
  893. at 0x00000113 : */ 0x980c0007,0x01020000,
  894. /*
  895. INT int_msg_1, IF 0x0f ; INITIATE RECOVERY
  896. at 0x00000115 : */ 0x980c000f,0x01020000,
  897. /*
  898. JUMP reject_message
  899. at 0x00000117 : */ 0x80080000,0x00000604,
  900. /*
  901. munge_2:
  902. JUMP reject_message
  903. at 0x00000119 : */ 0x80080000,0x00000604,
  904. /*
  905. ;
  906. ; The SCSI standard allows targets to recover from transient
  907. ; error conditions by backing up the data pointer with a
  908. ; RESTORE POINTERS message.
  909. ;
  910. ; So, we must save and restore the _residual_ code as well as
  911. ; the current instruction pointer. Because of this messiness,
  912. ; it is simpler to put dynamic code in the dsa for this and to
  913. ; just do a simple jump down there.
  914. ;
  915. munge_save_data_pointer:
  916. ; We have something in TEMP here, so first we must save that
  917. MOVE TEMP0 TO SFBR
  918. at 0x0000011b : */ 0x721c0000,0x00000000,
  919. /*
  920. MOVE SFBR TO SCRATCH0
  921. at 0x0000011d : */ 0x6a340000,0x00000000,
  922. /*
  923. MOVE TEMP1 TO SFBR
  924. at 0x0000011f : */ 0x721d0000,0x00000000,
  925. /*
  926. MOVE SFBR TO SCRATCH1
  927. at 0x00000121 : */ 0x6a350000,0x00000000,
  928. /*
  929. MOVE TEMP2 TO SFBR
  930. at 0x00000123 : */ 0x721e0000,0x00000000,
  931. /*
  932. MOVE SFBR TO SCRATCH2
  933. at 0x00000125 : */ 0x6a360000,0x00000000,
  934. /*
  935. MOVE TEMP3 TO SFBR
  936. at 0x00000127 : */ 0x721f0000,0x00000000,
  937. /*
  938. MOVE SFBR TO SCRATCH3
  939. at 0x00000129 : */ 0x6a370000,0x00000000,
  940. /*
  941. MOVE MEMORY 4, addr_scratch, jump_temp + 4
  942. at 0x0000012b : */ 0xc0000004,0x00000000,0x000009c8,
  943. /*
  944. ; Now restore DSA
  945. MOVE MEMORY 4, saved_dsa, addr_dsa
  946. at 0x0000012e : */ 0xc0000004,0x00000000,0x00000000,
  947. /*
  948. MOVE DSA0 + dsa_save_data_pointer TO SFBR
  949. at 0x00000131 : */ 0x76100000,0x00000000,
  950. /*
  951. MOVE SFBR TO SCRATCH0
  952. at 0x00000133 : */ 0x6a340000,0x00000000,
  953. /*
  954. MOVE DSA1 + 0xff TO SFBR WITH CARRY
  955. at 0x00000135 : */ 0x7711ff00,0x00000000,
  956. /*
  957. MOVE SFBR TO SCRATCH1
  958. at 0x00000137 : */ 0x6a350000,0x00000000,
  959. /*
  960. MOVE DSA2 + 0xff TO SFBR WITH CARRY
  961. at 0x00000139 : */ 0x7712ff00,0x00000000,
  962. /*
  963. MOVE SFBR TO SCRATCH2
  964. at 0x0000013b : */ 0x6a360000,0x00000000,
  965. /*
  966. MOVE DSA3 + 0xff TO SFBR WITH CARRY
  967. at 0x0000013d : */ 0x7713ff00,0x00000000,
  968. /*
  969. MOVE SFBR TO SCRATCH3
  970. at 0x0000013f : */ 0x6a370000,0x00000000,
  971. /*
  972. MOVE MEMORY 4, addr_scratch, jump_dsa_save + 4
  973. at 0x00000141 : */ 0xc0000004,0x00000000,0x00000514,
  974. /*
  975. jump_dsa_save:
  976. JUMP 0
  977. at 0x00000144 : */ 0x80080000,0x00000000,
  978. /*
  979. munge_restore_pointers:
  980. ; The code at dsa_restore_pointers will RETURN, but we don't care
  981. ; about TEMP here, as it will overwrite it anyway.
  982. MOVE DSA0 + dsa_restore_pointers TO SFBR
  983. at 0x00000146 : */ 0x76100000,0x00000000,
  984. /*
  985. MOVE SFBR TO SCRATCH0
  986. at 0x00000148 : */ 0x6a340000,0x00000000,
  987. /*
  988. MOVE DSA1 + 0xff TO SFBR WITH CARRY
  989. at 0x0000014a : */ 0x7711ff00,0x00000000,
  990. /*
  991. MOVE SFBR TO SCRATCH1
  992. at 0x0000014c : */ 0x6a350000,0x00000000,
  993. /*
  994. MOVE DSA2 + 0xff TO SFBR WITH CARRY
  995. at 0x0000014e : */ 0x7712ff00,0x00000000,
  996. /*
  997. MOVE SFBR TO SCRATCH2
  998. at 0x00000150 : */ 0x6a360000,0x00000000,
  999. /*
  1000. MOVE DSA3 + 0xff TO SFBR WITH CARRY
  1001. at 0x00000152 : */ 0x7713ff00,0x00000000,
  1002. /*
  1003. MOVE SFBR TO SCRATCH3
  1004. at 0x00000154 : */ 0x6a370000,0x00000000,
  1005. /*
  1006. MOVE MEMORY 4, addr_scratch, jump_dsa_restore + 4
  1007. at 0x00000156 : */ 0xc0000004,0x00000000,0x00000568,
  1008. /*
  1009. jump_dsa_restore:
  1010. JUMP 0
  1011. at 0x00000159 : */ 0x80080000,0x00000000,
  1012. /*
  1013. munge_disconnect:
  1014. JUMP dsa_schedule
  1015. at 0x0000015b : */ 0x80080000,0x00000178,
  1016. /*
  1017. munge_extended:
  1018. CLEAR ACK
  1019. at 0x0000015d : */ 0x60000040,0x00000000,
  1020. /*
  1021. INT int_err_unexpected_phase, WHEN NOT MSG_IN
  1022. at 0x0000015f : */ 0x9f030000,0x00000000,
  1023. /*
  1024. MOVE 1, msg_buf + 1, WHEN MSG_IN
  1025. at 0x00000161 : */ 0x0f000001,0x00000001,
  1026. /*
  1027. JUMP munge_extended_2, IF 0x02
  1028. at 0x00000163 : */ 0x800c0002,0x000005a4,
  1029. /*
  1030. JUMP munge_extended_3, IF 0x03
  1031. at 0x00000165 : */ 0x800c0003,0x000005d4,
  1032. /*
  1033. JUMP reject_message
  1034. at 0x00000167 : */ 0x80080000,0x00000604,
  1035. /*
  1036. munge_extended_2:
  1037. CLEAR ACK
  1038. at 0x00000169 : */ 0x60000040,0x00000000,
  1039. /*
  1040. MOVE 1, msg_buf + 2, WHEN MSG_IN
  1041. at 0x0000016b : */ 0x0f000001,0x00000002,
  1042. /*
  1043. JUMP reject_message, IF NOT 0x02 ; Must be WDTR
  1044. at 0x0000016d : */ 0x80040002,0x00000604,
  1045. /*
  1046. CLEAR ACK
  1047. at 0x0000016f : */ 0x60000040,0x00000000,
  1048. /*
  1049. MOVE 1, msg_buf + 3, WHEN MSG_IN
  1050. at 0x00000171 : */ 0x0f000001,0x00000003,
  1051. /*
  1052. INT int_msg_wdtr
  1053. at 0x00000173 : */ 0x98080000,0x01000000,
  1054. /*
  1055. munge_extended_3:
  1056. CLEAR ACK
  1057. at 0x00000175 : */ 0x60000040,0x00000000,
  1058. /*
  1059. MOVE 1, msg_buf + 2, WHEN MSG_IN
  1060. at 0x00000177 : */ 0x0f000001,0x00000002,
  1061. /*
  1062. JUMP reject_message, IF NOT 0x01 ; Must be SDTR
  1063. at 0x00000179 : */ 0x80040001,0x00000604,
  1064. /*
  1065. CLEAR ACK
  1066. at 0x0000017b : */ 0x60000040,0x00000000,
  1067. /*
  1068. MOVE 2, msg_buf + 3, WHEN MSG_IN
  1069. at 0x0000017d : */ 0x0f000002,0x00000003,
  1070. /*
  1071. INT int_msg_sdtr
  1072. at 0x0000017f : */ 0x98080000,0x01010000,
  1073. /*
  1074. ENTRY reject_message
  1075. reject_message:
  1076. SET ATN
  1077. at 0x00000181 : */ 0x58000008,0x00000000,
  1078. /*
  1079. CLEAR ACK
  1080. at 0x00000183 : */ 0x60000040,0x00000000,
  1081. /*
  1082. MOVE 1, NCR53c7xx_msg_reject, WHEN MSG_OUT
  1083. at 0x00000185 : */ 0x0e000001,0x00000000,
  1084. /*
  1085. RETURN
  1086. at 0x00000187 : */ 0x90080000,0x00000000,
  1087. /*
  1088. ENTRY accept_message
  1089. accept_message:
  1090. CLEAR ATN
  1091. at 0x00000189 : */ 0x60000008,0x00000000,
  1092. /*
  1093. CLEAR ACK
  1094. at 0x0000018b : */ 0x60000040,0x00000000,
  1095. /*
  1096. RETURN
  1097. at 0x0000018d : */ 0x90080000,0x00000000,
  1098. /*
  1099. ENTRY respond_message
  1100. respond_message:
  1101. SET ATN
  1102. at 0x0000018f : */ 0x58000008,0x00000000,
  1103. /*
  1104. CLEAR ACK
  1105. at 0x00000191 : */ 0x60000040,0x00000000,
  1106. /*
  1107. MOVE FROM dsa_msgout_other, WHEN MSG_OUT
  1108. at 0x00000193 : */ 0x1e000000,0x00000068,
  1109. /*
  1110. RETURN
  1111. at 0x00000195 : */ 0x90080000,0x00000000,
  1112. /*
  1113. ;
  1114. ; command_complete
  1115. ;
  1116. ; PURPOSE : handle command termination when STATUS IN is detected by reading
  1117. ; a status byte followed by a command termination message.
  1118. ;
  1119. ; Normal termination results in an INTFLY instruction, and
  1120. ; the host system can pick out which command terminated by
  1121. ; examining the MESSAGE and STATUS buffers of all currently
  1122. ; executing commands;
  1123. ;
  1124. ; Abnormal (CHECK_CONDITION) termination results in an
  1125. ; int_err_check_condition interrupt so that a REQUEST SENSE
  1126. ; command can be issued out-of-order so that no other command
  1127. ; clears the contingent allegiance condition.
  1128. ;
  1129. ;
  1130. ; INPUTS : DSA - command
  1131. ;
  1132. ; CALLS : OK
  1133. ;
  1134. ; EXITS : On successful termination, control is passed to schedule.
  1135. ; On abnormal termination, the user will usually modify the
  1136. ; DSA fields and corresponding buffers and return control
  1137. ; to select.
  1138. ;
  1139. ENTRY command_complete
  1140. command_complete:
  1141. MOVE FROM dsa_status, WHEN STATUS
  1142. at 0x00000197 : */ 0x1b000000,0x00000060,
  1143. /*
  1144. MOVE SFBR TO SCRATCH0 ; Save status
  1145. at 0x00000199 : */ 0x6a340000,0x00000000,
  1146. /*
  1147. ENTRY command_complete_msgin
  1148. command_complete_msgin:
  1149. MOVE FROM dsa_msgin, WHEN MSG_IN
  1150. at 0x0000019b : */ 0x1f000000,0x00000058,
  1151. /*
  1152. ; Indicate that we should be expecting a disconnect
  1153. ; Above code cleared the Unexpected Disconnect bit, what do we do?
  1154. CLEAR ACK
  1155. at 0x0000019d : */ 0x60000040,0x00000000,
  1156. /*
  1157. WAIT DISCONNECT
  1158. at 0x0000019f : */ 0x48000000,0x00000000,
  1159. /*
  1160. ;
  1161. ; The SCSI specification states that when a UNIT ATTENTION condition
  1162. ; is pending, as indicated by a CHECK CONDITION status message,
  1163. ; the target shall revert to asynchronous transfers. Since
  1164. ; synchronous transfers parameters are maintained on a per INITIATOR/TARGET
  1165. ; basis, and returning control to our scheduler could work on a command
  1166. ; running on another lun on that target using the old parameters, we must
  1167. ; interrupt the host processor to get them changed, or change them ourselves.
  1168. ;
  1169. ; Once SCSI-II tagged queueing is implemented, things will be even more
  1170. ; hairy, since contingent allegiance conditions exist on a per-target/lun
  1171. ; basis, and issuing a new command with a different tag would clear it.
  1172. ; In these cases, we must interrupt the host processor to get a request
  1173. ; added to the HEAD of the queue with the request sense command, or we
  1174. ; must automatically issue the request sense command.
  1175. INT int_norm_emulateintfly
  1176. at 0x000001a1 : */ 0x98080000,0x02060000,
  1177. /*
  1178. ; Time to correct DSA following memory move
  1179. MOVE MEMORY 4, saved_dsa, addr_dsa
  1180. at 0x000001a3 : */ 0xc0000004,0x00000000,0x00000000,
  1181. /*
  1182. JUMP schedule
  1183. at 0x000001a6 : */ 0x80080000,0x00000000,
  1184. /*
  1185. command_failed:
  1186. INT int_err_check_condition
  1187. at 0x000001a8 : */ 0x98080000,0x00030000,
  1188. /*
  1189. ;
  1190. ; wait_reselect
  1191. ;
  1192. ; PURPOSE : This is essentially the idle routine, where control lands
  1193. ; when there are no new processes to schedule. wait_reselect
  1194. ; waits for reselection, selection, and new commands.
  1195. ;
  1196. ; When a successful reselection occurs, with the aid
  1197. ; of fixed up code in each DSA, wait_reselect walks the
  1198. ; reconnect_dsa_queue, asking each dsa if the target ID
  1199. ; and LUN match its.
  1200. ;
  1201. ; If a match is found, a call is made back to reselected_ok,
  1202. ; which through the miracles of self modifying code, extracts
  1203. ; the found DSA from the reconnect_dsa_queue and then
  1204. ; returns control to the DSAs thread of execution.
  1205. ;
  1206. ; INPUTS : NONE
  1207. ;
  1208. ; CALLS : OK
  1209. ;
  1210. ; MODIFIES : DSA,
  1211. ;
  1212. ; EXITS : On successful reselection, control is returned to the
  1213. ; DSA which called reselected_ok. If the WAIT RESELECT
  1214. ; was interrupted by a new commands arrival signaled by
  1215. ; SIG_P, control is passed to schedule. If the NCR is
  1216. ; selected, the host system is interrupted with an
  1217. ; int_err_selected which is usually responded to by
  1218. ; setting DSP to the target_abort address.
  1219. ENTRY wait_reselect
  1220. wait_reselect:
  1221. WAIT RESELECT wait_reselect_failed
  1222. at 0x000001aa : */ 0x50000000,0x00000800,
  1223. /*
  1224. reselected:
  1225. CLEAR TARGET
  1226. at 0x000001ac : */ 0x60000200,0x00000000,
  1227. /*
  1228. ; Read all data needed to reestablish the nexus -
  1229. MOVE 1, reselected_identify, WHEN MSG_IN
  1230. at 0x000001ae : */ 0x0f000001,0x00000000,
  1231. /*
  1232. ; We used to CLEAR ACK here.
  1233. ; Point DSA at the current head of the disconnected queue.
  1234. MOVE MEMORY 4, reconnect_dsa_head, addr_scratch
  1235. at 0x000001b0 : */ 0xc0000004,0x00000000,0x00000000,
  1236. /*
  1237. MOVE MEMORY 4, addr_scratch, saved_dsa
  1238. at 0x000001b3 : */ 0xc0000004,0x00000000,0x00000000,
  1239. /*
  1240. ; Fix the update-next pointer so that the reconnect_dsa_head
  1241. ; pointer is the one that will be updated if this DSA is a hit
  1242. ; and we remove it from the queue.
  1243. MOVE MEMORY 4, addr_reconnect_dsa_head, reselected_ok_patch + 8
  1244. at 0x000001b6 : */ 0xc0000004,0x00000000,0x000007ec,
  1245. /*
  1246. ; Time to correct DSA following memory move
  1247. MOVE MEMORY 4, saved_dsa, addr_dsa
  1248. at 0x000001b9 : */ 0xc0000004,0x00000000,0x00000000,
  1249. /*
  1250. ENTRY reselected_check_next
  1251. reselected_check_next:
  1252. ; Check for a NULL pointer.
  1253. MOVE DSA0 TO SFBR
  1254. at 0x000001bc : */ 0x72100000,0x00000000,
  1255. /*
  1256. JUMP reselected_not_end, IF NOT 0
  1257. at 0x000001be : */ 0x80040000,0x00000738,
  1258. /*
  1259. MOVE DSA1 TO SFBR
  1260. at 0x000001c0 : */ 0x72110000,0x00000000,
  1261. /*
  1262. JUMP reselected_not_end, IF NOT 0
  1263. at 0x000001c2 : */ 0x80040000,0x00000738,
  1264. /*
  1265. MOVE DSA2 TO SFBR
  1266. at 0x000001c4 : */ 0x72120000,0x00000000,
  1267. /*
  1268. JUMP reselected_not_end, IF NOT 0
  1269. at 0x000001c6 : */ 0x80040000,0x00000738,
  1270. /*
  1271. MOVE DSA3 TO SFBR
  1272. at 0x000001c8 : */ 0x72130000,0x00000000,
  1273. /*
  1274. JUMP reselected_not_end, IF NOT 0
  1275. at 0x000001ca : */ 0x80040000,0x00000738,
  1276. /*
  1277. INT int_err_unexpected_reselect
  1278. at 0x000001cc : */ 0x98080000,0x00020000,
  1279. /*
  1280. reselected_not_end:
  1281. ;
  1282. ; XXX the ALU is only eight bits wide, and the assembler
  1283. ; wont do the dirt work for us. As long as dsa_check_reselect
  1284. ; is negative, we need to sign extend with 1 bits to the full
  1285. ; 32 bit width of the address.
  1286. ;
  1287. ; A potential work around would be to have a known alignment
  1288. ; of the DSA structure such that the base address plus
  1289. ; dsa_check_reselect doesn't require carrying from bytes
  1290. ; higher than the LSB.
  1291. ;
  1292. MOVE DSA0 TO SFBR
  1293. at 0x000001ce : */ 0x72100000,0x00000000,
  1294. /*
  1295. MOVE SFBR + dsa_check_reselect TO SCRATCH0
  1296. at 0x000001d0 : */ 0x6e340000,0x00000000,
  1297. /*
  1298. MOVE DSA1 TO SFBR
  1299. at 0x000001d2 : */ 0x72110000,0x00000000,
  1300. /*
  1301. MOVE SFBR + 0xff TO SCRATCH1 WITH CARRY
  1302. at 0x000001d4 : */ 0x6f35ff00,0x00000000,
  1303. /*
  1304. MOVE DSA2 TO SFBR
  1305. at 0x000001d6 : */ 0x72120000,0x00000000,
  1306. /*
  1307. MOVE SFBR + 0xff TO SCRATCH2 WITH CARRY
  1308. at 0x000001d8 : */ 0x6f36ff00,0x00000000,
  1309. /*
  1310. MOVE DSA3 TO SFBR
  1311. at 0x000001da : */ 0x72130000,0x00000000,
  1312. /*
  1313. MOVE SFBR + 0xff TO SCRATCH3 WITH CARRY
  1314. at 0x000001dc : */ 0x6f37ff00,0x00000000,
  1315. /*
  1316. MOVE MEMORY 4, addr_scratch, reselected_check + 4
  1317. at 0x000001de : */ 0xc0000004,0x00000000,0x00000794,
  1318. /*
  1319. ; Time to correct DSA following memory move
  1320. MOVE MEMORY 4, saved_dsa, addr_dsa
  1321. at 0x000001e1 : */ 0xc0000004,0x00000000,0x00000000,
  1322. /*
  1323. reselected_check:
  1324. JUMP 0
  1325. at 0x000001e4 : */ 0x80080000,0x00000000,
  1326. /*
  1327. ;
  1328. ;
  1329. ; We have problems here - the memory move corrupts TEMP and DSA. This
  1330. ; routine is called from DSA code, and patched from many places. Scratch
  1331. ; is probably free when it is called.
  1332. ; We have to:
  1333. ; copy temp to scratch, one byte at a time
  1334. ; write scratch to patch a jump in place of the return
  1335. ; do the move memory
  1336. ; jump to the patched in return address
  1337. ; DSA is corrupt when we get here, and can be left corrupt
  1338. ENTRY reselected_ok
  1339. reselected_ok:
  1340. MOVE TEMP0 TO SFBR
  1341. at 0x000001e6 : */ 0x721c0000,0x00000000,
  1342. /*
  1343. MOVE SFBR TO SCRATCH0
  1344. at 0x000001e8 : */ 0x6a340000,0x00000000,
  1345. /*
  1346. MOVE TEMP1 TO SFBR
  1347. at 0x000001ea : */ 0x721d0000,0x00000000,
  1348. /*
  1349. MOVE SFBR TO SCRATCH1
  1350. at 0x000001ec : */ 0x6a350000,0x00000000,
  1351. /*
  1352. MOVE TEMP2 TO SFBR
  1353. at 0x000001ee : */ 0x721e0000,0x00000000,
  1354. /*
  1355. MOVE SFBR TO SCRATCH2
  1356. at 0x000001f0 : */ 0x6a360000,0x00000000,
  1357. /*
  1358. MOVE TEMP3 TO SFBR
  1359. at 0x000001f2 : */ 0x721f0000,0x00000000,
  1360. /*
  1361. MOVE SFBR TO SCRATCH3
  1362. at 0x000001f4 : */ 0x6a370000,0x00000000,
  1363. /*
  1364. MOVE MEMORY 4, addr_scratch, reselected_ok_jump + 4
  1365. at 0x000001f6 : */ 0xc0000004,0x00000000,0x000007f4,
  1366. /*
  1367. reselected_ok_patch:
  1368. MOVE MEMORY 4, 0, 0
  1369. at 0x000001f9 : */ 0xc0000004,0x00000000,0x00000000,
  1370. /*
  1371. reselected_ok_jump:
  1372. JUMP 0
  1373. at 0x000001fc : */ 0x80080000,0x00000000,
  1374. /*
  1375. selected:
  1376. INT int_err_selected;
  1377. at 0x000001fe : */ 0x98080000,0x00010000,
  1378. /*
  1379. ;
  1380. ; A select or reselect failure can be caused by one of two conditions :
  1381. ; 1. SIG_P was set. This will be the case if the user has written
  1382. ; a new value to a previously NULL head of the issue queue.
  1383. ;
  1384. ; 2. The NCR53c810 was selected or reselected by another device.
  1385. ;
  1386. ; 3. The bus was already busy since we were selected or reselected
  1387. ; before starting the command.
  1388. wait_reselect_failed:
  1389. ; Check selected bit.
  1390. ; Must work out how to tell if we are selected....
  1391. ; Reading CTEST2 clears the SIG_P bit in the ISTAT register.
  1392. MOVE CTEST2 & 0x40 TO SFBR
  1393. at 0x00000200 : */ 0x74164000,0x00000000,
  1394. /*
  1395. JUMP schedule, IF 0x40
  1396. at 0x00000202 : */ 0x800c0040,0x00000000,
  1397. /*
  1398. ; Check connected bit.
  1399. ; FIXME: this needs to change if we support target mode
  1400. MOVE ISTAT & 0x08 TO SFBR
  1401. at 0x00000204 : */ 0x74210800,0x00000000,
  1402. /*
  1403. JUMP reselected, IF 0x08
  1404. at 0x00000206 : */ 0x800c0008,0x000006b0,
  1405. /*
  1406. ; FIXME : Something bogus happened, and we shouldn't fail silently.
  1407. INT int_debug_panic
  1408. at 0x00000208 : */ 0x98080000,0x030b0000,
  1409. /*
  1410. select_failed:
  1411. ; Disable selection timer
  1412. MOVE CTEST7 | 0x10 TO CTEST7
  1413. at 0x0000020a : */ 0x7a1b1000,0x00000000,
  1414. /*
  1415. ; Otherwise, mask the selected and reselected bits off SIST0
  1416. ; Let's assume we don't get selected for now
  1417. MOVE SSTAT0 & 0x10 TO SFBR
  1418. at 0x0000020c : */ 0x740d1000,0x00000000,
  1419. /*
  1420. JUMP reselected, IF 0x10
  1421. at 0x0000020e : */ 0x800c0010,0x000006b0,
  1422. /*
  1423. ; If SIGP is set, the user just gave us another command, and
  1424. ; we should restart or return to the scheduler.
  1425. ; Reading CTEST2 clears the SIG_P bit in the ISTAT register.
  1426. MOVE CTEST2 & 0x40 TO SFBR
  1427. at 0x00000210 : */ 0x74164000,0x00000000,
  1428. /*
  1429. JUMP select, IF 0x40
  1430. at 0x00000212 : */ 0x800c0040,0x000001f8,
  1431. /*
  1432. ; Check connected bit.
  1433. ; FIXME: this needs to change if we support target mode
  1434. ; FIXME: is this really necessary?
  1435. MOVE ISTAT & 0x08 TO SFBR
  1436. at 0x00000214 : */ 0x74210800,0x00000000,
  1437. /*
  1438. JUMP reselected, IF 0x08
  1439. at 0x00000216 : */ 0x800c0008,0x000006b0,
  1440. /*
  1441. ; FIXME : Something bogus happened, and we shouldn't fail silently.
  1442. INT int_debug_panic
  1443. at 0x00000218 : */ 0x98080000,0x030b0000,
  1444. /*
  1445. ;
  1446. ; test_1
  1447. ; test_2
  1448. ;
  1449. ; PURPOSE : run some verification tests on the NCR. test_1
  1450. ; copies test_src to test_dest and interrupts the host
  1451. ; processor, testing for cache coherency and interrupt
  1452. ; problems in the processes.
  1453. ;
  1454. ; test_2 runs a command with offsets relative to the
  1455. ; DSA on entry, and is useful for miscellaneous experimentation.
  1456. ;
  1457. ; Verify that interrupts are working correctly and that we don't
  1458. ; have a cache invalidation problem.
  1459. ABSOLUTE test_src = 0, test_dest = 0
  1460. ENTRY test_1
  1461. test_1:
  1462. MOVE MEMORY 4, test_src, test_dest
  1463. at 0x0000021a : */ 0xc0000004,0x00000000,0x00000000,
  1464. /*
  1465. INT int_test_1
  1466. at 0x0000021d : */ 0x98080000,0x04000000,
  1467. /*
  1468. ;
  1469. ; Run arbitrary commands, with test code establishing a DSA
  1470. ;
  1471. ENTRY test_2
  1472. test_2:
  1473. CLEAR TARGET
  1474. at 0x0000021f : */ 0x60000200,0x00000000,
  1475. /*
  1476. ; Enable selection timer
  1477. MOVE CTEST7 & 0xef TO CTEST7
  1478. at 0x00000221 : */ 0x7c1bef00,0x00000000,
  1479. /*
  1480. SELECT ATN FROM 0, test_2_fail
  1481. at 0x00000223 : */ 0x43000000,0x000008dc,
  1482. /*
  1483. JUMP test_2_msgout, WHEN MSG_OUT
  1484. at 0x00000225 : */ 0x860b0000,0x0000089c,
  1485. /*
  1486. ENTRY test_2_msgout
  1487. test_2_msgout:
  1488. ; Disable selection timer
  1489. MOVE CTEST7 | 0x10 TO CTEST7
  1490. at 0x00000227 : */ 0x7a1b1000,0x00000000,
  1491. /*
  1492. MOVE FROM 8, WHEN MSG_OUT
  1493. at 0x00000229 : */ 0x1e000000,0x00000008,
  1494. /*
  1495. MOVE FROM 16, WHEN CMD
  1496. at 0x0000022b : */ 0x1a000000,0x00000010,
  1497. /*
  1498. MOVE FROM 24, WHEN DATA_IN
  1499. at 0x0000022d : */ 0x19000000,0x00000018,
  1500. /*
  1501. MOVE FROM 32, WHEN STATUS
  1502. at 0x0000022f : */ 0x1b000000,0x00000020,
  1503. /*
  1504. MOVE FROM 40, WHEN MSG_IN
  1505. at 0x00000231 : */ 0x1f000000,0x00000028,
  1506. /*
  1507. CLEAR ACK
  1508. at 0x00000233 : */ 0x60000040,0x00000000,
  1509. /*
  1510. WAIT DISCONNECT
  1511. at 0x00000235 : */ 0x48000000,0x00000000,
  1512. /*
  1513. test_2_fail:
  1514. ; Disable selection timer
  1515. MOVE CTEST7 | 0x10 TO CTEST7
  1516. at 0x00000237 : */ 0x7a1b1000,0x00000000,
  1517. /*
  1518. INT int_test_2
  1519. at 0x00000239 : */ 0x98080000,0x04010000,
  1520. /*
  1521. ENTRY debug_break
  1522. debug_break:
  1523. INT int_debug_break
  1524. at 0x0000023b : */ 0x98080000,0x03000000,
  1525. /*
  1526. ;
  1527. ; initiator_abort
  1528. ; target_abort
  1529. ;
  1530. ; PURPOSE : Abort the currently established nexus from with initiator
  1531. ; or target mode.
  1532. ;
  1533. ;
  1534. ENTRY target_abort
  1535. target_abort:
  1536. SET TARGET
  1537. at 0x0000023d : */ 0x58000200,0x00000000,
  1538. /*
  1539. DISCONNECT
  1540. at 0x0000023f : */ 0x48000000,0x00000000,
  1541. /*
  1542. CLEAR TARGET
  1543. at 0x00000241 : */ 0x60000200,0x00000000,
  1544. /*
  1545. JUMP schedule
  1546. at 0x00000243 : */ 0x80080000,0x00000000,
  1547. /*
  1548. ENTRY initiator_abort
  1549. initiator_abort:
  1550. SET ATN
  1551. at 0x00000245 : */ 0x58000008,0x00000000,
  1552. /*
  1553. ;
  1554. ; The SCSI-I specification says that targets may go into MSG out at
  1555. ; their leisure upon receipt of the ATN single. On all versions of the
  1556. ; specification, we can't change phases until REQ transitions true->false,
  1557. ; so we need to sink/source one byte of data to allow the transition.
  1558. ;
  1559. ; For the sake of safety, we'll only source one byte of data in all
  1560. ; cases, but to accommodate the SCSI-I dain bramage, we'll sink an
  1561. ; arbitrary number of bytes.
  1562. JUMP spew_cmd, WHEN CMD
  1563. at 0x00000247 : */ 0x820b0000,0x0000094c,
  1564. /*
  1565. JUMP eat_msgin, WHEN MSG_IN
  1566. at 0x00000249 : */ 0x870b0000,0x0000095c,
  1567. /*
  1568. JUMP eat_datain, WHEN DATA_IN
  1569. at 0x0000024b : */ 0x810b0000,0x0000098c,
  1570. /*
  1571. JUMP eat_status, WHEN STATUS
  1572. at 0x0000024d : */ 0x830b0000,0x00000974,
  1573. /*
  1574. JUMP spew_dataout, WHEN DATA_OUT
  1575. at 0x0000024f : */ 0x800b0000,0x000009a4,
  1576. /*
  1577. JUMP sated
  1578. at 0x00000251 : */ 0x80080000,0x000009ac,
  1579. /*
  1580. spew_cmd:
  1581. MOVE 1, NCR53c7xx_zero, WHEN CMD
  1582. at 0x00000253 : */ 0x0a000001,0x00000000,
  1583. /*
  1584. JUMP sated
  1585. at 0x00000255 : */ 0x80080000,0x000009ac,
  1586. /*
  1587. eat_msgin:
  1588. MOVE 1, NCR53c7xx_sink, WHEN MSG_IN
  1589. at 0x00000257 : */ 0x0f000001,0x00000000,
  1590. /*
  1591. JUMP eat_msgin, WHEN MSG_IN
  1592. at 0x00000259 : */ 0x870b0000,0x0000095c,
  1593. /*
  1594. JUMP sated
  1595. at 0x0000025b : */ 0x80080000,0x000009ac,
  1596. /*
  1597. eat_status:
  1598. MOVE 1, NCR53c7xx_sink, WHEN STATUS
  1599. at 0x0000025d : */ 0x0b000001,0x00000000,
  1600. /*
  1601. JUMP eat_status, WHEN STATUS
  1602. at 0x0000025f : */ 0x830b0000,0x00000974,
  1603. /*
  1604. JUMP sated
  1605. at 0x00000261 : */ 0x80080000,0x000009ac,
  1606. /*
  1607. eat_datain:
  1608. MOVE 1, NCR53c7xx_sink, WHEN DATA_IN
  1609. at 0x00000263 : */ 0x09000001,0x00000000,
  1610. /*
  1611. JUMP eat_datain, WHEN DATA_IN
  1612. at 0x00000265 : */ 0x810b0000,0x0000098c,
  1613. /*
  1614. JUMP sated
  1615. at 0x00000267 : */ 0x80080000,0x000009ac,
  1616. /*
  1617. spew_dataout:
  1618. MOVE 1, NCR53c7xx_zero, WHEN DATA_OUT
  1619. at 0x00000269 : */ 0x08000001,0x00000000,
  1620. /*
  1621. sated:
  1622. MOVE 1, NCR53c7xx_msg_abort, WHEN MSG_OUT
  1623. at 0x0000026b : */ 0x0e000001,0x00000000,
  1624. /*
  1625. WAIT DISCONNECT
  1626. at 0x0000026d : */ 0x48000000,0x00000000,
  1627. /*
  1628. INT int_norm_aborted
  1629. at 0x0000026f : */ 0x98080000,0x02040000,
  1630. /*
  1631. ; Little patched jump, used to overcome problems with TEMP getting
  1632. ; corrupted on memory moves.
  1633. jump_temp:
  1634. JUMP 0
  1635. at 0x00000271 : */ 0x80080000,0x00000000,
  1636. };
  1637. #define A_NCR53c7xx_msg_abort 0x00000000
  1638. static u32 A_NCR53c7xx_msg_abort_used[] __attribute((unused)) = {
  1639. 0x0000026c,
  1640. };
  1641. #define A_NCR53c7xx_msg_reject 0x00000000
  1642. static u32 A_NCR53c7xx_msg_reject_used[] __attribute((unused)) = {
  1643. 0x00000186,
  1644. };
  1645. #define A_NCR53c7xx_sink 0x00000000
  1646. static u32 A_NCR53c7xx_sink_used[] __attribute((unused)) = {
  1647. 0x00000258,
  1648. 0x0000025e,
  1649. 0x00000264,
  1650. };
  1651. #define A_NCR53c7xx_zero 0x00000000
  1652. static u32 A_NCR53c7xx_zero_used[] __attribute((unused)) = {
  1653. 0x00000254,
  1654. 0x0000026a,
  1655. };
  1656. #define A_NOP_insn 0x00000000
  1657. static u32 A_NOP_insn_used[] __attribute((unused)) = {
  1658. 0x00000017,
  1659. };
  1660. #define A_addr_dsa 0x00000000
  1661. static u32 A_addr_dsa_used[] __attribute((unused)) = {
  1662. 0x0000000f,
  1663. 0x00000026,
  1664. 0x00000033,
  1665. 0x00000040,
  1666. 0x00000055,
  1667. 0x00000079,
  1668. 0x0000008e,
  1669. 0x000000bc,
  1670. 0x000000d2,
  1671. 0x00000130,
  1672. 0x000001a5,
  1673. 0x000001bb,
  1674. 0x000001e3,
  1675. };
  1676. #define A_addr_reconnect_dsa_head 0x00000000
  1677. static u32 A_addr_reconnect_dsa_head_used[] __attribute((unused)) = {
  1678. 0x000001b7,
  1679. };
  1680. #define A_addr_scratch 0x00000000
  1681. static u32 A_addr_scratch_used[] __attribute((unused)) = {
  1682. 0x00000002,
  1683. 0x00000004,
  1684. 0x00000008,
  1685. 0x00000020,
  1686. 0x00000022,
  1687. 0x00000049,
  1688. 0x00000060,
  1689. 0x0000006a,
  1690. 0x00000071,
  1691. 0x00000073,
  1692. 0x000000ab,
  1693. 0x000000b5,
  1694. 0x000000c1,
  1695. 0x000000cb,
  1696. 0x0000012c,
  1697. 0x00000142,
  1698. 0x00000157,
  1699. 0x000001b2,
  1700. 0x000001b4,
  1701. 0x000001df,
  1702. 0x000001f7,
  1703. };
  1704. #define A_addr_temp 0x00000000
  1705. static u32 A_addr_temp_used[] __attribute((unused)) = {
  1706. };
  1707. #define A_dmode_memory_to_memory 0x00000000
  1708. static u32 A_dmode_memory_to_memory_used[] __attribute((unused)) = {
  1709. };
  1710. #define A_dmode_memory_to_ncr 0x00000000
  1711. static u32 A_dmode_memory_to_ncr_used[] __attribute((unused)) = {
  1712. };
  1713. #define A_dmode_ncr_to_memory 0x00000000
  1714. static u32 A_dmode_ncr_to_memory_used[] __attribute((unused)) = {
  1715. };
  1716. #define A_dsa_check_reselect 0x00000000
  1717. static u32 A_dsa_check_reselect_used[] __attribute((unused)) = {
  1718. 0x000001d0,
  1719. };
  1720. #define A_dsa_cmdout 0x00000048
  1721. static u32 A_dsa_cmdout_used[] __attribute((unused)) = {
  1722. 0x0000009a,
  1723. };
  1724. #define A_dsa_cmnd 0x00000038
  1725. static u32 A_dsa_cmnd_used[] __attribute((unused)) = {
  1726. };
  1727. #define A_dsa_datain 0x00000054
  1728. static u32 A_dsa_datain_used[] __attribute((unused)) = {
  1729. 0x000000c2,
  1730. };
  1731. #define A_dsa_dataout 0x00000050
  1732. static u32 A_dsa_dataout_used[] __attribute((unused)) = {
  1733. 0x000000ac,
  1734. };
  1735. #define A_dsa_end 0x00000070
  1736. static u32 A_dsa_end_used[] __attribute((unused)) = {
  1737. };
  1738. #define A_dsa_fields_start 0x00000000
  1739. static u32 A_dsa_fields_start_used[] __attribute((unused)) = {
  1740. };
  1741. #define A_dsa_msgin 0x00000058
  1742. static u32 A_dsa_msgin_used[] __attribute((unused)) = {
  1743. 0x0000019c,
  1744. };
  1745. #define A_dsa_msgout 0x00000040
  1746. static u32 A_dsa_msgout_used[] __attribute((unused)) = {
  1747. 0x00000089,
  1748. };
  1749. #define A_dsa_msgout_other 0x00000068
  1750. static u32 A_dsa_msgout_other_used[] __attribute((unused)) = {
  1751. 0x00000194,
  1752. };
  1753. #define A_dsa_next 0x00000030
  1754. static u32 A_dsa_next_used[] __attribute((unused)) = {
  1755. 0x00000061,
  1756. };
  1757. #define A_dsa_restore_pointers 0x00000000
  1758. static u32 A_dsa_restore_pointers_used[] __attribute((unused)) = {
  1759. 0x00000146,
  1760. };
  1761. #define A_dsa_save_data_pointer 0x00000000
  1762. static u32 A_dsa_save_data_pointer_used[] __attribute((unused)) = {
  1763. 0x00000131,
  1764. };
  1765. #define A_dsa_select 0x0000003c
  1766. static u32 A_dsa_select_used[] __attribute((unused)) = {
  1767. 0x00000082,
  1768. };
  1769. #define A_dsa_sscf_710 0x00000000
  1770. static u32 A_dsa_sscf_710_used[] __attribute((unused)) = {
  1771. 0x00000007,
  1772. };
  1773. #define A_dsa_status 0x00000060
  1774. static u32 A_dsa_status_used[] __attribute((unused)) = {
  1775. 0x00000198,
  1776. };
  1777. #define A_dsa_temp_addr_array_value 0x00000000
  1778. static u32 A_dsa_temp_addr_array_value_used[] __attribute((unused)) = {
  1779. };
  1780. #define A_dsa_temp_addr_dsa_value 0x00000000
  1781. static u32 A_dsa_temp_addr_dsa_value_used[] __attribute((unused)) = {
  1782. 0x00000001,
  1783. };
  1784. #define A_dsa_temp_addr_new_value 0x00000000
  1785. static u32 A_dsa_temp_addr_new_value_used[] __attribute((unused)) = {
  1786. };
  1787. #define A_dsa_temp_addr_next 0x00000000
  1788. static u32 A_dsa_temp_addr_next_used[] __attribute((unused)) = {
  1789. 0x0000001c,
  1790. 0x0000004f,
  1791. };
  1792. #define A_dsa_temp_addr_residual 0x00000000
  1793. static u32 A_dsa_temp_addr_residual_used[] __attribute((unused)) = {
  1794. 0x0000002d,
  1795. 0x0000003b,
  1796. };
  1797. #define A_dsa_temp_addr_saved_pointer 0x00000000
  1798. static u32 A_dsa_temp_addr_saved_pointer_used[] __attribute((unused)) = {
  1799. 0x0000002b,
  1800. 0x00000037,
  1801. };
  1802. #define A_dsa_temp_addr_saved_residual 0x00000000
  1803. static u32 A_dsa_temp_addr_saved_residual_used[] __attribute((unused)) = {
  1804. 0x0000002e,
  1805. 0x0000003a,
  1806. };
  1807. #define A_dsa_temp_lun 0x00000000
  1808. static u32 A_dsa_temp_lun_used[] __attribute((unused)) = {
  1809. 0x0000004c,
  1810. };
  1811. #define A_dsa_temp_next 0x00000000
  1812. static u32 A_dsa_temp_next_used[] __attribute((unused)) = {
  1813. 0x0000001f,
  1814. };
  1815. #define A_dsa_temp_sync 0x00000000
  1816. static u32 A_dsa_temp_sync_used[] __attribute((unused)) = {
  1817. 0x00000057,
  1818. };
  1819. #define A_dsa_temp_target 0x00000000
  1820. static u32 A_dsa_temp_target_used[] __attribute((unused)) = {
  1821. 0x00000045,
  1822. };
  1823. #define A_emulfly 0x00000000
  1824. static u32 A_emulfly_used[] __attribute((unused)) = {
  1825. };
  1826. #define A_int_debug_break 0x03000000
  1827. static u32 A_int_debug_break_used[] __attribute((unused)) = {
  1828. 0x0000023c,
  1829. };
  1830. #define A_int_debug_panic 0x030b0000
  1831. static u32 A_int_debug_panic_used[] __attribute((unused)) = {
  1832. 0x00000209,
  1833. 0x00000219,
  1834. };
  1835. #define A_int_err_check_condition 0x00030000
  1836. static u32 A_int_err_check_condition_used[] __attribute((unused)) = {
  1837. 0x000001a9,
  1838. };
  1839. #define A_int_err_no_phase 0x00040000
  1840. static u32 A_int_err_no_phase_used[] __attribute((unused)) = {
  1841. };
  1842. #define A_int_err_selected 0x00010000
  1843. static u32 A_int_err_selected_used[] __attribute((unused)) = {
  1844. 0x000001ff,
  1845. };
  1846. #define A_int_err_unexpected_phase 0x00000000
  1847. static u32 A_int_err_unexpected_phase_used[] __attribute((unused)) = {
  1848. 0x00000092,
  1849. 0x00000098,
  1850. 0x000000a0,
  1851. 0x000000d6,
  1852. 0x000000da,
  1853. 0x000000dc,
  1854. 0x000000e4,
  1855. 0x000000e8,
  1856. 0x000000ea,
  1857. 0x000000f2,
  1858. 0x000000f6,
  1859. 0x000000f8,
  1860. 0x000000fa,
  1861. 0x00000160,
  1862. };
  1863. #define A_int_err_unexpected_reselect 0x00020000
  1864. static u32 A_int_err_unexpected_reselect_used[] __attribute((unused)) = {
  1865. 0x000001cd,
  1866. };
  1867. #define A_int_msg_1 0x01020000
  1868. static u32 A_int_msg_1_used[] __attribute((unused)) = {
  1869. 0x00000114,
  1870. 0x00000116,
  1871. };
  1872. #define A_int_msg_sdtr 0x01010000
  1873. static u32 A_int_msg_sdtr_used[] __attribute((unused)) = {
  1874. 0x00000180,
  1875. };
  1876. #define A_int_msg_wdtr 0x01000000
  1877. static u32 A_int_msg_wdtr_used[] __attribute((unused)) = {
  1878. 0x00000174,
  1879. };
  1880. #define A_int_norm_aborted 0x02040000
  1881. static u32 A_int_norm_aborted_used[] __attribute((unused)) = {
  1882. 0x00000270,
  1883. };
  1884. #define A_int_norm_command_complete 0x02020000
  1885. static u32 A_int_norm_command_complete_used[] __attribute((unused)) = {
  1886. };
  1887. #define A_int_norm_disconnected 0x02030000
  1888. static u32 A_int_norm_disconnected_used[] __attribute((unused)) = {
  1889. };
  1890. #define A_int_norm_emulateintfly 0x02060000
  1891. static u32 A_int_norm_emulateintfly_used[] __attribute((unused)) = {
  1892. 0x000001a2,
  1893. };
  1894. #define A_int_norm_reselect_complete 0x02010000
  1895. static u32 A_int_norm_reselect_complete_used[] __attribute((unused)) = {
  1896. };
  1897. #define A_int_norm_reset 0x02050000
  1898. static u32 A_int_norm_reset_used[] __attribute((unused)) = {
  1899. };
  1900. #define A_int_norm_select_complete 0x02000000
  1901. static u32 A_int_norm_select_complete_used[] __attribute((unused)) = {
  1902. };
  1903. #define A_int_test_1 0x04000000
  1904. static u32 A_int_test_1_used[] __attribute((unused)) = {
  1905. 0x0000021e,
  1906. };
  1907. #define A_int_test_2 0x04010000
  1908. static u32 A_int_test_2_used[] __attribute((unused)) = {
  1909. 0x0000023a,
  1910. };
  1911. #define A_int_test_3 0x04020000
  1912. static u32 A_int_test_3_used[] __attribute((unused)) = {
  1913. };
  1914. #define A_msg_buf 0x00000000
  1915. static u32 A_msg_buf_used[] __attribute((unused)) = {
  1916. 0x00000108,
  1917. 0x00000162,
  1918. 0x0000016c,
  1919. 0x00000172,
  1920. 0x00000178,
  1921. 0x0000017e,
  1922. };
  1923. #define A_reconnect_dsa_head 0x00000000
  1924. static u32 A_reconnect_dsa_head_used[] __attribute((unused)) = {
  1925. 0x0000006d,
  1926. 0x00000074,
  1927. 0x000001b1,
  1928. };
  1929. #define A_reselected_identify 0x00000000
  1930. static u32 A_reselected_identify_used[] __attribute((unused)) = {
  1931. 0x00000048,
  1932. 0x000001af,
  1933. };
  1934. #define A_reselected_tag 0x00000000
  1935. static u32 A_reselected_tag_used[] __attribute((unused)) = {
  1936. };
  1937. #define A_saved_dsa 0x00000000
  1938. static u32 A_saved_dsa_used[] __attribute((unused)) = {
  1939. 0x00000005,
  1940. 0x0000000e,
  1941. 0x00000023,
  1942. 0x00000025,
  1943. 0x00000032,
  1944. 0x0000003f,
  1945. 0x00000054,
  1946. 0x0000005f,
  1947. 0x00000070,
  1948. 0x00000078,
  1949. 0x0000008d,
  1950. 0x000000aa,
  1951. 0x000000bb,
  1952. 0x000000c0,
  1953. 0x000000d1,
  1954. 0x0000012f,
  1955. 0x000001a4,
  1956. 0x000001b5,
  1957. 0x000001ba,
  1958. 0x000001e2,
  1959. };
  1960. #define A_schedule 0x00000000
  1961. static u32 A_schedule_used[] __attribute((unused)) = {
  1962. 0x0000007d,
  1963. 0x000001a7,
  1964. 0x00000203,
  1965. 0x00000244,
  1966. };
  1967. #define A_test_dest 0x00000000
  1968. static u32 A_test_dest_used[] __attribute((unused)) = {
  1969. 0x0000021c,
  1970. };
  1971. #define A_test_src 0x00000000
  1972. static u32 A_test_src_used[] __attribute((unused)) = {
  1973. 0x0000021b,
  1974. };
  1975. #define Ent_accept_message 0x00000624
  1976. #define Ent_cmdout_cmdout 0x00000264
  1977. #define Ent_command_complete 0x0000065c
  1978. #define Ent_command_complete_msgin 0x0000066c
  1979. #define Ent_data_transfer 0x0000026c
  1980. #define Ent_datain_to_jump 0x00000334
  1981. #define Ent_debug_break 0x000008ec
  1982. #define Ent_dsa_code_begin 0x00000000
  1983. #define Ent_dsa_code_check_reselect 0x0000010c
  1984. #define Ent_dsa_code_fix_jump 0x00000058
  1985. #define Ent_dsa_code_restore_pointers 0x000000d8
  1986. #define Ent_dsa_code_save_data_pointer 0x000000a4
  1987. #define Ent_dsa_code_template 0x00000000
  1988. #define Ent_dsa_code_template_end 0x00000178
  1989. #define Ent_dsa_schedule 0x00000178
  1990. #define Ent_dsa_zero 0x00000178
  1991. #define Ent_end_data_transfer 0x000002a4
  1992. #define Ent_initiator_abort 0x00000914
  1993. #define Ent_msg_in 0x0000041c
  1994. #define Ent_msg_in_restart 0x000003fc
  1995. #define Ent_other_in 0x0000038c
  1996. #define Ent_other_out 0x00000354
  1997. #define Ent_other_transfer 0x000003c4
  1998. #define Ent_reject_message 0x00000604
  1999. #define Ent_reselected_check_next 0x000006f0
  2000. #define Ent_reselected_ok 0x00000798
  2001. #define Ent_respond_message 0x0000063c
  2002. #define Ent_select 0x000001f8
  2003. #define Ent_select_msgout 0x00000218
  2004. #define Ent_target_abort 0x000008f4
  2005. #define Ent_test_1 0x00000868
  2006. #define Ent_test_2 0x0000087c
  2007. #define Ent_test_2_msgout 0x0000089c
  2008. #define Ent_wait_reselect 0x000006a8
  2009. static u32 LABELPATCHES[] __attribute((unused)) = {
  2010. 0x00000011,
  2011. 0x0000001a,
  2012. 0x0000001d,
  2013. 0x00000028,
  2014. 0x0000002a,
  2015. 0x00000035,
  2016. 0x00000038,
  2017. 0x00000042,
  2018. 0x00000050,
  2019. 0x00000052,
  2020. 0x0000006b,
  2021. 0x00000083,
  2022. 0x00000085,
  2023. 0x00000090,
  2024. 0x00000094,
  2025. 0x00000096,
  2026. 0x0000009c,
  2027. 0x0000009e,
  2028. 0x000000a2,
  2029. 0x000000a4,
  2030. 0x000000a6,
  2031. 0x000000a8,
  2032. 0x000000b6,
  2033. 0x000000b9,
  2034. 0x000000cc,
  2035. 0x000000cf,
  2036. 0x000000d8,
  2037. 0x000000de,
  2038. 0x000000e0,
  2039. 0x000000e6,
  2040. 0x000000ec,
  2041. 0x000000ee,
  2042. 0x000000f4,
  2043. 0x000000fc,
  2044. 0x000000fe,
  2045. 0x0000010a,
  2046. 0x0000010c,
  2047. 0x0000010e,
  2048. 0x00000110,
  2049. 0x00000112,
  2050. 0x00000118,
  2051. 0x0000011a,
  2052. 0x0000012d,
  2053. 0x00000143,
  2054. 0x00000158,
  2055. 0x0000015c,
  2056. 0x00000164,
  2057. 0x00000166,
  2058. 0x00000168,
  2059. 0x0000016e,
  2060. 0x0000017a,
  2061. 0x000001ab,
  2062. 0x000001b8,
  2063. 0x000001bf,
  2064. 0x000001c3,
  2065. 0x000001c7,
  2066. 0x000001cb,
  2067. 0x000001e0,
  2068. 0x000001f8,
  2069. 0x00000207,
  2070. 0x0000020f,
  2071. 0x00000213,
  2072. 0x00000217,
  2073. 0x00000224,
  2074. 0x00000226,
  2075. 0x00000248,
  2076. 0x0000024a,
  2077. 0x0000024c,
  2078. 0x0000024e,
  2079. 0x00000250,
  2080. 0x00000252,
  2081. 0x00000256,
  2082. 0x0000025a,
  2083. 0x0000025c,
  2084. 0x00000260,
  2085. 0x00000262,
  2086. 0x00000266,
  2087. 0x00000268,
  2088. };
  2089. static struct {
  2090. u32 offset;
  2091. void *address;
  2092. } EXTERNAL_PATCHES[] __attribute((unused)) = {
  2093. };
  2094. static u32 INSTRUCTIONS __attribute((unused)) = 290;
  2095. static u32 PATCHES __attribute((unused)) = 78;
  2096. static u32 EXTERNAL_PATCHES_LEN __attribute((unused)) = 0;