aic79xx.reg 66 KB

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