vme_tsi148.h 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412
  1. /*
  2. * tsi148.h
  3. *
  4. * Support for the Tundra TSI148 VME Bridge chip
  5. *
  6. * Author: Tom Armistead
  7. * Updated and maintained by Ajit Prem
  8. * Copyright 2004 Motorola Inc.
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. */
  15. #ifndef TSI148_H
  16. #define TSI148_H
  17. #ifndef PCI_VENDOR_ID_TUNDRA
  18. #define PCI_VENDOR_ID_TUNDRA 0x10e3
  19. #endif
  20. #ifndef PCI_DEVICE_ID_TUNDRA_TSI148
  21. #define PCI_DEVICE_ID_TUNDRA_TSI148 0x148
  22. #endif
  23. /*
  24. * Define the number of each that the Tsi148 supports.
  25. */
  26. #define TSI148_MAX_MASTER 8 /* Max Master Windows */
  27. #define TSI148_MAX_SLAVE 8 /* Max Slave Windows */
  28. #define TSI148_MAX_DMA 2 /* Max DMA Controllers */
  29. #define TSI148_MAX_MAILBOX 4 /* Max Mail Box registers */
  30. #define TSI148_MAX_SEMAPHORE 8 /* Max Semaphores */
  31. /* Structure used to hold driver specific information */
  32. struct tsi148_driver {
  33. void __iomem *base; /* Base Address of device registers */
  34. wait_queue_head_t dma_queue[2];
  35. wait_queue_head_t iack_queue;
  36. void (*lm_callback[4])(void *); /* Called in interrupt handler */
  37. void *lm_data[4];
  38. void *crcsr_kernel;
  39. dma_addr_t crcsr_bus;
  40. struct vme_master_resource *flush_image;
  41. struct mutex vme_rmw; /* Only one RMW cycle at a time */
  42. struct mutex vme_int; /*
  43. * Only one VME interrupt can be
  44. * generated at a time, provide locking
  45. */
  46. };
  47. /*
  48. * Layout of a DMAC Linked-List Descriptor
  49. *
  50. * Note: This structure is accessed via the chip and therefore must be
  51. * correctly laid out - It must also be aligned on 64-bit boundaries.
  52. */
  53. struct tsi148_dma_descriptor {
  54. __be32 dsau; /* Source Address */
  55. __be32 dsal;
  56. __be32 ddau; /* Destination Address */
  57. __be32 ddal;
  58. __be32 dsat; /* Source attributes */
  59. __be32 ddat; /* Destination attributes */
  60. __be32 dnlau; /* Next link address */
  61. __be32 dnlal;
  62. __be32 dcnt; /* Byte count */
  63. __be32 ddbs; /* 2eSST Broadcast select */
  64. };
  65. struct tsi148_dma_entry {
  66. /*
  67. * The descriptor needs to be aligned on a 64-bit boundary, we increase
  68. * the chance of this by putting it first in the structure.
  69. */
  70. struct tsi148_dma_descriptor descriptor;
  71. struct list_head list;
  72. dma_addr_t dma_handle;
  73. };
  74. /*
  75. * TSI148 ASIC register structure overlays and bit field definitions.
  76. *
  77. * Note: Tsi148 Register Group (CRG) consists of the following
  78. * combination of registers:
  79. * PCFS - PCI Configuration Space Registers
  80. * LCSR - Local Control and Status Registers
  81. * GCSR - Global Control and Status Registers
  82. * CR/CSR - Subset of Configuration ROM /
  83. * Control and Status Registers
  84. */
  85. /*
  86. * Command/Status Registers (CRG + $004)
  87. */
  88. #define TSI148_PCFS_ID 0x0
  89. #define TSI148_PCFS_CSR 0x4
  90. #define TSI148_PCFS_CLASS 0x8
  91. #define TSI148_PCFS_MISC0 0xC
  92. #define TSI148_PCFS_MBARL 0x10
  93. #define TSI148_PCFS_MBARU 0x14
  94. #define TSI148_PCFS_SUBID 0x28
  95. #define TSI148_PCFS_CAPP 0x34
  96. #define TSI148_PCFS_MISC1 0x3C
  97. #define TSI148_PCFS_XCAPP 0x40
  98. #define TSI148_PCFS_XSTAT 0x44
  99. /*
  100. * LCSR definitions
  101. */
  102. /*
  103. * Outbound Translations
  104. */
  105. #define TSI148_LCSR_OT0_OTSAU 0x100
  106. #define TSI148_LCSR_OT0_OTSAL 0x104
  107. #define TSI148_LCSR_OT0_OTEAU 0x108
  108. #define TSI148_LCSR_OT0_OTEAL 0x10C
  109. #define TSI148_LCSR_OT0_OTOFU 0x110
  110. #define TSI148_LCSR_OT0_OTOFL 0x114
  111. #define TSI148_LCSR_OT0_OTBS 0x118
  112. #define TSI148_LCSR_OT0_OTAT 0x11C
  113. #define TSI148_LCSR_OT1_OTSAU 0x120
  114. #define TSI148_LCSR_OT1_OTSAL 0x124
  115. #define TSI148_LCSR_OT1_OTEAU 0x128
  116. #define TSI148_LCSR_OT1_OTEAL 0x12C
  117. #define TSI148_LCSR_OT1_OTOFU 0x130
  118. #define TSI148_LCSR_OT1_OTOFL 0x134
  119. #define TSI148_LCSR_OT1_OTBS 0x138
  120. #define TSI148_LCSR_OT1_OTAT 0x13C
  121. #define TSI148_LCSR_OT2_OTSAU 0x140
  122. #define TSI148_LCSR_OT2_OTSAL 0x144
  123. #define TSI148_LCSR_OT2_OTEAU 0x148
  124. #define TSI148_LCSR_OT2_OTEAL 0x14C
  125. #define TSI148_LCSR_OT2_OTOFU 0x150
  126. #define TSI148_LCSR_OT2_OTOFL 0x154
  127. #define TSI148_LCSR_OT2_OTBS 0x158
  128. #define TSI148_LCSR_OT2_OTAT 0x15C
  129. #define TSI148_LCSR_OT3_OTSAU 0x160
  130. #define TSI148_LCSR_OT3_OTSAL 0x164
  131. #define TSI148_LCSR_OT3_OTEAU 0x168
  132. #define TSI148_LCSR_OT3_OTEAL 0x16C
  133. #define TSI148_LCSR_OT3_OTOFU 0x170
  134. #define TSI148_LCSR_OT3_OTOFL 0x174
  135. #define TSI148_LCSR_OT3_OTBS 0x178
  136. #define TSI148_LCSR_OT3_OTAT 0x17C
  137. #define TSI148_LCSR_OT4_OTSAU 0x180
  138. #define TSI148_LCSR_OT4_OTSAL 0x184
  139. #define TSI148_LCSR_OT4_OTEAU 0x188
  140. #define TSI148_LCSR_OT4_OTEAL 0x18C
  141. #define TSI148_LCSR_OT4_OTOFU 0x190
  142. #define TSI148_LCSR_OT4_OTOFL 0x194
  143. #define TSI148_LCSR_OT4_OTBS 0x198
  144. #define TSI148_LCSR_OT4_OTAT 0x19C
  145. #define TSI148_LCSR_OT5_OTSAU 0x1A0
  146. #define TSI148_LCSR_OT5_OTSAL 0x1A4
  147. #define TSI148_LCSR_OT5_OTEAU 0x1A8
  148. #define TSI148_LCSR_OT5_OTEAL 0x1AC
  149. #define TSI148_LCSR_OT5_OTOFU 0x1B0
  150. #define TSI148_LCSR_OT5_OTOFL 0x1B4
  151. #define TSI148_LCSR_OT5_OTBS 0x1B8
  152. #define TSI148_LCSR_OT5_OTAT 0x1BC
  153. #define TSI148_LCSR_OT6_OTSAU 0x1C0
  154. #define TSI148_LCSR_OT6_OTSAL 0x1C4
  155. #define TSI148_LCSR_OT6_OTEAU 0x1C8
  156. #define TSI148_LCSR_OT6_OTEAL 0x1CC
  157. #define TSI148_LCSR_OT6_OTOFU 0x1D0
  158. #define TSI148_LCSR_OT6_OTOFL 0x1D4
  159. #define TSI148_LCSR_OT6_OTBS 0x1D8
  160. #define TSI148_LCSR_OT6_OTAT 0x1DC
  161. #define TSI148_LCSR_OT7_OTSAU 0x1E0
  162. #define TSI148_LCSR_OT7_OTSAL 0x1E4
  163. #define TSI148_LCSR_OT7_OTEAU 0x1E8
  164. #define TSI148_LCSR_OT7_OTEAL 0x1EC
  165. #define TSI148_LCSR_OT7_OTOFU 0x1F0
  166. #define TSI148_LCSR_OT7_OTOFL 0x1F4
  167. #define TSI148_LCSR_OT7_OTBS 0x1F8
  168. #define TSI148_LCSR_OT7_OTAT 0x1FC
  169. #define TSI148_LCSR_OT0 0x100
  170. #define TSI148_LCSR_OT1 0x120
  171. #define TSI148_LCSR_OT2 0x140
  172. #define TSI148_LCSR_OT3 0x160
  173. #define TSI148_LCSR_OT4 0x180
  174. #define TSI148_LCSR_OT5 0x1A0
  175. #define TSI148_LCSR_OT6 0x1C0
  176. #define TSI148_LCSR_OT7 0x1E0
  177. static const int TSI148_LCSR_OT[8] = { TSI148_LCSR_OT0, TSI148_LCSR_OT1,
  178. TSI148_LCSR_OT2, TSI148_LCSR_OT3,
  179. TSI148_LCSR_OT4, TSI148_LCSR_OT5,
  180. TSI148_LCSR_OT6, TSI148_LCSR_OT7 };
  181. #define TSI148_LCSR_OFFSET_OTSAU 0x0
  182. #define TSI148_LCSR_OFFSET_OTSAL 0x4
  183. #define TSI148_LCSR_OFFSET_OTEAU 0x8
  184. #define TSI148_LCSR_OFFSET_OTEAL 0xC
  185. #define TSI148_LCSR_OFFSET_OTOFU 0x10
  186. #define TSI148_LCSR_OFFSET_OTOFL 0x14
  187. #define TSI148_LCSR_OFFSET_OTBS 0x18
  188. #define TSI148_LCSR_OFFSET_OTAT 0x1C
  189. /*
  190. * VMEbus interrupt ack
  191. * offset 200
  192. */
  193. #define TSI148_LCSR_VIACK1 0x204
  194. #define TSI148_LCSR_VIACK2 0x208
  195. #define TSI148_LCSR_VIACK3 0x20C
  196. #define TSI148_LCSR_VIACK4 0x210
  197. #define TSI148_LCSR_VIACK5 0x214
  198. #define TSI148_LCSR_VIACK6 0x218
  199. #define TSI148_LCSR_VIACK7 0x21C
  200. static const int TSI148_LCSR_VIACK[8] = { 0, TSI148_LCSR_VIACK1,
  201. TSI148_LCSR_VIACK2, TSI148_LCSR_VIACK3,
  202. TSI148_LCSR_VIACK4, TSI148_LCSR_VIACK5,
  203. TSI148_LCSR_VIACK6, TSI148_LCSR_VIACK7 };
  204. /*
  205. * RMW
  206. * offset 220
  207. */
  208. #define TSI148_LCSR_RMWAU 0x220
  209. #define TSI148_LCSR_RMWAL 0x224
  210. #define TSI148_LCSR_RMWEN 0x228
  211. #define TSI148_LCSR_RMWC 0x22C
  212. #define TSI148_LCSR_RMWS 0x230
  213. /*
  214. * VMEbus control
  215. * offset 234
  216. */
  217. #define TSI148_LCSR_VMCTRL 0x234
  218. #define TSI148_LCSR_VCTRL 0x238
  219. #define TSI148_LCSR_VSTAT 0x23C
  220. /*
  221. * PCI status
  222. * offset 240
  223. */
  224. #define TSI148_LCSR_PSTAT 0x240
  225. /*
  226. * VME filter.
  227. * offset 250
  228. */
  229. #define TSI148_LCSR_VMEFL 0x250
  230. /*
  231. * VME exception.
  232. * offset 260
  233. */
  234. #define TSI148_LCSR_VEAU 0x260
  235. #define TSI148_LCSR_VEAL 0x264
  236. #define TSI148_LCSR_VEAT 0x268
  237. /*
  238. * PCI error
  239. * offset 270
  240. */
  241. #define TSI148_LCSR_EDPAU 0x270
  242. #define TSI148_LCSR_EDPAL 0x274
  243. #define TSI148_LCSR_EDPXA 0x278
  244. #define TSI148_LCSR_EDPXS 0x27C
  245. #define TSI148_LCSR_EDPAT 0x280
  246. /*
  247. * Inbound Translations
  248. * offset 300
  249. */
  250. #define TSI148_LCSR_IT0_ITSAU 0x300
  251. #define TSI148_LCSR_IT0_ITSAL 0x304
  252. #define TSI148_LCSR_IT0_ITEAU 0x308
  253. #define TSI148_LCSR_IT0_ITEAL 0x30C
  254. #define TSI148_LCSR_IT0_ITOFU 0x310
  255. #define TSI148_LCSR_IT0_ITOFL 0x314
  256. #define TSI148_LCSR_IT0_ITAT 0x318
  257. #define TSI148_LCSR_IT1_ITSAU 0x320
  258. #define TSI148_LCSR_IT1_ITSAL 0x324
  259. #define TSI148_LCSR_IT1_ITEAU 0x328
  260. #define TSI148_LCSR_IT1_ITEAL 0x32C
  261. #define TSI148_LCSR_IT1_ITOFU 0x330
  262. #define TSI148_LCSR_IT1_ITOFL 0x334
  263. #define TSI148_LCSR_IT1_ITAT 0x338
  264. #define TSI148_LCSR_IT2_ITSAU 0x340
  265. #define TSI148_LCSR_IT2_ITSAL 0x344
  266. #define TSI148_LCSR_IT2_ITEAU 0x348
  267. #define TSI148_LCSR_IT2_ITEAL 0x34C
  268. #define TSI148_LCSR_IT2_ITOFU 0x350
  269. #define TSI148_LCSR_IT2_ITOFL 0x354
  270. #define TSI148_LCSR_IT2_ITAT 0x358
  271. #define TSI148_LCSR_IT3_ITSAU 0x360
  272. #define TSI148_LCSR_IT3_ITSAL 0x364
  273. #define TSI148_LCSR_IT3_ITEAU 0x368
  274. #define TSI148_LCSR_IT3_ITEAL 0x36C
  275. #define TSI148_LCSR_IT3_ITOFU 0x370
  276. #define TSI148_LCSR_IT3_ITOFL 0x374
  277. #define TSI148_LCSR_IT3_ITAT 0x378
  278. #define TSI148_LCSR_IT4_ITSAU 0x380
  279. #define TSI148_LCSR_IT4_ITSAL 0x384
  280. #define TSI148_LCSR_IT4_ITEAU 0x388
  281. #define TSI148_LCSR_IT4_ITEAL 0x38C
  282. #define TSI148_LCSR_IT4_ITOFU 0x390
  283. #define TSI148_LCSR_IT4_ITOFL 0x394
  284. #define TSI148_LCSR_IT4_ITAT 0x398
  285. #define TSI148_LCSR_IT5_ITSAU 0x3A0
  286. #define TSI148_LCSR_IT5_ITSAL 0x3A4
  287. #define TSI148_LCSR_IT5_ITEAU 0x3A8
  288. #define TSI148_LCSR_IT5_ITEAL 0x3AC
  289. #define TSI148_LCSR_IT5_ITOFU 0x3B0
  290. #define TSI148_LCSR_IT5_ITOFL 0x3B4
  291. #define TSI148_LCSR_IT5_ITAT 0x3B8
  292. #define TSI148_LCSR_IT6_ITSAU 0x3C0
  293. #define TSI148_LCSR_IT6_ITSAL 0x3C4
  294. #define TSI148_LCSR_IT6_ITEAU 0x3C8
  295. #define TSI148_LCSR_IT6_ITEAL 0x3CC
  296. #define TSI148_LCSR_IT6_ITOFU 0x3D0
  297. #define TSI148_LCSR_IT6_ITOFL 0x3D4
  298. #define TSI148_LCSR_IT6_ITAT 0x3D8
  299. #define TSI148_LCSR_IT7_ITSAU 0x3E0
  300. #define TSI148_LCSR_IT7_ITSAL 0x3E4
  301. #define TSI148_LCSR_IT7_ITEAU 0x3E8
  302. #define TSI148_LCSR_IT7_ITEAL 0x3EC
  303. #define TSI148_LCSR_IT7_ITOFU 0x3F0
  304. #define TSI148_LCSR_IT7_ITOFL 0x3F4
  305. #define TSI148_LCSR_IT7_ITAT 0x3F8
  306. #define TSI148_LCSR_IT0 0x300
  307. #define TSI148_LCSR_IT1 0x320
  308. #define TSI148_LCSR_IT2 0x340
  309. #define TSI148_LCSR_IT3 0x360
  310. #define TSI148_LCSR_IT4 0x380
  311. #define TSI148_LCSR_IT5 0x3A0
  312. #define TSI148_LCSR_IT6 0x3C0
  313. #define TSI148_LCSR_IT7 0x3E0
  314. static const int TSI148_LCSR_IT[8] = { TSI148_LCSR_IT0, TSI148_LCSR_IT1,
  315. TSI148_LCSR_IT2, TSI148_LCSR_IT3,
  316. TSI148_LCSR_IT4, TSI148_LCSR_IT5,
  317. TSI148_LCSR_IT6, TSI148_LCSR_IT7 };
  318. #define TSI148_LCSR_OFFSET_ITSAU 0x0
  319. #define TSI148_LCSR_OFFSET_ITSAL 0x4
  320. #define TSI148_LCSR_OFFSET_ITEAU 0x8
  321. #define TSI148_LCSR_OFFSET_ITEAL 0xC
  322. #define TSI148_LCSR_OFFSET_ITOFU 0x10
  323. #define TSI148_LCSR_OFFSET_ITOFL 0x14
  324. #define TSI148_LCSR_OFFSET_ITAT 0x18
  325. /*
  326. * Inbound Translation GCSR
  327. * offset 400
  328. */
  329. #define TSI148_LCSR_GBAU 0x400
  330. #define TSI148_LCSR_GBAL 0x404
  331. #define TSI148_LCSR_GCSRAT 0x408
  332. /*
  333. * Inbound Translation CRG
  334. * offset 40C
  335. */
  336. #define TSI148_LCSR_CBAU 0x40C
  337. #define TSI148_LCSR_CBAL 0x410
  338. #define TSI148_LCSR_CSRAT 0x414
  339. /*
  340. * Inbound Translation CR/CSR
  341. * CRG
  342. * offset 418
  343. */
  344. #define TSI148_LCSR_CROU 0x418
  345. #define TSI148_LCSR_CROL 0x41C
  346. #define TSI148_LCSR_CRAT 0x420
  347. /*
  348. * Inbound Translation Location Monitor
  349. * offset 424
  350. */
  351. #define TSI148_LCSR_LMBAU 0x424
  352. #define TSI148_LCSR_LMBAL 0x428
  353. #define TSI148_LCSR_LMAT 0x42C
  354. /*
  355. * VMEbus Interrupt Control.
  356. * offset 430
  357. */
  358. #define TSI148_LCSR_BCU 0x430
  359. #define TSI148_LCSR_BCL 0x434
  360. #define TSI148_LCSR_BPGTR 0x438
  361. #define TSI148_LCSR_BPCTR 0x43C
  362. #define TSI148_LCSR_VICR 0x440
  363. /*
  364. * Local Bus Interrupt Control.
  365. * offset 448
  366. */
  367. #define TSI148_LCSR_INTEN 0x448
  368. #define TSI148_LCSR_INTEO 0x44C
  369. #define TSI148_LCSR_INTS 0x450
  370. #define TSI148_LCSR_INTC 0x454
  371. #define TSI148_LCSR_INTM1 0x458
  372. #define TSI148_LCSR_INTM2 0x45C
  373. /*
  374. * DMA Controllers
  375. * offset 500
  376. */
  377. #define TSI148_LCSR_DCTL0 0x500
  378. #define TSI148_LCSR_DSTA0 0x504
  379. #define TSI148_LCSR_DCSAU0 0x508
  380. #define TSI148_LCSR_DCSAL0 0x50C
  381. #define TSI148_LCSR_DCDAU0 0x510
  382. #define TSI148_LCSR_DCDAL0 0x514
  383. #define TSI148_LCSR_DCLAU0 0x518
  384. #define TSI148_LCSR_DCLAL0 0x51C
  385. #define TSI148_LCSR_DSAU0 0x520
  386. #define TSI148_LCSR_DSAL0 0x524
  387. #define TSI148_LCSR_DDAU0 0x528
  388. #define TSI148_LCSR_DDAL0 0x52C
  389. #define TSI148_LCSR_DSAT0 0x530
  390. #define TSI148_LCSR_DDAT0 0x534
  391. #define TSI148_LCSR_DNLAU0 0x538
  392. #define TSI148_LCSR_DNLAL0 0x53C
  393. #define TSI148_LCSR_DCNT0 0x540
  394. #define TSI148_LCSR_DDBS0 0x544
  395. #define TSI148_LCSR_DCTL1 0x580
  396. #define TSI148_LCSR_DSTA1 0x584
  397. #define TSI148_LCSR_DCSAU1 0x588
  398. #define TSI148_LCSR_DCSAL1 0x58C
  399. #define TSI148_LCSR_DCDAU1 0x590
  400. #define TSI148_LCSR_DCDAL1 0x594
  401. #define TSI148_LCSR_DCLAU1 0x598
  402. #define TSI148_LCSR_DCLAL1 0x59C
  403. #define TSI148_LCSR_DSAU1 0x5A0
  404. #define TSI148_LCSR_DSAL1 0x5A4
  405. #define TSI148_LCSR_DDAU1 0x5A8
  406. #define TSI148_LCSR_DDAL1 0x5AC
  407. #define TSI148_LCSR_DSAT1 0x5B0
  408. #define TSI148_LCSR_DDAT1 0x5B4
  409. #define TSI148_LCSR_DNLAU1 0x5B8
  410. #define TSI148_LCSR_DNLAL1 0x5BC
  411. #define TSI148_LCSR_DCNT1 0x5C0
  412. #define TSI148_LCSR_DDBS1 0x5C4
  413. #define TSI148_LCSR_DMA0 0x500
  414. #define TSI148_LCSR_DMA1 0x580
  415. static const int TSI148_LCSR_DMA[TSI148_MAX_DMA] = { TSI148_LCSR_DMA0,
  416. TSI148_LCSR_DMA1 };
  417. #define TSI148_LCSR_OFFSET_DCTL 0x0
  418. #define TSI148_LCSR_OFFSET_DSTA 0x4
  419. #define TSI148_LCSR_OFFSET_DCSAU 0x8
  420. #define TSI148_LCSR_OFFSET_DCSAL 0xC
  421. #define TSI148_LCSR_OFFSET_DCDAU 0x10
  422. #define TSI148_LCSR_OFFSET_DCDAL 0x14
  423. #define TSI148_LCSR_OFFSET_DCLAU 0x18
  424. #define TSI148_LCSR_OFFSET_DCLAL 0x1C
  425. #define TSI148_LCSR_OFFSET_DSAU 0x20
  426. #define TSI148_LCSR_OFFSET_DSAL 0x24
  427. #define TSI148_LCSR_OFFSET_DDAU 0x28
  428. #define TSI148_LCSR_OFFSET_DDAL 0x2C
  429. #define TSI148_LCSR_OFFSET_DSAT 0x30
  430. #define TSI148_LCSR_OFFSET_DDAT 0x34
  431. #define TSI148_LCSR_OFFSET_DNLAU 0x38
  432. #define TSI148_LCSR_OFFSET_DNLAL 0x3C
  433. #define TSI148_LCSR_OFFSET_DCNT 0x40
  434. #define TSI148_LCSR_OFFSET_DDBS 0x44
  435. /*
  436. * GCSR Register Group
  437. */
  438. /*
  439. * GCSR CRG
  440. * offset 00 600 - DEVI/VENI
  441. * offset 04 604 - CTRL/GA/REVID
  442. * offset 08 608 - Semaphore3/2/1/0
  443. * offset 0C 60C - Seamphore7/6/5/4
  444. */
  445. #define TSI148_GCSR_ID 0x600
  446. #define TSI148_GCSR_CSR 0x604
  447. #define TSI148_GCSR_SEMA0 0x608
  448. #define TSI148_GCSR_SEMA1 0x60C
  449. /*
  450. * Mail Box
  451. * GCSR CRG
  452. * offset 10 610 - Mailbox0
  453. */
  454. #define TSI148_GCSR_MBOX0 0x610
  455. #define TSI148_GCSR_MBOX1 0x614
  456. #define TSI148_GCSR_MBOX2 0x618
  457. #define TSI148_GCSR_MBOX3 0x61C
  458. static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0,
  459. TSI148_GCSR_MBOX1,
  460. TSI148_GCSR_MBOX2,
  461. TSI148_GCSR_MBOX3 };
  462. /*
  463. * CR/CSR
  464. */
  465. /*
  466. * CR/CSR CRG
  467. * offset 7FFF4 FF4 - CSRBCR
  468. * offset 7FFF8 FF8 - CSRBSR
  469. * offset 7FFFC FFC - CBAR
  470. */
  471. #define TSI148_CSRBCR 0xFF4
  472. #define TSI148_CSRBSR 0xFF8
  473. #define TSI148_CBAR 0xFFC
  474. /*
  475. * TSI148 Register Bit Definitions
  476. */
  477. /*
  478. * PFCS Register Set
  479. */
  480. #define TSI148_PCFS_CMMD_SERR (1<<8) /* SERR_L out pin ssys err */
  481. #define TSI148_PCFS_CMMD_PERR (1<<6) /* PERR_L out pin parity */
  482. #define TSI148_PCFS_CMMD_MSTR (1<<2) /* PCI bus master */
  483. #define TSI148_PCFS_CMMD_MEMSP (1<<1) /* PCI mem space access */
  484. #define TSI148_PCFS_CMMD_IOSP (1<<0) /* PCI I/O space enable */
  485. #define TSI148_PCFS_STAT_RCPVE (1<<15) /* Detected Parity Error */
  486. #define TSI148_PCFS_STAT_SIGSE (1<<14) /* Signalled System Error */
  487. #define TSI148_PCFS_STAT_RCVMA (1<<13) /* Received Master Abort */
  488. #define TSI148_PCFS_STAT_RCVTA (1<<12) /* Received Target Abort */
  489. #define TSI148_PCFS_STAT_SIGTA (1<<11) /* Signalled Target Abort */
  490. #define TSI148_PCFS_STAT_SELTIM (3<<9) /* DELSEL Timing */
  491. #define TSI148_PCFS_STAT_DPAR (1<<8) /* Data Parity Err Reported */
  492. #define TSI148_PCFS_STAT_FAST (1<<7) /* Fast back-to-back Cap */
  493. #define TSI148_PCFS_STAT_P66M (1<<5) /* 66 MHz Capable */
  494. #define TSI148_PCFS_STAT_CAPL (1<<4) /* Capab List - address $34 */
  495. /*
  496. * Revision ID/Class Code Registers (CRG +$008)
  497. */
  498. #define TSI148_PCFS_CLAS_M (0xFF<<24) /* Class ID */
  499. #define TSI148_PCFS_SUBCLAS_M (0xFF<<16) /* Sub-Class ID */
  500. #define TSI148_PCFS_PROGIF_M (0xFF<<8) /* Sub-Class ID */
  501. #define TSI148_PCFS_REVID_M (0xFF<<0) /* Rev ID */
  502. /*
  503. * Cache Line Size/ Master Latency Timer/ Header Type Registers (CRG + $00C)
  504. */
  505. #define TSI148_PCFS_HEAD_M (0xFF<<16) /* Master Lat Timer */
  506. #define TSI148_PCFS_MLAT_M (0xFF<<8) /* Master Lat Timer */
  507. #define TSI148_PCFS_CLSZ_M (0xFF<<0) /* Cache Line Size */
  508. /*
  509. * Memory Base Address Lower Reg (CRG + $010)
  510. */
  511. #define TSI148_PCFS_MBARL_BASEL_M (0xFFFFF<<12) /* Base Addr Lower Mask */
  512. #define TSI148_PCFS_MBARL_PRE (1<<3) /* Prefetch */
  513. #define TSI148_PCFS_MBARL_MTYPE_M (3<<1) /* Memory Type Mask */
  514. #define TSI148_PCFS_MBARL_IOMEM (1<<0) /* I/O Space Indicator */
  515. /*
  516. * Message Signaled Interrupt Capabilities Register (CRG + $040)
  517. */
  518. #define TSI148_PCFS_MSICAP_64BAC (1<<7) /* 64-bit Address Capable */
  519. #define TSI148_PCFS_MSICAP_MME_M (7<<4) /* Multiple Msg Enable Mask */
  520. #define TSI148_PCFS_MSICAP_MMC_M (7<<1) /* Multiple Msg Capable Mask */
  521. #define TSI148_PCFS_MSICAP_MSIEN (1<<0) /* Msg signaled INT Enable */
  522. /*
  523. * Message Address Lower Register (CRG +$044)
  524. */
  525. #define TSI148_PCFS_MSIAL_M (0x3FFFFFFF<<2) /* Mask */
  526. /*
  527. * Message Data Register (CRG + 4C)
  528. */
  529. #define TSI148_PCFS_MSIMD_M (0xFFFF<<0) /* Mask */
  530. /*
  531. * PCI-X Capabilities Register (CRG + $050)
  532. */
  533. #define TSI148_PCFS_PCIXCAP_MOST_M (7<<4) /* Max outstanding Split Tran */
  534. #define TSI148_PCFS_PCIXCAP_MMRBC_M (3<<2) /* Max Mem Read byte cnt */
  535. #define TSI148_PCFS_PCIXCAP_ERO (1<<1) /* Enable Relaxed Ordering */
  536. #define TSI148_PCFS_PCIXCAP_DPERE (1<<0) /* Data Parity Recover Enable */
  537. /*
  538. * PCI-X Status Register (CRG +$054)
  539. */
  540. #define TSI148_PCFS_PCIXSTAT_RSCEM (1<<29) /* Received Split Comp Error */
  541. #define TSI148_PCFS_PCIXSTAT_DMCRS_M (7<<26) /* max Cumulative Read Size */
  542. #define TSI148_PCFS_PCIXSTAT_DMOST_M (7<<23) /* max outstanding Split Trans
  543. */
  544. #define TSI148_PCFS_PCIXSTAT_DMMRC_M (3<<21) /* max mem read byte count */
  545. #define TSI148_PCFS_PCIXSTAT_DC (1<<20) /* Device Complexity */
  546. #define TSI148_PCFS_PCIXSTAT_USC (1<<19) /* Unexpected Split comp */
  547. #define TSI148_PCFS_PCIXSTAT_SCD (1<<18) /* Split completion discard */
  548. #define TSI148_PCFS_PCIXSTAT_133C (1<<17) /* 133MHz capable */
  549. #define TSI148_PCFS_PCIXSTAT_64D (1<<16) /* 64 bit device */
  550. #define TSI148_PCFS_PCIXSTAT_BN_M (0xFF<<8) /* Bus number */
  551. #define TSI148_PCFS_PCIXSTAT_DN_M (0x1F<<3) /* Device number */
  552. #define TSI148_PCFS_PCIXSTAT_FN_M (7<<0) /* Function Number */
  553. /*
  554. * LCSR Registers
  555. */
  556. /*
  557. * Outbound Translation Starting Address Lower
  558. */
  559. #define TSI148_LCSR_OTSAL_M (0xFFFF<<16) /* Mask */
  560. /*
  561. * Outbound Translation Ending Address Lower
  562. */
  563. #define TSI148_LCSR_OTEAL_M (0xFFFF<<16) /* Mask */
  564. /*
  565. * Outbound Translation Offset Lower
  566. */
  567. #define TSI148_LCSR_OTOFFL_M (0xFFFF<<16) /* Mask */
  568. /*
  569. * Outbound Translation 2eSST Broadcast Select
  570. */
  571. #define TSI148_LCSR_OTBS_M (0xFFFFF<<0) /* Mask */
  572. /*
  573. * Outbound Translation Attribute
  574. */
  575. #define TSI148_LCSR_OTAT_EN (1<<31) /* Window Enable */
  576. #define TSI148_LCSR_OTAT_MRPFD (1<<18) /* Prefetch Disable */
  577. #define TSI148_LCSR_OTAT_PFS_M (3<<16) /* Prefetch Size Mask */
  578. #define TSI148_LCSR_OTAT_PFS_2 (0<<16) /* 2 Cache Lines P Size */
  579. #define TSI148_LCSR_OTAT_PFS_4 (1<<16) /* 4 Cache Lines P Size */
  580. #define TSI148_LCSR_OTAT_PFS_8 (2<<16) /* 8 Cache Lines P Size */
  581. #define TSI148_LCSR_OTAT_PFS_16 (3<<16) /* 16 Cache Lines P Size */
  582. #define TSI148_LCSR_OTAT_2eSSTM_M (7<<11) /* 2eSST Xfer Rate Mask */
  583. #define TSI148_LCSR_OTAT_2eSSTM_160 (0<<11) /* 160MB/s 2eSST Xfer Rate */
  584. #define TSI148_LCSR_OTAT_2eSSTM_267 (1<<11) /* 267MB/s 2eSST Xfer Rate */
  585. #define TSI148_LCSR_OTAT_2eSSTM_320 (2<<11) /* 320MB/s 2eSST Xfer Rate */
  586. #define TSI148_LCSR_OTAT_TM_M (7<<8) /* Xfer Protocol Mask */
  587. #define TSI148_LCSR_OTAT_TM_SCT (0<<8) /* SCT Xfer Protocol */
  588. #define TSI148_LCSR_OTAT_TM_BLT (1<<8) /* BLT Xfer Protocol */
  589. #define TSI148_LCSR_OTAT_TM_MBLT (2<<8) /* MBLT Xfer Protocol */
  590. #define TSI148_LCSR_OTAT_TM_2eVME (3<<8) /* 2eVME Xfer Protocol */
  591. #define TSI148_LCSR_OTAT_TM_2eSST (4<<8) /* 2eSST Xfer Protocol */
  592. #define TSI148_LCSR_OTAT_TM_2eSSTB (5<<8) /* 2eSST Bcast Xfer Protocol */
  593. #define TSI148_LCSR_OTAT_DBW_M (3<<6) /* Max Data Width */
  594. #define TSI148_LCSR_OTAT_DBW_16 (0<<6) /* 16-bit Data Width */
  595. #define TSI148_LCSR_OTAT_DBW_32 (1<<6) /* 32-bit Data Width */
  596. #define TSI148_LCSR_OTAT_SUP (1<<5) /* Supervisory Access */
  597. #define TSI148_LCSR_OTAT_PGM (1<<4) /* Program Access */
  598. #define TSI148_LCSR_OTAT_AMODE_M (0xf<<0) /* Address Mode Mask */
  599. #define TSI148_LCSR_OTAT_AMODE_A16 (0<<0) /* A16 Address Space */
  600. #define TSI148_LCSR_OTAT_AMODE_A24 (1<<0) /* A24 Address Space */
  601. #define TSI148_LCSR_OTAT_AMODE_A32 (2<<0) /* A32 Address Space */
  602. #define TSI148_LCSR_OTAT_AMODE_A64 (4<<0) /* A32 Address Space */
  603. #define TSI148_LCSR_OTAT_AMODE_CRCSR (5<<0) /* CR/CSR Address Space */
  604. #define TSI148_LCSR_OTAT_AMODE_USER1 (8<<0) /* User1 Address Space */
  605. #define TSI148_LCSR_OTAT_AMODE_USER2 (9<<0) /* User2 Address Space */
  606. #define TSI148_LCSR_OTAT_AMODE_USER3 (10<<0) /* User3 Address Space */
  607. #define TSI148_LCSR_OTAT_AMODE_USER4 (11<<0) /* User4 Address Space */
  608. /*
  609. * VME Master Control Register CRG+$234
  610. */
  611. #define TSI148_LCSR_VMCTRL_VSA (1<<27) /* VMEbus Stop Ack */
  612. #define TSI148_LCSR_VMCTRL_VS (1<<26) /* VMEbus Stop */
  613. #define TSI148_LCSR_VMCTRL_DHB (1<<25) /* Device Has Bus */
  614. #define TSI148_LCSR_VMCTRL_DWB (1<<24) /* Device Wants Bus */
  615. #define TSI148_LCSR_VMCTRL_RMWEN (1<<20) /* RMW Enable */
  616. #define TSI148_LCSR_VMCTRL_ATO_M (7<<16) /* Master Access Time-out Mask
  617. */
  618. #define TSI148_LCSR_VMCTRL_ATO_32 (0<<16) /* 32 us */
  619. #define TSI148_LCSR_VMCTRL_ATO_128 (1<<16) /* 128 us */
  620. #define TSI148_LCSR_VMCTRL_ATO_512 (2<<16) /* 512 us */
  621. #define TSI148_LCSR_VMCTRL_ATO_2M (3<<16) /* 2 ms */
  622. #define TSI148_LCSR_VMCTRL_ATO_8M (4<<16) /* 8 ms */
  623. #define TSI148_LCSR_VMCTRL_ATO_32M (5<<16) /* 32 ms */
  624. #define TSI148_LCSR_VMCTRL_ATO_128M (6<<16) /* 128 ms */
  625. #define TSI148_LCSR_VMCTRL_ATO_DIS (7<<16) /* Disabled */
  626. #define TSI148_LCSR_VMCTRL_VTOFF_M (7<<12) /* VMEbus Master Time off */
  627. #define TSI148_LCSR_VMCTRL_VTOFF_0 (0<<12) /* 0us */
  628. #define TSI148_LCSR_VMCTRL_VTOFF_1 (1<<12) /* 1us */
  629. #define TSI148_LCSR_VMCTRL_VTOFF_2 (2<<12) /* 2us */
  630. #define TSI148_LCSR_VMCTRL_VTOFF_4 (3<<12) /* 4us */
  631. #define TSI148_LCSR_VMCTRL_VTOFF_8 (4<<12) /* 8us */
  632. #define TSI148_LCSR_VMCTRL_VTOFF_16 (5<<12) /* 16us */
  633. #define TSI148_LCSR_VMCTRL_VTOFF_32 (6<<12) /* 32us */
  634. #define TSI148_LCSR_VMCTRL_VTOFF_64 (7<<12) /* 64us */
  635. #define TSI148_LCSR_VMCTRL_VTON_M (7<<8) /* VMEbus Master Time On */
  636. #define TSI148_LCSR_VMCTRL_VTON_4 (0<<8) /* 8us */
  637. #define TSI148_LCSR_VMCTRL_VTON_8 (1<<8) /* 8us */
  638. #define TSI148_LCSR_VMCTRL_VTON_16 (2<<8) /* 16us */
  639. #define TSI148_LCSR_VMCTRL_VTON_32 (3<<8) /* 32us */
  640. #define TSI148_LCSR_VMCTRL_VTON_64 (4<<8) /* 64us */
  641. #define TSI148_LCSR_VMCTRL_VTON_128 (5<<8) /* 128us */
  642. #define TSI148_LCSR_VMCTRL_VTON_256 (6<<8) /* 256us */
  643. #define TSI148_LCSR_VMCTRL_VTON_512 (7<<8) /* 512us */
  644. #define TSI148_LCSR_VMCTRL_VREL_M (3<<3) /* VMEbus Master Rel Mode Mask
  645. */
  646. #define TSI148_LCSR_VMCTRL_VREL_T_D (0<<3) /* Time on or Done */
  647. #define TSI148_LCSR_VMCTRL_VREL_T_R_D (1<<3) /* Time on and REQ or Done */
  648. #define TSI148_LCSR_VMCTRL_VREL_T_B_D (2<<3) /* Time on and BCLR or Done */
  649. #define TSI148_LCSR_VMCTRL_VREL_T_D_R (3<<3) /* Time on or Done and REQ */
  650. #define TSI148_LCSR_VMCTRL_VFAIR (1<<2) /* VMEbus Master Fair Mode */
  651. #define TSI148_LCSR_VMCTRL_VREQL_M (3<<0) /* VMEbus Master Req Level Mask
  652. */
  653. /*
  654. * VMEbus Control Register CRG+$238
  655. */
  656. #define TSI148_LCSR_VCTRL_LRE (1<<31) /* Late Retry Enable */
  657. #define TSI148_LCSR_VCTRL_DLT_M (0xF<<24) /* Deadlock Timer */
  658. #define TSI148_LCSR_VCTRL_DLT_OFF (0<<24) /* Deadlock Timer Off */
  659. #define TSI148_LCSR_VCTRL_DLT_16 (1<<24) /* 16 VCLKS */
  660. #define TSI148_LCSR_VCTRL_DLT_32 (2<<24) /* 32 VCLKS */
  661. #define TSI148_LCSR_VCTRL_DLT_64 (3<<24) /* 64 VCLKS */
  662. #define TSI148_LCSR_VCTRL_DLT_128 (4<<24) /* 128 VCLKS */
  663. #define TSI148_LCSR_VCTRL_DLT_256 (5<<24) /* 256 VCLKS */
  664. #define TSI148_LCSR_VCTRL_DLT_512 (6<<24) /* 512 VCLKS */
  665. #define TSI148_LCSR_VCTRL_DLT_1024 (7<<24) /* 1024 VCLKS */
  666. #define TSI148_LCSR_VCTRL_DLT_2048 (8<<24) /* 2048 VCLKS */
  667. #define TSI148_LCSR_VCTRL_DLT_4096 (9<<24) /* 4096 VCLKS */
  668. #define TSI148_LCSR_VCTRL_DLT_8192 (0xA<<24) /* 8192 VCLKS */
  669. #define TSI148_LCSR_VCTRL_DLT_16384 (0xB<<24) /* 16384 VCLKS */
  670. #define TSI148_LCSR_VCTRL_DLT_32768 (0xC<<24) /* 32768 VCLKS */
  671. #define TSI148_LCSR_VCTRL_NERBB (1<<20) /* No Early Release of Bus Busy
  672. */
  673. #define TSI148_LCSR_VCTRL_SRESET (1<<17) /* System Reset */
  674. #define TSI148_LCSR_VCTRL_LRESET (1<<16) /* Local Reset */
  675. #define TSI148_LCSR_VCTRL_SFAILAI (1<<15) /* SYSFAIL Auto Slot ID */
  676. #define TSI148_LCSR_VCTRL_BID_M (0x1F<<8) /* Broadcast ID Mask */
  677. #define TSI148_LCSR_VCTRL_ATOEN (1<<7) /* Arbiter Time-out Enable */
  678. #define TSI148_LCSR_VCTRL_ROBIN (1<<6) /* VMEbus Round Robin */
  679. #define TSI148_LCSR_VCTRL_GTO_M (7<<0) /* VMEbus Global Time-out Mask
  680. */
  681. #define TSI148_LCSR_VCTRL_GTO_8 (0<<0) /* 8 us */
  682. #define TSI148_LCSR_VCTRL_GTO_16 (1<<0) /* 16 us */
  683. #define TSI148_LCSR_VCTRL_GTO_32 (2<<0) /* 32 us */
  684. #define TSI148_LCSR_VCTRL_GTO_64 (3<<0) /* 64 us */
  685. #define TSI148_LCSR_VCTRL_GTO_128 (4<<0) /* 128 us */
  686. #define TSI148_LCSR_VCTRL_GTO_256 (5<<0) /* 256 us */
  687. #define TSI148_LCSR_VCTRL_GTO_512 (6<<0) /* 512 us */
  688. #define TSI148_LCSR_VCTRL_GTO_DIS (7<<0) /* Disabled */
  689. /*
  690. * VMEbus Status Register CRG + $23C
  691. */
  692. #define TSI148_LCSR_VSTAT_CPURST (1<<15) /* Clear power up reset */
  693. #define TSI148_LCSR_VSTAT_BRDFL (1<<14) /* Board fail */
  694. #define TSI148_LCSR_VSTAT_PURSTS (1<<12) /* Power up reset status */
  695. #define TSI148_LCSR_VSTAT_BDFAILS (1<<11) /* Board Fail Status */
  696. #define TSI148_LCSR_VSTAT_SYSFAILS (1<<10) /* System Fail Status */
  697. #define TSI148_LCSR_VSTAT_ACFAILS (1<<9) /* AC fail status */
  698. #define TSI148_LCSR_VSTAT_SCONS (1<<8) /* System Cont Status */
  699. #define TSI148_LCSR_VSTAT_GAP (1<<5) /* Geographic Addr Parity */
  700. #define TSI148_LCSR_VSTAT_GA_M (0x1F<<0) /* Geographic Addr Mask */
  701. /*
  702. * PCI Configuration Status Register CRG+$240
  703. */
  704. #define TSI148_LCSR_PSTAT_REQ64S (1<<6) /* Request 64 status set */
  705. #define TSI148_LCSR_PSTAT_M66ENS (1<<5) /* M66ENS 66Mhz enable */
  706. #define TSI148_LCSR_PSTAT_FRAMES (1<<4) /* Frame Status */
  707. #define TSI148_LCSR_PSTAT_IRDYS (1<<3) /* IRDY status */
  708. #define TSI148_LCSR_PSTAT_DEVSELS (1<<2) /* DEVL status */
  709. #define TSI148_LCSR_PSTAT_STOPS (1<<1) /* STOP status */
  710. #define TSI148_LCSR_PSTAT_TRDYS (1<<0) /* TRDY status */
  711. /*
  712. * VMEbus Exception Attributes Register CRG + $268
  713. */
  714. #define TSI148_LCSR_VEAT_VES (1<<31) /* Status */
  715. #define TSI148_LCSR_VEAT_VEOF (1<<30) /* Overflow */
  716. #define TSI148_LCSR_VEAT_VESCL (1<<29) /* Status Clear */
  717. #define TSI148_LCSR_VEAT_2EOT (1<<21) /* 2e Odd Termination */
  718. #define TSI148_LCSR_VEAT_2EST (1<<20) /* 2e Slave terminated */
  719. #define TSI148_LCSR_VEAT_BERR (1<<19) /* Bus Error */
  720. #define TSI148_LCSR_VEAT_LWORD (1<<18) /* LWORD_ signal state */
  721. #define TSI148_LCSR_VEAT_WRITE (1<<17) /* WRITE_ signal state */
  722. #define TSI148_LCSR_VEAT_IACK (1<<16) /* IACK_ signal state */
  723. #define TSI148_LCSR_VEAT_DS1 (1<<15) /* DS1_ signal state */
  724. #define TSI148_LCSR_VEAT_DS0 (1<<14) /* DS0_ signal state */
  725. #define TSI148_LCSR_VEAT_AM_M (0x3F<<8) /* Address Mode Mask */
  726. #define TSI148_LCSR_VEAT_XAM_M (0xFF<<0) /* Master AMode Mask */
  727. /*
  728. * VMEbus PCI Error Diagnostics PCI/X Attributes Register CRG + $280
  729. */
  730. #define TSI148_LCSR_EDPAT_EDPCL (1<<29)
  731. /*
  732. * Inbound Translation Starting Address Lower
  733. */
  734. #define TSI148_LCSR_ITSAL6432_M (0xFFFF<<16) /* Mask */
  735. #define TSI148_LCSR_ITSAL24_M (0x00FFF<<12) /* Mask */
  736. #define TSI148_LCSR_ITSAL16_M (0x0000FFF<<4) /* Mask */
  737. /*
  738. * Inbound Translation Ending Address Lower
  739. */
  740. #define TSI148_LCSR_ITEAL6432_M (0xFFFF<<16) /* Mask */
  741. #define TSI148_LCSR_ITEAL24_M (0x00FFF<<12) /* Mask */
  742. #define TSI148_LCSR_ITEAL16_M (0x0000FFF<<4) /* Mask */
  743. /*
  744. * Inbound Translation Offset Lower
  745. */
  746. #define TSI148_LCSR_ITOFFL6432_M (0xFFFF<<16) /* Mask */
  747. #define TSI148_LCSR_ITOFFL24_M (0xFFFFF<<12) /* Mask */
  748. #define TSI148_LCSR_ITOFFL16_M (0xFFFFFFF<<4) /* Mask */
  749. /*
  750. * Inbound Translation Attribute
  751. */
  752. #define TSI148_LCSR_ITAT_EN (1<<31) /* Window Enable */
  753. #define TSI148_LCSR_ITAT_TH (1<<18) /* Prefetch Threshold */
  754. #define TSI148_LCSR_ITAT_VFS_M (3<<16) /* Virtual FIFO Size Mask */
  755. #define TSI148_LCSR_ITAT_VFS_64 (0<<16) /* 64 bytes Virtual FIFO Size */
  756. #define TSI148_LCSR_ITAT_VFS_128 (1<<16) /* 128 bytes Virtual FIFO Sz */
  757. #define TSI148_LCSR_ITAT_VFS_256 (2<<16) /* 256 bytes Virtual FIFO Sz */
  758. #define TSI148_LCSR_ITAT_VFS_512 (3<<16) /* 512 bytes Virtual FIFO Sz */
  759. #define TSI148_LCSR_ITAT_2eSSTM_M (7<<12) /* 2eSST Xfer Rate Mask */
  760. #define TSI148_LCSR_ITAT_2eSSTM_160 (0<<12) /* 160MB/s 2eSST Xfer Rate */
  761. #define TSI148_LCSR_ITAT_2eSSTM_267 (1<<12) /* 267MB/s 2eSST Xfer Rate */
  762. #define TSI148_LCSR_ITAT_2eSSTM_320 (2<<12) /* 320MB/s 2eSST Xfer Rate */
  763. #define TSI148_LCSR_ITAT_2eSSTB (1<<11) /* 2eSST Bcast Xfer Protocol */
  764. #define TSI148_LCSR_ITAT_2eSST (1<<10) /* 2eSST Xfer Protocol */
  765. #define TSI148_LCSR_ITAT_2eVME (1<<9) /* 2eVME Xfer Protocol */
  766. #define TSI148_LCSR_ITAT_MBLT (1<<8) /* MBLT Xfer Protocol */
  767. #define TSI148_LCSR_ITAT_BLT (1<<7) /* BLT Xfer Protocol */
  768. #define TSI148_LCSR_ITAT_AS_M (7<<4) /* Address Space Mask */
  769. #define TSI148_LCSR_ITAT_AS_A16 (0<<4) /* A16 Address Space */
  770. #define TSI148_LCSR_ITAT_AS_A24 (1<<4) /* A24 Address Space */
  771. #define TSI148_LCSR_ITAT_AS_A32 (2<<4) /* A32 Address Space */
  772. #define TSI148_LCSR_ITAT_AS_A64 (4<<4) /* A64 Address Space */
  773. #define TSI148_LCSR_ITAT_SUPR (1<<3) /* Supervisor Access */
  774. #define TSI148_LCSR_ITAT_NPRIV (1<<2) /* Non-Priv (User) Access */
  775. #define TSI148_LCSR_ITAT_PGM (1<<1) /* Program Access */
  776. #define TSI148_LCSR_ITAT_DATA (1<<0) /* Data Access */
  777. /*
  778. * GCSR Base Address Lower Address CRG +$404
  779. */
  780. #define TSI148_LCSR_GBAL_M (0x7FFFFFF<<5) /* Mask */
  781. /*
  782. * GCSR Attribute Register CRG + $408
  783. */
  784. #define TSI148_LCSR_GCSRAT_EN (1<<7) /* Enable access to GCSR */
  785. #define TSI148_LCSR_GCSRAT_AS_M (7<<4) /* Address Space Mask */
  786. #define TSI148_LCSR_GCSRAT_AS_A16 (0<<4) /* Address Space 16 */
  787. #define TSI148_LCSR_GCSRAT_AS_A24 (1<<4) /* Address Space 24 */
  788. #define TSI148_LCSR_GCSRAT_AS_A32 (2<<4) /* Address Space 32 */
  789. #define TSI148_LCSR_GCSRAT_AS_A64 (4<<4) /* Address Space 64 */
  790. #define TSI148_LCSR_GCSRAT_SUPR (1<<3) /* Sup set -GCSR decoder */
  791. #define TSI148_LCSR_GCSRAT_NPRIV (1<<2) /* Non-Privliged set - CGSR */
  792. #define TSI148_LCSR_GCSRAT_PGM (1<<1) /* Program set - GCSR decoder */
  793. #define TSI148_LCSR_GCSRAT_DATA (1<<0) /* DATA set GCSR decoder */
  794. /*
  795. * CRG Base Address Lower Address CRG + $410
  796. */
  797. #define TSI148_LCSR_CBAL_M (0xFFFFF<<12)
  798. /*
  799. * CRG Attribute Register CRG + $414
  800. */
  801. #define TSI148_LCSR_CRGAT_EN (1<<7) /* Enable PRG Access */
  802. #define TSI148_LCSR_CRGAT_AS_M (7<<4) /* Address Space */
  803. #define TSI148_LCSR_CRGAT_AS_A16 (0<<4) /* Address Space 16 */
  804. #define TSI148_LCSR_CRGAT_AS_A24 (1<<4) /* Address Space 24 */
  805. #define TSI148_LCSR_CRGAT_AS_A32 (2<<4) /* Address Space 32 */
  806. #define TSI148_LCSR_CRGAT_AS_A64 (4<<4) /* Address Space 64 */
  807. #define TSI148_LCSR_CRGAT_SUPR (1<<3) /* Supervisor Access */
  808. #define TSI148_LCSR_CRGAT_NPRIV (1<<2) /* Non-Privliged(User) Access */
  809. #define TSI148_LCSR_CRGAT_PGM (1<<1) /* Program Access */
  810. #define TSI148_LCSR_CRGAT_DATA (1<<0) /* Data Access */
  811. /*
  812. * CR/CSR Offset Lower Register CRG + $41C
  813. */
  814. #define TSI148_LCSR_CROL_M (0x1FFF<<19) /* Mask */
  815. /*
  816. * CR/CSR Attribute register CRG + $420
  817. */
  818. #define TSI148_LCSR_CRAT_EN (1<<7) /* Enable access to CR/CSR */
  819. /*
  820. * Location Monitor base address lower register CRG + $428
  821. */
  822. #define TSI148_LCSR_LMBAL_M (0x7FFFFFF<<5) /* Mask */
  823. /*
  824. * Location Monitor Attribute Register CRG + $42C
  825. */
  826. #define TSI148_LCSR_LMAT_EN (1<<7) /* Enable Location Monitor */
  827. #define TSI148_LCSR_LMAT_AS_M (7<<4) /* Address Space MASK */
  828. #define TSI148_LCSR_LMAT_AS_A16 (0<<4) /* A16 */
  829. #define TSI148_LCSR_LMAT_AS_A24 (1<<4) /* A24 */
  830. #define TSI148_LCSR_LMAT_AS_A32 (2<<4) /* A32 */
  831. #define TSI148_LCSR_LMAT_AS_A64 (4<<4) /* A64 */
  832. #define TSI148_LCSR_LMAT_SUPR (1<<3) /* Supervisor Access */
  833. #define TSI148_LCSR_LMAT_NPRIV (1<<2) /* Non-Priv (User) Access */
  834. #define TSI148_LCSR_LMAT_PGM (1<<1) /* Program Access */
  835. #define TSI148_LCSR_LMAT_DATA (1<<0) /* Data Access */
  836. /*
  837. * Broadcast Pulse Generator Timer Register CRG + $438
  838. */
  839. #define TSI148_LCSR_BPGTR_BPGT_M (0xFFFF<<0) /* Mask */
  840. /*
  841. * Broadcast Programmable Clock Timer Register CRG + $43C
  842. */
  843. #define TSI148_LCSR_BPCTR_BPCT_M (0xFFFFFF<<0) /* Mask */
  844. /*
  845. * VMEbus Interrupt Control Register CRG + $43C
  846. */
  847. #define TSI148_LCSR_VICR_CNTS_M (3<<22) /* Cntr Source MASK */
  848. #define TSI148_LCSR_VICR_CNTS_DIS (1<<22) /* Cntr Disable */
  849. #define TSI148_LCSR_VICR_CNTS_IRQ1 (2<<22) /* IRQ1 to Cntr */
  850. #define TSI148_LCSR_VICR_CNTS_IRQ2 (3<<22) /* IRQ2 to Cntr */
  851. #define TSI148_LCSR_VICR_EDGIS_M (3<<20) /* Edge interrupt MASK */
  852. #define TSI148_LCSR_VICR_EDGIS_DIS (1<<20) /* Edge interrupt Disable */
  853. #define TSI148_LCSR_VICR_EDGIS_IRQ1 (2<<20) /* IRQ1 to Edge */
  854. #define TSI148_LCSR_VICR_EDGIS_IRQ2 (3<<20) /* IRQ2 to Edge */
  855. #define TSI148_LCSR_VICR_IRQIF_M (3<<18) /* IRQ1* Function MASK */
  856. #define TSI148_LCSR_VICR_IRQIF_NORM (1<<18) /* Normal */
  857. #define TSI148_LCSR_VICR_IRQIF_PULSE (2<<18) /* Pulse Generator */
  858. #define TSI148_LCSR_VICR_IRQIF_PROG (3<<18) /* Programmable Clock */
  859. #define TSI148_LCSR_VICR_IRQIF_1U (4<<18) /* 1us Clock */
  860. #define TSI148_LCSR_VICR_IRQ2F_M (3<<16) /* IRQ2* Function MASK */
  861. #define TSI148_LCSR_VICR_IRQ2F_NORM (1<<16) /* Normal */
  862. #define TSI148_LCSR_VICR_IRQ2F_PULSE (2<<16) /* Pulse Generator */
  863. #define TSI148_LCSR_VICR_IRQ2F_PROG (3<<16) /* Programmable Clock */
  864. #define TSI148_LCSR_VICR_IRQ2F_1U (4<<16) /* 1us Clock */
  865. #define TSI148_LCSR_VICR_BIP (1<<15) /* Broadcast Interrupt Pulse */
  866. #define TSI148_LCSR_VICR_IRQC (1<<12) /* VMEbus IRQ Clear */
  867. #define TSI148_LCSR_VICR_IRQS (1<<11) /* VMEbus IRQ Status */
  868. #define TSI148_LCSR_VICR_IRQL_M (7<<8) /* VMEbus SW IRQ Level Mask */
  869. #define TSI148_LCSR_VICR_IRQL_1 (1<<8) /* VMEbus SW IRQ Level 1 */
  870. #define TSI148_LCSR_VICR_IRQL_2 (2<<8) /* VMEbus SW IRQ Level 2 */
  871. #define TSI148_LCSR_VICR_IRQL_3 (3<<8) /* VMEbus SW IRQ Level 3 */
  872. #define TSI148_LCSR_VICR_IRQL_4 (4<<8) /* VMEbus SW IRQ Level 4 */
  873. #define TSI148_LCSR_VICR_IRQL_5 (5<<8) /* VMEbus SW IRQ Level 5 */
  874. #define TSI148_LCSR_VICR_IRQL_6 (6<<8) /* VMEbus SW IRQ Level 6 */
  875. #define TSI148_LCSR_VICR_IRQL_7 (7<<8) /* VMEbus SW IRQ Level 7 */
  876. static const int TSI148_LCSR_VICR_IRQL[8] = { 0, TSI148_LCSR_VICR_IRQL_1,
  877. TSI148_LCSR_VICR_IRQL_2, TSI148_LCSR_VICR_IRQL_3,
  878. TSI148_LCSR_VICR_IRQL_4, TSI148_LCSR_VICR_IRQL_5,
  879. TSI148_LCSR_VICR_IRQL_6, TSI148_LCSR_VICR_IRQL_7 };
  880. #define TSI148_LCSR_VICR_STID_M (0xFF<<0) /* Status/ID Mask */
  881. /*
  882. * Interrupt Enable Register CRG + $440
  883. */
  884. #define TSI148_LCSR_INTEN_DMA1EN (1<<25) /* DMAC 1 */
  885. #define TSI148_LCSR_INTEN_DMA0EN (1<<24) /* DMAC 0 */
  886. #define TSI148_LCSR_INTEN_LM3EN (1<<23) /* Location Monitor 3 */
  887. #define TSI148_LCSR_INTEN_LM2EN (1<<22) /* Location Monitor 2 */
  888. #define TSI148_LCSR_INTEN_LM1EN (1<<21) /* Location Monitor 1 */
  889. #define TSI148_LCSR_INTEN_LM0EN (1<<20) /* Location Monitor 0 */
  890. #define TSI148_LCSR_INTEN_MB3EN (1<<19) /* Mail Box 3 */
  891. #define TSI148_LCSR_INTEN_MB2EN (1<<18) /* Mail Box 2 */
  892. #define TSI148_LCSR_INTEN_MB1EN (1<<17) /* Mail Box 1 */
  893. #define TSI148_LCSR_INTEN_MB0EN (1<<16) /* Mail Box 0 */
  894. #define TSI148_LCSR_INTEN_PERREN (1<<13) /* PCI/X Error */
  895. #define TSI148_LCSR_INTEN_VERREN (1<<12) /* VMEbus Error */
  896. #define TSI148_LCSR_INTEN_VIEEN (1<<11) /* VMEbus IRQ Edge */
  897. #define TSI148_LCSR_INTEN_IACKEN (1<<10) /* IACK */
  898. #define TSI148_LCSR_INTEN_SYSFLEN (1<<9) /* System Fail */
  899. #define TSI148_LCSR_INTEN_ACFLEN (1<<8) /* AC Fail */
  900. #define TSI148_LCSR_INTEN_IRQ7EN (1<<7) /* IRQ7 */
  901. #define TSI148_LCSR_INTEN_IRQ6EN (1<<6) /* IRQ6 */
  902. #define TSI148_LCSR_INTEN_IRQ5EN (1<<5) /* IRQ5 */
  903. #define TSI148_LCSR_INTEN_IRQ4EN (1<<4) /* IRQ4 */
  904. #define TSI148_LCSR_INTEN_IRQ3EN (1<<3) /* IRQ3 */
  905. #define TSI148_LCSR_INTEN_IRQ2EN (1<<2) /* IRQ2 */
  906. #define TSI148_LCSR_INTEN_IRQ1EN (1<<1) /* IRQ1 */
  907. static const int TSI148_LCSR_INTEN_LMEN[4] = { TSI148_LCSR_INTEN_LM0EN,
  908. TSI148_LCSR_INTEN_LM1EN,
  909. TSI148_LCSR_INTEN_LM2EN,
  910. TSI148_LCSR_INTEN_LM3EN };
  911. static const int TSI148_LCSR_INTEN_IRQEN[7] = { TSI148_LCSR_INTEN_IRQ1EN,
  912. TSI148_LCSR_INTEN_IRQ2EN,
  913. TSI148_LCSR_INTEN_IRQ3EN,
  914. TSI148_LCSR_INTEN_IRQ4EN,
  915. TSI148_LCSR_INTEN_IRQ5EN,
  916. TSI148_LCSR_INTEN_IRQ6EN,
  917. TSI148_LCSR_INTEN_IRQ7EN };
  918. /*
  919. * Interrupt Enable Out Register CRG + $444
  920. */
  921. #define TSI148_LCSR_INTEO_DMA1EO (1<<25) /* DMAC 1 */
  922. #define TSI148_LCSR_INTEO_DMA0EO (1<<24) /* DMAC 0 */
  923. #define TSI148_LCSR_INTEO_LM3EO (1<<23) /* Loc Monitor 3 */
  924. #define TSI148_LCSR_INTEO_LM2EO (1<<22) /* Loc Monitor 2 */
  925. #define TSI148_LCSR_INTEO_LM1EO (1<<21) /* Loc Monitor 1 */
  926. #define TSI148_LCSR_INTEO_LM0EO (1<<20) /* Location Monitor 0 */
  927. #define TSI148_LCSR_INTEO_MB3EO (1<<19) /* Mail Box 3 */
  928. #define TSI148_LCSR_INTEO_MB2EO (1<<18) /* Mail Box 2 */
  929. #define TSI148_LCSR_INTEO_MB1EO (1<<17) /* Mail Box 1 */
  930. #define TSI148_LCSR_INTEO_MB0EO (1<<16) /* Mail Box 0 */
  931. #define TSI148_LCSR_INTEO_PERREO (1<<13) /* PCI/X Error */
  932. #define TSI148_LCSR_INTEO_VERREO (1<<12) /* VMEbus Error */
  933. #define TSI148_LCSR_INTEO_VIEEO (1<<11) /* VMEbus IRQ Edge */
  934. #define TSI148_LCSR_INTEO_IACKEO (1<<10) /* IACK */
  935. #define TSI148_LCSR_INTEO_SYSFLEO (1<<9) /* System Fail */
  936. #define TSI148_LCSR_INTEO_ACFLEO (1<<8) /* AC Fail */
  937. #define TSI148_LCSR_INTEO_IRQ7EO (1<<7) /* IRQ7 */
  938. #define TSI148_LCSR_INTEO_IRQ6EO (1<<6) /* IRQ6 */
  939. #define TSI148_LCSR_INTEO_IRQ5EO (1<<5) /* IRQ5 */
  940. #define TSI148_LCSR_INTEO_IRQ4EO (1<<4) /* IRQ4 */
  941. #define TSI148_LCSR_INTEO_IRQ3EO (1<<3) /* IRQ3 */
  942. #define TSI148_LCSR_INTEO_IRQ2EO (1<<2) /* IRQ2 */
  943. #define TSI148_LCSR_INTEO_IRQ1EO (1<<1) /* IRQ1 */
  944. static const int TSI148_LCSR_INTEO_LMEO[4] = { TSI148_LCSR_INTEO_LM0EO,
  945. TSI148_LCSR_INTEO_LM1EO,
  946. TSI148_LCSR_INTEO_LM2EO,
  947. TSI148_LCSR_INTEO_LM3EO };
  948. static const int TSI148_LCSR_INTEO_IRQEO[7] = { TSI148_LCSR_INTEO_IRQ1EO,
  949. TSI148_LCSR_INTEO_IRQ2EO,
  950. TSI148_LCSR_INTEO_IRQ3EO,
  951. TSI148_LCSR_INTEO_IRQ4EO,
  952. TSI148_LCSR_INTEO_IRQ5EO,
  953. TSI148_LCSR_INTEO_IRQ6EO,
  954. TSI148_LCSR_INTEO_IRQ7EO };
  955. /*
  956. * Interrupt Status Register CRG + $448
  957. */
  958. #define TSI148_LCSR_INTS_DMA1S (1<<25) /* DMA 1 */
  959. #define TSI148_LCSR_INTS_DMA0S (1<<24) /* DMA 0 */
  960. #define TSI148_LCSR_INTS_LM3S (1<<23) /* Location Monitor 3 */
  961. #define TSI148_LCSR_INTS_LM2S (1<<22) /* Location Monitor 2 */
  962. #define TSI148_LCSR_INTS_LM1S (1<<21) /* Location Monitor 1 */
  963. #define TSI148_LCSR_INTS_LM0S (1<<20) /* Location Monitor 0 */
  964. #define TSI148_LCSR_INTS_MB3S (1<<19) /* Mail Box 3 */
  965. #define TSI148_LCSR_INTS_MB2S (1<<18) /* Mail Box 2 */
  966. #define TSI148_LCSR_INTS_MB1S (1<<17) /* Mail Box 1 */
  967. #define TSI148_LCSR_INTS_MB0S (1<<16) /* Mail Box 0 */
  968. #define TSI148_LCSR_INTS_PERRS (1<<13) /* PCI/X Error */
  969. #define TSI148_LCSR_INTS_VERRS (1<<12) /* VMEbus Error */
  970. #define TSI148_LCSR_INTS_VIES (1<<11) /* VMEbus IRQ Edge */
  971. #define TSI148_LCSR_INTS_IACKS (1<<10) /* IACK */
  972. #define TSI148_LCSR_INTS_SYSFLS (1<<9) /* System Fail */
  973. #define TSI148_LCSR_INTS_ACFLS (1<<8) /* AC Fail */
  974. #define TSI148_LCSR_INTS_IRQ7S (1<<7) /* IRQ7 */
  975. #define TSI148_LCSR_INTS_IRQ6S (1<<6) /* IRQ6 */
  976. #define TSI148_LCSR_INTS_IRQ5S (1<<5) /* IRQ5 */
  977. #define TSI148_LCSR_INTS_IRQ4S (1<<4) /* IRQ4 */
  978. #define TSI148_LCSR_INTS_IRQ3S (1<<3) /* IRQ3 */
  979. #define TSI148_LCSR_INTS_IRQ2S (1<<2) /* IRQ2 */
  980. #define TSI148_LCSR_INTS_IRQ1S (1<<1) /* IRQ1 */
  981. static const int TSI148_LCSR_INTS_LMS[4] = { TSI148_LCSR_INTS_LM0S,
  982. TSI148_LCSR_INTS_LM1S,
  983. TSI148_LCSR_INTS_LM2S,
  984. TSI148_LCSR_INTS_LM3S };
  985. static const int TSI148_LCSR_INTS_MBS[4] = { TSI148_LCSR_INTS_MB0S,
  986. TSI148_LCSR_INTS_MB1S,
  987. TSI148_LCSR_INTS_MB2S,
  988. TSI148_LCSR_INTS_MB3S };
  989. /*
  990. * Interrupt Clear Register CRG + $44C
  991. */
  992. #define TSI148_LCSR_INTC_DMA1C (1<<25) /* DMA 1 */
  993. #define TSI148_LCSR_INTC_DMA0C (1<<24) /* DMA 0 */
  994. #define TSI148_LCSR_INTC_LM3C (1<<23) /* Location Monitor 3 */
  995. #define TSI148_LCSR_INTC_LM2C (1<<22) /* Location Monitor 2 */
  996. #define TSI148_LCSR_INTC_LM1C (1<<21) /* Location Monitor 1 */
  997. #define TSI148_LCSR_INTC_LM0C (1<<20) /* Location Monitor 0 */
  998. #define TSI148_LCSR_INTC_MB3C (1<<19) /* Mail Box 3 */
  999. #define TSI148_LCSR_INTC_MB2C (1<<18) /* Mail Box 2 */
  1000. #define TSI148_LCSR_INTC_MB1C (1<<17) /* Mail Box 1 */
  1001. #define TSI148_LCSR_INTC_MB0C (1<<16) /* Mail Box 0 */
  1002. #define TSI148_LCSR_INTC_PERRC (1<<13) /* VMEbus Error */
  1003. #define TSI148_LCSR_INTC_VERRC (1<<12) /* VMEbus Access Time-out */
  1004. #define TSI148_LCSR_INTC_VIEC (1<<11) /* VMEbus IRQ Edge */
  1005. #define TSI148_LCSR_INTC_IACKC (1<<10) /* IACK */
  1006. #define TSI148_LCSR_INTC_SYSFLC (1<<9) /* System Fail */
  1007. #define TSI148_LCSR_INTC_ACFLC (1<<8) /* AC Fail */
  1008. static const int TSI148_LCSR_INTC_LMC[4] = { TSI148_LCSR_INTC_LM0C,
  1009. TSI148_LCSR_INTC_LM1C,
  1010. TSI148_LCSR_INTC_LM2C,
  1011. TSI148_LCSR_INTC_LM3C };
  1012. static const int TSI148_LCSR_INTC_MBC[4] = { TSI148_LCSR_INTC_MB0C,
  1013. TSI148_LCSR_INTC_MB1C,
  1014. TSI148_LCSR_INTC_MB2C,
  1015. TSI148_LCSR_INTC_MB3C };
  1016. /*
  1017. * Interrupt Map Register 1 CRG + $458
  1018. */
  1019. #define TSI148_LCSR_INTM1_DMA1M_M (3<<18) /* DMA 1 */
  1020. #define TSI148_LCSR_INTM1_DMA0M_M (3<<16) /* DMA 0 */
  1021. #define TSI148_LCSR_INTM1_LM3M_M (3<<14) /* Location Monitor 3 */
  1022. #define TSI148_LCSR_INTM1_LM2M_M (3<<12) /* Location Monitor 2 */
  1023. #define TSI148_LCSR_INTM1_LM1M_M (3<<10) /* Location Monitor 1 */
  1024. #define TSI148_LCSR_INTM1_LM0M_M (3<<8) /* Location Monitor 0 */
  1025. #define TSI148_LCSR_INTM1_MB3M_M (3<<6) /* Mail Box 3 */
  1026. #define TSI148_LCSR_INTM1_MB2M_M (3<<4) /* Mail Box 2 */
  1027. #define TSI148_LCSR_INTM1_MB1M_M (3<<2) /* Mail Box 1 */
  1028. #define TSI148_LCSR_INTM1_MB0M_M (3<<0) /* Mail Box 0 */
  1029. /*
  1030. * Interrupt Map Register 2 CRG + $45C
  1031. */
  1032. #define TSI148_LCSR_INTM2_PERRM_M (3<<26) /* PCI Bus Error */
  1033. #define TSI148_LCSR_INTM2_VERRM_M (3<<24) /* VMEbus Error */
  1034. #define TSI148_LCSR_INTM2_VIEM_M (3<<22) /* VMEbus IRQ Edge */
  1035. #define TSI148_LCSR_INTM2_IACKM_M (3<<20) /* IACK */
  1036. #define TSI148_LCSR_INTM2_SYSFLM_M (3<<18) /* System Fail */
  1037. #define TSI148_LCSR_INTM2_ACFLM_M (3<<16) /* AC Fail */
  1038. #define TSI148_LCSR_INTM2_IRQ7M_M (3<<14) /* IRQ7 */
  1039. #define TSI148_LCSR_INTM2_IRQ6M_M (3<<12) /* IRQ6 */
  1040. #define TSI148_LCSR_INTM2_IRQ5M_M (3<<10) /* IRQ5 */
  1041. #define TSI148_LCSR_INTM2_IRQ4M_M (3<<8) /* IRQ4 */
  1042. #define TSI148_LCSR_INTM2_IRQ3M_M (3<<6) /* IRQ3 */
  1043. #define TSI148_LCSR_INTM2_IRQ2M_M (3<<4) /* IRQ2 */
  1044. #define TSI148_LCSR_INTM2_IRQ1M_M (3<<2) /* IRQ1 */
  1045. /*
  1046. * DMA Control (0-1) Registers CRG + $500
  1047. */
  1048. #define TSI148_LCSR_DCTL_ABT (1<<27) /* Abort */
  1049. #define TSI148_LCSR_DCTL_PAU (1<<26) /* Pause */
  1050. #define TSI148_LCSR_DCTL_DGO (1<<25) /* DMA Go */
  1051. #define TSI148_LCSR_DCTL_MOD (1<<23) /* Mode */
  1052. #define TSI148_LCSR_DCTL_VBKS_M (7<<12) /* VMEbus block Size MASK */
  1053. #define TSI148_LCSR_DCTL_VBKS_32 (0<<12) /* VMEbus block Size 32 */
  1054. #define TSI148_LCSR_DCTL_VBKS_64 (1<<12) /* VMEbus block Size 64 */
  1055. #define TSI148_LCSR_DCTL_VBKS_128 (2<<12) /* VMEbus block Size 128 */
  1056. #define TSI148_LCSR_DCTL_VBKS_256 (3<<12) /* VMEbus block Size 256 */
  1057. #define TSI148_LCSR_DCTL_VBKS_512 (4<<12) /* VMEbus block Size 512 */
  1058. #define TSI148_LCSR_DCTL_VBKS_1024 (5<<12) /* VMEbus block Size 1024 */
  1059. #define TSI148_LCSR_DCTL_VBKS_2048 (6<<12) /* VMEbus block Size 2048 */
  1060. #define TSI148_LCSR_DCTL_VBKS_4096 (7<<12) /* VMEbus block Size 4096 */
  1061. #define TSI148_LCSR_DCTL_VBOT_M (7<<8) /* VMEbus back-off MASK */
  1062. #define TSI148_LCSR_DCTL_VBOT_0 (0<<8) /* VMEbus back-off 0us */
  1063. #define TSI148_LCSR_DCTL_VBOT_1 (1<<8) /* VMEbus back-off 1us */
  1064. #define TSI148_LCSR_DCTL_VBOT_2 (2<<8) /* VMEbus back-off 2us */
  1065. #define TSI148_LCSR_DCTL_VBOT_4 (3<<8) /* VMEbus back-off 4us */
  1066. #define TSI148_LCSR_DCTL_VBOT_8 (4<<8) /* VMEbus back-off 8us */
  1067. #define TSI148_LCSR_DCTL_VBOT_16 (5<<8) /* VMEbus back-off 16us */
  1068. #define TSI148_LCSR_DCTL_VBOT_32 (6<<8) /* VMEbus back-off 32us */
  1069. #define TSI148_LCSR_DCTL_VBOT_64 (7<<8) /* VMEbus back-off 64us */
  1070. #define TSI148_LCSR_DCTL_PBKS_M (7<<4) /* PCI block size MASK */
  1071. #define TSI148_LCSR_DCTL_PBKS_32 (0<<4) /* PCI block size 32 bytes */
  1072. #define TSI148_LCSR_DCTL_PBKS_64 (1<<4) /* PCI block size 64 bytes */
  1073. #define TSI148_LCSR_DCTL_PBKS_128 (2<<4) /* PCI block size 128 bytes */
  1074. #define TSI148_LCSR_DCTL_PBKS_256 (3<<4) /* PCI block size 256 bytes */
  1075. #define TSI148_LCSR_DCTL_PBKS_512 (4<<4) /* PCI block size 512 bytes */
  1076. #define TSI148_LCSR_DCTL_PBKS_1024 (5<<4) /* PCI block size 1024 bytes */
  1077. #define TSI148_LCSR_DCTL_PBKS_2048 (6<<4) /* PCI block size 2048 bytes */
  1078. #define TSI148_LCSR_DCTL_PBKS_4096 (7<<4) /* PCI block size 4096 bytes */
  1079. #define TSI148_LCSR_DCTL_PBOT_M (7<<0) /* PCI back off MASK */
  1080. #define TSI148_LCSR_DCTL_PBOT_0 (0<<0) /* PCI back off 0us */
  1081. #define TSI148_LCSR_DCTL_PBOT_1 (1<<0) /* PCI back off 1us */
  1082. #define TSI148_LCSR_DCTL_PBOT_2 (2<<0) /* PCI back off 2us */
  1083. #define TSI148_LCSR_DCTL_PBOT_4 (3<<0) /* PCI back off 3us */
  1084. #define TSI148_LCSR_DCTL_PBOT_8 (4<<0) /* PCI back off 4us */
  1085. #define TSI148_LCSR_DCTL_PBOT_16 (5<<0) /* PCI back off 8us */
  1086. #define TSI148_LCSR_DCTL_PBOT_32 (6<<0) /* PCI back off 16us */
  1087. #define TSI148_LCSR_DCTL_PBOT_64 (7<<0) /* PCI back off 32us */
  1088. /*
  1089. * DMA Status Registers (0-1) CRG + $504
  1090. */
  1091. #define TSI148_LCSR_DSTA_SMA (1<<31) /* PCI Signalled Master Abt */
  1092. #define TSI148_LCSR_DSTA_RTA (1<<30) /* PCI Received Target Abt */
  1093. #define TSI148_LCSR_DSTA_MRC (1<<29) /* PCI Max Retry Count */
  1094. #define TSI148_LCSR_DSTA_VBE (1<<28) /* VMEbus error */
  1095. #define TSI148_LCSR_DSTA_ABT (1<<27) /* Abort */
  1096. #define TSI148_LCSR_DSTA_PAU (1<<26) /* Pause */
  1097. #define TSI148_LCSR_DSTA_DON (1<<25) /* Done */
  1098. #define TSI148_LCSR_DSTA_BSY (1<<24) /* Busy */
  1099. /*
  1100. * DMA Current Link Address Lower (0-1)
  1101. */
  1102. #define TSI148_LCSR_DCLAL_M (0x3FFFFFF<<6) /* Mask */
  1103. /*
  1104. * DMA Source Attribute (0-1) Reg
  1105. */
  1106. #define TSI148_LCSR_DSAT_TYP_M (3<<28) /* Source Bus Type */
  1107. #define TSI148_LCSR_DSAT_TYP_PCI (0<<28) /* PCI Bus */
  1108. #define TSI148_LCSR_DSAT_TYP_VME (1<<28) /* VMEbus */
  1109. #define TSI148_LCSR_DSAT_TYP_PAT (2<<28) /* Data Pattern */
  1110. #define TSI148_LCSR_DSAT_PSZ (1<<25) /* Pattern Size */
  1111. #define TSI148_LCSR_DSAT_NIN (1<<24) /* No Increment */
  1112. #define TSI148_LCSR_DSAT_2eSSTM_M (3<<11) /* 2eSST Trans Rate Mask */
  1113. #define TSI148_LCSR_DSAT_2eSSTM_160 (0<<11) /* 160 MB/s */
  1114. #define TSI148_LCSR_DSAT_2eSSTM_267 (1<<11) /* 267 MB/s */
  1115. #define TSI148_LCSR_DSAT_2eSSTM_320 (2<<11) /* 320 MB/s */
  1116. #define TSI148_LCSR_DSAT_TM_M (7<<8) /* Bus Transfer Protocol Mask */
  1117. #define TSI148_LCSR_DSAT_TM_SCT (0<<8) /* SCT */
  1118. #define TSI148_LCSR_DSAT_TM_BLT (1<<8) /* BLT */
  1119. #define TSI148_LCSR_DSAT_TM_MBLT (2<<8) /* MBLT */
  1120. #define TSI148_LCSR_DSAT_TM_2eVME (3<<8) /* 2eVME */
  1121. #define TSI148_LCSR_DSAT_TM_2eSST (4<<8) /* 2eSST */
  1122. #define TSI148_LCSR_DSAT_TM_2eSSTB (5<<8) /* 2eSST Broadcast */
  1123. #define TSI148_LCSR_DSAT_DBW_M (3<<6) /* Max Data Width MASK */
  1124. #define TSI148_LCSR_DSAT_DBW_16 (0<<6) /* 16 Bits */
  1125. #define TSI148_LCSR_DSAT_DBW_32 (1<<6) /* 32 Bits */
  1126. #define TSI148_LCSR_DSAT_SUP (1<<5) /* Supervisory Mode */
  1127. #define TSI148_LCSR_DSAT_PGM (1<<4) /* Program Mode */
  1128. #define TSI148_LCSR_DSAT_AMODE_M (0xf<<0) /* Address Space Mask */
  1129. #define TSI148_LCSR_DSAT_AMODE_A16 (0<<0) /* A16 */
  1130. #define TSI148_LCSR_DSAT_AMODE_A24 (1<<0) /* A24 */
  1131. #define TSI148_LCSR_DSAT_AMODE_A32 (2<<0) /* A32 */
  1132. #define TSI148_LCSR_DSAT_AMODE_A64 (4<<0) /* A64 */
  1133. #define TSI148_LCSR_DSAT_AMODE_CRCSR (5<<0) /* CR/CSR */
  1134. #define TSI148_LCSR_DSAT_AMODE_USER1 (8<<0) /* User1 */
  1135. #define TSI148_LCSR_DSAT_AMODE_USER2 (9<<0) /* User2 */
  1136. #define TSI148_LCSR_DSAT_AMODE_USER3 (0xa<<0) /* User3 */
  1137. #define TSI148_LCSR_DSAT_AMODE_USER4 (0xb<<0) /* User4 */
  1138. /*
  1139. * DMA Destination Attribute Registers (0-1)
  1140. */
  1141. #define TSI148_LCSR_DDAT_TYP_PCI (0<<28) /* Destination PCI Bus */
  1142. #define TSI148_LCSR_DDAT_TYP_VME (1<<28) /* Destination VMEbus */
  1143. #define TSI148_LCSR_DDAT_2eSSTM_M (3<<11) /* 2eSST Transfer Rate Mask */
  1144. #define TSI148_LCSR_DDAT_2eSSTM_160 (0<<11) /* 160 MB/s */
  1145. #define TSI148_LCSR_DDAT_2eSSTM_267 (1<<11) /* 267 MB/s */
  1146. #define TSI148_LCSR_DDAT_2eSSTM_320 (2<<11) /* 320 MB/s */
  1147. #define TSI148_LCSR_DDAT_TM_M (7<<8) /* Bus Transfer Protocol Mask */
  1148. #define TSI148_LCSR_DDAT_TM_SCT (0<<8) /* SCT */
  1149. #define TSI148_LCSR_DDAT_TM_BLT (1<<8) /* BLT */
  1150. #define TSI148_LCSR_DDAT_TM_MBLT (2<<8) /* MBLT */
  1151. #define TSI148_LCSR_DDAT_TM_2eVME (3<<8) /* 2eVME */
  1152. #define TSI148_LCSR_DDAT_TM_2eSST (4<<8) /* 2eSST */
  1153. #define TSI148_LCSR_DDAT_TM_2eSSTB (5<<8) /* 2eSST Broadcast */
  1154. #define TSI148_LCSR_DDAT_DBW_M (3<<6) /* Max Data Width MASK */
  1155. #define TSI148_LCSR_DDAT_DBW_16 (0<<6) /* 16 Bits */
  1156. #define TSI148_LCSR_DDAT_DBW_32 (1<<6) /* 32 Bits */
  1157. #define TSI148_LCSR_DDAT_SUP (1<<5) /* Supervisory/User Access */
  1158. #define TSI148_LCSR_DDAT_PGM (1<<4) /* Program/Data Access */
  1159. #define TSI148_LCSR_DDAT_AMODE_M (0xf<<0) /* Address Space Mask */
  1160. #define TSI148_LCSR_DDAT_AMODE_A16 (0<<0) /* A16 */
  1161. #define TSI148_LCSR_DDAT_AMODE_A24 (1<<0) /* A24 */
  1162. #define TSI148_LCSR_DDAT_AMODE_A32 (2<<0) /* A32 */
  1163. #define TSI148_LCSR_DDAT_AMODE_A64 (4<<0) /* A64 */
  1164. #define TSI148_LCSR_DDAT_AMODE_CRCSR (5<<0) /* CRC/SR */
  1165. #define TSI148_LCSR_DDAT_AMODE_USER1 (8<<0) /* User1 */
  1166. #define TSI148_LCSR_DDAT_AMODE_USER2 (9<<0) /* User2 */
  1167. #define TSI148_LCSR_DDAT_AMODE_USER3 (0xa<<0) /* User3 */
  1168. #define TSI148_LCSR_DDAT_AMODE_USER4 (0xb<<0) /* User4 */
  1169. /*
  1170. * DMA Next Link Address Lower
  1171. */
  1172. #define TSI148_LCSR_DNLAL_DNLAL_M (0x3FFFFFF<<6) /* Address Mask */
  1173. #define TSI148_LCSR_DNLAL_LLA (1<<0) /* Last Link Address Indicator */
  1174. /*
  1175. * DMA 2eSST Broadcast Select
  1176. */
  1177. #define TSI148_LCSR_DBS_M (0x1FFFFF<<0) /* Mask */
  1178. /*
  1179. * GCSR Register Group
  1180. */
  1181. /*
  1182. * GCSR Control and Status Register CRG + $604
  1183. */
  1184. #define TSI148_GCSR_GCTRL_LRST (1<<15) /* Local Reset */
  1185. #define TSI148_GCSR_GCTRL_SFAILEN (1<<14) /* System Fail enable */
  1186. #define TSI148_GCSR_GCTRL_BDFAILS (1<<13) /* Board Fail Status */
  1187. #define TSI148_GCSR_GCTRL_SCON (1<<12) /* System Copntroller */
  1188. #define TSI148_GCSR_GCTRL_MEN (1<<11) /* Module Enable (READY) */
  1189. #define TSI148_GCSR_GCTRL_LMI3S (1<<7) /* Loc Monitor 3 Int Status */
  1190. #define TSI148_GCSR_GCTRL_LMI2S (1<<6) /* Loc Monitor 2 Int Status */
  1191. #define TSI148_GCSR_GCTRL_LMI1S (1<<5) /* Loc Monitor 1 Int Status */
  1192. #define TSI148_GCSR_GCTRL_LMI0S (1<<4) /* Loc Monitor 0 Int Status */
  1193. #define TSI148_GCSR_GCTRL_MBI3S (1<<3) /* Mail box 3 Int Status */
  1194. #define TSI148_GCSR_GCTRL_MBI2S (1<<2) /* Mail box 2 Int Status */
  1195. #define TSI148_GCSR_GCTRL_MBI1S (1<<1) /* Mail box 1 Int Status */
  1196. #define TSI148_GCSR_GCTRL_MBI0S (1<<0) /* Mail box 0 Int Status */
  1197. #define TSI148_GCSR_GAP (1<<5) /* Geographic Addr Parity */
  1198. #define TSI148_GCSR_GA_M (0x1F<<0) /* Geographic Address Mask */
  1199. /*
  1200. * CR/CSR Register Group
  1201. */
  1202. /*
  1203. * CR/CSR Bit Clear Register CRG + $FF4
  1204. */
  1205. #define TSI148_CRCSR_CSRBCR_LRSTC (1<<7) /* Local Reset Clear */
  1206. #define TSI148_CRCSR_CSRBCR_SFAILC (1<<6) /* System Fail Enable Clear */
  1207. #define TSI148_CRCSR_CSRBCR_BDFAILS (1<<5) /* Board Fail Status */
  1208. #define TSI148_CRCSR_CSRBCR_MENC (1<<4) /* Module Enable Clear */
  1209. #define TSI148_CRCSR_CSRBCR_BERRSC (1<<3) /* Bus Error Status Clear */
  1210. /*
  1211. * CR/CSR Bit Set Register CRG+$FF8
  1212. */
  1213. #define TSI148_CRCSR_CSRBSR_LISTS (1<<7) /* Local Reset Clear */
  1214. #define TSI148_CRCSR_CSRBSR_SFAILS (1<<6) /* System Fail Enable Clear */
  1215. #define TSI148_CRCSR_CSRBSR_BDFAILS (1<<5) /* Board Fail Status */
  1216. #define TSI148_CRCSR_CSRBSR_MENS (1<<4) /* Module Enable Clear */
  1217. #define TSI148_CRCSR_CSRBSR_BERRS (1<<3) /* Bus Error Status Clear */
  1218. /*
  1219. * CR/CSR Base Address Register CRG + FFC
  1220. */
  1221. #define TSI148_CRCSR_CBAR_M (0x1F<<3) /* Mask */
  1222. #endif /* TSI148_H */