aic79xx.reg 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096
  1. /*
  2. * Aic79xx register and scratch ram definitions.
  3. *
  4. * Copyright (c) 1994-2001, 2004 Justin T. Gibbs.
  5. * Copyright (c) 2000-2002 Adaptec Inc.
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions, and the following disclaimer,
  13. * without modification.
  14. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  15. * substantially similar to the "NO WARRANTY" disclaimer below
  16. * ("Disclaimer") and any redistribution must be conditioned upon
  17. * including a substantially similar Disclaimer requirement for further
  18. * binary redistribution.
  19. * 3. Neither the names of the above-listed copyright holders nor the names
  20. * of any contributors may be used to endorse or promote products derived
  21. * from this software without specific prior written permission.
  22. *
  23. * Alternatively, this software may be distributed under the terms of the
  24. * GNU General Public License ("GPL") version 2 as published by the Free
  25. * Software Foundation.
  26. *
  27. * NO WARRANTY
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  29. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  30. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  31. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  32. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  34. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  36. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  37. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. * POSSIBILITY OF SUCH DAMAGES.
  39. *
  40. * $FreeBSD$
  41. */
  42. VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $"
  43. /*
  44. * This file is processed by the aic7xxx_asm utility for use in assembling
  45. * firmware for the aic79xx family of SCSI host adapters as well as to generate
  46. * a C header file for use in the kernel portion of the Aic79xx driver.
  47. */
  48. /* Register window Modes */
  49. #define M_DFF0 0
  50. #define M_DFF1 1
  51. #define M_CCHAN 2
  52. #define M_SCSI 3
  53. #define M_CFG 4
  54. #define M_DST_SHIFT 4
  55. #define MK_MODE(src, dst) ((src) | ((dst) << M_DST_SHIFT))
  56. #define SET_MODE(src, dst) \
  57. SET_SRC_MODE src; \
  58. SET_DST_MODE dst; \
  59. if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
  60. mvi MK_MODE(src, dst) call set_mode_work_around; \
  61. } else { \
  62. mvi MODE_PTR, MK_MODE(src, dst); \
  63. }
  64. #define RESTORE_MODE(mode) \
  65. if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
  66. mov mode call set_mode_work_around; \
  67. } else { \
  68. mov MODE_PTR, mode; \
  69. }
  70. #define SET_SEQINTCODE(code) \
  71. if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) { \
  72. mvi code call set_seqint_work_around; \
  73. } else { \
  74. mvi SEQINTCODE, code; \
  75. }
  76. /*
  77. * Mode Pointer
  78. * Controls which of the 5, 512byte, address spaces should be used
  79. * as the source and destination of any register accesses in our
  80. * register window.
  81. */
  82. register MODE_PTR {
  83. address 0x000
  84. access_mode RW
  85. field DST_MODE 0x70
  86. field SRC_MODE 0x07
  87. mode_pointer
  88. }
  89. const SRC_MODE_SHIFT 0
  90. const DST_MODE_SHIFT 4
  91. /*
  92. * Host Interrupt Status
  93. */
  94. register INTSTAT {
  95. address 0x001
  96. access_mode RW
  97. field HWERRINT 0x80
  98. field BRKADRINT 0x40
  99. field SWTMINT 0x20
  100. field PCIINT 0x10
  101. field SCSIINT 0x08
  102. field SEQINT 0x04
  103. field CMDCMPLT 0x02
  104. field SPLTINT 0x01
  105. mask INT_PEND 0xFF
  106. }
  107. /*
  108. * Sequencer Interrupt Code
  109. */
  110. register SEQINTCODE {
  111. address 0x002
  112. access_mode RW
  113. field {
  114. NO_SEQINT, /* No seqint pending. */
  115. BAD_PHASE, /* unknown scsi bus phase */
  116. SEND_REJECT, /* sending a message reject */
  117. PROTO_VIOLATION, /* Protocol Violation */
  118. NO_MATCH, /* no cmd match for reconnect */
  119. IGN_WIDE_RES, /* Complex IGN Wide Res Msg */
  120. PDATA_REINIT, /*
  121. * Returned to data phase
  122. * that requires data
  123. * transfer pointers to be
  124. * recalculated from the
  125. * transfer residual.
  126. */
  127. HOST_MSG_LOOP, /*
  128. * The bus is ready for the
  129. * host to perform another
  130. * message transaction. This
  131. * mechanism is used for things
  132. * like sync/wide negotiation
  133. * that require a kernel based
  134. * message state engine.
  135. */
  136. BAD_STATUS, /* Bad status from target */
  137. DATA_OVERRUN, /*
  138. * Target attempted to write
  139. * beyond the bounds of its
  140. * command.
  141. */
  142. MKMSG_FAILED, /*
  143. * Target completed command
  144. * without honoring our ATN
  145. * request to issue a message.
  146. */
  147. MISSED_BUSFREE, /*
  148. * The sequencer never saw
  149. * the bus go free after
  150. * either a command complete
  151. * or disconnect message.
  152. */
  153. DUMP_CARD_STATE,
  154. ILLEGAL_PHASE,
  155. INVALID_SEQINT,
  156. CFG4ISTAT_INTR,
  157. STATUS_OVERRUN,
  158. CFG4OVERRUN,
  159. ENTERING_NONPACK,
  160. TASKMGMT_FUNC_COMPLETE, /*
  161. * Task management function
  162. * request completed with
  163. * an expected busfree.
  164. */
  165. TASKMGMT_CMD_CMPLT_OKAY, /*
  166. * A command with a non-zero
  167. * task management function
  168. * has completed via the normal
  169. * command completion method
  170. * for commands with a zero
  171. * task management function.
  172. * This happens when an attempt
  173. * to abort a command loses
  174. * the race for the command to
  175. * complete normally.
  176. */
  177. TRACEPOINT0,
  178. TRACEPOINT1,
  179. TRACEPOINT2,
  180. TRACEPOINT3,
  181. SAW_HWERR,
  182. BAD_SCB_STATUS
  183. }
  184. }
  185. /*
  186. * Clear Host Interrupt
  187. */
  188. register CLRINT {
  189. address 0x003
  190. access_mode WO
  191. count 19
  192. field CLRHWERRINT 0x80 /* Rev B or greater */
  193. field CLRBRKADRINT 0x40
  194. field CLRSWTMINT 0x20
  195. field CLRPCIINT 0x10
  196. field CLRSCSIINT 0x08
  197. field CLRSEQINT 0x04
  198. field CLRCMDINT 0x02
  199. field CLRSPLTINT 0x01
  200. }
  201. /*
  202. * Error Register
  203. */
  204. register ERROR {
  205. address 0x004
  206. access_mode RO
  207. field CIOPARERR 0x80
  208. field CIOACCESFAIL 0x40 /* Rev B or greater */
  209. field MPARERR 0x20
  210. field DPARERR 0x10
  211. field SQPARERR 0x08
  212. field ILLOPCODE 0x04
  213. field DSCTMOUT 0x02
  214. }
  215. /*
  216. * Clear Error
  217. */
  218. register CLRERR {
  219. address 0x004
  220. access_mode WO
  221. field CLRCIOPARERR 0x80
  222. field CLRCIOACCESFAIL 0x40 /* Rev B or greater */
  223. field CLRMPARERR 0x20
  224. field CLRDPARERR 0x10
  225. field CLRSQPARERR 0x08
  226. field CLRILLOPCODE 0x04
  227. field CLRDSCTMOUT 0x02
  228. }
  229. /*
  230. * Host Control Register
  231. * Overall host control of the device.
  232. */
  233. register HCNTRL {
  234. address 0x005
  235. access_mode RW
  236. count 12
  237. field SEQ_RESET 0x80 /* Rev B or greater */
  238. field POWRDN 0x40
  239. field SWINT 0x10
  240. field SWTIMER_START_B 0x08 /* Rev B or greater */
  241. field PAUSE 0x04
  242. field INTEN 0x02
  243. field CHIPRST 0x01
  244. field CHIPRSTACK 0x01
  245. }
  246. /*
  247. * Host New SCB Queue Offset
  248. */
  249. register HNSCB_QOFF {
  250. address 0x006
  251. access_mode RW
  252. size 2
  253. count 2
  254. }
  255. /*
  256. * Host Empty SCB Queue Offset
  257. */
  258. register HESCB_QOFF {
  259. address 0x008
  260. access_mode RW
  261. count 2
  262. }
  263. /*
  264. * Host Mailbox
  265. */
  266. register HS_MAILBOX {
  267. address 0x00B
  268. access_mode RW
  269. mask HOST_TQINPOS 0x80 /* Boundary at either 0 or 128 */
  270. mask ENINT_COALESCE 0x40 /* Perform interrupt coalescing */
  271. }
  272. /*
  273. * Sequencer Interupt Status
  274. */
  275. register SEQINTSTAT {
  276. address 0x00C
  277. count 1
  278. access_mode RO
  279. field SEQ_SWTMRTO 0x10
  280. field SEQ_SEQINT 0x08
  281. field SEQ_SCSIINT 0x04
  282. field SEQ_PCIINT 0x02
  283. field SEQ_SPLTINT 0x01
  284. }
  285. /*
  286. * Clear SEQ Interrupt
  287. */
  288. register CLRSEQINTSTAT {
  289. address 0x00C
  290. access_mode WO
  291. field CLRSEQ_SWTMRTO 0x10
  292. field CLRSEQ_SEQINT 0x08
  293. field CLRSEQ_SCSIINT 0x04
  294. field CLRSEQ_PCIINT 0x02
  295. field CLRSEQ_SPLTINT 0x01
  296. }
  297. /*
  298. * Software Timer
  299. */
  300. register SWTIMER {
  301. address 0x00E
  302. access_mode RW
  303. size 2
  304. }
  305. /*
  306. * SEQ New SCB Queue Offset
  307. */
  308. register SNSCB_QOFF {
  309. address 0x010
  310. access_mode RW
  311. size 2
  312. modes M_CCHAN
  313. }
  314. /*
  315. * SEQ Empty SCB Queue Offset
  316. */
  317. register SESCB_QOFF {
  318. address 0x012
  319. count 2
  320. access_mode RW
  321. modes M_CCHAN
  322. }
  323. /*
  324. * SEQ Done SCB Queue Offset
  325. */
  326. register SDSCB_QOFF {
  327. address 0x014
  328. access_mode RW
  329. modes M_CCHAN
  330. size 2
  331. }
  332. /*
  333. * Queue Offset Control & Status
  334. */
  335. register QOFF_CTLSTA {
  336. address 0x016
  337. access_mode RW
  338. modes M_CCHAN
  339. field EMPTY_SCB_AVAIL 0x80
  340. field NEW_SCB_AVAIL 0x40
  341. field SDSCB_ROLLOVR 0x20
  342. field HS_MAILBOX_ACT 0x10
  343. field SCB_QSIZE 0x0F {
  344. SCB_QSIZE_4,
  345. SCB_QSIZE_8,
  346. SCB_QSIZE_16,
  347. SCB_QSIZE_32,
  348. SCB_QSIZE_64,
  349. SCB_QSIZE_128,
  350. SCB_QSIZE_256,
  351. SCB_QSIZE_512,
  352. SCB_QSIZE_1024,
  353. SCB_QSIZE_2048,
  354. SCB_QSIZE_4096,
  355. SCB_QSIZE_8192,
  356. SCB_QSIZE_16384
  357. }
  358. }
  359. /*
  360. * Interrupt Control
  361. */
  362. register INTCTL {
  363. address 0x018
  364. access_mode RW
  365. field SWTMINTMASK 0x80
  366. field SWTMINTEN 0x40
  367. field SWTIMER_START 0x20
  368. field AUTOCLRCMDINT 0x10
  369. field PCIINTEN 0x08
  370. field SCSIINTEN 0x04
  371. field SEQINTEN 0x02
  372. field SPLTINTEN 0x01
  373. }
  374. /*
  375. * Data FIFO Control
  376. */
  377. register DFCNTRL {
  378. address 0x019
  379. access_mode RW
  380. modes M_DFF0, M_DFF1
  381. count 11
  382. field PRELOADEN 0x80
  383. field SCSIENWRDIS 0x40 /* Rev B only. */
  384. field SCSIEN 0x20
  385. field SCSIENACK 0x20
  386. field HDMAEN 0x08
  387. field HDMAENACK 0x08
  388. field DIRECTION 0x04
  389. field DIRECTIONACK 0x04
  390. field FIFOFLUSH 0x02
  391. field FIFOFLUSHACK 0x02
  392. field DIRECTIONEN 0x01
  393. }
  394. /*
  395. * Device Space Command 0
  396. */
  397. register DSCOMMAND0 {
  398. address 0x019
  399. count 1
  400. access_mode RW
  401. modes M_CFG
  402. field CACHETHEN 0x80 /* Cache Threshold enable */
  403. field DPARCKEN 0x40 /* Data Parity Check Enable */
  404. field MPARCKEN 0x20 /* Memory Parity Check Enable */
  405. field EXTREQLCK 0x10 /* External Request Lock */
  406. field DISABLE_TWATE 0x02 /* Rev B or greater */
  407. field CIOPARCKEN 0x01 /* Internal bus parity error enable */
  408. }
  409. /*
  410. * Data FIFO Status
  411. */
  412. register DFSTATUS {
  413. address 0x01A
  414. access_mode RO
  415. modes M_DFF0, M_DFF1
  416. field PRELOAD_AVAIL 0x80
  417. field PKT_PRELOAD_AVAIL 0x40
  418. field MREQPEND 0x10
  419. field HDONE 0x08
  420. field DFTHRESH 0x04
  421. field FIFOFULL 0x02
  422. field FIFOEMP 0x01
  423. }
  424. /*
  425. * S/G Cache Pointer
  426. */
  427. register SG_CACHE_PRE {
  428. address 0x01B
  429. access_mode WO
  430. modes M_DFF0, M_DFF1
  431. field SG_ADDR_MASK 0xf8
  432. field ODD_SEG 0x04
  433. field LAST_SEG 0x02
  434. }
  435. register SG_CACHE_SHADOW {
  436. address 0x01B
  437. access_mode RO
  438. modes M_DFF0, M_DFF1
  439. field SG_ADDR_MASK 0xf8
  440. field ODD_SEG 0x04
  441. field LAST_SEG 0x02
  442. field LAST_SEG_DONE 0x01
  443. }
  444. /*
  445. * Arbiter Control
  446. */
  447. register ARBCTL {
  448. address 0x01B
  449. access_mode RW
  450. modes M_CFG
  451. field RESET_HARB 0x80
  452. field RETRY_SWEN 0x08
  453. field USE_TIME 0x07
  454. }
  455. /*
  456. * Data Channel Host Address
  457. */
  458. register HADDR {
  459. address 0x070
  460. access_mode RW
  461. size 8
  462. modes M_DFF0, M_DFF1
  463. }
  464. /*
  465. * Host Overlay DMA Address
  466. */
  467. register HODMAADR {
  468. address 0x070
  469. access_mode RW
  470. size 8
  471. modes M_SCSI
  472. }
  473. /*
  474. * PCI PLL Delay.
  475. */
  476. register PLLDELAY {
  477. address 0x070
  478. access_mode RW
  479. size 1
  480. modes M_CFG
  481. field SPLIT_DROP_REQ 0x80
  482. }
  483. /*
  484. * Data Channel Host Count
  485. */
  486. register HCNT {
  487. address 0x078
  488. access_mode RW
  489. size 3
  490. modes M_DFF0, M_DFF1
  491. }
  492. /*
  493. * Host Overlay DMA Count
  494. */
  495. register HODMACNT {
  496. address 0x078
  497. access_mode RW
  498. size 2
  499. modes M_SCSI
  500. }
  501. /*
  502. * Host Overlay DMA Enable
  503. */
  504. register HODMAEN {
  505. address 0x07A
  506. access_mode RW
  507. modes M_SCSI
  508. }
  509. /*
  510. * Scatter/Gather Host Address
  511. */
  512. register SGHADDR {
  513. address 0x07C
  514. access_mode RW
  515. size 8
  516. modes M_DFF0, M_DFF1
  517. }
  518. /*
  519. * SCB Host Address
  520. */
  521. register SCBHADDR {
  522. address 0x07C
  523. access_mode RW
  524. size 8
  525. modes M_CCHAN
  526. }
  527. /*
  528. * Scatter/Gather Host Count
  529. */
  530. register SGHCNT {
  531. address 0x084
  532. access_mode RW
  533. modes M_DFF0, M_DFF1
  534. }
  535. /*
  536. * SCB Host Count
  537. */
  538. register SCBHCNT {
  539. address 0x084
  540. access_mode RW
  541. modes M_CCHAN
  542. }
  543. /*
  544. * Data FIFO Threshold
  545. */
  546. register DFF_THRSH {
  547. address 0x088
  548. access_mode RW
  549. modes M_CFG
  550. count 1
  551. field WR_DFTHRSH 0x70 {
  552. WR_DFTHRSH_MIN,
  553. WR_DFTHRSH_25,
  554. WR_DFTHRSH_50,
  555. WR_DFTHRSH_63,
  556. WR_DFTHRSH_75,
  557. WR_DFTHRSH_85,
  558. WR_DFTHRSH_90,
  559. WR_DFTHRSH_MAX
  560. }
  561. field RD_DFTHRSH 0x07 {
  562. RD_DFTHRSH_MIN,
  563. RD_DFTHRSH_25,
  564. RD_DFTHRSH_50,
  565. RD_DFTHRSH_63,
  566. RD_DFTHRSH_75,
  567. RD_DFTHRSH_85,
  568. RD_DFTHRSH_90,
  569. RD_DFTHRSH_MAX
  570. }
  571. }
  572. /*
  573. * ROM Address
  574. */
  575. register ROMADDR {
  576. address 0x08A
  577. access_mode RW
  578. size 3
  579. }
  580. /*
  581. * ROM Control
  582. */
  583. register ROMCNTRL {
  584. address 0x08D
  585. access_mode RW
  586. field ROMOP 0xE0
  587. field ROMSPD 0x18
  588. field REPEAT 0x02
  589. field RDY 0x01
  590. }
  591. /*
  592. * ROM Data
  593. */
  594. register ROMDATA {
  595. address 0x08E
  596. access_mode RW
  597. }
  598. /*
  599. * Data Channel Receive Message 0
  600. */
  601. register DCHRXMSG0 {
  602. address 0x090
  603. access_mode RO
  604. modes M_DFF0, M_DFF1
  605. field CDNUM 0xF8
  606. field CFNUM 0x07
  607. }
  608. /*
  609. * CMC Recieve Message 0
  610. */
  611. register CMCRXMSG0 {
  612. address 0x090
  613. access_mode RO
  614. modes M_CCHAN
  615. field CDNUM 0xF8
  616. field CFNUM 0x07
  617. }
  618. /*
  619. * Overlay Recieve Message 0
  620. */
  621. register OVLYRXMSG0 {
  622. address 0x090
  623. access_mode RO
  624. modes M_SCSI
  625. field CDNUM 0xF8
  626. field CFNUM 0x07
  627. }
  628. /*
  629. * Relaxed Order Enable
  630. */
  631. register ROENABLE {
  632. address 0x090
  633. access_mode RW
  634. modes M_CFG
  635. field MSIROEN 0x20
  636. field OVLYROEN 0x10
  637. field CMCROEN 0x08
  638. field SGROEN 0x04
  639. field DCH1ROEN 0x02
  640. field DCH0ROEN 0x01
  641. }
  642. /*
  643. * Data Channel Receive Message 1
  644. */
  645. register DCHRXMSG1 {
  646. address 0x091
  647. access_mode RO
  648. modes M_DFF0, M_DFF1
  649. field CBNUM 0xFF
  650. }
  651. /*
  652. * CMC Recieve Message 1
  653. */
  654. register CMCRXMSG1 {
  655. address 0x091
  656. access_mode RO
  657. modes M_CCHAN
  658. field CBNUM 0xFF
  659. }
  660. /*
  661. * Overlay Recieve Message 1
  662. */
  663. register OVLYRXMSG1 {
  664. address 0x091
  665. access_mode RO
  666. modes M_SCSI
  667. field CBNUM 0xFF
  668. }
  669. /*
  670. * No Snoop Enable
  671. */
  672. register NSENABLE {
  673. address 0x091
  674. access_mode RW
  675. modes M_CFG
  676. field MSINSEN 0x20
  677. field OVLYNSEN 0x10
  678. field CMCNSEN 0x08
  679. field SGNSEN 0x04
  680. field DCH1NSEN 0x02
  681. field DCH0NSEN 0x01
  682. }
  683. /*
  684. * Data Channel Receive Message 2
  685. */
  686. register DCHRXMSG2 {
  687. address 0x092
  688. access_mode RO
  689. modes M_DFF0, M_DFF1
  690. field MINDEX 0xFF
  691. }
  692. /*
  693. * CMC Recieve Message 2
  694. */
  695. register CMCRXMSG2 {
  696. address 0x092
  697. access_mode RO
  698. modes M_CCHAN
  699. field MINDEX 0xFF
  700. }
  701. /*
  702. * Overlay Recieve Message 2
  703. */
  704. register OVLYRXMSG2 {
  705. address 0x092
  706. access_mode RO
  707. modes M_SCSI
  708. field MINDEX 0xFF
  709. }
  710. /*
  711. * Outstanding Split Transactions
  712. */
  713. register OST {
  714. address 0x092
  715. access_mode RW
  716. modes M_CFG
  717. }
  718. /*
  719. * Data Channel Receive Message 3
  720. */
  721. register DCHRXMSG3 {
  722. address 0x093
  723. access_mode RO
  724. modes M_DFF0, M_DFF1
  725. field MCLASS 0x0F
  726. }
  727. /*
  728. * CMC Recieve Message 3
  729. */
  730. register CMCRXMSG3 {
  731. address 0x093
  732. access_mode RO
  733. modes M_CCHAN
  734. field MCLASS 0x0F
  735. }
  736. /*
  737. * Overlay Recieve Message 3
  738. */
  739. register OVLYRXMSG3 {
  740. address 0x093
  741. access_mode RO
  742. modes M_SCSI
  743. field MCLASS 0x0F
  744. }
  745. /*
  746. * PCI-X Control
  747. */
  748. register PCIXCTL {
  749. address 0x093
  750. access_mode RW
  751. modes M_CFG
  752. count 1
  753. field SERRPULSE 0x80
  754. field UNEXPSCIEN 0x20
  755. field SPLTSMADIS 0x10
  756. field SPLTSTADIS 0x08
  757. field SRSPDPEEN 0x04
  758. field TSCSERREN 0x02
  759. field CMPABCDIS 0x01
  760. }
  761. /*
  762. * CMC Sequencer Byte Count
  763. */
  764. register CMCSEQBCNT {
  765. address 0x094
  766. access_mode RO
  767. modes M_CCHAN
  768. }
  769. /*
  770. * Overlay Sequencer Byte Count
  771. */
  772. register OVLYSEQBCNT {
  773. address 0x094
  774. access_mode RO
  775. modes M_SCSI
  776. }
  777. /*
  778. * Data Channel Sequencer Byte Count
  779. */
  780. register DCHSEQBCNT {
  781. address 0x094
  782. access_mode RO
  783. size 2
  784. modes M_DFF0, M_DFF1
  785. }
  786. /*
  787. * Data Channel Split Status 0
  788. */
  789. register DCHSPLTSTAT0 {
  790. address 0x096
  791. access_mode RW
  792. modes M_DFF0, M_DFF1
  793. count 2
  794. field STAETERM 0x80
  795. field SCBCERR 0x40
  796. field SCADERR 0x20
  797. field SCDATBUCKET 0x10
  798. field CNTNOTCMPLT 0x08
  799. field RXOVRUN 0x04
  800. field RXSCEMSG 0x02
  801. field RXSPLTRSP 0x01
  802. }
  803. /*
  804. * CMC Split Status 0
  805. */
  806. register CMCSPLTSTAT0 {
  807. address 0x096
  808. access_mode RW
  809. modes M_CCHAN
  810. field STAETERM 0x80
  811. field SCBCERR 0x40
  812. field SCADERR 0x20
  813. field SCDATBUCKET 0x10
  814. field CNTNOTCMPLT 0x08
  815. field RXOVRUN 0x04
  816. field RXSCEMSG 0x02
  817. field RXSPLTRSP 0x01
  818. }
  819. /*
  820. * Overlay Split Status 0
  821. */
  822. register OVLYSPLTSTAT0 {
  823. address 0x096
  824. access_mode RW
  825. modes M_SCSI
  826. field STAETERM 0x80
  827. field SCBCERR 0x40
  828. field SCADERR 0x20
  829. field SCDATBUCKET 0x10
  830. field CNTNOTCMPLT 0x08
  831. field RXOVRUN 0x04
  832. field RXSCEMSG 0x02
  833. field RXSPLTRSP 0x01
  834. }
  835. /*
  836. * Data Channel Split Status 1
  837. */
  838. register DCHSPLTSTAT1 {
  839. address 0x097
  840. access_mode RW
  841. modes M_DFF0, M_DFF1
  842. count 2
  843. field RXDATABUCKET 0x01
  844. }
  845. /*
  846. * CMC Split Status 1
  847. */
  848. register CMCSPLTSTAT1 {
  849. address 0x097
  850. access_mode RW
  851. modes M_CCHAN
  852. field RXDATABUCKET 0x01
  853. }
  854. /*
  855. * Overlay Split Status 1
  856. */
  857. register OVLYSPLTSTAT1 {
  858. address 0x097
  859. access_mode RW
  860. modes M_SCSI
  861. field RXDATABUCKET 0x01
  862. }
  863. /*
  864. * S/G Receive Message 0
  865. */
  866. register SGRXMSG0 {
  867. address 0x098
  868. access_mode RO
  869. modes M_DFF0, M_DFF1
  870. field CDNUM 0xF8
  871. field CFNUM 0x07
  872. }
  873. /*
  874. * S/G Receive Message 1
  875. */
  876. register SGRXMSG1 {
  877. address 0x099
  878. access_mode RO
  879. modes M_DFF0, M_DFF1
  880. field CBNUM 0xFF
  881. }
  882. /*
  883. * S/G Receive Message 2
  884. */
  885. register SGRXMSG2 {
  886. address 0x09A
  887. access_mode RO
  888. modes M_DFF0, M_DFF1
  889. field MINDEX 0xFF
  890. }
  891. /*
  892. * S/G Receive Message 3
  893. */
  894. register SGRXMSG3 {
  895. address 0x09B
  896. access_mode RO
  897. modes M_DFF0, M_DFF1
  898. field MCLASS 0x0F
  899. }
  900. /*
  901. * Slave Split Out Address 0
  902. */
  903. register SLVSPLTOUTADR0 {
  904. address 0x098
  905. access_mode RO
  906. modes M_SCSI
  907. field LOWER_ADDR 0x7F
  908. }
  909. /*
  910. * Slave Split Out Address 1
  911. */
  912. register SLVSPLTOUTADR1 {
  913. address 0x099
  914. access_mode RO
  915. modes M_SCSI
  916. field REQ_DNUM 0xF8
  917. field REQ_FNUM 0x07
  918. }
  919. /*
  920. * Slave Split Out Address 2
  921. */
  922. register SLVSPLTOUTADR2 {
  923. address 0x09A
  924. access_mode RO
  925. modes M_SCSI
  926. field REQ_BNUM 0xFF
  927. }
  928. /*
  929. * Slave Split Out Address 3
  930. */
  931. register SLVSPLTOUTADR3 {
  932. address 0x09B
  933. access_mode RO
  934. modes M_SCSI
  935. field RLXORD 020
  936. field TAG_NUM 0x1F
  937. }
  938. /*
  939. * SG Sequencer Byte Count
  940. */
  941. register SGSEQBCNT {
  942. address 0x09C
  943. access_mode RO
  944. modes M_DFF0, M_DFF1
  945. }
  946. /*
  947. * Slave Split Out Attribute 0
  948. */
  949. register SLVSPLTOUTATTR0 {
  950. address 0x09C
  951. access_mode RO
  952. modes M_SCSI
  953. field LOWER_BCNT 0xFF
  954. }
  955. /*
  956. * Slave Split Out Attribute 1
  957. */
  958. register SLVSPLTOUTATTR1 {
  959. address 0x09D
  960. access_mode RO
  961. modes M_SCSI
  962. field CMPLT_DNUM 0xF8
  963. field CMPLT_FNUM 0x07
  964. }
  965. /*
  966. * Slave Split Out Attribute 2
  967. */
  968. register SLVSPLTOUTATTR2 {
  969. address 0x09E
  970. access_mode RO
  971. size 2
  972. modes M_SCSI
  973. field CMPLT_BNUM 0xFF
  974. }
  975. /*
  976. * S/G Split Status 0
  977. */
  978. register SGSPLTSTAT0 {
  979. address 0x09E
  980. access_mode RW
  981. modes M_DFF0, M_DFF1
  982. count 2
  983. field STAETERM 0x80
  984. field SCBCERR 0x40
  985. field SCADERR 0x20
  986. field SCDATBUCKET 0x10
  987. field CNTNOTCMPLT 0x08
  988. field RXOVRUN 0x04
  989. field RXSCEMSG 0x02
  990. field RXSPLTRSP 0x01
  991. }
  992. /*
  993. * S/G Split Status 1
  994. */
  995. register SGSPLTSTAT1 {
  996. address 0x09F
  997. access_mode RW
  998. modes M_DFF0, M_DFF1
  999. count 2
  1000. field RXDATABUCKET 0x01
  1001. }
  1002. /*
  1003. * Special Function
  1004. */
  1005. register SFUNCT {
  1006. address 0x09f
  1007. access_mode RW
  1008. modes M_CFG
  1009. field TEST_GROUP 0xF0
  1010. field TEST_NUM 0x0F
  1011. }
  1012. /*
  1013. * Data FIFO 0 PCI Status
  1014. */
  1015. register DF0PCISTAT {
  1016. address 0x0A0
  1017. access_mode RW
  1018. modes M_CFG
  1019. count 1
  1020. field DPE 0x80
  1021. field SSE 0x40
  1022. field RMA 0x20
  1023. field RTA 0x10
  1024. field SCAAPERR 0x08
  1025. field RDPERR 0x04
  1026. field TWATERR 0x02
  1027. field DPR 0x01
  1028. }
  1029. /*
  1030. * Data FIFO 1 PCI Status
  1031. */
  1032. register DF1PCISTAT {
  1033. address 0x0A1
  1034. access_mode RW
  1035. modes M_CFG
  1036. field DPE 0x80
  1037. field SSE 0x40
  1038. field RMA 0x20
  1039. field RTA 0x10
  1040. field SCAAPERR 0x08
  1041. field RDPERR 0x04
  1042. field TWATERR 0x02
  1043. field DPR 0x01
  1044. }
  1045. /*
  1046. * S/G PCI Status
  1047. */
  1048. register SGPCISTAT {
  1049. address 0x0A2
  1050. access_mode RW
  1051. modes M_CFG
  1052. field DPE 0x80
  1053. field SSE 0x40
  1054. field RMA 0x20
  1055. field RTA 0x10
  1056. field SCAAPERR 0x08
  1057. field RDPERR 0x04
  1058. field DPR 0x01
  1059. }
  1060. /*
  1061. * CMC PCI Status
  1062. */
  1063. register CMCPCISTAT {
  1064. address 0x0A3
  1065. access_mode RW
  1066. modes M_CFG
  1067. field DPE 0x80
  1068. field SSE 0x40
  1069. field RMA 0x20
  1070. field RTA 0x10
  1071. field SCAAPERR 0x08
  1072. field RDPERR 0x04
  1073. field TWATERR 0x02
  1074. field DPR 0x01
  1075. }
  1076. /*
  1077. * Overlay PCI Status
  1078. */
  1079. register OVLYPCISTAT {
  1080. address 0x0A4
  1081. access_mode RW
  1082. modes M_CFG
  1083. field DPE 0x80
  1084. field SSE 0x40
  1085. field RMA 0x20
  1086. field RTA 0x10
  1087. field SCAAPERR 0x08
  1088. field RDPERR 0x04
  1089. field DPR 0x01
  1090. }
  1091. /*
  1092. * PCI Status for MSI Master DMA Transfer
  1093. */
  1094. register MSIPCISTAT {
  1095. address 0x0A6
  1096. access_mode RW
  1097. modes M_CFG
  1098. field SSE 0x40
  1099. field RMA 0x20
  1100. field RTA 0x10
  1101. field CLRPENDMSI 0x08
  1102. field TWATERR 0x02
  1103. field DPR 0x01
  1104. }
  1105. /*
  1106. * PCI Status for Target
  1107. */
  1108. register TARGPCISTAT {
  1109. address 0x0A7
  1110. access_mode RW
  1111. modes M_CFG
  1112. count 5
  1113. field DPE 0x80
  1114. field SSE 0x40
  1115. field STA 0x08
  1116. field TWATERR 0x02
  1117. }
  1118. /*
  1119. * LQ Packet In
  1120. * The last LQ Packet recieved
  1121. */
  1122. register LQIN {
  1123. address 0x020
  1124. access_mode RW
  1125. size 20
  1126. count 2
  1127. modes M_DFF0, M_DFF1, M_SCSI
  1128. }
  1129. /*
  1130. * SCB Type Pointer
  1131. * SCB offset for Target Mode SCB type information
  1132. */
  1133. register TYPEPTR {
  1134. address 0x020
  1135. access_mode RW
  1136. modes M_CFG
  1137. }
  1138. /*
  1139. * Queue Tag Pointer
  1140. * SCB offset to the Two Byte tag identifier used for target mode.
  1141. */
  1142. register TAGPTR {
  1143. address 0x021
  1144. access_mode RW
  1145. modes M_CFG
  1146. }
  1147. /*
  1148. * Logical Unit Number Pointer
  1149. * SCB offset to the LSB (little endian) of the lun field.
  1150. */
  1151. register LUNPTR {
  1152. address 0x022
  1153. access_mode RW
  1154. modes M_CFG
  1155. count 2
  1156. }
  1157. /*
  1158. * Data Length Pointer
  1159. * SCB offset for the 4 byte data length field in target mode.
  1160. */
  1161. register DATALENPTR {
  1162. address 0x023
  1163. access_mode RW
  1164. modes M_CFG
  1165. }
  1166. /*
  1167. * Status Length Pointer
  1168. * SCB offset to the two byte status field in target SCBs.
  1169. */
  1170. register STATLENPTR {
  1171. address 0x024
  1172. access_mode RW
  1173. modes M_CFG
  1174. }
  1175. /*
  1176. * Command Length Pointer
  1177. * Scb offset for the CDB length field in initiator SCBs.
  1178. */
  1179. register CMDLENPTR {
  1180. address 0x025
  1181. access_mode RW
  1182. modes M_CFG
  1183. count 1
  1184. }
  1185. /*
  1186. * Task Attribute Pointer
  1187. * Scb offset for the byte field specifying the attribute byte
  1188. * to be used in command packets.
  1189. */
  1190. register ATTRPTR {
  1191. address 0x026
  1192. access_mode RW
  1193. modes M_CFG
  1194. count 1
  1195. }
  1196. /*
  1197. * Task Management Flags Pointer
  1198. * Scb offset for the byte field specifying the attribute flags
  1199. * byte to be used in command packets.
  1200. */
  1201. register FLAGPTR {
  1202. address 0x027
  1203. access_mode RW
  1204. modes M_CFG
  1205. count 1
  1206. }
  1207. /*
  1208. * Command Pointer
  1209. * Scb offset for the first byte in the CDB for initiator SCBs.
  1210. */
  1211. register CMDPTR {
  1212. address 0x028
  1213. access_mode RW
  1214. modes M_CFG
  1215. count 1
  1216. }
  1217. /*
  1218. * Queue Next Pointer
  1219. * Scb offset for the 2 byte "next scb link".
  1220. */
  1221. register QNEXTPTR {
  1222. address 0x029
  1223. access_mode RW
  1224. modes M_CFG
  1225. count 1
  1226. }
  1227. /*
  1228. * SCSI ID Pointer
  1229. * Scb offset to the value to place in the SCSIID register
  1230. * during target mode connections.
  1231. */
  1232. register IDPTR {
  1233. address 0x02A
  1234. access_mode RW
  1235. modes M_CFG
  1236. }
  1237. /*
  1238. * Command Aborted Byte Pointer
  1239. * Offset to the SCB flags field that includes the
  1240. * "SCB aborted" status bit.
  1241. */
  1242. register ABRTBYTEPTR {
  1243. address 0x02B
  1244. access_mode RW
  1245. modes M_CFG
  1246. count 1
  1247. }
  1248. /*
  1249. * Command Aborted Bit Pointer
  1250. * Bit offset in the SCB flags field for "SCB aborted" status.
  1251. */
  1252. register ABRTBITPTR {
  1253. address 0x02C
  1254. access_mode RW
  1255. modes M_CFG
  1256. count 1
  1257. }
  1258. /*
  1259. * Rev B or greater.
  1260. */
  1261. register MAXCMDBYTES {
  1262. address 0x02D
  1263. access_mode RW
  1264. modes M_CFG
  1265. }
  1266. /*
  1267. * Rev B or greater.
  1268. */
  1269. register MAXCMD2RCV {
  1270. address 0x02E
  1271. access_mode RW
  1272. modes M_CFG
  1273. }
  1274. /*
  1275. * Rev B or greater.
  1276. */
  1277. register SHORTTHRESH {
  1278. address 0x02F
  1279. access_mode RW
  1280. modes M_CFG
  1281. }
  1282. /*
  1283. * Logical Unit Number Length
  1284. * The length, in bytes, of the SCB lun field.
  1285. */
  1286. register LUNLEN {
  1287. address 0x030
  1288. access_mode RW
  1289. modes M_CFG
  1290. count 2
  1291. mask ILUNLEN 0x0F
  1292. mask TLUNLEN 0xF0
  1293. }
  1294. const LUNLEN_SINGLE_LEVEL_LUN 0xF
  1295. /*
  1296. * CDB Limit
  1297. * The size, in bytes, of the embedded CDB field in initator SCBs.
  1298. */
  1299. register CDBLIMIT {
  1300. address 0x031
  1301. access_mode RW
  1302. modes M_CFG
  1303. count 1
  1304. }
  1305. /*
  1306. * Maximum Commands
  1307. * The maximum number of commands to issue during a
  1308. * single packetized connection.
  1309. */
  1310. register MAXCMD {
  1311. address 0x032
  1312. access_mode RW
  1313. modes M_CFG
  1314. count 9
  1315. }
  1316. /*
  1317. * Maximum Command Counter
  1318. * The number of commands already sent during this connection
  1319. */
  1320. register MAXCMDCNT {
  1321. address 0x033
  1322. access_mode RW
  1323. modes M_CFG
  1324. }
  1325. /*
  1326. * LQ Packet Reserved Bytes
  1327. * The bytes to be sent in the currently reserved fileds
  1328. * of all LQ packets.
  1329. */
  1330. register LQRSVD01 {
  1331. address 0x034
  1332. access_mode RW
  1333. modes M_SCSI
  1334. }
  1335. register LQRSVD16 {
  1336. address 0x035
  1337. access_mode RW
  1338. modes M_SCSI
  1339. }
  1340. register LQRSVD17 {
  1341. address 0x036
  1342. access_mode RW
  1343. modes M_SCSI
  1344. }
  1345. /*
  1346. * Command Reserved 0
  1347. * The byte to be sent for the reserved byte 0 of
  1348. * outgoing command packets.
  1349. */
  1350. register CMDRSVD0 {
  1351. address 0x037
  1352. access_mode RW
  1353. modes M_CFG
  1354. }
  1355. /*
  1356. * LQ Manager Control 0
  1357. */
  1358. register LQCTL0 {
  1359. address 0x038
  1360. access_mode RW
  1361. modes M_CFG
  1362. field LQITARGCLT 0xC0
  1363. field LQIINITGCLT 0x30
  1364. field LQ0TARGCLT 0x0C
  1365. field LQ0INITGCLT 0x03
  1366. }
  1367. /*
  1368. * LQ Manager Control 1
  1369. */
  1370. register LQCTL1 {
  1371. address 0x038
  1372. access_mode RW
  1373. modes M_DFF0, M_DFF1, M_SCSI
  1374. count 2
  1375. field PCI2PCI 0x04
  1376. field SINGLECMD 0x02
  1377. field ABORTPENDING 0x01
  1378. }
  1379. /*
  1380. * LQ Manager Control 2
  1381. */
  1382. register LQCTL2 {
  1383. address 0x039
  1384. access_mode RW
  1385. modes M_DFF0, M_DFF1, M_SCSI
  1386. count 5
  1387. field LQIRETRY 0x80
  1388. field LQICONTINUE 0x40
  1389. field LQITOIDLE 0x20
  1390. field LQIPAUSE 0x10
  1391. field LQORETRY 0x08
  1392. field LQOCONTINUE 0x04
  1393. field LQOTOIDLE 0x02
  1394. field LQOPAUSE 0x01
  1395. }
  1396. /*
  1397. * SCSI RAM BIST0
  1398. */
  1399. register SCSBIST0 {
  1400. address 0x039
  1401. access_mode RW
  1402. modes M_CFG
  1403. field GSBISTERR 0x40
  1404. field GSBISTDONE 0x20
  1405. field GSBISTRUN 0x10
  1406. field OSBISTERR 0x04
  1407. field OSBISTDONE 0x02
  1408. field OSBISTRUN 0x01
  1409. }
  1410. /*
  1411. * SCSI Sequence Control0
  1412. */
  1413. register SCSISEQ0 {
  1414. address 0x03A
  1415. access_mode RW
  1416. modes M_DFF0, M_DFF1, M_SCSI
  1417. field TEMODEO 0x80
  1418. field ENSELO 0x40
  1419. field ENARBO 0x20
  1420. field FORCEBUSFREE 0x10
  1421. field SCSIRSTO 0x01
  1422. }
  1423. /*
  1424. * SCSI RAM BIST 1
  1425. */
  1426. register SCSBIST1 {
  1427. address 0x03A
  1428. access_mode RW
  1429. modes M_CFG
  1430. field NTBISTERR 0x04
  1431. field NTBISTDONE 0x02
  1432. field NTBISTRUN 0x01
  1433. }
  1434. /*
  1435. * SCSI Sequence Control 1
  1436. */
  1437. register SCSISEQ1 {
  1438. address 0x03B
  1439. access_mode RW
  1440. modes M_DFF0, M_DFF1, M_SCSI
  1441. count 8
  1442. field MANUALCTL 0x40
  1443. field ENSELI 0x20
  1444. field ENRSELI 0x10
  1445. field MANUALP 0x0C
  1446. field ENAUTOATNP 0x02
  1447. field ALTSTIM 0x01
  1448. }
  1449. /*
  1450. * SCSI Transfer Control 0
  1451. */
  1452. register SXFRCTL0 {
  1453. address 0x03C
  1454. access_mode RW
  1455. modes M_SCSI
  1456. field DFON 0x80
  1457. field DFPEXP 0x40
  1458. field BIOSCANCELEN 0x10
  1459. field SPIOEN 0x08
  1460. }
  1461. /*
  1462. * SCSI Transfer Control 1
  1463. */
  1464. register SXFRCTL1 {
  1465. address 0x03D
  1466. access_mode RW
  1467. modes M_SCSI
  1468. field BITBUCKET 0x80
  1469. field ENSACHK 0x40
  1470. field ENSPCHK 0x20
  1471. field STIMESEL 0x18
  1472. field ENSTIMER 0x04
  1473. field ACTNEGEN 0x02
  1474. field STPWEN 0x01
  1475. }
  1476. /*
  1477. * SCSI Transfer Control 2
  1478. */
  1479. register SXFRCTL2 {
  1480. address 0x03E
  1481. access_mode RW
  1482. modes M_SCSI
  1483. field AUTORSTDIS 0x10
  1484. field CMDDMAEN 0x08
  1485. field ASU 0x07
  1486. }
  1487. /*
  1488. * SCSI Bus Initiator IDs
  1489. * Bitmask of observed initiators on the bus.
  1490. */
  1491. register BUSINITID {
  1492. address 0x03C
  1493. access_mode RW
  1494. modes M_CFG
  1495. size 2
  1496. }
  1497. /*
  1498. * Data Length Counters
  1499. * Packet byte counter.
  1500. */
  1501. register DLCOUNT {
  1502. address 0x03C
  1503. access_mode RW
  1504. modes M_DFF0, M_DFF1
  1505. size 3
  1506. }
  1507. /*
  1508. * Data FIFO Status
  1509. */
  1510. register DFFSTAT {
  1511. address 0x03F
  1512. access_mode RW
  1513. modes M_SCSI
  1514. field FIFO1FREE 0x20
  1515. field FIFO0FREE 0x10
  1516. /*
  1517. * On the B, this enum only works
  1518. * in the read direction. For writes,
  1519. * you must use the B version of the
  1520. * CURRFIFO_0 definition which is defined
  1521. * as a constant outside of this register
  1522. * definition to avoid confusing the
  1523. * register pretty printing code.
  1524. */
  1525. enum CURRFIFO 0x03 {
  1526. CURRFIFO_0,
  1527. CURRFIFO_1,
  1528. CURRFIFO_NONE 0x3
  1529. }
  1530. }
  1531. const B_CURRFIFO_0 0x2
  1532. /*
  1533. * SCSI Bus Target IDs
  1534. * Bitmask of observed targets on the bus.
  1535. */
  1536. register BUSTARGID {
  1537. address 0x03E
  1538. access_mode RW
  1539. modes M_CFG
  1540. size 2
  1541. }
  1542. /*
  1543. * SCSI Control Signal Out
  1544. */
  1545. register SCSISIGO {
  1546. address 0x040
  1547. access_mode RW
  1548. modes M_DFF0, M_DFF1, M_SCSI
  1549. field CDO 0x80
  1550. field IOO 0x40
  1551. field MSGO 0x20
  1552. field ATNO 0x10
  1553. field SELO 0x08
  1554. field BSYO 0x04
  1555. field REQO 0x02
  1556. field ACKO 0x01
  1557. /*
  1558. * Possible phases to write into SCSISIG0
  1559. */
  1560. enum PHASE_MASK CDO|IOO|MSGO {
  1561. P_DATAOUT 0x0,
  1562. P_DATAIN IOO,
  1563. P_DATAOUT_DT P_DATAOUT|MSGO,
  1564. P_DATAIN_DT P_DATAIN|MSGO,
  1565. P_COMMAND CDO,
  1566. P_MESGOUT CDO|MSGO,
  1567. P_STATUS CDO|IOO,
  1568. P_MESGIN CDO|IOO|MSGO
  1569. }
  1570. }
  1571. /*
  1572. * SCSI Control Signal In
  1573. */
  1574. register SCSISIGI {
  1575. address 0x041
  1576. access_mode RO
  1577. modes M_DFF0, M_DFF1, M_SCSI
  1578. field CDI 0x80
  1579. field IOI 0x40
  1580. field MSGI 0x20
  1581. field ATNI 0x10
  1582. field SELI 0x08
  1583. field BSYI 0x04
  1584. field REQI 0x02
  1585. field ACKI 0x01
  1586. /*
  1587. * Possible phases in SCSISIGI
  1588. */
  1589. enum PHASE_MASK CDO|IOO|MSGO {
  1590. P_DATAOUT 0x0,
  1591. P_DATAIN IOO,
  1592. P_DATAOUT_DT P_DATAOUT|MSGO,
  1593. P_DATAIN_DT P_DATAIN|MSGO,
  1594. P_COMMAND CDO,
  1595. P_MESGOUT CDO|MSGO,
  1596. P_STATUS CDO|IOO,
  1597. P_MESGIN CDO|IOO|MSGO
  1598. }
  1599. }
  1600. /*
  1601. * Multiple Target IDs
  1602. * Bitmask of ids to respond as a target.
  1603. */
  1604. register MULTARGID {
  1605. address 0x040
  1606. access_mode RW
  1607. modes M_CFG
  1608. size 2
  1609. count 2
  1610. }
  1611. /*
  1612. * SCSI Phase
  1613. */
  1614. register SCSIPHASE {
  1615. address 0x042
  1616. access_mode RO
  1617. modes M_DFF0, M_DFF1, M_SCSI
  1618. field STATUS_PHASE 0x20
  1619. field COMMAND_PHASE 0x10
  1620. field MSG_IN_PHASE 0x08
  1621. field MSG_OUT_PHASE 0x04
  1622. field DATA_PHASE_MASK 0x03 {
  1623. DATA_OUT_PHASE 0x01,
  1624. DATA_IN_PHASE 0x02
  1625. }
  1626. }
  1627. /*
  1628. * SCSI Data 0 Image
  1629. */
  1630. register SCSIDAT0_IMG {
  1631. address 0x043
  1632. access_mode RW
  1633. modes M_DFF0, M_DFF1, M_SCSI
  1634. }
  1635. /*
  1636. * SCSI Latched Data
  1637. */
  1638. register SCSIDAT {
  1639. address 0x044
  1640. access_mode RW
  1641. modes M_DFF0, M_DFF1, M_SCSI
  1642. size 2
  1643. }
  1644. /*
  1645. * SCSI Data Bus
  1646. */
  1647. register SCSIBUS {
  1648. address 0x046
  1649. access_mode RW
  1650. modes M_DFF0, M_DFF1, M_SCSI
  1651. size 2
  1652. }
  1653. /*
  1654. * Target ID In
  1655. */
  1656. register TARGIDIN {
  1657. address 0x048
  1658. access_mode RO
  1659. modes M_DFF0, M_DFF1, M_SCSI
  1660. count 2
  1661. field CLKOUT 0x80
  1662. field TARGID 0x0F
  1663. }
  1664. /*
  1665. * Selection/Reselection ID
  1666. * Upper four bits are the device id. The ONEBIT is set when the re/selecting
  1667. * device did not set its own ID.
  1668. */
  1669. register SELID {
  1670. address 0x049
  1671. access_mode RW
  1672. modes M_DFF0, M_DFF1, M_SCSI
  1673. field SELID_MASK 0xf0
  1674. field ONEBIT 0x08
  1675. }
  1676. /*
  1677. * SCSI Block Control
  1678. * Controls Bus type and channel selection. SELWIDE allows for the
  1679. * coexistence of 8bit and 16bit devices on a wide bus.
  1680. */
  1681. register SBLKCTL {
  1682. address 0x04A
  1683. access_mode RW
  1684. modes M_DFF0, M_DFF1, M_SCSI
  1685. field DIAGLEDEN 0x80
  1686. field DIAGLEDON 0x40
  1687. field ENAB40 0x08 /* LVD transceiver active */
  1688. field ENAB20 0x04 /* SE/HVD transceiver active */
  1689. field SELWIDE 0x02
  1690. }
  1691. /*
  1692. * Option Mode
  1693. */
  1694. register OPTIONMODE {
  1695. address 0x04A
  1696. access_mode RW
  1697. modes M_CFG
  1698. count 4
  1699. field BIOSCANCTL 0x80
  1700. field AUTOACKEN 0x40
  1701. field BIASCANCTL 0x20
  1702. field BUSFREEREV 0x10
  1703. field ENDGFORMCHK 0x04
  1704. field AUTO_MSGOUT_DE 0x02
  1705. mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE
  1706. }
  1707. /*
  1708. * SCSI Status 0
  1709. */
  1710. register SSTAT0 {
  1711. address 0x04B
  1712. access_mode RO
  1713. modes M_DFF0, M_DFF1, M_SCSI
  1714. field TARGET 0x80 /* Board acting as target */
  1715. field SELDO 0x40 /* Selection Done */
  1716. field SELDI 0x20 /* Board has been selected */
  1717. field SELINGO 0x10 /* Selection In Progress */
  1718. field IOERR 0x08 /* LVD Tranceiver mode changed */
  1719. field OVERRUN 0x04 /* SCSI Offset overrun detected */
  1720. field SPIORDY 0x02 /* SCSI PIO Ready */
  1721. field ARBDO 0x01 /* Arbitration Done Out */
  1722. }
  1723. /*
  1724. * Clear SCSI Interrupt 0
  1725. * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
  1726. */
  1727. register CLRSINT0 {
  1728. address 0x04B
  1729. access_mode WO
  1730. modes M_DFF0, M_DFF1, M_SCSI
  1731. field CLRSELDO 0x40
  1732. field CLRSELDI 0x20
  1733. field CLRSELINGO 0x10
  1734. field CLRIOERR 0x08
  1735. field CLROVERRUN 0x04
  1736. field CLRSPIORDY 0x02
  1737. field CLRARBDO 0x01
  1738. }
  1739. /*
  1740. * SCSI Interrupt Mode 0
  1741. * Setting any bit will enable the corresponding function
  1742. * in SIMODE0 to interrupt via the IRQ pin.
  1743. */
  1744. register SIMODE0 {
  1745. address 0x04B
  1746. access_mode RW
  1747. modes M_CFG
  1748. count 8
  1749. field ENSELDO 0x40
  1750. field ENSELDI 0x20
  1751. field ENSELINGO 0x10
  1752. field ENIOERR 0x08
  1753. field ENOVERRUN 0x04
  1754. field ENSPIORDY 0x02
  1755. field ENARBDO 0x01
  1756. }
  1757. /*
  1758. * SCSI Status 1
  1759. */
  1760. register SSTAT1 {
  1761. address 0x04C
  1762. access_mode RO
  1763. modes M_DFF0, M_DFF1, M_SCSI
  1764. field SELTO 0x80
  1765. field ATNTARG 0x40
  1766. field SCSIRSTI 0x20
  1767. field PHASEMIS 0x10
  1768. field BUSFREE 0x08
  1769. field SCSIPERR 0x04
  1770. field STRB2FAST 0x02
  1771. field REQINIT 0x01
  1772. }
  1773. /*
  1774. * Clear SCSI Interrupt 1
  1775. * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
  1776. */
  1777. register CLRSINT1 {
  1778. address 0x04C
  1779. access_mode WO
  1780. modes M_DFF0, M_DFF1, M_SCSI
  1781. field CLRSELTIMEO 0x80
  1782. field CLRATNO 0x40
  1783. field CLRSCSIRSTI 0x20
  1784. field CLRBUSFREE 0x08
  1785. field CLRSCSIPERR 0x04
  1786. field CLRSTRB2FAST 0x02
  1787. field CLRREQINIT 0x01
  1788. }
  1789. /*
  1790. * SCSI Status 2
  1791. */
  1792. register SSTAT2 {
  1793. address 0x04d
  1794. access_mode RO
  1795. modes M_DFF0, M_DFF1, M_SCSI
  1796. field BUSFREETIME 0xc0 {
  1797. BUSFREE_LQO 0x40,
  1798. BUSFREE_DFF0 0x80,
  1799. BUSFREE_DFF1 0xC0
  1800. }
  1801. field NONPACKREQ 0x20
  1802. field EXP_ACTIVE 0x10 /* SCSI Expander Active */
  1803. field BSYX 0x08 /* Busy Expander */
  1804. field WIDE_RES 0x04 /* Modes 0 and 1 only */
  1805. field SDONE 0x02 /* Modes 0 and 1 only */
  1806. field DMADONE 0x01 /* Modes 0 and 1 only */
  1807. }
  1808. /*
  1809. * Clear SCSI Interrupt 2
  1810. */
  1811. register CLRSINT2 {
  1812. address 0x04D
  1813. access_mode WO
  1814. modes M_DFF0, M_DFF1, M_SCSI
  1815. field CLRNONPACKREQ 0x20
  1816. field CLRWIDE_RES 0x04 /* Modes 0 and 1 only */
  1817. field CLRSDONE 0x02 /* Modes 0 and 1 only */
  1818. field CLRDMADONE 0x01 /* Modes 0 and 1 only */
  1819. }
  1820. /*
  1821. * SCSI Interrupt Mode 2
  1822. */
  1823. register SIMODE2 {
  1824. address 0x04D
  1825. access_mode RW
  1826. modes M_CFG
  1827. field ENWIDE_RES 0x04
  1828. field ENSDONE 0x02
  1829. field ENDMADONE 0x01
  1830. }
  1831. /*
  1832. * Physical Error Diagnosis
  1833. */
  1834. register PERRDIAG {
  1835. address 0x04E
  1836. access_mode RO
  1837. modes M_DFF0, M_DFF1, M_SCSI
  1838. count 3
  1839. field HIZERO 0x80
  1840. field HIPERR 0x40
  1841. field PREVPHASE 0x20
  1842. field PARITYERR 0x10
  1843. field AIPERR 0x08
  1844. field CRCERR 0x04
  1845. field DGFORMERR 0x02
  1846. field DTERR 0x01
  1847. }
  1848. /*
  1849. * LQI Manager Current State
  1850. */
  1851. register LQISTATE {
  1852. address 0x04E
  1853. access_mode RO
  1854. modes M_CFG
  1855. count 6
  1856. }
  1857. /*
  1858. * SCSI Offset Count
  1859. */
  1860. register SOFFCNT {
  1861. address 0x04F
  1862. access_mode RO
  1863. modes M_DFF0, M_DFF1, M_SCSI
  1864. count 1
  1865. }
  1866. /*
  1867. * LQO Manager Current State
  1868. */
  1869. register LQOSTATE {
  1870. address 0x04F
  1871. access_mode RO
  1872. modes M_CFG
  1873. count 2
  1874. }
  1875. /*
  1876. * LQI Manager Status
  1877. */
  1878. register LQISTAT0 {
  1879. address 0x050
  1880. access_mode RO
  1881. modes M_DFF0, M_DFF1, M_SCSI
  1882. count 2
  1883. field LQIATNQAS 0x20
  1884. field LQICRCT1 0x10
  1885. field LQICRCT2 0x08
  1886. field LQIBADLQT 0x04
  1887. field LQIATNLQ 0x02
  1888. field LQIATNCMD 0x01
  1889. }
  1890. /*
  1891. * Clear LQI Interrupts 0
  1892. */
  1893. register CLRLQIINT0 {
  1894. address 0x050
  1895. access_mode WO
  1896. modes M_DFF0, M_DFF1, M_SCSI
  1897. count 1
  1898. field CLRLQIATNQAS 0x20
  1899. field CLRLQICRCT1 0x10
  1900. field CLRLQICRCT2 0x08
  1901. field CLRLQIBADLQT 0x04
  1902. field CLRLQIATNLQ 0x02
  1903. field CLRLQIATNCMD 0x01
  1904. }
  1905. /*
  1906. * LQI Manager Interrupt Mode 0
  1907. */
  1908. register LQIMODE0 {
  1909. address 0x050
  1910. access_mode RW
  1911. modes M_CFG
  1912. count 3
  1913. field ENLQIATNQASK 0x20
  1914. field ENLQICRCT1 0x10
  1915. field ENLQICRCT2 0x08
  1916. field ENLQIBADLQT 0x04
  1917. field ENLQIATNLQ 0x02
  1918. field ENLQIATNCMD 0x01
  1919. }
  1920. /*
  1921. * LQI Manager Status 1
  1922. */
  1923. register LQISTAT1 {
  1924. address 0x051
  1925. access_mode RO
  1926. modes M_DFF0, M_DFF1, M_SCSI
  1927. count 3
  1928. field LQIPHASE_LQ 0x80
  1929. field LQIPHASE_NLQ 0x40
  1930. field LQIABORT 0x20
  1931. field LQICRCI_LQ 0x10
  1932. field LQICRCI_NLQ 0x08
  1933. field LQIBADLQI 0x04
  1934. field LQIOVERI_LQ 0x02
  1935. field LQIOVERI_NLQ 0x01
  1936. }
  1937. /*
  1938. * Clear LQI Manager Interrupts1
  1939. */
  1940. register CLRLQIINT1 {
  1941. address 0x051
  1942. access_mode WO
  1943. modes M_DFF0, M_DFF1, M_SCSI
  1944. count 4
  1945. field CLRLQIPHASE_LQ 0x80
  1946. field CLRLQIPHASE_NLQ 0x40
  1947. field CLRLIQABORT 0x20
  1948. field CLRLQICRCI_LQ 0x10
  1949. field CLRLQICRCI_NLQ 0x08
  1950. field CLRLQIBADLQI 0x04
  1951. field CLRLQIOVERI_LQ 0x02
  1952. field CLRLQIOVERI_NLQ 0x01
  1953. }
  1954. /*
  1955. * LQI Manager Interrupt Mode 1
  1956. */
  1957. register LQIMODE1 {
  1958. address 0x051
  1959. access_mode RW
  1960. modes M_CFG
  1961. count 4
  1962. field ENLQIPHASE_LQ 0x80 /* LQIPHASE1 */
  1963. field ENLQIPHASE_NLQ 0x40 /* LQIPHASE2 */
  1964. field ENLIQABORT 0x20
  1965. field ENLQICRCI_LQ 0x10 /* LQICRCI1 */
  1966. field ENLQICRCI_NLQ 0x08 /* LQICRCI2 */
  1967. field ENLQIBADLQI 0x04
  1968. field ENLQIOVERI_LQ 0x02 /* LQIOVERI1 */
  1969. field ENLQIOVERI_NLQ 0x01 /* LQIOVERI2 */
  1970. }
  1971. /*
  1972. * LQI Manager Status 2
  1973. */
  1974. register LQISTAT2 {
  1975. address 0x052
  1976. access_mode RO
  1977. modes M_DFF0, M_DFF1, M_SCSI
  1978. field PACKETIZED 0x80
  1979. field LQIPHASE_OUTPKT 0x40
  1980. field LQIWORKONLQ 0x20
  1981. field LQIWAITFIFO 0x10
  1982. field LQISTOPPKT 0x08
  1983. field LQISTOPLQ 0x04
  1984. field LQISTOPCMD 0x02
  1985. field LQIGSAVAIL 0x01
  1986. }
  1987. /*
  1988. * SCSI Status 3
  1989. */
  1990. register SSTAT3 {
  1991. address 0x053
  1992. access_mode RO
  1993. modes M_DFF0, M_DFF1, M_SCSI
  1994. count 3
  1995. field NTRAMPERR 0x02
  1996. field OSRAMPERR 0x01
  1997. }
  1998. /*
  1999. * Clear SCSI Status 3
  2000. */
  2001. register CLRSINT3 {
  2002. address 0x053
  2003. access_mode WO
  2004. modes M_DFF0, M_DFF1, M_SCSI
  2005. count 3
  2006. field CLRNTRAMPERR 0x02
  2007. field CLROSRAMPERR 0x01
  2008. }
  2009. /*
  2010. * SCSI Interrupt Mode 3
  2011. */
  2012. register SIMODE3 {
  2013. address 0x053
  2014. access_mode RW
  2015. modes M_CFG
  2016. count 4
  2017. field ENNTRAMPERR 0x02
  2018. field ENOSRAMPERR 0x01
  2019. }
  2020. /*
  2021. * LQO Manager Status 0
  2022. */
  2023. register LQOSTAT0 {
  2024. address 0x054
  2025. access_mode RO
  2026. modes M_DFF0, M_DFF1, M_SCSI
  2027. count 2
  2028. field LQOTARGSCBPERR 0x10
  2029. field LQOSTOPT2 0x08
  2030. field LQOATNLQ 0x04
  2031. field LQOATNPKT 0x02
  2032. field LQOTCRC 0x01
  2033. }
  2034. /*
  2035. * Clear LQO Manager interrupt 0
  2036. */
  2037. register CLRLQOINT0 {
  2038. address 0x054
  2039. access_mode WO
  2040. modes M_DFF0, M_DFF1, M_SCSI
  2041. count 3
  2042. field CLRLQOTARGSCBPERR 0x10
  2043. field CLRLQOSTOPT2 0x08
  2044. field CLRLQOATNLQ 0x04
  2045. field CLRLQOATNPKT 0x02
  2046. field CLRLQOTCRC 0x01
  2047. }
  2048. /*
  2049. * LQO Manager Interrupt Mode 0
  2050. */
  2051. register LQOMODE0 {
  2052. address 0x054
  2053. access_mode RW
  2054. modes M_CFG
  2055. count 4
  2056. field ENLQOTARGSCBPERR 0x10
  2057. field ENLQOSTOPT2 0x08
  2058. field ENLQOATNLQ 0x04
  2059. field ENLQOATNPKT 0x02
  2060. field ENLQOTCRC 0x01
  2061. }
  2062. /*
  2063. * LQO Manager Status 1
  2064. */
  2065. register LQOSTAT1 {
  2066. address 0x055
  2067. access_mode RO
  2068. modes M_DFF0, M_DFF1, M_SCSI
  2069. field LQOINITSCBPERR 0x10
  2070. field LQOSTOPI2 0x08
  2071. field LQOBADQAS 0x04
  2072. field LQOBUSFREE 0x02
  2073. field LQOPHACHGINPKT 0x01
  2074. }
  2075. /*
  2076. * Clear LOQ Interrupt 1
  2077. */
  2078. register CLRLQOINT1 {
  2079. address 0x055
  2080. access_mode WO
  2081. modes M_DFF0, M_DFF1, M_SCSI
  2082. count 7
  2083. field CLRLQOINITSCBPERR 0x10
  2084. field CLRLQOSTOPI2 0x08
  2085. field CLRLQOBADQAS 0x04
  2086. field CLRLQOBUSFREE 0x02
  2087. field CLRLQOPHACHGINPKT 0x01
  2088. }
  2089. /*
  2090. * LQO Manager Interrupt Mode 1
  2091. */
  2092. register LQOMODE1 {
  2093. address 0x055
  2094. access_mode RW
  2095. modes M_CFG
  2096. count 4
  2097. field ENLQOINITSCBPERR 0x10
  2098. field ENLQOSTOPI2 0x08
  2099. field ENLQOBADQAS 0x04
  2100. field ENLQOBUSFREE 0x02
  2101. field ENLQOPHACHGINPKT 0x01
  2102. }
  2103. /*
  2104. * LQO Manager Status 2
  2105. */
  2106. register LQOSTAT2 {
  2107. address 0x056
  2108. access_mode RO
  2109. modes M_DFF0, M_DFF1, M_SCSI
  2110. field LQOPKT 0xE0
  2111. field LQOWAITFIFO 0x10
  2112. field LQOPHACHGOUTPKT 0x02 /* outside of packet boundaries. */
  2113. field LQOSTOP0 0x01 /* Stopped after sending all packets */
  2114. }
  2115. /*
  2116. * Output Synchronizer Space Count
  2117. */
  2118. register OS_SPACE_CNT {
  2119. address 0x056
  2120. access_mode RO
  2121. modes M_CFG
  2122. count 2
  2123. }
  2124. /*
  2125. * SCSI Interrupt Mode 1
  2126. * Setting any bit will enable the corresponding function
  2127. * in SIMODE1 to interrupt via the IRQ pin.
  2128. */
  2129. register SIMODE1 {
  2130. address 0x057
  2131. access_mode RW
  2132. modes M_DFF0, M_DFF1, M_SCSI
  2133. field ENSELTIMO 0x80
  2134. field ENATNTARG 0x40
  2135. field ENSCSIRST 0x20
  2136. field ENPHASEMIS 0x10
  2137. field ENBUSFREE 0x08
  2138. field ENSCSIPERR 0x04
  2139. field ENSTRB2FAST 0x02
  2140. field ENREQINIT 0x01
  2141. }
  2142. /*
  2143. * Good Status FIFO
  2144. */
  2145. register GSFIFO {
  2146. address 0x058
  2147. access_mode RO
  2148. size 2
  2149. modes M_DFF0, M_DFF1, M_SCSI
  2150. }
  2151. /*
  2152. * Data FIFO SCSI Transfer Control
  2153. */
  2154. register DFFSXFRCTL {
  2155. address 0x05A
  2156. access_mode RW
  2157. modes M_DFF0, M_DFF1
  2158. field DFFBITBUCKET 0x08
  2159. field CLRSHCNT 0x04
  2160. field CLRCHN 0x02
  2161. field RSTCHN 0x01
  2162. }
  2163. /*
  2164. * Next SCSI Control Block
  2165. */
  2166. register NEXTSCB {
  2167. address 0x05A
  2168. access_mode RW
  2169. size 2
  2170. modes M_SCSI
  2171. }
  2172. /*
  2173. * LQO SCSI Control
  2174. * (Rev B only.)
  2175. */
  2176. register LQOSCSCTL {
  2177. address 0x05A
  2178. access_mode RW
  2179. size 1
  2180. modes M_CFG
  2181. count 1
  2182. field LQOH2A_VERSION 0x80
  2183. field LQOBUSETDLY 0x40
  2184. field LQONOHOLDLACK 0x02
  2185. field LQONOCHKOVER 0x01
  2186. }
  2187. /*
  2188. * SEQ Interrupts
  2189. */
  2190. register SEQINTSRC {
  2191. address 0x05B
  2192. access_mode RO
  2193. modes M_DFF0, M_DFF1
  2194. field CTXTDONE 0x40
  2195. field SAVEPTRS 0x20
  2196. field CFG4DATA 0x10
  2197. field CFG4ISTAT 0x08
  2198. field CFG4TSTAT 0x04
  2199. field CFG4ICMD 0x02
  2200. field CFG4TCMD 0x01
  2201. }
  2202. /*
  2203. * Clear Arp Interrupts
  2204. */
  2205. register CLRSEQINTSRC {
  2206. address 0x05B
  2207. access_mode WO
  2208. modes M_DFF0, M_DFF1
  2209. field CLRCTXTDONE 0x40
  2210. field CLRSAVEPTRS 0x20
  2211. field CLRCFG4DATA 0x10
  2212. field CLRCFG4ISTAT 0x08
  2213. field CLRCFG4TSTAT 0x04
  2214. field CLRCFG4ICMD 0x02
  2215. field CLRCFG4TCMD 0x01
  2216. }
  2217. /*
  2218. * SEQ Interrupt Enabled (Shared)
  2219. */
  2220. register SEQIMODE {
  2221. address 0x05C
  2222. access_mode RW
  2223. modes M_DFF0, M_DFF1
  2224. field ENCTXTDONE 0x40
  2225. field ENSAVEPTRS 0x20
  2226. field ENCFG4DATA 0x10
  2227. field ENCFG4ISTAT 0x08
  2228. field ENCFG4TSTAT 0x04
  2229. field ENCFG4ICMD 0x02
  2230. field ENCFG4TCMD 0x01
  2231. }
  2232. /*
  2233. * Current SCSI Control Block
  2234. */
  2235. register CURRSCB {
  2236. address 0x05C
  2237. access_mode RW
  2238. size 2
  2239. modes M_SCSI
  2240. }
  2241. /*
  2242. * Data FIFO Status
  2243. */
  2244. register MDFFSTAT {
  2245. address 0x05D
  2246. access_mode RO
  2247. modes M_DFF0, M_DFF1
  2248. field SHCNTNEGATIVE 0x40 /* Rev B or higher */
  2249. field SHCNTMINUS1 0x20 /* Rev B or higher */
  2250. field LASTSDONE 0x10
  2251. field SHVALID 0x08
  2252. field DLZERO 0x04 /* FIFO data ends on packet boundary. */
  2253. field DATAINFIFO 0x02
  2254. field FIFOFREE 0x01
  2255. }
  2256. /*
  2257. * CRC Control
  2258. */
  2259. register CRCCONTROL {
  2260. address 0x05d
  2261. access_mode RW
  2262. modes M_CFG
  2263. field CRCVALCHKEN 0x40
  2264. }
  2265. /*
  2266. * SCSI Test Control
  2267. */
  2268. register SCSITEST {
  2269. address 0x05E
  2270. access_mode RW
  2271. modes M_CFG
  2272. field CNTRTEST 0x08
  2273. field SEL_TXPLL_DEBUG 0x04
  2274. }
  2275. /*
  2276. * Data FIFO Queue Tag
  2277. */
  2278. register DFFTAG {
  2279. address 0x05E
  2280. access_mode RW
  2281. size 2
  2282. modes M_DFF0, M_DFF1
  2283. }
  2284. /*
  2285. * Last SCSI Control Block
  2286. */
  2287. register LASTSCB {
  2288. address 0x05E
  2289. access_mode RW
  2290. size 2
  2291. modes M_SCSI
  2292. }
  2293. /*
  2294. * SCSI I/O Cell Power-down Control
  2295. */
  2296. register IOPDNCTL {
  2297. address 0x05F
  2298. access_mode RW
  2299. modes M_CFG
  2300. field DISABLE_OE 0x80
  2301. field PDN_IDIST 0x04
  2302. field PDN_DIFFSENSE 0x01
  2303. }
  2304. /*
  2305. * Shaddow Host Address.
  2306. */
  2307. register SHADDR {
  2308. address 0x060
  2309. access_mode RO
  2310. size 8
  2311. modes M_DFF0, M_DFF1
  2312. }
  2313. /*
  2314. * Data Group CRC Interval.
  2315. */
  2316. register DGRPCRCI {
  2317. address 0x060
  2318. access_mode RW
  2319. size 2
  2320. modes M_CFG
  2321. }
  2322. /*
  2323. * Data Transfer Negotiation Address
  2324. */
  2325. register NEGOADDR {
  2326. address 0x060
  2327. access_mode RW
  2328. modes M_SCSI
  2329. }
  2330. /*
  2331. * Data Transfer Negotiation Data - Period Byte
  2332. */
  2333. register NEGPERIOD {
  2334. address 0x061
  2335. access_mode RW
  2336. modes M_SCSI
  2337. count 1
  2338. }
  2339. /*
  2340. * Packetized CRC Interval
  2341. */
  2342. register PACKCRCI {
  2343. address 0x062
  2344. access_mode RW
  2345. size 2
  2346. modes M_CFG
  2347. }
  2348. /*
  2349. * Data Transfer Negotiation Data - Offset Byte
  2350. */
  2351. register NEGOFFSET {
  2352. address 0x062
  2353. access_mode RW
  2354. modes M_SCSI
  2355. count 1
  2356. }
  2357. /*
  2358. * Data Transfer Negotiation Data - PPR Options
  2359. */
  2360. register NEGPPROPTS {
  2361. address 0x063
  2362. access_mode RW
  2363. modes M_SCSI
  2364. count 1
  2365. field PPROPT_PACE 0x08
  2366. field PPROPT_QAS 0x04
  2367. field PPROPT_DT 0x02
  2368. field PPROPT_IUT 0x01
  2369. }
  2370. /*
  2371. * Data Transfer Negotiation Data - Connection Options
  2372. */
  2373. register NEGCONOPTS {
  2374. address 0x064
  2375. access_mode RW
  2376. modes M_SCSI
  2377. field ENSNAPSHOT 0x40
  2378. field RTI_WRTDIS 0x20
  2379. field RTI_OVRDTRN 0x10
  2380. field ENSLOWCRC 0x08
  2381. field ENAUTOATNI 0x04
  2382. field ENAUTOATNO 0x02
  2383. field WIDEXFER 0x01
  2384. }
  2385. /*
  2386. * Negotiation Table Annex Column Index.
  2387. */
  2388. register ANNEXCOL {
  2389. address 0x065
  2390. access_mode RW
  2391. modes M_SCSI
  2392. count 7
  2393. }
  2394. /*
  2395. * SCSI Check
  2396. * (Rev. B only)
  2397. */
  2398. register SCSCHKN {
  2399. address 0x066
  2400. access_mode RW
  2401. modes M_CFG
  2402. count 1
  2403. field BIDICHKDIS 0x80
  2404. field STSELSKIDDIS 0x40
  2405. field CURRFIFODEF 0x20
  2406. field WIDERESEN 0x10
  2407. field SDONEMSKDIS 0x08
  2408. field DFFACTCLR 0x04
  2409. field SHVALIDSTDIS 0x02
  2410. field LSTSGCLRDIS 0x01
  2411. }
  2412. const AHD_ANNEXCOL_PER_DEV0 4
  2413. const AHD_NUM_PER_DEV_ANNEXCOLS 4
  2414. const AHD_ANNEXCOL_PRECOMP_SLEW 4
  2415. const AHD_PRECOMP_MASK 0x07
  2416. const AHD_PRECOMP_SHIFT 0
  2417. const AHD_PRECOMP_CUTBACK_17 0x04
  2418. const AHD_PRECOMP_CUTBACK_29 0x06
  2419. const AHD_PRECOMP_CUTBACK_37 0x07
  2420. const AHD_SLEWRATE_MASK 0x78
  2421. const AHD_SLEWRATE_SHIFT 3
  2422. /*
  2423. * Rev A has only a single bit (high bit of field) of slew adjustment.
  2424. * Rev B has 4 bits. The current default happens to be the same for both.
  2425. */
  2426. const AHD_SLEWRATE_DEF_REVA 0x08
  2427. const AHD_SLEWRATE_DEF_REVB 0x08
  2428. /* Rev A does not have any amplitude setting. */
  2429. const AHD_ANNEXCOL_AMPLITUDE 6
  2430. const AHD_AMPLITUDE_MASK 0x7
  2431. const AHD_AMPLITUDE_SHIFT 0
  2432. const AHD_AMPLITUDE_DEF 0x7
  2433. /*
  2434. * Negotiation Table Annex Data Port.
  2435. */
  2436. register ANNEXDAT {
  2437. address 0x066
  2438. access_mode RW
  2439. modes M_SCSI
  2440. count 3
  2441. }
  2442. /*
  2443. * Initiator's Own Id.
  2444. * The SCSI ID to use for Selection Out and seen during a reselection..
  2445. */
  2446. register IOWNID {
  2447. address 0x067
  2448. access_mode RW
  2449. modes M_SCSI
  2450. }
  2451. /*
  2452. * 960MHz Phase-Locked Loop Control 0
  2453. */
  2454. register PLL960CTL0 {
  2455. address 0x068
  2456. access_mode RW
  2457. modes M_CFG
  2458. field PLL_VCOSEL 0x80
  2459. field PLL_PWDN 0x40
  2460. field PLL_NS 0x30
  2461. field PLL_ENLUD 0x08
  2462. field PLL_ENLPF 0x04
  2463. field PLL_DLPF 0x02
  2464. field PLL_ENFBM 0x01
  2465. }
  2466. /*
  2467. * Target Own Id
  2468. */
  2469. register TOWNID {
  2470. address 0x069
  2471. access_mode RW
  2472. modes M_SCSI
  2473. count 2
  2474. }
  2475. /*
  2476. * 960MHz Phase-Locked Loop Control 1
  2477. */
  2478. register PLL960CTL1 {
  2479. address 0x069
  2480. access_mode RW
  2481. modes M_CFG
  2482. field PLL_CNTEN 0x80
  2483. field PLL_CNTCLR 0x40
  2484. field PLL_RST 0x01
  2485. }
  2486. /*
  2487. * Expander Signature
  2488. */
  2489. register XSIG {
  2490. address 0x06A
  2491. access_mode RW
  2492. modes M_SCSI
  2493. }
  2494. /*
  2495. * Shadow Byte Count
  2496. */
  2497. register SHCNT {
  2498. address 0x068
  2499. access_mode RW
  2500. size 3
  2501. modes M_DFF0, M_DFF1
  2502. }
  2503. /*
  2504. * Selection Out ID
  2505. */
  2506. register SELOID {
  2507. address 0x06B
  2508. access_mode RW
  2509. modes M_SCSI
  2510. }
  2511. /*
  2512. * 960-MHz Phase-Locked Loop Test Count
  2513. */
  2514. register PLL960CNT0 {
  2515. address 0x06A
  2516. access_mode RO
  2517. size 2
  2518. modes M_CFG
  2519. }
  2520. /*
  2521. * 400-MHz Phase-Locked Loop Control 0
  2522. */
  2523. register PLL400CTL0 {
  2524. address 0x06C
  2525. access_mode RW
  2526. modes M_CFG
  2527. field PLL_VCOSEL 0x80
  2528. field PLL_PWDN 0x40
  2529. field PLL_NS 0x30
  2530. field PLL_ENLUD 0x08
  2531. field PLL_ENLPF 0x04
  2532. field PLL_DLPF 0x02
  2533. field PLL_ENFBM 0x01
  2534. }
  2535. /*
  2536. * Arbitration Fairness
  2537. */
  2538. register FAIRNESS {
  2539. address 0x06C
  2540. access_mode RW
  2541. size 2
  2542. modes M_SCSI
  2543. }
  2544. /*
  2545. * 400-MHz Phase-Locked Loop Control 1
  2546. */
  2547. register PLL400CTL1 {
  2548. address 0x06D
  2549. access_mode RW
  2550. modes M_CFG
  2551. field PLL_CNTEN 0x80
  2552. field PLL_CNTCLR 0x40
  2553. field PLL_RST 0x01
  2554. }
  2555. /*
  2556. * Arbitration Unfairness
  2557. */
  2558. register UNFAIRNESS {
  2559. address 0x06E
  2560. access_mode RW
  2561. size 2
  2562. modes M_SCSI
  2563. }
  2564. /*
  2565. * 400-MHz Phase-Locked Loop Test Count
  2566. */
  2567. register PLL400CNT0 {
  2568. address 0x06E
  2569. access_mode RO
  2570. size 2
  2571. modes M_CFG
  2572. }
  2573. /*
  2574. * SCB Page Pointer
  2575. */
  2576. register SCBPTR {
  2577. address 0x0A8
  2578. access_mode RW
  2579. size 2
  2580. modes M_DFF0, M_DFF1, M_CCHAN, M_SCSI
  2581. }
  2582. /*
  2583. * CMC SCB Array Count
  2584. * Number of bytes to transfer between CMC SCB memory and SCBRAM.
  2585. * Transfers must be 8byte aligned and sized.
  2586. */
  2587. register CCSCBACNT {
  2588. address 0x0AB
  2589. access_mode RW
  2590. modes M_CCHAN
  2591. }
  2592. /*
  2593. * SCB Autopointer
  2594. * SCB-Next Address Snooping logic. When an SCB is transferred to
  2595. * the card, the next SCB address to be used by the CMC array can
  2596. * be autoloaded from that transfer.
  2597. */
  2598. register SCBAUTOPTR {
  2599. address 0x0AB
  2600. access_mode RW
  2601. modes M_CFG
  2602. count 1
  2603. field AUSCBPTR_EN 0x80
  2604. field SCBPTR_ADDR 0x38
  2605. field SCBPTR_OFF 0x07
  2606. }
  2607. /*
  2608. * CMC SG Ram Address Pointer
  2609. */
  2610. register CCSGADDR {
  2611. address 0x0AC
  2612. access_mode RW
  2613. modes M_DFF0, M_DFF1
  2614. }
  2615. /*
  2616. * CMC SCB RAM Address Pointer
  2617. */
  2618. register CCSCBADDR {
  2619. address 0x0AC
  2620. access_mode RW
  2621. modes M_CCHAN
  2622. }
  2623. /*
  2624. * CMC SCB Ram Back-up Address Pointer
  2625. * Indicates the true stop location of transfers halted prior
  2626. * to SCBHCNT going to 0.
  2627. */
  2628. register CCSCBADR_BK {
  2629. address 0x0AC
  2630. access_mode RO
  2631. modes M_CFG
  2632. }
  2633. /*
  2634. * CMC SG Control
  2635. */
  2636. register CCSGCTL {
  2637. address 0x0AD
  2638. access_mode RW
  2639. modes M_DFF0, M_DFF1
  2640. field CCSGDONE 0x80
  2641. field SG_CACHE_AVAIL 0x10
  2642. field CCSGENACK 0x08
  2643. mask CCSGEN 0x0C
  2644. field SG_FETCH_REQ 0x02
  2645. field CCSGRESET 0x01
  2646. }
  2647. /*
  2648. * CMD SCB Control
  2649. */
  2650. register CCSCBCTL {
  2651. address 0x0AD
  2652. access_mode RW
  2653. modes M_CCHAN
  2654. field CCSCBDONE 0x80
  2655. field ARRDONE 0x40
  2656. field CCARREN 0x10
  2657. field CCSCBEN 0x08
  2658. field CCSCBDIR 0x04
  2659. field CCSCBRESET 0x01
  2660. }
  2661. /*
  2662. * CMC Ram BIST
  2663. */
  2664. register CMC_RAMBIST {
  2665. address 0x0AD
  2666. access_mode RW
  2667. modes M_CFG
  2668. field SG_ELEMENT_SIZE 0x80
  2669. field SCBRAMBIST_FAIL 0x40
  2670. field SG_BIST_FAIL 0x20
  2671. field SG_BIST_EN 0x10
  2672. field CMC_BUFFER_BIST_FAIL 0x02
  2673. field CMC_BUFFER_BIST_EN 0x01
  2674. }
  2675. /*
  2676. * CMC SG RAM Data Port
  2677. */
  2678. register CCSGRAM {
  2679. address 0x0B0
  2680. access_mode RW
  2681. modes M_DFF0, M_DFF1
  2682. }
  2683. /*
  2684. * CMC SCB RAM Data Port
  2685. */
  2686. register CCSCBRAM {
  2687. address 0x0B0
  2688. access_mode RW
  2689. modes M_CCHAN
  2690. }
  2691. /*
  2692. * Flex DMA Address.
  2693. */
  2694. register FLEXADR {
  2695. address 0x0B0
  2696. access_mode RW
  2697. size 3
  2698. modes M_SCSI
  2699. }
  2700. /*
  2701. * Flex DMA Byte Count
  2702. */
  2703. register FLEXCNT {
  2704. address 0x0B3
  2705. access_mode RW
  2706. size 2
  2707. modes M_SCSI
  2708. }
  2709. /*
  2710. * Flex DMA Status
  2711. */
  2712. register FLEXDMASTAT {
  2713. address 0x0B5
  2714. access_mode RW
  2715. modes M_SCSI
  2716. field FLEXDMAERR 0x02
  2717. field FLEXDMADONE 0x01
  2718. }
  2719. /*
  2720. * Flex DMA Data Port
  2721. */
  2722. register FLEXDATA {
  2723. address 0x0B6
  2724. access_mode RW
  2725. modes M_SCSI
  2726. }
  2727. /*
  2728. * Board Data
  2729. */
  2730. register BRDDAT {
  2731. address 0x0B8
  2732. access_mode RW
  2733. modes M_SCSI
  2734. count 2
  2735. }
  2736. /*
  2737. * Board Control
  2738. */
  2739. register BRDCTL {
  2740. address 0x0B9
  2741. access_mode RW
  2742. modes M_SCSI
  2743. count 7
  2744. field FLXARBACK 0x80
  2745. field FLXARBREQ 0x40
  2746. field BRDADDR 0x38
  2747. field BRDEN 0x04
  2748. field BRDRW 0x02
  2749. field BRDSTB 0x01
  2750. }
  2751. /*
  2752. * Serial EEPROM Address
  2753. */
  2754. register SEEADR {
  2755. address 0x0BA
  2756. access_mode RW
  2757. modes M_SCSI
  2758. count 4
  2759. }
  2760. /*
  2761. * Serial EEPROM Data
  2762. */
  2763. register SEEDAT {
  2764. address 0x0BC
  2765. access_mode RW
  2766. size 2
  2767. modes M_SCSI
  2768. count 4
  2769. }
  2770. /*
  2771. * Serial EEPROM Status
  2772. */
  2773. register SEESTAT {
  2774. address 0x0BE
  2775. access_mode RO
  2776. modes M_SCSI
  2777. count 1
  2778. field INIT_DONE 0x80
  2779. field SEEOPCODE 0x70
  2780. field LDALTID_L 0x08
  2781. field SEEARBACK 0x04
  2782. field SEEBUSY 0x02
  2783. field SEESTART 0x01
  2784. }
  2785. /*
  2786. * Serial EEPROM Control
  2787. */
  2788. register SEECTL {
  2789. address 0x0BE
  2790. access_mode RW
  2791. modes M_SCSI
  2792. count 4
  2793. field SEEOPCODE 0x70 {
  2794. SEEOP_ERASE 0x70,
  2795. SEEOP_READ 0x60,
  2796. SEEOP_WRITE 0x50,
  2797. /*
  2798. * The following four commands use special
  2799. * addresses for differentiation.
  2800. */
  2801. SEEOP_ERAL 0x40
  2802. }
  2803. mask SEEOP_EWEN 0x40
  2804. mask SEEOP_WALL 0x40
  2805. mask SEEOP_EWDS 0x40
  2806. field SEERST 0x02
  2807. field SEESTART 0x01
  2808. }
  2809. const SEEOP_ERAL_ADDR 0x80
  2810. const SEEOP_EWEN_ADDR 0xC0
  2811. const SEEOP_WRAL_ADDR 0x40
  2812. const SEEOP_EWDS_ADDR 0x00
  2813. /*
  2814. * SCB Counter
  2815. */
  2816. register SCBCNT {
  2817. address 0x0BF
  2818. access_mode RW
  2819. modes M_SCSI
  2820. }
  2821. /*
  2822. * Data FIFO Write Address
  2823. * Pointer to the next QWD location to be written to the data FIFO.
  2824. */
  2825. register DFWADDR {
  2826. address 0x0C0
  2827. access_mode RW
  2828. size 2
  2829. modes M_DFF0, M_DFF1
  2830. }
  2831. /*
  2832. * DSP Filter Control
  2833. */
  2834. register DSPFLTRCTL {
  2835. address 0x0C0
  2836. access_mode RW
  2837. modes M_CFG
  2838. field FLTRDISABLE 0x20
  2839. field EDGESENSE 0x10
  2840. field DSPFCNTSEL 0x0F
  2841. }
  2842. /*
  2843. * DSP Data Channel Control
  2844. */
  2845. register DSPDATACTL {
  2846. address 0x0C1
  2847. access_mode RW
  2848. modes M_CFG
  2849. count 3
  2850. field BYPASSENAB 0x80
  2851. field DESQDIS 0x10
  2852. field RCVROFFSTDIS 0x04
  2853. field XMITOFFSTDIS 0x02
  2854. }
  2855. /*
  2856. * Data FIFO Read Address
  2857. * Pointer to the next QWD location to be read from the data FIFO.
  2858. */
  2859. register DFRADDR {
  2860. address 0x0C2
  2861. access_mode RW
  2862. size 2
  2863. modes M_DFF0, M_DFF1
  2864. }
  2865. /*
  2866. * DSP REQ Control
  2867. */
  2868. register DSPREQCTL {
  2869. address 0x0C2
  2870. access_mode RW
  2871. modes M_CFG
  2872. field MANREQCTL 0xC0
  2873. field MANREQDLY 0x3F
  2874. }
  2875. /*
  2876. * DSP ACK Control
  2877. */
  2878. register DSPACKCTL {
  2879. address 0x0C3
  2880. access_mode RW
  2881. modes M_CFG
  2882. field MANACKCTL 0xC0
  2883. field MANACKDLY 0x3F
  2884. }
  2885. /*
  2886. * Data FIFO Data
  2887. * Read/Write byte port into the data FIFO. The read and write
  2888. * FIFO pointers increment with each read and write respectively
  2889. * to this port.
  2890. */
  2891. register DFDAT {
  2892. address 0x0C4
  2893. access_mode RW
  2894. modes M_DFF0, M_DFF1
  2895. }
  2896. /*
  2897. * DSP Channel Select
  2898. */
  2899. register DSPSELECT {
  2900. address 0x0C4
  2901. access_mode RW
  2902. modes M_CFG
  2903. count 1
  2904. field AUTOINCEN 0x80
  2905. field DSPSEL 0x1F
  2906. }
  2907. const NUMDSPS 0x14
  2908. /*
  2909. * Write Bias Control
  2910. */
  2911. register WRTBIASCTL {
  2912. address 0x0C5
  2913. access_mode WO
  2914. modes M_CFG
  2915. count 3
  2916. field AUTOXBCDIS 0x80
  2917. field XMITMANVAL 0x3F
  2918. }
  2919. /*
  2920. * Currently the WRTBIASCTL is the same as the default.
  2921. */
  2922. const WRTBIASCTL_HP_DEFAULT 0x0
  2923. /*
  2924. * Receiver Bias Control
  2925. */
  2926. register RCVRBIOSCTL {
  2927. address 0x0C6
  2928. access_mode WO
  2929. modes M_CFG
  2930. field AUTORBCDIS 0x80
  2931. field RCVRMANVAL 0x3F
  2932. }
  2933. /*
  2934. * Write Bias Calculator
  2935. */
  2936. register WRTBIASCALC {
  2937. address 0x0C7
  2938. access_mode RO
  2939. modes M_CFG
  2940. }
  2941. /*
  2942. * Data FIFO Pointers
  2943. * Contains the byte offset from DFWADDR and DWRADDR to the current
  2944. * FIFO write/read locations.
  2945. */
  2946. register DFPTRS {
  2947. address 0x0C8
  2948. access_mode RW
  2949. modes M_DFF0, M_DFF1
  2950. }
  2951. /*
  2952. * Receiver Bias Calculator
  2953. */
  2954. register RCVRBIASCALC {
  2955. address 0x0C8
  2956. access_mode RO
  2957. modes M_CFG
  2958. }
  2959. /*
  2960. * Data FIFO Backup Read Pointer
  2961. * Contains the data FIFO address to be restored if the last
  2962. * data accessed from the data FIFO was not transferred successfully.
  2963. */
  2964. register DFBKPTR {
  2965. address 0x0C9
  2966. access_mode RW
  2967. size 2
  2968. modes M_DFF0, M_DFF1
  2969. }
  2970. /*
  2971. * Skew Calculator
  2972. */
  2973. register SKEWCALC {
  2974. address 0x0C9
  2975. access_mode RO
  2976. modes M_CFG
  2977. }
  2978. /*
  2979. * Data FIFO Debug Control
  2980. */
  2981. register DFDBCTL {
  2982. address 0x0CB
  2983. access_mode RW
  2984. modes M_DFF0, M_DFF1
  2985. field DFF_CIO_WR_RDY 0x20
  2986. field DFF_CIO_RD_RDY 0x10
  2987. field DFF_DIR_ERR 0x08
  2988. field DFF_RAMBIST_FAIL 0x04
  2989. field DFF_RAMBIST_DONE 0x02
  2990. field DFF_RAMBIST_EN 0x01
  2991. }
  2992. /*
  2993. * Data FIFO Space Count
  2994. * Number of FIFO locations that are free.
  2995. */
  2996. register DFSCNT {
  2997. address 0x0CC
  2998. access_mode RO
  2999. size 2
  3000. modes M_DFF0, M_DFF1
  3001. }
  3002. /*
  3003. * Data FIFO Byte Count
  3004. * Number of filled FIFO locations.
  3005. */
  3006. register DFBCNT {
  3007. address 0x0CE
  3008. access_mode RO
  3009. size 2
  3010. modes M_DFF0, M_DFF1
  3011. }
  3012. /*
  3013. * Sequencer Program Overlay Address.
  3014. * Low address must be written prior to high address.
  3015. */
  3016. register OVLYADDR {
  3017. address 0x0D4
  3018. modes M_SCSI
  3019. size 2
  3020. access_mode RW
  3021. }
  3022. /*
  3023. * Sequencer Control 0
  3024. * Error detection mode, speed configuration,
  3025. * single step, breakpoints and program load.
  3026. */
  3027. register SEQCTL0 {
  3028. address 0x0D6
  3029. access_mode RW
  3030. count 11
  3031. field PERRORDIS 0x80
  3032. field PAUSEDIS 0x40
  3033. field FAILDIS 0x20
  3034. field FASTMODE 0x10
  3035. field BRKADRINTEN 0x08
  3036. field STEP 0x04
  3037. field SEQRESET 0x02
  3038. field LOADRAM 0x01
  3039. }
  3040. /*
  3041. * Sequencer Control 1
  3042. * Instruction RAM Diagnostics
  3043. */
  3044. register SEQCTL1 {
  3045. address 0x0D7
  3046. access_mode RW
  3047. field OVRLAY_DATA_CHK 0x08
  3048. field RAMBIST_DONE 0x04
  3049. field RAMBIST_FAIL 0x02
  3050. field RAMBIST_EN 0x01
  3051. }
  3052. /*
  3053. * Sequencer Flags
  3054. * Zero and Carry state of the ALU.
  3055. */
  3056. register FLAGS {
  3057. address 0x0D8
  3058. access_mode RO
  3059. count 23
  3060. field ZERO 0x02
  3061. field CARRY 0x01
  3062. }
  3063. /*
  3064. * Sequencer Interrupt Control
  3065. */
  3066. register SEQINTCTL {
  3067. address 0x0D9
  3068. access_mode RW
  3069. field INTVEC1DSL 0x80
  3070. field INT1_CONTEXT 0x20
  3071. field SCS_SEQ_INT1M1 0x10
  3072. field SCS_SEQ_INT1M0 0x08
  3073. field INTMASK2 0x04
  3074. field INTMASK1 0x02
  3075. field IRET 0x01
  3076. }
  3077. /*
  3078. * Sequencer RAM Data Port
  3079. * Single byte window into the Sequencer Instruction Ram area starting
  3080. * at the address specified by OVLYADDR. To write a full instruction word,
  3081. * simply write four bytes in succession. OVLYADDR will increment after the
  3082. * most significant instrution byte (the byte with the parity bit) is written.
  3083. */
  3084. register SEQRAM {
  3085. address 0x0DA
  3086. access_mode RW
  3087. count 2
  3088. }
  3089. /*
  3090. * Sequencer Program Counter
  3091. * Low byte must be written prior to high byte.
  3092. */
  3093. register PRGMCNT {
  3094. address 0x0DE
  3095. access_mode RW
  3096. size 2
  3097. count 5
  3098. }
  3099. /*
  3100. * Accumulator
  3101. */
  3102. register ACCUM {
  3103. address 0x0E0
  3104. access_mode RW
  3105. accumulator
  3106. }
  3107. /*
  3108. * Source Index Register
  3109. * Incrementing index for reads of SINDIR and the destination (low byte only)
  3110. * for any immediate operands passed in jmp, jc, jnc, call instructions.
  3111. * Example:
  3112. * mvi 0xFF call some_routine;
  3113. *
  3114. * Will set SINDEX[0] to 0xFF and call the routine "some_routine.
  3115. */
  3116. register SINDEX {
  3117. address 0x0E2
  3118. access_mode RW
  3119. size 2
  3120. sindex
  3121. }
  3122. /*
  3123. * Destination Index Register
  3124. * Incrementing index for writes to DINDIR. Can be used as a scratch register.
  3125. */
  3126. register DINDEX {
  3127. address 0x0E4
  3128. access_mode RW
  3129. size 2
  3130. }
  3131. /*
  3132. * Break Address
  3133. * Sequencer instruction breakpoint address address.
  3134. */
  3135. register BRKADDR0 {
  3136. address 0x0E6
  3137. access_mode RW
  3138. }
  3139. register BRKADDR1 {
  3140. address 0x0E6
  3141. access_mode RW
  3142. field BRKDIS 0x80 /* Disable Breakpoint */
  3143. }
  3144. /*
  3145. * All Ones
  3146. * All reads to this register return the value 0xFF.
  3147. */
  3148. register ALLONES {
  3149. address 0x0E8
  3150. access_mode RO
  3151. allones
  3152. }
  3153. /*
  3154. * All Zeros
  3155. * All reads to this register return the value 0.
  3156. */
  3157. register ALLZEROS {
  3158. address 0x0EA
  3159. access_mode RO
  3160. allzeros
  3161. }
  3162. /*
  3163. * No Destination
  3164. * Writes to this register have no effect.
  3165. */
  3166. register NONE {
  3167. address 0x0EA
  3168. access_mode WO
  3169. none
  3170. }
  3171. /*
  3172. * Source Index Indirect
  3173. * Reading this register is equivalent to reading (register_base + SINDEX) and
  3174. * incrementing SINDEX by 1.
  3175. */
  3176. register SINDIR {
  3177. address 0x0EC
  3178. access_mode RO
  3179. }
  3180. /*
  3181. * Destination Index Indirect
  3182. * Writing this register is equivalent to writing to (register_base + DINDEX)
  3183. * and incrementing DINDEX by 1.
  3184. */
  3185. register DINDIR {
  3186. address 0x0ED
  3187. access_mode WO
  3188. }
  3189. /*
  3190. * Function One
  3191. * 2's complement to bit value conversion. Write the 2's complement value
  3192. * (0-7 only) to the top nibble and retrieve the bit indexed by that value
  3193. * on the next read of this register.
  3194. * Example:
  3195. * Write 0x60
  3196. * Read 0x40
  3197. */
  3198. register FUNCTION1 {
  3199. address 0x0F0
  3200. access_mode RW
  3201. }
  3202. /*
  3203. * Stack
  3204. * Window into the stack. Each stack location is 10 bits wide reported
  3205. * low byte followed by high byte. There are 8 stack locations.
  3206. */
  3207. register STACK {
  3208. address 0x0F2
  3209. access_mode RW
  3210. }
  3211. /*
  3212. * Interrupt Vector 1 Address
  3213. * Interrupt branch address for SCS SEQ_INT1 mode 0 and 1 interrupts.
  3214. */
  3215. register INTVEC1_ADDR {
  3216. address 0x0F4
  3217. access_mode RW
  3218. size 2
  3219. modes M_CFG
  3220. count 1
  3221. }
  3222. /*
  3223. * Current Address
  3224. * Address of the SEQRAM instruction currently executing instruction.
  3225. */
  3226. register CURADDR {
  3227. address 0x0F4
  3228. access_mode RW
  3229. size 2
  3230. modes M_SCSI
  3231. count 2
  3232. }
  3233. /*
  3234. * Interrupt Vector 2 Address
  3235. * Interrupt branch address for HST_SEQ_INT2 interrupts.
  3236. */
  3237. register INTVEC2_ADDR {
  3238. address 0x0F6
  3239. access_mode RW
  3240. size 2
  3241. modes M_CFG
  3242. count 1
  3243. }
  3244. /*
  3245. * Last Address
  3246. * Address of the SEQRAM instruction executed prior to the current instruction.
  3247. */
  3248. register LASTADDR {
  3249. address 0x0F6
  3250. access_mode RW
  3251. size 2
  3252. modes M_SCSI
  3253. }
  3254. register AHD_PCI_CONFIG_BASE {
  3255. address 0x100
  3256. access_mode RW
  3257. size 256
  3258. modes M_CFG
  3259. }
  3260. /* ---------------------- Scratch RAM Offsets ------------------------- */
  3261. scratch_ram {
  3262. /* Mode Specific */
  3263. address 0x0A0
  3264. size 8
  3265. modes 0, 1, 2, 3
  3266. REG0 {
  3267. size 2
  3268. }
  3269. REG1 {
  3270. size 2
  3271. }
  3272. REG_ISR {
  3273. size 2
  3274. }
  3275. SG_STATE {
  3276. size 1
  3277. field SEGS_AVAIL 0x01
  3278. field LOADING_NEEDED 0x02
  3279. field FETCH_INPROG 0x04
  3280. }
  3281. /*
  3282. * Track whether the transfer byte count for
  3283. * the current data phase is odd.
  3284. */
  3285. DATA_COUNT_ODD {
  3286. size 1
  3287. }
  3288. }
  3289. scratch_ram {
  3290. /* Mode Specific */
  3291. address 0x0F8
  3292. size 8
  3293. modes 0, 1, 2, 3
  3294. LONGJMP_ADDR {
  3295. size 2
  3296. }
  3297. ACCUM_SAVE {
  3298. size 1
  3299. }
  3300. }
  3301. scratch_ram {
  3302. address 0x100
  3303. size 128
  3304. modes 0, 1, 2, 3
  3305. /*
  3306. * Per "other-id" execution queues. We use an array of
  3307. * tail pointers into lists of SCBs sorted by "other-id".
  3308. * The execution head pointer threads the head SCBs for
  3309. * each list.
  3310. */
  3311. WAITING_SCB_TAILS {
  3312. size 32
  3313. }
  3314. WAITING_TID_HEAD {
  3315. size 2
  3316. }
  3317. WAITING_TID_TAIL {
  3318. size 2
  3319. }
  3320. /*
  3321. * SCBID of the next SCB in the new SCB queue.
  3322. */
  3323. NEXT_QUEUED_SCB_ADDR {
  3324. size 4
  3325. }
  3326. /*
  3327. * head of list of SCBs that have
  3328. * completed but have not been
  3329. * put into the qoutfifo.
  3330. */
  3331. COMPLETE_SCB_HEAD {
  3332. size 2
  3333. }
  3334. /*
  3335. * The list of completed SCBs in
  3336. * the active DMA.
  3337. */
  3338. COMPLETE_SCB_DMAINPROG_HEAD {
  3339. size 2
  3340. }
  3341. /*
  3342. * head of list of SCBs that have
  3343. * completed but need to be uploaded
  3344. * to the host prior to being completed.
  3345. */
  3346. COMPLETE_DMA_SCB_HEAD {
  3347. size 2
  3348. }
  3349. /*
  3350. * tail of list of SCBs that have
  3351. * completed but need to be uploaded
  3352. * to the host prior to being completed.
  3353. */
  3354. COMPLETE_DMA_SCB_TAIL {
  3355. size 2
  3356. }
  3357. /*
  3358. * head of list of SCBs that have
  3359. * been uploaded to the host, but cannot
  3360. * be completed until the QFREEZE is in
  3361. * full effect (i.e. no selections pending).
  3362. */
  3363. COMPLETE_ON_QFREEZE_HEAD {
  3364. size 2
  3365. }
  3366. /*
  3367. * Counting semaphore to prevent new select-outs
  3368. * The queue is frozen so long as the sequencer
  3369. * and kernel freeze counts differ.
  3370. */
  3371. QFREEZE_COUNT {
  3372. size 2
  3373. }
  3374. KERNEL_QFREEZE_COUNT {
  3375. size 2
  3376. }
  3377. /*
  3378. * Mode to restore on legacy idle loop exit.
  3379. */
  3380. SAVED_MODE {
  3381. size 1
  3382. }
  3383. /*
  3384. * Single byte buffer used to designate the type or message
  3385. * to send to a target.
  3386. */
  3387. MSG_OUT {
  3388. size 1
  3389. }
  3390. /* Parameters for DMA Logic */
  3391. DMAPARAMS {
  3392. size 1
  3393. count 8
  3394. field PRELOADEN 0x80
  3395. field WIDEODD 0x40
  3396. field SCSIEN 0x20
  3397. field SDMAEN 0x10
  3398. field SDMAENACK 0x10
  3399. field HDMAEN 0x08
  3400. field HDMAENACK 0x08
  3401. field DIRECTION 0x04 /* Set indicates PCI->SCSI */
  3402. field FIFOFLUSH 0x02
  3403. field FIFORESET 0x01
  3404. }
  3405. SEQ_FLAGS {
  3406. size 1
  3407. field NOT_IDENTIFIED 0x80
  3408. field NO_CDB_SENT 0x40
  3409. field TARGET_CMD_IS_TAGGED 0x40
  3410. field DPHASE 0x20
  3411. /* Target flags */
  3412. field TARG_CMD_PENDING 0x10
  3413. field CMDPHASE_PENDING 0x08
  3414. field DPHASE_PENDING 0x04
  3415. field SPHASE_PENDING 0x02
  3416. field NO_DISCONNECT 0x01
  3417. }
  3418. /*
  3419. * Temporary storage for the
  3420. * target/channel/lun of a
  3421. * reconnecting target
  3422. */
  3423. SAVED_SCSIID {
  3424. size 1
  3425. }
  3426. SAVED_LUN {
  3427. size 1
  3428. }
  3429. /*
  3430. * The last bus phase as seen by the sequencer.
  3431. */
  3432. LASTPHASE {
  3433. size 1
  3434. field CDI 0x80
  3435. field IOI 0x40
  3436. field MSGI 0x20
  3437. field P_BUSFREE 0x01
  3438. enum PHASE_MASK CDO|IOO|MSGO {
  3439. P_DATAOUT 0x0,
  3440. P_DATAIN IOO,
  3441. P_DATAOUT_DT P_DATAOUT|MSGO,
  3442. P_DATAIN_DT P_DATAIN|MSGO,
  3443. P_COMMAND CDO,
  3444. P_MESGOUT CDO|MSGO,
  3445. P_STATUS CDO|IOO,
  3446. P_MESGIN CDO|IOO|MSGO
  3447. }
  3448. }
  3449. /*
  3450. * Value to "or" into the SCBPTR[1] value to
  3451. * indicate that an entry in the QINFIFO is valid.
  3452. */
  3453. QOUTFIFO_ENTRY_VALID_TAG {
  3454. size 1
  3455. }
  3456. /*
  3457. * Kernel and sequencer offsets into the queue of
  3458. * incoming target mode command descriptors. The
  3459. * queue is full when the KERNEL_TQINPOS == TQINPOS.
  3460. */
  3461. KERNEL_TQINPOS {
  3462. size 1
  3463. count 1
  3464. }
  3465. TQINPOS {
  3466. size 1
  3467. count 8
  3468. }
  3469. /*
  3470. * Base address of our shared data with the kernel driver in host
  3471. * memory. This includes the qoutfifo and target mode
  3472. * incoming command queue.
  3473. */
  3474. SHARED_DATA_ADDR {
  3475. size 4
  3476. }
  3477. /*
  3478. * Pointer to location in host memory for next
  3479. * position in the qoutfifo.
  3480. */
  3481. QOUTFIFO_NEXT_ADDR {
  3482. size 4
  3483. }
  3484. ARG_1 {
  3485. size 1
  3486. mask SEND_MSG 0x80
  3487. mask SEND_SENSE 0x40
  3488. mask SEND_REJ 0x20
  3489. mask MSGOUT_PHASEMIS 0x10
  3490. mask EXIT_MSG_LOOP 0x08
  3491. mask CONT_MSG_LOOP_WRITE 0x04
  3492. mask CONT_MSG_LOOP_READ 0x03
  3493. mask CONT_MSG_LOOP_TARG 0x02
  3494. alias RETURN_1
  3495. }
  3496. ARG_2 {
  3497. size 1
  3498. count 1
  3499. alias RETURN_2
  3500. }
  3501. /*
  3502. * Snapshot of MSG_OUT taken after each message is sent.
  3503. */
  3504. LAST_MSG {
  3505. size 1
  3506. }
  3507. /*
  3508. * Sequences the kernel driver has okayed for us. This allows
  3509. * the driver to do things like prevent initiator or target
  3510. * operations.
  3511. */
  3512. SCSISEQ_TEMPLATE {
  3513. size 1
  3514. count 7
  3515. field MANUALCTL 0x40
  3516. field ENSELI 0x20
  3517. field ENRSELI 0x10
  3518. field MANUALP 0x0C
  3519. field ENAUTOATNP 0x02
  3520. field ALTSTIM 0x01
  3521. }
  3522. /*
  3523. * The initiator specified tag for this target mode transaction.
  3524. */
  3525. INITIATOR_TAG {
  3526. size 1
  3527. count 1
  3528. }
  3529. SEQ_FLAGS2 {
  3530. size 1
  3531. field PENDING_MK_MESSAGE 0x01
  3532. field TARGET_MSG_PENDING 0x02
  3533. field SELECTOUT_QFROZEN 0x04
  3534. }
  3535. ALLOCFIFO_SCBPTR {
  3536. size 2
  3537. }
  3538. /*
  3539. * The maximum amount of time to wait, when interrupt coalescing
  3540. * is enabled, before issueing a CMDCMPLT interrupt for a completed
  3541. * command.
  3542. */
  3543. INT_COALESCING_TIMER {
  3544. size 2
  3545. }
  3546. /*
  3547. * The maximum number of commands to coalesce into a single interrupt.
  3548. * Actually the 2's complement of that value to simplify sequencer
  3549. * code.
  3550. */
  3551. INT_COALESCING_MAXCMDS {
  3552. size 1
  3553. }
  3554. /*
  3555. * The minimum number of commands still outstanding required
  3556. * to continue coalescing (2's complement of value).
  3557. */
  3558. INT_COALESCING_MINCMDS {
  3559. size 1
  3560. }
  3561. /*
  3562. * Number of commands "in-flight".
  3563. */
  3564. CMDS_PENDING {
  3565. size 2
  3566. }
  3567. /*
  3568. * The count of commands that have been coalesced.
  3569. */
  3570. INT_COALESCING_CMDCOUNT {
  3571. size 1
  3572. }
  3573. /*
  3574. * Since the HS_MAIBOX is self clearing, copy its contents to
  3575. * this position in scratch ram every time it changes.
  3576. */
  3577. LOCAL_HS_MAILBOX {
  3578. size 1
  3579. }
  3580. /*
  3581. * Target-mode CDB type to CDB length table used
  3582. * in non-packetized operation.
  3583. */
  3584. CMDSIZE_TABLE {
  3585. size 8
  3586. count 8
  3587. }
  3588. /*
  3589. * When an SCB with the MK_MESSAGE flag is
  3590. * queued to the controller, it cannot enter
  3591. * the waiting for selection list until the
  3592. * selections for any previously queued
  3593. * commands to that target complete. During
  3594. * the wait, the MK_MESSAGE SCB is queued
  3595. * here.
  3596. */
  3597. MK_MESSAGE_SCB {
  3598. size 2
  3599. }
  3600. /*
  3601. * Saved SCSIID of MK_MESSAGE_SCB to avoid
  3602. * an extra SCBPTR operation when deciding
  3603. * if the MK_MESSAGE_SCB can be run.
  3604. */
  3605. MK_MESSAGE_SCSIID {
  3606. size 1
  3607. }
  3608. }
  3609. /************************* Hardware SCB Definition ****************************/
  3610. scb {
  3611. address 0x180
  3612. size 64
  3613. modes 0, 1, 2, 3
  3614. SCB_RESIDUAL_DATACNT {
  3615. size 4
  3616. alias SCB_CDB_STORE
  3617. alias SCB_HOST_CDB_PTR
  3618. }
  3619. SCB_RESIDUAL_SGPTR {
  3620. size 4
  3621. field SG_ADDR_MASK 0xf8 /* In the last byte */
  3622. field SG_OVERRUN_RESID 0x02 /* In the first byte */
  3623. field SG_LIST_NULL 0x01 /* In the first byte */
  3624. }
  3625. SCB_SCSI_STATUS {
  3626. size 1
  3627. alias SCB_HOST_CDB_LEN
  3628. }
  3629. SCB_TARGET_PHASES {
  3630. size 1
  3631. }
  3632. SCB_TARGET_DATA_DIR {
  3633. size 1
  3634. }
  3635. SCB_TARGET_ITAG {
  3636. size 1
  3637. }
  3638. SCB_SENSE_BUSADDR {
  3639. /*
  3640. * Only valid if CDB length is less than 13 bytes or
  3641. * we are using a CDB pointer. Otherwise contains
  3642. * the last 4 bytes of embedded cdb information.
  3643. */
  3644. size 4
  3645. alias SCB_NEXT_COMPLETE
  3646. }
  3647. SCB_TAG {
  3648. alias SCB_FIFO_USE_COUNT
  3649. size 2
  3650. }
  3651. SCB_CONTROL {
  3652. size 1
  3653. field TARGET_SCB 0x80
  3654. field DISCENB 0x40
  3655. field TAG_ENB 0x20
  3656. field MK_MESSAGE 0x10
  3657. field STATUS_RCVD 0x08
  3658. field DISCONNECTED 0x04
  3659. field SCB_TAG_TYPE 0x03
  3660. }
  3661. SCB_SCSIID {
  3662. size 1
  3663. field TID 0xF0
  3664. field OID 0x0F
  3665. }
  3666. SCB_LUN {
  3667. size 1
  3668. field LID 0xff
  3669. }
  3670. SCB_TASK_ATTRIBUTE {
  3671. size 1
  3672. /*
  3673. * Overloaded field for non-packetized
  3674. * ignore wide residue message handling.
  3675. */
  3676. field SCB_XFERLEN_ODD 0x01
  3677. }
  3678. SCB_CDB_LEN {
  3679. size 1
  3680. field SCB_CDB_LEN_PTR 0x80 /* CDB in host memory */
  3681. }
  3682. SCB_TASK_MANAGEMENT {
  3683. size 1
  3684. }
  3685. SCB_DATAPTR {
  3686. size 8
  3687. }
  3688. SCB_DATACNT {
  3689. /*
  3690. * The last byte is really the high address bits for
  3691. * the data address.
  3692. */
  3693. size 4
  3694. field SG_LAST_SEG 0x80 /* In the fourth byte */
  3695. field SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */
  3696. }
  3697. SCB_SGPTR {
  3698. size 4
  3699. field SG_STATUS_VALID 0x04 /* In the first byte */
  3700. field SG_FULL_RESID 0x02 /* In the first byte */
  3701. field SG_LIST_NULL 0x01 /* In the first byte */
  3702. }
  3703. SCB_BUSADDR {
  3704. size 4
  3705. }
  3706. SCB_NEXT {
  3707. alias SCB_NEXT_SCB_BUSADDR
  3708. size 2
  3709. }
  3710. SCB_NEXT2 {
  3711. size 2
  3712. }
  3713. SCB_SPARE {
  3714. size 8
  3715. alias SCB_PKT_LUN
  3716. }
  3717. SCB_DISCONNECTED_LISTS {
  3718. size 8
  3719. }
  3720. }
  3721. /*********************************** Constants ********************************/
  3722. const MK_MESSAGE_BIT_OFFSET 4
  3723. const TID_SHIFT 4
  3724. const TARGET_CMD_CMPLT 0xfe
  3725. const INVALID_ADDR 0x80
  3726. #define SCB_LIST_NULL 0xff
  3727. #define QOUTFIFO_ENTRY_VALID_TOGGLE 0x80
  3728. const CCSGADDR_MAX 0x80
  3729. const CCSCBADDR_MAX 0x80
  3730. const CCSGRAM_MAXSEGS 16
  3731. /* Selection Timeout Timer Constants */
  3732. const STIMESEL_SHIFT 3
  3733. const STIMESEL_MIN 0x18
  3734. const STIMESEL_BUG_ADJ 0x8
  3735. /* WDTR Message values */
  3736. const BUS_8_BIT 0x00
  3737. const BUS_16_BIT 0x01
  3738. const BUS_32_BIT 0x02
  3739. /* Offset maximums */
  3740. const MAX_OFFSET 0xfe
  3741. const MAX_OFFSET_PACED 0xfe
  3742. const MAX_OFFSET_PACED_BUG 0x7f
  3743. /*
  3744. * Some 160 devices incorrectly accept 0xfe as a
  3745. * sync offset, but will overrun this value. Limit
  3746. * to 0x7f for speed lower than U320 which will
  3747. * avoid the persistent sync offset overruns.
  3748. */
  3749. const MAX_OFFSET_NON_PACED 0x7f
  3750. const HOST_MSG 0xff
  3751. /*
  3752. * The size of our sense buffers.
  3753. * Sense buffer mapping can be handled in either of two ways.
  3754. * The first is to allocate a dmamap for each transaction.
  3755. * Depending on the architecture, dmamaps can be costly. The
  3756. * alternative is to statically map the buffers in much the same
  3757. * way we handle our scatter gather lists. The driver implements
  3758. * the later.
  3759. */
  3760. const AHD_SENSE_BUFSIZE 256
  3761. /* Target mode command processing constants */
  3762. const CMD_GROUP_CODE_SHIFT 0x05
  3763. const STATUS_BUSY 0x08
  3764. const STATUS_QUEUE_FULL 0x28
  3765. const STATUS_PKT_SENSE 0xFF
  3766. const TARGET_DATA_IN 1
  3767. const SCB_TRANSFER_SIZE_FULL_LUN 56
  3768. const SCB_TRANSFER_SIZE_1BYTE_LUN 48
  3769. /* PKT_OVERRUN_BUFSIZE must be a multiple of 256 less than 64K */
  3770. const PKT_OVERRUN_BUFSIZE 512
  3771. /*
  3772. * Timer parameters.
  3773. */
  3774. const AHD_TIMER_US_PER_TICK 25
  3775. const AHD_TIMER_MAX_TICKS 0xFFFF
  3776. const AHD_TIMER_MAX_US (AHD_TIMER_MAX_TICKS * AHD_TIMER_US_PER_TICK)
  3777. /*
  3778. * Downloaded (kernel inserted) constants
  3779. */
  3780. const SG_PREFETCH_CNT download
  3781. const SG_PREFETCH_CNT_LIMIT download
  3782. const SG_PREFETCH_ALIGN_MASK download
  3783. const SG_PREFETCH_ADDR_MASK download
  3784. const SG_SIZEOF download
  3785. const PKT_OVERRUN_BUFOFFSET download
  3786. const SCB_TRANSFER_SIZE download
  3787. const CACHELINE_MASK download
  3788. /*
  3789. * BIOS SCB offsets
  3790. */
  3791. const NVRAM_SCB_OFFSET 0x2C